@wrongstack/tui 0.292.1 → 0.295.0

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 (277) hide show
  1. package/README.md +1 -0
  2. package/dist/app-initial-state.d.ts +1 -1
  3. package/dist/app-initial-state.d.ts.map +1 -1
  4. package/dist/app-key-handler.d.ts +79 -0
  5. package/dist/app-key-handler.d.ts.map +1 -0
  6. package/dist/app-props.d.ts +25 -27
  7. package/dist/app-props.d.ts.map +1 -1
  8. package/dist/app-reducer.d.ts.map +1 -1
  9. package/dist/app-state.d.ts +31 -62
  10. package/dist/app-state.d.ts.map +1 -1
  11. package/dist/app-status-region.d.ts +5 -0
  12. package/dist/app-status-region.d.ts.map +1 -0
  13. package/dist/app-view-contract.d.ts +84 -0
  14. package/dist/app-view-contract.d.ts.map +1 -0
  15. package/dist/app-view-state.d.ts +19 -0
  16. package/dist/app-view-state.d.ts.map +1 -0
  17. package/dist/app-view.d.ts +4 -0
  18. package/dist/app-view.d.ts.map +1 -0
  19. package/dist/app.d.ts +3 -3
  20. package/dist/app.d.ts.map +1 -1
  21. package/dist/auth-panel-model.d.ts +150 -0
  22. package/dist/auth-panel-model.d.ts.map +1 -0
  23. package/dist/brain-contracts.d.ts +8 -0
  24. package/dist/brain-contracts.d.ts.map +1 -0
  25. package/dist/brain-panel-model.d.ts +222 -0
  26. package/dist/brain-panel-model.d.ts.map +1 -0
  27. package/dist/checkpoint-retention.d.ts +35 -0
  28. package/dist/checkpoint-retention.d.ts.map +1 -0
  29. package/dist/components/agents-monitor.d.ts +3 -4
  30. package/dist/components/agents-monitor.d.ts.map +1 -1
  31. package/dist/components/animation-style.d.ts +22 -23
  32. package/dist/components/animation-style.d.ts.map +1 -1
  33. package/dist/components/audit-panel.d.ts +1 -1
  34. package/dist/components/audit-panel.d.ts.map +1 -1
  35. package/dist/components/auth-panel-model.d.ts +1 -149
  36. package/dist/components/auth-panel-model.d.ts.map +1 -1
  37. package/dist/components/brain-panel-model.d.ts +1 -106
  38. package/dist/components/brain-panel-model.d.ts.map +1 -1
  39. package/dist/components/brain-panel.d.ts +2 -7
  40. package/dist/components/brain-panel.d.ts.map +1 -1
  41. package/dist/components/composer-status-chip.d.ts +16 -3
  42. package/dist/components/composer-status-chip.d.ts.map +1 -1
  43. package/dist/components/context-panel.d.ts +1 -1
  44. package/dist/components/context-panel.d.ts.map +1 -1
  45. package/dist/components/coordinator-panel.d.ts +1 -1
  46. package/dist/components/coordinator-panel.d.ts.map +1 -1
  47. package/dist/components/design-picker.d.ts +1 -1
  48. package/dist/components/design-picker.d.ts.map +1 -1
  49. package/dist/components/exit-confirm-panel.d.ts +2 -1
  50. package/dist/components/exit-confirm-panel.d.ts.map +1 -1
  51. package/dist/components/fleet-monitor.d.ts +1 -1
  52. package/dist/components/fleet-monitor.d.ts.map +1 -1
  53. package/dist/components/fleet-panel.d.ts +2 -2
  54. package/dist/components/fleet-panel.d.ts.map +1 -1
  55. package/dist/components/history/banner.d.ts +4 -1
  56. package/dist/components/history/banner.d.ts.map +1 -1
  57. package/dist/components/history/code-block.d.ts +27 -19
  58. package/dist/components/history/code-block.d.ts.map +1 -1
  59. package/dist/components/history/entry.d.ts +4 -2
  60. package/dist/components/history/entry.d.ts.map +1 -1
  61. package/dist/components/history/index.d.ts +4 -4
  62. package/dist/components/history/index.d.ts.map +1 -1
  63. package/dist/components/history/replay.d.ts +1 -1
  64. package/dist/components/history/replay.d.ts.map +1 -1
  65. package/dist/components/history/tool-card.d.ts +2 -2
  66. package/dist/components/history/tool-card.d.ts.map +1 -1
  67. package/dist/components/history/tool-group.d.ts +73 -0
  68. package/dist/components/history/tool-group.d.ts.map +1 -0
  69. package/dist/components/history/types.d.ts +3 -156
  70. package/dist/components/history/types.d.ts.map +1 -1
  71. package/dist/components/history/utils.d.ts +2 -0
  72. package/dist/components/history/utils.d.ts.map +1 -1
  73. package/dist/components/history.d.ts +1 -1
  74. package/dist/components/history.d.ts.map +1 -1
  75. package/dist/components/input.d.ts.map +1 -1
  76. package/dist/components/kanban-panel.d.ts +1 -1
  77. package/dist/components/kanban-panel.d.ts.map +1 -1
  78. package/dist/components/mailbox-panel.d.ts +1 -0
  79. package/dist/components/mailbox-panel.d.ts.map +1 -1
  80. package/dist/components/mode-picker.d.ts +1 -1
  81. package/dist/components/mode-picker.d.ts.map +1 -1
  82. package/dist/components/process-list.d.ts.map +1 -1
  83. package/dist/components/resume-picker.d.ts +1 -1
  84. package/dist/components/resume-picker.d.ts.map +1 -1
  85. package/dist/components/scrollable-history.d.ts +61 -33
  86. package/dist/components/scrollable-history.d.ts.map +1 -1
  87. package/dist/components/settings-picker.d.ts +9 -2
  88. package/dist/components/settings-picker.d.ts.map +1 -1
  89. package/dist/components/status-bar-chips.d.ts +4 -1
  90. package/dist/components/status-bar-chips.d.ts.map +1 -1
  91. package/dist/components/status-bar.d.ts +22 -4
  92. package/dist/components/status-bar.d.ts.map +1 -1
  93. package/dist/components/statusline-picker.d.ts +1 -1
  94. package/dist/components/statusline-picker.d.ts.map +1 -1
  95. package/dist/components/todos-monitor.d.ts +1 -1
  96. package/dist/components/todos-monitor.d.ts.map +1 -1
  97. package/dist/context-fill.d.ts +61 -0
  98. package/dist/context-fill.d.ts.map +1 -0
  99. package/dist/context-slash.d.ts +1 -1
  100. package/dist/context-slash.d.ts.map +1 -1
  101. package/dist/cron-slash.d.ts +2 -1
  102. package/dist/cron-slash.d.ts.map +1 -1
  103. package/dist/exit-slash.d.ts +4 -1
  104. package/dist/exit-slash.d.ts.map +1 -1
  105. package/dist/heap-watchdog.d.ts +6 -2
  106. package/dist/heap-watchdog.d.ts.map +1 -1
  107. package/dist/height-cache.d.ts +58 -10
  108. package/dist/height-cache.d.ts.map +1 -1
  109. package/dist/history-entry.d.ts +175 -0
  110. package/dist/history-entry.d.ts.map +1 -0
  111. package/dist/history-retention.d.ts +15 -3
  112. package/dist/history-retention.d.ts.map +1 -1
  113. package/dist/hit-test.d.ts +4 -0
  114. package/dist/hit-test.d.ts.map +1 -1
  115. package/dist/hooks/subagent-history-format.d.ts +45 -0
  116. package/dist/hooks/subagent-history-format.d.ts.map +1 -0
  117. package/dist/hooks/use-app-picker-keys.d.ts +36 -0
  118. package/dist/hooks/use-app-picker-keys.d.ts.map +1 -0
  119. package/dist/hooks/use-auth-panel.d.ts +1 -1
  120. package/dist/hooks/use-auth-panel.d.ts.map +1 -1
  121. package/dist/hooks/use-autonomous-coordinator.d.ts +1 -1
  122. package/dist/hooks/use-autonomous-coordinator.d.ts.map +1 -1
  123. package/dist/hooks/use-autonomy-drivers.d.ts +25 -0
  124. package/dist/hooks/use-autonomy-drivers.d.ts.map +1 -0
  125. package/dist/hooks/use-brain-events.d.ts +1 -1
  126. package/dist/hooks/use-brain-events.d.ts.map +1 -1
  127. package/dist/hooks/use-brain-panel.d.ts +2 -2
  128. package/dist/hooks/use-brain-panel.d.ts.map +1 -1
  129. package/dist/hooks/use-chip-staleness-guard.d.ts +83 -0
  130. package/dist/hooks/use-chip-staleness-guard.d.ts.map +1 -0
  131. package/dist/hooks/use-client-telemetry.d.ts +17 -0
  132. package/dist/hooks/use-client-telemetry.d.ts.map +1 -0
  133. package/dist/hooks/use-core-tui-commands.d.ts +39 -0
  134. package/dist/hooks/use-core-tui-commands.d.ts.map +1 -0
  135. package/dist/hooks/use-director-fleet-bridge.d.ts +5 -1
  136. package/dist/hooks/use-director-fleet-bridge.d.ts.map +1 -1
  137. package/dist/hooks/use-exit-command.d.ts +2 -1
  138. package/dist/hooks/use-exit-command.d.ts.map +1 -1
  139. package/dist/hooks/use-file-search.d.ts +3 -2
  140. package/dist/hooks/use-file-search.d.ts.map +1 -1
  141. package/dist/hooks/use-fleet-generation-gate.d.ts +2 -0
  142. package/dist/hooks/use-fleet-generation-gate.d.ts.map +1 -1
  143. package/dist/hooks/use-git-session-status.d.ts +11 -0
  144. package/dist/hooks/use-git-session-status.d.ts.map +1 -0
  145. package/dist/hooks/use-initial-prompt.d.ts +15 -0
  146. package/dist/hooks/use-initial-prompt.d.ts.map +1 -0
  147. package/dist/hooks/use-input-history-persistence.d.ts.map +1 -1
  148. package/dist/hooks/use-interrupt-ladder.d.ts +29 -0
  149. package/dist/hooks/use-interrupt-ladder.d.ts.map +1 -0
  150. package/dist/hooks/use-live-todos.d.ts +1 -1
  151. package/dist/hooks/use-live-todos.d.ts.map +1 -1
  152. package/dist/hooks/use-mailbox-view-model.d.ts +13 -0
  153. package/dist/hooks/use-mailbox-view-model.d.ts.map +1 -0
  154. package/dist/hooks/use-mode-picker.d.ts +1 -1
  155. package/dist/hooks/use-mode-picker.d.ts.map +1 -1
  156. package/dist/hooks/use-next-steps-auto-submit.d.ts +50 -0
  157. package/dist/hooks/use-next-steps-auto-submit.d.ts.map +1 -0
  158. package/dist/hooks/use-panel-controllers.d.ts +41 -0
  159. package/dist/hooks/use-panel-controllers.d.ts.map +1 -0
  160. package/dist/hooks/use-paste-handling.d.ts +5 -3
  161. package/dist/hooks/use-paste-handling.d.ts.map +1 -1
  162. package/dist/hooks/use-picker-keys.d.ts +7 -3
  163. package/dist/hooks/use-picker-keys.d.ts.map +1 -1
  164. package/dist/hooks/use-prompt-picker.d.ts.map +1 -1
  165. package/dist/hooks/use-provider-event-bridge.d.ts +24 -0
  166. package/dist/hooks/use-provider-event-bridge.d.ts.map +1 -0
  167. package/dist/hooks/use-queue-manager.d.ts +2 -1
  168. package/dist/hooks/use-queue-manager.d.ts.map +1 -1
  169. package/dist/hooks/use-session-interrupt-controller.d.ts +1 -1
  170. package/dist/hooks/use-session-interrupt-controller.d.ts.map +1 -1
  171. package/dist/hooks/use-settings-auto-save.d.ts +6 -0
  172. package/dist/hooks/use-settings-auto-save.d.ts.map +1 -0
  173. package/dist/hooks/use-slash-picker.d.ts +13 -0
  174. package/dist/hooks/use-slash-picker.d.ts.map +1 -0
  175. package/dist/hooks/use-statusbar-view-model.d.ts +54 -0
  176. package/dist/hooks/use-statusbar-view-model.d.ts.map +1 -0
  177. package/dist/hooks/use-subagent-events.d.ts +2 -1
  178. package/dist/hooks/use-subagent-events.d.ts.map +1 -1
  179. package/dist/hooks/use-terminal-render-lifecycle.d.ts +4 -0
  180. package/dist/hooks/use-terminal-render-lifecycle.d.ts.map +1 -0
  181. package/dist/hooks/use-token-counter-refresh.d.ts +2 -1
  182. package/dist/hooks/use-token-counter-refresh.d.ts.map +1 -1
  183. package/dist/hooks/use-tui-activity.d.ts +2 -1
  184. package/dist/hooks/use-tui-activity.d.ts.map +1 -1
  185. package/dist/hooks/use-tui-controllers.d.ts +1 -5
  186. package/dist/hooks/use-tui-controllers.d.ts.map +1 -1
  187. package/dist/hooks/use-tui-environment-state.d.ts +42 -0
  188. package/dist/hooks/use-tui-environment-state.d.ts.map +1 -0
  189. package/dist/hooks/use-tui-event-bridge.d.ts +1 -1
  190. package/dist/hooks/use-tui-event-bridge.d.ts.map +1 -1
  191. package/dist/hooks/use-tui-slash-commands.d.ts +28 -0
  192. package/dist/hooks/use-tui-slash-commands.d.ts.map +1 -0
  193. package/dist/hooks/use-working-dir-chip.d.ts +1 -1
  194. package/dist/hooks/use-working-dir-chip.d.ts.map +1 -1
  195. package/dist/index.d.ts +2 -2
  196. package/dist/index.d.ts.map +1 -1
  197. package/dist/index.js +33772 -29744
  198. package/dist/index.js.map +4 -4
  199. package/dist/ink.d.ts +1 -1
  200. package/dist/ink.d.ts.map +1 -1
  201. package/dist/input-key-router.d.ts +35 -0
  202. package/dist/input-key-router.d.ts.map +1 -0
  203. package/dist/input-validation.d.ts +1 -1
  204. package/dist/input-validation.d.ts.map +1 -1
  205. package/dist/kanban-slash.d.ts +1 -1
  206. package/dist/kanban-slash.d.ts.map +1 -1
  207. package/dist/kill-slash.d.ts +1 -1
  208. package/dist/kill-slash.d.ts.map +1 -1
  209. package/dist/layout-engine.d.ts +112 -0
  210. package/dist/layout-engine.d.ts.map +1 -0
  211. package/dist/layout-store.d.ts +89 -0
  212. package/dist/layout-store.d.ts.map +1 -0
  213. package/dist/markdown.d.ts.map +1 -1
  214. package/dist/memory-context-monitor.d.ts +6 -1
  215. package/dist/memory-context-monitor.d.ts.map +1 -1
  216. package/dist/memory-slash.d.ts +2 -2
  217. package/dist/memory-slash.d.ts.map +1 -1
  218. package/dist/mouse.d.ts +13 -4
  219. package/dist/mouse.d.ts.map +1 -1
  220. package/dist/overlay-key-router.d.ts +43 -0
  221. package/dist/overlay-key-router.d.ts.map +1 -0
  222. package/dist/paste-accumulator.d.ts +10 -4
  223. package/dist/paste-accumulator.d.ts.map +1 -1
  224. package/dist/ps-slash.d.ts +1 -1
  225. package/dist/ps-slash.d.ts.map +1 -1
  226. package/dist/queue-slash.d.ts +2 -2
  227. package/dist/queue-slash.d.ts.map +1 -1
  228. package/dist/reducers/activity.d.ts +10 -0
  229. package/dist/reducers/activity.d.ts.map +1 -0
  230. package/dist/reducers/composer.d.ts +10 -0
  231. package/dist/reducers/composer.d.ts.map +1 -0
  232. package/dist/reducers/conversation.d.ts +10 -0
  233. package/dist/reducers/conversation.d.ts.map +1 -0
  234. package/dist/reducers/dialogs.d.ts +10 -0
  235. package/dist/reducers/dialogs.d.ts.map +1 -0
  236. package/dist/reducers/fleet.d.ts.map +1 -1
  237. package/dist/reducers/helpers.d.ts +8 -1
  238. package/dist/reducers/helpers.d.ts.map +1 -1
  239. package/dist/reducers/panel-pickers.d.ts +10 -0
  240. package/dist/reducers/panel-pickers.d.ts.map +1 -0
  241. package/dist/reducers/settings-panel.d.ts +10 -0
  242. package/dist/reducers/settings-panel.d.ts.map +1 -0
  243. package/dist/reducers/settings-values.d.ts +10 -0
  244. package/dist/reducers/settings-values.d.ts.map +1 -0
  245. package/dist/reducers/workspace-panels.d.ts +10 -0
  246. package/dist/reducers/workspace-panels.d.ts.map +1 -0
  247. package/dist/rehydrate-history.d.ts +1 -1
  248. package/dist/rehydrate-history.d.ts.map +1 -1
  249. package/dist/run-blocks-controller.d.ts +30 -0
  250. package/dist/run-blocks-controller.d.ts.map +1 -0
  251. package/dist/run-tui.d.ts +22 -20
  252. package/dist/run-tui.d.ts.map +1 -1
  253. package/dist/scroll-anchor.d.ts +103 -0
  254. package/dist/scroll-anchor.d.ts.map +1 -0
  255. package/dist/settings-contracts.d.ts +58 -0
  256. package/dist/settings-contracts.d.ts.map +1 -0
  257. package/dist/shared-types.d.ts +17 -0
  258. package/dist/shared-types.d.ts.map +1 -0
  259. package/dist/slash-command-search.d.ts +1 -1
  260. package/dist/slash-command-search.d.ts.map +1 -1
  261. package/dist/submit-controller.d.ts +73 -0
  262. package/dist/submit-controller.d.ts.map +1 -0
  263. package/dist/submit-prompt-refinement.d.ts +30 -0
  264. package/dist/submit-prompt-refinement.d.ts.map +1 -0
  265. package/dist/terminal-title.d.ts +1 -1
  266. package/dist/terminal-title.d.ts.map +1 -1
  267. package/dist/theme.d.ts +6 -0
  268. package/dist/theme.d.ts.map +1 -1
  269. package/dist/token-previews.d.ts +44 -0
  270. package/dist/token-previews.d.ts.map +1 -0
  271. package/dist/tui-host-capabilities.d.ts +66 -0
  272. package/dist/tui-host-capabilities.d.ts.map +1 -0
  273. package/dist/ui-contracts.d.ts +136 -0
  274. package/dist/ui-contracts.d.ts.map +1 -0
  275. package/dist/ui-glyphs.d.ts +1 -0
  276. package/dist/ui-glyphs.d.ts.map +1 -1
  277. package/package.json +13 -6
