@deepseek-ai/dsh-api-session-controller 0.1.7-rc.2 → 0.2.0-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 CHANGED
@@ -6,8 +6,8 @@
6
6
  en: 82789442228fc62a
7
7
  zh: f1d511ad838187de
8
8
  /session-controller:
9
- en: fb78499ee63f41b9
10
- zh: 6fff916b1fa26314
9
+ en: c7a4c58ea6d3437b
10
+ zh: 45c2b472a074bb1b
11
11
  /session-controller/summary:
12
12
  en: 4914824c347fdab5
13
13
  zh: 684a7b7fa970c39f
package/README.md CHANGED
@@ -6,6 +6,8 @@ kind: "package-reference"
6
6
 
7
7
  English | [中文](README.zh.md)
8
8
 
9
+ Desktop analytics follows the [product collection policy](../../client/product-analytics/README.md), including its launch-time switch. Web usage is excluded.
10
+
9
11
  ## Summary
10
12
 
11
13
  `@deepseek-ai/dsh-api-session-controller` owns the Host `ctx.sessionController` service and the generated Client `session`, `skills`, and `fileReferences` Remote namespaces. It serves Session lifecycle and history, the Host-generation model catalog, human background-job kill, workspace-path opening, user-invocable skill discovery, and Agent-scoped file references. Use it through API Gateway when a Client needs operations addressed by a Session.
package/README.zh.md CHANGED
@@ -6,6 +6,8 @@ kind: "package-reference"
6
6
 
7
7
  [English](README.md) | 中文
8
8
 
9
+ 桌面埋点遵循[产品采集策略](../../client/product-analytics/README.zh.md)及其启动时开关,不包含 Web 使用情况。
10
+
9
11
  ## 概述
10
12
 
11
13
  `@deepseek-ai/dsh-api-session-controller` 拥有 Host 的 `ctx.sessionController` 服务,以及生成的 Client `session`、`skills` 和 `fileReferences` Remote namespace。它提供 Session 生命周期与历史、Host generation 模型目录、人工后台任务终止、工作区路径打开、用户可调用 skill(技能)发现和 Agent(智能体)范围的文件引用。当 Client 需要按 Session 寻址的操作时,请通过 API Gateway 使用它。
package/lib/client.js CHANGED
@@ -591,12 +591,12 @@ window.__ModuleLoader__.load({
591
591
  const rendered = JSON.stringify(value) ?? String(value);
592
592
  throw new Error(`unreachable variant${context ? ` in ${context}` : ""}: ${rendered}`);
593
593
  }
594
- /** Whether a realm-owned intrinsic prototype is backed by its native constructor. */
594
+ /** Whether a realm-owned intrinsic prototype has a native constructor matching this engine's representation. */
595
595
  function hasIntrinsicConstructor(prototype, name) {
596
596
  const constructor = Object.getOwnPropertyDescriptor(prototype, "constructor")?.value;
597
597
  if (typeof constructor !== "function") return false;
598
598
  try {
599
- return constructor.name === name && constructor.prototype === prototype && Function.prototype.toString.call(constructor) === `function ${name}() { [native code] }`;
599
+ return constructor.name === name && constructor.prototype === prototype && Function.prototype.toString.call(constructor) === Function.prototype.toString.call(name === "Array" ? Array : Object);
600
600
  } catch {
601
601
  return false;
602
602
  }
@@ -3349,6 +3349,7 @@ window.__ModuleLoader__.load({
3349
3349
  if (!result.ok) throw new SessionForkError(result.error, opts.sessionId);
3350
3350
  this.projectList();
3351
3351
  const childId = result.value.sessionId;
3352
+ opts.onCreated?.(childId);
3352
3353
  if (sourceTitle !== void 0) {
3353
3354
  const renamed = await this.manager.rename(childId, increasedForkTitle(sourceTitle));
3354
3355
  if (!renamed.ok) throw new Error(`fork child rename failed: ${renamed.error.code}: ${renamed.error.message}`);
@@ -147,6 +147,36 @@ const _deepseek_ai_dsh_api_session_controller_session_control_result$schema = ()
147
147
  'createdAt': z.number().readonly(),
148
148
  'updatedAt': z.number().readonly(),
149
149
  })]).optional(),
150
+ 'userQuestions': z.object({
151
+ 'active': z.array(z.object({
152
+ 'callId': z.intersection(z.string(), z.unknown()).readonly(),
153
+ 'questions': z.array(z.object({
154
+ 'id': z.string(),
155
+ 'question': z.string(),
156
+ 'detail': z.string().optional(),
157
+ 'header': z.string().optional(),
158
+ 'options': z.array(z.object({
159
+ 'label': z.string(),
160
+ 'description': z.string().optional(),
161
+ })).optional(),
162
+ 'multiSelect': z.boolean().optional(),
163
+ 'intent': z.object({
164
+ 'kind': z.literal("plan-review"),
165
+ 'approve': z.string(),
166
+ 'callId': z.intersection(z.string(), z.unknown()).optional(),
167
+ }).optional(),
168
+ })).readonly(),
169
+ 'state': z.union([z.literal("open"), z.literal("continued")]).readonly(),
170
+ })).readonly(),
171
+ 'settled': z.array(z.object({
172
+ 'callId': z.intersection(z.string(), z.unknown()).readonly(),
173
+ 'answers': z.array(z.object({
174
+ 'id': z.string(),
175
+ 'selected': z.array(z.string()),
176
+ 'custom': z.string().optional(),
177
+ })).readonly(),
178
+ })).readonly(),
179
+ }).optional(),
150
180
  }), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema5())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema5()))])).readonly()).readonly(),
151
181
  })).readonly().readonly(),
152
182
  }).readonly(),
@@ -319,6 +349,36 @@ const _deepseek_ai_dsh_api_session_controller_session_follow_result$schema = ()
319
349
  'createdAt': z.number().readonly(),
320
350
  'updatedAt': z.number().readonly(),
321
351
  })]).optional(),
