flavor-code 1.4.4-beta.2 → 1.4.5-beta.2
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/README.md +43 -3
- package/README.zh-CN.md +43 -3
- package/dist/agent/expert-agents.d.ts +35 -0
- package/dist/agent/expert-generator.d.ts +14 -0
- package/dist/agent/expert-templates.d.ts +26 -0
- package/dist/agent/planner.d.ts +2 -0
- package/dist/{app-C5I2TH7I.js → app-LJV3GEXU.js} +805 -398
- package/dist/{chunk-IKGT4MDT.js → chunk-4GKKXT5V.js} +1 -0
- package/dist/{chunk-Y7EH4NVO.js → chunk-55YUJKT4.js} +1 -1
- package/dist/{chunk-X6U6BO5D.js → chunk-CI6IHATI.js} +7 -3
- package/dist/{chunk-U4XTQ5PU.js → chunk-G3LKW5SY.js} +4536 -3367
- package/dist/{chunk-5BDKRA6U.js → chunk-MVBRIM53.js} +1 -1
- package/dist/{chunk-36IDJRLQ.js → chunk-SAAIDKTM.js} +46 -9
- package/dist/{chunk-JQM2L2YM.js → chunk-SW7VZDFS.js} +1 -1
- package/dist/{chunk-ONRY3C2L.js → chunk-TZ7PI4NZ.js} +1 -1
- package/dist/{claude-ink-F554I3GJ.js → claude-ink-5X2DRKN6.js} +1 -1
- package/dist/{cli-V3BLZ5UW.js → cli-4NWD3ZN3.js} +66 -14
- package/dist/cli-main.js +19 -19
- package/dist/desktop/main.js +9336 -8125
- package/dist/desktop-renderer/assets/{index-CjC0Ibiq.js → index-CBjfgCRz.js} +3 -3
- package/dist/desktop-renderer/assets/{interactive-terminal-IjIT3Xoa.js → interactive-terminal-x8YYSqF6.js} +1 -1
- package/dist/desktop-renderer/index.html +1 -1
- package/dist/{doctor-SEL32R7M.js → doctor-77UMJ6TK.js} +3 -3
- package/dist/evolution/preferences.d.ts +52 -0
- package/dist/evolve/loader.d.ts +2 -0
- package/dist/evolve/service.d.ts +6 -3
- package/dist/evolve/store.d.ts +55 -2
- package/dist/evolve/verification.d.ts +30 -0
- package/dist/harness/local.d.ts +4 -2
- package/dist/{load-RHWXNUCS.js → load-JINXGR3N.js} +2 -2
- package/dist/{manager-IYBNNKUP.js → manager-UTQT466W.js} +2 -2
- package/dist/memory/coordinator.d.ts +1 -1
- package/dist/memory/review.d.ts +13 -0
- package/dist/memory/store.d.ts +1 -0
- package/dist/memory/types.d.ts +2 -0
- package/dist/{production-TD7UWWXW.js → production-J7ZWR7VL.js} +6 -6
- package/dist/sdk/index.js +6 -6
- package/dist/session/store.d.ts +1 -0
- package/dist/{store-MZZERW7K.js → store-Y4V5TLXE.js} +2 -2
- package/dist/ui/commands.d.ts +21 -2
- package/dist/ui/session.d.ts +8 -0
- package/package.json +1 -1
- package//346/212/200/346/234/257/346/226/271/346/241/210/346/212/245/345/221/212.md +97 -6
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
Text,
|
|
12
12
|
instances_default,
|
|
13
13
|
osc,
|
|
14
|
+
require_compiler_runtime,
|
|
14
15
|
require_jsx_runtime,
|
|
15
16
|
shiftAnchor,
|
|
16
17
|
stringWidth,
|
|
@@ -18,13 +19,13 @@ import {
|
|
|
18
19
|
useStdout,
|
|
19
20
|
use_app_default,
|
|
20
21
|
use_input_default
|
|
21
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-4GKKXT5V.js";
|
|
22
23
|
import {
|
|
23
24
|
require_react
|
|
24
25
|
} from "./chunk-PULWAH6E.js";
|
|
25
26
|
import {
|
|
26
27
|
statusPresentation
|
|
27
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-55YUJKT4.js";
|
|
28
29
|
import {
|
|
29
30
|
source_default
|
|
30
31
|
} from "./chunk-AA4QNKTF.js";
|
|
@@ -34,12 +35,12 @@ import {
|
|
|
34
35
|
createGlobTool,
|
|
35
36
|
createProductionRuntime,
|
|
36
37
|
isDestructiveTool
|
|
37
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-G3LKW5SY.js";
|
|
38
39
|
import {
|
|
39
40
|
getGraphemeSegmenter
|
|
40
41
|
} from "./chunk-TIEOVQW6.js";
|
|
41
42
|
import "./chunk-OKHV7CTB.js";
|
|
42
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-SW7VZDFS.js";
|
|
43
44
|
import {
|
|
44
45
|
execFileNoThrow
|
|
45
46
|
} from "./chunk-IU3UBETC.js";
|
|
@@ -54,7 +55,7 @@ import {
|
|
|
54
55
|
import "./chunk-CVP5OUHD.js";
|
|
55
56
|
import "./chunk-3563SW4X.js";
|
|
56
57
|
import "./chunk-RBAZLFKB.js";
|
|
57
|
-
import "./chunk-
|
|
58
|
+
import "./chunk-SAAIDKTM.js";
|
|
58
59
|
import {
|
|
59
60
|
redactErrorText
|
|
60
61
|
} from "./chunk-WLZUAVVU.js";
|
|
@@ -63,7 +64,7 @@ import {
|
|
|
63
64
|
} from "./chunk-RV3EXUXM.js";
|
|
64
65
|
import "./chunk-IQEEFDEE.js";
|
|
65
66
|
import "./chunk-GTFP2R5I.js";
|
|
66
|
-
import "./chunk-
|
|
67
|
+
import "./chunk-MVBRIM53.js";
|
|
67
68
|
import {
|
|
68
69
|
charWidth,
|
|
69
70
|
createTranscriptState,
|
|
@@ -71,11 +72,11 @@ import {
|
|
|
71
72
|
thinkingWindow,
|
|
72
73
|
transcriptReducer,
|
|
73
74
|
withTimeout
|
|
74
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-CI6IHATI.js";
|
|
75
76
|
import {
|
|
76
77
|
message
|
|
77
78
|
} from "./chunk-BDX777JR.js";
|
|
78
|
-
import "./chunk-
|
|
79
|
+
import "./chunk-TZ7PI4NZ.js";
|
|
79
80
|
import "./chunk-EWD7FWTH.js";
|
|
80
81
|
import "./chunk-KRWWCVXA.js";
|
|
81
82
|
import "./chunk-X442CJJH.js";
|
|
@@ -213,6 +214,336 @@ var import_react6 = __toESM(require_react(), 1);
|
|
|
213
214
|
// src/ui/markdown.tsx
|
|
214
215
|
var import_react5 = __toESM(require_react(), 1);
|
|
215
216
|
|
|
217
|
+
// src/claude-ink/components/Link.tsx
|
|
218
|
+
var import_compiler_runtime = __toESM(require_compiler_runtime(), 1);
|
|
219
|
+
|
|
220
|
+
// node_modules/supports-hyperlinks/index.js
|
|
221
|
+
import process4 from "process";
|
|
222
|
+
|
|
223
|
+
// node_modules/supports-color/index.js
|
|
224
|
+
import process2 from "process";
|
|
225
|
+
import os from "os";
|
|
226
|
+
import tty from "tty";
|
|
227
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
|
|
228
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
229
|
+
const position = argv.indexOf(prefix + flag);
|
|
230
|
+
const terminatorPosition = argv.indexOf("--");
|
|
231
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
232
|
+
}
|
|
233
|
+
var { env } = process2;
|
|
234
|
+
var flagForceColor;
|
|
235
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
236
|
+
flagForceColor = 0;
|
|
237
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
238
|
+
flagForceColor = 1;
|
|
239
|
+
}
|
|
240
|
+
function envForceColor() {
|
|
241
|
+
if (!("FORCE_COLOR" in env)) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
if (env.FORCE_COLOR === "true") {
|
|
245
|
+
return 1;
|
|
246
|
+
}
|
|
247
|
+
if (env.FORCE_COLOR === "false") {
|
|
248
|
+
return 0;
|
|
249
|
+
}
|
|
250
|
+
if (env.FORCE_COLOR.length === 0) {
|
|
251
|
+
return 1;
|
|
252
|
+
}
|
|
253
|
+
const level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
254
|
+
if (![0, 1, 2, 3].includes(level)) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
return level;
|
|
258
|
+
}
|
|
259
|
+
function translateLevel(level) {
|
|
260
|
+
if (level === 0) {
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
return {
|
|
264
|
+
level,
|
|
265
|
+
hasBasic: true,
|
|
266
|
+
has256: level >= 2,
|
|
267
|
+
has16m: level >= 3
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
271
|
+
const noFlagForceColor = envForceColor();
|
|
272
|
+
if (noFlagForceColor !== void 0) {
|
|
273
|
+
flagForceColor = noFlagForceColor;
|
|
274
|
+
}
|
|
275
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
276
|
+
if (forceColor === 0) {
|
|
277
|
+
return 0;
|
|
278
|
+
}
|
|
279
|
+
if (sniffFlags) {
|
|
280
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
281
|
+
return 3;
|
|
282
|
+
}
|
|
283
|
+
if (hasFlag("color=256")) {
|
|
284
|
+
return 2;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
288
|
+
return 1;
|
|
289
|
+
}
|
|
290
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
291
|
+
return 0;
|
|
292
|
+
}
|
|
293
|
+
const min = forceColor || 0;
|
|
294
|
+
if (env.TERM === "dumb") {
|
|
295
|
+
return min;
|
|
296
|
+
}
|
|
297
|
+
if (process2.platform === "win32") {
|
|
298
|
+
const osRelease = os.release().split(".");
|
|
299
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
300
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
301
|
+
}
|
|
302
|
+
return 1;
|
|
303
|
+
}
|
|
304
|
+
if ("CI" in env) {
|
|
305
|
+
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {
|
|
306
|
+
return 3;
|
|
307
|
+
}
|
|
308
|
+
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
309
|
+
return 1;
|
|
310
|
+
}
|
|
311
|
+
return min;
|
|
312
|
+
}
|
|
313
|
+
if ("TEAMCITY_VERSION" in env) {
|
|
314
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
315
|
+
}
|
|
316
|
+
if (env.COLORTERM === "truecolor") {
|
|
317
|
+
return 3;
|
|
318
|
+
}
|
|
319
|
+
if (env.TERM === "xterm-kitty") {
|
|
320
|
+
return 3;
|
|
321
|
+
}
|
|
322
|
+
if (env.TERM === "xterm-ghostty") {
|
|
323
|
+
return 3;
|
|
324
|
+
}
|
|
325
|
+
if (env.TERM === "wezterm") {
|
|
326
|
+
return 3;
|
|
327
|
+
}
|
|
328
|
+
if ("TERM_PROGRAM" in env) {
|
|
329
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
330
|
+
switch (env.TERM_PROGRAM) {
|
|
331
|
+
case "iTerm.app": {
|
|
332
|
+
return version >= 3 ? 3 : 2;
|
|
333
|
+
}
|
|
334
|
+
case "Apple_Terminal": {
|
|
335
|
+
return 2;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
340
|
+
return 2;
|
|
341
|
+
}
|
|
342
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
343
|
+
return 1;
|
|
344
|
+
}
|
|
345
|
+
if ("COLORTERM" in env) {
|
|
346
|
+
return 1;
|
|
347
|
+
}
|
|
348
|
+
return min;
|
|
349
|
+
}
|
|
350
|
+
function createSupportsColor(stream, options = {}) {
|
|
351
|
+
const level = _supportsColor(stream, {
|
|
352
|
+
streamIsTTY: stream && stream.isTTY,
|
|
353
|
+
...options
|
|
354
|
+
});
|
|
355
|
+
return translateLevel(level);
|
|
356
|
+
}
|
|
357
|
+
var supportsColor = {
|
|
358
|
+
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
359
|
+
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
// node_modules/has-flag/index.js
|
|
363
|
+
import process3 from "process";
|
|
364
|
+
function hasFlag2(flag, argv = process3.argv) {
|
|
365
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
366
|
+
const position = argv.indexOf(prefix + flag);
|
|
367
|
+
const terminatorPosition = argv.indexOf("--");
|
|
368
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// node_modules/supports-hyperlinks/index.js
|
|
372
|
+
function parseVersion(versionString = "") {
|
|
373
|
+
if (/^\d{3,4}$/.test(versionString)) {
|
|
374
|
+
const match = /(\d{1,2})(\d{2})/.exec(versionString) ?? [];
|
|
375
|
+
return {
|
|
376
|
+
major: 0,
|
|
377
|
+
minor: Number.parseInt(match[1], 10),
|
|
378
|
+
patch: Number.parseInt(match[2], 10)
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
const versions = (versionString ?? "").split(".").map((n) => Number.parseInt(n, 10));
|
|
382
|
+
return {
|
|
383
|
+
major: versions[0],
|
|
384
|
+
minor: versions[1],
|
|
385
|
+
patch: versions[2]
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
function createSupportsHyperlinks(stream) {
|
|
389
|
+
const {
|
|
390
|
+
CI,
|
|
391
|
+
CURSOR_TRACE_ID,
|
|
392
|
+
FORCE_HYPERLINK,
|
|
393
|
+
NETLIFY,
|
|
394
|
+
TEAMCITY_VERSION,
|
|
395
|
+
TERM_PROGRAM,
|
|
396
|
+
TERM_PROGRAM_VERSION,
|
|
397
|
+
VTE_VERSION,
|
|
398
|
+
TERM
|
|
399
|
+
} = process4.env;
|
|
400
|
+
if (FORCE_HYPERLINK) {
|
|
401
|
+
return !(FORCE_HYPERLINK.length > 0 && Number.parseInt(FORCE_HYPERLINK, 10) === 0);
|
|
402
|
+
}
|
|
403
|
+
if (hasFlag2("no-hyperlink") || hasFlag2("no-hyperlinks") || hasFlag2("hyperlink=false") || hasFlag2("hyperlink=never")) {
|
|
404
|
+
return false;
|
|
405
|
+
}
|
|
406
|
+
if (hasFlag2("hyperlink=true") || hasFlag2("hyperlink=always")) {
|
|
407
|
+
return true;
|
|
408
|
+
}
|
|
409
|
+
if (NETLIFY) {
|
|
410
|
+
return true;
|
|
411
|
+
}
|
|
412
|
+
if (!createSupportsColor(stream)) {
|
|
413
|
+
return false;
|
|
414
|
+
}
|
|
415
|
+
if (stream && !stream.isTTY) {
|
|
416
|
+
return false;
|
|
417
|
+
}
|
|
418
|
+
if ("WT_SESSION" in process4.env) {
|
|
419
|
+
return true;
|
|
420
|
+
}
|
|
421
|
+
if (process4.platform === "win32") {
|
|
422
|
+
return false;
|
|
423
|
+
}
|
|
424
|
+
if (CI) {
|
|
425
|
+
return false;
|
|
426
|
+
}
|
|
427
|
+
if (TEAMCITY_VERSION) {
|
|
428
|
+
return false;
|
|
429
|
+
}
|
|
430
|
+
if (TERM_PROGRAM) {
|
|
431
|
+
const version = parseVersion(TERM_PROGRAM_VERSION);
|
|
432
|
+
switch (TERM_PROGRAM) {
|
|
433
|
+
case "iTerm.app": {
|
|
434
|
+
if (version.major === 3) {
|
|
435
|
+
return version.minor >= 1;
|
|
436
|
+
}
|
|
437
|
+
return version.major > 3;
|
|
438
|
+
}
|
|
439
|
+
case "WezTerm": {
|
|
440
|
+
if (/^0-unstable-\d{4}-\d{2}-\d{2}$/.test(TERM_PROGRAM_VERSION)) {
|
|
441
|
+
const date = TERM_PROGRAM_VERSION.slice("0-unstable-".length);
|
|
442
|
+
return date >= "2020-06-20";
|
|
443
|
+
}
|
|
444
|
+
return version.major >= 20200620;
|
|
445
|
+
}
|
|
446
|
+
case "vscode": {
|
|
447
|
+
if (CURSOR_TRACE_ID) {
|
|
448
|
+
return true;
|
|
449
|
+
}
|
|
450
|
+
return version.major > 1 || version.major === 1 && version.minor >= 72;
|
|
451
|
+
}
|
|
452
|
+
case "ghostty": {
|
|
453
|
+
return true;
|
|
454
|
+
}
|
|
455
|
+
case "zed": {
|
|
456
|
+
return true;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
if (VTE_VERSION) {
|
|
461
|
+
if (VTE_VERSION === "0.50.0") {
|
|
462
|
+
return false;
|
|
463
|
+
}
|
|
464
|
+
const version = parseVersion(VTE_VERSION);
|
|
465
|
+
return version.major > 0 || version.minor >= 50;
|
|
466
|
+
}
|
|
467
|
+
switch (TERM) {
|
|
468
|
+
case "alacritty": {
|
|
469
|
+
return true;
|
|
470
|
+
}
|
|
471
|
+
case "xterm-kitty": {
|
|
472
|
+
return true;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
return false;
|
|
476
|
+
}
|
|
477
|
+
var supportsHyperlinks = {
|
|
478
|
+
stdout: createSupportsHyperlinks(process4.stdout),
|
|
479
|
+
stderr: createSupportsHyperlinks(process4.stderr)
|
|
480
|
+
};
|
|
481
|
+
var supports_hyperlinks_default = supportsHyperlinks;
|
|
482
|
+
|
|
483
|
+
// src/claude-ink/supports-hyperlinks.ts
|
|
484
|
+
var ADDITIONAL_HYPERLINK_TERMINALS = [
|
|
485
|
+
"ghostty",
|
|
486
|
+
"Hyper",
|
|
487
|
+
"kitty",
|
|
488
|
+
"alacritty",
|
|
489
|
+
"iTerm.app",
|
|
490
|
+
"iTerm2"
|
|
491
|
+
];
|
|
492
|
+
function supportsHyperlinks2(options) {
|
|
493
|
+
const stdoutSupported = options?.stdoutSupported ?? supports_hyperlinks_default.stdout;
|
|
494
|
+
if (stdoutSupported) {
|
|
495
|
+
return true;
|
|
496
|
+
}
|
|
497
|
+
const env2 = options?.env ?? process.env;
|
|
498
|
+
const termProgram = env2["TERM_PROGRAM"];
|
|
499
|
+
if (termProgram && ADDITIONAL_HYPERLINK_TERMINALS.includes(termProgram)) {
|
|
500
|
+
return true;
|
|
501
|
+
}
|
|
502
|
+
const lcTerminal = env2["LC_TERMINAL"];
|
|
503
|
+
if (lcTerminal && ADDITIONAL_HYPERLINK_TERMINALS.includes(lcTerminal)) {
|
|
504
|
+
return true;
|
|
505
|
+
}
|
|
506
|
+
const term = env2["TERM"];
|
|
507
|
+
if (term?.includes("kitty")) {
|
|
508
|
+
return true;
|
|
509
|
+
}
|
|
510
|
+
return false;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
// src/claude-ink/components/Link.tsx
|
|
514
|
+
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
|
515
|
+
function Link(t0) {
|
|
516
|
+
const $ = (0, import_compiler_runtime.c)(5);
|
|
517
|
+
const {
|
|
518
|
+
children,
|
|
519
|
+
url,
|
|
520
|
+
fallback
|
|
521
|
+
} = t0;
|
|
522
|
+
const content = children ?? url;
|
|
523
|
+
if (supportsHyperlinks2()) {
|
|
524
|
+
let t12;
|
|
525
|
+
if ($[0] !== content || $[1] !== url) {
|
|
526
|
+
t12 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ink-link", { href: url, children: content }) });
|
|
527
|
+
$[0] = content;
|
|
528
|
+
$[1] = url;
|
|
529
|
+
$[2] = t12;
|
|
530
|
+
} else {
|
|
531
|
+
t12 = $[2];
|
|
532
|
+
}
|
|
533
|
+
return t12;
|
|
534
|
+
}
|
|
535
|
+
const t1 = fallback ?? content;
|
|
536
|
+
let t2;
|
|
537
|
+
if ($[3] !== t1) {
|
|
538
|
+
t2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: t1 });
|
|
539
|
+
$[3] = t1;
|
|
540
|
+
$[4] = t2;
|
|
541
|
+
} else {
|
|
542
|
+
t2 = $[4];
|
|
543
|
+
}
|
|
544
|
+
return t2;
|
|
545
|
+
}
|
|
546
|
+
|
|
216
547
|
// src/ui/highlight.ts
|
|
217
548
|
source_default.level = Math.max(source_default.level, 3);
|
|
218
549
|
var KEYWORD = source_default.hex("#c586c0");
|
|
@@ -646,8 +977,52 @@ function highlightCode(source, language = void 0) {
|
|
|
646
977
|
return source.split("\n").map((line) => highlightSingleLine(line, keywords)).join("\n");
|
|
647
978
|
}
|
|
648
979
|
|
|
980
|
+
// src/ui/file-links.ts
|
|
981
|
+
import { isAbsolute, resolve } from "path";
|
|
982
|
+
import { pathToFileURL } from "url";
|
|
983
|
+
function fileLinkUrl(reference, workspace) {
|
|
984
|
+
const value = reference.trim();
|
|
985
|
+
if (!value || value.startsWith("#") || /[\x00-\x1f\x7f]/u.test(value)) return void 0;
|
|
986
|
+
if (value.startsWith("file://")) {
|
|
987
|
+
try {
|
|
988
|
+
return new URL(value).href;
|
|
989
|
+
} catch {
|
|
990
|
+
return void 0;
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
if (/^[a-z][a-z\d+.-]*:/iu.test(value) && !/^[A-Za-z]:[\\/]/u.test(value)) return void 0;
|
|
994
|
+
const location = /^(.*?):(\d+)(?::\d+)?$/u.exec(value);
|
|
995
|
+
const path = location?.[1] ?? value;
|
|
996
|
+
const absolute = isAbsolute(path);
|
|
997
|
+
if (!absolute && workspace === void 0) return void 0;
|
|
998
|
+
const url = pathToFileURL(absolute ? path : resolve(workspace, path));
|
|
999
|
+
if (location) url.hash = `L${location[2]}`;
|
|
1000
|
+
return url.href;
|
|
1001
|
+
}
|
|
1002
|
+
function looksLikeFilePath(value) {
|
|
1003
|
+
return value.startsWith("file://") || !/^[a-z][a-z\d+.-]*:\/\//iu.test(value) && /^(?:[A-Za-z]:[\\/]|\/|\.{1,2}[\\/]|[^\s/\\]+[/\\]|[^\s/\\]+\.[\w-]+(?::\d+(?::\d+)?)?$)/u.test(value);
|
|
1004
|
+
}
|
|
1005
|
+
var PATH_IN_TEXT = /(^|[\s([{“‘])((?:[A-Za-z]:[\\/]|\/|\.{1,2}[\\/]|[\w.-]+\/)[^\s<>"“”‘’`]+)/gu;
|
|
1006
|
+
function splitFilePaths(text, workspace) {
|
|
1007
|
+
const parts = [];
|
|
1008
|
+
let cursor = 0;
|
|
1009
|
+
for (const match of text.matchAll(PATH_IN_TEXT)) {
|
|
1010
|
+
const start = match.index + match[1].length;
|
|
1011
|
+
const raw = match[2];
|
|
1012
|
+
const path = raw.replace(/[.,;!?)}\]]+$/u, "");
|
|
1013
|
+
const url = fileLinkUrl(path, workspace);
|
|
1014
|
+
if (!url || path.length === 0) continue;
|
|
1015
|
+
if (start > cursor) parts.push({ text: text.slice(cursor, start) });
|
|
1016
|
+
parts.push({ text: path, url });
|
|
1017
|
+
cursor = start + path.length;
|
|
1018
|
+
}
|
|
1019
|
+
if (cursor < text.length) parts.push({ text: text.slice(cursor) });
|
|
1020
|
+
return parts;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
649
1023
|
// src/ui/markdown.tsx
|
|
650
|
-
var
|
|
1024
|
+
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
|
1025
|
+
var FileLinkWorkspaceContext = (0, import_react5.createContext)(void 0);
|
|
651
1026
|
var CODE_BLOCK_BORDER = {
|
|
652
1027
|
top: "\u2500",
|
|
653
1028
|
bottom: "\u2500",
|
|
@@ -676,9 +1051,9 @@ function MarkdownViewInner({ text }) {
|
|
|
676
1051
|
if (advance > 0) stablePrefixRef.current = text.substring(0, boundary + advance);
|
|
677
1052
|
const stablePrefix = stablePrefixRef.current;
|
|
678
1053
|
const unstableSuffix = text.substring(stablePrefix.length);
|
|
679
|
-
return /* @__PURE__ */ (0,
|
|
680
|
-
stablePrefix.length > 0 ? /* @__PURE__ */ (0,
|
|
681
|
-
unstableSuffix.length > 0 ? /* @__PURE__ */ (0,
|
|
1054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", width: "100%", children: [
|
|
1055
|
+
stablePrefix.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MarkdownSegment, { text: stablePrefix }) : null,
|
|
1056
|
+
unstableSuffix.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MarkdownSegment, { text: unstableSuffix }) : null
|
|
682
1057
|
] });
|
|
683
1058
|
}
|
|
684
1059
|
var MarkdownSegment = import_react5.default.memo(function MarkdownSegment2({ text }) {
|
|
@@ -689,32 +1064,32 @@ var MarkdownSegment = import_react5.default.memo(function MarkdownSegment2({ tex
|
|
|
689
1064
|
return [];
|
|
690
1065
|
}
|
|
691
1066
|
}, [text]);
|
|
692
|
-
return /* @__PURE__ */ (0,
|
|
1067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: tokens.map((token, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BlockToken, { token }, index)) });
|
|
693
1068
|
});
|
|
694
1069
|
var MarkdownView = import_react5.default.memo(MarkdownViewInner);
|
|
695
1070
|
var BlockToken = import_react5.default.memo(function BlockToken2({ token }) {
|
|
696
1071
|
switch (token.type) {
|
|
697
1072
|
case "space":
|
|
698
|
-
return /* @__PURE__ */ (0,
|
|
1073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { height: 1 });
|
|
699
1074
|
case "heading":
|
|
700
|
-
return /* @__PURE__ */ (0,
|
|
1075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(HeadingView, { token });
|
|
701
1076
|
case "paragraph":
|
|
702
|
-
return /* @__PURE__ */ (0,
|
|
1077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(InlineTokens, { tokens: token.tokens ?? [] }) });
|
|
703
1078
|
case "code":
|
|
704
|
-
return /* @__PURE__ */ (0,
|
|
1079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CodeBlock, { token });
|
|
705
1080
|
case "blockquote":
|
|
706
|
-
return /* @__PURE__ */ (0,
|
|
1081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BlockquoteView, { token });
|
|
707
1082
|
case "list":
|
|
708
|
-
return /* @__PURE__ */ (0,
|
|
1083
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ListView, { token });
|
|
709
1084
|
case "hr":
|
|
710
|
-
return /* @__PURE__ */ (0,
|
|
1085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(HrView, {});
|
|
711
1086
|
case "table":
|
|
712
|
-
return /* @__PURE__ */ (0,
|
|
1087
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableView, { token });
|
|
713
1088
|
case "html":
|
|
714
|
-
return /* @__PURE__ */ (0,
|
|
1089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: "[html]" });
|
|
715
1090
|
default:
|
|
716
1091
|
if ("text" in token && typeof token.text === "string") {
|
|
717
|
-
return /* @__PURE__ */ (0,
|
|
1092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: token.text });
|
|
718
1093
|
}
|
|
719
1094
|
return null;
|
|
720
1095
|
}
|
|
@@ -733,7 +1108,7 @@ function HeadingView({ token }) {
|
|
|
733
1108
|
return source_default.italic.hex("#93c5fd")(inner);
|
|
734
1109
|
}
|
|
735
1110
|
}, [token.depth, token.tokens]);
|
|
736
|
-
return /* @__PURE__ */ (0,
|
|
1111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: styled });
|
|
737
1112
|
}
|
|
738
1113
|
function CodeBlock({ token }) {
|
|
739
1114
|
const styledSource = (0, import_react5.useMemo)(() => highlightCode(token.text, token.lang), [token.text, token.lang]);
|
|
@@ -746,7 +1121,7 @@ function CodeBlock({ token }) {
|
|
|
746
1121
|
// resizes can change that width without changing this memoized token.
|
|
747
1122
|
// Building a line from process.stdout.columns overflows those narrower
|
|
748
1123
|
// parents and desynchronizes the terminal's physical auto-wrap cursor.
|
|
749
|
-
/* @__PURE__ */ (0,
|
|
1124
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
750
1125
|
Box_default,
|
|
751
1126
|
{
|
|
752
1127
|
flexDirection: "column",
|
|
@@ -756,28 +1131,28 @@ function CodeBlock({ token }) {
|
|
|
756
1131
|
borderColor: "gray",
|
|
757
1132
|
borderText: { content: ` ${label} `, position: "top", align: "start", offset: 1 },
|
|
758
1133
|
opaque: true,
|
|
759
|
-
children: /* @__PURE__ */ (0,
|
|
1134
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { flexDirection: "column", paddingX: 1, children: lines.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: "gray", wrap: "truncate-end", children: line.length > 0 ? line : " " }, i)) })
|
|
760
1135
|
}
|
|
761
1136
|
)
|
|
762
1137
|
);
|
|
763
1138
|
}
|
|
764
1139
|
function BlockquoteView({ token }) {
|
|
765
|
-
return /* @__PURE__ */ (0,
|
|
1140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { flexDirection: "column", children: token.tokens.map((child, i) => {
|
|
766
1141
|
const inline = "tokens" in child ? child.tokens ?? [] : [];
|
|
767
|
-
return /* @__PURE__ */ (0,
|
|
768
|
-
/* @__PURE__ */ (0,
|
|
769
|
-
/* @__PURE__ */ (0,
|
|
1142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { children: [
|
|
1143
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: "gray", children: "\u2502 " }),
|
|
1144
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(InlineTokens, { tokens: inline })
|
|
770
1145
|
] }, i);
|
|
771
1146
|
}) });
|
|
772
1147
|
}
|
|
773
1148
|
function HrView() {
|
|
774
1149
|
const { stdout } = useStdout();
|
|
775
1150
|
const width = Math.max(8, (stdout?.columns ?? 80) - 4);
|
|
776
|
-
return /* @__PURE__ */ (0,
|
|
1151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: "gray", children: "\u2500".repeat(width) });
|
|
777
1152
|
}
|
|
778
1153
|
function ListView({ token }) {
|
|
779
1154
|
const start = typeof token.start === "number" ? token.start : 1;
|
|
780
|
-
return /* @__PURE__ */ (0,
|
|
1155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { flexDirection: "column", children: token.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ListItemView, { item, index: start + i, ordered: token.ordered }, i)) });
|
|
781
1156
|
}
|
|
782
1157
|
function ListItemView({
|
|
783
1158
|
item,
|
|
@@ -803,28 +1178,28 @@ function ListItemView({
|
|
|
803
1178
|
blockTokens.push(child);
|
|
804
1179
|
}
|
|
805
1180
|
}
|
|
806
|
-
return /* @__PURE__ */ (0,
|
|
807
|
-
/* @__PURE__ */ (0,
|
|
808
|
-
/* @__PURE__ */ (0,
|
|
1181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
1182
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { children: [
|
|
1183
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { color: "cyan", children: [
|
|
809
1184
|
bullet,
|
|
810
1185
|
" "
|
|
811
1186
|
] }),
|
|
812
1187
|
inlineTokens.map((child, i) => {
|
|
813
1188
|
if (child.type === "paragraph") {
|
|
814
|
-
return /* @__PURE__ */ (0,
|
|
1189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(InlineTokens, { tokens: child.tokens ?? [] }, i);
|
|
815
1190
|
}
|
|
816
1191
|
const tokens = child.tokens ?? [];
|
|
817
|
-
return tokens.length > 0 ? /* @__PURE__ */ (0,
|
|
1192
|
+
return tokens.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(InlineTokens, { tokens }, i) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: child.text }, i);
|
|
818
1193
|
})
|
|
819
1194
|
] }),
|
|
820
|
-
blockTokens.map((child, i) => /* @__PURE__ */ (0,
|
|
1195
|
+
blockTokens.map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { marginLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BlockToken, { token: child }) }, i))
|
|
821
1196
|
] });
|
|
822
1197
|
}
|
|
823
1198
|
function TableView({ token }) {
|
|
824
1199
|
const { stdout } = useStdout();
|
|
825
1200
|
const maxWidth = stdout?.columns ?? 80;
|
|
826
1201
|
const colCount = token.header.length;
|
|
827
|
-
if (colCount === 0) return /* @__PURE__ */ (0,
|
|
1202
|
+
if (colCount === 0) return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: "[empty table]" });
|
|
828
1203
|
const colWidth = Math.max(8, Math.floor((maxWidth - colCount * 3) / colCount));
|
|
829
1204
|
const pad = (value, w, align) => {
|
|
830
1205
|
const stripped = stripAnsi2(value);
|
|
@@ -846,56 +1221,66 @@ function TableView({ token }) {
|
|
|
846
1221
|
if (align === "center") return ":" + "\u2500".repeat(colWidth - 2) + ":";
|
|
847
1222
|
return "\u2500".repeat(colWidth);
|
|
848
1223
|
});
|
|
849
|
-
return /* @__PURE__ */ (0,
|
|
850
|
-
/* @__PURE__ */ (0,
|
|
851
|
-
/* @__PURE__ */ (0,
|
|
852
|
-
token.rows.map((row, ri) => /* @__PURE__ */ (0,
|
|
1224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
1225
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: token.header.map((cell, i) => pad(cell.text, colWidth, cell.align ?? "left")).join(" \u2502 ") }),
|
|
1226
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: separator.join(" \u2502 ") }),
|
|
1227
|
+
token.rows.map((row, ri) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: row.map((cell, i) => pad(cell.text, colWidth, token.header[i]?.align ?? "left")).join(" \u2502 ") }, ri))
|
|
853
1228
|
] });
|
|
854
1229
|
}
|
|
855
1230
|
function InlineTokens({ tokens }) {
|
|
856
|
-
return /* @__PURE__ */ (0,
|
|
1231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: tokens.map((token, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(InlineToken, { token }, i)) });
|
|
857
1232
|
}
|
|
858
1233
|
function InlineToken({ token }) {
|
|
1234
|
+
const workspace = (0, import_react5.useContext)(FileLinkWorkspaceContext);
|
|
859
1235
|
switch (token.type) {
|
|
860
1236
|
case "text":
|
|
861
|
-
return /* @__PURE__ */ (0,
|
|
1237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: splitFilePaths(token.raw ?? token.text, workspace).map(
|
|
1238
|
+
(part, index) => part.url ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Link, { url: part.url, children: part.text }, index) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: part.text }, index)
|
|
1239
|
+
) });
|
|
862
1240
|
case "strong":
|
|
863
|
-
return /* @__PURE__ */ (0,
|
|
1241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { bold: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(InlineTokens, { tokens: token.tokens }) });
|
|
864
1242
|
case "em":
|
|
865
|
-
return /* @__PURE__ */ (0,
|
|
1243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { italic: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(InlineTokens, { tokens: token.tokens }) });
|
|
866
1244
|
case "del":
|
|
867
|
-
return /* @__PURE__ */ (0,
|
|
868
|
-
case "codespan":
|
|
869
|
-
|
|
1245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { strikethrough: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(InlineTokens, { tokens: token.tokens }) });
|
|
1246
|
+
case "codespan": {
|
|
1247
|
+
const value = token.text;
|
|
1248
|
+
const url = looksLikeFilePath(value) ? fileLinkUrl(value, workspace) : void 0;
|
|
1249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: "black", backgroundColor: "gray", children: url ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Link, { url, children: value }) : value });
|
|
1250
|
+
}
|
|
870
1251
|
case "link": {
|
|
871
1252
|
const link = token;
|
|
872
1253
|
const inner = renderInlineText(link.tokens);
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
/* @__PURE__ */ (0,
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
1254
|
+
const url = /^(?:https?:\/\/|mailto:|file:\/\/)/iu.test(link.href) ? link.href : looksLikeFilePath(link.href) ? fileLinkUrl(link.href, workspace) : void 0;
|
|
1255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { children: [
|
|
1256
|
+
url ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Link, { url, children: inner }) : inner,
|
|
1257
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { dimColor: true, color: "blue", children: [
|
|
1258
|
+
" ",
|
|
1259
|
+
url ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Link, { url, children: [
|
|
1260
|
+
"(",
|
|
1261
|
+
link.href,
|
|
1262
|
+
")"
|
|
1263
|
+
] }) : `(${link.href})`
|
|
879
1264
|
] })
|
|
880
1265
|
] });
|
|
881
1266
|
}
|
|
882
1267
|
case "image": {
|
|
883
1268
|
const img = token;
|
|
884
|
-
return /* @__PURE__ */ (0,
|
|
1269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { dimColor: true, children: [
|
|
885
1270
|
"[image: ",
|
|
886
1271
|
img.text,
|
|
887
1272
|
"]"
|
|
888
1273
|
] });
|
|
889
1274
|
}
|
|
890
1275
|
case "br":
|
|
891
|
-
return /* @__PURE__ */ (0,
|
|
1276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: "\n" });
|
|
892
1277
|
case "escape":
|
|
893
|
-
return /* @__PURE__ */ (0,
|
|
1278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: token.text });
|
|
894
1279
|
case "html":
|
|
895
1280
|
return null;
|
|
896
1281
|
default:
|
|
897
1282
|
if ("text" in token && typeof token.text === "string") {
|
|
898
|
-
return /* @__PURE__ */ (0,
|
|
1283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: token.text });
|
|
899
1284
|
}
|
|
900
1285
|
return null;
|
|
901
1286
|
}
|
|
@@ -939,9 +1324,9 @@ function inlineTokenToString(token) {
|
|
|
939
1324
|
}
|
|
940
1325
|
|
|
941
1326
|
// src/ui/assistant-text.tsx
|
|
942
|
-
var
|
|
1327
|
+
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
943
1328
|
function AssistantTextInner({ text }) {
|
|
944
|
-
return /* @__PURE__ */ (0,
|
|
1329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MarkdownView, { text });
|
|
945
1330
|
}
|
|
946
1331
|
var AssistantText = import_react6.default.memo(AssistantTextInner);
|
|
947
1332
|
|
|
@@ -1005,7 +1390,7 @@ function wrapPromptInput(input, codePointCursor, options) {
|
|
|
1005
1390
|
|
|
1006
1391
|
// src/ui/task-progress.tsx
|
|
1007
1392
|
var import_react7 = __toESM(require_react(), 1);
|
|
1008
|
-
var
|
|
1393
|
+
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
|
|
1009
1394
|
function TaskStatusLine({
|
|
1010
1395
|
block,
|
|
1011
1396
|
interactive,
|
|
@@ -1067,28 +1452,28 @@ function TaskStatusLine({
|
|
|
1067
1452
|
...metaLabel === void 0 ? [] : [{ text: ` ${metaLabel}`, color: metaColor ?? "ansi:blackBright" }]
|
|
1068
1453
|
];
|
|
1069
1454
|
const boundedText = textWidth === void 0 || maxTextLines === void 0 ? void 0 : limitTaskTextSegments(textSegments, textWidth, maxTextLines).segments;
|
|
1070
|
-
return /* @__PURE__ */ (0,
|
|
1071
|
-
/* @__PURE__ */ (0,
|
|
1072
|
-
/* @__PURE__ */ (0,
|
|
1455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Box_default, { flexDirection: "column", width: "100%", children: [
|
|
1456
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box_default, { ref, flexDirection: "row", width: "100%", children: boundedText === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1457
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { ...presentation.color === void 0 ? {} : { color: presentation.color }, children: [
|
|
1073
1458
|
presentation.glyph,
|
|
1074
1459
|
" "
|
|
1075
1460
|
] }),
|
|
1076
|
-
badge ? /* @__PURE__ */ (0,
|
|
1461
|
+
badge ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { color: badgeColor, children: [
|
|
1077
1462
|
badge,
|
|
1078
1463
|
" "
|
|
1079
1464
|
] }) : null,
|
|
1080
|
-
/* @__PURE__ */ (0,
|
|
1081
|
-
statusLabel !== void 0 ? /* @__PURE__ */ (0,
|
|
1082
|
-
/* @__PURE__ */ (0,
|
|
1083
|
-
/* @__PURE__ */ (0,
|
|
1465
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { ...presentation.color === void 0 ? {} : { color: presentation.color }, children: before }),
|
|
1466
|
+
statusLabel !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1467
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { ...presentation.color === void 0 ? {} : { color: presentation.color }, children: " \xB7 " }),
|
|
1468
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: statusColor ?? presentation.color, children: statusLabel })
|
|
1084
1469
|
] }) : null,
|
|
1085
|
-
after ? /* @__PURE__ */ (0,
|
|
1086
|
-
metaLabel === void 0 ? null : /* @__PURE__ */ (0,
|
|
1470
|
+
after ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { ...presentation.color === void 0 ? {} : { color: presentation.color }, children: after }) : null,
|
|
1471
|
+
metaLabel === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { color: metaColor ?? "ansi:blackBright", children: [
|
|
1087
1472
|
" ",
|
|
1088
1473
|
metaLabel
|
|
1089
1474
|
] })
|
|
1090
|
-
] }) : /* @__PURE__ */ (0,
|
|
1091
|
-
thinkingLine === void 0 ? null : /* @__PURE__ */ (0,
|
|
1475
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { children: boundedText.map((segment, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { ...segment.color === void 0 ? {} : { color: segment.color }, children: segment.text }, index)) }) }),
|
|
1476
|
+
thinkingLine === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ThinkingLineView, { text: thinkingLine })
|
|
1092
1477
|
] });
|
|
1093
1478
|
}
|
|
1094
1479
|
function limitTaskTextSegments(segments, width, maxLines = 3) {
|
|
@@ -1153,9 +1538,9 @@ function limitTaskTextSegments(segments, width, maxLines = 3) {
|
|
|
1153
1538
|
var THINKING_RAIL = "#416f84";
|
|
1154
1539
|
var THINKING_TEXT = "#91a0a8";
|
|
1155
1540
|
function ThinkingLineView({ text }) {
|
|
1156
|
-
return /* @__PURE__ */ (0,
|
|
1157
|
-
/* @__PURE__ */ (0,
|
|
1158
|
-
/* @__PURE__ */ (0,
|
|
1541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
1542
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: THINKING_RAIL, children: "\u2502 " }),
|
|
1543
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: THINKING_TEXT, wrap: "truncate-end", children: text })
|
|
1159
1544
|
] });
|
|
1160
1545
|
}
|
|
1161
1546
|
var SPLIT_TRACK_MIN_COLUMNS = 96;
|
|
@@ -1179,7 +1564,7 @@ function TaskProgressPanel({
|
|
|
1179
1564
|
const hoverProps = (track) => ({
|
|
1180
1565
|
onMouseEnter: () => onHoverChange?.(track)
|
|
1181
1566
|
});
|
|
1182
|
-
return /* @__PURE__ */ (0,
|
|
1567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1183
1568
|
Box_default,
|
|
1184
1569
|
{
|
|
1185
1570
|
flexDirection: "column",
|
|
@@ -1187,7 +1572,7 @@ function TaskProgressPanel({
|
|
|
1187
1572
|
width: "100%",
|
|
1188
1573
|
maxHeight,
|
|
1189
1574
|
onMouseLeave: () => onHoverChange?.(null),
|
|
1190
|
-
children: split ? /* @__PURE__ */ (0,
|
|
1575
|
+
children: split ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1191
1576
|
SplitTracks,
|
|
1192
1577
|
{
|
|
1193
1578
|
taskBlocks,
|
|
@@ -1199,7 +1584,7 @@ function TaskProgressPanel({
|
|
|
1199
1584
|
subagentScrollRef,
|
|
1200
1585
|
hoverProps
|
|
1201
1586
|
}
|
|
1202
|
-
) : hasTasks && hasSubagents ? /* @__PURE__ */ (0,
|
|
1587
|
+
) : hasTasks && hasSubagents ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1203
1588
|
StackedTracks,
|
|
1204
1589
|
{
|
|
1205
1590
|
taskBlocks,
|
|
@@ -1211,7 +1596,7 @@ function TaskProgressPanel({
|
|
|
1211
1596
|
subagentScrollRef,
|
|
1212
1597
|
hoverProps
|
|
1213
1598
|
}
|
|
1214
|
-
) : /* @__PURE__ */ (0,
|
|
1599
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1215
1600
|
SingleTrack,
|
|
1216
1601
|
{
|
|
1217
1602
|
role: hasTasks ? "main" : "subagent",
|
|
@@ -1240,14 +1625,14 @@ function SplitTracks({
|
|
|
1240
1625
|
const availableWidth = columns - SPLIT_TRACK_GUTTER_COLUMNS;
|
|
1241
1626
|
const leftWidth = Math.max(1, Math.floor(availableWidth * SPLIT_TRACK_MAIN_RATIO));
|
|
1242
1627
|
const rightWidth = Math.max(1, availableWidth - leftWidth);
|
|
1243
|
-
return /* @__PURE__ */ (0,
|
|
1244
|
-
/* @__PURE__ */ (0,
|
|
1245
|
-
/* @__PURE__ */ (0,
|
|
1246
|
-
/* @__PURE__ */ (0,
|
|
1247
|
-
/* @__PURE__ */ (0,
|
|
1628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1629
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Box_default, { flexDirection: "row", width: "100%", children: [
|
|
1630
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box_default, { width: leftWidth, ...hoverProps("main"), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TrackHeader, { role: "main", count: taskBlocks.length, width: leftWidth }) }),
|
|
1631
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "ansi:white", children: "\u2500\u252C\u2500" }),
|
|
1632
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box_default, { width: rightWidth, ...hoverProps("subagent"), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TrackHeader, { role: "subagent", count: subagentBlocks.length, width: rightWidth }) })
|
|
1248
1633
|
] }),
|
|
1249
|
-
contentHeight <= 0 ? null : /* @__PURE__ */ (0,
|
|
1250
|
-
/* @__PURE__ */ (0,
|
|
1634
|
+
contentHeight <= 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Box_default, { flexDirection: "row", width: "100%", height: contentHeight, children: [
|
|
1635
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box_default, { width: leftWidth, minWidth: 0, flexDirection: "column", ...hoverProps("main"), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1251
1636
|
TrackScrollBox,
|
|
1252
1637
|
{
|
|
1253
1638
|
ref: mainScrollRef,
|
|
@@ -1258,8 +1643,8 @@ function SplitTracks({
|
|
|
1258
1643
|
maxTextLines: 2
|
|
1259
1644
|
}
|
|
1260
1645
|
) }),
|
|
1261
|
-
/* @__PURE__ */ (0,
|
|
1262
|
-
/* @__PURE__ */ (0,
|
|
1646
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TrackDivider, { height: contentHeight }),
|
|
1647
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box_default, { width: rightWidth, minWidth: 0, flexDirection: "column", ...hoverProps("subagent"), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1263
1648
|
TrackScrollBox,
|
|
1264
1649
|
{
|
|
1265
1650
|
ref: subagentScrollRef,
|
|
@@ -1284,12 +1669,12 @@ function StackedTracks({
|
|
|
1284
1669
|
hoverProps
|
|
1285
1670
|
}) {
|
|
1286
1671
|
if (height <= 1) {
|
|
1287
|
-
return /* @__PURE__ */ (0,
|
|
1672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box_default, { ...hoverProps("main"), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TrackHeader, { role: "main", count: taskBlocks.length, width: columns }) });
|
|
1288
1673
|
}
|
|
1289
1674
|
const mainHeight = Math.ceil(height / 2);
|
|
1290
1675
|
const subagentHeight = Math.floor(height / 2);
|
|
1291
|
-
return /* @__PURE__ */ (0,
|
|
1292
|
-
/* @__PURE__ */ (0,
|
|
1676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1677
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1293
1678
|
SingleTrack,
|
|
1294
1679
|
{
|
|
1295
1680
|
role: "main",
|
|
@@ -1301,7 +1686,7 @@ function StackedTracks({
|
|
|
1301
1686
|
hoverProps
|
|
1302
1687
|
}
|
|
1303
1688
|
),
|
|
1304
|
-
/* @__PURE__ */ (0,
|
|
1689
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1305
1690
|
SingleTrack,
|
|
1306
1691
|
{
|
|
1307
1692
|
role: "subagent",
|
|
@@ -1325,9 +1710,9 @@ function SingleTrack({
|
|
|
1325
1710
|
hoverProps
|
|
1326
1711
|
}) {
|
|
1327
1712
|
const contentHeight = Math.max(0, height - 1);
|
|
1328
|
-
return /* @__PURE__ */ (0,
|
|
1329
|
-
/* @__PURE__ */ (0,
|
|
1330
|
-
contentHeight <= 0 ? null : /* @__PURE__ */ (0,
|
|
1713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Box_default, { flexDirection: "column", width: "100%", height, ...hoverProps(role), children: [
|
|
1714
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TrackHeader, { role, count: blocks.length, width }),
|
|
1715
|
+
contentHeight <= 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1331
1716
|
TrackScrollBox,
|
|
1332
1717
|
{
|
|
1333
1718
|
ref: scrollRef,
|
|
@@ -1348,7 +1733,7 @@ function TrackScrollBox({
|
|
|
1348
1733
|
width,
|
|
1349
1734
|
maxTextLines
|
|
1350
1735
|
}) {
|
|
1351
|
-
return /* @__PURE__ */ (0,
|
|
1736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1352
1737
|
ScrollBox_default,
|
|
1353
1738
|
{
|
|
1354
1739
|
...ref === void 0 ? {} : { ref },
|
|
@@ -1358,7 +1743,7 @@ function TrackScrollBox({
|
|
|
1358
1743
|
height,
|
|
1359
1744
|
maxHeight: height,
|
|
1360
1745
|
paddingX: 1,
|
|
1361
|
-
children: blocks.map((block) => /* @__PURE__ */ (0,
|
|
1746
|
+
children: blocks.map((block) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1362
1747
|
TaskStatusLine,
|
|
1363
1748
|
{
|
|
1364
1749
|
block,
|
|
@@ -1376,10 +1761,10 @@ function TrackHeader({ role, count, width }) {
|
|
|
1376
1761
|
const label = role === "main" ? `task plan (${count})` : `subagents (${count})`;
|
|
1377
1762
|
const prefix = `\u2500\u2500 ${label} `;
|
|
1378
1763
|
const line = prefix.length >= width ? prefix.slice(0, Math.max(0, width)) : `${prefix}${"\u2500".repeat(width - prefix.length)}`;
|
|
1379
|
-
return /* @__PURE__ */ (0,
|
|
1764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "ansi:white", wrap: "truncate-end", children: line });
|
|
1380
1765
|
}
|
|
1381
1766
|
function TrackDivider({ height }) {
|
|
1382
|
-
return /* @__PURE__ */ (0,
|
|
1767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box_default, { flexDirection: "column", width: SPLIT_TRACK_GUTTER_COLUMNS, flexShrink: 0, children: Array.from({ length: height }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "ansi:white", children: " \u2502 " }, index)) });
|
|
1383
1768
|
}
|
|
1384
1769
|
|
|
1385
1770
|
// src/ui/file-diff-style.ts
|
|
@@ -1627,7 +2012,7 @@ function comparePaths(left, right) {
|
|
|
1627
2012
|
}
|
|
1628
2013
|
|
|
1629
2014
|
// src/ui/welcome.tsx
|
|
1630
|
-
var
|
|
2015
|
+
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
|
|
1631
2016
|
var WIDE_WELCOME_COLUMNS = 72;
|
|
1632
2017
|
var FLAVOR_ACCENT = "#67D4FF";
|
|
1633
2018
|
var FLAVOR_WORDMARK = [
|
|
@@ -1646,12 +2031,12 @@ function WelcomeCard({
|
|
|
1646
2031
|
const wide = Math.max(1, Math.floor(columns)) >= WIDE_WELCOME_COLUMNS && availableRows >= 9 + Math.max(serviceName === void 0 ? 0 : 1, updateTo === void 0 ? 0 : 1);
|
|
1647
2032
|
const minimal = availableRows < 6 + (updateTo === void 0 ? 0 : 2);
|
|
1648
2033
|
if (minimal) {
|
|
1649
|
-
return /* @__PURE__ */ (0,
|
|
1650
|
-
/* @__PURE__ */ (0,
|
|
1651
|
-
availableRows >= 2 ? /* @__PURE__ */ (0,
|
|
2034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { width: "100%", flexDirection: "column", children: [
|
|
2035
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { bold: true, color: FLAVOR_ACCENT, wrap: "truncate-end", children: "\u25C6 Flavor Code" }),
|
|
2036
|
+
availableRows >= 2 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, wrap: "truncate-end", children: updateTo === void 0 ? "/help \xB7 /init" : `\u25B2 Update v${updateTo} \xB7 flavor update` }) : null
|
|
1652
2037
|
] });
|
|
1653
2038
|
}
|
|
1654
|
-
const updateHint = updateTo === void 0 ? null : /* @__PURE__ */ (0,
|
|
2039
|
+
const updateHint = updateTo === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "yellowBright", wrap: "wrap", children: [
|
|
1655
2040
|
"\u25B2 ",
|
|
1656
2041
|
"Update available: v",
|
|
1657
2042
|
packageVersion(),
|
|
@@ -1661,8 +2046,8 @@ function WelcomeCard({
|
|
|
1661
2046
|
updateTo,
|
|
1662
2047
|
"\nRun: flavor update"
|
|
1663
2048
|
] });
|
|
1664
|
-
return /* @__PURE__ */ (0,
|
|
1665
|
-
/* @__PURE__ */ (0,
|
|
2049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { width: "100%", borderStyle: "round", borderColor: "yellow", paddingX: 1, children: wide ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { width: "100%", flexDirection: "row", children: [
|
|
2050
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1666
2051
|
Box_default,
|
|
1667
2052
|
{
|
|
1668
2053
|
width: "36%",
|
|
@@ -1675,55 +2060,55 @@ function WelcomeCard({
|
|
|
1675
2060
|
borderColor: "yellow",
|
|
1676
2061
|
paddingRight: 1,
|
|
1677
2062
|
children: [
|
|
1678
|
-
/* @__PURE__ */ (0,
|
|
1679
|
-
/* @__PURE__ */ (0,
|
|
1680
|
-
serviceName === void 0 ? null : /* @__PURE__ */ (0,
|
|
1681
|
-
/* @__PURE__ */ (0,
|
|
1682
|
-
/* @__PURE__ */ (0,
|
|
1683
|
-
/* @__PURE__ */ (0,
|
|
2063
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { bold: true, color: "yellowBright", children: "Welcome back!" }),
|
|
2064
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: FLAVOR_ACCENT, children: FLAVOR_WORDMARK }),
|
|
2065
|
+
serviceName === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "cyan", wrap: "truncate-end", children: serviceName }),
|
|
2066
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, wrap: "truncate-end", children: model }),
|
|
2067
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, wrap: "truncate-end", children: workspaceName }),
|
|
2068
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { dimColor: true, wrap: "truncate-end", children: [
|
|
1684
2069
|
"v",
|
|
1685
2070
|
packageVersion()
|
|
1686
2071
|
] })
|
|
1687
2072
|
]
|
|
1688
2073
|
}
|
|
1689
2074
|
),
|
|
1690
|
-
/* @__PURE__ */ (0,
|
|
1691
|
-
/* @__PURE__ */ (0,
|
|
1692
|
-
/* @__PURE__ */ (0,
|
|
2075
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexGrow: 1, flexDirection: "column", paddingLeft: 1, children: [
|
|
2076
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { bold: true, color: "yellowBright", children: "Tips for getting started" }),
|
|
2077
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { children: [
|
|
1693
2078
|
"Run ",
|
|
1694
|
-
/* @__PURE__ */ (0,
|
|
2079
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "cyan", children: "/init" }),
|
|
1695
2080
|
" to create or refresh FLAVOR.md"
|
|
1696
2081
|
] }),
|
|
1697
|
-
/* @__PURE__ */ (0,
|
|
2082
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { children: [
|
|
1698
2083
|
"Type ",
|
|
1699
|
-
/* @__PURE__ */ (0,
|
|
2084
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "cyan", children: "@" }),
|
|
1700
2085
|
" to attach a project file"
|
|
1701
2086
|
] }),
|
|
1702
|
-
/* @__PURE__ */ (0,
|
|
1703
|
-
/* @__PURE__ */ (0,
|
|
1704
|
-
/* @__PURE__ */ (0,
|
|
1705
|
-
/* @__PURE__ */ (0,
|
|
2087
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { height: 1 }),
|
|
2088
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { bold: true, color: "yellowBright", children: "Quick commands" }),
|
|
2089
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { children: [
|
|
2090
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "cyan", children: "/help" }),
|
|
1706
2091
|
" \xB7 ",
|
|
1707
|
-
/* @__PURE__ */ (0,
|
|
2092
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "cyan", children: "/config" }),
|
|
1708
2093
|
" \xB7 ",
|
|
1709
|
-
/* @__PURE__ */ (0,
|
|
2094
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "cyan", children: "/tasks" })
|
|
1710
2095
|
] }),
|
|
1711
2096
|
updateHint
|
|
1712
2097
|
] })
|
|
1713
|
-
] }) : /* @__PURE__ */ (0,
|
|
1714
|
-
/* @__PURE__ */ (0,
|
|
1715
|
-
/* @__PURE__ */ (0,
|
|
1716
|
-
/* @__PURE__ */ (0,
|
|
2098
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { width: "100%", flexDirection: "column", children: [
|
|
2099
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { bold: true, color: FLAVOR_ACCENT, children: "\u25C6 Flavor Code" }),
|
|
2100
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { children: "Welcome back!" }),
|
|
2101
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { dimColor: true, wrap: "truncate-end", children: [
|
|
1717
2102
|
model,
|
|
1718
2103
|
" \xB7 ",
|
|
1719
2104
|
workspaceName,
|
|
1720
2105
|
" \xB7 v",
|
|
1721
2106
|
packageVersion()
|
|
1722
2107
|
] }),
|
|
1723
|
-
/* @__PURE__ */ (0,
|
|
1724
|
-
/* @__PURE__ */ (0,
|
|
2108
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { children: [
|
|
2109
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "cyan", children: "/init" }),
|
|
1725
2110
|
" setup \xB7 ",
|
|
1726
|
-
/* @__PURE__ */ (0,
|
|
2111
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "cyan", children: "/help" }),
|
|
1727
2112
|
" commands"
|
|
1728
2113
|
] }),
|
|
1729
2114
|
updateHint
|
|
@@ -1734,7 +2119,7 @@ function WelcomeCard({
|
|
|
1734
2119
|
import { createHash, randomUUID } from "crypto";
|
|
1735
2120
|
import { constants } from "fs";
|
|
1736
2121
|
import { mkdir, open, rename, rm } from "fs/promises";
|
|
1737
|
-
import { basename as basename2, join, resolve } from "path";
|
|
2122
|
+
import { basename as basename2, join, resolve as resolve2 } from "path";
|
|
1738
2123
|
var DEFAULT_MAX_IMAGES = 5;
|
|
1739
2124
|
var DEFAULT_MAX_IMAGE_BYTES = 5 * 1024 * 1024;
|
|
1740
2125
|
var DEFAULT_MAX_TOTAL_IMAGE_BYTES = 20 * 1024 * 1024;
|
|
@@ -1746,7 +2131,7 @@ var SessionAssetStore = class {
|
|
|
1746
2131
|
#maxImageBytes;
|
|
1747
2132
|
#maxTotalBytes;
|
|
1748
2133
|
constructor(options) {
|
|
1749
|
-
this.#root = join(
|
|
2134
|
+
this.#root = join(resolve2(options.workspace), ".flavor", "session-assets");
|
|
1750
2135
|
this.#maxImages = positiveInteger(options.maxImages ?? DEFAULT_MAX_IMAGES, "maxImages");
|
|
1751
2136
|
this.#maxImageBytes = positiveInteger(options.maxImageBytes ?? DEFAULT_MAX_IMAGE_BYTES, "maxImageBytes");
|
|
1752
2137
|
this.#maxTotalBytes = positiveInteger(options.maxTotalBytes ?? DEFAULT_MAX_TOTAL_IMAGE_BYTES, "maxTotalBytes");
|
|
@@ -2018,7 +2403,7 @@ function timestamp(value) {
|
|
|
2018
2403
|
// src/ui/prompt-history.ts
|
|
2019
2404
|
import { createHash as createHash2, randomUUID as randomUUID2 } from "crypto";
|
|
2020
2405
|
import { mkdir as mkdir2, readFile, rename as rename2, writeFile } from "fs/promises";
|
|
2021
|
-
import { join as join2, resolve as
|
|
2406
|
+
import { join as join2, resolve as resolve3 } from "path";
|
|
2022
2407
|
var HISTORY_VERSION = 1;
|
|
2023
2408
|
var PromptHistoryStore = class {
|
|
2024
2409
|
#directory;
|
|
@@ -2027,9 +2412,9 @@ var PromptHistoryStore = class {
|
|
|
2027
2412
|
#maxEntries;
|
|
2028
2413
|
#writeChain = Promise.resolve();
|
|
2029
2414
|
constructor(options) {
|
|
2030
|
-
this.#workspace =
|
|
2415
|
+
this.#workspace = resolve3(options.workspace);
|
|
2031
2416
|
this.#maxEntries = Math.max(1, Math.floor(options.maxEntries ?? 200));
|
|
2032
|
-
this.#directory = join2(
|
|
2417
|
+
this.#directory = join2(resolve3(options.home), ".flavor-code", "history");
|
|
2033
2418
|
const key = createHash2("sha256").update(this.#workspace).digest("hex").slice(0, 24);
|
|
2034
2419
|
this.#path = join2(this.#directory, `${key}.json`);
|
|
2035
2420
|
}
|
|
@@ -2059,7 +2444,7 @@ var PromptHistoryStore = class {
|
|
|
2059
2444
|
};
|
|
2060
2445
|
|
|
2061
2446
|
// src/ui/app.tsx
|
|
2062
|
-
var
|
|
2447
|
+
var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
|
|
2063
2448
|
var HISTORY_CAP = 200;
|
|
2064
2449
|
var CLIPBOARD_SHORTCUT_FALLBACK_MS = 300;
|
|
2065
2450
|
var BUILTIN_SLASH_CANDIDATES = [
|
|
@@ -2116,6 +2501,14 @@ function isPlatformShortcut(character, key, letter, platform = process.platform)
|
|
|
2116
2501
|
if (character.toLowerCase() !== letter.toLowerCase()) return false;
|
|
2117
2502
|
return platform === "darwin" ? key.super || key.ctrl : key.ctrl;
|
|
2118
2503
|
}
|
|
2504
|
+
function memoryReviewAction(character, key, platform = process.platform) {
|
|
2505
|
+
if (isPlatformShortcut(character, key, "y", platform)) return "accept";
|
|
2506
|
+
if (isPlatformShortcut(character, key, "n", platform)) return "dismiss";
|
|
2507
|
+
return null;
|
|
2508
|
+
}
|
|
2509
|
+
function memoryReviewModifierHint(platform = process.platform) {
|
|
2510
|
+
return platform === "darwin" ? "Ctrl/Cmd" : "Ctrl";
|
|
2511
|
+
}
|
|
2119
2512
|
function isOutputToggleShortcut(character, key) {
|
|
2120
2513
|
return key.ctrl && character.toLowerCase() === "o";
|
|
2121
2514
|
}
|
|
@@ -2837,8 +3230,9 @@ function App({ workspace, home, resumeSession, instanceId, palAlias, onSessionEn
|
|
|
2837
3230
|
return;
|
|
2838
3231
|
}
|
|
2839
3232
|
const pendingMemory = active?.memoryReviews.pending[0];
|
|
2840
|
-
|
|
2841
|
-
|
|
3233
|
+
const reviewAction = pendingMemory === void 0 ? null : memoryReviewAction(character, key);
|
|
3234
|
+
if (pendingMemory !== void 0 && reviewAction !== null) {
|
|
3235
|
+
if (reviewAction === "accept") {
|
|
2842
3236
|
void active.memoryReviews.accept(pendingMemory.id).catch((error) => {
|
|
2843
3237
|
dispatch({ type: "submit-error", message: safeUiError(error) });
|
|
2844
3238
|
});
|
|
@@ -3125,7 +3519,7 @@ function App({ workspace, home, resumeSession, instanceId, palAlias, onSessionEn
|
|
|
3125
3519
|
setDismissedMentionInput(void 0);
|
|
3126
3520
|
}
|
|
3127
3521
|
});
|
|
3128
|
-
if (runtime === void 0) return /* @__PURE__ */ (0,
|
|
3522
|
+
if (runtime === void 0) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FileLinkWorkspaceContext.Provider, { value: workspace, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3129
3523
|
StartingLayout,
|
|
3130
3524
|
{
|
|
3131
3525
|
workspaceName: basename3(workspace),
|
|
@@ -3135,9 +3529,9 @@ function App({ workspace, home, resumeSession, instanceId, palAlias, onSessionEn
|
|
|
3135
3529
|
columns,
|
|
3136
3530
|
rows
|
|
3137
3531
|
}
|
|
3138
|
-
);
|
|
3532
|
+
) });
|
|
3139
3533
|
const llmServiceName = runtime.services.llmServiceName?.();
|
|
3140
|
-
return /* @__PURE__ */ (0,
|
|
3534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FileLinkWorkspaceContext.Provider, { value: workspace, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3141
3535
|
TerminalLayout,
|
|
3142
3536
|
{
|
|
3143
3537
|
model: runtime.services.mainModel(),
|
|
@@ -3190,7 +3584,7 @@ function App({ workspace, home, resumeSession, instanceId, palAlias, onSessionEn
|
|
|
3190
3584
|
questionAnswers,
|
|
3191
3585
|
customQuestionActive
|
|
3192
3586
|
}
|
|
3193
|
-
);
|
|
3587
|
+
) });
|
|
3194
3588
|
}
|
|
3195
3589
|
function StartingLayout({
|
|
3196
3590
|
workspaceName,
|
|
@@ -3200,7 +3594,7 @@ function StartingLayout({
|
|
|
3200
3594
|
columns,
|
|
3201
3595
|
rows
|
|
3202
3596
|
}) {
|
|
3203
|
-
return /* @__PURE__ */ (0,
|
|
3597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3204
3598
|
TerminalLayout,
|
|
3205
3599
|
{
|
|
3206
3600
|
model: "starting",
|
|
@@ -3456,16 +3850,16 @@ function TerminalLayout({
|
|
|
3456
3850
|
} else {
|
|
3457
3851
|
footerHint = `Enter send \xB7 \u2191\u2193/Ctrl/Cmd+R history \xB7 ${outputShortcut} ${expandedOutput ? "collapse all output" : "expand all output"} \xB7 Ctrl+C exit`;
|
|
3458
3852
|
}
|
|
3459
|
-
return /* @__PURE__ */ (0,
|
|
3460
|
-
showWelcome && !focusedOpen ? /* @__PURE__ */ (0,
|
|
3461
|
-
/* @__PURE__ */ (0,
|
|
3853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { height: rows, width: "100%", flexDirection: "column", overflow: "hidden", children: [
|
|
3854
|
+
showWelcome && !focusedOpen ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { flexGrow: 1, flexShrink: 1, flexDirection: "column", overflow: "hidden", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WelcomeCard, { model, ...serviceName === void 0 ? {} : { serviceName }, workspaceName, ...updateTo === void 0 ? {} : { updateTo }, columns, availableRows: Math.max(0, rows - taskPanelRows - fixedBottomRows - 1) }) }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(ScrollBox_default, { ...scrollRef === void 0 ? {} : { ref: scrollRef }, flexGrow: 1, flexDirection: "column", stickyScroll: true, children: [
|
|
3855
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { dimColor: true, children: [
|
|
3462
3856
|
"flavor \xB7 ",
|
|
3463
3857
|
model,
|
|
3464
3858
|
" \xB7 ",
|
|
3465
3859
|
workspaceName
|
|
3466
3860
|
] }),
|
|
3467
|
-
/* @__PURE__ */ (0,
|
|
3468
|
-
completedWindow.hiddenTurns > 0 || completedWindow.hiddenBlocks > 0 ? /* @__PURE__ */ (0,
|
|
3861
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { height: 1 }),
|
|
3862
|
+
completedWindow.hiddenTurns > 0 || completedWindow.hiddenBlocks > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { dimColor: true, children: [
|
|
3469
3863
|
"\u2026 ",
|
|
3470
3864
|
completedWindow.hiddenTurns,
|
|
3471
3865
|
" earlier turns and ",
|
|
@@ -3474,21 +3868,21 @@ function TerminalLayout({
|
|
|
3474
3868
|
outputShortcut,
|
|
3475
3869
|
" to view all"
|
|
3476
3870
|
] }) : null,
|
|
3477
|
-
completedWindow.turns.map((turn, index) => /* @__PURE__ */ (0,
|
|
3478
|
-
index > 0 ? /* @__PURE__ */ (0,
|
|
3479
|
-
/* @__PURE__ */ (0,
|
|
3871
|
+
completedWindow.turns.map((turn, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { ref: (element) => onTurnElement?.(turn.id, element), flexDirection: "column", children: [
|
|
3872
|
+
index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TurnSeparator, { width: columns }) : null,
|
|
3873
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TurnView, { turn, interactive: false, workspaceName, expandedOutput })
|
|
3480
3874
|
] }, turn.id)),
|
|
3481
|
-
activeWithoutTasks === void 0 ? null : /* @__PURE__ */ (0,
|
|
3482
|
-
completedWindow.turns.length > 0 ? /* @__PURE__ */ (0,
|
|
3483
|
-
/* @__PURE__ */ (0,
|
|
3875
|
+
activeWithoutTasks === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { ref: (element) => onTurnElement?.(activeWithoutTasks.id, element), flexDirection: "column", children: [
|
|
3876
|
+
completedWindow.turns.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TurnSeparator, { width: columns }) : null,
|
|
3877
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TurnView, { turn: activeWithoutTasks, interactive: activeSession, workspaceName, expandedOutput })
|
|
3484
3878
|
] })
|
|
3485
3879
|
] }),
|
|
3486
|
-
!scrollBehind || showWelcome ? null : /* @__PURE__ */ (0,
|
|
3880
|
+
!scrollBehind || showWelcome ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { width: "100%", onClick: onJumpToLatest, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "yellow", wrap: "truncate-end", children: [
|
|
3487
3881
|
newOutput ? "\u2193 New output" : "\u2191 Reading earlier output",
|
|
3488
3882
|
" \xB7 End latest",
|
|
3489
3883
|
columns >= 72 ? " \xB7 Ctrl+\u2191/\u2193 turns" : ""
|
|
3490
3884
|
] }) }),
|
|
3491
|
-
/* @__PURE__ */ (0,
|
|
3885
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3492
3886
|
TaskProgressPanel,
|
|
3493
3887
|
{
|
|
3494
3888
|
blocks: activeTaskBlocks,
|
|
@@ -3500,13 +3894,13 @@ function TerminalLayout({
|
|
|
3500
3894
|
...onTaskPanelHoverChange === void 0 ? {} : { onHoverChange: onTaskPanelHoverChange }
|
|
3501
3895
|
}
|
|
3502
3896
|
),
|
|
3503
|
-
/* @__PURE__ */ (0,
|
|
3504
|
-
completion === void 0 && mentionCompletion === void 0 ? null : /* @__PURE__ */ (0,
|
|
3505
|
-
completion === void 0 ? null : /* @__PURE__ */ (0,
|
|
3506
|
-
mentionCompletion === void 0 ? null : /* @__PURE__ */ (0,
|
|
3897
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { position: "relative", flexShrink: 0, width: "100%", children: [
|
|
3898
|
+
completion === void 0 && mentionCompletion === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { position: "absolute", bottom: "100%", left: 0, right: 0, flexDirection: "column", opaque: true, children: [
|
|
3899
|
+
completion === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SlashMenu, { completion }),
|
|
3900
|
+
mentionCompletion === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MentionMenu, { completion: mentionCompletion, ...onMentionSelect === void 0 ? {} : { onSelect: onMentionSelect } })
|
|
3507
3901
|
] }),
|
|
3508
|
-
/* @__PURE__ */ (0,
|
|
3509
|
-
!focusedOpen ? null : /* @__PURE__ */ (0,
|
|
3902
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", flexShrink: 0, maxHeight: bottomMaxRows, width: "100%", overflowY: "hidden", children: [
|
|
3903
|
+
!focusedOpen ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3510
3904
|
FocusedCliPanel,
|
|
3511
3905
|
{
|
|
3512
3906
|
rows,
|
|
@@ -3523,24 +3917,24 @@ function TerminalLayout({
|
|
|
3523
3917
|
...focusScrollRef === void 0 ? {} : { focusScrollRef }
|
|
3524
3918
|
}
|
|
3525
3919
|
),
|
|
3526
|
-
memoryReviews.length === 0 ? null : /* @__PURE__ */ (0,
|
|
3527
|
-
!activeSession ? null : /* @__PURE__ */ (0,
|
|
3528
|
-
pendingPrompts.length === 0 ? null : /* @__PURE__ */ (0,
|
|
3920
|
+
memoryReviews.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MemoryReviewCards, { reviews: memoryReviews, autoDismissSeconds: memoryAutoDismissSeconds }),
|
|
3921
|
+
!activeSession ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "cyan", wrap: "truncate-end", children: columns < 48 ? "Running \xB7 Enter queues \xB7 /queue list" : "Running \xB7 /queue manage \xB7 Enter queues next \xB7 /steer acts now" }),
|
|
3922
|
+
pendingPrompts.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "yellow", wrap: "truncate-end", children: [
|
|
3529
3923
|
"Pending (",
|
|
3530
3924
|
pendingPrompts.length,
|
|
3531
3925
|
") \xB7 /queue manage \xB7 ",
|
|
3532
3926
|
queuedPromptLabel(pendingPrompts.at(-1)),
|
|
3533
3927
|
" \xB7 Esc edit latest"
|
|
3534
3928
|
] }),
|
|
3535
|
-
/* @__PURE__ */ (0,
|
|
3536
|
-
imageAttachments.map((image, index) => /* @__PURE__ */ (0,
|
|
3929
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: "\u2500".repeat(dividerWidth) }),
|
|
3930
|
+
imageAttachments.map((image, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "cyan", wrap: "truncate-end", children: [
|
|
3537
3931
|
"[Image #",
|
|
3538
3932
|
index + 1,
|
|
3539
3933
|
"] ",
|
|
3540
3934
|
image.name ?? basename3(image.source.path)
|
|
3541
3935
|
] }, `${image.sha256}:${index}`)),
|
|
3542
|
-
clipboardNotice === void 0 ? null : /* @__PURE__ */ (0,
|
|
3543
|
-
/* @__PURE__ */ (0,
|
|
3936
|
+
clipboardNotice === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "yellow", wrap: "truncate-end", children: clipboardNotice }),
|
|
3937
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3544
3938
|
PromptLine,
|
|
3545
3939
|
{
|
|
3546
3940
|
input,
|
|
@@ -3552,7 +3946,7 @@ function TerminalLayout({
|
|
|
3552
3946
|
...onPromptCursorChange === void 0 ? {} : { onCursorChange: onPromptCursorChange }
|
|
3553
3947
|
}
|
|
3554
3948
|
),
|
|
3555
|
-
/* @__PURE__ */ (0,
|
|
3949
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3556
3950
|
FooterStatus,
|
|
3557
3951
|
{
|
|
3558
3952
|
hint: footerHint,
|
|
@@ -3571,9 +3965,9 @@ function FooterStatus({
|
|
|
3571
3965
|
}) {
|
|
3572
3966
|
const ide = ideFooterPresentation(ideContext);
|
|
3573
3967
|
const showIde = ide !== void 0 && (columns === void 0 || stringWidth(hint) + stringWidth(ide) + 3 <= columns);
|
|
3574
|
-
return /* @__PURE__ */ (0,
|
|
3575
|
-
/* @__PURE__ */ (0,
|
|
3576
|
-
!showIde ? null : /* @__PURE__ */ (0,
|
|
3968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "row", width: "100%", justifyContent: "space-between", children: [
|
|
3969
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { flexGrow: 1, flexShrink: 1, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, wrap: "truncate-end", children: hint }) }),
|
|
3970
|
+
!showIde ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { flexShrink: 0, marginLeft: 1, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "cyan", wrap: "truncate-end", children: [
|
|
3577
3971
|
"\u29C9 ",
|
|
3578
3972
|
ide
|
|
3579
3973
|
] }) })
|
|
@@ -3630,32 +4024,32 @@ function FocusedCliPanel({
|
|
|
3630
4024
|
const detailLines = approvalExpanded ? approvalDetailLines(approval) : [];
|
|
3631
4025
|
const chromeRows = 3 + (allowAlways && narrow && rows >= 5 ? 1 : 0);
|
|
3632
4026
|
const thirdHint = allowAlways && narrow && rows >= 5;
|
|
3633
|
-
return /* @__PURE__ */ (0,
|
|
3634
|
-
/* @__PURE__ */ (0,
|
|
4027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { width: "100%", height: panelRows, flexDirection: "column", flexShrink: 0, overflow: "hidden", children: [
|
|
4028
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { bold: true, color: "magenta", wrap: "truncate-end", children: [
|
|
3635
4029
|
"\u250C\u2500 ",
|
|
3636
4030
|
"Approval \xB7 ",
|
|
3637
4031
|
approval.tool
|
|
3638
4032
|
] }),
|
|
3639
|
-
/* @__PURE__ */ (0,
|
|
3640
|
-
/* @__PURE__ */ (0,
|
|
4033
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(ScrollBox_default, { ...focusScrollRef === void 0 ? {} : { ref: focusScrollRef }, height: Math.max(1, panelRows - chromeRows), flexDirection: "column", children: [
|
|
4034
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "magentaBright", wrap: "wrap", children: [
|
|
3641
4035
|
"\u2502 ",
|
|
3642
4036
|
approval.reason ?? "This action needs permission."
|
|
3643
4037
|
] }),
|
|
3644
|
-
approvalExpanded ? detailLines.map((line, index) => /* @__PURE__ */ (0,
|
|
4038
|
+
approvalExpanded ? detailLines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "magentaBright", wrap: "wrap", children: [
|
|
3645
4039
|
"\u2502 ",
|
|
3646
4040
|
line
|
|
3647
4041
|
] }, `${approval.id}:detail:${index}`)) : null
|
|
3648
4042
|
] }),
|
|
3649
|
-
/* @__PURE__ */ (0,
|
|
4043
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { bold: true, color: "magenta", wrap: "truncate-end", children: [
|
|
3650
4044
|
"\u2502 ",
|
|
3651
4045
|
narrow ? "y once \xB7 n deny" : "y=once \xB7 n=deny \xB7 Esc=deny"
|
|
3652
4046
|
] }),
|
|
3653
|
-
/* @__PURE__ */ (0,
|
|
4047
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "magenta", wrap: "truncate-end", children: [
|
|
3654
4048
|
thirdHint ? "\u2502 " : "\u2514\u2500 ",
|
|
3655
4049
|
narrow ? "v details \xB7 e edits" : "v=details \xB7 e=accept edits",
|
|
3656
4050
|
allowAlways && !narrow ? " \xB7 a=same-type" : ""
|
|
3657
4051
|
] }),
|
|
3658
|
-
thirdHint ? /* @__PURE__ */ (0,
|
|
4052
|
+
thirdHint ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "magenta", wrap: "truncate-end", children: [
|
|
3659
4053
|
"\u2514\u2500 ",
|
|
3660
4054
|
"a same-type \xB7 Esc deny"
|
|
3661
4055
|
] }) : null
|
|
@@ -3663,8 +4057,8 @@ function FocusedCliPanel({
|
|
|
3663
4057
|
}
|
|
3664
4058
|
const question = questions?.[Math.min(questionIndex, questions.length - 1)];
|
|
3665
4059
|
if (question !== void 0) {
|
|
3666
|
-
return /* @__PURE__ */ (0,
|
|
3667
|
-
/* @__PURE__ */ (0,
|
|
4060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { width: "100%", height: panelRows, flexDirection: "column", flexShrink: 0, overflow: "hidden", children: [
|
|
4061
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { bold: true, color: "cyan", wrap: "truncate-end", children: [
|
|
3668
4062
|
"\u250C\u2500 ",
|
|
3669
4063
|
"Question ",
|
|
3670
4064
|
questionIndex + 1,
|
|
@@ -3673,13 +4067,13 @@ function FocusedCliPanel({
|
|
|
3673
4067
|
" \xB7 ",
|
|
3674
4068
|
question.header
|
|
3675
4069
|
] }),
|
|
3676
|
-
/* @__PURE__ */ (0,
|
|
3677
|
-
/* @__PURE__ */ (0,
|
|
4070
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(ScrollBox_default, { ...focusScrollRef === void 0 ? {} : { ref: focusScrollRef }, height: Math.max(1, panelRows - 2), flexDirection: "column", children: [
|
|
4071
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "cyanBright", wrap: "wrap", children: [
|
|
3678
4072
|
"\u2502 ",
|
|
3679
4073
|
question.question
|
|
3680
4074
|
] }),
|
|
3681
|
-
question.options.map((option, index) => /* @__PURE__ */ (0,
|
|
3682
|
-
/* @__PURE__ */ (0,
|
|
4075
|
+
question.options.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "cyan", wrap: "wrap", children: [
|
|
4076
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { bold: true, color: "green", children: [
|
|
3683
4077
|
"\u2502 ",
|
|
3684
4078
|
index + 1,
|
|
3685
4079
|
". ",
|
|
@@ -3687,26 +4081,26 @@ function FocusedCliPanel({
|
|
|
3687
4081
|
] }),
|
|
3688
4082
|
option.description ? ` ${option.description}` : ""
|
|
3689
4083
|
] }, index)),
|
|
3690
|
-
/* @__PURE__ */ (0,
|
|
4084
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "cyan", children: [
|
|
3691
4085
|
"\u2502 ",
|
|
3692
4086
|
question.options.length + 1,
|
|
3693
4087
|
". Custom input"
|
|
3694
4088
|
] })
|
|
3695
4089
|
] }),
|
|
3696
|
-
/* @__PURE__ */ (0,
|
|
4090
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "cyan", wrap: "truncate-end", children: [
|
|
3697
4091
|
"\u2514\u2500 ",
|
|
3698
4092
|
customQuestionActive ? columns < 40 ? "Enter answer \xB7 Esc choices" : "Enter=answer \xB7 Esc=choices \xB7 PgUp/PgDn=scroll" : columns < 40 ? `1-${question.options.length + 1} choose \xB7 Esc cancel` : `1-${question.options.length + 1}=choose \xB7 Esc=cancel \xB7 PgUp/PgDn=scroll`
|
|
3699
4093
|
] })
|
|
3700
4094
|
] });
|
|
3701
4095
|
}
|
|
3702
|
-
return /* @__PURE__ */ (0,
|
|
3703
|
-
/* @__PURE__ */ (0,
|
|
4096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { width: "100%", height: panelRows, flexDirection: "column", flexShrink: 0, overflow: "hidden", children: [
|
|
4097
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { bold: true, color: "yellow", wrap: "truncate-end", children: [
|
|
3704
4098
|
"\u250C\u2500 ",
|
|
3705
4099
|
"Queued messages (",
|
|
3706
4100
|
pendingPrompts.length,
|
|
3707
4101
|
")"
|
|
3708
4102
|
] }),
|
|
3709
|
-
/* @__PURE__ */ (0,
|
|
4103
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ScrollBox_default, { ...focusScrollRef === void 0 ? {} : { ref: focusScrollRef }, height: Math.max(1, panelRows - 3), flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3710
4104
|
QueueItems,
|
|
3711
4105
|
{
|
|
3712
4106
|
items: pendingPrompts,
|
|
@@ -3715,11 +4109,11 @@ function FocusedCliPanel({
|
|
|
3715
4109
|
...onQueueSelectionChange === void 0 ? {} : { onSelect: onQueueSelectionChange }
|
|
3716
4110
|
}
|
|
3717
4111
|
) }),
|
|
3718
|
-
/* @__PURE__ */ (0,
|
|
4112
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { bold: true, color: "yellow", wrap: "truncate-end", children: [
|
|
3719
4113
|
"\u2502 ",
|
|
3720
4114
|
columns < 48 ? "Enter edit \xB7 d cancel" : "Enter=edit selected \xB7 d=cancel selected"
|
|
3721
4115
|
] }),
|
|
3722
|
-
/* @__PURE__ */ (0,
|
|
4116
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "yellow", wrap: "truncate-end", children: [
|
|
3723
4117
|
"\u2514\u2500 ",
|
|
3724
4118
|
columns < 48 ? "\u2191\u2193 select \xB7 Esc close" : "\u2191/\u2193=select \xB7 PgUp/PgDn=jump \xB7 Esc=close"
|
|
3725
4119
|
] })
|
|
@@ -3733,12 +4127,12 @@ function QueueItems({ items, selection, scrollRef, onSelect }) {
|
|
|
3733
4127
|
(0, import_react8.useEffect)(() => {
|
|
3734
4128
|
if (selectedElement.current !== null) scrollRef?.current?.scrollToElement(selectedElement.current);
|
|
3735
4129
|
}, [selection, items.length, scrollRef]);
|
|
3736
|
-
return /* @__PURE__ */ (0,
|
|
4130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { flexDirection: "column", width: "100%", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3737
4131
|
Box_default,
|
|
3738
4132
|
{
|
|
3739
4133
|
ref: index === selection ? selectedElement : void 0,
|
|
3740
4134
|
onClick: () => onSelect?.(index),
|
|
3741
|
-
children: /* @__PURE__ */ (0,
|
|
4135
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: index === selection ? "yellowBright" : void 0, bold: index === selection, wrap: "wrap", children: [
|
|
3742
4136
|
index === selection ? "\u276F" : " ",
|
|
3743
4137
|
" ",
|
|
3744
4138
|
index + 1,
|
|
@@ -3751,6 +4145,7 @@ function QueueItems({ items, selection, scrollRef, onSelect }) {
|
|
|
3751
4145
|
}
|
|
3752
4146
|
function MemoryReviewCards({ reviews, autoDismissSeconds }) {
|
|
3753
4147
|
const review = reviews[0];
|
|
4148
|
+
const modifier = memoryReviewModifierHint();
|
|
3754
4149
|
const [remaining, setRemaining] = (0, import_react8.useState)(autoDismissSeconds);
|
|
3755
4150
|
(0, import_react8.useEffect)(() => {
|
|
3756
4151
|
if (autoDismissSeconds <= 0) return;
|
|
@@ -3758,39 +4153,49 @@ function MemoryReviewCards({ reviews, autoDismissSeconds }) {
|
|
|
3758
4153
|
const timer = setInterval(() => setRemaining((current) => Math.max(0, current - 1)), 1e3);
|
|
3759
4154
|
return () => clearInterval(timer);
|
|
3760
4155
|
}, [review.id, autoDismissSeconds]);
|
|
3761
|
-
return /* @__PURE__ */ (0,
|
|
3762
|
-
/* @__PURE__ */ (0,
|
|
4156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
4157
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { bold: true, color: "yellow", children: [
|
|
3763
4158
|
"\u250C\u2500 Long-term memory requires confirmation (",
|
|
3764
4159
|
reviews.length,
|
|
3765
4160
|
")"
|
|
3766
4161
|
] }),
|
|
3767
|
-
/* @__PURE__ */ (0,
|
|
4162
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "yellowBright", wrap: "truncate-end", children: [
|
|
3768
4163
|
"\u2502 [",
|
|
3769
4164
|
review.type,
|
|
3770
4165
|
"] ",
|
|
3771
4166
|
review.content
|
|
3772
4167
|
] }),
|
|
3773
|
-
/* @__PURE__ */ (0,
|
|
3774
|
-
|
|
4168
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { dimColor: true, wrap: "truncate-end", children: [
|
|
4169
|
+
"\u2502 ",
|
|
4170
|
+
review.evidence === void 0 ? "No verified user quote; check before saving." : `User said: \u201C${review.evidence}\u201D`
|
|
4171
|
+
] }),
|
|
4172
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: "\u2502 Model-generated content is not stored until you approve it." }),
|
|
4173
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "yellow", children: [
|
|
3775
4174
|
"\u2514\u2500 ",
|
|
3776
|
-
/* @__PURE__ */ (0,
|
|
4175
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { bold: true, children: [
|
|
4176
|
+
modifier,
|
|
4177
|
+
"+Y"
|
|
4178
|
+
] }),
|
|
3777
4179
|
" save / ",
|
|
3778
|
-
/* @__PURE__ */ (0,
|
|
4180
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { bold: true, children: [
|
|
4181
|
+
modifier,
|
|
4182
|
+
"+N"
|
|
4183
|
+
] }),
|
|
3779
4184
|
" ignore",
|
|
3780
|
-
autoDismissSeconds > 0 ? /* @__PURE__ */ (0,
|
|
4185
|
+
autoDismissSeconds > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { bold: true, color: "cyanBright", children: ` (auto-dismiss in ${remaining}s)` }) : " (stays pending until reviewed)"
|
|
3781
4186
|
] })
|
|
3782
4187
|
] });
|
|
3783
4188
|
}
|
|
3784
4189
|
function SlashMenu({ completion }) {
|
|
3785
4190
|
const visible = completion.items.slice(completion.windowStart, completion.windowStart + 6);
|
|
3786
|
-
return /* @__PURE__ */ (0,
|
|
4191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { flexDirection: "column", width: "100%", children: visible.map((candidate, visibleIndex) => {
|
|
3787
4192
|
const index = completion.windowStart + visibleIndex;
|
|
3788
4193
|
const presentation = slashCandidatePresentation(index === completion.selectedIndex);
|
|
3789
|
-
return /* @__PURE__ */ (0,
|
|
4194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { ...presentation.rowStyle, wrap: "truncate-end", children: [
|
|
3790
4195
|
presentation.marker,
|
|
3791
|
-
/* @__PURE__ */ (0,
|
|
3792
|
-
candidate.kind === "skill" || candidate.kind === "plugin" ? /* @__PURE__ */ (0,
|
|
3793
|
-
candidate.description === void 0 ? null : /* @__PURE__ */ (0,
|
|
4196
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HighlightedName, { name: candidate.name, query: completion.query, matchStyle: presentation.matchStyle }),
|
|
4197
|
+
candidate.kind === "skill" || candidate.kind === "plugin" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: candidate.kind === "skill" ? "magentaBright" : "cyanBright", children: ` ${candidate.kind}` }) : null,
|
|
4198
|
+
candidate.description === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: ` ${normalizeSlashDescription(candidate.description)}` })
|
|
3794
4199
|
] }, `${candidate.kind}:${candidate.name}`);
|
|
3795
4200
|
}) });
|
|
3796
4201
|
}
|
|
@@ -3799,19 +4204,19 @@ function MentionMenu({
|
|
|
3799
4204
|
onSelect
|
|
3800
4205
|
}) {
|
|
3801
4206
|
const visible = completion.items.slice(completion.windowStart, completion.windowStart + 6);
|
|
3802
|
-
return /* @__PURE__ */ (0,
|
|
4207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { flexDirection: "column", width: "100%", children: visible.map((path, visibleIndex) => {
|
|
3803
4208
|
const index = completion.windowStart + visibleIndex;
|
|
3804
4209
|
const presentation = mentionCandidatePresentation(index === completion.selectedIndex);
|
|
3805
|
-
return /* @__PURE__ */ (0,
|
|
4210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3806
4211
|
Box_default,
|
|
3807
4212
|
{
|
|
3808
4213
|
width: "100%",
|
|
3809
4214
|
onClick: (event) => {
|
|
3810
4215
|
if (!event.cellIsBlank) onSelect?.(path);
|
|
3811
4216
|
},
|
|
3812
|
-
children: /* @__PURE__ */ (0,
|
|
4217
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { ...presentation.textStyle, wrap: "truncate-end", children: [
|
|
3813
4218
|
presentation.marker,
|
|
3814
|
-
presentation.highlightMatches ? /* @__PURE__ */ (0,
|
|
4219
|
+
presentation.highlightMatches ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HighlightedName, { name: path, query: completion.query, matchStyle: presentation.matchStyle }) : path
|
|
3815
4220
|
] })
|
|
3816
4221
|
},
|
|
3817
4222
|
path
|
|
@@ -3824,16 +4229,16 @@ function HighlightedName({
|
|
|
3824
4229
|
matchStyle
|
|
3825
4230
|
}) {
|
|
3826
4231
|
const ranges = matchRanges(name, query);
|
|
3827
|
-
if (ranges.length === 0) return /* @__PURE__ */ (0,
|
|
4232
|
+
if (ranges.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { children: name });
|
|
3828
4233
|
const parts = [];
|
|
3829
4234
|
let cursor = 0;
|
|
3830
4235
|
for (const [start, end] of ranges) {
|
|
3831
4236
|
if (start > cursor) parts.push(name.slice(cursor, start));
|
|
3832
|
-
parts.push(/* @__PURE__ */ (0,
|
|
4237
|
+
parts.push(/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { ...matchStyle, children: name.slice(start, end) }, `${start}:${end}`));
|
|
3833
4238
|
cursor = end;
|
|
3834
4239
|
}
|
|
3835
4240
|
if (cursor < name.length) parts.push(name.slice(cursor));
|
|
3836
|
-
return /* @__PURE__ */ (0,
|
|
4241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { children: parts });
|
|
3837
4242
|
}
|
|
3838
4243
|
function jumpScroll(scroll, delta) {
|
|
3839
4244
|
const maximum = Math.max(0, scroll.getScrollHeight() - scroll.getViewportHeight());
|
|
@@ -3876,7 +4281,7 @@ function scrollUp(scroll, amount) {
|
|
|
3876
4281
|
else scroll.scrollBy(-amount);
|
|
3877
4282
|
}
|
|
3878
4283
|
function TurnSeparator({ width }) {
|
|
3879
|
-
return /* @__PURE__ */ (0,
|
|
4284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: "\u2500".repeat(Math.max(1, width - 1)) });
|
|
3880
4285
|
}
|
|
3881
4286
|
var TurnView = import_react8.default.memo(function TurnView2({
|
|
3882
4287
|
turn,
|
|
@@ -3885,16 +4290,16 @@ var TurnView = import_react8.default.memo(function TurnView2({
|
|
|
3885
4290
|
expandedOutput
|
|
3886
4291
|
}) {
|
|
3887
4292
|
if (turn.kind === "compaction") {
|
|
3888
|
-
return /* @__PURE__ */ (0,
|
|
3889
|
-
/* @__PURE__ */ (0,
|
|
3890
|
-
turn.blocks.map((block, index) => block.kind === "status" ? /* @__PURE__ */ (0,
|
|
4293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, borderStyle: "round", borderColor: "ansi:yellowBright", paddingX: 1, children: [
|
|
4294
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:yellowBright", bold: true, children: turn.prompt }),
|
|
4295
|
+
turn.blocks.map((block, index) => block.kind === "status" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(StatusBlockView, { block, interactive, workspaceName, expandedOutput }, block.id) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AssistantText, { text: block.text }) }, `${turn.id}-text-${index}`))
|
|
3891
4296
|
] });
|
|
3892
4297
|
}
|
|
3893
4298
|
if (turn.source?.kind === "pal") {
|
|
3894
4299
|
const context = turn.source.context === void 0 ? "" : ` \xB7 ${turn.source.context}`;
|
|
3895
|
-
return /* @__PURE__ */ (0,
|
|
3896
|
-
/* @__PURE__ */ (0,
|
|
3897
|
-
/* @__PURE__ */ (0,
|
|
4300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
4301
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
|
|
4302
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "cyanBright", bold: true, children: [
|
|
3898
4303
|
"PAL \xB7 ",
|
|
3899
4304
|
turn.source.alias,
|
|
3900
4305
|
" (",
|
|
@@ -3902,20 +4307,20 @@ var TurnView = import_react8.default.memo(function TurnView2({
|
|
|
3902
4307
|
")",
|
|
3903
4308
|
context
|
|
3904
4309
|
] }),
|
|
3905
|
-
/* @__PURE__ */ (0,
|
|
4310
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:whiteBright", children: turn.prompt })
|
|
3906
4311
|
] }),
|
|
3907
|
-
/* @__PURE__ */ (0,
|
|
4312
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { flexDirection: "column", paddingLeft: 2, marginTop: 1, children: turn.blocks.map((block, index) => block.kind === "status" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(StatusBlockView, { block, interactive, workspaceName, expandedOutput }, block.id) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AssistantText, { text: block.text }) }, `${turn.id}-text-${index}`)) })
|
|
3908
4313
|
] });
|
|
3909
4314
|
}
|
|
3910
|
-
return /* @__PURE__ */ (0,
|
|
3911
|
-
/* @__PURE__ */ (0,
|
|
3912
|
-
/* @__PURE__ */ (0,
|
|
3913
|
-
/* @__PURE__ */ (0,
|
|
4315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
4316
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "row", backgroundColor: "#3a3a3a", paddingX: 1, paddingY: 0, children: [
|
|
4317
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:whiteBright", bold: true, backgroundColor: "#3a3a3a", children: "\u276F" }),
|
|
4318
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "ansi:whiteBright", bold: true, backgroundColor: "#3a3a3a", children: [
|
|
3914
4319
|
" ",
|
|
3915
4320
|
turn.prompt
|
|
3916
4321
|
] })
|
|
3917
4322
|
] }),
|
|
3918
|
-
/* @__PURE__ */ (0,
|
|
4323
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { flexDirection: "column", paddingLeft: 2, marginTop: 1, children: turn.blocks.map((block, index) => block.kind === "status" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(StatusBlockView, { block, interactive, workspaceName, expandedOutput }, block.id) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AssistantText, { text: block.text }) }, `${turn.id}-text-${index}`)) })
|
|
3919
4324
|
] });
|
|
3920
4325
|
});
|
|
3921
4326
|
var DIFF_CONTENT = fileDiffLineStyle("context").contentColor;
|
|
@@ -3924,11 +4329,11 @@ var DIFF_ADDED_MARKER = fileDiffLineStyle("added").markerColor;
|
|
|
3924
4329
|
function FileDiffView({ presentation, expanded }) {
|
|
3925
4330
|
const operation = presentation.operation === "create" ? "Create" : presentation.operation === "delete" ? "Delete" : "Update";
|
|
3926
4331
|
if (presentation.operation === "delete") {
|
|
3927
|
-
return /* @__PURE__ */ (0,
|
|
3928
|
-
/* @__PURE__ */ (0,
|
|
3929
|
-
/* @__PURE__ */ (0,
|
|
4332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
4333
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: DIFF_REMOVED_MARKER, children: "\u25CF" }),
|
|
4334
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: DIFF_CONTENT, children: [
|
|
3930
4335
|
" ",
|
|
3931
|
-
/* @__PURE__ */ (0,
|
|
4336
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { bold: true, children: operation }),
|
|
3932
4337
|
"(",
|
|
3933
4338
|
basename3(presentation.path),
|
|
3934
4339
|
")"
|
|
@@ -3936,29 +4341,29 @@ function FileDiffView({ presentation, expanded }) {
|
|
|
3936
4341
|
] });
|
|
3937
4342
|
}
|
|
3938
4343
|
const lineWidth = Math.max(1, ...presentation.lines.map((line) => Math.max(line.oldLine ?? 0, line.newLine ?? 0))).toString().length;
|
|
3939
|
-
return /* @__PURE__ */ (0,
|
|
3940
|
-
/* @__PURE__ */ (0,
|
|
3941
|
-
/* @__PURE__ */ (0,
|
|
3942
|
-
/* @__PURE__ */ (0,
|
|
4344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", width: "100%", children: [
|
|
4345
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
4346
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: DIFF_ADDED_MARKER, children: "\u25CF" }),
|
|
4347
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: DIFF_CONTENT, children: [
|
|
3943
4348
|
" ",
|
|
3944
|
-
/* @__PURE__ */ (0,
|
|
4349
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { bold: true, children: operation }),
|
|
3945
4350
|
"(",
|
|
3946
4351
|
basename3(presentation.path),
|
|
3947
4352
|
")"
|
|
3948
4353
|
] })
|
|
3949
4354
|
] }),
|
|
3950
|
-
/* @__PURE__ */ (0,
|
|
4355
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: DIFF_CONTENT, children: [
|
|
3951
4356
|
" \u2514 Added ",
|
|
3952
4357
|
lineCount(presentation.added),
|
|
3953
4358
|
", removed ",
|
|
3954
4359
|
lineCount(presentation.removed)
|
|
3955
4360
|
] }),
|
|
3956
|
-
(expanded ? presentation.lines : []).map((line, index) => /* @__PURE__ */ (0,
|
|
4361
|
+
(expanded ? presentation.lines : []).map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FileDiffRow, { line, lineWidth }, `${line.kind}:${line.oldLine ?? ""}:${line.newLine ?? ""}:${index}`))
|
|
3957
4362
|
] });
|
|
3958
4363
|
}
|
|
3959
4364
|
function FileDiffRow({ line, lineWidth }) {
|
|
3960
4365
|
if (line.kind === "omitted") {
|
|
3961
|
-
return /* @__PURE__ */ (0,
|
|
4366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: DIFF_CONTENT, dimColor: true, children: [
|
|
3962
4367
|
" ".repeat(lineWidth + 4),
|
|
3963
4368
|
line.text
|
|
3964
4369
|
] });
|
|
@@ -3967,14 +4372,14 @@ function FileDiffRow({ line, lineWidth }) {
|
|
|
3967
4372
|
const marker = line.kind === "removed" ? "-" : line.kind === "added" ? "+" : " ";
|
|
3968
4373
|
const { backgroundColor, markerColor, contentColor } = fileDiffLineStyle(line.kind);
|
|
3969
4374
|
const prefix = `${String(number ?? "").padStart(lineWidth)} ${marker}| `;
|
|
3970
|
-
return /* @__PURE__ */ (0,
|
|
4375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
3971
4376
|
Box_default,
|
|
3972
4377
|
{
|
|
3973
4378
|
flexDirection: "row",
|
|
3974
4379
|
width: "100%",
|
|
3975
4380
|
...backgroundColor === void 0 ? {} : { backgroundColor },
|
|
3976
4381
|
children: [
|
|
3977
|
-
/* @__PURE__ */ (0,
|
|
4382
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3978
4383
|
Text,
|
|
3979
4384
|
{
|
|
3980
4385
|
color: markerColor,
|
|
@@ -3983,7 +4388,7 @@ function FileDiffRow({ line, lineWidth }) {
|
|
|
3983
4388
|
children: prefix
|
|
3984
4389
|
}
|
|
3985
4390
|
),
|
|
3986
|
-
/* @__PURE__ */ (0,
|
|
4391
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3987
4392
|
Text,
|
|
3988
4393
|
{
|
|
3989
4394
|
color: contentColor,
|
|
@@ -3999,18 +4404,18 @@ function lineCount(count) {
|
|
|
3999
4404
|
return `${count} ${count === 1 ? "line" : "lines"}`;
|
|
4000
4405
|
}
|
|
4001
4406
|
function StatusLine({ block, interactive }) {
|
|
4002
|
-
if (block.progress !== void 0) return /* @__PURE__ */ (0,
|
|
4407
|
+
if (block.progress !== void 0) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CompactProgressLine, { progress: block.progress });
|
|
4003
4408
|
const running = block.state === "running";
|
|
4004
4409
|
const [ref, time] = useAnimationFrame(running && interactive ? 120 : null);
|
|
4005
4410
|
const color = statusLineColor(block);
|
|
4006
4411
|
const frames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
4007
4412
|
const spinner = running && interactive ? frames[Math.floor(Math.max(0, time) / 120) % frames.length] + " " : "";
|
|
4008
|
-
return /* @__PURE__ */ (0,
|
|
4009
|
-
/* @__PURE__ */ (0,
|
|
4413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { ref, flexDirection: "row", children: [
|
|
4414
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { ...color === void 0 ? { dimColor: true } : { color }, children: [
|
|
4010
4415
|
spinner,
|
|
4011
4416
|
block.text
|
|
4012
4417
|
] }),
|
|
4013
|
-
block.hint === void 0 ? null : /* @__PURE__ */ (0,
|
|
4418
|
+
block.hint === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { dimColor: true, wrap: "truncate-end", children: [
|
|
4014
4419
|
" (",
|
|
4015
4420
|
block.hint,
|
|
4016
4421
|
")"
|
|
@@ -4026,13 +4431,13 @@ function statusLineColor(block) {
|
|
|
4026
4431
|
}
|
|
4027
4432
|
function CompactProgressLine({ progress }) {
|
|
4028
4433
|
const presentation = compactProgressPresentation(progress);
|
|
4029
|
-
return /* @__PURE__ */ (0,
|
|
4030
|
-
/* @__PURE__ */ (0,
|
|
4031
|
-
presentation.cells.map((cell, index) => /* @__PURE__ */ (0,
|
|
4434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
4435
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { children: "Compacting context " }),
|
|
4436
|
+
presentation.cells.map((cell, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: cell.color, children: [
|
|
4032
4437
|
"\u25A0",
|
|
4033
4438
|
index === presentation.cells.length - 1 ? "" : " "
|
|
4034
4439
|
] }, index)),
|
|
4035
|
-
/* @__PURE__ */ (0,
|
|
4440
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { dimColor: true, children: [
|
|
4036
4441
|
" ",
|
|
4037
4442
|
presentation.progress,
|
|
4038
4443
|
"%"
|
|
@@ -4063,13 +4468,13 @@ function PromptLine({
|
|
|
4063
4468
|
lineStarts.push(nextLineStart);
|
|
4064
4469
|
nextLineStart += [...line].length;
|
|
4065
4470
|
}
|
|
4066
|
-
return /* @__PURE__ */ (0,
|
|
4471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { width: "100%", flexDirection: "column", paddingX: PROMPT_HORIZONTAL_PADDING, children: visibleLines.map((line, visibleIndex) => {
|
|
4067
4472
|
const lineIndex = windowStart + visibleIndex;
|
|
4068
4473
|
const isCursorLine = lineIndex === wrap.cursor.line;
|
|
4069
4474
|
const points = [...line];
|
|
4070
4475
|
const cursorCol = wrap.cursor.column;
|
|
4071
4476
|
const styledCount = Math.max(0, Math.min(points.length, tokenLength - (lineStarts[lineIndex] ?? 0)));
|
|
4072
|
-
return /* @__PURE__ */ (0,
|
|
4477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
4073
4478
|
Box_default,
|
|
4074
4479
|
{
|
|
4075
4480
|
...onCursorChange === void 0 ? {} : {
|
|
@@ -4083,8 +4488,8 @@ function PromptLine({
|
|
|
4083
4488
|
}
|
|
4084
4489
|
},
|
|
4085
4490
|
children: [
|
|
4086
|
-
/* @__PURE__ */ (0,
|
|
4087
|
-
/* @__PURE__ */ (0,
|
|
4491
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "yellow", bold: true, children: lineIndex === 0 ? "\u276F " : " " }),
|
|
4492
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PromptLineContent, { points, cursor: cursorCol, cursorVisible: isCursorLine, styledCount })
|
|
4088
4493
|
]
|
|
4089
4494
|
},
|
|
4090
4495
|
lineIndex
|
|
@@ -4100,14 +4505,14 @@ function StatusBlockView({
|
|
|
4100
4505
|
const visibleBlock = cliToolTitle(block);
|
|
4101
4506
|
const outcome = cliToolOutcome(block);
|
|
4102
4507
|
const toolOutput = block.tool !== void 0 || block.presentation !== void 0;
|
|
4103
|
-
const primary = visibleBlock.activity === "model" || visibleBlock.task !== void 0 ? /* @__PURE__ */ (0,
|
|
4104
|
-
return /* @__PURE__ */ (0,
|
|
4508
|
+
const primary = visibleBlock.activity === "model" || visibleBlock.task !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TaskStatusLine, { block: visibleBlock, interactive }) : visibleBlock.state === "completed" && visibleBlock.presentation !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ToolPresentationView, { presentation: visibleBlock.presentation, workspaceName, expandedOutput }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(StatusLine, { block: visibleBlock, interactive });
|
|
4509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
4105
4510
|
primary,
|
|
4106
|
-
outcome === void 0 ? null : /* @__PURE__ */ (0,
|
|
4511
|
+
outcome === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { dimColor: true, children: [
|
|
4107
4512
|
"\u2514 ",
|
|
4108
4513
|
outcome
|
|
4109
4514
|
] }) }),
|
|
4110
|
-
block.details === void 0 || block.presentation?.kind === "changeset" || toolOutput && !expandedOutput ? null : /* @__PURE__ */ (0,
|
|
4515
|
+
block.details === void 0 || block.presentation?.kind === "changeset" || toolOutput && !expandedOutput ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AssistantText, { text: block.details }) })
|
|
4111
4516
|
] });
|
|
4112
4517
|
}
|
|
4113
4518
|
function ToolPresentationView({
|
|
@@ -4115,17 +4520,17 @@ function ToolPresentationView({
|
|
|
4115
4520
|
workspaceName,
|
|
4116
4521
|
expandedOutput
|
|
4117
4522
|
}) {
|
|
4118
|
-
if (presentation.kind === "changeset") return /* @__PURE__ */ (0,
|
|
4119
|
-
if (presentation.kind === "file-change") return /* @__PURE__ */ (0,
|
|
4120
|
-
if (presentation.kind === "terminal") return /* @__PURE__ */ (0,
|
|
4121
|
-
if (presentation.kind === "web") return /* @__PURE__ */ (0,
|
|
4122
|
-
if (presentation.kind === "job") return /* @__PURE__ */ (0,
|
|
4123
|
-
return /* @__PURE__ */ (0,
|
|
4124
|
-
/* @__PURE__ */ (0,
|
|
4523
|
+
if (presentation.kind === "changeset") return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ChangeSetPresentationView, { presentation, workspaceName, expanded: expandedOutput });
|
|
4524
|
+
if (presentation.kind === "file-change") return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FileDiffView, { presentation, expanded: expandedOutput });
|
|
4525
|
+
if (presentation.kind === "terminal") return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CommandPresentationView, { presentation, expanded: expandedOutput });
|
|
4526
|
+
if (presentation.kind === "web") return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WebPresentationView, { presentation, expanded: expandedOutput });
|
|
4527
|
+
if (presentation.kind === "job") return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(JobPresentationView, { presentation, expanded: expandedOutput });
|
|
4528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, children: [
|
|
4529
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { children: [
|
|
4125
4530
|
presentation.title,
|
|
4126
4531
|
presentation.summary ? ` \xB7 ${presentation.summary}` : ""
|
|
4127
4532
|
] }),
|
|
4128
|
-
!expandedOutput || presentation.details === void 0 ? null : /* @__PURE__ */ (0,
|
|
4533
|
+
!expandedOutput || presentation.details === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AssistantText, { text: presentation.details })
|
|
4129
4534
|
] });
|
|
4130
4535
|
}
|
|
4131
4536
|
var CHANGESET_TONE = "#b99bf8";
|
|
@@ -4139,10 +4544,10 @@ function ChangeSetPresentationView({
|
|
|
4139
4544
|
const removed = presentation.files.reduce((total, file) => total + file.removed, 0);
|
|
4140
4545
|
const fileLabel = presentation.files.length === 1 ? "FILE" : "FILES";
|
|
4141
4546
|
const showing = presentation.files.length > visibleFiles.length ? ` \xB7 Showing ${visibleFiles.length} of ${presentation.files.length}` : "";
|
|
4142
|
-
return /* @__PURE__ */ (0,
|
|
4143
|
-
/* @__PURE__ */ (0,
|
|
4144
|
-
/* @__PURE__ */ (0,
|
|
4145
|
-
/* @__PURE__ */ (0,
|
|
4547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
|
|
4548
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4549
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: CHANGESET_TONE, children: "\u250C\u2500 " }),
|
|
4550
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: CHANGESET_TONE, bold: true, children: [
|
|
4146
4551
|
"CHANGESET \xB7 ",
|
|
4147
4552
|
presentation.files.length,
|
|
4148
4553
|
" ",
|
|
@@ -4152,37 +4557,37 @@ function ChangeSetPresentationView({
|
|
|
4152
4557
|
visibleFiles.map((file) => {
|
|
4153
4558
|
const operation = file.operation.toUpperCase();
|
|
4154
4559
|
const stats = `+${file.added} -${file.removed}`;
|
|
4155
|
-
return /* @__PURE__ */ (0,
|
|
4156
|
-
/* @__PURE__ */ (0,
|
|
4157
|
-
/* @__PURE__ */ (0,
|
|
4158
|
-
/* @__PURE__ */ (0,
|
|
4159
|
-
/* @__PURE__ */ (0,
|
|
4560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4561
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: CHANGESET_TONE, children: "\u2502 " }),
|
|
4562
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: changeSetOperationColor(file.operation), bold: true, children: operation.padEnd(8) }),
|
|
4563
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { children: [
|
|
4564
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "ansi:green", children: [
|
|
4160
4565
|
"+",
|
|
4161
4566
|
file.added
|
|
4162
4567
|
] }),
|
|
4163
4568
|
" ",
|
|
4164
|
-
/* @__PURE__ */ (0,
|
|
4569
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "#e06c50", children: [
|
|
4165
4570
|
"-",
|
|
4166
4571
|
file.removed
|
|
4167
4572
|
] }),
|
|
4168
4573
|
" ".repeat(Math.max(1, 9 - stats.length))
|
|
4169
4574
|
] }),
|
|
4170
|
-
/* @__PURE__ */ (0,
|
|
4575
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:whiteBright", wrap: "truncate-end", children: workspaceRelativePath(file.path, workspaceName) })
|
|
4171
4576
|
] }, `${file.operation}:${file.path}`);
|
|
4172
4577
|
}),
|
|
4173
|
-
/* @__PURE__ */ (0,
|
|
4174
|
-
/* @__PURE__ */ (0,
|
|
4175
|
-
/* @__PURE__ */ (0,
|
|
4176
|
-
/* @__PURE__ */ (0,
|
|
4578
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4579
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: CHANGESET_TONE, children: "\u2514\u2500 " }),
|
|
4580
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { children: [
|
|
4581
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "ansi:green", children: [
|
|
4177
4582
|
"+",
|
|
4178
4583
|
added
|
|
4179
4584
|
] }),
|
|
4180
4585
|
" ",
|
|
4181
|
-
/* @__PURE__ */ (0,
|
|
4586
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "#e06c50", children: [
|
|
4182
4587
|
"-",
|
|
4183
4588
|
removed
|
|
4184
4589
|
] }),
|
|
4185
|
-
/* @__PURE__ */ (0,
|
|
4590
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: showing })
|
|
4186
4591
|
] })
|
|
4187
4592
|
] })
|
|
4188
4593
|
] });
|
|
@@ -4211,28 +4616,28 @@ function CommandPresentationView({
|
|
|
4211
4616
|
const perStreamLimit = expanded ? Number.POSITIVE_INFINITY : 0;
|
|
4212
4617
|
const stdout = boundedCommandLines(presentation.stdout ?? "", perStreamLimit);
|
|
4213
4618
|
const stderr = boundedCommandLines(presentation.stderr ?? "", perStreamLimit);
|
|
4214
|
-
return /* @__PURE__ */ (0,
|
|
4215
|
-
/* @__PURE__ */ (0,
|
|
4216
|
-
/* @__PURE__ */ (0,
|
|
4217
|
-
/* @__PURE__ */ (0,
|
|
4619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
|
|
4620
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4621
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u250C\u2500 " }),
|
|
4622
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: tone, bold: true, children: [
|
|
4218
4623
|
label,
|
|
4219
4624
|
" \xB7 ",
|
|
4220
4625
|
state.toUpperCase()
|
|
4221
4626
|
] })
|
|
4222
4627
|
] }),
|
|
4223
|
-
/* @__PURE__ */ (0,
|
|
4224
|
-
/* @__PURE__ */ (0,
|
|
4225
|
-
/* @__PURE__ */ (0,
|
|
4628
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4629
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2502 " }),
|
|
4630
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:whiteBright", bold: true, wrap: "truncate-end", children: presentation.command ?? presentation.title })
|
|
4226
4631
|
] }),
|
|
4227
|
-
stdout.total === 0 ? null : /* @__PURE__ */ (0,
|
|
4228
|
-
stderr.total === 0 ? null : /* @__PURE__ */ (0,
|
|
4229
|
-
!expanded || presentation.diagnostic === void 0 ? null : /* @__PURE__ */ (0,
|
|
4230
|
-
/* @__PURE__ */ (0,
|
|
4231
|
-
/* @__PURE__ */ (0,
|
|
4632
|
+
stdout.total === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CommandOutputSection, { label: "OUTPUT", value: stdout, tone, error: false }),
|
|
4633
|
+
stderr.total === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CommandOutputSection, { label: "ERROR", value: stderr, tone, error: true }),
|
|
4634
|
+
!expanded || presentation.diagnostic === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4635
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2502 " }),
|
|
4636
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: presentation.diagnostic })
|
|
4232
4637
|
] }),
|
|
4233
|
-
/* @__PURE__ */ (0,
|
|
4234
|
-
/* @__PURE__ */ (0,
|
|
4235
|
-
/* @__PURE__ */ (0,
|
|
4638
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4639
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2514\u2500 " }),
|
|
4640
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: commandFooter(presentation, state) })
|
|
4236
4641
|
] })
|
|
4237
4642
|
] });
|
|
4238
4643
|
}
|
|
@@ -4242,17 +4647,17 @@ function CommandOutputSection({
|
|
|
4242
4647
|
tone,
|
|
4243
4648
|
error
|
|
4244
4649
|
}) {
|
|
4245
|
-
return /* @__PURE__ */ (0,
|
|
4246
|
-
/* @__PURE__ */ (0,
|
|
4247
|
-
/* @__PURE__ */ (0,
|
|
4248
|
-
/* @__PURE__ */ (0,
|
|
4249
|
-
/* @__PURE__ */ (0,
|
|
4250
|
-
value.hidden === 0 ? null : /* @__PURE__ */ (0,
|
|
4650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
4651
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4652
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u251C\u2500 " }),
|
|
4653
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: error ? "#e06c50" : tone, bold: true, children: label }),
|
|
4654
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: ` \xB7 ${value.total} ${value.total === 1 ? "LINE" : "LINES"}` }),
|
|
4655
|
+
value.hidden === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: ` \xB7 ${value.head.length + value.tail.length} SHOWN` })
|
|
4251
4656
|
] }),
|
|
4252
|
-
value.head.map((line, index) => /* @__PURE__ */ (0,
|
|
4253
|
-
value.hidden === 0 ? null : /* @__PURE__ */ (0,
|
|
4254
|
-
/* @__PURE__ */ (0,
|
|
4255
|
-
/* @__PURE__ */ (0,
|
|
4657
|
+
value.head.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CommandOutputLine, { line, tone, error }, `head:${index}`)),
|
|
4658
|
+
value.hidden === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4659
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2502 " }),
|
|
4660
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { dimColor: true, children: [
|
|
4256
4661
|
"\u2026 ",
|
|
4257
4662
|
value.hidden,
|
|
4258
4663
|
" ",
|
|
@@ -4260,13 +4665,13 @@ function CommandOutputSection({
|
|
|
4260
4665
|
" hidden"
|
|
4261
4666
|
] })
|
|
4262
4667
|
] }),
|
|
4263
|
-
value.tail.map((line, index) => /* @__PURE__ */ (0,
|
|
4668
|
+
value.tail.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CommandOutputLine, { line, tone, error }, `tail:${index}`))
|
|
4264
4669
|
] });
|
|
4265
4670
|
}
|
|
4266
4671
|
function CommandOutputLine({ line, tone, error }) {
|
|
4267
|
-
return /* @__PURE__ */ (0,
|
|
4268
|
-
/* @__PURE__ */ (0,
|
|
4269
|
-
/* @__PURE__ */ (0,
|
|
4672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4673
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2502 " }),
|
|
4674
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: error ? "#e06c50" : "#b8bcc2", wrap: "truncate-end", children: line === "" ? " " : line })
|
|
4270
4675
|
] });
|
|
4271
4676
|
}
|
|
4272
4677
|
function boundedCommandLines(output, limit) {
|
|
@@ -4296,51 +4701,51 @@ function WebPresentationView({
|
|
|
4296
4701
|
expanded
|
|
4297
4702
|
}) {
|
|
4298
4703
|
const items = presentation.items ?? [];
|
|
4299
|
-
if (presentation.items === void 0) return /* @__PURE__ */ (0,
|
|
4300
|
-
/* @__PURE__ */ (0,
|
|
4301
|
-
/* @__PURE__ */ (0,
|
|
4302
|
-
/* @__PURE__ */ (0,
|
|
4303
|
-
presentation.summary === void 0 ? null : /* @__PURE__ */ (0,
|
|
4704
|
+
if (presentation.items === void 0) return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
|
|
4705
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4706
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#5f87af", children: "\u250C\u2500 " }),
|
|
4707
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:cyanBright", bold: true, children: "WEB FETCH" }),
|
|
4708
|
+
presentation.summary === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: ` \xB7 ${presentation.summary}` })
|
|
4304
4709
|
] }),
|
|
4305
|
-
/* @__PURE__ */ (0,
|
|
4306
|
-
/* @__PURE__ */ (0,
|
|
4307
|
-
/* @__PURE__ */ (0,
|
|
4710
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4711
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#5f87af", children: "\u2502 " }),
|
|
4712
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:whiteBright", wrap: "truncate-end", children: presentation.url ?? presentation.title })
|
|
4308
4713
|
] }),
|
|
4309
|
-
/* @__PURE__ */ (0,
|
|
4310
|
-
/* @__PURE__ */ (0,
|
|
4311
|
-
/* @__PURE__ */ (0,
|
|
4714
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4715
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#5f87af", children: "\u2514\u2500 " }),
|
|
4716
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: "Page content added to context" })
|
|
4312
4717
|
] })
|
|
4313
4718
|
] });
|
|
4314
4719
|
const visibleItems = expanded ? items : [];
|
|
4315
4720
|
const query = presentation.title.replace(/^Search:\s*/iu, "").trim();
|
|
4316
|
-
return /* @__PURE__ */ (0,
|
|
4317
|
-
/* @__PURE__ */ (0,
|
|
4318
|
-
/* @__PURE__ */ (0,
|
|
4319
|
-
/* @__PURE__ */ (0,
|
|
4320
|
-
/* @__PURE__ */ (0,
|
|
4721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
|
|
4722
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4723
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#5f87af", children: "\u250C\u2500 " }),
|
|
4724
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:cyanBright", bold: true, children: "WEB SEARCH" }),
|
|
4725
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: ` \xB7 ${items.length} ${items.length === 1 ? "RESULT" : "RESULTS"}` })
|
|
4321
4726
|
] }),
|
|
4322
|
-
/* @__PURE__ */ (0,
|
|
4323
|
-
/* @__PURE__ */ (0,
|
|
4324
|
-
/* @__PURE__ */ (0,
|
|
4727
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4728
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#5f87af", children: "\u2502 " }),
|
|
4729
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:whiteBright", bold: true, wrap: "truncate-end", children: query })
|
|
4325
4730
|
] }),
|
|
4326
|
-
/* @__PURE__ */ (0,
|
|
4327
|
-
visibleItems.map((item, index) => /* @__PURE__ */ (0,
|
|
4328
|
-
/* @__PURE__ */ (0,
|
|
4329
|
-
/* @__PURE__ */ (0,
|
|
4330
|
-
/* @__PURE__ */ (0,
|
|
4331
|
-
/* @__PURE__ */ (0,
|
|
4731
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#5f87af", children: "\u2502" }),
|
|
4732
|
+
visibleItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
4733
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4734
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#5f87af", children: "\u2502 " }),
|
|
4735
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:cyanBright", bold: true, children: String(index + 1).padStart(2, "0") }),
|
|
4736
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "ansi:whiteBright", wrap: "truncate-end", children: [
|
|
4332
4737
|
" ",
|
|
4333
4738
|
item.title
|
|
4334
4739
|
] })
|
|
4335
4740
|
] }),
|
|
4336
|
-
/* @__PURE__ */ (0,
|
|
4337
|
-
/* @__PURE__ */ (0,
|
|
4338
|
-
/* @__PURE__ */ (0,
|
|
4741
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4742
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#5f87af", children: "\u2502 " }),
|
|
4743
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, wrap: "truncate-end", children: compactWebSource(item.url) })
|
|
4339
4744
|
] })
|
|
4340
4745
|
] }, item.url)),
|
|
4341
|
-
/* @__PURE__ */ (0,
|
|
4342
|
-
/* @__PURE__ */ (0,
|
|
4343
|
-
/* @__PURE__ */ (0,
|
|
4746
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4747
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#5f87af", children: "\u2514\u2500 " }),
|
|
4748
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: items.length > visibleItems.length ? `Showing ${visibleItems.length} of ${items.length}` : `${items.length} ${items.length === 1 ? "source" : "sources"}` })
|
|
4344
4749
|
] })
|
|
4345
4750
|
] });
|
|
4346
4751
|
}
|
|
@@ -4358,43 +4763,43 @@ function JobPresentationView({
|
|
|
4358
4763
|
presentation,
|
|
4359
4764
|
expanded
|
|
4360
4765
|
}) {
|
|
4361
|
-
if (presentation.action === "list") return /* @__PURE__ */ (0,
|
|
4766
|
+
if (presentation.action === "list") return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(JobListPresentationView, { presentation, expanded });
|
|
4362
4767
|
const state = presentation.state ?? "running";
|
|
4363
4768
|
const tone = jobStateColor(state);
|
|
4364
4769
|
const lines = jobOutputLines(presentation.output ?? "");
|
|
4365
4770
|
const visibleLines = expanded ? lines : [];
|
|
4366
4771
|
const hiddenLines = lines.length - visibleLines.length;
|
|
4367
4772
|
const showLog = presentation.action === "read" || presentation.action === "kill" || lines.length > 0;
|
|
4368
|
-
return /* @__PURE__ */ (0,
|
|
4369
|
-
/* @__PURE__ */ (0,
|
|
4370
|
-
/* @__PURE__ */ (0,
|
|
4371
|
-
/* @__PURE__ */ (0,
|
|
4773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
|
|
4774
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4775
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u250C\u2500 " }),
|
|
4776
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: tone, bold: true, children: [
|
|
4372
4777
|
"JOB \xB7 ",
|
|
4373
4778
|
state.toUpperCase()
|
|
4374
4779
|
] })
|
|
4375
4780
|
] }),
|
|
4376
|
-
/* @__PURE__ */ (0,
|
|
4377
|
-
/* @__PURE__ */ (0,
|
|
4378
|
-
/* @__PURE__ */ (0,
|
|
4379
|
-
presentation.jobKind === void 0 ? null : /* @__PURE__ */ (0,
|
|
4781
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4782
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2502 " }),
|
|
4783
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:whiteBright", bold: true, children: presentation.id ?? "unknown job" }),
|
|
4784
|
+
presentation.jobKind === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: ` \xB7 ${presentation.jobKind}` })
|
|
4380
4785
|
] }),
|
|
4381
|
-
presentation.label === void 0 ? null : /* @__PURE__ */ (0,
|
|
4382
|
-
/* @__PURE__ */ (0,
|
|
4383
|
-
/* @__PURE__ */ (0,
|
|
4786
|
+
presentation.label === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4787
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2502 " }),
|
|
4788
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:whiteBright", wrap: "truncate-end", children: presentation.label })
|
|
4384
4789
|
] }),
|
|
4385
|
-
presentation.error === void 0 ? null : /* @__PURE__ */ (0,
|
|
4386
|
-
/* @__PURE__ */ (0,
|
|
4387
|
-
/* @__PURE__ */ (0,
|
|
4790
|
+
presentation.error === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4791
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2502 " }),
|
|
4792
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#e06c50", wrap: "truncate-end", children: presentation.error })
|
|
4388
4793
|
] }),
|
|
4389
|
-
showLog ? /* @__PURE__ */ (0,
|
|
4390
|
-
/* @__PURE__ */ (0,
|
|
4391
|
-
/* @__PURE__ */ (0,
|
|
4392
|
-
/* @__PURE__ */ (0,
|
|
4393
|
-
/* @__PURE__ */ (0,
|
|
4794
|
+
showLog ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
4795
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4796
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u251C\u2500 " }),
|
|
4797
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, bold: true, children: "LOG" }),
|
|
4798
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: lines.length === 0 ? " \xB7 NO NEW OUTPUT" : ` \xB7 ${lines.length} ${lines.length === 1 ? "LINE" : "LINES"}` })
|
|
4394
4799
|
] }),
|
|
4395
|
-
hiddenLines > 0 ? /* @__PURE__ */ (0,
|
|
4396
|
-
/* @__PURE__ */ (0,
|
|
4397
|
-
/* @__PURE__ */ (0,
|
|
4800
|
+
hiddenLines > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4801
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2502 " }),
|
|
4802
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { dimColor: true, children: [
|
|
4398
4803
|
"\u2026 ",
|
|
4399
4804
|
hiddenLines,
|
|
4400
4805
|
" earlier ",
|
|
@@ -4402,11 +4807,11 @@ function JobPresentationView({
|
|
|
4402
4807
|
" hidden"
|
|
4403
4808
|
] })
|
|
4404
4809
|
] }) : null,
|
|
4405
|
-
visibleLines.map((line, index) => /* @__PURE__ */ (0,
|
|
4810
|
+
visibleLines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(JobLogLine, { line, tone }, `${index}:${line}`))
|
|
4406
4811
|
] }) : null,
|
|
4407
|
-
/* @__PURE__ */ (0,
|
|
4408
|
-
/* @__PURE__ */ (0,
|
|
4409
|
-
/* @__PURE__ */ (0,
|
|
4812
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4813
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2514\u2500 " }),
|
|
4814
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: jobFooter(presentation) })
|
|
4410
4815
|
] })
|
|
4411
4816
|
] });
|
|
4412
4817
|
}
|
|
@@ -4416,41 +4821,41 @@ function JobListPresentationView({
|
|
|
4416
4821
|
}) {
|
|
4417
4822
|
const jobs = presentation.jobs ?? [];
|
|
4418
4823
|
const visibleJobs = expanded ? jobs : [];
|
|
4419
|
-
return /* @__PURE__ */ (0,
|
|
4420
|
-
/* @__PURE__ */ (0,
|
|
4421
|
-
/* @__PURE__ */ (0,
|
|
4422
|
-
/* @__PURE__ */ (0,
|
|
4824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
|
|
4825
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4826
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#d7a657", children: "\u250C\u2500 " }),
|
|
4827
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "#d7a657", bold: true, children: [
|
|
4423
4828
|
"JOBS \xB7 ",
|
|
4424
4829
|
jobs.length
|
|
4425
4830
|
] })
|
|
4426
4831
|
] }),
|
|
4427
|
-
jobs.length === 0 ? /* @__PURE__ */ (0,
|
|
4428
|
-
/* @__PURE__ */ (0,
|
|
4429
|
-
/* @__PURE__ */ (0,
|
|
4430
|
-
] }) : visibleJobs.map((job) => /* @__PURE__ */ (0,
|
|
4431
|
-
/* @__PURE__ */ (0,
|
|
4432
|
-
/* @__PURE__ */ (0,
|
|
4433
|
-
/* @__PURE__ */ (0,
|
|
4832
|
+
jobs.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4833
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#d7a657", children: "\u2502 " }),
|
|
4834
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: "No background jobs" })
|
|
4835
|
+
] }) : visibleJobs.map((job) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4836
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#d7a657", children: "\u2502 " }),
|
|
4837
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: jobStateColor(job.state), bold: true, children: job.state.toUpperCase().padEnd(9) }),
|
|
4838
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "ansi:whiteBright", children: [
|
|
4434
4839
|
" ",
|
|
4435
4840
|
job.id
|
|
4436
4841
|
] }),
|
|
4437
|
-
/* @__PURE__ */ (0,
|
|
4842
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { dimColor: true, wrap: "truncate-end", children: [
|
|
4438
4843
|
" \xB7 ",
|
|
4439
4844
|
job.label
|
|
4440
4845
|
] })
|
|
4441
4846
|
] }, job.id)),
|
|
4442
|
-
/* @__PURE__ */ (0,
|
|
4443
|
-
/* @__PURE__ */ (0,
|
|
4444
|
-
/* @__PURE__ */ (0,
|
|
4847
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4848
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#d7a657", children: "\u2514\u2500 " }),
|
|
4849
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: jobs.length > visibleJobs.length ? `Showing ${visibleJobs.length} of ${jobs.length}` : `${jobs.length} ${jobs.length === 1 ? "job" : "jobs"}` })
|
|
4445
4850
|
] })
|
|
4446
4851
|
] });
|
|
4447
4852
|
}
|
|
4448
4853
|
function JobLogLine({ line, tone }) {
|
|
4449
4854
|
const error = /^(?:\[stderr\]|ERR(?:OR)?(?:!|:|\s)|npm ERR!)/iu.test(line.trimStart());
|
|
4450
4855
|
const stage = /^={3}.*={3}$/u.test(line.trim());
|
|
4451
|
-
return /* @__PURE__ */ (0,
|
|
4452
|
-
/* @__PURE__ */ (0,
|
|
4453
|
-
/* @__PURE__ */ (0,
|
|
4856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4857
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2502 " }),
|
|
4858
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4454
4859
|
Text,
|
|
4455
4860
|
{
|
|
4456
4861
|
...error ? { color: "#e06c50" } : stage ? { color: "ansi:cyanBright", bold: true } : { dimColor: true },
|
|
@@ -4622,11 +5027,11 @@ function PromptLineContent({
|
|
|
4622
5027
|
styledCount
|
|
4623
5028
|
}) {
|
|
4624
5029
|
const tokenStyle = completedSlashTokenPresentation();
|
|
4625
|
-
return /* @__PURE__ */ (0,
|
|
5030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { children: [
|
|
4626
5031
|
points.map((point, index) => {
|
|
4627
5032
|
const styled = index < styledCount;
|
|
4628
5033
|
const caret = cursorVisible && index === cursor;
|
|
4629
|
-
return /* @__PURE__ */ (0,
|
|
5034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4630
5035
|
Text,
|
|
4631
5036
|
{
|
|
4632
5037
|
...styled ? tokenStyle : {},
|
|
@@ -4636,7 +5041,7 @@ function PromptLineContent({
|
|
|
4636
5041
|
index
|
|
4637
5042
|
);
|
|
4638
5043
|
}),
|
|
4639
|
-
cursorVisible && cursor >= points.length ? /* @__PURE__ */ (0,
|
|
5044
|
+
cursorVisible && cursor >= points.length ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { inverse: true, children: " " }) : null
|
|
4640
5045
|
] });
|
|
4641
5046
|
}
|
|
4642
5047
|
function editPrompt(state, edit) {
|
|
@@ -4786,6 +5191,8 @@ export {
|
|
|
4786
5191
|
isPlatformShortcut,
|
|
4787
5192
|
jumpScroll,
|
|
4788
5193
|
jumpToAdjacentTurn,
|
|
5194
|
+
memoryReviewAction,
|
|
5195
|
+
memoryReviewModifierHint,
|
|
4789
5196
|
navigateHistory,
|
|
4790
5197
|
navigatePromptHistory,
|
|
4791
5198
|
outputToggleShortcut,
|