@deepseek-ai/dsh-subagent 0.2.2-rc.5 → 0.2.3-alpha.2

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.
Files changed (53) hide show
  1. package/README.i18n.yaml +20 -8
  2. package/README.md +21 -5
  3. package/README.zh.md +21 -5
  4. package/lib/index.js +94 -42
  5. package/lib/typert.host.js +45 -7
  6. package/lib/typert.remote-client.d.ts.map +1 -1
  7. package/lib/typert.remote-client.js +2 -2
  8. package/lib/types/activation.d.ts +2 -0
  9. package/lib/types/activation.d.ts.map +1 -1
  10. package/lib/types/activation.js +4 -0
  11. package/lib/types/activation.js.map +1 -1
  12. package/lib/types/child-agent.d.ts +8 -4
  13. package/lib/types/child-agent.d.ts.map +1 -1
  14. package/lib/types/child-agent.js +14 -8
  15. package/lib/types/child-agent.js.map +1 -1
  16. package/lib/types/control-types.d.ts +1 -1
  17. package/lib/types/depth.d.ts +1 -1
  18. package/lib/types/depth.d.ts.map +1 -1
  19. package/lib/types/depth.js +3 -2
  20. package/lib/types/depth.js.map +1 -1
  21. package/lib/types/error.d.ts +83 -2
  22. package/lib/types/error.d.ts.map +1 -1
  23. package/lib/types/error.js +8 -1
  24. package/lib/types/error.js.map +1 -1
  25. package/lib/types/index.d.ts +11 -3
  26. package/lib/types/index.d.ts.map +1 -1
  27. package/lib/types/index.js +13 -1
  28. package/lib/types/index.js.map +1 -1
  29. package/lib/types/manager.d.ts +7 -1
  30. package/lib/types/manager.d.ts.map +1 -1
  31. package/lib/types/manager.js +30 -10
  32. package/lib/types/manager.js.map +1 -1
  33. package/lib/types/out-of-process.d.ts +1 -0
  34. package/lib/types/out-of-process.d.ts.map +1 -1
  35. package/lib/types/out-of-process.js +5 -3
  36. package/lib/types/out-of-process.js.map +1 -1
  37. package/lib/types/structured.d.ts.map +1 -1
  38. package/lib/types/structured.js +4 -2
  39. package/lib/types/structured.js.map +1 -1
  40. package/lib/types/types.d.ts +12 -4
  41. package/lib/types/types.d.ts.map +1 -1
  42. package/lib/types/types.js.map +1 -1
  43. package/package.json +54 -53
  44. package/src/activation.ts +5 -0
  45. package/src/child-agent.ts +14 -9
  46. package/src/control-types.ts +1 -1
  47. package/src/depth.ts +3 -2
  48. package/src/error.ts +86 -2
  49. package/src/index.ts +18 -2
  50. package/src/manager.ts +37 -11
  51. package/src/out-of-process.ts +5 -3
  52. package/src/structured.ts +4 -1
  53. package/src/types.ts +13 -4
@@ -81,7 +81,7 @@ const $remote = createTypertRemoteInfo({
81
81
  description: 'acknowledgement that the cancel signal was admitted, not that the target is quiescent.',
82
82
  jsonSchema: {"type":"object","properties":{"accepted":{"type":"boolean","const":true}},"required":["accepted"],"additionalProperties":true},
83
83
  },
84
- sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":504,"column":3},
84
+ sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":520,"column":3},
85
85
  },
86
86
  'subagents/prompt': {
87
87
  service: 'subagents',
@@ -114,7 +114,7 @@ const $remote = createTypertRemoteInfo({
114
114
  description: 'the accepted message\'s inbox identity.',
115
115
  jsonSchema: {"type":"object","properties":{"messageId":{"type":"string"}},"required":["messageId"],"additionalProperties":true},
116
116
  },
117
- sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":451,"column":9},
117
+ sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":467,"column":9},
118
118
  },
119
119
  },
120
120
  }, z)
