@h-rig/cli-surface-plugin 0.0.6-alpha.146

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 (94) hide show
  1. package/README.md +1 -0
  2. package/dist/src/app/drone-ui.d.ts +34 -0
  3. package/dist/src/app/drone-ui.js +278 -0
  4. package/dist/src/commands/_async-ui.d.ts +10 -0
  5. package/dist/src/commands/_async-ui.js +121 -0
  6. package/dist/src/commands/_cli-format.d.ts +56 -0
  7. package/dist/src/commands/_cli-format.js +332 -0
  8. package/dist/src/commands/_connection-state.d.ts +54 -0
  9. package/dist/src/commands/_connection-state.js +187 -0
  10. package/dist/src/commands/_doctor-checks.d.ts +9 -0
  11. package/dist/src/commands/_doctor-checks.js +24 -0
  12. package/dist/src/commands/_help-catalog.d.ts +29 -0
  13. package/dist/src/commands/_help-catalog.js +157 -0
  14. package/dist/src/commands/_inprocess-services.d.ts +33 -0
  15. package/dist/src/commands/_inprocess-services.js +102 -0
  16. package/dist/src/commands/_json-output.d.ts +11 -0
  17. package/dist/src/commands/_json-output.js +54 -0
  18. package/dist/src/commands/_parsers.d.ts +15 -0
  19. package/dist/src/commands/_parsers.js +114 -0
  20. package/dist/src/commands/_paths.d.ts +11 -0
  21. package/dist/src/commands/_paths.js +50 -0
  22. package/dist/src/commands/_pi-frontend.d.ts +35 -0
  23. package/dist/src/commands/_pi-frontend.js +64 -0
  24. package/dist/src/commands/_pi-install.d.ts +42 -0
  25. package/dist/src/commands/_pi-install.js +167 -0
  26. package/dist/src/commands/_policy.d.ts +8 -0
  27. package/dist/src/commands/_policy.js +138 -0
  28. package/dist/src/commands/_probes.d.ts +1 -0
  29. package/dist/src/commands/_probes.js +13 -0
  30. package/dist/src/commands/_run-driver-helpers.d.ts +26 -0
  31. package/dist/src/commands/_run-driver-helpers.js +132 -0
  32. package/dist/src/commands/_run-subcommands.d.ts +3 -0
  33. package/dist/src/commands/_run-subcommands.js +31 -0
  34. package/dist/src/commands/_spinner.d.ts +25 -0
  35. package/dist/src/commands/_spinner.js +65 -0
  36. package/dist/src/commands/agent.d.ts +3 -0
  37. package/dist/src/commands/agent.js +322 -0
  38. package/dist/src/commands/config.d.ts +3 -0
  39. package/dist/src/commands/config.js +193 -0
  40. package/dist/src/commands/dist.d.ts +28 -0
  41. package/dist/src/commands/dist.js +435 -0
  42. package/dist/src/commands/doctor.d.ts +3 -0
  43. package/dist/src/commands/doctor.js +171 -0
  44. package/dist/src/commands/github.d.ts +3 -0
  45. package/dist/src/commands/github.js +342 -0
  46. package/dist/src/commands/inbox.d.ts +19 -0
  47. package/dist/src/commands/inbox.js +241 -0
  48. package/dist/src/commands/init.d.ts +64 -0
  49. package/dist/src/commands/init.js +1449 -0
  50. package/dist/src/commands/inspect.d.ts +20 -0
  51. package/dist/src/commands/inspect.js +337 -0
  52. package/dist/src/commands/pi.d.ts +3 -0
  53. package/dist/src/commands/pi.js +177 -0
  54. package/dist/src/commands/plugin.d.ts +20 -0
  55. package/dist/src/commands/plugin.js +238 -0
  56. package/dist/src/commands/profile-and-review.d.ts +4 -0
  57. package/dist/src/commands/profile-and-review.js +223 -0
  58. package/dist/src/commands/queue.d.ts +3 -0
  59. package/dist/src/commands/queue.js +197 -0
  60. package/dist/src/commands/remote.d.ts +3 -0
  61. package/dist/src/commands/remote.js +516 -0
  62. package/dist/src/commands/repo-git-harness.d.ts +5 -0
  63. package/dist/src/commands/repo-git-harness.js +282 -0
  64. package/dist/src/commands/run.d.ts +22 -0
  65. package/dist/src/commands/run.js +645 -0
  66. package/dist/src/commands/server.d.ts +3 -0
  67. package/dist/src/commands/server.js +155 -0
  68. package/dist/src/commands/setup.d.ts +16 -0
  69. package/dist/src/commands/setup.js +356 -0
  70. package/dist/src/commands/stats.d.ts +11 -0
  71. package/dist/src/commands/stats.js +219 -0
  72. package/dist/src/commands/task-run-driver.d.ts +93 -0
  73. package/dist/src/commands/task-run-driver.js +136 -0
  74. package/dist/src/commands/task.d.ts +46 -0
  75. package/dist/src/commands/task.js +555 -0
  76. package/dist/src/commands/test.d.ts +3 -0
  77. package/dist/src/commands/test.js +46 -0
  78. package/dist/src/commands/triage.d.ts +11 -0
  79. package/dist/src/commands/triage.js +224 -0
  80. package/dist/src/commands/workspace.d.ts +3 -0
  81. package/dist/src/commands/workspace.js +130 -0
  82. package/dist/src/kernel-dispatch.d.ts +15 -0
  83. package/dist/src/kernel-dispatch.js +16 -0
  84. package/dist/src/plugin.d.ts +3 -0
  85. package/dist/src/plugin.js +5440 -0
  86. package/dist/src/rig-config-package-deps.d.ts +10 -0
  87. package/dist/src/rig-config-package-deps.js +272 -0
  88. package/dist/src/runner.d.ts +47 -0
  89. package/dist/src/runner.js +267 -0
  90. package/dist/src/version.d.ts +8 -0
  91. package/dist/src/version.js +47 -0
  92. package/dist/src/withMutedConsole.d.ts +2 -0
  93. package/dist/src/withMutedConsole.js +42 -0
  94. package/package.json +34 -0
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # @h-rig/cli-surface-plugin
@@ -0,0 +1,34 @@
1
+ type DroneSelectOption<T extends string> = {
2
+ readonly value: T;
3
+ readonly label: string;
4
+ readonly hint?: string;
5
+ };
6
+ type DroneSpinner = {
7
+ start(message: string): void;
8
+ stop(message?: string): void;
9
+ error(message?: string): void;
10
+ };
11
+ export declare function droneIntro(title: string, subtitle?: string): void;
12
+ export declare function droneOutro(text: string): void;
13
+ export declare function droneNote(message: string, title?: string): void;
14
+ export declare function droneStep(text: string): void;
15
+ export declare function droneInfo(text: string): void;
16
+ export declare function droneWarn(text: string): void;
17
+ export declare function droneError(text: string): void;
18
+ export declare function droneCancel(text: string): void;
19
+ export declare function droneSpinner(): DroneSpinner;
20
+ export declare function droneSelect<T extends string>(input: {
21
+ readonly message: string;
22
+ readonly options: readonly DroneSelectOption<T>[];
23
+ readonly initialValue?: T;
24
+ }): Promise<T | null>;
25
+ export declare function droneText(input: {
26
+ readonly message: string;
27
+ readonly placeholder?: string;
28
+ readonly initialValue?: string;
29
+ }): Promise<string | null>;
30
+ export declare function droneConfirm(input: {
31
+ readonly message: string;
32
+ readonly initialValue?: boolean;
33
+ }): Promise<boolean | null>;
34
+ export {};
@@ -0,0 +1,278 @@
1
+ // @bun
2
+ // packages/cli-surface-plugin/src/app/drone-ui.ts
3
+ import { Input, matchesKey, ProcessTerminal, SelectList, Text, TUI } from "@oh-my-pi/pi-tui";
4
+
5
+ // packages/cli-surface-plugin/src/commands/_spinner.ts
6
+ var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
7
+ function createTtySpinner(input) {
8
+ const output = input.output ?? process.stdout;
9
+ const isTty = output.isTTY === true;
10
+ const frames = input.frames && input.frames.length > 0 ? input.frames : SPINNER_FRAMES;
11
+ let label = input.label;
12
+ let frame = 0;
13
+ let paused = false;
14
+ let stopped = false;
15
+ let lastPrintedLabel = "";
16
+ const render = () => {
17
+ if (stopped || paused)
18
+ return;
19
+ if (!isTty) {
20
+ if (label !== lastPrintedLabel) {
21
+ output.write(`${label}
22
+ `);
23
+ lastPrintedLabel = label;
24
+ }
25
+ return;
26
+ }
27
+ frame = (frame + 1) % frames.length;
28
+ const glyph = frames[frame] ?? frames[0] ?? "";
29
+ output.write(`\r\x1B[2K${input.styleFrame ? input.styleFrame(glyph) : glyph} ${label}`);
30
+ };
31
+ const clearLine = () => {
32
+ if (isTty)
33
+ output.write("\r\x1B[2K");
34
+ };
35
+ render();
36
+ const timer = isTty ? setInterval(render, input.intervalMs ?? 16) : null;
37
+ return {
38
+ setLabel(next) {
39
+ label = next;
40
+ render();
41
+ },
42
+ pause() {
43
+ paused = true;
44
+ clearLine();
45
+ },
46
+ resume() {
47
+ if (stopped)
48
+ return;
49
+ paused = false;
50
+ render();
51
+ },
52
+ stop(finalLine) {
53
+ if (stopped)
54
+ return;
55
+ stopped = true;
56
+ if (timer)
57
+ clearInterval(timer);
58
+ clearLine();
59
+ if (finalLine)
60
+ output.write(`${finalLine}
61
+ `);
62
+ }
63
+ };
64
+ }
65
+
66
+ // packages/cli-surface-plugin/src/app/drone-ui.ts
67
+ var PALETTE = {
68
+ ink: "#f2f3f6",
69
+ ink2: "#aeb0ba",
70
+ ink3: "#6c6e79",
71
+ ink4: "#44464f",
72
+ accent: "#ccff4d",
73
+ accentDim: "#a9d63f",
74
+ cyan: "#56d8ff",
75
+ red: "#ff5d5d",
76
+ yellow: "#ffd24d"
77
+ };
78
+ function hexToRgb(hex) {
79
+ const value = hex.charCodeAt(0) === 35 ? hex.slice(1) : hex;
80
+ return [
81
+ Number.parseInt(value.slice(0, 2), 16),
82
+ Number.parseInt(value.slice(2, 4), 16),
83
+ Number.parseInt(value.slice(4, 6), 16)
84
+ ];
85
+ }
86
+ function fg(hex) {
87
+ const [r, g, b] = hexToRgb(hex);
88
+ return (text) => `\x1B[38;2;${r};${g};${b}m${text}\x1B[39m`;
89
+ }
90
+ var ink = fg(PALETTE.ink);
91
+ var ink2 = fg(PALETTE.ink2);
92
+ var ink3 = fg(PALETTE.ink3);
93
+ var ink4 = fg(PALETTE.ink4);
94
+ var accent = fg(PALETTE.accent);
95
+ var accentDim = fg(PALETTE.accentDim);
96
+ var cyan = fg(PALETTE.cyan);
97
+ var red = fg(PALETTE.red);
98
+ var yellow = fg(PALETTE.yellow);
99
+ var MICRO_BLADES = ["---", "\\\\\\", "|||", "///"];
100
+ var EYE_FRAMES = ["@", "o", "."];
101
+ var MICRO_DRONE_FRAMES = Array.from({ length: 12 }, (_, index) => {
102
+ const blade = MICRO_BLADES[index % MICRO_BLADES.length];
103
+ const eye = EYE_FRAMES[Math.floor(index / 2) % EYE_FRAMES.length];
104
+ return `(${blade})${eye}(${blade})`;
105
+ });
106
+ function bold(text) {
107
+ return `\x1B[1m${text}\x1B[22m`;
108
+ }
109
+ function renderMicroDroneFrame(frame) {
110
+ const tick = Math.max(0, MICRO_DRONE_FRAMES.indexOf(frame));
111
+ const blade = MICRO_BLADES[tick % MICRO_BLADES.length];
112
+ const eye = EYE_FRAMES[Math.floor(tick / 2) % EYE_FRAMES.length];
113
+ return `${ink4("(")}${cyan(blade)}${ink4(")")}${bold(accent(eye))}${ink4("(")}${cyan(blade)}${ink4(")")}`;
114
+ }
115
+ function hairline(width = Math.min(process.stdout.columns ?? 80, 100)) {
116
+ return ink4("\u2500".repeat(Math.max(10, width)));
117
+ }
118
+ function droneIntro(title, subtitle) {
119
+ console.log("");
120
+ console.log(` ${accent("\u258D")}${bold(ink(title))}${subtitle ? ink3(` \u2014 ${subtitle}`) : ""}`);
121
+ console.log(hairline());
122
+ }
123
+ function droneOutro(text) {
124
+ console.log(hairline());
125
+ console.log(` ${accent("\u25C6")} ${ink2(text)}`);
126
+ console.log("");
127
+ }
128
+ function droneNote(message, title) {
129
+ if (title)
130
+ console.log(` ${accentDim("\u25C7")} ${bold(ink2(title))}`);
131
+ for (const line of message.split(`
132
+ `))
133
+ console.log(` ${ink4("\u2502")} ${line}`);
134
+ }
135
+ function droneStep(text) {
136
+ console.log(` ${accent("\u203A")} ${ink(text)}`);
137
+ }
138
+ function droneInfo(text) {
139
+ console.log(` ${cyan("\xB7")} ${ink2(text)}`);
140
+ }
141
+ function droneWarn(text) {
142
+ console.log(` ${yellow("\u25B2")} ${ink2(text)}`);
143
+ }
144
+ function droneError(text) {
145
+ console.log(` ${red("\u2716")} ${ink2(text)}`);
146
+ }
147
+ function droneCancel(text) {
148
+ console.log(` ${red("\u2716")} ${ink3(text)}`);
149
+ }
150
+ function droneSpinner() {
151
+ let active = null;
152
+ return {
153
+ start(message) {
154
+ active = createTtySpinner({
155
+ label: message,
156
+ frames: MICRO_DRONE_FRAMES,
157
+ styleFrame: renderMicroDroneFrame
158
+ });
159
+ },
160
+ stop(message) {
161
+ active?.stop(message ? ` ${accent("\u25C6")} ${ink2(message)}` : undefined);
162
+ active = null;
163
+ },
164
+ error(message) {
165
+ active?.stop(message ? ` ${red("\u2716")} ${ink2(message)}` : undefined);
166
+ active = null;
167
+ }
168
+ };
169
+ }
170
+ var DRONE_SYMBOLS = {
171
+ cursor: "\u2192",
172
+ inputCursor: "\u258F",
173
+ boxRound: { topLeft: "\u256D", topRight: "\u256E", bottomLeft: "\u2570", bottomRight: "\u256F", horizontal: "\u2500", vertical: "\u2502" },
174
+ boxSharp: { topLeft: "\u250C", topRight: "\u2510", bottomLeft: "\u2514", bottomRight: "\u2518", horizontal: "\u2500", vertical: "\u2502", teeDown: "\u252C", teeUp: "\u2534", teeLeft: "\u2524", teeRight: "\u251C", cross: "\u253C" },
175
+ table: { topLeft: "\u250C", topRight: "\u2510", bottomLeft: "\u2514", bottomRight: "\u2518", horizontal: "\u2500", vertical: "\u2502", teeDown: "\u252C", teeUp: "\u2534", teeLeft: "\u2524", teeRight: "\u251C", cross: "\u253C" },
176
+ quoteBorder: "\u2502",
177
+ hrChar: "\u2500",
178
+ spinnerFrames: ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"]
179
+ };
180
+ var DRONE_SELECT_THEME = {
181
+ selectedPrefix: (text) => accent(text),
182
+ selectedText: (text) => bold(ink(text)),
183
+ description: (text) => ink3(text),
184
+ scrollInfo: (text) => ink4(text),
185
+ noMatch: (text) => ink3(text),
186
+ symbols: DRONE_SYMBOLS,
187
+ hovered: (text) => bold(ink(text))
188
+ };
189
+ async function runMiniTui(build) {
190
+ const tui = new TUI(new ProcessTerminal);
191
+ let settled = false;
192
+ return await new Promise((resolve) => {
193
+ const finish = (result) => {
194
+ if (settled)
195
+ return;
196
+ settled = true;
197
+ tui.stop();
198
+ resolve(result);
199
+ };
200
+ build(tui, finish);
201
+ tui.start();
202
+ });
203
+ }
204
+ async function droneSelect(input) {
205
+ if (!process.stdout.isTTY || input.options.length === 0)
206
+ return input.initialValue ?? input.options[0]?.value ?? null;
207
+ return runMiniTui((tui, finish) => {
208
+ tui.addChild(new Text(` ${accent("\u258D")}${bold(ink(input.message))}`));
209
+ const items = input.options.map((option) => ({
210
+ value: option.value,
211
+ label: option.label,
212
+ ...option.hint ? { description: option.hint } : {}
213
+ }));
214
+ const list = new SelectList(items, Math.min(items.length, 12), DRONE_SELECT_THEME);
215
+ const initialIndex = input.initialValue ? items.findIndex((item) => item.value === input.initialValue) : -1;
216
+ if (initialIndex > 0)
217
+ list.setSelectedIndex(initialIndex);
218
+ list.onSelect = (item) => finish(item.value);
219
+ list.onCancel = () => finish(null);
220
+ tui.addChild(list);
221
+ tui.addChild(new Text(ink4(" \u2191\u2193 navigate \xB7 enter select \xB7 esc cancel")));
222
+ tui.setFocus(list);
223
+ tui.addInputListener((data) => {
224
+ if (matchesKey(data, "ctrl+c") || matchesKey(data, "escape")) {
225
+ finish(null);
226
+ return { consume: true };
227
+ }
228
+ return;
229
+ });
230
+ });
231
+ }
232
+ async function droneText(input) {
233
+ if (!process.stdout.isTTY)
234
+ return input.initialValue ?? null;
235
+ return runMiniTui((tui, finish) => {
236
+ tui.addChild(new Text(` ${accent("\u258D")}${bold(ink(input.message))}${input.placeholder ? ink4(` (${input.placeholder})`) : ""}`));
237
+ const field = new Input;
238
+ if (input.initialValue)
239
+ field.setValue(input.initialValue);
240
+ field.onSubmit = (value) => finish(value);
241
+ field.onEscape = () => finish(null);
242
+ tui.addChild(field);
243
+ tui.addChild(new Text(ink4(" enter submit \xB7 esc cancel")));
244
+ tui.setFocus(field);
245
+ tui.addInputListener((data) => {
246
+ if (matchesKey(data, "ctrl+c")) {
247
+ finish(null);
248
+ return { consume: true };
249
+ }
250
+ return;
251
+ });
252
+ });
253
+ }
254
+ async function droneConfirm(input) {
255
+ const answer = await droneSelect({
256
+ message: input.message,
257
+ options: [
258
+ { value: "yes", label: "Yes" },
259
+ { value: "no", label: "No" }
260
+ ],
261
+ initialValue: input.initialValue === false ? "no" : "yes"
262
+ });
263
+ return answer === null ? null : answer === "yes";
264
+ }
265
+ export {
266
+ droneWarn,
267
+ droneText,
268
+ droneStep,
269
+ droneSpinner,
270
+ droneSelect,
271
+ droneOutro,
272
+ droneNote,
273
+ droneIntro,
274
+ droneInfo,
275
+ droneError,
276
+ droneConfirm,
277
+ droneCancel
278
+ };
@@ -0,0 +1,10 @@
1
+ import type { OutputMode } from "@rig/runtime";
2
+ export type SpinnerOutput = Pick<NodeJS.WriteStream, "write"> & {
3
+ readonly isTTY?: boolean;
4
+ };
5
+ export type WithSpinnerOptions = {
6
+ readonly doneLabel?: string;
7
+ readonly outputMode?: OutputMode;
8
+ readonly output?: SpinnerOutput;
9
+ };
10
+ export declare function withSpinner<T>(label: string, work: (update: (label: string) => void) => Promise<T>, options?: WithSpinnerOptions): Promise<T>;
@@ -0,0 +1,121 @@
1
+ // @bun
2
+ // packages/cli-surface-plugin/src/commands/_async-ui.ts
3
+ import pc from "picocolors";
4
+
5
+ // packages/cli-surface-plugin/src/commands/_spinner.ts
6
+ var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
7
+ function createTtySpinner(input) {
8
+ const output = input.output ?? process.stdout;
9
+ const isTty = output.isTTY === true;
10
+ const frames = input.frames && input.frames.length > 0 ? input.frames : SPINNER_FRAMES;
11
+ let label = input.label;
12
+ let frame = 0;
13
+ let paused = false;
14
+ let stopped = false;
15
+ let lastPrintedLabel = "";
16
+ const render = () => {
17
+ if (stopped || paused)
18
+ return;
19
+ if (!isTty) {
20
+ if (label !== lastPrintedLabel) {
21
+ output.write(`${label}
22
+ `);
23
+ lastPrintedLabel = label;
24
+ }
25
+ return;
26
+ }
27
+ frame = (frame + 1) % frames.length;
28
+ const glyph = frames[frame] ?? frames[0] ?? "";
29
+ output.write(`\r\x1B[2K${input.styleFrame ? input.styleFrame(glyph) : glyph} ${label}`);
30
+ };
31
+ const clearLine = () => {
32
+ if (isTty)
33
+ output.write("\r\x1B[2K");
34
+ };
35
+ render();
36
+ const timer = isTty ? setInterval(render, input.intervalMs ?? 16) : null;
37
+ return {
38
+ setLabel(next) {
39
+ label = next;
40
+ render();
41
+ },
42
+ pause() {
43
+ paused = true;
44
+ clearLine();
45
+ },
46
+ resume() {
47
+ if (stopped)
48
+ return;
49
+ paused = false;
50
+ render();
51
+ },
52
+ stop(finalLine) {
53
+ if (stopped)
54
+ return;
55
+ stopped = true;
56
+ if (timer)
57
+ clearInterval(timer);
58
+ clearLine();
59
+ if (finalLine)
60
+ output.write(`${finalLine}
61
+ `);
62
+ }
63
+ };
64
+ }
65
+
66
+ // packages/cli-surface-plugin/src/commands/_async-ui.ts
67
+ var FRAMES = ["\u25D0", "\u25D3", "\u25D1", "\u25D2"];
68
+ var DONE_SYMBOL = pc.green("\u25C7");
69
+ var FAIL_SYMBOL = pc.red("\u25A0");
70
+ var activeUpdate = null;
71
+ async function withSpinner(label, work, options = {}) {
72
+ if (options.outputMode === "json") {
73
+ return work(() => {
74
+ return;
75
+ });
76
+ }
77
+ if (activeUpdate) {
78
+ activeUpdate(label);
79
+ return work(activeUpdate);
80
+ }
81
+ const output = options.output ?? process.stderr;
82
+ const isTty = output.isTTY === true;
83
+ let lastLabel = label;
84
+ if (!isTty) {
85
+ output.write(`${label}
86
+ `);
87
+ const update2 = (next) => {
88
+ lastLabel = next;
89
+ };
90
+ activeUpdate = update2;
91
+ try {
92
+ return await work(update2);
93
+ } finally {
94
+ activeUpdate = null;
95
+ }
96
+ }
97
+ const spinner = createTtySpinner({
98
+ label,
99
+ output,
100
+ frames: FRAMES,
101
+ styleFrame: (frame) => pc.cyan(frame)
102
+ });
103
+ const update = (next) => {
104
+ lastLabel = next;
105
+ spinner.setLabel(next);
106
+ };
107
+ activeUpdate = update;
108
+ try {
109
+ const result = await work(update);
110
+ spinner.stop(options.doneLabel ? `${DONE_SYMBOL} ${options.doneLabel}` : undefined);
111
+ return result;
112
+ } catch (error) {
113
+ spinner.stop(`${FAIL_SYMBOL} ${lastLabel}`);
114
+ throw error;
115
+ } finally {
116
+ activeUpdate = null;
117
+ }
118
+ }
119
+ export {
120
+ withSpinner
121
+ };
@@ -0,0 +1,56 @@
1
+ export type CliTaskLike = Record<string, unknown>;
2
+ export type CliRunLike = Record<string, unknown>;
3
+ export declare function printFormattedOutput(message: string): void;
4
+ export declare function formatStatusPill(status: string): string;
5
+ export declare function formatSection(title: string, subtitle?: string): string;
6
+ export declare function formatSuccessCard(title: string, rows?: Array<[string, string | number | null | undefined]>): string;
7
+ export declare function formatNextSteps(steps: readonly string[]): string[];
8
+ export declare function formatTaskList(tasks: readonly CliTaskLike[], options?: {
9
+ raw?: boolean;
10
+ }): string;
11
+ export declare function formatTaskCard(task: CliTaskLike, options?: {
12
+ title?: string;
13
+ selected?: boolean;
14
+ }): string;
15
+ export declare function formatTaskDetails(task: CliTaskLike): string;
16
+ export declare function formatRunList(runs: readonly CliRunLike[], options?: {
17
+ source?: "local" | "server";
18
+ }): string;
19
+ export declare function formatSubmittedRun(input: {
20
+ runId: string;
21
+ taskId?: string | null;
22
+ title?: string | null;
23
+ queuePosition?: number | null;
24
+ }): string;
25
+ export declare function formatRunCard(run: CliRunLike, options?: {
26
+ title?: string;
27
+ }): string;
28
+ export declare function formatRunStatus(summary: {
29
+ activeRuns?: CliRunLike[];
30
+ recentRuns?: CliRunLike[];
31
+ runs?: CliRunLike[];
32
+ }, options?: {
33
+ source?: "local" | "server";
34
+ }): string;
35
+ export declare function formatInboxList(kind: "approvals" | "inputs", entries: readonly Record<string, unknown>[]): string;
36
+ export declare function formatConnectionList(connections: Record<string, {
37
+ kind: string;
38
+ baseUrl?: string;
39
+ mode?: string;
40
+ }>): string;
41
+ export declare function formatConnectionStatus(selected: string, connections: Record<string, {
42
+ kind: string;
43
+ baseUrl?: string;
44
+ mode?: string;
45
+ }>, repo?: {
46
+ project?: string;
47
+ serverProjectRoot?: string;
48
+ } | null, remoteProjectLink?: {
49
+ ok?: boolean;
50
+ status?: string;
51
+ serverProjectRoot?: string;
52
+ message?: string;
53
+ hint?: string;
54
+ } | null): string;
55
+ export declare function formatStatsTable(rows: Array<[string, unknown]>): string;
56
+ export declare function readOptionalCount(record: Record<string, unknown>, key: string): number | null;