@elaraai/e3-ui-cli 1.0.72 → 1.0.74

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 (220) hide show
  1. package/README.md +46 -21
  2. package/bin/e3-ui.mjs +6 -0
  3. package/dist/app/assets/{engine-BKZbmXkC-DmcCFcnb.js → engine-Bm-cIDd_-DwUdGcTZ.js} +1 -1
  4. package/dist/app/assets/{index-BJNWHnRv.js → index-mj-YVVN1.js} +91 -91
  5. package/dist/app/index.html +1 -1
  6. package/dist/cli.js +36 -5
  7. package/dist/cli.js.map +1 -1
  8. package/dist/commands/tui.d.ts +84 -0
  9. package/dist/commands/tui.d.ts.map +1 -0
  10. package/dist/commands/tui.js +89 -0
  11. package/dist/commands/tui.js.map +1 -0
  12. package/dist/tui/api.d.ts +108 -0
  13. package/dist/tui/api.d.ts.map +1 -0
  14. package/dist/tui/api.js +130 -0
  15. package/dist/tui/api.js.map +1 -0
  16. package/dist/tui/app.d.ts +23 -0
  17. package/dist/tui/app.d.ts.map +1 -0
  18. package/dist/tui/app.js +244 -0
  19. package/dist/tui/app.js.map +1 -0
  20. package/dist/tui/controller.d.ts +116 -0
  21. package/dist/tui/controller.d.ts.map +1 -0
  22. package/dist/tui/controller.js +644 -0
  23. package/dist/tui/controller.js.map +1 -0
  24. package/dist/tui/data/dataflow.d.ts +68 -0
  25. package/dist/tui/data/dataflow.d.ts.map +1 -0
  26. package/dist/tui/data/dataflow.js +137 -0
  27. package/dist/tui/data/dataflow.js.map +1 -0
  28. package/dist/tui/data/dataset.d.ts +80 -0
  29. package/dist/tui/data/dataset.d.ts.map +1 -0
  30. package/dist/tui/data/dataset.js +297 -0
  31. package/dist/tui/data/dataset.js.map +1 -0
  32. package/dist/tui/data/edit-buffer.d.ts +74 -0
  33. package/dist/tui/data/edit-buffer.d.ts.map +1 -0
  34. package/dist/tui/data/edit-buffer.js +120 -0
  35. package/dist/tui/data/edit-buffer.js.map +1 -0
  36. package/dist/tui/data/feeds.d.ts +45 -0
  37. package/dist/tui/data/feeds.d.ts.map +1 -0
  38. package/dist/tui/data/feeds.js +318 -0
  39. package/dist/tui/data/feeds.js.map +1 -0
  40. package/dist/tui/data/logs.d.ts +68 -0
  41. package/dist/tui/data/logs.d.ts.map +1 -0
  42. package/dist/tui/data/logs.js +134 -0
  43. package/dist/tui/data/logs.js.map +1 -0
  44. package/dist/tui/input/commands.d.ts +159 -0
  45. package/dist/tui/input/commands.d.ts.map +1 -0
  46. package/dist/tui/input/commands.js +259 -0
  47. package/dist/tui/input/commands.js.map +1 -0
  48. package/dist/tui/input/completion.d.ts +63 -0
  49. package/dist/tui/input/completion.d.ts.map +1 -0
  50. package/dist/tui/input/completion.js +128 -0
  51. package/dist/tui/input/completion.js.map +1 -0
  52. package/dist/tui/input/keymap.d.ts +153 -0
  53. package/dist/tui/input/keymap.d.ts.map +1 -0
  54. package/dist/tui/input/keymap.js +206 -0
  55. package/dist/tui/input/keymap.js.map +1 -0
  56. package/dist/tui/input/mouse.d.ts +52 -0
  57. package/dist/tui/input/mouse.d.ts.map +1 -0
  58. package/dist/tui/input/mouse.js +55 -0
  59. package/dist/tui/input/mouse.js.map +1 -0
  60. package/dist/tui/lifecycle.d.ts +61 -0
  61. package/dist/tui/lifecycle.d.ts.map +1 -0
  62. package/dist/tui/lifecycle.js +99 -0
  63. package/dist/tui/lifecycle.js.map +1 -0
  64. package/dist/tui/model/catalogue.d.ts +28 -0
  65. package/dist/tui/model/catalogue.d.ts.map +1 -0
  66. package/dist/tui/model/catalogue.js +94 -0
  67. package/dist/tui/model/catalogue.js.map +1 -0
  68. package/dist/tui/model/help.d.ts +37 -0
  69. package/dist/tui/model/help.d.ts.map +1 -0
  70. package/dist/tui/model/help.js +210 -0
  71. package/dist/tui/model/help.js.map +1 -0
  72. package/dist/tui/model/index.d.ts +42 -0
  73. package/dist/tui/model/index.d.ts.map +1 -0
  74. package/dist/tui/model/index.js +50 -0
  75. package/dist/tui/model/index.js.map +1 -0
  76. package/dist/tui/model/status.d.ts +88 -0
  77. package/dist/tui/model/status.d.ts.map +1 -0
  78. package/dist/tui/model/status.js +137 -0
  79. package/dist/tui/model/status.js.map +1 -0
  80. package/dist/tui/model/tree.d.ts +126 -0
  81. package/dist/tui/model/tree.d.ts.map +1 -0
  82. package/dist/tui/model/tree.js +217 -0
  83. package/dist/tui/model/tree.js.map +1 -0
  84. package/dist/tui/model/types.d.ts +21 -0
  85. package/dist/tui/model/types.d.ts.map +1 -0
  86. package/dist/tui/model/types.js +46 -0
  87. package/dist/tui/model/types.js.map +1 -0
  88. package/dist/tui/render/glyphs.d.ts +122 -0
  89. package/dist/tui/render/glyphs.d.ts.map +1 -0
  90. package/dist/tui/render/glyphs.js +122 -0
  91. package/dist/tui/render/glyphs.js.map +1 -0
  92. package/dist/tui/render/layout.d.ts +145 -0
  93. package/dist/tui/render/layout.d.ts.map +1 -0
  94. package/dist/tui/render/layout.js +209 -0
  95. package/dist/tui/render/layout.js.map +1 -0
  96. package/dist/tui/render/text.d.ts +153 -0
  97. package/dist/tui/render/text.d.ts.map +1 -0
  98. package/dist/tui/render/text.js +320 -0
  99. package/dist/tui/render/text.js.map +1 -0
  100. package/dist/tui/render/theme.d.ts +88 -0
  101. package/dist/tui/render/theme.d.ts.map +1 -0
  102. package/dist/tui/render/theme.js +145 -0
  103. package/dist/tui/render/theme.js.map +1 -0
  104. package/dist/tui/session.d.ts +78 -0
  105. package/dist/tui/session.d.ts.map +1 -0
  106. package/dist/tui/session.js +237 -0
  107. package/dist/tui/session.js.map +1 -0
  108. package/dist/tui/state/actions.d.ts +584 -0
  109. package/dist/tui/state/actions.d.ts.map +1 -0
  110. package/dist/tui/state/actions.js +62 -0
  111. package/dist/tui/state/actions.js.map +1 -0
  112. package/dist/tui/state/persist.d.ts +114 -0
  113. package/dist/tui/state/persist.d.ts.map +1 -0
  114. package/dist/tui/state/persist.js +187 -0
  115. package/dist/tui/state/persist.js.map +1 -0
  116. package/dist/tui/state/poll.d.ts +99 -0
  117. package/dist/tui/state/poll.d.ts.map +1 -0
  118. package/dist/tui/state/poll.js +160 -0
  119. package/dist/tui/state/poll.js.map +1 -0
  120. package/dist/tui/state/reducer.d.ts +16 -0
  121. package/dist/tui/state/reducer.d.ts.map +1 -0
  122. package/dist/tui/state/reducer.js +363 -0
  123. package/dist/tui/state/reducer.js.map +1 -0
  124. package/dist/tui/state/store.d.ts +37 -0
  125. package/dist/tui/state/store.d.ts.map +1 -0
  126. package/dist/tui/state/store.js +84 -0
  127. package/dist/tui/state/store.js.map +1 -0
  128. package/dist/tui/suspend.d.ts +17 -0
  129. package/dist/tui/suspend.d.ts.map +1 -0
  130. package/dist/tui/suspend.js +33 -0
  131. package/dist/tui/suspend.js.map +1 -0
  132. package/dist/tui/ui/App.d.ts +44 -0
  133. package/dist/tui/ui/App.d.ts.map +1 -0
  134. package/dist/tui/ui/App.js +105 -0
  135. package/dist/tui/ui/App.js.map +1 -0
  136. package/dist/tui/ui/frame.d.ts +86 -0
  137. package/dist/tui/ui/frame.d.ts.map +1 -0
  138. package/dist/tui/ui/frame.js +42 -0
  139. package/dist/tui/ui/frame.js.map +1 -0
  140. package/dist/tui/ui/lines.d.ts +92 -0
  141. package/dist/tui/ui/lines.d.ts.map +1 -0
  142. package/dist/tui/ui/lines.js +94 -0
  143. package/dist/tui/ui/lines.js.map +1 -0
  144. package/dist/tui/ui/shell/chrome.d.ts +61 -0
  145. package/dist/tui/ui/shell/chrome.d.ts.map +1 -0
  146. package/dist/tui/ui/shell/chrome.js +272 -0
  147. package/dist/tui/ui/shell/chrome.js.map +1 -0
  148. package/dist/tui/ui/shell/widgets.d.ts +116 -0
  149. package/dist/tui/ui/shell/widgets.d.ts.map +1 -0
  150. package/dist/tui/ui/shell/widgets.js +183 -0
  151. package/dist/tui/ui/shell/widgets.js.map +1 -0
  152. package/dist/tui/ui/views/about.d.ts +20 -0
  153. package/dist/tui/ui/views/about.d.ts.map +1 -0
  154. package/dist/tui/ui/views/about.js +40 -0
  155. package/dist/tui/ui/views/about.js.map +1 -0
  156. package/dist/tui/ui/views/all.d.ts +17 -0
  157. package/dist/tui/ui/views/all.d.ts.map +1 -0
  158. package/dist/tui/ui/views/all.js +17 -0
  159. package/dist/tui/ui/views/all.js.map +1 -0
  160. package/dist/tui/ui/views/dashboard.d.ts +211 -0
  161. package/dist/tui/ui/views/dashboard.d.ts.map +1 -0
  162. package/dist/tui/ui/views/dashboard.js +651 -0
  163. package/dist/tui/ui/views/dashboard.js.map +1 -0
  164. package/dist/tui/ui/views/help.d.ts +17 -0
  165. package/dist/tui/ui/views/help.d.ts.map +1 -0
  166. package/dist/tui/ui/views/help.js +65 -0
  167. package/dist/tui/ui/views/help.js.map +1 -0
  168. package/dist/tui/ui/views/index.d.ts +42 -0
  169. package/dist/tui/ui/views/index.d.ts.map +1 -0
  170. package/dist/tui/ui/views/index.js +42 -0
  171. package/dist/tui/ui/views/index.js.map +1 -0
  172. package/dist/tui/ui/views/input.d.ts +6 -0
  173. package/dist/tui/ui/views/input.d.ts.map +1 -0
  174. package/dist/tui/ui/views/input.js +494 -0
  175. package/dist/tui/ui/views/input.js.map +1 -0
  176. package/dist/tui/ui/views/launch.d.ts +16 -0
  177. package/dist/tui/ui/views/launch.d.ts.map +1 -0
  178. package/dist/tui/ui/views/launch.js +43 -0
  179. package/dist/tui/ui/views/launch.js.map +1 -0
  180. package/dist/tui/ui/views/refusal.d.ts +20 -0
  181. package/dist/tui/ui/views/refusal.d.ts.map +1 -0
  182. package/dist/tui/ui/views/refusal.js +47 -0
  183. package/dist/tui/ui/views/refusal.js.map +1 -0
  184. package/dist/tui/ui/views/repos.d.ts +10 -0
  185. package/dist/tui/ui/views/repos.d.ts.map +1 -0
  186. package/dist/tui/ui/views/repos.js +93 -0
  187. package/dist/tui/ui/views/repos.js.map +1 -0
  188. package/dist/tui/ui/views/task.d.ts +17 -0
  189. package/dist/tui/ui/views/task.d.ts.map +1 -0
  190. package/dist/tui/ui/views/task.js +309 -0
  191. package/dist/tui/ui/views/task.js.map +1 -0
  192. package/dist/tui/ui/views/wordmark.d.ts +15 -0
  193. package/dist/tui/ui/views/wordmark.d.ts.map +1 -0
  194. package/dist/tui/ui/views/wordmark.js +50 -0
  195. package/dist/tui/ui/views/wordmark.js.map +1 -0
  196. package/dist/tui/ui/views/workspaces.d.ts +17 -0
  197. package/dist/tui/ui/views/workspaces.d.ts.map +1 -0
  198. package/dist/tui/ui/views/workspaces.js +127 -0
  199. package/dist/tui/ui/views/workspaces.js.map +1 -0
  200. package/dist/tui/ui/widgets/leaf-editor.d.ts +58 -0
  201. package/dist/tui/ui/widgets/leaf-editor.d.ts.map +1 -0
  202. package/dist/tui/ui/widgets/leaf-editor.js +119 -0
  203. package/dist/tui/ui/widgets/leaf-editor.js.map +1 -0
  204. package/dist/tui/ui/widgets/logs.d.ts +99 -0
  205. package/dist/tui/ui/widgets/logs.d.ts.map +1 -0
  206. package/dist/tui/ui/widgets/logs.js +291 -0
  207. package/dist/tui/ui/widgets/logs.js.map +1 -0
  208. package/dist/tui/ui/widgets/reads.d.ts +62 -0
  209. package/dist/tui/ui/widgets/reads.d.ts.map +1 -0
  210. package/dist/tui/ui/widgets/reads.js +122 -0
  211. package/dist/tui/ui/widgets/reads.js.map +1 -0
  212. package/dist/tui/ui/widgets/runs.d.ts +51 -0
  213. package/dist/tui/ui/widgets/runs.d.ts.map +1 -0
  214. package/dist/tui/ui/widgets/runs.js +86 -0
  215. package/dist/tui/ui/widgets/runs.js.map +1 -0
  216. package/dist/tui/ui/widgets/tree.d.ts +149 -0
  217. package/dist/tui/ui/widgets/tree.d.ts.map +1 -0
  218. package/dist/tui/ui/widgets/tree.js +584 -0
  219. package/dist/tui/ui/widgets/tree.js.map +1 -0
  220. package/package.json +22 -12
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * The about view — the wordmark, the version, the server, the repository,
7
+ * the terminal, the state file and the licence.
8
+ *
9
+ * @packageDocumentation
10
+ */
11
+ import { formatInt } from '../../render/text.js';
12
+ import { blank, b, d, t } from '../lines.js';
13
+ import { wordmark } from './wordmark.js';
14
+ /** The about body. */
15
+ export function renderAbout(state, ctx, facts) {
16
+ const width = ctx.layout.columns;
17
+ const session = state.session;
18
+ const row = (label, value) => [t(' '), d(label.padEnd(11)), t(value)];
19
+ const server = session === null ? '—'
20
+ : session.kind === 'local'
21
+ ? `embedded @elaraai/e3-api-server ${ctx.version} · ${session.apiUrl} · repo ${session.repo}`
22
+ : `${session.apiUrl}${session.repo !== null ? ` · repo ${session.repo}` : ''}${session.identity !== null ? ` · signed in as ${session.identity}` : ''}`;
23
+ const repository = session === null ? '—'
24
+ : `${session.path ?? session.target}${facts !== null ? ` · ${formatInt(facts.objects)} objects · ${facts.packages} packages · ${facts.workspaces} workspaces` : ''}`;
25
+ return [
26
+ blank(width),
27
+ ...wordmark(ctx.g.tabL === '[').map(line => [t(' '), b(line, 'brand')]),
28
+ blank(width),
29
+ [t(' '), b(`e3-ui ${ctx.version}`)],
30
+ blank(width),
31
+ row('server', server),
32
+ row('repository', repository),
33
+ row('terminal', ctx.about.terminal),
34
+ row('state', ctx.about.statePath),
35
+ row('licence', 'AGPL-3.0-or-later · commercial licence available'),
36
+ ];
37
+ }
38
+ /** The about hints. */
39
+ export const aboutHints = { left: 'esc back', right: '' };
40
+ //# sourceMappingURL=about.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"about.js","sourceRoot":"","sources":["../../../../src/tui/ui/views/about.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAA6B,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAA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,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;QACzE,KAAK,CAAC,KAAK,CAAC;QACZ,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QACrC,KAAK,CAAC,KAAK,CAAC;QACZ,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC;QACrB,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC;QAC7B,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC;QACnC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC;QACjC,GAAG,CAAC,SAAS,EAAE,kDAAkD,CAAC;KACrE,CAAC;AACN,CAAC;AAED,uBAAuB;AACvB,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * Every view module, imported for its registrations (renderer, list
7
+ * model, controller hooks). The app entry and the test harness import
8
+ * this once.
9
+ *
10
+ * @packageDocumentation
11
+ */
12
+ import './dashboard.js';
13
+ import './repos.js';
14
+ import './workspaces.js';
15
+ import './task.js';
16
+ import './input.js';
17
+ //# sourceMappingURL=all.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"all.d.ts","sourceRoot":"","sources":["../../../../src/tui/ui/views/all.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,OAAO,gBAAgB,CAAC;AACxB,OAAO,YAAY,CAAC;AACpB,OAAO,iBAAiB,CAAC;AACzB,OAAO,WAAW,CAAC;AACnB,OAAO,YAAY,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * Every view module, imported for its registrations (renderer, list
7
+ * model, controller hooks). The app entry and the test harness import
8
+ * this once.
9
+ *
10
+ * @packageDocumentation
11
+ */
12
+ import './dashboard.js';
13
+ import './repos.js';
14
+ import './workspaces.js';
15
+ import './task.js';
16
+ import './input.js';
17
+ //# sourceMappingURL=all.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"all.js","sourceRoot":"","sources":["../../../../src/tui/ui/views/all.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,OAAO,gBAAgB,CAAC;AACxB,OAAO,YAAY,CAAC;AACpB,OAAO,iBAAiB,CAAC;AACzB,OAAO,WAAW,CAAC;AACnB,OAAO,YAAY,CAAC"}
@@ -0,0 +1,211 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * The workspace dashboard — the title line, then one scrolling column:
7
+ * the TASKS / DATASETS counts with the accounted bar, the execution panel
8
+ * (the last run's failures, or the live per-task feed while it runs), the
9
+ * tasks table and the inputs table. `⏎` opens the task, the input, or a
10
+ * failed task's logs. Status detail is inline (`✗ failed · exit 2`,
11
+ * `◐ waiting`, `◔ in-progress`).
12
+ *
13
+ * The column is built in two steps. {@link dashboardModel} derives what
14
+ * follows from the data and the width — the counts, the events the panel
15
+ * lists, the latest event per task, the dataset map, the fitted table
16
+ * plans, each row's cells and where each selectable row sits — once per
17
+ * data change: a single-entry cache keyed on the identity of the status,
18
+ * the execution, the dataset list, the task list, the width and the
19
+ * breakpoint. {@link dashboardLines} then renders only the lines on
20
+ * screen, restyling the selected row and stamping the clock and the
21
+ * spinner. A selection move costs the window, not the workspace.
22
+ *
23
+ * @packageDocumentation
24
+ */
25
+ import type { DataflowEvent, WorkspaceStatusResult } from '@elaraai/e3-api-client';
26
+ import type { Glyphs } from '../../render/glyphs.js';
27
+ import { type Breakpoint, type ColumnSpec } from '../../render/layout.js';
28
+ import type { ExecutionData, NavOp, TuiState } from '../../state/actions.js';
29
+ import { type Controller } from '../../controller.js';
30
+ import type { Hit, Pane } from '../frame.js';
31
+ import { type Line, type RenderCtx } from '../lines.js';
32
+ import { type TableRow } from '../shell/widgets.js';
33
+ type TaskInfo = WorkspaceStatusResult['tasks'][number];
34
+ /** What the column builder needs from the render context. */
35
+ export interface DashboardCtx {
36
+ g: Glyphs;
37
+ now: number;
38
+ columns: number;
39
+ bp: Breakpoint;
40
+ spinner: number;
41
+ }
42
+ /** A selectable row of the column: what `⏎` opens, and its line index. */
43
+ export interface DashboardRow {
44
+ kind: 'logs' | 'task' | 'input';
45
+ name: string;
46
+ line: number;
47
+ }
48
+ /** Event rows the execution panel shows at most. */
49
+ export declare const MAX_EVENT_ROWS = 6;
50
+ /**
51
+ * The column builder's context from a render context.
52
+ *
53
+ * @param state - The store state
54
+ * @param ctx - The render context
55
+ * @returns The dashboard context
56
+ */
57
+ export declare function dashboardCtx(state: TuiState, ctx: RenderCtx): DashboardCtx;
58
+ /** The dashboard title line: ` main ● DEPLOYED · demand@1.4.2 · deployed 3d ago · lock: none`. */
59
+ export declare function dashboardTitle(state: TuiState, ws: string, ctx: RenderCtx): Line;
60
+ /**
61
+ * The accounted bar: one cell per task (sampled past 40), lowest first —
62
+ * `✗` failed / error, `▁` ready, `▃` waiting, `▅` in progress, `▇`
63
+ * up-to-date — and `N of M accounted`, where a task is accounted for once
64
+ * the dataflow has touched it (anything but `ready`).
65
+ *
66
+ * @param tasks - The workspace's tasks
67
+ * @param g - The glyph set
68
+ * @returns The bar's spans and the counts
69
+ */
70
+ export declare function accountedBar(tasks: readonly TaskInfo[], g: Glyphs): {
71
+ bar: Line;
72
+ accounted: number;
73
+ total: number;
74
+ };
75
+ /**
76
+ * The latest event of each task, in order of first appearance.
77
+ *
78
+ * @param events - The execution's events
79
+ * @returns One event per task
80
+ */
81
+ export declare function latestPerTask(events: readonly DataflowEvent[]): DataflowEvent[];
82
+ /** A task's row: the cells that follow from the data, and what the `SIZE · LAST RUN` cell is stamped from per frame. */
83
+ export interface TaskRowModel {
84
+ task: TaskInfo;
85
+ /** The cells the data decides (`size` is stamped at render — it carries the clock and the spinner while the task runs). */
86
+ cells: TableRow['cells'];
87
+ /** The output's size text (`12.1 MB` / `—`). */
88
+ size: string;
89
+ /** The task's latest dataflow event, if any. */
90
+ event: DataflowEvent | undefined;
91
+ }
92
+ /**
93
+ * The data-derived column: everything that follows from the workspace's
94
+ * data and the terminal width. Built by {@link dashboardModel}, rendered
95
+ * by {@link dashboardLines}.
96
+ *
97
+ * @property status - The status the model follows (undefined → `placeholder` is the whole column)
98
+ * @property placeholder - The column while there is no status: nothing deployed, an error, or loading
99
+ * @property counts - The counts block (the two stat groups and the accounted bar)
100
+ * @property execution - The execution the panel shows
101
+ * @property live - Whether the panel shows the live feed
102
+ * @property done - Events past `start` (the live feed's `N of M tasks`)
103
+ * @property events - The events the panel lists: the latest per task — the last ones while live, the failures after
104
+ * @property latest - The latest event per task
105
+ * @property taskPlan - The tasks table's fitted column plan
106
+ * @property tasks - The task rows
107
+ * @property inputPlan - The inputs table's fitted column plan
108
+ * @property inputs - The input rows
109
+ * @property inputNames - The input names, in row order
110
+ * @property rows - The selectable rows in column order (failures, tasks, inputs) with their line indices
111
+ * @property total - Lines in the column
112
+ * @property panelAt - The execution panel's first line
113
+ * @property tasksAt - The TASKS section line (the header follows, then the rows)
114
+ * @property inputsAt - The INPUTS section line
115
+ */
116
+ export interface DashboardModel {
117
+ status: WorkspaceStatusResult | undefined;
118
+ placeholder: Line[];
119
+ counts: Line[];
120
+ execution: ExecutionData | undefined;
121
+ live: boolean;
122
+ done: number;
123
+ events: DataflowEvent[];
124
+ latest: ReadonlyMap<string, DataflowEvent>;
125
+ taskPlan: ColumnSpec[];
126
+ tasks: TaskRowModel[];
127
+ inputPlan: ColumnSpec[];
128
+ inputs: TableRow[];
129
+ inputNames: string[];
130
+ rows: DashboardRow[];
131
+ total: number;
132
+ panelAt: number;
133
+ tasksAt: number;
134
+ inputsAt: number;
135
+ }
136
+ /**
137
+ * The dashboard model for a workspace — built once per data change and
138
+ * returned as the same object until the status, the execution, the
139
+ * dataset list, the task list, the width or the breakpoint changes. The
140
+ * clock, the spinner and the selection are not inputs: they restyle lines
141
+ * at render ({@link dashboardLines}).
142
+ *
143
+ * @param state - The store state
144
+ * @param ws - The workspace
145
+ * @param dctx - The dashboard context (its width and breakpoint key the cache)
146
+ * @returns The model
147
+ */
148
+ export declare function dashboardModel(state: TuiState, ws: string, dctx: DashboardCtx): DashboardModel;
149
+ /**
150
+ * The column's lines in `[top, top + visible)` — the window the screen
151
+ * shows, rendered from the model with the selected row restyled and the
152
+ * clock and the spinner stamped in.
153
+ *
154
+ * @param model - The dashboard model
155
+ * @param dctx - The dashboard context
156
+ * @param sel - The selected row index
157
+ * @param top - The first line
158
+ * @param visible - Lines in the window
159
+ * @returns The lines (fewer when the column ends first)
160
+ */
161
+ export declare function dashboardLines(model: DashboardModel, dctx: DashboardCtx, sel: number, top: number, visible: number): Line[];
162
+ /**
163
+ * The dashboard body: the fixed title, then the column window with its
164
+ * scrollbar — plus the window's clickable rows and pane for the mouse.
165
+ *
166
+ * @param state - The store state
167
+ * @param ctx - The render context
168
+ * @returns The body lines, hits and pane
169
+ */
170
+ export declare function renderDashboard(state: TuiState, ctx: RenderCtx): {
171
+ body: Line[];
172
+ hits: Hit[];
173
+ pane: Pane | null;
174
+ };
175
+ /**
176
+ * Scrolls the column by lines (the wheel), or to a line (a thumb drag),
177
+ * keeping the selection inside the window.
178
+ *
179
+ * @param state - The store state
180
+ * @param controller - The controller
181
+ * @param to - `{ delta }` lines, or `{ top }` absolute
182
+ */
183
+ export declare function scrollDashboard(state: TuiState, controller: Controller, to: {
184
+ delta: number;
185
+ } | {
186
+ top: number;
187
+ }): void;
188
+ /** The dashboard hints. */
189
+ export declare function dashboardHints(state: TuiState, ctx: RenderCtx): {
190
+ left: string;
191
+ right: string;
192
+ };
193
+ /**
194
+ * Selects a row of the column (by index) and scrolls it into view.
195
+ *
196
+ * @param state - The store state
197
+ * @param controller - The controller
198
+ * @param index - The row index
199
+ */
200
+ export declare function selectDashboardRow(state: TuiState, controller: Controller, index: number): void;
201
+ /**
202
+ * Moves the selection (or scrolls the column when it has no selectable
203
+ * rows); page moves step by a window of lines.
204
+ *
205
+ * @param state - The store state
206
+ * @param controller - The controller
207
+ * @param op - The navigation
208
+ */
209
+ export declare function moveDashboard(state: TuiState, controller: Controller, op: NavOp): void;
210
+ export {};
211
+ //# sourceMappingURL=dashboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../../../src/tui/ui/views/dashboard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEnF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAA0C,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGlH,OAAO,KAAK,EAAa,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIxF,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEzE,OAAO,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAqC,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC3F,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