352
+ 'userQuestions': z.object({
353
+ 'active': z.array(z.object({
354
+ 'callId': z.intersection(z.string(), z.unknown()).readonly(),
355
+ 'questions': z.array(z.object({
356
+ 'id': z.string(),
357
+ 'question': z.string(),
358
+ 'detail': z.string().optional(),
359
+ 'header': z.string().optional(),
360
+ 'options': z.array(z.object({
361
+ 'label': z.string(),
362
+ 'description': z.string().optional(),
363
+ })).optional(),
364
+ 'multiSelect': z.boolean().optional(),
365
+ 'intent': z.object({
366
+ 'kind': z.literal("plan-review"),
367
+ 'approve': z.string(),
368
+ 'callId': z.intersection(z.string(), z.unknown()).optional(),
369
+ }).optional(),
370
+ })).readonly(),
371
+ 'state': z.union([z.literal("open"), z.literal("continued")]).readonly(),
372
+ })).readonly(),
373
+ 'settled': z.array(z.object({
374
+ 'callId': z.intersection(z.string(), z.unknown()).readonly(),
375
+ 'answers': z.array(z.object({
376
+ 'id': z.string(),
377
+ 'selected': z.array(z.string()),
378
+ 'custom': z.string().optional(),
379
+ })).readonly(),
380
+ })).readonly(),
381
+ }).optional(),
322
382
  }), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3()))])).readonly()).readonly(),
323
383
  }).readonly(),
324
384
  'assistantStream': z.object({
@@ -481,6 +541,36 @@ const _deepseek_ai_dsh_api_session_controller_session_list_result$schema = () =>
481
541
  'createdAt': z.number().readonly(),
482
542
  'updatedAt': z.number().readonly(),
483
543
  })]).optional(),
544
+ 'userQuestions': z.object({
545
+ 'active': z.array(z.object({
546
+ 'callId': z.intersection(z.string(), z.unknown()).readonly(),
547
+ 'questions': z.array(z.object({
548
+ 'id': z.string(),
549
+ 'question': z.string(),
550
+ 'detail': z.string().optional(),
551
+ 'header': z.string().optional(),
552
+ 'options': z.array(z.object({
553
+ 'label': z.string(),
554
+ 'description': z.string().optional(),
555
+ })).optional(),
556
+ 'multiSelect': z.boolean().optional(),
557
+ 'intent': z.object({
558
+ 'kind': z.literal("plan-review"),
559
+ 'approve': z.string(),
560
+ 'callId': z.intersection(z.string(), z.unknown()).optional(),
561
+ }).optional(),
562
+ })).readonly(),
563
+ 'state': z.union([z.literal("open"), z.literal("continued")]).readonly(),
564
+ })).readonly(),
565
+ 'settled': z.array(z.object({
566
+ 'callId': z.intersection(z.string(), z.unknown()).readonly(),
567
+ 'answers': z.array(z.object({
568
+ 'id': z.string(),
569
+ 'selected': z.array(z.string()),
570
+ 'custom': z.string().optional(),
571
+ })).readonly(),
572
+ })).readonly(),
573
+ }).optional(),
484
574
  }), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema()))])).readonly()).readonly(),
485
575
  }).readonly().optional(),
486
576
  })).readonly(),
@@ -658,6 +748,36 @@ const _deepseek_ai_dsh_api_session_controller_session_projections_result$schema
658
748
  'createdAt': z.number().readonly(),
659
749
  'updatedAt': z.number().readonly(),
660
750
  })]).optional(),
751
+ 'userQuestions': z.object({
752
+ 'active': z.array(z.object({
753
+ 'callId': z.intersection(z.string(), z.unknown()).readonly(),
754
+ 'questions': z.array(z.object({
755
+ 'id': z.string(),
756
+ 'question': z.string(),
757
+ 'detail': z.string().optional(),
758
+ 'header': z.string().optional(),
759
+ 'options': z.array(z.object({
760
+ 'label': z.string(),
761
+ 'description': z.string().optional(),
762
+ })).optional(),
763
+ 'multiSelect': z.boolean().optional(),
764
+ 'intent': z.object({
765
+ 'kind': z.literal("plan-review"),
766
+ 'approve': z.string(),
767
+ 'callId': z.intersection(z.string(), z.unknown()).optional(),
768
+ }).optional(),
769
+ })).readonly(),
770
+ 'state': z.union([z.literal("open"), z.literal("continued")]).readonly(),
771
+ })).readonly(),
772
+ 'settled': z.array(z.object({
773
+ 'callId': z.intersection(z.string(), z.unknown()).readonly(),
774
+ 'answers': z.array(z.object({
775
+ 'id': z.string(),
776
+ 'selected': z.array(z.string()),
777
+ 'custom': z.string().optional(),
778
+ })).readonly(),
779
+ })).readonly(),
780
+ }).optional(),
661
781
  }), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema4())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema4()))])).readonly()).readonly(),
662
782
  })]))
663
783
  let _deepseek_ai_dsh_api_session_controller_session_prompt_parameter_0$schema$value
@@ -1496,6 +1616,22 @@ export const TYPERT = {
1496
1616
  "name": "ApprovalRequestId",
1497
1617
  "declaration": "export type ApprovalRequestId = Branded<'ApprovalRequestId'>;"
1498
1618
  },
