@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
|
@@ -2,11 +2,28 @@ import { createHmac } from 'node:crypto';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { asConnectorId } from '../../utils/id.js';
|
|
4
4
|
import { BaseConnector } from '../BaseConnector.js';
|
|
5
|
+
import { CONNECTOR_HEALTH_TIMEOUT_MS, ConnectorHttpOperation, DEFAULT_CONNECTOR_MAX_RESPONSE_BYTES, DEFAULT_CONNECTOR_REQUEST_TIMEOUT_MS, readConnectorResponseBody, requireHttpUrl, requireSafeConnectorInputHeaders, requireSameOrigin, validateConnectorMaxResponseBytes, validateConnectorTimeoutMs, } from '../http-operation.js';
|
|
5
6
|
const WebhookConnectorConfigSchema = z.object({
|
|
6
|
-
url: z
|
|
7
|
+
url: z
|
|
8
|
+
.string()
|
|
9
|
+
.url()
|
|
10
|
+
.refine((value) => /^https?:/i.test(value), 'url must use http: or https:'),
|
|
7
11
|
secret: z.string().optional(),
|
|
8
12
|
defaultHeaders: z.record(z.string()).optional(),
|
|
9
|
-
|
|
13
|
+
maxResponseBytes: z
|
|
14
|
+
.number()
|
|
15
|
+
.int()
|
|
16
|
+
.positive()
|
|
17
|
+
.max(2_147_483_647)
|
|
18
|
+
.optional()
|
|
19
|
+
.default(DEFAULT_CONNECTOR_MAX_RESPONSE_BYTES),
|
|
20
|
+
timeoutMs: z
|
|
21
|
+
.number()
|
|
22
|
+
.int()
|
|
23
|
+
.positive()
|
|
24
|
+
.max(2_147_483_647)
|
|
25
|
+
.optional()
|
|
26
|
+
.default(DEFAULT_CONNECTOR_REQUEST_TIMEOUT_MS),
|
|
10
27
|
});
|
|
11
28
|
const WebhookSendInputSchema = z.object({
|
|
12
29
|
payload: z.unknown(),
|
|
@@ -20,6 +37,7 @@ export class WebhookConnector extends BaseConnector {
|
|
|
20
37
|
name = 'Webhook Connector';
|
|
21
38
|
description = 'Send webhook payloads to configured endpoints with optional HMAC signing';
|
|
22
39
|
connectionType = 'webhook';
|
|
40
|
+
supportedAuth = ['none', 'bearer'];
|
|
23
41
|
configSchema = WebhookConnectorConfigSchema;
|
|
24
42
|
methods = [
|
|
25
43
|
{
|
|
@@ -29,62 +47,72 @@ export class WebhookConnector extends BaseConnector {
|
|
|
29
47
|
},
|
|
30
48
|
];
|
|
31
49
|
url = '';
|
|
50
|
+
origin = '';
|
|
32
51
|
secret;
|
|
33
52
|
defaultHeaders = {};
|
|
34
|
-
timeoutMs =
|
|
53
|
+
timeoutMs = DEFAULT_CONNECTOR_REQUEST_TIMEOUT_MS;
|
|
54
|
+
maxResponseBytes = DEFAULT_CONNECTOR_MAX_RESPONSE_BYTES;
|
|
35
55
|
async connect(config, auth) {
|
|
36
|
-
|
|
56
|
+
const validated = WebhookConnectorConfigSchema.parse(config);
|
|
57
|
+
const parsedUrl = requireHttpUrl(validated.url, 'WebhookConnector url');
|
|
58
|
+
this.config = validated;
|
|
37
59
|
this.auth = auth;
|
|
38
|
-
this.url =
|
|
39
|
-
this.
|
|
40
|
-
this.
|
|
41
|
-
this.
|
|
60
|
+
this.url = validated.url;
|
|
61
|
+
this.origin = parsedUrl.origin;
|
|
62
|
+
this.secret = validated.secret;
|
|
63
|
+
this.defaultHeaders = { ...(validated.defaultHeaders ?? {}) };
|
|
64
|
+
this.timeoutMs = validateConnectorTimeoutMs(validated.timeoutMs, 'WebhookConnector timeoutMs');
|
|
65
|
+
this.maxResponseBytes = validateConnectorMaxResponseBytes(validated.maxResponseBytes, 'WebhookConnector maxResponseBytes');
|
|
42
66
|
if (auth?.type === 'bearer' && auth.credentials?.token) {
|
|
43
67
|
this.defaultHeaders.Authorization = `Bearer ${auth.credentials.token}`;
|
|
44
68
|
}
|
|
45
|
-
this.log.info('Webhook connector connected', {
|
|
69
|
+
this.log.info('Webhook connector connected', {
|
|
70
|
+
'namzu.connector.url': this.url,
|
|
71
|
+
});
|
|
46
72
|
}
|
|
47
73
|
async disconnect() {
|
|
48
74
|
this.config = null;
|
|
49
75
|
this.auth = undefined;
|
|
50
76
|
this.url = '';
|
|
77
|
+
this.origin = '';
|
|
51
78
|
this.secret = undefined;
|
|
52
79
|
this.defaultHeaders = {};
|
|
53
80
|
this.log.info('Webhook connector disconnected');
|
|
54
81
|
}
|
|
55
|
-
async healthCheck() {
|
|
82
|
+
async healthCheck(options) {
|
|
56
83
|
if (!this.url)
|
|
57
84
|
return false;
|
|
85
|
+
let operation;
|
|
58
86
|
try {
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
const response = await fetch(this.url, {
|
|
87
|
+
operation = new ConnectorHttpOperation(options?.signal, CONNECTOR_HEALTH_TIMEOUT_MS, 'Webhook connector health check');
|
|
88
|
+
const activeOperation = operation;
|
|
89
|
+
const response = await activeOperation.run(() => fetch(this.url, {
|
|
62
90
|
method: 'HEAD',
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
91
|
+
redirect: 'manual',
|
|
92
|
+
signal: activeOperation.signal,
|
|
93
|
+
}));
|
|
66
94
|
return response.ok || response.status < 500;
|
|
67
95
|
}
|
|
68
96
|
catch {
|
|
69
97
|
return false;
|
|
70
98
|
}
|
|
99
|
+
finally {
|
|
100
|
+
operation?.close();
|
|
101
|
+
}
|
|
71
102
|
}
|
|
72
|
-
async execute(method, input) {
|
|
103
|
+
async execute(method, input, options) {
|
|
73
104
|
this.requireMethod(method);
|
|
74
|
-
const validated = this.validateInput(this.requireMethod(method), input);
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
metadata: {
|
|
81
|
-
status: result.status,
|
|
82
|
-
deliveredAt: result.deliveredAt,
|
|
83
|
-
},
|
|
84
|
-
};
|
|
105
|
+
const validated = (await this.validateInput(this.requireMethod(method), input, options));
|
|
106
|
+
const startedAt = performance.now();
|
|
107
|
+
if (options?.signal?.aborted) {
|
|
108
|
+
return this.notStarted(options.signal.reason, startedAt);
|
|
109
|
+
}
|
|
110
|
+
return this.doSend(validated, options, startedAt);
|
|
85
111
|
}
|
|
86
|
-
async doSend(input) {
|
|
112
|
+
async doSend(input, options, startedAt) {
|
|
87
113
|
const targetUrl = input.url ?? this.url;
|
|
114
|
+
requireSameOrigin(targetUrl, this.origin, 'WebhookConnector request URL');
|
|
115
|
+
requireSafeConnectorInputHeaders(input.headers, 'WebhookConnector request headers');
|
|
88
116
|
const bodyStr = JSON.stringify(input.payload);
|
|
89
117
|
const headers = {
|
|
90
118
|
'Content-Type': 'application/json',
|
|
@@ -95,32 +123,124 @@ export class WebhookConnector extends BaseConnector {
|
|
|
95
123
|
const signature = createHmac('sha256', this.secret).update(bodyStr).digest('hex');
|
|
96
124
|
headers['X-Webhook-Signature'] = `sha256=${signature}`;
|
|
97
125
|
}
|
|
98
|
-
|
|
99
|
-
const timeout = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
126
|
+
let operation;
|
|
100
127
|
try {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
128
|
+
try {
|
|
129
|
+
operation = new ConnectorHttpOperation(options?.signal, this.timeoutMs, 'Webhook connector POST');
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
return this.notStarted(error, startedAt);
|
|
133
|
+
}
|
|
134
|
+
let response;
|
|
135
|
+
try {
|
|
136
|
+
const activeOperation = operation;
|
|
137
|
+
response = await activeOperation.run(() => fetch(targetUrl, {
|
|
138
|
+
method: 'POST',
|
|
139
|
+
headers,
|
|
140
|
+
body: bodyStr,
|
|
141
|
+
redirect: 'manual',
|
|
142
|
+
signal: activeOperation.signal,
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
return this.unknownOutcome(error, startedAt);
|
|
147
|
+
}
|
|
148
|
+
const deliveredAt = Date.now();
|
|
149
|
+
const metadata = {
|
|
150
|
+
status: response.status,
|
|
151
|
+
deliveredAt,
|
|
152
|
+
remoteOutcome: 'response_received',
|
|
153
|
+
retrySafety: 'unsafe',
|
|
154
|
+
bodyAvailable: true,
|
|
155
|
+
};
|
|
156
|
+
const redirectLocation = response.headers.get('location');
|
|
157
|
+
if (redirectLocation)
|
|
158
|
+
metadata.redirectLocation = redirectLocation;
|
|
107
159
|
let body;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
body = await response.json();
|
|
160
|
+
try {
|
|
161
|
+
body = await readConnectorResponseBody(response, operation, this.maxResponseBytes);
|
|
111
162
|
}
|
|
112
|
-
|
|
113
|
-
|
|
163
|
+
catch (error) {
|
|
164
|
+
const output = {
|
|
165
|
+
status: response.status,
|
|
166
|
+
body: null,
|
|
167
|
+
deliveredAt,
|
|
168
|
+
bodyAvailable: false,
|
|
169
|
+
bodyError: `Response body unavailable: ${this.errorText(error)}`,
|
|
170
|
+
remoteOutcome: 'response_received',
|
|
171
|
+
retrySafety: 'unsafe',
|
|
172
|
+
};
|
|
173
|
+
metadata.bodyAvailable = false;
|
|
174
|
+
return {
|
|
175
|
+
success: response.status >= 200 && response.status < 300,
|
|
176
|
+
output,
|
|
177
|
+
...(response.status < 200 || response.status >= 300
|
|
178
|
+
? { error: this.statusError(response, true) }
|
|
179
|
+
: {}),
|
|
180
|
+
durationMs: this.duration(startedAt),
|
|
181
|
+
metadata,
|
|
182
|
+
};
|
|
114
183
|
}
|
|
115
|
-
|
|
184
|
+
const output = {
|
|
116
185
|
status: response.status,
|
|
117
186
|
body,
|
|
118
|
-
deliveredAt
|
|
187
|
+
deliveredAt,
|
|
188
|
+
bodyAvailable: true,
|
|
189
|
+
remoteOutcome: 'response_received',
|
|
190
|
+
retrySafety: 'unsafe',
|
|
191
|
+
};
|
|
192
|
+
return {
|
|
193
|
+
success: response.status >= 200 && response.status < 300,
|
|
194
|
+
output,
|
|
195
|
+
...(response.status < 200 || response.status >= 300
|
|
196
|
+
? { error: this.statusError(response, false) }
|
|
197
|
+
: {}),
|
|
198
|
+
durationMs: this.duration(startedAt),
|
|
199
|
+
metadata,
|
|
119
200
|
};
|
|
120
201
|
}
|
|
121
202
|
finally {
|
|
122
|
-
|
|
203
|
+
operation?.close();
|
|
123
204
|
}
|
|
124
205
|
}
|
|
206
|
+
notStarted(reason, startedAt) {
|
|
207
|
+
return {
|
|
208
|
+
success: false,
|
|
209
|
+
output: null,
|
|
210
|
+
error: `Webhook POST was cancelled before it started: ${this.errorText(reason)}. No remote request was started; retry is safe.`,
|
|
211
|
+
durationMs: this.duration(startedAt),
|
|
212
|
+
metadata: {
|
|
213
|
+
remoteOutcome: 'not_started',
|
|
214
|
+
retrySafety: 'safe',
|
|
215
|
+
bodyAvailable: false,
|
|
216
|
+
},
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
unknownOutcome(error, startedAt) {
|
|
220
|
+
return {
|
|
221
|
+
success: false,
|
|
222
|
+
output: null,
|
|
223
|
+
error: `Webhook POST produced no response: ${this.errorText(error)}. The remote outcome is unknown. Do not automatically retry this request; it may duplicate a delivery.`,
|
|
224
|
+
durationMs: this.duration(startedAt),
|
|
225
|
+
metadata: {
|
|
226
|
+
remoteOutcome: 'unknown',
|
|
227
|
+
retrySafety: 'unsafe',
|
|
228
|
+
bodyAvailable: false,
|
|
229
|
+
},
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
statusError(response, bodyMissing) {
|
|
233
|
+
if (response.status >= 300 && response.status < 400) {
|
|
234
|
+
const location = response.headers.get('location');
|
|
235
|
+
return `HTTP ${response.status}: ${response.statusText}. The redirect was not followed because webhook requests cannot leave their configured origin.${location ? ` Location: ${location}.` : ''} Do not automatically retry; the webhook may already have been applied.`;
|
|
236
|
+
}
|
|
237
|
+
return `HTTP ${response.status}: ${response.statusText}.${bodyMissing ? ' The response body was unavailable.' : ''} Do not automatically retry; the webhook may already have been applied.`;
|
|
238
|
+
}
|
|
239
|
+
duration(startedAt) {
|
|
240
|
+
return Math.round(performance.now() - startedAt);
|
|
241
|
+
}
|
|
242
|
+
errorText(error) {
|
|
243
|
+
return error instanceof Error ? error.message : String(error);
|
|
244
|
+
}
|
|
125
245
|
}
|
|
126
246
|
//# sourceMappingURL=webhook.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.js","sourceRoot":"","sources":["../../../src/connector/builtins/webhook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"webhook.js","sourceRoot":"","sources":["../../../src/connector/builtins/webhook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,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AAE;gBACT,aAAa,EAAE,SAAS;gBACxB,WAAW,EAAE,QAAQ;gBACrB,aAAa,EAAE,KAAK;aACpB;SACD,CAAA;IACF,CAAC;IAEO,WAAW,CAAC,QAAkB,EAAE,WAAoB;QAC3D,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YACrD,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;YACjD,OAAO,QAAQ,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,UAAU,iGAAiG,QAAQ,CAAC,CAAC,CAAC,cAAc,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE,yEAAyE,CAAA;QAC1Q,CAAC;QACD,OAAO,QAAQ,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,UAAU,IAAI,WAAW,CAAC,CAAC,CAAC,qCAAqC,CAAC,CAAC,CAAC,EAAE,yEAAyE,CAAA;IAC5L,CAAC;IAEO,QAAQ,CAAC,SAAiB;QACjC,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,CAAA;IACjD,CAAC;IAEO,SAAS,CAAC,KAAc;QAC/B,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAC9D,CAAC;CACD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ConnectorOperationOptions } from '../types/connector/index.js';
|
|
2
|
+
declare const MANAGER_VALIDATED_INPUT: unique symbol;
|
|
3
|
+
export type ManagedConnectorOperationOptions = ConnectorOperationOptions & {
|
|
4
|
+
readonly [MANAGER_VALIDATED_INPUT]: true;
|
|
5
|
+
};
|
|
6
|
+
/** Internal hand-off: the manager already produced the method's canonical input. */
|
|
7
|
+
export declare function managedConnectorOptions(options: ConnectorOperationOptions): ManagedConnectorOperationOptions;
|
|
8
|
+
/** Used by BaseConnector helpers so direct calls still validate exactly once. */
|
|
9
|
+
export declare function hasManagerValidatedInput(options: ConnectorOperationOptions | undefined): options is ManagedConnectorOperationOptions;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=execution-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-contract.d.ts","sourceRoot":"","sources":["../../src/connector/execution-contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAE5E,QAAA,MAAM,uBAAuB,eAAoD,CAAA;AAEjF,MAAM,MAAM,gCAAgC,GAAG,yBAAyB,GAAG;IAC1E,QAAQ,CAAC,CAAC,uBAAuB,CAAC,EAAE,IAAI,CAAA;CACxC,CAAA;AAED,oFAAoF;AACpF,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,yBAAyB,GAChC,gCAAgC,CAKlC;AAED,iFAAiF;AACjF,wBAAgB,wBAAwB,CACvC,OAAO,EAAE,yBAAyB,GAAG,SAAS,GAC5C,OAAO,IAAI,gCAAgC,CAK7C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const MANAGER_VALIDATED_INPUT = Symbol('namzu.connector.manager-validated-input');
|
|
2
|
+
/** Internal hand-off: the manager already produced the method's canonical input. */
|
|
3
|
+
export function managedConnectorOptions(options) {
|
|
4
|
+
return {
|
|
5
|
+
...options,
|
|
6
|
+
[MANAGER_VALIDATED_INPUT]: true,
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
/** Used by BaseConnector helpers so direct calls still validate exactly once. */
|
|
10
|
+
export function hasManagerValidatedInput(options) {
|
|
11
|
+
return Boolean(options &&
|
|
12
|
+
options[MANAGER_VALIDATED_INPUT] === true);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=execution-contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-contract.js","sourceRoot":"","sources":["../../src/connector/execution-contract.ts"],"names":[],"mappings":"AAEA,MAAM,uBAAuB,GAAG,MAAM,CAAC,yCAAyC,CAAC,CAAA;AAMjF,oFAAoF;AACpF,MAAM,UAAU,uBAAuB,CACtC,OAAkC;IAElC,OAAO;QACN,GAAG,OAAO;QACV,CAAC,uBAAuB,CAAC,EAAE,IAAI;KAC/B,CAAA;AACF,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,wBAAwB,CACvC,OAA8C;IAE9C,OAAO,OAAO,CACb,OAAO;QACL,OAAqD,CAAC,uBAAuB,CAAC,KAAK,IAAI,CACzF,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export declare const DEFAULT_CONNECTOR_REQUEST_TIMEOUT_MS = 30000;
|
|
2
|
+
export declare const CONNECTOR_HEALTH_TIMEOUT_MS = 5000;
|
|
3
|
+
export declare const DEFAULT_CONNECTOR_MAX_RESPONSE_BYTES: number;
|
|
4
|
+
export declare function validateConnectorTimeoutMs(value: number, label: string): number;
|
|
5
|
+
export declare function validateConnectorMaxResponseBytes(value: number, label: string): number;
|
|
6
|
+
export declare function requireSafeConnectorInputHeaders(headers: Readonly<Record<string, string>> | undefined, label: string): void;
|
|
7
|
+
export declare function requireHttpUrl(value: string, label: string): URL;
|
|
8
|
+
export declare function requireSameOrigin(value: string, configuredOrigin: string, label: string): URL;
|
|
9
|
+
/**
|
|
10
|
+
* Read a platform response without allocating beyond the connector's byte
|
|
11
|
+
* budget. `Content-Length` is only an early refusal; the streaming count is
|
|
12
|
+
* authoritative because chunked and dishonest responses omit or understate it.
|
|
13
|
+
*/
|
|
14
|
+
export declare function readConnectorResponseBody(response: Response, operation: ConnectorHttpOperation, maxBytes: number): Promise<unknown>;
|
|
15
|
+
/**
|
|
16
|
+
* One whole HTTP operation boundary: fetch and body reads share one clock.
|
|
17
|
+
*
|
|
18
|
+
* The promise race is intentional. Forwarding a signal cannot settle a custom
|
|
19
|
+
* fetch/body implementation that ignores it, and a connector lifecycle is a
|
|
20
|
+
* public entry point independent of the run executor's own tool deadline.
|
|
21
|
+
*/
|
|
22
|
+
export declare class ConnectorHttpOperation {
|
|
23
|
+
readonly signal: AbortSignal;
|
|
24
|
+
private readonly controller;
|
|
25
|
+
private readonly aborted;
|
|
26
|
+
private readonly callerSignal;
|
|
27
|
+
private readonly onCallerAbort;
|
|
28
|
+
private readonly timer;
|
|
29
|
+
private rejectAbort;
|
|
30
|
+
private hasCause;
|
|
31
|
+
private firstCause;
|
|
32
|
+
constructor(callerSignal: AbortSignal | undefined, timeoutMs: number, label: string);
|
|
33
|
+
get cause(): unknown;
|
|
34
|
+
wait<T>(operation: Promise<T>): Promise<T>;
|
|
35
|
+
/**
|
|
36
|
+
* Check authority before starting foreign work, then again after it wins.
|
|
37
|
+
*
|
|
38
|
+
* Passing an already-created promise to `wait()` cannot prevent the work
|
|
39
|
+
* that created it from starting. Callers use this thunk form at every
|
|
40
|
+
* network, resolver and stream boundary where admission matters.
|
|
41
|
+
*/
|
|
42
|
+
run<T>(start: () => Promise<T>): Promise<T>;
|
|
43
|
+
throwIfStopped(): void;
|
|
44
|
+
close(): void;
|
|
45
|
+
cancel(reason: unknown): void;
|
|
46
|
+
private stop;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=http-operation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-operation.d.ts","sourceRoot":"","sources":["../../src/connector/http-operation.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,oCAAoC,QAAS,CAAA;AAC1D,eAAO,MAAM,2BAA2B,OAAQ,CAAA;AAChD,eAAO,MAAM,oCAAoC,QAAkB,CAAA;AAEnE,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAO/E;AAED,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAA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,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAKjD,cAAc,IAAI,IAAI;IAItB,KAAK,IAAI,IAAI;IAOb,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAI7B,OAAO,CAAC,IAAI;CAUZ"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
const MAX_TIMER_DELAY_MS = 2_147_483_647;
|
|
2
|
+
const MAX_RESPONSE_BYTES = 2_147_483_647;
|
|
3
|
+
// These headers can change where an already-validated URL is routed. Connector
|
|
4
|
+
// method input is commonly model-authored, while the base URL and credentials
|
|
5
|
+
// are host-configured. Letting the former supply `Host` would attach the
|
|
6
|
+
// latter's bearer/cookie headers to a different virtual host on the same
|
|
7
|
+
// socket. Proxy credentials are equally outside method-input authority.
|
|
8
|
+
const FORBIDDEN_CONNECTOR_INPUT_HEADERS = new Set([
|
|
9
|
+
'host',
|
|
10
|
+
'proxy-authorization',
|
|
11
|
+
'proxy-connection',
|
|
12
|
+
]);
|
|
13
|
+
export const DEFAULT_CONNECTOR_REQUEST_TIMEOUT_MS = 30_000;
|
|
14
|
+
export const CONNECTOR_HEALTH_TIMEOUT_MS = 5_000;
|
|
15
|
+
export const DEFAULT_CONNECTOR_MAX_RESPONSE_BYTES = 2 * 1024 * 1024;
|
|
16
|
+
export function validateConnectorTimeoutMs(value, label) {
|
|
17
|
+
if (!Number.isInteger(value) || value < 1 || value > MAX_TIMER_DELAY_MS) {
|
|
18
|
+
throw new Error(`${label} must be an integer from 1 to ${MAX_TIMER_DELAY_MS}; received ${String(value)}`);
|
|
19
|
+
}
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
export function validateConnectorMaxResponseBytes(value, label) {
|
|
23
|
+
if (!Number.isInteger(value) || value < 1 || value > MAX_RESPONSE_BYTES) {
|
|
24
|
+
throw new Error(`${label} must be an integer from 1 to ${MAX_RESPONSE_BYTES}; received ${String(value)}`);
|
|
25
|
+
}
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
export function requireSafeConnectorInputHeaders(headers, label) {
|
|
29
|
+
if (!headers)
|
|
30
|
+
return;
|
|
31
|
+
for (const name of Object.keys(headers)) {
|
|
32
|
+
if (FORBIDDEN_CONNECTOR_INPUT_HEADERS.has(name.toLowerCase())) {
|
|
33
|
+
throw new Error(`${label} cannot set routing header "${name}"`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export function requireHttpUrl(value, label) {
|
|
38
|
+
const parsed = new URL(value);
|
|
39
|
+
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
|
|
40
|
+
throw new Error(`${label} must use http: or https:; received ${parsed.protocol}`);
|
|
41
|
+
}
|
|
42
|
+
return parsed;
|
|
43
|
+
}
|
|
44
|
+
export function requireSameOrigin(value, configuredOrigin, label) {
|
|
45
|
+
const parsed = requireHttpUrl(value, label);
|
|
46
|
+
if (parsed.origin !== configuredOrigin) {
|
|
47
|
+
throw new Error(`${label} must stay on the configured connector origin ${configuredOrigin}; received ${parsed.origin}`);
|
|
48
|
+
}
|
|
49
|
+
return parsed;
|
|
50
|
+
}
|
|
51
|
+
function timeoutError(label, timeoutMs) {
|
|
52
|
+
const error = new Error(`${label} timed out after ${timeoutMs}ms`);
|
|
53
|
+
error.name = 'TimeoutError';
|
|
54
|
+
return error;
|
|
55
|
+
}
|
|
56
|
+
function responseSizeError(maxBytes) {
|
|
57
|
+
const error = new Error(`Response body exceeded the configured ${maxBytes}-byte limit`);
|
|
58
|
+
error.name = 'ResponseSizeError';
|
|
59
|
+
return error;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Read a platform response without allocating beyond the connector's byte
|
|
63
|
+
* budget. `Content-Length` is only an early refusal; the streaming count is
|
|
64
|
+
* authoritative because chunked and dishonest responses omit or understate it.
|
|
65
|
+
*/
|
|
66
|
+
export async function readConnectorResponseBody(response, operation, maxBytes) {
|
|
67
|
+
const contentType = response.headers.get('content-type') ?? '';
|
|
68
|
+
const contentLength = response.headers.get('content-length');
|
|
69
|
+
if (contentLength !== null) {
|
|
70
|
+
const declaredBytes = Number(contentLength);
|
|
71
|
+
if (Number.isFinite(declaredBytes) && declaredBytes > maxBytes) {
|
|
72
|
+
const error = responseSizeError(maxBytes);
|
|
73
|
+
operation.cancel(error);
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// A real fetch Response has a byte stream whenever it has a body. The
|
|
78
|
+
// fallback preserves compatibility with body-less responses and injected
|
|
79
|
+
// Response-shaped test doubles; there are no remote bytes to stream when
|
|
80
|
+
// the platform reports `body === null`.
|
|
81
|
+
if (!response.body) {
|
|
82
|
+
return operation.run(() => contentType.includes('application/json') ? response.json() : response.text());
|
|
83
|
+
}
|
|
84
|
+
const reader = response.body.getReader();
|
|
85
|
+
const chunks = [];
|
|
86
|
+
let totalBytes = 0;
|
|
87
|
+
try {
|
|
88
|
+
while (true) {
|
|
89
|
+
const { done, value } = await operation.run(() => reader.read());
|
|
90
|
+
if (done)
|
|
91
|
+
break;
|
|
92
|
+
totalBytes += value.byteLength;
|
|
93
|
+
if (totalBytes > maxBytes) {
|
|
94
|
+
const error = responseSizeError(maxBytes);
|
|
95
|
+
void reader.cancel(error).catch(() => undefined);
|
|
96
|
+
operation.cancel(error);
|
|
97
|
+
throw error;
|
|
98
|
+
}
|
|
99
|
+
chunks.push(value);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
finally {
|
|
103
|
+
reader.releaseLock();
|
|
104
|
+
}
|
|
105
|
+
const bytes = new Uint8Array(totalBytes);
|
|
106
|
+
let offset = 0;
|
|
107
|
+
for (const chunk of chunks) {
|
|
108
|
+
bytes.set(chunk, offset);
|
|
109
|
+
offset += chunk.byteLength;
|
|
110
|
+
}
|
|
111
|
+
const text = new TextDecoder().decode(bytes);
|
|
112
|
+
return contentType.includes('application/json') ? JSON.parse(text) : text;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* One whole HTTP operation boundary: fetch and body reads share one clock.
|
|
116
|
+
*
|
|
117
|
+
* The promise race is intentional. Forwarding a signal cannot settle a custom
|
|
118
|
+
* fetch/body implementation that ignores it, and a connector lifecycle is a
|
|
119
|
+
* public entry point independent of the run executor's own tool deadline.
|
|
120
|
+
*/
|
|
121
|
+
export class ConnectorHttpOperation {
|
|
122
|
+
signal;
|
|
123
|
+
controller = new AbortController();
|
|
124
|
+
aborted;
|
|
125
|
+
callerSignal;
|
|
126
|
+
onCallerAbort;
|
|
127
|
+
timer;
|
|
128
|
+
rejectAbort;
|
|
129
|
+
hasCause = false;
|
|
130
|
+
firstCause;
|
|
131
|
+
constructor(callerSignal, timeoutMs, label) {
|
|
132
|
+
callerSignal?.throwIfAborted();
|
|
133
|
+
this.signal = this.controller.signal;
|
|
134
|
+
this.callerSignal = callerSignal;
|
|
135
|
+
this.aborted = new Promise((_resolve, reject) => {
|
|
136
|
+
this.rejectAbort = reject;
|
|
137
|
+
});
|
|
138
|
+
// Cancellation may arrive between construction and the first `wait`.
|
|
139
|
+
// Keep that owned rejection observed even when the next `run` refuses
|
|
140
|
+
// before attaching a race handler.
|
|
141
|
+
void this.aborted.catch(() => undefined);
|
|
142
|
+
this.onCallerAbort = callerSignal ? () => this.stop(callerSignal.reason) : undefined;
|
|
143
|
+
callerSignal?.addEventListener('abort', this.onCallerAbort, {
|
|
144
|
+
once: true,
|
|
145
|
+
});
|
|
146
|
+
this.timer = setTimeout(() => this.stop(timeoutError(label, timeoutMs)), timeoutMs);
|
|
147
|
+
}
|
|
148
|
+
get cause() {
|
|
149
|
+
return this.firstCause;
|
|
150
|
+
}
|
|
151
|
+
async wait(operation) {
|
|
152
|
+
this.throwIfStopped();
|
|
153
|
+
try {
|
|
154
|
+
const result = await Promise.race([operation, this.aborted]);
|
|
155
|
+
// A foreign promise and caller abort can settle in the same turn. The
|
|
156
|
+
// promise race may pick the value first even though authority has
|
|
157
|
+
// already been withdrawn; never publish that late value as success.
|
|
158
|
+
this.throwIfStopped();
|
|
159
|
+
return result;
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
if (this.hasCause &&
|
|
163
|
+
error instanceof Error &&
|
|
164
|
+
(error.name === 'AbortError' || error.name === 'TimeoutError')) {
|
|
165
|
+
throw this.firstCause;
|
|
166
|
+
}
|
|
167
|
+
throw error;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Check authority before starting foreign work, then again after it wins.
|
|
172
|
+
*
|
|
173
|
+
* Passing an already-created promise to `wait()` cannot prevent the work
|
|
174
|
+
* that created it from starting. Callers use this thunk form at every
|
|
175
|
+
* network, resolver and stream boundary where admission matters.
|
|
176
|
+
*/
|
|
177
|
+
async run(start) {
|
|
178
|
+
this.throwIfStopped();
|
|
179
|
+
return this.wait(start());
|
|
180
|
+
}
|
|
181
|
+
throwIfStopped() {
|
|
182
|
+
this.signal.throwIfAborted();
|
|
183
|
+
}
|
|
184
|
+
close() {
|
|
185
|
+
clearTimeout(this.timer);
|
|
186
|
+
if (this.callerSignal && this.onCallerAbort) {
|
|
187
|
+
this.callerSignal.removeEventListener('abort', this.onCallerAbort);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
cancel(reason) {
|
|
191
|
+
this.stop(reason);
|
|
192
|
+
}
|
|
193
|
+
stop(reason) {
|
|
194
|
+
if (this.hasCause)
|
|
195
|
+
return;
|
|
196
|
+
this.hasCause = true;
|
|
197
|
+
this.firstCause = reason;
|
|
198
|
+
// Reject the owned wait before aborting transport. A fetch implementation
|
|
199
|
+
// may synchronously translate transport abort into a generic AbortError;
|
|
200
|
+
// that fallout must not erase the caller/deadline cause that won first.
|
|
201
|
+
this.rejectAbort(reason);
|
|
202
|
+
this.controller.abort(reason);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=http-operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-operation.js","sourceRoot":"","sources":["../../src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IAC9B,CAAC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/connector/mcp/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,KAAK,EACX,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,MAAM,gCAAgC,CAAA;AAEvC,OAAO,KAAK,EAAe,cAAc,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AACxF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAG5C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,GAAG,CAAC,CAAC,OAAO,CAOnE;AAwXD,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,CAAC,CAAC,OAAO,GAAG,aAAa,CAMtE;AAED,wBAAgB,uBAAuB,CACtC,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,MAAM;AAClB;;;;GAIG;AACH,mBAAmB,UAAQ,GACzB,cAAc,
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/connector/mcp/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,KAAK,EACX,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,MAAM,gCAAgC,CAAA;AAEvC,OAAO,KAAK,EAAe,cAAc,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AACxF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAG5C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,GAAG,CAAC,CAAC,OAAO,CAOnE;AAwXD,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,CAAC,CAAC,OAAO,GAAG,aAAa,CA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