@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
|
@@ -3,9 +3,9 @@ import { resolveContextWindow } from '../../../compaction/context-window.js';
|
|
|
3
3
|
import { extractFromAssistantMessage } from '../../../compaction/extractor.js';
|
|
4
4
|
import { AUTO_CONTINUATION_USER_MESSAGE } from '../../../constants/continuation.js';
|
|
5
5
|
import { DEFAULT_STRUCTURED_OUTPUT_RETRIES, STRUCTURED_OUTPUT_REPROMPT, } from '../../../constants/tools/index.js';
|
|
6
|
-
import { formatCompletionNotification } from '../../../gateway/completion-inbox.js';
|
|
7
6
|
import { renderSkillsSection } from '../../../persona/assembler.js';
|
|
8
|
-
import {
|
|
7
|
+
import { collectChatCompletion } from '../../../provider/collect-chat-completion.js';
|
|
8
|
+
import { formatCompletionNotification } from '../../../scheduler/completion-inbox.js';
|
|
9
9
|
import { GENAI, NAMZU, agentIterationSpanName, parentContext, } from '../../../telemetry/attributes.js';
|
|
10
10
|
import { getTracer } from '../../../telemetry/runtime-accessors.js';
|
|
11
11
|
import { STRUCTURED_OUTPUT_TOOL_NAME } from '../../../tools/builtins/structuredOutput.js';
|
|
@@ -13,8 +13,10 @@ import { DELEGATION_TIMEOUT_MS } from '../../../tools/coordinator/index.js';
|
|
|
13
13
|
import { createAssistantMessage, createSystemMessage, createUserMessage, } from '../../../types/message/index.js';
|
|
14
14
|
import { classifyProviderError } from '../../../types/provider/errors.js';
|
|
15
15
|
import { toErrorMessage } from '../../../utils/error.js';
|
|
16
|
+
import { stableDigest } from '../../../utils/hash.js';
|
|
16
17
|
import { generateMessageId } from '../../../utils/id.js';
|
|
17
18
|
import { applyLifecycleHookResults } from '../plugin-hooks.js';
|
|
19
|
+
import { formatSteeringNote } from '../steering.js';
|
|
18
20
|
import { runAdvisoryPhase } from './phases/advisory.js';
|
|
19
21
|
import { runIterationCheckpoint } from './phases/checkpoint.js';
|
|
20
22
|
import { measureContext, relieveOverflow, runCompactionCheck } from './phases/compaction.js';
|
|
@@ -92,6 +94,12 @@ export class IterationOrchestrator {
|
|
|
92
94
|
ctx;
|
|
93
95
|
/** Rejections so far. See {@link DEFAULT_ANSWER_REVIEW_LIMIT}. */
|
|
94
96
|
answerReviewAttempts = 0;
|
|
97
|
+
/**
|
|
98
|
+
* The last request envelope this run recorded, so an unchanged one
|
|
99
|
+
* costs a hash and no event. Per RUNNER, not module-level: two runs in
|
|
100
|
+
* one process must not suppress each other's first envelope.
|
|
101
|
+
*/
|
|
102
|
+
lastEnvelopeKey;
|
|
95
103
|
/**
|
|
96
104
|
* The previous iteration held a `stopWhen` decision open for a worker.
|
|
97
105
|
*
|
|
@@ -164,32 +172,51 @@ export class IterationOrchestrator {
|
|
|
164
172
|
const guardResult = this.ctx.guard.beforeIteration(runMgr, this.ctx.abortController.signal);
|
|
165
173
|
if (guardResult.shouldStop) {
|
|
166
174
|
if (guardResult.isCancelled) {
|
|
167
|
-
this.ctx.log.info('Run cancelled by signal', {
|
|
175
|
+
this.ctx.log.info('Run cancelled by signal', { [NAMZU.RUN_ID]: runMgr.id });
|
|
168
176
|
runMgr.setStopReason('cancelled');
|
|
169
177
|
runMgr.markCancelled();
|
|
170
178
|
break;
|
|
171
179
|
}
|
|
172
180
|
const stopReason = guardResult.stopReason ?? 'end_turn';
|
|
173
181
|
this.ctx.log.info('Guard enforcing stop', {
|
|
174
|
-
|
|
175
|
-
stopReason,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
182
|
+
[NAMZU.RUN_ID]: runMgr.id,
|
|
183
|
+
'namzu.runtime.stop_reason': stopReason,
|
|
184
|
+
[NAMZU.ITERATION]: runMgr.currentIteration,
|
|
185
|
+
'namzu.runtime.input_tokens': runMgr.tokenUsage.promptTokens,
|
|
186
|
+
'namzu.runtime.output_tokens': runMgr.tokenUsage.completionTokens,
|
|
179
187
|
});
|
|
180
188
|
await this.requestFinalResponse(model, stopReason);
|
|
181
189
|
yield* this.ctx.drainPending();
|
|
182
190
|
runMgr.setStopReason(stopReason);
|
|
183
191
|
break;
|
|
184
192
|
}
|
|
193
|
+
// Consulted here, after the guard and BEFORE the iteration is
|
|
194
|
+
// counted or the provider is called. `stopWhen` reads `steps`
|
|
195
|
+
// and so can only speak after the step it disliked has already
|
|
196
|
+
// run and been paid for; this is the seam a host with a live
|
|
197
|
+
// rate limit or a revoked tenant actually needs.
|
|
198
|
+
const veto = await this.beforeStep(runMgr.currentIteration + 1);
|
|
199
|
+
if (veto) {
|
|
200
|
+
// Namespaced. The un-namespaced keys elsewhere in this file are
|
|
201
|
+
// the frozen inventory LOG-22 exists to drain; a new call site
|
|
202
|
+
// has no reason to join it.
|
|
203
|
+
this.ctx.log.info('Step refused by beforeStep', {
|
|
204
|
+
[NAMZU.RUN_ID]: runMgr.id,
|
|
205
|
+
[NAMZU.ITERATION]: runMgr.currentIteration + 1,
|
|
206
|
+
'namzu.step.veto_reason': veto.reason,
|
|
207
|
+
});
|
|
208
|
+
runMgr.setLastError(`beforeStep refused the next step: ${veto.reason}`);
|
|
209
|
+
runMgr.setStopReason('step_refused');
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
185
212
|
const forceFinalize = guardResult.forceFinalize;
|
|
186
213
|
const iterationNum = runMgr.incrementIteration();
|
|
187
214
|
this.ctx.log.debug('Iteration started', {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
model,
|
|
191
|
-
forceFinalize,
|
|
192
|
-
|
|
215
|
+
[NAMZU.RUN_ID]: runMgr.id,
|
|
216
|
+
[NAMZU.ITERATION]: iterationNum,
|
|
217
|
+
[GENAI.REQUEST_MODEL]: model,
|
|
218
|
+
'namzu.runtime.force_finalize': forceFinalize,
|
|
219
|
+
'namzu.runtime.message_count': runMgr.messages.length,
|
|
193
220
|
});
|
|
194
221
|
const iterationActivity = this.ctx.activityStore.create({
|
|
195
222
|
type: 'llm_turn',
|
|
@@ -304,10 +331,73 @@ export class IterationOrchestrator {
|
|
|
304
331
|
// there is no length check here — a second guard for the same
|
|
305
332
|
// case is one more thing to keep in agreement with the first.
|
|
306
333
|
const stepSkills = step.skills ? renderSkillsSection([...step.skills]) : null;
|
|
307
|
-
|
|
334
|
+
// A supervision change rides the same ephemeral slot, and for
|
|
335
|
+
// the same reason: it applies to what happens next, not to the
|
|
336
|
+
// run's history. The model plans around how closely it is being
|
|
337
|
+
// watched — a run that silently stops asking a human leaves it
|
|
338
|
+
// batching destructive calls it expects to be reviewed, and one
|
|
339
|
+
// that silently starts leaves it waiting on permission nobody
|
|
340
|
+
// is left to give.
|
|
341
|
+
//
|
|
342
|
+
// Read-and-CLEAR, so it is said exactly once. Repeating it
|
|
343
|
+
// every iteration would read as supervision moving again on
|
|
344
|
+
// each turn.
|
|
345
|
+
const policyChange = this.ctx.takeApprovalPolicyChange?.();
|
|
346
|
+
const policyNotice = policyChange
|
|
347
|
+
? `Approval policy changed from "${policyChange.from}" to "${policyChange.to}" (${policyChange.reason}). Tool calls from here on are reviewed under the new policy.`
|
|
348
|
+
: null;
|
|
349
|
+
// State that changed during the run, reported once per turn.
|
|
350
|
+
// `turn` contributions land HERE and nowhere else: in the
|
|
351
|
+
// system prompt they would be cached for the run or read as
|
|
352
|
+
// a standing instruction, and either way the state they
|
|
353
|
+
// exist to report goes stale silently.
|
|
354
|
+
const turnSections = this.ctx.promptContributions?.render('turn', { iteration: iterationNum }) ?? [];
|
|
355
|
+
const stepPreamble = [step.system, stepSkills, policyNotice, ...turnSections]
|
|
356
|
+
.filter(Boolean)
|
|
357
|
+
.join('\n\n');
|
|
308
358
|
const messages = stepPreamble
|
|
309
359
|
? [...baseMessages, createSystemMessage(stepPreamble)]
|
|
310
360
|
: [...baseMessages];
|
|
361
|
+
// What the model is about to be ASKED, recorded when it
|
|
362
|
+
// changed. `run_started` carries one system prompt and tool
|
|
363
|
+
// schemas never reached the transcript at all — while
|
|
364
|
+
// `prepareStep` rewrites the system text, narrows the tool
|
|
365
|
+
// list or swaps the model, and a step's skills ride the
|
|
366
|
+
// ephemeral preamble above. So a transcript showed one
|
|
367
|
+
// question for a run that had asked several.
|
|
368
|
+
//
|
|
369
|
+
// Emitted only on a change: the digest is compared against
|
|
370
|
+
// the last one this run recorded, so the common case costs
|
|
371
|
+
// one hash and nothing else. Copying an unchanged system
|
|
372
|
+
// prompt every iteration is the fastest way to make a
|
|
373
|
+
// durable log too large to read.
|
|
374
|
+
const envelope = {
|
|
375
|
+
model: stepModel,
|
|
376
|
+
// Read off `messages`, which is what the request is actually
|
|
377
|
+
// built from — including the ephemeral preamble. Recomputing
|
|
378
|
+
// it from the run's history would describe a request nobody
|
|
379
|
+
// sent the moment the two diverge.
|
|
380
|
+
systemPrompt: messages
|
|
381
|
+
.filter((m) => m.role === 'system')
|
|
382
|
+
.map((m) => String(m.content))
|
|
383
|
+
.join('\n\n'),
|
|
384
|
+
toolNames: llmTools.map((t) => t.function.name),
|
|
385
|
+
// Over the SCHEMAS, sorted. A name list cannot see a tool
|
|
386
|
+
// whose schema body changed while its name did not, which
|
|
387
|
+
// is the change most likely to alter what the model does.
|
|
388
|
+
toolSchemaDigest: stableDigest([...llmTools].sort((a, b) => (a.function.name < b.function.name ? -1 : 1))),
|
|
389
|
+
};
|
|
390
|
+
const envelopeKey = stableDigest(envelope);
|
|
391
|
+
if (envelopeKey !== this.lastEnvelopeKey) {
|
|
392
|
+
this.lastEnvelopeKey = envelopeKey;
|
|
393
|
+
await this.ctx.emitEvent?.({
|
|
394
|
+
type: 'request_envelope',
|
|
395
|
+
runId: runMgr.id,
|
|
396
|
+
iteration: iterationNum,
|
|
397
|
+
...envelope,
|
|
398
|
+
toolNames: Object.freeze([...envelope.toolNames]),
|
|
399
|
+
});
|
|
400
|
+
}
|
|
311
401
|
if (this.ctx.pluginManager) {
|
|
312
402
|
const hookResults = await this.ctx.pluginManager.executeHooks('pre_llm_call', {
|
|
313
403
|
runId: runMgr.id,
|
|
@@ -436,15 +526,15 @@ export class IterationOrchestrator {
|
|
|
436
526
|
yield* this.ctx.drainPending();
|
|
437
527
|
}
|
|
438
528
|
this.ctx.log.debug('LLM response received', {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
529
|
+
[NAMZU.RUN_ID]: runMgr.id,
|
|
530
|
+
[NAMZU.ITERATION]: iterationNum,
|
|
531
|
+
'namzu.runtime.finish_reason': response.finishReason,
|
|
532
|
+
'namzu.runtime.has_content': response.message.content !== null && response.message.content.length > 0,
|
|
533
|
+
'namzu.runtime.tool_call_count': response.message.toolCalls?.length ?? 0,
|
|
534
|
+
[GENAI.USAGE_INPUT_TOKENS]: response.usage.promptTokens,
|
|
535
|
+
[GENAI.USAGE_OUTPUT_TOKENS]: response.usage.completionTokens,
|
|
536
|
+
'namzu.usage.total_tokens': runMgr.tokenUsage.totalTokens,
|
|
537
|
+
'namzu.runtime.total_cost': runMgr.costInfo.totalCost,
|
|
448
538
|
});
|
|
449
539
|
// The context figures ride with the spend figures because a
|
|
450
540
|
// surface showing one almost always wants the other — and
|
|
@@ -459,7 +549,7 @@ export class IterationOrchestrator {
|
|
|
459
549
|
const contextFigures = this.ctx.compactionConfig
|
|
460
550
|
? (() => {
|
|
461
551
|
const measured = measureContext(this.ctx);
|
|
462
|
-
const window = resolveContextWindow(this.ctx.compactionConfig?.contextWindowTokens, runConfig.model);
|
|
552
|
+
const window = resolveContextWindow(this.ctx.compactionConfig?.contextWindowTokens, runConfig.model, this.ctx.providerContextWindow);
|
|
463
553
|
return {
|
|
464
554
|
contextTokens: measured.tokens,
|
|
465
555
|
contextMeasuredBy: measured.source,
|
|
@@ -528,8 +618,8 @@ export class IterationOrchestrator {
|
|
|
528
618
|
// out. Log the orphans honestly and end the turn normally.
|
|
529
619
|
if (!forceFinalize && this.hasRunningAgentTasks()) {
|
|
530
620
|
this.ctx.log.warn('LLM ended turn with agent tasks still running — ending run without waiting (orphan tasks have no delivery path)', {
|
|
531
|
-
|
|
532
|
-
|
|
621
|
+
[NAMZU.RUN_ID]: runMgr.id,
|
|
622
|
+
[NAMZU.ITERATION]: iterationNum,
|
|
533
623
|
});
|
|
534
624
|
}
|
|
535
625
|
// This iteration gets a step too.
|
|
@@ -608,9 +698,9 @@ export class IterationOrchestrator {
|
|
|
608
698
|
// - max_iterations bounds the loop in any case.
|
|
609
699
|
if (!forceFinalize && response.finishReason === 'length' && hasContent) {
|
|
610
700
|
this.ctx.log.info('LLM hit max_tokens mid-text — auto-continuing', {
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
701
|
+
[NAMZU.RUN_ID]: runMgr.id,
|
|
702
|
+
[NAMZU.ITERATION]: iterationNum,
|
|
703
|
+
[GENAI.USAGE_OUTPUT_TOKENS]: response.usage.completionTokens,
|
|
614
704
|
});
|
|
615
705
|
runMgr.pushMessage(createUserMessage(AUTO_CONTINUATION_USER_MESSAGE));
|
|
616
706
|
await this.ctx.emitEvent({
|
|
@@ -632,16 +722,16 @@ export class IterationOrchestrator {
|
|
|
632
722
|
const limit = this.structuredOutputRetryLimit();
|
|
633
723
|
if (attempt > limit) {
|
|
634
724
|
this.ctx.log.warn('Structured output not produced within its retries', {
|
|
635
|
-
|
|
636
|
-
attempts: attempt - 1,
|
|
725
|
+
[NAMZU.RUN_ID]: runMgr.id,
|
|
726
|
+
'namzu.runtime.attempts': attempt - 1,
|
|
637
727
|
});
|
|
638
728
|
runMgr.setStopReason('structured_output_failed');
|
|
639
729
|
break;
|
|
640
730
|
}
|
|
641
731
|
this.ctx.log.info('Re-prompting for structured output', {
|
|
642
|
-
|
|
643
|
-
attempt,
|
|
644
|
-
limit,
|
|
732
|
+
[NAMZU.RUN_ID]: runMgr.id,
|
|
733
|
+
'namzu.retry.attempt': attempt,
|
|
734
|
+
'namzu.runtime.limit': limit,
|
|
645
735
|
});
|
|
646
736
|
runMgr.pushMessage(createUserMessage(STRUCTURED_OUTPUT_REPROMPT));
|
|
647
737
|
await this.ctx.emitEvent({
|
|
@@ -673,17 +763,17 @@ export class IterationOrchestrator {
|
|
|
673
763
|
const limit = this.ctx.maxAnswerReviews ?? DEFAULT_ANSWER_REVIEW_LIMIT;
|
|
674
764
|
if (attempt > limit) {
|
|
675
765
|
this.ctx.log.warn('Answer rejected more times than the run allows', {
|
|
676
|
-
|
|
677
|
-
attempts: attempt - 1,
|
|
678
|
-
limit,
|
|
766
|
+
[NAMZU.RUN_ID]: runMgr.id,
|
|
767
|
+
'namzu.runtime.attempts': attempt - 1,
|
|
768
|
+
'namzu.runtime.limit': limit,
|
|
679
769
|
});
|
|
680
770
|
runMgr.setStopReason('answer_rejected');
|
|
681
771
|
break;
|
|
682
772
|
}
|
|
683
773
|
this.ctx.log.info('Answer rejected — returning it to the model', {
|
|
684
|
-
|
|
685
|
-
attempt,
|
|
686
|
-
limit,
|
|
774
|
+
[NAMZU.RUN_ID]: runMgr.id,
|
|
775
|
+
'namzu.retry.attempt': attempt,
|
|
776
|
+
'namzu.runtime.limit': limit,
|
|
687
777
|
});
|
|
688
778
|
runMgr.pushMessage(createUserMessage(review.feedback));
|
|
689
779
|
await this.ctx.emitEvent({
|
|
@@ -705,10 +795,29 @@ export class IterationOrchestrator {
|
|
|
705
795
|
if (!forceFinalize && (yield* this.holdForOutstandingWork(iterationNum, false))) {
|
|
706
796
|
continue;
|
|
707
797
|
}
|
|
798
|
+
// Anything queued while this turn ran, on the path where
|
|
799
|
+
// there is no tool result to carry it. Without this the
|
|
800
|
+
// run settles with the channel still pending — which is
|
|
801
|
+
// the failure the steering channel's own test used to
|
|
802
|
+
// PIN as correct behaviour.
|
|
803
|
+
//
|
|
804
|
+
// After the outstanding-work hold above, so a delivery
|
|
805
|
+
// does not race a worker still finishing, and before the
|
|
806
|
+
// settle below, which is the last moment it can matter.
|
|
807
|
+
if (!forceFinalize && this.deliverInbound() > 0) {
|
|
808
|
+
await this.ctx.emitEvent({
|
|
809
|
+
type: 'iteration_completed',
|
|
810
|
+
runId: runMgr.id,
|
|
811
|
+
iteration: iterationNum,
|
|
812
|
+
hasToolCalls: false,
|
|
813
|
+
});
|
|
814
|
+
yield* this.ctx.drainPending();
|
|
815
|
+
continue;
|
|
816
|
+
}
|
|
708
817
|
if (!hasContent && !forceFinalize) {
|
|
709
818
|
this.ctx.log.warn('Empty completion detected — requesting final summary', {
|
|
710
|
-
|
|
711
|
-
|
|
819
|
+
[NAMZU.ITERATION]: iterationNum,
|
|
820
|
+
'namzu.runtime.finish_reason': response.finishReason,
|
|
712
821
|
});
|
|
713
822
|
await this.requestFinalResponse(model, 'end_turn');
|
|
714
823
|
yield* this.ctx.drainPending();
|
|
@@ -775,8 +884,8 @@ export class IterationOrchestrator {
|
|
|
775
884
|
// other calls, which relays instead. See the method.
|
|
776
885
|
if (this.captureStructuredOutput(reviewOutcome.results, response)) {
|
|
777
886
|
this.ctx.log.info('Structured output produced — ending run', {
|
|
778
|
-
|
|
779
|
-
|
|
887
|
+
[NAMZU.RUN_ID]: runMgr.id,
|
|
888
|
+
[NAMZU.ITERATION]: iterationNum,
|
|
780
889
|
});
|
|
781
890
|
runMgr.setStopReason('end_turn');
|
|
782
891
|
await this.ctx.emitEvent({
|
|
@@ -798,9 +907,9 @@ export class IterationOrchestrator {
|
|
|
798
907
|
const settled = this.terminalToolOutput(reviewOutcome.results, response);
|
|
799
908
|
if (settled !== undefined) {
|
|
800
909
|
this.ctx.log.info('Terminal tool produced the answer — ending run', {
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
910
|
+
[NAMZU.RUN_ID]: runMgr.id,
|
|
911
|
+
[NAMZU.ITERATION]: iterationNum,
|
|
912
|
+
[GENAI.TOOL_NAME]: settled.toolName,
|
|
804
913
|
});
|
|
805
914
|
runMgr.setResult(settled.output);
|
|
806
915
|
runMgr.setStopReason('end_turn');
|
|
@@ -842,8 +951,8 @@ export class IterationOrchestrator {
|
|
|
842
951
|
continue;
|
|
843
952
|
}
|
|
844
953
|
this.ctx.log.info('Stop condition met', {
|
|
845
|
-
|
|
846
|
-
|
|
954
|
+
[NAMZU.RUN_ID]: runMgr.id,
|
|
955
|
+
[NAMZU.ITERATION]: iterationNum,
|
|
847
956
|
});
|
|
848
957
|
runMgr.setStopReason('stop_condition');
|
|
849
958
|
await this.ctx.emitEvent({
|
|
@@ -881,12 +990,17 @@ export class IterationOrchestrator {
|
|
|
881
990
|
const unheard = this.ctx.completionInbox?.drain() ?? [];
|
|
882
991
|
if (unheard.length > 0) {
|
|
883
992
|
this.ctx.log.info('Delivering unawaited task completions', {
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
tasks: unheard.map((h) => h.taskId),
|
|
993
|
+
[NAMZU.RUN_ID]: runMgr.id,
|
|
994
|
+
[NAMZU.ITERATION]: iterationNum,
|
|
995
|
+
'namzu.runtime.tasks': unheard.map((h) => h.taskId),
|
|
887
996
|
});
|
|
888
997
|
runMgr.pushMessage(createUserMessage(formatCompletionNotification(unheard)));
|
|
889
998
|
}
|
|
999
|
+
// The same seam, for the two channels that could accept text
|
|
1000
|
+
// and never deliver it. Placed here rather than at the top of
|
|
1001
|
+
// the next iteration so a message queued during THIS turn is
|
|
1002
|
+
// in the history the next request is built from.
|
|
1003
|
+
this.deliverInbound();
|
|
890
1004
|
await runAdvisoryPhase(this.ctx, iterationNum, response);
|
|
891
1005
|
if (this.ctx.pluginManager) {
|
|
892
1006
|
const hookResults = await this.ctx.pluginManager.executeHooks('iteration_end', { runId: runMgr.id, iteration: iterationNum }, this.ctx.emitEvent);
|
|
@@ -941,9 +1055,9 @@ export class IterationOrchestrator {
|
|
|
941
1055
|
// followed it reaches the caller as the run's error.
|
|
942
1056
|
if (this.steps.at(-1)?.stepNumber === iterationNum) {
|
|
943
1057
|
this.ctx.log.warn('Iteration failed after its step was already recorded', {
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
1058
|
+
[NAMZU.RUN_ID]: runMgr.id,
|
|
1059
|
+
[NAMZU.ITERATION]: iterationNum,
|
|
1060
|
+
'exception.message': toErrorMessage(err),
|
|
947
1061
|
});
|
|
948
1062
|
}
|
|
949
1063
|
else {
|
|
@@ -1001,8 +1115,8 @@ export class IterationOrchestrator {
|
|
|
1001
1115
|
const shed = await relieveOverflow(this.ctx);
|
|
1002
1116
|
if (shed) {
|
|
1003
1117
|
this.ctx.log.info('Retrying the turn after relieving a context overflow', {
|
|
1004
|
-
|
|
1005
|
-
|
|
1118
|
+
[NAMZU.RUN_ID]: runMgr.id,
|
|
1119
|
+
[NAMZU.ITERATION]: iterationNum,
|
|
1006
1120
|
});
|
|
1007
1121
|
if (iterationActivity) {
|
|
1008
1122
|
this.ctx.activityStore.complete(iterationActivity.id);
|
|
@@ -1052,9 +1166,9 @@ export class IterationOrchestrator {
|
|
|
1052
1166
|
// must not open a wait against a reserve it has already entered.
|
|
1053
1167
|
const graceMs = settleGraceMs(this.ctx.guard.remainingBeforeFinalizeMs());
|
|
1054
1168
|
this.ctx.log.info('Holding the run open for a background task', {
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
graceMs,
|
|
1169
|
+
[NAMZU.RUN_ID]: this.ctx.runMgr.id,
|
|
1170
|
+
[NAMZU.ITERATION]: iterationNum,
|
|
1171
|
+
'namzu.runtime.grace_ms': graceMs,
|
|
1058
1172
|
});
|
|
1059
1173
|
await this.ctx.completionInbox.waitForArrival(graceMs);
|
|
1060
1174
|
const arrived = this.ctx.completionInbox.drain();
|
|
@@ -1104,8 +1218,8 @@ export class IterationOrchestrator {
|
|
|
1104
1218
|
if (abandoned.length === 0)
|
|
1105
1219
|
return;
|
|
1106
1220
|
this.ctx.log.warn('Run ended with delegated work still running', {
|
|
1107
|
-
|
|
1108
|
-
tasks: abandoned,
|
|
1221
|
+
[NAMZU.RUN_ID]: this.ctx.runMgr.id,
|
|
1222
|
+
'namzu.runtime.tasks': abandoned,
|
|
1109
1223
|
});
|
|
1110
1224
|
this.ctx.runMgr.setAbandonedTaskIds(abandoned);
|
|
1111
1225
|
}
|
|
@@ -1133,8 +1247,8 @@ export class IterationOrchestrator {
|
|
|
1133
1247
|
if (answer.length > 0)
|
|
1134
1248
|
this.ctx.runMgr.setResult(answer);
|
|
1135
1249
|
this.ctx.log.info('Delivering task completions the run would have settled over', {
|
|
1136
|
-
|
|
1137
|
-
tasks: unheard.map((h) => h.taskId),
|
|
1250
|
+
[NAMZU.RUN_ID]: this.ctx.runMgr.id,
|
|
1251
|
+
'namzu.runtime.tasks': unheard.map((h) => h.taskId),
|
|
1138
1252
|
});
|
|
1139
1253
|
this.ctx.runMgr.pushMessage(createUserMessage(formatCompletionNotification(unheard)));
|
|
1140
1254
|
}
|
|
@@ -1146,6 +1260,34 @@ export class IterationOrchestrator {
|
|
|
1146
1260
|
* otherwise healthy run, and unlike a safety check, nothing unsafe gets
|
|
1147
1261
|
* through when it is skipped.
|
|
1148
1262
|
*/
|
|
1263
|
+
/**
|
|
1264
|
+
* A host's chance to refuse the next model call.
|
|
1265
|
+
*
|
|
1266
|
+
* Fails CLOSED, which is the opposite of `prepareStep` below and the
|
|
1267
|
+
* reason they are separate hooks rather than one with two return
|
|
1268
|
+
* shapes. A broken step-SHAPER skipped costs a run its per-step tuning;
|
|
1269
|
+
* a broken step-REFUSER skipped is a refusal that did not happen, which
|
|
1270
|
+
* is precisely what the hook exists to prevent. The thrown error's
|
|
1271
|
+
* message becomes the reason, so an operator is not left with a run
|
|
1272
|
+
* that stopped and no account of it.
|
|
1273
|
+
*/
|
|
1274
|
+
async beforeStep(stepNumber) {
|
|
1275
|
+
const configured = this.ctx.beforeStep;
|
|
1276
|
+
if (!configured)
|
|
1277
|
+
return undefined;
|
|
1278
|
+
try {
|
|
1279
|
+
return ((await configured({
|
|
1280
|
+
runId: this.ctx.runMgr.id,
|
|
1281
|
+
stepNumber,
|
|
1282
|
+
messages: this.ctx.runMgr.messages,
|
|
1283
|
+
steps: this.steps,
|
|
1284
|
+
prepared: {},
|
|
1285
|
+
})) ?? undefined);
|
|
1286
|
+
}
|
|
1287
|
+
catch (err) {
|
|
1288
|
+
return { reason: `beforeStep threw: ${toErrorMessage(err)}` };
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1149
1291
|
async prepareStep(stepNumber) {
|
|
1150
1292
|
const configured = this.ctx.prepareStep;
|
|
1151
1293
|
if (!configured)
|
|
@@ -1172,9 +1314,9 @@ export class IterationOrchestrator {
|
|
|
1172
1314
|
// Skipped, and the rest still run: one broken concern must
|
|
1173
1315
|
// not silently disable the others it was declared beside.
|
|
1174
1316
|
this.ctx.log.error('a prepareStep stage threw — skipping it', {
|
|
1175
|
-
|
|
1176
|
-
stepNumber,
|
|
1177
|
-
|
|
1317
|
+
[NAMZU.RUN_ID]: this.ctx.runMgr.id,
|
|
1318
|
+
'namzu.runtime.step_number': stepNumber,
|
|
1319
|
+
'exception.message': toErrorMessage(err),
|
|
1178
1320
|
});
|
|
1179
1321
|
}
|
|
1180
1322
|
}
|
|
@@ -1198,10 +1340,10 @@ export class IterationOrchestrator {
|
|
|
1198
1340
|
? 'prepareStep named only tools that are not registered — this step can call nothing'
|
|
1199
1341
|
: 'prepareStep named tools that are not registered — ignoring them';
|
|
1200
1342
|
this.ctx.log.warn(message, {
|
|
1201
|
-
|
|
1202
|
-
stepNumber,
|
|
1203
|
-
unknown,
|
|
1204
|
-
remaining: known.length,
|
|
1343
|
+
[NAMZU.RUN_ID]: this.ctx.runMgr.id,
|
|
1344
|
+
'namzu.runtime.step_number': stepNumber,
|
|
1345
|
+
'namzu.runtime.unknown': unknown,
|
|
1346
|
+
'namzu.runtime.remaining': known.length,
|
|
1205
1347
|
});
|
|
1206
1348
|
}
|
|
1207
1349
|
prepared.allowedTools = known;
|
|
@@ -1234,6 +1376,32 @@ export class IterationOrchestrator {
|
|
|
1234
1376
|
* ITS usage rather than the run's running total, which is the number a
|
|
1235
1377
|
* caller asking "what did this step cost" actually wants.
|
|
1236
1378
|
*/
|
|
1379
|
+
/**
|
|
1380
|
+
* Take everything queued for this run since the last turn.
|
|
1381
|
+
*
|
|
1382
|
+
* Both channels drain here. `inboundMessages` is the manager's queue —
|
|
1383
|
+
* what `continueTask` and `queueMessage` push onto and nothing ever
|
|
1384
|
+
* collected. `steering` is the host's, and it could only ride on a tool
|
|
1385
|
+
* result, so guidance queued during a turn that called no tools stayed
|
|
1386
|
+
* pending until the run ended.
|
|
1387
|
+
*
|
|
1388
|
+
* Returns the count so a caller can decide whether a turn is owed. An
|
|
1389
|
+
* empty drain must change nothing at all: a `continue` on nothing queued
|
|
1390
|
+
* spends an iteration and a model call to say the same thing again.
|
|
1391
|
+
*/
|
|
1392
|
+
deliverInbound() {
|
|
1393
|
+
const queued = this.ctx.inboundMessages?.() ?? [];
|
|
1394
|
+
for (const message of queued)
|
|
1395
|
+
this.ctx.runMgr.pushMessage(message);
|
|
1396
|
+
// The steering channel's remainder. `attachSteering` already took
|
|
1397
|
+
// what it could carry on a tool result; anything still pending is
|
|
1398
|
+
// guidance from a turn that had no result to attach it to.
|
|
1399
|
+
const stranded = this.ctx.steering?.drain();
|
|
1400
|
+
if (stranded) {
|
|
1401
|
+
this.ctx.runMgr.pushMessage(createUserMessage(formatSteeringNote(stranded)));
|
|
1402
|
+
}
|
|
1403
|
+
return queued.length + (stranded ? 1 : 0);
|
|
1404
|
+
}
|
|
1237
1405
|
recordStep(input) {
|
|
1238
1406
|
const { runMgr } = this.ctx;
|
|
1239
1407
|
const toolCalls = input.response?.message.toolCalls ?? [];
|
|
@@ -1300,9 +1468,9 @@ export class IterationOrchestrator {
|
|
|
1300
1468
|
}
|
|
1301
1469
|
catch (err) {
|
|
1302
1470
|
this.ctx.log.warn('onStepFinish threw while recording a failed step', {
|
|
1303
|
-
|
|
1304
|
-
step: input.stepNumber,
|
|
1305
|
-
|
|
1471
|
+
[NAMZU.RUN_ID]: runMgr.id,
|
|
1472
|
+
'namzu.runtime.step': input.stepNumber,
|
|
1473
|
+
'exception.message': toErrorMessage(err),
|
|
1306
1474
|
});
|
|
1307
1475
|
}
|
|
1308
1476
|
}
|
|
@@ -1335,17 +1503,17 @@ export class IterationOrchestrator {
|
|
|
1335
1503
|
const callCount = response.message.toolCalls?.length ?? 0;
|
|
1336
1504
|
if (callCount > 1) {
|
|
1337
1505
|
this.ctx.log.info('Terminal tool shared its turn — relaying instead of settling', {
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1506
|
+
[NAMZU.RUN_ID]: this.ctx.runMgr.id,
|
|
1507
|
+
[GENAI.TOOL_NAME]: terminal[0]?.toolName,
|
|
1508
|
+
'namzu.runtime.calls_in_turn': callCount,
|
|
1341
1509
|
});
|
|
1342
1510
|
return undefined;
|
|
1343
1511
|
}
|
|
1344
1512
|
const hit = terminal[0];
|
|
1345
1513
|
if (!hit || hit.isError) {
|
|
1346
1514
|
this.ctx.log.info('Terminal tool failed — returning the error to the model', {
|
|
1347
|
-
|
|
1348
|
-
|
|
1515
|
+
[NAMZU.RUN_ID]: this.ctx.runMgr.id,
|
|
1516
|
+
[GENAI.TOOL_NAME]: hit?.toolName,
|
|
1349
1517
|
});
|
|
1350
1518
|
return undefined;
|
|
1351
1519
|
}
|
|
@@ -1404,8 +1572,8 @@ export class IterationOrchestrator {
|
|
|
1404
1572
|
const callCount = response.message.toolCalls?.length ?? 0;
|
|
1405
1573
|
if (callCount > 1) {
|
|
1406
1574
|
this.ctx.log.info('Structured output shared its turn — relaying instead of settling', {
|
|
1407
|
-
|
|
1408
|
-
|
|
1575
|
+
[NAMZU.RUN_ID]: this.ctx.runMgr.id,
|
|
1576
|
+
'namzu.runtime.calls_in_turn': callCount,
|
|
1409
1577
|
});
|
|
1410
1578
|
return false;
|
|
1411
1579
|
}
|
|
@@ -1444,8 +1612,8 @@ export class IterationOrchestrator {
|
|
|
1444
1612
|
}
|
|
1445
1613
|
catch (err) {
|
|
1446
1614
|
this.ctx.log.error('Answer review threw — accepting the answer unreviewed', {
|
|
1447
|
-
|
|
1448
|
-
|
|
1615
|
+
[NAMZU.RUN_ID]: this.ctx.runMgr.id,
|
|
1616
|
+
'exception.message': toErrorMessage(err),
|
|
1449
1617
|
});
|
|
1450
1618
|
return { accept: true };
|
|
1451
1619
|
}
|
|
@@ -1468,8 +1636,8 @@ export class IterationOrchestrator {
|
|
|
1468
1636
|
// A throwing predicate must not kill a run that is otherwise
|
|
1469
1637
|
// healthy; failing open keeps the existing budgets in charge.
|
|
1470
1638
|
this.ctx.log.error('Stop condition threw — continuing the run', {
|
|
1471
|
-
|
|
1472
|
-
|
|
1639
|
+
[NAMZU.RUN_ID]: this.ctx.runMgr.id,
|
|
1640
|
+
'exception.message': toErrorMessage(err),
|
|
1473
1641
|
});
|
|
1474
1642
|
return false;
|
|
1475
1643
|
}
|
|
@@ -1491,7 +1659,7 @@ export class IterationOrchestrator {
|
|
|
1491
1659
|
if (hasResult)
|
|
1492
1660
|
return;
|
|
1493
1661
|
this.ctx.log.info('Requesting final response before limit enforcement', {
|
|
1494
|
-
reason,
|
|
1662
|
+
'namzu.runtime.reason': reason,
|
|
1495
1663
|
});
|
|
1496
1664
|
try {
|
|
1497
1665
|
const finalMessages = [
|
|
@@ -1503,7 +1671,7 @@ export class IterationOrchestrator {
|
|
|
1503
1671
|
// no 400 on tool blocks in history) and forbid use via tool_choice.
|
|
1504
1672
|
const finalTools = this.ctx.tools.toLLMTools(this.ctx.allowedTools);
|
|
1505
1673
|
const finalEnforced = enforcedModelInputToolNames(this.ctx.tools, finalTools);
|
|
1506
|
-
const response = await
|
|
1674
|
+
const response = await collectChatCompletion(this.ctx.provider.chatStream({
|
|
1507
1675
|
model,
|
|
1508
1676
|
messages: finalMessages,
|
|
1509
1677
|
tools: finalTools.length > 0 ? finalTools : undefined,
|
|
@@ -1546,7 +1714,7 @@ export class IterationOrchestrator {
|
|
|
1546
1714
|
}
|
|
1547
1715
|
catch (err) {
|
|
1548
1716
|
this.ctx.log.error('Failed to get final response', {
|
|
1549
|
-
|
|
1717
|
+
'exception.message': toErrorMessage(err),
|
|
1550
1718
|
});
|
|
1551
1719
|
}
|
|
1552
1720
|
}
|