INNER CODE UNIT · TypeScript
bashToolWithEnv
yvgude/lean-ctx · packages/pi-lean-ctx/extensions/index.ts:399
const bashToolWithEnv = (extra: Record<string, string>, raw: boolean, timeoutSecs?: number) =>
raw
? createBashToolDefinition(process.cwd(), {
shellPath,
// `raw` bypasses lean-ctx entirely but still spawns through the
// host's bash tool, so it needs the same name filter (#1799).
spawnHook: ({ command, cwd, env }) => ({
command,
cwd,
env: posixSafeEnv({ ...env, ...extra }),
}),
})
: createBashToolDefinition(process.cwd(), {
shellPath,
spawnHook: leanCtxSpawnHook(extra, timeoutSecs),
});
const bashSchemaWithRaw = Type.Object({