chore: generate
This commit is contained in:
@@ -200,9 +200,7 @@ function turn(index: number): Message[] {
|
|||||||
...(index % 8 === 0
|
...(index % 8 === 0
|
||||||
? [toolPart(index, 8, "apply_patch", { files: [`src/generated/patch-${index}.ts`] }, 620)]
|
? [toolPart(index, 8, "apply_patch", { files: [`src/generated/patch-${index}.ts`] }, 620)]
|
||||||
: []),
|
: []),
|
||||||
...(index % 7 === 0
|
...(index % 7 === 0 ? [toolPart(index, 4, "bash", { command: "bun typecheck" }, 620)] : []),
|
||||||
? [toolPart(index, 4, "bash", { command: "bun typecheck" }, 620)]
|
|
||||||
: []),
|
|
||||||
...(index % 10 === 0 ? [toolPart(index, 9, "webfetch", { url: "https://example.com/docs/sample" }, 120)] : []),
|
...(index % 10 === 0 ? [toolPart(index, 9, "webfetch", { url: "https://example.com/docs/sample" }, 120)] : []),
|
||||||
...(index % 11 === 0 ? [toolPart(index, 10, "websearch", { query: "sample movement notes" }, 240)] : []),
|
...(index % 11 === 0 ? [toolPart(index, 10, "websearch", { query: "sample movement notes" }, 240)] : []),
|
||||||
...(index % 13 === 0
|
...(index % 13 === 0
|
||||||
|
|||||||
@@ -260,11 +260,7 @@ const parse = Effect.fn("ShellTool.parse")(function* (command: string, ps: boole
|
|||||||
return tree
|
return tree
|
||||||
})
|
})
|
||||||
|
|
||||||
const ask = Effect.fn("ShellTool.ask")(function* (
|
const ask = Effect.fn("ShellTool.ask")(function* (ctx: Tool.Context, scan: Scan, input: { command: string }) {
|
||||||
ctx: Tool.Context,
|
|
||||||
scan: Scan,
|
|
||||||
input: { command: string },
|
|
||||||
) {
|
|
||||||
if (scan.dirs.size > 0) {
|
if (scan.dirs.size > 0) {
|
||||||
const directories = Array.from(scan.dirs)
|
const directories = Array.from(scan.dirs)
|
||||||
const globs = directories.map((dir) => {
|
const globs = directories.map((dir) => {
|
||||||
|
|||||||
@@ -973,12 +973,9 @@ describe("tool.shell permissions", () => {
|
|||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const err = new Error("stop after permission")
|
const err = new Error("stop after permission")
|
||||||
const requests: Array<Omit<PermissionV1.Request, "id" | "sessionID" | "tool">> = []
|
const requests: Array<Omit<PermissionV1.Request, "id" | "sessionID" | "tool">> = []
|
||||||
expect(
|
expect(yield* fail({ command: "echo test > output.txt" }, capture(requests, err))).toMatchObject({
|
||||||
yield* fail(
|
message: err.message,
|
||||||
{ command: "echo test > output.txt" },
|
})
|
||||||
capture(requests, err),
|
|
||||||
),
|
|
||||||
).toMatchObject({ message: err.message })
|
|
||||||
const bashReq = requests.find((r) => r.permission === "bash")
|
const bashReq = requests.find((r) => r.permission === "bash")
|
||||||
expect(bashReq).toBeDefined()
|
expect(bashReq).toBeDefined()
|
||||||
expect(bashReq!.patterns).toContain("echo test > output.txt")
|
expect(bashReq!.patterns).toContain("echo test > output.txt")
|
||||||
|
|||||||
@@ -2083,10 +2083,7 @@ function Shell(props: ToolProps) {
|
|||||||
onClick={collapsed().overflow ? () => setExpanded((prev) => !prev) : undefined}
|
onClick={collapsed().overflow ? () => setExpanded((prev) => !prev) : undefined}
|
||||||
>
|
>
|
||||||
<box gap={1}>
|
<box gap={1}>
|
||||||
<Show
|
<Show when={isRunning()} fallback={<text fg={theme.text}>$ {stringValue(props.input.command)}</text>}>
|
||||||
when={isRunning()}
|
|
||||||
fallback={<text fg={theme.text}>$ {stringValue(props.input.command)}</text>}
|
|
||||||
>
|
|
||||||
<Spinner color={theme.text}>{stringValue(props.input.command)}</Spinner>
|
<Spinner color={theme.text}>{stringValue(props.input.command)}</Spinner>
|
||||||
</Show>
|
</Show>
|
||||||
<Show when={output()}>
|
<Show when={output()}>
|
||||||
|
|||||||
Reference in New Issue
Block a user