@aitherium/shell-cli 1.1.0 → 1.11.1
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.
- package/dist/auth.d.ts +13 -4
- package/dist/auth.js +18 -3
- package/dist/client.d.ts +21 -1
- package/dist/client.js +213 -9
- package/dist/command-registry.d.ts +1 -1
- package/dist/command-registry.js +28 -2
- package/dist/commands.d.ts +8 -0
- package/dist/commands.js +2068 -48
- package/dist/completions.js +236 -2
- package/dist/config.d.ts +30 -0
- package/dist/config.js +37 -4
- package/dist/crash-reporter.d.ts +22 -0
- package/dist/crash-reporter.js +275 -0
- package/dist/formatters.d.ts +16 -0
- package/dist/formatters.js +280 -0
- package/dist/interactive.d.ts +45 -0
- package/dist/interactive.js +232 -0
- package/dist/main.js +439 -41
- package/dist/mcp-client.d.ts +58 -0
- package/dist/mcp-client.js +202 -0
- package/dist/relay.d.ts +96 -0
- package/dist/relay.js +234 -0
- package/dist/renderer.d.ts +47 -17
- package/dist/renderer.js +506 -164
- package/dist/repl.js +205 -23
- package/dist/session-store.d.ts +30 -5
- package/dist/session-store.js +56 -0
- package/dist/status-banner.d.ts +59 -0
- package/dist/status-banner.js +239 -0
- package/dist/tui/controller.d.ts +3 -0
- package/dist/tui/controller.js +310 -0
- package/dist/tui/repl-tui.d.ts +3 -0
- package/dist/tui/repl-tui.js +898 -0
- package/dist/tui/screen.d.ts +68 -0
- package/dist/tui/screen.js +736 -0
- package/package.json +10 -2
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export interface PickerItem {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
separator?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface TuiSurface {
|
|
8
|
+
screen: any;
|
|
9
|
+
input: any;
|
|
10
|
+
/** Append raw streamed text (may contain partial lines / ANSI) to OUTPUT. */
|
|
11
|
+
appendOutput(text: string): void;
|
|
12
|
+
/** Append a finished line to OUTPUT (adds its own newline). */
|
|
13
|
+
outputLine(line: string): void;
|
|
14
|
+
/** Current OUTPUT length — a checkpoint for replaceOutputFrom (markdown render). */
|
|
15
|
+
markCheckpoint(): number;
|
|
16
|
+
/** Replace OUTPUT content from a checkpoint onward (used to swap streamed text for rendered markdown). */
|
|
17
|
+
replaceOutputFrom(offset: number, text: string): void;
|
|
18
|
+
/** Prepend text to the TOP of OUTPUT, keeping the viewport anchored (relay scrollback). */
|
|
19
|
+
prependOutput(text: string): void;
|
|
20
|
+
/** Append one line to the TRACE pane (into the current turn thread). */
|
|
21
|
+
traceLine(line: string): void;
|
|
22
|
+
/** Start a new collapsible trace thread for a user turn (collapses prior ones). */
|
|
23
|
+
startTraceTurn(label: string): void;
|
|
24
|
+
/** Mark the current trace thread done/error and stamp its duration in the header. */
|
|
25
|
+
finishTraceTurn(status: 'done' | 'error'): void;
|
|
26
|
+
/** Set the one-line STATUS strip. */
|
|
27
|
+
setStatus(text: string): void;
|
|
28
|
+
/** Relay mode: set the trace pane's label + raw content (the participant roster). */
|
|
29
|
+
setTracePanel(label: string, lines: string[]): void;
|
|
30
|
+
/** Set the output pane's label (e.g. the active relay channel). */
|
|
31
|
+
setOutputLabel(label: string): void;
|
|
32
|
+
/** Clear both content panes. */
|
|
33
|
+
clearPanes(): void;
|
|
34
|
+
/** Show/hide the TRACE pane (OUTPUT widens to fill). */
|
|
35
|
+
toggleTrace(): void;
|
|
36
|
+
/** Coalesced repaint. */
|
|
37
|
+
render(): void;
|
|
38
|
+
/** Focus the input box for typing. */
|
|
39
|
+
focusInput(): void;
|
|
40
|
+
/** Tear down the screen and restore the terminal. */
|
|
41
|
+
destroy(): void;
|
|
42
|
+
/** Whether the command picker overlay is open (suppresses chat input). */
|
|
43
|
+
pickerOpen(): boolean;
|
|
44
|
+
/** Show a filterable command picker; resolves with the chosen value or null. */
|
|
45
|
+
showPicker(title: string, items: PickerItem[], initialFilter?: string): Promise<string | null>;
|
|
46
|
+
/**
|
|
47
|
+
* Suspend the blessed screen, run `fn` on the REAL terminal (so command
|
|
48
|
+
* handlers' console.log / ora spinners / @inquirer prompts all work and don't
|
|
49
|
+
* corrupt the TUI), wait for a keypress, then restore the TUI. This is how
|
|
50
|
+
* `/commands` (including interactive ones like /login) run inside the TUI.
|
|
51
|
+
*/
|
|
52
|
+
runDetached(label: string, fn: () => Promise<void> | void): Promise<void>;
|
|
53
|
+
}
|
|
54
|
+
export interface TuiScreenOpts {
|
|
55
|
+
title?: string;
|
|
56
|
+
onSubmit: (line: string) => void;
|
|
57
|
+
onInterrupt: () => void;
|
|
58
|
+
onHistory?: (dir: 'up' | 'down') => string | null;
|
|
59
|
+
/** Tab pressed: given the current input, return a replacement value or null. */
|
|
60
|
+
onTab?: (value: string) => string | null;
|
|
61
|
+
/** Slash pressed on an empty input line → open the command picker. */
|
|
62
|
+
onSlash?: () => void;
|
|
63
|
+
/** Fired on each printable keystroke (debounce + use for relay typing). */
|
|
64
|
+
onType?: () => void;
|
|
65
|
+
/** Fired when the OUTPUT pane is scrolled to the top (relay scrollback). */
|
|
66
|
+
onScrollTop?: () => void;
|
|
67
|
+
}
|
|
68
|
+
export declare function createTuiScreen(opts: TuiScreenOpts): TuiSurface;
|