@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
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import type { Span } from '@opentelemetry/api'
|
|
2
2
|
import { extractFromToolCall, extractFromToolResult } from '../../compaction/extractor.js'
|
|
3
3
|
import type { WorkingStateManager } from '../../compaction/manager.js'
|
|
4
|
+
import { GENAI, NAMZU } from '../../constants/telemetry/index.js'
|
|
4
5
|
import type { PluginLifecycleManager } from '../../plugin/lifecycle.js'
|
|
5
6
|
import { buildProbeContext } from '../../probe/context.js'
|
|
6
7
|
import { ProbeVetoError } from '../../probe/errors.js'
|
|
7
|
-
import {
|
|
8
|
+
import { probe as defaultProbeRegistry } from '../../probe/registry.js'
|
|
9
|
+
import type { ProbeEnforcement } from '../../probe/registry.js'
|
|
8
10
|
import { renderToolSchema } from '../../registry/tool/schema.js'
|
|
9
11
|
import type { ActivityStore } from '../../store/activity/memory.js'
|
|
10
12
|
import { fingerprintContent } from '../../tools/builtins/content-fingerprint.js'
|
|
13
|
+
import { SKILL_TOOL_NAME } from '../../tools/builtins/skill.js'
|
|
11
14
|
import type { RunId, ToolUseId } from '../../types/ids/index.js'
|
|
12
15
|
import type { InvocationState } from '../../types/invocation/index.js'
|
|
13
16
|
import {
|
|
@@ -24,6 +27,7 @@ import type { Sandbox } from '../../types/sandbox/index.js'
|
|
|
24
27
|
import type {
|
|
25
28
|
FileReadTracker,
|
|
26
29
|
RequestToolPause,
|
|
30
|
+
SkillRegistryRef,
|
|
27
31
|
ToolContext,
|
|
28
32
|
ToolRegistryContract,
|
|
29
33
|
ToolResult,
|
|
@@ -36,8 +40,10 @@ import type {
|
|
|
36
40
|
import { abortReasonText } from '../../utils/abort.js'
|
|
37
41
|
import { type BackoffPolicy, backoffWithJitter, sleep } from '../../utils/backoff.js'
|
|
38
42
|
import { toErrorMessage } from '../../utils/error.js'
|
|
43
|
+
import { generateToolCallId } from '../../utils/id.js'
|
|
39
44
|
import type { Logger } from '../../utils/logger.js'
|
|
40
45
|
import { compressShellOutput } from '../../utils/shell-compress.js'
|
|
46
|
+
import { type BackgroundJobRegistry, bindOwner } from '../jobs/registry.js'
|
|
41
47
|
import {
|
|
42
48
|
DEFAULT_MAX_TOOL_OUTPUT_CHARS,
|
|
43
49
|
applyToolOutputBudget,
|
|
@@ -114,11 +120,45 @@ export interface ToolExecutorConfig {
|
|
|
114
120
|
tools: ToolRegistryContract
|
|
115
121
|
runId: RunId
|
|
116
122
|
workingDirectory: string
|
|
117
|
-
|
|
123
|
+
/**
|
|
124
|
+
* Read LIVE, not frozen at run start.
|
|
125
|
+
*
|
|
126
|
+
* The mode used to be resolved once per run and copied in here, so
|
|
127
|
+
* leaving plan mode meant ending the run — discarding the in-flight step
|
|
128
|
+
* and the tool-schema context to change one enum. A function lets an
|
|
129
|
+
* approval flip it inside the same conversation.
|
|
130
|
+
*
|
|
131
|
+
* Sampled ONCE per batch and held for it: a toggle landing between two
|
|
132
|
+
* calls the model issued together would half-apply, and a batch where
|
|
133
|
+
* the first write is refused and the second succeeds is not a state
|
|
134
|
+
* anyone can reason about.
|
|
135
|
+
*/
|
|
136
|
+
permissionMode: PermissionMode | (() => PermissionMode)
|
|
118
137
|
env: Record<string, string>
|
|
119
138
|
abortSignal: AbortSignal
|
|
120
139
|
allowedTools?: readonly string[]
|
|
121
140
|
sandbox?: Sandbox
|
|
141
|
+
/**
|
|
142
|
+
* Where background jobs this run starts are held.
|
|
143
|
+
*
|
|
144
|
+
* The registry is host-owned and shared; the executor binds it to THIS
|
|
145
|
+
* run's id before a tool ever sees it, so a tool cannot start a job
|
|
146
|
+
* billed to another run, nor read or kill one. Absent means the host
|
|
147
|
+
* offers no background mode, and `bash run_in_background` refuses rather
|
|
148
|
+
* than falling back to `cmd &` — see `runtime/jobs/registry.ts` for why
|
|
149
|
+
* that fallback is a lie rather than a lesser version.
|
|
150
|
+
*/
|
|
151
|
+
backgroundJobs?: BackgroundJobRegistry
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Where the `skill` tool reads from.
|
|
155
|
+
*
|
|
156
|
+
* Structural (`SkillRegistryRef`) rather than `SkillRegistry`, because
|
|
157
|
+
* this config is host-facing and a host may hold its skills anywhere.
|
|
158
|
+
*/
|
|
159
|
+
skills?: SkillRegistryRef
|
|
160
|
+
/** How this run reaches the web. See `ToolContext.web`. */
|
|
161
|
+
web?: ToolContext['web']
|
|
122
162
|
invocationState?: InvocationState
|
|
123
163
|
pluginManager?: PluginLifecycleManager
|
|
124
164
|
/** Run-level default deadline; per-tool `timeoutMs` overrides it. */
|
|
@@ -256,7 +296,7 @@ export class ToolExecutor {
|
|
|
256
296
|
private emitEvent: EmitEvent
|
|
257
297
|
private log: Logger
|
|
258
298
|
private workingStateManager?: WorkingStateManager
|
|
259
|
-
private probes:
|
|
299
|
+
private probes: ProbeEnforcement
|
|
260
300
|
private parentSpan?: Span
|
|
261
301
|
/** Set per turn by the orchestrator; see {@link setStepAllowedTools}. */
|
|
262
302
|
private stepAllowedTools?: readonly string[]
|
|
@@ -280,7 +320,7 @@ export class ToolExecutor {
|
|
|
280
320
|
activityStore: ActivityStore,
|
|
281
321
|
emitEvent: EmitEvent,
|
|
282
322
|
log: Logger,
|
|
283
|
-
probes:
|
|
323
|
+
probes: ProbeEnforcement = defaultProbeRegistry,
|
|
284
324
|
) {
|
|
285
325
|
this.config = config
|
|
286
326
|
this.activityStore = activityStore
|
|
@@ -336,6 +376,78 @@ export class ToolExecutor {
|
|
|
336
376
|
* the universal contract across providers: an unanswered `tool_use`
|
|
337
377
|
* is a protocol violation, not a decline.
|
|
338
378
|
*/
|
|
379
|
+
/**
|
|
380
|
+
* The mode sampled for the batch currently running, if one is.
|
|
381
|
+
*
|
|
382
|
+
* Belt-and-braces, and worth saying so. The per-batch property is
|
|
383
|
+
* ALREADY structural: `buildToolContext()` runs once per batch and every
|
|
384
|
+
* per-call context spreads its result, so the mode is read once whether
|
|
385
|
+
* or not this field exists — removing it is an equivalent mutation
|
|
386
|
+
* today, measured.
|
|
387
|
+
*
|
|
388
|
+
* Kept because that guarantee is incidental to where the context happens
|
|
389
|
+
* to be built. Moving `permissionContext` into the per-call spread is a
|
|
390
|
+
* plausible refactor and would silently make the read per-call, which is
|
|
391
|
+
* a batch where the first write is refused and the second succeeds.
|
|
392
|
+
*/
|
|
393
|
+
private batchMode?: PermissionMode
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* The tool scope a loaded skill declared, and the batch it applies from.
|
|
397
|
+
*
|
|
398
|
+
* `allowed-tools` was parsed, stored and rendered into the prompt, and
|
|
399
|
+
* read by nothing — advice phrased as a declaration. This is what makes
|
|
400
|
+
* it a restriction, on the same line that already enforces the step's
|
|
401
|
+
* list, because a narrowing the model can decline is not one.
|
|
402
|
+
*
|
|
403
|
+
* Two fields rather than one, and the second is the point: a skill
|
|
404
|
+
* loaded MID-batch must not retroactively refuse the calls the model
|
|
405
|
+
* issued alongside it. The model chose that batch under the old scope,
|
|
406
|
+
* and refusing half of it teaches nothing except that tools fail at
|
|
407
|
+
* random. `adoptedInBatch` is compared against the batch counter, so the
|
|
408
|
+
* scope takes effect from the next one.
|
|
409
|
+
*
|
|
410
|
+
* **`adoptedInBatch` is redundant TODAY and kept deliberately**, the same
|
|
411
|
+
* bargain `batchMode` above documents. `buildToolContext()` runs once per
|
|
412
|
+
* batch, so every call in a batch already shares one `allowedTools` array
|
|
413
|
+
* computed before any of them could adopt anything — remove this
|
|
414
|
+
* comparison and no test changes, because the guarantee currently comes
|
|
415
|
+
* from where the context happens to be built rather than from here.
|
|
416
|
+
* Moving the context into the per-call spread is a plausible refactor,
|
|
417
|
+
* and it would silently produce a batch whose second half is refused for
|
|
418
|
+
* a scope its first half installed. That is precisely the incoherent
|
|
419
|
+
* batch this line exists to make impossible.
|
|
420
|
+
*/
|
|
421
|
+
private skillScope?: { skill: string; allowedTools: readonly string[]; adoptedInBatch: number }
|
|
422
|
+
private batchCounter = 0
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* The step's list, narrowed by any skill scope in force.
|
|
426
|
+
*
|
|
427
|
+
* An INTERSECTION, never a replacement: a skill cannot hand the model a
|
|
428
|
+
* tool the step withheld. Widening has to be unexpressible rather than
|
|
429
|
+
* discouraged — the same rule `CreateTaskOptions.toolScope` states for
|
|
430
|
+
* delegation, and for the same reason: a skill file is content, and
|
|
431
|
+
* content that can grant tools is a privilege-escalation surface wearing
|
|
432
|
+
* the word "scope".
|
|
433
|
+
*
|
|
434
|
+
* The `skill` tool itself always survives. A skill that narrowed the
|
|
435
|
+
* model out of reaching for another skill would be a one-way door, and
|
|
436
|
+
* the tool reads instructions and changes nothing.
|
|
437
|
+
*/
|
|
438
|
+
private effectiveAllowedTools(): readonly string[] | undefined {
|
|
439
|
+
const base = this.stepAllowedTools ?? this.config.allowedTools
|
|
440
|
+
const scope = this.skillScope
|
|
441
|
+
if (!scope || scope.adoptedInBatch >= this.batchCounter) return base
|
|
442
|
+
const narrowed = new Set([...scope.allowedTools, SKILL_TOOL_NAME])
|
|
443
|
+
return base === undefined ? [...narrowed] : base.filter((name) => narrowed.has(name))
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
private resolvePermissionMode(): PermissionMode {
|
|
447
|
+
const configured = this.config.permissionMode
|
|
448
|
+
return typeof configured === 'function' ? configured() : configured
|
|
449
|
+
}
|
|
450
|
+
|
|
339
451
|
async executeBatch(
|
|
340
452
|
response: ChatCompletionResponse,
|
|
341
453
|
denials?: ToolCallDenials,
|
|
@@ -346,12 +458,31 @@ export class ToolExecutor {
|
|
|
346
458
|
return { messages: [], results: [] }
|
|
347
459
|
}
|
|
348
460
|
|
|
461
|
+
this.batchCounter += 1
|
|
462
|
+
|
|
463
|
+
// Sampled here, once, and held for every call below. See the note on
|
|
464
|
+
// `permissionMode` in the config type.
|
|
465
|
+
this.batchMode = this.resolvePermissionMode()
|
|
466
|
+
try {
|
|
467
|
+
return await this.runBatch(toolCalls, denials, prior)
|
|
468
|
+
} finally {
|
|
469
|
+
// Cleared so a later single execution outside a batch resolves
|
|
470
|
+
// live rather than inheriting the last batch's sample.
|
|
471
|
+
this.batchMode = undefined
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
private async runBatch(
|
|
476
|
+
toolCalls: readonly ToolCall[],
|
|
477
|
+
denials?: ToolCallDenials,
|
|
478
|
+
prior?: PriorToolResults,
|
|
479
|
+
): Promise<ToolExecutionBatch> {
|
|
349
480
|
this.log.debug('Executing tool batch', {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
481
|
+
[NAMZU.RUN_ID]: this.config.runId,
|
|
482
|
+
'namzu.runtime.tool_count': toolCalls.length,
|
|
483
|
+
'namzu.runtime.denied_count': denials?.size ?? 0,
|
|
484
|
+
'namzu.runtime.recovered_count': prior?.size ?? 0,
|
|
485
|
+
'namzu.tool.names': toolCalls.map((tc) => tc.function.name),
|
|
355
486
|
})
|
|
356
487
|
|
|
357
488
|
// One context per call so each execution can see its own
|
|
@@ -409,6 +540,11 @@ export class ToolExecutor {
|
|
|
409
540
|
const ctx: ToolContext = {
|
|
410
541
|
...baseContext,
|
|
411
542
|
toolUseId: toolCall.id,
|
|
543
|
+
// Overridden per call, so a nested dispatch can name the call
|
|
544
|
+
// that made it. The base context has no `toolUseId`, and a
|
|
545
|
+
// closure built there would report every nested call as
|
|
546
|
+
// parentless.
|
|
547
|
+
dispatchTool: (name, input) => this.dispatchNested(name, input, ctx),
|
|
412
548
|
// Per-call for the same reason: a pause has to be routed back
|
|
413
549
|
// to the call that raised it, and a batch can raise several.
|
|
414
550
|
...(this.config.toolPause ? { requestPause: this.config.toolPause(toolCall.id) } : {}),
|
|
@@ -480,15 +616,68 @@ export class ToolExecutor {
|
|
|
480
616
|
return { messages, results }
|
|
481
617
|
}
|
|
482
618
|
|
|
619
|
+
/**
|
|
620
|
+
* Run a tool on behalf of another tool, and put it on the record.
|
|
621
|
+
*
|
|
622
|
+
* These used to go straight to `registry.execute`, so they reached the
|
|
623
|
+
* permission gate and reached the event stream not at all — a run whose
|
|
624
|
+
* transcript showed one `run_code` call and nothing about the eleven
|
|
625
|
+
* writes it performed is a transcript nobody can audit.
|
|
626
|
+
*
|
|
627
|
+
* `via` names the dispatching call rather than merely marking this one
|
|
628
|
+
* nested, and that is the load-bearing part: without it a consumer
|
|
629
|
+
* counting tool calls double-counts the parent AND each child, and one
|
|
630
|
+
* rendering a timeline draws eleven siblings where there is one call with
|
|
631
|
+
* eleven children.
|
|
632
|
+
*/
|
|
633
|
+
private async dispatchNested(
|
|
634
|
+
name: string,
|
|
635
|
+
input: unknown,
|
|
636
|
+
context: ToolContext,
|
|
637
|
+
): Promise<ToolResult> {
|
|
638
|
+
const parent = context.toolUseId
|
|
639
|
+
const via = parent ? { tool: name, toolUseId: parent as ToolUseId } : undefined
|
|
640
|
+
// Its own id, minted here. Reusing the parent's would make two
|
|
641
|
+
// different calls indistinguishable in any log keyed by it, which is
|
|
642
|
+
// exactly how a nested write gets attributed to the program that ran
|
|
643
|
+
// it rather than to itself.
|
|
644
|
+
const nestedId = generateToolCallId() as unknown as ToolUseId
|
|
645
|
+
const startedAt = Date.now()
|
|
646
|
+
|
|
647
|
+
await this.emitEvent({
|
|
648
|
+
type: 'tool_executing',
|
|
649
|
+
runId: this.config.runId,
|
|
650
|
+
toolUseId: nestedId,
|
|
651
|
+
toolName: name,
|
|
652
|
+
input,
|
|
653
|
+
...(via ? { via } : {}),
|
|
654
|
+
})
|
|
655
|
+
|
|
656
|
+
const result = await this.config.tools.execute(name, input, context)
|
|
657
|
+
|
|
658
|
+
await this.emitEvent({
|
|
659
|
+
type: 'tool_completed',
|
|
660
|
+
runId: this.config.runId,
|
|
661
|
+
toolUseId: nestedId,
|
|
662
|
+
toolName: name,
|
|
663
|
+
result: result.success ? result.output : (result.error ?? 'failed'),
|
|
664
|
+
isError: !result.success,
|
|
665
|
+
durationMs: Date.now() - startedAt,
|
|
666
|
+
...(via ? { via } : {}),
|
|
667
|
+
})
|
|
668
|
+
|
|
669
|
+
return result
|
|
670
|
+
}
|
|
671
|
+
|
|
483
672
|
private buildToolContext(): ToolContext {
|
|
484
|
-
|
|
673
|
+
const context: ToolContext = {
|
|
485
674
|
runId: this.config.runId,
|
|
486
675
|
workingDirectory: this.config.workingDirectory,
|
|
487
676
|
abortSignal: this.config.abortSignal,
|
|
488
677
|
env: this.config.env,
|
|
489
678
|
log: (level, message) => this.log[level](message),
|
|
490
679
|
permissionContext: {
|
|
491
|
-
mode: this.
|
|
680
|
+
mode: this.batchMode ?? this.resolvePermissionMode(),
|
|
492
681
|
runId: this.config.runId,
|
|
493
682
|
workingDirectory: this.config.workingDirectory,
|
|
494
683
|
},
|
|
@@ -497,11 +686,39 @@ export class ToolExecutor {
|
|
|
497
686
|
// The step's list wins where it has one; the run's is the default.
|
|
498
687
|
// Same precedence the request already uses when it decides which
|
|
499
688
|
// schemas to send, so the menu and the kitchen agree.
|
|
500
|
-
allowedTools: this.
|
|
689
|
+
allowedTools: this.effectiveAllowedTools(),
|
|
690
|
+
// Recorded, not applied here: a skill loaded during this batch
|
|
691
|
+
// narrows the NEXT one. See `skillScope`.
|
|
692
|
+
adoptSkillScope: (scope) => {
|
|
693
|
+
this.skillScope = { ...scope, adoptedInBatch: this.batchCounter }
|
|
694
|
+
},
|
|
695
|
+
...(this.config.skills ? { skills: this.config.skills } : {}),
|
|
696
|
+
...(this.config.web ? { web: this.config.web } : {}),
|
|
697
|
+
// The SAME registry and the SAME context a model-issued call
|
|
698
|
+
// takes. Not a parallel path: a second dispatch is a second place
|
|
699
|
+
// for the permission gate to be forgotten, and the one that forgot
|
|
700
|
+
// it would be the one a model reached through a program.
|
|
701
|
+
// Bound to the BASE context, which has no `toolUseId` — a caller
|
|
702
|
+
// dispatching outside a batch has no parent call to name. The
|
|
703
|
+
// per-call context below overrides it with one that does; see
|
|
704
|
+
// `dispatchNested`.
|
|
705
|
+
dispatchTool: (name, input) => this.dispatchNested(name, input, context),
|
|
501
706
|
sandbox: this.config.sandbox,
|
|
502
707
|
fileReadTracker: this.fileReadTracker,
|
|
708
|
+
// Bound to this run, once. Binding here rather than passing the
|
|
709
|
+
// owner from the tool is what makes the scoping structural: there
|
|
710
|
+
// is no argument a tool could pass to reach another run's jobs.
|
|
711
|
+
...(this.config.backgroundJobs
|
|
712
|
+
? {
|
|
713
|
+
backgroundJobs: bindOwner(this.config.backgroundJobs, this.config.runId, {
|
|
714
|
+
workingDirectory: this.config.workingDirectory,
|
|
715
|
+
env: this.config.env,
|
|
716
|
+
}),
|
|
717
|
+
}
|
|
718
|
+
: {}),
|
|
503
719
|
...(this.parentSpan ? { parentSpan: this.parentSpan } : {}),
|
|
504
720
|
}
|
|
721
|
+
return context
|
|
505
722
|
}
|
|
506
723
|
|
|
507
724
|
private async executeSingle(
|
|
@@ -625,10 +842,10 @@ export class ToolExecutor {
|
|
|
625
842
|
const reason = vetoOutcome.reason ?? 'no reason provided'
|
|
626
843
|
const veto = new ProbeVetoError(probeName, reason, 'tool_executing')
|
|
627
844
|
this.log.warn('Tool call denied by probe', {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
probeName,
|
|
631
|
-
reason,
|
|
845
|
+
[NAMZU.RUN_ID]: this.config.runId,
|
|
846
|
+
[GENAI.TOOL_NAME]: toolName,
|
|
847
|
+
'namzu.runtime.probe_name': probeName,
|
|
848
|
+
'namzu.runtime.reason': reason,
|
|
632
849
|
})
|
|
633
850
|
if (activity) {
|
|
634
851
|
this.activityStore.fail(activity.id, veto.message)
|
|
@@ -725,13 +942,13 @@ export class ToolExecutor {
|
|
|
725
942
|
const delayMs = backoffWithJitter(attempt - 1, backoff)
|
|
726
943
|
|
|
727
944
|
this.log.info('Retrying a failed tool call', {
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
attempt,
|
|
731
|
-
budget,
|
|
732
|
-
|
|
733
|
-
delayMs,
|
|
734
|
-
|
|
945
|
+
[NAMZU.RUN_ID]: this.config.runId,
|
|
946
|
+
[GENAI.TOOL_NAME]: toolName,
|
|
947
|
+
'namzu.retry.attempt': attempt,
|
|
948
|
+
'namzu.runtime.budget': budget,
|
|
949
|
+
'namzu.runtime.requested_by_hook': post.retry,
|
|
950
|
+
'namzu.runtime.delay_ms': delayMs,
|
|
951
|
+
'exception.message': result.error,
|
|
735
952
|
})
|
|
736
953
|
|
|
737
954
|
try {
|
|
@@ -768,17 +985,17 @@ export class ToolExecutor {
|
|
|
768
985
|
spillDir: this.config.toolOutputDir,
|
|
769
986
|
onError: (message) =>
|
|
770
987
|
this.log.warn('Failed to spill oversized tool output', {
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
988
|
+
[NAMZU.RUN_ID]: this.config.runId,
|
|
989
|
+
[GENAI.TOOL_NAME]: toolName,
|
|
990
|
+
'exception.message': message,
|
|
774
991
|
}),
|
|
775
992
|
})
|
|
776
993
|
if (budgeted.truncated) {
|
|
777
994
|
this.log.warn('Tool output exceeded the model-visible budget', {
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
995
|
+
[NAMZU.RUN_ID]: this.config.runId,
|
|
996
|
+
[GENAI.TOOL_NAME]: toolName,
|
|
997
|
+
'namzu.runtime.original_length': budgeted.originalLength,
|
|
998
|
+
'namzu.runtime.spill_path': budgeted.spillPath,
|
|
782
999
|
})
|
|
783
1000
|
}
|
|
784
1001
|
output = budgeted.output
|
|
@@ -811,17 +1028,17 @@ export class ToolExecutor {
|
|
|
811
1028
|
|
|
812
1029
|
if (result.success) {
|
|
813
1030
|
this.log.debug('Tool executed successfully', {
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
durationMs,
|
|
817
|
-
|
|
1031
|
+
[NAMZU.RUN_ID]: this.config.runId,
|
|
1032
|
+
[GENAI.TOOL_NAME]: toolName,
|
|
1033
|
+
'namzu.duration_ms': durationMs,
|
|
1034
|
+
'namzu.runtime.output_length': output.length,
|
|
818
1035
|
})
|
|
819
1036
|
} else {
|
|
820
1037
|
this.log.warn('Tool execution failed', {
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
durationMs,
|
|
824
|
-
|
|
1038
|
+
[NAMZU.RUN_ID]: this.config.runId,
|
|
1039
|
+
[GENAI.TOOL_NAME]: toolName,
|
|
1040
|
+
'namzu.duration_ms': durationMs,
|
|
1041
|
+
'exception.message': result.error ?? 'unknown',
|
|
825
1042
|
})
|
|
826
1043
|
}
|
|
827
1044
|
|
|
@@ -954,9 +1171,9 @@ export class ToolExecutor {
|
|
|
954
1171
|
|
|
955
1172
|
if (outcome === 'timeout') {
|
|
956
1173
|
this.log.warn('Tool timed out', {
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
timeoutMs,
|
|
1174
|
+
[NAMZU.RUN_ID]: this.config.runId,
|
|
1175
|
+
[GENAI.TOOL_NAME]: toolName,
|
|
1176
|
+
'namzu.runtime.timeout_ms': timeoutMs,
|
|
960
1177
|
})
|
|
961
1178
|
return {
|
|
962
1179
|
success: false,
|
|
@@ -1084,10 +1301,12 @@ export class ToolExecutor {
|
|
|
1084
1301
|
}
|
|
1085
1302
|
|
|
1086
1303
|
this.log.info('Repaired a malformed tool call', {
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
reason: failure.reason,
|
|
1090
|
-
...(repair.toolName && repair.toolName !== toolName
|
|
1304
|
+
[NAMZU.RUN_ID]: this.config.runId,
|
|
1305
|
+
[GENAI.TOOL_NAME]: toolName,
|
|
1306
|
+
'namzu.runtime.reason': failure.reason,
|
|
1307
|
+
...(repair.toolName && repair.toolName !== toolName
|
|
1308
|
+
? { 'namzu.runtime.repaired_to': repair.toolName }
|
|
1309
|
+
: {}),
|
|
1091
1310
|
})
|
|
1092
1311
|
toolName = repair.toolName ?? toolName
|
|
1093
1312
|
raw = repair.arguments
|
|
@@ -1117,9 +1336,9 @@ export class ToolExecutor {
|
|
|
1117
1336
|
)
|
|
1118
1337
|
if (repair) {
|
|
1119
1338
|
this.log.info('Repaired a tool call whose input stream was truncated', {
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1339
|
+
[NAMZU.RUN_ID]: this.config.runId,
|
|
1340
|
+
[GENAI.TOOL_NAME]: toolName,
|
|
1341
|
+
'namzu.runtime.partial_length': partial.length,
|
|
1123
1342
|
})
|
|
1124
1343
|
}
|
|
1125
1344
|
return repair
|
|
@@ -1185,9 +1404,9 @@ export class ToolExecutor {
|
|
|
1185
1404
|
// failed run: the original error is still a perfectly good answer
|
|
1186
1405
|
// to give the model.
|
|
1187
1406
|
this.log.error('repairToolCall threw — falling back to the original error', {
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1407
|
+
[NAMZU.RUN_ID]: this.config.runId,
|
|
1408
|
+
[GENAI.TOOL_NAME]: toolName,
|
|
1409
|
+
'exception.message': toErrorMessage(err),
|
|
1191
1410
|
})
|
|
1192
1411
|
return null
|
|
1193
1412
|
}
|
|
@@ -1215,9 +1434,9 @@ export class ToolExecutor {
|
|
|
1215
1434
|
} catch (err) {
|
|
1216
1435
|
const message = toErrorMessage(err)
|
|
1217
1436
|
this.log.warn('Tool execution threw', {
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1437
|
+
[NAMZU.RUN_ID]: this.config.runId,
|
|
1438
|
+
[GENAI.TOOL_NAME]: toolName,
|
|
1439
|
+
'exception.message': message,
|
|
1221
1440
|
})
|
|
1222
1441
|
return { success: false, output: '', error: message }
|
|
1223
1442
|
}
|
|
@@ -1298,10 +1517,10 @@ export class ToolExecutor {
|
|
|
1298
1517
|
const output = deniedToolOutput(toolName, reason)
|
|
1299
1518
|
|
|
1300
1519
|
this.log.info('Tool call denied — synthesizing tool_result', {
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
reason,
|
|
1520
|
+
[NAMZU.RUN_ID]: this.config.runId,
|
|
1521
|
+
[GENAI.TOOL_NAME]: toolName,
|
|
1522
|
+
'namzu.runtime.tool_use_id': toolCall.id,
|
|
1523
|
+
'namzu.runtime.reason': reason,
|
|
1305
1524
|
})
|
|
1306
1525
|
|
|
1307
1526
|
const activity = this.activityStore.create({
|
|
@@ -1396,10 +1615,10 @@ export class ToolExecutor {
|
|
|
1396
1615
|
if (size <= cap) return content
|
|
1397
1616
|
|
|
1398
1617
|
this.log.warn('Tool result content exceeded the rich-content budget', {
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
cap,
|
|
1618
|
+
[NAMZU.RUN_ID]: this.config.runId,
|
|
1619
|
+
[GENAI.TOOL_NAME]: toolName,
|
|
1620
|
+
'namzu.runtime.content_bytes': size,
|
|
1621
|
+
'namzu.runtime.cap': cap,
|
|
1403
1622
|
})
|
|
1404
1623
|
|
|
1405
1624
|
const described = describeDroppedContent(content)
|
|
@@ -1422,10 +1641,12 @@ export class ToolExecutor {
|
|
|
1422
1641
|
const compressed = compressShellOutput(output)
|
|
1423
1642
|
if (compressed.length < output.length) {
|
|
1424
1643
|
this.log.debug('Shell output compressed', {
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1644
|
+
[GENAI.TOOL_NAME]: toolName,
|
|
1645
|
+
'namzu.runtime.original_length': output.length,
|
|
1646
|
+
'namzu.runtime.compressed_length': compressed.length,
|
|
1647
|
+
'namzu.runtime.reduction_percent': Math.round(
|
|
1648
|
+
(1 - compressed.length / output.length) * 100,
|
|
1649
|
+
),
|
|
1429
1650
|
})
|
|
1430
1651
|
}
|
|
1431
1652
|
return compressed
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OUTPUT_SECRET_PATTERNS } from '../../constants/secret-patterns.js'
|
|
1
2
|
import type {
|
|
2
3
|
GuardrailVerdict,
|
|
3
4
|
NamedGuardrail,
|
|
@@ -9,21 +10,17 @@ import type {
|
|
|
9
10
|
/**
|
|
10
11
|
* Patterns for credentials that must never leave a run.
|
|
11
12
|
*
|
|
12
|
-
* Deliberately narrow and prefix-anchored
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* point it
|
|
13
|
+
* Deliberately narrow and prefix-anchored, unchanged by the move to
|
|
14
|
+
* `constants/secret-patterns.ts`: a loose "looks like a secret" regex over
|
|
15
|
+
* agent output produces false positives on ordinary code, and a redactor
|
|
16
|
+
* that fires on the wrong thing gets switched off — at which point it
|
|
17
|
+
* protects nothing. The wider, field-name-aware set `provider/errors.ts`
|
|
18
|
+
* needs lives in the same leaf module as `LOG_SECRET_PATTERNS`; it is not
|
|
19
|
+
* used here because a false positive on THIS boundary rewrites the
|
|
20
|
+
* caller's answer, and a false positive there only costs a redacted log
|
|
21
|
+
* value.
|
|
16
22
|
*/
|
|
17
|
-
const SECRET_PATTERNS
|
|
18
|
-
['aws-access-key', /\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g],
|
|
19
|
-
['github-token', /\bgh[pousr]_[A-Za-z0-9]{36,}\b/g],
|
|
20
|
-
['openai-key', /\bsk-(?:proj-)?[A-Za-z0-9_-]{20,}\b/g],
|
|
21
|
-
['anthropic-key', /\bsk-ant-[A-Za-z0-9_-]{20,}\b/g],
|
|
22
|
-
['slack-token', /\bxox[abprs]-[A-Za-z0-9-]{10,}\b/g],
|
|
23
|
-
['google-api-key', /\bAIza[0-9A-Za-z_-]{35}\b/g],
|
|
24
|
-
['private-key-block', /-----BEGIN (?:RSA |EC |OPENSSH |PGP )?PRIVATE KEY-----/g],
|
|
25
|
-
['jwt', /\beyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g],
|
|
26
|
-
]
|
|
23
|
+
const SECRET_PATTERNS = OUTPUT_SECRET_PATTERNS
|
|
27
24
|
|
|
28
25
|
export interface SecretRedactionOptions {
|
|
29
26
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NAMZU } from '../../constants/telemetry/index.js'
|
|
1
2
|
import type {
|
|
2
3
|
GuardrailVerdict,
|
|
3
4
|
InputGuardrailContext,
|
|
@@ -46,9 +47,9 @@ export async function runInputGuardrails(
|
|
|
46
47
|
const verdict = await safely(() => check(ctx), nameOf({ name }, index), log)
|
|
47
48
|
if (verdict.action === 'block') {
|
|
48
49
|
log.warn('Input guardrail blocked the run', {
|
|
49
|
-
|
|
50
|
-
guardrail: nameOf({ name }, index),
|
|
51
|
-
reason: verdict.reason,
|
|
50
|
+
[NAMZU.RUN_ID]: ctx.runId,
|
|
51
|
+
'namzu.guardrail.name': nameOf({ name }, index),
|
|
52
|
+
'namzu.runtime.reason': verdict.reason,
|
|
52
53
|
})
|
|
53
54
|
return { blocked: true, name: nameOf({ name }, index), reason: verdict.reason }
|
|
54
55
|
}
|
|
@@ -57,8 +58,8 @@ export async function runInputGuardrails(
|
|
|
57
58
|
// different (and worse) feature than refusing it.
|
|
58
59
|
if (verdict.action === 'rewrite') {
|
|
59
60
|
log.warn('Input guardrail returned `rewrite`, which is not supported on input — ignoring', {
|
|
60
|
-
|
|
61
|
-
guardrail: nameOf({ name }, index),
|
|
61
|
+
[NAMZU.RUN_ID]: ctx.runId,
|
|
62
|
+
'namzu.guardrail.name': nameOf({ name }, index),
|
|
62
63
|
})
|
|
63
64
|
}
|
|
64
65
|
}
|
|
@@ -99,18 +100,18 @@ export async function runOutputGuardrails(
|
|
|
99
100
|
|
|
100
101
|
if (verdict.action === 'block') {
|
|
101
102
|
log.warn('Output guardrail blocked the result', {
|
|
102
|
-
|
|
103
|
-
guardrail: nameOf({ name }, index),
|
|
104
|
-
reason: verdict.reason,
|
|
103
|
+
[NAMZU.RUN_ID]: ctx.runId,
|
|
104
|
+
'namzu.guardrail.name': nameOf({ name }, index),
|
|
105
|
+
'namzu.runtime.reason': verdict.reason,
|
|
105
106
|
})
|
|
106
107
|
return { blocked: true, name: nameOf({ name }, index), reason: verdict.reason }
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
if (verdict.action === 'rewrite') {
|
|
110
111
|
log.info('Output guardrail rewrote the result', {
|
|
111
|
-
|
|
112
|
-
guardrail: nameOf({ name }, index),
|
|
113
|
-
reason: verdict.reason,
|
|
112
|
+
[NAMZU.RUN_ID]: ctx.runId,
|
|
113
|
+
'namzu.guardrail.name': nameOf({ name }, index),
|
|
114
|
+
'namzu.runtime.reason': verdict.reason,
|
|
114
115
|
})
|
|
115
116
|
current = verdict.output
|
|
116
117
|
rewritten = true
|
|
@@ -138,7 +139,10 @@ async function safely(
|
|
|
138
139
|
return await run()
|
|
139
140
|
} catch (err) {
|
|
140
141
|
const reason = `guardrail "${name}" threw: ${toErrorMessage(err)}`
|
|
141
|
-
log.error('Guardrail threw — failing closed', {
|
|
142
|
+
log.error('Guardrail threw — failing closed', {
|
|
143
|
+
'namzu.guardrail.name': name,
|
|
144
|
+
'exception.message': toErrorMessage(err),
|
|
145
|
+
})
|
|
142
146
|
return { action: 'block', reason }
|
|
143
147
|
}
|
|
144
148
|
}
|