@chatcode/chatcode-cli 3.0.6-rc.2 → 3.0.6-rc.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.
Files changed (55) hide show
  1. package/package.json +24 -24
  2. package/runtime/manifest.json +1 -1
  3. package/runtime/node_modules/@chatcode/runtime-client/README.md +9 -6
  4. package/runtime/node_modules/@chatcode/runtime-client/index.d.ts +6 -12
  5. package/runtime/node_modules/@chatcode/runtime-client/package.json +1 -1
  6. package/runtime/node_modules/@chatcode/runtime-client/runtime-connector.mjs +16 -16
  7. package/runtime/node_modules/@chatcode/runtime-client/session-browser.mjs +1 -0
  8. package/runtime/node_modules/@deepseek-ai/dsh-agent-loop/lib/index.js +1 -1
  9. package/runtime/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/typert.host.js +3 -3
  10. package/runtime/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +14 -4
  11. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/client.js +1 -0
  12. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/index.js +23 -10
  13. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +23 -13
  14. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.d.ts +2 -2
  15. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.js +10 -0
  16. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/agent.d.ts +2 -1
  17. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/agent.js +5 -3
  18. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/commands.js +8 -3
  19. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.d.ts +1 -0
  20. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.js +1 -1
  21. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/list.js +7 -3
  22. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/types.d.ts +9 -0
  23. package/runtime/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/typert.host.js +3 -3
  24. package/runtime/node_modules/@deepseek-ai/dsh-client-file-upload/lib/typert.host.js +3 -3
  25. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/client.js +2 -2
  26. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/types/index.d.ts +2 -2
  27. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +1 -1
  28. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
  29. package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/typert.host.js +3 -3
  30. package/runtime/node_modules/@deepseek-ai/dsh-cordis-host-runner/lib/typert.host.js +6 -6
  31. package/runtime/node_modules/@deepseek-ai/dsh-goal/lib/typert.host.js +3 -3
  32. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/index.js +17 -1
  33. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/typert.host.js +6 -6
  34. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/typert.remote-client.js +3 -3
  35. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/call-config.d.ts +4 -0
  36. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/call-config.js +1 -0
  37. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/index.js +24 -0
  38. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/types.d.ts +2 -0
  39. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/index.js +7 -0
  40. package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/index.js +15 -4
  41. package/runtime/node_modules/@deepseek-ai/dsh-permission-presets/lib/typert.host.js +3 -3
  42. package/runtime/node_modules/@deepseek-ai/dsh-repeat-tool-reminder/lib/index.js +16 -1
  43. package/runtime/node_modules/@deepseek-ai/dsh-session/lib/index.js +12 -1
  44. package/runtime/node_modules/@deepseek-ai/dsh-session/lib/types/index.d.ts +2 -0
  45. package/runtime/node_modules/@deepseek-ai/dsh-session/lib/types/index.js +13 -1
  46. package/runtime/node_modules/@deepseek-ai/dsh-session/lib/types/known-event-types.js +1 -0
  47. package/runtime/node_modules/@deepseek-ai/dsh-session/lib/types/types.d.ts +5 -0
  48. package/runtime/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/worker.cjs +22 -1
  49. package/runtime/node_modules/@deepseek-ai/dsh-session-reference/lib/typert.host.js +3 -3
  50. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/index.js +1 -0
  51. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/typert.host.js +3 -3
  52. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/child-agent.js +1 -0
  53. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/control.d.ts +1 -1
  54. package/runtime/node_modules/@deepseek-ai/dsh-tmux-context/lib/index.js +16 -1
  55. package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +83 -20
@@ -77,6 +77,7 @@ const _deepseek_ai_dsh_api_session_controller_session_control_result$schema = ()
77
77
  'status': z.union([z.literal("completed"), z.literal("pending"), z.literal("in_progress")]),
78
78
  }))]).optional(),
79
79
  'sessionListMetadata': z.object({
80
+ 'appId': z.union([z.undefined(), z.string()]).readonly().optional(),
80
81
  'hasUserPrompt': z.boolean().readonly().optional(),
81
82
  'blank': z.boolean().readonly(),
82
83
  'lastPromptAt': z.union([z.literal(null), z.number()]).readonly(),
@@ -169,6 +170,7 @@ const _deepseek_ai_dsh_api_session_controller_session_control_result$schema = ()
169
170
  }))]))
170
171
  let _deepseek_ai_dsh_api_session_controller_session_create_parameter_0$schema$value
171
172
  const _deepseek_ai_dsh_api_session_controller_session_create_parameter_0$schema = () => (_deepseek_ai_dsh_api_session_controller_session_create_parameter_0$schema$value ??= z.object({
173
+ 'appId': z.string().readonly().optional(),
172
174
  'resumeOnly': z.boolean().readonly().optional(),
173
175
  'workspaceId': z.intersection(z.string(), z.unknown()).readonly().optional(),
174
176
  'cwd': z.string().readonly().optional(),
@@ -179,6 +181,7 @@ const _deepseek_ai_dsh_api_session_controller_session_create_parameter_0$schema
179
181
  }))
180
182
  let _deepseek_ai_dsh_api_session_controller_session_create_result$schema$value
181
183
  const _deepseek_ai_dsh_api_session_controller_session_create_result$schema = () => (_deepseek_ai_dsh_api_session_controller_session_create_result$schema$value ??= z.object({
184
+ 'appId': z.string().readonly().optional(),
182
185
  'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
183
186
  'agentPreset': z.string().readonly().optional(),
184
187
  }))
