@chances-ai/tui 16.0.0 → 18.0.0
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/app.d.ts +1 -1
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +2 -2
- package/dist/app.js.map +1 -1
- package/dist/code-view.js +1 -1
- package/dist/code-view.js.map +1 -1
- package/dist/diff-view.js +1 -1
- package/dist/diff-view.js.map +1 -1
- package/dist/help-view.d.ts +46 -0
- package/dist/help-view.d.ts.map +1 -0
- package/dist/help-view.js +52 -0
- package/dist/help-view.js.map +1 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/select.d.ts +5 -0
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +11 -1
- package/dist/select.js.map +1 -1
- package/dist/theme.d.ts +15 -101
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +18 -109
- package/dist/theme.js.map +1 -1
- package/dist/tool-message.js +1 -1
- package/dist/tool-message.js.map +1 -1
- package/package.json +6 -5
- package/dist/diff-model.d.ts +0 -64
- package/dist/diff-model.d.ts.map +0 -1
- package/dist/diff-model.js +0 -156
- package/dist/diff-model.js.map +0 -1
- package/dist/frame-scheduler.d.ts +0 -44
- package/dist/frame-scheduler.d.ts.map +0 -1
- package/dist/frame-scheduler.js +0 -58
- package/dist/frame-scheduler.js.map +0 -1
- package/dist/highlight-to-segments.d.ts +0 -18
- package/dist/highlight-to-segments.d.ts.map +0 -1
- package/dist/highlight-to-segments.js +0 -224
- package/dist/highlight-to-segments.js.map +0 -1
- package/dist/tool-line.d.ts +0 -33
- package/dist/tool-line.d.ts.map +0 -1
- package/dist/tool-line.js +0 -168
- package/dist/tool-line.js.map +0 -1
- package/dist/view-model.d.ts +0 -226
- package/dist/view-model.d.ts.map +0 -1
- package/dist/view-model.js +0 -488
- package/dist/view-model.js.map +0 -1
package/dist/view-model.js
DELETED
|
@@ -1,488 +0,0 @@
|
|
|
1
|
-
import { defaultFrameScheduler, } from "./frame-scheduler.js";
|
|
2
|
-
import { formatToolCall } from "./tool-line.js";
|
|
3
|
-
/** (5.9) Extract the `linesDiff` block (from the first `@@ -d` hunk header to
|
|
4
|
-
* the end) out of a write/edit permission summary, or null when the summary
|
|
5
|
-
* carries no diff (single-line edits, "diff preview skipped", non-write tools). */
|
|
6
|
-
export function extractDiff(summary) {
|
|
7
|
-
const lines = summary.split("\n");
|
|
8
|
-
const idx = lines.findIndex((l) => /^@@ -\d/.test(l));
|
|
9
|
-
return idx < 0 ? null : lines.slice(idx).join("\n");
|
|
10
|
-
}
|
|
11
|
-
/** (5.8) Default count of leading tool-result lines shown inline before the
|
|
12
|
-
* rest collapses to a `… +N more lines` note. Overridable via
|
|
13
|
-
* `config.tui.toolResultPreviewLines`. */
|
|
14
|
-
const DEFAULT_TOOL_RESULT_PREVIEW_LINES = 12;
|
|
15
|
-
/**
|
|
16
|
-
* Observable view-model. The Ink tree subscribes via useSyncExternalStore and
|
|
17
|
-
* never touches domain objects directly — the only inputs are bus events and the
|
|
18
|
-
* permission resolver. This is the seam that keeps the UI decoupled from core.
|
|
19
|
-
*
|
|
20
|
-
* (5.8) Rendering is split into a committed prefix (frozen scrollback fed to
|
|
21
|
-
* Ink `<Static>`, rendered once) and a small live tail (re-rendered each
|
|
22
|
-
* frame). Streamed `assistant:delta` re-renders are coalesced to one per frame
|
|
23
|
-
* via {@link FrameScheduler}; every structural event force-flushes immediately.
|
|
24
|
-
*/
|
|
25
|
-
export class ChatViewModel {
|
|
26
|
-
approval;
|
|
27
|
-
lines = [];
|
|
28
|
-
busy = false;
|
|
29
|
-
pending = null;
|
|
30
|
-
/** (5.3) True while the Shift+Tab-into-yolo confirmation overlay is up.
|
|
31
|
-
* app.tsx renders the red confirm box; `resolveYoloConfirm` clears it. */
|
|
32
|
-
yoloConfirmPending = false;
|
|
33
|
-
/**
|
|
34
|
-
* (5.8) Count of leading `lines` that are committed (frozen). Lines
|
|
35
|
-
* `[0, committedCount)` are append-only — an index's content never changes
|
|
36
|
-
* once committed — and feed Ink `<Static>`. Lines `[committedCount, end)`
|
|
37
|
-
* are the live tail. Advanced ONLY forward (monotonic) so `<Static>` never
|
|
38
|
-
* has to un-render anything. The only line that ever mutates in place is an
|
|
39
|
-
* open assistant line (text grows per delta) and it is always live.
|
|
40
|
-
*/
|
|
41
|
-
committedCount = 0;
|
|
42
|
-
/**
|
|
43
|
-
* (5.8) Bumped by `clearLines()` and used as the Ink `<Static key>`. Ink
|
|
44
|
-
* `<Static>` can't be emptied by replacing its items, so `/clear` remounts
|
|
45
|
-
* it under a fresh key (needs `ink >= 7.0.3`, which fixes the
|
|
46
|
-
* remount-with-different-key drop-new-items bug).
|
|
47
|
-
*/
|
|
48
|
-
clearGeneration = 0;
|
|
49
|
-
version = 0;
|
|
50
|
-
listeners = new Set();
|
|
51
|
-
assistantOpen = false;
|
|
52
|
-
busUnsubscribers = [];
|
|
53
|
-
scheduler;
|
|
54
|
-
toolResultPreviewLines;
|
|
55
|
-
/** Non-null while a coalesced delta frame is queued (see `scheduleBump`). */
|
|
56
|
-
pendingFrame = null;
|
|
57
|
-
/**
|
|
58
|
-
* (5.9) Diff blocks parsed from `tool:permission` summaries, keyed by callId,
|
|
59
|
-
* awaiting their `tool:result` so they can be attached to the tool line and
|
|
60
|
-
* rendered under the `⎿` branch. Emitted before `gate.evaluate` for every
|
|
61
|
-
* write/edit call (engine.ts:763) — so this populates even under
|
|
62
|
-
* auto-edit/yolo, giving transcript diffs in all approval modes with zero
|
|
63
|
-
* engine/contract change. Cleared on detach/clear so it can't leak.
|
|
64
|
-
*/
|
|
65
|
-
diffStash = new Map();
|
|
66
|
-
/**
|
|
67
|
-
* (5.3) Optional session approval-mode holder. When wired (interactive
|
|
68
|
-
* `chat`), the footer reflects `approvalMode` and Shift+Tab / `/approval`
|
|
69
|
-
* mutate it. Left undefined in tests that don't exercise modes — every
|
|
70
|
-
* approval method then no-ops and `approvalMode` reads `"default"`.
|
|
71
|
-
*
|
|
72
|
-
* (5.8) `options` injects the frame scheduler + tool-result preview length;
|
|
73
|
-
* both default so existing callers (`new ChatViewModel()`,
|
|
74
|
-
* `new ChatViewModel(approval)`) keep working unchanged.
|
|
75
|
-
*/
|
|
76
|
-
constructor(approval, options) {
|
|
77
|
-
this.approval = approval;
|
|
78
|
-
this.scheduler = options?.scheduler ?? defaultFrameScheduler;
|
|
79
|
-
this.toolResultPreviewLines =
|
|
80
|
-
options?.toolResultPreviewLines ?? DEFAULT_TOOL_RESULT_PREVIEW_LINES;
|
|
81
|
-
}
|
|
82
|
-
subscribe = (fn) => {
|
|
83
|
-
this.listeners.add(fn);
|
|
84
|
-
return () => this.listeners.delete(fn);
|
|
85
|
-
};
|
|
86
|
-
getSnapshot = () => this.version;
|
|
87
|
-
/**
|
|
88
|
-
* (5.8) The frozen scrollback prefix — fed to Ink `<Static>` and rendered
|
|
89
|
-
* once. Guaranteed append-only: the element at index `i` never changes once
|
|
90
|
-
* it appears here. A fresh array is returned each call, but the prefix
|
|
91
|
-
* content is stable, which is all `<Static>` relies on.
|
|
92
|
-
*/
|
|
93
|
-
committedLines() {
|
|
94
|
-
return this.lines.slice(0, this.committedCount);
|
|
95
|
-
}
|
|
96
|
-
/** (5.8) The live tail re-rendered each frame: the open assistant line while
|
|
97
|
-
* streaming, or an in-flight tool / tool-result line awaiting its terminal
|
|
98
|
-
* event. Usually 0–1 entries. */
|
|
99
|
-
liveLines() {
|
|
100
|
-
return this.lines.slice(this.committedCount);
|
|
101
|
-
}
|
|
102
|
-
/** (5.9) The still-live `tool` line for a callId (normally the last line).
|
|
103
|
-
* Returns a mutable ref so `tool:result` can fill it in place — safe because
|
|
104
|
-
* it is in the live region (index ≥ committedCount), not yet committed. */
|
|
105
|
-
findLiveTool(callId) {
|
|
106
|
-
for (let i = this.lines.length - 1; i >= this.committedCount; i--) {
|
|
107
|
-
const l = this.lines[i];
|
|
108
|
-
if (l && l.kind === "tool" && l.callId === callId)
|
|
109
|
-
return l;
|
|
110
|
-
}
|
|
111
|
-
return undefined;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* (5.9 codex R2 MUST-1) Advance `committedCount` toward `target` but NEVER
|
|
115
|
-
* past the earliest still-running tool line (`kind:"tool"` with `ok ===
|
|
116
|
-
* undefined`). A sync/background subagent emits its own `tool:call` /
|
|
117
|
-
* `assistant:delta` frames on the SAME bus BETWEEN a parent `task` tool's
|
|
118
|
-
* call and its result; without this clamp those frames would commit the
|
|
119
|
-
* parent's tool line, after which `findLiveTool` could no longer fill it
|
|
120
|
-
* (mutating a committed line breaks the `<Static>` append-only invariant) and
|
|
121
|
-
* the parent result would spawn a duplicate empty block. Keeping every
|
|
122
|
-
* unresolved tool line live until its result arrives makes the fill always
|
|
123
|
-
* append-only-safe. `turn:end` force-commits unconditionally (the turn is
|
|
124
|
-
* over). Monotonic: `target ≥ committedCount`, and the result is in
|
|
125
|
-
* `[committedCount, target]`.
|
|
126
|
-
*/
|
|
127
|
-
commitThrough(target) {
|
|
128
|
-
let limit = target;
|
|
129
|
-
for (let i = this.committedCount; i < target; i++) {
|
|
130
|
-
const l = this.lines[i];
|
|
131
|
-
if (l && l.kind === "tool" && l.ok === undefined) {
|
|
132
|
-
limit = i;
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
if (limit > this.committedCount)
|
|
137
|
-
this.committedCount = limit;
|
|
138
|
-
}
|
|
139
|
-
bump() {
|
|
140
|
-
this.version++;
|
|
141
|
-
for (const l of this.listeners)
|
|
142
|
-
l();
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* (5.8) Coalesce a streamed-token re-render onto the next frame. The first
|
|
146
|
-
* delta in a window arms the scheduler; later deltas in the same window are
|
|
147
|
-
* no-ops (the text is already accumulated on the line), so N tokens cause
|
|
148
|
-
* at most one render per frame instead of N.
|
|
149
|
-
*/
|
|
150
|
-
scheduleBump() {
|
|
151
|
-
if (this.pendingFrame !== null)
|
|
152
|
-
return;
|
|
153
|
-
this.pendingFrame = this.scheduler.schedule(() => {
|
|
154
|
-
this.pendingFrame = null;
|
|
155
|
-
this.bump();
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
/** (5.8) Drop a queued delta frame if one is pending. */
|
|
159
|
-
cancelPendingBump() {
|
|
160
|
-
if (this.pendingFrame !== null) {
|
|
161
|
-
this.scheduler.cancel(this.pendingFrame);
|
|
162
|
-
this.pendingFrame = null;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* (5.8) Immediate notify that first drops any pending coalesced delta frame.
|
|
167
|
-
* Used by every structural mutation (finished message, tool call/result,
|
|
168
|
-
* turn boundary, user action) so the UI never renders a structural change
|
|
169
|
-
* behind a stale token-stream frame, and a cancelled frame can't fire into a
|
|
170
|
-
* later epoch.
|
|
171
|
-
*/
|
|
172
|
-
forceFlush() {
|
|
173
|
-
this.cancelPendingBump();
|
|
174
|
-
this.bump();
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Push a standalone, immutable line and commit everything (it and any prior
|
|
178
|
-
* live tail are terminal-on-creation).
|
|
179
|
-
*
|
|
180
|
-
* Closing `assistantOpen` here means a standalone line pushed while a stream
|
|
181
|
-
* is open ends that stream: the next `assistant:delta` opens a FRESH line
|
|
182
|
-
* rather than appending to the committed one — so the committed line is
|
|
183
|
-
* genuinely final (append-only holds; see the interleaving regression test).
|
|
184
|
-
* That a mid-stream user submit / mode-cycle visually splits the assistant
|
|
185
|
-
* message is a pre-existing interaction behavior (NOT a v13 regression — the
|
|
186
|
-
* pre-v13 `pushUser` closed the stream the same way); richer mid-turn input
|
|
187
|
-
* handling (queueing) is a v15 interaction-model concern, out of v13 scope.
|
|
188
|
-
*/
|
|
189
|
-
pushCommitted(line) {
|
|
190
|
-
this.assistantOpen = false;
|
|
191
|
-
this.lines.push(line);
|
|
192
|
-
this.committedCount = this.lines.length;
|
|
193
|
-
}
|
|
194
|
-
pushUser(text) {
|
|
195
|
-
this.pushCommitted({ kind: "user", text });
|
|
196
|
-
this.forceFlush();
|
|
197
|
-
}
|
|
198
|
-
pushInfo(text) {
|
|
199
|
-
this.pushCommitted({ kind: "info", text });
|
|
200
|
-
this.forceFlush();
|
|
201
|
-
}
|
|
202
|
-
pushError(text) {
|
|
203
|
-
this.pushCommitted({ kind: "error", text });
|
|
204
|
-
this.forceFlush();
|
|
205
|
-
}
|
|
206
|
-
/** Empties the rendered scrollback — used by `/clear` so the user sees a
|
|
207
|
-
* fresh view alongside the session.clearTurns() that drops the conversation
|
|
208
|
-
* history. The view-model and the underlying session are intentionally
|
|
209
|
-
* separate operations; the slash command sequences both.
|
|
210
|
-
*
|
|
211
|
-
* (5.8) Because Ink `<Static>` keeps everything ever handed to it, emptying
|
|
212
|
-
* `lines` is not enough — `clearGeneration` is bumped so app.tsx can remount
|
|
213
|
-
* `<Static>` under a fresh key. Any pending delta frame is dropped so it
|
|
214
|
-
* can't fire into the cleared epoch. */
|
|
215
|
-
clearLines() {
|
|
216
|
-
this.cancelPendingBump();
|
|
217
|
-
this.lines = [];
|
|
218
|
-
this.committedCount = 0;
|
|
219
|
-
this.clearGeneration++;
|
|
220
|
-
this.assistantOpen = false;
|
|
221
|
-
this.diffStash.clear();
|
|
222
|
-
this.bump();
|
|
223
|
-
}
|
|
224
|
-
attach(bus) {
|
|
225
|
-
// Unsub any prior subscription, but DON'T latch `detached` — `attach`
|
|
226
|
-
// is the lifecycle "this VM is live again" signal, and the latching
|
|
227
|
-
// version of detach (below) is reserved for engine respawns where the
|
|
228
|
-
// caller has already constructed a new VM and is winding this one down.
|
|
229
|
-
for (const unsubscribe of this.busUnsubscribers.splice(0))
|
|
230
|
-
unsubscribe();
|
|
231
|
-
this.detached = false;
|
|
232
|
-
this.busUnsubscribers = [
|
|
233
|
-
bus.on("turn:start", () => {
|
|
234
|
-
this.busy = true;
|
|
235
|
-
this.forceFlush();
|
|
236
|
-
}),
|
|
237
|
-
bus.on("turn:end", () => {
|
|
238
|
-
this.busy = false;
|
|
239
|
-
// Flush the whole live region: the turn is over, nothing more will
|
|
240
|
-
// change any trailing line.
|
|
241
|
-
this.committedCount = this.lines.length;
|
|
242
|
-
this.forceFlush();
|
|
243
|
-
}),
|
|
244
|
-
bus.on("assistant:delta", (e) => {
|
|
245
|
-
if (!this.assistantOpen) {
|
|
246
|
-
// Commit any prior live tail before the new narration line opens
|
|
247
|
-
// (but not past an unresolved tool line — see `commitThrough`).
|
|
248
|
-
this.commitThrough(this.lines.length);
|
|
249
|
-
this.lines.push({ kind: "assistant", text: "" });
|
|
250
|
-
this.assistantOpen = true;
|
|
251
|
-
}
|
|
252
|
-
this.lines[this.lines.length - 1].text += e.text;
|
|
253
|
-
// Coalesce: at most one render per frame for a fast token stream.
|
|
254
|
-
this.scheduleBump();
|
|
255
|
-
}),
|
|
256
|
-
bus.on("assistant:message", () => {
|
|
257
|
-
// The streamed line is final — commit it (not past an unresolved tool).
|
|
258
|
-
this.assistantOpen = false;
|
|
259
|
-
this.commitThrough(this.lines.length);
|
|
260
|
-
this.forceFlush();
|
|
261
|
-
}),
|
|
262
|
-
bus.on("tool:call", (e) => {
|
|
263
|
-
// A tool-using turn emits NO `assistant:message`, so closing the open
|
|
264
|
-
// assistant line here is what commits the narration (codex R1 MF-2).
|
|
265
|
-
// (5.9) One line per tool call: the same line later gains its result /
|
|
266
|
-
// diff (filled in `tool:result` while still LIVE), so the `⏺` dot can
|
|
267
|
-
// reflect the final ok/err without ever mutating a committed line.
|
|
268
|
-
this.assistantOpen = false;
|
|
269
|
-
this.lines.push({
|
|
270
|
-
kind: "tool",
|
|
271
|
-
toolName: e.name,
|
|
272
|
-
text: formatToolCall(e.name, e.args),
|
|
273
|
-
callId: e.callId,
|
|
274
|
-
});
|
|
275
|
-
// Commit prior lines, but not past an earlier still-running tool line
|
|
276
|
-
// (e.g. the parent `task` line while a subagent streams).
|
|
277
|
-
this.commitThrough(this.lines.length - 1);
|
|
278
|
-
this.forceFlush();
|
|
279
|
-
}),
|
|
280
|
-
bus.on("tool:permission", (e) => {
|
|
281
|
-
// (5.9) Stash the diff for the matching tool:result. No UI change here —
|
|
282
|
-
// the prompt overlay reads `vm.pending.req.summary` directly.
|
|
283
|
-
const diff = extractDiff(e.summary);
|
|
284
|
-
if (diff !== null)
|
|
285
|
-
this.diffStash.set(e.callId, { diff, anchored: e.name === "write" });
|
|
286
|
-
}),
|
|
287
|
-
bus.on("tool:result", (e) => {
|
|
288
|
-
// (5.9) Fill the still-live tool line (append-only safe) and commit the
|
|
289
|
-
// now-complete block. Attach any stashed diff (write/edit).
|
|
290
|
-
const stash = this.diffStash.get(e.callId);
|
|
291
|
-
this.diffStash.delete(e.callId);
|
|
292
|
-
const line = this.findLiveTool(e.callId);
|
|
293
|
-
const result = previewToolResult(e.output, this.toolResultPreviewLines);
|
|
294
|
-
if (line) {
|
|
295
|
-
line.ok = e.ok;
|
|
296
|
-
line.result = result;
|
|
297
|
-
if (stash) {
|
|
298
|
-
line.diff = stash.diff;
|
|
299
|
-
line.anchored = stash.anchored;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
else {
|
|
303
|
-
// No matching live call line (defensive) — push a standalone block.
|
|
304
|
-
this.lines.push({
|
|
305
|
-
kind: "tool",
|
|
306
|
-
toolName: e.name,
|
|
307
|
-
text: "",
|
|
308
|
-
ok: e.ok,
|
|
309
|
-
result,
|
|
310
|
-
...(stash ? { diff: stash.diff, anchored: stash.anchored } : {}),
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
// The filled line is now resolved; commit up to it (but still not past
|
|
314
|
-
// any EARLIER unresolved tool line — e.g. an outer parent task).
|
|
315
|
-
this.commitThrough(this.lines.length);
|
|
316
|
-
this.forceFlush();
|
|
317
|
-
}),
|
|
318
|
-
bus.on("error", (e) => {
|
|
319
|
-
this.pushCommitted({ kind: "error", text: `${e.code}: ${e.message}` });
|
|
320
|
-
this.forceFlush();
|
|
321
|
-
}),
|
|
322
|
-
];
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* (3.4 — codex Round-2 MUST-FIX #2) Once a VM is detached (engine
|
|
326
|
-
* respawn via `/resume`, `/clear` shouldn't detach but if a future
|
|
327
|
-
* caller does), any in-flight `requestPermission` is rejected with
|
|
328
|
-
* a synthetic "denied" decision so the closing-over-stale-resolver
|
|
329
|
-
* call sites (notably the background-task child engine that holds
|
|
330
|
-
* `deps.gate` from before the respawn) don't hang waiting for a
|
|
331
|
-
* prompt that will never reach a user. Any *future* call to
|
|
332
|
-
* `requestPermission` on this detached VM short-circuits the same
|
|
333
|
-
* way — same reasoning.
|
|
334
|
-
*
|
|
335
|
-
* (5.8) Also drops any pending coalesced frame so a scheduled bump
|
|
336
|
-
* can't fire into a remounted/stale epoch.
|
|
337
|
-
*/
|
|
338
|
-
detach() {
|
|
339
|
-
for (const unsubscribe of this.busUnsubscribers.splice(0))
|
|
340
|
-
unsubscribe();
|
|
341
|
-
this.detached = true;
|
|
342
|
-
this.cancelPendingBump();
|
|
343
|
-
this.diffStash.clear();
|
|
344
|
-
if (this.pending) {
|
|
345
|
-
const p = this.pending;
|
|
346
|
-
this.pending = null;
|
|
347
|
-
// (5.10b) Reject in-flight requests in their own variant.
|
|
348
|
-
p.resolve(p.req.kind === "question" ? { kind: "question", answers: {}, declined: true } : { allow: false });
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
detached = false;
|
|
352
|
-
/** Returned to the PermissionGate as its resolver. After `detach()`,
|
|
353
|
-
* any call resolves denied synchronously — see `detach()` docstring. */
|
|
354
|
-
requestPermission = (req) => {
|
|
355
|
-
if (this.detached) {
|
|
356
|
-
// (5.10b) Decline in the request's own variant.
|
|
357
|
-
return Promise.resolve(req.kind === "question" ? { kind: "question", answers: {}, declined: true } : { allow: false });
|
|
358
|
-
}
|
|
359
|
-
return new Promise((resolve) => {
|
|
360
|
-
this.pending = { req, resolve };
|
|
361
|
-
this.forceFlush();
|
|
362
|
-
});
|
|
363
|
-
};
|
|
364
|
-
/**
|
|
365
|
-
* (5.3) Resolve the open permission prompt with a full decision:
|
|
366
|
-
* - `{allow:true}` — approve once (not remembered).
|
|
367
|
-
* - `{allow:true, remember:true}` — approve & don't ask again (the gate
|
|
368
|
-
* caches it even for un-scoped tools like file-write).
|
|
369
|
-
* - `{allow:false}` — plain deny.
|
|
370
|
-
* - `{allow:false, feedback}` — deny + relay the user's note to the model.
|
|
371
|
-
*/
|
|
372
|
-
resolvePermission(decision) {
|
|
373
|
-
const p = this.pending;
|
|
374
|
-
// (5.10b) Authorization-only path; a question pending is settled via
|
|
375
|
-
// resolveQuestion. Narrowing on `kind` also lets us read `req.summary`.
|
|
376
|
-
if (!p || p.req.kind === "question") {
|
|
377
|
-
this.forceFlush();
|
|
378
|
-
return;
|
|
379
|
-
}
|
|
380
|
-
this.pending = null;
|
|
381
|
-
const verb = decision.allow
|
|
382
|
-
? decision.remember
|
|
383
|
-
? "approved (won't ask again)"
|
|
384
|
-
: "approved"
|
|
385
|
-
: decision.feedback
|
|
386
|
-
? "denied with feedback"
|
|
387
|
-
: "denied";
|
|
388
|
-
this.pushCommitted({ kind: "info", text: `${verb}: ${p.req.summary}` });
|
|
389
|
-
p.resolve(decision);
|
|
390
|
-
this.forceFlush();
|
|
391
|
-
}
|
|
392
|
-
/**
|
|
393
|
-
* (5.10b) Resolve an open QUESTION prompt with the user's answers (or a
|
|
394
|
-
* decline). Mirrors {@link resolvePermission} for the `question` pending
|
|
395
|
-
* variant — the `ask_user_question` tool turns the decision into the
|
|
396
|
-
* model-facing tool result.
|
|
397
|
-
*/
|
|
398
|
-
resolveQuestion(decision) {
|
|
399
|
-
const p = this.pending;
|
|
400
|
-
if (!p || p.req.kind !== "question") {
|
|
401
|
-
this.forceFlush();
|
|
402
|
-
return;
|
|
403
|
-
}
|
|
404
|
-
this.pending = null;
|
|
405
|
-
const header = p.req.questions[0]?.header ?? "question";
|
|
406
|
-
this.pushCommitted({
|
|
407
|
-
kind: "info",
|
|
408
|
-
text: `${decision.declined ? "declined" : "answered"}: ${header}`,
|
|
409
|
-
});
|
|
410
|
-
p.resolve(decision);
|
|
411
|
-
this.forceFlush();
|
|
412
|
-
}
|
|
413
|
-
// -- approval mode (5.3) ----------------------------------------------------
|
|
414
|
-
/** The current session approval mode (`"default"` when unwired). */
|
|
415
|
-
get approvalMode() {
|
|
416
|
-
return this.approval?.get() ?? "default";
|
|
417
|
-
}
|
|
418
|
-
/**
|
|
419
|
-
* Shift+Tab handler. Advances the cycle; cycling INTO `yolo` without a prior
|
|
420
|
-
* confirmation opens the confirm overlay instead of switching (the typed
|
|
421
|
-
* `/approval yolo` path counts as consent and skips this — see
|
|
422
|
-
* `setApprovalMode`).
|
|
423
|
-
*/
|
|
424
|
-
cycleApprovalMode() {
|
|
425
|
-
if (!this.approval)
|
|
426
|
-
return;
|
|
427
|
-
const next = this.approval.next();
|
|
428
|
-
if (next === "yolo" && !this.approval.isYoloConfirmed()) {
|
|
429
|
-
this.yoloConfirmPending = true;
|
|
430
|
-
this.forceFlush();
|
|
431
|
-
return;
|
|
432
|
-
}
|
|
433
|
-
this.approval.set(next);
|
|
434
|
-
this.pushCommitted({ kind: "info", text: `approval mode → ${next}` });
|
|
435
|
-
this.forceFlush();
|
|
436
|
-
}
|
|
437
|
-
/** Resolve the yolo confirm overlay. `confirm` latches yolo for the session. */
|
|
438
|
-
resolveYoloConfirm(confirm) {
|
|
439
|
-
this.yoloConfirmPending = false;
|
|
440
|
-
if (confirm && this.approval) {
|
|
441
|
-
this.approval.confirmYolo();
|
|
442
|
-
this.approval.set("yolo");
|
|
443
|
-
this.pushCommitted({
|
|
444
|
-
kind: "info",
|
|
445
|
-
text: "approval mode → yolo (all tool calls auto-approved)",
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
this.forceFlush();
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
/** Secondary guard for {@link previewToolResult}: a generous total-character
|
|
452
|
-
* ceiling so a single very long line (e.g. minified JSON with no newlines)
|
|
453
|
-
* can't blow up the live render even though it passes the line-count check.
|
|
454
|
-
* Far larger than the old hard 400-char clip — it only bites pathological
|
|
455
|
-
* single lines, never normal multi-line diffs / command output. The full
|
|
456
|
-
* output is already on disk when it overflowed (the result banner). */
|
|
457
|
-
const MAX_PREVIEW_CHARS = 8000;
|
|
458
|
-
/**
|
|
459
|
-
* (5.8) Line-aware tool-result preview: show the first `maxLines` content
|
|
460
|
-
* lines, then collapse the rest to a `… +N more lines` note. Replaces the old
|
|
461
|
-
* hard 400-char clip, which truncated multi-line diffs / command output
|
|
462
|
-
* mid-line. When a tool's full output overflowed it was already persisted to
|
|
463
|
-
* disk and the path is part of `output` (the banner), so nothing is lost.
|
|
464
|
-
*
|
|
465
|
-
* A single trailing newline is not counted as a hidden line (codex R2
|
|
466
|
-
* SHOULD-FIX): `"a\nb\n"` is two content lines, not three. After the
|
|
467
|
-
* line-aware pass, {@link MAX_PREVIEW_CHARS} caps a pathological single huge
|
|
468
|
-
* line (codex R2 NICE).
|
|
469
|
-
*/
|
|
470
|
-
function previewToolResult(output, maxLines) {
|
|
471
|
-
const lines = output.split("\n");
|
|
472
|
-
// A terminal "\n" yields a final empty segment that isn't a content line.
|
|
473
|
-
const contentLineCount = lines.length > 0 && lines[lines.length - 1] === "" ? lines.length - 1 : lines.length;
|
|
474
|
-
let preview;
|
|
475
|
-
if (contentLineCount <= maxLines) {
|
|
476
|
-
preview = output;
|
|
477
|
-
}
|
|
478
|
-
else {
|
|
479
|
-
const hidden = contentLineCount - maxLines;
|
|
480
|
-
preview = `${lines.slice(0, maxLines).join("\n")}\n… +${hidden} more line${hidden === 1 ? "" : "s"}`;
|
|
481
|
-
}
|
|
482
|
-
if (preview.length > MAX_PREVIEW_CHARS) {
|
|
483
|
-
const hiddenChars = preview.length - MAX_PREVIEW_CHARS;
|
|
484
|
-
preview = `${preview.slice(0, MAX_PREVIEW_CHARS)}… +${hiddenChars} more characters`;
|
|
485
|
-
}
|
|
486
|
-
return preview;
|
|
487
|
-
}
|
|
488
|
-
//# sourceMappingURL=view-model.js.map
|
package/dist/view-model.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"view-model.js","sourceRoot":"","sources":["../src/view-model.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;oFAEoF;AACpF,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACtD,CAAC;AA2BD;;2CAE2C;AAC3C,MAAM,iCAAiC,GAAG,EAAE,CAAC;AAU7C;;;;;;;;;GASG;AACH,MAAM,OAAO,aAAa;IAsDL;IArDnB,KAAK,GAAW,EAAE,CAAC;IACnB,IAAI,GAAG,KAAK,CAAC;IACb,OAAO,GAAmB,IAAI,CAAC;IAC/B;+EAC2E;IAC3E,kBAAkB,GAAG,KAAK,CAAC;IAE3B;;;;;;;OAOG;IACH,cAAc,GAAG,CAAC,CAAC;IACnB;;;;;OAKG;IACH,eAAe,GAAG,CAAC,CAAC;IAEZ,OAAO,GAAG,CAAC,CAAC;IACH,SAAS,GAAG,IAAI,GAAG,EAAc,CAAC;IAC3C,aAAa,GAAG,KAAK,CAAC;IACtB,gBAAgB,GAAsB,EAAE,CAAC;IAChC,SAAS,CAAiB;IAC1B,sBAAsB,CAA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