@namzu/sdk 27.1.0 → 28.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 +1664 -0
- package/README.md +45 -42
- package/dist/advisory/executor.d.ts.map +1 -1
- package/dist/advisory/executor.js +14 -12
- package/dist/advisory/executor.js.map +1 -1
- package/dist/advisory/registry.d.ts +2 -2
- package/dist/advisory/registry.d.ts.map +1 -1
- package/dist/advisory/registry.js +2 -2
- package/dist/advisory/registry.js.map +1 -1
- package/dist/agents/AbstractAgent.d.ts +44 -2
- package/dist/agents/AbstractAgent.d.ts.map +1 -1
- package/dist/agents/AbstractAgent.js +62 -13
- package/dist/agents/AbstractAgent.js.map +1 -1
- package/dist/agents/PipelineAgent.d.ts +29 -1
- package/dist/agents/PipelineAgent.d.ts.map +1 -1
- package/dist/agents/PipelineAgent.js +33 -4
- package/dist/agents/PipelineAgent.js.map +1 -1
- package/dist/agents/ReactiveAgent.d.ts +2 -1
- package/dist/agents/ReactiveAgent.d.ts.map +1 -1
- package/dist/agents/ReactiveAgent.js +15 -5
- package/dist/agents/ReactiveAgent.js.map +1 -1
- package/dist/agents/RouterAgent.d.ts +2 -1
- package/dist/agents/RouterAgent.d.ts.map +1 -1
- package/dist/agents/RouterAgent.js +21 -13
- package/dist/agents/RouterAgent.js.map +1 -1
- package/dist/agents/SupervisorAgent.d.ts +3 -2
- package/dist/agents/SupervisorAgent.d.ts.map +1 -1
- package/dist/agents/SupervisorAgent.js +29 -14
- package/dist/agents/SupervisorAgent.js.map +1 -1
- package/dist/agents/handle.d.ts +85 -0
- package/dist/agents/handle.d.ts.map +1 -0
- package/dist/agents/handle.js +79 -0
- package/dist/agents/handle.js.map +1 -0
- package/dist/agents/runAgent.d.ts +10 -5
- package/dist/agents/runAgent.d.ts.map +1 -1
- package/dist/agents/runAgent.js +3 -2
- package/dist/agents/runAgent.js.map +1 -1
- package/dist/{verification → authorization}/gate.d.ts +4 -4
- package/dist/authorization/gate.d.ts.map +1 -0
- package/dist/{verification → authorization}/gate.js +31 -24
- package/dist/authorization/gate.js.map +1 -0
- package/dist/authorization/index.d.ts +6 -0
- package/dist/authorization/index.d.ts.map +1 -0
- package/dist/authorization/index.js +14 -0
- package/dist/authorization/index.js.map +1 -0
- package/dist/authorization/permission-presets.d.ts +119 -0
- package/dist/authorization/permission-presets.d.ts.map +1 -0
- package/dist/authorization/permission-presets.js +137 -0
- package/dist/authorization/permission-presets.js.map +1 -0
- package/dist/{verification → authorization}/presets.d.ts +3 -3
- package/dist/authorization/presets.d.ts.map +1 -0
- package/dist/{verification → authorization}/presets.js +12 -0
- package/dist/authorization/presets.js.map +1 -0
- package/dist/authorization/rules.d.ts +4 -0
- package/dist/authorization/rules.d.ts.map +1 -0
- package/dist/{verification → authorization}/rules.js +14 -1
- package/dist/authorization/rules.js.map +1 -0
- package/dist/bridge/a2a/client.d.ts +107 -0
- package/dist/bridge/a2a/client.d.ts.map +1 -0
- package/dist/bridge/a2a/client.js +275 -0
- package/dist/bridge/a2a/client.js.map +1 -0
- package/dist/bridge/a2a/mapper.d.ts.map +1 -1
- package/dist/bridge/a2a/mapper.js +16 -0
- package/dist/bridge/a2a/mapper.js.map +1 -1
- package/dist/bridge/acp/filesystem.d.ts +33 -0
- package/dist/bridge/acp/filesystem.d.ts.map +1 -0
- package/dist/bridge/acp/filesystem.js +30 -0
- package/dist/bridge/acp/filesystem.js.map +1 -0
- package/dist/bridge/acp/index.d.ts +8 -0
- package/dist/bridge/acp/index.d.ts.map +1 -0
- package/dist/bridge/acp/index.js +5 -0
- package/dist/bridge/acp/index.js.map +1 -0
- package/dist/bridge/acp/permission.d.ts +51 -0
- package/dist/bridge/acp/permission.d.ts.map +1 -0
- package/dist/bridge/acp/permission.js +37 -0
- package/dist/bridge/acp/permission.js.map +1 -0
- package/dist/bridge/acp/server.d.ts +163 -0
- package/dist/bridge/acp/server.d.ts.map +1 -0
- package/dist/bridge/acp/server.js +312 -0
- package/dist/bridge/acp/server.js.map +1 -0
- package/dist/bridge/acp/update.d.ts +13 -0
- package/dist/bridge/acp/update.d.ts.map +1 -0
- package/dist/bridge/acp/update.js +94 -0
- package/dist/bridge/acp/update.js.map +1 -0
- package/dist/bridge/mcp/connector/adapter.d.ts +2 -0
- package/dist/bridge/mcp/connector/adapter.d.ts.map +1 -1
- package/dist/bridge/mcp/connector/adapter.js +7 -3
- package/dist/bridge/mcp/connector/adapter.js.map +1 -1
- package/dist/bridge/sse/mapper.d.ts.map +1 -1
- package/dist/bridge/sse/mapper.js +27 -0
- package/dist/bridge/sse/mapper.js.map +1 -1
- package/dist/bus/breaker.d.ts.map +1 -1
- package/dist/bus/breaker.js +15 -10
- package/dist/bus/breaker.js.map +1 -1
- package/dist/bus/index.d.ts.map +1 -1
- package/dist/bus/index.js +10 -8
- package/dist/bus/index.js.map +1 -1
- package/dist/bus/lock.d.ts.map +1 -1
- package/dist/bus/lock.js +36 -19
- package/dist/bus/lock.js.map +1 -1
- package/dist/bus/ownership.d.ts.map +1 -1
- package/dist/bus/ownership.js +17 -9
- package/dist/bus/ownership.js.map +1 -1
- package/dist/compaction/context-window.d.ts +18 -2
- package/dist/compaction/context-window.d.ts.map +1 -1
- package/dist/compaction/context-window.js +15 -1
- package/dist/compaction/context-window.js.map +1 -1
- package/dist/compaction/index.d.ts +3 -0
- package/dist/compaction/index.d.ts.map +1 -1
- package/dist/compaction/index.js +4 -0
- package/dist/compaction/index.js.map +1 -1
- package/dist/compaction/manual.d.ts +58 -0
- package/dist/compaction/manual.d.ts.map +1 -0
- package/dist/compaction/manual.js +104 -0
- package/dist/compaction/manual.js.map +1 -0
- package/dist/compaction/plan.d.ts +92 -0
- package/dist/compaction/plan.d.ts.map +1 -0
- package/dist/compaction/plan.js +149 -0
- package/dist/compaction/plan.js.map +1 -0
- package/dist/compaction/summary.d.ts +23 -0
- package/dist/compaction/summary.d.ts.map +1 -0
- package/dist/compaction/summary.js +27 -0
- package/dist/compaction/summary.js.map +1 -0
- package/dist/compaction/verifier.js +2 -2
- package/dist/compaction/verifier.js.map +1 -1
- package/dist/config/registry.d.ts +104 -0
- package/dist/config/registry.d.ts.map +1 -0
- package/dist/config/registry.js +105 -0
- package/dist/config/registry.js.map +1 -0
- package/dist/config/runtime.d.ts +99 -28
- package/dist/config/runtime.d.ts.map +1 -1
- package/dist/config/runtime.js +27 -0
- package/dist/config/runtime.js.map +1 -1
- package/dist/connector/BaseConnector.d.ts +1 -1
- package/dist/connector/BaseConnector.d.ts.map +1 -1
- package/dist/connector/BaseConnector.js +8 -3
- package/dist/connector/BaseConnector.js.map +1 -1
- package/dist/connector/builtins/http.d.ts +1 -1
- package/dist/connector/builtins/http.d.ts.map +1 -1
- package/dist/connector/builtins/http.js +11 -2
- package/dist/connector/builtins/http.js.map +1 -1
- package/dist/connector/builtins/webhook.d.ts +1 -1
- package/dist/connector/builtins/webhook.d.ts.map +1 -1
- package/dist/connector/builtins/webhook.js +5 -2
- package/dist/connector/builtins/webhook.js.map +1 -1
- package/dist/connector/index.d.ts +4 -15
- package/dist/connector/index.d.ts.map +1 -1
- package/dist/connector/index.js +12 -12
- package/dist/connector/index.js.map +1 -1
- package/dist/connector/mcp/client.d.ts.map +1 -1
- package/dist/connector/mcp/client.js +31 -20
- package/dist/connector/mcp/client.js.map +1 -1
- package/dist/connector/mcp/discovery.d.ts.map +1 -1
- package/dist/connector/mcp/discovery.js +31 -20
- package/dist/connector/mcp/discovery.js.map +1 -1
- package/dist/connector/mcp/http-sse.d.ts +2 -1
- package/dist/connector/mcp/http-sse.d.ts.map +1 -1
- package/dist/connector/mcp/http-sse.js +9 -6
- package/dist/connector/mcp/http-sse.js.map +1 -1
- package/dist/connector/mcp/index.d.ts +2 -3
- package/dist/connector/mcp/index.d.ts.map +1 -1
- package/dist/connector/mcp/index.js +5 -4
- package/dist/connector/mcp/index.js.map +1 -1
- package/dist/connector/mcp/reconnect.d.ts +123 -0
- package/dist/connector/mcp/reconnect.d.ts.map +1 -0
- package/dist/connector/mcp/reconnect.js +121 -0
- package/dist/connector/mcp/reconnect.js.map +1 -0
- package/dist/connector/mcp/server/index.d.ts +28 -0
- package/dist/connector/mcp/server/index.d.ts.map +1 -0
- package/dist/connector/mcp/server/index.js +27 -0
- package/dist/connector/mcp/server/index.js.map +1 -0
- package/dist/connector/mcp/{server-stdio.d.ts → server/server-stdio.d.ts} +3 -2
- package/dist/connector/mcp/server/server-stdio.d.ts.map +1 -0
- package/dist/connector/mcp/{server-stdio.js → server/server-stdio.js} +4 -3
- package/dist/connector/mcp/server/server-stdio.js.map +1 -0
- package/dist/connector/mcp/{server.d.ts → server/server.d.ts} +5 -4
- package/dist/connector/mcp/server/server.d.ts.map +1 -0
- package/dist/connector/mcp/{server.js → server/server.js} +14 -9
- package/dist/connector/mcp/server/server.js.map +1 -0
- package/dist/connector/mcp/stdio.d.ts +2 -1
- package/dist/connector/mcp/stdio.d.ts.map +1 -1
- package/dist/connector/mcp/stdio.js +15 -7
- package/dist/connector/mcp/stdio.js.map +1 -1
- package/dist/connector/mcp/streamable-http.d.ts +2 -1
- package/dist/connector/mcp/streamable-http.d.ts.map +1 -1
- package/dist/connector/mcp/streamable-http.js +5 -4
- package/dist/connector/mcp/streamable-http.js.map +1 -1
- package/dist/{bridge/tools/connector → connector/tools}/adapter.d.ts +4 -4
- package/dist/connector/tools/adapter.d.ts.map +1 -0
- package/dist/{bridge/tools/connector → connector/tools}/adapter.js +1 -1
- package/dist/connector/tools/adapter.js.map +1 -0
- package/dist/{bridge/tools/connector → connector/tools}/definitions.d.ts +2 -2
- package/dist/connector/tools/definitions.d.ts.map +1 -0
- package/dist/{bridge/tools/connector → connector/tools}/definitions.js +2 -2
- package/dist/connector/tools/definitions.js.map +1 -0
- package/dist/connector/tools/index.d.ts.map +1 -0
- package/dist/connector/tools/index.js.map +1 -0
- package/dist/{bridge/tools/connector → connector/tools}/router.d.ts +4 -2
- package/dist/connector/tools/router.d.ts.map +1 -0
- package/dist/{bridge/tools/connector → connector/tools}/router.js +14 -7
- package/dist/connector/tools/router.js.map +1 -0
- package/dist/connector/web/guarded-fetch.d.ts +60 -0
- package/dist/connector/web/guarded-fetch.d.ts.map +1 -0
- package/dist/connector/web/guarded-fetch.js +233 -0
- package/dist/connector/web/guarded-fetch.js.map +1 -0
- package/dist/connector/web/index.d.ts +5 -0
- package/dist/connector/web/index.d.ts.map +1 -0
- package/dist/connector/web/index.js +7 -0
- package/dist/connector/web/index.js.map +1 -0
- package/dist/connector/web/types.d.ts +87 -0
- package/dist/connector/web/types.d.ts.map +1 -0
- package/dist/connector/web/types.js +25 -0
- package/dist/connector/web/types.js.map +1 -0
- package/dist/constants/acp/index.d.ts +97 -0
- package/dist/constants/acp/index.d.ts.map +1 -0
- package/dist/constants/acp/index.js +96 -0
- package/dist/constants/acp/index.js.map +1 -0
- package/dist/constants/authorization/index.d.ts.map +1 -0
- package/dist/constants/authorization/index.js.map +1 -0
- package/dist/constants/credential-env-keys.d.ts +36 -0
- package/dist/constants/credential-env-keys.d.ts.map +1 -0
- package/dist/constants/credential-env-keys.js +62 -0
- package/dist/constants/credential-env-keys.js.map +1 -0
- package/dist/constants/index.d.ts +3 -1
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +3 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/secret-patterns.d.ts +78 -0
- package/dist/constants/secret-patterns.d.ts.map +1 -0
- package/dist/constants/secret-patterns.js +99 -0
- package/dist/constants/secret-patterns.js.map +1 -0
- package/dist/constants/telemetry/index.d.ts +42 -0
- package/dist/constants/telemetry/index.d.ts.map +1 -1
- package/dist/constants/telemetry/index.js +87 -0
- package/dist/constants/telemetry/index.js.map +1 -1
- package/dist/contracts/a2a.d.ts +54 -54
- package/dist/contracts/api.d.ts +12 -1
- package/dist/contracts/api.d.ts.map +1 -1
- package/dist/contracts/schemas.d.ts +12 -12
- package/dist/deprecated-aliases.d.ts +80 -0
- package/dist/deprecated-aliases.d.ts.map +1 -0
- package/dist/deprecated-aliases.js +60 -0
- package/dist/deprecated-aliases.js.map +1 -0
- package/dist/eval/judge.js +2 -2
- package/dist/eval/judge.js.map +1 -1
- package/dist/execution/base.d.ts +1 -1
- package/dist/execution/base.d.ts.map +1 -1
- package/dist/execution/base.js +18 -7
- package/dist/execution/base.js.map +1 -1
- package/dist/execution/code-runtime/types.d.ts +114 -0
- package/dist/execution/code-runtime/types.d.ts.map +1 -0
- package/dist/execution/code-runtime/types.js +40 -0
- package/dist/execution/code-runtime/types.js.map +1 -0
- package/dist/execution/code-runtime/worker.d.ts +6 -0
- package/dist/execution/code-runtime/worker.d.ts.map +1 -0
- package/dist/execution/code-runtime/worker.js +248 -0
- package/dist/execution/code-runtime/worker.js.map +1 -0
- package/dist/{connector/execution → execution}/factory.d.ts +3 -3
- package/dist/execution/factory.d.ts.map +1 -0
- package/dist/{connector/execution → execution}/factory.js +1 -1
- package/dist/execution/factory.js.map +1 -0
- package/dist/{connector/execution → execution}/hybrid.d.ts +5 -3
- package/dist/execution/hybrid.d.ts.map +1 -0
- package/dist/{connector/execution → execution}/hybrid.js +10 -4
- package/dist/execution/hybrid.js.map +1 -0
- package/dist/execution/index.d.ts +23 -0
- package/dist/execution/index.d.ts.map +1 -1
- package/dist/execution/index.js +21 -0
- package/dist/execution/index.js.map +1 -1
- package/dist/execution/local.d.ts +2 -0
- package/dist/execution/local.d.ts.map +1 -1
- package/dist/execution/local.js +2 -2
- package/dist/execution/local.js.map +1 -1
- package/dist/{connector/execution → execution}/remote.d.ts +4 -2
- package/dist/execution/remote.d.ts.map +1 -0
- package/dist/{connector/execution → execution}/remote.js +12 -5
- package/dist/execution/remote.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/invariants/index.d.ts +111 -0
- package/dist/invariants/index.d.ts.map +1 -0
- package/dist/invariants/index.js +138 -0
- package/dist/invariants/index.js.map +1 -0
- package/dist/manager/agent/lifecycle.d.ts +29 -7
- package/dist/manager/agent/lifecycle.d.ts.map +1 -1
- package/dist/manager/agent/lifecycle.js +140 -50
- package/dist/manager/agent/lifecycle.js.map +1 -1
- package/dist/manager/connector/environment.d.ts +2 -0
- package/dist/manager/connector/environment.d.ts.map +1 -1
- package/dist/manager/connector/environment.js +20 -9
- package/dist/manager/connector/environment.js.map +1 -1
- package/dist/manager/connector/lifecycle.d.ts +10 -0
- package/dist/manager/connector/lifecycle.d.ts.map +1 -1
- package/dist/manager/connector/lifecycle.js +21 -11
- package/dist/manager/connector/lifecycle.js.map +1 -1
- package/dist/manager/connector/tenant.d.ts +9 -0
- package/dist/manager/connector/tenant.d.ts.map +1 -1
- package/dist/manager/connector/tenant.js +24 -10
- package/dist/manager/connector/tenant.js.map +1 -1
- package/dist/manager/index.d.ts +6 -2
- package/dist/manager/index.d.ts.map +1 -1
- package/dist/manager/index.js +7 -1
- package/dist/manager/index.js.map +1 -1
- package/dist/manager/project/lifecycle.d.ts +1 -1
- package/dist/manager/project/lifecycle.js +1 -1
- package/dist/manager/run/emergency.d.ts.map +1 -1
- package/dist/manager/run/emergency.js +9 -7
- package/dist/manager/run/emergency.js.map +1 -1
- package/dist/manager/run/persistence.d.ts +46 -4
- package/dist/manager/run/persistence.d.ts.map +1 -1
- package/dist/manager/run/persistence.js +102 -7
- package/dist/manager/run/persistence.js.map +1 -1
- package/dist/manager/topic/lifecycle.d.ts +123 -0
- package/dist/manager/topic/lifecycle.d.ts.map +1 -0
- package/dist/manager/{thread → topic}/lifecycle.js +79 -61
- package/dist/manager/topic/lifecycle.js.map +1 -0
- package/dist/manager/topic/objective.d.ts +77 -0
- package/dist/manager/topic/objective.d.ts.map +1 -0
- package/dist/manager/topic/objective.js +133 -0
- package/dist/manager/topic/objective.js.map +1 -0
- package/dist/model-router/task-router.d.ts.map +1 -0
- package/dist/model-router/task-router.js.map +1 -0
- package/dist/persona/assembler.d.ts +1 -1
- package/dist/persona/assembler.d.ts.map +1 -1
- package/dist/persona/assembler.js +14 -2
- package/dist/persona/assembler.js.map +1 -1
- package/dist/plugin/lifecycle.d.ts +24 -0
- package/dist/plugin/lifecycle.d.ts.map +1 -1
- package/dist/plugin/lifecycle.js +112 -20
- package/dist/plugin/lifecycle.js.map +1 -1
- package/dist/plugin/loader.d.ts +17 -2
- package/dist/plugin/loader.d.ts.map +1 -1
- package/dist/plugin/loader.js +46 -26
- package/dist/plugin/loader.js.map +1 -1
- package/dist/probe/index.d.ts +1 -0
- package/dist/probe/index.d.ts.map +1 -1
- package/dist/probe/registry.d.ts +34 -1
- package/dist/probe/registry.d.ts.map +1 -1
- package/dist/probe/registry.js +5 -4
- package/dist/probe/registry.js.map +1 -1
- package/dist/process/kill-tree.d.ts +40 -0
- package/dist/process/kill-tree.d.ts.map +1 -0
- package/dist/process/kill-tree.js +54 -0
- package/dist/process/kill-tree.js.map +1 -0
- package/dist/prompt/contributions.d.ts +138 -0
- package/dist/prompt/contributions.d.ts.map +1 -0
- package/dist/prompt/contributions.js +78 -0
- package/dist/prompt/contributions.js.map +1 -0
- package/dist/prompt/index.d.ts +3 -0
- package/dist/prompt/index.d.ts.map +1 -0
- package/dist/prompt/index.js +6 -0
- package/dist/prompt/index.js.map +1 -0
- package/dist/provider/attribution.d.ts +45 -0
- package/dist/provider/attribution.d.ts.map +1 -0
- package/dist/provider/attribution.js +23 -0
- package/dist/provider/attribution.js.map +1 -0
- package/dist/provider/{collect.d.ts → collect-chat-completion.d.ts} +3 -3
- package/dist/provider/collect-chat-completion.d.ts.map +1 -0
- package/dist/provider/{collect.js → collect-chat-completion.js} +3 -3
- package/dist/provider/collect-chat-completion.js.map +1 -0
- package/dist/provider/conformance.d.ts +93 -0
- package/dist/provider/conformance.d.ts.map +1 -0
- package/dist/provider/conformance.js +124 -0
- package/dist/provider/conformance.js.map +1 -0
- package/dist/provider/errors.d.ts +29 -0
- package/dist/provider/errors.d.ts.map +1 -1
- package/dist/provider/errors.js +27 -10
- package/dist/provider/errors.js.map +1 -1
- package/dist/provider/fallback.d.ts +1 -1
- package/dist/provider/fallback.d.ts.map +1 -1
- package/dist/provider/fallback.js +27 -9
- package/dist/provider/fallback.js.map +1 -1
- package/dist/provider/idle-timeout.d.ts +47 -0
- package/dist/provider/idle-timeout.d.ts.map +1 -0
- package/dist/provider/idle-timeout.js +61 -0
- package/dist/provider/idle-timeout.js.map +1 -0
- package/dist/provider/instrumentation.d.ts +3 -2
- package/dist/provider/instrumentation.d.ts.map +1 -1
- package/dist/provider/instrumentation.js.map +1 -1
- package/dist/provider/retry.d.ts.map +1 -1
- package/dist/provider/retry.js +58 -21
- package/dist/provider/retry.js.map +1 -1
- package/dist/public-runtime.d.ts +77 -14
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +168 -16
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-tools.d.ts +8 -1
- package/dist/public-tools.d.ts.map +1 -1
- package/dist/public-tools.js +29 -1
- package/dist/public-tools.js.map +1 -1
- package/dist/public-types.d.ts +21 -4
- package/dist/public-types.d.ts.map +1 -1
- package/dist/rag/rag-tool.d.ts.map +1 -1
- package/dist/rag/rag-tool.js +4 -1
- package/dist/rag/rag-tool.js.map +1 -1
- package/dist/read-model/index.d.ts +5 -0
- package/dist/read-model/index.d.ts.map +1 -0
- package/dist/read-model/index.js +7 -0
- package/dist/read-model/index.js.map +1 -0
- package/dist/read-model/registry.d.ts +112 -0
- package/dist/read-model/registry.d.ts.map +1 -0
- package/dist/read-model/registry.js +105 -0
- package/dist/read-model/registry.js.map +1 -0
- package/dist/read-model/run-status.d.ts +43 -0
- package/dist/read-model/run-status.d.ts.map +1 -0
- package/dist/read-model/run-status.js +89 -0
- package/dist/read-model/run-status.js.map +1 -0
- package/dist/registry/{Registry.d.ts → BaseRegistry.d.ts} +2 -2
- package/dist/registry/BaseRegistry.d.ts.map +1 -0
- package/dist/registry/{Registry.js → BaseRegistry.js} +2 -2
- package/dist/registry/BaseRegistry.js.map +1 -0
- package/dist/registry/ManagedRegistry.d.ts +2 -2
- package/dist/registry/ManagedRegistry.d.ts.map +1 -1
- package/dist/registry/ManagedRegistry.js +26 -9
- package/dist/registry/ManagedRegistry.js.map +1 -1
- package/dist/registry/command/index-exports.d.ts +3 -0
- package/dist/registry/command/index-exports.d.ts.map +1 -0
- package/dist/registry/command/index-exports.js +5 -0
- package/dist/registry/command/index-exports.js.map +1 -0
- package/dist/registry/command/index.d.ts +53 -0
- package/dist/registry/command/index.d.ts.map +1 -0
- package/dist/registry/command/index.js +87 -0
- package/dist/registry/command/index.js.map +1 -0
- package/dist/registry/command/kernel-commands.d.ts +32 -0
- package/dist/registry/command/kernel-commands.d.ts.map +1 -0
- package/dist/registry/command/kernel-commands.js +78 -0
- package/dist/registry/command/kernel-commands.js.map +1 -0
- package/dist/registry/connector/scoped.d.ts +2 -1
- package/dist/registry/connector/scoped.d.ts.map +1 -1
- package/dist/registry/connector/scoped.js +6 -5
- package/dist/registry/connector/scoped.js.map +1 -1
- package/dist/registry/index.d.ts +4 -1
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +5 -1
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/tool/execute.d.ts.map +1 -1
- package/dist/registry/tool/execute.js +15 -12
- package/dist/registry/tool/execute.js.map +1 -1
- package/dist/registry/tool/presentation.d.ts +32 -0
- package/dist/registry/tool/presentation.d.ts.map +1 -0
- package/dist/registry/tool/presentation.js +92 -0
- package/dist/registry/tool/presentation.js.map +1 -0
- package/dist/registry/tool/screen.d.ts.map +1 -1
- package/dist/registry/tool/screen.js +12 -11
- package/dist/registry/tool/screen.js.map +1 -1
- package/dist/run/drain.d.ts +13 -3
- package/dist/run/drain.d.ts.map +1 -1
- package/dist/run/drain.js +10 -0
- package/dist/run/drain.js.map +1 -1
- package/dist/run/reporter.d.ts.map +1 -1
- package/dist/run/reporter.js +203 -149
- package/dist/run/reporter.js.map +1 -1
- package/dist/run-query/index.d.ts +74 -0
- package/dist/run-query/index.d.ts.map +1 -0
- package/dist/run-query/index.js +73 -0
- package/dist/run-query/index.js.map +1 -0
- package/dist/runtime/bidi/session.d.ts.map +1 -1
- package/dist/runtime/bidi/session.js +7 -2
- package/dist/runtime/bidi/session.js.map +1 -1
- package/dist/runtime/decision/fallback.d.ts.map +1 -1
- package/dist/runtime/decision/fallback.js +6 -3
- package/dist/runtime/decision/fallback.js.map +1 -1
- package/dist/runtime/decision/parser.d.ts.map +1 -1
- package/dist/runtime/decision/parser.js +10 -9
- package/dist/runtime/decision/parser.js.map +1 -1
- package/dist/runtime/jobs/registry.d.ts +147 -0
- package/dist/runtime/jobs/registry.d.ts.map +1 -0
- package/dist/runtime/jobs/registry.js +242 -0
- package/dist/runtime/jobs/registry.js.map +1 -0
- package/dist/runtime/query/approval-policy.d.ts +22 -0
- package/dist/runtime/query/approval-policy.d.ts.map +1 -0
- package/dist/runtime/query/approval-policy.js +61 -0
- package/dist/runtime/query/approval-policy.js.map +1 -0
- package/dist/runtime/query/checkpoint.d.ts +3 -3
- package/dist/runtime/query/checkpoint.d.ts.map +1 -1
- package/dist/runtime/query/checkpoint.js +2 -2
- package/dist/runtime/query/checkpoint.js.map +1 -1
- package/dist/runtime/query/context.d.ts +85 -15
- package/dist/runtime/query/context.d.ts.map +1 -1
- package/dist/runtime/query/context.js +57 -14
- package/dist/runtime/query/context.js.map +1 -1
- package/dist/runtime/query/events.d.ts +5 -4
- package/dist/runtime/query/events.d.ts.map +1 -1
- package/dist/runtime/query/events.js +9 -6
- package/dist/runtime/query/events.js.map +1 -1
- package/dist/runtime/query/executor.d.ts +113 -4
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +228 -62
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/guardrail-presets.d.ts.map +1 -1
- package/dist/runtime/query/guardrail-presets.js +11 -14
- package/dist/runtime/query/guardrail-presets.js.map +1 -1
- package/dist/runtime/query/guardrails.d.ts.map +1 -1
- package/dist/runtime/query/guardrails.js +16 -12
- package/dist/runtime/query/guardrails.js.map +1 -1
- package/dist/runtime/query/index.d.ts +140 -16
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +379 -76
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/iteration/index.d.ts +32 -0
- package/dist/runtime/query/iteration/index.d.ts.map +1 -1
- package/dist/runtime/query/iteration/index.js +256 -88
- package/dist/runtime/query/iteration/index.js.map +1 -1
- package/dist/runtime/query/iteration/phases/advisory.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/advisory.js +17 -16
- package/dist/runtime/query/iteration/phases/advisory.js.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction.d.ts +1 -8
- package/dist/runtime/query/iteration/phases/compaction.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction.js +202 -178
- package/dist/runtime/query/iteration/phases/compaction.js.map +1 -1
- package/dist/runtime/query/iteration/phases/context.d.ts +52 -6
- package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/context.js +26 -17
- package/dist/runtime/query/iteration/phases/context.js.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.d.ts +2 -2
- package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.js +27 -7
- package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
- package/dist/runtime/query/iteration/phases/working-memory.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/working-memory.js +3 -2
- package/dist/runtime/query/iteration/phases/working-memory.js.map +1 -1
- package/dist/runtime/query/iteration/stream-turn.js +14 -14
- package/dist/runtime/query/iteration/stream-turn.js.map +1 -1
- package/dist/runtime/query/{context-cache.d.ts → prompt-cache.d.ts} +6 -4
- package/dist/runtime/query/prompt-cache.d.ts.map +1 -0
- package/dist/runtime/query/{context-cache.js → prompt-cache.js} +20 -2
- package/dist/runtime/query/prompt-cache.js.map +1 -0
- package/dist/runtime/query/prompt.d.ts +50 -0
- package/dist/runtime/query/prompt.d.ts.map +1 -1
- package/dist/runtime/query/prompt.js +83 -4
- package/dist/runtime/query/prompt.js.map +1 -1
- package/dist/runtime/query/repeat-call.d.ts +42 -0
- package/dist/runtime/query/repeat-call.d.ts.map +1 -0
- package/dist/runtime/query/repeat-call.js +107 -0
- package/dist/runtime/query/repeat-call.js.map +1 -0
- package/dist/runtime/query/replay/mutate.js +8 -1
- package/dist/runtime/query/replay/mutate.js.map +1 -1
- package/dist/runtime/query/result.d.ts +7 -0
- package/dist/runtime/query/result.d.ts.map +1 -1
- package/dist/runtime/query/result.js +38 -10
- package/dist/runtime/query/result.js.map +1 -1
- package/dist/runtime/query/resume-pending.d.ts.map +1 -1
- package/dist/runtime/query/resume-pending.js +19 -17
- package/dist/runtime/query/resume-pending.js.map +1 -1
- package/dist/runtime/query/resume-run.d.ts +2 -2
- package/dist/runtime/query/resume-run.d.ts.map +1 -1
- package/dist/runtime/query/run-state.d.ts +3 -3
- package/dist/runtime/query/run-state.d.ts.map +1 -1
- package/dist/runtime/query/run-state.js +2 -2
- package/dist/runtime/query/run-state.js.map +1 -1
- package/dist/runtime/query/tool-grants.d.ts +7 -0
- package/dist/runtime/query/tool-grants.d.ts.map +1 -1
- package/dist/runtime/query/tool-grants.js +1 -1
- package/dist/runtime/query/tool-grants.js.map +1 -1
- package/dist/runtime/query/tool-output-budget.js +34 -3
- package/dist/runtime/query/tool-output-budget.js.map +1 -1
- package/dist/runtime/query/tool-pause.d.ts.map +1 -1
- package/dist/runtime/query/tool-pause.js +2 -1
- package/dist/runtime/query/tool-pause.js.map +1 -1
- package/dist/runtime/query/tooling.d.ts +10 -2
- package/dist/runtime/query/tooling.d.ts.map +1 -1
- package/dist/runtime/query/tooling.js +3 -0
- package/dist/runtime/query/tooling.js.map +1 -1
- package/dist/sandbox/provider/local.d.ts +10 -0
- package/dist/sandbox/provider/local.d.ts.map +1 -1
- package/dist/sandbox/provider/local.js +77 -23
- package/dist/sandbox/provider/local.js.map +1 -1
- package/dist/sandbox/terminal.d.ts +130 -0
- package/dist/sandbox/terminal.d.ts.map +1 -0
- package/dist/sandbox/terminal.js +119 -0
- package/dist/sandbox/terminal.js.map +1 -0
- package/dist/{gateway → scheduler}/completion-inbox.d.ts +12 -5
- package/dist/scheduler/completion-inbox.d.ts.map +1 -0
- package/dist/{gateway → scheduler}/completion-inbox.js +19 -7
- package/dist/scheduler/completion-inbox.js.map +1 -0
- package/dist/scheduler/delegating.d.ts +90 -0
- package/dist/scheduler/delegating.d.ts.map +1 -0
- package/dist/scheduler/delegating.js +230 -0
- package/dist/scheduler/delegating.js.map +1 -0
- package/dist/{gateway → scheduler}/local.d.ts +10 -2
- package/dist/scheduler/local.d.ts.map +1 -0
- package/dist/{gateway → scheduler}/local.js +20 -11
- package/dist/scheduler/local.js.map +1 -0
- package/dist/session/actor-scope.d.ts +52 -0
- package/dist/session/actor-scope.d.ts.map +1 -0
- package/dist/session/actor-scope.js +112 -0
- package/dist/session/actor-scope.js.map +1 -0
- package/dist/session/errors.d.ts +31 -8
- package/dist/session/errors.d.ts.map +1 -1
- package/dist/session/errors.js +21 -1
- package/dist/session/errors.js.map +1 -1
- package/dist/session/handoff/assignment.d.ts +5 -5
- package/dist/session/handoff/assignment.d.ts.map +1 -1
- package/dist/session/handoff/broadcast.d.ts +2 -2
- package/dist/session/handoff/broadcast.d.ts.map +1 -1
- package/dist/session/handoff/broadcast.js +7 -7
- package/dist/session/handoff/broadcast.js.map +1 -1
- package/dist/session/handoff/single.d.ts +4 -4
- package/dist/session/handoff/single.d.ts.map +1 -1
- package/dist/session/handoff/single.js +4 -4
- package/dist/session/handoff/single.js.map +1 -1
- package/dist/session/migration/filesystem.d.ts +28 -0
- package/dist/session/migration/filesystem.d.ts.map +1 -1
- package/dist/session/migration/filesystem.js +44 -2
- package/dist/session/migration/filesystem.js.map +1 -1
- package/dist/session/migration/id-prefix.d.ts +50 -19
- package/dist/session/migration/id-prefix.d.ts.map +1 -1
- package/dist/session/migration/id-prefix.js +54 -22
- package/dist/session/migration/id-prefix.js.map +1 -1
- package/dist/session/migration/index.d.ts +6 -2
- package/dist/session/migration/index.d.ts.map +1 -1
- package/dist/session/migration/index.js +6 -2
- package/dist/session/migration/index.js.map +1 -1
- package/dist/session/migration/marker.d.ts.map +1 -1
- package/dist/session/migration/marker.js +21 -4
- package/dist/session/migration/marker.js.map +1 -1
- package/dist/session/retention/archive.d.ts.map +1 -1
- package/dist/session/retention/archive.js +25 -11
- package/dist/session/retention/archive.js.map +1 -1
- package/dist/session/workspace/git-worktree.d.ts.map +1 -1
- package/dist/session/workspace/git-worktree.js +17 -8
- package/dist/session/workspace/git-worktree.js.map +1 -1
- package/dist/skills/loader.d.ts +4 -2
- package/dist/skills/loader.d.ts.map +1 -1
- package/dist/skills/loader.js +36 -9
- package/dist/skills/loader.js.map +1 -1
- package/dist/skills/registry.d.ts +59 -1
- package/dist/skills/registry.d.ts.map +1 -1
- package/dist/skills/registry.js +154 -20
- package/dist/skills/registry.js.map +1 -1
- package/dist/store/attachment/index.d.ts +111 -0
- package/dist/store/attachment/index.d.ts.map +1 -0
- package/dist/store/attachment/index.js +94 -0
- package/dist/store/attachment/index.js.map +1 -0
- package/dist/store/config/index.d.ts +43 -0
- package/dist/store/config/index.d.ts.map +1 -0
- package/dist/store/config/index.js +51 -0
- package/dist/store/config/index.js.map +1 -0
- package/dist/store/feedback/conformance.d.ts +44 -0
- package/dist/store/feedback/conformance.d.ts.map +1 -0
- package/dist/store/feedback/conformance.js +127 -0
- package/dist/store/feedback/conformance.js.map +1 -0
- package/dist/store/feedback/disk.d.ts +46 -0
- package/dist/store/feedback/disk.d.ts.map +1 -0
- package/dist/store/feedback/disk.js +141 -0
- package/dist/store/feedback/disk.js.map +1 -0
- package/dist/store/feedback/index.d.ts +9 -0
- package/dist/store/feedback/index.d.ts.map +1 -0
- package/dist/store/feedback/index.js +5 -0
- package/dist/store/feedback/index.js.map +1 -0
- package/dist/store/feedback/memory.d.ts +33 -0
- package/dist/store/feedback/memory.d.ts.map +1 -0
- package/dist/store/feedback/memory.js +0 -0
- package/dist/store/feedback/memory.js.map +1 -0
- package/dist/store/feedback/types.d.ts +95 -0
- package/dist/store/feedback/types.d.ts.map +1 -0
- package/dist/store/feedback/types.js +27 -0
- package/dist/store/feedback/types.js.map +1 -0
- package/dist/store/index.d.ts +1 -0
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +4 -0
- package/dist/store/index.js.map +1 -1
- package/dist/store/kv/record-store.d.ts +54 -0
- package/dist/store/kv/record-store.d.ts.map +1 -0
- package/dist/store/kv/record-store.js +94 -0
- package/dist/store/kv/record-store.js.map +1 -0
- package/dist/store/memory/disk.d.ts +2 -0
- package/dist/store/memory/disk.d.ts.map +1 -1
- package/dist/store/memory/disk.js +36 -30
- package/dist/store/memory/disk.js.map +1 -1
- package/dist/store/run/checkpoint-disk.d.ts +4 -4
- package/dist/store/run/checkpoint-disk.d.ts.map +1 -1
- package/dist/store/run/checkpoint-disk.js +22 -1
- package/dist/store/run/checkpoint-disk.js.map +1 -1
- package/dist/store/run/checkpoint-memory.d.ts +4 -4
- package/dist/store/run/checkpoint-memory.d.ts.map +1 -1
- package/dist/store/run/checkpoint-memory.js.map +1 -1
- package/dist/store/run/claim-disk.d.ts +5 -5
- package/dist/store/run/claim-disk.d.ts.map +1 -1
- package/dist/store/run/claim-disk.js +20 -0
- package/dist/store/run/claim-disk.js.map +1 -1
- package/dist/store/run/conformance.d.ts.map +1 -1
- package/dist/store/run/conformance.js +10 -9
- package/dist/store/run/conformance.js.map +1 -1
- package/dist/store/run/disk.d.ts +3 -1
- package/dist/store/run/disk.d.ts.map +1 -1
- package/dist/store/run/disk.js +73 -4
- package/dist/store/run/disk.js.map +1 -1
- package/dist/store/run/listing.d.ts +4 -4
- package/dist/store/run/listing.d.ts.map +1 -1
- package/dist/store/run/listing.js.map +1 -1
- package/dist/store/run/memory.d.ts +5 -0
- package/dist/store/run/memory.d.ts.map +1 -1
- package/dist/store/run/memory.js +20 -1
- package/dist/store/run/memory.js.map +1 -1
- package/dist/store/session/canonical-path.d.ts +32 -0
- package/dist/store/session/canonical-path.d.ts.map +1 -0
- package/dist/store/session/canonical-path.js +46 -0
- package/dist/store/session/canonical-path.js.map +1 -0
- package/dist/store/session/disk.d.ts +46 -2
- package/dist/store/session/disk.d.ts.map +1 -1
- package/dist/store/session/disk.js +191 -205
- package/dist/store/session/disk.js.map +1 -1
- package/dist/store/session/memory.d.ts +10 -2
- package/dist/store/session/memory.d.ts.map +1 -1
- package/dist/store/session/memory.js +36 -4
- package/dist/store/session/memory.js.map +1 -1
- package/dist/store/task/disk.d.ts.map +1 -1
- package/dist/store/task/disk.js +76 -68
- package/dist/store/task/disk.js.map +1 -1
- package/dist/store/topic/index.d.ts +6 -0
- package/dist/store/topic/index.d.ts.map +1 -0
- package/dist/store/topic/index.js +20 -0
- package/dist/store/topic/index.js.map +1 -0
- package/dist/store/topic/memory.d.ts +30 -0
- package/dist/store/topic/memory.d.ts.map +1 -0
- package/dist/store/topic/memory.js +97 -0
- package/dist/store/topic/memory.js.map +1 -0
- package/dist/store/topic/objective.d.ts +104 -0
- package/dist/store/topic/objective.d.ts.map +1 -0
- package/dist/store/topic/objective.js +195 -0
- package/dist/store/topic/objective.js.map +1 -0
- package/dist/store/topic/state.d.ts +60 -0
- package/dist/store/topic/state.d.ts.map +1 -0
- package/dist/store/topic/state.js +128 -0
- package/dist/store/topic/state.js.map +1 -0
- package/dist/streaming/coalesce.d.ts +19 -6
- package/dist/streaming/coalesce.d.ts.map +1 -1
- package/dist/streaming/coalesce.js +13 -4
- package/dist/streaming/coalesce.js.map +1 -1
- package/dist/telemetry/runtime-accessors.d.ts +27 -1
- package/dist/telemetry/runtime-accessors.d.ts.map +1 -1
- package/dist/telemetry/runtime-accessors.js +45 -1
- package/dist/telemetry/runtime-accessors.js.map +1 -1
- package/dist/test-support/ids.d.ts +68 -0
- package/dist/test-support/ids.d.ts.map +1 -0
- package/dist/test-support/ids.js +70 -0
- package/dist/test-support/ids.js.map +1 -0
- package/dist/testing.d.ts +24 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +22 -0
- package/dist/testing.js.map +1 -0
- package/dist/tools/builtins/bash.d.ts +1 -0
- package/dist/tools/builtins/bash.d.ts.map +1 -1
- package/dist/tools/builtins/bash.js +77 -3
- package/dist/tools/builtins/bash.js.map +1 -1
- package/dist/tools/builtins/computer-use.d.ts +8 -8
- package/dist/tools/builtins/edit.d.ts +1 -1
- package/dist/tools/builtins/edit.d.ts.map +1 -1
- package/dist/tools/builtins/edit.js +34 -0
- package/dist/tools/builtins/edit.js.map +1 -1
- package/dist/tools/builtins/index.d.ts +6 -0
- package/dist/tools/builtins/index.d.ts.map +1 -1
- package/dist/tools/builtins/index.js +24 -1
- package/dist/tools/builtins/index.js.map +1 -1
- package/dist/tools/builtins/job.d.ts +6 -0
- package/dist/tools/builtins/job.d.ts.map +1 -0
- package/dist/tools/builtins/job.js +114 -0
- package/dist/tools/builtins/job.js.map +1 -0
- package/dist/tools/builtins/lsp.d.ts +21 -0
- package/dist/tools/builtins/lsp.d.ts.map +1 -0
- package/dist/tools/builtins/lsp.js +186 -0
- package/dist/tools/builtins/lsp.js.map +1 -0
- package/dist/tools/builtins/run-code.d.ts +13 -0
- package/dist/tools/builtins/run-code.d.ts.map +1 -0
- package/dist/tools/builtins/run-code.js +126 -0
- package/dist/tools/builtins/run-code.js.map +1 -0
- package/dist/tools/builtins/skill.d.ts +14 -0
- package/dist/tools/builtins/skill.d.ts.map +1 -0
- package/dist/tools/builtins/skill.js +120 -0
- package/dist/tools/builtins/skill.js.map +1 -0
- package/dist/tools/builtins/web-guidance.d.ts +31 -0
- package/dist/tools/builtins/web-guidance.d.ts.map +1 -0
- package/dist/tools/builtins/web-guidance.js +42 -0
- package/dist/tools/builtins/web-guidance.js.map +1 -0
- package/dist/tools/builtins/web.d.ts +10 -0
- package/dist/tools/builtins/web.d.ts.map +1 -0
- package/dist/tools/builtins/web.js +137 -0
- package/dist/tools/builtins/web.js.map +1 -0
- package/dist/tools/builtins/write-file.d.ts.map +1 -1
- package/dist/tools/builtins/write-file.js +35 -0
- package/dist/tools/builtins/write-file.js.map +1 -1
- package/dist/tools/coordinator/agent.d.ts +2 -2
- package/dist/tools/coordinator/agent.d.ts.map +1 -1
- package/dist/tools/coordinator/index.d.ts +13 -4
- package/dist/tools/coordinator/index.d.ts.map +1 -1
- package/dist/tools/coordinator/index.js +125 -38
- package/dist/tools/coordinator/index.js.map +1 -1
- package/dist/tools/coordinator/outcome.d.ts +2 -2
- package/dist/tools/coordinator/outcome.d.ts.map +1 -1
- package/dist/tools/coordinator/outcome.js +1 -1
- package/dist/tools/coordinator/wait-with-idle-bound.d.ts +3 -3
- package/dist/tools/coordinator/wait-with-idle-bound.d.ts.map +1 -1
- package/dist/tools/coordinator/wait-with-idle-bound.js.map +1 -1
- package/dist/tools/defineTool.d.ts +12 -0
- package/dist/tools/defineTool.d.ts.map +1 -1
- package/dist/tools/defineTool.js +2 -0
- package/dist/tools/defineTool.js.map +1 -1
- package/dist/tools/env-scrub.d.ts +66 -0
- package/dist/tools/env-scrub.d.ts.map +1 -0
- package/dist/tools/env-scrub.js +68 -0
- package/dist/tools/env-scrub.js.map +1 -0
- package/dist/tools/memory/read.d.ts.map +1 -1
- package/dist/tools/memory/read.js +5 -1
- package/dist/tools/memory/read.js.map +1 -1
- package/dist/tools/task/create.d.ts.map +1 -1
- package/dist/tools/task/create.js +2 -1
- package/dist/tools/task/create.js.map +1 -1
- package/dist/tools/task/update.d.ts.map +1 -1
- package/dist/tools/task/update.js +7 -3
- package/dist/tools/task/update.js.map +1 -1
- package/dist/types/acp/index.d.ts +161 -0
- package/dist/types/acp/index.d.ts.map +1 -0
- package/dist/types/acp/index.js +2 -0
- package/dist/types/acp/index.js.map +1 -0
- package/dist/types/agent/base.d.ts +62 -5
- package/dist/types/agent/base.d.ts.map +1 -1
- package/dist/types/agent/delegate.d.ts +102 -0
- package/dist/types/agent/delegate.d.ts.map +1 -0
- package/dist/types/agent/delegate.js +2 -0
- package/dist/types/agent/delegate.js.map +1 -0
- package/dist/types/agent/index.d.ts +1 -1
- package/dist/types/agent/index.d.ts.map +1 -1
- package/dist/types/agent/index.js +1 -1
- package/dist/types/agent/index.js.map +1 -1
- package/dist/types/agent/manager.d.ts +7 -1
- package/dist/types/agent/manager.d.ts.map +1 -1
- package/dist/types/agent/reactive.d.ts +24 -3
- package/dist/types/agent/reactive.d.ts.map +1 -1
- package/dist/types/agent/{gateway.d.ts → scheduler.d.ts} +41 -5
- package/dist/types/agent/scheduler.d.ts.map +1 -0
- package/dist/types/agent/scheduler.js +2 -0
- package/dist/types/agent/scheduler.js.map +1 -0
- package/dist/types/agent/supervisor.d.ts +23 -5
- package/dist/types/agent/supervisor.d.ts.map +1 -1
- package/dist/types/agent/task.d.ts +31 -9
- package/dist/types/agent/task.d.ts.map +1 -1
- package/dist/types/agent/working-memory.d.ts +1 -1
- package/dist/types/authorization/index.d.ts +634 -0
- package/dist/types/authorization/index.d.ts.map +1 -0
- package/dist/types/authorization/index.js +103 -0
- package/dist/types/authorization/index.js.map +1 -0
- package/dist/types/bus/index.d.ts +24 -1
- package/dist/types/bus/index.d.ts.map +1 -1
- package/dist/types/code-navigation/index.d.ts +112 -0
- package/dist/types/code-navigation/index.d.ts.map +1 -0
- package/dist/types/code-navigation/index.js +17 -0
- package/dist/types/code-navigation/index.js.map +1 -0
- package/dist/types/command/index.d.ts +74 -0
- package/dist/types/command/index.d.ts.map +1 -0
- package/dist/types/command/index.js +18 -0
- package/dist/types/command/index.js.map +1 -0
- package/dist/types/common/index.d.ts +19 -2
- package/dist/types/common/index.d.ts.map +1 -1
- package/dist/types/common/index.js.map +1 -1
- package/dist/types/connector/mcp.d.ts +8 -0
- package/dist/types/connector/mcp.d.ts.map +1 -1
- package/dist/types/guardrail/index.d.ts +1 -1
- package/dist/types/hitl/policy.d.ts +79 -0
- package/dist/types/hitl/policy.d.ts.map +1 -0
- package/dist/types/hitl/policy.js +2 -0
- package/dist/types/hitl/policy.js.map +1 -0
- package/dist/types/ids/brand.d.ts +55 -0
- package/dist/types/ids/brand.d.ts.map +1 -0
- package/dist/types/ids/brand.js +45 -0
- package/dist/types/ids/brand.js.map +1 -0
- package/dist/types/ids/index.d.ts +98 -39
- package/dist/types/ids/index.d.ts.map +1 -1
- package/dist/types/ids/index.js +5 -1
- package/dist/types/ids/index.js.map +1 -1
- package/dist/types/message/index.d.ts +24 -1
- package/dist/types/message/index.d.ts.map +1 -1
- package/dist/types/message/index.js.map +1 -1
- package/dist/types/plugin/index.d.ts +2 -2
- package/dist/types/project/entity.d.ts +22 -2
- package/dist/types/project/entity.d.ts.map +1 -1
- package/dist/types/provider/interface.d.ts +43 -2
- package/dist/types/provider/interface.d.ts.map +1 -1
- package/dist/types/provider/model.d.ts +16 -2
- package/dist/types/provider/model.d.ts.map +1 -1
- package/dist/types/run/audit.d.ts +150 -0
- package/dist/types/run/audit.d.ts.map +1 -0
- package/dist/types/run/audit.js +39 -0
- package/dist/types/run/audit.js.map +1 -0
- package/dist/types/run/cancel-cause.d.ts +49 -0
- package/dist/types/run/cancel-cause.d.ts.map +1 -0
- package/dist/types/run/cancel-cause.js +39 -0
- package/dist/types/run/cancel-cause.js.map +1 -0
- package/dist/types/run/checkpoint-store.d.ts +29 -11
- package/dist/types/run/checkpoint-store.d.ts.map +1 -1
- package/dist/types/run/config.d.ts +24 -4
- package/dist/types/run/config.d.ts.map +1 -1
- package/dist/types/run/derive-status.d.ts +3 -3
- package/dist/types/run/derive-status.d.ts.map +1 -1
- package/dist/types/run/derive-status.js +1 -1
- package/dist/types/run/entity.d.ts +2 -3
- package/dist/types/run/entity.d.ts.map +1 -1
- package/dist/types/run/event-cursor.d.ts +3 -3
- package/dist/types/run/event-cursor.d.ts.map +1 -1
- package/dist/types/run/events.d.ts +159 -4
- package/dist/types/run/events.d.ts.map +1 -1
- package/dist/types/run/events.js.map +1 -1
- package/dist/types/run/index.d.ts +2 -0
- package/dist/types/run/index.d.ts.map +1 -1
- package/dist/types/run/index.js +2 -0
- package/dist/types/run/index.js.map +1 -1
- package/dist/types/run/metadata.d.ts +2 -2
- package/dist/types/run/metadata.d.ts.map +1 -1
- package/dist/types/run/prepare-step.d.ts +29 -0
- package/dist/types/run/prepare-step.d.ts.map +1 -1
- package/dist/types/run/state.d.ts +33 -10
- package/dist/types/run/state.d.ts.map +1 -1
- package/dist/types/run/state.js +60 -3
- package/dist/types/run/state.js.map +1 -1
- package/dist/types/run/stop-reason.d.ts +9 -0
- package/dist/types/run/stop-reason.d.ts.map +1 -1
- package/dist/types/run/store.d.ts +38 -0
- package/dist/types/run/store.d.ts.map +1 -1
- package/dist/types/sandbox/index.d.ts +38 -0
- package/dist/types/sandbox/index.d.ts.map +1 -1
- package/dist/types/sandbox/index.js +21 -0
- package/dist/types/sandbox/index.js.map +1 -1
- package/dist/types/session/actor.d.ts +2 -2
- package/dist/types/session/actor.d.ts.map +1 -1
- package/dist/types/session/entity.d.ts +9 -7
- package/dist/types/session/entity.d.ts.map +1 -1
- package/dist/types/session/ids.d.ts +3 -1
- package/dist/types/session/ids.d.ts.map +1 -1
- package/dist/types/session/index.d.ts +4 -2
- package/dist/types/session/index.d.ts.map +1 -1
- package/dist/types/session/store.d.ts +51 -22
- package/dist/types/session/store.d.ts.map +1 -1
- package/dist/types/session/sub-session.d.ts +55 -5
- package/dist/types/session/sub-session.d.ts.map +1 -1
- package/dist/types/skills/index.d.ts +41 -0
- package/dist/types/skills/index.d.ts.map +1 -1
- package/dist/types/skills/index.js +17 -1
- package/dist/types/skills/index.js.map +1 -1
- package/dist/types/tool/index.d.ts +175 -1
- package/dist/types/tool/index.d.ts.map +1 -1
- package/dist/types/tool/index.js.map +1 -1
- package/dist/types/tool/presentation.d.ts +53 -0
- package/dist/types/tool/presentation.d.ts.map +1 -0
- package/dist/types/tool/presentation.js +2 -0
- package/dist/types/tool/presentation.js.map +1 -0
- package/dist/types/{thread → topic}/entity.d.ts +34 -26
- package/dist/types/topic/entity.d.ts.map +1 -0
- package/dist/types/{thread → topic}/entity.js.map +1 -1
- package/dist/types/topic/index.d.ts +5 -0
- package/dist/types/topic/index.d.ts.map +1 -0
- package/dist/types/topic/index.js +11 -0
- package/dist/types/topic/index.js.map +1 -0
- package/dist/types/topic/objective.d.ts +86 -0
- package/dist/types/topic/objective.d.ts.map +1 -0
- package/dist/types/topic/objective.js +10 -0
- package/dist/types/topic/objective.js.map +1 -0
- package/dist/types/topic/state.d.ts +56 -0
- package/dist/types/topic/state.d.ts.map +1 -0
- package/dist/types/topic/state.js +10 -0
- package/dist/types/topic/state.js.map +1 -0
- package/dist/types/topic/store.d.ts +95 -0
- package/dist/types/topic/store.d.ts.map +1 -0
- package/dist/types/topic/store.js +29 -0
- package/dist/types/topic/store.js.map +1 -0
- package/dist/types/workspace/ref.d.ts +7 -0
- package/dist/types/workspace/ref.d.ts.map +1 -1
- package/dist/utils/abort.d.ts.map +1 -1
- package/dist/utils/abort.js +13 -1
- package/dist/utils/abort.js.map +1 -1
- package/dist/utils/hash.d.ts +10 -0
- package/dist/utils/hash.d.ts.map +1 -1
- package/dist/utils/hash.js +15 -0
- package/dist/utils/hash.js.map +1 -1
- package/dist/utils/id.d.ts +90 -2
- package/dist/utils/id.d.ts.map +1 -1
- package/dist/utils/id.js +113 -5
- package/dist/utils/id.js.map +1 -1
- package/dist/utils/log/attributes.d.ts +17 -0
- package/dist/utils/log/attributes.d.ts.map +1 -0
- package/dist/utils/log/attributes.js +2 -0
- package/dist/utils/log/attributes.js.map +1 -0
- package/dist/utils/log/caps.d.ts +27 -0
- package/dist/utils/log/caps.d.ts.map +1 -0
- package/dist/utils/log/caps.js +107 -0
- package/dist/utils/log/caps.js.map +1 -0
- package/dist/utils/log/create-logger.d.ts +28 -0
- package/dist/utils/log/create-logger.d.ts.map +1 -0
- package/dist/utils/log/create-logger.js +168 -0
- package/dist/utils/log/create-logger.js.map +1 -0
- package/dist/utils/log/exception.d.ts +11 -0
- package/dist/utils/log/exception.d.ts.map +1 -0
- package/dist/utils/log/exception.js +108 -0
- package/dist/utils/log/exception.js.map +1 -0
- package/dist/utils/log/index.d.ts +7 -0
- package/dist/utils/log/index.d.ts.map +1 -0
- package/dist/utils/log/index.js +15 -0
- package/dist/utils/log/index.js.map +1 -0
- package/dist/utils/log/process-sink.d.ts +28 -0
- package/dist/utils/log/process-sink.d.ts.map +1 -0
- package/dist/utils/log/process-sink.js +56 -0
- package/dist/utils/log/process-sink.js.map +1 -0
- package/dist/utils/log/redact.d.ts +3 -0
- package/dist/utils/log/redact.d.ts.map +1 -0
- package/dist/utils/log/redact.js +71 -0
- package/dist/utils/log/redact.js.map +1 -0
- package/dist/utils/log/sinks.d.ts +43 -0
- package/dist/utils/log/sinks.d.ts.map +1 -0
- package/dist/utils/log/sinks.js +184 -0
- package/dist/utils/log/sinks.js.map +1 -0
- package/dist/utils/log/templates.d.ts +63 -0
- package/dist/utils/log/templates.d.ts.map +1 -0
- package/dist/utils/log/templates.js +119 -0
- package/dist/utils/log/templates.js.map +1 -0
- package/dist/utils/log/types.d.ts +183 -0
- package/dist/utils/log/types.d.ts.map +1 -0
- package/dist/utils/log/types.js +55 -0
- package/dist/utils/log/types.js.map +1 -0
- package/dist/utils/logger.d.ts +44 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +102 -2
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/renamed-field.d.ts +19 -0
- package/dist/utils/renamed-field.d.ts.map +1 -0
- package/dist/utils/renamed-field.js +29 -0
- package/dist/utils/renamed-field.js.map +1 -0
- package/dist/vault/CredentialProvider.d.ts +89 -0
- package/dist/vault/CredentialProvider.d.ts.map +1 -0
- package/dist/vault/CredentialProvider.js +64 -0
- package/dist/vault/CredentialProvider.js.map +1 -0
- package/dist/vault/InMemoryCredentialVault.d.ts +2 -1
- package/dist/vault/InMemoryCredentialVault.d.ts.map +1 -1
- package/dist/vault/InMemoryCredentialVault.js +15 -5
- package/dist/vault/InMemoryCredentialVault.js.map +1 -1
- package/dist/vault/index.d.ts +3 -0
- package/dist/vault/index.d.ts.map +1 -1
- package/dist/vault/index.js +5 -0
- package/dist/vault/index.js.map +1 -1
- package/dist/vault/instrumentation.d.ts +18 -2
- package/dist/vault/instrumentation.d.ts.map +1 -1
- package/dist/vault/instrumentation.js +47 -0
- package/dist/vault/instrumentation.js.map +1 -1
- package/package.json +4 -4
- package/src/advisory/executor.ts +14 -12
- package/src/advisory/registry.ts +2 -2
- package/src/agents/AGENTS.md +91 -0
- package/src/agents/AbstractAgent.ts +67 -14
- package/src/agents/PipelineAgent.ts +46 -12
- package/src/agents/ReactiveAgent.ts +27 -13
- package/src/agents/RouterAgent.ts +33 -21
- package/src/agents/SupervisorAgent.ts +51 -26
- package/src/agents/handle.ts +149 -0
- package/src/agents/runAgent.ts +14 -7
- package/src/{verification → authorization}/gate.ts +39 -32
- package/src/authorization/index.ts +26 -0
- package/src/authorization/permission-presets.ts +215 -0
- package/src/{verification → authorization}/presets.ts +15 -3
- package/src/{verification → authorization}/rules.ts +16 -3
- package/src/bridge/a2a/client.ts +369 -0
- package/src/bridge/a2a/mapper.ts +17 -0
- package/src/bridge/acp/filesystem.ts +63 -0
- package/src/bridge/acp/index.ts +11 -0
- package/src/bridge/acp/permission.ts +71 -0
- package/src/bridge/acp/server.ts +500 -0
- package/src/bridge/acp/update.ts +109 -0
- package/src/bridge/mcp/connector/adapter.ts +8 -4
- package/src/bridge/sse/mapper.ts +30 -0
- package/src/bus/breaker.ts +15 -10
- package/src/bus/index.ts +10 -8
- package/src/bus/lock.ts +36 -19
- package/src/bus/ownership.ts +17 -9
- package/src/compaction/context-window.ts +23 -1
- package/src/compaction/index.ts +6 -0
- package/src/compaction/manual.ts +177 -0
- package/src/compaction/plan.ts +226 -0
- package/src/compaction/summary.ts +31 -0
- package/src/compaction/verifier.ts +2 -2
- package/src/config/registry.ts +208 -0
- package/src/config/runtime.ts +27 -0
- package/src/connector/BaseConnector.ts +8 -3
- package/src/connector/builtins/http.ts +12 -2
- package/src/connector/builtins/webhook.ts +6 -2
- package/src/connector/index.ts +45 -29
- package/src/connector/mcp/client.ts +32 -20
- package/src/connector/mcp/discovery.ts +31 -20
- package/src/connector/mcp/http-sse.ts +12 -6
- package/src/connector/mcp/index.ts +8 -7
- package/src/connector/mcp/reconnect.ts +194 -0
- package/src/connector/mcp/server/index.ts +32 -0
- package/src/connector/mcp/{server-stdio.ts → server/server-stdio.ts} +5 -4
- package/src/connector/mcp/{server.ts → server/server.ts} +17 -11
- package/src/connector/mcp/stdio.ts +18 -9
- package/src/connector/mcp/streamable-http.ts +8 -4
- package/src/{bridge/tools/connector → connector/tools}/adapter.ts +5 -5
- package/src/{bridge/tools/connector → connector/tools}/definitions.ts +4 -4
- package/src/{bridge/tools/connector → connector/tools}/router.ts +17 -9
- package/src/connector/web/guarded-fetch.ts +288 -0
- package/src/connector/web/index.ts +17 -0
- package/src/connector/web/types.ts +99 -0
- package/src/constants/acp/index.ts +104 -0
- package/src/constants/credential-env-keys.ts +63 -0
- package/src/constants/index.ts +3 -1
- package/src/constants/secret-patterns.ts +102 -0
- package/src/constants/telemetry/index.ts +98 -0
- package/src/contracts/api.ts +11 -0
- package/src/deprecated-aliases.ts +86 -0
- package/src/eval/judge.ts +2 -2
- package/src/execution/base.ts +18 -7
- package/src/execution/code-runtime/types.ts +116 -0
- package/src/execution/code-runtime/worker.ts +266 -0
- package/src/{connector/execution → execution}/factory.ts +3 -3
- package/src/{connector/execution → execution}/hybrid.ts +13 -7
- package/src/execution/index.ts +24 -0
- package/src/execution/local.ts +4 -2
- package/src/{connector/execution → execution}/remote.ts +15 -8
- package/src/index.ts +17 -0
- package/src/invariants/index.ts +201 -0
- package/src/manager/agent/lifecycle.ts +172 -58
- package/src/manager/connector/environment.ts +22 -11
- package/src/manager/connector/lifecycle.ts +30 -11
- package/src/manager/connector/tenant.ts +33 -14
- package/src/manager/index.ts +16 -2
- package/src/manager/project/lifecycle.ts +1 -1
- package/src/manager/run/emergency.ts +9 -7
- package/src/manager/run/persistence.ts +110 -8
- package/src/manager/topic/lifecycle.ts +235 -0
- package/src/manager/topic/objective.ts +203 -0
- package/src/persona/assembler.ts +14 -3
- package/src/plugin/lifecycle.ts +156 -20
- package/src/plugin/loader.ts +67 -16
- package/src/probe/index.ts +1 -0
- package/src/probe/registry.ts +41 -5
- package/src/process/kill-tree.ts +52 -0
- package/src/prompt/contributions.ts +173 -0
- package/src/prompt/index.ts +15 -0
- package/src/provider/attribution.ts +57 -0
- package/src/provider/{collect.ts → collect-chat-completion.ts} +4 -2
- package/src/provider/conformance.ts +189 -0
- package/src/provider/errors.ts +27 -12
- package/src/provider/fallback.ts +32 -10
- package/src/provider/idle-timeout.ts +112 -0
- package/src/provider/instrumentation.ts +4 -2
- package/src/provider/retry.ts +63 -21
- package/src/public-runtime.ts +373 -14
- package/src/public-tools.ts +41 -1
- package/src/public-types.ts +101 -4
- package/src/rag/rag-tool.ts +4 -2
- package/src/read-model/index.ts +14 -0
- package/src/read-model/registry.ts +152 -0
- package/src/read-model/run-status.ts +127 -0
- package/src/registry/{Registry.ts → BaseRegistry.ts} +1 -1
- package/src/registry/ManagedRegistry.ts +26 -9
- package/src/registry/command/index-exports.ts +4 -0
- package/src/registry/command/index.ts +105 -0
- package/src/registry/command/kernel-commands.ts +110 -0
- package/src/registry/connector/scoped.ts +6 -5
- package/src/registry/index.ts +7 -1
- package/src/registry/tool/execute.ts +15 -12
- package/src/registry/tool/presentation.ts +116 -0
- package/src/registry/tool/screen.ts +12 -11
- package/src/run/drain.ts +13 -3
- package/src/run/reporter.ts +208 -153
- package/src/run-query/index.ts +108 -0
- package/src/runtime/bidi/session.ts +7 -2
- package/src/runtime/decision/fallback.ts +6 -3
- package/src/runtime/decision/parser.ts +10 -9
- package/src/runtime/jobs/registry.ts +346 -0
- package/src/runtime/query/approval-policy.ts +78 -0
- package/src/runtime/query/checkpoint.ts +6 -6
- package/src/runtime/query/context.ts +120 -30
- package/src/runtime/query/events.ts +19 -11
- package/src/runtime/query/executor.ts +287 -66
- package/src/runtime/query/guardrail-presets.ts +11 -14
- package/src/runtime/query/guardrails.ts +16 -12
- package/src/runtime/query/index.ts +579 -96
- package/src/runtime/query/iteration/index.ts +269 -87
- package/src/runtime/query/iteration/phases/advisory.ts +17 -16
- package/src/runtime/query/iteration/phases/compaction.ts +235 -187
- package/src/runtime/query/iteration/phases/context.ts +82 -21
- package/src/runtime/query/iteration/phases/tool-review.ts +28 -9
- package/src/runtime/query/iteration/phases/working-memory.ts +3 -2
- package/src/runtime/query/iteration/stream-turn.ts +14 -14
- package/src/runtime/query/{context-cache.ts → prompt-cache.ts} +23 -3
- package/src/runtime/query/prompt.ts +104 -4
- package/src/runtime/query/repeat-call.ts +130 -0
- package/src/runtime/query/replay/mutate.ts +6 -0
- package/src/runtime/query/result.ts +47 -10
- package/src/runtime/query/resume-pending.ts +19 -17
- package/src/runtime/query/resume-run.ts +2 -2
- package/src/runtime/query/run-state.ts +5 -5
- package/src/runtime/query/tool-grants.ts +1 -1
- package/src/runtime/query/tool-output-budget.ts +36 -3
- package/src/runtime/query/tool-pause.ts +2 -1
- package/src/runtime/query/tooling.ts +17 -2
- package/src/sandbox/provider/local.ts +94 -21
- package/src/sandbox/terminal.ts +197 -0
- package/src/{gateway → scheduler}/completion-inbox.ts +20 -10
- package/src/scheduler/delegating.ts +297 -0
- package/src/{gateway → scheduler}/local.ts +24 -15
- package/src/session/actor-scope.ts +121 -0
- package/src/session/errors.ts +30 -8
- package/src/session/handoff/assignment.ts +5 -5
- package/src/session/handoff/broadcast.ts +9 -9
- package/src/session/handoff/single.ts +8 -8
- package/src/session/migration/filesystem.ts +46 -2
- package/src/session/migration/id-prefix.ts +60 -22
- package/src/session/migration/index.ts +5 -0
- package/src/session/migration/marker.ts +19 -4
- package/src/session/retention/archive.ts +32 -12
- package/src/session/workspace/git-worktree.ts +17 -8
- package/src/skills/loader.ts +39 -9
- package/src/skills/registry.ts +177 -20
- package/src/store/attachment/index.ts +182 -0
- package/src/store/config/index.ts +74 -0
- package/src/store/feedback/conformance.ts +193 -0
- package/src/store/feedback/disk.ts +184 -0
- package/src/store/feedback/index.ts +13 -0
- package/src/store/feedback/memory.ts +0 -0
- package/src/store/feedback/types.ts +107 -0
- package/src/store/index.ts +5 -0
- package/src/store/kv/record-store.ts +91 -0
- package/src/store/memory/disk.ts +35 -32
- package/src/store/run/checkpoint-disk.ts +27 -6
- package/src/store/run/checkpoint-memory.ts +8 -8
- package/src/store/run/claim-disk.ts +58 -13
- package/src/store/run/conformance.ts +11 -10
- package/src/store/run/disk.ts +77 -5
- package/src/store/run/listing.ts +6 -6
- package/src/store/run/memory.ts +24 -1
- package/src/store/session/canonical-path.ts +45 -0
- package/src/store/session/disk.ts +216 -191
- package/src/store/session/memory.ts +43 -5
- package/src/store/task/disk.ts +77 -67
- package/src/store/topic/index.ts +33 -0
- package/src/store/topic/memory.ts +111 -0
- package/src/store/topic/objective.ts +290 -0
- package/src/store/topic/state.ts +204 -0
- package/src/streaming/coalesce.ts +19 -5
- package/src/telemetry/runtime-accessors.ts +45 -1
- package/src/test-support/ids.ts +117 -0
- package/src/testing.ts +40 -0
- package/src/tools/builtins/bash.ts +82 -3
- package/src/tools/builtins/edit.ts +36 -0
- package/src/tools/builtins/index.ts +29 -1
- package/src/tools/builtins/job.ts +133 -0
- package/src/tools/builtins/lsp.ts +214 -0
- package/src/tools/builtins/run-code.ts +154 -0
- package/src/tools/builtins/skill.ts +134 -0
- package/src/tools/builtins/web-guidance.ts +46 -0
- package/src/tools/builtins/web.ts +156 -0
- package/src/tools/builtins/write-file.ts +37 -1
- package/src/tools/coordinator/agent.ts +2 -2
- package/src/tools/coordinator/index.ts +144 -40
- package/src/tools/coordinator/outcome.ts +2 -2
- package/src/tools/coordinator/wait-with-idle-bound.ts +3 -3
- package/src/tools/defineTool.ts +14 -0
- package/src/tools/env-scrub.ts +91 -0
- package/src/tools/memory/read.ts +5 -2
- package/src/tools/task/create.ts +2 -1
- package/src/tools/task/update.ts +7 -4
- package/src/types/acp/index.ts +163 -0
- package/src/types/agent/base.ts +67 -5
- package/src/types/agent/delegate.ts +110 -0
- package/src/types/agent/index.ts +1 -1
- package/src/types/agent/manager.ts +7 -1
- package/src/types/agent/reactive.ts +27 -3
- package/src/types/agent/{gateway.ts → scheduler.ts} +41 -4
- package/src/types/agent/supervisor.ts +26 -5
- package/src/types/agent/task.ts +31 -9
- package/src/types/agent/working-memory.ts +1 -1
- package/src/types/{verification → authorization}/index.ts +79 -10
- package/src/types/bus/index.ts +30 -1
- package/src/types/code-navigation/index.ts +99 -0
- package/src/types/command/index.ts +68 -0
- package/src/types/common/index.ts +26 -2
- package/src/types/connector/mcp.ts +8 -0
- package/src/types/guardrail/index.ts +1 -1
- package/src/types/hitl/policy.ts +83 -0
- package/src/types/ids/brand.ts +58 -0
- package/src/types/ids/index.ts +109 -42
- package/src/types/message/index.ts +25 -1
- package/src/types/project/entity.ts +22 -2
- package/src/types/provider/interface.ts +45 -2
- package/src/types/provider/model.ts +16 -2
- package/src/types/run/audit.ts +164 -0
- package/src/types/run/cancel-cause.ts +60 -0
- package/src/types/run/checkpoint-store.ts +31 -11
- package/src/types/run/config.ts +25 -4
- package/src/types/run/derive-status.ts +3 -3
- package/src/types/run/entity.ts +2 -4
- package/src/types/run/event-cursor.ts +3 -3
- package/src/types/run/events.ts +165 -6
- package/src/types/run/index.ts +2 -0
- package/src/types/run/metadata.ts +2 -2
- package/src/types/run/prepare-step.ts +33 -0
- package/src/types/run/state.ts +78 -11
- package/src/types/run/stop-reason.ts +9 -0
- package/src/types/run/store.ts +40 -0
- package/src/types/sandbox/index.ts +37 -0
- package/src/types/session/actor.ts +10 -2
- package/src/types/session/entity.ts +9 -7
- package/src/types/session/ids.ts +2 -0
- package/src/types/session/index.ts +2 -0
- package/src/types/session/store.ts +53 -22
- package/src/types/session/sub-session.ts +50 -9
- package/src/types/skills/index.ts +50 -0
- package/src/types/tool/index.ts +156 -1
- package/src/types/tool/presentation.ts +48 -0
- package/src/types/{thread → topic}/entity.ts +34 -26
- package/src/types/topic/index.ts +23 -0
- package/src/types/topic/objective.ts +93 -0
- package/src/types/topic/state.ts +60 -0
- package/src/types/topic/store.ts +101 -0
- package/src/types/workspace/ref.ts +7 -0
- package/src/utils/abort.ts +16 -1
- package/src/utils/hash.ts +16 -0
- package/src/utils/id.ts +172 -12
- package/src/utils/log/attributes.ts +47 -0
- package/src/utils/log/caps.ts +118 -0
- package/src/utils/log/create-logger.ts +198 -0
- package/src/utils/log/exception.ts +124 -0
- package/src/utils/log/index.ts +24 -0
- package/src/utils/log/process-sink.ts +76 -0
- package/src/utils/log/redact.ts +77 -0
- package/src/utils/log/sinks.ts +205 -0
- package/src/utils/log/templates.ts +161 -0
- package/src/utils/log/types.ts +195 -0
- package/src/utils/logger.ts +121 -2
- package/src/utils/renamed-field.ts +35 -0
- package/src/vault/CredentialProvider.ts +147 -0
- package/src/vault/InMemoryCredentialVault.ts +16 -5
- package/src/vault/index.ts +16 -0
- package/src/vault/instrumentation.ts +63 -2
- package/dist/bridge/tools/connector/adapter.d.ts.map +0 -1
- package/dist/bridge/tools/connector/adapter.js.map +0 -1
- package/dist/bridge/tools/connector/definitions.d.ts.map +0 -1
- package/dist/bridge/tools/connector/definitions.js.map +0 -1
- package/dist/bridge/tools/connector/index.d.ts.map +0 -1
- package/dist/bridge/tools/connector/index.js.map +0 -1
- package/dist/bridge/tools/connector/router.d.ts.map +0 -1
- package/dist/bridge/tools/connector/router.js.map +0 -1
- package/dist/connector/execution/factory.d.ts.map +0 -1
- package/dist/connector/execution/factory.js.map +0 -1
- package/dist/connector/execution/hybrid.d.ts.map +0 -1
- package/dist/connector/execution/hybrid.js.map +0 -1
- package/dist/connector/execution/index.d.ts +0 -6
- package/dist/connector/execution/index.d.ts.map +0 -1
- package/dist/connector/execution/index.js +0 -4
- package/dist/connector/execution/index.js.map +0 -1
- package/dist/connector/execution/remote.d.ts.map +0 -1
- package/dist/connector/execution/remote.js.map +0 -1
- package/dist/connector/mcp/server-stdio.d.ts.map +0 -1
- package/dist/connector/mcp/server-stdio.js.map +0 -1
- package/dist/connector/mcp/server.d.ts.map +0 -1
- package/dist/connector/mcp/server.js.map +0 -1
- package/dist/constants/verification/index.d.ts.map +0 -1
- package/dist/constants/verification/index.js.map +0 -1
- package/dist/gateway/completion-inbox.d.ts.map +0 -1
- package/dist/gateway/completion-inbox.js.map +0 -1
- package/dist/gateway/local.d.ts.map +0 -1
- package/dist/gateway/local.js.map +0 -1
- package/dist/manager/thread/lifecycle.d.ts +0 -105
- package/dist/manager/thread/lifecycle.d.ts.map +0 -1
- package/dist/manager/thread/lifecycle.js.map +0 -1
- package/dist/provider/collect.d.ts.map +0 -1
- package/dist/provider/collect.js.map +0 -1
- package/dist/registry/Registry.d.ts.map +0 -1
- package/dist/registry/Registry.js.map +0 -1
- package/dist/router/task-router.d.ts.map +0 -1
- package/dist/router/task-router.js.map +0 -1
- package/dist/runtime/query/context-cache.d.ts.map +0 -1
- package/dist/runtime/query/context-cache.js.map +0 -1
- package/dist/store/thread/disk.d.ts +0 -41
- package/dist/store/thread/disk.d.ts.map +0 -1
- package/dist/store/thread/disk.js +0 -238
- package/dist/store/thread/disk.js.map +0 -1
- package/dist/store/thread/index.d.ts +0 -4
- package/dist/store/thread/index.d.ts.map +0 -1
- package/dist/store/thread/index.js +0 -6
- package/dist/store/thread/index.js.map +0 -1
- package/dist/store/thread/memory.d.ts +0 -23
- package/dist/store/thread/memory.d.ts.map +0 -1
- package/dist/store/thread/memory.js +0 -90
- package/dist/store/thread/memory.js.map +0 -1
- package/dist/types/agent/gateway.d.ts.map +0 -1
- package/dist/types/agent/gateway.js +0 -2
- package/dist/types/agent/gateway.js.map +0 -1
- package/dist/types/thread/entity.d.ts.map +0 -1
- package/dist/types/thread/index.d.ts +0 -3
- package/dist/types/thread/index.d.ts.map +0 -1
- package/dist/types/thread/index.js +0 -5
- package/dist/types/thread/index.js.map +0 -1
- package/dist/types/thread/store.d.ts +0 -86
- package/dist/types/thread/store.d.ts.map +0 -1
- package/dist/types/thread/store.js +0 -22
- package/dist/types/thread/store.js.map +0 -1
- package/dist/types/verification/index.d.ts +0 -317
- package/dist/types/verification/index.d.ts.map +0 -1
- package/dist/types/verification/index.js +0 -53
- package/dist/types/verification/index.js.map +0 -1
- package/dist/verification/gate.d.ts.map +0 -1
- package/dist/verification/gate.js.map +0 -1
- package/dist/verification/index.d.ts +0 -4
- package/dist/verification/index.d.ts.map +0 -1
- package/dist/verification/index.js +0 -4
- package/dist/verification/index.js.map +0 -1
- package/dist/verification/presets.d.ts.map +0 -1
- package/dist/verification/presets.js.map +0 -1
- package/dist/verification/rules.d.ts +0 -4
- package/dist/verification/rules.d.ts.map +0 -1
- package/dist/verification/rules.js.map +0 -1
- package/src/connector/execution/index.ts +0 -5
- package/src/manager/thread/lifecycle.ts +0 -217
- package/src/store/thread/disk.ts +0 -272
- package/src/store/thread/index.ts +0 -7
- package/src/store/thread/memory.ts +0 -104
- package/src/types/thread/index.ts +0 -6
- package/src/types/thread/store.ts +0 -92
- package/src/verification/index.ts +0 -3
- /package/dist/{bridge/tools/connector → connector/tools}/index.d.ts +0 -0
- /package/dist/{bridge/tools/connector → connector/tools}/index.js +0 -0
- /package/dist/constants/{verification → authorization}/index.d.ts +0 -0
- /package/dist/constants/{verification → authorization}/index.js +0 -0
- /package/dist/{router → model-router}/task-router.d.ts +0 -0
- /package/dist/{router → model-router}/task-router.js +0 -0
- /package/dist/types/{thread → topic}/entity.js +0 -0
- /package/src/{bridge/tools/connector → connector/tools}/index.ts +0 -0
- /package/src/constants/{verification → authorization}/index.ts +0 -0
- /package/src/{router → model-router}/task-router.ts +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { NamzuError } from '../types/errors/index.js';
|
|
2
|
+
/** A steer aimed at an agent that is not running. */
|
|
3
|
+
export class AgentNotRunningError extends NamzuError {
|
|
4
|
+
constructor() {
|
|
5
|
+
super({
|
|
6
|
+
code: 'invalid_config',
|
|
7
|
+
message: 'steer() needs a run in flight — this agent is idle. Use queueForNextRun() to leave a message for the next one.',
|
|
8
|
+
details: {},
|
|
9
|
+
retryable: false,
|
|
10
|
+
});
|
|
11
|
+
this.name = 'AgentNotRunningError';
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A host's handle on one agent.
|
|
16
|
+
*
|
|
17
|
+
* `status` is a function call rather than a stored boolean, because a
|
|
18
|
+
* stored one is only as current as whoever remembered to update it — and
|
|
19
|
+
* the whole value of this object is answering a question at the moment it
|
|
20
|
+
* is asked.
|
|
21
|
+
*/
|
|
22
|
+
export function createAgentHandle(options) {
|
|
23
|
+
return {
|
|
24
|
+
get status() {
|
|
25
|
+
return options.isRunning() ? 'running' : 'idle';
|
|
26
|
+
},
|
|
27
|
+
steer(text) {
|
|
28
|
+
// Refused, not rerouted. Quietly forwarding to `queueForNextRun`
|
|
29
|
+
// would be a host asking to redirect what is happening now and
|
|
30
|
+
// getting a message delivered minutes later to a different run —
|
|
31
|
+
// which is worse than an error, because nothing says it happened.
|
|
32
|
+
if (!options.isRunning())
|
|
33
|
+
throw new AgentNotRunningError();
|
|
34
|
+
options.steering.steer(text);
|
|
35
|
+
},
|
|
36
|
+
async queueForNextRun(message) {
|
|
37
|
+
if (!options.topicStateStore) {
|
|
38
|
+
throw new NamzuError({
|
|
39
|
+
code: 'invalid_config',
|
|
40
|
+
message: 'queueForNextRun() needs a topic state store; this handle was built without one, so there is nowhere to leave the message.',
|
|
41
|
+
details: { topicId: options.topicId },
|
|
42
|
+
retryable: false,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
await appendQueuedMessage(options.topicStateStore, options.topicId, options.tenantId, message);
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Add a message to the topic's next-run queue, under compare-and-set.
|
|
51
|
+
*
|
|
52
|
+
* Read-modify-write against the record's revision, so two hosts queueing
|
|
53
|
+
* for one conversation cannot silently drop each other's message — the
|
|
54
|
+
* loser gets the store's stale-revision error and can retry with what it
|
|
55
|
+
* now sees.
|
|
56
|
+
*/
|
|
57
|
+
export async function appendQueuedMessage(store, topicId, tenantId, message) {
|
|
58
|
+
const state = await store.getState(topicId, tenantId);
|
|
59
|
+
await store.setQueuedMessages(topicId, tenantId, [...(state?.queuedMessages ?? []), message], {
|
|
60
|
+
revision: state?.revision ?? 0,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Take whatever was queued for this topic, leaving the queue empty.
|
|
65
|
+
*
|
|
66
|
+
* Cleared as it is read, in the same compare-and-set write. A queue that
|
|
67
|
+
* was read and cleared separately would re-deliver on a crash between the
|
|
68
|
+
* two, and "start with this" arriving twice is a different instruction from
|
|
69
|
+
* the one that was left.
|
|
70
|
+
*/
|
|
71
|
+
export async function drainQueuedMessages(store, topicId, tenantId) {
|
|
72
|
+
const state = await store.getState(topicId, tenantId);
|
|
73
|
+
const queued = state?.queuedMessages ?? [];
|
|
74
|
+
if (queued.length === 0)
|
|
75
|
+
return [];
|
|
76
|
+
await store.setQueuedMessages(topicId, tenantId, [], { revision: state?.revision ?? 0 });
|
|
77
|
+
return queued;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=handle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle.js","sourceRoot":"","sources":["../../src/agents/handle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAgCrD,qDAAqD;AACrD,MAAM,OAAO,oBAAqB,SAAQ,UAAU;IACnD;QACC,KAAK,CAAC;YACL,IAAI,EAAE,gBAAgB;YACtB,OAAO,EACN,gHAAgH;YACjH,OAAO,EAAE,EAAE;YACX,SAAS,EAAE,KAAK;SAChB,CAAC,CAAA;QACF,IAAI,CAAC,IAAI,GAAG,sBAAsB,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AC7F,QAAQ,EAAE,KAAK,EAAE,QAAQ,IAAI,CAAC;KAC9B,CAAC,CAAA;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACxC,KAAsB,EACtB,OAAgB,EAChB,QAAkB;IAElB,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IACrD,MAAM,MAAM,GAAG,KAAK,EAAE,cAAc,IAAI,EAAE,CAAA;IAC1C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IAClC,MAAM,KAAK,CAAC,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,IAAI,CAAC,EAAE,CAAC,CAAA;IACxF,OAAO,MAAM,CAAA;AACd,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AuthorizationGateConfig } from '../types/authorization/index.js';
|
|
2
|
+
import type { ProjectId, SessionId, TenantId, TopicId } from '../types/ids/index.js';
|
|
2
3
|
import type { Message } from '../types/message/index.js';
|
|
3
4
|
import type { LLMProvider, ReasoningEffort, ThinkingConfig } from '../types/provider/index.js';
|
|
4
5
|
import type { Run, RunEventListener } from '../types/run/index.js';
|
|
5
6
|
import type { Skill } from '../types/skills/index.js';
|
|
6
7
|
import type { StructuredOutputConfig } from '../types/structured-output/index.js';
|
|
7
8
|
import type { ToolRegistryContract } from '../types/tool/index.js';
|
|
8
|
-
import type { VerificationGateConfig } from '../types/verification/index.js';
|
|
9
9
|
/**
|
|
10
10
|
* The session a run belongs to.
|
|
11
11
|
*
|
|
@@ -26,7 +26,7 @@ import type { VerificationGateConfig } from '../types/verification/index.js';
|
|
|
26
26
|
*/
|
|
27
27
|
export interface AgentIdentity {
|
|
28
28
|
sessionId?: SessionId;
|
|
29
|
-
|
|
29
|
+
topicId?: TopicId;
|
|
30
30
|
projectId?: ProjectId;
|
|
31
31
|
tenantId?: TenantId;
|
|
32
32
|
}
|
|
@@ -63,11 +63,16 @@ export interface RunAgentOptions extends AgentIdentity {
|
|
|
63
63
|
*
|
|
64
64
|
* Absent means every tool runs unreviewed, which is the right default for a
|
|
65
65
|
* library front door and the wrong one for a host that hands this an agent
|
|
66
|
-
* directory it did not write. The kernel builds a `
|
|
66
|
+
* directory it did not write. The kernel builds a `AuthorizationGate` from
|
|
67
67
|
* this and consults it on every call; without it there is nothing to
|
|
68
68
|
* consult, so a front-door run is strictly less mediated than a kernel one.
|
|
69
69
|
*/
|
|
70
|
-
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated Renamed to `authorizationGate`. Removed in the next major.
|
|
72
|
+
* Setting both to different configs throws.
|
|
73
|
+
*/
|
|
74
|
+
verificationGate?: AuthorizationGateConfig;
|
|
75
|
+
authorizationGate?: AuthorizationGateConfig;
|
|
71
76
|
/** Defaults to the current working directory. */
|
|
72
77
|
workingDirectory?: string;
|
|
73
78
|
maxIterations?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runAgent.d.ts","sourceRoot":"","sources":["../../src/agents/runAgent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"runAgent.d.ts","sourceRoot":"","sources":["../../src/agents/runAgent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACpF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC9F,OAAO,KAAK,EA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,MAAM,CAAC,EAAE,eAAe,CAAA;IAExB,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,QAAQ,CAAC,EAAE,gBAAgB,CAAA;CAC3B;AAED,MAAM,WAAW,cAAc;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAEnC;;;;;;;OAOG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAEnC,qEAAqE;IACrE,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAA;IAEjB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAA;CAC1C;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAA;AACxC,eAAO,MAAM,oBAAoB,SAAU,CAAA;AAC3C,eAAO,MAAM,kBAAkB,SAAU,CAAA;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CA+ChF"}
|
package/dist/agents/runAgent.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ToolRegistry } from '../registry/tool/execute.js';
|
|
2
2
|
import { drainQuery } from '../runtime/query/index.js';
|
|
3
|
-
import { generateProjectId, generateSessionId, generateTenantId,
|
|
3
|
+
import { generateProjectId, generateSessionId, generateTenantId, generateTopicId, } from '../utils/id.js';
|
|
4
4
|
/**
|
|
5
5
|
* Defaults chosen to be safe rather than generous.
|
|
6
6
|
*
|
|
@@ -57,7 +57,7 @@ export const DEFAULT_TIMEOUT_MS = 300_000;
|
|
|
57
57
|
export async function runAgent(options) {
|
|
58
58
|
const identity = {
|
|
59
59
|
sessionId: options.sessionId ?? generateSessionId(),
|
|
60
|
-
|
|
60
|
+
topicId: options.topicId ?? generateTopicId(),
|
|
61
61
|
projectId: options.projectId ?? generateProjectId(),
|
|
62
62
|
tenantId: options.tenantId ?? generateTenantId(),
|
|
63
63
|
};
|
|
@@ -89,6 +89,7 @@ export async function runAgent(options) {
|
|
|
89
89
|
...(options.signal ? { signal: options.signal } : {}),
|
|
90
90
|
...(options.skills ? { skills: options.skills } : {}),
|
|
91
91
|
...(options.verificationGate ? { verificationGate: options.verificationGate } : {}),
|
|
92
|
+
...(options.authorizationGate ? { authorizationGate: options.authorizationGate } : {}),
|
|
92
93
|
...(options.structuredOutput ? { structuredOutput: options.structuredOutput } : {}),
|
|
93
94
|
...identity,
|
|
94
95
|
}, options.listener);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runAgent.js","sourceRoot":"","sources":["../../src/agents/runAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAStD,OAAO,EACN,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,
|
|
1
|
+
{"version":3,"file":"runAgent.js","sourceRoot":"","sources":["../../src/agents/runAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAStD,OAAO,EACN,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,GACf,MAAM,gBAAgB,CAAA;AAoJvB;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAA;AACxC,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAO,CAAA;AAC3C,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAA;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ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G,EAAE,QAAQ,EAAE,CAAA;AACrF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { AuthorizationGateConfig, AuthorizationRule, GateEvaluationResult } from '../types/authorization/index.js';
|
|
1
2
|
import type { ToolDefinition } from '../types/tool/index.js';
|
|
2
|
-
import type { GateEvaluationResult, VerificationGateConfig, VerificationRule } from '../types/verification/index.js';
|
|
3
3
|
import type { Logger } from '../utils/logger.js';
|
|
4
4
|
export interface ToolCallContext {
|
|
5
5
|
readonly toolName: string;
|
|
@@ -21,15 +21,15 @@ export interface ToolCallContext {
|
|
|
21
21
|
* cannot be reasoned about produces thrashing; one that can produces a route
|
|
22
22
|
* around it.
|
|
23
23
|
*/
|
|
24
|
-
export declare function describeRule(rule:
|
|
25
|
-
export declare class
|
|
24
|
+
export declare function describeRule(rule: AuthorizationRule): string;
|
|
25
|
+
export declare class AuthorizationGate {
|
|
26
26
|
private readonly rules;
|
|
27
27
|
private readonly compiledPatterns;
|
|
28
28
|
private readonly nameSets;
|
|
29
29
|
private readonly log;
|
|
30
30
|
private readonly logDecisions;
|
|
31
31
|
private readonly enabled;
|
|
32
|
-
constructor(config:
|
|
32
|
+
constructor(config: AuthorizationGateConfig, log: Logger);
|
|
33
33
|
evaluate(ctx: ToolCallContext): GateEvaluationResult;
|
|
34
34
|
}
|
|
35
35
|
//# sourceMappingURL=gate.d.ts.map
|
|
@@ -0,0 +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;AAGhD,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;CAC5C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAgC5D;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;CAwDpD"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { MAX_CUSTOM_PATTERN_LENGTH } from '../constants/
|
|
2
|
-
import {
|
|
1
|
+
import { MAX_CUSTOM_PATTERN_LENGTH } from '../constants/authorization/index.js';
|
|
2
|
+
import { GENAI } from '../constants/telemetry/index.js';
|
|
3
|
+
import { AuthorizationGateConfigSchema } from '../types/authorization/index.js';
|
|
4
|
+
import { SCOPE_ATTRIBUTE } from '../utils/log/types.js';
|
|
3
5
|
import { evaluateRule } from './rules.js';
|
|
4
6
|
/**
|
|
5
7
|
* What the rule actually said, in words a model can act on.
|
|
@@ -48,7 +50,7 @@ export function describeRule(rule) {
|
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
|
-
export class
|
|
53
|
+
export class AuthorizationGate {
|
|
52
54
|
rules;
|
|
53
55
|
compiledPatterns;
|
|
54
56
|
nameSets;
|
|
@@ -56,8 +58,8 @@ export class VerificationGate {
|
|
|
56
58
|
logDecisions;
|
|
57
59
|
enabled;
|
|
58
60
|
constructor(config, log) {
|
|
59
|
-
const parsed =
|
|
60
|
-
this.log = log.child({
|
|
61
|
+
const parsed = AuthorizationGateConfigSchema.parse(config);
|
|
62
|
+
this.log = log.child({ [SCOPE_ATTRIBUTE]: 'authorization/gate' });
|
|
61
63
|
this.logDecisions = parsed.logDecisions;
|
|
62
64
|
this.enabled = parsed.enabled;
|
|
63
65
|
const expandedRules = [];
|
|
@@ -82,7 +84,12 @@ export class VerificationGate {
|
|
|
82
84
|
}
|
|
83
85
|
expandedRules.push(...parsed.rules);
|
|
84
86
|
if (parsed.allowReadOnlyTools) {
|
|
85
|
-
expandedRules.push({
|
|
87
|
+
expandedRules.push({
|
|
88
|
+
type: 'allow_read_only',
|
|
89
|
+
...(parsed.allowReadOnlyExcludeCategories
|
|
90
|
+
? { excludeCategories: parsed.allowReadOnlyExcludeCategories }
|
|
91
|
+
: {}),
|
|
92
|
+
});
|
|
86
93
|
}
|
|
87
94
|
this.rules = expandedRules;
|
|
88
95
|
this.compiledPatterns = new Map();
|
|
@@ -94,9 +101,9 @@ export class VerificationGate {
|
|
|
94
101
|
if (rule.type === 'custom_pattern') {
|
|
95
102
|
if (rule.pattern.length > MAX_CUSTOM_PATTERN_LENGTH) {
|
|
96
103
|
this.log.warn('Custom pattern exceeds max length, skipping', {
|
|
97
|
-
index: i,
|
|
98
|
-
length: rule.pattern.length,
|
|
99
|
-
|
|
104
|
+
'namzu.authorization.index': i,
|
|
105
|
+
'namzu.authorization.length': rule.pattern.length,
|
|
106
|
+
'namzu.authorization.max_length': MAX_CUSTOM_PATTERN_LENGTH,
|
|
100
107
|
});
|
|
101
108
|
continue;
|
|
102
109
|
}
|
|
@@ -105,9 +112,9 @@ export class VerificationGate {
|
|
|
105
112
|
}
|
|
106
113
|
catch (err) {
|
|
107
114
|
this.log.warn('Invalid custom pattern regex, skipping', {
|
|
108
|
-
index: i,
|
|
109
|
-
pattern: rule.pattern,
|
|
110
|
-
|
|
115
|
+
'namzu.authorization.index': i,
|
|
116
|
+
'namzu.authorization.pattern': rule.pattern,
|
|
117
|
+
'exception.message': err instanceof Error ? err.message : String(err),
|
|
111
118
|
});
|
|
112
119
|
}
|
|
113
120
|
}
|
|
@@ -129,9 +136,9 @@ export class VerificationGate {
|
|
|
129
136
|
// it.
|
|
130
137
|
if (rule.pattern.length > MAX_CUSTOM_PATTERN_LENGTH) {
|
|
131
138
|
this.log.warn('Argument pattern exceeds max length, skipping', {
|
|
132
|
-
index: i,
|
|
133
|
-
length: rule.pattern.length,
|
|
134
|
-
|
|
139
|
+
'namzu.authorization.index': i,
|
|
140
|
+
'namzu.authorization.length': rule.pattern.length,
|
|
141
|
+
'namzu.authorization.max_length': MAX_CUSTOM_PATTERN_LENGTH,
|
|
135
142
|
});
|
|
136
143
|
continue;
|
|
137
144
|
}
|
|
@@ -142,9 +149,9 @@ export class VerificationGate {
|
|
|
142
149
|
}
|
|
143
150
|
catch (err) {
|
|
144
151
|
this.log.warn('Invalid argument pattern regex, skipping', {
|
|
145
|
-
index: i,
|
|
146
|
-
pattern: rule.pattern,
|
|
147
|
-
|
|
152
|
+
'namzu.authorization.index': i,
|
|
153
|
+
'namzu.authorization.pattern': rule.pattern,
|
|
154
|
+
'exception.message': err instanceof Error ? err.message : String(err),
|
|
148
155
|
});
|
|
149
156
|
}
|
|
150
157
|
}
|
|
@@ -177,10 +184,10 @@ export class VerificationGate {
|
|
|
177
184
|
};
|
|
178
185
|
if (this.logDecisions) {
|
|
179
186
|
this.log.debug('Gate decision', {
|
|
180
|
-
|
|
181
|
-
decision,
|
|
182
|
-
|
|
183
|
-
|
|
187
|
+
[GENAI.TOOL_NAME]: ctx.toolName,
|
|
188
|
+
'namzu.authorization.decision': decision,
|
|
189
|
+
'namzu.authorization.rule_type': rule.type,
|
|
190
|
+
'namzu.authorization.rule_index': i,
|
|
184
191
|
});
|
|
185
192
|
}
|
|
186
193
|
return result;
|
|
@@ -193,8 +200,8 @@ export class VerificationGate {
|
|
|
193
200
|
};
|
|
194
201
|
if (this.logDecisions) {
|
|
195
202
|
this.log.debug('Gate decision (default)', {
|
|
196
|
-
|
|
197
|
-
decision: 'review',
|
|
203
|
+
[GENAI.TOOL_NAME]: ctx.toolName,
|
|
204
|
+
'namzu.authorization.decision': 'review',
|
|
198
205
|
});
|
|
199
206
|
}
|
|
200
207
|
return result;
|
|
@@ -0,0 +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;AAMvD,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAA;AAE/E,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAQzC;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,YAAY,CAAC,IAAuB;IACnD,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,GAAG,CAAA;QACxD,KAAK,cAAc;YAClB,OAAO,mBAAmB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,gFAAgF,CAAA;QACpI,KAAK,mBAAmB;YACvB,OAAO,wBAAwB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAA;QAC7D,KAAK,eAAe;YACnB,OAAO,oBAAoB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAA;QACpD,KAAK,kBAAkB,CAAC,CAAC,CA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,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,6 @@
|
|
|
1
|
+
export { AuthorizationGate, describeRule, type ToolCallContext } from './gate.js';
|
|
2
|
+
export { defaultSandboxedGateConfig, defaultSandboxedShellGateConfig } from './presets.js';
|
|
3
|
+
export { evaluateRule } from './rules.js';
|
|
4
|
+
export { PERMISSION_PRESETS, SANDBOXED_PRESET, SANDBOXED_SHELL_PRESET, SUPERVISED_PRESET, UNATTENDED_PRESET, UnsupportedPermissionPresetError, availablePermissionPresets, permissionPreset, resolvePermissionPreset, } from './permission-presets.js';
|
|
5
|
+
export type { PermissionPreset } from './permission-presets.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/authorization/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,WAAW,CAAA;AACjF,OAAO,EAAE,0BAA0B,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAA;AAC1F,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAKzC,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,gCAAgC,EAChC,0BAA0B,EAC1B,gBAAgB,EAChB,uBAAuB,GACvB,MAAM,yBAAyB,CAAA;AAChC,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// This barrel is authorization: a rule engine that decides, BEFORE a tool
|
|
2
|
+
// runs, whether the call is permitted. It is not verification, and the
|
|
3
|
+
// module-invariant registry that used to sit beside it here moved to
|
|
4
|
+
// `src/invariants/` for that reason — see the note on the move in that
|
|
5
|
+
// file. Keeping the two in one directory is what let "verification" mean
|
|
6
|
+
// two unrelated things in one tree.
|
|
7
|
+
export { AuthorizationGate, describeRule } from './gate.js';
|
|
8
|
+
export { defaultSandboxedGateConfig, defaultSandboxedShellGateConfig } from './presets.js';
|
|
9
|
+
export { evaluateRule } from './rules.js';
|
|
10
|
+
// A named permission stance: what the gate allows, what the sandbox must
|
|
11
|
+
// actually enforce for that to be safe, and who answers the rest. The three
|
|
12
|
+
// were configured independently and had to agree by hand.
|
|
13
|
+
export { PERMISSION_PRESETS, SANDBOXED_PRESET, SANDBOXED_SHELL_PRESET, SUPERVISED_PRESET, UNATTENDED_PRESET, UnsupportedPermissionPresetError, availablePermissionPresets, permissionPreset, resolvePermissionPreset, } from './permission-presets.js';
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/authorization/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,uEAAuE;AACvE,qEAAqE;AACrE,uEAAuE;AACvE,yEAAyE;AACzE,oCAAoC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAwB,MAAM,WAAW,CAAA;AACjF,OAAO,EAAE,0BAA0B,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAA;AAC1F,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAEzC,yEAAyE;AACzE,4EAA4E;AAC5E,0DAA0D;AAC1D,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,gCAAgC,EAChC,0BAA0B,EAC1B,gBAAgB,EAChB,uBAAuB,GACvB,MAAM,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { AuthorizationGateConfig } from '../types/authorization/index.js';
|
|
2
|
+
import type { SandboxIsolationControl, SandboxIsolationReport } from '../types/sandbox/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* A named permission stance: what the gate allows, what the sandbox must
|
|
5
|
+
* actually enforce for that to be safe, and who answers the rest.
|
|
6
|
+
*
|
|
7
|
+
* The three were configured independently and had to agree by hand.
|
|
8
|
+
* `defaultSandboxedGateConfig` auto-approves in-sandbox file mutation, and
|
|
9
|
+
* its own docstring says why: "the FS boundary is enforced by the sandbox
|
|
10
|
+
* layer, not by per-call review". That is a claim about a DIFFERENT
|
|
11
|
+
* subsystem — one nothing checked. Hand that config a `basic` tier, where
|
|
12
|
+
* the spawned process can read and write the whole host filesystem, and the
|
|
13
|
+
* gate keeps auto-approving writes on the grounds of a boundary that is not
|
|
14
|
+
* there.
|
|
15
|
+
*
|
|
16
|
+
* So a preset states its requirement and {@link resolvePermissionPreset}
|
|
17
|
+
* refuses when the host cannot meet it. Refusing is the point: a preset
|
|
18
|
+
* that silently fell back to asking about everything would be safe and
|
|
19
|
+
* unusable, and one that silently kept auto-approving would be neither.
|
|
20
|
+
*/
|
|
21
|
+
export interface PermissionPreset {
|
|
22
|
+
/** Stable, and written into the run's log. */
|
|
23
|
+
readonly name: string;
|
|
24
|
+
/** One sentence an operator reads when choosing between them. */
|
|
25
|
+
readonly description: string;
|
|
26
|
+
readonly gate: AuthorizationGateConfig;
|
|
27
|
+
/**
|
|
28
|
+
* The controls the sandbox must actually enforce for `gate` to mean what
|
|
29
|
+
* it says.
|
|
30
|
+
*
|
|
31
|
+
* Controls, not a tier name. `SandboxEnvironment` names an
|
|
32
|
+
* implementation — one tier denies the network outright while another
|
|
33
|
+
* leaves the host filesystem visible — and a preset depends on the
|
|
34
|
+
* property, not on which implementation happens to supply it.
|
|
35
|
+
*/
|
|
36
|
+
readonly requiresIsolation: readonly SandboxIsolationControl[];
|
|
37
|
+
/**
|
|
38
|
+
* The approval policy name this stance expects to be running under.
|
|
39
|
+
*
|
|
40
|
+
* Advisory rather than enforced: this package cannot install a handler,
|
|
41
|
+
* and a preset that pretended to would be claiming an authority it does
|
|
42
|
+
* not have. It is here so a host can compare it against the run's actual
|
|
43
|
+
* policy and so the pairing is written down in one place instead of
|
|
44
|
+
* living in whoever wired it.
|
|
45
|
+
*/
|
|
46
|
+
readonly expectsApprovalPolicy: string;
|
|
47
|
+
}
|
|
48
|
+
/** A preset whose isolation requirement the host cannot meet. */
|
|
49
|
+
export declare class UnsupportedPermissionPresetError extends Error {
|
|
50
|
+
readonly details: {
|
|
51
|
+
preset: string;
|
|
52
|
+
required: readonly SandboxIsolationControl[];
|
|
53
|
+
missing: readonly SandboxIsolationControl[];
|
|
54
|
+
};
|
|
55
|
+
constructor(details: {
|
|
56
|
+
preset: string;
|
|
57
|
+
required: readonly SandboxIsolationControl[];
|
|
58
|
+
missing: readonly SandboxIsolationControl[];
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Ask a human about everything, and rely on nothing.
|
|
63
|
+
*
|
|
64
|
+
* The only preset with no isolation requirement, because it makes no
|
|
65
|
+
* assumption a sandbox could fail to back: every call goes to review.
|
|
66
|
+
* Correct on a bare host, and the one to reach for when the sandbox tier
|
|
67
|
+
* is unknown.
|
|
68
|
+
*/
|
|
69
|
+
export declare const SUPERVISED_PRESET: PermissionPreset;
|
|
70
|
+
/**
|
|
71
|
+
* Trust the sandbox for the filesystem; ask about shell and network.
|
|
72
|
+
*
|
|
73
|
+
* `filesystem` only, and the omissions are deliberate. This preset does not
|
|
74
|
+
* auto-approve shell or network calls, so it does not depend on those
|
|
75
|
+
* controls being enforced — requiring them would refuse hosts that could
|
|
76
|
+
* safely run this.
|
|
77
|
+
*/
|
|
78
|
+
export declare const SANDBOXED_PRESET: PermissionPreset;
|
|
79
|
+
/**
|
|
80
|
+
* Trust the sandbox for shell too.
|
|
81
|
+
*
|
|
82
|
+
* Requires `process` as well: a shell that auto-approves inside a tier
|
|
83
|
+
* which cannot stop it seeing or signalling host processes is a shell with
|
|
84
|
+
* the run of the machine, and the gate would be approving on the strength
|
|
85
|
+
* of a boundary that does not exist.
|
|
86
|
+
*/
|
|
87
|
+
export declare const SANDBOXED_SHELL_PRESET: PermissionPreset;
|
|
88
|
+
/**
|
|
89
|
+
* Nobody is watching, so the sandbox has to be.
|
|
90
|
+
*
|
|
91
|
+
* All three controls, because with an auto-approving policy the sandbox is
|
|
92
|
+
* the ONLY boundary left. This is the preset an unattended run wants, and
|
|
93
|
+
* the one whose requirement must not be waived: the whole reason it can
|
|
94
|
+
* approve everything is that the host said nothing can escape.
|
|
95
|
+
*/
|
|
96
|
+
export declare const UNATTENDED_PRESET: PermissionPreset;
|
|
97
|
+
export declare const PERMISSION_PRESETS: Readonly<Record<string, PermissionPreset>>;
|
|
98
|
+
/** The preset by name, or `undefined` — the reverse lookup a host needs. */
|
|
99
|
+
export declare function permissionPreset(name: string): PermissionPreset | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* The gate config for a preset, or a refusal naming what is missing.
|
|
102
|
+
*
|
|
103
|
+
* The check is the reason this function exists rather than a property
|
|
104
|
+
* lookup. A host reaching for `unattended` on a `basic` tier is asking for
|
|
105
|
+
* a run that approves everything with nothing enforcing the boundary it is
|
|
106
|
+
* approving on the strength of; the answer is no, with the missing controls
|
|
107
|
+
* named so the host can fix the sandbox rather than guess.
|
|
108
|
+
*/
|
|
109
|
+
export declare function resolvePermissionPreset(preset: PermissionPreset, isolation: SandboxIsolationReport): AuthorizationGateConfig;
|
|
110
|
+
/**
|
|
111
|
+
* Every preset this host can actually honour, strongest first.
|
|
112
|
+
*
|
|
113
|
+
* For an operator picking one, and for a host that wants a default it can
|
|
114
|
+
* defend. Ordered by how much they rely on the sandbox rather than
|
|
115
|
+
* alphabetically, so the first entry is always the loosest stance this host
|
|
116
|
+
* can back up and the last is always `supervised`, which needs nothing.
|
|
117
|
+
*/
|
|
118
|
+
export declare function availablePermissionPresets(isolation: SandboxIsolationReport): readonly PermissionPreset[];
|
|
119
|
+
//# sourceMappingURL=permission-presets.d.ts.map
|
|
@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CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAKzE,CAAA;AAED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAE3E;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACtC,MAAM,EAAE,gBAAgB,EACxB,SAAS,EAAE,sBAAsB,GAC/B,uBAAuB,CAUzB;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACzC,SAAS,EAAE,sBAAsB,GAC/B,SAAS,gBAAgB,EAAE,CAI7B"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { AUTO_APPROVE_POLICY_NAME } from '../runtime/query/approval-policy.js';
|
|
2
|
+
import { defaultSandboxedGateConfig, defaultSandboxedShellGateConfig } from './presets.js';
|
|
3
|
+
/** A preset whose isolation requirement the host cannot meet. */
|
|
4
|
+
export class UnsupportedPermissionPresetError extends Error {
|
|
5
|
+
details;
|
|
6
|
+
constructor(details) {
|
|
7
|
+
super(`The "${details.preset}" preset requires ${details.required.join(', ')} isolation; this sandbox does not enforce ${details.missing.join(', ')}.`);
|
|
8
|
+
this.name = 'UnsupportedPermissionPresetError';
|
|
9
|
+
this.details = details;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Ask a human about everything, and rely on nothing.
|
|
14
|
+
*
|
|
15
|
+
* The only preset with no isolation requirement, because it makes no
|
|
16
|
+
* assumption a sandbox could fail to back: every call goes to review.
|
|
17
|
+
* Correct on a bare host, and the one to reach for when the sandbox tier
|
|
18
|
+
* is unknown.
|
|
19
|
+
*/
|
|
20
|
+
export const SUPERVISED_PRESET = {
|
|
21
|
+
name: 'supervised',
|
|
22
|
+
description: 'Every tool call goes to a human. Assumes nothing about the sandbox.',
|
|
23
|
+
gate: {
|
|
24
|
+
enabled: true,
|
|
25
|
+
// `false`, and that is the whole preset. Read-only auto-approval is
|
|
26
|
+
// the one allowance whose safety does not depend on the sandbox — it
|
|
27
|
+
// depends on a tool telling the truth about itself, which is the
|
|
28
|
+
// claim `isTrustedReadOnly` exists because it cannot always take at
|
|
29
|
+
// face value.
|
|
30
|
+
allowReadOnlyTools: false,
|
|
31
|
+
denyDangerousPatterns: true,
|
|
32
|
+
logDecisions: false,
|
|
33
|
+
rules: [{ type: 'deny_dangerous_patterns' }],
|
|
34
|
+
},
|
|
35
|
+
requiresIsolation: [],
|
|
36
|
+
expectsApprovalPolicy: 'host',
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Trust the sandbox for the filesystem; ask about shell and network.
|
|
40
|
+
*
|
|
41
|
+
* `filesystem` only, and the omissions are deliberate. This preset does not
|
|
42
|
+
* auto-approve shell or network calls, so it does not depend on those
|
|
43
|
+
* controls being enforced — requiring them would refuse hosts that could
|
|
44
|
+
* safely run this.
|
|
45
|
+
*/
|
|
46
|
+
export const SANDBOXED_PRESET = {
|
|
47
|
+
name: 'sandboxed',
|
|
48
|
+
description: 'In-sandbox file mutation auto-approves; shell and network calls go to a human. Requires a sandbox that confines the filesystem.',
|
|
49
|
+
gate: defaultSandboxedGateConfig(),
|
|
50
|
+
requiresIsolation: ['filesystem'],
|
|
51
|
+
expectsApprovalPolicy: 'host',
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Trust the sandbox for shell too.
|
|
55
|
+
*
|
|
56
|
+
* Requires `process` as well: a shell that auto-approves inside a tier
|
|
57
|
+
* which cannot stop it seeing or signalling host processes is a shell with
|
|
58
|
+
* the run of the machine, and the gate would be approving on the strength
|
|
59
|
+
* of a boundary that does not exist.
|
|
60
|
+
*/
|
|
61
|
+
export const SANDBOXED_SHELL_PRESET = {
|
|
62
|
+
name: 'sandboxed-shell',
|
|
63
|
+
description: 'Shell as well as file mutation auto-approves inside the sandbox; network calls go to a human. Requires filesystem and process isolation.',
|
|
64
|
+
gate: defaultSandboxedShellGateConfig(),
|
|
65
|
+
requiresIsolation: ['filesystem', 'process'],
|
|
66
|
+
expectsApprovalPolicy: 'host',
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Nobody is watching, so the sandbox has to be.
|
|
70
|
+
*
|
|
71
|
+
* All three controls, because with an auto-approving policy the sandbox is
|
|
72
|
+
* the ONLY boundary left. This is the preset an unattended run wants, and
|
|
73
|
+
* the one whose requirement must not be waived: the whole reason it can
|
|
74
|
+
* approve everything is that the host said nothing can escape.
|
|
75
|
+
*/
|
|
76
|
+
export const UNATTENDED_PRESET = {
|
|
77
|
+
name: 'unattended',
|
|
78
|
+
description: 'Everything auto-approves. The sandbox is the only boundary, so it must enforce all three controls.',
|
|
79
|
+
gate: {
|
|
80
|
+
...defaultSandboxedShellGateConfig(),
|
|
81
|
+
allowReadOnlyTools: true,
|
|
82
|
+
// Network too, which is exactly what the `network` isolation
|
|
83
|
+
// requirement below is paying for. The sandboxed presets leave
|
|
84
|
+
// network to a human precisely because they do not require that
|
|
85
|
+
// control; this one requires it, so it can spend it.
|
|
86
|
+
rules: [
|
|
87
|
+
{
|
|
88
|
+
type: 'allow_by_category',
|
|
89
|
+
categories: ['filesystem', 'shell', 'analysis', 'custom', 'network'],
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
requiresIsolation: ['filesystem', 'network', 'process'],
|
|
94
|
+
expectsApprovalPolicy: AUTO_APPROVE_POLICY_NAME,
|
|
95
|
+
};
|
|
96
|
+
export const PERMISSION_PRESETS = {
|
|
97
|
+
[SUPERVISED_PRESET.name]: SUPERVISED_PRESET,
|
|
98
|
+
[SANDBOXED_PRESET.name]: SANDBOXED_PRESET,
|
|
99
|
+
[SANDBOXED_SHELL_PRESET.name]: SANDBOXED_SHELL_PRESET,
|
|
100
|
+
[UNATTENDED_PRESET.name]: UNATTENDED_PRESET,
|
|
101
|
+
};
|
|
102
|
+
/** The preset by name, or `undefined` — the reverse lookup a host needs. */
|
|
103
|
+
export function permissionPreset(name) {
|
|
104
|
+
return PERMISSION_PRESETS[name];
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The gate config for a preset, or a refusal naming what is missing.
|
|
108
|
+
*
|
|
109
|
+
* The check is the reason this function exists rather than a property
|
|
110
|
+
* lookup. A host reaching for `unattended` on a `basic` tier is asking for
|
|
111
|
+
* a run that approves everything with nothing enforcing the boundary it is
|
|
112
|
+
* approving on the strength of; the answer is no, with the missing controls
|
|
113
|
+
* named so the host can fix the sandbox rather than guess.
|
|
114
|
+
*/
|
|
115
|
+
export function resolvePermissionPreset(preset, isolation) {
|
|
116
|
+
const missing = preset.requiresIsolation.filter((control) => !isolation[control]);
|
|
117
|
+
if (missing.length > 0) {
|
|
118
|
+
throw new UnsupportedPermissionPresetError({
|
|
119
|
+
preset: preset.name,
|
|
120
|
+
required: preset.requiresIsolation,
|
|
121
|
+
missing,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return preset.gate;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Every preset this host can actually honour, strongest first.
|
|
128
|
+
*
|
|
129
|
+
* For an operator picking one, and for a host that wants a default it can
|
|
130
|
+
* defend. Ordered by how much they rely on the sandbox rather than
|
|
131
|
+
* alphabetically, so the first entry is always the loosest stance this host
|
|
132
|
+
* can back up and the last is always `supervised`, which needs nothing.
|
|
133
|
+
*/
|
|
134
|
+
export function availablePermissionPresets(isolation) {
|
|
135
|
+
return [UNATTENDED_PRESET, SANDBOXED_SHELL_PRESET, SANDBOXED_PRESET, SUPERVISED_PRESET].filter((preset) => preset.requiresIsolation.every((control) => isolation[control]));
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=permission-presets.js.map
|