@qodo/sdk 0.13.3 → 2.0.0-next.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/LICENSE +31 -118
- package/README.md +133 -121
- package/bin/qodo-skills.mjs +13 -0
- package/bundled-skills/code-review/SKILL.md +41 -0
- package/bundled-skills/pr-summary/SKILL.md +59 -0
- package/bundled-skills/test-gen/SKILL.md +47 -0
- package/dist/auth/index.browser.d.ts +38 -0
- package/dist/auth/index.browser.d.ts.map +1 -0
- package/dist/auth/index.browser.js +62 -0
- package/dist/auth/index.browser.js.map +1 -0
- package/dist/auth/index.d.ts +44 -30
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +57 -110
- package/dist/auth/index.js.map +1 -1
- package/dist/client/AgentsClient.d.ts +33 -0
- package/dist/client/AgentsClient.d.ts.map +1 -0
- package/dist/client/AgentsClient.js +40 -0
- package/dist/client/AgentsClient.js.map +1 -0
- package/dist/client/ArtifactsClient.d.ts +43 -0
- package/dist/client/ArtifactsClient.d.ts.map +1 -0
- package/dist/client/ArtifactsClient.js +54 -0
- package/dist/client/ArtifactsClient.js.map +1 -0
- package/dist/client/BulletinClient.d.ts +45 -0
- package/dist/client/BulletinClient.d.ts.map +1 -0
- package/dist/client/BulletinClient.js +51 -0
- package/dist/client/BulletinClient.js.map +1 -0
- package/dist/client/InfoClient.d.ts +58 -0
- package/dist/client/InfoClient.d.ts.map +1 -0
- package/dist/client/InfoClient.js +135 -0
- package/dist/client/InfoClient.js.map +1 -0
- package/dist/client/PipelineClient.d.ts +162 -0
- package/dist/client/PipelineClient.d.ts.map +1 -0
- package/dist/client/PipelineClient.js +340 -0
- package/dist/client/PipelineClient.js.map +1 -0
- package/dist/client/QarRegistryClient.d.ts +396 -0
- package/dist/client/QarRegistryClient.d.ts.map +1 -0
- package/dist/client/QarRegistryClient.js +536 -0
- package/dist/client/QarRegistryClient.js.map +1 -0
- package/dist/client/QodoClient.d.ts +296 -0
- package/dist/client/QodoClient.d.ts.map +1 -0
- package/dist/client/QodoClient.js +803 -0
- package/dist/client/QodoClient.js.map +1 -0
- package/dist/client/SpecsClient.d.ts +121 -0
- package/dist/client/SpecsClient.d.ts.map +1 -0
- package/dist/client/SpecsClient.js +252 -0
- package/dist/client/SpecsClient.js.map +1 -0
- package/dist/client/StateClient.d.ts +35 -0
- package/dist/client/StateClient.d.ts.map +1 -0
- package/dist/client/StateClient.js +36 -0
- package/dist/client/StateClient.js.map +1 -0
- package/dist/client/TaskClient.d.ts +706 -0
- package/dist/client/TaskClient.d.ts.map +1 -0
- package/dist/client/TaskClient.js +2522 -0
- package/dist/client/TaskClient.js.map +1 -0
- package/dist/client/ToolClient.d.ts +278 -0
- package/dist/client/ToolClient.d.ts.map +1 -0
- package/dist/client/ToolClient.js +1115 -0
- package/dist/client/ToolClient.js.map +1 -0
- package/dist/client/a2a/index.d.ts +10 -0
- package/dist/client/a2a/index.d.ts.map +1 -0
- package/dist/client/a2a/index.js +9 -0
- package/dist/client/a2a/index.js.map +1 -0
- package/dist/client/a2a/registerA2A.d.ts +170 -0
- package/dist/client/a2a/registerA2A.d.ts.map +1 -0
- package/dist/client/a2a/registerA2A.js +85 -0
- package/dist/client/a2a/registerA2A.js.map +1 -0
- package/dist/client/connection.d.ts +800 -0
- package/dist/client/connection.d.ts.map +1 -0
- package/dist/client/connection.js +2020 -0
- package/dist/client/connection.js.map +1 -0
- package/dist/client/errors.d.ts +735 -0
- package/dist/client/errors.d.ts.map +1 -0
- package/dist/client/errors.js +921 -0
- package/dist/client/errors.js.map +1 -0
- package/dist/client/index.d.ts +26 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +20 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/inlineGraph.d.ts +66 -0
- package/dist/client/inlineGraph.d.ts.map +1 -0
- package/dist/client/inlineGraph.js +500 -0
- package/dist/client/inlineGraph.js.map +1 -0
- package/dist/client/internal/thenable.d.ts +27 -0
- package/dist/client/internal/thenable.d.ts.map +1 -0
- package/dist/client/internal/thenable.js +31 -0
- package/dist/client/internal/thenable.js.map +1 -0
- package/dist/client/iterator.d.ts +32 -0
- package/dist/client/iterator.d.ts.map +1 -0
- package/dist/client/iterator.js +73 -0
- package/dist/client/iterator.js.map +1 -0
- package/dist/client/mcp/McpClientPool.browser.d.ts +76 -0
- package/dist/client/mcp/McpClientPool.browser.d.ts.map +1 -0
- package/dist/client/mcp/McpClientPool.browser.js +78 -0
- package/dist/client/mcp/McpClientPool.browser.js.map +1 -0
- package/dist/client/mcp/McpClientPool.d.ts +236 -0
- package/dist/client/mcp/McpClientPool.d.ts.map +1 -0
- package/dist/client/mcp/McpClientPool.js +585 -0
- package/dist/client/mcp/McpClientPool.js.map +1 -0
- package/dist/client/mcp/projection.d.ts +109 -0
- package/dist/client/mcp/projection.d.ts.map +1 -0
- package/dist/client/mcp/projection.js +446 -0
- package/dist/client/mcp/projection.js.map +1 -0
- package/dist/client/mcp/substituteEnv.browser.d.ts +18 -0
- package/dist/client/mcp/substituteEnv.browser.d.ts.map +1 -0
- package/dist/client/mcp/substituteEnv.browser.js +20 -0
- package/dist/client/mcp/substituteEnv.browser.js.map +1 -0
- package/dist/client/mcp/substituteEnv.d.ts +45 -0
- package/dist/client/mcp/substituteEnv.d.ts.map +1 -0
- package/dist/client/mcp/substituteEnv.js +63 -0
- package/dist/client/mcp/substituteEnv.js.map +1 -0
- package/dist/client/observers.d.ts +57 -0
- package/dist/client/observers.d.ts.map +1 -0
- package/dist/client/observers.js +203 -0
- package/dist/client/observers.js.map +1 -0
- package/dist/client/options.d.ts +269 -0
- package/dist/client/options.d.ts.map +1 -0
- package/dist/client/options.js +9 -0
- package/dist/client/options.js.map +1 -0
- package/dist/client/tools/_readlineApprovalPrompt.browser.d.ts +17 -0
- package/dist/client/tools/_readlineApprovalPrompt.browser.d.ts.map +1 -0
- package/dist/client/tools/_readlineApprovalPrompt.browser.js +24 -0
- package/dist/client/tools/_readlineApprovalPrompt.browser.js.map +1 -0
- package/dist/client/tools/_readlineApprovalPrompt.d.ts +33 -0
- package/dist/client/tools/_readlineApprovalPrompt.d.ts.map +1 -0
- package/dist/client/tools/_readlineApprovalPrompt.js +90 -0
- package/dist/client/tools/_readlineApprovalPrompt.js.map +1 -0
- package/dist/client/tools/approval.d.ts +280 -0
- package/dist/client/tools/approval.d.ts.map +1 -0
- package/dist/client/tools/approval.js +229 -0
- package/dist/client/tools/approval.js.map +1 -0
- package/dist/client/tools/bindFunctionToolDefs.d.ts +156 -0
- package/dist/client/tools/bindFunctionToolDefs.d.ts.map +1 -0
- package/dist/client/tools/bindFunctionToolDefs.js +360 -0
- package/dist/client/tools/bindFunctionToolDefs.js.map +1 -0
- package/dist/client/tools/defineFunctionTool.d.ts +277 -0
- package/dist/client/tools/defineFunctionTool.d.ts.map +1 -0
- package/dist/client/tools/defineFunctionTool.js +190 -0
- package/dist/client/tools/defineFunctionTool.js.map +1 -0
- package/dist/client/transport.browser.d.ts +20 -0
- package/dist/client/transport.browser.d.ts.map +1 -0
- package/dist/client/transport.browser.js +29 -0
- package/dist/client/transport.browser.js.map +1 -0
- package/dist/client/transport.d.ts +47 -0
- package/dist/client/transport.d.ts.map +1 -0
- package/dist/client/transport.js +102 -0
- package/dist/client/transport.js.map +1 -0
- package/dist/client/transport.shared.d.ts +30 -0
- package/dist/client/transport.shared.d.ts.map +1 -0
- package/dist/client/transport.shared.js +40 -0
- package/dist/client/transport.shared.js.map +1 -0
- package/dist/client/uuid.d.ts +32 -0
- package/dist/client/uuid.d.ts.map +1 -0
- package/dist/client/uuid.js +65 -0
- package/dist/client/uuid.js.map +1 -0
- package/dist/index.d.ts +88 -39
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +166 -43
- package/dist/index.js.map +1 -1
- package/dist/observability/attributes.d.ts +136 -0
- package/dist/observability/attributes.d.ts.map +1 -0
- package/dist/observability/attributes.js +184 -0
- package/dist/observability/attributes.js.map +1 -0
- package/dist/observability/index.d.ts +14 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +11 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/observability/resolveOTel.browser.d.ts +13 -0
- package/dist/observability/resolveOTel.browser.d.ts.map +1 -0
- package/dist/observability/resolveOTel.browser.js +14 -0
- package/dist/observability/resolveOTel.browser.js.map +1 -0
- package/dist/observability/resolveOTel.d.ts +28 -0
- package/dist/observability/resolveOTel.d.ts.map +1 -0
- package/dist/observability/resolveOTel.js +74 -0
- package/dist/observability/resolveOTel.js.map +1 -0
- package/dist/observability/spans.d.ts +198 -0
- package/dist/observability/spans.d.ts.map +1 -0
- package/dist/observability/spans.js +300 -0
- package/dist/observability/spans.js.map +1 -0
- package/dist/observability/traceContext.d.ts +51 -0
- package/dist/observability/traceContext.d.ts.map +1 -0
- package/dist/observability/traceContext.js +151 -0
- package/dist/observability/traceContext.js.map +1 -0
- package/dist/observability/transportMetrics.d.ts +58 -0
- package/dist/observability/transportMetrics.d.ts.map +1 -0
- package/dist/observability/transportMetrics.js +55 -0
- package/dist/observability/transportMetrics.js.map +1 -0
- package/dist/qar/agentSpec.d.ts +93 -0
- package/dist/qar/agentSpec.d.ts.map +1 -0
- package/dist/qar/agentSpec.js +184 -0
- package/dist/qar/agentSpec.js.map +1 -0
- package/dist/qar/clientEvents.d.ts +86 -0
- package/dist/qar/clientEvents.d.ts.map +1 -0
- package/dist/qar/clientEvents.js +36 -0
- package/dist/qar/clientEvents.js.map +1 -0
- package/dist/qar/envelopes.d.ts +227 -0
- package/dist/qar/envelopes.d.ts.map +1 -0
- package/dist/qar/envelopes.js +67 -0
- package/dist/qar/envelopes.js.map +1 -0
- package/dist/qar/generated/envelope.d.ts +332 -0
- package/dist/qar/generated/envelope.d.ts.map +1 -0
- package/dist/qar/generated/envelope.js +15 -0
- package/dist/qar/generated/envelope.js.map +1 -0
- package/dist/qar/generated/qar-info.d.ts +76 -0
- package/dist/qar/generated/qar-info.d.ts.map +1 -0
- package/dist/qar/generated/qar-info.js +15 -0
- package/dist/qar/generated/qar-info.js.map +1 -0
- package/dist/qar/generated/qodo-task-start-payload.d.ts +54 -0
- package/dist/qar/generated/qodo-task-start-payload.d.ts.map +1 -0
- package/dist/qar/generated/qodo-task-start-payload.js +15 -0
- package/dist/qar/generated/qodo-task-start-payload.js.map +1 -0
- package/dist/qar/ids.d.ts +19 -0
- package/dist/qar/ids.d.ts.map +1 -0
- package/dist/qar/ids.js +11 -0
- package/dist/qar/ids.js.map +1 -0
- package/dist/qar/index.d.ts +24 -0
- package/dist/qar/index.d.ts.map +1 -0
- package/dist/qar/index.js +16 -0
- package/dist/qar/index.js.map +1 -0
- package/dist/qar/info.d.ts +37 -0
- package/dist/qar/info.d.ts.map +1 -0
- package/dist/qar/info.js +17 -0
- package/dist/qar/info.js.map +1 -0
- package/dist/qar/json.d.ts +14 -0
- package/dist/qar/json.d.ts.map +1 -0
- package/dist/qar/json.js +9 -0
- package/dist/qar/json.js.map +1 -0
- package/dist/qar/payloads.d.ts +480 -0
- package/dist/qar/payloads.d.ts.map +1 -0
- package/dist/qar/payloads.js +37 -0
- package/dist/qar/payloads.js.map +1 -0
- package/dist/qar/specs.d.ts +604 -0
- package/dist/qar/specs.d.ts.map +1 -0
- package/dist/qar/specs.js +29 -0
- package/dist/qar/specs.js.map +1 -0
- package/dist/qar/taskEvents.d.ts +25 -0
- package/dist/qar/taskEvents.d.ts.map +1 -0
- package/dist/qar/taskEvents.js +22 -0
- package/dist/qar/taskEvents.js.map +1 -0
- package/dist/qar/trace.d.ts +12 -0
- package/dist/qar/trace.d.ts.map +1 -0
- package/dist/qar/trace.js +12 -0
- package/dist/qar/trace.js.map +1 -0
- package/dist/skills/activation.d.ts +177 -0
- package/dist/skills/activation.d.ts.map +1 -0
- package/dist/skills/activation.js +428 -0
- package/dist/skills/activation.js.map +1 -0
- package/dist/skills/cli/index.browser.d.ts +18 -0
- package/dist/skills/cli/index.browser.d.ts.map +1 -0
- package/dist/skills/cli/index.browser.js +27 -0
- package/dist/skills/cli/index.browser.js.map +1 -0
- package/dist/skills/cli/index.d.ts +37 -0
- package/dist/skills/cli/index.d.ts.map +1 -0
- package/dist/skills/cli/index.js +494 -0
- package/dist/skills/cli/index.js.map +1 -0
- package/dist/skills/events.d.ts +255 -0
- package/dist/skills/events.d.ts.map +1 -0
- package/dist/skills/events.js +224 -0
- package/dist/skills/events.js.map +1 -0
- package/dist/skills/index.d.ts +45 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +34 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/inject.d.ts +57 -0
- package/dist/skills/inject.d.ts.map +1 -0
- package/dist/skills/inject.js +162 -0
- package/dist/skills/inject.js.map +1 -0
- package/dist/skills/lockfile.browser.d.ts +56 -0
- package/dist/skills/lockfile.browser.d.ts.map +1 -0
- package/dist/skills/lockfile.browser.js +55 -0
- package/dist/skills/lockfile.browser.js.map +1 -0
- package/dist/skills/lockfile.d.ts +137 -0
- package/dist/skills/lockfile.d.ts.map +1 -0
- package/dist/skills/lockfile.js +423 -0
- package/dist/skills/lockfile.js.map +1 -0
- package/dist/skills/manager.browser.d.ts +94 -0
- package/dist/skills/manager.browser.d.ts.map +1 -0
- package/dist/skills/manager.browser.js +159 -0
- package/dist/skills/manager.browser.js.map +1 -0
- package/dist/skills/manager.d.ts +362 -0
- package/dist/skills/manager.d.ts.map +1 -0
- package/dist/skills/manager.js +1386 -0
- package/dist/skills/manager.js.map +1 -0
- package/dist/skills/mcp/index.d.ts +15 -0
- package/dist/skills/mcp/index.d.ts.map +1 -0
- package/dist/skills/mcp/index.js +12 -0
- package/dist/skills/mcp/index.js.map +1 -0
- package/dist/skills/mcp/path.browser.d.ts +27 -0
- package/dist/skills/mcp/path.browser.d.ts.map +1 -0
- package/dist/skills/mcp/path.browser.js +33 -0
- package/dist/skills/mcp/path.browser.js.map +1 -0
- package/dist/skills/mcp/path.d.ts +57 -0
- package/dist/skills/mcp/path.d.ts.map +1 -0
- package/dist/skills/mcp/path.js +150 -0
- package/dist/skills/mcp/path.js.map +1 -0
- package/dist/skills/mcp/server.browser.d.ts +32 -0
- package/dist/skills/mcp/server.browser.d.ts.map +1 -0
- package/dist/skills/mcp/server.browser.js +53 -0
- package/dist/skills/mcp/server.browser.js.map +1 -0
- package/dist/skills/mcp/server.d.ts +144 -0
- package/dist/skills/mcp/server.d.ts.map +1 -0
- package/dist/skills/mcp/server.js +841 -0
- package/dist/skills/mcp/server.js.map +1 -0
- package/dist/skills/mcp/types.d.ts +72 -0
- package/dist/skills/mcp/types.d.ts.map +1 -0
- package/dist/skills/mcp/types.js +20 -0
- package/dist/skills/mcp/types.js.map +1 -0
- package/dist/skills/mcp/wireDefs.d.ts +58 -0
- package/dist/skills/mcp/wireDefs.d.ts.map +1 -0
- package/dist/skills/mcp/wireDefs.js +141 -0
- package/dist/skills/mcp/wireDefs.js.map +1 -0
- package/dist/skills/parser.d.ts +63 -0
- package/dist/skills/parser.d.ts.map +1 -0
- package/dist/skills/parser.js +755 -0
- package/dist/skills/parser.js.map +1 -0
- package/dist/skills/prefilter.d.ts +104 -0
- package/dist/skills/prefilter.d.ts.map +1 -0
- package/dist/skills/prefilter.js +398 -0
- package/dist/skills/prefilter.js.map +1 -0
- package/dist/skills/preprocess.d.ts +169 -0
- package/dist/skills/preprocess.d.ts.map +1 -0
- package/dist/skills/preprocess.js +535 -0
- package/dist/skills/preprocess.js.map +1 -0
- package/dist/skills/render.d.ts +83 -0
- package/dist/skills/render.d.ts.map +1 -0
- package/dist/skills/render.js +397 -0
- package/dist/skills/render.js.map +1 -0
- package/dist/skills/sources/index.browser.d.ts +29 -0
- package/dist/skills/sources/index.browser.d.ts.map +1 -0
- package/dist/skills/sources/index.browser.js +16 -0
- package/dist/skills/sources/index.browser.js.map +1 -0
- package/dist/skills/sources/index.d.ts +59 -0
- package/dist/skills/sources/index.d.ts.map +1 -0
- package/dist/skills/sources/index.js +471 -0
- package/dist/skills/sources/index.js.map +1 -0
- package/dist/skills/sources/walk.browser.d.ts +17 -0
- package/dist/skills/sources/walk.browser.d.ts.map +1 -0
- package/dist/skills/sources/walk.browser.js +19 -0
- package/dist/skills/sources/walk.browser.js.map +1 -0
- package/dist/skills/sources/walk.d.ts +68 -0
- package/dist/skills/sources/walk.d.ts.map +1 -0
- package/dist/skills/sources/walk.js +264 -0
- package/dist/skills/sources/walk.js.map +1 -0
- package/dist/skills/substitute.d.ts +87 -0
- package/dist/skills/substitute.d.ts.map +1 -0
- package/dist/skills/substitute.js +322 -0
- package/dist/skills/substitute.js.map +1 -0
- package/dist/skills/testing/SkillKit.browser.d.ts +62 -0
- package/dist/skills/testing/SkillKit.browser.d.ts.map +1 -0
- package/dist/skills/testing/SkillKit.browser.js +41 -0
- package/dist/skills/testing/SkillKit.browser.js.map +1 -0
- package/dist/skills/testing/SkillKit.d.ts +130 -0
- package/dist/skills/testing/SkillKit.d.ts.map +1 -0
- package/dist/skills/testing/SkillKit.js +316 -0
- package/dist/skills/testing/SkillKit.js.map +1 -0
- package/dist/skills/testing/index.d.ts +9 -0
- package/dist/skills/testing/index.d.ts.map +1 -0
- package/dist/skills/testing/index.js +8 -0
- package/dist/skills/testing/index.js.map +1 -0
- package/dist/skills/trust.d.ts +72 -0
- package/dist/skills/trust.d.ts.map +1 -0
- package/dist/skills/trust.js +183 -0
- package/dist/skills/trust.js.map +1 -0
- package/dist/skills/types.d.ts +627 -0
- package/dist/skills/types.d.ts.map +1 -0
- package/dist/skills/types.js +85 -0
- package/dist/skills/types.js.map +1 -0
- package/dist/skills/validator.d.ts +95 -0
- package/dist/skills/validator.d.ts.map +1 -0
- package/dist/skills/validator.js +486 -0
- package/dist/skills/validator.js.map +1 -0
- package/dist/tracing/PipelineTracer.d.ts +35 -22
- package/dist/tracing/PipelineTracer.d.ts.map +1 -1
- package/dist/tracing/PipelineTracer.js +106 -61
- package/dist/tracing/PipelineTracer.js.map +1 -1
- package/dist/tracing/SdkTracer.d.ts +63 -61
- package/dist/tracing/SdkTracer.d.ts.map +1 -1
- package/dist/tracing/SdkTracer.js +185 -177
- package/dist/tracing/SdkTracer.js.map +1 -1
- package/dist/tracing/index.d.ts +10 -1
- package/dist/tracing/index.d.ts.map +1 -1
- package/dist/tracing/index.js +9 -0
- package/dist/tracing/index.js.map +1 -1
- package/dist/tracing/types.d.ts +89 -16
- package/dist/tracing/types.d.ts.map +1 -1
- package/dist/tracing/types.js +17 -4
- package/dist/tracing/types.js.map +1 -1
- package/dist/types.d.ts +6 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +10 -20
- package/dist/version.js.map +1 -1
- package/package.json +53 -39
- package/.claude/skills/qodo-agent/SKILL.md +0 -974
- package/.claude/skills/qodo-agent/assets/programmatic-agent.ts +0 -407
- package/.claude/skills/qodo-agent/references/builtin-tools.md +0 -342
- package/.claude/skills/qodo-agent/references/common-issues.md +0 -537
- package/bin/rg +0 -0
- package/dist/api/agent.d.ts +0 -104
- package/dist/api/agent.d.ts.map +0 -1
- package/dist/api/agent.js +0 -939
- package/dist/api/agent.js.map +0 -1
- package/dist/api/analytics.d.ts +0 -43
- package/dist/api/analytics.d.ts.map +0 -1
- package/dist/api/analytics.js +0 -163
- package/dist/api/analytics.js.map +0 -1
- package/dist/api/http.d.ts +0 -5
- package/dist/api/http.d.ts.map +0 -1
- package/dist/api/http.js +0 -62
- package/dist/api/http.js.map +0 -1
- package/dist/api/index.d.ts +0 -12
- package/dist/api/index.d.ts.map +0 -1
- package/dist/api/index.js +0 -17
- package/dist/api/index.js.map +0 -1
- package/dist/api/taskTracking.d.ts +0 -54
- package/dist/api/taskTracking.d.ts.map +0 -1
- package/dist/api/taskTracking.js +0 -208
- package/dist/api/taskTracking.js.map +0 -1
- package/dist/api/types.d.ts +0 -93
- package/dist/api/types.d.ts.map +0 -1
- package/dist/api/types.js +0 -2
- package/dist/api/types.js.map +0 -1
- package/dist/api/utils.d.ts +0 -8
- package/dist/api/utils.d.ts.map +0 -1
- package/dist/api/utils.js +0 -63
- package/dist/api/utils.js.map +0 -1
- package/dist/api/websocket.d.ts +0 -203
- package/dist/api/websocket.d.ts.map +0 -1
- package/dist/api/websocket.js +0 -1166
- package/dist/api/websocket.js.map +0 -1
- package/dist/bin/install-skill.d.ts +0 -14
- package/dist/bin/install-skill.d.ts.map +0 -1
- package/dist/bin/install-skill.js +0 -125
- package/dist/bin/install-skill.js.map +0 -1
- package/dist/bin/run-helpers.d.ts +0 -34
- package/dist/bin/run-helpers.d.ts.map +0 -1
- package/dist/bin/run-helpers.js +0 -186
- package/dist/bin/run-helpers.js.map +0 -1
- package/dist/bin/run.d.ts +0 -13
- package/dist/bin/run.d.ts.map +0 -1
- package/dist/bin/run.js +0 -57
- package/dist/bin/run.js.map +0 -1
- package/dist/clients/index.d.ts +0 -10
- package/dist/clients/index.d.ts.map +0 -1
- package/dist/clients/index.js +0 -8
- package/dist/clients/index.js.map +0 -1
- package/dist/clients/info/InfoClient.d.ts +0 -37
- package/dist/clients/info/InfoClient.d.ts.map +0 -1
- package/dist/clients/info/InfoClient.js +0 -69
- package/dist/clients/info/InfoClient.js.map +0 -1
- package/dist/clients/info/index.d.ts +0 -4
- package/dist/clients/info/index.d.ts.map +0 -1
- package/dist/clients/info/index.js +0 -2
- package/dist/clients/info/index.js.map +0 -1
- package/dist/clients/info/types.d.ts +0 -21
- package/dist/clients/info/types.d.ts.map +0 -1
- package/dist/clients/info/types.js +0 -2
- package/dist/clients/info/types.js.map +0 -1
- package/dist/clients/sessions/SessionsClient.d.ts +0 -34
- package/dist/clients/sessions/SessionsClient.d.ts.map +0 -1
- package/dist/clients/sessions/SessionsClient.js +0 -71
- package/dist/clients/sessions/SessionsClient.js.map +0 -1
- package/dist/clients/sessions/index.d.ts +0 -4
- package/dist/clients/sessions/index.d.ts.map +0 -1
- package/dist/clients/sessions/index.js +0 -2
- package/dist/clients/sessions/index.js.map +0 -1
- package/dist/clients/sessions/types.d.ts +0 -20
- package/dist/clients/sessions/types.d.ts.map +0 -1
- package/dist/clients/sessions/types.js +0 -2
- package/dist/clients/sessions/types.js.map +0 -1
- package/dist/clients/tools/ToolsClient.d.ts +0 -39
- package/dist/clients/tools/ToolsClient.d.ts.map +0 -1
- package/dist/clients/tools/ToolsClient.js +0 -95
- package/dist/clients/tools/ToolsClient.js.map +0 -1
- package/dist/clients/tools/index.d.ts +0 -4
- package/dist/clients/tools/index.d.ts.map +0 -1
- package/dist/clients/tools/index.js +0 -2
- package/dist/clients/tools/index.js.map +0 -1
- package/dist/clients/tools/types.d.ts +0 -14
- package/dist/clients/tools/types.d.ts.map +0 -1
- package/dist/clients/tools/types.js +0 -2
- package/dist/clients/tools/types.js.map +0 -1
- package/dist/config/ConfigManager.d.ts +0 -43
- package/dist/config/ConfigManager.d.ts.map +0 -1
- package/dist/config/ConfigManager.js +0 -472
- package/dist/config/ConfigManager.js.map +0 -1
- package/dist/config/index.d.ts +0 -6
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -7
- package/dist/config/index.js.map +0 -1
- package/dist/config/urlConfig.d.ts +0 -15
- package/dist/config/urlConfig.d.ts.map +0 -1
- package/dist/config/urlConfig.js +0 -75
- package/dist/config/urlConfig.js.map +0 -1
- package/dist/constants/errors.d.ts +0 -2
- package/dist/constants/errors.d.ts.map +0 -1
- package/dist/constants/errors.js +0 -2
- package/dist/constants/errors.js.map +0 -1
- package/dist/constants/index.d.ts +0 -7
- package/dist/constants/index.d.ts.map +0 -1
- package/dist/constants/index.js +0 -11
- package/dist/constants/index.js.map +0 -1
- package/dist/constants/tools.d.ts +0 -4
- package/dist/constants/tools.d.ts.map +0 -1
- package/dist/constants/tools.js +0 -4
- package/dist/constants/tools.js.map +0 -1
- package/dist/constants/versions.d.ts +0 -2
- package/dist/constants/versions.d.ts.map +0 -1
- package/dist/constants/versions.js +0 -2
- package/dist/constants/versions.js.map +0 -1
- package/dist/context/buildUserContext.d.ts +0 -18
- package/dist/context/buildUserContext.d.ts.map +0 -1
- package/dist/context/buildUserContext.js +0 -34
- package/dist/context/buildUserContext.js.map +0 -1
- package/dist/context/index.d.ts +0 -9
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js +0 -9
- package/dist/context/index.js.map +0 -1
- package/dist/context/messageManager.d.ts +0 -42
- package/dist/context/messageManager.d.ts.map +0 -1
- package/dist/context/messageManager.js +0 -322
- package/dist/context/messageManager.js.map +0 -1
- package/dist/context/taskFocus.d.ts +0 -2
- package/dist/context/taskFocus.d.ts.map +0 -1
- package/dist/context/taskFocus.js +0 -26
- package/dist/context/taskFocus.js.map +0 -1
- package/dist/context/userInput.d.ts +0 -3
- package/dist/context/userInput.d.ts.map +0 -1
- package/dist/context/userInput.js +0 -20
- package/dist/context/userInput.js.map +0 -1
- package/dist/mcp/MCPManager.d.ts +0 -109
- package/dist/mcp/MCPManager.d.ts.map +0 -1
- package/dist/mcp/MCPManager.js +0 -592
- package/dist/mcp/MCPManager.js.map +0 -1
- package/dist/mcp/approvedTools.d.ts +0 -4
- package/dist/mcp/approvedTools.d.ts.map +0 -1
- package/dist/mcp/approvedTools.js +0 -19
- package/dist/mcp/approvedTools.js.map +0 -1
- package/dist/mcp/baseServer.d.ts +0 -75
- package/dist/mcp/baseServer.d.ts.map +0 -1
- package/dist/mcp/baseServer.js +0 -107
- package/dist/mcp/baseServer.js.map +0 -1
- package/dist/mcp/builtinServers.d.ts +0 -15
- package/dist/mcp/builtinServers.d.ts.map +0 -1
- package/dist/mcp/builtinServers.js +0 -141
- package/dist/mcp/builtinServers.js.map +0 -1
- package/dist/mcp/dynamicBEServer.d.ts +0 -20
- package/dist/mcp/dynamicBEServer.d.ts.map +0 -1
- package/dist/mcp/dynamicBEServer.js +0 -52
- package/dist/mcp/dynamicBEServer.js.map +0 -1
- package/dist/mcp/index.d.ts +0 -18
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/index.js +0 -23
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/mcpInitialization.d.ts +0 -2
- package/dist/mcp/mcpInitialization.d.ts.map +0 -1
- package/dist/mcp/mcpInitialization.js +0 -56
- package/dist/mcp/mcpInitialization.js.map +0 -1
- package/dist/mcp/servers/filesystem.d.ts +0 -44
- package/dist/mcp/servers/filesystem.d.ts.map +0 -1
- package/dist/mcp/servers/filesystem.js +0 -776
- package/dist/mcp/servers/filesystem.js.map +0 -1
- package/dist/mcp/servers/git.d.ts +0 -18
- package/dist/mcp/servers/git.d.ts.map +0 -1
- package/dist/mcp/servers/git.js +0 -441
- package/dist/mcp/servers/git.js.map +0 -1
- package/dist/mcp/servers/ripgrep.d.ts +0 -39
- package/dist/mcp/servers/ripgrep.d.ts.map +0 -1
- package/dist/mcp/servers/ripgrep.js +0 -550
- package/dist/mcp/servers/ripgrep.js.map +0 -1
- package/dist/mcp/servers/shell.d.ts +0 -20
- package/dist/mcp/servers/shell.d.ts.map +0 -1
- package/dist/mcp/servers/shell.js +0 -519
- package/dist/mcp/servers/shell.js.map +0 -1
- package/dist/mcp/serversRegistry.d.ts +0 -55
- package/dist/mcp/serversRegistry.d.ts.map +0 -1
- package/dist/mcp/serversRegistry.js +0 -416
- package/dist/mcp/serversRegistry.js.map +0 -1
- package/dist/mcp/toolProcessor.d.ts +0 -82
- package/dist/mcp/toolProcessor.d.ts.map +0 -1
- package/dist/mcp/toolProcessor.js +0 -392
- package/dist/mcp/toolProcessor.js.map +0 -1
- package/dist/mcp/types.d.ts +0 -29
- package/dist/mcp/types.d.ts.map +0 -1
- package/dist/mcp/types.js +0 -2
- package/dist/mcp/types.js.map +0 -1
- package/dist/messages/index.d.ts +0 -8
- package/dist/messages/index.d.ts.map +0 -1
- package/dist/messages/index.js +0 -7
- package/dist/messages/index.js.map +0 -1
- package/dist/messages/openai.d.ts +0 -26
- package/dist/messages/openai.d.ts.map +0 -1
- package/dist/messages/openai.js +0 -55
- package/dist/messages/openai.js.map +0 -1
- package/dist/messages/types.d.ts +0 -73
- package/dist/messages/types.d.ts.map +0 -1
- package/dist/messages/types.js +0 -78
- package/dist/messages/types.js.map +0 -1
- package/dist/parser/index.d.ts +0 -72
- package/dist/parser/index.d.ts.map +0 -1
- package/dist/parser/index.js +0 -967
- package/dist/parser/index.js.map +0 -1
- package/dist/parser/types.d.ts +0 -153
- package/dist/parser/types.d.ts.map +0 -1
- package/dist/parser/types.js +0 -6
- package/dist/parser/types.js.map +0 -1
- package/dist/parser/utils.d.ts +0 -18
- package/dist/parser/utils.d.ts.map +0 -1
- package/dist/parser/utils.js +0 -64
- package/dist/parser/utils.js.map +0 -1
- package/dist/sdk/QodoSDK.d.ts +0 -218
- package/dist/sdk/QodoSDK.d.ts.map +0 -1
- package/dist/sdk/QodoSDK.js +0 -1115
- package/dist/sdk/QodoSDK.js.map +0 -1
- package/dist/sdk/artifacts.d.ts +0 -156
- package/dist/sdk/artifacts.d.ts.map +0 -1
- package/dist/sdk/artifacts.js +0 -166
- package/dist/sdk/artifacts.js.map +0 -1
- package/dist/sdk/bootstrap.d.ts +0 -16
- package/dist/sdk/bootstrap.d.ts.map +0 -1
- package/dist/sdk/bootstrap.js +0 -28
- package/dist/sdk/bootstrap.js.map +0 -1
- package/dist/sdk/builders.d.ts +0 -54
- package/dist/sdk/builders.d.ts.map +0 -1
- package/dist/sdk/builders.js +0 -117
- package/dist/sdk/builders.js.map +0 -1
- package/dist/sdk/defaults.d.ts +0 -11
- package/dist/sdk/defaults.d.ts.map +0 -1
- package/dist/sdk/defaults.js +0 -39
- package/dist/sdk/defaults.js.map +0 -1
- package/dist/sdk/discovery.d.ts +0 -2
- package/dist/sdk/discovery.d.ts.map +0 -1
- package/dist/sdk/discovery.js +0 -25
- package/dist/sdk/discovery.js.map +0 -1
- package/dist/sdk/events.d.ts +0 -269
- package/dist/sdk/events.d.ts.map +0 -1
- package/dist/sdk/events.js +0 -69
- package/dist/sdk/events.js.map +0 -1
- package/dist/sdk/exit-expression.d.ts +0 -13
- package/dist/sdk/exit-expression.d.ts.map +0 -1
- package/dist/sdk/exit-expression.js +0 -35
- package/dist/sdk/exit-expression.js.map +0 -1
- package/dist/sdk/index.d.ts +0 -17
- package/dist/sdk/index.d.ts.map +0 -1
- package/dist/sdk/index.js +0 -17
- package/dist/sdk/index.js.map +0 -1
- package/dist/sdk/middleware.d.ts +0 -59
- package/dist/sdk/middleware.d.ts.map +0 -1
- package/dist/sdk/middleware.js +0 -69
- package/dist/sdk/middleware.js.map +0 -1
- package/dist/sdk/pipeline/PipelineBuilder.d.ts +0 -79
- package/dist/sdk/pipeline/PipelineBuilder.d.ts.map +0 -1
- package/dist/sdk/pipeline/PipelineBuilder.js +0 -129
- package/dist/sdk/pipeline/PipelineBuilder.js.map +0 -1
- package/dist/sdk/pipeline/PipelineRunner.d.ts +0 -28
- package/dist/sdk/pipeline/PipelineRunner.d.ts.map +0 -1
- package/dist/sdk/pipeline/PipelineRunner.js +0 -326
- package/dist/sdk/pipeline/PipelineRunner.js.map +0 -1
- package/dist/sdk/pipeline/compiler.d.ts +0 -24
- package/dist/sdk/pipeline/compiler.d.ts.map +0 -1
- package/dist/sdk/pipeline/compiler.js +0 -199
- package/dist/sdk/pipeline/compiler.js.map +0 -1
- package/dist/sdk/pipeline/declarative.d.ts +0 -34
- package/dist/sdk/pipeline/declarative.d.ts.map +0 -1
- package/dist/sdk/pipeline/declarative.js +0 -9
- package/dist/sdk/pipeline/declarative.js.map +0 -1
- package/dist/sdk/pipeline/index.d.ts +0 -20
- package/dist/sdk/pipeline/index.d.ts.map +0 -1
- package/dist/sdk/pipeline/index.js +0 -19
- package/dist/sdk/pipeline/index.js.map +0 -1
- package/dist/sdk/pipeline/types.d.ts +0 -93
- package/dist/sdk/pipeline/types.d.ts.map +0 -1
- package/dist/sdk/pipeline/types.js +0 -10
- package/dist/sdk/pipeline/types.js.map +0 -1
- package/dist/sdk/policies.d.ts +0 -163
- package/dist/sdk/policies.d.ts.map +0 -1
- package/dist/sdk/policies.js +0 -243
- package/dist/sdk/policies.js.map +0 -1
- package/dist/sdk/runner/AgentRunner.d.ts +0 -22
- package/dist/sdk/runner/AgentRunner.d.ts.map +0 -1
- package/dist/sdk/runner/AgentRunner.js +0 -222
- package/dist/sdk/runner/AgentRunner.js.map +0 -1
- package/dist/sdk/runner/finalize.d.ts +0 -56
- package/dist/sdk/runner/finalize.d.ts.map +0 -1
- package/dist/sdk/runner/finalize.js +0 -155
- package/dist/sdk/runner/finalize.js.map +0 -1
- package/dist/sdk/runner/formats.d.ts +0 -7
- package/dist/sdk/runner/formats.d.ts.map +0 -1
- package/dist/sdk/runner/formats.js +0 -76
- package/dist/sdk/runner/formats.js.map +0 -1
- package/dist/sdk/runner/index.d.ts +0 -9
- package/dist/sdk/runner/index.d.ts.map +0 -1
- package/dist/sdk/runner/index.js +0 -9
- package/dist/sdk/runner/index.js.map +0 -1
- package/dist/sdk/runner/progress.d.ts +0 -3
- package/dist/sdk/runner/progress.d.ts.map +0 -1
- package/dist/sdk/runner/progress.js +0 -16
- package/dist/sdk/runner/progress.js.map +0 -1
- package/dist/sdk/schemas.d.ts +0 -72
- package/dist/sdk/schemas.d.ts.map +0 -1
- package/dist/sdk/schemas.js +0 -282
- package/dist/sdk/schemas.js.map +0 -1
- package/dist/sdk/trigger-context.d.ts +0 -24
- package/dist/sdk/trigger-context.d.ts.map +0 -1
- package/dist/sdk/trigger-context.js +0 -136
- package/dist/sdk/trigger-context.js.map +0 -1
- package/dist/session/SessionContext.d.ts +0 -89
- package/dist/session/SessionContext.d.ts.map +0 -1
- package/dist/session/SessionContext.js +0 -410
- package/dist/session/SessionContext.js.map +0 -1
- package/dist/session/environment.d.ts +0 -52
- package/dist/session/environment.d.ts.map +0 -1
- package/dist/session/environment.js +0 -27
- package/dist/session/environment.js.map +0 -1
- package/dist/session/history.d.ts +0 -18
- package/dist/session/history.d.ts.map +0 -1
- package/dist/session/history.js +0 -68
- package/dist/session/history.js.map +0 -1
- package/dist/session/index.d.ts +0 -10
- package/dist/session/index.d.ts.map +0 -1
- package/dist/session/index.js +0 -9
- package/dist/session/index.js.map +0 -1
- package/dist/session/serverData.d.ts +0 -38
- package/dist/session/serverData.d.ts.map +0 -1
- package/dist/session/serverData.js +0 -261
- package/dist/session/serverData.js.map +0 -1
- package/dist/tracing/pipelineHelpers.d.ts +0 -29
- package/dist/tracing/pipelineHelpers.d.ts.map +0 -1
- package/dist/tracing/pipelineHelpers.js +0 -224
- package/dist/tracing/pipelineHelpers.js.map +0 -1
- package/dist/tracking/Tracker.d.ts +0 -55
- package/dist/tracking/Tracker.d.ts.map +0 -1
- package/dist/tracking/Tracker.js +0 -217
- package/dist/tracking/Tracker.js.map +0 -1
- package/dist/tracking/index.d.ts +0 -8
- package/dist/tracking/index.d.ts.map +0 -1
- package/dist/tracking/index.js +0 -8
- package/dist/tracking/index.js.map +0 -1
- package/dist/tracking/schemas.d.ts +0 -292
- package/dist/tracking/schemas.d.ts.map +0 -1
- package/dist/tracking/schemas.js +0 -91
- package/dist/tracking/schemas.js.map +0 -1
- package/dist/utils/extractSetFlags.d.ts +0 -6
- package/dist/utils/extractSetFlags.d.ts.map +0 -1
- package/dist/utils/extractSetFlags.js +0 -16
- package/dist/utils/extractSetFlags.js.map +0 -1
- package/dist/utils/formatTimeAgo.d.ts +0 -2
- package/dist/utils/formatTimeAgo.d.ts.map +0 -1
- package/dist/utils/formatTimeAgo.js +0 -20
- package/dist/utils/formatTimeAgo.js.map +0 -1
- package/dist/utils/index.d.ts +0 -12
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -12
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/machineId.d.ts +0 -14
- package/dist/utils/machineId.d.ts.map +0 -1
- package/dist/utils/machineId.js +0 -66
- package/dist/utils/machineId.js.map +0 -1
- package/dist/utils/pathUtils.d.ts +0 -22
- package/dist/utils/pathUtils.d.ts.map +0 -1
- package/dist/utils/pathUtils.js +0 -54
- package/dist/utils/pathUtils.js.map +0 -1
- package/scripts/download-ripgrep.js +0 -269
|
@@ -0,0 +1,706 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `TaskClient` — task lifecycle surface, mirroring QAR's `task.*` envelope kinds.
|
|
3
|
+
*/
|
|
4
|
+
import type { TaskEvent } from '../qar/index.js';
|
|
5
|
+
import type { SessionId, TaskId } from '../qar/ids.js';
|
|
6
|
+
import type { QodoTaskStartInput, QodoTaskStartPayload, SessionState, TaskCancelPayload, TaskContinuePayload } from '../qar/payloads.js';
|
|
7
|
+
import type { FunctionToolDef, InlineAgentSpec, InlineGraphSpec } from '../qar/specs.js';
|
|
8
|
+
import type { TaskOptions, ResubscribeOptions, TaskCancelOptions } from './options.js';
|
|
9
|
+
import { Connection } from './connection.js';
|
|
10
|
+
import type { SpecsClient } from './SpecsClient.js';
|
|
11
|
+
import type { SpanRecorder } from '../observability/spans.js';
|
|
12
|
+
import type { TransportMetrics } from '../observability/transportMetrics.js';
|
|
13
|
+
import type { QarRegistryClient, RegisteredAgentRef } from './QarRegistryClient.js';
|
|
14
|
+
import { type SkillsManager } from '../skills/manager.js';
|
|
15
|
+
/**
|
|
16
|
+
* Returned by `TaskClient.cancel`. Mirrors the `task.done` envelope payload.
|
|
17
|
+
*
|
|
18
|
+
* `status` carries the server-reported terminal value verbatim so callers can
|
|
19
|
+
* tell whether the cancel actually applied (`'canceled'`), the server reported
|
|
20
|
+
* failure (`'failed'`), or the task completed before the cancel was processed
|
|
21
|
+
* (`'completed'` — race outcome). Don't collapse — collapsing loses the race
|
|
22
|
+
* signal that the docs say `cancel()` returns.
|
|
23
|
+
*/
|
|
24
|
+
export interface TaskCancelResult {
|
|
25
|
+
readonly task_id: TaskId;
|
|
26
|
+
readonly status: 'canceled' | 'failed' | 'completed';
|
|
27
|
+
readonly error?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The shape returned by `tasks.start` / `tasks.startWithAgent` /
|
|
31
|
+
* `tasks.startWithGraph` — an `AsyncIterable<TaskEvent>` augmented with
|
|
32
|
+
* the synchronous outbound `taskId` and two Promises resolved on the
|
|
33
|
+
* server's `task.started` admission ack.
|
|
34
|
+
*
|
|
35
|
+
* `taskId` is synchronous and equals the **first outbound**
|
|
36
|
+
* `task.start.message_id`. Useful for the pre-admission cancel race: a
|
|
37
|
+
* caller that wants to abandon the start before the ack arrives can
|
|
38
|
+
* immediately invoke `client.tasks.cancel(stream.taskId)`.
|
|
39
|
+
*
|
|
40
|
+
* `admittedTaskId` is the **canonical post-admission task id** carried
|
|
41
|
+
* on `task.started.payload.task_id`. On the omitted-key DX-default
|
|
42
|
+
* path it equals `taskId` (no retry path possible — server can't mint
|
|
43
|
+
* a different id). On the opt-in deterministic-key path with
|
|
44
|
+
* `admission_in_progress` retries it **may differ** — the SDK rotates
|
|
45
|
+
* `message_id` per retry, while the server's canonical task_id is
|
|
46
|
+
* whatever the winning attempt's `task.started` reports. Use
|
|
47
|
+
* `await stream.admittedTaskId` for cancel / continue / resubscribe
|
|
48
|
+
* operations after admission completes.
|
|
49
|
+
*
|
|
50
|
+
* `sessionId` is the server-derived `session_id` carried on the same
|
|
51
|
+
* envelope. Await it before any cross-pod operation that needs the
|
|
52
|
+
* address (Bulletin forwarding, durable logging for replay recovery).
|
|
53
|
+
*
|
|
54
|
+
* **Rejection contract**: both Promises always settle — resolve on
|
|
55
|
+
* admission, reject on `admission_stalled` /
|
|
56
|
+
* `QodoAdmissionTimeoutError` / transport failure / pre-ack terminal.
|
|
57
|
+
* Crucially, the SDK's internal admission driver advances the retry
|
|
58
|
+
* loop **independent of whether the consumer iterates the stream**,
|
|
59
|
+
* so `await stream.sessionId` BEFORE the first `for await` cannot
|
|
60
|
+
* hang.
|
|
61
|
+
*/
|
|
62
|
+
export type TaskStartIterable = AsyncIterable<TaskEvent> & {
|
|
63
|
+
readonly taskId: TaskId;
|
|
64
|
+
readonly admittedTaskId: Promise<TaskId>;
|
|
65
|
+
readonly sessionId: Promise<SessionId>;
|
|
66
|
+
/**
|
|
67
|
+
* Full admission ack including the idempotency discriminator.
|
|
68
|
+
* Resolves with `{taskId, sessionId, isNew, state?, previousTaskId?,
|
|
69
|
+
* previousState?}` when the server's `task.started` envelope arrives.
|
|
70
|
+
* Settles atomically with `admittedTaskId` and `sessionId` (same
|
|
71
|
+
* envelope, three views of the same data).
|
|
72
|
+
*
|
|
73
|
+
* `isNew === true` on the fresh-admission path (default — older QAR
|
|
74
|
+
* builds without idempotent admission also report `true` because the
|
|
75
|
+
* SDK defaults the absent field). `false` indicates QAR returned the
|
|
76
|
+
* existing task for an already-dispatched session.
|
|
77
|
+
*
|
|
78
|
+
* `previousTaskId` + `previousState` are populated ONLY on terminal
|
|
79
|
+
* re-dispatch (a NEW task with full `session_messages` history
|
|
80
|
+
* inherited from a prior `completed | cancelled | failed` task).
|
|
81
|
+
*/
|
|
82
|
+
readonly admissionResult: Promise<TaskAdmissionResult>;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Resolved view of the `task.started` admission ack — what
|
|
86
|
+
* `TaskStartIterable.admissionResult` carries.
|
|
87
|
+
*
|
|
88
|
+
* `taskId` + `sessionId` are concrete by the time this resolves (vs the
|
|
89
|
+
* separate `admittedTaskId` / `sessionId` Promises which expose the same
|
|
90
|
+
* fields). `isNew` discriminates fresh dispatch (`true`) from idempotent
|
|
91
|
+
* existing-session return (`false`); `state` is present when
|
|
92
|
+
* `isNew === false`. `previousTaskId` + `previousState` are populated
|
|
93
|
+
* only on terminal re-dispatch.
|
|
94
|
+
*/
|
|
95
|
+
export interface TaskAdmissionResult {
|
|
96
|
+
readonly taskId: TaskId;
|
|
97
|
+
readonly sessionId: SessionId;
|
|
98
|
+
readonly isNew: boolean;
|
|
99
|
+
readonly state?: SessionState;
|
|
100
|
+
readonly previousTaskId?: TaskId;
|
|
101
|
+
readonly previousState?: SessionState;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Resolved handle returned by `tasks.continueOrStart`. Composes the
|
|
105
|
+
* admission ack with an `AsyncIterable<TaskEvent>` so consumers can
|
|
106
|
+
* `for await` events directly off the handle:
|
|
107
|
+
*
|
|
108
|
+
* - `isNew === true` — the iterable yields the freshly-started task's
|
|
109
|
+
* event stream (`task.delta` → `task.done`).
|
|
110
|
+
* - `isNew === false && options.input !== undefined` — the iterable
|
|
111
|
+
* yields events from the auto-emitted `tasks.continue(taskId, {input})`
|
|
112
|
+
* dispatch the helper issued internally.
|
|
113
|
+
* - `isNew === false && options.input === undefined` — the iterable
|
|
114
|
+
* completes immediately (no events; consumer wanted a lookup, not a
|
|
115
|
+
* dispatch).
|
|
116
|
+
*
|
|
117
|
+
* `previousTaskId` + `previousState` are populated only on terminal
|
|
118
|
+
* re-dispatch.
|
|
119
|
+
*/
|
|
120
|
+
export interface TaskHandle extends AsyncIterable<TaskEvent> {
|
|
121
|
+
readonly taskId: TaskId;
|
|
122
|
+
readonly sessionId: SessionId;
|
|
123
|
+
readonly isNew: boolean;
|
|
124
|
+
readonly previousTaskId?: TaskId;
|
|
125
|
+
readonly previousState?: SessionState;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Resolved by `tasks.forceResume(idempotencyKey)`. Carries the recovered
|
|
129
|
+
* task's id and the post-recovery session state (typically
|
|
130
|
+
* `'auto-paused'` after QAR cancelled in-flight tool/HITL work; reports
|
|
131
|
+
* the actual state on passthrough — e.g. already auto-paused or
|
|
132
|
+
* terminal).
|
|
133
|
+
*/
|
|
134
|
+
export interface ForceResumeResult {
|
|
135
|
+
readonly taskId: TaskId;
|
|
136
|
+
readonly state: SessionState;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* `tasks.start` input — wire-shape `QodoTaskStartPayload` with `agent_id`
|
|
140
|
+
* widened to accept either a bare string or a `RegisteredAgentRef` minted by
|
|
141
|
+
* `client.qar.registerAgent`.
|
|
142
|
+
*
|
|
143
|
+
* The SDK never serializes a locally-registered agent's body to QAR — it
|
|
144
|
+
* auto-fills the wire `agent_id` from `ref.name` and keeps the body in the
|
|
145
|
+
* in-process registry for local dispatch.
|
|
146
|
+
*/
|
|
147
|
+
export type TaskStartInput = Omit<QodoTaskStartPayload, 'agent_id'> & {
|
|
148
|
+
readonly agent_id: string | RegisteredAgentRef;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* `tasks.startWithGraph` input shape — inline-graph dispatch.
|
|
152
|
+
*
|
|
153
|
+
* Carries the declarative `graph` topology QAR's runtime will execute. The
|
|
154
|
+
* `input` field is the same typed `QodoTaskStartInput` shape as the by-id
|
|
155
|
+
* variant — `user_query`, `deps_overrides`, `metadata`. The `skill` field is
|
|
156
|
+
* preserved from the wire envelope so a graph can be dispatched as the body
|
|
157
|
+
* of a named QAR skill (Studio-generated workflows lean on this).
|
|
158
|
+
*/
|
|
159
|
+
export interface TaskStartGraphInput {
|
|
160
|
+
readonly graph: InlineGraphSpec;
|
|
161
|
+
readonly input?: QodoTaskStartInput;
|
|
162
|
+
readonly skill?: string | null;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* `tasks.startWithAgent` input shape — inline-AgentSpec dispatch.
|
|
166
|
+
*
|
|
167
|
+
* Carries the data-only safe subset (`apiVersion`, `instructions`,
|
|
168
|
+
* `model`, optional `tools` / `skills` / `spawnable_agents` / etc.). The
|
|
169
|
+
* `input` field mirrors the by-id variant — `user_query`, `deps_overrides`,
|
|
170
|
+
* `metadata`. The `skill` field passes through so a registered Qodo skill
|
|
171
|
+
* can dispatch with the consumer-defined agent as its body.
|
|
172
|
+
*/
|
|
173
|
+
export interface TaskStartAgentInput {
|
|
174
|
+
readonly agent: InlineAgentSpec;
|
|
175
|
+
readonly input?: QodoTaskStartInput;
|
|
176
|
+
readonly skill?: string | null;
|
|
177
|
+
}
|
|
178
|
+
/** Per-call options for `tasks.startWithAgent`. */
|
|
179
|
+
export interface StartWithAgentOptions extends TaskOptions {
|
|
180
|
+
/**
|
|
181
|
+
* Opt-in pre-flight: run `client.specs.validate(agent)` (HTTP) against
|
|
182
|
+
* QAR *before* opening the WebSocket task. Adds one round-trip but
|
|
183
|
+
* catches the rules the SDK can't enforce locally — catalog tool
|
|
184
|
+
* registration, skill version pinning, spawnable `agent_id` resolution
|
|
185
|
+
* against the live registry.
|
|
186
|
+
*
|
|
187
|
+
* Default `false` — the SDK's pre-wire `collectInlineAgentSpecPreWireIssues`
|
|
188
|
+
* covers the structural cases (forbidden `custom_code`, missing
|
|
189
|
+
* required fields, unknown top-level keys). Set `true` in CI /
|
|
190
|
+
* pre-deploy gates where the round-trip is affordable.
|
|
191
|
+
*/
|
|
192
|
+
readonly preflight?: boolean;
|
|
193
|
+
}
|
|
194
|
+
/** Per-call options for `tasks.startWithGraph`. */
|
|
195
|
+
export interface StartWithGraphOptions extends TaskOptions {
|
|
196
|
+
/**
|
|
197
|
+
* Opt-in pre-flight: run `client.specs.validate(graph)` (HTTP) against QAR
|
|
198
|
+
* *before* opening the WebSocket task. Adds one round-trip but catches
|
|
199
|
+
* rules the SDK can't enforce locally (model registry probes, AgentSpec
|
|
200
|
+
* composition against the live agent table).
|
|
201
|
+
*
|
|
202
|
+
* Default `false` — the SDK's local validator covers the most common
|
|
203
|
+
* mistakes. Set `true` in CI / pre-deploy gates where the round-trip is
|
|
204
|
+
* affordable.
|
|
205
|
+
*/
|
|
206
|
+
readonly preflight?: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* Override the graph-depth cap the SDK enforces client-side. Default
|
|
209
|
+
* `DEFAULT_INLINE_GRAPH_MAX_DEPTH` (4) — matches the operator default.
|
|
210
|
+
* Operators running a higher-limit deployment can raise this; the
|
|
211
|
+
* server-side validator still enforces its own cap on dispatch.
|
|
212
|
+
*/
|
|
213
|
+
readonly maxDepth?: number;
|
|
214
|
+
}
|
|
215
|
+
export declare class TaskClient {
|
|
216
|
+
private readonly resolveConnection;
|
|
217
|
+
private readonly spanRecorder;
|
|
218
|
+
private readonly registry;
|
|
219
|
+
private readonly resolveSpecs?;
|
|
220
|
+
/**
|
|
221
|
+
* Transport-metric store passed through to each constructed
|
|
222
|
+
* `TaskSubscription` so the connection's reconnect/replay path can
|
|
223
|
+
* increment `replay_envelopes_received_total` /
|
|
224
|
+
* `replay_anchor_missing_total` against absorbed envelopes. Optional
|
|
225
|
+
* for back-compat with consumers wiring `TaskClient` directly in
|
|
226
|
+
* tests; production wires from `QodoClient`.
|
|
227
|
+
*/
|
|
228
|
+
private readonly metrics?;
|
|
229
|
+
/**
|
|
230
|
+
* Skills foundation manager. When provided, the `startWithAgent` and
|
|
231
|
+
* `startWithGraph` paths await the manager's `discover()` (idempotent)
|
|
232
|
+
* and append the rendered slim index to the spec's `instructions`
|
|
233
|
+
* before the wire write. Undefined when the consumer didn't pass
|
|
234
|
+
* `ClientOptions.skills` — those paths stay verbatim.
|
|
235
|
+
*/
|
|
236
|
+
private readonly skills?;
|
|
237
|
+
/**
|
|
238
|
+
* `defineFunctionTool` auto-bind hook. Called at every
|
|
239
|
+
* `startWithAgent` / `startWithGraph` entry point so handlers
|
|
240
|
+
* attached to `FunctionToolDef` entries (via the helper's
|
|
241
|
+
* symbol-keyed handler bag) get installed on the `ToolClient`
|
|
242
|
+
* before the wire `task.start` lands. Optional — when undefined
|
|
243
|
+
* (e.g. `TaskClient` constructed in isolation in tests), the bind
|
|
244
|
+
* step is skipped and consumers fall back to manual
|
|
245
|
+
* `client.tools.onRequest(...)` registration.
|
|
246
|
+
*/
|
|
247
|
+
private readonly bindFunctionToolDefs?;
|
|
248
|
+
/**
|
|
249
|
+
* @param resolveConnection Returns the live `Connection` or throws if the
|
|
250
|
+
* client isn't connected yet.
|
|
251
|
+
* @param spanRecorder Recorder for `qar.client.task.*` spans. No-op
|
|
252
|
+
* when OTel isn't configured.
|
|
253
|
+
* @param registry Local agent + MCP registries. `tasks.start` reads
|
|
254
|
+
* this to resolve `RegisteredAgentRef` → wire
|
|
255
|
+
* `agent_id`.
|
|
256
|
+
* @param resolveSpecs Lazily-resolved `SpecsClient` used by the
|
|
257
|
+
* opt-in `preflight: true` path on
|
|
258
|
+
* `startWithGraph()`. Lazy because `QodoClient`
|
|
259
|
+
* constructs `tasks` before `specs`; defer
|
|
260
|
+
* dereference until the caller actually asks
|
|
261
|
+
* for pre-flight validation.
|
|
262
|
+
*/
|
|
263
|
+
constructor(resolveConnection: () => Connection, spanRecorder: SpanRecorder, registry: QarRegistryClient, resolveSpecs?: (() => SpecsClient) | undefined,
|
|
264
|
+
/**
|
|
265
|
+
* Transport-metric store passed through to each constructed
|
|
266
|
+
* `TaskSubscription` so the connection's reconnect/replay path can
|
|
267
|
+
* increment `replay_envelopes_received_total` /
|
|
268
|
+
* `replay_anchor_missing_total` against absorbed envelopes. Optional
|
|
269
|
+
* for back-compat with consumers wiring `TaskClient` directly in
|
|
270
|
+
* tests; production wires from `QodoClient`.
|
|
271
|
+
*/
|
|
272
|
+
metrics?: TransportMetrics | undefined,
|
|
273
|
+
/**
|
|
274
|
+
* Skills foundation manager. When provided, the `startWithAgent` and
|
|
275
|
+
* `startWithGraph` paths await the manager's `discover()` (idempotent)
|
|
276
|
+
* and append the rendered slim index to the spec's `instructions`
|
|
277
|
+
* before the wire write. Undefined when the consumer didn't pass
|
|
278
|
+
* `ClientOptions.skills` — those paths stay verbatim.
|
|
279
|
+
*/
|
|
280
|
+
skills?: SkillsManager | undefined,
|
|
281
|
+
/**
|
|
282
|
+
* `defineFunctionTool` auto-bind hook. Called at every
|
|
283
|
+
* `startWithAgent` / `startWithGraph` entry point so handlers
|
|
284
|
+
* attached to `FunctionToolDef` entries (via the helper's
|
|
285
|
+
* symbol-keyed handler bag) get installed on the `ToolClient`
|
|
286
|
+
* before the wire `task.start` lands. Optional — when undefined
|
|
287
|
+
* (e.g. `TaskClient` constructed in isolation in tests), the bind
|
|
288
|
+
* step is skipped and consumers fall back to manual
|
|
289
|
+
* `client.tools.onRequest(...)` registration.
|
|
290
|
+
*/
|
|
291
|
+
bindFunctionToolDefs?: ((tools: readonly FunctionToolDef[]) => void) | undefined);
|
|
292
|
+
/**
|
|
293
|
+
* Send `task.start` and yield the resulting `TaskEvent` stream until `task.done`.
|
|
294
|
+
*
|
|
295
|
+
* The iterator is the canonical streaming primitive — consumers `for await` and
|
|
296
|
+
* `switch (event.kind)` over the QAR discriminator. Breaking the iterator
|
|
297
|
+
* before `task.done` arrives sends a best-effort `task.cancel` so the runtime
|
|
298
|
+
* can free its resources promptly.
|
|
299
|
+
*
|
|
300
|
+
* `payload.agent_id` accepts either a wire-shape `string` or a
|
|
301
|
+
* `RegisteredAgentRef` from `client.qar.registerAgent`. Refs are resolved
|
|
302
|
+
* to `ref.name` for the outgoing envelope; the local agent body never
|
|
303
|
+
* crosses the wire.
|
|
304
|
+
*/
|
|
305
|
+
start(payload: TaskStartInput, opts?: TaskOptions): TaskStartIterable;
|
|
306
|
+
/**
|
|
307
|
+
* Send `task.start { agent, input }` and yield the resulting `TaskEvent`
|
|
308
|
+
* stream until `task.done` — inline-AgentSpec dispatch.
|
|
309
|
+
*
|
|
310
|
+
* The spec is validated client-side (the SDK-enforceable rule subset,
|
|
311
|
+
* see `collectInlineAgentSpecPreWireIssues`) BEFORE the envelope hits
|
|
312
|
+
* the wire. A `QodoInlineAgentValidationError` is thrown when any
|
|
313
|
+
* forbidden-key or missing-required-field rule fails — the error's
|
|
314
|
+
* `issues` array carries every violation with a `rule_id` +
|
|
315
|
+
* JSON-Pointer `path` so consumers can route both client-side and
|
|
316
|
+
* server-side rejections through the same branch logic.
|
|
317
|
+
*
|
|
318
|
+
* Opt into `{ preflight: true }` to additionally call
|
|
319
|
+
* `client.specs.validate(agent)` (HTTP) before opening the task — that
|
|
320
|
+
* catches the rules the SDK can't enforce locally (catalog tool
|
|
321
|
+
* registration, skill version pinning, spawnable `agent_id`
|
|
322
|
+
* resolution). Default `false`.
|
|
323
|
+
*
|
|
324
|
+
* Iterator + early-termination semantics match `start()` — breaking the
|
|
325
|
+
* iterator before `task.done` arrives sends best-effort `task.cancel`.
|
|
326
|
+
* Inline-agent spans carry `qar.agent.kind = "inline"` and
|
|
327
|
+
* `qar.agent_id = "inline:<message_id>"`.
|
|
328
|
+
*
|
|
329
|
+
* Server-side rejection: when QAR's `_handle_task_start` emits an
|
|
330
|
+
* `error { code: 'agent_spec_rejected' }` envelope, the iterator
|
|
331
|
+
* rejects with `QodoAgentSpecRejectedError` instead of yielding the
|
|
332
|
+
* envelope as a `kind: 'error'` event — consumers don't need to
|
|
333
|
+
* defensively narrow the error case out of `TaskEvent.kind`.
|
|
334
|
+
*/
|
|
335
|
+
startWithAgent(payload: TaskStartAgentInput, opts?: StartWithAgentOptions): TaskStartIterable;
|
|
336
|
+
/**
|
|
337
|
+
* Eagerly run `client.specs.validate(agent)` and, on success, dispatch
|
|
338
|
+
* the `task.start` envelope via `subscribeAndSend`. Returns a
|
|
339
|
+
* `Promise<TaskSubscription>` that resolves once the wire write has
|
|
340
|
+
* happened — kicked off in the public method body so the dispatch is
|
|
341
|
+
* in flight by the time the consumer can read `stream.taskId`.
|
|
342
|
+
*
|
|
343
|
+
* `preflight: true` still means "validate before the wire write" per
|
|
344
|
+
* the documented contract; we just no longer wait for iteration to
|
|
345
|
+
* start the validate.
|
|
346
|
+
*
|
|
347
|
+
* Server-side rule failures throw `QodoAgentSpecRejectedError` so
|
|
348
|
+
* consumers route SDK + server rejections through one branch.
|
|
349
|
+
*/
|
|
350
|
+
private runAgentPreflightAndDispatch;
|
|
351
|
+
/**
|
|
352
|
+
* Wrap the underlying subscription so a server-side `error { code: ... }`
|
|
353
|
+
* envelope arriving on the iterator surfaces as a rejected typed error
|
|
354
|
+
* instead of a yielded `kind: 'error'` event. Covers the documented
|
|
355
|
+
* typed-error catalog:
|
|
356
|
+
*
|
|
357
|
+
* - `agent_spec_rejected` → `QodoAgentSpecRejectedError`
|
|
358
|
+
* - the cancel / resume / HITL / graph code family → the matching
|
|
359
|
+
* `QodoServerError` subclass
|
|
360
|
+
*
|
|
361
|
+
* Other error envelopes (`replay_anchor_missing`,
|
|
362
|
+
* `envelope_parse_error`, future codes the SDK hasn't catalogued)
|
|
363
|
+
* pass through unchanged as `kind: 'error'` iterator events so
|
|
364
|
+
* existing consumer code reading them keeps working. Callers that
|
|
365
|
+
* want to convert an arbitrary error envelope into a typed throw
|
|
366
|
+
* can wrap it themselves with `QodoUnknownServerError` (exposed via
|
|
367
|
+
* the public surface) or `errorFromServerErrorEnvelope` (internal,
|
|
368
|
+
* stable across the typed catalog).
|
|
369
|
+
*
|
|
370
|
+
* Non-error envelopes pass through unchanged.
|
|
371
|
+
*
|
|
372
|
+
* **Why this isn't an `async function*`.** Native async generators don't
|
|
373
|
+
* propagate `.return()` to the inner iterator until the generator's
|
|
374
|
+
* body has entered (one `.next()` call has fired). The SDK's
|
|
375
|
+
* iterator-early-termination contract is that breaking the iterator
|
|
376
|
+
* BEFORE the first envelope arrives still fires a best-effort
|
|
377
|
+
* `task.cancel` — that relies on `.return()` reaching `sub.return()`.
|
|
378
|
+
* The explicit iterator object below forwards every protocol call
|
|
379
|
+
* straight to the underlying subscription's iterator so the
|
|
380
|
+
* cancel-on-break path stays intact.
|
|
381
|
+
*/
|
|
382
|
+
private static wrapServerErrorsIterator;
|
|
383
|
+
/**
|
|
384
|
+
* Send `task.start { graph, input }` and yield the resulting `TaskEvent`
|
|
385
|
+
* stream until `task.done` — inline-graph-spec dispatch.
|
|
386
|
+
*
|
|
387
|
+
* The graph is validated client-side (the SDK-enforceable rule subset,
|
|
388
|
+
* see `validateInlineGraphSpec`) BEFORE the envelope hits the wire. A
|
|
389
|
+
* `QodoInlineGraphValidationError` is thrown when any rule fails — the
|
|
390
|
+
* error's `failures` array carries every violation with a `rule_id` +
|
|
391
|
+
* JSON-Pointer `path` so consumers can route both client-side and
|
|
392
|
+
* server-side rejections through the same branch logic.
|
|
393
|
+
*
|
|
394
|
+
* Opt into `{ preflight: true }` to additionally call
|
|
395
|
+
* `client.specs.validate(graph)` (HTTP) before opening the task — that
|
|
396
|
+
* catches the rules the SDK can't enforce locally (model registry probes,
|
|
397
|
+
* AgentSpec composition against the live agent table). Default `false`.
|
|
398
|
+
*
|
|
399
|
+
* Iterator + early-termination semantics match `start()` — breaking the
|
|
400
|
+
* iterator before `task.done` arrives sends best-effort `task.cancel`.
|
|
401
|
+
* Inline-graph spans carry `qar.graph.entry`, `qar.graph.depth`, and
|
|
402
|
+
* `qar.agent.kind = "inline"` attrs in addition to the standard
|
|
403
|
+
* `qar.client.task.start` set.
|
|
404
|
+
*/
|
|
405
|
+
startWithGraph(payload: TaskStartGraphInput, opts?: StartWithGraphOptions): TaskStartIterable;
|
|
406
|
+
/**
|
|
407
|
+
* Eagerly run `client.specs.validate(graph)` and, on success, dispatch
|
|
408
|
+
* the `task.start` envelope via `subscribeAndSend`. Returns a
|
|
409
|
+
* `Promise<TaskSubscription>` that resolves once the wire write has
|
|
410
|
+
* happened. Validation rejection surfaces as
|
|
411
|
+
* `QodoInlineGraphValidationError` so consumers don't need a second
|
|
412
|
+
* `instanceof` branch for `SpecValidateResult` failures.
|
|
413
|
+
*/
|
|
414
|
+
private runGraphPreflightAndDispatch;
|
|
415
|
+
/**
|
|
416
|
+
* Compute the longest-path depth (edge count) from `entry` for the
|
|
417
|
+
* `qar.graph.depth` span attr. Returns 0 when the graph has no edges
|
|
418
|
+
* (single-node graphs).
|
|
419
|
+
*
|
|
420
|
+
* Delegates to the validator's shared `longestPathFrom` so the two call
|
|
421
|
+
* sites can't drift on cycle handling.
|
|
422
|
+
*/
|
|
423
|
+
private static computeGraphDepth;
|
|
424
|
+
/**
|
|
425
|
+
* Return the documented `qar.agent.kind` value for a graph: `"inline"`
|
|
426
|
+
* when any node carries an inline `AgentSpec` (or a nested `GraphSpec`),
|
|
427
|
+
* `"agent_id"` when every node is a server-static reference. The
|
|
428
|
+
* `qar.agent.kind` attribute is documented with the closed value set
|
|
429
|
+
* `"inline" | "agent_id"` — keep this in sync with
|
|
430
|
+
* `src/observability/attributes.ts`.
|
|
431
|
+
*/
|
|
432
|
+
private static computeAgentKind;
|
|
433
|
+
/**
|
|
434
|
+
* Send `task.continue` for an existing `task_id` and yield the resulting `TaskEvent`
|
|
435
|
+
* stream until `task.done`. Same iterator semantics as `start`.
|
|
436
|
+
*
|
|
437
|
+
* Payload shape mirrors QAR's `TaskContinuePayload` minus `task_id` — the id is
|
|
438
|
+
* already supplied as the first argument. `task.continue` carries no
|
|
439
|
+
* `agent_id`/`skill` because those are bound at `task.start` time.
|
|
440
|
+
*/
|
|
441
|
+
continue(taskId: TaskId, payload: Omit<TaskContinuePayload, 'task_id'>, opts?: TaskOptions): AsyncIterable<TaskEvent>;
|
|
442
|
+
/**
|
|
443
|
+
* Cold-start helper. Unifies `task.start` and `task.continue` behind
|
|
444
|
+
* a single call so consumers with deterministic `idempotencyKey`
|
|
445
|
+
* derivation (Slack bots, CLI tools, IDE plugins, web apps without
|
|
446
|
+
* server affinity) don't have to track in-memory
|
|
447
|
+
* `(idempotencyKey → taskId)` mappings across process restarts.
|
|
448
|
+
*
|
|
449
|
+
* Behavior, gated on QAR's `task.started` admission response:
|
|
450
|
+
*
|
|
451
|
+
* - **No session yet** (`isNew === true`, no `previousTaskId`) —
|
|
452
|
+
* fresh dispatch. The returned handle iterates the newly-started
|
|
453
|
+
* task's event stream.
|
|
454
|
+
* - **Existing session, `state === 'auto-paused'`** (`isNew === false`) —
|
|
455
|
+
* QAR returned the existing `task_id`. The helper auto-emits a
|
|
456
|
+
* `tasks.continue(taskId, { input })` to deliver the caller's
|
|
457
|
+
* input; the returned handle iterates the continue subscription's
|
|
458
|
+
* events.
|
|
459
|
+
* - **Existing session, `state === 'running'`** (`isNew === false`) —
|
|
460
|
+
* QAR returned the existing `task_id`. Same auto-continue path;
|
|
461
|
+
* QAR queues the input until the next auto-pause boundary.
|
|
462
|
+
* - **Terminal re-dispatch** (`isNew === true` + `previousTaskId` +
|
|
463
|
+
* `previousState`) — QAR created a NEW task on the same
|
|
464
|
+
* `session_id`, inheriting the full `session_messages` history
|
|
465
|
+
* (B-raw). The handle iterates the new task's stream; consumer
|
|
466
|
+
* can read `previousTaskId` + `previousState` to surface
|
|
467
|
+
* "this is a new task after a prior failure" UX.
|
|
468
|
+
*
|
|
469
|
+
* `graphSpec` is required for the fresh-dispatch branch. On
|
|
470
|
+
* already-dispatched sessions QAR ignores it (the existing task's
|
|
471
|
+
* spec is the source of truth). The helper throws
|
|
472
|
+
* {@link RequiredGraphSpecError} synchronously if `graphSpec` is
|
|
473
|
+
* `undefined` — consumers who don't have a graphSpec on hand should
|
|
474
|
+
* call {@link continue} or {@link forceResume} directly.
|
|
475
|
+
*
|
|
476
|
+
* Paired with QAR-side idempotent admission. Older QAR builds without
|
|
477
|
+
* idempotent admission either reject `session_already_dispatched` (the
|
|
478
|
+
* case this helper fixes) or — for fresh sessions — behave identically
|
|
479
|
+
* (the helper defaults `isNew` to `true` when the field is absent in
|
|
480
|
+
* the ack).
|
|
481
|
+
*/
|
|
482
|
+
continueOrStart(idempotencyKey: string, graphSpec: InlineGraphSpec | undefined, options?: {
|
|
483
|
+
readonly input?: QodoTaskStartInput;
|
|
484
|
+
}): Promise<TaskHandle>;
|
|
485
|
+
/**
|
|
486
|
+
* Explicit stuck-session recovery. Sends `task.forceResume` and
|
|
487
|
+
* awaits the matching `task.force_resumed` ack.
|
|
488
|
+
*
|
|
489
|
+
* Use case: a prior consumer process died mid-tool-call or mid-HITL;
|
|
490
|
+
* the session is stuck `running` with outstanding `tool_call_id` /
|
|
491
|
+
* `hitl_id` that will never resolve. `forceResume` triggers QAR to:
|
|
492
|
+
*
|
|
493
|
+
* 1. Cancel the in-flight tool call (mirrors the system-cancel
|
|
494
|
+
* primitives used by `task.cancel` and the A2A bridge).
|
|
495
|
+
* 2. Synth-resolve pending HITLs.
|
|
496
|
+
* 3. Append a `{role: 'system', content: 'process restart — outstanding
|
|
497
|
+
* tool call cancelled'}` marker to `session_messages` (audit trail).
|
|
498
|
+
* 4. Transition the session to `'auto-paused'`.
|
|
499
|
+
*
|
|
500
|
+
* If the session is already `auto-paused` or terminal, QAR
|
|
501
|
+
* passthroughs and reports the actual state.
|
|
502
|
+
*
|
|
503
|
+
* Returns `{taskId, state}` — the consumer can then call
|
|
504
|
+
* `tasks.continue(taskId, { input })` with their next turn's input.
|
|
505
|
+
*/
|
|
506
|
+
forceResume(idempotencyKey: string): Promise<ForceResumeResult>;
|
|
507
|
+
/**
|
|
508
|
+
* Send `task.cancel` and await the matching `task.done { status: "canceled" }`.
|
|
509
|
+
*
|
|
510
|
+
* The returned promise resolves once the server confirms the cancel via
|
|
511
|
+
* `task.done`. If the server reports failure (`task.done { status: "failed" }`)
|
|
512
|
+
* during cancellation, `status: 'failed'` surfaces here so callers can
|
|
513
|
+
* distinguish — they didn't ask for it, but it's still a terminal state.
|
|
514
|
+
*
|
|
515
|
+
* Cross-process recovery: pass `opts.sessionId` to cancel a task whose
|
|
516
|
+
* `task_id` was hydrated from durable storage (i.e. the SDK never
|
|
517
|
+
* observed the originating `task.started` in this process). Without the
|
|
518
|
+
* override the SDK throws {@link QodoColdAddressError} before the wire
|
|
519
|
+
* write.
|
|
520
|
+
*
|
|
521
|
+
* `opts.signal` semantic: **"signal aborts wait-for-task.done"**. If the
|
|
522
|
+
* signal fires before `task.done` arrives, `cancel` throws
|
|
523
|
+
* {@link QodoCancelAbortedError} with the task_id and the abort reason.
|
|
524
|
+
* The wire `task.cancel` was already sent; the underlying task's
|
|
525
|
+
* terminal ack still routes through its `tasks.start` /
|
|
526
|
+
* `tasks.continue` subscription. The signal does NOT cause a second
|
|
527
|
+
* `task.cancel` (that would be redundant — the consumer's intent is
|
|
528
|
+
* "stop waiting", not "cancel twice"). Pre-aborted signals throw
|
|
529
|
+
* synchronously before any wire write.
|
|
530
|
+
*/
|
|
531
|
+
cancel(taskId: TaskId, payload?: Omit<TaskCancelPayload, 'task_id'>, opts?: TaskCancelOptions): Promise<TaskCancelResult>;
|
|
532
|
+
/**
|
|
533
|
+
* Send `task.resubscribe { task_id, since_message_id? }` and yield replayed
|
|
534
|
+
* `TaskEvent`s from the server-held ring buffer (per-session cap of 1000
|
|
535
|
+
* envelopes). No client outbox — durability is server-side.
|
|
536
|
+
*
|
|
537
|
+
* Use this when you have a `task_id` from a prior connection (e.g. across a
|
|
538
|
+
* process restart) and want to catch up from a known anchor. For automatic
|
|
539
|
+
* reconnect-on-drop within a single `connect()` lifetime, the SDK does this
|
|
540
|
+
* for you transparently — see `qar.client.reconnect*` events on the
|
|
541
|
+
* canonical iterator.
|
|
542
|
+
*
|
|
543
|
+
* If the server's ring buffer has rotated past `sinceMessageId` (very long
|
|
544
|
+
* disconnects, or a missing/wrong anchor), the server emits an `error`
|
|
545
|
+
* envelope with a `replay_anchor_missing`-style code; that event surfaces
|
|
546
|
+
* as the iterator's final value and ends the stream. The consumer can
|
|
547
|
+
* decide to start the task fresh or surrender.
|
|
548
|
+
*/
|
|
549
|
+
resubscribe(taskId: TaskId, opts?: ResubscribeOptions): AsyncIterable<TaskEvent>;
|
|
550
|
+
/**
|
|
551
|
+
* Pre-allocate a `MessageId`, register a `TaskSubscription` against it, then
|
|
552
|
+
* send the outbound envelope using the same id. Subscribing before sending
|
|
553
|
+
* eliminates the race where the server's first reply could land before the
|
|
554
|
+
* subscription is in place.
|
|
555
|
+
*
|
|
556
|
+
* Pre-aborted signals short-circuit BEFORE the send so we never start
|
|
557
|
+
* server-side work the consumer has already given up on.
|
|
558
|
+
*
|
|
559
|
+
* `preallocatedRootMessageId` lets the caller mint the root id at the
|
|
560
|
+
* public-API boundary so it can derive `task_id` synchronously for
|
|
561
|
+
* `task.start` envelopes (the wire protocol codifies
|
|
562
|
+
* `task_id == task.start.message_id`). When omitted, we allocate fresh —
|
|
563
|
+
* the `task.continue` / `task.cancel` / `task.resubscribe` call sites
|
|
564
|
+
* already carry the task_id as an explicit arg.
|
|
565
|
+
*/
|
|
566
|
+
private subscribeAndSend;
|
|
567
|
+
/**
|
|
568
|
+
* Retry wrapper for `admission_in_progress` errors.
|
|
569
|
+
*
|
|
570
|
+
* When a deterministic-key admission collides with an in-flight admission
|
|
571
|
+
* on the same `(tenant_id, idempotency_key)`, QAR emits
|
|
572
|
+
* `error { code: 'admission_in_progress', retry_after_ms? }` instead of
|
|
573
|
+
* starting work. The SDK MUST retry with the same payload (server
|
|
574
|
+
* derives the same `session_id`) after the hinted delay — or, if absent,
|
|
575
|
+
* after exponential backoff with jitter — capped at
|
|
576
|
+
* `PENDING_ADMISSION_TIMEOUT` (5 min). The wrapper only fires on the
|
|
577
|
+
* deterministic-key path; the DX-default omitted-key path never sees
|
|
578
|
+
* `admission_in_progress` (each call mints a fresh `uuidv7` server-side
|
|
579
|
+
* — no collisions possible).
|
|
580
|
+
*
|
|
581
|
+
* Returns an `AsyncIterable<TaskEvent>` that wraps the underlying
|
|
582
|
+
* subscription. The wrapper:
|
|
583
|
+
*
|
|
584
|
+
* 1. Calls `buildAttempt(rootMessageId)` to register a fresh
|
|
585
|
+
* `TaskSubscription` and emit the wire `task.start`.
|
|
586
|
+
* 2. Reads the first event.
|
|
587
|
+
* 3. If `error { code: 'admission_in_progress' }`: capture the
|
|
588
|
+
* scoped `session_id` and `retry_after_ms` hint, sleep, retry
|
|
589
|
+
* with a fresh `rootMessageId`. Lifecycle bookkeeping
|
|
590
|
+
* (subscription close, span end) flows through the underlying
|
|
591
|
+
* subscription's terminal handling on the error envelope.
|
|
592
|
+
* 4. If `admission_stalled` typed throw arrives via the
|
|
593
|
+
* wrap-server-errors layer: propagate (terminal, non-retryable).
|
|
594
|
+
* 5. Otherwise: yield the first event and pass through every
|
|
595
|
+
* subsequent event.
|
|
596
|
+
*
|
|
597
|
+
* After {@link PENDING_ADMISSION_TIMEOUT_MS} elapsed wall-clock time
|
|
598
|
+
* the wrapper throws {@link QodoAdmissionTimeoutError} carrying the
|
|
599
|
+
* scoped `session_id` so the caller can `task.resubscribe` if a
|
|
600
|
+
* recovery path exists.
|
|
601
|
+
*/
|
|
602
|
+
private static wrapWithAdmissionRetry;
|
|
603
|
+
/**
|
|
604
|
+
* Wire an `AbortSignal` to the subscription. On abort, send `task.cancel`
|
|
605
|
+
* (if we know the task id) and end the iterator. Returns a cleanup
|
|
606
|
+
* function the subscription's `onClose` invokes so the listener doesn't
|
|
607
|
+
* outlive the task (matters when a single AbortController is reused
|
|
608
|
+
* across many short-lived tasks).
|
|
609
|
+
*/
|
|
610
|
+
private bindAbort;
|
|
611
|
+
/**
|
|
612
|
+
* Inject the rendered active-skills block + slim index into an
|
|
613
|
+
* `InlineAgentSpec` synchronously. Validates caller-pinned skills
|
|
614
|
+
* against the cached snapshot first; unresolved names throw
|
|
615
|
+
* `SkillNotFoundError`. Returns the original spec when the catalog
|
|
616
|
+
* is empty or when no `SkillsManager` is configured.
|
|
617
|
+
*
|
|
618
|
+
* When the caller pinned any skills, the SDK resolves the `requires:`
|
|
619
|
+
* chain (with the depth/breadth/token caps applied), renders the
|
|
620
|
+
* bodies into an `<active_skills>` block, and prepends that block to
|
|
621
|
+
* the spec's `instructions` *before* the slim-index block. Trust
|
|
622
|
+
* violations, cap breaches, cycles, or unresolved deps all throw
|
|
623
|
+
* `QodoSkillError` so no partial body lands on the wire.
|
|
624
|
+
*/
|
|
625
|
+
private applyAgentSkillsInjection;
|
|
626
|
+
/**
|
|
627
|
+
* Inject the active-skills block + slim index into every inline-agent
|
|
628
|
+
* node of an `InlineGraphSpec`. Mirrors `applyAgentSkillsInjection`
|
|
629
|
+
* for the graph case.
|
|
630
|
+
*/
|
|
631
|
+
private applyGraphSkillsInjection;
|
|
632
|
+
/**
|
|
633
|
+
* MCP projection at the wire boundary. When the consumer set
|
|
634
|
+
* `mcpTools` (or `mcpToolOverrides`), this:
|
|
635
|
+
*
|
|
636
|
+
* 1. Awaits the MCP pool's catalog-settle window so cold-start
|
|
637
|
+
* `tools/list` round-trips can complete before projection.
|
|
638
|
+
* 2. Runs `projectMcpTools` against the live pool snapshot.
|
|
639
|
+
* 3. Partitions the diagnostics:
|
|
640
|
+
* - `unknownMcps` and `unknownMcpTools` always reject (consumer
|
|
641
|
+
* code drift; pre-deploy-detectable).
|
|
642
|
+
* - `unreachableMcps` is policed per-MCP via the registry's
|
|
643
|
+
* `unavailability` setting. `'fail'` raises
|
|
644
|
+
* `QodoMcpUnavailableError`; `'warn'` omits the MCP's tools
|
|
645
|
+
* and emits a console warning.
|
|
646
|
+
* 4. Returns a fresh `InlineAgentSpec` with `tools[]` replaced by
|
|
647
|
+
* the projected surface and `mcpTools` / `mcpToolOverrides`
|
|
648
|
+
* stripped (SDK-only fields — QAR rejects them at the wire
|
|
649
|
+
* validator via `D10-R5` if they slipped through).
|
|
650
|
+
*
|
|
651
|
+
* When the spec carries neither `mcpTools` nor `mcpToolOverrides`, the
|
|
652
|
+
* helper returns the input verbatim — projection is opt-in, the v1
|
|
653
|
+
* `tools: FunctionToolDef[]` ergonomic continues to work.
|
|
654
|
+
*/
|
|
655
|
+
private projectMcpToolsForWire;
|
|
656
|
+
/**
|
|
657
|
+
* MCP projection over an `InlineGraphSpec`. Walks every node whose
|
|
658
|
+
* `spec` is an inline `InlineAgentSpec` and applies
|
|
659
|
+
* {@link projectMcpToolsForWire} to it; static refs and nested
|
|
660
|
+
* subgraphs are recursed into. Returns a fresh `InlineGraphSpec` with
|
|
661
|
+
* the same shape but every per-node `tools[]` replaced by the
|
|
662
|
+
* projected surface. Diagnostic errors propagate from the first
|
|
663
|
+
* node that fails — earlier nodes have already projected
|
|
664
|
+
* successfully, but the wire write hasn't started so the early
|
|
665
|
+
* partial work is invisible.
|
|
666
|
+
*/
|
|
667
|
+
private projectMcpToolsForGraphWire;
|
|
668
|
+
/**
|
|
669
|
+
* Resolve the caller-pinned roots into a rendered active-skills block
|
|
670
|
+
* + telemetry events. Pure — relies on the already-loaded snapshot
|
|
671
|
+
* (callers await `manager.discover()` before getting here). Returns
|
|
672
|
+
* an empty result when no pins are effective.
|
|
673
|
+
*/
|
|
674
|
+
private composeActiveSkills;
|
|
675
|
+
/**
|
|
676
|
+
* Surface a caller-pin overflow as a loud failure. The renderer drops
|
|
677
|
+
* pinned skills that would push the block past its hard cap
|
|
678
|
+
* (`2 × charBudget`, floored at `charBudget + 4096`). Silently
|
|
679
|
+
* truncating the wire payload would make the model behave as if the
|
|
680
|
+
* caller never pinned those skills — throw instead so the caller
|
|
681
|
+
* fixes the pin list or raises the budget.
|
|
682
|
+
*/
|
|
683
|
+
private throwIfPinsOmitted;
|
|
684
|
+
/**
|
|
685
|
+
* Resolve per-call pinned skills against the constructor-level
|
|
686
|
+
* `SkillsConfig.activate` default:
|
|
687
|
+
*
|
|
688
|
+
* - `opts.skills === undefined` → fall back to the constructor's
|
|
689
|
+
* `activate` (or `undefined` if none).
|
|
690
|
+
* - `opts.skills === []` → explicit empty, no fallback.
|
|
691
|
+
* - `opts.skills === [...]` → per-call wins outright.
|
|
692
|
+
*/
|
|
693
|
+
private resolveEffectivePinned;
|
|
694
|
+
private buildRenderOptions;
|
|
695
|
+
/**
|
|
696
|
+
* Validate caller-pinned specifiers against the manager's already-loaded
|
|
697
|
+
* snapshot. Throws `SkillNotFoundError` on a miss and
|
|
698
|
+
* `SkillAmbiguousPinError` on a bare-name pin that matches multiple
|
|
699
|
+
* vendors. Assumes the snapshot is present (the public entry-points
|
|
700
|
+
* await `discover()` before calling this helper).
|
|
701
|
+
*/
|
|
702
|
+
private validatePinnedSync;
|
|
703
|
+
/** Forward renderer telemetry events to the manager's configured sink. */
|
|
704
|
+
private dispatchSkillsEvents;
|
|
705
|
+
}
|
|
706
|
+
//# sourceMappingURL=TaskClient.d.ts.map
|