@marinoscar/platform-cli 0.1.0-next.23 → 0.1.0-next.24

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 (186) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/engine/commands/node.d.ts.map +1 -1
  3. package/dist/engine/commands/node.js +8 -0
  4. package/dist/engine/commands/node.js.map +1 -1
  5. package/dist/engine/create-cli.d.ts +21 -0
  6. package/dist/engine/create-cli.d.ts.map +1 -1
  7. package/dist/engine/create-cli.js +11 -0
  8. package/dist/engine/create-cli.js.map +1 -1
  9. package/dist/engine/index.d.ts +18 -1
  10. package/dist/engine/index.d.ts.map +1 -1
  11. package/dist/engine/index.js +9 -0
  12. package/dist/engine/index.js.map +1 -1
  13. package/dist/engine/node/daemon-channels.d.ts +66 -0
  14. package/dist/engine/node/daemon-channels.d.ts.map +1 -0
  15. package/dist/engine/node/daemon-channels.js +65 -0
  16. package/dist/engine/node/daemon-channels.js.map +1 -0
  17. package/dist/engine/node/daemon.d.ts.map +1 -1
  18. package/dist/engine/node/daemon.js +52 -0
  19. package/dist/engine/node/daemon.js.map +1 -1
  20. package/dist/engine/node/executors/credential-hygiene.d.ts +1 -1
  21. package/dist/engine/node/executors/credential-hygiene.d.ts.map +1 -1
  22. package/dist/engine/node/executors/credential-hygiene.js +23 -2
  23. package/dist/engine/node/executors/credential-hygiene.js.map +1 -1
  24. package/dist/engine/node/executors/index.d.ts +52 -7
  25. package/dist/engine/node/executors/index.d.ts.map +1 -1
  26. package/dist/engine/node/executors/index.js +14 -0
  27. package/dist/engine/node/executors/index.js.map +1 -1
  28. package/dist/engine/node/executors/registry.d.ts.map +1 -1
  29. package/dist/engine/node/executors/registry.js +13 -2
  30. package/dist/engine/node/executors/registry.js.map +1 -1
  31. package/dist/engine/node/ipc-protocol.d.ts +49 -2
  32. package/dist/engine/node/ipc-protocol.d.ts.map +1 -1
  33. package/dist/engine/node/ipc-protocol.js +39 -0
  34. package/dist/engine/node/ipc-protocol.js.map +1 -1
  35. package/dist/engine/node/lifecycle.js +2 -1
  36. package/dist/engine/node/lifecycle.js.map +1 -1
  37. package/dist/engine/node/logger.d.ts +13 -0
  38. package/dist/engine/node/logger.d.ts.map +1 -1
  39. package/dist/engine/node/logger.js.map +1 -1
  40. package/dist/engine/node/memory-watchdog.d.ts +11 -0
  41. package/dist/engine/node/memory-watchdog.d.ts.map +1 -1
  42. package/dist/engine/node/memory-watchdog.js +28 -4
  43. package/dist/engine/node/memory-watchdog.js.map +1 -1
  44. package/dist/engine/node/node-dashboard-source.d.ts +46 -19
  45. package/dist/engine/node/node-dashboard-source.d.ts.map +1 -1
  46. package/dist/engine/node/node-dashboard-source.js +70 -102
  47. package/dist/engine/node/node-dashboard-source.js.map +1 -1
  48. package/dist/engine/node/node-engine.d.ts +7 -1
  49. package/dist/engine/node/node-engine.d.ts.map +1 -1
  50. package/dist/engine/node/node-engine.js +81 -8
  51. package/dist/engine/node/node-engine.js.map +1 -1
  52. package/dist/engine/node/runtime-state.d.ts +24 -0
  53. package/dist/engine/node/runtime-state.d.ts.map +1 -0
  54. package/dist/engine/node/runtime-state.js +19 -0
  55. package/dist/engine/node/runtime-state.js.map +1 -0
  56. package/dist/engine/node/runtime-tuning.d.ts +111 -2
  57. package/dist/engine/node/runtime-tuning.d.ts.map +1 -1
  58. package/dist/engine/node/runtime-tuning.js +133 -4
  59. package/dist/engine/node/runtime-tuning.js.map +1 -1
  60. package/dist/engine/node/service.d.ts.map +1 -1
  61. package/dist/engine/node/service.js +4 -0
  62. package/dist/engine/node/service.js.map +1 -1
  63. package/dist/engine/node/start.d.ts +7 -0
  64. package/dist/engine/node/start.d.ts.map +1 -1
  65. package/dist/engine/node/start.js +33 -1
  66. package/dist/engine/node/start.js.map +1 -1
  67. package/dist/engine/node/worker-env-aliases.d.ts +39 -0
  68. package/dist/engine/node/worker-env-aliases.d.ts.map +1 -0
  69. package/dist/engine/node/worker-env-aliases.js +126 -0
  70. package/dist/engine/node/worker-env-aliases.js.map +1 -0
  71. package/dist/engine/node/worker-env-table.d.ts.map +1 -1
  72. package/dist/engine/node/worker-env-table.js +4 -1
  73. package/dist/engine/node/worker-env-table.js.map +1 -1
  74. package/dist/engine/node/worker-env.d.ts +13 -1
  75. package/dist/engine/node/worker-env.d.ts.map +1 -1
  76. package/dist/engine/node/worker-env.js +8 -0
  77. package/dist/engine/node/worker-env.js.map +1 -1
  78. package/dist/engine/registries.d.ts.map +1 -1
  79. package/dist/engine/registries.js +5 -0
  80. package/dist/engine/registries.js.map +1 -1
  81. package/dist/engine/tui/app.d.ts.map +1 -1
  82. package/dist/engine/tui/app.js +15 -2
  83. package/dist/engine/tui/app.js.map +1 -1
  84. package/dist/engine/tui/builtin-screens.d.ts.map +1 -1
  85. package/dist/engine/tui/builtin-screens.js +6 -0
  86. package/dist/engine/tui/builtin-screens.js.map +1 -1
  87. package/dist/engine/tui/dashboard/index.d.ts +8 -0
  88. package/dist/engine/tui/dashboard/index.d.ts.map +1 -0
  89. package/dist/engine/tui/dashboard/index.js +5 -0
  90. package/dist/engine/tui/dashboard/index.js.map +1 -0
  91. package/dist/engine/tui/dashboard/jobs-insights.d.ts +145 -0
  92. package/dist/engine/tui/dashboard/jobs-insights.d.ts.map +1 -0
  93. package/dist/engine/tui/dashboard/jobs-insights.js +63 -0
  94. package/dist/engine/tui/dashboard/jobs-insights.js.map +1 -0
  95. package/dist/engine/tui/dashboard/node-embedded.d.ts +33 -0
  96. package/dist/engine/tui/dashboard/node-embedded.d.ts.map +1 -0
  97. package/dist/engine/tui/dashboard/node-embedded.js +81 -0
  98. package/dist/engine/tui/dashboard/node-embedded.js.map +1 -0
  99. package/dist/engine/tui/dashboard/source.d.ts +274 -0
  100. package/dist/engine/tui/dashboard/source.d.ts.map +1 -0
  101. package/dist/engine/tui/dashboard/source.js +351 -0
  102. package/dist/engine/tui/dashboard/source.js.map +1 -0
  103. package/dist/engine/tui/dashboard/use-dashboard.d.ts +23 -0
  104. package/dist/engine/tui/dashboard/use-dashboard.d.ts.map +1 -0
  105. package/dist/engine/tui/dashboard/use-dashboard.js +32 -0
  106. package/dist/engine/tui/dashboard/use-dashboard.js.map +1 -0
  107. package/dist/engine/tui/layout.d.ts +20 -0
  108. package/dist/engine/tui/layout.d.ts.map +1 -1
  109. package/dist/engine/tui/layout.js +7 -0
  110. package/dist/engine/tui/layout.js.map +1 -1
  111. package/dist/engine/tui/menu-registry.d.ts +124 -0
  112. package/dist/engine/tui/menu-registry.d.ts.map +1 -0
  113. package/dist/engine/tui/menu-registry.js +151 -0
  114. package/dist/engine/tui/menu-registry.js.map +1 -0
  115. package/dist/engine/tui/menu-tree.d.ts +179 -0
  116. package/dist/engine/tui/menu-tree.d.ts.map +1 -0
  117. package/dist/engine/tui/menu-tree.js +250 -0
  118. package/dist/engine/tui/menu-tree.js.map +1 -0
  119. package/dist/engine/tui/screen-registry.d.ts +1 -1
  120. package/dist/engine/tui/screen-registry.d.ts.map +1 -1
  121. package/dist/engine/tui/screen-registry.js +2 -1
  122. package/dist/engine/tui/screen-registry.js.map +1 -1
  123. package/dist/engine/tui/screens/jobs.d.ts +12 -0
  124. package/dist/engine/tui/screens/jobs.d.ts.map +1 -0
  125. package/dist/engine/tui/screens/jobs.js +72 -0
  126. package/dist/engine/tui/screens/jobs.js.map +1 -0
  127. package/dist/engine/tui/screens/menu.d.ts +4 -1
  128. package/dist/engine/tui/screens/menu.d.ts.map +1 -1
  129. package/dist/engine/tui/screens/menu.js +85 -22
  130. package/dist/engine/tui/screens/menu.js.map +1 -1
  131. package/dist/engine/tui/screens/node.d.ts.map +1 -1
  132. package/dist/engine/tui/screens/node.js +82 -37
  133. package/dist/engine/tui/screens/node.js.map +1 -1
  134. package/dist/engine/tui/screens/not-logged-in.d.ts +12 -0
  135. package/dist/engine/tui/screens/not-logged-in.d.ts.map +1 -0
  136. package/dist/engine/tui/screens/not-logged-in.js +14 -0
  137. package/dist/engine/tui/screens/not-logged-in.js.map +1 -0
  138. package/dist/engine/tui/scroll-box.d.ts +15 -0
  139. package/dist/engine/tui/scroll-box.d.ts.map +1 -1
  140. package/dist/engine/tui/scroll-box.js +10 -0
  141. package/dist/engine/tui/scroll-box.js.map +1 -1
  142. package/dist/engine/tui/ui/active-items.d.ts +40 -0
  143. package/dist/engine/tui/ui/active-items.d.ts.map +1 -0
  144. package/dist/engine/tui/ui/active-items.js +38 -0
  145. package/dist/engine/tui/ui/active-items.js.map +1 -0
  146. package/dist/engine/tui/ui/event-log.d.ts +58 -0
  147. package/dist/engine/tui/ui/event-log.d.ts.map +1 -0
  148. package/dist/engine/tui/ui/event-log.js +32 -0
  149. package/dist/engine/tui/ui/event-log.js.map +1 -0
  150. package/dist/engine/tui/ui/index.d.ts +20 -0
  151. package/dist/engine/tui/ui/index.d.ts.map +1 -0
  152. package/dist/engine/tui/ui/index.js +14 -0
  153. package/dist/engine/tui/ui/index.js.map +1 -0
  154. package/dist/engine/tui/ui/meter-legend.d.ts +26 -0
  155. package/dist/engine/tui/ui/meter-legend.d.ts.map +1 -0
  156. package/dist/engine/tui/ui/meter-legend.js +25 -0
  157. package/dist/engine/tui/ui/meter-legend.js.map +1 -0
  158. package/dist/engine/tui/ui/run-summary.d.ts +58 -0
  159. package/dist/engine/tui/ui/run-summary.d.ts.map +1 -0
  160. package/dist/engine/tui/ui/run-summary.js +29 -0
  161. package/dist/engine/tui/ui/run-summary.js.map +1 -0
  162. package/dist/engine/tui/ui/segment-meter.d.ts +72 -0
  163. package/dist/engine/tui/ui/segment-meter.d.ts.map +1 -0
  164. package/dist/engine/tui/ui/segment-meter.js +128 -0
  165. package/dist/engine/tui/ui/segment-meter.js.map +1 -0
  166. package/dist/engine/tui/ui/status-line.d.ts +42 -0
  167. package/dist/engine/tui/ui/status-line.d.ts.map +1 -0
  168. package/dist/engine/tui/ui/status-line.js +35 -0
  169. package/dist/engine/tui/ui/status-line.js.map +1 -0
  170. package/dist/engine/tui/ui/tone.d.ts +46 -0
  171. package/dist/engine/tui/ui/tone.d.ts.map +1 -0
  172. package/dist/engine/tui/ui/tone.js +48 -0
  173. package/dist/engine/tui/ui/tone.js.map +1 -0
  174. package/dist/node/index.d.ts +2 -2
  175. package/dist/node/index.d.ts.map +1 -1
  176. package/dist/node/index.js +1 -1
  177. package/dist/node/index.js.map +1 -1
  178. package/dist/tui/index.d.ts +2 -2
  179. package/dist/tui/index.d.ts.map +1 -1
  180. package/dist/tui/index.js +1 -1
  181. package/dist/tui/index.js.map +1 -1
  182. package/dist/tui/ui/index.d.ts +2 -0
  183. package/dist/tui/ui/index.d.ts.map +1 -0
  184. package/dist/tui/ui/index.js +10 -0
  185. package/dist/tui/ui/index.js.map +1 -0
  186. package/package.json +8 -3
