@wrongstack/tui 0.295.0 → 0.295.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-initial-state.d.ts +4 -2
- package/dist/app-initial-state.d.ts.map +1 -1
- package/dist/app-key-handler.d.ts +1 -1
- package/dist/app-key-handler.d.ts.map +1 -1
- package/dist/app-status-region.d.ts +1 -1
- package/dist/app-status-region.d.ts.map +1 -1
- package/dist/components/entry-error-boundary.d.ts +37 -0
- package/dist/components/entry-error-boundary.d.ts.map +1 -0
- package/dist/components/history/banner.d.ts +1 -1
- package/dist/components/history/banner.d.ts.map +1 -1
- package/dist/components/history/entry.d.ts +1 -1
- package/dist/components/history/entry.d.ts.map +1 -1
- package/dist/components/history/replay.d.ts +12 -0
- package/dist/components/history/replay.d.ts.map +1 -1
- package/dist/components/history/utils.d.ts.map +1 -1
- package/dist/components/scrollable-history.d.ts.map +1 -1
- package/dist/components/tools-picker.d.ts.map +1 -1
- package/dist/hooks/use-director-fleet-bridge.d.ts.map +1 -1
- package/dist/hooks/use-next-steps-auto-submit.d.ts.map +1 -1
- package/dist/hooks/use-provider-event-bridge.d.ts.map +1 -1
- package/dist/hooks/use-subagent-events.d.ts.map +1 -1
- package/dist/hooks/use-terminal-render-lifecycle.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +491 -454
- package/dist/index.js.map +4 -4
- package/dist/input-validation.d.ts +3 -3
- package/dist/input-validation.d.ts.map +1 -1
- package/dist/layout-store.d.ts +8 -1
- package/dist/layout-store.d.ts.map +1 -1
- package/dist/reducers/conversation.d.ts.map +1 -1
- package/dist/submit-prompt-refinement.d.ts.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -94,20 +94,28 @@ function authMoveSelected(state, delta) {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
// src/components/history/replay.ts
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
97
|
+
import { SESSION_MARKER_EVENT_TYPES, sessionEventToMarker } from "@wrongstack/core/types";
|
|
98
|
+
var MARKER_EVENT_TYPES = SESSION_MARKER_EVENT_TYPES;
|
|
99
|
+
var SUBAGENT_MARKER_STYLE = {
|
|
100
|
+
agent_spawned: { color: "magenta", icon: "\u26A1" },
|
|
101
|
+
agent_stopped: { color: "gray", icon: "\u2298" },
|
|
102
|
+
agent_error: { color: "red", icon: "\u2717" }
|
|
103
|
+
};
|
|
104
|
+
function markerToEntry(marker) {
|
|
105
|
+
if (marker.agentId !== void 0) {
|
|
106
|
+
const style = SUBAGENT_MARKER_STYLE[marker.source] ?? { color: "gray", icon: "\xB7" };
|
|
107
|
+
return {
|
|
108
|
+
kind: "subagent",
|
|
109
|
+
agentLabel: marker.agentId.slice(0, 8),
|
|
110
|
+
agentColor: style.color,
|
|
111
|
+
icon: style.icon,
|
|
112
|
+
text: marker.text
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
if (marker.level === "error") return { kind: "error", text: marker.text };
|
|
116
|
+
if (marker.level === "warn") return { kind: "warn", text: marker.text };
|
|
117
|
+
return { kind: "info", text: marker.text };
|
|
118
|
+
}
|
|
111
119
|
function toolOutputPreview(content) {
|
|
112
120
|
return (typeof content === "string" ? content : JSON.stringify(content)).slice(0, 400);
|
|
113
121
|
}
|
|
@@ -208,34 +216,11 @@ function replaySessionMessages(messages, events, startId) {
|
|
|
208
216
|
while (j < markers.length) emit(markers[j++].entry);
|
|
209
217
|
return entries;
|
|
210
218
|
}
|
|
211
|
-
function replaySessionEvents(events, startId) {
|
|
212
|
-
const entries = [];
|
|
213
|
-
let nextId = startId;
|
|
214
|
-
const pendingTools = /* @__PURE__ */ new Map();
|
|
215
|
-
const completedTools = /* @__PURE__ */ new Map();
|
|
216
|
-
for (const ev of events) {
|
|
217
|
-
const entry = eventToEntry(ev, pendingTools, completedTools);
|
|
218
|
-
if (entry) {
|
|
219
|
-
const completed = { ...entry, id: nextId++ };
|
|
220
|
-
entries.push(completed);
|
|
221
|
-
if (ev.type === "tool_call_end" && completed.kind === "tool") {
|
|
222
|
-
completedTools.set(ev.id, completed);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
for (const [, tu] of pendingTools) {
|
|
227
|
-
entries.push({
|
|
228
|
-
id: nextId++,
|
|
229
|
-
kind: "tool",
|
|
230
|
-
name: tu.name,
|
|
231
|
-
durationMs: 0,
|
|
232
|
-
ok: false,
|
|
233
|
-
input: tu.input
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
return entries;
|
|
237
|
-
}
|
|
238
219
|
function eventToEntry(ev, pendingTools, completedTools) {
|
|
220
|
+
if (MARKER_EVENT_TYPES.has(ev.type)) {
|
|
221
|
+
const marker = sessionEventToMarker(ev);
|
|
222
|
+
return marker ? markerToEntry(marker) : null;
|
|
223
|
+
}
|
|
239
224
|
switch (ev.type) {
|
|
240
225
|
case "user_input": {
|
|
241
226
|
const text = typeof ev.content === "string" ? ev.content : Array.isArray(ev.content) ? ev.content.filter((b) => b.type === "text").map((b) => b.text).join("") : "";
|
|
@@ -295,92 +280,6 @@ function eventToEntry(ev, pendingTools, completedTools) {
|
|
|
295
280
|
outputLines: ev.outputLines
|
|
296
281
|
};
|
|
297
282
|
}
|
|
298
|
-
case "compaction": {
|
|
299
|
-
const before = (ev.before / 1e3).toFixed(0);
|
|
300
|
-
const after = (ev.after / 1e3).toFixed(0);
|
|
301
|
-
const level = ev.level ? ` (${ev.level})` : "";
|
|
302
|
-
const reductions = ev.reductions && ev.reductions.length > 0 ? ` [${ev.reductions.map((r) => `${r.phase}: \u2212${r.saved}`).join(", ")}]` : "";
|
|
303
|
-
return {
|
|
304
|
-
kind: "info",
|
|
305
|
-
text: `\u27F2 context compacted${level}: ${before}K \u2192 ${after}K tokens${reductions}`
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
case "error": {
|
|
309
|
-
return {
|
|
310
|
-
kind: "error",
|
|
311
|
-
text: ev.phase ? `[${ev.phase}] ${ev.message}` : ev.message
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
case "provider_retry": {
|
|
315
|
-
const secs = (ev.delayMs / 1e3).toFixed(ev.delayMs >= 1e3 ? 1 : 2);
|
|
316
|
-
return {
|
|
317
|
-
kind: "warn",
|
|
318
|
-
text: ev.status ? `\u27F3 retry ${ev.attempt} (HTTP ${ev.status}) after ${secs}s \u2014 ${ev.description}` : `\u27F3 retry ${ev.attempt} after ${secs}s \u2014 ${ev.description}`
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
case "provider_error": {
|
|
322
|
-
return {
|
|
323
|
-
kind: "error",
|
|
324
|
-
text: ev.status ? `provider error (HTTP ${ev.status}, ${ev.retryable ? "retryable" : "fatal"}): ${ev.description}` : `provider error (${ev.retryable ? "retryable" : "fatal"}): ${ev.description}`
|
|
325
|
-
};
|
|
326
|
-
}
|
|
327
|
-
case "checkpoint": {
|
|
328
|
-
return {
|
|
329
|
-
kind: "info",
|
|
330
|
-
text: `\u2713 checkpoint #${ev.promptIndex}: "${ev.promptPreview.slice(0, 60)}"`
|
|
331
|
-
};
|
|
332
|
-
}
|
|
333
|
-
case "agent_spawned": {
|
|
334
|
-
return {
|
|
335
|
-
kind: "subagent",
|
|
336
|
-
agentLabel: ev.agentId.slice(0, 8),
|
|
337
|
-
agentColor: "magenta",
|
|
338
|
-
icon: "\u26A1",
|
|
339
|
-
text: `spawned as ${ev.role}`
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
case "agent_stopped": {
|
|
343
|
-
return {
|
|
344
|
-
kind: "subagent",
|
|
345
|
-
agentLabel: ev.agentId.slice(0, 8),
|
|
346
|
-
agentColor: "gray",
|
|
347
|
-
icon: "\u2298",
|
|
348
|
-
text: "stopped"
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
case "agent_error": {
|
|
352
|
-
return {
|
|
353
|
-
kind: "subagent",
|
|
354
|
-
agentLabel: ev.agentId.slice(0, 8),
|
|
355
|
-
agentColor: "red",
|
|
356
|
-
icon: "\u2717",
|
|
357
|
-
text: `error: ${ev.error.slice(0, 80)}`
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
case "mode_changed": {
|
|
361
|
-
return {
|
|
362
|
-
kind: "info",
|
|
363
|
-
text: `mode: ${ev.from} \u2192 ${ev.to}`
|
|
364
|
-
};
|
|
365
|
-
}
|
|
366
|
-
case "skill_activated": {
|
|
367
|
-
return {
|
|
368
|
-
kind: "info",
|
|
369
|
-
text: `skill activated: ${ev.skillName}`
|
|
370
|
-
};
|
|
371
|
-
}
|
|
372
|
-
case "skill_deactivated": {
|
|
373
|
-
return {
|
|
374
|
-
kind: "info",
|
|
375
|
-
text: `skill deactivated: ${ev.skillName}`
|
|
376
|
-
};
|
|
377
|
-
}
|
|
378
|
-
case "message_truncated": {
|
|
379
|
-
return {
|
|
380
|
-
kind: "warn",
|
|
381
|
-
text: ev.after < ev.before ? `message truncated: ${ev.before} \u2192 ${ev.after} tokens` : `message truncated at ${ev.after} tokens`
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
283
|
// Skipped — internal markers not relevant for display
|
|
385
284
|
case "session_start":
|
|
386
285
|
case "session_resumed":
|
|
@@ -677,8 +576,16 @@ function buildRestoredEntries(messages, restoredToolCalls, restoredEvents) {
|
|
|
677
576
|
}
|
|
678
577
|
function buildRestoredCheckpoints(restoredEvents) {
|
|
679
578
|
if (!restoredEvents || restoredEvents.length === 0) return [];
|
|
579
|
+
const fileCountByIndex = /* @__PURE__ */ new Map();
|
|
680
580
|
const byIndex = /* @__PURE__ */ new Map();
|
|
681
581
|
for (const ev of restoredEvents) {
|
|
582
|
+
if (ev.type === "file_snapshot") {
|
|
583
|
+
fileCountByIndex.set(
|
|
584
|
+
ev.promptIndex,
|
|
585
|
+
(fileCountByIndex.get(ev.promptIndex) ?? 0) + ev.files.length
|
|
586
|
+
);
|
|
587
|
+
continue;
|
|
588
|
+
}
|
|
682
589
|
if (ev.type !== "checkpoint") continue;
|
|
683
590
|
byIndex.set(ev.promptIndex, {
|
|
684
591
|
promptIndex: ev.promptIndex,
|
|
@@ -687,6 +594,9 @@ function buildRestoredCheckpoints(restoredEvents) {
|
|
|
687
594
|
fileCount: 0
|
|
688
595
|
});
|
|
689
596
|
}
|
|
597
|
+
for (const [promptIndex, checkpoint] of byIndex) {
|
|
598
|
+
checkpoint.fileCount = fileCountByIndex.get(promptIndex) ?? 0;
|
|
599
|
+
}
|
|
690
600
|
return retainCheckpoints([...byIndex.values()].sort((a, b) => a.promptIndex - b.promptIndex));
|
|
691
601
|
}
|
|
692
602
|
function createInitialState(options) {
|
|
@@ -2826,7 +2736,12 @@ function reduceConversation(state, action) {
|
|
|
2826
2736
|
return { ...state, streamingText: "" };
|
|
2827
2737
|
case "status":
|
|
2828
2738
|
if (action.status === "idle") {
|
|
2829
|
-
return {
|
|
2739
|
+
return {
|
|
2740
|
+
...state,
|
|
2741
|
+
status: "idle",
|
|
2742
|
+
debugStreamStats: null,
|
|
2743
|
+
...state.runningTools.size > 0 ? { runningTools: /* @__PURE__ */ new Map() } : {}
|
|
2744
|
+
};
|
|
2830
2745
|
}
|
|
2831
2746
|
return { ...state, status: action.status };
|
|
2832
2747
|
case "interrupt":
|
|
@@ -12923,11 +12838,27 @@ function useDirectorFleetBridge({
|
|
|
12923
12838
|
type: "addEntry",
|
|
12924
12839
|
entry: {
|
|
12925
12840
|
kind: "error",
|
|
12926
|
-
text: `subagent
|
|
12841
|
+
text: `subagent model failed${payload?.description ? `: ${payload.description}` : ""}`
|
|
12927
12842
|
}
|
|
12928
12843
|
});
|
|
12929
12844
|
break;
|
|
12930
12845
|
}
|
|
12846
|
+
case "provider.fallback": {
|
|
12847
|
+
const payload = event.payload;
|
|
12848
|
+
const from = payload?.from;
|
|
12849
|
+
const to = payload?.to;
|
|
12850
|
+
if (to?.providerId && to.model) {
|
|
12851
|
+
const fromLabel = from?.providerId && from.model ? `${from.providerId}/${from.model} ` : "";
|
|
12852
|
+
enqueue({
|
|
12853
|
+
type: "addEntry",
|
|
12854
|
+
entry: {
|
|
12855
|
+
kind: "info",
|
|
12856
|
+
text: `subagent fallback: ${fromLabel}\u2192 ${to.providerId}/${to.model}`
|
|
12857
|
+
}
|
|
12858
|
+
});
|
|
12859
|
+
}
|
|
12860
|
+
break;
|
|
12861
|
+
}
|
|
12931
12862
|
case "tool.started": {
|
|
12932
12863
|
const payload = event.payload;
|
|
12933
12864
|
if (payload?.name) {
|
|
@@ -14138,7 +14069,10 @@ function useMailboxViewModel(events) {
|
|
|
14138
14069
|
|
|
14139
14070
|
// src/hooks/use-next-steps-auto-submit.ts
|
|
14140
14071
|
import { resolveContinuation } from "@wrongstack/core/agent";
|
|
14141
|
-
import {
|
|
14072
|
+
import {
|
|
14073
|
+
createAutoProceedLoopGuard,
|
|
14074
|
+
GROUNDED_NO_PROGRESS_STEER
|
|
14075
|
+
} from "@wrongstack/tools/auto-proceed-loop-guard";
|
|
14142
14076
|
import {
|
|
14143
14077
|
useCallback as useCallback8,
|
|
14144
14078
|
useEffect as useEffect19,
|
|
@@ -14182,6 +14116,7 @@ function useNextStepsAutoSubmit({
|
|
|
14182
14116
|
const [nextStepsAutoSubmitCountdown, setNextStepsAutoSubmitCountdown] = useState9(null);
|
|
14183
14117
|
const [nextStepsAutoSubmitLabel, setNextStepsAutoSubmitLabel] = useState9(null);
|
|
14184
14118
|
const nextStepsAutoSubmitSuggestionRef = useRef12(null);
|
|
14119
|
+
const nextStepsAutoSubmitSourceRef = useRef12(null);
|
|
14185
14120
|
const nextStepsAutoSubmitTimerRef = useRef12(void 0);
|
|
14186
14121
|
const autoSubmitStreakRef = useRef12(0);
|
|
14187
14122
|
const autoSubmitCapWarnedRef = useRef12(false);
|
|
@@ -14200,6 +14135,7 @@ function useNextStepsAutoSubmit({
|
|
|
14200
14135
|
setNextStepsAutoSubmitCountdown(null);
|
|
14201
14136
|
setNextStepsAutoSubmitLabel(null);
|
|
14202
14137
|
nextStepsAutoSubmitSuggestionRef.current = null;
|
|
14138
|
+
nextStepsAutoSubmitSourceRef.current = null;
|
|
14203
14139
|
return;
|
|
14204
14140
|
}
|
|
14205
14141
|
if (state.enhance != null || state.enhanceBusy || state.refineFailure != null || state.continueConfirm != null || state.clearConfirm != null || state.slashConfirm != null || state.escConfirm != null || state.sendModePicker != null || state.confirmQueue.length > 0 || state.shellCommandWarning != null || state.brainPrompt != null) {
|
|
@@ -14239,6 +14175,7 @@ function useNextStepsAutoSubmit({
|
|
|
14239
14175
|
}
|
|
14240
14176
|
const delay = cfg?.delayMs ?? 45e3;
|
|
14241
14177
|
nextStepsAutoSubmitSuggestionRef.current = candidate.prompt;
|
|
14178
|
+
nextStepsAutoSubmitSourceRef.current = candidate.source;
|
|
14242
14179
|
const start = Date.now();
|
|
14243
14180
|
setNextStepsAutoSubmitCountdown(Math.ceil(delay / 1e3));
|
|
14244
14181
|
setNextStepsAutoSubmitLabel(candidate.label);
|
|
@@ -14251,12 +14188,15 @@ function useNextStepsAutoSubmit({
|
|
|
14251
14188
|
setNextStepsAutoSubmitLabel(null);
|
|
14252
14189
|
if ((getAutonomy?.() ?? autonomyLive) !== "auto") {
|
|
14253
14190
|
nextStepsAutoSubmitSuggestionRef.current = null;
|
|
14191
|
+
nextStepsAutoSubmitSourceRef.current = null;
|
|
14254
14192
|
return;
|
|
14255
14193
|
}
|
|
14256
14194
|
const suggestion = nextStepsAutoSubmitSuggestionRef.current;
|
|
14195
|
+
const source = nextStepsAutoSubmitSourceRef.current;
|
|
14257
14196
|
nextStepsAutoSubmitSuggestionRef.current = null;
|
|
14197
|
+
nextStepsAutoSubmitSourceRef.current = null;
|
|
14258
14198
|
if (suggestion) {
|
|
14259
|
-
const repetition = autoSubmitLoopGuardRef.current.record(suggestion);
|
|
14199
|
+
const repetition = source === "todo" ? autoSubmitLoopGuardRef.current.recordGrounded(suggestion) : autoSubmitLoopGuardRef.current.record(suggestion);
|
|
14260
14200
|
if (repetition.shouldHalt) {
|
|
14261
14201
|
setSuggestions?.([]);
|
|
14262
14202
|
const truncatedForMessage = suggestion.length > 100 ? `${suggestion.slice(0, 97)}\u2026` : suggestion;
|
|
@@ -14269,8 +14209,12 @@ function useNextStepsAutoSubmit({
|
|
|
14269
14209
|
});
|
|
14270
14210
|
} else {
|
|
14271
14211
|
autoSubmitStreakRef.current += 1;
|
|
14212
|
+
const steered = "action" in repetition && repetition.action === "steer";
|
|
14213
|
+
const promptToFeed = steered ? `${suggestion}
|
|
14214
|
+
|
|
14215
|
+
${GROUNDED_NO_PROGRESS_STEER}` : suggestion;
|
|
14272
14216
|
void (async () => {
|
|
14273
|
-
const trimmed =
|
|
14217
|
+
const trimmed = promptToFeed.trim();
|
|
14274
14218
|
if (!trimmed) {
|
|
14275
14219
|
clearDraft();
|
|
14276
14220
|
return;
|
|
@@ -14325,6 +14269,7 @@ function useNextStepsAutoSubmit({
|
|
|
14325
14269
|
setNextStepsAutoSubmitCountdown(null);
|
|
14326
14270
|
setNextStepsAutoSubmitLabel(null);
|
|
14327
14271
|
nextStepsAutoSubmitSuggestionRef.current = null;
|
|
14272
|
+
nextStepsAutoSubmitSourceRef.current = null;
|
|
14328
14273
|
}, []);
|
|
14329
14274
|
return {
|
|
14330
14275
|
nextStepsAutoSubmitCountdown,
|
|
@@ -15293,7 +15238,7 @@ function usePromptPicker({
|
|
|
15293
15238
|
}
|
|
15294
15239
|
|
|
15295
15240
|
// src/hooks/use-provider-event-bridge.ts
|
|
15296
|
-
import {
|
|
15241
|
+
import { tuiStreamFlushMs } from "@wrongstack/core/utils";
|
|
15297
15242
|
import {
|
|
15298
15243
|
useEffect as useEffect21
|
|
15299
15244
|
} from "react";
|
|
@@ -15601,15 +15546,9 @@ function useProviderEventBridge({
|
|
|
15601
15546
|
}
|
|
15602
15547
|
});
|
|
15603
15548
|
}
|
|
15604
|
-
dispatch({ type: "toolEnded", name: e.name });
|
|
15549
|
+
dispatch({ type: "toolEnded", ...e.id !== void 0 ? { id: e.id } : {}, name: e.name });
|
|
15605
15550
|
dispatch({ type: "toolStreamClear", name: e.name });
|
|
15606
15551
|
dispatch({ type: "leaderToolEnd", name: e.name, ok: e.ok, durationMs: e.durationMs });
|
|
15607
|
-
if (e.ok && e.name === "todo") {
|
|
15608
|
-
dispatch({
|
|
15609
|
-
type: "addEntry",
|
|
15610
|
-
entry: { kind: "info", text: formatTodosList(agent.ctx.todos) }
|
|
15611
|
-
});
|
|
15612
|
-
}
|
|
15613
15552
|
});
|
|
15614
15553
|
const offRetry = events.on("provider.retry", (e) => {
|
|
15615
15554
|
const secs = (e.delayMs / 1e3).toFixed(e.delayMs >= 1e3 ? 1 : 2);
|
|
@@ -15793,7 +15732,7 @@ function useProviderEventBridge({
|
|
|
15793
15732
|
offMemoryLifecycle();
|
|
15794
15733
|
if (flushTimerRef.current) clearTimeout(flushTimerRef.current);
|
|
15795
15734
|
};
|
|
15796
|
-
}, [events, agent.ctx.
|
|
15735
|
+
}, [events, agent.ctx.session.id]);
|
|
15797
15736
|
}
|
|
15798
15737
|
|
|
15799
15738
|
// src/hooks/use-queue-manager.ts
|
|
@@ -16698,11 +16637,12 @@ function useStreamChipExpiration({
|
|
|
16698
16637
|
|
|
16699
16638
|
// src/hooks/use-terminal-render-lifecycle.ts
|
|
16700
16639
|
import { writeOut } from "@wrongstack/core/utils";
|
|
16701
|
-
import React4, { useCallback as useCallback12, useEffect as useEffect30, useRef as useRef19 } from "react";
|
|
16640
|
+
import React4, { useCallback as useCallback12, useEffect as useEffect30, useInsertionEffect, useRef as useRef19 } from "react";
|
|
16702
16641
|
function useTerminalRenderLifecycle(state) {
|
|
16703
16642
|
const prevAnyOverlayOpen = useRef19(false);
|
|
16704
16643
|
const prevEntriesCount = useRef19(0);
|
|
16705
16644
|
const prevToolStreamLen = useRef19(0);
|
|
16645
|
+
const hasMounted = useRef19(false);
|
|
16706
16646
|
const eraseLiveRegion = useCallback12(() => {
|
|
16707
16647
|
try {
|
|
16708
16648
|
writeOut("\x1B[J");
|
|
@@ -16710,6 +16650,17 @@ function useTerminalRenderLifecycle(state) {
|
|
|
16710
16650
|
}
|
|
16711
16651
|
}, []);
|
|
16712
16652
|
React4.useLayoutEffect(() => {
|
|
16653
|
+
try {
|
|
16654
|
+
writeOut("\x1B8");
|
|
16655
|
+
} catch {
|
|
16656
|
+
}
|
|
16657
|
+
if (!hasMounted.current) {
|
|
16658
|
+
hasMounted.current = true;
|
|
16659
|
+
prevAnyOverlayOpen.current = state.picker.open || state.slashPicker.open || state.modelPicker.open || state.autonomyPicker.open || state.designPicker.open || state.resumePicker.open || state.settingsPicker.open || state.enhanceBusy || state.enhance != null || state.refineFailure != null || state.continueConfirm != null || state.clearConfirm != null || state.slashConfirm != null || state.coordinator.monitorOpen || state.escConfirm != null || state.sendModePicker != null || state.confirmQueue.length > 0 || state.shellCommandWarning != null || state.brainPrompt != null;
|
|
16660
|
+
prevEntriesCount.current = state.entries.length;
|
|
16661
|
+
prevToolStreamLen.current = state.toolStream?.text.length ?? 0;
|
|
16662
|
+
return;
|
|
16663
|
+
}
|
|
16713
16664
|
const anyOpenNow = state.picker.open || state.slashPicker.open || state.modelPicker.open || state.autonomyPicker.open || state.designPicker.open || state.resumePicker.open || state.settingsPicker.open || state.enhanceBusy || state.enhance != null || state.refineFailure != null || state.continueConfirm != null || state.clearConfirm != null || state.slashConfirm != null || state.coordinator.monitorOpen || state.escConfirm != null || state.sendModePicker != null || state.confirmQueue.length > 0 || state.shellCommandWarning != null || state.brainPrompt != null;
|
|
16714
16665
|
const overlayClosed = prevAnyOverlayOpen.current && !anyOpenNow;
|
|
16715
16666
|
const newEntryCommitted = state.entries.length > prevEntriesCount.current;
|
|
@@ -16753,7 +16704,12 @@ function useTerminalRenderLifecycle(state) {
|
|
|
16753
16704
|
process.stdout.off("resize", handleResize);
|
|
16754
16705
|
};
|
|
16755
16706
|
}, [eraseLiveRegion]);
|
|
16756
|
-
|
|
16707
|
+
useInsertionEffect(() => {
|
|
16708
|
+
try {
|
|
16709
|
+
writeOut("\x1B7");
|
|
16710
|
+
} catch {
|
|
16711
|
+
}
|
|
16712
|
+
if (!hasMounted.current) return;
|
|
16757
16713
|
if (state.enhanceBusy || state.enhance != null || state.refineFailure != null || state.continueConfirm != null)
|
|
16758
16714
|
eraseLiveRegion();
|
|
16759
16715
|
});
|
|
@@ -17360,6 +17316,7 @@ function useSubagentEvents(events, dispatch, setActiveMaxContext, getSessionId,
|
|
|
17360
17316
|
const offRemoved = events.on("subagent.removed", (e) => {
|
|
17361
17317
|
if (!isCurrentSession(e.sessionId)) return;
|
|
17362
17318
|
labelsRef.current.delete(e.subagentId);
|
|
17319
|
+
ctxDispatchRef.current.delete(e.subagentId);
|
|
17363
17320
|
gate.forget(e.subagentId);
|
|
17364
17321
|
dispatch({ type: "fleetRemove", id: e.subagentId });
|
|
17365
17322
|
});
|
|
@@ -25792,7 +25749,7 @@ function formatToolVisualOutput(toolName, output, ok, input) {
|
|
|
25792
25749
|
if (toolName === "outdated") return visualOutdated(text);
|
|
25793
25750
|
if (toolName === "audit") return visualAudit(text);
|
|
25794
25751
|
if (toolName === "scaffold") return visualScaffold(text);
|
|
25795
|
-
if (toolName === "todo") return visualTodo(text);
|
|
25752
|
+
if (toolName === "todo") return visualTodo(text, input);
|
|
25796
25753
|
if (toolName === "task" || toolName === "plan") return visualWorkBoard(toolName, text, ok);
|
|
25797
25754
|
if (toolName === "remember" || toolName === "forget" || toolName === "search_memory" || toolName === "find_related_memories") {
|
|
25798
25755
|
return visualMemory(toolName, text, ok);
|
|
@@ -25811,7 +25768,6 @@ function formatToolVisualOutput(toolName, output, ok, input) {
|
|
|
25811
25768
|
}
|
|
25812
25769
|
if (toolName === "set_working_dir") return visualWorkingDir(text, ok);
|
|
25813
25770
|
if (toolName === "mode") return visualMode(text, ok);
|
|
25814
|
-
void input;
|
|
25815
25771
|
return void 0;
|
|
25816
25772
|
}
|
|
25817
25773
|
function visualLsp(toolName, text, ok) {
|
|
@@ -26282,7 +26238,28 @@ function visualScaffold(text) {
|
|
|
26282
26238
|
rows.push({ kind: "warn", marker: "! ", text: `${skipped.length} skipped` });
|
|
26283
26239
|
return rows.length > 0 ? rows : void 0;
|
|
26284
26240
|
}
|
|
26285
|
-
|
|
26241
|
+
var TODO_VISUAL_MAX_LINES = 10;
|
|
26242
|
+
function visualTodo(text, input) {
|
|
26243
|
+
const inputObj = input && typeof input === "object" && !Array.isArray(input) ? input : void 0;
|
|
26244
|
+
const todos = Array.isArray(inputObj?.["todos"]) ? inputObj["todos"] : void 0;
|
|
26245
|
+
const items = (todos ?? []).filter(
|
|
26246
|
+
(t) => Boolean(t) && typeof t === "object" && !Array.isArray(t)
|
|
26247
|
+
);
|
|
26248
|
+
if (items.length > 0) {
|
|
26249
|
+
const rows = items.slice(0, TODO_VISUAL_MAX_LINES).map((o) => {
|
|
26250
|
+
const content = stringOf(o["content"]) ?? stringOf(o["id"]) ?? "todo";
|
|
26251
|
+
const status = stringOf(o["status"]);
|
|
26252
|
+
if (status === "completed") return { kind: "ok", marker: "[x] ", text: content };
|
|
26253
|
+
if (status === "in_progress") {
|
|
26254
|
+
return { kind: "warn", marker: "[~] ", text: stringOf(o["activeForm"]) ?? content };
|
|
26255
|
+
}
|
|
26256
|
+
return { kind: "meta", marker: "[ ] ", text: content };
|
|
26257
|
+
});
|
|
26258
|
+
if (items.length > rows.length) {
|
|
26259
|
+
rows.push({ kind: "meta", text: `\u2026 ${items.length - rows.length} more` });
|
|
26260
|
+
}
|
|
26261
|
+
return rows;
|
|
26262
|
+
}
|
|
26286
26263
|
const json = tryParseJson(text);
|
|
26287
26264
|
const fields = json && typeof json === "object" && !Array.isArray(json) ? recordToStringFields(json) : parseHeaderLine(text).fields;
|
|
26288
26265
|
const count = numberFromParsedField(fields, "count") ?? 0;
|
|
@@ -29493,8 +29470,43 @@ function planPinned(geometry, extraRows = 0) {
|
|
|
29493
29470
|
return { startIdx, endIdx: groupCount, mountTail: true };
|
|
29494
29471
|
}
|
|
29495
29472
|
|
|
29473
|
+
// src/components/entry-error-boundary.tsx
|
|
29474
|
+
import { Component } from "react";
|
|
29475
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
29476
|
+
var EntryErrorBoundary = class extends Component {
|
|
29477
|
+
state = { error: null };
|
|
29478
|
+
static getDerivedStateFromError(error) {
|
|
29479
|
+
return { error };
|
|
29480
|
+
}
|
|
29481
|
+
componentDidCatch(error) {
|
|
29482
|
+
console.error(
|
|
29483
|
+
JSON.stringify({
|
|
29484
|
+
level: "error",
|
|
29485
|
+
event: "entry_render_error",
|
|
29486
|
+
label: this.props.label ?? null,
|
|
29487
|
+
message: error.message,
|
|
29488
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
29489
|
+
})
|
|
29490
|
+
);
|
|
29491
|
+
}
|
|
29492
|
+
componentDidUpdate(prevProps) {
|
|
29493
|
+
if (this.state.error !== null && this.props.resetKey !== void 0 && this.props.resetKey !== prevProps.resetKey) {
|
|
29494
|
+
this.setState({ error: null });
|
|
29495
|
+
}
|
|
29496
|
+
}
|
|
29497
|
+
render() {
|
|
29498
|
+
const { error } = this.state;
|
|
29499
|
+
if (error) {
|
|
29500
|
+
const label = this.props.label ? ` (${this.props.label})` : "";
|
|
29501
|
+
const message = error.message || String(error);
|
|
29502
|
+
return /* @__PURE__ */ jsx60(Box, { children: /* @__PURE__ */ jsx60(Text, { color: theme.error, children: `\u26A0 render error${label}: ${message}` }) });
|
|
29503
|
+
}
|
|
29504
|
+
return this.props.children;
|
|
29505
|
+
}
|
|
29506
|
+
};
|
|
29507
|
+
|
|
29496
29508
|
// src/components/history/tool-group.tsx
|
|
29497
|
-
import { Fragment as Fragment21, jsx as
|
|
29509
|
+
import { Fragment as Fragment21, jsx as jsx61, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
29498
29510
|
var MAX_TOOL_GROUP_ENTRIES = 12;
|
|
29499
29511
|
var STRUCTURED_DIFF_TOOLS = /* @__PURE__ */ new Set(["edit", "write", "replace", "diff", "patch"]);
|
|
29500
29512
|
function renderGroupId(group) {
|
|
@@ -29608,15 +29620,15 @@ function ToolGroupHeader({
|
|
|
29608
29620
|
const metaBudget = meta ? Math.min(displayWidth(meta), Math.floor(tailBudget * 0.36)) : 0;
|
|
29609
29621
|
const railColor = allOk ? theme.borderSubtle : theme.error;
|
|
29610
29622
|
const countLabel = `\xD7${totalCount}`;
|
|
29611
|
-
return /* @__PURE__ */
|
|
29612
|
-
/* @__PURE__ */
|
|
29613
|
-
/* @__PURE__ */
|
|
29614
|
-
/* @__PURE__ */
|
|
29615
|
-
/* @__PURE__ */
|
|
29616
|
-
/* @__PURE__ */
|
|
29617
|
-
/* @__PURE__ */
|
|
29618
|
-
metaBudget >= 2 ? /* @__PURE__ */
|
|
29619
|
-
failCount > 0 ? /* @__PURE__ */
|
|
29623
|
+
return /* @__PURE__ */ jsx61(Box, { flexDirection: "column", marginY: 0, children: /* @__PURE__ */ jsxs59(Text, { children: [
|
|
29624
|
+
/* @__PURE__ */ jsx61(Text, { color: railColor, children: "\u256D\u2500 " }),
|
|
29625
|
+
/* @__PURE__ */ jsx61(Text, { color, children: glyph2 }),
|
|
29626
|
+
/* @__PURE__ */ jsx61(Text, { children: " " }),
|
|
29627
|
+
/* @__PURE__ */ jsx61(Text, { bold: true, color: theme.textPrimary, children: name }),
|
|
29628
|
+
/* @__PURE__ */ jsx61(Text, { children: " " }),
|
|
29629
|
+
/* @__PURE__ */ jsx61(Text, { bold: true, color: theme.textSecondary, children: countLabel }),
|
|
29630
|
+
metaBudget >= 2 ? /* @__PURE__ */ jsx61(Text, { color: theme.textMuted, children: ` \xB7 ${meta}` }) : null,
|
|
29631
|
+
failCount > 0 ? /* @__PURE__ */ jsx61(Text, { color: theme.error, children: ` \u2717${failCount}` }) : null
|
|
29620
29632
|
] }) });
|
|
29621
29633
|
}
|
|
29622
29634
|
function ToolGroup({
|
|
@@ -29627,7 +29639,7 @@ function ToolGroup({
|
|
|
29627
29639
|
const railColor = failCount === 0 ? theme.borderSubtle : theme.error;
|
|
29628
29640
|
const toolContentWidth = Math.max(20, termWidth - 2);
|
|
29629
29641
|
return /* @__PURE__ */ jsxs59(Box, { flexDirection: "column", marginY: 0, children: [
|
|
29630
|
-
/* @__PURE__ */
|
|
29642
|
+
/* @__PURE__ */ jsx61(
|
|
29631
29643
|
ToolGroupHeader,
|
|
29632
29644
|
{
|
|
29633
29645
|
name,
|
|
@@ -29637,7 +29649,7 @@ function ToolGroup({
|
|
|
29637
29649
|
termWidth
|
|
29638
29650
|
}
|
|
29639
29651
|
),
|
|
29640
|
-
/* @__PURE__ */
|
|
29652
|
+
/* @__PURE__ */ jsx61(
|
|
29641
29653
|
Box,
|
|
29642
29654
|
{
|
|
29643
29655
|
flexDirection: "column",
|
|
@@ -29649,7 +29661,7 @@ function ToolGroup({
|
|
|
29649
29661
|
paddingLeft: 1,
|
|
29650
29662
|
children: entries.map((entry, idx) => {
|
|
29651
29663
|
if (entry.kind !== "tool") return null;
|
|
29652
|
-
return /* @__PURE__ */
|
|
29664
|
+
return /* @__PURE__ */ jsx61(
|
|
29653
29665
|
ToolGroupItem,
|
|
29654
29666
|
{
|
|
29655
29667
|
entry,
|
|
@@ -29661,7 +29673,7 @@ function ToolGroup({
|
|
|
29661
29673
|
})
|
|
29662
29674
|
}
|
|
29663
29675
|
),
|
|
29664
|
-
/* @__PURE__ */
|
|
29676
|
+
/* @__PURE__ */ jsx61(Text, { color: railColor, children: `\u2570${"\u2500".repeat(Math.max(2, termWidth - 1))}` })
|
|
29665
29677
|
] });
|
|
29666
29678
|
}
|
|
29667
29679
|
function ToolGroupItem({
|
|
@@ -29685,13 +29697,13 @@ function ToolGroupItem({
|
|
|
29685
29697
|
const rawArg = formatToolArgs(entry.name, entry.input);
|
|
29686
29698
|
const argPreview = displayWidth(rawArg) > argBudget ? `\u2026${rawArg.slice(-(argBudget - 1))}` : rawArg;
|
|
29687
29699
|
return /* @__PURE__ */ jsxs59(Text, { children: [
|
|
29688
|
-
/* @__PURE__ */
|
|
29689
|
-
/* @__PURE__ */
|
|
29700
|
+
/* @__PURE__ */ jsx61(Text, { bold: true, color: statusColor2, children: statusMark }),
|
|
29701
|
+
/* @__PURE__ */ jsx61(Text, { dimColor: true, children: ` #${index}` }),
|
|
29690
29702
|
argPreview ? /* @__PURE__ */ jsxs59(Fragment21, { children: [
|
|
29691
|
-
/* @__PURE__ */
|
|
29692
|
-
/* @__PURE__ */
|
|
29703
|
+
/* @__PURE__ */ jsx61(Text, { children: " " }),
|
|
29704
|
+
/* @__PURE__ */ jsx61(Text, { color: theme.textSecondary, children: argPreview })
|
|
29693
29705
|
] }) : null,
|
|
29694
|
-
metaStr ? /* @__PURE__ */
|
|
29706
|
+
metaStr ? /* @__PURE__ */ jsx61(Text, { dimColor: true, children: ` \xB7 ${metaStr}` }) : null
|
|
29695
29707
|
] });
|
|
29696
29708
|
}
|
|
29697
29709
|
|
|
@@ -29703,7 +29715,7 @@ import { hasOpenTodos } from "@wrongstack/core/utils";
|
|
|
29703
29715
|
import React8, { useEffect as useEffect53, useMemo as useMemo11 } from "react";
|
|
29704
29716
|
|
|
29705
29717
|
// src/components/history/banner.tsx
|
|
29706
|
-
import { Fragment as Fragment22, jsx as
|
|
29718
|
+
import { Fragment as Fragment22, jsx as jsx62, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
29707
29719
|
var STACK_ORANGE = "#FD9F02";
|
|
29708
29720
|
var SIGNAL_PINK = "#FE2E5F";
|
|
29709
29721
|
var BORDER = "#3B3C36";
|
|
@@ -29742,7 +29754,7 @@ function BrandMark({ pinkRow = 1 }) {
|
|
|
29742
29754
|
return null;
|
|
29743
29755
|
})
|
|
29744
29756
|
);
|
|
29745
|
-
return /* @__PURE__ */
|
|
29757
|
+
return /* @__PURE__ */ jsx62(Box, { flexDirection: "column", alignItems: "center", children: rows.map((row, rowIndex) => /* @__PURE__ */ jsx62(Text, { bold: true, children: row.map((color, columnIndex) => /* @__PURE__ */ jsxs60(Text, { color: color ?? void 0, children: [
|
|
29746
29758
|
color ? "\u2588\u2588" : " ",
|
|
29747
29759
|
columnIndex < row.length - 1 ? " " : ""
|
|
29748
29760
|
] }, columnIndex)) }, rowIndex)) });
|
|
@@ -29792,12 +29804,12 @@ function bannerGradientColor(position, length) {
|
|
|
29792
29804
|
return mixHex(STACK_ORANGE, SIGNAL_PINK, progress);
|
|
29793
29805
|
}
|
|
29794
29806
|
function GradientText({ text }) {
|
|
29795
|
-
return /* @__PURE__ */
|
|
29796
|
-
(character, index) => character === " " ? " " : /* @__PURE__ */
|
|
29807
|
+
return /* @__PURE__ */ jsx62(Text, { bold: true, children: [...text].map(
|
|
29808
|
+
(character, index) => character === " " ? " " : /* @__PURE__ */ jsx62(Text, { color: bannerGradientColor(index, text.length), children: character }, index)
|
|
29797
29809
|
) });
|
|
29798
29810
|
}
|
|
29799
29811
|
function PixelWordmark() {
|
|
29800
|
-
return /* @__PURE__ */
|
|
29812
|
+
return /* @__PURE__ */ jsx62(Box, { flexDirection: "column", alignItems: "center", children: WORDMARK_LINES.map((line, row) => /* @__PURE__ */ jsx62(GradientText, { text: line }, row)) });
|
|
29801
29813
|
}
|
|
29802
29814
|
function trunc(value, width) {
|
|
29803
29815
|
if (width <= 0 || !value) return "";
|
|
@@ -29816,9 +29828,9 @@ function InfoRow({
|
|
|
29816
29828
|
const valueWidth = Math.max(1, contentWidth - labelWidth - 3);
|
|
29817
29829
|
const color = accent ? STACK_ORANGE : MUTED;
|
|
29818
29830
|
return /* @__PURE__ */ jsxs60(Text, { children: [
|
|
29819
|
-
/* @__PURE__ */
|
|
29820
|
-
/* @__PURE__ */
|
|
29821
|
-
/* @__PURE__ */
|
|
29831
|
+
/* @__PURE__ */ jsx62(Text, { color, children: icon }),
|
|
29832
|
+
/* @__PURE__ */ jsx62(Text, { color, bold: true, children: ` ${trunc(label, labelWidth).padEnd(labelWidth)} ` }),
|
|
29833
|
+
/* @__PURE__ */ jsx62(Text, { color: accent ? TEXT : MUTED, children: trunc(value, valueWidth) })
|
|
29822
29834
|
] });
|
|
29823
29835
|
}
|
|
29824
29836
|
function ProfileRow({
|
|
@@ -29833,7 +29845,7 @@ function ProfileRow({
|
|
|
29833
29845
|
const icon = "\u2699";
|
|
29834
29846
|
const label = "profile";
|
|
29835
29847
|
if (!profileConfigPath) {
|
|
29836
|
-
return /* @__PURE__ */
|
|
29848
|
+
return /* @__PURE__ */ jsx62(
|
|
29837
29849
|
InfoRow,
|
|
29838
29850
|
{
|
|
29839
29851
|
icon,
|
|
@@ -29851,25 +29863,25 @@ function ProfileRow({
|
|
|
29851
29863
|
const profileSegment = segmentMatch?.[1] ?? "";
|
|
29852
29864
|
const segIdx = profileSegment ? displayPath.lastIndexOf(profileSegment) : -1;
|
|
29853
29865
|
return /* @__PURE__ */ jsxs60(Text, { children: [
|
|
29854
|
-
/* @__PURE__ */
|
|
29855
|
-
/* @__PURE__ */
|
|
29866
|
+
/* @__PURE__ */ jsx62(Text, { color: STACK_ORANGE, children: icon }),
|
|
29867
|
+
/* @__PURE__ */ jsx62(Text, { color: STACK_ORANGE, bold: true, children: ` ${trunc(label, labelWidth).padEnd(labelWidth)} ` }),
|
|
29856
29868
|
segIdx >= 0 && profileSegment ? /* @__PURE__ */ jsxs60(Fragment22, { children: [
|
|
29857
|
-
/* @__PURE__ */
|
|
29858
|
-
/* @__PURE__ */
|
|
29859
|
-
/* @__PURE__ */
|
|
29860
|
-
] }) : /* @__PURE__ */
|
|
29869
|
+
/* @__PURE__ */ jsx62(Text, { color: MUTED, children: displayPath.slice(0, segIdx) }),
|
|
29870
|
+
/* @__PURE__ */ jsx62(Text, { color: STACK_ORANGE, bold: true, children: profileSegment }),
|
|
29871
|
+
/* @__PURE__ */ jsx62(Text, { color: MUTED, children: displayPath.slice(segIdx + profileSegment.length) })
|
|
29872
|
+
] }) : /* @__PURE__ */ jsx62(Text, { color: MUTED, children: displayPath })
|
|
29861
29873
|
] });
|
|
29862
29874
|
}
|
|
29863
29875
|
var OSC8_WRONGSTACK = "\x1B]8;;https://wrongstack.com\x1B\\wrongstack.com\x1B]8;;\x1B\\";
|
|
29864
29876
|
var OSC8_GITHUB = "\x1B]8;;https://github.com/wrongstack/wrongstack\x1B\\github\x1B]8;;\x1B\\";
|
|
29865
29877
|
function Footer({ contentWidth, compact }) {
|
|
29866
|
-
return /* @__PURE__ */
|
|
29867
|
-
/* @__PURE__ */
|
|
29868
|
-
/* @__PURE__ */
|
|
29878
|
+
return /* @__PURE__ */ jsx62(Box, { flexDirection: "column", alignItems: "center", marginTop: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs60(Text, { children: [
|
|
29879
|
+
/* @__PURE__ */ jsx62(Text, { color: SIGNAL_PINK, children: "\u25C6 " }),
|
|
29880
|
+
/* @__PURE__ */ jsx62(Text, { dimColor: true, children: OSC8_WRONGSTACK }),
|
|
29869
29881
|
!compact || contentWidth >= 35 ? /* @__PURE__ */ jsxs60(Fragment22, { children: [
|
|
29870
|
-
/* @__PURE__ */
|
|
29871
|
-
/* @__PURE__ */
|
|
29872
|
-
/* @__PURE__ */
|
|
29882
|
+
/* @__PURE__ */ jsx62(Text, { dimColor: true, children: " \xB7 " }),
|
|
29883
|
+
/* @__PURE__ */ jsx62(Text, { color: STACK_ORANGE, children: "\u2605 " }),
|
|
29884
|
+
/* @__PURE__ */ jsx62(Text, { dimColor: true, children: OSC8_GITHUB })
|
|
29873
29885
|
] }) : null
|
|
29874
29886
|
] }) });
|
|
29875
29887
|
}
|
|
@@ -29888,8 +29900,8 @@ function AutonomyAgentsSection({
|
|
|
29888
29900
|
const lookup = new Map(agents.map((a) => [a.name, a]));
|
|
29889
29901
|
const maxLabelWidth = Math.max(1, contentWidth - 4);
|
|
29890
29902
|
return /* @__PURE__ */ jsxs60(Box, { flexDirection: "column", marginTop: 1, children: [
|
|
29891
|
-
/* @__PURE__ */
|
|
29892
|
-
/* @__PURE__ */
|
|
29903
|
+
/* @__PURE__ */ jsx62(Text, { color: BORDER, children: "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500" }),
|
|
29904
|
+
/* @__PURE__ */ jsx62(Box, { flexDirection: "row", flexWrap: "wrap", marginTop: 0, children: AGENT_ORDER.map((name) => {
|
|
29893
29905
|
const agent = lookup.get(name);
|
|
29894
29906
|
if (!agent) return null;
|
|
29895
29907
|
const online = agent.online;
|
|
@@ -29897,7 +29909,7 @@ function AutonomyAgentsSection({
|
|
|
29897
29909
|
const color = online ? STACK_ORANGE : MUTED;
|
|
29898
29910
|
const detail = agent.detail;
|
|
29899
29911
|
return /* @__PURE__ */ jsxs60(Box, { flexDirection: "row", marginRight: 2, children: [
|
|
29900
|
-
/* @__PURE__ */
|
|
29912
|
+
/* @__PURE__ */ jsx62(Text, { color, children: indicator }),
|
|
29901
29913
|
/* @__PURE__ */ jsxs60(Text, { color, children: [
|
|
29902
29914
|
" ",
|
|
29903
29915
|
trunc(compact ? name.slice(0, 4) : name, compact ? 4 : 8)
|
|
@@ -29933,7 +29945,7 @@ function Banner({
|
|
|
29933
29945
|
const version = trunc(entry.version, Math.max(1, contentWidth - 1));
|
|
29934
29946
|
const route = `${entry.provider} \u203A ${entry.model}`;
|
|
29935
29947
|
const pinkRow = 1;
|
|
29936
|
-
if (termHeight !== void 0 && termHeight <= 0) return
|
|
29948
|
+
if (termHeight !== void 0 && termHeight <= 0) return null;
|
|
29937
29949
|
if (condensed) {
|
|
29938
29950
|
const unbordered = (termHeight ?? 0) < 3;
|
|
29939
29951
|
const summary = truncateDisplay(
|
|
@@ -29941,9 +29953,9 @@ function Banner({
|
|
|
29941
29953
|
Math.max(1, panelWidth - (unbordered ? 0 : 4))
|
|
29942
29954
|
);
|
|
29943
29955
|
if (unbordered) {
|
|
29944
|
-
return /* @__PURE__ */
|
|
29956
|
+
return /* @__PURE__ */ jsx62(Text, { color: STACK_ORANGE, bold: true, children: summary });
|
|
29945
29957
|
}
|
|
29946
|
-
return /* @__PURE__ */
|
|
29958
|
+
return /* @__PURE__ */ jsx62(Box, { width: panelWidth, borderStyle: "round", borderColor: BORDER, paddingX: 1, children: /* @__PURE__ */ jsx62(Text, { color: STACK_ORANGE, bold: true, children: summary }) });
|
|
29947
29959
|
}
|
|
29948
29960
|
return /* @__PURE__ */ jsxs60(
|
|
29949
29961
|
Box,
|
|
@@ -29966,16 +29978,16 @@ function Banner({
|
|
|
29966
29978
|
")"
|
|
29967
29979
|
] }) : null
|
|
29968
29980
|
] }),
|
|
29969
|
-
/* @__PURE__ */
|
|
29981
|
+
/* @__PURE__ */ jsx62(Box, { justifyContent: "center", marginTop: compact ? 0 : 1, children: /* @__PURE__ */ jsx62(BrandMark, { pinkRow }) }),
|
|
29970
29982
|
compact ? /* @__PURE__ */ jsxs60(Fragment22, { children: [
|
|
29971
|
-
/* @__PURE__ */
|
|
29972
|
-
/* @__PURE__ */
|
|
29983
|
+
/* @__PURE__ */ jsx62(Box, { justifyContent: "center", marginTop: 1, children: /* @__PURE__ */ jsx62(GradientText, { text: "WrongStack" }) }),
|
|
29984
|
+
/* @__PURE__ */ jsx62(Box, { justifyContent: "center", children: /* @__PURE__ */ jsx62(Text, { color: MUTED, children: trunc("TERMINAL AI ENGINE", contentWidth) }) })
|
|
29973
29985
|
] }) : /* @__PURE__ */ jsxs60(Fragment22, { children: [
|
|
29974
|
-
/* @__PURE__ */
|
|
29975
|
-
/* @__PURE__ */
|
|
29986
|
+
/* @__PURE__ */ jsx62(Box, { justifyContent: "center", marginTop: 1, children: /* @__PURE__ */ jsx62(PixelWordmark, {}) }),
|
|
29987
|
+
/* @__PURE__ */ jsx62(Box, { justifyContent: "center", marginTop: 1, children: /* @__PURE__ */ jsx62(Text, { color: MUTED, italic: true, children: "BUILT ON THE WRONG STACK. SHIPPED ANYWAY." }) })
|
|
29976
29988
|
] }),
|
|
29977
29989
|
/* @__PURE__ */ jsxs60(Box, { flexDirection: "column", marginTop: 1, children: [
|
|
29978
|
-
/* @__PURE__ */
|
|
29990
|
+
/* @__PURE__ */ jsx62(
|
|
29979
29991
|
InfoRow,
|
|
29980
29992
|
{
|
|
29981
29993
|
icon: "\u25C6",
|
|
@@ -29986,7 +29998,7 @@ function Banner({
|
|
|
29986
29998
|
accent: true
|
|
29987
29999
|
}
|
|
29988
30000
|
),
|
|
29989
|
-
entry.family ? /* @__PURE__ */
|
|
30001
|
+
entry.family ? /* @__PURE__ */ jsx62(
|
|
29990
30002
|
InfoRow,
|
|
29991
30003
|
{
|
|
29992
30004
|
icon: "\u25C7",
|
|
@@ -29996,7 +30008,7 @@ function Banner({
|
|
|
29996
30008
|
compact
|
|
29997
30009
|
}
|
|
29998
30010
|
) : null,
|
|
29999
|
-
entry.keyTail ? /* @__PURE__ */
|
|
30011
|
+
entry.keyTail ? /* @__PURE__ */ jsx62(
|
|
30000
30012
|
InfoRow,
|
|
30001
30013
|
{
|
|
30002
30014
|
icon: "\u25C8",
|
|
@@ -30006,7 +30018,7 @@ function Banner({
|
|
|
30006
30018
|
compact
|
|
30007
30019
|
}
|
|
30008
30020
|
) : null,
|
|
30009
|
-
entry.sessionId ? /* @__PURE__ */
|
|
30021
|
+
entry.sessionId ? /* @__PURE__ */ jsx62(
|
|
30010
30022
|
InfoRow,
|
|
30011
30023
|
{
|
|
30012
30024
|
icon: "\u25C8",
|
|
@@ -30016,7 +30028,7 @@ function Banner({
|
|
|
30016
30028
|
compact
|
|
30017
30029
|
}
|
|
30018
30030
|
) : null,
|
|
30019
|
-
/* @__PURE__ */
|
|
30031
|
+
/* @__PURE__ */ jsx62(
|
|
30020
30032
|
InfoRow,
|
|
30021
30033
|
{
|
|
30022
30034
|
icon: "\u2301",
|
|
@@ -30026,7 +30038,7 @@ function Banner({
|
|
|
30026
30038
|
compact
|
|
30027
30039
|
}
|
|
30028
30040
|
),
|
|
30029
|
-
/* @__PURE__ */
|
|
30041
|
+
/* @__PURE__ */ jsx62(
|
|
30030
30042
|
ProfileRow,
|
|
30031
30043
|
{
|
|
30032
30044
|
profile: entry.profile,
|
|
@@ -30036,8 +30048,8 @@ function Banner({
|
|
|
30036
30048
|
}
|
|
30037
30049
|
)
|
|
30038
30050
|
] }),
|
|
30039
|
-
/* @__PURE__ */
|
|
30040
|
-
entry.autonomyAgents && entry.autonomyAgents.length > 0 ? /* @__PURE__ */
|
|
30051
|
+
/* @__PURE__ */ jsx62(Footer, { contentWidth, compact }),
|
|
30052
|
+
entry.autonomyAgents && entry.autonomyAgents.length > 0 ? /* @__PURE__ */ jsx62(
|
|
30041
30053
|
AutonomyAgentsSection,
|
|
30042
30054
|
{
|
|
30043
30055
|
agents: entry.autonomyAgents,
|
|
@@ -30395,7 +30407,7 @@ function padCell(text, width, align) {
|
|
|
30395
30407
|
}
|
|
30396
30408
|
|
|
30397
30409
|
// src/markdown.tsx
|
|
30398
|
-
import { jsx as
|
|
30410
|
+
import { jsx as jsx63, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
30399
30411
|
var _parseCache = /* @__PURE__ */ new Map();
|
|
30400
30412
|
var _PARSE_CACHE_MAX_ENTRIES = 5e3;
|
|
30401
30413
|
var _PARSE_CACHE_MAX_CHARS = 512 * 1024;
|
|
@@ -30480,8 +30492,8 @@ function parseInline(text) {
|
|
|
30480
30492
|
return tokens;
|
|
30481
30493
|
}
|
|
30482
30494
|
function InlineLine({ tokens, dim }) {
|
|
30483
|
-
if (tokens.length === 0) return /* @__PURE__ */
|
|
30484
|
-
return /* @__PURE__ */
|
|
30495
|
+
if (tokens.length === 0) return /* @__PURE__ */ jsx63(Text, { children: " " });
|
|
30496
|
+
return /* @__PURE__ */ jsx63(Text, { children: tokens.map((t, j) => /* @__PURE__ */ jsx63(
|
|
30485
30497
|
Text,
|
|
30486
30498
|
{
|
|
30487
30499
|
color: t.code ? theme.accent : "white",
|
|
@@ -30514,7 +30526,7 @@ function MarkdownView({
|
|
|
30514
30526
|
if (tableEnd > i) {
|
|
30515
30527
|
const tableText = renderTable(lines.slice(i, tableEnd), tableBudget);
|
|
30516
30528
|
rows.push(
|
|
30517
|
-
/* @__PURE__ */
|
|
30529
|
+
/* @__PURE__ */ jsx63(Box, { width: tableBudget, backgroundColor: "transparent", children: /* @__PURE__ */ jsx63(Text, { children: tableText }) }, `t${key++}`)
|
|
30518
30530
|
);
|
|
30519
30531
|
i = tableEnd;
|
|
30520
30532
|
continue;
|
|
@@ -30524,7 +30536,7 @@ function MarkdownView({
|
|
|
30524
30536
|
const heading = line.match(HEADING_RE);
|
|
30525
30537
|
if (heading) {
|
|
30526
30538
|
rows.push(
|
|
30527
|
-
/* @__PURE__ */
|
|
30539
|
+
/* @__PURE__ */ jsx63(Text, { bold: true, color: theme.accent, children: heading[2] ?? "" }, `h${key++}`)
|
|
30528
30540
|
);
|
|
30529
30541
|
continue;
|
|
30530
30542
|
}
|
|
@@ -30533,12 +30545,12 @@ function MarkdownView({
|
|
|
30533
30545
|
const qContent = quote[1] ?? "";
|
|
30534
30546
|
rows.push(
|
|
30535
30547
|
/* @__PURE__ */ jsxs61(Box, { flexDirection: "row", children: [
|
|
30536
|
-
/* @__PURE__ */
|
|
30548
|
+
/* @__PURE__ */ jsx63(Text, { dimColor: true, children: " " }),
|
|
30537
30549
|
/[\u2500-\u257F]/.test(qContent) ? (
|
|
30538
30550
|
// Box-drawing characters inside blockquotes also need transparent
|
|
30539
30551
|
// background to avoid inheriting the message panel background.
|
|
30540
|
-
/* @__PURE__ */
|
|
30541
|
-
) : /* @__PURE__ */
|
|
30552
|
+
/* @__PURE__ */ jsx63(Box, { flexDirection: "row", backgroundColor: "transparent", children: [...qContent].slice(0, (contentWidth ?? termWidth) - 2).map((ch, ci) => /* @__PURE__ */ jsx63(Text, { dimColor: true, children: ch }, ci)) })
|
|
30553
|
+
) : /* @__PURE__ */ jsx63(InlineLine, { tokens: parseInline(qContent), dim: true })
|
|
30542
30554
|
] }, `q${key++}`)
|
|
30543
30555
|
);
|
|
30544
30556
|
continue;
|
|
@@ -30547,8 +30559,8 @@ function MarkdownView({
|
|
|
30547
30559
|
if (bullet) {
|
|
30548
30560
|
rows.push(
|
|
30549
30561
|
/* @__PURE__ */ jsxs61(Box, { flexDirection: "row", children: [
|
|
30550
|
-
/* @__PURE__ */
|
|
30551
|
-
/* @__PURE__ */
|
|
30562
|
+
/* @__PURE__ */ jsx63(Text, { color: theme.accent, children: `${bullet[1] ?? ""}\u2022 ` }),
|
|
30563
|
+
/* @__PURE__ */ jsx63(InlineLine, { tokens: parseInline(bullet[2] ?? "") })
|
|
30552
30564
|
] }, `b${key++}`)
|
|
30553
30565
|
);
|
|
30554
30566
|
continue;
|
|
@@ -30557,8 +30569,8 @@ function MarkdownView({
|
|
|
30557
30569
|
if (numbered) {
|
|
30558
30570
|
rows.push(
|
|
30559
30571
|
/* @__PURE__ */ jsxs61(Box, { flexDirection: "row", children: [
|
|
30560
|
-
/* @__PURE__ */
|
|
30561
|
-
/* @__PURE__ */
|
|
30572
|
+
/* @__PURE__ */ jsx63(Text, { color: theme.accent, children: `${numbered[1] ?? ""}${numbered[2]}. ` }),
|
|
30573
|
+
/* @__PURE__ */ jsx63(InlineLine, { tokens: parseInline(numbered[3] ?? "") })
|
|
30562
30574
|
] }, `n${key++}`)
|
|
30563
30575
|
);
|
|
30564
30576
|
continue;
|
|
@@ -30567,17 +30579,17 @@ function MarkdownView({
|
|
|
30567
30579
|
const maxW = contentWidth ?? termWidth;
|
|
30568
30580
|
const chars = [...line].slice(0, maxW);
|
|
30569
30581
|
rows.push(
|
|
30570
|
-
/* @__PURE__ */
|
|
30582
|
+
/* @__PURE__ */ jsx63(Box, { width: maxW, backgroundColor: "transparent", flexDirection: "row", children: chars.map((ch, ci) => /* @__PURE__ */ jsx63(Text, { children: ch }, ci)) }, `bx${key++}`)
|
|
30571
30583
|
);
|
|
30572
30584
|
continue;
|
|
30573
30585
|
}
|
|
30574
|
-
rows.push(/* @__PURE__ */
|
|
30586
|
+
rows.push(/* @__PURE__ */ jsx63(InlineLine, { tokens: parseInline(line) }, `p${key++}`));
|
|
30575
30587
|
}
|
|
30576
|
-
return /* @__PURE__ */
|
|
30588
|
+
return /* @__PURE__ */ jsx63(Box, { flexDirection: "column", width: Math.max(20, tableBudget), children: rows });
|
|
30577
30589
|
}
|
|
30578
30590
|
|
|
30579
30591
|
// src/components/history/assistant.tsx
|
|
30580
|
-
import { jsx as
|
|
30592
|
+
import { jsx as jsx64, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
30581
30593
|
var MESSAGE_PANEL_CHROME_WIDTH = 2;
|
|
30582
30594
|
function assistantContentWidth(termWidth) {
|
|
30583
30595
|
return Math.max(20, termWidth - MESSAGE_PANEL_CHROME_WIDTH);
|
|
@@ -30622,8 +30634,8 @@ function AssistantBody({
|
|
|
30622
30634
|
}) {
|
|
30623
30635
|
const segments = splitFencedBlocks(text);
|
|
30624
30636
|
const inner = contentWidth ?? termWidth;
|
|
30625
|
-
return /* @__PURE__ */
|
|
30626
|
-
(seg, i) => seg.type === "code" ? /* @__PURE__ */
|
|
30637
|
+
return /* @__PURE__ */ jsx64(Box, { flexDirection: "column", children: segments.map(
|
|
30638
|
+
(seg, i) => seg.type === "code" ? /* @__PURE__ */ jsx64(CodeBlock, { code: seg.text, lang: seg.lang ?? "plain", contentWidth: inner }, i) : /* @__PURE__ */ jsx64(
|
|
30627
30639
|
MarkdownView,
|
|
30628
30640
|
{
|
|
30629
30641
|
text: seg.text,
|
|
@@ -30640,7 +30652,7 @@ var ASSISTANT_TAIL_HEADER_ROWS = 1;
|
|
|
30640
30652
|
var ASSISTANT_TAIL_HEIGHT = ASSISTANT_TAIL_MARGIN_Y + ASSISTANT_TAIL_HEADER_ROWS + ASSISTANT_TAIL_LINES;
|
|
30641
30653
|
|
|
30642
30654
|
// src/components/history/tool-card.tsx
|
|
30643
|
-
import { Fragment as Fragment23, jsx as
|
|
30655
|
+
import { Fragment as Fragment23, jsx as jsx65, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
30644
30656
|
function ToolCard({
|
|
30645
30657
|
glyph: glyph2,
|
|
30646
30658
|
color,
|
|
@@ -30663,17 +30675,17 @@ function ToolCard({
|
|
|
30663
30675
|
const railColor = ok ? theme.borderSubtle : theme.error;
|
|
30664
30676
|
return /* @__PURE__ */ jsxs63(Box, { flexDirection: "column", marginY: 0, children: [
|
|
30665
30677
|
/* @__PURE__ */ jsxs63(Text, { children: [
|
|
30666
|
-
/* @__PURE__ */
|
|
30667
|
-
/* @__PURE__ */
|
|
30668
|
-
/* @__PURE__ */
|
|
30669
|
-
/* @__PURE__ */
|
|
30670
|
-
/* @__PURE__ */
|
|
30671
|
-
/* @__PURE__ */
|
|
30672
|
-
visibleDetail ? /* @__PURE__ */
|
|
30673
|
-
visibleMeta ? /* @__PURE__ */
|
|
30678
|
+
/* @__PURE__ */ jsx65(Text, { color: railColor, children: "\u256D\u2500 " }),
|
|
30679
|
+
/* @__PURE__ */ jsx65(Text, { bold: true, color: statusColor2, children: status }),
|
|
30680
|
+
/* @__PURE__ */ jsx65(Text, { children: " " }),
|
|
30681
|
+
/* @__PURE__ */ jsx65(Text, { color, children: glyph2 }),
|
|
30682
|
+
/* @__PURE__ */ jsx65(Text, { children: " " }),
|
|
30683
|
+
/* @__PURE__ */ jsx65(Text, { bold: true, color: theme.textPrimary, children: title }),
|
|
30684
|
+
visibleDetail ? /* @__PURE__ */ jsx65(Text, { color: theme.textSecondary, children: ` ${visibleDetail}` }) : null,
|
|
30685
|
+
visibleMeta ? /* @__PURE__ */ jsx65(Text, { color: theme.textMuted, children: ` \xB7 ${visibleMeta}` }) : null
|
|
30674
30686
|
] }),
|
|
30675
30687
|
hasBody ? /* @__PURE__ */ jsxs63(Fragment23, { children: [
|
|
30676
|
-
/* @__PURE__ */
|
|
30688
|
+
/* @__PURE__ */ jsx65(
|
|
30677
30689
|
Box,
|
|
30678
30690
|
{
|
|
30679
30691
|
flexDirection: "column",
|
|
@@ -30686,13 +30698,13 @@ function ToolCard({
|
|
|
30686
30698
|
children
|
|
30687
30699
|
}
|
|
30688
30700
|
),
|
|
30689
|
-
/* @__PURE__ */
|
|
30701
|
+
/* @__PURE__ */ jsx65(Text, { color: railColor, children: `\u2570${"\u2500".repeat(Math.max(2, termWidth - 1))}` })
|
|
30690
30702
|
] }) : null
|
|
30691
30703
|
] });
|
|
30692
30704
|
}
|
|
30693
30705
|
|
|
30694
30706
|
// src/components/history/entry.tsx
|
|
30695
|
-
import { Fragment as Fragment24, jsx as
|
|
30707
|
+
import { Fragment as Fragment24, jsx as jsx66, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
30696
30708
|
function brainStatusStyle(status) {
|
|
30697
30709
|
switch (status) {
|
|
30698
30710
|
case "thinking":
|
|
@@ -30743,8 +30755,8 @@ function NoticeCard({
|
|
|
30743
30755
|
borderColor: color,
|
|
30744
30756
|
paddingX: 1,
|
|
30745
30757
|
children: [
|
|
30746
|
-
/* @__PURE__ */
|
|
30747
|
-
/* @__PURE__ */
|
|
30758
|
+
/* @__PURE__ */ jsx66(Text, { bold: true, color, children: `${icon} ${label}` }),
|
|
30759
|
+
/* @__PURE__ */ jsx66(Box, { flexDirection: "column", width: contentWidth, children: hasAnsi ? /* @__PURE__ */ jsx66(Text, { children: text }) : lines.map((line, i) => /* @__PURE__ */ jsx66(Text, { color, children: line.length > 0 ? line : " " }, i)) })
|
|
30748
30760
|
]
|
|
30749
30761
|
}
|
|
30750
30762
|
);
|
|
@@ -30774,7 +30786,7 @@ var Entry = React8.memo(function Entry2({
|
|
|
30774
30786
|
}, [entry.kind, entry.text, openTodos, setSuggestions]);
|
|
30775
30787
|
switch (entry.kind) {
|
|
30776
30788
|
case "user":
|
|
30777
|
-
return /* @__PURE__ */
|
|
30789
|
+
return /* @__PURE__ */ jsx66(
|
|
30778
30790
|
Box,
|
|
30779
30791
|
{
|
|
30780
30792
|
marginX: 0,
|
|
@@ -30785,9 +30797,9 @@ var Entry = React8.memo(function Entry2({
|
|
|
30785
30797
|
borderColor: theme.user,
|
|
30786
30798
|
paddingLeft: 1,
|
|
30787
30799
|
children: /* @__PURE__ */ jsxs64(Text, { children: [
|
|
30788
|
-
/* @__PURE__ */
|
|
30789
|
-
/* @__PURE__ */
|
|
30790
|
-
entry.queued ? /* @__PURE__ */
|
|
30800
|
+
/* @__PURE__ */ jsx66(Text, { bold: true, color: theme.user, children: "\u{1F464} USER " }),
|
|
30801
|
+
/* @__PURE__ */ jsx66(Text, { color: "white", children: entry.text }),
|
|
30802
|
+
entry.queued ? /* @__PURE__ */ jsx66(Text, { dimColor: true, children: " (queued)" }) : null,
|
|
30791
30803
|
entry.pasteContent ? /* @__PURE__ */ jsxs64(Fragment24, { children: [
|
|
30792
30804
|
entry.text ? "\n" : null,
|
|
30793
30805
|
/* @__PURE__ */ jsxs64(Text, { dimColor: true, children: [
|
|
@@ -30799,7 +30811,7 @@ var Entry = React8.memo(function Entry2({
|
|
|
30799
30811
|
}
|
|
30800
30812
|
);
|
|
30801
30813
|
case "thinking": {
|
|
30802
|
-
if (showModelReasoning === false) return
|
|
30814
|
+
if (showModelReasoning === false) return null;
|
|
30803
30815
|
const contentWidth = assistantContentWidth(termWidth);
|
|
30804
30816
|
return /* @__PURE__ */ jsxs64(
|
|
30805
30817
|
Box,
|
|
@@ -30815,10 +30827,10 @@ var Entry = React8.memo(function Entry2({
|
|
|
30815
30827
|
paddingLeft: 1,
|
|
30816
30828
|
children: [
|
|
30817
30829
|
/* @__PURE__ */ jsxs64(Box, { flexDirection: "row", children: [
|
|
30818
|
-
/* @__PURE__ */
|
|
30819
|
-
/* @__PURE__ */
|
|
30830
|
+
/* @__PURE__ */ jsx66(Text, { bold: true, color: theme.textSecondary, children: "\u27F3 Model Reasoning" }),
|
|
30831
|
+
/* @__PURE__ */ jsx66(Text, { color: theme.textSecondary, children: " (model reasoning\u2026)" })
|
|
30820
30832
|
] }),
|
|
30821
|
-
/* @__PURE__ */
|
|
30833
|
+
/* @__PURE__ */ jsx66(Box, { width: contentWidth, children: /* @__PURE__ */ jsx66(Text, { color: theme.textSecondary, children: entry.text }) })
|
|
30822
30834
|
]
|
|
30823
30835
|
}
|
|
30824
30836
|
);
|
|
@@ -30841,8 +30853,8 @@ var Entry = React8.memo(function Entry2({
|
|
|
30841
30853
|
borderColor: theme.assistant,
|
|
30842
30854
|
paddingLeft: 1,
|
|
30843
30855
|
children: [
|
|
30844
|
-
/* @__PURE__ */
|
|
30845
|
-
/* @__PURE__ */
|
|
30856
|
+
/* @__PURE__ */ jsx66(Box, { flexDirection: "row", children: /* @__PURE__ */ jsx66(Text, { bold: true, color: theme.assistant, children: "\u{1F4AC} ASSISTANT" }) }),
|
|
30857
|
+
/* @__PURE__ */ jsx66(AssistantBody, { text: stripped, termWidth, contentWidth })
|
|
30846
30858
|
]
|
|
30847
30859
|
}
|
|
30848
30860
|
),
|
|
@@ -30860,14 +30872,14 @@ var Entry = React8.memo(function Entry2({
|
|
|
30860
30872
|
paddingLeft: 1,
|
|
30861
30873
|
children: [
|
|
30862
30874
|
/* @__PURE__ */ jsxs64(Box, { flexDirection: "row", marginBottom: 1, children: [
|
|
30863
|
-
/* @__PURE__ */
|
|
30864
|
-
/* @__PURE__ */
|
|
30875
|
+
/* @__PURE__ */ jsx66(Text, { bold: true, color: theme.accent, children: "\u{1F4A1} NEXT STEPS " }),
|
|
30876
|
+
/* @__PURE__ */ jsx66(Text, { dimColor: true, children: "(use /next 1, /next 1 2 3 to select)" })
|
|
30865
30877
|
] }),
|
|
30866
|
-
steps.map((s2, i) => /* @__PURE__ */
|
|
30867
|
-
/* @__PURE__ */
|
|
30868
|
-
/* @__PURE__ */
|
|
30869
|
-
s2.auto ? /* @__PURE__ */
|
|
30870
|
-
autonomyMode === "auto" && i === 0 ? /* @__PURE__ */
|
|
30878
|
+
steps.map((s2, i) => /* @__PURE__ */ jsx66(Box, { flexDirection: "row", marginTop: 0, children: /* @__PURE__ */ jsxs64(Text, { children: [
|
|
30879
|
+
/* @__PURE__ */ jsx66(Text, { bold: true, color: theme.accent, children: ` ${s2.index}. ` }),
|
|
30880
|
+
/* @__PURE__ */ jsx66(Text, { children: s2.text }),
|
|
30881
|
+
s2.auto ? /* @__PURE__ */ jsx66(Text, { color: "cyan", dimColor: true, children: " auto" }) : null,
|
|
30882
|
+
autonomyMode === "auto" && i === 0 ? /* @__PURE__ */ jsx66(Text, { color: "cyan", children: " \u23E9" }) : null
|
|
30871
30883
|
] }) }, s2.index))
|
|
30872
30884
|
]
|
|
30873
30885
|
}
|
|
@@ -30959,12 +30971,12 @@ var Entry = React8.memo(function Entry2({
|
|
|
30959
30971
|
hasBody: true,
|
|
30960
30972
|
children: [
|
|
30961
30973
|
/* @__PURE__ */ jsxs64(Text, { children: [
|
|
30962
|
-
/* @__PURE__ */
|
|
30963
|
-
mutation.added > 0 ? /* @__PURE__ */
|
|
30964
|
-
mutation.added > 0 && mutation.removed > 0 ? /* @__PURE__ */
|
|
30965
|
-
mutation.removed > 0 ? /* @__PURE__ */
|
|
30966
|
-
hasCounts ? /* @__PURE__ */
|
|
30967
|
-
/* @__PURE__ */
|
|
30974
|
+
/* @__PURE__ */ jsx66(Text, { dimColor: true, children: "\u23BF " }),
|
|
30975
|
+
mutation.added > 0 ? /* @__PURE__ */ jsx66(Text, { bold: true, color: theme.success, children: `+${mutation.added}` }) : null,
|
|
30976
|
+
mutation.added > 0 && mutation.removed > 0 ? /* @__PURE__ */ jsx66(Text, { children: " " }) : null,
|
|
30977
|
+
mutation.removed > 0 ? /* @__PURE__ */ jsx66(Text, { bold: true, color: theme.error, children: `-${mutation.removed}` }) : null,
|
|
30978
|
+
hasCounts ? /* @__PURE__ */ jsx66(Text, { dimColor: true, children: " " }) : null,
|
|
30979
|
+
/* @__PURE__ */ jsx66(Text, { dimColor: true, children: statsText })
|
|
30968
30980
|
] }),
|
|
30969
30981
|
entry.resultRenderMode !== "simple" && multiDiffs ? /* @__PURE__ */ jsxs64(Box, { flexDirection: "column", children: [
|
|
30970
30982
|
(() => {
|
|
@@ -30972,9 +30984,9 @@ var Entry = React8.memo(function Entry2({
|
|
|
30972
30984
|
summarizeMultiFileDiffs(multiDiffs),
|
|
30973
30985
|
multiDiffSummaryThreshold ?? -1
|
|
30974
30986
|
);
|
|
30975
|
-
return summaryLine ? /* @__PURE__ */
|
|
30987
|
+
return summaryLine ? /* @__PURE__ */ jsx66(Text, { dimColor: true, italic: true, children: ` ${summaryLine}` }) : null;
|
|
30976
30988
|
})(),
|
|
30977
|
-
multiDiffs.map((item) => /* @__PURE__ */
|
|
30989
|
+
multiDiffs.map((item) => /* @__PURE__ */ jsx66(
|
|
30978
30990
|
DiffFileBlock,
|
|
30979
30991
|
{
|
|
30980
30992
|
path: item.path,
|
|
@@ -30984,7 +30996,7 @@ var Entry = React8.memo(function Entry2({
|
|
|
30984
30996
|
},
|
|
30985
30997
|
item.path
|
|
30986
30998
|
))
|
|
30987
|
-
] }) : entry.resultRenderMode !== "simple" && diff ? /* @__PURE__ */
|
|
30999
|
+
] }) : entry.resultRenderMode !== "simple" && diff ? /* @__PURE__ */ jsx66(
|
|
30988
31000
|
DiffBlock,
|
|
30989
31001
|
{
|
|
30990
31002
|
rows: diff.rows,
|
|
@@ -31019,17 +31031,17 @@ var Entry = React8.memo(function Entry2({
|
|
|
31019
31031
|
termWidth,
|
|
31020
31032
|
hasBody: hasToolBody,
|
|
31021
31033
|
children: [
|
|
31022
|
-
visualLines && entry.resultRenderMode !== "simple" ? /* @__PURE__ */
|
|
31034
|
+
visualLines && entry.resultRenderMode !== "simple" ? /* @__PURE__ */ jsx66(ToolOutputLines, { lines: visualLines, hasFollowingBlock: Boolean(diff || multiDiffs) }) : visualLines ? (
|
|
31023
31035
|
// `simple` mode: meta line stays visible (path + replacement
|
|
31024
31036
|
// count for edit, line count for read, etc.) but the diff
|
|
31025
31037
|
// body below is hidden. The user always gets a one-line
|
|
31026
31038
|
// summary so the entry never looks empty.
|
|
31027
|
-
/* @__PURE__ */
|
|
31039
|
+
/* @__PURE__ */ jsx66(ToolOutputLines, { lines: visualLines, hasFollowingBlock: false })
|
|
31028
31040
|
) : entry.resultRenderMode === "simple" ? null : outLines.map((line, i) => {
|
|
31029
31041
|
const connector = i === outLines.length - 1 && !diff && !multiDiffs ? " \u2514\u2500 " : " \u251C\u2500 ";
|
|
31030
31042
|
return /* @__PURE__ */ jsxs64(Text, { children: [
|
|
31031
|
-
/* @__PURE__ */
|
|
31032
|
-
/* @__PURE__ */
|
|
31043
|
+
/* @__PURE__ */ jsx66(Text, { color, dimColor: true, children: connector }),
|
|
31044
|
+
/* @__PURE__ */ jsx66(
|
|
31033
31045
|
Text,
|
|
31034
31046
|
{
|
|
31035
31047
|
dimColor: entry.ok && !line.startsWith("!"),
|
|
@@ -31045,10 +31057,10 @@ var Entry = React8.memo(function Entry2({
|
|
|
31045
31057
|
summarizeMultiFileDiffs(multiDiffs),
|
|
31046
31058
|
multiDiffSummaryThreshold ?? -1
|
|
31047
31059
|
);
|
|
31048
|
-
return summaryLine ? /* @__PURE__ */
|
|
31060
|
+
return summaryLine ? /* @__PURE__ */ jsx66(Text, { dimColor: true, italic: true, children: summaryLine }) : null;
|
|
31049
31061
|
})(),
|
|
31050
|
-
multiDiffs.map((item) => /* @__PURE__ */
|
|
31051
|
-
] }) : entry.resultRenderMode !== "simple" && diff ? /* @__PURE__ */
|
|
31062
|
+
multiDiffs.map((item) => /* @__PURE__ */ jsx66(DiffFileBlock, { path: item.path, preview: item.preview, useColor: theme.supportsBackground, contentWidth: toolContentWidth }, item.path))
|
|
31063
|
+
] }) : entry.resultRenderMode !== "simple" && diff ? /* @__PURE__ */ jsx66(
|
|
31052
31064
|
DiffBlock,
|
|
31053
31065
|
{
|
|
31054
31066
|
rows: diff.rows,
|
|
@@ -31072,42 +31084,42 @@ var Entry = React8.memo(function Entry2({
|
|
|
31072
31084
|
const why = [...new Set(injected.flatMap((memory) => memory.activationReasons))].slice(0, 3).join(" \xB7 ");
|
|
31073
31085
|
return /* @__PURE__ */ jsxs64(Box, { flexDirection: "column", borderStyle: "single", borderColor: "magenta", paddingX: 1, children: [
|
|
31074
31086
|
/* @__PURE__ */ jsxs64(Box, { flexDirection: "row", children: [
|
|
31075
|
-
/* @__PURE__ */
|
|
31076
|
-
/* @__PURE__ */
|
|
31077
|
-
/* @__PURE__ */
|
|
31087
|
+
/* @__PURE__ */ jsx66(Text, { bold: true, color: "magenta", children: "\u{1F9E0} MEMORY INJECTOR " }),
|
|
31088
|
+
/* @__PURE__ */ jsx66(Text, { color: "cyan", children: entry.trigger }),
|
|
31089
|
+
/* @__PURE__ */ jsx66(Text, { dimColor: true, children: ` ${entry.activated.length} activated \u2192 ${entry.injectedIds.length} injected / ${entry.candidates} \xB7 ctx ${Math.round(entry.contextPressure * 100)}% \xB7 +${entry.injectedChars} chars` })
|
|
31078
31090
|
] }),
|
|
31079
|
-
entry.error ? /* @__PURE__ */
|
|
31091
|
+
entry.error ? /* @__PURE__ */ jsx66(Text, { color: "red", children: `error: ${entry.error}` }) : null,
|
|
31080
31092
|
injectedSummary ? /* @__PURE__ */ jsxs64(Text, { children: [
|
|
31081
|
-
/* @__PURE__ */
|
|
31082
|
-
/* @__PURE__ */
|
|
31083
|
-
why ? /* @__PURE__ */
|
|
31093
|
+
/* @__PURE__ */ jsx66(Text, { color: "green", children: "injected " }),
|
|
31094
|
+
/* @__PURE__ */ jsx66(Text, { dimColor: true, children: `${injectedSummary}${injected.length > 3 ? ` +${injected.length - 3}` : ""}` }),
|
|
31095
|
+
why ? /* @__PURE__ */ jsx66(Text, { dimColor: true, children: ` \xB7 why: ${why}` }) : null
|
|
31084
31096
|
] }) : null,
|
|
31085
|
-
rejected ? /* @__PURE__ */
|
|
31097
|
+
rejected ? /* @__PURE__ */ jsx66(Text, { dimColor: true, children: `filtered: ${rejected}` }) : null
|
|
31086
31098
|
] });
|
|
31087
31099
|
}
|
|
31088
31100
|
case "memory-lifecycle": {
|
|
31089
31101
|
const style = memoryLifecycleStyle(entry.action);
|
|
31090
31102
|
return /* @__PURE__ */ jsxs64(Box, { flexDirection: "row", children: [
|
|
31091
|
-
/* @__PURE__ */
|
|
31092
|
-
/* @__PURE__ */
|
|
31093
|
-
entry.detail ? /* @__PURE__ */
|
|
31103
|
+
/* @__PURE__ */ jsx66(Text, { bold: true, color: style.color, children: `${style.icon} MEMORY ` }),
|
|
31104
|
+
/* @__PURE__ */ jsx66(Text, { color: style.color, children: entry.label }),
|
|
31105
|
+
entry.detail ? /* @__PURE__ */ jsx66(Text, { dimColor: true, children: ` \xB7 ${entry.detail}` }) : null
|
|
31094
31106
|
] });
|
|
31095
31107
|
}
|
|
31096
31108
|
case "info": {
|
|
31097
31109
|
const hasAnsi = /\x1b\[/.test(entry.text);
|
|
31098
|
-
if (hasAnsi) return /* @__PURE__ */
|
|
31110
|
+
if (hasAnsi) return /* @__PURE__ */ jsx66(Text, { children: entry.text });
|
|
31099
31111
|
return /* @__PURE__ */ jsxs64(Text, { dimColor: true, children: [
|
|
31100
|
-
/* @__PURE__ */
|
|
31112
|
+
/* @__PURE__ */ jsx66(Text, { dimColor: true, children: "\u2139 " }),
|
|
31101
31113
|
entry.text
|
|
31102
31114
|
] });
|
|
31103
31115
|
}
|
|
31104
31116
|
case "warn":
|
|
31105
|
-
return /* @__PURE__ */
|
|
31106
|
-
/* @__PURE__ */
|
|
31107
|
-
/* @__PURE__ */
|
|
31117
|
+
return /* @__PURE__ */ jsx66(Box, { flexDirection: "row", marginY: 0, height: 1, children: /* @__PURE__ */ jsxs64(Text, { children: [
|
|
31118
|
+
/* @__PURE__ */ jsx66(Text, { bold: true, color: theme.warn, children: "\u26A0 " }),
|
|
31119
|
+
/* @__PURE__ */ jsx66(Text, { color: theme.warn, children: entry.text })
|
|
31108
31120
|
] }) });
|
|
31109
31121
|
case "error":
|
|
31110
|
-
return /* @__PURE__ */
|
|
31122
|
+
return /* @__PURE__ */ jsx66(
|
|
31111
31123
|
NoticeCard,
|
|
31112
31124
|
{
|
|
31113
31125
|
icon: "\u2717",
|
|
@@ -31118,7 +31130,7 @@ var Entry = React8.memo(function Entry2({
|
|
|
31118
31130
|
}
|
|
31119
31131
|
);
|
|
31120
31132
|
case "turn-summary":
|
|
31121
|
-
return /* @__PURE__ */
|
|
31133
|
+
return /* @__PURE__ */ jsx66(
|
|
31122
31134
|
Box,
|
|
31123
31135
|
{
|
|
31124
31136
|
marginX: 0,
|
|
@@ -31127,8 +31139,8 @@ var Entry = React8.memo(function Entry2({
|
|
|
31127
31139
|
backgroundColor: theme.surfaceRaised,
|
|
31128
31140
|
paddingX: 1,
|
|
31129
31141
|
children: /* @__PURE__ */ jsxs64(Text, { children: [
|
|
31130
|
-
/* @__PURE__ */
|
|
31131
|
-
/* @__PURE__ */
|
|
31142
|
+
/* @__PURE__ */ jsx66(Text, { color: theme.brandPrimary, children: "\u{1F4CB} " }),
|
|
31143
|
+
/* @__PURE__ */ jsx66(Text, { color: theme.textSecondary, children: entry.text })
|
|
31132
31144
|
] })
|
|
31133
31145
|
}
|
|
31134
31146
|
);
|
|
@@ -31151,18 +31163,18 @@ var Entry = React8.memo(function Entry2({
|
|
|
31151
31163
|
borderColor: accent,
|
|
31152
31164
|
paddingX: 1,
|
|
31153
31165
|
children: [
|
|
31154
|
-
/* @__PURE__ */
|
|
31166
|
+
/* @__PURE__ */ jsx66(Text, { bold: true, color: accent, children: "\u{1F504} MODEL SWITCHED" }),
|
|
31155
31167
|
fromRef ? /* @__PURE__ */ jsxs64(Text, { children: [
|
|
31156
|
-
/* @__PURE__ */
|
|
31157
|
-
/* @__PURE__ */
|
|
31158
|
-
fromChip ? /* @__PURE__ */
|
|
31168
|
+
/* @__PURE__ */ jsx66(Text, { dimColor: true, children: " from " }),
|
|
31169
|
+
/* @__PURE__ */ jsx66(Text, { dimColor: true, children: fromRef }),
|
|
31170
|
+
fromChip ? /* @__PURE__ */ jsx66(Text, { dimColor: true, children: ` ${fromChip}` }) : null
|
|
31159
31171
|
] }) : null,
|
|
31160
31172
|
/* @__PURE__ */ jsxs64(Text, { children: [
|
|
31161
|
-
/* @__PURE__ */
|
|
31162
|
-
/* @__PURE__ */
|
|
31163
|
-
toChip ? /* @__PURE__ */
|
|
31173
|
+
/* @__PURE__ */ jsx66(Text, { dimColor: true, children: fromRef ? " to " : " now " }),
|
|
31174
|
+
/* @__PURE__ */ jsx66(Text, { bold: true, color: theme.assistant, children: toRef }),
|
|
31175
|
+
toChip ? /* @__PURE__ */ jsx66(Text, { color: shrink ? theme.warn : theme.success, children: ` ${toChip}` }) : null
|
|
31164
31176
|
] }),
|
|
31165
|
-
shrink ? /* @__PURE__ */
|
|
31177
|
+
shrink ? /* @__PURE__ */ jsx66(Text, { color: theme.warn, children: ` \u26A0 smaller window: ${fmtTok3(entry.fromContext)} \u2192 ${fmtTok3(
|
|
31166
31178
|
entry.toContext
|
|
31167
31179
|
)}${pct !== void 0 ? ` \xB7 request \u2248 ${fmtTok3(entry.requestTokens)} (${pct}% of new window)` : ""}` }) : null
|
|
31168
31180
|
]
|
|
@@ -31187,21 +31199,21 @@ var Entry = React8.memo(function Entry2({
|
|
|
31187
31199
|
paddingLeft: 1,
|
|
31188
31200
|
children: [
|
|
31189
31201
|
/* @__PURE__ */ jsxs64(Box, { flexDirection: "row", gap: 1, children: [
|
|
31190
|
-
/* @__PURE__ */
|
|
31191
|
-
/* @__PURE__ */
|
|
31192
|
-
/* @__PURE__ */
|
|
31193
|
-
/* @__PURE__ */
|
|
31194
|
-
/* @__PURE__ */
|
|
31202
|
+
/* @__PURE__ */ jsx66(Text, { bold: true, color: theme.monitor.agents, children: "\u2726 BRAIN" }),
|
|
31203
|
+
/* @__PURE__ */ jsx66(Text, { color: statusStyle.color, children: statusStyle.icon }),
|
|
31204
|
+
/* @__PURE__ */ jsx66(Text, { dimColor: true, children: entry.source }),
|
|
31205
|
+
/* @__PURE__ */ jsx66(Text, { dimColor: true, children: "\xB7" }),
|
|
31206
|
+
/* @__PURE__ */ jsx66(Text, { bold: true, color: riskColor2, children: entry.risk })
|
|
31195
31207
|
] }),
|
|
31196
|
-
/* @__PURE__ */
|
|
31197
|
-
entry.decision ? /* @__PURE__ */
|
|
31198
|
-
/* @__PURE__ */
|
|
31199
|
-
/* @__PURE__ */
|
|
31208
|
+
/* @__PURE__ */ jsx66(Box, { paddingLeft: indentWidth, children: /* @__PURE__ */ jsx66(Text, { color: theme.textPrimary, children: entry.question }) }),
|
|
31209
|
+
entry.decision ? /* @__PURE__ */ jsx66(Box, { paddingLeft: indentWidth, marginTop: 1, children: /* @__PURE__ */ jsxs64(Text, { children: [
|
|
31210
|
+
/* @__PURE__ */ jsx66(Text, { bold: true, color: statusStyle.color, children: "\u21B3 Decision: " }),
|
|
31211
|
+
/* @__PURE__ */ jsx66(Text, { color: theme.textPrimary, children: entry.decision })
|
|
31200
31212
|
] }) }) : null,
|
|
31201
|
-
entry.rationale ? /* @__PURE__ */
|
|
31202
|
-
entry.outcome ? /* @__PURE__ */
|
|
31203
|
-
/* @__PURE__ */
|
|
31204
|
-
/* @__PURE__ */
|
|
31213
|
+
entry.rationale ? /* @__PURE__ */ jsx66(Box, { paddingLeft: indentWidth, marginTop: 1, children: /* @__PURE__ */ jsx66(Text, { dimColor: true, children: entry.rationale }) }) : null,
|
|
31214
|
+
entry.outcome ? /* @__PURE__ */ jsx66(Box, { paddingLeft: indentWidth, marginTop: 1, children: /* @__PURE__ */ jsxs64(Text, { children: [
|
|
31215
|
+
/* @__PURE__ */ jsx66(Text, { bold: true, color: statusStyle.color, children: "\u2713 Outcome: " }),
|
|
31216
|
+
/* @__PURE__ */ jsx66(Text, { color: theme.textPrimary, children: entry.outcome })
|
|
31205
31217
|
] }) }) : null
|
|
31206
31218
|
]
|
|
31207
31219
|
}
|
|
@@ -31221,12 +31233,12 @@ var Entry = React8.memo(function Entry2({
|
|
|
31221
31233
|
"\u26A0 Confirm: ",
|
|
31222
31234
|
entry.toolName
|
|
31223
31235
|
] }),
|
|
31224
|
-
/* @__PURE__ */
|
|
31236
|
+
/* @__PURE__ */ jsx66(Text, { dimColor: true, children: "Waiting for y / n / a / d..." })
|
|
31225
31237
|
]
|
|
31226
31238
|
}
|
|
31227
31239
|
);
|
|
31228
31240
|
case "banner":
|
|
31229
|
-
return /* @__PURE__ */
|
|
31241
|
+
return /* @__PURE__ */ jsx66(
|
|
31230
31242
|
Banner,
|
|
31231
31243
|
{
|
|
31232
31244
|
entry,
|
|
@@ -31238,20 +31250,20 @@ var Entry = React8.memo(function Entry2({
|
|
|
31238
31250
|
const lines = entry.text.split("\n");
|
|
31239
31251
|
return /* @__PURE__ */ jsxs64(Box, { flexDirection: "column", marginX: 0, marginY: 0, paddingLeft: 0, children: [
|
|
31240
31252
|
/* @__PURE__ */ jsxs64(Text, { children: [
|
|
31241
|
-
/* @__PURE__ */
|
|
31242
|
-
/* @__PURE__ */
|
|
31243
|
-
/* @__PURE__ */
|
|
31244
|
-
/* @__PURE__ */
|
|
31245
|
-
/* @__PURE__ */
|
|
31246
|
-
/* @__PURE__ */
|
|
31253
|
+
/* @__PURE__ */ jsx66(Text, { color: theme.borderSubtle, children: "\u2502 " }),
|
|
31254
|
+
/* @__PURE__ */ jsx66(Text, { color: entry.agentColor, children: entry.icon }),
|
|
31255
|
+
/* @__PURE__ */ jsx66(Text, { children: " " }),
|
|
31256
|
+
/* @__PURE__ */ jsx66(Text, { bold: true, color: entry.agentColor, children: entry.agentLabel }),
|
|
31257
|
+
/* @__PURE__ */ jsx66(Text, { children: " " }),
|
|
31258
|
+
/* @__PURE__ */ jsx66(Text, { color: theme.textSecondary, children: lines[0] ?? "" }),
|
|
31247
31259
|
entry.detail ? /* @__PURE__ */ jsxs64(Fragment24, { children: [
|
|
31248
|
-
/* @__PURE__ */
|
|
31249
|
-
/* @__PURE__ */
|
|
31260
|
+
/* @__PURE__ */ jsx66(Text, { color: theme.textMuted, children: " \xB7 " }),
|
|
31261
|
+
/* @__PURE__ */ jsx66(Text, { color: theme.textMuted, children: entry.detail })
|
|
31250
31262
|
] }) : null
|
|
31251
31263
|
] }),
|
|
31252
31264
|
lines.slice(1).map((line, i) => /* @__PURE__ */ jsxs64(Text, { children: [
|
|
31253
|
-
/* @__PURE__ */
|
|
31254
|
-
/* @__PURE__ */
|
|
31265
|
+
/* @__PURE__ */ jsx66(Text, { color: theme.borderSubtle, children: "\u2502 " }),
|
|
31266
|
+
/* @__PURE__ */ jsx66(Text, { color: theme.textMuted, children: line })
|
|
31255
31267
|
] }, i))
|
|
31256
31268
|
] });
|
|
31257
31269
|
}
|
|
@@ -31259,7 +31271,7 @@ var Entry = React8.memo(function Entry2({
|
|
|
31259
31271
|
});
|
|
31260
31272
|
|
|
31261
31273
|
// src/components/history/index.tsx
|
|
31262
|
-
import { Fragment as Fragment25, jsx as
|
|
31274
|
+
import { Fragment as Fragment25, jsx as jsx67, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
31263
31275
|
var History = memo2(function History2({ entries, generation, toolStream, setSuggestions, autonomyMode, multiDiffSummaryThreshold, todos, showModelReasoning }) {
|
|
31264
31276
|
const { stdout } = useStdout();
|
|
31265
31277
|
const [termSize, setTermSize] = useState31({
|
|
@@ -31324,13 +31336,13 @@ var History = memo2(function History2({ entries, generation, toolStream, setSugg
|
|
|
31324
31336
|
const staticEntries = pendingEntries;
|
|
31325
31337
|
void toolStream;
|
|
31326
31338
|
return /* @__PURE__ */ jsxs65(Fragment25, { children: [
|
|
31327
|
-
/* @__PURE__ */
|
|
31328
|
-
/* @__PURE__ */
|
|
31339
|
+
/* @__PURE__ */ jsx67(Static, { items: staticEntries, children: (entry) => /* @__PURE__ */ jsx67(Box, { marginBottom: entry.kind === "turn-summary" ? 1 : 0, children: /* @__PURE__ */ jsx67(Entry, { entry, termWidth, termHeight: termSize.rows, setSuggestions, autonomyMode, multiDiffSummaryThreshold, todos, showModelReasoning }) }, entry.id) }, staticKey),
|
|
31340
|
+
/* @__PURE__ */ jsx67(Box, { flexGrow: 1 })
|
|
31329
31341
|
] });
|
|
31330
31342
|
});
|
|
31331
31343
|
|
|
31332
31344
|
// src/components/scrollable-history.tsx
|
|
31333
|
-
import { jsx as
|
|
31345
|
+
import { jsx as jsx68, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
31334
31346
|
function scrollbarThumb(rows, offset, total) {
|
|
31335
31347
|
const scrollable = total > rows;
|
|
31336
31348
|
if (!scrollable) return { top: 0, size: rows, scrollable: false };
|
|
@@ -31350,7 +31362,7 @@ function Scrollbar({
|
|
|
31350
31362
|
for (let i = 0; i < rows; i++) {
|
|
31351
31363
|
cells.push(i >= thumbTop && i < thumbTop + thumbSize ? "\u2588" : "\u2502");
|
|
31352
31364
|
}
|
|
31353
|
-
return /* @__PURE__ */
|
|
31365
|
+
return /* @__PURE__ */ jsx68(Box, { flexDirection: "column", marginLeft: 1, flexShrink: 0, children: cells.map((c, i) => /* @__PURE__ */ jsx68(
|
|
31354
31366
|
Text,
|
|
31355
31367
|
{
|
|
31356
31368
|
...scrollable ? { color: theme.accent } : {},
|
|
@@ -31401,7 +31413,9 @@ var ScrollableHistory = memo3(function ScrollableHistory2({
|
|
|
31401
31413
|
const groupIds = useMemo12(() => groupedEntries.map(renderGroupId), [groupedEntries]);
|
|
31402
31414
|
const groupIndexById = useMemo12(() => {
|
|
31403
31415
|
const map = /* @__PURE__ */ new Map();
|
|
31404
|
-
groupIds.forEach((id, index) =>
|
|
31416
|
+
groupIds.forEach((id, index) => {
|
|
31417
|
+
map.set(id, index);
|
|
31418
|
+
});
|
|
31405
31419
|
return map;
|
|
31406
31420
|
}, [groupIds]);
|
|
31407
31421
|
const groupIdsKey = groupIds.join(",");
|
|
@@ -31411,7 +31425,7 @@ var ScrollableHistory = memo3(function ScrollableHistory2({
|
|
|
31411
31425
|
const entryNodeRefs = useRef26(/* @__PURE__ */ new Map());
|
|
31412
31426
|
const preparedGroupIdsRef = useRef26(null);
|
|
31413
31427
|
const preparedEstimateWidthRef = useRef26(null);
|
|
31414
|
-
const cacheKey = layoutStore ? `${groupIdsKey}|w${termWidth}
|
|
31428
|
+
const cacheKey = layoutStore ? `${groupIdsKey}|w${termWidth}` : groupIdsKey;
|
|
31415
31429
|
if (preparedGroupIdsRef.current !== cacheKey || preparedEstimateWidthRef.current !== termWidth) {
|
|
31416
31430
|
heightCache.sync(groupIds);
|
|
31417
31431
|
if (layoutStore) {
|
|
@@ -31442,6 +31456,16 @@ var ScrollableHistory = memo3(function ScrollableHistory2({
|
|
|
31442
31456
|
const vp = Math.max(1, viewportRows);
|
|
31443
31457
|
const [anchor, setAnchor] = useState32(null);
|
|
31444
31458
|
const [mountBump, setMountBump] = useState32(0);
|
|
31459
|
+
const prevTermWidthRef = useRef26(termWidth);
|
|
31460
|
+
if (prevTermWidthRef.current !== termWidth) {
|
|
31461
|
+
prevTermWidthRef.current = termWidth;
|
|
31462
|
+
setMountBump(0);
|
|
31463
|
+
}
|
|
31464
|
+
const prevVpRef = useRef26(viewportRows);
|
|
31465
|
+
if (prevVpRef.current !== viewportRows) {
|
|
31466
|
+
prevVpRef.current = viewportRows;
|
|
31467
|
+
setMountBump(0);
|
|
31468
|
+
}
|
|
31445
31469
|
const [, setMeasureTick] = useState32(0);
|
|
31446
31470
|
const geometry = {
|
|
31447
31471
|
cache: heightCache,
|
|
@@ -31512,7 +31536,8 @@ var ScrollableHistory = memo3(function ScrollableHistory2({
|
|
|
31512
31536
|
lastReportedScrolled.current = scrolled;
|
|
31513
31537
|
onScrollInfoRef.current?.({ scrolled });
|
|
31514
31538
|
}, [scrolled]);
|
|
31515
|
-
const
|
|
31539
|
+
const bumpStep = Math.max(UNDERFILL_BUMP_ROWS, vp);
|
|
31540
|
+
const plan = effectiveAnchor ? planFromAnchor(geometry, effectiveAnchor, mountBump * bumpStep) : planPinned(geometry, mountBump * bumpStep);
|
|
31516
31541
|
const renderGroups = groupedEntries.slice(plan.startIdx, plan.endIdx);
|
|
31517
31542
|
const clip2 = effectiveAnchor?.clip ?? 0;
|
|
31518
31543
|
const totalRows = contentRows(geometry);
|
|
@@ -31528,7 +31553,7 @@ var ScrollableHistory = memo3(function ScrollableHistory2({
|
|
|
31528
31553
|
if (actual <= 0) continue;
|
|
31529
31554
|
if (heightCache.getHeight(gid) !== actual) {
|
|
31530
31555
|
heightCache.record(gid, actual);
|
|
31531
|
-
layoutStore?.markMeasured(gid, actual);
|
|
31556
|
+
layoutStore?.markMeasured(gid, actual, termWidth);
|
|
31532
31557
|
changed = true;
|
|
31533
31558
|
}
|
|
31534
31559
|
}
|
|
@@ -31578,7 +31603,7 @@ var ScrollableHistory = memo3(function ScrollableHistory2({
|
|
|
31578
31603
|
if (changed) setMeasureTick((tick) => tick + 1);
|
|
31579
31604
|
});
|
|
31580
31605
|
return /* @__PURE__ */ jsxs66(Box, { flexDirection: "row", width: viewportWidth, children: [
|
|
31581
|
-
/* @__PURE__ */
|
|
31606
|
+
/* @__PURE__ */ jsx68(
|
|
31582
31607
|
Box,
|
|
31583
31608
|
{
|
|
31584
31609
|
flexDirection: "column",
|
|
@@ -31600,33 +31625,40 @@ var ScrollableHistory = memo3(function ScrollableHistory2({
|
|
|
31600
31625
|
else entryNodeRefs.current.delete(gid);
|
|
31601
31626
|
};
|
|
31602
31627
|
if (group.type === "tool-group") {
|
|
31603
|
-
return /* @__PURE__ */
|
|
31628
|
+
return /* @__PURE__ */ jsx68(Box, { ref: setNode, flexShrink: 0, children: /* @__PURE__ */ jsx68(EntryErrorBoundary, { label: "tool group", resetKey: group.data.entries.length, children: /* @__PURE__ */ jsx68(ToolGroup, { data: group.data, termWidth }) }) }, `tool-group-${gid}`);
|
|
31604
31629
|
}
|
|
31605
31630
|
const { entry } = group;
|
|
31606
|
-
return /* @__PURE__ */
|
|
31631
|
+
return /* @__PURE__ */ jsx68(
|
|
31607
31632
|
Box,
|
|
31608
31633
|
{
|
|
31609
31634
|
ref: setNode,
|
|
31610
31635
|
marginBottom: entry.kind === "turn-summary" ? 1 : 0,
|
|
31611
31636
|
flexShrink: 0,
|
|
31612
|
-
children: /* @__PURE__ */
|
|
31613
|
-
|
|
31637
|
+
children: /* @__PURE__ */ jsx68(
|
|
31638
|
+
EntryErrorBoundary,
|
|
31614
31639
|
{
|
|
31615
|
-
entry,
|
|
31616
|
-
|
|
31617
|
-
|
|
31618
|
-
|
|
31619
|
-
|
|
31620
|
-
|
|
31621
|
-
|
|
31622
|
-
|
|
31640
|
+
label: entry.kind,
|
|
31641
|
+
resetKey: entry.kind === "tool" ? entry.output?.length ?? 0 : "text" in entry ? entry.text.length : 0,
|
|
31642
|
+
children: /* @__PURE__ */ jsx68(
|
|
31643
|
+
Entry,
|
|
31644
|
+
{
|
|
31645
|
+
entry,
|
|
31646
|
+
termWidth,
|
|
31647
|
+
termHeight: vp,
|
|
31648
|
+
setSuggestions,
|
|
31649
|
+
autonomyMode,
|
|
31650
|
+
multiDiffSummaryThreshold,
|
|
31651
|
+
todos,
|
|
31652
|
+
showModelReasoning
|
|
31653
|
+
}
|
|
31654
|
+
)
|
|
31623
31655
|
}
|
|
31624
31656
|
)
|
|
31625
31657
|
},
|
|
31626
31658
|
entry.id
|
|
31627
31659
|
);
|
|
31628
31660
|
}),
|
|
31629
|
-
plan.mountTail && toolTail && toolStream ? /* @__PURE__ */
|
|
31661
|
+
plan.mountTail && toolTail && toolStream ? /* @__PURE__ */ jsx68(
|
|
31630
31662
|
ToolStreamBox,
|
|
31631
31663
|
{
|
|
31632
31664
|
name: toolStream.name,
|
|
@@ -31640,44 +31672,44 @@ var ScrollableHistory = memo3(function ScrollableHistory2({
|
|
|
31640
31672
|
)
|
|
31641
31673
|
}
|
|
31642
31674
|
),
|
|
31643
|
-
/* @__PURE__ */
|
|
31675
|
+
/* @__PURE__ */ jsx68(Scrollbar, { rows: vp, offset: offsetFromBottom, total: totalRows })
|
|
31644
31676
|
] });
|
|
31645
31677
|
});
|
|
31646
31678
|
|
|
31647
31679
|
// src/components/shadow-panel.tsx
|
|
31648
|
-
import { jsx as
|
|
31680
|
+
import { jsx as jsx69, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
31649
31681
|
function ShadowPanel({
|
|
31650
31682
|
shadow,
|
|
31651
31683
|
hint
|
|
31652
31684
|
}) {
|
|
31653
31685
|
return /* @__PURE__ */ jsxs67(Box, { flexDirection: "column", borderStyle: "round", borderColor: "blue", paddingX: 1, children: [
|
|
31654
|
-
/* @__PURE__ */
|
|
31655
|
-
/* @__PURE__ */
|
|
31686
|
+
/* @__PURE__ */ jsx69(Text, { bold: true, color: "blue", children: "\u2501\u2501 Shadow Agent \u2501\u2501" }),
|
|
31687
|
+
/* @__PURE__ */ jsx69(Text, { dimColor: true, children: "s start \xB7 t stop \xB7 i cycle interval \xB7 m cycle model \xB7 Esc close" }),
|
|
31656
31688
|
/* @__PURE__ */ jsxs67(Box, { marginTop: 1, flexDirection: "column", children: [
|
|
31657
31689
|
/* @__PURE__ */ jsxs67(Box, { children: [
|
|
31658
|
-
/* @__PURE__ */
|
|
31659
|
-
shadow.running ? /* @__PURE__ */
|
|
31660
|
-
shadow.activeId ? /* @__PURE__ */
|
|
31690
|
+
/* @__PURE__ */ jsx69(Text, { bold: true, children: "Status: " }),
|
|
31691
|
+
shadow.running ? /* @__PURE__ */ jsx69(Text, { color: "green", children: "\u25CF running" }) : /* @__PURE__ */ jsx69(Text, { color: "gray", children: "\u25CB stopped" }),
|
|
31692
|
+
shadow.activeId ? /* @__PURE__ */ jsx69(Text, { dimColor: true, children: ` ${shadow.activeId.slice(0, 12)}\u2026` }) : null
|
|
31661
31693
|
] }),
|
|
31662
31694
|
/* @__PURE__ */ jsxs67(Box, { marginTop: 1, children: [
|
|
31663
|
-
/* @__PURE__ */
|
|
31664
|
-
/* @__PURE__ */
|
|
31695
|
+
/* @__PURE__ */ jsx69(Text, { bold: true, children: "Model: " }),
|
|
31696
|
+
/* @__PURE__ */ jsx69(Text, { color: "cyan", children: shadow.model })
|
|
31665
31697
|
] }),
|
|
31666
31698
|
/* @__PURE__ */ jsxs67(Box, { marginTop: 1, children: [
|
|
31667
|
-
/* @__PURE__ */
|
|
31668
|
-
/* @__PURE__ */
|
|
31669
|
-
/* @__PURE__ */
|
|
31699
|
+
/* @__PURE__ */ jsx69(Text, { bold: true, children: "Interval: " }),
|
|
31700
|
+
/* @__PURE__ */ jsx69(Text, { color: "yellow", children: shadow.intervalMs >= 1e3 ? `${shadow.intervalMs / 1e3}s` : `${shadow.intervalMs}ms` }),
|
|
31701
|
+
/* @__PURE__ */ jsx69(Text, { dimColor: true, children: " (min 5s)" })
|
|
31670
31702
|
] }),
|
|
31671
|
-
/* @__PURE__ */
|
|
31703
|
+
/* @__PURE__ */ jsx69(Box, { marginTop: 1, children: /* @__PURE__ */ jsx69(Text, { dimColor: true, children: shadow.running ? "Press t to stop the Shadow Agent" : "Press s to start the Shadow Agent" }) })
|
|
31672
31704
|
] }),
|
|
31673
|
-
hint ? /* @__PURE__ */
|
|
31705
|
+
hint ? /* @__PURE__ */ jsx69(Box, { marginTop: 1, children: /* @__PURE__ */ jsx69(Text, { dimColor: true, children: hint }) }) : null
|
|
31674
31706
|
] });
|
|
31675
31707
|
}
|
|
31676
31708
|
|
|
31677
31709
|
// src/components/shell-command-warning.tsx
|
|
31678
31710
|
import { writeOut as writeOut3 } from "@wrongstack/core/utils";
|
|
31679
31711
|
import React9 from "react";
|
|
31680
|
-
import { jsx as
|
|
31712
|
+
import { jsx as jsx70, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
31681
31713
|
function truncateShellCommandWarningCommand(text, max = 80) {
|
|
31682
31714
|
return text.length <= max ? text : `${text.slice(0, max - 1)}\u2026`;
|
|
31683
31715
|
}
|
|
@@ -31697,28 +31729,28 @@ function ShellCommandWarning({
|
|
|
31697
31729
|
});
|
|
31698
31730
|
return /* @__PURE__ */ jsxs68(Box, { flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 1, children: [
|
|
31699
31731
|
/* @__PURE__ */ jsxs68(Box, { flexDirection: "row", children: [
|
|
31700
|
-
/* @__PURE__ */
|
|
31701
|
-
/* @__PURE__ */
|
|
31732
|
+
/* @__PURE__ */ jsx70(Text, { bold: true, color: "yellow", children: "\u26A0 SHELL COMMAND" }),
|
|
31733
|
+
/* @__PURE__ */ jsx70(Text, { children: " " }),
|
|
31702
31734
|
/* @__PURE__ */ jsxs68(Text, { bold: true, color: "white", children: [
|
|
31703
31735
|
"!",
|
|
31704
31736
|
truncateShellCommandWarningCommand(command)
|
|
31705
31737
|
] })
|
|
31706
31738
|
] }),
|
|
31707
|
-
/* @__PURE__ */
|
|
31708
|
-
/* @__PURE__ */
|
|
31709
|
-
/* @__PURE__ */
|
|
31710
|
-
/* @__PURE__ */
|
|
31711
|
-
/* @__PURE__ */
|
|
31712
|
-
/* @__PURE__ */
|
|
31713
|
-
/* @__PURE__ */
|
|
31714
|
-
/* @__PURE__ */
|
|
31715
|
-
/* @__PURE__ */
|
|
31739
|
+
/* @__PURE__ */ jsx70(Text, { dimColor: true, children: "This will execute in your shell via /dev. Only run commands you trust." }),
|
|
31740
|
+
/* @__PURE__ */ jsx70(Text, { dimColor: true, children: "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500" }),
|
|
31741
|
+
/* @__PURE__ */ jsx70(Box, { flexDirection: "row", children: /* @__PURE__ */ jsxs68(Text, { children: [
|
|
31742
|
+
/* @__PURE__ */ jsx70(Text, { bold: true, color: "green", children: "[y]" }),
|
|
31743
|
+
/* @__PURE__ */ jsx70(Text, { dimColor: true, children: "es " }),
|
|
31744
|
+
/* @__PURE__ */ jsx70(Text, { bold: true, color: "red", children: "[n]" }),
|
|
31745
|
+
/* @__PURE__ */ jsx70(Text, { dimColor: true, children: "o " }),
|
|
31746
|
+
/* @__PURE__ */ jsx70(Text, { bold: true, color: "cyan", children: "[d]" }),
|
|
31747
|
+
/* @__PURE__ */ jsx70(Text, { dimColor: true, children: "ont show again" })
|
|
31716
31748
|
] }) })
|
|
31717
31749
|
] });
|
|
31718
31750
|
}
|
|
31719
31751
|
|
|
31720
31752
|
// src/components/slash-confirm-panel.tsx
|
|
31721
|
-
import { jsx as
|
|
31753
|
+
import { jsx as jsx71, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
31722
31754
|
function slashConfirmationDecision(input, key, defaultYes) {
|
|
31723
31755
|
if (key.escape) return "cancel";
|
|
31724
31756
|
if (key.return) return defaultYes;
|
|
@@ -31733,27 +31765,27 @@ function SlashConfirmPanel({
|
|
|
31733
31765
|
defaultYes
|
|
31734
31766
|
}) {
|
|
31735
31767
|
return /* @__PURE__ */ jsxs69(Box, { flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 1, marginY: 1, children: [
|
|
31736
|
-
/* @__PURE__ */
|
|
31737
|
-
/* @__PURE__ */
|
|
31738
|
-
/* @__PURE__ */
|
|
31739
|
-
/* @__PURE__ */
|
|
31768
|
+
/* @__PURE__ */ jsx71(Text, { bold: true, color: "yellow", children: "? CONFIRM ACTION" }),
|
|
31769
|
+
/* @__PURE__ */ jsx71(Box, { marginTop: 1, children: /* @__PURE__ */ jsx71(Text, { children: question }) }),
|
|
31770
|
+
/* @__PURE__ */ jsx71(Box, { marginTop: 1, children: /* @__PURE__ */ jsxs69(Text, { children: [
|
|
31771
|
+
/* @__PURE__ */ jsx71(Text, { bold: true, color: "green", children: "[y]" }),
|
|
31740
31772
|
"es",
|
|
31741
31773
|
" ",
|
|
31742
|
-
/* @__PURE__ */
|
|
31774
|
+
/* @__PURE__ */ jsx71(Text, { bold: true, color: "red", children: "[n]" }),
|
|
31743
31775
|
"o",
|
|
31744
31776
|
" ",
|
|
31745
|
-
/* @__PURE__ */
|
|
31777
|
+
/* @__PURE__ */ jsx71(Text, { bold: true, children: "Enter" }),
|
|
31746
31778
|
" = ",
|
|
31747
31779
|
defaultYes ? "yes" : "no",
|
|
31748
31780
|
" ",
|
|
31749
|
-
/* @__PURE__ */
|
|
31781
|
+
/* @__PURE__ */ jsx71(Text, { bold: true, children: "Esc/q" }),
|
|
31750
31782
|
" = cancel"
|
|
31751
31783
|
] }) })
|
|
31752
31784
|
] });
|
|
31753
31785
|
}
|
|
31754
31786
|
|
|
31755
31787
|
// src/components/slash-menu.tsx
|
|
31756
|
-
import { jsx as
|
|
31788
|
+
import { jsx as jsx72, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
31757
31789
|
var MAX_VISIBLE_ITEMS = 8;
|
|
31758
31790
|
function SlashMenu({ query, matches, selected }) {
|
|
31759
31791
|
const placeholder2 = query ? `/${query}` : "/";
|
|
@@ -31775,7 +31807,7 @@ function SlashMenu({ query, matches, selected }) {
|
|
|
31775
31807
|
return /* @__PURE__ */ jsxs70(Box, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
|
|
31776
31808
|
/* @__PURE__ */ jsxs70(Text, { bold: true, color: "cyan", children: [
|
|
31777
31809
|
"\u2501\u2501 Command palette \u2501\u2501 ",
|
|
31778
|
-
/* @__PURE__ */
|
|
31810
|
+
/* @__PURE__ */ jsx72(Text, { dimColor: true, children: placeholder2 }),
|
|
31779
31811
|
" ",
|
|
31780
31812
|
/* @__PURE__ */ jsxs70(Text, { dimColor: true, children: [
|
|
31781
31813
|
"(",
|
|
@@ -31783,7 +31815,7 @@ function SlashMenu({ query, matches, selected }) {
|
|
|
31783
31815
|
")"
|
|
31784
31816
|
] })
|
|
31785
31817
|
] }),
|
|
31786
|
-
/* @__PURE__ */
|
|
31818
|
+
/* @__PURE__ */ jsx72(Text, { dimColor: true, children: "Type to filter commands by name, alias, or description." }),
|
|
31787
31819
|
hiddenAbove > 0 && /* @__PURE__ */ jsxs70(Text, { dimColor: true, children: [
|
|
31788
31820
|
" \u2191 ",
|
|
31789
31821
|
hiddenAbove,
|
|
@@ -31803,7 +31835,7 @@ function SlashMenu({ query, matches, selected }) {
|
|
|
31803
31835
|
const { match: m, index: i } = row;
|
|
31804
31836
|
return /* @__PURE__ */ jsxs70(Text, { inverse: i === selected, ...i === selected ? { color: "cyan" } : {}, children: [
|
|
31805
31837
|
i === selected ? "\u203A " : " ",
|
|
31806
|
-
/* @__PURE__ */
|
|
31838
|
+
/* @__PURE__ */ jsx72(Text, { bold: true, children: m.name }),
|
|
31807
31839
|
m.argsHint ? /* @__PURE__ */ jsxs70(Text, { dimColor: true, children: [
|
|
31808
31840
|
" ",
|
|
31809
31841
|
m.argsHint
|
|
@@ -31823,8 +31855,8 @@ function SlashMenu({ query, matches, selected }) {
|
|
|
31823
31855
|
hiddenBelow,
|
|
31824
31856
|
" more"
|
|
31825
31857
|
] }),
|
|
31826
|
-
matches.length === 0 && /* @__PURE__ */
|
|
31827
|
-
/* @__PURE__ */
|
|
31858
|
+
matches.length === 0 && /* @__PURE__ */ jsx72(Text, { dimColor: true, children: "No matching commands" }),
|
|
31859
|
+
/* @__PURE__ */ jsx72(Text, { dimColor: true, children: "\u2500\u2500\u2500 \u2191\u2193 nav \xB7 Enter run \xB7 Tab fill \xB7 Esc close" })
|
|
31828
31860
|
] });
|
|
31829
31861
|
}
|
|
31830
31862
|
function windowRows2(rows, focus, max) {
|
|
@@ -31855,17 +31887,17 @@ function windowRows2(rows, focus, max) {
|
|
|
31855
31887
|
}
|
|
31856
31888
|
|
|
31857
31889
|
// src/components/tools-picker.tsx
|
|
31858
|
-
import { Fragment as Fragment26, jsx as
|
|
31890
|
+
import { Fragment as Fragment26, jsx as jsx73, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
31859
31891
|
var CHROME_ROWS6 = 15;
|
|
31860
31892
|
var MAX_PICKER_ITEMS2 = 15;
|
|
31861
31893
|
function toolActionLabel(enabled) {
|
|
31862
31894
|
return enabled ? "Enter makes this tool passive" : "Enter re-enables this tool";
|
|
31863
31895
|
}
|
|
31864
31896
|
function statusBadge2(enabled) {
|
|
31865
|
-
return enabled ? /* @__PURE__ */
|
|
31897
|
+
return enabled ? /* @__PURE__ */ jsx73(Text, { color: "green", children: "\u25CF active" }) : /* @__PURE__ */ jsx73(Text, { color: "red", children: "\u25CB passive" });
|
|
31866
31898
|
}
|
|
31867
31899
|
function rwBadge(mutating) {
|
|
31868
|
-
return mutating ? /* @__PURE__ */
|
|
31900
|
+
return mutating ? /* @__PURE__ */ jsx73(Text, { color: "yellow", children: "mut" }) : /* @__PURE__ */ jsx73(Text, { color: "cyan", children: "ro" });
|
|
31869
31901
|
}
|
|
31870
31902
|
function displayCategory(cat) {
|
|
31871
31903
|
if (!cat || cat.trim() === "") return "Other";
|
|
@@ -31959,24 +31991,21 @@ function ToolsPicker({
|
|
|
31959
31991
|
const enabledCount = items.filter((item) => item.enabled).length;
|
|
31960
31992
|
const passiveCount = total - enabledCount;
|
|
31961
31993
|
const selectedItem = visibleItems[visibleSelected];
|
|
31962
|
-
let displayRows;
|
|
31963
|
-
let hiddenAbove = 0;
|
|
31964
|
-
let hiddenBelow = 0;
|
|
31965
31994
|
const win = windowRows3(rows, visibleSelected, maxVisible);
|
|
31966
|
-
displayRows = win.rows;
|
|
31967
|
-
hiddenAbove = win.start;
|
|
31968
|
-
hiddenBelow = rows.length - win.end;
|
|
31995
|
+
const displayRows = win.rows;
|
|
31996
|
+
const hiddenAbove = win.start;
|
|
31997
|
+
const hiddenBelow = rows.length - win.end;
|
|
31969
31998
|
const hasFilter = filterActive;
|
|
31970
31999
|
return /* @__PURE__ */ jsxs71(Box, { flexDirection: "column", borderStyle: "round", borderColor: "green", paddingX: 1, children: [
|
|
31971
|
-
/* @__PURE__ */
|
|
31972
|
-
/* @__PURE__ */
|
|
31973
|
-
/* @__PURE__ */
|
|
31974
|
-
/* @__PURE__ */
|
|
32000
|
+
/* @__PURE__ */ jsx73(Text, { bold: true, color: "green", children: "\u2501\u2501 Tools \u2501\u2501" }),
|
|
32001
|
+
/* @__PURE__ */ jsx73(Text, { dimColor: true, children: hasFilter ? `Filter: ${filter} (${visibleItems.length} match${visibleItems.length === 1 ? "" : "es"}) \xB7 Backspace edit \xB7 Esc clear` : `\u2191/\u2193 select \xB7 type to filter \xB7 Enter toggles \xB7 Esc close \xB7 ${enabledCount} active / ${passiveCount} passive` }),
|
|
32002
|
+
/* @__PURE__ */ jsx73(Text, { dimColor: true, children: "Passive tools stay listed for this session so you can select them and re-enable them later." }),
|
|
32003
|
+
/* @__PURE__ */ jsx73(Box, { marginTop: 1, flexDirection: "column", children: total === 0 ? /* @__PURE__ */ jsx73(Text, { dimColor: true, children: busy ? "Loading tools\u2026" : "No tools registered." }) : visibleItems.length === 0 ? /* @__PURE__ */ jsxs71(Text, { dimColor: true, children: [
|
|
31975
32004
|
'No tools match "',
|
|
31976
32005
|
filter,
|
|
31977
32006
|
'".'
|
|
31978
32007
|
] }) : /* @__PURE__ */ jsxs71(Fragment26, { children: [
|
|
31979
|
-
hiddenAbove > 0 ? /* @__PURE__ */
|
|
32008
|
+
hiddenAbove > 0 ? /* @__PURE__ */ jsx73(Text, { dimColor: true, children: ` \u2191 ${hiddenAbove} more` }) : null,
|
|
31980
32009
|
displayRows.map(({ item, index }) => {
|
|
31981
32010
|
const focused = index === visibleSelected;
|
|
31982
32011
|
return /* @__PURE__ */ jsxs71(
|
|
@@ -31989,7 +32018,7 @@ function ToolsPicker({
|
|
|
31989
32018
|
focused ? "\u203A " : " ",
|
|
31990
32019
|
statusBadge2(item.enabled),
|
|
31991
32020
|
" ",
|
|
31992
|
-
/* @__PURE__ */
|
|
32021
|
+
/* @__PURE__ */ jsx73(Text, { bold: true, children: fitCell(item.name, columnWidths.name) }),
|
|
31993
32022
|
" ",
|
|
31994
32023
|
/* @__PURE__ */ jsxs71(Text, { dimColor: true, children: [
|
|
31995
32024
|
fitCell(displayCategory(item.category), columnWidths.category),
|
|
@@ -32011,21 +32040,21 @@ function ToolsPicker({
|
|
|
32011
32040
|
item.name
|
|
32012
32041
|
);
|
|
32013
32042
|
}),
|
|
32014
|
-
hiddenBelow > 0 ? /* @__PURE__ */
|
|
32043
|
+
hiddenBelow > 0 ? /* @__PURE__ */ jsx73(Text, { dimColor: true, children: ` \u2193 ${hiddenBelow} more` }) : null
|
|
32015
32044
|
] }) }),
|
|
32016
32045
|
selectedItem ? /* @__PURE__ */ jsxs71(Box, { marginTop: 1, flexDirection: "column", children: [
|
|
32017
32046
|
/* @__PURE__ */ jsxs71(Text, { children: [
|
|
32018
|
-
/* @__PURE__ */
|
|
32019
|
-
/* @__PURE__ */
|
|
32047
|
+
/* @__PURE__ */ jsx73(Text, { color: selectedItem.enabled ? "green" : "red", children: toolActionLabel(selectedItem.enabled) }),
|
|
32048
|
+
/* @__PURE__ */ jsx73(Text, { dimColor: true, children: ` \xB7 ${selectedItem.mutating ? "Mutating" : "Read-only"} \xB7 permission: ${selectedItem.permission} \xB7 descriptions: ${selectedItem.descMode}` })
|
|
32020
32049
|
] }),
|
|
32021
|
-
/* @__PURE__ */
|
|
32050
|
+
/* @__PURE__ */ jsx73(Text, { dimColor: true, wrap: "truncate-end", children: selectedItem.description || "No description provided." })
|
|
32022
32051
|
] }) : null,
|
|
32023
|
-
hint ? /* @__PURE__ */
|
|
32052
|
+
hint ? /* @__PURE__ */ jsx73(Box, { marginTop: 1, children: /* @__PURE__ */ jsx73(Text, { dimColor: true, children: hint }) }) : null
|
|
32024
32053
|
] });
|
|
32025
32054
|
}
|
|
32026
32055
|
|
|
32027
32056
|
// src/app-view.tsx
|
|
32028
|
-
import { jsx as
|
|
32057
|
+
import { jsx as jsx74, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
32029
32058
|
var CONTINUE_CONFIRM_DELAY_MS = 4e3;
|
|
32030
32059
|
var INPUT_PROMPT = DEFAULT_INPUT_PROMPT;
|
|
32031
32060
|
function AppView({ host, runtime }) {
|
|
@@ -32094,7 +32123,7 @@ function AppView({ host, runtime }) {
|
|
|
32094
32123
|
the history box (Ink-7: flex-end clips top), so a freshly-opened picker
|
|
32095
32124
|
or grown input is fully visible immediately while history briefly loses
|
|
32096
32125
|
its top rows until the viewport re-measures. */
|
|
32097
|
-
/* @__PURE__ */
|
|
32126
|
+
/* @__PURE__ */ jsx74(
|
|
32098
32127
|
Box,
|
|
32099
32128
|
{
|
|
32100
32129
|
flexDirection: "column",
|
|
@@ -32102,7 +32131,7 @@ function AppView({ host, runtime }) {
|
|
|
32102
32131
|
overflowY: "hidden",
|
|
32103
32132
|
justifyContent: "flex-end",
|
|
32104
32133
|
children: /* @__PURE__ */ jsxs72(Box, { flexDirection: "column", flexShrink: 0, children: [
|
|
32105
|
-
/* @__PURE__ */
|
|
32134
|
+
/* @__PURE__ */ jsx74(
|
|
32106
32135
|
ScrollableHistory,
|
|
32107
32136
|
{
|
|
32108
32137
|
entries: state.entries,
|
|
@@ -32119,7 +32148,7 @@ function AppView({ host, runtime }) {
|
|
|
32119
32148
|
}
|
|
32120
32149
|
),
|
|
32121
32150
|
/* @__PURE__ */ jsxs72(Box, { flexDirection: "column", flexShrink: 0, ref: bottomRegionRef, children: [
|
|
32122
|
-
/* @__PURE__ */
|
|
32151
|
+
/* @__PURE__ */ jsx74(
|
|
32123
32152
|
Input,
|
|
32124
32153
|
{
|
|
32125
32154
|
prompt: INPUT_PROMPT,
|
|
@@ -32136,7 +32165,7 @@ function AppView({ host, runtime }) {
|
|
|
32136
32165
|
workingTime: workingTimeMs
|
|
32137
32166
|
}
|
|
32138
32167
|
),
|
|
32139
|
-
state.picker.open ? /* @__PURE__ */
|
|
32168
|
+
state.picker.open ? /* @__PURE__ */ jsx74(
|
|
32140
32169
|
FilePicker,
|
|
32141
32170
|
{
|
|
32142
32171
|
query: state.picker.query,
|
|
@@ -32144,7 +32173,7 @@ function AppView({ host, runtime }) {
|
|
|
32144
32173
|
selected: state.picker.selected
|
|
32145
32174
|
}
|
|
32146
32175
|
) : null,
|
|
32147
|
-
state.slashPicker.open ? /* @__PURE__ */
|
|
32176
|
+
state.slashPicker.open ? /* @__PURE__ */ jsx74(
|
|
32148
32177
|
SlashMenu,
|
|
32149
32178
|
{
|
|
32150
32179
|
query: state.slashPicker.query,
|
|
@@ -32152,7 +32181,7 @@ function AppView({ host, runtime }) {
|
|
|
32152
32181
|
selected: state.slashPicker.selected
|
|
32153
32182
|
}
|
|
32154
32183
|
) : null,
|
|
32155
|
-
state.modelPicker.open ? /* @__PURE__ */
|
|
32184
|
+
state.modelPicker.open ? /* @__PURE__ */ jsx74(
|
|
32156
32185
|
ModelPicker,
|
|
32157
32186
|
{
|
|
32158
32187
|
step: state.modelPicker.step,
|
|
@@ -32166,7 +32195,7 @@ function AppView({ host, runtime }) {
|
|
|
32166
32195
|
titleLabel: state.modelPicker.title
|
|
32167
32196
|
}
|
|
32168
32197
|
) : null,
|
|
32169
|
-
state.autonomyPicker.open ? /* @__PURE__ */
|
|
32198
|
+
state.autonomyPicker.open ? /* @__PURE__ */ jsx74(
|
|
32170
32199
|
AutonomyPicker,
|
|
32171
32200
|
{
|
|
32172
32201
|
options: state.autonomyPicker.options,
|
|
@@ -32174,7 +32203,7 @@ function AppView({ host, runtime }) {
|
|
|
32174
32203
|
hint: state.autonomyPicker.hint
|
|
32175
32204
|
}
|
|
32176
32205
|
) : null,
|
|
32177
|
-
state.modePicker.open ? /* @__PURE__ */
|
|
32206
|
+
state.modePicker.open ? /* @__PURE__ */ jsx74(
|
|
32178
32207
|
ModePicker,
|
|
32179
32208
|
{
|
|
32180
32209
|
modes: state.modePicker.modes,
|
|
@@ -32182,7 +32211,7 @@ function AppView({ host, runtime }) {
|
|
|
32182
32211
|
hint: state.modePicker.hint
|
|
32183
32212
|
}
|
|
32184
32213
|
) : null,
|
|
32185
|
-
state.designPicker.open ? /* @__PURE__ */
|
|
32214
|
+
state.designPicker.open ? /* @__PURE__ */ jsx74(
|
|
32186
32215
|
DesignPicker,
|
|
32187
32216
|
{
|
|
32188
32217
|
kits: state.designPicker.kits,
|
|
@@ -32190,7 +32219,7 @@ function AppView({ host, runtime }) {
|
|
|
32190
32219
|
stack: state.designPicker.stack
|
|
32191
32220
|
}
|
|
32192
32221
|
) : null,
|
|
32193
|
-
state.promptPicker.open ? /* @__PURE__ */
|
|
32222
|
+
state.promptPicker.open ? /* @__PURE__ */ jsx74(
|
|
32194
32223
|
PromptPicker,
|
|
32195
32224
|
{
|
|
32196
32225
|
entries: filterPromptPicker(
|
|
@@ -32204,7 +32233,7 @@ function AppView({ host, runtime }) {
|
|
|
32204
32233
|
total: state.promptPicker.all.length
|
|
32205
32234
|
}
|
|
32206
32235
|
) : null,
|
|
32207
|
-
state.resumePicker.open ? /* @__PURE__ */
|
|
32236
|
+
state.resumePicker.open ? /* @__PURE__ */ jsx74(
|
|
32208
32237
|
ResumePicker,
|
|
32209
32238
|
{
|
|
32210
32239
|
sessions: state.resumePicker.sessions,
|
|
@@ -32214,7 +32243,7 @@ function AppView({ host, runtime }) {
|
|
|
32214
32243
|
hint: state.resumePicker.hint
|
|
32215
32244
|
}
|
|
32216
32245
|
) : null,
|
|
32217
|
-
state.settingsPicker.open ? /* @__PURE__ */
|
|
32246
|
+
state.settingsPicker.open ? /* @__PURE__ */ jsx74(
|
|
32218
32247
|
SettingsPicker,
|
|
32219
32248
|
{
|
|
32220
32249
|
field: state.settingsPicker.field,
|
|
@@ -32266,7 +32295,7 @@ function AppView({ host, runtime }) {
|
|
|
32266
32295
|
hint: state.settingsPicker.hint
|
|
32267
32296
|
}
|
|
32268
32297
|
) : null,
|
|
32269
|
-
state.statuslinePicker.open ? /* @__PURE__ */
|
|
32298
|
+
state.statuslinePicker.open ? /* @__PURE__ */ jsx74(
|
|
32270
32299
|
StatuslinePicker,
|
|
32271
32300
|
{
|
|
32272
32301
|
field: state.statuslinePicker.field,
|
|
@@ -32275,7 +32304,7 @@ function AppView({ host, runtime }) {
|
|
|
32275
32304
|
hint: state.statuslinePicker.hint
|
|
32276
32305
|
}
|
|
32277
32306
|
) : null,
|
|
32278
|
-
state.pluginPicker.open ? /* @__PURE__ */
|
|
32307
|
+
state.pluginPicker.open ? /* @__PURE__ */ jsx74(
|
|
32279
32308
|
PluginPicker,
|
|
32280
32309
|
{
|
|
32281
32310
|
items: state.pluginPicker.items,
|
|
@@ -32284,7 +32313,7 @@ function AppView({ host, runtime }) {
|
|
|
32284
32313
|
hint: state.pluginPicker.hint
|
|
32285
32314
|
}
|
|
32286
32315
|
) : null,
|
|
32287
|
-
state.mcpPicker.open ? /* @__PURE__ */
|
|
32316
|
+
state.mcpPicker.open ? /* @__PURE__ */ jsx74(
|
|
32288
32317
|
McpPicker,
|
|
32289
32318
|
{
|
|
32290
32319
|
items: state.mcpPicker.items,
|
|
@@ -32293,7 +32322,7 @@ function AppView({ host, runtime }) {
|
|
|
32293
32322
|
hint: state.mcpPicker.hint
|
|
32294
32323
|
}
|
|
32295
32324
|
) : null,
|
|
32296
|
-
state.toolsPicker.open ? /* @__PURE__ */
|
|
32325
|
+
state.toolsPicker.open ? /* @__PURE__ */ jsx74(
|
|
32297
32326
|
ToolsPicker,
|
|
32298
32327
|
{
|
|
32299
32328
|
items: state.toolsPicker.items,
|
|
@@ -32303,8 +32332,8 @@ function AppView({ host, runtime }) {
|
|
|
32303
32332
|
filter: state.toolsPicker.filter
|
|
32304
32333
|
}
|
|
32305
32334
|
) : null,
|
|
32306
|
-
state.brainPanel.open && !state.modelPicker.open ? /* @__PURE__ */
|
|
32307
|
-
state.helpPanel.open ? /* @__PURE__ */
|
|
32335
|
+
state.brainPanel.open && !state.modelPicker.open ? /* @__PURE__ */ jsx74(BrainPanel, { ...state.brainPanel }) : null,
|
|
32336
|
+
state.helpPanel.open ? /* @__PURE__ */ jsx74(
|
|
32308
32337
|
HelpPanel,
|
|
32309
32338
|
{
|
|
32310
32339
|
entries: state.helpPanel.entries,
|
|
@@ -32313,9 +32342,9 @@ function AppView({ host, runtime }) {
|
|
|
32313
32342
|
hint: state.helpPanel.hint
|
|
32314
32343
|
}
|
|
32315
32344
|
) : null,
|
|
32316
|
-
state.shadowPanel.open ? /* @__PURE__ */
|
|
32317
|
-
state.authPanel.open ? /* @__PURE__ */
|
|
32318
|
-
state.projectPicker.open ? /* @__PURE__ */
|
|
32345
|
+
state.shadowPanel.open ? /* @__PURE__ */ jsx74(ShadowPanel, { shadow: state.shadowPanel.shadow, hint: state.shadowPanel.hint }) : null,
|
|
32346
|
+
state.authPanel.open ? /* @__PURE__ */ jsx74(AuthPanel, { panel: state.authPanel }) : null,
|
|
32347
|
+
state.projectPicker.open ? /* @__PURE__ */ jsx74(
|
|
32319
32348
|
ProjectPicker,
|
|
32320
32349
|
{
|
|
32321
32350
|
items: state.projectPicker.items,
|
|
@@ -32324,8 +32353,8 @@ function AppView({ host, runtime }) {
|
|
|
32324
32353
|
hint: state.projectPicker.hint
|
|
32325
32354
|
}
|
|
32326
32355
|
) : null,
|
|
32327
|
-
state.fKeyPicker.open ? /* @__PURE__ */
|
|
32328
|
-
state.coordinator.monitorOpen ? /* @__PURE__ */
|
|
32356
|
+
state.fKeyPicker.open ? /* @__PURE__ */ jsx74(FKeyPicker, { selected: state.fKeyPicker.selected }) : null,
|
|
32357
|
+
state.coordinator.monitorOpen ? /* @__PURE__ */ jsx74(
|
|
32329
32358
|
CoordinatorPanel,
|
|
32330
32359
|
{
|
|
32331
32360
|
coordinator: state.coordinator,
|
|
@@ -32333,7 +32362,7 @@ function AppView({ host, runtime }) {
|
|
|
32333
32362
|
onClose: () => dispatch({ type: "toggleCoordinatorMonitor" })
|
|
32334
32363
|
}
|
|
32335
32364
|
) : null,
|
|
32336
|
-
state.auditPanelOpen ? /* @__PURE__ */
|
|
32365
|
+
state.auditPanelOpen ? /* @__PURE__ */ jsx74(
|
|
32337
32366
|
AuditPanel,
|
|
32338
32367
|
{
|
|
32339
32368
|
sideEffects: agent.ctx.sideEffects ?? [],
|
|
@@ -32342,7 +32371,7 @@ function AppView({ host, runtime }) {
|
|
|
32342
32371
|
) : null,
|
|
32343
32372
|
state.rewindOverlay ? (() => {
|
|
32344
32373
|
const overlay = state.rewindOverlay;
|
|
32345
|
-
return /* @__PURE__ */
|
|
32374
|
+
return /* @__PURE__ */ jsx74(
|
|
32346
32375
|
CheckpointTimeline,
|
|
32347
32376
|
{
|
|
32348
32377
|
checkpoints: overlay.checkpoints,
|
|
@@ -32356,7 +32385,7 @@ function AppView({ host, runtime }) {
|
|
|
32356
32385
|
}
|
|
32357
32386
|
);
|
|
32358
32387
|
})() : null,
|
|
32359
|
-
state.brainPrompt ? /* @__PURE__ */
|
|
32388
|
+
state.brainPrompt ? /* @__PURE__ */ jsx74(Box, { flexDirection: "column", marginY: 1, flexShrink: 0, children: /* @__PURE__ */ jsx74(
|
|
32360
32389
|
BrainDecisionPrompt,
|
|
32361
32390
|
{
|
|
32362
32391
|
...state.brainPrompt,
|
|
@@ -32375,7 +32404,7 @@ function AppView({ host, runtime }) {
|
|
|
32375
32404
|
info.resolve(decision);
|
|
32376
32405
|
dispatch({ type: "shellCommandWarningClose" });
|
|
32377
32406
|
};
|
|
32378
|
-
return /* @__PURE__ */
|
|
32407
|
+
return /* @__PURE__ */ jsx74(ShellCommandWarning, { command: info.command, onDecision });
|
|
32379
32408
|
})() : null,
|
|
32380
32409
|
state.confirmQueue.length > 0 && (() => {
|
|
32381
32410
|
const head = expectDefined5(state.confirmQueue[0]);
|
|
@@ -32399,7 +32428,7 @@ function AppView({ host, runtime }) {
|
|
|
32399
32428
|
head.resolve("yes");
|
|
32400
32429
|
dispatch({ type: "confirmClose" });
|
|
32401
32430
|
};
|
|
32402
|
-
return /* @__PURE__ */
|
|
32431
|
+
return /* @__PURE__ */ jsx74(
|
|
32403
32432
|
ConfirmPrompt,
|
|
32404
32433
|
{
|
|
32405
32434
|
toolName: head.toolName,
|
|
@@ -32412,7 +32441,7 @@ function AppView({ host, runtime }) {
|
|
|
32412
32441
|
}
|
|
32413
32442
|
);
|
|
32414
32443
|
})(),
|
|
32415
|
-
state.clearConfirm ? /* @__PURE__ */
|
|
32444
|
+
state.clearConfirm ? /* @__PURE__ */ jsx74(
|
|
32416
32445
|
ClearConfirmPanel,
|
|
32417
32446
|
{
|
|
32418
32447
|
leaderActive: state.clearConfirm.leaderActive,
|
|
@@ -32420,7 +32449,7 @@ function AppView({ host, runtime }) {
|
|
|
32420
32449
|
value: state.clearConfirm.value
|
|
32421
32450
|
}
|
|
32422
32451
|
) : null,
|
|
32423
|
-
state.exitConfirm ? /* @__PURE__ */
|
|
32452
|
+
state.exitConfirm ? /* @__PURE__ */ jsx74(
|
|
32424
32453
|
ExitConfirmPanel,
|
|
32425
32454
|
{
|
|
32426
32455
|
leaderActive: state.exitConfirm.leaderActive,
|
|
@@ -32428,14 +32457,14 @@ function AppView({ host, runtime }) {
|
|
|
32428
32457
|
backgroundCount: state.exitConfirm.backgroundCount
|
|
32429
32458
|
}
|
|
32430
32459
|
) : null,
|
|
32431
|
-
state.slashConfirm ? /* @__PURE__ */
|
|
32460
|
+
state.slashConfirm ? /* @__PURE__ */ jsx74(
|
|
32432
32461
|
SlashConfirmPanel,
|
|
32433
32462
|
{
|
|
32434
32463
|
question: state.slashConfirm.question,
|
|
32435
32464
|
defaultYes: state.slashConfirm.defaultYes
|
|
32436
32465
|
}
|
|
32437
32466
|
) : null,
|
|
32438
|
-
state.escConfirm ? /* @__PURE__ */
|
|
32467
|
+
state.escConfirm ? /* @__PURE__ */ jsx74(Box, { flexDirection: "column", marginY: 1, flexShrink: 0, children: /* @__PURE__ */ jsx74(
|
|
32439
32468
|
EscConfirmPrompt,
|
|
32440
32469
|
{
|
|
32441
32470
|
runningTools: state.escConfirm.snapshot.runningTools,
|
|
@@ -32483,7 +32512,7 @@ function AppView({ host, runtime }) {
|
|
|
32483
32512
|
resolved = true;
|
|
32484
32513
|
info.resolve(decision);
|
|
32485
32514
|
};
|
|
32486
|
-
return /* @__PURE__ */
|
|
32515
|
+
return /* @__PURE__ */ jsx74(
|
|
32487
32516
|
SendModePicker,
|
|
32488
32517
|
{
|
|
32489
32518
|
selected: info.selected,
|
|
@@ -32493,7 +32522,7 @@ function AppView({ host, runtime }) {
|
|
|
32493
32522
|
}
|
|
32494
32523
|
);
|
|
32495
32524
|
})() : null,
|
|
32496
|
-
state.enhanceBusy && !state.enhance ? /* @__PURE__ */
|
|
32525
|
+
state.enhanceBusy && !state.enhance ? /* @__PURE__ */ jsx74(
|
|
32497
32526
|
RefiningPanel,
|
|
32498
32527
|
{
|
|
32499
32528
|
original: enhanceOriginalRef.current,
|
|
@@ -32512,7 +32541,7 @@ function AppView({ host, runtime }) {
|
|
|
32512
32541
|
setEnhanceCountdown(null);
|
|
32513
32542
|
info.resolve(decision);
|
|
32514
32543
|
};
|
|
32515
|
-
return /* @__PURE__ */
|
|
32544
|
+
return /* @__PURE__ */ jsx74(
|
|
32516
32545
|
EnhancePanel,
|
|
32517
32546
|
{
|
|
32518
32547
|
original: info.original,
|
|
@@ -32536,7 +32565,7 @@ function AppView({ host, runtime }) {
|
|
|
32536
32565
|
resolved = true;
|
|
32537
32566
|
info.resolve(decision);
|
|
32538
32567
|
};
|
|
32539
|
-
return /* @__PURE__ */
|
|
32568
|
+
return /* @__PURE__ */ jsx74(
|
|
32540
32569
|
RefineFailurePanel,
|
|
32541
32570
|
{
|
|
32542
32571
|
original: info.original,
|
|
@@ -32556,7 +32585,7 @@ function AppView({ host, runtime }) {
|
|
|
32556
32585
|
resolved = true;
|
|
32557
32586
|
info.resolve(decision);
|
|
32558
32587
|
};
|
|
32559
|
-
return /* @__PURE__ */
|
|
32588
|
+
return /* @__PURE__ */ jsx74(
|
|
32560
32589
|
ContinueConfirmPanel,
|
|
32561
32590
|
{
|
|
32562
32591
|
label: info.label,
|
|
@@ -32568,7 +32597,7 @@ function AppView({ host, runtime }) {
|
|
|
32568
32597
|
}
|
|
32569
32598
|
);
|
|
32570
32599
|
})() : null,
|
|
32571
|
-
/* @__PURE__ */
|
|
32600
|
+
/* @__PURE__ */ jsx74(AppStatusRegion, { host, runtime })
|
|
32572
32601
|
] })
|
|
32573
32602
|
] })
|
|
32574
32603
|
}
|
|
@@ -32625,7 +32654,7 @@ var LayoutStore = class {
|
|
|
32625
32654
|
allMeasured(ids) {
|
|
32626
32655
|
for (const id of ids) {
|
|
32627
32656
|
const layout = this.layouts.get(id);
|
|
32628
|
-
if (
|
|
32657
|
+
if (layout?.kind !== "measured") return false;
|
|
32629
32658
|
}
|
|
32630
32659
|
return true;
|
|
32631
32660
|
}
|
|
@@ -32666,15 +32695,25 @@ var LayoutStore = class {
|
|
|
32666
32695
|
/**
|
|
32667
32696
|
* Promote a layout from 'estimated' to 'measured' once the real component
|
|
32668
32697
|
* has been mounted and its actual height is known.
|
|
32698
|
+
*
|
|
32699
|
+
* Also updates the stored `termWidth` to the current terminal width: after a
|
|
32700
|
+
* resize, entries are re-seeded with the new width as estimates, and the
|
|
32701
|
+
* post-render measurement pass needs to stamp the actual width so the store
|
|
32702
|
+
* is consistent. Without this, a subsequent render sees `stored.termWidth`
|
|
32703
|
+
* mismatch the current width and re-seeds estimates, discarding the
|
|
32704
|
+
* measurement and corrupting the virtual scroll viewport.
|
|
32669
32705
|
*/
|
|
32670
|
-
markMeasured(id, actualRows) {
|
|
32706
|
+
markMeasured(id, actualRows, termWidth = this.currentTermWidth) {
|
|
32671
32707
|
const existing = this.layouts.get(id);
|
|
32672
32708
|
if (!existing) return;
|
|
32673
|
-
if (existing.kind === "measured" && existing.rows === actualRows)
|
|
32709
|
+
if (existing.kind === "measured" && existing.rows === actualRows && existing.termWidth === termWidth) {
|
|
32710
|
+
return;
|
|
32711
|
+
}
|
|
32674
32712
|
this.layouts.set(id, {
|
|
32675
32713
|
...existing,
|
|
32676
32714
|
rows: Math.max(1, actualRows),
|
|
32677
|
-
kind: "measured"
|
|
32715
|
+
kind: "measured",
|
|
32716
|
+
termWidth
|
|
32678
32717
|
});
|
|
32679
32718
|
this.dirty = true;
|
|
32680
32719
|
this.scheduleFlush();
|
|
@@ -32968,8 +33007,7 @@ async function refineSubmittedPrompt(host, trimmed, options) {
|
|
|
32968
33007
|
const chips = [];
|
|
32969
33008
|
let cleanText = trimmed;
|
|
32970
33009
|
const chipPattern = new RegExp(INLINE_TOKEN_SRC, "g");
|
|
32971
|
-
|
|
32972
|
-
while ((chipMatch = chipPattern.exec(trimmed)) !== null) chips.push(chipMatch[0]);
|
|
33010
|
+
for (const chipMatch of trimmed.matchAll(chipPattern)) chips.push(chipMatch[0]);
|
|
32973
33011
|
if (chips.length > 0) {
|
|
32974
33012
|
cleanText = trimmed.replace(chipPattern, "").replace(/\s{2,}/g, " ").trim();
|
|
32975
33013
|
if (!cleanText) {
|
|
@@ -34636,7 +34674,7 @@ function createAppKeyHandler(options) {
|
|
|
34636
34674
|
|
|
34637
34675
|
// src/app.tsx
|
|
34638
34676
|
import { buildGoalPreamble as buildGoalPreamble2 } from "@wrongstack/core/execution";
|
|
34639
|
-
import { jsx as
|
|
34677
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
34640
34678
|
function App(props) {
|
|
34641
34679
|
const {
|
|
34642
34680
|
agent,
|
|
@@ -35645,7 +35683,7 @@ function App(props) {
|
|
|
35645
35683
|
fleetRunning: fleetCounts?.running ?? 0,
|
|
35646
35684
|
liveAnimationStyle
|
|
35647
35685
|
});
|
|
35648
|
-
return /* @__PURE__ */
|
|
35686
|
+
return /* @__PURE__ */ jsx75(
|
|
35649
35687
|
AppView,
|
|
35650
35688
|
{
|
|
35651
35689
|
host: props,
|
|
@@ -36329,7 +36367,6 @@ export {
|
|
|
36329
36367
|
buildGoalPreamble2 as buildGoalPreamble,
|
|
36330
36368
|
parseInline,
|
|
36331
36369
|
parseNextSteps2 as parseNextSteps,
|
|
36332
|
-
replaySessionEvents,
|
|
36333
36370
|
replaySessionMessages,
|
|
36334
36371
|
runTui
|
|
36335
36372
|
};
|