@av-pi-studio/workbench 0.0.0-stage → 0.0.117

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 (273) hide show
  1. package/README.md +157 -2
  2. package/dist/chunks/BinaryFallbackViewer-BN-9Yvel.js +19 -0
  3. package/dist/chunks/ChatPanel-CjPUJMEs.js +2493 -0
  4. package/dist/chunks/CodeView-6kJms_MF.js +143 -0
  5. package/dist/chunks/DiffView-BqDuT3CF.js +48 -0
  6. package/dist/chunks/FilePanel-B8IXG2bj.js +92 -0
  7. package/dist/chunks/HtmlViewer-DpuVFaDo.js +490 -0
  8. package/dist/chunks/ImageViewer-BBfyA5QN.js +27 -0
  9. package/dist/chunks/MarkdownFileViewer-DPFPDS7G.js +88 -0
  10. package/dist/chunks/ModelProvidersPanel-Dsezq7Ss.js +95 -0
  11. package/dist/chunks/MoleculeViewerPanel-DEEU6Zkx.js +191 -0
  12. package/dist/chunks/PdfViewer-BdacmAu_.js +300 -0
  13. package/dist/chunks/SaveFileButton-2rOu02Xx.js +33 -0
  14. package/dist/chunks/SettingsDialog-DO1tDhMW.js +471 -0
  15. package/dist/chunks/SkillsPanel-DZDia4Pw.js +833 -0
  16. package/dist/chunks/TerminalPanel-bphwCSyW.js +242 -0
  17. package/dist/chunks/TextViewer-CVGqN6yy.js +63 -0
  18. package/dist/chunks/VideoViewer-BkB9BoOr.js +20 -0
  19. package/dist/chunks/ViewersPanel-C2E9FLf7.js +50 -0
  20. package/dist/chunks/href-resolution-jv3tpRcp.js +25 -0
  21. package/dist/chunks/index-Dlz8mEKZ.js +6258 -0
  22. package/dist/chunks/markdown-B2OXhZ-_.js +353 -0
  23. package/dist/chunks/provider-auth-store-C1GaLTlw.js +34 -0
  24. package/dist/chunks/use-file-download-CogCqTvU.js +31 -0
  25. package/dist/chunks/use-file-watch-Bb_Xzbr-.js +55 -0
  26. package/dist/chunks/use-provider-auth-list-DTjIZycd.js +16 -0
  27. package/dist/features/agent-ui/AskCard.d.ts +62 -0
  28. package/dist/features/agent-ui/agent-ui-store.d.ts +84 -0
  29. package/dist/features/agent-ui/announce.d.ts +51 -0
  30. package/dist/features/agent-ui/ask-list.d.ts +53 -0
  31. package/dist/features/agent-ui/ask-placement.d.ts +47 -0
  32. package/dist/features/agent-ui/deadline.d.ts +27 -0
  33. package/dist/features/agent-ui/keyboard.d.ts +37 -0
  34. package/dist/features/agent-ui/notify-effect.d.ts +41 -0
  35. package/dist/features/agent-ui/option-layout.d.ts +24 -0
  36. package/dist/features/agent-ui/outcome-line.d.ts +38 -0
  37. package/dist/features/agent-ui/prompt-text.d.ts +24 -0
  38. package/dist/features/chat/Attachments.d.ts +20 -0
  39. package/dist/features/chat/ChatPanel.d.ts +12 -0
  40. package/dist/features/chat/CommandMenu.d.ts +41 -0
  41. package/dist/features/chat/Composer.d.ts +58 -0
  42. package/dist/features/chat/ForkDialog.d.ts +24 -0
  43. package/dist/features/chat/ModelMenu.d.ts +54 -0
  44. package/dist/features/chat/ThinkingMenu.d.ts +39 -0
  45. package/dist/features/chat/Timeline.d.ts +30 -0
  46. package/dist/features/chat/TurnProgressBar.d.ts +14 -0
  47. package/dist/features/chat/composer-busy.d.ts +22 -0
  48. package/dist/features/chat/composer-gate.d.ts +37 -0
  49. package/dist/features/chat/composer-path-drop.d.ts +75 -0
  50. package/dist/features/chat/fork-correlation.d.ts +39 -0
  51. package/dist/features/chat/fork-gate.d.ts +27 -0
  52. package/dist/features/chat/fork-picker-nav.d.ts +14 -0
  53. package/dist/features/chat/fork-result.d.ts +43 -0
  54. package/dist/features/chat/model-menu-sort.d.ts +30 -0
  55. package/dist/features/chat/onboarding-nudge.d.ts +18 -0
  56. package/dist/features/chat/rows/AssistantRow.d.ts +24 -0
  57. package/dist/features/chat/rows/CompactionRow.d.ts +16 -0
  58. package/dist/features/chat/rows/ErrorRow.d.ts +13 -0
  59. package/dist/features/chat/rows/ReasoningRow.d.ts +16 -0
  60. package/dist/features/chat/rows/RowShell.d.ts +37 -0
  61. package/dist/features/chat/rows/SystemRow.d.ts +11 -0
  62. package/dist/features/chat/rows/ToolCard.d.ts +30 -0
  63. package/dist/features/chat/rows/UserRow.d.ts +43 -0
  64. package/dist/features/chat/slash-commands.d.ts +81 -0
  65. package/dist/features/chat/thinking-level-source.d.ts +29 -0
  66. package/dist/features/chat/todos/TodoPanel.d.ts +11 -0
  67. package/dist/features/chat/todos/agent-todos-store.d.ts +35 -0
  68. package/dist/features/chat/todos/todo-collapse-codec.d.ts +12 -0
  69. package/dist/features/chat/todos/todo-panel-model.d.ts +37 -0
  70. package/dist/features/chat/use-bottom-anchor.d.ts +33 -0
  71. package/dist/features/chat/use-fork-action.d.ts +32 -0
  72. package/dist/features/connection/ConnectionBar.d.ts +18 -0
  73. package/dist/features/connection/connection-presentation.d.ts +70 -0
  74. package/dist/features/files/BinaryFallbackViewer.d.ts +9 -0
  75. package/dist/features/files/CodeView.d.ts +15 -0
  76. package/dist/features/files/DiffView.d.ts +18 -0
  77. package/dist/features/files/FileContextMenu.d.ts +13 -0
  78. package/dist/features/files/FileExplorer.d.ts +24 -0
  79. package/dist/features/files/FilePanel.d.ts +26 -0
  80. package/dist/features/files/HtmlViewer.d.ts +22 -0
  81. package/dist/features/files/ImageViewer.d.ts +8 -0
  82. package/dist/features/files/MarkdownFileViewer.d.ts +14 -0
  83. package/dist/features/files/MoleculeViewer.d.ts +60 -0
  84. package/dist/features/files/MoleculeViewerPanel.d.ts +9 -0
  85. package/dist/features/files/PdfViewer.d.ts +14 -0
  86. package/dist/features/files/RightSidebar.d.ts +9 -0
  87. package/dist/features/files/SaveFileButton.d.ts +9 -0
  88. package/dist/features/files/TextViewer.d.ts +23 -0
  89. package/dist/features/files/TreeDraftRow.d.ts +15 -0
  90. package/dist/features/files/TreeNode.d.ts +42 -0
  91. package/dist/features/files/TreeRenameRow.d.ts +19 -0
  92. package/dist/features/files/VideoViewer.d.ts +8 -0
  93. package/dist/features/files/create-entry.d.ts +23 -0
  94. package/dist/features/files/delete-entry.d.ts +17 -0
  95. package/dist/features/files/file-tree.d.ts +92 -0
  96. package/dist/features/files/git-status-index.d.ts +37 -0
  97. package/dist/features/files/html-asset-loader.d.ts +43 -0
  98. package/dist/features/files/html-assets.d.ts +97 -0
  99. package/dist/features/files/html-sandbox.d.ts +62 -0
  100. package/dist/features/files/molecule-reload.d.ts +20 -0
  101. package/dist/features/files/molecule-source.d.ts +10 -0
  102. package/dist/features/files/molecule-theme.d.ts +31 -0
  103. package/dist/features/files/move-entry.d.ts +10 -0
  104. package/dist/features/files/move-status.d.ts +10 -0
  105. package/dist/features/files/move-target.d.ts +31 -0
  106. package/dist/features/files/open-file-tab.d.ts +32 -0
  107. package/dist/features/files/pdf-layout.d.ts +28 -0
  108. package/dist/features/files/pdfjs-runtime.d.ts +30 -0
  109. package/dist/features/files/polymer-file.d.ts +33 -0
  110. package/dist/features/files/text-viewer-state.d.ts +53 -0
  111. package/dist/features/files/upload-sources.d.ts +20 -0
  112. package/dist/features/files/viewer-registry.d.ts +81 -0
  113. package/dist/features/files/write-file.d.ts +12 -0
  114. package/dist/features/git/ChangesPanel.d.ts +13 -0
  115. package/dist/features/provider-auth/LoginDialog.d.ts +21 -0
  116. package/dist/features/provider-auth/ModelProvidersPanel.d.ts +12 -0
  117. package/dist/features/provider-auth/QrCode.d.ts +26 -0
  118. package/dist/features/provider-auth/login-flow.d.ts +55 -0
  119. package/dist/features/provider-auth/provider-auth-presentation.d.ts +31 -0
  120. package/dist/features/provider-auth/provider-auth-store.d.ts +42 -0
  121. package/dist/features/sessions/SessionContextMenu.d.ts +11 -0
  122. package/dist/features/sessions/SessionItem.d.ts +22 -0
  123. package/dist/features/sessions/SessionList.d.ts +9 -0
  124. package/dist/features/sessions/WorkspaceContextMenu.d.ts +9 -0
  125. package/dist/features/sessions/WorkspaceGroupHeader.d.ts +26 -0
  126. package/dist/features/sessions/apply-agent-deep-link.d.ts +7 -0
  127. package/dist/features/sessions/open-chat-tab.d.ts +14 -0
  128. package/dist/features/sessions/open-workspace.d.ts +20 -0
  129. package/dist/features/sessions/session-actions.d.ts +18 -0
  130. package/dist/features/sessions/session-presentation.d.ts +47 -0
  131. package/dist/features/sessions/status-map.d.ts +10 -0
  132. package/dist/features/sessions/workspace-grouping.d.ts +30 -0
  133. package/dist/features/settings/SettingsDialog.d.ts +22 -0
  134. package/dist/features/settings/ViewersPanel.d.ts +18 -0
  135. package/dist/features/settings/settings-categories.d.ts +32 -0
  136. package/dist/features/skills/InstallSkillDialog.d.ts +21 -0
  137. package/dist/features/skills/SkillsPanel.d.ts +32 -0
  138. package/dist/features/skills/skills-presentation.d.ts +159 -0
  139. package/dist/features/skills/use-skills.d.ts +215 -0
  140. package/dist/features/terminal/TerminalPanel.d.ts +37 -0
  141. package/dist/features/terminal/terminal-font.d.ts +44 -0
  142. package/dist/features/terminal/terminal-size.d.ts +52 -0
  143. package/dist/features/workspace/ContextMeter.d.ts +15 -0
  144. package/dist/features/workspace/ContextMeterPopover.d.ts +16 -0
  145. package/dist/features/workspace/DropPreview.d.ts +23 -0
  146. package/dist/features/workspace/PaneDividers.d.ts +30 -0
  147. package/dist/features/workspace/StatusBar.d.ts +16 -0
  148. package/dist/features/workspace/TabContextMenu.d.ts +15 -0
  149. package/dist/features/workspace/TabPanelHost.d.ts +30 -0
  150. package/dist/features/workspace/TabStrip.d.ts +36 -0
  151. package/dist/features/workspace/compact-action.d.ts +21 -0
  152. package/dist/features/workspace/context-meter.d.ts +26 -0
  153. package/dist/features/workspace/external-drag.d.ts +99 -0
  154. package/dist/features/workspace/pane-dnd.d.ts +70 -0
  155. package/dist/features/workspace/pane-layout-view.d.ts +73 -0
  156. package/dist/features/workspace/pane-tree.d.ts +141 -0
  157. package/dist/features/workspace/panel-registry.d.ts +13 -0
  158. package/dist/features/workspace/reopen-client-tabs.d.ts +44 -0
  159. package/dist/features/workspace/restore-active-workspace.d.ts +30 -0
  160. package/dist/features/workspace/status-bar-format.d.ts +20 -0
  161. package/dist/features/workspace/tab-attention.d.ts +35 -0
  162. package/dist/features/workspace-picker/OpenWorkspaceDialog.d.ts +11 -0
  163. package/dist/fonts/CascadiaMono.woff2 +0 -0
  164. package/dist/fonts/CascadiaMonoNF.woff2 +0 -0
  165. package/dist/fonts/LICENSE-Cascadia.txt +97 -0
  166. package/dist/fonts.css +60 -0
  167. package/dist/hooks/agent-stream-events.d.ts +20 -0
  168. package/dist/hooks/file-text-state.d.ts +31 -0
  169. package/dist/hooks/file-transfer-instance.d.ts +10 -0
  170. package/dist/hooks/use-agent-commands.d.ts +18 -0
  171. package/dist/hooks/use-agent-deep-link-boot.d.ts +9 -0
  172. package/dist/hooks/use-agent-stream.d.ts +15 -0
  173. package/dist/hooks/use-agent-todos.d.ts +10 -0
  174. package/dist/hooks/use-checkout-status.d.ts +13 -0
  175. package/dist/hooks/use-connection.d.ts +27 -0
  176. package/dist/hooks/use-explorer-tree.d.ts +20 -0
  177. package/dist/hooks/use-explorer-watch.d.ts +39 -0
  178. package/dist/hooks/use-explorer.d.ts +21 -0
  179. package/dist/hooks/use-external-pane-drop.d.ts +47 -0
  180. package/dist/hooks/use-file-diff.d.ts +9 -0
  181. package/dist/hooks/use-file-download.d.ts +18 -0
  182. package/dist/hooks/use-file-live-refresh.d.ts +31 -0
  183. package/dist/hooks/use-file-read.d.ts +31 -0
  184. package/dist/hooks/use-file-source.d.ts +16 -0
  185. package/dist/hooks/use-file-text.d.ts +21 -0
  186. package/dist/hooks/use-file-transfer.d.ts +18 -0
  187. package/dist/hooks/use-file-watch.d.ts +36 -0
  188. package/dist/hooks/use-home-dir.d.ts +14 -0
  189. package/dist/hooks/use-inline-image.d.ts +37 -0
  190. package/dist/hooks/use-is-compacting.d.ts +9 -0
  191. package/dist/hooks/use-pane-drag.d.ts +40 -0
  192. package/dist/hooks/use-pane-layout.d.ts +40 -0
  193. package/dist/hooks/use-provider-auth-list.d.ts +19 -0
  194. package/dist/hooks/use-provider-models.d.ts +14 -0
  195. package/dist/hooks/use-session-restore.d.ts +44 -0
  196. package/dist/hooks/use-session-stats.d.ts +40 -0
  197. package/dist/hooks/use-shortcuts.d.ts +6 -0
  198. package/dist/hooks/use-terminal-exit-watch.d.ts +47 -0
  199. package/dist/hooks/use-terminal-restore.d.ts +38 -0
  200. package/dist/hooks/use-thinking-levels.d.ts +13 -0
  201. package/dist/hooks/use-timeline-reset-watch.d.ts +43 -0
  202. package/dist/hooks/use-viewer-settings.d.ts +17 -0
  203. package/dist/host/browser-clipboard.d.ts +9 -0
  204. package/dist/host/browser-connection.d.ts +13 -0
  205. package/dist/host/browser-files.d.ts +9 -0
  206. package/dist/host/browser-host.d.ts +14 -0
  207. package/dist/host/browser-launch.d.ts +19 -0
  208. package/dist/host/browser-worker-timers.d.ts +29 -0
  209. package/dist/host/external-link.d.ts +14 -0
  210. package/dist/host/index.d.ts +4 -0
  211. package/dist/host/install.d.ts +21 -0
  212. package/dist/host/types.d.ts +168 -0
  213. package/dist/index.d.ts +14 -0
  214. package/dist/index.js +18 -0
  215. package/dist/lib/agent-deep-link.d.ts +29 -0
  216. package/dist/lib/connection/connection-store.d.ts +49 -0
  217. package/dist/lib/connection/files-changed.d.ts +41 -0
  218. package/dist/lib/connection/live-file-transfer.d.ts +8 -0
  219. package/dist/lib/connection/normalize-url.d.ts +16 -0
  220. package/dist/lib/connection/query-client.d.ts +3 -0
  221. package/dist/lib/connection/resolve-connect-target.d.ts +10 -0
  222. package/dist/lib/connection/resume-action.d.ts +33 -0
  223. package/dist/lib/connection/resume-handler.d.ts +6 -0
  224. package/dist/lib/connection/rpc-keys.d.ts +39 -0
  225. package/dist/lib/drag-guard.d.ts +39 -0
  226. package/dist/lib/inline-image-cache.d.ts +34 -0
  227. package/dist/lib/pane-layout-persistence.d.ts +74 -0
  228. package/dist/lib/paths.d.ts +33 -0
  229. package/dist/lib/protocol/events.d.ts +19 -0
  230. package/dist/lib/protocol/timeline-paging.d.ts +29 -0
  231. package/dist/lib/random-id.d.ts +16 -0
  232. package/dist/shell/Workbench.d.ts +6 -0
  233. package/dist/shell/WorkbenchBoot.d.ts +4 -0
  234. package/dist/shell/WorkbenchProvider.d.ts +10 -0
  235. package/dist/shell/WorkspaceShell.d.ts +12 -0
  236. package/dist/shell/context.d.ts +8 -0
  237. package/dist/shell/hooks.d.ts +32 -0
  238. package/dist/shell/regions.d.ts +17 -0
  239. package/dist/stores/compaction-store.d.ts +45 -0
  240. package/dist/stores/deep-link-store.d.ts +15 -0
  241. package/dist/stores/draft-store.d.ts +45 -0
  242. package/dist/stores/explorer-store.d.ts +63 -0
  243. package/dist/stores/fork-store.d.ts +69 -0
  244. package/dist/stores/git-store.d.ts +59 -0
  245. package/dist/stores/layout-store.d.ts +137 -0
  246. package/dist/stores/materialize.d.ts +47 -0
  247. package/dist/stores/session-store.d.ts +76 -0
  248. package/dist/stores/stats-store.d.ts +48 -0
  249. package/dist/stores/tab-store.d.ts +145 -0
  250. package/dist/stores/ui-store.d.ts +85 -0
  251. package/dist/styles.css +1 -0
  252. package/dist/timeline/FileLink.d.ts +22 -0
  253. package/dist/timeline/InlineImage.d.ts +16 -0
  254. package/dist/timeline/bottom-anchor.d.ts +77 -0
  255. package/dist/timeline/compaction.d.ts +12 -0
  256. package/dist/timeline/file-link-src.d.ts +34 -0
  257. package/dist/timeline/file-open-target.d.ts +19 -0
  258. package/dist/timeline/format-meta-time.d.ts +10 -0
  259. package/dist/timeline/highlight.d.ts +9 -0
  260. package/dist/timeline/href-resolution.d.ts +34 -0
  261. package/dist/timeline/image-src.d.ts +32 -0
  262. package/dist/timeline/inline-image-view.d.ts +34 -0
  263. package/dist/timeline/live-tail.d.ts +5 -0
  264. package/dist/timeline/markdown.d.ts +35 -0
  265. package/dist/timeline/mermaid-theme.d.ts +23 -0
  266. package/dist/timeline/reducer.d.ts +38 -0
  267. package/dist/timeline/row-model.d.ts +154 -0
  268. package/dist/timeline/streaming-split.d.ts +42 -0
  269. package/dist/timeline/tool-mapping.d.ts +60 -0
  270. package/dist/viewer-plugins/viewer-settings-store.d.ts +55 -0
  271. package/dist/vite/index.d.ts +36 -0
  272. package/dist/vite/index.js +39 -0
  273. package/package.json +81 -4