@@ -0,0 +1,179 @@
1
+ import { type TuiMenuLabel, type TuiMenuNode } from './menu-registry.js';
2
+ import { type TuiMenuContext } from './screen-registry.js';
3
+ import type { TuiColor, TuiTheme } from './theme.js';
4
+ /**
5
+ * What the tree needs to know about a screen: its route, its root label and its order.
6
+ *
7
+ * @stability experimental
8
+ */
9
+ export interface TuiMenuScreenInfo {
10
+ /** The screen's route id. */
11
+ route: string;
12
+ /** Its root menu label. */
13
+ label: TuiMenuLabel;
14
+ /** Its root menu order. */
15
+ order: number;
16
+ }
17
+ /**
18
+ * What both kinds of built tree node carry.
19
+ *
20
+ * @stability experimental
21
+ */
22
+ export interface TuiMenuTreeNodeBase {
23
+ /** The node id (`screen:<route>` for a synthesised root entry). */
24
+ id: string;
25
+ /** The section it sits in (`root` for a top-level node). */
26
+ parentId: string;
27
+ /** The label, or a function of the login state. */
28
+ label: TuiMenuLabel;
29
+ /** Position among its siblings. */
30
+ order: number;
31
+ /** The node's own logged-out flag; `undefined` inherits from the parent. */
32
+ loggedOut: boolean | undefined;
33
+ /** Hidden once logged in. */
34
+ hideWhenLoggedIn: boolean;
35
+ /** A theme token, colour name or colour; resolve it with {@link tuiMenuColor}. */
36
+ color: TuiColor;
37
+ }
38
+ /**
39
+ * A section in the built tree.
40
+ *
41
+ * @stability experimental
42
+ */
43
+ export interface TuiMenuTreeSection extends TuiMenuTreeNodeBase {
44
+ /** Discriminant. */
45
+ kind: 'section';
46
+ /** Replaces the default hint under the breadcrumb. */
47
+ subtitle: string | undefined;
48
+ /** Children, sorted by order then id. */
49
+ children: TuiMenuTreeNode[];
50
+ }
51
+ /**
52
+ * An entry in the built tree.
53
+ *
54
+ * @stability experimental
55
+ */
56
+ export interface TuiMenuTreeEntry extends TuiMenuTreeNodeBase {
57
+ /** Discriminant. */
58
+ kind: 'entry';
59
+ /** The screen it opens. */
60
+ route: string;
61
+ /** Rendered with a trailing `…`. */
62
+ ellipsis: boolean;
63
+ /** An explicit `requiresLogin`; `undefined` derives it from the logged-out rule. */
64
+ requiresLogin: boolean | undefined;
65
+ /** True for a screen no node references, shown at the root as it always was. */
66
+ synthesised: boolean;
67
+ }
68
+ /**
69
+ * A node of the built tree.
70
+ *
71
+ * @stability experimental
72
+ */
73
+ export type TuiMenuTreeNode = TuiMenuTreeSection | TuiMenuTreeEntry;
74
+ /**
75
+ * The built menu: the root section plus an index by id.
76
+ *
77
+ * @stability experimental
78
+ */
79
+ export interface TuiMenuTree {
80
+ /** The implicit root section (id `root`). */
81
+ readonly root: TuiMenuTreeSection;
82
+ /** Every section by id, the root included. */
83
+ readonly sections: ReadonlyMap<string, TuiMenuTreeSection>;
84
+ /** Every entry (synthesised ones too), in tree order. */
85
+ readonly entries: readonly TuiMenuTreeEntry[];
86
+ /** True when the app registered at least one menu node. */
87
+ readonly customised: boolean;
88
+ }
89
+ /** Display name of the root in a breadcrumb. */
90
+ export declare const TUI_MENU_HOME_LABEL = "Home";
91
+ /**
92
+ * Builds the menu tree from registered nodes and the screens.
93
+ *
94
+ * Every screen that no entry opens becomes a root entry with its own label and
95
+ * order (visible when logged out, no login gate), so a CLI with no menu nodes
96
+ * lists exactly the screens it always did. A screen that an entry opens is
97
+ * left out of the root, so it appears once. Children sort by `order`, then id.
98
+ * References are assumed valid (`createCli` checks them when it freezes); an
99
+ * unresolvable node is placed at the root rather than lost.
100
+ *
101
+ * @param nodes - The registered nodes.
102
+ * @param screens - Every screen (built-in and app) with its root label and order.
103
+ * @returns The tree.
104
+ * @stability experimental
105
+ */
106
+ export declare function buildTuiMenuTree(nodes: readonly TuiMenuNode[], screens: readonly TuiMenuScreenInfo[]): TuiMenuTree;
107
+ /**
108
+ * The children of a section a user in this login state sees, in order.
109
+ *
110
+ * `loggedOut` CASCADES: a node with no explicit flag takes its parent's
111
+ * effective value, so a child added to an offline section cannot vanish for
112
+ * logged-out users by forgetting the flag; an explicit `false` opts one out.
113
+ * `hideWhenLoggedIn` hides a node once logged in. A section shows only when it
114
+ * has at least one visible descendant entry.
115
+ *
116
+ * @param sectionId - A section id; `root` for the top.
117
+ * @param context - The login state.
118
+ * @param tree - The tree (default: built from the registry, with built-in labels unresolved).
119
+ * @returns The visible children; empty for an unknown section.
120
+ * @stability experimental
121
+ */
122
+ export declare function visibleTuiMenuChildren(sectionId: string, context: TuiMenuContext, tree?: TuiMenuTree): TuiMenuTreeNode[];
123
+ /**
124
+ * The text of a menu line: the label for the login state, then the
125
+ * decorations, which only this function adds: a section ends in ` ▸`, an
126
+ * entry with `ellipsis` in `…`, and a 1-based `position` of 1 to 9 gets an
127
+ * `N. ` accelerator (later positions get equal-width padding so the column
128
+ * stays aligned).
129
+ *
130
+ * @param node - A tree node.
131
+ * @param position - The node's 1-based place among the visible items; omit for no prefix.
132
+ * @param context - The login state for a label function (default logged out).
133
+ * @returns The line.
134
+ * @stability experimental
135
+ */
136
+ export declare function tuiMenuItemLabel(node: TuiMenuTreeNode, position?: number, context?: TuiMenuContext): string;
137
+ /**
138
+ * The path from the root to a section: `Home › Node › Settings`.
139
+ *
140
+ * @param sectionId - A section id; `root` or an unknown id gives `Home`.
141
+ * @param context - The login state for label functions (default logged out).
142
+ * @param tree - The tree (default: built from the registry).
143
+ * @returns The labels joined with ` › `.
144
+ * @stability experimental
145
+ */
146
+ export declare function tuiBreadcrumb(sectionId: string, context?: TuiMenuContext, tree?: TuiMenuTree): string;
147
+ /**
148
+ * The parent of a section (`root` for a top-level one and for the root itself).
149
+ *
150
+ * @param sectionId - A section id.
151
+ * @param tree - The tree (default: built from the registry).
152
+ * @returns The parent section id.
153
+ * @stability experimental
154
+ */
155
+ export declare function tuiParentSectionId(sectionId: string, tree?: TuiMenuTree): string;
156
+ /**
157
+ * Whether opening a route while logged out should show the "not logged in"
158
+ * notice. True only when every entry that opens the route requires a login
159
+ * (`requiresLogin`, else "not visible when logged out"); a route no entry
160
+ * opens, or a synthesised root entry, never does.
161
+ *
162
+ * @param route - The screen route.
163
+ * @param tree - The tree (default: built from the registry).
164
+ * @returns Whether the route is login-gated.
165
+ * @stability experimental
166
+ */
167
+ export declare function tuiRouteRequiresLogin(route: string, tree?: TuiMenuTree): boolean;
168
+ /**
169
+ * Resolves a node's `color` for drawing: a theme token name or a basic colour
170
+ * name maps through the theme (so an app's palette applies and `NO_COLOR`
171
+ * yields no colour); any other string is used as written unless colour is off.
172
+ *
173
+ * @param theme - The app theme.
174
+ * @param color - The node's `color`.
175
+ * @returns A colour for ink, or `undefined` for none.
176
+ * @stability experimental
177
+ */
178
+ export declare function tuiMenuColor(theme: TuiTheme, color: TuiColor): TuiColor;
179
+ //# sourceMappingURL=menu-tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-tree.d.ts","sourceRoot":"","sources":["../../../src/engine/tui/menu-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAiD,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC1G,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAcrD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,K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/** Display name of the root in a breadcrumb. */
4
+ export const TUI_MENU_HOME_LABEL = 'Home';
5
+ function byOrder(a, b) {
6
+ return a.order - b.order || (a.id < b.id ? -1 : a.id > b.id ? 1 : 0);
7
+ }
8
+ /**
9
+ * Builds the menu tree from registered nodes and the screens.
10
+ *
11
+ * Every screen that no entry opens becomes a root entry with its own label and
12
+ * order (visible when logged out, no login gate), so a CLI with no menu nodes
13
+ * lists exactly the screens it always did. A screen that an entry opens is
14
+ * left out of the root, so it appears once. Children sort by `order`, then id.
15
+ * References are assumed valid (`createCli` checks them when it freezes); an
16
+ * unresolvable node is placed at the root rather than lost.
17
+ *
18
+ * @param nodes - The registered nodes.
19
+ * @param screens - Every screen (built-in and app) with its root label and order.
20
+ * @returns The tree.
21
+ * @stability experimental
22
+ */
23
+ export function buildTuiMenuTree(nodes, screens) {
24
+ const sections = new Map();
25
+ const root = {
26
+ kind: 'section',
27
+ id: TUI_MENU_ROOT,
28
+ parentId: TUI_MENU_ROOT,
29
+ label: TUI_MENU_HOME_LABEL,
30
+ order: 0,
31
+ loggedOut: undefined,
32
+ hideWhenLoggedIn: false,
33
+ color: undefined,
34
+ subtitle: undefined,
35
+ children: [],
36
+ };
37
+ sections.set(root.id, root);
38
+ for (const node of nodes) {
39
+ if (node.kind !== 'section')
40
+ continue;
41
+ sections.set(node.id, {
42
+ kind: 'section',
43
+ id: node.id,
44
+ parentId: node.parent ?? TUI_MENU_ROOT,
45
+ label: node.label,
46
+ order: node.order,
47
+ loggedOut: node.loggedOut,
48
+ hideWhenLoggedIn: node.hideWhenLoggedIn === true,
49
+ color: node.color,
50
+ subtitle: node.subtitle,
51
+ children: [],
52
+ });
53
+ }
54
+ const entries = [];
55
+ const place = (child) => {
56
+ (sections.get(child.parentId) ?? root).children.push(child);
57
+ };
58
+ for (const section of sections.values()) {
59
+ if (section !== root)
60
+ place(section);
61
+ }
62
+ for (const node of nodes) {
63
+ if (node.kind !== 'entry')
64
+ continue;
65
+ const entry = {
66
+ kind: 'entry',
67
+ id: node.id,
68
+ parentId: node.parent ?? TUI_MENU_ROOT,
69
+ label: node.label,
70
+ order: node.order,
71
+ loggedOut: node.loggedOut,
72
+ hideWhenLoggedIn: node.hideWhenLoggedIn === true,
73
+ color: node.color,
74
+ route: node.route,
75
+ ellipsis: node.ellipsis === true,
76
+ requiresLogin: node.requiresLogin,
77
+ synthesised: false,
78
+ };
79
+ entries.push(entry);
80
+ place(entry);
81
+ }
82
+ const referenced = new Set(entries.map((entry) => entry.route));
83
+ for (const screen of screens) {
84
+ if (referenced.has(screen.route))
85
+ continue;
86
+ const entry = {
87
+ kind: 'entry',
88
+ // Not a valid registered id, so it can never collide with one.
89
+ id: `screen:${screen.route}`,
90
+ parentId: TUI_MENU_ROOT,
91
+ label: screen.label,
92
+ order: screen.order,
93
+ loggedOut: true,
94
+ hideWhenLoggedIn: false,
95
+ color: undefined,
96
+ route: screen.route,
97
+ ellipsis: false,
98
+ requiresLogin: false,
99
+ synthesised: true,
100
+ };
101
+ entries.push(entry);
102
+ place(entry);
103
+ }
104
+ for (const section of sections.values())
105
+ section.children.sort(byOrder);
106
+ return { root, sections, entries, customised: nodes.length > 0 };
107
+ }
108
+ /** The tree from the registry, with built-in labels unknown (their route stands in): for pure callers and tests. */
109
+ function defaultTree() {
110
+ const screens = [
111
+ ...BUILTIN_TUI_SCREENS.map(({ route, order }) => ({ route, order, label: route })),
112
+ ...listRegisteredTuiScreens(),
113
+ ];
114
+ return buildTuiMenuTree(listTuiMenuNodes(), screens);
115
+ }
116
+ /** The effective logged-out flag: the nearest explicit one, walking up; false at the root. */
117
+ function effectiveLoggedOut(node, tree) {
118
+ let current = node;
119
+ const guard = new Set();
120
+ while (current !== undefined && !guard.has(current.id)) {
121
+ if (current.loggedOut !== undefined)
122
+ return current.loggedOut;
123
+ guard.add(current.id);
124
+ current = current.id === TUI_MENU_ROOT ? undefined : tree.sections.get(current.parentId);
125
+ }
126
+ return false;
127
+ }
128
+ /**
129
+ * The children of a section a user in this login state sees, in order.
130
+ *
131
+ * `loggedOut` CASCADES: a node with no explicit flag takes its parent's
132
+ * effective value, so a child added to an offline section cannot vanish for
133
+ * logged-out users by forgetting the flag; an explicit `false` opts one out.
134
+ * `hideWhenLoggedIn` hides a node once logged in. A section shows only when it
135
+ * has at least one visible descendant entry.
136
+ *
137
+ * @param sectionId - A section id; `root` for the top.
138
+ * @param context - The login state.
139
+ * @param tree - The tree (default: built from the registry, with built-in labels unresolved).
140
+ * @returns The visible children; empty for an unknown section.
141
+ * @stability experimental
142
+ */
143
+ export function visibleTuiMenuChildren(sectionId, context, tree = defaultTree()) {
144
+ const section = tree.sections.get(sectionId);
145
+ if (section === undefined)
146
+ return [];
147
+ return section.children.filter((child) => {
148
+ if (context.loggedIn && child.hideWhenLoggedIn)
149
+ return false;
150
+ if (child.kind === 'entry')
151
+ return effectiveLoggedOut(child, tree) || context.loggedIn;
152
+ return visibleTuiMenuChildren(child.id, context, tree).length > 0;
153
+ });
154
+ }
155
+ /**
156
+ * The text of a menu line: the label for the login state, then the
157
+ * decorations, which only this function adds: a section ends in ` ▸`, an
158
+ * entry with `ellipsis` in `…`, and a 1-based `position` of 1 to 9 gets an
159
+ * `N. ` accelerator (later positions get equal-width padding so the column
160
+ * stays aligned).
161
+ *
162
+ * @param node - A tree node.
163
+ * @param position - The node's 1-based place among the visible items; omit for no prefix.
164
+ * @param context - The login state for a label function (default logged out).
165
+ * @returns The line.
166
+ * @stability experimental
167
+ */
168
+ export function tuiMenuItemLabel(node, position, context = { loggedIn: false }) {
169
+ const text = typeof node.label === 'function' ? node.label(context) : node.label;
170
+ const base = node.kind === 'section' ? `${text} ▸` : node.ellipsis ? `${text}…` : text;
171
+ if (position === undefined)
172
+ return base;
173
+ return `${position >= 1 && position <= 9 ? `${position}. ` : ' '}${base}`;
174
+ }
175
+ /**
176
+ * The path from the root to a section: `Home › Node › Settings`.
177
+ *
178
+ * @param sectionId - A section id; `root` or an unknown id gives `Home`.
179
+ * @param context - The login state for label functions (default logged out).
180
+ * @param tree - The tree (default: built from the registry).
181
+ * @returns The labels joined with ` › `.
182
+ * @stability experimental
183
+ */
184
+ export function tuiBreadcrumb(sectionId, context = { loggedIn: false }, tree = defaultTree()) {
185
+ const trail = [];
186
+ const guard = new Set();
187
+ let current = tree.sections.get(sectionId);
188
+ while (current !== undefined && current.id !== TUI_MENU_ROOT && !guard.has(current.id)) {
189
+ guard.add(current.id);
190
+ trail.unshift(typeof current.label === 'function' ? current.label(context) : current.label);
191
+ current = tree.sections.get(current.parentId);
192
+ }
193
+ return [TUI_MENU_HOME_LABEL, ...trail].join(' › ');
194
+ }
195
+ /**
196
+ * The parent of a section (`root` for a top-level one and for the root itself).
197
+ *
198
+ * @param sectionId - A section id.
199
+ * @param tree - The tree (default: built from the registry).
200
+ * @returns The parent section id.
201
+ * @stability experimental
202
+ */
203
+ export function tuiParentSectionId(sectionId, tree = defaultTree()) {
204
+ return tree.sections.get(sectionId)?.parentId ?? TUI_MENU_ROOT;
205
+ }
206
+ /**
207
+ * Whether opening a route while logged out should show the "not logged in"
208
+ * notice. True only when every entry that opens the route requires a login
209
+ * (`requiresLogin`, else "not visible when logged out"); a route no entry
210
+ * opens, or a synthesised root entry, never does.
211
+ *
212
+ * @param route - The screen route.
213
+ * @param tree - The tree (default: built from the registry).
214
+ * @returns Whether the route is login-gated.
215
+ * @stability experimental
216
+ */
217
+ export function tuiRouteRequiresLogin(route, tree = defaultTree()) {
218
+ const opening = tree.entries.filter((entry) => entry.route === route);
219
+ if (opening.length === 0)
220
+ return false;
221
+ return opening.every((entry) => entry.requiresLogin ?? !effectiveLoggedOut(entry, tree));
222
+ }
223
+ const NAMED_COLOURS = {
224
+ red: 'error',
225
+ green: 'success',
226
+ yellow: 'warning',
227
+ blue: 'info',
228
+ gray: 'dim',
229
+ grey: 'dim',
230
+ magenta: 'accent',
231
+ cyan: 'primary',
232
+ };
233
+ const THEME_TOKENS = ['primary', 'success', 'warning', 'error', 'info', 'dim', 'accent', 'banner'];
234
+ /**
235
+ * Resolves a node's `color` for drawing: a theme token name or a basic colour
236
+ * name maps through the theme (so an app's palette applies and `NO_COLOR`
237
+ * yields no colour); any other string is used as written unless colour is off.
238
+ *
239
+ * @param theme - The app theme.
240
+ * @param color - The node's `color`.
241
+ * @returns A colour for ink, or `undefined` for none.
242
+ * @stability experimental
243
+ */
244
+ export function tuiMenuColor(theme, color) {
245
+ if (color === undefined || !theme.color)
246
+ return undefined;
247
+ const token = THEME_TOKENS.includes(color) ? color : NAMED_COLOURS[color];
248
+ return token === undefined ? color : theme[token];
249
+ }
250
+ //# sourceMappingURL=menu-tree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-tree.js","sourceRoot":"","sources":["../../../src/engine/tui/menu-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,aAAa,GAGd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAuB,MAAM,sBAAsB,CAAC;AA0G1G,gDAAgD;AAChD,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAE1C,SAAS,OAAO,CAAC,CAAgC,EAAE,CAAgC;IACjF,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAA6B,EAAE,OAAqC;IACnG,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA8B,CAAC;IACvD,MAAM,IAAI,GAAuB;QAC/B,IAAI,EAAE,SAAS;QACf,EAAE,EAAE,aAAa;QACjB,QAAQ,EAAE,aAAa;QACv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AC"}
@@ -52,7 +52,7 @@ export interface TuiScreenRegistration extends TuiScreenOrder {
52
52
  }
