@wrongstack/tui 0.141.0 → 0.148.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +156 -47
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -33,6 +33,8 @@ type Settings = {
|
|
|
33
33
|
auditLevel: 'minimal' | 'standard' | 'full';
|
|
34
34
|
indexOnStart: boolean;
|
|
35
35
|
maxIterations: number;
|
|
36
|
+
/** Maximum auto-proceed iterations (0 = unlimited). */
|
|
37
|
+
autoProceedMaxIterations: number;
|
|
36
38
|
/** Prompt refinement preview countdown (ms). */
|
|
37
39
|
enhanceDelayMs: number;
|
|
38
40
|
/** Raw SSE stream debugging — hex-dump every byte received from providers. */
|
package/dist/index.js
CHANGED
|
@@ -59,7 +59,9 @@ function StatusBar({
|
|
|
59
59
|
goalSummary,
|
|
60
60
|
indexState,
|
|
61
61
|
modeLabel,
|
|
62
|
-
debugStreamStats
|
|
62
|
+
debugStreamStats,
|
|
63
|
+
enhanceCountdown,
|
|
64
|
+
autoProceedCountdown
|
|
63
65
|
}) {
|
|
64
66
|
const { stdout } = useStdout();
|
|
65
67
|
const [termWidth, setTermWidth] = useState(stdout?.columns ?? 90);
|
|
@@ -96,11 +98,13 @@ function StatusBar({
|
|
|
96
98
|
const { label: stateLabel, color: stateColor } = stateChip(state, fleet?.running ?? 0);
|
|
97
99
|
const statePrefix = state === "idle" || state === "aborting" ? "\u25CF" : spinner;
|
|
98
100
|
const thinking = state === "running" || state === "streaming";
|
|
99
|
-
const
|
|
101
|
+
const hasAutoProceed = autoProceedCountdown != null && autoProceedCountdown > 0;
|
|
102
|
+
const hasSecondLine = yolo || autonomy && autonomy !== "off" || startedAt != null || git !== null && git !== void 0 || projectName !== void 0 && projectName.length > 0 || goalSummary !== null && goalSummary !== void 0 || !!modeLabel || hasAutoProceed;
|
|
100
103
|
const fleetHasActivity = fleet && (fleet.running > 0 || fleet.idle > 0 || fleet.pending > 0 || fleet.completed > 0) || subagentCount > 0;
|
|
101
104
|
const hasBrainActivity = !!brain && brain.state !== "idle";
|
|
102
105
|
const hasDebugStream = !!debugStreamStats;
|
|
103
|
-
const
|
|
106
|
+
const hasEnhanceCountdown = enhanceCountdown != null && enhanceCountdown > 0;
|
|
107
|
+
const hasThirdLine = todos && (todos.pending > 0 || todos.inProgress > 0 || todos.completed > 0) || plan && (plan.open > 0 || plan.inProgress > 0 || plan.done > 0) || fleetHasActivity || hasBrainActivity || hasDebugStream || hasEnhanceCountdown;
|
|
104
108
|
return /* @__PURE__ */ jsxs(
|
|
105
109
|
Box,
|
|
106
110
|
{
|
|
@@ -267,6 +271,14 @@ function StatusBar({
|
|
|
267
271
|
yolo || autonomy && autonomy !== "off" || eternalStage || startedAt != null || projectName || goalSummary ? /* @__PURE__ */ jsx(Text, { dimColor: true, children: "\u2502" }) : null,
|
|
268
272
|
/* @__PURE__ */ jsx(Text, { color: "cyan", children: modeIcon(modeLabel) })
|
|
269
273
|
] }) : null,
|
|
274
|
+
hasAutoProceed ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
275
|
+
yolo || autonomy && autonomy !== "off" || eternalStage || startedAt != null || projectName || goalSummary || modeLabel ? /* @__PURE__ */ jsx(Text, { dimColor: true, children: "\u2502" }) : null,
|
|
276
|
+
/* @__PURE__ */ jsxs(Text, { color: autoProceedCountdown != null && autoProceedCountdown <= 5 ? "yellow" : "cyan", children: [
|
|
277
|
+
"\u23F3 auto in ",
|
|
278
|
+
autoProceedCountdown,
|
|
279
|
+
"s"
|
|
280
|
+
] })
|
|
281
|
+
] }) : null,
|
|
270
282
|
git ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
271
283
|
yolo || startedAt != null || projectName ? /* @__PURE__ */ jsx(Text, { dimColor: true, children: "\u2502" }) : null,
|
|
272
284
|
/* @__PURE__ */ jsxs(Text, { children: [
|
|
@@ -385,6 +397,14 @@ function StatusBar({
|
|
|
385
397
|
fmtDebugBytes(debugStreamStats.totalBytes)
|
|
386
398
|
] })
|
|
387
399
|
] })
|
|
400
|
+
] }) : null,
|
|
401
|
+
hasEnhanceCountdown && enhanceCountdown != null ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
402
|
+
todos && (todos.pending > 0 || todos.inProgress > 0 || todos.completed > 0) || plan && (plan.open > 0 || plan.inProgress > 0 || plan.done > 0) || fleetHasActivity || hasBrainActivity || hasDebugStream ? /* @__PURE__ */ jsx(Text, { dimColor: true, children: "\u2502" }) : null,
|
|
403
|
+
/* @__PURE__ */ jsxs(Text, { color: enhanceCountdown <= 5 ? "yellow" : "cyan", children: [
|
|
404
|
+
"\u23F3 auto-send in ",
|
|
405
|
+
enhanceCountdown,
|
|
406
|
+
"s"
|
|
407
|
+
] })
|
|
388
408
|
] }) : null
|
|
389
409
|
] }) : /* @__PURE__ */ jsx(Box, { height: 1, children: /* @__PURE__ */ jsx(Text, { children: " " }) }),
|
|
390
410
|
fleetAgents && fleetAgents.length > 0 ? /* @__PURE__ */ jsx(Box, { flexDirection: "row", gap: 2, children: fleetAgents.map((a, i) => (
|
|
@@ -1327,22 +1347,24 @@ function EnhancePanel({
|
|
|
1327
1347
|
refined,
|
|
1328
1348
|
english,
|
|
1329
1349
|
delayMs,
|
|
1330
|
-
onDecision
|
|
1350
|
+
onDecision,
|
|
1351
|
+
onTick
|
|
1331
1352
|
}) {
|
|
1332
1353
|
const totalSecs = Math.max(1, Math.ceil(delayMs / 1e3));
|
|
1333
|
-
const
|
|
1354
|
+
const remainingRef = React5.useRef(totalSecs);
|
|
1334
1355
|
const decideRef = React5.useRef(onDecision);
|
|
1335
1356
|
decideRef.current = onDecision;
|
|
1357
|
+
const tickRef = React5.useRef(onTick);
|
|
1358
|
+
tickRef.current = onTick;
|
|
1336
1359
|
React5.useEffect(() => {
|
|
1337
1360
|
const id = setInterval(() => {
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
});
|
|
1361
|
+
const r = remainingRef.current - 1;
|
|
1362
|
+
remainingRef.current = r;
|
|
1363
|
+
tickRef.current?.(r);
|
|
1364
|
+
if (r <= 0) {
|
|
1365
|
+
clearInterval(id);
|
|
1366
|
+
decideRef.current("refined");
|
|
1367
|
+
}
|
|
1346
1368
|
}, 1e3);
|
|
1347
1369
|
return () => clearInterval(id);
|
|
1348
1370
|
}, []);
|
|
@@ -1358,15 +1380,7 @@ function EnhancePanel({
|
|
|
1358
1380
|
}
|
|
1359
1381
|
});
|
|
1360
1382
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
|
|
1361
|
-
/* @__PURE__ */
|
|
1362
|
-
/* @__PURE__ */ jsx(Text, { bold: true, color: "cyan", children: "\u2728 Refined request" }),
|
|
1363
|
-
/* @__PURE__ */ jsx(Text, { children: " " }),
|
|
1364
|
-
/* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
1365
|
-
"\u2014 sending in ",
|
|
1366
|
-
remaining,
|
|
1367
|
-
"s"
|
|
1368
|
-
] })
|
|
1369
|
-
] }),
|
|
1383
|
+
/* @__PURE__ */ jsx(Box, { flexDirection: "row", children: /* @__PURE__ */ jsx(Text, { bold: true, color: "cyan", children: "\u2728 Refined request" }) }),
|
|
1370
1384
|
/* @__PURE__ */ jsxs(Box, { flexDirection: "row", children: [
|
|
1371
1385
|
/* @__PURE__ */ jsx(Text, { dimColor: true, children: "original: " }),
|
|
1372
1386
|
/* @__PURE__ */ jsx(Text, { dimColor: true, children: original })
|
|
@@ -4494,6 +4508,7 @@ var LOG_LEVELS = ["error", "warn", "info", "debug", "trace"];
|
|
|
4494
4508
|
var AUDIT_LEVELS = ["minimal", "standard", "full"];
|
|
4495
4509
|
var COMPACTOR_STRATEGIES = ["hybrid", "intelligent", "selective"];
|
|
4496
4510
|
var MAX_ITERATIONS_PRESETS = [100, 200, 500, 1e3, 0];
|
|
4511
|
+
var AUTO_PROCEED_MAX_PRESETS = [10, 25, 50, 100, 250, 0];
|
|
4497
4512
|
var ENHANCE_DELAY_PRESETS = [3e4, 45e3, 6e4, 9e4, 12e4];
|
|
4498
4513
|
function formatSettingsDelay(ms) {
|
|
4499
4514
|
if (ms === 0) return "disabled";
|
|
@@ -4512,7 +4527,7 @@ var MODE_DESC = {
|
|
|
4512
4527
|
suggest: "Shows next-step suggestions after each turn",
|
|
4513
4528
|
auto: "Self-driving \u2014 agent continues automatically"
|
|
4514
4529
|
};
|
|
4515
|
-
var SETTINGS_FIELD_COUNT =
|
|
4530
|
+
var SETTINGS_FIELD_COUNT = 23;
|
|
4516
4531
|
var CONFIG_SCOPES = ["global", "project"];
|
|
4517
4532
|
function SettingsPicker({
|
|
4518
4533
|
field,
|
|
@@ -4535,6 +4550,7 @@ function SettingsPicker({
|
|
|
4535
4550
|
auditLevel,
|
|
4536
4551
|
indexOnStart,
|
|
4537
4552
|
maxIterations,
|
|
4553
|
+
autoProceedMaxIterations,
|
|
4538
4554
|
enhanceDelayMs,
|
|
4539
4555
|
debugStream,
|
|
4540
4556
|
configScope,
|
|
@@ -4649,6 +4665,11 @@ function SettingsPicker({
|
|
|
4649
4665
|
value: formatMaxIterations(maxIterations),
|
|
4650
4666
|
detail: "100\u20131000 or unlimited (0)"
|
|
4651
4667
|
},
|
|
4668
|
+
{
|
|
4669
|
+
label: "Auto-proceed max iterations",
|
|
4670
|
+
value: formatMaxIterations(autoProceedMaxIterations),
|
|
4671
|
+
detail: "Stop auto-proceed after N iterations (0 = unlimited, default 50)"
|
|
4672
|
+
},
|
|
4652
4673
|
{
|
|
4653
4674
|
label: "Refine preview countdown",
|
|
4654
4675
|
value: formatEnhanceDelay(enhanceDelayMs),
|
|
@@ -5519,6 +5540,20 @@ function useDirectorFleetBridge({
|
|
|
5519
5540
|
}
|
|
5520
5541
|
break;
|
|
5521
5542
|
}
|
|
5543
|
+
case "ctx.pct": {
|
|
5544
|
+
const payload = event.payload;
|
|
5545
|
+
if (payload?.load !== void 0) {
|
|
5546
|
+
enqueue({
|
|
5547
|
+
type: "fleetCtxPct",
|
|
5548
|
+
id: event.subagentId,
|
|
5549
|
+
load: payload.load,
|
|
5550
|
+
tokens: payload.tokens ?? 0,
|
|
5551
|
+
maxContext: payload.maxContext ?? 0,
|
|
5552
|
+
ctxCost: payload.ctxCost
|
|
5553
|
+
});
|
|
5554
|
+
}
|
|
5555
|
+
break;
|
|
5556
|
+
}
|
|
5522
5557
|
case "bug.found":
|
|
5523
5558
|
handleCollabBugFound(event, enqueue, stateRef);
|
|
5524
5559
|
break;
|
|
@@ -6311,6 +6346,9 @@ function reducer(state, action) {
|
|
|
6311
6346
|
case "streamReset":
|
|
6312
6347
|
return { ...state, streamingText: "" };
|
|
6313
6348
|
case "status":
|
|
6349
|
+
if (action.status === "idle") {
|
|
6350
|
+
return { ...state, status: "idle", debugStreamStats: null };
|
|
6351
|
+
}
|
|
6314
6352
|
return { ...state, status: action.status };
|
|
6315
6353
|
case "interrupt":
|
|
6316
6354
|
return { ...state, interrupts: state.interrupts + 1 };
|
|
@@ -6601,6 +6639,7 @@ function reducer(state, action) {
|
|
|
6601
6639
|
auditLevel: action.auditLevel,
|
|
6602
6640
|
indexOnStart: action.indexOnStart,
|
|
6603
6641
|
maxIterations: action.maxIterations,
|
|
6642
|
+
autoProceedMaxIterations: action.autoProceedMaxIterations,
|
|
6604
6643
|
enhanceDelayMs: action.enhanceDelayMs,
|
|
6605
6644
|
debugStream: action.debugStream,
|
|
6606
6645
|
configScope: action.configScope,
|
|
@@ -6676,13 +6715,19 @@ function reducer(state, action) {
|
|
|
6676
6715
|
return { ...state, settingsPicker: { ...sp, maxIterations: expectDefined(MAX_ITERATIONS_PRESETS[next]), hint: void 0 } };
|
|
6677
6716
|
}
|
|
6678
6717
|
if (f === 19) {
|
|
6718
|
+
const aj = AUTO_PROCEED_MAX_PRESETS.indexOf(sp.autoProceedMaxIterations);
|
|
6719
|
+
const abase = aj < 0 ? 0 : aj;
|
|
6720
|
+
const anext = (abase + action.delta + AUTO_PROCEED_MAX_PRESETS.length) % AUTO_PROCEED_MAX_PRESETS.length;
|
|
6721
|
+
return { ...state, settingsPicker: { ...sp, autoProceedMaxIterations: expectDefined(AUTO_PROCEED_MAX_PRESETS[anext]), hint: void 0 } };
|
|
6722
|
+
}
|
|
6723
|
+
if (f === 20) {
|
|
6679
6724
|
const ej = ENHANCE_DELAY_PRESETS.indexOf(sp.enhanceDelayMs);
|
|
6680
6725
|
const ebase = ej < 0 ? 0 : ej;
|
|
6681
6726
|
const enext = (ebase + action.delta + ENHANCE_DELAY_PRESETS.length) % ENHANCE_DELAY_PRESETS.length;
|
|
6682
6727
|
return { ...state, settingsPicker: { ...sp, enhanceDelayMs: expectDefined(ENHANCE_DELAY_PRESETS[enext]), hint: void 0 } };
|
|
6683
6728
|
}
|
|
6684
|
-
if (f ===
|
|
6685
|
-
if (f ===
|
|
6729
|
+
if (f === 21) return { ...state, settingsPicker: { ...sp, debugStream: !sp.debugStream, hint: void 0 } };
|
|
6730
|
+
if (f === 22) {
|
|
6686
6731
|
const i = CONFIG_SCOPES.indexOf(sp.configScope);
|
|
6687
6732
|
const base = i < 0 ? 0 : i;
|
|
6688
6733
|
const next = (base + action.delta + CONFIG_SCOPES.length) % CONFIG_SCOPES.length;
|
|
@@ -7028,25 +7073,32 @@ function reducer(state, action) {
|
|
|
7028
7073
|
return { ...state, streamFleet: action.enabled };
|
|
7029
7074
|
}
|
|
7030
7075
|
case "toggleMonitor": {
|
|
7031
|
-
|
|
7076
|
+
const opening = !state.monitorOpen;
|
|
7077
|
+
return opening ? { ...state, monitorOpen: true, agentsMonitorOpen: false, helpOpen: false, todosMonitorOpen: false, queuePanelOpen: false, processListOpen: false, goalPanelOpen: false } : { ...state, monitorOpen: false };
|
|
7032
7078
|
}
|
|
7033
7079
|
case "toggleAgentsMonitor": {
|
|
7034
|
-
|
|
7080
|
+
const opening = !state.agentsMonitorOpen;
|
|
7081
|
+
return opening ? { ...state, agentsMonitorOpen: true, monitorOpen: false, helpOpen: false, todosMonitorOpen: false, queuePanelOpen: false, processListOpen: false, goalPanelOpen: false } : { ...state, agentsMonitorOpen: false };
|
|
7035
7082
|
}
|
|
7036
7083
|
case "toggleHelp": {
|
|
7037
|
-
|
|
7084
|
+
const opening = !state.helpOpen;
|
|
7085
|
+
return opening ? { ...state, helpOpen: true, monitorOpen: false, agentsMonitorOpen: false, todosMonitorOpen: false, queuePanelOpen: false, processListOpen: false, goalPanelOpen: false } : { ...state, helpOpen: false };
|
|
7038
7086
|
}
|
|
7039
7087
|
case "toggleTodosMonitor": {
|
|
7040
|
-
|
|
7088
|
+
const opening = !state.todosMonitorOpen;
|
|
7089
|
+
return opening ? { ...state, todosMonitorOpen: true, monitorOpen: false, agentsMonitorOpen: false, helpOpen: false, queuePanelOpen: false, processListOpen: false, goalPanelOpen: false } : { ...state, todosMonitorOpen: false };
|
|
7041
7090
|
}
|
|
7042
7091
|
case "toggleQueuePanel": {
|
|
7043
|
-
|
|
7092
|
+
const opening = !state.queuePanelOpen;
|
|
7093
|
+
return opening ? { ...state, queuePanelOpen: true, monitorOpen: false, agentsMonitorOpen: false, helpOpen: false, todosMonitorOpen: false, processListOpen: false, goalPanelOpen: false } : { ...state, queuePanelOpen: false };
|
|
7044
7094
|
}
|
|
7045
7095
|
case "toggleProcessList": {
|
|
7046
|
-
|
|
7096
|
+
const opening = !state.processListOpen;
|
|
7097
|
+
return opening ? { ...state, processListOpen: true, monitorOpen: false, agentsMonitorOpen: false, helpOpen: false, todosMonitorOpen: false, queuePanelOpen: false, goalPanelOpen: false } : { ...state, processListOpen: false };
|
|
7047
7098
|
}
|
|
7048
7099
|
case "toggleGoalPanel": {
|
|
7049
|
-
|
|
7100
|
+
const opening = !state.goalPanelOpen;
|
|
7101
|
+
return opening ? { ...state, goalPanelOpen: true, monitorOpen: false, agentsMonitorOpen: false, helpOpen: false, todosMonitorOpen: false, queuePanelOpen: false, processListOpen: false } : { ...state, goalPanelOpen: false };
|
|
7050
7102
|
}
|
|
7051
7103
|
case "checkpointReceived": {
|
|
7052
7104
|
const existing = state.checkpoints.find((c) => c.promptIndex === action.cp.promptIndex);
|
|
@@ -7546,7 +7598,7 @@ function App({
|
|
|
7546
7598
|
searchQuery: ""
|
|
7547
7599
|
},
|
|
7548
7600
|
autonomyPicker: { open: false, options: [], selected: 0 },
|
|
7549
|
-
settingsPicker: { open: false, field: 0, mode: "off", delayMs: 0, titleAnimation: true, yolo: false, streamFleet: true, chime: false, confirmExit: true, nextPrediction: false, featureMcp: true, featurePlugins: true, featureMemory: true, featureSkills: true, featureModelsRegistry: true, contextAutoCompact: true, contextStrategy: "hybrid", logLevel: "info", auditLevel: "standard", indexOnStart: true, maxIterations: 500, enhanceDelayMs: 6e4, debugStream: false, configScope: "global" },
|
|
7601
|
+
settingsPicker: { open: false, field: 0, mode: "off", delayMs: 0, titleAnimation: true, yolo: false, streamFleet: true, chime: false, confirmExit: true, nextPrediction: false, featureMcp: true, featurePlugins: true, featureMemory: true, featureSkills: true, featureModelsRegistry: true, contextAutoCompact: true, contextStrategy: "hybrid", logLevel: "info", auditLevel: "standard", indexOnStart: true, maxIterations: 500, autoProceedMaxIterations: 50, enhanceDelayMs: 6e4, debugStream: false, configScope: "global" },
|
|
7550
7602
|
confirmQueue: [],
|
|
7551
7603
|
enhance: null,
|
|
7552
7604
|
enhanceEnabled,
|
|
@@ -7889,6 +7941,7 @@ function App({
|
|
|
7889
7941
|
auditLevel: sp.auditLevel,
|
|
7890
7942
|
indexOnStart: sp.indexOnStart,
|
|
7891
7943
|
maxIterations: sp.maxIterations,
|
|
7944
|
+
autoProceedMaxIterations: sp.autoProceedMaxIterations,
|
|
7892
7945
|
enhanceDelayMs: sp.enhanceDelayMs,
|
|
7893
7946
|
debugStream: sp.debugStream,
|
|
7894
7947
|
configScope: sp.configScope
|
|
@@ -8014,6 +8067,7 @@ function App({
|
|
|
8014
8067
|
data,
|
|
8015
8068
|
meta: { filename: picked, label: picked }
|
|
8016
8069
|
});
|
|
8070
|
+
tokenPreviewsRef.current.set(token, data);
|
|
8017
8071
|
const before = draft.buffer.slice(0, tok.start);
|
|
8018
8072
|
const after = draft.buffer.slice(tok.end);
|
|
8019
8073
|
const next = `${before}${token}${after}`;
|
|
@@ -8225,11 +8279,40 @@ function App({
|
|
|
8225
8279
|
auditLevel: s2.auditLevel ?? "standard",
|
|
8226
8280
|
indexOnStart: s2.indexOnStart ?? true,
|
|
8227
8281
|
maxIterations: s2.maxIterations ?? 500,
|
|
8282
|
+
autoProceedMaxIterations: s2.autoProceedMaxIterations ?? 50,
|
|
8228
8283
|
enhanceDelayMs: s2.enhanceDelayMs ?? 6e4,
|
|
8229
8284
|
debugStream: s2.debugStream ?? false,
|
|
8230
8285
|
configScope: s2.configScope ?? "global"
|
|
8231
8286
|
});
|
|
8232
8287
|
}, [getSettings]);
|
|
8288
|
+
const [autoProceedCountdown, setAutoProceedCountdown] = useState(null);
|
|
8289
|
+
const autoProceedTimerRef = useRef(void 0);
|
|
8290
|
+
useEffect(() => {
|
|
8291
|
+
if (autonomyLive !== "auto") {
|
|
8292
|
+
clearInterval(autoProceedTimerRef.current);
|
|
8293
|
+
autoProceedTimerRef.current = void 0;
|
|
8294
|
+
setAutoProceedCountdown(null);
|
|
8295
|
+
return;
|
|
8296
|
+
}
|
|
8297
|
+
const cfg = getSettings?.();
|
|
8298
|
+
const delay = cfg?.delayMs ?? 45e3;
|
|
8299
|
+
const start = Date.now();
|
|
8300
|
+
setAutoProceedCountdown(Math.ceil(delay / 1e3));
|
|
8301
|
+
autoProceedTimerRef.current = setInterval(() => {
|
|
8302
|
+
const remaining = Math.max(0, Math.ceil((delay - (Date.now() - start)) / 1e3));
|
|
8303
|
+
if (remaining <= 0) {
|
|
8304
|
+
clearInterval(autoProceedTimerRef.current);
|
|
8305
|
+
autoProceedTimerRef.current = void 0;
|
|
8306
|
+
setAutoProceedCountdown(null);
|
|
8307
|
+
} else {
|
|
8308
|
+
setAutoProceedCountdown(remaining);
|
|
8309
|
+
}
|
|
8310
|
+
}, 500);
|
|
8311
|
+
return () => {
|
|
8312
|
+
clearInterval(autoProceedTimerRef.current);
|
|
8313
|
+
autoProceedTimerRef.current = void 0;
|
|
8314
|
+
};
|
|
8315
|
+
}, [autonomyLive, getSettings]);
|
|
8233
8316
|
const settingsAutoSaveGateRef = useRef(true);
|
|
8234
8317
|
useEffect(() => {
|
|
8235
8318
|
if (state.settingsPicker.open) {
|
|
@@ -8264,6 +8347,7 @@ function App({
|
|
|
8264
8347
|
auditLevel: sp.auditLevel,
|
|
8265
8348
|
indexOnStart: sp.indexOnStart,
|
|
8266
8349
|
maxIterations: sp.maxIterations,
|
|
8350
|
+
autoProceedMaxIterations: sp.autoProceedMaxIterations,
|
|
8267
8351
|
enhanceDelayMs: sp.enhanceDelayMs,
|
|
8268
8352
|
debugStream: sp.debugStream,
|
|
8269
8353
|
configScope: sp.configScope
|
|
@@ -8291,6 +8375,7 @@ function App({
|
|
|
8291
8375
|
state.settingsPicker.auditLevel,
|
|
8292
8376
|
state.settingsPicker.indexOnStart,
|
|
8293
8377
|
state.settingsPicker.maxIterations,
|
|
8378
|
+
state.settingsPicker.autoProceedMaxIterations,
|
|
8294
8379
|
state.settingsPicker.enhanceDelayMs,
|
|
8295
8380
|
saveSettings
|
|
8296
8381
|
]);
|
|
@@ -8533,6 +8618,7 @@ function App({
|
|
|
8533
8618
|
enhanceEnabledRef.current = state.enhanceEnabled;
|
|
8534
8619
|
}, [state.enhanceEnabled]);
|
|
8535
8620
|
const enhanceAbortRef = useRef(null);
|
|
8621
|
+
const [enhanceCountdown, setEnhanceCountdown] = useState(null);
|
|
8536
8622
|
useTuiEventBridge({
|
|
8537
8623
|
events,
|
|
8538
8624
|
dispatch,
|
|
@@ -8676,13 +8762,6 @@ function App({
|
|
|
8676
8762
|
process.off("SIGINT", onSigint);
|
|
8677
8763
|
};
|
|
8678
8764
|
}, [director, getEternalEngine, getParallelEngine, switchAutonomy, onExit, exit]);
|
|
8679
|
-
const truncatePastePreview = (text, lines) => {
|
|
8680
|
-
const all = text.split("\n");
|
|
8681
|
-
if (all.length <= lines) return text;
|
|
8682
|
-
const head = all.slice(0, lines).join("\n");
|
|
8683
|
-
return `${head}
|
|
8684
|
-
... (${all.length - lines} more lines)`;
|
|
8685
|
-
};
|
|
8686
8765
|
const commitPaste = async (full) => {
|
|
8687
8766
|
const builder = builderRef.current;
|
|
8688
8767
|
if (!builder || !full) return;
|
|
@@ -8697,7 +8776,7 @@ function App({
|
|
|
8697
8776
|
}
|
|
8698
8777
|
if (mustCollapse || multiLine) {
|
|
8699
8778
|
const token = await builder.registerPaste(full);
|
|
8700
|
-
tokenPreviewsRef.current.set(token,
|
|
8779
|
+
tokenPreviewsRef.current.set(token, full);
|
|
8701
8780
|
const next2 = buffer.slice(0, cursor) + token + buffer.slice(cursor);
|
|
8702
8781
|
setDraft(next2, cursor + token.length);
|
|
8703
8782
|
return;
|
|
@@ -9088,6 +9167,7 @@ function App({
|
|
|
9088
9167
|
auditLevel: cfg.auditLevel ?? "standard",
|
|
9089
9168
|
indexOnStart: cfg.indexOnStart ?? true,
|
|
9090
9169
|
maxIterations: cfg.maxIterations ?? 500,
|
|
9170
|
+
autoProceedMaxIterations: cfg.autoProceedMaxIterations ?? 50,
|
|
9091
9171
|
enhanceDelayMs: cfg.enhanceDelayMs ?? 6e4,
|
|
9092
9172
|
debugStream: cfg.debugStream ?? false,
|
|
9093
9173
|
configScope: cfg.configScope ?? "global"
|
|
@@ -9180,6 +9260,7 @@ function App({
|
|
|
9180
9260
|
auditLevel: cfg.auditLevel ?? "standard",
|
|
9181
9261
|
indexOnStart: cfg.indexOnStart ?? true,
|
|
9182
9262
|
maxIterations: cfg.maxIterations ?? 500,
|
|
9263
|
+
autoProceedMaxIterations: cfg.autoProceedMaxIterations ?? 50,
|
|
9183
9264
|
enhanceDelayMs: cfg.enhanceDelayMs ?? 6e4,
|
|
9184
9265
|
debugStream: cfg.debugStream ?? false,
|
|
9185
9266
|
configScope: cfg.configScope ?? "global"
|
|
@@ -9580,7 +9661,12 @@ function App({
|
|
|
9580
9661
|
const submit = async (overrideRaw) => {
|
|
9581
9662
|
const raw = overrideRaw ?? draftRef.current.buffer;
|
|
9582
9663
|
const trimmed = raw.trim();
|
|
9583
|
-
if (!trimmed)
|
|
9664
|
+
if (!trimmed) {
|
|
9665
|
+
if (state.steeringPending) {
|
|
9666
|
+
dispatch({ type: "steerConsume" });
|
|
9667
|
+
}
|
|
9668
|
+
return;
|
|
9669
|
+
}
|
|
9584
9670
|
dispatch({ type: "resetInterrupts" });
|
|
9585
9671
|
const pushSubmittedHistory = () => {
|
|
9586
9672
|
if (trimmed) dispatch({ type: "historyPush", text: trimmed });
|
|
@@ -9592,11 +9678,29 @@ function App({
|
|
|
9592
9678
|
return;
|
|
9593
9679
|
}
|
|
9594
9680
|
if (trimmed.startsWith("/")) {
|
|
9595
|
-
|
|
9681
|
+
let resolvedForDispatch = trimmed;
|
|
9682
|
+
const pasteParts2 = [];
|
|
9683
|
+
for (const m of trimmed.matchAll(new RegExp(INLINE_TOKEN_SRC, "g"))) {
|
|
9684
|
+
const token = m[0];
|
|
9685
|
+
const content = tokenPreviewsRef.current.get(token);
|
|
9686
|
+
if (content) {
|
|
9687
|
+
resolvedForDispatch = resolvedForDispatch.replace(
|
|
9688
|
+
token,
|
|
9689
|
+
`
|
|
9690
|
+
<pasted>
|
|
9691
|
+
${content}
|
|
9692
|
+
</pasted>`
|
|
9693
|
+
);
|
|
9694
|
+
}
|
|
9695
|
+
pasteParts2.push(token);
|
|
9696
|
+
if (content) pasteParts2.push(` ${content.split("\n").slice(0, 6).join("\n ")}`);
|
|
9697
|
+
}
|
|
9698
|
+
const pasteContent2 = pasteParts2.length > 0 ? pasteParts2.join("\n") : void 0;
|
|
9699
|
+
dispatch({ type: "addEntry", entry: { kind: "user", text: trimmed, pasteContent: pasteContent2 } });
|
|
9596
9700
|
pushSubmittedHistory();
|
|
9597
9701
|
clearDraft();
|
|
9598
9702
|
try {
|
|
9599
|
-
const res = await slashRegistry.dispatch(
|
|
9703
|
+
const res = await slashRegistry.dispatch(resolvedForDispatch, agent.ctx);
|
|
9600
9704
|
if (res?.message) {
|
|
9601
9705
|
dispatch({ type: "addEntry", entry: { kind: "info", text: res.message } });
|
|
9602
9706
|
}
|
|
@@ -9750,7 +9854,7 @@ User message:
|
|
|
9750
9854
|
builder.appendText(toAppend);
|
|
9751
9855
|
}
|
|
9752
9856
|
if (steering) dispatch({ type: "steerConsume" });
|
|
9753
|
-
const displayText =
|
|
9857
|
+
const displayText = steering ? `\u21AF ${effectiveText}` : effectiveText;
|
|
9754
9858
|
const pasteParts = [];
|
|
9755
9859
|
for (const m of trimmed.matchAll(new RegExp(INLINE_TOKEN_SRC, "g"))) {
|
|
9756
9860
|
const token = m[0];
|
|
@@ -9905,6 +10009,7 @@ User message:
|
|
|
9905
10009
|
auditLevel: state.settingsPicker.auditLevel,
|
|
9906
10010
|
indexOnStart: state.settingsPicker.indexOnStart,
|
|
9907
10011
|
maxIterations: state.settingsPicker.maxIterations,
|
|
10012
|
+
autoProceedMaxIterations: state.settingsPicker.autoProceedMaxIterations,
|
|
9908
10013
|
enhanceDelayMs: state.settingsPicker.enhanceDelayMs,
|
|
9909
10014
|
debugStream: state.settingsPicker.debugStream,
|
|
9910
10015
|
configScope: state.settingsPicker.configScope,
|
|
@@ -10008,6 +10113,7 @@ User message:
|
|
|
10008
10113
|
const onDecision = (decision) => {
|
|
10009
10114
|
if (resolved) return;
|
|
10010
10115
|
resolved = true;
|
|
10116
|
+
setEnhanceCountdown(null);
|
|
10011
10117
|
info.resolve(decision);
|
|
10012
10118
|
};
|
|
10013
10119
|
return /* @__PURE__ */ jsx(
|
|
@@ -10017,7 +10123,8 @@ User message:
|
|
|
10017
10123
|
refined: info.refined,
|
|
10018
10124
|
english: info.english,
|
|
10019
10125
|
delayMs: enhanceDelayMs,
|
|
10020
|
-
onDecision
|
|
10126
|
+
onDecision,
|
|
10127
|
+
onTick: (r) => setEnhanceCountdown(r > 0 ? r : null)
|
|
10021
10128
|
}
|
|
10022
10129
|
);
|
|
10023
10130
|
})() : null,
|
|
@@ -10047,7 +10154,9 @@ User message:
|
|
|
10047
10154
|
goalSummary: state.goalSummary,
|
|
10048
10155
|
indexState,
|
|
10049
10156
|
modeLabel: liveModeLabel || void 0,
|
|
10050
|
-
debugStreamStats: state.debugStreamStats
|
|
10157
|
+
debugStreamStats: state.debugStreamStats,
|
|
10158
|
+
enhanceCountdown,
|
|
10159
|
+
autoProceedCountdown
|
|
10051
10160
|
}
|
|
10052
10161
|
),
|
|
10053
10162
|
state.helpOpen ? /* @__PURE__ */ jsx(HelpOverlay, {}) : null,
|