@namzu/sdk 45.1.0 → 48.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +436 -8
- package/README.md +7 -8
- package/dist/advisory/history.d.ts.map +1 -1
- package/dist/advisory/history.js +21 -1
- package/dist/advisory/history.js.map +1 -1
- package/dist/advisory/index.d.ts +1 -1
- package/dist/advisory/index.d.ts.map +1 -1
- package/dist/advisory/index.js +1 -1
- package/dist/advisory/index.js.map +1 -1
- package/dist/advisory/registry.d.ts +17 -0
- package/dist/advisory/registry.d.ts.map +1 -1
- package/dist/advisory/registry.js +26 -0
- package/dist/advisory/registry.js.map +1 -1
- package/dist/agents/PipelineAgent.d.ts +2 -46
- package/dist/agents/PipelineAgent.d.ts.map +1 -1
- package/dist/agents/PipelineAgent.js +2 -242
- package/dist/agents/PipelineAgent.js.map +1 -1
- package/dist/agents/QueryAgent.d.ts +21 -0
- package/dist/agents/QueryAgent.d.ts.map +1 -0
- package/dist/agents/QueryAgent.js +214 -0
- package/dist/agents/QueryAgent.js.map +1 -0
- package/dist/agents/ReactiveAgent.d.ts +4 -16
- package/dist/agents/ReactiveAgent.d.ts.map +1 -1
- package/dist/agents/ReactiveAgent.js +4 -183
- package/dist/agents/ReactiveAgent.js.map +1 -1
- package/dist/agents/RouterAgent.d.ts +2 -20
- package/dist/agents/RouterAgent.d.ts.map +1 -1
- package/dist/agents/RouterAgent.js +2 -266
- package/dist/agents/RouterAgent.js.map +1 -1
- package/dist/agents/SupervisorAgent.d.ts +3 -43
- package/dist/agents/SupervisorAgent.d.ts.map +1 -1
- package/dist/agents/SupervisorAgent.js +3 -418
- package/dist/agents/SupervisorAgent.js.map +1 -1
- package/dist/agents/defineAgent.d.ts +2 -1
- package/dist/agents/defineAgent.d.ts.map +1 -1
- package/dist/agents/defineAgent.js +6 -1
- package/dist/agents/defineAgent.js.map +1 -1
- package/dist/agents/examples/PipelineAgent.d.ts +46 -0
- package/dist/agents/examples/PipelineAgent.d.ts.map +1 -0
- package/dist/agents/examples/PipelineAgent.js +242 -0
- package/dist/agents/examples/PipelineAgent.js.map +1 -0
- package/dist/agents/examples/RouterAgent.d.ts +22 -0
- package/dist/agents/examples/RouterAgent.d.ts.map +1 -0
- package/dist/agents/examples/RouterAgent.js +268 -0
- package/dist/agents/examples/RouterAgent.js.map +1 -0
- package/dist/agents/examples/SupervisorAgent.d.ts +45 -0
- package/dist/agents/examples/SupervisorAgent.d.ts.map +1 -0
- package/dist/agents/examples/SupervisorAgent.js +406 -0
- package/dist/agents/examples/SupervisorAgent.js.map +1 -0
- package/dist/agents/explore.d.ts +6 -3
- package/dist/agents/explore.d.ts.map +1 -1
- package/dist/agents/explore.js +6 -3
- package/dist/agents/explore.js.map +1 -1
- package/dist/agents/forward-options.d.ts +11 -0
- package/dist/agents/forward-options.d.ts.map +1 -0
- package/dist/agents/forward-options.js +15 -0
- package/dist/agents/forward-options.js.map +1 -0
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +2 -0
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/runAgent.d.ts +19 -8
- package/dist/agents/runAgent.d.ts.map +1 -1
- package/dist/agents/runAgent.js +99 -29
- package/dist/agents/runAgent.js.map +1 -1
- package/dist/authorization/command-line.d.ts +2 -0
- package/dist/authorization/command-line.d.ts.map +1 -1
- package/dist/authorization/command-line.js +2 -2
- package/dist/authorization/command-line.js.map +1 -1
- package/dist/authorization/gate.d.ts +13 -2
- package/dist/authorization/gate.d.ts.map +1 -1
- package/dist/authorization/gate.js +37 -5
- package/dist/authorization/gate.js.map +1 -1
- package/dist/authorization/program.d.ts +151 -0
- package/dist/authorization/program.d.ts.map +1 -0
- package/dist/authorization/program.js +713 -0
- package/dist/authorization/program.js.map +1 -0
- package/dist/authorization/reexec-wrapper.d.ts +106 -0
- package/dist/authorization/reexec-wrapper.d.ts.map +1 -0
- package/dist/authorization/reexec-wrapper.js +532 -0
- package/dist/authorization/reexec-wrapper.js.map +1 -0
- package/dist/authorization/rules.d.ts +9 -0
- package/dist/authorization/rules.d.ts.map +1 -1
- package/dist/authorization/rules.js +27 -1
- package/dist/authorization/rules.js.map +1 -1
- package/dist/authorization/shell-lexer.d.ts +39 -0
- package/dist/authorization/shell-lexer.d.ts.map +1 -1
- package/dist/authorization/shell-lexer.js +113 -69
- package/dist/authorization/shell-lexer.js.map +1 -1
- package/dist/bridge/sse/mapper.d.ts.map +1 -1
- package/dist/bridge/sse/mapper.js +6 -0
- package/dist/bridge/sse/mapper.js.map +1 -1
- package/dist/capabilities/index.d.ts +54 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +92 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/config/registry.d.ts +2 -1
- package/dist/config/registry.d.ts.map +1 -1
- package/dist/config/registry.js +3 -2
- package/dist/config/registry.js.map +1 -1
- package/dist/connector/index.d.ts +4 -4
- package/dist/connector/index.d.ts.map +1 -1
- package/dist/connector/index.js +3 -3
- package/dist/connector/index.js.map +1 -1
- package/dist/connector/mcp/adapter.d.ts +16 -1
- package/dist/connector/mcp/adapter.d.ts.map +1 -1
- package/dist/connector/mcp/adapter.js +60 -4
- package/dist/connector/mcp/adapter.js.map +1 -1
- package/dist/connector/mcp/client.d.ts +13 -4
- package/dist/connector/mcp/client.d.ts.map +1 -1
- package/dist/connector/mcp/client.js +20 -3
- package/dist/connector/mcp/client.js.map +1 -1
- package/dist/connector/mcp/discovery.d.ts +24 -1
- package/dist/connector/mcp/discovery.d.ts.map +1 -1
- package/dist/connector/mcp/discovery.js +44 -0
- package/dist/connector/mcp/discovery.js.map +1 -1
- package/dist/connector/mcp/index.d.ts +2 -0
- package/dist/connector/mcp/index.d.ts.map +1 -1
- package/dist/connector/mcp/index.js +11 -0
- package/dist/connector/mcp/index.js.map +1 -1
- package/dist/connector/mcp/mcp-toolset.d.ts +133 -0
- package/dist/connector/mcp/mcp-toolset.d.ts.map +1 -0
- package/dist/connector/mcp/mcp-toolset.js +399 -0
- package/dist/connector/mcp/mcp-toolset.js.map +1 -0
- package/dist/connector/tools/index.d.ts +2 -2
- package/dist/connector/tools/index.d.ts.map +1 -1
- package/dist/connector/tools/index.js +1 -1
- package/dist/connector/tools/index.js.map +1 -1
- package/dist/connector/tools/router.d.ts +15 -13
- package/dist/connector/tools/router.d.ts.map +1 -1
- package/dist/connector/tools/router.js +30 -51
- package/dist/connector/tools/router.js.map +1 -1
- package/dist/contracts/a2a.d.ts +2 -2
- package/dist/directory/derive-supervisor.d.ts +2 -2
- package/dist/directory/derive-supervisor.d.ts.map +1 -1
- package/dist/directory/derive-supervisor.js +6 -7
- package/dist/directory/derive-supervisor.js.map +1 -1
- package/dist/directory/derive.d.ts.map +1 -1
- package/dist/directory/derive.js +5 -5
- package/dist/directory/derive.js.map +1 -1
- package/dist/execution/code-runtime/types.d.ts +2 -2
- package/dist/execution/code-runtime/types.js +1 -1
- package/dist/invariants/index.d.ts +2 -1
- package/dist/invariants/index.d.ts.map +1 -1
- package/dist/invariants/index.js +3 -2
- package/dist/invariants/index.js.map +1 -1
- package/dist/manager/agent/lifecycle.d.ts.map +1 -1
- package/dist/manager/agent/lifecycle.js +9 -0
- package/dist/manager/agent/lifecycle.js.map +1 -1
- package/dist/manager/connector/environment.d.ts +6 -0
- package/dist/manager/connector/environment.d.ts.map +1 -1
- package/dist/manager/connector/environment.js +11 -4
- package/dist/manager/connector/environment.js.map +1 -1
- package/dist/manager/connector/index.d.ts +2 -2
- package/dist/manager/connector/index.d.ts.map +1 -1
- package/dist/manager/connector/index.js +2 -2
- package/dist/manager/connector/index.js.map +1 -1
- package/dist/manager/connector/tenant.d.ts +6 -0
- package/dist/manager/connector/tenant.d.ts.map +1 -1
- package/dist/manager/connector/tenant.js +11 -4
- package/dist/manager/connector/tenant.js.map +1 -1
- package/dist/manager/index.d.ts +2 -2
- package/dist/manager/index.d.ts.map +1 -1
- package/dist/manager/index.js +2 -2
- package/dist/manager/index.js.map +1 -1
- package/dist/manager/resident/learning-observation.d.ts +4 -4
- package/dist/manager/resident/learning.d.ts +36 -36
- package/dist/manager/session/attribution.d.ts +22 -0
- package/dist/manager/session/attribution.d.ts.map +1 -0
- package/dist/manager/session/attribution.js +64 -0
- package/dist/manager/session/attribution.js.map +1 -0
- package/dist/manager/session/turn-recorder.d.ts +14 -0
- package/dist/manager/session/turn-recorder.d.ts.map +1 -1
- package/dist/manager/session/turn-recorder.js +208 -55
- package/dist/manager/session/turn-recorder.js.map +1 -1
- package/dist/peers/address.d.ts +36 -0
- package/dist/peers/address.d.ts.map +1 -0
- package/dist/peers/address.js +52 -0
- package/dist/peers/address.js.map +1 -0
- package/dist/peers/client.d.ts +47 -0
- package/dist/peers/client.d.ts.map +1 -0
- package/dist/peers/client.js +132 -0
- package/dist/peers/client.js.map +1 -0
- package/dist/peers/dir.d.ts +88 -0
- package/dist/peers/dir.d.ts.map +1 -0
- package/dist/peers/dir.js +139 -0
- package/dist/peers/dir.js.map +1 -0
- package/dist/peers/endpoint.d.ts +144 -0
- package/dist/peers/endpoint.d.ts.map +1 -0
- package/dist/peers/endpoint.js +420 -0
- package/dist/peers/endpoint.js.map +1 -0
- package/dist/peers/envelope.d.ts +42 -0
- package/dist/peers/envelope.d.ts.map +1 -0
- package/dist/peers/envelope.js +110 -0
- package/dist/peers/envelope.js.map +1 -0
- package/dist/peers/index.d.ts +30 -0
- package/dist/peers/index.d.ts.map +1 -0
- package/dist/peers/index.js +22 -0
- package/dist/peers/index.js.map +1 -0
- package/dist/peers/protocol.d.ts +645 -0
- package/dist/peers/protocol.d.ts.map +1 -0
- package/dist/peers/protocol.js +151 -0
- package/dist/peers/protocol.js.map +1 -0
- package/dist/peers/record.d.ts +71 -0
- package/dist/peers/record.d.ts.map +1 -0
- package/dist/peers/record.js +45 -0
- package/dist/peers/record.js.map +1 -0
- package/dist/peers/registry.d.ts +54 -0
- package/dist/peers/registry.d.ts.map +1 -0
- package/dist/peers/registry.js +213 -0
- package/dist/peers/registry.js.map +1 -0
- package/dist/plugin/define.d.ts +24 -0
- package/dist/plugin/define.d.ts.map +1 -0
- package/dist/plugin/define.js +42 -0
- package/dist/plugin/define.js.map +1 -0
- package/dist/plugin/index.d.ts +2 -0
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js +1 -0
- package/dist/plugin/index.js.map +1 -1
- package/dist/plugin/lifecycle.d.ts +27 -3
- package/dist/plugin/lifecycle.d.ts.map +1 -1
- package/dist/plugin/lifecycle.js +242 -92
- package/dist/plugin/lifecycle.js.map +1 -1
- package/dist/plugin/resolver.d.ts +2 -2
- package/dist/plugin/resolver.d.ts.map +1 -1
- package/dist/plugin/resolver.js.map +1 -1
- package/dist/plugin/shell-hook.d.ts.map +1 -1
- package/dist/plugin/shell-hook.js +17 -3
- package/dist/plugin/shell-hook.js.map +1 -1
- package/dist/pricing/catalogue.generated.d.ts.map +1 -1
- package/dist/pricing/catalogue.generated.js +28 -4
- package/dist/pricing/catalogue.generated.js.map +1 -1
- package/dist/probe/errors.d.ts +2 -1
- package/dist/probe/errors.d.ts.map +1 -1
- package/dist/probe/errors.js +3 -2
- package/dist/probe/errors.js.map +1 -1
- package/dist/prompt/coding-agent-doctrine.d.ts +18 -7
- package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -1
- package/dist/prompt/coding-agent-doctrine.js +11 -6
- package/dist/prompt/coding-agent-doctrine.js.map +1 -1
- package/dist/prompt/contributions.d.ts +4 -1
- package/dist/prompt/contributions.d.ts.map +1 -1
- package/dist/prompt/contributions.js +7 -2
- package/dist/prompt/contributions.js.map +1 -1
- package/dist/prompt/index.d.ts +1 -1
- package/dist/prompt/index.d.ts.map +1 -1
- package/dist/prompt/index.js +1 -1
- package/dist/prompt/index.js.map +1 -1
- package/dist/provider/collect-chat-completion.d.ts +6 -1
- package/dist/provider/collect-chat-completion.d.ts.map +1 -1
- package/dist/provider/collect-chat-completion.js +88 -10
- package/dist/provider/collect-chat-completion.js.map +1 -1
- package/dist/provider/mock.d.ts.map +1 -1
- package/dist/provider/mock.js +23 -6
- package/dist/provider/mock.js.map +1 -1
- package/dist/provider/registry.d.ts +2 -1
- package/dist/provider/registry.d.ts.map +1 -1
- package/dist/provider/registry.js +3 -2
- package/dist/provider/registry.js.map +1 -1
- package/dist/provider/tool-call-framing.d.ts +164 -0
- package/dist/provider/tool-call-framing.d.ts.map +1 -0
- package/dist/provider/tool-call-framing.js +163 -0
- package/dist/provider/tool-call-framing.js.map +1 -0
- package/dist/public-runtime.d.ts +27 -14
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +49 -11
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-tools.d.ts +9 -6
- package/dist/public-tools.d.ts.map +1 -1
- package/dist/public-tools.js +13 -5
- package/dist/public-tools.js.map +1 -1
- package/dist/public-types.d.ts +16 -5
- package/dist/public-types.d.ts.map +1 -1
- package/dist/read-model/registry.d.ts +2 -1
- package/dist/read-model/registry.d.ts.map +1 -1
- package/dist/read-model/registry.js +3 -2
- package/dist/read-model/registry.js.map +1 -1
- package/dist/registry/ManagedRegistry.d.ts +30 -0
- package/dist/registry/ManagedRegistry.d.ts.map +1 -1
- package/dist/registry/ManagedRegistry.js +45 -6
- package/dist/registry/ManagedRegistry.js.map +1 -1
- package/dist/registry/collision.d.ts +57 -0
- package/dist/registry/collision.d.ts.map +1 -0
- package/dist/registry/collision.js +41 -0
- package/dist/registry/collision.js.map +1 -0
- package/dist/registry/command/index.d.ts +5 -3
- package/dist/registry/command/index.d.ts.map +1 -1
- package/dist/registry/command/index.js +6 -4
- package/dist/registry/command/index.js.map +1 -1
- package/dist/registry/index.d.ts +3 -4
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +2 -2
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/plugin/index.d.ts.map +1 -1
- package/dist/registry/plugin/index.js +14 -1
- package/dist/registry/plugin/index.js.map +1 -1
- package/dist/registry/tool/callable.d.ts +22 -0
- package/dist/registry/tool/callable.d.ts.map +1 -0
- package/dist/registry/tool/callable.js +28 -0
- package/dist/registry/tool/callable.js.map +1 -0
- package/dist/registry/tool/execute.d.ts +14 -77
- package/dist/registry/tool/execute.d.ts.map +1 -1
- package/dist/registry/tool/execute.js +15 -720
- package/dist/registry/tool/execute.js.map +1 -1
- package/dist/registry/tool/portable.d.ts +25 -0
- package/dist/registry/tool/portable.d.ts.map +1 -1
- package/dist/registry/tool/portable.js +50 -0
- package/dist/registry/tool/portable.js.map +1 -1
- package/dist/registry/tool/presentation.d.ts +6 -5
- package/dist/registry/tool/presentation.d.ts.map +1 -1
- package/dist/registry/tool/presentation.js +3 -3
- package/dist/registry/tool/presentation.js.map +1 -1
- package/dist/runtime/bidi/session.d.ts +5 -4
- package/dist/runtime/bidi/session.d.ts.map +1 -1
- package/dist/runtime/bidi/session.js +18 -1
- package/dist/runtime/bidi/session.js.map +1 -1
- package/dist/runtime/query/executor/tool-call-admission.d.ts +82 -13
- package/dist/runtime/query/executor/tool-call-admission.d.ts.map +1 -1
- package/dist/runtime/query/executor/tool-call-admission.js +227 -17
- package/dist/runtime/query/executor/tool-call-admission.js.map +1 -1
- package/dist/runtime/query/executor.d.ts +37 -5
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +103 -14
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/file-evidence-replay.d.ts +1 -1
- package/dist/runtime/query/file-evidence-replay.d.ts.map +1 -1
- package/dist/runtime/query/file-evidence-replay.js +8 -7
- package/dist/runtime/query/file-evidence-replay.js.map +1 -1
- package/dist/runtime/query/fork/prepare.d.ts +4 -1
- package/dist/runtime/query/fork/prepare.d.ts.map +1 -1
- package/dist/runtime/query/fork/prepare.js +4 -0
- package/dist/runtime/query/fork/prepare.js.map +1 -1
- package/dist/runtime/query/guardrail-presets.d.ts +4 -3
- package/dist/runtime/query/guardrail-presets.d.ts.map +1 -1
- package/dist/runtime/query/guardrail-presets.js +4 -3
- package/dist/runtime/query/guardrail-presets.js.map +1 -1
- package/dist/runtime/query/index.d.ts +23 -10
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +149 -70
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/iteration/index.d.ts.map +1 -1
- package/dist/runtime/query/iteration/index.js +8 -1
- package/dist/runtime/query/iteration/index.js.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction.js +1 -1
- package/dist/runtime/query/iteration/phases/compaction.js.map +1 -1
- package/dist/runtime/query/iteration/phases/context.d.ts +2 -2
- package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.js +55 -2
- package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
- package/dist/runtime/query/iteration/stream-turn.d.ts.map +1 -1
- package/dist/runtime/query/iteration/stream-turn.js +342 -116
- package/dist/runtime/query/iteration/stream-turn.js.map +1 -1
- package/dist/runtime/query/iteration/tool-input.d.ts +79 -0
- package/dist/runtime/query/iteration/tool-input.d.ts.map +1 -0
- package/dist/runtime/query/iteration/tool-input.js +291 -0
- package/dist/runtime/query/iteration/tool-input.js.map +1 -0
- package/dist/runtime/query/observation-context.d.ts +2 -2
- package/dist/runtime/query/observation-context.d.ts.map +1 -1
- package/dist/runtime/query/observation-context.js.map +1 -1
- package/dist/runtime/query/prelude-lease.d.ts +18 -0
- package/dist/runtime/query/prelude-lease.d.ts.map +1 -0
- package/dist/runtime/query/prelude-lease.js +121 -0
- package/dist/runtime/query/prelude-lease.js.map +1 -0
- package/dist/runtime/query/prepare-turn.d.ts.map +1 -1
- package/dist/runtime/query/prepare-turn.js +386 -187
- package/dist/runtime/query/prepare-turn.js.map +1 -1
- package/dist/runtime/query/prompt-cache.d.ts +2 -2
- package/dist/runtime/query/prompt-cache.d.ts.map +1 -1
- package/dist/runtime/query/prompt.d.ts +2 -2
- package/dist/runtime/query/prompt.d.ts.map +1 -1
- package/dist/runtime/query/prompt.js +1 -1
- package/dist/runtime/query/prompt.js.map +1 -1
- package/dist/runtime/query/resume-session.d.ts.map +1 -1
- package/dist/runtime/query/resume-session.js +37 -2
- package/dist/runtime/query/resume-session.js.map +1 -1
- package/dist/runtime/query/review-policy.d.ts +65 -3
- package/dist/runtime/query/review-policy.d.ts.map +1 -1
- package/dist/runtime/query/review-policy.js +143 -22
- package/dist/runtime/query/review-policy.js.map +1 -1
- package/dist/runtime/query/tooling.d.ts +3 -2
- package/dist/runtime/query/tooling.d.ts.map +1 -1
- package/dist/runtime/query/tooling.js.map +1 -1
- package/dist/runtime/query/turn-state.d.ts.map +1 -1
- package/dist/runtime/query/turn-state.js +5 -0
- package/dist/runtime/query/turn-state.js.map +1 -1
- package/dist/runtime/system-events.d.ts +112 -0
- package/dist/runtime/system-events.d.ts.map +1 -0
- package/dist/runtime/system-events.js +183 -0
- package/dist/runtime/system-events.js.map +1 -0
- package/dist/scheduler/delegating.d.ts +2 -1
- package/dist/scheduler/delegating.d.ts.map +1 -1
- package/dist/scheduler/delegating.js +3 -2
- package/dist/scheduler/delegating.js.map +1 -1
- package/dist/skills/index.d.ts +1 -1
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +1 -1
- package/dist/skills/index.js.map +1 -1
- package/dist/skills/registry.d.ts +18 -0
- package/dist/skills/registry.d.ts.map +1 -1
- package/dist/skills/registry.js +20 -0
- package/dist/skills/registry.js.map +1 -1
- package/dist/store/evidence/index-page.d.ts +2 -2
- package/dist/store/session-log/conformance.d.ts +1 -1
- package/dist/store/session-log/conformance.d.ts.map +1 -1
- package/dist/store/session-log/conformance.js +49 -8
- package/dist/store/session-log/conformance.js.map +1 -1
- package/dist/store/session-log/core.d.ts +8 -3
- package/dist/store/session-log/core.d.ts.map +1 -1
- package/dist/store/session-log/core.js +2 -1
- package/dist/store/session-log/core.js.map +1 -1
- package/dist/store/session-log/fold.d.ts +12 -0
- package/dist/store/session-log/fold.d.ts.map +1 -1
- package/dist/store/session-log/fold.js +57 -7
- package/dist/store/session-log/fold.js.map +1 -1
- package/dist/store/session-log/index.d.ts +2 -2
- package/dist/store/session-log/index.d.ts.map +1 -1
- package/dist/store/session-log/index.js +1 -1
- package/dist/store/session-log/index.js.map +1 -1
- package/dist/test-support/toolset.d.ts +19 -0
- package/dist/test-support/toolset.d.ts.map +1 -0
- package/dist/test-support/toolset.js +20 -0
- package/dist/test-support/toolset.js.map +1 -0
- package/dist/tools/builtins/bash.d.ts +29 -0
- package/dist/tools/builtins/bash.d.ts.map +1 -1
- package/dist/tools/builtins/bash.js +19 -9
- package/dist/tools/builtins/bash.js.map +1 -1
- package/dist/tools/builtins/browser-url.d.ts +1 -1
- package/dist/tools/builtins/browser-url.js +1 -1
- package/dist/tools/builtins/browser.d.ts +6 -6
- package/dist/tools/builtins/computer-use-coordinates.d.ts +65 -0
- package/dist/tools/builtins/computer-use-coordinates.d.ts.map +1 -0
- package/dist/tools/builtins/computer-use-coordinates.js +123 -0
- package/dist/tools/builtins/computer-use-coordinates.js.map +1 -0
- package/dist/tools/builtins/computer-use-image.d.ts +77 -0
- package/dist/tools/builtins/computer-use-image.d.ts.map +1 -0
- package/dist/tools/builtins/computer-use-image.js +223 -0
- package/dist/tools/builtins/computer-use-image.js.map +1 -0
- package/dist/tools/builtins/computer-use.d.ts +519 -14
- package/dist/tools/builtins/computer-use.d.ts.map +1 -1
- package/dist/tools/builtins/computer-use.js +1196 -183
- package/dist/tools/builtins/computer-use.js.map +1 -1
- package/dist/tools/builtins/edit.d.ts.map +1 -1
- package/dist/tools/builtins/edit.js +9 -1
- package/dist/tools/builtins/edit.js.map +1 -1
- package/dist/tools/builtins/index.d.ts +2 -1
- package/dist/tools/builtins/index.d.ts.map +1 -1
- package/dist/tools/builtins/index.js +1 -1
- package/dist/tools/builtins/index.js.map +1 -1
- package/dist/tools/builtins/json-string-hint.d.ts +15 -0
- package/dist/tools/builtins/json-string-hint.d.ts.map +1 -0
- package/dist/tools/builtins/json-string-hint.js +17 -0
- package/dist/tools/builtins/json-string-hint.js.map +1 -0
- package/dist/tools/builtins/search-tools.d.ts.map +1 -1
- package/dist/tools/builtins/search-tools.js +7 -15
- package/dist/tools/builtins/search-tools.js.map +1 -1
- package/dist/tools/builtins/skill.d.ts +74 -0
- package/dist/tools/builtins/skill.d.ts.map +1 -1
- package/dist/tools/builtins/skill.js +214 -174
- package/dist/tools/builtins/skill.js.map +1 -1
- package/dist/tools/builtins/write-file.d.ts.map +1 -1
- package/dist/tools/builtins/write-file.js +11 -0
- package/dist/tools/builtins/write-file.js.map +1 -1
- package/dist/tools/command-shell.d.ts +10 -0
- package/dist/tools/command-shell.d.ts.map +1 -1
- package/dist/tools/command-shell.js +45 -1
- package/dist/tools/command-shell.js.map +1 -1
- package/dist/tools/coordinator/agent.d.ts.map +1 -1
- package/dist/tools/coordinator/agent.js +5 -0
- package/dist/tools/coordinator/agent.js.map +1 -1
- package/dist/tools/coordinator/ask-user-question.d.ts.map +1 -1
- package/dist/tools/coordinator/ask-user-question.js +26 -13
- package/dist/tools/coordinator/ask-user-question.js.map +1 -1
- package/dist/tools/coordinator/index.d.ts.map +1 -1
- package/dist/tools/coordinator/index.js +5 -0
- package/dist/tools/coordinator/index.js.map +1 -1
- package/dist/tools/coordinator/question-options.d.ts +78 -0
- package/dist/tools/coordinator/question-options.d.ts.map +1 -0
- package/dist/tools/coordinator/question-options.js +153 -0
- package/dist/tools/coordinator/question-options.js.map +1 -0
- package/dist/tools/defineTool.d.ts +12 -0
- package/dist/tools/defineTool.d.ts.map +1 -1
- package/dist/tools/defineTool.js +24 -0
- package/dist/tools/defineTool.js.map +1 -1
- package/dist/tools/memory/search.d.ts.map +1 -1
- package/dist/tools/memory/search.js +4 -1
- package/dist/tools/memory/search.js.map +1 -1
- package/dist/tools/memory/update.d.ts.map +1 -1
- package/dist/tools/memory/update.js +8 -5
- package/dist/tools/memory/update.js.map +1 -1
- package/dist/tools/render-nonce.d.ts +47 -0
- package/dist/tools/render-nonce.d.ts.map +1 -0
- package/dist/tools/render-nonce.js +63 -0
- package/dist/tools/render-nonce.js.map +1 -0
- package/dist/tools/roster.d.ts +46 -19
- package/dist/tools/roster.d.ts.map +1 -1
- package/dist/tools/roster.js +63 -33
- package/dist/tools/roster.js.map +1 -1
- package/dist/tools/schedules/present.d.ts.map +1 -1
- package/dist/tools/schedules/present.js +2 -0
- package/dist/tools/schedules/present.js.map +1 -1
- package/dist/tools/schedules/schedule-tool.d.ts +6 -5
- package/dist/tools/schedules/schedule-tool.d.ts.map +1 -1
- package/dist/tools/schedules/schedule-tool.js +208 -37
- package/dist/tools/schedules/schedule-tool.js.map +1 -1
- package/dist/tools/schedules/types.d.ts +120 -6
- package/dist/tools/schedules/types.d.ts.map +1 -1
- package/dist/tools/trusted-read-only.d.ts +9 -5
- package/dist/tools/trusted-read-only.d.ts.map +1 -1
- package/dist/tools/trusted-read-only.js +14 -10
- package/dist/tools/trusted-read-only.js.map +1 -1
- package/dist/tools/untrusted-envelope.d.ts +67 -28
- package/dist/tools/untrusted-envelope.d.ts.map +1 -1
- package/dist/tools/untrusted-envelope.js +108 -59
- package/dist/tools/untrusted-envelope.js.map +1 -1
- package/dist/toolsets/combine.d.ts +44 -0
- package/dist/toolsets/combine.d.ts.map +1 -0
- package/dist/toolsets/combine.js +153 -0
- package/dist/toolsets/combine.js.map +1 -0
- package/dist/toolsets/manager.d.ts +201 -0
- package/dist/toolsets/manager.d.ts.map +1 -0
- package/dist/toolsets/manager.js +837 -0
- package/dist/toolsets/manager.js.map +1 -0
- package/dist/toolsets/source-glob.d.ts +15 -0
- package/dist/toolsets/source-glob.d.ts.map +1 -0
- package/dist/toolsets/source-glob.js +23 -0
- package/dist/toolsets/source-glob.js.map +1 -0
- package/dist/toolsets/toolset.d.ts +20 -0
- package/dist/toolsets/toolset.d.ts.map +1 -0
- package/dist/toolsets/toolset.js +28 -0
- package/dist/toolsets/toolset.js.map +1 -0
- package/dist/toolsets/types.d.ts +128 -0
- package/dist/toolsets/types.d.ts.map +1 -0
- package/dist/toolsets/types.js +33 -0
- package/dist/toolsets/types.js.map +1 -0
- package/dist/toolsets/wrappers.d.ts +59 -0
- package/dist/toolsets/wrappers.d.ts.map +1 -0
- package/dist/toolsets/wrappers.js +165 -0
- package/dist/toolsets/wrappers.js.map +1 -0
- package/dist/types/agent/base.d.ts +27 -16
- package/dist/types/agent/base.d.ts.map +1 -1
- package/dist/types/agent/index.d.ts +1 -0
- package/dist/types/agent/index.d.ts.map +1 -1
- package/dist/types/agent/index.js +1 -0
- package/dist/types/agent/index.js.map +1 -1
- package/dist/types/agent/pipeline.d.ts +2 -0
- package/dist/types/agent/pipeline.d.ts.map +1 -1
- package/dist/types/agent/query.d.ts +117 -0
- package/dist/types/agent/query.d.ts.map +1 -0
- package/dist/types/agent/query.js +2 -0
- package/dist/types/agent/query.js.map +1 -0
- package/dist/types/agent/reactive.d.ts +2 -129
- package/dist/types/agent/reactive.d.ts.map +1 -1
- package/dist/types/agent/router.d.ts +2 -0
- package/dist/types/agent/router.d.ts.map +1 -1
- package/dist/types/agent/supervisor.d.ts +5 -2
- package/dist/types/agent/supervisor.d.ts.map +1 -1
- package/dist/types/authorization/index.d.ts +70 -12
- package/dist/types/authorization/index.d.ts.map +1 -1
- package/dist/types/authorization/index.js +11 -0
- package/dist/types/authorization/index.js.map +1 -1
- package/dist/types/computer-use/index.d.ts +176 -0
- package/dist/types/computer-use/index.d.ts.map +1 -1
- package/dist/types/computer-use/index.js.map +1 -1
- package/dist/types/connector/mcp.d.ts +32 -0
- package/dist/types/connector/mcp.d.ts.map +1 -1
- package/dist/types/errors/index.d.ts +15 -0
- package/dist/types/errors/index.d.ts.map +1 -1
- package/dist/types/errors/index.js.map +1 -1
- package/dist/types/hitl/index.d.ts +57 -0
- package/dist/types/hitl/index.d.ts.map +1 -1
- package/dist/types/hitl/index.js.map +1 -1
- package/dist/types/message/index.d.ts +130 -9
- package/dist/types/message/index.d.ts.map +1 -1
- package/dist/types/message/index.js +4 -1
- package/dist/types/message/index.js.map +1 -1
- package/dist/types/plugin/index.d.ts +22 -4
- package/dist/types/plugin/index.d.ts.map +1 -1
- package/dist/types/plugin/index.js +1 -0
- package/dist/types/plugin/index.js.map +1 -1
- package/dist/types/provider/chat.d.ts +5 -0
- package/dist/types/provider/chat.d.ts.map +1 -1
- package/dist/types/provider/config.d.ts +8 -3
- package/dist/types/provider/config.d.ts.map +1 -1
- package/dist/types/provider/stream.d.ts +39 -0
- package/dist/types/provider/stream.d.ts.map +1 -1
- package/dist/types/sandbox/index.d.ts +1 -1
- package/dist/types/session/events.d.ts +14 -3
- package/dist/types/session/events.d.ts.map +1 -1
- package/dist/types/session/events.js.map +1 -1
- package/dist/types/tool/index.d.ts +171 -91
- package/dist/types/tool/index.d.ts.map +1 -1
- package/dist/types/tool/index.js.map +1 -1
- package/dist/types/toolset/index.d.ts +10 -40
- package/dist/types/toolset/index.d.ts.map +1 -1
- package/package.json +3 -1
- package/src/advisory/history.ts +27 -2
- package/src/advisory/index.ts +1 -1
- package/src/advisory/registry.ts +33 -0
- package/src/agents/AGENTS.md +14 -7
- package/src/agents/PipelineAgent.ts +2 -303
- package/src/agents/QueryAgent.ts +269 -0
- package/src/agents/ReactiveAgent.ts +6 -216
- package/src/agents/RouterAgent.ts +2 -337
- package/src/agents/SupervisorAgent.ts +3 -476
- package/src/agents/defineAgent.ts +13 -2
- package/src/agents/examples/PipelineAgent.ts +302 -0
- package/src/agents/examples/RouterAgent.ts +338 -0
- package/src/agents/examples/SupervisorAgent.ts +472 -0
- package/src/agents/explore.ts +6 -3
- package/src/agents/forward-options.ts +37 -0
- package/src/agents/index.ts +2 -0
- package/src/agents/runAgent.ts +144 -37
- package/src/authorization/command-line.ts +2 -2
- package/src/authorization/gate.ts +46 -5
- package/src/authorization/program.ts +773 -0
- package/src/authorization/reexec-wrapper.ts +589 -0
- package/src/authorization/rules.ts +36 -1
- package/src/authorization/shell-lexer.ts +136 -63
- package/src/bridge/sse/mapper.ts +6 -0
- package/src/capabilities/index.ts +157 -0
- package/src/config/registry.ts +4 -1
- package/src/connector/index.ts +9 -2
- package/src/connector/mcp/adapter.ts +58 -3
- package/src/connector/mcp/client.ts +20 -4
- package/src/connector/mcp/discovery.ts +60 -0
- package/src/connector/mcp/index.ts +13 -0
- package/src/connector/mcp/mcp-toolset.ts +515 -0
- package/src/connector/tools/index.ts +2 -2
- package/src/connector/tools/router.ts +35 -58
- package/src/directory/derive-supervisor.ts +12 -8
- package/src/directory/derive.ts +8 -5
- package/src/execution/code-runtime/types.ts +2 -2
- package/src/invariants/index.ts +4 -1
- package/src/manager/agent/lifecycle.ts +9 -0
- package/src/manager/connector/environment.ts +17 -4
- package/src/manager/connector/index.ts +2 -2
- package/src/manager/connector/tenant.ts +17 -4
- package/src/manager/index.ts +2 -2
- package/src/manager/session/attribution.ts +79 -0
- package/src/manager/session/turn-recorder.ts +211 -55
- package/src/peers/address.ts +58 -0
- package/src/peers/client.ts +202 -0
- package/src/peers/dir.ts +176 -0
- package/src/peers/endpoint.ts +564 -0
- package/src/peers/envelope.ts +121 -0
- package/src/peers/index.ts +96 -0
- package/src/peers/protocol.ts +196 -0
- package/src/peers/record.ts +56 -0
- package/src/peers/registry.ts +241 -0
- package/src/plugin/define.ts +68 -0
- package/src/plugin/index.ts +2 -0
- package/src/plugin/lifecycle.ts +286 -106
- package/src/plugin/resolver.ts +6 -3
- package/src/plugin/shell-hook.ts +21 -5
- package/src/pricing/catalogue.generated.ts +28 -4
- package/src/pricing/rates.source.json +27 -6
- package/src/probe/errors.ts +4 -1
- package/src/prompt/coding-agent-doctrine.ts +22 -10
- package/src/prompt/contributions.ts +12 -2
- package/src/prompt/index.ts +1 -0
- package/src/provider/collect-chat-completion.ts +96 -11
- package/src/provider/mock.ts +24 -6
- package/src/provider/registry.ts +4 -1
- package/src/provider/tool-call-framing.ts +226 -0
- package/src/public-runtime.ts +152 -9
- package/src/public-tools.ts +43 -5
- package/src/public-types.ts +65 -6
- package/src/read-model/registry.ts +7 -2
- package/src/registry/ManagedRegistry.ts +57 -6
- package/src/registry/collision.ts +64 -0
- package/src/registry/command/index.ts +7 -3
- package/src/registry/index.ts +3 -9
- package/src/registry/plugin/index.ts +14 -1
- package/src/registry/tool/callable.ts +36 -0
- package/src/registry/tool/execute.ts +16 -839
- package/src/registry/tool/portable.ts +59 -0
- package/src/registry/tool/presentation.ts +6 -5
- package/src/runtime/bidi/session.ts +24 -5
- package/src/runtime/query/executor/tool-call-admission.ts +288 -22
- package/src/runtime/query/executor.ts +129 -16
- package/src/runtime/query/file-evidence-replay.ts +8 -7
- package/src/runtime/query/fork/prepare.ts +6 -1
- package/src/runtime/query/guardrail-presets.ts +4 -3
- package/src/runtime/query/index.ts +199 -101
- package/src/runtime/query/iteration/index.ts +13 -3
- package/src/runtime/query/iteration/phases/compaction.ts +1 -1
- package/src/runtime/query/iteration/phases/context.ts +2 -2
- package/src/runtime/query/iteration/phases/tool-review.ts +59 -2
- package/src/runtime/query/iteration/stream-turn.ts +390 -136
- package/src/runtime/query/iteration/tool-input.ts +284 -0
- package/src/runtime/query/observation-context.ts +2 -2
- package/src/runtime/query/prelude-lease.ts +132 -0
- package/src/runtime/query/prepare-turn.ts +477 -198
- package/src/runtime/query/prompt-cache.ts +2 -2
- package/src/runtime/query/prompt.ts +4 -4
- package/src/runtime/query/resume-session.ts +42 -3
- package/src/runtime/query/review-policy.ts +190 -24
- package/src/runtime/query/tooling.ts +3 -6
- package/src/runtime/query/turn-state.ts +4 -0
- package/src/runtime/system-events.ts +246 -0
- package/src/scheduler/delegating.ts +7 -2
- package/src/skills/index.ts +1 -1
- package/src/skills/registry.ts +33 -0
- package/src/store/session-log/conformance.ts +51 -8
- package/src/store/session-log/core.ts +10 -4
- package/src/store/session-log/fold.ts +33 -7
- package/src/store/session-log/index.ts +2 -0
- package/src/test-support/toolset.ts +23 -0
- package/src/tools/builtins/bash.ts +27 -10
- package/src/tools/builtins/browser-url.ts +1 -1
- package/src/tools/builtins/computer-use-coordinates.ts +144 -0
- package/src/tools/builtins/computer-use-image.ts +278 -0
- package/src/tools/builtins/computer-use.ts +1495 -191
- package/src/tools/builtins/edit.ts +12 -2
- package/src/tools/builtins/index.ts +7 -1
- package/src/tools/builtins/json-string-hint.ts +16 -0
- package/src/tools/builtins/search-tools.ts +7 -20
- package/src/tools/builtins/skill.ts +304 -174
- package/src/tools/builtins/write-file.ts +12 -0
- package/src/tools/command-shell.ts +46 -1
- package/src/tools/coordinator/agent.ts +6 -0
- package/src/tools/coordinator/ask-user-question.ts +29 -15
- package/src/tools/coordinator/index.ts +6 -0
- package/src/tools/coordinator/question-options.ts +195 -0
- package/src/tools/defineTool.ts +38 -0
- package/src/tools/memory/search.ts +4 -1
- package/src/tools/memory/update.ts +8 -5
- package/src/tools/render-nonce.ts +69 -0
- package/src/tools/roster.ts +84 -33
- package/src/tools/schedules/present.ts +2 -0
- package/src/tools/schedules/schedule-tool.ts +238 -39
- package/src/tools/schedules/types.ts +120 -6
- package/src/tools/trusted-read-only.ts +19 -10
- package/src/tools/untrusted-envelope.ts +121 -57
- package/src/toolsets/combine.ts +181 -0
- package/src/toolsets/manager.ts +996 -0
- package/src/toolsets/source-glob.ts +22 -0
- package/src/toolsets/toolset.ts +31 -0
- package/src/toolsets/types.ts +154 -0
- package/src/toolsets/wrappers.ts +191 -0
- package/src/types/agent/base.ts +29 -16
- package/src/types/agent/index.ts +1 -0
- package/src/types/agent/pipeline.ts +2 -0
- package/src/types/agent/query.ts +129 -0
- package/src/types/agent/reactive.ts +5 -142
- package/src/types/agent/router.ts +2 -0
- package/src/types/agent/supervisor.ts +5 -2
- package/src/types/authorization/index.ts +33 -0
- package/src/types/computer-use/index.ts +202 -0
- package/src/types/connector/mcp.ts +32 -0
- package/src/types/errors/index.ts +15 -0
- package/src/types/hitl/index.ts +57 -0
- package/src/types/message/index.ts +135 -7
- package/src/types/plugin/index.ts +44 -21
- package/src/types/provider/chat.ts +5 -0
- package/src/types/provider/config.ts +8 -3
- package/src/types/provider/stream.ts +39 -0
- package/src/types/sandbox/index.ts +1 -1
- package/src/types/session/events.ts +14 -3
- package/src/types/tool/index.ts +173 -105
- package/src/types/toolset/index.ts +10 -47
- package/dist/registry/toolset/catalog.d.ts +0 -42
- package/dist/registry/toolset/catalog.d.ts.map +0 -1
- package/dist/registry/toolset/catalog.js +0 -234
- package/dist/registry/toolset/catalog.js.map +0 -1
- package/src/registry/toolset/catalog.ts +0 -308
|
@@ -1,142 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import type { InputGuardrailSpec, OutputGuardrailSpec } from '../guardrail/index.js'
|
|
7
|
-
import type { ResumeHandler } from '../hitl/index.js'
|
|
8
|
-
import type { AgentPersona } from '../persona/index.js'
|
|
9
|
-
import type { LLMProvider } from '../provider/index.js'
|
|
10
|
-
import type { SandboxProvider } from '../sandbox/index.js'
|
|
11
|
-
import type { BeforeStep, PrepareStepChain, StepResult, StopCondition } from '../session/index.js'
|
|
12
|
-
import type { Skill } from '../skills/index.js'
|
|
13
|
-
import type { StructuredOutputConfig } from '../structured-output/index.js'
|
|
14
|
-
import type { ToolRegistryContract } from '../tool/index.js'
|
|
15
|
-
import type { RepairToolCall } from '../tool/repair.js'
|
|
16
|
-
import type { BaseAgentConfig, BaseAgentResult } from './base.js'
|
|
17
|
-
import type { WorkingMemoryProvider } from './working-memory.js'
|
|
18
|
-
|
|
19
|
-
export interface ReactiveAgentConfig extends BaseAgentConfig {
|
|
20
|
-
systemPrompt?: string
|
|
21
|
-
/** Provider-hosted search for this turn; the selected driver must support it. */
|
|
22
|
-
webSearch?: { mode: 'live' | 'cached' }
|
|
23
|
-
|
|
24
|
-
persona?: AgentPersona
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Channel a host uses to hand guidance to this turn's current turn.
|
|
28
|
-
*
|
|
29
|
-
* Present here for the same reason it is on `SupervisorAgentConfig`, and
|
|
30
|
-
* the reason that file gives twice already: a capability the kernel
|
|
31
|
-
* honours in `drainQuery` and not on the surface hosts actually
|
|
32
|
-
* construct is a capability nobody can reach. This is the archetype most
|
|
33
|
-
* hosts run, and it was the one that could not be steered at all.
|
|
34
|
-
*/
|
|
35
|
-
steering?: SteeringChannel
|
|
36
|
-
|
|
37
|
-
skills?: Skill[]
|
|
38
|
-
|
|
39
|
-
basePrompt?: string
|
|
40
|
-
provider: LLMProvider
|
|
41
|
-
tools: ToolRegistryContract
|
|
42
|
-
|
|
43
|
-
advisory?: AdvisoryConfig
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Optional capability-aware deny/allow gate for child tool calls.
|
|
47
|
-
* Mirrors the same field on `SupervisorAgentConfig`; when omitted,
|
|
48
|
-
* `drainQuery` falls back to its `autoApproveHandler` default
|
|
49
|
-
* (every tool call auto-approves, no policy applied). Hosts that
|
|
50
|
-
* trust their sandbox should still pass at least
|
|
51
|
-
* `{ enabled: true, denyDangerousPatterns: true, ... }` so the
|
|
52
|
-
* canonical brick patterns hard-deny instead of executing
|
|
53
|
-
* silently.
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
authorizationGate?: AuthorizationGateConfig
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Optional ephemeral sandbox provider. When set, drainQuery creates
|
|
60
|
-
* a sandbox via `provider.create()` before the iteration loop and
|
|
61
|
-
* routes filesystem / shell tool calls through it; on turn end the
|
|
62
|
-
* SDK calls `sandbox.destroy()`. Hosts that want a per-task
|
|
63
|
-
* container shared across supervisor + every child specialist run
|
|
64
|
-
* pass the SAME provider instance to all of them — caching layered
|
|
65
|
-
* on top of the provider keeps the underlying container alive.
|
|
66
|
-
*/
|
|
67
|
-
sandboxProvider?: SandboxProvider
|
|
68
|
-
/** See {@link QueryParams.sandboxTeardownTimeoutMs}. */
|
|
69
|
-
sandboxTeardownTimeoutMs?: number
|
|
70
|
-
/** See {@link QueryParams.outsideRootAccess}. Default `'refuse'`. */
|
|
71
|
-
outsideRootAccess?: 'refuse' | 'review'
|
|
72
|
-
/** See {@link QueryParams.sandboxEscape}. Default `'refuse'`. */
|
|
73
|
-
sandboxEscape?: 'refuse' | 'review'
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Optional structured-compaction config. Omitted ⇒ byte-identical run path
|
|
77
|
-
* (no `WorkingStateManager`, compaction early-returns). Mirrors the field
|
|
78
|
-
* on `SupervisorAgentConfig` so a child specialist can share the
|
|
79
|
-
* supervisor's compaction settings.
|
|
80
|
-
*/
|
|
81
|
-
compactionConfig?: CompactionConfig
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Optional neutral working-memory seam — same contract as the field on
|
|
85
|
-
* `SupervisorAgentConfig`. Absent ⇒ no block injected. A child specialist
|
|
86
|
-
* sharing the supervisor's output dir passes the same provider.
|
|
87
|
-
*/
|
|
88
|
-
workingMemoryProvider?: WorkingMemoryProvider
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Loop-control and resilience seams, forwarded verbatim to `query()`.
|
|
92
|
-
*
|
|
93
|
-
* These existed on `QueryParams` and stopped there. `ReactiveAgent` is
|
|
94
|
-
* the entry point most consumers actually use — it is what
|
|
95
|
-
* `AgentManager` spawns and what the estate's own applications call —
|
|
96
|
-
* and it forwarded none of them. So a per-tool deadline, a provider
|
|
97
|
-
* retry policy, a guardrail, a stop condition: all of it was reachable
|
|
98
|
-
* only by dropping down to `query()` and rebuilding the turn wiring by
|
|
99
|
-
* hand. Features that a consumer cannot reach are features that do not
|
|
100
|
-
* exist for them.
|
|
101
|
-
*
|
|
102
|
-
* Every field is optional and absent means exactly what it meant
|
|
103
|
-
* before, so no existing agent changes behavior.
|
|
104
|
-
*/
|
|
105
|
-
resumeHandler?: ResumeHandler
|
|
106
|
-
retry?: QueryParams['retry']
|
|
107
|
-
toolTimeoutMs?: number
|
|
108
|
-
toolRetryBackoff?: QueryParams['toolRetryBackoff']
|
|
109
|
-
maxToolConcurrency?: number
|
|
110
|
-
maxToolOutputChars?: number
|
|
111
|
-
retainedToolPreviewChars?: QueryParams['retainedToolPreviewChars']
|
|
112
|
-
/**
|
|
113
|
-
* Cap on the RICH channel of a single tool result, in base64 characters.
|
|
114
|
-
* `0` or absent disables it. Separate from {@link maxToolOutputChars}:
|
|
115
|
-
* that one bounds characters the model reads, this one bounds the image
|
|
116
|
-
* payload beside them, which no text budget ever touched.
|
|
117
|
-
*/
|
|
118
|
-
maxToolContentBytes?: number
|
|
119
|
-
repairToolCall?: RepairToolCall
|
|
120
|
-
stopWhen?: StopCondition
|
|
121
|
-
onStepFinish?: (step: StepResult) => void
|
|
122
|
-
prepareStep?: PrepareStepChain
|
|
123
|
-
/**
|
|
124
|
-
* Refuse the next model call before it is made. See {@link BeforeStep}.
|
|
125
|
-
* A throw fails CLOSED, opposite to `prepareStep` beside it.
|
|
126
|
-
*/
|
|
127
|
-
beforeStep?: BeforeStep
|
|
128
|
-
|
|
129
|
-
structuredOutput?: StructuredOutputConfig
|
|
130
|
-
inputGuardrails?: readonly InputGuardrailSpec[]
|
|
131
|
-
outputGuardrails?: readonly OutputGuardrailSpec[]
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Span this turn should hang off, when it is a delegated one. Absent for
|
|
135
|
-
* a top-level turn, which correctly starts its own root trace.
|
|
136
|
-
*/
|
|
137
|
-
parentSpan?: import('@opentelemetry/api').Span
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export interface ReactiveAgentResult extends BaseAgentResult {
|
|
141
|
-
toolCallCount: number
|
|
142
|
-
}
|
|
1
|
+
/** @deprecated Use QueryAgentConfig and QueryAgentResult for the generic query shell. */
|
|
2
|
+
export type {
|
|
3
|
+
QueryAgentConfig as ReactiveAgentConfig,
|
|
4
|
+
QueryAgentResult as ReactiveAgentResult,
|
|
5
|
+
} from './query.js'
|
|
@@ -28,6 +28,7 @@ export interface RouteDefinition {
|
|
|
28
28
|
matchPatterns?: string[]
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
/** @deprecated Configuration for the router example; define application routing as needed. */
|
|
31
32
|
export interface RouterAgentConfig extends BaseAgentConfig {
|
|
32
33
|
routes: RouteDefinition[]
|
|
33
34
|
provider: LLMProvider
|
|
@@ -37,6 +38,7 @@ export interface RouterAgentConfig extends BaseAgentConfig {
|
|
|
37
38
|
maxRoutingRetries?: number
|
|
38
39
|
}
|
|
39
40
|
|
|
41
|
+
/** @deprecated Result of the router example. */
|
|
40
42
|
export interface RouterAgentResult extends BaseAgentResult {
|
|
41
43
|
selectedRoute: string
|
|
42
44
|
routingDecision: RoutingDecision
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CompactionConfig } from '../../config/runtime.js'
|
|
2
2
|
import type { SteeringChannel } from '../../runtime/query/steering.js'
|
|
3
|
+
import type { Toolset } from '../../toolsets/types.js'
|
|
3
4
|
import type { AdvisoryConfig } from '../advisory/index.js'
|
|
4
5
|
import type { AuthorizationGateConfig } from '../authorization/index.js'
|
|
5
6
|
import type { ResumeHandler } from '../hitl/index.js'
|
|
@@ -8,13 +9,13 @@ import type { TaskRouterConfig } from '../router/index.js'
|
|
|
8
9
|
import type { SandboxProvider } from '../sandbox/index.js'
|
|
9
10
|
import type { Skill } from '../skills/index.js'
|
|
10
11
|
import type { StructuredOutputConfig } from '../structured-output/index.js'
|
|
11
|
-
import type { ToolRegistryContract } from '../tool/index.js'
|
|
12
12
|
import type { BaseAgentConfig, BaseAgentResult } from './base.js'
|
|
13
13
|
import type { AgentFactoryOptions } from './factory.js'
|
|
14
14
|
import type { AgentManagerContract } from './manager.js'
|
|
15
15
|
import type { SiblingFailurePolicy, TaskScheduler } from './scheduler.js'
|
|
16
16
|
import type { WorkingMemoryProvider } from './working-memory.js'
|
|
17
17
|
|
|
18
|
+
/** @deprecated Configuration for the supervisor example; hosts own their orchestration. */
|
|
18
19
|
export interface SupervisorAgentConfig extends BaseAgentConfig {
|
|
19
20
|
provider: LLMProvider
|
|
20
21
|
|
|
@@ -59,7 +60,8 @@ export interface SupervisorAgentConfig extends BaseAgentConfig {
|
|
|
59
60
|
*/
|
|
60
61
|
onPlanApproved?: () => Promise<void> | void
|
|
61
62
|
agentManager?: AgentManagerContract
|
|
62
|
-
|
|
63
|
+
/** Every tool this turn may see comes from one of these — see `toolsets/types.ts`. */
|
|
64
|
+
toolsets?: readonly Toolset[]
|
|
63
65
|
|
|
64
66
|
systemPrompt: string
|
|
65
67
|
|
|
@@ -234,6 +236,7 @@ export interface AgentTaskResult {
|
|
|
234
236
|
taskIndex: number
|
|
235
237
|
}
|
|
236
238
|
|
|
239
|
+
/** @deprecated Result of the supervisor example. */
|
|
237
240
|
export interface SupervisorAgentResult extends BaseAgentResult {
|
|
238
241
|
taskResults: AgentTaskResult[]
|
|
239
242
|
completedTasks: number
|
|
@@ -27,6 +27,12 @@ export type AuthorizationRule =
|
|
|
27
27
|
| { type: 'allow_by_category'; categories: string[] }
|
|
28
28
|
| { type: 'allow_by_name'; toolNames: string[] }
|
|
29
29
|
| { type: 'deny_by_name'; toolNames: string[] }
|
|
30
|
+
| {
|
|
31
|
+
/** Match the owning toolset's host-assigned source id, never tool input or MCP metadata. */
|
|
32
|
+
type: 'by_source'
|
|
33
|
+
sources: string[]
|
|
34
|
+
decision: GateDecision
|
|
35
|
+
}
|
|
30
36
|
| {
|
|
31
37
|
/**
|
|
32
38
|
* Match a regular expression against the tool's NAME, the
|
|
@@ -115,6 +121,19 @@ export type AuthorizationRule =
|
|
|
115
121
|
*/
|
|
116
122
|
description: string
|
|
117
123
|
decide: AuthorizationPredicate
|
|
124
|
+
/**
|
|
125
|
+
* The reason for THIS call, when `decide` returned a decision: what
|
|
126
|
+
* in the input matched, and where. The gate reports it instead of
|
|
127
|
+
* {@link description}. Absent, returning `null` or throwing, the
|
|
128
|
+
* gate reports `description`.
|
|
129
|
+
*
|
|
130
|
+
* A rule that refuses on several grounds and reports one fixed
|
|
131
|
+
* sentence leaves the model, and the person reading the refusal,
|
|
132
|
+
* to guess which ground it was. A scheduled run's refusal listed
|
|
133
|
+
* everything the rule protects when one word of the command had
|
|
134
|
+
* matched.
|
|
135
|
+
*/
|
|
136
|
+
describe?: (call: AuthorizationPredicateCall) => string | null
|
|
118
137
|
}
|
|
119
138
|
|
|
120
139
|
/** The call an `AuthorizationRule` of type `predicate` is asked about. */
|
|
@@ -156,6 +175,11 @@ const DenyByNameSchema = z.object({
|
|
|
156
175
|
type: z.literal('deny_by_name'),
|
|
157
176
|
toolNames: z.array(z.string()),
|
|
158
177
|
})
|
|
178
|
+
const BySourceSchema = z.object({
|
|
179
|
+
type: z.literal('by_source'),
|
|
180
|
+
sources: z.array(z.string().min(1)).min(1),
|
|
181
|
+
decision: z.enum(['allow', 'deny', 'review']),
|
|
182
|
+
})
|
|
159
183
|
const CustomPatternSchema = z.object({
|
|
160
184
|
type: z.literal('custom_pattern'),
|
|
161
185
|
pattern: z.string().max(MAX_CUSTOM_PATTERN_LENGTH),
|
|
@@ -183,6 +207,14 @@ const PredicateSchema = z.object({
|
|
|
183
207
|
decide: z.custom<AuthorizationPredicate>((value) => typeof value === 'function', {
|
|
184
208
|
message: 'decide must be a function',
|
|
185
209
|
}),
|
|
210
|
+
// Named here so the gate's own parse keeps it: zod strips what a schema
|
|
211
|
+
// does not name.
|
|
212
|
+
describe: z
|
|
213
|
+
.custom<(call: AuthorizationPredicateCall) => string | null>(
|
|
214
|
+
(value) => typeof value === 'function',
|
|
215
|
+
{ message: 'describe must be a function' },
|
|
216
|
+
)
|
|
217
|
+
.optional(),
|
|
186
218
|
})
|
|
187
219
|
|
|
188
220
|
export const AuthorizationRuleSchema = z.discriminatedUnion('type', [
|
|
@@ -191,6 +223,7 @@ export const AuthorizationRuleSchema = z.discriminatedUnion('type', [
|
|
|
191
223
|
AllowByCategorySchema,
|
|
192
224
|
AllowByNameSchema,
|
|
193
225
|
DenyByNameSchema,
|
|
226
|
+
BySourceSchema,
|
|
194
227
|
CustomPatternSchema,
|
|
195
228
|
ArgumentPatternSchema,
|
|
196
229
|
AllowByTierSchema,
|
|
@@ -44,10 +44,41 @@ export interface ComputerUseCapabilities {
|
|
|
44
44
|
* model reads the reason once and does not try again.
|
|
45
45
|
*/
|
|
46
46
|
readonly unavailableReason?: string
|
|
47
|
+
/**
|
|
48
|
+
* The host implements {@link ComputerUseHost.listWindows} and
|
|
49
|
+
* {@link ComputerUseHost.focusWindow}. Absent or false, the tool does not
|
|
50
|
+
* offer `list_windows` or `focus_window`, even when the methods exist.
|
|
51
|
+
*/
|
|
52
|
+
readonly windows?: boolean
|
|
53
|
+
/**
|
|
54
|
+
* The host implements {@link ComputerUseHost.captureRegion}. Absent or
|
|
55
|
+
* false, `zoom` still works: the tool crops a full capture instead, which
|
|
56
|
+
* costs one whole-display capture per zoom.
|
|
57
|
+
*/
|
|
58
|
+
readonly regionCapture?: boolean
|
|
59
|
+
/**
|
|
60
|
+
* The host implements {@link ComputerUseHost.uiSnapshot} and
|
|
61
|
+
* {@link ComputerUseHost.uiAct}: an accessibility tree (Windows UI
|
|
62
|
+
* Automation, macOS AX, AT-SPI, or a driver that wraps one) whose
|
|
63
|
+
* elements can be acted on by reference instead of by pixel.
|
|
64
|
+
*
|
|
65
|
+
* @experimental The UI-tree surface is reserved for the host packages that
|
|
66
|
+
* implement it; its shape may still change in a minor release.
|
|
67
|
+
*/
|
|
68
|
+
readonly uiTree?: boolean
|
|
47
69
|
}
|
|
48
70
|
|
|
49
71
|
// ---------------------------------------------------------------------------
|
|
50
72
|
// Geometry + screenshot payload
|
|
73
|
+
//
|
|
74
|
+
// Units, once for the whole file: every coordinate and size a host accepts or
|
|
75
|
+
// returns is in PHYSICAL pixels — the pixels of the captured bitmap, not
|
|
76
|
+
// logical points or DPI-scaled units. A 3440x1440 monitor at 150 % scaling is
|
|
77
|
+
// 3440x1440 here. A point a host is asked to act on is relative to the
|
|
78
|
+
// top-left of the display it last captured (the primary display until a host
|
|
79
|
+
// offers display selection); the host adds that display's origin itself.
|
|
80
|
+
// Window and UI-element bounds are the exception and say so: they are in
|
|
81
|
+
// virtual-desktop physical pixels, because a window can span displays.
|
|
51
82
|
// ---------------------------------------------------------------------------
|
|
52
83
|
|
|
53
84
|
export interface DisplayGeometry {
|
|
@@ -56,11 +87,144 @@ export interface DisplayGeometry {
|
|
|
56
87
|
readonly scaleFactor: number
|
|
57
88
|
}
|
|
58
89
|
|
|
90
|
+
/**
|
|
91
|
+
* The display a capture shows.
|
|
92
|
+
*
|
|
93
|
+
* `x`/`y` place it in the virtual desktop (a monitor left of the primary has
|
|
94
|
+
* a negative `x`); `width`/`height` are its physical size. `scaleFactor` is
|
|
95
|
+
* physical pixels per logical pixel — 1 at 96 DPI on Windows, 1.5 at 150 %,
|
|
96
|
+
* 2 on a Retina panel — reported for the host UI and for diagnosis; the tool
|
|
97
|
+
* never multiplies by it, because every coordinate crossing this interface
|
|
98
|
+
* is already physical.
|
|
99
|
+
*/
|
|
100
|
+
export interface DisplayInfo {
|
|
101
|
+
/** Stable for the host's lifetime; what a host would accept to select this display. */
|
|
102
|
+
readonly id: string
|
|
103
|
+
readonly x: number
|
|
104
|
+
readonly y: number
|
|
105
|
+
readonly width: number
|
|
106
|
+
readonly height: number
|
|
107
|
+
readonly scaleFactor: number
|
|
108
|
+
/** True for the display the operating system calls primary. */
|
|
109
|
+
readonly primary?: boolean
|
|
110
|
+
}
|
|
111
|
+
|
|
59
112
|
export interface ScreenshotResult {
|
|
60
113
|
readonly data: Buffer
|
|
61
114
|
readonly mimeType: 'image/png'
|
|
115
|
+
/** Physical pixel width of `data`. */
|
|
62
116
|
readonly width: number
|
|
117
|
+
/** Physical pixel height of `data`. */
|
|
63
118
|
readonly height: number
|
|
119
|
+
/**
|
|
120
|
+
* The display this capture shows. A host should always set it; one written
|
|
121
|
+
* before it existed does not, and the tool then assumes a single display at
|
|
122
|
+
* the origin whose size is the capture's own, with a scale factor of 1.
|
|
123
|
+
*/
|
|
124
|
+
readonly display?: DisplayInfo
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** A rectangle in physical pixels. What its origin is relative to depends on where it appears. */
|
|
128
|
+
export interface Rect {
|
|
129
|
+
readonly x: number
|
|
130
|
+
readonly y: number
|
|
131
|
+
readonly width: number
|
|
132
|
+
readonly height: number
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** One top-level window, as {@link ComputerUseHost.listWindows} reports it. */
|
|
136
|
+
export interface WindowInfo {
|
|
137
|
+
/** Opaque and host-defined (an HWND in hex, a CGWindowID, an X11 window id); valid for {@link ComputerUseHost.focusWindow}. */
|
|
138
|
+
readonly id: string
|
|
139
|
+
readonly title: string
|
|
140
|
+
/** Application or process name, e.g. `msedge`, `Teams`, `Code`. */
|
|
141
|
+
readonly app: string
|
|
142
|
+
readonly pid: number
|
|
143
|
+
/** Virtual-desktop physical pixels — not display-relative. */
|
|
144
|
+
readonly bounds: Rect
|
|
145
|
+
readonly focused: boolean
|
|
146
|
+
readonly minimized: boolean
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* What {@link ComputerUseHost.focusWindow} achieved. Bringing a window to
|
|
151
|
+
* the front is a request the operating system can refuse (Windows'
|
|
152
|
+
* foreground lock is the common case), so a host reports the window that is
|
|
153
|
+
* actually in front afterwards rather than assuming its request held.
|
|
154
|
+
*/
|
|
155
|
+
export interface FocusWindowResult {
|
|
156
|
+
/** True only when `focusedId` is the requested window. */
|
|
157
|
+
readonly ok: boolean
|
|
158
|
+
/** The window in front after the attempt, or null when none could be read. */
|
|
159
|
+
readonly focusedId: string | null
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* An action an accessibility element can take by reference.
|
|
164
|
+
*
|
|
165
|
+
* @experimental See {@link ComputerUseCapabilities.uiTree}.
|
|
166
|
+
*/
|
|
167
|
+
export type UiElementAction =
|
|
168
|
+
| 'invoke'
|
|
169
|
+
| 'focus'
|
|
170
|
+
| 'set_value'
|
|
171
|
+
| 'toggle'
|
|
172
|
+
| 'select'
|
|
173
|
+
| 'expand'
|
|
174
|
+
| 'collapse'
|
|
175
|
+
| 'scroll_into_view'
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* One accessibility element.
|
|
179
|
+
*
|
|
180
|
+
* @experimental See {@link ComputerUseCapabilities.uiTree}.
|
|
181
|
+
*/
|
|
182
|
+
export interface UiElement {
|
|
183
|
+
/**
|
|
184
|
+
* Opaque reference for {@link ComputerUseHost.uiAct}, valid until the
|
|
185
|
+
* host's next snapshot. Empty for an element the host cannot act on (a
|
|
186
|
+
* label, a group), which is in the tree for what it says.
|
|
187
|
+
*/
|
|
188
|
+
readonly ref: string
|
|
189
|
+
/** Platform role, e.g. `Button`, `Edit`, `ListItem` (UIA ControlType) or `AXButton`. */
|
|
190
|
+
readonly role: string
|
|
191
|
+
readonly name: string
|
|
192
|
+
readonly value?: string
|
|
193
|
+
/** A platform automation id, when the element has one. */
|
|
194
|
+
readonly automationId?: string
|
|
195
|
+
/** Virtual-desktop physical pixels, when the element is on screen. */
|
|
196
|
+
readonly bounds?: Rect
|
|
197
|
+
/** Element states such as `focused`, `disabled`, `selected`, `checked`, `expanded`. */
|
|
198
|
+
readonly states?: readonly string[]
|
|
199
|
+
readonly actions?: readonly UiElementAction[]
|
|
200
|
+
readonly children?: readonly UiElement[]
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* An accessibility tree for one window.
|
|
205
|
+
*
|
|
206
|
+
* @experimental See {@link ComputerUseCapabilities.uiTree}.
|
|
207
|
+
*/
|
|
208
|
+
export interface UiSnapshot {
|
|
209
|
+
readonly windowId?: string
|
|
210
|
+
/** The window's title, as its application sets it. */
|
|
211
|
+
readonly title?: string
|
|
212
|
+
/** The owning application or process name, as in {@link WindowInfo.app}. */
|
|
213
|
+
readonly app?: string
|
|
214
|
+
readonly root: UiElement
|
|
215
|
+
/** True when the host stopped walking the tree before it ended (a size or time bound). */
|
|
216
|
+
readonly truncated?: boolean
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* What {@link ComputerUseHost.uiAct} did.
|
|
221
|
+
*
|
|
222
|
+
* @experimental See {@link ComputerUseCapabilities.uiTree}.
|
|
223
|
+
*/
|
|
224
|
+
export interface UiActResult {
|
|
225
|
+
readonly ok: boolean
|
|
226
|
+
/** Why it did not, in words the model can act on (a stale ref, a disabled element). */
|
|
227
|
+
readonly detail?: string
|
|
64
228
|
}
|
|
65
229
|
|
|
66
230
|
export interface Point {
|
|
@@ -152,8 +316,46 @@ export interface ComputerUseHost {
|
|
|
152
316
|
readonly capabilities: ComputerUseCapabilities
|
|
153
317
|
|
|
154
318
|
getDisplayGeometry(): Promise<DisplayGeometry>
|
|
319
|
+
/**
|
|
320
|
+
* Points in `action` are physical pixels relative to the display of the
|
|
321
|
+
* most recent capture; a `screenshot` result carries that display in
|
|
322
|
+
* {@link ScreenshotResult.display}.
|
|
323
|
+
*/
|
|
155
324
|
execute(action: ComputerUseAction): Promise<ComputerUseResult>
|
|
156
325
|
|
|
326
|
+
/**
|
|
327
|
+
* The visible, titled top-level windows, front to back where the platform
|
|
328
|
+
* knows the order. Offered to the model only with
|
|
329
|
+
* {@link ComputerUseCapabilities.windows}.
|
|
330
|
+
*/
|
|
331
|
+
listWindows?(): Promise<readonly WindowInfo[]>
|
|
332
|
+
/**
|
|
333
|
+
* Bring a window to the front, restoring it when minimized. Offered only
|
|
334
|
+
* with {@link ComputerUseCapabilities.windows}.
|
|
335
|
+
*/
|
|
336
|
+
focusWindow?(id: string): Promise<FocusWindowResult>
|
|
337
|
+
/**
|
|
338
|
+
* Capture one region of the current display at full physical resolution.
|
|
339
|
+
* `rect` is display-relative physical pixels; the result's `width` and
|
|
340
|
+
* `height` are the region's. Used by `zoom` when
|
|
341
|
+
* {@link ComputerUseCapabilities.regionCapture} is set.
|
|
342
|
+
*/
|
|
343
|
+
captureRegion?(rect: Rect): Promise<ScreenshotResult>
|
|
344
|
+
/**
|
|
345
|
+
* The accessibility tree of one window, or of the focused window when
|
|
346
|
+
* `windowId` is omitted. Offered only with {@link ComputerUseCapabilities.uiTree}.
|
|
347
|
+
*
|
|
348
|
+
* @experimental
|
|
349
|
+
*/
|
|
350
|
+
uiSnapshot?(windowId?: string): Promise<UiSnapshot>
|
|
351
|
+
/**
|
|
352
|
+
* Act on an element from the latest {@link uiSnapshot}. `value` is the text
|
|
353
|
+
* for `set_value`. Offered only with {@link ComputerUseCapabilities.uiTree}.
|
|
354
|
+
*
|
|
355
|
+
* @experimental
|
|
356
|
+
*/
|
|
357
|
+
uiAct?(ref: string, action: UiElementAction, value?: string): Promise<UiActResult>
|
|
358
|
+
|
|
157
359
|
initialize?(): Promise<void>
|
|
158
360
|
dispose?(): Promise<void>
|
|
159
361
|
}
|
|
@@ -276,6 +276,14 @@ export interface MCPToolDefinition {
|
|
|
276
276
|
*/
|
|
277
277
|
outputSchema?: MCPValueJsonSchema
|
|
278
278
|
annotations?: MCPToolAnnotations
|
|
279
|
+
/**
|
|
280
|
+
* Server-defined data on the tool's own listing entry, carried opaquely:
|
|
281
|
+
* this client acts on none of it. `mcpToolToToolDefinition` lands it in
|
|
282
|
+
* `ToolDefinition.metadata` alongside the annotations that have no other
|
|
283
|
+
* typed home, so a host reading either does not have to reach past this
|
|
284
|
+
* client's own parsed shape back to the raw listing.
|
|
285
|
+
*/
|
|
286
|
+
_meta?: Record<string, unknown>
|
|
279
287
|
}
|
|
280
288
|
|
|
281
289
|
/**
|
|
@@ -409,6 +417,24 @@ export interface MCPInitializeResult {
|
|
|
409
417
|
protocolVersion: string
|
|
410
418
|
capabilities: MCPServerCapabilities
|
|
411
419
|
serverInfo: { name: string; version?: string }
|
|
420
|
+
/**
|
|
421
|
+
* The server's own account of how to use it, read off the `initialize`
|
|
422
|
+
* response verbatim. Only a legacy handshake carries one — the modern
|
|
423
|
+
* era has no `initialize` round trip, so a modern connection's result
|
|
424
|
+
* never populates this field (see `completeModernConnection` in
|
|
425
|
+
* `client.ts`, which synthesises the rest of this shape from a discover
|
|
426
|
+
* result that has no `instructions` concept at all).
|
|
427
|
+
*
|
|
428
|
+
* This is observability data, not steering: nothing in the SDK folds it
|
|
429
|
+
* into an agent's instruction set automatically. It is server-authored,
|
|
430
|
+
* remote-party text, and namzu already keeps that class of text out of
|
|
431
|
+
* instruction/system position (see `connector/mcp/prompt-adapter.ts`
|
|
432
|
+
* and `frameServerResult` in `connector/mcp/adapter.ts`, which frame
|
|
433
|
+
* server-supplied prompts and tool results as untrusted data rather
|
|
434
|
+
* than instructions). A host may display or log this field; it should
|
|
435
|
+
* not read it into a prompt without the same untrusted framing.
|
|
436
|
+
*/
|
|
437
|
+
instructions?: string
|
|
412
438
|
}
|
|
413
439
|
|
|
414
440
|
export type MCPConnectionStatus = 'disconnected' | 'connecting' | 'connected' | 'error'
|
|
@@ -461,6 +487,12 @@ export interface MCPClientState {
|
|
|
461
487
|
status: MCPConnectionStatus
|
|
462
488
|
serverInfo?: { name: string; version?: string }
|
|
463
489
|
serverCapabilities?: MCPServerCapabilities
|
|
490
|
+
/**
|
|
491
|
+
* The server's `initialize` instructions, captured verbatim. See
|
|
492
|
+
* {@link MCPInitializeResult.instructions} — legacy handshakes only,
|
|
493
|
+
* observability only, never auto-folded into an agent's instructions.
|
|
494
|
+
*/
|
|
495
|
+
serverInstructions?: string
|
|
464
496
|
connectedAt?: number
|
|
465
497
|
error?: string
|
|
466
498
|
}
|
|
@@ -20,6 +20,21 @@ import { ProviderError, classifyProviderError } from '../provider/errors.js'
|
|
|
20
20
|
export type NamzuErrorCode =
|
|
21
21
|
/** The turn was set up wrong — missing model, contradictory options. Retrying cannot help. */
|
|
22
22
|
| 'invalid_config'
|
|
23
|
+
/**
|
|
24
|
+
* A caller's cached prior messages disagree with this session's log. A
|
|
25
|
+
* message carrying an id disagrees when the log recorded it under that id
|
|
26
|
+
* with different content (`'edited'`) or never recorded that id at all
|
|
27
|
+
* (`'foreign'`); `details.messageId` names it. A message with no id
|
|
28
|
+
* disagrees when the caller's whole no-id cache does not align as a
|
|
29
|
+
* contiguous run ending the log's own fold — the shape a host's cache
|
|
30
|
+
* always has when it is exactly the fold plus new messages appended after
|
|
31
|
+
* it — yet some of it still matches the fold by value out of place
|
|
32
|
+
* (`'unaligned'`; no `messageId`, since none of it carries one). Retrying
|
|
33
|
+
* with the same messages cannot help; the host must pass only its new
|
|
34
|
+
* messages, or re-read history from the session instead of reusing a
|
|
35
|
+
* cached copy.
|
|
36
|
+
*/
|
|
37
|
+
| 'stale_cached_history'
|
|
23
38
|
/** The upstream model call failed. `details.providerCode` narrows it. */
|
|
24
39
|
| 'provider_error'
|
|
25
40
|
/** A tool could not be executed or resolved. */
|
package/src/types/hitl/index.ts
CHANGED
|
@@ -135,6 +135,19 @@ export interface ToolCallSummary {
|
|
|
135
135
|
* approve it on their own. A `deny` rule still refuses it outright.
|
|
136
136
|
*/
|
|
137
137
|
escalation?: ToolCallEscalation
|
|
138
|
+
/**
|
|
139
|
+
* The tool itself declared that this exact call always needs a person's
|
|
140
|
+
* approval (`ToolDefinition.requiresApproval`), regardless of the host's
|
|
141
|
+
* rules or the turn's mode.
|
|
142
|
+
*
|
|
143
|
+
* Computed once, when the batch is prepared for review, the same way
|
|
144
|
+
* {@link isDestructive} is — so it survives a gate `allow` rule (the
|
|
145
|
+
* decision is forced back to `review` before the rule can settle
|
|
146
|
+
* anything) and is asked about, or refused unattended, in every mode,
|
|
147
|
+
* like {@link escalation}. No grant, skill grant or `accept-edits`
|
|
148
|
+
* exemption covers it, and a `deny` rule still wins.
|
|
149
|
+
*/
|
|
150
|
+
requiresApproval?: true
|
|
138
151
|
/**
|
|
139
152
|
* Present when a skill loaded earlier in this turn pre-approved this call
|
|
140
153
|
* through its `allowed-tools`, and nothing stronger stands in the way.
|
|
@@ -165,6 +178,30 @@ export interface ToolCallEscalation {
|
|
|
165
178
|
* `confirmedEscalations`.
|
|
166
179
|
*/
|
|
167
180
|
sandboxEscape?: true
|
|
181
|
+
/**
|
|
182
|
+
* Why a command's own program name — where `programPositions` (the SDK's
|
|
183
|
+
* shared resolver for where a command line actually execs a program;
|
|
184
|
+
* `packages/sdk/src/authorization/program.ts`) says one is actually
|
|
185
|
+
* exec'd, after unwrapping any `sudo`/`env`/`nice`/`timeout`/…
|
|
186
|
+
* re-exec chain, and independently for each `find -exec` clause — is not
|
|
187
|
+
* knowable ahead of running it: the word itself is decided at runtime
|
|
188
|
+
* (`$(echo rm) -rf x`, `env $(echo git) push`, `"$HOME"/bin/tool`), an
|
|
189
|
+
* option on a wrapper this does not recognise stood in the way, the
|
|
190
|
+
* position is inherently unreadable (`eval`/`source`/`.`, an `xargs`
|
|
191
|
+
* program that is a shell or a `{}` placeholder), or an earlier command
|
|
192
|
+
* set `PATH`, `LD_PRELOAD`, `LD_LIBRARY_PATH`, `BASH_ENV`, `ENV` or `IFS`
|
|
193
|
+
* so even a literal name here cannot be trusted to resolve to what its
|
|
194
|
+
* text says.
|
|
195
|
+
*
|
|
196
|
+
* No rule can be trusted to have matched a program whose name never
|
|
197
|
+
* appears as such anywhere in the call's own text: `git push.*` does not
|
|
198
|
+
* see `$(echo git) push`, and neither `env $(echo git) push` nor
|
|
199
|
+
* `timeout 5 $(echo git) push` puts the program right after the wrapper's
|
|
200
|
+
* own name. Present only for a tool that declares `commandArgument`.
|
|
201
|
+
* Argument-level expansion alone does not set this — only a position
|
|
202
|
+
* where a program name is actually decided.
|
|
203
|
+
*/
|
|
204
|
+
unknownProgram?: string
|
|
168
205
|
}
|
|
169
206
|
|
|
170
207
|
export interface ToolModification {
|
|
@@ -175,8 +212,28 @@ export interface ToolModification {
|
|
|
175
212
|
|
|
176
213
|
export interface UserQuestionOption {
|
|
177
214
|
id: string
|
|
215
|
+
/**
|
|
216
|
+
* The label as shown and as the answer quotes it. `ask_user_question`
|
|
217
|
+
* takes out of it a recommendation marker the model wrote out of habit:
|
|
218
|
+
* "(Recommended)" on any option, and "(Önerilen)", "(Empfohlen)", … on
|
|
219
|
+
* a recommended option, when every option whose label ends in a
|
|
220
|
+
* parenthesised group is recommended, did not end in "(Recommended)", and
|
|
221
|
+
* ends in that same one. A group that differs between options, or is left
|
|
222
|
+
* before "(Recommended)" ("Cloud (AWS) (Recommended)" → "Cloud (AWS)"),
|
|
223
|
+
* is kept. The recommendation is `recommended`, so a host never has to
|
|
224
|
+
* parse a label to find it. Apart from surrounding spaces and
|
|
225
|
+
* "(Recommended)", an option that is not recommended keeps its label as
|
|
226
|
+
* written.
|
|
227
|
+
*/
|
|
178
228
|
label: string
|
|
179
229
|
description?: string
|
|
230
|
+
/**
|
|
231
|
+
* The model recommends this option: it set `recommended: true` on it, or
|
|
232
|
+
* left the flag out and ended the label in "(Recommended)". A host marks
|
|
233
|
+
* it (a badge, an emphasis) rather than relying on the label to say so.
|
|
234
|
+
* Absent, not `false`, on every other option.
|
|
235
|
+
*/
|
|
236
|
+
recommended?: boolean
|
|
180
237
|
}
|
|
181
238
|
|
|
182
239
|
/**
|