53
53
  /**
54
54
  * The platform's own screens, in menu order: `login` 10, `invoke` 20,
55
- * `status` 30, `node` 40, `deploy` 50, `logout` 60. An app screen picks an
55
+ * `status` 30, `jobs` 35, `node` 40, `deploy` 50, `logout` 60. An app screen picks an
56
56
  * `order` relative to these. Their components are attached when the TUI
57
57
  * starts; the ids and orders are here so a duplicate is caught without
58
58
  * loading the UI.
@@ -1 +1 @@
1
- {"version":3,"file":"screen-registry.d.ts","sourceRoot":"","sources":["../../../src/engine/tui/screen-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAqB3C;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,kGAAkG;IAClG,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,sFAAsF;IACtF,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,4EAA4E;IAC5E,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,8FAA8F;IAC9F,KAAK,EAAE,MAAM,CAAC;IACd,4FAA4F;IAC5F,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D,wDAAwD;IACxD,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,cAAc,KAAK,MAAM,CAAC,CAAC;IACtD;;;;OAIG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;IACtD;;;OAGG;IACH,IAAI,CAAC,EAAE,CAAC,MAAM,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CACnE;AAKD;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,EAAE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C,EAAE,CAAC,MAAM,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CACnE;AAKD;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,cAAc,EAQvD,CAAC;AAOH;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,qBAAqB,GAAG,IAAI,CAyBrE;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,SAAS,qBAAqB,EAAE,CAE3E;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,cAAc,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,CAEnF;AAED,yDAAyD;AACzD,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAExD;AAED,wCAAwC;AACxC,wBAAgB,8BAA8B,IAAI,IAAI,CAGrD"}
@@ -2,7 +2,7 @@
2
2
  const RESERVED_ROUTES = ['menu', 'quit'];
3
3
  /**
4
4
  * The platform's own screens, in menu order: `login` 10, `invoke` 20,
5
- * `status` 30, `node` 40, `deploy` 50, `logout` 60. An app screen picks an
5
+ * `status` 30, `jobs` 35, `node` 40, `deploy` 50, `logout` 60. An app screen picks an
6
6
  * `order` relative to these. Their components are attached when the TUI
7
7
  * starts; the ids and orders are here so a duplicate is caught without
8
8
  * loading the UI.
@@ -13,6 +13,7 @@ export const BUILTIN_TUI_SCREENS = Object.freeze([
13
13
  { route: 'login', order: 10 },
14
14
  { route: 'invoke', order: 20 },
15
15
  { route: 'status', order: 30 },
16
+ { route: 'jobs', order: 35 },
16
17
  { route: 'node', order: 40 },
17
18
  { route: 'deploy', order: 50 },
18
19
  { route: 'logout', order: 60 },
@@ -1 +1 @@
1
- {"version":3,"file":"screen-registry.js","sourceRoot":"","sources":["../../../src/engine/tui/screen-registry.ts"],"names":[],"mappings":"AA4EA,4CAA4C;AAC5C,MAAM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;AAChH,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,uBAAuB,CAAC,EAAU;IAChD,QAAQ,GAAG,EAAE,CAAC;AAChB,CAAC;AAED,wCAAwC;AACxC,MAAM,UAAU,8BAA8B;IAC5C,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;IACtB,QAAQ,GAAG,SAAS,CAAC;AACvB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type JobsDashboardData, type JobsPollResult } from '../dashboard/jobs-insights.js';
3
+ import { DashboardSource } from '../dashboard/source.js';
4
+ import type { TuiScreenProps } from '../screen-registry.js';
5
+ /** How often the queue is re-read. */
6
+ export declare const JOBS_POLL_INTERVAL_MS = 5000;
7
+ type JobsSource = DashboardSource<JobsDashboardData, JobsPollResult>;
8
+ /** Builds the screen's source for a server and token. Exported for tests. */
9
+ export declare function createJobsSource(serverUrl: string, token: string, intervalMs?: number): JobsSource;
10
+ export declare function JobsScreen({ onDone }: TuiScreenProps): ReactNode;
11
+ export {};
12
+ //# sourceMappingURL=jobs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jobs.d.ts","sourceRoot":"","sources":["../../../../src/engine/tui/screens/jobs.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAKhD,OAAO,EAA0C,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpI,OAAO,EAAE,eAAe,EAAsC,MAAM,wBAAwB,CAAC;AAI7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAiB5D,sCAAsC;AACtC,eAAO,MAAM,qBAAqB,OAAQ,CAAC;AAE3C,KAAK,UAAU,GAAG,eAAe,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC;AAErE,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,GAAE,MAA8B,GAAG,UAAU,CAGzH;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE,cAAc,GAAG,SAAS,CA0FhE"}
@@ -0,0 +1,72 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text, useInput } from 'ink';
3
+ import Spinner from 'ink-spinner';
4
+ import { useMemo } from 'react';
5
+ import { ApiClient, resolveApiBaseUrl } from '../../api-client.js';
6
+ import { resolveConfig } from '../../config.js';
7
+ import { formatDuration } from '../../node/node-dashboard-source.js';
8
+ import { fetchJobsInsights, jobsInsightsReducer } from '../dashboard/jobs-insights.js';
9
+ import { DashboardSource, pollFeed } from '../dashboard/source.js';
10
+ import { useDashboard } from '../dashboard/use-dashboard.js';
11
+ import { useTuiTheme } from '../context.js';
12
+ import { ErrorNotice, Field, Frame } from '../layout.js';
13
+ import { ScrollBox } from '../scroll-box.js';
14
+ import { textColor } from '../theme.js';
15
+ // =============================================================================
16
+ // The jobs-queue screen (RETRO-G1.3, epic #1064)
17
+ // =============================================================================
18
+ //
19
+ // A server-side dashboard on the same pattern as the worker screen: a pure
20
+ // reducer (`jobsInsightsReducer`) fed by `pollFeed` over the platform's admin
21
+ // jobs API. It uses the caller's own credential, so the SERVER decides who may
22
+ // see it (`jobs:read`): a 403 renders a notice here, never a crash, and the
23
+ // poll keeps going so a grant takes effect without reopening the screen.
24
+ //
25
+ // Read-only: it shows the queue and sends nothing but GETs.
26
+ // =============================================================================
27
+ /** How often the queue is re-read. */
28
+ export const JOBS_POLL_INTERVAL_MS = 5_000;
29
+ /** Builds the screen's source for a server and token. Exported for tests. */
30
+ export function createJobsSource(serverUrl, token, intervalMs = JOBS_POLL_INTERVAL_MS) {
31
+ const api = new ApiClient({ baseUrl: resolveApiBaseUrl(serverUrl), token });
32
+ return new DashboardSource(jobsInsightsReducer, pollFeed(fetchJobsInsights(api), { intervalMs }));
33
+ }
34
+ export function JobsScreen({ onDone }) {
35
+ const theme = useTuiTheme();
36
+ const source = useMemo(() => {
37
+ try {
38
+ const { serverUrl, token } = resolveConfig();
39
+ return serverUrl === undefined || token === undefined ? undefined : createJobsSource(serverUrl, token);
40
+ }
41
+ catch {
42
+ return undefined;
43
+ }
44
+ }, []);
45
+ const state = useDashboard(source);
46
+ useInput((_input, key) => {
47
+ if (key.escape)
48
+ onDone();
49
+ });
50
+ const lines = useMemo(() => {
51
+ const eta = state?.insights?.eta ?? [];
52
+ return eta.map((row) => `${row.label.padEnd(28)} ${String(row.pending).padStart(6)} pending ${String(row.running).padStart(4)} running` +
53
+ ` ${row.remaining === 0 ? 'done' : `~${formatDuration(row.estimatedMs)}`}`);
54
+ }, [state?.insights]);
55
+ if (source === undefined || state === undefined) {
56
+ return (_jsx(Frame, { title: "Jobs queue", hints: ['esc back'], children: _jsx(ErrorNotice, { message: "Not logged in.", hint: "Choose Login from the menu first." }) }));
57
+ }
58
+ if (state.forbidden !== undefined) {
59
+ return (_jsx(Frame, { title: "Jobs queue", hints: ['esc back'], children: _jsx(Text, { ...textColor(theme.warning), children: state.forbidden }) }));
60
+ }
61
+ if (state.stats === undefined || state.insights === undefined) {
62
+ return (_jsx(Frame, { title: "Jobs queue", hints: ['esc back'], children: _jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsxs(Text, { children: [_jsx(Spinner, { type: "dots" }), " ", state.error ?? 'Reading the queue…'] }), state.error !== undefined ? _jsx(ErrorNotice, { message: state.error }) : null] }) }));
63
+ }
64
+ const { stats, insights } = state;
65
+ const overall = insights.history.overall;
66
+ return (_jsx(Frame, { title: "Jobs queue", hints: ['↑↓ scroll', 'esc back'], children: _jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Field, { label: "Status", value: `${stats.byStatus.pending} pending · ${stats.byStatus.running} running · ` +
67
+ `${stats.byStatus.succeeded} succeeded · ${stats.byStatus.failed} failed` }), _jsx(Field, { label: "Backing off", value: String(stats.scheduled) }), _jsx(Field, { label: "Stuck", value: `${stats.stuckRunning} (over ${stats.stuckThresholdMinutes} min)`, ...(stats.stuckRunning > 0 ? textColor(theme.error) : {}) }), _jsx(Field, { label: "Throughput", value: `${overall.throughputPerMin.toFixed(1)}/min · p50 ${ms(overall.p50Ms)} · p95 ${ms(overall.p95Ms)} (${insights.windowDays}d)` }), _jsx(Field, { label: "Updated", value: state.updatedAt ?? '—', dim: true })] }), state.error !== undefined ? _jsxs(Text, { ...textColor(theme.warning), children: ["Last refresh failed: ", state.error] }) : null, _jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, children: "Estimated completion" }), lines.length === 0 ? _jsx(Text, { dimColor: true, children: "Nothing queued." }) : _jsx(ScrollBox, { lines: lines, reservedRows: 16, isActive: true })] })] }) }));
68
+ }
69
+ function ms(value) {
70
+ return value === null ? '—' : formatDuration(value);
71
+ }
72
+ //# sourceMappingURL=jobs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jobs.js","sourceRoot":"","sources":["../../../../src/engine/tui/screens/jobs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,OAAO,EAAkB,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAA+C,MAAM,+BAA+B,CAAC;AACpI,OAAO,EAAE,eAAe,EAAE,QAAQ,EAA4B,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;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c,CAAC,KAAK,CAAC,CAAC;AACtD,CAAC"}
@@ -1,9 +1,12 @@
1
1
  import { type ReactNode } from 'react';
