mindweave 2.3.1 → 2.4.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/README.md +26 -43
- package/dist/alternator/chassis/lsp.js +67 -0
- package/dist/alternator/chassis/lsp.js.map +1 -1
- package/dist/cli/App.js +1201 -108
- package/dist/cli/App.js.map +1 -1
- package/dist/cli/altScreen.js +80 -10
- package/dist/cli/altScreen.js.map +1 -1
- package/dist/cli/appIdentity.js +54 -0
- package/dist/cli/appIdentity.js.map +1 -0
- package/dist/cli/attachments.js +27 -3
- package/dist/cli/attachments.js.map +1 -1
- package/dist/cli/blockHeights.js +58 -0
- package/dist/cli/blockHeights.js.map +1 -0
- package/dist/cli/caretPark.js +94 -0
- package/dist/cli/caretPark.js.map +1 -0
- package/dist/cli/clipboard.js +68 -0
- package/dist/cli/clipboard.js.map +1 -0
- package/dist/cli/commandLabel.js +19 -2
- package/dist/cli/commandLabel.js.map +1 -1
- package/dist/cli/commands.js +1 -0
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/components/BlockView.js +1 -1
- package/dist/cli/components/BlockView.js.map +1 -1
- package/dist/cli/components/KeyManager.js +11 -5
- package/dist/cli/components/KeyManager.js.map +1 -1
- package/dist/cli/components/Picker.js +18 -3
- package/dist/cli/components/Picker.js.map +1 -1
- package/dist/cli/components/PromptInput.js +300 -74
- package/dist/cli/components/PromptInput.js.map +1 -1
- package/dist/cli/components/TipLine.js +33 -0
- package/dist/cli/components/TipLine.js.map +1 -0
- package/dist/cli/components/ToolLine.js +30 -3
- package/dist/cli/components/ToolLine.js.map +1 -1
- package/dist/cli/dropHandles.js +76 -0
- package/dist/cli/dropHandles.js.map +1 -0
- package/dist/cli/exitCursor.js +56 -0
- package/dist/cli/exitCursor.js.map +1 -0
- package/dist/cli/framebuffer/overlay.js +42 -0
- package/dist/cli/framebuffer/overlay.js.map +1 -0
- package/dist/cli/framebuffer/paint.js +8 -1
- package/dist/cli/framebuffer/paint.js.map +1 -1
- package/dist/cli/framebuffer/parse.js +54 -4
- package/dist/cli/framebuffer/parse.js.map +1 -1
- package/dist/cli/framebuffer/writer.js +357 -6
- package/dist/cli/framebuffer/writer.js.map +1 -1
- package/dist/cli/groupReveal.js +29 -3
- package/dist/cli/groupReveal.js.map +1 -1
- package/dist/cli/inputView.js +45 -0
- package/dist/cli/inputView.js.map +1 -1
- package/dist/cli/keyManager.js +12 -2
- package/dist/cli/keyManager.js.map +1 -1
- package/dist/cli/livePad.js +53 -0
- package/dist/cli/livePad.js.map +1 -0
- package/dist/cli/memoryTuning.js +31 -0
- package/dist/cli/memoryTuning.js.map +1 -0
- package/dist/cli/messageQueue.js +76 -7
- package/dist/cli/messageQueue.js.map +1 -1
- package/dist/cli/mouse.js +40 -7
- package/dist/cli/mouse.js.map +1 -1
- package/dist/cli/pickerOrder.js +49 -0
- package/dist/cli/pickerOrder.js.map +1 -0
- package/dist/cli/quietConsole.js +50 -0
- package/dist/cli/quietConsole.js.map +1 -0
- package/dist/cli/screenMode.js +118 -0
- package/dist/cli/screenMode.js.map +1 -0
- package/dist/cli/screenShell.js +67 -0
- package/dist/cli/screenShell.js.map +1 -0
- package/dist/cli/screenStore.js +46 -0
- package/dist/cli/screenStore.js.map +1 -0
- package/dist/cli/scrollPill.js +101 -0
- package/dist/cli/scrollPill.js.map +1 -0
- package/dist/cli/selection.js +130 -0
- package/dist/cli/selection.js.map +1 -0
- package/dist/cli/startupFill.js +48 -0
- package/dist/cli/startupFill.js.map +1 -0
- package/dist/cli/terminalRestore.js +1 -1
- package/dist/cli/terminalRestore.js.map +1 -1
- package/dist/cli/toolDisplay.js +11 -2
- package/dist/cli/toolDisplay.js.map +1 -1
- package/dist/cli/toolItems.js +1 -0
- package/dist/cli/toolItems.js.map +1 -1
- package/dist/cli/transcript.js +54 -3
- package/dist/cli/transcript.js.map +1 -1
- package/dist/cli/wordEdit.js +95 -0
- package/dist/cli/wordEdit.js.map +1 -0
- package/dist/drivers/deepseek/manifest.js +54 -56
- package/dist/drivers/deepseek/manifest.js.map +1 -1
- package/dist/drivers/openai/manifest.js +4 -1
- package/dist/drivers/openai/manifest.js.map +1 -1
- package/dist/drivers/registry.js +7 -1
- package/dist/drivers/registry.js.map +1 -1
- package/dist/dynamo/engine.js +126 -20
- package/dist/dynamo/engine.js.map +1 -1
- package/dist/index.js +42 -3
- package/dist/index.js.map +1 -1
- package/dist/memory/pastedText.js +37 -0
- package/dist/memory/pastedText.js.map +1 -0
- package/dist/memory/presence.js +47 -0
- package/dist/memory/presence.js.map +1 -1
- package/dist/memory/session.js +78 -4
- package/dist/memory/session.js.map +1 -1
- package/dist/memory/store.js +22 -1
- package/dist/memory/store.js.map +1 -1
- package/dist/memory/types.js.map +1 -1
- package/dist/tools/backgroundShells.js +105 -18
- package/dist/tools/backgroundShells.js.map +1 -1
- package/dist/tools/commandOutput.js +207 -0
- package/dist/tools/commandOutput.js.map +1 -0
- package/dist/tools/detail.js +2 -2
- package/dist/tools/detail.js.map +1 -1
- package/dist/tools/openDefault.js +150 -0
- package/dist/tools/openDefault.js.map +1 -0
- package/dist/tools/outputShape.js +31 -6
- package/dist/tools/outputShape.js.map +1 -1
- package/dist/tools/pathList.js +32 -0
- package/dist/tools/pathList.js.map +1 -0
- package/dist/tools/readFile.js +3 -15
- package/dist/tools/readFile.js.map +1 -1
- package/dist/tools/registry.js +3 -1
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/runCommand.js +154 -58
- package/dist/tools/runCommand.js.map +1 -1
- package/dist/tools/screenshot.js +35 -3
- package/dist/tools/screenshot.js.map +1 -1
- package/dist/tools/viewImage.js +88 -0
- package/dist/tools/viewImage.js.map +1 -0
- package/dist/tools/writeFile.js +9 -1
- package/dist/tools/writeFile.js.map +1 -1
- package/package.json +74 -74
package/dist/cli/altScreen.js
CHANGED
|
@@ -17,7 +17,11 @@
|
|
|
17
17
|
* force-quit — cannot be covered from in here at all. That is what
|
|
18
18
|
* `mindweave --reset-terminal` is for; see `terminalRestore.ts`.
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
// Imported as a namespace so the call is a property lookup at call time, which is what
|
|
21
|
+
// lets a test observe the restore. A named import is bound at load and cannot be seen.
|
|
22
|
+
import * as nodeFs from "node:fs";
|
|
23
|
+
import { SHOW_CURSOR, TERMINAL_RESTORE } from "./terminalRestore.js";
|
|
24
|
+
import { caretToOutputEnd } from "./exitCursor.js";
|
|
21
25
|
const ENTER = "\x1b[?1049h";
|
|
22
26
|
const HIDE_CURSOR = "\x1b[?25l";
|
|
23
27
|
/**
|
|
@@ -37,14 +41,61 @@ const HIDE_CURSOR = "\x1b[?25l";
|
|
|
37
41
|
*/
|
|
38
42
|
const AUTOWRAP_OFF = "\x1b[?7l";
|
|
39
43
|
let active = false;
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
/** Whether the process-level restore hooks are installed. Separate from `active`, so
|
|
45
|
+
* leaving the alternate screen for the inline shell does not unregister them and
|
|
46
|
+
* re-entering does not register a second copy of every signal handler — `enterAltScreen`
|
|
47
|
+
* is called again on every switch back, and each call used to add another SIGINT,
|
|
48
|
+
* SIGTERM, SIGHUP and uncaughtException listener. */
|
|
49
|
+
let guarded = false;
|
|
50
|
+
/**
|
|
51
|
+
* Show or hide the terminal's own cursor.
|
|
52
|
+
*
|
|
53
|
+
* Hidden in BOTH shells, for opposite reasons. Fullscreen parks it deliberately as the
|
|
54
|
+
* caret and hides it the rest of the time; the inline shell draws its caret as a cell,
|
|
55
|
+
* and the real cursor would otherwise sit wherever Ink's output happened to end — a
|
|
56
|
+
* second, stranded caret on a line of its own below the input.
|
|
57
|
+
*/
|
|
58
|
+
export function setCursorVisible(on) {
|
|
59
|
+
if (!process.stdout.isTTY)
|
|
60
|
+
return;
|
|
61
|
+
process.stdout.write(on ? SHOW_CURSOR : HIDE_CURSOR);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Enter or leave the alternate screen at runtime, in either direction.
|
|
65
|
+
*
|
|
66
|
+
* The switch `/screen` makes, and the reason it is separate from `enterAltScreen`: that
|
|
67
|
+
* one is the once-per-process setup, this one is the part that can happen many times.
|
|
68
|
+
*
|
|
69
|
+
* An ordinary async write, not `writeSync`, because nobody is exiting — the process
|
|
70
|
+
* carries on rendering into whichever screen this leaves it on.
|
|
71
|
+
*/
|
|
72
|
+
export function setAltScreen(on) {
|
|
73
|
+
if (!process.stdout.isTTY || on === active)
|
|
74
|
+
return;
|
|
75
|
+
active = on;
|
|
76
|
+
// Leaving restores the whole terminal, not just the buffer: autowrap back on so the
|
|
77
|
+
// terminal wraps its own scrollback, the cursor visible because Ink owns it in the
|
|
78
|
+
// inline shell, and mouse reporting off because nothing is reading it there.
|
|
79
|
+
process.stdout.write(on ? ENTER + HIDE_CURSOR + AUTOWRAP_OFF : TERMINAL_RESTORE);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Registers the restore-on-exit hooks, and by default switches to the alternate screen.
|
|
83
|
+
*
|
|
84
|
+
* No-op outside a real TTY (piped output, CI) — same rule Ink itself uses for every
|
|
85
|
+
* terminal-control feature. Once per process: `setAltScreen` is the one that can be
|
|
86
|
+
* called again.
|
|
87
|
+
*
|
|
88
|
+
* @param buffer Whether to switch to the alternate screen as well as installing the
|
|
89
|
+
* hooks. False for a session starting in the inline shell: it owns no screen, but it
|
|
90
|
+
* still wants the restore — bracketed paste and the cursor are turned on there too,
|
|
91
|
+
* and a signal that skipped the restore would leave the terminal swallowing pastes.
|
|
92
|
+
*/
|
|
93
|
+
export function enterAltScreen(options = {}) {
|
|
94
|
+
if (guarded || !process.stdout.isTTY)
|
|
45
95
|
return;
|
|
46
|
-
|
|
47
|
-
|
|
96
|
+
guarded = true;
|
|
97
|
+
if (options.buffer !== false)
|
|
98
|
+
setAltScreen(true);
|
|
48
99
|
process.on("exit", exitAltScreen);
|
|
49
100
|
process.on("SIGINT", () => {
|
|
50
101
|
exitAltScreen();
|
|
@@ -75,9 +126,28 @@ export function enterAltScreen() {
|
|
|
75
126
|
* unmount, but a signal or a crash skips React entirely, so it is turned off here
|
|
76
127
|
* unconditionally rather than being left to a component that may never unmount. */
|
|
77
128
|
export function exitAltScreen() {
|
|
78
|
-
if (!active)
|
|
129
|
+
if (!guarded && !active)
|
|
79
130
|
return;
|
|
131
|
+
guarded = false;
|
|
80
132
|
active = false;
|
|
81
|
-
process.stdout.write
|
|
133
|
+
// writeSync, NOT process.stdout.write, because every caller of this is on its way out.
|
|
134
|
+
//
|
|
135
|
+
// A write to a TTY is ASYNCHRONOUS on Windows: the bytes are queued and flushed on a
|
|
136
|
+
// later tick. Every path here — SIGINT, SIGTERM, SIGHUP, uncaughtException — calls
|
|
137
|
+
// process.exit immediately afterwards, and exit does not wait for that queue. So the
|
|
138
|
+
// restore was written and then discarded, and Ctrl+C left the terminal still in the
|
|
139
|
+
// alternate screen with mouse reporting on: a window that is neither the app nor the
|
|
140
|
+
// shell, and cannot be typed into. Writing to the file descriptor returns only once the
|
|
141
|
+
// bytes are gone, which is the whole difference.
|
|
142
|
+
try {
|
|
143
|
+
// The cursor move goes FIRST and in the same write. It has to precede the restore
|
|
144
|
+
// because it is about where the NEXT program prints, and it has to share the write
|
|
145
|
+
// because every caller here is on its way out — a second writeSync is a second chance
|
|
146
|
+
// to be cut off half way. See exitCursor.ts for what is being corrected.
|
|
147
|
+
nodeFs.writeSync(1, caretToOutputEnd() + TERMINAL_RESTORE);
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
// A closed or redirected stdout. Nothing to restore and nothing to report.
|
|
151
|
+
}
|
|
82
152
|
}
|
|
83
153
|
//# sourceMappingURL=altScreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"altScreen.js","sourceRoot":"","sources":["../../src/cli/altScreen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAA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ACjD,IAAI,CAAC;QACH,kFAAkF;QAClF,mFAAmF;QACnF,sFAAsF;QACtF,yEAAyE;QACzE,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,CAAC,CAAC;IAC7D,CAAC;IAAC,MAAM,CAAC;QACP,2EAA2E;IAC7E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* appIdentity.ts — what the app calls itself to the terminal and the OS.
|
|
3
|
+
*
|
|
4
|
+
* By default a Node program is anonymous: the terminal tab keeps whatever the shell put
|
|
5
|
+
* there ("Command Prompt", a path), and a process list shows "node" / "Node.js
|
|
6
|
+
* JavaScript Runtime". Neither says what is actually running. This gives the session a
|
|
7
|
+
* name in the two places a name is cheap to set from inside the process.
|
|
8
|
+
*
|
|
9
|
+
* ## The terminal tab
|
|
10
|
+
*
|
|
11
|
+
* `OSC 2 ; <title> BEL` sets the window/tab title, and every VT-descended terminal —
|
|
12
|
+
* Windows Terminal included — honours it unless a profile is pinned to a fixed tab name.
|
|
13
|
+
* Written once at startup, before the alternate screen and the framebuffer take over, so
|
|
14
|
+
* it is a plain control write and nothing diffs it as a frame.
|
|
15
|
+
*
|
|
16
|
+
* ## The process name
|
|
17
|
+
*
|
|
18
|
+
* `process.title` renames the process where the platform lets it. On Linux and macOS it
|
|
19
|
+
* changes what `ps` and most monitors show. On Windows it sets the console title but does
|
|
20
|
+
* NOT change the image name Task Manager shows (that is `node.exe`, taken from the
|
|
21
|
+
* executable's own version resource) — changing THAT needs a renamed/repackaged binary,
|
|
22
|
+
* which is a build-time concern, not something a running process can do to itself. Set
|
|
23
|
+
* here anyway: it is correct where it works and harmless where it does not.
|
|
24
|
+
*/
|
|
25
|
+
/** The one place the display name lives, so the tab, the process and any future use agree. */
|
|
26
|
+
export const APP_NAME = "Mindweave";
|
|
27
|
+
const BEL = "\x07";
|
|
28
|
+
/** The OSC sequence that sets the terminal's window/tab title (pure). */
|
|
29
|
+
export function setTitleSequence(title) {
|
|
30
|
+
return `\x1b]2;${title}${BEL}`;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Name the session to the terminal and the OS. Best-effort and silent: a failure here
|
|
34
|
+
* must never be the reason the app does not start.
|
|
35
|
+
*
|
|
36
|
+
* @param write how to reach the real terminal — injected so a test can observe it and so
|
|
37
|
+
* the caller controls whether it is the raw stdout or a wrapper.
|
|
38
|
+
*/
|
|
39
|
+
export function nameSession(write = (d) => void process.stdout.write(d)) {
|
|
40
|
+
try {
|
|
41
|
+
process.title = APP_NAME;
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// Some platforms refuse to rename the process; the tab title below still works.
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
if (process.stdout.isTTY)
|
|
48
|
+
write(setTitleSequence(APP_NAME));
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
// No terminal, or a closed stream. Nothing to name.
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=appIdentity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appIdentity.js","sourceRoot":"","sources":["../../src/cli/appIdentity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,8FAA8F;AAC9F,MAAM,CAAC,MAAM,QAAQ,GAAG,WAAW,CAAC;AAEpC,MAAM,GAAG,GAAG,MAAM,CAAC;AAEnB,yEAAyE;AACzE,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,OAAO,UAAU,KAAK,GAAG,GAAG,EAAE,CAAC;AACjC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7F,IAAI,CAAC;QACH,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,gFAAgF;IAClF,CAAC;IACD,IAAI,CAAC;QACH,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK;YAAE,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC9D,CAAC;IAAC,MAAM,CAAC;QACP,oDAAoD;IACtD,CAAC;AACH,CAAC"}
|
package/dist/cli/attachments.js
CHANGED
|
@@ -43,6 +43,30 @@ const QUOTED_RE = /'([^']+)'|"([^"]+)"/g;
|
|
|
43
43
|
// (`\\host\…`), or POSIX (`/…`). Must start at a word boundary; stops at
|
|
44
44
|
// whitespace or a quote. Real-file gating (below) keeps stray matches harmless.
|
|
45
45
|
const BARE_ABS_RE = /(^|\s)((?:[A-Za-z]:[\\/]|\\\\|\/)[^\s"']+)/g;
|
|
46
|
+
// The same root shapes, anchored: "does this string start like an absolute path".
|
|
47
|
+
// Used to tell a dropped file from ordinary quoted prose without touching the disk.
|
|
48
|
+
const ABSOLUTE_RE = /^(?:[A-Za-z]:[\\/]|\\\\|\/)/;
|
|
49
|
+
/**
|
|
50
|
+
* Find the absolute paths a terminal drops into the input when a file is dragged onto it,
|
|
51
|
+
* quoted or bare. Syntactic only, and deliberately so: this runs on a keystroke, where
|
|
52
|
+
* touching the disk is not an option, and requiring a drive letter, a UNC prefix or a
|
|
53
|
+
* leading slash is enough to keep ordinary quoted prose ("hello world") out. Anything
|
|
54
|
+
* that turns out not to be a file is still handled correctly later, because resolution
|
|
55
|
+
* against the disk happens at send time exactly as it always did.
|
|
56
|
+
*/
|
|
57
|
+
export function findDroppedPaths(text) {
|
|
58
|
+
const out = [];
|
|
59
|
+
for (const m of text.matchAll(QUOTED_RE)) {
|
|
60
|
+
const path = (m[1] ?? m[2]);
|
|
61
|
+
if (ABSOLUTE_RE.test(path))
|
|
62
|
+
out.push({ start: m.index, end: m.index + m[0].length, path });
|
|
63
|
+
}
|
|
64
|
+
for (const m of text.matchAll(BARE_ABS_RE)) {
|
|
65
|
+
const start = m.index + m[1].length;
|
|
66
|
+
out.push({ start, end: start + m[2].length, path: trimEnds(m[2]) });
|
|
67
|
+
}
|
|
68
|
+
return out.sort((x, y) => x.start - y.start);
|
|
69
|
+
}
|
|
46
70
|
/**
|
|
47
71
|
* Resolve every file reference in `text` (an `@mention`, a quoted path, or a bare
|
|
48
72
|
* absolute path from a drag-and-drop) against `cwd`. A reference that points at a
|
|
@@ -51,7 +75,7 @@ const BARE_ABS_RE = /(^|\s)((?:[A-Za-z]:[\\/]|\\\\|\/)[^\s"']+)/g;
|
|
|
51
75
|
* quoted phrase, or a `/` in prose never breaks a message). When nothing attaches,
|
|
52
76
|
* `modelText`/`displayText` are the original text unchanged.
|
|
53
77
|
*/
|
|
54
|
-
export async function resolveAttachments(text, cwd, canSeeImages = false) {
|
|
78
|
+
export async function resolveAttachments(text, cwd, canSeeImages = false, labelFor) {
|
|
55
79
|
const candidates = findCandidates(text);
|
|
56
80
|
const seen = new Set();
|
|
57
81
|
const blocks = [];
|
|
@@ -81,7 +105,7 @@ export async function resolveAttachments(text, cwd, canSeeImages = false) {
|
|
|
81
105
|
// model, so it can ask about it rather than being unaware anything was shared.
|
|
82
106
|
if (isImage(abs)) {
|
|
83
107
|
if (c.kind === "path")
|
|
84
|
-
collapses.push({ start: c.start, end: c.end, label: basename(abs) });
|
|
108
|
+
collapses.push({ start: c.start, end: c.end, label: labelFor?.(abs) ?? basename(abs) });
|
|
85
109
|
if (!canSeeImages) {
|
|
86
110
|
notes.push(`attached image ${shown} (this model can't see images — describe it, or switch with /provider)`);
|
|
87
111
|
blocks.push(`[The user shared an image file: ${shown}. The model you are running can't see images, so its ` +
|
|
@@ -116,7 +140,7 @@ export async function resolveAttachments(text, cwd, canSeeImages = false) {
|
|
|
116
140
|
// A dropped/quoted path is long and ugly in the chat — collapse it to the file
|
|
117
141
|
// name. An `@mention` is already short, so leave it visible as typed.
|
|
118
142
|
if (c.kind === "path")
|
|
119
|
-
collapses.push({ start: c.start, end: c.end, label: basename(abs) });
|
|
143
|
+
collapses.push({ start: c.start, end: c.end, label: labelFor?.(abs) ?? basename(abs) });
|
|
120
144
|
}
|
|
121
145
|
const displayText = applyCollapses(text, collapses);
|
|
122
146
|
if (blocks.length === 0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachments.js","sourceRoot":"","sources":["../../src/cli/attachments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,EAAiB,MAAM,qBAAqB,CAAC;AAEzF,oFAAoF;AACpF,MAAM,SAAS,GAAG,GAAG,GAAG,IAAI,CAAC;AAE7B,mFAAmF;AACnF,MAAM,UAAU,GAAG,mBAAmB,CAAC;AACvC,8EAA8E;AAC9E,MAAM,SAAS,GAAG,sBAAsB,CAAC;AACzC,2EAA2E;AAC3E,yEAAyE;AACzE,gFAAgF;AAChF,MAAM,WAAW,GAAG,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"attachments.js","sourceRoot":"","sources":["../../src/cli/attachments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,EAAiB,MAAM,qBAAqB,CAAC;AAEzF,oFAAoF;AACpF,MAAM,SAAS,GAAG,GAAG,GAAG,IAAI,CAAC;AAE7B,mFAAmF;AACnF,MA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B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;QAAE,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;IAC1D,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,WAAW,CAAC,CAAS;IAC5B,IAAI,CAAC,GAAG,IAAI;QAAE,OAAO,GAAG,CAAC,IAAI,CAAC;IAC9B,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI;QAAE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;IACzD,OAAO,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* blockHeights.ts — bounding the table of measured block heights.
|
|
3
|
+
*
|
|
4
|
+
* The heights themselves live in a ref inside App; this is the one rule about them
|
|
5
|
+
* worth testing on its own, because getting it wrong is invisible in both directions.
|
|
6
|
+
*
|
|
7
|
+
* The table used to be a WeakMap, which needed no bounding at all: a block dropped past
|
|
8
|
+
* the scrollback cap became unreachable and took its height with it. It is a Map now,
|
|
9
|
+
* keyed by block id, because a resize has to walk every entry to rescale it and a
|
|
10
|
+
* WeakMap cannot be walked. That buys the rescale and inherits a leak: a long session
|
|
11
|
+
* appends blocks forever and nothing would ever remove their heights.
|
|
12
|
+
*
|
|
13
|
+
* Ids are handed out by the reducer in ascending order and never reused, so "older than
|
|
14
|
+
* the oldest block still on screen" is simply a smaller id, and pruning is a threshold
|
|
15
|
+
* rather than a set difference. Kept generous, because the cost of dropping a height
|
|
16
|
+
* that is still wanted is far higher than the cost of keeping one that is not: the block
|
|
17
|
+
* has to be laid out in full again to get it back.
|
|
18
|
+
*/
|
|
19
|
+
/** How many heights to keep. Comfortably more than the scrollback cap, so pruning can
|
|
20
|
+
* never reach a block that is still being rendered. */
|
|
21
|
+
export const MAX_TRACKED_HEIGHTS = 600;
|
|
22
|
+
/** Prune when the table grows past the cap, oldest ids first (in place). */
|
|
23
|
+
export function pruneHeights(table, cap = MAX_TRACKED_HEIGHTS) {
|
|
24
|
+
if (table.size <= cap)
|
|
25
|
+
return;
|
|
26
|
+
// Ascending, so the ids removed are the oldest blocks — the ones already dropped past
|
|
27
|
+
// the scrollback cap and therefore never rendered again.
|
|
28
|
+
const ids = [...table.keys()].sort((a, b) => a - b);
|
|
29
|
+
for (let i = 0; i < ids.length - cap; i++)
|
|
30
|
+
table.delete(ids[i]);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Whether a block that is about to be laid out still owes a real measurement (pure).
|
|
34
|
+
*
|
|
35
|
+
* Two ways it can. The obvious one is a block that changed — the reducer hands back a
|
|
36
|
+
* new object, so the height recorded against the old one describes different content.
|
|
37
|
+
*
|
|
38
|
+
* The one that was missed for longer is a SCALED entry. A width change multiplies every
|
|
39
|
+
* recorded height by the ratio of the widths, which keeps the scroll arithmetic roughly
|
|
40
|
+
* right without laying the whole scrollback out again. But the entry it leaves behind
|
|
41
|
+
* still points at the same block object, so a check for "did the block change" says no
|
|
42
|
+
* and the estimate is never paid off. It then sizes a spacer in the virtual window
|
|
43
|
+
* forever, and since a paragraph that wrapped to one row does not become 1.4 rows at a
|
|
44
|
+
* narrower width but two, blocks land a row or two from where they belong — text that
|
|
45
|
+
* will not settle, worst where the terminal is narrowest.
|
|
46
|
+
*
|
|
47
|
+
* The entry stays USABLE either way; this only decides whether it is worth re-measuring
|
|
48
|
+
* when the block happens to be rendered. That keeps the cost bounded by what is on
|
|
49
|
+
* screen rather than by the length of the session.
|
|
50
|
+
*/
|
|
51
|
+
export function needsMeasure(entry, block) {
|
|
52
|
+
if (entry === undefined)
|
|
53
|
+
return true;
|
|
54
|
+
if (entry.block !== block)
|
|
55
|
+
return true;
|
|
56
|
+
return entry.scaled === true;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=blockHeights.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blockHeights.js","sourceRoot":"","sources":["../../src/cli/blockHeights.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;wDACwD;AACxD,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEvC,4EAA4E;AAC5E,MAAM,UAAU,YAAY,CAAC,KAA2B,EAAE,GAAG,GAAG,mBAAmB;IACjF,IAAI,KAAK,CAAC,IAAI,IAAI,GAAG;QAAE,OAAO;IAC9B,sFAAsF;IACtF,yDAAyD;IACzD,MAAM,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACpD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC,EAAE;QAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAE,CAAC,CAAC;AACnE,CAAC;AAWD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,YAAY,CAAC,KAA8B,EAAE,KAAc;IACzE,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACrC,IAAI,KAAK,CAAC,KAAK,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IACvC,OAAO,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* caretPark.ts — put the TERMINAL's own cursor where the text caret belongs.
|
|
3
|
+
*
|
|
4
|
+
* A caret drawn by the app has to live in a cell, because a terminal grid has no room
|
|
5
|
+
* between two of them. Every version of that is wrong in some way: standing ON a character
|
|
6
|
+
* hides it for half of each blink, and taking a column of its own opens a gap between the
|
|
7
|
+
* letters it sits between. The gap is what a real text field never has.
|
|
8
|
+
*
|
|
9
|
+
* The terminal's own cursor has no such problem — it is drawn BETWEEN cells by the
|
|
10
|
+
* terminal itself, costs no column, and blinks (or does not) according to the settings the
|
|
11
|
+
* user already chose. So nothing is drawn here. After each frame the cursor is parked at
|
|
12
|
+
* the right cell and shown.
|
|
13
|
+
*
|
|
14
|
+
* Two things fall out of that for free: an IME renders its preedit text at the physical
|
|
15
|
+
* cursor, so CJK input appears inline instead of somewhere else on screen; and screen
|
|
16
|
+
* readers and magnifiers follow the native cursor, so they follow the caret.
|
|
17
|
+
*
|
|
18
|
+
* ## Why the position comes from LAYOUT, not from the painted text
|
|
19
|
+
*
|
|
20
|
+
* The first version of this found the caret's row by searching the painted screen for the
|
|
21
|
+
* row's text. It worked until it did not: a row ending in a space is painted against a
|
|
22
|
+
* background of padding spaces, a row wider than the box is painted truncated, and in
|
|
23
|
+
* either case the search fails and the cursor is dropped. Typing a space made the caret
|
|
24
|
+
* vanish until the next keystroke — a bug that only exists because the position was being
|
|
25
|
+
* inferred from pixels rather than known.
|
|
26
|
+
*
|
|
27
|
+
* The layout already knows. Ink measures every node, and `measureElement` reports a node's
|
|
28
|
+
* position within the live region — which is the whole screen here, since the transcript
|
|
29
|
+
* is re-rendered each frame and nothing is in a Static region. So the input declares the
|
|
30
|
+
* BOX its caret sits in, and the column within it, and the answer is read from the layout
|
|
31
|
+
* at paint time. Nothing to match, nothing to fail.
|
|
32
|
+
*/
|
|
33
|
+
import { measureElement } from "ink";
|
|
34
|
+
let declared = null;
|
|
35
|
+
let onMoved = null;
|
|
36
|
+
/**
|
|
37
|
+
* Called when the caret moves, so the renderer can park it even if NO FRAME is written.
|
|
38
|
+
*
|
|
39
|
+
* This is the whole reason it exists. Ink does not write a frame when its output is
|
|
40
|
+
* unchanged, and typing a space at the end of a line produces an identical frame —
|
|
41
|
+
* trailing blanks are indistinguishable from the padding already there. So the one thing
|
|
42
|
+
* that DID change, the cursor, never reached the terminal, and the caret sat a character
|
|
43
|
+
* behind until the after-burst repaint fired four hundred milliseconds later. That pause
|
|
44
|
+
* is the whole bug: everything else was already correct.
|
|
45
|
+
*/
|
|
46
|
+
export function onCaretMoved(fn) {
|
|
47
|
+
onMoved = fn;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Declare the caret, or clear it with null.
|
|
51
|
+
*
|
|
52
|
+
* Cleared whenever the input is not the thing being typed into — an open picker, a turn in
|
|
53
|
+
* flight with no prompt — so the cursor is not left parked in a box nobody is using.
|
|
54
|
+
*/
|
|
55
|
+
export function declareCaret(caret) {
|
|
56
|
+
const moved = caret?.column !== declared?.column || caret?.ref !== declared?.ref;
|
|
57
|
+
declared = caret;
|
|
58
|
+
if (moved)
|
|
59
|
+
onMoved?.();
|
|
60
|
+
}
|
|
61
|
+
export function caretDeclaration() {
|
|
62
|
+
return declared;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The screen cell the caret sits on, or null when there is nothing to park.
|
|
66
|
+
*
|
|
67
|
+
* Read at PAINT time, which is after layout, so the measurements are the ones the frame
|
|
68
|
+
* about to be written was built from. Null is a real answer and the caller must respect
|
|
69
|
+
* it: parking at a guess puts a visible cursor somewhere the user is not typing.
|
|
70
|
+
*/
|
|
71
|
+
export function caretCell(caret = declared) {
|
|
72
|
+
if (!caret?.ref.current)
|
|
73
|
+
return null;
|
|
74
|
+
try {
|
|
75
|
+
const box = measureElement(caret.ref.current);
|
|
76
|
+
// A node that has never been laid out measures as nothing. Parking inside a
|
|
77
|
+
// zero-width box would put the cursor at the top-left corner of the screen.
|
|
78
|
+
if (box.width === 0 && box.height === 0)
|
|
79
|
+
return null;
|
|
80
|
+
const column = Math.max(0, Math.min(caret.column, Math.max(0, box.width - 1)));
|
|
81
|
+
return { x: box.x + column, y: box.y };
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// The node was unmounted between the declaration and the paint.
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/** Move the terminal cursor to a cell and show it. Coordinates are 1-based on the wire. */
|
|
89
|
+
export function parkAt(cell) {
|
|
90
|
+
return `\x1b[${cell.y + 1};${cell.x + 1}H\x1b[?25h`;
|
|
91
|
+
}
|
|
92
|
+
/** Hide the cursor, for the span of a paint and for frames with no caret on screen. */
|
|
93
|
+
export const HIDE = "\x1b[?25l";
|
|
94
|
+
//# sourceMappingURL=caretPark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caretPark.js","sourceRoot":"","sources":["../../src/cli/caretPark.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,cAAc,EAAmB,MAAM,KAAK,CAAC;AAiBtD,IAAI,QAAQ,GAA4B,IAAI,CAAC;AAC7C,IAAI,OAAO,GAAwB,IAAI,CAAC;AAExC;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAAC,EAAuB;IAClD,OAAO,GAAG,EAAE,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,KAA8B;IACzD,MAAM,KAAK,GAAG,KAAK,EAAE,MAAM,KAAK,QAAQ,EAAE,MAAM,IAAI,KAAK,EAAE,GAAG,KAAK,QAAQ,EAAE,GAAG,CAAC;IACjF,QAAQ,GAAG,KAAK,CAAC;IACjB,IAAI,KAAK;QAAE,OAAO,EAAE,EAAE,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,QAAiC,QAAQ;IACjE,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IACrC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC9C,4EAA4E;QAC5E,4EAA4E;QAC5E,IAAI,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACrD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/E,OAAO,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC;QACP,gEAAgE;QAChE,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,MAAM,CAAC,IAA8B;IACnD,OAAO,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC;AACtD,CAAC;AAED,uFAAuF;AACvF,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* clipboard.ts — put selected text on the system clipboard.
|
|
3
|
+
*
|
|
4
|
+
* Two routes, tried in order, because neither alone covers where a terminal runs.
|
|
5
|
+
*
|
|
6
|
+
* OSC 52 asks the TERMINAL to set the clipboard. It is one escape sequence on the stream
|
|
7
|
+
* already open, it needs no child process, and it is the only thing that works over SSH,
|
|
8
|
+
* where the machine running this has no clipboard of its own. Terminals may refuse it,
|
|
9
|
+
* and there is no reply to say whether they did.
|
|
10
|
+
*
|
|
11
|
+
* So a local helper runs as well when there is one. Writing the same text twice is
|
|
12
|
+
* harmless: both routes set the same clipboard to the same string, and whichever the
|
|
13
|
+
* terminal honours, the result is what the user selected.
|
|
14
|
+
*/
|
|
15
|
+
import { spawn } from "node:child_process";
|
|
16
|
+
/** Above this, skip OSC 52. Terminals cap what they accept and a truncated paste is
|
|
17
|
+
* worse than one route quietly not firing; the local helper has no such limit. */
|
|
18
|
+
const OSC52_MAX_BYTES = 100_000;
|
|
19
|
+
/** The command that owns the clipboard on this platform, if one ships with it. */
|
|
20
|
+
function helper() {
|
|
21
|
+
if (process.platform === "win32")
|
|
22
|
+
return { command: "clip", args: [] };
|
|
23
|
+
if (process.platform === "darwin")
|
|
24
|
+
return { command: "pbcopy", args: [] };
|
|
25
|
+
// Wayland first, then X11. Both are absent on a headless machine, where OSC 52 is
|
|
26
|
+
// the only route anyway.
|
|
27
|
+
return { command: "wl-copy", args: [] };
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The escape sequence that hands `text` to the terminal.
|
|
31
|
+
*
|
|
32
|
+
* Exported for tests: the encoding is the part that can be wrong, and it is not
|
|
33
|
+
* observable from the outside once written to a stream.
|
|
34
|
+
*/
|
|
35
|
+
export function osc52(text) {
|
|
36
|
+
return `\x1b]52;c;${Buffer.from(text, "utf8").toString("base64")}\x07`;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Copy `text`. Never throws and never rejects: a clipboard that does not take is a
|
|
40
|
+
* disappointment, not an error worth interrupting the session for.
|
|
41
|
+
*/
|
|
42
|
+
export function copyToClipboard(text, out = process.stdout) {
|
|
43
|
+
if (text === "")
|
|
44
|
+
return;
|
|
45
|
+
if (Buffer.byteLength(text, "utf8") <= OSC52_MAX_BYTES) {
|
|
46
|
+
try {
|
|
47
|
+
out.write(osc52(text));
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
// A closed or non-writable stream is not worth reporting here.
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const local = helper();
|
|
54
|
+
if (!local)
|
|
55
|
+
return;
|
|
56
|
+
try {
|
|
57
|
+
const child = spawn(local.command, local.args, { stdio: ["pipe", "ignore", "ignore"] });
|
|
58
|
+
// A missing helper surfaces as an error event, not a throw, and means nothing more
|
|
59
|
+
// than "this platform did not have that one".
|
|
60
|
+
child.on("error", () => { });
|
|
61
|
+
child.stdin.on("error", () => { });
|
|
62
|
+
child.stdin.end(text, "utf8");
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
// Spawning can fail outright on a locked-down system. OSC 52 may still have worked.
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=clipboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clipboard.js","sourceRoot":"","sources":["../../src/cli/clipboard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C;mFACmF;AACnF,MAAM,eAAe,GAAG,OAAO,CAAC;AAEhC,kFAAkF;AAClF,SAAS,MAAM;IACb,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO;QAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IACvE,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ;QAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IAC1E,kFAAkF;IAClF,yBAAyB;IACzB,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;AAC1C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAC,IAAY;IAChC,OAAO,aAAa,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;AACzE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,MAA0B,OAAO,CAAC,MAAM;IACpF,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO;IAExB,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,eAAe,EAAE,CAAC;QACvD,IAAI,CAAC;YACH,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QACzB,CAAC;QAAC,MAAM,CAAC;YACP,+DAA+D;QACjE,CAAC;IACH,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC;IACvB,IAAI,CAAC,KAAK;QAAE,OAAO;IACnB,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;QACxF,mFAAmF;QACnF,8CAA8C;QAC9C,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAC5B,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAClC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,oFAAoF;IACtF,CAAC;AACH,CAAC"}
|
package/dist/cli/commandLabel.js
CHANGED
|
@@ -63,13 +63,30 @@ const REDIRECTION = /\s*(?:\d?>>?&?\d?|\d?<)\s*\S*\s*$/;
|
|
|
63
63
|
*/
|
|
64
64
|
export function commandLabel(command, budget) {
|
|
65
65
|
const room = Math.max(4, budget);
|
|
66
|
-
|
|
66
|
+
const whole = command.trim();
|
|
67
|
+
const first = firstSegment(whole);
|
|
68
|
+
// Did dropping the tail lose a further COMMAND, rather than plumbing?
|
|
69
|
+
//
|
|
70
|
+
// This matters more than it looks. `cd app; npm install` was named `cd app`, with
|
|
71
|
+
// nothing to say the label was partial — so a row that reported a directory change
|
|
72
|
+
// sat above a screenful of npm output, and the only reading available was that the
|
|
73
|
+
// tool had run something other than what it said. A trailing separator with nothing
|
|
74
|
+
// after it is not that, so the remainder is checked for content rather than the
|
|
75
|
+
// separator merely being present.
|
|
76
|
+
const chained = whole.slice(first.length).replace(/^\s*(?:&&|\|\||[;|])+/, "").trim() !== "";
|
|
77
|
+
let label = first.trim();
|
|
67
78
|
for (let previous = ""; previous !== label;) {
|
|
68
79
|
previous = label;
|
|
69
80
|
label = label.replace(REDIRECTION, "").trim();
|
|
70
81
|
}
|
|
71
82
|
if (label === "")
|
|
72
|
-
label =
|
|
83
|
+
label = whole;
|
|
84
|
+
// The ellipsis is the same mark a length cut uses, and it means the same thing here:
|
|
85
|
+
// the row is a NAME for the command, and there is more of it than the name shows.
|
|
86
|
+
// Redirection is deliberately not marked — `2>&1` is plumbing on this same command,
|
|
87
|
+
// not another one, so the name is complete without it.
|
|
88
|
+
if (chained)
|
|
89
|
+
return label.length + 1 <= room ? `${label}…` : `${label.slice(0, Math.max(1, room - 1))}…`;
|
|
73
90
|
if (label.length <= room)
|
|
74
91
|
return label;
|
|
75
92
|
// Cut at a space, so the last thing shown is a whole token rather than half a flag —
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandLabel.js","sourceRoot":"","sources":["../../src/cli/commandLabel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;sBACsB;AACtB,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B,mEAAmE;AACnE,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,IAAI,KAAyB,CAAC;IAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,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,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC;IAC1G,OAAO,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC;AAC9B,CAAC"}
|
package/dist/cli/commands.js
CHANGED
|
@@ -21,6 +21,7 @@ export const BASE_COMMANDS = [
|
|
|
21
21
|
{ name: "/key", description: "add or replace an API key" },
|
|
22
22
|
{ name: "/model", description: "choose which model answers, from the current provider" },
|
|
23
23
|
{ name: "/think", description: "set the reasoning level for the model" },
|
|
24
|
+
{ name: "/screen", description: "choose the shell: fullscreen, or inline (beta)" },
|
|
24
25
|
{ name: "/rules", description: "list rules, or add one: /rules <directive>" },
|
|
25
26
|
{ name: "/skills", description: "list skills, or make one: /skills <description>" },
|
|
26
27
|
{ name: "/forbidden", description: "list protected paths, or add: /forbidden <path>" },
|
package/dist/cli/commands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAQH;qDACqD;AACrD,MAAM,CAAC,MAAM,aAAa,GAAkB;IAC1C,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE;IAChD,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,2EAA2E,EAAE;IAC3G,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,2CAA2C,EAAE;IAC/E,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,2BAA2B,EAAE;IAC1D,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uDAAuD,EAAE;IACxF,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uCAAuC,EAAE;IACxE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4CAA4C,EAAE;IAC7E,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,iD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EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,+BAA+B,EAAE;CACpE,CAAC"}
|
|
@@ -54,7 +54,7 @@ function BlockViewInner({ block, columns, tightTop }) {
|
|
|
54
54
|
return (_jsxs(Box, { marginTop: 1, flexDirection: "row", children: [_jsx(Box, { minWidth: 2, children: _jsx(Text, { children: "●" }) }), _jsx(WrappedText, { text: renderMarkdown(block.text, proseWidth), width: proseWidth })] }));
|
|
55
55
|
}
|
|
56
56
|
case "tool":
|
|
57
|
-
return (_jsx(ToolLine, { name: block.name, arg: block.arg, status: block.status, action: block.action, summary: block.summary, detail: block.detail, detailKind: block.detailKind, meta: block.meta, columns: columns, live: block.live, tightTop: tightTop }));
|
|
57
|
+
return (_jsx(ToolLine, { name: block.name, arg: block.arg, status: block.status, action: block.action, summary: block.summary, detail: block.detail, detailKind: block.detailKind, meta: block.meta, columns: columns, live: block.live, tightTop: tightTop, since: block.since, waited: block.waited }));
|
|
58
58
|
case "tools":
|
|
59
59
|
return _jsx(ToolGroup, { items: block.items, live: block.live, columns: columns, tightTop: tightTop });
|
|
60
60
|
case "subagent":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockView.js","sourceRoot":"","sources":["../../../src/cli/components/BlockView.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAA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