@deepseek-ai/dsh-subagent 0.1.7-alpha.2 → 0.1.7-rc.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.
- package/README.i18n.yaml +93 -5
- package/README.md +3 -2
- package/README.zh.md +4 -3
- package/lib/index.js +71 -238
- package/lib/typert.host.js +65 -41
- package/lib/types/child-agent.d.ts +4 -1
- package/lib/types/control-types.d.ts +12 -16
- package/lib/types/control-types.js +1 -1
- package/lib/types/index.d.ts +14 -14
- package/lib/types/index.js +12 -12
- package/lib/types/list-children.d.ts +10 -22
- package/lib/types/list-children.js +50 -261
- package/package.json +48 -53
package/lib/typert.host.js
CHANGED
|
@@ -175,8 +175,8 @@ export const TYPERT = {
|
|
|
175
175
|
"kind": "method",
|
|
176
176
|
"name": "listDescendants",
|
|
177
177
|
"signature": "listDescendants(rootSessionId: SessionId, signal?: AbortSignal): Promise<SubagentDescendantListEntry[]>",
|
|
178
|
-
"summary": "
|
|
179
|
-
"jsDoc": "/**\n *
|
|
178
|
+
"summary": "Recursively list reachable parent catalogs in stable pre-order, preserving each catalog's event order.",
|
|
179
|
+
"jsDoc": "/**\n * Recursively list reachable parent catalogs in stable pre-order, preserving\n * each catalog's event order. Each row carries its catalog parent and depth;\n * one-shot and unknown-mode children remain traversal nodes. Unknown modes\n * produce unsupported diagnostics. Unreadable child catalogs produce corrupt\n * or unavailable diagnostics and stop only that branch. Root read failures,\n * missing services or projections, and cancellation reject the whole listing.\n * Each catalog is observed once and released before the next read. No Agent\n * is loaded or resumed; Sessions absent from reachable catalogs are omitted.\n * @param rootSessionId - session whose catalog starts descendant discovery.\n * @param signal - cancellation forwarded to and checked around each catalog read.\n * @returns children and branch diagnostics in parent-catalog pre-order.\n * @throws {@link SubagentError} when listing dependencies are unavailable or the caller cancels.\n * @throws SessionQueryError when the root catalog cannot be read.\n */"
|
|
180
180
|
},
|
|
181
181
|
{
|
|
182
182
|
"kind": "method",
|
|
@@ -222,6 +222,10 @@ export const TYPERT = {
|
|
|
222
222
|
}
|
|
223
223
|
],
|
|
224
224
|
"types": [
|
|
225
|
+
{
|
|
226
|
+
"name": "AfterScheduleRecord",
|
|
227
|
+
"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}"
|
|
228
|
+
},
|
|
225
229
|
{
|
|
226
230
|
"name": "Agent",
|
|
227
231
|
"declaration": "export interface Agent {\n readonly id: SessionId;\n readonly options: AgentOptions;\n readonly session: Session;\n readonly inbox: Inbox;\n readonly status: AgentStatus;\n readonly ctx: Context;\n cancel(cause: AgentCancelCause, options?: CancelOptions): void;\n whenIdle(): Promise<void>;\n runMaintenance<T>(task: (signal: AbortSignal) => Promise<T>): Promise<T>;\n send(message: UserMessage, target: InboxTarget, wakeup: boolean): void;\n followup(message: UserMessage): void;\n steer(message: UserMessage): void;\n inject(message: UserMessage): void;\n}"
|
|
@@ -266,6 +270,10 @@ export const TYPERT = {
|
|
|
266
270
|
"name": "AssistantStreamRecord",
|
|
267
271
|
"declaration": "export type AssistantStreamRecord = { readonly type: 'text-chunks'; readonly time0: number; readonly index: number; readonly dt: readonly number[]; readonly texts: readonly string[]; } | { readonly type: 'reasoning-chunks'; readonly time0: number; readonly index: number; readonly dt: readonly number[]; readonly texts: readonly string[]; } | { readonly type: 'tool-call-chunks'; readonly time0: number; readonly index: number; readonly dt: readonly number[]; readonly id: ToolCallId; readonly name?: string; readonly args: readonly string[]; } | { readonly type: 'chunk'; readonly time: number; readonly chunk: StreamChunk; };"
|
|
268
272
|
},
|
|
273
|
+
{
|
|
274
|
+
"name": "AtScheduleRecord",
|
|
275
|
+
"declaration": "export interface AtScheduleRecord {\n readonly id: ScheduleId;\n readonly kind: 'at';\n readonly title: string;\n readonly prompt: string;\n readonly scheduledAt: string;\n}"
|
|
276
|
+
},
|
|
269
277
|
{
|
|
270
278
|
"name": "AttachmentId",
|
|
271
279
|
"declaration": "export type AttachmentId = Branded<'AttachmentId'>;"
|
|
@@ -350,6 +358,14 @@ export const TYPERT = {
|
|
|
350
358
|
"name": "EpochHeader",
|
|
351
359
|
"declaration": "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n tools?: ToolSchema[];\n system?: never;\n}"
|
|
352
360
|
},
|
|
361
|
+
{
|
|
362
|
+
"name": "EveryScheduleDispatchChange",
|
|
363
|
+
"declaration": "export interface EveryScheduleDispatchChange {\n readonly version: 1;\n readonly operation: 'dispatch';\n readonly id: ScheduleId;\n readonly acceptedAt: string;\n}"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"name": "EveryScheduleRecord",
|
|
367
|
+
"declaration": "export interface EveryScheduleRecord {\n readonly id: ScheduleId;\n readonly kind: 'every';\n readonly title: string;\n readonly prompt: string;\n readonly everySeconds: number;\n readonly scheduledAt: string;\n}"
|
|
368
|
+
},
|
|
353
369
|
{
|
|
354
370
|
"name": "FeedbackCategory",
|
|
355
371
|
"declaration": "export type FeedbackCategory = 'task-result' | 'instruction-following' | 'product-interaction' | 'service-stability' | 'resource-cost' | 'security-privacy-permission' | 'other';"
|
|
@@ -458,6 +474,22 @@ export const TYPERT = {
|
|
|
458
474
|
"name": "KnownCatalogMode",
|
|
459
475
|
"declaration": "export type KnownCatalogMode = { readonly mode: 'one-shot'; readonly label?: string; } | { readonly mode: 'continuable'; readonly label: string; };"
|
|
460
476
|
},
|
|
477
|
+
{
|
|
478
|
+
"name": "LegacyAfterScheduleRecord",
|
|
479
|
+
"declaration": "export interface LegacyAfterScheduleRecord extends Omit<AfterScheduleRecord, 'title'> {\n readonly title?: string;\n}"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"name": "LegacyAtScheduleRecord",
|
|
483
|
+
"declaration": "export interface LegacyAtScheduleRecord extends Omit<AtScheduleRecord, 'title'> {\n readonly title?: string;\n}"
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"name": "LegacyEveryScheduleRecord",
|
|
487
|
+
"declaration": "export interface LegacyEveryScheduleRecord extends Omit<EveryScheduleRecord, 'title'> {\n readonly title?: string;\n}"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"name": "LegacyScheduleRecord",
|
|
491
|
+
"declaration": "export type LegacyScheduleRecord = LegacyAfterScheduleRecord | LegacyAtScheduleRecord | LegacyEveryScheduleRecord;"
|
|
492
|
+
},
|
|
461
493
|
{
|
|
462
494
|
"name": "LlmCallConfig",
|
|
463
495
|
"declaration": "export interface LlmCallConfig {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n}"
|
|
@@ -512,7 +544,7 @@ export const TYPERT = {
|
|
|
512
544
|
},
|
|
513
545
|
{
|
|
514
546
|
"name": "MessageSourceMap",
|
|
515
|
-
"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 'user-approval': { kind: 'user-approval'; } & ContextFormed;\n 'ptc-mode': { kind: 'ptc-mode'; };\n 'tool-registry': { kind: 'tool-registry'; };\n 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; };\n 'agent-message': AgentMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'skill-invocation': SkillInvocationSource;\n 'cordis-host-runner': { kind: 'cordis-host-runner'; };\n
|
|
547
|
+
"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 'user-approval': { kind: 'user-approval'; } & ContextFormed;\n 'ptc-mode': { kind: 'ptc-mode'; };\n 'tool-registry': { kind: 'tool-registry'; };\n 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; };\n 'agent-message': AgentMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'skill-invocation': SkillInvocationSource;\n 'cordis-host-runner': { kind: 'cordis-host-runner'; };\n goal: GoalMessageSource;\n schedule: { kind: 'schedule'; } & ContextFormed;\n 'compact-checkpoint': CompactionCheckpointSource;\n 'session-reference': SessionReferenceSource;\n}"
|
|
516
548
|
},
|
|
517
549
|
{
|
|
518
550
|
"name": "ModelMessageSource",
|
|
@@ -526,6 +558,10 @@ export const TYPERT = {
|
|
|
526
558
|
"name": "ObjectJsonSchema",
|
|
527
559
|
"declaration": "export type ObjectJsonSchema = JsonSchemaNode & { type: 'object'; };"
|
|
528
560
|
},
|
|
561
|
+
{
|
|
562
|
+
"name": "OneShotScheduleDispatchChange",
|
|
563
|
+
"declaration": "export interface OneShotScheduleDispatchChange {\n readonly version: 1;\n readonly operation: 'dispatch';\n readonly id: ScheduleId;\n}"
|
|
564
|
+
},
|
|
529
565
|
{
|
|
530
566
|
"name": "OneShotSubagentDescriptorData",
|
|
531
567
|
"declaration": "export interface OneShotSubagentDescriptorData extends SubagentDescriptorBase {\n readonly mode: 'one-shot';\n readonly label?: string;\n}"
|
|
@@ -578,9 +614,29 @@ export const TYPERT = {
|
|
|
578
614
|
"name": "SandboxMode",
|
|
579
615
|
"declaration": "export type SandboxMode = 'read-only' | 'workspace-write' | 'danger-full-access';"
|
|
580
616
|
},
|
|
617
|
+
{
|
|
618
|
+
"name": "ScheduleChange",
|
|
619
|
+
"declaration": "export type ScheduleChange = ScheduleCreateChange | ScheduleDeleteChange | ScheduleDispatchChange;"
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
"name": "ScheduleCreateChange",
|
|
623
|
+
"declaration": "export interface ScheduleCreateChange {\n readonly version: 1;\n readonly operation: 'create';\n readonly schedule: LegacyScheduleRecord;\n}"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"name": "ScheduleDeleteChange",
|
|
627
|
+
"declaration": "export interface ScheduleDeleteChange {\n readonly version: 1;\n readonly operation: 'delete';\n readonly id: ScheduleId;\n}"
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
"name": "ScheduleDispatchChange",
|
|
631
|
+
"declaration": "export type ScheduleDispatchChange = OneShotScheduleDispatchChange | EveryScheduleDispatchChange;"
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
"name": "ScheduleId",
|
|
635
|
+
"declaration": "export type ScheduleId = Branded<'ScheduleId'>;"
|
|
636
|
+
},
|
|
581
637
|
{
|
|
582
638
|
"name": "Session",
|
|
583
|
-
"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 readonly firstLifecycleSeq: 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<T>] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
|
|
639
|
+
"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 readonly firstLifecycleSeq: 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<T>] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n toolHistory(): ToolHistory;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
|
|
584
640
|
},
|
|
585
641
|
{
|
|
586
642
|
"name": "SessionEvent",
|
|
@@ -588,7 +644,7 @@ export const TYPERT = {
|
|
|
588
644
|
},
|
|
589
645
|
{
|
|
590
646
|
"name": "SessionEventMap",
|
|
591
|
-
"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 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\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/ptc-dispatch-start': PtcDispatchStartEventData;\n 'tool/ptc-dispatch': PtcDispatchEventData;\n 'agent-preset/selected': { agentPreset: string; };\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 'image/offload': { targets: ImageOffloadTarget[]; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'model/selection': ModelSelection;\n 'subagent/descriptor': SubagentDescriptorData;\n 'permission/preset': { preset: string; };\n 'subagent/catalog': SubagentCatalogEvent;\n 'feedback/record': FeedbackRecord;\n '
|
|
647
|
+
"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 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\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/ptc-dispatch-start': PtcDispatchStartEventData;\n 'tool/ptc-dispatch': PtcDispatchEventData;\n 'agent-preset/selected': { agentPreset: string; };\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 'image/offload': { targets: ImageOffloadTarget[]; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'model/selection': ModelSelection;\n 'subagent/descriptor': SubagentDescriptorData;\n 'permission/preset': { preset: string; };\n 'subagent/catalog': SubagentCatalogEvent;\n 'feedback/record': FeedbackRecord;\n 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n 'schedule/change': ScheduleChange;\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}"
|
|
592
648
|
},
|
|
593
649
|
{
|
|
594
650
|
"name": "SessionEventType",
|
|
@@ -754,42 +810,6 @@ export const TYPERT = {
|
|
|
754
810
|
"name": "SystemPromptUpdate",
|
|
755
811
|
"declaration": "export type SystemPromptUpdate = 'in-history';"
|
|
756
812
|
},
|
|
757
|
-
{
|
|
758
|
-
"name": "TeamId",
|
|
759
|
-
"declaration": "export type TeamId = Branded<'TeamId'>;"
|
|
760
|
-
},
|
|
761
|
-
{
|
|
762
|
-
"name": "TeamMemberPhase",
|
|
763
|
-
"declaration": "export type TeamMemberPhase = 'provisioning' | 'active' | 'failed';"
|
|
764
|
-
},
|
|
765
|
-
{
|
|
766
|
-
"name": "TeamMemberSnapshot",
|
|
767
|
-
"declaration": "export interface TeamMemberSnapshot {\n readonly id: SessionId;\n readonly name: string;\n readonly description: string;\n readonly provider: string;\n readonly context: 'fresh' | 'fork';\n readonly phase: TeamMemberPhase;\n readonly error?: string;\n}"
|
|
768
|
-
},
|
|
769
|
-
{
|
|
770
|
-
"name": "TeamMessageId",
|
|
771
|
-
"declaration": "export type TeamMessageId = Branded<'TeamMessageId'>;"
|
|
772
|
-
},
|
|
773
|
-
{
|
|
774
|
-
"name": "TeamMessageSnapshot",
|
|
775
|
-
"declaration": "export interface TeamMessageSnapshot {\n readonly id: TeamMessageId;\n readonly senderId: SessionId;\n readonly senderName: string;\n readonly targetId: SessionId;\n readonly content: ContentBlock[];\n}"
|
|
776
|
-
},
|
|
777
|
-
{
|
|
778
|
-
"name": "TeamMessageSource",
|
|
779
|
-
"declaration": "export interface TeamMessageSource {\n readonly kind: 'team-message';\n readonly teamId: TeamId;\n readonly messageId: TeamMessageId;\n readonly senderId: SessionId;\n readonly senderName: string;\n}"
|
|
780
|
-
},
|
|
781
|
-
{
|
|
782
|
-
"name": "TeamTaskId",
|
|
783
|
-
"declaration": "export type TeamTaskId = Branded<'TeamTaskId'>;"
|
|
784
|
-
},
|
|
785
|
-
{
|
|
786
|
-
"name": "TeamTaskSnapshot",
|
|
787
|
-
"declaration": "export interface TeamTaskSnapshot {\n readonly id: TeamTaskId;\n readonly revision: number;\n readonly subject: string;\n readonly description: string;\n readonly status: TeamTaskStatus;\n readonly ownerId?: SessionId;\n readonly blockedBy: TeamTaskId[];\n readonly writeScopes: string[];\n}"
|
|
788
|
-
},
|
|
789
|
-
{
|
|
790
|
-
"name": "TeamTaskStatus",
|
|
791
|
-
"declaration": "export type TeamTaskStatus = 'pending' | 'in_progress' | 'completed' | 'deleted';"
|
|
792
|
-
},
|
|
793
813
|
{
|
|
794
814
|
"name": "TextBlock",
|
|
795
815
|
"declaration": "export interface TextBlock {\n type: 'text';\n text: string;\n}"
|
|
@@ -814,6 +834,10 @@ export const TYPERT = {
|
|
|
814
834
|
"name": "ToolCallId",
|
|
815
835
|
"declaration": "export type ToolCallId = Branded<'ToolCallId'>;"
|
|
816
836
|
},
|
|
837
|
+
{
|
|
838
|
+
"name": "ToolHistory",
|
|
839
|
+
"declaration": "export interface ToolHistory {\n readonly tools: readonly ToolSchema[];\n readonly updates: readonly { readonly messageId: MessageId; readonly additions: readonly ToolSchema[]; }[];\n}"
|
|
840
|
+
},
|
|
817
841
|
{
|
|
818
842
|
"name": "ToolMessageSource",
|
|
819
843
|
"declaration": "export interface ToolMessageSource {\n kind: 'tool';\n callId: ToolCallId;\n}"
|
|
@@ -106,7 +106,10 @@ export declare const SUBAGENT_DELEGATION_CONTEXT: string;
|
|
|
106
106
|
export declare function applyChildComposition(childCtx: Context, parent: Agent, composition: ChildComposition): void;
|
|
107
107
|
/** Policy seeded onto a child session's log at the delegation boundary. */
|
|
108
108
|
export interface DelegatedPolicyOverrides {
|
|
109
|
-
/**
|
|
109
|
+
/**
|
|
110
|
+
* The parent's current preset identity when it runs in Auto or Full access;
|
|
111
|
+
* the child keeps it under the pinned `never` approval policy.
|
|
112
|
+
*/
|
|
110
113
|
readonly permissionPreset: 'auto' | 'danger-full-access' | undefined;
|
|
111
114
|
/** The parent session's explicit sandbox-mode override, or `undefined` without one. */
|
|
112
115
|
readonly sandboxMode: SandboxMode | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Client-safe
|
|
2
|
+
* Client-safe recursive catalog rows and browser continuation requests,
|
|
3
3
|
* receipts, and failures.
|
|
4
4
|
*
|
|
5
5
|
* @module @deepseek-ai/dsh-subagent/control-types
|
|
@@ -16,47 +16,43 @@ import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
|
16
16
|
* rather than imported.
|
|
17
17
|
*/
|
|
18
18
|
export type SubagentPromptRequestId = Branded<'session-request-id'>;
|
|
19
|
-
/** Shared child fields for
|
|
19
|
+
/** Shared child fields for recursive catalog listing. */
|
|
20
20
|
export type SubagentCatalogRow = {
|
|
21
21
|
/** The durable child session id, stable across Activations. */
|
|
22
22
|
readonly id: SessionId;
|
|
23
23
|
/**
|
|
24
|
-
* Whether
|
|
24
|
+
* Whether recursive catalog listing observed a resident Session. This
|
|
25
25
|
* does not encode a durable outcome or guarantee continuation delivery.
|
|
26
26
|
*/
|
|
27
27
|
readonly activity: 'running' | 'inactive';
|
|
28
28
|
} & ({
|
|
29
29
|
/** A terminal one-shot child. */
|
|
30
30
|
readonly mode: 'one-shot';
|
|
31
|
-
/** Optional durable creation label from the
|
|
31
|
+
/** Optional durable creation label from the parent catalog. */
|
|
32
32
|
readonly label?: string;
|
|
33
33
|
} | {
|
|
34
34
|
/** A resumable conversation. */
|
|
35
35
|
readonly mode: 'continuable';
|
|
36
|
-
/** Durable creation label from the
|
|
36
|
+
/** Durable creation label from the parent catalog. */
|
|
37
37
|
readonly label: string;
|
|
38
38
|
});
|
|
39
39
|
/**
|
|
40
|
-
* One
|
|
41
|
-
*
|
|
40
|
+
* One recursive catalog row. Traversal may also return diagnostics for
|
|
41
|
+
* unknown catalog modes or unreadable child catalogs.
|
|
42
42
|
*/
|
|
43
43
|
export type SubagentListEntry = SubagentCatalogRow & {
|
|
44
44
|
readonly kind: 'child';
|
|
45
|
-
/** Whether
|
|
45
|
+
/** Whether the child catalog contains a direct child. */
|
|
46
46
|
readonly hasChildren: boolean;
|
|
47
47
|
} | {
|
|
48
48
|
readonly kind: 'diagnostic';
|
|
49
49
|
/** The candidate's session id. */
|
|
50
50
|
readonly id: SessionId;
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* throw (deterministic data damage, contained per child); `unavailable`
|
|
57
|
-
* when the candidate's Session observation was absent or transiently
|
|
58
|
-
* unreadable (retried on the next listing). `unsupported` is never produced; it remains in the
|
|
59
|
-
* union for consumers that route on it.
|
|
52
|
+
* `corrupt` means the child catalog read found invalid or conflicting
|
|
53
|
+
* Session data; `unavailable` means it could not be read. Either failure
|
|
54
|
+
* stops that branch. `unsupported` means the parent catalog records an
|
|
55
|
+
* unknown child mode; its readable catalog is still traversed.
|
|
60
56
|
*/
|
|
61
57
|
readonly reason: 'corrupt' | 'unsupported' | 'unavailable';
|
|
62
58
|
};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
* continuation manager holds their `AgentHandle` directly and orders every turn
|
|
19
19
|
* through the child's own inbox, so providers contribute only the detached
|
|
20
20
|
* creation spec and see no handle, turn, or teardown. Direct-child
|
|
21
|
-
* discovery
|
|
22
|
-
*
|
|
21
|
+
* discovery reads the parent catalog; descendant discovery recursively reads
|
|
22
|
+
* those child catalogs. Neither read requires the continuation runtime.
|
|
23
23
|
*
|
|
24
24
|
* Same-process providers are trusted typed collaborators. Requests, provider
|
|
25
25
|
* descriptors, results, and lifecycle payloads are borrowed immutable values;
|
|
@@ -217,19 +217,19 @@ export declare class SubagentRuntime extends TypertRemoteService {
|
|
|
217
217
|
*/
|
|
218
218
|
listChildren(parentSessionId: SessionId, signal?: AbortSignal): Promise<SubagentCatalogEntry[]>;
|
|
219
219
|
/**
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
* @param
|
|
229
|
-
*
|
|
230
|
-
* @returns children and
|
|
231
|
-
* stable pre-order.
|
|
220
|
+
* Recursively list reachable parent catalogs in stable pre-order, preserving
|
|
221
|
+
* each catalog's event order. Each row carries its catalog parent and depth;
|
|
222
|
+
* one-shot and unknown-mode children remain traversal nodes. Unknown modes
|
|
223
|
+
* produce unsupported diagnostics. Unreadable child catalogs produce corrupt
|
|
224
|
+
* or unavailable diagnostics and stop only that branch. Root read failures,
|
|
225
|
+
* missing services or projections, and cancellation reject the whole listing.
|
|
226
|
+
* Each catalog is observed once and released before the next read. No Agent
|
|
227
|
+
* is loaded or resumed; Sessions absent from reachable catalogs are omitted.
|
|
228
|
+
* @param rootSessionId - session whose catalog starts descendant discovery.
|
|
229
|
+
* @param signal - cancellation forwarded to and checked around each catalog read.
|
|
230
|
+
* @returns children and branch diagnostics in parent-catalog pre-order.
|
|
232
231
|
* @throws {@link SubagentError} when listing dependencies are unavailable or the caller cancels.
|
|
232
|
+
* @throws SessionQueryError when the root catalog cannot be read.
|
|
233
233
|
*/
|
|
234
234
|
listDescendants(rootSessionId: SessionId, signal?: AbortSignal): Promise<SubagentDescendantListEntry[]>;
|
|
235
235
|
/**
|
package/lib/types/index.js
CHANGED
|
@@ -234,19 +234,19 @@ let SubagentRuntime = (() => {
|
|
|
234
234
|
return listSubagentChildren(this.ctx, parentSessionId, signal);
|
|
235
235
|
}
|
|
236
236
|
/**
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
* @param
|
|
246
|
-
*
|
|
247
|
-
* @returns children and
|
|
248
|
-
* stable pre-order.
|
|
237
|
+
* Recursively list reachable parent catalogs in stable pre-order, preserving
|
|
238
|
+
* each catalog's event order. Each row carries its catalog parent and depth;
|
|
239
|
+
* one-shot and unknown-mode children remain traversal nodes. Unknown modes
|
|
240
|
+
* produce unsupported diagnostics. Unreadable child catalogs produce corrupt
|
|
241
|
+
* or unavailable diagnostics and stop only that branch. Root read failures,
|
|
242
|
+
* missing services or projections, and cancellation reject the whole listing.
|
|
243
|
+
* Each catalog is observed once and released before the next read. No Agent
|
|
244
|
+
* is loaded or resumed; Sessions absent from reachable catalogs are omitted.
|
|
245
|
+
* @param rootSessionId - session whose catalog starts descendant discovery.
|
|
246
|
+
* @param signal - cancellation forwarded to and checked around each catalog read.
|
|
247
|
+
* @returns children and branch diagnostics in parent-catalog pre-order.
|
|
249
248
|
* @throws {@link SubagentError} when listing dependencies are unavailable or the caller cancels.
|
|
249
|
+
* @throws SessionQueryError when the root catalog cannot be read.
|
|
250
250
|
*/
|
|
251
251
|
listDescendants(rootSessionId, signal) {
|
|
252
252
|
return listSubagentDescendants(this.ctx, rootSessionId, signal);
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Direct-child discovery from
|
|
3
|
-
*
|
|
4
|
-
* listing owns one parent observation and reads no child log. Descendant
|
|
5
|
-
* enumeration retains the complete corpus and the child identity projection
|
|
6
|
-
* because ordinary Sessions and one-shot children remain traversal nodes.
|
|
7
|
-
*
|
|
2
|
+
* Direct-child and recursive descendant discovery from parent-owned catalogs.
|
|
3
|
+
* Each catalog read releases its Session observation before the next branch.
|
|
8
4
|
* @module @deepseek-ai/dsh-subagent
|
|
9
5
|
*/
|
|
10
6
|
import type { Context } from '@deepseek-ai/cordis';
|
|
@@ -12,13 +8,9 @@ import type { SessionId } from '@deepseek-ai/dsh-session';
|
|
|
12
8
|
import type { SubagentListEntry } from './control-types.ts';
|
|
13
9
|
import type { SubagentCatalogEntry } from './projection-types.ts';
|
|
14
10
|
export type { SubagentListEntry } from './control-types.ts';
|
|
15
|
-
/**
|
|
16
|
-
* One entry of a descendant listing: the interpreted subagent facts plus its
|
|
17
|
-
* position in the complete session tree. `parentId` is the durable direct
|
|
18
|
-
* parent from the enumerated header, and `depth` counts edges from the root.
|
|
19
|
-
*/
|
|
11
|
+
/** One catalog descendant with its direct parent and edge distance from the requested root. */
|
|
20
12
|
export type SubagentDescendantListEntry = SubagentListEntry & {
|
|
21
|
-
/**
|
|
13
|
+
/** Parent whose catalog contains this child. */
|
|
22
14
|
readonly parentId: SessionId;
|
|
23
15
|
/** Edge distance from the requested root; direct children are `1`. */
|
|
24
16
|
readonly depth: number;
|
|
@@ -33,16 +25,12 @@ export type SubagentDescendantListEntry = SubagentListEntry & {
|
|
|
33
25
|
*/
|
|
34
26
|
export declare function listChildren(ctx: Context, parentSessionId: SessionId, signal?: AbortSignal): Promise<SubagentCatalogEntry[]>;
|
|
35
27
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* @
|
|
41
|
-
* @
|
|
42
|
-
* @param rootSessionId - session whose complete descendant tree is listed.
|
|
43
|
-
* @param signal - caller-owned cancellation observed around every persistence read.
|
|
44
|
-
* @returns interpreted subagents with durable direct-parent and root-relative depth.
|
|
45
|
-
* @throws {@link SubagentError} when listing dependencies are unavailable or the caller cancels.
|
|
28
|
+
* Walk reachable parent catalogs in stable pre-order without loading Agents.
|
|
29
|
+
* @see SubagentRuntime.listDescendants for failure and cancellation semantics.
|
|
30
|
+
* @param ctx - context carrying the Session store and query service.
|
|
31
|
+
* @param rootSessionId - parent whose catalog starts the traversal.
|
|
32
|
+
* @param signal - cancellation checked around each catalog read.
|
|
33
|
+
* @returns children and branch diagnostics with catalog parent and depth.
|
|
46
34
|
*/
|
|
47
35
|
export declare function listDescendants(ctx: Context, rootSessionId: SessionId, signal?: AbortSignal): Promise<SubagentDescendantListEntry[]>;
|
|
48
36
|
//# sourceMappingURL=list-children.d.ts.map
|