feat(plugin): pass sessionID and callID to shell.env hook input (#13662)
This commit is contained in:
@@ -1618,7 +1618,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the
|
|||||||
const args = matchingInvocation?.args
|
const args = matchingInvocation?.args
|
||||||
|
|
||||||
const cwd = Instance.directory
|
const cwd = Instance.directory
|
||||||
const shellEnv = await Plugin.trigger("shell.env", { cwd }, { env: {} })
|
const shellEnv = await Plugin.trigger("shell.env", { cwd, sessionID: input.sessionID, callID: part.callID }, { env: {} })
|
||||||
const proc = spawn(shell, args, {
|
const proc = spawn(shell, args, {
|
||||||
cwd,
|
cwd,
|
||||||
detached: process.platform !== "win32",
|
detached: process.platform !== "win32",
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ export const BashTool = Tool.define("bash", async () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const shellEnv = await Plugin.trigger("shell.env", { cwd }, { env: {} })
|
const shellEnv = await Plugin.trigger("shell.env", { cwd, sessionID: ctx.sessionID, callID: ctx.callID }, { env: {} })
|
||||||
const proc = spawn(params.command, {
|
const proc = spawn(params.command, {
|
||||||
shell,
|
shell,
|
||||||
cwd,
|
cwd,
|
||||||
|
|||||||
@@ -185,7 +185,10 @@ export interface Hooks {
|
|||||||
input: { tool: string; sessionID: string; callID: string },
|
input: { tool: string; sessionID: string; callID: string },
|
||||||
output: { args: any },
|
output: { args: any },
|
||||||
) => Promise<void>
|
) => Promise<void>
|
||||||
"shell.env"?: (input: { cwd: string }, output: { env: Record<string, string> }) => Promise<void>
|
"shell.env"?: (
|
||||||
|
input: { cwd: string; sessionID?: string; callID?: string },
|
||||||
|
output: { env: Record<string, string> },
|
||||||
|
) => Promise<void>
|
||||||
"tool.execute.after"?: (
|
"tool.execute.after"?: (
|
||||||
input: { tool: string; sessionID: string; callID: string; args: any },
|
input: { tool: string; sessionID: string; callID: string; args: any },
|
||||||
output: {
|
output: {
|
||||||
|
|||||||
Reference in New Issue
Block a user