@deepseek-ai/dsh-subagent 0.2.3-alpha.1 → 0.2.3-alpha.3
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 +15 -12
- package/README.md +19 -5
- package/README.zh.md +19 -5
- package/lib/index.js +480 -162
- package/lib/typert.host.js +90 -5
- package/lib/typert.remote-client.d.ts +4 -1
- package/lib/typert.remote-client.d.ts.map +1 -1
- package/lib/typert.remote-client.js +57 -2
- package/lib/types/activation.d.ts +31 -4
- package/lib/types/activation.d.ts.map +1 -1
- package/lib/types/activation.js +35 -6
- package/lib/types/activation.js.map +1 -1
- package/lib/types/assistant-output.d.ts +4 -2
- package/lib/types/assistant-output.d.ts.map +1 -1
- package/lib/types/assistant-output.js +8 -8
- package/lib/types/assistant-output.js.map +1 -1
- package/lib/types/child-agent.d.ts +3 -4
- package/lib/types/child-agent.d.ts.map +1 -1
- package/lib/types/child-agent.js +4 -12
- package/lib/types/child-agent.js.map +1 -1
- package/lib/types/control-types.d.ts +26 -2
- package/lib/types/control-types.d.ts.map +1 -1
- package/lib/types/control.d.ts +16 -2
- package/lib/types/control.d.ts.map +1 -1
- package/lib/types/control.js +49 -2
- package/lib/types/control.js.map +1 -1
- package/lib/types/descriptor.d.ts +19 -15
- package/lib/types/descriptor.d.ts.map +1 -1
- package/lib/types/descriptor.js +10 -21
- package/lib/types/descriptor.js.map +1 -1
- package/lib/types/error.d.ts +4 -0
- package/lib/types/error.d.ts.map +1 -1
- package/lib/types/error.js.map +1 -1
- package/lib/types/index.d.ts +30 -2
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +58 -2
- package/lib/types/index.js.map +1 -1
- package/lib/types/lifecycle.d.ts +4 -4
- package/lib/types/lifecycle.d.ts.map +1 -1
- package/lib/types/lifecycle.js +4 -5
- package/lib/types/lifecycle.js.map +1 -1
- package/lib/types/manager.d.ts +38 -3
- package/lib/types/manager.d.ts.map +1 -1
- package/lib/types/manager.js +247 -38
- package/lib/types/manager.js.map +1 -1
- package/lib/types/model-selection.d.ts +22 -0
- package/lib/types/model-selection.d.ts.map +1 -0
- package/lib/types/model-selection.js +39 -0
- package/lib/types/model-selection.js.map +1 -0
- package/lib/types/types.d.ts +3 -3
- package/package.json +54 -54
- package/src/activation.ts +48 -9
- package/src/assistant-output.ts +9 -8
- package/src/child-agent.ts +4 -11
- package/src/control-types.ts +22 -2
- package/src/control.ts +67 -2
- package/src/descriptor.ts +20 -27
- package/src/error.ts +4 -0
- package/src/index.ts +67 -4
- package/src/lifecycle.ts +5 -6
- package/src/manager.ts +238 -34
- package/src/model-selection.ts +52 -0
- package/src/types.ts +3 -3
package/lib/typert.host.js
CHANGED
|
@@ -29,6 +29,21 @@ let _deepseek_ai_dsh_subagent_subagents_prompt_result$schema$value
|
|
|
29
29
|
const _deepseek_ai_dsh_subagent_subagents_prompt_result$schema = () => (_deepseek_ai_dsh_subagent_subagents_prompt_result$schema$value ??= z.object({
|
|
30
30
|
'messageId': z.string().readonly(),
|
|
31
31
|
}))
|
|
32
|
+
let _deepseek_ai_dsh_subagent_subagents_selectModelByUser_parameter_0$schema$value
|
|
33
|
+
const _deepseek_ai_dsh_subagent_subagents_selectModelByUser_parameter_0$schema = () => (_deepseek_ai_dsh_subagent_subagents_selectModelByUser_parameter_0$schema$value ??= z.object({
|
|
34
|
+
'childSessionId': z.string().readonly(),
|
|
35
|
+
'provider': z.string().readonly(),
|
|
36
|
+
'model': z.string().readonly(),
|
|
37
|
+
'reasoningEffort': z.string().readonly().optional().describe('Omission clears an explicit effort and uses the selected model\'s default.'),
|
|
38
|
+
}))
|
|
39
|
+
let _deepseek_ai_dsh_subagent_subagents_selectModelByUser_result$schema$value
|
|
40
|
+
const _deepseek_ai_dsh_subagent_subagents_selectModelByUser_result$schema = () => (_deepseek_ai_dsh_subagent_subagents_selectModelByUser_result$schema$value ??= z.object({
|
|
41
|
+
'selected': z.object({
|
|
42
|
+
'provider': z.string().describe('Registered provider route.'),
|
|
43
|
+
'model': z.string().describe('Provider-owned model id.'),
|
|
44
|
+
'reasoningEffort': z.string().optional().describe('Adapter-owned reasoning effort, or provider/default behavior when absent.'),
|
|
45
|
+
}).readonly(),
|
|
46
|
+
}))
|
|
32
47
|
let _deepseek_ai_dsh_subagent_subagents_interruptByUser_parameter_0_strict$schema$value
|
|
33
48
|
const _deepseek_ai_dsh_subagent_subagents_interruptByUser_parameter_0_strict$schema = () => (_deepseek_ai_dsh_subagent_subagents_interruptByUser_parameter_0_strict$schema$value ??= z.string())
|
|
34
49
|
let _deepseek_ai_dsh_subagent_subagents_prompt_parameter_0_strict$schema$value
|
|
@@ -47,6 +62,13 @@ const _deepseek_ai_dsh_subagent_subagents_prompt_parameter_0_strict$schema = ()
|
|
|
47
62
|
})])).readonly().describe('Browser prompt parts delivered as the child\'s user message. The Host admits and persists image parts before delivery, so the wire never carries a durable attachment reference the caller could fabricate.'),
|
|
48
63
|
'clientTimeZone': z.string().readonly().optional().describe('Optional browser zone sampled for this exact human prompt.'),
|
|
49
64
|
}))
|
|
65
|
+
let _deepseek_ai_dsh_subagent_subagents_selectModelByUser_parameter_0_strict$schema$value
|
|
66
|
+
const _deepseek_ai_dsh_subagent_subagents_selectModelByUser_parameter_0_strict$schema = () => (_deepseek_ai_dsh_subagent_subagents_selectModelByUser_parameter_0_strict$schema$value ??= z.strictObject({
|
|
67
|
+
'childSessionId': z.string().readonly(),
|
|
68
|
+
'provider': z.string().readonly(),
|
|
69
|
+
'model': z.string().readonly(),
|
|
70
|
+
'reasoningEffort': z.string().readonly().optional().describe('Omission clears an explicit effort and uses the selected model\'s default.'),
|
|
71
|
+
}))
|
|
50
72
|
|
|
51
73
|
const $remote = createTypertRemoteInfo({
|
|
52
74
|
package: '@deepseek-ai/dsh-subagent',
|
|
@@ -81,7 +103,7 @@ const $remote = createTypertRemoteInfo({
|
|
|
81
103
|
description: 'acknowledgement that the cancel signal was admitted, not that the target is quiescent.',
|
|
82
104
|
jsonSchema: {"type":"object","properties":{"accepted":{"type":"boolean","const":true}},"required":["accepted"],"additionalProperties":true},
|
|
83
105
|
},
|
|
84
|
-
sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":
|
|
106
|
+
sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":544,"column":3},
|
|
85
107
|
},
|
|
86
108
|
'subagents/prompt': {
|
|
87
109
|
service: 'subagents',
|
|
@@ -114,7 +136,40 @@ const $remote = createTypertRemoteInfo({
|
|
|
114
136
|
description: 'the accepted message\'s inbox identity.',
|
|
115
137
|
jsonSchema: {"type":"object","properties":{"messageId":{"type":"string"}},"required":["messageId"],"additionalProperties":true},
|
|
116
138
|
},
|
|
117
|
-
sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":
|
|
139
|
+
sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":491,"column":9},
|
|
140
|
+
},
|
|
141
|
+
'subagents/selectModelByUser': {
|
|
142
|
+
service: 'subagents',
|
|
143
|
+
description: 'Select a local child\'s model under the caller\'s target-Session permission. Like Session model selection, it accepts only a model its provider lists in the current catalog. No message or global default is changed. A successful receipt confirms the child\'s persistence barrier; an unconfirmed failure may follow a live change.',
|
|
144
|
+
invocation: { kind: 'direct' },
|
|
145
|
+
parameters: [
|
|
146
|
+
{
|
|
147
|
+
name: 'request',
|
|
148
|
+
description: 'target and complete model choice; omitted effort uses adapter defaults.',
|
|
149
|
+
source: 'json',
|
|
150
|
+
codec: {
|
|
151
|
+
mode: 'strict',
|
|
152
|
+
typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentSelectModelRequest',
|
|
153
|
+
create: _deepseek_ai_dsh_subagent_subagents_selectModelByUser_parameter_0$schema,
|
|
154
|
+
jsonSchema: {"type":"object","properties":{"childSessionId":{"type":"string"},"provider":{"type":"string"},"model":{"type":"string"},"reasoningEffort":{"type":"string","description":"Omission clears an explicit effort and uses the selected model's default."}},"required":["childSessionId","provider","model"],"additionalProperties":true},
|
|
155
|
+
},
|
|
156
|
+
strictCodec: {
|
|
157
|
+
mode: 'strict',
|
|
158
|
+
typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentSelectModelRequest',
|
|
159
|
+
create: _deepseek_ai_dsh_subagent_subagents_selectModelByUser_parameter_0_strict$schema,
|
|
160
|
+
jsonSchema: {"type":"object","properties":{"childSessionId":{"type":"string"},"provider":{"type":"string"},"model":{"type":"string"},"reasoningEffort":{"type":"string","description":"Omission clears an explicit effort and uses the selected model's default."}},"required":["childSessionId","provider","model"],"additionalProperties":false},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
cancellation: { parameter: 'signal' },
|
|
165
|
+
result: {
|
|
166
|
+
mode: 'strict',
|
|
167
|
+
typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentSelectModelReceipt',
|
|
168
|
+
create: _deepseek_ai_dsh_subagent_subagents_selectModelByUser_result$schema,
|
|
169
|
+
description: 'the recorded choice after confirmed persistence.',
|
|
170
|
+
jsonSchema: {"type":"object","properties":{"selected":{"type":"object","properties":{"provider":{"type":"string","description":"Registered provider route."},"model":{"type":"string","description":"Provider-owned model id."},"reasoningEffort":{"type":"string","description":"Adapter-owned reasoning effort, or provider/default behavior when absent."}},"required":["provider","model"],"additionalProperties":true}},"required":["selected"],"additionalProperties":true},
|
|
171
|
+
},
|
|
172
|
+
sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":566,"column":9},
|
|
118
173
|
},
|
|
119
174
|
},
|
|
120
175
|
}, z)
|
|
@@ -212,6 +267,13 @@ export const TYPERT = {
|
|
|
212
267
|
"summary": "Interrupt one live child's current execution under a trusted user operation or an exact live ancestor Agent.",
|
|
213
268
|
"jsDoc": "/**\n * Interrupt one live child's current execution under a trusted user\n * operation 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 Agent is idle, a waking send resumes the parked FIFO\n * queue. External backends stop their single execution. An absent target\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 - a trusted user operation or exact live ancestor Agent.\n * @throws {SubagentError} `UNAUTHORIZED` when the authority does not own the\n * live target.\n */"
|
|
214
269
|
},
|
|
270
|
+
{
|
|
271
|
+
"kind": "method",
|
|
272
|
+
"name": "selectModel",
|
|
273
|
+
"signature": "async selectModel( childId: SessionId, selection: Readonly<ModelSelection>, authority: SubagentInterruptAuthority, signal: AbortSignal, ): Promise<ModelSelection>",
|
|
274
|
+
"summary": "Record a local child's complete model choice for future steps without adding a message or changing user defaults.",
|
|
275
|
+
"jsDoc": "/**\n * Record a local child's complete model choice for future steps without\n * adding a message or changing user defaults. Selection and image admission\n * share the child's operation order; an already prepared step retains its model.\n * @param childId - durable continuable child Session id.\n * @param selection - complete choice; omitted effort follows adapter defaults.\n * @param authority - trusted user operation or exact live creation ancestor.\n * @param signal - cancellation before selection is recorded.\n * @returns the recorded choice after its durability barrier completes.\n * @throws {LlmError} when the LLM runtime rejects the selected route or effort.\n * @throws {SubagentError} when access or child availability fails;\n * PERSISTENCE_UNCONFIRMED means the choice may have changed but durability is unknown.\n */"
|
|
276
|
+
},
|
|
215
277
|
{
|
|
216
278
|
"kind": "method",
|
|
217
279
|
"name": "drainDescendants",
|
|
@@ -240,6 +302,13 @@ export const TYPERT = {
|
|
|
240
302
|
"summary": "Remote face of {@link interrupt}, authorized on the target Session by the Gateway.",
|
|
241
303
|
"jsDoc": "/**\n * Remote face of {@link interrupt}, authorized on the target Session by the Gateway.\n * No catalog, history, persistence, or parent Agent lookup runs.\n * Absent, idle, and already-completed targets are accepted no-ops there.\n * @param childSessionId - durable child session id to interrupt.\n * @returns acknowledgement that the cancel signal was admitted, not that the target is quiescent.\n * @throws {RemoteError} `gateway/bad-request` for an empty id,\n * otherwise `gateway/internal`.\n */"
|
|
242
304
|
},
|
|
305
|
+
{
|
|
306
|
+
"kind": "method",
|
|
307
|
+
"name": "selectModelByUser",
|
|
308
|
+
"signature": "@Remote({ name: 'selectModelByUser', resources: { session: request => request.childSessionId } }) async selectModelByUser(request: SubagentSelectModelRequest, signal: AbortSignal): Promise<SubagentSelectModelReceipt>",
|
|
309
|
+
"summary": "Select a local child's model under the caller's target-Session permission.",
|
|
310
|
+
"jsDoc": "/**\n * Select a local child's model under the caller's target-Session permission.\n * Like Session model selection, it accepts only a model its provider lists in the\n * current catalog. No message or global default is changed. A successful receipt\n * confirms the child's persistence barrier; an unconfirmed failure may follow a live change.\n * @param request - target and complete model choice; omitted effort uses adapter defaults.\n * @param signal - caller cancellation before selection is recorded.\n * @returns the recorded choice after confirmed persistence.\n * @throws {RemoteError} validation, authorization, availability, cancellation,\n * or subagent/model-selection-unconfirmed when the durable outcome is unknown.\n */"
|
|
311
|
+
},
|
|
243
312
|
{
|
|
244
313
|
"kind": "method",
|
|
245
314
|
"name": "registerProvider",
|
|
@@ -626,7 +695,7 @@ export const TYPERT = {
|
|
|
626
695
|
},
|
|
627
696
|
{
|
|
628
697
|
"name": "MessageSourceMap",
|
|
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 '
|
|
698
|
+
"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 'user-approval': { kind: 'user-approval'; } & ContextFormed;\n 'tool-registry': { kind: 'tool-registry'; };\n 'runtime-context': { kind: 'runtime-context'; } & ContextFormed;\n 'team-message': TeamMessageSource;\n 'todo-reminder': { kind: 'todo-reminder'; } & 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 'plugin-reference': PluginReferenceSource;\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 im: { kind: 'im'; } & ContextFormed;\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}"
|
|
630
699
|
},
|
|
631
700
|
{
|
|
632
701
|
"name": "Model",
|
|
@@ -656,6 +725,10 @@ export const TYPERT = {
|
|
|
656
725
|
"name": "OptionalSessionSeq",
|
|
657
726
|
"declaration": "export type OptionalSessionSeq = SessionSeq | null;"
|
|
658
727
|
},
|
|
728
|
+
{
|
|
729
|
+
"name": "PluginReferenceSource",
|
|
730
|
+
"declaration": "export interface PluginReferenceSource {\n readonly kind: 'plugin-reference';\n readonly form: 'recall';\n readonly version: 1;\n readonly packages: readonly { readonly packageName: string; readonly label: string; }[];\n}"
|
|
731
|
+
},
|
|
659
732
|
{
|
|
660
733
|
"name": "Principal",
|
|
661
734
|
"declaration": "export type Principal = PrincipalMap[keyof PrincipalMap];"
|
|
@@ -746,7 +819,7 @@ export const TYPERT = {
|
|
|
746
819
|
},
|
|
747
820
|
{
|
|
748
821
|
"name": "SessionEventMap",
|
|
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 '
|
|
822
|
+
"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 '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 '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 '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}"
|
|
750
823
|
},
|
|
751
824
|
{
|
|
752
825
|
"name": "SessionEventType",
|
|
@@ -754,7 +827,7 @@ export const TYPERT = {
|
|
|
754
827
|
},
|
|
755
828
|
{
|
|
756
829
|
"name": "SessionHeader",
|
|
757
|
-
"declaration": "export interface SessionHeader {\n readonly version: typeof SESSION_FORMAT_VERSION;\n readonly id: SessionId;\n readonly createdAt: number;\n readonly cwd?: string;\n readonly parentSession?: SessionId;\n readonly isSeeded: boolean;\n readonly origin?:
|
|
830
|
+
"declaration": "export interface SessionHeader {\n readonly version: typeof SESSION_FORMAT_VERSION;\n readonly id: SessionId;\n readonly createdAt: number;\n readonly cwd?: string;\n readonly parentSession?: SessionId;\n readonly isSeeded: boolean;\n readonly origin?: SessionOrigin;\n readonly delegationDepth?: number;\n readonly agentPreset?: string;\n}"
|
|
758
831
|
},
|
|
759
832
|
{
|
|
760
833
|
"name": "SessionId",
|
|
@@ -764,6 +837,10 @@ export const TYPERT = {
|
|
|
764
837
|
"name": "SessionLogOffset",
|
|
765
838
|
"declaration": "export type SessionLogOffset = BrandedNumber<'SessionLogOffset'>;"
|
|
766
839
|
},
|
|
840
|
+
{
|
|
841
|
+
"name": "SessionOrigin",
|
|
842
|
+
"declaration": "export type SessionOrigin = 'subagent' | 'side';"
|
|
843
|
+
},
|
|
767
844
|
{
|
|
768
845
|
"name": "SessionReferenceSource",
|
|
769
846
|
"declaration": "export interface SessionReferenceSource {\n kind: 'session-reference';\n form: 'recall';\n version: 1;\n references: { sessionId: string; label: string; capturedFormatVersion?: number; capturedThroughSeq: OptionalSessionSeq; compacted: boolean; originalMessages: number; retainedMessages: number; omittedMessages: number; omittedBytes: number; truncated: boolean; inputIndex: number; }[];\n}"
|
|
@@ -888,6 +965,14 @@ export const TYPERT = {
|
|
|
888
965
|
"name": "SubagentRun",
|
|
889
966
|
"declaration": "export interface SubagentRun {\n readonly id: SessionId;\n readonly result: Promise<SubagentResult>;\n dispose(): Promise<void>;\n}"
|
|
890
967
|
},
|
|
968
|
+
{
|
|
969
|
+
"name": "SubagentSelectModelReceipt",
|
|
970
|
+
"declaration": "export interface SubagentSelectModelReceipt {\n readonly selected: ModelSelection;\n}"
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
"name": "SubagentSelectModelRequest",
|
|
974
|
+
"declaration": "export interface SubagentSelectModelRequest {\n readonly childSessionId: SessionId;\n readonly provider: string;\n readonly model: string;\n readonly reasoningEffort?: string;\n}"
|
|
975
|
+
},
|
|
891
976
|
{
|
|
892
977
|
"name": "SubagentSendMessageOptions",
|
|
893
978
|
"declaration": "export interface SubagentSendMessageOptions {\n readonly signal: AbortSignal;\n}"
|
|
@@ -5,16 +5,18 @@ import type {
|
|
|
5
5
|
TypertRemoteMethod,
|
|
6
6
|
} from '@deepseek-ai/dsh-typert-protocol'
|
|
7
7
|
import type { SessionId } from '@deepseek-ai/dsh-session/types'
|
|
8
|
-
import type { SubagentInterruptReceipt, SubagentPromptReceipt, SubagentPromptRequest } from '@deepseek-ai/dsh-subagent/client'
|
|
8
|
+
import type { SubagentInterruptReceipt, SubagentPromptReceipt, SubagentPromptRequest, SubagentSelectModelReceipt, SubagentSelectModelRequest } from '@deepseek-ai/dsh-subagent/client'
|
|
9
9
|
|
|
10
10
|
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
11
11
|
interface TypertRemoteNamespace$7375626167656e7473 {
|
|
12
12
|
interruptByUser: (childSessionId: SessionId) => Promise<RemoteResult<SubagentInterruptReceipt>>
|
|
13
13
|
prompt: (request: SubagentPromptRequest, signal?: AbortSignal) => Promise<RemoteResult<SubagentPromptReceipt>>
|
|
14
|
+
selectModelByUser: (request: SubagentSelectModelRequest, signal?: AbortSignal) => Promise<RemoteResult<SubagentSelectModelReceipt>>
|
|
14
15
|
}
|
|
15
16
|
interface TypertRemoteMap {
|
|
16
17
|
'subagents/interruptByUser': (childSessionId: SessionId) => Promise<RemoteResult<SubagentInterruptReceipt>>
|
|
17
18
|
'subagents/prompt': (request: SubagentPromptRequest, signal?: AbortSignal) => Promise<RemoteResult<SubagentPromptReceipt>>
|
|
19
|
+
'subagents/selectModelByUser': (request: SubagentSelectModelRequest, signal?: AbortSignal) => Promise<RemoteResult<SubagentSelectModelReceipt>>
|
|
18
20
|
}
|
|
19
21
|
interface TypertRemoteNamespaceMap {
|
|
20
22
|
'subagents': TypertRemoteNamespace$7375626167656e7473
|
|
@@ -24,6 +26,7 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
|
24
26
|
export declare const TYPERT_REMOTE: TypertRemoteInfo<{
|
|
25
27
|
readonly 'subagents/interruptByUser': TypertRemoteMethod<{ readonly 'childSessionId': SessionId }, SubagentInterruptReceipt>
|
|
26
28
|
readonly 'subagents/prompt': TypertRemoteMethod<{ readonly 'request': SubagentPromptRequest }, SubagentPromptReceipt>
|
|
29
|
+
readonly 'subagents/selectModelByUser': TypertRemoteMethod<{ readonly 'request': SubagentSelectModelRequest }, SubagentSelectModelReceipt>
|
|
27
30
|
}>
|
|
28
31
|
export default TYPERT_REMOTE
|
|
29
32
|
//# sourceMappingURL=typert.remote-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typert.remote-client.d.ts","names":["interruptByUser","prompt"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"typert.remote-client.d.ts","names":["interruptByUser","prompt","selectModelByUser"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;IA+hBEA,e;IArDMC,M;IA2EAC,iB;;;IAtBNF,2B;IArDMC,kB;IA2EAC,6B","ignoreList":[]}
|
|
@@ -29,6 +29,21 @@ let _deepseek_ai_dsh_subagent_subagents_prompt_result$schema$value
|
|
|
29
29
|
const _deepseek_ai_dsh_subagent_subagents_prompt_result$schema = () => (_deepseek_ai_dsh_subagent_subagents_prompt_result$schema$value ??= z.object({
|
|
30
30
|
'messageId': z.string().readonly(),
|
|
31
31
|
}))
|
|
32
|
+
let _deepseek_ai_dsh_subagent_subagents_selectModelByUser_parameter_0$schema$value
|
|
33
|
+
const _deepseek_ai_dsh_subagent_subagents_selectModelByUser_parameter_0$schema = () => (_deepseek_ai_dsh_subagent_subagents_selectModelByUser_parameter_0$schema$value ??= z.object({
|
|
34
|
+
'childSessionId': z.string().readonly(),
|
|
35
|
+
'provider': z.string().readonly(),
|
|
36
|
+
'model': z.string().readonly(),
|
|
37
|
+
'reasoningEffort': z.string().readonly().optional().describe('Omission clears an explicit effort and uses the selected model\'s default.'),
|
|
38
|
+
}))
|
|
39
|
+
let _deepseek_ai_dsh_subagent_subagents_selectModelByUser_result$schema$value
|
|
40
|
+
const _deepseek_ai_dsh_subagent_subagents_selectModelByUser_result$schema = () => (_deepseek_ai_dsh_subagent_subagents_selectModelByUser_result$schema$value ??= z.object({
|
|
41
|
+
'selected': z.object({
|
|
42
|
+
'provider': z.string().describe('Registered provider route.'),
|
|
43
|
+
'model': z.string().describe('Provider-owned model id.'),
|
|
44
|
+
'reasoningEffort': z.string().optional().describe('Adapter-owned reasoning effort, or provider/default behavior when absent.'),
|
|
45
|
+
}).readonly(),
|
|
46
|
+
}))
|
|
32
47
|
let _deepseek_ai_dsh_subagent_subagents_interruptByUser_parameter_0_strict$schema$value
|
|
33
48
|
const _deepseek_ai_dsh_subagent_subagents_interruptByUser_parameter_0_strict$schema = () => (_deepseek_ai_dsh_subagent_subagents_interruptByUser_parameter_0_strict$schema$value ??= z.string())
|
|
34
49
|
let _deepseek_ai_dsh_subagent_subagents_prompt_parameter_0_strict$schema$value
|
|
@@ -47,6 +62,13 @@ const _deepseek_ai_dsh_subagent_subagents_prompt_parameter_0_strict$schema = ()
|
|
|
47
62
|
})])).readonly().describe('Browser prompt parts delivered as the child\'s user message. The Host admits and persists image parts before delivery, so the wire never carries a durable attachment reference the caller could fabricate.'),
|
|
48
63
|
'clientTimeZone': z.string().readonly().optional().describe('Optional browser zone sampled for this exact human prompt.'),
|
|
49
64
|
}))
|
|
65
|
+
let _deepseek_ai_dsh_subagent_subagents_selectModelByUser_parameter_0_strict$schema$value
|
|
66
|
+
const _deepseek_ai_dsh_subagent_subagents_selectModelByUser_parameter_0_strict$schema = () => (_deepseek_ai_dsh_subagent_subagents_selectModelByUser_parameter_0_strict$schema$value ??= z.strictObject({
|
|
67
|
+
'childSessionId': z.string().readonly(),
|
|
68
|
+
'provider': z.string().readonly(),
|
|
69
|
+
'model': z.string().readonly(),
|
|
70
|
+
'reasoningEffort': z.string().readonly().optional().describe('Omission clears an explicit effort and uses the selected model\'s default.'),
|
|
71
|
+
}))
|
|
50
72
|
|
|
51
73
|
export const TYPERT_REMOTE = createTypertRemoteInfo({
|
|
52
74
|
package: '@deepseek-ai/dsh-subagent',
|
|
@@ -81,7 +103,7 @@ export const TYPERT_REMOTE = createTypertRemoteInfo({
|
|
|
81
103
|
description: 'acknowledgement that the cancel signal was admitted, not that the target is quiescent.',
|
|
82
104
|
jsonSchema: {"type":"object","properties":{"accepted":{"type":"boolean","const":true}},"required":["accepted"],"additionalProperties":true},
|
|
83
105
|
},
|
|
84
|
-
sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":
|
|
106
|
+
sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":544,"column":3},
|
|
85
107
|
},
|
|
86
108
|
'subagents/prompt': {
|
|
87
109
|
service: 'subagents',
|
|
@@ -114,7 +136,40 @@ export const TYPERT_REMOTE = createTypertRemoteInfo({
|
|
|
114
136
|
description: 'the accepted message\'s inbox identity.',
|
|
115
137
|
jsonSchema: {"type":"object","properties":{"messageId":{"type":"string"}},"required":["messageId"],"additionalProperties":true},
|
|
116
138
|
},
|
|
117
|
-
sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":
|
|
139
|
+
sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":491,"column":9},
|
|
140
|
+
},
|
|
141
|
+
'subagents/selectModelByUser': {
|
|
142
|
+
service: 'subagents',
|
|
143
|
+
description: 'Select a local child\'s model under the caller\'s target-Session permission. Like Session model selection, it accepts only a model its provider lists in the current catalog. No message or global default is changed. A successful receipt confirms the child\'s persistence barrier; an unconfirmed failure may follow a live change.',
|
|
144
|
+
invocation: { kind: 'direct' },
|
|
145
|
+
parameters: [
|
|
146
|
+
{
|
|
147
|
+
name: 'request',
|
|
148
|
+
description: 'target and complete model choice; omitted effort uses adapter defaults.',
|
|
149
|
+
source: 'json',
|
|
150
|
+
codec: {
|
|
151
|
+
mode: 'strict',
|
|
152
|
+
typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentSelectModelRequest',
|
|
153
|
+
create: _deepseek_ai_dsh_subagent_subagents_selectModelByUser_parameter_0$schema,
|
|
154
|
+
jsonSchema: {"type":"object","properties":{"childSessionId":{"type":"string"},"provider":{"type":"string"},"model":{"type":"string"},"reasoningEffort":{"type":"string","description":"Omission clears an explicit effort and uses the selected model's default."}},"required":["childSessionId","provider","model"],"additionalProperties":true},
|
|
155
|
+
},
|
|
156
|
+
strictCodec: {
|
|
157
|
+
mode: 'strict',
|
|
158
|
+
typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentSelectModelRequest',
|
|
159
|
+
create: _deepseek_ai_dsh_subagent_subagents_selectModelByUser_parameter_0_strict$schema,
|
|
160
|
+
jsonSchema: {"type":"object","properties":{"childSessionId":{"type":"string"},"provider":{"type":"string"},"model":{"type":"string"},"reasoningEffort":{"type":"string","description":"Omission clears an explicit effort and uses the selected model's default."}},"required":["childSessionId","provider","model"],"additionalProperties":false},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
cancellation: { parameter: 'signal' },
|
|
165
|
+
result: {
|
|
166
|
+
mode: 'strict',
|
|
167
|
+
typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentSelectModelReceipt',
|
|
168
|
+
create: _deepseek_ai_dsh_subagent_subagents_selectModelByUser_result$schema,
|
|
169
|
+
description: 'the recorded choice after confirmed persistence.',
|
|
170
|
+
jsonSchema: {"type":"object","properties":{"selected":{"type":"object","properties":{"provider":{"type":"string","description":"Registered provider route."},"model":{"type":"string","description":"Provider-owned model id."},"reasoningEffort":{"type":"string","description":"Adapter-owned reasoning effort, or provider/default behavior when absent."}},"required":["provider","model"],"additionalProperties":true}},"required":["selected"],"additionalProperties":true},
|
|
171
|
+
},
|
|
172
|
+
sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":566,"column":9},
|
|
118
173
|
},
|
|
119
174
|
},
|
|
120
175
|
}, z)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
/** Execution-period records, capacity slots, child serialization, and local
|
|
1
|
+
/** Execution-period records, capacity slots, child serialization, and local result capture.
|
|
2
2
|
* @module @deepseek-ai/dsh-subagent/activation
|
|
3
3
|
*/
|
|
4
|
-
import type { Agent, AgentHandle } from '@deepseek-ai/dsh-agent';
|
|
5
|
-
import type { SessionId, SessionLogOffset } from '@deepseek-ai/dsh-session';
|
|
4
|
+
import type { Agent, AgentHandle, ConsumedWorkFoldState } from '@deepseek-ai/dsh-agent';
|
|
5
|
+
import type { SessionEvent, SessionId, SessionLogOffset } from '@deepseek-ai/dsh-session';
|
|
6
|
+
import type { AssistantOutputFold } from './assistant-output.ts';
|
|
6
7
|
import type { StructuredAttachment } from './structured.ts';
|
|
7
8
|
import type { SubagentResult, SubagentRun, SubagentRunId } from './types.ts';
|
|
8
9
|
/** Process-local capacity shared by every member of a subagent tree. */
|
|
@@ -46,12 +47,28 @@ interface ActivationBase {
|
|
|
46
47
|
* settlement notice, even if this epoch's start event was already published.
|
|
47
48
|
*/
|
|
48
49
|
accepted: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Whether this local epoch was restored only to record durable child state.
|
|
52
|
+
* It holds no capacity slot, publishes no lifecycle events, admits no input,
|
|
53
|
+
* and closes before its child lock is released.
|
|
54
|
+
*/
|
|
55
|
+
readonly maintenance: boolean;
|
|
49
56
|
}
|
|
50
57
|
/** Resources retained only for the selected execution kind. */
|
|
51
58
|
export type ActivationResource = {
|
|
52
59
|
readonly kind: 'local';
|
|
53
60
|
readonly handle: AgentHandle;
|
|
54
|
-
|
|
61
|
+
/** Fold of every child event committed since this epoch began. */
|
|
62
|
+
readonly output: AssistantOutputFold;
|
|
63
|
+
/** {@link foldConsumedWorkForEvent} state over the same events; `undefined` before the first. */
|
|
64
|
+
work: ConsumedWorkFoldState | undefined;
|
|
65
|
+
/** The first error each fold threw; {@link captureLocalResult} rethrows it. */
|
|
66
|
+
outputFailure: {
|
|
67
|
+
error: unknown;
|
|
68
|
+
} | undefined;
|
|
69
|
+
workFailure: {
|
|
70
|
+
error: unknown;
|
|
71
|
+
} | undefined;
|
|
55
72
|
readonly structured: StructuredAttachment | undefined;
|
|
56
73
|
/** Latest live failure not superseded by a later committed turn ending. */
|
|
57
74
|
failureAt: SessionLogOffset | undefined;
|
|
@@ -93,10 +110,20 @@ export declare function requireLocalActivation(activation: Activation): LocalAct
|
|
|
93
110
|
* @param wake - notify its settlement watcher when failure changes readiness.
|
|
94
111
|
*/
|
|
95
112
|
export declare function observeLocalFailure(activation: LocalActivation, wake: () => void): void;
|
|
113
|
+
/**
|
|
114
|
+
* Fold one committed child event into the result its epoch settles with.
|
|
115
|
+
* `session/event` dispatch discards a listener exception, so each fold keeps
|
|
116
|
+
* its first one and stops; {@link captureLocalResult} rethrows it.
|
|
117
|
+
* @param activation - the resident local execution that owns the child.
|
|
118
|
+
* @param event - the child Session event just committed.
|
|
119
|
+
*/
|
|
120
|
+
export declare function foldLocalResult(activation: LocalActivation, event: SessionEvent): void;
|
|
96
121
|
/**
|
|
97
122
|
* Capture local output and retain failures without a later committed turn ending.
|
|
98
123
|
* @param activation - the settled local execution and any structured result.
|
|
99
124
|
* @returns final output, stop reason, and committed structured value.
|
|
125
|
+
* @throws the first error a fold of this epoch's events threw; the stop-reason
|
|
126
|
+
* fold is not consulted after a retained live failure.
|
|
100
127
|
*/
|
|
101
128
|
export declare function captureLocalResult(activation: LocalActivation): SubagentResult;
|
|
102
129
|
/** Serialize each durable child's delivery, release, and disposal. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activation.d.ts","sourceRoot":"","sources":["../../src/activation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"activation.d.ts","sourceRoot":"","sources":["../../src/activation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAEvF,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAEzF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAGhE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE5E,wEAAwE;AACxE,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoB;IAE1C,kEAAkE;IAClE,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;;;OAIG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,IAAI;CAYtC;AAED;;;GAGG;AACH,UAAU,cAAc;IACtB,uEAAuE;IACvE,QAAQ,CAAC,WAAW,EAAE,MAAM,IAAI,CAAA;IAChC,wDAAwD;IACxD,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAA;IAC3B,6EAA6E;IAC7E,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;IAC7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AAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAA;IACzB,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAA;CACrC,CAAA;AAEH,yEAAyE;AACzE,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,kBAAkB,CAAA;AAE5D,8EAA8E;AAC9E,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAA;AAEpE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,KAAK,GAAG,SAAS,CAEzE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,eAAe,CAQ9E;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,IAAI,GAAG,IAAI,CAavF;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,eAAe,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,CAetF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,eAAe,GAAG,cAAc,CAY9E;AAED,sEAAsE;AACtE,qBAAa,SAAS;IACpB,OAAO,CAAC,KAAK,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"}
|
package/lib/types/activation.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/** Execution-period records, capacity slots, child serialization, and local
|
|
1
|
+
/** Execution-period records, capacity slots, child serialization, and local result capture.
|
|
2
2
|
* @module @deepseek-ai/dsh-subagent/activation
|
|
3
3
|
*/
|
|
4
|
+
import { foldConsumedWorkForEvent } from '@deepseek-ai/dsh-agent';
|
|
4
5
|
import { assertNever } from '@deepseek-ai/dsh-util-values';
|
|
5
|
-
import { finalAssistantOutput } from "./assistant-output.js";
|
|
6
6
|
import { epochStopReason } from "./lifecycle.js";
|
|
7
7
|
import { SubagentError } from "./error.js";
|
|
8
8
|
/** Process-local capacity shared by every member of a subagent tree. */
|
|
@@ -70,16 +70,45 @@ export function observeLocalFailure(activation, wake) {
|
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Fold one committed child event into the result its epoch settles with.
|
|
75
|
+
* `session/event` dispatch discards a listener exception, so each fold keeps
|
|
76
|
+
* its first one and stops; {@link captureLocalResult} rethrows it.
|
|
77
|
+
* @param activation - the resident local execution that owns the child.
|
|
78
|
+
* @param event - the child Session event just committed.
|
|
79
|
+
*/
|
|
80
|
+
export function foldLocalResult(activation, event) {
|
|
81
|
+
if (activation.outputFailure === undefined) {
|
|
82
|
+
try {
|
|
83
|
+
activation.output.push(event);
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
activation.outputFailure = { error };
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (activation.workFailure === undefined) {
|
|
90
|
+
try {
|
|
91
|
+
activation.work = foldConsumedWorkForEvent(activation.work, event);
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
activation.workFailure = { error };
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
73
98
|
/**
|
|
74
99
|
* Capture local output and retain failures without a later committed turn ending.
|
|
75
100
|
* @param activation - the settled local execution and any structured result.
|
|
76
101
|
* @returns final output, stop reason, and committed structured value.
|
|
102
|
+
* @throws the first error a fold of this epoch's events threw; the stop-reason
|
|
103
|
+
* fold is not consulted after a retained live failure.
|
|
77
104
|
*/
|
|
78
105
|
export function captureLocalResult(activation) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
106
|
+
if (activation.outputFailure !== undefined)
|
|
107
|
+
throw activation.outputFailure.error;
|
|
108
|
+
if (activation.failureAt === undefined && activation.workFailure !== undefined)
|
|
109
|
+
throw activation.workFailure.error;
|
|
110
|
+
const output = activation.output.collect() ?? [];
|
|
111
|
+
const stopReason = activation.failureAt === undefined ? epochStopReason(activation.work ?? { droppedUnrun: false }) : 'error';
|
|
83
112
|
const structured = activation.structured;
|
|
84
113
|
if (structured !== undefined) {
|
|
85
114
|
const captured = structured.captured();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activation.js","sourceRoot":"","sources":["../../src/activation.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"activation.js","sourceRoot":"","sources":["../../src/activation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAE1D,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,kEAAkE;IAClE,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAA;IACxB,CAAC;IAED;;;;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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22,13 +22,15 @@ export declare class AssistantOutputFold {
|
|
|
22
22
|
private partial;
|
|
23
23
|
/**
|
|
24
24
|
* Fold one session event: a non-empty assistant message becomes the
|
|
25
|
-
* candidate final answer
|
|
26
|
-
*
|
|
25
|
+
* candidate final answer and discards the streamed fallback. Before one
|
|
26
|
+
* exists, the stream of an empty message or of a log-only attempt extends
|
|
27
|
+
* that fallback. Every other event contributes nothing.
|
|
27
28
|
* @param event - the next observed session event.
|
|
28
29
|
*/
|
|
29
30
|
push(event: SessionEvent): void;
|
|
30
31
|
/**
|
|
31
32
|
* Extend the streamed fallback with text observed outside session events.
|
|
33
|
+
* The fallback is discarded once a non-empty message exists.
|
|
32
34
|
* @param text - the next streamed text piece (an empty piece is a no-op).
|
|
33
35
|
*/
|
|
34
36
|
pushText(text: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assistant-output.d.ts","sourceRoot":"","sources":["../../src/assistant-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAA2B,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE5D;;;;;GAKG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,OAAO,CAAqC;IACpD,OAAO,CAAC,OAAO,CAAe;IAE9B
|
|
1
|
+
{"version":3,"file":"assistant-output.d.ts","sourceRoot":"","sources":["../../src/assistant-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAA2B,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE5D;;;;;GAKG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,OAAO,CAAqC;IACpD,OAAO,CAAC,OAAO,CAAe;IAE9B;;;;;;OAMG;IACH,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAa/B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI5B;;;;OAIG;IACH,OAAO,IAAI,SAAS,YAAY,EAAE,GAAG,SAAS;CAK/C;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,YAAY,EAAE,GAAG,SAAS,CAIzG"}
|
|
@@ -21,15 +21,18 @@ export class AssistantOutputFold {
|
|
|
21
21
|
partial = [];
|
|
22
22
|
/**
|
|
23
23
|
* Fold one session event: a non-empty assistant message becomes the
|
|
24
|
-
* candidate final answer
|
|
25
|
-
*
|
|
24
|
+
* candidate final answer and discards the streamed fallback. Before one
|
|
25
|
+
* exists, the stream of an empty message or of a log-only attempt extends
|
|
26
|
+
* that fallback. Every other event contributes nothing.
|
|
26
27
|
* @param event - the next observed session event.
|
|
27
28
|
*/
|
|
28
29
|
push(event) {
|
|
29
30
|
if (event.type === 'assistant/message') {
|
|
30
31
|
const content = event.data.message.content;
|
|
31
|
-
if (content.length > 0)
|
|
32
|
+
if (content.length > 0) {
|
|
32
33
|
this.message = content;
|
|
34
|
+
this.partial = [];
|
|
35
|
+
}
|
|
33
36
|
}
|
|
34
37
|
if (event.type === 'assistant/message' || event.type === 'assistant/attempt') {
|
|
35
38
|
this.pushText(joinAssistantStreamText(event.data.stream));
|
|
@@ -37,10 +40,11 @@ export class AssistantOutputFold {
|
|
|
37
40
|
}
|
|
38
41
|
/**
|
|
39
42
|
* Extend the streamed fallback with text observed outside session events.
|
|
43
|
+
* The fallback is discarded once a non-empty message exists.
|
|
40
44
|
* @param text - the next streamed text piece (an empty piece is a no-op).
|
|
41
45
|
*/
|
|
42
46
|
pushText(text) {
|
|
43
|
-
if (text.length > 0)
|
|
47
|
+
if (this.message === undefined && text.length > 0)
|
|
44
48
|
this.partial.push(text);
|
|
45
49
|
}
|
|
46
50
|
/**
|
|
@@ -61,10 +65,6 @@ export class AssistantOutputFold {
|
|
|
61
65
|
* @returns the selected output, or `undefined` when the child produced none.
|
|
62
66
|
*/
|
|
63
67
|
export function finalAssistantOutput(events) {
|
|
64
|
-
// TODO: this folds the complete suffix once per run/epoch settlement. If a
|
|
65
|
-
// long continuable epoch ever profiles hot here, scan backward with early
|
|
66
|
-
// exit for the last non-empty message and fold text deltas only on the
|
|
67
|
-
// no-message fallback.
|
|
68
68
|
const fold = new AssistantOutputFold();
|
|
69
69
|
for (const event of events)
|
|
70
70
|
fold.push(event);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assistant-output.js","sourceRoot":"","sources":["../../src/assistant-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,uBAAuB,EAAqB,MAAM,sBAAsB,CAAA;AAGjF;;;;;GAKG;AACH,MAAM,OAAO,mBAAmB;IACtB,OAAO,CAAqC;IAC5C,OAAO,GAAa,EAAE,CAAA;IAE9B
|
|
1
|
+
{"version":3,"file":"assistant-output.js","sourceRoot":"","sources":["../../src/assistant-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,uBAAuB,EAAqB,MAAM,sBAAsB,CAAA;AAGjF;;;;;GAKG;AACH,MAAM,OAAO,mBAAmB;IACtB,OAAO,CAAqC;IAC5C,OAAO,GAAa,EAAE,CAAA;IAE9B;;;;;;OAMG;IACH,IAAI,CAAC,KAAmB;QACtB,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;YACvC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAA;YAC1C,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;gBACtB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;YACnB,CAAC;QACH,CAAC;QACD,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAmB,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;YAC7E,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;QAC3D,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,IAAY;QACnB,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;YAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5E,CAAC;IAED;;;;OAIG;IACH,OAAO;QACL,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC,OAAO,CAAA;QACnD,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAClC,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAC/D,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAA+B;IAClE,MAAM,IAAI,GAAG,IAAI,mBAAmB,EAAE,CAAA;IACtC,KAAK,MAAM,KAAK,IAAI,MAAM;QAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC5C,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;AACvB,CAAC"}
|
|
@@ -29,10 +29,9 @@ export declare class SubagentDepthError extends SubagentError {
|
|
|
29
29
|
*/
|
|
30
30
|
export declare function resolveChildDepth(parent: Agent, maxDepth: number | undefined): number;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* the configured output-token limit.
|
|
32
|
+
* Capture the parent's current model choice and configured output controls.
|
|
33
|
+
* A recorded choice applies even before the parent uses it in a request;
|
|
34
|
+
* adapter-defaulted effort remains unselected.
|
|
36
35
|
* @param parent - delegating parent Agent.
|
|
37
36
|
* @returns detached Agent options for child-option merging.
|
|
38
37
|
*/
|
|
@@ -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;AAe7D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE1C,qGAAqG;AACrG,qBAAa,kBAAmB,SAAQ,aAAa;aACvB,cAAc,EAAE,MAAM;aAAkB,QAAQ,EAAE,MAAM;gBAAxD,cAAc,EAAE,MAAM,EAAkB,QAAQ,EAAE,MAAM;CAIrF;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CASrF;AAED
|
|
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,O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