1619
+ {
1620
+ "name": "AskUserQuestionAnswerItem",
1621
+ "declaration": "export interface AskUserQuestionAnswerItem {\n id: string;\n selected: string[];\n custom?: string;\n}"
1622
+ },
1623
+ {
1624
+ "name": "AskUserQuestionIntent",
1625
+ "declaration": "export type AskUserQuestionIntent = { kind: 'plan-review'; approve: string; callId?: ToolCallId; };"
1626
+ },
1627
+ {
1628
+ "name": "AskUserQuestionItem",
1629
+ "declaration": "export interface AskUserQuestionItem {\n id: string;\n question: string;\n detail?: string;\n header?: string;\n options?: AskUserQuestionOption[];\n multiSelect?: boolean;\n intent?: AskUserQuestionIntent;\n}"
1630
+ },
1631
+ {
1632
+ "name": "AskUserQuestionOption",
1633
+ "declaration": "export interface AskUserQuestionOption {\n label: string;\n description?: string;\n}"
1634
+ },
1499
1635
  {
1500
1636
  "name": "AssistantMessage",
1501
1637
  "declaration": "export interface AssistantMessage extends MessageBase {\n readonly role: 'assistant';\n readonly source: ModelMessageSource;\n}"
@@ -1774,7 +1910,7 @@ export const TYPERT = {
1774
1910
  },
1775
1911
  {
1776
1912
  "name": "MessageSourceMap",
1777
- "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}"
1913
+ "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 'user-question-reply': { kind: 'user-question-reply'; callId: ToolCallId; outcome: 'answered'; };\n}"
1778
1914
  },
1779
1915
  {
1780
1916
  "name": "ModelCatalog",
@@ -1832,6 +1968,10 @@ export const TYPERT = {
1832
1968
  "name": "OptionalSessionSeq",
1833
1969
  "declaration": "export type OptionalSessionSeq = SessionSeq | null;"
1834
1970
  },
1971
+ {
1972
+ "name": "PendingUserQuestion",
1973
+ "declaration": "export interface PendingUserQuestion {\n readonly callId: ToolCallId;\n readonly questions: readonly AskUserQuestionItem[];\n readonly state: UserQuestionState;\n}"
1974
+ },
1835
1975
  {
1836
1976
  "name": "PermissionSelection",
1837
1977
  "declaration": "export interface PermissionSelection {\n currentValue: string;\n}"
@@ -1874,7 +2014,7 @@ export const TYPERT = {
1874
2014
  },
1875
2015
  {
1876
2016
  "name": "RemoteErrorDetailsMap",
1877
- "declaration": "export interface RemoteErrorDetailsMap {\n 'gateway/bad-request': { readonly issues?: readonly object[]; };\n 'gateway/cancelled': {};\n 'gateway/internal': {};\n 'llm/model-discovery-rejected': { readonly settingsNs: string; readonly baseURL?: string; };\n 'session/not-found': { readonly sessionId: SessionId; };\n 'workspace/not-found': { readonly workspaceId: WorkspaceId; };\n 'agent-preset/not-found': { readonly agentPreset: string; readonly available: readonly string[]; };\n 'agent-preset/invalid': { readonly agentPreset: string; readonly reason: string; };\n 'agent-preset/locked': { readonly sessionId: SessionId; readonly agentPreset: string; };\n 'job/not-found': { readonly sessionId: SessionId; readonly jobId: JobId; };\n 'session/provider-credentials-unavailable': Record<string, never>;\n 'session/provider-models-unavailable': { readonly provider: string; };\n 'session/model-unavailable': { readonly provider: string; readonly model: string; };\n 'session/conflict': { readonly sessionId: SessionId; readonly requestedCwd: string; readonly existingCwd?: string; };\n 'session/projections-unavailable': Record<string, never>;\n 'session/writer-held': { readonly sessionId: SessionId; };\n 'session/agent-busy': { readonly reason: string; };\n 'session/invalid-time-zone': { readonly value: string; };\n 'session/workspace-attach-failed': { readonly sessionId: SessionId; readonly workspaceId: string; };\n 'agent-preset/conflict': { readonly sessionId: SessionId; readonly requestedPreset: string; readonly existingPreset?: string; };\n 'session/attachment-invalid': { readonly reason: string; };\n 'session/queue-item-not-found': { readonly itemId: MessageId; };\n 'session/steer-unavailable': { readonly itemId: MessageId; };\n 'session/title-invalid': { readonly sessionId: SessionId; };\n 'session/fork-unavailable': { readonly sessionId: SessionId; };\n 'subagent/not-found': { readonly parentSessionId: SessionId; readonly childSessionId: SessionId; };\n 'subagent/catalog-diagnostic': { readonly parentSessionId: SessionId; readonly childSessionId: SessionId; readonly reason: 'corrupt' | 'unsupported' | 'unavailable'; };\n 'subagent/invalid-time-zone': { readonly value: string; };\n 'subagent/parent-unavailable': { readonly parentSessionId: SessionId; };\n 'subagent/not-resumable': { readonly childSessionId: SessionId; };\n 'subagent/unauthorized': { readonly childSessionId: SessionId; };\n 'subagent/attachment-invalid': { readonly reason: string; };\n 'subagent/delivery-unavailable': { readonly childSessionId: SessionId; };\n 'settings/rejected': { readonly ns: string; };\n 'settings/conflict': { readonly ns: string; readonly expected: number; readonly actual: number; };\n 'credential/rejected': { readonly ref: string; };\n 'terminal/unavailable': Record<string, never>;\n 'terminal/control-unavailable': { readonly reason: 'read-only' | 'not-running'; };\n 'terminal/limit-reached': { readonly limit: number; };\n 'workspace/invalid-path': { readonly path: string; };\n 'workspace/name-conflict': { readonly name: string; };\n 'workspace/session-active': { readonly sessionId: SessionId; readonly activity: readonly SessionActivity[]; };\n 'workspace/move-invalid': { readonly workspaceId: WorkspaceId; readonly sessionId: SessionId; readonly beforeSessionId?: SessionId; };\n 'directory-picker/unavailable': { readonly capability: string; };\n 'directory-picker/unreadable': { readonly path: string; };\n 'directory-picker/exists': { readonly path: string; };\n 'directory-picker/create-failed': { readonly path: string; };\n 'workspace-file/watch-unsupported': { readonly path: string; };\n 'workspace-file/not-found': { readonly path: string; };\n 'workspace-file/outside-workspace': { readonly path: string; };\n 'workspace-file/too-large': { readonly path: string; readonly limit: number; };\n 'workspace-file/not-text': { readonly path: string; };\n 'workspace-file/not-regular-file': { readonly path: string; readonly kind: 'directory' | 'symlink' | 'other'; };\n 'workspace-file/not-directory': { readonly path: string; readonly kind: 'file' | 'symlink' | 'other'; };\n 'speech/invalid-audio': { readonly reason: string; };\n 'speech/transcription-failed': { readonly reason: string; };\n 'document-render/failed': { readonly reason: OfficeToPdfErrorCode; };\n}"
2017
+ "declaration": "export interface RemoteErrorDetailsMap {\n 'gateway/bad-request': { readonly issues?: readonly object[]; };\n 'gateway/cancelled': {};\n 'gateway/internal': {};\n 'llm/model-discovery-rejected': { readonly settingsNs: string; readonly baseURL?: string; };\n 'session/not-found': { readonly sessionId: SessionId; };\n 'workspace/not-found': { readonly workspaceId: WorkspaceId; };\n 'agent-preset/not-found': { readonly agentPreset: string; readonly available: readonly string[]; };\n 'agent-preset/invalid': { readonly agentPreset: string; readonly reason: string; };\n 'agent-preset/locked': { readonly sessionId: SessionId; readonly agentPreset: string; };\n 'job/not-found': { readonly sessionId: SessionId; readonly jobId: JobId; };\n 'session/provider-credentials-unavailable': Record<string, never>;\n 'session/provider-models-unavailable': { readonly provider: string; };\n 'session/model-unavailable': { readonly provider: string; readonly model: string; };\n 'session/conflict': { readonly sessionId: SessionId; readonly requestedCwd: string; readonly existingCwd?: string; };\n 'session/projections-unavailable': Record<string, never>;\n 'session/writer-held': { readonly sessionId: SessionId; };\n 'session/agent-busy': { readonly reason: string; };\n 'session/invalid-time-zone': { readonly value: string; };\n 'session/workspace-attach-failed': { readonly sessionId: SessionId; readonly workspaceId: string; };\n 'agent-preset/conflict': { readonly sessionId: SessionId; readonly requestedPreset: string; readonly existingPreset?: string; };\n 'session/attachment-invalid': { readonly reason: string; };\n 'session/queue-item-not-found': { readonly itemId: MessageId; };\n 'session/steer-unavailable': { readonly itemId: MessageId; };\n 'session/title-invalid': { readonly sessionId: SessionId; };\n 'session/fork-unavailable': { readonly sessionId: SessionId; };\n 'subagent/not-found': { readonly parentSessionId: SessionId; readonly childSessionId: SessionId; };\n 'subagent/catalog-diagnostic': { readonly parentSessionId: SessionId; readonly childSessionId: SessionId; readonly reason: 'corrupt' | 'unsupported' | 'unavailable'; };\n 'subagent/invalid-time-zone': { readonly value: string; };\n 'subagent/parent-unavailable': { readonly parentSessionId: SessionId; };\n 'subagent/not-resumable': { readonly childSessionId: SessionId; };\n 'subagent/unauthorized': { readonly childSessionId: SessionId; };\n 'subagent/attachment-invalid': { readonly reason: string; };\n 'subagent/delivery-unavailable': { readonly childSessionId: SessionId; };\n 'settings/rejected': { readonly ns: string; };\n 'settings/conflict': { readonly ns: string; readonly expected: number; readonly actual: number; };\n 'credential/rejected': { readonly ref: string; };\n 'terminal/unavailable': Record<string, never>;\n 'terminal/control-unavailable': { readonly reason: 'read-only' | 'not-running'; };\n 'terminal/limit-reached': { readonly limit: number; };\n 'workspace/invalid-path': { readonly path: string; };\n 'workspace/name-conflict': { readonly name: string; };\n 'workspace/session-active': { readonly sessionId: SessionId; readonly activity: readonly SessionActivity[]; };\n 'workspace/move-invalid': { readonly workspaceId: WorkspaceId; readonly sessionId: SessionId; readonly beforeSessionId?: SessionId; };\n 'directory-picker/unavailable': { readonly capability: string; };\n 'directory-picker/unreadable': { readonly path: string; };\n 'directory-picker/exists': { readonly path: string; };\n 'directory-picker/create-failed': { readonly path: string; };\n 'workspace-file/watch-unsupported': { readonly path: string; };\n 'workspace-file/not-found': { readonly path: string; };\n 'workspace-file/outside-workspace': { readonly path: string; };\n 'workspace-file/too-large': { readonly path: string; readonly limit: number; };\n 'workspace-file/not-text': { readonly path: string; };\n 'workspace-file/not-regular-file': { readonly path: string; readonly kind: 'directory' | 'symlink' | 'other'; };\n 'workspace-file/not-directory': { readonly path: string; readonly kind: 'file' | 'symlink' | 'other'; };\n 'gateway/ambiguous-endpoint': TypertGatewayFaultDetails;\n 'gateway/arguments-invalid': TypertGatewayFaultDetails;\n 'gateway/binding-invalid': TypertGatewayFaultDetails;\n 'gateway/context-failed': TypertGatewayFaultDetails;\n 'gateway/context-not-found': TypertGatewayFaultDetails;\n 'gateway/context-unavailable': TypertGatewayFaultDetails;\n 'gateway/definition-unavailable': TypertGatewayFaultDetails;\n 'gateway/input-invalid': TypertGatewayFaultDetails;\n 'gateway/invocation-unavailable': TypertGatewayFaultDetails;\n 'gateway/lookup-failed': TypertGatewayFaultDetails;\n 'gateway/lookup-not-found': TypertGatewayFaultDetails;\n 'gateway/lookup-unavailable': TypertGatewayFaultDetails;\n 'gateway/method-unavailable': TypertGatewayFaultDetails;\n 'gateway/protocol': TypertGatewayFaultDetails;\n 'gateway/provider-mismatch': TypertGatewayFaultDetails;\n 'gateway/result-invalid': TypertGatewayFaultDetails;\n 'gateway/service-unavailable': TypertGatewayFaultDetails;\n 'gateway/signature-invalid': TypertGatewayFaultDetails;\n 'gateway/uplink-overflow': TypertGatewayFaultDetails;\n 'speech/invalid-audio': { readonly reason: string; };\n 'speech/transcription-failed': { readonly reason: string; };\n 'document-render/failed': { readonly reason: OfficeToPdfErrorCode; };\n}"
1878
2018
  },
1879
2019
  {
1880
2020
  "name": "ReplayEnvelope",
@@ -1990,7 +2130,7 @@ export const TYPERT = {
1990
2130
  },
1991
2131
  {
1992
2132
  "name": "SessionEventMap",
1993
- "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}"
2133
+ "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 '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 'feedback/record': FeedbackRecord;\n 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n 'schedule/change': ScheduleChange;\n}"
1994
2134
  },
1995
2135
  {
1996
2136
  "name": "SessionEventType",
@@ -2070,7 +2210,7 @@ export const TYPERT = {
2070
2210
  },
2071
2211
  {
2072
2212
  "name": "SessionProjectionMap",
2073
- "declaration": "export interface SessionProjectionMap {\n inbox: InboxWireState;\n agentPreset: string | null;\n title: string | null;\n todos: TodoItem[] | null;\n sessionListMetadata: SessionListMetadata;\n imageLimits: ImageAttachmentLimits;\n modelSelection: ModelSelectionProjection;\n permissions: PermissionSelection;\n subagentCatalog: SubagentCatalogEntry[];\n subagentTiming: SubagentTimingProjection;\n subagent: SubagentIdentityProjection | null;\n goal: GoalProjection | null;\n}"
2213
+ "declaration": "export interface SessionProjectionMap {\n inbox: InboxWireState;\n agentPreset: string | null;\n title: string | null;\n todos: TodoItem[] | null;\n sessionListMetadata: SessionListMetadata;\n imageLimits: ImageAttachmentLimits;\n modelSelection: ModelSelectionProjection;\n permissions: PermissionSelection;\n subagentCatalog: SubagentCatalogEntry[];\n subagentTiming: SubagentTimingProjection;\n subagent: SubagentIdentityProjection | null;\n goal: GoalProjection | null;\n userQuestions: UserQuestionProjectionView;\n}"
2074
2214
  },
2075
2215
  {
2076
2216
  "name": "SessionProjectionsRequest",
@@ -2192,6 +2332,10 @@ export const TYPERT = {
2192
2332
  "name": "SessionWorkspacePathApplication",
2193
2333
  "declaration": "export type SessionWorkspacePathApplication = NativeFileApplication;"
2194
2334
  },
2335
+ {
2336
+ "name": "SettledUserQuestion",
2337
+ "declaration": "export interface SettledUserQuestion {\n readonly callId: ToolCallId;\n readonly answers: readonly AskUserQuestionAnswerItem[];\n}"
2338
+ },
2195
2339
  {
2196
2340
  "name": "SkillInvocationSource",
2197
2341
  "declaration": "export interface SkillInvocationSource {\n readonly kind: 'skill-invocation';\n readonly name: string;\n readonly form: 'instructions';\n}"
@@ -2312,10 +2456,22 @@ export const TYPERT = {
2312
2456
  "name": "TurnEndReasonMap",
2313
2457
  "declaration": "export interface TurnEndReasonMap {\n completed: { kind: 'completed'; };\n aborted: { kind: 'aborted'; reason: TurnEndCancelCause; };\n blocked: { kind: 'blocked'; };\n error: { kind: 'error'; error: LlmFailure; };\n 'max-tokens': { kind: 'max-tokens'; };\n interrupted: { kind: 'interrupted'; };\n forked: { kind: 'forked'; };\n}"
2314
2458
  },
2459
+ {
2460
+ "name": "TypertGatewayFaultDetails",
2461
+ "declaration": "export interface TypertGatewayFaultDetails {\n readonly endpoint: string;\n readonly field?: string;\n}"
2462
+ },
2315
2463
  {
2316
2464
  "name": "UserMessage",
2317
2465
  "declaration": "export interface UserMessage extends MessageBase {\n readonly role: 'user';\n}"
2318
2466
  },
2467
+ {
2468
+ "name": "UserQuestionProjectionView",
2469
+ "declaration": "export interface UserQuestionProjectionView {\n readonly active: readonly PendingUserQuestion[];\n readonly settled: readonly SettledUserQuestion[];\n}"
2470
+ },
2471
+ {
2472
+ "name": "UserQuestionState",
2473
+ "declaration": "export type UserQuestionState = 'open' | 'continued';"
2474
+ },
2319
2475
  {
2320
2476
  "name": "WorkspaceId",
2321
2477
  "declaration": "export type WorkspaceId = Branded<'WorkspaceId'>;"
@@ -2637,7 +2793,7 @@ export const TYPERT = {
2637
2793
  },
2638
2794
  {
2639
2795
  "name": "MessageSourceMap",
2640
- "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}"
2796
+ "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 'user-question-reply': { kind: 'user-question-reply'; callId: ToolCallId; outcome: 'answered'; };\n}"
2641
2797
  },
2642
2798
  {
2643
2799
  "name": "ModelMessageSource",
@@ -2725,7 +2881,7 @@ export const TYPERT = {
2725
2881
  },
2726
2882
  {
2727
2883
  "name": "SessionEventMap",
2728
- "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}"
2884
+ "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 '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 'feedback/record': FeedbackRecord;\n 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n 'schedule/change': ScheduleChange;\n}"
2729
2885
  },
2730
2886
  {
2731
2887
  "name": "SessionEventType",
@@ -147,6 +147,36 @@ const _deepseek_ai_dsh_api_session_controller_session_control_result$schema = ()
147
147
  'createdAt': z.number().readonly(),
148
148
  'updatedAt': z.number().readonly(),
149
149
  })]).optional(),
150
+ 'userQuestions': z.object({
151
+ 'active': z.array(z.object({
152
+ 'callId': z.intersection(z.string(), z.unknown()).readonly(),
153
+ 'questions': z.array(z.object({
154
+ 'id': z.string(),
155
+ 'question': z.string(),
156
+ 'detail': z.string().optional(),
157
+ 'header': z.string().optional(),
158
+ 'options': z.array(z.object({
159
+ 'label': z.string(),
160
+ 'description': z.string().optional(),
161
+ })).optional(),
162
+ 'multiSelect': z.boolean().optional(),
163
+ 'intent': z.object({
164
+ 'kind': z.literal("plan-review"),
165
+ 'approve': z.string(),
166
+ 'callId': z.intersection(z.string(), z.unknown()).optional(),
167
+ }).optional(),
168
+ })).readonly(),
169
+ 'state': z.union([z.literal("open"), z.literal("continued")]).readonly(),
170
+ })).readonly(),
171
+ 'settled': z.array(z.object({
172
+ 'callId': z.intersection(z.string(), z.unknown()).readonly(),
173
+ 'answers': z.array(z.object({
174
+ 'id': z.string(),
175
+ 'selected': z.array(z.string()),
176
+ 'custom': z.string().optional(),
177
+ })).readonly(),
178
+ })).readonly(),
179
+ }).optional(),
150
180
  }), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema5())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema5()))])).readonly()).readonly(),
