@namzu/sdk 51.1.0 → 52.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +119 -0
- package/dist/agents/QueryAgent.d.ts.map +1 -1
- package/dist/agents/QueryAgent.js +2 -0
- package/dist/agents/QueryAgent.js.map +1 -1
- package/dist/agents/SupervisorAgent.d.ts +1 -1
- package/dist/agents/SupervisorAgent.d.ts.map +1 -1
- package/dist/agents/SupervisorAgent.js.map +1 -1
- package/dist/agents/examples/SupervisorAgent.d.ts +42 -0
- package/dist/agents/examples/SupervisorAgent.d.ts.map +1 -1
- package/dist/agents/examples/SupervisorAgent.js +80 -4
- package/dist/agents/examples/SupervisorAgent.js.map +1 -1
- package/dist/agents/index.d.ts +1 -1
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js.map +1 -1
- package/dist/authorization/protected-paths.d.ts +36 -0
- package/dist/authorization/protected-paths.d.ts.map +1 -0
- package/dist/authorization/protected-paths.js +107 -0
- package/dist/authorization/protected-paths.js.map +1 -0
- package/dist/authorization/readonly-commands.d.ts +39 -0
- package/dist/authorization/readonly-commands.d.ts.map +1 -0
- package/dist/authorization/readonly-commands.js +797 -0
- package/dist/authorization/readonly-commands.js.map +1 -0
- package/dist/authorization/readonly-flags.d.ts +19 -0
- package/dist/authorization/readonly-flags.d.ts.map +1 -0
- package/dist/authorization/readonly-flags.js +178 -0
- package/dist/authorization/readonly-flags.js.map +1 -0
- package/dist/authorization/removal.d.ts +52 -0
- package/dist/authorization/removal.d.ts.map +1 -0
- package/dist/authorization/removal.js +283 -0
- package/dist/authorization/removal.js.map +1 -0
- package/dist/authorization/shell-paths.d.ts +66 -0
- package/dist/authorization/shell-paths.d.ts.map +1 -0
- package/dist/authorization/shell-paths.js +697 -0
- package/dist/authorization/shell-paths.js.map +1 -0
- package/dist/bridge/acp/update.d.ts.map +1 -1
- package/dist/bridge/acp/update.js +1 -0
- package/dist/bridge/acp/update.js.map +1 -1
- package/dist/compaction/context-window.d.ts +24 -0
- package/dist/compaction/context-window.d.ts.map +1 -1
- package/dist/compaction/context-window.js +34 -0
- package/dist/compaction/context-window.js.map +1 -1
- package/dist/compaction/manual.d.ts.map +1 -1
- package/dist/compaction/manual.js +10 -2
- package/dist/compaction/manual.js.map +1 -1
- package/dist/compaction/plan.d.ts +4 -0
- package/dist/compaction/plan.d.ts.map +1 -1
- package/dist/compaction/plan.js +6 -2
- package/dist/compaction/plan.js.map +1 -1
- package/dist/compaction/verifier.d.ts +11 -1
- package/dist/compaction/verifier.d.ts.map +1 -1
- package/dist/compaction/verifier.js +75 -23
- package/dist/compaction/verifier.js.map +1 -1
- package/dist/config/runtime.d.ts +55 -7
- package/dist/config/runtime.d.ts.map +1 -1
- package/dist/config/runtime.js +23 -2
- package/dist/config/runtime.js.map +1 -1
- package/dist/connector/web/guarded-fetch.d.ts.map +1 -1
- package/dist/connector/web/guarded-fetch.js +24 -0
- package/dist/connector/web/guarded-fetch.js.map +1 -1
- package/dist/connector/web/index.d.ts +1 -1
- package/dist/connector/web/index.d.ts.map +1 -1
- package/dist/connector/web/page.d.ts +59 -0
- package/dist/connector/web/page.d.ts.map +1 -0
- package/dist/connector/web/page.js +112 -0
- package/dist/connector/web/page.js.map +1 -0
- package/dist/connector/web/types.d.ts +47 -0
- package/dist/connector/web/types.d.ts.map +1 -1
- package/dist/connector/web/types.js.map +1 -1
- package/dist/constants/continuation.d.ts +8 -0
- package/dist/constants/continuation.d.ts.map +1 -1
- package/dist/constants/continuation.js +8 -0
- package/dist/constants/continuation.js.map +1 -1
- package/dist/constants/plugin/index.d.ts +1 -1
- package/dist/constants/plugin/index.d.ts.map +1 -1
- package/dist/constants/plugin/index.js +1 -1
- package/dist/constants/plugin/index.js.map +1 -1
- package/dist/contracts/a2a.d.ts +2 -2
- package/dist/manager/agent/lifecycle.d.ts +7 -0
- package/dist/manager/agent/lifecycle.d.ts.map +1 -1
- package/dist/manager/agent/lifecycle.js +11 -2
- package/dist/manager/agent/lifecycle.js.map +1 -1
- package/dist/manager/session/turn-recorder.d.ts.map +1 -1
- package/dist/manager/session/turn-recorder.js +4 -2
- package/dist/manager/session/turn-recorder.js.map +1 -1
- package/dist/plugin/index.d.ts +1 -1
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js +1 -1
- package/dist/plugin/index.js.map +1 -1
- package/dist/plugin/lifecycle.d.ts +6 -0
- package/dist/plugin/lifecycle.d.ts.map +1 -1
- package/dist/plugin/lifecycle.js +98 -114
- package/dist/plugin/lifecycle.js.map +1 -1
- package/dist/plugin/shell-hook.d.ts +90 -22
- package/dist/plugin/shell-hook.d.ts.map +1 -1
- package/dist/plugin/shell-hook.js +434 -41
- package/dist/plugin/shell-hook.js.map +1 -1
- package/dist/provider/capabilities.d.ts +9 -0
- package/dist/provider/capabilities.d.ts.map +1 -1
- package/dist/provider/capabilities.js +15 -0
- package/dist/provider/capabilities.js.map +1 -1
- package/dist/provider/errors.d.ts.map +1 -1
- package/dist/provider/errors.js +13 -0
- package/dist/provider/errors.js.map +1 -1
- package/dist/provider/fallback.d.ts.map +1 -1
- package/dist/provider/fallback.js +10 -0
- package/dist/provider/fallback.js.map +1 -1
- package/dist/provider/idle-timeout.d.ts.map +1 -1
- package/dist/provider/idle-timeout.js +5 -0
- package/dist/provider/idle-timeout.js.map +1 -1
- package/dist/provider/image-input-refusal.d.ts +9 -0
- package/dist/provider/image-input-refusal.d.ts.map +1 -0
- package/dist/provider/image-input-refusal.js +54 -0
- package/dist/provider/image-input-refusal.js.map +1 -0
- package/dist/provider/index.d.ts +2 -1
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +2 -1
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/retry.d.ts +7 -2
- package/dist/provider/retry.d.ts.map +1 -1
- package/dist/provider/retry.js +38 -4
- package/dist/provider/retry.js.map +1 -1
- package/dist/public-runtime.d.ts +5 -2
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +5 -2
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-types.d.ts +2 -2
- package/dist/public-types.d.ts.map +1 -1
- package/dist/runtime/jobs/registry.d.ts +21 -0
- package/dist/runtime/jobs/registry.d.ts.map +1 -1
- package/dist/runtime/jobs/registry.js +15 -2
- package/dist/runtime/jobs/registry.js.map +1 -1
- package/dist/runtime/query/deferred-sandbox.d.ts +54 -0
- package/dist/runtime/query/deferred-sandbox.d.ts.map +1 -0
- package/dist/runtime/query/deferred-sandbox.js +75 -0
- package/dist/runtime/query/deferred-sandbox.js.map +1 -0
- package/dist/runtime/query/executor/tool-call-admission.d.ts +10 -0
- package/dist/runtime/query/executor/tool-call-admission.d.ts.map +1 -1
- package/dist/runtime/query/executor/tool-call-admission.js +74 -13
- package/dist/runtime/query/executor/tool-call-admission.js.map +1 -1
- package/dist/runtime/query/executor.d.ts +51 -2
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +214 -9
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/finalize-turn.d.ts +6 -0
- package/dist/runtime/query/finalize-turn.d.ts.map +1 -1
- package/dist/runtime/query/finalize-turn.js +1 -1
- package/dist/runtime/query/finalize-turn.js.map +1 -1
- package/dist/runtime/query/index.d.ts +29 -0
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +108 -28
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/iteration/index.d.ts +57 -0
- package/dist/runtime/query/iteration/index.d.ts.map +1 -1
- package/dist/runtime/query/iteration/index.js +380 -28
- package/dist/runtime/query/iteration/index.js.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction-breaker.d.ts +61 -0
- package/dist/runtime/query/iteration/phases/compaction-breaker.d.ts.map +1 -0
- package/dist/runtime/query/iteration/phases/compaction-breaker.js +94 -0
- package/dist/runtime/query/iteration/phases/compaction-breaker.js.map +1 -0
- package/dist/runtime/query/iteration/phases/compaction.d.ts +42 -1
- package/dist/runtime/query/iteration/phases/compaction.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction.js +203 -23
- package/dist/runtime/query/iteration/phases/compaction.js.map +1 -1
- package/dist/runtime/query/iteration/phases/context.d.ts +10 -0
- package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/context.js.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.js +165 -2
- package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
- package/dist/runtime/query/iteration/provider-rejected-image.d.ts +21 -1
- package/dist/runtime/query/iteration/provider-rejected-image.d.ts.map +1 -1
- package/dist/runtime/query/iteration/provider-rejected-image.js +53 -7
- package/dist/runtime/query/iteration/provider-rejected-image.js.map +1 -1
- package/dist/runtime/query/iteration/request-repair.d.ts +108 -0
- package/dist/runtime/query/iteration/request-repair.d.ts.map +1 -0
- package/dist/runtime/query/iteration/request-repair.js +593 -0
- package/dist/runtime/query/iteration/request-repair.js.map +1 -0
- package/dist/runtime/query/iteration/stream-turn.d.ts +6 -0
- package/dist/runtime/query/iteration/stream-turn.d.ts.map +1 -1
- package/dist/runtime/query/iteration/stream-turn.js +2 -2
- package/dist/runtime/query/iteration/stream-turn.js.map +1 -1
- package/dist/runtime/query/path-escalation.d.ts +36 -0
- package/dist/runtime/query/path-escalation.d.ts.map +1 -0
- package/dist/runtime/query/path-escalation.js +184 -0
- package/dist/runtime/query/path-escalation.js.map +1 -0
- package/dist/runtime/query/plugin-hooks.d.ts.map +1 -1
- package/dist/runtime/query/plugin-hooks.js +8 -0
- package/dist/runtime/query/plugin-hooks.js.map +1 -1
- package/dist/runtime/query/reminders.d.ts +35 -0
- package/dist/runtime/query/reminders.d.ts.map +1 -0
- package/dist/runtime/query/reminders.js +7 -0
- package/dist/runtime/query/reminders.js.map +1 -0
- package/dist/runtime/query/request-rich-content.d.ts +5 -1
- package/dist/runtime/query/request-rich-content.d.ts.map +1 -1
- package/dist/runtime/query/request-rich-content.js +67 -25
- package/dist/runtime/query/request-rich-content.js.map +1 -1
- package/dist/runtime/query/resume-pending.d.ts.map +1 -1
- package/dist/runtime/query/resume-pending.js +26 -0
- package/dist/runtime/query/resume-pending.js.map +1 -1
- package/dist/runtime/query/review-policy.d.ts +26 -0
- package/dist/runtime/query/review-policy.d.ts.map +1 -1
- package/dist/runtime/query/review-policy.js +79 -5
- package/dist/runtime/query/review-policy.js.map +1 -1
- package/dist/runtime/query/tool-output-budget.d.ts +46 -0
- package/dist/runtime/query/tool-output-budget.d.ts.map +1 -1
- package/dist/runtime/query/tool-output-budget.js +85 -1
- package/dist/runtime/query/tool-output-budget.js.map +1 -1
- package/dist/runtime/query/tooling.d.ts +1 -0
- package/dist/runtime/query/tooling.d.ts.map +1 -1
- package/dist/runtime/query/tooling.js +5 -0
- package/dist/runtime/query/tooling.js.map +1 -1
- package/dist/session/paths.d.ts +5 -1
- package/dist/session/paths.d.ts.map +1 -1
- package/dist/session/paths.js +8 -0
- package/dist/session/paths.js.map +1 -1
- package/dist/store/memory/disk.d.ts.map +1 -1
- package/dist/store/memory/disk.js +2 -2
- package/dist/store/memory/disk.js.map +1 -1
- package/dist/store/memory/markdown.d.ts.map +1 -1
- package/dist/store/memory/markdown.js +2 -2
- package/dist/store/memory/markdown.js.map +1 -1
- package/dist/store/memory/naming.d.ts +9 -0
- package/dist/store/memory/naming.d.ts.map +1 -1
- package/dist/store/memory/naming.js +12 -0
- package/dist/store/memory/naming.js.map +1 -1
- package/dist/tools/builtins/bash.d.ts +30 -1
- package/dist/tools/builtins/bash.d.ts.map +1 -1
- package/dist/tools/builtins/bash.js +170 -26
- package/dist/tools/builtins/bash.js.map +1 -1
- package/dist/tools/builtins/computer-use.d.ts +1 -1
- package/dist/tools/builtins/computer-use.d.ts.map +1 -1
- package/dist/tools/builtins/computer-use.js +12 -5
- package/dist/tools/builtins/computer-use.js.map +1 -1
- package/dist/tools/builtins/content-fingerprint.d.ts +2 -0
- package/dist/tools/builtins/content-fingerprint.d.ts.map +1 -1
- package/dist/tools/builtins/content-fingerprint.js +4 -0
- package/dist/tools/builtins/content-fingerprint.js.map +1 -1
- package/dist/tools/builtins/edit.d.ts.map +1 -1
- package/dist/tools/builtins/edit.js +60 -18
- package/dist/tools/builtins/edit.js.map +1 -1
- package/dist/tools/builtins/grep.d.ts +8 -1
- package/dist/tools/builtins/grep.d.ts.map +1 -1
- package/dist/tools/builtins/grep.js +152 -33
- package/dist/tools/builtins/grep.js.map +1 -1
- package/dist/tools/builtins/read-file.d.ts +1 -0
- package/dist/tools/builtins/read-file.d.ts.map +1 -1
- package/dist/tools/builtins/read-file.js +44 -5
- package/dist/tools/builtins/read-file.js.map +1 -1
- package/dist/tools/builtins/read-render.d.ts +52 -0
- package/dist/tools/builtins/read-render.d.ts.map +1 -1
- package/dist/tools/builtins/read-render.js +143 -0
- package/dist/tools/builtins/read-render.js.map +1 -1
- package/dist/tools/builtins/web.d.ts +13 -2
- package/dist/tools/builtins/web.d.ts.map +1 -1
- package/dist/tools/builtins/web.js +225 -32
- package/dist/tools/builtins/web.js.map +1 -1
- package/dist/tools/coordinator/ask-user-question.d.ts +2 -0
- package/dist/tools/coordinator/ask-user-question.d.ts.map +1 -1
- package/dist/tools/coordinator/ask-user-question.js +256 -92
- package/dist/tools/coordinator/ask-user-question.js.map +1 -1
- package/dist/tools/coordinator/question-options.d.ts +1 -0
- package/dist/tools/coordinator/question-options.d.ts.map +1 -1
- package/dist/tools/coordinator/question-options.js +6 -1
- package/dist/tools/coordinator/question-options.js.map +1 -1
- package/dist/tools/defineTool.d.ts +4 -1
- package/dist/tools/defineTool.d.ts.map +1 -1
- package/dist/tools/defineTool.js +6 -1
- package/dist/tools/defineTool.js.map +1 -1
- package/dist/tools/paths.d.ts +6 -0
- package/dist/tools/paths.d.ts.map +1 -1
- package/dist/tools/paths.js +1 -1
- package/dist/tools/paths.js.map +1 -1
- package/dist/types/agent/query.d.ts +3 -0
- package/dist/types/agent/query.d.ts.map +1 -1
- package/dist/types/errors/catalog.js +1 -1
- package/dist/types/errors/catalog.js.map +1 -1
- package/dist/types/hitl/index.d.ts +104 -0
- package/dist/types/hitl/index.d.ts.map +1 -1
- package/dist/types/hitl/index.js.map +1 -1
- package/dist/types/message/index.d.ts +1 -1
- package/dist/types/message/index.d.ts.map +1 -1
- package/dist/types/message/index.js +2 -0
- package/dist/types/message/index.js.map +1 -1
- package/dist/types/plugin/index.d.ts +93 -19
- package/dist/types/plugin/index.d.ts.map +1 -1
- package/dist/types/plugin/index.js +3 -0
- package/dist/types/plugin/index.js.map +1 -1
- package/dist/types/provider/errors.d.ts +19 -0
- package/dist/types/provider/errors.d.ts.map +1 -1
- package/dist/types/provider/errors.js +54 -5
- package/dist/types/provider/errors.js.map +1 -1
- package/dist/types/provider/interface.d.ts +12 -0
- package/dist/types/provider/interface.d.ts.map +1 -1
- package/dist/types/provider/stream.d.ts +1 -1
- package/dist/types/session/config.d.ts +14 -0
- package/dist/types/session/config.d.ts.map +1 -1
- package/dist/types/session/events.d.ts +27 -4
- package/dist/types/session/events.d.ts.map +1 -1
- package/dist/types/session/events.js.map +1 -1
- package/dist/types/session/records.d.ts +9 -9
- package/dist/types/session/records.d.ts.map +1 -1
- package/dist/types/session/records.js +1 -0
- package/dist/types/session/records.js.map +1 -1
- package/dist/types/session/stop-reason.d.ts +5 -0
- package/dist/types/session/stop-reason.d.ts.map +1 -1
- package/dist/types/tool/index.d.ts +52 -0
- package/dist/types/tool/index.d.ts.map +1 -1
- package/dist/types/tool/index.js.map +1 -1
- package/package.json +4 -2
- package/src/agents/QueryAgent.ts +5 -1
- package/src/agents/SupervisorAgent.ts +1 -1
- package/src/agents/examples/SupervisorAgent.ts +217 -106
- package/src/agents/index.ts +1 -1
- package/src/authorization/protected-paths.ts +110 -0
- package/src/authorization/readonly-commands.ts +771 -0
- package/src/authorization/readonly-flags.ts +196 -0
- package/src/authorization/removal.ts +326 -0
- package/src/authorization/shell-paths.ts +927 -0
- package/src/bridge/acp/update.ts +1 -0
- package/src/compaction/context-window.ts +41 -0
- package/src/compaction/manual.ts +10 -2
- package/src/compaction/plan.ts +11 -2
- package/src/compaction/verifier.ts +84 -22
- package/src/config/runtime.ts +23 -2
- package/src/connector/web/guarded-fetch.ts +26 -0
- package/src/connector/web/index.ts +3 -0
- package/src/connector/web/page.ts +130 -0
- package/src/connector/web/types.ts +47 -0
- package/src/constants/continuation.ts +10 -0
- package/src/constants/plugin/index.ts +1 -1
- package/src/manager/agent/lifecycle.ts +12 -4
- package/src/manager/session/turn-recorder.ts +10 -2
- package/src/plugin/index.ts +1 -0
- package/src/plugin/lifecycle.ts +107 -119
- package/src/plugin/shell-hook.ts +477 -43
- package/src/provider/capabilities.ts +17 -0
- package/src/provider/errors.ts +13 -0
- package/src/provider/fallback.ts +10 -0
- package/src/provider/idle-timeout.ts +5 -0
- package/src/provider/image-input-refusal.ts +54 -0
- package/src/provider/index.ts +2 -0
- package/src/provider/retry.ts +42 -4
- package/src/public-runtime.ts +11 -0
- package/src/public-types.ts +4 -0
- package/src/runtime/jobs/registry.ts +39 -2
- package/src/runtime/query/deferred-sandbox.ts +110 -0
- package/src/runtime/query/executor/tool-call-admission.ts +79 -13
- package/src/runtime/query/executor.ts +267 -11
- package/src/runtime/query/finalize-turn.ts +7 -1
- package/src/runtime/query/index.ts +169 -52
- package/src/runtime/query/iteration/index.ts +439 -35
- package/src/runtime/query/iteration/phases/compaction-breaker.ts +108 -0
- package/src/runtime/query/iteration/phases/compaction.ts +241 -38
- package/src/runtime/query/iteration/phases/context.ts +11 -0
- package/src/runtime/query/iteration/phases/tool-review.ts +177 -2
- package/src/runtime/query/iteration/provider-rejected-image.ts +71 -5
- package/src/runtime/query/iteration/request-repair.ts +743 -0
- package/src/runtime/query/iteration/stream-turn.ts +11 -1
- package/src/runtime/query/path-escalation.ts +204 -0
- package/src/runtime/query/plugin-hooks.ts +8 -0
- package/src/runtime/query/reminders.ts +45 -0
- package/src/runtime/query/request-rich-content.ts +77 -27
- package/src/runtime/query/resume-pending.ts +27 -0
- package/src/runtime/query/review-policy.ts +106 -5
- package/src/runtime/query/tool-output-budget.ts +115 -1
- package/src/runtime/query/tooling.ts +6 -0
- package/src/session/paths.ts +11 -1
- package/src/store/memory/disk.ts +2 -1
- package/src/store/memory/markdown.ts +2 -1
- package/src/store/memory/naming.ts +13 -0
- package/src/tools/builtins/bash.ts +203 -34
- package/src/tools/builtins/computer-use.ts +13 -4
- package/src/tools/builtins/content-fingerprint.ts +5 -0
- package/src/tools/builtins/edit.ts +69 -19
- package/src/tools/builtins/grep.ts +159 -38
- package/src/tools/builtins/read-file.ts +48 -5
- package/src/tools/builtins/read-render.ts +193 -0
- package/src/tools/builtins/web.ts +258 -33
- package/src/tools/coordinator/ask-user-question.ts +309 -103
- package/src/tools/coordinator/question-options.ts +8 -1
- package/src/tools/defineTool.ts +11 -2
- package/src/tools/paths.ts +1 -1
- package/src/types/agent/query.ts +3 -0
- package/src/types/errors/catalog.ts +1 -1
- package/src/types/hitl/index.ts +104 -0
- package/src/types/message/index.ts +2 -0
- package/src/types/plugin/index.ts +101 -18
- package/src/types/provider/errors.ts +66 -5
- package/src/types/provider/interface.ts +13 -0
- package/src/types/provider/stream.ts +1 -1
- package/src/types/session/config.ts +14 -0
- package/src/types/session/events.ts +32 -4
- package/src/types/session/records.ts +1 -0
- package/src/types/session/stop-reason.ts +5 -0
- package/src/types/tool/index.ts +53 -2
|
@@ -20,13 +20,24 @@ import { generateToolCallId } from '../../utils/id.js';
|
|
|
20
20
|
import { compressShellOutput } from '../../utils/shell-compress.js';
|
|
21
21
|
import { parseStructuredResultJson } from '../../utils/structured-result-json.js';
|
|
22
22
|
import { bindOwner } from '../jobs/registry.js';
|
|
23
|
-
import { formatFailedToolOutput, isUnregistered, prepareDirectCall, runPreToolHook, unknownToolMessage, } from './executor/tool-call-admission.js';
|
|
23
|
+
import { formatFailedToolOutput, hookNote, isUnregistered, prepareDirectCall, runPreToolHook, unknownToolMessage, } from './executor/tool-call-admission.js';
|
|
24
24
|
import { describeVisibleFileEvidence } from './file-evidence-context.js';
|
|
25
25
|
import { seedObservationLedger } from './file-evidence-seed.js';
|
|
26
26
|
import { DEFAULT_TOOL_RESULT_GUARDRAILS } from './guardrail-presets.js';
|
|
27
|
+
import { declaredWriteEscalation, shellEscalations } from './path-escalation.js';
|
|
27
28
|
import { savedPresentation } from './saved-presentation.js';
|
|
28
29
|
import { ToolCallBudget, assertMaxToolCalls } from './tool-call-budget.js';
|
|
29
|
-
import { DEFAULT_MAX_TOOL_OUTPUT_CHARS, applyToolOutputBudget, describeDroppedContent, measureContentBytes, } from './tool-output-budget.js';
|
|
30
|
+
import { DEFAULT_MAX_TOOL_OUTPUT_CHARS, DEFAULT_MAX_TOOL_OUTPUT_CHARS_PER_MESSAGE, applyToolOutputBudget, describeDroppedContent, fitResultsToMessageBudget, measureContentBytes, } from './tool-output-budget.js';
|
|
31
|
+
/**
|
|
32
|
+
* A nested call cannot open a review from inside the tool that issued it, so
|
|
33
|
+
* a hook that asked for a person to approve it can only be answered with a
|
|
34
|
+
* refusal. Silence would run the call the hook wanted a person to see.
|
|
35
|
+
*/
|
|
36
|
+
function askedNestedMessage(toolName, outcome) {
|
|
37
|
+
if (outcome.kind !== 'continue' || outcome.permission?.decision !== 'ask')
|
|
38
|
+
return undefined;
|
|
39
|
+
return `Blocked: a hook asked that a person approve "${toolName}", and an approval cannot be requested from inside another tool. Call it directly.`;
|
|
40
|
+
}
|
|
30
41
|
function assertUniqueToolCallIds(toolCalls) {
|
|
31
42
|
const seen = new Set();
|
|
32
43
|
for (const [index, toolCall] of toolCalls.entries()) {
|
|
@@ -226,6 +237,7 @@ export class ToolExecutor {
|
|
|
226
237
|
/** Set per turn by the orchestrator; see {@link setStepAllowedTools}. */
|
|
227
238
|
stepAllowedTools;
|
|
228
239
|
fileReadTracker;
|
|
240
|
+
sandboxGate;
|
|
229
241
|
/** A ledger is rebuilt from history at most once; a second pass would re-append its chains. */
|
|
230
242
|
fileObservationsSeeded = false;
|
|
231
243
|
constructor(config, activityStore, emitEvent, log, probes = defaultProbeRegistry) {
|
|
@@ -245,6 +257,22 @@ export class ToolExecutor {
|
|
|
245
257
|
}
|
|
246
258
|
setSandbox(sandbox) {
|
|
247
259
|
this.config = { ...this.config, sandbox };
|
|
260
|
+
this.sandboxGate = undefined;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Hold tool admission until a sandbox that is still being acquired exists.
|
|
264
|
+
* The gate rejects when none will, and the turn settles that rejection. It
|
|
265
|
+
* is cleared by {@link setSandbox}, so a turn pays the check once.
|
|
266
|
+
*/
|
|
267
|
+
setSandboxGate(gate) {
|
|
268
|
+
this.sandboxGate = gate;
|
|
269
|
+
}
|
|
270
|
+
async awaitSandbox() {
|
|
271
|
+
await this.sandboxGate?.();
|
|
272
|
+
}
|
|
273
|
+
/** True once the turn has a sandbox, or is certain to get one before a tool runs. */
|
|
274
|
+
get sandboxed() {
|
|
275
|
+
return this.config.sandbox !== undefined || this.sandboxGate !== undefined;
|
|
248
276
|
}
|
|
249
277
|
/** Classify only the exact successful result executed by this executor. */
|
|
250
278
|
recordedObservationKey(call, message) {
|
|
@@ -318,7 +346,7 @@ export class ToolExecutor {
|
|
|
318
346
|
}
|
|
319
347
|
/** Request-only evidence from the same ledger used by mutation admission. No filesystem I/O. */
|
|
320
348
|
describeFileEvidence(messages) {
|
|
321
|
-
return describeVisibleFileEvidence(messages, this.fileReadTracker, this.config.workingDirectory, this.
|
|
349
|
+
return describeVisibleFileEvidence(messages, this.fileReadTracker, this.config.workingDirectory, this.sandboxed);
|
|
322
350
|
}
|
|
323
351
|
/**
|
|
324
352
|
* Span that this executor's tool spans should hang off — the current
|
|
@@ -480,7 +508,7 @@ export class ToolExecutor {
|
|
|
480
508
|
commandDialect(toolName) {
|
|
481
509
|
const tool = this.config.tools.get(toolName);
|
|
482
510
|
return (tool?.commandDialect?.({
|
|
483
|
-
sandboxed: this.
|
|
511
|
+
sandboxed: this.sandboxed,
|
|
484
512
|
}) ?? 'sh');
|
|
485
513
|
}
|
|
486
514
|
/**
|
|
@@ -500,6 +528,8 @@ export class ToolExecutor {
|
|
|
500
528
|
*/
|
|
501
529
|
async prepareBatchForReview(response, hostModifiedCallIds) {
|
|
502
530
|
assertUniqueToolCallIds(response.message.toolCalls ?? []);
|
|
531
|
+
if ((response.message.toolCalls ?? []).length > 0)
|
|
532
|
+
await this.awaitSandbox();
|
|
503
533
|
const calls = new Map();
|
|
504
534
|
const escalations = new Map();
|
|
505
535
|
for (const toolCall of response.message.toolCalls ?? []) {
|
|
@@ -531,7 +561,7 @@ export class ToolExecutor {
|
|
|
531
561
|
if (!tool || call.input === null || typeof call.input !== 'object')
|
|
532
562
|
return undefined;
|
|
533
563
|
const input = call.input;
|
|
534
|
-
const sandboxed = this.
|
|
564
|
+
const sandboxed = this.sandboxed;
|
|
535
565
|
let outsidePaths;
|
|
536
566
|
if (this.config.outsideRootAccess === 'review' &&
|
|
537
567
|
!sandboxed &&
|
|
@@ -548,12 +578,67 @@ export class ToolExecutor {
|
|
|
548
578
|
tool.sandboxEscapeArgument !== undefined &&
|
|
549
579
|
input[tool.sandboxEscapeArgument] === true;
|
|
550
580
|
const unknownProgram = this.unknownProgramOf(tool, input, sandboxed);
|
|
551
|
-
|
|
581
|
+
const reaches = await this.pathEscalationsOf(tool, input, sandboxed);
|
|
582
|
+
if (reaches.outsidePaths.length > 0) {
|
|
583
|
+
outsidePaths = [...new Set([...(outsidePaths ?? []), ...reaches.outsidePaths])];
|
|
584
|
+
}
|
|
585
|
+
const protectedPaths = reaches.protectedPaths;
|
|
586
|
+
const removal = reaches.dangerousRemoval;
|
|
587
|
+
if (!outsidePaths &&
|
|
588
|
+
!sandboxEscape &&
|
|
589
|
+
unknownProgram === undefined &&
|
|
590
|
+
protectedPaths.length === 0 &&
|
|
591
|
+
removal === undefined) {
|
|
552
592
|
return undefined;
|
|
593
|
+
}
|
|
553
594
|
return {
|
|
554
595
|
...(outsidePaths ? { outsidePaths } : {}),
|
|
555
596
|
...(sandboxEscape ? { sandboxEscape: true } : {}),
|
|
556
597
|
...(unknownProgram !== undefined ? { unknownProgram } : {}),
|
|
598
|
+
...(protectedPaths.length > 0 ? { protectedPaths } : {}),
|
|
599
|
+
...(removal !== undefined ? { dangerousRemoval: removal } : {}),
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* What the call's own arguments write or remove that no mode may approve in
|
|
604
|
+
* advance, and, for a shell line, the paths outside the roots it names.
|
|
605
|
+
*
|
|
606
|
+
* The protected-path and removal floors hold whether or not the turn reviews
|
|
607
|
+
* outside paths and whether or not it is sandboxed: they are about what the
|
|
608
|
+
* write plants and what the removal destroys, not about where the turn is
|
|
609
|
+
* allowed to look. The outside-path half follows `outsideRootAccess`, as the
|
|
610
|
+
* file tools' own does.
|
|
611
|
+
*/
|
|
612
|
+
async pathEscalationsOf(tool, input, sandboxed) {
|
|
613
|
+
const roots = toolRoots(this.config);
|
|
614
|
+
const protectedPaths = [];
|
|
615
|
+
let outsidePaths = [];
|
|
616
|
+
let removal;
|
|
617
|
+
if (tool.pathArgument !== undefined && tool.isReadOnly?.(input) !== true) {
|
|
618
|
+
const value = input[tool.pathArgument];
|
|
619
|
+
if (typeof value === 'string') {
|
|
620
|
+
const hit = await declaredWriteEscalation(roots, value);
|
|
621
|
+
if (hit !== undefined)
|
|
622
|
+
protectedPaths.push(hit);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
if (tool.commandArgument !== undefined) {
|
|
626
|
+
const line = input[tool.commandArgument];
|
|
627
|
+
if (typeof line === 'string') {
|
|
628
|
+
const dialect = tool.commandDialect?.({ sandboxed }) ?? 'sh';
|
|
629
|
+
const found = await shellEscalations(line, dialect, {
|
|
630
|
+
roots,
|
|
631
|
+
reviewOutside: this.config.outsideRootAccess === 'review' && !sandboxed,
|
|
632
|
+
});
|
|
633
|
+
protectedPaths.push(...found.protectedPaths);
|
|
634
|
+
outsidePaths = found.outsidePaths;
|
|
635
|
+
removal = found.dangerousRemoval;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
return {
|
|
639
|
+
outsidePaths,
|
|
640
|
+
protectedPaths: [...new Set(protectedPaths)],
|
|
641
|
+
...(removal !== undefined ? { dangerousRemoval: removal } : {}),
|
|
557
642
|
};
|
|
558
643
|
}
|
|
559
644
|
/**
|
|
@@ -602,11 +687,13 @@ export class ToolExecutor {
|
|
|
602
687
|
.filter((call) => call.kind !== 'synthetic')
|
|
603
688
|
.map((call) => {
|
|
604
689
|
const escalation = escalations.get(call.toolCall.id);
|
|
690
|
+
const hookPermission = call.hook?.permission;
|
|
605
691
|
return {
|
|
606
692
|
id: call.toolCall.id,
|
|
607
693
|
name: call.toolName,
|
|
608
694
|
input: call.input,
|
|
609
695
|
...(escalation ? { escalation } : {}),
|
|
696
|
+
...(hookPermission ? { hookPermission } : {}),
|
|
610
697
|
};
|
|
611
698
|
});
|
|
612
699
|
const batch = Object.freeze({
|
|
@@ -623,6 +710,8 @@ export class ToolExecutor {
|
|
|
623
710
|
return { messages: [], results: [], observations: [] };
|
|
624
711
|
}
|
|
625
712
|
assertUniqueToolCallIds(toolCalls);
|
|
713
|
+
if (toolCalls.length > 0)
|
|
714
|
+
await this.awaitSandbox();
|
|
626
715
|
// Sampled here, once, and held for every call below. See the note on
|
|
627
716
|
// `permissionMode` in the config type.
|
|
628
717
|
this.batchMode = this.resolvePermissionMode();
|
|
@@ -832,6 +921,7 @@ export class ToolExecutor {
|
|
|
832
921
|
isError: true,
|
|
833
922
|
});
|
|
834
923
|
}
|
|
924
|
+
this.fitBatchToMessageBudget(results);
|
|
835
925
|
// isError and rich content were computed and then discarded here: the
|
|
836
926
|
// tuple narrowed to {toolCallId, output} BEFORE the message was built,
|
|
837
927
|
// so the failure signal and any image block were structurally lost at
|
|
@@ -839,6 +929,46 @@ export class ToolExecutor {
|
|
|
839
929
|
const messages = results.map((r) => createToolMessage(r.content ?? r.output, r.toolCallId, r.isError, r.revealedTools));
|
|
840
930
|
return { messages, results, observations };
|
|
841
931
|
}
|
|
932
|
+
/**
|
|
933
|
+
* Hold the batch's combined result text under the per-message cap.
|
|
934
|
+
*
|
|
935
|
+
* Runs once, on the settled batch and before the results become history
|
|
936
|
+
* messages, so what it writes is what every later request replays.
|
|
937
|
+
*/
|
|
938
|
+
fitBatchToMessageBudget(results) {
|
|
939
|
+
const maxChars = this.config.maxToolOutputCharsPerMessage ?? DEFAULT_MAX_TOOL_OUTPUT_CHARS_PER_MESSAGE;
|
|
940
|
+
const replacements = fitResultsToMessageBudget(results.map((r) => ({
|
|
941
|
+
toolCallId: r.toolCallId,
|
|
942
|
+
toolName: r.toolName,
|
|
943
|
+
output: r.output,
|
|
944
|
+
// A result carrying rich content or a structured-output copy is
|
|
945
|
+
// not text the model reads alone, and a self-limiting tool has
|
|
946
|
+
// already decided its own size.
|
|
947
|
+
replaceable: r.content === undefined &&
|
|
948
|
+
r.structuredResultJson === undefined &&
|
|
949
|
+
this.config.tools.get(r.toolName)?.selfLimitingOutput !== true,
|
|
950
|
+
})), {
|
|
951
|
+
maxChars,
|
|
952
|
+
spillDir: this.outputDirectory(),
|
|
953
|
+
onError: (message) => this.log.warn('Failed to retain a tool output replaced for the message budget', {
|
|
954
|
+
[NAMZU.TURN_ID]: this.config.turnId,
|
|
955
|
+
'exception.message': message,
|
|
956
|
+
}),
|
|
957
|
+
});
|
|
958
|
+
if (replacements.size === 0)
|
|
959
|
+
return;
|
|
960
|
+
for (const [i, r] of results.entries()) {
|
|
961
|
+
const replacement = replacements.get(r.toolCallId);
|
|
962
|
+
if (replacement === undefined)
|
|
963
|
+
continue;
|
|
964
|
+
results[i] = { ...r, output: replacement.output };
|
|
965
|
+
}
|
|
966
|
+
this.log.warn("Tool results exceeded the message's combined budget", {
|
|
967
|
+
[NAMZU.TURN_ID]: this.config.turnId,
|
|
968
|
+
'namzu.runtime.replaced_count': replacements.size,
|
|
969
|
+
'namzu.runtime.message_budget_chars': maxChars,
|
|
970
|
+
});
|
|
971
|
+
}
|
|
842
972
|
/**
|
|
843
973
|
* Run a tool on behalf of another tool, and put it on the record.
|
|
844
974
|
*
|
|
@@ -1236,7 +1366,9 @@ export class ToolExecutor {
|
|
|
1236
1366
|
let input;
|
|
1237
1367
|
let prepared;
|
|
1238
1368
|
let inputFailure;
|
|
1369
|
+
let preparedHookContext;
|
|
1239
1370
|
if (preparedCall?.kind === 'ready' || preparedCall?.kind === 'legacy') {
|
|
1371
|
+
preparedHookContext = preparedCall.hook?.context;
|
|
1240
1372
|
input = preparedCall.input;
|
|
1241
1373
|
prepared = preparedCall.kind === 'ready' ? preparedCall.prepared : undefined;
|
|
1242
1374
|
if (preparedCall.kind === 'legacy')
|
|
@@ -1262,6 +1394,7 @@ export class ToolExecutor {
|
|
|
1262
1394
|
return this.recordSyntheticPreparation(admitted);
|
|
1263
1395
|
toolName = admitted.toolName;
|
|
1264
1396
|
input = admitted.input;
|
|
1397
|
+
preparedHookContext = admitted.hook?.context;
|
|
1265
1398
|
prepared = admitted.kind === 'ready' ? admitted.prepared : undefined;
|
|
1266
1399
|
if (admitted.kind === 'legacy')
|
|
1267
1400
|
inputFailure = admitted.inputFailure;
|
|
@@ -1460,7 +1593,10 @@ export class ToolExecutor {
|
|
|
1460
1593
|
];
|
|
1461
1594
|
}
|
|
1462
1595
|
}
|
|
1463
|
-
|
|
1596
|
+
// A tool that bounds its own output is exempt from the DEFAULT per-result
|
|
1597
|
+
// cap only; a host that set the cap explicitly still gets it.
|
|
1598
|
+
const maxToolOutputChars = this.config.maxToolOutputChars ??
|
|
1599
|
+
(executedDefinition?.selfLimitingOutput === true ? 0 : DEFAULT_MAX_TOOL_OUTPUT_CHARS);
|
|
1464
1600
|
const sourceOutput = output;
|
|
1465
1601
|
// This owner-bound channel follows the selected receipt after both result
|
|
1466
1602
|
// screening and post-tool replacement. ToolResult.data and raw input can
|
|
@@ -1511,12 +1647,25 @@ export class ToolExecutor {
|
|
|
1511
1647
|
});
|
|
1512
1648
|
}
|
|
1513
1649
|
output = budgeted.output;
|
|
1514
|
-
|
|
1650
|
+
let modelContent = selectedContent === undefined
|
|
1515
1651
|
? undefined
|
|
1516
1652
|
: this.budgetContent(selectedContent, toolName, toolCall.id, {
|
|
1517
1653
|
sourceOutput,
|
|
1518
1654
|
budgeted,
|
|
1519
1655
|
});
|
|
1656
|
+
// What hooks said about this call rides with its result, in the model's
|
|
1657
|
+
// receipt and the host's alike, framed as a hook's words. Added after
|
|
1658
|
+
// the output budget so a bounded result is never trimmed to make room
|
|
1659
|
+
// for it; the note has its own bound (`hookNote`).
|
|
1660
|
+
const hookTexts = [preparedHookContext, post.context].filter((text) => text !== undefined && text.length > 0);
|
|
1661
|
+
if (hookTexts.length > 0) {
|
|
1662
|
+
const note = hookNote(hookTexts);
|
|
1663
|
+
output = `${output}\n\n${note}`;
|
|
1664
|
+
if (typeof modelContent === 'string')
|
|
1665
|
+
modelContent = `${modelContent}\n\n${note}`;
|
|
1666
|
+
else if (modelContent)
|
|
1667
|
+
modelContent = [...modelContent, { type: 'text', text: note }];
|
|
1668
|
+
}
|
|
1520
1669
|
// A failed call, or an override that says the call failed. A `replace`
|
|
1521
1670
|
// says the opposite, and reading it as a failure is what made redaction
|
|
1522
1671
|
// unusable: the model was told a successful call had gone wrong, and
|
|
@@ -1820,8 +1969,21 @@ export class ToolExecutor {
|
|
|
1820
1969
|
emitEvent: this.emitEvent,
|
|
1821
1970
|
log: this.log,
|
|
1822
1971
|
allowedTools: this.effectiveAllowedTools(),
|
|
1972
|
+
requestHalt: (reason) => this.requestHalt(reason),
|
|
1823
1973
|
};
|
|
1824
1974
|
}
|
|
1975
|
+
/** Why a hook asked for the turn to stop, until the iteration loop reads it. */
|
|
1976
|
+
haltReason;
|
|
1977
|
+
/** The first request wins: a later hook does not rewrite why the turn stopped. */
|
|
1978
|
+
requestHalt(reason) {
|
|
1979
|
+
this.haltReason ??= reason;
|
|
1980
|
+
}
|
|
1981
|
+
/** Read and clear a hook's request to stop the turn. */
|
|
1982
|
+
takeHalt() {
|
|
1983
|
+
const reason = this.haltReason;
|
|
1984
|
+
this.haltReason = undefined;
|
|
1985
|
+
return reason;
|
|
1986
|
+
}
|
|
1825
1987
|
async prepareNestedCall(toolName, input, signal) {
|
|
1826
1988
|
signal.throwIfAborted();
|
|
1827
1989
|
const prepare = this.config.tools.prepareExecutionAsync ?? this.config.tools.prepareExecution;
|
|
@@ -1845,6 +2007,14 @@ export class ToolExecutor {
|
|
|
1845
2007
|
...(preOutcome.kind === 'skip' ? { skipped: true } : {}),
|
|
1846
2008
|
};
|
|
1847
2009
|
}
|
|
2010
|
+
const nestedAsk = askedNestedMessage(toolName, preOutcome);
|
|
2011
|
+
if (nestedAsk)
|
|
2012
|
+
return {
|
|
2013
|
+
kind: 'synthetic',
|
|
2014
|
+
input: preOutcome.input,
|
|
2015
|
+
message: nestedAsk,
|
|
2016
|
+
isError: true,
|
|
2017
|
+
};
|
|
1848
2018
|
return { kind: 'legacy', input: preOutcome.input };
|
|
1849
2019
|
}
|
|
1850
2020
|
let preparation;
|
|
@@ -1885,6 +2055,15 @@ export class ToolExecutor {
|
|
|
1885
2055
|
...(preOutcome.kind === 'skip' ? { skipped: true } : {}),
|
|
1886
2056
|
};
|
|
1887
2057
|
}
|
|
2058
|
+
const nestedAsk = askedNestedMessage(toolName, preOutcome);
|
|
2059
|
+
if (nestedAsk) {
|
|
2060
|
+
return {
|
|
2061
|
+
kind: 'synthetic',
|
|
2062
|
+
input: preOutcome.input,
|
|
2063
|
+
message: nestedAsk,
|
|
2064
|
+
isError: true,
|
|
2065
|
+
};
|
|
2066
|
+
}
|
|
1888
2067
|
if (!preOutcome.modified) {
|
|
1889
2068
|
return {
|
|
1890
2069
|
kind: 'ready',
|
|
@@ -1937,6 +2116,7 @@ export class ToolExecutor {
|
|
|
1937
2116
|
/**
|
|
1938
2117
|
* @returns `override` — text replacing the tool's output, or `null`.
|
|
1939
2118
|
* `retry` — the hook asked for the tool to run again.
|
|
2119
|
+
* `context` — what the hooks want the model to read beside the result.
|
|
1940
2120
|
*/
|
|
1941
2121
|
async runPostToolHook(toolName, input, toolResult) {
|
|
1942
2122
|
if (!this.config.pluginManager)
|
|
@@ -1951,6 +2131,22 @@ export class ToolExecutor {
|
|
|
1951
2131
|
toolResult,
|
|
1952
2132
|
signal: this.config.abortSignal,
|
|
1953
2133
|
}, this.emitEvent);
|
|
2134
|
+
// A failed call is announced a second time, by name, so a hook that
|
|
2135
|
+
// only cares about failures need not read every result. After
|
|
2136
|
+
// `post_tool_use`, so the existing hooks see exactly what they saw.
|
|
2137
|
+
if (!toolResult.success) {
|
|
2138
|
+
results = [
|
|
2139
|
+
...results,
|
|
2140
|
+
...(await this.config.pluginManager.executeHooks('post_tool_use_failure', {
|
|
2141
|
+
sessionId: this.config.sessionId,
|
|
2142
|
+
turnId: this.config.turnId,
|
|
2143
|
+
toolName,
|
|
2144
|
+
toolInput: input,
|
|
2145
|
+
toolResult,
|
|
2146
|
+
signal: this.config.abortSignal,
|
|
2147
|
+
}, this.emitEvent)),
|
|
2148
|
+
];
|
|
2149
|
+
}
|
|
1954
2150
|
}
|
|
1955
2151
|
catch (error) {
|
|
1956
2152
|
if (!this.config.abortSignal.aborted)
|
|
@@ -1969,9 +2165,14 @@ export class ToolExecutor {
|
|
|
1969
2165
|
}
|
|
1970
2166
|
let override = null;
|
|
1971
2167
|
let retry = false;
|
|
2168
|
+
const contexts = [];
|
|
1972
2169
|
for (const result of results) {
|
|
1973
2170
|
switch (result.action) {
|
|
1974
2171
|
case 'continue':
|
|
2172
|
+
if (result.context)
|
|
2173
|
+
contexts.push(result.context);
|
|
2174
|
+
if (result.halt)
|
|
2175
|
+
this.requestHalt(result.halt.reason);
|
|
1975
2176
|
continue;
|
|
1976
2177
|
case 'error':
|
|
1977
2178
|
override = { output: `Error: ${result.message}`, isError: true };
|
|
@@ -2005,7 +2206,11 @@ export class ToolExecutor {
|
|
|
2005
2206
|
}
|
|
2006
2207
|
}
|
|
2007
2208
|
}
|
|
2008
|
-
return {
|
|
2209
|
+
return {
|
|
2210
|
+
override,
|
|
2211
|
+
retry,
|
|
2212
|
+
...(contexts.length > 0 ? { context: contexts.join('\n') } : {}),
|
|
2213
|
+
};
|
|
2009
2214
|
}
|
|
2010
2215
|
/**
|
|
2011
2216
|
* Answer a tool call that policy or a human refused, without executing
|