@chatcode/chatcode-cli 3.0.6-rc.1 → 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 (77) hide show
  1. package/lib/{command-errors-CnbcOM1a.js → command-errors-vCFKCJFq.js} +12 -12
  2. package/lib/{command-trees-CU7BxVJo.js → command-trees-N2_LR4f-.js} +2 -2
  3. package/lib/{component-identity-kZK1_hFy.js → component-identity-CaV_MmmE.js} +3 -3
  4. package/lib/{extension-events-hLxwPvpg.js → extension-events-B5qKP0-X.js} +20 -20
  5. package/lib/{host-access-kT-u85k_.js → host-access-BRXW3V8i.js} +1 -1
  6. package/lib/{keymap-DS1M8sDo.js → keymap-BYjklwli.js} +2 -2
  7. package/lib/{plugin-BccFcAte.js → plugin-VYAv2o0K.js} +497 -347
  8. package/lib/{scenes-DG6T8t-A.js → scenes-B-iDMpgW.js} +3 -3
  9. package/lib/{settings-sections-2SuE0biI.js → settings-sections-CYCrZKUk.js} +3 -3
  10. package/lib/{statusBarSettings-B2MEAwnI.js → statusBarSettings-Cu-b_o4Q.js} +3 -3
  11. package/lib/{themes-DUO7kGW-.js → themes-DC9GpV6q.js} +12 -12
  12. package/lib/tui-compat-command-trees.js +1 -1
  13. package/lib/tui-compat-extensions.js +3 -3
  14. package/lib/tui-compat-plugin-host.js +5 -5
  15. package/lib/tui-compat-scenes.js +1 -1
  16. package/lib/tui-compat-settings-sections.js +1 -1
  17. package/lib/tui-compat-working-activity.js +1 -1
  18. package/lib/tui-compat-workspaces.js +1 -1
  19. package/lib/tui-compat.js +6 -6
  20. package/lib/{workspaces-CLOkL_yE.js → workspaces-BchdRzlw.js} +2 -2
  21. package/package.json +25 -25
  22. package/runtime/manifest.json +1 -1
  23. package/runtime/node_modules/@chatcode/runtime-client/README.md +11 -8
  24. package/runtime/node_modules/@chatcode/runtime-client/index.d.ts +6 -12
  25. package/runtime/node_modules/@chatcode/runtime-client/package.json +1 -1
  26. package/runtime/node_modules/@chatcode/runtime-client/runtime-connector.mjs +16 -16
  27. package/runtime/node_modules/@chatcode/runtime-client/session-browser.mjs +1 -0
  28. package/runtime/node_modules/@deepseek-ai/dsh-agent-loop/lib/index.js +1 -1
  29. package/runtime/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/typert.host.js +3 -3
  30. package/runtime/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +14 -4
  31. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/client.js +1 -0
  32. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/index.js +23 -10
  33. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +23 -13
  34. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.d.ts +2 -2
  35. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.js +10 -0
  36. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/agent.d.ts +2 -1
  37. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/agent.js +5 -3
  38. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/commands.js +8 -3
  39. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/controller.js +1 -1
  40. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.d.ts +1 -0
  41. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.js +1 -1
  42. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/list.js +7 -3
  43. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/types.d.ts +9 -0
  44. package/runtime/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/typert.host.js +3 -3
  45. package/runtime/node_modules/@deepseek-ai/dsh-client-file-upload/lib/typert.host.js +3 -3
  46. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/client.js +2 -2
  47. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/types/index.d.ts +2 -2
  48. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +1 -1
  49. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
  50. package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/typert.host.js +3 -3
  51. package/runtime/node_modules/@deepseek-ai/dsh-cordis-host-runner/lib/typert.host.js +6 -6
  52. package/runtime/node_modules/@deepseek-ai/dsh-goal/lib/typert.host.js +3 -3
  53. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/index.js +17 -1
  54. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/typert.host.js +6 -6
  55. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/typert.remote-client.js +3 -3
  56. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/call-config.d.ts +4 -0
  57. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/call-config.js +1 -0
  58. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/index.js +24 -0
  59. package/runtime/node_modules/@deepseek-ai/dsh-llm/lib/types/types.d.ts +2 -0
  60. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/index.js +7 -0
  61. package/runtime/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/index.js +15 -4
  62. package/runtime/node_modules/@deepseek-ai/dsh-permission-presets/lib/typert.host.js +3 -3
  63. package/runtime/node_modules/@deepseek-ai/dsh-repeat-tool-reminder/lib/index.js +16 -1
  64. package/runtime/node_modules/@deepseek-ai/dsh-session/lib/index.js +12 -1
  65. package/runtime/node_modules/@deepseek-ai/dsh-session/lib/types/index.d.ts +2 -0
  66. package/runtime/node_modules/@deepseek-ai/dsh-session/lib/types/index.js +13 -1
  67. package/runtime/node_modules/@deepseek-ai/dsh-session/lib/types/known-event-types.js +1 -0
  68. package/runtime/node_modules/@deepseek-ai/dsh-session/lib/types/types.d.ts +5 -0
  69. package/runtime/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/worker.cjs +22 -1
  70. package/runtime/node_modules/@deepseek-ai/dsh-session-reference/lib/typert.host.js +3 -3
  71. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/index.js +1 -0
  72. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/typert.host.js +3 -3
  73. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/child-agent.js +1 -0
  74. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/control.d.ts +1 -1
  75. package/runtime/node_modules/@deepseek-ai/dsh-tmux-context/lib/index.js +16 -1
  76. package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +83 -20
  77. package/runtime/node_modules/@deepseek-ai/node-addon-system/lib/.tsbuildinfo +1 -1