@@ -135,6 +135,13 @@ export const TYPERT = {
135
135
  "key": "subagents",
136
136
  "exportName": "SubagentRuntime",
137
137
  "members": [
138
+ {
139
+ "kind": "getter",
140
+ "name": "maxActiveSubagents",
141
+ "signature": "get maxActiveSubagents(): number",
142
+ "summary": "Current concurrency limit shared by all descendants in each subagent tree.",
143
+ "jsDoc": "/** Current concurrency limit shared by all descendants in each subagent tree. */"
144
+ },
138
145
  {
139
146
  "kind": "method",
140
147
  "name": "resolveMaxDepth",
@@ -163,6 +170,13 @@ export const TYPERT = {
163
170
  "summary": "Resolve the root shared by an Agent and its other agents in its subagent tree.",
164
171
  "jsDoc": "/**\n * Resolve the root shared by an Agent and its other agents in its subagent tree.\n * @param caller - exact live Agent whose subagent ancestry selects the tree.\n * @returns the live root; ordinary Session forks lead independent trees.\n * @throws when the caller or its runtime owner is unavailable.\n */"
165
172
  },
173
+ {
174
+ "kind": "method",
175
+ "name": "capacityOf",
176
+ "signature": "capacityOf(caller: Agent): SubagentCapacity",
177
+ "summary": "Observe the shared concurrency capacity of the caller's subagent tree.",
178
+ "jsDoc": "/**\n * Observe the shared concurrency capacity of the caller's subagent tree.\n * @param caller - exact live root or resident tree member.\n * @returns occupied slots and the current limit; this observation reserves no capacity.\n */"
179
+ },
166
180
  {
167
181
  "kind": "method",
168
182
  "name": "namesOf",
@@ -242,6 +256,18 @@ export const TYPERT = {
242
256
  }
243
257
  ],
244
258
  "types": [
259
+ {
260
+ "name": "ActionCardDecision",
261
+ "declaration": "export interface ActionCardDecision {\n readonly cardId: ActionCardId;\n readonly action: string;\n readonly phase: string;\n readonly data?: ActionCardFields | undefined;\n}"
262
+ },
263
+ {
264
+ "name": "ActionCardFields",
265
+ "declaration": "export type ActionCardFields = Readonly<Record<string, JsonValue>>;"
266
+ },
267
+ {
268
+ "name": "ActionCardId",
269
+ "declaration": "export type ActionCardId = Branded<'ActionCardId'>;"
270
+ },
245
271
  {
246
272
  "name": "AfterScheduleRecord",
247
273
  "declaration": "export interface AfterScheduleRecord {\n readonly id: ScheduleId;\n readonly kind: 'after';\n readonly title: string;\n readonly prompt: string;\n readonly afterSeconds: number;\n readonly scheduledAt: string;\n}"
@@ -476,7 +502,7 @@ export const TYPERT = {
476
502
  },
477
503
  {
478
504
  "name": "JobOutcome",
479
- "declaration": "export interface JobOutcome {\n status: 'completed' | 'killed' | 'failed';\n detail?: string;\n result?: string;\n}"
505
+ "declaration": "export interface JobOutcome {\n status: 'completed' | 'killed' | 'failed';\n detail?: string;\n exitCode?: number;\n result?: string;\n}"
480
506
  },
481
507
  {
482
508
  "name": "JobRegisteredData",
@@ -600,7 +626,7 @@ export const TYPERT = {
600
626
  },
601
627
  {
602
628
  "name": "MessageSourceMap",
603
- "declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n model: ModelMessageSource;\n tool: ToolMessageSource;\n 'system-prompt': SystemPromptMessageSource;\n 'model-selection': { kind: 'model-selection'; } & ContextFormed;\n 'tool-registry': { kind: 'tool-registry'; };\n 'action-cards': { kind: 'action-cards'; through: SessionSeq; } & ContextFormed;\n 'runtime-context': { kind: 'runtime-context'; } & ContextFormed;\n 'team-message': TeamMessageSource;\n 'working-directory': { kind: 'working-directory'; };\n 'user-approval': { kind: 'user-approval'; } & ContextFormed;\n 'agent-message': AgentMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; principal?: Principal; };\n 'retry-rpc': { kind: 'retry'; rpcId: SessionRequestId; clientTimeZone?: string; principal?: Principal; };\n 'skill-invocation': SkillInvocationSource;\n 'ptc-mode': { kind: 'ptc-mode'; };\n 'compact-checkpoint': CompactionCheckpointSource;\n 'cordis-host-runner': { kind: 'cordis-host-runner'; };\n 'user-question-reply': { kind: 'user-question-reply'; callId: ToolCallId; outcome: 'answered'; };\n goal: GoalMessageSource;\n 'plan-mode': { kind: 'plan-mode'; } & ContextFormed;\n schedule: { kind: 'schedule'; } & ContextFormed;\n 'session-reference': SessionReferenceSource;\n webhook: { readonly kind: 'webhook'; readonly provider: string; readonly source: WebhookSourceId; readonly deliveryId: WebhookDeliveryId; readonly ruleId: WebhookRuleId; readonly form: 'notice'; readonly summary: string; };\n}"
629
+ "declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n model: ModelMessageSource;\n tool: ToolMessageSource;\n 'system-prompt': SystemPromptMessageSource;\n 'model-selection': { kind: 'model-selection'; } & ContextFormed;\n 'skill-invocation': SkillInvocationSource;\n 'working-directory': { kind: 'working-directory'; };\n 'action-cards': { kind: 'action-cards'; through: SessionSeq; } & ContextFormed;\n 'tool-registry': { kind: 'tool-registry'; };\n 'runtime-context': { kind: 'runtime-context'; } & ContextFormed;\n 'team-message': TeamMessageSource;\n 'user-approval': { kind: 'user-approval'; } & ContextFormed;\n 'agent-message': AgentMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; principal?: Principal; };\n 'retry-rpc': { kind: 'retry'; rpcId: SessionRequestId; clientTimeZone?: string; principal?: Principal; };\n 'ptc-mode': { kind: 'ptc-mode'; };\n 'compact-checkpoint': CompactionCheckpointSource;\n 'cordis-host-runner': { kind: 'cordis-host-runner'; };\n 'user-question-reply': { kind: 'user-question-reply'; callId: ToolCallId; outcome: 'answered'; };\n 'cua-held-inputs': { kind: 'cua-held-inputs'; } & Extract<ContextFormed, { form: 'notice'; }>;\n 'cua-inputs-released': { kind: 'cua-inputs-released'; } & Extract<ContextFormed, { form: 'notice'; }>;\n goal: GoalMessageSource;\n 'plan-mode': { kind: 'plan-mode'; } & ContextFormed;\n schedule: { kind: 'schedule'; } & ContextFormed;\n 'session-reference': SessionReferenceSource;\n 'timeline-priority': { kind: 'timeline-priority'; form: 'notice'; summary: string; };\n webhook: { readonly kind: 'webhook'; readonly provider: string; readonly source: WebhookSourceId; readonly deliveryId: WebhookDeliveryId; readonly ruleId: WebhookRuleId; readonly form: 'notice'; readonly summary: string; };\n}"
604
630
  },
605
631
  {
606
632
  "name": "Model",
@@ -720,7 +746,7 @@ export const TYPERT = {
720
746
  },
721
747
  {
722
748
  "name": "SessionEventMap",
723
- "declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'developer/message': { turn: number; step: number; message: DeveloperMessage; headerSeq?: SessionSeq; };\n 'system/message': { turn: number; step: number; message: SystemMessage; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; stream: AssistantStreamRecord[]; usage?: TokenUsage; interrupted?: true; };\n 'assistant/attempt': { turn: number; step: number; stream: AssistantStreamRecord[]; };\n 'tool/call': { turn: number; step: number; callId: ToolCallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; reason?: string; }; meta?: JsonValue; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; startsSeries?: true; };\n 'request/context': RequestContext;\n 'session/end-seed': { inherited?: true; };\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n 'model/selection': ModelSelection;\n 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\n 'agent-preset/selected': { agentPreset: string; };\n 'team/mode': { enabled: boolean; };\n 'team/member': { version: 2; teamId: TeamId; member: TeamMemberSnapshot; };\n 'team/task': { version: 2; teamId: TeamId; task: TeamTaskSnapshot; };\n 'team/message/queued': { version: 2; teamId: TeamId; message: TeamMessageSnapshot; };\n 'team/message/delivered': { version: 2; teamId: TeamId; messageId: TeamMessageId; targetId: SessionId; };\n 'working-directory/change': { cwd: string; };\n 'image/offload': { targets: ImageOffloadTarget[]; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: ToolCallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: import('@deepseek-ai/dsh-session/types').SessionSeq; };\n 'permission/preset': { preset: string; };\n 'subagent/descriptor': SubagentDescriptorData;\n 'subagent/catalog': SubagentCatalogEvent;\n 'job/registered': JobRegisteredData;\n 'job/settled': JobSettledData;\n 'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; };\n 'compaction/summary': { compactionId: CompactionId; sourceCommandId?: CommandId; summary: ContentBlock[]; shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; provider: string; model: string; maxTokens?: number; usage?: TokenUsage; } & ({ rawOutput: ContentBlock[]; llmStreamCall: true; } | { rawOutput?: ContentBlock[]; llmStreamCall?: never; });\n 'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string; };\n 'compaction/prune': { shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; };\n 'tool/ptc-dispatch-start': PtcDispatchStartEventData;\n 'tool/ptc-dispatch': PtcDispatchEventData;\n 'feedback/record': FeedbackRecord;\n 'llm/retry': LlmRetryEventData;\n 'llm/retry-started': LlmRetryStartedEventData;\n 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n 'plan/mode': { active: boolean; };\n 'schedule/change': ScheduleChange;\n 'session-log-deepseek/delivery-accepted': { sessionId: import('@deepseek-ai/dsh-session/types').SessionId; sessionFormatVersion?: number; throughSeq: import('@deepseek-ai/dsh-session/types').SessionSeq; };\n 'subagent/model-selection-policy': { allowedModels: AllowedModelRoute[]; };\n 'workspace/changes': { turn: number; };\n}"
749
+ "declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'developer/message': { turn: number; step: number; message: DeveloperMessage; headerSeq?: SessionSeq; };\n 'system/message': { turn: number; step: number; message: SystemMessage; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; stream: AssistantStreamRecord[]; usage?: TokenUsage; interrupted?: true; };\n 'assistant/attempt': { turn: number; step: number; stream: AssistantStreamRecord[]; };\n 'tool/call': { turn: number; step: number; callId: ToolCallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; reason?: string; }; meta?: JsonValue; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; startsSeries?: true; };\n 'request/context': RequestContext;\n 'session/end-seed': { inherited?: true; };\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n 'model/selection': ModelSelection;\n 'working-directory/change': { cwd: string; };\n 'workspace-root/change': { cwd: string; };\n 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\n 'action-cards/decision': ActionCardDecision;\n 'agent-preset/selected': { agentPreset: string; };\n 'team/mode': { enabled: boolean; };\n 'team/member': { version: 2; teamId: TeamId; member: TeamMemberSnapshot; };\n 'team/task': { version: 2; teamId: TeamId; task: TeamTaskSnapshot; };\n 'team/message/queued': { version: 2; teamId: TeamId; message: TeamMessageSnapshot; };\n 'team/message/delivered': { version: 2; teamId: TeamId; messageId: TeamMessageId; targetId: SessionId; };\n 'image/offload': { targets: ImageOffloadTarget[]; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: ToolCallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: import('@deepseek-ai/dsh-session/types').SessionSeq; };\n 'permission/preset': { preset: string; };\n 'subagent/descriptor': SubagentDescriptorData;\n 'subagent/catalog': SubagentCatalogEvent;\n 'job/registered': JobRegisteredData;\n 'job/settled': JobSettledData;\n 'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; };\n 'compaction/summary': { compactionId: CompactionId; sourceCommandId?: CommandId; summary: ContentBlock[]; shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; provider: string; model: string; maxTokens?: number; usage?: TokenUsage; } & ({ rawOutput: ContentBlock[]; llmStreamCall: true; } | { rawOutput?: ContentBlock[]; llmStreamCall?: never; });\n 'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string; };\n 'compaction/prune': { shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; };\n 'tool/ptc-dispatch-start': PtcDispatchStartEventData;\n 'tool/ptc-dispatch': PtcDispatchEventData;\n 'feedback/record': FeedbackRecord;\n 'llm/retry': LlmRetryEventData;\n 'llm/retry-started': LlmRetryStartedEventData;\n 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n 'plan/mode': { active: boolean; };\n 'schedule/change': ScheduleChange;\n 'session-log-deepseek/delivery-accepted': { sessionId: import('@deepseek-ai/dsh-session/types').SessionId; sessionFormatVersion?: number; throughSeq: import('@deepseek-ai/dsh-session/types').SessionSeq; };\n 'subagent/model-selection-policy': { allowedModels: AllowedModelRoute[]; };\n 'workspace/changes': { turn: number; };\n}"
724
750
  },
725
751
  {
726
752
  "name": "SessionEventType",
@@ -752,7 +778,7 @@ export const TYPERT = {
752
778
  },
753
779
  {
754
780
  "name": "SessionSurface",
755
- "declaration": "export interface SessionSurface {\n readonly nodes: readonly SessionSeq[];\n readonly replaceGeneration: number;\n readonly contentGeneration: number;\n}"
781
+ "declaration": "export interface SessionSurface {\n readonly nodes: readonly SessionSeq[];\n readonly systemNodes: readonly SystemSurfaceNode[];\n readonly replaceGeneration: number;\n readonly contentGeneration: number;\n}"
756
782
  },
757
783
  {
758
784
  "name": "SessionTitleEventData",
@@ -794,6 +820,10 @@ export const TYPERT = {
794
820
  "name": "SubagentCapabilities",
795
821
  "declaration": "export interface SubagentCapabilities {\n readonly agentOptions: boolean;\n readonly agentPreset: boolean;\n readonly outputSchema: boolean;\n readonly depthLimit: boolean;\n}"
796
822
  },
823
+ {
824
+ "name": "SubagentCapacity",
825
+ "declaration": "export interface SubagentCapacity {\n readonly running: number;\n readonly limit: number;\n}"
826
+ },
797
827
  {
798
828
  "name": "SubagentCatalogEvent",
799
829
  "declaration": "export type SubagentCatalogEvent = { readonly childId: SessionId; readonly childCreatedAt: number; } & (({ readonly version: 0; } & KnownCatalogMode) | ({ readonly version: 1; } & (KnownCatalogMode | { readonly mode: 'unknown'; readonly label?: string; })) | { readonly version: 2; readonly mode: 'external'; readonly label?: string; } | ({ readonly version: 3; readonly name: string; } & ({ readonly mode: 'continuable'; readonly label: string; } | { readonly mode: 'external'; readonly label?: string; })));"
@@ -896,12 +926,20 @@ export const TYPERT = {
896
926
  },
897
927
  {
898
928
  "name": "SystemPromptMessageSource",
899
- "declaration": "export interface SystemPromptMessageSource {\n kind: 'system-prompt';\n}"
929
+ "declaration": "export interface SystemPromptMessageSource {\n kind: 'system-prompt';\n readonly complete?: true;\n readonly reset?: true;\n readonly sections?: readonly SystemPromptSectionState[];\n}"
930
+ },
931
+ {
932
+ "name": "SystemPromptSectionState",
933
+ "declaration": "export type SystemPromptSectionState = { readonly name: string; readonly noticeIndex?: readonly number[]; } & ({ readonly state: 'active'; readonly order: number; readonly contentIndex: number; } | { readonly state: 'retired'; readonly contentIndex?: never; });"
900
934
  },
901
935
  {
902
936
  "name": "SystemPromptUpdate",
903
937
  "declaration": "export type SystemPromptUpdate = 'in-history';"
904
938
  },
939
+ {
940
+ "name": "SystemSurfaceNode",
941
+ "declaration": "export interface SystemSurfaceNode {\n readonly seq: SessionSeq;\n readonly isEmpty: boolean;\n}"
942
+ },
905
943
  {
906
944
  "name": "TeamId",
907
945
  "declaration": "export type TeamId = Branded<'TeamId'>;"
@@ -1 +1 @@
1
- {"version":3,"file":"typert.remote-client.d.ts","names":["interruptByUser","prompt"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;IAufEA,e;IArDMC,M;;;IAqDND,2B;IArDMC,kB","ignoreList":[]}
1
+ {"version":3,"file":"typert.remote-client.d.ts","names":["interruptByUser","prompt"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;IAugBEA,e;IArDMC,M;;;IAqDND,2B;IArDMC,kB","ignoreList":[]}
@@ -81,7 +81,7 @@ export const TYPERT_REMOTE = createTypertRemoteInfo({
81
81
  description: 'acknowledgement that the cancel signal was admitted, not that the target is quiescent.',
82
82
  jsonSchema: {"type":"object","properties":{"accepted":{"type":"boolean","const":true}},"required":["accepted"],"additionalProperties":true},
83
83
  },
84
- sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":504,"column":3},
84
+ sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":520,"column":3},
85
85
  },
86
86
  'subagents/prompt': {
87
87
  service: 'subagents',
@@ -114,7 +114,7 @@ export const TYPERT_REMOTE = createTypertRemoteInfo({
114
114
  description: 'the accepted message\'s inbox identity.',
115
115
  jsonSchema: {"type":"object","properties":{"messageId":{"type":"string"}},"required":["messageId"],"additionalProperties":true},
116
116
  },
117
- sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":451,"column":9},
117
+ sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":467,"column":9},
118
118
  },
119
119
  },
120
120
  }, z)
@@ -8,6 +8,8 @@ import type { SubagentResult, SubagentRun, SubagentRunId } from './types.ts';
8
8
  /** Process-local capacity shared by every member of a subagent tree. */
9
9
  export declare class ActivationPool {
10
10
  private readonly slots;
11
+ /** Slots reserved by starting, resident, or stopping children. */
12
+ get size(): number;
11
13
  /**
12
14
  * Reserve before reconstruction; release also tolerates unpublished rollback.
13
15
  * @param capacity - the maximum simultaneous activations in this pool.
@@ -1 +1 @@
1
- {"version":3,"file":"activation.d.ts","sourceRoot":"","sources":["../../src/activation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO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AAK,CAAyC;IAEtD;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CAYpE"}
@@ -8,6 +8,10 @@ import { SubagentError } from "./error.js";
8
8
  /** Process-local capacity shared by every member of a subagent tree. */
9
9
  export class ActivationPool {
10
10
  slots = new Set();
11
+ /** Slots reserved by starting, resident, or stopping children. */
12
+ get size() {
13
+ return this.slots.size;
14
+ }
11
15
  /**
12
16
  * Reserve before reconstruction; release also tolerates unpublished rollback.
13
17
  * @param capacity - the maximum simultaneous activations in this pool.
@@ -1 +1 @@
1
- {"version":3,"file":"activation.js","sourceRoot":"","sources":["../../src/activation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAI1C,wEAAwE;AACxE,MAAM,OAAO,cAAc;IACR,KAAK,GAAG,IAAI,GAAG,EAAU,CAAA;IAE1C;;;;OAIG;IACH,OAAO,CAAC,QAAgB;QACtB,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,QAAQ,EAAE,CAAC;YAChC,MAAM,IAAI,aAAa,CACrB,+CAA+C,QAAQ,0CAA0C;kBAC/F,+CAA+C,EACjD,0BAA0B,CAC3B,CAAA;QACH,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,EAAE,CAAA;QACrB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACpB,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA,CAAC,CAAC,CAAA;IAC1C,CAAC;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;QAClD,wEAAwE;QACxE,2CAA2C;QAC3C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;QAC1D,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QAC7B,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YAClB,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI;gBAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QAClE,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAA;IACf,CAAC;CACF"}
@@ -10,8 +10,9 @@ import type { Agent, AgentOptions, CreateAgentOptions } from '@deepseek-ai/dsh-a
10
10
  import type { SandboxMode } from '@deepseek-ai/dsh-sandbox';
11
11
  import type { Session } from '@deepseek-ai/dsh-session';
12
12
  import type { ToolRestriction } from '@deepseek-ai/dsh-tools';
13
- /** Thrown when starting a child would exceed the requested depth cap. */
14
- export declare class SubagentDepthError extends Error {
13
+ import { SubagentError } from './error.ts';
14
+ /** Thrown when starting a child would exceed the requested depth cap; `code` is `DEPTH_EXCEEDED`. */
15
+ export declare class SubagentDepthError extends SubagentError {
15
16
  readonly attemptedDepth: number;
16
17
  readonly maxDepth: number;
17
18
  constructor(attemptedDepth: number, maxDepth: number);
@@ -24,7 +25,7 @@ export declare class SubagentDepthError extends Error {
24
25
  * @param maxDepth - optional absolute cap the resolved depth must not exceed.
25
26
  * @returns the child's non-negative safe-integer depth.
26
27
  * @throws {SubagentDepthError} when the resolved depth exceeds `maxDepth`.
27
- * @throws {RangeError} when the resolved depth leaves the safe-integer range.
28
+ * @throws {SubagentError} `INVALID_DEPTH` when the resolved depth leaves the safe-integer range.
28
29
  */
29
30
  export declare function resolveChildDepth(parent: Agent, maxDepth: number | undefined): number;
30
31
  /**
@@ -73,7 +74,7 @@ export interface ChildComposition {
73
74
  readonly toolFilter?: ToolRestriction | undefined;
74
75
  }
75
76
  /**
76
- * Model-facing delegation-scope statement for every in-process child. A
77
+ * Model-facing delegation-scope and message-authorship statement for every in-process child. A
77
78
  * runtime-context contribution rather than a system-prompt section, so the
78
79
  * deployment's system prompt stays uniform across parents and children.
79
80
  */
@@ -87,6 +88,9 @@ export declare const SUBAGENT_DELEGATION_CONTEXT: string;
87
88
  * @param parent - creator for fresh delegation; absent during target-only restoration.
88
89
  * @param composition - independent preset and any overrides read from a historical descriptor.
89
90
  * @returns A promise when mounting an independent preset; otherwise completes synchronously.
91
+ * @throws {SubagentError} `PRESET_UNAVAILABLE` when a preset is selected but the preset
92
+ * service is absent. An unknown or unloadable selected preset rejects with the registry's
93
+ * `RemoteError` code.
90
94
  */
91
95
  export declare function applyChildComposition(childCtx: Context, parent: Agent | undefined, composition: ChildComposition): void | Promise<void>;
92
96
  /** Policy seeded onto a child session's log at the delegation boundary. */
@@ -1 +1 @@
1
- {"version":3,"file":"child-agent.d.ts","sourceRoot":"","sources":["../../src/child-agent.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AACrF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAiB7D,yEAAyE;AACzE,qBAAa,kBAAmB,SAAQ,KAAK;aACf,cAAc,EAAE,MAAM;aAAkB,QAAQ,EAAE,MAAM;gBAAxD,cAAc,EAAE,MAAM,EAAkB,QAAQ,EAAE,MAAM;CAIrF;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,C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6
  * @module @deepseek-ai/dsh-subagent/child-agent
7
7
  */
8
+ import { PERSONA_PREFIX_SECTION } from '@deepseek-ai/dsh-system-prompt';
8
9
  import { delegationDepthOf } from "./depth.js";
9
10
  import { SubagentError } from "./error.js";
10
- /** Thrown when starting a child would exceed the requested depth cap. */
11
- export class SubagentDepthError extends Error {
11
+ /** Thrown when starting a child would exceed the requested depth cap; `code` is `DEPTH_EXCEEDED`. */
12
+ export class SubagentDepthError extends SubagentError {
12
13
  attemptedDepth;
13
14
  maxDepth;
14
15
  constructor(attemptedDepth, maxDepth) {
15
- super(`subagent depth ${attemptedDepth} exceeds maxDepth ${maxDepth}`);
16
+ super(`subagent depth ${attemptedDepth} exceeds maxDepth ${maxDepth}`, 'DEPTH_EXCEEDED');
16
17
  this.attemptedDepth = attemptedDepth;
17
18
  this.maxDepth = maxDepth;
18
19
  this.name = 'SubagentDepthError';
@@ -26,12 +27,12 @@ export class SubagentDepthError extends Error {
26
27
  * @param maxDepth - optional absolute cap the resolved depth must not exceed.
27
28
  * @returns the child's non-negative safe-integer depth.
28
29
  * @throws {SubagentDepthError} when the resolved depth exceeds `maxDepth`.
29
- * @throws {RangeError} when the resolved depth leaves the safe-integer range.
30
+ * @throws {SubagentError} `INVALID_DEPTH` when the resolved depth leaves the safe-integer range.
30
31
  */
31
32
  export function resolveChildDepth(parent, maxDepth) {
32
33
  const childDepth = delegationDepthOf(parent) + 1;
33
34
  if (!Number.isSafeInteger(childDepth)) {
34
- throw new RangeError('subagent child depth exceeds the safe-integer range');
35
+ throw new SubagentError('subagent child depth exceeds the safe-integer range', 'INVALID_DEPTH');
35
36
  }
36
37
  if (maxDepth !== undefined && childDepth > maxDepth) {
37
38
  throw new SubagentDepthError(childDepth, maxDepth);
@@ -120,14 +121,16 @@ export function childSessionMeta(parent, childDepth, isSeeded, selectedPreset) {
120
121
  };
121
122
  }
122
123
  /**
123
- * Model-facing delegation-scope statement for every in-process child. A
124
+ * Model-facing delegation-scope and message-authorship statement for every in-process child. A
124
125
  * runtime-context contribution rather than a system-prompt section, so the
125
126
  * deployment's system prompt stays uniform across parents and children.
126
127
  */
127
128
  export const SUBAGENT_DELEGATION_CONTEXT = 'You are a delegated subagent: your permission scope was fixed when you were started and cannot be '
128
129
  + 'widened from inside this session — operations that require approval are rejected automatically. '
129
130
  + 'When the task needs access beyond that scope, do not retry the denied operation; state the '
130
- + 'limitation in your reply so the delegating agent can handle it.';
131
+ + 'limitation in your reply so the delegating agent can handle it. Messages from other agents begin with '
132
+ + '"Agent <name> sent a message:". Other user messages come from the human user, who reads this conversation '
133
+ + 'directly. You can still message other agents to coordinate, but answer the human user in your reply.';
131
134
  /**
132
135
  * Compose a child before publication and restore historical descriptor overrides.
133
136
  * Explicit selection mounts the named preset. Omission joins a supplied creator's
@@ -137,6 +140,9 @@ export const SUBAGENT_DELEGATION_CONTEXT = 'You are a delegated subagent: your p
137
140
  * @param parent - creator for fresh delegation; absent during target-only restoration.
138
141
  * @param composition - independent preset and any overrides read from a historical descriptor.
139
142
  * @returns A promise when mounting an independent preset; otherwise completes synchronously.
143
+ * @throws {SubagentError} `PRESET_UNAVAILABLE` when a preset is selected but the preset
144
+ * service is absent. An unknown or unloadable selected preset rejects with the registry's
145
+ * `RemoteError` code.
140
146
  */
141
147
  export function applyChildComposition(childCtx, parent, composition) {
142
148
  if (composition.agentPreset !== undefined) {
@@ -160,7 +166,7 @@ function applyChildOverrides(childCtx, composition) {
160
166
  });
161
167
  if (composition.persona !== undefined) {
162
168
  childCtx.systemPrompt.section({
163
- name: 'deployment:persona-prefix',
169
+ name: PERSONA_PREFIX_SECTION,
164
170
  order: childCtx.systemPrompt.getSectionOrder('DEPLOYMENT_PERSONA_PREFIX'),
165
171
  text: composition.persona,
166
172
  });
@@ -1 +1 @@
1
- {"version":3,"file":"child-agent.js","sourceRoot":"","sources":["../../src/child-agent.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAqBH,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,C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G,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC;QACxE,cAAc,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO;KAC/E,CAAA;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,8BAA8B,CAC5C,YAAqB,EACrB,SAAmC;IAEnC,IAAI,SAAS,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QACxC,YAAY,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAA;IAC5F,CAAC;IACD,IAAI,SAAS,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;QAC3C,YAAY,CAAC,MAAM,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAA;IACpG,CAAC;IACD,IAAI,SAAS,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;QAC7C,YAAY,CAAC,MAAM,CAAC,mBAAmB,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,gBAAgB,EAAE,CAAC,CAAA;IAClF,CAAC;AACH,CAAC"}
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import type { PromptContentPart } from '@deepseek-ai/dsh-attachment/types';
8
8
  import type { Branded } from '@deepseek-ai/dsh-brand';
9
- import type { MessageId } from '@deepseek-ai/dsh-llm/brand';
9
+ import type { MessageId } from '@deepseek-ai/dsh-llm/types';
10
10
  import type { SessionId } from '@deepseek-ai/dsh-session/types';
11
11
  import type { KnownSubagentCatalogFields } from './projection-types.ts';
12
12
  /**
@@ -20,7 +20,7 @@ declare module '@deepseek-ai/dsh-agent' {
20
20
  * let it delegate as if it were top-level.
21
21
  * @param agent - the agent whose header and options carry the depth.
22
22
  * @returns its non-negative safe-integer depth.
23
- * @throws if the runtime `AgentOptions.subagentDepth` is not a non-negative safe integer.
23
+ * @throws {SubagentError} `INVALID_DEPTH` if the runtime `AgentOptions.subagentDepth` is not a non-negative safe integer.
24
24
  */
25
25
  export declare function delegationDepthOf(agent: Agent): number;
26
26
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"depth.d.ts","sourceRoot":"","sources":["../../src/depth.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAEnD,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAU,YAAY;QACpB,qFAAqF;QACrF,aAAa,CAAC,EAAE,MAAM,CAAA;KACvB;CACF;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAQtD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAS9D"}
1
+ {"version":3,"file":"depth.d.ts","sourceRoot":"","sources":["../../src/depth.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAGnD,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAU,YAAY;QACpB,qFAAqF;QACrF,aAAa,CAAC,EAAE,MAAM,CAAA;KACvB;CACF;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAQtD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAS9D"}
@@ -5,6 +5,7 @@
5
5
  *
6
6
  * @module @deepseek-ai/dsh-subagent/depth
7
7
  */
8
+ import { SubagentError } from "./error.js";
8
9
  /**
9
10
  * Read an agent's delegation depth, treating absence as top-level depth zero.
10
11
  * The persisted session header is authoritative and monotone: runtime
@@ -13,12 +14,12 @@
13
14
  * let it delegate as if it were top-level.
14
15
  * @param agent - the agent whose header and options carry the depth.
15
16
  * @returns its non-negative safe-integer depth.
16
- * @throws if the runtime `AgentOptions.subagentDepth` is not a non-negative safe integer.
17
+ * @throws {SubagentError} `INVALID_DEPTH` if the runtime `AgentOptions.subagentDepth` is not a non-negative safe integer.
17
18
  */
18
19
  export function delegationDepthOf(agent) {
19
20
  const runtime = agent.options.subagentDepth;
20
21
  if (runtime !== undefined && (!Number.isSafeInteger(runtime) || runtime < 0 || Object.is(runtime, -0))) {
21
- throw new TypeError('agent subagentDepth must be a non-negative safe integer');
22
+ throw new SubagentError('agent subagentDepth must be a non-negative safe integer', 'INVALID_DEPTH');
22
23
  }
23
24
  // The header value was validated at the session boundary (creation and
24
25
  // persistence load both construct through the store).
@@ -1 +1 @@
1
- {"version":3,"file":"depth.js","sourceRoot":"","sources":["../../src/depth.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAY;IAC5C,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,aAAa,CAAA;IAC3C,IAAI,OAAO,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,IAAI,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACvG,MAAM,IAAI,SAAS,CAAC,yDAAyD,CAAC,CAAA;IAChF,CAAC;IACD,uEAAuE;IACvE,sDAAsD;IACtD,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,IAAI,CAAC,EAAE,OAAO,IAAI,CAAC,CAAC,CAAA;AAC1E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAiB;IACtD,IAAI,QAAQ,KAAK,SAAS,IAAI,CAC5B,OA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,SAAS,CAAC,uDAAuD,CAAC,CAAA;IAC9E,CAAC;AACH,CAAC"}
@@ -4,8 +4,89 @@
4
4
  * @module @deepseek-ai/dsh-subagent
5
5
  */
6
6
  import { HarnessError } from '@deepseek-ai/dsh-llm';
7
- /** Typed failure for the subagent seam. */
7
+ /**
8
+ * Every machine-routable subagent failure. Each code names one condition;
9
+ * reuse one only when the consumer action is the same.
10
+ */
11
+ export type SubagentErrorCode =
12
+ /** A provider registration or a request needs a capability the selected backend lacks. */
13
+ 'UNSUPPORTED_CAPABILITY'
14
+ /** A provider with the same name is already registered. */
15
+ | 'DUPLICATE_PROVIDER'
16
+ /** No subagent provider is registered under the requested name. */
17
+ | 'NO_PROVIDER'
18
+ /** The provider was removed or replaced while a delegation was starting; retry against the current registration. */
19
+ | 'PROVIDER_CHANGED'
20
+ /** A child preset was selected but the agent-presets service is absent. */
21
+ | 'PRESET_UNAVAILABLE'
22
+ /** The tool instance exposes no agent preset choice. */
23
+ | 'PRESET_SELECTION_DISABLED'
24
+ /** The selected agent preset is outside the tool's allowlist. */
25
+ | 'PRESET_NOT_ALLOWED'
26
+ /** The tool instance does not accept child model selection. */
27
+ | 'MODEL_SELECTION_DISABLED'
28
+ /** The enabled Host model-selection setting has invalid routes; correct the setting before retrying. */
29
+ | 'INVALID_MODEL_SELECTION_SETTINGS'
30
+ /** The current Host model-selection setting does not authorize the requested child provider or route. */
31
+ | 'MODEL_ROUTE_NOT_ALLOWED'
32
+ /** The requested LLM provider is not registered with the LLM runtime. */
33
+ | 'LLM_PROVIDER_NOT_FOUND'
34
+ /** The child's target model cannot accept image input. */
35
+ | 'MODEL_DOES_NOT_SUPPORT_IMAGES'
36
+ /** Starting the child would exceed the requested delegation depth; thrown as `SubagentDepthError`. */
37
+ | 'DEPTH_EXCEEDED'
38
+ /** A runtime delegation depth is not a non-negative safe integer. */
39
+ | 'INVALID_DEPTH'
40
+ /** An out-of-process child's working directory is relative or not enterable. */
41
+ | 'INVALID_CWD'
42
+ /** A local child cannot start because the working-directory service is absent. */
43
+ | 'WORKING_DIRECTORY_UNAVAILABLE'
44
+ /** The caller is not the exact live agent, or does not own the target in its subagent tree. */
45
+ | 'UNAUTHORIZED'
46
+ /** The tree's activation capacity is exhausted. */
47
+ | 'ACTIVATION_LIMIT_REACHED'
48
+ /** The target activation is closing. */
49
+ | 'ACTIVATION_CLOSING'
50
+ /** Releasing an activation's resources failed. */
51
+ | 'ACTIVATION_TEARDOWN_FAILED'
52
+ /** A child with the same Session id already exists. */
53
+ | 'DUPLICATE_CHILD'
54
+ /** The subagent tree is draining and admits no new work. */
55
+ | 'DRAINING'
56
+ /** The child accepts no more input after its structured result. */
57
+ | 'INPUT_CLOSED'
58
+ /** `structured_output` was called while accepted input is still pending. */
59
+ | 'STRUCTURED_OUTPUT_PENDING_INPUT'
60
+ /** The operation was cancelled by its caller. */
61
+ | 'CANCELLED'
62
+ /** A cold child cannot be restored from its persisted state. */
63
+ | 'NOT_RESUMABLE'
64
+ /** The child was not started as continuable and accepts no follow-up. */
65
+ | 'NOT_CONTINUABLE'
66
+ /** Continuation needs the agent runtime or a live tree root that is absent. */
67
+ | 'CONTINUATION_UNAVAILABLE'
68
+ /** Continuation needs Session persistence that is absent or failed. */
69
+ | 'PERSISTENCE_UNAVAILABLE'
70
+ /** A requested agent name does not satisfy the naming rule. */
71
+ | 'INVALID_AGENT_NAME'
72
+ /** A requested agent name is already used by a sibling. */
73
+ | 'DUPLICATE_AGENT_NAME'
74
+ /** An agent path names no member of the tree. */
75
+ | 'AGENT_NAME_NOT_FOUND'
76
+ /** Listing children needs the session-query service. */
77
+ | 'SUBAGENT_CONTROL_QUERY_UNAVAILABLE'
78
+ /** Listing children needs the session-projection service. */
79
+ | 'SUBAGENT_CONTROL_PROJECTIONS_UNAVAILABLE'
80
+ /** Listing children needs the Session store. */
81
+ | 'SUBAGENT_CONTROL_SESSION_STORE_UNAVAILABLE';
82
+ /** Typed failure for the subagent seam; `code` is one {@link SubagentErrorCode}. */
8
83
  export declare class SubagentError extends HarnessError {
9
- constructor(message: string, code: string, options?: ErrorOptions);
84
+ readonly code: SubagentErrorCode;
85
+ /**
86
+ * @param message - reason and next step for the caller.
87
+ * @param code - failure class.
88
+ * @param options - standard `cause` chaining.
89
+ */
90
+ constructor(message: string, code: SubagentErrorCode, options?: ErrorOptions);
10
91
  }
11
92
  //# sourceMappingURL=error.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD,2CAA2C;AAC3C,qBAAa,aAAc,SAAQ,YAAY;gBACjC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIlE"}
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD;;;GAGG;AACH,MAAM,MAAM,iBAAiB;AAC3B,0FAA0F;AACxF,wBAAwB;AAC1B,2DAA2D;GACzD,oBAAoB;AACtB,mEAAmE;GACjE,aAAa;AACf,oHAAoH;GAClH,kBAAkB;AACpB,2EAA2E;GACzE,oBAAoB;AACtB,wDAAwD;GACtD,2BAA2B;AAC7B,iEAAiE;GAC/D,oBAAoB;AACtB,+DAA+D;GAC7D,0BAA0B;AAC5B,wGAAwG;GACtG,kCAAkC;AACpC,yGAAyG;GACvG,yBAAyB;AAC3B,yEAAyE;GACvE,wBAAwB;AAC1B,0DAA0D;GACxD,+BAA+B;AACjC,sGAAsG;GACpG,gBAAgB;AAClB,qEAAqE;GACnE,eAAe;AACjB,gFAAgF;GAC9E,aAAa;AACf,kFAAkF;GAChF,+BAA+B;AACjC,+FAA+F;GAC7F,cAAc;AAChB,mDAAmD;GACjD,0BAA0B;AAC5B,wCAAwC;GACtC,oBAAoB;AACtB,kDAAkD;GAChD,4BAA4B;AAC9B,uDAAuD;GACrD,iBAAiB;AACnB,4DAA4D;GAC1D,UAAU;AACZ,mEAAmE;GACjE,cAAc;AAChB,4EAA4E;GAC1E,iCAAiC;AACnC,iDAAiD;GAC/C,WAAW;AACb,gEAAgE;GAC9D,eAAe;AACjB,yEAAyE;GACvE,iBAAiB;AACnB,+EAA+E;GAC7E,0BAA0B;AAC5B,uEAAuE;GACrE,yBAAyB;AAC3B,+DAA+D;GAC7D,oBAAoB;AACtB,2DAA2D;GACzD,sBAAsB;AACxB,iDAAiD;GAC/C,sBAAsB;AACxB,wDAAwD;GACtD,oCAAoC;AACtC,6DAA6D;GAC3D,0CAA0C;AAC5C,gDAAgD;GAC9C,4CAA4C,CAAA;AAEhD,oFAAoF;AACpF,qBAAa,aAAc,SAAQ,YAAY;IAC7C,SAAkB,IAAI,EAAE,iBAAiB,CAAA;IAEzC;;;;OAIG;gBACS,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,YAAY;CAK7E"}
@@ -4,11 +4,18 @@
4
4
  * @module @deepseek-ai/dsh-subagent
5
5
  */
6
6
  import { HarnessError } from '@deepseek-ai/dsh-llm';
7
- /** Typed failure for the subagent seam. */
7
+ /** Typed failure for the subagent seam; `code` is one {@link SubagentErrorCode}. */
8
8
  export class SubagentError extends HarnessError {
9
+ code;
10
+ /**
11
+ * @param message - reason and next step for the caller.
12
+ * @param code - failure class.
13
+ * @param options - standard `cause` chaining.
14
+ */
9
15
  constructor(message, code, options) {
10
16
  super(message, code, options);
11
17
  this.name = 'SubagentError';
18
+ this.code = code;
12
19
  }
13
20
  }
14
21
  //# sourceMappingURL=error.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD,2CAA2C;AAC3C,MAAM,OAAO,aAAc,SAAQ,YAAY;IAC7C,YAAY,OAAe,EAAE,IAAY,EAAE,OAAsB;QAC/D,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QAC7B,IAAI,CAAC,IAAI,GAAG,eAAe,CAAA;IAC7B,CAAC;CACF"}
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AA8EnD,oFAAoF;AACpF,MAAM,OAAO,aAAc,SAAQ,YAAY;IAC3B,IAAI,CAAmB;IAEzC;;;;OAIG;IACH,YAAY,OAAe,EAAE,IAAuB,EAAE,OAAsB;QAC1E,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QAC7B,IAAI,CAAC,IAAI,GAAG,eAAe,CAAA;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF"}