@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,32 @@
1
+ import { useEffect, useSyncExternalStore } from 'react';
2
+ /**
3
+ * Subscribes a screen to a {@link DashboardSource}: starts it on mount, stops
4
+ * it on unmount, and re-renders on every new state.
5
+ *
6
+ * The source is started and stopped by the hook, so build it once (in a
7
+ * `useMemo` or a ref) and pass the same instance on every render. Stopping
8
+ * on unmount is what keeps a reconnect timer or a poll from outliving the
9
+ * screen and holding the ink process open.
10
+ *
11
+ * @typeParam S - The dashboard's data.
12
+ * @typeParam E - One event.
13
+ * @param source - The source to follow; `undefined` renders nothing and starts nothing.
14
+ * @returns The current state (data plus connection fields), or `undefined` with no source.
15
+ * @stability experimental
16
+ * @example
17
+ * ```tsx
18
+ * const source = useMemo(() => new DashboardSource(jobsInsightsReducer, pollFeed(fetchJobs, { intervalMs: 5000 })), []);
19
+ * const state = useDashboard(source);
20
+ * ```
21
+ */
22
+ export function useDashboard(source) {
23
+ const state = useSyncExternalStore((listener) => source?.subscribe(listener) ?? (() => { }), () => source?.getState());
24
+ useEffect(() => {
25
+ if (source === undefined)
26
+ return;
27
+ void source.start();
28
+ return () => source.stop();
29
+ }, [source]);
30
+ return state;
31
+ }
32
+ //# sourceMappingURL=use-dashboard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-dashboard.js","sourceRoot":"","sources":["../../../../src/engine/tui/dashboard/use-dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAIxD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,YAAY,CAAO,MAAyC;IAC1E,MAAM,KAAK,GAAG,oBAAoB,CAChC,CAAC,QAAQ,EAAE,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,EACvD,GAAG,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,CACzB,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO;QACjC,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC;QACpB,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -15,6 +15,7 @@ import { type ReactNode } from 'react';
15
15
  * refusal — a user in a tmux split or an 80-column window halved is a normal
16
16
  * case, and a TUI that says "your terminal is too small" to someone who can
17
17
  * plainly see text on it is a TUI they stop using.
18
+ * @stability experimental
18
19
  */
19
20
  export declare const NARROW_COLUMNS = 56;
20
21
  /**
@@ -22,10 +23,18 @@ export declare const NARROW_COLUMNS = 56;
22
23
  *
23
24
  * Thirty is about the width of a phone-sized SSH session. There is no useful
24
25
  * layout left at this size, only content, so that is all that is drawn.
26
+ * @stability experimental
25
27
  */
26
28
  export declare const TINY_COLUMNS = 30;
