codebase-cli 2.0.0-pre.4 → 2.0.0-pre.40
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/agent/agent.js +43 -15
- package/dist/agent/agent.js.map +1 -1
- package/dist/agent/config.js +61 -20
- package/dist/agent/config.js.map +1 -1
- package/dist/agent/events.bench.js +84 -0
- package/dist/agent/events.bench.js.map +1 -0
- package/dist/agent/prompt-suggestion.js +141 -0
- package/dist/agent/prompt-suggestion.js.map +1 -0
- package/dist/agent/system-prompt.js +15 -0
- package/dist/agent/system-prompt.js.map +1 -1
- package/dist/app-server/protocol.js +7 -0
- package/dist/app-server/protocol.js.map +1 -0
- package/dist/app-server/server.js +241 -0
- package/dist/app-server/server.js.map +1 -0
- package/dist/auth/cli.js +1 -1
- package/dist/auth/cli.js.map +1 -1
- package/dist/auth/credentials.js +33 -2
- package/dist/auth/credentials.js.map +1 -1
- package/dist/auth/flow.js +145 -24
- package/dist/auth/flow.js.map +1 -1
- package/dist/auth/token-manager.js +73 -0
- package/dist/auth/token-manager.js.map +1 -0
- package/dist/cli.js +56 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/builtins.js +160 -14
- package/dist/commands/builtins.js.map +1 -1
- package/dist/commands/registry.js +46 -1
- package/dist/commands/registry.js.map +1 -1
- package/dist/compaction/monitor.js +38 -0
- package/dist/compaction/monitor.js.map +1 -0
- package/dist/config/types.js.map +1 -1
- package/dist/glue/client.js +12 -2
- package/dist/glue/client.js.map +1 -1
- package/dist/hooks/manager.js +8 -2
- package/dist/hooks/manager.js.map +1 -1
- package/dist/memory/store.js +2 -3
- package/dist/memory/store.js.map +1 -1
- package/dist/plan/run-flow.js +89 -0
- package/dist/plan/run-flow.js.map +1 -0
- package/dist/projects/cli.js +92 -0
- package/dist/projects/cli.js.map +1 -0
- package/dist/projects/client.js +120 -0
- package/dist/projects/client.js.map +1 -0
- package/dist/projects/types.js +2 -0
- package/dist/projects/types.js.map +1 -0
- package/dist/skills/platform-loader.js +133 -38
- package/dist/skills/platform-loader.js.map +1 -1
- package/dist/tools/__test__/mock-tool-context.js +31 -0
- package/dist/tools/__test__/mock-tool-context.js.map +1 -0
- package/dist/tools/file-state-cache.js.map +1 -1
- package/dist/tools/read-file.js +7 -2
- package/dist/tools/read-file.js.map +1 -1
- package/dist/ui/App.js +109 -110
- package/dist/ui/App.js.map +1 -1
- package/dist/ui/CompactionBanner.js +23 -0
- package/dist/ui/CompactionBanner.js.map +1 -0
- package/dist/ui/FirstRunSetup.js +66 -14
- package/dist/ui/FirstRunSetup.js.map +1 -1
- package/dist/ui/Input.js +370 -20
- package/dist/ui/Input.js.map +1 -1
- package/dist/ui/Markdown.js +286 -0
- package/dist/ui/Markdown.js.map +1 -0
- package/dist/ui/Message.js +110 -48
- package/dist/ui/Message.js.map +1 -1
- package/dist/ui/MessageList.js +100 -3
- package/dist/ui/MessageList.js.map +1 -1
- package/dist/ui/Permission.js +43 -20
- package/dist/ui/Permission.js.map +1 -1
- package/dist/ui/PixelC.js +25 -0
- package/dist/ui/PixelC.js.map +1 -0
- package/dist/ui/Status.js +267 -7
- package/dist/ui/Status.js.map +1 -1
- package/dist/ui/Throbber.js +11 -7
- package/dist/ui/Throbber.js.map +1 -1
- package/dist/ui/Welcome.js +59 -0
- package/dist/ui/Welcome.js.map +1 -0
- package/dist/ui/attachments.js +68 -0
- package/dist/ui/attachments.js.map +1 -0
- package/dist/ui/debug-input.js +44 -0
- package/dist/ui/debug-input.js.map +1 -0
- package/dist/ui/diff-summary.js +171 -0
- package/dist/ui/diff-summary.js.map +1 -0
- package/dist/ui/highlight.js +324 -0
- package/dist/ui/highlight.js.map +1 -0
- package/dist/ui/history-store.js +60 -0
- package/dist/ui/history-store.js.map +1 -0
- package/dist/ui/input-state.js +125 -1
- package/dist/ui/input-state.js.map +1 -1
- package/dist/ui/path-complete.js +102 -0
- package/dist/ui/path-complete.js.map +1 -0
- package/dist/ui/paths.js +41 -0
- package/dist/ui/paths.js.map +1 -0
- package/dist/ui/shell-escape.js +42 -0
- package/dist/ui/shell-escape.js.map +1 -0
- package/dist/ui/terminal-restore.js +83 -0
- package/dist/ui/terminal-restore.js.map +1 -0
- package/dist/ui/terminal-title.js +21 -0
- package/dist/ui/terminal-title.js.map +1 -0
- package/dist/ui/tool-call-line.js +83 -0
- package/dist/ui/tool-call-line.js.map +1 -0
- package/dist/ui/tool-labels.js +194 -0
- package/dist/ui/tool-labels.js.map +1 -0
- package/dist/ui/truncated-output.js +42 -0
- package/dist/ui/truncated-output.js.map +1 -0
- package/dist/ui/use-coalesced-agent-events.js +70 -0
- package/dist/ui/use-coalesced-agent-events.js.map +1 -0
- package/dist/ui/use-prompt-suggestion.js +52 -0
- package/dist/ui/use-prompt-suggestion.js.map +1 -0
- package/dist/ui/wrapped-lines.js +18 -0
- package/dist/ui/wrapped-lines.js.map +1 -0
- package/package.json +4 -1
package/dist/ui/Input.js
CHANGED
|
@@ -1,7 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Box, Text, useInput } from "ink";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useInput, useStdin } from "ink";
|
|
3
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { logInputEvent } from "./debug-input.js";
|
|
5
|
+
import { backspace, deleteForward, expandPastes, initialInputState, insertChar, insertPaste, killToEnd, killToStart, killWordBack, looksLikePaste, moveEnd, moveLeft, moveRight, moveStart, undo, yank, } from "./input-state.js";
|
|
6
|
+
import { completePath, findAtTokenAt } from "./path-complete.js";
|
|
7
|
+
const MAX_SUGGESTIONS = 6;
|
|
8
|
+
const PLACEHOLDERS_FRESH = [
|
|
9
|
+
"Ask anything · / for commands",
|
|
10
|
+
"Try /help to see what I can do",
|
|
11
|
+
"Tell me what to build · / for commands",
|
|
12
|
+
"Paste a stack trace, a TODO, or a question",
|
|
13
|
+
"What are we working on?",
|
|
14
|
+
];
|
|
15
|
+
const PLACEHOLDERS_RETURNING = [
|
|
16
|
+
"Welcome back · ↑ for prior prompts",
|
|
17
|
+
"Picking up where you left off · ↑ for history",
|
|
18
|
+
"What's next? · ↑ recalls past prompts",
|
|
19
|
+
"Ready when you are · / for commands · ↑ for history",
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* Pick a placeholder once per Input mount. The returning-user variants
|
|
23
|
+
* mention ↑ for history so users with persisted prompts learn the
|
|
24
|
+
* shortcut; fresh sessions emphasize / and free-form prompts.
|
|
25
|
+
*/
|
|
26
|
+
function pickPlaceholder(hasHistory) {
|
|
27
|
+
const pool = hasHistory ? PLACEHOLDERS_RETURNING : PLACEHOLDERS_FRESH;
|
|
28
|
+
return pool[Math.floor(Math.random() * pool.length)];
|
|
29
|
+
}
|
|
5
30
|
/**
|
|
6
31
|
* Single-line input with Emacs / readline editing. Cursor positioning,
|
|
7
32
|
* kill ring with Ctrl-K/U/W/Y, and Ctrl-Z undo. Stay in tight feedback
|
|
@@ -18,22 +43,194 @@ import { backspace, deleteForward, initialInputState, insertChar, killToEnd, kil
|
|
|
18
43
|
* Ctrl-W kill word before cursor
|
|
19
44
|
* Ctrl-Y yank (paste from kill ring)
|
|
20
45
|
* Ctrl-Z undo
|
|
21
|
-
* Ctrl-C
|
|
46
|
+
* Ctrl-C busy → cancel turn (stay in app); double-tap → exit
|
|
22
47
|
*/
|
|
23
|
-
export function Input({ disabled, onSubmit, onAbort }) {
|
|
48
|
+
export function Input({ disabled, onSubmit, onAbort, commands, history, cwd, suggestion, onSuggestionDismiss, }) {
|
|
24
49
|
const [state, setState] = useState(initialInputState());
|
|
50
|
+
const [suggestionIdx, setSuggestionIdx] = useState(0);
|
|
51
|
+
/**
|
|
52
|
+
* History cursor:
|
|
53
|
+
* -1 → live buffer (no history navigation in progress)
|
|
54
|
+
* 0..N-1 → indexing from the newest backwards (0 = most recent)
|
|
55
|
+
* We snapshot the live buffer the first time the user steps into
|
|
56
|
+
* history so ↓-past-newest returns to whatever they were typing.
|
|
57
|
+
*/
|
|
58
|
+
const [historyIdx, setHistoryIdx] = useState(-1);
|
|
59
|
+
const [liveBuffer, setLiveBuffer] = useState(null);
|
|
60
|
+
// Stable per-mount placeholder so the hint doesn't flicker between renders.
|
|
61
|
+
const placeholderRef = useRef(pickPlaceholder((history?.length ?? 0) > 0));
|
|
62
|
+
// @-path completion cycler — `pathMatches` is the list, `pathIdx` is
|
|
63
|
+
// the current cycle position. Both reset whenever the buffer
|
|
64
|
+
// changes away from the active @-token.
|
|
65
|
+
const [pathMatches, setPathMatches] = useState([]);
|
|
66
|
+
const [pathIdx, setPathIdx] = useState(0);
|
|
67
|
+
const lastAtTokenRef = useRef(null);
|
|
68
|
+
useBracketedPasteHandler((content) => setState((s) => insertPaste(s, content)));
|
|
69
|
+
// Autocomplete only fires when the buffer starts with `/` AND there's
|
|
70
|
+
// no whitespace yet (so once the user types a space, they're past the
|
|
71
|
+
// command name and into args — no more suggestions).
|
|
72
|
+
const autocompleteActive = state.buffer.startsWith("/") && !state.buffer.includes(" ");
|
|
73
|
+
const suggestions = useMemo(() => {
|
|
74
|
+
if (!autocompleteActive || !commands)
|
|
75
|
+
return [];
|
|
76
|
+
const query = state.buffer.slice(1).toLowerCase();
|
|
77
|
+
const matches = commands.filter((c) => c.name.toLowerCase().startsWith(query));
|
|
78
|
+
return matches.slice(0, MAX_SUGGESTIONS);
|
|
79
|
+
}, [autocompleteActive, commands, state.buffer]);
|
|
80
|
+
const clampedSuggestionIdx = Math.min(suggestionIdx, Math.max(0, suggestions.length - 1));
|
|
25
81
|
useInput((input, key) => {
|
|
82
|
+
// First thing — log every keystroke when --debug-input is on, so
|
|
83
|
+
// we can diagnose "key X doesn't work" reports from real terminals.
|
|
84
|
+
logInputEvent(input, key);
|
|
26
85
|
if (key.ctrl && input === "c") {
|
|
27
86
|
onAbort?.();
|
|
28
87
|
return;
|
|
29
88
|
}
|
|
30
89
|
if (disabled)
|
|
31
90
|
return;
|
|
91
|
+
// Ghost-text suggestion accept. Only fires when there's no slash
|
|
92
|
+
// or @-path completion in flight AND the buffer is empty (the
|
|
93
|
+
// suggestion is contextual to the conversation, not to whatever
|
|
94
|
+
// the user is mid-typing). Tab fills the buffer and clears the
|
|
95
|
+
// suggestion. Any other keystroke dismisses the suggestion so it
|
|
96
|
+
// doesn't keep flashing after the user has started a fresh idea.
|
|
97
|
+
if (suggestion && state.buffer.length === 0) {
|
|
98
|
+
if (key.tab && !autocompleteActive) {
|
|
99
|
+
setState({ ...initialInputState(), buffer: suggestion, cursor: suggestion.length });
|
|
100
|
+
onSuggestionDismiss?.();
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
// Anything user-driven that isn't bare cursor navigation should
|
|
104
|
+
// kill the ghost — they've moved on.
|
|
105
|
+
const isPassThrough = key.upArrow ||
|
|
106
|
+
key.downArrow ||
|
|
107
|
+
key.leftArrow ||
|
|
108
|
+
key.rightArrow ||
|
|
109
|
+
key.escape ||
|
|
110
|
+
(key.ctrl && (input === "c" || input === "d"));
|
|
111
|
+
if (!isPassThrough) {
|
|
112
|
+
onSuggestionDismiss?.();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
// Autocomplete navigation runs BEFORE generic input handling so Tab
|
|
116
|
+
// doesn't insert a literal tab and arrow keys don't fight cursor
|
|
117
|
+
// movement when we have a suggestion list to navigate.
|
|
118
|
+
if (autocompleteActive && suggestions.length > 0) {
|
|
119
|
+
if (key.upArrow) {
|
|
120
|
+
setSuggestionIdx((i) => (i - 1 + suggestions.length) % suggestions.length);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (key.downArrow) {
|
|
124
|
+
setSuggestionIdx((i) => (i + 1) % suggestions.length);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
if (key.tab) {
|
|
128
|
+
const chosen = suggestions[clampedSuggestionIdx];
|
|
129
|
+
setState({ ...initialInputState(), buffer: `/${chosen.name} `, cursor: chosen.name.length + 2 });
|
|
130
|
+
setSuggestionIdx(0);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
// @-path Tab completion. Only kicks in when slash autocomplete is
|
|
135
|
+
// inactive and the cursor sits inside an @-token. Repeated Tab
|
|
136
|
+
// cycles through matches; any keypress other than Tab clears the
|
|
137
|
+
// cycle so the next Tab recomputes a fresh list.
|
|
138
|
+
if (key.tab && !autocompleteActive && cwd) {
|
|
139
|
+
const at = findAtTokenAt(state.buffer, state.cursor);
|
|
140
|
+
if (at) {
|
|
141
|
+
let matches = pathMatches;
|
|
142
|
+
let idx = pathIdx;
|
|
143
|
+
const cached = lastAtTokenRef.current;
|
|
144
|
+
const sameContext = cached && cached.buffer === state.buffer && cached.cursor === state.cursor && matches.length > 0;
|
|
145
|
+
if (!sameContext) {
|
|
146
|
+
matches = completePath(at.prefix, cwd);
|
|
147
|
+
idx = 0;
|
|
148
|
+
setPathMatches(matches);
|
|
149
|
+
setPathIdx(0);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
idx = (idx + 1) % matches.length;
|
|
153
|
+
setPathIdx(idx);
|
|
154
|
+
}
|
|
155
|
+
if (matches.length === 0)
|
|
156
|
+
return;
|
|
157
|
+
const chosen = matches[idx];
|
|
158
|
+
const before = state.buffer.slice(0, at.start);
|
|
159
|
+
const after = state.buffer.slice(state.cursor);
|
|
160
|
+
const inserted = `@${chosen}`;
|
|
161
|
+
const newBuffer = before + inserted + after;
|
|
162
|
+
const newCursor = before.length + inserted.length;
|
|
163
|
+
setState({ ...initialInputState(), buffer: newBuffer, cursor: newCursor });
|
|
164
|
+
lastAtTokenRef.current = { buffer: newBuffer, cursor: newCursor };
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// History navigation: only when autocomplete is closed and the
|
|
169
|
+
// cursor sits at the start of the buffer (or buffer is empty).
|
|
170
|
+
// That way ↑/↓ in the middle of a long line still behave as
|
|
171
|
+
// cursor moves, matching shell readline.
|
|
172
|
+
if (history && history.length > 0 && !autocompleteActive && state.cursor === 0) {
|
|
173
|
+
if (key.upArrow) {
|
|
174
|
+
const nextIdx = historyIdx < 0 ? 0 : Math.min(historyIdx + 1, history.length - 1);
|
|
175
|
+
if (historyIdx < 0)
|
|
176
|
+
setLiveBuffer(state.buffer);
|
|
177
|
+
const entry = history[history.length - 1 - nextIdx] ?? "";
|
|
178
|
+
setHistoryIdx(nextIdx);
|
|
179
|
+
setState({ ...initialInputState(), buffer: entry, cursor: entry.length });
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (key.downArrow) {
|
|
183
|
+
if (historyIdx < 0)
|
|
184
|
+
return; // already at live buffer
|
|
185
|
+
const nextIdx = historyIdx - 1;
|
|
186
|
+
if (nextIdx < 0) {
|
|
187
|
+
const restored = liveBuffer ?? "";
|
|
188
|
+
setHistoryIdx(-1);
|
|
189
|
+
setLiveBuffer(null);
|
|
190
|
+
setState({ ...initialInputState(), buffer: restored, cursor: restored.length });
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
const entry = history[history.length - 1 - nextIdx] ?? "";
|
|
194
|
+
setHistoryIdx(nextIdx);
|
|
195
|
+
setState({ ...initialInputState(), buffer: entry, cursor: entry.length });
|
|
196
|
+
}
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
// Esc clears the buffer back to empty (and exits history mode) so
|
|
201
|
+
// the user can bail out of a half-typed prompt without having to
|
|
202
|
+
// hammer Backspace. Harmless when the buffer is already empty.
|
|
203
|
+
if (key.escape) {
|
|
204
|
+
if (state.buffer.length === 0 && historyIdx < 0)
|
|
205
|
+
return;
|
|
206
|
+
setState(initialInputState());
|
|
207
|
+
setSuggestionIdx(0);
|
|
208
|
+
setHistoryIdx(-1);
|
|
209
|
+
setLiveBuffer(null);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
32
212
|
if (key.return) {
|
|
213
|
+
// `\<Enter>` inserts a newline instead of submitting — the
|
|
214
|
+
// terminal-idiomatic way to enter multi-line input. Strip the
|
|
215
|
+
// trailing `\` and replace it with a newline so the buffer
|
|
216
|
+
// reads cleanly.
|
|
217
|
+
if (state.buffer.endsWith("\\") && state.cursor === state.buffer.length) {
|
|
218
|
+
const stripped = state.buffer.slice(0, -1);
|
|
219
|
+
setState({ ...initialInputState(), buffer: `${stripped}\n`, cursor: stripped.length + 1 });
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
// Enter on a single-suggestion autocomplete still submits — if
|
|
223
|
+
// the user wanted to complete, they'd Tab. If they hit Enter on
|
|
224
|
+
// `/cos`, that's a clear "run /cost" intent only if it's an
|
|
225
|
+
// exact match; otherwise we submit as-typed and let the command
|
|
226
|
+
// registry's not-found path surface the typo.
|
|
33
227
|
const trimmed = state.buffer.trim();
|
|
34
228
|
if (trimmed.length > 0) {
|
|
35
|
-
onSubmit(trimmed);
|
|
229
|
+
onSubmit(expandPastes(trimmed, state.pastedContents));
|
|
36
230
|
setState(initialInputState());
|
|
231
|
+
setSuggestionIdx(0);
|
|
232
|
+
setHistoryIdx(-1);
|
|
233
|
+
setLiveBuffer(null);
|
|
37
234
|
}
|
|
38
235
|
return;
|
|
39
236
|
}
|
|
@@ -46,13 +243,35 @@ export function Input({ disabled, onSubmit, onAbort }) {
|
|
|
46
243
|
return setState(moveStart(state));
|
|
47
244
|
if (key.ctrl && input === "e")
|
|
48
245
|
return setState(moveEnd(state));
|
|
49
|
-
// Edits
|
|
50
|
-
|
|
246
|
+
// Edits. Some terminals (Linux console, tmux, certain SSH configs)
|
|
247
|
+
// deliver Backspace as raw 0x7f/0x08 without setting key.backspace,
|
|
248
|
+
// or even surface it as key.delete. We catch every shape so the
|
|
249
|
+
// floor — "Backspace deletes a char" — always works.
|
|
250
|
+
const isBackspaceByte = input === "\x7f" || input === "\b";
|
|
251
|
+
if (key.backspace || isBackspaceByte) {
|
|
252
|
+
setSuggestionIdx(0);
|
|
51
253
|
return setState(backspace(state));
|
|
52
|
-
|
|
254
|
+
}
|
|
255
|
+
// `key.delete` historically also fires for Backspace on some Ink
|
|
256
|
+
// builds, so prefer the backspace semantics when the buffer is
|
|
257
|
+
// non-empty and the cursor isn't at end-of-line. Forward-delete
|
|
258
|
+
// stays accessible via Ctrl-D.
|
|
259
|
+
if (key.delete) {
|
|
260
|
+
if (state.cursor > 0 && state.cursor === state.buffer.length) {
|
|
261
|
+
setSuggestionIdx(0);
|
|
262
|
+
return setState(backspace(state));
|
|
263
|
+
}
|
|
53
264
|
return setState(deleteForward(state));
|
|
54
|
-
|
|
265
|
+
}
|
|
266
|
+
// Ctrl-D matches readline: on an empty buffer it's EOF (i.e. quit),
|
|
267
|
+
// on a non-empty buffer it deletes forward like Delete.
|
|
268
|
+
if (key.ctrl && input === "d") {
|
|
269
|
+
if (state.buffer.length === 0) {
|
|
270
|
+
onAbort?.();
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
55
273
|
return setState(deleteForward(state));
|
|
274
|
+
}
|
|
56
275
|
// Kill ring
|
|
57
276
|
if (key.ctrl && input === "k")
|
|
58
277
|
return setState(killToEnd(state));
|
|
@@ -65,26 +284,157 @@ export function Input({ disabled, onSubmit, onAbort }) {
|
|
|
65
284
|
// Undo
|
|
66
285
|
if (key.ctrl && input === "z")
|
|
67
286
|
return setState(undo(state));
|
|
68
|
-
// Printable text — Ink's useInput delivers individual chars (or pasted runs)
|
|
69
|
-
|
|
70
|
-
|
|
287
|
+
// Printable text — Ink's useInput delivers individual chars (or pasted runs).
|
|
288
|
+
// Strip control bytes (0x00–0x1f, 0x7f) so a stray Backspace or escape
|
|
289
|
+
// fragment doesn't end up inserted as a glyph in the buffer.
|
|
290
|
+
// CSI 200~ / 201~ remnants from a bracketed paste: ink's keypress
|
|
291
|
+
// parser surfaces them here as `[200~` / `[201~` (escape stripped).
|
|
292
|
+
// The actual content was already handled by useBracketedPasteHandler,
|
|
293
|
+
// so swallow these so they don't end up in the buffer.
|
|
294
|
+
if (input === "[200~" || input === "[201~")
|
|
295
|
+
return;
|
|
296
|
+
const isPrintable = input && !key.ctrl && !key.meta && !/[\x00-\x1f\x7f]/.test(input);
|
|
297
|
+
if (isPrintable) {
|
|
298
|
+
setSuggestionIdx(0);
|
|
299
|
+
// Once the user starts editing on top of a recalled history
|
|
300
|
+
// entry, snap out of history mode — the entry is now their
|
|
301
|
+
// own buffer and ↓ shouldn't try to bring it back.
|
|
302
|
+
if (historyIdx >= 0) {
|
|
303
|
+
setHistoryIdx(-1);
|
|
304
|
+
setLiveBuffer(null);
|
|
305
|
+
}
|
|
306
|
+
// Break the @-Tab cycle so the next Tab recomputes from the new text.
|
|
307
|
+
if (pathMatches.length > 0) {
|
|
308
|
+
setPathMatches([]);
|
|
309
|
+
setPathIdx(0);
|
|
310
|
+
lastAtTokenRef.current = null;
|
|
311
|
+
}
|
|
312
|
+
setState(looksLikePaste(input) ? insertPaste(state, input) : insertChar(state, input));
|
|
71
313
|
}
|
|
72
314
|
});
|
|
73
|
-
return (_jsxs(Box, { paddingX: 1, children: [_jsxs(Text, { color: disabled ? "gray" : "cyan", children: [disabled ? "·" : ">", " "] }), disabled ? _jsx(Text, { children: state.buffer }) : _jsx(RenderedBuffer, { buffer: state.buffer, cursor: state.cursor })] }));
|
|
315
|
+
return (_jsxs(Box, { flexDirection: "column", children: [autocompleteActive && suggestions.length > 0 ? (_jsx(SlashSuggestions, { suggestions: suggestions, selected: clampedSuggestionIdx })) : null, _jsxs(Box, { paddingX: 1, children: [_jsxs(Text, { color: disabled ? "gray" : "cyan", children: [disabled ? "·" : ">", " "] }), disabled ? (_jsx(Text, { children: state.buffer })) : state.buffer.length === 0 ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: "cyan", children: "\u258E" }), suggestion ? (_jsxs(_Fragment, { children: [_jsx(Text, { dimColor: true, children: suggestion }), _jsx(Text, { dimColor: true, children: " " }), _jsx(Text, { dimColor: true, children: "\u21B9 tab" })] })) : (_jsx(Text, { dimColor: true, children: placeholderRef.current }))] })) : (_jsx(RenderedBuffer, { buffer: state.buffer, cursor: state.cursor }))] })] }));
|
|
316
|
+
}
|
|
317
|
+
function SlashSuggestions({ suggestions, selected, }) {
|
|
318
|
+
return (_jsxs(Box, { flexDirection: "column", paddingX: 1, marginBottom: 0, children: [suggestions.map((cmd, i) => {
|
|
319
|
+
const isSelected = i === selected;
|
|
320
|
+
return (_jsxs(Box, { children: [_jsxs(Text, { color: isSelected ? "cyan" : "gray", bold: isSelected, children: [isSelected ? "▸ " : " ", `/${cmd.name}`] }), cmd.description ? (_jsxs(Text, { dimColor: true, children: [" ", "\u2014 ", cmd.description.slice(0, 60)] })) : null] }, `sug-${cmd.name}`));
|
|
321
|
+
}), _jsx(Box, { marginTop: 0, children: _jsx(Text, { dimColor: true, children: "\u2191\u2193 to move \u00B7 Tab to complete \u00B7 Enter to send as-typed" }) })] }));
|
|
74
322
|
}
|
|
75
323
|
/**
|
|
76
324
|
* Render the buffer with a visible cursor block at the cursor position.
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* the
|
|
325
|
+
* Splits on `\n` so multi-line pastes (and `\<Enter>` newlines) show
|
|
326
|
+
* as stacked rows — otherwise pasted code collapses into one line and
|
|
327
|
+
* the user can't see what they're sending.
|
|
80
328
|
*/
|
|
81
329
|
function RenderedBuffer({ buffer, cursor }) {
|
|
330
|
+
if (!buffer.includes("\n"))
|
|
331
|
+
return _jsx(SingleLineBuffer, { buffer: buffer, cursor: cursor });
|
|
332
|
+
const lines = buffer.split("\n");
|
|
333
|
+
let consumed = 0;
|
|
334
|
+
return (_jsx(Box, { flexDirection: "column", children: lines.map((line, idx) => {
|
|
335
|
+
const lineStart = consumed;
|
|
336
|
+
const lineEnd = consumed + line.length;
|
|
337
|
+
const cursorOnThisLine = cursor >= lineStart && cursor <= lineEnd;
|
|
338
|
+
consumed = lineEnd + 1;
|
|
339
|
+
if (!cursorOnThisLine) {
|
|
340
|
+
return (_jsx(Box, { children: line.length === 0 ? _jsx(Text, { children: " " }) : _jsx(StyledRun, { text: line, keyPrefix: `l${idx}` }) }, `line-${idx}-${line.slice(0, 8)}`));
|
|
341
|
+
}
|
|
342
|
+
return (_jsx(SingleLineBuffer, { buffer: line, cursor: cursor - lineStart }, `line-${idx}-cur-${line.slice(0, 8)}`));
|
|
343
|
+
}) }));
|
|
344
|
+
}
|
|
345
|
+
function SingleLineBuffer({ buffer, cursor }) {
|
|
82
346
|
if (cursor >= buffer.length) {
|
|
83
|
-
return (_jsxs(_Fragment, { children: [_jsx(
|
|
347
|
+
return (_jsxs(_Fragment, { children: [_jsx(StyledRun, { text: buffer, keyPrefix: "slb-end" }), _jsx(Text, { color: "cyan", children: "\u258E" })] }));
|
|
84
348
|
}
|
|
85
349
|
const before = buffer.slice(0, cursor);
|
|
86
350
|
const onCursor = buffer[cursor] === " " ? " " : (buffer[cursor] ?? " ");
|
|
87
351
|
const after = buffer.slice(cursor + 1);
|
|
88
|
-
return (_jsxs(_Fragment, { children: [_jsx(
|
|
352
|
+
return (_jsxs(_Fragment, { children: [_jsx(StyledRun, { text: before, keyPrefix: "slb-b" }), _jsx(Text, { inverse: true, children: onCursor }), _jsx(StyledRun, { text: after, keyPrefix: "slb-a" })] }));
|
|
353
|
+
}
|
|
354
|
+
const BRACKETED_PASTE_START = "\x1b[200~";
|
|
355
|
+
const BRACKETED_PASTE_END = "\x1b[201~";
|
|
356
|
+
/**
|
|
357
|
+
* Subscribe to ink's raw stdin event emitter so we can carve paste content
|
|
358
|
+
* out of bracketed-paste markers (CSI 200~ … 201~) before ink's keypress
|
|
359
|
+
* parser mangles them. Necessary because parseKeypress sees `\x1b[200~`
|
|
360
|
+
* as a single keypress and *discards* whatever bytes followed it in the
|
|
361
|
+
* same chunk — so without intercepting at this layer, the pasted content
|
|
362
|
+
* is gone before useInput ever sees it.
|
|
363
|
+
*
|
|
364
|
+
* Buffers across multiple stdin chunks for large pastes that the OS
|
|
365
|
+
* fragments. The callback fires once per complete paste, with the full
|
|
366
|
+
* content between the markers.
|
|
367
|
+
*/
|
|
368
|
+
function useBracketedPasteHandler(onPaste) {
|
|
369
|
+
const { internal_eventEmitter } = useStdin();
|
|
370
|
+
const pasteRef = useRef({ active: false, chunks: [] });
|
|
371
|
+
const onPasteRef = useRef(onPaste);
|
|
372
|
+
onPasteRef.current = onPaste;
|
|
373
|
+
useEffect(() => {
|
|
374
|
+
if (!internal_eventEmitter)
|
|
375
|
+
return;
|
|
376
|
+
const handler = (raw) => {
|
|
377
|
+
const chunk = typeof raw === "string" ? raw : String(raw);
|
|
378
|
+
let pos = 0;
|
|
379
|
+
while (pos < chunk.length) {
|
|
380
|
+
if (pasteRef.current.active) {
|
|
381
|
+
const endIdx = chunk.indexOf(BRACKETED_PASTE_END, pos);
|
|
382
|
+
if (endIdx === -1) {
|
|
383
|
+
pasteRef.current.chunks.push(chunk.slice(pos));
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
pasteRef.current.chunks.push(chunk.slice(pos, endIdx));
|
|
387
|
+
const content = pasteRef.current.chunks.join("");
|
|
388
|
+
pasteRef.current = { active: false, chunks: [] };
|
|
389
|
+
if (content.length > 0)
|
|
390
|
+
onPasteRef.current(content);
|
|
391
|
+
pos = endIdx + BRACKETED_PASTE_END.length;
|
|
392
|
+
}
|
|
393
|
+
else {
|
|
394
|
+
const startIdx = chunk.indexOf(BRACKETED_PASTE_START, pos);
|
|
395
|
+
if (startIdx === -1)
|
|
396
|
+
return;
|
|
397
|
+
// Bytes before the start marker are normal input; ink's
|
|
398
|
+
// useInput handles them in parallel. We only take over
|
|
399
|
+
// once the paste begins.
|
|
400
|
+
pasteRef.current = { active: true, chunks: [] };
|
|
401
|
+
pos = startIdx + BRACKETED_PASTE_START.length;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
internal_eventEmitter.on("input", handler);
|
|
406
|
+
return () => {
|
|
407
|
+
internal_eventEmitter.removeListener("input", handler);
|
|
408
|
+
};
|
|
409
|
+
}, [internal_eventEmitter]);
|
|
410
|
+
}
|
|
411
|
+
const PASTE_PLACEHOLDER_RE_DISPLAY = /\[Pasted #\d+ · \d+ (?:lines|chars)\]/g;
|
|
412
|
+
/**
|
|
413
|
+
* Render a text run, dim-styling any paste-placeholder substrings.
|
|
414
|
+
* Cursor handling lives outside — RenderedBuffer / SingleLineBuffer split
|
|
415
|
+
* around the cursor first, then hand the halves here. A placeholder split
|
|
416
|
+
* across the cursor boundary won't match its regex in either half and
|
|
417
|
+
* falls back to plain text — fine because the user is actively editing it.
|
|
418
|
+
*/
|
|
419
|
+
function StyledRun({ text, keyPrefix }) {
|
|
420
|
+
if (!text)
|
|
421
|
+
return null;
|
|
422
|
+
const parts = [];
|
|
423
|
+
let lastEnd = 0;
|
|
424
|
+
let idx = 0;
|
|
425
|
+
for (const m of text.matchAll(PASTE_PLACEHOLDER_RE_DISPLAY)) {
|
|
426
|
+
const start = m.index ?? 0;
|
|
427
|
+
if (start > lastEnd) {
|
|
428
|
+
parts.push(_jsx(Text, { children: text.slice(lastEnd, start) }, `${keyPrefix}-t-${idx++}`));
|
|
429
|
+
}
|
|
430
|
+
parts.push(_jsx(Text, { dimColor: true, italic: true, children: m[0] }, `${keyPrefix}-p-${idx++}`));
|
|
431
|
+
lastEnd = start + m[0].length;
|
|
432
|
+
}
|
|
433
|
+
if (lastEnd === 0)
|
|
434
|
+
return _jsx(Text, { children: text });
|
|
435
|
+
if (lastEnd < text.length) {
|
|
436
|
+
parts.push(_jsx(Text, { children: text.slice(lastEnd) }, `${keyPrefix}-t-${idx++}`));
|
|
437
|
+
}
|
|
438
|
+
return _jsx(_Fragment, { children: parts });
|
|
89
439
|
}
|
|
90
440
|
//# sourceMappingURL=Input.js.map
|
package/dist/ui/Input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../src/ui/Input.tsx"],"names":[],"m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