@@ -0,0 +1,51 @@
1
+ /**
2
+ * `computeAnnouncements` — § 08's "Announcements" table as pure decision logic over an
3
+ * `AgentUiState` transition. Never touches the DOM or a store; `stores/announcer-store.ts` is the
4
+ * one consumer that turns its output into a spoken live-region update (sprint-069/task-008).
5
+ *
6
+ * Reuses `outcome-line.ts`'s own resolution classification rather than re-deriving one (this
7
+ * task's own Notes) — including its wire-limitation posture: a populated `select`/`input`'s
8
+ * second-Esc dismissal resolves as a bare `{ cancelled: true }`, indistinguishable on the wire
9
+ * from a resolution by another client, so `outcome-line.ts` renders both as "no longer pending"
10
+ * and this module inherits exactly that call rather than promising a "Dismissed" string the wire
11
+ * cannot attribute.
12
+ *
13
+ * Two rules mirrored from `outcome-line.ts`'s own header, restated here because an announcement is
14
+ * an even sharper case of both:
15
+ * - **Never echo a typed or extension-chosen value.** `outcomeLine`'s `text` for a `select`
16
+ * response is the literal option string (the card MAY print it — § 04 permits it because the
17
+ * options are a fixed set the extension already chose); the announcement never does. Every
18
+ * `tone: "success"` outcome collapses to the one generic word "Answered", regardless of method
19
+ * or answer.
20
+ * - **Never announce absence.** This module has nothing to say about "nothing pending anywhere" —
21
+ * that transition has no announcement string at all (§ 08's own table entry is "region emptied,
22
+ * nothing spoken"); the caller (`agent-ui-store.ts`) detects the global-pending-count-reaches-
23
+ * zero case itself and clears the live region, not by asking this module for a message.
24
+ */
25
+ import type { AgentUiState } from "@av-pi-studio/client";
26
+ export type AnnouncementPoliteness = "polite" | "assertive";
27
+ export interface Announcement {
28
+ text: string;
29
+ politeness: AnnouncementPoliteness;
30
+ }
31
+ export interface AnnouncementContext {
32
+ /** The agent id of the session currently on screen — same "active session" concept
33
+ * `notifyEffect` already uses (`session-store.ts`'s `activeSessionId`), not per-pane
34
+ * visibility. `null` when no session is active. */
35
+ activeAgentId: string | null;
36
+ /** Resolves a session's display name from its agent id; `null` when not locally known
37
+ * (defensive — mirrors `notifyEffect`'s own posture of never throwing on a miss). */
38
+ sessionTitle: (agentId: string) => string | null;
39
+ }
40
+ /** Diffs one `AgentUiState` commit against the previous one and returns every § 08 announcement it
41
+ * produces, in the order they should be spoken. Almost always 0 or 1 entries — each commit
42
+ * corresponds to exactly one wire action — but the loop is written generally rather than assuming
43
+ * that.
44
+ *
45
+ * A pending entry only announces its **arrival** when it was observed live
46
+ * (`entry.receivedAt !== undefined` — `agent-ui-state.ts`'s own field doc: stamped only by a live
47
+ * `ui_request`, absent for a snapshot/resync-recovered entry). A resolved entry always announces
48
+ * — `agent-ui-state.ts`: "Resolved entries are never 'recovered'", so anything newly present in
49
+ * `next.resolved` happened live while this page was open. */
50
+ export declare function computeAnnouncements(prev: AgentUiState, next: AgentUiState, ctx: AnnouncementContext): Announcement[];
51
+ //# sourceMappingURL=announce.d.ts.map
@@ -0,0 +1,53 @@
1
+ /**
2
+ * `mergeAskEntries` — combines an agent's pending and resolved extension-UI dialogs into one
3
+ * ordered list (sprint-068/task-006, extended by task-007 for the recovered marker and the
4
+ * past-four collapse). Uses the SDK's own ordering key — `createdAt`, `requestId` tie-break, the
5
+ * same comparator `pendingForAgent`/`resolvedForAgent` already sort each list by — so a card never
6
+ * reshuffles when it resolves: an entry's `createdAt`/`requestId` never changes when it moves from
7
+ * `pending` into `resolved`, so re-sorting the union by that same key places it at the identical
8
+ * slot regardless of which of the two source lists it currently lives in. Ordering comes from the
9
+ * SDK's comparator, not a local invention — re-deriving one here is how a card would gain a second,
10
+ * divergent order and start jumping on resolution.
11
+ */
12
+ import type { AgentUiPendingEntry, AgentUiResolvedEntry } from "@av-pi-studio/client";
13
+ export type AskEntry = {
14
+ kind: "pending";
15
+ entry: AgentUiPendingEntry;
16
+ } | {
17
+ kind: "resolved";
18
+ entry: AgentUiResolvedEntry;
19
+ };
20
+ export declare function mergeAskEntries(pending: readonly AgentUiPendingEntry[], resolved: readonly AgentUiResolvedEntry[]): AskEntry[];
21
+ /** Stable identity for a `AskEntry` across the transition from pending to resolved (both carry the
22
+ * same `requestId`) — the key a virtualizer/React list should key on. */
23
+ export declare function askEntryKey(item: AskEntry): string;
24
+ /** A pending entry recovered from a daemon snapshot (page reload, reconnect) rather than observed
25
+ * live — the SDK stamps `receivedAt` only on a live `agent_ui_request` (`agent-ui-state.ts`'s
26
+ * `reduceUiRequest`); a rehydrated entry carries none. This is exactly the § 06 "still waiting"
27
+ * marker's signal — no new state, just reading the field that already means it. Resolved entries
28
+ * are never "recovered" (the daemon serves no resolved history to rebuild one from), so this only
29
+ * takes a pending entry. */
30
+ export declare function isRecovered(entry: AgentUiPendingEntry): boolean;
31
+ /** § 06 "Past four": four pending cards render in full; the SDK's own comparator order decides
32
+ * which four (oldest first) — never a local reordering. Resolved cards are unaffected: task-006
33
+ * already collapses every resolved card unconditionally, so they never compete for the budget. */
34
+ export declare const FULL_CARD_LIMIT = 4;
35
+ export type AskLayoutItem = {
36
+ kind: "card";
37
+ item: AskEntry;
38
+ collapsed: boolean;
39
+ } | {
40
+ kind: "more";
41
+ count: number;
42
+ };
43
+ /**
44
+ * Lays `merged` (already `mergeAskEntries`-ordered) into the exact render sequence: every card in
45
+ * order, with a `{ kind: "more" }` marker spliced in right before the first card collapsed by the
46
+ * limit — i.e. immediately after the last full pending card, matching § 06's "beneath the fourth".
47
+ * `expanded` lifts the limit entirely once the user has clicked that marker; a card past the limit
48
+ * always renders in full once `expanded` is true, and a freshly arriving pending card while
49
+ * collapsed just raises the `more` marker's `count` (never reshuffles or auto-hides an existing
50
+ * full card).
51
+ */
52
+ export declare function layoutAskEntries(merged: readonly AskEntry[], expanded: boolean): AskLayoutItem[];
53
+ //# sourceMappingURL=ask-list.d.ts.map
@@ -0,0 +1,47 @@
1
+ /**
2
+ * `placeAsksInRows` — decides *where* in the transcript each extension-UI dialog card renders
3
+ * (sprint-068 follow-up: the real-`pi` ordering bug).
4
+ *
5
+ * Tasks 005–007 appended every card after the last persisted row. That is right only while the
6
+ * dialog is the newest thing on screen — which is all the mock provider can produce, since each
7
+ * `#ui` recipe ends the turn on the dialog. Against a real extension the turn *continues*: the
8
+ * tool call returns, the agent writes a reply, and those rows land after a card that chronologically
9
+ * preceded them, so the answered question renders below the response that consumed it.
10
+ *
11
+ * ## The one invariant
12
+ *
13
+ * **Rows never move relative to each other.** Their array order is the source of truth (daemon
14
+ * append order) and nothing here may permute it — this is an *insertion* of cards into a fixed row
15
+ * sequence, never a sort of the union. A sort would be actively dangerous: `timestamp` is optional
16
+ * on every row kind, and one `undefined` (→ `NaN` comparison) is enough to make a comparator
17
+ * inconsistent and scramble the whole transcript. Both inputs are already correctly ordered — rows
18
+ * by append, `askLayout` by the SDK's `createdAt`/`requestId` comparator — so this is a linear
19
+ * two-list merge, not a re-derivation of either order.
20
+ *
21
+ * ## Placement rules
22
+ *
23
+ * - A card goes before the first row **provably newer** than it (`rowTime > createdAt`, strict, so
24
+ * equal-millisecond ties put the row first deterministically — no jitter across re-renders).
25
+ * - A row with **no** timestamp can never be the row a card is placed before — it is skipped, not
26
+ * treated as time zero. If no row is provably newer (e.g. every timestamp absent on a transcript
27
+ * hydrated by a code path predating the field), every card lands at the end: exactly the pre-fix
28
+ * behaviour. The degenerate case degrades to the old one instead of collapsing to index 0. A card
29
+ * whose own `createdAt` is unusable degrades the same way.
30
+ * - Row timestamps can legitimately go **backwards** — an optimistic user row is stamped from the
31
+ * *local* clock while every other row carries the daemon's, and the two hosts need not agree.
32
+ * No monotonic clamp is applied, because one would provably never change the result: stopping at
33
+ * the *first* row newer than the card makes the decision purely prefix-based, and a clamp can
34
+ * only raise floors at or after that stopping point. (Written, tested, and removed — the test
35
+ * `"non-monotonic row timestamps"` pins the behaviour the clamp was meant to provide.)
36
+ * - The § 06 `"more"` marker carries no time of its own; it stays glued immediately in front of the
37
+ * card it already precedes, so it travels with it.
38
+ */
39
+ import type { TimelineRow } from "../../timeline/row-model.js";
40
+ import type { AskLayoutItem } from "./ask-list.js";
41
+ /**
42
+ * `rows` and `askLayout` merged into one render sequence, preserving both input orders exactly.
43
+ * Generic over the row/card wrappers so the caller keeps its own `ComposedItem` union — this module
44
+ * decides ordering and nothing else.
45
+ */
46
+ export declare function placeAsksInRows<T>(rows: readonly TimelineRow[], askLayout: readonly AskLayoutItem[], wrapRow: (row: TimelineRow) => T, wrapAsk: (item: AskLayoutItem) => T): T[];
47
+ //# sourceMappingURL=ask-placement.d.ts.map
@@ -0,0 +1,27 @@
1
+ /**
2
+ * `deadline` — the pending card's deadline-bar display state (visual spec § 02, § 05). Derived,
3
+ * never enforced: nothing here expires, dismisses, or resends anything — only the daemon's
4
+ * `agent_ui_resolved` ever ends a dialog (`extension-ui-client-sdk.md` § Timeout display: Pi
5
+ * auto-resolves on timeout and "the client does not need to track timeouts"). This module answers
6
+ * one question only — "how full should the bar look right now" — by consuming the SDK's own
7
+ * `remainingMs` selector rather than recomputing the anchor logic a second, divergent time.
8
+ *
9
+ * `approximate` is true for a snapshot-recovered entry (`receivedAt === undefined` — a live event
10
+ * always stamps one, a rehydrated one cannot) — per § 05, that bar must never be drawn as an exact
11
+ * countdown, since it is anchored on the daemon's `createdAt` from a possibly different host clock.
12
+ *
13
+ * `editor` never carries a `timeout` on Pi's real wire (the visual spec's § 00 table lists one in
14
+ * error — sprint-068/task-009 files the correction), so an `editor` entry always has
15
+ * `timeoutMs === undefined` and needs no special case here: absent `timeoutMs` already yields
16
+ * `show: false`.
17
+ */
18
+ import { type AgentUiPendingEntry } from "@av-pi-studio/client";
19
+ export interface DeadlineDisplay {
20
+ show: boolean;
21
+ /** Fraction of the deadline remaining, `1` (full) down to `0` (expired). Meaningless when `show`
22
+ * is `false`. */
23
+ fraction: number;
24
+ approximate: boolean;
25
+ }
26
+ export declare function deadline(entry: AgentUiPendingEntry, now: number): DeadlineDisplay;
27
+ //# sourceMappingURL=deadline.d.ts.map
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Pure keyboard-ownership logic for a pending `AskCard` (sprint-068/task-008, § 07 "Keyboard
3
+ * affordances"). Nothing here touches the DOM or React — `AskCard.tsx` wires refs/listeners
4
+ * around it, exactly like `outcome-line.ts`/`option-layout.ts` (task-004) separate presentation
5
+ * decisions from rendering.
6
+ */
7
+ /** § 07 "the hint line lists only the keys valid for that card's kind" — every kind but `editor`
8
+ * submits on bare Enter; `editor` reserves bare Enter for a newline (so its own field's
9
+ * `onKeyDown` never intercepts it) and submits on the modifier chord instead. Both the field's
10
+ * key handling and the hint's glyph read this one flag, so the two can never drift apart. */
11
+ export declare function submitKeyClaimsShift(method: string): boolean;
12
+ export interface HintKeySegment {
13
+ key: string;
14
+ label: string;
15
+ }
16
+ export type Hint = {
17
+ kind: "keys";
18
+ segments: readonly HintKeySegment[];
19
+ } | {
20
+ kind: "warning";
21
+ text: string;
22
+ };
23
+ /** § 07 "swaps the hint line for 'Esc again to dismiss — the extension gets an empty answer'" —
24
+ * shown verbatim once a card is armed, replacing the key hint regardless of which method armed
25
+ * it (the warning is about the *action*, not the card's kind). */
26
+ export declare const ARM_WARNING = "Esc again to dismiss \u2014 the extension gets an empty answer";
27
+ export declare function computeHint(method: string, armed: boolean): Hint;
28
+ /** § 07 two-step Esc: the first press arms dismissal (and moves focus to the card's dismissing
29
+ * control, when it has one); the second resolves it. `resolve: true` tells the caller to send
30
+ * the cancellation now — the caller decides what that means for its own kind (`{ cancelled:
31
+ * true }` for every kind here, since `agentUiResponseSchema` accepts it universally). */
32
+ export interface EscPressResult {
33
+ armed: boolean;
34
+ resolve: boolean;
35
+ }
36
+ export declare function pressEscape(currentlyArmed: boolean): EscPressResult;
37
+ //# sourceMappingURL=keyboard.d.ts.map
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Pure `notify` effect → toast decision (sprint-069/task-006). Store-free, like
3
+ * `session-presentation.ts`/`tab-attention.ts`: `agent-ui-store.ts` sources the session lookup and
4
+ * calls `useToastStore` with what this module decides.
5
+ *
6
+ * § 11: no extension name is ever available on the wire (`agent-ui-state.ts`'s `AgentUiEffect`
7
+ * only carries `agentId`/`message`/`level`) — the active session's toast is the bare message; a
8
+ * background session's toast is prefixed with the session's own title as a locator, since a title
9
+ * is the only identity available. Level → treatment is a direct 1:1 with `ToastVariant`: `toast.ts`'s
10
+ * existing `"default"` already *is* § 11's "info" (no rail — no separate variant needed), and an
11
+ * unrecognised level falls into that same `default` branch as `"info"` itself, which is exactly
12
+ * what makes "unrecognised ⇒ info" hold without a special case.
13
+ */
14
+ import type { ToastVariant } from "@av-pi-studio/ui-library";
15
+ export declare function notifyVariant(level: string): ToastVariant;
16
+ /** § 11 dwell: info 4s, warning 6s (longer, but still self-dismissing), error sticky (`null`). */
17
+ export declare function notifyDurationMs(level: string): number | null;
18
+ /**
19
+ * @param effectAgentId The `notify` effect's own `agentId`.
20
+ * @param activeSessionAgentId The agentId of the session currently on screen, or `null` if none.
21
+ * @param sessionTitle The effect's own session's title, or `null` if not locally known (defensive
22
+ * — an effect should always name a real, locally-tracked agent, but this must not throw on a
23
+ * lookup miss).
24
+ */
25
+ export declare function notifyToastCopy(message: string, effectAgentId: string, activeSessionAgentId: string | null, sessionTitle: string | null): string;
26
+ /**
27
+ * § 11 announcement copy for a `notify` effect — a distinct, colon-separated locator form from
28
+ * `notifyToastCopy`'s own em-dash toast prefix (task-008's own spec text spells out
29
+ * `"<session name>: <message>"`), and a distinct politeness rather than `ToastVariant`: `error`
30
+ * is `"assertive"`, `info`/`warning` are `"polite"` (the same unrecognised-level-behaves-like-info
31
+ * fallback as `notifyVariant`/`notifyDurationMs` above).
32
+ *
33
+ * @param effectAgentId The `notify` effect's own `agentId`.
34
+ * @param activeSessionAgentId The agentId of the session currently on screen, or `null` if none.
35
+ * @param sessionTitle The effect's own session's title, or `null` if not locally known.
36
+ */
37
+ export declare function notifyAnnouncement(message: string, level: string, effectAgentId: string, activeSessionAgentId: string | null, sessionTitle: string | null): {
38
+ text: string;
39
+ politeness: "polite" | "assertive";
40
+ };
41
+ //# sourceMappingURL=notify-effect.d.ts.map
@@ -0,0 +1,24 @@
1
+ /**
2
+ * `optionLayout` — how a `select` dialog's `options: string[]` lay out (visual spec § 03, § 12).
3
+ * Pure decision over the array alone: a `select` card never gets custom ids, labels, ordinals, or
4
+ * descriptions on the wire (§ 00), so length and count are the only signals available.
5
+ *
6
+ * - **Stack** (full-width, vertically listed buttons) when there are five or more options, or when
7
+ * any single label is longer than roughly 40 characters (§ 12 "EXACT STACKING THRESHOLD" pins
8
+ * this with a two-option case: one 95-character option forces the stack even though there is only
9
+ * one other, four-character option). Otherwise **row** (side-by-side) — the exception, not the
10
+ * default (§ 03).
11
+ * - **Scroll** once there are more than six options (§ 12 "NINE OPTIONS · SCROLLS AT SIX" — nine
12
+ * options scrolls, six does not).
13
+ * - **No ordinals, no dedup.** Real extensions already number their own options in the label text
14
+ * (§ 03); adding a second, local numbering scheme would collide with or duplicate that, or
15
+ * falsely imply this surface can disambiguate identical labels when it cannot (§ 12 "DUPLICATE
16
+ * OPTION LABELS"). This module is a pure pass-through of the layout decision — it never
17
+ * reorders, merges, or annotates `options` itself.
18
+ */
19
+ export interface OptionLayout {
20
+ mode: "row" | "stack";
21
+ scrolls: boolean;
22
+ }
23
+ export declare function optionLayout(options: readonly string[]): OptionLayout;
24
+ //# sourceMappingURL=option-layout.d.ts.map
@@ -0,0 +1,38 @@
1
+ /**
2
+ * `outcomeLine` — the collapsed-card outcome string a resolved dialog shows (visual spec § 04).
3
+ * Pure decision over data: never reads the DOM, never touches CSS clamping (the truncation flag
4
+ * only signals "the CSS should clamp this one" — actual ellipsis-at-40%-width is a style concern,
5
+ * task-005).
6
+ *
7
+ * Two rules exist to prevent a specific, already-identified failure (§ 04):
8
+ * - **Never invent a claim the wire cannot support.** `timed out` never says which default value
9
+ * the extension acted on (§ 04: "the default is empty for select/input/editor and 'no' for
10
+ * confirm, and the card can't know which the extension acted on"). "Resolved elsewhere" never
11
+ * claims *which* of a lost race / stale id / swept agent happened — the daemon returns the same
12
+ * signal for all three (`extension-ui-rpc.md`).
13
+ * - **Never echo a typed value.** `input`/`editor` show a neutral fixed confirmation ("answered" /
14
+ * "submitted") regardless of who answered or what was typed — the SDK already makes a typed
15
+ * answer unrepresentable in state (`agent-ui-state.ts`'s `answerFromResponse`), and this module
16
+ * must not reintroduce it by any other means.
17
+ *
18
+ * "No longer pending" (§ 04) applies only to `select`/`confirm`: those two methods retain
19
+ * `answer.value`/`answer.confirmed` on the resolved entry **only when THIS client submitted it**
20
+ * (`agent-ui-state.ts` module header); an `answer === undefined` on a `reason: "answered"` entry
21
+ * for one of those two methods therefore means another client (or a race this client lost) is what
22
+ * actually resolved it. `input`/`editor` never retain an answer regardless of who answered — for
23
+ * those two, `reason: "answered"` unconditionally means "✓ answered"/"✓ submitted"; there is no
24
+ * "elsewhere" variant to distinguish (nothing on the wire would let it be distinguished).
25
+ */
26
+ import type { AgentUiResolvedEntry } from "@av-pi-studio/client";
27
+ export type OutcomeTone = "success" | "muted";
28
+ export interface OutcomeLine {
29
+ tone: OutcomeTone;
30
+ /** Present only for a genuine "answered here" outcome — a checkmark. */
31
+ glyph: "check" | null;
32
+ text: string;
33
+ /** True only for the one case where `text` is an arbitrary, extension-chosen string that may run
34
+ * long (the `select` answer) — the CSS clamps/ellipsises only when this is set. */
35
+ truncate: boolean;
36
+ }
37
+ export declare function outcomeLine(entry: AgentUiResolvedEntry): OutcomeLine;
38
+ //# sourceMappingURL=outcome-line.d.ts.map
@@ -0,0 +1,24 @@
1
+ /**
2
+ * `promptLines` — turns a raw `title`/`message` string into renderable lines (visual spec § 02,
3
+ * § 03, § 12). `\n` is a hard break; a run of consecutive blank lines collapses to a single blank
4
+ * line, so an extension cannot inflate its own vertical space by repeating newlines. A bracketed
5
+ * extension prefix (e.g. `[Color]`) is preserved **verbatim** — never parsed, stripped, or
6
+ * restyled, since there is no reliable way to tell an extension's own namespacing from ordinary
7
+ * prose (§ 00, § 03).
8
+ *
9
+ * Wrapping and the 4-line-then-scroll cap (§ 12) are a CSS concern (`max-height` + `overflow`) —
10
+ * they depend on rendered width/font metrics this module has no access to and does not need:
11
+ * providing the correctly-split, collapsed line array is the whole of this module's job.
12
+ *
13
+ * `confirmPromptParts` returns `title` and `message` as distinct line arrays, per § 03: a `confirm`
14
+ * with a message weights the title differently (heavier, to separate it from the message below)
15
+ * than a `confirm` with none (ordinary weight, and nothing reserved where the message would sit).
16
+ */
17
+ export declare function promptLines(text: string): string[];
18
+ export interface ConfirmPromptParts {
19
+ title: string[];
20
+ /** Absent (not an empty array) when no message was sent — the component reserves no space. */
21
+ message?: string[];
22
+ }
23
+ export declare function confirmPromptParts(title: string, message?: string): ConfirmPromptParts;
24
+ //# sourceMappingURL=prompt-text.d.ts.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Attachment preview strip — presentational thumbnail row with remove buttons (POC
3
+ * `renderAttachments`, POC_TO_APP_PLAN_UI.md §4.4). Pending-image state lives in `Composer`;
4
+ * this component only renders `images` and forwards `onRemove(index)`.
5
+ */
6
+ export interface PendingImage {
7
+ mimeType: string;
8
+ /** Base64 payload, no `data:...;base64,` prefix — sent to the daemon as-is. */
9
+ data: string;
10
+ /** Full data URL, for the thumbnail `<img src>`. */
11
+ thumbUrl: string;
12
+ }
13
+ export interface AttachmentsProps {
14
+ images: PendingImage[];
15
+ onRemove: (index: number) => void;
16
+ }
17
+ export declare function Attachments({ images, onRemove }: AttachmentsProps): import("react").JSX.Element | null;
18
+ /** `FileReader.readAsDataURL` wrapped as a promise (POC `addImageFile`). */
19
+ export declare function readImageFile(file: File): Promise<PendingImage>;
20
+ //# sourceMappingURL=Attachments.d.ts.map
@@ -0,0 +1,12 @@
1
+ /**
2
+ * ChatPanel — the tab content mounted by `panel-registry.ts` for `kind: "chat"` tabs. Looks up
3
+ * the session by `tab.data.sessionId`, keeps its timeline live via `useAgentStream`, and renders
4
+ * the virtualized `Timeline` + `Composer` (POC_TO_APP_PLAN_UI.md §4.3/§4.4).
5
+ */
6
+ import type { Tab } from "../../stores/tab-store.js";
7
+ export interface ChatPanelProps {
8
+ tab: Tab;
9
+ owningPaneId: string | null;
10
+ }
11
+ export declare function ChatPanel({ tab, owningPaneId }: ChatPanelProps): import("react").JSX.Element;
12
+ //# sourceMappingURL=ChatPanel.d.ts.map
@@ -0,0 +1,41 @@
1
+ /**
2
+ * CommandMenu — the `/` slash-command popup (web-client slash commands). Reuses `ModelMenu`'s
3
+ * visual chrome (`ModelMenu.module.css`'s `.content`/`.list`/`.item`/`.label`/`.modelId`/`.state`/
4
+ * `.stateError`) plus command-row-specific classes added to the same file
5
+ * (`.commandContent`/`.commandItem`/`.commandItemHeader`/`.commandDescription` — a capped popup
6
+ * width with the name and source badge on one line, description clamped to two lines below, full
7
+ * text on hover via the native `title` attribute) — but this is a DIFFERENT component, not a
8
+ * generalized `ModelMenu`: `ModelMenu` owns its `open`/`query` state privately and renders its own
9
+ * search `<input>`, neither of which fits a menu whose open state and filter query are driven
10
+ * entirely by the composer's own textarea.
11
+ *
12
+ * Rows are plain `<div role="option">`, not `DropdownMenu.Item` — `Item` brings Radix roving
13
+ * focus/typeahead, which would fight the textarea for keyboard focus. `.itemActive` (keyboard
14
+ * selection — what Enter/Tab applies) comes purely from `highlightedIndex`, driven by the
15
+ * composer's own `ArrowUp`/`ArrowDown` handling; mouse hover is deliberately a SEPARATE, native
16
+ * CSS `:hover` (see `.commandItem:hover` in `ModelMenu.module.css`) rather than being synced into
17
+ * the same state via `onMouseEnter` — that would add a React round-trip to something the browser
18
+ * already tracks natively, and can miss fast pointer movement.
19
+ * `onOpenAutoFocus` is prevented so opening the menu (by clicking the trigger, or by typing `/`)
20
+ * never steals focus away from the textarea — the user must be able to keep typing.
21
+ */
22
+ import { type ReactNode } from "react";
23
+ import { type ComboboxOption } from "@av-pi-studio/ui-library";
24
+ export interface CommandMenuProps {
25
+ open: boolean;
26
+ onOpenChange: (open: boolean) => void;
27
+ /** Rows to render, already filtered + ordered by the caller (`slash-commands.ts`). A `disabled`
28
+ * row is shown dimmed and cannot be picked (the composer's submit gate stays authoritative). */
29
+ options: ComboboxOption<string>[];
30
+ /** Index into `options`; the row rendered as preselected. -1 for none. */
31
+ highlightedIndex: number;
32
+ onSelect: (name: string) => void;
33
+ isLoading: boolean;
34
+ isError: boolean;
35
+ errorMessage?: string;
36
+ /** Count of extension commands hidden because a turn is running; 0 renders no note. */
37
+ hiddenExtensionCount: number;
38
+ renderTrigger: () => ReactNode;
39
+ }
40
+ export declare function CommandMenu({ open, onOpenChange, options, highlightedIndex, onSelect, isLoading, isError, errorMessage, hiddenExtensionCount, renderTrigger, }: CommandMenuProps): import("react").JSX.Element;
41
+ //# sourceMappingURL=CommandMenu.d.ts.map
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Composer — a bordered card holding an autosizing textarea with a **bottom toolbar** beneath it
3
+ * (attach / slash-commands on the left, model picker + send/steer/stop on the right), replacing
4
+ * the old single-row "textarea flanked by loose buttons" layout. Send/stop semantics are
5
+ * unchanged (POC `initChatPanel`/`send()`,
6
+ * POC_TO_APP_PLAN_UI.md §4.4). Every send goes through `ensureMaterialized` (`stores/
7
+ * materialize.ts`) first: a brand-new session (`agentId: null`) becomes a real, persisted draft
8
+ * via a no-`initialPrompt` `createAgent` call — the daemon persists the record but does NOT spawn
9
+ * a provider process yet (`agent-service.ts` `handleCreate`'s deferred-draft branch); the process
10
+ * spawns lazily on this very send (`spawnOrResumeSession`). `ensureMaterialized` is a no-op once
11
+ * already bound, so this is the single path for both "first message ever" and every follow-up:
12
+ * `client.agent(agentId).send(...)`. Stop → `client.agent(agentId).interrupt()`.
13
+ *
14
+ * Because the agent is bound (materialized) *before* this call, `useAgentStream` (attaches once
15
+ * `agentId` is set) is already subscribed by the time `send`'s turn starts streaming — unlike the
16
+ * old "one RPC does create-agent-and-run-the-first-turn" path, there is no window where the first
17
+ * turn's events arrive on a raw broadcast nobody is listening to, so this file no longer needs a
18
+ * first-turn gate/latch dance for a still-unbound session.
19
+ *
20
+ * OPTIMISTIC ECHO: `send_agent_prompt` blocks server-side until the whole turn finishes, and even
21
+ * the *first* broadcast event only fires once the agent process is booted/warm — for a session
22
+ * materializing on this very send, that means a real process-spawn+handshake before anything
23
+ * appears (see AGENTS.md "First-message latency"). To hide that, `submit` mints a
24
+ * `clientMessageId` and inserts the user's row into the timeline *synchronously*, before the RPC
25
+ * is even issued. The daemon echoes the same id back verbatim as the `user_message` event's
26
+ * `messageId` (`packages/server/src/agent/agent-service.ts` `runTurn`); the reducer
27
+ * (`timeline/reducer.ts` `onUserMessage`) matches it against the pending row and confirms it in
28
+ * place instead of appending a duplicate.
29
+ *
30
+ * MODEL & MATERIALIZATION: a chat materializes the instant its tab is created
31
+ * (`tab-store.ts` `openNewChat` calls `ensureMaterialized`, which also resolves and pins the
32
+ * default model into the record if none was set yet) — long before this composer even mounts, in
33
+ * the common case. `submit`'s own `ensureMaterialized` call below is the retry path: it only does
34
+ * real work when the eager materialize failed or never ran (opened while disconnected). Picking a
35
+ * different model (`handleSelectModel` below, moved here from `StatusBar.tsx` with the toolbar)
36
+ * updates the already-materialized
37
+ * record's `config.model`/`config.modelProvider` directly — replayed by the server on first spawn
38
+ * regardless of whether it's the resolved default or an explicit pick (`spawnOrResumeSession`).
39
+ *
40
+ * STEERING: while the agent is running, the primary action becomes **Steer** instead of Send
41
+ * (`send_agent_prompt` is only legal when idle — see AGENTS.md "Steering"). Steer reuses the exact
42
+ * optimistic-echo + reconciliation path above (`clientMessageId` in, same `user_message` echo
43
+ * back), just against `client.agent(id).steer(...)` instead of `.send(...)`, and marks the
44
+ * optimistic row `queued: true` so `UserRow` can show a "queued" badge until a `queue_update`
45
+ * stream event drops the text from its `steering[]` list (`timeline/reducer.ts`'s
46
+ * `onQueueUpdate`). Follow-up (`.followUp(...)`, delivered only after the turn fully stops) is
47
+ * intentionally not surfaced here — SDK/CLI only for now. Steering only makes sense against a
48
+ * live agent — never triggers materialization itself.
49
+ */
50
+ export interface ComposerProps {
51
+ sessionId: string;
52
+ /** The workspace (layout key) and pane this composer's chat tab lives in — a path drop focuses
53
+ * that pane, since a drop fires no `pointerdown` for the pane's own click-to-focus. */
54
+ workspaceCwd: string;
55
+ owningPaneId: string | null;
56
+ }
57
+ export declare function Composer({ sessionId, workspaceCwd, owningPaneId }: ComposerProps): import("react").JSX.Element;
58
+ //# sourceMappingURL=Composer.d.ts.map
@@ -0,0 +1,24 @@
1
+ /**
2
+ * ForkDialog — one dialog, two steps (sprint-072/task-003, visual spec § 05·06·07's "open
3
+ * question 5" decision): a confirm step showing exactly what will be forked from, and a
4
+ * "Fork from…" picker step that swaps into the SAME dialog rather than opening a second one.
5
+ * Mounted once for the whole app (`TabPanelHost`, alongside `TabContextMenu` — the same "one
6
+ * global overlay" precedent), driven entirely by `stores/fork-store.ts`: any open chat pane's row
7
+ * button (task-002) or "⋮" menu (task-003) can open it, and only one instance is ever open.
8
+ *
9
+ * Result handling (task-004, `fork-result.ts`) applies the settled RPC: a cancelled fork toasts
10
+ * and closes; success closes and conditionally prefills the composer; a rejection toasts and
11
+ * returns the dialog to a reusable idle state instead of closing it.
12
+ *
13
+ * Keyboard/assistive tech (task-005, visual spec § 11): initial focus on Cancel in the confirm
14
+ * step (`autoFocus`); Esc is inert while pending (`onEscapeKeyDown` below) and — via the existing
15
+ * global precedence guard in `use-shortcuts.ts` — consumes the keystroke exclusively, so an open
16
+ * toast is never dismissed by the same Esc; the picker's rows are arrow-key navigable
17
+ * (`handlePickerKeyDown`) with the first row focused on open; closing restores focus to the
18
+ * control that opened this whole flow (`triggerElement`, captured by the caller at click-time),
19
+ * or falls back to that session's composer when the row is gone — the COMMON case after a
20
+ * successful fork, since its own `agent_timeline_reset` typically already removed the row by the
21
+ * time this dialog finishes closing.
22
+ */
23
+ export declare function ForkDialog(): import("react").JSX.Element | null;
24
+ //# sourceMappingURL=ForkDialog.d.ts.map
@@ -0,0 +1,54 @@
1
+ /**
2
+ * ModelMenu — model-selector trigger + anchored searchable picker (sprint-043; lives in the
3
+ * composer's bottom toolbar). Renders a caller-supplied trigger element (`renderTrigger`, i.e.
4
+ * `Composer.tsx`'s model-name + chevron button) that opens an anchored dropdown listing the
5
+ * provider's models with a fuzzy search filter at the top, sectioned under one sticky header per
6
+ * underlying LLM provider. The current model sorts first with a checkmark; every row renders
7
+ * `label (id)` with the id in muted text, and `renderTrigger` gets that same name + id pair so
8
+ * the closed trigger reads the same way the list does.
9
+ *
10
+ * Grouping is a shared mechanic, not a ModelMenu feature: `ui/option-groups.ts`'s `groupOptions`
11
+ * sections any `ComboboxOption` list by its `group` field, and `MenuGroup` renders the header, so
12
+ * any other picker built on the same primitives can group by whatever it likes. Here `group` is
13
+ * the model's own provider (`"anthropic"`, `"openai"`, …) — the field that already had to travel
14
+ * with every row for `setModel`. Headers render only once there are at least two of them: a
15
+ * single-provider list is not clarified by one identical header above every row.
16
+ *
17
+ * Anchoring follows `TabStrip.tsx`'s `NewTabMenu` visible-trigger pattern (`DropdownMenu.Trigger
18
+ * asChild` wrapping a real element), NOT `SessionContextMenu`'s invisible fixed-coordinate
19
+ * trigger (that pattern is for right-click menus only). `align="end"` overrides `MenuContent`'s
20
+ * `align="start"` default because this trigger sits at the RIGHT edge of the composer toolbar —
21
+ * a start-aligned popup would hang off the panel's right side. Search reuses the pure
22
+ * `filterOptions` helper (case-insensitive substring on label + id) instead of a bespoke filter;
23
+ * a group whose every row is filtered out disappears with its header.
24
+ */
25
+ import { type ReactNode } from "react";
26
+ export interface ModelMenuProps {
27
+ /** `session.model` — undefined for a brand-new session with no known model yet. */
28
+ currentModel?: string;
29
+ /**
30
+ * `session.modelProvider` — the current model's own LLM provider. Hoists that provider's
31
+ * section to the top of the list, and keeps the checkmark on the right row when two providers
32
+ * offer the same model id. Undefined (a stream update that carried no provider) degrades to
33
+ * id-only matching, exactly as before this field existed.
34
+ */
35
+ currentModelProvider?: string;
36
+ provider: string;
37
+ /** The session's agent, if any — scopes the list to what that agent's process can switch to. */
38
+ agentId?: string | null;
39
+ /**
40
+ * `modelProvider` is the model's OWN underlying LLM provider (e.g. `"anthropic"`) — REQUIRED
41
+ * by `client.agent(id).setModel(provider, modelId)`'s `provider` argument. Never hardcode the
42
+ * pi-studio provider (`"pi"`) here: Pi has no model registered under a provider literally
43
+ * named "pi" (sprint-043's "Model not found: pi/<modelId>" bug).
44
+ */
45
+ onSelect: (modelId: string, modelProvider?: string) => void;
46
+ /** Renders the visible trigger element (must forward ref/props via `DropdownMenu.Trigger
47
+ * asChild` — a real `<button>`/`Button`, not a fragment). Receives the current model's id and
48
+ * its human-readable name from the fetched list (undefined until that list resolves, or when
49
+ * the model is not in it at all), so the caller can render `Name (id)` styled however it
50
+ * likes. */
51
+ renderTrigger: (currentModel: string | undefined, currentModelLabel?: string) => ReactNode;
52
+ }
53
+ export declare function ModelMenu({ currentModel, currentModelProvider, provider, agentId, onSelect, renderTrigger, }: ModelMenuProps): import("react").JSX.Element;
54
+ //# sourceMappingURL=ModelMenu.d.ts.map
@@ -0,0 +1,39 @@
1
+ /**
2
+ * ThinkingMenu — thinking-level selector trigger + anchored picker (sprint-070/task-005; the
3
+ * "Thinking | brain-icon badge → levels combobox" row `composer-ui.md`'s controls table has
4
+ * specified since sprint-015). Lives in the composer's bottom toolbar, mounted immediately
5
+ * after `ModelMenu` in `.toolbarRight` (user-pinned placement, 2026-08-24).
6
+ *
7
+ * Deliberately leaner than `ModelMenu`: levels are one flat ordered list (≤7 rows), so there is
8
+ * no search input and no grouping. Open state is CONTROLLED (like `CommandMenu`, unlike
9
+ * `ModelMenu`) because the caller gates its live `agent_thinking_levels_request` query on the
10
+ * menu being open — an uncontrolled menu would have no way to express that. The caller also
11
+ * supplies the level list (live: `useThinkingLevels`, keyed `[agentId, model]`; draft: the
12
+ * cached model catalogue via `thinking-level-source.ts`), and an empty list hides the whole
13
+ * control. The popup reuses `ModelMenu.module.css`'s chrome (`.picker`/`.list`/`.item`/
14
+ * `.checkSlot`/`.label`), the same cross-component reuse `CommandMenu` established.
15
+ *
16
+ * Anchoring follows `ModelMenu`'s visible-trigger pattern (`DropdownMenu.Trigger asChild`
17
+ * wrapping a real button) with `align="end"` — same right-edge reasoning as the model trigger.
18
+ * `side="top"` is EXPLICIT, not left to Radix's collision-based auto-flip: `ModelMenu`'s bulkier
19
+ * popup (search input + rows) reliably overflows below the composer and gets auto-flipped, but
20
+ * this popup's short ≤7-row (often 1-row-while-loading) content can "fit" in the sliver of space
21
+ * below the toolbar and stay there — the same explicit-`side` fix `CommandMenu` already applies
22
+ * for the identical composer-bottom position.
23
+ */
24
+ import type { ReactNode } from "react";
25
+ export interface ThinkingMenuProps {
26
+ /** `session.thinkingLevel` — undefined until restored/broadcast/picked. */
27
+ currentLevel?: string;
28
+ /** The levels to offer — one flat ordered list, ≤7 rows. Empty ⇒ the caller hides us. */
29
+ levels: string[];
30
+ open: boolean;
31
+ onOpenChange: (open: boolean) => void;
32
+ onSelect: (level: string) => void;
33
+ /** Renders the visible trigger element (must forward ref/props via `DropdownMenu.Trigger
34
+ * asChild` — a real `<button>`). Receives the current level so the caller can render its own
35
+ * label/placeholder styling. */
36
+ renderTrigger: (currentLevel: string | undefined) => ReactNode;
37
+ }
38
+ export declare function ThinkingMenu({ currentLevel, levels, open, onOpenChange, onSelect, renderTrigger, }: ThinkingMenuProps): import("react").JSX.Element;
39
+ //# sourceMappingURL=ThinkingMenu.d.ts.map