@@ -0,0 +1,222 @@
1
+ /**
2
+ * Brain panel data model — pure types + row derivation shared by the
3
+ * reducer (cursor clamping), the key hook (action dispatch), and the
4
+ * component (render). Mirrors the auth-panel pattern: the TUI never
5
+ * touches config files — every mutation goes through the host bridge,
6
+ * which the CLI implements on top of its BrainRuntime (live apply +
7
+ * persist to the global config).
8
+ */
9
+ import type { BrainRiskLevel } from './brain-contracts.js';
10
+ /** One configured pool entry / council voter, display-mapped. */
11
+ export interface BrainPanelVoter {
12
+ label: string;
13
+ persona?: string | undefined;
14
+ veto?: boolean | undefined;
15
+ weight?: number | undefined;
16
+ }
17
+ /** Editable heuristic toggles, mirroring `BrainConfigSnapshot.heuristics`. */
18
+ export interface BrainPanelHeuristics {
19
+ lowRiskAutoAnswer: boolean;
20
+ blockedResolved: boolean;
21
+ deadlockSkip: boolean;
22
+ retryExhausted: boolean;
23
+ continuePing: boolean;
24
+ /** Custom resolution-marker word list (undefined = built-in list). Read-only here. */
25
+ blockedResolvedMarkers?: string[] | undefined;
26
+ }
27
+ /** Keys of the boolean heuristic toggles — the setter's `key` argument. */
28
+ export type BrainHeuristicKey = keyof Omit<BrainPanelHeuristics, 'blockedResolvedMarkers'>;
29
+ export type BrainDenyIsTerminal = 'never' | 'when-decided' | 'always';
30
+ export type BrainTraceContent = 'none' | 'redacted' | 'full';
31
+ export type BrainTerminalPolicyValue = 'conservative' | 'deny-all' | 'continue-on-recommended';
32
+ /** Display-mapped snapshot of the live Brain settings. */
33
+ export interface BrainPanelSettings {
34
+ mode: 'headless' | 'interactive';
35
+ riskLevel: BrainRiskLevel;
36
+ strategy: 'fallback' | 'round-robin';
37
+ decisionTimeoutMs?: number | undefined;
38
+ humanTimeoutMs?: number | undefined;
39
+ /** Configured pool entries as compact "provider/model" labels. */
40
+ pool: string[];
41
+ /** Resolved pool labels from the last assembly (≤ pool.length). */
42
+ poolResolved: string[];
43
+ usingSessionModel: boolean;
44
+ councilEnabled: boolean;
45
+ councilMinRisk: 'medium' | 'high' | 'critical';
46
+ /** Explicitly configured voters (empty = seats derive from the pool). */
47
+ voters: BrainPanelVoter[];
48
+ /** Effective council seat labels (empty = council disabled). */
49
+ councilSeats: string[];
50
+ judgeLabel?: string | undefined;
51
+ ledgerEnabled: boolean;
52
+ autoDenyAfterFailures?: number | undefined;
53
+ /** Headless escalation variant. */
54
+ terminalPolicy: BrainTerminalPolicyValue;
55
+ /** Effective heuristic toggles (defaults already filled in by the host). */
56
+ heuristics: BrainPanelHeuristics;
57
+ /** Single-LLM tier quality gate. */
58
+ llmMaxTokens: number;
59
+ llmRejectUncertain: boolean;
60
+ llmMinConfidence: number;
61
+ llmDenyIsTerminal: BrainDenyIsTerminal;
62
+ /** Decision cache: effective settings + LIVE counters (counters read-only). */
63
+ cacheEnabled: boolean;
64
+ cacheTtlMs: number;
65
+ cacheMaxEntries: number;
66
+ cacheHits: number;
67
+ cacheMisses: number;
68
+ cacheSize: number;
69
+ /** Replay trace. `tracePath` is read-only (edited via config). */
70
+ traceEnabled: boolean;
71
+ traceContent: BrainTraceContent;
72
+ tracePath?: string | undefined;
73
+ /** Live LLM circuit-breaker state; undefined = no breaker wired. READ-ONLY. */
74
+ circuitState?: string | undefined;
75
+ circuitFailures?: number | undefined;
76
+ /** Deterministic rule table summary. READ-ONLY. */
77
+ ruleCount: number;
78
+ /** Compile diagnostics from the last assembly, one per dropped rule. READ-ONLY. */
79
+ ruleErrors: string[];
80
+ }
81
+ /**
82
+ * Host bridge implemented by the CLI. Every setter returns an error string
83
+ * (shown as the panel hint) or null on success; all setters apply LIVE and
84
+ * persist to the active profile config. Model SELECTION is not part of this
85
+ * bridge — the panel uses the shared /model picker via requestModelPick.
86
+ */
87
+ export interface BrainPanelHost {
88
+ getSettings(): BrainPanelSettings;
89
+ setMode(mode: 'headless' | 'interactive'): Promise<string | null>;
90
+ setRisk(level: BrainRiskLevel): Promise<string | null>;
91
+ setStrategy(strategy: 'fallback' | 'round-robin'): Promise<string | null>;
92
+ setDecisionTimeout(ms: number | undefined): Promise<string | null>;
93
+ setHumanTimeout(ms: number | undefined): Promise<string | null>;
94
+ addPoolModel(providerId: string, model: string): Promise<string | null>;
95
+ removePoolModel(index: number): Promise<string | null>;
96
+ clearPool(): Promise<string | null>;
97
+ setCouncilEnabled(on: boolean): Promise<string | null>;
98
+ setCouncilMinRisk(risk: 'medium' | 'high' | 'critical'): Promise<string | null>;
99
+ addVoter(providerId: string, model: string): Promise<string | null>;
100
+ removeVoter(index: number): Promise<string | null>;
101
+ cycleVoterPersona(index: number): Promise<string | null>;
102
+ toggleVoterVeto(index: number): Promise<string | null>;
103
+ setJudge(providerId: string, model: string): Promise<string | null>;
104
+ clearJudge(): Promise<string | null>;
105
+ setLedgerEnabled(on: boolean): Promise<string | null>;
106
+ setAutoDeny(count: number | undefined): Promise<string | null>;
107
+ setTerminalPolicy(policy: BrainTerminalPolicyValue): Promise<string | null>;
108
+ setHeuristic(key: BrainHeuristicKey, on: boolean): Promise<string | null>;
109
+ /**
110
+ * NOTE the numeric LLM/cache knobs take a plain number: the underlying
111
+ * `BrainConfigPatch` validators reject `null` for these fields ("must be a
112
+ * positive integer"), so there is no "clear back to default" step here —
113
+ * the preset ladders are number-only.
114
+ */
115
+ setLlmMaxTokens(tokens: number): Promise<string | null>;
116
+ setLlmRejectUncertain(on: boolean): Promise<string | null>;
117
+ setLlmMinConfidence(value: number): Promise<string | null>;
118
+ setLlmDenyIsTerminal(mode: BrainDenyIsTerminal): Promise<string | null>;
119
+ setCacheEnabled(on: boolean): Promise<string | null>;
120
+ setCacheTtl(ms: number): Promise<string | null>;
121
+ setCacheMaxEntries(count: number): Promise<string | null>;
122
+ setTraceEnabled(on: boolean): Promise<string | null>;
123
+ setTraceContent(content: BrainTraceContent): Promise<string | null>;
124
+ }
125
+ /** One selectable row of the settings view. */
126
+ export type BrainPanelRow = {
127
+ kind: 'mode';
128
+ } | {
129
+ kind: 'risk';
130
+ } | {
131
+ kind: 'strategy';
132
+ } | {
133
+ kind: 'timeout';
134
+ } | {
135
+ kind: 'humanTimeout';
136
+ } | {
137
+ kind: 'poolModel';
138
+ index: number;
139
+ } | {
140
+ kind: 'poolAdd';
141
+ } | {
142
+ kind: 'councilToggle';
143
+ } | {
144
+ kind: 'councilMinRisk';
145
+ } | {
146
+ kind: 'voter';
147
+ index: number;
148
+ } | {
149
+ kind: 'voterAdd';
150
+ } | {
151
+ kind: 'judge';
152
+ } | {
153
+ kind: 'ledgerToggle';
154
+ } | {
155
+ kind: 'autoDeny';
156
+ } | {
157
+ kind: 'terminalPolicy';
158
+ } | {
159
+ kind: 'heuristic';
160
+ key: BrainHeuristicKey;
161
+ } | {
162
+ kind: 'llmMaxTokens';
163
+ } | {
164
+ kind: 'llmRejectUncertain';
165
+ } | {
166
+ kind: 'llmMinConfidence';
167
+ } | {
168
+ kind: 'llmDenyIsTerminal';
169
+ } | {
170
+ kind: 'cacheToggle';
171
+ } | {
172
+ kind: 'cacheTtl';
173
+ } | {
174
+ kind: 'cacheMaxEntries';
175
+ } | {
176
+ kind: 'traceToggle';
177
+ } | {
178
+ kind: 'traceContent';
179
+ } | {
180
+ kind: 'cacheStats';
181
+ } | {
182
+ kind: 'tracePath';
183
+ } | {
184
+ kind: 'circuit';
185
+ } | {
186
+ kind: 'rulesSummary';
187
+ } | {
188
+ kind: 'ruleErrors';
189
+ };
190
+ /**
191
+ * Rows that only REPORT live/derived state. They are rendered dim and are
192
+ * skipped by the adjust/enter handlers — there is nothing to write back.
193
+ */
194
+ export declare const BRAIN_READONLY_ROW_KINDS: ReadonlySet<BrainPanelRow['kind']>;
195
+ /** Heuristic rows, in display order. */
196
+ export declare const BRAIN_HEURISTIC_KEYS: readonly BrainHeuristicKey[];
197
+ /**
198
+ * Derive the selectable rows for a settings snapshot.
199
+ *
200
+ * Array/optional reads are defensive: this is a pure display function driven
201
+ * by whatever the host last pushed over `brainSettingsLoaded`, and a host that
202
+ * predates a field (or an older persisted payload) must render fewer rows, not
203
+ * crash the whole TUI.
204
+ */
205
+ export declare function brainPanelRows(settings: BrainPanelSettings): BrainPanelRow[];
206
+ /** Preset ladders for ←/→ cycling on numeric rows. */
207
+ export declare const DECISION_TIMEOUT_PRESETS: ReadonlyArray<number | undefined>;
208
+ export declare const HUMAN_TIMEOUT_PRESETS: ReadonlyArray<number | undefined>;
209
+ export declare const AUTO_DENY_PRESETS: ReadonlyArray<number | undefined>;
210
+ /**
211
+ * Number-only ladders. The Brain patch validators reject `null` for these
212
+ * fields, so there is no `undefined` ("back to default") rung — the default
213
+ * value itself is the first rung.
214
+ */
215
+ export declare const LLM_MAX_TOKENS_PRESETS: readonly number[];
216
+ export declare const LLM_MIN_CONFIDENCE_PRESETS: readonly number[];
217
+ export declare const CACHE_TTL_PRESETS: readonly number[];
218
+ export declare const CACHE_MAX_ENTRIES_PRESETS: readonly number[];
219
+ export declare const PERSONA_CYCLE: readonly ['executor', 'skeptic', 'auditor'];
220
+ /** Cycle helper: step through a preset ladder from the current value. */
221
+ export declare function cyclePreset<T>(presets: ReadonlyArray<T>, current: T, delta: number): T;
222
+ //# sourceMappingURL=brain-panel-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brain-panel-model.d.ts","sourceRoot":"","sources":["../src/brain-panel-model.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,iEAAiE;AACjE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED,8EAA8E;AAC9E,MAAM,WAAW,oBAAoB;IACnC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,OAAO,CAAC;IACtB,sFAAsF;IACtF,sBAAsB,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CAC/C;AAED,2EAA2E;AAC3E,MAAM,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,oBAAoB,EAAE,wBAAwB,CAAC,CAAC;AAE3F,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,cAAc,GAAG,QAAQ,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;AAC7D,MAAM,MAAM,wBAAwB,GAAG,cAAc,GAAG,UAAU,GAAG,yBAAyB,CAAC;A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,sBAAsB,EAAE,SAAS,MAAM,EAAkC,CAAC;AACvF,eAAO,MAAM,0BAA0B,EAAE,SAAS,MAAM,EAA4B,CAAC;AACrF,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAM9C,CAAC;AACF,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,EAA+B,CAAC;AACvF,eAAO,MAAM,aAAa,YAAI,UAAU,EAAE,SAAS,EAAE,SAAS,CAAU,CAAC;AAEzE,yEAAyE;AACzE,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,CAKtF"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Bounded retention for the session checkpoint list (`state.checkpoints`).
3
+ *
4
+ * Mirrors the dual-budget pattern of history-retention.ts: the checkpoint
5
+ * list is a display index into the canonical session record, not the record
6
+ * itself. The JSONL session log still carries every `checkpoint` event, so
7
+ * pruning old in-memory rows loses nothing — `/rewind` simply shows the
8
+ * newest slice. Without a bound, resuming a long session rebuilt every
9
+ * checkpoint ever written into memory (see buildRestoredCheckpoints) and
10
+ * the live `checkpointReceived` reducer appended forever.
11
+ *
12
+ * This module is pure TypeScript — no React, no Ink.
13
+ */
14
+ import type { State } from './app-state.js';
15
+ export type CheckpointEntry = State['checkpoints'][number];
16
+ /** Default maximum number of retained checkpoints. */
17
+ export declare const TUI_CHECKPOINTS_MAX_ENTRIES = 200;
18
+ /** Default maximum serialized bytes across all retained checkpoints. */
19
+ export declare const TUI_CHECKPOINTS_MAX_BYTES: number;
20
+ export interface CheckpointBudget {
21
+ maxEntries?: number | undefined;
22
+ maxBytes?: number | undefined;
23
+ }
24
+ /**
25
+ * Retain the newest checkpoints within both a count and serialized-byte
26
+ * budget. Checkpoints are chronological (ascending promptIndex), so the
27
+ * newest entries are at the end of the array. Like retainTuiHistory, at
28
+ * least one entry is always kept — dropping the only checkpoint would make
29
+ * `/rewind` report "no checkpoints" for a session that has one.
30
+ *
31
+ * Returns the ORIGINAL array reference when nothing needs pruning so
32
+ * reducer callers can bail out without scheduling another render.
33
+ */
34
+ export declare function retainCheckpoints(checkpoints: CheckpointEntry[], budget?: CheckpointBudget): CheckpointEntry[];
35
+ //# sourceMappingURL=checkpoint-retention.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint-retention.d.ts","sourceRoot":"","sources":["../src/checkpoint-retention.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,sDAAsD;AACtD,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C,wEAAwE;AACxE,eAAO,MAAM,yBAAyB,QAAa,CAAC;AAEpD,MAAM,WAAW,gBAAgB;IAC/B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAWD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,eAAe,EAAE,EAC9B,MAAM,GAAE,gBAAqB,GAC5B,eAAe,EAAE,CAmBnB"}
@@ -1,6 +1,8 @@
1
1
  import type React from 'react';