151
181
  })).readonly().readonly(),
152
182
  }).readonly(),
@@ -319,6 +349,36 @@ const _deepseek_ai_dsh_api_session_controller_session_follow_result$schema = ()
319
349
  'createdAt': z.number().readonly(),
320
350
  'updatedAt': z.number().readonly(),
321
351
  })]).optional(),
352
+ 'userQuestions': z.object({
353
+ 'active': z.array(z.object({
354
+ 'callId': z.intersection(z.string(), z.unknown()).readonly(),
355
+ 'questions': z.array(z.object({
356
+ 'id': z.string(),
357
+ 'question': z.string(),
358
+ 'detail': z.string().optional(),
359
+ 'header': z.string().optional(),
360
+ 'options': z.array(z.object({
361
+ 'label': z.string(),
362
+ 'description': z.string().optional(),
363
+ })).optional(),
364
+ 'multiSelect': z.boolean().optional(),
365
+ 'intent': z.object({
366
+ 'kind': z.literal("plan-review"),
367
+ 'approve': z.string(),
368
+ 'callId': z.intersection(z.string(), z.unknown()).optional(),
369
+ }).optional(),
370
+ })).readonly(),
371
+ 'state': z.union([z.literal("open"), z.literal("continued")]).readonly(),
372
+ })).readonly(),
373
+ 'settled': z.array(z.object({
374
+ 'callId': z.intersection(z.string(), z.unknown()).readonly(),
375
+ 'answers': z.array(z.object({
376
+ 'id': z.string(),
377
+ 'selected': z.array(z.string()),
378
+ 'custom': z.string().optional(),
379
+ })).readonly(),
380
+ })).readonly(),
381
+ }).optional(),
322
382
  }), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3()))])).readonly()).readonly(),