@@ -253,6 +256,7 @@ const _deepseek_ai_dsh_api_session_controller_session_follow_result$schema = ()
253
256
  'status': z.union([z.literal("completed"), z.literal("pending"), z.literal("in_progress")]),
254
257
  }))]).optional(),
255
258
  'sessionListMetadata': z.object({
259
+ 'appId': z.union([z.undefined(), z.string()]).readonly().optional(),
256
260
  'hasUserPrompt': z.boolean().readonly().optional(),
257
261
  'blank': z.boolean().readonly(),
258
262
  'lastPromptAt': z.union([z.literal(null), z.number()]).readonly(),
@@ -393,6 +397,7 @@ const _deepseek_ai_dsh_api_session_controller_session_list_parameter_0$schema =
393
397
  let _deepseek_ai_dsh_api_session_controller_session_list_result$schema$value
394
398
  const _deepseek_ai_dsh_api_session_controller_session_list_result$schema = () => (_deepseek_ai_dsh_api_session_controller_session_list_result$schema$value ??= z.object({
395
399
  'items': z.array(z.object({
400
+ 'appId': z.string().readonly().optional(),
396
401
  'agentAvailable': z.boolean().readonly(),
397
402
  'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
398
403
  'updatedAt': z.number().readonly(),
@@ -416,6 +421,7 @@ const _deepseek_ai_dsh_api_session_controller_session_list_result$schema = () =>
416
421
  'status': z.union([z.literal("completed"), z.literal("pending"), z.literal("in_progress")]),
417
422
  }))]).optional(),
418
423
  'sessionListMetadata': z.object({
424
+ 'appId': z.union([z.undefined(), z.string()]).readonly().optional(),
419
425
  'hasUserPrompt': z.boolean().readonly().optional(),
420
426
  'blank': z.boolean().readonly(),
421
427
  'lastPromptAt': z.union([z.literal(null), z.number()]).readonly(),
@@ -602,6 +608,7 @@ const _deepseek_ai_dsh_api_session_controller_session_projections_result$schema
602
608
  'status': z.union([z.literal("completed"), z.literal("pending"), z.literal("in_progress")]),
603
609
  }))]).optional(),
604
610
  'sessionListMetadata': z.object({
611
+ 'appId': z.union([z.undefined(), z.string()]).readonly().optional(),
605
612
  'hasUserPrompt': z.boolean().readonly().optional(),
606
613
  'blank': z.boolean().readonly(),
607
614
  'lastPromptAt': z.union([z.literal(null), z.number()]).readonly(),
@@ -707,6 +714,7 @@ const _deepseek_ai_dsh_api_session_controller_session_prompt_parameter_0$schema
707
714
  'provider': z.string().readonly(),
708
715
  'model': z.string().readonly(),
709
716
  'protocol': z.string().readonly().optional(),
717
+ 'baseUrl': z.string().readonly().optional(),
710
718
  'apiKey': z.string().readonly().optional(),
711
719
  'options': z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema2())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema2()))])).readonly().readonly(),
712
720
  'protocolOptions': z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema2())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema2()))])).readonly().readonly().optional(),
@@ -721,6 +729,7 @@ const _deepseek_ai_dsh_api_session_controller_session_promptModelConfig_result$s
721
729
  'version': z.literal(1),
722
730
  'requestApiKey': z.literal(true),
723
731
  'unifiedOptions': z.literal(true),
732
+ 'requestBaseUrl': z.literal(true),
724
733
  }))
725
734
  let _deepseek_ai_dsh_api_session_controller_session_refreshModelCatalog_result$schema$value
726
735
  const _deepseek_ai_dsh_api_session_controller_session_refreshModelCatalog_result$schema = () => (_deepseek_ai_dsh_api_session_controller_session_refreshModelCatalog_result$schema$value ??= z.object({
@@ -787,6 +796,7 @@ const _deepseek_ai_dsh_api_session_controller_session_resume_parameter_0$schema
787
796
  }))
788
797
  let _deepseek_ai_dsh_api_session_controller_session_resume_result$schema$value
