xiaotime 0.5.0 → 0.5.3
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/__tests__/ansi_tags.test.d.ts +9 -0
- package/dist/__tests__/ansi_tags.test.d.ts.map +1 -0
- package/dist/__tests__/ansi_tags.test.js +58 -0
- package/dist/__tests__/ansi_tags.test.js.map +1 -0
- package/dist/__tests__/paste_transform_submit.test.d.ts +2 -0
- package/dist/__tests__/paste_transform_submit.test.d.ts.map +1 -0
- package/dist/__tests__/paste_transform_submit.test.js +74 -0
- package/dist/__tests__/paste_transform_submit.test.js.map +1 -0
- package/dist/__tests__/session_match.test.d.ts +10 -0
- package/dist/__tests__/session_match.test.d.ts.map +1 -0
- package/dist/__tests__/session_match.test.js +55 -0
- package/dist/__tests__/session_match.test.js.map +1 -0
- package/dist/__tests__/tools.test.js +165 -0
- package/dist/__tests__/tools.test.js.map +1 -1
- package/dist/__tests__/ui_state_listener_lifecycle.test.d.ts +2 -0
- package/dist/__tests__/ui_state_listener_lifecycle.test.d.ts.map +1 -0
- package/dist/__tests__/ui_state_listener_lifecycle.test.js +152 -0
- package/dist/__tests__/ui_state_listener_lifecycle.test.js.map +1 -0
- package/dist/ansi_tags.d.ts +20 -0
- package/dist/ansi_tags.d.ts.map +1 -0
- package/dist/ansi_tags.js +38 -0
- package/dist/ansi_tags.js.map +1 -0
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/display.d.ts +53 -22
- package/dist/display.d.ts.map +1 -1
- package/dist/display.js +773 -47
- package/dist/display.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -3
- package/dist/index.js.map +1 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +5 -2
- package/dist/session.js.map +1 -1
- package/dist/session_match.d.ts +19 -0
- package/dist/session_match.d.ts.map +1 -0
- package/dist/session_match.js +9 -0
- package/dist/session_match.js.map +1 -0
- package/dist/sidebar.d.ts +84 -0
- package/dist/sidebar.d.ts.map +1 -0
- package/dist/sidebar.js +310 -0
- package/dist/sidebar.js.map +1 -0
- package/dist/tools.d.ts +4 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +64 -49
- package/dist/tools.js.map +1 -1
- package/dist/ui_state.d.ts +41 -87
- package/dist/ui_state.d.ts.map +1 -1
- package/dist/ui_state.js +216 -162
- package/dist/ui_state.js.map +1 -1
- package/dist/ws.d.ts +10 -14
- package/dist/ws.d.ts.map +1 -1
- package/dist/ws.js +236 -119
- package/dist/ws.js.map +1 -1
- package/package.json +10 -5
package/dist/ui_state.js
CHANGED
|
@@ -2,43 +2,36 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Session-UI state machine for the xiaotime dev CLI.
|
|
4
4
|
*
|
|
5
|
-
* SPRINT-CLI-STATE-MACHINE-1 (#6163 / closes #6127)
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* its own keypress handler to stdin that echoes characters via its own
|
|
10
|
-
* stdout writes; `rl.pause()` stops `line` events but does NOT detach that
|
|
11
|
-
* echo path, and `setRawMode(true)` only suppresses kernel-level echo, not
|
|
12
|
-
* readline's.
|
|
5
|
+
* SPRINT-CLI-STATE-MACHINE-1 (#6163 / closes #6127)
|
|
6
|
+
* SPRINT-CLI-APPROVAL-MENU-1 (#6509)
|
|
7
|
+
* SPRINT-CLI-INPUT-AND-TOOL-HARDENING-1 (#7299) PR2
|
|
8
|
+
* SPRINT-CLI-PASTE-MODE-4 — push-based paste interception.
|
|
13
9
|
*
|
|
14
|
-
*
|
|
15
|
-
* one-shot prompt with `promptApprovalMenu` — a three-option numbered menu
|
|
16
|
-
* (Run / Run + allowlist / Reject + feedback). The rl is explicitly
|
|
17
|
-
* **closed and recreated** around the menu render so its keypress echo
|
|
18
|
-
* physically can't fire (the rl object is gone for the duration of the
|
|
19
|
-
* menu). Persistent close listeners survive the recreation via
|
|
20
|
-
* `onRlClose()` — callers that need a stable close hook register through
|
|
21
|
-
* that instead of `getRl().on("close", ...)`.
|
|
10
|
+
* Two strategies run together:
|
|
22
11
|
*
|
|
23
|
-
*
|
|
12
|
+
* 1. Bracketed paste (ESC[200~ / ESC[201~) — the clean path. When the
|
|
13
|
+
* terminal sends these markers the PasteTransform buffers everything
|
|
14
|
+
* between them, collapses newlines, and emits a single block. Readline
|
|
15
|
+
* never sees a raw newline, so it cannot auto-submit.
|
|
24
16
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* captures keystrokes.
|
|
17
|
+
* 2. Rapid-chunk coalescing — the fallback. When bracketed paste mode is
|
|
18
|
+
* not supported by the terminal (Termius, older SSH clients) chunks
|
|
19
|
+
* arriving with gaps < RAPID_PASTE_GAP_MS are held in a buffer.
|
|
20
|
+
* After RAPID_PASTE_IDLE_MS of silence the buffer is flushed as a
|
|
21
|
+
* single block with internal newlines collapsed.
|
|
31
22
|
*
|
|
32
|
-
*
|
|
23
|
+
* Root-cause fix (PASTE-MODE-4): readline must NOT receive the
|
|
24
|
+
* PasteTransform stream directly as `input` with `terminal: true`.
|
|
25
|
+
* When readline sees a Transform as input in terminal mode it internally
|
|
26
|
+
* calls readline.emitKeypressEvents() on that stream, which installs its
|
|
27
|
+
* own `data` listener that fires keypress events — including \r/\n — before
|
|
28
|
+
* our _transform() can intercept them.
|
|
33
29
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* RUNNING_TOOL -- tool_result sent -> GENERATING
|
|
40
|
-
* GENERATING -- message_stop -> IDLE
|
|
41
|
-
* ANY -- error -> IDLE
|
|
30
|
+
* Solution: push-based forwarding. PasteTransform processes chunks from
|
|
31
|
+
* stdin and pushes safe output into a PassThrough. Readline reads from the
|
|
32
|
+
* PassThrough. readline.emitKeypressEvents() is called on the PassThrough,
|
|
33
|
+
* which only ever sees already-safe data — newlines inside paste blocks have
|
|
34
|
+
* already been collapsed to spaces.
|
|
42
35
|
*/
|
|
43
36
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
44
37
|
if (k2 === undefined) k2 = k;
|
|
@@ -77,83 +70,208 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
77
70
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
78
71
|
};
|
|
79
72
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
80
|
-
exports.SessionUI = void 0;
|
|
73
|
+
exports.SessionUI = exports.PasteTransform = void 0;
|
|
81
74
|
const readline = __importStar(require("readline"));
|
|
75
|
+
const stream_1 = require("stream");
|
|
82
76
|
const chalk_1 = __importDefault(require("chalk"));
|
|
83
77
|
const SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
84
78
|
const SPINNER_INTERVAL_MS = 100;
|
|
85
|
-
const ELAPSED_THRESHOLD_MS = 3000;
|
|
79
|
+
const ELAPSED_THRESHOLD_MS = 3000;
|
|
86
80
|
const MENU_OPTIONS = [
|
|
87
81
|
"Run",
|
|
88
82
|
"Run and don't ask again",
|
|
89
83
|
"Reject and tell Claude why",
|
|
90
84
|
];
|
|
91
85
|
const MENU_HINT = "(1-3, ↑↓ Enter, Esc to reject)";
|
|
86
|
+
const PASTE_START = "\x1b[200~";
|
|
87
|
+
const PASTE_END = "\x1b[201~";
|
|
88
|
+
const BPASTE_ENABLE = "\x1b[?2004h";
|
|
89
|
+
const BPASTE_DISABLE = "\x1b[?2004l";
|
|
90
|
+
// Rapid-chunk coalescing thresholds
|
|
91
|
+
const RAPID_PASTE_GAP_MS = 30; // chunks arriving faster than this = paste burst
|
|
92
|
+
const RAPID_PASTE_IDLE_MS = 60; // flush buffer after this much silence
|
|
93
|
+
// ── PasteTransform ────────────────────────────────────────────────────────────
|
|
94
|
+
// Processes raw stdin chunks. Two interception modes:
|
|
95
|
+
//
|
|
96
|
+
// Mode A — bracketed paste: ESC[200~ starts buffering, ESC[201~ flushes.
|
|
97
|
+
// Mode B — rapid-chunk coalescing: bursts of chunks with gaps < RAPID_PASTE_GAP_MS
|
|
98
|
+
// are held and flushed as one block after RAPID_PASTE_IDLE_MS of silence.
|
|
99
|
+
//
|
|
100
|
+
// Output is pushed into a PassThrough (`sink`) which readline reads from.
|
|
101
|
+
// Readline never touches this Transform directly — that prevents readline from
|
|
102
|
+
// calling emitKeypressEvents() on us and bypassing our interception.
|
|
103
|
+
class PasteTransform extends stream_1.Transform {
|
|
104
|
+
// Mode A
|
|
105
|
+
_inBracketedPaste = false;
|
|
106
|
+
_bracketedBuf = "";
|
|
107
|
+
// Mode B
|
|
108
|
+
_rapidBuf = "";
|
|
109
|
+
_lastChunkAt = 0;
|
|
110
|
+
_rapidTimer = null;
|
|
111
|
+
// The PassThrough that readline reads from
|
|
112
|
+
sink;
|
|
113
|
+
constructor() {
|
|
114
|
+
super();
|
|
115
|
+
this.sink = new stream_1.PassThrough();
|
|
116
|
+
// Forward our Transform output to the sink
|
|
117
|
+
this.pipe(this.sink);
|
|
118
|
+
}
|
|
119
|
+
_transform(chunk, _enc, cb) {
|
|
120
|
+
let s = chunk.toString();
|
|
121
|
+
// ── Mode A: bracketed paste ──────────────────────────────────────────────
|
|
122
|
+
if (s.includes(PASTE_START)) {
|
|
123
|
+
this._inBracketedPaste = true;
|
|
124
|
+
this._bracketedBuf = "";
|
|
125
|
+
s = s.replace(PASTE_START, "");
|
|
126
|
+
}
|
|
127
|
+
if (s.includes(PASTE_END)) {
|
|
128
|
+
this._inBracketedPaste = false;
|
|
129
|
+
const tail = s.replace(PASTE_END, "");
|
|
130
|
+
this._bracketedBuf += tail;
|
|
131
|
+
const safe = this._bracketedBuf.replace(/[\r\n]+/g, " ");
|
|
132
|
+
this._bracketedBuf = "";
|
|
133
|
+
this.push(Buffer.from(safe));
|
|
134
|
+
cb();
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (this._inBracketedPaste) {
|
|
138
|
+
this._bracketedBuf += s;
|
|
139
|
+
cb();
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
// ── Mode B: rapid-chunk coalescing ───────────────────────────────────────
|
|
143
|
+
const now = Date.now();
|
|
144
|
+
const gap = now - this._lastChunkAt;
|
|
145
|
+
this._lastChunkAt = now;
|
|
146
|
+
const hasNewline = /[\r\n]/.test(s);
|
|
147
|
+
const isBurst = gap < RAPID_PASTE_GAP_MS && this._rapidBuf.length > 0;
|
|
148
|
+
if (isBurst || (hasNewline && this._rapidBuf.length > 0)) {
|
|
149
|
+
this._rapidBuf += s;
|
|
150
|
+
this._scheduleRapidFlush();
|
|
151
|
+
cb();
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (hasNewline && this._rapidBuf.length === 0) {
|
|
155
|
+
// A lone CR/LF is a deliberate Enter, not the first chunk of a paste.
|
|
156
|
+
// Pass it straight through so readline emits its `line` event and the
|
|
157
|
+
// prompt submits. Without this, the newline gets buffered and collapsed
|
|
158
|
+
// to a space by _scheduleRapidFlush, so readline never sees a line
|
|
159
|
+
// terminator and NO prompt ever submits. Only buffer + newline-strip
|
|
160
|
+
// when the chunk carries text alongside the newline (the first chunk of
|
|
161
|
+
// a fast, un-bracketed multi-line paste).
|
|
162
|
+
if (/^[\r\n]+$/.test(s)) {
|
|
163
|
+
this.push(chunk);
|
|
164
|
+
cb();
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
this._rapidBuf += s;
|
|
168
|
+
this._scheduleRapidFlush();
|
|
169
|
+
cb();
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
// Normal single keystroke — pass through immediately
|
|
173
|
+
this.push(chunk);
|
|
174
|
+
cb();
|
|
175
|
+
}
|
|
176
|
+
_scheduleRapidFlush() {
|
|
177
|
+
if (this._rapidTimer)
|
|
178
|
+
clearTimeout(this._rapidTimer);
|
|
179
|
+
this._rapidTimer = setTimeout(() => {
|
|
180
|
+
this._rapidTimer = null;
|
|
181
|
+
this._flushRapidBuf();
|
|
182
|
+
}, RAPID_PASTE_IDLE_MS);
|
|
183
|
+
}
|
|
184
|
+
// Flush the rapid-coalesce buffer to readline.
|
|
185
|
+
//
|
|
186
|
+
// Trailing-newline rule — fixes the "press Enter twice" bug on SSH clients
|
|
187
|
+
// (Termius, mosh) that batch a fast-typed line together with its Enter into a
|
|
188
|
+
// single read, e.g. "hey junior\r" arriving as ONE chunk. The old code
|
|
189
|
+
// collapsed EVERY newline — including that trailing \r — to a space, so
|
|
190
|
+
// readline never saw a line terminator: the first Enter silently did nothing
|
|
191
|
+
// and you had to hit Enter again.
|
|
192
|
+
//
|
|
193
|
+
// - buffer ends in a newline AND the text before it has no internal newline
|
|
194
|
+
// → a single typed line + Enter. Re-emit one \r so readline submits on the
|
|
195
|
+
// first Enter.
|
|
196
|
+
// - buffer has an internal newline (genuine multi-line paste) → collapse all
|
|
197
|
+
// newlines to spaces and emit NO terminator, so the paste lands in the
|
|
198
|
+
// input for review (unchanged behaviour).
|
|
199
|
+
_flushRapidBuf() {
|
|
200
|
+
if (!this._rapidBuf)
|
|
201
|
+
return;
|
|
202
|
+
const buf = this._rapidBuf;
|
|
203
|
+
this._rapidBuf = "";
|
|
204
|
+
const trailing = buf.match(/[\r\n]+$/);
|
|
205
|
+
const body = trailing ? buf.slice(0, trailing.index) : buf;
|
|
206
|
+
const isSingleLineEnter = trailing !== null && !/[\r\n]/.test(body);
|
|
207
|
+
if (isSingleLineEnter) {
|
|
208
|
+
this.push(Buffer.from(body + "\r"));
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
this.push(Buffer.from(buf.replace(/[\r\n]+/g, " ")));
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
_flush(cb) {
|
|
215
|
+
if (this._rapidTimer) {
|
|
216
|
+
clearTimeout(this._rapidTimer);
|
|
217
|
+
this._rapidTimer = null;
|
|
218
|
+
}
|
|
219
|
+
const combined = this._bracketedBuf + this._rapidBuf;
|
|
220
|
+
if (combined) {
|
|
221
|
+
const safe = combined.replace(/[\r\n]+/g, " ");
|
|
222
|
+
this.push(Buffer.from(safe));
|
|
223
|
+
}
|
|
224
|
+
this._bracketedBuf = "";
|
|
225
|
+
this._rapidBuf = "";
|
|
226
|
+
cb();
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
exports.PasteTransform = PasteTransform;
|
|
92
230
|
class SessionUI {
|
|
93
231
|
state = "idle";
|
|
94
232
|
spinnerTimer = null;
|
|
95
233
|
spinnerFrame = 0;
|
|
96
234
|
spinnerStartedAt = 0;
|
|
97
235
|
spinnerLabel = "";
|
|
98
|
-
// True only while the spinner has written something to the line and
|
|
99
|
-
// we owe a clear. Set on first frame, cleared on stopSpinner. Lets
|
|
100
|
-
// text_delta callers know they need to clear the spinner line
|
|
101
|
-
// before printing the first token.
|
|
102
236
|
spinnerLineDirty = false;
|
|
103
237
|
rl;
|
|
104
238
|
lineListener = null;
|
|
105
|
-
/**
|
|
106
|
-
* Close-listener callbacks that should survive rl recreations. The
|
|
107
|
-
* approval-menu path closes + recreates `rl` to physically detach
|
|
108
|
-
* readline's keypress echo. ws.ts registers its "Session paused"
|
|
109
|
-
* resume hint here so it stays attached across recreations.
|
|
110
|
-
*/
|
|
111
239
|
closeListeners = [];
|
|
240
|
+
_pasteTransform = null;
|
|
112
241
|
constructor() {
|
|
113
242
|
this.rl = this._makeRl();
|
|
243
|
+
process.on("exit", () => {
|
|
244
|
+
process.stdout.write(BPASTE_DISABLE);
|
|
245
|
+
process.stdout.write("\x1b[?25h"); // never leave the cursor hidden on exit
|
|
246
|
+
});
|
|
114
247
|
}
|
|
115
|
-
/** Hand the underlying readline to callers that need it for cleanup. */
|
|
116
248
|
getRl() {
|
|
117
249
|
return this.rl;
|
|
118
250
|
}
|
|
119
|
-
/**
|
|
120
|
-
* Register a callback to fire when the rl reports a non-suppressed
|
|
121
|
-
* `close` event (the only one users observe is Ctrl+C at the main
|
|
122
|
-
* prompt — close-during-approval is suppressed via removeAllListeners
|
|
123
|
-
* before `rl.close()`). Callbacks are re-attached on every rl
|
|
124
|
-
* recreation so they outlive `promptApprovalMenu`.
|
|
125
|
-
*/
|
|
126
251
|
onRlClose(listener) {
|
|
127
252
|
this.closeListeners.push(listener);
|
|
128
253
|
this.rl.on("close", listener);
|
|
129
254
|
}
|
|
130
|
-
/** Set the explicit current state. Drives spinner start/stop. */
|
|
131
255
|
setState(next) {
|
|
132
256
|
if (next === this.state)
|
|
133
257
|
return;
|
|
134
258
|
const prev = this.state;
|
|
135
259
|
this.state = next;
|
|
136
|
-
// Transition out of any spinner state.
|
|
137
260
|
if (prev === "generating" || prev === "running_tool") {
|
|
138
261
|
this.stopSpinner();
|
|
139
262
|
}
|
|
140
|
-
// Transition in.
|
|
141
263
|
if (next === "generating") {
|
|
142
264
|
this.startSpinner("thinking");
|
|
143
265
|
}
|
|
144
266
|
else if (next === "running_tool") {
|
|
145
267
|
this.startSpinner("running tool");
|
|
146
268
|
}
|
|
147
|
-
// `awaiting_approval` / `idle` => no spinner. Approval-menu path
|
|
148
|
-
// takes over stdin in `promptApprovalMenu`.
|
|
149
269
|
}
|
|
150
270
|
getState() {
|
|
151
271
|
return this.state;
|
|
152
272
|
}
|
|
153
|
-
/** Wait for one line of user input on the main rl. */
|
|
154
273
|
promptLine() {
|
|
155
274
|
return new Promise((resolve) => {
|
|
156
|
-
// Drop any previous one-shot listener that didn't fire.
|
|
157
275
|
if (this.lineListener) {
|
|
158
276
|
this.rl.off("line", this.lineListener);
|
|
159
277
|
}
|
|
@@ -165,49 +283,12 @@ class SessionUI {
|
|
|
165
283
|
this.rl.once("line", listener);
|
|
166
284
|
});
|
|
167
285
|
}
|
|
168
|
-
/**
|
|
169
|
-
* Three-option numbered approval menu. Replaces the pre-#6509
|
|
170
|
-
* `[y/N]` one-shot prompt.
|
|
171
|
-
*
|
|
172
|
-
* Visual:
|
|
173
|
-
* ❯ 1. Run
|
|
174
|
-
* 2. Run and don't ask again
|
|
175
|
-
* 3. Reject and tell Claude why
|
|
176
|
-
* (1-3, ↑↓ Enter, Esc to reject)
|
|
177
|
-
*
|
|
178
|
-
* Controls:
|
|
179
|
-
* - Number key 1/2/3 — one-shot select
|
|
180
|
-
* - Arrow Up/Down — move focus
|
|
181
|
-
* - Enter — select focused
|
|
182
|
-
* - Esc — equivalent to option 3 (reject)
|
|
183
|
-
* - Ctrl+C — reject + propagate SIGINT (cancels session)
|
|
184
|
-
*
|
|
185
|
-
* The rl is closed before the menu render and recreated after. This
|
|
186
|
-
* physically removes readline's keypress echo from stdin for the
|
|
187
|
-
* duration of the menu — the bug fix the #6163 patch attempted via
|
|
188
|
-
* `rl.pause()` (which only stops `line` events, not the keypress
|
|
189
|
-
* echo). Persistent close listeners are stashed in
|
|
190
|
-
* `this.closeListeners` and re-attached on recreate; the close event
|
|
191
|
-
* triggered by THIS close() is suppressed via removeAllListeners
|
|
192
|
-
* before the call so it doesn't fire the "Session paused" hint.
|
|
193
|
-
*
|
|
194
|
-
* For option 3, after the menu resolves the recreated rl prompts
|
|
195
|
-
* once for a free-form rejection reason (line-mode). Empty input is
|
|
196
|
-
* allowed.
|
|
197
|
-
*
|
|
198
|
-
* The returned `allowlistRequested: true` (option 2) is a signal to
|
|
199
|
-
* the caller — PR2 wires it to write the pattern to
|
|
200
|
-
* `~/.xiaotime/settings.json`. PR1 callers may ignore it.
|
|
201
|
-
*/
|
|
202
286
|
async promptApprovalMenu(toolHeader) {
|
|
203
287
|
this.setState("awaiting_approval");
|
|
288
|
+
this._destroyPasteTransform();
|
|
204
289
|
if (toolHeader) {
|
|
205
290
|
process.stdout.write(toolHeader);
|
|
206
291
|
}
|
|
207
|
-
// Recreate the rl in `finally` so it ALWAYS lands — even if the
|
|
208
|
-
// no-TTY bail-out fires inside `_renderMenuAndGetSelection`. The
|
|
209
|
-
// next `promptLine` call needs a live rl regardless of how the
|
|
210
|
-
// menu resolved.
|
|
211
292
|
let selectedIdx;
|
|
212
293
|
try {
|
|
213
294
|
selectedIdx = await this._renderMenuAndGetSelection();
|
|
@@ -215,9 +296,6 @@ class SessionUI {
|
|
|
215
296
|
finally {
|
|
216
297
|
this.rl = this._makeRl();
|
|
217
298
|
}
|
|
218
|
-
// -1 → bail-out from `_renderMenuAndGetSelection` because stdin is
|
|
219
|
-
// not a TTY (CI / piped invocation / test runner). Skip the
|
|
220
|
-
// rejection-reason readline prompt because nothing would feed it.
|
|
221
299
|
if (selectedIdx === -1) {
|
|
222
300
|
return { approved: false, rejectReason: "(no TTY)" };
|
|
223
301
|
}
|
|
@@ -229,40 +307,54 @@ class SessionUI {
|
|
|
229
307
|
process.stdout.write(chalk_1.default.green(" ✓ Approved (allowlist requested)\n"));
|
|
230
308
|
return { approved: true, allowlistRequested: true };
|
|
231
309
|
}
|
|
232
|
-
// selectedIdx === 2 — rejection. Prompt for free-form reason via
|
|
233
|
-
// the recreated rl (line-mode, single line, empty allowed).
|
|
234
310
|
process.stdout.write(chalk_1.default.yellow(" Reason (Enter to send empty): "));
|
|
235
311
|
const reason = await new Promise((resolve) => {
|
|
236
312
|
this.rl.once("line", (line) => resolve(line.trim()));
|
|
237
313
|
});
|
|
238
314
|
return { approved: false, rejectReason: reason };
|
|
239
315
|
}
|
|
240
|
-
// ──
|
|
316
|
+
// ── PasteTransform lifecycle ──────────────────────────────────────────────
|
|
317
|
+
_destroyPasteTransform() {
|
|
318
|
+
if (this._pasteTransform) {
|
|
319
|
+
process.stdin.unpipe(this._pasteTransform);
|
|
320
|
+
this._pasteTransform.destroy();
|
|
321
|
+
this._pasteTransform = null;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
// ── rl factory ───────────────────────────────────────────────────────────
|
|
241
325
|
_makeRl() {
|
|
326
|
+
process.stdin.removeAllListeners("keypress");
|
|
327
|
+
process.stdin.removeAllListeners("end");
|
|
328
|
+
process.stdin.removeAllListeners("error");
|
|
329
|
+
process.stdout.removeAllListeners("resize");
|
|
330
|
+
process.stdout.write(BPASTE_ENABLE);
|
|
331
|
+
// Create PasteTransform, pipe stdin through it.
|
|
332
|
+
// Readline reads from pt.sink (a PassThrough) — NOT from the Transform
|
|
333
|
+
// directly. This prevents readline from calling emitKeypressEvents() on
|
|
334
|
+
// the transform, which would bypass our paste interception.
|
|
335
|
+
this._destroyPasteTransform();
|
|
336
|
+
const pt = new PasteTransform();
|
|
337
|
+
this._pasteTransform = pt;
|
|
338
|
+
process.stdin.pipe(pt);
|
|
242
339
|
const rl = readline.createInterface({
|
|
243
|
-
input:
|
|
340
|
+
input: pt.sink, // readline reads from the safe PassThrough sink
|
|
244
341
|
output: process.stdout,
|
|
245
342
|
terminal: true,
|
|
246
343
|
});
|
|
247
344
|
for (const l of this.closeListeners) {
|
|
248
345
|
rl.on("close", l);
|
|
249
346
|
}
|
|
347
|
+
rl.on("close", () => {
|
|
348
|
+
process.stdout.write(BPASTE_DISABLE);
|
|
349
|
+
this._destroyPasteTransform();
|
|
350
|
+
});
|
|
250
351
|
return rl;
|
|
251
352
|
}
|
|
353
|
+
// ── Menu internals ────────────────────────────────────────────────────────
|
|
252
354
|
async _renderMenuAndGetSelection() {
|
|
253
|
-
// Suppress the close-listener side effects for this internal
|
|
254
|
-
// close — we don't want the "Session paused" hint firing
|
|
255
|
-
// mid-approval. Stash the listeners on this.closeListeners so
|
|
256
|
-
// _makeRl can re-attach them after the menu resolves.
|
|
257
355
|
this.rl.removeAllListeners("close");
|
|
258
356
|
this.rl.close();
|
|
259
357
|
const stdin = process.stdin;
|
|
260
|
-
// Bail BEFORE rendering the menu if stdin isn't a TTY. setRawMode
|
|
261
|
-
// can silently no-op on non-TTY stdin in some environments
|
|
262
|
-
// (vitest, piped invocation) — in that case the data listener
|
|
263
|
-
// would attach but never receive bytes, hanging the caller
|
|
264
|
-
// indefinitely. -1 sentinel tells promptApprovalMenu to skip the
|
|
265
|
-
// rejection-reason prompt (which would also hang).
|
|
266
358
|
if (!stdin.isTTY) {
|
|
267
359
|
process.stdout.write(chalk_1.default.red("Rejected (no TTY)\n"));
|
|
268
360
|
return -1;
|
|
@@ -272,20 +364,12 @@ class SessionUI {
|
|
|
272
364
|
stdin.setRawMode(true);
|
|
273
365
|
}
|
|
274
366
|
catch {
|
|
275
|
-
// Belt + suspenders — isTTY guard above should cover this, but a
|
|
276
|
-
// mid-session TTY loss could surface here.
|
|
277
367
|
process.stdout.write(chalk_1.default.red("Rejected (no TTY)\n"));
|
|
278
368
|
return -1;
|
|
279
369
|
}
|
|
280
370
|
stdin.resume();
|
|
281
371
|
let focusedIdx = 0;
|
|
282
372
|
this._renderMenu(focusedIdx);
|
|
283
|
-
// #6532 CR-r1: function-level finally guarantees onData removal +
|
|
284
|
-
// setRawMode restore even if the Promise body throws or the
|
|
285
|
-
// process is signalled. The previous design relied on every
|
|
286
|
-
// `finish()` call doing the cleanup, leaving leak windows when
|
|
287
|
-
// onData itself threw or when an awaiter rejected without
|
|
288
|
-
// routing through finish().
|
|
289
373
|
let onData = null;
|
|
290
374
|
try {
|
|
291
375
|
return await new Promise((resolve, reject) => {
|
|
@@ -296,29 +380,18 @@ class SessionUI {
|
|
|
296
380
|
onData = (chunk) => {
|
|
297
381
|
try {
|
|
298
382
|
const s = chunk.toString();
|
|
299
|
-
// Ctrl+C → reject + propagate SIGINT so the WS handler's
|
|
300
|
-
// close path runs and the session ends cleanly.
|
|
301
383
|
if (s.includes("\x03")) {
|
|
302
384
|
finish(2);
|
|
303
385
|
process.kill(process.pid, "SIGINT");
|
|
304
386
|
return;
|
|
305
387
|
}
|
|
306
|
-
// Allowlisted escape-prefixed sequences. Esc alone (no
|
|
307
|
-
// `[`) → option 3 (reject). Arrow up/down rotate focus.
|
|
308
|
-
// Any OTHER `\x1b`-prefixed input is explicitly rejected
|
|
309
|
-
// (logged to stderr at debug level + ignored) per #6532
|
|
310
|
-
// CR-r1: previously such sequences silently no-op'd,
|
|
311
|
-
// which is currently safe due to the no-echo policy but
|
|
312
|
-
// would become a terminal-injection vector if a future
|
|
313
|
-
// diagnostic change started echoing unknown input.
|
|
314
388
|
if (s.charCodeAt(0) === 0x1b) {
|
|
315
389
|
if (s === "\x1b") {
|
|
316
390
|
finish(2);
|
|
317
391
|
return;
|
|
318
392
|
}
|
|
319
393
|
if (s === "\x1b[A") {
|
|
320
|
-
focusedIdx =
|
|
321
|
-
(focusedIdx - 1 + MENU_OPTIONS.length) % MENU_OPTIONS.length;
|
|
394
|
+
focusedIdx = (focusedIdx - 1 + MENU_OPTIONS.length) % MENU_OPTIONS.length;
|
|
322
395
|
this._rerenderMenu(focusedIdx);
|
|
323
396
|
return;
|
|
324
397
|
}
|
|
@@ -327,27 +400,20 @@ class SessionUI {
|
|
|
327
400
|
this._rerenderMenu(focusedIdx);
|
|
328
401
|
return;
|
|
329
402
|
}
|
|
330
|
-
// Unrecognized escape sequence — log + ignore. Use the
|
|
331
|
-
// hex form so a malicious paste of bell/CSI bytes is
|
|
332
|
-
// not re-rendered through stderr.
|
|
333
403
|
const hex = Array.from(chunk)
|
|
334
404
|
.map((b) => b.toString(16).padStart(2, "0"))
|
|
335
405
|
.join(" ");
|
|
336
406
|
process.stderr.write(chalk_1.default.dim(`\n[approval-menu] ignored unrecognized escape: ${hex}\n`));
|
|
337
407
|
return;
|
|
338
408
|
}
|
|
339
|
-
// Number-key one-shot selectors.
|
|
340
409
|
if (s === "1" || s === "2" || s === "3") {
|
|
341
410
|
finish(Number(s) - 1);
|
|
342
411
|
return;
|
|
343
412
|
}
|
|
344
|
-
// Enter on focused row.
|
|
345
413
|
if (s === "\r" || s === "\n") {
|
|
346
414
|
finish(focusedIdx);
|
|
347
415
|
return;
|
|
348
416
|
}
|
|
349
|
-
// Anything else — ignore. No echo, no bounce. The visible
|
|
350
|
-
// menu stays put so the user can try again.
|
|
351
417
|
}
|
|
352
418
|
catch (err) {
|
|
353
419
|
reject(err);
|
|
@@ -357,18 +423,14 @@ class SessionUI {
|
|
|
357
423
|
});
|
|
358
424
|
}
|
|
359
425
|
finally {
|
|
360
|
-
if (onData)
|
|
426
|
+
if (onData)
|
|
361
427
|
stdin.removeListener("data", onData);
|
|
362
|
-
}
|
|
363
428
|
try {
|
|
364
429
|
stdin.setRawMode(wasRaw);
|
|
365
430
|
}
|
|
366
|
-
catch {
|
|
367
|
-
/* setRawMode can throw if stdin lost its TTY mid-session. */
|
|
368
|
-
}
|
|
431
|
+
catch { /* TTY lost mid-session */ }
|
|
369
432
|
}
|
|
370
433
|
}
|
|
371
|
-
/** Total lines the menu occupies: one per option + one hint line. */
|
|
372
434
|
_menuLineCount() {
|
|
373
435
|
return MENU_OPTIONS.length + 1;
|
|
374
436
|
}
|
|
@@ -381,7 +443,6 @@ class SessionUI {
|
|
|
381
443
|
process.stdout.write(chalk_1.default.dim(` ${MENU_HINT}\n`));
|
|
382
444
|
}
|
|
383
445
|
_rerenderMenu(focusedIdx) {
|
|
384
|
-
// Move cursor up to top of menu, clear each line, redraw.
|
|
385
446
|
const lines = this._menuLineCount();
|
|
386
447
|
process.stdout.write(`\x1b[${lines}A`);
|
|
387
448
|
for (let i = 0; i < MENU_OPTIONS.length; i++) {
|
|
@@ -401,19 +462,19 @@ class SessionUI {
|
|
|
401
462
|
if (i < lines - 1)
|
|
402
463
|
process.stdout.write("\n");
|
|
403
464
|
}
|
|
404
|
-
// Cursor left at start of the (now-cleared) first menu line so
|
|
405
|
-
// the post-selection echo lands there cleanly.
|
|
406
465
|
process.stdout.write(`\x1b[${lines - 1}A\r`);
|
|
407
466
|
}
|
|
408
|
-
// ── Spinner internals
|
|
467
|
+
// ── Spinner internals ─────────────────────────────────────────────────────
|
|
409
468
|
startSpinner(label) {
|
|
410
469
|
this.spinnerLabel = label;
|
|
411
470
|
this.spinnerFrame = 0;
|
|
412
471
|
this.spinnerStartedAt = Date.now();
|
|
413
472
|
this.spinnerLineDirty = false;
|
|
473
|
+
// Hide the terminal cursor while the spinner animates. Without this the
|
|
474
|
+
// blinking hardware cursor jumps column-0 ↔ end on every \r repaint, which
|
|
475
|
+
// reads as a cursor "rapidly disappearing" next to the thinking label.
|
|
476
|
+
process.stdout.write("\x1b[?25l");
|
|
414
477
|
this.spinnerTimer = setInterval(() => this.renderSpinnerFrame(), SPINNER_INTERVAL_MS);
|
|
415
|
-
// Render the first frame immediately so there's no perceptible
|
|
416
|
-
// delay between state-set and visible feedback.
|
|
417
478
|
this.renderSpinnerFrame();
|
|
418
479
|
}
|
|
419
480
|
renderSpinnerFrame() {
|
|
@@ -422,10 +483,6 @@ class SessionUI {
|
|
|
422
483
|
const elapsedStr = elapsed >= ELAPSED_THRESHOLD_MS
|
|
423
484
|
? chalk_1.default.dim(` (${Math.floor(elapsed / 1000)}s)`)
|
|
424
485
|
: "";
|
|
425
|
-
// Clear-to-end-of-line (`\x1b[K`) after the spinner content
|
|
426
|
-
// rather than trailing spaces — robust against terminals where
|
|
427
|
-
// the last frame was longer than the current one (the trailing
|
|
428
|
-
// spaces approach left orphaned chars on shrinking labels).
|
|
429
486
|
process.stdout.write(`\r${chalk_1.default.cyan(frame)} ${chalk_1.default.dim(this.spinnerLabel)}${elapsedStr}\x1b[K`);
|
|
430
487
|
this.spinnerLineDirty = true;
|
|
431
488
|
this.spinnerFrame++;
|
|
@@ -436,15 +493,11 @@ class SessionUI {
|
|
|
436
493
|
this.spinnerTimer = null;
|
|
437
494
|
}
|
|
438
495
|
if (this.spinnerLineDirty) {
|
|
439
|
-
// Clear the spinner line so the next print doesn't overlap.
|
|
440
496
|
process.stdout.write("\r\x1b[K");
|
|
441
497
|
this.spinnerLineDirty = false;
|
|
442
498
|
}
|
|
499
|
+
process.stdout.write("\x1b[?25h"); // restore cursor hidden by startSpinner
|
|
443
500
|
}
|
|
444
|
-
/** Called by the text_delta renderer the first time a real model
|
|
445
|
-
* token arrives during a `generating` state. Clears the spinner so
|
|
446
|
-
* the token prints cleanly, but leaves the state at `generating`
|
|
447
|
-
* (token streaming continues without re-spinning). */
|
|
448
501
|
onFirstToken() {
|
|
449
502
|
if (this.spinnerLineDirty) {
|
|
450
503
|
process.stdout.write("\r\x1b[K");
|
|
@@ -454,6 +507,7 @@ class SessionUI {
|
|
|
454
507
|
clearInterval(this.spinnerTimer);
|
|
455
508
|
this.spinnerTimer = null;
|
|
456
509
|
}
|
|
510
|
+
process.stdout.write("\x1b[?25h"); // restore cursor hidden by startSpinner
|
|
457
511
|
}
|
|
458
512
|
}
|
|
459
513
|
exports.SessionUI = SessionUI;
|
package/dist/ui_state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui_state.js","sourceRoot":"","sources":["../src/ui_state.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AACrC,kDAA0B;AAY1B,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAC1E,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAChC,MAAM,oBAAoB,GAAG,IAAI,CAAC,CAAC,+BAA+B;AAElE,MAAM,YAAY,GAA0B;IAC1C,KAAK;IACL,yBAAyB;IACzB,4BAA4B;CAC7B,CAAC;AACF,MAAM,SAAS,GAAG,gCAAgC,CAAC;AAEnD,MAAa,SAAS;IACZ,KAAK,GAAa,MAAM,CAAC;IACzB,YAAY,GAA0B,IAAI,CAAC;IAC3C,YAAY,GAAG,CAAC,CAAC;IACjB,gBAAgB,GAAG,CAAC,CAAC;IACrB,YAAY,GAAG,EAAE,CAAC;IAC1B,oEAAoE;IACpE,mEAAmE;IACnE,8DAA8D;IAC9D,mCAAmC;IAC3B,gBAAgB,GAAG,KAAK,CAAC;IAEzB,EAAE,CAAqB;IACvB,YAAY,GAAoC,IAAI,CAAC;IA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