323
383
  }).readonly(),
324
384
  'assistantStream': z.object({
@@ -481,6 +541,36 @@ const _deepseek_ai_dsh_api_session_controller_session_list_result$schema = () =>
481
541
  'createdAt': z.number().readonly(),
482
542
  'updatedAt': z.number().readonly(),
483
543
  })]).optional(),
544
+ 'userQuestions': z.object({
545
+ 'active': z.array(z.object({
546
+ 'callId': z.intersection(z.string(), z.unknown()).readonly(),
547
+ 'questions': z.array(z.object({
548
+ 'id': z.string(),
549
+ 'question': z.string(),
550
+ 'detail': z.string().optional(),
551
+ 'header': z.string().optional(),
552
+ 'options': z.array(z.object({
553
+ 'label': z.string(),
554
+ 'description': z.string().optional(),
555
+ })).optional(),
556
+ 'multiSelect': z.boolean().optional(),
557
+ 'intent': z.object({
558
+ 'kind': z.literal("plan-review"),
559
+ 'approve': z.string(),
560
+ 'callId': z.intersection(z.string(), z.unknown()).optional(),
561
+ }).optional(),
562
+ })).readonly(),
563
+ 'state': z.union([z.literal("open"), z.literal("continued")]).readonly(),
564
+ })).readonly(),
565
+ 'settled': z.array(z.object({
566
+ 'callId': z.intersection(z.string(), z.unknown()).readonly(),
567
+ 'answers': z.array(z.object({
568
+ 'id': z.string(),
569
+ 'selected': z.array(z.string()),
570
+ 'custom': z.string().optional(),
571
+ })).readonly(),
572
+ })).readonly(),
573
+ }).optional(),
484
574
  }), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema()))])).readonly()).readonly(),