789
798
  const _deepseek_ai_dsh_api_session_controller_session_resume_result$schema = () => (_deepseek_ai_dsh_api_session_controller_session_resume_result$schema$value ??= z.object({
799
+ 'appId': z.string().readonly().optional(),
790
800
  'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
791
801
  'selected': z.object({
792
802
  'provider': z.string().readonly(),
@@ -1802,7 +1812,7 @@ export const TYPERT = {
1802
1812
  {
1803
1813
  "kind": "method",
1804
1814
  "name": "promptModelConfig",
1805
- "signature": "@Remote('promptModelConfig') promptModelConfig(): { version: 1; requestApiKey: true; unifiedOptions: true }",
1815
+ "signature": "@Remote('promptModelConfig') promptModelConfig(): { version: 1; requestApiKey: true; unifiedOptions: true; requestBaseUrl: true }",
1806
1816
  "summary": "Advertise support for request-local model configuration.",
1807
1817
  "jsDoc": "/**\n * Advertise support for request-local model configuration.\n * @returns Supported model configuration version.\n */"
1808
1818
  },
@@ -2134,7 +2144,7 @@ export const TYPERT = {
2134
2144
  },
2135
2145
  {
2136
2146
  "name": "LlmCallConfig",
2137
- "declaration": "export interface LlmCallConfig {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n contextWindow?: number;\n protocol?: string;\n protocolOptions?: Readonly<Record<string, JsonValue>>;\n}"
2147
+ "declaration": "export interface LlmCallConfig {\n baseUrl?: string;\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n contextWindow?: number;\n protocol?: string;\n protocolOptions?: Readonly<Record<string, JsonValue>>;\n}"
2138
2148
  },
2139
2149
  {
2140
2150
  "name": "LlmCallConfigAdapterDefaults",
@@ -2146,7 +2156,7 @@ export const TYPERT = {
2146
2156
  },
2147
2157
  {
2148
2158
  "name": "LlmPromptModelConfig",
2149
- "declaration": "export interface LlmPromptModelConfig {\n readonly provider: string;\n readonly model: string;\n readonly protocol?: string;\n readonly apiKey?: string;\n readonly options: Readonly<Record<string, JsonValue>>;\n readonly protocolOptions?: Readonly<Record<string, JsonValue>>;\n}"
2159
+ "declaration": "export interface LlmPromptModelConfig {\n readonly provider: string;\n readonly model: string;\n readonly protocol?: string;\n readonly baseUrl?: string;\n readonly apiKey?: string;\n readonly options: Readonly<Record<string, JsonValue>>;\n readonly protocolOptions?: Readonly<Record<string, JsonValue>>;\n}"
2150
2160
  },
2151
2161
  {
2152
2162
  "name": "Message",
@@ -2330,7 +2340,7 @@ export const TYPERT = {
2330
2340
  },
2331
2341
  {
2332
2342
  "name": "Session",
2333
- "declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n readonly inheritedEventCount: SessionLogOffset;\n get id(): SessionId;\n readonly firstLiveSeq: SessionLogOffset;\n readonly firstLifecycleSeq: SessionLogOffset;\n eventAt(seq: SessionSeq): SessionEvent | undefined;\n snapshotEvents(fromSeq: SessionLogOffset = SessionLogOffset(0), toSeqExclusive: SessionLogOffset = this.seq): readonly SessionEvent[];\n ownEvents(): readonly SessionEvent[];\n isOwnSeq(seq: SessionSeq): boolean;\n get seq(): SessionLogOffset;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n toolHistory(): ToolHistory;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
2343
+ "declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n readonly inheritedEventCount: SessionLogOffset;\n get id(): SessionId;\n readonly firstLiveSeq: SessionLogOffset;\n readonly firstLifecycleSeq: SessionLogOffset;\n get appId(): string | undefined;\n eventAt(seq: SessionSeq): SessionEvent | undefined;\n snapshotEvents(fromSeq: SessionLogOffset = SessionLogOffset(0), toSeqExclusive: SessionLogOffset = this.seq): readonly SessionEvent[];\n ownEvents(): readonly SessionEvent[];\n isOwnSeq(seq: SessionSeq): boolean;\n get seq(): SessionLogOffset;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n toolHistory(): ToolHistory;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
2334
2344
  },
2335
2345
  {
2336
2346
  "name": "SessionActivity",
@@ -2398,11 +2408,11 @@ export const TYPERT = {
2398
2408
  },
2399
2409
  {
2400
2410
  "name": "SessionCreateRequest",
2401
- "declaration": "export interface SessionCreateRequest {\n readonly resumeOnly?: boolean;\n readonly workspaceId?: WorkspaceId;\n readonly cwd?: string;\n readonly sessionId?: SessionId;\n readonly agentPreset?: string;\n readonly provider?: string;\n readonly model?: string;\n}"
2411
+ "declaration": "export interface SessionCreateRequest {\n readonly appId?: string;\n readonly resumeOnly?: boolean;\n readonly workspaceId?: WorkspaceId;\n readonly cwd?: string;\n readonly sessionId?: SessionId;\n readonly agentPreset?: string;\n readonly provider?: string;\n readonly model?: string;\n}"
2402
2412
  },
2403
2413
  {
2404
2414
  "name": "SessionCreateValue",
2405
- "declaration": "export interface SessionCreateValue {\n readonly sessionId: SessionId;\n readonly agentPreset?: string;\n}"
2415
+ "declaration": "export interface SessionCreateValue {\n readonly appId?: string;\n readonly sessionId: SessionId;\n readonly agentPreset?: string;\n}"
2406
2416
  },
2407
2417
  {
2408
2418
  "name": "SessionEvent",
@@ -2414,7 +2424,7 @@ export const TYPERT = {
2414
2424
  },
2415
2425
  {
2416
2426
  "name": "SessionEventMap",
2417
- "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}"
2427
+ "declaration": "export interface SessionEventMap {\n 'session/application': { appId: string; };\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}"
2418
2428
  },
2419
2429
  {
2420
2430
  "name": "SessionEventType",
@@ -2454,7 +2464,7 @@ export const TYPERT = {
2454
2464
  },
2455
2465
  {
2456
2466
  "name": "SessionListMetadata",
2457
- "declaration": "export interface SessionListMetadata {\n readonly hasUserPrompt?: boolean;\n readonly blank: boolean;\n readonly lastPromptAt: number | null;\n}"
2467
+ "declaration": "export interface SessionListMetadata {\n readonly appId?: string | undefined;\n readonly hasUserPrompt?: boolean;\n readonly blank: boolean;\n readonly lastPromptAt: number | null;\n}"
2458
2468
  },
2459
2469
  {
2460
2470
  "name": "SessionListRequest",
@@ -2546,7 +2556,7 @@ export const TYPERT = {
2546
2556
  },
2547
2557
  {
2548
2558
  "name": "SessionResumeValue",
2549
- "declaration": "export interface SessionResumeValue {\n readonly sessionId: SessionId;\n readonly selected: ModelSelection;\n}"
2559
+ "declaration": "export interface SessionResumeValue {\n readonly appId?: string;\n readonly sessionId: SessionId;\n readonly selected: ModelSelection;\n}"
2550
2560
  },
2551
2561
  {
2552
2562
  "name": "SessionSearchItem",
@@ -2590,7 +2600,7 @@ export const TYPERT = {
2590
2600
  },
2591
2601
  {
2592
2602
  "name": "SessionSummary",
2593
- "declaration": "export interface SessionSummary {\n readonly agentAvailable: boolean;\n readonly sessionId: SessionId;\n readonly updatedAt: number;\n readonly running: boolean;\n readonly blank: boolean;\n readonly parentSessionId?: SessionId;\n readonly origin?: 'subagent';\n readonly cwd?: string;\n readonly projections?: SessionProjectionHints;\n}"
2603
+ "declaration": "export interface SessionSummary {\n readonly appId?: string;\n readonly agentAvailable: boolean;\n readonly sessionId: SessionId;\n readonly updatedAt: number;\n readonly running: boolean;\n readonly blank: boolean;\n readonly parentSessionId?: SessionId;\n readonly origin?: 'subagent';\n readonly cwd?: string;\n readonly projections?: SessionProjectionHints;\n}"
2594
2604
  },
2595
2605
  {
2596
2606
  "name": "SessionSurface",
@@ -3025,7 +3035,7 @@ export const TYPERT = {
3025
3035
  },
3026
3036
  {
3027
3037
  "name": "LlmCallConfig",
3028
- "declaration": "export interface LlmCallConfig {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n contextWindow?: number;\n protocol?: string;\n protocolOptions?: Readonly<Record<string, JsonValue>>;\n}"
3038
+ "declaration": "export interface LlmCallConfig {\n baseUrl?: string;\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n contextWindow?: number;\n protocol?: string;\n protocolOptions?: Readonly<Record<string, JsonValue>>;\n}"
3029
3039
  },
3030
3040
  {
3031
3041
  "name": "LlmCallConfigAdapterDefaults",
@@ -3157,7 +3167,7 @@ export const TYPERT = {
3157
3167
  },
3158
3168
  {
3159
3169
  "name": "Session",
3160
- "declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n readonly inheritedEventCount: SessionLogOffset;\n get id(): SessionId;\n readonly firstLiveSeq: SessionLogOffset;\n readonly firstLifecycleSeq: SessionLogOffset;\n eventAt(seq: SessionSeq): SessionEvent | undefined;\n snapshotEvents(fromSeq: SessionLogOffset = SessionLogOffset(0), toSeqExclusive: SessionLogOffset = this.seq): readonly SessionEvent[];\n ownEvents(): readonly SessionEvent[];\n isOwnSeq(seq: SessionSeq): boolean;\n get seq(): SessionLogOffset;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n toolHistory(): ToolHistory;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
3170
+ "declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n readonly inheritedEventCount: SessionLogOffset;\n get id(): SessionId;\n readonly firstLiveSeq: SessionLogOffset;\n readonly firstLifecycleSeq: SessionLogOffset;\n get appId(): string | undefined;\n eventAt(seq: SessionSeq): SessionEvent | undefined;\n snapshotEvents(fromSeq: SessionLogOffset = SessionLogOffset(0), toSeqExclusive: SessionLogOffset = this.seq): readonly SessionEvent[];\n ownEvents(): readonly SessionEvent[];\n isOwnSeq(seq: SessionSeq): boolean;\n get seq(): SessionLogOffset;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n toolHistory(): ToolHistory;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
3161
3171
  },
3162
3172
  {
3163
3173
  "name": "SessionEvent",
@@ -3165,7 +3175,7 @@ export const TYPERT = {
3165
3175
  },
3166
3176
  {
3167
3177
  "name": "SessionEventMap",
3168
- "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}"
3178
+ "declaration": "export interface SessionEventMap {\n 'session/application': { appId: string; };\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}"
3169
3179
  },
3170
3180
  {
3171
3181
  "name": "SessionEventType",
@@ -28,7 +28,7 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
28
28
  page: (request: SessionPageRequest, signal?: AbortSignal) => Promise<RemoteResult<SessionPage>>
29
29
  projections: (request: SessionProjectionsRequest, signal?: AbortSignal) => Promise<RemoteResult<SessionProjectionsValue>>
30
30
  prompt: (request: SessionPromptRequest, signal?: AbortSignal) => Promise<RemoteResult<SessionPromptValue>>
31
- promptModelConfig: () => Promise<RemoteResult<{ version: 1; requestApiKey: true; unifiedOptions: true; }>>
31
+ promptModelConfig: () => Promise<RemoteResult<{ version: 1; requestApiKey: true; unifiedOptions: true; requestBaseUrl: true; }>>
32
32
  refreshModelCatalog: () => Promise<RemoteResult<ModelCatalog>>
33
33
  release: (request: SessionCancelRequest) => Promise<RemoteResult<{ readonly released: true; }>>
34
34
  rename: (request: SessionRenameRequest) => Promise<RemoteResult<SessionRenameValue>>
@@ -62,7 +62,7 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
62
62
  'session/page': (request: SessionPageRequest, signal?: AbortSignal) => Promise<RemoteResult<SessionPage>>
63
63
  'session/projections': (request: SessionProjectionsRequest, signal?: AbortSignal) => Promise<RemoteResult<SessionProjectionsValue>>
64
64
  'session/prompt': (request: SessionPromptRequest, signal?: AbortSignal) => Promise<RemoteResult<SessionPromptValue>>
65
- 'session/promptModelConfig': () => Promise<RemoteResult<{ version: 1; requestApiKey: true; unifiedOptions: true; }>>
65
+ 'session/promptModelConfig': () => Promise<RemoteResult<{ version: 1; requestApiKey: true; unifiedOptions: true; requestBaseUrl: true; }>>
66
66
  'session/refreshModelCatalog': () => Promise<RemoteResult<ModelCatalog>>
67
67
  'session/release': (request: SessionCancelRequest) => Promise<RemoteResult<{ readonly released: true; }>>
68
68
  'session/rename': (request: SessionRenameRequest) => Promise<RemoteResult<SessionRenameValue>>
@@ -77,6 +77,7 @@ const _deepseek_ai_dsh_api_session_controller_session_control_result$schema = ()
77
77
  'status': z.union([z.literal("completed"), z.literal("pending"), z.literal("in_progress")]),
78
78
  }))]).optional(),
79
79
  'sessionListMetadata': z.object({
80
+ 'appId': z.union([z.undefined(), z.string()]).readonly().optional(),
80
81
  'hasUserPrompt': z.boolean().readonly().optional(),
81
82
  'blank': z.boolean().readonly(),
82
83
  'lastPromptAt': z.union([z.literal(null), z.number()]).readonly(),
@@ -169,6 +170,7 @@ const _deepseek_ai_dsh_api_session_controller_session_control_result$schema = ()
169
170
  }))]))
170
171
  let _deepseek_ai_dsh_api_session_controller_session_create_parameter_0$schema$value
171
172
  const _deepseek_ai_dsh_api_session_controller_session_create_parameter_0$schema = () => (_deepseek_ai_dsh_api_session_controller_session_create_parameter_0$schema$value ??= z.object({
173
+ 'appId': z.string().readonly().optional(),
172
174
  'resumeOnly': z.boolean().readonly().optional(),
173
175
  'workspaceId': z.intersection(z.string(), z.unknown()).readonly().optional(),
174
176
  'cwd': z.string().readonly().optional(),
@@ -179,6 +181,7 @@ const _deepseek_ai_dsh_api_session_controller_session_create_parameter_0$schema
179
181
  }))
180
182
  let _deepseek_ai_dsh_api_session_controller_session_create_result$schema$value
181
183
  const _deepseek_ai_dsh_api_session_controller_session_create_result$schema = () => (_deepseek_ai_dsh_api_session_controller_session_create_result$schema$value ??= z.object({
184
+ 'appId': z.string().readonly().optional(),
182
185
  'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
183
186
  'agentPreset': z.string().readonly().optional(),
184
187
  }))
@@ -253,6 +256,7 @@ const _deepseek_ai_dsh_api_session_controller_session_follow_result$schema = ()
253
256
  'status': z.union([z.literal("completed"), z.literal("pending"), z.literal("in_progress")]),
254
257
  }))]).optional(),
255
258
  'sessionListMetadata': z.object({
259
+ 'appId': z.union([z.undefined(), z.string()]).readonly().optional(),
256
260
  'hasUserPrompt': z.boolean().readonly().optional(),
257
261
  'blank': z.boolean().readonly(),
258
262
  'lastPromptAt': z.union([z.literal(null), z.number()]).readonly(),
@@ -393,6 +397,7 @@ const _deepseek_ai_dsh_api_session_controller_session_list_parameter_0$schema =
393
397
  let _deepseek_ai_dsh_api_session_controller_session_list_result$schema$value
394
398
  const _deepseek_ai_dsh_api_session_controller_session_list_result$schema = () => (_deepseek_ai_dsh_api_session_controller_session_list_result$schema$value ??= z.object({
395
399
  'items': z.array(z.object({
400
+ 'appId': z.string().readonly().optional(),
396
401
  'agentAvailable': z.boolean().readonly(),
397
402
  'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
398
403
  'updatedAt': z.number().readonly(),
@@ -416,6 +421,7 @@ const _deepseek_ai_dsh_api_session_controller_session_list_result$schema = () =>
416
421
  'status': z.union([z.literal("completed"), z.literal("pending"), z.literal("in_progress")]),
417
422
  }))]).optional(),
418
423
  'sessionListMetadata': z.object({
424
+ 'appId': z.union([z.undefined(), z.string()]).readonly().optional(),
419
425
  'hasUserPrompt': z.boolean().readonly().optional(),
420
426
  'blank': z.boolean().readonly(),
421
427
  'lastPromptAt': z.union([z.literal(null), z.number()]).readonly(),
@@ -602,6 +608,7 @@ const _deepseek_ai_dsh_api_session_controller_session_projections_result$schema
602
608
  'status': z.union([z.literal("completed"), z.literal("pending"), z.literal("in_progress")]),
603
609
  }))]).optional(),
604
610
  'sessionListMetadata': z.object({
611
+ 'appId': z.union([z.undefined(), z.string()]).readonly().optional(),
605
612
  'hasUserPrompt': z.boolean().readonly().optional(),
606
613
  'blank': z.boolean().readonly(),
607
614
  'lastPromptAt': z.union([z.literal(null), z.number()]).readonly(),
@@ -707,6 +714,7 @@ const _deepseek_ai_dsh_api_session_controller_session_prompt_parameter_0$schema
707
714
  'provider': z.string().readonly(),
708
715
  'model': z.string().readonly(),
709
716
  'protocol': z.string().readonly().optional(),
717
+ 'baseUrl': z.string().readonly().optional(),
710
718
  'apiKey': z.string().readonly().optional(),
711
719
  'options': z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema2())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema2()))])).readonly().readonly(),
712
720
  'protocolOptions': z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema2())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema2()))])).readonly().readonly().optional(),
@@ -721,6 +729,7 @@ const _deepseek_ai_dsh_api_session_controller_session_promptModelConfig_result$s
721
729
  'version': z.literal(1),
722
730
  'requestApiKey': z.literal(true),
723
731
  'unifiedOptions': z.literal(true),
732
+ 'requestBaseUrl': z.literal(true),
724
733
  }))
725
734
  let _deepseek_ai_dsh_api_session_controller_session_refreshModelCatalog_result$schema$value
726
735
  const _deepseek_ai_dsh_api_session_controller_session_refreshModelCatalog_result$schema = () => (_deepseek_ai_dsh_api_session_controller_session_refreshModelCatalog_result$schema$value ??= z.object({
@@ -787,6 +796,7 @@ const _deepseek_ai_dsh_api_session_controller_session_resume_parameter_0$schema
787
796
  }))
788
797
  let _deepseek_ai_dsh_api_session_controller_session_resume_result$schema$value
789
798
  const _deepseek_ai_dsh_api_session_controller_session_resume_result$schema = () => (_deepseek_ai_dsh_api_session_controller_session_resume_result$schema$value ??= z.object({
799
+ 'appId': z.string().readonly().optional(),
790
800
  'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
791
801
  'selected': z.object({
792
802
  'provider': z.string().readonly(),
@@ -139,9 +139,10 @@ export declare class ApiSessionAgentController {
139
139
  * @param existingOnly - refuse a cold identity that does not exist instead of creating it.
140
140
  * @param provider - optional provider override for the model selection.
141
141
  * @param model - optional model override for the model selection.
142
+ * @param appId - application identity for new Sessions.
142
143
  * @returns the matching live ordinary Agent.
143
144
  */
144
- ensureSession(sessionId: SessionId, cwd: string | undefined, checkPersistedIdentity: boolean, presetId?: string, existingOnly?: boolean, provider?: string, model?: string): Promise<Agent>;
145
+ ensureSession(sessionId: SessionId, cwd: string | undefined, checkPersistedIdentity: boolean, presetId?: string, existingOnly?: boolean, provider?: string, model?: string, appId?: string): Promise<Agent>;
145
146
  /**
146
147
  * Install or return the Session-local model selection used by prompt assembly.
147
148
  * @param agent - live Agent that owns the selection.
@@ -417,15 +417,16 @@ export class ApiSessionAgentController {
417
417
  * @param existingOnly - refuse a cold identity that does not exist instead of creating it.
418
418
  * @param provider - optional provider override for the model selection.
419
419
  * @param model - optional model override for the model selection.
420
+ * @param appId - application identity for new Sessions.
420
421
  * @returns the matching live ordinary Agent.
421
422
  */
422
- async ensureSession(sessionId, cwd, checkPersistedIdentity, presetId, existingOnly = false, provider, model) {
423
+ async ensureSession(sessionId, cwd, checkPersistedIdentity, presetId, existingOnly = false, provider, model, appId) {
423
424
  const releasing = this.releases.get(sessionId);
424
425
  if (releasing !== undefined)
425
426
  await releasing;
426
427
  let creation = this.creations.get(sessionId);
427
428
  if (creation === undefined) {
428
- creation = this.createOrAdopt(sessionId, cwd, checkPersistedIdentity, presetId, existingOnly, provider, model)
429
+ creation = this.createOrAdopt(sessionId, cwd, checkPersistedIdentity, presetId, existingOnly, provider, model, appId)
429
430
  .catch((error) => {
430
431
  const live = this.ctx.agents.get(sessionId);
431
432
  if (live !== undefined) {
@@ -624,7 +625,7 @@ export class ApiSessionAgentController {
624
625
  setup: composition.setup,
625
626
  }))).agent;
626
627
  }
627
- async createOrAdopt(sessionId, cwd, checkPersistedIdentity, presetId, existingOnly, provider, model) {
628
+ async createOrAdopt(sessionId, cwd, checkPersistedIdentity, presetId, existingOnly, provider, model, appId) {
628
629
  const attached = this.ctx.sessions.get(sessionId);
629
630
  const live = this.ctx.agents.get(sessionId);
630
631
  if (attached !== undefined && hasApiSessionSubagentOwner(this.ctx, attached, live)) {
@@ -682,6 +683,7 @@ export class ApiSessionAgentController {
682
683
  agentOptions: this.agentOptions(provider, model),
683
684
  meta: {
684
685
  cwd,
686
+ ...(appId === undefined ? {} : { appId }),
685
687
  ...(composition.agentPreset === undefined ? {} : { agentPreset: composition.agentPreset }),
686
688
  },
687
689
  setup: composition.setup,
@@ -105,6 +105,9 @@ export class SessionCommandController {
105
105
  * @returns the Session identity and resolved preset when configured.
106
106
  */
107
107
  async create(request) {
108
+ if (request.appId !== undefined && (typeof request.appId !== 'string' || !/^[\x21-\x7e]{1,128}$/u.test(request.appId))) {
109
+ throw new RemoteError('gateway/bad-request', 'appId must contain 1 to 128 visible ASCII characters', {});
110
+ }
108
111
  if (request.resumeOnly === true && !request.sessionId) {
109
112
  throw new RemoteError('gateway/bad-request', 'resumeOnly requires a sessionId', {});
110
113
  }
@@ -125,7 +128,7 @@ export class SessionCommandController {
125
128
  const cwd = workspace?.path ?? request.cwd ?? this.defaultCwd;
126
129
  let adopted;
127
130
  try {
128
- adopted = await this.agents.ensureSession(sessionId, cwd, request.sessionId !== undefined, request.agentPreset, request.resumeOnly === true, request.provider, request.model);
131
+ adopted = await this.agents.ensureSession(sessionId, cwd, request.sessionId !== undefined, request.agentPreset, request.resumeOnly === true, request.provider, request.model, request.appId);
129
132
  }
130
133
  catch (error) {
131
134
  this.rejectCreation(sessionId, error);
@@ -139,7 +142,8 @@ export class SessionCommandController {
139
142
  }
140
143
  }
141
144
  const agentPreset = this.agents.presetForSession(adopted.session);
142
- return { sessionId, ...(agentPreset === undefined ? {} : { agentPreset }) };
145
+ const appId = adopted.session.appId;
146
+ return { sessionId, ...(agentPreset === undefined ? {} : { agentPreset }), ...(appId === undefined ? {} : { appId }) };
143
147
  }
144
148
  /**
145
149
  * Validate against the live registry and persist the default, then install one
@@ -566,6 +570,7 @@ export class SessionCommandController {
566
570
  const current = selection.current;
567
571
  return {
568
572
  sessionId,
573
+ ...(agent.session.appId === undefined ? {} : { appId: agent.session.appId }),
569
574
  selected: {
570
575
  provider: current.provider,
571
576
  model: current.model,
@@ -666,7 +671,7 @@ function validatePromptModelConfig(request) {
666
671
  throw invalidModelConfig('modelConfig');
667
672
  const object = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
668
673
  if (config === undefined || !object(config) || !isJsonValue(config)
669
- || Object.keys(config).some(key => !['provider', 'model', 'protocol', 'options', 'protocolOptions', 'apiKey'].includes(key))
674
+ || Object.keys(config).some(key => !['provider', 'model', 'protocol', 'options', 'protocolOptions', 'apiKey', 'baseUrl'].includes(key))
670
675
  || Buffer.byteLength(JSON.stringify(config)) > 16_384)
671
676
  throw invalidModelConfig('modelConfig');
672
677
  for (const key of ['provider', 'model', 'protocol']) {
@@ -240,6 +240,7 @@ export declare class SessionController extends TypertRemoteService {
240
240
  version: 1;
241
241
  requestApiKey: true;
242
242
  unifiedOptions: true;
243
+ requestBaseUrl: true;
243
244
  };
244
245
  /**
245
246
  * Admit one prompt after explicitly resuming its Session.
@@ -698,7 +698,7 @@ let SessionController = (() => {
698
698
  * @returns Supported model configuration version.
699
699
  */
700
700
  promptModelConfig() {
701
- return { version: 1, requestApiKey: true, unifiedOptions: true };
701
+ return { version: 1, requestApiKey: true, unifiedOptions: true, requestBaseUrl: true };
702
702
  }
703
703
  /**
704
704
  * Admit one prompt after explicitly resuming its Session.
@@ -8,6 +8,7 @@ const SEARCH_PROVIDER_CALL_LIMIT = 100;
8
8
  const SESSION_SEARCH_QUERY_MAX_CHARS = 500;
9
9
  const MESSAGE_TYPES = new Set(['user/message', 'assistant/message']);
10
10
  const sessionListMetadataSchema = z.object({
11
+ appId: z.string().optional(),
11
12
  hasUserPrompt: z.boolean().default(false),
12
13
  blank: z.boolean(),
13
14
  lastPromptAt: z.number().nullable(),
@@ -32,9 +33,10 @@ export function applySessionListMetadata(state, event) {
32
33
  const lastPromptAt = event.type === 'user/message' && event.data.source.kind === 'user'
33
34
  ? event.time
34
35
  : state.lastPromptAt;
35
- return blank === state.blank && lastPromptAt === state.lastPromptAt && hasUserPrompt === state.hasUserPrompt
36
+ const appId = state.appId ?? (event.type === 'session/application' ? event.data.appId : undefined);
37
+ return appId === state.appId && blank === state.blank && lastPromptAt === state.lastPromptAt && hasUserPrompt === state.hasUserPrompt
36
38
  ? state
37
- : { blank, lastPromptAt, hasUserPrompt };
39
+ : { blank, lastPromptAt, hasUserPrompt, ...(appId === undefined ? {} : { appId }) };
38
40
  }
39
41
  /** User-origin text or media is conversation input; injected context is not. */
40
42
  function hasHumanInput(event) {
@@ -76,7 +78,7 @@ export class ApiSessionList {
76
78
  init: () => ({ blank: true, lastPromptAt: null, hasUserPrompt: false }),
77
79
  apply: applySessionListMetadata,
78
80
  wire: { viewSchema: sessionListMetadataSchema, view: state => state },
79
- stateVersion: 2,
81
+ stateVersion: 3,
80
82
  });
81
83
  ctx.effect(() => async () => {
82
84
  this.backfillAbort.abort();
@@ -115,6 +117,7 @@ export class ApiSessionList {
115
117
  running: this.ctx.agents.get(session.id)?.status === 'running',
116
118
  blank: metadata?.blank ?? session.seq === 0,
117
119
  ...listFields(session.header),
120
+ ...(session.appId === undefined ? {} : { appId: session.appId }),
118
121
  ...(projections === undefined ? {} : { projections }),
119
122
  };
120
123
  }
@@ -165,6 +168,7 @@ export class ApiSessionList {
165
168
  // A large, metadata-less, or inaccessible cache miss remains unknown and visible.
166
169
  blank: metadata?.blank ?? false,
167
170
  ...listFields(header),
171
+ ...(metadata?.appId === undefined ? {} : { appId: metadata.appId }),
168
172
  ...(projections === undefined ? {} : { projections }),
169
173
  };
170
174
  }
@@ -37,6 +37,7 @@ declare module '@deepseek-ai/dsh-session/types' {
37
37
  }
38
38
  /** Persisted hints used to summarize a cold Session. */
39
39
  export interface SessionListMetadata {
40
+ readonly appId?: string | undefined;
40
41
  /** Real user input exists in this prefix; absent in older cached views. */
41
42
  readonly hasUserPrompt?: boolean;
42
43
  /** Whether the folded prefix contains no turn. */
@@ -171,6 +172,8 @@ export type QueueAction = {
171
172
  };
172
173
  /** One Session list entry. */
173
174
  export interface SessionSummary {
175
+ /** Application originally recorded in the Session log; absent for legacy Sessions. */
176
+ readonly appId?: string;
174
177
  /** Whether this Session currently owns a live Agent. */
175
178
  readonly agentAvailable: boolean;
176
179
  readonly sessionId: SessionId;
@@ -344,6 +347,8 @@ export interface SessionSearchValue {
344
347
  }
345
348
  /** Session creation or explicit-id adoption request. */
346
349
  export interface SessionCreateRequest {
350
+ /** Application metadata supplied by the SDK; no application authorization is performed. */
351
+ readonly appId?: string;
347
352
  /** Refuse a missing explicit identity instead of creating a replacement Session. */
348
353
  readonly resumeOnly?: boolean;
349
354
  readonly workspaceId?: WorkspaceId;
@@ -357,6 +362,8 @@ export interface SessionCreateRequest {
357
362
  }
358
363
  /** Session creation response value. */
359
364
  export interface SessionCreateValue {
365
+ /** Application originally recorded in the Session log; absent for legacy Sessions. */
366
+ readonly appId?: string;
360
367
  readonly sessionId: SessionId;
361
368
  readonly agentPreset?: string;
362
369
  }
@@ -390,6 +397,8 @@ export interface SessionResumeRequest {
390
397
  }
391
398
  /** Session resume response value. */
392
399
  export interface SessionResumeValue {
400
+ /** Application originally recorded in the Session log; absent for legacy Sessions. */
401
+ readonly appId?: string;
393
402
  readonly sessionId: SessionId;
394
403
  /** The resolved model selection for this Session. */
395
404
  readonly selected: ModelSelection;
@@ -927,7 +927,7 @@ export const TYPERT = {
927
927
  },
928
928
  {
929
929
  "name": "LlmCallConfig",
930
- "declaration": "export interface LlmCallConfig {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n contextWindow?: number;\n protocol?: string;\n protocolOptions?: Readonly<Record<string, JsonValue>>;\n}"
930
+ "declaration": "export interface LlmCallConfig {\n baseUrl?: string;\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n contextWindow?: number;\n protocol?: string;\n protocolOptions?: Readonly<Record<string, JsonValue>>;\n}"
931
931
  },
932
932
  {
933
933
  "name": "LlmCallConfigAdapterDefaults",
@@ -1059,7 +1059,7 @@ export const TYPERT = {
1059
1059
  },
1060
1060
  {
1061
1061
  "name": "Session",
1062
- "declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n readonly inheritedEventCount: SessionLogOffset;\n get id(): SessionId;\n readonly firstLiveSeq: SessionLogOffset;\n readonly firstLifecycleSeq: SessionLogOffset;\n eventAt(seq: SessionSeq): SessionEvent | undefined;\n snapshotEvents(fromSeq: SessionLogOffset = SessionLogOffset(0), toSeqExclusive: SessionLogOffset = this.seq): readonly SessionEvent[];\n ownEvents(): readonly SessionEvent[];\n isOwnSeq(seq: SessionSeq): boolean;\n get seq(): SessionLogOffset;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n toolHistory(): ToolHistory;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
1062
+ "declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n readonly inheritedEventCount: SessionLogOffset;\n get id(): SessionId;\n readonly firstLiveSeq: SessionLogOffset;\n readonly firstLifecycleSeq: SessionLogOffset;\n get appId(): string | undefined;\n eventAt(seq: SessionSeq): SessionEvent | undefined;\n snapshotEvents(fromSeq: SessionLogOffset = SessionLogOffset(0), toSeqExclusive: SessionLogOffset = this.seq): readonly SessionEvent[];\n ownEvents(): readonly SessionEvent[];\n isOwnSeq(seq: SessionSeq): boolean;\n get seq(): SessionLogOffset;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n toolHistory(): ToolHistory;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
1063
1063
  },
1064
1064
  {
1065
1065
  "name": "SessionEvent",
@@ -1067,7 +1067,7 @@ export const TYPERT = {
1067
1067
  },
1068
1068
  {
1069
1069
  "name": "SessionEventMap",
1070
- "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}"
1070
+ "declaration": "export interface SessionEventMap {\n 'session/application': { appId: string; };\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}"
1071
1071
  },
1072
1072
  {
1073
1073
  "name": "SessionEventType",