@@ -340,7 +340,7 @@ export const TYPERT = {
340
340
  },
341
341
  {
342
342
  "name": "LlmCallConfig",
343
- "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}"
343
+ "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}"
344
344
  },
345
345
  {
346
346
  "name": "LlmCallConfigAdapterDefaults",
@@ -476,7 +476,7 @@ export const TYPERT = {
476
476
  },
477
477
  {
478
478
  "name": "Session",
479
- "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}"
479
+ "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}"
480
480
  },
481
481
  {
482
482
  "name": "SessionEvent",
@@ -484,7 +484,7 @@ export const TYPERT = {
484
484
  },
485
485
  {
486
486
  "name": "SessionEventMap",
487
- "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}"
487
+ "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}"
488
488
  },
489
489
  {
490
490
  "name": "SessionEventType",
@@ -472,6 +472,7 @@ function childSessionMeta(parent, childDepth, isSeeded) {
472
472
  const agentPreset = parent.ctx.get("agentPresets")?.composedPreset(parent.ctx);
473
473
  return {
474
474
  ...parentHeader.cwd !== void 0 ? { cwd: parentHeader.cwd } : {},
475
+ ...parent.session.appId === void 0 ? {} : { appId: parent.session.appId },
475
476
  ...agentPreset === void 0 ? {} : { agentPreset },
476
477
  parentSession: parentHeader.id,
477
478
  isSeeded,
@@ -492,7 +492,7 @@ export const TYPERT = {
492
492
  },
493
493
  {
494
494
  "name": "LlmCallConfig",
495
- "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}"
495
+ "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}"
496
496
  },
497
497
  {
498
498
  "name": "LlmCallConfigAdapterDefaults",
@@ -636,7 +636,7 @@ export const TYPERT = {
636
636
  },
637
637
  {
638
638
  "name": "Session",
639
- "declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n readonly inheritedEventCount: SessionLogOffset;\n get id(): SessionId;\n readonly firstLiveSeq: SessionLogOffset;\n readonly firstLifecycleSeq: SessionLogOffset;\n eventAt(seq: SessionSeq): SessionEvent | undefined;\n snapshotEvents(fromSeq: SessionLogOffset = SessionLogOffset(0), toSeqExclusive: SessionLogOffset = this.seq): readonly SessionEvent[];\n ownEvents(): readonly SessionEvent[];\n isOwnSeq(seq: SessionSeq): boolean;\n get seq(): SessionLogOffset;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n toolHistory(): ToolHistory;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
639
+ "declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n readonly inheritedEventCount: SessionLogOffset;\n get id(): SessionId;\n readonly firstLiveSeq: SessionLogOffset;\n readonly firstLifecycleSeq: SessionLogOffset;\n 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}"
640
640
  },
641
641
  {
642
642
  "name": "SessionEvent",
@@ -644,7 +644,7 @@ export const TYPERT = {
644
644
  },
645
645
  {
646
646
  "name": "SessionEventMap",
647
- "declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'developer/message': { turn: number; step: number; message: DeveloperMessage; headerSeq?: SessionSeq; };\n 'system/message': { turn: number; step: number; message: SystemMessage; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; stream: AssistantStreamRecord[]; usage?: TokenUsage; interrupted?: true; };\n 'assistant/attempt': { turn: number; step: number; stream: AssistantStreamRecord[]; };\n 'tool/call': { turn: number; step: number; callId: ToolCallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; reason?: string; }; meta?: JsonValue; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; startsSeries?: true; };\n 'request/context': RequestContext;\n 'session/end-seed': { inherited?: true; };\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: ToolCallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'tool/ptc-dispatch-start': PtcDispatchStartEventData;\n 'tool/ptc-dispatch': PtcDispatchEventData;\n 'agent-preset/selected': { agentPreset: string; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: import('@deepseek-ai/dsh-session/types').SessionSeq; };\n 'image/offload': { targets: ImageOffloadTarget[]; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'model/selection': ModelSelection;\n 'subagent/descriptor': SubagentDescriptorData;\n 'permission/preset': { preset: string; };\n 'subagent/catalog': SubagentCatalogEvent;\n 'feedback/record': FeedbackRecord;\n 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n 'schedule/change': ScheduleChange;\n 'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; };\n 'compaction/summary': { compactionId: CompactionId; sourceCommandId?: CommandId; summary: ContentBlock[]; shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; provider: string; model: string; maxTokens?: number; usage?: TokenUsage; } & ({ rawOutput: ContentBlock[]; llmStreamCall: true; } | { rawOutput?: ContentBlock[]; llmStreamCall?: never; });\n 'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string; };\n 'compaction/prune': { shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; };\n}"
647
+ "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}"
648
648
  },
649
649
  {
650
650
  "name": "SessionEventType",
@@ -113,6 +113,7 @@ export function childSessionMeta(parent, childDepth, isSeeded) {
113
113
  const agentPreset = parent.ctx.get('agentPresets')?.composedPreset(parent.ctx);
114
114
  return {
115
115
  ...parentHeader.cwd !== undefined ? { cwd: parentHeader.cwd } : {},
116
+ ...parent.session.appId === undefined ? {} : { appId: parent.session.appId },
116
117
  ...agentPreset === undefined ? {} : { agentPreset },
117
118
  parentSession: parentHeader.id,
118
119
  isSeeded,
@@ -12,8 +12,8 @@ declare const CONTROL_ID_SCHEMAS: {
12
12
  childSessionId: z.ZodString;
13
13
  mode: z.ZodLiteral<"continuable">;
14
14
  delivery: z.ZodEnum<{
15
- queue: "queue";
16
15
  steer: "steer";
16
+ queue: "queue";
17
17
  }>;
18
18
  }, z.core.$strip>;
19
19
  readonly 'subagent.interrupt': z.ZodObject<{
@@ -479,7 +479,7 @@ function ReasoningEffortId(id) {
479
479
  * @returns whether every field (including the `stop` list, element-wise) matches.
480
480
  */
481
481
  function callConfigEquals(a, b) {
482
- if (a.provider !== b.provider || a.model !== b.model || a.reasoningEffort !== b.reasoningEffort || a.temperature !== b.temperature || a.maxTokens !== b.maxTokens || a.contextWindow !== b.contextWindow || a.protocol !== b.protocol || !deepEqualJson(a.protocolOptions, b.protocolOptions)) return false;
482
+ if (a.provider !== b.provider || a.model !== b.model || a.reasoningEffort !== b.reasoningEffort || a.temperature !== b.temperature || a.maxTokens !== b.maxTokens || a.contextWindow !== b.contextWindow || a.protocol !== b.protocol || a.baseUrl !== b.baseUrl || !deepEqualJson(a.protocolOptions, b.protocolOptions)) return false;
483
483
  if (a.stop === void 0 || b.stop === void 0) return a.stop === b.stop;
484
484
  return a.stop.length === b.stop.length && a.stop.every((s, i) => s === b.stop?.[i]);
485
485
  }
@@ -1370,6 +1370,17 @@ function validatePromptProtocolOptions(options) {
1370
1370
  model,
1371
1371
  ...protocol === void 0 ? {} : { protocol }
1372
1372
  };
1373
+ if (request.baseUrl !== void 0) {
1374
+ let endpoint;
1375
+ try {
1376
+ endpoint = new URL(request.baseUrl);
1377
+ } catch (_invalidEndpoint) {
1378
+ throw new LlmError("baseUrl", "UNSUPPORTED_OPTION");
1379
+ }
1380
+ if (typeof request.baseUrl !== "string" || request.baseUrl !== request.baseUrl.trim() || !["http:", "https:"].includes(endpoint.protocol) || !endpoint.hostname || endpoint.username || endpoint.password || endpoint.search || endpoint.hash) throw new LlmError("baseUrl", "UNSUPPORTED_OPTION");
1381
+ if (request.apiKey === void 0) throw new LlmError("apiKey", "UNSUPPORTED_OPTION");
1382
+ config.baseUrl = request.baseUrl;
1383
+ }
1373
1384
  const forwarded = new Map(Object.entries(protocolOptions ?? {}));
1374
1385
  for (const [key, value] of Object.entries(options)) {
1375
1386
  const invalid = () => new LlmError(`options.${key}`, "UNSUPPORTED_OPTION");
@@ -1437,6 +1448,10 @@ function validatePromptProtocolOptions(options) {
1437
1448
  async prepareCall(config, signal, promptApiKey) {
1438
1449
  const registration = this.registration(config.provider);
1439
1450
  if (promptApiKey !== void 0 && !registration.adapter.supportsPromptApiKey(config.provider, config.model)) throw new LlmError("This model route cannot use a prompt API key", "UNSUPPORTED_OPTION");
1451
+ if (config.baseUrl !== void 0) {
1452
+ if (promptApiKey === void 0) throw new LlmError("apiKey", "UNSUPPORTED_OPTION");
1453
+ registration.adapter.validatePromptProtocol(config);
1454
+ }
1440
1455
  const adapterCall = await registration.adapter.prepareCall(config.provider, config.model, signal);
1441
1456
  const modelInfo = this.normalizeModelInfo(registration, config.model, adapterCall.model);
1442
1457
  const resolved = this.resolveCallWithInfo(config, modelInfo);
@@ -42,6 +42,11 @@ export const SERVICE_API = [
42
42
  parameters: [],
43
43
  returns: 'The saved provider/model/name tuple, or undefined for missing or invalid name metadata.',
44
44
  },
45
+ {
46
+ signature: 'setCurrentSelection(next: ModelSelection): void',
47
+ description: 'Update the in-memory current selection without persisting to disk. Used by the desktop-injection flow where the AI workbench controls model selection and the Runtime must not write credentials or choices to disk.',
48
+ parameters: [{ name: 'next', description: 'model selection to use in memory.' }],
49
+ },
45
50
  {
46
51
  signature: 'async saveSelection(next: ModelSelection, name?: string): Promise<void>',
47
52
  description: 'Save the complete default model selection to the shared ChatCode Home file, or the owning profile entry in other deployments. Saves commit in submission order; a failed save rejects its caller without blocking later saves. A shared save uses the caller\'s already resolved catalog name without an additional lookup.',
@@ -1403,9 +1408,15 @@ export const SERVICE_API = [
1403
1408
  returns: 'a detached config only when a default must be materialized.',
1404
1409
  },
1405
1410
  {
1406
- signature: 'async prepareCall(config: LlmCallConfig, signal?: AbortSignal): Promise<PreparedLlmCall>',
1411
+ signature: 'resolvePromptConfig(request: LlmPromptModelConfig): LlmCallConfig',
1412
+ description: 'Resolve prompt controls before queue admission, without contacting the upstream API.',
1413
+ parameters: [{ name: 'request', description: 'Validated JSON model configuration from the prompt transport.' }],
1414
+ returns: 'Controls safe to persist with the queued user message.',
1415
+ },
1416
+ {
1417
+ signature: 'async prepareCall(config: LlmCallConfig, signal?: AbortSignal, promptApiKey?: string): Promise<PreparedLlmCall>',
1407
1418
  description: 'Resolve one call under its current adapter registration. The returned one-shot handle keeps that registration across header logging and dispatch, so HMR cannot combine one adapter\'s capability result with another adapter.',
1408
- parameters: [{ name: 'config', description: 'provider/model route and optional request controls.' }, { name: 'signal', description: 'optional cancellation for adapter-owned capability lookup.' }],
1419
+ parameters: [{ name: 'config', description: 'provider/model route and optional request controls.' }, { name: 'signal', description: 'optional cancellation for adapter-owned capability lookup.' }, { name: 'promptApiKey', description: 'in-memory credential bound to this call and kept out of request events.' }],
1409
1420
  returns: 'a prepared config and its registration-bound stream entry point.',
1410
1421
  },
1411
1422
  {
@@ -1889,6 +1900,24 @@ export const SERVICE_API = [
1889
1900
  parameters: [{ name: 'request', description: 'ordinary Session identity owned by this controller.' }],
1890
1901
  returns: 'acknowledgement after persistence has drained and unlocked.',
1891
1902
  },
1903
+ {
1904
+ signature: '@Remote(\'setLoginToken\') async setLoginToken(request: SessionSetLoginTokenRequest): Promise<SessionSetLoginTokenValue>',
1905
+ description: 'Inject a ChatCode OAuth grant into the credentials service.\n\nThe desktop AI workbench calls this after completing OAuth to provide the access token and optional metadata (refreshToken, expiry, user info). The grant is stored in the credentials service (persisted to disk, encrypted) using the same credential key as ChatCodeAuthService, so the auth bundle automatically reads it without any modification.\n\nToken expiry is detected by API 401 responses, not by local clock. When the token expires, the LLM adapter returns API 401 naturally.',
1906
+ parameters: [{ name: 'request', description: 'ChatCode OAuth grant fields.' }],
1907
+ returns: 'confirmation.',
1908
+ },
1909
+ {
1910
+ signature: '@Remote(\'clearLoginToken\') async clearLoginToken(_request: SessionClearLoginTokenRequest): Promise<SessionClearLoginTokenValue>',
1911
+ description: 'Remove the ChatCode OAuth token from the credentials service.',
1912
+ parameters: [{ name: '_request', description: 'unused (no params needed).' }],
1913
+ returns: 'confirmation.',
1914
+ },
1915
+ {
1916
+ signature: '@Remote(\'resume\') resume(request: SessionResumeRequest): Promise<SessionResumeValue>',
1917
+ description: 'Resume an existing Session, optionally with provider/model overrides. The Session must already exist in persistence. Desktop AI workbenches use this after Runtime restart to re-inject the model selection.',
1918
+ parameters: [{ name: 'request', description: 'Session identity and optional provider/model override.' }],
1919
+ returns: 'the Session identity and resolved model selection.',
1920
+ },
1892
1921
  {
1893
1922
  signature: '@Remote(\'selectModel\') selectModel(request: SessionSelectModelRequest): Promise<SessionSelectModelValue>',
1894
1923
  description: 'Select a model after explicitly resuming the Session and awaiting default persistence.',
@@ -1951,6 +1980,12 @@ export const SERVICE_API = [
1951
1980
  parameters: [{ name: 'request', description: 'source Session and optional exact inclusive event boundary.' }],
1952
1981
  returns: 'the new Session identity.',
1953
1982
  },
1983
+ {
1984
+ signature: '@Remote(\'promptModelConfig\') promptModelConfig(): { version: 1; requestApiKey: true; unifiedOptions: true; requestBaseUrl: true }',
1985
+ description: 'Advertise support for request-local model configuration.',
1986
+ parameters: [],
1987
+ returns: 'Supported model configuration version.',
1988
+ },
1954
1989
  {
1955
1990
  signature: '@Remote(\'prompt\') prompt(request: SessionPromptRequest, signal: AbortSignal): Promise<SessionPromptValue>',
1956
1991
  description: 'Admit one prompt after explicitly resuming its Session.',
@@ -1994,7 +2029,7 @@ export const SERVICE_API = [
1994
2029
  returns: 'complete baseline, or null when the Session does not exist.',
1995
2030
  },
1996
2031
  {
1997
- signature: '@Remote({ mode: \'stream\' }) control(signal: AbortSignal): AsyncIterable<SessionControlFrame>',
2032
+ signature: '@Remote({ mode: \'stream\' }) async *control(signal: AbortSignal): AsyncIterable<SessionControlFrame>',
1998
2033
  description: 'Stream a complete live-control baseline followed by replacement frames.',
1999
2034
  parameters: [{ name: 'signal', description: 'cancellation owned by the Remote stream carrier.' }],
2000
2035
  returns: 'one complete baseline followed by live replacement frames.',
@@ -3827,7 +3862,7 @@ export const EVENT_API = [
3827
3862
  {
3828
3863
  name: 'agent/pre-step',
3829
3864
  mode: 'waterfall',
3830
- signature: '\'agent/pre-step\'(this: Scoped<Agent>, payload: { agent: Agent; messages: UserMessage[]; turn: number; step: number; signal: AbortSignal }, next: () => Promise<PreStepDecision>): Promise<PreStepDecision>',
3865
+ signature: '\'agent/pre-step\'(this: Scoped<Agent>, payload: { agent: Agent; messages: UserMessage[]; promptConfig?: LlmCallConfig; turn: number; step: number; signal: AbortSignal }, next: () => Promise<PreStepDecision>): Promise<PreStepDecision>',
3831
3866
  summary: 'Reject a proposed step or replace the messages that enter it.',
3832
3867
  description: 'Reject a proposed step or replace the messages that enter it. Calling `next()` preserves the current messages.',
3833
3868
  parameters: [{ name: 'payload', description: '.signal - the current turn\'s cancellation signal. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.' }],
@@ -3837,7 +3872,7 @@ export const EVENT_API = [
3837
3872
  mode: 'waterfall',
3838
3873
  signature: '\'agent/request\'(this: Scoped<Agent>, payload: { agent: Agent; turn: number; step: number; signal: AbortSignal }, next: () => Promise<LlmCallConfig>): Promise<LlmCallConfig>',
3839
3874
  summary: 'Replace the frozen call configuration.',
3840
- description: 'Replace the frozen call configuration. `await next()` yields the config the machine would use (agent options on the first request, the logged header afterwards); return a replacement to switch. On step admission, this runs after assembly and `step/start`, before the system prompt and accepted user batch are committed. Cancellation here or during subsequent `prepareCall()` resolution commits neither. The prepared call capability governs prompt admission. Model-visible content must use logged channels; this waterfall cannot mutate messages.',
3875
+ description: 'Replace the frozen call configuration. `await next()` yields the config the machine would use. A queued prompt\'s config takes precedence over agent options and the previous request header. On step admission, this runs after assembly and `step/start`, before the system prompt and accepted user batch are committed. Cancellation here or during subsequent `prepareCall()` resolution commits neither. The prepared call capability governs prompt admission. Model-visible content must use logged channels; this waterfall cannot mutate messages.',
3841
3876
  parameters: [{ name: 'payload', description: '.signal - the current turn\'s explicit abort signal. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.' }],
3842
3877
  },
3843
3878
  {
@@ -4557,7 +4592,7 @@ export const TYPE_API = [
4557
4592
  },
4558
4593
  {
4559
4594
  name: 'ApiSessionAgentError',
4560
- declaration: 'export type ApiSessionAgentError = RemoteError<\'session/not-found\' | \'session/agent-busy\' | \'session/writer-held\' | \'gateway/internal\'>;',
4595
+ declaration: 'export type ApiSessionAgentError = RemoteError<\'session/not-found\' | \'session/agent-busy\' | \'session/writer-held\' | \'session/writer-released\' | \'session/not-owned\' | \'session/activation-pending\' | \'session/busy-release\' | \'session/busy-release-conflict\' | \'session/subagent-access\' | \'gateway/internal\'>;',
4561
4596
  },
4562
4597
  {
4563
4598
  name: 'ApiSessionAgentResult',
@@ -5001,7 +5036,7 @@ export const TYPE_API = [
5001
5036
  },
5002
5037
  {
5003
5038
  name: 'CreateSessionOptions',
5004
- declaration: 'export interface CreateSessionOptions {\n readonly seed?: readonly SessionEvent[];\n readonly inheritedEventCount?: SessionLogOffset;\n readonly meta?: {\n readonly cwd?: string;\n readonly parentSession?: SessionId;\n readonly createdAt?: number;\n readonly isSeeded?: boolean;\n readonly origin?: \'subagent\';\n readonly delegationDepth?: number;\n readonly agentPreset?: string;\n };\n}',
5039
+ declaration: 'export interface CreateSessionOptions {\n readonly seed?: readonly SessionEvent[];\n readonly inheritedEventCount?: SessionLogOffset;\n readonly meta?: {\n readonly cwd?: string;\n readonly appId?: string;\n readonly parentSession?: SessionId;\n readonly createdAt?: number;\n readonly isSeeded?: boolean;\n readonly origin?: \'subagent\';\n readonly delegationDepth?: number;\n readonly agentPreset?: string;\n };\n}',
5005
5040
  },
5006
5041
  {
5007
5042
  name: 'CreateTeamTaskRequest',
@@ -5193,7 +5228,7 @@ export const TYPE_API = [
5193
5228
  },
5194
5229
  {
5195
5230
  name: 'EpochHeader',
5196
- declaration: 'export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n tools?: ToolSchema[];\n system?: never;\n}',
5231
+ declaration: 'export interface EpochHeader {\n config: LlmCallConfig;\n promptScoped?: true;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n tools?: ToolSchema[];\n system?: never;\n}',
5197
5232
  },
5198
5233
  {
5199
5234
  name: 'EveryScheduleRecord',
@@ -5293,7 +5328,7 @@ export const TYPE_API = [
5293
5328
  },
5294
5329
  {
5295
5330
  name: 'GenerateOptions',
5296
- declaration: 'export interface GenerateOptions {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n messages: RequestMessage[];\n system?: string;\n tools?: ToolSchema[];\n toolHistory?: ToolHistory;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n signal?: AbortSignal;\n sessionId?: Branded<\'SessionId\'>;\n purpose?: \'compaction\' | \'session-title\';\n}',
5331
+ declaration: 'export interface GenerateOptions {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n messages: RequestMessage[];\n system?: string;\n tools?: ToolSchema[];\n toolHistory?: ToolHistory;\n temperature?: number;\n maxTokens?: number;\n baseUrl?: string;\n contextWindow?: number;\n protocol?: string;\n protocolOptions?: Readonly<Record<string, JsonValue>>;\n stop?: string[];\n signal?: AbortSignal;\n sessionId?: Branded<\'SessionId\'>;\n purpose?: \'compaction\' | \'session-title\';\n}',
5297
5332
  },
5298
5333
  {
5299
5334
  name: 'GenericCallView',
@@ -5605,7 +5640,7 @@ export const TYPE_API = [
5605
5640
  },
5606
5641
  {
5607
5642
  name: 'LlmAdapter',
5608
- declaration: 'export abstract class LlmAdapter {\n providerInfo(provider: string): LlmProviderInfo;\n providerRetryPolicy(_provider: string): ResolvedRetryPolicy | undefined;\n imageRequestPricing(_provider: string, _model: string): LlmImageRequestPricing | undefined;\n listModels(_provider: string): Promise<readonly LlmModelInfo[]>;\n resolveModel(provider: string, model: string, _signal?: AbortSignal): Promise<LlmResolvedModelInfo>;\n async prepareCall(provider: string, model: string, signal?: AbortSignal): Promise<PreparedAdapterCall>;\n abstract stream(options: GenerateOptions): AsyncIterable<StreamChunk>;\n}',
5643
+ declaration: 'export abstract class LlmAdapter {\n providerInfo(provider: string): LlmProviderInfo;\n providerRetryPolicy(_provider: string): ResolvedRetryPolicy | undefined;\n imageRequestPricing(_provider: string, _model: string): LlmImageRequestPricing | undefined;\n listModels(_provider: string): Promise<readonly LlmModelInfo[]>;\n resolveModel(provider: string, model: string, _signal?: AbortSignal): Promise<LlmResolvedModelInfo>;\n async prepareCall(provider: string, model: string, signal?: AbortSignal): Promise<PreparedAdapterCall>;\n abstract stream(options: GenerateOptions): AsyncIterable<StreamChunk>;\n supportsPromptApiKey(_provider: string, _model: string): boolean;\n validatePromptProtocol(config: LlmCallConfig): void;\n}',
5609
5644
  },
5610
5645
  {
5611
5646
  name: 'LlmAttemptId',
@@ -5613,7 +5648,7 @@ export const TYPE_API = [
5613
5648
  },
5614
5649
  {
5615
5650
  name: 'LlmCallConfig',
5616
- declaration: 'export interface LlmCallConfig {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n}',
5651
+ 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}',
5617
5652
  },
5618
5653
  {
5619
5654
  name: 'LlmCallConfigAdapterDefaults',
@@ -5655,6 +5690,10 @@ export const TYPE_API = [
5655
5690
  name: 'LlmModelReasoningInfo',
5656
5691
  declaration: 'export interface LlmModelReasoningInfo {\n efforts: readonly LlmReasoningEffortInfo[];\n defaultEffort?: ReasoningEffortId;\n}',
5657
5692
  },
5693
+ {
5694
+ name: 'LlmPromptModelConfig',
5695
+ 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}',
5696
+ },
5658
5697
  {
5659
5698
  name: 'LlmProviderInfo',
5660
5699
  declaration: 'export interface LlmProviderInfo {\n id: string;\n name: string;\n}',
@@ -5669,7 +5708,7 @@ export const TYPE_API = [
5669
5708
  },
5670
5709
  {
5671
5710
  name: 'LlmRuntime',
5672
- declaration: 'export class LlmRuntime extends TypertRemoteService {\n constructor(ctx: Context);\n registerAdapter(providers: string[], adapter: LlmAdapter): AdapterRegistrationHandle;\n @Remote\n listProviders(): LlmProviderInfo[];\n registerConfigurableProviders(entries: readonly LlmConfigurableProvider[]): DirectoryRegistrationHandle;\n @Remote\n listConfigurableProviders(): LlmConfigurableProvider[];\n registerModelDiscovery(settingsNs: string, discover: (request: LlmModelDiscoveryRequest, signal?: AbortSignal) => Promise<readonly LlmDiscoveredModel[]>): () => void;\n async discoverModels(settingsNs: string, request: LlmModelDiscoveryRequest, signal?: AbortSignal): Promise<LlmDiscoveredModel[]>;\n @Remote(\'discoverModels\')\n async remoteDiscoverModels(settingsNs: string, request: LlmModelDiscoveryRequest, signal: AbortSignal): Promise<LlmDiscoveredModel[]>;\n providerRetryPolicy(provider: string): ResolvedRetryPolicy;\n imageRequestPricing(provider: string, model: string): LlmImageRequestPricing | undefined;\n fileRequestText(ref: FileAttachmentRef): string;\n async listModels(provider: string): Promise<LlmModelInfo[]>;\n async resolveModelInfo(provider: string, model: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;\n async resolveCallConfig(config: LlmCallConfig, signal?: AbortSignal): Promise<LlmCallConfig>;\n async prepareCall(config: LlmCallConfig, signal?: AbortSignal): Promise<PreparedLlmCall>;\n stream(options: GenerateOptions) /* …truncated — full shape in source */',
5711
+ declaration: 'export class LlmRuntime extends TypertRemoteService {\n constructor(ctx: Context);\n registerAdapter(providers: string[], adapter: LlmAdapter): AdapterRegistrationHandle;\n @Remote\n listProviders(): LlmProviderInfo[];\n registerConfigurableProviders(entries: readonly LlmConfigurableProvider[]): DirectoryRegistrationHandle;\n @Remote\n listConfigurableProviders(): LlmConfigurableProvider[];\n registerModelDiscovery(settingsNs: string, discover: (request: LlmModelDiscoveryRequest, signal?: AbortSignal) => Promise<readonly LlmDiscoveredModel[]>): () => void;\n async discoverModels(settingsNs: string, request: LlmModelDiscoveryRequest, signal?: AbortSignal): Promise<LlmDiscoveredModel[]>;\n @Remote(\'discoverModels\')\n async remoteDiscoverModels(settingsNs: string, request: LlmModelDiscoveryRequest, signal: AbortSignal): Promise<LlmDiscoveredModel[]>;\n providerRetryPolicy(provider: string): ResolvedRetryPolicy;\n imageRequestPricing(provider: string, model: string): LlmImageRequestPricing | undefined;\n fileRequestText(ref: FileAttachmentRef): string;\n async listModels(provider: string): Promise<LlmModelInfo[]>;\n async resolveModelInfo(provider: string, model: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;\n async resolveCallConfig(config: LlmCallConfig, signal?: AbortSignal): Promise<LlmCallConfig>;\n resolvePromptConfig(request: LlmPromptModelConfig): LlmCallConfig;\n async prepareCall(config: LlmCallConfig, signal?: Abort /* …truncated — full shape in source */',
5673
5712
  },
5674
5713
  {
5675
5714
  name: 'LocalAtInput',
@@ -6009,7 +6048,7 @@ export const TYPE_API = [
6009
6048
  },
6010
6049
  {
6011
6050
  name: 'PreparedAdapterCall',
6012
- declaration: 'export interface PreparedAdapterCall {\n readonly model: LlmResolvedModelInfo;\n stream(options: GenerateOptions): AsyncIterable<StreamChunk>;\n}',
6051
+ declaration: 'export interface PreparedAdapterCall {\n readonly model: LlmResolvedModelInfo;\n stream(options: GenerateOptions, promptApiKey?: string): AsyncIterable<StreamChunk>;\n}',
6013
6052
  },
6014
6053
  {
6015
6054
  name: 'PreparedDeepSeekLlmApiExtension',
@@ -6453,7 +6492,7 @@ export const TYPE_API = [
6453
6492
  },
6454
6493
  {
6455
6494
  name: 'Session',
6456
- 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 static create(id: SessionId, seed?: readonly SessionEvent[], header?: SessionHeader, inheritedEventCount?: SessionLogOffset, projections?: readonly SessionMessageProjection[]): Session;\n static fromRestore(id: SessionId, seed: readonly SessionEvent[], header: SessionHeader, inheritedEventCount: SessionLogOffset, eventState: SessionSeedEventState, projections?: readonly SessionMessageProjection[]): Session;\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 ? [\n opts: SurfaceIntent<T>\n ] : [\n ]): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n toolHistory(): ToolHistory;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}',
6495
+ 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 static create(id: SessionId, seed?: readonly SessionEvent[], header?: SessionHeader, inheritedEventCount?: SessionLogOffset, projections?: readonly SessionMessageProjection[]): Session;\n static fromRestore(id: SessionId, seed: readonly SessionEvent[], header: SessionHeader, inheritedEventCount: SessionLogOffset, eventState: SessionSeedEventState, projections?: readonly SessionMessageProjection[]): Session;\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 ? [\n opts: SurfaceIntent<T>\n ] : [\n ]): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n toolHistory(): ToolHistory;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}',
6457
6496
  },
6458
6497
  {
6459
6498
  name: 'SessionAccess',
@@ -6515,6 +6554,14 @@ export const TYPE_API = [
6515
6554
  name: 'SessionCancelValue',
6516
6555
  declaration: 'export interface SessionCancelValue {\n readonly accepted: true;\n}',
6517
6556
  },
6557
+ {
6558
+ name: 'SessionClearLoginTokenRequest',
6559
+ declaration: 'export interface SessionClearLoginTokenRequest {\n}',
6560
+ },
6561
+ {
6562
+ name: 'SessionClearLoginTokenValue',
6563
+ declaration: 'export interface SessionClearLoginTokenValue {\n readonly ok: true;\n}',
6564
+ },
6518
6565
  {
6519
6566
  name: 'SessionControlBaseline',
6520
6567
  declaration: 'export interface SessionControlBaseline {\n readonly projections: Readonly<Record<SessionId, SessionProjectionBaseline>>;\n}',
@@ -6525,11 +6572,11 @@ export const TYPE_API = [
6525
6572
  },
6526
6573
  {
6527
6574
  name: 'SessionCreateRequest',
6528
- 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}',
6575
+ 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}',
6529
6576
  },
6530
6577
  {
6531
6578
  name: 'SessionCreateValue',
6532
- declaration: 'export interface SessionCreateValue {\n readonly sessionId: SessionId;\n readonly agentPreset?: string;\n}',
6579
+ declaration: 'export interface SessionCreateValue {\n readonly appId?: string;\n readonly sessionId: SessionId;\n readonly agentPreset?: string;\n}',
6533
6580
  },
6534
6581
  {
6535
6582
  name: 'SessionEvent',
@@ -6541,7 +6588,7 @@ export const TYPE_API = [
6541
6588
  },
6542
6589
  {
6543
6590
  name: 'SessionEventMap',
6544
- declaration: 'export interface SessionEventMap {\n \'turn/start\': {\n turn: number;\n };\n \'turn/end\': {\n turn: number;\n reason: TurnEndReason;\n };\n \'step/start\': {\n turn: number;\n step: number;\n };\n \'step/end\': {\n turn: number;\n step: number;\n };\n \'user/message\': UserMessage;\n \'developer/message\': {\n turn: number;\n step: number;\n message: DeveloperMessage;\n headerSeq?: SessionSeq;\n };\n \'system/message\': {\n turn: number;\n step: number;\n message: SystemMessage;\n };\n \'assistant/message\': {\n turn: number;\n step: number;\n message: AssistantMessage;\n stream: AssistantStreamRecord[];\n usage?: TokenUsage;\n interrupted?: true;\n };\n \'assistant/attempt\': {\n turn: number;\n step: number;\n stream: AssistantStreamRecord[];\n };\n \'tool/call\': {\n turn: number;\n step: number;\n callId: ToolCallId;\n name: string;\n arguments: string;\n };\n \'tool/result\': {\n turn: number;\n step: number;\n message: ToolResultMessage;\n error?: {\n name: string;\n code: string;\n reason?: string;\n };\n meta?: JsonValue;\n };\n \'request/header\': {\n header: EpochHeader;\n reason: RequestHeaderReason;\n startsSeries?: true;\n };\n \'request/context\': RequestContext;\n \'session/end-seed\': {\n /* …truncated — full shape in source */',
6591
+ declaration: 'export interface SessionEventMap {\n \'session/application\': {\n appId: string;\n };\n \'turn/start\': {\n turn: number;\n };\n \'turn/end\': {\n turn: number;\n reason: TurnEndReason;\n };\n \'step/start\': {\n turn: number;\n step: number;\n };\n \'step/end\': {\n turn: number;\n step: number;\n };\n \'user/message\': UserMessage;\n \'developer/message\': {\n turn: number;\n step: number;\n message: DeveloperMessage;\n headerSeq?: SessionSeq;\n };\n \'system/message\': {\n turn: number;\n step: number;\n message: SystemMessage;\n };\n \'assistant/message\': {\n turn: number;\n step: number;\n message: AssistantMessage;\n stream: AssistantStreamRecord[];\n usage?: TokenUsage;\n interrupted?: true;\n };\n \'assistant/attempt\': {\n turn: number;\n step: number;\n stream: AssistantStreamRecord[];\n };\n \'tool/call\': {\n turn: number;\n step: number;\n callId: ToolCallId;\n name: string;\n arguments: string;\n };\n \'tool/result\': {\n turn: number;\n step: number;\n message: ToolResultMessage;\n error?: {\n name: string;\n code: string;\n reason?: string;\n };\n meta?: JsonValue;\n };\n \'request/header\': {\n header: EpochHeader;\n reason: RequestHeaderReason;\n startsSeries?: true;\n };\n \'req /* …truncated — full shape in source */',
6545
6592
  },
6546
6593
  {
6547
6594
  name: 'SessionEventMetadataFilter',
@@ -6789,7 +6836,7 @@ export const TYPE_API = [
6789
6836
  },
6790
6837
  {
6791
6838
  name: 'SessionPromptRequest',
6792
- declaration: 'export interface SessionPromptRequest {\n readonly requestId: SessionRequestId;\n readonly sessionId: SessionId;\n readonly mode: \'queue\' | \'steer\';\n readonly content: readonly PromptContentPart[];\n readonly clientTimeZone?: string;\n}',
6839
+ declaration: 'export interface SessionPromptRequest {\n readonly requestId: SessionRequestId;\n readonly sessionId: SessionId;\n readonly mode: \'queue\' | \'steer\';\n readonly content: readonly PromptContentPart[];\n readonly clientTimeZone?: string;\n readonly provider?: string;\n readonly model?: string;\n readonly modelConfig?: LlmPromptModelConfig;\n}',
6793
6840
  },
6794
6841
  {
6795
6842
  name: 'SessionPromptValue',
@@ -6831,6 +6878,14 @@ export const TYPE_API = [
6831
6878
  name: 'SessionResultRange',
6832
6879
  declaration: 'export interface SessionResultRange {\n from?: number;\n to?: number;\n}',
6833
6880
  },
6881
+ {
6882
+ name: 'SessionResumeRequest',
6883
+ declaration: 'export interface SessionResumeRequest {\n readonly sessionId: SessionId;\n readonly provider?: string;\n readonly model?: string;\n}',
6884
+ },
6885
+ {
6886
+ name: 'SessionResumeValue',
6887
+ declaration: 'export interface SessionResumeValue {\n readonly appId?: string;\n readonly sessionId: SessionId;\n readonly selected: ModelSelection;\n}',
6888
+ },
6834
6889
  {
6835
6890
  name: 'SessionSearchCursor',
6836
6891
  declaration: 'export type SessionSearchCursor = Branded<\'SessionSearchCursor\'>;',
@@ -6875,6 +6930,14 @@ export const TYPE_API = [
6875
6930
  name: 'SessionSeqCursor',
6876
6931
  declaration: 'export type SessionSeqCursor = SessionSeq | -1;',
6877
6932
  },
6933
+ {
6934
+ name: 'SessionSetLoginTokenRequest',
6935
+ declaration: 'export interface SessionSetLoginTokenRequest {\n readonly accessToken: string;\n readonly refreshToken?: string;\n readonly longToken?: string;\n readonly expiresAtMs?: number;\n readonly userName?: string;\n readonly emailAddress?: string;\n}',
6936
+ },
6937
+ {
6938
+ name: 'SessionSetLoginTokenValue',
6939
+ declaration: 'export interface SessionSetLoginTokenValue {\n readonly ok: true;\n}',
6940
+ },
6878
6941
  {
6879
6942
  name: 'SessionStartSource',
6880
6943
  declaration: 'export type SessionStartSource = \'startup\' | \'resume\' | \'clear\' | \'compact\';',
@@ -6885,7 +6948,7 @@ export const TYPE_API = [
6885
6948
  },
6886
6949
  {
6887
6950
  name: 'SessionSummary',
6888
- 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}',
6951
+ 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}',
6889
6952
  },
6890
6953
  {
6891
6954
  name: 'SessionSurface',
@@ -7849,7 +7912,7 @@ export const TYPE_API = [
7849
7912
  },
7850
7913
  {
7851
7914
  name: 'UserMessage',
7852
- declaration: 'export interface UserMessage extends MessageBase {\n readonly role: \'user\';\n}',
7915
+ declaration: 'export interface UserMessage extends MessageBase {\n readonly role: \'user\';\n readonly promptConfig?: LlmCallConfig;\n readonly promptApiKeyRequired?: true;\n}',
7853
7916
  },
7854
7917
  {
7855
7918
  name: 'VerifiedWebhookDelivery',