@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
|
@@ -33,6 +33,8 @@ export function presentScheduleCall(input: {
|
|
|
33
33
|
}
|
|
34
34
|
case 'list':
|
|
35
35
|
return activity('List scheduled jobs')
|
|
36
|
+
case 'update':
|
|
37
|
+
return activity(`Change scheduled job · ${oneLine(input.job)}`)
|
|
36
38
|
case 'pause':
|
|
37
39
|
return activity(`Pause scheduled job · ${oneLine(input.job)}`)
|
|
38
40
|
case 'resume':
|
|
@@ -7,7 +7,10 @@ import { scanSchedulePrompt } from './prompt-scan.js'
|
|
|
7
7
|
import type {
|
|
8
8
|
ScheduleBrowserGrant,
|
|
9
9
|
ScheduleBrowserSiteLevel,
|
|
10
|
+
ScheduleJobChanges,
|
|
10
11
|
ScheduleJobDraft,
|
|
12
|
+
ScheduleJobSummary,
|
|
13
|
+
ScheduleJobUpdateProposal,
|
|
11
14
|
ScheduleToolHost,
|
|
12
15
|
} from './types.js'
|
|
13
16
|
|
|
@@ -15,7 +18,8 @@ export const SCHEDULE_TOOL_NAME = 'schedule'
|
|
|
15
18
|
|
|
16
19
|
/**
|
|
17
20
|
* A person reads the whole proposal — the prompt, the rules, the schedule,
|
|
18
|
-
* the credential source — before answering `create`, `resume` or
|
|
21
|
+
* the credential source — before answering `create`, `update`, `resume` or
|
|
22
|
+
* `delete`.
|
|
19
23
|
* The executor's `DEFAULT_TOOL_TIMEOUT_MS` (two minutes) is sized for a tool
|
|
20
24
|
* call, not a person on the other end of a screen, and would abandon the
|
|
21
25
|
* call out from under them mid-read. `save_skill`
|
|
@@ -30,18 +34,43 @@ const BROWSER_PROFILE = /^[a-z0-9][a-z0-9-]{0,62}$/
|
|
|
30
34
|
|
|
31
35
|
const inputSchema = z.object({
|
|
32
36
|
action: z
|
|
33
|
-
.enum(['create', 'list', 'pause', 'resume', 'delete'])
|
|
34
|
-
.describe(
|
|
37
|
+
.enum(['create', 'list', 'update', 'pause', 'resume', 'delete'])
|
|
38
|
+
.describe(
|
|
39
|
+
'What to do. create, update, resume and delete ask the operator first. To change a job, update it: deleting and creating it again loses its history.',
|
|
40
|
+
),
|
|
35
41
|
name: z
|
|
36
42
|
.string()
|
|
37
43
|
.regex(/^[a-z0-9][a-z0-9-]{0,62}$/)
|
|
38
44
|
.optional()
|
|
39
45
|
.describe('create: job name, lowercase letters, digits and dashes'),
|
|
40
|
-
|
|
46
|
+
kind: z
|
|
47
|
+
.enum(['agent', 'script', 'script+agent'])
|
|
48
|
+
.optional()
|
|
49
|
+
.describe(
|
|
50
|
+
'create: what the run does. agent (default): the model runs prompt. script: a fixed shell script runs unattended, no model call, no prompt. script+agent: a cheap gate script decides whether to wake the model; wake:false costs nothing. Prefer script/script+agent for a fixed, deterministic check that would otherwise cost tokens for no reason.',
|
|
51
|
+
),
|
|
52
|
+
script: z
|
|
53
|
+
.object({
|
|
54
|
+
body: z.string().min(1).describe('The exact script text, run verbatim once confirmed'),
|
|
55
|
+
shell: z.enum(['bash', 'sh']).describe('Which shell reads it; no default'),
|
|
56
|
+
timeoutMs: z.number().int().positive().optional().describe('The script’s own wall clock'),
|
|
57
|
+
})
|
|
58
|
+
.optional()
|
|
59
|
+
.describe(
|
|
60
|
+
'create: required when kind is script or script+agent. For script+agent this is the wake-gate: its stdout must be exactly one JSON line, {"wake": boolean, "context": string}.',
|
|
61
|
+
),
|
|
62
|
+
prompt: z
|
|
63
|
+
.string()
|
|
64
|
+
.min(1)
|
|
65
|
+
.max(20_000)
|
|
66
|
+
.optional()
|
|
67
|
+
.describe(
|
|
68
|
+
'create, update: what the model run is asked to do. Required for agent and script+agent; refused for a pure script. For script+agent this is handed to the model only when the wake-gate says wake: true.',
|
|
69
|
+
),
|
|
41
70
|
when: z
|
|
42
71
|
.string()
|
|
43
72
|
.optional()
|
|
44
|
-
.describe('create: "every 30m", "0 9 * * 1-5" (cron), "at 2026-09-24 09:00", "in 2h"'),
|
|
73
|
+
.describe('create, update: "every 30m", "0 9 * * 1-5" (cron), "at 2026-09-24 09:00", "in 2h"'),
|
|
45
74
|
folder: z
|
|
46
75
|
.string()
|
|
47
76
|
.optional()
|
|
@@ -90,7 +119,9 @@ const inputSchema = z.object({
|
|
|
90
119
|
.describe('Browser access; omit for none'),
|
|
91
120
|
})
|
|
92
121
|
.optional()
|
|
93
|
-
.describe(
|
|
122
|
+
.describe(
|
|
123
|
+
'create: REQUIRED explicit permission set; there is no default. A pure script cannot use a browser grant. update: the whole new set, only when the permissions change',
|
|
124
|
+
),
|
|
94
125
|
budget: z
|
|
95
126
|
.object({
|
|
96
127
|
maxIterations: z
|
|
@@ -114,11 +145,13 @@ const inputSchema = z.object({
|
|
|
114
145
|
.int()
|
|
115
146
|
.positive()
|
|
116
147
|
.optional()
|
|
117
|
-
.describe('Wall clock of one
|
|
148
|
+
.describe('Wall clock of one agent phase, in milliseconds'),
|
|
118
149
|
})
|
|
119
150
|
.optional()
|
|
120
|
-
.describe(
|
|
121
|
-
|
|
151
|
+
.describe(
|
|
152
|
+
'Agent-phase limits; omit to use the defaults. Refused for a pure script; use script.timeoutMs instead.',
|
|
153
|
+
),
|
|
154
|
+
job: z.string().optional().describe('update/pause/resume/delete: job name'),
|
|
122
155
|
allFolders: z.boolean().optional().describe('list: include jobs of other folders (names only)'),
|
|
123
156
|
})
|
|
124
157
|
|
|
@@ -138,6 +171,14 @@ function effectsOf(rule: unknown): string[] {
|
|
|
138
171
|
* Refuse a network tool beside a shell that runs on the host: a scheduled run
|
|
139
172
|
* that can both read the machine and reach the internet, unattended, is the
|
|
140
173
|
* exfiltration shape, and only the operator can choose it.
|
|
174
|
+
*
|
|
175
|
+
* For `runKind: 'script'`/`'script+agent'` the "shell" isn't a rule the model
|
|
176
|
+
* could reach at some later live call — it's the confirmed script's own
|
|
177
|
+
* body, which unconditionally runs shell commands whenever it runs at all.
|
|
178
|
+
* The `bash` rule heuristic below answers a question ("could a live call
|
|
179
|
+
* reach bash") that isn't the one being asked here, so a script/script+agent
|
|
180
|
+
* job on the host is treated as reaching a shell outright, whatever its
|
|
181
|
+
* rules say about `bash`.
|
|
141
182
|
*/
|
|
142
183
|
function networkWithHostShell(draft: ScheduleJobDraft): boolean {
|
|
143
184
|
const rules = draft.permissions.rules ?? {}
|
|
@@ -145,6 +186,8 @@ function networkWithHostShell(draft: ScheduleJobDraft): boolean {
|
|
|
145
186
|
draft.permissions.browser !== undefined ||
|
|
146
187
|
NETWORK_TOOLS.some((t) => effectsOf(rules[t]).some((e) => e === 'allow' || e === 'ask'))
|
|
147
188
|
if (!network) return false
|
|
189
|
+
const onHost = (draft.permissions.execution ?? 'host') === 'host'
|
|
190
|
+
if ((draft.runKind ?? 'agent') !== 'agent') return onHost
|
|
148
191
|
const bashEffects = effectsOf(rules.bash)
|
|
149
192
|
// The read-only preset denies bash; its rules are expanded by the host,
|
|
150
193
|
// so the draft carries only its name.
|
|
@@ -152,7 +195,7 @@ function networkWithHostShell(draft: ScheduleJobDraft): boolean {
|
|
|
152
195
|
bashEffects.length > 0
|
|
153
196
|
? bashEffects.some((e) => e !== 'deny')
|
|
154
197
|
: draft.permissions.preset !== 'read-only' && draft.permissions.unmatched !== 'deny'
|
|
155
|
-
return shellPossible &&
|
|
198
|
+
return shellPossible && onHost
|
|
156
199
|
}
|
|
157
200
|
|
|
158
201
|
/**
|
|
@@ -208,45 +251,70 @@ function browserGrant(
|
|
|
208
251
|
}
|
|
209
252
|
}
|
|
210
253
|
|
|
254
|
+
/** A proposed permission set as a draft carries it, or why it is refused. */
|
|
255
|
+
function checkPermissions(
|
|
256
|
+
host: ScheduleToolHost,
|
|
257
|
+
proposed: NonNullable<Input['permissions']>,
|
|
258
|
+
): { ok: true; permissions: ScheduleJobDraft['permissions'] } | { ok: false; error: string } {
|
|
259
|
+
if (!proposed.preset && !proposed.rules && !proposed.browser) {
|
|
260
|
+
return {
|
|
261
|
+
ok: false,
|
|
262
|
+
error:
|
|
263
|
+
'permissions needs a preset, rules or a browser grant; an empty permission set is not a choice.',
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (!proposed.browser) return { ok: true, permissions: proposed }
|
|
267
|
+
const grant = browserGrant(host, proposed.browser)
|
|
268
|
+
if (!grant.ok) return grant
|
|
269
|
+
return { ok: true, permissions: { ...proposed, browser: grant.grant } }
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
const NETWORK_WITH_HOST_SHELL =
|
|
273
|
+
'A scheduled job proposed here cannot combine web or browser access with a shell on the host. Deny bash, use execution "sandbox", or ask the operator to create it with `namzu schedule add`.'
|
|
274
|
+
|
|
211
275
|
async function create(
|
|
212
276
|
host: ScheduleToolHost,
|
|
213
277
|
input: Input,
|
|
214
278
|
signal: AbortSignal | undefined,
|
|
215
279
|
): Promise<ToolResult> {
|
|
216
|
-
const
|
|
280
|
+
const runKind = input.kind ?? 'agent'
|
|
281
|
+
const required: string[] = (['name', 'when', 'permissions'] as const).filter(
|
|
217
282
|
(k) => input[k] === undefined,
|
|
218
283
|
)
|
|
219
|
-
if (
|
|
284
|
+
if (runKind !== 'script' && input.prompt === undefined) required.push('prompt')
|
|
285
|
+
if (runKind !== 'agent' && input.script === undefined) required.push('script')
|
|
286
|
+
if (required.length > 0) {
|
|
220
287
|
return refuse(
|
|
221
|
-
`create needs ${
|
|
288
|
+
`create needs ${required.join(', ')}. permissions is required: propose an explicit set (a preset and/or rules, plus unmatched).`,
|
|
222
289
|
)
|
|
223
290
|
}
|
|
224
|
-
|
|
225
|
-
|
|
291
|
+
if (runKind === 'agent' && input.script !== undefined) {
|
|
292
|
+
return refuse('an agent job has no script; omit kind (or set it to agent) to use one')
|
|
293
|
+
}
|
|
294
|
+
if (runKind === 'script' && input.prompt !== undefined)
|
|
295
|
+
return refuse('a pure script job has no prompt; remove prompt')
|
|
296
|
+
if (runKind === 'script' && input.budget !== undefined) {
|
|
226
297
|
return refuse(
|
|
227
|
-
'
|
|
298
|
+
'a pure script job has no agent budget; remove budget and use script.timeoutMs for its timeout',
|
|
228
299
|
)
|
|
229
300
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
301
|
+
if (runKind === 'script' && input.permissions?.browser !== undefined)
|
|
302
|
+
return refuse('a pure script job cannot use a browser grant; remove permissions.browser')
|
|
303
|
+
const checked = checkPermissions(host, input.permissions as NonNullable<Input['permissions']>)
|
|
304
|
+
if (!checked.ok) return refuse(checked.error)
|
|
305
|
+
const permissions = checked.permissions
|
|
236
306
|
const draft: ScheduleJobDraft = {
|
|
237
307
|
name: input.name as string,
|
|
238
|
-
prompt: input.prompt as string,
|
|
239
308
|
when: input.when as string,
|
|
309
|
+
...(runKind !== 'agent' ? { runKind } : {}),
|
|
310
|
+
...(input.script ? { script: input.script } : {}),
|
|
311
|
+
...(input.prompt !== undefined ? { prompt: input.prompt } : {}),
|
|
240
312
|
...(input.folder !== undefined ? { folder: input.folder } : {}),
|
|
241
313
|
...(input.tz !== undefined ? { tz: input.tz } : {}),
|
|
242
314
|
permissions,
|
|
243
315
|
...(input.budget ? { budget: input.budget } : {}),
|
|
244
316
|
}
|
|
245
|
-
if (networkWithHostShell(draft))
|
|
246
|
-
return refuse(
|
|
247
|
-
'A scheduled job proposed here cannot combine web or browser access with a shell on the host. Deny bash, use execution "sandbox", or ask the operator to create it with `namzu schedule add`.',
|
|
248
|
-
)
|
|
249
|
-
}
|
|
317
|
+
if (networkWithHostShell(draft)) return refuse(NETWORK_WITH_HOST_SHELL)
|
|
250
318
|
let preview: Awaited<ReturnType<ScheduleToolHost['preview']>>
|
|
251
319
|
try {
|
|
252
320
|
preview = await host.preview(draft)
|
|
@@ -282,7 +350,9 @@ async function create(
|
|
|
282
350
|
const said =
|
|
283
351
|
answer === 'create-paused'
|
|
284
352
|
? `Job "${created.name}" was created paused. The operator can resume it with /schedule.`
|
|
285
|
-
:
|
|
353
|
+
: runKind === 'script'
|
|
354
|
+
? `Job "${created.name}" was created. It runs ${preview.schedule}, with nobody watching; results are recorded in its history and may arrive as a notification. It creates no session.`
|
|
355
|
+
: `Job "${created.name}" was created. It runs ${preview.schedule}, with nobody watching; results arrive as a notification and a session.`
|
|
286
356
|
return {
|
|
287
357
|
success: true,
|
|
288
358
|
output: created.note ? `${said} ${created.note}` : said,
|
|
@@ -291,15 +361,141 @@ async function create(
|
|
|
291
361
|
}
|
|
292
362
|
|
|
293
363
|
async function list(host: ScheduleToolHost, input: Input): Promise<ToolResult> {
|
|
294
|
-
|
|
364
|
+
let jobs: readonly ScheduleJobSummary[]
|
|
365
|
+
try {
|
|
366
|
+
jobs = await host.list({ allFolders: input.allFolders === true })
|
|
367
|
+
} catch (error) {
|
|
368
|
+
return refuse(error instanceof Error ? error.message : String(error))
|
|
369
|
+
}
|
|
295
370
|
if (jobs.length === 0) return { success: true, output: 'No scheduled jobs.', data: { jobs: [] } }
|
|
296
371
|
const lines = jobs.map(
|
|
297
372
|
(j) =>
|
|
298
|
-
`${j.name} · ${j.state} · ${j.schedule}${j.nextFireAt ? ` · next ${j.nextFireAt}` : ''}${j.lastStatus ? ` · last ${j.lastStatus}` : ''} · ${j.folder}`,
|
|
373
|
+
`${j.name} · ${j.state} · ${j.schedule}${j.nextFireAt ? ` · next ${j.nextFireAt}` : ''}${j.lastStatus ? ` · last ${j.lastStatus}` : ''} · ${j.folder}${j.inSessionFolder ? ' (this folder)' : ''}`,
|
|
299
374
|
)
|
|
300
375
|
return { success: true, output: lines.join('\n'), data: { jobs } }
|
|
301
376
|
}
|
|
302
377
|
|
|
378
|
+
/** The fields `update` may change, as the model set them. */
|
|
379
|
+
const CHANGEABLE = [
|
|
380
|
+
'prompt',
|
|
381
|
+
'when',
|
|
382
|
+
'folder',
|
|
383
|
+
'tz',
|
|
384
|
+
'permissions',
|
|
385
|
+
'budget',
|
|
386
|
+
'kind',
|
|
387
|
+
'script',
|
|
388
|
+
] as const
|
|
389
|
+
|
|
390
|
+
async function update(
|
|
391
|
+
host: ScheduleToolHost,
|
|
392
|
+
input: Input,
|
|
393
|
+
signal: AbortSignal | undefined,
|
|
394
|
+
): Promise<ToolResult> {
|
|
395
|
+
if (!host.previewUpdate || !host.confirmUpdate || !host.update) {
|
|
396
|
+
return refuse(
|
|
397
|
+
'This host cannot change a scheduled job. Ask the operator to change it themselves; do not delete and create it again, which loses its history.',
|
|
398
|
+
)
|
|
399
|
+
}
|
|
400
|
+
if (!input.job) return refuse("update needs job (the job's name) and the fields to change.")
|
|
401
|
+
if (input.name !== undefined) {
|
|
402
|
+
return refuse(
|
|
403
|
+
'update cannot rename a job: name the job to change with job, and leave name out.',
|
|
404
|
+
)
|
|
405
|
+
}
|
|
406
|
+
const given = CHANGEABLE.filter((k) => input[k] !== undefined)
|
|
407
|
+
if (given.length === 0) {
|
|
408
|
+
return refuse(`update needs at least one of ${CHANGEABLE.join(', ')} to change.`)
|
|
409
|
+
}
|
|
410
|
+
if (input.kind === 'agent' && input.script !== undefined) {
|
|
411
|
+
return refuse(
|
|
412
|
+
'update cannot set kind to agent while also giving a script; drop script to make it an agent job, or leave kind unset (or as script/script+agent) to keep one.',
|
|
413
|
+
)
|
|
414
|
+
}
|
|
415
|
+
let permissions: ScheduleJobDraft['permissions'] | undefined
|
|
416
|
+
if (input.permissions) {
|
|
417
|
+
const checked = checkPermissions(host, input.permissions)
|
|
418
|
+
if (!checked.ok) return refuse(checked.error)
|
|
419
|
+
permissions = checked.permissions
|
|
420
|
+
// The same guard `create` applies, against whatever THIS call
|
|
421
|
+
// changes: a kind given here is read too, since a script/script+agent
|
|
422
|
+
// job is refused this combination even where an agent job is not (no
|
|
423
|
+
// live turn reviews a script's calls one at a time). A kind changed
|
|
424
|
+
// with the existing permissions is checked on the effective preview
|
|
425
|
+
// after the host has applied all changes below.
|
|
426
|
+
if (
|
|
427
|
+
networkWithHostShell({
|
|
428
|
+
name: '',
|
|
429
|
+
prompt: '',
|
|
430
|
+
when: '',
|
|
431
|
+
...(input.kind !== undefined ? { runKind: input.kind } : {}),
|
|
432
|
+
permissions,
|
|
433
|
+
})
|
|
434
|
+
)
|
|
435
|
+
return refuse(NETWORK_WITH_HOST_SHELL)
|
|
436
|
+
}
|
|
437
|
+
const changes: ScheduleJobChanges = {
|
|
438
|
+
...(input.prompt !== undefined ? { prompt: input.prompt } : {}),
|
|
439
|
+
...(input.when !== undefined ? { when: input.when } : {}),
|
|
440
|
+
...(input.folder !== undefined ? { folder: input.folder } : {}),
|
|
441
|
+
...(input.tz !== undefined ? { tz: input.tz } : {}),
|
|
442
|
+
...(permissions ? { permissions } : {}),
|
|
443
|
+
...(input.budget ? { budget: input.budget } : {}),
|
|
444
|
+
...(input.kind !== undefined ? { runKind: input.kind } : {}),
|
|
445
|
+
...(input.script !== undefined ? { script: input.script } : {}),
|
|
446
|
+
}
|
|
447
|
+
let proposal: ScheduleJobUpdateProposal
|
|
448
|
+
try {
|
|
449
|
+
proposal = await host.previewUpdate(input.job, changes)
|
|
450
|
+
} catch (error) {
|
|
451
|
+
return refuse(error instanceof Error ? error.message : String(error))
|
|
452
|
+
}
|
|
453
|
+
const effectiveKind = input.kind ?? proposal.preview.runKind ?? 'agent'
|
|
454
|
+
if (
|
|
455
|
+
(effectiveKind === 'script' || effectiveKind === 'script+agent') &&
|
|
456
|
+
proposal.preview.execution === 'host' &&
|
|
457
|
+
(proposal.preview.networkGrantAccess ?? proposal.preview.networkAccess)
|
|
458
|
+
) {
|
|
459
|
+
return refuse(NETWORK_WITH_HOST_SHELL)
|
|
460
|
+
}
|
|
461
|
+
let confirmed = false
|
|
462
|
+
try {
|
|
463
|
+
confirmed = await host.confirmUpdate(
|
|
464
|
+
{
|
|
465
|
+
...proposal,
|
|
466
|
+
promptFindings: scanSchedulePrompt(proposal.preview.prompt),
|
|
467
|
+
proposedBy: 'model',
|
|
468
|
+
},
|
|
469
|
+
signal,
|
|
470
|
+
)
|
|
471
|
+
} catch {
|
|
472
|
+
confirmed = false
|
|
473
|
+
}
|
|
474
|
+
// As for `create`: never save on an answer that came after the
|
|
475
|
+
// operator was no longer being asked.
|
|
476
|
+
if (signal?.aborted) confirmed = false
|
|
477
|
+
if (!confirmed) {
|
|
478
|
+
return {
|
|
479
|
+
...refuse(
|
|
480
|
+
`The operator did not confirm the change; "${proposal.preview.name}" was not changed.`,
|
|
481
|
+
),
|
|
482
|
+
data: { cancelled: true },
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
let saved: Awaited<ReturnType<NonNullable<ScheduleToolHost['update']>>>
|
|
486
|
+
try {
|
|
487
|
+
saved = await host.update(proposal.preview)
|
|
488
|
+
} catch (error) {
|
|
489
|
+
return refuse(error instanceof Error ? error.message : String(error))
|
|
490
|
+
}
|
|
491
|
+
const said = `Job "${saved.name}" was updated in place and keeps its history. It runs ${proposal.preview.schedule}.`
|
|
492
|
+
return {
|
|
493
|
+
success: true,
|
|
494
|
+
output: saved.note ? `${said} ${saved.note}` : said,
|
|
495
|
+
data: { name: saved.name, updated: true, changes: proposal.changes },
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
303
499
|
async function lifecycle(
|
|
304
500
|
host: ScheduleToolHost,
|
|
305
501
|
input: Input,
|
|
@@ -331,12 +527,13 @@ async function lifecycle(
|
|
|
331
527
|
}
|
|
332
528
|
|
|
333
529
|
/**
|
|
334
|
-
* The `schedule` tool: create, list, pause, resume and delete the
|
|
335
|
-
* scheduled jobs from a conversation.
|
|
530
|
+
* The `schedule` tool: create, list, update, pause, resume and delete the
|
|
531
|
+
* operator's scheduled jobs from a conversation.
|
|
336
532
|
*
|
|
337
|
-
* Creation, resuming and deleting are confirmed by a person
|
|
338
|
-
* (`ScheduleToolHost.confirm`), on a
|
|
339
|
-
*
|
|
533
|
+
* Creation, updating, resuming and deleting are confirmed by a person
|
|
534
|
+
* through the host (`ScheduleToolHost.confirm`, `confirmUpdate`), on a
|
|
535
|
+
* screen the host draws from its own computation. An update changes the
|
|
536
|
+
* job in place, so it keeps its id and its history. The model cannot propose that uncovered calls run without
|
|
340
537
|
* asking, nor web access beside a host shell. Register it only where a person
|
|
341
538
|
* is present to confirm: never in a headless run, a scheduled run or a
|
|
342
539
|
* sub-agent.
|
|
@@ -346,7 +543,7 @@ export function buildScheduleTools(host: ScheduleToolHost): ToolDefinition[] {
|
|
|
346
543
|
defineTool({
|
|
347
544
|
name: SCHEDULE_TOOL_NAME,
|
|
348
545
|
description:
|
|
349
|
-
"Manage the operator's scheduled jobs: prompts that run later in a folder, with nobody watching, under an explicit permission set. Use it only when the user asks for something to happen on a schedule. create, resume and delete are confirmed by the operator; pause is not. A job needs name,
|
|
546
|
+
"Manage the operator's scheduled jobs: model prompts or fixed scripts that run later in a folder, with nobody watching, under an explicit permission set. Use it only when the user asks for something to happen on a schedule. create, update, resume and delete are confirmed by the operator; pause is not. A job needs name, when and permissions (unmatched: park or deny, plus a preset, rules or a browser grant). agent and script+agent also need prompt; script and script+agent also need script. A pure script has no prompt, model, agent budget, browser grant or session; set script.timeoutMs to limit it. To change a job, update it with job and only the fields that change; do not delete and recreate it. Leave every other field (folder, tz, execution, budget, headed) unset unless the user asked for it: the defaults are the operator's, and the confirmation marks each value you chose. Scheduled runs cannot ask questions.",
|
|
350
547
|
inputSchema,
|
|
351
548
|
category: 'custom',
|
|
352
549
|
permissions: [],
|
|
@@ -358,8 +555,8 @@ export function buildScheduleTools(host: ScheduleToolHost): ToolDefinition[] {
|
|
|
358
555
|
concurrencySafe: false,
|
|
359
556
|
presentCall: presentScheduleCall,
|
|
360
557
|
presentResult: presentScheduleResult,
|
|
361
|
-
// A person, not a tool, answers `create`/`resume`/`delete`;
|
|
362
|
-
// `OPERATOR_CONFIRM_TIMEOUT_MS`.
|
|
558
|
+
// A person, not a tool, answers `create`/`update`/`resume`/`delete`;
|
|
559
|
+
// see `OPERATOR_CONFIRM_TIMEOUT_MS`.
|
|
363
560
|
timeoutMs: OPERATOR_CONFIRM_TIMEOUT_MS,
|
|
364
561
|
async execute(input, context: ToolContext) {
|
|
365
562
|
switch (input.action) {
|
|
@@ -367,6 +564,8 @@ export function buildScheduleTools(host: ScheduleToolHost): ToolDefinition[] {
|
|
|
367
564
|
return create(host, input, context.abortSignal)
|
|
368
565
|
case 'list':
|
|
369
566
|
return list(host, input)
|
|
567
|
+
case 'update':
|
|
568
|
+
return update(host, input, context.abortSignal)
|
|
370
569
|
default:
|
|
371
570
|
return lifecycle(host, input, input.action, context.abortSignal)
|
|
372
571
|
}
|
|
@@ -11,10 +11,29 @@
|
|
|
11
11
|
/** A rule effect, in the vocabulary of the CLI's `[permissions]` table. */
|
|
12
12
|
export type ScheduleRuleEffect = 'allow' | 'ask' | 'deny'
|
|
13
13
|
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* What the model proposes. Validated by the tool's schema, then by the host.
|
|
16
|
+
*
|
|
17
|
+
* `runKind` absent means `'agent'`, unchanged from before this field
|
|
18
|
+
* existed — every existing host keeps compiling and behaving the same.
|
|
19
|
+
* `prompt` is optional ONLY because a pure `'script'` draft has none; a
|
|
20
|
+
* `ScheduleToolHost` that read it as a bare `string` before this field
|
|
21
|
+
* existed now needs a null check under `strictNullChecks` (see the SDK's
|
|
22
|
+
* changeset for this release: this is a breaking change to the type, not a
|
|
23
|
+
* free widening).
|
|
24
|
+
*/
|
|
15
25
|
export interface ScheduleJobDraft {
|
|
16
26
|
readonly name: string
|
|
17
|
-
|
|
27
|
+
/** Required unless `runKind` is `'script'`, whose prompt is unused. */
|
|
28
|
+
readonly prompt?: string
|
|
29
|
+
/** Absent: `'agent'`. */
|
|
30
|
+
readonly runKind?: 'agent' | 'script' | 'script+agent'
|
|
31
|
+
/** Required when `runKind` is `'script'` or `'script+agent'` (the wake-gate). */
|
|
32
|
+
readonly script?: {
|
|
33
|
+
readonly body: string
|
|
34
|
+
readonly shell: 'bash' | 'sh'
|
|
35
|
+
readonly timeoutMs?: number
|
|
36
|
+
}
|
|
18
37
|
/** Schedule words: `every 30m`, `0 9 * * 1-5`, `at 09:00`, `in 2h`. */
|
|
19
38
|
readonly when: string
|
|
20
39
|
/** Folder the job runs in. Absent: the session's working directory. */
|
|
@@ -78,7 +97,16 @@ export interface ScheduleJobPreview {
|
|
|
78
97
|
readonly folder: string
|
|
79
98
|
/** True when `folder` is outside the session's working directory and added directories. */
|
|
80
99
|
readonly outsideSessionRoots: boolean
|
|
100
|
+
/** Empty for a pure `'script'` job, whose prompt is unused. */
|
|
81
101
|
readonly prompt: string
|
|
102
|
+
/** Absent: `'agent'`. */
|
|
103
|
+
readonly runKind?: 'agent' | 'script' | 'script+agent'
|
|
104
|
+
/** Present for `runKind: 'script'`/`'script+agent'`: the exact confirmed text. */
|
|
105
|
+
readonly script?: {
|
|
106
|
+
readonly body: string
|
|
107
|
+
readonly shell: 'bash' | 'sh'
|
|
108
|
+
readonly timeoutMs: number
|
|
109
|
+
}
|
|
82
110
|
/** The schedule in words, with its zone. */
|
|
83
111
|
readonly schedule: string
|
|
84
112
|
/** The next fire times, ISO-8601 UTC. */
|
|
@@ -87,8 +115,11 @@ export interface ScheduleJobPreview {
|
|
|
87
115
|
readonly rules: readonly string[]
|
|
88
116
|
readonly unmatched: 'park' | 'deny' | 'allow'
|
|
89
117
|
readonly execution: 'host' | 'sandbox'
|
|
90
|
-
/**
|
|
118
|
+
/** The run can reach the network, including through a fixed host script. */
|
|
91
119
|
readonly networkAccess: boolean
|
|
120
|
+
/** Web/browser permissions grant network access, separate from a script's own capability. */
|
|
121
|
+
readonly networkGrantAccess?: boolean
|
|
122
|
+
/** Effective run limits. A pure script has zero model iterations/tokens and its script timeout. */
|
|
92
123
|
readonly budget: {
|
|
93
124
|
readonly maxIterations: number
|
|
94
125
|
readonly tokenBudget: number
|
|
@@ -96,8 +127,8 @@ export interface ScheduleJobPreview {
|
|
|
96
127
|
}
|
|
97
128
|
/** Runs per day at most, times the token budget. Absent for a one-shot. */
|
|
98
129
|
readonly dailyTokenCeiling?: number
|
|
99
|
-
/** Provider and model the
|
|
100
|
-
readonly model
|
|
130
|
+
/** Provider and model the agent phase is pinned to. Absent for a pure script job. */
|
|
131
|
+
readonly model?: string
|
|
101
132
|
/** Where the run's credential comes from, in words. */
|
|
102
133
|
readonly credentialSource?: string
|
|
103
134
|
/** Anything the host wants said in the warning colour. */
|
|
@@ -114,6 +145,62 @@ export interface ScheduleJobSummary {
|
|
|
114
145
|
readonly lastStatus?: string
|
|
115
146
|
/** Present only for jobs in the session's own folder. */
|
|
116
147
|
readonly prompt?: string
|
|
148
|
+
/**
|
|
149
|
+
* True for a job whose folder is the session's own. A host that lists
|
|
150
|
+
* other folders' jobs sets it so the model can tell them apart; the tool
|
|
151
|
+
* marks such a job `(this folder)`.
|
|
152
|
+
*/
|
|
153
|
+
readonly inSessionFolder?: boolean
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* What the model proposes to change in an existing job. Every field left
|
|
158
|
+
* out keeps the job's current value. `permissions`, when given, is the whole
|
|
159
|
+
* new set, with the same limits as a new job's; the host keeps the job's
|
|
160
|
+
* `execution` when it is not given, and its additional directories.
|
|
161
|
+
*/
|
|
162
|
+
export interface ScheduleJobChanges {
|
|
163
|
+
readonly prompt?: string
|
|
164
|
+
readonly when?: string
|
|
165
|
+
readonly folder?: string
|
|
166
|
+
readonly tz?: string
|
|
167
|
+
readonly permissions?: ScheduleJobDraft['permissions']
|
|
168
|
+
readonly budget?: ScheduleJobDraft['budget']
|
|
169
|
+
/**
|
|
170
|
+
* Changes what kind of run this is. Absent: keeps the job's current kind.
|
|
171
|
+
* Moving to `'script'`/`'script+agent'` needs `script`; moving to
|
|
172
|
+
* `'agent'` drops whatever script the job had, whether or not one is
|
|
173
|
+
* given here — an agent job cannot carry one.
|
|
174
|
+
*/
|
|
175
|
+
readonly runKind?: 'agent' | 'script' | 'script+agent'
|
|
176
|
+
/**
|
|
177
|
+
* Replaces the whole script (or, for `'script+agent'`, wake-gate) body,
|
|
178
|
+
* shell and timeout — never a partial edit of just one of them. Absent:
|
|
179
|
+
* keeps the job's current script. Re-verified fresh against the
|
|
180
|
+
* scheduled-run floor and every `deny` rule, the same as a new job's.
|
|
181
|
+
*/
|
|
182
|
+
readonly script?: ScheduleJobDraft['script']
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** A proposed change to a job, as the host computed it. */
|
|
186
|
+
export interface ScheduleJobUpdateProposal {
|
|
187
|
+
/** The job as it would be once changed. Every field is the host's own computation. */
|
|
188
|
+
readonly preview: ScheduleJobPreview
|
|
189
|
+
/**
|
|
190
|
+
* What differs from the job as it stands (and from edits saved since it
|
|
191
|
+
* was last confirmed), one line each: `- ` what goes, `+ ` what comes.
|
|
192
|
+
*/
|
|
193
|
+
readonly changes: readonly string[]
|
|
194
|
+
/** The change touches what a run may do: its rules, `unmatched`, where it runs, its browser grant. */
|
|
195
|
+
readonly permissionsChange: boolean
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** What the person confirming a change is shown. */
|
|
199
|
+
export interface ScheduleUpdateRequest extends ScheduleJobUpdateProposal {
|
|
200
|
+
/** The prompt tripwire's findings over `preview.prompt`. */
|
|
201
|
+
readonly promptFindings: readonly string[]
|
|
202
|
+
/** Always `model` from this tool. */
|
|
203
|
+
readonly proposedBy: 'model'
|
|
117
204
|
}
|
|
118
205
|
|
|
119
206
|
/** What the person answered to a proposed job. */
|
|
@@ -157,7 +244,15 @@ export interface ScheduleToolHost {
|
|
|
157
244
|
preview: ScheduleJobPreview,
|
|
158
245
|
options: { readonly paused: boolean },
|
|
159
246
|
): Promise<{ readonly name: string; readonly note?: string }>
|
|
160
|
-
/**
|
|
247
|
+
/**
|
|
248
|
+
* Jobs, the session folder's in full, other folders' without their
|
|
249
|
+
* prompts. `allFolders: false` lets a host list only the session
|
|
250
|
+
* folder's; a host may list every job regardless, marking the session
|
|
251
|
+
* folder's with {@link ScheduleJobSummary.inSessionFolder}. The tool says
|
|
252
|
+
* "No scheduled jobs." when this returns none, so a host that filters
|
|
253
|
+
* says so only for its folder. Throw on an unreadable job store: the tool
|
|
254
|
+
* reports the error rather than claiming there are no jobs.
|
|
255
|
+
*/
|
|
161
256
|
list(options: { readonly allFolders: boolean }): Promise<readonly ScheduleJobSummary[]>
|
|
162
257
|
/** A job by name or id prefix, or undefined. */
|
|
163
258
|
find(job: string): Promise<ScheduleJobSummary | undefined>
|
|
@@ -170,6 +265,25 @@ export interface ScheduleToolHost {
|
|
|
170
265
|
pause(job: string): Promise<void>
|
|
171
266
|
resume(job: string): Promise<void>
|
|
172
267
|
delete(job: string): Promise<void>
|
|
268
|
+
/**
|
|
269
|
+
* Validate a change to `job` (a name or id prefix) and compute what the
|
|
270
|
+
* person will be shown. Throws with a message on a refusal. The tool
|
|
271
|
+
* offers `update` only when a host has all three of `previewUpdate`,
|
|
272
|
+
* `confirmUpdate` and `update`.
|
|
273
|
+
*/
|
|
274
|
+
previewUpdate?(job: string, changes: ScheduleJobChanges): Promise<ScheduleJobUpdateProposal>
|
|
275
|
+
/**
|
|
276
|
+
* Ask the person whether to save the change. Anything but `true` — a
|
|
277
|
+
* thrown error, a closed screen — changes nothing. See `confirm` on
|
|
278
|
+
* `signal`.
|
|
279
|
+
*/
|
|
280
|
+
confirmUpdate?(request: ScheduleUpdateRequest, signal?: AbortSignal): Promise<boolean>
|
|
281
|
+
/**
|
|
282
|
+
* Save the change the person confirmed, to the same job: its id and its
|
|
283
|
+
* history are kept, and the confirmation is the person's. `note` as for
|
|
284
|
+
* `create`.
|
|
285
|
+
*/
|
|
286
|
+
update?(preview: ScheduleJobPreview): Promise<{ readonly name: string; readonly note?: string }>
|
|
173
287
|
}
|
|
174
288
|
|
|
175
289
|
/** A prompt the session re-sends to itself on an interval. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ToolSourceRef } from '../toolsets/types.js'
|
|
1
2
|
import type { ToolDefinition } from '../types/tool/index.js'
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -30,23 +31,31 @@ import type { ToolDefinition } from '../types/tool/index.js'
|
|
|
30
31
|
* opening its own gate.
|
|
31
32
|
*
|
|
32
33
|
* Trust for the second case comes from the operator, per server, and is
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
34
|
+
* carried on the OWNING TOOLSET's source (`ToolSourceRef.readOnlyHintTrusted`,
|
|
35
|
+
* `toolsets/manager.ts`'s `sourceOf`) rather than stamped onto the tool
|
|
36
|
+
* itself — `ToolDefinition` has no `provenance` field to read; a definition
|
|
37
|
+
* cannot claim its own source. Never a global switch: one flag meaning
|
|
38
|
+
* "trust annotations" hands every connected server the same reach, which is
|
|
39
|
+
* the hole restated.
|
|
36
40
|
*
|
|
37
41
|
* `isReadOnly` itself is left reporting faithfully what the server said.
|
|
38
|
-
*
|
|
42
|
+
* Source and policy are different questions, and collapsing them would
|
|
39
43
|
* corrupt the outbound re-export and the prompt's own destructive label in
|
|
40
44
|
* order to fix a gate.
|
|
41
45
|
*/
|
|
42
|
-
export function isTrustedReadOnly(
|
|
46
|
+
export function isTrustedReadOnly(
|
|
47
|
+
tool: ToolDefinition | undefined,
|
|
48
|
+
input: unknown,
|
|
49
|
+
source?: ToolSourceRef,
|
|
50
|
+
): boolean {
|
|
43
51
|
if (!tool?.isReadOnly) return false
|
|
44
52
|
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
|
|
53
|
+
// A source that is not `mcp_server` is host-defined: this process, code
|
|
54
|
+
// the operator installed, no untrusted party in the chain. Requiring an
|
|
55
|
+
// opt-in for a builtin would break every read-only exemption for no gain
|
|
56
|
+
// in trust. `source` itself absent (a caller with no manager to ask)
|
|
57
|
+
// is treated the same way, matching the old "no provenance" default.
|
|
58
|
+
if (source?.kind === 'mcp_server' && !source.readOnlyHintTrusted) return false
|
|
50
59
|
|
|
51
60
|
return tool.isReadOnly(input)
|
|
52
61
|
}
|