reasonix 0.12.13 → 0.12.15
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/dashboard/app.css +71 -0
- package/dashboard/app.js +188 -20
- package/dist/cli/index.js +196 -52
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -2816,6 +2816,7 @@ var CacheFirstLoop = class {
|
|
|
2816
2816
|
return;
|
|
2817
2817
|
}
|
|
2818
2818
|
}
|
|
2819
|
+
let workspaceSwitchPending = false;
|
|
2819
2820
|
for (const call of repairedCalls) {
|
|
2820
2821
|
const name = call.function?.name ?? "";
|
|
2821
2822
|
const args = call.function?.arguments ?? "{}";
|
|
@@ -2838,7 +2839,11 @@ var CacheFirstLoop = class {
|
|
|
2838
2839
|
});
|
|
2839
2840
|
for (const w of hookWarnings(preReport.outcomes, this._turn)) yield w;
|
|
2840
2841
|
let result;
|
|
2841
|
-
if (
|
|
2842
|
+
if (workspaceSwitchPending) {
|
|
2843
|
+
result = JSON.stringify({
|
|
2844
|
+
error: `${name}: deferred because change_workspace in the same batch is awaiting the user's approval. Re-issue this call on your next turn \u2014 the sandbox root may have changed.`
|
|
2845
|
+
});
|
|
2846
|
+
} else if (preReport.blocked) {
|
|
2842
2847
|
const blocking = preReport.outcomes[preReport.outcomes.length - 1];
|
|
2843
2848
|
const reason = (blocking?.stderr || blocking?.stdout || "blocked by PreToolUse hook").trim();
|
|
2844
2849
|
result = `[hook block] ${blocking?.hook.command ?? "<unknown>"}
|
|
@@ -2848,6 +2853,9 @@ ${reason}`;
|
|
|
2848
2853
|
signal,
|
|
2849
2854
|
maxResultTokens: DEFAULT_MAX_RESULT_TOKENS
|
|
2850
2855
|
});
|
|
2856
|
+
if (name === "change_workspace" && result.includes('"WorkspaceConfirmationError:')) {
|
|
2857
|
+
workspaceSwitchPending = true;
|
|
2858
|
+
}
|
|
2851
2859
|
const postReport = await runHooks({
|
|
2852
2860
|
hooks: this.hooks,
|
|
2853
2861
|
payload: {
|
|
@@ -7509,7 +7517,7 @@ import React27, { useState as useState12 } from "react";
|
|
|
7509
7517
|
|
|
7510
7518
|
// src/cli/ui/App.tsx
|
|
7511
7519
|
import * as pathMod7 from "path";
|
|
7512
|
-
import { Box as Box22, Static, Text as Text20,
|
|
7520
|
+
import { Box as Box22, Static, Text as Text20, useStdout as useStdout8 } from "ink";
|
|
7513
7521
|
import React24, { useCallback as useCallback4, useEffect as useEffect6, useMemo as useMemo3, useRef as useRef6, useState as useState10 } from "react";
|
|
7514
7522
|
|
|
7515
7523
|
// src/code/pending-edits.ts
|
|
@@ -8559,6 +8567,42 @@ async function handleModal(method, rest, body, ctx) {
|
|
|
8559
8567
|
ctx.resolveEditReview(choice);
|
|
8560
8568
|
return { status: 200, body: { resolved: true } };
|
|
8561
8569
|
}
|
|
8570
|
+
if (kind === "workspace") {
|
|
8571
|
+
if (!ctx.resolveWorkspaceConfirm) {
|
|
8572
|
+
return { status: 503, body: { error: "workspace modal resolution not wired" } };
|
|
8573
|
+
}
|
|
8574
|
+
if (choice !== "switch" && choice !== "deny") {
|
|
8575
|
+
return { status: 400, body: { error: "workspace choice must be switch / deny" } };
|
|
8576
|
+
}
|
|
8577
|
+
ctx.resolveWorkspaceConfirm(choice);
|
|
8578
|
+
return { status: 200, body: { resolved: true } };
|
|
8579
|
+
}
|
|
8580
|
+
if (kind === "checkpoint") {
|
|
8581
|
+
if (!ctx.resolveCheckpointConfirm) {
|
|
8582
|
+
return { status: 503, body: { error: "checkpoint modal resolution not wired" } };
|
|
8583
|
+
}
|
|
8584
|
+
if (choice !== "continue" && choice !== "revise" && choice !== "stop") {
|
|
8585
|
+
return {
|
|
8586
|
+
status: 400,
|
|
8587
|
+
body: { error: "checkpoint choice must be continue / revise / stop" }
|
|
8588
|
+
};
|
|
8589
|
+
}
|
|
8590
|
+
ctx.resolveCheckpointConfirm(
|
|
8591
|
+
choice,
|
|
8592
|
+
typeof text === "string" && text.trim() ? text : void 0
|
|
8593
|
+
);
|
|
8594
|
+
return { status: 200, body: { resolved: true } };
|
|
8595
|
+
}
|
|
8596
|
+
if (kind === "revision") {
|
|
8597
|
+
if (!ctx.resolveReviseConfirm) {
|
|
8598
|
+
return { status: 503, body: { error: "revision modal resolution not wired" } };
|
|
8599
|
+
}
|
|
8600
|
+
if (choice !== "accept" && choice !== "reject") {
|
|
8601
|
+
return { status: 400, body: { error: "revision choice must be accept / reject" } };
|
|
8602
|
+
}
|
|
8603
|
+
ctx.resolveReviseConfirm(choice);
|
|
8604
|
+
return { status: 200, body: { resolved: true } };
|
|
8605
|
+
}
|
|
8562
8606
|
return { status: 400, body: { error: `unknown modal kind: ${String(kind)}` } };
|
|
8563
8607
|
}
|
|
8564
8608
|
return { status: 405, body: { error: `method ${method} not supported on this path` } };
|
|
@@ -14509,9 +14553,9 @@ var SLASH_COMMANDS = [
|
|
|
14509
14553
|
{ cmd: "status", summary: "current model, flags, context, session" },
|
|
14510
14554
|
{
|
|
14511
14555
|
cmd: "preset",
|
|
14512
|
-
argsHint: "<
|
|
14513
|
-
summary: "
|
|
14514
|
-
argCompleter: ["
|
|
14556
|
+
argsHint: "<auto|flash|pro>",
|
|
14557
|
+
summary: "model bundle \u2014 auto escalates flash \u2192 pro, flash/pro lock",
|
|
14558
|
+
argCompleter: ["auto", "flash", "pro"]
|
|
14515
14559
|
},
|
|
14516
14560
|
{
|
|
14517
14561
|
cmd: "model",
|
|
@@ -15099,7 +15143,7 @@ var help = () => ({
|
|
|
15099
15143
|
" /help this message",
|
|
15100
15144
|
" /keys keyboard shortcuts + prompt prefixes (!, @, /)",
|
|
15101
15145
|
" /status show current settings",
|
|
15102
|
-
" /preset <
|
|
15146
|
+
" /preset <auto|flash|pro> model bundle \u2014 see below",
|
|
15103
15147
|
" /model <id> deepseek-v4-flash or deepseek-v4-pro",
|
|
15104
15148
|
" /pro [off] arm v4-pro for NEXT turn only (one-shot, auto-disarms)",
|
|
15105
15149
|
" /harvest [on|off] Pillar 2: structured plan-state extraction (OPT-IN \u2014 costs extra)",
|
|
@@ -15161,9 +15205,9 @@ var help = () => ({
|
|
|
15161
15205
|
" Trailing sentence punctuation (./,/)) is stripped automatically.",
|
|
15162
15206
|
"",
|
|
15163
15207
|
"Presets (branch + harvest are NEVER auto-enabled \u2014 opt-in only):",
|
|
15164
|
-
"
|
|
15165
|
-
"
|
|
15166
|
-
"
|
|
15208
|
+
" auto v4-flash \u2192 v4-pro on hard turns \u2190 default \xB7 cheap when easy, smart when hard",
|
|
15209
|
+
" flash v4-flash always cheapest \xB7 predictable per-turn cost",
|
|
15210
|
+
" pro v4-pro always ~3\xD7 flash (5/31) \xB7 hard multi-turn work",
|
|
15167
15211
|
"",
|
|
15168
15212
|
"Sessions (auto-enabled by default, named 'default'):",
|
|
15169
15213
|
" reasonix chat --session <name> use a different named session",
|
|
@@ -15933,39 +15977,43 @@ var preset = (args, loop2) => {
|
|
|
15933
15977
|
} catch {
|
|
15934
15978
|
}
|
|
15935
15979
|
};
|
|
15936
|
-
if (name === "
|
|
15980
|
+
if (name === "auto") {
|
|
15981
|
+
const p = PRESETS.auto;
|
|
15937
15982
|
loop2.configure({
|
|
15938
|
-
model:
|
|
15939
|
-
|
|
15940
|
-
|
|
15941
|
-
|
|
15983
|
+
model: p.model,
|
|
15984
|
+
autoEscalate: p.autoEscalate,
|
|
15985
|
+
reasoningEffort: p.reasoningEffort,
|
|
15986
|
+
harvest: p.harvest,
|
|
15987
|
+
branch: p.branch
|
|
15942
15988
|
});
|
|
15943
|
-
applyAndPersist(
|
|
15944
|
-
return { info: "preset \u2192
|
|
15989
|
+
applyAndPersist(p.reasoningEffort);
|
|
15990
|
+
return { info: "preset \u2192 auto (v4-flash \u2192 v4-pro on hard turns \xB7 default)" };
|
|
15945
15991
|
}
|
|
15946
|
-
if (name === "
|
|
15992
|
+
if (name === "flash") {
|
|
15993
|
+
const p = PRESETS.flash;
|
|
15947
15994
|
loop2.configure({
|
|
15948
|
-
model:
|
|
15949
|
-
|
|
15950
|
-
|
|
15951
|
-
|
|
15995
|
+
model: p.model,
|
|
15996
|
+
autoEscalate: p.autoEscalate,
|
|
15997
|
+
reasoningEffort: p.reasoningEffort,
|
|
15998
|
+
harvest: p.harvest,
|
|
15999
|
+
branch: p.branch
|
|
15952
16000
|
});
|
|
15953
|
-
applyAndPersist(
|
|
15954
|
-
return { info: "preset \u2192
|
|
16001
|
+
applyAndPersist(p.reasoningEffort);
|
|
16002
|
+
return { info: "preset \u2192 flash (v4-flash always \xB7 cheapest \xB7 /pro still bumps one turn)" };
|
|
15955
16003
|
}
|
|
15956
|
-
if (name === "
|
|
16004
|
+
if (name === "pro") {
|
|
16005
|
+
const p = PRESETS.pro;
|
|
15957
16006
|
loop2.configure({
|
|
15958
|
-
model:
|
|
15959
|
-
|
|
15960
|
-
|
|
15961
|
-
|
|
16007
|
+
model: p.model,
|
|
16008
|
+
autoEscalate: p.autoEscalate,
|
|
16009
|
+
reasoningEffort: p.reasoningEffort,
|
|
16010
|
+
harvest: p.harvest,
|
|
16011
|
+
branch: p.branch
|
|
15962
16012
|
});
|
|
15963
|
-
applyAndPersist(
|
|
15964
|
-
return {
|
|
15965
|
-
info: "preset \u2192 max (v4-pro \xB7 effort=max \xB7 ~12\xD7 fast \xB7 save for hard tasks, or use /pro for a single-turn bump)"
|
|
15966
|
-
};
|
|
16013
|
+
applyAndPersist(p.reasoningEffort);
|
|
16014
|
+
return { info: "preset \u2192 pro (v4-pro always \xB7 ~3\xD7 flash \xB7 for hard multi-turn work)" };
|
|
15967
16015
|
}
|
|
15968
|
-
return { info: "usage: /preset <
|
|
16016
|
+
return { info: "usage: /preset <auto|flash|pro>" };
|
|
15969
16017
|
};
|
|
15970
16018
|
var branch = (args, loop2) => {
|
|
15971
16019
|
const raw = (args[0] ?? "").toLowerCase();
|
|
@@ -17249,7 +17297,6 @@ function App({
|
|
|
17249
17297
|
codeMode,
|
|
17250
17298
|
noDashboard
|
|
17251
17299
|
}) {
|
|
17252
|
-
const { exit: exit2 } = useApp();
|
|
17253
17300
|
const [historical, setHistorical] = useState10([]);
|
|
17254
17301
|
const [streaming, setStreaming] = useState10(null);
|
|
17255
17302
|
const [input, setInput] = useState10("");
|
|
@@ -17606,6 +17653,52 @@ function App({
|
|
|
17606
17653
|
broadcastDashboardEvent({ kind: "modal-down", modalKind: "edit-review" });
|
|
17607
17654
|
};
|
|
17608
17655
|
}, [pendingEditReview, broadcastDashboardEvent]);
|
|
17656
|
+
useEffect6(() => {
|
|
17657
|
+
if (!pendingWorkspace) return;
|
|
17658
|
+
broadcastDashboardEvent({
|
|
17659
|
+
kind: "modal-up",
|
|
17660
|
+
modal: { kind: "workspace", path: pendingWorkspace.path }
|
|
17661
|
+
});
|
|
17662
|
+
return () => {
|
|
17663
|
+
broadcastDashboardEvent({ kind: "modal-down", modalKind: "workspace" });
|
|
17664
|
+
};
|
|
17665
|
+
}, [pendingWorkspace, broadcastDashboardEvent]);
|
|
17666
|
+
useEffect6(() => {
|
|
17667
|
+
if (!pendingCheckpoint) return;
|
|
17668
|
+
broadcastDashboardEvent({
|
|
17669
|
+
kind: "modal-up",
|
|
17670
|
+
modal: {
|
|
17671
|
+
kind: "checkpoint",
|
|
17672
|
+
stepId: pendingCheckpoint.stepId,
|
|
17673
|
+
title: pendingCheckpoint.title,
|
|
17674
|
+
completed: pendingCheckpoint.completed,
|
|
17675
|
+
total: pendingCheckpoint.total
|
|
17676
|
+
}
|
|
17677
|
+
});
|
|
17678
|
+
return () => {
|
|
17679
|
+
broadcastDashboardEvent({ kind: "modal-down", modalKind: "checkpoint" });
|
|
17680
|
+
};
|
|
17681
|
+
}, [pendingCheckpoint, broadcastDashboardEvent]);
|
|
17682
|
+
useEffect6(() => {
|
|
17683
|
+
if (!pendingRevision) return;
|
|
17684
|
+
broadcastDashboardEvent({
|
|
17685
|
+
kind: "modal-up",
|
|
17686
|
+
modal: {
|
|
17687
|
+
kind: "revision",
|
|
17688
|
+
reason: pendingRevision.reason,
|
|
17689
|
+
remainingSteps: pendingRevision.remainingSteps.map((s) => ({
|
|
17690
|
+
id: s.id,
|
|
17691
|
+
title: s.title,
|
|
17692
|
+
action: s.action,
|
|
17693
|
+
...s.risk ? { risk: s.risk } : {}
|
|
17694
|
+
})),
|
|
17695
|
+
...pendingRevision.summary ? { summary: pendingRevision.summary } : {}
|
|
17696
|
+
}
|
|
17697
|
+
});
|
|
17698
|
+
return () => {
|
|
17699
|
+
broadcastDashboardEvent({ kind: "modal-down", modalKind: "revision" });
|
|
17700
|
+
};
|
|
17701
|
+
}, [pendingRevision, broadcastDashboardEvent]);
|
|
17609
17702
|
const {
|
|
17610
17703
|
slashMatches,
|
|
17611
17704
|
slashSelected,
|
|
@@ -18174,6 +18267,31 @@ function App({
|
|
|
18174
18267
|
remaining: pendingEdits.current.length
|
|
18175
18268
|
};
|
|
18176
18269
|
}
|
|
18270
|
+
if (pendingWorkspace) {
|
|
18271
|
+
return { kind: "workspace", path: pendingWorkspace.path };
|
|
18272
|
+
}
|
|
18273
|
+
if (pendingCheckpoint) {
|
|
18274
|
+
return {
|
|
18275
|
+
kind: "checkpoint",
|
|
18276
|
+
stepId: pendingCheckpoint.stepId,
|
|
18277
|
+
title: pendingCheckpoint.title,
|
|
18278
|
+
completed: pendingCheckpoint.completed,
|
|
18279
|
+
total: pendingCheckpoint.total
|
|
18280
|
+
};
|
|
18281
|
+
}
|
|
18282
|
+
if (pendingRevision) {
|
|
18283
|
+
return {
|
|
18284
|
+
kind: "revision",
|
|
18285
|
+
reason: pendingRevision.reason,
|
|
18286
|
+
remainingSteps: pendingRevision.remainingSteps.map((s) => ({
|
|
18287
|
+
id: s.id,
|
|
18288
|
+
title: s.title,
|
|
18289
|
+
action: s.action,
|
|
18290
|
+
...s.risk ? { risk: s.risk } : {}
|
|
18291
|
+
})),
|
|
18292
|
+
...pendingRevision.summary ? { summary: pendingRevision.summary } : {}
|
|
18293
|
+
};
|
|
18294
|
+
}
|
|
18177
18295
|
return null;
|
|
18178
18296
|
},
|
|
18179
18297
|
resolveShellConfirm: (choice) => {
|
|
@@ -18200,6 +18318,22 @@ function App({
|
|
|
18200
18318
|
resolve13(choice);
|
|
18201
18319
|
}
|
|
18202
18320
|
},
|
|
18321
|
+
resolveWorkspaceConfirm: (choice) => {
|
|
18322
|
+
handleWorkspaceConfirmRef.current(choice).catch(() => void 0);
|
|
18323
|
+
},
|
|
18324
|
+
resolveCheckpointConfirm: (choice, text) => {
|
|
18325
|
+
if (choice === "revise" && typeof text === "string") {
|
|
18326
|
+
const snap = pendingCheckpoint;
|
|
18327
|
+
setPendingCheckpoint(null);
|
|
18328
|
+
if (!snap) return;
|
|
18329
|
+
handleCheckpointReviseSubmitRef.current(text, snap).catch(() => void 0);
|
|
18330
|
+
return;
|
|
18331
|
+
}
|
|
18332
|
+
handleCheckpointConfirmRef.current(choice).catch(() => void 0);
|
|
18333
|
+
},
|
|
18334
|
+
resolveReviseConfirm: (choice) => {
|
|
18335
|
+
handleReviseConfirmRef.current(choice).catch(() => void 0);
|
|
18336
|
+
},
|
|
18203
18337
|
// ---------- v0.14 mutation surface ----------
|
|
18204
18338
|
reloadHooks: () => {
|
|
18205
18339
|
const fresh = loadHooks({ projectRoot: codeMode ? currentRootDirRef.current : void 0 });
|
|
@@ -18220,7 +18354,10 @@ function App({
|
|
|
18220
18354
|
togglePlanMode,
|
|
18221
18355
|
pendingShell,
|
|
18222
18356
|
pendingChoice,
|
|
18223
|
-
pendingEditReview
|
|
18357
|
+
pendingEditReview,
|
|
18358
|
+
pendingWorkspace,
|
|
18359
|
+
pendingCheckpoint,
|
|
18360
|
+
pendingRevision
|
|
18224
18361
|
]);
|
|
18225
18362
|
const stopDashboard = useCallback4(async () => {
|
|
18226
18363
|
const h = dashboardRef.current;
|
|
@@ -18477,8 +18614,7 @@ function App({
|
|
|
18477
18614
|
});
|
|
18478
18615
|
if (result.exit) {
|
|
18479
18616
|
if (activeLoopRef.current) stopLoop();
|
|
18480
|
-
|
|
18481
|
-
exit2();
|
|
18617
|
+
quitProcess();
|
|
18482
18618
|
return;
|
|
18483
18619
|
}
|
|
18484
18620
|
if (result.clear && result.info) {
|
|
@@ -19051,7 +19187,7 @@ function App({
|
|
|
19051
19187
|
codeShowEdit,
|
|
19052
19188
|
codeUndo,
|
|
19053
19189
|
currentRootDir,
|
|
19054
|
-
|
|
19190
|
+
quitProcess,
|
|
19055
19191
|
hookList,
|
|
19056
19192
|
loop2,
|
|
19057
19193
|
latestVersion,
|
|
@@ -19416,8 +19552,8 @@ Stay in plan mode \u2014 address the feedback (explore more if needed), then sub
|
|
|
19416
19552
|
[]
|
|
19417
19553
|
);
|
|
19418
19554
|
const handleCheckpointReviseSubmit = useCallback4(
|
|
19419
|
-
async (feedback) => {
|
|
19420
|
-
const snap = stagedCheckpointRevise;
|
|
19555
|
+
async (feedback, snapOverride) => {
|
|
19556
|
+
const snap = snapOverride ?? stagedCheckpointRevise;
|
|
19421
19557
|
setStagedCheckpointRevise(null);
|
|
19422
19558
|
if (!snap) return;
|
|
19423
19559
|
const label = snap.title ? `${snap.stepId} \xB7 ${snap.title}` : snap.stepId;
|
|
@@ -19501,6 +19637,14 @@ If the feedback only tweaks how you execute (extra constraints, style preference
|
|
|
19501
19637
|
async (choice) => handleChoiceConfirmRef.current(choice),
|
|
19502
19638
|
[]
|
|
19503
19639
|
);
|
|
19640
|
+
const handleWorkspaceConfirmRef = useRef6(handleWorkspaceConfirm);
|
|
19641
|
+
useEffect6(() => {
|
|
19642
|
+
handleWorkspaceConfirmRef.current = handleWorkspaceConfirm;
|
|
19643
|
+
}, [handleWorkspaceConfirm]);
|
|
19644
|
+
const handleCheckpointReviseSubmitRef = useRef6(handleCheckpointReviseSubmit);
|
|
19645
|
+
useEffect6(() => {
|
|
19646
|
+
handleCheckpointReviseSubmitRef.current = handleCheckpointReviseSubmit;
|
|
19647
|
+
}, [handleCheckpointReviseSubmit]);
|
|
19504
19648
|
const handleChoiceCustomSubmit = useCallback4(
|
|
19505
19649
|
async (answer) => {
|
|
19506
19650
|
setStagedChoiceCustom(null);
|
|
@@ -19798,13 +19942,13 @@ function relativeTime2(date) {
|
|
|
19798
19942
|
}
|
|
19799
19943
|
|
|
19800
19944
|
// src/cli/ui/Setup.tsx
|
|
19801
|
-
import { Box as Box24, Text as Text22, useApp
|
|
19945
|
+
import { Box as Box24, Text as Text22, useApp } from "ink";
|
|
19802
19946
|
import TextInput from "ink-text-input";
|
|
19803
19947
|
import React26, { useState as useState11 } from "react";
|
|
19804
19948
|
function Setup({ onReady }) {
|
|
19805
19949
|
const [value, setValue] = useState11("");
|
|
19806
19950
|
const [error, setError] = useState11(null);
|
|
19807
|
-
const { exit: exit2 } =
|
|
19951
|
+
const { exit: exit2 } = useApp();
|
|
19808
19952
|
const handleSubmit2 = (raw) => {
|
|
19809
19953
|
const trimmed = raw.trim();
|
|
19810
19954
|
if (trimmed === "/exit" || trimmed === "/quit") {
|
|
@@ -20063,7 +20207,7 @@ import { render as render2 } from "ink";
|
|
|
20063
20207
|
import React30 from "react";
|
|
20064
20208
|
|
|
20065
20209
|
// src/cli/ui/DiffApp.tsx
|
|
20066
|
-
import { Box as Box26, Static as Static2, Text as Text24, useApp as
|
|
20210
|
+
import { Box as Box26, Static as Static2, Text as Text24, useApp as useApp2, useInput } from "ink";
|
|
20067
20211
|
import React29, { useState as useState13 } from "react";
|
|
20068
20212
|
|
|
20069
20213
|
// src/cli/ui/RecordView.tsx
|
|
@@ -20105,7 +20249,7 @@ function truncate2(s, max) {
|
|
|
20105
20249
|
|
|
20106
20250
|
// src/cli/ui/DiffApp.tsx
|
|
20107
20251
|
function DiffApp({ report }) {
|
|
20108
|
-
const { exit: exit2 } =
|
|
20252
|
+
const { exit: exit2 } = useApp2();
|
|
20109
20253
|
const maxIdx = Math.max(0, report.pairs.length - 1);
|
|
20110
20254
|
const initialIdx = report.firstDivergenceTurn ? report.pairs.findIndex((p) => p.turn === report.firstDivergenceTurn) : 0;
|
|
20111
20255
|
const [idx, setIdx] = useState13(Math.max(0, initialIdx));
|
|
@@ -20548,10 +20692,10 @@ import { render as render3 } from "ink";
|
|
|
20548
20692
|
import React32 from "react";
|
|
20549
20693
|
|
|
20550
20694
|
// src/cli/ui/ReplayApp.tsx
|
|
20551
|
-
import { Box as Box27, Static as Static3, Text as Text25, useApp as
|
|
20695
|
+
import { Box as Box27, Static as Static3, Text as Text25, useApp as useApp3, useInput as useInput2 } from "ink";
|
|
20552
20696
|
import React31, { useMemo as useMemo4, useState as useState14 } from "react";
|
|
20553
20697
|
function ReplayApp({ meta, pages }) {
|
|
20554
|
-
const { exit: exit2 } =
|
|
20698
|
+
const { exit: exit2 } = useApp3();
|
|
20555
20699
|
const maxIdx = Math.max(0, pages.length - 1);
|
|
20556
20700
|
const [idx, setIdx] = useState14(maxIdx);
|
|
20557
20701
|
useInput2((input, key) => {
|
|
@@ -20916,16 +21060,16 @@ import { render as render4 } from "ink";
|
|
|
20916
21060
|
import React34 from "react";
|
|
20917
21061
|
|
|
20918
21062
|
// src/cli/ui/Wizard.tsx
|
|
20919
|
-
import { Box as Box28, Text as Text26, useApp as
|
|
21063
|
+
import { Box as Box28, Text as Text26, useApp as useApp4, useInput as useInput3 } from "ink";
|
|
20920
21064
|
import TextInput2 from "ink-text-input";
|
|
20921
21065
|
import React33, { useState as useState15 } from "react";
|
|
20922
21066
|
var CATALOG_BY_NAME = new Map(MCP_CATALOG.map((e) => [e.name, e]));
|
|
20923
21067
|
function Wizard({ onComplete, onCancel, existingApiKey, initial }) {
|
|
20924
|
-
const { exit: exit2 } =
|
|
21068
|
+
const { exit: exit2 } = useApp4();
|
|
20925
21069
|
const [step, setStep] = useState15(existingApiKey ? "preset" : "apiKey");
|
|
20926
21070
|
const [data, setData] = useState15({
|
|
20927
21071
|
apiKey: existingApiKey ?? "",
|
|
20928
|
-
preset: initial?.preset ?? "
|
|
21072
|
+
preset: initial?.preset ?? "auto",
|
|
20929
21073
|
selectedCatalog: deriveInitialCatalog(initial?.mcp ?? []),
|
|
20930
21074
|
catalogArgs: {}
|
|
20931
21075
|
});
|
|
@@ -21370,7 +21514,7 @@ program.command("setup").description("Interactive wizard \u2014 API key, preset,
|
|
|
21370
21514
|
await setupCommand({});
|
|
21371
21515
|
});
|
|
21372
21516
|
program.command("code [dir]").description(
|
|
21373
|
-
"Code-editing chat \u2014 filesystem tools rooted at <dir> (default: cwd), coding system prompt, v4-flash. Model proposes SEARCH/REPLACE blocks; Reasonix applies them to disk. Use /preset
|
|
21517
|
+
"Code-editing chat \u2014 filesystem tools rooted at <dir> (default: cwd), coding system prompt, v4-flash baseline. Model proposes SEARCH/REPLACE blocks; Reasonix applies them to disk. Use /preset pro or /pro to lock v4-pro on hard tasks."
|
|
21374
21518
|
).option("-m, --model <id>", "Override default model (v4-flash)").option("--no-session", "Disable session persistence for this run").option("-r, --resume", "Skip the session picker \u2014 always continue prior messages").option("-n, --new", "Skip the session picker \u2014 always wipe prior messages and start fresh").option("--transcript <path>", "Write a JSONL transcript to this path").option(
|
|
21375
21519
|
"--harvest",
|
|
21376
21520
|
"Opt-in Pillar-2 plan-state extraction. Adds one flash call per turn; off by default (no preset enables it)."
|
|
@@ -21391,7 +21535,7 @@ program.command("code [dir]").description(
|
|
|
21391
21535
|
});
|
|
21392
21536
|
program.command("chat").description("Interactive Ink TUI with live cache/cost panel.").option("-m, --model <id>", "DeepSeek model id (overrides preset)").option("-s, --system <prompt>", "System prompt (pinned in the immutable prefix)", DEFAULT_SYSTEM).option("--transcript <path>", "Write a JSONL transcript to this path").option(
|
|
21393
21537
|
"--preset <name>",
|
|
21394
|
-
"Model
|
|
21538
|
+
"Model bundle. One of: auto (flash \u2192 pro on hard turns, default), flash (always flash), pro (always pro). Overrides config.preset."
|
|
21395
21539
|
).option(
|
|
21396
21540
|
"--harvest",
|
|
21397
21541
|
"Opt-in Pillar-2 plan-state extraction. Off by default \u2014 no preset enables it."
|
|
@@ -21444,7 +21588,7 @@ program.command("chat").description("Interactive Ink TUI with live cache/cost pa
|
|
|
21444
21588
|
noDashboard: opts.dashboard === false
|
|
21445
21589
|
});
|
|
21446
21590
|
});
|
|
21447
|
-
program.command("run <task>").description("Run a single task non-interactively, streaming output.").option("-m, --model <id>", "DeepSeek model id (overrides preset)").option("-s, --system <prompt>", "System prompt", DEFAULT_SYSTEM).option("--preset <name>", "
|
|
21591
|
+
program.command("run <task>").description("Run a single task non-interactively, streaming output.").option("-m, --model <id>", "DeepSeek model id (overrides preset)").option("-s, --system <prompt>", "System prompt", DEFAULT_SYSTEM).option("--preset <name>", "Model bundle: auto | flash | pro (default: auto)").option("--harvest", "Extract typed plan state from R1 reasoning (Pillar 2)").option(
|
|
21448
21592
|
"--branch <n>",
|
|
21449
21593
|
"Self-consistency: run N parallel samples per turn and pick the most confident",
|
|
21450
21594
|
(v) => Number.parseInt(v, 10)
|