2
2
  import type { AgentTimelineEntry } from '@wrongstack/core/coordination';
3
- import type { FleetEntry } from '../app.js';
3
+ import type { AgentTranscriptReader } from '../ui-contracts.js';
4
+ export type { AgentTranscriptReader } from '../ui-contracts.js';
5
+ import type { FleetEntry } from '../app-state.js';
4
6
  import type { HistoryEntry } from './history/types.js';
5
7
  /**
6
8
  * Narrow read-only view of per-subagent transcripts. AgentMonitorService
@@ -8,9 +10,6 @@ import type { HistoryEntry } from './history/types.js';
8
10
  * imports from @wrongstack/cli. `getTranscript` returns entries NEWEST
9
11
  * FIRST (mirroring AgentMonitorService.getTranscript).
10
12
  */
11
- export interface AgentTranscriptReader {
12
- getTranscript(subagentId: string, limit?: number): AgentTimelineEntry[];
13
- }
14
13
  export interface AgentsMonitorProps {
15
14
  entries: Record<string, FleetEntry>;
16
15
  totalCost: number;
@@ -1 +1 @@
1
- {"version":3,"file":"agents-monitor.d.ts","sourceRoot":"","sources":["../../src/components/agents-monitor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAgBvD;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,kBAAkB,EAAE,CAAC;CACzE;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,WAAW,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACnC,WAAW,CAAC,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAChD,gBAAgB,CAAC,EAAE,CAAC,MAAM,kBAAkB,EAAE,CAAC,GAAG,SAAS,CAAC;IAC5D,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAClC;AAaD,yEAAyE;AACzE,eAAO,MAAM,YAAY,QAAS,CAAC;AACnC,eAAO,MA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idle/aborting).
17
17
  */
18
18
  export declare const CYCLE_TICK_INTERVAL_MS = 1000;
19
+ /**
20
+ * Milliseconds between each color-animation tick for rainbow/wave/pulse.
21
+ * The 1-second spinner cadence (SPINNER_INTERVAL_MS) is too slow for a
22
+ * visible traveling gradient — 120ms gives ~8 updates/second, so the
23
+ * rainbow moves ~1 palette stop per 0.5s and completes a full 12-stop
24
+ * cycle in ~6s. Derive with `Math.floor(elapsedMs / COLOR_TICK_MS)`.
25
+ *
26
+ * Pure for testing.
27
+ */
28
+ export declare const COLOR_TICK_MS = 120;
29
+ /**
30
+ * Derive a fast color-animation frame from wall-clock elapsed milliseconds.
31
+ * Callers pass `animationTime` (from Ink's `useAnimation`) and get a
32
+ * monotonically increasing phase suitable for rainbow/wave/pulse, while
33
+ * keeping the spinner-phase for dots/breathe at the original 1s cadence.
34
+ */
35
+ export declare function colorPhaseFromTime(elapsedMs: number): number;
19
36
  /**
20
37
  * Cycle through every other `AnimationStyle` in order, returning to the
21
38
  * start once the list is exhausted. `rainbow` is excluded from the cycle
@@ -46,30 +63,12 @@ export declare function waveColor(charIndex: number, phase: number, length: numb
46
63
  */
47
64
  export declare function pulseColor(phase: number): string;
48
65
  /**
49
- * Compute the hue (in degrees, 0-360) for glyph `charIndex` at animation
50
- * `phase`.
51
- *
52
- * The hue follows a sinusoidal curve: `base + amp * sin(2π * f)`, where
53
- * `f` combines spatial position and temporal phase into a single phase
54
- * argument. This produces a smooth traveling wave — the bright band glides
55
- * across the text, and adjacent glyphs always differ by a small hue delta
56
- * (never a snap).
57
- *
58
- * Pure for testing.
59
- */
60
- export declare function rainbowHue(charIndex: number, phase: number): number;
61
- /**
62
- * Convert HSL (degrees, 0-1, 0-1) to a `#rrggbb` hex string.
63
- * Algorithm: standard HSL→RGB conversion with the 0/120/240 sector trick.
66
+ * Pick a Catppuccin colour for glyph `charIndex` at animation `phase`.
64
67
  *
65
- * Pure for testing.
66
- */
67
- export declare function hslToHex(h: number, s: number, l: number): string;
68
- /**
69
- * Pick a smooth-rainbow color for glyph `charIndex` at animation `phase`
70
- * for a text of length `textLen`. This is the refined replacement for the
71
- * old `HUE_WHEEL[(i + phase) % 12]` lookup — it computes hue via
72
- * {@link rainbowHue} and converts to hex via {@link hslToHex}.
68
+ * The palette coordinate is `charIndex - phase / 4`, making the complete
69
+ * gradient translate from the left edge to the right edge instead of
70
+ * oscillating or choosing colours independently. Fractional coordinates are
71
+ * blended between neighbouring Catppuccin stops to keep every frame smooth.
73
72
  *
74
73
  * Pure for testing.
75
74
  */
@@ -1 +1 @@
1
- {"version":3,"file":"animation-style.d.ts","sourceRoot":"","sources":["../../src/components/animation-style.tsx"],"names":[],"mappings":"AAwBA,eAAO,MAAM,SAAS,UAarB,CAAC;AAWF,eAAO,MAAM,cAAc,UAAqD,CAAC;AAOjF,eAAO,MAAM,WAAW,UAAoC,CAAC;AAE7D,eAAO,MAAM,gBAAgB,YAAI,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AACzF,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,eAAO,MAAM,uBAAuB,EAAE,cAA0B,CAAC;AAEjE,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAMhE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,SAAS,cAAc,EAAyC,CAAC;AAE3F;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAI9D;AAED,qDAAqD;AACrD,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAS9D;AAWD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C;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,MAAM,CAAC;AAEjC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,SAAS,cAAc,EAAyC,CAAC;AAE3F;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAI9D;AAED,qDAAqD;AACrD,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAS9D;AAWD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAIlF;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIhD;AAeD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAKrE;AAED;+BAC+B;AAC/B,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAWtD"}
@@ -1,4 +1,4 @@
1
- import type { SideEffect } from '@wrongstack/core';
1
+ import type { SideEffect } from '@wrongstack/core/types';
2
2
  interface AuditPanelProps {
3
3
  /** Side effects from ctx.sideEffects, passed from the host. */
4
4
  sideEffects: SideEffect[];
@@ -1 +1 @@
1
- {"version":3,"file":"audit-panel.d.ts","sourceRoot":"","sources":["../../src/components/audit-panel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,UAAU,eAAe;IACvB,+DAA+D;IAC/D,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAwBD,wBAAgB,UAAU,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,eAAe,+BA6C7E"}
1
+ {"version":3,"file":"audit-panel.d.ts","sourceRoot":"","sources":["../../src/components/audit-panel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,UAAU,eAAe;IACvB,+DAA+D;IAC/D,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAwBD,wBAAgB,UAAU,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,eAAe,+BA6C7E"}
@@ -1,150 +1,2 @@
1
- /** One saved API key / OAuth token, with the secret already masked. */
2
- export interface AuthKeyRow {
3
- label: string;
4
- /** Pre-masked display form ("sk-a…f3k2" / "••••••") — never the secret. */
5
- masked: string;
6
- createdAt: string;
7
- active: boolean;
8
- authMethod?: 'api_key' | 'oauth' | 'session_token' | undefined;
9
- expiresAt?: string | undefined;
10
- }
11
- /** One saved provider from the active profile config. */
12
- export interface AuthProviderRow {
13
- id: string;
14
- type?: string | undefined;
15
- family?: string | undefined;
16
- baseUrl?: string | undefined;
17
- models: string[];
18
- envVars: string[];
19
- keys: AuthKeyRow[];
20
- }
21
- /** One models.dev catalog entry offered by "Add provider (catalog)". */
22
- export interface AuthCatalogRow {
23
- id: string;
24
- name: string;
25
- family: string;
26
- apiBase?: string | undefined;
27
- envVars: string[];
28
- /** Already present in the saved config (shown as ◉). */
29
- saved: boolean;
30
- }
31
- /** One local-LLM preset (OmniRoute / Ollama / vLLM / LM Studio). */
32
- export interface AuthLocalPresetRow {
33
- id: string;
34
- label: string;
35
- defaultBaseUrl: string;
36
- noAuth: boolean;
37
- hint: string;
38
- }
39
- export type AuthOAuthKind = 'chatgpt' | 'claude' | 'copilot';
40
- /**
41
- * Bridge the CLI flows use to talk to the panel while a flow runs.
42
- * `prompt` REJECTS when the user cancels (Esc) — flows treat a thrown
43
- * prompt as user-cancel, which aborts before anything is saved.
44
- */
45
- export interface AuthFlowIo {
46
- onLog(line: string): void;
47
- prompt(question: string, opts: {
48
- secret: boolean;
49
- }): Promise<string>;
50
- signal: AbortSignal;
51
- }
52
- export interface AuthFlowResult {
53
- ok: boolean;
54
- message?: string | undefined;
55
- }
56
- /**
57
- * Host callbacks the CLI provides. Simple mutations return an error
58
- * string (or null on success); multi-step interactions run as "flows"
59
- * that log and prompt through {@link AuthFlowIo}.
60
- */
61
- export interface AuthPanelHost {
62
- listProviders(): Promise<AuthProviderRow[]>;
63
- listCatalog(): Promise<AuthCatalogRow[]>;
64
- localPresets(): AuthLocalPresetRow[];
65
- setActiveKey(providerId: string, label: string): Promise<string | null>;
66
- deleteKey(providerId: string, label: string): Promise<string | null>;
67
- removeProvider(providerId: string): Promise<string | null>;
68
- addKey(providerId: string, io: AuthFlowIo): Promise<AuthFlowResult>;
69
- updateKey(providerId: string, label: string, io: AuthFlowIo): Promise<AuthFlowResult>;
70
- editField(providerId: string, field: 'family' | 'baseUrl' | 'models', io: AuthFlowIo): Promise<AuthFlowResult>;
71
- addCatalogProvider(catalogId: string, io: AuthFlowIo): Promise<AuthFlowResult>;
72
- addCustomProvider(io: AuthFlowIo): Promise<AuthFlowResult>;
73
- addLocal(presetId: string, io: AuthFlowIo): Promise<AuthFlowResult>;
74
- oauthLogin(kind: AuthOAuthKind, io: AuthFlowIo): Promise<AuthFlowResult>;
75
- }
76
- export type AuthPanelView = 'list' | 'provider' | 'catalog' | 'local' | 'oauth' | 'flow';
77
- export type AuthConfirmAction = {
78
- kind: 'delete-key';
79
- providerId: string;
80
- label: string;
81
- } | {
82
- kind: 'remove-provider';
83
- providerId: string;
84
- };
85
- export interface AuthPanelState {
86
- open: boolean;
87
- view: AuthPanelView;
88
- busy: boolean;
89
- hint?: string | undefined;
90
- providers: AuthProviderRow[];
91
- presets: AuthLocalPresetRow[];
92
- catalog: AuthCatalogRow[];
93
- /** Cursor index into `authPanelRows(state)` for the current view. */
94
- selected: number;
95
- /** Provider shown in the 'provider' detail view. */
96
- providerId?: string | undefined;
97
- /** Type-to-filter query for the catalog view. */
98
- filter: string;
99
- /** Running/last flow (OAuth, catalog add, local add, key edit, …). */
100
- flowTitle: string;
101
- log: string[];
102
- flowDone: boolean;
103
- flowOk?: boolean | undefined;
104
- /** Modal one-line prompt raised by a flow (masked for secrets). */
105
- input?: {
106
- label: string;
107
- masked: boolean;
108
- draft: string;
109
- } | undefined;
110
- /** Modal y/N confirmation for destructive actions. */
111
- confirm?: {
112
- question: string;
113
- action: AuthConfirmAction;
114
- } | undefined;
115
- }
116
- export declare const AUTH_PANEL_INITIAL: AuthPanelState;
117
- export type AuthPanelRow = {
118
- kind: 'provider';
119
- provider: AuthProviderRow;
120
- } | {
121
- kind: 'list-action';
122
- action: 'catalog' | 'local' | 'custom' | 'oauth';
123
- } | {
124
- kind: 'key';
125
- keyRow: AuthKeyRow;
126
- } | {
127
- kind: 'provider-action';
128
- action: 'add-key' | 'edit-family' | 'edit-base-url' | 'edit-models' | 'remove';
129
- } | {
130
- kind: 'catalog-entry';
131
- entry: AuthCatalogRow;
132
- } | {
133
- kind: 'local-preset';
134
- preset: AuthLocalPresetRow;
135
- } | {
136
- kind: 'oauth-option';
137
- oauth: AuthOAuthKind;
138
- };
139
- /** Case-insensitive substring filter over id + name + family. */
140
- export declare function filterAuthCatalog(catalog: AuthCatalogRow[], filter: string): AuthCatalogRow[];
141
- export declare function authSelectedProvider(state: AuthPanelState): AuthProviderRow | undefined;
142
- /**
143
- * Selectable rows for the current view, in render order. The component
144
- * renders exactly this list; the reducer clamps `selected` to its length;
145
- * the Enter handler dispatches on `rows[selected]`.
146
- */
147
- export declare function authPanelRows(state: AuthPanelState): AuthPanelRow[];
148
- /** Wrap-around cursor move over the current view's rows. */
149
- export declare function authMoveSelected(state: AuthPanelState, delta: number): number;
1
+ export * from '../auth-panel-model.js';
150
2
  //# sourceMappingURL=auth-panel-model.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-panel-model.d.ts","sourceRoot":"","sources":["../../src/components/auth-panel-model.ts"],"names":[],"mappings":"AAaA,uEAAuE;AACvE,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,2EAA2E;IAC3E,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,eAAe,GAAG,SAAS,CAAC;IAC/D,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED,yDAAyD;AACzD,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,UAAU,EAAE,CAAC;CACpB;AAED,wEAAwE;AACxE,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,wDAAwD;IACxD,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,oEAAoE;AACpE,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,aAAa,GAAG,SAAS,G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