@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,141 @@
1
+ /**
2
+ * Pane tree — the pure split/collapse algebra behind workspace split panes.
3
+ *
4
+ * No React, no store, no persistence: a workspace's pane arrangement is a tree of leaves and
5
+ * splits, and every operation on it is a total function from tree to tree. Keeping it here means
6
+ * the two rules that carry real bug risk are exhaustively testable without a DOM:
7
+ *
8
+ * 1. **Depth is checked per branch.** Inserting a sibling into an existing same-direction run
9
+ * never deepens the tree, so at `MAX_PANE_DEPTH` a split *along* the run's direction is still
10
+ * legal — only a perpendicular (nesting) split is refused.
11
+ * 2. **Collapse keeps runs flat.** A split left with one child is replaced by that child, and if
12
+ * that child is a same-direction split its children are spliced into the parent — otherwise
13
+ * removing a pane silently produces same-direction nesting, wasting depth against the cap and
14
+ * changing divider behaviour.
15
+ *
16
+ * swe/features/workspace-split-panes.md § Pane tree, § Splitting,
17
+ * § Removing a pane / collapsing
18
+ */
19
+ export interface LeafPane {
20
+ kind: "leaf";
21
+ id: string;
22
+ }
23
+ export interface SplitNode {
24
+ kind: "split";
25
+ direction: SplitDirection;
26
+ /** Always >= 2 entries; parallel to `sizes`. */
27
+ children: PaneNode[];
28
+ /** Parallel to `children`; each > 0, summing to 1. */
29
+ sizes: number[];
30
+ }
31
+ export type SplitDirection = "row" | "column";
32
+ export type PaneNode = LeafPane | SplitNode;
33
+ export type SplitRegion = "left" | "right" | "top" | "bottom";
34
+ /** Deepest tree a split may produce. A lone leaf is depth 1. Matches `workspace-ui.md`. */
35
+ export declare const MAX_PANE_DEPTH = 4;
36
+ /** Region → split axis. Shared by `canSplit`, `splitPane`, and the drop-region gesture layer. */
37
+ export declare function directionOfRegion(region: SplitRegion): SplitDirection;
38
+ export declare function leafIds(tree: PaneNode): string[];
39
+ /** 1-based: a lone leaf is depth 1, a leaf under three nested splits is depth 4. `depth` is the
40
+ * recursion accumulator — callers pass only the tree and the pane id. */
41
+ export declare function paneDepth(node: PaneNode, paneId: string, depth?: number): number | null;
42
+ /**
43
+ * Whether splitting `targetPaneId` towards `region` is legal.
44
+ *
45
+ * Evaluated per branch, *after* resolving whether the split reuses a same-direction parent: a
46
+ * sibling insert leaves depth untouched and is always legal, so only a nesting split can hit the
47
+ * cap. A single `depth + 1 > MAX` check would wrongly refuse both.
48
+ */
49
+ export declare function canSplit(tree: PaneNode, targetPaneId: string, region: SplitRegion): boolean;
50
+ /**
51
+ * Split `targetPaneId`, placing `newPaneId` on the side `region` names.
52
+ *
53
+ * Returns the tree **unchanged** when the split is illegal (`canSplit` false, unknown target, or a
54
+ * `newPaneId` already in the tree). Refusal is a backstop for programmatic callers and corrupted
55
+ * state, not an error: the drag gesture degrades an illegal edge region to a `center` move instead
56
+ * of ever calling this and getting nothing.
57
+ */
58
+ export declare function splitPane(tree: PaneNode, targetPaneId: string, region: SplitRegion, newPaneId: string): PaneNode;
59
+ /**
60
+ * Remove a leaf, redistributing its size proportionally across its remaining siblings and
61
+ * collapsing upward. Never removes the last leaf — a workspace always has at least one pane, and
62
+ * the single-leaf tree is the terminal state.
63
+ */
64
+ export declare function removePane(tree: PaneNode, paneId: string): PaneNode;
65
+ /**
66
+ * Collapse single-child splits and splice same-direction runs flat, bottom-up.
67
+ *
68
+ * Without the splice, removing `B` from `row[A, column[B, row[C, D]]]` would promote `row[C, D]`
69
+ * into the outer row as a nested same-direction split; this restores `row[A, C, D]`.
70
+ */
71
+ export declare function normalizePaneTree(node: PaneNode): PaneNode;
72
+ /**
73
+ * Smallest fraction a divider drag may leave a pane at.
74
+ *
75
+ * A **resize** constraint, not a global invariant: `splitPane` halves its target unconditionally,
76
+ * so repeated splits can legitimately *birth* a pane below this. The clamp only guarantees a drag
77
+ * never reduces a neighbour below the minimum — an already-sub-minimum neighbour can still grow.
78
+ */
79
+ export declare const MIN_PANE_FRACTION = 0.1;
80
+ export interface Rect {
81
+ x: number;
82
+ y: number;
83
+ width: number;
84
+ height: number;
85
+ }
86
+ /**
87
+ * Fractional rectangles (0..1) keyed by pane id; callers multiply by their measured content box.
88
+ *
89
+ * Kept fractional on purpose: the flat panel host re-derives pixel boxes from one `ResizeObserver`
90
+ * measurement, so a container resize never has to walk the tree again.
91
+ */
92
+ export declare function paneRects(tree: PaneNode): Map<string, Rect>;
93
+ /** Child indices from the root down to a split; the root split's path is `[]`. */
94
+ export type SplitPath = readonly number[];
95
+ export interface Divider {
96
+ splitPath: SplitPath;
97
+ /** Boundary between `children[boundaryIndex]` and `children[boundaryIndex + 1]`. */
98
+ boundaryIndex: number;
99
+ direction: SplitDirection;
100
+ /** Zero-thickness line spanning the split's cross-axis extent; the UI gives it a hit area. */
101
+ rect: Rect;
102
+ /**
103
+ * The split's OWN rect. `sizes` are fractions of this, not of the whole host, so this is the
104
+ * denominator a drag needs: `deltaFraction = deltaPx / (splitRect extent along `direction` × host
105
+ * extent)`. Using the host extent instead would under-move every nested split's divider.
106
+ */
107
+ splitRect: Rect;
108
+ }
109
+ /** A split with N children owns N−1 interior boundaries. */
110
+ export declare function dividers(tree: PaneNode): Divider[];
111
+ /**
112
+ * Shift `deltaFraction` from `children[boundaryIndex + 1]` to `children[boundaryIndex]`, clamped so
113
+ * neither neighbour is reduced below `MIN_PANE_FRACTION`. Only those two siblings change.
114
+ *
115
+ * `deltaFraction` is the pointer delta along the split axis divided by the content box's extent on
116
+ * that axis — the pixel conversion belongs to the UI, not here.
117
+ */
118
+ export declare function resizeAtDivider(tree: PaneNode, splitPath: SplitPath, boundaryIndex: number, deltaFraction: number): PaneNode;
119
+ /**
120
+ * The tree **as rendered**: leaves absent from `occupied` are dropped and collapsed exactly as
121
+ * `removePane` would, without touching the stored tree.
122
+ *
123
+ * During restore a persisted pane may hold no tab yet; it must render as absent (its fraction
124
+ * redistributed) while staying in the stored tree, because its tab may simply not have arrived from
125
+ * the daemon yet. Pruning for real is tied to the hydration settle point, not to geometry.
126
+ */
127
+ export declare function effectiveTree(tree: PaneNode, occupied: ReadonlySet<string>): PaneNode;
128
+ /** Bumped only on a breaking layout-record shape change; a mismatch discards the whole record. */
129
+ export declare const PANE_LAYOUT_VERSION = 1;
130
+ /**
131
+ * Parse untrusted persisted JSON into a valid tree, or `null` when it is structurally damaged.
132
+ * Never throws — callers treat `null` as "start this workspace from a single pane".
133
+ *
134
+ * The line between repair and rejection is deliberate. Sizes that merely drift from summing to 1
135
+ * are **renormalized**: float error accumulates across save/load cycles and losing a layout to
136
+ * rounding would be a bug. Structural damage — length mismatch, duplicate pane ids, non-finite or
137
+ * non-positive sizes, a split with fewer than two children — is **rejected**, because a malformed
138
+ * tree would otherwise crash geometry or render one pane twice.
139
+ */
140
+ export declare function parsePaneTree(input: unknown): PaneNode | null;
141
+ //# sourceMappingURL=pane-tree.d.ts.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Tab kind → panel component map (POC `createTabPanel` switch, POC_TO_APP_PLAN_UI.md §4.2).
3
+ * Panels are lazy-loaded — the terminal (xterm) and diff/highlighter modules only pay their
4
+ * bundle cost once a tab of that kind actually opens (§6 Performance strategy).
5
+ */
6
+ import { type ComponentType } from "react";
7
+ import type { Tab } from "../../stores/tab-store.js";
8
+ export interface PanelProps {
9
+ tab: Tab;
10
+ owningPaneId: string | null;
11
+ }
12
+ export declare const PANEL_BY_KIND: Record<Tab["kind"], ComponentType<PanelProps>>;
13
+ //# sourceMappingURL=panel-registry.d.ts.map
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Reopen the **client-side** tabs a persisted layout still claims: `file`, `diff`, and `molecule`.
3
+ *
4
+ * Chats and terminals are rebuilt from the daemon's own inventory (`use-session-restore.ts`,
5
+ * `use-terminal-restore.ts`) — the daemon owns them, and one deleted since the last load must not
6
+ * come back. A file/diff/molecule tab has no daemon-side existence at all; it is a *view of a path*.
7
+ * Nothing would ever reopen it, so its claim expired at the hydration settle point and its pane was
8
+ * pruned: open two files side by side, reload, and the split silently collapsed to one pane.
9
+ *
10
+ * No extra persisted state is needed, because the **identity is already the descriptor**:
11
+ * `file:<path>`, `diff:<staged|worktree>:<path>`, `molecule:<path>` (`tab-store.ts`'s `tabIdentity`).
12
+ * A kind whose identity carries no path — a slot-less terminal, an empty molecule tab — was never
13
+ * persisted in the first place, so there is nothing to miss.
14
+ *
15
+ * `tabFromIdentity` is the exact inverse of `tabIdentity` for these three kinds, and is built here
16
+ * rather than by calling `openFileTab` precisely because that helper *dispatches*: it re-routes a
17
+ * molecule extension to a `molecule` tab, which would turn a persisted `file:/a/x.cif` claim into a
18
+ * `molecule:` tab, leave the claim unconsumed, and prune the pane. Round-tripping identity is the
19
+ * whole job here, so the mapping must be literal.
20
+ *
21
+ * Synchronous and claim-driven, which is what lets it run at boot before a connection exists: each
22
+ * open consumes its own claim (`layout-store.claimPaneFor`), the panels' content queries are gated on
23
+ * the client and fire when it arrives (`use-file-read.ts`'s `enabled`), and the whole replay finishes
24
+ * long before either daemon restore reports in — so ordering against them needs no coordination.
25
+ *
26
+ * swe/features/workspace-split-panes.md § Restoring a persisted layout, § Tab identity
27
+ */
28
+ import type { ValidatedWorkspaceLayout } from "../../lib/pane-layout-persistence.js";
29
+ import { type Tab } from "../../stores/tab-store.js";
30
+ export declare function reopenClientTabs(loaded: ReadonlyMap<string, ValidatedWorkspaceLayout>): void;
31
+ /**
32
+ * The tab a persisted identity describes, or `null` when it names a daemon-owned kind (`agent:`,
33
+ * `terminal:`) or anything unrecognised — a record written by a newer client can carry kinds this one
34
+ * has never heard of, and those must be ignored rather than guessed at.
35
+ *
36
+ * `isViewerEnabled` is a required, injected parameter — never read from the settings store
37
+ * directly — so this stays the pure, synchronous inverse of `tabIdentity` it always was, unit-tested
38
+ * with no stores. Phase 3's plugin registry supplies the same parameter unchanged. When a
39
+ * `molecule:` identity's viewer is disabled, this returns EXACTLY the tab the `file:` branch would
40
+ * produce for the same path (`kind: "file"`, `tabIds.file(path)`) — "disabled" means offer the file
41
+ * as text, never orphan the claim and never fabricate a molecule tab the user just turned off.
42
+ */
43
+ export declare function tabFromIdentity(identity: string, workspaceCwd: string, isViewerEnabled: (id: string) => boolean): Tab | null;
44
+ //# sourceMappingURL=reopen-client-tabs.d.ts.map
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Bring the workspace that was in view back into view after a reload.
3
+ *
4
+ * Panes are restored per workspace, but *which* workspace the user was looking at is a separate fact,
5
+ * and without it restore lands wherever the most recently active agent happens to live
6
+ * (`use-session-restore.ts` activates `order[0]`, and every tab open brings its own workspace into
7
+ * view). With two workspaces open that is a coin flip: the panes come back correctly and the user sees
8
+ * the wrong ones — a bug that reads as "my layout was lost" until you click the other workspace and
9
+ * watch the split appear intact.
10
+ *
11
+ * Waits for the **hydration settle point** rather than acting on the first arriving tab: tabs arrive
12
+ * asynchronously and out of order, and any later `open()` would switch the view again — the last
13
+ * writer has to be this one. At the settle point every tab that will arrive has arrived.
14
+ *
15
+ * Two conditions to switch, both about not lying to the user:
16
+ * - the workspace still has a layout (its entry survived validation), and
17
+ * - it has at least one live tab, so switching does not land on an empty workspace whose sessions were
18
+ * all deleted since the last load.
19
+ *
20
+ * swe/features/workspace-split-panes.md § Restoring a persisted layout
21
+ */
22
+ /**
23
+ * Watch for the settle point and restore the view once. Returns the unsubscribe, which is also called
24
+ * automatically after the switch — this is a one-shot, so a later user-initiated workspace switch is
25
+ * never undone.
26
+ */
27
+ export declare function installActiveWorkspaceRestore(cwd: string | null): () => void;
28
+ /** Exported for tests: the switch itself, with both guards. Returns whether it switched. */
29
+ export declare function restoreActiveWorkspace(cwd: string): boolean;
30
+ //# sourceMappingURL=restore-active-workspace.d.ts.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Pure, framework-free value formatters for the workspace status bar (sprint-042). No store/DOM
3
+ * access — every function takes plain values and returns a display string, so each is directly
4
+ * unit-testable without rendering anything (matches the project's `lib/`-style convention of
5
+ * keeping core logic free of DOM dependencies).
6
+ */
7
+ /** `undefined` → "--"; <1000 exact; ≥1000 → "12.3k"; ≥1_000_000 → "1.2M" (one decimal, trimmed). */
8
+ export declare function formatTokens(n: number | undefined): string;
9
+ /** Formats a **0–100** percentage (Pi's scale, see `stats-store`'s `contextPercent`) as a rounded
10
+ * integer; anything above zero but under 1 renders `<1%` rather than a misleading `0%`.
11
+ * `undefined`/`null` → "--". */
12
+ export declare function formatPercent(p: number | null | undefined): string;
13
+ /** `undefined` → "--"; small costs keep more precision (< $1 → 4 decimals), larger costs 2 dp. */
14
+ export declare function formatCost(c: number | undefined): string;
15
+ /** Collapses a leading `home` prefix to `~`. No-op when `home` is null/undefined or not a prefix
16
+ * of `cwd`. Does not truncate/ellipsize — that's a CSS concern for the component to apply. */
17
+ export declare function formatCwd(cwd: string, home: string | null | undefined): string;
18
+ /** `"↑2 ↓1"` — omits a zero side; `""` when both are zero (nothing to show). */
19
+ export declare function formatBranchMeta(ahead: number, behind: number): string;
20
+ //# sourceMappingURL=status-bar-format.d.ts.map
@@ -0,0 +1,35 @@
1
+ /**
2
+ * A background chat tab's "attention" state — a projection of its session's status, never new
3
+ * per-tab state. `Tab` has no unread/dirty flag (`stores/tab-store.ts`), and inventing one means
4
+ * owning read-receipt semantics (what marks a tab read? focus? scroll to bottom?) that redesign
5
+ * spec § 07 does not define and nothing else in the app tracks.
6
+ *
7
+ * Only two statuses earn a dot from `sessionStatus` alone: a turn in progress, or the last one
8
+ * having failed. Every other status (`idle`, `initializing`, `closed`) would paint permanent
9
+ * decoration rather than attention — a `closed` session's tab does not need a green dot forever.
10
+ * Sprint-069/task-004 adds a third, independent source: a pending extension question, sourced
11
+ * from sprint-068's store rather than `sessionStatus` (the two are orthogonal — a session can be
12
+ * `idle` with a question pending). The pane's own *active* chat tab never gets a dot at all, for
13
+ * any source: `TurnProgressBar` already sweeps under the strip while a turn runs, an `ErrorRow`
14
+ * already renders a failed turn in the timeline, and sprint-068's own cards already render inline
15
+ * for the active session — a dot directly above any of those would be the same information
16
+ * twice. This is strictly the background-tab affordance.
17
+ *
18
+ * docs/UI design/redesign 0.1.0/Redesign Handoff Spec.dc.html § 07
19
+ */
20
+ import type { AgentStatus as ProtocolAgentStatus } from "@av-pi-studio/protocol";
21
+ import type { StatusDotInput } from "@av-pi-studio/ui-library";
22
+ import type { Tab } from "../../stores/tab-store.js";
23
+ /**
24
+ * `sessionStatus` is `undefined` for a chat tab whose session hasn't landed in the store yet (an
25
+ * offline-restore ordering gap) — treated the same as "nothing to show", never a throw.
26
+ * `activeInPane` is whether `tab` is its own pane's active tab (not workspace-active — the same
27
+ * per-pane notion `TabStrip.tsx` already highlights). `hasPendingQuestion` is sprint-068's store,
28
+ * sourced by the caller (`useAgentUiPending`) — this module stays store-free, matching
29
+ * `sidebarSessionView`'s contract (sprint-069/task-001). Needs-input does not depend on
30
+ * `sessionStatus` at all (it is a distinct, session-status-independent signal), so it is checked
31
+ * before the `sessionStatus === undefined` gap — an offline-restore ordering gap on the *session*
32
+ * store must not suppress a pending-question signal that already landed via the *agent-ui* store.
33
+ */
34
+ export declare function tabAttentionStatus(tab: Tab, sessionStatus: ProtocolAgentStatus | "idle" | undefined, activeInPane: boolean, hasPendingQuestion: boolean): StatusDotInput | null;
35
+ //# sourceMappingURL=tab-attention.d.ts.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * OpenWorkspaceDialog — directory browser for opening a new workspace (evolved from the POC
3
+ * `#cwd-overlay`, chat.html ~line 328-336, 1122-1141; POC_TO_APP_PLAN_UI.md §4.7 follow-up:
4
+ * toolbar "Open Workspace" button). Built on the generic `Dialog` primitive
5
+ * (`components/primitives/Dialog.tsx`) — this file owns only the address input + Go/Up buttons +
6
+ * directory list body. "Open" resolves the selected path to a session via `openWorkspace()` —
7
+ * reusing the workspace's most recent existing session if one is already open there, else
8
+ * creating a new one — then closes.
9
+ */
10
+ export declare function OpenWorkspaceDialog(): import("react").JSX.Element;
11
+ //# sourceMappingURL=OpenWorkspaceDialog.d.ts.map
Binary file
Binary file
@@ -0,0 +1,97 @@
1
+ Cascadia Mono / Cascadia Mono NF — https://github.com/microsoft/cascadia-code
2
+ Bundled files: CascadiaMono.woff2, CascadiaMonoNF.woff2 (release v2407.24, official woff2 build)
3
+
4
+ Copyright (c) 2019 - Present, Microsoft Corporation,
5
+ with Reserved Font Name Cascadia Code.
6
+
7
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
8
+ This license is copied below, and is also available with a FAQ at:
9
+ http://scripts.sil.org/OFL
10
+
11
+
12
+ -----------------------------------------------------------
13
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
14
+ -----------------------------------------------------------
15
+
16
+ PREAMBLE
17
+ The goals of the Open Font License (OFL) are to stimulate worldwide
18
+ development of collaborative font projects, to support the font creation
19
+ efforts of academic and linguistic communities, and to provide a free and
20
+ open framework in which fonts may be shared and improved in partnership
21
+ with others.
22
+
23
+ The OFL allows the licensed fonts to be used, studied, modified and
24
+ redistributed freely as long as they are not sold by themselves. The
25
+ fonts, including any derivative works, can be bundled, embedded,
26
+ redistributed and/or sold with any software provided that any reserved
27
+ names are not used by derivative works. The fonts and derivatives,
28
+ however, cannot be released under any other type of license. The
29
+ requirement for fonts to remain under this license does not apply
30
+ to any document created using the fonts or their derivatives.
31
+
32
+ DEFINITIONS
33
+ "Font Software" refers to the set of files released by the Copyright
34
+ Holder(s) under this license and clearly marked as such. This may
35
+ include source files, build scripts and documentation.
36
+
37
+ "Reserved Font Name" refers to any names specified as such after the
38
+ copyright statement(s).
39
+
40
+ "Original Version" refers to the collection of Font Software components as
41
+ distributed by the Copyright Holder(s).
42
+
43
+ "Modified Version" refers to any derivative made by adding to, deleting,
44
+ or substituting -- in part or in whole -- any of the components of the
45
+ Original Version, by changing formats or by porting the Font Software to a
46
+ new environment.
47
+
48
+ "Author" refers to any designer, engineer, programmer, technical
49
+ writer or other person who contributed to the Font Software.
50
+
51
+ PERMISSION & CONDITIONS
52
+ Permission is hereby granted, free of charge, to any person obtaining
53
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
54
+ redistribute, and sell modified and unmodified copies of the Font
55
+ Software, subject to the following conditions:
56
+
57
+ 1) Neither the Font Software nor any of its individual components,
58
+ in Original or Modified Versions, may be sold by itself.
59
+
60
+ 2) Original or Modified Versions of the Font Software may be bundled,
61
+ redistributed and/or sold with any software, provided that each copy
62
+ contains the above copyright notice and this license. These can be
63
+ included either as stand-alone text files, human-readable headers or
64
+ in the appropriate machine-readable metadata fields within text or
65
+ binary files as long as those fields can be easily viewed by the user.
66
+
67
+ 3) No Modified Version of the Font Software may use the Reserved Font
68
+ Name(s) unless explicit written permission is granted by the corresponding
69
+ Copyright Holder. This restriction only applies to the primary font name as
70
+ presented to the users.
71
+
72
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
73
+ Software shall not be used to promote, endorse or advertise any
74
+ Modified Version, except to acknowledge the contribution(s) of the
75
+ Copyright Holder(s) and the Author(s) or with their explicit written
76
+ permission.
77
+
78
+ 5) The Font Software, modified or unmodified, in part or in whole,
79
+ must be distributed entirely under this license, and must not be
80
+ distributed under any other license. The requirement for fonts to
81
+ remain under this license does not apply to any document created
82
+ using the Font Software.
83
+
84
+ TERMINATION
85
+ This license becomes null and void if any of the above conditions are
86
+ not met.
87
+
88
+ DISCLAIMER
89
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
90
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
91
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
92
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
93
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
94
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
95
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
96
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
97
+ OTHER DEALINGS IN THE FONT SOFTWARE.
package/dist/fonts.css ADDED
@@ -0,0 +1,60 @@
1
+ /* Bundled terminal typeface — "Cascadia Mono NF".
2
+ *
3
+ * WHY A BUNDLED FONT AT ALL: the terminal renders a real shell, and a prompt like powerlevel10k
4
+ * (whose own docs recommend MesloLGS NF) paints Nerd Font glyphs from the private-use planes. A
5
+ * browser has no access to the user's installed terminal font unless it happens to be installed
6
+ * system-wide AND named in the font stack, so without a webfont every icon in that prompt is a
7
+ * tofu box. MesloLGS NF itself is a *desktop* distribution — 2.5 MB TTFs, four separate static
8
+ * faces, no woff2, and (measured) no braille coverage at all, which is what most CLI spinners
9
+ * draw with. Microsoft publishes official woff2 builds of Cascadia, including Nerd-Font-patched
10
+ * variants, so that is what ships here. `theme/tokens.ts`'s TERMINAL_FONT_STACK still names
11
+ * MesloLGS NF *first*, so a user who installed it per the p10k instructions keeps their own font
12
+ * and downloads nothing.
13
+ *
14
+ * WHY TWO FACES OF ONE FAMILY: the NF file carries ~9.2k icon glyphs and costs 976 KB; the plain
15
+ * one is 210 KB and already covers latin + all 128 box-drawing + 32 block + 256 braille glyphs.
16
+ * Splitting them by `unicode-range` under a single family name means a plain `bash` session
17
+ * fetches 210 KB and the icon file is fetched only when a glyph in the icon planes is actually
18
+ * painted — the browser resolves per character, so this is real laziness, not a heuristic.
19
+ *
20
+ * WHY THIS IS SAFE FOR CELL ALIGNMENT: xterm.js assumes one advance width for every glyph in a
21
+ * row. Both files are the same typeface at unitsPerEm 2048 with an advance of exactly 0.5859 em
22
+ * for every glyph — latin, box drawing, powerline and Material icons alike — so a row that mixes
23
+ * the two stays on the grid. This is also why the standalone "Symbols Nerd Font Mono" is NOT used
24
+ * here despite being the obvious icon-only candidate: its glyphs advance a full 1.0 em (it has no
25
+ * host font to match), which is 1.7x this cell and shifts the rest of the line.
26
+ *
27
+ * Both files are variable-weight (`wght` 200-700), so xterm's bold attribute is synthesised from
28
+ * the same download rather than pulling a second file.
29
+ *
30
+ * `font-display: block`: the alternative (`swap`) paints one frame in a fallback font of a
31
+ * different width, which for a terminal means the whole grid visibly reflows. Blocking briefly is
32
+ * the lesser evil, and `TerminalPanel.tsx` waits for this face before it measures a cell anyway.
33
+ */
34
+
35
+ @font-face {
36
+ font-family: "Cascadia Mono NF";
37
+ src:
38
+ local("Cascadia Mono NF"),
39
+ url("./fonts/CascadiaMono.woff2") format("woff2");
40
+ font-weight: 200 700;
41
+ font-style: normal;
42
+ font-display: block;
43
+ /* Everything except the icon planes below. Excluding U+E000-F8FF costs nothing: the plain file
44
+ has zero glyphs mapped in that range. */
45
+ unicode-range: U+0-DFFF, U+F900-FFFD;
46
+ }
47
+
48
+ /* Nerd Font icons: powerline separators (U+E0A0-E0D4), devicons/octicons/font-awesome/weather
49
+ (U+E000-F8FF) and Material Design Icons (U+F0000-FFFFD). Declared second and range-restricted,
50
+ so it is the only candidate for those characters and never a candidate for text. */
51
+ @font-face {
52
+ font-family: "Cascadia Mono NF";
53
+ src:
54
+ local("Cascadia Mono NF"),
55
+ url("./fonts/CascadiaMonoNF.woff2") format("woff2");
56
+ font-weight: 200 700;
57
+ font-style: normal;
58
+ font-display: block;
59
+ unicode-range: U+E000-F8FF, U+F0000-FFFFD;
60
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Shared `AgentStreamEvent` → store-update logic, consumed by the live subscription
3
+ * (`use-agent-stream.ts`), which attaches the instant a session's `agentId` is bound —
4
+ * including a freshly materialized draft, before its first turn can possibly start streaming
5
+ * (`Composer.tsx`'s file header) — so there is no separate raw-broadcast/first-turn-gate path
6
+ * here anymore.
7
+ */
8
+ import type { PiStudioClient } from "@av-pi-studio/client";
9
+ import type { AgentStreamEvent } from "@av-pi-studio/protocol";
10
+ import type { QueryClient } from "@tanstack/react-query";
11
+ export interface ApplyAgentStreamEventArgs {
12
+ sessionId: string;
13
+ event: AgentStreamEvent;
14
+ /** Daemon-owned timestamp of this event's timeline row, forwarded from the SDK's stream meta. */
15
+ timestamp?: string;
16
+ client: PiStudioClient;
17
+ queryClient: QueryClient;
18
+ }
19
+ export declare function applyAgentStreamEvent({ sessionId, event, timestamp, client, queryClient, }: ApplyAgentStreamEventArgs): void;
20
+ //# sourceMappingURL=agent-stream-events.d.ts.map
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Pure query-state merge for `use-file-text` (task-009), kept DOM/React-free so the
3
+ * loading/error/data composition across the two dependent queries it wraps (download → decode)
4
+ * is unit-testable directly, without `renderHook` (no jsdom test environment in this repo).
5
+ */
6
+ export interface FileTextResult {
7
+ content: string;
8
+ }
9
+ export interface FileTextMergeInputs {
10
+ enabled: boolean;
11
+ download: {
12
+ isLoading: boolean;
13
+ isError: boolean;
14
+ error: unknown;
15
+ hasObjectUrl: boolean;
16
+ };
17
+ decode: {
18
+ isLoading: boolean;
19
+ isError: boolean;
20
+ error: unknown;
21
+ data: FileTextResult | undefined;
22
+ };
23
+ }
24
+ export interface FileTextQueryState {
25
+ isLoading: boolean;
26
+ isError: boolean;
27
+ error: unknown;
28
+ data: FileTextResult | undefined;
29
+ }
30
+ export declare function mergeFileTextState(input: FileTextMergeInputs): FileTextQueryState;
31
+ //# sourceMappingURL=file-text-state.d.ts.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Shared `FileTransferClient` accessor — one instance per daemon connection so every
3
+ * transfer consumer (inline viewer downloads, save-to-disk downloads, uploads) shares the
4
+ * single inbound-frame demuxer over the one WebSocket. Mirrors `TerminalPanel.tsx`'s
5
+ * `routerFor` pattern.
6
+ */
7
+ import type { DaemonClient } from "@av-pi-studio/client";
8
+ import { FileTransferClient } from "@av-pi-studio/client";
9
+ export declare function transferFor(daemon: DaemonClient): FileTransferClient;
10
+ //# sourceMappingURL=file-transfer-instance.d.ts.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * `use-agent-commands` — TanStack Query wrapper over `agent_list_commands_request`
3
+ * (`client.agent(id).listCommands()`, sprint-040 web-client half). Cached exactly like
4
+ * `use-provider-models.ts`: read-through by `["agents","commands",sessionId]`, no `staleTime`/
5
+ * `gcTime`/`retry` override of its own, so a subsequent open of the `/` menu — including the
6
+ * auto-open that fires on every `/` keystroke — shows the cached rows immediately
7
+ * (`isLoading: false`) while a background refetch keeps the list current, instead of re-showing
8
+ * a loading spinner every time.
9
+ */
10
+ export declare function useAgentCommands(sessionId: string, enabled?: boolean): import("@tanstack/react-query").UseQueryResult<NoInfer<import("zod").objectOutputType<{
11
+ name: import("zod").ZodString;
12
+ id: import("zod").ZodOptional<import("zod").ZodString>;
13
+ description: import("zod").ZodOptional<import("zod").ZodString>;
14
+ source: import("zod").ZodOptional<import("zod").ZodEnum<["extension", "prompt", "skill"]>>;
15
+ scope: import("zod").ZodOptional<import("zod").ZodEnum<["user", "project", "temporary"]>>;
16
+ path: import("zod").ZodOptional<import("zod").ZodString>;
17
+ }, import("zod").ZodTypeAny, "passthrough">[]>, Error>;
18
+ //# sourceMappingURL=use-agent-commands.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { type AgentDeepLinkSource } from "../host/types.js";
2
+ /**
3
+ * Reads the pending agent deep link at boot and every later request into the pending-target store.
4
+ * Never connects; the initial apply happens in `useSessionRestore` after restore settles. A request
5
+ * that arrives while the app is open and restored applies immediately. Returns the unsubscribe.
6
+ */
7
+ export declare function startAgentDeepLinkBoot(source: AgentDeepLinkSource, apply?: () => void): () => void;
8
+ export declare function useAgentDeepLinkBoot(): void;
9
+ //# sourceMappingURL=use-agent-deep-link-boot.d.ts.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Live timeline subscription for a chat session. Subscribes to
3
+ * `client.agent(agentId).timeline.subscribe` whenever both the connection's `client` and the
4
+ * session's `agentId` are available, routing every event through `applyAgentStreamEvent`
5
+ * (POC_TO_APP_PLAN_UI.md §4.3). Also mirrors the POC's `handleAgentStream` turn-lifecycle →
6
+ * `session.status` transitions so the Composer's Stop button and the session-list status dot
7
+ * stay live.
8
+ *
9
+ * By design, a deferred draft's `agentId` is bound before any turn can start (at tab-open time
10
+ * via `ensureMaterialized` in the Composer), so this subscription attaches before streaming
11
+ * begins. There is no raw-broadcast first-turn workaround — every event is captured by the live
12
+ * subscription, including the first turn.
13
+ */
14
+ export declare function useAgentStream(sessionId: string): void;
15
+ //# sourceMappingURL=use-agent-stream.d.ts.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Agent todos boot: one `agent_todos_update` subscription per open connection, and a refetch of
3
+ * every tracked agent each time a connection opens (the daemon restarts `seq` at 1 on restart, so
4
+ * the store resets seq tracking first). A daemon without the `agentTodos` capability gets zero
5
+ * requests and an emptied store. Other statuses keep the snapshots: the next open resets them.
6
+ *
7
+ * Mount once in `app.tsx`'s `Boot`, next to `useViewerSettingsBoot()`.
8
+ */
9
+ export declare function useAgentTodosBoot(): void;
10
+ //# sourceMappingURL=use-agent-todos.d.ts.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * `use-checkout-status` — subscribes to live git checkout status for a cwd (POC `loadChanges` +
3
+ * `handleCheckoutStatusUpdate`, POC_TO_APP_PLAN_UI.md §4.7 / §3 `hooks/use-checkout-status.ts`).
4
+ * On `cwd` change: unsubscribes the previous cwd (`checkout_status_unsubscribe`), subscribes the
5
+ * new one (`checkout_status_subscribe`), and routes pushed `checkout_status_update` session
6
+ * messages into `git-store`. Cleans up both the RPC subscription and the message handler on
7
+ * unmount/cwd-change — the POC leaked subscriptions on cwd change (§4.7).
8
+ */
9
+ export interface UseCheckoutStatusResult {
10
+ refresh(): void;
11
+ }
12
+ export declare function useCheckoutStatus(cwd: string): UseCheckoutStatusResult;
13
+ //# sourceMappingURL=use-checkout-status.d.ts.map
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Boot hook: applies the host's launch intent once on mount — pre-fills the connection bar
3
+ * (host/password/cwd) and connects when the intent says so. In the browser the intent comes from
4
+ * the page URL (`host/browser-launch.ts`: `?host=&password=&cwd=&connect=1`, `?pair=`, a fragment
5
+ * carrying `offer=`); a native shell supplies its own.
6
+ *
7
+ * The URL is handed to `connect()` verbatim — it detects a pairing link itself via
8
+ * `parsePairingUrl` and branches to the relay transport when the link carries one. A pairing link
9
+ * is its own credential, so no password is sent with it.
10
+ */
11
+ import { type ConnectIntent } from "../host/types.js";
12
+ import { type ConnectOptions } from "../lib/connection/connection-store.js";
13
+ export interface ConnectIntentDeps {
14
+ setHost(host: string): void;
15
+ setPassword(password: string): void;
16
+ setCwd(cwd: string): void;
17
+ /** The connection bar's fields after pre-filling (a missing `url` keeps its current host). */
18
+ fields(): {
19
+ host: string;
20
+ password: string;
21
+ };
22
+ connect(options: ConnectOptions): void;
23
+ }
24
+ /** Pre-fill from `intent`, then connect to the bar's fields if it asks to. `null` does nothing. */
25
+ export declare function applyConnectIntent(intent: ConnectIntent | null, deps: ConnectIntentDeps): void;
26
+ export declare function useConnectionBoot(): void;
27
+ //# sourceMappingURL=use-connection.d.ts.map