@qwen-code/web-shell 0.27.4 → 0.28.0-nightly.20261120.19b31401f5

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 (217) hide show
  1. package/NOTICES.txt +464 -0
  2. package/README.md +4 -3
  3. package/dist/{PierreFilePreview-BMd8Nqyr.js → PierreFilePreview-CfXrxlQc.js} +1 -1
  4. package/dist/{SpreadsheetPreview-MnZX4z-A.js → SpreadsheetPreview-BPurJ_TG.js} +11 -11
  5. package/dist/{WorkspaceFileBrowser-CvJS8MdL.js → WorkspaceFileBrowser-SyFKPQPx.js} +189 -189
  6. package/dist/WorkspacePdfRangePreview-CsiD3ccc.js +22384 -0
  7. package/dist/agents-route-V3vhM8Gj.js +1746 -0
  8. package/dist/daemon-react-sdk.js +1 -1
  9. package/dist/i18n-ru-CfZvlNRX.js +4399 -0
  10. package/dist/i18n-zh-cn-oYBQlyci.js +4455 -0
  11. package/dist/i18n-zh-tw-meIHyJiH.js +5548 -0
  12. package/dist/{index-ENe4NzKy.js → index-B1Jw6-bY.js} +76003 -78380
  13. package/dist/index.js +3 -3
  14. package/dist/sw.js +1 -1
  15. package/dist/terminal-runtime-BQaN1NCS.js +7881 -0
  16. package/dist/transcript.js +14748 -14211
  17. package/dist/types/App.d.ts +6 -2
  18. package/dist/types/adapters/messageTypes.d.ts +10 -1
  19. package/dist/types/adapters/toolClassification.d.ts +2 -1
  20. package/dist/types/adapters/transcriptAdapter.d.ts +8 -0
  21. package/dist/types/browser-notifications/messages.d.ts +1 -0
  22. package/dist/types/browser-notifications/messages.transcript-stub.d.ts +1 -0
  23. package/dist/types/chat-core/capabilities.d.ts +3 -0
  24. package/dist/types/chat-core/contract.d.ts +106 -0
  25. package/dist/types/chat-core/intent.d.ts +8 -0
  26. package/dist/types/completions/sendCompletion.d.ts +28 -0
  27. package/dist/types/completions/slashCompletion.d.ts +8 -1
  28. package/dist/types/components/BranchPickerPopover.d.ts +11 -1
  29. package/dist/types/components/ChatContextHeader.d.ts +11 -1
  30. package/dist/types/components/ChatEditor.d.ts +7 -1
  31. package/dist/types/components/ChatPane.d.ts +3 -1
  32. package/dist/types/components/ComposerStatusStack.d.ts +8 -0
  33. package/dist/types/components/ComposerTaskChips.d.ts +5 -2
  34. package/dist/types/components/GoalStatusStrip.d.ts +23 -2
  35. package/dist/types/components/LocalFilesControl.d.ts +40 -1
  36. package/dist/types/components/ManagedLocalFilesControl.d.ts +3 -1
  37. package/dist/types/components/MessageItem.d.ts +2 -0
  38. package/dist/types/components/MessageList.d.ts +1 -0
  39. package/dist/types/components/ReportedArtifactRegistration.d.ts +25 -0
  40. package/dist/types/components/RestartRecoveryPanel.d.ts +22 -0
  41. package/dist/types/components/SessionGoalMarker.d.ts +24 -0
  42. package/dist/types/components/ToastHost.d.ts +27 -1
  43. package/dist/types/components/UnavailableModelTooltip.d.ts +4 -2
  44. package/dist/types/components/WebShellTranscript.d.ts +3 -1
  45. package/dist/types/components/artifacts/ArtifactPanel.d.ts +47 -2
  46. package/dist/types/components/artifacts/ArtifactsListPanel.d.ts +13 -0
  47. package/dist/types/components/artifacts/ChangeOverviewPanel.d.ts +4 -0
  48. package/dist/types/components/artifacts/SessionPanel.d.ts +19 -0
  49. package/dist/types/components/artifacts/WorkspacePdfRangePreview.d.ts +10 -0
  50. package/dist/types/components/artifacts/artifactUtils.d.ts +9 -5
  51. package/dist/types/components/artifacts/change-overview.d.ts +102 -0
  52. package/dist/types/components/artifacts/files-messages.d.ts +33 -0
  53. package/dist/types/components/artifacts/files-messages.transcript-stub.d.ts +1 -0
  54. package/dist/types/components/artifacts/token-usage-messages.d.ts +1 -0
  55. package/dist/types/components/artifacts/token-usage-messages.transcript-stub.d.ts +1 -0
  56. package/dist/types/components/artifacts/useChangeOverview.d.ts +21 -0
  57. package/dist/types/components/channels/channel-events-messages.d.ts +1 -0
  58. package/dist/types/components/channels/channel-platform.d.ts +1 -1
  59. package/dist/types/components/dialogs/GoalsDialog.d.ts +2 -1
  60. package/dist/types/components/managed/ManagedArtifactLibraryPage.d.ts +15 -0
  61. package/dist/types/components/managed/ManagedSurfaceDecisionsDialog.d.ts +1 -0
  62. package/dist/types/components/managed/ManagedTerminalPanel.d.ts +0 -1
  63. package/dist/types/components/managed/ManagedWorkspaceNavigation.d.ts +2 -1
  64. package/dist/types/components/managed/WorkspaceBindingCreator.d.ts +14 -2
  65. package/dist/types/components/managed/chat-capabilities.d.ts +5 -0
  66. package/dist/types/components/managed/generated/managed-agent-api.d.ts +100 -6
  67. package/dist/types/components/managed/java-managed-agent-client.d.ts +21 -0
  68. package/dist/types/components/managed/managed-agent-provider.d.ts +4 -1
  69. package/dist/types/components/managed/managed-artifact-library-messages.d.ts +8 -0
  70. package/dist/types/components/managed/managed-artifact-library-messages.transcript-stub.d.ts +8 -0
  71. package/dist/types/components/managed/managed-diagnostics-messages.d.ts +167 -167
  72. package/dist/types/components/managed/managed-extension-install.d.ts +3 -0
  73. package/dist/types/components/managed/managed-extension-messages.d.ts +1 -0
  74. package/dist/types/components/managed/managed-lifecycle-messages.d.ts +40 -0
  75. package/dist/types/components/managed/managed-lifecycle-messages.transcript-stub.d.ts +1 -0
  76. package/dist/types/components/managed/managed-mcp-messages.d.ts +1 -0
  77. package/dist/types/components/managed/managed-mcp-messages.transcript-stub.d.ts +1 -0
  78. package/dist/types/components/managed/managed-recovery-messages.d.ts +4 -1
  79. package/dist/types/components/managed/managed-surface-decisions.d.ts +10 -0
  80. package/dist/types/components/managed/managed-task-messages.d.ts +1 -0
  81. package/dist/types/components/managed/managed-task-messages.transcript-stub.d.ts +1 -0
  82. package/dist/types/components/managed/managed-tool-result-types.d.ts +6 -0
  83. package/dist/types/components/managed/managed-workspace-messages.d.ts +1 -0
  84. package/dist/types/components/managed/managed-workspace-messages.transcript-stub.d.ts +1 -0
  85. package/dist/types/components/managed/use-managed-recovery.d.ts +1 -2
  86. package/dist/types/components/message-deletion-messages.d.ts +1 -0
  87. package/dist/types/components/message-deletion-messages.transcript-stub.d.ts +1 -0
  88. package/dist/types/components/messages/AssistantMessage.d.ts +6 -1
  89. package/dist/types/components/messages/AssistantMessageRow.d.ts +13 -0
  90. package/dist/types/components/messages/AssistantMessageRow.transcript-stub.d.ts +6 -0
  91. package/dist/types/components/messages/BtwMessage.d.ts +6 -0
  92. package/dist/types/components/messages/HookStatistics.d.ts +4 -0
  93. package/dist/types/components/messages/HookStatistics.transcript-stub.d.ts +4 -0
  94. package/dist/types/components/messages/Markdown.d.ts +1 -0
  95. package/dist/types/components/messages/MemoryMessage.d.ts +1 -2
  96. package/dist/types/components/messages/ModAssistantMessage.d.ts +15 -0
  97. package/dist/types/components/messages/UserMessage.d.ts +5 -1
  98. package/dist/types/components/messages/WorkflowExecutionView.d.ts +4 -0
  99. package/dist/types/components/messages/hook-statistics-context.d.ts +13 -0
  100. package/dist/types/components/messages/hook-statistics-turns.d.ts +3 -0
  101. package/dist/types/components/messages/mod-rows.d.ts +53 -0
  102. package/dist/types/components/messages/session-link.d.ts +1 -0
  103. package/dist/types/components/sidebar/ActivityDateSessions.d.ts +22 -0
  104. package/dist/types/components/sidebar/SessionGroupSection.d.ts +4 -2
  105. package/dist/types/components/sidebar/SessionSortMenu.d.ts +15 -1
  106. package/dist/types/components/sidebar/WebShellSidebar.d.ts +1 -1
  107. package/dist/types/components/sidebar/activity-messages.d.ts +1 -0
  108. package/dist/types/components/sidebar/activity-model.d.ts +1 -1
  109. package/dist/types/components/streaming-tail.d.ts +8 -0
  110. package/dist/types/components/streaming-tail.transcript-stub.d.ts +6 -0
  111. package/dist/types/components/terminal/TerminalPanel.d.ts +0 -1
  112. package/dist/types/components/terminal/terminal-runtime.d.ts +8 -0
  113. package/dist/types/components/terminal/use-terminal-runtime.d.ts +6 -0
  114. package/dist/types/components/ui/dialog.d.ts +1 -0
  115. package/dist/types/components/ui/drawer.d.ts +1 -1
  116. package/dist/types/components/workspace-agents/add-runtime-dialog.d.ts +13 -5
  117. package/dist/types/components/workspace-agents/messages.d.ts +1 -0
  118. package/dist/types/components/workspace-agents/messages.transcript-stub.d.ts +1 -0
  119. package/dist/types/constants/approvalModes.d.ts +7 -0
  120. package/dist/types/constants/localCommands.d.ts +3 -1
  121. package/dist/types/constants/sessions.d.ts +1 -0
  122. package/dist/types/customization.d.ts +23 -2
  123. package/dist/types/daemon/chat-capabilities.d.ts +3 -0
  124. package/dist/types/daemon/chat-controller.d.ts +67 -0
  125. package/dist/types/daemon/chat-intents.d.ts +88 -0
  126. package/dist/types/daemon/permission-signals.d.ts +35 -0
  127. package/dist/types/daemon/session/types.d.ts +42 -2
  128. package/dist/types/daemon/useDaemonChatController.d.ts +15 -0
  129. package/dist/types/daemon/workspace/hooks/useDaemonAgents.d.ts +5 -0
  130. package/dist/types/daemon/workspace/hooks/useDaemonAuth.d.ts +5 -0
  131. package/dist/types/daemon/workspace/hooks/useDaemonChannelEvents.d.ts +5 -0
  132. package/dist/types/daemon/workspace/hooks/useDaemonDiagnostics.d.ts +14 -2
  133. package/dist/types/daemon/workspace/hooks/useDaemonMcp.d.ts +5 -0
  134. package/dist/types/daemon/workspace/hooks/useDaemonMemory.d.ts +5 -0
  135. package/dist/types/daemon/workspace/hooks/useDaemonProviders.d.ts +5 -0
  136. package/dist/types/daemon/workspace/hooks/useDaemonResource.d.ts +7 -1
  137. package/dist/types/daemon/workspace/hooks/useDaemonSessions.d.ts +6 -0
  138. package/dist/types/daemon/workspace/hooks/useDaemonSettings.d.ts +5 -0
  139. package/dist/types/daemon/workspace/hooks/useDaemonStatusReport.d.ts +5 -0
  140. package/dist/types/daemon/workspace/hooks/useDaemonTools.d.ts +5 -0
  141. package/dist/types/daemon/workspace/hooks/useDaemonUsageDashboard.d.ts +5 -0
  142. package/dist/types/generated-ui/instance-store.d.ts +4 -1
  143. package/dist/types/generated-ui/view-state.d.ts +51 -0
  144. package/dist/types/hooks/useAtMentionSources.d.ts +1 -1
  145. package/dist/types/hooks/useComposerCore.d.ts +22 -2
  146. package/dist/types/hooks/useComposerWorkspace.d.ts +7 -0
  147. package/dist/types/hooks/useIsTouchComposer.d.ts +1 -0
  148. package/dist/types/hooks/useModelConfigurations.d.ts +7 -0
  149. package/dist/types/hooks/useModelRefresh.d.ts +1 -0
  150. package/dist/types/hooks/useScopedSessions.d.ts +1 -0
  151. package/dist/types/hooks/useSessionArtifacts.d.ts +8 -2
  152. package/dist/types/hooks/useSubSessionTasks.d.ts +8 -0
  153. package/dist/types/i18n-catalogs.d.ts +3 -0
  154. package/dist/types/i18n-catalogs.eager.d.ts +3 -0
  155. package/dist/types/i18n-language.d.ts +2 -0
  156. package/dist/types/i18n-ru-part1.d.ts +1 -0
  157. package/dist/types/i18n-ru-part1.transcript-stub.d.ts +12 -0
  158. package/dist/types/i18n-ru-part2.d.ts +1 -0
  159. package/dist/types/i18n-ru-part2.transcript-stub.d.ts +12 -0
  160. package/dist/types/i18n-ru-part3.d.ts +1 -0
  161. package/dist/types/i18n-ru-part3.transcript-stub.d.ts +12 -0
  162. package/dist/types/i18n-ru-part4.d.ts +1 -0
  163. package/dist/types/i18n-ru-part4.transcript-stub.d.ts +12 -0
  164. package/dist/types/i18n-ru-part5.d.ts +1 -0
  165. package/dist/types/i18n-ru-part5.transcript-stub.d.ts +12 -0
  166. package/dist/types/i18n-ru-part6.d.ts +1 -0
  167. package/dist/types/i18n-ru-part6.transcript-stub.d.ts +12 -0
  168. package/dist/types/i18n-ru-remainder.d.ts +6 -0
  169. package/dist/types/i18n-ru-remainder.transcript-stub.d.ts +11 -0
  170. package/dist/types/i18n-ru.d.ts +7 -0
  171. package/dist/types/i18n-zh-cn.d.ts +7 -0
  172. package/dist/types/i18n-zh-tw.d.ts +8 -0
  173. package/dist/types/i18n-zh-tw.transcript-stub.d.ts +6 -0
  174. package/dist/types/i18n.d.ts +13 -2
  175. package/dist/types/index.d.ts +1 -1
  176. package/dist/types/live/messages.d.ts +1 -0
  177. package/dist/types/live/messages.transcript-stub.d.ts +1 -0
  178. package/dist/types/local-files/useLocalFilesBridge.d.ts +7 -1
  179. package/dist/types/local-files/useManagedLocalFilesBridge.d.ts +5 -1
  180. package/dist/types/mcp-app/messages.d.ts +1 -0
  181. package/dist/types/mcp-app/messages.transcript-stub.d.ts +1 -0
  182. package/dist/types/mcpAppHostContext.d.ts +4 -0
  183. package/dist/types/session-catalog/session-catalog-hooks.d.ts +5 -1
  184. package/dist/types/session-catalog/session-live-work.d.ts +39 -0
  185. package/dist/types/settings/messages.d.ts +1 -0
  186. package/dist/types/settings/messages.transcript-stub.d.ts +1 -0
  187. package/dist/types/settings.d.ts +3 -0
  188. package/dist/types/subagentDetailsContext.d.ts +9 -1
  189. package/dist/types/trajectory/buildTimeline.d.ts +1 -1
  190. package/dist/types/trajectory/execution-messages.d.ts +1 -0
  191. package/dist/types/trajectory/execution-messages.transcript-stub.d.ts +1 -0
  192. package/dist/types/trajectory/filter-messages.d.ts +1 -0
  193. package/dist/types/trajectory/filter-messages.transcript-stub.d.ts +1 -0
  194. package/dist/types/trajectory/project-trajectory-lifecycle.d.ts +1 -1
  195. package/dist/types/trajectory/trajectory-live-store.d.ts +3 -1
  196. package/dist/types/trajectory/types.d.ts +2 -0
  197. package/dist/types/trajectory/window-messages.d.ts +1 -0
  198. package/dist/types/trajectory/window-messages.transcript-stub.d.ts +1 -0
  199. package/dist/types/utils/askUserPermission.d.ts +1 -1
  200. package/dist/types/utils/composerTasks.d.ts +16 -4
  201. package/dist/types/utils/gitModeIntent.d.ts +14 -4
  202. package/dist/types/utils/imageIngestion.d.ts +1 -0
  203. package/dist/types/utils/planMode.d.ts +2 -2
  204. package/dist/types/utils/plural.d.ts +5 -0
  205. package/dist/types/utils/sendCommand.d.ts +31 -0
  206. package/dist/types/utils/sessionPreparation.d.ts +16 -14
  207. package/dist/types/vision-timeout-command.d.ts +17 -0
  208. package/dist/types/voice/VoiceButton.d.ts +9 -1
  209. package/dist/types/voice/messages.d.ts +1 -0
  210. package/dist/types/voice/messages.transcript-stub.d.ts +1 -0
  211. package/dist/types/voice/use-voice-workspace-settings.d.ts +1 -0
  212. package/dist/types/voice/useVoiceCapture.d.ts +8 -0
  213. package/dist/types/voice/voice-workspace-target.d.ts +1 -0
  214. package/dist/{useDaemonMidTurnInjected-BCExZTLK.js → useDaemonMidTurnInjected-BjQ9zxRv.js} +8475 -10940
  215. package/package.json +4 -1
  216. package/dist/agents-route-BYqfB9LM.js +0 -1727
  217. package/dist/types/components/managed/ManagedRecoveryPanel.d.ts +0 -9
