@namzu/sdk 27.1.0 → 29.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 +1757 -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 -6
- 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 -16
- 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 +107 -36
- 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 +46 -46
- package/dist/contracts/api.d.ts +12 -1
- package/dist/contracts/api.d.ts.map +1 -1
- 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 -15
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +168 -17
- 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 +124 -16
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +372 -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 +8 -4
- package/dist/session/handoff/broadcast.d.ts.map +1 -1
- package/dist/session/handoff/broadcast.js +8 -9
- package/dist/session/handoff/broadcast.js.map +1 -1
- package/dist/session/handoff/index.d.ts +1 -1
- package/dist/session/handoff/index.d.ts.map +1 -1
- package/dist/session/handoff/index.js +1 -1
- package/dist/session/handoff/index.js.map +1 -1
- package/dist/session/handoff/single.d.ts +11 -7
- package/dist/session/handoff/single.d.ts.map +1 -1
- package/dist/session/handoff/single.js +5 -11
- 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 +39 -19
- package/dist/session/migration/id-prefix.d.ts.map +1 -1
- package/dist/session/migration/id-prefix.js +43 -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 +13 -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/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 +19 -3
- package/dist/types/agent/reactive.d.ts.map +1 -1
- package/dist/types/agent/{gateway.d.ts → scheduler.d.ts} +31 -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 +13 -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/{verification → authorization}/index.d.ts +68 -12
- package/dist/types/authorization/index.d.ts.map +1 -0
- package/dist/types/authorization/index.js +99 -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 +11 -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 +83 -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 +8 -8
- 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 +23 -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 +1 -1
- package/dist/types/session/ids.d.ts.map +1 -1
- package/dist/types/session/index.d.ts +2 -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 +44 -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 +82 -2
- package/dist/utils/id.d.ts.map +1 -1
- package/dist/utils/id.js +104 -4
- 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 -14
- package/src/agents/RouterAgent.ts +33 -21
- package/src/agents/SupervisorAgent.ts +46 -28
- 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/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 +15 -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 +371 -18
- 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 +539 -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 +16 -12
- package/src/session/handoff/index.ts +1 -1
- package/src/session/handoff/single.ts +16 -17
- package/src/session/migration/filesystem.ts +46 -2
- package/src/session/migration/id-prefix.ts +47 -22
- package/src/session/migration/index.ts +5 -2
- package/src/session/migration/marker.ts +19 -4
- package/src/session/retention/archive.ts +19 -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 +22 -3
- package/src/types/agent/{gateway.ts → scheduler.ts} +30 -4
- package/src/types/agent/supervisor.ts +15 -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 +69 -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 +17 -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 +94 -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 +24 -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 +1 -1
- package/src/types/session/index.ts +1 -1
- package/src/types/session/store.ts +53 -22
- package/src/types/session/sub-session.ts +45 -16
- 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 +163 -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.map +0 -1
- package/dist/types/verification/index.js +0 -53
- package/dist/types/verification/index.js.map +0 -1
- package/dist/verification/gate.d.ts.map +0 -1
- package/dist/verification/gate.js.map +0 -1
- package/dist/verification/index.d.ts +0 -4
- package/dist/verification/index.d.ts.map +0 -1
- package/dist/verification/index.js +0 -4
- package/dist/verification/index.js.map +0 -1
- package/dist/verification/presets.d.ts.map +0 -1
- package/dist/verification/presets.js.map +0 -1
- package/dist/verification/rules.d.ts +0 -4
- package/dist/verification/rules.d.ts.map +0 -1
- package/dist/verification/rules.js.map +0 -1
- package/src/connector/execution/index.ts +0 -5
- package/src/manager/thread/lifecycle.ts +0 -217
- package/src/store/thread/disk.ts +0 -272
- package/src/store/thread/index.ts +0 -7
- package/src/store/thread/memory.ts +0 -104
- package/src/types/thread/index.ts +0 -6
- package/src/types/thread/store.ts +0 -92
- package/src/verification/index.ts +0 -3
- /package/dist/{bridge/tools/connector → connector/tools}/index.d.ts +0 -0
- /package/dist/{bridge/tools/connector → connector/tools}/index.js +0 -0
- /package/dist/constants/{verification → authorization}/index.d.ts +0 -0
- /package/dist/constants/{verification → authorization}/index.js +0 -0
- /package/dist/{router → model-router}/task-router.d.ts +0 -0
- /package/dist/{router → model-router}/task-router.js +0 -0
- /package/dist/types/{thread → topic}/entity.js +0 -0
- /package/src/{bridge/tools/connector → connector/tools}/index.ts +0 -0
- /package/src/constants/{verification → authorization}/index.ts +0 -0
- /package/src/{router → model-router}/task-router.ts +0 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { AgentRuntimeContext } from '../types/agent/base.js';
|
|
2
|
+
import type { Skill } from '../types/skills/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* A seam for putting something in the system prompt.
|
|
5
|
+
*
|
|
6
|
+
* The prompt was closed. `PromptBuilder` assembled a fixed list — base
|
|
7
|
+
* prompt, persona or system prompt, skills, tool section, tier guidance,
|
|
8
|
+
* environment — and every one of those was a branch written into the
|
|
9
|
+
* builder. A capability that needed the model to know something (web tools
|
|
10
|
+
* and their citation rules, a plugin's conventions, a host's house style)
|
|
11
|
+
* had exactly two options: convince somebody to add a branch, or splice it
|
|
12
|
+
* into `systemPrompt` and lose whatever was there.
|
|
13
|
+
*
|
|
14
|
+
* Skills is the first contributor through this seam, and deliberately so:
|
|
15
|
+
* it was already a special case in four places in the builder, so making it
|
|
16
|
+
* one is the smallest change that proves the seam carries a real one rather
|
|
17
|
+
* than a shape invented to fit.
|
|
18
|
+
*/
|
|
19
|
+
export interface PromptContributionContext {
|
|
20
|
+
readonly workingDirectory?: string;
|
|
21
|
+
readonly runtimeContext?: AgentRuntimeContext;
|
|
22
|
+
readonly skills?: readonly Skill[];
|
|
23
|
+
/** The tools this turn may call, if the turn was narrowed. */
|
|
24
|
+
readonly allowedTools?: readonly string[];
|
|
25
|
+
/**
|
|
26
|
+
* Which iteration this is, 1-based — present only for `turn`.
|
|
27
|
+
*
|
|
28
|
+
* Absent for `static` and `dynamic`, and that absence is the type
|
|
29
|
+
* saying what the placement means: a contribution that needs to know
|
|
30
|
+
* which turn it is cannot be part of a prompt assembled once and
|
|
31
|
+
* cached.
|
|
32
|
+
*/
|
|
33
|
+
readonly iteration?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Which half of the prompt this lands in.
|
|
37
|
+
*
|
|
38
|
+
* Not cosmetic, and the wrong answer is expensive in a way nothing reports.
|
|
39
|
+
* `static` is the segment the prompt cache keeps and a provider caches
|
|
40
|
+
* across turns; `dynamic` is re-sent every iteration. A contributor whose
|
|
41
|
+
* text varies per turn but declares `static` either invalidates the cached
|
|
42
|
+
* prefix on every iteration — paying full price for a cache that never
|
|
43
|
+
* hits — or, worse, gets served the first turn's text forever.
|
|
44
|
+
*
|
|
45
|
+
* The rule: `static` iff the output depends only on things that cannot
|
|
46
|
+
* change inside one run.
|
|
47
|
+
*/
|
|
48
|
+
export type PromptPlacement = 'static' | 'dynamic' | 'turn';
|
|
49
|
+
/**
|
|
50
|
+
* `turn` is a third thing, not a looser `dynamic`.
|
|
51
|
+
*
|
|
52
|
+
* `static` and `dynamic` are both parts of the SYSTEM PROMPT: assembled
|
|
53
|
+
* once per request, sent as system messages, and — for `static` — cached by
|
|
54
|
+
* the provider across turns. `turn` is not in the system prompt at all. It
|
|
55
|
+
* rides the ephemeral trailing message that a step's guidance, its skills
|
|
56
|
+
* and the approval-policy notice already use: appended to the request,
|
|
57
|
+
* never pushed onto the run's history, and gone the moment the request is
|
|
58
|
+
* sent.
|
|
59
|
+
*
|
|
60
|
+
* That is the placement for state that changes DURING a run — a budget
|
|
61
|
+
* running down, a queue draining, a policy that just moved. Putting such a
|
|
62
|
+
* thing in `static` serves the first iteration's value forever; putting it
|
|
63
|
+
* in `dynamic` re-sends it in a position the model reads as part of its
|
|
64
|
+
* standing instructions rather than as a status.
|
|
65
|
+
*
|
|
66
|
+
* The cost of `turn` is real and worth stating: every iteration pays for it
|
|
67
|
+
* in tokens, and it lands after the cached prefix so it cannot be cached.
|
|
68
|
+
* The approval-policy notice is the shape to copy — it returns text only
|
|
69
|
+
* when something actually changed, and `null` on every other turn.
|
|
70
|
+
*/
|
|
71
|
+
export interface PromptContribution {
|
|
72
|
+
/**
|
|
73
|
+
* Stable and unique. Registration refuses a duplicate rather than
|
|
74
|
+
* letting the second silently win, because "my guidance stopped
|
|
75
|
+
* appearing" is the least debuggable failure this registry could have.
|
|
76
|
+
*/
|
|
77
|
+
readonly id: string;
|
|
78
|
+
readonly placement: PromptPlacement;
|
|
79
|
+
/** `null` for "nothing to say this time", which is not an error. */
|
|
80
|
+
render(context: PromptContributionContext): string | null;
|
|
81
|
+
}
|
|
82
|
+
/** Two contributions claiming one id. */
|
|
83
|
+
export declare class PromptContributionCollisionError extends Error {
|
|
84
|
+
readonly details: {
|
|
85
|
+
id: string;
|
|
86
|
+
};
|
|
87
|
+
constructor(details: {
|
|
88
|
+
id: string;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* What goes in the prompt beyond what the builder knows about.
|
|
93
|
+
*
|
|
94
|
+
* Registration order is the rendering order, and that is the contract: an
|
|
95
|
+
* ordering derived from something else — priority numbers, id sort — would
|
|
96
|
+
* have every contributor arguing about a number, and the prompt is read
|
|
97
|
+
* top to bottom by a model that weights early text more.
|
|
98
|
+
*/
|
|
99
|
+
export declare class PromptContributionRegistry {
|
|
100
|
+
private readonly byId;
|
|
101
|
+
register(contribution: PromptContribution): void;
|
|
102
|
+
/** Replace one already registered, for a host that owns both. */
|
|
103
|
+
replace(contribution: PromptContribution): void;
|
|
104
|
+
has(id: string): boolean;
|
|
105
|
+
/** In registration order. */
|
|
106
|
+
list(): readonly PromptContribution[];
|
|
107
|
+
/**
|
|
108
|
+
* Every contribution for one placement, rendered, with the empty ones
|
|
109
|
+
* dropped.
|
|
110
|
+
*
|
|
111
|
+
* Dropping `null` here rather than at each call site is the point: a
|
|
112
|
+
* contributor that has nothing to say this turn must not leave a blank
|
|
113
|
+
* section behind, and four separate `if (x) parts.push(x)` sites is four
|
|
114
|
+
* chances for one of them to forget.
|
|
115
|
+
*/
|
|
116
|
+
render(placement: PromptPlacement, context: PromptContributionContext): readonly string[];
|
|
117
|
+
}
|
|
118
|
+
/** The id the built-in skills contribution registers under. */
|
|
119
|
+
export declare const SKILLS_CONTRIBUTION_ID = "namzu.skills";
|
|
120
|
+
/**
|
|
121
|
+
* Skills, as a contribution.
|
|
122
|
+
*
|
|
123
|
+
* `static`, because a run's skill set is fixed for the run — a STEP's
|
|
124
|
+
* skills are a different thing entirely and ride the ephemeral trailing
|
|
125
|
+
* system message, which is what keeps them out of the cached prefix.
|
|
126
|
+
*
|
|
127
|
+
* The persona path does not use this. `assembleSystemPrompt(persona,
|
|
128
|
+
* skills)` renders skills INSIDE the persona's own section ordering, which
|
|
129
|
+
* is a persona-assembler decision about where skills belong relative to
|
|
130
|
+
* constraints and output discipline. Moving it out here would silently
|
|
131
|
+
* reorder every persona-driven prompt in the estate to buy uniformity
|
|
132
|
+
* nobody asked for. So this contribution serves the branches that render
|
|
133
|
+
* skills standalone, and the persona branch keeps its own — stated here
|
|
134
|
+
* because two renderers for one concept is exactly the kind of thing that
|
|
135
|
+
* looks like an oversight later.
|
|
136
|
+
*/
|
|
137
|
+
export declare const skillsContribution: PromptContribution;
|
|
138
|
+
//# sourceMappingURL=contributions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contributions.d.ts","sourceRoot":"","sources":["../../src/prompt/contributions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAErD;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAClC,QAAQ,CAAC,cAAc,CAAC,EAAE,mBAAmB,CAAA;IAC7C,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,KAAK,EAAE,CAAA;IAClC,8DAA8D;IAC9D,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACzC;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAA;AAE3D;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,WAAW,kBAAkB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAA;IACnC,oEAAoE;IACpE,MAAM,CAAC,OAAO,EAAE,yBAAyB,GAAG,MAAM,GAAG,IAAI,CAAA;CACzD;AAED,yCAAyC;AACzC,qBAAa,gCAAiC,SAAQ,KAAK;IAC1D,QAAQ,CAAC,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;gBAEpB,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE;CAKnC;AAED;;;;;;;GAOG;AACH,qBAAa,0BAA0B;IACtC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAwC;IAE7D,QAAQ,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI;IAOhD,iEAAiE;IACjE,OAAO,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI;IAI/C,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIxB,6BAA6B;IAC7B,IAAI,IAAI,SAAS,kBAAkB,EAAE;IAIrC;;;;;;;;OAQG;IACH,MAAM,CAAC,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,yBAAyB,GAAG,SAAS,MAAM,EAAE;CAMzF;AAED,+DAA+D;AAC/D,eAAO,MAAM,sBAAsB,iBAAiB,CAAA;AAEpD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAIhC,CAAA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { renderSkillsSection } from '../persona/assembler.js';
|
|
2
|
+
/** Two contributions claiming one id. */
|
|
3
|
+
export class PromptContributionCollisionError extends Error {
|
|
4
|
+
details;
|
|
5
|
+
constructor(details) {
|
|
6
|
+
super(`A prompt contribution with id "${details.id}" is already registered.`);
|
|
7
|
+
this.name = 'PromptContributionCollisionError';
|
|
8
|
+
this.details = details;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* What goes in the prompt beyond what the builder knows about.
|
|
13
|
+
*
|
|
14
|
+
* Registration order is the rendering order, and that is the contract: an
|
|
15
|
+
* ordering derived from something else — priority numbers, id sort — would
|
|
16
|
+
* have every contributor arguing about a number, and the prompt is read
|
|
17
|
+
* top to bottom by a model that weights early text more.
|
|
18
|
+
*/
|
|
19
|
+
export class PromptContributionRegistry {
|
|
20
|
+
byId = new Map();
|
|
21
|
+
register(contribution) {
|
|
22
|
+
if (this.byId.has(contribution.id)) {
|
|
23
|
+
throw new PromptContributionCollisionError({ id: contribution.id });
|
|
24
|
+
}
|
|
25
|
+
this.byId.set(contribution.id, contribution);
|
|
26
|
+
}
|
|
27
|
+
/** Replace one already registered, for a host that owns both. */
|
|
28
|
+
replace(contribution) {
|
|
29
|
+
this.byId.set(contribution.id, contribution);
|
|
30
|
+
}
|
|
31
|
+
has(id) {
|
|
32
|
+
return this.byId.has(id);
|
|
33
|
+
}
|
|
34
|
+
/** In registration order. */
|
|
35
|
+
list() {
|
|
36
|
+
return [...this.byId.values()];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Every contribution for one placement, rendered, with the empty ones
|
|
40
|
+
* dropped.
|
|
41
|
+
*
|
|
42
|
+
* Dropping `null` here rather than at each call site is the point: a
|
|
43
|
+
* contributor that has nothing to say this turn must not leave a blank
|
|
44
|
+
* section behind, and four separate `if (x) parts.push(x)` sites is four
|
|
45
|
+
* chances for one of them to forget.
|
|
46
|
+
*/
|
|
47
|
+
render(placement, context) {
|
|
48
|
+
return this.list()
|
|
49
|
+
.filter((contribution) => contribution.placement === placement)
|
|
50
|
+
.map((contribution) => contribution.render(context))
|
|
51
|
+
.filter((text) => typeof text === 'string' && text.trim().length > 0);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/** The id the built-in skills contribution registers under. */
|
|
55
|
+
export const SKILLS_CONTRIBUTION_ID = 'namzu.skills';
|
|
56
|
+
/**
|
|
57
|
+
* Skills, as a contribution.
|
|
58
|
+
*
|
|
59
|
+
* `static`, because a run's skill set is fixed for the run — a STEP's
|
|
60
|
+
* skills are a different thing entirely and ride the ephemeral trailing
|
|
61
|
+
* system message, which is what keeps them out of the cached prefix.
|
|
62
|
+
*
|
|
63
|
+
* The persona path does not use this. `assembleSystemPrompt(persona,
|
|
64
|
+
* skills)` renders skills INSIDE the persona's own section ordering, which
|
|
65
|
+
* is a persona-assembler decision about where skills belong relative to
|
|
66
|
+
* constraints and output discipline. Moving it out here would silently
|
|
67
|
+
* reorder every persona-driven prompt in the estate to buy uniformity
|
|
68
|
+
* nobody asked for. So this contribution serves the branches that render
|
|
69
|
+
* skills standalone, and the persona branch keeps its own — stated here
|
|
70
|
+
* because two renderers for one concept is exactly the kind of thing that
|
|
71
|
+
* looks like an oversight later.
|
|
72
|
+
*/
|
|
73
|
+
export const skillsContribution = {
|
|
74
|
+
id: SKILLS_CONTRIBUTION_ID,
|
|
75
|
+
placement: 'static',
|
|
76
|
+
render: (context) => renderSkillsSection(context.skills ? [...context.skills] : undefined),
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=contributions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contributions.js","sourceRoot":"","sources":["../../src/prompt/contributions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAwF7D,yCAAyC;AACzC,MAAM,OAAO,gCAAiC,SAAQ,KAAK;IACjD,OAAO,CAAgB;IAEhC,YAAY,OAAuB;QAClC,KAAK,CAAC,kCAAkC,OAAO,CAAC,EAAE,0BAA0B,CAAC,CAAA;QAC7E,IAAI,CAAC,IAAI,GAAG,kCAAkC,CAAA;QAC9C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACvB,CAAC;CACD;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,0BAA0B;IACrB,IAAI,GAAG,IAAI,GAAG,EAA8B,CAAA;IAE7D,QAAQ,CAAC,YAAgC;QACxC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC;YACpC,MAAM,IAAI,gCAAgC,CAAC,EAAE,EAAE,EAAE,YAAY,CAAC,EAAE,EAAE,CAAC,CAAA;QACpE,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,EAAE,YAAY,CAAC,CAAA;IAC7C,CAAC;IAED,iEAAiE;IACjE,OAAO,CAAC,YAAgC;QACvC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,EAAE,YAAY,CAAC,CAAA;IAC7C,CAAC;IAED,GAAG,CAAC,EAAU;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IACzB,CAAC;IAED,6BAA6B;IAC7B,IAAI;QACH,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IAC/B,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,SAA0B,EAAE,OAAkC;QACpE,OAAO,IAAI,CAAC,IAAI,EAAE;aAChB,MAAM,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,SAAS,KAAK,SAAS,CAAC;aAC9D,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;aACnD,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IACvF,CAAC;CACD;AAED,+DAA+D;AAC/D,MAAM,CAAC,MAAM,sBAAsB,GAAG,cAAc,CAAA;AAEpD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAuB;IACrD,EAAE,EAAE,sBAAsB;IAC1B,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,mBAAmB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;CAC1F,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { PromptContributionCollisionError, PromptContributionRegistry, SKILLS_CONTRIBUTION_ID, skillsContribution, } from './contributions.js';
|
|
2
|
+
export type { PromptContribution, PromptContributionContext, PromptPlacement, } from './contributions.js';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompt/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACN,gCAAgC,EAChC,0BAA0B,EAC1B,sBAAsB,EACtB,kBAAkB,GAClB,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EACX,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,GACf,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// A seam for putting something in the system prompt. The prompt was closed:
|
|
2
|
+
// every section was a branch inside `PromptBuilder`, so a capability that
|
|
3
|
+
// needed the model to know something had to argue for a branch or splice
|
|
4
|
+
// into `systemPrompt` and lose whatever was there.
|
|
5
|
+
export { PromptContributionCollisionError, PromptContributionRegistry, SKILLS_CONTRIBUTION_ID, skillsContribution, } from './contributions.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompt/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,0EAA0E;AAC1E,yEAAyE;AACzE,mDAAmD;AACnD,OAAO,EACN,gCAAgC,EAChC,0BAA0B,EAC1B,sBAAsB,EACtB,kBAAkB,GAClB,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who is calling, said once.
|
|
3
|
+
*
|
|
4
|
+
* No driver identified this kernel to a provider. The only user-agent
|
|
5
|
+
* anywhere was on one OAuth code path, set so a token-exchange endpoint
|
|
6
|
+
* would accept the request — that is load-bearing impersonation, not
|
|
7
|
+
* attribution, and it must not be touched.
|
|
8
|
+
*
|
|
9
|
+
* What attribution buys is not vanity. A provider reading its own logs can
|
|
10
|
+
* tell a kernel's traffic from a browser's; a rate-limit or an abuse
|
|
11
|
+
* investigation lands on the right party; and a driver bug reported by a
|
|
12
|
+
* vendor arrives with something to search for. None of that is possible
|
|
13
|
+
* from an unlabelled request.
|
|
14
|
+
*
|
|
15
|
+
* ## One header, and only one
|
|
16
|
+
*
|
|
17
|
+
* Every additional header is a thing a proxy may strip, a vendor may
|
|
18
|
+
* reject, and a reader has to reconcile. The helper returns exactly one
|
|
19
|
+
* key and a test asserts the count — a driver wanting to send something of
|
|
20
|
+
* its own sends it at its own seam rather than growing this.
|
|
21
|
+
*/
|
|
22
|
+
export interface AppIdentity {
|
|
23
|
+
/** Product name, as it should appear in a vendor's logs. */
|
|
24
|
+
readonly product: string;
|
|
25
|
+
/** Version of the product. Read, never hand-copied. */
|
|
26
|
+
readonly version: string;
|
|
27
|
+
/** Where a vendor can find out what this is. */
|
|
28
|
+
readonly url: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* `version` comes from `VERSION`, which is read from the package manifest
|
|
32
|
+
* — a hand-copied literal here would be wrong from the first release after
|
|
33
|
+
* somebody forgot it, and wrong in the one place a vendor is reading to
|
|
34
|
+
* decide which build has the bug.
|
|
35
|
+
*/
|
|
36
|
+
export declare const NAMZU_APP_IDENTITY: AppIdentity;
|
|
37
|
+
/**
|
|
38
|
+
* The single header a driver merges at its own seam.
|
|
39
|
+
*
|
|
40
|
+
* Pure, and takes the identity as an argument, so a host embedding this
|
|
41
|
+
* kernel in its own product can say so — and so a driver cannot hardcode
|
|
42
|
+
* the constant and quietly ignore what the host asked for.
|
|
43
|
+
*/
|
|
44
|
+
export declare function attributionHeaders(identity?: AppIdentity): Record<string, string>;
|
|
45
|
+
//# sourceMappingURL=attribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribution.d.ts","sourceRoot":"","sources":["../../src/provider/attribution.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,WAAW,WAAW;IAC3B,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,gDAAgD;IAChD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CACpB;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAIhC,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CACjC,QAAQ,GAAE,WAAgC,GACxC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAExB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { VERSION } from '../version.js';
|
|
2
|
+
/**
|
|
3
|
+
* `version` comes from `VERSION`, which is read from the package manifest
|
|
4
|
+
* — a hand-copied literal here would be wrong from the first release after
|
|
5
|
+
* somebody forgot it, and wrong in the one place a vendor is reading to
|
|
6
|
+
* decide which build has the bug.
|
|
7
|
+
*/
|
|
8
|
+
export const NAMZU_APP_IDENTITY = {
|
|
9
|
+
product: 'namzu',
|
|
10
|
+
version: VERSION,
|
|
11
|
+
url: 'https://github.com/cogitave/namzu',
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The single header a driver merges at its own seam.
|
|
15
|
+
*
|
|
16
|
+
* Pure, and takes the identity as an argument, so a host embedding this
|
|
17
|
+
* kernel in its own product can say so — and so a driver cannot hardcode
|
|
18
|
+
* the constant and quietly ignore what the host asked for.
|
|
19
|
+
*/
|
|
20
|
+
export function attributionHeaders(identity = NAMZU_APP_IDENTITY) {
|
|
21
|
+
return { 'User-Agent': `${identity.product}/${identity.version} (+${identity.url})` };
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=attribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribution.js","sourceRoot":"","sources":["../../src/provider/attribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAiCvC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAgB;IAC9C,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE,OAAO;IAChB,GAAG,EAAE,mCAAmC;CACxC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CACjC,WAAwB,kBAAkB;IAE1C,OAAO,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,OAAO,MAAM,QAAQ,CAAC,GAAG,GAAG,EAAE,CAAA;AACtF,CAAC"}
|
|
@@ -8,7 +8,7 @@ import type { StreamChunk } from '../types/provider/stream.js';
|
|
|
8
8
|
* four internal callers that genuinely need the aggregated view (advisory
|
|
9
9
|
* executor, RouterAgent's deterministic routing decision, compaction's
|
|
10
10
|
* verifier, the instrumentation wrapper) replace `provider.chat(p)` with
|
|
11
|
-
* `
|
|
11
|
+
* `collectChatCompletion(provider.chatStream(p))`.
|
|
12
12
|
*
|
|
13
13
|
* Behaviour matches the pre-removal `chat()` contract:
|
|
14
14
|
* - text content is concatenated in delta order;
|
|
@@ -21,5 +21,5 @@ import type { StreamChunk } from '../types/provider/stream.js';
|
|
|
21
21
|
* The orchestrator does NOT call this helper — it consumes the stream
|
|
22
22
|
* directly so it can emit per-delta `RunEvent`s.
|
|
23
23
|
*/
|
|
24
|
-
export declare function
|
|
25
|
-
//# sourceMappingURL=collect.d.ts.map
|
|
24
|
+
export declare function collectChatCompletion(stream: AsyncIterable<StreamChunk>): Promise<ChatCompletionResponse>;
|
|
25
|
+
//# sourceMappingURL=collect-chat-completion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collect-chat-completion.d.ts","sourceRoot":"","sources":["../../src/provider/collect-chat-completion.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAE9D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,qBAAqB,CAC1C,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,GAChC,OAAO,CAAC,sBAAsB,CAAC,CA8DjC"}
|
|
@@ -7,7 +7,7 @@ import { mergeTokenUsage } from '../types/common/index.js';
|
|
|
7
7
|
* four internal callers that genuinely need the aggregated view (advisory
|
|
8
8
|
* executor, RouterAgent's deterministic routing decision, compaction's
|
|
9
9
|
* verifier, the instrumentation wrapper) replace `provider.chat(p)` with
|
|
10
|
-
* `
|
|
10
|
+
* `collectChatCompletion(provider.chatStream(p))`.
|
|
11
11
|
*
|
|
12
12
|
* Behaviour matches the pre-removal `chat()` contract:
|
|
13
13
|
* - text content is concatenated in delta order;
|
|
@@ -20,7 +20,7 @@ import { mergeTokenUsage } from '../types/common/index.js';
|
|
|
20
20
|
* The orchestrator does NOT call this helper — it consumes the stream
|
|
21
21
|
* directly so it can emit per-delta `RunEvent`s.
|
|
22
22
|
*/
|
|
23
|
-
export async function
|
|
23
|
+
export async function collectChatCompletion(stream) {
|
|
24
24
|
let id = '';
|
|
25
25
|
const model = '';
|
|
26
26
|
let content = '';
|
|
@@ -82,4 +82,4 @@ export async function collect(stream) {
|
|
|
82
82
|
usage,
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
//# sourceMappingURL=collect.js.map
|
|
85
|
+
//# sourceMappingURL=collect-chat-completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collect-chat-completion.js","sourceRoot":"","sources":["../../src/provider/collect-chat-completion.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { ConformanceDescribe, ConformanceExpect, ConformanceIt } from '../store/run/conformance.js';
|
|
2
|
+
import type { LLMProvider } from '../types/provider/interface.js';
|
|
3
|
+
import type { ProviderRetryConfig } from './retry.js';
|
|
4
|
+
/**
|
|
5
|
+
* The driver contract, as a suite every driver package runs.
|
|
6
|
+
*
|
|
7
|
+
* Seven packages implement `LLMProvider` and there was nowhere to write a
|
|
8
|
+
* rule binding all of them. Each carried a hand-written error-taxonomy
|
|
9
|
+
* test covering the same ground differently, and every provider finding in
|
|
10
|
+
* the audit was a behaviour present in exactly ONE driver and absent from
|
|
11
|
+
* the other six — which is what you get when a contract lives in seven
|
|
12
|
+
* copies of a test rather than in one place. Nothing failed when an eighth
|
|
13
|
+
* package appeared implementing none of it.
|
|
14
|
+
*
|
|
15
|
+
* The mechanism already existed for a different interface: the checkpoint
|
|
16
|
+
* store publishes its contract at `@namzu/sdk/testing` and takes its
|
|
17
|
+
* runner as an argument. This copies that shape exactly, for the same two
|
|
18
|
+
* reasons — the SDK gains no test dependency from publishing a suite, and
|
|
19
|
+
* a caller can pass a RECORDING `describe`/`it` and run the whole contract
|
|
20
|
+
* as ordinary code, which is how a deliberately wrong driver is shown to
|
|
21
|
+
* fail it.
|
|
22
|
+
*
|
|
23
|
+
* ## What is in it, and what is deliberately not
|
|
24
|
+
*
|
|
25
|
+
* Seeded only with rules that pass for every driver today. A suite that
|
|
26
|
+
* ships red is a suite somebody switches off in its first week, and the
|
|
27
|
+
* point of it is to hold the line while the four known gaps are closed one
|
|
28
|
+
* at a time — each of which adds a rule here in the commit that fixes it.
|
|
29
|
+
*
|
|
30
|
+
* ## Consuming it
|
|
31
|
+
*
|
|
32
|
+
* ```typescript
|
|
33
|
+
* import { describe, expect, it } from 'vitest'
|
|
34
|
+
* import { defineProviderDriverConformance } from '@namzu/sdk/testing'
|
|
35
|
+
*
|
|
36
|
+
* defineProviderDriverConformance({
|
|
37
|
+
* describe, it, expect,
|
|
38
|
+
* label: 'anthropic',
|
|
39
|
+
* registryType: 'anthropic',
|
|
40
|
+
* makeProvider: () => new AnthropicProvider({ apiKey: 'test' }),
|
|
41
|
+
* })
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
/** The contract revision a driver declares itself written against. */
|
|
45
|
+
export declare const PROVIDER_DRIVER_CONTRACT_VERSION = 1;
|
|
46
|
+
export interface ProviderDriverConformanceOptions {
|
|
47
|
+
readonly describe: ConformanceDescribe;
|
|
48
|
+
readonly it: ConformanceIt;
|
|
49
|
+
readonly expect: ConformanceExpect;
|
|
50
|
+
/**
|
|
51
|
+
* The string this driver is registered under. Asserted to equal `id`,
|
|
52
|
+
* because the two are used interchangeably at call sites — a chain
|
|
53
|
+
* member names one and a `ProviderRegistry` lookup uses the other — and
|
|
54
|
+
* a driver where they differ resolves for some callers and not others.
|
|
55
|
+
*/
|
|
56
|
+
readonly registryType: string;
|
|
57
|
+
/**
|
|
58
|
+
* Built once per case. No case may depend on another's state, and a
|
|
59
|
+
* driver that holds a connection gets a fresh one rather than a shared
|
|
60
|
+
* instance the suite would then have to clean.
|
|
61
|
+
*/
|
|
62
|
+
readonly makeProvider: () => LLMProvider | Promise<LLMProvider>;
|
|
63
|
+
/**
|
|
64
|
+
* What this driver declares as its retry defaults, restated here.
|
|
65
|
+
*
|
|
66
|
+
* REQUIRED, and required as a value rather than inferred from the
|
|
67
|
+
* driver, so a new package cannot skip the decision by not thinking
|
|
68
|
+
* about it. `undefined` is a legitimate answer — it means the generic
|
|
69
|
+
* default suits this vendor — but it has to be written down, which is
|
|
70
|
+
* the difference between a decision and an omission.
|
|
71
|
+
*/
|
|
72
|
+
readonly retryDefaults: Partial<ProviderRetryConfig> | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Whether this driver identifies the kernel to its vendor, and if not
|
|
75
|
+
* why not.
|
|
76
|
+
*
|
|
77
|
+
* REQUIRED for the same reason `retryDefaults` is: a package that never
|
|
78
|
+
* decided should not typecheck. `'unsupported'` is a legitimate answer
|
|
79
|
+
* — one vendor's client speaks a websocket protocol with no header seam
|
|
80
|
+
* — but it has to carry a reason, so the next reader learns whether it
|
|
81
|
+
* is impossible or merely undone.
|
|
82
|
+
*/
|
|
83
|
+
readonly attribution: {
|
|
84
|
+
kind: 'header';
|
|
85
|
+
} | {
|
|
86
|
+
kind: 'unsupported';
|
|
87
|
+
reason: string;
|
|
88
|
+
};
|
|
89
|
+
/** Names the driver in test output. Defaults to `provider driver`. */
|
|
90
|
+
readonly label?: string;
|
|
91
|
+
}
|
|
92
|
+
export declare function defineProviderDriverConformance(options: ProviderDriverConformanceOptions): void;
|
|
93
|
+
//# sourceMappingURL=conformance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conformance.d.ts","sourceRoot":"","sources":["../../src/provider/conformance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,sEAAsE;AACtE,eAAO,MAAM,gCAAgC,IAAI,CAAA;AAEjD,MAAM,WAAW,gCAAgC;IAChD,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAA;IACtC,QAAQ,CAAC,EAAE,EAAE,aAAa,CAAA;IAC1B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAA;IAClC;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;IAC/D;;;;;;;;OAQG;IACH,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAAA;IAChE;;;;;;;;;OASG;IACH,QAAQ,CAAC,WAAW,EAAE;QAAE,IAAI,EAAE,QAAQ,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,aAAa,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAClF,sEAAsE;IACtE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,gCAAgC,GAAG,IAAI,CA8F/F"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The driver contract, as a suite every driver package runs.
|
|
3
|
+
*
|
|
4
|
+
* Seven packages implement `LLMProvider` and there was nowhere to write a
|
|
5
|
+
* rule binding all of them. Each carried a hand-written error-taxonomy
|
|
6
|
+
* test covering the same ground differently, and every provider finding in
|
|
7
|
+
* the audit was a behaviour present in exactly ONE driver and absent from
|
|
8
|
+
* the other six — which is what you get when a contract lives in seven
|
|
9
|
+
* copies of a test rather than in one place. Nothing failed when an eighth
|
|
10
|
+
* package appeared implementing none of it.
|
|
11
|
+
*
|
|
12
|
+
* The mechanism already existed for a different interface: the checkpoint
|
|
13
|
+
* store publishes its contract at `@namzu/sdk/testing` and takes its
|
|
14
|
+
* runner as an argument. This copies that shape exactly, for the same two
|
|
15
|
+
* reasons — the SDK gains no test dependency from publishing a suite, and
|
|
16
|
+
* a caller can pass a RECORDING `describe`/`it` and run the whole contract
|
|
17
|
+
* as ordinary code, which is how a deliberately wrong driver is shown to
|
|
18
|
+
* fail it.
|
|
19
|
+
*
|
|
20
|
+
* ## What is in it, and what is deliberately not
|
|
21
|
+
*
|
|
22
|
+
* Seeded only with rules that pass for every driver today. A suite that
|
|
23
|
+
* ships red is a suite somebody switches off in its first week, and the
|
|
24
|
+
* point of it is to hold the line while the four known gaps are closed one
|
|
25
|
+
* at a time — each of which adds a rule here in the commit that fixes it.
|
|
26
|
+
*
|
|
27
|
+
* ## Consuming it
|
|
28
|
+
*
|
|
29
|
+
* ```typescript
|
|
30
|
+
* import { describe, expect, it } from 'vitest'
|
|
31
|
+
* import { defineProviderDriverConformance } from '@namzu/sdk/testing'
|
|
32
|
+
*
|
|
33
|
+
* defineProviderDriverConformance({
|
|
34
|
+
* describe, it, expect,
|
|
35
|
+
* label: 'anthropic',
|
|
36
|
+
* registryType: 'anthropic',
|
|
37
|
+
* makeProvider: () => new AnthropicProvider({ apiKey: 'test' }),
|
|
38
|
+
* })
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
/** The contract revision a driver declares itself written against. */
|
|
42
|
+
export const PROVIDER_DRIVER_CONTRACT_VERSION = 1;
|
|
43
|
+
export function defineProviderDriverConformance(options) {
|
|
44
|
+
const { describe, it, expect, makeProvider, registryType } = options;
|
|
45
|
+
const label = options.label ?? 'provider driver';
|
|
46
|
+
describe(`${label} — driver contract v${PROVIDER_DRIVER_CONTRACT_VERSION}`, () => {
|
|
47
|
+
it('has a non-empty id and name', async () => {
|
|
48
|
+
// Both reach a human or a log line. An empty one produces a
|
|
49
|
+
// provider-chain entry that names nothing, which is worse than a
|
|
50
|
+
// wrong name because there is nothing to search for.
|
|
51
|
+
const provider = await makeProvider();
|
|
52
|
+
expect(typeof provider.id).toBe('string');
|
|
53
|
+
expect(provider.id.length > 0).toBe(true);
|
|
54
|
+
expect(typeof provider.name).toBe('string');
|
|
55
|
+
expect(provider.name.length > 0).toBe(true);
|
|
56
|
+
});
|
|
57
|
+
it('has an id equal to the string it is registered under', async () => {
|
|
58
|
+
// A chain member names the registry type; a lookup uses `id`. A
|
|
59
|
+
// driver where they differ resolves through one path and not the
|
|
60
|
+
// other, and the failure appears at whichever call site the host
|
|
61
|
+
// happens to reach second.
|
|
62
|
+
const provider = await makeProvider();
|
|
63
|
+
expect(provider.id).toBe(registryType);
|
|
64
|
+
});
|
|
65
|
+
it('exposes chatStream as a function', async () => {
|
|
66
|
+
// The single entry point. Asserted because a driver can satisfy
|
|
67
|
+
// the type by declaring it and still ship an object literal that
|
|
68
|
+
// forgot it — the interface is structural.
|
|
69
|
+
const provider = await makeProvider();
|
|
70
|
+
expect(typeof provider.chatStream).toBe('function');
|
|
71
|
+
});
|
|
72
|
+
it('declares capabilities honestly or not at all', async () => {
|
|
73
|
+
// Optional BY DESIGN: an absent declaration resolves to the
|
|
74
|
+
// permissive default, which is the behaviour every driver had
|
|
75
|
+
// before the field existed. What is not allowed is a declaration
|
|
76
|
+
// that is present and not a capability record — that reaches the
|
|
77
|
+
// runtime as "supports nothing" and silently strips tool surfaces.
|
|
78
|
+
const provider = await makeProvider();
|
|
79
|
+
if (provider.capabilities === undefined)
|
|
80
|
+
return;
|
|
81
|
+
expect(typeof provider.capabilities.supportsTools).toBe('boolean');
|
|
82
|
+
expect(typeof provider.capabilities.supportsStreaming).toBe('boolean');
|
|
83
|
+
expect(typeof provider.capabilities.supportsFunctionCalling).toBe('boolean');
|
|
84
|
+
});
|
|
85
|
+
// NOT A RULE HERE, and the reason is worth keeping.
|
|
86
|
+
//
|
|
87
|
+
// NZ-PROV-05 makes `contextWindow`/`maxOutputTokens` optional so a
|
|
88
|
+
// driver stops writing `0` for "I do not know" — zero is not a
|
|
89
|
+
// window, and it reads to every consumer as a measurement of a model
|
|
90
|
+
// that can hold nothing.
|
|
91
|
+
//
|
|
92
|
+
// The obvious place to enforce that is here, reading `listModels`.
|
|
93
|
+
// It was here, and it was worse than nothing twice over. For every
|
|
94
|
+
// in-tree driver `listModels` needs a live service, so the rule
|
|
95
|
+
// returned early and asserted NOTHING in CI — verified by putting a
|
|
96
|
+
// zero back and watching the driver's run stay green. And lmstudio's
|
|
97
|
+
// does not throw, it HANGS: the rule timed out that package's whole
|
|
98
|
+
// conformance run. A check that cannot fail, attached to a suite it
|
|
99
|
+
// can take down.
|
|
100
|
+
//
|
|
101
|
+
// The reintroduction of a literal zero is caught by a source scan in
|
|
102
|
+
// `provider/__tests__/conformance-fails-a-wrong-driver.test.ts`,
|
|
103
|
+
// which depends on reaching nothing.
|
|
104
|
+
it('declares the retry defaults its conformance run says it does', async () => {
|
|
105
|
+
// The option above forces the decision; this asserts the answer is
|
|
106
|
+
// TRUE of the driver. Without it a package could declare one thing
|
|
107
|
+
// in its test and ship another, which is the same gap as no
|
|
108
|
+
// declaration at all with an extra place to look.
|
|
109
|
+
const provider = await makeProvider();
|
|
110
|
+
expect(JSON.stringify(provider.retryDefaults ?? null)).toBe(JSON.stringify(options.retryDefaults ?? null));
|
|
111
|
+
});
|
|
112
|
+
it('builds a second instance independent of the first', async () => {
|
|
113
|
+
// The property the suite itself relies on, and one a driver can
|
|
114
|
+
// break by caching a client on the module. Every case above calls
|
|
115
|
+
// `makeProvider` again; if that returned a shared object, a
|
|
116
|
+
// driver's state would leak between cases and this suite would
|
|
117
|
+
// report on whichever one ran first.
|
|
118
|
+
const a = await makeProvider();
|
|
119
|
+
const b = await makeProvider();
|
|
120
|
+
expect(a === b).toBe(false);
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=conformance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conformance.js","sourceRoot":"","sources":["../../src/provider/conformance.ts"],"names":[],"mappings":"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"}
|