@deepseek-ai/dsh-subagent 0.1.2-alpha.3 → 0.1.2-alpha.4

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.
@@ -101,7 +101,7 @@ export const TYPERT = {
101
101
  typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentInterruptReceipt',
102
102
  schema: _deepseek_ai_dsh_subagent_subagents_interruptByParent_result$schema,
103
103
  },
104
- sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":491,"column":3},
104
+ sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":476,"column":3},
105
105
  },
106
106
  {
107
107
  id: '@deepseek-ai/dsh-subagent#subagents/list',
@@ -128,7 +128,7 @@ export const TYPERT = {
128
128
  typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentCatalog',
129
129
  schema: _deepseek_ai_dsh_subagent_subagents_list_result$schema,
130
130
  },
131
- sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":407,"column":9},
131
+ sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":384,"column":9},
132
132
  },
133
133
  {
134
134
  id: '@deepseek-ai/dsh-subagent#subagents/prompt',
@@ -154,7 +154,7 @@ export const TYPERT = {
154
154
  typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentPromptReceipt',
155
155
  schema: _deepseek_ai_dsh_subagent_subagents_prompt_result$schema,
156
156
  },
157
- sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":433,"column":9},
157
+ sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":410,"column":9},
158
158
  },
159
159
  ],
160
160
  model: {
@@ -176,10 +176,10 @@ export const TYPERT = {
176
176
  },
177
177
  {
178
178
  "kind": "method",
179
- "name": "followup",
180
- "signature": "async followup( parent: Agent, childId: SessionId, content: ContentBlock[], options: SubagentFollowupOptions, ): Promise<MessageId>",
181
- "summary": "Deliver one later message to a continuable child as its next FIFO turn.",
182
- "jsDoc": "/**\n * Deliver one later message to a continuable child as its next FIFO turn. A\n * resident child's Agent inbox accepts it directly (waking a `waiting`\n * Activation), while an absent one is cold-resumed from its persisted\n * Session. The Agent inbox is the only queue, so every accepted message has\n * one observable order.\n * @param parent - the exact live direct parent authorizing this delivery.\n * @param childId - durable child session id.\n * @param content - user-role content to deliver.\n * @param options - the message source fields and caller cancellation, which stops the\n * operation only before inbox acceptance.\n * @returns the accepted message's inbox id.\n * @throws when continuation services are unavailable, parent authority is\n * rejected, or the message was not admitted.\n */"
179
+ "name": "sendMessage",
180
+ "signature": "async sendMessage( sender: Agent, targetId: SessionId, content: ContentBlock[], options: SubagentSendMessageOptions, ): Promise<MessageId>",
181
+ "summary": "Steer one model-authored message to the sender's direct parent or direct continuable child.",
182
+ "jsDoc": "/**\n * Steer one model-authored message to the sender's direct parent or direct\n * continuable child. A running target admits it at the nearest step boundary;\n * an idle target starts a turn, and an absent direct child cold-resumes from\n * persistence. The service derives durable sender attribution from the exact\n * live sender. Caller cancellation stops only pre-acceptance work.\n * @param sender - exact live Agent authorizing and originating the message.\n * @param targetId - durable direct-parent or direct-child session id.\n * @param content - model-authored content to deliver.\n * @param options - caller cancellation before inbox acceptance.\n * @returns the accepted message's inbox id.\n * @throws when continuation services are unavailable, adjacency is rejected,\n * or the message was not admitted.\n */"
183
183
  },
184
184
  {
185
185
  "kind": "method",
@@ -188,20 +188,6 @@ export const TYPERT = {
188
188
  "summary": "Interrupt one live continuable child's current turn under a human parent address or an exact live ancestor Agent.",
189
189
  "jsDoc": "/**\n * Interrupt one live continuable child's current turn under a human parent\n * address or an exact live ancestor Agent. Fire-and-return: the cancel\n * signal is issued before this returns, but the target may keep running\n * until it observes the signal. Unclaimed pending inbox work, the Activation,\n * and published descendants are preserved; claimed work is not requeued.\n * Once the interrupted driver is idle, a waking send resumes the parked FIFO\n * queue. An absent target — including a one-shot or unknown id —\n * is an accepted no-op, as is a manager-less composition, which cannot own a\n * live Activation.\n * @param targetSessionId - the durable child session id to interrupt.\n * @param authority - the human parent address or exact live ancestor Agent.\n * @throws {SubagentError} `UNAUTHORIZED` when the authority does not own the\n * live target.\n */"
190
190
  },
191
- {
192
- "kind": "method",
193
- "name": "reportFrom",
194
- "signature": "async reportFrom( child: Agent, content: ContentBlock[], options: SubagentReportOptions, ): Promise<MessageId>",
195
- "summary": "Deliver selected content from one live continuable child to its durable direct parent.",
196
- "jsDoc": "/**\n * Deliver selected content from one live continuable child to its durable\n * direct parent. The child is the authority credential; callers cannot name a\n * recipient. Reporting does not conclude the child's turn or Activation.\n * @param child - exact live reporting child.\n * @param content - selected model-facing content.\n * @param options - parent scheduling and pre-acceptance cancellation.\n * @returns the stable identity of the parent-accepted message.\n * @throws when continuation services are unavailable, sender authorization\n * fails, or the direct parent is not live.\n */"
197
- },
198
- {
199
- "kind": "method",
200
- "name": "registerContinuableSetup",
201
- "signature": "registerContinuableSetup(contribution: ContinuableSetupContribution): () => void",
202
- "summary": "Compose one deployment capability into every continuable child's unpublished creation context on fresh creation and cold resume.",
203
- "jsDoc": "/**\n * Compose one deployment capability into every continuable child's\n * unpublished creation context on fresh creation and cold resume. Grants wait\n * for the next Activation; removing the contribution revokes every resident\n * installation immediately.\n * @param contribution - synchronous child-scope installer.\n * @returns the exact Cordis effect disposer.\n */"
204
- },
205
191
  {
206
192
  "kind": "method",
207
193
  "name": "drainContinuableDescendants",
@@ -289,6 +275,10 @@ export const TYPERT = {
289
275
  "name": "AgentCancelCause",
290
276
  "declaration": "export type AgentCancelCause = { readonly kind: 'user'; } | { readonly kind: 'parent'; } | { readonly kind: 'hook'; readonly reason: string; } | { readonly kind: 'disposed'; };"
291
277
  },
278
+ {
279
+ "name": "AgentMessageSource",
280
+ "declaration": "export interface AgentMessageSource {\n readonly kind: 'agent-message';\n readonly form: 'relay';\n readonly senderSessionId: SessionId;\n}"
281
+ },
292
282
  {
293
283
  "name": "AgentOptions",
294
284
  "declaration": "export interface AgentOptions {\n provider?: string;\n model?: string;\n reasoningEffort?: ReasoningEffortId;\n maxTokens?: number;\n subagentDepth?: number;\n}"
@@ -325,6 +315,10 @@ export const TYPERT = {
325
315
  "name": "Branded",
326
316
  "declaration": "export type Branded<B extends string> = string & { readonly [BRAND]: B; };"
327
317
  },
318
+ {
319
+ "name": "BrandedNumber",
320
+ "declaration": "export type BrandedNumber<B extends string> = number & { readonly [BRAND]: B; };"
321
+ },
328
322
  {
329
323
  "name": "CancelOptions",
330
324
  "declaration": "export interface CancelOptions {\n keepInbox?: boolean | undefined;\n}"
@@ -373,10 +367,6 @@ export const TYPERT = {
373
367
  "name": "ContinuableCreateSpec",
374
368
  "declaration": "export interface ContinuableCreateSpec {\n readonly seed?: readonly SessionEvent[];\n}"
375
369
  },
376
- {
377
- "name": "ContinuableSetupContribution",
378
- "declaration": "export type ContinuableSetupContribution = (childCtx: Context) => () => void;"
379
- },
380
370
  {
381
371
  "name": "ContinuableStart",
382
372
  "declaration": "export interface ContinuableStart {\n readonly childId: SessionId;\n readonly messageId: MessageId;\n}"
@@ -389,10 +379,6 @@ export const TYPERT = {
389
379
  "name": "ContinuableSubagentDescriptorData",
390
380
  "declaration": "export interface ContinuableSubagentDescriptorData extends SubagentDescriptorBase {\n readonly mode: 'continuable';\n readonly label: string;\n readonly agentProvider?: string;\n readonly agentModel?: string;\n readonly agentReasoningEffort?: ReasoningEffortId;\n readonly persona?: string;\n readonly toolFilter?: ToolRestriction;\n}"
391
381
  },
392
- {
393
- "name": "CoordinatorMessageSource",
394
- "declaration": "export interface CoordinatorMessageSource {\n readonly kind: 'coordinator';\n readonly form: 'relay';\n readonly senderSessionId: SessionId;\n}"
395
- },
396
382
  {
397
383
  "name": "EpochHeader",
398
384
  "declaration": "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n system?: string;\n tools?: ToolSchema[];\n}"
@@ -507,7 +493,7 @@ export const TYPERT = {
507
493
  },
508
494
  {
509
495
  "name": "MessageSourceMap",
510
- "declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n plugin: { kind: 'plugin'; plugin: string; } & ContextFormed;\n model: ModelMessageSource;\n tool: ToolMessageSource;\n 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; };\n coordinator: CoordinatorMessageSource;\n 'subagent-report': SubagentReportMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'skill-invocation': SkillInvocationSource;\n 'team-message': TeamMessageSource;\n goal: GoalMessageSource;\n 'session-reference': SessionReferenceSource;\n}"
496
+ "declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n plugin: { kind: 'plugin'; plugin: string; } & ContextFormed;\n model: ModelMessageSource;\n tool: ToolMessageSource;\n 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; };\n 'agent-message': AgentMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'skill-invocation': SkillInvocationSource;\n 'team-message': TeamMessageSource;\n goal: GoalMessageSource;\n 'session-reference': SessionReferenceSource;\n}"
511
497
  },
512
498
  {
513
499
  "name": "ModelMessageSource",
@@ -525,6 +511,10 @@ export const TYPERT = {
525
511
  "name": "OneShotSubagentDescriptorData",
526
512
  "declaration": "export interface OneShotSubagentDescriptorData extends SubagentDescriptorBase {\n readonly mode: 'one-shot';\n readonly label?: string;\n}"
527
513
  },
514
+ {
515
+ "name": "OptionalSessionSeq",
516
+ "declaration": "export type OptionalSessionSeq = SessionSeq | null;"
517
+ },
528
518
  {
529
519
  "name": "PromptContentPart",
530
520
  "declaration": "export type PromptContentPart = { readonly type: 'text'; readonly text: string; } | { readonly type: 'image'; readonly mediaType: ImageMediaType; readonly data: string; readonly name?: string; };"
@@ -571,15 +561,15 @@ export const TYPERT = {
571
561
  },
572
562
  {
573
563
  "name": "Session",
574
- "declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n get id(): SessionId;\n readonly firstLiveSeq: number;\n get events(): readonly SessionEvent[];\n get seq(): number;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
564
+ "declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n readonly inheritedEventCount: SessionLogOffset;\n get id(): SessionId;\n readonly firstLiveSeq: SessionLogOffset;\n eventAt(seq: SessionSeq): SessionEvent | undefined;\n snapshotEvents(fromSeq: SessionLogOffset = SessionLogOffset(0), toSeqExclusive: SessionLogOffset = this.seq): readonly SessionEvent[];\n ownEvents(): readonly SessionEvent[];\n isOwnSeq(seq: SessionSeq): boolean;\n get seq(): SessionLogOffset;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
575
565
  },
576
566
  {
577
567
  "name": "SessionEvent",
578
- "declaration": "export type SessionEvent<T extends SessionEventType = SessionEventType> = { [K in SessionEventType]: { type: K; seq: number; time: number; data: SessionEventMap[K]; ignorable?: true; } & (K extends SurfaceEventType ? { sourceEventSeqs?: number[]; surfaceOp?: SurfaceOp; } : object) }[T];"
568
+ "declaration": "export type SessionEvent<T extends SessionEventType = SessionEventType> = { [K in SessionEventType]: { type: K; seq: SessionSeq; time: number; data: SessionEventMap[K]; ignorable?: true; } & (K extends SurfaceEventType ? { sourceEventSeqs?: SessionSeq[]; surfaceOp?: SurfaceOp; } : object) }[T];"
579
569
  },
580
570
  {
581
571
  "name": "SessionEventMap",
582
- "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 'assistant/chunk': { turn: number; step: number; chunk: StreamChunk; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; usage?: TokenUsage; interrupted?: true; };\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; }; meta?: JsonValue; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; startsSeries?: true; };\n 'request/context': RequestContext;\n 'session/end-seed': Record<string, never>;\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\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 'tool/code-dispatch-start': PtcDispatchStartEventData;\n 'tool/code-dispatch': PtcDispatchEventData;\n 'agent-preset/selected': { agentPreset: string; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'model/selection': ModelSelection;\n 'subagent/descriptor': SubagentDescriptorData;\n 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: number; };\n 'team/member': { version: 1; teamId: TeamId; member: TeamMemberSnapshot; };\n 'team/task': { version: 1; teamId: TeamId; task: TeamTaskSnapshot; };\n 'team/message/queued': { version: 1; teamId: TeamId; message: TeamMessageSnapshot; };\n 'team/message/delivered': { version: 1; teamId: TeamId; messageId: TeamMessageId; targetId: SessionId; };\n 'goal/change': GoalChangeMeta;\n 'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; };\n 'compaction/summary': { compactionId: CompactionId; sourceCommandId?: CommandId; summary: ContentBlock[]; shadowedRange: { start: number; end: number; }; shadowedSeqs: number[]; 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: number; end: number; }; shadowedSeqs: number[]; shadowedTokenCount: number; };\n}"
572
+ "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 'assistant/chunk': { turn: number; step: number; chunk: StreamChunk; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; usage?: TokenUsage; interrupted?: true; };\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; }; meta?: JsonValue; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; startsSeries?: true; };\n 'request/context': RequestContext;\n 'session/end-seed': Record<string, never>;\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\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 'tool/code-dispatch-start': PtcDispatchStartEventData;\n 'tool/code-dispatch': PtcDispatchEventData;\n 'agent-preset/selected': { agentPreset: string; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'model/selection': ModelSelection;\n 'subagent/descriptor': SubagentDescriptorData;\n 'sandbox/mode': { mode: SandboxMode; 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 'team/member': { version: 1; teamId: TeamId; member: TeamMemberSnapshot; };\n 'team/task': { version: 1; teamId: TeamId; task: TeamTaskSnapshot; };\n 'team/message/queued': { version: 1; teamId: TeamId; message: TeamMessageSnapshot; };\n 'team/message/delivered': { version: 1; teamId: TeamId; messageId: TeamMessageId; targetId: SessionId; };\n 'goal/change': GoalChangeMeta;\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}"
583
573
  },
584
574
  {
585
575
  "name": "SessionEventType",
@@ -587,27 +577,35 @@ export const TYPERT = {
587
577
  },
588
578
  {
589
579
  "name": "SessionHeader",
590
- "declaration": "export interface SessionHeader {\n readonly version: number;\n readonly id: SessionId;\n readonly createdAt: number;\n readonly cwd?: string;\n readonly parentSession?: SessionId;\n readonly seedLength?: number;\n readonly origin?: 'subagent';\n readonly delegationDepth?: number;\n readonly agentPreset?: string;\n}"
580
+ "declaration": "export interface SessionHeader {\n readonly version: number;\n readonly id: SessionId;\n readonly createdAt: number;\n readonly cwd?: string;\n readonly parentSession?: SessionId;\n readonly isSeeded: boolean;\n readonly origin?: 'subagent';\n readonly delegationDepth?: number;\n readonly agentPreset?: string;\n}"
591
581
  },
592
582
  {
593
583
  "name": "SessionId",
594
584
  "declaration": "export type SessionId = Branded<'SessionId'>;"
595
585
  },
586
+ {
587
+ "name": "SessionLogOffset",
588
+ "declaration": "export type SessionLogOffset = BrandedNumber<'SessionLogOffset'>;"
589
+ },
596
590
  {
597
591
  "name": "SessionReferenceSource",
598
- "declaration": "export interface SessionReferenceSource {\n kind: 'session-reference';\n form: 'recall';\n version: 1;\n references: { sessionId: string; label: string; capturedThroughSeq: number | null; compacted: boolean; originalMessages: number; retainedMessages: number; omittedMessages: number; omittedBytes: number; truncated: boolean; inputIndex: number; }[];\n}"
592
+ "declaration": "export interface SessionReferenceSource {\n kind: 'session-reference';\n form: 'recall';\n version: 1;\n references: { sessionId: string; label: string; capturedThroughSeq: OptionalSessionSeq; compacted: boolean; originalMessages: number; retainedMessages: number; omittedMessages: number; omittedBytes: number; truncated: boolean; inputIndex: number; }[];\n}"
599
593
  },
600
594
  {
601
595
  "name": "SessionRequestId",
602
596
  "declaration": "export type SessionRequestId = Branded<'session-request-id'>;"
603
597
  },
598
+ {
599
+ "name": "SessionSeq",
600
+ "declaration": "export type SessionSeq = BrandedNumber<'SessionSeq'>;"
601
+ },
604
602
  {
605
603
  "name": "SessionSurface",
606
- "declaration": "export interface SessionSurface {\n readonly nodes: readonly number[];\n readonly replaceGeneration: number;\n}"
604
+ "declaration": "export interface SessionSurface {\n readonly nodes: readonly SessionSeq[];\n readonly replaceGeneration: number;\n}"
607
605
  },
608
606
  {
609
607
  "name": "SessionTitleEventData",
610
- "declaration": "export interface SessionTitleEventData {\n readonly title: string;\n readonly messageSeqs: number[];\n readonly source: SessionTitleSource;\n}"
608
+ "declaration": "export interface SessionTitleEventData {\n readonly title: string;\n readonly messageSeqs: SessionSeq[];\n readonly source: SessionTitleSource;\n}"
611
609
  },
612
610
  {
613
611
  "name": "SessionTitleModelProvenance",
@@ -649,10 +647,6 @@ export const TYPERT = {
649
647
  "name": "SubagentDescriptorData",
650
648
  "declaration": "export type SubagentDescriptorData = OneShotSubagentDescriptorData | ContinuableSubagentDescriptorData;"
651
649
  },
652
- {
653
- "name": "SubagentFollowupOptions",
654
- "declaration": "export interface SubagentFollowupOptions {\n readonly source: MessageSource;\n readonly signal: AbortSignal;\n}"
655
- },
656
650
  {
657
651
  "name": "SubagentInterruptAuthority",
658
652
  "declaration": "export type SubagentInterruptAuthority = { readonly kind: 'user'; readonly parentSessionId: SessionId; } | { readonly kind: 'ancestor'; readonly agent: Agent; };"
@@ -681,18 +675,6 @@ export const TYPERT = {
681
675
  "name": "SubagentProvider",
682
676
  "declaration": "export interface SubagentProvider {\n readonly name: string;\n readonly capabilities: SubagentCapabilities;\n readonly inheritsParentContext: boolean;\n readonly agentRouteDefaults?: Readonly<{ provider: string; model: string; }>;\n start(request: ResolvedSubagentStartRequest): Promise<SubagentRun>;\n prepareContinuable?(request: ContinuableCreateRequest): Promise<ContinuableCreateSpec>;\n}"
683
677
  },
684
- {
685
- "name": "SubagentReportDelivery",
686
- "declaration": "export type SubagentReportDelivery = 'quiet' | 'next-step';"
687
- },
688
- {
689
- "name": "SubagentReportMessageSource",
690
- "declaration": "export interface SubagentReportMessageSource {\n readonly kind: 'subagent-report';\n readonly form: 'relay';\n readonly senderSessionId: SessionId;\n}"
691
- },
692
- {
693
- "name": "SubagentReportOptions",
694
- "declaration": "export interface SubagentReportOptions {\n readonly delivery: SubagentReportDelivery;\n readonly signal: AbortSignal;\n}"
695
- },
696
678
  {
697
679
  "name": "SubagentResult",
698
680
  "declaration": "export interface SubagentResult {\n readonly output: ContentBlock[];\n readonly structured?: unknown;\n readonly diagnostic?: string;\n readonly stopReason: SubagentStopReason;\n}"
@@ -701,6 +683,10 @@ export const TYPERT = {
701
683
  "name": "SubagentRun",
702
684
  "declaration": "export interface SubagentRun {\n readonly id: SessionId;\n readonly localAgent: Agent | undefined;\n readonly result: Promise<SubagentResult>;\n dispose(): Promise<void>;\n}"
703
685
  },
686
+ {
687
+ "name": "SubagentSendMessageOptions",
688
+ "declaration": "export interface SubagentSendMessageOptions {\n readonly signal: AbortSignal;\n}"
689
+ },
704
690
  {
705
691
  "name": "SubagentSettledMessageSource",
706
692
  "declaration": "export interface SubagentSettledMessageSource {\n readonly kind: 'subagent-settled';\n readonly form: 'notice';\n readonly summary: string;\n readonly senderSessionId: SessionId;\n}"
@@ -723,11 +709,11 @@ export const TYPERT = {
723
709
  },
724
710
  {
725
711
  "name": "SurfaceIntent",
726
- "declaration": "export interface SurfaceIntent {\n surfaceOp: SurfaceOp;\n sourceEventSeqs?: number[];\n}"
712
+ "declaration": "export interface SurfaceIntent {\n surfaceOp: SurfaceOp;\n sourceEventSeqs?: SessionSeq[];\n}"
727
713
  },
728
714
  {
729
715
  "name": "SurfaceOp",
730
- "declaration": "export type SurfaceOp = 'append' | { op: 'replace'; start: number; end: number; };"
716
+ "declaration": "export type SurfaceOp = 'append' | { op: 'replace'; start: SessionSeq; end: SessionSeq; };"
731
717
  },
732
718
  {
733
719
  "name": "TeamId",
@@ -98,7 +98,7 @@ export const TYPERT_REMOTE = {
98
98
  typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentInterruptReceipt',
99
99
  schema: _deepseek_ai_dsh_subagent_subagents_interruptByParent_result$schema,
100
100
  },
101
- sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":491,"column":3},
101
+ sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":476,"column":3},
102
102
  },
103
103
  {
104
104
  id: '@deepseek-ai/dsh-subagent#subagents/list',
@@ -125,7 +125,7 @@ export const TYPERT_REMOTE = {
125
125
  typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentCatalog',
126
126
  schema: _deepseek_ai_dsh_subagent_subagents_list_result$schema,
127
127
  },
128
- sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":407,"column":9},
128
+ sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":384,"column":9},
129
129
  },
130
130
  {
131
131
  id: '@deepseek-ai/dsh-subagent#subagents/prompt',
@@ -151,7 +151,7 @@ export const TYPERT_REMOTE = {
151
151
  typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentPromptReceipt',
152
152
  schema: _deepseek_ai_dsh_subagent_subagents_prompt_result$schema,
153
153
  },
154
- sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":433,"column":9},
154
+ sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":410,"column":9},
155
155
  },
156
156
  ],
157
157
  }
@@ -64,10 +64,10 @@ export declare function resolveChildAgentOptions(parent: Agent, requested: Agent
64
64
  * child never had.
65
65
  * @param parent - the delegating parent agent.
66
66
  * @param childDepth - the resolved delegation depth to persist.
67
- * @param lineageSeedLength - how many leading events came from the parent's log.
67
+ * @param isSeeded - whether this child inherits a parent-log prefix, including an explicitly empty one.
68
68
  * @returns the `meta` for `ctx.agents.create()`.
69
69
  */
70
- export declare function childSessionMeta(parent: Agent, childDepth: number, lineageSeedLength: number): NonNullable<CreateAgentOptions['meta']>;
70
+ export declare function childSessionMeta(parent: Agent, childDepth: number, isSeeded: boolean): NonNullable<CreateAgentOptions['meta']>;
71
71
  /** The scoped composition a child agent's creation window applies. */
72
72
  export interface ChildComposition {
73
73
  /** Per-child persona shadowing the deployment persona. */
@@ -105,22 +105,22 @@ export function resolveChildAgentOptions(parent, requested, childDepth) {
105
105
  * child never had.
106
106
  * @param parent - the delegating parent agent.
107
107
  * @param childDepth - the resolved delegation depth to persist.
108
- * @param lineageSeedLength - how many leading events came from the parent's log.
108
+ * @param isSeeded - whether this child inherits a parent-log prefix, including an explicitly empty one.
109
109
  * @returns the `meta` for `ctx.agents.create()`.
110
110
  */
111
- export function childSessionMeta(parent, childDepth, lineageSeedLength) {
111
+ export function childSessionMeta(parent, childDepth, isSeeded) {
112
112
  const parentHeader = parent.session.header;
113
113
  const agentPreset = parent.ctx.get('agentPresets')?.composedPreset(parent.ctx);
114
114
  return {
115
115
  ...parentHeader.cwd !== undefined ? { cwd: parentHeader.cwd } : {},
116
116
  ...agentPreset === undefined ? {} : { agentPreset },
117
117
  parentSession: parentHeader.id,
118
+ isSeeded,
118
119
  // Navigation classification only; the descriptor remains the authority
119
120
  // for mode and continuation capability.
120
121
  origin: 'subagent',
121
122
  // Durable: the recursion budget must survive persistence and resume.
122
123
  delegationDepth: childDepth,
123
- ...lineageSeedLength > 0 ? { seedLength: lineageSeedLength } : {},
124
124
  };
125
125
  }
126
126
  /**
@@ -27,27 +27,18 @@ import type { SessionId } from '@deepseek-ai/dsh-session';
27
27
  import type { SubagentDescriptorData } from './descriptor.ts';
28
28
  import type { ContinuableCreateRequest, ContinuableCreateSpec, SubagentStartRequest } from './types.ts';
29
29
  import type { ActivationObserver } from './lifecycle.ts';
30
- import type SubagentActivationSetupRegistry from './activation-setup-registry.ts';
31
- /** Attribution for a model coordinator's follow-up to one of its children. */
32
- export interface CoordinatorMessageSource {
33
- readonly kind: 'coordinator';
30
+ /** Durable attribution for one model-authored message between adjacent Agents. */
31
+ export interface AgentMessageSource {
32
+ readonly kind: 'agent-message';
34
33
  /** A message another agent addressed to this one (`relay` context form). */
35
34
  readonly form: 'relay';
36
- /** Session id of the agent whose tool call produced the follow-up. */
37
- readonly senderSessionId: SessionId;
38
- }
39
- /** Durable attribution for a continuable child's explicit parent report. */
40
- export interface SubagentReportMessageSource {
41
- readonly kind: 'subagent-report';
42
- /** A message another agent addressed to this one (`relay` context form). */
43
- readonly form: 'relay';
44
- /** Session id of the reporting child. */
35
+ /** Session id of the Agent whose tool call produced the message. */
45
36
  readonly senderSessionId: SessionId;
46
37
  }
47
38
  /**
48
39
  * Durable attribution for the runtime's own account of a continuable child
49
40
  * settling. Deliberately a different kind from
50
- * {@link SubagentReportMessageSource}: a report is content the child chose,
41
+ * {@link AgentMessageSource}: an Agent message is content the sender chose,
51
42
  * while this message is the manager stating what became of the child, and a
52
43
  * transcript that merged them would credit the child with words it never wrote.
53
44
  */
@@ -62,20 +53,10 @@ export interface SubagentSettledMessageSource {
62
53
  }
63
54
  declare module '@deepseek-ai/dsh-llm' {
64
55
  interface MessageSourceMap {
65
- coordinator: CoordinatorMessageSource;
66
- 'subagent-report': SubagentReportMessageSource;
56
+ 'agent-message': AgentMessageSource;
67
57
  'subagent-settled': SubagentSettledMessageSource;
68
58
  }
69
59
  }
70
- /** Deployment scheduling policy for accepted child reports. */
71
- export type SubagentReportDelivery = 'quiet' | 'next-step';
72
- /** Options for one continuable child's report to its direct parent. */
73
- export interface SubagentReportOptions {
74
- /** Already-resolved parent scheduling policy. */
75
- readonly delivery: SubagentReportDelivery;
76
- /** Caller cancellation, owning authorization and admission until acceptance. */
77
- readonly signal: AbortSignal;
78
- }
79
60
  /** What a caller asks for when starting a continuable background child. */
80
61
  export interface ContinuableStartSpec {
81
62
  /** The `ctx.subagents` provider whose continuable-creation capability establishes the child. */
@@ -115,10 +96,8 @@ export type SubagentInterruptAuthority = {
115
96
  readonly kind: 'ancestor';
116
97
  readonly agent: Agent;
117
98
  };
118
- /** Options for following up with one continuable child. */
119
- export interface SubagentFollowupOptions {
120
- /** Durable attribution retained on the delivered message; it grants no authority. */
121
- readonly source: MessageSource;
99
+ /** Options for one model-authored message between adjacent Agents. */
100
+ export interface SubagentSendMessageOptions {
122
101
  /** Caller cancellation, owning the operation only until inbox acceptance. */
123
102
  readonly signal: AbortSignal;
124
103
  }
@@ -155,7 +134,6 @@ interface ContinuationHost {
155
134
  export declare class SubagentContinuationManager {
156
135
  private readonly ctx;
157
136
  private readonly host;
158
- private readonly setupRegistry;
159
137
  /** Child session id → its live Activation. Process-local, never durable. */
160
138
  private activations;
161
139
  /** Materializations admitted before drain, tracked through publication or rollback. */
@@ -171,7 +149,7 @@ export declare class SubagentContinuationManager {
171
149
  */
172
150
  private readonly closingScopes;
173
151
  private draining;
174
- constructor(ctx: Context, host: ContinuationHost, setupRegistry: SubagentActivationSetupRegistry);
152
+ constructor(ctx: Context, host: ContinuationHost);
175
153
  /**
176
154
  * Start one continuable background child: reserve its durable identity,
177
155
  * resolve the provider's detached creation spec, create the child Agent
@@ -191,23 +169,31 @@ export declare class SubagentContinuationManager {
191
169
  /** Reject one child identity already owned by a live Agent or Session. */
192
170
  private assertChildIdAvailable;
193
171
  /**
194
- * Deliver one later message to a known continuable child as its next FIFO
195
- * turn. Routing depends only on Activation residency: a `running` Activation
196
- * enqueues, a `waiting` one wakes the same Agent, and an absent one
197
- * cold-resumes a new Activation from the persisted Session. The Agent inbox
198
- * is the only queue, so every accepted message has one observable order.
199
- *
200
- * The caller signal owns lookup, materialization, and admission only until
201
- * inbox acceptance; afterwards the accepted turn cannot be cancelled through
202
- * this service.
203
- * @param parent - the exact live direct parent authorizing this delivery.
204
- * @param childId - the durable child session id.
205
- * @param content - the user-role content to deliver.
206
- * @param options - the message source fields and caller cancellation.
172
+ * Deliver one model-authored message to a direct continuable child or to the
173
+ * sender's direct parent. Both directions use Steer: a running target admits
174
+ * the message at its nearest step boundary, while an idle target starts a
175
+ * turn. A missing direct child cold-resumes through the ordinary continuation
176
+ * lifecycle. The caller signal owns the operation only until inbox acceptance.
177
+ * @param sender - exact live Agent authorizing and originating the message.
178
+ * @param targetId - durable direct-parent or direct-child session id.
179
+ * @param content - model-authored content to deliver.
180
+ * @param options - caller cancellation before acceptance.
181
+ * @returns the accepted message's inbox id.
182
+ * @throws when adjacency, availability, or admission rejects delivery.
183
+ */
184
+ sendMessage(sender: Agent, targetId: SessionId, content: ContentBlock[], options: SubagentSendMessageOptions): Promise<MessageId>;
185
+ /**
186
+ * Queue one human-authored prompt as a distinct direct-child turn.
187
+ * @param parent - exact live direct parent authorizing delivery.
188
+ * @param childId - durable direct-child session id.
189
+ * @param content - human-authored content to deliver.
190
+ * @param source - durable host-protocol provenance.
191
+ * @param signal - caller cancellation before inbox acceptance.
207
192
  * @returns the accepted message's inbox id.
208
- * @throws when parent authority, availability, or admission rejects the delivery.
209
193
  */
210
- followup(parent: Agent, childId: SessionId, content: ContentBlock[], options: SubagentFollowupOptions): Promise<MessageId>;
194
+ queuePrompt(parent: Agent, childId: SessionId, content: ContentBlock[], source: MessageSource, signal: AbortSignal): Promise<MessageId>;
195
+ /** Route one parent-originated delivery through residency and cold resume. */
196
+ private deliverToChild;
211
197
  /**
212
198
  * Interrupt one live continuable child's current turn. Admission is
213
199
  * synchronous and the effect is asynchronous: this authorizes the caller,
@@ -230,25 +216,8 @@ export declare class SubagentContinuationManager {
230
216
  * an ancestor outside the target's recorded live lineage.
231
217
  */
232
218
  interrupt(targetSessionId: SessionId, authority: SubagentInterruptAuthority): void;
233
- /**
234
- * Deliver explicitly selected content from one resident continuable child to
235
- * its durable direct parent. Sender authorization, parent resolution, and
236
- * send acceptance share one no-await span. Reporting neither concludes the
237
- * child's turn nor changes its Activation lifetime.
238
- * @param child - exact live reporting child; this is the authority credential.
239
- * @param content - selected model-facing content.
240
- * @param options - scheduling policy and pre-acceptance cancellation.
241
- * @returns the stable identity of the message accepted by the parent.
242
- * @throws {SubagentError} when the sender is unauthorized, the parent is not
243
- * live, or continuation admission is closing.
244
- */
245
- reportFrom(child: Agent, content: ContentBlock[], options: SubagentReportOptions): Promise<MessageId>;
246
- /** Authorize only the exact Agent of one resident Activation. */
247
- private authorizeReporter;
248
- /** Resolve the reporting child's live direct parent from durable lineage. */
249
- private resolveReportParent;
250
- /** Deliver one framed report through the selected parent scheduling preset. */
251
- private deliverReport;
219
+ /** Deliver one resident continuable child's message to its live direct parent. */
220
+ private sendToParent;
252
221
  /**
253
222
  * Perform one waking send to a parent, accounted against that parent's own
254
223
  * Activation when it has one. Registering the id before the send is what
@@ -259,8 +228,8 @@ export declare class SubagentContinuationManager {
259
228
  * @param send - the synchronous waking send to perform.
260
229
  */
261
230
  private sendWaking;
262
- /** Send one report while translating only the parent's own rejection. */
263
- private sendReport;
231
+ /** Send one Agent message while translating only the target's own rejection. */
232
+ private sendAgentMessage;
264
233
  /**
265
234
  * Close admission, await every already-admitted materialization through
266
235
  * publication or rollback, then dispose the stable live Activation forest
@@ -334,9 +303,8 @@ export declare class SubagentContinuationManager {
334
303
  * Submit to a freshly materialized Activation or roll it back completely.
335
304
  * @param activation - the just-published Activation to admit or release.
336
305
  * @param content - the initial or resumed message content.
337
- * @param source - durable fields naming who supplied the accepted message.
306
+ * @param options - durable source, scheduling, and pre-acceptance cancellation.
338
307
  * @param parent - the live direct parent authorizing admission.
339
- * @param signal - caller cancellation owning admission until acceptance.
340
308
  * @returns the accepted inbox message id.
341
309
  */
342
310
  private submitMaterialized;