@@ -0,0 +1,67 @@
1
+ import type { Message } from '../adapters/types.js';
2
+ import type { Admission, ApprovalSelectionController, ChatCapabilities, ChatStatusFacts, ComposerSubmit, ContextUsageController, ModelSelectionController, PendingApproval, PendingQuestion, QuestionAnswer, SessionChatController, SessionOpsController } from '../chat-core/contract.js';
3
+ /**
4
+ * A terminal prompt event from the daemon, reduced to the prompt it settles
5
+ * and whether that turn completed, was cancelled, or failed. The adapter binds
6
+ * it to the dispatched attempt by `promptId`, never by the visible
7
+ * session/turn target.
8
+ */
9
+ export interface DaemonPromptSettlement {
10
+ readonly promptId: string;
11
+ readonly outcome: 'completed' | 'cancelled' | 'failed';
12
+ }
13
+ /**
14
+ * Evidence that an approval/question decision was applied to the request it
15
+ * names. `applied` is false when the decision could not be applied; the
16
+ * adapter still terminalizes the attempt but never certifies it. The daemon
17
+ * decision event names only the request (no attempt/option discriminator), so
18
+ * correlation is request-level: the request's single active attempt.
19
+ */
20
+ export interface DaemonDecisionSettlement {
21
+ readonly requestId: string;
22
+ readonly applied: boolean;
23
+ }
24
+ /**
25
+ * The provider facts and actions the controller assembles. Everything is
26
+ * injected so the assembly is testable without mounting the session provider;
27
+ * the binding hook backs the fact fields with live provider state. Fact fields
28
+ * are read on each access, so a deps object with getter-backed fields stays
29
+ * current across renders.
30
+ */
31
+ export interface DaemonChatControllerDeps {
32
+ readonly sessionId: string;
33
+ readonly storageKey: string;
34
+ readonly messages: readonly Message[];
35
+ readonly transcriptState: 'loading' | 'ready' | 'error';
36
+ loadOlder?(): Promise<void>;
37
+ readonly statusFacts: ChatStatusFacts;
38
+ readonly capabilities: ChatCapabilities;
39
+ readonly modelSelection?: ModelSelectionController;
40
+ readonly approvalSelection?: ApprovalSelectionController;
41
+ readonly contextUsage?: ContextUsageController;
42
+ readonly sessionOps?: SessionOpsController;
43
+ readonly pendingApprovals: readonly PendingApproval[];
44
+ readonly pendingQuestions: readonly PendingQuestion[];
45
+ submitPrompt(input: ComposerSubmit, onAdmitted: (promptId: string) => void): Promise<Admission>;
46
+ cancelPrompt(): Promise<Admission>;
47
+ submitPermission(requestId: string, optionId: string): Promise<Admission>;
48
+ submitQuestionAnswers(requestId: string, answers: readonly QuestionAnswer[]): Promise<Admission>;
49
+ subscribePromptSettlement(listener: (event: DaemonPromptSettlement) => void): () => void;
50
+ subscribeDecisionSettlement(listener: (event: DaemonDecisionSettlement) => void): () => void;
51
+ subscribeApprovalCurrency(listener: (requestId: string, live: boolean) => void): () => void;
52
+ readonly liveApprovalRequestIds?: readonly string[];
53
+ readonly settledPhase?: 'idle' | 'failed';
54
+ readonly signal?: AbortSignal;
55
+ }
56
+ /**
57
+ * The daemon adapter's controller assembly (slice 2c). It wraps the injected
58
+ * provider facts and actions into the backend-neutral {@link
59
+ * SessionChatController}, wiring the slice-2b intent engine so admission stays
60
+ * separate from establishment. Its new logic is the correlation between a
61
+ * dispatched attempt and the backend identity its evidence names: settlement
62
+ * elevates only the attempt bound to the event's `promptId`/`requestId`, so a
63
+ * late event for a finished attempt cannot establish a retry on the same
64
+ * visible target. Transcript and sub-controller facts are passed through from
65
+ * the provider, not re-derived here.
66
+ */
67
+ export declare function createDaemonChatController(deps: DaemonChatControllerDeps): SessionChatController;
@@ -0,0 +1,88 @@
1
+ import type { Admission, ChatOperation, ChatPhase, IntentKind, IntentResult, IntentTarget } from '../chat-core/contract.js';
2
+ import { type OutcomeWitness } from '../chat-core/intent.js';
3
+ /**
4
+ * Transport dispatch for one intent. It resolves to an admission only; the
5
+ * resolution of this promise is never evidence that the intended effect is
6
+ * established. Outcome evidence arrives separately through {@link
7
+ * DaemonChatIntents.settle}.
8
+ */
9
+ export type IntentTransport = () => Promise<Admission>;
10
+ /**
11
+ * One dispatched attempt and the identity that binds its settlement evidence.
12
+ * The adapter must record the operation id next to the backend identity of the
13
+ * request it just made, so an incoming event can name the attempt it belongs
14
+ * to. Binding the id after the event arrives cannot authenticate it.
15
+ */
16
+ export interface DaemonIntentDispatch {
17
+ readonly operationId: string;
18
+ readonly result: IntentResult;
19
+ }
20
+ export interface DaemonChatIntents {
21
+ /**
22
+ * In-flight and recently settled intents, bounded by the contract retention.
23
+ * The snapshot identity is stable between state changes so it can back a
24
+ * `useSyncExternalStore` cache.
25
+ */
26
+ readonly operations: readonly ChatOperation[];
27
+ /** `cancelling` is derived from an unestablished cancel operation. */
28
+ phase(settled: 'idle' | 'failed'): ChatPhase;
29
+ /**
30
+ * Dispatch an intent's transport and report admission. The attempt is
31
+ * recorded as `pending` before the transport runs, so the row exists (and
32
+ * evidence can bind to it) while the request is in flight, and rows stay in
33
+ * dispatch order. The outcome is `unsettled` until authoritative evidence
34
+ * arrives via {@link settle}; a resolved transport alone never produces
35
+ * `established`.
36
+ */
37
+ dispatch(kind: IntentKind, target: IntentTarget, transport: IntentTransport): Promise<DaemonIntentDispatch>;
38
+ /**
39
+ * Apply authoritative outcome evidence to the attempt it belongs to. The
40
+ * witness is bound to one dispatched operation, so a late witness for a
41
+ * finished attempt cannot establish a later attempt that shares the same
42
+ * visible target. Unknown or already-terminal operations are a no-op.
43
+ * For approvals a *settled* decision establishes only while its request is
44
+ * still live; a superseded or unidentified request never establishes, while
45
+ * negative evidence still terminalizes the attempt.
46
+ */
47
+ settle(operationId: string, witness: OutcomeWitness): IntentResult | undefined;
48
+ /**
49
+ * Apply decision evidence to the request's active (non-terminal) approval or
50
+ * question attempt, freezing currency when the evidence arrives even though
51
+ * the attempt's operation id is not yet bound (its POST is still in flight).
52
+ * The daemon decision event names only the request, so the correlation is
53
+ * request-level. No active matching attempt is a no-op, so a late event for a
54
+ * finished attempt is not retained.
55
+ */
56
+ settleDecisionRequest(requestId: string, witness: OutcomeWitness): IntentResult | undefined;
57
+ /**
58
+ * Give an attempt whose admission can never be confirmed (a thrown transport
59
+ * leaves it `unknown`) an exit: terminalize it as `failed`, never
60
+ * `established`, so it stops holding the phase open. Unknown ids,
61
+ * already-terminal attempts, and attempts with a confirmed admission are a
62
+ * no-op — a live accepted turn must keep its chance to settle. While the POST
63
+ * is in flight, held `settled` evidence also blocks abandon (it may yet land
64
+ * on an accepted admission); once admission resolves `unknown` the held
65
+ * witness can never certify, so the attempt stays abandonable.
66
+ */
67
+ abandon(operationId: string): IntentResult | undefined;
68
+ /**
69
+ * Release a terminal row once the surface has consumed it. Non-terminal rows
70
+ * are kept; terminal rows stay readable until acknowledged.
71
+ */
72
+ acknowledge(operationId: string): void;
73
+ /**
74
+ * Track whether an approval request is still valid (not superseded). The
75
+ * daemon keeps several permission requests pending at once, so currency is a
76
+ * set, not a single "newest" id. Mark a request live when it arrives and
77
+ * not-live only when it is superseded or cancelled — not when it is answered;
78
+ * the engine releases the identity itself once the decision settles, so a
79
+ * decision establishes while its request has not been superseded.
80
+ */
81
+ setApprovalRequestLive(requestId: string, live: boolean): void;
82
+ }
83
+ /**
84
+ * The daemon adapter's intent lifecycle core. It keeps admission (transport)
85
+ * and outcome (evidence) separate so the shared contract's
86
+ * admission-is-not-establishment invariant holds for daemon chat intents.
87
+ */
88
+ export declare function createDaemonChatIntents(): DaemonChatIntents;
@@ -0,0 +1,35 @@
1
+ import type { DaemonTranscriptBlock } from '@qwen-code/sdk/daemon';
2
+ import type { DaemonDecisionSettlement } from './chat-controller.js';
3
+ /**
4
+ * The option id a question answer must vote to be applied. A question is
5
+ * answered by selecting its submit (`allow_once`) option with the answers
6
+ * attached — the same wire shape `AskUserQuestion.handleSubmit` uses. Voting
7
+ * with no option id sends a `cancelled` outcome, which discards the answers and
8
+ * cancels the question, so the submit option is required. Returns undefined when
9
+ * the request is not pending or has no submit option.
10
+ */
11
+ export declare function questionSubmitOptionId(pendingPermissions: ReadonlyArray<Extract<DaemonTranscriptBlock, {
12
+ kind: 'permission';
13
+ }>>, requestId: string): string | undefined;
14
+ /**
15
+ * The permission-derived signals the daemon controller needs but the provider
16
+ * does not expose as explicit channels: approval currency and decision
17
+ * settlement. Both are derived from the pending-permission set across renders.
18
+ *
19
+ * Currency: a request is live while its permission is pending. It is marked
20
+ * not-live only when it leaves the pending set *without* this controller having
21
+ * answered it — i.e. it was superseded. A request this controller answered stays
22
+ * live so its decision can establish; the engine releases the identity itself on
23
+ * establishment.
24
+ *
25
+ * Decision settlement: when a permission this controller answered leaves the
26
+ * pending set, the daemon applied the answer, so an `applied: true` settlement is
27
+ * emitted for that request. This is authoritative evidence (the block resolved),
28
+ * not the transport's admission.
29
+ */
30
+ export interface PermissionSignals {
31
+ readonly currency: ReadonlyArray<readonly [requestId: string, live: boolean]>;
32
+ readonly decisions: readonly DaemonDecisionSettlement[];
33
+ readonly answered: ReadonlySet<string>;
34
+ }
35
+ export declare function derivePermissionSignals(prevPending: ReadonlySet<string>, nextPending: ReadonlySet<string>, answered: ReadonlySet<string>): PermissionSignals;
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { ReactNode } from 'react';
7
- import type { CreateSessionRequest, DaemonBranchSessionRequest, DaemonCapabilities, DaemonBackgroundTurn, DaemonEvent, DaemonApprovalMode, DaemonApprovalModeResult, DaemonAvailableCommand, DaemonForkSessionResult, DaemonInputAnnotation, DaemonSessionBtwResult, DaemonSessionGenerationEvent, DaemonSessionAttachmentReference, DaemonSessionAttachmentData, DaemonMidTurnMessageResult, DaemonMidTurnMessagesResult, DaemonRemoveMidTurnMessageResult, DaemonSendMidTurnMessagesNowResult, DaemonPendingPromptsResult, DaemonRemovePendingPromptResult, DaemonSessionContextStatus, DaemonSessionSavedWorkflowDetail, DaemonSessionContextUsageStatus, DaemonSessionRecapResult, DaemonRewindResult, DaemonRewindSnapshotInfo, DaemonSession, DaemonSessionClient, DaemonSessionPrInfo, DaemonSessionSummary, DaemonSessionSupportedCommandsStatus, DaemonSessionTaskRuntimeStatus, DaemonSessionTaskWithWorkflowStatus, DaemonSessionTasksStatus, DaemonSessionWorkflowTaskStatus, DaemonSessionWorkflowTasksStatus, DaemonSessionStatsStatus, DaemonSessionArtifactsEnvelope, DaemonSessionArtifactInput, DaemonSessionArtifactMutationResult, SessionSourceInput, SessionSourcesResult, SessionSourceUpsertResult, SessionSourceRemoveResult, DaemonSkillToggleMutation, DaemonShellCommandResult, DaemonTranscriptBlock, DaemonTranscriptStore, DaemonWorkspaceGitStatus, DaemonWorkspaceProvidersStatus, DaemonStandaloneCreationRecovery, DaemonStandaloneWorkingDirectory, HeartbeatResult, GoalControlRequest, GoalSnapshotV2, GoalStateResponse, PermissionResponse, PromptContentBlock, PromptResult, ReasoningSelection, SessionMetadataResult, SetModelResult } from '@qwen-code/sdk/daemon';
7
+ import type { CreateSessionRequest, DaemonBranchSessionRequest, DaemonWorktreeBranchResult, DaemonWorktreeHandoffResult, DaemonCapabilities, DaemonBackgroundTurn, DaemonEvent, DaemonApprovalMode, DaemonApprovalModeResult, DaemonAvailableCommand, DaemonForkSessionResult, DaemonInputAnnotation, DaemonSessionBtwResult, DaemonSessionGenerationEvent, DaemonSessionAttachmentReference, DaemonSessionAttachmentData, DaemonMidTurnMessageResult, DaemonMidTurnMessagesResult, DaemonRemoveMidTurnMessageResult, DaemonSendMidTurnMessagesNowResult, DaemonPendingPromptsResult, DaemonRemovePendingPromptResult, DaemonSessionContextStatus, DaemonSessionSavedWorkflowDetail, DaemonSessionContextUsageStatus, DaemonSessionRecapResult, DaemonRewindResult, DaemonRewindSnapshotInfo, DaemonSession, DaemonSessionClient, DaemonSessionPrInfo, DaemonSessionSummary, DaemonSessionSupportedCommandsStatus, DaemonSessionTaskRuntimeStatus, DaemonSessionTaskWithWorkflowStatus, DaemonSessionTasksStatus, DaemonSessionWorkflowTaskStatus, DaemonSessionWorkflowTasksStatus, DaemonSessionStatsStatus, DaemonSessionArtifact, DaemonSessionArtifactsEnvelope, DaemonSessionArtifactInput, DaemonSessionArtifactMutationResult, SessionSourceInput, SessionSourcesResult, SessionSourceUpsertResult, SessionSourceRemoveResult, DaemonSkillToggleMutation, DaemonShellCommandResult, DaemonTranscriptBlock, DaemonTranscriptStore, DaemonWorkspaceGitStatus, DaemonWorkspaceProvidersStatus, DaemonStandaloneCreationRecovery, DaemonStandaloneWorkingDirectory, HeartbeatResult, GoalControlRequest, GoalSnapshotV2, GoalStateResponse, PermissionResponse, PromptContentBlock, PromptResult, ReasoningSelection, SessionMetadataResult, SetModelResult } from '@qwen-code/sdk/daemon';
8
8
  export type DaemonConnectionStatus = 'idle' | 'connecting' | 'connected' | 'disconnected' | 'error';
