@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
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import type { StreamChunk } from '../types/provider/stream.js'
|
|
2
|
+
|
|
3
|
+
type ToolCallDelta = NonNullable<StreamChunk['delta']['toolCalls']>[number]
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A stream that broke tool-call framing: a second call id on an `index`
|
|
7
|
+
* another call holds.
|
|
8
|
+
*
|
|
9
|
+
* The index is what groups a call's fragments, so after this no buffer can be
|
|
10
|
+
* trusted to hold one call's arguments. The second call's arguments used to be
|
|
11
|
+
* appended to the first's; the buffer that reached `JSON.parse` was then not
|
|
12
|
+
* what the model sent, and the model was told its call had been cut off.
|
|
13
|
+
*
|
|
14
|
+
* Nothing else about a call's framing is a violation. Arguments that arrive
|
|
15
|
+
* before the call's id belong to the call at their index and are kept, and a
|
|
16
|
+
* call whose id never arrives is still one call.
|
|
17
|
+
*/
|
|
18
|
+
export interface ToolCallFramingViolation {
|
|
19
|
+
readonly kind: 'index_reused'
|
|
20
|
+
readonly index: number
|
|
21
|
+
readonly openId: string
|
|
22
|
+
readonly newId: string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Whether this tool-call delta puts a new call on an index another call
|
|
27
|
+
* holds, or `undefined` when it does not.
|
|
28
|
+
*
|
|
29
|
+
* The same id repeated on every fragment is fine: some wires send it each
|
|
30
|
+
* time. Only a different one is a second call.
|
|
31
|
+
*/
|
|
32
|
+
export function toolCallFramingViolation(
|
|
33
|
+
open: { readonly id: string } | undefined,
|
|
34
|
+
delta: ToolCallDelta,
|
|
35
|
+
/** The index the fragment was placed on, when it came without one. */
|
|
36
|
+
index: number = delta.index,
|
|
37
|
+
): ToolCallFramingViolation | undefined {
|
|
38
|
+
if (open?.id && delta.id && delta.id !== open.id) {
|
|
39
|
+
return { kind: 'index_reused', index, openId: open.id, newId: delta.id }
|
|
40
|
+
}
|
|
41
|
+
return undefined
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function hasIndex(index: number | undefined): index is number {
|
|
45
|
+
return typeof index === 'number' && Number.isInteger(index) && index >= 0
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Whether a fragment carries neither an index nor an id — the one shape
|
|
50
|
+
* `ToolCallIndexer.indexOf` cannot place by itself, and the only shape
|
|
51
|
+
* {@link ToolCallIndexer.placeUnindexedFragment} is for. A fragment with
|
|
52
|
+
* either goes through `indexOf` instead, unaffected by anything below.
|
|
53
|
+
*/
|
|
54
|
+
export function isUnindexedFragment(delta: {
|
|
55
|
+
readonly index?: number
|
|
56
|
+
readonly id?: string
|
|
57
|
+
}): boolean {
|
|
58
|
+
return !hasIndex(delta.index) && !delta.id
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The index each tool-call fragment of one stream belongs to.
|
|
63
|
+
*
|
|
64
|
+
* A driver sets `index`, and the index is what groups a call's fragments.
|
|
65
|
+
* Some servers leave it out of their `tool_calls` fragments, and a driver
|
|
66
|
+
* that passes the wire value through then sends none. Every such fragment used
|
|
67
|
+
* to land on one `undefined` index: two parallel calls were refused as a
|
|
68
|
+
* reused index, and the turn paused on a stream that had nothing wrong with
|
|
69
|
+
* it but the missing field.
|
|
70
|
+
*
|
|
71
|
+
* A fragment that carries an id, with or without an index, is placed by
|
|
72
|
+
* {@link indexOf}: an id seen before continues its call; a new id names the
|
|
73
|
+
* call the latest fragment went to when that call has no id yet, and starts a
|
|
74
|
+
* call on the next free index otherwise. A fragment that carries an index
|
|
75
|
+
* keeps it, so a well-formed stream is read exactly as before and a real
|
|
76
|
+
* reuse of an index is still refused.
|
|
77
|
+
*
|
|
78
|
+
* A fragment with NEITHER an id nor an index — see
|
|
79
|
+
* {@link isUnindexedFragment} — goes through {@link placeUnindexedFragment}
|
|
80
|
+
* instead, which is never a guess: nothing in such a fragment says which call
|
|
81
|
+
* it continues, so the caller is asked, for every call opened so far,
|
|
82
|
+
* whether it could still be receiving more of its arguments right now, and
|
|
83
|
+
* the fragment is placed only when the answer says exactly one call.
|
|
84
|
+
*/
|
|
85
|
+
export class ToolCallIndexer {
|
|
86
|
+
private readonly byId = new Map<string, number>()
|
|
87
|
+
private readonly idOf = new Map<number, string>()
|
|
88
|
+
private readonly named = new Set<number>()
|
|
89
|
+
private readonly opened = new Set<number>()
|
|
90
|
+
private latest: number | undefined
|
|
91
|
+
private next = 0
|
|
92
|
+
|
|
93
|
+
/** The index this id- or index-bearing fragment belongs to. */
|
|
94
|
+
indexOf(delta: { readonly index?: number; readonly id?: string }): number {
|
|
95
|
+
const index = hasIndex(delta.index) ? delta.index : this.placed(delta.id)
|
|
96
|
+
if (delta.id && !this.byId.has(delta.id)) this.byId.set(delta.id, index)
|
|
97
|
+
if (delta.id) {
|
|
98
|
+
this.named.add(index)
|
|
99
|
+
this.idOf.set(index, delta.id)
|
|
100
|
+
}
|
|
101
|
+
this.opened.add(index)
|
|
102
|
+
if (index >= this.next) this.next = index + 1
|
|
103
|
+
this.latest = index
|
|
104
|
+
return index
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
private placed(id: string | undefined): number {
|
|
108
|
+
if (!id) return this.latest ?? this.next
|
|
109
|
+
const known = this.byId.get(id)
|
|
110
|
+
if (known !== undefined) return known
|
|
111
|
+
return this.latest !== undefined && !this.named.has(this.latest) ? this.latest : this.next
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Where a fragment with neither an id nor an index belongs — see
|
|
116
|
+
* {@link isUnindexedFragment}.
|
|
117
|
+
*
|
|
118
|
+
* Evaluated fresh for every such fragment, never decided once and
|
|
119
|
+
* remembered from when a call opened: a call's buffer can go from
|
|
120
|
+
* accepting more text to not (once it completes) and stay that way, so
|
|
121
|
+
* only the state right now, at each fragment, says which calls could
|
|
122
|
+
* still be its target. `canAccept(index)` is asked for every call opened
|
|
123
|
+
* so far and answers exactly that: true while its buffer is empty or is
|
|
124
|
+
* not yet a complete JSON value (it could still be receiving more), false
|
|
125
|
+
* once the buffer already parses as one complete value (nothing more is
|
|
126
|
+
* missing from it).
|
|
127
|
+
*
|
|
128
|
+
* - No call has opened yet: this fragment starts the first one. An id
|
|
129
|
+
* for it, if the stream sends one, arrives on a later fragment and
|
|
130
|
+
* attaches to it — the ordinary "arguments before the id" case,
|
|
131
|
+
* unchanged.
|
|
132
|
+
* - Exactly one open call can still accept: it is unambiguously that
|
|
133
|
+
* one.
|
|
134
|
+
* - Zero, or more than one, open call can: there is no way to tell which
|
|
135
|
+
* one this fragment was for, or none could take it at all. Every call
|
|
136
|
+
* that could have is returned in `candidates` (empty when none could),
|
|
137
|
+
* and the fragment belongs to none of them — appending it to a guess
|
|
138
|
+
* is exactly the splice this method exists to refuse.
|
|
139
|
+
*/
|
|
140
|
+
placeUnindexedFragment(
|
|
141
|
+
canAccept: (index: number) => boolean,
|
|
142
|
+
):
|
|
143
|
+
| number
|
|
144
|
+
| { readonly candidates: ReadonlyArray<{ readonly index: number; readonly id?: string }> } {
|
|
145
|
+
if (this.opened.size === 0) {
|
|
146
|
+
const index = this.next
|
|
147
|
+
this.opened.add(index)
|
|
148
|
+
this.next = index + 1
|
|
149
|
+
this.latest = index
|
|
150
|
+
return index
|
|
151
|
+
}
|
|
152
|
+
const candidates = [...this.opened].filter(canAccept)
|
|
153
|
+
if (candidates.length === 1) {
|
|
154
|
+
const [index] = candidates as [number]
|
|
155
|
+
this.latest = index
|
|
156
|
+
return index
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
candidates: candidates
|
|
160
|
+
.sort((a, b) => a - b)
|
|
161
|
+
.map((index) => ({ index, id: this.idOf.get(index) })),
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* The index a block close belongs to: its own, or, when it has none, the
|
|
167
|
+
* call its id names, or the call the latest fragment went to.
|
|
168
|
+
*/
|
|
169
|
+
closedIndex(end: { readonly index?: number; readonly id?: string }): number | undefined {
|
|
170
|
+
if (hasIndex(end.index)) return end.index
|
|
171
|
+
return (end.id ? this.byId.get(end.id) : undefined) ?? this.latest
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/** One sentence naming the violation, for an error's detail. */
|
|
176
|
+
export function describeToolCallFramingViolation(violation: ToolCallFramingViolation): string {
|
|
177
|
+
return `the stream reused tool-call index ${violation.index} for call "${violation.newId}" while call "${violation.openId}" held it`
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* A stream sent a fragment with neither an id nor an index while more than
|
|
182
|
+
* one open call could still have been its target, or while none could.
|
|
183
|
+
*
|
|
184
|
+
* {@link ToolCallIndexer.placeUnindexedFragment} places such a fragment only
|
|
185
|
+
* when exactly one open call can still accept more text right now (its
|
|
186
|
+
* buffer empty, or not yet a complete JSON value). Once two calls are both
|
|
187
|
+
* in that state — the ordinary shape of a chat-completions "open" fragment,
|
|
188
|
+
* name and id with empty arguments, sent for one call right after another,
|
|
189
|
+
* before either has streamed any argument text — a later fragment naming
|
|
190
|
+
* neither could belong to either, and there is no field in it that says
|
|
191
|
+
* which. Guessing (placing it on whichever call was merely most recently
|
|
192
|
+
* active) can splice one call's JSON into the other's, and the splice can
|
|
193
|
+
* still happen to parse, so the wrong call runs with no error at all.
|
|
194
|
+
*
|
|
195
|
+
* `candidates` names every call that could have accepted the fragment: more
|
|
196
|
+
* than one when ambiguous, empty when the fragment matched no open call
|
|
197
|
+
* (nothing to route it to, and nothing to blame for it either).
|
|
198
|
+
*/
|
|
199
|
+
export interface ToolCallInterleaving {
|
|
200
|
+
readonly kind: 'interleaved_without_index'
|
|
201
|
+
readonly candidates: ReadonlyArray<{ readonly index: number; readonly id?: string }>
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/** One sentence naming the interleaving, for an error's detail or log line. */
|
|
205
|
+
export function describeToolCallInterleaving(interleaving: ToolCallInterleaving): string {
|
|
206
|
+
if (interleaving.candidates.length === 0) {
|
|
207
|
+
return 'the stream sent a tool-call fragment with neither an index nor an id, and no open call could still have accepted it'
|
|
208
|
+
}
|
|
209
|
+
const names = interleaving.candidates
|
|
210
|
+
.map((c) => (c.id ? `"${c.id}"` : `index ${c.index} (not yet named)`))
|
|
211
|
+
.join(' and ')
|
|
212
|
+
return `the stream sent a tool-call fragment with neither an index nor an id while ${names} could each still have accepted it, with nothing to tell them apart`
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* The `ToolInputError.parseError` given to every call an interleaving names.
|
|
217
|
+
* Reported `reason: 'malformed'`, never `'truncated'`: nothing here says the
|
|
218
|
+
* response was cut off, and "the model moved on to more text, reasoning or
|
|
219
|
+
* another call" — the only other case {@link ToolInputError} models — is
|
|
220
|
+
* exactly what opening a second call means. A call this leaves open may
|
|
221
|
+
* genuinely have gone on to carry valid JSON, if by chance no ambiguous
|
|
222
|
+
* fragment ever decided its fate; it is still reported unreadable rather
|
|
223
|
+
* than risk having guessed right by luck on some other stream.
|
|
224
|
+
*/
|
|
225
|
+
export const INTERLEAVED_TOOL_INPUT_PARSE_ERROR =
|
|
226
|
+
"its fragments arrived interleaved with another call's, with neither carrying an index to tell them apart"
|
package/src/public-runtime.ts
CHANGED
|
@@ -278,9 +278,13 @@ export type { JsonSchemaDialect } from './registry/tool/dialect.js'
|
|
|
278
278
|
// by construction. Exported so a driver or a CI gate can assert it.
|
|
279
279
|
export {
|
|
280
280
|
findPortableSchemaViolations,
|
|
281
|
+
findUndescribedProperties,
|
|
281
282
|
toPortableToolSchema,
|
|
282
283
|
} from './registry/tool/portable.js'
|
|
283
|
-
export type {
|
|
284
|
+
export type {
|
|
285
|
+
PortableSchemaViolation,
|
|
286
|
+
UndescribedPropertyViolation,
|
|
287
|
+
} from './registry/tool/portable.js'
|
|
284
288
|
// The renderer itself, so a driver or a contract test can ask what a tool will
|
|
285
289
|
// actually put on the wire without reaching into the registry.
|
|
286
290
|
export { renderToolSchema, toolWireSchema } from './registry/tool/schema.js'
|
|
@@ -424,6 +428,7 @@ export {
|
|
|
424
428
|
loadSkill,
|
|
425
429
|
resolveSkillChain,
|
|
426
430
|
SKILL_FRONTMATTER_KEYS,
|
|
431
|
+
SkillCollisionError,
|
|
427
432
|
SkillRegistry,
|
|
428
433
|
} from './skills/index.js'
|
|
429
434
|
// The one frontmatter reader. `loadSkill` is built on it, and a host reading
|
|
@@ -450,6 +455,7 @@ export {
|
|
|
450
455
|
loadDirectory,
|
|
451
456
|
} from './directory/index.js'
|
|
452
457
|
export {
|
|
458
|
+
AdvisorCollisionError,
|
|
453
459
|
AdvisorRegistry,
|
|
454
460
|
AdvisoryContext,
|
|
455
461
|
AdvisoryExecutor,
|
|
@@ -464,6 +470,7 @@ export {
|
|
|
464
470
|
defineAgent,
|
|
465
471
|
InvocationLock,
|
|
466
472
|
PipelineAgent,
|
|
473
|
+
QueryAgent,
|
|
467
474
|
ReactiveAgent,
|
|
468
475
|
RouterAgent,
|
|
469
476
|
// The short path: provider + model + prompt. Assembles the identity and
|
|
@@ -552,18 +559,42 @@ export {
|
|
|
552
559
|
BaseRegistry,
|
|
553
560
|
ManagedRegistry,
|
|
554
561
|
PluginRegistry,
|
|
555
|
-
|
|
562
|
+
RegistryCollisionError,
|
|
556
563
|
ToolNameCollisionError,
|
|
557
|
-
ToolRegistry,
|
|
558
|
-
createToolCatalogFromRegistry,
|
|
559
|
-
loadingFromAvailability,
|
|
560
|
-
toolDefinitionToCatalogEntry,
|
|
561
564
|
} from './registry/index.js'
|
|
565
|
+
export type { ManagedRegistryConfig, RegistryCollisionPolicy } from './registry/index.js'
|
|
566
|
+
|
|
567
|
+
// Toolsets (plan.md v3 §1-2): the unit every tool comes from, and the
|
|
568
|
+
// runtime-owned resolver of them. `toolset()` builds a plain static one;
|
|
569
|
+
// `combineToolsets` merges several under one umbrella source, atomically
|
|
570
|
+
// (throwing `ToolsetConflictError` on a name collision instead of silently
|
|
571
|
+
// picking a winner); the rest are composable wrappers over any `Toolset`.
|
|
572
|
+
// `ToolManager` is an advanced API: `query()` builds one per turn from
|
|
573
|
+
// `toolsets`, and a host embedding the execution pipeline directly (rather
|
|
574
|
+
// than through `query()`/the agent classes) builds its own.
|
|
575
|
+
export { combineToolsets, ToolsetConflictError } from './toolsets/combine.js'
|
|
576
|
+
export { defineCapability, dynamicCapability } from './capabilities/index.js'
|
|
577
|
+
export { ToolManager } from './toolsets/manager.js'
|
|
578
|
+
export type { ToolManagerConfig, ToolsetChangeReport } from './toolsets/manager.js'
|
|
579
|
+
export { matchesSourceIdGlob } from './toolsets/source-glob.js'
|
|
580
|
+
export { toolset } from './toolsets/toolset.js'
|
|
581
|
+
export { toToolSourceRef } from './toolsets/types.js'
|
|
582
|
+
export {
|
|
583
|
+
deferred,
|
|
584
|
+
filtered,
|
|
585
|
+
mapTools,
|
|
586
|
+
prefixed,
|
|
587
|
+
renamed,
|
|
588
|
+
readyWhen,
|
|
589
|
+
requireApproval,
|
|
590
|
+
withMetadata,
|
|
591
|
+
} from './toolsets/wrappers.js'
|
|
562
592
|
|
|
563
593
|
export {
|
|
564
594
|
attachShellHooks,
|
|
565
595
|
createShellHook,
|
|
566
596
|
DEFAULT_SHELL_HOOK_TIMEOUT_MS,
|
|
597
|
+
definePlugin,
|
|
567
598
|
discoverAllPluginDirs,
|
|
568
599
|
discoverPlugins,
|
|
569
600
|
loadPluginManifest,
|
|
@@ -576,6 +607,7 @@ export {
|
|
|
576
607
|
shellHookMatches,
|
|
577
608
|
shellHookVerdict,
|
|
578
609
|
} from './plugin/index.js'
|
|
610
|
+
export type { DefinedPlugin, DefinePluginOptions } from './plugin/define.js'
|
|
579
611
|
|
|
580
612
|
export {
|
|
581
613
|
AgentManager,
|
|
@@ -742,6 +774,7 @@ export {
|
|
|
742
774
|
CommandCancellationUnsupportedError,
|
|
743
775
|
ConnectorManager,
|
|
744
776
|
ConnectorRegistry,
|
|
777
|
+
EnvironmentCollisionError,
|
|
745
778
|
EnvironmentConnectorManager,
|
|
746
779
|
ExecutionContextFactory,
|
|
747
780
|
HttpConnector,
|
|
@@ -778,6 +811,8 @@ export {
|
|
|
778
811
|
renderPromptMessages,
|
|
779
812
|
mcpJsonSchemaToZod,
|
|
780
813
|
mcpToolResultToToolResult,
|
|
814
|
+
mcpToolset,
|
|
815
|
+
mcpToolsetName,
|
|
781
816
|
mcpToolToToolDefinition,
|
|
782
817
|
RemoteExecutionContext,
|
|
783
818
|
RemoteExecutionBusyError,
|
|
@@ -788,6 +823,7 @@ export {
|
|
|
788
823
|
ServerStdioTransport,
|
|
789
824
|
StdioTransport,
|
|
790
825
|
StreamableHttpTransport,
|
|
826
|
+
TenantCollisionError,
|
|
791
827
|
TenantConnectorManager,
|
|
792
828
|
toolDefinitionToMCPTool,
|
|
793
829
|
toolResultToMCPToolResult,
|
|
@@ -810,6 +846,8 @@ export type {
|
|
|
810
846
|
MCPToolDrift,
|
|
811
847
|
MCPToolPolicy,
|
|
812
848
|
MCPToolPolicyDecision,
|
|
849
|
+
MCPToolsetOptions,
|
|
850
|
+
MCPToolsets,
|
|
813
851
|
} from './connector/index.js'
|
|
814
852
|
|
|
815
853
|
// ─── bridges (a2a + sse) ─────────────────────────────────────────────────
|
|
@@ -923,7 +961,31 @@ export {
|
|
|
923
961
|
// The one reader of a bash command line the gate itself uses. A host that
|
|
924
962
|
// writes a `predicate` rule about what a line runs decides on this reading,
|
|
925
963
|
// so its rule and the SDK's own never disagree about where a quote ends.
|
|
926
|
-
|
|
964
|
+
// `nestedShellCommand` says which `-c` payloads that reading already
|
|
965
|
+
// includes, so a host treats every other text a program runs as unread.
|
|
966
|
+
export {
|
|
967
|
+
NESTED_SHELLS,
|
|
968
|
+
lexShellCommandLine,
|
|
969
|
+
nestedShellCommand,
|
|
970
|
+
} from './authorization/shell-lexer.js'
|
|
971
|
+
|
|
972
|
+
// Where a command line actually execs a program — unwrapping `sudo`, `env`,
|
|
973
|
+
// `nice`, `timeout` and the rest of a re-exec chain with their own real
|
|
974
|
+
// option grammars, rather than assuming the program sits right after the
|
|
975
|
+
// wrapper's name. The live `bash` tool's escalation, the CLI's
|
|
976
|
+
// scheduled-run floor and its script check all read this the same way, so
|
|
977
|
+
// `env $(echo git) push` and `timeout 5 $(echo systemctl) stop …` cannot be
|
|
978
|
+
// verified by one and missed by another.
|
|
979
|
+
export {
|
|
980
|
+
DYNAMIC_RESOLUTION_VARIABLES,
|
|
981
|
+
hasPoisoningPrefix,
|
|
982
|
+
poisonedProgramPosition,
|
|
983
|
+
poisonsLaterCommands,
|
|
984
|
+
programPositions,
|
|
985
|
+
resolveScriptPrograms,
|
|
986
|
+
unknownProgramInLine,
|
|
987
|
+
} from './authorization/program.js'
|
|
988
|
+
export type { CommandProgramPositions, ProgramPosition } from './authorization/program.js'
|
|
927
989
|
|
|
928
990
|
// NZ-BOOT-03: the module-attributed invariant registry. `compaction.ts` and
|
|
929
991
|
// `claim-disk.ts` register themselves against the shared `invariants`
|
|
@@ -1302,6 +1364,8 @@ export {
|
|
|
1302
1364
|
REVIEW_EXEMPT_WRITES,
|
|
1303
1365
|
REVIEW_MODES,
|
|
1304
1366
|
SANDBOX_ESCAPE_UNATTENDED_REFUSAL,
|
|
1367
|
+
SCREEN_CONSENT_DECLINED_FEEDBACK,
|
|
1368
|
+
SCREEN_CONSENT_UNATTENDED_REFUSAL,
|
|
1305
1369
|
STRICT_MODE_REFUSAL,
|
|
1306
1370
|
batchNeedsReview,
|
|
1307
1371
|
createReviewHandler,
|
|
@@ -1317,6 +1381,7 @@ export { DECLINED_TOOL_CALL_FEEDBACK } from './runtime/query/declined.js'
|
|
|
1317
1381
|
export {
|
|
1318
1382
|
CODING_AGENT_DELEGATION_DOCTRINE,
|
|
1319
1383
|
CODING_AGENT_DOCTRINE_CONTRIBUTION_ID,
|
|
1384
|
+
CODING_AGENT_HYPERMODE_DOCTRINE,
|
|
1320
1385
|
CODING_AGENT_ORCHESTRATE_DOCTRINE,
|
|
1321
1386
|
CODING_AGENT_WORKING_DOCTRINE,
|
|
1322
1387
|
PLAN_MODE_DOCTRINE,
|
|
@@ -1416,7 +1481,6 @@ export type {
|
|
|
1416
1481
|
GoalCommandScope,
|
|
1417
1482
|
KernelCommandOptions,
|
|
1418
1483
|
} from './registry/command/kernel-commands.js'
|
|
1419
|
-
export type { ToolCatalogFromRegistryOptions } from './registry/toolset/catalog.js'
|
|
1420
1484
|
export type { MockBidiScript, MockBidiSession } from './runtime/bidi/mock.js'
|
|
1421
1485
|
export type { BidiTurn, BidiTurnParams } from './runtime/bidi/session.js'
|
|
1422
1486
|
export type { SecretRedactionOptions } from './runtime/query/guardrail-presets.js'
|
|
@@ -1433,7 +1497,13 @@ export type {
|
|
|
1433
1497
|
export type { BroadcastHandoffDeps } from './session/handoff/broadcast.js'
|
|
1434
1498
|
export type { SingleHandoffDeps } from './session/handoff/single.js'
|
|
1435
1499
|
export type { InterventionChainLoader } from './session/intervention/prev-artifact.js'
|
|
1436
|
-
export type {
|
|
1500
|
+
export type {
|
|
1501
|
+
ActionInput,
|
|
1502
|
+
ComputerUseTool,
|
|
1503
|
+
ComputerUseToolOptions,
|
|
1504
|
+
ImageSize,
|
|
1505
|
+
ScreenshotLimits,
|
|
1506
|
+
} from './tools/builtins/computer-use.js'
|
|
1437
1507
|
export type { Project } from './types/project/entity.js'
|
|
1438
1508
|
export type { CreatedLogger } from './utils/log/create-logger.js'
|
|
1439
1509
|
export type {
|
|
@@ -1544,3 +1614,76 @@ export * from './store/session-index/index.js'
|
|
|
1544
1614
|
export * from './store/checkpoint/index.js'
|
|
1545
1615
|
export * from './store/budget/index.js'
|
|
1546
1616
|
export * from './contracts/session/index.js'
|
|
1617
|
+
|
|
1618
|
+
// ─── system events (@experimental) ──────────────────────────────────────
|
|
1619
|
+
//
|
|
1620
|
+
// One envelope for every asynchronous event a running turn reads as
|
|
1621
|
+
// provider-required user-role context. See `runtime/system-events.ts`.
|
|
1622
|
+
|
|
1623
|
+
export {
|
|
1624
|
+
SYSTEM_EVENT_HEADER,
|
|
1625
|
+
SYSTEM_EVENT_KINDS,
|
|
1626
|
+
SYSTEM_EVENT_STATUSES,
|
|
1627
|
+
formatSystemEvent,
|
|
1628
|
+
} from './runtime/system-events.js'
|
|
1629
|
+
|
|
1630
|
+
// ─── peer messaging (@experimental) ─────────────────────────────────────
|
|
1631
|
+
//
|
|
1632
|
+
// Cross-session messaging's SDK half: the live-session registry, the
|
|
1633
|
+
// `namzu-peer/1` transport (server + client), and the runtime-context
|
|
1634
|
+
// rendering of a delivered message or notice. CLI wiring (registry
|
|
1635
|
+
// lifecycle, inbox policy, `/peers`) is a separate workstream. See
|
|
1636
|
+
// `peers/index.ts`.
|
|
1637
|
+
|
|
1638
|
+
export {
|
|
1639
|
+
DEFAULT_PEER_READ_DEADLINE_MS,
|
|
1640
|
+
DeliverRequestSchema,
|
|
1641
|
+
DeliverResponseSchema,
|
|
1642
|
+
DeliverStatusSchema,
|
|
1643
|
+
LONGEST_PEER_SOCKET_FILE_NAME_LENGTH,
|
|
1644
|
+
MAX_OUTSTANDING_PEERS,
|
|
1645
|
+
MAX_OUTSTANDING_PER_PEER,
|
|
1646
|
+
MAX_PEER_CONNECTIONS,
|
|
1647
|
+
MAX_PEER_MESSAGE_TEXT_BYTES,
|
|
1648
|
+
MAX_PEER_REQUEST_BYTES,
|
|
1649
|
+
NoticeRequestSchema,
|
|
1650
|
+
NoticeResponseSchema,
|
|
1651
|
+
OUTSTANDING_EXPIRY_MS,
|
|
1652
|
+
PEER_PROTOCOL_VERSION,
|
|
1653
|
+
PEER_RECORD_VERSION,
|
|
1654
|
+
PeerAddressError,
|
|
1655
|
+
PeerClient,
|
|
1656
|
+
PeerClientError,
|
|
1657
|
+
PeerDirectoryError,
|
|
1658
|
+
PeerEndpointError,
|
|
1659
|
+
PeerFromSchema,
|
|
1660
|
+
PeerNoticeAboutSchema,
|
|
1661
|
+
PeerNoticePayloadSchema,
|
|
1662
|
+
PeerRecordSchema,
|
|
1663
|
+
PeerRefSchema,
|
|
1664
|
+
PeerRegistryError,
|
|
1665
|
+
PeerRequestSchema,
|
|
1666
|
+
PeerSessionKindSchema,
|
|
1667
|
+
PeerSessionStateSchema,
|
|
1668
|
+
PingRequestSchema,
|
|
1669
|
+
PingResponseSchema,
|
|
1670
|
+
SubscribeIdleRequestSchema,
|
|
1671
|
+
SubscribeIdleResponseSchema,
|
|
1672
|
+
createPeerEndpoint,
|
|
1673
|
+
derivePeerRef,
|
|
1674
|
+
formatPeerMessage,
|
|
1675
|
+
formatPeerNotice,
|
|
1676
|
+
hardenPeerRuntimeDir,
|
|
1677
|
+
isPeerRecordLive,
|
|
1678
|
+
listLivePeers,
|
|
1679
|
+
parsePeerAddress,
|
|
1680
|
+
peerSocketFileName,
|
|
1681
|
+
pingPeer,
|
|
1682
|
+
pipePeerAddress,
|
|
1683
|
+
readPeerRecord,
|
|
1684
|
+
readPeerRecords,
|
|
1685
|
+
removePeerRecord,
|
|
1686
|
+
resolvePeerRuntimeDir,
|
|
1687
|
+
udsPeerAddress,
|
|
1688
|
+
writePeerRecord,
|
|
1689
|
+
} from './peers/index.js'
|
package/src/public-tools.ts
CHANGED
|
@@ -32,8 +32,9 @@ export {
|
|
|
32
32
|
untrustedEnvelopeBody,
|
|
33
33
|
wrapUntrusted,
|
|
34
34
|
} from './tools/untrusted-envelope.js'
|
|
35
|
-
export {
|
|
36
|
-
export type {
|
|
35
|
+
export { matchesToolSelector } from './tools/roster.js'
|
|
36
|
+
export type { ToolSelector } from './tools/roster.js'
|
|
37
|
+
export type { UntrustedEnvelope, WrapUntrustedOptions } from './tools/untrusted-envelope.js'
|
|
37
38
|
|
|
38
39
|
// ─── Built-in tools ──────────────────────────────────────────────────────
|
|
39
40
|
|
|
@@ -44,10 +45,29 @@ export { buildResidentHistoryTools } from './tools/resident-history.js'
|
|
|
44
45
|
// input, which is how an `allow` for `git status*` came to approve
|
|
45
46
|
// `git status && rm -rf ~`.
|
|
46
47
|
export { builtinCommandArguments, commandArgumentOf } from './tools/command-arguments.js'
|
|
48
|
+
// Which shell a host-side command runs in, and how to spawn it, so a host
|
|
49
|
+
// that runs a command line outside the `bash` tool itself (a scheduled
|
|
50
|
+
// job's own script, say) resolves the SAME shell the rules already read the
|
|
51
|
+
// line in — never a second, drifting copy of this resolution.
|
|
52
|
+
export {
|
|
53
|
+
type CommandShell,
|
|
54
|
+
type CommandShellProbe,
|
|
55
|
+
findCommandShell,
|
|
56
|
+
findCommandShellForDialect,
|
|
57
|
+
hostCommandShell,
|
|
58
|
+
hostShellSpawn,
|
|
59
|
+
installedCommandShellForDialect,
|
|
60
|
+
withoutBashStartup,
|
|
61
|
+
} from './tools/command-shell.js'
|
|
47
62
|
export { ReadFileTool } from './tools/builtins/read-file.js'
|
|
48
63
|
export { WriteFileTool } from './tools/builtins/write-file.js'
|
|
49
64
|
export { EditTool } from './tools/builtins/edit.js'
|
|
50
|
-
export {
|
|
65
|
+
export {
|
|
66
|
+
BashTool,
|
|
67
|
+
type ExecHostShellProgress,
|
|
68
|
+
SANDBOX_ESCAPE_NOT_APPROVED,
|
|
69
|
+
execHostShell,
|
|
70
|
+
} from './tools/builtins/bash.js'
|
|
51
71
|
export { LSP_TOOL_NAME, LspTool, getCodeNavigationTools } from './tools/builtins/lsp.js'
|
|
52
72
|
export { GlobTool } from './tools/builtins/glob.js'
|
|
53
73
|
export { GrepTool } from './tools/builtins/grep.js'
|
|
@@ -66,7 +86,21 @@ export { WaitForJobTool } from './tools/builtins/wait-for-job.js'
|
|
|
66
86
|
// NOT in the default builtin set: a turn with no skills has nothing for it
|
|
67
87
|
// to do, and offering a tool that can only refuse is worse than not
|
|
68
88
|
// offering it. Hosts register it alongside a skills registry.
|
|
69
|
-
|
|
89
|
+
// `createSkillTool` takes what the host knows about where its model's tools
|
|
90
|
+
// run: `resolveModelDirectory` names the directory the model can open for
|
|
91
|
+
// each skill, which a sandboxed host's own path is not.
|
|
92
|
+
export {
|
|
93
|
+
SKILL_TOOL_NAME,
|
|
94
|
+
SkillTool,
|
|
95
|
+
createSkillTool,
|
|
96
|
+
parseAllowedTools,
|
|
97
|
+
} from './tools/builtins/skill.js'
|
|
98
|
+
export type {
|
|
99
|
+
SkillDirectoryContext,
|
|
100
|
+
SkillDirectoryRequest,
|
|
101
|
+
SkillDirectoryResolver,
|
|
102
|
+
SkillToolOptions,
|
|
103
|
+
} from './tools/builtins/skill.js'
|
|
70
104
|
// Both declare `category: 'network'`, which is what the authorization
|
|
71
105
|
// presets branch on. NOT in the default builtin set: a turn with no web
|
|
72
106
|
// provider has nothing for them to do, and only the `unattended` preset --
|
|
@@ -105,7 +139,11 @@ export {
|
|
|
105
139
|
} from './tools/builtins/structuredOutput.js'
|
|
106
140
|
export {
|
|
107
141
|
COMPUTER_USE_TOOL_NAME,
|
|
142
|
+
HIGH_RES_SCREENSHOT_LIMITS,
|
|
143
|
+
STANDARD_SCREENSHOT_LIMITS,
|
|
144
|
+
computerUseUnavailableReason,
|
|
108
145
|
createComputerUseTool,
|
|
146
|
+
screenshotTargetSize,
|
|
109
147
|
} from './tools/builtins/computer-use.js'
|
|
110
148
|
// The browser contract: the two tools over a host a separate package
|
|
111
149
|
// provides, and the canonicalisers a host and a site-rule compiler must share
|
|
@@ -174,7 +212,7 @@ export {
|
|
|
174
212
|
allConnectorTools,
|
|
175
213
|
connectorInstanceToTools,
|
|
176
214
|
connectorMethodToTool,
|
|
177
|
-
|
|
215
|
+
connectorTools,
|
|
178
216
|
createConnectorExecuteTool,
|
|
179
217
|
createConnectorListTool,
|
|
180
218
|
createConnectorRouterTool,
|