@namzu/sdk 45.1.0 → 48.0.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 +436 -8
- package/README.md +7 -8
- package/dist/advisory/history.d.ts.map +1 -1
- package/dist/advisory/history.js +21 -1
- package/dist/advisory/history.js.map +1 -1
- package/dist/advisory/index.d.ts +1 -1
- package/dist/advisory/index.d.ts.map +1 -1
- package/dist/advisory/index.js +1 -1
- package/dist/advisory/index.js.map +1 -1
- package/dist/advisory/registry.d.ts +17 -0
- package/dist/advisory/registry.d.ts.map +1 -1
- package/dist/advisory/registry.js +26 -0
- package/dist/advisory/registry.js.map +1 -1
- package/dist/agents/PipelineAgent.d.ts +2 -46
- package/dist/agents/PipelineAgent.d.ts.map +1 -1
- package/dist/agents/PipelineAgent.js +2 -242
- package/dist/agents/PipelineAgent.js.map +1 -1
- package/dist/agents/QueryAgent.d.ts +21 -0
- package/dist/agents/QueryAgent.d.ts.map +1 -0
- package/dist/agents/QueryAgent.js +214 -0
- package/dist/agents/QueryAgent.js.map +1 -0
- package/dist/agents/ReactiveAgent.d.ts +4 -16
- package/dist/agents/ReactiveAgent.d.ts.map +1 -1
- package/dist/agents/ReactiveAgent.js +4 -183
- package/dist/agents/ReactiveAgent.js.map +1 -1
- package/dist/agents/RouterAgent.d.ts +2 -20
- package/dist/agents/RouterAgent.d.ts.map +1 -1
- package/dist/agents/RouterAgent.js +2 -266
- package/dist/agents/RouterAgent.js.map +1 -1
- package/dist/agents/SupervisorAgent.d.ts +3 -43
- package/dist/agents/SupervisorAgent.d.ts.map +1 -1
- package/dist/agents/SupervisorAgent.js +3 -418
- package/dist/agents/SupervisorAgent.js.map +1 -1
- package/dist/agents/defineAgent.d.ts +2 -1
- package/dist/agents/defineAgent.d.ts.map +1 -1
- package/dist/agents/defineAgent.js +6 -1
- package/dist/agents/defineAgent.js.map +1 -1
- package/dist/agents/examples/PipelineAgent.d.ts +46 -0
- package/dist/agents/examples/PipelineAgent.d.ts.map +1 -0
- package/dist/agents/examples/PipelineAgent.js +242 -0
- package/dist/agents/examples/PipelineAgent.js.map +1 -0
- package/dist/agents/examples/RouterAgent.d.ts +22 -0
- package/dist/agents/examples/RouterAgent.d.ts.map +1 -0
- package/dist/agents/examples/RouterAgent.js +268 -0
- package/dist/agents/examples/RouterAgent.js.map +1 -0
- package/dist/agents/examples/SupervisorAgent.d.ts +45 -0
- package/dist/agents/examples/SupervisorAgent.d.ts.map +1 -0
- package/dist/agents/examples/SupervisorAgent.js +406 -0
- package/dist/agents/examples/SupervisorAgent.js.map +1 -0
- package/dist/agents/explore.d.ts +6 -3
- package/dist/agents/explore.d.ts.map +1 -1
- package/dist/agents/explore.js +6 -3
- package/dist/agents/explore.js.map +1 -1
- package/dist/agents/forward-options.d.ts +11 -0
- package/dist/agents/forward-options.d.ts.map +1 -0
- package/dist/agents/forward-options.js +15 -0
- package/dist/agents/forward-options.js.map +1 -0
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +2 -0
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/runAgent.d.ts +19 -8
- package/dist/agents/runAgent.d.ts.map +1 -1
- package/dist/agents/runAgent.js +99 -29
- package/dist/agents/runAgent.js.map +1 -1
- package/dist/authorization/command-line.d.ts +2 -0
- package/dist/authorization/command-line.d.ts.map +1 -1
- package/dist/authorization/command-line.js +2 -2
- package/dist/authorization/command-line.js.map +1 -1
- package/dist/authorization/gate.d.ts +13 -2
- package/dist/authorization/gate.d.ts.map +1 -1
- package/dist/authorization/gate.js +37 -5
- package/dist/authorization/gate.js.map +1 -1
- package/dist/authorization/program.d.ts +151 -0
- package/dist/authorization/program.d.ts.map +1 -0
- package/dist/authorization/program.js +713 -0
- package/dist/authorization/program.js.map +1 -0
- package/dist/authorization/reexec-wrapper.d.ts +106 -0
- package/dist/authorization/reexec-wrapper.d.ts.map +1 -0
- package/dist/authorization/reexec-wrapper.js +532 -0
- package/dist/authorization/reexec-wrapper.js.map +1 -0
- package/dist/authorization/rules.d.ts +9 -0
- package/dist/authorization/rules.d.ts.map +1 -1
- package/dist/authorization/rules.js +27 -1
- package/dist/authorization/rules.js.map +1 -1
- package/dist/authorization/shell-lexer.d.ts +39 -0
- package/dist/authorization/shell-lexer.d.ts.map +1 -1
- package/dist/authorization/shell-lexer.js +113 -69
- package/dist/authorization/shell-lexer.js.map +1 -1
- package/dist/bridge/sse/mapper.d.ts.map +1 -1
- package/dist/bridge/sse/mapper.js +6 -0
- package/dist/bridge/sse/mapper.js.map +1 -1
- package/dist/capabilities/index.d.ts +54 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +92 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/config/registry.d.ts +2 -1
- package/dist/config/registry.d.ts.map +1 -1
- package/dist/config/registry.js +3 -2
- package/dist/config/registry.js.map +1 -1
- package/dist/connector/index.d.ts +4 -4
- package/dist/connector/index.d.ts.map +1 -1
- package/dist/connector/index.js +3 -3
- package/dist/connector/index.js.map +1 -1
- package/dist/connector/mcp/adapter.d.ts +16 -1
- package/dist/connector/mcp/adapter.d.ts.map +1 -1
- package/dist/connector/mcp/adapter.js +60 -4
- package/dist/connector/mcp/adapter.js.map +1 -1
- package/dist/connector/mcp/client.d.ts +13 -4
- package/dist/connector/mcp/client.d.ts.map +1 -1
- package/dist/connector/mcp/client.js +20 -3
- package/dist/connector/mcp/client.js.map +1 -1
- package/dist/connector/mcp/discovery.d.ts +24 -1
- package/dist/connector/mcp/discovery.d.ts.map +1 -1
- package/dist/connector/mcp/discovery.js +44 -0
- package/dist/connector/mcp/discovery.js.map +1 -1
- package/dist/connector/mcp/index.d.ts +2 -0
- package/dist/connector/mcp/index.d.ts.map +1 -1
- package/dist/connector/mcp/index.js +11 -0
- package/dist/connector/mcp/index.js.map +1 -1
- package/dist/connector/mcp/mcp-toolset.d.ts +133 -0
- package/dist/connector/mcp/mcp-toolset.d.ts.map +1 -0
- package/dist/connector/mcp/mcp-toolset.js +399 -0
- package/dist/connector/mcp/mcp-toolset.js.map +1 -0
- package/dist/connector/tools/index.d.ts +2 -2
- package/dist/connector/tools/index.d.ts.map +1 -1
- package/dist/connector/tools/index.js +1 -1
- package/dist/connector/tools/index.js.map +1 -1
- package/dist/connector/tools/router.d.ts +15 -13
- package/dist/connector/tools/router.d.ts.map +1 -1
- package/dist/connector/tools/router.js +30 -51
- package/dist/connector/tools/router.js.map +1 -1
- package/dist/contracts/a2a.d.ts +2 -2
- package/dist/directory/derive-supervisor.d.ts +2 -2
- package/dist/directory/derive-supervisor.d.ts.map +1 -1
- package/dist/directory/derive-supervisor.js +6 -7
- package/dist/directory/derive-supervisor.js.map +1 -1
- package/dist/directory/derive.d.ts.map +1 -1
- package/dist/directory/derive.js +5 -5
- package/dist/directory/derive.js.map +1 -1
- package/dist/execution/code-runtime/types.d.ts +2 -2
- package/dist/execution/code-runtime/types.js +1 -1
- package/dist/invariants/index.d.ts +2 -1
- package/dist/invariants/index.d.ts.map +1 -1
- package/dist/invariants/index.js +3 -2
- package/dist/invariants/index.js.map +1 -1
- package/dist/manager/agent/lifecycle.d.ts.map +1 -1
- package/dist/manager/agent/lifecycle.js +9 -0
- package/dist/manager/agent/lifecycle.js.map +1 -1
- package/dist/manager/connector/environment.d.ts +6 -0
- package/dist/manager/connector/environment.d.ts.map +1 -1
- package/dist/manager/connector/environment.js +11 -4
- package/dist/manager/connector/environment.js.map +1 -1
- package/dist/manager/connector/index.d.ts +2 -2
- package/dist/manager/connector/index.d.ts.map +1 -1
- package/dist/manager/connector/index.js +2 -2
- package/dist/manager/connector/index.js.map +1 -1
- package/dist/manager/connector/tenant.d.ts +6 -0
- package/dist/manager/connector/tenant.d.ts.map +1 -1
- package/dist/manager/connector/tenant.js +11 -4
- package/dist/manager/connector/tenant.js.map +1 -1
- package/dist/manager/index.d.ts +2 -2
- package/dist/manager/index.d.ts.map +1 -1
- package/dist/manager/index.js +2 -2
- package/dist/manager/index.js.map +1 -1
- package/dist/manager/resident/learning-observation.d.ts +4 -4
- package/dist/manager/resident/learning.d.ts +36 -36
- package/dist/manager/session/attribution.d.ts +22 -0
- package/dist/manager/session/attribution.d.ts.map +1 -0
- package/dist/manager/session/attribution.js +64 -0
- package/dist/manager/session/attribution.js.map +1 -0
- package/dist/manager/session/turn-recorder.d.ts +14 -0
- package/dist/manager/session/turn-recorder.d.ts.map +1 -1
- package/dist/manager/session/turn-recorder.js +208 -55
- package/dist/manager/session/turn-recorder.js.map +1 -1
- package/dist/peers/address.d.ts +36 -0
- package/dist/peers/address.d.ts.map +1 -0
- package/dist/peers/address.js +52 -0
- package/dist/peers/address.js.map +1 -0
- package/dist/peers/client.d.ts +47 -0
- package/dist/peers/client.d.ts.map +1 -0
- package/dist/peers/client.js +132 -0
- package/dist/peers/client.js.map +1 -0
- package/dist/peers/dir.d.ts +88 -0
- package/dist/peers/dir.d.ts.map +1 -0
- package/dist/peers/dir.js +139 -0
- package/dist/peers/dir.js.map +1 -0
- package/dist/peers/endpoint.d.ts +144 -0
- package/dist/peers/endpoint.d.ts.map +1 -0
- package/dist/peers/endpoint.js +420 -0
- package/dist/peers/endpoint.js.map +1 -0
- package/dist/peers/envelope.d.ts +42 -0
- package/dist/peers/envelope.d.ts.map +1 -0
- package/dist/peers/envelope.js +110 -0
- package/dist/peers/envelope.js.map +1 -0
- package/dist/peers/index.d.ts +30 -0
- package/dist/peers/index.d.ts.map +1 -0
- package/dist/peers/index.js +22 -0
- package/dist/peers/index.js.map +1 -0
- package/dist/peers/protocol.d.ts +645 -0
- package/dist/peers/protocol.d.ts.map +1 -0
- package/dist/peers/protocol.js +151 -0
- package/dist/peers/protocol.js.map +1 -0
- package/dist/peers/record.d.ts +71 -0
- package/dist/peers/record.d.ts.map +1 -0
- package/dist/peers/record.js +45 -0
- package/dist/peers/record.js.map +1 -0
- package/dist/peers/registry.d.ts +54 -0
- package/dist/peers/registry.d.ts.map +1 -0
- package/dist/peers/registry.js +213 -0
- package/dist/peers/registry.js.map +1 -0
- package/dist/plugin/define.d.ts +24 -0
- package/dist/plugin/define.d.ts.map +1 -0
- package/dist/plugin/define.js +42 -0
- package/dist/plugin/define.js.map +1 -0
- package/dist/plugin/index.d.ts +2 -0
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js +1 -0
- package/dist/plugin/index.js.map +1 -1
- package/dist/plugin/lifecycle.d.ts +27 -3
- package/dist/plugin/lifecycle.d.ts.map +1 -1
- package/dist/plugin/lifecycle.js +242 -92
- package/dist/plugin/lifecycle.js.map +1 -1
- package/dist/plugin/resolver.d.ts +2 -2
- package/dist/plugin/resolver.d.ts.map +1 -1
- package/dist/plugin/resolver.js.map +1 -1
- package/dist/plugin/shell-hook.d.ts.map +1 -1
- package/dist/plugin/shell-hook.js +17 -3
- package/dist/plugin/shell-hook.js.map +1 -1
- package/dist/pricing/catalogue.generated.d.ts.map +1 -1
- package/dist/pricing/catalogue.generated.js +28 -4
- package/dist/pricing/catalogue.generated.js.map +1 -1
- package/dist/probe/errors.d.ts +2 -1
- package/dist/probe/errors.d.ts.map +1 -1
- package/dist/probe/errors.js +3 -2
- package/dist/probe/errors.js.map +1 -1
- package/dist/prompt/coding-agent-doctrine.d.ts +18 -7
- package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -1
- package/dist/prompt/coding-agent-doctrine.js +11 -6
- package/dist/prompt/coding-agent-doctrine.js.map +1 -1
- package/dist/prompt/contributions.d.ts +4 -1
- package/dist/prompt/contributions.d.ts.map +1 -1
- package/dist/prompt/contributions.js +7 -2
- package/dist/prompt/contributions.js.map +1 -1
- package/dist/prompt/index.d.ts +1 -1
- package/dist/prompt/index.d.ts.map +1 -1
- package/dist/prompt/index.js +1 -1
- package/dist/prompt/index.js.map +1 -1
- package/dist/provider/collect-chat-completion.d.ts +6 -1
- package/dist/provider/collect-chat-completion.d.ts.map +1 -1
- package/dist/provider/collect-chat-completion.js +88 -10
- package/dist/provider/collect-chat-completion.js.map +1 -1
- package/dist/provider/mock.d.ts.map +1 -1
- package/dist/provider/mock.js +23 -6
- package/dist/provider/mock.js.map +1 -1
- package/dist/provider/registry.d.ts +2 -1
- package/dist/provider/registry.d.ts.map +1 -1
- package/dist/provider/registry.js +3 -2
- package/dist/provider/registry.js.map +1 -1
- package/dist/provider/tool-call-framing.d.ts +164 -0
- package/dist/provider/tool-call-framing.d.ts.map +1 -0
- package/dist/provider/tool-call-framing.js +163 -0
- package/dist/provider/tool-call-framing.js.map +1 -0
- package/dist/public-runtime.d.ts +27 -14
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +49 -11
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-tools.d.ts +9 -6
- package/dist/public-tools.d.ts.map +1 -1
- package/dist/public-tools.js +13 -5
- package/dist/public-tools.js.map +1 -1
- package/dist/public-types.d.ts +16 -5
- package/dist/public-types.d.ts.map +1 -1
- package/dist/read-model/registry.d.ts +2 -1
- package/dist/read-model/registry.d.ts.map +1 -1
- package/dist/read-model/registry.js +3 -2
- package/dist/read-model/registry.js.map +1 -1
- package/dist/registry/ManagedRegistry.d.ts +30 -0
- package/dist/registry/ManagedRegistry.d.ts.map +1 -1
- package/dist/registry/ManagedRegistry.js +45 -6
- package/dist/registry/ManagedRegistry.js.map +1 -1
- package/dist/registry/collision.d.ts +57 -0
- package/dist/registry/collision.d.ts.map +1 -0
- package/dist/registry/collision.js +41 -0
- package/dist/registry/collision.js.map +1 -0
- package/dist/registry/command/index.d.ts +5 -3
- package/dist/registry/command/index.d.ts.map +1 -1
- package/dist/registry/command/index.js +6 -4
- package/dist/registry/command/index.js.map +1 -1
- package/dist/registry/index.d.ts +3 -4
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +2 -2
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/plugin/index.d.ts.map +1 -1
- package/dist/registry/plugin/index.js +14 -1
- package/dist/registry/plugin/index.js.map +1 -1
- package/dist/registry/tool/callable.d.ts +22 -0
- package/dist/registry/tool/callable.d.ts.map +1 -0
- package/dist/registry/tool/callable.js +28 -0
- package/dist/registry/tool/callable.js.map +1 -0
- package/dist/registry/tool/execute.d.ts +14 -77
- package/dist/registry/tool/execute.d.ts.map +1 -1
- package/dist/registry/tool/execute.js +15 -720
- package/dist/registry/tool/execute.js.map +1 -1
- package/dist/registry/tool/portable.d.ts +25 -0
- package/dist/registry/tool/portable.d.ts.map +1 -1
- package/dist/registry/tool/portable.js +50 -0
- package/dist/registry/tool/portable.js.map +1 -1
- package/dist/registry/tool/presentation.d.ts +6 -5
- package/dist/registry/tool/presentation.d.ts.map +1 -1
- package/dist/registry/tool/presentation.js +3 -3
- package/dist/registry/tool/presentation.js.map +1 -1
- package/dist/runtime/bidi/session.d.ts +5 -4
- package/dist/runtime/bidi/session.d.ts.map +1 -1
- package/dist/runtime/bidi/session.js +18 -1
- package/dist/runtime/bidi/session.js.map +1 -1
- package/dist/runtime/query/executor/tool-call-admission.d.ts +82 -13
- package/dist/runtime/query/executor/tool-call-admission.d.ts.map +1 -1
- package/dist/runtime/query/executor/tool-call-admission.js +227 -17
- package/dist/runtime/query/executor/tool-call-admission.js.map +1 -1
- package/dist/runtime/query/executor.d.ts +37 -5
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +103 -14
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/file-evidence-replay.d.ts +1 -1
- package/dist/runtime/query/file-evidence-replay.d.ts.map +1 -1
- package/dist/runtime/query/file-evidence-replay.js +8 -7
- package/dist/runtime/query/file-evidence-replay.js.map +1 -1
- package/dist/runtime/query/fork/prepare.d.ts +4 -1
- package/dist/runtime/query/fork/prepare.d.ts.map +1 -1
- package/dist/runtime/query/fork/prepare.js +4 -0
- package/dist/runtime/query/fork/prepare.js.map +1 -1
- package/dist/runtime/query/guardrail-presets.d.ts +4 -3
- package/dist/runtime/query/guardrail-presets.d.ts.map +1 -1
- package/dist/runtime/query/guardrail-presets.js +4 -3
- package/dist/runtime/query/guardrail-presets.js.map +1 -1
- package/dist/runtime/query/index.d.ts +23 -10
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +149 -70
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/iteration/index.d.ts.map +1 -1
- package/dist/runtime/query/iteration/index.js +8 -1
- package/dist/runtime/query/iteration/index.js.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction.js +1 -1
- package/dist/runtime/query/iteration/phases/compaction.js.map +1 -1
- package/dist/runtime/query/iteration/phases/context.d.ts +2 -2
- package/dist/runtime/query/iteration/phases/context.d.ts.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 +55 -2
- package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
- package/dist/runtime/query/iteration/stream-turn.d.ts.map +1 -1
- package/dist/runtime/query/iteration/stream-turn.js +342 -116
- package/dist/runtime/query/iteration/stream-turn.js.map +1 -1
- package/dist/runtime/query/iteration/tool-input.d.ts +79 -0
- package/dist/runtime/query/iteration/tool-input.d.ts.map +1 -0
- package/dist/runtime/query/iteration/tool-input.js +291 -0
- package/dist/runtime/query/iteration/tool-input.js.map +1 -0
- package/dist/runtime/query/observation-context.d.ts +2 -2
- package/dist/runtime/query/observation-context.d.ts.map +1 -1
- package/dist/runtime/query/observation-context.js.map +1 -1
- package/dist/runtime/query/prelude-lease.d.ts +18 -0
- package/dist/runtime/query/prelude-lease.d.ts.map +1 -0
- package/dist/runtime/query/prelude-lease.js +121 -0
- package/dist/runtime/query/prelude-lease.js.map +1 -0
- package/dist/runtime/query/prepare-turn.d.ts.map +1 -1
- package/dist/runtime/query/prepare-turn.js +386 -187
- package/dist/runtime/query/prepare-turn.js.map +1 -1
- package/dist/runtime/query/prompt-cache.d.ts +2 -2
- package/dist/runtime/query/prompt-cache.d.ts.map +1 -1
- package/dist/runtime/query/prompt.d.ts +2 -2
- package/dist/runtime/query/prompt.d.ts.map +1 -1
- package/dist/runtime/query/prompt.js +1 -1
- package/dist/runtime/query/prompt.js.map +1 -1
- package/dist/runtime/query/resume-session.d.ts.map +1 -1
- package/dist/runtime/query/resume-session.js +37 -2
- package/dist/runtime/query/resume-session.js.map +1 -1
- package/dist/runtime/query/review-policy.d.ts +65 -3
- package/dist/runtime/query/review-policy.d.ts.map +1 -1
- package/dist/runtime/query/review-policy.js +143 -22
- package/dist/runtime/query/review-policy.js.map +1 -1
- package/dist/runtime/query/tooling.d.ts +3 -2
- package/dist/runtime/query/tooling.d.ts.map +1 -1
- package/dist/runtime/query/tooling.js.map +1 -1
- package/dist/runtime/query/turn-state.d.ts.map +1 -1
- package/dist/runtime/query/turn-state.js +5 -0
- package/dist/runtime/query/turn-state.js.map +1 -1
- package/dist/runtime/system-events.d.ts +112 -0
- package/dist/runtime/system-events.d.ts.map +1 -0
- package/dist/runtime/system-events.js +183 -0
- package/dist/runtime/system-events.js.map +1 -0
- package/dist/scheduler/delegating.d.ts +2 -1
- package/dist/scheduler/delegating.d.ts.map +1 -1
- package/dist/scheduler/delegating.js +3 -2
- package/dist/scheduler/delegating.js.map +1 -1
- package/dist/skills/index.d.ts +1 -1
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +1 -1
- package/dist/skills/index.js.map +1 -1
- package/dist/skills/registry.d.ts +18 -0
- package/dist/skills/registry.d.ts.map +1 -1
- package/dist/skills/registry.js +20 -0
- package/dist/skills/registry.js.map +1 -1
- package/dist/store/evidence/index-page.d.ts +2 -2
- package/dist/store/session-log/conformance.d.ts +1 -1
- package/dist/store/session-log/conformance.d.ts.map +1 -1
- package/dist/store/session-log/conformance.js +49 -8
- package/dist/store/session-log/conformance.js.map +1 -1
- package/dist/store/session-log/core.d.ts +8 -3
- package/dist/store/session-log/core.d.ts.map +1 -1
- package/dist/store/session-log/core.js +2 -1
- package/dist/store/session-log/core.js.map +1 -1
- package/dist/store/session-log/fold.d.ts +12 -0
- package/dist/store/session-log/fold.d.ts.map +1 -1
- package/dist/store/session-log/fold.js +57 -7
- package/dist/store/session-log/fold.js.map +1 -1
- package/dist/store/session-log/index.d.ts +2 -2
- package/dist/store/session-log/index.d.ts.map +1 -1
- package/dist/store/session-log/index.js +1 -1
- package/dist/store/session-log/index.js.map +1 -1
- package/dist/test-support/toolset.d.ts +19 -0
- package/dist/test-support/toolset.d.ts.map +1 -0
- package/dist/test-support/toolset.js +20 -0
- package/dist/test-support/toolset.js.map +1 -0
- package/dist/tools/builtins/bash.d.ts +29 -0
- package/dist/tools/builtins/bash.d.ts.map +1 -1
- package/dist/tools/builtins/bash.js +19 -9
- package/dist/tools/builtins/bash.js.map +1 -1
- package/dist/tools/builtins/browser-url.d.ts +1 -1
- package/dist/tools/builtins/browser-url.js +1 -1
- package/dist/tools/builtins/browser.d.ts +6 -6
- package/dist/tools/builtins/computer-use-coordinates.d.ts +65 -0
- package/dist/tools/builtins/computer-use-coordinates.d.ts.map +1 -0
- package/dist/tools/builtins/computer-use-coordinates.js +123 -0
- package/dist/tools/builtins/computer-use-coordinates.js.map +1 -0
- package/dist/tools/builtins/computer-use-image.d.ts +77 -0
- package/dist/tools/builtins/computer-use-image.d.ts.map +1 -0
- package/dist/tools/builtins/computer-use-image.js +223 -0
- package/dist/tools/builtins/computer-use-image.js.map +1 -0
- package/dist/tools/builtins/computer-use.d.ts +519 -14
- package/dist/tools/builtins/computer-use.d.ts.map +1 -1
- package/dist/tools/builtins/computer-use.js +1196 -183
- package/dist/tools/builtins/computer-use.js.map +1 -1
- package/dist/tools/builtins/edit.d.ts.map +1 -1
- package/dist/tools/builtins/edit.js +9 -1
- package/dist/tools/builtins/edit.js.map +1 -1
- package/dist/tools/builtins/index.d.ts +2 -1
- package/dist/tools/builtins/index.d.ts.map +1 -1
- package/dist/tools/builtins/index.js +1 -1
- package/dist/tools/builtins/index.js.map +1 -1
- package/dist/tools/builtins/json-string-hint.d.ts +15 -0
- package/dist/tools/builtins/json-string-hint.d.ts.map +1 -0
- package/dist/tools/builtins/json-string-hint.js +17 -0
- package/dist/tools/builtins/json-string-hint.js.map +1 -0
- package/dist/tools/builtins/search-tools.d.ts.map +1 -1
- package/dist/tools/builtins/search-tools.js +7 -15
- package/dist/tools/builtins/search-tools.js.map +1 -1
- package/dist/tools/builtins/skill.d.ts +74 -0
- package/dist/tools/builtins/skill.d.ts.map +1 -1
- package/dist/tools/builtins/skill.js +214 -174
- package/dist/tools/builtins/skill.js.map +1 -1
- package/dist/tools/builtins/write-file.d.ts.map +1 -1
- package/dist/tools/builtins/write-file.js +11 -0
- package/dist/tools/builtins/write-file.js.map +1 -1
- package/dist/tools/command-shell.d.ts +10 -0
- package/dist/tools/command-shell.d.ts.map +1 -1
- package/dist/tools/command-shell.js +45 -1
- package/dist/tools/command-shell.js.map +1 -1
- package/dist/tools/coordinator/agent.d.ts.map +1 -1
- package/dist/tools/coordinator/agent.js +5 -0
- package/dist/tools/coordinator/agent.js.map +1 -1
- package/dist/tools/coordinator/ask-user-question.d.ts.map +1 -1
- package/dist/tools/coordinator/ask-user-question.js +26 -13
- package/dist/tools/coordinator/ask-user-question.js.map +1 -1
- package/dist/tools/coordinator/index.d.ts.map +1 -1
- package/dist/tools/coordinator/index.js +5 -0
- package/dist/tools/coordinator/index.js.map +1 -1
- package/dist/tools/coordinator/question-options.d.ts +78 -0
- package/dist/tools/coordinator/question-options.d.ts.map +1 -0
- package/dist/tools/coordinator/question-options.js +153 -0
- package/dist/tools/coordinator/question-options.js.map +1 -0
- package/dist/tools/defineTool.d.ts +12 -0
- package/dist/tools/defineTool.d.ts.map +1 -1
- package/dist/tools/defineTool.js +24 -0
- package/dist/tools/defineTool.js.map +1 -1
- package/dist/tools/memory/search.d.ts.map +1 -1
- package/dist/tools/memory/search.js +4 -1
- package/dist/tools/memory/search.js.map +1 -1
- package/dist/tools/memory/update.d.ts.map +1 -1
- package/dist/tools/memory/update.js +8 -5
- package/dist/tools/memory/update.js.map +1 -1
- package/dist/tools/render-nonce.d.ts +47 -0
- package/dist/tools/render-nonce.d.ts.map +1 -0
- package/dist/tools/render-nonce.js +63 -0
- package/dist/tools/render-nonce.js.map +1 -0
- package/dist/tools/roster.d.ts +46 -19
- package/dist/tools/roster.d.ts.map +1 -1
- package/dist/tools/roster.js +63 -33
- package/dist/tools/roster.js.map +1 -1
- package/dist/tools/schedules/present.d.ts.map +1 -1
- package/dist/tools/schedules/present.js +2 -0
- package/dist/tools/schedules/present.js.map +1 -1
- package/dist/tools/schedules/schedule-tool.d.ts +6 -5
- package/dist/tools/schedules/schedule-tool.d.ts.map +1 -1
- package/dist/tools/schedules/schedule-tool.js +208 -37
- package/dist/tools/schedules/schedule-tool.js.map +1 -1
- package/dist/tools/schedules/types.d.ts +120 -6
- package/dist/tools/schedules/types.d.ts.map +1 -1
- package/dist/tools/trusted-read-only.d.ts +9 -5
- package/dist/tools/trusted-read-only.d.ts.map +1 -1
- package/dist/tools/trusted-read-only.js +14 -10
- package/dist/tools/trusted-read-only.js.map +1 -1
- package/dist/tools/untrusted-envelope.d.ts +67 -28
- package/dist/tools/untrusted-envelope.d.ts.map +1 -1
- package/dist/tools/untrusted-envelope.js +108 -59
- package/dist/tools/untrusted-envelope.js.map +1 -1
- package/dist/toolsets/combine.d.ts +44 -0
- package/dist/toolsets/combine.d.ts.map +1 -0
- package/dist/toolsets/combine.js +153 -0
- package/dist/toolsets/combine.js.map +1 -0
- package/dist/toolsets/manager.d.ts +201 -0
- package/dist/toolsets/manager.d.ts.map +1 -0
- package/dist/toolsets/manager.js +837 -0
- package/dist/toolsets/manager.js.map +1 -0
- package/dist/toolsets/source-glob.d.ts +15 -0
- package/dist/toolsets/source-glob.d.ts.map +1 -0
- package/dist/toolsets/source-glob.js +23 -0
- package/dist/toolsets/source-glob.js.map +1 -0
- package/dist/toolsets/toolset.d.ts +20 -0
- package/dist/toolsets/toolset.d.ts.map +1 -0
- package/dist/toolsets/toolset.js +28 -0
- package/dist/toolsets/toolset.js.map +1 -0
- package/dist/toolsets/types.d.ts +128 -0
- package/dist/toolsets/types.d.ts.map +1 -0
- package/dist/toolsets/types.js +33 -0
- package/dist/toolsets/types.js.map +1 -0
- package/dist/toolsets/wrappers.d.ts +59 -0
- package/dist/toolsets/wrappers.d.ts.map +1 -0
- package/dist/toolsets/wrappers.js +165 -0
- package/dist/toolsets/wrappers.js.map +1 -0
- package/dist/types/agent/base.d.ts +27 -16
- package/dist/types/agent/base.d.ts.map +1 -1
- package/dist/types/agent/index.d.ts +1 -0
- package/dist/types/agent/index.d.ts.map +1 -1
- package/dist/types/agent/index.js +1 -0
- package/dist/types/agent/index.js.map +1 -1
- package/dist/types/agent/pipeline.d.ts +2 -0
- package/dist/types/agent/pipeline.d.ts.map +1 -1
- package/dist/types/agent/query.d.ts +117 -0
- package/dist/types/agent/query.d.ts.map +1 -0
- package/dist/types/agent/query.js +2 -0
- package/dist/types/agent/query.js.map +1 -0
- package/dist/types/agent/reactive.d.ts +2 -129
- package/dist/types/agent/reactive.d.ts.map +1 -1
- package/dist/types/agent/router.d.ts +2 -0
- package/dist/types/agent/router.d.ts.map +1 -1
- package/dist/types/agent/supervisor.d.ts +5 -2
- package/dist/types/agent/supervisor.d.ts.map +1 -1
- package/dist/types/authorization/index.d.ts +70 -12
- package/dist/types/authorization/index.d.ts.map +1 -1
- package/dist/types/authorization/index.js +11 -0
- package/dist/types/authorization/index.js.map +1 -1
- package/dist/types/computer-use/index.d.ts +176 -0
- package/dist/types/computer-use/index.d.ts.map +1 -1
- package/dist/types/computer-use/index.js.map +1 -1
- package/dist/types/connector/mcp.d.ts +32 -0
- package/dist/types/connector/mcp.d.ts.map +1 -1
- package/dist/types/errors/index.d.ts +15 -0
- package/dist/types/errors/index.d.ts.map +1 -1
- package/dist/types/errors/index.js.map +1 -1
- package/dist/types/hitl/index.d.ts +57 -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 +130 -9
- package/dist/types/message/index.d.ts.map +1 -1
- package/dist/types/message/index.js +4 -1
- package/dist/types/message/index.js.map +1 -1
- package/dist/types/plugin/index.d.ts +22 -4
- package/dist/types/plugin/index.d.ts.map +1 -1
- package/dist/types/plugin/index.js +1 -0
- package/dist/types/plugin/index.js.map +1 -1
- package/dist/types/provider/chat.d.ts +5 -0
- package/dist/types/provider/chat.d.ts.map +1 -1
- package/dist/types/provider/config.d.ts +8 -3
- package/dist/types/provider/config.d.ts.map +1 -1
- package/dist/types/provider/stream.d.ts +39 -0
- package/dist/types/provider/stream.d.ts.map +1 -1
- package/dist/types/sandbox/index.d.ts +1 -1
- package/dist/types/session/events.d.ts +14 -3
- package/dist/types/session/events.d.ts.map +1 -1
- package/dist/types/session/events.js.map +1 -1
- package/dist/types/tool/index.d.ts +171 -91
- package/dist/types/tool/index.d.ts.map +1 -1
- package/dist/types/tool/index.js.map +1 -1
- package/dist/types/toolset/index.d.ts +10 -40
- package/dist/types/toolset/index.d.ts.map +1 -1
- package/package.json +3 -1
- package/src/advisory/history.ts +27 -2
- package/src/advisory/index.ts +1 -1
- package/src/advisory/registry.ts +33 -0
- package/src/agents/AGENTS.md +14 -7
- package/src/agents/PipelineAgent.ts +2 -303
- package/src/agents/QueryAgent.ts +269 -0
- package/src/agents/ReactiveAgent.ts +6 -216
- package/src/agents/RouterAgent.ts +2 -337
- package/src/agents/SupervisorAgent.ts +3 -476
- package/src/agents/defineAgent.ts +13 -2
- package/src/agents/examples/PipelineAgent.ts +302 -0
- package/src/agents/examples/RouterAgent.ts +338 -0
- package/src/agents/examples/SupervisorAgent.ts +472 -0
- package/src/agents/explore.ts +6 -3
- package/src/agents/forward-options.ts +37 -0
- package/src/agents/index.ts +2 -0
- package/src/agents/runAgent.ts +144 -37
- package/src/authorization/command-line.ts +2 -2
- package/src/authorization/gate.ts +46 -5
- package/src/authorization/program.ts +773 -0
- package/src/authorization/reexec-wrapper.ts +589 -0
- package/src/authorization/rules.ts +36 -1
- package/src/authorization/shell-lexer.ts +136 -63
- package/src/bridge/sse/mapper.ts +6 -0
- package/src/capabilities/index.ts +157 -0
- package/src/config/registry.ts +4 -1
- package/src/connector/index.ts +9 -2
- package/src/connector/mcp/adapter.ts +58 -3
- package/src/connector/mcp/client.ts +20 -4
- package/src/connector/mcp/discovery.ts +60 -0
- package/src/connector/mcp/index.ts +13 -0
- package/src/connector/mcp/mcp-toolset.ts +515 -0
- package/src/connector/tools/index.ts +2 -2
- package/src/connector/tools/router.ts +35 -58
- package/src/directory/derive-supervisor.ts +12 -8
- package/src/directory/derive.ts +8 -5
- package/src/execution/code-runtime/types.ts +2 -2
- package/src/invariants/index.ts +4 -1
- package/src/manager/agent/lifecycle.ts +9 -0
- package/src/manager/connector/environment.ts +17 -4
- package/src/manager/connector/index.ts +2 -2
- package/src/manager/connector/tenant.ts +17 -4
- package/src/manager/index.ts +2 -2
- package/src/manager/session/attribution.ts +79 -0
- package/src/manager/session/turn-recorder.ts +211 -55
- package/src/peers/address.ts +58 -0
- package/src/peers/client.ts +202 -0
- package/src/peers/dir.ts +176 -0
- package/src/peers/endpoint.ts +564 -0
- package/src/peers/envelope.ts +121 -0
- package/src/peers/index.ts +96 -0
- package/src/peers/protocol.ts +196 -0
- package/src/peers/record.ts +56 -0
- package/src/peers/registry.ts +241 -0
- package/src/plugin/define.ts +68 -0
- package/src/plugin/index.ts +2 -0
- package/src/plugin/lifecycle.ts +286 -106
- package/src/plugin/resolver.ts +6 -3
- package/src/plugin/shell-hook.ts +21 -5
- package/src/pricing/catalogue.generated.ts +28 -4
- package/src/pricing/rates.source.json +27 -6
- package/src/probe/errors.ts +4 -1
- package/src/prompt/coding-agent-doctrine.ts +22 -10
- package/src/prompt/contributions.ts +12 -2
- package/src/prompt/index.ts +1 -0
- package/src/provider/collect-chat-completion.ts +96 -11
- package/src/provider/mock.ts +24 -6
- package/src/provider/registry.ts +4 -1
- package/src/provider/tool-call-framing.ts +226 -0
- package/src/public-runtime.ts +152 -9
- package/src/public-tools.ts +43 -5
- package/src/public-types.ts +65 -6
- package/src/read-model/registry.ts +7 -2
- package/src/registry/ManagedRegistry.ts +57 -6
- package/src/registry/collision.ts +64 -0
- package/src/registry/command/index.ts +7 -3
- package/src/registry/index.ts +3 -9
- package/src/registry/plugin/index.ts +14 -1
- package/src/registry/tool/callable.ts +36 -0
- package/src/registry/tool/execute.ts +16 -839
- package/src/registry/tool/portable.ts +59 -0
- package/src/registry/tool/presentation.ts +6 -5
- package/src/runtime/bidi/session.ts +24 -5
- package/src/runtime/query/executor/tool-call-admission.ts +288 -22
- package/src/runtime/query/executor.ts +129 -16
- package/src/runtime/query/file-evidence-replay.ts +8 -7
- package/src/runtime/query/fork/prepare.ts +6 -1
- package/src/runtime/query/guardrail-presets.ts +4 -3
- package/src/runtime/query/index.ts +199 -101
- package/src/runtime/query/iteration/index.ts +13 -3
- package/src/runtime/query/iteration/phases/compaction.ts +1 -1
- package/src/runtime/query/iteration/phases/context.ts +2 -2
- package/src/runtime/query/iteration/phases/tool-review.ts +59 -2
- package/src/runtime/query/iteration/stream-turn.ts +390 -136
- package/src/runtime/query/iteration/tool-input.ts +284 -0
- package/src/runtime/query/observation-context.ts +2 -2
- package/src/runtime/query/prelude-lease.ts +132 -0
- package/src/runtime/query/prepare-turn.ts +477 -198
- package/src/runtime/query/prompt-cache.ts +2 -2
- package/src/runtime/query/prompt.ts +4 -4
- package/src/runtime/query/resume-session.ts +42 -3
- package/src/runtime/query/review-policy.ts +190 -24
- package/src/runtime/query/tooling.ts +3 -6
- package/src/runtime/query/turn-state.ts +4 -0
- package/src/runtime/system-events.ts +246 -0
- package/src/scheduler/delegating.ts +7 -2
- package/src/skills/index.ts +1 -1
- package/src/skills/registry.ts +33 -0
- package/src/store/session-log/conformance.ts +51 -8
- package/src/store/session-log/core.ts +10 -4
- package/src/store/session-log/fold.ts +33 -7
- package/src/store/session-log/index.ts +2 -0
- package/src/test-support/toolset.ts +23 -0
- package/src/tools/builtins/bash.ts +27 -10
- package/src/tools/builtins/browser-url.ts +1 -1
- package/src/tools/builtins/computer-use-coordinates.ts +144 -0
- package/src/tools/builtins/computer-use-image.ts +278 -0
- package/src/tools/builtins/computer-use.ts +1495 -191
- package/src/tools/builtins/edit.ts +12 -2
- package/src/tools/builtins/index.ts +7 -1
- package/src/tools/builtins/json-string-hint.ts +16 -0
- package/src/tools/builtins/search-tools.ts +7 -20
- package/src/tools/builtins/skill.ts +304 -174
- package/src/tools/builtins/write-file.ts +12 -0
- package/src/tools/command-shell.ts +46 -1
- package/src/tools/coordinator/agent.ts +6 -0
- package/src/tools/coordinator/ask-user-question.ts +29 -15
- package/src/tools/coordinator/index.ts +6 -0
- package/src/tools/coordinator/question-options.ts +195 -0
- package/src/tools/defineTool.ts +38 -0
- package/src/tools/memory/search.ts +4 -1
- package/src/tools/memory/update.ts +8 -5
- package/src/tools/render-nonce.ts +69 -0
- package/src/tools/roster.ts +84 -33
- package/src/tools/schedules/present.ts +2 -0
- package/src/tools/schedules/schedule-tool.ts +238 -39
- package/src/tools/schedules/types.ts +120 -6
- package/src/tools/trusted-read-only.ts +19 -10
- package/src/tools/untrusted-envelope.ts +121 -57
- package/src/toolsets/combine.ts +181 -0
- package/src/toolsets/manager.ts +996 -0
- package/src/toolsets/source-glob.ts +22 -0
- package/src/toolsets/toolset.ts +31 -0
- package/src/toolsets/types.ts +154 -0
- package/src/toolsets/wrappers.ts +191 -0
- package/src/types/agent/base.ts +29 -16
- package/src/types/agent/index.ts +1 -0
- package/src/types/agent/pipeline.ts +2 -0
- package/src/types/agent/query.ts +129 -0
- package/src/types/agent/reactive.ts +5 -142
- package/src/types/agent/router.ts +2 -0
- package/src/types/agent/supervisor.ts +5 -2
- package/src/types/authorization/index.ts +33 -0
- package/src/types/computer-use/index.ts +202 -0
- package/src/types/connector/mcp.ts +32 -0
- package/src/types/errors/index.ts +15 -0
- package/src/types/hitl/index.ts +57 -0
- package/src/types/message/index.ts +135 -7
- package/src/types/plugin/index.ts +44 -21
- package/src/types/provider/chat.ts +5 -0
- package/src/types/provider/config.ts +8 -3
- package/src/types/provider/stream.ts +39 -0
- package/src/types/sandbox/index.ts +1 -1
- package/src/types/session/events.ts +14 -3
- package/src/types/tool/index.ts +173 -105
- package/src/types/toolset/index.ts +10 -47
- package/dist/registry/toolset/catalog.d.ts +0 -42
- package/dist/registry/toolset/catalog.d.ts.map +0 -1
- package/dist/registry/toolset/catalog.js +0 -234
- package/dist/registry/toolset/catalog.js.map +0 -1
- package/src/registry/toolset/catalog.ts +0 -308
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { join } from 'node:path'
|
|
2
2
|
import type { Span } from '@opentelemetry/api'
|
|
3
3
|
import type { AuthorizationGate } from '../../authorization/gate.js'
|
|
4
|
+
import { unknownProgramInLine } from '../../authorization/program.js'
|
|
4
5
|
import { type SkillGrantSet, compileSkillGrant } from '../../authorization/skill-grant.js'
|
|
5
6
|
import { extractFromToolCall, extractFromToolResult } from '../../compaction/extractor.js'
|
|
6
7
|
import type { WorkingStateManager } from '../../compaction/manager.js'
|
|
@@ -15,6 +16,8 @@ import { sandboxShellSpawn, withoutBashStartup } from '../../tools/command-shell
|
|
|
15
16
|
import { isAlwaysDestructive } from '../../tools/defineTool.js'
|
|
16
17
|
import { createFileReadTracker } from '../../tools/file-read-tracker.js'
|
|
17
18
|
import { pathOutsideRoots, toolRoots } from '../../tools/paths.js'
|
|
19
|
+
import type { ToolManager } from '../../toolsets/manager.js'
|
|
20
|
+
import type { ToolSourceRef } from '../../toolsets/types.js'
|
|
18
21
|
import type { ToolResultGuardrailSpec } from '../../types/guardrail/index.js'
|
|
19
22
|
import type { ToolCallEscalation } from '../../types/hitl/index.js'
|
|
20
23
|
import type { SessionId, ToolUseId, TurnId } from '../../types/ids/index.js'
|
|
@@ -23,6 +26,7 @@ import {
|
|
|
23
26
|
type Message,
|
|
24
27
|
type ToolCall,
|
|
25
28
|
type ToolResultContent,
|
|
29
|
+
type ToolRevealReceipt,
|
|
26
30
|
createToolMessage,
|
|
27
31
|
} from '../../types/message/index.js'
|
|
28
32
|
import type { PermissionMode } from '../../types/permission/index.js'
|
|
@@ -38,9 +42,9 @@ import type {
|
|
|
38
42
|
ShellDialect,
|
|
39
43
|
SkillRegistryRef,
|
|
40
44
|
ToolContext,
|
|
45
|
+
ToolDefinition,
|
|
41
46
|
ToolDispatchOptions,
|
|
42
47
|
ToolHandoff,
|
|
43
|
-
ToolRegistryContract,
|
|
44
48
|
ToolResult,
|
|
45
49
|
} from '../../types/tool/index.js'
|
|
46
50
|
import type { RepairToolCall } from '../../types/tool/repair.js'
|
|
@@ -55,11 +59,13 @@ import { type BackgroundJobRegistry, type JobProcess, bindOwner } from '../jobs/
|
|
|
55
59
|
import {
|
|
56
60
|
type ToolAdmissionHost,
|
|
57
61
|
formatFailedToolOutput,
|
|
62
|
+
isUnregistered,
|
|
58
63
|
prepareDirectCall,
|
|
59
64
|
repairTruncatedCall,
|
|
60
65
|
resolveCall,
|
|
61
66
|
runPreToolHook,
|
|
62
|
-
|
|
67
|
+
unknownToolMessage,
|
|
68
|
+
unreadableToolCallMessage,
|
|
63
69
|
} from './executor/tool-call-admission.js'
|
|
64
70
|
import { describeVisibleFileEvidence } from './file-evidence-context.js'
|
|
65
71
|
import { seedObservationLedger } from './file-evidence-seed.js'
|
|
@@ -302,7 +308,7 @@ export const DEFAULT_TOOL_RETRY_BACKOFF: BackoffPolicy = {
|
|
|
302
308
|
|
|
303
309
|
export interface ToolExecutorConfig {
|
|
304
310
|
fileReadTracker?: FileReadTracker
|
|
305
|
-
tools:
|
|
311
|
+
tools: ToolManager
|
|
306
312
|
sessionId: SessionId
|
|
307
313
|
turnId: TurnId
|
|
308
314
|
workingDirectory: string
|
|
@@ -492,6 +498,15 @@ export interface ToolCallOutcome {
|
|
|
492
498
|
isError?: boolean
|
|
493
499
|
/** The tool asked for a person; see `ToolResult.handoff`. */
|
|
494
500
|
handoff?: ToolHandoff
|
|
501
|
+
/**
|
|
502
|
+
* Source-bound receipts for names this successful call revealed
|
|
503
|
+
* (`ToolResult.reveals`, filtered to deferred names inside any active
|
|
504
|
+
* allow-list). Carried onto the persisted tool message
|
|
505
|
+
* (`ToolMessage.revealedTools`) so `ToolManager.availability`
|
|
506
|
+
* (`toolsets/manager.ts`) can derive activation from history instead of
|
|
507
|
+
* a mutable map.
|
|
508
|
+
*/
|
|
509
|
+
revealedTools?: readonly ToolRevealReceipt[]
|
|
495
510
|
}
|
|
496
511
|
|
|
497
512
|
export interface ToolExecutionBatch {
|
|
@@ -795,6 +810,7 @@ export class ToolExecutor {
|
|
|
795
810
|
toolInput: input,
|
|
796
811
|
toolDef: this.config.tools.get(toolName),
|
|
797
812
|
commandDialect: this.commandDialect(toolName),
|
|
813
|
+
toolSource: this.toolSource(toolName),
|
|
798
814
|
})
|
|
799
815
|
}
|
|
800
816
|
|
|
@@ -805,7 +821,22 @@ export class ToolExecutor {
|
|
|
805
821
|
*/
|
|
806
822
|
commandDialect(toolName: string): ShellDialect {
|
|
807
823
|
const tool = this.config.tools.get(toolName)
|
|
808
|
-
return
|
|
824
|
+
return (
|
|
825
|
+
tool?.commandDialect?.({
|
|
826
|
+
sandboxed: this.config.sandbox !== undefined,
|
|
827
|
+
}) ?? 'sh'
|
|
828
|
+
)
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* Where `toolName` came from, for the gate's `allow_read_only` rule to
|
|
833
|
+
* tell an operator-trusted MCP server's `readOnlyHint` from an untrusted
|
|
834
|
+
* one's. `sourceOf` throws for a name the manager does not have, so this
|
|
835
|
+
* checks first rather than let an unknown nested-call name throw here
|
|
836
|
+
* instead of being refused by the gate itself.
|
|
837
|
+
*/
|
|
838
|
+
toolSource(toolName: string): ToolSourceRef | undefined {
|
|
839
|
+
return this.config.tools.has(toolName) ? this.config.tools.sourceOf(toolName) : undefined
|
|
809
840
|
}
|
|
810
841
|
|
|
811
842
|
/**
|
|
@@ -861,13 +892,37 @@ export class ToolExecutor {
|
|
|
861
892
|
sandboxed &&
|
|
862
893
|
tool.sandboxEscapeArgument !== undefined &&
|
|
863
894
|
input[tool.sandboxEscapeArgument] === true
|
|
864
|
-
|
|
895
|
+
const unknownProgram = this.unknownProgramOf(tool, input, sandboxed)
|
|
896
|
+
if (!outsidePaths && !sandboxEscape && unknownProgram === undefined) return undefined
|
|
865
897
|
return {
|
|
866
898
|
...(outsidePaths ? { outsidePaths } : {}),
|
|
867
899
|
...(sandboxEscape ? { sandboxEscape: true as const } : {}),
|
|
900
|
+
...(unknownProgram !== undefined ? { unknownProgram } : {}),
|
|
868
901
|
}
|
|
869
902
|
}
|
|
870
903
|
|
|
904
|
+
/**
|
|
905
|
+
* Why a command's own program name is not knowable ahead of running it,
|
|
906
|
+
* in a tool's `commandArgument`, or undefined. Delegates to
|
|
907
|
+
* {@link unknownProgramInLine} — the SDK's one answer to this question,
|
|
908
|
+
* shared with that function's own tests so they cannot drift from what
|
|
909
|
+
* this method actually calls the way an independent test mirror once
|
|
910
|
+
* did. Checked whether or not the turn is sandboxed: a program nobody
|
|
911
|
+
* can name before it runs is exactly as unverifiable inside a sandbox as
|
|
912
|
+
* outside one.
|
|
913
|
+
*/
|
|
914
|
+
private unknownProgramOf(
|
|
915
|
+
tool: { commandArgument?: string; commandDialect?: ToolDefinition['commandDialect'] },
|
|
916
|
+
input: Record<string, unknown>,
|
|
917
|
+
sandboxed: boolean,
|
|
918
|
+
): string | undefined {
|
|
919
|
+
if (tool.commandArgument === undefined) return undefined
|
|
920
|
+
const value = input[tool.commandArgument]
|
|
921
|
+
if (typeof value !== 'string') return undefined
|
|
922
|
+
const dialect = tool.commandDialect?.({ sandboxed }) ?? 'sh'
|
|
923
|
+
return unknownProgramInLine(value, dialect)
|
|
924
|
+
}
|
|
925
|
+
|
|
871
926
|
/** Re-prepare only calls whose raw input a reviewer actually changed. */
|
|
872
927
|
async reprepareBatchForReview(
|
|
873
928
|
response: ChatCompletionResponse,
|
|
@@ -1153,7 +1208,7 @@ export class ToolExecutor {
|
|
|
1153
1208
|
// so the failure signal and any image block were structurally lost at
|
|
1154
1209
|
// the last possible moment.
|
|
1155
1210
|
const messages: Message[] = results.map((r) =>
|
|
1156
|
-
createToolMessage(r.content ?? r.output, r.toolCallId, r.isError),
|
|
1211
|
+
createToolMessage(r.content ?? r.output, r.toolCallId, r.isError, r.revealedTools),
|
|
1157
1212
|
)
|
|
1158
1213
|
|
|
1159
1214
|
return { messages, results, observations }
|
|
@@ -1259,6 +1314,7 @@ export class ToolExecutor {
|
|
|
1259
1314
|
toolInput: preparedInput,
|
|
1260
1315
|
toolDef: this.config.tools.get(name),
|
|
1261
1316
|
commandDialect: this.commandDialect(name),
|
|
1317
|
+
toolSource: this.toolSource(name),
|
|
1262
1318
|
})
|
|
1263
1319
|
if (gateResult && gateResult.decision !== 'allow') {
|
|
1264
1320
|
const reason =
|
|
@@ -1356,7 +1412,10 @@ export class ToolExecutor {
|
|
|
1356
1412
|
input: preparedInput,
|
|
1357
1413
|
...(via ? { via } : {}),
|
|
1358
1414
|
},
|
|
1359
|
-
buildProbeContext({
|
|
1415
|
+
buildProbeContext({
|
|
1416
|
+
sessionId: this.config.sessionId,
|
|
1417
|
+
turnId: this.config.turnId,
|
|
1418
|
+
}),
|
|
1360
1419
|
)
|
|
1361
1420
|
if (vetoOutcome.action === 'deny') {
|
|
1362
1421
|
const probeName = vetoOutcome.probeName ?? 'unnamed'
|
|
@@ -1456,7 +1515,13 @@ export class ToolExecutor {
|
|
|
1456
1515
|
// cannot tell apart from the result text alone.
|
|
1457
1516
|
if (!result.success) {
|
|
1458
1517
|
return view?.kind === 'generic' && view.outcome === 'cancelled'
|
|
1459
|
-
? {
|
|
1518
|
+
? {
|
|
1519
|
+
presentation: {
|
|
1520
|
+
kind: 'generic',
|
|
1521
|
+
label: view.label,
|
|
1522
|
+
outcome: 'cancelled',
|
|
1523
|
+
} as const,
|
|
1524
|
+
}
|
|
1460
1525
|
: {}
|
|
1461
1526
|
}
|
|
1462
1527
|
if (view?.kind !== 'diff') return {}
|
|
@@ -1604,7 +1669,7 @@ export class ToolExecutor {
|
|
|
1604
1669
|
: null
|
|
1605
1670
|
|
|
1606
1671
|
if (toolCall.metadata?.inputTruncated === true && !truncationRepair) {
|
|
1607
|
-
const message =
|
|
1672
|
+
const message = unreadableToolCallMessage(this.admissionHost(), toolCall, toolName)
|
|
1608
1673
|
await this.emitEvent({
|
|
1609
1674
|
type: 'tool_executing',
|
|
1610
1675
|
turnId: this.config.turnId,
|
|
@@ -1722,7 +1787,10 @@ export class ToolExecutor {
|
|
|
1722
1787
|
toolName,
|
|
1723
1788
|
input,
|
|
1724
1789
|
},
|
|
1725
|
-
buildProbeContext({
|
|
1790
|
+
buildProbeContext({
|
|
1791
|
+
sessionId: this.config.sessionId,
|
|
1792
|
+
turnId: this.config.turnId,
|
|
1793
|
+
}),
|
|
1726
1794
|
)
|
|
1727
1795
|
if (vetoOutcome.action === 'deny') {
|
|
1728
1796
|
const probeName = vetoOutcome.probeName ?? 'unnamed'
|
|
@@ -1928,7 +1996,10 @@ export class ToolExecutor {
|
|
|
1928
1996
|
const modelContent =
|
|
1929
1997
|
selectedContent === undefined
|
|
1930
1998
|
? undefined
|
|
1931
|
-
: this.budgetContent(selectedContent, toolName, toolCall.id, {
|
|
1999
|
+
: this.budgetContent(selectedContent, toolName, toolCall.id, {
|
|
2000
|
+
sourceOutput,
|
|
2001
|
+
budgeted,
|
|
2002
|
+
})
|
|
1932
2003
|
|
|
1933
2004
|
// A failed call, or an override that says the call failed. A `replace`
|
|
1934
2005
|
// says the opposite, and reading it as a failure is what made redaction
|
|
@@ -1943,6 +2014,30 @@ export class ToolExecutor {
|
|
|
1943
2014
|
}
|
|
1944
2015
|
}
|
|
1945
2016
|
|
|
2017
|
+
// A reveal loads a deferred schema after a successful call. Host-owned
|
|
2018
|
+
// readiness remains a separate gate: a suspended tool cannot be found
|
|
2019
|
+
// or revealed, and a prior receipt cannot make it ready. Bind the
|
|
2020
|
+
// receipt to the current owner so a later source reusing the same name
|
|
2021
|
+
// does not inherit it.
|
|
2022
|
+
//
|
|
2023
|
+
// `revealedTools` is written onto the persisted tool message; nothing
|
|
2024
|
+
// here mutates the manager itself, because `ToolManager.availability`
|
|
2025
|
+
// (`toolsets/manager.ts`) DERIVES availability from this field the
|
|
2026
|
+
// next time it reads the turn's post-compaction history — compaction
|
|
2027
|
+
// is the one boundary that resets it. There is no `activate()` call
|
|
2028
|
+
// to make: the manager has no mutable membership to activate.
|
|
2029
|
+
let revealedTools: readonly ToolRevealReceipt[] | undefined
|
|
2030
|
+
if (!this.config.abortSignal.aborted && !effectiveIsError && result.reveals?.length) {
|
|
2031
|
+
const revealed = result.reveals.filter(
|
|
2032
|
+
(name) =>
|
|
2033
|
+
this.config.tools.availability(name) === 'deferred' &&
|
|
2034
|
+
(toolContext.allowedTools === undefined || toolContext.allowedTools.includes(name)),
|
|
2035
|
+
)
|
|
2036
|
+
if (revealed.length > 0) {
|
|
2037
|
+
revealedTools = revealed.map((name) => this.config.tools.revealReceipt(name))
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
|
|
1946
2041
|
if (result.success) {
|
|
1947
2042
|
this.log.debug('Tool executed successfully', {
|
|
1948
2043
|
[NAMZU.TURN_ID]: this.config.turnId,
|
|
@@ -2020,6 +2115,7 @@ export class ToolExecutor {
|
|
|
2020
2115
|
...(result.handoff !== undefined && !this.config.abortSignal.aborted
|
|
2021
2116
|
? { handoff: result.handoff }
|
|
2022
2117
|
: {}),
|
|
2118
|
+
...(revealedTools !== undefined ? { revealedTools } : {}),
|
|
2023
2119
|
}
|
|
2024
2120
|
}
|
|
2025
2121
|
|
|
@@ -2202,10 +2298,12 @@ export class ToolExecutor {
|
|
|
2202
2298
|
}
|
|
2203
2299
|
|
|
2204
2300
|
/**
|
|
2205
|
-
* The
|
|
2301
|
+
* The four things the admission family reads off this executor.
|
|
2206
2302
|
*
|
|
2207
2303
|
* Built per call rather than held: `setSandbox` REPLACES `config`, so a
|
|
2208
|
-
* host captured once would hand the next admission a stale sandbox.
|
|
2304
|
+
* host captured once would hand the next admission a stale sandbox. The
|
|
2305
|
+
* allow-list is the step's, taken the same way and for a like reason:
|
|
2306
|
+
* `setStepAllowedTools` replaces it every step.
|
|
2209
2307
|
*
|
|
2210
2308
|
* The one way this differs from the inline code it replaced, which
|
|
2211
2309
|
* re-read `this.config` at every use: an admission that spans a
|
|
@@ -2216,7 +2314,12 @@ export class ToolExecutor {
|
|
|
2216
2314
|
* before the loop, so nothing in this tree can tell them apart.
|
|
2217
2315
|
*/
|
|
2218
2316
|
private admissionHost(): ToolAdmissionHost {
|
|
2219
|
-
return {
|
|
2317
|
+
return {
|
|
2318
|
+
config: this.config,
|
|
2319
|
+
emitEvent: this.emitEvent,
|
|
2320
|
+
log: this.log,
|
|
2321
|
+
allowedTools: this.effectiveAllowedTools(),
|
|
2322
|
+
}
|
|
2220
2323
|
}
|
|
2221
2324
|
|
|
2222
2325
|
private async prepareNestedCall(
|
|
@@ -2251,10 +2354,16 @@ export class ToolExecutor {
|
|
|
2251
2354
|
try {
|
|
2252
2355
|
preparation = prepare.call(this.config.tools, toolName, input)
|
|
2253
2356
|
} catch (err) {
|
|
2357
|
+
// A name the registry does not hold is answered with what this step
|
|
2358
|
+
// can call, as a model's own call is; the registry's "Not found"
|
|
2359
|
+
// lists everything it holds.
|
|
2360
|
+
const host = this.admissionHost()
|
|
2254
2361
|
return {
|
|
2255
2362
|
kind: 'synthetic',
|
|
2256
2363
|
input,
|
|
2257
|
-
message:
|
|
2364
|
+
message: isUnregistered(host, toolName)
|
|
2365
|
+
? unknownToolMessage(host, toolName)
|
|
2366
|
+
: `Tool "${toolName}" could not be prepared: ${toErrorMessage(err)}`,
|
|
2258
2367
|
isError: true,
|
|
2259
2368
|
}
|
|
2260
2369
|
}
|
|
@@ -2296,7 +2405,11 @@ export class ToolExecutor {
|
|
|
2296
2405
|
isError: true,
|
|
2297
2406
|
}
|
|
2298
2407
|
}
|
|
2299
|
-
return {
|
|
2408
|
+
return {
|
|
2409
|
+
kind: 'ready',
|
|
2410
|
+
input: modified.prepared.input,
|
|
2411
|
+
prepared: modified.prepared,
|
|
2412
|
+
}
|
|
2300
2413
|
}
|
|
2301
2414
|
|
|
2302
2415
|
/**
|
|
@@ -242,12 +242,13 @@ export function collectObservedPaths(
|
|
|
242
242
|
* The recorded arguments and nothing else. A receipt names the path too, but it
|
|
243
243
|
* names it inside a sentence a path may itself contain, in a spelling that
|
|
244
244
|
* differs between the host and sandbox branches, and compaction clears receipts
|
|
245
|
-
* while it never clears a call. A call
|
|
246
|
-
* carries `{}` here: `function.arguments` is
|
|
247
|
-
* buffer moves to `metadata.partialArguments`,
|
|
248
|
-
* saying rather than what ran — a
|
|
249
|
-
*
|
|
250
|
-
*
|
|
245
|
+
* while it never clears a call. A call whose arguments could not be read, cut
|
|
246
|
+
* off mid-JSON or malformed, carries `{}` here: `function.arguments` is
|
|
247
|
+
* normalized to that and the raw buffer moves to `metadata.partialArguments`,
|
|
248
|
+
* which is what the model was saying rather than what ran — a
|
|
249
|
+
* `repairToolCall` hook may have rewritten the arguments before execution. So
|
|
250
|
+
* an unreadable call is attributable to nothing, and the walk treats it as
|
|
251
|
+
* such. So is a call whose arguments run past
|
|
251
252
|
* {@link MAX_ATTRIBUTION_UNITS}, which this does not read at all.
|
|
252
253
|
*
|
|
253
254
|
* Answered once per pass and remembered. The path collection and the walk ask
|
|
@@ -270,7 +271,7 @@ function declaredPath(call: ToolCall, attributions: PathAttributions): string |
|
|
|
270
271
|
*
|
|
271
272
|
* One function because a middle hop is not a lesser claim than the last one.
|
|
272
273
|
* A chain whose second edit was cleared by compaction, or came back an error,
|
|
273
|
-
* or arrived
|
|
274
|
+
* or arrived with arguments that could not be read, reconstructs nothing at all — so the whole path is
|
|
274
275
|
* withheld rather than emitted as the part still visible, which would name a
|
|
275
276
|
* body the model cannot rebuild.
|
|
276
277
|
*
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { assertSessionLogAttribution } from '../../../manager/session/attribution.js'
|
|
1
2
|
import type { CheckpointScope, SessionCheckpointStore } from '../../../store/checkpoint/index.js'
|
|
2
3
|
import type { SessionLog } from '../../../store/session-log/index.js'
|
|
3
4
|
import type { CheckpointId } from '../../../types/hitl/index.js'
|
|
5
|
+
import type { TopicId } from '../../../types/ids/index.js'
|
|
4
6
|
import type { Message } from '../../../types/message/index.js'
|
|
5
7
|
import type { Checkpoint } from '../../../types/session/checkpoint.js'
|
|
6
8
|
import type { Mutation } from '../../../types/session/fork.js'
|
|
@@ -18,7 +20,7 @@ export interface PrepareForkInput {
|
|
|
18
20
|
/** The store the source turn's checkpoints are in. */
|
|
19
21
|
readonly checkpointStore: SessionCheckpointStore
|
|
20
22
|
/** The source turn, across the full attribution. */
|
|
21
|
-
readonly scope: CheckpointScope
|
|
23
|
+
readonly scope: CheckpointScope & { readonly topicId: TopicId }
|
|
22
24
|
/** Which checkpoint to fork at. */
|
|
23
25
|
readonly fromCheckpoint: CheckpointSelector
|
|
24
26
|
/** Mutations applied at the fork point before the caller hands the state to `query()`. */
|
|
@@ -55,6 +57,9 @@ export interface PreparedForkState {
|
|
|
55
57
|
* covers must be intact.
|
|
56
58
|
*/
|
|
57
59
|
export async function prepareForkState(input: PrepareForkInput): Promise<PreparedForkState> {
|
|
60
|
+
// A checkpoint address alone cannot authorize reading the source session's
|
|
61
|
+
// conversation. The log owner must agree before touching its checkpoints.
|
|
62
|
+
await assertSessionLogAttribution(input.sessionLog, input.scope, { requireStarted: true })
|
|
58
63
|
const sourceCheckpoint = await resolveCheckpoint(input)
|
|
59
64
|
const restored = await restoreCheckpointContext(input.sessionLog, sourceCheckpoint)
|
|
60
65
|
const mutations = input.mutate ?? []
|
|
@@ -497,9 +497,10 @@ export function toolResultCorrespondenceGuardrail(
|
|
|
497
497
|
* The screens a turn installs on itself when its host configured none.
|
|
498
498
|
*
|
|
499
499
|
* A DEFAULT, and the reason it is here rather than on
|
|
500
|
-
*
|
|
501
|
-
* and hands
|
|
502
|
-
* host's to write and this repository's default would
|
|
500
|
+
* `ToolManagerConfig.resultGuardrails` (`toolsets/manager.ts`): a host
|
|
501
|
+
* assembles its toolsets and hands them to `query()`, so a manager-construction
|
|
502
|
+
* default would be the host's to write and this repository's default would
|
|
503
|
+
* reach nobody. The turn
|
|
503
504
|
* is the thing that has to carry it, and a turn that wants none says so with
|
|
504
505
|
* an empty array — which is the escape hatch, and it exists precisely because
|
|
505
506
|
* the screen below can refuse a result.
|