9
9
  export interface DaemonSessionOwnerSnapshot {
10
10
  isCurrent(): boolean;
@@ -104,6 +104,32 @@ export interface DaemonConnectionState {
104
104
  loadingTranscript?: boolean;
105
105
  /** True while replaying buffered events after a reconnect. */
106
106
  catchingUp?: boolean;
107
+ /**
108
+ * Restored artifact snapshot embedded in the load response. Available before
109
+ * the replay renders so a session-level artifact entry can appear early;
110
+ * live updates still come from the gated artifact fetch.
111
+ */
112
+ restoredArtifacts?: DaemonSessionArtifact[];
113
+ /**
114
+ * Session the restoredArtifacts snapshot belongs to. The optimistic session
115
+ * switch moves sessionId before the new restore lands, so consumers must
116
+ * only use the snapshot when this matches the current sessionId — otherwise
117
+ * the previous session's artifacts leak under the new one.
118
+ */
119
+ restoredArtifactsSessionId?: string;
120
+ /**
121
+ * Artifact count captured from the session-list summary at click time, so
122
+ * the header artifact entry can show it before the load response lands.
123
+ * A hint only: the load-embedded snapshot and the gated fetch supersede it,
124
+ * and the provider clears it once authoritative data commits.
125
+ */
126
+ artifactCountHint?: number;
127
+ /**
128
+ * Session the artifactCountHint belongs to. Same keying contract as
129
+ * restoredArtifactsSessionId: consumers must only use the hint when this
130
+ * matches the current sessionId.
131
+ */
132
+ artifactCountHintSessionId?: string;
107
133
  error?: string;
108
134
  /** Latest HTTP error status kept for diagnostics; use missingSession for UI. */
109
135
  errorStatus?: number;
@@ -239,7 +265,7 @@ export type DaemonPromptSettledListener = (event: DaemonPromptSettledEvent) => v
239
265
  export type DaemonPromptSettlementSubscribe = (listener: DaemonPromptSettledListener) => () => void;
240
266
  export type DaemonNoticeSeverity = 'info' | 'warning' | 'error';
241
267
  export type DaemonNoticeCategory = 'validation' | 'user_action' | 'connection' | 'protocol' | 'lifecycle' | 'system';
242
- export type DaemonNoticeOperation = 'send_prompt' | 'continue_session' | 'send_shell_command' | 'switch_model' | 'set_reasoning_effort' | 'set_workflow_mode' | 'set_approval_mode' | 'submit_permission' | 'cancel_prompt' | 'attach_session' | 'load_session' | 'resume_session' | 'create_session' | 'close_session' | 'rename_session' | 'bind_session_pr' | 'release_session' | 'list_sessions' | 'load_context' | 'load_context_usage' | 'load_tasks' | 'load_artifacts' | 'read_attachment' | 'remove_attachment' | 'cancel_task' | 'control_workflow' | 'run_saved_workflow' | 'read_saved_workflow' | 'load_goal' | 'control_goal' | 'clear_goal' | 'load_stats' | 'rewind_snapshots' | 'rewind_session' | 'refresh_commands' | 'recap_session' | 'generate_session_content' | 'btw_session' | 'branch_session' | 'fork_session' | 'record_session' | 'stream' | 'normalize_event';
268
+ export type DaemonNoticeOperation = 'send_prompt' | 'continue_session' | 'send_shell_command' | 'switch_model' | 'set_reasoning_effort' | 'set_workflow_mode' | 'set_approval_mode' | 'submit_permission' | 'cancel_prompt' | 'attach_session' | 'load_session' | 'resume_session' | 'create_session' | 'close_session' | 'rename_session' | 'bind_session_pr' | 'release_session' | 'list_sessions' | 'load_context' | 'load_context_usage' | 'load_tasks' | 'load_artifacts' | 'read_attachment' | 'remove_attachment' | 'cancel_task' | 'control_workflow' | 'run_saved_workflow' | 'read_saved_workflow' | 'load_goal' | 'control_goal' | 'clear_goal' | 'load_stats' | 'rewind_snapshots' | 'rewind_session' | 'refresh_commands' | 'recap_session' | 'generate_session_content' | 'btw_session' | 'branch_session' | 'create_worktree_branch' | 'handoff_worktree' | 'fork_session' | 'record_session' | 'stream' | 'normalize_event';
243
269
  export interface DaemonSessionNotice {
244
270
  id: string;
245
271
  severity: DaemonNoticeSeverity;
@@ -328,6 +354,8 @@ export interface PendingPromptActionOptions {
328
354
  }
329
355
  export interface GetTasksActionOptions {
330
356
  silent?: boolean;
357
+ /** Also list the sends the daemon reports back to this session. */
358
+ includeSubSessions?: boolean;
331
359
  }
332
360
  export interface DaemonPromptImage {
333
361
  data: string;
@@ -433,6 +461,9 @@ export interface DaemonSessionActions {
433
461
  loadSession(sessionId: string, options?: {
434
462
  workspaceCwd?: string;
435
463
  sessionContext?: DaemonProductSessionContext;
464
+ /** Artifact count from the clicked session's list summary, shown in
465
+ * the header entry before the load response lands. Omit when unknown. */
466
+ artifactCountHint?: number;
436
467
  }): Promise<void>;
437
468
  /** `memory` replay is reserved for the provider's live-journal repair. */
438
469
  reloadSession(signal: AbortSignal, options?: {
@@ -640,6 +671,10 @@ export interface DaemonSessionActions {
640
671
  switchStarted: boolean;
641
672
  sourceWarnings?: string[];
642
673
  }>;
674
+ /** "Create branch here" on the session's detached managed worktree. */
675
+ createWorktreeBranch(name: string): Promise<DaemonWorktreeBranchResult>;
676
+ /** "Hand off" between the managed worktree and the local checkout. */
677
+ handoffWorktree(to: 'local' | 'worktree'): Promise<DaemonWorktreeHandoffResult>;
643
678
  forkSession(directive: string): Promise<DaemonForkSessionResult>;
644
679
  }
645
680
  export interface DaemonSessionContextValue {
@@ -660,6 +695,11 @@ export interface DaemonWorkspaceEventSignals {
660
695
  extensionsVersion: number;
661
696
  artifactsVersion: number;
662
697
  sourcesVersion?: number;
698
+ /**
699
+ * Per caller session: how many times a send it made that the daemon
700
+ * reports back started or settled. Re-read its sub-session tasks on change.
701
+ */
702
+ subSessionTaskVersions?: Record<string, number>;
663
703
  lastExtensionChange?: {
664
704
  status?: 'installed' | 'enabled' | 'disabled' | 'updated' | 'uninstalled' | 'failed';
665
705
  source?: string;
@@ -0,0 +1,15 @@
1
+ import type { SessionChatController } from '../chat-core/contract.js';
2
+ /**
3
+ * Binds the daemon session provider to the backend-neutral chat controller
4
+ * (slice 2d). It constructs {@link createDaemonChatController} once per session
5
+ * and feeds it live provider facts, wiring the intent transports to the session
6
+ * actions and deriving the two evidence channels the provider does not expose
7
+ * explicitly: prompt settlement comes from the terminal-event subscription, and
8
+ * approval currency / decision settlement are derived from the pending-permission
9
+ * set (see {@link derivePermissionSignals}).
10
+ *
11
+ * The optional capability-gated sub-controllers (model / approval-mode / context
12
+ * usage / session ops) are not bound yet; their regions stay hidden until a later
13
+ * increment wires them, so this binding is additive and renders nothing on its own.
14
+ */
15
+ export declare function useDaemonChatController(): SessionChatController;
@@ -19,4 +19,9 @@ export declare function useDaemonAgents(options?: DaemonResourceOptions): {
19
19
  data: import("@qwen-code/sdk/daemon").DaemonWorkspaceAgentsStatus | undefined;
20
20
  loading: boolean;
21
21
  error: Error | undefined;
22
+ reloadWithOutcome: () => Promise<{
23
+ data: import("@qwen-code/sdk/daemon").DaemonWorkspaceAgentsStatus | undefined;
24
+ superseded: boolean;
25
+ error?: Error;
26
+ }>;
22
27
  };
@@ -21,4 +21,9 @@ export declare function useDaemonAuth(options?: DaemonResourceOptions): {
21
21
  data: import("@qwen-code/sdk/daemon").DaemonAuthStatusSnapshot | undefined;
22
22
  loading: boolean;
23
23
  error: Error | undefined;
24
+ reloadWithOutcome: () => Promise<{
25
+ data: import("@qwen-code/sdk/daemon").DaemonAuthStatusSnapshot | undefined;
26
+ superseded: boolean;
27
+ error?: Error;
28
+ }>;
24
29
  };
@@ -27,5 +27,10 @@ export declare function useDaemonChannelEvents(options?: DaemonChannelEventsOpti
27
27
  reload: () => Promise<ChannelEventsSnapshot | undefined>;
28
28
  loading: boolean;
29
29
  error: Error | undefined;
30
+ reloadWithOutcome: () => Promise<{
31
+ data: ChannelEventsSnapshot | undefined;
32
+ superseded: boolean;
33
+ error?: Error;
34
+ }>;
30
35
  };
31
36
  export {};
@@ -5,6 +5,18 @@
5
5
  */
6
6
  import type { DaemonResourceOptions } from '../types.js';
7
7
  export declare function useDaemonDiagnostics(options?: DaemonResourceOptions): {
8
- env: import("../types.js").ResourceResult<import("@qwen-code/sdk/daemon").DaemonWorkspaceEnvStatus>;
9
- preflight: import("../types.js").ResourceResult<import("@qwen-code/sdk/daemon").DaemonWorkspacePreflightStatus>;
8
+ env: import("../types.js").ResourceResult<import("@qwen-code/sdk/daemon").DaemonWorkspaceEnvStatus> & {
9
+ reloadWithOutcome: () => Promise<{
10
+ data: import("@qwen-code/sdk/daemon").DaemonWorkspaceEnvStatus | undefined;
11
+ superseded: boolean;
12
+ error?: Error;
13
+ }>;
14
+ };
15
+ preflight: import("../types.js").ResourceResult<import("@qwen-code/sdk/daemon").DaemonWorkspacePreflightStatus> & {
16
+ reloadWithOutcome: () => Promise<{
17
+ data: import("@qwen-code/sdk/daemon").DaemonWorkspacePreflightStatus | undefined;
18
+ superseded: boolean;
19
+ error?: Error;
20
+ }>;
21
+ };
10
22
  };
@@ -27,5 +27,10 @@ export declare function useDaemonMcp(options?: DaemonMcpOptions): {
27
27
  data: import("@qwen-code/sdk/daemon").DaemonWorkspaceMcpStatus | undefined;
28
28
  loading: boolean;
29
29
  error: Error | undefined;
30
+ reloadWithOutcome: () => Promise<{
31
+ data: import("@qwen-code/sdk/daemon").DaemonWorkspaceMcpStatus | undefined;
32
+ superseded: boolean;
33
+ error?: Error;
34
+ }>;
30
35
  };
31
36
  export {};
@@ -19,4 +19,9 @@ export declare function useDaemonMemory(options?: DaemonResourceOptions): {
19
19
  data: import("@qwen-code/sdk/daemon").DaemonWorkspaceMemoryStatus | undefined;
20
20
  loading: boolean;
21
21
  error: Error | undefined;
22
+ reloadWithOutcome: () => Promise<{
23
+ data: import("@qwen-code/sdk/daemon").DaemonWorkspaceMemoryStatus | undefined;
24
+ superseded: boolean;
25
+ error?: Error;
26
+ }>;
22
27
  };
@@ -17,4 +17,9 @@ export declare function useDaemonProviders(options?: DaemonResourceOptions): {
17
17
  data: import("@qwen-code/sdk/daemon").DaemonWorkspaceProvidersStatus | undefined;
18
18
  loading: boolean;
19
19
  error: Error | undefined;
20
+ reloadWithOutcome: () => Promise<{
21
+ data: import("@qwen-code/sdk/daemon").DaemonWorkspaceProvidersStatus | undefined;
22
+ superseded: boolean;
23
+ error?: Error;
24
+ }>;
20
25
  };
@@ -4,4 +4,10 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { DaemonResourceOptions, ResourceResult } from '../types.js';
7
- export declare function useDaemonResource<T>(load: () => Promise<T>, options: DaemonResourceOptions): ResourceResult<T>;
7
+ export declare function useDaemonResource<T>(load: () => Promise<T>, options: DaemonResourceOptions): ResourceResult<T> & {
8
+ reloadWithOutcome: () => Promise<{
9
+ data: T | undefined;
10
+ superseded: boolean;
11
+ error?: Error;
12
+ }>;
13
+ };
@@ -24,6 +24,7 @@ export declare function useDaemonSessions(options?: DaemonSessionsOptions): {
24
24
  loadSession: ((sessionId: string, options?: {
25
25
  workspaceCwd?: string;
26
26
  sessionContext?: import("../../index.js").DaemonProductSessionContext;
27
+ artifactCountHint?: number;
27
28
  }) => Promise<void>) | undefined;
28
29
  resumeSession: ((sessionId: string, options?: {
29
30
  workspaceCwd?: string;
@@ -45,4 +46,9 @@ export declare function useDaemonSessions(options?: DaemonSessionsOptions): {
45
46
  unarchiveSession: (sessionId: string) => Promise<boolean>;
46
47
  loading: boolean;
47
48
  error: Error | undefined;
49
+ reloadWithOutcome: () => Promise<{
50
+ data: import("@qwen-code/sdk/daemon").DaemonSessionListPage | undefined;
51
+ superseded: boolean;
52
+ error?: Error;
53
+ }>;
48
54
  };
@@ -17,4 +17,9 @@ export declare function useDaemonSettings(options?: DaemonResourceOptions): {
17
17
  data: import("@qwen-code/sdk/daemon").DaemonWorkspaceSettingsStatus | undefined;
18
18
  loading: boolean;
19
19
  error: Error | undefined;
20
+ reloadWithOutcome: () => Promise<{
21
+ data: import("@qwen-code/sdk/daemon").DaemonWorkspaceSettingsStatus | undefined;
22
+ superseded: boolean;
23
+ error?: Error;
24
+ }>;
20
25
  };
@@ -15,4 +15,9 @@ export declare function useDaemonStatusReport(options?: DaemonStatusReportOption
15
15
  data: import("@qwen-code/sdk/daemon").DaemonStatusReport | undefined;
16
16
  loading: boolean;
17
17
  error: Error | undefined;
18
+ reloadWithOutcome: () => Promise<{
19
+ data: import("@qwen-code/sdk/daemon").DaemonStatusReport | undefined;
20
+ superseded: boolean;
21
+ error?: Error;
22
+ }>;
18
23
  };
@@ -13,4 +13,9 @@ export declare function useDaemonTools(options?: DaemonResourceOptions): {
13
13
  data: import("@qwen-code/sdk/daemon").DaemonWorkspaceToolsStatus | undefined;
14
14
  loading: boolean;
15
15
  error: Error | undefined;
16
+ reloadWithOutcome: () => Promise<{
17
+ data: import("@qwen-code/sdk/daemon").DaemonWorkspaceToolsStatus | undefined;
18
+ superseded: boolean;
19
+ error?: Error;
20
+ }>;
16
21
  };
@@ -24,4 +24,9 @@ export declare function useDaemonUsageDashboard(options?: DaemonUsageDashboardOp
24
24
  data: import("@qwen-code/sdk/daemon").DaemonUsageDashboard | undefined;
25
25
  loading: boolean;
26
26
  error: Error | undefined;
27
+ reloadWithOutcome: () => Promise<{
28
+ data: import("@qwen-code/sdk/daemon").DaemonUsageDashboard | undefined;
29
+ superseded: boolean;
30
+ error?: Error;
31
+ }>;
27
32
  };
@@ -41,6 +41,7 @@ export interface GeneratedUiInstance {
41
41
  canMessage: boolean;
42
42
  token?: object;
43
43
  lease?: Lease;
44
+ reloadOnGrant?: boolean;
44
45
  leaseGeneration?: number;
45
46
  parkedAt?: number;
46
47
  timer?: ReturnType<typeof setTimeout>;
@@ -50,7 +51,7 @@ export interface GeneratedUiInstance {
50
51
  reopened: boolean;
51
52
  getSignal(): AbortSignal;
52
53
  isVisible(): boolean;
53
- reset(): void;
54
+ reset(clear?: () => Promise<boolean>): void;
54
55
  };
55
56
  }
56
57
  interface InstanceRecord {
@@ -63,6 +64,7 @@ export declare function instanceKey(source: McpAppGeneratedUiOwnerSource, toolId
63
64
  export declare function resourceKey(display: McpAppDisplay, eventEpoch?: string, capabilities?: {
64
65
  tools: boolean;
65
66
  messages: boolean;
67
+ viewState?: boolean;
66
68
  }): string;
67
69
  export declare class GeneratedUiInstanceStore {
68
70
  private records;
@@ -83,6 +85,7 @@ export declare class GeneratedUiInstanceStore {
83
85
  private revoke;
84
86
  private grant;
85
87
  attach(slot: InstanceSlot, explicit?: boolean): GeneratedUiInstance | undefined;
88
+ private viewState;
86
89
  update(slot: InstanceSlot): void;
87
90
  release(key: string, token: object): void;
88
91
  dispose(key: string, reason: string): void;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Qwen Team
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { DaemonGeneratedUiState, DaemonGeneratedUiStateWriteResult } from '@qwen-code/sdk/daemon';
7
+ /** The App frame asks for these; the host answers for the card it mounted. */
8
+ export declare const VIEW_STATE_CAPABILITY = "qwen-code/generated-ui-state";
9
+ export declare const VIEW_STATE_LOAD = "qwen-code/generated-ui-state/load";
10
+ export declare const VIEW_STATE_SAVE = "qwen-code/generated-ui-state/save";
11
+ export interface ViewStateStore {
12
+ sessionId: string;
13
+ get(cardId: string): Promise<DaemonGeneratedUiState>;
14
+ set(cardId: string, write: {
15
+ baseRevision: number;
16
+ value: unknown;
17
+ }): Promise<DaemonGeneratedUiStateWriteResult>;
18
+ /** Admits a save now and binds its eventual write to the current owner. */
19
+ captureWrite?(): ViewStateStore['set'];
20
+ }
21
+ export type ViewStateStatus = 'saving' | 'saved' | 'stale' | 'too_large' | 'failed' | 'unavailable';
22
+ /** The card id the bundled Generated UI server minted into its result. */
23
+ export declare function generatedUiCardId(toolResult: unknown): string | undefined;
24
+ /**
25
+ * One mounted card's saved state. Saves are sent as soon as the previous one
26
+ * settles, so only changes made while a write is in flight are coalesced.
27
+ */
28
+ export declare class ViewStateCoordinator {
29
+ private readonly store;
30
+ private readonly cardId;
31
+ private readonly onStatus;
32
+ private revision?;
33
+ private saved?;
34
+ private pending?;
35
+ private inFlight?;
36
+ private stale;
37
+ private latestSaveFailure?;
38
+ private last?;
39
+ private readonly key;
40
+ constructor(store: ViewStateStore, cardId: string, onStatus: (status: ViewStateStatus) => void);
41
+ load(signal?: AbortSignal): Promise<unknown>;
42
+ save(value: unknown): void;
43
+ /**
44
+ * Clears the saved state for the host's reset. This mount saves nothing
45
+ * afterwards; the reset mounts the card again. It reads the current
46
+ * revision first, so it also works after a stale write or a failed load.
47
+ */
48
+ clear(): Promise<boolean>;
49
+ private pump;
50
+ private report;
51
+ }
@@ -63,7 +63,7 @@ export interface BuiltinProviderCache {
63
63
  mcpResources: Map<string, Promise<McpResources>>;
64
64
  }
65
65
  export declare function createBuiltinProviderCache(): BuiltinProviderCache;
66
- export declare function getCached<K, V>(cache: Map<K, Promise<V>>, key: K, load: () => Promise<V>): Promise<V>;
66
+ export declare function getCached<K, V>(cache: Map<K, Promise<V>>, key: K, load: () => Promise<V>, signal: AbortSignal): Promise<V>;
67
67
  export interface AtMentionWorkspaceActions {
68
68
  globWorkspace?: GlobWorkspaceFn;
69
69
  searchWorkspaceFiles?: (query: string, signal: AbortSignal) => Promise<string[]>;
@@ -3,8 +3,8 @@ import { EditorView } from '@codemirror/view';
3
3
  import { Compartment } from '@codemirror/state';
4
4
  import type { CommandInfo } from '../adapters/types';
5
5
  import type { PromptFile, PromptImage } from '../adapters/promptTypes';
6
- import { type UseDaemonFollowupSuggestionReturn } from '@qwen-code/web-shell/daemon-react-sdk';
7
- import { type SkillInfo, type SlashCommandCompletionResult } from '../completions/slashCompletion';
6
+ import type { UseDaemonFollowupSuggestionReturn } from '@qwen-code/web-shell/daemon-react-sdk';
7
+ import { type SkillInfo, type SlashArgumentCompleter, type SlashCommandCompletionResult } from '../completions/slashCompletion';
8
8
  import { type CommandDisplayCategoryOrder } from '../utils/commandDisplay';
9
9
  import { type AtMentionMenuState, type AtMentionWorkspaceActions } from './useAtMentionMenu';
10
10
  export { getComposerTagDisplay, getComposerTagLabel, getComposerTagValue, } from '../utils/composerTag';
@@ -63,6 +63,15 @@ export interface ComposerSubmitMetadata {
63
63
  }
64
64
  export interface UseComposerCoreOptions {
65
65
  onSubmit: (text: string, images?: PromptImage[], files?: PromptFile[], commitAccepted?: ComposerSubmitCommit, metadata?: ComposerSubmitMetadata) => boolean | void;
66
+ /**
67
+ * Awaited before a user-initiated submit (Send button or Enter) reads the
68
+ * draft, so the host can finalize pending input first — e.g. stop voice
69
+ * dictation and insert its final transcript. Submits stay synchronous when
70
+ * it is absent. While it runs, further user submits are ignored and
71
+ * `submitPreparing` is true; a session switch, unmount, or a rejecting
72
+ * finalizer cancels the submit.
73
+ */
74
+ prepareSubmit?: () => Promise<void>;
66
75
  onInputTextChange?: (text: string) => void;
67
76
  onCycleMode?: () => void;
68
77
  cycleModeOnTab?: boolean;
@@ -80,6 +89,8 @@ export interface UseComposerCoreOptions {
80
89
  commands: CommandInfo[];
81
90
  skills?: SkillInfo[];
82
91
  allowEmptySlashMenu?: boolean;
92
+ /** Completes arguments the static subcommand trees cannot (`/send`). */
93
+ slashArgumentCompleter?: SlashArgumentCompleter;
83
94
  slashCommandCategoryOrder?: CommandDisplayCategoryOrder;
84
95
  autoSubmitSlashCommands?: boolean;
85
96
  queuedMessages?: string[];
@@ -185,6 +196,15 @@ export interface UseComposerCoreReturn {
185
196
  hasAttachments: boolean;
186
197
  hasContent: boolean;
187
198
  canSubmit: boolean;
199
+ /**
200
+ * The content-independent submit guards (disabled, submitDisabled, draft
201
+ * restore, pending attachment batches, workspace upload). `canSubmit` is
202
+ * `!submitBlocked && hasContent`; render sites that relax the content term
203
+ * must keep these guards.
204
+ */
205
+ submitBlocked: boolean;
206
+ /** True while `prepareSubmit` is running ahead of a user-initiated submit. */
207
+ submitPreparing: boolean;
188
208
  pendingImageBatchCount: number;
189
209
  imageDragActive: boolean;
190
210
  clearImageDragState: () => void;
@@ -0,0 +1,7 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { DaemonWorkspaceContextValue } from '../daemon/workspace/types.js';
3
+ export declare function ComposerWorkspaceProvider({ value, children, }: {
4
+ value: DaemonWorkspaceContextValue | undefined;
5
+ children: ReactNode;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ export declare function useOptionalComposerWorkspace(): DaemonWorkspaceContextValue | undefined;
@@ -10,6 +10,7 @@
10
10
  * CodeMirror editor.
11
11
  */
12
12
  export declare const TOUCH_COMPOSER_QUERY = "(hover: none) and (pointer: coarse)";
13
+ export declare const MODEL_SHEET_QUERY = "(hover: none) and (pointer: coarse), (max-width: 639px)";
13
14
  /**
14
15
  * Raw device detection, ignoring the URL override. Used to gate programmatic
15
16
  * (non-gesture) `view.focus()` calls: on iOS, focusing an editable element