@songtonyli/dsh-cli 0.1.67 → 0.1.69
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/README.md +1 -1
- package/bin/dsh.mjs +1 -1
- package/node_modules/@anthropic-ai/sdk/CHANGELOG.md +182 -0
- package/node_modules/@anthropic-ai/sdk/README.md +1 -1
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js +66 -53
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs +66 -53
- package/node_modules/@anthropic-ai/sdk/client.js +871 -856
- package/node_modules/@anthropic-ai/sdk/client.mjs +872 -851
- package/node_modules/@anthropic-ai/sdk/core/api-promise.js +71 -69
- package/node_modules/@anthropic-ai/sdk/core/api-promise.mjs +71 -65
- package/node_modules/@anthropic-ai/sdk/core/error.js +5 -3
- package/node_modules/@anthropic-ai/sdk/core/error.mjs +5 -3
- package/node_modules/@anthropic-ai/sdk/core/pagination.js +56 -51
- package/node_modules/@anthropic-ai/sdk/core/pagination.mjs +56 -42
- package/node_modules/@anthropic-ai/sdk/core/resource.js +0 -1
- package/node_modules/@anthropic-ai/sdk/core/resource.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/core/streaming.js +214 -240
- package/node_modules/@anthropic-ai/sdk/core/streaming.mjs +215 -241
- package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.js +14 -19
- package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.mjs +14 -13
- package/node_modules/@anthropic-ai/sdk/index.js +7 -7
- package/node_modules/@anthropic-ai/sdk/index.mjs +3 -3
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.js +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/constants.js +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.js +27 -24
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs +27 -24
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.js +52 -49
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs +52 -43
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.js +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/errors.js +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/errors.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/file-store.js +256 -258
- package/node_modules/@anthropic-ai/sdk/internal/file-store.mjs +256 -243
- package/node_modules/@anthropic-ai/sdk/internal/headers.js +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/headers.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/node.browser.mjs +7 -7
- package/node_modules/@anthropic-ai/sdk/internal/parse.js +2 -3
- package/node_modules/@anthropic-ai/sdk/internal/parse.mjs +3 -4
- package/node_modules/@anthropic-ai/sdk/internal/request-options.js +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/request-options.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/shim-types.js +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/shim-types.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/shims.js +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/shims.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.js +12 -7
- package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.mjs +6 -1
- package/node_modules/@anthropic-ai/sdk/internal/to-file.js +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/to-file.mjs +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/types.js +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/types.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/uploads.js +5 -2
- package/node_modules/@anthropic-ai/sdk/internal/uploads.mjs +5 -2
- package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.js +66 -63
- package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.mjs +66 -56
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.js +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.js +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.js +12 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.mjs +11 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/query.js +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/query.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.js +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.js +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils.js +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js +596 -590
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs +596 -590
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.js +544 -541
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs +544 -541
- package/node_modules/@anthropic-ai/sdk/lib/environments/poller.js +180 -174
- package/node_modules/@anthropic-ai/sdk/lib/environments/poller.mjs +180 -153
- package/node_modules/@anthropic-ai/sdk/lib/environments/worker.js +375 -359
- package/node_modules/@anthropic-ai/sdk/lib/environments/worker.mjs +374 -319
- package/node_modules/@anthropic-ai/sdk/lib/internal/BetaToolRunnerStream.js +137 -0
- package/node_modules/@anthropic-ai/sdk/lib/internal/BetaToolRunnerStream.mjs +137 -0
- package/node_modules/@anthropic-ai/sdk/lib/internal/stub.js +6 -0
- package/node_modules/@anthropic-ai/sdk/lib/internal/stub.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/lib/internal/types.js +3 -0
- package/node_modules/@anthropic-ai/sdk/lib/internal/types.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/lib/middleware.js +20 -2
- package/node_modules/@anthropic-ai/sdk/lib/middleware.mjs +20 -2
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.js +628 -361
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs +629 -355
- package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.js +600 -594
- package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.mjs +599 -550
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolError.js +39 -36
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolError.mjs +39 -13
- package/node_modules/@anthropic-ai/sdk/lib/transform-json-schema.js +7 -5
- package/node_modules/@anthropic-ai/sdk/lib/transform-json-schema.mjs +7 -5
- package/node_modules/@anthropic-ai/sdk/package.json +3 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.js +135 -133
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.mjs +135 -133
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.js +39 -37
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs +39 -37
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.js +45 -6
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.mjs +45 -6
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.js +157 -155
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.mjs +157 -155
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.js +255 -253
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.mjs +255 -253
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.js +8 -8
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs +1 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.js +150 -148
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.mjs +150 -148
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.js +4 -4
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.mjs +2 -3
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.js +132 -112
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs +131 -111
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.js +11 -9
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.mjs +11 -9
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.js +187 -185
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.mjs +187 -185
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.js +38 -36
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.mjs +38 -36
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.js +163 -161
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.mjs +163 -161
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.js +6 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.mjs +6 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.js +97 -95
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.mjs +97 -95
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.js +118 -116
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.mjs +118 -116
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.js +161 -159
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.mjs +161 -159
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.js +86 -84
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.mjs +86 -84
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.js +104 -102
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs +104 -102
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.js +188 -186
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.mjs +188 -186
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.js +25 -11
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.mjs +25 -11
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.js +156 -154
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.mjs +156 -154
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/completions.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/completions.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/files.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/files.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/index.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/index.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.js +115 -113
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs +115 -113
- package/node_modules/@anthropic-ai/sdk/resources/messages.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/models.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/models.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/shared.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/shared.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/skills/index.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/skills/index.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/skills/skills.js +88 -86
- package/node_modules/@anthropic-ai/sdk/resources/skills/skills.mjs +88 -86
- package/node_modules/@anthropic-ai/sdk/resources/skills/versions.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/skills/versions.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/skills.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/skills.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/top-level.js +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/top-level.mjs +0 -1
- package/node_modules/@anthropic-ai/sdk/src/_vendor/partial-json-parser/parser.ts +71 -56
- package/node_modules/@anthropic-ai/sdk/src/client.ts +138 -98
- package/node_modules/@anthropic-ai/sdk/src/core/api-promise.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/core/error.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/core/pagination.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/core/resource.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/core/streaming.ts +3 -39
- package/node_modules/@anthropic-ai/sdk/src/index.ts +10 -17
- package/node_modules/@anthropic-ai/sdk/src/internal/builtin-types.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/internal/detect-platform.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/internal/errors.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/internal/headers.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/internal/node.browser.ts +7 -7
- package/node_modules/@anthropic-ai/sdk/src/internal/parse.ts +8 -13
- package/node_modules/@anthropic-ai/sdk/src/internal/request-options.ts +1 -3
- package/node_modules/@anthropic-ai/sdk/src/internal/shim-types.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/internal/shims.ts +4 -5
- package/node_modules/@anthropic-ai/sdk/src/internal/stainless-helper-header.ts +7 -1
- package/node_modules/@anthropic-ai/sdk/src/internal/to-file.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/src/internal/types.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/internal/uploads.ts +5 -2
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/base64.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/bytes.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/env.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/log.ts +16 -4
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/query.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/uuid.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/values.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/internal/utils.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/lib/.keep +0 -2
- package/node_modules/@anthropic-ai/sdk/src/lib/BetaMessageStream.ts +9 -6
- package/node_modules/@anthropic-ai/sdk/src/lib/beta-parser.ts +1 -3
- package/node_modules/@anthropic-ai/sdk/src/lib/environments/worker.ts +29 -15
- package/node_modules/@anthropic-ai/sdk/src/lib/internal/BetaToolRunnerStream.ts +170 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/internal/stub.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/internal/types.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/middleware.ts +20 -2
- package/node_modules/@anthropic-ai/sdk/src/lib/parser.ts +1 -3
- package/node_modules/@anthropic-ai/sdk/src/lib/tools/BetaRunnableTool.ts +2 -1
- package/node_modules/@anthropic-ai/sdk/src/lib/tools/BetaToolRunner.ts +579 -240
- package/node_modules/@anthropic-ai/sdk/src/lib/transform-json-schema.ts +8 -6
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/agents/agents.ts +147 -53
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/agents/index.ts +1 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/agents/versions.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/agents.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/beta.ts +67 -3
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/deployment-runs.ts +13 -8
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/deployments.ts +43 -27
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/dreams.ts +279 -89
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/environments/environments.ts +5 -12
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/environments/index.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/environments/work.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/environments.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/files.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/index.ts +191 -161
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/index.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memories.ts +82 -23
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memory-stores.ts +6 -5
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memory-versions.ts +60 -43
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/batches.ts +27 -12
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/index.ts +47 -21
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/messages.ts +741 -176
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/models.ts +30 -7
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/api-keys.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/compliance-settings.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/external-keys.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/federation.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/index.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/issuers.ts +4 -7
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/rules/index.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/rules/rules.ts +4 -8
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/rules/workspaces.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/rules.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/index.ts +6 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/invites.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/organization.ts +12 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/rate-limits.ts +112 -6
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/service-accounts/index.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/service-accounts/service-accounts.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/service-accounts/workspaces.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/service-accounts.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/users.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/index.ts +2 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/members.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/rate-limits.ts +58 -14
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/service-accounts.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/workspaces.ts +7 -5
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/events.ts +234 -82
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/index.ts +10 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/resources.ts +5 -9
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/sessions.ts +85 -46
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads/events.ts +2 -4
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads/index.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads/threads.ts +21 -15
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/index.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/skills.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/versions.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/tunnels/certificates.ts +7 -7
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/tunnels/index.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/tunnels/tunnels.ts +3 -4
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/tunnels.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/user-profiles.ts +300 -38
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/vaults/credentials.ts +37 -35
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/vaults/index.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/vaults/vaults.ts +1 -3
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/vaults.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/webhooks.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/completions.ts +3 -4
- package/node_modules/@anthropic-ai/sdk/src/resources/files.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/index.ts +17 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/batches.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/index.ts +17 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/messages.ts +289 -93
- package/node_modules/@anthropic-ai/sdk/src/resources/messages.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/models.ts +12 -9
- package/node_modules/@anthropic-ai/sdk/src/resources/shared.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/skills/index.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/skills/skills.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/skills/versions.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/skills.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/node.ts +3 -2
- package/node_modules/@anthropic-ai/sdk/src/tsconfig.json +13 -3
- package/node_modules/@anthropic-ai/sdk/src/version.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.js +0 -6
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.mjs +0 -6
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.js +694 -691
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.mjs +691 -631
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.js +12 -12
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.js +207 -200
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.mjs +197 -186
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.js +5 -5
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.js +3 -3
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.js +2 -2
- package/node_modules/@anthropic-ai/sdk/version.js +1 -1
- package/node_modules/@anthropic-ai/sdk/version.mjs +1 -1
- package/node_modules/@deepseek-ai/cordis-plugin-loader/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh/lib/bin.js +1 -1
- package/node_modules/@deepseek-ai/dsh/package.json +121 -117
- package/node_modules/@deepseek-ai/dsh-acp/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-acp/README.md +5 -1
- package/node_modules/@deepseek-ai/dsh-acp/README.zh.md +5 -1
- package/node_modules/@deepseek-ai/dsh-acp/lib/index.js +59 -17
- package/node_modules/@deepseek-ai/dsh-acp/package.json +23 -22
- package/node_modules/@deepseek-ai/dsh-acp-app/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-acp-app/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-acp-app/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-acp-app/cordis.patch.yml +0 -1
- package/node_modules/@deepseek-ai/dsh-acp-app/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-agent/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-agent-default-model/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-agent-instructions/README.i18n.yaml +12 -12
- package/node_modules/@deepseek-ai/dsh-agent-instructions/README.md +15 -7
- package/node_modules/@deepseek-ai/dsh-agent-instructions/README.zh.md +15 -7
- package/node_modules/@deepseek-ai/dsh-agent-instructions/lib/index.js +226 -91
- package/node_modules/@deepseek-ai/dsh-agent-instructions/package.json +24 -22
- package/node_modules/@deepseek-ai/dsh-agent-loop/README.i18n.yaml +10 -10
- package/node_modules/@deepseek-ai/dsh-agent-loop/README.md +6 -3
- package/node_modules/@deepseek-ai/dsh-agent-loop/README.zh.md +6 -3
- package/node_modules/@deepseek-ai/dsh-agent-loop/lib/index.js +67 -25
- package/node_modules/@deepseek-ai/dsh-agent-loop/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-agent-preset/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-composition-reference/references/packages.md +17 -21
- package/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-plugin-development/references/practices.md +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/typert.host.js +9 -5
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/package.json +27 -27
- package/node_modules/@deepseek-ai/dsh-agent-tool-presentation/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-agent-tool-presentation/README.md +4 -4
- package/node_modules/@deepseek-ai/dsh-agent-tool-presentation/README.zh.md +4 -4
- package/node_modules/@deepseek-ai/dsh-agent-tool-presentation/lib/index.js +1 -5
- package/node_modules/@deepseek-ai/dsh-agent-tool-presentation/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-anonymous-user-id/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-api-account-controller/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-api-authorization-controller/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-api-gateway/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-api-job-controller/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +477 -237
- package/node_modules/@deepseek-ai/dsh-api-remotes/package.json +41 -41
- package/node_modules/@deepseek-ai/dsh-api-session-controller/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-api-session-controller/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-api-session-controller/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/client.js +44 -20
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/index.js +43 -13
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +227 -41
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.js +199 -21
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/manager.js +36 -11
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/projection-store.js +1 -1
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/service.js +7 -3
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.js +40 -10
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/list.js +6 -4
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/skill-catalog.js +7 -6
- package/node_modules/@deepseek-ai/dsh-api-session-controller/package.json +73 -70
- package/node_modules/@deepseek-ai/dsh-api-settings-controller/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/README.md +5 -5
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/README.zh.md +5 -5
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/index.js +13 -9
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/typert.host.js +21 -17
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/typert.remote-client.js +10 -10
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/types/index.js +13 -10
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/package.json +18 -17
- package/node_modules/@deepseek-ai/dsh-api-workspace-controller/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-api-workspace-files/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-app-boot/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-app-boot/README.md +5 -1
- package/node_modules/@deepseek-ai/dsh-app-boot/README.zh.md +5 -1
- package/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js +61 -8
- package/node_modules/@deepseek-ai/dsh-app-boot/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-atomic-write/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-attachment/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-attachment-local/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-authorization/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-base/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-base/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-base/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-base/cordis.patch.yml +13 -25
- package/node_modules/@deepseek-ai/dsh-base/package.json +94 -94
- package/node_modules/@deepseek-ai/dsh-bash-local/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-bash-sandbox/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-brand/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-chunked-list/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-connection/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-connection/README.md +5 -3
- package/node_modules/@deepseek-ai/dsh-client-connection/README.zh.md +5 -3
- package/node_modules/@deepseek-ai/dsh-client-connection/lib/index.js +94 -38
- package/node_modules/@deepseek-ai/dsh-client-connection/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-client-file-upload/lib/typert.host.js +9 -5
- package/node_modules/@deepseek-ai/dsh-client-file-upload/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-client-hmr/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-client-locale/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-client-modules/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-client-product-analytics/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-resources/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-client-shortcuts/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-client-store/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-approval/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-brand-official/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.md +19 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.zh.md +19 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/client.js +5539 -4837
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/package.json +38 -38
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.md +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.zh.md +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +26 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/package.json +33 -33
- package/node_modules/@deepseek-ai/dsh-client-ui-cordis/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/client.js +26 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/package.json +28 -28
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-browse/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-native/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/lib/client.js +46 -33
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/package.json +13 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/lib/client.js +22 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-message-feedback/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/README.i18n.yaml +5 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/README.zh.md +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/lib/client.js +11 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-plan/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.i18n.yaml +12 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.md +9 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.zh.md +9 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/client.js +303 -94
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/README.md +6 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/README.zh.md +6 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/CommandText.module.css +12 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/DisclosureRow.module.css +15 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/ImageLightbox.module.css +12 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/TerminalBlock.module.css +3 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/index.js +224 -120
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/CommandText.d.ts +16 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/DisclosureRow.d.ts +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/PermissionIcon.d.ts +12 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/TerminalBlock.d.ts +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/index.d.ts +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-reference/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-renderer/lib/client.js +87 -87
- package/node_modules/@deepseek-ai/dsh-client-ui-renderer/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-client-ui-session/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-settings/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/client.js +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-agent-loop/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-agent-loop/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.md +4 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.zh.md +4 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/client.js +54 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-session-log/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-shell/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-shell/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-signin/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-signin/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-subagent/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-subagent/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-shortcuts/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-browser/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.excel.js +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.js +437 -91
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/client.js +73 -33
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/lib/client.terminal.js +27 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-skill/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-slots/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/README.i18n.yaml +5 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/README.md +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/lib/client.js +50 -35
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.i18n.yaml +19 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.md +13 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.zh.md +13 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/client.js +471 -104
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/index.js +134 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.md +5 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.zh.md +5 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/client.js +52 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/package.json +28 -26
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.md +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.zh.md +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/client.js +60 -43
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/lib/client.js +1 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/README.md +3 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/README.zh.md +3 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/lib/client.js +20 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.md +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.zh.md +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +52 -20
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-cmdline/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-command-compact/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-command-feedback/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-command-goal/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-commands/lib/typert.host.js +9 -5
- package/node_modules/@deepseek-ai/dsh-commands/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-compaction/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-compaction-basic/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-compaction-image-offload/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-compaction-tool-result-pruner/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-config-editor/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-cordis-client-runner/lib/client.js +153 -41
- package/node_modules/@deepseek-ai/dsh-cordis-client-runner/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-cordis-host-runner/lib/index.js +9 -9
- package/node_modules/@deepseek-ai/dsh-cordis-host-runner/lib/typert.host.js +30 -22
- package/node_modules/@deepseek-ai/dsh-cordis-host-runner/lib/typert.remote-client.js +12 -12
- package/node_modules/@deepseek-ai/dsh-cordis-host-runner/lib/types/index.js +12 -8
- package/node_modules/@deepseek-ai/dsh-cordis-host-runner/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-credentials/package.json +2 -2
- package/node_modules/@deepseek-ai/dsh-credentials-local/lib/index.js +7 -3
- package/node_modules/@deepseek-ai/dsh-credentials-local/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-deepseek-account/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-deepseek-account-platform/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/lib/index.js +25 -9
- package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/lib/types/index.js +22 -9
- package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-deque/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/README.i18n.yaml +35 -35
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/README.md +19 -21
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/README.zh.md +19 -21
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/index.js +748 -978
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/types/index.js +44 -22
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/types/lifecycle.js +18 -0
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/types/roster.js +4 -19
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/types/session-message.js +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/cordis.patch.yml +0 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-experimental-api-speech-to-text/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-api-speech-to-text/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-api-speech-to-text/package.json +7 -5
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/lib/index.js +4 -5
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/package.json +41 -39
- package/node_modules/@deepseek-ai/dsh-experimental-badge-skill-bundle/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-badge-skill-bundle/README.md +78 -0
- package/node_modules/@deepseek-ai/dsh-experimental-badge-skill-bundle/README.zh.md +78 -0
- package/node_modules/@deepseek-ai/dsh-experimental-badge-skill-bundle/cordis.patch.yml +3 -0
- package/node_modules/@deepseek-ai/dsh-experimental-badge-skill-bundle/icon.svg +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-badge-skill-bundle/lib/index.js +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-badge-skill-bundle/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-badge-skill-bundle/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/{dsh-hook-protocol → dsh-experimental-badge-skill-bundle}/package.json +18 -8
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-cot-translation/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-cot-translation/README.md +90 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-cot-translation/README.zh.md +90 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-cot-translation/lib/client.js +4766 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-cot-translation/lib/index.js +250 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-cot-translation/lib/typert.host.js +137 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-cot-translation/lib/typert.remote-client.js +72 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-cot-translation/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-cot-translation/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-cot-translation/package.json +100 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/lib/client.js +298 -24
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/package.json +34 -32
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/README.md +81 -0
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/README.zh.md +81 -0
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/cordis.patch.yml +8 -0
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/icon.svg +5 -0
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/lib/index.js +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/package.json +52 -0
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/AutocompleteHistory-BJXpeT8x.js +73 -0
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{FormatterActions-FcPgI0uV.js → FormatterActions-D6HaA-6R.js} +17 -6
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/MapUtilities-C6UNTa-e.js +50 -0
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/ResolverBase-BwI5i_Uj.js +33 -0
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/Runnable-Mz0aa-Zm.js +22 -0
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/StorageItem-_wZ3i4k_.js +12 -0
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/StringUtilities-CMDxNrEc.js +190 -0
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{accessibility-BY7oM_Zr.js → accessibility-B8zUkXQh.js} +225 -226
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{acorn-_jSanihy.js → acorn-yx0Qbj0X.js} +58 -51
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{adorners-CGSl65ls.js → adorners-DUGSZ7j5.js} +2 -4
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{ai_assistance-B1wOs26S.js → ai_assistance-Clc1xIf6.js} +571 -558
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{angular-Dutmu-L9.js → angular-CyYAyotN.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{animation-1CaxAvi1.js → animation-Cb5WQenF.js} +91 -92
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{application-a6KsIIks.js → application-oBBqvcZp.js} +2237 -2232
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{autofill-DRlJ5WO3.js → autofill--bByRQmk.js} +24 -24
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/autofill_manager-XEkk9oZ5.js +59 -0
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{bindings-Cr5O2fL5.js → bindings-CAIo-k1a.js} +492 -462
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{browser-DL1S1Kiu.js → browser-DveWkZD5.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{browser_debugger-DfivmPio.js → browser_debugger--7vbe3d1.js} +146 -145
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{changes-CzTmqALz.js → changes-DjWi1v9d.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{changes-o7rU211I.js → changes-xRx2n786.js} +46 -45
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{code_highlighter-Bh9ro2mP.js → code_highlighter-H8UOTYgG.js} +6 -3
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{codemirror-CBR9VJma.js → codemirror-CENmPHF2.js} +157 -137
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{color_picker-D9TxczuM.js → color_picker-BIF87165.js} +273 -273
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{common-qd_KLeYO.js → common-DMSVbaSb.js} +1077 -1439
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{common-LSsbP0lU.js → common-Ec_cVEiV.js} +2683 -2500
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{common-DhyylFJO.js → common-kU2bwxmb.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{components-DB4oenRq.js → components-B3I3NG-4.js} +68 -67
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{components-CT445-PD.js → components-CaH94O_V.js} +170 -116
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{components-CSVBAbW3.js → components-CsKivuxU.js} +258 -293
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{console-DwIHHkNd.js → console-BmwBLvHk.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{console-VAMtSW-X.js → console-CUdjJ9Xp.js} +596 -601
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{console_counters-BpgnYGWt.js → console_counters-BScL6IPX.js} +26 -26
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{coverage-4LvbYA2T.js → coverage-HrH22f9l.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{coverage-CYnEOg6T.js → coverage-NhXPoU6-.js} +156 -150
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{cpp-CdElSCaB.js → cpp-DaQzQ7EV.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{css_overview-s6ziZpq8.js → css_overview-CxLMtTr9.js} +344 -345
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{data_grid-UqFJQMC9.js → data_grid-CWSfqJp7.js} +109 -102
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{developer_resources-BEGIXIcF.js → developer_resources-BATAp86N.js} +38 -37
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{diff-qn55JSCS.js → diff-DXcO6Sla.js} +24 -7
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{dom_extension-B0UaTHZj.js → dom_extension-BLny9Waw.js} +38 -14
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{elements-B5_H3hT1.js → elements-BU8z2iUE.js} +1881 -1776
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{elements-KASgrHtM.js → elements-Ck9kJ4zi.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{emulation-DZ65TT-w.js → emulation-BIhr0HsX.js} +61 -59
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{emulation-CbCy_GsY.js → emulation-CJ_3s3iH.js} +5 -5
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{emulation-C518g-x2.js → emulation-CczS-vUV.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{emulation-3hQQL2yf.js → emulation-DSV_4uNT.js} +277 -271
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{event_listeners-DhTNoGOp.js → event_listeners-DnM83R-t.js} +63 -63
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/explain-D5jDyrH1.js +745 -0
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{greendev-yysgT4ng.js → greendev-IsUdA61g.js} +38 -38
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{heap_snapshot-CZt2KUPL.js → heap_snapshot-CTdRQlts.js} +6 -6
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{helper-DbYCW1m0.js → helper-YgGAtBRb.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{helpers-C-Rya7xk.js → helpers-BQtqX6SJ.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{i18n--ZipiwZ9.js → i18n-BX_qxSex.js} +4 -3
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{icon_button-BKsdgzo3.js → icon_button-AiKYfeBf.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{inline_editor-DaZpS-8x.js → inline_editor-C2tEGunK.js} +218 -215
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{inspector_main-DkFTp37J.js → inspector_main-BqySmYv0.js} +75 -73
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{issue_counter-rspQhd2r.js → issue_counter-BX-KAvOZ.js} +22 -22
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{issues-DrqiU8Pw.js → issues-DaMGmAC2.js} +469 -468
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{issues_manager-DZmsx4wr.js → issues_manager-e2pmpVIp.js} +537 -599
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{java-7g_qfFa2.js → java-62KG1Vpd.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{layer_viewer-farvqWTo.js → layer_viewer-pReGOxmi.js} +101 -100
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{layers-BO25qbXj.js → layers-BsFRGUMJ.js} +22 -22
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{legacy-DOCLCisy.js → legacy-BYV0pRId.js} +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{legacy-Dv5Py_9p.js → legacy-md3HQs_7.js} +6124 -5944
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{less-DXiRNbd4.js → less-DmILOm_5.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{lighthouse-BvKq1-jB.js → lighthouse-BZB1Bmby.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{lighthouse-CawSQT5Y.js → lighthouse-NimZl1cI.js} +181 -191
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{linear_memory_inspector-CGR2Z7Ph.js → linear_memory_inspector-p2-Ih16z.js} +22 -22
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{live-metrics-4EBbno52.js → live-metrics-CTk3dlLJ.js} +73 -73
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{main-DY6diJ-3.js → main-B8aRedWL.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/main-CU6VhZTa.js +753 -0
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{markdown-tZoR6Bsu.js → markdown-rVMoMV9q.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{markdown_view-CxbhmCgQ.js → markdown_view-JGM1CTOq.js} +15 -12
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{marked-zGgfoDxO.js → marked-CGxJO_CC.js} +20 -14
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{media-DEVFcgOQ.js → media-Cf52Rd9o.js} +236 -234
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{media-BeuRvD7L.js → media-Z6GjdmRm.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{menus-Cjq-uD73.js → menus-Cu1y5CSe.js} +85 -83
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{mobile_throttling-CuGRbE5B.js → mobile_throttling-CvudVoXO.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{mobile_throttling-B_3ewTmi.js → mobile_throttling-dNBk2ECF.js} +174 -172
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{network-CpKopkw0.js → network-BX1qe3_D.js} +1237 -1230
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{network-C-3jvhoX.js → network-B_IYxadp.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{object_ui-cmgZzf81.js → object_ui-Bkc4pMRS.js} +255 -249
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{object_ui-BLzT-Z2e.js → object_ui-CYZ9Q9W6.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{perf_ui-uax9xKLn.js → perf_ui-Ch0z1TZ3.js} +409 -405
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{perf_ui-CYbvqQmF.js → perf_ui-Dlpk1iY7.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{performance_monitor-B_RXvxih.js → performance_monitor-BTc9fFSa.js} +55 -56
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{php-tl5gKrxu.js → php-DVXaM5js.js} +7 -5
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/platform-D4TUCh2P.js +7 -0
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{profiler-C7HGH_E8.js → profiler-CBSzVAE7.js} +707 -703
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{protocol_client-Cwf_jb8R.js → protocol_client-L4-X1Qrb.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/protocol_monitor-B0h70b5w.js +2 -0
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{protocol_monitor-DW-p-6yH.js → protocol_monitor-DOPDE4ZB.js} +221 -225
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{puppeteer-ZLIws8kb.js → puppeteer-xGpmPP-i.js} +71 -89
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{python-D9AdRkMm.js → python-kisakN4d.js} +3 -3
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{quick_open-C_ga_4Hq.js → quick_open-BUuhuOIx.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{quick_open-DJB3P9Ki.js → quick_open-CdyeK7mh.js} +92 -94
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{recorder-DGA0ByVf.js → recorder-DJPAdS_H.js} +365 -365
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{request_link_icon-DPUTK49Y.js → request_link_icon-D2WGdvuX.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{root-DbVQo07X.js → root-DdvV-xPu.js} +52 -74
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{sass-BPQlMmw2.js → sass-CIsRpUiU.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{security-BvuW7HEs.js → security-D2VNjFFC.js} +175 -181
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{sensors-xT8kT9Ea.js → sensors-DjLhEaOA.js} +62 -62
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{settings-z07EmGki.js → settings-D4dmilBC.js} +235 -229
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{settings_ui-gaRa3Hhd.js → settings_ui-DJR_-8cd.js} +54 -53
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{snackbars-CGAwPElE.js → snackbars-DazoAb8B.js} +1169 -1172
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{snippets-Dfmqv8f-.js → snippets-BKl1jevC.js} +51 -50
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{source_frame-_RZ4t3FM.js → source_frame-DpMQZC8A.js} +166 -165
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{sources-DbXkdCVM.js → sources-BS1uHO2R.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{sources-C5ZQ_xfd.js → sources-D4DLpkXp.js} +1131 -1140
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{suggestion_input-Dw2hCSbK.js → suggestion_input-oulk6E-b.js} +6 -16
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{svelte-DJS1itbE.js → svelte-C62W4gaL.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{text_editor-DLc_XoDa.js → text_editor-zHwTtDDW.js} +374 -444
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{text_utils-ohNt_gua.js → text_utils-DWSliayn.js} +161 -82
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{theme_support-DXvy8kfg.js → theme_support-BF2WpOah.js} +49 -34
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{third-party-web-DGiPoc0U.js → third-party-web-Dm5IRT3g.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{timeline-E7l2B_oh.js → timeline-Dt3nmxBb.js} +2407 -2389
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{timeline-Cg6JhvmN.js → timeline-yO_pXh7Z.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{utils-CIWN0B30.js → utils-TeCpVsRE.js} +50 -52
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{vue-CjH9yovn.js → vue-rRx4yj6I.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{wast-CbGHiqaW.js → wast-BJdLzx63.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{web_audio-CbMU64Js.js → web_audio-DuonfZJu.js} +25 -25
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{webauthn-Dlb2Haex.js → webauthn-5JQ01zyM.js} +24 -24
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{whats_new-DtTF4nMn.js → whats_new-nGMut_wC.js} +18 -19
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{xml-DI9dcP5w.js → xml-qmN-BlAu.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/entrypoints/device_mode_emulation_frame/device_mode_emulation_frame.js +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/entrypoints/devtools_app/devtools_app.js +2444 -2443
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/entrypoints/formatter_worker/formatter_worker-entrypoint.js +116 -118
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/entrypoints/heap_snapshot_worker/heap_snapshot_worker-entrypoint.js +289 -192
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/entrypoints/lighthouse_worker/lighthouse_worker.js +428 -403
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/entrypoints/wasmparser_worker/wasmparser_worker-entrypoint.js +31 -44
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/models/live-metrics/web-vitals-injected/web-vitals-injected.generated.js +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/panels/recorder/injected/injected.generated.js +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/resource-manifest.json +387 -357
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/index.js +9 -0
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/README.md +78 -0
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/README.zh.md +78 -0
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/cordis.patch.yml +16 -0
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/icon.svg +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/lib/index.js +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/package.json +50 -0
- package/node_modules/@deepseek-ai/dsh-experimental-session-inspector/lib/client.js +15 -7
- package/node_modules/@deepseek-ai/dsh-experimental-session-inspector/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/README.md +82 -0
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/README.zh.md +82 -0
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/cordis.patch.yml +14 -0
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/icon.svg +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/lib/index.js +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/package.json +50 -0
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/README.md +78 -0
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/README.zh.md +78 -0
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/cordis.patch.yml +12 -0
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/icon.svg +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/lib/index.js +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/package.json +49 -0
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text/package.json +8 -6
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text-sensevoice/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text-sensevoice/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text-sensevoice/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text-sensevoice/lib/index.js +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text-sensevoice/lib/worker.js +15 -1
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text-sensevoice/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text-sensevoice/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text-sensevoice/package.json +10 -8
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/README.md +78 -0
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/README.zh.md +78 -0
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/cordis.patch.yml +19 -0
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/icon.svg +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/lib/index.js +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/package.json +51 -0
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/lib/index.js +11 -16
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/README.i18n.yaml +46 -0
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/README.md +96 -0
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/README.zh.md +96 -0
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/cordis.patch.yml +5 -0
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/icon.svg +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/lib/index.js +66 -0
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/package.json +67 -0
- package/node_modules/@deepseek-ai/dsh-experimental-translator/README.i18n.yaml +49 -0
- package/node_modules/@deepseek-ai/dsh-experimental-translator/README.md +124 -0
- package/node_modules/@deepseek-ai/dsh-experimental-translator/README.zh.md +124 -0
- package/node_modules/@deepseek-ai/dsh-experimental-translator/lib/index.js +935 -0
- package/node_modules/@deepseek-ai/dsh-experimental-translator/lib/types/deepseek.js +283 -0
- package/node_modules/@deepseek-ai/dsh-experimental-translator/lib/types/error.js +14 -0
- package/node_modules/@deepseek-ai/dsh-experimental-translator/lib/types/index.js +148 -0
- package/node_modules/@deepseek-ai/dsh-experimental-translator/lib/types/provider.js +215 -0
- package/node_modules/@deepseek-ai/dsh-experimental-translator/lib/types/storage.js +215 -0
- package/node_modules/@deepseek-ai/dsh-experimental-translator/lib/types/types.js +2 -0
- package/node_modules/@deepseek-ai/dsh-experimental-translator/package.json +68 -0
- package/node_modules/@deepseek-ai/dsh-experimental-voice-input-bundle/package.json +6 -6
- package/node_modules/{@octokit/request-error → @deepseek-ai/dsh-experimental-worktree}/LICENSE +6 -6
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/README.md +98 -0
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/README.zh.md +98 -0
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/lib/index.js +368 -0
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/lib/types/directory.d.ts +7 -0
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/lib/types/index.d.ts +54 -0
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/lib/types/process.d.ts +29 -0
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/lib/types/types.d.ts +20 -0
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/package.json +58 -0
- package/node_modules/@deepseek-ai/dsh-file-reference/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-file-reference-local/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-file-reference-local/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-file-reference-local/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-file-reference-local/lib/index.js +15 -10
- package/node_modules/@deepseek-ai/dsh-file-reference-local/lib/types/index.js +12 -10
- package/node_modules/@deepseek-ai/dsh-file-reference-local/package.json +15 -11
- package/node_modules/@deepseek-ai/dsh-fs/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-fs-local/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-fs-observation-policy/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-fs-sandbox/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-goal/lib/typert.host.js +9 -5
- package/node_modules/@deepseek-ai/dsh-goal/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-goal-round-driver/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-headless/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-headless/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-headless/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-headless/cordis.patch.yml +0 -1
- package/node_modules/@deepseek-ai/dsh-headless/lib/index.js +20 -1
- package/node_modules/@deepseek-ai/dsh-headless/package.json +24 -17
- package/node_modules/@deepseek-ai/dsh-hmr/lib/index.js +9 -3
- package/node_modules/@deepseek-ai/dsh-hmr/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-home-paths/README.i18n.yaml +13 -10
- package/node_modules/@deepseek-ai/dsh-home-paths/README.md +16 -5
- package/node_modules/@deepseek-ai/dsh-home-paths/README.zh.md +16 -5
- package/node_modules/@deepseek-ai/dsh-home-paths/lib/index.js +65 -4
- package/node_modules/@deepseek-ai/dsh-home-paths/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-host-directory-picker/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-auto/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-auto/README.md +5 -3
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-auto/README.zh.md +5 -3
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-auto/lib/index.js +30 -18
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-auto/package.json +15 -13
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-browse/package.json +2 -2
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-native/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-host-frontend-static/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-host-open-in-app/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-host-product-telemetry-otel/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-host-webserver/README.i18n.yaml +23 -20
- package/node_modules/@deepseek-ai/dsh-host-webserver/README.md +31 -10
- package/node_modules/@deepseek-ai/dsh-host-webserver/README.zh.md +31 -10
- package/node_modules/@deepseek-ai/dsh-host-webserver/lib/index.js +207 -63
- package/node_modules/@deepseek-ai/dsh-host-webserver/package.json +5 -3
- package/node_modules/@deepseek-ai/dsh-http-proxy/package.json +2 -2
- package/node_modules/@deepseek-ai/dsh-jobs/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-jobs-local/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-launch-environment/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-lazy-require/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-llm/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-llm/README.md +19 -0
- package/node_modules/@deepseek-ai/dsh-llm/README.zh.md +19 -0
- package/node_modules/@deepseek-ai/dsh-llm/lib/index.js +21 -8
- package/node_modules/@deepseek-ai/dsh-llm/lib/typert.host.js +12 -4
- package/node_modules/@deepseek-ai/dsh-llm/lib/types/index.js +19 -8
- package/node_modules/@deepseek-ai/dsh-llm/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-llm-cursor/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/README.md +4 -4
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/README.zh.md +4 -4
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/index.js +37 -14
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/package.json +37 -37
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/lib/index.js +8 -2
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/README.i18n.yaml +10 -10
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/README.md +10 -4
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/README.zh.md +10 -4
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/index.js +150 -61
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-llm-retry/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-mcp-client/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-mcp-resources/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-message-feedback/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-native-command/package.json +2 -2
- package/node_modules/@deepseek-ai/dsh-no-progress-reminder/lib/index.js +21 -8
- package/node_modules/@deepseek-ai/dsh-no-progress-reminder/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-office-to-pdf/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-otel/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-otel/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-otel/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-otel/lib/index.js +14 -4
- package/node_modules/@deepseek-ai/dsh-otel/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-output-retention/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-package-manifest/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-permission-presets/lib/typert.host.js +9 -5
- package/node_modules/@deepseek-ai/dsh-permission-presets/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-persona/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-plan-mode/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-plan-mode/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-plan-mode/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-plan-mode/lib/index.js +31 -26
- package/node_modules/@deepseek-ai/dsh-plan-mode/lib/types/index.js +35 -27
- package/node_modules/@deepseek-ai/dsh-plan-mode/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-plugin-manager/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-plugin-manager/README.md +7 -1
- package/node_modules/@deepseek-ai/dsh-plugin-manager/README.zh.md +7 -1
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/index.js +142 -20
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/typert.host.js +24 -17
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/typert.remote-client.js +19 -12
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/build-approval.js +35 -5
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/index.js +55 -24
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/official-install-target.js +54 -0
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/tools.js +1 -1
- package/node_modules/@deepseek-ai/dsh-plugin-manager/package.json +28 -28
- package/node_modules/@deepseek-ai/dsh-plugin-package-inventory-deepseek/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-plugin-package-inventory-deepseek/README.md +4 -4
- package/node_modules/@deepseek-ai/dsh-plugin-package-inventory-deepseek/README.zh.md +4 -4
- package/node_modules/@deepseek-ai/dsh-plugin-package-inventory-deepseek/lib/index.js +22 -13
- package/node_modules/@deepseek-ai/dsh-plugin-package-inventory-deepseek/lib/types/index.js +25 -15
- package/node_modules/@deepseek-ai/dsh-plugin-package-inventory-deepseek/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-ptc-runtime/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.md +2 -3
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.zh.md +2 -3
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/index.js +37 -12
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-pwsh-local/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-pwsh-sandbox/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-repeat-tool-reminder/lib/index.js +21 -8
- package/node_modules/@deepseek-ai/dsh-repeat-tool-reminder/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-sandbox/lib/index.js +12 -11
- package/node_modules/@deepseek-ai/dsh-sandbox/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-sandbox-apple-container/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-sandbox-apple-container/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-sandbox-apple-container/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-sandbox-apple-container/lib/exec-shim.js +26 -34
- package/node_modules/@deepseek-ai/dsh-sandbox-apple-container/lib/index.js +118 -57
- package/node_modules/@deepseek-ai/dsh-sandbox-apple-container/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-sandbox-local/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-sandbox-policy/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-schedule/package.json +30 -30
- package/node_modules/@deepseek-ai/dsh-scope/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-sdk-app/README.i18n.yaml +14 -14
- package/node_modules/@deepseek-ai/dsh-sdk-app/README.md +5 -5
- package/node_modules/@deepseek-ai/dsh-sdk-app/README.zh.md +5 -5
- package/node_modules/@deepseek-ai/dsh-sdk-app/cordis.patch.yml +4 -9
- package/node_modules/@deepseek-ai/dsh-sdk-app/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/README.md +5 -1
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/README.zh.md +5 -1
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/lib/index.js +93 -11
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/package.json +23 -21
- package/node_modules/@deepseek-ai/dsh-sdk-minimal/README.i18n.yaml +12 -12
- package/node_modules/@deepseek-ai/dsh-sdk-minimal/README.md +6 -6
- package/node_modules/@deepseek-ai/dsh-sdk-minimal/README.zh.md +6 -6
- package/node_modules/@deepseek-ai/dsh-sdk-minimal/cordis.patch.yml +9 -0
- package/node_modules/@deepseek-ai/dsh-sdk-minimal/package.json +29 -26
- package/node_modules/@deepseek-ai/dsh-sdk-protocol/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-sdk-protocol/README.md +6 -1
- package/node_modules/@deepseek-ai/dsh-sdk-protocol/README.zh.md +6 -1
- package/node_modules/@deepseek-ai/dsh-sdk-protocol/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-session/README.i18n.yaml +7 -4
- package/node_modules/@deepseek-ai/dsh-session/README.md +13 -1
- package/node_modules/@deepseek-ai/dsh-session/README.zh.md +13 -1
- package/node_modules/@deepseek-ai/dsh-session/lib/index.js +134 -18
- package/node_modules/@deepseek-ai/dsh-session/lib/types/index.js +120 -5
- package/node_modules/@deepseek-ai/dsh-session/lib/types/known-event-types.js +1 -0
- package/node_modules/@deepseek-ai/dsh-session/lib/types/types.js +14 -14
- package/node_modules/@deepseek-ai/dsh-session/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-session-checkpoint-policy/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-session-format/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-session-format/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session-format/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session-format/package.json +2 -2
- package/node_modules/@deepseek-ai/dsh-session-format-catalog/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-session-format-v0-to-v1/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-session-format-v1-to-v2/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-session-format-v2-to-v3/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/lib/index.js +4 -1
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/lib/types/index.js +4 -1
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session-log-export/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-session-persistence/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-session-persistence/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-session-persistence/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-session-persistence/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/README.md +4 -0
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/README.zh.md +4 -0
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/index.js +23 -19
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/worker.cjs +92 -12
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-session-projection/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-session-projection/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session-projection/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session-projection/lib/index.js +1 -2
- package/node_modules/@deepseek-ai/dsh-session-projection/lib/types/index.js +2 -1
- package/node_modules/@deepseek-ai/dsh-session-projection/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-session-projection-cache/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-session-query/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-session-query/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-session-query/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-session-query/lib/index.js +9 -7
- package/node_modules/@deepseek-ai/dsh-session-query/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-session-query-sqlite/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-session-query-sqlite/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session-query-sqlite/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session-query-sqlite/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-session-reference/lib/typert.host.js +9 -5
- package/node_modules/@deepseek-ai/dsh-session-reference/package.json +35 -34
- package/node_modules/@deepseek-ai/dsh-session-stats/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-session-telemetry/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-session-telemetry-otel/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-session-telemetry-otel/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session-telemetry-otel/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session-telemetry-otel/lib/index.js +2 -1
- package/node_modules/@deepseek-ai/dsh-session-telemetry-otel/package.json +22 -24
- package/node_modules/@deepseek-ai/dsh-session-title/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-session-title/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-session-title/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-session-title/lib/index.js +8 -4
- package/node_modules/@deepseek-ai/dsh-session-title/lib/types/index.js +9 -4
- package/node_modules/@deepseek-ai/dsh-session-title/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-session-title-all-prompts-llm/README.i18n.yaml +64 -0
- package/node_modules/@deepseek-ai/dsh-session-title-all-prompts-llm/README.md +120 -0
- package/node_modules/@deepseek-ai/dsh-session-title-all-prompts-llm/README.zh.md +120 -0
- package/node_modules/@deepseek-ai/dsh-session-title-all-prompts-llm/lib/index.js +127 -0
- package/node_modules/@deepseek-ai/dsh-session-title-all-prompts-llm/package.json +48 -0
- package/node_modules/@deepseek-ai/dsh-session-title-first-prompt-llm/README.i18n.yaml +16 -16
- package/node_modules/@deepseek-ai/dsh-session-title-first-prompt-llm/README.md +10 -10
- package/node_modules/@deepseek-ai/dsh-session-title-first-prompt-llm/README.zh.md +10 -10
- package/node_modules/@deepseek-ai/dsh-session-title-first-prompt-llm/lib/index.js +91 -8
- package/node_modules/@deepseek-ai/dsh-session-title-first-prompt-llm/package.json +15 -13
- package/node_modules/@deepseek-ai/dsh-session-title-llm/README.i18n.yaml +29 -29
- package/node_modules/@deepseek-ai/dsh-session-title-llm/README.md +21 -20
- package/node_modules/@deepseek-ai/dsh-session-title-llm/README.zh.md +21 -20
- package/node_modules/@deepseek-ai/dsh-session-title-llm/lib/index.js +60 -81
- package/node_modules/@deepseek-ai/dsh-session-title-llm/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-session-turn-outline/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-settings/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-shell/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-shell-env/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-skill/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-skill-badge/README.i18n.yaml +13 -13
- package/node_modules/@deepseek-ai/dsh-skill-badge/README.md +10 -8
- package/node_modules/@deepseek-ai/dsh-skill-badge/README.zh.md +10 -8
- package/node_modules/@deepseek-ai/dsh-skill-badge/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-skill-filesystem/lib/index.js +17 -14
- package/node_modules/@deepseek-ai/dsh-skill-filesystem/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-skill-office/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-spill/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-spill-local/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-spill-policy/package.json +31 -31
- package/node_modules/@deepseek-ai/dsh-storage/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-storage-domain/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-storage-json/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-subagent/README.i18n.yaml +34 -34
- package/node_modules/@deepseek-ai/dsh-subagent/README.md +32 -26
- package/node_modules/@deepseek-ai/dsh-subagent/README.zh.md +32 -26
- package/node_modules/@deepseek-ai/dsh-subagent/lib/index.js +1552 -1477
- package/node_modules/@deepseek-ai/dsh-subagent/lib/typert.host.js +59 -48
- package/node_modules/@deepseek-ai/dsh-subagent/lib/typert.remote-client.js +2 -2
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/activation.js +112 -0
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/catalog.js +34 -30
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/child-agent.js +1 -3
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/continuation-messages.js +18 -23
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/descriptor.js +20 -21
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/index.js +75 -95
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/lifecycle.js +9 -100
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/list-children.js +1 -1
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/manager.js +1294 -0
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/out-of-process.js +25 -45
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/structured.js +130 -0
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/types.js +1 -1
- package/node_modules/@deepseek-ai/dsh-subagent/package.json +48 -48
- package/node_modules/@deepseek-ai/dsh-subagent-acp/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-subagent-acp/README.md +3 -4
- package/node_modules/@deepseek-ai/dsh-subagent-acp/README.zh.md +3 -4
- package/node_modules/@deepseek-ai/dsh-subagent-acp/lib/index.js +5 -55
- package/node_modules/@deepseek-ai/dsh-subagent-acp/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/README.i18n.yaml +14 -14
- package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/README.md +8 -9
- package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/README.zh.md +8 -9
- package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/lib/index.js +0 -5
- package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/package.json +11 -13
- package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/README.i18n.yaml +14 -14
- package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/README.md +6 -7
- package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/README.zh.md +6 -7
- package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/lib/index.js +0 -4
- package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/package.json +15 -16
- package/node_modules/@deepseek-ai/dsh-subprocess/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-subprocess-local/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-subprocess-local/README.md +2 -1
- package/node_modules/@deepseek-ai/dsh-subprocess-local/README.zh.md +2 -1
- package/node_modules/@deepseek-ai/dsh-subprocess-local/lib/index.js +5 -3
- package/node_modules/@deepseek-ai/dsh-subprocess-local/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-system-prompt/README.i18n.yaml +10 -10
- package/node_modules/@deepseek-ai/dsh-system-prompt/README.md +10 -6
- package/node_modules/@deepseek-ai/dsh-system-prompt/README.zh.md +10 -6
- package/node_modules/@deepseek-ai/dsh-system-prompt/lib/index.js +50 -9
- package/node_modules/@deepseek-ai/dsh-system-prompt/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-terminal/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-terminal/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-terminal/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-terminal/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-terminal-bash/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-terminal-bash/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-terminal-bash/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-terminal-bash/lib/index.js +3 -2
- package/node_modules/@deepseek-ai/dsh-terminal-bash/package.json +20 -18
- package/node_modules/@deepseek-ai/dsh-time-context/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-timeout/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-timeout/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-timeout/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-timeout/lib/index.js +12 -3
- package/node_modules/@deepseek-ai/dsh-timeout/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tmux-context/lib/index.js +21 -8
- package/node_modules/@deepseek-ai/dsh-tmux-context/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-token-meter/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-tool-ask-user/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-tool-bash/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-tool-bash/README.md +5 -1
- package/node_modules/@deepseek-ai/dsh-tool-bash/README.zh.md +5 -1
- package/node_modules/@deepseek-ai/dsh-tool-bash/lib/index.js +35 -21
- package/node_modules/@deepseek-ai/dsh-tool-bash/package.json +33 -30
- package/node_modules/@deepseek-ai/dsh-tool-bash-persistent/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-tool-bash-persistent/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-tool-bash-persistent/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-tool-bash-persistent/lib/index.js +7 -3
- package/node_modules/@deepseek-ai/dsh-tool-bash-persistent/package.json +22 -20
- package/node_modules/@deepseek-ai/dsh-tool-call-timeout-policy/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +293 -94
- package/node_modules/@deepseek-ai/dsh-tool-cordis/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.i18n.yaml +10 -10
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.md +6 -3
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.zh.md +6 -3
- package/node_modules/@deepseek-ai/dsh-tool-fs/lib/index.js +71 -58
- package/node_modules/@deepseek-ai/dsh-tool-fs/package.json +32 -30
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/lib/index.js +25 -21
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/package.json +27 -25
- package/node_modules/@deepseek-ai/dsh-tool-goal/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-tool-jobs/README.i18n.yaml +3 -3
- package/node_modules/@deepseek-ai/dsh-tool-jobs/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-tool-jobs/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-jobs/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-tool-present/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-tool-present/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-tool-present/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-tool-present/lib/index.js +7 -4
- package/node_modules/@deepseek-ai/dsh-tool-present/lib/types/index.js +3 -5
- package/node_modules/@deepseek-ai/dsh-tool-present/package.json +19 -17
- package/node_modules/@deepseek-ai/dsh-tool-pwsh/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-tool-pwsh/README.md +4 -1
- package/node_modules/@deepseek-ai/dsh-tool-pwsh/README.zh.md +4 -1
- package/node_modules/@deepseek-ai/dsh-tool-pwsh/lib/index.js +37 -20
- package/node_modules/@deepseek-ai/dsh-tool-pwsh/package.json +31 -28
- package/node_modules/@deepseek-ai/dsh-tool-pwsh-persistent/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-tool-pwsh-persistent/README.md +3 -0
- package/node_modules/@deepseek-ai/dsh-tool-pwsh-persistent/README.zh.md +3 -0
- package/node_modules/@deepseek-ai/dsh-tool-pwsh-persistent/lib/index.js +7 -3
- package/node_modules/@deepseek-ai/dsh-tool-pwsh-persistent/package.json +24 -22
- package/node_modules/@deepseek-ai/dsh-tool-ralph/README.i18n.yaml +3 -3
- package/node_modules/@deepseek-ai/dsh-tool-ralph/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-tool-ralph/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-tool-ralph/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-tool-schedule/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-tool-session-query/README.i18n.yaml +97 -0
- package/node_modules/@deepseek-ai/dsh-tool-session-query/README.md +186 -0
- package/node_modules/@deepseek-ai/dsh-tool-session-query/README.zh.md +186 -0
- package/node_modules/@deepseek-ai/dsh-tool-session-query/lib/index.js +1034 -0
- package/node_modules/@deepseek-ai/dsh-tool-session-query/package.json +61 -0
- package/node_modules/@deepseek-ai/dsh-tool-skill/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-tool-skill/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-tool-skill/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-tool-skill/lib/index.js +97 -5
- package/node_modules/@deepseek-ai/dsh-tool-skill/package.json +16 -14
- package/node_modules/@deepseek-ai/dsh-tool-str-replace-editor/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-tool-str-replace-editor/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-tool-str-replace-editor/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-tool-str-replace-editor/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-tool-subagent/README.i18n.yaml +51 -51
- package/node_modules/@deepseek-ai/dsh-tool-subagent/README.md +27 -29
- package/node_modules/@deepseek-ai/dsh-tool-subagent/README.zh.md +26 -28
- package/node_modules/@deepseek-ai/dsh-tool-subagent/lib/index.js +108 -237
- package/node_modules/@deepseek-ai/dsh-tool-subagent/package.json +20 -24
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/README.md +4 -5
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/README.zh.md +4 -5
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/lib/types/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-tool-terminal/README.i18n.yaml +100 -0
- package/node_modules/@deepseek-ai/dsh-tool-terminal/README.md +186 -0
- package/node_modules/@deepseek-ai/dsh-tool-terminal/README.zh.md +186 -0
- package/node_modules/@deepseek-ai/dsh-tool-terminal/lib/index.js +650 -0
- package/node_modules/@deepseek-ai/dsh-tool-terminal/package.json +64 -0
- package/node_modules/@deepseek-ai/dsh-tool-todo/lib/types/index.js +1 -0
- package/node_modules/@deepseek-ai/dsh-tool-todo/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-tool-web/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-tool-workflow/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-tool-working-directory/README.i18n.yaml +46 -0
- package/node_modules/@deepseek-ai/dsh-tool-working-directory/README.md +90 -0
- package/node_modules/@deepseek-ai/dsh-tool-working-directory/README.zh.md +90 -0
- package/node_modules/@deepseek-ai/dsh-tool-working-directory/lib/index.js +45 -0
- package/node_modules/@deepseek-ai/dsh-tool-working-directory/package.json +45 -0
- package/node_modules/@deepseek-ai/dsh-tool-workspace-dependencies/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-tools/README.i18n.yaml +12 -12
- package/node_modules/@deepseek-ai/dsh-tools/README.md +9 -7
- package/node_modules/@deepseek-ai/dsh-tools/README.zh.md +9 -7
- package/node_modules/@deepseek-ai/dsh-tools/lib/index.js +17 -19
- package/node_modules/@deepseek-ai/dsh-tools/lib/types/index.js +17 -10
- package/node_modules/@deepseek-ai/dsh-tools/lib/types/ptc.js +4 -2
- package/node_modules/@deepseek-ai/dsh-tools/lib/types/py-types.js +1 -2
- package/node_modules/@deepseek-ai/dsh-tools/package.json +24 -22
- package/node_modules/@deepseek-ai/dsh-tui-app/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-tui-app/README.md +5 -4
- package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +5 -4
- package/node_modules/@deepseek-ai/dsh-tui-app/cordis.patch.yml +0 -1
- package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +117 -53
- package/node_modules/@deepseek-ai/dsh-tui-app/package.json +79 -79
- package/node_modules/@deepseek-ai/dsh-typert-loader/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-typert-protocol/package.json +2 -2
- package/node_modules/@deepseek-ai/dsh-typert-registry/package.json +2 -2
- package/node_modules/@deepseek-ai/dsh-user-approval/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-user-questions/lib/typert.host.js +9 -5
- package/node_modules/@deepseek-ai/dsh-user-questions/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-util-code-language/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-util-crypto/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-util-time/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-util-values/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-util-workspace-path/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-web/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-web-app/README.i18n.yaml +18 -21
- package/node_modules/@deepseek-ai/dsh-web-app/README.md +30 -22
- package/node_modules/@deepseek-ai/dsh-web-app/README.zh.md +30 -22
- package/node_modules/@deepseek-ai/dsh-web-app/cordis.patch.yml +18 -24
- package/node_modules/@deepseek-ai/dsh-web-app/lib/index.js +44 -41
- package/node_modules/@deepseek-ai/dsh-web-app/lib/startup.js +17 -6
- package/node_modules/@deepseek-ai/dsh-web-app/package.json +142 -143
- package/node_modules/@deepseek-ai/dsh-web-app/presets/cordis.patch.yml +1 -26
- package/node_modules/@deepseek-ai/dsh-web-app/presets/ptc.patch.yml +1 -26
- package/node_modules/@deepseek-ai/dsh-web-app/presets/standard.patch.yml +1 -26
- package/node_modules/@deepseek-ai/dsh-web-fetch-http/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-C5TXjxs_.js +127 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-CyN1a9tV.css +1 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/asciidoc-CSVQ5wI8.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{bat-BkioyH1T.js → bat-CickPsom.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/cpp-DddhVWhK.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{graphql-DujV8YkJ.js → graphql-B1S3xuDR.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{http-DcV90OkR.js → http-Ddl8tKhJ.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{julia-BpJ6DjL_.js → julia-BfSmLjIk.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{latex-B4C7GdlO.js → latex-B2nUCzCX.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{php-LEPfNACG.js → php-G1-V1D4R.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{powershell-Dpen1YoG.js → powershell-BmBUJMz7.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/r-Cf5RLm7j.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{rst-BbocfKWr.js → rst-qb8661zE.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{ruby-R292Iif0.js → ruby-D3_WCtdO.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{scala-C151Ov-r.js → scala-CqE71os6.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{svelte-DNMY6jOf.js → svelte-Dhjv0SwI.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/swift-C2oV4EkX.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/system-verilog-0hqHdDBg.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{vb-D17OF-Vu.js → vb-Cu-pLBUe.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/verilog-nZwndyjY.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{vue-Dq2x6432.js → vue-CjW_c7H6.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/{vendor-CCJJTK99.js → vendor-BlFz1smR.js} +32 -32
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/vendor-D2ODLP6r.css +1 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/index.html +4 -4
- package/node_modules/@deepseek-ai/dsh-web-frontend/package.json +25 -22
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-web-search-exa/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-web-search-perplexity/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-win32-process/package.json +2 -2
- package/node_modules/@deepseek-ai/dsh-workflow/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-workflow-ptc/README.i18n.yaml +10 -10
- package/node_modules/@deepseek-ai/dsh-workflow-ptc/README.md +5 -5
- package/node_modules/@deepseek-ai/dsh-workflow-ptc/README.zh.md +5 -5
- package/node_modules/@deepseek-ai/dsh-workflow-ptc/lib/index.js +25 -14
- package/node_modules/@deepseek-ai/dsh-workflow-ptc/package.json +36 -33
- package/node_modules/@deepseek-ai/dsh-working-directory/README.i18n.yaml +46 -0
- package/node_modules/@deepseek-ai/dsh-working-directory/README.md +90 -0
- package/node_modules/@deepseek-ai/dsh-working-directory/README.zh.md +90 -0
- package/node_modules/@deepseek-ai/dsh-working-directory/lib/index.js +167 -0
- package/node_modules/@deepseek-ai/dsh-working-directory/package.json +56 -0
- package/node_modules/@deepseek-ai/dsh-workspace/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-workspace-changes/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-workspace-changes/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-workspace-changes/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-workspace-changes/lib/index.js +25 -34
- package/node_modules/@deepseek-ai/dsh-workspace-changes/lib/types/capture.js +0 -27
- package/node_modules/@deepseek-ai/dsh-workspace-changes/lib/types/index.js +22 -4
- package/node_modules/@deepseek-ai/dsh-workspace-changes/lib/types/recorder.js +4 -8
- package/node_modules/@deepseek-ai/dsh-workspace-changes/package.json +18 -11
- package/node_modules/@earendil-works/pi-ai/README.md +16 -5
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +30 -29
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.js +76 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +11 -79
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +58 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.js +98 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.js +15 -9
- package/node_modules/@earendil-works/pi-ai/dist/api/lazy.js +4 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/llama-cpp-classify.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +5 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +6 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.js +162 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.js +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +6 -5
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +9 -5
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +10 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.js +5 -89
- package/node_modules/@earendil-works/pi-ai/dist/api/typesafe-system-one.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js +65 -7
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-chatgpt.js +11 -14
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +51 -27
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/models.js +6 -8
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure.js +46 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.js +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/mistral.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/radius.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +25 -8
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.js +12 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/radius.js +4 -12
- package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +25 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.js +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth-page.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/transcript.js +5 -2
- package/node_modules/@earendil-works/pi-ai/package.json +3 -3
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/index.cjs +474 -114
- package/node_modules/@modelcontextprotocol/client/dist/index.mjs +468 -115
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/{src-NAgB4Mp8.cjs → src-oZBjf3U1.cjs} +131 -41
- package/node_modules/@modelcontextprotocol/client/dist/{src-D_zzAWoS.mjs → src-xKF0PJN-.mjs} +120 -36
- package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs +8 -2
- package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs +8 -2
- package/node_modules/@modelcontextprotocol/client/package.json +4 -4
- package/node_modules/@modelcontextprotocol/core/dist/{auth-CUe6YdwF.mjs → auth-BNDyLTqp.mjs} +7 -4
- package/node_modules/@modelcontextprotocol/core/dist/{auth-CfDMXiII.cjs → auth-D1CeV_Jr.cjs} +7 -4
- package/node_modules/@modelcontextprotocol/core/dist/index.cjs +1 -1
- package/node_modules/@modelcontextprotocol/core/dist/index.mjs +1 -1
- package/node_modules/@modelcontextprotocol/core/dist/internal.cjs +1 -1
- package/node_modules/@modelcontextprotocol/core/dist/internal.mjs +1 -1
- package/node_modules/@modelcontextprotocol/core/package.json +1 -1
- package/node_modules/@opentelemetry/api-logs/build/esm/version.js +1 -1
- package/node_modules/@opentelemetry/api-logs/build/esnext/version.js +1 -1
- package/node_modules/@opentelemetry/api-logs/build/src/types/LogRecord.js +1 -1
- package/node_modules/@opentelemetry/api-logs/build/src/version.js +1 -1
- package/node_modules/@opentelemetry/api-logs/package.json +7 -7
- package/node_modules/@opentelemetry/core/build/esm/version.js +1 -1
- package/node_modules/@opentelemetry/core/build/esnext/version.js +1 -1
- package/node_modules/@opentelemetry/core/build/src/ExportResult.js +1 -1
- package/node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js +1 -1
- package/node_modules/@opentelemetry/core/build/src/version.js +1 -1
- package/node_modules/@opentelemetry/core/package.json +7 -7
- package/node_modules/@opentelemetry/otlp-exporter-base/README.md +30 -0
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esm/ExporterMetrics.js +104 -0
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esm/OTLPExporterBase.js +3 -0
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/create-legacy-browser-delegate.js +36 -2
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esm/index-browser-http.js +1 -1
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esm/index-node-http.js +1 -1
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esm/index.js +1 -0
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-browser-http-export-delegate.js +8 -4
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-export-delegate.js +19 -6
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-http-export-delegate.js +30 -1
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-network-export-delegate.js +2 -1
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esm/semconv.js +100 -0
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esm/version.js +1 -1
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esnext/ExporterMetrics.js +104 -0
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esnext/OTLPExporterBase.js +3 -0
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esnext/configuration/create-legacy-browser-delegate.js +36 -2
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esnext/index-browser-http.js +1 -1
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esnext/index-node-http.js +1 -1
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esnext/index.js +1 -0
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esnext/otlp-browser-http-export-delegate.js +8 -4
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esnext/otlp-export-delegate.js +19 -6
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esnext/otlp-http-export-delegate.js +30 -1
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esnext/otlp-network-export-delegate.js +2 -1
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esnext/semconv.js +100 -0
- package/node_modules/@opentelemetry/otlp-exporter-base/build/esnext/version.js +1 -1
- package/node_modules/@opentelemetry/otlp-exporter-base/build/src/ExporterMetrics.js +108 -0
- package/node_modules/@opentelemetry/otlp-exporter-base/build/src/OTLPExporterBase.js +3 -0
- package/node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/create-legacy-browser-delegate.js +38 -3
- package/node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/legacy-node-configuration.js +1 -1
- package/node_modules/@opentelemetry/otlp-exporter-base/build/src/index-browser-http.js +2 -1
- package/node_modules/@opentelemetry/otlp-exporter-base/build/src/index-node-http.js +2 -1
- package/node_modules/@opentelemetry/otlp-exporter-base/build/src/index.js +3 -1
- package/node_modules/@opentelemetry/otlp-exporter-base/build/src/otlp-browser-http-export-delegate.js +8 -4
- package/node_modules/@opentelemetry/otlp-exporter-base/build/src/otlp-export-delegate.js +19 -6
- package/node_modules/@opentelemetry/otlp-exporter-base/build/src/otlp-http-export-delegate.js +32 -2
- package/node_modules/@opentelemetry/otlp-exporter-base/build/src/otlp-network-export-delegate.js +2 -1
- package/node_modules/@opentelemetry/otlp-exporter-base/build/src/semconv.js +103 -0
- package/node_modules/@opentelemetry/otlp-exporter-base/build/src/version.js +1 -1
- package/node_modules/@opentelemetry/otlp-exporter-base/package.json +9 -9
- package/node_modules/@opentelemetry/otlp-transformer/build/esm/i-exporter-metrics-helper.js +6 -0
- package/node_modules/@opentelemetry/otlp-transformer/build/esm/index.js +3 -0
- package/node_modules/@opentelemetry/otlp-transformer/build/esm/logs/index.js +7 -1
- package/node_modules/@opentelemetry/otlp-transformer/build/esm/logs/json/logs.js +1 -1
- package/node_modules/@opentelemetry/otlp-transformer/build/esm/logs/protobuf/logs.js +1 -1
- package/node_modules/@opentelemetry/otlp-transformer/build/esm/metrics/index.js +12 -1
- package/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/index.js +4 -1
- package/node_modules/@opentelemetry/otlp-transformer/build/esnext/i-exporter-metrics-helper.js +6 -0
- package/node_modules/@opentelemetry/otlp-transformer/build/esnext/index.js +3 -0
- package/node_modules/@opentelemetry/otlp-transformer/build/esnext/logs/index.js +7 -1
- package/node_modules/@opentelemetry/otlp-transformer/build/esnext/logs/json/logs.js +1 -1
- package/node_modules/@opentelemetry/otlp-transformer/build/esnext/logs/protobuf/logs.js +1 -1
- package/node_modules/@opentelemetry/otlp-transformer/build/esnext/metrics/index.js +12 -1
- package/node_modules/@opentelemetry/otlp-transformer/build/esnext/trace/index.js +4 -1
- package/node_modules/@opentelemetry/otlp-transformer/build/src/i-exporter-metrics-helper.js +7 -0
- package/node_modules/@opentelemetry/otlp-transformer/build/src/index.js +7 -1
- package/node_modules/@opentelemetry/otlp-transformer/build/src/logs/index.js +8 -0
- package/node_modules/@opentelemetry/otlp-transformer/build/src/logs/internal-types.js +1 -1
- package/node_modules/@opentelemetry/otlp-transformer/build/src/logs/json/logs.js +1 -1
- package/node_modules/@opentelemetry/otlp-transformer/build/src/logs/protobuf/logs.js +1 -1
- package/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/index.js +13 -0
- package/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/internal-types.js +1 -1
- package/node_modules/@opentelemetry/otlp-transformer/build/src/trace/index.js +5 -0
- package/node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal-types.js +2 -2
- package/node_modules/@opentelemetry/otlp-transformer/package.json +15 -15
- package/node_modules/@opentelemetry/resources/build/esm/detectors/platform/node/ServiceInstanceIdDetector.js +6 -1
- package/node_modules/@opentelemetry/resources/build/esm/version.js +1 -1
- package/node_modules/@opentelemetry/resources/build/esnext/detectors/platform/node/ServiceInstanceIdDetector.js +6 -1
- package/node_modules/@opentelemetry/resources/build/esnext/version.js +1 -1
- package/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ServiceInstanceIdDetector.js +6 -1
- package/node_modules/@opentelemetry/resources/build/src/version.js +1 -1
- package/node_modules/@opentelemetry/resources/package.json +9 -9
- package/node_modules/@opentelemetry/sdk-logs/README.md +5 -0
- package/node_modules/@opentelemetry/sdk-logs/build/esm/LogRecordImpl.js +33 -6
- package/node_modules/@opentelemetry/sdk-logs/build/esm/LoggerProvider.js +3 -4
- package/node_modules/@opentelemetry/sdk-logs/build/esm/MultiLogRecordProcessor.js +3 -5
- package/node_modules/@opentelemetry/sdk-logs/build/esm/export/BatchLogRecordProcessorBase.js +19 -4
- package/node_modules/@opentelemetry/sdk-logs/build/esm/export/LogRecordProcessorMetrics.js +63 -0
- package/node_modules/@opentelemetry/sdk-logs/build/esm/export/{SdkLogRecord.js → ReadWriteLogRecord.js} +1 -1
- package/node_modules/@opentelemetry/sdk-logs/build/esm/export/SimpleLogRecordProcessor.js +10 -0
- package/node_modules/@opentelemetry/sdk-logs/build/esm/internal/LoggerProviderSharedState.js +2 -4
- package/node_modules/@opentelemetry/sdk-logs/build/esm/semconv.js +106 -0
- package/node_modules/@opentelemetry/sdk-logs/build/esm/version.js +1 -1
- package/node_modules/@opentelemetry/sdk-logs/build/esnext/LogRecordImpl.js +33 -6
- package/node_modules/@opentelemetry/sdk-logs/build/esnext/LoggerProvider.js +3 -4
- package/node_modules/@opentelemetry/sdk-logs/build/esnext/MultiLogRecordProcessor.js +3 -5
- package/node_modules/@opentelemetry/sdk-logs/build/esnext/export/BatchLogRecordProcessorBase.js +19 -4
- package/node_modules/@opentelemetry/sdk-logs/build/esnext/export/LogRecordProcessorMetrics.js +63 -0
- package/node_modules/@opentelemetry/sdk-logs/build/esnext/export/{SdkLogRecord.js → ReadWriteLogRecord.js} +1 -1
- package/node_modules/@opentelemetry/sdk-logs/build/esnext/export/SimpleLogRecordProcessor.js +10 -0
- package/node_modules/@opentelemetry/sdk-logs/build/esnext/internal/LoggerProviderSharedState.js +2 -4
- package/node_modules/@opentelemetry/sdk-logs/build/esnext/semconv.js +106 -0
- package/node_modules/@opentelemetry/sdk-logs/build/esnext/version.js +1 -1
- package/node_modules/@opentelemetry/sdk-logs/build/src/LogRecordImpl.js +33 -6
- package/node_modules/@opentelemetry/sdk-logs/build/src/LoggerProvider.js +3 -4
- package/node_modules/@opentelemetry/sdk-logs/build/src/MultiLogRecordProcessor.js +3 -5
- package/node_modules/@opentelemetry/sdk-logs/build/src/export/BatchLogRecordProcessorBase.js +18 -3
- package/node_modules/@opentelemetry/sdk-logs/build/src/export/LogRecordProcessorMetrics.js +67 -0
- package/node_modules/@opentelemetry/sdk-logs/build/src/export/{SdkLogRecord.js → ReadWriteLogRecord.js} +1 -1
- package/node_modules/@opentelemetry/sdk-logs/build/src/export/SimpleLogRecordProcessor.js +10 -0
- package/node_modules/@opentelemetry/sdk-logs/build/src/internal/LoggerProviderSharedState.js +2 -4
- package/node_modules/@opentelemetry/sdk-logs/build/src/semconv.js +107 -1
- package/node_modules/@opentelemetry/sdk-logs/build/src/utils/validation.js +1 -1
- package/node_modules/@opentelemetry/sdk-logs/build/src/version.js +1 -1
- package/node_modules/@opentelemetry/sdk-logs/package.json +11 -11
- package/node_modules/@opentelemetry/sdk-metrics/build/esm/aggregator/ExponentialHistogram.js +3 -3
- package/node_modules/@opentelemetry/sdk-metrics/build/esm/aggregator/exponential-histogram/mapping/ExponentMapping.js +3 -8
- package/node_modules/@opentelemetry/sdk-metrics/build/esm/aggregator/exponential-histogram/mapping/LogarithmMapping.js +1 -1
- package/node_modules/@opentelemetry/sdk-metrics/build/esm/aggregator/exponential-histogram/mapping/ieee754.js +24 -23
- package/node_modules/@opentelemetry/sdk-metrics/build/esm/version.js +1 -1
- package/node_modules/@opentelemetry/sdk-metrics/build/esm/view/Aggregation.js +4 -8
- package/node_modules/@opentelemetry/sdk-metrics/build/esnext/aggregator/ExponentialHistogram.js +3 -3
- package/node_modules/@opentelemetry/sdk-metrics/build/esnext/aggregator/exponential-histogram/mapping/ExponentMapping.js +3 -8
- package/node_modules/@opentelemetry/sdk-metrics/build/esnext/aggregator/exponential-histogram/mapping/LogarithmMapping.js +1 -1
- package/node_modules/@opentelemetry/sdk-metrics/build/esnext/aggregator/exponential-histogram/mapping/ieee754.js +24 -23
- package/node_modules/@opentelemetry/sdk-metrics/build/esnext/version.js +1 -1
- package/node_modules/@opentelemetry/sdk-metrics/build/esnext/view/Aggregation.js +4 -8
- package/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/ExponentialHistogram.js +3 -3
- package/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/ExponentMapping.js +3 -8
- package/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/LogarithmMapping.js +1 -1
- package/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/ieee754.js +26 -25
- package/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/types.js +1 -1
- package/node_modules/@opentelemetry/sdk-metrics/build/src/export/AggregationTemporality.js +1 -1
- package/node_modules/@opentelemetry/sdk-metrics/build/src/export/MetricData.js +2 -2
- package/node_modules/@opentelemetry/sdk-metrics/build/src/version.js +1 -1
- package/node_modules/@opentelemetry/sdk-metrics/build/src/view/AggregationOption.js +1 -1
- package/node_modules/@opentelemetry/sdk-metrics/package.json +9 -9
- package/node_modules/@opentelemetry/sdk-trace/build/esm/TracerProvider.js +2 -2
- package/node_modules/@opentelemetry/sdk-trace/build/esm/export/SimpleSpanProcessor.js +19 -3
- package/node_modules/@opentelemetry/sdk-trace/build/esm/sampler/TraceIdRatioBasedSampler.js +2 -1
- package/node_modules/@opentelemetry/sdk-trace/build/esm/version.js +1 -1
- package/node_modules/@opentelemetry/sdk-trace/build/esnext/TracerProvider.js +2 -2
- package/node_modules/@opentelemetry/sdk-trace/build/esnext/export/SimpleSpanProcessor.js +19 -3
- package/node_modules/@opentelemetry/sdk-trace/build/esnext/sampler/TraceIdRatioBasedSampler.js +2 -1
- package/node_modules/@opentelemetry/sdk-trace/build/esnext/version.js +1 -1
- package/node_modules/@opentelemetry/sdk-trace/build/src/Sampler.js +1 -1
- package/node_modules/@opentelemetry/sdk-trace/build/src/TracerProvider.js +2 -2
- package/node_modules/@opentelemetry/sdk-trace/build/src/export/SimpleSpanProcessor.js +19 -3
- package/node_modules/@opentelemetry/sdk-trace/build/src/sampler/TraceIdRatioBasedSampler.js +2 -1
- package/node_modules/@opentelemetry/sdk-trace/build/src/version.js +1 -1
- package/node_modules/@opentelemetry/sdk-trace/package.json +11 -10
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +2 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/cache/EndpointCache.js +2 -1
- package/node_modules/@smithy/core/package.json +1 -1
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/package.json +13 -3
- package/node_modules/node-addon-native-custom-loader/package.json +1 -1
- package/node_modules/node-addon-require-builtin/package.json +2 -2
- package/node_modules/node-pty/lib/windowsPtyAgent.js +2 -0
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/ws/lib/permessage-deflate.js +3 -1
- package/node_modules/ws/lib/receiver.js +15 -32
- package/node_modules/ws/lib/websocket-server.js +4 -4
- package/node_modules/ws/lib/websocket.js +4 -4
- package/node_modules/ws/package.json +5 -1
- package/package.json +342 -336
- package/node_modules/@anthropic-ai/sdk/lib/tools/CompactionControl.js +0 -28
- package/node_modules/@anthropic-ai/sdk/lib/tools/CompactionControl.mjs +0 -25
- package/node_modules/@anthropic-ai/sdk/src/lib/tools/CompactionControl.ts +0 -57
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/autofill_manager-CxcaWQiv.js +0 -58
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/explain-CNIdfhW8.js +0 -747
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/main-BLMNMheT.js +0 -755
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/platform-BzB373NB.js +0 -600
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/protocol_monitor-mWRlFT7z.js +0 -2
- package/node_modules/@deepseek-ai/dsh-hook-protocol/README.i18n.yaml +0 -61
- package/node_modules/@deepseek-ai/dsh-hook-protocol/README.md +0 -142
- package/node_modules/@deepseek-ai/dsh-hook-protocol/README.zh.md +0 -142
- package/node_modules/@deepseek-ai/dsh-hook-protocol/lib/index.js +0 -377
- package/node_modules/@deepseek-ai/dsh-hooks-claude-code/README.i18n.yaml +0 -88
- package/node_modules/@deepseek-ai/dsh-hooks-claude-code/README.md +0 -193
- package/node_modules/@deepseek-ai/dsh-hooks-claude-code/README.zh.md +0 -193
- package/node_modules/@deepseek-ai/dsh-hooks-claude-code/lib/index.js +0 -405
- package/node_modules/@deepseek-ai/dsh-hooks-claude-code/package.json +0 -57
- package/node_modules/@deepseek-ai/dsh-hooks-codex/README.i18n.yaml +0 -88
- package/node_modules/@deepseek-ai/dsh-hooks-codex/README.md +0 -188
- package/node_modules/@deepseek-ai/dsh-hooks-codex/README.zh.md +0 -188
- package/node_modules/@deepseek-ai/dsh-hooks-codex/lib/index.js +0 -346
- package/node_modules/@deepseek-ai/dsh-hooks-codex/package.json +0 -55
- package/node_modules/@deepseek-ai/dsh-subagent-in-process-driver/README.i18n.yaml +0 -106
- package/node_modules/@deepseek-ai/dsh-subagent-in-process-driver/README.md +0 -176
- package/node_modules/@deepseek-ai/dsh-subagent-in-process-driver/README.zh.md +0 -176
- package/node_modules/@deepseek-ai/dsh-subagent-in-process-driver/lib/index.js +0 -254
- package/node_modules/@deepseek-ai/dsh-subagent-in-process-driver/package.json +0 -59
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-DBK_Mahs.css +0 -1
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-DjTxlw_T.js +0 -127
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/asciidoc-Ve4PFQV2.js +0 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/cpp-DIPi6g--.js +0 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/r-Dspwwk_N.js +0 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/swift-D82vCrfD.js +0 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/system-verilog-CnnmHF94.js +0 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/verilog-BQ8w6xss.js +0 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/vendor-BNsW4eBh.css +0 -1
- package/node_modules/@deepseek-ai/dsh-webhook/README.i18n.yaml +0 -46
- package/node_modules/@deepseek-ai/dsh-webhook/README.md +0 -86
- package/node_modules/@deepseek-ai/dsh-webhook/README.zh.md +0 -86
- package/node_modules/@deepseek-ai/dsh-webhook/lib/index.js +0 -352
- package/node_modules/@deepseek-ai/dsh-webhook/lib/types/brand.js +0 -26
- package/node_modules/@deepseek-ai/dsh-webhook/lib/types/index.js +0 -138
- package/node_modules/@deepseek-ai/dsh-webhook/lib/types/invariant.js +0 -38
- package/node_modules/@deepseek-ai/dsh-webhook/lib/types/session.js +0 -211
- package/node_modules/@deepseek-ai/dsh-webhook/lib/types/types.js +0 -3
- package/node_modules/@deepseek-ai/dsh-webhook/package.json +0 -62
- package/node_modules/@deepseek-ai/dsh-webhook-github/README.i18n.yaml +0 -37
- package/node_modules/@deepseek-ai/dsh-webhook-github/README.md +0 -86
- package/node_modules/@deepseek-ai/dsh-webhook-github/README.zh.md +0 -86
- package/node_modules/@deepseek-ai/dsh-webhook-github/lib/index.js +0 -193
- package/node_modules/@deepseek-ai/dsh-webhook-github/lib/types/body.js +0 -65
- package/node_modules/@deepseek-ai/dsh-webhook-github/lib/types/handler.js +0 -115
- package/node_modules/@deepseek-ai/dsh-webhook-github/lib/types/index.js +0 -39
- package/node_modules/@deepseek-ai/dsh-webhook-github/lib/types/types.js +0 -3
- package/node_modules/@deepseek-ai/dsh-webhook-github/package.json +0 -55
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +0 -14
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js +0 -8
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +0 -1
- package/node_modules/@octokit/openapi-types/LICENSE +0 -7
- package/node_modules/@octokit/openapi-types/README.md +0 -17
- package/node_modules/@octokit/openapi-types/package.json +0 -21
- package/node_modules/@octokit/openapi-webhooks-types/LICENSE +0 -7
- package/node_modules/@octokit/openapi-webhooks-types/README.md +0 -17
- package/node_modules/@octokit/openapi-webhooks-types/package.json +0 -18
- package/node_modules/@octokit/request-error/README.md +0 -93
- package/node_modules/@octokit/request-error/dist-src/index.js +0 -41
- package/node_modules/@octokit/request-error/package.json +0 -50
- package/node_modules/@octokit/types/LICENSE +0 -7
- package/node_modules/@octokit/types/README.md +0 -65
- package/node_modules/@octokit/types/package.json +0 -41
- package/node_modules/@octokit/webhooks/LICENSE.md +0 -20
- package/node_modules/@octokit/webhooks/README.md +0 -786
- package/node_modules/@octokit/webhooks/dist-bundle/index.js +0 -871
- package/node_modules/@octokit/webhooks/dist-src/concat-uint8array.js +0 -22
- package/node_modules/@octokit/webhooks/dist-src/create-logger.js +0 -20
- package/node_modules/@octokit/webhooks/dist-src/event-handler/index.js +0 -27
- package/node_modules/@octokit/webhooks/dist-src/event-handler/on.js +0 -31
- package/node_modules/@octokit/webhooks/dist-src/event-handler/receive.js +0 -61
- package/node_modules/@octokit/webhooks/dist-src/event-handler/remove-listener.js +0 -20
- package/node_modules/@octokit/webhooks/dist-src/event-handler/validate-event-name.js +0 -33
- package/node_modules/@octokit/webhooks/dist-src/event-handler/wrap-error-handler.js +0 -18
- package/node_modules/@octokit/webhooks/dist-src/generated/webhook-identifiers.js +0 -0
- package/node_modules/@octokit/webhooks/dist-src/generated/webhook-names.js +0 -328
- package/node_modules/@octokit/webhooks/dist-src/index.js +0 -48
- package/node_modules/@octokit/webhooks/dist-src/middleware/create-middleware.js +0 -147
- package/node_modules/@octokit/webhooks/dist-src/middleware/node/get-payload.js +0 -30
- package/node_modules/@octokit/webhooks/dist-src/middleware/node/get-request-header.js +0 -6
- package/node_modules/@octokit/webhooks/dist-src/middleware/node/handle-response.js +0 -11
- package/node_modules/@octokit/webhooks/dist-src/middleware/node/index.js +0 -23
- package/node_modules/@octokit/webhooks/dist-src/middleware/web/get-payload.js +0 -6
- package/node_modules/@octokit/webhooks/dist-src/middleware/web/get-request-header.js +0 -6
- package/node_modules/@octokit/webhooks/dist-src/middleware/web/handle-response.js +0 -12
- package/node_modules/@octokit/webhooks/dist-src/middleware/web/index.js +0 -23
- package/node_modules/@octokit/webhooks/dist-src/normalize-trailing-slashes.js +0 -18
- package/node_modules/@octokit/webhooks/dist-src/verify-and-receive.js +0 -33
- package/node_modules/@octokit/webhooks/package.json +0 -54
- package/node_modules/@octokit/webhooks-methods/LICENSE +0 -9
- package/node_modules/@octokit/webhooks-methods/README.md +0 -249
- package/node_modules/@octokit/webhooks-methods/dist-node/index.js +0 -65
- package/node_modules/@octokit/webhooks-methods/dist-src/index.js +0 -22
- package/node_modules/@octokit/webhooks-methods/dist-src/node/sign.js +0 -18
- package/node_modules/@octokit/webhooks-methods/dist-src/node/verify.js +0 -26
- package/node_modules/@octokit/webhooks-methods/dist-src/version.js +0 -4
- package/node_modules/@octokit/webhooks-methods/dist-src/web.js +0 -83
- package/node_modules/@octokit/webhooks-methods/dist-web/index.js +0 -84
- package/node_modules/@octokit/webhooks-methods/package.json +0 -53
- /package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/devtools/chunks/{chunk-DF993M8W.js → rolldown-runtime-DF993M8W.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import z from "@deepseek-ai/schemastery";
|
|
2
2
|
import { scopeTarget } from "@deepseek-ai/dsh-scope";
|
|
3
|
-
import { assertObjectJsonSchema } from "@deepseek-ai/dsh-tools";
|
|
3
|
+
import { ToolArgsError, assertObjectJsonSchema, validateJsonSchemaValue } from "@deepseek-ai/dsh-tools";
|
|
4
4
|
import { canonicalClientTimeZone } from "@deepseek-ai/dsh-util-time";
|
|
5
5
|
import { Remote, RemoteError, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
6
6
|
import { AttachmentError } from "@deepseek-ai/dsh-attachment";
|
|
@@ -8,12 +8,12 @@ import { z as z$1 } from "zod";
|
|
|
8
8
|
import { HarnessError, ReasoningEffortId, boundContextSummary, contentHasImage, createUserMessage, errorChain, joinAssistantStreamText } from "@deepseek-ai/dsh-llm";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
10
10
|
import { foldConsumedWork } from "@deepseek-ai/dsh-agent";
|
|
11
|
-
import {
|
|
11
|
+
import { isAbsolute, resolve } from "node:path";
|
|
12
12
|
import { brandString } from "@deepseek-ai/dsh-brand";
|
|
13
|
-
import {
|
|
13
|
+
import { SessionLogOffset, SessionSeq } from "@deepseek-ai/dsh-session";
|
|
14
|
+
import { assertNever, snapshotJsonValue } from "@deepseek-ai/dsh-util-values";
|
|
14
15
|
import { appendChunkedList, chunkedListSchema, iterateChunkedList } from "@deepseek-ai/dsh-chunked-list";
|
|
15
16
|
import { accessSync, constants, statSync } from "node:fs";
|
|
16
|
-
import { isAbsolute, resolve } from "node:path";
|
|
17
17
|
//#region lib/types/error.js
|
|
18
18
|
/**
|
|
19
19
|
* Typed failures shared by subagent service and provider operations.
|
|
@@ -121,113 +121,13 @@ function assertSubagentMaxDepth(maxDepth) {
|
|
|
121
121
|
if (maxDepth !== void 0 && (typeof maxDepth !== "number" || !Number.isSafeInteger(maxDepth) || maxDepth < 0 || Object.is(maxDepth, -0))) throw new TypeError("subagent maxDepth must be a non-negative safe integer");
|
|
122
122
|
}
|
|
123
123
|
//#endregion
|
|
124
|
-
//#region lib/types/assistant-output.js
|
|
125
|
-
/**
|
|
126
|
-
* Canonical selection of a child's final assistant output. Backend run results
|
|
127
|
-
* and `subagent/end.lastAssistantMessage` apply the same rule: select the last
|
|
128
|
-
* non-empty assistant message. An empty-content message records usage only
|
|
129
|
-
* when the loop appends it after a max-tokens step with no executable blocks,
|
|
130
|
-
* so it does not replace earlier output. If no non-empty message exists,
|
|
131
|
-
* select the accumulated assistant text. Selection is independent of the
|
|
132
|
-
* run's stop reason.
|
|
133
|
-
*
|
|
134
|
-
* @module @deepseek-ai/dsh-subagent/assistant-output
|
|
135
|
-
*/
|
|
136
|
-
/**
|
|
137
|
-
* Incremental fold of the selection rule, for backends that observe a child's
|
|
138
|
-
* output as it streams: session-event backends {@link push} each event, and
|
|
139
|
-
* transports without session events (ACP content chunks) {@link pushText} raw
|
|
140
|
-
* text into the same streamed fallback.
|
|
141
|
-
*/
|
|
142
|
-
var AssistantOutputFold = class {
|
|
143
|
-
message;
|
|
144
|
-
partial = [];
|
|
145
|
-
/**
|
|
146
|
-
* Fold one session event: a non-empty assistant message becomes the
|
|
147
|
-
* candidate final answer, while its embedded stream and any log-only attempt
|
|
148
|
-
* extend the streamed fallback; every other event contributes nothing.
|
|
149
|
-
* @param event - the next observed session event.
|
|
150
|
-
*/
|
|
151
|
-
push(event) {
|
|
152
|
-
if (event.type === "assistant/message") {
|
|
153
|
-
const content = event.data.message.content;
|
|
154
|
-
if (content.length > 0) this.message = content;
|
|
155
|
-
}
|
|
156
|
-
if (event.type === "assistant/message" || event.type === "assistant/attempt") this.pushText(joinAssistantStreamText(event.data.stream));
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Extend the streamed fallback with text observed outside session events.
|
|
160
|
-
* @param text - the next streamed text piece (an empty piece is a no-op).
|
|
161
|
-
*/
|
|
162
|
-
pushText(text) {
|
|
163
|
-
if (text.length > 0) this.partial.push(text);
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Select the final output folded so far.
|
|
167
|
-
* @returns the last non-empty assistant message, else the accumulated
|
|
168
|
-
* streamed text, or `undefined` when the child produced neither.
|
|
169
|
-
*/
|
|
170
|
-
collect() {
|
|
171
|
-
if (this.message !== void 0) return this.message;
|
|
172
|
-
const text = this.partial.join("");
|
|
173
|
-
return text.length > 0 ? [{
|
|
174
|
-
type: "text",
|
|
175
|
-
text
|
|
176
|
-
}] : void 0;
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
/**
|
|
180
|
-
* Apply the selection rule to one complete child-owned event suffix.
|
|
181
|
-
* @param events - the child-owned events (after any seed or epoch boundary).
|
|
182
|
-
* @returns the selected output, or `undefined` when the child produced none.
|
|
183
|
-
*/
|
|
184
|
-
function finalAssistantOutput(events) {
|
|
185
|
-
const fold = new AssistantOutputFold();
|
|
186
|
-
for (const event of events) fold.push(event);
|
|
187
|
-
return fold.collect();
|
|
188
|
-
}
|
|
189
|
-
//#endregion
|
|
190
|
-
//#region lib/types/diagnostic.js
|
|
191
|
-
/**
|
|
192
|
-
* Byte budget shared by `SubagentResult.diagnostic` and the continuable
|
|
193
|
-
* settlement notice's failure reason.
|
|
194
|
-
*
|
|
195
|
-
* @module @deepseek-ai/dsh-subagent/diagnostic
|
|
196
|
-
*/
|
|
197
|
-
/** Maximum UTF-8 size of `SubagentResult.diagnostic`. */
|
|
198
|
-
const MAX_SUBAGENT_DIAGNOSTIC_BYTES = 4096;
|
|
199
|
-
const DIAGNOSTIC_TRUNCATION_SUFFIX = "\n[diagnostic truncated]";
|
|
200
|
-
const utf8Encoder = new TextEncoder();
|
|
201
|
-
const utf8Decoder = new TextDecoder();
|
|
202
|
-
/**
|
|
203
|
-
* Limit failure detail without splitting a UTF-8 sequence.
|
|
204
|
-
* @param diagnostic - safe diagnostic text produced by a provider or teardown.
|
|
205
|
-
* @returns the original text, or a visibly truncated value within the limit.
|
|
206
|
-
*/
|
|
207
|
-
function limitSubagentDiagnostic(diagnostic) {
|
|
208
|
-
const bytes = utf8Encoder.encode(diagnostic);
|
|
209
|
-
if (bytes.byteLength <= MAX_SUBAGENT_DIAGNOSTIC_BYTES) return diagnostic;
|
|
210
|
-
let prefixBytes = MAX_SUBAGENT_DIAGNOSTIC_BYTES - utf8Encoder.encode(DIAGNOSTIC_TRUNCATION_SUFFIX).byteLength;
|
|
211
|
-
while ((bytes[prefixBytes] & 192) === 128) prefixBytes -= 1;
|
|
212
|
-
return utf8Decoder.decode(bytes.subarray(0, prefixBytes)) + DIAGNOSTIC_TRUNCATION_SUFFIX;
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* Apply the diagnostic byte budget and drop an empty result.
|
|
216
|
-
* @param diagnostic - candidate failure detail, or absent.
|
|
217
|
-
* @returns the limited text, or `undefined` when nothing remains to show.
|
|
218
|
-
*/
|
|
219
|
-
function optionalSubagentDiagnostic(diagnostic) {
|
|
220
|
-
if (diagnostic === void 0 || diagnostic.length === 0) return void 0;
|
|
221
|
-
return limitSubagentDiagnostic(diagnostic);
|
|
222
|
-
}
|
|
223
|
-
//#endregion
|
|
224
124
|
//#region lib/types/types.js
|
|
225
125
|
/**
|
|
226
126
|
* The seam's consumer-facing contracts: request, result, and capability types
|
|
227
127
|
* for {@link SubagentProvider}, plus the `subagent/start` and `subagent/end`
|
|
228
128
|
* payloads that plugins and hosts observe. Internal control interfaces belong
|
|
229
129
|
* with their implementation — the lifecycle observer in `./lifecycle.ts`, the
|
|
230
|
-
*
|
|
130
|
+
* manager host in `./manager.ts` — so this module stays the published
|
|
231
131
|
* surface rather than a bag of everything type-shaped.
|
|
232
132
|
*
|
|
233
133
|
* @module @deepseek-ai/dsh-subagent/types
|
|
@@ -243,17 +143,10 @@ function SubagentRunId(id) {
|
|
|
243
143
|
//#endregion
|
|
244
144
|
//#region lib/types/lifecycle.js
|
|
245
145
|
/**
|
|
246
|
-
* Lifecycle-edge publication for
|
|
247
|
-
* the one-shot run observer, and the continuable Activation observer.
|
|
146
|
+
* Lifecycle-edge publication for managed subagent activations.
|
|
248
147
|
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
* consumer-facing types; this module owns only the implementation and the
|
|
252
|
-
* package-private {@link ActivationObserver} the continuation manager consumes.
|
|
253
|
-
* Keeping the internal control interface out of the published surface is
|
|
254
|
-
* deliberate: the observer's `start`/`capture`/`settle` ordering is a contract
|
|
255
|
-
* between this module and one in-package caller, not something a plugin may
|
|
256
|
-
* depend on.
|
|
148
|
+
* Public event payloads live in `./types.ts`; the package-private observer
|
|
149
|
+
* retains only the identity shared by each start/end pair.
|
|
257
150
|
*
|
|
258
151
|
* @module @deepseek-ai/dsh-subagent/lifecycle
|
|
259
152
|
*/
|
|
@@ -284,40 +177,7 @@ function createLifecycleEmitter(ctx, carrier) {
|
|
|
284
177
|
};
|
|
285
178
|
}
|
|
286
179
|
/**
|
|
287
|
-
*
|
|
288
|
-
* @param emit - the contained lifecycle emitter.
|
|
289
|
-
* @param provider - the provider that established the run.
|
|
290
|
-
* @param parent - the delegating parent keying scoped dispatch.
|
|
291
|
-
* @param run - the published run whose settlement closes the pair.
|
|
292
|
-
* @returns the same run, unchanged.
|
|
293
|
-
*/
|
|
294
|
-
function observeRun(emit, provider, parent, run) {
|
|
295
|
-
const identity = {
|
|
296
|
-
runId: SubagentRunId(randomUUID()),
|
|
297
|
-
provider,
|
|
298
|
-
id: run.id,
|
|
299
|
-
local: run.localAgent !== void 0
|
|
300
|
-
};
|
|
301
|
-
run.result.then((result) => {
|
|
302
|
-
emit("subagent/end", {
|
|
303
|
-
...identity,
|
|
304
|
-
stopReason: result.stopReason,
|
|
305
|
-
...result.output.length === 0 ? {} : { lastAssistantMessage: result.output }
|
|
306
|
-
}, parent);
|
|
307
|
-
}, () => {
|
|
308
|
-
emit("subagent/end", {
|
|
309
|
-
...identity,
|
|
310
|
-
stopReason: "error"
|
|
311
|
-
}, parent);
|
|
312
|
-
});
|
|
313
|
-
emit("subagent/start", identity, parent);
|
|
314
|
-
return run;
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Build the observer for one continuable Activation's residency epoch. Observers
|
|
318
|
-
* see the same vocabulary as a one-shot run, so a child's start and settlement
|
|
319
|
-
* remain observable without exposing whether the manager materialized, woke, or
|
|
320
|
-
* cold-resumed it. Creation failure before residency emits no lifecycle edge.
|
|
180
|
+
* Build the observer for one local or external activation's residency epoch. Creation failure before residency emits no lifecycle edge.
|
|
321
181
|
* @param emit - the contained lifecycle emitter.
|
|
322
182
|
* @param provider - the provider name recorded in the durable descriptor.
|
|
323
183
|
* @param childId - the durable child session id.
|
|
@@ -329,52 +189,23 @@ function createActivationObserver(emit, provider, childId, parent) {
|
|
|
329
189
|
runId: SubagentRunId(randomUUID()),
|
|
330
190
|
provider,
|
|
331
191
|
id: childId,
|
|
332
|
-
local:
|
|
192
|
+
local: false
|
|
333
193
|
};
|
|
334
|
-
let boundary = SessionLogOffset(0);
|
|
335
|
-
let captured = { stopReason: "completed" };
|
|
336
|
-
const terminal = (failure) => resolveActivationTerminal(captured, failure);
|
|
337
194
|
return {
|
|
338
195
|
start: (child) => {
|
|
339
|
-
|
|
196
|
+
identity.local = child !== void 0;
|
|
340
197
|
emit("subagent/start", identity, parent);
|
|
341
198
|
},
|
|
342
|
-
|
|
343
|
-
const own = child.session.snapshotEvents(boundary);
|
|
344
|
-
const output = finalAssistantOutput(own);
|
|
345
|
-
const diagnostic = epochDiagnostic(own);
|
|
346
|
-
captured = {
|
|
347
|
-
stopReason: epochStopReason(own),
|
|
348
|
-
...output === void 0 ? {} : { output },
|
|
349
|
-
...diagnostic === void 0 ? {} : { diagnostic }
|
|
350
|
-
};
|
|
351
|
-
},
|
|
352
|
-
terminal,
|
|
353
|
-
settle: (failure) => {
|
|
354
|
-
const { stopReason, output } = terminal(failure);
|
|
199
|
+
settle: ({ stopReason, output }) => {
|
|
355
200
|
emit("subagent/end", {
|
|
356
201
|
...identity,
|
|
357
202
|
stopReason,
|
|
358
|
-
...output ===
|
|
203
|
+
...output.length === 0 ? {} : { lastAssistantMessage: output }
|
|
359
204
|
}, parent);
|
|
360
205
|
}
|
|
361
206
|
};
|
|
362
207
|
}
|
|
363
208
|
/**
|
|
364
|
-
* Resolve an epoch's terminal facts when teardown succeeds or fails.
|
|
365
|
-
* @param captured - facts captured before ownership release.
|
|
366
|
-
* @param failure - teardown or durability failure.
|
|
367
|
-
* @returns terminal facts safe for parent delivery.
|
|
368
|
-
*/
|
|
369
|
-
function resolveActivationTerminal(captured, failure) {
|
|
370
|
-
if (failure === void 0) return captured;
|
|
371
|
-
const diagnostic = optionalSubagentDiagnostic(captured.diagnostic) ?? optionalSubagentDiagnostic(errorChain(failure));
|
|
372
|
-
return {
|
|
373
|
-
stopReason: "error",
|
|
374
|
-
...diagnostic === void 0 ? {} : { diagnostic }
|
|
375
|
-
};
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
209
|
* Why this child's epoch ended, for the terminal lifecycle edge and the
|
|
379
210
|
* manager's own parent delivery. The child's own log is authoritative:
|
|
380
211
|
* teardown succeeding says nothing about whether the model errored, hit its
|
|
@@ -407,15 +238,6 @@ function epochStopReason(events) {
|
|
|
407
238
|
default: return "error";
|
|
408
239
|
}
|
|
409
240
|
}
|
|
410
|
-
/**
|
|
411
|
-
* Return the recorded failure detail when this epoch ended in error.
|
|
412
|
-
* @param events - this epoch's event suffix.
|
|
413
|
-
* @returns limited error text, when available.
|
|
414
|
-
*/
|
|
415
|
-
function epochDiagnostic(events) {
|
|
416
|
-
const { end } = foldConsumedWork(events);
|
|
417
|
-
return end?.data.reason.kind === "error" ? optionalSubagentDiagnostic(end.data.reason.error.message) : void 0;
|
|
418
|
-
}
|
|
419
241
|
/** Render any listener-thrown value without letting coercion escape containment. */
|
|
420
242
|
function renderThrown(value) {
|
|
421
243
|
try {
|
|
@@ -429,9 +251,7 @@ function renderThrown(value) {
|
|
|
429
251
|
/**
|
|
430
252
|
* Shared in-process child composition: the delegation-depth budget, the
|
|
431
253
|
* durable session metadata, the resolved child `AgentOptions`, the delegated
|
|
432
|
-
* policy seed, and the scoped setup
|
|
433
|
-
* provider driver and the continuation manager compose children this way, so
|
|
434
|
-
* depth accounting, lineage stamping, and delegation policy have one home.
|
|
254
|
+
* policy seed, and the scoped setup used by local activations.
|
|
435
255
|
*
|
|
436
256
|
* @module @deepseek-ai/dsh-subagent/child-agent
|
|
437
257
|
*/
|
|
@@ -667,20 +487,17 @@ function withContinuableReturnGuidance(parentId, prompt) {
|
|
|
667
487
|
* the parent's own task vocabulary.
|
|
668
488
|
* @param childId - the durable child the parent knows by id.
|
|
669
489
|
* @param stopReason - how the child's last ordinary turn ended.
|
|
670
|
-
* @param
|
|
490
|
+
* @param continuable - whether the child accepts a later message.
|
|
671
491
|
* @returns the model-facing opening line of the settlement notice.
|
|
672
492
|
*/
|
|
673
|
-
function settlementSummary(childId, stopReason,
|
|
493
|
+
function settlementSummary(childId, stopReason, continuable) {
|
|
674
494
|
const subject = `Background subagent ${childId}`;
|
|
675
495
|
switch (stopReason) {
|
|
676
|
-
case "completed": return `${subject} finished and will do no further work unless you send it more.`;
|
|
496
|
+
case "completed": return continuable ? `${subject} finished and will do no further work unless you send it more.` : `${subject} finished. It cannot receive follow-up messages.`;
|
|
677
497
|
case "aborted": return `${subject} was stopped before it finished.`;
|
|
678
498
|
case "max-tokens": return `${subject} ran out of room before it finished.`;
|
|
679
499
|
case "refusal": return `${subject} declined the task.`;
|
|
680
|
-
case "error": {
|
|
681
|
-
const reason = optionalSubagentDiagnostic(diagnostic);
|
|
682
|
-
return reason === void 0 ? `${subject} failed before it finished.` : `${subject} failed before it finished: ${reason}`;
|
|
683
|
-
}
|
|
500
|
+
case "error": return `${subject} failed before it finished.`;
|
|
684
501
|
/* v8 ignore next 4 -- `SubagentResult['stopReason']` is merge-extensible, so this arm
|
|
685
502
|
* needs a backend that adds a variant; an unnameable ending is reported as unfinished
|
|
686
503
|
* rather than silently as success. */
|
|
@@ -689,34 +506,35 @@ function settlementSummary(childId, stopReason, diagnostic) {
|
|
|
689
506
|
}
|
|
690
507
|
/**
|
|
691
508
|
* Build the runtime-owned settlement notice from the child's nonempty closing text.
|
|
692
|
-
* A `stopReason: 'error'` notice appends the stable retry instruction after the
|
|
693
|
-
* closing-message block.
|
|
694
509
|
* @param childId - durable child session id named in the notice.
|
|
695
510
|
* @param terminal - recorded terminal state for the settled Activation.
|
|
511
|
+
* @param continuable - whether the child can accept another task.
|
|
696
512
|
* @returns the durable user-message representation delivered to the parent.
|
|
697
513
|
*/
|
|
698
|
-
function createSettlementMessage(childId, terminal) {
|
|
699
|
-
const summary = settlementSummary(childId, terminal.stopReason,
|
|
700
|
-
const closingText =
|
|
701
|
-
const closing = closingText.length === 0 ? [{
|
|
702
|
-
type: "text",
|
|
703
|
-
text: "It left no closing message."
|
|
704
|
-
}] : [{
|
|
705
|
-
type: "text",
|
|
706
|
-
text: "Its closing message:"
|
|
707
|
-
}, ...closingText];
|
|
708
|
-
const retry = terminal.stopReason === "error" ? [{
|
|
709
|
-
type: "text",
|
|
710
|
-
text: "Do the work directly or retry."
|
|
711
|
-
}] : [];
|
|
514
|
+
function createSettlementMessage(childId, terminal, continuable = true) {
|
|
515
|
+
const summary = settlementSummary(childId, terminal.stopReason, continuable);
|
|
516
|
+
const closingText = terminal.output.flatMap((block) => block.type === "text" && block.text.length > 0 ? [block] : []);
|
|
712
517
|
return createUserMessage({
|
|
713
518
|
content: [
|
|
714
519
|
{
|
|
715
520
|
type: "text",
|
|
716
521
|
text: summary
|
|
717
522
|
},
|
|
718
|
-
...
|
|
719
|
-
|
|
523
|
+
...closingText.length === 0 ? [{
|
|
524
|
+
type: "text",
|
|
525
|
+
text: "It left no closing message."
|
|
526
|
+
}] : [{
|
|
527
|
+
type: "text",
|
|
528
|
+
text: "Its closing message:"
|
|
529
|
+
}, ...closingText],
|
|
530
|
+
...terminal.structured !== void 0 ? [{
|
|
531
|
+
type: "text",
|
|
532
|
+
text: `Structured result: ${JSON.stringify(terminal.structured)}`
|
|
533
|
+
}] : [],
|
|
534
|
+
...terminal.diagnostic !== void 0 ? [{
|
|
535
|
+
type: "text",
|
|
536
|
+
text: terminal.diagnostic
|
|
537
|
+
}] : []
|
|
720
538
|
],
|
|
721
539
|
source: {
|
|
722
540
|
kind: "subagent-settled",
|
|
@@ -727,187 +545,716 @@ function createSettlementMessage(childId, terminal) {
|
|
|
727
545
|
});
|
|
728
546
|
}
|
|
729
547
|
//#endregion
|
|
730
|
-
//#region lib/types/
|
|
548
|
+
//#region lib/types/descriptor.js
|
|
731
549
|
/**
|
|
732
|
-
*
|
|
550
|
+
* The durable subagent-child descriptor: the versioned, model-hidden
|
|
551
|
+
* `subagent/descriptor` session event that identifies every session-backed
|
|
552
|
+
* subagent, including historical one-shot records. The manager appends each
|
|
553
|
+
* continuable child's descriptor inside its initial turn, preserving the
|
|
554
|
+
* declared composition required for cold resume.
|
|
555
|
+
*
|
|
556
|
+
* The descriptor deliberately snapshots explicit fields rather than the
|
|
557
|
+
* merge-extensible `AgentOptions` object: an unrelated extension value cannot
|
|
558
|
+
* make continuation fail merely because it is not JSON, and later composition
|
|
559
|
+
* inputs require a deliberate {@link SUBAGENT_DESCRIPTOR_VERSION} change. It
|
|
560
|
+
* omits `subagentDepth` — cold resume trusts the persisted header's
|
|
561
|
+
* `delegationDepth` as the monotone floor — and `outputSchema`, which belongs
|
|
562
|
+
* to one activation's result contract rather than durable child composition.
|
|
563
|
+
* Per-activation knobs such as `maxTokens` are omitted for the same reason as
|
|
564
|
+
* `outputSchema`: they budget one activation. Cold resume requires the exact
|
|
565
|
+
* live parent for authorization but reconstructs child options only from the
|
|
566
|
+
* durable descriptor, so it neither restores the prior budget nor inherits
|
|
567
|
+
* the parent's current one; the resumed route's defaults apply instead.
|
|
733
568
|
*
|
|
734
|
-
* @module @deepseek-ai/dsh-subagent/
|
|
569
|
+
* @module @deepseek-ai/dsh-subagent/descriptor
|
|
735
570
|
*/
|
|
736
|
-
/** Delegate Queue and Steer to one live Agent until its Activation starts closing. */
|
|
737
|
-
var SubagentInbox = class {
|
|
738
|
-
agent;
|
|
739
|
-
closingPromise;
|
|
740
|
-
/**
|
|
741
|
-
* Wrap one live continuable Agent.
|
|
742
|
-
* @param agent - the Agent whose inbox receives accepted deliveries.
|
|
743
|
-
*/
|
|
744
|
-
constructor(agent) {
|
|
745
|
-
this.agent = agent;
|
|
746
|
-
}
|
|
747
|
-
/**
|
|
748
|
-
* Read the Activation's close transaction.
|
|
749
|
-
* @returns the memoized transaction, or `undefined` while delivery remains open.
|
|
750
|
-
*/
|
|
751
|
-
get closing() {
|
|
752
|
-
return this.closingPromise;
|
|
753
|
-
}
|
|
754
|
-
/**
|
|
755
|
-
* Read whether the underlying Agent still has accepted work to claim.
|
|
756
|
-
* @returns whether either Agent inbox destination is non-empty.
|
|
757
|
-
*/
|
|
758
|
-
get hasPending() {
|
|
759
|
-
return this.agent.inbox.nextTurn.length > 0 || this.agent.inbox.nextStep.length > 0;
|
|
760
|
-
}
|
|
761
|
-
/**
|
|
762
|
-
* Submit through the Agent only while its Activation remains resident.
|
|
763
|
-
* @param message - the accepted input to submit.
|
|
764
|
-
* @param delivery - whether to queue a distinct turn or steer the nearest step.
|
|
765
|
-
*/
|
|
766
|
-
deliver(message, delivery) {
|
|
767
|
-
if (this.closingPromise !== void 0) throw new SubagentError(`subagent "${this.agent.id}" activation is being disposed; the message was not accepted`, "ACTIVATION_CLOSING");
|
|
768
|
-
if (delivery === "steer") this.agent.steer(message);
|
|
769
|
-
else this.agent.followup(message);
|
|
770
|
-
}
|
|
771
|
-
/**
|
|
772
|
-
* Close delivery synchronously and share one asynchronous release.
|
|
773
|
-
* @param release - the one release operation to start after closing admission.
|
|
774
|
-
* @returns the memoized release transaction.
|
|
775
|
-
*/
|
|
776
|
-
close(release) {
|
|
777
|
-
const existing = this.closingPromise;
|
|
778
|
-
if (existing !== void 0) return existing;
|
|
779
|
-
const completion = Promise.withResolvers();
|
|
780
|
-
this.closingPromise = completion.promise;
|
|
781
|
-
release().then(completion.resolve, completion.reject);
|
|
782
|
-
return completion.promise;
|
|
783
|
-
}
|
|
784
|
-
};
|
|
785
|
-
//#endregion
|
|
786
|
-
//#region lib/types/continuation-activation.js
|
|
787
571
|
/**
|
|
788
|
-
*
|
|
789
|
-
*
|
|
790
|
-
*
|
|
791
|
-
*
|
|
792
|
-
* every mutable residency decision to this registry, so delivery and teardown
|
|
793
|
-
* share one child lock and one Activation map.
|
|
794
|
-
*
|
|
795
|
-
* @module @deepseek-ai/dsh-subagent/continuation-activation
|
|
572
|
+
* The current descriptor format version, stamped into every appended
|
|
573
|
+
* `subagent/descriptor` event and required verbatim by {@link foldSubagentDescriptor}.
|
|
574
|
+
* Supporting another composition input is a deliberate version change, never
|
|
575
|
+
* an implicit extra field.
|
|
796
576
|
*/
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
577
|
+
const SUBAGENT_DESCRIPTOR_VERSION = 3;
|
|
578
|
+
const DESCRIPTOR_BASE_KEYS = [
|
|
579
|
+
"version",
|
|
580
|
+
"mode",
|
|
581
|
+
"provider",
|
|
582
|
+
"label"
|
|
583
|
+
];
|
|
584
|
+
const ONE_SHOT_DESCRIPTOR_KEYS = new Set(DESCRIPTOR_BASE_KEYS);
|
|
585
|
+
const CONTINUABLE_DESCRIPTOR_KEYS = new Set([
|
|
586
|
+
...DESCRIPTOR_BASE_KEYS,
|
|
587
|
+
"agentProvider",
|
|
588
|
+
"agentModel",
|
|
589
|
+
"agentReasoningEffort",
|
|
590
|
+
"persona",
|
|
591
|
+
"toolFilter"
|
|
592
|
+
]);
|
|
593
|
+
const TOOL_FILTER_KEYS = new Set(["allow", "deny"]);
|
|
594
|
+
/** Whether a persisted JSON value is an object record. */
|
|
595
|
+
function isRecord(value) {
|
|
596
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
597
|
+
}
|
|
598
|
+
/** Reject fields outside one versioned record's declared schema. */
|
|
599
|
+
function assertKnownKeys(value, keys, path) {
|
|
600
|
+
const unknown = Object.keys(value).find((key) => !keys.has(key));
|
|
601
|
+
if (unknown !== void 0) throw new Error(`persisted subagent descriptor ${path} has unknown field "${unknown}"`);
|
|
602
|
+
}
|
|
603
|
+
/** Read one optional string field from a persisted descriptor record. */
|
|
604
|
+
function optionalString(value, key) {
|
|
605
|
+
if (!Object.hasOwn(value, key)) return void 0;
|
|
606
|
+
const field = value[key];
|
|
607
|
+
if (typeof field !== "string") throw new Error(`persisted subagent descriptor ${key} must be a string`);
|
|
608
|
+
return field;
|
|
609
|
+
}
|
|
610
|
+
/** Read one optional string-array field from a persisted tool restriction. */
|
|
611
|
+
function optionalStringArray(value, key) {
|
|
612
|
+
if (!Object.hasOwn(value, key)) return void 0;
|
|
613
|
+
const field = value[key];
|
|
614
|
+
if (!Array.isArray(field)) throw new Error(`persisted subagent descriptor toolFilter.${key} must be an array of strings`);
|
|
615
|
+
const items = field;
|
|
616
|
+
if (items.some((item) => typeof item !== "string")) throw new Error(`persisted subagent descriptor toolFilter.${key} must be an array of strings`);
|
|
617
|
+
return items;
|
|
618
|
+
}
|
|
619
|
+
/** Validate and reconstruct a persisted tool restriction. */
|
|
620
|
+
function parseToolFilter(value) {
|
|
621
|
+
if (!isRecord(value)) throw new Error("persisted subagent descriptor toolFilter must be an object");
|
|
622
|
+
assertKnownKeys(value, TOOL_FILTER_KEYS, "toolFilter");
|
|
623
|
+
const allow = optionalStringArray(value, "allow");
|
|
624
|
+
const deny = optionalStringArray(value, "deny");
|
|
625
|
+
if (allow === void 0 && deny === void 0) throw new Error("persisted subagent descriptor toolFilter must declare allow and/or deny");
|
|
626
|
+
return {
|
|
627
|
+
...allow !== void 0 ? { allow } : {},
|
|
628
|
+
...deny !== void 0 ? { deny } : {}
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
/** Validate one persisted descriptor payload for the current runtime. */
|
|
632
|
+
function parseSubagentDescriptor(value) {
|
|
633
|
+
if (!isRecord(value)) throw new Error("persisted subagent descriptor payload must be an object");
|
|
634
|
+
const version = value["version"];
|
|
635
|
+
if (typeof version !== "number") throw new Error("persisted subagent descriptor version must be a number");
|
|
636
|
+
if (version !== 3) return void 0;
|
|
637
|
+
const mode = value["mode"];
|
|
638
|
+
if (mode !== "one-shot" && mode !== "continuable") throw new Error("persisted subagent descriptor mode must be \"one-shot\" or \"continuable\"");
|
|
639
|
+
assertKnownKeys(value, mode === "one-shot" ? ONE_SHOT_DESCRIPTOR_KEYS : CONTINUABLE_DESCRIPTOR_KEYS, "payload");
|
|
640
|
+
const provider = value["provider"];
|
|
641
|
+
if (typeof provider !== "string") throw new Error("persisted subagent descriptor provider must be a string");
|
|
642
|
+
if (mode === "one-shot") {
|
|
643
|
+
const label = optionalString(value, "label");
|
|
644
|
+
return {
|
|
645
|
+
version: 3,
|
|
646
|
+
mode,
|
|
647
|
+
provider,
|
|
648
|
+
...label !== void 0 ? { label } : {}
|
|
807
649
|
};
|
|
808
650
|
}
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
651
|
+
const label = value["label"];
|
|
652
|
+
if (typeof label !== "string") throw new Error("persisted subagent descriptor label must be a string");
|
|
653
|
+
const agentProvider = optionalString(value, "agentProvider");
|
|
654
|
+
const agentModel = optionalString(value, "agentModel");
|
|
655
|
+
const agentReasoningEffort = optionalString(value, "agentReasoningEffort");
|
|
656
|
+
const persona = optionalString(value, "persona");
|
|
657
|
+
const toolFilter = Object.hasOwn(value, "toolFilter") ? parseToolFilter(value["toolFilter"]) : void 0;
|
|
658
|
+
return {
|
|
659
|
+
version: 3,
|
|
660
|
+
mode,
|
|
661
|
+
provider,
|
|
662
|
+
label,
|
|
663
|
+
...agentProvider !== void 0 ? { agentProvider } : {},
|
|
664
|
+
...agentModel !== void 0 ? { agentModel } : {},
|
|
665
|
+
...agentReasoningEffort !== void 0 ? { agentReasoningEffort } : {},
|
|
666
|
+
...persona !== void 0 ? { persona } : {},
|
|
667
|
+
...toolFilter !== void 0 ? { toolFilter } : {}
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* Validate and detach a continuable descriptor input.
|
|
672
|
+
* @param input - the caller-collected continuable composition fields.
|
|
673
|
+
* @returns the versioned, detached continuable descriptor payload.
|
|
674
|
+
* @throws when a field is not losslessly JSON-serializable.
|
|
675
|
+
*/
|
|
676
|
+
function snapshotSubagentDescriptor(input) {
|
|
677
|
+
const snapshot = snapshotJsonValue({
|
|
678
|
+
version: 3,
|
|
679
|
+
mode: input.mode,
|
|
680
|
+
provider: input.provider,
|
|
681
|
+
label: input.label,
|
|
682
|
+
...input.agentProvider !== void 0 ? { agentProvider: input.agentProvider } : {},
|
|
683
|
+
...input.agentModel !== void 0 ? { agentModel: input.agentModel } : {},
|
|
684
|
+
...input.agentReasoningEffort !== void 0 ? { agentReasoningEffort: input.agentReasoningEffort } : {},
|
|
685
|
+
...input.persona !== void 0 ? { persona: input.persona } : {},
|
|
686
|
+
...input.toolFilter !== void 0 ? { toolFilter: input.toolFilter } : {}
|
|
687
|
+
});
|
|
688
|
+
if (snapshot === void 0) throw new Error("subagent descriptor is not losslessly JSON-serializable");
|
|
689
|
+
return snapshot;
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* Fold a persisted child log to its supported descriptor. The first
|
|
693
|
+
* `subagent/descriptor` event is authoritative — the establishing provider
|
|
694
|
+
* appends exactly one, so a later same-type event cannot rewrite the declared
|
|
695
|
+
* composition.
|
|
696
|
+
* @param events - the loaded child session events.
|
|
697
|
+
* @returns the descriptor, or `undefined` when the log has none or its
|
|
698
|
+
* version is not {@link SUBAGENT_DESCRIPTOR_VERSION} (the child cannot be
|
|
699
|
+
* classified by this runtime).
|
|
700
|
+
* @throws when a current-version persisted payload does not match its complete
|
|
701
|
+
* declared schema.
|
|
702
|
+
*/
|
|
703
|
+
function foldSubagentDescriptor(events) {
|
|
704
|
+
const event = events.find((candidate) => candidate.type === "subagent/descriptor");
|
|
705
|
+
if (event === void 0) return void 0;
|
|
706
|
+
return parseSubagentDescriptor(event.data);
|
|
707
|
+
}
|
|
708
|
+
const sessionIdSchema = z$1.string();
|
|
709
|
+
const oneShotCatalogSchema = z$1.object({
|
|
710
|
+
version: z$1.union([z$1.literal(0), z$1.literal(1)]),
|
|
711
|
+
childId: sessionIdSchema,
|
|
712
|
+
childCreatedAt: z$1.number().int().nonnegative(),
|
|
713
|
+
mode: z$1.literal("one-shot"),
|
|
714
|
+
label: z$1.string().optional()
|
|
715
|
+
}).strict();
|
|
716
|
+
const continuableCatalogSchema = z$1.object({
|
|
717
|
+
version: z$1.union([z$1.literal(0), z$1.literal(1)]),
|
|
718
|
+
childId: sessionIdSchema,
|
|
719
|
+
childCreatedAt: z$1.number().int().nonnegative(),
|
|
720
|
+
mode: z$1.literal("continuable"),
|
|
721
|
+
label: z$1.string()
|
|
722
|
+
}).strict();
|
|
723
|
+
const externalCatalogSchema = oneShotCatalogSchema.extend({
|
|
724
|
+
version: z$1.literal(2),
|
|
725
|
+
mode: z$1.literal("external")
|
|
726
|
+
});
|
|
727
|
+
const unknownCatalogSchema = oneShotCatalogSchema.extend({
|
|
728
|
+
version: z$1.literal(1),
|
|
729
|
+
mode: z$1.literal("unknown")
|
|
730
|
+
});
|
|
731
|
+
const eventDataSchema = z$1.union([
|
|
732
|
+
oneShotCatalogSchema,
|
|
733
|
+
externalCatalogSchema,
|
|
734
|
+
continuableCatalogSchema,
|
|
735
|
+
unknownCatalogSchema
|
|
736
|
+
]);
|
|
737
|
+
const viewSchema = z$1.array(z$1.union([
|
|
738
|
+
oneShotCatalogSchema.omit({
|
|
739
|
+
version: true,
|
|
740
|
+
childId: true,
|
|
741
|
+
childCreatedAt: true
|
|
742
|
+
}).extend({
|
|
743
|
+
id: sessionIdSchema,
|
|
744
|
+
createdAt: oneShotCatalogSchema.shape.childCreatedAt
|
|
745
|
+
}),
|
|
746
|
+
externalCatalogSchema.omit({
|
|
747
|
+
version: true,
|
|
748
|
+
childId: true,
|
|
749
|
+
childCreatedAt: true
|
|
750
|
+
}).extend({
|
|
751
|
+
id: sessionIdSchema,
|
|
752
|
+
createdAt: externalCatalogSchema.shape.childCreatedAt
|
|
753
|
+
}),
|
|
754
|
+
continuableCatalogSchema.omit({
|
|
755
|
+
version: true,
|
|
756
|
+
childId: true,
|
|
757
|
+
childCreatedAt: true
|
|
758
|
+
}).extend({
|
|
759
|
+
id: sessionIdSchema,
|
|
760
|
+
createdAt: continuableCatalogSchema.shape.childCreatedAt
|
|
761
|
+
}),
|
|
762
|
+
unknownCatalogSchema.omit({
|
|
763
|
+
version: true,
|
|
764
|
+
childId: true,
|
|
765
|
+
childCreatedAt: true
|
|
766
|
+
}).extend({
|
|
767
|
+
id: sessionIdSchema,
|
|
768
|
+
createdAt: unknownCatalogSchema.shape.childCreatedAt
|
|
769
|
+
})
|
|
770
|
+
]));
|
|
771
|
+
const stateSchema = z$1.object({
|
|
772
|
+
inheritedEventCount: z$1.number().int().nonnegative(),
|
|
773
|
+
head: chunkedListSchema(eventDataSchema).optional()
|
|
774
|
+
}).strict();
|
|
775
|
+
/**
|
|
776
|
+
* Materialize complete and unknown-mode child identities from parent catalog events.
|
|
777
|
+
* @param state - parent catalog fold state.
|
|
778
|
+
* @returns current direct-child rows in parent catalog event order.
|
|
779
|
+
*/
|
|
780
|
+
function subagentCatalogEntries(state) {
|
|
781
|
+
const entries = [];
|
|
782
|
+
for (const data of iterateChunkedList(state.head)) {
|
|
783
|
+
const { version: _version, childId, childCreatedAt, ...descriptor } = data;
|
|
784
|
+
entries.push({
|
|
785
|
+
id: childId,
|
|
786
|
+
createdAt: childCreatedAt,
|
|
787
|
+
...descriptor
|
|
825
788
|
});
|
|
826
|
-
|
|
789
|
+
}
|
|
790
|
+
return entries;
|
|
791
|
+
}
|
|
792
|
+
/** Parent-owned direct-child catalog projection; invalid own facts reject restoration. */
|
|
793
|
+
const subagentCatalogProjectionDefinition = {
|
|
794
|
+
key: "subagentCatalog",
|
|
795
|
+
stateSchema,
|
|
796
|
+
init: (_header, inheritedEventCount) => ({ inheritedEventCount }),
|
|
797
|
+
apply: (state, event) => {
|
|
798
|
+
if (event.type !== "subagent/catalog" || event.seq < state.inheritedEventCount) return state;
|
|
799
|
+
return {
|
|
800
|
+
...state,
|
|
801
|
+
head: appendChunkedList(state.head, eventDataSchema.parse(event.data))
|
|
802
|
+
};
|
|
803
|
+
},
|
|
804
|
+
stateVersion: 6,
|
|
805
|
+
wire: {
|
|
806
|
+
viewSchema,
|
|
807
|
+
view: subagentCatalogEntries
|
|
827
808
|
}
|
|
828
809
|
};
|
|
829
|
-
/**
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
810
|
+
/**
|
|
811
|
+
* Append a complete direct-child discovery fact to its parent Session.
|
|
812
|
+
* @param parent - durable direct parent receiving the discovery fact.
|
|
813
|
+
* @param child - established child's immutable Session metadata.
|
|
814
|
+
* @param descriptor - mode-discriminated creation label frozen with the child.
|
|
815
|
+
*/
|
|
816
|
+
function establishCatalogChild(parent, child, descriptor) {
|
|
817
|
+
parent.append("subagent/catalog", {
|
|
818
|
+
version: 0,
|
|
819
|
+
childId: child.id,
|
|
820
|
+
childCreatedAt: child.createdAt,
|
|
821
|
+
mode: descriptor.mode,
|
|
822
|
+
label: descriptor.label
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
/** Catalog payload version emitted by external execution creation. */
|
|
826
|
+
const EXTERNAL_SUBAGENT_CATALOG_VERSION = 2;
|
|
827
|
+
/**
|
|
828
|
+
* Record an external execution without a local child Session.
|
|
829
|
+
* @param parent - durable direct parent receiving the discovery fact.
|
|
830
|
+
* @param childId - identity returned by the external provider.
|
|
831
|
+
* @param label - display label assigned by the caller.
|
|
832
|
+
*/
|
|
833
|
+
function establishExternalCatalogChild(parent, childId, label) {
|
|
834
|
+
parent.append("subagent/catalog", {
|
|
835
|
+
version: EXTERNAL_SUBAGENT_CATALOG_VERSION,
|
|
836
|
+
childId,
|
|
837
|
+
childCreatedAt: Date.now(),
|
|
838
|
+
mode: "external",
|
|
839
|
+
label
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
//#endregion
|
|
843
|
+
//#region lib/types/internal.js
|
|
844
|
+
/**
|
|
845
|
+
* Continuation integration markers and host adapters outside the public
|
|
846
|
+
* Service Definition and model-facing Agent messaging contract.
|
|
847
|
+
* @module @deepseek-ai/dsh-subagent/internal
|
|
848
|
+
*/
|
|
849
|
+
/** Process-stable identity carried only by the standard adjacent-Agent messaging tool. */
|
|
850
|
+
const adjacentAgentSendMessageTool = Symbol.for("dsh.subagent.adjacentAgentSendMessageTool");
|
|
851
|
+
/**
|
|
852
|
+
* Test whether one visible definition is the standard adjacent-Agent messaging tool.
|
|
853
|
+
* @param definition - the scope-resolved `send_message` candidate.
|
|
854
|
+
* @returns whether the definition carries the internal standard-tool identity.
|
|
855
|
+
*/
|
|
856
|
+
function isAdjacentAgentSendMessageTool(definition) {
|
|
857
|
+
return definition !== void 0 && definition[adjacentAgentSendMessageTool] === true;
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* Process-stable symbol-keyed host delivery shared by the bundled runtime
|
|
861
|
+
* entry and this unbundled internal subpath.
|
|
862
|
+
* @internal
|
|
863
|
+
*/
|
|
864
|
+
const deliverSubagentPrompt = Symbol.for("dsh.subagent.deliverPrompt");
|
|
865
|
+
//#endregion
|
|
866
|
+
//#region lib/types/structured.js
|
|
867
|
+
/**
|
|
868
|
+
* Child-scoped structured-output tool, prompt instruction, terminal guard, and authoritative
|
|
869
|
+
* result capture for in-process subagents. Each child registers its real schema on its own
|
|
870
|
+
* scope, so concurrent runs do not interact and disposal leaves no global residue. The prompt
|
|
871
|
+
* contribution is ordinary reconstructed request state.
|
|
872
|
+
*
|
|
873
|
+
* Capture commits only after the authoritative `tools/result` succeeds; PTC mode capture also
|
|
874
|
+
* waits for the enclosing `run_code` result. The terminal result marker and monotonic tool
|
|
875
|
+
* guard prevent later calls from reopening a completed structured run.
|
|
876
|
+
* @module @deepseek-ai/dsh-subagent/structured
|
|
877
|
+
*/
|
|
878
|
+
/** The model-facing tool name a structured child must call to finish. */
|
|
879
|
+
const STRUCTURED_OUTPUT_TOOL = "structured_output";
|
|
880
|
+
/**
|
|
881
|
+
* The instruction registered as the child's trailing scoped prompt section:
|
|
882
|
+
* the demand travels with the
|
|
883
|
+
* tool, as ordinary prompt state of exactly one agent.
|
|
884
|
+
*/
|
|
885
|
+
const STRUCTURED_OUTPUT_INSTRUCTION = `When you have your final answer, you MUST report it by calling the \`${STRUCTURED_OUTPUT_TOOL}\` tool with arguments matching its parameter schema exactly. Do not finish with a plain text answer: only the tool call counts as your result.`;
|
|
886
|
+
/**
|
|
887
|
+
* Attach the scoped capture tool, instruction, and enforcement to a child during
|
|
888
|
+
* its creation window. Child disposal removes every registration.
|
|
889
|
+
* @param childCtx - the child agent's scope context (`setup`'s argument).
|
|
890
|
+
* @param schema - the trusted, already-asserted schema subset to enforce (see
|
|
891
|
+
* `assertObjectJsonSchema` in dsh-tools).
|
|
892
|
+
* @param canComplete - whether accepted input and owned child work have finished.
|
|
893
|
+
* @returns the attachment handle (read `captured()` after the child settles).
|
|
894
|
+
*/
|
|
895
|
+
function attachStructuredRuntime(childCtx, schema, canComplete) {
|
|
844
896
|
/**
|
|
845
|
-
*
|
|
846
|
-
*
|
|
847
|
-
*
|
|
848
|
-
*
|
|
897
|
+
* Validated values staged by the capture tool body, awaiting THEIR OWN
|
|
898
|
+
* authoritative `tools/result` notification. The execution object's identity
|
|
899
|
+
* uniquely identifies a trip through the pipeline: adapter call ids may
|
|
900
|
+
* repeat across steps, but another execution can never reach this Map
|
|
901
|
+
* entry. This is distinct from the opaque `ToolExecutionToken` used to
|
|
902
|
+
* correlate nested transports. The final notification always deletes its own
|
|
903
|
+
* stage, whether the result succeeded or failed.
|
|
849
904
|
*/
|
|
850
|
-
|
|
851
|
-
|
|
905
|
+
const staged = /* @__PURE__ */ new Map();
|
|
906
|
+
/** Successful nested capture waiting for its enclosing transport to commit. */
|
|
907
|
+
let pending;
|
|
908
|
+
let captured;
|
|
909
|
+
const schemaEntry = {
|
|
910
|
+
name: STRUCTURED_OUTPUT_TOOL,
|
|
911
|
+
description: "Report your final structured result. Call this exactly once, when your answer is complete; the arguments must match this tool's parameter schema exactly.",
|
|
912
|
+
parameters: { ...schema }
|
|
913
|
+
};
|
|
914
|
+
childCtx.tools.register({
|
|
915
|
+
...schemaEntry,
|
|
916
|
+
output: {
|
|
917
|
+
schema: {
|
|
918
|
+
type: "object",
|
|
919
|
+
properties: { recorded: {
|
|
920
|
+
type: "boolean",
|
|
921
|
+
const: true
|
|
922
|
+
} },
|
|
923
|
+
required: ["recorded"],
|
|
924
|
+
additionalProperties: false
|
|
925
|
+
},
|
|
926
|
+
render: () => [{
|
|
927
|
+
type: "text",
|
|
928
|
+
text: "Structured output recorded."
|
|
929
|
+
}]
|
|
930
|
+
},
|
|
931
|
+
execute(args, exec) {
|
|
932
|
+
const violations = validateJsonSchemaValue(schema, args);
|
|
933
|
+
if (violations.length > 0) throw new ToolArgsError(violations);
|
|
934
|
+
if (!canComplete()) throw new Error("Wait for all delegated child tasks to finish and process pending messages before submitting structured output.");
|
|
935
|
+
staged.set(exec, { value: args });
|
|
936
|
+
exec.concludeTurn();
|
|
937
|
+
return Promise.resolve({ recorded: true });
|
|
938
|
+
}
|
|
939
|
+
});
|
|
940
|
+
childCtx.systemPrompt.section({
|
|
941
|
+
name: `tool:${STRUCTURED_OUTPUT_TOOL}`,
|
|
942
|
+
order: childCtx.systemPrompt.getSectionOrder("STRUCTURED_OUTPUT"),
|
|
943
|
+
text: STRUCTURED_OUTPUT_INSTRUCTION
|
|
944
|
+
});
|
|
945
|
+
childCtx.tools.guard((exec) => captured === void 0 && pending === void 0 ? void 0 : `structured output already recorded: the run is complete, so \`${exec.name}\` is not executed`);
|
|
946
|
+
childCtx.on("tools/result", function(exec, result) {
|
|
947
|
+
if (exec.name === "structured_output") {
|
|
948
|
+
const entry = staged.get(exec);
|
|
949
|
+
if (entry === void 0) return;
|
|
950
|
+
staged.delete(exec);
|
|
951
|
+
if (result.isError) return;
|
|
952
|
+
if (exec.parent === void 0) {
|
|
953
|
+
/* v8 ignore else -- sequential agent-loop dispatch lets the guard block every later supported call */
|
|
954
|
+
if (captured === void 0) captured = { value: entry.value };
|
|
955
|
+
} else if (captured === void 0 && pending === void 0) pending = {
|
|
956
|
+
parent: exec.parent,
|
|
957
|
+
value: entry.value
|
|
958
|
+
};
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
if (pending?.parent !== exec.token) return;
|
|
962
|
+
const entry = pending;
|
|
963
|
+
pending = void 0;
|
|
964
|
+
if (result.isError) return;
|
|
965
|
+
/* v8 ignore else -- PTC mode serializes outer executions, so the guard blocks every later supported call */
|
|
966
|
+
if (captured === void 0) captured = { value: entry.value };
|
|
967
|
+
});
|
|
968
|
+
return {
|
|
969
|
+
captured: () => captured,
|
|
970
|
+
acceptsInput: () => staged.size === 0 && pending === void 0 && captured === void 0
|
|
971
|
+
};
|
|
972
|
+
}
|
|
973
|
+
//#endregion
|
|
974
|
+
//#region lib/types/assistant-output.js
|
|
975
|
+
/**
|
|
976
|
+
* Canonical selection of a child's final assistant output. Backend run results
|
|
977
|
+
* and `subagent/end.lastAssistantMessage` apply the same rule: select the last
|
|
978
|
+
* non-empty assistant message. An empty-content message records usage only
|
|
979
|
+
* when the loop appends it after a max-tokens step with no executable blocks,
|
|
980
|
+
* so it does not replace earlier output. If no non-empty message exists,
|
|
981
|
+
* select the accumulated assistant text. Selection is independent of the
|
|
982
|
+
* run's stop reason.
|
|
983
|
+
*
|
|
984
|
+
* @module @deepseek-ai/dsh-subagent/assistant-output
|
|
985
|
+
*/
|
|
986
|
+
/**
|
|
987
|
+
* Incremental fold of the selection rule, for backends that observe a child's
|
|
988
|
+
* output as it streams: session-event backends {@link push} each event, and
|
|
989
|
+
* transports without session events (ACP content chunks) {@link pushText} raw
|
|
990
|
+
* text into the same streamed fallback.
|
|
991
|
+
*/
|
|
992
|
+
var AssistantOutputFold = class {
|
|
993
|
+
message;
|
|
994
|
+
partial = [];
|
|
852
995
|
/**
|
|
853
|
-
*
|
|
854
|
-
*
|
|
855
|
-
*
|
|
996
|
+
* Fold one session event: a non-empty assistant message becomes the
|
|
997
|
+
* candidate final answer, while its embedded stream and any log-only attempt
|
|
998
|
+
* extend the streamed fallback; every other event contributes nothing.
|
|
999
|
+
* @param event - the next observed session event.
|
|
856
1000
|
*/
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
ctx.on("agent/disposed", ({ agent }) => {
|
|
864
|
-
this.closingScopes.delete(agent);
|
|
865
|
-
});
|
|
866
|
-
ctx.effect(function* () {
|
|
867
|
-
yield scope.dispose;
|
|
868
|
-
yield () => this.drain();
|
|
869
|
-
}.bind(this), "subagents.continuations()");
|
|
1001
|
+
push(event) {
|
|
1002
|
+
if (event.type === "assistant/message") {
|
|
1003
|
+
const content = event.data.message.content;
|
|
1004
|
+
if (content.length > 0) this.message = content;
|
|
1005
|
+
}
|
|
1006
|
+
if (event.type === "assistant/message" || event.type === "assistant/attempt") this.pushText(joinAssistantStreamText(event.data.stream));
|
|
870
1007
|
}
|
|
871
1008
|
/**
|
|
872
|
-
*
|
|
873
|
-
* @param
|
|
874
|
-
* @returns the process-local Activation, or `undefined` when it is not resident.
|
|
1009
|
+
* Extend the streamed fallback with text observed outside session events.
|
|
1010
|
+
* @param text - the next streamed text piece (an empty piece is a no-op).
|
|
875
1011
|
*/
|
|
876
|
-
|
|
877
|
-
|
|
1012
|
+
pushText(text) {
|
|
1013
|
+
if (text.length > 0) this.partial.push(text);
|
|
878
1014
|
}
|
|
879
1015
|
/**
|
|
880
|
-
*
|
|
881
|
-
* @
|
|
1016
|
+
* Select the final output folded so far.
|
|
1017
|
+
* @returns the last non-empty assistant message, else the accumulated
|
|
1018
|
+
* streamed text, or `undefined` when the child produced neither.
|
|
882
1019
|
*/
|
|
883
|
-
|
|
884
|
-
if (this.
|
|
1020
|
+
collect() {
|
|
1021
|
+
if (this.message !== void 0) return this.message;
|
|
1022
|
+
const text = this.partial.join("");
|
|
1023
|
+
return text.length > 0 ? [{
|
|
1024
|
+
type: "text",
|
|
1025
|
+
text
|
|
1026
|
+
}] : void 0;
|
|
885
1027
|
}
|
|
1028
|
+
};
|
|
1029
|
+
/**
|
|
1030
|
+
* Apply the selection rule to one complete child-owned event suffix.
|
|
1031
|
+
* @param events - the child-owned events (after any seed or epoch boundary).
|
|
1032
|
+
* @returns the selected output, or `undefined` when the child produced none.
|
|
1033
|
+
*/
|
|
1034
|
+
function finalAssistantOutput(events) {
|
|
1035
|
+
const fold = new AssistantOutputFold();
|
|
1036
|
+
for (const event of events) fold.push(event);
|
|
1037
|
+
return fold.collect();
|
|
1038
|
+
}
|
|
1039
|
+
//#endregion
|
|
1040
|
+
//#region lib/types/activation.js
|
|
1041
|
+
/** Execution-period records, capacity slots, child serialization, and local output capture.
|
|
1042
|
+
* @module @deepseek-ai/dsh-subagent/activation
|
|
1043
|
+
*/
|
|
1044
|
+
/** Process-local slots shared through uninterrupted continuable parent links. */
|
|
1045
|
+
var ActivationPool = class {
|
|
1046
|
+
slots = /* @__PURE__ */ new Set();
|
|
886
1047
|
/**
|
|
887
|
-
*
|
|
888
|
-
*
|
|
889
|
-
*
|
|
890
|
-
* this call added, and leaves ownership in place once a live Activation for
|
|
891
|
-
* the child exists.
|
|
892
|
-
* @param parent - the live direct parent the operation is admitted under.
|
|
893
|
-
* @param childId - the durable child the operation addresses.
|
|
894
|
-
* @returns the failure-path releaser; a no-op when nothing was added.
|
|
1048
|
+
* Reserve before reconstruction; release also tolerates unpublished rollback.
|
|
1049
|
+
* @param capacity - the maximum simultaneous activations in this pool.
|
|
1050
|
+
* @returns an idempotent slot release.
|
|
895
1051
|
*/
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
if (parentActivation.ownedChildren.has(childId)) return () => {};
|
|
901
|
-
parentActivation.ownedChildren.add(childId);
|
|
1052
|
+
reserve(capacity) {
|
|
1053
|
+
if (this.slots.size >= capacity) throw new SubagentError(`subagent limit reached (active child limit: ${capacity}); wait for an existing child to finish or complete this work with the current agents`, "ACTIVATION_LIMIT_REACHED");
|
|
1054
|
+
const slot = Symbol();
|
|
1055
|
+
this.slots.add(slot);
|
|
902
1056
|
return () => {
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
1057
|
+
this.slots.delete(slot);
|
|
1058
|
+
};
|
|
1059
|
+
}
|
|
1060
|
+
};
|
|
1061
|
+
/**
|
|
1062
|
+
* Read the live Agent retained by local execution.
|
|
1063
|
+
* @param activation - the managed local or external execution.
|
|
1064
|
+
* @returns the local Agent, absent for an external run.
|
|
1065
|
+
*/
|
|
1066
|
+
function activationAgent(activation) {
|
|
1067
|
+
return activation.kind === "local" ? activation.handle.agent : void 0;
|
|
1068
|
+
}
|
|
1069
|
+
/**
|
|
1070
|
+
* Require local residency before accepting further input.
|
|
1071
|
+
* @param activation - execution targeted by message delivery.
|
|
1072
|
+
* @returns the local activation.
|
|
1073
|
+
* @throws when the external backend cannot accept another message.
|
|
1074
|
+
*/
|
|
1075
|
+
function requireLocalActivation(activation) {
|
|
1076
|
+
switch (activation.kind) {
|
|
1077
|
+
case "local": return activation;
|
|
1078
|
+
case "external": throw new SubagentError(`subagent "${activation.childId}" does not accept follow-up input`, "NOT_CONTINUABLE");
|
|
1079
|
+
/* v8 ignore next 2 -- Both execution kinds are handled above. */
|
|
1080
|
+
default: return assertNever(activation);
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
/**
|
|
1084
|
+
* Retain local failures whose turn ending could not be committed.
|
|
1085
|
+
* @param activation - exact local Agent and epoch receiving the scoped observers.
|
|
1086
|
+
* @param wake - notify its settlement watcher when failure changes readiness.
|
|
1087
|
+
*/
|
|
1088
|
+
function observeLocalFailure(activation, wake) {
|
|
1089
|
+
const child = activation.handle.agent;
|
|
1090
|
+
child.ctx.on("agent/error", ({ agent }) => {
|
|
1091
|
+
if (agent !== child) return;
|
|
1092
|
+
activation.failureAt = child.session.seq;
|
|
1093
|
+
wake();
|
|
1094
|
+
});
|
|
1095
|
+
child.ctx.on("session/event", (session, event) => {
|
|
1096
|
+
if (session === child.session && event.type === "turn/end" && activation.failureAt !== void 0 && event.seq >= activation.failureAt) activation.failureAt = void 0;
|
|
1097
|
+
});
|
|
1098
|
+
}
|
|
1099
|
+
/**
|
|
1100
|
+
* Capture local output and retain failures without a later committed turn ending.
|
|
1101
|
+
* @param activation - the settled local execution and any structured result.
|
|
1102
|
+
* @returns final output, stop reason, and committed structured value.
|
|
1103
|
+
*/
|
|
1104
|
+
function captureLocalResult(activation) {
|
|
1105
|
+
const events = activation.handle.agent.session.snapshotEvents(activation.outputStart);
|
|
1106
|
+
const output = finalAssistantOutput(events) ?? [];
|
|
1107
|
+
const stopReason = activation.failureAt === void 0 ? epochStopReason(events) : "error";
|
|
1108
|
+
const structured = activation.structured;
|
|
1109
|
+
if (structured !== void 0) {
|
|
1110
|
+
const captured = structured.captured();
|
|
1111
|
+
if (captured !== void 0) return {
|
|
1112
|
+
output,
|
|
1113
|
+
stopReason,
|
|
1114
|
+
structured: captured.value
|
|
1115
|
+
};
|
|
1116
|
+
if (stopReason === "completed") return {
|
|
1117
|
+
output,
|
|
1118
|
+
stopReason: "error"
|
|
1119
|
+
};
|
|
1120
|
+
}
|
|
1121
|
+
return {
|
|
1122
|
+
output,
|
|
1123
|
+
stopReason
|
|
1124
|
+
};
|
|
1125
|
+
}
|
|
1126
|
+
/** Serialize each durable child's delivery, release, and disposal. */
|
|
1127
|
+
var ChildLock = class {
|
|
1128
|
+
tails = /* @__PURE__ */ new Map();
|
|
1129
|
+
/**
|
|
1130
|
+
* Run `operation` after every previously queued operation for `childId`.
|
|
1131
|
+
* @param childId - the durable child whose operations are linearized.
|
|
1132
|
+
* @param operation - the critical section to run in order.
|
|
1133
|
+
* @returns the operation's own settlement.
|
|
1134
|
+
*/
|
|
1135
|
+
run(childId, operation) {
|
|
1136
|
+
const result = (this.tails.get(childId) ?? Promise.resolve()).then(operation, operation);
|
|
1137
|
+
const tail = result.then(() => void 0, () => void 0);
|
|
1138
|
+
this.tails.set(childId, tail);
|
|
1139
|
+
tail.then(() => {
|
|
1140
|
+
if (this.tails.get(childId) === tail) this.tails.delete(childId);
|
|
1141
|
+
});
|
|
1142
|
+
return result;
|
|
1143
|
+
}
|
|
1144
|
+
};
|
|
1145
|
+
//#endregion
|
|
1146
|
+
//#region lib/types/manager.js
|
|
1147
|
+
/**
|
|
1148
|
+
* Owns subagent startup, message admission, cold resume, and execution lifetimes.
|
|
1149
|
+
* One child lock orders input acceptance and closure; one activation map owns
|
|
1150
|
+
* capacity, parent relationships, and resource release across all providers.
|
|
1151
|
+
*
|
|
1152
|
+
* @module @deepseek-ai/dsh-subagent/manager
|
|
1153
|
+
*/
|
|
1154
|
+
var __addDisposableResource$2 = function(env, value, async) {
|
|
1155
|
+
if (value !== null && value !== void 0) {
|
|
1156
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
1157
|
+
var dispose, inner;
|
|
1158
|
+
if (async) {
|
|
1159
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
1160
|
+
dispose = value[Symbol.asyncDispose];
|
|
1161
|
+
}
|
|
1162
|
+
if (dispose === void 0) {
|
|
1163
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
1164
|
+
dispose = value[Symbol.dispose];
|
|
1165
|
+
if (async) inner = dispose;
|
|
1166
|
+
}
|
|
1167
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
1168
|
+
if (inner) dispose = function() {
|
|
1169
|
+
try {
|
|
1170
|
+
inner.call(this);
|
|
1171
|
+
} catch (e) {
|
|
1172
|
+
return Promise.reject(e);
|
|
1173
|
+
}
|
|
910
1174
|
};
|
|
1175
|
+
env.stack.push({
|
|
1176
|
+
value,
|
|
1177
|
+
dispose,
|
|
1178
|
+
async
|
|
1179
|
+
});
|
|
1180
|
+
} else if (async) env.stack.push({ async: true });
|
|
1181
|
+
return value;
|
|
1182
|
+
};
|
|
1183
|
+
var __disposeResources$2 = (function(SuppressedError) {
|
|
1184
|
+
return function(env) {
|
|
1185
|
+
function fail(e) {
|
|
1186
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
1187
|
+
env.hasError = true;
|
|
1188
|
+
}
|
|
1189
|
+
var r, s = 0;
|
|
1190
|
+
function next() {
|
|
1191
|
+
while (r = env.stack.pop()) try {
|
|
1192
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
1193
|
+
if (r.dispose) {
|
|
1194
|
+
var result = r.dispose.call(r.value);
|
|
1195
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) {
|
|
1196
|
+
fail(e);
|
|
1197
|
+
return next();
|
|
1198
|
+
});
|
|
1199
|
+
} else s |= 1;
|
|
1200
|
+
} catch (e) {
|
|
1201
|
+
fail(e);
|
|
1202
|
+
}
|
|
1203
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
1204
|
+
if (env.hasError) throw env.error;
|
|
1205
|
+
}
|
|
1206
|
+
return next();
|
|
1207
|
+
};
|
|
1208
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
1209
|
+
var e = new Error(message);
|
|
1210
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
1211
|
+
});
|
|
1212
|
+
/** Render only the safe outer message from execution or teardown failures. */
|
|
1213
|
+
function failureMessage(error) {
|
|
1214
|
+
return error instanceof Error ? error.message : "unknown teardown failure";
|
|
1215
|
+
}
|
|
1216
|
+
/** Own subagent requests and the resources of every live activation. */
|
|
1217
|
+
var SubagentManager = class {
|
|
1218
|
+
ctx;
|
|
1219
|
+
host;
|
|
1220
|
+
maxActiveSubagents;
|
|
1221
|
+
/** Child session id → its live Activation. Process-local, never durable. */
|
|
1222
|
+
resident = /* @__PURE__ */ new Map();
|
|
1223
|
+
/** Root identities retain their pool across child settlement without retaining dead roots. */
|
|
1224
|
+
rootPools = /* @__PURE__ */ new WeakMap();
|
|
1225
|
+
/** Materializations admitted before drain, tracked through publication or rollback. */
|
|
1226
|
+
materializations = /* @__PURE__ */ new Set();
|
|
1227
|
+
/** Per-child serializer shared by delivery, release, and disposal. */
|
|
1228
|
+
locks = new ChildLock();
|
|
1229
|
+
/** Structural Cordis owner of every Activation handle. */
|
|
1230
|
+
ownerCtx;
|
|
1231
|
+
/**
|
|
1232
|
+
* Exact roots whose host teardown has begun, with the live lineage members
|
|
1233
|
+
* observed under each root. Entries remain until that exact root leaves the
|
|
1234
|
+
* Agent registry, closing admission throughout its host's teardown without
|
|
1235
|
+
* poisoning a later same-id replacement.
|
|
1236
|
+
*/
|
|
1237
|
+
closingScopes = /* @__PURE__ */ new Map();
|
|
1238
|
+
draining = false;
|
|
1239
|
+
/**
|
|
1240
|
+
* Build one manager inside the service's Agent-injected context.
|
|
1241
|
+
* @param ctx - context providing Agents, Sessions, and teardown ownership.
|
|
1242
|
+
* @param host - provider dispatch and lifecycle observation owned by the service.
|
|
1243
|
+
* @param maxActiveSubagents - the current configured child capacity.
|
|
1244
|
+
*/
|
|
1245
|
+
constructor(ctx, host, maxActiveSubagents) {
|
|
1246
|
+
this.ctx = ctx;
|
|
1247
|
+
this.host = host;
|
|
1248
|
+
this.maxActiveSubagents = maxActiveSubagents;
|
|
1249
|
+
const scope = ctx.plugin(function activationOwner() {});
|
|
1250
|
+
this.ownerCtx = scope.ctx;
|
|
1251
|
+
ctx.on("agent/disposed", ({ agent }) => {
|
|
1252
|
+
this.closingScopes.delete(agent);
|
|
1253
|
+
});
|
|
1254
|
+
ctx.effect(function* () {
|
|
1255
|
+
yield scope.dispose;
|
|
1256
|
+
yield () => this.drain();
|
|
1257
|
+
}.bind(this), "subagents.manager()");
|
|
911
1258
|
}
|
|
912
1259
|
/**
|
|
913
1260
|
* Interrupt one live continuable child's current turn under the supplied authority.
|
|
@@ -923,29 +1270,15 @@ var ContinuableActivationRegistry = class {
|
|
|
923
1270
|
const activation = this.resident.get(targetSessionId);
|
|
924
1271
|
if (activation === void 0) return;
|
|
925
1272
|
if (authority.kind === "user") {
|
|
926
|
-
if (activation.
|
|
1273
|
+
if (activation.parent.id !== authority.parentSessionId) throw new SubagentError(`subagent "${targetSessionId}" belongs to another parent session`, "UNAUTHORIZED");
|
|
927
1274
|
} else if (!activation.ancestry.has(authority.agent)) throw new SubagentError(`subagent "${targetSessionId}" is not a live descendant of agent "${authority.agent.id}"`, "UNAUTHORIZED");
|
|
928
|
-
if (activation.
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
* @param message - durable user message to deliver.
|
|
935
|
-
* @param delivery - receiving inbox destination.
|
|
936
|
-
*/
|
|
937
|
-
sendWaking(parent, message, delivery) {
|
|
938
|
-
const parentActivation = this.resident.get(parent.id);
|
|
939
|
-
if (parentActivation !== void 0 && parentActivation.handle.agent === parent) {
|
|
940
|
-
try {
|
|
941
|
-
parentActivation.inbox.deliver(message, delivery);
|
|
942
|
-
} finally {
|
|
943
|
-
this.wake(parentActivation);
|
|
944
|
-
}
|
|
945
|
-
return;
|
|
1275
|
+
if (activation.closing !== void 0) return;
|
|
1276
|
+
const kind = authority.kind === "user" ? "user" : "parent";
|
|
1277
|
+
if (activation.kind === "local") activation.handle.agent.cancel({ kind }, { keepInbox: true });
|
|
1278
|
+
else {
|
|
1279
|
+
activation.controller.abort({ kind });
|
|
1280
|
+
this.dispose(activation).catch(() => void 0);
|
|
946
1281
|
}
|
|
947
|
-
if (delivery === "steer") parent.steer(message);
|
|
948
|
-
else parent.followup(message);
|
|
949
1282
|
}
|
|
950
1283
|
/**
|
|
951
1284
|
* Close admission, await every already-admitted materialization through
|
|
@@ -954,6 +1287,7 @@ var ContinuableActivationRegistry = class {
|
|
|
954
1287
|
*/
|
|
955
1288
|
async drain() {
|
|
956
1289
|
this.draining = true;
|
|
1290
|
+
for (const pending of this.materializations) pending.controller.abort();
|
|
957
1291
|
await Promise.all([...this.materializations].map((materialization) => materialization.settled));
|
|
958
1292
|
const owned = /* @__PURE__ */ new Set();
|
|
959
1293
|
for (const activation of this.resident.values()) for (const child of activation.ownedChildren) owned.add(child);
|
|
@@ -961,8 +1295,47 @@ var ContinuableActivationRegistry = class {
|
|
|
961
1295
|
await this.disposeRoots(roots, "activation(s)");
|
|
962
1296
|
}
|
|
963
1297
|
/**
|
|
964
|
-
*
|
|
965
|
-
* @param
|
|
1298
|
+
* Join progressing child work, leaving idle parked inboxes resident.
|
|
1299
|
+
* @param parent - exact live parent whose descendants are observed.
|
|
1300
|
+
* @returns whether work was joined and the host must recheck parent completion.
|
|
1301
|
+
*/
|
|
1302
|
+
async waitForChildren(parent) {
|
|
1303
|
+
let observed = false;
|
|
1304
|
+
while (true) {
|
|
1305
|
+
const pending = [...this.materializations].filter((item) => item.lineage.includes(parent));
|
|
1306
|
+
const children = [...this.resident.values()].filter((item) => activationAgent(item) !== parent && item.ancestry.has(parent));
|
|
1307
|
+
observed ||= children.some((item) => item.kind === "local" && item.handle.agent.status !== "idle");
|
|
1308
|
+
await Promise.all(children.flatMap((item) => item.kind === "local" ? [item.handle.agent.whenIdle()] : []));
|
|
1309
|
+
const waits = pending.map((item) => item.settled);
|
|
1310
|
+
for (const item of children) {
|
|
1311
|
+
if (item.kind === "external" || item.closing !== void 0) {
|
|
1312
|
+
waits.push(item.result.promise.catch(() => void 0));
|
|
1313
|
+
continue;
|
|
1314
|
+
}
|
|
1315
|
+
if (item.handle.agent.status !== "idle") {
|
|
1316
|
+
waits.push(item.handle.agent.whenIdle());
|
|
1317
|
+
continue;
|
|
1318
|
+
}
|
|
1319
|
+
if (item.ownedChildren.size > 0) {
|
|
1320
|
+
if ([...item.ownedChildren].some((id) => !this.resident.has(id))) waits.push(item.poke.promise);
|
|
1321
|
+
continue;
|
|
1322
|
+
}
|
|
1323
|
+
const inbox = item.handle.agent.inbox;
|
|
1324
|
+
if (item.failureAt === void 0 && (inbox.nextTurn.length > 0 || inbox.nextStep.length > 0)) continue;
|
|
1325
|
+
waits.push(Promise.race([item.result.promise.catch(() => void 0), item.poke.promise]));
|
|
1326
|
+
}
|
|
1327
|
+
if (waits.length > 0) {
|
|
1328
|
+
observed = true;
|
|
1329
|
+
await Promise.all(waits);
|
|
1330
|
+
continue;
|
|
1331
|
+
}
|
|
1332
|
+
if ([...this.materializations].some((item) => item.lineage.includes(parent) && !pending.includes(item)) || [...this.resident.values()].some((item) => activationAgent(item) !== parent && item.ancestry.has(parent) && !children.includes(item))) continue;
|
|
1333
|
+
return observed;
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
/**
|
|
1337
|
+
* Stop the managed descendants of exact live host-owned parents.
|
|
1338
|
+
* @param parents - exact live roots whose managed descendants must stop.
|
|
966
1339
|
*/
|
|
967
1340
|
async drainDescendants(parents) {
|
|
968
1341
|
const roots = new Set(parents.filter((parent) => this.ctx.agents.get(parent.id) === parent));
|
|
@@ -970,13 +1343,14 @@ var ContinuableActivationRegistry = class {
|
|
|
970
1343
|
for (const root of roots) this.closingMembers(root).add(root);
|
|
971
1344
|
const targets = [];
|
|
972
1345
|
for (const activation of this.resident.values()) {
|
|
973
|
-
const
|
|
974
|
-
const
|
|
1346
|
+
const child = activationAgent(activation);
|
|
1347
|
+
const lineage = this.liveLineage(child ?? activation.parent);
|
|
1348
|
+
const owners = [...roots].filter((root) => child !== root && activation.ancestry.has(root));
|
|
975
1349
|
if (owners.length === 0) continue;
|
|
976
1350
|
targets.push(activation);
|
|
977
1351
|
for (const owner of owners) {
|
|
978
1352
|
const members = this.closingMembers(owner);
|
|
979
|
-
members.add(
|
|
1353
|
+
if (child !== void 0) members.add(child);
|
|
980
1354
|
for (const agent of lineage) members.add(agent);
|
|
981
1355
|
}
|
|
982
1356
|
}
|
|
@@ -986,6 +1360,7 @@ var ContinuableActivationRegistry = class {
|
|
|
986
1360
|
const members = this.closingMembers(owner);
|
|
987
1361
|
for (const agent of materialization.lineage) members.add(agent);
|
|
988
1362
|
}
|
|
1363
|
+
if (owners.length > 0) materialization.controller.abort();
|
|
989
1364
|
return owners.length > 0;
|
|
990
1365
|
});
|
|
991
1366
|
const ownedTargets = /* @__PURE__ */ new Set();
|
|
@@ -1006,883 +1381,714 @@ var ContinuableActivationRegistry = class {
|
|
|
1006
1381
|
for (const childId of new Set(childIds)) {
|
|
1007
1382
|
const activation = this.resident.get(childId);
|
|
1008
1383
|
if (activation === void 0) continue;
|
|
1009
|
-
if (activation.
|
|
1384
|
+
if (activation.parent.id !== parent.id || !activation.ancestry.has(parent)) throw new SubagentError(`subagent "${childId}" is not a direct child of agent "${parent.id}"`, "UNAUTHORIZED");
|
|
1010
1385
|
targets.push(activation);
|
|
1011
1386
|
}
|
|
1012
1387
|
for (const activation of targets) this.dispose(activation).catch(() => void 0);
|
|
1013
1388
|
await this.disposeRoots(targets, "selected activation(s)");
|
|
1014
1389
|
}
|
|
1015
1390
|
/**
|
|
1016
|
-
*
|
|
1017
|
-
*
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
if (closing === void 0) return;
|
|
1022
|
-
throw new SubagentError(closing === "manager" ? "continuable subagents are draining; the operation was not admitted" : `continuable subagents below parent "${closing.id}" are draining; the operation was not admitted`, "DRAINING");
|
|
1023
|
-
}
|
|
1024
|
-
/**
|
|
1025
|
-
* Authorize one operation against the durable direct-parent lineage.
|
|
1026
|
-
* @param parent - exact live Agent claiming direct-parent authority.
|
|
1027
|
-
* @param childId - durable child session id addressed by the operation.
|
|
1028
|
-
* @param parentSession - durable direct-parent id recorded by the child.
|
|
1391
|
+
* Start one continuable background child and resolve at initial inbox acceptance.
|
|
1392
|
+
* Every earlier failure disposes any created handle and rolls back Activation
|
|
1393
|
+
* and parent ownership without returning either id.
|
|
1394
|
+
* @param spec - provider, delegation request, and caller cancellation.
|
|
1395
|
+
* @returns the durable child id and accepted initial prompt message id.
|
|
1029
1396
|
*/
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
}
|
|
1034
|
-
/**
|
|
1035
|
-
* Create or resume one child Agent and publish its Activation.
|
|
1036
|
-
* @param inputs - reconstruction and admission inputs for the residency epoch.
|
|
1037
|
-
* @returns the published process-local Activation.
|
|
1038
|
-
*/
|
|
1039
|
-
materialize(inputs) {
|
|
1040
|
-
this.assertAdmitting(inputs.parent);
|
|
1041
|
-
inputs.signal.throwIfAborted();
|
|
1042
|
-
const lineage = this.liveLineage(inputs.parent);
|
|
1043
|
-
const pool = this.resident.get(inputs.parent.id)?.pool ?? this.rootPool(inputs.parent);
|
|
1044
|
-
const releaseSlot = pool.reserve(this.maxActiveSubagents());
|
|
1045
|
-
const settled = Promise.withResolvers();
|
|
1046
|
-
const materialization = {
|
|
1047
|
-
lineage,
|
|
1048
|
-
settled: settled.promise
|
|
1049
|
-
};
|
|
1050
|
-
this.materializations.add(materialization);
|
|
1051
|
-
return this.materializeTracked(inputs, lineage, pool, releaseSlot).catch((error) => {
|
|
1052
|
-
releaseSlot();
|
|
1053
|
-
throw error;
|
|
1054
|
-
}).finally(() => {
|
|
1055
|
-
this.materializations.delete(materialization);
|
|
1056
|
-
settled.resolve();
|
|
1057
|
-
});
|
|
1058
|
-
}
|
|
1059
|
-
/**
|
|
1060
|
-
* Cross the final admission cutoff and submit without yielding.
|
|
1061
|
-
* @param activation - the exact resident child receiving the message.
|
|
1062
|
-
* @param message - the already-built durable user message.
|
|
1063
|
-
* @param delivery - the Agent inbox destination.
|
|
1064
|
-
* @param parent - exact live direct parent authorizing admission.
|
|
1065
|
-
* @param signal - caller cancellation before inbox acceptance.
|
|
1066
|
-
* @returns the accepted durable message id.
|
|
1067
|
-
*/
|
|
1068
|
-
submitAdmitted(activation, message, delivery, parent, signal) {
|
|
1069
|
-
signal.throwIfAborted();
|
|
1397
|
+
async startLocal(spec) {
|
|
1398
|
+
const request = spec.request;
|
|
1399
|
+
const parent = request.parent;
|
|
1070
1400
|
this.assertAdmitting(parent);
|
|
1071
|
-
this.
|
|
1072
|
-
|
|
1401
|
+
const persistence = spec.delivery === "caller" ? this.ctx.get("sessionPersistence") : this.requirePersistence();
|
|
1402
|
+
assertSubagentMaxDepth(request.maxDepth);
|
|
1403
|
+
const childId = spec.childId ?? brandString(randomUUID());
|
|
1404
|
+
this.assertChildIdAvailable(childId);
|
|
1405
|
+
const childDepth = resolveChildDepth(parent, request.maxDepth);
|
|
1406
|
+
const agentOptions = resolveChildAgentOptions(parent, request.agentOptions, childDepth);
|
|
1407
|
+
const agentProvider = agentOptions.provider;
|
|
1408
|
+
const agentModel = agentOptions.model;
|
|
1409
|
+
const agentReasoningEffort = agentOptions.reasoningEffort;
|
|
1410
|
+
const descriptor = snapshotSubagentDescriptor({
|
|
1411
|
+
mode: "continuable",
|
|
1412
|
+
provider: spec.provider,
|
|
1413
|
+
label: spec.label,
|
|
1414
|
+
...agentProvider !== void 0 ? { agentProvider } : {},
|
|
1415
|
+
...agentModel !== void 0 ? { agentModel } : {},
|
|
1416
|
+
...agentReasoningEffort !== void 0 ? { agentReasoningEffort } : {},
|
|
1417
|
+
...request.persona !== void 0 ? { persona: request.persona } : {},
|
|
1418
|
+
...request.toolFilter !== void 0 ? { toolFilter: request.toolFilter } : {}
|
|
1419
|
+
});
|
|
1420
|
+
const delegatedPolicies = captureDelegatedPolicyOverrides(parent);
|
|
1421
|
+
const releaseHold = this.holdOwnership(parent, childId);
|
|
1073
1422
|
try {
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1423
|
+
const cwd = await this.resolveDirectory(request, spec.signal);
|
|
1424
|
+
const prepared = await this.host.prepareContinuable(spec.provider, {
|
|
1425
|
+
sessionId: childId,
|
|
1426
|
+
cwd,
|
|
1427
|
+
parent,
|
|
1428
|
+
signal: spec.signal
|
|
1429
|
+
});
|
|
1430
|
+
spec.signal.throwIfAborted();
|
|
1431
|
+
this.assertAdmitting(parent);
|
|
1432
|
+
const inheritedEventCount = SessionLogOffset(prepared.seed?.length ?? 0);
|
|
1433
|
+
const seed = prepared.seed;
|
|
1434
|
+
let established;
|
|
1435
|
+
const messageId = await this.locks.run(childId, async () => {
|
|
1436
|
+
spec.signal.throwIfAborted();
|
|
1437
|
+
this.assertAdmitting(parent);
|
|
1438
|
+
this.assertChildIdAvailable(childId);
|
|
1439
|
+
if (spec.childId !== void 0) {
|
|
1440
|
+
const persisted = await persistence?.stat(childId, { signal: spec.signal });
|
|
1441
|
+
spec.signal.throwIfAborted();
|
|
1442
|
+
this.assertAdmitting(parent);
|
|
1443
|
+
this.assertChildIdAvailable(childId);
|
|
1444
|
+
if (persisted !== void 0) throw new SubagentError(`subagent "${childId}" already exists`, "DUPLICATE_CHILD");
|
|
1445
|
+
}
|
|
1446
|
+
const activation = await this.materialize({
|
|
1447
|
+
kind: "local",
|
|
1448
|
+
childId,
|
|
1449
|
+
provider: spec.provider,
|
|
1450
|
+
parent,
|
|
1451
|
+
create: {
|
|
1452
|
+
cwd,
|
|
1453
|
+
seed,
|
|
1454
|
+
meta: childSessionMeta(parent, childDepth, prepared.seed !== void 0),
|
|
1455
|
+
inheritedEventCount,
|
|
1456
|
+
delegatedPolicies,
|
|
1457
|
+
descriptor
|
|
1458
|
+
},
|
|
1459
|
+
agentOptions,
|
|
1460
|
+
composition: {
|
|
1461
|
+
persona: request.persona,
|
|
1462
|
+
toolFilter: request.toolFilter
|
|
1463
|
+
},
|
|
1464
|
+
signal: spec.signal,
|
|
1465
|
+
delivery: spec.delivery,
|
|
1466
|
+
outputSchema: spec.request.outputSchema
|
|
1467
|
+
});
|
|
1468
|
+
established = activation;
|
|
1469
|
+
const child = requireLocalActivation(activation).handle.agent;
|
|
1470
|
+
const childHeader = child.session.header;
|
|
1471
|
+
return await this.submitMaterialized(activation, spec.delivery !== "caller" && isAdjacentAgentSendMessageTool(this.ctx.get("tools")?.get("send_message", child)) ? withContinuableReturnGuidance(parent.id, request.prompt) : request.prompt, {
|
|
1472
|
+
source: { kind: "user" },
|
|
1473
|
+
signal: spec.signal,
|
|
1474
|
+
delivery: "queue"
|
|
1475
|
+
}, parent, () => {
|
|
1476
|
+
establishCatalogChild(parent.session, childHeader, descriptor);
|
|
1477
|
+
});
|
|
1478
|
+
});
|
|
1479
|
+
return {
|
|
1480
|
+
...this.receipt(established),
|
|
1481
|
+
childId,
|
|
1482
|
+
messageId
|
|
1483
|
+
};
|
|
1484
|
+
} catch (error) {
|
|
1485
|
+
releaseHold();
|
|
1486
|
+
throw error;
|
|
1077
1487
|
}
|
|
1078
|
-
return message.id;
|
|
1079
1488
|
}
|
|
1080
1489
|
/**
|
|
1081
|
-
*
|
|
1082
|
-
* @param
|
|
1083
|
-
* @
|
|
1084
|
-
* @returns the shared close transaction.
|
|
1490
|
+
* Start an external backend under activation ownership.
|
|
1491
|
+
* @param spec - task, provider, cancellation, and delivery policy.
|
|
1492
|
+
* @returns the accepted activation and its result/disposal capabilities.
|
|
1085
1493
|
*/
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1494
|
+
async startExternal(spec) {
|
|
1495
|
+
const parent = spec.request.parent;
|
|
1496
|
+
this.assertAdmitting(parent);
|
|
1497
|
+
const pendingId = brandString(randomUUID());
|
|
1498
|
+
const releaseHold = this.holdOwnership(parent, pendingId);
|
|
1499
|
+
let activation;
|
|
1500
|
+
try {
|
|
1501
|
+
const cwd = await this.resolveDirectory(spec.request, spec.signal);
|
|
1502
|
+
activation = await this.materialize({
|
|
1503
|
+
kind: "external",
|
|
1504
|
+
childId: pendingId,
|
|
1505
|
+
provider: spec.provider,
|
|
1506
|
+
parent,
|
|
1507
|
+
signal: spec.signal,
|
|
1508
|
+
delivery: spec.delivery,
|
|
1509
|
+
start: (signal) => this.host.startExternal(spec.provider, {
|
|
1510
|
+
...spec.request,
|
|
1511
|
+
cwd,
|
|
1512
|
+
label: spec.label,
|
|
1513
|
+
signal
|
|
1514
|
+
})
|
|
1515
|
+
});
|
|
1516
|
+
this.assertAdmitting(parent);
|
|
1517
|
+
this.assertLiveParent(parent, activation.childId);
|
|
1518
|
+
spec.signal.throwIfAborted();
|
|
1519
|
+
if (spec.delivery === "parent") establishExternalCatalogChild(parent.session, activation.childId, spec.label);
|
|
1520
|
+
this.announce(activation);
|
|
1521
|
+
return this.receipt(activation);
|
|
1522
|
+
} catch (error) {
|
|
1523
|
+
if (activation !== void 0) try {
|
|
1093
1524
|
await this.dispose(activation);
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
return error;
|
|
1525
|
+
} catch (cleanupError) {
|
|
1526
|
+
this.ctx.logger.warn(`subagent "${activation.childId}" admission rollback failed: ${failureMessage(cleanupError)}`);
|
|
1097
1527
|
}
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
/** Return the retained member set for one exact scoped-teardown root. */
|
|
1102
|
-
closingMembers(root) {
|
|
1103
|
-
const existing = this.closingScopes.get(root);
|
|
1104
|
-
if (existing !== void 0) return existing;
|
|
1105
|
-
const members = /* @__PURE__ */ new Set();
|
|
1106
|
-
this.closingScopes.set(root, members);
|
|
1107
|
-
return members;
|
|
1108
|
-
}
|
|
1109
|
-
/** Return the exact currently resolvable ancestry from `agent` upward. */
|
|
1110
|
-
liveLineage(agent) {
|
|
1111
|
-
const lineage = [agent];
|
|
1112
|
-
const seen = new Set([agent.id]);
|
|
1113
|
-
let parentSession = agent.session.header.parentSession;
|
|
1114
|
-
while (parentSession !== void 0) {
|
|
1115
|
-
const parent = this.ctx.agents.get(parentSession);
|
|
1116
|
-
if (parent === void 0 || seen.has(parent.id)) break;
|
|
1117
|
-
lineage.push(parent);
|
|
1118
|
-
seen.add(parent.id);
|
|
1119
|
-
parentSession = parent.session.header.parentSession;
|
|
1528
|
+
throw error;
|
|
1529
|
+
} finally {
|
|
1530
|
+
releaseHold();
|
|
1120
1531
|
}
|
|
1121
|
-
return lineage;
|
|
1122
1532
|
}
|
|
1123
|
-
/**
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1533
|
+
/** Capture the explicit or inherited directory while the parent still owns startup. */
|
|
1534
|
+
async resolveDirectory(request, signal) {
|
|
1535
|
+
const cwd = request.cwd !== void 0 && isAbsolute(request.cwd) ? request.cwd : resolve(await this.ctx.workingDirectory.ensure(request.parent, signal), request.cwd ?? ".");
|
|
1536
|
+
signal.throwIfAborted();
|
|
1537
|
+
return cwd;
|
|
1128
1538
|
}
|
|
1129
|
-
/**
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1539
|
+
/**
|
|
1540
|
+
* Deliver one model-authored message to a direct continuable child or to the
|
|
1541
|
+
* sender's direct parent. A missing direct child cold-resumes through the
|
|
1542
|
+
* ordinary continuation lifecycle.
|
|
1543
|
+
* @param sender - exact live Agent authorizing and originating the message.
|
|
1544
|
+
* @param targetId - durable direct-parent or direct-child session id.
|
|
1545
|
+
* @param content - model-authored content to deliver.
|
|
1546
|
+
* @param options - caller cancellation before acceptance.
|
|
1547
|
+
* @returns the accepted message's inbox id.
|
|
1548
|
+
*/
|
|
1549
|
+
async sendMessage(sender, targetId, content, options) {
|
|
1550
|
+
if (this.ctx.agents.get(sender.id) !== sender) throw new SubagentError("message delivery requires the exact live sender agent", "UNAUTHORIZED");
|
|
1551
|
+
this.assertAdmitting(sender);
|
|
1552
|
+
const senderActivation = this.resident.get(sender.id);
|
|
1553
|
+
if (senderActivation !== void 0 && senderActivation.kind === "local" && senderActivation.handle.agent === sender && senderActivation.parent.id === targetId) {
|
|
1554
|
+
options.signal.throwIfAborted();
|
|
1555
|
+
return this.sendToParent(senderActivation, sender, content);
|
|
1135
1556
|
}
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
const { childId, provider, parent, create } = inputs;
|
|
1141
|
-
inputs.signal.throwIfAborted();
|
|
1142
|
-
const setup = (childCtx, child) => {
|
|
1143
|
-
if (create !== void 0) {
|
|
1144
|
-
child.session.append("subagent/descriptor", create.descriptor);
|
|
1145
|
-
appendDelegatedPolicyOverrides(child.session, create.delegatedPolicies);
|
|
1146
|
-
}
|
|
1147
|
-
applyChildComposition(childCtx, parent, inputs.composition);
|
|
1148
|
-
};
|
|
1149
|
-
const observer = this.observeActivation(provider, childId, parent);
|
|
1150
|
-
const handle = create === void 0 ? await this.ownerCtx.agents.resume({
|
|
1151
|
-
resumeSessionId: childId,
|
|
1152
|
-
parentAgent: parent,
|
|
1153
|
-
agentOptions: inputs.agentOptions,
|
|
1154
|
-
signal: inputs.signal,
|
|
1155
|
-
setup
|
|
1156
|
-
}) : await this.ownerCtx.agents.create({
|
|
1157
|
-
sessionId: childId,
|
|
1158
|
-
parentAgent: parent,
|
|
1159
|
-
meta: create.meta,
|
|
1160
|
-
...create.seed === void 0 ? {} : { seed: create.seed },
|
|
1161
|
-
inheritedEventCount: create.inheritedEventCount,
|
|
1162
|
-
agentOptions: inputs.agentOptions,
|
|
1163
|
-
signal: inputs.signal,
|
|
1164
|
-
setup
|
|
1557
|
+
if (sender.session.header.parentSession === targetId) throw new SubagentError(`agent "${sender.id}" is not a resident continuable child and cannot send to parent "${targetId}"`, "UNAUTHORIZED");
|
|
1558
|
+
return this.deliverToChild(sender, targetId, content, {
|
|
1559
|
+
signal: options.signal,
|
|
1560
|
+
delivery: "steer"
|
|
1165
1561
|
});
|
|
1166
|
-
const activation = {
|
|
1167
|
-
pool,
|
|
1168
|
-
releaseSlot,
|
|
1169
|
-
childId,
|
|
1170
|
-
parentSession: parent.id,
|
|
1171
|
-
provider,
|
|
1172
|
-
handle,
|
|
1173
|
-
inbox: new SubagentInbox(handle.agent),
|
|
1174
|
-
ancestry: new WeakSet([handle.agent, ...parentLineage]),
|
|
1175
|
-
ownedChildren: /* @__PURE__ */ new Set(),
|
|
1176
|
-
observer,
|
|
1177
|
-
announced: false,
|
|
1178
|
-
poke: Promise.withResolvers()
|
|
1179
|
-
};
|
|
1180
|
-
this.resident.set(childId, activation);
|
|
1181
|
-
try {
|
|
1182
|
-
inputs.signal.throwIfAborted();
|
|
1183
|
-
this.assertAdmitting(parent);
|
|
1184
|
-
this.acquireOwnership(parent, childId);
|
|
1185
|
-
const wakeOnInboxRemoval = () => {
|
|
1186
|
-
this.wake(activation);
|
|
1187
|
-
};
|
|
1188
|
-
handle.agent.ctx.on("agent/inbox/claimed", wakeOnInboxRemoval);
|
|
1189
|
-
handle.agent.ctx.on("agent/inbox/discarded", wakeOnInboxRemoval);
|
|
1190
|
-
observer.start(handle.agent);
|
|
1191
|
-
} catch (error) {
|
|
1192
|
-
/* v8 ignore next -- rollback failure must not mask the admission failure
|
|
1193
|
-
* that prevented this operation from returning an accepted message id. */
|
|
1194
|
-
await this.rollbackUnpublished(activation).catch(() => void 0);
|
|
1195
|
-
throw error;
|
|
1196
|
-
}
|
|
1197
|
-
this.watchSettlement(activation);
|
|
1198
|
-
return activation;
|
|
1199
1562
|
}
|
|
1200
|
-
/**
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1563
|
+
/**
|
|
1564
|
+
* Queue one human-authored prompt as a distinct direct-child turn.
|
|
1565
|
+
* @param parent - exact live direct parent authorizing delivery.
|
|
1566
|
+
* @param childId - durable direct-child session id.
|
|
1567
|
+
* @param content - model-visible prompt blocks.
|
|
1568
|
+
* @param source - durable attribution for the human prompt.
|
|
1569
|
+
* @param signal - caller cancellation before inbox acceptance.
|
|
1570
|
+
* @returns the accepted durable message id.
|
|
1571
|
+
*/
|
|
1572
|
+
async queuePrompt(parent, childId, content, source, signal) {
|
|
1573
|
+
return this.deliverToChild(parent, childId, content, {
|
|
1574
|
+
source,
|
|
1575
|
+
signal,
|
|
1576
|
+
delivery: "queue"
|
|
1210
1577
|
});
|
|
1211
1578
|
}
|
|
1212
|
-
/**
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
activation.poke = Promise.withResolvers();
|
|
1227
|
-
}
|
|
1228
|
-
/** Follow one Activation to natural settlement. */
|
|
1229
|
-
watchSettlement(activation) {
|
|
1230
|
-
(async () => {
|
|
1231
|
-
while (true) {
|
|
1232
|
-
const idleObservation = activation.poke;
|
|
1233
|
-
await activation.handle.agent.whenIdle();
|
|
1234
|
-
if (activation.inbox.closing !== void 0) return;
|
|
1235
|
-
const readiness = await this.locks.run(activation.childId, () => Promise.resolve(this.settlementState(activation, idleObservation)));
|
|
1236
|
-
if (readiness === "closed") return;
|
|
1237
|
-
if (readiness === "retry") continue;
|
|
1238
|
-
if (readiness === "wait") {
|
|
1239
|
-
await idleObservation.promise;
|
|
1240
|
-
continue;
|
|
1241
|
-
}
|
|
1242
|
-
const finalSeq = activation.handle.agent.session.seq;
|
|
1243
|
-
await this.flushFinalState(activation);
|
|
1244
|
-
const attempt = await this.locks.run(activation.childId, () => {
|
|
1245
|
-
const state = this.settlementState(activation, idleObservation);
|
|
1246
|
-
if (state !== "ready") return Promise.resolve(state);
|
|
1247
|
-
if (activation.handle.agent.session.seq !== finalSeq) return Promise.resolve("retry");
|
|
1248
|
-
let done;
|
|
1249
|
-
try {
|
|
1250
|
-
activation.handle.agent.runMaintenance(() => {
|
|
1251
|
-
done = this.dispose(activation, true);
|
|
1252
|
-
return Promise.resolve();
|
|
1253
|
-
});
|
|
1254
|
-
} catch {
|
|
1255
|
-
return Promise.resolve("retry");
|
|
1256
|
-
}
|
|
1257
|
-
return Promise.resolve({ done });
|
|
1258
|
-
});
|
|
1259
|
-
if (attempt === "closed") return;
|
|
1260
|
-
if (attempt === "retry") continue;
|
|
1261
|
-
if (attempt === "wait") {
|
|
1262
|
-
await idleObservation.promise;
|
|
1263
|
-
continue;
|
|
1264
|
-
}
|
|
1265
|
-
try {
|
|
1266
|
-
await attempt.done;
|
|
1267
|
-
} catch (error) {
|
|
1268
|
-
this.ctx.logger.warn(`subagent "${activation.childId}" activation teardown failed: ${errorChain(error)}`);
|
|
1269
|
-
}
|
|
1270
|
-
return;
|
|
1271
|
-
}
|
|
1272
|
-
})();
|
|
1273
|
-
}
|
|
1274
|
-
/** Classify one Inbox and owned-child observation without reading Agent execution state. */
|
|
1275
|
-
settlementState(activation, observation) {
|
|
1276
|
-
if (activation.inbox.closing !== void 0) return "closed";
|
|
1277
|
-
if (activation.poke !== observation) return "retry";
|
|
1278
|
-
if (activation.inbox.hasPending || activation.ownedChildren.size > 0) return "wait";
|
|
1279
|
-
return "ready";
|
|
1280
|
-
}
|
|
1281
|
-
/** Propagate stop synchronously, then finish the child-first release. */
|
|
1282
|
-
async finishDisposal(activation, finalStateFlushed) {
|
|
1283
|
-
this.wake(activation);
|
|
1284
|
-
const { childId } = activation;
|
|
1285
|
-
const failures = [];
|
|
1286
|
-
if (finalStateFlushed) try {
|
|
1287
|
-
activation.observer.capture(activation.handle.agent);
|
|
1288
|
-
} catch (error) {
|
|
1289
|
-
failures.push(new SubagentError(`subagent "${childId}" activation teardown failed: ${errorChain(error)}`, "ACTIVATION_TEARDOWN_FAILED", { cause: error }));
|
|
1290
|
-
}
|
|
1291
|
-
else {
|
|
1292
|
-
activation.handle.agent.cancel({ kind: "parent" });
|
|
1293
|
-
const idle = activation.handle.agent.whenIdle();
|
|
1294
|
-
const childDisposals = [...activation.ownedChildren].map((child) => this.resident.get(child)).filter((child) => child !== void 0).map((child) => this.dispose(child));
|
|
1295
|
-
try {
|
|
1296
|
-
const reasons = (await Promise.all(childDisposals.map(async (disposal) => {
|
|
1297
|
-
try {
|
|
1298
|
-
await disposal;
|
|
1299
|
-
return;
|
|
1300
|
-
} catch (error) {
|
|
1301
|
-
return error;
|
|
1302
|
-
}
|
|
1303
|
-
}))).filter((reason) => reason !== void 0);
|
|
1304
|
-
if (reasons.length > 0) failures.push(new SubagentError(`subagent "${childId}" child teardown failed: ${reasons.map((reason) => errorChain(reason)).join("; ")}`, "ACTIVATION_TEARDOWN_FAILED"));
|
|
1305
|
-
await idle;
|
|
1306
|
-
await this.flushFinalState(activation);
|
|
1307
|
-
activation.observer.capture(activation.handle.agent);
|
|
1308
|
-
} catch (error) {
|
|
1309
|
-
failures.push(new SubagentError(`subagent "${childId}" activation teardown failed: ${errorChain(error)}`, "ACTIVATION_TEARDOWN_FAILED", { cause: error }));
|
|
1310
|
-
}
|
|
1311
|
-
}
|
|
1312
|
-
try {
|
|
1313
|
-
await activation.handle.dispose();
|
|
1314
|
-
} catch (error) {
|
|
1315
|
-
failures.push(new SubagentError(`subagent "${childId}" activation handle disposal failed: ${errorChain(error)}`, "ACTIVATION_TEARDOWN_FAILED", { cause: error }));
|
|
1316
|
-
}
|
|
1317
|
-
let failure;
|
|
1318
|
-
if (failures.length === 1) failure = failures[0];
|
|
1319
|
-
else if (failures.length > 1) failure = new SubagentError(`subagent "${childId}" activation teardown failed at ${failures.length} boundaries: ` + failures.map((item) => errorChain(item)).join("; "), "ACTIVATION_TEARDOWN_FAILED", { cause: new AggregateError(failures) });
|
|
1320
|
-
this.resident.delete(childId);
|
|
1321
|
-
activation.releaseSlot();
|
|
1322
|
-
this.notifySettlement(activation, activation.observer.terminal(failure));
|
|
1323
|
-
this.releaseOwnership(childId);
|
|
1324
|
-
activation.observer.settle(failure);
|
|
1325
|
-
if (failure !== void 0) throw failure;
|
|
1326
|
-
}
|
|
1327
|
-
/** Tell the durable direct parent how this Activation ended. */
|
|
1328
|
-
notifySettlement(activation, terminal) {
|
|
1329
|
-
if (!activation.announced) return;
|
|
1330
|
-
try {
|
|
1331
|
-
const parent = this.ctx.agents.get(activation.parentSession);
|
|
1332
|
-
if (parent === void 0) return;
|
|
1333
|
-
const message = createSettlementMessage(activation.childId, terminal);
|
|
1334
|
-
if (this.closingTeardownFor(parent) !== void 0) {
|
|
1335
|
-
parent.inject(message);
|
|
1336
|
-
return;
|
|
1337
|
-
}
|
|
1338
|
-
this.sendWaking(parent, message, parent.status === "idle" ? "queue" : "steer");
|
|
1339
|
-
} catch (error) {
|
|
1340
|
-
this.ctx.logger.warn(`subagent "${activation.childId}" settlement notice was not delivered to its parent: ` + errorChain(error));
|
|
1341
|
-
}
|
|
1342
|
-
}
|
|
1343
|
-
/** Request a best-effort final session flush before closing natural-settlement admission. */
|
|
1344
|
-
async flushFinalState(activation) {
|
|
1345
|
-
const child = activation.handle.agent;
|
|
1346
|
-
try {
|
|
1347
|
-
await child.ctx.sessions.flush(child.session);
|
|
1348
|
-
} catch (error) {
|
|
1349
|
-
this.ctx.logger.warn(`subagent "${activation.childId}" best-effort final session flush failed; the persisted state may be unavailable or stale on resume: ${errorChain(error)}`);
|
|
1350
|
-
}
|
|
1351
|
-
}
|
|
1352
|
-
};
|
|
1353
|
-
//#endregion
|
|
1354
|
-
//#region lib/types/descriptor.js
|
|
1355
|
-
/**
|
|
1356
|
-
* The durable subagent-child descriptor: the versioned, model-hidden
|
|
1357
|
-
* `subagent/descriptor` session event that identifies every session-backed
|
|
1358
|
-
* subagent and records whether it is one-shot or continuable. Continuable
|
|
1359
|
-
* descriptors additionally preserve the declared composition required for
|
|
1360
|
-
* cold resume. Providers append it turn-enclosed in the child's initial turn.
|
|
1361
|
-
*
|
|
1362
|
-
* The descriptor deliberately snapshots explicit fields rather than the
|
|
1363
|
-
* merge-extensible `AgentOptions` object: an unrelated extension value cannot
|
|
1364
|
-
* make continuation fail merely because it is not JSON, and later composition
|
|
1365
|
-
* inputs require a deliberate {@link SUBAGENT_DESCRIPTOR_VERSION} change. It
|
|
1366
|
-
* omits `subagentDepth` — cold resume trusts the persisted header's
|
|
1367
|
-
* `delegationDepth` as the monotone floor — and `outputSchema`, which belongs
|
|
1368
|
-
* to one activation's result contract rather than durable child composition.
|
|
1369
|
-
* Per-activation knobs such as `maxTokens` are omitted for the same reason as
|
|
1370
|
-
* `outputSchema`: they budget one activation. Cold resume requires the exact
|
|
1371
|
-
* live parent for authorization but reconstructs child options only from the
|
|
1372
|
-
* durable descriptor, so it neither restores the prior budget nor inherits
|
|
1373
|
-
* the parent's current one; the resumed route's defaults apply instead.
|
|
1374
|
-
*
|
|
1375
|
-
* @module @deepseek-ai/dsh-subagent/descriptor
|
|
1376
|
-
*/
|
|
1377
|
-
/**
|
|
1378
|
-
* The current descriptor format version, stamped into every appended
|
|
1379
|
-
* `subagent/descriptor` event and required verbatim by {@link foldSubagentDescriptor}.
|
|
1380
|
-
* Supporting another composition input is a deliberate version change, never
|
|
1381
|
-
* an implicit extra field.
|
|
1382
|
-
*/
|
|
1383
|
-
const SUBAGENT_DESCRIPTOR_VERSION = 3;
|
|
1384
|
-
const DESCRIPTOR_BASE_KEYS = [
|
|
1385
|
-
"version",
|
|
1386
|
-
"mode",
|
|
1387
|
-
"provider",
|
|
1388
|
-
"label"
|
|
1389
|
-
];
|
|
1390
|
-
const ONE_SHOT_DESCRIPTOR_KEYS = new Set(DESCRIPTOR_BASE_KEYS);
|
|
1391
|
-
const CONTINUABLE_DESCRIPTOR_KEYS = new Set([
|
|
1392
|
-
...DESCRIPTOR_BASE_KEYS,
|
|
1393
|
-
"agentProvider",
|
|
1394
|
-
"agentModel",
|
|
1395
|
-
"agentReasoningEffort",
|
|
1396
|
-
"persona",
|
|
1397
|
-
"toolFilter"
|
|
1398
|
-
]);
|
|
1399
|
-
const TOOL_FILTER_KEYS = new Set(["allow", "deny"]);
|
|
1400
|
-
/** Whether a persisted JSON value is an object record. */
|
|
1401
|
-
function isRecord(value) {
|
|
1402
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1403
|
-
}
|
|
1404
|
-
/** Reject fields outside one versioned record's declared schema. */
|
|
1405
|
-
function assertKnownKeys(value, keys, path) {
|
|
1406
|
-
const unknown = Object.keys(value).find((key) => !keys.has(key));
|
|
1407
|
-
if (unknown !== void 0) throw new Error(`persisted subagent descriptor ${path} has unknown field "${unknown}"`);
|
|
1408
|
-
}
|
|
1409
|
-
/** Read one optional string field from a persisted descriptor record. */
|
|
1410
|
-
function optionalString(value, key) {
|
|
1411
|
-
if (!Object.hasOwn(value, key)) return void 0;
|
|
1412
|
-
const field = value[key];
|
|
1413
|
-
if (typeof field !== "string") throw new Error(`persisted subagent descriptor ${key} must be a string`);
|
|
1414
|
-
return field;
|
|
1415
|
-
}
|
|
1416
|
-
/** Read one optional string-array field from a persisted tool restriction. */
|
|
1417
|
-
function optionalStringArray(value, key) {
|
|
1418
|
-
if (!Object.hasOwn(value, key)) return void 0;
|
|
1419
|
-
const field = value[key];
|
|
1420
|
-
if (!Array.isArray(field)) throw new Error(`persisted subagent descriptor toolFilter.${key} must be an array of strings`);
|
|
1421
|
-
const items = field;
|
|
1422
|
-
if (items.some((item) => typeof item !== "string")) throw new Error(`persisted subagent descriptor toolFilter.${key} must be an array of strings`);
|
|
1423
|
-
return items;
|
|
1424
|
-
}
|
|
1425
|
-
/** Validate and reconstruct a persisted tool restriction. */
|
|
1426
|
-
function parseToolFilter(value) {
|
|
1427
|
-
if (!isRecord(value)) throw new Error("persisted subagent descriptor toolFilter must be an object");
|
|
1428
|
-
assertKnownKeys(value, TOOL_FILTER_KEYS, "toolFilter");
|
|
1429
|
-
const allow = optionalStringArray(value, "allow");
|
|
1430
|
-
const deny = optionalStringArray(value, "deny");
|
|
1431
|
-
if (allow === void 0 && deny === void 0) throw new Error("persisted subagent descriptor toolFilter must declare allow and/or deny");
|
|
1432
|
-
return {
|
|
1433
|
-
...allow !== void 0 ? { allow } : {},
|
|
1434
|
-
...deny !== void 0 ? { deny } : {}
|
|
1435
|
-
};
|
|
1436
|
-
}
|
|
1437
|
-
/** Validate one persisted descriptor payload for the current runtime. */
|
|
1438
|
-
function parseSubagentDescriptor(value) {
|
|
1439
|
-
if (!isRecord(value)) throw new Error("persisted subagent descriptor payload must be an object");
|
|
1440
|
-
const version = value["version"];
|
|
1441
|
-
if (typeof version !== "number") throw new Error("persisted subagent descriptor version must be a number");
|
|
1442
|
-
if (version !== 3) return void 0;
|
|
1443
|
-
const mode = value["mode"];
|
|
1444
|
-
if (mode !== "one-shot" && mode !== "continuable") throw new Error("persisted subagent descriptor mode must be \"one-shot\" or \"continuable\"");
|
|
1445
|
-
assertKnownKeys(value, mode === "one-shot" ? ONE_SHOT_DESCRIPTOR_KEYS : CONTINUABLE_DESCRIPTOR_KEYS, "payload");
|
|
1446
|
-
const provider = value["provider"];
|
|
1447
|
-
if (typeof provider !== "string") throw new Error("persisted subagent descriptor provider must be a string");
|
|
1448
|
-
if (mode === "one-shot") {
|
|
1449
|
-
const label = optionalString(value, "label");
|
|
1450
|
-
return {
|
|
1451
|
-
version: 3,
|
|
1452
|
-
mode,
|
|
1453
|
-
provider,
|
|
1454
|
-
...label !== void 0 ? { label } : {}
|
|
1455
|
-
};
|
|
1456
|
-
}
|
|
1457
|
-
const label = value["label"];
|
|
1458
|
-
if (typeof label !== "string") throw new Error("persisted subagent descriptor label must be a string");
|
|
1459
|
-
const agentProvider = optionalString(value, "agentProvider");
|
|
1460
|
-
const agentModel = optionalString(value, "agentModel");
|
|
1461
|
-
const agentReasoningEffort = optionalString(value, "agentReasoningEffort");
|
|
1462
|
-
const persona = optionalString(value, "persona");
|
|
1463
|
-
const toolFilter = Object.hasOwn(value, "toolFilter") ? parseToolFilter(value["toolFilter"]) : void 0;
|
|
1464
|
-
return {
|
|
1465
|
-
version: 3,
|
|
1466
|
-
mode,
|
|
1467
|
-
provider,
|
|
1468
|
-
label,
|
|
1469
|
-
...agentProvider !== void 0 ? { agentProvider } : {},
|
|
1470
|
-
...agentModel !== void 0 ? { agentModel } : {},
|
|
1471
|
-
...agentReasoningEffort !== void 0 ? { agentReasoningEffort } : {},
|
|
1472
|
-
...persona !== void 0 ? { persona } : {},
|
|
1473
|
-
...toolFilter !== void 0 ? { toolFilter } : {}
|
|
1474
|
-
};
|
|
1475
|
-
}
|
|
1476
|
-
function snapshotSubagentDescriptor(input) {
|
|
1477
|
-
const snapshot = snapshotJsonValue(input.mode === "one-shot" ? {
|
|
1478
|
-
version: 3,
|
|
1479
|
-
mode: input.mode,
|
|
1480
|
-
provider: input.provider,
|
|
1481
|
-
...input.label !== void 0 ? { label: input.label } : {}
|
|
1482
|
-
} : {
|
|
1483
|
-
version: 3,
|
|
1484
|
-
mode: input.mode,
|
|
1485
|
-
provider: input.provider,
|
|
1486
|
-
label: input.label,
|
|
1487
|
-
...input.agentProvider !== void 0 ? { agentProvider: input.agentProvider } : {},
|
|
1488
|
-
...input.agentModel !== void 0 ? { agentModel: input.agentModel } : {},
|
|
1489
|
-
...input.agentReasoningEffort !== void 0 ? { agentReasoningEffort: input.agentReasoningEffort } : {},
|
|
1490
|
-
...input.persona !== void 0 ? { persona: input.persona } : {},
|
|
1491
|
-
...input.toolFilter !== void 0 ? { toolFilter: input.toolFilter } : {}
|
|
1492
|
-
});
|
|
1493
|
-
if (snapshot === void 0) throw new Error("subagent descriptor is not losslessly JSON-serializable");
|
|
1494
|
-
return snapshot;
|
|
1495
|
-
}
|
|
1496
|
-
/**
|
|
1497
|
-
* Fold a persisted child log to its supported descriptor. The first
|
|
1498
|
-
* `subagent/descriptor` event is authoritative — the establishing provider
|
|
1499
|
-
* appends exactly one, so a later same-type event cannot rewrite the declared
|
|
1500
|
-
* composition.
|
|
1501
|
-
* @param events - the loaded child session events.
|
|
1502
|
-
* @returns the descriptor, or `undefined` when the log has none or its
|
|
1503
|
-
* version is not {@link SUBAGENT_DESCRIPTOR_VERSION} (the child cannot be
|
|
1504
|
-
* classified by this runtime).
|
|
1505
|
-
* @throws when a current-version persisted payload does not match its complete
|
|
1506
|
-
* declared schema.
|
|
1507
|
-
*/
|
|
1508
|
-
function foldSubagentDescriptor(events) {
|
|
1509
|
-
const event = events.find((candidate) => candidate.type === "subagent/descriptor");
|
|
1510
|
-
if (event === void 0) return void 0;
|
|
1511
|
-
return parseSubagentDescriptor(event.data);
|
|
1512
|
-
}
|
|
1513
|
-
const sessionIdSchema = z$1.string();
|
|
1514
|
-
const oneShotCatalogSchema = z$1.object({
|
|
1515
|
-
version: z$1.union([z$1.literal(0), z$1.literal(1)]),
|
|
1516
|
-
childId: sessionIdSchema,
|
|
1517
|
-
childCreatedAt: z$1.number().int().nonnegative(),
|
|
1518
|
-
mode: z$1.literal("one-shot"),
|
|
1519
|
-
label: z$1.string().optional()
|
|
1520
|
-
}).strict();
|
|
1521
|
-
const continuableCatalogSchema = z$1.object({
|
|
1522
|
-
version: z$1.union([z$1.literal(0), z$1.literal(1)]),
|
|
1523
|
-
childId: sessionIdSchema,
|
|
1524
|
-
childCreatedAt: z$1.number().int().nonnegative(),
|
|
1525
|
-
mode: z$1.literal("continuable"),
|
|
1526
|
-
label: z$1.string()
|
|
1527
|
-
}).strict();
|
|
1528
|
-
const unknownCatalogSchema = oneShotCatalogSchema.extend({
|
|
1529
|
-
version: z$1.literal(1),
|
|
1530
|
-
mode: z$1.literal("unknown")
|
|
1531
|
-
});
|
|
1532
|
-
const eventDataSchema = z$1.union([
|
|
1533
|
-
oneShotCatalogSchema,
|
|
1534
|
-
continuableCatalogSchema,
|
|
1535
|
-
unknownCatalogSchema
|
|
1536
|
-
]);
|
|
1537
|
-
const viewSchema = z$1.array(z$1.union([
|
|
1538
|
-
oneShotCatalogSchema.omit({
|
|
1539
|
-
version: true,
|
|
1540
|
-
childId: true,
|
|
1541
|
-
childCreatedAt: true
|
|
1542
|
-
}).extend({
|
|
1543
|
-
id: sessionIdSchema,
|
|
1544
|
-
createdAt: oneShotCatalogSchema.shape.childCreatedAt
|
|
1545
|
-
}),
|
|
1546
|
-
continuableCatalogSchema.omit({
|
|
1547
|
-
version: true,
|
|
1548
|
-
childId: true,
|
|
1549
|
-
childCreatedAt: true
|
|
1550
|
-
}).extend({
|
|
1551
|
-
id: sessionIdSchema,
|
|
1552
|
-
createdAt: continuableCatalogSchema.shape.childCreatedAt
|
|
1553
|
-
}),
|
|
1554
|
-
unknownCatalogSchema.omit({
|
|
1555
|
-
version: true,
|
|
1556
|
-
childId: true,
|
|
1557
|
-
childCreatedAt: true
|
|
1558
|
-
}).extend({
|
|
1559
|
-
id: sessionIdSchema,
|
|
1560
|
-
createdAt: unknownCatalogSchema.shape.childCreatedAt
|
|
1561
|
-
})
|
|
1562
|
-
]));
|
|
1563
|
-
const stateSchema = z$1.object({
|
|
1564
|
-
inheritedEventCount: z$1.number().int().nonnegative(),
|
|
1565
|
-
head: chunkedListSchema(eventDataSchema).optional()
|
|
1566
|
-
}).strict();
|
|
1567
|
-
/**
|
|
1568
|
-
* Materialize complete and unknown-mode child identities from parent catalog events.
|
|
1569
|
-
* @param state - parent catalog fold state.
|
|
1570
|
-
* @returns current direct-child rows in parent catalog event order.
|
|
1571
|
-
*/
|
|
1572
|
-
function subagentCatalogEntries(state) {
|
|
1573
|
-
const entries = [];
|
|
1574
|
-
for (const data of iterateChunkedList(state.head)) entries.push(data.mode !== "continuable" ? {
|
|
1575
|
-
id: data.childId,
|
|
1576
|
-
createdAt: data.childCreatedAt,
|
|
1577
|
-
mode: data.mode,
|
|
1578
|
-
...data.label === void 0 ? {} : { label: data.label }
|
|
1579
|
-
} : {
|
|
1580
|
-
id: data.childId,
|
|
1581
|
-
createdAt: data.childCreatedAt,
|
|
1582
|
-
mode: data.mode,
|
|
1583
|
-
label: data.label
|
|
1584
|
-
});
|
|
1585
|
-
return entries;
|
|
1586
|
-
}
|
|
1587
|
-
/** Parent-owned direct-child catalog projection; invalid own facts reject restoration. */
|
|
1588
|
-
const subagentCatalogProjectionDefinition = {
|
|
1589
|
-
key: "subagentCatalog",
|
|
1590
|
-
stateSchema,
|
|
1591
|
-
init: (_header, inheritedEventCount) => ({ inheritedEventCount }),
|
|
1592
|
-
apply: (state, event) => {
|
|
1593
|
-
if (event.type !== "subagent/catalog" || event.seq < state.inheritedEventCount) return state;
|
|
1594
|
-
return {
|
|
1595
|
-
...state,
|
|
1596
|
-
head: appendChunkedList(state.head, eventDataSchema.parse(event.data))
|
|
1597
|
-
};
|
|
1598
|
-
},
|
|
1599
|
-
stateVersion: 3,
|
|
1600
|
-
wire: {
|
|
1601
|
-
viewSchema,
|
|
1602
|
-
view: subagentCatalogEntries
|
|
1603
|
-
}
|
|
1604
|
-
};
|
|
1605
|
-
/**
|
|
1606
|
-
* Append a complete direct-child discovery fact to its parent Session.
|
|
1607
|
-
* @param parent - durable direct parent receiving the discovery fact.
|
|
1608
|
-
* @param child - established child's immutable Session metadata.
|
|
1609
|
-
* @param descriptor - mode-discriminated creation label frozen with the child.
|
|
1610
|
-
*/
|
|
1611
|
-
function establishCatalogChild(parent, child, descriptor) {
|
|
1612
|
-
parent.append("subagent/catalog", descriptor.mode === "one-shot" ? {
|
|
1613
|
-
version: 0,
|
|
1614
|
-
childId: child.id,
|
|
1615
|
-
childCreatedAt: child.createdAt,
|
|
1616
|
-
mode: descriptor.mode,
|
|
1617
|
-
...descriptor.label === void 0 ? {} : { label: descriptor.label }
|
|
1618
|
-
} : {
|
|
1619
|
-
version: 0,
|
|
1620
|
-
childId: child.id,
|
|
1621
|
-
childCreatedAt: child.createdAt,
|
|
1622
|
-
mode: descriptor.mode,
|
|
1623
|
-
label: descriptor.label
|
|
1624
|
-
});
|
|
1625
|
-
}
|
|
1626
|
-
//#endregion
|
|
1627
|
-
//#region lib/types/internal.js
|
|
1628
|
-
/**
|
|
1629
|
-
* Continuation integration markers and host adapters outside the public
|
|
1630
|
-
* Service Definition and model-facing Agent messaging contract.
|
|
1631
|
-
* @module @deepseek-ai/dsh-subagent/internal
|
|
1632
|
-
*/
|
|
1633
|
-
/** Process-stable identity carried only by the standard adjacent-Agent messaging tool. */
|
|
1634
|
-
const adjacentAgentSendMessageTool = Symbol.for("dsh.subagent.adjacentAgentSendMessageTool");
|
|
1635
|
-
/**
|
|
1636
|
-
* Test whether one visible definition is the standard adjacent-Agent messaging tool.
|
|
1637
|
-
* @param definition - the scope-resolved `send_message` candidate.
|
|
1638
|
-
* @returns whether the definition carries the internal standard-tool identity.
|
|
1639
|
-
*/
|
|
1640
|
-
function isAdjacentAgentSendMessageTool(definition) {
|
|
1641
|
-
return definition !== void 0 && definition[adjacentAgentSendMessageTool] === true;
|
|
1642
|
-
}
|
|
1643
|
-
/**
|
|
1644
|
-
* Process-stable symbol-keyed host delivery shared by the bundled runtime
|
|
1645
|
-
* entry and this unbundled internal subpath.
|
|
1646
|
-
* @internal
|
|
1647
|
-
*/
|
|
1648
|
-
const deliverSubagentPrompt = Symbol.for("dsh.subagent.deliverPrompt");
|
|
1649
|
-
//#endregion
|
|
1650
|
-
//#region lib/types/continuation.js
|
|
1651
|
-
/**
|
|
1652
|
-
* Continuable-subagent orchestration behind `ctx.subagents`: stable child ids,
|
|
1653
|
-
* descriptor persistence, provider preparation, cold resume, authorization,
|
|
1654
|
-
* and message routing. {@link ContinuableActivationRegistry} owns the mutable
|
|
1655
|
-
* process-local Activation graph and its settlement and disposal lifecycle.
|
|
1656
|
-
*
|
|
1657
|
-
* A continuable child has one durable Session and at most one process-local
|
|
1658
|
-
* Activation. The Agent inbox is the only turn queue, so this manager owns
|
|
1659
|
-
* durable orchestration while the Agent loop owns all turn ordering and
|
|
1660
|
-
* execution. No continuable path creates a Task or an intermediate
|
|
1661
|
-
* result-bearing wrapper.
|
|
1662
|
-
*
|
|
1663
|
-
* @module @deepseek-ai/dsh-subagent
|
|
1664
|
-
*/
|
|
1665
|
-
var __addDisposableResource$2 = function(env, value, async) {
|
|
1666
|
-
if (value !== null && value !== void 0) {
|
|
1667
|
-
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
1668
|
-
var dispose, inner;
|
|
1669
|
-
if (async) {
|
|
1670
|
-
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
1671
|
-
dispose = value[Symbol.asyncDispose];
|
|
1672
|
-
}
|
|
1673
|
-
if (dispose === void 0) {
|
|
1674
|
-
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
1675
|
-
dispose = value[Symbol.dispose];
|
|
1676
|
-
if (async) inner = dispose;
|
|
1677
|
-
}
|
|
1678
|
-
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
1679
|
-
if (inner) dispose = function() {
|
|
1680
|
-
try {
|
|
1681
|
-
inner.call(this);
|
|
1682
|
-
} catch (e) {
|
|
1683
|
-
return Promise.reject(e);
|
|
1684
|
-
}
|
|
1685
|
-
};
|
|
1686
|
-
env.stack.push({
|
|
1687
|
-
value,
|
|
1688
|
-
dispose,
|
|
1689
|
-
async
|
|
1579
|
+
/**
|
|
1580
|
+
* Steer one host-authored prompt to a direct continuable child.
|
|
1581
|
+
* @param parent - exact live direct parent authorizing delivery.
|
|
1582
|
+
* @param childId - durable direct-child session id.
|
|
1583
|
+
* @param content - model-visible prompt blocks.
|
|
1584
|
+
* @param source - durable attribution for the host prompt.
|
|
1585
|
+
* @param signal - caller cancellation before inbox acceptance.
|
|
1586
|
+
* @returns the accepted durable message id.
|
|
1587
|
+
*/
|
|
1588
|
+
async steerPrompt(parent, childId, content, source, signal) {
|
|
1589
|
+
return this.deliverToChild(parent, childId, content, {
|
|
1590
|
+
source,
|
|
1591
|
+
signal,
|
|
1592
|
+
delivery: "steer"
|
|
1690
1593
|
});
|
|
1691
|
-
}
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1594
|
+
}
|
|
1595
|
+
/** Admit local input synchronously before any teardown can begin. */
|
|
1596
|
+
deliver(activation, message, delivery) {
|
|
1597
|
+
if (activation.closing !== void 0) throw new SubagentError("subagent activation is being disposed; the message was not accepted", "ACTIVATION_CLOSING");
|
|
1598
|
+
const local = requireLocalActivation(activation);
|
|
1599
|
+
if (local.structured?.acceptsInput() === false) throw new SubagentError("subagent is submitting or has submitted its structured result; the message was not accepted", "INPUT_CLOSED");
|
|
1600
|
+
if (delivery === "steer") local.handle.agent.steer(message);
|
|
1601
|
+
else local.handle.agent.followup(message);
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1604
|
+
* Reject one child identity already owned by a live Agent or Session.
|
|
1605
|
+
* @param childId - proposed durable child session id.
|
|
1606
|
+
*/
|
|
1607
|
+
assertChildIdAvailable(childId) {
|
|
1608
|
+
if (this.resident.has(childId) || this.ctx.agents.get(childId) !== void 0 || this.ctx.get("sessions")?.get(childId) !== void 0) throw new SubagentError(`subagent "${childId}" already exists`, "DUPLICATE_CHILD");
|
|
1609
|
+
}
|
|
1610
|
+
/**
|
|
1611
|
+
* Pre-register `childId` in a continuation-managed parent's owned set so the
|
|
1612
|
+
* parent cannot settle while a caller is still establishing or resuming that
|
|
1613
|
+
* child. Returns a releaser for the failure path; it removes only a hold
|
|
1614
|
+
* this call added, and leaves ownership in place once a live Activation for
|
|
1615
|
+
* the child exists.
|
|
1616
|
+
* @param parent - the live direct parent the operation is admitted under.
|
|
1617
|
+
* @param childId - the durable child the operation addresses.
|
|
1618
|
+
* @returns the failure-path releaser; a no-op when nothing was added.
|
|
1619
|
+
*/
|
|
1620
|
+
holdOwnership(parent, childId) {
|
|
1621
|
+
const parentActivation = this.resident.get(parent.id);
|
|
1622
|
+
if (parentActivation === void 0 || activationAgent(parentActivation) !== parent) return () => {};
|
|
1623
|
+
if (parentActivation.closing !== void 0) throw new SubagentError(`subagent parent "${parent.id}" is being disposed; the child was not established`, "ACTIVATION_CLOSING");
|
|
1624
|
+
if (parentActivation.ownedChildren.has(childId)) return () => {};
|
|
1625
|
+
parentActivation.ownedChildren.add(childId);
|
|
1626
|
+
return () => {
|
|
1627
|
+
const live = this.resident.get(childId);
|
|
1628
|
+
/* v8 ignore next 4 -- reaching this arm needs another delivery to establish the child
|
|
1629
|
+
* between this operation's failure and its releaser running, which no test can schedule
|
|
1630
|
+
* deterministically: the ownership edge then belongs to that live Activation, so the
|
|
1631
|
+
* conservative keep leaves it for finishDisposal's releaseOwnership. */
|
|
1632
|
+
if (live !== void 0 && live.closing === void 0) return;
|
|
1633
|
+
if (parentActivation.ownedChildren.delete(childId)) this.wake(parentActivation);
|
|
1634
|
+
};
|
|
1635
|
+
}
|
|
1636
|
+
/**
|
|
1637
|
+
* Apply activation admission to a resident parent before delivering input.
|
|
1638
|
+
* @param parent - exact live Agent receiving the message.
|
|
1639
|
+
* @param message - durable user message to deliver.
|
|
1640
|
+
* @param delivery - receiving inbox destination.
|
|
1641
|
+
*/
|
|
1642
|
+
sendWaking(parent, message, delivery) {
|
|
1643
|
+
const parentActivation = this.resident.get(parent.id);
|
|
1644
|
+
if (parentActivation !== void 0 && activationAgent(parentActivation) === parent) {
|
|
1645
|
+
try {
|
|
1646
|
+
this.deliver(parentActivation, message, delivery);
|
|
1647
|
+
} finally {
|
|
1648
|
+
this.wake(parentActivation);
|
|
1713
1649
|
}
|
|
1714
|
-
|
|
1715
|
-
if (env.hasError) throw env.error;
|
|
1650
|
+
return;
|
|
1716
1651
|
}
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
})(typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
1720
|
-
var e = new Error(message);
|
|
1721
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
1722
|
-
});
|
|
1723
|
-
/**
|
|
1724
|
-
* The continuable-subagent orchestration service behind `ctx.subagents`. Tool
|
|
1725
|
-
* schema and host adapters are consumers of this one contract; foreground
|
|
1726
|
-
* one-shot delegation keeps calling `ctx.subagents.start()` and never enters
|
|
1727
|
-
* this lifecycle.
|
|
1728
|
-
*/
|
|
1729
|
-
var SubagentContinuationManager = class {
|
|
1730
|
-
ctx;
|
|
1731
|
-
host;
|
|
1732
|
-
activations;
|
|
1733
|
-
constructor(ctx, host, maxActiveSubagents) {
|
|
1734
|
-
this.ctx = ctx;
|
|
1735
|
-
this.host = host;
|
|
1736
|
-
this.activations = new ContinuableActivationRegistry(ctx, (provider, childId, parent) => host.observeActivation(provider, childId, parent), maxActiveSubagents);
|
|
1652
|
+
if (delivery === "steer") parent.steer(message);
|
|
1653
|
+
else parent.followup(message);
|
|
1737
1654
|
}
|
|
1738
1655
|
/**
|
|
1739
|
-
*
|
|
1740
|
-
*
|
|
1741
|
-
* and parent ownership without returning either id.
|
|
1742
|
-
* @param spec - provider, delegation request, and caller cancellation.
|
|
1743
|
-
* @returns the durable child id and accepted initial prompt message id.
|
|
1656
|
+
* Reject new admission once the manager or this exact parent tree began draining.
|
|
1657
|
+
* @param agent - exact live Agent whose lineage determines admission.
|
|
1744
1658
|
*/
|
|
1745
|
-
|
|
1746
|
-
const
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1659
|
+
assertAdmitting(agent) {
|
|
1660
|
+
const closing = this.closingTeardownFor(agent);
|
|
1661
|
+
if (closing === void 0) return;
|
|
1662
|
+
throw new SubagentError(closing === "manager" ? "subagents are draining; the operation was not admitted" : `subagents below parent "${closing.id}" are draining; the operation was not admitted`, "DRAINING");
|
|
1663
|
+
}
|
|
1664
|
+
/**
|
|
1665
|
+
* Authorize one operation against the durable direct-parent lineage.
|
|
1666
|
+
* @param parent - exact live Agent claiming direct-parent authority.
|
|
1667
|
+
* @param childId - durable child session id addressed by the operation.
|
|
1668
|
+
* @param parentSession - durable direct-parent id recorded by the child.
|
|
1669
|
+
*/
|
|
1670
|
+
authorizeLineage(parent, childId, parentSession) {
|
|
1671
|
+
this.assertLiveParent(parent, childId);
|
|
1672
|
+
if (parentSession !== parent.id) throw new SubagentError(`subagent "${childId}" belongs to another parent session`, "UNAUTHORIZED");
|
|
1673
|
+
}
|
|
1674
|
+
/** Reject parent authority after the live registry entry changes. */
|
|
1675
|
+
assertLiveParent(parent, childId) {
|
|
1676
|
+
if (this.ctx.agents.get(parent.id) !== parent) throw new SubagentError(`subagent "${childId}" delivery requires the exact live parent agent`, "UNAUTHORIZED");
|
|
1677
|
+
}
|
|
1678
|
+
/**
|
|
1679
|
+
* Create or resume one child Agent and publish its Activation.
|
|
1680
|
+
* @param inputs - reconstruction and admission inputs for the residency epoch.
|
|
1681
|
+
* @returns the published process-local Activation.
|
|
1682
|
+
*/
|
|
1683
|
+
materialize(inputs) {
|
|
1684
|
+
this.assertAdmitting(inputs.parent);
|
|
1685
|
+
inputs.signal.throwIfAborted();
|
|
1686
|
+
const lineage = this.liveLineage(inputs.parent);
|
|
1687
|
+
const pool = this.resident.get(inputs.parent.id)?.pool ?? this.rootPool(inputs.parent);
|
|
1688
|
+
const releaseSlot = pool.reserve(this.maxActiveSubagents());
|
|
1689
|
+
const settled = Promise.withResolvers();
|
|
1690
|
+
const controller = new AbortController();
|
|
1691
|
+
const materialization = {
|
|
1692
|
+
lineage,
|
|
1693
|
+
settled: settled.promise,
|
|
1694
|
+
controller
|
|
1695
|
+
};
|
|
1696
|
+
this.materializations.add(materialization);
|
|
1697
|
+
return this.materializeTracked({
|
|
1698
|
+
...inputs,
|
|
1699
|
+
signal: AbortSignal.any([inputs.signal, controller.signal])
|
|
1700
|
+
}, lineage, pool, releaseSlot).catch((error) => {
|
|
1701
|
+
releaseSlot();
|
|
1702
|
+
if (error instanceof Error && error.name === "AbortError") this.assertAdmitting(inputs.parent);
|
|
1703
|
+
throw error;
|
|
1704
|
+
}).finally(() => {
|
|
1705
|
+
this.materializations.delete(materialization);
|
|
1706
|
+
settled.resolve();
|
|
1767
1707
|
});
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1708
|
+
}
|
|
1709
|
+
/**
|
|
1710
|
+
* Stop and release one Activation through its memoized close transaction.
|
|
1711
|
+
* @param activation - exact residency epoch to close.
|
|
1712
|
+
* @returns the shared close transaction.
|
|
1713
|
+
*/
|
|
1714
|
+
dispose(activation) {
|
|
1715
|
+
return this.close(activation, () => this.finishDisposal(activation, true));
|
|
1716
|
+
}
|
|
1717
|
+
/** Close admission synchronously and share one release, including startup rollback. */
|
|
1718
|
+
close(activation, release) {
|
|
1719
|
+
if (activation.closing !== void 0) return activation.closing;
|
|
1720
|
+
const completion = Promise.withResolvers();
|
|
1721
|
+
activation.closing = completion.promise;
|
|
1722
|
+
release().then(completion.resolve, completion.reject);
|
|
1723
|
+
return completion.promise;
|
|
1724
|
+
}
|
|
1725
|
+
/** Dispose independent roots and report every branch failure after all settle. */
|
|
1726
|
+
async disposeRoots(roots, failureSubject) {
|
|
1727
|
+
const reasons = (await Promise.all(roots.map(async (activation) => {
|
|
1728
|
+
try {
|
|
1729
|
+
await this.dispose(activation);
|
|
1730
|
+
return;
|
|
1731
|
+
} catch (error) {
|
|
1732
|
+
return error;
|
|
1733
|
+
}
|
|
1734
|
+
}))).filter((failure) => failure !== void 0);
|
|
1735
|
+
if (reasons.length > 0) throw new SubagentError(`subagent teardown failed for ${reasons.length} ${failureSubject}: ` + reasons.map((reason) => failureMessage(reason)).join("; "), "ACTIVATION_TEARDOWN_FAILED");
|
|
1736
|
+
}
|
|
1737
|
+
/** Return the retained member set for one exact scoped-teardown root. */
|
|
1738
|
+
closingMembers(root) {
|
|
1739
|
+
const existing = this.closingScopes.get(root);
|
|
1740
|
+
if (existing !== void 0) return existing;
|
|
1741
|
+
const members = /* @__PURE__ */ new Set();
|
|
1742
|
+
this.closingScopes.set(root, members);
|
|
1743
|
+
return members;
|
|
1744
|
+
}
|
|
1745
|
+
/** Return the exact currently resolvable ancestry from `agent` upward. */
|
|
1746
|
+
liveLineage(agent) {
|
|
1747
|
+
const lineage = [agent];
|
|
1748
|
+
const seen = new Set([agent.id]);
|
|
1749
|
+
let parentSession = agent.session.header.parentSession;
|
|
1750
|
+
while (parentSession !== void 0) {
|
|
1751
|
+
const parent = this.ctx.agents.get(parentSession);
|
|
1752
|
+
if (parent === void 0 || seen.has(parent.id)) break;
|
|
1753
|
+
lineage.push(parent);
|
|
1754
|
+
seen.add(parent.id);
|
|
1755
|
+
parentSession = parent.session.header.parentSession;
|
|
1756
|
+
}
|
|
1757
|
+
return lineage;
|
|
1758
|
+
}
|
|
1759
|
+
/** Return the teardown that closed continuable admission for this agent's lineage. */
|
|
1760
|
+
closingTeardownFor(agent) {
|
|
1761
|
+
if (this.draining) return "manager";
|
|
1762
|
+
const lineage = this.liveLineage(agent);
|
|
1763
|
+
for (const [root, members] of this.closingScopes) if (members.has(agent) || lineage.includes(root)) return root;
|
|
1764
|
+
}
|
|
1765
|
+
/** Resolve a root's pool once; descendants inherit their resident parent's pool directly. */
|
|
1766
|
+
rootPool(parent) {
|
|
1767
|
+
let pool = this.rootPools.get(parent);
|
|
1768
|
+
if (pool === void 0) {
|
|
1769
|
+
pool = new ActivationPool();
|
|
1770
|
+
this.rootPools.set(parent, pool);
|
|
1771
|
+
}
|
|
1772
|
+
return pool;
|
|
1773
|
+
}
|
|
1774
|
+
/** Perform one tracked materialization through publication or rollback. */
|
|
1775
|
+
async materializeTracked(inputs, parentLineage, pool, releaseSlot) {
|
|
1776
|
+
const { provider, parent } = inputs;
|
|
1777
|
+
let childId = inputs.childId;
|
|
1778
|
+
inputs.signal.throwIfAborted();
|
|
1779
|
+
let resource;
|
|
1780
|
+
if (inputs.kind === "external") {
|
|
1781
|
+
const controller = new AbortController();
|
|
1782
|
+
const cancelStartup = () => {
|
|
1783
|
+
controller.abort(inputs.signal.reason);
|
|
1784
|
+
};
|
|
1785
|
+
inputs.signal.addEventListener("abort", cancelStartup, { once: true });
|
|
1786
|
+
try {
|
|
1787
|
+
const run = await inputs.start(controller.signal);
|
|
1788
|
+
resource = {
|
|
1789
|
+
kind: "external",
|
|
1790
|
+
run,
|
|
1791
|
+
controller
|
|
1792
|
+
};
|
|
1793
|
+
run.result.catch(() => void 0);
|
|
1794
|
+
childId = run.id;
|
|
1795
|
+
try {
|
|
1796
|
+
this.assertChildIdAvailable(childId);
|
|
1797
|
+
} catch (error) {
|
|
1798
|
+
await run.dispose();
|
|
1799
|
+
throw error;
|
|
1800
|
+
}
|
|
1801
|
+
} finally {
|
|
1802
|
+
inputs.signal.removeEventListener("abort", cancelStartup);
|
|
1803
|
+
}
|
|
1804
|
+
} else {
|
|
1805
|
+
const { create } = inputs;
|
|
1806
|
+
let structured;
|
|
1807
|
+
const setup = async (childCtx, child) => {
|
|
1808
|
+
if (create !== void 0) {
|
|
1809
|
+
child.session.append("subagent/descriptor", create.descriptor);
|
|
1810
|
+
appendDelegatedPolicyOverrides(child.session, create.delegatedPolicies);
|
|
1811
|
+
const workingDirectory = childCtx.get("workingDirectory");
|
|
1812
|
+
if (workingDirectory === void 0) throw new Error("local subagents require the working-directory service");
|
|
1813
|
+
await workingDirectory.set(child, create.cwd, inputs.signal);
|
|
1814
|
+
}
|
|
1815
|
+
applyChildComposition(childCtx, parent, inputs.composition);
|
|
1816
|
+
if (inputs.outputSchema !== void 0) structured = attachStructuredRuntime(childCtx, inputs.outputSchema, () => this.resident.get(childId)?.ownedChildren.size === 0 && child.inbox.nextStep.length === 0 && child.inbox.nextTurn.length === 0);
|
|
1817
|
+
};
|
|
1818
|
+
const handle = create === void 0 ? await this.ownerCtx.agents.resume({
|
|
1819
|
+
resumeSessionId: childId,
|
|
1820
|
+
parentAgent: parent,
|
|
1821
|
+
agentOptions: inputs.agentOptions,
|
|
1822
|
+
signal: inputs.signal,
|
|
1823
|
+
setup
|
|
1824
|
+
}) : await this.ownerCtx.agents.create({
|
|
1772
1825
|
sessionId: childId,
|
|
1773
|
-
parent,
|
|
1774
|
-
|
|
1826
|
+
parentAgent: parent,
|
|
1827
|
+
meta: create.meta,
|
|
1828
|
+
...create.seed === void 0 ? {} : { seed: create.seed },
|
|
1829
|
+
inheritedEventCount: create.inheritedEventCount,
|
|
1830
|
+
agentOptions: inputs.agentOptions,
|
|
1831
|
+
signal: inputs.signal,
|
|
1832
|
+
setup
|
|
1775
1833
|
});
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
signal: spec.signal
|
|
1810
|
-
});
|
|
1811
|
-
const childHeader = activation.handle.agent.session.header;
|
|
1812
|
-
return await this.submitMaterialized(activation, isAdjacentAgentSendMessageTool(this.ctx.get("tools")?.get("send_message", activation.handle.agent)) ? withContinuableReturnGuidance(parent.id, request.prompt) : request.prompt, {
|
|
1813
|
-
source: { kind: "user" },
|
|
1814
|
-
signal: spec.signal,
|
|
1815
|
-
delivery: "queue"
|
|
1816
|
-
}, parent, () => {
|
|
1817
|
-
establishCatalogChild(parent.session, childHeader, descriptor);
|
|
1818
|
-
});
|
|
1819
|
-
})
|
|
1834
|
+
resource = {
|
|
1835
|
+
kind: "local",
|
|
1836
|
+
handle,
|
|
1837
|
+
outputStart: handle.agent.session.seq,
|
|
1838
|
+
structured,
|
|
1839
|
+
failureAt: void 0,
|
|
1840
|
+
poke: Promise.withResolvers()
|
|
1841
|
+
};
|
|
1842
|
+
}
|
|
1843
|
+
const observer = this.host.observeActivation(provider, childId, parent);
|
|
1844
|
+
const activation = {
|
|
1845
|
+
pool,
|
|
1846
|
+
releaseSlot,
|
|
1847
|
+
childId,
|
|
1848
|
+
...resource,
|
|
1849
|
+
parent,
|
|
1850
|
+
delivery: inputs.delivery ?? "parent",
|
|
1851
|
+
result: Promise.withResolvers(),
|
|
1852
|
+
closing: void 0,
|
|
1853
|
+
ancestry: new WeakSet(resource.kind === "external" ? parentLineage : [resource.handle.agent, ...parentLineage]),
|
|
1854
|
+
ownedChildren: /* @__PURE__ */ new Set(),
|
|
1855
|
+
observer,
|
|
1856
|
+
announced: false
|
|
1857
|
+
};
|
|
1858
|
+
activation.result.promise.catch(() => void 0);
|
|
1859
|
+
this.resident.set(childId, activation);
|
|
1860
|
+
try {
|
|
1861
|
+
this.assertAdmitting(parent);
|
|
1862
|
+
inputs.signal.throwIfAborted();
|
|
1863
|
+
if (this.ctx.agents.get(parent.id) !== parent) throw new SubagentError("subagent parent is no longer live", "UNAUTHORIZED");
|
|
1864
|
+
this.acquireOwnership(parent, childId);
|
|
1865
|
+
const wakeSettlement = () => {
|
|
1866
|
+
this.wake(activation);
|
|
1820
1867
|
};
|
|
1868
|
+
if (activation.kind === "local") {
|
|
1869
|
+
observeLocalFailure(activation, wakeSettlement);
|
|
1870
|
+
activation.handle.agent.ctx.on("agent/inbox/inserted", wakeSettlement);
|
|
1871
|
+
activation.handle.agent.ctx.on("agent/inbox/claimed", wakeSettlement);
|
|
1872
|
+
activation.handle.agent.ctx.on("agent/inbox/discarded", wakeSettlement);
|
|
1873
|
+
}
|
|
1874
|
+
observer.start(activationAgent(activation));
|
|
1821
1875
|
} catch (error) {
|
|
1822
|
-
|
|
1876
|
+
/* v8 ignore next -- rollback failure must not mask the admission failure
|
|
1877
|
+
* that prevented this operation from returning an accepted message id. */
|
|
1878
|
+
await this.rollbackUnpublished(activation, error).catch(() => void 0);
|
|
1823
1879
|
throw error;
|
|
1824
1880
|
}
|
|
1881
|
+
return activation;
|
|
1825
1882
|
}
|
|
1826
1883
|
/**
|
|
1827
|
-
*
|
|
1828
|
-
*
|
|
1829
|
-
* ordinary continuation lifecycle.
|
|
1830
|
-
* @param sender - exact live Agent authorizing and originating the message.
|
|
1831
|
-
* @param targetId - durable direct-parent or direct-child session id.
|
|
1832
|
-
* @param content - model-authored content to deliver.
|
|
1833
|
-
* @param options - caller cancellation before acceptance.
|
|
1834
|
-
* @returns the accepted message's inbox id.
|
|
1884
|
+
* Begin settlement observation after initial acceptance is recorded.
|
|
1885
|
+
* @param activation - accepted activation to observe.
|
|
1835
1886
|
*/
|
|
1836
|
-
|
|
1837
|
-
if (
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1887
|
+
announce(activation) {
|
|
1888
|
+
if (activation.announced) return;
|
|
1889
|
+
activation.announced = true;
|
|
1890
|
+
if (activation.kind === "local") this.watchLocalSettlement(activation);
|
|
1891
|
+
else {
|
|
1892
|
+
const finish = () => this.close(activation, () => this.finishDisposal(activation, false));
|
|
1893
|
+
activation.run.result.then(finish, finish).catch((error) => {
|
|
1894
|
+
this.reportTeardownFailure(activation, error);
|
|
1895
|
+
});
|
|
1843
1896
|
}
|
|
1844
|
-
if (sender.session.header.parentSession === targetId) throw new SubagentError(`agent "${sender.id}" is not a resident continuable child and cannot send to parent "${targetId}"`, "UNAUTHORIZED");
|
|
1845
|
-
return this.deliverToChild(sender, targetId, content, {
|
|
1846
|
-
signal: options.signal,
|
|
1847
|
-
delivery: "steer"
|
|
1848
|
-
});
|
|
1849
1897
|
}
|
|
1850
|
-
/**
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
source,
|
|
1862
|
-
signal,
|
|
1863
|
-
delivery: "queue"
|
|
1898
|
+
/** Release an Activation whose start edge was not published. */
|
|
1899
|
+
rollbackUnpublished(activation, error) {
|
|
1900
|
+
return this.close(activation, async () => {
|
|
1901
|
+
try {
|
|
1902
|
+
await (activation.kind === "local" ? activation.handle.dispose() : activation.run.dispose());
|
|
1903
|
+
} finally {
|
|
1904
|
+
this.resident.delete(activation.childId);
|
|
1905
|
+
activation.releaseSlot();
|
|
1906
|
+
this.releaseOwnership(activation.childId);
|
|
1907
|
+
activation.result.reject(error);
|
|
1908
|
+
}
|
|
1864
1909
|
});
|
|
1865
1910
|
}
|
|
1866
|
-
/**
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
*/
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1911
|
+
/** Register the child in a continuation-managed parent's owned set. */
|
|
1912
|
+
acquireOwnership(parent, childId) {
|
|
1913
|
+
const parentActivation = this.resident.get(parent.id);
|
|
1914
|
+
if (parentActivation === void 0) return;
|
|
1915
|
+
if (parentActivation.closing !== void 0) throw new SubagentError(`subagent parent "${parent.id}" is being disposed; the child was not established`, "ACTIVATION_CLOSING");
|
|
1916
|
+
parentActivation.ownedChildren.add(childId);
|
|
1917
|
+
this.wake(parentActivation);
|
|
1918
|
+
}
|
|
1919
|
+
/** Remove one child from its live owner's set and let that owner re-check settlement. */
|
|
1920
|
+
releaseOwnership(childId) {
|
|
1921
|
+
for (const candidate of this.resident.values()) if (candidate.ownedChildren.delete(childId)) this.wake(candidate);
|
|
1922
|
+
}
|
|
1923
|
+
/** Let a settlement watcher re-check residency after relevant state changes. */
|
|
1924
|
+
wake(activation) {
|
|
1925
|
+
if (activation.kind === "external") return;
|
|
1926
|
+
activation.poke.resolve();
|
|
1927
|
+
activation.poke = Promise.withResolvers();
|
|
1928
|
+
}
|
|
1929
|
+
/** Follow one Activation to natural settlement. */
|
|
1930
|
+
watchLocalSettlement(activation) {
|
|
1931
|
+
(async () => {
|
|
1932
|
+
while (true) {
|
|
1933
|
+
const idleObservation = activation.poke;
|
|
1934
|
+
await activation.handle.agent.whenIdle();
|
|
1935
|
+
if (activation.closing !== void 0) return;
|
|
1936
|
+
const readiness = await this.locks.run(activation.childId, () => Promise.resolve(this.settlementState(activation, idleObservation)));
|
|
1937
|
+
if (readiness === "closed") return;
|
|
1938
|
+
if (readiness === "retry") continue;
|
|
1939
|
+
if (readiness === "wait") {
|
|
1940
|
+
await idleObservation.promise;
|
|
1941
|
+
continue;
|
|
1942
|
+
}
|
|
1943
|
+
const finalSeq = activation.handle.agent.session.seq;
|
|
1944
|
+
await this.flushFinalState(activation);
|
|
1945
|
+
const attempt = await this.locks.run(activation.childId, () => {
|
|
1946
|
+
const state = this.settlementState(activation, idleObservation);
|
|
1947
|
+
if (state !== "ready") return Promise.resolve(state);
|
|
1948
|
+
if (activation.handle.agent.session.seq !== finalSeq) return Promise.resolve("retry");
|
|
1949
|
+
let done;
|
|
1950
|
+
try {
|
|
1951
|
+
activation.handle.agent.runMaintenance(() => {
|
|
1952
|
+
done = this.close(activation, () => this.finishDisposal(activation, false));
|
|
1953
|
+
return Promise.resolve();
|
|
1954
|
+
});
|
|
1955
|
+
} catch (_error) {
|
|
1956
|
+
return Promise.resolve("retry");
|
|
1957
|
+
}
|
|
1958
|
+
return Promise.resolve({ done });
|
|
1959
|
+
});
|
|
1960
|
+
if (typeof attempt === "string") {
|
|
1961
|
+
if (attempt === "closed") return;
|
|
1962
|
+
continue;
|
|
1963
|
+
}
|
|
1964
|
+
try {
|
|
1965
|
+
await attempt.done;
|
|
1966
|
+
} catch (error) {
|
|
1967
|
+
this.reportTeardownFailure(activation, error);
|
|
1968
|
+
}
|
|
1969
|
+
return;
|
|
1970
|
+
}
|
|
1971
|
+
})();
|
|
1972
|
+
}
|
|
1973
|
+
/** Report disposal failure once after the natural settlement observer finishes. */
|
|
1974
|
+
reportTeardownFailure(activation, error) {
|
|
1975
|
+
this.ctx.logger.warn(`subagent "${activation.childId}" activation teardown failed: ${failureMessage(error)}`);
|
|
1976
|
+
}
|
|
1977
|
+
/** Check pending input and owned children before closing admission. */
|
|
1978
|
+
settlementState(activation, observation) {
|
|
1979
|
+
if (activation.closing !== void 0) return "closed";
|
|
1980
|
+
if (activation.poke !== observation) return "retry";
|
|
1981
|
+
const inbox = activation.handle.agent.inbox;
|
|
1982
|
+
if (activation.ownedChildren.size > 0) return "wait";
|
|
1983
|
+
if (activation.failureAt === void 0 && (inbox.nextTurn.length > 0 || inbox.nextStep.length > 0)) return "wait";
|
|
1984
|
+
return "ready";
|
|
1985
|
+
}
|
|
1986
|
+
/** Propagate stop synchronously and await descendant startup rollback before release. */
|
|
1987
|
+
async finishDisposal(activation, stop) {
|
|
1988
|
+
this.wake(activation);
|
|
1989
|
+
const { childId } = activation;
|
|
1990
|
+
const failures = [];
|
|
1991
|
+
let result = {
|
|
1992
|
+
output: [],
|
|
1993
|
+
stopReason: "error"
|
|
1994
|
+
};
|
|
1995
|
+
let resultFailure;
|
|
1996
|
+
let externalDisposal;
|
|
1997
|
+
const child = activationAgent(activation);
|
|
1998
|
+
const detail = (error) => child === void 0 ? failureMessage(error) : errorChain(error);
|
|
1999
|
+
try {
|
|
2000
|
+
if (activation.kind === "external") {
|
|
2001
|
+
if (stop) {
|
|
2002
|
+
activation.controller.abort({ kind: "parent" });
|
|
2003
|
+
externalDisposal = Promise.resolve().then(() => activation.run.dispose());
|
|
2004
|
+
externalDisposal.catch(() => void 0);
|
|
2005
|
+
}
|
|
2006
|
+
result = await activation.run.result;
|
|
2007
|
+
} else {
|
|
2008
|
+
if (stop) {
|
|
2009
|
+
activation.handle.agent.cancel({ kind: "parent" });
|
|
2010
|
+
const idle = activation.handle.agent.whenIdle();
|
|
2011
|
+
const children = [...activation.ownedChildren].map((child) => this.resident.get(child)).filter((child) => child !== void 0);
|
|
2012
|
+
const pending = [...this.materializations].filter((item) => item.lineage.includes(activation.handle.agent));
|
|
2013
|
+
const childDisposals = children.map((child) => this.dispose(child));
|
|
2014
|
+
for (const item of pending) item.controller.abort();
|
|
2015
|
+
childDisposals.push(...pending.map((item) => item.settled));
|
|
2016
|
+
const reasons = (await Promise.all(childDisposals.map(async (disposal) => {
|
|
2017
|
+
try {
|
|
2018
|
+
await disposal;
|
|
2019
|
+
return;
|
|
2020
|
+
} catch (error) {
|
|
2021
|
+
return error;
|
|
2022
|
+
}
|
|
2023
|
+
}))).filter((reason) => reason !== void 0);
|
|
2024
|
+
if (reasons.length > 0) failures.push(new SubagentError(`subagent "${childId}" child teardown failed: ${reasons.map((reason) => failureMessage(reason)).join("; ")}`, "ACTIVATION_TEARDOWN_FAILED"));
|
|
2025
|
+
await idle;
|
|
2026
|
+
await this.flushFinalState(activation);
|
|
2027
|
+
}
|
|
2028
|
+
result = captureLocalResult(activation);
|
|
2029
|
+
}
|
|
2030
|
+
} catch (error) {
|
|
2031
|
+
resultFailure = { error };
|
|
2032
|
+
failures.push(new SubagentError(`subagent "${childId}" activation teardown failed: ${detail(error)}`, "ACTIVATION_TEARDOWN_FAILED", { cause: error }));
|
|
2033
|
+
}
|
|
2034
|
+
try {
|
|
2035
|
+
if (activation.kind === "local") await activation.handle.dispose();
|
|
2036
|
+
else await (externalDisposal ?? activation.run.dispose());
|
|
2037
|
+
} catch (error) {
|
|
2038
|
+
failures.push(new SubagentError(`subagent "${childId}" activation handle disposal failed: ${detail(error)}`, "ACTIVATION_TEARDOWN_FAILED", { cause: error }));
|
|
2039
|
+
}
|
|
2040
|
+
let failure;
|
|
2041
|
+
if (failures.length === 1) failure = failures[0];
|
|
2042
|
+
else if (failures.length > 1) failure = new SubagentError(`subagent "${childId}" activation teardown failed at ${failures.length} boundaries: ` + failures.map((item) => detail(item)).join("; "), "ACTIVATION_TEARDOWN_FAILED", { cause: new AggregateError(failures) });
|
|
2043
|
+
this.resident.delete(childId);
|
|
2044
|
+
activation.releaseSlot();
|
|
2045
|
+
const terminal = failure === void 0 ? result : {
|
|
2046
|
+
output: [],
|
|
2047
|
+
stopReason: "error"
|
|
2048
|
+
};
|
|
2049
|
+
this.notifySettlement(activation, result);
|
|
2050
|
+
this.releaseOwnership(childId);
|
|
2051
|
+
activation.observer.settle(terminal);
|
|
2052
|
+
if (resultFailure === void 0) activation.result.resolve(result);
|
|
2053
|
+
else activation.result.reject(resultFailure.error);
|
|
2054
|
+
if (failure !== void 0) throw failure;
|
|
2055
|
+
}
|
|
2056
|
+
/** Deliver the captured execution result to the durable direct parent after cleanup. */
|
|
2057
|
+
notifySettlement(activation, terminal) {
|
|
2058
|
+
if (!activation.announced || activation.delivery === "caller") return;
|
|
2059
|
+
try {
|
|
2060
|
+
const parent = this.ctx.agents.get(activation.parent.id);
|
|
2061
|
+
if (parent !== activation.parent) return;
|
|
2062
|
+
const message = createSettlementMessage(activation.childId, terminal, activationAgent(activation) !== void 0);
|
|
2063
|
+
if (this.closingTeardownFor(parent) !== void 0) {
|
|
2064
|
+
parent.inject(message);
|
|
2065
|
+
return;
|
|
2066
|
+
}
|
|
2067
|
+
this.sendWaking(parent, message, parent.status === "idle" ? "queue" : "steer");
|
|
2068
|
+
} catch (error) {
|
|
2069
|
+
this.ctx.logger.warn(`subagent "${activation.childId}" settlement notice was not delivered to its parent: ` + errorChain(error));
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
/** Request a best-effort final session flush before closing natural-settlement admission. */
|
|
2073
|
+
async flushFinalState(activation) {
|
|
2074
|
+
try {
|
|
2075
|
+
await activation.handle.agent.ctx.sessions.flush(activation.handle.agent.session);
|
|
2076
|
+
} catch (error) {
|
|
2077
|
+
this.ctx.logger.warn(`subagent "${activation.childId}" best-effort final session flush failed; the persisted state may be unavailable or stale on resume: ${errorChain(error)}`);
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
/** Return capabilities bound to an exact activation instead of a future same-id instance. */
|
|
2081
|
+
receipt(activation) {
|
|
2082
|
+
return {
|
|
2083
|
+
childId: activation.childId,
|
|
2084
|
+
result: activation.result.promise,
|
|
2085
|
+
dispose: () => this.dispose(activation)
|
|
2086
|
+
};
|
|
1881
2087
|
}
|
|
1882
2088
|
/** Route one parent-originated delivery through residency and cold resume. */
|
|
1883
2089
|
async deliverToChild(parent, childId, content, options) {
|
|
1884
|
-
this.
|
|
1885
|
-
const releaseHold = this.
|
|
2090
|
+
this.assertAdmitting(parent);
|
|
2091
|
+
const releaseHold = this.holdOwnership(parent, childId);
|
|
1886
2092
|
try {
|
|
1887
2093
|
return await this.deliverFollowup(parent, childId, content, options);
|
|
1888
2094
|
} catch (error) {
|
|
@@ -1893,47 +2099,38 @@ var SubagentContinuationManager = class {
|
|
|
1893
2099
|
/** The delivery loop behind {@link deliverToChild}, run under the parent hold. */
|
|
1894
2100
|
async deliverFollowup(parent, childId, content, options) {
|
|
1895
2101
|
while (true) {
|
|
1896
|
-
const live = await this.
|
|
1897
|
-
const activation = this.
|
|
2102
|
+
const live = await this.locks.run(childId, async () => {
|
|
2103
|
+
const activation = this.resident.get(childId);
|
|
1898
2104
|
if (activation === void 0) return this.coldResume(parent, childId, content, options);
|
|
1899
|
-
|
|
2105
|
+
requireLocalActivation(activation);
|
|
2106
|
+
const disposal = activation.closing;
|
|
1900
2107
|
/* v8 ignore next 3 -- the send-versus-dispose cutoff needs a delivery to
|
|
1901
2108
|
* observe the transaction inside the same critical section that opened it. */
|
|
1902
2109
|
if (disposal !== void 0) return disposal.then(() => void 0, () => void 0);
|
|
1903
2110
|
if (contentHasImage(content)) {
|
|
1904
|
-
await this.assertImageCapable(activation.handle.agent, options.signal);
|
|
1905
|
-
if (activation.
|
|
1906
|
-
await Promise.allSettled([activation.
|
|
2111
|
+
await this.assertImageCapable(requireLocalActivation(activation).handle.agent, options.signal);
|
|
2112
|
+
if (activation.closing !== void 0) {
|
|
2113
|
+
await Promise.allSettled([activation.closing]);
|
|
1907
2114
|
return;
|
|
1908
2115
|
}
|
|
1909
2116
|
}
|
|
1910
2117
|
const messageId = this.submitAdmitted(activation, content, options, parent);
|
|
1911
|
-
activation
|
|
2118
|
+
this.announce(activation);
|
|
1912
2119
|
return messageId;
|
|
1913
2120
|
});
|
|
1914
2121
|
/* v8 ignore start -- only a delivery that lost the disposal cutoff retries. */
|
|
1915
2122
|
if (live !== void 0) return live;
|
|
1916
|
-
this.
|
|
2123
|
+
this.assertAdmitting(parent);
|
|
1917
2124
|
options.signal.throwIfAborted();
|
|
1918
2125
|
}
|
|
1919
2126
|
}
|
|
1920
|
-
/**
|
|
1921
|
-
* Interrupt one live continuable child's current turn. Admission is
|
|
1922
|
-
* synchronous and the cancellation effect is asynchronous. An absent or
|
|
1923
|
-
* already-closing target is an accepted no-op after authority checks.
|
|
1924
|
-
* @param targetSessionId - the durable child session id to interrupt.
|
|
1925
|
-
* @param authority - the human parent address or exact live ancestor Agent.
|
|
1926
|
-
*/
|
|
1927
|
-
interrupt(targetSessionId, authority) {
|
|
1928
|
-
this.activations.interrupt(targetSessionId, authority);
|
|
1929
|
-
}
|
|
1930
2127
|
/** Deliver one resident continuable child's message to its live direct parent. */
|
|
1931
2128
|
sendToParent(activation, sender, content) {
|
|
1932
2129
|
/* v8 ignore next 6 -- only synchronous re-entrant teardown can open this
|
|
1933
2130
|
* transaction between exact-agent authorization and this no-await span. */
|
|
1934
|
-
if (activation.
|
|
1935
|
-
const parent = this.ctx.agents.get(activation.
|
|
1936
|
-
if (parent
|
|
2131
|
+
if (activation.closing !== void 0) throw new SubagentError(`subagent "${sender.id}" activation is being disposed; the message was not delivered`, "ACTIVATION_CLOSING");
|
|
2132
|
+
const parent = this.ctx.agents.get(activation.parent.id);
|
|
2133
|
+
if (parent !== activation.parent) throw new SubagentError("direct parent is not live; the message was not delivered", "PARENT_UNAVAILABLE");
|
|
1937
2134
|
const message = createAgentMessage(sender, content);
|
|
1938
2135
|
this.sendAgentMessage(parent, message);
|
|
1939
2136
|
return message.id;
|
|
@@ -1941,30 +2138,11 @@ var SubagentContinuationManager = class {
|
|
|
1941
2138
|
/** Send one Agent message while translating only the target's own rejection. */
|
|
1942
2139
|
sendAgentMessage(parent, message) {
|
|
1943
2140
|
try {
|
|
1944
|
-
this.
|
|
2141
|
+
this.sendWaking(parent, message, "steer");
|
|
1945
2142
|
} catch (error) {
|
|
1946
2143
|
throw new SubagentError("direct parent is not live; the message was not delivered", "PARENT_UNAVAILABLE", { cause: error });
|
|
1947
2144
|
}
|
|
1948
2145
|
}
|
|
1949
|
-
/** Close manager-wide admission and release every live Activation. */
|
|
1950
|
-
async drain() {
|
|
1951
|
-
await this.activations.drain();
|
|
1952
|
-
}
|
|
1953
|
-
/**
|
|
1954
|
-
* Stop only the continuable descendants of exact live host-owned parents.
|
|
1955
|
-
* @param parents - exact live roots whose continuable descendants must stop.
|
|
1956
|
-
*/
|
|
1957
|
-
async drainDescendants(parents) {
|
|
1958
|
-
await this.activations.drainDescendants(parents);
|
|
1959
|
-
}
|
|
1960
|
-
/**
|
|
1961
|
-
* Release selected resident direct children of one exact live parent.
|
|
1962
|
-
* @param parent - exact live direct parent authorizing the selected release.
|
|
1963
|
-
* @param childIds - durable direct-child ids to release when resident.
|
|
1964
|
-
*/
|
|
1965
|
-
async drainChildren(parent, childIds) {
|
|
1966
|
-
await this.activations.drainChildren(parent, childIds);
|
|
1967
|
-
}
|
|
1968
2146
|
/**
|
|
1969
2147
|
* Cold-resume a persisted child and submit the waiting turn. The descriptor
|
|
1970
2148
|
* supplies every reconstruction input; no subagent provider is dispatched.
|
|
@@ -1985,13 +2163,14 @@ var SubagentContinuationManager = class {
|
|
|
1985
2163
|
throw new SubagentError(`subagent "${childId}" is unavailable`, "NOT_RESUMABLE", { cause: error });
|
|
1986
2164
|
}
|
|
1987
2165
|
const source = __addDisposableResource$2(env_1, observation, false);
|
|
1988
|
-
this.
|
|
1989
|
-
this.
|
|
2166
|
+
this.assertAdmitting(parent);
|
|
2167
|
+
this.authorizeLineage(parent, childId, source.header.parentSession);
|
|
1990
2168
|
const descriptor = foldSubagentDescriptor(source.events.slice(source.inheritedEventCount));
|
|
1991
2169
|
if (descriptor === void 0 || descriptor.mode !== "continuable") throw new SubagentError(`subagent "${childId}" has no supported continuation state and cannot be resumed; choose a different target`, "NOT_RESUMABLE");
|
|
1992
2170
|
let activation;
|
|
1993
2171
|
try {
|
|
1994
|
-
activation = await this.
|
|
2172
|
+
activation = await this.materialize({
|
|
2173
|
+
kind: "local",
|
|
1995
2174
|
childId,
|
|
1996
2175
|
provider: descriptor.provider,
|
|
1997
2176
|
parent,
|
|
@@ -2023,16 +2202,16 @@ var SubagentContinuationManager = class {
|
|
|
2023
2202
|
async submitMaterialized(activation, content, options, parent, commit) {
|
|
2024
2203
|
try {
|
|
2025
2204
|
if (contentHasImage(content)) {
|
|
2026
|
-
await this.assertImageCapable(activation.handle.agent, options.signal);
|
|
2027
|
-
if (activation.
|
|
2205
|
+
await this.assertImageCapable(requireLocalActivation(activation).handle.agent, options.signal);
|
|
2206
|
+
if (activation.closing !== void 0) throw new SubagentError(`subagent "${activation.childId}" is closing`, "ACTIVATION_CLOSING");
|
|
2028
2207
|
}
|
|
2029
2208
|
const messageId = this.submitAdmitted(activation, content, options, parent);
|
|
2030
2209
|
commit?.();
|
|
2031
|
-
activation
|
|
2210
|
+
this.announce(activation);
|
|
2032
2211
|
return messageId;
|
|
2033
2212
|
} catch (error) {
|
|
2034
2213
|
try {
|
|
2035
|
-
await this.
|
|
2214
|
+
await this.dispose(activation);
|
|
2036
2215
|
} catch (cleanupError) {
|
|
2037
2216
|
this.ctx.logger.warn(`subagent continuation: disposal after admission or catalog append failure also failed: ${String(cleanupError)}`);
|
|
2038
2217
|
}
|
|
@@ -2045,7 +2224,16 @@ var SubagentContinuationManager = class {
|
|
|
2045
2224
|
content,
|
|
2046
2225
|
source: options.source
|
|
2047
2226
|
});
|
|
2048
|
-
|
|
2227
|
+
options.signal.throwIfAborted();
|
|
2228
|
+
this.assertAdmitting(parent);
|
|
2229
|
+
this.authorizeLineage(parent, activation.childId, activation.parent.id);
|
|
2230
|
+
this.acquireOwnership(parent, activation.childId);
|
|
2231
|
+
try {
|
|
2232
|
+
this.deliver(activation, message, options.delivery);
|
|
2233
|
+
} finally {
|
|
2234
|
+
this.wake(activation);
|
|
2235
|
+
}
|
|
2236
|
+
return message.id;
|
|
2049
2237
|
}
|
|
2050
2238
|
/** Refuse image content for a child whose fixed model accepts text only. */
|
|
2051
2239
|
async assertImageCapable(agent, signal) {
|
|
@@ -2198,7 +2386,7 @@ async function listDescendants(ctx, rootSessionId, signal) {
|
|
|
2198
2386
|
visited.add(entry.id);
|
|
2199
2387
|
let children;
|
|
2200
2388
|
try {
|
|
2201
|
-
children = await readChildren(entry.id);
|
|
2389
|
+
children = entry.mode === "external" ? [] : await readChildren(entry.id);
|
|
2202
2390
|
} catch (error) {
|
|
2203
2391
|
if (error instanceof SubagentError) throw error;
|
|
2204
2392
|
const code = error instanceof Error && "code" in error ? error.code : void 0;
|
|
@@ -2556,14 +2744,30 @@ const subagentIdentityProjectionDefinition = {
|
|
|
2556
2744
|
* Provider-side vocabulary for OUT-OF-PROCESS subagent backends — the pieces
|
|
2557
2745
|
* that enforce this seam's own contracts around a child in another process:
|
|
2558
2746
|
* the no-capabilities advertisement, timing-bound validation, child
|
|
2559
|
-
* working-directory
|
|
2560
|
-
* session's workspace), the never-reject result settlement, and the standard
|
|
2747
|
+
* working-directory validation, the never-reject result settlement, and the standard
|
|
2561
2748
|
* run-handle publication. Backends compose these with their own wire drivers;
|
|
2562
2749
|
* the process machinery itself (spawn, env scrub, managed-range teardown)
|
|
2563
2750
|
* belongs to the `dsh-subprocess` seam.
|
|
2564
2751
|
*
|
|
2565
2752
|
* @module @deepseek-ai/dsh-subagent/out-of-process
|
|
2566
2753
|
*/
|
|
2754
|
+
/** Maximum UTF-8 size of {@link SubagentResult.diagnostic}. */
|
|
2755
|
+
const MAX_SUBAGENT_DIAGNOSTIC_BYTES = 4096;
|
|
2756
|
+
const DIAGNOSTIC_TRUNCATION_SUFFIX = "\n[diagnostic truncated]";
|
|
2757
|
+
const utf8Encoder = new TextEncoder();
|
|
2758
|
+
const utf8Decoder = new TextDecoder();
|
|
2759
|
+
/**
|
|
2760
|
+
* Limit provider-authored failure detail without splitting a UTF-8 sequence.
|
|
2761
|
+
* @param diagnostic - safe diagnostic text produced by the provider.
|
|
2762
|
+
* @returns the original text, or a visibly truncated value within the limit.
|
|
2763
|
+
*/
|
|
2764
|
+
function limitSubagentDiagnostic(diagnostic) {
|
|
2765
|
+
const bytes = utf8Encoder.encode(diagnostic);
|
|
2766
|
+
if (bytes.byteLength <= MAX_SUBAGENT_DIAGNOSTIC_BYTES) return diagnostic;
|
|
2767
|
+
let prefixBytes = MAX_SUBAGENT_DIAGNOSTIC_BYTES - utf8Encoder.encode(DIAGNOSTIC_TRUNCATION_SUFFIX).byteLength;
|
|
2768
|
+
while ((bytes[prefixBytes] & 192) === 128) prefixBytes -= 1;
|
|
2769
|
+
return utf8Decoder.decode(bytes.subarray(0, prefixBytes)) + DIAGNOSTIC_TRUNCATION_SUFFIX;
|
|
2770
|
+
}
|
|
2567
2771
|
/** Enforce the byte limit on a provider-returned diagnostic. */
|
|
2568
2772
|
function normalizeSubagentDiagnostic(result) {
|
|
2569
2773
|
return result.diagnostic === void 0 ? result : {
|
|
@@ -2623,39 +2827,6 @@ function assertUsableCwd(prefix, label, cwd) {
|
|
|
2623
2827
|
if (!isEnterableDirectory(cwd)) throw new Error(`${prefix}: ${label} is not an accessible directory: ${cwd}`);
|
|
2624
2828
|
return cwd;
|
|
2625
2829
|
}
|
|
2626
|
-
/**
|
|
2627
|
-
* Validate a configured `cwd` override ONCE, at plugin load: reject the empty
|
|
2628
|
-
* string (`path.resolve('')` is the process cwd — it would silently
|
|
2629
|
-
* reintroduce the launch-directory fallback this resolution removes),
|
|
2630
|
-
* interpret a relative path against the harness launch directory, and require
|
|
2631
|
-
* an enterable directory.
|
|
2632
|
-
* @param prefix - the consuming plugin's diagnostic prefix.
|
|
2633
|
-
* @param cwd - the configured override, or `undefined` when the config omits it.
|
|
2634
|
-
* @returns the validated absolute override, or `undefined` when omitted.
|
|
2635
|
-
*/
|
|
2636
|
-
function validateConfiguredCwd(prefix, cwd) {
|
|
2637
|
-
if (cwd === void 0) return void 0;
|
|
2638
|
-
if (cwd === "") throw new Error(`${prefix}: config cwd must not be empty — omit the key to inherit the parent session cwd`);
|
|
2639
|
-
return assertUsableCwd(prefix, "config cwd", resolve(cwd));
|
|
2640
|
-
}
|
|
2641
|
-
/**
|
|
2642
|
-
* Resolve the child's working directory at start: the deployment override
|
|
2643
|
-
* when configured (already validated at load), else the parent session's
|
|
2644
|
-
* workspace cwd (validated here, its earliest resolvable point). Fails loud
|
|
2645
|
-
* when neither exists — falling back to the harness process cwd would
|
|
2646
|
-
* silently bind the child to the server's launch directory instead of the
|
|
2647
|
-
* delegating session's workspace (one server process serves many sessions,
|
|
2648
|
-
* each with its own cwd).
|
|
2649
|
-
* @param prefix - the consuming plugin's diagnostic prefix.
|
|
2650
|
-
* @param configured - the load-validated override, or `undefined`.
|
|
2651
|
-
* @param parentCwd - the delegating parent session's workspace cwd, if any.
|
|
2652
|
-
* @returns the absolute child working directory.
|
|
2653
|
-
*/
|
|
2654
|
-
function resolveChildCwd(prefix, configured, parentCwd) {
|
|
2655
|
-
if (configured !== void 0) return configured;
|
|
2656
|
-
if (parentCwd === void 0) throw new Error(`${prefix}: no working directory for the child — configure \`cwd\` or delegate from a parent session that has one`);
|
|
2657
|
-
return assertUsableCwd(prefix, "parent session cwd", parentCwd);
|
|
2658
|
-
}
|
|
2659
2830
|
/** Normalize an unknown thrown value to an Error (the catch binding is `unknown`). */
|
|
2660
2831
|
function toError(value) {
|
|
2661
2832
|
/* v8 ignore next */
|
|
@@ -2703,13 +2874,12 @@ async function settleRunResult(parts) {
|
|
|
2703
2874
|
* local cancellation — there is no assumption the child cooperates — and then
|
|
2704
2875
|
* awaits the backend's teardown to actual exit.
|
|
2705
2876
|
* @param parts - the run identity, result, cancellation wiring, and teardown.
|
|
2706
|
-
* @returns the
|
|
2877
|
+
* @returns the external run handle.
|
|
2707
2878
|
*/
|
|
2708
2879
|
function subprocessRunHandle(parts) {
|
|
2709
2880
|
let disposal;
|
|
2710
2881
|
return {
|
|
2711
2882
|
id: parts.id,
|
|
2712
|
-
localAgent: void 0,
|
|
2713
2883
|
result: parts.result,
|
|
2714
2884
|
dispose() {
|
|
2715
2885
|
if (disposal !== void 0) return disposal;
|
|
@@ -2721,80 +2891,6 @@ function subprocessRunHandle(parts) {
|
|
|
2721
2891
|
};
|
|
2722
2892
|
}
|
|
2723
2893
|
//#endregion
|
|
2724
|
-
//#region lib/types/run-settlement.js
|
|
2725
|
-
/**
|
|
2726
|
-
* Settlement of one ONE-SHOT subagent run into a background-Task outcome. Only
|
|
2727
|
-
* the one-shot background path uses Jobs; continuable children have no Task,
|
|
2728
|
-
* no per-message result, and no Task cancellation.
|
|
2729
|
-
*
|
|
2730
|
-
* @module @deepseek-ai/dsh-subagent/run-settlement
|
|
2731
|
-
*/
|
|
2732
|
-
/** Flatten a child's final output blocks to the task's final text. */
|
|
2733
|
-
function finalText(blocks) {
|
|
2734
|
-
return blocks.filter((block) => block.type === "text").map((block) => block.text).join("");
|
|
2735
|
-
}
|
|
2736
|
-
/** Render a failed stop reason with optional provider-authored detail. */
|
|
2737
|
-
function failureDetail(result) {
|
|
2738
|
-
const stopReason = result.stopReason;
|
|
2739
|
-
return result.diagnostic === void 0 ? stopReason : `${stopReason}; diagnostic: ${result.diagnostic}`;
|
|
2740
|
-
}
|
|
2741
|
-
/**
|
|
2742
|
-
* Map a child result to the task outcome: completed carries final text, local
|
|
2743
|
-
* cancellation (`aborted` without a diagnostic) is killed, and provider-
|
|
2744
|
-
* diagnosed remote aborts plus every other reason are failed without partial
|
|
2745
|
-
* output.
|
|
2746
|
-
* @param result - child terminal result.
|
|
2747
|
-
* @returns outcome for the `ctx.jobs` registration.
|
|
2748
|
-
*/
|
|
2749
|
-
function runOutcome(result) {
|
|
2750
|
-
switch (result.stopReason) {
|
|
2751
|
-
case "completed": return {
|
|
2752
|
-
status: "completed",
|
|
2753
|
-
result: finalText(result.output)
|
|
2754
|
-
};
|
|
2755
|
-
case "aborted": return result.diagnostic === void 0 ? { status: "killed" } : {
|
|
2756
|
-
status: "failed",
|
|
2757
|
-
detail: failureDetail(result)
|
|
2758
|
-
};
|
|
2759
|
-
case "error":
|
|
2760
|
-
case "max-tokens":
|
|
2761
|
-
case "refusal": return {
|
|
2762
|
-
status: "failed",
|
|
2763
|
-
detail: failureDetail(result)
|
|
2764
|
-
};
|
|
2765
|
-
default: return {
|
|
2766
|
-
status: "failed",
|
|
2767
|
-
detail: failureDetail(result)
|
|
2768
|
-
};
|
|
2769
|
-
}
|
|
2770
|
-
}
|
|
2771
|
-
/**
|
|
2772
|
-
* Await the child result, dispose the run, then return its task outcome. Result
|
|
2773
|
-
* and disposal failures become `failed`; when both fail, both details survive.
|
|
2774
|
-
* @param run - live run to settle and release.
|
|
2775
|
-
* @returns outcome after child resources are released.
|
|
2776
|
-
*/
|
|
2777
|
-
async function settleRun(run) {
|
|
2778
|
-
let outcome;
|
|
2779
|
-
try {
|
|
2780
|
-
outcome = runOutcome(await run.result);
|
|
2781
|
-
} catch (error) {
|
|
2782
|
-
outcome = {
|
|
2783
|
-
status: "failed",
|
|
2784
|
-
detail: String(error)
|
|
2785
|
-
};
|
|
2786
|
-
}
|
|
2787
|
-
try {
|
|
2788
|
-
await run.dispose();
|
|
2789
|
-
} catch (error) {
|
|
2790
|
-
return {
|
|
2791
|
-
status: "failed",
|
|
2792
|
-
detail: `${outcome.detail === void 0 ? "" : `${outcome.detail}; `}dispose failed: ${String(error)}`
|
|
2793
|
-
};
|
|
2794
|
-
}
|
|
2795
|
-
return outcome;
|
|
2796
|
-
}
|
|
2797
|
-
//#endregion
|
|
2798
2894
|
//#region lib/types/index.js
|
|
2799
2895
|
var __runInitializers = function(thisArg, initializers, value) {
|
|
2800
2896
|
var useValue = arguments.length > 2;
|
|
@@ -2834,7 +2930,7 @@ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializ
|
|
|
2834
2930
|
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
2835
2931
|
done = true;
|
|
2836
2932
|
};
|
|
2837
|
-
/** Named provider registry with
|
|
2933
|
+
/** Named provider registry with managed activations, durable discovery, and local child messaging. */
|
|
2838
2934
|
let SubagentRuntime = (() => {
|
|
2839
2935
|
let _classSuper = TypertRemoteService;
|
|
2840
2936
|
let _instanceExtraInitializers = [];
|
|
@@ -2879,8 +2975,9 @@ let SubagentRuntime = (() => {
|
|
|
2879
2975
|
maxDepth: z.number().step(1).min(0).max(Number.MAX_SAFE_INTEGER).default(1).volatile(),
|
|
2880
2976
|
maxActiveSubagents: z.number().step(1).min(1).max(Number.MAX_SAFE_INTEGER).default(8).volatile()
|
|
2881
2977
|
});
|
|
2978
|
+
static inject = ["workingDirectory"];
|
|
2882
2979
|
providers = /* @__PURE__ */ new Map();
|
|
2883
|
-
|
|
2980
|
+
manager;
|
|
2884
2981
|
/**
|
|
2885
2982
|
* The contained lifecycle-edge publisher. Built here because scoped dispatch
|
|
2886
2983
|
* keys its carrier by this exact service instance, whose own context filter
|
|
@@ -2892,21 +2989,23 @@ let SubagentRuntime = (() => {
|
|
|
2892
2989
|
this.config = config;
|
|
2893
2990
|
this.emitLifecycle = createLifecycleEmitter(this.ctx, (parent) => scopeTarget(this, parent));
|
|
2894
2991
|
ctx.inject(["agents"], (childCtx) => {
|
|
2895
|
-
const manager = new
|
|
2992
|
+
const manager = new SubagentManager(childCtx, {
|
|
2993
|
+
startExternal: (name, request) => {
|
|
2994
|
+
return this.expectProvider(name).start(request);
|
|
2995
|
+
},
|
|
2896
2996
|
prepareContinuable: (name, request) => this.prepareContinuable(name, request),
|
|
2897
2997
|
observeActivation: (provider, childId, parent) => this.observeActivation(provider, childId, parent)
|
|
2898
2998
|
}, () => this.config.maxActiveSubagents.get());
|
|
2899
|
-
this.
|
|
2999
|
+
this.manager = manager;
|
|
2900
3000
|
childCtx.effect(() => () => {
|
|
2901
3001
|
/* v8 ignore else -- one injected binding owns the slot until its fiber disposes. */
|
|
2902
|
-
if (this.
|
|
2903
|
-
}, "subagents.
|
|
3002
|
+
if (this.manager === manager) this.manager = void 0;
|
|
3003
|
+
}, "subagents.managerBinding()");
|
|
2904
3004
|
});
|
|
2905
3005
|
ctx.inject(["sessionProjections"], (projectionCtx) => {
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
projections.register(subagentIdentityProjectionDefinition);
|
|
3006
|
+
projectionCtx.sessionProjections.register(subagentCatalogProjectionDefinition);
|
|
3007
|
+
projectionCtx.sessionProjections.register(subagentTimingProjectionDefinition);
|
|
3008
|
+
projectionCtx.sessionProjections.register(subagentIdentityProjectionDefinition);
|
|
2910
3009
|
});
|
|
2911
3010
|
ctx.inject(["agents"], (agentsCtx) => {
|
|
2912
3011
|
installSubagentArchiveAdmission(agentsCtx);
|
|
@@ -2925,16 +3024,32 @@ let SubagentRuntime = (() => {
|
|
|
2925
3024
|
return depth;
|
|
2926
3025
|
}
|
|
2927
3026
|
/**
|
|
2928
|
-
* Establish
|
|
2929
|
-
*
|
|
2930
|
-
*
|
|
2931
|
-
*
|
|
2932
|
-
* @param spec - provider, delegation request, and caller cancellation.
|
|
2933
|
-
* @returns the durable child id and the accepted prompt's message id.
|
|
2934
|
-
* @throws when continuation services are unavailable or materialization fails.
|
|
3027
|
+
* Establish a managed child with backend-specific execution capabilities.
|
|
3028
|
+
* @param spec - task, backend, and result recipient.
|
|
3029
|
+
* @returns identities, execution result, and exact-activation disposal. A reserved
|
|
3030
|
+
* childId requires a local backend and guarantees an accepted messageId.
|
|
2935
3031
|
*/
|
|
2936
|
-
async
|
|
2937
|
-
|
|
3032
|
+
async startActivation(spec) {
|
|
3033
|
+
const provider = this.expectProvider(spec.provider);
|
|
3034
|
+
if (spec.childId !== void 0 && provider.prepareContinuable === void 0) throw new SubagentError("reserved child ids require a local backend", "UNSUPPORTED_CAPABILITY");
|
|
3035
|
+
assertSubagentMaxDepth(spec.request.maxDepth);
|
|
3036
|
+
this.assertCapabilities(provider, {
|
|
3037
|
+
...spec.request,
|
|
3038
|
+
signal: spec.signal
|
|
3039
|
+
});
|
|
3040
|
+
const manager = this.requireManager();
|
|
3041
|
+
if (this.ctx.get("agents")?.get(spec.request.parent.id) !== spec.request.parent) throw new SubagentError("subagent creation requires the exact live parent agent", "UNAUTHORIZED");
|
|
3042
|
+
if (spec.request.outputSchema !== void 0) assertObjectJsonSchema(spec.request.outputSchema);
|
|
3043
|
+
return provider.prepareContinuable === void 0 ? manager.startExternal(spec) : manager.startLocal(spec);
|
|
3044
|
+
}
|
|
3045
|
+
/**
|
|
3046
|
+
* Join progressing descendants without cancelling them. Idle descendants whose
|
|
3047
|
+
* inboxes require a later wake stay resident and do not delay host completion.
|
|
3048
|
+
* @param parent - the exact parent whose descendant work is observed.
|
|
3049
|
+
* @returns whether work was joined; hosts recheck parent idle after true.
|
|
3050
|
+
*/
|
|
3051
|
+
async waitForChildren(parent) {
|
|
3052
|
+
return this.manager?.waitForChildren(parent) ?? false;
|
|
2938
3053
|
}
|
|
2939
3054
|
/**
|
|
2940
3055
|
* Steer one model-authored message to the sender's direct parent or direct
|
|
@@ -2951,7 +3066,7 @@ let SubagentRuntime = (() => {
|
|
|
2951
3066
|
* or the message was not admitted.
|
|
2952
3067
|
*/
|
|
2953
3068
|
async sendMessage(sender, targetId, content, options) {
|
|
2954
|
-
return this.
|
|
3069
|
+
return this.requireManager().sendMessage(sender, targetId, content, options);
|
|
2955
3070
|
}
|
|
2956
3071
|
/**
|
|
2957
3072
|
* Deliver one host-protocol message to a direct continuable child.
|
|
@@ -2966,16 +3081,16 @@ let SubagentRuntime = (() => {
|
|
|
2966
3081
|
* @returns the accepted message's inbox id.
|
|
2967
3082
|
*/
|
|
2968
3083
|
[deliverSubagentPrompt](parent, childId, content, source, signal, delivery) {
|
|
2969
|
-
return delivery === "steer" ? this.
|
|
3084
|
+
return delivery === "steer" ? this.requireManager().steerPrompt(parent, childId, content, source, signal) : this.requireManager().queuePrompt(parent, childId, content, source, signal);
|
|
2970
3085
|
}
|
|
2971
3086
|
/**
|
|
2972
|
-
* Interrupt one live
|
|
3087
|
+
* Interrupt one live child's current execution under a human parent
|
|
2973
3088
|
* address or an exact live ancestor Agent. Fire-and-return: the cancel
|
|
2974
3089
|
* signal is issued before this returns, but the target may keep running
|
|
2975
3090
|
* until it observes the signal. Unclaimed pending inbox work, the Activation,
|
|
2976
3091
|
* and published descendants are preserved; claimed work is not requeued.
|
|
2977
|
-
* Once the interrupted
|
|
2978
|
-
* queue.
|
|
3092
|
+
* Once the interrupted Agent is idle, a waking send resumes the parked FIFO
|
|
3093
|
+
* queue. External backends stop their single execution. An absent target
|
|
2979
3094
|
* is an accepted no-op, as is a manager-less composition, which cannot own a
|
|
2980
3095
|
* live Activation.
|
|
2981
3096
|
* @param targetSessionId - the durable child session id to interrupt.
|
|
@@ -2984,35 +3099,35 @@ let SubagentRuntime = (() => {
|
|
|
2984
3099
|
* live target.
|
|
2985
3100
|
*/
|
|
2986
3101
|
interrupt(targetSessionId, authority) {
|
|
2987
|
-
this.
|
|
3102
|
+
this.manager?.interrupt(targetSessionId, authority);
|
|
2988
3103
|
}
|
|
2989
3104
|
/**
|
|
2990
|
-
* Close
|
|
3105
|
+
* Close subagent admission below exact live parent Agents, stop only their
|
|
2991
3106
|
* visible descendant Activations synchronously, then await admitted scoped
|
|
2992
3107
|
* materializations and release those forests child-first. The scoped cutoff
|
|
2993
3108
|
* lasts until each exact parent leaves the registry; unrelated parent trees
|
|
2994
3109
|
* remain live.
|
|
2995
3110
|
* @param parents - exact host-owned parent Agents entering teardown.
|
|
2996
|
-
* @returns once every retained descendant
|
|
3111
|
+
* @returns once every retained descendant activation released its execution handle.
|
|
2997
3112
|
* @throws an aggregate error after all branches settle when any failed.
|
|
2998
3113
|
*/
|
|
2999
|
-
async
|
|
3000
|
-
const manager = this.
|
|
3114
|
+
async drainDescendants(parents) {
|
|
3115
|
+
const manager = this.manager;
|
|
3001
3116
|
if (manager === void 0) return;
|
|
3002
3117
|
await manager.drainDescendants(parents);
|
|
3003
3118
|
}
|
|
3004
3119
|
/**
|
|
3005
|
-
* Release selected resident
|
|
3120
|
+
* Release selected resident direct children of one exact live
|
|
3006
3121
|
* parent. Other children of the same parent remain admitted and resident.
|
|
3007
3122
|
* Absent targets and a manager-less composition are accepted no-ops.
|
|
3008
3123
|
* @param parent - exact live direct parent authorizing the selected release.
|
|
3009
3124
|
* @param childIds - durable direct-child ids to release when resident.
|
|
3010
|
-
* @returns once every selected
|
|
3125
|
+
* @returns once every selected activation released its execution handle.
|
|
3011
3126
|
* @throws {SubagentError} `UNAUTHORIZED` when a resident target belongs to a
|
|
3012
3127
|
* different parent or the supplied parent identity is stale.
|
|
3013
3128
|
*/
|
|
3014
|
-
async
|
|
3015
|
-
const manager = this.
|
|
3129
|
+
async drainChildren(parent, childIds) {
|
|
3130
|
+
const manager = this.manager;
|
|
3016
3131
|
if (manager === void 0) return;
|
|
3017
3132
|
await manager.drainChildren(parent, childIds);
|
|
3018
3133
|
}
|
|
@@ -3031,7 +3146,8 @@ let SubagentRuntime = (() => {
|
|
|
3031
3146
|
/**
|
|
3032
3147
|
* Recursively list reachable parent catalogs in stable pre-order, preserving
|
|
3033
3148
|
* each catalog's event order. Each row carries its catalog parent and depth;
|
|
3034
|
-
* one-shot and unknown-mode children remain
|
|
3149
|
+
* external children are leaves; one-shot and unknown-mode children remain
|
|
3150
|
+
* traversal nodes. Unknown modes
|
|
3035
3151
|
* produce unsupported diagnostics. Unreadable child catalogs produce corrupt
|
|
3036
3152
|
* or unavailable diagnostics and stop only that branch. Root read failures,
|
|
3037
3153
|
* missing services or projections, and cancellation reject the whole listing.
|
|
@@ -3126,12 +3242,14 @@ let SubagentRuntime = (() => {
|
|
|
3126
3242
|
/**
|
|
3127
3243
|
* Register a provider under its name. Registration is effect-scoped and HMR
|
|
3128
3244
|
* safe; removing a provider blocks new starts but does not revoke runs that
|
|
3129
|
-
* were already returned to their holders.
|
|
3245
|
+
* were already returned to their holders. Providers without either execution
|
|
3246
|
+
* method are rejected with UNSUPPORTED_CAPABILITY before registration.
|
|
3130
3247
|
* @param provider - the trusted provider implementation.
|
|
3131
3248
|
* @returns the exact Cordis effect disposer.
|
|
3132
3249
|
*/
|
|
3133
3250
|
registerProvider(provider) {
|
|
3134
3251
|
const name = provider.name;
|
|
3252
|
+
if (provider.start === void 0 && provider.prepareContinuable === void 0) throw new SubagentError(`subagent provider "${name}" must implement start or prepareContinuable`, "UNSUPPORTED_CAPABILITY");
|
|
3135
3253
|
return this.ctx.effect(function* () {
|
|
3136
3254
|
if (this.providers.has(name)) throw new SubagentError(`a subagent provider named "${name}" is already registered`, "DUPLICATE_PROVIDER");
|
|
3137
3255
|
this.providers.set(name, provider);
|
|
@@ -3158,55 +3276,12 @@ let SubagentRuntime = (() => {
|
|
|
3158
3276
|
return [...this.providers.keys()];
|
|
3159
3277
|
}
|
|
3160
3278
|
/**
|
|
3161
|
-
* Establish a published child on the named provider. Capability and semantic
|
|
3162
|
-
* checks run before delegation. Provider ownership lasts until its promise
|
|
3163
|
-
* fulfills; a rejection therefore has no run for the caller to dispose and
|
|
3164
|
-
* emits no run lifecycle events. Post-publication turn and infrastructure
|
|
3165
|
-
* failures settle through the returned run.
|
|
3166
|
-
* A catalog append failure disposes the run and handles its result rejection;
|
|
3167
|
-
* the caller receives the catalog error even if disposal also fails.
|
|
3168
|
-
* @param name - the provider to use.
|
|
3169
|
-
* @param request - child label, prompt, parent, signal, and optional capabilities.
|
|
3170
|
-
* @returns the published holder-owned run.
|
|
3171
|
-
*/
|
|
3172
|
-
async start(name, request) {
|
|
3173
|
-
const provider = this.expectProvider(name);
|
|
3174
|
-
this.assertCapabilities(provider, request);
|
|
3175
|
-
assertSubagentMaxDepth(request.maxDepth);
|
|
3176
|
-
if (request.outputSchema !== void 0) assertObjectJsonSchema(request.outputSchema);
|
|
3177
|
-
const descriptor = snapshotSubagentDescriptor({
|
|
3178
|
-
mode: "one-shot",
|
|
3179
|
-
provider: name,
|
|
3180
|
-
...request.label !== void 0 ? { label: request.label } : {}
|
|
3181
|
-
});
|
|
3182
|
-
const resolved = {
|
|
3183
|
-
...request,
|
|
3184
|
-
descriptor
|
|
3185
|
-
};
|
|
3186
|
-
const run = await provider.start(resolved);
|
|
3187
|
-
const child = run.localAgent?.session;
|
|
3188
|
-
if (child !== void 0) try {
|
|
3189
|
-
establishCatalogChild(request.parent.session, child.header, descriptor);
|
|
3190
|
-
} catch (error) {
|
|
3191
|
-
run.result.catch(() => void 0);
|
|
3192
|
-
try {
|
|
3193
|
-
await run.dispose();
|
|
3194
|
-
} catch (cleanupError) {
|
|
3195
|
-
this.ctx.logger.warn(`subagent: disposal after catalog append failure also failed: ${String(cleanupError)}`);
|
|
3196
|
-
}
|
|
3197
|
-
throw error;
|
|
3198
|
-
}
|
|
3199
|
-
return observeRun(this.emitLifecycle, name, request.parent, run);
|
|
3200
|
-
}
|
|
3201
|
-
/**
|
|
3202
3279
|
* Resolve one provider's detached continuable-creation contribution. Method
|
|
3203
3280
|
* presence on the provider IS the capability, so a provider without it is
|
|
3204
3281
|
* rejected before the manager reserves any child resources.
|
|
3205
3282
|
*/
|
|
3206
3283
|
async prepareContinuable(name, request) {
|
|
3207
|
-
|
|
3208
|
-
if (provider.prepareContinuable === void 0) throw new SubagentError(`subagent provider "${provider.name}" does not support continuable children (no prepareContinuable capability)`, "UNSUPPORTED_CAPABILITY");
|
|
3209
|
-
return provider.prepareContinuable(request);
|
|
3284
|
+
return this.expectProvider(name).prepareContinuable(request);
|
|
3210
3285
|
}
|
|
3211
3286
|
/** Look up a provider for dispatch or fail loud. */
|
|
3212
3287
|
expectProvider(name) {
|
|
@@ -3214,10 +3289,10 @@ let SubagentRuntime = (() => {
|
|
|
3214
3289
|
if (provider === void 0) throw new SubagentError(`no subagent provider registered for "${name}"`, "NO_PROVIDER");
|
|
3215
3290
|
return provider;
|
|
3216
3291
|
}
|
|
3217
|
-
/** Resolve the
|
|
3218
|
-
|
|
3219
|
-
if (this.
|
|
3220
|
-
return this.
|
|
3292
|
+
/** Resolve the subagent manager or fail loud. */
|
|
3293
|
+
requireManager() {
|
|
3294
|
+
if (this.manager === void 0) throw new SubagentError("continuable subagents require the agents service", "CONTINUATION_UNAVAILABLE");
|
|
3295
|
+
return this.manager;
|
|
3221
3296
|
}
|
|
3222
3297
|
/**
|
|
3223
3298
|
* Build the lifecycle observer for one continuable Activation's residency
|
|
@@ -3255,4 +3330,4 @@ let SubagentRuntime = (() => {
|
|
|
3255
3330
|
};
|
|
3256
3331
|
})();
|
|
3257
3332
|
//#endregion
|
|
3258
|
-
export { AssistantOutputFold, NO_START_CAPABILITIES, SUBAGENT_DESCRIPTOR_VERSION, SubagentDepthError, SubagentError, SubagentRunId, SubagentRuntime, SubagentRuntime as default, appendDelegatedPolicyOverrides, applyChildComposition, assertPositiveFinite, assertSubagentMaxDepth, assertUsableCwd, captureDelegatedPolicyOverrides, childSessionMeta, delegationDepthOf, finalAssistantOutput, foldSubagentDescriptor, parentAgentOptionsForDelegation, resolveChildAgentOptions,
|
|
3333
|
+
export { AssistantOutputFold, NO_START_CAPABILITIES, STRUCTURED_OUTPUT_TOOL, SUBAGENT_DESCRIPTOR_VERSION, SubagentDepthError, SubagentError, SubagentRunId, SubagentRuntime, SubagentRuntime as default, appendDelegatedPolicyOverrides, applyChildComposition, assertPositiveFinite, assertSubagentMaxDepth, assertUsableCwd, captureDelegatedPolicyOverrides, childSessionMeta, delegationDepthOf, finalAssistantOutput, foldSubagentDescriptor, parentAgentOptionsForDelegation, resolveChildAgentOptions, resolveChildDepth, settleRunResult, snapshotSubagentDescriptor, subprocessRunHandle };
|