2
+ import { type TuiMenuTree } from '../menu-tree.js';
2
3
  import type { Route } from '../routes.js';
3
4
  import type { TuiMenuContext, TuiScreenRegistration } from '../screen-registry.js';
4
5
  export interface MenuScreenProps {
5
6
  onSelect: (route: Route) => void;
6
7
  onQuit: () => void;
8
+ /** The tree to draw; defaults to the registered nodes and screens. Tests only. */
9
+ tree?: TuiMenuTree | undefined;
7
10
  }
8
11
  /** One entry of the menu list. */
9
12
  export interface MenuItem {
@@ -18,5 +21,5 @@ export interface MenuItem {
18
21
  * without rendering.
19
22
  */
20
23
  export declare function buildMenuItems(screens: readonly TuiScreenRegistration[], context: TuiMenuContext): MenuItem[];
21
- export declare function MenuScreen({ onSelect, onQuit }: MenuScreenProps): ReactNode;
24
+ export declare function MenuScreen({ onSelect, onQuit, tree: treeProp }: MenuScreenProps): ReactNode;
22
25
  //# sourceMappingURL=menu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../../src/engine/tui/screens/menu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAMhD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAsBnF,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,kCAAkC;AAClC,MAAM,WAAW,QAAQ;IACvB,kFAAkF;IAClF,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAgB,cAA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