@wrongstack/tui 0.297.0 → 0.298.1

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 (314) hide show
  1. package/dist/app-action-type.d.ts +25 -2
  2. package/dist/app-key-handler.d.ts +4 -0
  3. package/dist/app-props.d.ts +11 -1
  4. package/dist/app-settings-type.d.ts +19 -3
  5. package/dist/app-state.d.ts +6 -2
  6. package/dist/app-status-region.d.ts +7 -2
  7. package/dist/components/auth-panel.d.ts +4 -0
  8. package/dist/components/confirm-prompt.d.ts +14 -0
  9. package/dist/components/fleet-panel.d.ts +3 -1
  10. package/dist/components/history/copy-geometry.d.ts +61 -0
  11. package/dist/components/history/sage-output-format.d.ts +7 -6
  12. package/dist/components/history/scroll-controller-types.d.ts +116 -0
  13. package/dist/components/history/scrollbar-geometry.d.ts +60 -0
  14. package/dist/components/history/scrollbar-rail.d.ts +18 -0
  15. package/dist/components/history/selection-helpers.d.ts +111 -0
  16. package/dist/components/input.d.ts +8 -1
  17. package/dist/components/scrollable-history.d.ts +7 -136
  18. package/dist/components/settings-picker-model.d.ts +11 -1
  19. package/dist/components/settings-picker.d.ts +4 -4
  20. package/dist/components/sidebar-content.d.ts +47 -0
  21. package/dist/components/sidebar.d.ts +40 -0
  22. package/dist/components/status-bar-format.d.ts +10 -0
  23. package/dist/components/status-bar-types.d.ts +38 -5
  24. package/dist/components/status-bar.d.ts +1 -1
  25. package/dist/hit-test.d.ts +3 -2
  26. package/dist/hooks/use-provider-event-bridge.d.ts +1 -1
  27. package/dist/hooks/use-statusbar-view-model.d.ts +1 -0
  28. package/dist/hooks/use-tui-slash-commands.d.ts +1 -1
  29. package/dist/index.js +1803 -799
  30. package/dist/input-validation/action-types.d.ts +1 -1
  31. package/dist/markdown.d.ts +2 -0
  32. package/dist/reducers/helpers.d.ts +1 -1
  33. package/dist/reducers/workspace-panels.d.ts +1 -1
  34. package/dist/run-tui-options.d.ts +10 -1
  35. package/dist/settings-contracts.d.ts +1 -1
  36. package/dist/token-previews.d.ts +3 -2
  37. package/dist/ui-contracts.d.ts +9 -0
  38. package/package.json +11 -9
  39. package/dist/app-action-type.d.ts.map +0 -1
  40. package/dist/app-initial-state.d.ts.map +0 -1
  41. package/dist/app-key-handler.d.ts.map +0 -1
  42. package/dist/app-props.d.ts.map +0 -1
  43. package/dist/app-reducer.d.ts.map +0 -1
  44. package/dist/app-settings-type.d.ts.map +0 -1
  45. package/dist/app-state-core-types.d.ts.map +0 -1
  46. package/dist/app-state-fleet.d.ts.map +0 -1
  47. package/dist/app-state.d.ts.map +0 -1
  48. package/dist/app-status-region.d.ts.map +0 -1
  49. package/dist/app-ui-state.d.ts.map +0 -1
  50. package/dist/app-view-contract.d.ts.map +0 -1
  51. package/dist/app-view-state.d.ts.map +0 -1
  52. package/dist/app-view.d.ts.map +0 -1
  53. package/dist/app.d.ts.map +0 -1
  54. package/dist/auth-panel-model.d.ts.map +0 -1
  55. package/dist/brain-contracts.d.ts.map +0 -1
  56. package/dist/brain-panel-model.d.ts.map +0 -1
  57. package/dist/checkpoint-retention.d.ts.map +0 -1
  58. package/dist/clipboard.d.ts.map +0 -1
  59. package/dist/components/agents-monitor-constants.d.ts.map +0 -1
  60. package/dist/components/agents-monitor.d.ts.map +0 -1
  61. package/dist/components/animation-style.d.ts.map +0 -1
  62. package/dist/components/audit-panel.d.ts.map +0 -1
  63. package/dist/components/auth-panel-model.d.ts.map +0 -1
  64. package/dist/components/auth-panel.d.ts.map +0 -1
  65. package/dist/components/autonomy-picker.d.ts.map +0 -1
  66. package/dist/components/brain-decision-prompt.d.ts.map +0 -1
  67. package/dist/components/brain-panel-model.d.ts.map +0 -1
  68. package/dist/components/brain-panel.d.ts.map +0 -1
  69. package/dist/components/checkpoint-timeline.d.ts.map +0 -1
  70. package/dist/components/clear-confirm-panel.d.ts.map +0 -1
  71. package/dist/components/composer-status-chip.d.ts.map +0 -1
  72. package/dist/components/confirm-prompt.d.ts.map +0 -1
  73. package/dist/components/connections-panel.d.ts.map +0 -1
  74. package/dist/components/context-panel.d.ts.map +0 -1
  75. package/dist/components/continue-confirm-panel.d.ts.map +0 -1
  76. package/dist/components/coordinator-panel.d.ts.map +0 -1
  77. package/dist/components/cron-jobs.d.ts.map +0 -1
  78. package/dist/components/design-picker.d.ts.map +0 -1
  79. package/dist/components/enhance-panel.d.ts.map +0 -1
  80. package/dist/components/entry-error-boundary.d.ts.map +0 -1
  81. package/dist/components/esc-confirm-prompt.d.ts.map +0 -1
  82. package/dist/components/exit-confirm-panel.d.ts.map +0 -1
  83. package/dist/components/f-key-picker.d.ts.map +0 -1
  84. package/dist/components/file-picker.d.ts.map +0 -1
  85. package/dist/components/fleet-monitor.d.ts.map +0 -1
  86. package/dist/components/fleet-panel.d.ts.map +0 -1
  87. package/dist/components/goal-kanban-panel.d.ts.map +0 -1
  88. package/dist/components/goal-panel.d.ts.map +0 -1
  89. package/dist/components/help-overlay.d.ts.map +0 -1
  90. package/dist/components/help-panel.d.ts.map +0 -1
  91. package/dist/components/history/assistant.d.ts.map +0 -1
  92. package/dist/components/history/banner.d.ts.map +0 -1
  93. package/dist/components/history/basic-format.d.ts.map +0 -1
  94. package/dist/components/history/code-block-diff-helpers.d.ts.map +0 -1
  95. package/dist/components/history/code-block.d.ts.map +0 -1
  96. package/dist/components/history/copy-icon.d.ts.map +0 -1
  97. package/dist/components/history/entry.d.ts.map +0 -1
  98. package/dist/components/history/index.d.ts.map +0 -1
  99. package/dist/components/history/replay.d.ts.map +0 -1
  100. package/dist/components/history/sage-output-format.d.ts.map +0 -1
  101. package/dist/components/history/stream-box.d.ts.map +0 -1
  102. package/dist/components/history/tool-arg-format.d.ts.map +0 -1
  103. package/dist/components/history/tool-card.d.ts.map +0 -1
  104. package/dist/components/history/tool-group.d.ts.map +0 -1
  105. package/dist/components/history/tool-output-summary.d.ts.map +0 -1
  106. package/dist/components/history/tool-visual-command.d.ts.map +0 -1
  107. package/dist/components/history/tool-visual-domain.d.ts.map +0 -1
  108. package/dist/components/history/tool-visual-format.d.ts.map +0 -1
  109. package/dist/components/history/tool-visual-lsp.d.ts.map +0 -1
  110. package/dist/components/history/tool-visual-misc.d.ts.map +0 -1
  111. package/dist/components/history/tool-visual-mode-workdir.d.ts.map +0 -1
  112. package/dist/components/history/tool-visual-types.d.ts.map +0 -1
  113. package/dist/components/history/types.d.ts.map +0 -1
  114. package/dist/components/history/utils.d.ts.map +0 -1
  115. package/dist/components/history/visual-lines.d.ts.map +0 -1
  116. package/dist/components/history/visual-memory-logs.d.ts.map +0 -1
  117. package/dist/components/history.d.ts.map +0 -1
  118. package/dist/components/input.d.ts.map +0 -1
  119. package/dist/components/kanban-panel.d.ts.map +0 -1
  120. package/dist/components/key-hint-bar.d.ts.map +0 -1
  121. package/dist/components/live-activity-strip.d.ts.map +0 -1
  122. package/dist/components/mailbox-panel.d.ts.map +0 -1
  123. package/dist/components/mcp-picker.d.ts.map +0 -1
  124. package/dist/components/memory-context-widget.d.ts.map +0 -1
  125. package/dist/components/mode-picker.d.ts.map +0 -1
  126. package/dist/components/model-picker.d.ts.map +0 -1
  127. package/dist/components/monitor-shell.d.ts.map +0 -1
  128. package/dist/components/phase-monitor.d.ts.map +0 -1
  129. package/dist/components/phase-panel.d.ts.map +0 -1
  130. package/dist/components/plan-panel.d.ts.map +0 -1
  131. package/dist/components/plugin-picker.d.ts.map +0 -1
  132. package/dist/components/powerline-rail.d.ts.map +0 -1
  133. package/dist/components/process-list.d.ts.map +0 -1
  134. package/dist/components/project-picker.d.ts.map +0 -1
  135. package/dist/components/prompt-picker.d.ts.map +0 -1
  136. package/dist/components/provider-colors.d.ts.map +0 -1
  137. package/dist/components/queue-panel.d.ts.map +0 -1
  138. package/dist/components/refine-countdown-panel.d.ts.map +0 -1
  139. package/dist/components/refine-failure-panel.d.ts.map +0 -1
  140. package/dist/components/resume-picker.d.ts.map +0 -1
  141. package/dist/components/scrollable-history.d.ts.map +0 -1
  142. package/dist/components/sdd-board-overlay.d.ts.map +0 -1
  143. package/dist/components/send-mode-picker.d.ts.map +0 -1
  144. package/dist/components/sessions-panel.d.ts.map +0 -1
  145. package/dist/components/settings-picker-filter.d.ts.map +0 -1
  146. package/dist/components/settings-picker-jumps.d.ts.map +0 -1
  147. package/dist/components/settings-picker-model.d.ts.map +0 -1
  148. package/dist/components/settings-picker-row-list.d.ts.map +0 -1
  149. package/dist/components/settings-picker.d.ts.map +0 -1
  150. package/dist/components/shadow-panel.d.ts.map +0 -1
  151. package/dist/components/shell-command-warning.d.ts.map +0 -1
  152. package/dist/components/slash-confirm-panel.d.ts.map +0 -1
  153. package/dist/components/slash-menu.d.ts.map +0 -1
  154. package/dist/components/status-bar-chips.d.ts.map +0 -1
  155. package/dist/components/status-bar-format.d.ts.map +0 -1
  156. package/dist/components/status-bar-helpers.d.ts.map +0 -1
  157. package/dist/components/status-bar-types.d.ts.map +0 -1
  158. package/dist/components/status-bar.d.ts.map +0 -1
  159. package/dist/components/statusline-detail-panel.d.ts.map +0 -1
  160. package/dist/components/statusline-picker.d.ts.map +0 -1
  161. package/dist/components/suggestions.d.ts.map +0 -1
  162. package/dist/components/todos-monitor.d.ts.map +0 -1
  163. package/dist/components/tools-picker.d.ts.map +0 -1
  164. package/dist/components/worktree-monitor.d.ts.map +0 -1
  165. package/dist/components/worktree-panel.d.ts.map +0 -1
  166. package/dist/connections-health.d.ts.map +0 -1
  167. package/dist/connections-slash.d.ts.map +0 -1
  168. package/dist/context-fill.d.ts.map +0 -1
  169. package/dist/context-slash.d.ts.map +0 -1
  170. package/dist/cron-slash.d.ts.map +0 -1
  171. package/dist/esc-close-panels.d.ts.map +0 -1
  172. package/dist/exit-slash.d.ts.map +0 -1
  173. package/dist/f-key-panels.d.ts.map +0 -1
  174. package/dist/file-search.d.ts.map +0 -1
  175. package/dist/fn-keys.d.ts.map +0 -1
  176. package/dist/git-info.d.ts.map +0 -1
  177. package/dist/heap-watchdog.d.ts.map +0 -1
  178. package/dist/height-cache.d.ts.map +0 -1
  179. package/dist/highlight.d.ts.map +0 -1
  180. package/dist/history-archive.d.ts.map +0 -1
  181. package/dist/history-entry.d.ts.map +0 -1
  182. package/dist/history-retention.d.ts.map +0 -1
  183. package/dist/hit-test.d.ts.map +0 -1
  184. package/dist/hooks/fleet-chat-coalescer.d.ts.map +0 -1
  185. package/dist/hooks/subagent-history-format.d.ts.map +0 -1
  186. package/dist/hooks/use-app-picker-keys.d.ts.map +0 -1
  187. package/dist/hooks/use-app-runtime-refs.d.ts.map +0 -1
  188. package/dist/hooks/use-app-session-state.d.ts.map +0 -1
  189. package/dist/hooks/use-auth-panel.d.ts.map +0 -1
  190. package/dist/hooks/use-autonomous-coordinator.d.ts.map +0 -1
  191. package/dist/hooks/use-autonomy-drivers.d.ts.map +0 -1
  192. package/dist/hooks/use-brain-events.d.ts.map +0 -1
  193. package/dist/hooks/use-brain-panel.d.ts.map +0 -1
  194. package/dist/hooks/use-brain-risk-sync.d.ts.map +0 -1
  195. package/dist/hooks/use-chip-staleness-guard.d.ts.map +0 -1
  196. package/dist/hooks/use-client-telemetry.d.ts.map +0 -1
  197. package/dist/hooks/use-core-tui-commands.d.ts.map +0 -1
  198. package/dist/hooks/use-director-fleet-bridge.d.ts.map +0 -1
  199. package/dist/hooks/use-enhance-runtime-state.d.ts.map +0 -1
  200. package/dist/hooks/use-exit-command.d.ts.map +0 -1
  201. package/dist/hooks/use-file-search.d.ts.map +0 -1
  202. package/dist/hooks/use-fleet-generation-gate.d.ts.map +0 -1
  203. package/dist/hooks/use-git-session-status.d.ts.map +0 -1
  204. package/dist/hooks/use-help-panel.d.ts.map +0 -1
  205. package/dist/hooks/use-history-copy-notice.d.ts.map +0 -1
  206. package/dist/hooks/use-history-viewport-sync.d.ts.map +0 -1
  207. package/dist/hooks/use-initial-prompt.d.ts.map +0 -1
  208. package/dist/hooks/use-input-history-persistence.d.ts.map +0 -1
  209. package/dist/hooks/use-interrupt-ladder.d.ts.map +0 -1
  210. package/dist/hooks/use-kanban-board-focus.d.ts.map +0 -1
  211. package/dist/hooks/use-live-settings-state.d.ts.map +0 -1
  212. package/dist/hooks/use-live-todos.d.ts.map +0 -1
  213. package/dist/hooks/use-mailbox-view-model.d.ts.map +0 -1
  214. package/dist/hooks/use-mode-picker.d.ts.map +0 -1
  215. package/dist/hooks/use-model-pick.d.ts.map +0 -1
  216. package/dist/hooks/use-mouse-tracking.d.ts.map +0 -1
  217. package/dist/hooks/use-next-steps-auto-submit.d.ts.map +0 -1
  218. package/dist/hooks/use-panel-controllers.d.ts.map +0 -1
  219. package/dist/hooks/use-paste-handling.d.ts.map +0 -1
  220. package/dist/hooks/use-picker-keys-types.d.ts.map +0 -1
  221. package/dist/hooks/use-picker-keys.d.ts.map +0 -1
  222. package/dist/hooks/use-prompt-picker.d.ts.map +0 -1
  223. package/dist/hooks/use-provider-event-bridge.d.ts.map +0 -1
  224. package/dist/hooks/use-queue-manager.d.ts.map +0 -1
  225. package/dist/hooks/use-session-interrupt-controller.d.ts.map +0 -1
  226. package/dist/hooks/use-settings-auto-save.d.ts.map +0 -1
  227. package/dist/hooks/use-shadow-panel.d.ts.map +0 -1
  228. package/dist/hooks/use-slash-picker.d.ts.map +0 -1
  229. package/dist/hooks/use-stable-key-handler.d.ts.map +0 -1
  230. package/dist/hooks/use-statusbar-view-model.d.ts.map +0 -1
  231. package/dist/hooks/use-statusline-hidden-sync.d.ts.map +0 -1
  232. package/dist/hooks/use-statusline-state.d.ts.map +0 -1
  233. package/dist/hooks/use-stream-chip-expiration.d.ts.map +0 -1
  234. package/dist/hooks/use-subagent-events.d.ts.map +0 -1
  235. package/dist/hooks/use-terminal-render-lifecycle.d.ts.map +0 -1
  236. package/dist/hooks/use-todos-auto-clear.d.ts.map +0 -1
  237. package/dist/hooks/use-token-counter-refresh.d.ts.map +0 -1
  238. package/dist/hooks/use-tui-activity.d.ts.map +0 -1
  239. package/dist/hooks/use-tui-controllers.d.ts.map +0 -1
  240. package/dist/hooks/use-tui-environment-state.d.ts.map +0 -1
  241. package/dist/hooks/use-tui-event-bridge.d.ts.map +0 -1
  242. package/dist/hooks/use-tui-slash-commands.d.ts.map +0 -1
  243. package/dist/hooks/use-working-dir-chip.d.ts.map +0 -1
  244. package/dist/index.d.ts.map +0 -1
  245. package/dist/index.js.map +0 -7
  246. package/dist/ink.d.ts.map +0 -1
  247. package/dist/input-editing.d.ts.map +0 -1
  248. package/dist/input-key-router.d.ts.map +0 -1
  249. package/dist/input-tokens.d.ts.map +0 -1
  250. package/dist/input-validation/action-helpers.d.ts.map +0 -1
  251. package/dist/input-validation/action-types.d.ts.map +0 -1
  252. package/dist/input-validation/allow-lists.d.ts.map +0 -1
  253. package/dist/input-validation/limits.d.ts.map +0 -1
  254. package/dist/input-validation/result.d.ts.map +0 -1
  255. package/dist/input-validation/state-entries.d.ts.map +0 -1
  256. package/dist/input-validation/terminal.d.ts.map +0 -1
  257. package/dist/input-validation.d.ts.map +0 -1
  258. package/dist/kanban-audit.d.ts.map +0 -1
  259. package/dist/kanban-slash.d.ts.map +0 -1
  260. package/dist/kill-slash.d.ts.map +0 -1
  261. package/dist/layout-engine.d.ts.map +0 -1
  262. package/dist/layout-store.d.ts.map +0 -1
  263. package/dist/mailbox-view-model-types.d.ts.map +0 -1
  264. package/dist/markdown-table.d.ts.map +0 -1
  265. package/dist/markdown.d.ts.map +0 -1
  266. package/dist/memory-context-monitor.d.ts.map +0 -1
  267. package/dist/memory-lifecycle-entry.d.ts.map +0 -1
  268. package/dist/memory-slash-format.d.ts.map +0 -1
  269. package/dist/memory-slash.d.ts.map +0 -1
  270. package/dist/mouse.d.ts.map +0 -1
  271. package/dist/on-panel-open.d.ts.map +0 -1
  272. package/dist/overlay-key-router.d.ts.map +0 -1
  273. package/dist/paste-accumulator.d.ts.map +0 -1
  274. package/dist/prompt-refinement-start.d.ts.map +0 -1
  275. package/dist/ps-slash.d.ts.map +0 -1
  276. package/dist/queue-slash.d.ts.map +0 -1
  277. package/dist/reducers/activity.d.ts.map +0 -1
  278. package/dist/reducers/composer.d.ts.map +0 -1
  279. package/dist/reducers/conversation.d.ts.map +0 -1
  280. package/dist/reducers/dialogs.d.ts.map +0 -1
  281. package/dist/reducers/fleet.d.ts.map +0 -1
  282. package/dist/reducers/helpers.d.ts.map +0 -1
  283. package/dist/reducers/panel-pickers.d.ts.map +0 -1
  284. package/dist/reducers/settings-panel.d.ts.map +0 -1
  285. package/dist/reducers/settings-values.d.ts.map +0 -1
  286. package/dist/reducers/workspace-panels.d.ts.map +0 -1
  287. package/dist/rehydrate-history.d.ts.map +0 -1
  288. package/dist/run-blocks-controller.d.ts.map +0 -1
  289. package/dist/run-tui-client-registration.d.ts.map +0 -1
  290. package/dist/run-tui-options.d.ts.map +0 -1
  291. package/dist/run-tui-title-controller.d.ts.map +0 -1
  292. package/dist/run-tui.d.ts.map +0 -1
  293. package/dist/running-tools.d.ts.map +0 -1
  294. package/dist/scroll-anchor.d.ts.map +0 -1
  295. package/dist/sdd-lifecycle-entry.d.ts.map +0 -1
  296. package/dist/settings-contracts.d.ts.map +0 -1
  297. package/dist/shared-types.d.ts.map +0 -1
  298. package/dist/slash-command-search.d.ts.map +0 -1
  299. package/dist/steering-preamble.d.ts.map +0 -1
  300. package/dist/submit-controller.d.ts.map +0 -1
  301. package/dist/submit-history.d.ts.map +0 -1
  302. package/dist/submit-prompt-refinement.d.ts.map +0 -1
  303. package/dist/terminal-modes.d.ts.map +0 -1
  304. package/dist/terminal-silence.d.ts.map +0 -1
  305. package/dist/terminal-title.d.ts.map +0 -1
  306. package/dist/terminal-width.d.ts.map +0 -1
  307. package/dist/theme.d.ts.map +0 -1
  308. package/dist/thinking-word.d.ts.map +0 -1
  309. package/dist/token-previews.d.ts.map +0 -1
  310. package/dist/tool-glyph.d.ts.map +0 -1
  311. package/dist/tui-host-capabilities.d.ts.map +0 -1
  312. package/dist/tui-memory-counters.d.ts.map +0 -1
  313. package/dist/ui-contracts.d.ts.map +0 -1
  314. package/dist/ui-glyphs.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- import type { AutonomyStage, DesignKitEntry, FleetChatVerbosity, TokenSavingTier } from '@wrongstack/core/types';
