@namzu/sdk 46.0.0 → 48.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +351 -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 +8 -0
- package/dist/authorization/gate.d.ts.map +1 -1
- package/dist/authorization/gate.js +12 -1
- 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 +8 -1
- package/dist/authorization/rules.js.map +1 -1
- package/dist/authorization/shell-lexer.d.ts +19 -4
- package/dist/authorization/shell-lexer.d.ts.map +1 -1
- package/dist/authorization/shell-lexer.js +91 -65
- 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 +71 -4
- package/dist/connector/mcp/adapter.js.map +1 -1
- package/dist/connector/mcp/client.d.ts +32 -4
- package/dist/connector/mcp/client.d.ts.map +1 -1
- package/dist/connector/mcp/client.js +383 -5
- 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/era.d.ts.map +1 -1
- package/dist/connector/mcp/era.js +7 -0
- package/dist/connector/mcp/era.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/mcp/streamable-http.d.ts +15 -0
- package/dist/connector/mcp/streamable-http.d.ts.map +1 -1
- package/dist/connector/mcp/streamable-http.js +281 -6
- package/dist/connector/mcp/streamable-http.js.map +1 -1
- 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 +1 -0
- package/dist/manager/agent/lifecycle.d.ts.map +1 -1
- package/dist/manager/agent/lifecycle.js +146 -18
- 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/initiative.d.ts +6 -6
- package/dist/manager/resident/learning-observation.d.ts +4 -4
- package/dist/manager/resident/learning.d.ts +36 -36
- package/dist/manager/resident/outbox.d.ts +4 -4
- 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/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 +24 -11
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +45 -9
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-tools.d.ts +6 -4
- package/dist/public-tools.d.ts.map +1 -1
- package/dist/public-tools.js +8 -3
- package/dist/public-tools.js.map +1 -1
- package/dist/public-types.d.ts +13 -2
- 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 +7 -7
- package/dist/registry/tool/callable.d.ts.map +1 -1
- package/dist/registry/tool/callable.js +6 -7
- package/dist/registry/tool/callable.js.map +1 -1
- 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 -727
- 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 +45 -2
- package/dist/runtime/query/executor/tool-call-admission.d.ts.map +1 -1
- package/dist/runtime/query/executor/tool-call-admission.js +189 -5
- package/dist/runtime/query/executor/tool-call-admission.js.map +1 -1
- package/dist/runtime/query/executor.d.ts +33 -3
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +86 -10
- 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 +22 -3
- package/dist/runtime/query/review-policy.d.ts.map +1 -1
- package/dist/runtime/query/review-policy.js +84 -6
- 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/scheduler/local.d.ts.map +1 -1
- package/dist/scheduler/local.js +2 -0
- package/dist/scheduler/local.js.map +1 -1
- package/dist/session/retention/archive.js +1 -1
- package/dist/session/retention/archive.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 +12 -0
- package/dist/skills/registry.d.ts.map +1 -1
- package/dist/skills/registry.js +19 -0
- package/dist/skills/registry.js.map +1 -1
- package/dist/store/evidence/index-page.d.ts +2 -2
- package/dist/store/session/disk.d.ts.map +1 -1
- package/dist/store/session/disk.js +2 -0
- package/dist/store/session/disk.js.map +1 -1
- 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/browser.js +2 -2
- package/dist/tools/builtins/browser.js.map +1 -1
- package/dist/tools/builtins/computer-use.d.ts.map +1 -1
- package/dist/tools/builtins/computer-use.js +19 -11
- 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/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/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 +10 -0
- package/dist/tools/defineTool.d.ts.map +1 -1
- package/dist/tools/defineTool.js +17 -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/schedule-tool.d.ts.map +1 -1
- package/dist/tools/schedules/schedule-tool.js +94 -14
- package/dist/tools/schedules/schedule-tool.js.map +1 -1
- package/dist/tools/schedules/types.d.ts +52 -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/scheduler.d.ts +6 -1
- package/dist/types/agent/scheduler.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/agent/task.d.ts +19 -1
- package/dist/types/agent/task.d.ts.map +1 -1
- package/dist/types/agent/task.js.map +1 -1
- package/dist/types/authorization/index.d.ts +49 -12
- package/dist/types/authorization/index.d.ts.map +1 -1
- package/dist/types/authorization/index.js +6 -0
- package/dist/types/authorization/index.js.map +1 -1
- package/dist/types/connector/mcp.d.ts +45 -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/session/sub-session.d.ts +2 -0
- package/dist/types/session/sub-session.d.ts.map +1 -1
- package/dist/types/tool/index.d.ts +152 -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 +1 -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 +21 -1
- package/src/authorization/program.ts +773 -0
- package/src/authorization/reexec-wrapper.ts +589 -0
- package/src/authorization/rules.ts +18 -1
- package/src/authorization/shell-lexer.ts +104 -59
- 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 +73 -3
- package/src/connector/mcp/client.ts +425 -6
- package/src/connector/mcp/discovery.ts +60 -0
- package/src/connector/mcp/era.ts +7 -0
- package/src/connector/mcp/index.ts +13 -0
- package/src/connector/mcp/mcp-toolset.ts +515 -0
- package/src/connector/mcp/streamable-http.ts +302 -5
- 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 +167 -19
- 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/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 +136 -7
- package/src/public-tools.ts +24 -4
- package/src/public-types.ts +60 -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 +8 -9
- package/src/registry/tool/execute.ts +16 -846
- 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 +228 -6
- package/src/runtime/query/executor.ts +110 -12
- 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 +87 -9
- 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/scheduler/local.ts +2 -0
- package/src/session/retention/archive.ts +1 -1
- package/src/skills/index.ts +1 -1
- package/src/skills/registry.ts +25 -0
- package/src/store/session/disk.ts +3 -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/browser.ts +2 -2
- package/src/tools/builtins/computer-use.ts +21 -11
- package/src/tools/builtins/edit.ts +12 -2
- package/src/tools/builtins/json-string-hint.ts +16 -0
- package/src/tools/builtins/search-tools.ts +7 -20
- 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 +28 -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/schedule-tool.ts +107 -14
- package/src/tools/schedules/types.ts +52 -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/scheduler.ts +6 -1
- package/src/types/agent/supervisor.ts +5 -2
- package/src/types/agent/task.ts +21 -1
- package/src/types/authorization/index.ts +12 -0
- package/src/types/connector/mcp.ts +46 -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/session/sub-session.ts +2 -0
- package/src/types/tool/index.ts +154 -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,4 +1,4 @@
|
|
|
1
|
-
import type { GoalId } from '../ids/index.js'
|
|
1
|
+
import type { GoalId, MessageId } from '../ids/index.js'
|
|
2
2
|
|
|
3
3
|
export type MessageRole = 'system' | 'user' | 'assistant' | 'tool'
|
|
4
4
|
|
|
@@ -105,7 +105,7 @@ export interface Citation {
|
|
|
105
105
|
* An attachment whose bytes are held by a store, not by the message.
|
|
106
106
|
*
|
|
107
107
|
* Structural rather than an import from `store/attachment`, so this types
|
|
108
|
-
* module keeps depending on nothing — the same reasoning `
|
|
108
|
+
* module keeps depending on nothing — the same reasoning `ToolsView`
|
|
109
109
|
* gives. `store/attachment` owns the resolution and its refusals; this is
|
|
110
110
|
* the shape a message may carry.
|
|
111
111
|
*
|
|
@@ -144,18 +144,106 @@ export interface ToolCall {
|
|
|
144
144
|
* JSON payload, while provider/runtime recovery state lives here.
|
|
145
145
|
*/
|
|
146
146
|
metadata?: {
|
|
147
|
+
/**
|
|
148
|
+
* The streamed arguments could not be read, and `function.arguments`
|
|
149
|
+
* was normalized to `"{}"`. Set for every unreadable call, cut off or
|
|
150
|
+
* malformed alike: the name predates that distinction, and
|
|
151
|
+
* {@link inputError} is what says which it was.
|
|
152
|
+
*/
|
|
147
153
|
inputTruncated?: boolean
|
|
148
154
|
/**
|
|
149
|
-
* The
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
155
|
+
* The argument buffer as it arrived, when it could not be read.
|
|
156
|
+
* `function.arguments` is normalized to `"{}"` in that case so tool
|
|
157
|
+
* args stay clean, which leaves this as the only record of what the
|
|
158
|
+
* model was actually saying — and a `repairToolCall` hook has nothing
|
|
159
|
+
* to repair without it.
|
|
154
160
|
*/
|
|
155
161
|
partialArguments?: string
|
|
162
|
+
/**
|
|
163
|
+
* Why the arguments could not be read. Present with
|
|
164
|
+
* {@link inputTruncated} on every call the runtime marked; absent on a
|
|
165
|
+
* call marked by an older runtime, which recorded only the flag.
|
|
166
|
+
*/
|
|
167
|
+
inputError?: ToolInputError
|
|
156
168
|
}
|
|
157
169
|
}
|
|
158
170
|
|
|
171
|
+
/**
|
|
172
|
+
* Why a streamed tool call's arguments could not be read. See
|
|
173
|
+
* {@link ToolInputError}.
|
|
174
|
+
*/
|
|
175
|
+
export type ToolInputErrorReason = 'truncated' | 'malformed'
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* A tool call whose streamed arguments did not parse as JSON, and why.
|
|
179
|
+
*
|
|
180
|
+
* An output limit, a content filter or a dropped stream stops a response
|
|
181
|
+
* wherever it is, so only the call the response was streaming at that moment
|
|
182
|
+
* can have been cut off: the last one, with nothing the model streamed after
|
|
183
|
+
* it. For that call the finish reason decides, never the text:
|
|
184
|
+
*
|
|
185
|
+
* - `truncated` — the response stopped before the model closed the
|
|
186
|
+
* arguments. It reached its output limit (`finishReason: 'length'`), a
|
|
187
|
+
* content filter stopped it (`'content_filter'`), or the stream ended
|
|
188
|
+
* without reporting a finish reason at all.
|
|
189
|
+
* - `malformed` — the response finished normally (`'stop'` or
|
|
190
|
+
* `'tool_calls'`) and the arguments still were not valid JSON.
|
|
191
|
+
*
|
|
192
|
+
* Every other unreadable call is `malformed`, whatever the finish reason:
|
|
193
|
+
* the model moved on to more text, reasoning or another call, so it had
|
|
194
|
+
* finished writing this one.
|
|
195
|
+
*/
|
|
196
|
+
export interface ToolInputError {
|
|
197
|
+
readonly reason: ToolInputErrorReason
|
|
198
|
+
/** How the response ended, as the provider reported it. Absent when the stream reported nothing. */
|
|
199
|
+
readonly finishReason?: 'stop' | 'tool_calls' | 'length' | 'content_filter'
|
|
200
|
+
/**
|
|
201
|
+
* `'context_window'` when a `'length'` finish was the model's context
|
|
202
|
+
* window rather than its output token limit (`StreamChunk.finishDetail`).
|
|
203
|
+
*/
|
|
204
|
+
readonly finishDetail?: 'context_window'
|
|
205
|
+
/** The JSON parser's own message. */
|
|
206
|
+
readonly parseError: string
|
|
207
|
+
/**
|
|
208
|
+
* Zero-based character offset in the arguments where parsing failed: the
|
|
209
|
+
* first character that cannot continue valid JSON, or their length when
|
|
210
|
+
* the text simply ended. Found by scanning the arguments, so it is there
|
|
211
|
+
* when {@link parseError} names no position, as for a bare `True` or
|
|
212
|
+
* `None`.
|
|
213
|
+
*/
|
|
214
|
+
readonly offset?: number
|
|
215
|
+
/** How many characters of arguments arrived. */
|
|
216
|
+
readonly length: number
|
|
217
|
+
/**
|
|
218
|
+
* How many characters the response streamed before this call began: its
|
|
219
|
+
* text, its visible reasoning and the arguments of earlier tool calls.
|
|
220
|
+
* Text a driver adds of its own is not counted. For a `truncated` call,
|
|
221
|
+
* which nothing followed, this plus {@link length} is everything the
|
|
222
|
+
* response streamed as text. It is not everything the response spent:
|
|
223
|
+
* reasoning a provider does not stream (encrypted, summarised, or only
|
|
224
|
+
* counted) uses the output limit too, and {@link outputTokens} and
|
|
225
|
+
* {@link reasoningTokens} are what show it.
|
|
226
|
+
*/
|
|
227
|
+
readonly precedingLength: number
|
|
228
|
+
/**
|
|
229
|
+
* The output tokens the whole response used, reasoning included, as the
|
|
230
|
+
* provider reported them when it ended. Present on a `truncated` call when
|
|
231
|
+
* the provider reported any.
|
|
232
|
+
*
|
|
233
|
+
* After an output limit it says whether the visible text accounts for the
|
|
234
|
+
* limit: when most of the output went to reasoning, or to anything else
|
|
235
|
+
* the stream did not carry, the call is not what filled the response, and
|
|
236
|
+
* the model is told so rather than told to shrink the call.
|
|
237
|
+
*/
|
|
238
|
+
readonly outputTokens?: number
|
|
239
|
+
/**
|
|
240
|
+
* Of {@link outputTokens}, the tokens the provider says went to reasoning.
|
|
241
|
+
* Present only when the provider reports that split; absent means unknown,
|
|
242
|
+
* not zero.
|
|
243
|
+
*/
|
|
244
|
+
readonly reasoningTokens?: number
|
|
245
|
+
}
|
|
246
|
+
|
|
159
247
|
export interface BaseMessage {
|
|
160
248
|
/**
|
|
161
249
|
* Widened from `string | null` so `ToolMessage` can carry content
|
|
@@ -167,6 +255,22 @@ export interface BaseMessage {
|
|
|
167
255
|
content: string | null | readonly ToolResultBlock[]
|
|
168
256
|
timestamp?: number
|
|
169
257
|
cacheHint?: CacheHint
|
|
258
|
+
/**
|
|
259
|
+
* The id of the durable `message` record this message was written as, or
|
|
260
|
+
* a `message_replaced` record's `targetMessageId` when a guardrail,
|
|
261
|
+
* review or structured-output override replaced its content in place.
|
|
262
|
+
* Absent means the kernel has not recorded this exact message: a host
|
|
263
|
+
* just constructed it, or it is a compaction's own summary (a bulk
|
|
264
|
+
* spilled or inline array, which carries no per-message id — see
|
|
265
|
+
* `docs/sdk/session-log.md`).
|
|
266
|
+
*
|
|
267
|
+
* Set by the kernel alone, never by a caller: `query()` stamps every
|
|
268
|
+
* message it folds from the session log or records fresh, on `Turn.messages`,
|
|
269
|
+
* on the messages `onConversationMessages` reports, and on a checkpoint's
|
|
270
|
+
* restored messages. A caller that mints its own id here gets `conflict`
|
|
271
|
+
* on the next turn — this log never recorded it under that name.
|
|
272
|
+
*/
|
|
273
|
+
readonly id?: MessageId
|
|
170
274
|
/**
|
|
171
275
|
* Exempt this message from compaction and from tool-result clearing.
|
|
172
276
|
*
|
|
@@ -248,6 +352,8 @@ export const RUNTIME_CONTEXT_MESSAGE_KINDS = [
|
|
|
248
352
|
'auto-continuation',
|
|
249
353
|
'job-exit',
|
|
250
354
|
'limit-finalization',
|
|
355
|
+
'peer-message',
|
|
356
|
+
'peer-notice',
|
|
251
357
|
'repeat-call',
|
|
252
358
|
'steering',
|
|
253
359
|
'step-context',
|
|
@@ -445,6 +551,13 @@ export type ToolResultBlock =
|
|
|
445
551
|
*/
|
|
446
552
|
export type ToolResultContent = string | readonly ToolResultBlock[]
|
|
447
553
|
|
|
554
|
+
/** A schema reveal bound to the source that contributed that exact tool. */
|
|
555
|
+
export interface ToolRevealReceipt {
|
|
556
|
+
readonly name: string
|
|
557
|
+
readonly sourceId: string
|
|
558
|
+
readonly sourceKind: import('../toolset/index.js').ToolSourceKind
|
|
559
|
+
}
|
|
560
|
+
|
|
448
561
|
export interface ToolMessage extends BaseMessage {
|
|
449
562
|
role: 'tool'
|
|
450
563
|
content: ToolResultContent
|
|
@@ -460,6 +573,19 @@ export interface ToolMessage extends BaseMessage {
|
|
|
460
573
|
* fired and namzu relied on prose formatting to convey failure.
|
|
461
574
|
*/
|
|
462
575
|
isError?: boolean
|
|
576
|
+
/**
|
|
577
|
+
* Source-bound receipts for deferred schemas loaded by a successful
|
|
578
|
+
* {@link ToolResult.reveals} (`types/tool/index.ts`). The executor writes
|
|
579
|
+
* these onto the message it built from that result.
|
|
580
|
+
*
|
|
581
|
+
* This is what `ToolManager.availability` (`toolsets/manager.ts`) scans
|
|
582
|
+
* the post-compaction history for, instead of a mutable activation map:
|
|
583
|
+
* a deferred tool is active once a matching receipt appears after the
|
|
584
|
+
* last compaction summary and the host still reports it ready. Persisted
|
|
585
|
+
* like any other message field — a session log or checkpoint already
|
|
586
|
+
* carries this too, with nothing extra to serialize.
|
|
587
|
+
*/
|
|
588
|
+
revealedTools?: readonly ToolRevealReceipt[]
|
|
463
589
|
}
|
|
464
590
|
|
|
465
591
|
export type Message = SystemMessage | UserMessage | AssistantMessage | ToolMessage
|
|
@@ -539,12 +665,14 @@ export function createToolMessage(
|
|
|
539
665
|
content: ToolResultContent,
|
|
540
666
|
toolCallId: string,
|
|
541
667
|
isError?: boolean,
|
|
668
|
+
revealedTools?: readonly ToolRevealReceipt[],
|
|
542
669
|
): ToolMessage {
|
|
543
670
|
return {
|
|
544
671
|
role: 'tool',
|
|
545
672
|
content,
|
|
546
673
|
toolCallId,
|
|
547
674
|
...(isError !== undefined ? { isError } : {}),
|
|
675
|
+
...(revealedTools && revealedTools.length > 0 ? { revealedTools } : {}),
|
|
548
676
|
timestamp: Date.now(),
|
|
549
677
|
}
|
|
550
678
|
}
|
|
@@ -326,26 +326,41 @@ export function assertPluginHookResult(result: PluginHookResult): asserts result
|
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
329
|
+
/** Actions the query can interpret for a particular hook event. */
|
|
330
|
+
export type PluginHookResultFor<E extends PluginHookEvent> = E extends 'user_prompt_submit'
|
|
331
|
+
? Extract<PluginHookResult, { action: 'continue' | 'annotate' | 'skip' | 'error' }>
|
|
332
|
+
: E extends 'pre_tool_use'
|
|
333
|
+
? Extract<PluginHookResult, { action: 'continue' | 'skip' | 'modify' | 'error' }>
|
|
334
|
+
: E extends 'post_tool_use'
|
|
335
|
+
? Extract<PluginHookResult, { action: 'continue' | 'replace' | 'retry' | 'error' }>
|
|
336
|
+
: E extends 'turn_interrupt' | 'session_start' | 'session_end'
|
|
337
|
+
? Extract<PluginHookResult, { action: 'continue' }>
|
|
338
|
+
: Extract<PluginHookResult, { action: 'continue' | 'error' }>
|
|
339
|
+
|
|
340
|
+
/** The event and its handler verdict stay correlated, including in hook arrays. */
|
|
341
|
+
export type PluginHookDefinition<E extends PluginHookEvent = PluginHookEvent> =
|
|
342
|
+
E extends PluginHookEvent
|
|
343
|
+
? {
|
|
344
|
+
readonly event: E
|
|
345
|
+
readonly handler: (context: PluginHookContext) => Promise<PluginHookResultFor<E>>
|
|
346
|
+
/**
|
|
347
|
+
* Lower runs first. Default 100.
|
|
348
|
+
*
|
|
349
|
+
* Order was install order, which is neither declared nor stable — it
|
|
350
|
+
* depends on when each plugin happened to be installed. That is fine
|
|
351
|
+
* for hooks that only observe, and wrong for the ones that decide:
|
|
352
|
+
* `executeHooks` SHORT-CIRCUITS on `skip` and `error`, so a hook that
|
|
353
|
+
* denies a dangerous command only gets to deny it if it runs before
|
|
354
|
+
* whatever else stops the chain. A guard that fires depending on
|
|
355
|
+
* installation history is not a guard.
|
|
356
|
+
*
|
|
357
|
+
* Ties keep registration order, so plugins that never set a priority
|
|
358
|
+
* behave exactly as before. Convention: guards below 100, observers
|
|
359
|
+
* above.
|
|
360
|
+
*/
|
|
361
|
+
readonly priority?: number
|
|
362
|
+
}
|
|
363
|
+
: never
|
|
349
364
|
|
|
350
365
|
// ---------------------------------------------------------------------------
|
|
351
366
|
// Plugin MCP server config
|
|
@@ -367,6 +382,8 @@ export interface PluginManifest {
|
|
|
367
382
|
readonly version: string
|
|
368
383
|
readonly description: string
|
|
369
384
|
readonly author?: string
|
|
385
|
+
/** Plugin-authored request context, present only while this plugin is enabled. */
|
|
386
|
+
readonly instructions?: string
|
|
370
387
|
readonly tools?: readonly string[]
|
|
371
388
|
readonly skills?: readonly string[]
|
|
372
389
|
readonly hooks?: readonly string[]
|
|
@@ -391,6 +408,7 @@ export const PluginManifestSchema = z.object({
|
|
|
391
408
|
version: z.string().min(1),
|
|
392
409
|
description: z.string().min(1),
|
|
393
410
|
author: z.string().optional(),
|
|
411
|
+
instructions: z.string().min(1).optional(),
|
|
394
412
|
tools: z.array(z.string()).max(MAX_TOOLS_PER_PLUGIN).optional(),
|
|
395
413
|
skills: z.array(z.string()).max(MAX_SKILLS_PER_PLUGIN).optional(),
|
|
396
414
|
hooks: z.array(z.string()).max(MAX_HOOKS_PER_PLUGIN).optional(),
|
|
@@ -419,7 +437,12 @@ export interface PluginDefinition {
|
|
|
419
437
|
// ---------------------------------------------------------------------------
|
|
420
438
|
|
|
421
439
|
export type PluginLifecycleEvent =
|
|
422
|
-
| {
|
|
440
|
+
| {
|
|
441
|
+
type: 'plugin_installed'
|
|
442
|
+
pluginId: PluginId
|
|
443
|
+
name: string
|
|
444
|
+
scope: PluginScope
|
|
445
|
+
}
|
|
423
446
|
| { type: 'plugin_enabled'; pluginId: PluginId; name: string }
|
|
424
447
|
| { type: 'plugin_disabled'; pluginId: PluginId; name: string }
|
|
425
448
|
| { type: 'plugin_uninstalled'; pluginId: PluginId; name: string }
|
|
@@ -193,5 +193,10 @@ export interface ChatCompletionResponse {
|
|
|
193
193
|
citations?: readonly import('../message/index.js').Citation[]
|
|
194
194
|
}
|
|
195
195
|
finishReason: 'stop' | 'tool_calls' | 'length' | 'content_filter'
|
|
196
|
+
/**
|
|
197
|
+
* `'context_window'` when a `'length'` finish was the model's context
|
|
198
|
+
* window rather than the output token limit; see `StreamChunk.finishDetail`.
|
|
199
|
+
*/
|
|
200
|
+
finishDetail?: 'context_window'
|
|
196
201
|
usage: TokenUsage
|
|
197
202
|
}
|
|
@@ -38,9 +38,14 @@ export interface MockToolCall {
|
|
|
38
38
|
/** Fragment size for the argument JSON; smaller exercises more buffering. */
|
|
39
39
|
argChunkSize?: number
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
41
|
+
* Send only the first half of the arguments, omit the block-close signal
|
|
42
|
+
* and finish with `'length'` (unless the turn sets `finishReason`),
|
|
43
|
+
* reproducing the provider cutting a tool call off at `max_tokens`. The
|
|
44
|
+
* response ends at this call, as an output limit ends it: later calls in
|
|
45
|
+
* the turn's `toolCalls` are not streamed. The consumer should mark the
|
|
46
|
+
* call `inputTruncated` with a `truncated` `inputError` rather than
|
|
47
|
+
* crashing on a parse; under a scripted `finishReason` of `'stop'` or
|
|
48
|
+
* `'tool_calls'` it is `malformed` instead.
|
|
44
49
|
*/
|
|
45
50
|
truncateArguments?: boolean
|
|
46
51
|
/**
|
|
@@ -29,8 +29,28 @@ export interface StreamChunk {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
content?: string
|
|
32
|
+
/**
|
|
33
|
+
* Who wrote {@link content}. Absent means the model. `'driver'` marks
|
|
34
|
+
* text a driver adds of its own after the model's output, such as a
|
|
35
|
+
* list of the sources a hosted search used. It is shown and kept in
|
|
36
|
+
* the message like any other text, but it is not output the model
|
|
37
|
+
* produced: the turn loop does not read it as the model moving on from
|
|
38
|
+
* its last tool call, which would turn a call the output limit cut
|
|
39
|
+
* off into a malformed one.
|
|
40
|
+
*/
|
|
41
|
+
contentOrigin?: 'driver'
|
|
32
42
|
/** Identity and phase of this content fragment, when the provider supplies them. */
|
|
33
43
|
textPart?: Omit<import('../message/index.js').AssistantTextPart, 'text'>
|
|
44
|
+
/**
|
|
45
|
+
* Fragments of tool calls. `index` is what groups them: every fragment
|
|
46
|
+
* of one call carries the same index, and no other call in the
|
|
47
|
+
* response uses it. The call's `id` and `function.name` may arrive on
|
|
48
|
+
* any of its fragments, including after arguments; arguments that
|
|
49
|
+
* arrive first are kept for the call at their index. The turn loop gives
|
|
50
|
+
* a call whose id never arrives, here or on `toolCallEnd`, an id of its
|
|
51
|
+
* own. A second id on an index another call holds is refused, by the
|
|
52
|
+
* turn loop and by `collectChatCompletion`.
|
|
53
|
+
*/
|
|
34
54
|
toolCalls?: Array<{
|
|
35
55
|
index: number
|
|
36
56
|
id?: string
|
|
@@ -52,6 +72,12 @@ export interface StreamChunk {
|
|
|
52
72
|
* leave this undefined; the orchestrator infers from
|
|
53
73
|
* end-of-stream instead.
|
|
54
74
|
*
|
|
75
|
+
* `id` fills in the call's id when no fragment carried one. The
|
|
76
|
+
* completion always carries the id the call was announced with, and
|
|
77
|
+
* follows the announcement: a close with an empty `id` for a call no
|
|
78
|
+
* fragment named, or for a call whose name has not arrived, is
|
|
79
|
+
* settled when the stream ends instead.
|
|
80
|
+
*
|
|
55
81
|
* Added 2026-05-01 (ses_001-tool-stream-events A9).
|
|
56
82
|
*/
|
|
57
83
|
toolCallEnd?: {
|
|
@@ -93,6 +119,19 @@ export interface StreamChunk {
|
|
|
93
119
|
citation?: import('../message/index.js').Citation
|
|
94
120
|
}
|
|
95
121
|
finishReason?: 'stop' | 'tool_calls' | 'length' | 'content_filter'
|
|
122
|
+
/**
|
|
123
|
+
* Which limit a `'length'` finish reached, when it was not the output
|
|
124
|
+
* token limit: `'context_window'` when the response filled the model's
|
|
125
|
+
* context window (a stop reason such as `model_context_window_exceeded`
|
|
126
|
+
* or `model_length`).
|
|
127
|
+
*
|
|
128
|
+
* Both stop the output where it stands, so both are `'length'`, and a
|
|
129
|
+
* tool call either one cut off is truncated. They differ in what can
|
|
130
|
+
* follow: after the output limit the turn loop asks the model to continue
|
|
131
|
+
* a reply it cut off mid-text, and after the context window there is no
|
|
132
|
+
* room to continue into. Set only with `finishReason: 'length'`.
|
|
133
|
+
*/
|
|
134
|
+
finishDetail?: 'context_window'
|
|
96
135
|
usage?: TokenUsage
|
|
97
136
|
error?: string
|
|
98
137
|
|
|
@@ -466,7 +466,7 @@ export interface SandboxDestroyOptions {
|
|
|
466
466
|
* - `azureFileShare` — mount an Azure Files SMB share into the
|
|
467
467
|
* container. Used by managed Azure Container Instances (incl.
|
|
468
468
|
* Standby Pool) which have no host filesystem to bind from; the
|
|
469
|
-
*
|
|
469
|
+
* host provisions a per-task share before claim and
|
|
470
470
|
* the ACI backend translates this variant to ACI's `volume +
|
|
471
471
|
* azureFile` shape.
|
|
472
472
|
*/
|
|
@@ -1096,11 +1096,22 @@ type CoreSessionEvent =
|
|
|
1096
1096
|
toolUseId: ToolUseId
|
|
1097
1097
|
input: unknown
|
|
1098
1098
|
/**
|
|
1099
|
-
* True when the
|
|
1100
|
-
*
|
|
1101
|
-
*
|
|
1099
|
+
* True when the streamed arguments could not be read, whether the
|
|
1100
|
+
* response stopped before they closed or they were not valid JSON;
|
|
1101
|
+
* {@link inputError} says which. `input` is then `{}`, a sanitized
|
|
1102
|
+
* object, so public consumers never receive internal recovery
|
|
1103
|
+
* sentinels.
|
|
1102
1104
|
*/
|
|
1103
1105
|
inputTruncated?: boolean
|
|
1106
|
+
/** Why the arguments could not be read. Present exactly when `inputTruncated` is. */
|
|
1107
|
+
inputError?: import('../message/index.js').ToolInputError
|
|
1108
|
+
/**
|
|
1109
|
+
* The arguments as they arrived, when they could not be read: at most
|
|
1110
|
+
* the first 16 384 characters, with `inputError.length` saying how many
|
|
1111
|
+
* there were. The whole text stays on the assistant message, as
|
|
1112
|
+
* `ToolCall.metadata.partialArguments`.
|
|
1113
|
+
*/
|
|
1114
|
+
partialArguments?: string
|
|
1104
1115
|
}
|
|
1105
1116
|
|
|
1106
1117
|
/**
|
|
@@ -100,6 +100,8 @@ export interface SubSession {
|
|
|
100
100
|
failureMode: FailureMode
|
|
101
101
|
completionMode: CompletionMode
|
|
102
102
|
workspaceId: WorkspaceId | null
|
|
103
|
+
/** Keep this delegated workspace when the child ends or its session is archived. */
|
|
104
|
+
workspaceRetention?: 'retain'
|
|
103
105
|
/**
|
|
104
106
|
* For interventions, the immutable artifact being addressed. Chains form
|
|
105
107
|
* a strict acyclic DAG — see session-hierarchy.md §4.5.
|