@carboncode/cli 0.1.1 → 0.1.4
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/cli/{acp-E6QAGSG4.js → acp-6J54TVVC.js} +16 -16
- package/dist/cli/{chat-6MBLB7MU.js → chat-UTY5WLP3.js} +21 -21
- package/dist/cli/{chunk-676EW5HH.js → chunk-3N7FTZVE.js} +2 -2
- package/dist/cli/{chunk-LRXTF6NZ.js → chunk-ACHQFKW2.js} +8 -8
- package/dist/cli/{chunk-X3IHKOYW.js → chunk-ANVEA3RU.js} +2 -2
- package/dist/cli/{chunk-U7RHC7D6.js → chunk-BXMMGFAL.js} +2 -2
- package/dist/cli/{chunk-2UXHZAXP.js → chunk-COTWTQQZ.js} +2 -2
- package/dist/cli/{chunk-OYAIE6C7.js → chunk-D3ACJ6D5.js} +2 -2
- package/dist/cli/{chunk-RLQQOIBS.js → chunk-DSQNSP7F.js} +2 -2
- package/dist/cli/{chunk-QLPHVU3W.js → chunk-FKSYTVWZ.js} +2 -2
- package/dist/cli/{chunk-7R3PKZXB.js → chunk-FXG7CSGY.js} +7 -7
- package/dist/cli/{chunk-2EKLWOE3.js → chunk-HWYTH42F.js} +739 -647
- package/dist/cli/chunk-HWYTH42F.js.map +1 -0
- package/dist/cli/{chunk-ZADUQPQP.js → chunk-K43DXH3G.js} +29 -60
- package/dist/cli/chunk-K43DXH3G.js.map +1 -0
- package/dist/cli/{chunk-PT4UDK7Z.js → chunk-LNU3CR7X.js} +2 -2
- package/dist/cli/{chunk-NCMC7AMN.js → chunk-MXUSER5C.js} +2 -2
- package/dist/cli/{chunk-B2RA3NMS.js → chunk-NQJYZKEU.js} +2 -2
- package/dist/cli/{chunk-3PNIUDTA.js → chunk-OB5XR5HG.js} +2 -2
- package/dist/cli/{chunk-NTF4IE7G.js → chunk-OY5GGU6D.js} +2 -2
- package/dist/cli/{chunk-V6A26HU5.js → chunk-R677DIFU.js} +6 -4
- package/dist/cli/chunk-R677DIFU.js.map +1 -0
- package/dist/cli/{chunk-BYBOY5UY.js → chunk-RSQMO6CF.js} +5 -5
- package/dist/cli/{chunk-GG2V37EH.js → chunk-RUPXIRNL.js} +2 -2
- package/dist/cli/{chunk-XJIF545V.js → chunk-S4YD3N3X.js} +6 -6
- package/dist/cli/{chunk-J6UWUIT2.js → chunk-T6SBUSG2.js} +3 -3
- package/dist/cli/{chunk-VVQTSZWX.js → chunk-UGPC4LPM.js} +2 -2
- package/dist/cli/{chunk-MDQWQYBS.js → chunk-X4UJ6Q6M.js} +3 -3
- package/dist/cli/{code-LBRSX6ZI.js → code-I3TP5QVR.js} +24 -24
- package/dist/cli/{commands-PCHFC3CL.js → commands-HMQPRVNT.js} +4 -4
- package/dist/cli/{commit-HDN6VJBA.js → commit-WIY4B3X4.js} +3 -3
- package/dist/cli/{desktop-RHWSCBHO.js → desktop-MGOG3AWV.js} +17 -17
- package/dist/cli/{diff-MV5JNUH4.js → diff-57LRKCB7.js} +8 -8
- package/dist/cli/{doctor-QLO4V4DD.js → doctor-5FDRBIXE.js} +8 -8
- package/dist/cli/index.js +32 -32
- package/dist/cli/{mcp-JSHFAINM.js → mcp-HJHTNRZF.js} +2 -2
- package/dist/cli/{mcp-browse-ESMKKKYH.js → mcp-browse-C2PJRQBO.js} +2 -2
- package/dist/cli/{mcp-inspect-WSUN36FM.js → mcp-inspect-JBFXV2II.js} +2 -2
- package/dist/cli/{prompt-5LMDCF4M.js → prompt-U62OVZNY.js} +3 -3
- package/dist/cli/{replay-D3ILR2YO.js → replay-M3YKBVAM.js} +8 -8
- package/dist/cli/{run-6NN3P5JM.js → run-V6X5GXCR.js} +13 -13
- package/dist/cli/{server-HE7LFAHH.js → server-73KDDDDD.js} +75 -56
- package/dist/cli/server-73KDDDDD.js.map +1 -0
- package/dist/cli/{sessions-HXDBQM3V.js → sessions-B266WVM3.js} +12 -12
- package/dist/cli/{setup-EP3UPG3F.js → setup-SWX5E3W2.js} +5 -5
- package/dist/cli/{stats-5RC6P5TN.js → stats-VPPKS6UF.js} +6 -6
- package/dist/cli/{version-AIR25TRN.js → version-TVHAEHWY.js} +12 -12
- package/dist/index.d.ts +2 -0
- package/dist/index.js +32 -61
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/cli/chunk-2EKLWOE3.js.map +0 -1
- package/dist/cli/chunk-V6A26HU5.js.map +0 -1
- package/dist/cli/chunk-ZADUQPQP.js.map +0 -1
- package/dist/cli/server-HE7LFAHH.js.map +0 -1
- /package/dist/cli/{acp-E6QAGSG4.js.map → acp-6J54TVVC.js.map} +0 -0
- /package/dist/cli/{chat-6MBLB7MU.js.map → chat-UTY5WLP3.js.map} +0 -0
- /package/dist/cli/{chunk-676EW5HH.js.map → chunk-3N7FTZVE.js.map} +0 -0
- /package/dist/cli/{chunk-LRXTF6NZ.js.map → chunk-ACHQFKW2.js.map} +0 -0
- /package/dist/cli/{chunk-X3IHKOYW.js.map → chunk-ANVEA3RU.js.map} +0 -0
- /package/dist/cli/{chunk-U7RHC7D6.js.map → chunk-BXMMGFAL.js.map} +0 -0
- /package/dist/cli/{chunk-2UXHZAXP.js.map → chunk-COTWTQQZ.js.map} +0 -0
- /package/dist/cli/{chunk-OYAIE6C7.js.map → chunk-D3ACJ6D5.js.map} +0 -0
- /package/dist/cli/{chunk-RLQQOIBS.js.map → chunk-DSQNSP7F.js.map} +0 -0
- /package/dist/cli/{chunk-QLPHVU3W.js.map → chunk-FKSYTVWZ.js.map} +0 -0
- /package/dist/cli/{chunk-7R3PKZXB.js.map → chunk-FXG7CSGY.js.map} +0 -0
- /package/dist/cli/{chunk-PT4UDK7Z.js.map → chunk-LNU3CR7X.js.map} +0 -0
- /package/dist/cli/{chunk-NCMC7AMN.js.map → chunk-MXUSER5C.js.map} +0 -0
- /package/dist/cli/{chunk-B2RA3NMS.js.map → chunk-NQJYZKEU.js.map} +0 -0
- /package/dist/cli/{chunk-3PNIUDTA.js.map → chunk-OB5XR5HG.js.map} +0 -0
- /package/dist/cli/{chunk-NTF4IE7G.js.map → chunk-OY5GGU6D.js.map} +0 -0
- /package/dist/cli/{chunk-BYBOY5UY.js.map → chunk-RSQMO6CF.js.map} +0 -0
- /package/dist/cli/{chunk-GG2V37EH.js.map → chunk-RUPXIRNL.js.map} +0 -0
- /package/dist/cli/{chunk-XJIF545V.js.map → chunk-S4YD3N3X.js.map} +0 -0
- /package/dist/cli/{chunk-J6UWUIT2.js.map → chunk-T6SBUSG2.js.map} +0 -0
- /package/dist/cli/{chunk-VVQTSZWX.js.map → chunk-UGPC4LPM.js.map} +0 -0
- /package/dist/cli/{chunk-MDQWQYBS.js.map → chunk-X4UJ6Q6M.js.map} +0 -0
- /package/dist/cli/{code-LBRSX6ZI.js.map → code-I3TP5QVR.js.map} +0 -0
- /package/dist/cli/{commands-PCHFC3CL.js.map → commands-HMQPRVNT.js.map} +0 -0
- /package/dist/cli/{commit-HDN6VJBA.js.map → commit-WIY4B3X4.js.map} +0 -0
- /package/dist/cli/{desktop-RHWSCBHO.js.map → desktop-MGOG3AWV.js.map} +0 -0
- /package/dist/cli/{diff-MV5JNUH4.js.map → diff-57LRKCB7.js.map} +0 -0
- /package/dist/cli/{doctor-QLO4V4DD.js.map → doctor-5FDRBIXE.js.map} +0 -0
- /package/dist/cli/{mcp-JSHFAINM.js.map → mcp-HJHTNRZF.js.map} +0 -0
- /package/dist/cli/{mcp-browse-ESMKKKYH.js.map → mcp-browse-C2PJRQBO.js.map} +0 -0
- /package/dist/cli/{mcp-inspect-WSUN36FM.js.map → mcp-inspect-JBFXV2II.js.map} +0 -0
- /package/dist/cli/{prompt-5LMDCF4M.js.map → prompt-U62OVZNY.js.map} +0 -0
- /package/dist/cli/{replay-D3ILR2YO.js.map → replay-M3YKBVAM.js.map} +0 -0
- /package/dist/cli/{run-6NN3P5JM.js.map → run-V6X5GXCR.js.map} +0 -0
- /package/dist/cli/{sessions-HXDBQM3V.js.map → sessions-B266WVM3.js.map} +0 -0
- /package/dist/cli/{setup-EP3UPG3F.js.map → setup-SWX5E3W2.js.map} +0 -0
- /package/dist/cli/{stats-5RC6P5TN.js.map → stats-VPPKS6UF.js.map} +0 -0
- /package/dist/cli/{version-AIR25TRN.js.map → version-TVHAEHWY.js.map} +0 -0
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-JMBMLOBP.js";
|
|
10
10
|
import {
|
|
11
11
|
createMcpRuntime
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-RSQMO6CF.js";
|
|
13
13
|
import {
|
|
14
14
|
Eventizer,
|
|
15
15
|
autoResolveVerdict,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
formatMcpLifecycleEvent,
|
|
21
21
|
formatMcpSlowToast
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-D3ACJ6D5.js";
|
|
23
23
|
import {
|
|
24
24
|
buildTransportFromSpec
|
|
25
25
|
} from "./chunk-VPMBGAND.js";
|
|
@@ -54,19 +54,19 @@ import {
|
|
|
54
54
|
toWholeFileEditBlock,
|
|
55
55
|
walkFilesStream,
|
|
56
56
|
webFetch
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-ACHQFKW2.js";
|
|
58
58
|
import {
|
|
59
59
|
openTranscriptFile,
|
|
60
60
|
recordFromLoopEvent,
|
|
61
61
|
writeRecord
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-X4UJ6Q6M.js";
|
|
63
63
|
import {
|
|
64
64
|
McpClient
|
|
65
65
|
} from "./chunk-GALC45Q2.js";
|
|
66
66
|
import {
|
|
67
67
|
MemoryStore,
|
|
68
68
|
effectivePriority
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-FKSYTVWZ.js";
|
|
70
70
|
import {
|
|
71
71
|
wrapper_default
|
|
72
72
|
} from "./chunk-FEZK652I.js";
|
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
KeystrokeProvider,
|
|
75
75
|
SingleSelect,
|
|
76
76
|
useKeystroke
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-COTWTQQZ.js";
|
|
78
78
|
import {
|
|
79
79
|
COLOR,
|
|
80
80
|
GLYPH,
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
ThemeProvider,
|
|
83
83
|
useColor,
|
|
84
84
|
useThemeTokens
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-UGPC4LPM.js";
|
|
86
86
|
import {
|
|
87
87
|
Box_default,
|
|
88
88
|
Text,
|
|
@@ -102,20 +102,20 @@ import {
|
|
|
102
102
|
} from "./chunk-2425HK6U.js";
|
|
103
103
|
import {
|
|
104
104
|
runDoctorChecks
|
|
105
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-FXG7CSGY.js";
|
|
106
106
|
import {
|
|
107
107
|
countTokensBounded
|
|
108
108
|
} from "./chunk-6OWJV3YW.js";
|
|
109
109
|
import {
|
|
110
110
|
DeepSeekClient,
|
|
111
111
|
pickPrimaryBalance
|
|
112
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-LNU3CR7X.js";
|
|
113
113
|
import {
|
|
114
114
|
loadDotenv
|
|
115
115
|
} from "./chunk-2UQP6H6T.js";
|
|
116
116
|
import {
|
|
117
117
|
renderDashboard
|
|
118
|
-
} from "./chunk-
|
|
118
|
+
} from "./chunk-T6SBUSG2.js";
|
|
119
119
|
import {
|
|
120
120
|
MANUAL_UPDATE_COMMANDS,
|
|
121
121
|
planUpdate
|
|
@@ -158,7 +158,7 @@ import {
|
|
|
158
158
|
formatCommandResult,
|
|
159
159
|
pauseGate,
|
|
160
160
|
runCommand
|
|
161
|
-
} from "./chunk-
|
|
161
|
+
} from "./chunk-MXUSER5C.js";
|
|
162
162
|
import {
|
|
163
163
|
PROJECT_MEMORY_FILE,
|
|
164
164
|
SkillStore,
|
|
@@ -173,7 +173,7 @@ import {
|
|
|
173
173
|
loadHooks,
|
|
174
174
|
projectSettingsPath,
|
|
175
175
|
runHooks
|
|
176
|
-
} from "./chunk-
|
|
176
|
+
} from "./chunk-OB5XR5HG.js";
|
|
177
177
|
import {
|
|
178
178
|
deleteSession,
|
|
179
179
|
detectGitBranch,
|
|
@@ -196,12 +196,12 @@ import {
|
|
|
196
196
|
appendUsage,
|
|
197
197
|
defaultUsageLogPath,
|
|
198
198
|
readUsageLog
|
|
199
|
-
} from "./chunk-
|
|
199
|
+
} from "./chunk-BXMMGFAL.js";
|
|
200
200
|
import {
|
|
201
201
|
DEEPSEEK_CONTEXT_TOKENS,
|
|
202
202
|
DEFAULT_CONTEXT_TOKENS,
|
|
203
203
|
pricingFor
|
|
204
|
-
} from "./chunk-
|
|
204
|
+
} from "./chunk-OY5GGU6D.js";
|
|
205
205
|
import {
|
|
206
206
|
getLanguage,
|
|
207
207
|
getSupportedLanguages,
|
|
@@ -210,7 +210,7 @@ import {
|
|
|
210
210
|
setLanguage,
|
|
211
211
|
t,
|
|
212
212
|
tObj
|
|
213
|
-
} from "./chunk-
|
|
213
|
+
} from "./chunk-R677DIFU.js";
|
|
214
214
|
import {
|
|
215
215
|
CARD,
|
|
216
216
|
FG,
|
|
@@ -263,7 +263,7 @@ import {
|
|
|
263
263
|
webSearchEndpoint,
|
|
264
264
|
webSearchEngine,
|
|
265
265
|
writeConfig
|
|
266
|
-
} from "./chunk-
|
|
266
|
+
} from "./chunk-K43DXH3G.js";
|
|
267
267
|
import {
|
|
268
268
|
VERSION,
|
|
269
269
|
compareVersions,
|
|
@@ -44315,7 +44315,7 @@ var require_dist = __commonJS({
|
|
|
44315
44315
|
});
|
|
44316
44316
|
|
|
44317
44317
|
// src/cli/commands/chat.tsx
|
|
44318
|
-
var
|
|
44318
|
+
var import_react94 = __toESM(require_react(), 1);
|
|
44319
44319
|
|
|
44320
44320
|
// src/qq/channel.ts
|
|
44321
44321
|
import { mkdirSync, readFileSync, unlinkSync, writeFileSync } from "fs";
|
|
@@ -44760,10 +44760,45 @@ var QQChannel = class {
|
|
|
44760
44760
|
}
|
|
44761
44761
|
};
|
|
44762
44762
|
|
|
44763
|
+
// src/cli/startup-update.ts
|
|
44764
|
+
var PACKAGE_MANAGER_SOURCES = /* @__PURE__ */ new Set(["npm", "bun", "pnpm", "yarn"]);
|
|
44765
|
+
function envFlagEnabled(value) {
|
|
44766
|
+
if (value === void 0) return false;
|
|
44767
|
+
const normalized = value.trim().toLowerCase();
|
|
44768
|
+
return normalized !== "" && normalized !== "0" && normalized !== "false";
|
|
44769
|
+
}
|
|
44770
|
+
function shouldRunStartupUpdateCheck(input) {
|
|
44771
|
+
if (input.config.updateCheck === false) return false;
|
|
44772
|
+
if (!input.stdoutIsTTY) return false;
|
|
44773
|
+
if (envFlagEnabled(input.env.CARBONCODE_NO_UPDATE_CHECK)) return false;
|
|
44774
|
+
if (envFlagEnabled(input.env.CI)) return false;
|
|
44775
|
+
return PACKAGE_MANAGER_SOURCES.has(input.installSource);
|
|
44776
|
+
}
|
|
44777
|
+
async function getStartupUpdateHint(opts) {
|
|
44778
|
+
if (!shouldRunStartupUpdateCheck(opts)) return null;
|
|
44779
|
+
const current = opts.current ?? VERSION;
|
|
44780
|
+
const latest = await (opts.fetchLatest ?? (() => getLatestVersion()))();
|
|
44781
|
+
if (!latest) return null;
|
|
44782
|
+
if (compareVersions(current, latest) >= 0) return null;
|
|
44783
|
+
return t("startup.updateAvailable", { current, latest });
|
|
44784
|
+
}
|
|
44785
|
+
function createStartupUpdateCheck(config, opts = {}) {
|
|
44786
|
+
const env = opts.env ?? process.env;
|
|
44787
|
+
const installSource = opts.installSource ?? detectInstallSource();
|
|
44788
|
+
const stdoutIsTTY = opts.stdoutIsTTY ?? process.stdout.isTTY === true;
|
|
44789
|
+
const gate = { config, env, installSource, stdoutIsTTY };
|
|
44790
|
+
if (!shouldRunStartupUpdateCheck(gate)) return void 0;
|
|
44791
|
+
return () => getStartupUpdateHint({
|
|
44792
|
+
...gate,
|
|
44793
|
+
current: opts.current,
|
|
44794
|
+
fetchLatest: opts.fetchLatest
|
|
44795
|
+
});
|
|
44796
|
+
}
|
|
44797
|
+
|
|
44763
44798
|
// src/cli/ui/App.tsx
|
|
44764
44799
|
import { statSync as statSync2 } from "fs";
|
|
44765
44800
|
import { resolve as resolve4 } from "path";
|
|
44766
|
-
var
|
|
44801
|
+
var import_react91 = __toESM(require_react(), 1);
|
|
44767
44802
|
|
|
44768
44803
|
// src/code/pending-edits.ts
|
|
44769
44804
|
import { existsSync, mkdirSync as mkdirSync2, readFileSync as readFileSync2, unlinkSync as unlinkSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
@@ -55453,15 +55488,14 @@ function plainText(tokens) {
|
|
|
55453
55488
|
}
|
|
55454
55489
|
|
|
55455
55490
|
// src/cli/ui/cards/StreamingCard.tsx
|
|
55456
|
-
var STREAMING_PREVIEW_LINES2 = 4;
|
|
55457
55491
|
var EXPANDED_MAX_LINES = 60;
|
|
55458
55492
|
function StreamingCard({ card }) {
|
|
55459
55493
|
const { stdout } = use_stdout_default();
|
|
55460
55494
|
const cols = stdout?.columns ?? 80;
|
|
55461
55495
|
const expanded = (0, import_react74.useContext)(LiveExpandContext);
|
|
55462
|
-
const reserveCap = expanded ? EXPANDED_MAX_LINES + 2 :
|
|
55496
|
+
const reserveCap = expanded ? EXPANDED_MAX_LINES + 2 : Number.POSITIVE_INFINITY;
|
|
55463
55497
|
useReserveRows("stream", {
|
|
55464
|
-
min:
|
|
55498
|
+
min: 1,
|
|
55465
55499
|
max: reserveCap
|
|
55466
55500
|
});
|
|
55467
55501
|
useSlowTick();
|
|
@@ -55470,9 +55504,7 @@ function StreamingCard({ card }) {
|
|
|
55470
55504
|
if (card.done && !card.aborted) {
|
|
55471
55505
|
return /* @__PURE__ */ import_react74.default.createElement(Card, { tone: TONE.ok }, /* @__PURE__ */ import_react74.default.createElement(CardHeader, { glyph: "\u2039", tone: TONE.ok, title: t("cardTitles.reply") }), /* @__PURE__ */ import_react74.default.createElement(Markdown, { text: card.text }));
|
|
55472
55506
|
}
|
|
55473
|
-
const
|
|
55474
|
-
const visible = visualLines.slice(-cap);
|
|
55475
|
-
const droppedAbove = Math.max(0, visualLines.length - visible.length);
|
|
55507
|
+
const visible = visualLines;
|
|
55476
55508
|
const aborted = !!card.aborted;
|
|
55477
55509
|
const headColor = aborted ? TONE.err : TONE_ACTIVE.brand;
|
|
55478
55510
|
const glyph = aborted ? "\u2298" : "\u25CF";
|
|
@@ -55485,9 +55517,7 @@ function StreamingCard({ card }) {
|
|
|
55485
55517
|
title: headLabel,
|
|
55486
55518
|
right: aborted ? null : /* @__PURE__ */ import_react74.default.createElement(Spinner, { kind: "braille", color: TONE_ACTIVE.brand })
|
|
55487
55519
|
}
|
|
55488
|
-
),
|
|
55489
|
-
count: droppedAbove
|
|
55490
|
-
})) : null, visible.map((line, i) => /* @__PURE__ */ import_react74.default.createElement(Box_default, { key: `${card.id}:${visualLines.length - visible.length + i}`, flexDirection: "row" }, /* @__PURE__ */ import_react74.default.createElement(Text, { color: aborted ? FG.meta : FG.body }, clipToCells(line, lineCells)))), aborted ? /* @__PURE__ */ import_react74.default.createElement(Text, { color: FG.faint }, t("cardLabels.truncatedByEsc")) : null);
|
|
55520
|
+
), visible.map((line, i) => /* @__PURE__ */ import_react74.default.createElement(Box_default, { key: `${card.id}:${i}`, flexDirection: "row" }, /* @__PURE__ */ import_react74.default.createElement(Text, { color: aborted ? FG.meta : FG.body }, clipToCells(line, lineCells)))), aborted ? /* @__PURE__ */ import_react74.default.createElement(Text, { color: FG.faint }, t("cardLabels.truncatedByEsc")) : null);
|
|
55491
55521
|
}
|
|
55492
55522
|
|
|
55493
55523
|
// src/cli/ui/cards/SubAgentCard.tsx
|
|
@@ -55804,8 +55834,9 @@ function ToolCard({ card }) {
|
|
|
55804
55834
|
const formatted = formatStructuredErrorOutput(card.output);
|
|
55805
55835
|
if (!isShellTool(card.name)) return formatted;
|
|
55806
55836
|
const summary = summarizeCommandOutput(formatted);
|
|
55807
|
-
if (summary.status !== "failed"
|
|
55808
|
-
|
|
55837
|
+
if (summary.status !== "failed") return formatted;
|
|
55838
|
+
const details = summary.failures.length > 0 ? summary.failures : summary.tail;
|
|
55839
|
+
return compactFailureLines(summary.headline, details).join("\n");
|
|
55809
55840
|
}, [card.name, card.output]);
|
|
55810
55841
|
const allLines = displayOutput.length > 0 ? displayOutput.split("\n") : [];
|
|
55811
55842
|
const tail = tailLinesFor(card.name);
|
|
@@ -55921,6 +55952,17 @@ function formatArgsSummary(args) {
|
|
|
55921
55952
|
}
|
|
55922
55953
|
return "";
|
|
55923
55954
|
}
|
|
55955
|
+
function compactFailureLines(headline, details) {
|
|
55956
|
+
const lines = [headline.trim()].filter(Boolean);
|
|
55957
|
+
const seen = new Set(lines);
|
|
55958
|
+
for (const detail of details.slice(-4)) {
|
|
55959
|
+
const trimmed = detail.trim();
|
|
55960
|
+
if (!trimmed || seen.has(trimmed)) continue;
|
|
55961
|
+
seen.add(trimmed);
|
|
55962
|
+
lines.push(trimmed);
|
|
55963
|
+
}
|
|
55964
|
+
return lines.length > 0 ? lines : ["failed"];
|
|
55965
|
+
}
|
|
55924
55966
|
var INPUT_SIZE_THRESHOLD = 1024;
|
|
55925
55967
|
function largestStringInputBytes(args) {
|
|
55926
55968
|
let max = 0;
|
|
@@ -56072,7 +56114,8 @@ function computeCardStreamItems(cards, cardHeights, scrollRows, outerHeight) {
|
|
|
56072
56114
|
return out;
|
|
56073
56115
|
}
|
|
56074
56116
|
function CardStream({
|
|
56075
|
-
suppressLive = false
|
|
56117
|
+
suppressLive = false,
|
|
56118
|
+
maxRows
|
|
56076
56119
|
}) {
|
|
56077
56120
|
const cards = useAgentState((s) => s.cards);
|
|
56078
56121
|
const scrollRows = useChatScrollState((s) => s.scrollRows);
|
|
@@ -56099,9 +56142,20 @@ function CardStream({
|
|
|
56099
56142
|
() => computeCardStreamItems(visible, cardHeights, scrollRows, outer.height),
|
|
56100
56143
|
[visible, cardHeights, scrollRows, outer.height]
|
|
56101
56144
|
);
|
|
56102
|
-
return /* @__PURE__ */ import_react84.default.createElement(import_react84.default.Fragment, null, /* @__PURE__ */ import_react84.default.createElement(Box_default, { height: 1, flexShrink: 0 }, scrollRows > 0 ? /* @__PURE__ */ import_react84.default.createElement(ScrollIndicator, { scrollRows, maxScroll }) : null), /* @__PURE__ */ import_react84.default.createElement(
|
|
56103
|
-
|
|
56104
|
-
|
|
56145
|
+
return /* @__PURE__ */ import_react84.default.createElement(import_react84.default.Fragment, null, /* @__PURE__ */ import_react84.default.createElement(Box_default, { height: 1, flexShrink: 0 }, scrollRows > 0 ? /* @__PURE__ */ import_react84.default.createElement(ScrollIndicator, { scrollRows, maxScroll }) : null), /* @__PURE__ */ import_react84.default.createElement(
|
|
56146
|
+
Box_default,
|
|
56147
|
+
{
|
|
56148
|
+
ref: outerRef,
|
|
56149
|
+
flexDirection: "column",
|
|
56150
|
+
flexGrow: maxRows === void 0 ? 1 : 0,
|
|
56151
|
+
flexShrink: 1,
|
|
56152
|
+
maxHeight: maxRows,
|
|
56153
|
+
overflow: "hidden"
|
|
56154
|
+
},
|
|
56155
|
+
/* @__PURE__ */ import_react84.default.createElement(Box_default, { ref: innerRef, flexDirection: "column", marginTop: -scrollRows, flexShrink: 0 }, items.map(
|
|
56156
|
+
(item) => item.kind === "spacer" ? /* @__PURE__ */ import_react84.default.createElement(Box_default, { key: item.key, height: item.rows, flexShrink: 0 }) : /* @__PURE__ */ import_react84.default.createElement(MeasuredCard, { key: item.card.id, card: item.card, report: setCardHeight })
|
|
56157
|
+
))
|
|
56158
|
+
));
|
|
56105
56159
|
}
|
|
56106
56160
|
function MeasuredCard({
|
|
56107
56161
|
card,
|
|
@@ -56171,6 +56225,20 @@ function isCardSettled(card) {
|
|
|
56171
56225
|
}
|
|
56172
56226
|
}
|
|
56173
56227
|
|
|
56228
|
+
// src/cli/ui/layout/ConversationViewport.tsx
|
|
56229
|
+
var import_react85 = __toESM(require_react(), 1);
|
|
56230
|
+
function ConversationViewport({
|
|
56231
|
+
history: history2,
|
|
56232
|
+
controls,
|
|
56233
|
+
bottomReserveRows = 4
|
|
56234
|
+
}) {
|
|
56235
|
+
const { stdout } = use_stdout_default();
|
|
56236
|
+
const totalRows = stdout?.rows ?? 24;
|
|
56237
|
+
const maxRows = Math.max(1, totalRows - bottomReserveRows);
|
|
56238
|
+
const renderedHistory = typeof history2 === "function" ? history2({ maxRows, totalRows }) : history2;
|
|
56239
|
+
return /* @__PURE__ */ import_react85.default.createElement(Box_default, { flexDirection: "row", height: totalRows }, /* @__PURE__ */ import_react85.default.createElement(Box_default, { flexDirection: "column", flexGrow: 1 }, /* @__PURE__ */ import_react85.default.createElement(Box_default, { flexDirection: "column", flexShrink: 1, maxHeight: maxRows, overflow: "hidden" }, renderedHistory), controls, /* @__PURE__ */ import_react85.default.createElement(Box_default, { flexGrow: 1 })));
|
|
56240
|
+
}
|
|
56241
|
+
|
|
56174
56242
|
// src/cli/ui/mcp-append.ts
|
|
56175
56243
|
function applyMcpAppend(loop2, target, addedTools) {
|
|
56176
56244
|
const accepted = [];
|
|
@@ -57654,7 +57722,7 @@ var handlers10 = {
|
|
|
57654
57722
|
import { release } from "os";
|
|
57655
57723
|
|
|
57656
57724
|
// src/cli/ui/ctx-breakdown.tsx
|
|
57657
|
-
var
|
|
57725
|
+
var import_react86 = __toESM(require_react(), 1);
|
|
57658
57726
|
function computeCtxBreakdown(loop2) {
|
|
57659
57727
|
const systemTokens = countTokensBounded(loop2.prefix.system);
|
|
57660
57728
|
const toolsTokens = countTokensBounded(JSON.stringify(loop2.prefix.toolSpecs));
|
|
@@ -58790,7 +58858,7 @@ function handleTurnInterrupt(key, {
|
|
|
58790
58858
|
}
|
|
58791
58859
|
|
|
58792
58860
|
// src/cli/ui/useCompletionPickers.ts
|
|
58793
|
-
var
|
|
58861
|
+
var import_react87 = __toESM(require_react(), 1);
|
|
58794
58862
|
import { isAbsolute, parse, relative as relative2, resolve as resolve3 } from "path";
|
|
58795
58863
|
var SEARCH_DEBOUNCE_MS = 80;
|
|
58796
58864
|
var SEARCH_FLUSH_MS = 50;
|
|
@@ -58804,38 +58872,38 @@ function useCompletionPickers({
|
|
|
58804
58872
|
mcpServers,
|
|
58805
58873
|
slashUsage
|
|
58806
58874
|
}) {
|
|
58807
|
-
const [slashSelected, setSlashSelected] = (0,
|
|
58808
|
-
const slashMatches = (0,
|
|
58875
|
+
const [slashSelected, setSlashSelected] = (0, import_react87.useState)(0);
|
|
58876
|
+
const slashMatches = (0, import_react87.useMemo)(() => {
|
|
58809
58877
|
if (!input.startsWith("/") || input.includes(" ")) return null;
|
|
58810
58878
|
return suggestSlashCommands(input.slice(1), !!codeMode, slashUsage);
|
|
58811
58879
|
}, [input, codeMode, slashUsage]);
|
|
58812
58880
|
const slashGroupMode = input === "/";
|
|
58813
|
-
const slashAdvancedHidden = (0,
|
|
58881
|
+
const slashAdvancedHidden = (0, import_react87.useMemo)(
|
|
58814
58882
|
() => slashGroupMode ? countAdvancedCommands(!!codeMode) : 0,
|
|
58815
58883
|
[slashGroupMode, codeMode]
|
|
58816
58884
|
);
|
|
58817
|
-
(0,
|
|
58885
|
+
(0, import_react87.useEffect)(() => {
|
|
58818
58886
|
setSlashSelected((prev) => {
|
|
58819
58887
|
if (!slashMatches || slashMatches.length === 0) return 0;
|
|
58820
58888
|
if (prev >= slashMatches.length) return slashMatches.length - 1;
|
|
58821
58889
|
return prev;
|
|
58822
58890
|
});
|
|
58823
58891
|
}, [slashMatches]);
|
|
58824
|
-
const [atSelected, setAtSelected] = (0,
|
|
58825
|
-
const recentFilesRef = (0,
|
|
58826
|
-
const recordRecentFile = (0,
|
|
58892
|
+
const [atSelected, setAtSelected] = (0, import_react87.useState)(0);
|
|
58893
|
+
const recentFilesRef = (0, import_react87.useRef)([]);
|
|
58894
|
+
const recordRecentFile = (0, import_react87.useCallback)((p) => {
|
|
58827
58895
|
const list2 = recentFilesRef.current;
|
|
58828
58896
|
const i = list2.indexOf(p);
|
|
58829
58897
|
if (i >= 0) list2.splice(i, 1);
|
|
58830
58898
|
list2.unshift(p);
|
|
58831
58899
|
if (list2.length > 20) list2.length = 20;
|
|
58832
58900
|
}, []);
|
|
58833
|
-
const atPicker = (0,
|
|
58901
|
+
const atPicker = (0, import_react87.useMemo)(() => {
|
|
58834
58902
|
if (!codeMode) return null;
|
|
58835
58903
|
if (slashMatches !== null) return null;
|
|
58836
58904
|
return detectAtPicker(input);
|
|
58837
58905
|
}, [codeMode, input, slashMatches]);
|
|
58838
|
-
const parsed = (0,
|
|
58906
|
+
const parsed = (0, import_react87.useMemo)(
|
|
58839
58907
|
() => atPicker ? parseAtQuery(atPicker.query) : null,
|
|
58840
58908
|
[atPicker]
|
|
58841
58909
|
);
|
|
@@ -58847,7 +58915,7 @@ function useCompletionPickers({
|
|
|
58847
58915
|
atMode === "search" && parsed ? parsed.filter : null,
|
|
58848
58916
|
recentFilesRef
|
|
58849
58917
|
);
|
|
58850
|
-
const atState = (0,
|
|
58918
|
+
const atState = (0, import_react87.useMemo)(() => {
|
|
58851
58919
|
if (!parsed) return null;
|
|
58852
58920
|
if (atMode === "browse") {
|
|
58853
58921
|
const entries = browseDir ? [parentBrowseEntry(browseDir), ...browse.entries] : browse.entries;
|
|
@@ -58866,7 +58934,7 @@ function useCompletionPickers({
|
|
|
58866
58934
|
searching: search.searching
|
|
58867
58935
|
};
|
|
58868
58936
|
}, [parsed, atMode, browseDir, browse, search]);
|
|
58869
|
-
(0,
|
|
58937
|
+
(0, import_react87.useEffect)(() => {
|
|
58870
58938
|
setAtSelected((prev) => {
|
|
58871
58939
|
const len = atState?.entries.length ?? 0;
|
|
58872
58940
|
if (len === 0) return 0;
|
|
@@ -58874,7 +58942,7 @@ function useCompletionPickers({
|
|
|
58874
58942
|
return prev;
|
|
58875
58943
|
});
|
|
58876
58944
|
}, [atState]);
|
|
58877
|
-
const pickAtMention = (0,
|
|
58945
|
+
const pickAtMention = (0, import_react87.useCallback)(
|
|
58878
58946
|
(entry, action) => {
|
|
58879
58947
|
if (!atPicker) return;
|
|
58880
58948
|
const before = input.slice(0, atPicker.atOffset);
|
|
@@ -58884,8 +58952,8 @@ function useCompletionPickers({
|
|
|
58884
58952
|
},
|
|
58885
58953
|
[atPicker, input, setInput]
|
|
58886
58954
|
);
|
|
58887
|
-
const [slashArgSelected, setSlashArgSelected] = (0,
|
|
58888
|
-
const slashArgContext = (0,
|
|
58955
|
+
const [slashArgSelected, setSlashArgSelected] = (0, import_react87.useState)(0);
|
|
58956
|
+
const slashArgContext = (0, import_react87.useMemo)(() => {
|
|
58889
58957
|
if (!input.startsWith("/")) return null;
|
|
58890
58958
|
if (slashMatches !== null) return null;
|
|
58891
58959
|
return detectSlashArgContext(input, !!codeMode);
|
|
@@ -58895,7 +58963,7 @@ function useCompletionPickers({
|
|
|
58895
58963
|
slashArgContext?.kind === "picker" && slashArgContext.spec.argCompleter === "path" ? slashArgContext.partial : null,
|
|
58896
58964
|
slashArgContext?.kind === "picker" && slashArgContext.spec.argCompleter === "path"
|
|
58897
58965
|
);
|
|
58898
|
-
const slashArgMatches = (0,
|
|
58966
|
+
const slashArgMatches = (0, import_react87.useMemo)(() => {
|
|
58899
58967
|
if (!slashArgContext || slashArgContext.kind !== "picker") return null;
|
|
58900
58968
|
const completer = slashArgContext.spec.argCompleter;
|
|
58901
58969
|
const partial = slashArgContext.partial;
|
|
@@ -58949,14 +59017,14 @@ function useCompletionPickers({
|
|
|
58949
59017
|
}
|
|
58950
59018
|
return null;
|
|
58951
59019
|
}, [slashArgContext, models, mcpServers, codeMode, slashArgPathCandidates]);
|
|
58952
|
-
(0,
|
|
59020
|
+
(0, import_react87.useEffect)(() => {
|
|
58953
59021
|
setSlashArgSelected((prev) => {
|
|
58954
59022
|
if (!slashArgMatches || slashArgMatches.length === 0) return 0;
|
|
58955
59023
|
if (prev >= slashArgMatches.length) return slashArgMatches.length - 1;
|
|
58956
59024
|
return prev;
|
|
58957
59025
|
});
|
|
58958
59026
|
}, [slashArgMatches]);
|
|
58959
|
-
const pickSlashArg = (0,
|
|
59027
|
+
const pickSlashArg = (0, import_react87.useCallback)(
|
|
58960
59028
|
(chosen, isDir) => {
|
|
58961
59029
|
if (!slashArgContext) return;
|
|
58962
59030
|
const before = input.slice(0, slashArgContext.partialOffset);
|
|
@@ -58990,8 +59058,8 @@ function useCompletionPickers({
|
|
|
58990
59058
|
};
|
|
58991
59059
|
}
|
|
58992
59060
|
function usePathCandidates(rootDir, partial, isActive) {
|
|
58993
|
-
const [entries, setEntries] = (0,
|
|
58994
|
-
(0,
|
|
59061
|
+
const [entries, setEntries] = (0, import_react87.useState)([]);
|
|
59062
|
+
(0, import_react87.useEffect)(() => {
|
|
58995
59063
|
if (!isActive) {
|
|
58996
59064
|
setEntries([]);
|
|
58997
59065
|
return;
|
|
@@ -59059,9 +59127,9 @@ function usePathCandidates(rootDir, partial, isActive) {
|
|
|
59059
59127
|
return entries;
|
|
59060
59128
|
}
|
|
59061
59129
|
function useBrowseListing(rootDir, dir) {
|
|
59062
|
-
const [entries, setEntries] = (0,
|
|
59063
|
-
const [loading, setLoading] = (0,
|
|
59064
|
-
(0,
|
|
59130
|
+
const [entries, setEntries] = (0, import_react87.useState)([]);
|
|
59131
|
+
const [loading, setLoading] = (0, import_react87.useState)(false);
|
|
59132
|
+
(0, import_react87.useEffect)(() => {
|
|
59065
59133
|
if (dir === null) {
|
|
59066
59134
|
setEntries([]);
|
|
59067
59135
|
setLoading(false);
|
|
@@ -59102,12 +59170,12 @@ function parentBrowseEntry(currentDir) {
|
|
|
59102
59170
|
};
|
|
59103
59171
|
}
|
|
59104
59172
|
function useStreamingSearch(rootDir, filter, recentFilesRef) {
|
|
59105
|
-
const [, bumpRender] = (0,
|
|
59106
|
-
const hitsRef = (0,
|
|
59107
|
-
const scannedRef = (0,
|
|
59108
|
-
const searchingRef = (0,
|
|
59109
|
-
const rankedRef = (0,
|
|
59110
|
-
(0,
|
|
59173
|
+
const [, bumpRender] = (0, import_react87.useReducer)((x) => x + 1, 0);
|
|
59174
|
+
const hitsRef = (0, import_react87.useRef)([]);
|
|
59175
|
+
const scannedRef = (0, import_react87.useRef)(0);
|
|
59176
|
+
const searchingRef = (0, import_react87.useRef)(false);
|
|
59177
|
+
const rankedRef = (0, import_react87.useRef)([]);
|
|
59178
|
+
(0, import_react87.useEffect)(() => {
|
|
59111
59179
|
if (filter === null) {
|
|
59112
59180
|
hitsRef.current = [];
|
|
59113
59181
|
scannedRef.current = 0;
|
|
@@ -59178,14 +59246,14 @@ function rankSearchHits(hits, filter, recent) {
|
|
|
59178
59246
|
}
|
|
59179
59247
|
|
|
59180
59248
|
// src/cli/ui/useEditHistory.ts
|
|
59181
|
-
var
|
|
59249
|
+
var import_react88 = __toESM(require_react(), 1);
|
|
59182
59250
|
function useEditHistory(codeMode) {
|
|
59183
|
-
const editHistory = (0,
|
|
59184
|
-
const nextHistoryId = (0,
|
|
59185
|
-
const currentTurnEntry = (0,
|
|
59186
|
-
const [undoBanner, setUndoBanner] = (0,
|
|
59187
|
-
const undoTimeoutRef = (0,
|
|
59188
|
-
const recordEdit = (0,
|
|
59251
|
+
const editHistory = (0, import_react88.useRef)([]);
|
|
59252
|
+
const nextHistoryId = (0, import_react88.useRef)(1);
|
|
59253
|
+
const currentTurnEntry = (0, import_react88.useRef)(null);
|
|
59254
|
+
const [undoBanner, setUndoBanner] = (0, import_react88.useState)(null);
|
|
59255
|
+
const undoTimeoutRef = (0, import_react88.useRef)(null);
|
|
59256
|
+
const recordEdit = (0, import_react88.useCallback)(
|
|
59189
59257
|
(source, blocks, results, snaps) => {
|
|
59190
59258
|
if (snaps.length === 0) return;
|
|
59191
59259
|
let entry = currentTurnEntry.current;
|
|
@@ -59211,7 +59279,7 @@ function useEditHistory(codeMode) {
|
|
|
59211
59279
|
},
|
|
59212
59280
|
[]
|
|
59213
59281
|
);
|
|
59214
|
-
const armUndoBanner = (0,
|
|
59282
|
+
const armUndoBanner = (0, import_react88.useCallback)((results) => {
|
|
59215
59283
|
setUndoBanner({ results, expiresAt: Date.now() + 5e3, pausedRemainingMs: null });
|
|
59216
59284
|
if (undoTimeoutRef.current) clearTimeout(undoTimeoutRef.current);
|
|
59217
59285
|
undoTimeoutRef.current = setTimeout(() => {
|
|
@@ -59219,7 +59287,7 @@ function useEditHistory(codeMode) {
|
|
|
59219
59287
|
undoTimeoutRef.current = null;
|
|
59220
59288
|
}, 5e3);
|
|
59221
59289
|
}, []);
|
|
59222
|
-
const toggleUndoPause = (0,
|
|
59290
|
+
const toggleUndoPause = (0, import_react88.useCallback)(() => {
|
|
59223
59291
|
setUndoBanner((prev) => {
|
|
59224
59292
|
if (!prev) return prev;
|
|
59225
59293
|
if (prev.pausedRemainingMs === null) {
|
|
@@ -59238,7 +59306,7 @@ function useEditHistory(codeMode) {
|
|
|
59238
59306
|
return { ...prev, expiresAt: Date.now() + remaining, pausedRemainingMs: null };
|
|
59239
59307
|
});
|
|
59240
59308
|
}, []);
|
|
59241
|
-
const codeUndo = (0,
|
|
59309
|
+
const codeUndo = (0, import_react88.useCallback)(
|
|
59242
59310
|
(args = []) => {
|
|
59243
59311
|
if (!codeMode) return "not in code mode";
|
|
59244
59312
|
const root = codeMode.rootDir;
|
|
@@ -59296,7 +59364,7 @@ function useEditHistory(codeMode) {
|
|
|
59296
59364
|
},
|
|
59297
59365
|
[codeMode]
|
|
59298
59366
|
);
|
|
59299
|
-
const codeHistory = (0,
|
|
59367
|
+
const codeHistory = (0, import_react88.useCallback)(() => {
|
|
59300
59368
|
if (!codeMode) return "not in code mode";
|
|
59301
59369
|
const entries = editHistory.current;
|
|
59302
59370
|
if (entries.length === 0) return "no edits recorded this session yet";
|
|
@@ -59321,7 +59389,7 @@ function useEditHistory(codeMode) {
|
|
|
59321
59389
|
);
|
|
59322
59390
|
return lines.join("\n");
|
|
59323
59391
|
}, [codeMode]);
|
|
59324
|
-
const codeShowEdit = (0,
|
|
59392
|
+
const codeShowEdit = (0, import_react88.useCallback)(
|
|
59325
59393
|
(args = []) => {
|
|
59326
59394
|
if (!codeMode) return "not in code mode";
|
|
59327
59395
|
const entries = editHistory.current;
|
|
@@ -59379,14 +59447,14 @@ function useEditHistory(codeMode) {
|
|
|
59379
59447
|
},
|
|
59380
59448
|
[codeMode]
|
|
59381
59449
|
);
|
|
59382
|
-
const sealCurrentEntry = (0,
|
|
59450
|
+
const sealCurrentEntry = (0, import_react88.useCallback)(() => {
|
|
59383
59451
|
currentTurnEntry.current = null;
|
|
59384
59452
|
}, []);
|
|
59385
|
-
const hasUndoable = (0,
|
|
59453
|
+
const hasUndoable = (0, import_react88.useCallback)(
|
|
59386
59454
|
() => editHistory.current.some((e) => !isEntryFullyUndone(e)),
|
|
59387
59455
|
[]
|
|
59388
59456
|
);
|
|
59389
|
-
const touchedPaths = (0,
|
|
59457
|
+
const touchedPaths = (0, import_react88.useCallback)(() => {
|
|
59390
59458
|
const seen = /* @__PURE__ */ new Set();
|
|
59391
59459
|
for (const entry of editHistory.current) {
|
|
59392
59460
|
for (const b of entry.blocks) seen.add(b.path);
|
|
@@ -59408,12 +59476,12 @@ function useEditHistory(codeMode) {
|
|
|
59408
59476
|
}
|
|
59409
59477
|
|
|
59410
59478
|
// src/cli/ui/useSessionInfo.ts
|
|
59411
|
-
var
|
|
59479
|
+
var import_react89 = __toESM(require_react(), 1);
|
|
59412
59480
|
function useSessionInfo(loop2) {
|
|
59413
|
-
const [balance, setBalance] = (0,
|
|
59414
|
-
const [models, setModels] = (0,
|
|
59415
|
-
const [latestVersion, setLatestVersion] = (0,
|
|
59416
|
-
(0,
|
|
59481
|
+
const [balance, setBalance] = (0, import_react89.useState)(null);
|
|
59482
|
+
const [models, setModels] = (0, import_react89.useState)(null);
|
|
59483
|
+
const [latestVersion, setLatestVersion] = (0, import_react89.useState)(null);
|
|
59484
|
+
(0, import_react89.useEffect)(() => {
|
|
59417
59485
|
let cancelled = false;
|
|
59418
59486
|
void (async () => {
|
|
59419
59487
|
const bal = await loop2.client.getBalance().catch(() => null);
|
|
@@ -59426,7 +59494,7 @@ function useSessionInfo(loop2) {
|
|
|
59426
59494
|
cancelled = true;
|
|
59427
59495
|
};
|
|
59428
59496
|
}, [loop2]);
|
|
59429
|
-
(0,
|
|
59497
|
+
(0, import_react89.useEffect)(() => {
|
|
59430
59498
|
let cancelled = false;
|
|
59431
59499
|
void (async () => {
|
|
59432
59500
|
const list2 = await loop2.client.listModels().catch(() => null);
|
|
@@ -59437,7 +59505,7 @@ function useSessionInfo(loop2) {
|
|
|
59437
59505
|
cancelled = true;
|
|
59438
59506
|
};
|
|
59439
59507
|
}, [loop2]);
|
|
59440
|
-
(0,
|
|
59508
|
+
(0, import_react89.useEffect)(() => {
|
|
59441
59509
|
let cancelled = false;
|
|
59442
59510
|
void (async () => {
|
|
59443
59511
|
const latest = await getLatestVersion();
|
|
@@ -59449,7 +59517,7 @@ function useSessionInfo(loop2) {
|
|
|
59449
59517
|
};
|
|
59450
59518
|
}, []);
|
|
59451
59519
|
const updateAvailable = latestVersion && compareVersions(VERSION, latestVersion) < 0 ? latestVersion : null;
|
|
59452
|
-
const refreshBalance = (0,
|
|
59520
|
+
const refreshBalance = (0, import_react89.useCallback)(() => {
|
|
59453
59521
|
void (async () => {
|
|
59454
59522
|
const bal = await loop2.client.getBalance().catch(() => null);
|
|
59455
59523
|
const primary = bal ? pickPrimaryBalance(bal.balance_infos) : null;
|
|
@@ -59458,13 +59526,13 @@ function useSessionInfo(loop2) {
|
|
|
59458
59526
|
}
|
|
59459
59527
|
})();
|
|
59460
59528
|
}, [loop2]);
|
|
59461
|
-
const refreshModels = (0,
|
|
59529
|
+
const refreshModels = (0, import_react89.useCallback)(() => {
|
|
59462
59530
|
void (async () => {
|
|
59463
59531
|
const list2 = await loop2.client.listModels().catch(() => null);
|
|
59464
59532
|
if (list2) setModels(list2.data.map((m) => m.id));
|
|
59465
59533
|
})();
|
|
59466
59534
|
}, [loop2]);
|
|
59467
|
-
const refreshLatestVersion = (0,
|
|
59535
|
+
const refreshLatestVersion = (0, import_react89.useCallback)(() => {
|
|
59468
59536
|
void (async () => {
|
|
59469
59537
|
const fresh = await getLatestVersion({ force: true });
|
|
59470
59538
|
if (fresh) setLatestVersion(fresh);
|
|
@@ -59482,7 +59550,7 @@ function useSessionInfo(loop2) {
|
|
|
59482
59550
|
}
|
|
59483
59551
|
|
|
59484
59552
|
// src/cli/ui/useSubagent.ts
|
|
59485
|
-
var
|
|
59553
|
+
var import_react90 = __toESM(require_react(), 1);
|
|
59486
59554
|
function reduceSubagentInnerEvent(prev, ev) {
|
|
59487
59555
|
if (ev.kind === "inner") {
|
|
59488
59556
|
if (!ev.inner) return prev;
|
|
@@ -59557,13 +59625,13 @@ function useSubagent({
|
|
|
59557
59625
|
log,
|
|
59558
59626
|
getWalletCurrency
|
|
59559
59627
|
}) {
|
|
59560
|
-
const [activities, setActivities] = (0,
|
|
59561
|
-
const sinkRef = (0,
|
|
59562
|
-
const getWalletCurrencyRef = (0,
|
|
59563
|
-
(0,
|
|
59628
|
+
const [activities, setActivities] = (0, import_react90.useState)([]);
|
|
59629
|
+
const sinkRef = (0, import_react90.useRef)({ current: null });
|
|
59630
|
+
const getWalletCurrencyRef = (0, import_react90.useRef)(getWalletCurrency);
|
|
59631
|
+
(0, import_react90.useEffect)(() => {
|
|
59564
59632
|
getWalletCurrencyRef.current = getWalletCurrency;
|
|
59565
59633
|
}, [getWalletCurrency]);
|
|
59566
|
-
(0,
|
|
59634
|
+
(0, import_react90.useEffect)(() => {
|
|
59567
59635
|
sinkRef.current.current = (ev) => {
|
|
59568
59636
|
if (ev.kind === "start") {
|
|
59569
59637
|
setActivities((prev) => {
|
|
@@ -59661,14 +59729,14 @@ function App(props) {
|
|
|
59661
59729
|
model: props.model,
|
|
59662
59730
|
workspace: props.codeMode?.rootDir ?? process.cwd()
|
|
59663
59731
|
});
|
|
59664
|
-
const initialCards =
|
|
59732
|
+
const initialCards = import_react91.default.useMemo(
|
|
59665
59733
|
() => props.session ? hydrateCardsFromMessages(loadSessionMessages(props.session)) : [],
|
|
59666
59734
|
[props.session]
|
|
59667
59735
|
);
|
|
59668
|
-
const [themeName, setThemeName] =
|
|
59736
|
+
const [themeName, setThemeName] = import_react91.default.useState(
|
|
59669
59737
|
() => resolveThemePreference(loadTheme(), process.env.REASONIX_THEME)
|
|
59670
59738
|
);
|
|
59671
|
-
const statusBar =
|
|
59739
|
+
const statusBar = import_react91.default.useMemo(() => {
|
|
59672
59740
|
const cfg = readConfig().statusBar ?? {};
|
|
59673
59741
|
return {
|
|
59674
59742
|
showMode: cfg.showMode === true,
|
|
@@ -59683,7 +59751,7 @@ function App(props) {
|
|
|
59683
59751
|
showFeedbackHint: cfg.showFeedbackHint === true
|
|
59684
59752
|
};
|
|
59685
59753
|
}, []);
|
|
59686
|
-
return /* @__PURE__ */
|
|
59754
|
+
return /* @__PURE__ */ import_react91.default.createElement(ThemeProvider, { name: themeName }, /* @__PURE__ */ import_react91.default.createElement(AgentStoreProvider, { session, initialCards }, /* @__PURE__ */ import_react91.default.createElement(ChatScrollProvider, null, /* @__PURE__ */ import_react91.default.createElement(
|
|
59687
59755
|
AppInner,
|
|
59688
59756
|
{
|
|
59689
59757
|
...props,
|
|
@@ -59713,6 +59781,7 @@ function AppInner({
|
|
|
59713
59781
|
dashboardToken,
|
|
59714
59782
|
onSwitchSession,
|
|
59715
59783
|
startupInfoHints,
|
|
59784
|
+
startupUpdateCheck,
|
|
59716
59785
|
qqChannel,
|
|
59717
59786
|
qqSubmitRef,
|
|
59718
59787
|
qqErrorRef,
|
|
@@ -59745,33 +59814,33 @@ function AppInner({
|
|
|
59745
59814
|
const lastTurnMs = useAgentState((s) => s.status.lastTurnMs);
|
|
59746
59815
|
const activityLabel = useActivityLabel();
|
|
59747
59816
|
const chatScroll = useChatScrollActions();
|
|
59748
|
-
const [input, setInput] = (0,
|
|
59749
|
-
const [composerCursor, setComposerCursor] = (0,
|
|
59750
|
-
const [busy, setBusy] = (0,
|
|
59751
|
-
const [slashUsage, setSlashUsage] = (0,
|
|
59817
|
+
const [input, setInput] = (0, import_react91.useState)("");
|
|
59818
|
+
const [composerCursor, setComposerCursor] = (0, import_react91.useState)(0);
|
|
59819
|
+
const [busy, setBusy] = (0, import_react91.useState)(false);
|
|
59820
|
+
const [slashUsage, setSlashUsage] = (0, import_react91.useState)(
|
|
59752
59821
|
() => loadSlashUsage()
|
|
59753
59822
|
);
|
|
59754
|
-
const [liveExpand, setLiveExpand] = (0,
|
|
59755
|
-
(0,
|
|
59823
|
+
const [liveExpand, setLiveExpand] = (0, import_react91.useState)(false);
|
|
59824
|
+
(0, import_react91.useEffect)(() => {
|
|
59756
59825
|
if (!isStreaming && liveExpand) setLiveExpand(false);
|
|
59757
59826
|
}, [isStreaming, liveExpand]);
|
|
59758
59827
|
const languageVersion = useLanguageReload();
|
|
59759
|
-
const showBanner = (0,
|
|
59760
|
-
const [bootReady, setBootReady] = (0,
|
|
59761
|
-
(0,
|
|
59828
|
+
const showBanner = (0, import_react91.useMemo)(() => readConfig().banner !== false, []);
|
|
59829
|
+
const [bootReady, setBootReady] = (0, import_react91.useState)(!showBanner);
|
|
59830
|
+
(0, import_react91.useEffect)(() => {
|
|
59762
59831
|
if (!showBanner) return;
|
|
59763
59832
|
const t2 = setTimeout(() => setBootReady(true), 1400);
|
|
59764
59833
|
return () => clearTimeout(t2);
|
|
59765
59834
|
}, [showBanner]);
|
|
59766
|
-
(0,
|
|
59835
|
+
(0, import_react91.useEffect)(() => {
|
|
59767
59836
|
markPhase("first_paint");
|
|
59768
59837
|
dumpStartupProfile();
|
|
59769
59838
|
}, []);
|
|
59770
|
-
const [liveMcpServers, setLiveMcpServers] = (0,
|
|
59771
|
-
const liveMcpServersRef = (0,
|
|
59839
|
+
const [liveMcpServers, setLiveMcpServers] = (0, import_react91.useState)(() => mcpServers ?? []);
|
|
59840
|
+
const liveMcpServersRef = (0, import_react91.useRef)(liveMcpServers);
|
|
59772
59841
|
liveMcpServersRef.current = liveMcpServers;
|
|
59773
|
-
const abortedThisTurn = (0,
|
|
59774
|
-
(0,
|
|
59842
|
+
const abortedThisTurn = (0, import_react91.useRef)(false);
|
|
59843
|
+
(0, import_react91.useEffect)(() => {
|
|
59775
59844
|
busyRef.current = busy;
|
|
59776
59845
|
}, [busy]);
|
|
59777
59846
|
const {
|
|
@@ -59784,7 +59853,7 @@ function AppInner({
|
|
|
59784
59853
|
clear: clearToolProgressDisplay
|
|
59785
59854
|
} = useToolProgressDisplay(progressSink);
|
|
59786
59855
|
const { stdout } = use_stdout_default();
|
|
59787
|
-
const walletCurrencyRef = (0,
|
|
59856
|
+
const walletCurrencyRef = (0, import_react91.useRef)(void 0);
|
|
59788
59857
|
const { activities: subagentActivities, sinkRef: subagentSinkRef } = useSubagent({
|
|
59789
59858
|
session,
|
|
59790
59859
|
log,
|
|
@@ -59817,39 +59886,39 @@ function AppInner({
|
|
|
59817
59886
|
modeFlash
|
|
59818
59887
|
} = useEditGate(!!codeMode);
|
|
59819
59888
|
const { preset: preset2, setPreset, proArmed, setProArmed, turnOnPro, setTurnOnPro } = usePresetMode(model2);
|
|
59820
|
-
const planModeRef = (0,
|
|
59821
|
-
const latestVersionRef = (0,
|
|
59822
|
-
const [pendingEditReview, setPendingEditReview] = (0,
|
|
59823
|
-
const [walkthroughActive, setWalkthroughActive] = (0,
|
|
59824
|
-
const editReviewResolveRef = (0,
|
|
59825
|
-
const turnEditPolicyRef = (0,
|
|
59826
|
-
const [pendingShell, setPendingShell] = (0,
|
|
59827
|
-
const [pendingPath, setPendingPath] = (0,
|
|
59828
|
-
const [pendingPlan, setPendingPlan] = (0,
|
|
59829
|
-
const [pendingReviseEditor, setPendingReviseEditor] = (0,
|
|
59830
|
-
const [pendingSessionsPicker, setPendingSessionsPicker] = (0,
|
|
59831
|
-
const [sessionsPickerList, setSessionsPickerList] = (0,
|
|
59889
|
+
const planModeRef = (0, import_react91.useRef)(false);
|
|
59890
|
+
const latestVersionRef = (0, import_react91.useRef)(null);
|
|
59891
|
+
const [pendingEditReview, setPendingEditReview] = (0, import_react91.useState)(null);
|
|
59892
|
+
const [walkthroughActive, setWalkthroughActive] = (0, import_react91.useState)(false);
|
|
59893
|
+
const editReviewResolveRef = (0, import_react91.useRef)(null);
|
|
59894
|
+
const turnEditPolicyRef = (0, import_react91.useRef)("ask");
|
|
59895
|
+
const [pendingShell, setPendingShell] = (0, import_react91.useState)(null);
|
|
59896
|
+
const [pendingPath, setPendingPath] = (0, import_react91.useState)(null);
|
|
59897
|
+
const [pendingPlan, setPendingPlan] = (0, import_react91.useState)(null);
|
|
59898
|
+
const [pendingReviseEditor, setPendingReviseEditor] = (0, import_react91.useState)(null);
|
|
59899
|
+
const [pendingSessionsPicker, setPendingSessionsPicker] = (0, import_react91.useState)(false);
|
|
59900
|
+
const [sessionsPickerList, setSessionsPickerList] = (0, import_react91.useState)(
|
|
59832
59901
|
() => listSessionsForWorkspace(currentRootDir)
|
|
59833
59902
|
);
|
|
59834
|
-
const [sessionsPickerFocus, setSessionsPickerFocus] = (0,
|
|
59835
|
-
const [pendingWorkspacePicker, setPendingWorkspacePicker] = (0,
|
|
59836
|
-
const [workspacePickerList, setWorkspacePickerList] = (0,
|
|
59837
|
-
const [pendingCheckpointPicker, setPendingCheckpointPicker] = (0,
|
|
59838
|
-
const [checkpointPickerList, setCheckpointPickerList] = (0,
|
|
59839
|
-
const [pendingMcpHub, setPendingMcpHub] = (0,
|
|
59840
|
-
const [pendingModelPicker, setPendingModelPicker] = (0,
|
|
59841
|
-
const [pendingThemePicker, setPendingThemePicker] = (0,
|
|
59842
|
-
const [pendingCopyMode, setPendingCopyMode] = (0,
|
|
59843
|
-
const [stagedInput, setStagedInput] = (0,
|
|
59844
|
-
const [pendingCheckpoint, setPendingCheckpoint] = (0,
|
|
59845
|
-
const [stagedCheckpointRevise, setStagedCheckpointRevise] = (0,
|
|
59846
|
-
const [pendingRevision, setPendingRevision] = (0,
|
|
59847
|
-
const [pendingChoice, setPendingChoice] = (0,
|
|
59848
|
-
const [stagedChoiceCustom, setStagedChoiceCustom] = (0,
|
|
59903
|
+
const [sessionsPickerFocus, setSessionsPickerFocus] = (0, import_react91.useState)(0);
|
|
59904
|
+
const [pendingWorkspacePicker, setPendingWorkspacePicker] = (0, import_react91.useState)(false);
|
|
59905
|
+
const [workspacePickerList, setWorkspacePickerList] = (0, import_react91.useState)(() => listKnownWorkspaces(currentRootDir));
|
|
59906
|
+
const [pendingCheckpointPicker, setPendingCheckpointPicker] = (0, import_react91.useState)(false);
|
|
59907
|
+
const [checkpointPickerList, setCheckpointPickerList] = (0, import_react91.useState)([]);
|
|
59908
|
+
const [pendingMcpHub, setPendingMcpHub] = (0, import_react91.useState)(null);
|
|
59909
|
+
const [pendingModelPicker, setPendingModelPicker] = (0, import_react91.useState)(false);
|
|
59910
|
+
const [pendingThemePicker, setPendingThemePicker] = (0, import_react91.useState)(false);
|
|
59911
|
+
const [pendingCopyMode, setPendingCopyMode] = (0, import_react91.useState)(false);
|
|
59912
|
+
const [stagedInput, setStagedInput] = (0, import_react91.useState)(null);
|
|
59913
|
+
const [pendingCheckpoint, setPendingCheckpoint] = (0, import_react91.useState)(null);
|
|
59914
|
+
const [stagedCheckpointRevise, setStagedCheckpointRevise] = (0, import_react91.useState)(null);
|
|
59915
|
+
const [pendingRevision, setPendingRevision] = (0, import_react91.useState)(null);
|
|
59916
|
+
const [pendingChoice, setPendingChoice] = (0, import_react91.useState)(null);
|
|
59917
|
+
const [stagedChoiceCustom, setStagedChoiceCustom] = (0, import_react91.useState)(null);
|
|
59849
59918
|
const modalOpen = !!pendingShell || !!pendingPlan || !!pendingReviseEditor || !!pendingSessionsPicker || !!pendingWorkspacePicker || !!pendingCheckpointPicker || !!pendingMcpHub || pendingModelPicker || pendingThemePicker || pendingCopyMode || !!stagedInput || !!pendingEditReview || walkthroughActive || !!pendingChoice || !!stagedChoiceCustom || !!pendingRevision || !!stagedCheckpointRevise || !!pendingCheckpoint;
|
|
59850
59919
|
const noTakeoverOverlay = !pendingShell && !pendingPath && !pendingPlan && !pendingReviseEditor && !pendingSessionsPicker && !pendingWorkspacePicker && !pendingCheckpointPicker && !pendingMcpHub && !stagedInput && !pendingEditReview;
|
|
59851
|
-
const [planMode, setPlanMode] = (0,
|
|
59852
|
-
const [queuedSubmit, setQueuedSubmit] = (0,
|
|
59920
|
+
const [planMode, setPlanMode] = (0, import_react91.useState)(false);
|
|
59921
|
+
const [queuedSubmit, setQueuedSubmit] = (0, import_react91.useState)(null);
|
|
59853
59922
|
const {
|
|
59854
59923
|
recallPrev,
|
|
59855
59924
|
recallNext,
|
|
@@ -59858,7 +59927,7 @@ function AppInner({
|
|
|
59858
59927
|
history: promptHistory
|
|
59859
59928
|
} = useInputRecall(setInput);
|
|
59860
59929
|
const { setRawMode, isRawModeSupported } = use_stdin_default();
|
|
59861
|
-
const handleOpenExternalEditor = (0,
|
|
59930
|
+
const handleOpenExternalEditor = (0, import_react91.useCallback)(async () => {
|
|
59862
59931
|
if (!isRawModeSupported) {
|
|
59863
59932
|
log.pushWarning(t("composer.editorFailed"), t("composer.editorNoRawMode"));
|
|
59864
59933
|
return;
|
|
@@ -59872,25 +59941,25 @@ function AppInner({
|
|
|
59872
59941
|
setRawMode(true);
|
|
59873
59942
|
}
|
|
59874
59943
|
}, [input, isRawModeSupported, log, setRawMode]);
|
|
59875
|
-
const assistantIterCounter = (0,
|
|
59876
|
-
const atUrlCache = (0,
|
|
59877
|
-
const handleSubmitRef = (0,
|
|
59878
|
-
const busyRef = (0,
|
|
59879
|
-
const submittingRef = (0,
|
|
59880
|
-
const dashboardRef = (0,
|
|
59881
|
-
const dashboardStartingRef = (0,
|
|
59882
|
-
const eventSubscribersRef = (0,
|
|
59883
|
-
const activePickerResolverRef = (0,
|
|
59884
|
-
const activePickerSnapshotRef = (0,
|
|
59885
|
-
const activeViewerResolverRef = (0,
|
|
59886
|
-
const activeViewerSnapshotRef = (0,
|
|
59887
|
-
const [pendingReplayViewer, setPendingReplayViewer] = (0,
|
|
59888
|
-
const planStepsRef = (0,
|
|
59889
|
-
const completedStepIdsRef = (0,
|
|
59890
|
-
const planBodyRef = (0,
|
|
59891
|
-
const planSummaryRef = (0,
|
|
59892
|
-
const toolStartedAtRef = (0,
|
|
59893
|
-
const persistPlanState = (0,
|
|
59944
|
+
const assistantIterCounter = (0, import_react91.useRef)(0);
|
|
59945
|
+
const atUrlCache = (0, import_react91.useRef)(/* @__PURE__ */ new Map());
|
|
59946
|
+
const handleSubmitRef = (0, import_react91.useRef)(null);
|
|
59947
|
+
const busyRef = (0, import_react91.useRef)(false);
|
|
59948
|
+
const submittingRef = (0, import_react91.useRef)(false);
|
|
59949
|
+
const dashboardRef = (0, import_react91.useRef)(null);
|
|
59950
|
+
const dashboardStartingRef = (0, import_react91.useRef)(null);
|
|
59951
|
+
const eventSubscribersRef = (0, import_react91.useRef)(/* @__PURE__ */ new Set());
|
|
59952
|
+
const activePickerResolverRef = (0, import_react91.useRef)(null);
|
|
59953
|
+
const activePickerSnapshotRef = (0, import_react91.useRef)(null);
|
|
59954
|
+
const activeViewerResolverRef = (0, import_react91.useRef)(null);
|
|
59955
|
+
const activeViewerSnapshotRef = (0, import_react91.useRef)(null);
|
|
59956
|
+
const [pendingReplayViewer, setPendingReplayViewer] = (0, import_react91.useState)(null);
|
|
59957
|
+
const planStepsRef = (0, import_react91.useRef)(null);
|
|
59958
|
+
const completedStepIdsRef = (0, import_react91.useRef)(/* @__PURE__ */ new Set());
|
|
59959
|
+
const planBodyRef = (0, import_react91.useRef)(null);
|
|
59960
|
+
const planSummaryRef = (0, import_react91.useRef)(null);
|
|
59961
|
+
const toolStartedAtRef = (0, import_react91.useRef)(null);
|
|
59962
|
+
const persistPlanState = (0, import_react91.useCallback)(() => {
|
|
59894
59963
|
if (!session) return;
|
|
59895
59964
|
const steps = planStepsRef.current;
|
|
59896
59965
|
if (!steps || steps.length === 0) {
|
|
@@ -59902,7 +59971,7 @@ function AppInner({
|
|
|
59902
59971
|
if (planSummaryRef.current) extras.summary = planSummaryRef.current;
|
|
59903
59972
|
savePlanState(session, steps, completedStepIdsRef.current, extras);
|
|
59904
59973
|
}, [session]);
|
|
59905
|
-
const [summary, setSummary] = (0,
|
|
59974
|
+
const [summary, setSummary] = (0, import_react91.useState)({
|
|
59906
59975
|
turns: 0,
|
|
59907
59976
|
totalCostUsd: 0,
|
|
59908
59977
|
totalInputCostUsd: 0,
|
|
@@ -59913,7 +59982,7 @@ function AppInner({
|
|
|
59913
59982
|
lastPromptTokens: 0,
|
|
59914
59983
|
lastTurnCostUsd: 0
|
|
59915
59984
|
});
|
|
59916
|
-
const transcriptRef = (0,
|
|
59985
|
+
const transcriptRef = (0, import_react91.useRef)(null);
|
|
59917
59986
|
if (transcript && !transcriptRef.current) {
|
|
59918
59987
|
transcriptRef.current = openTranscriptFile(transcript, {
|
|
59919
59988
|
version: 1,
|
|
@@ -59922,21 +59991,21 @@ function AppInner({
|
|
|
59922
59991
|
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
59923
59992
|
});
|
|
59924
59993
|
}
|
|
59925
|
-
const eventSinkRef = (0,
|
|
59926
|
-
const eventizerRef = (0,
|
|
59994
|
+
const eventSinkRef = (0, import_react91.useRef)(null);
|
|
59995
|
+
const eventizerRef = (0, import_react91.useRef)(null);
|
|
59927
59996
|
if (session && !eventSinkRef.current) {
|
|
59928
59997
|
eventSinkRef.current = openEventSink(eventLogPath(session));
|
|
59929
59998
|
eventizerRef.current = new Eventizer();
|
|
59930
59999
|
eventSinkRef.current.append(eventizerRef.current.emitSessionOpened(0, session, 0));
|
|
59931
60000
|
}
|
|
59932
|
-
(0,
|
|
60001
|
+
(0, import_react91.useEffect)(() => {
|
|
59933
60002
|
return () => {
|
|
59934
60003
|
transcriptRef.current?.end();
|
|
59935
60004
|
void eventSinkRef.current?.close();
|
|
59936
60005
|
};
|
|
59937
60006
|
}, []);
|
|
59938
|
-
const loopRef = (0,
|
|
59939
|
-
const loop2 = (0,
|
|
60007
|
+
const loopRef = (0, import_react91.useRef)(null);
|
|
60008
|
+
const loop2 = (0, import_react91.useMemo)(() => {
|
|
59940
60009
|
if (loopRef.current) return loopRef.current;
|
|
59941
60010
|
const client = new DeepSeekClient({ baseUrl: loadBaseUrl() });
|
|
59942
60011
|
if (tools && !tools.has("run_skill")) {
|
|
@@ -59986,10 +60055,10 @@ function AppInner({
|
|
|
59986
60055
|
loopRef.current = l;
|
|
59987
60056
|
return l;
|
|
59988
60057
|
}, [model2, system, rebuildSystem, budgetUsd, session, tools, codeMode]);
|
|
59989
|
-
(0,
|
|
60058
|
+
(0, import_react91.useEffect)(() => {
|
|
59990
60059
|
setSummary(loop2.stats.summary());
|
|
59991
60060
|
}, [loop2]);
|
|
59992
|
-
const generateCurrentSessionTitle = (0,
|
|
60061
|
+
const generateCurrentSessionTitle = (0, import_react91.useCallback)(
|
|
59993
60062
|
async (seed) => {
|
|
59994
60063
|
if (!session || !onSwitchSession) return t("app.sessionTitleNoSession");
|
|
59995
60064
|
const userText = seed?.userText ?? lastMessageContent(loop2.log.entries, "user");
|
|
@@ -60024,7 +60093,7 @@ function AppInner({
|
|
|
60024
60093
|
},
|
|
60025
60094
|
[currentRootDir, loop2.client, loop2.log.entries, loop2.model, model2, onSwitchSession, session]
|
|
60026
60095
|
);
|
|
60027
|
-
const switchWorkspaceRoot = (0,
|
|
60096
|
+
const switchWorkspaceRoot = (0, import_react91.useCallback)(
|
|
60028
60097
|
(newPath) => {
|
|
60029
60098
|
if (!codeMode?.reregisterTools) return { ok: false, info: t("handlers.edits.cwdCodeOnly") };
|
|
60030
60099
|
const resolved = resolve4(newPath);
|
|
@@ -60061,7 +60130,7 @@ function AppInner({
|
|
|
60061
60130
|
},
|
|
60062
60131
|
[codeMode, log, reloadHooks, setCurrentRootDir]
|
|
60063
60132
|
);
|
|
60064
|
-
(0,
|
|
60133
|
+
(0, import_react91.useEffect)(() => {
|
|
60065
60134
|
if (!session || !tools) return;
|
|
60066
60135
|
tools.setAuditListener((event) => {
|
|
60067
60136
|
const sink = eventSinkRef.current;
|
|
@@ -60104,15 +60173,15 @@ function AppInner({
|
|
|
60104
60173
|
pauseGate.setAuditListener(null);
|
|
60105
60174
|
};
|
|
60106
60175
|
}, [loop2, session, tools]);
|
|
60107
|
-
(0,
|
|
60176
|
+
(0, import_react91.useEffect)(() => {
|
|
60108
60177
|
loop2.hooks = hookList;
|
|
60109
60178
|
}, [loop2, hookList]);
|
|
60110
|
-
(0,
|
|
60179
|
+
(0, import_react91.useEffect)(() => {
|
|
60111
60180
|
const canonical = loop2.model === "deepseek-v4-pro" ? "pro" : loop2.model === "deepseek-v4-flash" ? loop2.autoEscalate ? "auto" : "flash" : null;
|
|
60112
60181
|
agentStore.dispatch({ type: "session.preset.change", preset: canonical });
|
|
60113
60182
|
}, []);
|
|
60114
|
-
const mcpBridgeStartedRef = (0,
|
|
60115
|
-
(0,
|
|
60183
|
+
const mcpBridgeStartedRef = (0, import_react91.useRef)(false);
|
|
60184
|
+
(0, import_react91.useEffect)(() => {
|
|
60116
60185
|
if (mcpBridgeStartedRef.current) return;
|
|
60117
60186
|
if (!mcpRuntime || !mcpSpecs || mcpSpecs.length === 0) return;
|
|
60118
60187
|
mcpBridgeStartedRef.current = true;
|
|
@@ -60184,18 +60253,18 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
60184
60253
|
}
|
|
60185
60254
|
}, [mcpRuntime, mcpSpecs, loop2, log, agentStore]);
|
|
60186
60255
|
const { balance, models, latestVersion, refreshBalance, refreshModels, refreshLatestVersion } = useSessionInfo(loop2);
|
|
60187
|
-
(0,
|
|
60256
|
+
(0, import_react91.useEffect)(() => {
|
|
60188
60257
|
planModeRef.current = planMode;
|
|
60189
60258
|
}, [planMode]);
|
|
60190
|
-
(0,
|
|
60259
|
+
(0, import_react91.useEffect)(() => {
|
|
60191
60260
|
latestVersionRef.current = latestVersion ?? null;
|
|
60192
60261
|
}, [latestVersion]);
|
|
60193
|
-
const balanceRef = (0,
|
|
60194
|
-
const modelsRef = (0,
|
|
60195
|
-
(0,
|
|
60262
|
+
const balanceRef = (0, import_react91.useRef)(null);
|
|
60263
|
+
const modelsRef = (0, import_react91.useRef)(null);
|
|
60264
|
+
(0, import_react91.useEffect)(() => {
|
|
60196
60265
|
modelsRef.current = models;
|
|
60197
60266
|
}, [models]);
|
|
60198
|
-
(0,
|
|
60267
|
+
(0, import_react91.useEffect)(() => {
|
|
60199
60268
|
balanceRef.current = balance;
|
|
60200
60269
|
walletCurrencyRef.current = balance?.currency;
|
|
60201
60270
|
if (balance) {
|
|
@@ -60205,7 +60274,7 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
60205
60274
|
});
|
|
60206
60275
|
}
|
|
60207
60276
|
}, [balance, agentStore]);
|
|
60208
|
-
const broadcastDashboardEvent = (0,
|
|
60277
|
+
const broadcastDashboardEvent = (0, import_react91.useCallback)((ev) => {
|
|
60209
60278
|
const subs = eventSubscribersRef.current;
|
|
60210
60279
|
if (subs.size === 0) return;
|
|
60211
60280
|
for (const h of subs) {
|
|
@@ -60215,7 +60284,7 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
60215
60284
|
}
|
|
60216
60285
|
}
|
|
60217
60286
|
}, []);
|
|
60218
|
-
const pickerPorts = (0,
|
|
60287
|
+
const pickerPorts = (0, import_react91.useMemo)(
|
|
60219
60288
|
() => ({
|
|
60220
60289
|
broadcast: broadcastDashboardEvent,
|
|
60221
60290
|
resolverRef: activePickerResolverRef,
|
|
@@ -60223,7 +60292,7 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
60223
60292
|
}),
|
|
60224
60293
|
[broadcastDashboardEvent]
|
|
60225
60294
|
);
|
|
60226
|
-
const viewerPorts = (0,
|
|
60295
|
+
const viewerPorts = (0, import_react91.useMemo)(
|
|
60227
60296
|
() => ({
|
|
60228
60297
|
broadcast: broadcastDashboardEvent,
|
|
60229
60298
|
resolverRef: activeViewerResolverRef,
|
|
@@ -60237,10 +60306,10 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
60237
60306
|
() => setPendingReplayViewer(null),
|
|
60238
60307
|
viewerPorts
|
|
60239
60308
|
);
|
|
60240
|
-
(0,
|
|
60309
|
+
(0, import_react91.useEffect)(() => {
|
|
60241
60310
|
broadcastDashboardEvent({ kind: "busy-change", busy });
|
|
60242
60311
|
}, [busy, broadcastDashboardEvent]);
|
|
60243
|
-
(0,
|
|
60312
|
+
(0, import_react91.useEffect)(() => {
|
|
60244
60313
|
if (!pendingShell) return;
|
|
60245
60314
|
const modal = {
|
|
60246
60315
|
kind: "shell",
|
|
@@ -60253,7 +60322,7 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
60253
60322
|
broadcastDashboardEvent({ kind: "modal-down", modalKind: "shell" });
|
|
60254
60323
|
};
|
|
60255
60324
|
}, [pendingShell, broadcastDashboardEvent]);
|
|
60256
|
-
(0,
|
|
60325
|
+
(0, import_react91.useEffect)(() => {
|
|
60257
60326
|
if (!pendingChoice) return;
|
|
60258
60327
|
const modal = {
|
|
60259
60328
|
kind: "choice",
|
|
@@ -60266,7 +60335,7 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
60266
60335
|
broadcastDashboardEvent({ kind: "modal-down", modalKind: "choice" });
|
|
60267
60336
|
};
|
|
60268
60337
|
}, [pendingChoice, broadcastDashboardEvent]);
|
|
60269
|
-
(0,
|
|
60338
|
+
(0, import_react91.useEffect)(() => {
|
|
60270
60339
|
if (!pendingPlan) return;
|
|
60271
60340
|
broadcastDashboardEvent({
|
|
60272
60341
|
kind: "modal-up",
|
|
@@ -60276,7 +60345,7 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
60276
60345
|
broadcastDashboardEvent({ kind: "modal-down", modalKind: "plan" });
|
|
60277
60346
|
};
|
|
60278
60347
|
}, [pendingPlan, broadcastDashboardEvent]);
|
|
60279
|
-
(0,
|
|
60348
|
+
(0, import_react91.useEffect)(() => {
|
|
60280
60349
|
if (!pendingEditReview) return;
|
|
60281
60350
|
const firstBlock = pendingEditReview[0];
|
|
60282
60351
|
if (!firstBlock) return;
|
|
@@ -60299,7 +60368,7 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
60299
60368
|
broadcastDashboardEvent({ kind: "modal-down", modalKind: "edit-review" });
|
|
60300
60369
|
};
|
|
60301
60370
|
}, [pendingEditReview, broadcastDashboardEvent]);
|
|
60302
|
-
(0,
|
|
60371
|
+
(0, import_react91.useEffect)(() => {
|
|
60303
60372
|
if (!pendingRevision) return;
|
|
60304
60373
|
broadcastDashboardEvent({
|
|
60305
60374
|
kind: "modal-up",
|
|
@@ -60319,7 +60388,7 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
60319
60388
|
broadcastDashboardEvent({ kind: "modal-down", modalKind: "revision" });
|
|
60320
60389
|
};
|
|
60321
60390
|
}, [pendingRevision, broadcastDashboardEvent]);
|
|
60322
|
-
(0,
|
|
60391
|
+
(0, import_react91.useEffect)(() => {
|
|
60323
60392
|
if (!pendingCheckpoint) return;
|
|
60324
60393
|
broadcastDashboardEvent({
|
|
60325
60394
|
kind: "modal-up",
|
|
@@ -60360,12 +60429,12 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
60360
60429
|
mcpServers: liveMcpServers,
|
|
60361
60430
|
slashUsage
|
|
60362
60431
|
});
|
|
60363
|
-
(0,
|
|
60432
|
+
(0, import_react91.useEffect)(() => {
|
|
60364
60433
|
setSessionsPickerList(listSessionsForWorkspace(currentRootDir));
|
|
60365
60434
|
setWorkspacePickerList(listKnownWorkspaces(currentRootDir));
|
|
60366
60435
|
}, [currentRootDir]);
|
|
60367
|
-
const [dashboardUrl, setDashboardUrlState] = (0,
|
|
60368
|
-
const handleHistoryPrev = (0,
|
|
60436
|
+
const [dashboardUrl, setDashboardUrlState] = (0, import_react91.useState)(null);
|
|
60437
|
+
const handleHistoryPrev = (0, import_react91.useCallback)(() => {
|
|
60369
60438
|
if (atState && atState.entries.length > 0) {
|
|
60370
60439
|
setAtSelected((i) => Math.max(0, i - 1));
|
|
60371
60440
|
return;
|
|
@@ -60388,7 +60457,7 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
60388
60457
|
setSlashSelected,
|
|
60389
60458
|
recallPrev
|
|
60390
60459
|
]);
|
|
60391
|
-
const handleHistoryNext = (0,
|
|
60460
|
+
const handleHistoryNext = (0, import_react91.useCallback)(() => {
|
|
60392
60461
|
if (atState && atState.entries.length > 0) {
|
|
60393
60462
|
setAtSelected((i) => Math.min(atState.entries.length - 1, i + 1));
|
|
60394
60463
|
return;
|
|
@@ -60411,8 +60480,8 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
60411
60480
|
setSlashSelected,
|
|
60412
60481
|
recallNext
|
|
60413
60482
|
]);
|
|
60414
|
-
const sessionBannerShown = (0,
|
|
60415
|
-
(0,
|
|
60483
|
+
const sessionBannerShown = (0, import_react91.useRef)(false);
|
|
60484
|
+
(0, import_react91.useEffect)(() => {
|
|
60416
60485
|
if (sessionBannerShown.current) return;
|
|
60417
60486
|
sessionBannerShown.current = true;
|
|
60418
60487
|
if (session && loop2.resumedMessageCount > 0) {
|
|
@@ -60459,8 +60528,20 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
60459
60528
|
markMouseClipboardHintShown();
|
|
60460
60529
|
}
|
|
60461
60530
|
}, [session, loop2, codeMode, syncPendingCount, log, pendingEdits, startupInfoHints]);
|
|
60531
|
+
const startupUpdateCheckStarted = (0, import_react91.useRef)(false);
|
|
60532
|
+
(0, import_react91.useEffect)(() => {
|
|
60533
|
+
if (!startupUpdateCheck || startupUpdateCheckStarted.current) return;
|
|
60534
|
+
startupUpdateCheckStarted.current = true;
|
|
60535
|
+
let cancelled = false;
|
|
60536
|
+
void startupUpdateCheck().then((hint) => {
|
|
60537
|
+
if (!cancelled && hint) log.pushInfo(hint);
|
|
60538
|
+
});
|
|
60539
|
+
return () => {
|
|
60540
|
+
cancelled = true;
|
|
60541
|
+
};
|
|
60542
|
+
}, [startupUpdateCheck, log]);
|
|
60462
60543
|
const quitProcess = useQuit(transcriptRef);
|
|
60463
|
-
const cleanupInterruptedTurn = (0,
|
|
60544
|
+
const cleanupInterruptedTurn = (0, import_react91.useCallback)(() => {
|
|
60464
60545
|
const ts = Date.now();
|
|
60465
60546
|
agentStore.dispatch({
|
|
60466
60547
|
type: "turn.interrupt.cleanup",
|
|
@@ -60597,7 +60678,7 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
60597
60678
|
}
|
|
60598
60679
|
}
|
|
60599
60680
|
});
|
|
60600
|
-
(0,
|
|
60681
|
+
(0, import_react91.useEffect)(() => {
|
|
60601
60682
|
if (!tools || !codeMode) return;
|
|
60602
60683
|
tools.setToolInterceptor(async (name, args, ctx) => {
|
|
60603
60684
|
const rootForEdit = currentRootDirRef.current;
|
|
@@ -60689,7 +60770,7 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
60689
60770
|
});
|
|
60690
60771
|
const prefixHash = loop2.prefix.fingerprint;
|
|
60691
60772
|
const writeTranscript = useTranscriptWriter(transcriptRef, model2, prefixHash);
|
|
60692
|
-
const togglePlanMode = (0,
|
|
60773
|
+
const togglePlanMode = (0, import_react91.useCallback)(
|
|
60693
60774
|
(on) => {
|
|
60694
60775
|
setPlanMode(on);
|
|
60695
60776
|
tools?.setPlanMode(on);
|
|
@@ -60705,7 +60786,7 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
60705
60786
|
clearFiringFlag,
|
|
60706
60787
|
activeLoop
|
|
60707
60788
|
} = useLoopMode({ log, busyRef, handleSubmitRef });
|
|
60708
|
-
const startWalkthrough = (0,
|
|
60789
|
+
const startWalkthrough = (0, import_react91.useCallback)(() => {
|
|
60709
60790
|
if (!codeMode) {
|
|
60710
60791
|
return "/walk is only available inside `carboncode code`.";
|
|
60711
60792
|
}
|
|
@@ -60715,11 +60796,11 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
60715
60796
|
setWalkthroughActive(true);
|
|
60716
60797
|
return `walking ${pendingEdits.current.length} edit block(s) - y apply - n reject - a apply rest - A flip to AUTO - Esc cancels (keeps remaining queued).`;
|
|
60717
60798
|
}, [codeMode, pendingEdits]);
|
|
60718
|
-
const startDashboard = (0,
|
|
60799
|
+
const startDashboard = (0, import_react91.useCallback)(async () => {
|
|
60719
60800
|
if (dashboardRef.current) return dashboardRef.current.url;
|
|
60720
60801
|
if (dashboardStartingRef.current) return dashboardStartingRef.current;
|
|
60721
60802
|
const startup = (async () => {
|
|
60722
|
-
const { startDashboardServer } = await import("./server-
|
|
60803
|
+
const { startDashboardServer } = await import("./server-73KDDDDD.js");
|
|
60723
60804
|
const handle = await startDashboardServer(
|
|
60724
60805
|
{
|
|
60725
60806
|
mode: "attached",
|
|
@@ -60991,7 +61072,7 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
60991
61072
|
dashboardHost,
|
|
60992
61073
|
dashboardToken
|
|
60993
61074
|
]);
|
|
60994
|
-
const stopDashboard = (0,
|
|
61075
|
+
const stopDashboard = (0, import_react91.useCallback)(async () => {
|
|
60995
61076
|
const h = dashboardRef.current;
|
|
60996
61077
|
if (!h) return;
|
|
60997
61078
|
dashboardRef.current = null;
|
|
@@ -61002,10 +61083,10 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
61002
61083
|
}
|
|
61003
61084
|
log.pushInfo(t("app.dashboardStopped"));
|
|
61004
61085
|
}, [log]);
|
|
61005
|
-
const getDashboardUrl = (0,
|
|
61086
|
+
const getDashboardUrl = (0, import_react91.useCallback)(() => {
|
|
61006
61087
|
return dashboardRef.current?.url ?? null;
|
|
61007
61088
|
}, []);
|
|
61008
|
-
(0,
|
|
61089
|
+
(0, import_react91.useEffect)(() => {
|
|
61009
61090
|
if (noDashboard) return;
|
|
61010
61091
|
if (dashboardRef.current) return;
|
|
61011
61092
|
startDashboard().then((url) => {
|
|
@@ -61017,7 +61098,7 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
61017
61098
|
log.pushInfo(t("ui.dashboardAutoStartFailed", { reason }));
|
|
61018
61099
|
});
|
|
61019
61100
|
}, [noDashboard, openDashboard, startDashboard, log]);
|
|
61020
|
-
(0,
|
|
61101
|
+
(0, import_react91.useEffect)(() => {
|
|
61021
61102
|
return () => {
|
|
61022
61103
|
const h = dashboardRef.current;
|
|
61023
61104
|
if (h) {
|
|
@@ -61026,7 +61107,7 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
61026
61107
|
}
|
|
61027
61108
|
};
|
|
61028
61109
|
}, []);
|
|
61029
|
-
const handleWalkChoice = (0,
|
|
61110
|
+
const handleWalkChoice = (0, import_react91.useCallback)(
|
|
61030
61111
|
(choice) => {
|
|
61031
61112
|
if (choice === "apply") {
|
|
61032
61113
|
log.pushInfo(codeApply([1]));
|
|
@@ -61048,20 +61129,20 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
61048
61129
|
},
|
|
61049
61130
|
[codeApply, codeDiscard, log, pendingEdits, setEditMode]
|
|
61050
61131
|
);
|
|
61051
|
-
const pendingGateIdRef = (0,
|
|
61052
|
-
const handleShellConfirmRef = (0,
|
|
61053
|
-
const handlePathConfirmRef = (0,
|
|
61054
|
-
const handlePlanCancelRef = (0,
|
|
61055
|
-
const handlePlanFeedbackRef = (0,
|
|
61056
|
-
const handleCheckpointConfirmRef = (0,
|
|
61132
|
+
const pendingGateIdRef = (0, import_react91.useRef)(null);
|
|
61133
|
+
const handleShellConfirmRef = (0, import_react91.useRef)(() => void 0);
|
|
61134
|
+
const handlePathConfirmRef = (0, import_react91.useRef)(() => void 0);
|
|
61135
|
+
const handlePlanCancelRef = (0, import_react91.useRef)(() => void 0);
|
|
61136
|
+
const handlePlanFeedbackRef = (0, import_react91.useRef)(() => void 0);
|
|
61137
|
+
const handleCheckpointConfirmRef = (0, import_react91.useRef)(
|
|
61057
61138
|
() => void 0
|
|
61058
61139
|
);
|
|
61059
|
-
const handleCheckpointReviseSubmitRef = (0,
|
|
61060
|
-
const handleReviseConfirmRef = (0,
|
|
61140
|
+
const handleCheckpointReviseSubmitRef = (0, import_react91.useRef)(() => void 0);
|
|
61141
|
+
const handleReviseConfirmRef = (0, import_react91.useRef)(
|
|
61061
61142
|
() => void 0
|
|
61062
61143
|
);
|
|
61063
|
-
const handleChoiceResolveRef = (0,
|
|
61064
|
-
const handleQQModelPick = (0,
|
|
61144
|
+
const handleChoiceResolveRef = (0, import_react91.useRef)(() => void 0);
|
|
61145
|
+
const handleQQModelPick = (0, import_react91.useCallback)(
|
|
61065
61146
|
(target) => {
|
|
61066
61147
|
if (target === "auto" || target === "flash" || target === "pro") {
|
|
61067
61148
|
const preset3 = PRESETS[target];
|
|
@@ -61094,7 +61175,7 @@ run \`carboncode setup\` to remove this entry, or fix the underlying issue (miss
|
|
|
61094
61175
|
},
|
|
61095
61176
|
[agentStore, loop2, setPreset]
|
|
61096
61177
|
);
|
|
61097
|
-
const handleQQThemePick = (0,
|
|
61178
|
+
const handleQQThemePick = (0, import_react91.useCallback)(
|
|
61098
61179
|
(target) => {
|
|
61099
61180
|
saveTheme(target);
|
|
61100
61181
|
const active = resolveThemePreference(target, process.env.REASONIX_THEME);
|
|
@@ -61131,7 +61212,7 @@ active now: ${active}`;
|
|
|
61131
61212
|
onPlanRevisionRef: handleReviseConfirmRef,
|
|
61132
61213
|
onChoiceResolveRef: handleChoiceResolveRef
|
|
61133
61214
|
});
|
|
61134
|
-
const handleSubmit = (0,
|
|
61215
|
+
const handleSubmit = (0, import_react91.useCallback)(
|
|
61135
61216
|
async (raw) => {
|
|
61136
61217
|
const incoming = qq.parseSubmit(raw);
|
|
61137
61218
|
if (!incoming) return;
|
|
@@ -61796,10 +61877,10 @@ ${answer}`, "brand");
|
|
|
61796
61877
|
switchWorkspaceRoot
|
|
61797
61878
|
]
|
|
61798
61879
|
);
|
|
61799
|
-
(0,
|
|
61880
|
+
(0, import_react91.useEffect)(() => {
|
|
61800
61881
|
handleSubmitRef.current = handleSubmit;
|
|
61801
61882
|
}, [handleSubmit]);
|
|
61802
|
-
const handleShellConfirm = (0,
|
|
61883
|
+
const handleShellConfirm = (0, import_react91.useCallback)(
|
|
61803
61884
|
(choice, denyContext) => {
|
|
61804
61885
|
const pending = pendingShell;
|
|
61805
61886
|
if (!pending || !codeMode) return;
|
|
@@ -61819,7 +61900,7 @@ ${answer}`, "brand");
|
|
|
61819
61900
|
},
|
|
61820
61901
|
[pendingShell, codeMode, currentRootDir, log]
|
|
61821
61902
|
);
|
|
61822
|
-
const handlePathConfirm = (0,
|
|
61903
|
+
const handlePathConfirm = (0, import_react91.useCallback)(
|
|
61823
61904
|
(choice, denyContext) => {
|
|
61824
61905
|
const pending = pendingPath;
|
|
61825
61906
|
if (!pending) return;
|
|
@@ -61835,7 +61916,7 @@ ${answer}`, "brand");
|
|
|
61835
61916
|
},
|
|
61836
61917
|
[pendingPath]
|
|
61837
61918
|
);
|
|
61838
|
-
const resetPendingModals = (0,
|
|
61919
|
+
const resetPendingModals = (0, import_react91.useCallback)(() => {
|
|
61839
61920
|
const editResolve = editReviewResolveRef.current;
|
|
61840
61921
|
if (editResolve) {
|
|
61841
61922
|
editReviewResolveRef.current = null;
|
|
@@ -61855,7 +61936,7 @@ ${answer}`, "brand");
|
|
|
61855
61936
|
qq.resetInteractions();
|
|
61856
61937
|
pauseGate.cancelAll();
|
|
61857
61938
|
}, [qq]);
|
|
61858
|
-
(0,
|
|
61939
|
+
(0, import_react91.useEffect)(() => {
|
|
61859
61940
|
if (queuedSubmit === null) return;
|
|
61860
61941
|
const canBypassBusy = qq.canBypassBusy(queuedSubmit);
|
|
61861
61942
|
if (!busy && !submittingRef.current || canBypassBusy) {
|
|
@@ -61864,7 +61945,7 @@ ${answer}`, "brand");
|
|
|
61864
61945
|
void handleSubmit(text);
|
|
61865
61946
|
}
|
|
61866
61947
|
}, [busy, queuedSubmit, handleSubmit, qq]);
|
|
61867
|
-
const handlePlanConfirm = (0,
|
|
61948
|
+
const handlePlanConfirm = (0, import_react91.useCallback)(
|
|
61868
61949
|
async (choice) => {
|
|
61869
61950
|
const hadPendingPlan = pendingPlan !== null;
|
|
61870
61951
|
if (!hadPendingPlan && choice !== "approve") {
|
|
@@ -61895,18 +61976,18 @@ ${answer}`, "brand");
|
|
|
61895
61976
|
},
|
|
61896
61977
|
[pendingPlan]
|
|
61897
61978
|
);
|
|
61898
|
-
const handlePlanConfirmRef = (0,
|
|
61899
|
-
(0,
|
|
61979
|
+
const handlePlanConfirmRef = (0, import_react91.useRef)(handlePlanConfirm);
|
|
61980
|
+
(0, import_react91.useEffect)(() => {
|
|
61900
61981
|
handlePlanConfirmRef.current = handlePlanConfirm;
|
|
61901
61982
|
}, [handlePlanConfirm]);
|
|
61902
|
-
(0,
|
|
61983
|
+
(0, import_react91.useEffect)(() => {
|
|
61903
61984
|
handlePlanCancelRef.current = () => handlePlanConfirmRef.current("cancel");
|
|
61904
61985
|
}, []);
|
|
61905
|
-
const stableHandlePlanConfirm = (0,
|
|
61986
|
+
const stableHandlePlanConfirm = (0, import_react91.useCallback)(
|
|
61906
61987
|
async (choice) => handlePlanConfirmRef.current(choice),
|
|
61907
61988
|
[]
|
|
61908
61989
|
);
|
|
61909
|
-
const handleStagedInputSubmit = (0,
|
|
61990
|
+
const handleStagedInputSubmit = (0, import_react91.useCallback)(
|
|
61910
61991
|
async (feedback2, override) => {
|
|
61911
61992
|
const staged = override ?? stagedInput;
|
|
61912
61993
|
if (override) {
|
|
@@ -61962,18 +62043,18 @@ ${answer}`, "brand");
|
|
|
61962
62043
|
},
|
|
61963
62044
|
[stagedInput, togglePlanMode, persistPlanState, agentStore, log]
|
|
61964
62045
|
);
|
|
61965
|
-
const handleStagedInputSubmitRef = (0,
|
|
61966
|
-
(0,
|
|
62046
|
+
const handleStagedInputSubmitRef = (0, import_react91.useRef)(handleStagedInputSubmit);
|
|
62047
|
+
(0, import_react91.useEffect)(() => {
|
|
61967
62048
|
handleStagedInputSubmitRef.current = handleStagedInputSubmit;
|
|
61968
62049
|
}, [handleStagedInputSubmit]);
|
|
61969
|
-
(0,
|
|
62050
|
+
(0, import_react91.useEffect)(() => {
|
|
61970
62051
|
handlePlanFeedbackRef.current = (feedback2, override) => handleStagedInputSubmitRef.current(feedback2, override);
|
|
61971
62052
|
}, []);
|
|
61972
|
-
const handleStagedInputCancel = (0,
|
|
62053
|
+
const handleStagedInputCancel = (0, import_react91.useCallback)(() => {
|
|
61973
62054
|
if (stagedInput?.plan) setPendingPlan(stagedInput.plan);
|
|
61974
62055
|
setStagedInput(null);
|
|
61975
62056
|
}, [stagedInput]);
|
|
61976
|
-
const handleChoiceConfirm = (0,
|
|
62057
|
+
const handleChoiceConfirm = (0, import_react91.useCallback)(
|
|
61977
62058
|
async (choice) => {
|
|
61978
62059
|
const snap = pendingChoice;
|
|
61979
62060
|
if (!snap) return;
|
|
@@ -61994,13 +62075,13 @@ ${answer}`, "brand");
|
|
|
61994
62075
|
},
|
|
61995
62076
|
[pendingChoice]
|
|
61996
62077
|
);
|
|
61997
|
-
(0,
|
|
62078
|
+
(0, import_react91.useEffect)(() => {
|
|
61998
62079
|
handleShellConfirmRef.current = handleShellConfirm;
|
|
61999
62080
|
}, [handleShellConfirm]);
|
|
62000
|
-
(0,
|
|
62081
|
+
(0, import_react91.useEffect)(() => {
|
|
62001
62082
|
handlePathConfirmRef.current = handlePathConfirm;
|
|
62002
62083
|
}, [handlePathConfirm]);
|
|
62003
|
-
(0,
|
|
62084
|
+
(0, import_react91.useEffect)(() => {
|
|
62004
62085
|
return pauseGate.on((request) => {
|
|
62005
62086
|
const payload = request.payload;
|
|
62006
62087
|
pendingGateIdRef.current = request.id;
|
|
@@ -62083,23 +62164,23 @@ ${answer}`, "brand");
|
|
|
62083
62164
|
}
|
|
62084
62165
|
});
|
|
62085
62166
|
}, [log, qq]);
|
|
62086
|
-
const pendingPlanRef = (0,
|
|
62087
|
-
(0,
|
|
62167
|
+
const pendingPlanRef = (0, import_react91.useRef)(null);
|
|
62168
|
+
(0, import_react91.useEffect)(() => {
|
|
62088
62169
|
pendingPlanRef.current = pendingPlan;
|
|
62089
62170
|
}, [pendingPlan]);
|
|
62090
|
-
const pendingCheckpointRef = (0,
|
|
62091
|
-
(0,
|
|
62171
|
+
const pendingCheckpointRef = (0, import_react91.useRef)(null);
|
|
62172
|
+
(0, import_react91.useEffect)(() => {
|
|
62092
62173
|
pendingCheckpointRef.current = pendingCheckpoint;
|
|
62093
62174
|
}, [pendingCheckpoint]);
|
|
62094
|
-
const handleChoiceConfirmRef = (0,
|
|
62095
|
-
(0,
|
|
62175
|
+
const handleChoiceConfirmRef = (0, import_react91.useRef)(handleChoiceConfirm);
|
|
62176
|
+
(0, import_react91.useEffect)(() => {
|
|
62096
62177
|
handleChoiceConfirmRef.current = handleChoiceConfirm;
|
|
62097
62178
|
}, [handleChoiceConfirm]);
|
|
62098
|
-
const stableHandleChoiceConfirm = (0,
|
|
62179
|
+
const stableHandleChoiceConfirm = (0, import_react91.useCallback)(
|
|
62099
62180
|
async (choice) => handleChoiceConfirmRef.current(choice),
|
|
62100
62181
|
[]
|
|
62101
62182
|
);
|
|
62102
|
-
const handleCheckpointConfirm = (0,
|
|
62183
|
+
const handleCheckpointConfirm = (0, import_react91.useCallback)(
|
|
62103
62184
|
(choice) => {
|
|
62104
62185
|
const snap = pendingCheckpoint;
|
|
62105
62186
|
if (!snap) return;
|
|
@@ -62144,10 +62225,10 @@ ${answer}`, "brand");
|
|
|
62144
62225
|
},
|
|
62145
62226
|
[pendingCheckpoint, codeMode, touchedPaths, log]
|
|
62146
62227
|
);
|
|
62147
|
-
(0,
|
|
62228
|
+
(0, import_react91.useEffect)(() => {
|
|
62148
62229
|
handleCheckpointConfirmRef.current = handleCheckpointConfirm;
|
|
62149
62230
|
}, [handleCheckpointConfirm]);
|
|
62150
|
-
const handleAutoCheckpointContinue = (0,
|
|
62231
|
+
const handleAutoCheckpointContinue = (0, import_react91.useCallback)(
|
|
62151
62232
|
(stepId, title2) => {
|
|
62152
62233
|
if (codeMode) {
|
|
62153
62234
|
const paths = touchedPaths();
|
|
@@ -62172,15 +62253,15 @@ ${answer}`, "brand");
|
|
|
62172
62253
|
},
|
|
62173
62254
|
[codeMode, touchedPaths, log]
|
|
62174
62255
|
);
|
|
62175
|
-
const handleAutoCheckpointContinueRef = (0,
|
|
62176
|
-
(0,
|
|
62256
|
+
const handleAutoCheckpointContinueRef = (0, import_react91.useRef)(handleAutoCheckpointContinue);
|
|
62257
|
+
(0, import_react91.useEffect)(() => {
|
|
62177
62258
|
handleAutoCheckpointContinueRef.current = handleAutoCheckpointContinue;
|
|
62178
62259
|
}, [handleAutoCheckpointContinue]);
|
|
62179
|
-
const stableHandleCheckpointConfirm = (0,
|
|
62260
|
+
const stableHandleCheckpointConfirm = (0, import_react91.useCallback)(
|
|
62180
62261
|
(choice) => handleCheckpointConfirmRef.current(choice),
|
|
62181
62262
|
[]
|
|
62182
62263
|
);
|
|
62183
|
-
const handleCheckpointReviseSubmit = (0,
|
|
62264
|
+
const handleCheckpointReviseSubmit = (0, import_react91.useCallback)(
|
|
62184
62265
|
(feedback2, snapOverride) => {
|
|
62185
62266
|
const snap = snapOverride;
|
|
62186
62267
|
setStagedCheckpointRevise(null);
|
|
@@ -62202,15 +62283,15 @@ ${answer}`, "brand");
|
|
|
62202
62283
|
},
|
|
62203
62284
|
[log]
|
|
62204
62285
|
);
|
|
62205
|
-
const handleCheckpointReviseCancel = (0,
|
|
62286
|
+
const handleCheckpointReviseCancel = (0, import_react91.useCallback)(() => {
|
|
62206
62287
|
const snap = stagedCheckpointRevise;
|
|
62207
62288
|
setStagedCheckpointRevise(null);
|
|
62208
62289
|
if (snap) setPendingCheckpoint(snap);
|
|
62209
62290
|
}, [stagedCheckpointRevise]);
|
|
62210
|
-
(0,
|
|
62291
|
+
(0, import_react91.useEffect)(() => {
|
|
62211
62292
|
handleCheckpointReviseSubmitRef.current = handleCheckpointReviseSubmit;
|
|
62212
62293
|
}, [handleCheckpointReviseSubmit]);
|
|
62213
|
-
const handleChoiceCustomSubmit = (0,
|
|
62294
|
+
const handleChoiceCustomSubmit = (0, import_react91.useCallback)((answer) => {
|
|
62214
62295
|
setStagedChoiceCustom(null);
|
|
62215
62296
|
const trimmed = answer.trim();
|
|
62216
62297
|
const gateId = pendingGateIdRef.current;
|
|
@@ -62218,12 +62299,12 @@ ${answer}`, "brand");
|
|
|
62218
62299
|
pauseGate.resolve(gateId, { type: "text", text: trimmed || "" });
|
|
62219
62300
|
}
|
|
62220
62301
|
}, []);
|
|
62221
|
-
const handleChoiceCustomCancel = (0,
|
|
62302
|
+
const handleChoiceCustomCancel = (0, import_react91.useCallback)(() => {
|
|
62222
62303
|
const snap = stagedChoiceCustom;
|
|
62223
62304
|
setStagedChoiceCustom(null);
|
|
62224
62305
|
if (snap) setPendingChoice(snap);
|
|
62225
62306
|
}, [stagedChoiceCustom]);
|
|
62226
|
-
(0,
|
|
62307
|
+
(0, import_react91.useEffect)(() => {
|
|
62227
62308
|
handleChoiceResolveRef.current = (resolution) => {
|
|
62228
62309
|
if (resolution.type === "pick") {
|
|
62229
62310
|
void handleChoiceConfirmRef.current({ kind: "pick", optionId: resolution.optionId });
|
|
@@ -62237,7 +62318,7 @@ ${answer}`, "brand");
|
|
|
62237
62318
|
void handleChoiceConfirmRef.current({ kind: "cancel" });
|
|
62238
62319
|
};
|
|
62239
62320
|
}, [handleChoiceCustomSubmit]);
|
|
62240
|
-
const handleReviseConfirm = (0,
|
|
62321
|
+
const handleReviseConfirm = (0, import_react91.useCallback)(
|
|
62241
62322
|
(choice) => {
|
|
62242
62323
|
const snap = pendingRevision;
|
|
62243
62324
|
if (!snap) return;
|
|
@@ -62271,7 +62352,7 @@ ${answer}`, "brand");
|
|
|
62271
62352
|
},
|
|
62272
62353
|
[pendingRevision, persistPlanState, agentStore, log]
|
|
62273
62354
|
);
|
|
62274
|
-
(0,
|
|
62355
|
+
(0, import_react91.useEffect)(() => {
|
|
62275
62356
|
handleReviseConfirmRef.current = (choice) => {
|
|
62276
62357
|
if (choice === "cancel") {
|
|
62277
62358
|
const gateId = pendingGateIdRef.current;
|
|
@@ -62282,13 +62363,13 @@ ${answer}`, "brand");
|
|
|
62282
62363
|
return handleReviseConfirm(choice);
|
|
62283
62364
|
};
|
|
62284
62365
|
}, [handleReviseConfirm]);
|
|
62285
|
-
const stableHandleReviseConfirm = (0,
|
|
62366
|
+
const stableHandleReviseConfirm = (0, import_react91.useCallback)(
|
|
62286
62367
|
async (choice) => handleReviseConfirmRef.current(choice),
|
|
62287
62368
|
[]
|
|
62288
62369
|
);
|
|
62289
62370
|
const tickerSuspended = modalOpen || !busy && !isStreaming;
|
|
62290
|
-
if (!bootReady) return /* @__PURE__ */
|
|
62291
|
-
return /* @__PURE__ */
|
|
62371
|
+
if (!bootReady) return /* @__PURE__ */ import_react91.default.createElement(BootSplash, null);
|
|
62372
|
+
return /* @__PURE__ */ import_react91.default.createElement(import_react91.default.Fragment, null, /* @__PURE__ */ import_react91.default.createElement(
|
|
62292
62373
|
HistoryTypingCapture,
|
|
62293
62374
|
{
|
|
62294
62375
|
input,
|
|
@@ -62296,393 +62377,400 @@ ${answer}`, "brand");
|
|
|
62296
62377
|
enabled: !modalOpen && !busy,
|
|
62297
62378
|
onReturnToBottom: chatScroll.jumpToBottom
|
|
62298
62379
|
}
|
|
62299
|
-
), /* @__PURE__ */
|
|
62300
|
-
|
|
62301
|
-
{
|
|
62302
|
-
inCodeMode: !!codeMode,
|
|
62303
|
-
workspaceRoot: codeMode ? currentRootDir : void 0,
|
|
62304
|
-
dashboardUrl,
|
|
62305
|
-
languageVersion
|
|
62306
|
-
}
|
|
62307
|
-
) : null, /* @__PURE__ */ import_react90.default.createElement(
|
|
62308
|
-
LiveActivityArea,
|
|
62309
|
-
{
|
|
62310
|
-
noTakeoverOverlay,
|
|
62311
|
-
ongoingTool,
|
|
62312
|
-
toolProgress,
|
|
62313
|
-
subagentActivities,
|
|
62314
|
-
statusLine,
|
|
62315
|
-
busy,
|
|
62316
|
-
isStreaming,
|
|
62317
|
-
activityLabel,
|
|
62318
|
-
undoBanner,
|
|
62319
|
-
hideUndo: !!(pendingShell || pendingPlan || pendingReviseEditor || pendingSessionsPicker || pendingCheckpointPicker || pendingMcpHub || stagedInput || pendingEditReview || pendingChoice || stagedChoiceCustom || pendingRevision || stagedCheckpointRevise || pendingCheckpoint)
|
|
62320
|
-
}
|
|
62321
|
-
)), stagedInput ? /* @__PURE__ */ import_react90.default.createElement(
|
|
62322
|
-
PlanRefineInput,
|
|
62323
|
-
{
|
|
62324
|
-
mode: stagedInput.mode,
|
|
62325
|
-
questions: stagedInput.questions,
|
|
62326
|
-
onSubmit: handleStagedInputSubmit,
|
|
62327
|
-
onCancel: handleStagedInputCancel
|
|
62328
|
-
}
|
|
62329
|
-
) : stagedChoiceCustom ? /* @__PURE__ */ import_react90.default.createElement(
|
|
62330
|
-
PlanRefineInput,
|
|
62331
|
-
{
|
|
62332
|
-
mode: "choice-custom",
|
|
62333
|
-
onSubmit: handleChoiceCustomSubmit,
|
|
62334
|
-
onCancel: handleChoiceCustomCancel
|
|
62335
|
-
}
|
|
62336
|
-
) : stagedCheckpointRevise ? /* @__PURE__ */ import_react90.default.createElement(
|
|
62337
|
-
PlanRefineInput,
|
|
62338
|
-
{
|
|
62339
|
-
mode: "checkpoint-revise",
|
|
62340
|
-
onSubmit: (text) => handleCheckpointReviseSubmit(text, stagedCheckpointRevise),
|
|
62341
|
-
onCancel: handleCheckpointReviseCancel
|
|
62342
|
-
}
|
|
62343
|
-
) : pendingChoice ? /* @__PURE__ */ import_react90.default.createElement(
|
|
62344
|
-
ChoiceConfirm,
|
|
62345
|
-
{
|
|
62346
|
-
question: pendingChoice.question,
|
|
62347
|
-
options: pendingChoice.options,
|
|
62348
|
-
allowCustom: pendingChoice.allowCustom,
|
|
62349
|
-
onChoose: stableHandleChoiceConfirm
|
|
62350
|
-
}
|
|
62351
|
-
) : pendingRevision ? /* @__PURE__ */ import_react90.default.createElement(
|
|
62352
|
-
PlanReviseConfirm,
|
|
62353
|
-
{
|
|
62354
|
-
reason: pendingRevision.reason,
|
|
62355
|
-
oldRemaining: (planStepsRef.current ?? []).filter(
|
|
62356
|
-
(s) => !completedStepIdsRef.current.has(s.id)
|
|
62357
|
-
),
|
|
62358
|
-
newRemaining: pendingRevision.remainingSteps,
|
|
62359
|
-
summary: pendingRevision.summary,
|
|
62360
|
-
onChoose: stableHandleReviseConfirm
|
|
62361
|
-
}
|
|
62362
|
-
) : pendingCheckpoint ? /* @__PURE__ */ import_react90.default.createElement(
|
|
62363
|
-
PlanCheckpointConfirm,
|
|
62380
|
+
), /* @__PURE__ */ import_react91.default.createElement(TickerProvider, { disabled: tickerSuspended }, /* @__PURE__ */ import_react91.default.createElement(ViewportBudgetProvider, null, /* @__PURE__ */ import_react91.default.createElement(InflightProvider, { inflight: loop2.inflight }, /* @__PURE__ */ import_react91.default.createElement(
|
|
62381
|
+
ConversationViewport,
|
|
62364
62382
|
{
|
|
62365
|
-
|
|
62366
|
-
|
|
62367
|
-
|
|
62368
|
-
|
|
62369
|
-
|
|
62370
|
-
|
|
62371
|
-
|
|
62372
|
-
|
|
62373
|
-
) : pendingCheckpointPicker ? /* @__PURE__ */ import_react90.default.createElement(
|
|
62374
|
-
CheckpointPicker,
|
|
62375
|
-
{
|
|
62376
|
-
checkpoints: checkpointPickerList,
|
|
62377
|
-
workspace: currentRootDir,
|
|
62378
|
-
pickerPorts,
|
|
62379
|
-
onChoose: (outcome) => {
|
|
62380
|
-
if (outcome.kind === "quit") {
|
|
62381
|
-
setPendingCheckpointPicker(false);
|
|
62382
|
-
return;
|
|
62383
|
+
bottomReserveRows: modalOpen ? 12 : 4,
|
|
62384
|
+
history: ({ maxRows }) => /* @__PURE__ */ import_react91.default.createElement(Box_default, { flexDirection: "column", flexShrink: 1 }, /* @__PURE__ */ import_react91.default.createElement(LiveExpandContext.Provider, { value: liveExpand }, /* @__PURE__ */ import_react91.default.createElement(CardStream, { suppressLive: modalOpen, maxRows: Math.max(1, maxRows - 1) })), !hasConversation && !busy && !isStreaming && slashMatches === null ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62385
|
+
WelcomeBanner,
|
|
62386
|
+
{
|
|
62387
|
+
inCodeMode: !!codeMode,
|
|
62388
|
+
workspaceRoot: codeMode ? currentRootDir : void 0,
|
|
62389
|
+
dashboardUrl,
|
|
62390
|
+
languageVersion
|
|
62383
62391
|
}
|
|
62384
|
-
|
|
62385
|
-
|
|
62386
|
-
|
|
62387
|
-
|
|
62388
|
-
|
|
62389
|
-
|
|
62390
|
-
|
|
62391
|
-
|
|
62392
|
-
|
|
62393
|
-
|
|
62394
|
-
|
|
62395
|
-
|
|
62396
|
-
|
|
62397
|
-
|
|
62398
|
-
|
|
62399
|
-
|
|
62400
|
-
|
|
62401
|
-
|
|
62402
|
-
|
|
62403
|
-
|
|
62404
|
-
|
|
62405
|
-
|
|
62406
|
-
}
|
|
62407
|
-
log.pushInfo(lines.join("\n"));
|
|
62408
|
-
return;
|
|
62392
|
+
) : null, /* @__PURE__ */ import_react91.default.createElement(
|
|
62393
|
+
LiveActivityArea,
|
|
62394
|
+
{
|
|
62395
|
+
noTakeoverOverlay,
|
|
62396
|
+
ongoingTool,
|
|
62397
|
+
toolProgress,
|
|
62398
|
+
subagentActivities,
|
|
62399
|
+
statusLine,
|
|
62400
|
+
busy,
|
|
62401
|
+
isStreaming,
|
|
62402
|
+
activityLabel,
|
|
62403
|
+
undoBanner,
|
|
62404
|
+
hideUndo: !!(pendingShell || pendingPlan || pendingReviseEditor || pendingSessionsPicker || pendingCheckpointPicker || pendingMcpHub || stagedInput || pendingEditReview || pendingChoice || stagedChoiceCustom || pendingRevision || stagedCheckpointRevise || pendingCheckpoint)
|
|
62405
|
+
}
|
|
62406
|
+
)),
|
|
62407
|
+
controls: stagedInput ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62408
|
+
PlanRefineInput,
|
|
62409
|
+
{
|
|
62410
|
+
mode: stagedInput.mode,
|
|
62411
|
+
questions: stagedInput.questions,
|
|
62412
|
+
onSubmit: handleStagedInputSubmit,
|
|
62413
|
+
onCancel: handleStagedInputCancel
|
|
62409
62414
|
}
|
|
62410
|
-
|
|
62411
|
-
|
|
62412
|
-
|
|
62413
|
-
|
|
62414
|
-
|
|
62415
|
+
) : stagedChoiceCustom ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62416
|
+
PlanRefineInput,
|
|
62417
|
+
{
|
|
62418
|
+
mode: "choice-custom",
|
|
62419
|
+
onSubmit: handleChoiceCustomSubmit,
|
|
62420
|
+
onCancel: handleChoiceCustomCancel
|
|
62415
62421
|
}
|
|
62416
|
-
|
|
62417
|
-
|
|
62418
|
-
|
|
62419
|
-
|
|
62420
|
-
|
|
62421
|
-
|
|
62422
|
-
|
|
62423
|
-
|
|
62424
|
-
|
|
62425
|
-
|
|
62426
|
-
|
|
62427
|
-
|
|
62428
|
-
|
|
62429
|
-
|
|
62430
|
-
|
|
62431
|
-
|
|
62432
|
-
|
|
62433
|
-
|
|
62434
|
-
|
|
62435
|
-
|
|
62436
|
-
|
|
62437
|
-
|
|
62438
|
-
|
|
62439
|
-
|
|
62440
|
-
|
|
62441
|
-
|
|
62442
|
-
|
|
62443
|
-
|
|
62444
|
-
|
|
62445
|
-
|
|
62446
|
-
|
|
62447
|
-
|
|
62448
|
-
|
|
62449
|
-
|
|
62422
|
+
) : stagedCheckpointRevise ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62423
|
+
PlanRefineInput,
|
|
62424
|
+
{
|
|
62425
|
+
mode: "checkpoint-revise",
|
|
62426
|
+
onSubmit: (text) => handleCheckpointReviseSubmit(text, stagedCheckpointRevise),
|
|
62427
|
+
onCancel: handleCheckpointReviseCancel
|
|
62428
|
+
}
|
|
62429
|
+
) : pendingChoice ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62430
|
+
ChoiceConfirm,
|
|
62431
|
+
{
|
|
62432
|
+
question: pendingChoice.question,
|
|
62433
|
+
options: pendingChoice.options,
|
|
62434
|
+
allowCustom: pendingChoice.allowCustom,
|
|
62435
|
+
onChoose: stableHandleChoiceConfirm
|
|
62436
|
+
}
|
|
62437
|
+
) : pendingRevision ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62438
|
+
PlanReviseConfirm,
|
|
62439
|
+
{
|
|
62440
|
+
reason: pendingRevision.reason,
|
|
62441
|
+
oldRemaining: (planStepsRef.current ?? []).filter(
|
|
62442
|
+
(s) => !completedStepIdsRef.current.has(s.id)
|
|
62443
|
+
),
|
|
62444
|
+
newRemaining: pendingRevision.remainingSteps,
|
|
62445
|
+
summary: pendingRevision.summary,
|
|
62446
|
+
onChoose: stableHandleReviseConfirm
|
|
62447
|
+
}
|
|
62448
|
+
) : pendingCheckpoint ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62449
|
+
PlanCheckpointConfirm,
|
|
62450
|
+
{
|
|
62451
|
+
stepId: pendingCheckpoint.stepId,
|
|
62452
|
+
title: pendingCheckpoint.title,
|
|
62453
|
+
completed: pendingCheckpoint.completed,
|
|
62454
|
+
total: pendingCheckpoint.total,
|
|
62455
|
+
steps: planStepsRef.current ?? void 0,
|
|
62456
|
+
completedStepIds: completedStepIdsRef.current,
|
|
62457
|
+
onChoose: stableHandleCheckpointConfirm
|
|
62458
|
+
}
|
|
62459
|
+
) : pendingCheckpointPicker ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62460
|
+
CheckpointPicker,
|
|
62461
|
+
{
|
|
62462
|
+
checkpoints: checkpointPickerList,
|
|
62463
|
+
workspace: currentRootDir,
|
|
62464
|
+
pickerPorts,
|
|
62465
|
+
onChoose: (outcome) => {
|
|
62466
|
+
if (outcome.kind === "quit") {
|
|
62467
|
+
setPendingCheckpointPicker(false);
|
|
62468
|
+
return;
|
|
62469
|
+
}
|
|
62470
|
+
if (outcome.kind === "restore") {
|
|
62471
|
+
const target = checkpointPickerList.find((c) => c.id === outcome.id);
|
|
62472
|
+
setPendingCheckpointPicker(false);
|
|
62473
|
+
if (!target) return;
|
|
62474
|
+
const result = restoreCheckpoint(currentRootDir, target.id);
|
|
62475
|
+
const lines = [
|
|
62476
|
+
`restored "${target.name}" (${target.id.slice(0, 7)}, ${fmtAgo(target.createdAt)})`
|
|
62477
|
+
];
|
|
62478
|
+
if (result.restored.length > 0) {
|
|
62479
|
+
lines.push(
|
|
62480
|
+
` wrote ${result.restored.length} file${result.restored.length === 1 ? "" : "s"}`
|
|
62481
|
+
);
|
|
62482
|
+
}
|
|
62483
|
+
if (result.removed.length > 0) {
|
|
62484
|
+
lines.push(
|
|
62485
|
+
` removed ${result.removed.length} file${result.removed.length === 1 ? "" : "s"}`
|
|
62486
|
+
);
|
|
62487
|
+
}
|
|
62488
|
+
if (result.skipped.length > 0) {
|
|
62489
|
+
lines.push(
|
|
62490
|
+
` skipped ${result.skipped.length} file${result.skipped.length === 1 ? "" : "s"}`
|
|
62491
|
+
);
|
|
62492
|
+
}
|
|
62493
|
+
log.pushInfo(lines.join("\n"));
|
|
62494
|
+
return;
|
|
62495
|
+
}
|
|
62496
|
+
if (outcome.kind === "delete") {
|
|
62497
|
+
const target = checkpointPickerList.find((c) => c.id === outcome.id);
|
|
62498
|
+
if (!target) return;
|
|
62499
|
+
deleteCheckpoint(currentRootDir, target.id);
|
|
62500
|
+
setCheckpointPickerList([...listCheckpoints(currentRootDir)].reverse());
|
|
62501
|
+
}
|
|
62450
62502
|
}
|
|
62451
|
-
return;
|
|
62452
62503
|
}
|
|
62453
|
-
|
|
62454
|
-
|
|
62455
|
-
|
|
62456
|
-
|
|
62457
|
-
|
|
62458
|
-
|
|
62459
|
-
|
|
62504
|
+
) : pendingWorkspacePicker ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62505
|
+
WorkspacePicker,
|
|
62506
|
+
{
|
|
62507
|
+
workspaces: workspacePickerList,
|
|
62508
|
+
currentWorkspace: currentRootDir,
|
|
62509
|
+
onChoose: (outcome) => {
|
|
62510
|
+
setPendingWorkspacePicker(false);
|
|
62511
|
+
if (outcome.kind === "quit") return;
|
|
62512
|
+
const result = switchWorkspaceRoot(outcome.path);
|
|
62513
|
+
log.pushInfo(result.info);
|
|
62514
|
+
if (!result.ok) return;
|
|
62515
|
+
setSessionsPickerList(listSessionsForWorkspace(outcome.path));
|
|
62516
|
+
setPendingSessionsPicker(true);
|
|
62517
|
+
}
|
|
62518
|
+
}
|
|
62519
|
+
) : pendingSessionsPicker ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62520
|
+
SessionPicker,
|
|
62521
|
+
{
|
|
62522
|
+
sessions: sessionsPickerList,
|
|
62523
|
+
workspace: currentRootDir,
|
|
62524
|
+
walletCurrency: walletCurrencyRef.current,
|
|
62525
|
+
pickerPorts,
|
|
62526
|
+
onFocusChange: setSessionsPickerFocus,
|
|
62527
|
+
onChoose: (outcome) => {
|
|
62528
|
+
if (outcome.kind === "open") {
|
|
62529
|
+
setPendingSessionsPicker(false);
|
|
62530
|
+
if (onSwitchSession) {
|
|
62531
|
+
onSwitchSession(outcome.name);
|
|
62532
|
+
} else {
|
|
62533
|
+
log.pushInfo(
|
|
62534
|
+
`to switch to "${outcome.name}", quit and run: carboncode chat --session ${outcome.name}`
|
|
62535
|
+
);
|
|
62536
|
+
}
|
|
62537
|
+
return;
|
|
62538
|
+
}
|
|
62539
|
+
if (outcome.kind === "new") {
|
|
62540
|
+
setPendingSessionsPicker(false);
|
|
62541
|
+
if (onSwitchSession) {
|
|
62542
|
+
onSwitchSession(freshSessionName(session));
|
|
62543
|
+
} else {
|
|
62544
|
+
log.pushInfo(
|
|
62545
|
+
"to start a fresh session, quit and run: carboncode chat (no --session flag)"
|
|
62546
|
+
);
|
|
62547
|
+
}
|
|
62548
|
+
return;
|
|
62549
|
+
}
|
|
62550
|
+
if (outcome.kind === "delete") {
|
|
62551
|
+
deleteSession(outcome.name);
|
|
62552
|
+
setSessionsPickerList(listSessionsForWorkspace(currentRootDir));
|
|
62553
|
+
return;
|
|
62554
|
+
}
|
|
62555
|
+
if (outcome.kind === "rename") {
|
|
62556
|
+
renameSession(outcome.name, outcome.newName);
|
|
62557
|
+
setSessionsPickerList(listSessionsForWorkspace(currentRootDir));
|
|
62558
|
+
return;
|
|
62559
|
+
}
|
|
62560
|
+
if (outcome.kind === "quit") {
|
|
62561
|
+
setPendingSessionsPicker(false);
|
|
62562
|
+
}
|
|
62563
|
+
}
|
|
62564
|
+
}
|
|
62565
|
+
) : pendingThemePicker ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62566
|
+
ThemePicker,
|
|
62567
|
+
{
|
|
62568
|
+
currentPreference: loadTheme() ?? "auto",
|
|
62569
|
+
activeTheme: themeName,
|
|
62570
|
+
onChoose: (outcome) => {
|
|
62571
|
+
setPendingThemePicker(false);
|
|
62572
|
+
if (outcome.kind === "quit") return;
|
|
62573
|
+
saveTheme(outcome.value);
|
|
62574
|
+
const active = resolveThemePreference(
|
|
62575
|
+
outcome.value,
|
|
62576
|
+
process.env.REASONIX_THEME
|
|
62460
62577
|
);
|
|
62578
|
+
setThemeName(active);
|
|
62579
|
+
log.pushInfo(`theme saved: ${outcome.value}
|
|
62580
|
+
active now: ${active}`);
|
|
62461
62581
|
}
|
|
62462
|
-
return;
|
|
62463
62582
|
}
|
|
62464
|
-
|
|
62465
|
-
|
|
62466
|
-
|
|
62467
|
-
|
|
62583
|
+
) : pendingCopyMode ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62584
|
+
CopyMode,
|
|
62585
|
+
{
|
|
62586
|
+
cards: agentStore.getState().cards,
|
|
62587
|
+
onClose: (yanked) => {
|
|
62588
|
+
setPendingCopyMode(false);
|
|
62589
|
+
if (yanked) {
|
|
62590
|
+
const path = yanked.filePath;
|
|
62591
|
+
const info = yanked.osc52 ? t("copyMode.yankedToast", { size: yanked.size }) : t("copyMode.yankedToastFile", {
|
|
62592
|
+
size: yanked.size,
|
|
62593
|
+
path: path ?? "unknown"
|
|
62594
|
+
});
|
|
62595
|
+
log.pushInfo(info);
|
|
62596
|
+
}
|
|
62597
|
+
}
|
|
62468
62598
|
}
|
|
62469
|
-
|
|
62470
|
-
|
|
62471
|
-
|
|
62472
|
-
|
|
62599
|
+
) : pendingModelPicker ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62600
|
+
ModelPicker,
|
|
62601
|
+
{
|
|
62602
|
+
models,
|
|
62603
|
+
current: loop2.model,
|
|
62604
|
+
currentEffort: loop2.reasoningEffort,
|
|
62605
|
+
currentAutoEscalate: loop2.autoEscalate,
|
|
62606
|
+
onRefresh: refreshModels,
|
|
62607
|
+
onChoose: (outcome) => {
|
|
62608
|
+
setPendingModelPicker(false);
|
|
62609
|
+
if (outcome.kind === "select") {
|
|
62610
|
+
loop2.configure({ model: outcome.id, autoEscalate: false });
|
|
62611
|
+
agentStore.dispatch({ type: "session.model.change", model: outcome.id });
|
|
62612
|
+
const inferred = outcome.id === "deepseek-v4-pro" ? "pro" : outcome.id === "deepseek-v4-flash" ? "flash" : null;
|
|
62613
|
+
setPreset(inferred ?? "flash");
|
|
62614
|
+
agentStore.dispatch({
|
|
62615
|
+
type: "session.preset.change",
|
|
62616
|
+
preset: inferred
|
|
62617
|
+
});
|
|
62618
|
+
if (inferred) {
|
|
62619
|
+
try {
|
|
62620
|
+
savePreset(inferred);
|
|
62621
|
+
} catch {
|
|
62622
|
+
}
|
|
62623
|
+
}
|
|
62624
|
+
log.pushInfo(`model: ${outcome.id}`);
|
|
62625
|
+
return;
|
|
62626
|
+
}
|
|
62627
|
+
if (outcome.kind === "preset") {
|
|
62628
|
+
const p = PRESETS[outcome.name];
|
|
62629
|
+
loop2.configure({
|
|
62630
|
+
model: p.model,
|
|
62631
|
+
autoEscalate: p.autoEscalate,
|
|
62632
|
+
reasoningEffort: p.reasoningEffort
|
|
62633
|
+
});
|
|
62634
|
+
agentStore.dispatch({ type: "session.model.change", model: p.model });
|
|
62635
|
+
setPreset(outcome.name);
|
|
62636
|
+
agentStore.dispatch({
|
|
62637
|
+
type: "session.preset.change",
|
|
62638
|
+
preset: outcome.name
|
|
62639
|
+
});
|
|
62640
|
+
try {
|
|
62641
|
+
savePreset(outcome.name);
|
|
62642
|
+
} catch {
|
|
62643
|
+
}
|
|
62644
|
+
log.pushInfo(`preset: ${outcome.name} - ${p.model}`);
|
|
62645
|
+
}
|
|
62646
|
+
}
|
|
62473
62647
|
}
|
|
62474
|
-
|
|
62475
|
-
|
|
62648
|
+
) : pendingMcpHub ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62649
|
+
McpHub,
|
|
62650
|
+
{
|
|
62651
|
+
initialTab: pendingMcpHub.tab,
|
|
62652
|
+
liveServers: liveMcpServers,
|
|
62653
|
+
configPath: defaultConfigPath(),
|
|
62654
|
+
pickerPorts,
|
|
62655
|
+
onClose: () => setPendingMcpHub(null),
|
|
62656
|
+
postInfo: (text) => log.pushInfo(text),
|
|
62657
|
+
applyAppend: (target, addedTools) => {
|
|
62658
|
+
const updated = applyMcpAppend(loop2, target, addedTools);
|
|
62659
|
+
setLiveMcpServers((prev) => replaceMcpServerSummary(prev, target, updated));
|
|
62660
|
+
return updated;
|
|
62661
|
+
},
|
|
62662
|
+
reloadMcp: mcpRuntime ? async () => {
|
|
62663
|
+
const r = await mcpRuntime.reloadFromConfig(loop2);
|
|
62664
|
+
setLiveMcpServers(r.summaries);
|
|
62665
|
+
return r;
|
|
62666
|
+
} : void 0
|
|
62476
62667
|
}
|
|
62477
|
-
|
|
62478
|
-
|
|
62479
|
-
|
|
62480
|
-
|
|
62481
|
-
|
|
62482
|
-
|
|
62483
|
-
|
|
62484
|
-
|
|
62485
|
-
|
|
62486
|
-
|
|
62487
|
-
|
|
62488
|
-
|
|
62489
|
-
|
|
62490
|
-
|
|
62491
|
-
|
|
62492
|
-
|
|
62493
|
-
|
|
62494
|
-
|
|
62495
|
-
|
|
62496
|
-
|
|
62497
|
-
|
|
62498
|
-
|
|
62499
|
-
|
|
62500
|
-
|
|
62501
|
-
|
|
62502
|
-
|
|
62503
|
-
|
|
62504
|
-
const path = yanked.filePath;
|
|
62505
|
-
const info = yanked.osc52 ? t("copyMode.yankedToast", { size: yanked.size }) : t("copyMode.yankedToastFile", {
|
|
62506
|
-
size: yanked.size,
|
|
62507
|
-
path: path ?? "unknown"
|
|
62508
|
-
});
|
|
62509
|
-
log.pushInfo(info);
|
|
62668
|
+
) : pendingPlan ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62669
|
+
PlanConfirm,
|
|
62670
|
+
{
|
|
62671
|
+
plan: pendingPlan,
|
|
62672
|
+
steps: planStepsRef.current ?? void 0,
|
|
62673
|
+
summary: planSummaryRef.current ?? void 0,
|
|
62674
|
+
onChoose: stableHandlePlanConfirm,
|
|
62675
|
+
projectRoot: currentRootDir
|
|
62676
|
+
}
|
|
62677
|
+
) : pendingReviseEditor ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62678
|
+
PlanReviseEditor,
|
|
62679
|
+
{
|
|
62680
|
+
steps: planStepsRef.current ?? [],
|
|
62681
|
+
completedStepIds: completedStepIdsRef.current,
|
|
62682
|
+
onAccept: (revised, skippedIds) => {
|
|
62683
|
+
planStepsRef.current = revised;
|
|
62684
|
+
for (const id of skippedIds) completedStepIdsRef.current.add(id);
|
|
62685
|
+
persistPlanState();
|
|
62686
|
+
const planText = pendingReviseEditor;
|
|
62687
|
+
setPendingReviseEditor(null);
|
|
62688
|
+
setPendingPlan(planText);
|
|
62689
|
+
},
|
|
62690
|
+
onCancel: () => {
|
|
62691
|
+
const planText = pendingReviseEditor;
|
|
62692
|
+
setPendingReviseEditor(null);
|
|
62693
|
+
setPendingPlan(planText);
|
|
62694
|
+
}
|
|
62510
62695
|
}
|
|
62511
|
-
|
|
62512
|
-
|
|
62513
|
-
|
|
62514
|
-
|
|
62515
|
-
|
|
62516
|
-
|
|
62517
|
-
|
|
62518
|
-
|
|
62519
|
-
|
|
62520
|
-
|
|
62521
|
-
|
|
62522
|
-
|
|
62523
|
-
|
|
62524
|
-
|
|
62525
|
-
|
|
62526
|
-
|
|
62527
|
-
|
|
62528
|
-
|
|
62529
|
-
|
|
62530
|
-
|
|
62531
|
-
|
|
62532
|
-
|
|
62533
|
-
|
|
62534
|
-
|
|
62535
|
-
|
|
62696
|
+
) : pendingShell ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62697
|
+
ShellConfirm,
|
|
62698
|
+
{
|
|
62699
|
+
command: pendingShell.command,
|
|
62700
|
+
allowPrefix: derivePrefix(pendingShell.command),
|
|
62701
|
+
kind: pendingShell.kind,
|
|
62702
|
+
cwd: pendingShell.cwd,
|
|
62703
|
+
timeoutSec: pendingShell.timeoutSec,
|
|
62704
|
+
waitSec: pendingShell.waitSec,
|
|
62705
|
+
onChoose: handleShellConfirm
|
|
62706
|
+
}
|
|
62707
|
+
) : pendingPath ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62708
|
+
PathConfirm,
|
|
62709
|
+
{
|
|
62710
|
+
path: pendingPath.path,
|
|
62711
|
+
intent: pendingPath.intent,
|
|
62712
|
+
toolName: pendingPath.toolName,
|
|
62713
|
+
sandboxRoot: pendingPath.sandboxRoot,
|
|
62714
|
+
allowPrefix: pendingPath.allowPrefix,
|
|
62715
|
+
onChoose: handlePathConfirm
|
|
62716
|
+
}
|
|
62717
|
+
) : pendingEditReview ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62718
|
+
EditConfirm,
|
|
62719
|
+
{
|
|
62720
|
+
blocks: pendingEditReview,
|
|
62721
|
+
onChoose: (choice, denyContext) => {
|
|
62722
|
+
const resolve6 = editReviewResolveRef.current;
|
|
62723
|
+
if (resolve6) {
|
|
62724
|
+
editReviewResolveRef.current = null;
|
|
62725
|
+
resolve6({ choice, denyContext });
|
|
62536
62726
|
}
|
|
62537
62727
|
}
|
|
62538
|
-
log.pushInfo(`model: ${outcome.id}`);
|
|
62539
|
-
return;
|
|
62540
62728
|
}
|
|
62541
|
-
|
|
62542
|
-
|
|
62543
|
-
|
|
62544
|
-
|
|
62545
|
-
|
|
62546
|
-
|
|
62547
|
-
});
|
|
62548
|
-
agentStore.dispatch({ type: "session.model.change", model: p.model });
|
|
62549
|
-
setPreset(outcome.name);
|
|
62550
|
-
agentStore.dispatch({
|
|
62551
|
-
type: "session.preset.change",
|
|
62552
|
-
preset: outcome.name
|
|
62553
|
-
});
|
|
62554
|
-
try {
|
|
62555
|
-
savePreset(outcome.name);
|
|
62556
|
-
} catch {
|
|
62557
|
-
}
|
|
62558
|
-
log.pushInfo(`preset: ${outcome.name} - ${p.model}`);
|
|
62729
|
+
) : walkthroughActive && pendingEdits.current.length > 0 ? /* @__PURE__ */ import_react91.default.createElement(
|
|
62730
|
+
EditConfirm,
|
|
62731
|
+
{
|
|
62732
|
+
key: `walk-${pendingTick}`,
|
|
62733
|
+
block: pendingEdits.current[0],
|
|
62734
|
+
onChoose: handleWalkChoice
|
|
62559
62735
|
}
|
|
62560
|
-
|
|
62561
|
-
|
|
62562
|
-
|
|
62563
|
-
|
|
62564
|
-
|
|
62565
|
-
|
|
62566
|
-
|
|
62567
|
-
|
|
62568
|
-
|
|
62569
|
-
|
|
62570
|
-
|
|
62571
|
-
|
|
62572
|
-
|
|
62573
|
-
|
|
62574
|
-
|
|
62575
|
-
|
|
62576
|
-
|
|
62577
|
-
|
|
62578
|
-
|
|
62579
|
-
|
|
62580
|
-
|
|
62581
|
-
|
|
62582
|
-
|
|
62583
|
-
|
|
62584
|
-
|
|
62585
|
-
|
|
62586
|
-
|
|
62587
|
-
summary: planSummaryRef.current ?? void 0,
|
|
62588
|
-
onChoose: stableHandlePlanConfirm,
|
|
62589
|
-
projectRoot: currentRootDir
|
|
62590
|
-
}
|
|
62591
|
-
) : pendingReviseEditor ? /* @__PURE__ */ import_react90.default.createElement(
|
|
62592
|
-
PlanReviseEditor,
|
|
62593
|
-
{
|
|
62594
|
-
steps: planStepsRef.current ?? [],
|
|
62595
|
-
completedStepIds: completedStepIdsRef.current,
|
|
62596
|
-
onAccept: (revised, skippedIds) => {
|
|
62597
|
-
planStepsRef.current = revised;
|
|
62598
|
-
for (const id of skippedIds) completedStepIdsRef.current.add(id);
|
|
62599
|
-
persistPlanState();
|
|
62600
|
-
const planText = pendingReviseEditor;
|
|
62601
|
-
setPendingReviseEditor(null);
|
|
62602
|
-
setPendingPlan(planText);
|
|
62603
|
-
},
|
|
62604
|
-
onCancel: () => {
|
|
62605
|
-
const planText = pendingReviseEditor;
|
|
62606
|
-
setPendingReviseEditor(null);
|
|
62607
|
-
setPendingPlan(planText);
|
|
62608
|
-
}
|
|
62609
|
-
}
|
|
62610
|
-
) : pendingShell ? /* @__PURE__ */ import_react90.default.createElement(
|
|
62611
|
-
ShellConfirm,
|
|
62612
|
-
{
|
|
62613
|
-
command: pendingShell.command,
|
|
62614
|
-
allowPrefix: derivePrefix(pendingShell.command),
|
|
62615
|
-
kind: pendingShell.kind,
|
|
62616
|
-
cwd: pendingShell.cwd,
|
|
62617
|
-
timeoutSec: pendingShell.timeoutSec,
|
|
62618
|
-
waitSec: pendingShell.waitSec,
|
|
62619
|
-
onChoose: handleShellConfirm
|
|
62620
|
-
}
|
|
62621
|
-
) : pendingPath ? /* @__PURE__ */ import_react90.default.createElement(
|
|
62622
|
-
PathConfirm,
|
|
62623
|
-
{
|
|
62624
|
-
path: pendingPath.path,
|
|
62625
|
-
intent: pendingPath.intent,
|
|
62626
|
-
toolName: pendingPath.toolName,
|
|
62627
|
-
sandboxRoot: pendingPath.sandboxRoot,
|
|
62628
|
-
allowPrefix: pendingPath.allowPrefix,
|
|
62629
|
-
onChoose: handlePathConfirm
|
|
62630
|
-
}
|
|
62631
|
-
) : pendingEditReview ? /* @__PURE__ */ import_react90.default.createElement(
|
|
62632
|
-
EditConfirm,
|
|
62633
|
-
{
|
|
62634
|
-
blocks: pendingEditReview,
|
|
62635
|
-
onChoose: (choice, denyContext) => {
|
|
62636
|
-
const resolve6 = editReviewResolveRef.current;
|
|
62637
|
-
if (resolve6) {
|
|
62638
|
-
editReviewResolveRef.current = null;
|
|
62639
|
-
resolve6({ choice, denyContext });
|
|
62736
|
+
) : /* @__PURE__ */ import_react91.default.createElement(
|
|
62737
|
+
ComposerArea,
|
|
62738
|
+
{
|
|
62739
|
+
editMode,
|
|
62740
|
+
pendingCount,
|
|
62741
|
+
modeFlash,
|
|
62742
|
+
planMode,
|
|
62743
|
+
jobs: codeMode ? codeMode.jobs : void 0,
|
|
62744
|
+
activeLoop,
|
|
62745
|
+
statusBar,
|
|
62746
|
+
input,
|
|
62747
|
+
setInput,
|
|
62748
|
+
busy,
|
|
62749
|
+
onSubmit: handleSubmit,
|
|
62750
|
+
onHistoryPrev: handleHistoryPrev,
|
|
62751
|
+
onHistoryNext: handleHistoryNext,
|
|
62752
|
+
onOpenExternalEditor: handleOpenExternalEditor,
|
|
62753
|
+
onCursorChange: setComposerCursor,
|
|
62754
|
+
slashMatches,
|
|
62755
|
+
slashSelected,
|
|
62756
|
+
slashGroupMode,
|
|
62757
|
+
slashAdvancedHidden,
|
|
62758
|
+
atState,
|
|
62759
|
+
atSelected,
|
|
62760
|
+
slashArgContext,
|
|
62761
|
+
slashArgMatches,
|
|
62762
|
+
slashArgSelected
|
|
62640
62763
|
}
|
|
62641
|
-
|
|
62642
|
-
}
|
|
62643
|
-
) : walkthroughActive && pendingEdits.current.length > 0 ? /* @__PURE__ */ import_react90.default.createElement(
|
|
62644
|
-
EditConfirm,
|
|
62645
|
-
{
|
|
62646
|
-
key: `walk-${pendingTick}`,
|
|
62647
|
-
block: pendingEdits.current[0],
|
|
62648
|
-
onChoose: handleWalkChoice
|
|
62649
|
-
}
|
|
62650
|
-
) : /* @__PURE__ */ import_react90.default.createElement(
|
|
62651
|
-
ComposerArea,
|
|
62652
|
-
{
|
|
62653
|
-
editMode,
|
|
62654
|
-
pendingCount,
|
|
62655
|
-
modeFlash,
|
|
62656
|
-
planMode,
|
|
62657
|
-
jobs: codeMode ? codeMode.jobs : void 0,
|
|
62658
|
-
activeLoop,
|
|
62659
|
-
statusBar,
|
|
62660
|
-
input,
|
|
62661
|
-
setInput,
|
|
62662
|
-
busy,
|
|
62663
|
-
onSubmit: handleSubmit,
|
|
62664
|
-
onHistoryPrev: handleHistoryPrev,
|
|
62665
|
-
onHistoryNext: handleHistoryNext,
|
|
62666
|
-
onOpenExternalEditor: handleOpenExternalEditor,
|
|
62667
|
-
onCursorChange: setComposerCursor,
|
|
62668
|
-
slashMatches,
|
|
62669
|
-
slashSelected,
|
|
62670
|
-
slashGroupMode,
|
|
62671
|
-
slashAdvancedHidden,
|
|
62672
|
-
atState,
|
|
62673
|
-
atSelected,
|
|
62674
|
-
slashArgContext,
|
|
62675
|
-
slashArgMatches,
|
|
62676
|
-
slashArgSelected
|
|
62764
|
+
)
|
|
62677
62765
|
}
|
|
62678
|
-
)))))
|
|
62766
|
+
)))));
|
|
62679
62767
|
}
|
|
62680
62768
|
|
|
62681
62769
|
// src/cli/ui/Setup.tsx
|
|
62682
|
-
var
|
|
62770
|
+
var import_react93 = __toESM(require_react(), 1);
|
|
62683
62771
|
|
|
62684
62772
|
// src/cli/ui/MaskedInput.tsx
|
|
62685
|
-
var
|
|
62773
|
+
var import_react92 = __toESM(require_react(), 1);
|
|
62686
62774
|
function stripPasteMarkers(s) {
|
|
62687
62775
|
return s.replace(/\u001b?\[20[01]~/g, "").replace(/\u001b/g, "");
|
|
62688
62776
|
}
|
|
@@ -62693,7 +62781,7 @@ function MaskedInput({
|
|
|
62693
62781
|
mask = "\u2022",
|
|
62694
62782
|
placeholder = ""
|
|
62695
62783
|
}) {
|
|
62696
|
-
const valueRef = (0,
|
|
62784
|
+
const valueRef = (0, import_react92.useRef)(value);
|
|
62697
62785
|
valueRef.current = value;
|
|
62698
62786
|
useKeystroke((ev) => {
|
|
62699
62787
|
if (ev.return) {
|
|
@@ -62717,17 +62805,17 @@ function MaskedInput({
|
|
|
62717
62805
|
});
|
|
62718
62806
|
if (value.length === 0) {
|
|
62719
62807
|
if (placeholder.length === 0) {
|
|
62720
|
-
return /* @__PURE__ */
|
|
62808
|
+
return /* @__PURE__ */ import_react92.default.createElement(Text, { inverse: true }, " ");
|
|
62721
62809
|
}
|
|
62722
|
-
return /* @__PURE__ */
|
|
62810
|
+
return /* @__PURE__ */ import_react92.default.createElement(import_react92.default.Fragment, null, /* @__PURE__ */ import_react92.default.createElement(Text, { inverse: true }, placeholder[0]), /* @__PURE__ */ import_react92.default.createElement(Text, { color: FG.faint }, placeholder.slice(1)));
|
|
62723
62811
|
}
|
|
62724
|
-
return /* @__PURE__ */
|
|
62812
|
+
return /* @__PURE__ */ import_react92.default.createElement(import_react92.default.Fragment, null, /* @__PURE__ */ import_react92.default.createElement(Text, null, mask.repeat(value.length)), /* @__PURE__ */ import_react92.default.createElement(Text, { inverse: true }, " "));
|
|
62725
62813
|
}
|
|
62726
62814
|
|
|
62727
62815
|
// src/cli/ui/Setup.tsx
|
|
62728
62816
|
function Setup({ onReady }) {
|
|
62729
|
-
const [value, setValue] = (0,
|
|
62730
|
-
const [error, setError] = (0,
|
|
62817
|
+
const [value, setValue] = (0, import_react93.useState)("");
|
|
62818
|
+
const [error, setError] = (0, import_react93.useState)(null);
|
|
62731
62819
|
const { exit: exit2 } = use_app_default();
|
|
62732
62820
|
const handleSubmit = (raw) => {
|
|
62733
62821
|
const trimmed = raw.trim();
|
|
@@ -62748,7 +62836,7 @@ function Setup({ onReady }) {
|
|
|
62748
62836
|
}
|
|
62749
62837
|
onReady(trimmed);
|
|
62750
62838
|
};
|
|
62751
|
-
return /* @__PURE__ */
|
|
62839
|
+
return /* @__PURE__ */ import_react93.default.createElement(Box_default, { flexDirection: "column", paddingX: 1, marginY: 1 }, /* @__PURE__ */ import_react93.default.createElement(Box_default, null, /* @__PURE__ */ import_react93.default.createElement(Text, { bold: true, color: GRADIENT[0] }, GLYPH.brand), /* @__PURE__ */ import_react93.default.createElement(Text, null, " "), /* @__PURE__ */ import_react93.default.createElement(Text, { bold: true }, t("wizard.welcomeTitle"))), /* @__PURE__ */ import_react93.default.createElement(Box_default, { marginTop: 1 }, /* @__PURE__ */ import_react93.default.createElement(Text, { color: COLOR.info }, t("wizard.apiKeyPrompt"))), /* @__PURE__ */ import_react93.default.createElement(Box_default, null, /* @__PURE__ */ import_react93.default.createElement(Text, { dimColor: true }, ` ${t("wizard.apiKeyGetOne")}`)), /* @__PURE__ */ import_react93.default.createElement(Box_default, null, /* @__PURE__ */ import_react93.default.createElement(Text, { dimColor: true }, t("wizard.apiKeySavedLocally", { path: defaultConfigPath() }))), /* @__PURE__ */ import_react93.default.createElement(Box_default, { marginTop: 1 }, /* @__PURE__ */ import_react93.default.createElement(Text, { bold: true, color: COLOR.brand }, GLYPH.bar), /* @__PURE__ */ import_react93.default.createElement(Text, { bold: true, color: COLOR.primary }, " \u203A "), /* @__PURE__ */ import_react93.default.createElement(
|
|
62752
62840
|
MaskedInput,
|
|
62753
62841
|
{
|
|
62754
62842
|
value,
|
|
@@ -62757,7 +62845,7 @@ function Setup({ onReady }) {
|
|
|
62757
62845
|
mask: "\u2022",
|
|
62758
62846
|
placeholder: t("wizard.apiKeyPlaceholder")
|
|
62759
62847
|
}
|
|
62760
|
-
)), error ? /* @__PURE__ */
|
|
62848
|
+
)), error ? /* @__PURE__ */ import_react93.default.createElement(Box_default, { marginTop: 1 }, /* @__PURE__ */ import_react93.default.createElement(Text, { color: COLOR.err, bold: true }, GLYPH.err), /* @__PURE__ */ import_react93.default.createElement(Text, { color: COLOR.err }, ` ${error}`)) : value ? /* @__PURE__ */ import_react93.default.createElement(Box_default, { marginTop: 1 }, /* @__PURE__ */ import_react93.default.createElement(Text, { dimColor: true }, t("wizard.apiKeyPreview", { redacted: redactKey(value) }))) : null, /* @__PURE__ */ import_react93.default.createElement(Box_default, { marginTop: 1 }, /* @__PURE__ */ import_react93.default.createElement(Text, { dimColor: true }, t("wizard.exitHint"))));
|
|
62761
62849
|
}
|
|
62762
62850
|
|
|
62763
62851
|
// src/cli/ui/drain-tty.ts
|
|
@@ -62833,17 +62921,18 @@ function Root({
|
|
|
62833
62921
|
showPicker,
|
|
62834
62922
|
mcpRuntime,
|
|
62835
62923
|
startupInfoHints,
|
|
62924
|
+
startupUpdateCheck,
|
|
62836
62925
|
...appProps
|
|
62837
62926
|
}) {
|
|
62838
|
-
const [key, setKey] = (0,
|
|
62839
|
-
const [pickerOpen, setPickerOpen] = (0,
|
|
62840
|
-
const [activeSession, setActiveSession] = (0,
|
|
62841
|
-
const [activeRoot, setActiveRoot] = (0,
|
|
62927
|
+
const [key, setKey] = (0, import_react94.useState)(initialKey);
|
|
62928
|
+
const [pickerOpen, setPickerOpen] = (0, import_react94.useState)(showPicker);
|
|
62929
|
+
const [activeSession, setActiveSession] = (0, import_react94.useState)(appProps.session);
|
|
62930
|
+
const [activeRoot, setActiveRoot] = (0, import_react94.useState)(
|
|
62842
62931
|
() => appProps.codeMode?.rootDir ?? process.cwd()
|
|
62843
62932
|
);
|
|
62844
62933
|
const workspaceRoot = activeRoot;
|
|
62845
|
-
const [sessions2, setSessions] = (0,
|
|
62846
|
-
const codeMode = (0,
|
|
62934
|
+
const [sessions2, setSessions] = (0, import_react94.useState)(() => listSessionsForWorkspace(workspaceRoot));
|
|
62935
|
+
const codeMode = (0, import_react94.useMemo)(() => {
|
|
62847
62936
|
if (!appProps.codeMode) return void 0;
|
|
62848
62937
|
return {
|
|
62849
62938
|
...appProps.codeMode,
|
|
@@ -62856,7 +62945,7 @@ function Root({
|
|
|
62856
62945
|
};
|
|
62857
62946
|
}, [appProps.codeMode, activeRoot]);
|
|
62858
62947
|
if (!key) {
|
|
62859
|
-
return /* @__PURE__ */
|
|
62948
|
+
return /* @__PURE__ */ import_react94.default.createElement(KeystrokeProvider, null, /* @__PURE__ */ import_react94.default.createElement(
|
|
62860
62949
|
Setup,
|
|
62861
62950
|
{
|
|
62862
62951
|
onReady: (k) => {
|
|
@@ -62868,7 +62957,7 @@ function Root({
|
|
|
62868
62957
|
}
|
|
62869
62958
|
process.env.DEEPSEEK_API_KEY = key;
|
|
62870
62959
|
if (pickerOpen) {
|
|
62871
|
-
return /* @__PURE__ */
|
|
62960
|
+
return /* @__PURE__ */ import_react94.default.createElement(KeystrokeProvider, null, /* @__PURE__ */ import_react94.default.createElement(
|
|
62872
62961
|
SessionPicker,
|
|
62873
62962
|
{
|
|
62874
62963
|
sessions: sessions2,
|
|
@@ -62904,7 +62993,7 @@ function Root({
|
|
|
62904
62993
|
}
|
|
62905
62994
|
));
|
|
62906
62995
|
}
|
|
62907
|
-
return /* @__PURE__ */
|
|
62996
|
+
return /* @__PURE__ */ import_react94.default.createElement(KeystrokeProvider, null, /* @__PURE__ */ import_react94.default.createElement(
|
|
62908
62997
|
App,
|
|
62909
62998
|
{
|
|
62910
62999
|
key: activeSession ?? "__new__",
|
|
@@ -62920,6 +63009,7 @@ function Root({
|
|
|
62920
63009
|
mcpRuntime,
|
|
62921
63010
|
progressSink,
|
|
62922
63011
|
startupInfoHints,
|
|
63012
|
+
startupUpdateCheck,
|
|
62923
63013
|
codeMode,
|
|
62924
63014
|
noDashboard: appProps.noDashboard,
|
|
62925
63015
|
openDashboard: appProps.openDashboard,
|
|
@@ -62952,6 +63042,7 @@ async function chatCommand(opts) {
|
|
|
62952
63042
|
const mcpServers = [];
|
|
62953
63043
|
const cfg = readConfig();
|
|
62954
63044
|
const startupInfoHints = [];
|
|
63045
|
+
const startupUpdateCheck = createStartupUpdateCheck(cfg);
|
|
62955
63046
|
if (searchEnabled()) {
|
|
62956
63047
|
if (!tools) tools = new ToolRegistry();
|
|
62957
63048
|
registerWebTools(tools, {
|
|
@@ -63000,7 +63091,7 @@ async function chatCommand(opts) {
|
|
|
63000
63091
|
}
|
|
63001
63092
|
process.stdout.setMaxListeners(200);
|
|
63002
63093
|
const { waitUntilExit } = render_default(
|
|
63003
|
-
/* @__PURE__ */
|
|
63094
|
+
/* @__PURE__ */ import_react94.default.createElement(
|
|
63004
63095
|
Root,
|
|
63005
63096
|
{
|
|
63006
63097
|
initialKey,
|
|
@@ -63010,6 +63101,7 @@ async function chatCommand(opts) {
|
|
|
63010
63101
|
mcpRuntime: runtime,
|
|
63011
63102
|
progressSink,
|
|
63012
63103
|
startupInfoHints,
|
|
63104
|
+
startupUpdateCheck,
|
|
63013
63105
|
showPicker,
|
|
63014
63106
|
...opts,
|
|
63015
63107
|
session: resolvedSession,
|
|
@@ -63032,4 +63124,4 @@ async function chatCommand(opts) {
|
|
|
63032
63124
|
export {
|
|
63033
63125
|
chatCommand
|
|
63034
63126
|
};
|
|
63035
|
-
//# sourceMappingURL=chunk-
|
|
63127
|
+
//# sourceMappingURL=chunk-HWYTH42F.js.map
|