29
+ /**
30
+ * The terminal size and the width tier it falls in.
31
+ *
32
+ * @stability experimental
33
+ */
27
34
  export interface TerminalSize {
35
+ /** Width in cells (80 when the terminal will not say). */
28
36
  columns: number;
37
+ /** Height in rows (24 when the terminal will not say). */
29
38
  rows: number;
30
39
  /** `columns < NARROW_COLUMNS`. Drop borders and side padding. */
31
40
  narrow: boolean;
@@ -45,6 +54,7 @@ export interface TerminalSize {
45
54
  * The listener is removed on unmount. `process.stdout` is a long-lived emitter
46
55
  * shared with the whole runtime, so a leaked listener here outlives the UI and
47
56
  * fires against unmounted components for the rest of the process's life.
57
+ * @stability experimental
48
58
  */
49
59
  export declare function useTerminalSize(): TerminalSize;
50
60
  /**
@@ -65,11 +75,17 @@ export declare function useTerminalSize(): TerminalSize;
65
75
  * `true` and defeat the whole thing.
66
76
  */
67
77
  export declare function useIsMounted(): () => boolean;
78
+ /**
79
+ * Props of {@link Frame}.
80
+ *
81
+ * @stability experimental
82
+ */
68
83
  export interface FrameProps {
69
84
  /** Screen name, shown in the header. */
70
85
  title: string;
71
86
  /** Key hints for the bottom line, e.g. `['↑↓ move', 'enter select']`. */
72
87
  hints?: string[];
88
+ /** The screen content. */
73
89
  children: ReactNode;
74
90
  }
75
91
  /**
@@ -87,6 +103,7 @@ export interface FrameProps {
87
103
  * so the right-hand edge wraps onto the next line and every frame ends with a
88
104
  * row of orphaned box characters. Letting the box size itself and constraining
89
105
  * only the CONTENT is what keeps the frame intact at every width.
106
+ * @stability experimental
90
107
  */
91
108
  export declare function Frame({ title, hints, children }: FrameProps): ReactNode;
92
109
  /**
@@ -99,6 +116,7 @@ export declare function Frame({ title, hints, children }: FrameProps): ReactNode
99
116
  *
100
117
  * Separators are dropped when narrow: at that width the hints wrap, and a
101
118
  * wrapped line beginning with a lone dot reads as corruption.
119
+ * @stability experimental
102
120
  */
103
121
  export declare function KeyHints({ hints }: {
104
122
  hints: string[];
@@ -110,6 +128,7 @@ export declare function KeyHints({ hints }: {
110
128
  * ink measures a Box in cells and these labels are ASCII — padding is exact,
111
129
  * one flex node cheaper per row, and immune to the width-collapse described in
112
130
  * `Frame`.
131
+ * @stability experimental
113
132
  */
114
133
  export declare function Field({ label, value, color, dim, }: {
115
134
  label: string;
@@ -124,6 +143,7 @@ export declare function Field({ label, value, color, dim, }: {
124
143
  * diagnosis. The messages this CLI produces already carry their own remedy
125
144
  * (see errors.ts), so `hint` is for the extra sentence a SCREEN can add and the
126
145
  * error itself cannot — "press r to try again".
146
+ * @stability experimental
127
147
  */
128
148
  export declare function ErrorNotice({ message, hint, }: {
129
149
  message: string;
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/engine/tui/layout.tsx"],"names":[],"mappings":"AACA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAiBpE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC;;;;;GAKG;AACH,eAAO,MAAM,YAAY,KAAK,CAAC;AAe/B,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,MAAM,EAAE,OAAO,CAAC;IAChB,mEAAmE;IACnE,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAqC9C;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,IAAI,MAAM,OAAO,CAe5C;AAMD,MAAM,WAAW,UAAU;IACzB,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,UAAU,GAAG,SAAS,CAwCvE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,SAAS,CAgBlE;AAED;;;;;;;GAOG;AACH,wBAAgB,KAAK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AAC;CACrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,UAAU,GAAG,SAAS,CAwCvE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,SAAS,CAgBlE;AAED;;;;;;;;GAQG;AACH,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,KAAK,EACL,KAAK,EACL,GAAG,GACJ,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC3B,GAAG,SAAS,CAYZ;AAID;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,IAAI,GACL,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B,GAAG,SAAS,CAUZ"}
@@ -30,6 +30,7 @@ import { textColor } from './theme.js';
30
30
  * refusal — a user in a tmux split or an 80-column window halved is a normal
31
31
  * case, and a TUI that says "your terminal is too small" to someone who can
32
32
  * plainly see text on it is a TUI they stop using.
33
+ * @stability experimental
33
34
  */
34
35
  export const NARROW_COLUMNS = 56;
35
36
  /**
@@ -37,6 +38,7 @@ export const NARROW_COLUMNS = 56;
37
38
  *
38
39
  * Thirty is about the width of a phone-sized SSH session. There is no useful
39
40
  * layout left at this size, only content, so that is all that is drawn.
41
+ * @stability experimental
40
42
  */
41
43
  export const TINY_COLUMNS = 30;
42
44
  /**
@@ -64,6 +66,7 @@ const FALLBACK_ROWS = 24;
64
66
  * The listener is removed on unmount. `process.stdout` is a long-lived emitter
65
67
  * shared with the whole runtime, so a leaked listener here outlives the UI and
66
68
  * fires against unmounted components for the rest of the process's life.
69
+ * @stability experimental
67
70
  */
68
71
  export function useTerminalSize() {
69
72
  const { stdout } = useStdout();
@@ -147,6 +150,7 @@ export function useIsMounted() {
147
150
  * so the right-hand edge wraps onto the next line and every frame ends with a
148
151
  * row of orphaned box characters. Letting the box size itself and constraining
149
152
  * only the CONTENT is what keeps the frame intact at every width.
153
+ * @stability experimental
150
154
  */
151
155
  export function Frame({ title, hints, children }) {
152
156
  const { narrow, tiny } = useTerminalSize();
@@ -172,6 +176,7 @@ export function Frame({ title, hints, children }) {
172
176
  *
173
177
  * Separators are dropped when narrow: at that width the hints wrap, and a
174
178
  * wrapped line beginning with a lone dot reads as corruption.
179
+ * @stability experimental
175
180
  */
176
181
  export function KeyHints({ hints }) {
177
182
  const { narrow } = useTerminalSize();
@@ -187,6 +192,7 @@ export function KeyHints({ hints }) {
187
192
  * ink measures a Box in cells and these labels are ASCII — padding is exact,
188
193
  * one flex node cheaper per row, and immune to the width-collapse described in
189
194
  * `Frame`.
195
+ * @stability experimental
190
196
  */
191
197
  export function Field({ label, value, color, dim, }) {
192
198
  return (_jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: label.padEnd(FIELD_LABEL_WIDTH) }), _jsx(Text, { ...(color === undefined ? {} : { color }), ...(dim === true ? { dimColor: true } : {}), children: value })] }));
@@ -199,6 +205,7 @@ const FIELD_LABEL_WIDTH = 10;
199
205
  * diagnosis. The messages this CLI produces already carry their own remedy
200
206
  * (see errors.ts), so `hint` is for the extra sentence a SCREEN can add and the
201
207
  * error itself cannot — "press r to try again".
208
+ * @stability experimental
202
209
  */
203
210
  export function ErrorNotice({ message, hint, }) {
204
211
  const theme = useTuiTheme();
@@ -1 +1 @@
1
- {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../src/engine/tui/layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAC3C,O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AE,CAAC;IAC5B,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACzB,MAAC,IAAI,IAAC,IAAI,WAAK,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,aAClC,KAAK,CAAC,MAAM,CAAC,KAAK,OAAG,OAAO,IACxB,EACN,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,QAAQ,kBAAE,IAAI,GAAQ,IACrD,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,124 @@
1
+ import { type TuiMenuContext } from './screen-registry.js';
2
+ import type { TuiColor } from './theme.js';
3
+ /**
4
+ * The id of the implicit root section. Reserved.
5
+ *
6
+ * @stability experimental
7
+ */
8
+ export declare const TUI_MENU_ROOT = "root";
9
+ /**
10
+ * The deepest a section may nest (a section directly under the root is level 1).
11
+ *
12
+ * @stability experimental
13
+ */
14
+ export declare const TUI_MENU_MAX_DEPTH = 4;
15
+ /**
16
+ * A menu label: fixed, or a function of the login state.
17
+ *
18
+ * @stability experimental
19
+ */
20
+ export type TuiMenuLabel = string | ((context: TuiMenuContext) => string);
21
+ /**
22
+ * Fields both node kinds share.
23
+ *
24
+ * @stability experimental
25
+ */
26
+ export interface TuiMenuNodeBase {
27
+ /** Unique across sections and entries: lowercase `[a-z][a-z0-9-]*`; `root` is reserved. */
28
+ id: string;
29
+ /** The section it sits in. Default `root`. */
30
+ parent?: string | undefined;
31
+ /** What the menu shows; a function gets `{ loggedIn }`. */
32
+ label: TuiMenuLabel;
33
+ /** Position among its siblings: lower first; ties sort by id. */
34
+ order: number;
35
+ /**
36
+ * Visible when logged out. Omitted means INHERITED from the nearest ancestor
37
+ * that sets it (default false: hidden until login). An explicit `false`
38
+ * opts one child out of an offline section.
39
+ */
40
+ loggedOut?: boolean | undefined;
41
+ /** Hide the node once logged in (a "Login" entry that moves elsewhere). */
42
+ hideWhenLoggedIn?: boolean | undefined;
43
+ /** A theme token name (`error`, `success`, ...) or a plain colour such as `red`. Presentation only. */
44
+ color?: TuiColor;
45
+ }
46
+ /**
47
+ * A submenu.
48
+ *
49
+ * @stability experimental
50
+ */
51
+ export interface TuiMenuSection extends TuiMenuNodeBase {
52
+ /** Discriminant. */
53
+ kind: 'section';
54
+ /** Shown under the breadcrumb instead of the default hint. */
55
+ subtitle?: string | undefined;
56
+ }
57
+ /**
58
+ * A menu line that opens a registered screen.
59
+ *
60
+ * @stability experimental
61
+ */
62
+ export interface TuiMenuEntry extends TuiMenuNodeBase {
63
+ /** Discriminant. */
64
+ kind: 'entry';
65
+ /** A registered screen route (built-in or `registerTuiScreen`). */
66
+ route: string;
67
+ /** The screen asks for a further input step first; rendered with a trailing `…`. */
68
+ ellipsis?: boolean | undefined;
69
+ /**
70
+ * Opening the screen while logged out shows the shared "not logged in"
71
+ * notice instead. Default: true unless the entry is visible when logged out.
72
+ */
73
+ requiresLogin?: boolean | undefined;
74
+ }
75
+ /**
76
+ * A node of the menu tree.
77
+ *
78
+ * @stability experimental
79
+ */
80
+ export type TuiMenuNode = TuiMenuSection | TuiMenuEntry;
81
+ /**
82
+ * Adds a section or an entry to the TUI menu tree.
83
+ *
84
+ * Unknown `parent` and unknown `route` are rejected when `createCli` builds
85
+ * the CLI (so registration order is free), together with cycles and nesting
86
+ * deeper than {@link TUI_MENU_MAX_DEPTH}.
87
+ *
88
+ * @param node - A section (`kind: 'section'`) or an entry (`kind: 'entry'`, with a `route`).
89
+ * @throws Error when the id is malformed, reserved or taken, a field is missing, or `createCli` has already built the CLI.
90
+ * @stability experimental
91
+ * @extensionPoint registry
92
+ * @example
93
+ * ```ts
94
+ * registerTuiMenuNode({ kind: 'section', id: 'node', label: 'Worker node', order: 40 });
95
+ * registerTuiMenuNode({ kind: 'entry', id: 'node-dashboard', parent: 'node', route: 'node-dashboard', label: 'Dashboard', order: 10 });
96
+ * ```
97
+ */
98
+ export declare function registerTuiMenuNode(node: TuiMenuNode): void;
99
+ /**
100
+ * The menu nodes registered so far, in registration order.
101
+ *
102
+ * @returns A frozen copy.
103
+ * @stability experimental
104
+ */
105
+ export declare function listTuiMenuNodes(): readonly TuiMenuNode[];
106
+ /**
107
+ * Checks the references between nodes and screens.
108
+ *
109
+ * @param nodes - The registered nodes.
110
+ * @param routes - Every screen route that exists.
111
+ * @throws Error naming the offending node id for an unknown or non-section parent, an unknown route, a cycle, or nesting deeper than {@link TUI_MENU_MAX_DEPTH}.
112
+ * @stability experimental
113
+ */
114
+ export declare function validateTuiMenuNodes(nodes: readonly TuiMenuNode[], routes: readonly string[]): void;
115
+ /**
116
+ * Validates the registered nodes against the screens, then refuses later
117
+ * registrations; `createCli` calls it.
118
+ *
119
+ * @throws Error from {@link validateTuiMenuNodes}; nothing is frozen then.
120
+ */
121
+ export declare function freezeTuiMenuRegistry(by: string): void;
122
+ /** Empties the registry. Tests only. */
123
+ export declare function resetTuiMenuRegistryForTests(): void;
124
+ //# sourceMappingURL=menu-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-registry.d.ts","sourceRoot":"","sources":["../../../src/engine/tui/menu-registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAiD,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC1G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAmB3C;;;;GAIG;AACH,eAAO,MAAM,aAAa,SAAS,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,cAAc,KAAK,MAAM,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,2FAA2F;IAC3F,EAAE,EAAE,MAAM,CAAC;IACX,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,2DAA2D;IAC3D,KAAK,EAAE,YAAY,CAAC;I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N_TUI_SCREENS, listRegisteredTuiScreens } from './screen-registry.js';
3
+ // =============================================================================
4
+ // The TUI menu tree registry (RETRO-G1.1, #1065)
5
+ // =============================================================================
6
+ //
7
+ // `registerTuiScreen` puts a screen in one flat list. A MENU NODE places things
8
+ // in a tree: a SECTION is a submenu (with a breadcrumb, a subtitle and a
9
+ // logged-out rule), an ENTRY opens a registered screen from inside a section.
10
+ // Nothing here is required: a screen that no entry references is shown at the
11
+ // root with its own label and order, exactly as before, so an app that never
12
+ // calls `registerTuiMenuNode` keeps today's menu.
13
+ //
14
+ // PURE ON PURPOSE, like screen-registry.ts: React is not imported at all, so
15
+ // registering a node from `createCli` never loads ink. References (`parent`,
16
+ // `route`) are resolved when `createCli` freezes the registries, not when a
17
+ // node is registered, so the order of registration does not matter.
18
+ // =============================================================================
19
+ /**
20
+ * The id of the implicit root section. Reserved.
21
+ *
22
+ * @stability experimental
23
+ */
24
+ export const TUI_MENU_ROOT = 'root';
25
+ /**
26
+ * The deepest a section may nest (a section directly under the root is level 1).
27
+ *
28
+ * @stability experimental
29
+ */
30
+ export const TUI_MENU_MAX_DEPTH = 4;
31
+ const ID_PATTERN = /^[a-z][a-z0-9-]*$/;
32
+ const registry = createCliRegistry({
33
+ name: 'TUI menu node',
34
+ registerFn: 'registerTuiMenuNode',
35
+ idOf: (node) => node.id,
36
+ validate: (node) => {
37
+ const id = node.id;
38
+ if (typeof id !== 'string' || !ID_PATTERN.test(id)) {
39
+ throw new Error(`TUI menu node id "${String(id)}" is invalid: use lowercase letters, digits and hyphens.`);
40
+ }
41
+ if (id === TUI_MENU_ROOT) {
42
+ throw new Error(`TUI menu node id "${TUI_MENU_ROOT}" is reserved for the menu root.`);
43
+ }
44
+ if (node.kind !== 'section' && node.kind !== 'entry') {
45
+ throw new Error(`TUI menu node "${id}" needs kind "section" or "entry".`);
46
+ }
47
+ if (typeof node.order !== 'number' || !Number.isFinite(node.order)) {
48
+ throw new Error(`TUI menu node "${id}" needs a finite numeric order.`);
49
+ }
50
+ if (typeof node.label !== 'string' && typeof node.label !== 'function') {
51
+ throw new Error(`TUI menu node "${id}" needs a label (a string or a function of the login state).`);
52
+ }
53
+ if (typeof node.label === 'string' && node.label.trim() === '') {
54
+ throw new Error(`TUI menu node "${id}" needs a non-empty label.`);
55
+ }
56
+ if (node.parent !== undefined && (typeof node.parent !== 'string' || node.parent === '')) {
57
+ throw new Error(`TUI menu node "${id}" has an invalid parent.`);
58
+ }
59
+ if (node.kind === 'entry' && (typeof node.route !== 'string' || node.route === '')) {
60
+ throw new Error(`TUI menu entry "${id}" needs the route of a registered screen.`);
61
+ }
62
+ },
63
+ });
64
+ /**
65
+ * Adds a section or an entry to the TUI menu tree.
66
+ *
67
+ * Unknown `parent` and unknown `route` are rejected when `createCli` builds
68
+ * the CLI (so registration order is free), together with cycles and nesting
69
+ * deeper than {@link TUI_MENU_MAX_DEPTH}.
70
+ *
71
+ * @param node - A section (`kind: 'section'`) or an entry (`kind: 'entry'`, with a `route`).
72
+ * @throws Error when the id is malformed, reserved or taken, a field is missing, or `createCli` has already built the CLI.
73
+ * @stability experimental
74
+ * @extensionPoint registry
75
+ * @example
76
+ * ```ts
77
+ * registerTuiMenuNode({ kind: 'section', id: 'node', label: 'Worker node', order: 40 });
78
+ * registerTuiMenuNode({ kind: 'entry', id: 'node-dashboard', parent: 'node', route: 'node-dashboard', label: 'Dashboard', order: 10 });
79
+ * ```
80
+ */
81
+ export function registerTuiMenuNode(node) {
82
+ registry.register(Object.freeze({ ...node }));
83
+ }
84
+ /**
85
+ * The menu nodes registered so far, in registration order.
86
+ *
87
+ * @returns A frozen copy.
88
+ * @stability experimental
89
+ */
90
+ export function listTuiMenuNodes() {
91
+ return registry.list();
92
+ }
93
+ /**
94
+ * Checks the references between nodes and screens.
95
+ *
96
+ * @param nodes - The registered nodes.
97
+ * @param routes - Every screen route that exists.
98
+ * @throws Error naming the offending node id for an unknown or non-section parent, an unknown route, a cycle, or nesting deeper than {@link TUI_MENU_MAX_DEPTH}.
99
+ * @stability experimental
100
+ */
101
+ export function validateTuiMenuNodes(nodes, routes) {
102
+ const byId = new Map(nodes.map((node) => [node.id, node]));
103
+ for (const node of nodes) {
104
+ const parent = node.parent ?? TUI_MENU_ROOT;
105
+ if (parent !== TUI_MENU_ROOT) {
106
+ const found = byId.get(parent);
107
+ if (found === undefined) {
108
+ throw new Error(`TUI menu node "${node.id}" has unknown parent "${parent}".`);
109
+ }
110
+ if (found.kind !== 'section') {
111
+ throw new Error(`TUI menu node "${node.id}" has parent "${parent}", which is an entry; a parent must be a section.`);
112
+ }
113
+ }
114
+ if (node.kind === 'entry' && !routes.includes(node.route)) {
115
+ throw new Error(`TUI menu entry "${node.id}" opens unknown screen route "${node.route}"; register it with registerTuiScreen.`);
116
+ }
117
+ }
118
+ for (const node of nodes) {
119
+ // Walk up; the chain must reach the root within the cap without repeating.
120
+ const seen = new Set([node.id]);
121
+ let level = node.kind === 'section' ? 1 : 0;
122
+ let parent = node.parent ?? TUI_MENU_ROOT;
123
+ while (parent !== TUI_MENU_ROOT) {
124
+ if (seen.has(parent)) {
125
+ throw new Error(`TUI menu node "${node.id}" is part of a cycle through "${parent}".`);
126
+ }
127
+ seen.add(parent);
128
+ level += 1;
129
+ parent = byId.get(parent)?.parent ?? TUI_MENU_ROOT;
130
+ }
131
+ if (level > TUI_MENU_MAX_DEPTH) {
132
+ throw new Error(`TUI menu node "${node.id}" nests ${level} sections deep; the limit is ${TUI_MENU_MAX_DEPTH}.`);
133
+ }
134
+ }
135
+ }
136
+ /**
137
+ * Validates the registered nodes against the screens, then refuses later
138
+ * registrations; `createCli` calls it.
139
+ *
140
+ * @throws Error from {@link validateTuiMenuNodes}; nothing is frozen then.
141
+ */
142
+ export function freezeTuiMenuRegistry(by) {
143
+ const routes = [...BUILTIN_TUI_SCREENS, ...listRegisteredTuiScreens()].map((screen) => screen.route);
144
+ validateTuiMenuNodes(registry.list(), routes);
145
+ registry.freeze(by);
146
+ }
147
+ /** Empties the registry. Tests only. */
148
+ export function resetTuiMenuRegistryForTests() {
149
+ registry.reset();
150
+ }
151
+ //# sourceMappingURL=menu-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-registry.js","sourceRoot":"","sources":["../../../src/engine/tui/menu-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAuB,MAAM,sBAAsB,CAAC;AAG1G,gFAAgF;AAChF,kDAAkD;AAClD,gFAAgF;AAChF,EAAE;AACF,gFAAgF;AAChF,yEAAyE;AACzE,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,kDAAkD;AAClD,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,4EAA4E;AAC5E,oEAAoE;AACpE,gFAAgF;AAEhF;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC;AAEpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAyEpC,MAAM,UAAU,GAAG,mBAAmB,CAAC;AAEvC,MAAM,QAAQ,GAAG,iBAAiB,CAAc;IAC9C,IAAI,EAAE,eAAe;IACrB,UAAU,EAAE,qBAAqB;IACjC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE;IACvB,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;QACjB,MAAM,EAAE,GAAI,IAAyB,CAAC,EAAE,CAAC;QACzC,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;YACnD,MAAM,IAAI,KAAK,CAAC,qBAAqB,MAAM,CAAC,EAAE,CAAC,0DAA0D,CAAC,CAAC;QAC7G,CAAC;QACD,IAAI,EAAE,KAAK,aAAa,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,qBAAqB,aA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