TL;DR
Expand the shell.env plugin hook trigger in bash.ts to include messageID and agent in the context, so plugins know which message and agent triggered a bash command.
More detail
The Plugin.trigger("shell.env", ...) call in bash.ts currently passes minimal context. Plugins that need to set environment variables conditionally (e.g. only for agent-initiated commands, or per-message) have no way to know which message or agent triggered the shell invocation.
This change adds messageID and agent to the trigger context for the bash.ts call site only (the other call sites in prompt.ts and pty/index.ts are for user-initiated commands and are a separate concern).
Part of the plugin primitives work tracked in #20018 (split from #21687).
TL;DR
Expand the
shell.envplugin hook trigger inbash.tsto includemessageIDandagentin the context, so plugins know which message and agent triggered a bash command.More detail
The
Plugin.trigger("shell.env", ...)call inbash.tscurrently passes minimal context. Plugins that need to set environment variables conditionally (e.g. only for agent-initiated commands, or per-message) have no way to know which message or agent triggered the shell invocation.This change adds
messageIDandagentto the trigger context for thebash.tscall site only (the other call sites inprompt.tsandpty/index.tsare for user-initiated commands and are a separate concern).Part of the plugin primitives work tracked in #20018 (split from #21687).