Merge branch 'dev' into refactor-shells
This commit is contained in:
commit
73ee7ae702
6 changed files with 38 additions and 10 deletions
1
bun.lock
1
bun.lock
|
|
@ -451,6 +451,7 @@
|
||||||
"@typescript/native-preview": "catalog:",
|
"@typescript/native-preview": "catalog:",
|
||||||
"drizzle-kit": "catalog:",
|
"drizzle-kit": "catalog:",
|
||||||
"drizzle-orm": "catalog:",
|
"drizzle-orm": "catalog:",
|
||||||
|
"prettier": "3.6.2",
|
||||||
"typescript": "catalog:",
|
"typescript": "catalog:",
|
||||||
"vscode-languageserver-types": "3.17.5",
|
"vscode-languageserver-types": "3.17.5",
|
||||||
"why-is-node-running": "3.2.2",
|
"why-is-node-running": "3.2.2",
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"nodeModules": {
|
"nodeModules": {
|
||||||
"x86_64-linux": "sha256-+G3/s18NZO1Dpc5TsZyix2Npodzei25Svw3nTjfzXW8=",
|
"x86_64-linux": "sha256-V1Rt2k7ujkqGw4pDkn++WALTy1fAugvoKLhKvwFKkss=",
|
||||||
"aarch64-linux": "sha256-39HPencmRYRbyCk/cZIdPFk6ocY1AMlyuN9j25zAKzI=",
|
"aarch64-linux": "sha256-ho0AuGbJ1qw9Hvb3EbGC8f0lWqqgUslvda/wTe32MFo=",
|
||||||
"aarch64-darwin": "sha256-043korPEjSHKiZ3P+EfWyOfKpgOC7CBpviccviaDa0o=",
|
"aarch64-darwin": "sha256-hdUyNmp+snwtnBckHXsPMgNFUYS1sYDdngkk+AXVqzc=",
|
||||||
"x86_64-darwin": "sha256-vsZ7e//rL9e7Cl5kl/Xplvi1fqayljxTLwRSbxvCxeM="
|
"x86_64-darwin": "sha256-P57LpQNF8fplFKQBBIukhOKbIugbViyBUIUjClXohuk="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@
|
||||||
"@typescript/native-preview": "catalog:",
|
"@typescript/native-preview": "catalog:",
|
||||||
"drizzle-kit": "catalog:",
|
"drizzle-kit": "catalog:",
|
||||||
"drizzle-orm": "catalog:",
|
"drizzle-orm": "catalog:",
|
||||||
|
"prettier": "3.6.2",
|
||||||
"typescript": "catalog:",
|
"typescript": "catalog:",
|
||||||
"vscode-languageserver-types": "3.17.5",
|
"vscode-languageserver-types": "3.17.5",
|
||||||
"why-is-node-running": "3.2.2",
|
"why-is-node-running": "3.2.2",
|
||||||
|
|
|
||||||
|
|
@ -788,6 +788,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the
|
||||||
const shellName = (
|
const shellName = (
|
||||||
process.platform === "win32" ? path.win32.basename(sh, ".exe") : path.basename(sh)
|
process.platform === "win32" ? path.win32.basename(sh, ".exe") : path.basename(sh)
|
||||||
).toLowerCase()
|
).toLowerCase()
|
||||||
|
const cwd = ctx.directory
|
||||||
const invocations: Record<string, { args: string[] }> = {
|
const invocations: Record<string, { args: string[] }> = {
|
||||||
nu: { args: ["-c", input.command] },
|
nu: { args: ["-c", input.command] },
|
||||||
fish: { args: ["-c", input.command] },
|
fish: { args: ["-c", input.command] },
|
||||||
|
|
@ -796,12 +797,13 @@ NOTE: At any point in time through this workflow you should feel free to ask the
|
||||||
"-l",
|
"-l",
|
||||||
"-c",
|
"-c",
|
||||||
`
|
`
|
||||||
__oc_cwd=$PWD
|
|
||||||
[[ -f ~/.zshenv ]] && source ~/.zshenv >/dev/null 2>&1 || true
|
[[ -f ~/.zshenv ]] && source ~/.zshenv >/dev/null 2>&1 || true
|
||||||
[[ -f "\${ZDOTDIR:-$HOME}/.zshrc" ]] && source "\${ZDOTDIR:-$HOME}/.zshrc" >/dev/null 2>&1 || true
|
[[ -f "\${ZDOTDIR:-$HOME}/.zshrc" ]] && source "\${ZDOTDIR:-$HOME}/.zshrc" >/dev/null 2>&1 || true
|
||||||
cd "$__oc_cwd"
|
cd -- "$1"
|
||||||
eval ${JSON.stringify(input.command)}
|
eval ${JSON.stringify(input.command)}
|
||||||
`,
|
`,
|
||||||
|
"opencode",
|
||||||
|
cwd,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
bash: {
|
bash: {
|
||||||
|
|
@ -809,12 +811,13 @@ NOTE: At any point in time through this workflow you should feel free to ask the
|
||||||
"-l",
|
"-l",
|
||||||
"-c",
|
"-c",
|
||||||
`
|
`
|
||||||
__oc_cwd=$PWD
|
|
||||||
shopt -s expand_aliases
|
shopt -s expand_aliases
|
||||||
[[ -f ~/.bashrc ]] && source ~/.bashrc >/dev/null 2>&1 || true
|
[[ -f ~/.bashrc ]] && source ~/.bashrc >/dev/null 2>&1 || true
|
||||||
cd "$__oc_cwd"
|
cd -- "$1"
|
||||||
eval ${JSON.stringify(input.command)}
|
eval ${JSON.stringify(input.command)}
|
||||||
`,
|
`,
|
||||||
|
"opencode",
|
||||||
|
cwd,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
cmd: { args: ["/c", input.command] },
|
cmd: { args: ["/c", input.command] },
|
||||||
|
|
@ -824,7 +827,6 @@ NOTE: At any point in time through this workflow you should feel free to ask the
|
||||||
}
|
}
|
||||||
|
|
||||||
const args = (invocations[shellName] ?? invocations[""]).args
|
const args = (invocations[shellName] ?? invocations[""]).args
|
||||||
const cwd = ctx.directory
|
|
||||||
const shellEnv = yield* plugin.trigger(
|
const shellEnv = yield* plugin.trigger(
|
||||||
"shell.env",
|
"shell.env",
|
||||||
{ cwd, sessionID: input.sessionID, callID: part.callID },
|
{ cwd, sessionID: input.sessionID, callID: part.callID },
|
||||||
|
|
|
||||||
|
|
@ -1078,6 +1078,30 @@ unix("shell completes a fast command on the preferred shell", () =>
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
unix("shell commands can change directory after startup", () =>
|
||||||
|
provideTmpdirInstance(
|
||||||
|
(dir) =>
|
||||||
|
Effect.gen(function* () {
|
||||||
|
const { prompt, run, chat } = yield* boot()
|
||||||
|
const parent = path.dirname(dir)
|
||||||
|
const result = yield* prompt.shell({
|
||||||
|
sessionID: chat.id,
|
||||||
|
agent: "build",
|
||||||
|
command: "cd .. && pwd",
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(result.info.role).toBe("assistant")
|
||||||
|
const tool = completedTool(result.parts)
|
||||||
|
if (!tool) return
|
||||||
|
|
||||||
|
expect(tool.state.output).toContain(parent)
|
||||||
|
expect(tool.state.metadata.output).toContain(parent)
|
||||||
|
yield* run.assertNotBusy(chat.id)
|
||||||
|
}),
|
||||||
|
{ git: true, config: cfg },
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
unix("shell lists files from the project directory", () =>
|
unix("shell lists files from the project directory", () =>
|
||||||
provideTmpdirInstance(
|
provideTmpdirInstance(
|
||||||
(dir) =>
|
(dir) =>
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ async function close(num: number) {
|
||||||
const patch = await fetch(base, {
|
const patch = await fetch(base, {
|
||||||
method: "PATCH",
|
method: "PATCH",
|
||||||
headers,
|
headers,
|
||||||
body: JSON.stringify({ state: "closed", state_reason: "completed" }),
|
body: JSON.stringify({ state: "closed", state_reason: "not_planned" }),
|
||||||
})
|
})
|
||||||
if (!patch.ok) throw new Error(`Failed to close #${num}: ${patch.status} ${patch.statusText}`)
|
if (!patch.ok) throw new Error(`Failed to close #${num}: ${patch.status} ${patch.statusText}`)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue