@namzu/sdk 30.2.0 → 31.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 +556 -0
- package/README.md +43 -2
- package/dist/advisory/executor.d.ts +2 -1
- package/dist/advisory/executor.d.ts.map +1 -1
- package/dist/advisory/executor.js +4 -1
- package/dist/advisory/executor.js.map +1 -1
- package/dist/agents/ReactiveAgent.d.ts.map +1 -1
- package/dist/agents/ReactiveAgent.js +12 -0
- package/dist/agents/ReactiveAgent.js.map +1 -1
- package/dist/agents/RouterAgent.d.ts.map +1 -1
- package/dist/agents/RouterAgent.js +21 -3
- package/dist/agents/RouterAgent.js.map +1 -1
- package/dist/agents/SupervisorAgent.d.ts.map +1 -1
- package/dist/agents/SupervisorAgent.js +34 -11
- package/dist/agents/SupervisorAgent.js.map +1 -1
- package/dist/agents/runAgent.d.ts +12 -0
- package/dist/agents/runAgent.d.ts.map +1 -1
- package/dist/agents/runAgent.js +26 -2
- package/dist/agents/runAgent.js.map +1 -1
- package/dist/authorization/command-line.d.ts +81 -0
- package/dist/authorization/command-line.d.ts.map +1 -0
- package/dist/authorization/command-line.js +347 -0
- package/dist/authorization/command-line.js.map +1 -0
- package/dist/authorization/rules.d.ts.map +1 -1
- package/dist/authorization/rules.js +22 -1
- package/dist/authorization/rules.js.map +1 -1
- package/dist/bridge/a2a/client.d.ts +23 -5
- package/dist/bridge/a2a/client.d.ts.map +1 -1
- package/dist/bridge/a2a/client.js +320 -73
- package/dist/bridge/a2a/client.js.map +1 -1
- package/dist/bridge/a2a/mapper.d.ts.map +1 -1
- package/dist/bridge/a2a/mapper.js +4 -0
- package/dist/bridge/a2a/mapper.js.map +1 -1
- package/dist/bridge/acp/server.d.ts +13 -1
- package/dist/bridge/acp/server.d.ts.map +1 -1
- package/dist/bridge/acp/server.js +150 -44
- package/dist/bridge/acp/server.js.map +1 -1
- package/dist/bridge/mcp/connector/adapter.d.ts +3 -2
- package/dist/bridge/mcp/connector/adapter.d.ts.map +1 -1
- package/dist/bridge/mcp/connector/adapter.js +17 -21
- 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 +3 -0
- package/dist/bridge/sse/mapper.js.map +1 -1
- package/dist/compaction/dangling.d.ts +29 -2
- package/dist/compaction/dangling.d.ts.map +1 -1
- package/dist/compaction/dangling.js +172 -35
- package/dist/compaction/dangling.js.map +1 -1
- package/dist/compaction/index.d.ts +3 -2
- package/dist/compaction/index.d.ts.map +1 -1
- package/dist/compaction/index.js +1 -1
- package/dist/compaction/index.js.map +1 -1
- package/dist/compaction/manual.d.ts +11 -1
- package/dist/compaction/manual.d.ts.map +1 -1
- package/dist/compaction/manual.js +89 -14
- package/dist/compaction/manual.js.map +1 -1
- package/dist/compaction/plan.d.ts +19 -6
- package/dist/compaction/plan.d.ts.map +1 -1
- package/dist/compaction/plan.js +18 -4
- package/dist/compaction/plan.js.map +1 -1
- package/dist/compaction/retention.d.ts +10 -7
- package/dist/compaction/retention.d.ts.map +1 -1
- package/dist/compaction/retention.js +26 -8
- package/dist/compaction/retention.js.map +1 -1
- package/dist/compaction/summary.d.ts +4 -4
- package/dist/compaction/summary.js +4 -4
- package/dist/compaction/verifier.d.ts +19 -1
- package/dist/compaction/verifier.d.ts.map +1 -1
- package/dist/compaction/verifier.js +20 -1
- package/dist/compaction/verifier.js.map +1 -1
- package/dist/config/runtime.d.ts +6 -6
- package/dist/connector/BaseConnector.d.ts +6 -4
- package/dist/connector/BaseConnector.d.ts.map +1 -1
- package/dist/connector/BaseConnector.js +8 -2
- package/dist/connector/BaseConnector.js.map +1 -1
- package/dist/connector/builtins/http.d.ts +16 -4
- package/dist/connector/builtins/http.d.ts.map +1 -1
- package/dist/connector/builtins/http.js +177 -44
- package/dist/connector/builtins/http.js.map +1 -1
- package/dist/connector/builtins/webhook.d.ts +15 -4
- package/dist/connector/builtins/webhook.d.ts.map +1 -1
- package/dist/connector/builtins/webhook.js +165 -45
- package/dist/connector/builtins/webhook.js.map +1 -1
- package/dist/connector/execution-contract.d.ts +11 -0
- package/dist/connector/execution-contract.d.ts.map +1 -0
- package/dist/connector/execution-contract.js +14 -0
- package/dist/connector/execution-contract.js.map +1 -0
- package/dist/connector/http-operation.d.ts +48 -0
- package/dist/connector/http-operation.d.ts.map +1 -0
- package/dist/connector/http-operation.js +205 -0
- package/dist/connector/http-operation.js.map +1 -0
- package/dist/connector/mcp/adapter.d.ts.map +1 -1
- package/dist/connector/mcp/adapter.js +8 -3
- package/dist/connector/mcp/adapter.js.map +1 -1
- package/dist/connector/mcp/client.d.ts +14 -8
- package/dist/connector/mcp/client.d.ts.map +1 -1
- package/dist/connector/mcp/client.js +160 -44
- package/dist/connector/mcp/client.js.map +1 -1
- package/dist/connector/mcp/http-sse.d.ts +8 -2
- package/dist/connector/mcp/http-sse.d.ts.map +1 -1
- package/dist/connector/mcp/http-sse.js +70 -17
- package/dist/connector/mcp/http-sse.js.map +1 -1
- package/dist/connector/mcp/prompt-adapter.d.ts.map +1 -1
- package/dist/connector/mcp/prompt-adapter.js +9 -2
- package/dist/connector/mcp/prompt-adapter.js.map +1 -1
- package/dist/connector/mcp/stdio.d.ts +2 -2
- package/dist/connector/mcp/stdio.d.ts.map +1 -1
- package/dist/connector/mcp/stdio.js +14 -50
- package/dist/connector/mcp/stdio.js.map +1 -1
- package/dist/connector/mcp/streamable-http.d.ts +7 -2
- package/dist/connector/mcp/streamable-http.d.ts.map +1 -1
- package/dist/connector/mcp/streamable-http.js +66 -18
- package/dist/connector/mcp/streamable-http.js.map +1 -1
- package/dist/connector/tools/adapter.d.ts +2 -2
- package/dist/connector/tools/adapter.d.ts.map +1 -1
- package/dist/connector/tools/adapter.js +23 -14
- package/dist/connector/tools/adapter.js.map +1 -1
- package/dist/connector/tools/definitions.d.ts.map +1 -1
- package/dist/connector/tools/definitions.js +5 -2
- package/dist/connector/tools/definitions.js.map +1 -1
- package/dist/connector/tools/result.d.ts +4 -0
- package/dist/connector/tools/result.d.ts.map +1 -0
- package/dist/connector/tools/result.js +20 -0
- package/dist/connector/tools/result.js.map +1 -0
- package/dist/connector/web/guarded-fetch.d.ts +4 -2
- package/dist/connector/web/guarded-fetch.d.ts.map +1 -1
- package/dist/connector/web/guarded-fetch.js +157 -43
- package/dist/connector/web/guarded-fetch.js.map +1 -1
- package/dist/constants/sandbox/index.d.ts +3 -2
- package/dist/constants/sandbox/index.d.ts.map +1 -1
- package/dist/constants/sandbox/index.js +3 -2
- package/dist/constants/sandbox/index.js.map +1 -1
- package/dist/contracts/api.d.ts +2 -0
- package/dist/contracts/api.d.ts.map +1 -1
- package/dist/contracts/schemas.d.ts +38 -12
- package/dist/contracts/schemas.d.ts.map +1 -1
- package/dist/contracts/schemas.js +7 -0
- package/dist/contracts/schemas.js.map +1 -1
- package/dist/directory/derive-supervisor.d.ts.map +1 -1
- package/dist/directory/derive-supervisor.js +8 -0
- package/dist/directory/derive-supervisor.js.map +1 -1
- package/dist/directory/derive.d.ts.map +1 -1
- package/dist/directory/derive.js +8 -0
- package/dist/directory/derive.js.map +1 -1
- package/dist/directory/load.d.ts.map +1 -1
- package/dist/directory/load.js +2 -0
- package/dist/directory/load.js.map +1 -1
- package/dist/directory/types.d.ts +4 -0
- package/dist/directory/types.d.ts.map +1 -1
- package/dist/eval/experiment.d.ts +10 -10
- package/dist/eval/experiment.d.ts.map +1 -1
- package/dist/eval/experiment.js +121 -91
- package/dist/eval/experiment.js.map +1 -1
- package/dist/eval/judge.d.ts +6 -0
- package/dist/eval/judge.d.ts.map +1 -1
- package/dist/eval/judge.js +7 -2
- package/dist/eval/judge.js.map +1 -1
- package/dist/eval/types.d.ts +7 -1
- package/dist/eval/types.d.ts.map +1 -1
- package/dist/manager/agent/lifecycle.d.ts +12 -10
- package/dist/manager/agent/lifecycle.d.ts.map +1 -1
- package/dist/manager/agent/lifecycle.js +16 -3
- package/dist/manager/agent/lifecycle.js.map +1 -1
- package/dist/manager/connector/environment.d.ts +2 -2
- package/dist/manager/connector/environment.d.ts.map +1 -1
- package/dist/manager/connector/environment.js +2 -2
- package/dist/manager/connector/environment.js.map +1 -1
- package/dist/manager/connector/lifecycle.d.ts +10 -2
- package/dist/manager/connector/lifecycle.d.ts.map +1 -1
- package/dist/manager/connector/lifecycle.js +273 -24
- package/dist/manager/connector/lifecycle.js.map +1 -1
- package/dist/manager/connector/tenant.d.ts +5 -4
- package/dist/manager/connector/tenant.d.ts.map +1 -1
- package/dist/manager/connector/tenant.js +47 -22
- package/dist/manager/connector/tenant.js.map +1 -1
- package/dist/manager/goal/activation.d.ts +23 -0
- package/dist/manager/goal/activation.d.ts.map +1 -0
- package/dist/manager/goal/activation.js +41 -0
- package/dist/manager/goal/activation.js.map +1 -0
- package/dist/manager/index.d.ts +3 -2
- package/dist/manager/index.d.ts.map +1 -1
- package/dist/manager/index.js.map +1 -1
- package/dist/manager/run/persistence.d.ts +2 -0
- package/dist/manager/run/persistence.d.ts.map +1 -1
- package/dist/manager/run/persistence.js +5 -1
- package/dist/manager/run/persistence.js.map +1 -1
- package/dist/manager/topic/dependency.d.ts +24 -0
- package/dist/manager/topic/dependency.d.ts.map +1 -0
- package/dist/manager/topic/dependency.js +13 -0
- package/dist/manager/topic/dependency.js.map +1 -0
- package/dist/manager/topic/lifecycle.d.ts +9 -21
- package/dist/manager/topic/lifecycle.d.ts.map +1 -1
- package/dist/manager/topic/lifecycle.js +17 -29
- package/dist/manager/topic/lifecycle.js.map +1 -1
- package/dist/plugin/index.d.ts +1 -0
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js.map +1 -1
- package/dist/plugin/lifecycle.d.ts +15 -0
- package/dist/plugin/lifecycle.d.ts.map +1 -1
- package/dist/plugin/lifecycle.js +144 -38
- package/dist/plugin/lifecycle.js.map +1 -1
- package/dist/plugin/loader.d.ts +3 -3
- package/dist/plugin/loader.d.ts.map +1 -1
- package/dist/plugin/loader.js +58 -12
- package/dist/plugin/loader.js.map +1 -1
- package/dist/provider/collect-chat-completion.d.ts.map +1 -1
- package/dist/provider/collect-chat-completion.js +4 -0
- package/dist/provider/collect-chat-completion.js.map +1 -1
- package/dist/provider/fallback.d.ts +3 -1
- package/dist/provider/fallback.d.ts.map +1 -1
- package/dist/provider/fallback.js +62 -10
- package/dist/provider/fallback.js.map +1 -1
- package/dist/provider/idle-timeout.d.ts +4 -0
- package/dist/provider/idle-timeout.d.ts.map +1 -1
- package/dist/provider/idle-timeout.js +131 -15
- package/dist/provider/idle-timeout.js.map +1 -1
- package/dist/provider/index.d.ts +2 -0
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +1 -0
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/instrumentation.d.ts.map +1 -1
- package/dist/provider/instrumentation.js +1 -0
- package/dist/provider/instrumentation.js.map +1 -1
- package/dist/provider/retry.d.ts.map +1 -1
- package/dist/provider/retry.js +13 -1
- package/dist/provider/retry.js.map +1 -1
- package/dist/public-runtime.d.ts +57 -24
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +42 -35
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-tools.d.ts +1 -0
- package/dist/public-tools.d.ts.map +1 -1
- package/dist/public-tools.js +5 -0
- package/dist/public-tools.js.map +1 -1
- package/dist/public-types.d.ts +33 -12
- package/dist/public-types.d.ts.map +1 -1
- package/dist/rag/embedding.d.ts +8 -3
- package/dist/rag/embedding.d.ts.map +1 -1
- package/dist/rag/embedding.js +120 -9
- package/dist/rag/embedding.js.map +1 -1
- package/dist/rag/index.d.ts +1 -1
- package/dist/rag/index.d.ts.map +1 -1
- package/dist/rag/index.js +1 -1
- package/dist/rag/index.js.map +1 -1
- package/dist/rag/ingestion.d.ts +2 -2
- package/dist/rag/ingestion.d.ts.map +1 -1
- package/dist/rag/ingestion.js +15 -3
- package/dist/rag/ingestion.js.map +1 -1
- package/dist/rag/knowledge-base.d.ts +3 -3
- package/dist/rag/knowledge-base.d.ts.map +1 -1
- package/dist/rag/knowledge-base.js +8 -4
- package/dist/rag/knowledge-base.js.map +1 -1
- package/dist/rag/operation.d.ts +10 -0
- package/dist/rag/operation.d.ts.map +1 -0
- package/dist/rag/operation.js +26 -0
- package/dist/rag/operation.js.map +1 -0
- package/dist/rag/rag-tool.d.ts.map +1 -1
- package/dist/rag/rag-tool.js +6 -3
- package/dist/rag/rag-tool.js.map +1 -1
- package/dist/rag/retriever.d.ts +2 -2
- package/dist/rag/retriever.d.ts.map +1 -1
- package/dist/rag/retriever.js +31 -15
- package/dist/rag/retriever.js.map +1 -1
- package/dist/rag/vector-store.d.ts +3 -3
- package/dist/rag/vector-store.d.ts.map +1 -1
- package/dist/rag/vector-store.js +4 -2
- package/dist/rag/vector-store.js.map +1 -1
- package/dist/registry/command/kernel-commands.d.ts +16 -4
- package/dist/registry/command/kernel-commands.d.ts.map +1 -1
- package/dist/registry/command/kernel-commands.js +171 -0
- package/dist/registry/command/kernel-commands.js.map +1 -1
- package/dist/run/reporter.d.ts.map +1 -1
- package/dist/run/reporter.js +9 -0
- package/dist/run/reporter.js.map +1 -1
- package/dist/run-query/index.d.ts +15 -1
- package/dist/run-query/index.d.ts.map +1 -1
- package/dist/run-query/index.js +69 -15
- package/dist/run-query/index.js.map +1 -1
- package/dist/runtime/query/context.d.ts.map +1 -1
- package/dist/runtime/query/context.js +10 -3
- package/dist/runtime/query/context.js.map +1 -1
- package/dist/runtime/query/executor.d.ts +3 -0
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +80 -18
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/guard.d.ts +9 -0
- package/dist/runtime/query/guard.d.ts.map +1 -1
- package/dist/runtime/query/guard.js +11 -0
- package/dist/runtime/query/guard.js.map +1 -1
- package/dist/runtime/query/index.d.ts +30 -1
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +548 -95
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/iteration/index.d.ts.map +1 -1
- package/dist/runtime/query/iteration/index.js +74 -14
- package/dist/runtime/query/iteration/index.js.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction.js +94 -53
- package/dist/runtime/query/iteration/phases/compaction.js.map +1 -1
- package/dist/runtime/query/iteration/phases/context.d.ts +3 -0
- package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/context.js.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.js +21 -0
- package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
- package/dist/runtime/query/iteration/stream-turn.d.ts.map +1 -1
- package/dist/runtime/query/iteration/stream-turn.js +4 -0
- package/dist/runtime/query/iteration/stream-turn.js.map +1 -1
- package/dist/runtime/query/project-instructions.d.ts +69 -0
- package/dist/runtime/query/project-instructions.d.ts.map +1 -0
- package/dist/runtime/query/project-instructions.js +137 -0
- package/dist/runtime/query/project-instructions.js.map +1 -0
- package/dist/runtime/query/request-rich-content.d.ts +22 -0
- package/dist/runtime/query/request-rich-content.d.ts.map +1 -0
- package/dist/runtime/query/request-rich-content.js +122 -0
- package/dist/runtime/query/request-rich-content.js.map +1 -0
- package/dist/runtime/query/result.d.ts.map +1 -1
- package/dist/runtime/query/result.js +12 -1
- 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 -20
- package/dist/runtime/query/resume-pending.js.map +1 -1
- package/dist/runtime/query/resume-run.d.ts.map +1 -1
- package/dist/runtime/query/resume-run.js +54 -8
- package/dist/runtime/query/resume-run.js.map +1 -1
- package/dist/runtime/query/run-state.d.ts +5 -0
- package/dist/runtime/query/run-state.d.ts.map +1 -1
- package/dist/runtime/query/run-state.js +6 -1
- package/dist/runtime/query/run-state.js.map +1 -1
- package/dist/runtime/query/sandbox-lifecycle.d.ts +54 -0
- package/dist/runtime/query/sandbox-lifecycle.d.ts.map +1 -0
- package/dist/runtime/query/sandbox-lifecycle.js +167 -0
- package/dist/runtime/query/sandbox-lifecycle.js.map +1 -0
- package/dist/sandbox/isolation.d.ts.map +1 -1
- package/dist/sandbox/isolation.js +9 -0
- package/dist/sandbox/isolation.js.map +1 -1
- package/dist/sandbox/provider/local.d.ts +56 -6
- package/dist/sandbox/provider/local.d.ts.map +1 -1
- package/dist/sandbox/provider/local.js +181 -76
- package/dist/sandbox/provider/local.js.map +1 -1
- package/dist/sandbox/terminal.d.ts +13 -5
- package/dist/sandbox/terminal.d.ts.map +1 -1
- package/dist/sandbox/terminal.js +11 -3
- package/dist/sandbox/terminal.js.map +1 -1
- package/dist/session/errors.d.ts +28 -29
- package/dist/session/errors.d.ts.map +1 -1
- package/dist/session/errors.js +28 -29
- package/dist/session/errors.js.map +1 -1
- package/dist/session/handoff/broadcast.d.ts +5 -8
- package/dist/session/handoff/broadcast.d.ts.map +1 -1
- package/dist/session/handoff/broadcast.js +16 -6
- package/dist/session/handoff/broadcast.js.map +1 -1
- package/dist/session/handoff/single.d.ts +5 -8
- package/dist/session/handoff/single.d.ts.map +1 -1
- package/dist/session/handoff/single.js +7 -4
- package/dist/session/handoff/single.js.map +1 -1
- package/dist/store/attachment/index.d.ts +11 -3
- package/dist/store/attachment/index.d.ts.map +1 -1
- package/dist/store/attachment/index.js +49 -4
- package/dist/store/attachment/index.js.map +1 -1
- package/dist/store/feedback/conformance.d.ts.map +1 -1
- package/dist/store/feedback/conformance.js +32 -0
- package/dist/store/feedback/conformance.js.map +1 -1
- package/dist/store/feedback/disk.d.ts +8 -6
- package/dist/store/feedback/disk.d.ts.map +1 -1
- package/dist/store/feedback/disk.js +111 -76
- package/dist/store/feedback/disk.js.map +1 -1
- package/dist/store/goal/index.d.ts +111 -0
- package/dist/store/goal/index.d.ts.map +1 -0
- package/dist/store/goal/index.js +436 -0
- package/dist/store/goal/index.js.map +1 -0
- package/dist/store/index.d.ts +1 -1
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +1 -1
- package/dist/store/index.js.map +1 -1
- package/dist/store/kv/revision-record-store.d.ts +70 -0
- package/dist/store/kv/revision-record-store.d.ts.map +1 -0
- package/dist/store/kv/revision-record-store.js +290 -0
- package/dist/store/kv/revision-record-store.js.map +1 -0
- package/dist/store/memory/disk.d.ts +9 -7
- package/dist/store/memory/disk.d.ts.map +1 -1
- package/dist/store/memory/disk.js +256 -98
- package/dist/store/memory/disk.js.map +1 -1
- package/dist/store/run/disk.d.ts +10 -2
- package/dist/store/run/disk.d.ts.map +1 -1
- package/dist/store/run/disk.js +70 -4
- package/dist/store/run/disk.js.map +1 -1
- package/dist/store/run/memory.d.ts +4 -2
- package/dist/store/run/memory.d.ts.map +1 -1
- package/dist/store/run/memory.js +15 -1
- package/dist/store/run/memory.js.map +1 -1
- package/dist/store/session/disk.d.ts +9 -0
- package/dist/store/session/disk.d.ts.map +1 -1
- package/dist/store/session/disk.js +57 -5
- package/dist/store/session/disk.js.map +1 -1
- package/dist/store/session/memory.d.ts +1 -0
- package/dist/store/session/memory.d.ts.map +1 -1
- package/dist/store/session/memory.js +14 -0
- package/dist/store/session/memory.js.map +1 -1
- package/dist/store/topic/memory.d.ts +1 -2
- package/dist/store/topic/memory.d.ts.map +1 -1
- package/dist/store/topic/memory.js +4 -5
- package/dist/store/topic/memory.js.map +1 -1
- package/dist/store/topic/objective.d.ts +8 -4
- package/dist/store/topic/objective.d.ts.map +1 -1
- package/dist/store/topic/objective.js +185 -100
- package/dist/store/topic/objective.js.map +1 -1
- package/dist/store/topic/state.d.ts +1 -2
- package/dist/store/topic/state.d.ts.map +1 -1
- package/dist/store/topic/state.js +50 -62
- package/dist/store/topic/state.js.map +1 -1
- package/dist/tools/builtins/bash.d.ts.map +1 -1
- package/dist/tools/builtins/bash.js +20 -0
- package/dist/tools/builtins/bash.js.map +1 -1
- package/dist/tools/builtins/computer-use.d.ts +9 -1
- package/dist/tools/builtins/computer-use.d.ts.map +1 -1
- package/dist/tools/builtins/computer-use.js.map +1 -1
- package/dist/tools/builtins/content-fingerprint.d.ts +8 -7
- package/dist/tools/builtins/content-fingerprint.d.ts.map +1 -1
- package/dist/tools/builtins/content-fingerprint.js +9 -10
- package/dist/tools/builtins/content-fingerprint.js.map +1 -1
- package/dist/tools/builtins/edit.d.ts +6 -1
- package/dist/tools/builtins/edit.d.ts.map +1 -1
- package/dist/tools/builtins/edit.js +166 -27
- package/dist/tools/builtins/edit.js.map +1 -1
- package/dist/tools/builtins/write-file.d.ts.map +1 -1
- package/dist/tools/builtins/write-file.js +45 -19
- package/dist/tools/builtins/write-file.js.map +1 -1
- package/dist/tools/command-arguments.d.ts +43 -0
- package/dist/tools/command-arguments.d.ts.map +1 -0
- package/dist/tools/command-arguments.js +52 -0
- package/dist/tools/command-arguments.js.map +1 -0
- package/dist/tools/coordinator/index.d.ts +2 -0
- package/dist/tools/coordinator/index.d.ts.map +1 -1
- package/dist/tools/coordinator/index.js +3 -1
- package/dist/tools/coordinator/index.js.map +1 -1
- package/dist/tools/defineTool.d.ts +10 -0
- package/dist/tools/defineTool.d.ts.map +1 -1
- package/dist/tools/defineTool.js +1 -0
- package/dist/tools/defineTool.js.map +1 -1
- package/dist/tools/env-scrub.d.ts +7 -5
- package/dist/tools/env-scrub.d.ts.map +1 -1
- package/dist/tools/env-scrub.js +7 -5
- package/dist/tools/env-scrub.js.map +1 -1
- package/dist/tools/goal/index.d.ts +20 -0
- package/dist/tools/goal/index.d.ts.map +1 -0
- package/dist/tools/goal/index.js +104 -0
- package/dist/tools/goal/index.js.map +1 -0
- package/dist/tools/memory/index.d.ts +16 -0
- package/dist/tools/memory/index.d.ts.map +1 -1
- package/dist/tools/memory/index.js +6 -2
- package/dist/tools/memory/index.js.map +1 -1
- package/dist/tools/memory/search.d.ts +4 -1
- package/dist/tools/memory/search.d.ts.map +1 -1
- package/dist/tools/memory/search.js +10 -2
- package/dist/tools/memory/search.js.map +1 -1
- package/dist/types/agent/base.d.ts +11 -3
- package/dist/types/agent/base.d.ts.map +1 -1
- package/dist/types/agent/factory.d.ts +2 -0
- package/dist/types/agent/factory.d.ts.map +1 -1
- package/dist/types/agent/reactive.d.ts +2 -0
- package/dist/types/agent/reactive.d.ts.map +1 -1
- package/dist/types/agent/supervisor.d.ts +6 -0
- package/dist/types/agent/supervisor.d.ts.map +1 -1
- package/dist/types/agent/task.d.ts +6 -2
- package/dist/types/agent/task.d.ts.map +1 -1
- package/dist/types/connector/core.d.ts +13 -8
- package/dist/types/connector/core.d.ts.map +1 -1
- package/dist/types/connector/definition.d.ts +37 -18
- package/dist/types/connector/definition.d.ts.map +1 -1
- package/dist/types/connector/http.d.ts +6 -0
- package/dist/types/connector/http.d.ts.map +1 -1
- package/dist/types/connector/mcp.d.ts +24 -6
- package/dist/types/connector/mcp.d.ts.map +1 -1
- package/dist/types/connector/tenant.d.ts +17 -7
- package/dist/types/connector/tenant.d.ts.map +1 -1
- package/dist/types/connector/webhook.d.ts +6 -0
- package/dist/types/connector/webhook.d.ts.map +1 -1
- package/dist/types/goal/index.d.ts +46 -0
- package/dist/types/goal/index.d.ts.map +1 -0
- package/dist/types/goal/index.js +2 -0
- package/dist/types/goal/index.js.map +1 -0
- package/dist/types/ids/index.d.ts +2 -0
- package/dist/types/ids/index.d.ts.map +1 -1
- package/dist/types/ids/index.js.map +1 -1
- package/dist/types/message/index.d.ts +75 -10
- package/dist/types/message/index.d.ts.map +1 -1
- package/dist/types/message/index.js +49 -3
- package/dist/types/message/index.js.map +1 -1
- package/dist/types/plugin/index.d.ts +7 -5
- package/dist/types/plugin/index.d.ts.map +1 -1
- package/dist/types/plugin/index.js.map +1 -1
- package/dist/types/provider/chat.d.ts +27 -4
- package/dist/types/provider/chat.d.ts.map +1 -1
- package/dist/types/provider/interface.d.ts +18 -7
- package/dist/types/provider/interface.d.ts.map +1 -1
- package/dist/types/provider/stream.d.ts +6 -0
- package/dist/types/provider/stream.d.ts.map +1 -1
- package/dist/types/rag/embedding.d.ts +15 -2
- package/dist/types/rag/embedding.d.ts.map +1 -1
- package/dist/types/rag/ingestion.d.ts +2 -2
- package/dist/types/rag/ingestion.d.ts.map +1 -1
- package/dist/types/rag/knowledge-base.d.ts +3 -3
- package/dist/types/rag/knowledge-base.d.ts.map +1 -1
- package/dist/types/rag/retrieval.d.ts +2 -2
- package/dist/types/rag/retrieval.d.ts.map +1 -1
- package/dist/types/rag/scope.d.ts +4 -0
- package/dist/types/rag/scope.d.ts.map +1 -1
- package/dist/types/rag/vector.d.ts +5 -2
- package/dist/types/rag/vector.d.ts.map +1 -1
- package/dist/types/run/config.d.ts +20 -0
- package/dist/types/run/config.d.ts.map +1 -1
- package/dist/types/run/events.d.ts +25 -1
- package/dist/types/run/events.d.ts.map +1 -1
- package/dist/types/run/events.js.map +1 -1
- package/dist/types/run/metadata.d.ts +2 -0
- package/dist/types/run/metadata.d.ts.map +1 -1
- package/dist/types/run/step.d.ts +2 -6
- package/dist/types/run/step.d.ts.map +1 -1
- package/dist/types/run/step.js.map +1 -1
- package/dist/types/run/store.d.ts +55 -2
- package/dist/types/run/store.d.ts.map +1 -1
- package/dist/types/sandbox/index.d.ts +47 -6
- package/dist/types/sandbox/index.d.ts.map +1 -1
- package/dist/types/sandbox/index.js +23 -10
- package/dist/types/sandbox/index.js.map +1 -1
- package/dist/types/session/store.d.ts +13 -0
- package/dist/types/session/store.d.ts.map +1 -1
- package/dist/types/tool/index.d.ts +33 -11
- package/dist/types/tool/index.d.ts.map +1 -1
- package/dist/types/tool/index.js.map +1 -1
- package/dist/types/topic/entity.d.ts +3 -4
- package/dist/types/topic/entity.d.ts.map +1 -1
- package/dist/types/topic/store.d.ts +3 -3
- package/dist/utils/id.d.ts +3 -1
- package/dist/utils/id.d.ts.map +1 -1
- package/dist/utils/id.js +4 -0
- package/dist/utils/id.js.map +1 -1
- package/dist/utils/process-environment.d.ts +26 -0
- package/dist/utils/process-environment.d.ts.map +1 -0
- package/dist/utils/process-environment.js +78 -0
- package/dist/utils/process-environment.js.map +1 -0
- package/dist/vault/InMemoryCredentialVault.d.ts +2 -0
- package/dist/vault/InMemoryCredentialVault.d.ts.map +1 -1
- package/dist/vault/InMemoryCredentialVault.js +24 -4
- package/dist/vault/InMemoryCredentialVault.js.map +1 -1
- package/dist/vault/instrumentation.d.ts.map +1 -1
- package/dist/vault/instrumentation.js +15 -0
- package/dist/vault/instrumentation.js.map +1 -1
- package/package.json +1 -1
- package/src/advisory/executor.ts +4 -1
- package/src/agents/ReactiveAgent.ts +12 -0
- package/src/agents/RouterAgent.ts +25 -3
- package/src/agents/SupervisorAgent.ts +33 -11
- package/src/agents/runAgent.ts +38 -2
- package/src/authorization/command-line.ts +390 -0
- package/src/authorization/rules.ts +22 -1
- package/src/bridge/a2a/client.ts +384 -97
- package/src/bridge/a2a/mapper.ts +5 -0
- package/src/bridge/acp/server.ts +184 -42
- package/src/bridge/mcp/connector/adapter.ts +28 -20
- package/src/bridge/sse/mapper.ts +3 -0
- package/src/compaction/dangling.ts +203 -38
- package/src/compaction/index.ts +9 -2
- package/src/compaction/manual.ts +125 -18
- package/src/compaction/plan.ts +42 -11
- package/src/compaction/retention.ts +23 -8
- package/src/compaction/summary.ts +4 -4
- package/src/compaction/verifier.ts +66 -0
- package/src/connector/BaseConnector.ts +19 -4
- package/src/connector/builtins/http.ts +236 -46
- package/src/connector/builtins/webhook.ts +207 -47
- package/src/connector/execution-contract.ts +27 -0
- package/src/connector/http-operation.ts +238 -0
- package/src/connector/mcp/adapter.ts +8 -3
- package/src/connector/mcp/client.ts +207 -58
- package/src/connector/mcp/http-sse.ts +91 -23
- package/src/connector/mcp/prompt-adapter.ts +8 -2
- package/src/connector/mcp/stdio.ts +21 -46
- package/src/connector/mcp/streamable-http.ts +86 -22
- package/src/connector/tools/adapter.ts +23 -14
- package/src/connector/tools/definitions.ts +5 -2
- package/src/connector/tools/result.ts +21 -0
- package/src/connector/web/guarded-fetch.ts +188 -48
- package/src/constants/sandbox/index.ts +3 -2
- package/src/contracts/api.ts +2 -0
- package/src/contracts/schemas.ts +7 -0
- package/src/directory/derive-supervisor.ts +8 -0
- package/src/directory/derive.ts +8 -0
- package/src/directory/load.ts +2 -0
- package/src/directory/types.ts +4 -0
- package/src/eval/experiment.ts +160 -111
- package/src/eval/judge.ts +13 -2
- package/src/eval/types.ts +7 -1
- package/src/manager/agent/lifecycle.ts +28 -12
- package/src/manager/connector/environment.ts +3 -1
- package/src/manager/connector/lifecycle.ts +364 -24
- package/src/manager/connector/tenant.ts +56 -23
- package/src/manager/goal/activation.ts +52 -0
- package/src/manager/index.ts +10 -2
- package/src/manager/run/persistence.ts +6 -1
- package/src/manager/topic/dependency.ts +39 -0
- package/src/manager/topic/lifecycle.ts +19 -31
- package/src/plugin/index.ts +1 -0
- package/src/plugin/lifecycle.ts +180 -39
- package/src/plugin/loader.ts +70 -13
- package/src/provider/collect-chat-completion.ts +3 -0
- package/src/provider/fallback.ts +79 -11
- package/src/provider/idle-timeout.ts +143 -17
- package/src/provider/index.ts +2 -0
- package/src/provider/instrumentation.ts +1 -0
- package/src/provider/retry.ts +16 -1
- package/src/public-runtime.ts +190 -32
- package/src/public-tools.ts +5 -0
- package/src/public-types.ts +85 -11
- package/src/rag/embedding.ts +147 -19
- package/src/rag/index.ts +1 -1
- package/src/rag/ingestion.ts +16 -2
- package/src/rag/knowledge-base.ts +13 -4
- package/src/rag/operation.ts +28 -0
- package/src/rag/rag-tool.ts +6 -3
- package/src/rag/retriever.ts +62 -11
- package/src/rag/vector-store.ts +8 -2
- package/src/registry/command/kernel-commands.ts +223 -4
- package/src/run/reporter.ts +10 -0
- package/src/run-query/index.ts +84 -15
- package/src/runtime/query/context.ts +13 -3
- package/src/runtime/query/executor.ts +90 -17
- package/src/runtime/query/guard.ts +12 -0
- package/src/runtime/query/index.ts +652 -103
- package/src/runtime/query/iteration/index.ts +89 -13
- package/src/runtime/query/iteration/phases/compaction.ts +120 -55
- package/src/runtime/query/iteration/phases/context.ts +4 -0
- package/src/runtime/query/iteration/phases/tool-review.ts +28 -0
- package/src/runtime/query/iteration/stream-turn.ts +3 -0
- package/src/runtime/query/project-instructions.ts +212 -0
- package/src/runtime/query/request-rich-content.ts +153 -0
- package/src/runtime/query/result.ts +12 -1
- package/src/runtime/query/resume-pending.ts +20 -18
- package/src/runtime/query/resume-run.ts +52 -8
- package/src/runtime/query/run-state.ts +11 -1
- package/src/runtime/query/sandbox-lifecycle.ts +210 -0
- package/src/sandbox/isolation.ts +9 -0
- package/src/sandbox/provider/local.ts +255 -90
- package/src/sandbox/terminal.ts +13 -5
- package/src/session/errors.ts +68 -42
- package/src/session/handoff/broadcast.ts +20 -14
- package/src/session/handoff/single.ts +14 -13
- package/src/store/attachment/index.ts +65 -3
- package/src/store/feedback/conformance.ts +39 -0
- package/src/store/feedback/disk.ts +128 -82
- package/src/store/goal/index.ts +594 -0
- package/src/store/index.ts +1 -1
- package/src/store/kv/revision-record-store.ts +346 -0
- package/src/store/memory/disk.ts +288 -113
- package/src/store/run/disk.ts +96 -5
- package/src/store/run/memory.ts +22 -2
- package/src/store/session/disk.ts +93 -6
- package/src/store/session/memory.ts +22 -0
- package/src/store/topic/memory.ts +4 -5
- package/src/store/topic/objective.ts +215 -100
- package/src/store/topic/state.ts +100 -63
- package/src/tools/builtins/bash.ts +21 -0
- package/src/tools/builtins/computer-use.ts +9 -1
- package/src/tools/builtins/content-fingerprint.ts +9 -12
- package/src/tools/builtins/edit.ts +190 -27
- package/src/tools/builtins/write-file.ts +55 -19
- package/src/tools/command-arguments.ts +54 -0
- package/src/tools/coordinator/index.ts +4 -1
- package/src/tools/defineTool.ts +11 -0
- package/src/tools/env-scrub.ts +7 -5
- package/src/tools/goal/index.ts +129 -0
- package/src/tools/memory/index.ts +26 -3
- package/src/tools/memory/search.ts +20 -3
- package/src/types/agent/base.ts +12 -3
- package/src/types/agent/factory.ts +2 -0
- package/src/types/agent/reactive.ts +2 -0
- package/src/types/agent/supervisor.ts +6 -0
- package/src/types/agent/task.ts +6 -2
- package/src/types/connector/core.ts +13 -8
- package/src/types/connector/definition.ts +54 -20
- package/src/types/connector/http.ts +7 -0
- package/src/types/connector/mcp.ts +27 -6
- package/src/types/connector/tenant.ts +21 -7
- package/src/types/connector/webhook.ts +7 -0
- package/src/types/goal/index.ts +50 -0
- package/src/types/ids/index.ts +2 -0
- package/src/types/message/index.ts +143 -9
- package/src/types/plugin/index.ts +7 -5
- package/src/types/provider/chat.ts +35 -4
- package/src/types/provider/interface.ts +22 -7
- package/src/types/provider/stream.ts +6 -0
- package/src/types/rag/embedding.ts +16 -2
- package/src/types/rag/ingestion.ts +2 -1
- package/src/types/rag/knowledge-base.ts +7 -3
- package/src/types/rag/retrieval.ts +2 -1
- package/src/types/rag/scope.ts +5 -0
- package/src/types/rag/vector.ts +5 -2
- package/src/types/run/config.ts +20 -0
- package/src/types/run/events.ts +28 -3
- package/src/types/run/metadata.ts +2 -0
- package/src/types/run/step.ts +2 -7
- package/src/types/run/store.ts +60 -2
- package/src/types/sandbox/index.ts +57 -14
- package/src/types/session/store.ts +18 -0
- package/src/types/tool/index.ts +33 -11
- package/src/types/topic/entity.ts +3 -4
- package/src/types/topic/store.ts +3 -3
- package/src/utils/id.ts +6 -0
- package/src/utils/process-environment.ts +101 -0
- package/src/vault/InMemoryCredentialVault.ts +29 -4
- package/src/vault/instrumentation.ts +24 -0
|
@@ -52,7 +52,8 @@ export interface LLMProvider {
|
|
|
52
52
|
*/
|
|
53
53
|
chatStream(params: ChatCompletionParams): AsyncIterable<StreamChunk>
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
/** Optional cancellation belongs to the surface asking for this menu. */
|
|
56
|
+
listModels?(signal?: AbortSignal): Promise<ModelInfo[]>
|
|
56
57
|
|
|
57
58
|
/**
|
|
58
59
|
* Establish whether this credential actually works. Resolves if it does,
|
|
@@ -87,7 +88,7 @@ export interface LLMProvider {
|
|
|
87
88
|
* as a bad key would tell an operator on broken wifi to go and rotate a
|
|
88
89
|
* credential that is fine.
|
|
89
90
|
*/
|
|
90
|
-
probeCredential?(): Promise<void>
|
|
91
|
+
probeCredential?(signal?: AbortSignal): Promise<void>
|
|
91
92
|
|
|
92
93
|
/**
|
|
93
94
|
* Is this driver able to serve traffic? A summary bit; `doctorCheck` is
|
|
@@ -132,11 +133,12 @@ export interface LLMProvider {
|
|
|
132
133
|
* the start rather than a quieter one. Building that choice needs the
|
|
133
134
|
* answer BEFORE the request exists.
|
|
134
135
|
*
|
|
135
|
-
* There are
|
|
136
|
+
* There are four states and they mean different things:
|
|
136
137
|
*
|
|
137
|
-
* - **method absent** — this driver
|
|
138
|
-
*
|
|
139
|
-
*
|
|
138
|
+
* - **method absent** — this driver cannot enumerate effort for any model.
|
|
139
|
+
* - **`undefined`** — the driver understands effort, but cannot establish
|
|
140
|
+
* the levels for this model id. Compatible endpoints with private model
|
|
141
|
+
* names are the common case. A caller must not fabricate a picker.
|
|
140
142
|
* - **empty array** — the driver implements effort and THIS model has no
|
|
141
143
|
* levels. A real answer, not a missing one.
|
|
142
144
|
* - **non-empty** — offer exactly these, and nothing else.
|
|
@@ -156,6 +158,18 @@ export interface LLMProvider {
|
|
|
156
158
|
* stale on the next model release and goes stale SILENTLY — surfacing as
|
|
157
159
|
* a vendor rejection rather than a failing build.
|
|
158
160
|
*/
|
|
161
|
+
reasoningEffortLevelsFor?(
|
|
162
|
+
model: string,
|
|
163
|
+
thinking?: import('./chat.js').ThinkingConfig,
|
|
164
|
+
): readonly import('./chat.js').ReasoningEffort[] | undefined
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Legacy effort menu which cannot distinguish an unknown model from a model
|
|
168
|
+
* with no effort support.
|
|
169
|
+
*
|
|
170
|
+
* @deprecated Implement and consume {@link LLMProvider.reasoningEffortLevelsFor}
|
|
171
|
+
* instead. Kept for one compatibility window; decorators still preserve it.
|
|
172
|
+
*/
|
|
159
173
|
effortLevelsFor?(
|
|
160
174
|
model: string,
|
|
161
175
|
thinking?: import('./chat.js').ThinkingConfig,
|
|
@@ -173,7 +187,8 @@ export interface LLMProvider {
|
|
|
173
187
|
* parses a real per-model `context_length` off the vendor listing and
|
|
174
188
|
* throws it away, because there was no member to return it through.
|
|
175
189
|
*
|
|
176
|
-
* Three states,
|
|
190
|
+
* Three states, like the non-empty half of
|
|
191
|
+
* {@link LLMProvider.reasoningEffortLevelsFor}: the
|
|
177
192
|
* member ABSENT means this driver cannot answer at all; a resolved
|
|
178
193
|
* `undefined` means it asked and does not know; a number is the answer.
|
|
179
194
|
* The three are different facts and collapsing any two of them turns
|
|
@@ -2,6 +2,12 @@ import type { TokenUsage } from '../common/index.js'
|
|
|
2
2
|
|
|
3
3
|
export interface StreamChunk {
|
|
4
4
|
id: string
|
|
5
|
+
/**
|
|
6
|
+
* Adapter-private lossless-JSON state for replaying the completed native
|
|
7
|
+
* assistant response. Emitted only once the state is complete; aggregators
|
|
8
|
+
* retain the last defined value and the query stores it in message source.
|
|
9
|
+
*/
|
|
10
|
+
replayState?: unknown
|
|
5
11
|
delta: {
|
|
6
12
|
content?: string
|
|
7
13
|
toolCalls?: Array<{
|
|
@@ -1,15 +1,24 @@
|
|
|
1
|
+
import type { RAGOperationOptions } from './scope.js'
|
|
2
|
+
|
|
1
3
|
export interface EmbeddingProvider {
|
|
2
4
|
readonly id: string
|
|
3
5
|
readonly model: string
|
|
4
6
|
readonly dimensions: number
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Implementations should stop owned I/O when `options.signal` aborts.
|
|
10
|
+
* A caller still bounds its own wait: a custom provider may be
|
|
11
|
+
* non-cooperative, just as any other host-supplied implementation may be.
|
|
12
|
+
*/
|
|
13
|
+
embed(texts: string[], options?: RAGOperationOptions): Promise<number[][]>
|
|
14
|
+
embedQuery(query: string, options?: RAGOperationOptions): Promise<number[]>
|
|
8
15
|
}
|
|
9
16
|
|
|
10
17
|
export interface EmbeddingConfig {
|
|
11
18
|
model: string
|
|
19
|
+
/** Expected positive vector width. HTTP responses with another width are refused. */
|
|
12
20
|
dimensions?: number
|
|
21
|
+
/** Positive number of inputs sent in one operation. */
|
|
13
22
|
batchSize?: number
|
|
14
23
|
}
|
|
15
24
|
|
|
@@ -25,4 +34,9 @@ export interface HttpEmbeddingConfig extends EmbeddingConfig {
|
|
|
25
34
|
apiKey: string
|
|
26
35
|
/** Root of an embeddings API; `/embeddings` is appended. */
|
|
27
36
|
baseUrl: string
|
|
37
|
+
/**
|
|
38
|
+
* Whole-request bound for each HTTP batch, including response-body reads.
|
|
39
|
+
* Defaults to 30 seconds. Set `0` to preserve the former unbounded behavior.
|
|
40
|
+
*/
|
|
41
|
+
requestTimeoutMs?: number
|
|
28
42
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DocumentId, KnowledgeBaseId } from '../ids/index.js'
|
|
2
|
-
import type { DocumentMetadata, TenantScope } from './scope.js'
|
|
2
|
+
import type { DocumentMetadata, RAGOperationOptions, TenantScope } from './scope.js'
|
|
3
3
|
|
|
4
4
|
export interface IngestionResult {
|
|
5
5
|
documentId: DocumentId
|
|
@@ -14,6 +14,7 @@ export interface IngestionPipeline {
|
|
|
14
14
|
metadata: DocumentMetadata,
|
|
15
15
|
scope: TenantScope,
|
|
16
16
|
knowledgeBaseId: KnowledgeBaseId,
|
|
17
|
+
options?: RAGOperationOptions,
|
|
17
18
|
): Promise<IngestionResult>
|
|
18
19
|
|
|
19
20
|
remove(documentId: DocumentId): Promise<void>
|
|
@@ -3,7 +3,7 @@ import type { ChunkingConfig } from './chunking.js'
|
|
|
3
3
|
import type { EmbeddingConfig } from './embedding.js'
|
|
4
4
|
import type { IngestionResult } from './ingestion.js'
|
|
5
5
|
import type { RetrievalConfig, RetrievalQuery, RetrievalResult } from './retrieval.js'
|
|
6
|
-
import type { DocumentMetadata } from './scope.js'
|
|
6
|
+
import type { DocumentMetadata, RAGOperationOptions } from './scope.js'
|
|
7
7
|
|
|
8
8
|
export interface KnowledgeBaseConfig {
|
|
9
9
|
id?: KnowledgeBaseId
|
|
@@ -20,8 +20,12 @@ export interface KnowledgeBase {
|
|
|
20
20
|
readonly id: KnowledgeBaseId
|
|
21
21
|
readonly config: KnowledgeBaseConfig
|
|
22
22
|
|
|
23
|
-
ingest(
|
|
23
|
+
ingest(
|
|
24
|
+
content: string,
|
|
25
|
+
metadata?: DocumentMetadata,
|
|
26
|
+
options?: RAGOperationOptions,
|
|
27
|
+
): Promise<IngestionResult>
|
|
24
28
|
remove(documentId: DocumentId): Promise<void>
|
|
25
|
-
query(query: RetrievalQuery): Promise<RetrievalResult>
|
|
29
|
+
query(query: RetrievalQuery, options?: RAGOperationOptions): Promise<RetrievalResult>
|
|
26
30
|
clear(): Promise<void>
|
|
27
31
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { KnowledgeBaseId } from '../ids/index.js'
|
|
2
2
|
import type { ProjectId } from '../session/ids.js'
|
|
3
|
-
import type { TenantScope } from './scope.js'
|
|
3
|
+
import type { RAGOperationOptions, TenantScope } from './scope.js'
|
|
4
4
|
import type { VectorSearchResult } from './vector.js'
|
|
5
5
|
|
|
6
6
|
export type RetrievalMode = 'vector' | 'keyword' | 'hybrid'
|
|
@@ -48,5 +48,6 @@ export interface Retriever {
|
|
|
48
48
|
query: RetrievalQuery,
|
|
49
49
|
scope: TenantScope,
|
|
50
50
|
knowledgeBaseId?: KnowledgeBaseId,
|
|
51
|
+
options?: RAGOperationOptions,
|
|
51
52
|
): Promise<RetrievalResult>
|
|
52
53
|
}
|
package/src/types/rag/scope.ts
CHANGED
|
@@ -5,6 +5,11 @@ export interface TenantScope {
|
|
|
5
5
|
namespace?: string
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
/** Cancellation shared by one public RAG operation and its downstream I/O. */
|
|
9
|
+
export interface RAGOperationOptions {
|
|
10
|
+
readonly signal?: AbortSignal
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
export interface DocumentMetadata {
|
|
9
14
|
source?: string
|
|
10
15
|
title?: string
|
package/src/types/rag/vector.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ChunkId, DocumentId, KnowledgeBaseId, TenantId } from '../ids/index.js'
|
|
2
|
+
import type { RAGOperationOptions } from './scope.js'
|
|
2
3
|
import type { Chunk } from './storage.js'
|
|
3
4
|
|
|
4
5
|
export interface VectorSearchResult {
|
|
@@ -27,8 +28,10 @@ export interface VectorStoreQuery {
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export interface VectorStore {
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
/** Persist chunks, stopping owned I/O when the operation is cancelled. */
|
|
32
|
+
upsert(chunks: Chunk[], options?: RAGOperationOptions): Promise<void>
|
|
33
|
+
/** Search chunks, stopping owned I/O when the operation is cancelled. */
|
|
34
|
+
search(query: VectorStoreQuery, options?: RAGOperationOptions): Promise<VectorSearchResult[]>
|
|
32
35
|
delete(chunkIds: ChunkId[]): Promise<void>
|
|
33
36
|
deleteByDocument(documentId: DocumentId): Promise<void>
|
|
34
37
|
deleteByKnowledgeBase(knowledgeBaseId: KnowledgeBaseId, tenantId: TenantId): Promise<void>
|
package/src/types/run/config.ts
CHANGED
|
@@ -8,6 +8,26 @@ import type { CheckpointStore } from './checkpoint-store.js'
|
|
|
8
8
|
export interface AgentRunConfig {
|
|
9
9
|
model: string
|
|
10
10
|
timeoutMs: number
|
|
11
|
+
/**
|
|
12
|
+
* Maximum silence between provider stream chunks, in milliseconds.
|
|
13
|
+
*
|
|
14
|
+
* Defaults to five minutes at the `query()` boundary. This is distinct
|
|
15
|
+
* from `timeoutMs`, which is checked between agent iterations and cannot
|
|
16
|
+
* settle a provider iterator whose pending `next()` never returns. Set
|
|
17
|
+
* `0` to retain unbounded stream silence. Positive values must be integer
|
|
18
|
+
* milliseconds accepted by the platform timer.
|
|
19
|
+
*/
|
|
20
|
+
streamIdleTimeoutMs?: number
|
|
21
|
+
/**
|
|
22
|
+
* Maximum accumulated inline image/document payload on one provider request.
|
|
23
|
+
*
|
|
24
|
+
* Defaults to 24 MiB. The budget is shared by user attachments and rich
|
|
25
|
+
* tool-result blocks. When history exceeds it, the provider-bound projection
|
|
26
|
+
* replaces the oldest values with model-visible omission markers; the run's
|
|
27
|
+
* canonical messages and durable evidence remain unchanged. Set `0` to keep
|
|
28
|
+
* the prior unbounded behaviour.
|
|
29
|
+
*/
|
|
30
|
+
maxRequestRichContentBytes?: number
|
|
11
31
|
maxResponseTokens?: number
|
|
12
32
|
|
|
13
33
|
/**
|
package/src/types/run/events.ts
CHANGED
|
@@ -581,15 +581,33 @@ type CoreRunEvent =
|
|
|
581
581
|
// run when the request asks for something the provider DRIVER declared
|
|
582
582
|
// it cannot do — tools registered against a no-tools driver (tool
|
|
583
583
|
// surfaces stripped so the model is never told about uncallable
|
|
584
|
-
// tools),
|
|
585
|
-
//
|
|
584
|
+
// tools), image attachments against a no-vision driver, or document
|
|
585
|
+
// attachments against a no-documents driver. Hosts surface these so
|
|
586
|
+
// degradation is visible, not silent.
|
|
586
587
|
| {
|
|
587
588
|
type: 'capability_warning'
|
|
588
589
|
runId: RunId
|
|
589
|
-
capability: 'tools' | 'vision'
|
|
590
|
+
capability: 'tools' | 'vision' | 'documents'
|
|
590
591
|
providerId: string
|
|
591
592
|
message: string
|
|
592
593
|
}
|
|
594
|
+
/**
|
|
595
|
+
* Provider-invalid tool history was repaired before the first model call.
|
|
596
|
+
*
|
|
597
|
+
* Counts, not content: a host can surface and audit the rewrite without
|
|
598
|
+
* copying tool output or conversation secrets into its event channel.
|
|
599
|
+
* `fresh-history` names caller-supplied history. `abandoned-checkpoint`
|
|
600
|
+
* excludes any incomplete turn still owned by a durable pending/recovered
|
|
601
|
+
* resume plan; that turn is completed by its authority path instead.
|
|
602
|
+
*/
|
|
603
|
+
| {
|
|
604
|
+
type: 'message_history_repaired'
|
|
605
|
+
runId: RunId
|
|
606
|
+
source: 'fresh-history' | 'abandoned-checkpoint'
|
|
607
|
+
duplicateToolResultsRemoved: number
|
|
608
|
+
orphanedToolResultsRemoved: number
|
|
609
|
+
syntheticToolResultsInserted: number
|
|
610
|
+
}
|
|
593
611
|
| {
|
|
594
612
|
type: 'token_usage_updated'
|
|
595
613
|
runId: RunId
|
|
@@ -623,6 +641,13 @@ type CoreRunEvent =
|
|
|
623
641
|
* Absent when the run has no compaction configuration, because
|
|
624
642
|
* nothing then resolves a window and inventing one would be the
|
|
625
643
|
* guess this exists to replace.
|
|
644
|
+
*
|
|
645
|
+
* This is a state snapshot, not merely a receipt for a model call.
|
|
646
|
+
* It is also emitted immediately after an automatic context edit:
|
|
647
|
+
* cumulative `usage`/`cost` may be unchanged (or may include a
|
|
648
|
+
* verifier call) while `contextTokens` falls to its post-edit
|
|
649
|
+
* estimate. Hosts therefore need not wait for another provider
|
|
650
|
+
* response to learn that compaction made room.
|
|
626
651
|
*/
|
|
627
652
|
contextTokens?: number
|
|
628
653
|
contextMeasuredBy?: 'provider' | 'estimate'
|
package/src/types/run/step.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CostInfo, TokenUsage } from '../common/index.js'
|
|
2
2
|
import type { MessageId } from '../ids/index.js'
|
|
3
|
-
import type { ToolCall } from '../message/index.js'
|
|
3
|
+
import type { ProviderRoute, ToolCall } from '../message/index.js'
|
|
4
4
|
import type { ProviderErrorCode } from '../provider/errors.js'
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -125,12 +125,7 @@ export interface StepResult {
|
|
|
125
125
|
* the same provider twice — two models, or two credentials, on one driver.
|
|
126
126
|
* `providerId` alone could not tell those apart.
|
|
127
127
|
*/
|
|
128
|
-
export interface StepProvenance {
|
|
129
|
-
readonly providerId: string
|
|
130
|
-
readonly model: string
|
|
131
|
-
/** 0 is the head, i.e. the provider the run was configured with. */
|
|
132
|
-
readonly chainIndex: number
|
|
133
|
-
}
|
|
128
|
+
export interface StepProvenance extends ProviderRoute {}
|
|
134
129
|
|
|
135
130
|
/**
|
|
136
131
|
* Why a step ended in `finishReason: 'error'`.
|
package/src/types/run/store.ts
CHANGED
|
@@ -27,10 +27,40 @@
|
|
|
27
27
|
* re-keyed per call, it happens once, deliberately, as its own change.
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
|
+
import type { Message } from '../message/index.js'
|
|
30
31
|
import type { AuditEvent } from './audit.js'
|
|
31
32
|
import type { Run } from './entity.js'
|
|
32
33
|
import type { PersistedRunEvent, RunEvent } from './events.js'
|
|
33
34
|
|
|
35
|
+
/**
|
|
36
|
+
* The run's surviving message history, and whether it can be placed against
|
|
37
|
+
* the durable event log without guessing.
|
|
38
|
+
*
|
|
39
|
+
* `available` is stronger than "some bytes were found": `throughEventSeq`
|
|
40
|
+
* names the exact event-log head the snapshot was published after. A caller
|
|
41
|
+
* can therefore refuse a stale snapshot left by an earlier pause or a crash
|
|
42
|
+
* during final persistence instead of presenting it as the whole run.
|
|
43
|
+
*
|
|
44
|
+
* `legacy-unverified` preserves read access to the raw message arrays written
|
|
45
|
+
* before snapshots carried that boundary. Those messages are real, but no
|
|
46
|
+
* stored fact proves which event-log head they represent, so they must not be
|
|
47
|
+
* used to claim a complete transcript.
|
|
48
|
+
*/
|
|
49
|
+
export type RunMessageSnapshot =
|
|
50
|
+
| {
|
|
51
|
+
readonly kind: 'available'
|
|
52
|
+
readonly throughEventSeq: number
|
|
53
|
+
readonly messages: readonly Message[]
|
|
54
|
+
}
|
|
55
|
+
| {
|
|
56
|
+
readonly kind: 'legacy-unverified'
|
|
57
|
+
readonly messages: readonly Message[]
|
|
58
|
+
}
|
|
59
|
+
| {
|
|
60
|
+
readonly kind: 'unavailable'
|
|
61
|
+
readonly reason: 'not-persisted'
|
|
62
|
+
}
|
|
63
|
+
|
|
34
64
|
/** What a caller asks the log for. See {@link RunStore.readEvents}. */
|
|
35
65
|
export interface ReadRunEventsOptions {
|
|
36
66
|
/**
|
|
@@ -41,6 +71,17 @@ export interface ReadRunEventsOptions {
|
|
|
41
71
|
* delivered twice. Absent means the whole log.
|
|
42
72
|
*/
|
|
43
73
|
readonly sinceSeq?: number
|
|
74
|
+
/**
|
|
75
|
+
* Refuse a disk transcript with a torn, malformed, or discontinuously
|
|
76
|
+
* numbered record instead of skipping past it.
|
|
77
|
+
*
|
|
78
|
+
* The default stays `tolerant`: an incident viewer is usually better served
|
|
79
|
+
* by every intact event around one damaged line. A caller making a
|
|
80
|
+
* completeness claim — an export, a replay proof, an archive — chooses
|
|
81
|
+
* `strict`, because one skipped line makes that claim false even when the
|
|
82
|
+
* rest of the log remains useful.
|
|
83
|
+
*/
|
|
84
|
+
readonly integrity?: 'tolerant' | 'strict'
|
|
44
85
|
}
|
|
45
86
|
|
|
46
87
|
/**
|
|
@@ -72,8 +113,25 @@ export interface RunStore {
|
|
|
72
113
|
/** Persist the run record: status, metadata, usage, timings. */
|
|
73
114
|
writeRunMeta(run: Run): Promise<void>
|
|
74
115
|
|
|
75
|
-
/**
|
|
76
|
-
|
|
116
|
+
/**
|
|
117
|
+
* Publish the run's surviving message history through a durable event.
|
|
118
|
+
*
|
|
119
|
+
* The boundary is required. Messages are written after the terminal or
|
|
120
|
+
* pause event, and a resumed run reuses the same run id; without the
|
|
121
|
+
* boundary an older, valid file is indistinguishable from the current
|
|
122
|
+
* run's final snapshot.
|
|
123
|
+
*/
|
|
124
|
+
writeMessages(run: Run, throughEventSeq: number): Promise<void>
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Read the published message snapshot back.
|
|
128
|
+
*
|
|
129
|
+
* Missing data is `unavailable`, never an available empty list. An empty
|
|
130
|
+
* list is a real snapshot only after {@link RunStore.writeMessages}
|
|
131
|
+
* explicitly published it. This distinction closes the crash window where
|
|
132
|
+
* the run's terminal event and metadata landed but its messages did not.
|
|
133
|
+
*/
|
|
134
|
+
readMessages(): Promise<RunMessageSnapshot>
|
|
77
135
|
|
|
78
136
|
/**
|
|
79
137
|
* Append one event to the run's durable event log.
|
|
@@ -31,7 +31,25 @@ export function assertSandboxStatus(status: SandboxStatus): void {
|
|
|
31
31
|
// Sandbox environment — detected platform capability
|
|
32
32
|
// ---------------------------------------------------------------------------
|
|
33
33
|
|
|
34
|
-
export type SandboxEnvironment = 'linux-namespace' | 'macos-seatbelt' | 'basic'
|
|
34
|
+
export type SandboxEnvironment = 'linux-bwrap' | 'linux-namespace' | 'macos-seatbelt' | 'basic'
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Every tier, in the order a detector prefers them: strongest first.
|
|
38
|
+
*
|
|
39
|
+
* Exported because the alternative is what was there — a hand-written
|
|
40
|
+
* alternation in a doctor test that had to be edited by whoever added a tier,
|
|
41
|
+
* and was not, so the first new tier in a year failed a test that was
|
|
42
|
+
* describing the tier list rather than checking anything about it.
|
|
43
|
+
*
|
|
44
|
+
* `assertSandboxEnvironment` reads this too, so the union, the runtime list and
|
|
45
|
+
* the exhaustive check cannot drift apart.
|
|
46
|
+
*/
|
|
47
|
+
export const SANDBOX_ENVIRONMENTS: readonly SandboxEnvironment[] = [
|
|
48
|
+
'linux-bwrap',
|
|
49
|
+
'macos-seatbelt',
|
|
50
|
+
'linux-namespace',
|
|
51
|
+
'basic',
|
|
52
|
+
]
|
|
35
53
|
|
|
36
54
|
/**
|
|
37
55
|
* A security control a sandbox tier either provides or does not.
|
|
@@ -60,16 +78,11 @@ export const SANDBOX_ISOLATION_CONTROLS: readonly SandboxIsolationControl[] = [
|
|
|
60
78
|
export type SandboxIsolationReport = Readonly<Record<SandboxIsolationControl, boolean>>
|
|
61
79
|
|
|
62
80
|
export function assertSandboxEnvironment(env: SandboxEnvironment): void {
|
|
63
|
-
switch
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
default: {
|
|
69
|
-
const _exhaustive: never = env
|
|
70
|
-
throw new Error(`Unknown SandboxEnvironment: ${_exhaustive}`)
|
|
71
|
-
}
|
|
72
|
-
}
|
|
81
|
+
// Membership, not a switch. A `case` per tier is a second list to keep in
|
|
82
|
+
// step with the union, and the switch's `never` arm only catches a tier
|
|
83
|
+
// ADDED to the union — never one added here and forgotten there.
|
|
84
|
+
if (SANDBOX_ENVIRONMENTS.includes(env)) return
|
|
85
|
+
throw new Error(`Unknown SandboxEnvironment: ${env}`)
|
|
73
86
|
}
|
|
74
87
|
|
|
75
88
|
// ---------------------------------------------------------------------------
|
|
@@ -207,7 +220,8 @@ export interface Sandbox {
|
|
|
207
220
|
setNetworkPolicy?(policy: SandboxNetworkPolicy): Promise<void>
|
|
208
221
|
|
|
209
222
|
/**
|
|
210
|
-
* Open a real pseudo-terminal
|
|
223
|
+
* Open a real pseudo-terminal whose complete process tree is confined to
|
|
224
|
+
* and owned by this sandbox.
|
|
211
225
|
*
|
|
212
226
|
* Optional, and a backend that cannot provide one must **throw** rather
|
|
213
227
|
* than hand back a pipe — the same rule {@link Sandbox.setNetworkPolicy}
|
|
@@ -217,7 +231,14 @@ export interface Sandbox {
|
|
|
217
231
|
* exits immediately, the progress bar prints ten thousand lines, and
|
|
218
232
|
* nothing says why.
|
|
219
233
|
*
|
|
220
|
-
*
|
|
234
|
+
* A backend that implements this method MUST make {@link destroy} kill and
|
|
235
|
+
* await every terminal it returned. Merely starting a host pseudo-terminal
|
|
236
|
+
* with `rootDir` as its working directory does not satisfy either the
|
|
237
|
+
* confinement or the ownership contract.
|
|
238
|
+
*
|
|
239
|
+
* @deprecated No built-in backend currently satisfies both guarantees.
|
|
240
|
+
* Use a separately owned terminal backend; this member will be removed in
|
|
241
|
+
* a future major release after the repository's deprecation window.
|
|
221
242
|
*/
|
|
222
243
|
openTerminal?(options: OpenTerminalOptions): Promise<TerminalSession>
|
|
223
244
|
writeFile(path: string, content: string | Buffer): Promise<void>
|
|
@@ -242,7 +263,20 @@ export interface Sandbox {
|
|
|
242
263
|
* MAY throw for other I/O failures.
|
|
243
264
|
*/
|
|
244
265
|
listFiles(rootPath: string): Promise<readonly SandboxFileEntry[]>
|
|
245
|
-
|
|
266
|
+
/**
|
|
267
|
+
* Release every resource owned by this sandbox.
|
|
268
|
+
*
|
|
269
|
+
* The signal belongs to a fresh teardown operation, not to the run that is
|
|
270
|
+
* already ending. Implementations should stop their teardown transport and
|
|
271
|
+
* settle promptly when it aborts. Hosts may still impose an independent
|
|
272
|
+
* wait bound because a third-party implementation can ignore the signal.
|
|
273
|
+
*/
|
|
274
|
+
destroy(options?: SandboxDestroyOptions): Promise<void>
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/** Authority for a teardown operation owned independently of the ending run. */
|
|
278
|
+
export interface SandboxDestroyOptions {
|
|
279
|
+
readonly signal?: AbortSignal
|
|
246
280
|
}
|
|
247
281
|
|
|
248
282
|
// ---------------------------------------------------------------------------
|
|
@@ -418,6 +452,15 @@ export interface ResolvedContainerSandboxLayout {
|
|
|
418
452
|
// ---------------------------------------------------------------------------
|
|
419
453
|
|
|
420
454
|
export interface SandboxCreateConfig {
|
|
455
|
+
/**
|
|
456
|
+
* Withdraws authority to publish the allocation to the run.
|
|
457
|
+
*
|
|
458
|
+
* Providers should stop their transport and reconcile any resource they can
|
|
459
|
+
* identify. This signal is not, by itself, proof that a remote allocation
|
|
460
|
+
* was rolled back: a service that commits before returning its identifier
|
|
461
|
+
* still needs a client-owned reconciliation key or an external reaper.
|
|
462
|
+
*/
|
|
463
|
+
readonly signal?: AbortSignal
|
|
421
464
|
readonly workingDirectory?: string
|
|
422
465
|
readonly env?: Record<string, string>
|
|
423
466
|
readonly timeoutMs?: number
|
|
@@ -321,6 +321,24 @@ export interface SessionStore {
|
|
|
321
321
|
*/
|
|
322
322
|
appendMessage(sessionId: SessionId, message: Message, tenantId: TenantId): Promise<MessageId>
|
|
323
323
|
|
|
324
|
+
/**
|
|
325
|
+
* Replace the conversation view with a compacted history. OPTIONAL.
|
|
326
|
+
*
|
|
327
|
+
* This is not deletion of the underlying log. A durable implementation may
|
|
328
|
+
* append one replacement record and project every later read from it, which
|
|
329
|
+
* keeps the write atomic while preserving the earlier records for recovery.
|
|
330
|
+
*
|
|
331
|
+
* Optional because existing hosts implement this interface, and manual
|
|
332
|
+
* compaction is a host capability rather than a requirement every store must
|
|
333
|
+
* gain. A caller that offers durable compaction checks for it and refuses to
|
|
334
|
+
* claim persistence when the store cannot perform the replacement.
|
|
335
|
+
*/
|
|
336
|
+
replaceMessages?(
|
|
337
|
+
sessionId: SessionId,
|
|
338
|
+
messages: readonly Message[],
|
|
339
|
+
tenantId: TenantId,
|
|
340
|
+
): Promise<void>
|
|
341
|
+
|
|
324
342
|
/**
|
|
325
343
|
* Load the full message history for a session in insertion order.
|
|
326
344
|
* Returns an empty array when the session has no messages.
|
package/src/types/tool/index.ts
CHANGED
|
@@ -18,16 +18,6 @@ export interface ToolRegistryRef {
|
|
|
18
18
|
getAvailability(name: string): ToolAvailability
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
/**
|
|
22
|
-
* The slice of the background job registry a tool is given.
|
|
23
|
-
*
|
|
24
|
-
* A structural reference rather than the class, for the reason
|
|
25
|
-
* `ToolRegistryRef` exists: this type file is imported by everything, and
|
|
26
|
-
* naming the implementation here would drag a `node:child_process` module
|
|
27
|
-
* into every consumer's type graph. `owner` is not on this surface at all —
|
|
28
|
-
* the executor binds it to the run, so a tool cannot start a job that
|
|
29
|
-
* outlives, or is billed to, somebody else's run.
|
|
30
|
-
*/
|
|
31
21
|
/**
|
|
32
22
|
* The slice of the skills registry a tool is given.
|
|
33
23
|
*
|
|
@@ -67,6 +57,16 @@ export interface SkillRegistryRef {
|
|
|
67
57
|
names(): readonly string[]
|
|
68
58
|
}
|
|
69
59
|
|
|
60
|
+
/**
|
|
61
|
+
* The slice of the background job registry a tool is given.
|
|
62
|
+
*
|
|
63
|
+
* A structural reference rather than the class, for the reason
|
|
64
|
+
* `ToolRegistryRef` exists: this type file is imported by everything, and
|
|
65
|
+
* naming the implementation here would drag a `node:child_process` module
|
|
66
|
+
* into every consumer's type graph. `owner` is not on this surface at all —
|
|
67
|
+
* the executor binds it to the run, so a tool cannot start a job that
|
|
68
|
+
* outlives, or is billed to, somebody else's run.
|
|
69
|
+
*/
|
|
70
70
|
export interface BackgroundJobRegistryRef {
|
|
71
71
|
start(params: { command: string; workingDirectory: string }): { id: string; status: string }
|
|
72
72
|
get(id: string): { id: string; status: string; exitCode?: number }
|
|
@@ -207,7 +207,9 @@ export interface ToolContext {
|
|
|
207
207
|
* `linux-namespace` tier the wrapping `sh` is PID 1 of a fresh PID
|
|
208
208
|
* namespace, so a backgrounded grandchild dies the moment that shell
|
|
209
209
|
* exits, on the successful path. It returns in milliseconds looking like
|
|
210
|
-
* it worked, with the work already dead.
|
|
210
|
+
* it worked, with the work already dead. It is also absent from sandboxed
|
|
211
|
+
* query-built contexts: the shipped registry owns host processes and
|
|
212
|
+
* cannot preserve a sandbox boundary.
|
|
211
213
|
*/
|
|
212
214
|
backgroundJobs?: BackgroundJobRegistryRef
|
|
213
215
|
|
|
@@ -415,6 +417,26 @@ export interface ToolDefinition<TInput = unknown> extends ToolPresentation<TInpu
|
|
|
415
417
|
* request.
|
|
416
418
|
*/
|
|
417
419
|
outputSchema?: Record<string, unknown>
|
|
420
|
+
/**
|
|
421
|
+
* The argument that holds a shell command line, when one does.
|
|
422
|
+
*
|
|
423
|
+
* Declared on the tool because only the tool knows. An operator writing
|
|
424
|
+
* `bash = { "git status*" = "allow" }` means the `command` argument, and
|
|
425
|
+
* every other way of learning that is a list somewhere else that drifts:
|
|
426
|
+
* a host compiling permissions has the tool's NAME and no reason to know
|
|
427
|
+
* which of its arguments is the interesting one.
|
|
428
|
+
*
|
|
429
|
+
* What it buys is the difference between a permission about text and a
|
|
430
|
+
* permission about commands. A rule routed through this argument reads
|
|
431
|
+
* `git status && rm -rf ~` as the two commands it is, so an `allow`
|
|
432
|
+
* written for `git status*` declines it instead of approving it on the
|
|
433
|
+
* strength of the first few words. See `decomposeCommandLine`.
|
|
434
|
+
*
|
|
435
|
+
* Omit it on every tool that takes no command line. A tool that runs
|
|
436
|
+
* something but takes an argument list rather than a line — no shell, no
|
|
437
|
+
* chaining — has nothing to decompose and must not claim otherwise.
|
|
438
|
+
*/
|
|
439
|
+
commandArgument?: string
|
|
418
440
|
execute(input: TInput, context: ToolContext): Promise<ToolResult>
|
|
419
441
|
tier?: string
|
|
420
442
|
permissions?: ToolPermission[]
|
|
@@ -67,10 +67,9 @@ export type TopicStatus = 'open' | 'archived'
|
|
|
67
67
|
* the kernel.
|
|
68
68
|
* - `ownerVersion` is the CAS counter for mutations — `updateTopic` and
|
|
69
69
|
* archival transitions require a matching version and reject
|
|
70
|
-
* {@link import('../../session/errors.js').
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* (§6.1).
|
|
70
|
+
* {@link import('../../session/errors.js').StaleTopicError} on mismatch
|
|
71
|
+
* with `details.topicId`. Mirrors the
|
|
72
|
+
* {@link import('./entity.js').Session} handoff CAS pattern (§6.1).
|
|
74
73
|
* - No fan-in `deriveStatus()` helper — status is owner-managed, not
|
|
75
74
|
* Run-derived. This is the Topic-vs-Session contract boundary.
|
|
76
75
|
*/
|
package/src/types/topic/store.ts
CHANGED
|
@@ -69,9 +69,9 @@ export interface TopicStore {
|
|
|
69
69
|
/**
|
|
70
70
|
* Persist a mutation to a Topic record. CAS on `ownerVersion`: if the
|
|
71
71
|
* supplied `topic.ownerVersion` does not match the persisted version,
|
|
72
|
-
* rejects with {@link import('../../session/errors.js').
|
|
73
|
-
*
|
|
74
|
-
*
|
|
72
|
+
* rejects with {@link import('../../session/errors.js').StaleTopicError}
|
|
73
|
+
* using `details.topicId`. On success the write commits with `ownerVersion
|
|
74
|
+
* + 1` and a refreshed `updatedAt`.
|
|
75
75
|
*
|
|
76
76
|
* Archival transition (`status: 'open' → 'archived'`) shares this path;
|
|
77
77
|
* the caller is responsible for verifying that no non-terminal Sessions
|