1
+ import type { AutonomyStage, ContextSnapshot, DesignKitEntry, FleetChatVerbosity, TokenSavingTier } from '@wrongstack/core/types';
2
2
  import type { SddBoardSnapshot } from '@wrongstack/sdd';
3
3
  import type { State } from './app-state.js';
4
4
  import type { DraftEntry, GoalSummary, QueueItem, ResumeSessionEntry, SlashCommandMatch } from './app-state-core-types.js';
@@ -218,6 +218,15 @@ export type Action = {
218
218
  type: 'replaceHistory';
219
219
  entries: HistoryEntry[];
220
220
  nextId: number;
221
+ /**
222
+ * Optional context-window snapshot forwarded from the host's
223
+ * `onResumeSession` return. When present, the reducer writes
224
+ * `tokens` to `state.leader.ctxTokens` and bumps
225
+ * `state.contextChipVersion` so the statusline chip and `/context`
226
+ * panel reflect the rebuilt context immediately, instead of staying
227
+ * at zero until the next ctx.pct event.
228
+ */
229
+ contextSnapshot?: ContextSnapshot | undefined;
221
230
  } | {
222
231
  type: 'settingsOpen';
223
232
  mode: SettingsMode;
@@ -270,7 +279,7 @@ export type Action = {
270
279
  breakerEnabled: boolean;
271
280
  breakerAutoKillResetMs: number;
272
281
  showModelReasoning: boolean;
273
- showAgentSwarmPanel: boolean;
282
+ showAgentSwarmPanel: import('./app-settings-type.js').AgentSwarmPanelMode;
274
283
  readSymbols: boolean;
275
284
  showSageMemoryInject: boolean;
276
285
  sageMemoryInjectThreshold: number;
@@ -920,6 +929,20 @@ export type Action = {
920
929
  /** Close every open panel/monitor/overlay at once. */
921
930
  | {
922
931
  type: 'closeAllPanels';
932
+ }
933
+ /** Toggle keyboard focus between input and the right sidebar. */
934
+ | {
935
+ type: 'toggleSidebarFocus';
936
+ }
937
+ /** Scroll the sidebar content by delta rows (clamped to >=0). */
938
+ | {
939
+ type: 'sidebarScroll';
940
+ delta: number;
941
+ viewportHeight?: number | undefined;
942
+ }
943
+ /** Reset sidebar scroll offset to 0. */
944
+ | {
945
+ type: 'sidebarScrollReset';
923
946
  } | {
924
947
  type: 'toggleKanbanPanel';
925
948
  } | {
@@ -47,6 +47,10 @@ interface AppKeyHandlerOptions {
47
47
  termRows: number;
48
48
  terminalColumns: number;
49
49
  terminalRows: number;
50
+ /** Width of the main column (terminal width minus sidebar). When > 0,
51
+ * scrollbar hit-tests use this instead of terminalColumns so the scrollbar
52
+ * track is correctly positioned to the left of the sidebar. */
53
+ mainColumnWidth: number;
50
54
  statusBarWrapRef: MutableRefObject<DOMElement | null>;
51
55
  belowStatusBarRef: MutableRefObject<DOMElement | null>;
52
56
  liveStatuslineMode: string;
@@ -2,7 +2,7 @@ import type { Agent } from '@wrongstack/core/agent';
2
2
  import type { CoordinatorEvent, Director } from '@wrongstack/core/coordination';
3
3
  import type { SlashCommandRegistry } from '@wrongstack/core/registry';
4
4
  import type { QueueStore } from '@wrongstack/core/storage';
5
- import type { AttachmentStore, AutonomyStage, FleetChatVerbosity, Message, TokenCounter, TokenSavingTier } from '@wrongstack/core/types';
5
+ import type { AttachmentStore, AutonomyStage, ContextSnapshot, FleetChatVerbosity, Message, TokenCounter, TokenSavingTier } from '@wrongstack/core/types';
6
6
  import type { EventBus } from '@wrongstack/core/kernel';
7
7
  import type { VisionAdapters } from '@wrongstack/runtime/vision';
8
8
  import type { SddLifecycleResult, SddRunControl } from '@wrongstack/sdd';
@@ -410,6 +410,16 @@ export interface AppProps {
410
410
  entries: HistoryEntry[];
411
411
  nextId: number;
412
412
  sessionId: string;
413
+ /**
414
+ * Optional context-window snapshot computed from the resumed
415
+ * session's tokenCounter after accounting the persisted usage.
416
+ * When present, the reducer writes `tokens` to `state.leader.ctxTokens`,
417
+ * `maxContext` to `state.leader.ctxMaxTokens`, and bumps
418
+ * `state.contextChipVersion` so the chip refreshes immediately. When
419
+ * absent, the chip stays at its previous value until the next ctx.pct
420
+ * event lands.
421
+ */
422
+ contextSnapshot?: ContextSnapshot | undefined;
413
423
  } | null>) | undefined;
414
424
  /**
415
425
  * List recent session summaries for the /resume picker. The host reads
@@ -1,5 +1,19 @@
1
1
  import type { FleetChatVerbosity, TokenSavingTier } from '@wrongstack/core/types';
2
2
  import type { CacheTtl, ContextMode, ReasoningEffort, StatuslineMode } from './settings-contracts.js';
3
+ /** Where to render the agent swarm panel: lower region, sidebar, or hidden. */
4
+ export type AgentSwarmPanelMode = 'bottom' | 'sidebar' | 'off';
5
+ /**
6
+ * Coerce a persisted showAgentSwarmPanel value (which may be a legacy boolean
7
+ * or the new tri-state string) into a valid AgentSwarmPanelMode.
8
+ * - true / undefined → 'bottom' (default)
9
+ * - false → 'off'
10
+ * - Valid string ('bottom' | 'sidebar' | 'off') → returned as-is
11
+ * - Any other string → 'bottom' (safe fallback)
12
+ *
13
+ * This is the single canonical coercion — all read sites should call this
14
+ * rather than re-implementing the mapping to avoid divergent defaults.
15
+ */
16
+ export declare function coerceAgentSwarmMode(v: boolean | AgentSwarmPanelMode | string | undefined): AgentSwarmPanelMode;
3
17
  export type Settings = {
4
18
  mode: 'off' | 'suggest' | 'auto';
5
19
  delayMs: number;
@@ -45,7 +59,7 @@ export type Settings = {
45
59
  debugStream: boolean;
46
60
  /** Skip the confirmation prompt for the `!<command>` shell shortcut. */
47
61
  shellBangWarningDontShowAgain?: boolean | undefined;
48
- /** Statusline density mode. Defaults to detailed. */
62
+ /** Statusline density mode. Defaults to minimum (DEFAULT_STATUSLINE_MODE). */
49
63
  statuslineMode: StatuslineMode;
50
64
  /** Reasoning mode: auto (provider default) | on | off. */
51
65
  reasoningMode: 'auto' | 'on' | 'off';
@@ -56,8 +70,10 @@ export type Settings = {
56
70
  /** Single word shown in the TUI rainbow working-state chip. */
57
71
  thinkingWord: string;
58
72
  showModelReasoning: boolean;
59
- /** Show the persistent AGENT SWARM and todo mission queue panel. Default: true. */
60
- showAgentSwarmPanel: boolean;
73
+ /** Agent swarm panel placement: 'bottom' (lower region), 'sidebar' (right
74
+ * sidebar, vertical), or 'off' (hidden). Default: 'bottom'.
75
+ * Backward-compat: old boolean configs are coerced — true→'bottom', false→'off'. */
76
+ showAgentSwarmPanel: AgentSwarmPanelMode;
61
77
  /** Show SAGE Memory Inject blocks in tool results. Default: false (hidden). */
62
78
  showSageMemoryInject: boolean;
63
79
  /** Minimum relation strength for SAGE memory injection. Default: 0.85. */
@@ -273,8 +273,8 @@ export type State = {
273
273
  * (API-level provisioning). Default: true.
274
274
  */
275
275
  showModelReasoning: boolean;
276
- /** Show the persistent AGENT SWARM and todo mission queue panel. Default: true. */
277
- showAgentSwarmPanel: boolean;
276
+ /** Agent swarm panel placement: 'bottom' (lower region), 'sidebar' (right sidebar), or 'off'. Default: 'bottom'. */
277
+ showAgentSwarmPanel: import('./app-settings-type.js').AgentSwarmPanelMode;
278
278
  /** Show SAGE Memory Inject blocks in tool results. Default: false. */
279
279
  showSageMemoryInject: boolean;
280
280
  /** Minimum relation strength for SAGE memory injection. Default: 0.85. */
@@ -616,6 +616,10 @@ export type State = {
616
616
  connectionsPanelOpen: boolean;
617
617
  /** When true, the sessions panel is shown (F10). */
618
618
  sessionsPanelOpen: boolean;
619
+ /** When true, keyboard focus is on the right sidebar (↑↓ scrolls sidebar content). */
620
+ sidebarFocused: boolean;
621
+ /** Vertical scroll offset for the sidebar content (in rows). */
622
+ sidebarScrollOffset: number;
619
623
  /** Live session data for the sessions panel (F10). */
620
624
  sessionsPanel: {
621
625
  sessions: LiveSessionEntry[];
@@ -1,5 +1,10 @@
1
1
  import type React from 'react';
2
+ import type { AgentSwarmPanelMode } from './app-settings-type.js';
2
3
  import type { AppViewProps } from './app-view-contract.js';
3
- export declare function resolveAgentSwarmPanelVisibility(settingsOpen: boolean, pickerValue: boolean, persistedValue: boolean | undefined): boolean;
4
- export declare function AppStatusRegion({ host, runtime }: AppViewProps): React.ReactElement;
4
+ export declare function resolveAgentSwarmPanelVisibility(settingsOpen: boolean, pickerValue: AgentSwarmPanelMode, persistedValue: AgentSwarmPanelMode | undefined): AgentSwarmPanelMode;
5
+ export interface AppStatusRegionProps extends AppViewProps {
6
+ /** Optional column width cap for the status bar (when beside a sidebar). */
7
+ mainColumnWidth?: number | undefined;
8
+ }
9
+ export declare function AppStatusRegion({ host, runtime, mainColumnWidth }: AppStatusRegionProps): React.ReactElement;
5
10
  //# sourceMappingURL=app-status-region.d.ts.map
@@ -3,6 +3,10 @@ import { type AuthPanelState } from './auth-panel-model.js';
3
3
  export interface AuthPanelProps {
4
4
  panel: AuthPanelState;
5
5
  }
6
+ export declare function formatExpiry(expiresAt: string | undefined): {
7
+ text: string;
8
+ color: string;
9
+ } | null;
6
10
  export declare function isAuthFlowUrlLine(line: string): boolean;
7
11
  /** Keep the newest authorize URL pinned even as later status lines arrive. */
8
12
  export declare function latestAuthFlowUrl(lines: readonly string[]): string | undefined;
@@ -23,5 +23,19 @@ export declare function confirmButtonSegments(suggestedPattern: string): Array<{
23
23
  start: number;
24
24
  len: number;
25
25
  }>;
26
+ /**
27
+ * Unified-diff text for the payload a mutating tool is about to write.
28
+ *
29
+ * `stringifyInput` strips `content`/`new_string` to keep the summary line
30
+ * readable, and the branch meant to compensate keyed on `input.diff`. But
31
+ * `diff` lives on EditOutput, never on EditInput/WriteInput, and no layer
32
+ * enriches the input before the dialog receives it — so the branch was dead
33
+ * and this dialog asked the user to approve an edit, or an arbitrary
34
+ * whole-file overwrite, having shown them only a path (WS-080).
35
+ *
36
+ * Synthesised here from the fields the tool was actually given, so it renders
37
+ * through the same DiffBlock the committed history entries use.
38
+ */
39
+ export declare function payloadDiff(input: unknown): string;
26
40
  export declare function ConfirmPrompt({ toolName, input, suggestedPattern, onDecision, onEnableYolo, destructive, boundaryReason, }: ConfirmPromptProps): React.ReactElement;
27
41
  //# sourceMappingURL=confirm-prompt.d.ts.map
@@ -21,6 +21,8 @@ export interface FleetPanelProps {
21
21
  planCount: number;
22
22
  evalCount: number;
23
23
  } | null;
24
+ /** Optional column width cap (when rendered beside a sidebar). */
25
+ maxWidth?: number | undefined;
24
26
  }
25
27
  type SwarmColor = 'blue' | 'cyan' | 'green' | 'gray' | 'red' | 'yellow';
26
28
  export interface SwarmCell {
@@ -69,6 +71,6 @@ export declare function buildTodoPreviewRows(todos: readonly TodoItem[] | undefi
69
71
  * monitor owns transcripts and drill-down; this panel stays compact and makes
70
72
  * the fleet's current shape readable at a glance.
71
73
  */
72
- export declare function FleetPanel({ entries, totalCost, roster, todos, nowTick, collabSession, }: FleetPanelProps): React.ReactElement | null;
74
+ export declare function FleetPanel({ entries, totalCost, roster, todos, nowTick, collabSession, maxWidth, }: FleetPanelProps): React.ReactElement | null;
73
75
  export {};
74
76
  //# sourceMappingURL=fleet-panel.d.ts.map
@@ -0,0 +1,61 @@
1
+ import type { HistoryEntry } from './index.js';
2
+ /**
3
+ * A clickable copy-icon target resolved in viewport coordinates during the
4
+ * post-render measurement pass. `entryId` identifies a single card or the first
5
+ * member of a compact tool group; `entryIds` contains every group member when
6
+ * present. `startRow`/`endRow` bound the box's visible rows (0-based from the
7
+ * viewport top, `endRow` exclusive); `iconCol` is the 0-based terminal column
8
+ * the icon renders at on the box's first visible row.
9
+ */
10
+ export interface CopyHit {
11
+ entryId: number;
12
+ entryIds?: readonly number[] | undefined;
13
+ startRow: number;
14
+ endRow: number;
15
+ iconCol: number;
16
+ }
17
+ /** Sentinel returned after copying the active, non-retained tool-stream box. */
18
+ export declare const LIVE_TOOL_STREAM_COPY_ID = -1;
19
+ /** Sentinel returned after copying a drag-select-then-right-click selection.
20
+ * Distinct from any retained entry id so the host can render a different
21
+ * status-line notice ("Selected range copied") without flashing a specific
22
+ * card's copy icon (which only makes sense when a single entry was copied). */
23
+ export declare const SELECTION_COPY_ID = -2;
24
+ /**
25
+ * Resolve the copy target under a viewport cell, or null. A cell matches when
26
+ * its `row` is within the card's visible rows and its `col` is within the
27
+ * icon's cell span. Iterates newest-first so overlapping row estimates favor
28
+ * the most recently rendered card. Exported-shape pure helper for unit tests.
29
+ */
30
+ export declare function findCopyHit(hits: readonly CopyHit[], row: number, col: number): CopyHit | null;
31
+ /** Resolve a hit to the complete current clipboard payload without performing I/O. */
32
+ export declare function resolveCopyPayload(hit: CopyHit, entriesById: ReadonlyMap<number, HistoryEntry>, liveToolText?: string | undefined): {
33
+ entryId: number;
34
+ text: string;
35
+ } | null;
36
+ /**
37
+ * Rows clipped from the top of the mounted history stack before it appears in
38
+ * the viewport. Scrolled frames clip by the anchor's row offset; pinned frames
39
+ * rely on Ink flex-end clipping, which hides top overflow from mounted groups
40
+ * plus the live tool tail.
41
+ */
42
+ export declare function copyRegistryVisibleClip(opts: {
43
+ scrolled: boolean;
44
+ clip: number;
45
+ mountedRows: number;
46
+ tailRows: number;
47
+ viewportRows: number;
48
+ }): number;
49
+ /** Build the live tool-stream header hit, accounting for ToolStreamBox's top margin.
50
+ * The `pinnedSlack` offset must match {@link buildCopyRegistry}'s card-hit math so
51
+ * the live-stream icon stays visually aligned with its header row in underfilled
52
+ * pinned frames (flex-end parks the mounted stack at the bottom of the viewport). */
53
+ export declare function liveToolStreamCopyHit(opts: {
54
+ visible: boolean;
55
+ mountedRows: number;
56
+ visibleClip: number;
57
+ viewportRows: number;
58
+ iconCol: number;
59
+ pinnedSlack?: number;
60
+ }): CopyHit | null;
61
+ //# sourceMappingURL=copy-geometry.d.ts.map
@@ -20,12 +20,13 @@ export interface ParsedSageMemoryLine {
20
20
  tags?: string[] | undefined;
21
21
  }
22
22
  /**
23
- * Strict counterpart to `SAGE_MEMORY_LINE`. The gate above only decides "does
24
- * this line belong to a SAGE block?" and stays permissive (greedy body, opaque
25
- * `(?: .*)?` trailer) so block extraction survives future format additions.
26
- * This one captures named groups and therefore requires the exact `(anchor)` /
27
- * `[meta]` shapes the producer emits today; a line that passes the gate but
28
- * fails here falls back to a literal render row, so the memory is still shown.
23
+ * Strict counterpart to the canonical gate regex (kept private in
24
+ * `sage-output-block.ts`). The gate only decides "does this line belong to a
25
+ * SAGE block?" and stays permissive (greedy body, opaque `(?: .*)?` trailer)
26
+ * so block extraction survives future format additions. This one captures
27
+ * named groups and therefore requires the exact `(anchor)` / `[meta]` shapes
28
+ * the producer emits today; a line that passes the gate but fails here falls
29
+ * back to a literal render row, so the memory is still shown.
29
30
  */
30
31
  export declare const SAGE_MEMORY_DETAIL: RegExp;
31
32
  export declare function parseSageMemoryLine(line: string): ParsedSageMemoryLine | null;
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Public types for the scrollable history viewport.
3
+ *
4
+ * Extracted from scrollable-history.tsx so the imperative controller
5
+ * contract, props, and shared geometry types can be imported without
6
+ * pulling in the full component.
7
+ */
8
+ import type { MutableRefObject } from 'react';
9
+ import type { HistoryProps } from './index.js';
10
+ /**
11
+ * Imperative scroll surface owned by the ScrollableHistory component. The app
12
+ * key/mouse handlers call these instead of dispatching reducer actions: all
13
+ * scroll math needs the live height cache, which lives here, and routing it
14
+ * through app state previously forced totals and offsets to travel through
15
+ * separate commits — the root cause of an entire family of jump bugs.
16
+ */
17
+ export interface HistoryScrollController {
18
+ /** Scroll by `deltaUp` rows: positive = older content, negative = newer. */
19
+ scrollBy(deltaUp: number): void;
20
+ /** Scroll by one viewport page. */
21
+ scrollPage(dir: 'up' | 'down'): void;
22
+ /** Jump to the oldest retained entry. */
23
+ scrollToTop(): void;
24
+ /** Re-pin to the newest output. */
25
+ scrollToBottom(): void;
26
+ /** Jump to a 0-based cell clicked/dragged on the scrollbar track. */
27
+ scrollToTrackCell(cell: number): void;
28
+ /** True while the viewport is scrolled away from the newest output. */
29
+ isScrolled(): boolean;
30
+ /**
31
+ * True when the viewport cell lands on a copyable card's copy icon. Lets the
32
+ * mouse handler decide synchronously whether to consume the click before
33
+ * firing the async copy. See {@link copyAtViewportCell} for the `row`/`col`
34
+ * coordinate contract.
35
+ */
36
+ hasCopyTargetAt(row: number, col: number): boolean;
37
+ /**
38
+ * Handle a left-click inside the history viewport. `row` is 0-based from the
39
+ * viewport top; `col` is 0-based from the LEFT EDGE OF THE HISTORY BAND, not
40
+ * the raw terminal column. In the interactive mount the band renders flush at
41
+ * terminal column 0 (the scrollbar occupies the rightmost columns), so the
42
+ * caller passes the terminal column directly; a band that is inset from the
43
+ * left must subtract its left offset first. When the cell lands on a copyable
44
+ * card's copy icon, its content is written to the system clipboard and the
45
+ * entry id is returned; otherwise returns null.
46
+ */
47
+ copyAtViewportCell(row: number, col: number): Promise<number | null>;
48
+ /**
49
+ * Begin a drag-to-select gesture at `row`,`col` (history-band viewport cell).
50
+ * The cell must be inside a card's row range and inside the rendered band
51
+ * (`0 <= col < termWidth`); the mouse handler has already excluded the rail.
52
+ * Calls that don't satisfy that contract are silently ignored. Existing
53
+ * scrollbar/copy-icon/wheel paths remain intact because they call their own
54
+ * handlers; this only kicks in when the mouse layer explicitly routes a
55
+ * left-press into the card band.
56
+ */
57
+ beginSelection(row: number, col: number): void;
58
+ /**
59
+ * Extend an active selection to `row`,`col`. If no selection is in progress,
60
+ * the call is a no-op. Crossing into the gutter or below the viewport cancels
61
+ * the drag internally — leaving stale viewport-relative coords around after
62
+ * a mid-drag escape would let the next right-click paste from the wrong
63
+ * card, which is the worse failure mode than the selection disappearing.
64
+ */
65
+ extendSelection(row: number, col: number): void;
66
+ /**
67
+ * End an active drag (left-release). Does NOT write to the clipboard — the
68
+ * copy is performed by {@link commitSelection}, which is triggered by a
69
+ * separate right-click in the history band (per the drag-select-then-commit
70
+ * contract). If no selection is in progress, the call is a no-op.
71
+ */
72
+ endSelection(): void;
73
+ /** Drop any in-progress or committed selection without copying. */
74
+ clearSelection(): void;
75
+ /**
76
+ * Commit the active selection to the system clipboard. Returns true if a
77
+ * non-empty selection was resolved and the write succeeded. Returns false
78
+ * silently when there is no selection, the selection is empty (e.g. the drag
79
+ * never moved), or the write fails — the caller can show a transient notice
80
+ * on the truthy branch and stay silent on the falsy branch.
81
+ */
82
+ commitSelection(): Promise<boolean>;
83
+ }
84
+ export interface ScrollableHistoryProps extends HistoryProps {
85
+ /** Height of the viewport in rows, computed by App from the bottom region. */
86
+ viewportRows: number;
87
+ /** Receives the imperative scroll controller. The component assigns on
88
+ * mount and clears on unmount. Optional for isolated renderers. */
89
+ controllerRef?: MutableRefObject<HistoryScrollController | null> | undefined;
90
+ /** Reports scroll-state transitions (scrolled away from / re-pinned to the
91
+ * newest output) so the host can adjust key hints. */
92
+ onScrollInfo?: ((info: {
93
+ scrolled: boolean;
94
+ }) => void) | undefined;
95
+ /** Optional cap on the width used for entry wrapping (right panel mode). */
96
+ maxWidth?: number | undefined;
97
+ /** Layout store for persisting entry height data across renders and sessions.
98
+ * When provided, the ScrollableHistory seeds its height cache from the
99
+ * store's persisted measurements and marks entries as measured after render,
100
+ * eliminating estimate-vs-actual scroll jumps on re-render. */
101
+ layoutStore?: import('../../layout-store.js').LayoutStore | undefined;
102
+ /**
103
+ * Entry id of the card whose copy icon was just clicked. That card's icon
104
+ * renders in the success color for the brief window the host keeps this set,
105
+ * giving per-card visual feedback alongside the status-line "Copied" notice.
106
+ * `null` / undefined = no card highlighted.
107
+ */
108
+ copiedEntryId?: number | null | undefined;
109
+ /**
110
+ * Called when the user scrolls near the top of the currently loaded
111
+ * entries. The host should respond by loading older entries from the
112
+ * history archive and dispatching `archiveLoaded` to prepend them.
113
+ */
114
+ onRequestOlderEntries?: (() => void) | undefined;
115
+ }
116
+ //# sourceMappingURL=scroll-controller-types.d.ts.map
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Scrollbar math and card-span geometry — pure functions for thumb position,
3
+ * track-cell-to-offset mapping, and mounted card viewport spans.
4
+ *
5
+ * Extracted from scrollable-history.tsx.
6
+ */
7
+ import type { EntryHeightCache } from '../../height-cache.js';
8
+ import { type RenderGroup } from './tool-group.js';
9
+ /** Pure thumb geometry for the scrollbar: where the thumb starts and how many
10
+ * cells it spans, given the track height, scroll offset, and total content
11
+ * height. Exported for testing. */
12
+ export declare function scrollbarThumb(rows: number, offset: number, total: number): {
13
+ top: number;
14
+ size: number;
15
+ scrollable: boolean;
16
+ };
17
+ /** Inverse of {@link scrollbarThumb}: given a clicked/dragged 0-based cell on a
18
+ * track of `rows` height, return the scroll offset (rows up from the bottom)
19
+ * that lands the visible window there. Cell 0 (top) → oldest content (max
20
+ * offset); cell rows-1 (bottom) → newest (offset 0). Exported for testing. */
21
+ export declare function scrollOffsetForTrackRow(rows: number, total: number, cell: number): number;
22
+ /**
23
+ * Per-card viewport span for the currently-mounted groups. Mirrors
24
+ * {@link buildCopyRegistry}'s visibleClip math so the drag-select gesture asks
25
+ * the same geometry question the copy-hit registry already answers.
26
+ */
27
+ export interface MountedCardSpan {
28
+ entryId: number;
29
+ /** 0-based viewport row of the first VISIBLE row of the card. */
30
+ viewportStartRow: number;
31
+ /** 0-based viewport row one past the last VISIBLE row of the card. */
32
+ viewportEndRow: number;
33
+ /** Card's geometry in rows; visibleClip + scrolled-clip aware. */
34
+ totalRows: number;
35
+ entryIds?: readonly number[];
36
+ }
37
+ /**
38
+ * Build per-card viewport spans for every mounted render group. Pure — given
39
+ * the same render-group list, height cache, scroll state, and viewport size,
40
+ * the result is deterministic and matches the copy-hit registry. Exported so
41
+ * tests can verify the span map without mounting the full component.
42
+ */
43
+ export declare function buildMountedCardSpans(opts: {
44
+ renderGroups: readonly RenderGroup[];
45
+ heightCache: EntryHeightCache;
46
+ scrolled: boolean;
47
+ clip: number;
48
+ tailRows: number;
49
+ viewportRows: number;
50
+ showModelReasoning?: boolean | undefined;
51
+ }): MountedCardSpan[];
52
+ /**
53
+ * Find the card whose viewport row range contains `row`. Pure.
54
+ * Returns null when the row is in a blank gap or outside the viewport.
55
+ */
56
+ export declare function selectionHitAt(row: number, spans: readonly MountedCardSpan[]): {
57
+ entryId: number;
58
+ entryIds?: readonly number[];
59
+ } | null;
60
+ //# sourceMappingURL=scrollbar-geometry.d.ts.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Right-edge rail for the managed viewport. Its first column is the copy icon
3
+ * (or blank), the second is a visual gap, and the third is the scrollbar track.
4
+ * All three columns are always reserved, so copy affordances and scrollability
5
+ * never reflow chat content.
6
+ *
7
+ * Extracted from scrollable-history.tsx.
8
+ */
9
+ import type React from 'react';
10
+ import type { CopyHit } from './copy-geometry.js';
11
+ export declare function Scrollbar({ rows, offset, total, copyHits, copiedEntryId, }: {
12
+ rows: number;
13
+ offset: number;
14
+ total: number;
15
+ copyHits: readonly CopyHit[];
16
+ copiedEntryId?: number | null | undefined;
17
+ }): React.ReactElement;
18
+ //# sourceMappingURL=scrollbar-rail.d.ts.map
@@ -0,0 +1,111 @@
1
+ import type { HistoryEntry } from './index.js';
2
+ /**
3
+ * Selection rectangle in viewport cell coordinates, normalized so
4
+ * `topLeft.row <= bottomRight.row` and the column pairs are likewise ordered.
5
+ * Both endpoints are inclusive — the cell at `bottomRight` is selected.
6
+ */
7
+ export interface SelectionRect {
8
+ topLeft: {
9
+ row: number;
10
+ col: number;
11
+ };
12
+ bottomRight: {
13
+ row: number;
14
+ col: number;
15
+ };
16
+ /** True while the user is still dragging; false after left-release but
17
+ * before either clearSelection or commitSelection runs. */
18
+ inProgress: boolean;
19
+ }
20
+ /** Canonicalize two viewport cells into a SelectionRect. Pure. */
21
+ export declare function normalizeSelection(a: {
22
+ row: number;
23
+ col: number;
24
+ }, b: {
25
+ row: number;
26
+ col: number;
27
+ }, inProgress: boolean): SelectionRect;
28
+ /** True when the column lies outside the rendered card band. Inside the band
29
+ * the layout reserves `SCROLLBAR_HIT_WIDTH` columns for the rail AFTER the
30
+ * band, so `0..termWidth-1` is always in-band and nothing inside needs to be
31
+ * excluded. The mouse handler must already have excluded the rail before
32
+ * calling into the controller — we only check the band bounds here. */
33
+ export declare function isOutOfBand(col: number, termWidth: number): boolean;
34
+ /**
35
+ * One entry's contribution to a drag-selected range. Returned in document
36
+ * (row-index-in-card) coordinates so the caller decides how to slice into
37
+ * the entry's source text. `start` is the column inside the card (0-based
38
+ * from the left edge of the card's visible rectangle, NOT the terminal
39
+ * column — the gutter is excluded by the caller before reaching here).
40
+ * `end` is inclusive. When `startRow === endRow`, the slice is one row; the
41
+ * caller is responsible for translating text columns into source offsets.
42
+ */
43
+ export interface SelectionSlice {
44
+ entryId: number;
45
+ /** Inclusive row-in-card for the start of the slice. */
46
+ startRow: number;
47
+ /** Inclusive column, 0-based, inside the card's text area (gutter excluded). */
48
+ startCol: number;
49
+ /** Inclusive end row. */
50
+ endRow: number;
51
+ /** Inclusive end column, 0-based. */
52
+ endCol: number;
53
+ }
54
+ /**
55
+ * Translate a viewport-cell selection into per-entry row/col slices, walking
56
+ * the same mounted-group geometry the copy-hit registry uses so the two
57
+ * systems share one row index. Entries wholly outside the selection return
58
+ * nothing. Entries whose vertical span is wholly inside the selection are
59
+ * returned as a single row-range; entries the selection clips at the top or
60
+ * bottom are returned with row bounds matching the clip.
61
+ *
62
+ * `cardVisibleCols` is the number of columns inside the card the user can
63
+ * see — the band width minus the right gutter (`viewportWidth - SCROLLBAR_HIT_WIDTH`).
64
+ * Slices never include the gutter or any column to its right; the caller has
65
+ * already validated that.
66
+ *
67
+ * Returned slices are in document (entry-local) coordinates: `startRow`/`endRow`
68
+ * are rows inside the entry's own geometry, NOT viewport cells. This is what
69
+ * the assembler needs to recover text — slicing into the raw entry text uses
70
+ * per-row layout, which the caller resolves via the layout store.
71
+ */
72
+ export declare function selectionToSlices(opts: {
73
+ selection: SelectionRect;
74
+ cards: ReadonlyArray<{
75
+ entryId: number;
76
+ /** 0-based viewport row of the card's first visible row. */
77
+ viewportStartRow: number;
78
+ /** 0-based viewport row just past the card's last visible row. */
79
+ viewportEndRow: number;
80
+ }>;
81
+ cardVisibleCols: number;
82
+ }): SelectionSlice[];
83
+ /**
84
+ * Build the clipboard payload for a selection by slicing into each affected
85
+ * entry's full renderable text. The v1 contract is line-then-column on the
86
+ * entry's source text: each slice exposes `startRow`/`endRow` and
87
+ * `startCol`/`endCol` in card-local coordinates; we split the entry's
88
+ * text on `\n`, keep only the rows inside the row range, and within those
89
+ * rows apply the column range. The matrix matches what the source line
90
+ * index would be when no wrapping occurs — i.e. one card row maps to one
91
+ * source line. Wrap-geometry translation is intentionally absent in v1
92
+ * because the layout store does not yet expose per-card-row wrap segments;
93
+ * it returns when those segments exist and a v1.1 test demands it.
94
+ *
95
+ * `toolGroupsByHeadId` lets a multi-member tool-group expand: when the
96
+ * head id appears with `entryIds.length > 1`, the assembler copies via
97
+ * `copyableTextForEntries` (raw ordered JSON of every member, matching
98
+ * the existing copy-icon contract). A single-entry head falls through
99
+ * to `copyableTextForEntry`.
100
+ *
101
+ * Multi-entry selections are joined with `\n---\n` so the user can see
102
+ * where one card ends and the next begins. Empty selections and
103
+ * selections that resolve to no text return `""` so the caller can fall
104
+ * through silently.
105
+ */
106
+ export declare function assembleSelectionText(opts: {
107
+ slices: readonly SelectionSlice[];
108
+ entriesById: ReadonlyMap<number, HistoryEntry>;
109
+ toolGroupsByHeadId?: ReadonlyMap<number, readonly number[]> | undefined;
110
+ }): string;
111
+ //# sourceMappingURL=selection-helpers.d.ts.map
@@ -42,6 +42,13 @@ export interface InputProps {
42
42
  /** Row count for the hidden placeholder so the bottom region never resizes. */
43
43
  placeholderHeight?: number | undefined;
44
44
  onKey: (input: string, key: KeyEvent) => void;
45
+ /**
46
+ * Optional cap on the column width used for wrapping and frame sizing.
47
+ * When set, the input area treats this as its effective terminal width
48
+ * instead of `stdout.columns` — needed when the input sits in a column
49
+ * narrower than the full terminal (e.g. beside a sidebar).
50
+ */
51
+ maxWidth?: number | undefined;
45
52
  }
46
53
  export interface KeyEvent {
47
54
  upArrow: boolean;
@@ -76,5 +83,5 @@ export interface KeyEvent {
76
83
  fn?: number | undefined;
77
84
  }
78
85
  export declare const EMPTY_KEY: KeyEvent;
79
- export declare const Input: React.MemoExoticComponent<({ prompt, value, cursor, disabled, hint, title, status, animationStyle, workingTime, footerHint, hidden, placeholderHeight, onKey, }: InputProps) => React.ReactElement>;
86
+ export declare const Input: React.MemoExoticComponent<({ prompt, value, cursor, disabled, hint, title, status, animationStyle, workingTime, footerHint, hidden, placeholderHeight, onKey, maxWidth, }: InputProps) => React.ReactElement>;
80
87
  //# sourceMappingURL=input.d.ts.map