@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
package/dist/agents/runAgent.js
CHANGED
|
@@ -1,9 +1,53 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
2
|
+
import { resolveCapabilities } from '../capabilities/index.js';
|
|
3
|
+
import { PromptContributionRegistry } from '../prompt/contributions.js';
|
|
2
4
|
import { drainQuery } from '../runtime/query/index.js';
|
|
3
5
|
import { resolveNamzuHome } from '../session/home.js';
|
|
4
6
|
import { SessionPaths, ensureProject } from '../session/paths.js';
|
|
5
7
|
import { InMemorySessionLog } from '../store/session-log/index.js';
|
|
6
8
|
import { generateProjectId, generateSessionId, generateTenantId, generateTopicId, } from '../utils/id.js';
|
|
9
|
+
import { pickRoutedOptions } from './forward-options.js';
|
|
10
|
+
const RUN_AGENT_OPTION_ROUTES = {
|
|
11
|
+
sessionId: 'special',
|
|
12
|
+
topicId: 'special',
|
|
13
|
+
projectId: 'special',
|
|
14
|
+
tenantId: 'special',
|
|
15
|
+
provider: 'special',
|
|
16
|
+
prompt: 'special',
|
|
17
|
+
instructions: 'special',
|
|
18
|
+
model: 'special',
|
|
19
|
+
toolsets: 'special',
|
|
20
|
+
capabilities: 'special',
|
|
21
|
+
pluginManager: 'special',
|
|
22
|
+
inputGuardrails: 'special',
|
|
23
|
+
outputGuardrails: 'special',
|
|
24
|
+
toolResultGuardrails: 'query',
|
|
25
|
+
sandboxProvider: 'query',
|
|
26
|
+
sandbox: 'turn',
|
|
27
|
+
sandboxTeardownTimeoutMs: 'query',
|
|
28
|
+
skills: 'query',
|
|
29
|
+
verificationGate: 'special',
|
|
30
|
+
authorizationGate: 'query',
|
|
31
|
+
workingDirectory: 'special',
|
|
32
|
+
paths: 'special',
|
|
33
|
+
sessionLog: 'query',
|
|
34
|
+
checkpointStore: 'query',
|
|
35
|
+
maxIterations: 'special',
|
|
36
|
+
tokenBudget: 'special',
|
|
37
|
+
timeoutMs: 'special',
|
|
38
|
+
streamIdleTimeoutMs: 'turn',
|
|
39
|
+
maxRequestRichContentBytes: 'turn',
|
|
40
|
+
attachmentResolveTimeoutMs: 'query',
|
|
41
|
+
attachmentStore: 'query',
|
|
42
|
+
temperature: 'special',
|
|
43
|
+
structuredOutput: 'query',
|
|
44
|
+
thinking: 'special',
|
|
45
|
+
effort: 'special',
|
|
46
|
+
name: 'special',
|
|
47
|
+
signal: 'query',
|
|
48
|
+
listener: 'special',
|
|
49
|
+
projectInstructionContext: 'query',
|
|
50
|
+
};
|
|
7
51
|
/**
|
|
8
52
|
* Defaults chosen to be safe rather than generous.
|
|
9
53
|
*
|
|
@@ -58,6 +102,12 @@ export const DEFAULT_TIMEOUT_MS = 300_000;
|
|
|
58
102
|
* ```
|
|
59
103
|
*/
|
|
60
104
|
export async function runAgent(options) {
|
|
105
|
+
if (options.verificationGate &&
|
|
106
|
+
options.authorizationGate &&
|
|
107
|
+
!isDeepStrictEqual(options.verificationGate, options.authorizationGate)) {
|
|
108
|
+
throw new Error('runAgent: verificationGate and authorizationGate must name the same policy.');
|
|
109
|
+
}
|
|
110
|
+
const authorizationGate = options.authorizationGate ?? options.verificationGate;
|
|
61
111
|
const workingDirectory = options.workingDirectory ?? process.cwd();
|
|
62
112
|
const layout = await resolveLayout(options, workingDirectory);
|
|
63
113
|
const identity = {
|
|
@@ -68,6 +118,23 @@ export async function runAgent(options) {
|
|
|
68
118
|
projectId: options.projectId ?? layout.projectId,
|
|
69
119
|
tenantId: options.tenantId ?? generateTenantId(),
|
|
70
120
|
};
|
|
121
|
+
const resolvedCapabilities = options.capabilities
|
|
122
|
+
? await resolveCapabilities(options.capabilities, {
|
|
123
|
+
...identity,
|
|
124
|
+
workingDirectory,
|
|
125
|
+
model: options.model,
|
|
126
|
+
prompt: options.prompt,
|
|
127
|
+
...(options.signal ? { signal: options.signal } : {}),
|
|
128
|
+
})
|
|
129
|
+
: undefined;
|
|
130
|
+
const capabilitySettings = resolvedCapabilities?.modelSettings;
|
|
131
|
+
const promptContributions = options.pluginManager || resolvedCapabilities ? new PromptContributionRegistry() : undefined;
|
|
132
|
+
for (const contribution of options.pluginManager?.promptContributions ?? []) {
|
|
133
|
+
promptContributions?.register(contribution);
|
|
134
|
+
}
|
|
135
|
+
for (const contribution of resolvedCapabilities?.promptContributions.list() ?? []) {
|
|
136
|
+
promptContributions?.register(contribution);
|
|
137
|
+
}
|
|
71
138
|
const messages = typeof options.prompt === 'string'
|
|
72
139
|
? [
|
|
73
140
|
{
|
|
@@ -79,38 +146,49 @@ export async function runAgent(options) {
|
|
|
79
146
|
: options.prompt;
|
|
80
147
|
const turn = await drainQuery({
|
|
81
148
|
provider: options.provider,
|
|
149
|
+
...pickRoutedOptions(options, RUN_AGENT_OPTION_ROUTES, 'query'),
|
|
150
|
+
...(authorizationGate ? { authorizationGate } : {}),
|
|
82
151
|
...(layout.paths ? { paths: layout.paths } : {}),
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
152
|
+
toolsets: [
|
|
153
|
+
...(options.toolsets ?? []),
|
|
154
|
+
...(resolvedCapabilities?.toolsets ?? []),
|
|
155
|
+
...(options.pluginManager?.toolsets ?? []),
|
|
156
|
+
],
|
|
157
|
+
...(promptContributions ? { promptContributions } : {}),
|
|
158
|
+
...(options.pluginManager ? { pluginManager: options.pluginManager } : {}),
|
|
159
|
+
...((resolvedCapabilities?.inputGuardrails.length ?? 0) > 0 || options.inputGuardrails
|
|
160
|
+
? {
|
|
161
|
+
inputGuardrails: [
|
|
162
|
+
...(resolvedCapabilities?.inputGuardrails ?? []),
|
|
163
|
+
...(options.inputGuardrails ?? []),
|
|
164
|
+
],
|
|
165
|
+
}
|
|
88
166
|
: {}),
|
|
89
|
-
...(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
167
|
+
...((resolvedCapabilities?.outputGuardrails.length ?? 0) > 0 || options.outputGuardrails
|
|
168
|
+
? {
|
|
169
|
+
outputGuardrails: [
|
|
170
|
+
...(resolvedCapabilities?.outputGuardrails ?? []),
|
|
171
|
+
...(options.outputGuardrails ?? []),
|
|
172
|
+
],
|
|
173
|
+
}
|
|
96
174
|
: {}),
|
|
97
175
|
messages,
|
|
98
176
|
workingDirectory,
|
|
99
177
|
turnConfig: {
|
|
100
178
|
model: options.model,
|
|
101
|
-
...(options
|
|
179
|
+
...pickRoutedOptions(options, RUN_AGENT_OPTION_ROUTES, 'turn'),
|
|
102
180
|
maxIterations: options.maxIterations ?? DEFAULT_MAX_ITERATIONS,
|
|
103
181
|
tokenBudget: options.tokenBudget ?? DEFAULT_TOKEN_BUDGET,
|
|
104
182
|
timeoutMs: options.timeoutMs ?? DEFAULT_TIMEOUT_MS,
|
|
105
|
-
...(options.
|
|
106
|
-
? {
|
|
183
|
+
...((options.temperature ?? capabilitySettings?.temperature) !== undefined
|
|
184
|
+
? { temperature: options.temperature ?? capabilitySettings?.temperature }
|
|
185
|
+
: {}),
|
|
186
|
+
...((options.thinking ?? capabilitySettings?.thinking) !== undefined
|
|
187
|
+
? { thinking: options.thinking ?? capabilitySettings?.thinking }
|
|
107
188
|
: {}),
|
|
108
|
-
...(options.
|
|
109
|
-
? {
|
|
189
|
+
...((options.effort ?? capabilitySettings?.effort) !== undefined
|
|
190
|
+
? { effort: options.effort ?? capabilitySettings?.effort }
|
|
110
191
|
: {}),
|
|
111
|
-
...(options.temperature !== undefined ? { temperature: options.temperature } : {}),
|
|
112
|
-
...(options.thinking ? { thinking: options.thinking } : {}),
|
|
113
|
-
...(options.effort ? { effort: options.effort } : {}),
|
|
114
192
|
},
|
|
115
193
|
// One option covers both. `drainQuery` separates the id from the
|
|
116
194
|
// display name because a fleet needs a stable key and a readable
|
|
@@ -120,14 +198,6 @@ export async function runAgent(options) {
|
|
|
120
198
|
agentId: options.name ?? 'agent',
|
|
121
199
|
agentName: options.name ?? 'Agent',
|
|
122
200
|
...(options.instructions ? { systemPrompt: options.instructions } : {}),
|
|
123
|
-
...(options.signal ? { signal: options.signal } : {}),
|
|
124
|
-
...(options.skills ? { skills: options.skills } : {}),
|
|
125
|
-
...(options.verificationGate ? { verificationGate: options.verificationGate } : {}),
|
|
126
|
-
...(options.authorizationGate ? { authorizationGate: options.authorizationGate } : {}),
|
|
127
|
-
...(options.structuredOutput ? { structuredOutput: options.structuredOutput } : {}),
|
|
128
|
-
...(options.projectInstructionContext
|
|
129
|
-
? { projectInstructionContext: options.projectInstructionContext }
|
|
130
|
-
: {}),
|
|
131
201
|
...identity,
|
|
132
202
|
}, options.listener);
|
|
133
203
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runAgent.js","sourceRoot":"","sources":["../../src/agents/runAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"runAgent.js","sourceRoot":"","sources":["../../src/agents/runAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAG9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,EAAoB,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAExE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAalE,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UAAU,aAAa,CAC3B,OAAoE,EACpE,gBAAwB;IAExB,IAAI,OAAO,CAAC,UAAU,YAAY,kBAAkB,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QACrF,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,iBAAiB,EAAE,EAAE,CAAA;IAC/D,CAAC;IACD,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACxC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAA;IAC9D,CAAC;IACD,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,EAAE,IAAI,IAAI,gBAAgB,EAAE,CAAA;IACtD,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,gBAAgB,EAAE,CAAC,CAAA;IACpE,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CACd,iCAAiC,OAAO,CAAC,KAAK,CAAC,IAAI,UAAU,OAAO,CAAC,GAAG,gBAAgB,OAAO,CAAC,IAAI,6DAA6D,CACjK,CAAA;IACF,CAAC;IACD,OAAO;QACN,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,IAAI,YAAY,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;QACtE,SAAS,EAAE,OAAO,CAAC,SAAS;KAC5B,CAAA;AACF,CAAC"}
|
|
@@ -89,6 +89,8 @@ export interface CommandLineDecomposition {
|
|
|
89
89
|
*/
|
|
90
90
|
readonly opaque: boolean;
|
|
91
91
|
}
|
|
92
|
+
/** Commands whose argument is code assembled at runtime. Shared with `program.ts`. */
|
|
93
|
+
export declare const RUNTIME_EVALUATORS: Set<string>;
|
|
92
94
|
/**
|
|
93
95
|
* `dialect` is the shell that will run the line (see `ShellDialect`); a
|
|
94
96
|
* caller that does not know passes `sh`, whose reading holds for any POSIX
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-line.d.ts","sourceRoot":"","sources":["../../src/authorization/command-line.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AAEH,OAAO,EACN,KAAK,YAAY,EAKjB,MAAM,kBAAkB,CAAA;AAEzB,kFAAkF;AAClF,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;IACpC;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CACxB;
|
|
1
|
+
{"version":3,"file":"command-line.d.ts","sourceRoot":"","sources":["../../src/authorization/command-line.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AAEH,OAAO,EACN,KAAK,YAAY,EAKjB,MAAM,kBAAkB,CAAA;AAEzB,kFAAkF;AAClF,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;IACpC;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CACxB;AAED,sFAAsF;AACtF,eAAO,MAAM,kBAAkB,aAAmC,CAAA;AASlE;;;;GAIG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,YAAqB,GAC5B,wBAAwB,CAmC1B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC9B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,YAAqB,GAC5B,SAAS,MAAM,EAAE,CAenB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,YAAqB,GAAG,OAAO,CAKjG"}
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
* The failure mode is a prompt, never a silent grant.
|
|
77
77
|
*/
|
|
78
78
|
import { basename, lexShellCommandLine, } from './shell-lexer.js';
|
|
79
|
-
/** Commands whose argument is code assembled at runtime. */
|
|
80
|
-
const RUNTIME_EVALUATORS = new Set(['eval', 'source', '.']);
|
|
79
|
+
/** Commands whose argument is code assembled at runtime. Shared with `program.ts`. */
|
|
80
|
+
export const RUNTIME_EVALUATORS = new Set(['eval', 'source', '.']);
|
|
81
81
|
/**
|
|
82
82
|
* Width limit. A line past it is reported opaque rather than truncated: a
|
|
83
83
|
* shortened list of segments would read as complete to `allow`, which is the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-line.js","sourceRoot":"","sources":["../../src/authorization/command-line.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AAEH,OAAO,EAIN,QAAQ,EACR,mBAAmB,GACnB,MAAM,kBAAkB,CAAA;AAgBzB,
|
|
1
|
+
{"version":3,"file":"command-line.js","sourceRoot":"","sources":["../../src/authorization/command-line.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AAEH,OAAO,EAIN,QAAQ,EACR,mBAAmB,GACnB,MAAM,kBAAkB,CAAA;AAgBzB,sFAAsF;AACtF,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAA;AAElE;;;;GAIG;AACH,MAAM,YAAY,GAAG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MAAM,CAAA;AACd,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ToolSourceRef } from '../toolsets/types.js';
|
|
2
|
+
import type { AuthorizationGateConfig, AuthorizationPredicateCall, AuthorizationRule, GateEvaluationResult } from '../types/authorization/index.js';
|
|
2
3
|
import type { ToolDefinition } from '../types/tool/index.js';
|
|
3
4
|
import type { Logger } from '../utils/logger.js';
|
|
4
5
|
import type { ShellDialect } from './shell-lexer.js';
|
|
@@ -12,6 +13,13 @@ export interface ToolCallContext {
|
|
|
12
13
|
* `sh` dialect, which holds whichever shell runs it.
|
|
13
14
|
*/
|
|
14
15
|
readonly commandDialect?: ShellDialect;
|
|
16
|
+
/**
|
|
17
|
+
* Where `toolName` came from (`ToolManager.sourceOf`), when the caller
|
|
18
|
+
* has a manager to ask. `allow_read_only` needs this to tell an
|
|
19
|
+
* operator-trusted MCP server's read-only claim from an untrusted one's;
|
|
20
|
+
* omitted, it is read the same as a host-defined tool.
|
|
21
|
+
*/
|
|
22
|
+
readonly toolSource?: ToolSourceRef;
|
|
15
23
|
}
|
|
16
24
|
/**
|
|
17
25
|
* What the rule actually said, in words a model can act on.
|
|
@@ -27,8 +35,11 @@ export interface ToolCallContext {
|
|
|
27
35
|
* `git push*`, it can stop, say so, and do something else. A refusal that
|
|
28
36
|
* cannot be reasoned about produces thrashing; one that can produces a route
|
|
29
37
|
* around it.
|
|
38
|
+
*
|
|
39
|
+
* `call`, when given, is the call the rule decided: a `predicate` rule with a
|
|
40
|
+
* `describe` says what in it matched, instead of its fixed `description`.
|
|
30
41
|
*/
|
|
31
|
-
export declare function describeRule(rule: AuthorizationRule): string;
|
|
42
|
+
export declare function describeRule(rule: AuthorizationRule, call?: AuthorizationPredicateCall): string;
|
|
32
43
|
export declare class AuthorizationGate {
|
|
33
44
|
private readonly rules;
|
|
34
45
|
private readonly compiledPatterns;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../src/authorization/gate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,MAAM,iCAAiC,CAAA;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAEpD,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,SAAS,CAAA;IAC5C;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../src/authorization/gate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,KAAK,EACX,uBAAuB,EACvB,0BAA0B,EAC1B,iBAAiB,EACjB,oBAAoB,EACpB,MAAM,iCAAiC,CAAA;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAEpD,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,SAAS,CAAA;IAC5C;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,YAAY,CAAA;IACtC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAA;CACnC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,0BAA0B,GAAG,MAAM,CA6D/F;AAED,qBAAa,iBAAiB;IAC7B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqB;IAC3C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAqB;IACtD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA0B;IACnD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,MAAM,EAAE,uBAAuB,EAAE,GAAG,EAAE,MAAM;IAiHxD,QAAQ,CAAC,GAAG,EAAE,eAAe,GAAG,oBAAoB;CAqEpD"}
|
|
@@ -17,8 +17,11 @@ import { evaluateRule } from './rules.js';
|
|
|
17
17
|
* `git push*`, it can stop, say so, and do something else. A refusal that
|
|
18
18
|
* cannot be reasoned about produces thrashing; one that can produces a route
|
|
19
19
|
* around it.
|
|
20
|
+
*
|
|
21
|
+
* `call`, when given, is the call the rule decided: a `predicate` rule with a
|
|
22
|
+
* `describe` says what in it matched, instead of its fixed `description`.
|
|
20
23
|
*/
|
|
21
|
-
export function describeRule(rule) {
|
|
24
|
+
export function describeRule(rule, call) {
|
|
22
25
|
switch (rule.type) {
|
|
23
26
|
case 'deny_dangerous_patterns':
|
|
24
27
|
return 'this matches a pattern the operator refuses outright; rewording it will not help';
|
|
@@ -28,6 +31,14 @@ export function describeRule(rule) {
|
|
|
28
31
|
return `allowed by name (${rule.toolNames.join(', ')})`;
|
|
29
32
|
case 'deny_by_name':
|
|
30
33
|
return `denied by name (${rule.toolNames.join(', ')}) — this tool is refused for this turn, so a different input will not change it`;
|
|
34
|
+
case 'by_source': {
|
|
35
|
+
const verb = rule.decision === 'deny'
|
|
36
|
+
? 'denied'
|
|
37
|
+
: rule.decision === 'review'
|
|
38
|
+
? 'sent for review'
|
|
39
|
+
: 'allowed';
|
|
40
|
+
return `${verb} by source (${rule.sources.join(', ')})`;
|
|
41
|
+
}
|
|
31
42
|
case 'allow_by_category':
|
|
32
43
|
return `allowed by category (${rule.categories.join(', ')})`;
|
|
33
44
|
case 'allow_by_tier':
|
|
@@ -52,8 +63,18 @@ export function describeRule(rule) {
|
|
|
52
63
|
: 'allowed';
|
|
53
64
|
return `${verb} by a pattern rule matching the ${where}: ${rule.pattern}`;
|
|
54
65
|
}
|
|
55
|
-
case 'predicate':
|
|
56
|
-
|
|
66
|
+
case 'predicate': {
|
|
67
|
+
if (call === undefined || rule.describe === undefined)
|
|
68
|
+
return rule.description;
|
|
69
|
+
// A reason that cannot be computed is no reason to lose the
|
|
70
|
+
// refusal: the fixed one still says what the rule is.
|
|
71
|
+
try {
|
|
72
|
+
return rule.describe(call) || rule.description;
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
return rule.description;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
57
78
|
default: {
|
|
58
79
|
const exhaustive = rule;
|
|
59
80
|
return `matched an unrecognised rule: ${JSON.stringify(exhaustive)}`;
|
|
@@ -185,12 +206,23 @@ export class AuthorizationGate {
|
|
|
185
206
|
const rule = this.rules[i];
|
|
186
207
|
if (!rule)
|
|
187
208
|
continue;
|
|
188
|
-
const decision = evaluateRule(rule, ctx.toolName, ctx.toolInput, ctx.toolDef, this.compiledPatterns.get(i), this.nameSets.get(i),
|
|
209
|
+
const decision = evaluateRule(rule, ctx.toolName, ctx.toolInput, ctx.toolDef, this.compiledPatterns.get(i), this.nameSets.get(i), {
|
|
210
|
+
...(ctx.commandDialect !== undefined ? { commandDialect: ctx.commandDialect } : {}),
|
|
211
|
+
...(ctx.toolSource !== undefined ? { toolSource: ctx.toolSource } : {}),
|
|
212
|
+
});
|
|
189
213
|
if (decision !== null) {
|
|
190
214
|
const result = {
|
|
191
215
|
decision,
|
|
192
216
|
matchedRule: rule,
|
|
193
|
-
reason:
|
|
217
|
+
reason: rule.type === 'predicate'
|
|
218
|
+
? describeRule(rule, {
|
|
219
|
+
toolName: ctx.toolName,
|
|
220
|
+
toolInput: ctx.toolInput,
|
|
221
|
+
toolDef: ctx.toolDef,
|
|
222
|
+
// What `evaluateRule` told `decide`.
|
|
223
|
+
commandDialect: ctx.commandDialect ?? 'sh',
|
|
224
|
+
})
|
|
225
|
+
: describeRule(rule),
|
|
194
226
|
};
|
|
195
227
|
if (this.logDecisions) {
|
|
196
228
|
this.log.debug('Gate decision', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate.js","sourceRoot":"","sources":["../../src/authorization/gate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAA;AAC/E,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAA;
|
|
1
|
+
{"version":3,"file":"gate.js","sourceRoot":"","sources":["../../src/authorization/gate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAA;AAC/E,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAA;AAQvD,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAA;AAE/E,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAsBzC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,YAAY,CAAC,IAAuB,EAAE,IAAiC;IACtF,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,yBAAyB;YAC7B,OAAO,kFAAkF,CAAA;QAC1F,KAAK,iBAAiB;YACrB,OAAO,yCAAyC,CAAA;QACjD,KAAK,eAAe;YACnB,OAAO,oBAAoB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC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AC;oBACvB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,eAAe,EAAE;wBAC/B,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC,QAAQ;wBAC/B,8BAA8B,EAAE,QAAQ;wBACxC,+BAA+B,EAAE,IAAI,CAAC,IAAI;wBAC1C,gCAAgC,EAAE,CAAC;qBACnC,CAAC,CAAA;gBACH,CAAC;gBAED,OAAO,MAAM,CAAA;YACd,CAAC;QACF,CAAC;QAED,MAAM,MAAM,GAAyB;YACpC,QAAQ,EAAE,QAAQ;YAClB,WAAW,EAAE,IAAI;YACjB,MAAM,EAAE,wBAAwB;SAChC,CAAA;QAED,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,yBAAyB,EAAE;gBACzC,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC,QAAQ;gBAC/B,8BAA8B,EAAE,QAAQ;aACxC,CAAC,CAAA;QACH,CAAC;QAED,OAAO,MAAM,CAAA;IACd,CAAC;CACD"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a command line actually execs a program.
|
|
3
|
+
*
|
|
4
|
+
* Three consumers each answered "what program does this command run" their
|
|
5
|
+
* own way — the live `bash` tool's escalation, the scheduled-run floor's
|
|
6
|
+
* `pkill`/`systemctl`/… detection, and a scheduled script's static check —
|
|
7
|
+
* and each guessed differently about a re-exec wrapper (`sudo`, `env`,
|
|
8
|
+
* `nice`, `timeout`, …) standing in front of the real program. A security
|
|
9
|
+
* review found that every one of them only ever looked at
|
|
10
|
+
* `command.words[command.assignments]`, so `env $(echo git) push`,
|
|
11
|
+
* `timeout 5 $(echo systemctl) stop …` and the rest ran unverified: the
|
|
12
|
+
* wrapper's own name is what each check saw, never the word it was actually
|
|
13
|
+
* about to run.
|
|
14
|
+
*
|
|
15
|
+
* `programPositions` is the one place that answer now lives. It unwraps a
|
|
16
|
+
* chain of re-exec wrappers — each with its OWN real option grammar, so
|
|
17
|
+
* `stdbuf -oL prog` and `timeout 5 prog` are read correctly rather than
|
|
18
|
+
* assumed to put the program right after the wrapper's name — and reports
|
|
19
|
+
* every position in the command where a program is actually named: the
|
|
20
|
+
* (possibly wrapped) head, and, for `find`, each `-exec`/`-execdir`/`-ok`/
|
|
21
|
+
* `-okdir` clause's own head.
|
|
22
|
+
*
|
|
23
|
+
* A position is `known` (the literal, non-expanding word that names the
|
|
24
|
+
* program) or `unknown` (why it could not be resolved: the word itself
|
|
25
|
+
* expands, an option this does not recognise stood in the way, or an
|
|
26
|
+
* `xargs` program that is a shell or a `{}` placeholder). Fail closed: an
|
|
27
|
+
* option this does not model makes the position unknown, never "assumed to
|
|
28
|
+
* be the program" and never "assumed harmless".
|
|
29
|
+
*
|
|
30
|
+
* `source`/`.` and `eval` are read the same way a nested `bash -c` payload
|
|
31
|
+
* already is, not as an automatic unknown: `source path`/`. path` with a
|
|
32
|
+
* LITERAL path is known — the position is the `source`/`.` word itself,
|
|
33
|
+
* exactly as `bash path` is known without anyone reading what `path`
|
|
34
|
+
* contains — and unknown only when the path itself expands (`source "$X"`).
|
|
35
|
+
* `eval`'s literal argument words are joined and lexed as a command line of
|
|
36
|
+
* their own, and every position in the commands that come out of that is
|
|
37
|
+
* folded into the result — unknown when that reading is opaque, when any
|
|
38
|
+
* argument word expands, or, transitively, when a position inside the
|
|
39
|
+
* lexed payload is itself unknown (`eval 'env $(echo git) push'`).
|
|
40
|
+
* Consistency review (2026-09-24): treating `eval`/`source`/`.` as
|
|
41
|
+
* automatically unknown "wherever they stand, even literal" made
|
|
42
|
+
* `source .venv/bin/activate` ask alongside `source "$X"`, which is exactly
|
|
43
|
+
* the asymmetry `bash script.sh` (known) versus `bash -c "$X"` (unknown)
|
|
44
|
+
* does not have — the same module read a literal argument two different
|
|
45
|
+
* ways depending only on which command carried it. An `unknown` position
|
|
46
|
+
* still carries `word` when a single word is the reason (the word itself
|
|
47
|
+
* expands, so its value is not known before the line runs) — a caller that
|
|
48
|
+
* only needs "is there a word here that could name any of several tools"
|
|
49
|
+
* (the scheduled-run floor's `pkill`/`systemctl`/… detection) reads that
|
|
50
|
+
* word whether the position is known or not; `unknown` with no `word` is a
|
|
51
|
+
* structural failure with no single culprit (too many wrappers, an
|
|
52
|
+
* unrecognised option, an opaque `eval` payload, a poisoned environment).
|
|
53
|
+
*
|
|
54
|
+
* `hasPoisoningPrefix`, `poisonsLaterCommands` and `poisonedProgramPosition`
|
|
55
|
+
* are the other half a caller iterating a whole script needs: a command
|
|
56
|
+
* that sets `PATH`, `LD_PRELOAD`, `LD_LIBRARY_PATH`, `BASH_ENV`, `ENV` or
|
|
57
|
+
* `IFS` — as a leading assignment (which affects that same command's own
|
|
58
|
+
* program position) or as an `export`/bare assignment (which affects every
|
|
59
|
+
* command after it in the same script) — makes a LATER literal program name
|
|
60
|
+
* unverifiable too: which binary a literal `ls` resolves to depends on
|
|
61
|
+
* `PATH` at the moment it runs, not on the text of the word `ls`.
|
|
62
|
+
* `resolveScriptPrograms` threads that state through a whole script's
|
|
63
|
+
* commands in one pass, for a caller that does not want to write the loop
|
|
64
|
+
* itself.
|
|
65
|
+
*/
|
|
66
|
+
import { type ShellCommand, type ShellDialect, type ShellWord } from './shell-lexer.js';
|
|
67
|
+
/**
|
|
68
|
+
* Where a program is named, or why it could not be resolved. `word` is set
|
|
69
|
+
* whenever the position resolves to a specific word — including an unknown
|
|
70
|
+
* one whose OWN text is what is unresolvable (it expands, so its value is
|
|
71
|
+
* not known before the line runs); a caller that only cares "is there a
|
|
72
|
+
* word here that might be any program name" (the scheduled-run floor's
|
|
73
|
+
* scheduler-tool detection) reads `word` regardless of `unknown`. `unknown`
|
|
74
|
+
* with no `word` is a structural failure with no single culprit word — an
|
|
75
|
+
* option on a wrapper this does not recognise, too many wrappers, an opaque
|
|
76
|
+
* `eval` payload, or a poisoned resolution environment.
|
|
77
|
+
*/
|
|
78
|
+
export type ProgramPosition = {
|
|
79
|
+
readonly word: ShellWord;
|
|
80
|
+
readonly unknown?: undefined;
|
|
81
|
+
} | {
|
|
82
|
+
readonly word?: ShellWord;
|
|
83
|
+
readonly unknown: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Every position in `command` where a program is actually exec'd: the
|
|
87
|
+
* (possibly re-exec-wrapped) head, and, for `find`, each `-exec`-family
|
|
88
|
+
* clause's own head. Empty for a command with no words at all. `dialect` is
|
|
89
|
+
* the shell that will run the line — needed only to read a literal `eval`
|
|
90
|
+
* payload the same way its own commands would be.
|
|
91
|
+
*/
|
|
92
|
+
export declare function programPositions(command: ShellCommand, dialect: ShellDialect): readonly ProgramPosition[];
|
|
93
|
+
/** Variables whose value governs how a LATER literal program name resolves to a binary or to code. */
|
|
94
|
+
export declare const DYNAMIC_RESOLUTION_VARIABLES: ReadonlySet<string>;
|
|
95
|
+
/**
|
|
96
|
+
* Whether `command`'s OWN leading assignment (`PATH=x prog`) sets one of
|
|
97
|
+
* {@link DYNAMIC_RESOLUTION_VARIABLES} — which affects only `prog`'s own
|
|
98
|
+
* position, the way a real command-prefix assignment is scoped to that one
|
|
99
|
+
* invocation and does not leak to later commands. A caller iterating a
|
|
100
|
+
* whole script applies this to THIS command's own {@link programPositions}.
|
|
101
|
+
*/
|
|
102
|
+
export declare function hasPoisoningPrefix(command: ShellCommand): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Whether `command` sets one of {@link DYNAMIC_RESOLUTION_VARIABLES} for
|
|
105
|
+
* every command AFTER it in the same script: an `export NAME=value` (or a
|
|
106
|
+
* bare re-export, `export NAME`, of an already-set one), or a standalone
|
|
107
|
+
* assignment with no trailing command (`PATH=x` alone), both of which are
|
|
108
|
+
* real, persisting shell-variable assignments rather than a one-call
|
|
109
|
+
* prefix. A caller iterating a whole script applies this to every command
|
|
110
|
+
* that follows, not to `command` itself: a literal `ls` after either one
|
|
111
|
+
* cannot be trusted to resolve to what its text says, since which binary
|
|
112
|
+
* it runs — or what code a shell reads on startup (`BASH_ENV`, `ENV`) —
|
|
113
|
+
* depends on these variables' runtime value.
|
|
114
|
+
*/
|
|
115
|
+
export declare function poisonsLaterCommands(command: ShellCommand): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* The `unknown` position a command's own program name becomes once
|
|
118
|
+
* {@link hasPoisoningPrefix} or an earlier {@link poisonsLaterCommands} is
|
|
119
|
+
* true for it, in place of whatever {@link programPositions} would
|
|
120
|
+
* otherwise resolve — a literal name is no longer trustworthy once the
|
|
121
|
+
* environment it resolves against is unknown.
|
|
122
|
+
*/
|
|
123
|
+
export declare function poisonedProgramPosition(): ProgramPosition;
|
|
124
|
+
/** One command's {@link programPositions}, paired with the command itself. */
|
|
125
|
+
export interface CommandProgramPositions {
|
|
126
|
+
readonly command: ShellCommand;
|
|
127
|
+
readonly positions: readonly ProgramPosition[];
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* {@link programPositions} for every command a script reads, in order,
|
|
131
|
+
* threading {@link hasPoisoningPrefix} and {@link poisonsLaterCommands}
|
|
132
|
+
* through so a literal program name after an earlier `PATH=`, `export
|
|
133
|
+
* PATH=`, … comes back {@link poisonedProgramPosition} rather than trusted
|
|
134
|
+
* at face value. This is the one loop the live `bash` tool's escalation, the
|
|
135
|
+
* scheduled-run floor and `verifyScheduledScript` would otherwise each write
|
|
136
|
+
* for themselves — exactly the duplication that let `env $(echo git) push`
|
|
137
|
+
* pass one consumer's check and not another's.
|
|
138
|
+
*/
|
|
139
|
+
export declare function resolveScriptPrograms(commands: readonly ShellCommand[], dialect: ShellDialect): readonly CommandProgramPositions[];
|
|
140
|
+
/**
|
|
141
|
+
* Why a command line's own program name is not knowable ahead of running
|
|
142
|
+
* it, in one call: the line itself, unread whole (`bash -c "$X"`'s outer
|
|
143
|
+
* line is opaque — the lexer could not follow the payload at all, which is
|
|
144
|
+
* a stronger statement than any one position being unresolvable), or a
|
|
145
|
+
* specific command's unresolvable position via {@link resolveScriptPrograms}.
|
|
146
|
+
* The live `bash` tool's escalation (`executor.ts`) calls this directly
|
|
147
|
+
* rather than re-implementing it, so its own tests import the same function
|
|
148
|
+
* they are testing instead of a hand-written mirror that can drift from it.
|
|
149
|
+
*/
|
|
150
|
+
export declare function unknownProgramInLine(value: string, dialect: ShellDialect): string | undefined;
|
|
151
|
+
//# sourceMappingURL=program.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/authorization/program.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAIH,OAAO,EAEN,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,SAAS,EAId,MAAM,kBAAkB,CAAA;AAEzB;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GACxB;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAA;CAAE,GAC1D;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AA4f1D;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC/B,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,YAAY,GACnB,SAAS,eAAe,EAAE,CAa5B;AAED,sGAAsG;AACtG,eAAO,MAAM,4BAA4B,EAAE,WAAW,CAAC,MAAM,CAO3D,CAAA;AAUF;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAEjE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAyBnE;AAcD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,IAAI,eAAe,CAKzD;AAED,8EAA8E;AAC9E,MAAM,WA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