485
575
  }).readonly().optional(),
486
576
  })).readonly(),
@@ -658,6 +748,36 @@ const _deepseek_ai_dsh_api_session_controller_session_projections_result$schema
658
748
  'createdAt': z.number().readonly(),
659
749
  'updatedAt': z.number().readonly(),
660
750
  })]).optional(),
751
+ 'userQuestions': z.object({
752
+ 'active': z.array(z.object({
753
+ 'callId': z.intersection(z.string(), z.unknown()).readonly(),
754
+ 'questions': z.array(z.object({
755
+ 'id': z.string(),
756
+ 'question': z.string(),
757
+ 'detail': z.string().optional(),
758
+ 'header': z.string().optional(),
759
+ 'options': z.array(z.object({
760
+ 'label': z.string(),
761
+ 'description': z.string().optional(),
762
+ })).optional(),
763
+ 'multiSelect': z.boolean().optional(),
764
+ 'intent': z.object({
765
+ 'kind': z.literal("plan-review"),
766
+ 'approve': z.string(),
767
+ 'callId': z.intersection(z.string(), z.unknown()).optional(),
768
+ }).optional(),
769
+ })).readonly(),
770
+ 'state': z.union([z.literal("open"), z.literal("continued")]).readonly(),
771
+ })).readonly(),
772
+ 'settled': z.array(z.object({
773
+ 'callId': z.intersection(z.string(), z.unknown()).readonly(),
774
+ 'answers': z.array(z.object({
775
+ 'id': z.string(),
776
+ 'selected': z.array(z.string()),
777
+ 'custom': z.string().optional(),
778
+ })).readonly(),
779
+ })).readonly(),
780
+ }).optional(),
661
781
  }), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema4())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema4()))])).readonly()).readonly(),
662
782
  })]))
663
783
  let _deepseek_ai_dsh_api_session_controller_session_prompt_parameter_0$schema$value
@@ -117,7 +117,7 @@ export interface ISessions {
117
117
  * seq (a real event seq the caller already knows; a cut inside an open
118
118
  * turn is balanced Host-side with synthetic closers, and omission selects
119
119
  * the latest completed-turn prefix), and whether to increment an
120
- * inherited durable title before resolving.
120
+ * inherited durable title before resolving. `onCreated` observes the catalogued child before that optional rename.
121
121
  * @returns the child session id.
122
122
  * @throws when the fork fails, or when a requested child-title rename fails after creation.
123
123
  */
@@ -125,6 +125,7 @@ export interface ISessions {
125
125
  sessionId: SessionId;
126
126
  atSeq?: number;
127
127
  increaseTitle?: boolean;
128
+ onCreated?: (childId: SessionId) => void;
128
129
  }): Promise<SessionId>;
