@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
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mkdir, readFile } from 'node:fs/promises'
|
|
2
2
|
import { dirname } from 'node:path'
|
|
3
3
|
import { z } from 'zod'
|
|
4
4
|
import type { ToolContext, ToolResult } from '../../types/tool/index.js'
|
|
5
5
|
import { defineTool } from '../defineTool.js'
|
|
6
6
|
import { resolveWithinReal } from '../paths.js'
|
|
7
7
|
import { atomicWriteFile } from './atomic-write-file.js'
|
|
8
|
+
import { fingerprintContent, staleFileError } from './content-fingerprint.js'
|
|
8
9
|
import { withFileMutationLock } from './file-mutation-lock.js'
|
|
9
10
|
|
|
10
11
|
const inputSchema = z
|
|
@@ -144,13 +145,16 @@ export const WriteFileTool = defineTool({
|
|
|
144
145
|
|
|
145
146
|
return withFileMutationLock(lockKey, async () => {
|
|
146
147
|
if (context.sandbox) {
|
|
147
|
-
const
|
|
148
|
-
if (
|
|
149
|
-
const guard =
|
|
148
|
+
const current = await readSandboxFileIfPresent(context, valid.path)
|
|
149
|
+
if (current !== undefined) {
|
|
150
|
+
const guard = enforceFreshOverwrite(context, valid.path, current.toString('utf-8'))
|
|
150
151
|
if (guard) return guard
|
|
151
152
|
}
|
|
152
153
|
await context.sandbox.writeFile(valid.path, content)
|
|
153
|
-
|
|
154
|
+
// This write is now the runtime's newest observation. Recording only
|
|
155
|
+
// the boolean would leave an older content fingerprint in place and
|
|
156
|
+
// make the next same-run write refuse its own predecessor as drift.
|
|
157
|
+
context.fileReadTracker?.recordRead(valid.path, content)
|
|
154
158
|
return {
|
|
155
159
|
success: true as const,
|
|
156
160
|
output: `File written successfully: ${valid.path} (${content.length} chars) [sandboxed]`,
|
|
@@ -159,9 +163,9 @@ export const WriteFileTool = defineTool({
|
|
|
159
163
|
}
|
|
160
164
|
|
|
161
165
|
const hostPath = filePath as string
|
|
162
|
-
const
|
|
163
|
-
if (
|
|
164
|
-
const guard =
|
|
166
|
+
const current = await readHostFileIfPresent(hostPath)
|
|
167
|
+
if (current !== undefined) {
|
|
168
|
+
const guard = enforceFreshOverwrite(context, hostPath, current)
|
|
165
169
|
if (guard) return guard
|
|
166
170
|
}
|
|
167
171
|
|
|
@@ -170,7 +174,7 @@ export const WriteFileTool = defineTool({
|
|
|
170
174
|
// leaves the destination truncated — and this tool overwrites a
|
|
171
175
|
// whole file, so the truncation is the user's previous work.
|
|
172
176
|
await atomicWriteFile(hostPath, content)
|
|
173
|
-
context.fileReadTracker?.recordRead(hostPath)
|
|
177
|
+
context.fileReadTracker?.recordRead(hostPath, content)
|
|
174
178
|
|
|
175
179
|
return {
|
|
176
180
|
success: true as const,
|
|
@@ -194,21 +198,53 @@ function enforceReadBeforeOverwrite(
|
|
|
194
198
|
}
|
|
195
199
|
}
|
|
196
200
|
|
|
197
|
-
|
|
201
|
+
function enforceFreshOverwrite(
|
|
202
|
+
context: ToolContext,
|
|
203
|
+
key: string,
|
|
204
|
+
currentContent: string,
|
|
205
|
+
): { success: false; output: ''; error: string } | null {
|
|
206
|
+
const unread = enforceReadBeforeOverwrite(context, key)
|
|
207
|
+
if (unread) return unread
|
|
208
|
+
|
|
209
|
+
// Optional forever: older hosts only tracked the boolean read-before-write
|
|
210
|
+
// fact. They retain their old behavior rather than being refused on a
|
|
211
|
+
// fingerprint the host never promised to capture.
|
|
212
|
+
const observed = context.fileReadTracker?.fingerprint?.(key)
|
|
213
|
+
if (observed !== undefined && observed !== fingerprintContent(currentContent)) {
|
|
214
|
+
return { success: false, output: '', error: staleFileError(key, 'write') }
|
|
215
|
+
}
|
|
216
|
+
return null
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
async function readHostFileIfPresent(hostPath: string): Promise<string | undefined> {
|
|
198
220
|
try {
|
|
199
|
-
await
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
221
|
+
return await readFile(hostPath, 'utf-8')
|
|
222
|
+
} catch (error) {
|
|
223
|
+
if (isMissingFileError(error)) return undefined
|
|
224
|
+
throw error
|
|
203
225
|
}
|
|
204
226
|
}
|
|
205
227
|
|
|
206
|
-
|
|
207
|
-
|
|
228
|
+
function isMissingFileError(error: unknown): boolean {
|
|
229
|
+
return (
|
|
230
|
+
typeof error === 'object' &&
|
|
231
|
+
error !== null &&
|
|
232
|
+
'code' in error &&
|
|
233
|
+
(error as { code?: unknown }).code === 'ENOENT'
|
|
234
|
+
)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
async function readSandboxFileIfPresent(
|
|
238
|
+
context: ToolContext,
|
|
239
|
+
path: string,
|
|
240
|
+
): Promise<Buffer | undefined> {
|
|
241
|
+
if (!context.sandbox) return undefined
|
|
208
242
|
try {
|
|
209
|
-
await context.sandbox.readFile(path)
|
|
210
|
-
return true
|
|
243
|
+
return await context.sandbox.readFile(path)
|
|
211
244
|
} catch {
|
|
212
|
-
|
|
245
|
+
// `Sandbox` currently has no typed missing-file result. Preserve the
|
|
246
|
+
// existing create behavior for all backends; when a read succeeds, the
|
|
247
|
+
// exact body above is still a real admission-time freshness check.
|
|
248
|
+
return undefined
|
|
213
249
|
}
|
|
214
250
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which argument of a tool holds a shell command line.
|
|
3
|
+
*
|
|
4
|
+
* ## Why a host needs this
|
|
5
|
+
*
|
|
6
|
+
* A host that compiles operator config into gate rules has a tool NAME and a
|
|
7
|
+
* pattern, and needs an argument to attach the pattern to. Without one it can
|
|
8
|
+
* only reach for `custom_pattern`, whose subject is `JSON.stringify(input)` —
|
|
9
|
+
* and matching a glob against a serialised object costs both halves of what an
|
|
10
|
+
* operator meant. The pattern can match the start of any argument's value
|
|
11
|
+
* rather than the one they had in mind, and it stays open on the right, so
|
|
12
|
+
* `bash = { "git status*" = "allow" }` compiled to a rule that also approved
|
|
13
|
+
* `git status && rm -rf ~`.
|
|
14
|
+
*
|
|
15
|
+
* `argument_pattern` has neither problem, and it reads the value as the
|
|
16
|
+
* commands it runs. Reaching it needs exactly one fact this function supplies.
|
|
17
|
+
*
|
|
18
|
+
* ## Why it is derived rather than written down
|
|
19
|
+
*
|
|
20
|
+
* A list of "tools whose first argument is a command" maintained beside the
|
|
21
|
+
* tools is a list that drifts from them, and this repository has now gated
|
|
22
|
+
* that same shape four times. So the fact lives on the tool as
|
|
23
|
+
* {@link ToolDefinition.commandArgument} and this reads it back.
|
|
24
|
+
*
|
|
25
|
+
* A host with its own tools should ask {@link commandArgumentOf} with the
|
|
26
|
+
* definition it already holds. {@link builtinCommandArguments} exists for the
|
|
27
|
+
* case where only the name is available — permission config is compiled before
|
|
28
|
+
* any tool is constructed — and answers for the builtin set alone. An unknown
|
|
29
|
+
* name gets `undefined`, which is a host falling back to what it did before
|
|
30
|
+
* rather than a wrong answer.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
import type { ToolDefinition } from '../types/tool/index.js'
|
|
34
|
+
import { getBuiltinTools } from './builtins/index.js'
|
|
35
|
+
|
|
36
|
+
/** The argument holding a command line, or undefined when the tool has none. */
|
|
37
|
+
export function commandArgumentOf(tool: ToolDefinition): string | undefined {
|
|
38
|
+
return tool.commandArgument
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The builtin tools that take a command line, by tool name.
|
|
43
|
+
*
|
|
44
|
+
* Computed on each call rather than cached at module load: a frozen snapshot
|
|
45
|
+
* taken at import time is a copy of the registry, and a copy is the thing this
|
|
46
|
+
* module exists to avoid.
|
|
47
|
+
*/
|
|
48
|
+
export function builtinCommandArguments(): ReadonlyMap<string, string> {
|
|
49
|
+
const byName = new Map<string, string>()
|
|
50
|
+
for (const tool of getBuiltinTools()) {
|
|
51
|
+
if (tool.commandArgument !== undefined) byName.set(tool.name, tool.commandArgument)
|
|
52
|
+
}
|
|
53
|
+
return byName
|
|
54
|
+
}
|
|
@@ -107,6 +107,9 @@ export interface CoordinatorToolsOptions {
|
|
|
107
107
|
pendingAnswers?: PendingAnswers
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
/** Internal identity shared by the builder and the agent authority boundary. */
|
|
111
|
+
export const ASK_USER_QUESTION_TOOL_NAME = 'ask_user_question' as const
|
|
112
|
+
|
|
110
113
|
const approvePlanStepSchema = z.object({
|
|
111
114
|
description: z.string().describe('What this step does'),
|
|
112
115
|
agent_id: z
|
|
@@ -1472,7 +1475,7 @@ export function buildCoordinatorTools(opts: CoordinatorToolsOptions): ToolDefini
|
|
|
1472
1475
|
const parkRunId = runId
|
|
1473
1476
|
const parkHandler = resumeHandler
|
|
1474
1477
|
const askUserQuestion = defineTool({
|
|
1475
|
-
name:
|
|
1478
|
+
name: ASK_USER_QUESTION_TOOL_NAME,
|
|
1476
1479
|
description:
|
|
1477
1480
|
'Ask the user ONE question ONLY when you are blocked on a decision that is genuinely theirs to make — one you cannot resolve from their request, your tools, the files you can read, or sensible defaults. The question must be the genuinely undecidable thing in THIS task. Never ask for information a tool can discover (do not ask what you can read, list, or search), never re-ask what the conversation already answers, and never ask meta-questions like "Shall I proceed?" — plan ratification goes through approve_plan. Provide 2-4 genuinely distinct options derived from the actual context — concrete paths, never generic placeholders (for example, asked to prepare a presentation, ask "Who is the audience?" with options like Board / Engineering team / Customer); keep labels short (1-5 words) and give each option a one-line description of what practically changes if it is chosen. Put your recommended option FIRST and append " (Recommended)" to its label. Set multiSelect: true only when several options can apply at once. A free-text "Something else" escape hatch is always shown automatically — do not add your own "Other" option. Ask ONE question per call and prefer at most one question per assistant turn; if several decisions block you, ask only the ones that materially change your next actions, in sequence — most work needs at most 2-3 questions, so prefer proceeding on stated defaults over interrogating the user. Never invent answers or synthetic content on the user\'s behalf unless they explicitly asked for a random/test scenario. The answer arrives as this tool\'s result; if the result says the user did not answer, do not ask this or any other question again — proceed on your best judgment without assuming consent.',
|
|
1478
1481
|
inputSchema: z
|
package/src/tools/defineTool.ts
CHANGED
|
@@ -48,6 +48,16 @@ export interface DefineToolOptions<S extends z.ZodType> {
|
|
|
48
48
|
outputSchema?: Record<string, unknown>
|
|
49
49
|
/** Settle the run with this tool's output; see {@link ToolDefinition.terminal}. */
|
|
50
50
|
terminal?: boolean
|
|
51
|
+
/**
|
|
52
|
+
* The argument holding a shell command line; see
|
|
53
|
+
* {@link ToolDefinition.commandArgument}.
|
|
54
|
+
*
|
|
55
|
+
* Here as well as on the definition for the reason `maxRetries` and
|
|
56
|
+
* `presentCall` are: this builder is the sanctioned way to author a tool,
|
|
57
|
+
* and a field a host reads that the builder cannot set is a field only
|
|
58
|
+
* hand-written definitions can use.
|
|
59
|
+
*/
|
|
60
|
+
commandArgument?: string
|
|
51
61
|
execute(input: z.infer<S>, context: ToolContext): Promise<ToolResult>
|
|
52
62
|
}
|
|
53
63
|
|
|
@@ -66,6 +76,7 @@ export function defineTool<S extends z.ZodType>(
|
|
|
66
76
|
tier: options.tier,
|
|
67
77
|
...(options.timeoutMs !== undefined ? { timeoutMs: options.timeoutMs } : {}),
|
|
68
78
|
...(options.maxRetries !== undefined ? { maxRetries: options.maxRetries } : {}),
|
|
79
|
+
...(options.commandArgument !== undefined ? { commandArgument: options.commandArgument } : {}),
|
|
69
80
|
...(options.presentCall ? { presentCall: options.presentCall } : {}),
|
|
70
81
|
...(options.presentResult ? { presentResult: options.presentResult } : {}),
|
|
71
82
|
...(options.outputSchema !== undefined ? { outputSchema: options.outputSchema } : {}),
|
package/src/tools/env-scrub.ts
CHANGED
|
@@ -20,11 +20,13 @@
|
|
|
20
20
|
* still reach the command.
|
|
21
21
|
*
|
|
22
22
|
* The actual boundary is the sandbox, where the inherited set is an allowlist
|
|
23
|
-
* (
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
23
|
+
* (the local sandbox's bounded core-process keys) rather than a denylist. Its
|
|
24
|
+
* Windows branch includes the system-root, command-interpreter and profile
|
|
25
|
+
* plumbing a working Windows child needs; it still carries no ambient
|
|
26
|
+
* credential keys. An allowlist is correct there because a sandbox is a fresh
|
|
27
|
+
* environment; it is wrong on the host path, where the same agent is expected
|
|
28
|
+
* to run `pnpm test`, `make` and `docker build`, all of which need far more
|
|
29
|
+
* variables. So the host path gets the weaker control on purpose, and says so.
|
|
28
30
|
*
|
|
29
31
|
* ## Why this exists at all
|
|
30
32
|
*
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
import { GoalNotFoundError, type SessionGoalStore, StaleGoalError } from '../../store/goal/index.js'
|
|
4
|
+
import type { GoalRoundAuthority, SessionGoal } from '../../types/goal/index.js'
|
|
5
|
+
import type { RunId } from '../../types/ids/index.js'
|
|
6
|
+
import type { ToolDefinition } from '../../types/tool/index.js'
|
|
7
|
+
import { defineTool } from '../defineTool.js'
|
|
8
|
+
|
|
9
|
+
export const SESSION_GOAL_TOOL_NAMES = ['get_goal', 'update_goal'] as const
|
|
10
|
+
export const MIN_GOAL_BLOCK_ROUND = 3
|
|
11
|
+
|
|
12
|
+
/** Resolve authority captured for one caller-reserved run id. */
|
|
13
|
+
export type ResolveGoalRoundAuthority = (runId: RunId) => GoalRoundAuthority | null | undefined
|
|
14
|
+
|
|
15
|
+
/** A goal tool was reached outside the one run whose admission authorized it. */
|
|
16
|
+
export class GoalRoundAuthorityError extends Error {
|
|
17
|
+
constructor(runId: RunId) {
|
|
18
|
+
super(`Run ${runId} has no admitted goal-round authority.`)
|
|
19
|
+
this.name = 'GoalRoundAuthorityError'
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async function currentGoal(
|
|
24
|
+
store: SessionGoalStore,
|
|
25
|
+
authority: GoalRoundAuthority,
|
|
26
|
+
): Promise<SessionGoal> {
|
|
27
|
+
const goal = await store.getGoal(authority.sessionId, authority.tenantId)
|
|
28
|
+
if (!goal) throw new GoalNotFoundError(authority.sessionId)
|
|
29
|
+
if (goal.id !== authority.id || goal.revision !== authority.revision) {
|
|
30
|
+
throw new StaleGoalError({
|
|
31
|
+
sessionId: authority.sessionId,
|
|
32
|
+
expectedRevision: authority.revision,
|
|
33
|
+
actualRevision: goal.revision,
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
return goal
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function authorityFor(
|
|
40
|
+
resolveAuthority: ResolveGoalRoundAuthority,
|
|
41
|
+
runId: RunId,
|
|
42
|
+
): GoalRoundAuthority {
|
|
43
|
+
const authority = resolveAuthority(runId)
|
|
44
|
+
if (!authority) throw new GoalRoundAuthorityError(runId)
|
|
45
|
+
return authority
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Run-scoped tools for an admitted SessionGoal round.
|
|
50
|
+
*
|
|
51
|
+
* Registration is not authorization. A host must also withhold these names
|
|
52
|
+
* from every non-goal provider request and executor allow-list.
|
|
53
|
+
*/
|
|
54
|
+
export function buildSessionGoalTools(
|
|
55
|
+
store: SessionGoalStore,
|
|
56
|
+
resolveAuthority: ResolveGoalRoundAuthority,
|
|
57
|
+
): ToolDefinition[] {
|
|
58
|
+
const getGoal = defineTool({
|
|
59
|
+
name: 'get_goal',
|
|
60
|
+
description:
|
|
61
|
+
'Read the exact completion goal and admitted-round budget that authorized this automatic turn.',
|
|
62
|
+
inputSchema: z.object({}),
|
|
63
|
+
category: 'analysis',
|
|
64
|
+
permissions: [],
|
|
65
|
+
readOnly: true,
|
|
66
|
+
destructive: false,
|
|
67
|
+
concurrencySafe: true,
|
|
68
|
+
async execute(_input, context) {
|
|
69
|
+
const authority = authorityFor(resolveAuthority, context.runId)
|
|
70
|
+
const goal = await currentGoal(store, authority)
|
|
71
|
+
return {
|
|
72
|
+
success: true,
|
|
73
|
+
output: JSON.stringify({
|
|
74
|
+
id: goal.id,
|
|
75
|
+
objective: goal.objective,
|
|
76
|
+
phase: goal.phase,
|
|
77
|
+
round: authority.round,
|
|
78
|
+
maxGoalRounds: goal.maxGoalRounds,
|
|
79
|
+
roundsAdmitted: goal.roundsAdmitted,
|
|
80
|
+
}),
|
|
81
|
+
data: goal,
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
const updateGoal = defineTool({
|
|
87
|
+
name: 'update_goal',
|
|
88
|
+
description:
|
|
89
|
+
'Mark this admitted goal complete, or blocked after at least three admitted rounds. This does not end the turn; explain the final state to the operator afterward.',
|
|
90
|
+
inputSchema: z.object({
|
|
91
|
+
status: z.enum(['complete', 'blocked']),
|
|
92
|
+
reasonCode: z
|
|
93
|
+
.string()
|
|
94
|
+
.optional()
|
|
95
|
+
.describe('Lower-kebab-case reason code; required when status is blocked.'),
|
|
96
|
+
reason: z.string().optional().describe('Operator-readable reason; required when blocked.'),
|
|
97
|
+
}),
|
|
98
|
+
category: 'custom',
|
|
99
|
+
permissions: [],
|
|
100
|
+
readOnly: false,
|
|
101
|
+
destructive: false,
|
|
102
|
+
concurrencySafe: false,
|
|
103
|
+
async execute({ status, reasonCode, reason }, context) {
|
|
104
|
+
const authority = authorityFor(resolveAuthority, context.runId)
|
|
105
|
+
await currentGoal(store, authority)
|
|
106
|
+
const ref = { id: authority.id, revision: authority.revision }
|
|
107
|
+
if (status === 'complete') {
|
|
108
|
+
const goal = await store.completeGoal(authority.sessionId, authority.tenantId, ref)
|
|
109
|
+
return { success: true, output: 'Goal marked complete.', data: goal }
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (authority.round < MIN_GOAL_BLOCK_ROUND) {
|
|
113
|
+
throw new Error(
|
|
114
|
+
`A goal cannot be marked blocked before admitted round ${MIN_GOAL_BLOCK_ROUND}; this is round ${authority.round}.`,
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
if (!reasonCode || !reason) {
|
|
118
|
+
throw new TypeError('Blocked goal updates require reasonCode and reason.')
|
|
119
|
+
}
|
|
120
|
+
const goal = await store.blockGoal(authority.sessionId, authority.tenantId, ref, {
|
|
121
|
+
code: reasonCode,
|
|
122
|
+
message: reason,
|
|
123
|
+
})
|
|
124
|
+
return { success: true, output: 'Goal marked blocked.', data: goal }
|
|
125
|
+
},
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
return [getGoal, updateGoal]
|
|
129
|
+
}
|
|
@@ -2,10 +2,33 @@ import type { MemoryIndex, MemoryStore } from '../../types/memory/index.js'
|
|
|
2
2
|
import type { ToolDefinition } from '../../types/tool/index.js'
|
|
3
3
|
import { buildReadMemoryTool } from './read.js'
|
|
4
4
|
import { buildSaveMemoryTool } from './save.js'
|
|
5
|
-
import { buildSearchMemoryTool } from './search.js'
|
|
5
|
+
import { buildSearchMemoryTool, buildStoreSearchMemoryTool } from './search.js'
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Build memory tools over one authoritative store.
|
|
9
|
+
*
|
|
10
|
+
* This is the safe default for asynchronous or lazy stores: `search_memory`
|
|
11
|
+
* crosses the store's own `list()` boundary, so a fresh disk-backed instance
|
|
12
|
+
* loads its durable index before answering the first search.
|
|
13
|
+
*/
|
|
14
|
+
export function buildMemoryTools(store: MemoryStore): ToolDefinition[]
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Build memory tools with a caller-owned search index.
|
|
18
|
+
*
|
|
19
|
+
* The index is deliberately authoritative in this form. It may be remote,
|
|
20
|
+
* pre-populated or otherwise unrelated to the content store, so searching it
|
|
21
|
+
* must not first call `store.list()` and invent a readiness dependency that
|
|
22
|
+
* this contract never promised.
|
|
23
|
+
*/
|
|
24
|
+
export function buildMemoryTools(store: MemoryStore, index: MemoryIndex): ToolDefinition[]
|
|
25
|
+
|
|
26
|
+
export function buildMemoryTools(store: MemoryStore, index?: MemoryIndex): ToolDefinition[] {
|
|
27
|
+
return [
|
|
28
|
+
index ? buildSearchMemoryTool(index) : buildStoreSearchMemoryTool(store),
|
|
29
|
+
buildReadMemoryTool(store),
|
|
30
|
+
buildSaveMemoryTool(store),
|
|
31
|
+
]
|
|
9
32
|
}
|
|
10
33
|
|
|
11
34
|
export { buildSearchMemoryTool } from './search.js'
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { z } from 'zod'
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
MemoryIndex,
|
|
4
|
+
MemorySearchParams,
|
|
5
|
+
MemorySearchResult,
|
|
6
|
+
MemoryStore,
|
|
7
|
+
} from '../../types/memory/index.js'
|
|
3
8
|
import type { ToolDefinition } from '../../types/tool/index.js'
|
|
4
9
|
import { defineTool } from '../defineTool.js'
|
|
5
10
|
|
|
6
|
-
|
|
11
|
+
type SearchMemory = (params: MemorySearchParams) => MemorySearchResult | Promise<MemorySearchResult>
|
|
12
|
+
|
|
13
|
+
function defineSearchMemoryTool(search: SearchMemory): ToolDefinition {
|
|
7
14
|
return defineTool({
|
|
8
15
|
name: 'search_memory',
|
|
9
16
|
description:
|
|
@@ -19,7 +26,7 @@ export function buildSearchMemoryTool(index: MemoryIndex): ToolDefinition {
|
|
|
19
26
|
destructive: false,
|
|
20
27
|
concurrencySafe: true,
|
|
21
28
|
async execute({ query, tags, limit }) {
|
|
22
|
-
const result =
|
|
29
|
+
const result = await search({ query, tags, limit })
|
|
23
30
|
|
|
24
31
|
if (result.entries.length === 0) {
|
|
25
32
|
return {
|
|
@@ -50,3 +57,13 @@ export function buildSearchMemoryTool(index: MemoryIndex): ToolDefinition {
|
|
|
50
57
|
},
|
|
51
58
|
})
|
|
52
59
|
}
|
|
60
|
+
|
|
61
|
+
/** Build search over a caller-owned, already-ready synchronous index. */
|
|
62
|
+
export function buildSearchMemoryTool(index: MemoryIndex): ToolDefinition {
|
|
63
|
+
return defineSearchMemoryTool((params) => index.search(params))
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Build search over the store's authoritative asynchronous read boundary. */
|
|
67
|
+
export function buildStoreSearchMemoryTool(store: MemoryStore): ToolDefinition {
|
|
68
|
+
return defineSearchMemoryTool((params) => store.list(params))
|
|
69
|
+
}
|
package/src/types/agent/base.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ProjectInstructionContext } from '../../runtime/query/project-instructions.js'
|
|
1
2
|
import type { Logger } from '../../utils/logger.js'
|
|
2
3
|
import type { CostInfo, RunExecutionStatus, TokenUsage } from '../common/index.js'
|
|
3
4
|
import type { ResumeHandler } from '../hitl/index.js'
|
|
@@ -18,6 +19,10 @@ export interface BaseAgentConfig {
|
|
|
18
19
|
model: string
|
|
19
20
|
tokenBudget: number
|
|
20
21
|
timeoutMs: number
|
|
22
|
+
/** See {@link import('../run/config.js').AgentRunConfig.streamIdleTimeoutMs}. */
|
|
23
|
+
streamIdleTimeoutMs?: number
|
|
24
|
+
/** See {@link import('../run/config.js').AgentRunConfig.maxRequestRichContentBytes}. */
|
|
25
|
+
maxRequestRichContentBytes?: number
|
|
21
26
|
maxIterations?: number
|
|
22
27
|
temperature?: number
|
|
23
28
|
maxResponseTokens?: number
|
|
@@ -57,6 +62,9 @@ export interface BaseAgentConfig {
|
|
|
57
62
|
*/
|
|
58
63
|
inboundMessages?: () => import('../message/index.js').Message[]
|
|
59
64
|
|
|
65
|
+
/** Live project policy, flushed independently of human continuation text. */
|
|
66
|
+
projectInstructionContext?: ProjectInstructionContext
|
|
67
|
+
|
|
60
68
|
allowedTools?: readonly string[]
|
|
61
69
|
|
|
62
70
|
/**
|
|
@@ -184,7 +192,7 @@ export interface BaseAgentConfig {
|
|
|
184
192
|
|
|
185
193
|
/**
|
|
186
194
|
* Where this agent takes a decision it cannot make alone — a tool that
|
|
187
|
-
* needs approval, a question for a human, a plan to sign off.
|
|
195
|
+
* needs approval, a root-agent question for a human, a plan to sign off.
|
|
188
196
|
*
|
|
189
197
|
* Declared HERE, on the base config, rather than only on the agent
|
|
190
198
|
* shapes that happened to want it. `AgentManager` builds a child as a
|
|
@@ -203,8 +211,9 @@ export interface BaseAgentConfig {
|
|
|
203
211
|
* had a human review `write` at the top level and never see the same
|
|
204
212
|
* `write` issued one hop down.
|
|
205
213
|
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
214
|
+
* A delegated agent inherits this channel for review but does not gain the
|
|
215
|
+
* root-only `ask_user_question` tool. Absent still means auto-approve, so a
|
|
216
|
+
* host that never wired one is unaffected.
|
|
208
217
|
*/
|
|
209
218
|
resumeHandler?: ResumeHandler
|
|
210
219
|
}
|
|
@@ -46,6 +46,8 @@ export interface AgentFactoryOptions {
|
|
|
46
46
|
workingDirectory?: string
|
|
47
47
|
tokenBudget?: number
|
|
48
48
|
timeoutMs?: number
|
|
49
|
+
streamIdleTimeoutMs?: number
|
|
50
|
+
maxRequestRichContentBytes?: number
|
|
49
51
|
temperature?: number
|
|
50
52
|
maxResponseTokens?: number
|
|
51
53
|
env?: Record<string, string>
|
|
@@ -64,6 +64,8 @@ export interface ReactiveAgentConfig extends BaseAgentConfig {
|
|
|
64
64
|
* on top of the provider keeps the underlying container alive.
|
|
65
65
|
*/
|
|
66
66
|
sandboxProvider?: SandboxProvider
|
|
67
|
+
/** See {@link QueryParams.sandboxTeardownTimeoutMs}. */
|
|
68
|
+
sandboxTeardownTimeoutMs?: number
|
|
67
69
|
|
|
68
70
|
/**
|
|
69
71
|
* Optional structured-compaction config. Omitted ⇒ byte-identical run path
|
|
@@ -138,6 +138,10 @@ export interface SupervisorAgentConfig extends BaseAgentConfig {
|
|
|
138
138
|
* handler that surfaces the `tool_review_requested` RunEvent to
|
|
139
139
|
* the user and resolves the returned promise once the user
|
|
140
140
|
* approves, rejects, or modifies the call.
|
|
141
|
+
*
|
|
142
|
+
* The root supervisor also uses this channel for `ask_user_question`.
|
|
143
|
+
* Delegated supervisors keep the review channel but do not publish that
|
|
144
|
+
* interactive tool; their root owns operator questions.
|
|
141
145
|
*/
|
|
142
146
|
resumeHandler?: ResumeHandler
|
|
143
147
|
|
|
@@ -173,6 +177,8 @@ export interface SupervisorAgentConfig extends BaseAgentConfig {
|
|
|
173
177
|
* + children share one ephemeral container per task.
|
|
174
178
|
*/
|
|
175
179
|
sandboxProvider?: SandboxProvider
|
|
180
|
+
/** See {@link import('../../runtime/query/index.js').QueryParams.sandboxTeardownTimeoutMs}. */
|
|
181
|
+
sandboxTeardownTimeoutMs?: number
|
|
176
182
|
|
|
177
183
|
/**
|
|
178
184
|
* Optional structured-compaction config. When omitted, `query()` never
|
package/src/types/agent/task.ts
CHANGED
|
@@ -42,8 +42,12 @@ export interface AgentTaskContext {
|
|
|
42
42
|
factoryOptions?: AgentFactoryOptions
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
-
* The parent's channel to whoever
|
|
46
|
-
*
|
|
45
|
+
* The parent's channel to whoever reviews decisions it cannot make alone,
|
|
46
|
+
* handed down so a child's REVIEW-tier tool calls reach the same person.
|
|
47
|
+
* This does not grant a delegated agent the `ask_user_question` tool:
|
|
48
|
+
* interactive questions are a root-agent capability, while authorization
|
|
49
|
+
* review must remain inherited to avoid unattended auto-approval below the
|
|
50
|
+
* root.
|
|
47
51
|
*
|
|
48
52
|
* Passed as the function itself, which works because delegation is
|
|
49
53
|
* in-process: `LocalTaskScheduler` is the only `TaskScheduler` in the tree.
|
|
@@ -29,14 +29,9 @@ export interface ConnectorMethod<TInput = unknown, TOutput = unknown> {
|
|
|
29
29
|
description: string
|
|
30
30
|
inputSchema: z.ZodType<TInput, z.ZodTypeDef, unknown>
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* The tool layer solved the same problem already: a remote tool's output
|
|
36
|
-
* schema is appended to its description by `describeWithOutput`, because
|
|
37
|
-
* no provider's tool wire format has a slot for one. A connector method
|
|
38
|
-
* that reaches a model through that bridge should take the same route
|
|
39
|
-
* rather than growing a second mechanism.
|
|
32
|
+
* Canonical output contract for this method. ConnectorManager validates a
|
|
33
|
+
* successful implementation result before publishing it and exposes the
|
|
34
|
+
* rendered schema to tool and MCP consumers.
|
|
40
35
|
*/
|
|
41
36
|
outputSchema?: z.ZodType<TOutput, z.ZodTypeDef, unknown>
|
|
42
37
|
}
|
|
@@ -64,6 +59,11 @@ export interface ConnectorMethod<TInput = unknown, TOutput = unknown> {
|
|
|
64
59
|
* in-process dedupe seam and names the cross-process half as its known
|
|
65
60
|
* gap, and `EditOwnershipTracker.claim` is the claim/refuse shape with
|
|
66
61
|
* same-owner idempotency already worked out.
|
|
62
|
+
*
|
|
63
|
+
* @deprecated The SDK does not subscribe to or dispatch connector triggers.
|
|
64
|
+
* Keep inbound subscription metadata in a host-owned type and store. This
|
|
65
|
+
* declaration remains for one migration release because a host may already
|
|
66
|
+
* use `ConnectorRegistry` as its own metadata table.
|
|
67
67
|
*/
|
|
68
68
|
export interface ConnectorTrigger {
|
|
69
69
|
name: string
|
|
@@ -72,6 +72,11 @@ export interface ConnectorTrigger {
|
|
|
72
72
|
configSchema?: z.ZodType
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* @deprecated The SDK does not emit inbound connector events. Define the
|
|
77
|
+
* event envelope at the host boundary that owns subscription, de-duplication,
|
|
78
|
+
* delivery, and run admission.
|
|
79
|
+
*/
|
|
75
80
|
export interface ConnectorEvent {
|
|
76
81
|
connectorId: ConnectorId
|
|
77
82
|
instanceId: ConnectorInstanceId
|