129
130
  /**
130
131
  * Borrow an already-retained Agent-scoped Context without extending its lifetime.
@@ -198,6 +198,7 @@ export declare class ClientSessions implements ISessions {
198
198
  sessionId: SessionId;
199
199
  atSeq?: number;
200
200
  increaseTitle?: boolean;
201
+ onCreated?: (childId: SessionId) => void;
201
202
  }): Promise<SessionId>;
202
203
  /**
203
204
  * Borrow an already-retained Agent-scoped Context.
@@ -348,6 +348,7 @@ export class ClientSessions {
348
348
  throw new SessionForkError(result.error, opts.sessionId);
349
349
  this.projectList();
350
350
  const childId = result.value.sessionId;
351
+ opts.onCreated?.(childId);
351
352
  if (sourceTitle !== undefined) {
352
353
  const renamed = await this.manager.rename(childId, increasedForkTitle(sourceTitle));
353
354
  if (!renamed.ok)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-api-session-controller",
3
3
  "description": "Session Remote commands, cold reads, and live control transport",
4
- "version": "0.1.7-rc.2",
4
+ "version": "0.2.0-rc.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -67,41 +67,41 @@
67
67
  "dependencies": {
68
68
  "mime-types": "^3.0.2",
69
69
  "zod": "^4.4.3",
70
- "@deepseek-ai/dsh-deque": "0.1.7-rc.2",
71
- "@deepseek-ai/dsh-brand": "0.1.7-rc.2",
70
+ "@deepseek-ai/dsh-brand": "0.2.0-rc.2",
71
+ "@deepseek-ai/dsh-deque": "0.2.0-rc.2",
72
72
  "@deepseek-ai/schemastery": "~3.18.4"
73
73
  },
74
74
  "peerDependencies": {
75
+ "@deepseek-ai/dsh-agent": "0.2.0-rc.2",
76
+ "@deepseek-ai/dsh-agent-default-model": "0.2.0-rc.2",
75
77
  "@deepseek-ai/cordis": "~4.0.4",
76
- "@deepseek-ai/dsh-agent-default-model": "0.1.7-rc.2",
77
- "@deepseek-ai/dsh-agent-preset-registry": "0.1.7-rc.2",
78
- "@deepseek-ai/dsh-api-gateway": "0.1.7-rc.2",
79
- "@deepseek-ai/dsh-attachment": "0.1.7-rc.2",
80
- "@deepseek-ai/dsh-client-connection": "0.1.7-rc.2",
81
- "@deepseek-ai/dsh-client-file-upload": "0.1.7-rc.2",
82
- "@deepseek-ai/dsh-commands": "0.1.7-rc.2",
83
- "@deepseek-ai/dsh-agent": "0.1.7-rc.2",
84
- "@deepseek-ai/dsh-credentials": "0.1.7-rc.2",
85
- "@deepseek-ai/dsh-file-reference": "0.1.7-rc.2",
86
- "@deepseek-ai/dsh-fs": "0.1.7-rc.2",
87
- "@deepseek-ai/dsh-llm": "0.1.7-rc.2",
88
- "@deepseek-ai/dsh-native-command": "0.1.7-rc.2",
89
- "@deepseek-ai/dsh-session": "0.1.7-rc.2",
90
- "@deepseek-ai/dsh-session-persistence": "0.1.7-rc.2",
91
- "@deepseek-ai/dsh-session-projection": "0.1.7-rc.2",
92
- "@deepseek-ai/dsh-session-projection-cache": "0.1.7-rc.2",
93
- "@deepseek-ai/dsh-scope": "0.1.7-rc.2",
94
- "@deepseek-ai/dsh-session-query": "0.1.7-rc.2",
95
- "@deepseek-ai/dsh-session-title": "0.1.7-rc.2",
96
- "@deepseek-ai/dsh-settings": "0.1.7-rc.2",
97
- "@deepseek-ai/dsh-typert-protocol": "0.1.7-rc.2",
98
- "@deepseek-ai/dsh-typert-registry": "0.1.7-rc.2",
99
- "@deepseek-ai/dsh-util-values": "0.1.7-rc.2",
100
- "@deepseek-ai/dsh-util-workspace-path": "0.1.7-rc.2",
101
- "@deepseek-ai/dsh-subagent": "0.1.7-rc.2",
102
- "@deepseek-ai/dsh-skill": "0.1.7-rc.2",
103
- "@deepseek-ai/dsh-util-time": "0.1.7-rc.2",
104
- "@deepseek-ai/dsh-workspace": "0.1.7-rc.2"
78
+ "@deepseek-ai/dsh-agent-preset-registry": "0.2.0-rc.2",
79
+ "@deepseek-ai/dsh-api-gateway": "0.2.0-rc.2",
80
+ "@deepseek-ai/dsh-attachment": "0.2.0-rc.2",
81
+ "@deepseek-ai/dsh-client-connection": "0.2.0-rc.2",
82
+ "@deepseek-ai/dsh-client-file-upload": "0.2.0-rc.2",
83
+ "@deepseek-ai/dsh-commands": "0.2.0-rc.2",
84
+ "@deepseek-ai/dsh-fs": "0.2.0-rc.2",
85
+ "@deepseek-ai/dsh-native-command": "0.2.0-rc.2",
86
+ "@deepseek-ai/dsh-scope": "0.2.0-rc.2",
87
+ "@deepseek-ai/dsh-session": "0.2.0-rc.2",
88
+ "@deepseek-ai/dsh-session-persistence": "0.2.0-rc.2",
89
+ "@deepseek-ai/dsh-session-projection": "0.2.0-rc.2",
90
+ "@deepseek-ai/dsh-session-projection-cache": "0.2.0-rc.2",
91
+ "@deepseek-ai/dsh-session-title": "0.2.0-rc.2",
92
+ "@deepseek-ai/dsh-settings": "0.2.0-rc.2",
93
+ "@deepseek-ai/dsh-session-query": "0.2.0-rc.2",
94
+ "@deepseek-ai/dsh-skill": "0.2.0-rc.2",
95
+ "@deepseek-ai/dsh-subagent": "0.2.0-rc.2",
96
+ "@deepseek-ai/dsh-typert-protocol": "0.2.0-rc.2",
97
+ "@deepseek-ai/dsh-typert-registry": "0.2.0-rc.2",
98
+ "@deepseek-ai/dsh-util-time": "0.2.0-rc.2",
99
+ "@deepseek-ai/dsh-util-values": "0.2.0-rc.2",
100
+ "@deepseek-ai/dsh-credentials": "0.2.0-rc.2",
101
+ "@deepseek-ai/dsh-llm": "0.2.0-rc.2",
102
+ "@deepseek-ai/dsh-file-reference": "0.2.0-rc.2",
103
+ "@deepseek-ai/dsh-workspace": "0.2.0-rc.2",
104
+ "@deepseek-ai/dsh-util-workspace-path": "0.2.0-rc.2"
105
105
  },
106
106
  "peerDependenciesMeta": {
107
107
  "@deepseek-ai/dsh-session-persistence": {
@@ -117,46 +117,46 @@
117
117
  "devDependencies": {
118
118
  "@types/mime-types": "^3.0.1",
119
119
  "@deepseek-ai/cordis": "~4.0.4",
120
- "@deepseek-ai/dsh-agent": "0.1.7-rc.2",
121
- "@deepseek-ai/dsh-agent-default-model": "0.1.7-rc.2",
122
- "@deepseek-ai/dsh-agent-loop-testkit": "0.1.7-rc.2",
123
- "@deepseek-ai/dsh-agent-loop": "0.1.7-rc.2",
124
- "@deepseek-ai/dsh-agent-preset-registry": "0.1.7-rc.2",
125
- "@deepseek-ai/dsh-api-gateway": "0.1.7-rc.2",
126
- "@deepseek-ai/dsh-attachment": "0.1.7-rc.2",
127
- "@deepseek-ai/dsh-client-connection": "0.1.7-rc.2",
128
- "@deepseek-ai/dsh-client-file-upload": "0.1.7-rc.2",
129
- "@deepseek-ai/dsh-client-store": "0.1.7-rc.2",
130
- "@deepseek-ai/dsh-client-test-runtime": "0.1.7-rc.2",
131
- "@deepseek-ai/dsh-commands": "0.1.7-rc.2",
132
- "@deepseek-ai/dsh-credentials": "0.1.7-rc.2",
133
- "@deepseek-ai/dsh-file-reference": "0.1.7-rc.2",
134
- "@deepseek-ai/dsh-fs": "0.1.7-rc.2",
135
- "@deepseek-ai/dsh-fs-local": "0.1.7-rc.2",
136
- "@deepseek-ai/dsh-permission-presets": "0.1.7-rc.2",
137
- "@deepseek-ai/dsh-remote-mock": "0.1.7-rc.2",
138
- "@deepseek-ai/dsh-scope": "0.1.7-rc.2",
139
- "@deepseek-ai/dsh-session": "0.1.7-rc.2",
140
- "@deepseek-ai/dsh-session-persistence": "0.1.7-rc.2",
141
- "@deepseek-ai/dsh-llm": "0.1.7-rc.2",
142
- "@deepseek-ai/dsh-native-command": "0.1.7-rc.2",
143
- "@deepseek-ai/dsh-session-projection-cache": "0.1.7-rc.2",
144
- "@deepseek-ai/dsh-session-projection": "0.1.7-rc.2",
145
- "@deepseek-ai/dsh-session-title": "0.1.7-rc.2",
146
- "@deepseek-ai/dsh-settings": "0.1.7-rc.2",
147
- "@deepseek-ai/dsh-session-query": "0.1.7-rc.2",
148
- "@deepseek-ai/dsh-skill": "0.1.7-rc.2",
149
- "@deepseek-ai/dsh-storage-json": "0.1.7-rc.2",
150
- "@deepseek-ai/dsh-subagent": "0.1.7-rc.2",
151
- "@deepseek-ai/dsh-typert-protocol": "0.1.7-rc.2",
152
- "@deepseek-ai/dsh-typert-registry": "0.1.7-rc.2",
153
- "@deepseek-ai/dsh-storage-domain": "0.1.7-rc.2",
154
- "@deepseek-ai/dsh-storage": "0.1.7-rc.2",
155
- "@deepseek-ai/dsh-util-crypto": "0.1.7-rc.2",
156
- "@deepseek-ai/dsh-util-time": "0.1.7-rc.2",
157
- "@deepseek-ai/dsh-util-values": "0.1.7-rc.2",
158
- "@deepseek-ai/dsh-util-workspace-path": "0.1.7-rc.2",
159
- "@deepseek-ai/dsh-workspace": "0.1.7-rc.2"
120
+ "@deepseek-ai/dsh-agent": "0.2.0-rc.2",
121
+ "@deepseek-ai/dsh-agent-default-model": "0.2.0-rc.2",
122
+ "@deepseek-ai/dsh-agent-loop": "0.2.0-rc.2",
123
+ "@deepseek-ai/dsh-agent-loop-testkit": "0.2.0-rc.2",
124
+ "@deepseek-ai/dsh-api-gateway": "0.2.0-rc.2",
125
+ "@deepseek-ai/dsh-attachment": "0.2.0-rc.2",
126
+ "@deepseek-ai/dsh-client-connection": "0.2.0-rc.2",
127
+ "@deepseek-ai/dsh-client-file-upload": "0.2.0-rc.2",
128
+ "@deepseek-ai/dsh-client-store": "0.2.0-rc.2",
129
+ "@deepseek-ai/dsh-client-test-runtime": "0.2.0-rc.2",
130
+ "@deepseek-ai/dsh-commands": "0.2.0-rc.2",
131
+ "@deepseek-ai/dsh-credentials": "0.2.0-rc.2",
132
+ "@deepseek-ai/dsh-file-reference": "0.2.0-rc.2",
133
+ "@deepseek-ai/dsh-fs": "0.2.0-rc.2",
134
+ "@deepseek-ai/dsh-fs-local": "0.2.0-rc.2",
135
+ "@deepseek-ai/dsh-llm": "0.2.0-rc.2",
136
+ "@deepseek-ai/dsh-native-command": "0.2.0-rc.2",
137
+ "@deepseek-ai/dsh-permission-presets": "0.2.0-rc.2",
138
+ "@deepseek-ai/dsh-remote-mock": "0.2.0-rc.2",
139
+ "@deepseek-ai/dsh-scope": "0.2.0-rc.2",
140
+ "@deepseek-ai/dsh-session": "0.2.0-rc.2",
141
+ "@deepseek-ai/dsh-session-persistence": "0.2.0-rc.2",
142
+ "@deepseek-ai/dsh-session-projection": "0.2.0-rc.2",
143
+ "@deepseek-ai/dsh-session-projection-cache": "0.2.0-rc.2",
144
+ "@deepseek-ai/dsh-session-query": "0.2.0-rc.2",
145
+ "@deepseek-ai/dsh-session-title": "0.2.0-rc.2",
146
+ "@deepseek-ai/dsh-settings": "0.2.0-rc.2",
147
+ "@deepseek-ai/dsh-skill": "0.2.0-rc.2",
148
+ "@deepseek-ai/dsh-agent-preset-registry": "0.2.0-rc.2",
149
+ "@deepseek-ai/dsh-storage-domain": "0.2.0-rc.2",
150
+ "@deepseek-ai/dsh-storage-json": "0.2.0-rc.2",
151
+ "@deepseek-ai/dsh-subagent": "0.2.0-rc.2",
152
+ "@deepseek-ai/dsh-typert-protocol": "0.2.0-rc.2",
153
+ "@deepseek-ai/dsh-typert-registry": "0.2.0-rc.2",
154
+ "@deepseek-ai/dsh-util-crypto": "0.2.0-rc.2",
155
+ "@deepseek-ai/dsh-util-time": "0.2.0-rc.2",
156
+ "@deepseek-ai/dsh-util-values": "0.2.0-rc.2",
157
+ "@deepseek-ai/dsh-util-workspace-path": "0.2.0-rc.2",
158
+ "@deepseek-ai/dsh-storage": "0.2.0-rc.2",
159
+ "@deepseek-ai/dsh-workspace": "0.2.0-rc.2"
160
160
  },
161
161
  "scripts": {
162
162
  "bundle": "tsdown",