flavor-code 1.4.4-beta.2 → 1.4.5-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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-IUPRUKWJ.js} +785 -396
- 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 = [
|
|
@@ -3125,7 +3510,7 @@ function App({ workspace, home, resumeSession, instanceId, palAlias, onSessionEn
|
|
|
3125
3510
|
setDismissedMentionInput(void 0);
|
|
3126
3511
|
}
|
|
3127
3512
|
});
|
|
3128
|
-
if (runtime === void 0) return /* @__PURE__ */ (0,
|
|
3513
|
+
if (runtime === void 0) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FileLinkWorkspaceContext.Provider, { value: workspace, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3129
3514
|
StartingLayout,
|
|
3130
3515
|
{
|
|
3131
3516
|
workspaceName: basename3(workspace),
|
|
@@ -3135,9 +3520,9 @@ function App({ workspace, home, resumeSession, instanceId, palAlias, onSessionEn
|
|
|
3135
3520
|
columns,
|
|
3136
3521
|
rows
|
|
3137
3522
|
}
|
|
3138
|
-
);
|
|
3523
|
+
) });
|
|
3139
3524
|
const llmServiceName = runtime.services.llmServiceName?.();
|
|
3140
|
-
return /* @__PURE__ */ (0,
|
|
3525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FileLinkWorkspaceContext.Provider, { value: workspace, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3141
3526
|
TerminalLayout,
|
|
3142
3527
|
{
|
|
3143
3528
|
model: runtime.services.mainModel(),
|
|
@@ -3190,7 +3575,7 @@ function App({ workspace, home, resumeSession, instanceId, palAlias, onSessionEn
|
|
|
3190
3575
|
questionAnswers,
|
|
3191
3576
|
customQuestionActive
|
|
3192
3577
|
}
|
|
3193
|
-
);
|
|
3578
|
+
) });
|
|
3194
3579
|
}
|
|
3195
3580
|
function StartingLayout({
|
|
3196
3581
|
workspaceName,
|
|
@@ -3200,7 +3585,7 @@ function StartingLayout({
|
|
|
3200
3585
|
columns,
|
|
3201
3586
|
rows
|
|
3202
3587
|
}) {
|
|
3203
|
-
return /* @__PURE__ */ (0,
|
|
3588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3204
3589
|
TerminalLayout,
|
|
3205
3590
|
{
|
|
3206
3591
|
model: "starting",
|
|
@@ -3456,16 +3841,16 @@ function TerminalLayout({
|
|
|
3456
3841
|
} else {
|
|
3457
3842
|
footerHint = `Enter send \xB7 \u2191\u2193/Ctrl/Cmd+R history \xB7 ${outputShortcut} ${expandedOutput ? "collapse all output" : "expand all output"} \xB7 Ctrl+C exit`;
|
|
3458
3843
|
}
|
|
3459
|
-
return /* @__PURE__ */ (0,
|
|
3460
|
-
showWelcome && !focusedOpen ? /* @__PURE__ */ (0,
|
|
3461
|
-
/* @__PURE__ */ (0,
|
|
3844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { height: rows, width: "100%", flexDirection: "column", overflow: "hidden", children: [
|
|
3845
|
+
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: [
|
|
3846
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { dimColor: true, children: [
|
|
3462
3847
|
"flavor \xB7 ",
|
|
3463
3848
|
model,
|
|
3464
3849
|
" \xB7 ",
|
|
3465
3850
|
workspaceName
|
|
3466
3851
|
] }),
|
|
3467
|
-
/* @__PURE__ */ (0,
|
|
3468
|
-
completedWindow.hiddenTurns > 0 || completedWindow.hiddenBlocks > 0 ? /* @__PURE__ */ (0,
|
|
3852
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { height: 1 }),
|
|
3853
|
+
completedWindow.hiddenTurns > 0 || completedWindow.hiddenBlocks > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { dimColor: true, children: [
|
|
3469
3854
|
"\u2026 ",
|
|
3470
3855
|
completedWindow.hiddenTurns,
|
|
3471
3856
|
" earlier turns and ",
|
|
@@ -3474,21 +3859,21 @@ function TerminalLayout({
|
|
|
3474
3859
|
outputShortcut,
|
|
3475
3860
|
" to view all"
|
|
3476
3861
|
] }) : null,
|
|
3477
|
-
completedWindow.turns.map((turn, index) => /* @__PURE__ */ (0,
|
|
3478
|
-
index > 0 ? /* @__PURE__ */ (0,
|
|
3479
|
-
/* @__PURE__ */ (0,
|
|
3862
|
+
completedWindow.turns.map((turn, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { ref: (element) => onTurnElement?.(turn.id, element), flexDirection: "column", children: [
|
|
3863
|
+
index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TurnSeparator, { width: columns }) : null,
|
|
3864
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TurnView, { turn, interactive: false, workspaceName, expandedOutput })
|
|
3480
3865
|
] }, turn.id)),
|
|
3481
|
-
activeWithoutTasks === void 0 ? null : /* @__PURE__ */ (0,
|
|
3482
|
-
completedWindow.turns.length > 0 ? /* @__PURE__ */ (0,
|
|
3483
|
-
/* @__PURE__ */ (0,
|
|
3866
|
+
activeWithoutTasks === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { ref: (element) => onTurnElement?.(activeWithoutTasks.id, element), flexDirection: "column", children: [
|
|
3867
|
+
completedWindow.turns.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TurnSeparator, { width: columns }) : null,
|
|
3868
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TurnView, { turn: activeWithoutTasks, interactive: activeSession, workspaceName, expandedOutput })
|
|
3484
3869
|
] })
|
|
3485
3870
|
] }),
|
|
3486
|
-
!scrollBehind || showWelcome ? null : /* @__PURE__ */ (0,
|
|
3871
|
+
!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
3872
|
newOutput ? "\u2193 New output" : "\u2191 Reading earlier output",
|
|
3488
3873
|
" \xB7 End latest",
|
|
3489
3874
|
columns >= 72 ? " \xB7 Ctrl+\u2191/\u2193 turns" : ""
|
|
3490
3875
|
] }) }),
|
|
3491
|
-
/* @__PURE__ */ (0,
|
|
3876
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3492
3877
|
TaskProgressPanel,
|
|
3493
3878
|
{
|
|
3494
3879
|
blocks: activeTaskBlocks,
|
|
@@ -3500,13 +3885,13 @@ function TerminalLayout({
|
|
|
3500
3885
|
...onTaskPanelHoverChange === void 0 ? {} : { onHoverChange: onTaskPanelHoverChange }
|
|
3501
3886
|
}
|
|
3502
3887
|
),
|
|
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,
|
|
3888
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { position: "relative", flexShrink: 0, width: "100%", children: [
|
|
3889
|
+
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: [
|
|
3890
|
+
completion === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SlashMenu, { completion }),
|
|
3891
|
+
mentionCompletion === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MentionMenu, { completion: mentionCompletion, ...onMentionSelect === void 0 ? {} : { onSelect: onMentionSelect } })
|
|
3507
3892
|
] }),
|
|
3508
|
-
/* @__PURE__ */ (0,
|
|
3509
|
-
!focusedOpen ? null : /* @__PURE__ */ (0,
|
|
3893
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", flexShrink: 0, maxHeight: bottomMaxRows, width: "100%", overflowY: "hidden", children: [
|
|
3894
|
+
!focusedOpen ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3510
3895
|
FocusedCliPanel,
|
|
3511
3896
|
{
|
|
3512
3897
|
rows,
|
|
@@ -3523,24 +3908,24 @@ function TerminalLayout({
|
|
|
3523
3908
|
...focusScrollRef === void 0 ? {} : { focusScrollRef }
|
|
3524
3909
|
}
|
|
3525
3910
|
),
|
|
3526
|
-
memoryReviews.length === 0 ? null : /* @__PURE__ */ (0,
|
|
3527
|
-
!activeSession ? null : /* @__PURE__ */ (0,
|
|
3528
|
-
pendingPrompts.length === 0 ? null : /* @__PURE__ */ (0,
|
|
3911
|
+
memoryReviews.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MemoryReviewCards, { reviews: memoryReviews, autoDismissSeconds: memoryAutoDismissSeconds }),
|
|
3912
|
+
!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" }),
|
|
3913
|
+
pendingPrompts.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "yellow", wrap: "truncate-end", children: [
|
|
3529
3914
|
"Pending (",
|
|
3530
3915
|
pendingPrompts.length,
|
|
3531
3916
|
") \xB7 /queue manage \xB7 ",
|
|
3532
3917
|
queuedPromptLabel(pendingPrompts.at(-1)),
|
|
3533
3918
|
" \xB7 Esc edit latest"
|
|
3534
3919
|
] }),
|
|
3535
|
-
/* @__PURE__ */ (0,
|
|
3536
|
-
imageAttachments.map((image, index) => /* @__PURE__ */ (0,
|
|
3920
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: "\u2500".repeat(dividerWidth) }),
|
|
3921
|
+
imageAttachments.map((image, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "cyan", wrap: "truncate-end", children: [
|
|
3537
3922
|
"[Image #",
|
|
3538
3923
|
index + 1,
|
|
3539
3924
|
"] ",
|
|
3540
3925
|
image.name ?? basename3(image.source.path)
|
|
3541
3926
|
] }, `${image.sha256}:${index}`)),
|
|
3542
|
-
clipboardNotice === void 0 ? null : /* @__PURE__ */ (0,
|
|
3543
|
-
/* @__PURE__ */ (0,
|
|
3927
|
+
clipboardNotice === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "yellow", wrap: "truncate-end", children: clipboardNotice }),
|
|
3928
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3544
3929
|
PromptLine,
|
|
3545
3930
|
{
|
|
3546
3931
|
input,
|
|
@@ -3552,7 +3937,7 @@ function TerminalLayout({
|
|
|
3552
3937
|
...onPromptCursorChange === void 0 ? {} : { onCursorChange: onPromptCursorChange }
|
|
3553
3938
|
}
|
|
3554
3939
|
),
|
|
3555
|
-
/* @__PURE__ */ (0,
|
|
3940
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3556
3941
|
FooterStatus,
|
|
3557
3942
|
{
|
|
3558
3943
|
hint: footerHint,
|
|
@@ -3571,9 +3956,9 @@ function FooterStatus({
|
|
|
3571
3956
|
}) {
|
|
3572
3957
|
const ide = ideFooterPresentation(ideContext);
|
|
3573
3958
|
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,
|
|
3959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "row", width: "100%", justifyContent: "space-between", children: [
|
|
3960
|
+
/* @__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 }) }),
|
|
3961
|
+
!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
3962
|
"\u29C9 ",
|
|
3578
3963
|
ide
|
|
3579
3964
|
] }) })
|
|
@@ -3630,32 +4015,32 @@ function FocusedCliPanel({
|
|
|
3630
4015
|
const detailLines = approvalExpanded ? approvalDetailLines(approval) : [];
|
|
3631
4016
|
const chromeRows = 3 + (allowAlways && narrow && rows >= 5 ? 1 : 0);
|
|
3632
4017
|
const thirdHint = allowAlways && narrow && rows >= 5;
|
|
3633
|
-
return /* @__PURE__ */ (0,
|
|
3634
|
-
/* @__PURE__ */ (0,
|
|
4018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { width: "100%", height: panelRows, flexDirection: "column", flexShrink: 0, overflow: "hidden", children: [
|
|
4019
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { bold: true, color: "magenta", wrap: "truncate-end", children: [
|
|
3635
4020
|
"\u250C\u2500 ",
|
|
3636
4021
|
"Approval \xB7 ",
|
|
3637
4022
|
approval.tool
|
|
3638
4023
|
] }),
|
|
3639
|
-
/* @__PURE__ */ (0,
|
|
3640
|
-
/* @__PURE__ */ (0,
|
|
4024
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(ScrollBox_default, { ...focusScrollRef === void 0 ? {} : { ref: focusScrollRef }, height: Math.max(1, panelRows - chromeRows), flexDirection: "column", children: [
|
|
4025
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "magentaBright", wrap: "wrap", children: [
|
|
3641
4026
|
"\u2502 ",
|
|
3642
4027
|
approval.reason ?? "This action needs permission."
|
|
3643
4028
|
] }),
|
|
3644
|
-
approvalExpanded ? detailLines.map((line, index) => /* @__PURE__ */ (0,
|
|
4029
|
+
approvalExpanded ? detailLines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "magentaBright", wrap: "wrap", children: [
|
|
3645
4030
|
"\u2502 ",
|
|
3646
4031
|
line
|
|
3647
4032
|
] }, `${approval.id}:detail:${index}`)) : null
|
|
3648
4033
|
] }),
|
|
3649
|
-
/* @__PURE__ */ (0,
|
|
4034
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { bold: true, color: "magenta", wrap: "truncate-end", children: [
|
|
3650
4035
|
"\u2502 ",
|
|
3651
4036
|
narrow ? "y once \xB7 n deny" : "y=once \xB7 n=deny \xB7 Esc=deny"
|
|
3652
4037
|
] }),
|
|
3653
|
-
/* @__PURE__ */ (0,
|
|
4038
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "magenta", wrap: "truncate-end", children: [
|
|
3654
4039
|
thirdHint ? "\u2502 " : "\u2514\u2500 ",
|
|
3655
4040
|
narrow ? "v details \xB7 e edits" : "v=details \xB7 e=accept edits",
|
|
3656
4041
|
allowAlways && !narrow ? " \xB7 a=same-type" : ""
|
|
3657
4042
|
] }),
|
|
3658
|
-
thirdHint ? /* @__PURE__ */ (0,
|
|
4043
|
+
thirdHint ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "magenta", wrap: "truncate-end", children: [
|
|
3659
4044
|
"\u2514\u2500 ",
|
|
3660
4045
|
"a same-type \xB7 Esc deny"
|
|
3661
4046
|
] }) : null
|
|
@@ -3663,8 +4048,8 @@ function FocusedCliPanel({
|
|
|
3663
4048
|
}
|
|
3664
4049
|
const question = questions?.[Math.min(questionIndex, questions.length - 1)];
|
|
3665
4050
|
if (question !== void 0) {
|
|
3666
|
-
return /* @__PURE__ */ (0,
|
|
3667
|
-
/* @__PURE__ */ (0,
|
|
4051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { width: "100%", height: panelRows, flexDirection: "column", flexShrink: 0, overflow: "hidden", children: [
|
|
4052
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { bold: true, color: "cyan", wrap: "truncate-end", children: [
|
|
3668
4053
|
"\u250C\u2500 ",
|
|
3669
4054
|
"Question ",
|
|
3670
4055
|
questionIndex + 1,
|
|
@@ -3673,13 +4058,13 @@ function FocusedCliPanel({
|
|
|
3673
4058
|
" \xB7 ",
|
|
3674
4059
|
question.header
|
|
3675
4060
|
] }),
|
|
3676
|
-
/* @__PURE__ */ (0,
|
|
3677
|
-
/* @__PURE__ */ (0,
|
|
4061
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(ScrollBox_default, { ...focusScrollRef === void 0 ? {} : { ref: focusScrollRef }, height: Math.max(1, panelRows - 2), flexDirection: "column", children: [
|
|
4062
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "cyanBright", wrap: "wrap", children: [
|
|
3678
4063
|
"\u2502 ",
|
|
3679
4064
|
question.question
|
|
3680
4065
|
] }),
|
|
3681
|
-
question.options.map((option, index) => /* @__PURE__ */ (0,
|
|
3682
|
-
/* @__PURE__ */ (0,
|
|
4066
|
+
question.options.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "cyan", wrap: "wrap", children: [
|
|
4067
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { bold: true, color: "green", children: [
|
|
3683
4068
|
"\u2502 ",
|
|
3684
4069
|
index + 1,
|
|
3685
4070
|
". ",
|
|
@@ -3687,26 +4072,26 @@ function FocusedCliPanel({
|
|
|
3687
4072
|
] }),
|
|
3688
4073
|
option.description ? ` ${option.description}` : ""
|
|
3689
4074
|
] }, index)),
|
|
3690
|
-
/* @__PURE__ */ (0,
|
|
4075
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "cyan", children: [
|
|
3691
4076
|
"\u2502 ",
|
|
3692
4077
|
question.options.length + 1,
|
|
3693
4078
|
". Custom input"
|
|
3694
4079
|
] })
|
|
3695
4080
|
] }),
|
|
3696
|
-
/* @__PURE__ */ (0,
|
|
4081
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "cyan", wrap: "truncate-end", children: [
|
|
3697
4082
|
"\u2514\u2500 ",
|
|
3698
4083
|
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
4084
|
] })
|
|
3700
4085
|
] });
|
|
3701
4086
|
}
|
|
3702
|
-
return /* @__PURE__ */ (0,
|
|
3703
|
-
/* @__PURE__ */ (0,
|
|
4087
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { width: "100%", height: panelRows, flexDirection: "column", flexShrink: 0, overflow: "hidden", children: [
|
|
4088
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { bold: true, color: "yellow", wrap: "truncate-end", children: [
|
|
3704
4089
|
"\u250C\u2500 ",
|
|
3705
4090
|
"Queued messages (",
|
|
3706
4091
|
pendingPrompts.length,
|
|
3707
4092
|
")"
|
|
3708
4093
|
] }),
|
|
3709
|
-
/* @__PURE__ */ (0,
|
|
4094
|
+
/* @__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
4095
|
QueueItems,
|
|
3711
4096
|
{
|
|
3712
4097
|
items: pendingPrompts,
|
|
@@ -3715,11 +4100,11 @@ function FocusedCliPanel({
|
|
|
3715
4100
|
...onQueueSelectionChange === void 0 ? {} : { onSelect: onQueueSelectionChange }
|
|
3716
4101
|
}
|
|
3717
4102
|
) }),
|
|
3718
|
-
/* @__PURE__ */ (0,
|
|
4103
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { bold: true, color: "yellow", wrap: "truncate-end", children: [
|
|
3719
4104
|
"\u2502 ",
|
|
3720
4105
|
columns < 48 ? "Enter edit \xB7 d cancel" : "Enter=edit selected \xB7 d=cancel selected"
|
|
3721
4106
|
] }),
|
|
3722
|
-
/* @__PURE__ */ (0,
|
|
4107
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "yellow", wrap: "truncate-end", children: [
|
|
3723
4108
|
"\u2514\u2500 ",
|
|
3724
4109
|
columns < 48 ? "\u2191\u2193 select \xB7 Esc close" : "\u2191/\u2193=select \xB7 PgUp/PgDn=jump \xB7 Esc=close"
|
|
3725
4110
|
] })
|
|
@@ -3733,12 +4118,12 @@ function QueueItems({ items, selection, scrollRef, onSelect }) {
|
|
|
3733
4118
|
(0, import_react8.useEffect)(() => {
|
|
3734
4119
|
if (selectedElement.current !== null) scrollRef?.current?.scrollToElement(selectedElement.current);
|
|
3735
4120
|
}, [selection, items.length, scrollRef]);
|
|
3736
|
-
return /* @__PURE__ */ (0,
|
|
4121
|
+
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
4122
|
Box_default,
|
|
3738
4123
|
{
|
|
3739
4124
|
ref: index === selection ? selectedElement : void 0,
|
|
3740
4125
|
onClick: () => onSelect?.(index),
|
|
3741
|
-
children: /* @__PURE__ */ (0,
|
|
4126
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: index === selection ? "yellowBright" : void 0, bold: index === selection, wrap: "wrap", children: [
|
|
3742
4127
|
index === selection ? "\u276F" : " ",
|
|
3743
4128
|
" ",
|
|
3744
4129
|
index + 1,
|
|
@@ -3758,39 +4143,43 @@ function MemoryReviewCards({ reviews, autoDismissSeconds }) {
|
|
|
3758
4143
|
const timer = setInterval(() => setRemaining((current) => Math.max(0, current - 1)), 1e3);
|
|
3759
4144
|
return () => clearInterval(timer);
|
|
3760
4145
|
}, [review.id, autoDismissSeconds]);
|
|
3761
|
-
return /* @__PURE__ */ (0,
|
|
3762
|
-
/* @__PURE__ */ (0,
|
|
4146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
4147
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { bold: true, color: "yellow", children: [
|
|
3763
4148
|
"\u250C\u2500 Long-term memory requires confirmation (",
|
|
3764
4149
|
reviews.length,
|
|
3765
4150
|
")"
|
|
3766
4151
|
] }),
|
|
3767
|
-
/* @__PURE__ */ (0,
|
|
4152
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "yellowBright", wrap: "truncate-end", children: [
|
|
3768
4153
|
"\u2502 [",
|
|
3769
4154
|
review.type,
|
|
3770
4155
|
"] ",
|
|
3771
4156
|
review.content
|
|
3772
4157
|
] }),
|
|
3773
|
-
/* @__PURE__ */ (0,
|
|
3774
|
-
|
|
4158
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { dimColor: true, wrap: "truncate-end", children: [
|
|
4159
|
+
"\u2502 ",
|
|
4160
|
+
review.evidence === void 0 ? "No verified user quote; check before saving." : `User said: \u201C${review.evidence}\u201D`
|
|
4161
|
+
] }),
|
|
4162
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: "\u2502 Model-generated content is not stored until you approve it." }),
|
|
4163
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "yellow", children: [
|
|
3775
4164
|
"\u2514\u2500 ",
|
|
3776
|
-
/* @__PURE__ */ (0,
|
|
4165
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { bold: true, children: "Ctrl+Y" }),
|
|
3777
4166
|
" save / ",
|
|
3778
|
-
/* @__PURE__ */ (0,
|
|
4167
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { bold: true, children: "Ctrl+N" }),
|
|
3779
4168
|
" ignore",
|
|
3780
|
-
autoDismissSeconds > 0 ? /* @__PURE__ */ (0,
|
|
4169
|
+
autoDismissSeconds > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { bold: true, color: "cyanBright", children: ` (auto-dismiss in ${remaining}s)` }) : " (stays pending until reviewed)"
|
|
3781
4170
|
] })
|
|
3782
4171
|
] });
|
|
3783
4172
|
}
|
|
3784
4173
|
function SlashMenu({ completion }) {
|
|
3785
4174
|
const visible = completion.items.slice(completion.windowStart, completion.windowStart + 6);
|
|
3786
|
-
return /* @__PURE__ */ (0,
|
|
4175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { flexDirection: "column", width: "100%", children: visible.map((candidate, visibleIndex) => {
|
|
3787
4176
|
const index = completion.windowStart + visibleIndex;
|
|
3788
4177
|
const presentation = slashCandidatePresentation(index === completion.selectedIndex);
|
|
3789
|
-
return /* @__PURE__ */ (0,
|
|
4178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { ...presentation.rowStyle, wrap: "truncate-end", children: [
|
|
3790
4179
|
presentation.marker,
|
|
3791
|
-
/* @__PURE__ */ (0,
|
|
3792
|
-
candidate.kind === "skill" || candidate.kind === "plugin" ? /* @__PURE__ */ (0,
|
|
3793
|
-
candidate.description === void 0 ? null : /* @__PURE__ */ (0,
|
|
4180
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HighlightedName, { name: candidate.name, query: completion.query, matchStyle: presentation.matchStyle }),
|
|
4181
|
+
candidate.kind === "skill" || candidate.kind === "plugin" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: candidate.kind === "skill" ? "magentaBright" : "cyanBright", children: ` ${candidate.kind}` }) : null,
|
|
4182
|
+
candidate.description === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: ` ${normalizeSlashDescription(candidate.description)}` })
|
|
3794
4183
|
] }, `${candidate.kind}:${candidate.name}`);
|
|
3795
4184
|
}) });
|
|
3796
4185
|
}
|
|
@@ -3799,19 +4188,19 @@ function MentionMenu({
|
|
|
3799
4188
|
onSelect
|
|
3800
4189
|
}) {
|
|
3801
4190
|
const visible = completion.items.slice(completion.windowStart, completion.windowStart + 6);
|
|
3802
|
-
return /* @__PURE__ */ (0,
|
|
4191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { flexDirection: "column", width: "100%", children: visible.map((path, visibleIndex) => {
|
|
3803
4192
|
const index = completion.windowStart + visibleIndex;
|
|
3804
4193
|
const presentation = mentionCandidatePresentation(index === completion.selectedIndex);
|
|
3805
|
-
return /* @__PURE__ */ (0,
|
|
4194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3806
4195
|
Box_default,
|
|
3807
4196
|
{
|
|
3808
4197
|
width: "100%",
|
|
3809
4198
|
onClick: (event) => {
|
|
3810
4199
|
if (!event.cellIsBlank) onSelect?.(path);
|
|
3811
4200
|
},
|
|
3812
|
-
children: /* @__PURE__ */ (0,
|
|
4201
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { ...presentation.textStyle, wrap: "truncate-end", children: [
|
|
3813
4202
|
presentation.marker,
|
|
3814
|
-
presentation.highlightMatches ? /* @__PURE__ */ (0,
|
|
4203
|
+
presentation.highlightMatches ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HighlightedName, { name: path, query: completion.query, matchStyle: presentation.matchStyle }) : path
|
|
3815
4204
|
] })
|
|
3816
4205
|
},
|
|
3817
4206
|
path
|
|
@@ -3824,16 +4213,16 @@ function HighlightedName({
|
|
|
3824
4213
|
matchStyle
|
|
3825
4214
|
}) {
|
|
3826
4215
|
const ranges = matchRanges(name, query);
|
|
3827
|
-
if (ranges.length === 0) return /* @__PURE__ */ (0,
|
|
4216
|
+
if (ranges.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { children: name });
|
|
3828
4217
|
const parts = [];
|
|
3829
4218
|
let cursor = 0;
|
|
3830
4219
|
for (const [start, end] of ranges) {
|
|
3831
4220
|
if (start > cursor) parts.push(name.slice(cursor, start));
|
|
3832
|
-
parts.push(/* @__PURE__ */ (0,
|
|
4221
|
+
parts.push(/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { ...matchStyle, children: name.slice(start, end) }, `${start}:${end}`));
|
|
3833
4222
|
cursor = end;
|
|
3834
4223
|
}
|
|
3835
4224
|
if (cursor < name.length) parts.push(name.slice(cursor));
|
|
3836
|
-
return /* @__PURE__ */ (0,
|
|
4225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { children: parts });
|
|
3837
4226
|
}
|
|
3838
4227
|
function jumpScroll(scroll, delta) {
|
|
3839
4228
|
const maximum = Math.max(0, scroll.getScrollHeight() - scroll.getViewportHeight());
|
|
@@ -3876,7 +4265,7 @@ function scrollUp(scroll, amount) {
|
|
|
3876
4265
|
else scroll.scrollBy(-amount);
|
|
3877
4266
|
}
|
|
3878
4267
|
function TurnSeparator({ width }) {
|
|
3879
|
-
return /* @__PURE__ */ (0,
|
|
4268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: "\u2500".repeat(Math.max(1, width - 1)) });
|
|
3880
4269
|
}
|
|
3881
4270
|
var TurnView = import_react8.default.memo(function TurnView2({
|
|
3882
4271
|
turn,
|
|
@@ -3885,16 +4274,16 @@ var TurnView = import_react8.default.memo(function TurnView2({
|
|
|
3885
4274
|
expandedOutput
|
|
3886
4275
|
}) {
|
|
3887
4276
|
if (turn.kind === "compaction") {
|
|
3888
|
-
return /* @__PURE__ */ (0,
|
|
3889
|
-
/* @__PURE__ */ (0,
|
|
3890
|
-
turn.blocks.map((block, index) => block.kind === "status" ? /* @__PURE__ */ (0,
|
|
4277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, borderStyle: "round", borderColor: "ansi:yellowBright", paddingX: 1, children: [
|
|
4278
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:yellowBright", bold: true, children: turn.prompt }),
|
|
4279
|
+
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
4280
|
] });
|
|
3892
4281
|
}
|
|
3893
4282
|
if (turn.source?.kind === "pal") {
|
|
3894
4283
|
const context = turn.source.context === void 0 ? "" : ` \xB7 ${turn.source.context}`;
|
|
3895
|
-
return /* @__PURE__ */ (0,
|
|
3896
|
-
/* @__PURE__ */ (0,
|
|
3897
|
-
/* @__PURE__ */ (0,
|
|
4284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
4285
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
|
|
4286
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "cyanBright", bold: true, children: [
|
|
3898
4287
|
"PAL \xB7 ",
|
|
3899
4288
|
turn.source.alias,
|
|
3900
4289
|
" (",
|
|
@@ -3902,20 +4291,20 @@ var TurnView = import_react8.default.memo(function TurnView2({
|
|
|
3902
4291
|
")",
|
|
3903
4292
|
context
|
|
3904
4293
|
] }),
|
|
3905
|
-
/* @__PURE__ */ (0,
|
|
4294
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:whiteBright", children: turn.prompt })
|
|
3906
4295
|
] }),
|
|
3907
|
-
/* @__PURE__ */ (0,
|
|
4296
|
+
/* @__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
4297
|
] });
|
|
3909
4298
|
}
|
|
3910
|
-
return /* @__PURE__ */ (0,
|
|
3911
|
-
/* @__PURE__ */ (0,
|
|
3912
|
-
/* @__PURE__ */ (0,
|
|
3913
|
-
/* @__PURE__ */ (0,
|
|
4299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
4300
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "row", backgroundColor: "#3a3a3a", paddingX: 1, paddingY: 0, children: [
|
|
4301
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:whiteBright", bold: true, backgroundColor: "#3a3a3a", children: "\u276F" }),
|
|
4302
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "ansi:whiteBright", bold: true, backgroundColor: "#3a3a3a", children: [
|
|
3914
4303
|
" ",
|
|
3915
4304
|
turn.prompt
|
|
3916
4305
|
] })
|
|
3917
4306
|
] }),
|
|
3918
|
-
/* @__PURE__ */ (0,
|
|
4307
|
+
/* @__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
4308
|
] });
|
|
3920
4309
|
});
|
|
3921
4310
|
var DIFF_CONTENT = fileDiffLineStyle("context").contentColor;
|
|
@@ -3924,11 +4313,11 @@ var DIFF_ADDED_MARKER = fileDiffLineStyle("added").markerColor;
|
|
|
3924
4313
|
function FileDiffView({ presentation, expanded }) {
|
|
3925
4314
|
const operation = presentation.operation === "create" ? "Create" : presentation.operation === "delete" ? "Delete" : "Update";
|
|
3926
4315
|
if (presentation.operation === "delete") {
|
|
3927
|
-
return /* @__PURE__ */ (0,
|
|
3928
|
-
/* @__PURE__ */ (0,
|
|
3929
|
-
/* @__PURE__ */ (0,
|
|
4316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
4317
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: DIFF_REMOVED_MARKER, children: "\u25CF" }),
|
|
4318
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: DIFF_CONTENT, children: [
|
|
3930
4319
|
" ",
|
|
3931
|
-
/* @__PURE__ */ (0,
|
|
4320
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { bold: true, children: operation }),
|
|
3932
4321
|
"(",
|
|
3933
4322
|
basename3(presentation.path),
|
|
3934
4323
|
")"
|
|
@@ -3936,29 +4325,29 @@ function FileDiffView({ presentation, expanded }) {
|
|
|
3936
4325
|
] });
|
|
3937
4326
|
}
|
|
3938
4327
|
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,
|
|
4328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", width: "100%", children: [
|
|
4329
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
4330
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: DIFF_ADDED_MARKER, children: "\u25CF" }),
|
|
4331
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: DIFF_CONTENT, children: [
|
|
3943
4332
|
" ",
|
|
3944
|
-
/* @__PURE__ */ (0,
|
|
4333
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { bold: true, children: operation }),
|
|
3945
4334
|
"(",
|
|
3946
4335
|
basename3(presentation.path),
|
|
3947
4336
|
")"
|
|
3948
4337
|
] })
|
|
3949
4338
|
] }),
|
|
3950
|
-
/* @__PURE__ */ (0,
|
|
4339
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: DIFF_CONTENT, children: [
|
|
3951
4340
|
" \u2514 Added ",
|
|
3952
4341
|
lineCount(presentation.added),
|
|
3953
4342
|
", removed ",
|
|
3954
4343
|
lineCount(presentation.removed)
|
|
3955
4344
|
] }),
|
|
3956
|
-
(expanded ? presentation.lines : []).map((line, index) => /* @__PURE__ */ (0,
|
|
4345
|
+
(expanded ? presentation.lines : []).map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FileDiffRow, { line, lineWidth }, `${line.kind}:${line.oldLine ?? ""}:${line.newLine ?? ""}:${index}`))
|
|
3957
4346
|
] });
|
|
3958
4347
|
}
|
|
3959
4348
|
function FileDiffRow({ line, lineWidth }) {
|
|
3960
4349
|
if (line.kind === "omitted") {
|
|
3961
|
-
return /* @__PURE__ */ (0,
|
|
4350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: DIFF_CONTENT, dimColor: true, children: [
|
|
3962
4351
|
" ".repeat(lineWidth + 4),
|
|
3963
4352
|
line.text
|
|
3964
4353
|
] });
|
|
@@ -3967,14 +4356,14 @@ function FileDiffRow({ line, lineWidth }) {
|
|
|
3967
4356
|
const marker = line.kind === "removed" ? "-" : line.kind === "added" ? "+" : " ";
|
|
3968
4357
|
const { backgroundColor, markerColor, contentColor } = fileDiffLineStyle(line.kind);
|
|
3969
4358
|
const prefix = `${String(number ?? "").padStart(lineWidth)} ${marker}| `;
|
|
3970
|
-
return /* @__PURE__ */ (0,
|
|
4359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
3971
4360
|
Box_default,
|
|
3972
4361
|
{
|
|
3973
4362
|
flexDirection: "row",
|
|
3974
4363
|
width: "100%",
|
|
3975
4364
|
...backgroundColor === void 0 ? {} : { backgroundColor },
|
|
3976
4365
|
children: [
|
|
3977
|
-
/* @__PURE__ */ (0,
|
|
4366
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3978
4367
|
Text,
|
|
3979
4368
|
{
|
|
3980
4369
|
color: markerColor,
|
|
@@ -3983,7 +4372,7 @@ function FileDiffRow({ line, lineWidth }) {
|
|
|
3983
4372
|
children: prefix
|
|
3984
4373
|
}
|
|
3985
4374
|
),
|
|
3986
|
-
/* @__PURE__ */ (0,
|
|
4375
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3987
4376
|
Text,
|
|
3988
4377
|
{
|
|
3989
4378
|
color: contentColor,
|
|
@@ -3999,18 +4388,18 @@ function lineCount(count) {
|
|
|
3999
4388
|
return `${count} ${count === 1 ? "line" : "lines"}`;
|
|
4000
4389
|
}
|
|
4001
4390
|
function StatusLine({ block, interactive }) {
|
|
4002
|
-
if (block.progress !== void 0) return /* @__PURE__ */ (0,
|
|
4391
|
+
if (block.progress !== void 0) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CompactProgressLine, { progress: block.progress });
|
|
4003
4392
|
const running = block.state === "running";
|
|
4004
4393
|
const [ref, time] = useAnimationFrame(running && interactive ? 120 : null);
|
|
4005
4394
|
const color = statusLineColor(block);
|
|
4006
4395
|
const frames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
4007
4396
|
const spinner = running && interactive ? frames[Math.floor(Math.max(0, time) / 120) % frames.length] + " " : "";
|
|
4008
|
-
return /* @__PURE__ */ (0,
|
|
4009
|
-
/* @__PURE__ */ (0,
|
|
4397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { ref, flexDirection: "row", children: [
|
|
4398
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { ...color === void 0 ? { dimColor: true } : { color }, children: [
|
|
4010
4399
|
spinner,
|
|
4011
4400
|
block.text
|
|
4012
4401
|
] }),
|
|
4013
|
-
block.hint === void 0 ? null : /* @__PURE__ */ (0,
|
|
4402
|
+
block.hint === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { dimColor: true, wrap: "truncate-end", children: [
|
|
4014
4403
|
" (",
|
|
4015
4404
|
block.hint,
|
|
4016
4405
|
")"
|
|
@@ -4026,13 +4415,13 @@ function statusLineColor(block) {
|
|
|
4026
4415
|
}
|
|
4027
4416
|
function CompactProgressLine({ progress }) {
|
|
4028
4417
|
const presentation = compactProgressPresentation(progress);
|
|
4029
|
-
return /* @__PURE__ */ (0,
|
|
4030
|
-
/* @__PURE__ */ (0,
|
|
4031
|
-
presentation.cells.map((cell, index) => /* @__PURE__ */ (0,
|
|
4418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
4419
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { children: "Compacting context " }),
|
|
4420
|
+
presentation.cells.map((cell, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: cell.color, children: [
|
|
4032
4421
|
"\u25A0",
|
|
4033
4422
|
index === presentation.cells.length - 1 ? "" : " "
|
|
4034
4423
|
] }, index)),
|
|
4035
|
-
/* @__PURE__ */ (0,
|
|
4424
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { dimColor: true, children: [
|
|
4036
4425
|
" ",
|
|
4037
4426
|
presentation.progress,
|
|
4038
4427
|
"%"
|
|
@@ -4063,13 +4452,13 @@ function PromptLine({
|
|
|
4063
4452
|
lineStarts.push(nextLineStart);
|
|
4064
4453
|
nextLineStart += [...line].length;
|
|
4065
4454
|
}
|
|
4066
|
-
return /* @__PURE__ */ (0,
|
|
4455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { width: "100%", flexDirection: "column", paddingX: PROMPT_HORIZONTAL_PADDING, children: visibleLines.map((line, visibleIndex) => {
|
|
4067
4456
|
const lineIndex = windowStart + visibleIndex;
|
|
4068
4457
|
const isCursorLine = lineIndex === wrap.cursor.line;
|
|
4069
4458
|
const points = [...line];
|
|
4070
4459
|
const cursorCol = wrap.cursor.column;
|
|
4071
4460
|
const styledCount = Math.max(0, Math.min(points.length, tokenLength - (lineStarts[lineIndex] ?? 0)));
|
|
4072
|
-
return /* @__PURE__ */ (0,
|
|
4461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
4073
4462
|
Box_default,
|
|
4074
4463
|
{
|
|
4075
4464
|
...onCursorChange === void 0 ? {} : {
|
|
@@ -4083,8 +4472,8 @@ function PromptLine({
|
|
|
4083
4472
|
}
|
|
4084
4473
|
},
|
|
4085
4474
|
children: [
|
|
4086
|
-
/* @__PURE__ */ (0,
|
|
4087
|
-
/* @__PURE__ */ (0,
|
|
4475
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "yellow", bold: true, children: lineIndex === 0 ? "\u276F " : " " }),
|
|
4476
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PromptLineContent, { points, cursor: cursorCol, cursorVisible: isCursorLine, styledCount })
|
|
4088
4477
|
]
|
|
4089
4478
|
},
|
|
4090
4479
|
lineIndex
|
|
@@ -4100,14 +4489,14 @@ function StatusBlockView({
|
|
|
4100
4489
|
const visibleBlock = cliToolTitle(block);
|
|
4101
4490
|
const outcome = cliToolOutcome(block);
|
|
4102
4491
|
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,
|
|
4492
|
+
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 });
|
|
4493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
4105
4494
|
primary,
|
|
4106
|
-
outcome === void 0 ? null : /* @__PURE__ */ (0,
|
|
4495
|
+
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
4496
|
"\u2514 ",
|
|
4108
4497
|
outcome
|
|
4109
4498
|
] }) }),
|
|
4110
|
-
block.details === void 0 || block.presentation?.kind === "changeset" || toolOutput && !expandedOutput ? null : /* @__PURE__ */ (0,
|
|
4499
|
+
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
4500
|
] });
|
|
4112
4501
|
}
|
|
4113
4502
|
function ToolPresentationView({
|
|
@@ -4115,17 +4504,17 @@ function ToolPresentationView({
|
|
|
4115
4504
|
workspaceName,
|
|
4116
4505
|
expandedOutput
|
|
4117
4506
|
}) {
|
|
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,
|
|
4507
|
+
if (presentation.kind === "changeset") return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ChangeSetPresentationView, { presentation, workspaceName, expanded: expandedOutput });
|
|
4508
|
+
if (presentation.kind === "file-change") return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FileDiffView, { presentation, expanded: expandedOutput });
|
|
4509
|
+
if (presentation.kind === "terminal") return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CommandPresentationView, { presentation, expanded: expandedOutput });
|
|
4510
|
+
if (presentation.kind === "web") return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WebPresentationView, { presentation, expanded: expandedOutput });
|
|
4511
|
+
if (presentation.kind === "job") return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(JobPresentationView, { presentation, expanded: expandedOutput });
|
|
4512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, children: [
|
|
4513
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { children: [
|
|
4125
4514
|
presentation.title,
|
|
4126
4515
|
presentation.summary ? ` \xB7 ${presentation.summary}` : ""
|
|
4127
4516
|
] }),
|
|
4128
|
-
!expandedOutput || presentation.details === void 0 ? null : /* @__PURE__ */ (0,
|
|
4517
|
+
!expandedOutput || presentation.details === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AssistantText, { text: presentation.details })
|
|
4129
4518
|
] });
|
|
4130
4519
|
}
|
|
4131
4520
|
var CHANGESET_TONE = "#b99bf8";
|
|
@@ -4139,10 +4528,10 @@ function ChangeSetPresentationView({
|
|
|
4139
4528
|
const removed = presentation.files.reduce((total, file) => total + file.removed, 0);
|
|
4140
4529
|
const fileLabel = presentation.files.length === 1 ? "FILE" : "FILES";
|
|
4141
4530
|
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,
|
|
4531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
|
|
4532
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4533
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: CHANGESET_TONE, children: "\u250C\u2500 " }),
|
|
4534
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: CHANGESET_TONE, bold: true, children: [
|
|
4146
4535
|
"CHANGESET \xB7 ",
|
|
4147
4536
|
presentation.files.length,
|
|
4148
4537
|
" ",
|
|
@@ -4152,37 +4541,37 @@ function ChangeSetPresentationView({
|
|
|
4152
4541
|
visibleFiles.map((file) => {
|
|
4153
4542
|
const operation = file.operation.toUpperCase();
|
|
4154
4543
|
const stats = `+${file.added} -${file.removed}`;
|
|
4155
|
-
return /* @__PURE__ */ (0,
|
|
4156
|
-
/* @__PURE__ */ (0,
|
|
4157
|
-
/* @__PURE__ */ (0,
|
|
4158
|
-
/* @__PURE__ */ (0,
|
|
4159
|
-
/* @__PURE__ */ (0,
|
|
4544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4545
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: CHANGESET_TONE, children: "\u2502 " }),
|
|
4546
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: changeSetOperationColor(file.operation), bold: true, children: operation.padEnd(8) }),
|
|
4547
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { children: [
|
|
4548
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "ansi:green", children: [
|
|
4160
4549
|
"+",
|
|
4161
4550
|
file.added
|
|
4162
4551
|
] }),
|
|
4163
4552
|
" ",
|
|
4164
|
-
/* @__PURE__ */ (0,
|
|
4553
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "#e06c50", children: [
|
|
4165
4554
|
"-",
|
|
4166
4555
|
file.removed
|
|
4167
4556
|
] }),
|
|
4168
4557
|
" ".repeat(Math.max(1, 9 - stats.length))
|
|
4169
4558
|
] }),
|
|
4170
|
-
/* @__PURE__ */ (0,
|
|
4559
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:whiteBright", wrap: "truncate-end", children: workspaceRelativePath(file.path, workspaceName) })
|
|
4171
4560
|
] }, `${file.operation}:${file.path}`);
|
|
4172
4561
|
}),
|
|
4173
|
-
/* @__PURE__ */ (0,
|
|
4174
|
-
/* @__PURE__ */ (0,
|
|
4175
|
-
/* @__PURE__ */ (0,
|
|
4176
|
-
/* @__PURE__ */ (0,
|
|
4562
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4563
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: CHANGESET_TONE, children: "\u2514\u2500 " }),
|
|
4564
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { children: [
|
|
4565
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "ansi:green", children: [
|
|
4177
4566
|
"+",
|
|
4178
4567
|
added
|
|
4179
4568
|
] }),
|
|
4180
4569
|
" ",
|
|
4181
|
-
/* @__PURE__ */ (0,
|
|
4570
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "#e06c50", children: [
|
|
4182
4571
|
"-",
|
|
4183
4572
|
removed
|
|
4184
4573
|
] }),
|
|
4185
|
-
/* @__PURE__ */ (0,
|
|
4574
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: showing })
|
|
4186
4575
|
] })
|
|
4187
4576
|
] })
|
|
4188
4577
|
] });
|
|
@@ -4211,28 +4600,28 @@ function CommandPresentationView({
|
|
|
4211
4600
|
const perStreamLimit = expanded ? Number.POSITIVE_INFINITY : 0;
|
|
4212
4601
|
const stdout = boundedCommandLines(presentation.stdout ?? "", perStreamLimit);
|
|
4213
4602
|
const stderr = boundedCommandLines(presentation.stderr ?? "", perStreamLimit);
|
|
4214
|
-
return /* @__PURE__ */ (0,
|
|
4215
|
-
/* @__PURE__ */ (0,
|
|
4216
|
-
/* @__PURE__ */ (0,
|
|
4217
|
-
/* @__PURE__ */ (0,
|
|
4603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
|
|
4604
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4605
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u250C\u2500 " }),
|
|
4606
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: tone, bold: true, children: [
|
|
4218
4607
|
label,
|
|
4219
4608
|
" \xB7 ",
|
|
4220
4609
|
state.toUpperCase()
|
|
4221
4610
|
] })
|
|
4222
4611
|
] }),
|
|
4223
|
-
/* @__PURE__ */ (0,
|
|
4224
|
-
/* @__PURE__ */ (0,
|
|
4225
|
-
/* @__PURE__ */ (0,
|
|
4612
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4613
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2502 " }),
|
|
4614
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:whiteBright", bold: true, wrap: "truncate-end", children: presentation.command ?? presentation.title })
|
|
4226
4615
|
] }),
|
|
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,
|
|
4616
|
+
stdout.total === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CommandOutputSection, { label: "OUTPUT", value: stdout, tone, error: false }),
|
|
4617
|
+
stderr.total === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CommandOutputSection, { label: "ERROR", value: stderr, tone, error: true }),
|
|
4618
|
+
!expanded || presentation.diagnostic === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4619
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2502 " }),
|
|
4620
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: presentation.diagnostic })
|
|
4232
4621
|
] }),
|
|
4233
|
-
/* @__PURE__ */ (0,
|
|
4234
|
-
/* @__PURE__ */ (0,
|
|
4235
|
-
/* @__PURE__ */ (0,
|
|
4622
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4623
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2514\u2500 " }),
|
|
4624
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: commandFooter(presentation, state) })
|
|
4236
4625
|
] })
|
|
4237
4626
|
] });
|
|
4238
4627
|
}
|
|
@@ -4242,17 +4631,17 @@ function CommandOutputSection({
|
|
|
4242
4631
|
tone,
|
|
4243
4632
|
error
|
|
4244
4633
|
}) {
|
|
4245
|
-
return /* @__PURE__ */ (0,
|
|
4246
|
-
/* @__PURE__ */ (0,
|
|
4247
|
-
/* @__PURE__ */ (0,
|
|
4248
|
-
/* @__PURE__ */ (0,
|
|
4249
|
-
/* @__PURE__ */ (0,
|
|
4250
|
-
value.hidden === 0 ? null : /* @__PURE__ */ (0,
|
|
4634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
4635
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4636
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u251C\u2500 " }),
|
|
4637
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: error ? "#e06c50" : tone, bold: true, children: label }),
|
|
4638
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: ` \xB7 ${value.total} ${value.total === 1 ? "LINE" : "LINES"}` }),
|
|
4639
|
+
value.hidden === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: ` \xB7 ${value.head.length + value.tail.length} SHOWN` })
|
|
4251
4640
|
] }),
|
|
4252
|
-
value.head.map((line, index) => /* @__PURE__ */ (0,
|
|
4253
|
-
value.hidden === 0 ? null : /* @__PURE__ */ (0,
|
|
4254
|
-
/* @__PURE__ */ (0,
|
|
4255
|
-
/* @__PURE__ */ (0,
|
|
4641
|
+
value.head.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CommandOutputLine, { line, tone, error }, `head:${index}`)),
|
|
4642
|
+
value.hidden === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4643
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2502 " }),
|
|
4644
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { dimColor: true, children: [
|
|
4256
4645
|
"\u2026 ",
|
|
4257
4646
|
value.hidden,
|
|
4258
4647
|
" ",
|
|
@@ -4260,13 +4649,13 @@ function CommandOutputSection({
|
|
|
4260
4649
|
" hidden"
|
|
4261
4650
|
] })
|
|
4262
4651
|
] }),
|
|
4263
|
-
value.tail.map((line, index) => /* @__PURE__ */ (0,
|
|
4652
|
+
value.tail.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CommandOutputLine, { line, tone, error }, `tail:${index}`))
|
|
4264
4653
|
] });
|
|
4265
4654
|
}
|
|
4266
4655
|
function CommandOutputLine({ line, tone, error }) {
|
|
4267
|
-
return /* @__PURE__ */ (0,
|
|
4268
|
-
/* @__PURE__ */ (0,
|
|
4269
|
-
/* @__PURE__ */ (0,
|
|
4656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4657
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2502 " }),
|
|
4658
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: error ? "#e06c50" : "#b8bcc2", wrap: "truncate-end", children: line === "" ? " " : line })
|
|
4270
4659
|
] });
|
|
4271
4660
|
}
|
|
4272
4661
|
function boundedCommandLines(output, limit) {
|
|
@@ -4296,51 +4685,51 @@ function WebPresentationView({
|
|
|
4296
4685
|
expanded
|
|
4297
4686
|
}) {
|
|
4298
4687
|
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,
|
|
4688
|
+
if (presentation.items === void 0) return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
|
|
4689
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4690
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#5f87af", children: "\u250C\u2500 " }),
|
|
4691
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:cyanBright", bold: true, children: "WEB FETCH" }),
|
|
4692
|
+
presentation.summary === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: ` \xB7 ${presentation.summary}` })
|
|
4304
4693
|
] }),
|
|
4305
|
-
/* @__PURE__ */ (0,
|
|
4306
|
-
/* @__PURE__ */ (0,
|
|
4307
|
-
/* @__PURE__ */ (0,
|
|
4694
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4695
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#5f87af", children: "\u2502 " }),
|
|
4696
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:whiteBright", wrap: "truncate-end", children: presentation.url ?? presentation.title })
|
|
4308
4697
|
] }),
|
|
4309
|
-
/* @__PURE__ */ (0,
|
|
4310
|
-
/* @__PURE__ */ (0,
|
|
4311
|
-
/* @__PURE__ */ (0,
|
|
4698
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4699
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#5f87af", children: "\u2514\u2500 " }),
|
|
4700
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: "Page content added to context" })
|
|
4312
4701
|
] })
|
|
4313
4702
|
] });
|
|
4314
4703
|
const visibleItems = expanded ? items : [];
|
|
4315
4704
|
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,
|
|
4705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
|
|
4706
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4707
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#5f87af", children: "\u250C\u2500 " }),
|
|
4708
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:cyanBright", bold: true, children: "WEB SEARCH" }),
|
|
4709
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: ` \xB7 ${items.length} ${items.length === 1 ? "RESULT" : "RESULTS"}` })
|
|
4321
4710
|
] }),
|
|
4322
|
-
/* @__PURE__ */ (0,
|
|
4323
|
-
/* @__PURE__ */ (0,
|
|
4324
|
-
/* @__PURE__ */ (0,
|
|
4711
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4712
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#5f87af", children: "\u2502 " }),
|
|
4713
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:whiteBright", bold: true, wrap: "truncate-end", children: query })
|
|
4325
4714
|
] }),
|
|
4326
|
-
/* @__PURE__ */ (0,
|
|
4327
|
-
visibleItems.map((item, index) => /* @__PURE__ */ (0,
|
|
4328
|
-
/* @__PURE__ */ (0,
|
|
4329
|
-
/* @__PURE__ */ (0,
|
|
4330
|
-
/* @__PURE__ */ (0,
|
|
4331
|
-
/* @__PURE__ */ (0,
|
|
4715
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#5f87af", children: "\u2502" }),
|
|
4716
|
+
visibleItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
4717
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4718
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#5f87af", children: "\u2502 " }),
|
|
4719
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:cyanBright", bold: true, children: String(index + 1).padStart(2, "0") }),
|
|
4720
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "ansi:whiteBright", wrap: "truncate-end", children: [
|
|
4332
4721
|
" ",
|
|
4333
4722
|
item.title
|
|
4334
4723
|
] })
|
|
4335
4724
|
] }),
|
|
4336
|
-
/* @__PURE__ */ (0,
|
|
4337
|
-
/* @__PURE__ */ (0,
|
|
4338
|
-
/* @__PURE__ */ (0,
|
|
4725
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4726
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#5f87af", children: "\u2502 " }),
|
|
4727
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, wrap: "truncate-end", children: compactWebSource(item.url) })
|
|
4339
4728
|
] })
|
|
4340
4729
|
] }, item.url)),
|
|
4341
|
-
/* @__PURE__ */ (0,
|
|
4342
|
-
/* @__PURE__ */ (0,
|
|
4343
|
-
/* @__PURE__ */ (0,
|
|
4730
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4731
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#5f87af", children: "\u2514\u2500 " }),
|
|
4732
|
+
/* @__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
4733
|
] })
|
|
4345
4734
|
] });
|
|
4346
4735
|
}
|
|
@@ -4358,43 +4747,43 @@ function JobPresentationView({
|
|
|
4358
4747
|
presentation,
|
|
4359
4748
|
expanded
|
|
4360
4749
|
}) {
|
|
4361
|
-
if (presentation.action === "list") return /* @__PURE__ */ (0,
|
|
4750
|
+
if (presentation.action === "list") return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(JobListPresentationView, { presentation, expanded });
|
|
4362
4751
|
const state = presentation.state ?? "running";
|
|
4363
4752
|
const tone = jobStateColor(state);
|
|
4364
4753
|
const lines = jobOutputLines(presentation.output ?? "");
|
|
4365
4754
|
const visibleLines = expanded ? lines : [];
|
|
4366
4755
|
const hiddenLines = lines.length - visibleLines.length;
|
|
4367
4756
|
const showLog = presentation.action === "read" || presentation.action === "kill" || lines.length > 0;
|
|
4368
|
-
return /* @__PURE__ */ (0,
|
|
4369
|
-
/* @__PURE__ */ (0,
|
|
4370
|
-
/* @__PURE__ */ (0,
|
|
4371
|
-
/* @__PURE__ */ (0,
|
|
4757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
|
|
4758
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4759
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u250C\u2500 " }),
|
|
4760
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: tone, bold: true, children: [
|
|
4372
4761
|
"JOB \xB7 ",
|
|
4373
4762
|
state.toUpperCase()
|
|
4374
4763
|
] })
|
|
4375
4764
|
] }),
|
|
4376
|
-
/* @__PURE__ */ (0,
|
|
4377
|
-
/* @__PURE__ */ (0,
|
|
4378
|
-
/* @__PURE__ */ (0,
|
|
4379
|
-
presentation.jobKind === void 0 ? null : /* @__PURE__ */ (0,
|
|
4765
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4766
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2502 " }),
|
|
4767
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:whiteBright", bold: true, children: presentation.id ?? "unknown job" }),
|
|
4768
|
+
presentation.jobKind === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: ` \xB7 ${presentation.jobKind}` })
|
|
4380
4769
|
] }),
|
|
4381
|
-
presentation.label === void 0 ? null : /* @__PURE__ */ (0,
|
|
4382
|
-
/* @__PURE__ */ (0,
|
|
4383
|
-
/* @__PURE__ */ (0,
|
|
4770
|
+
presentation.label === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4771
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2502 " }),
|
|
4772
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "ansi:whiteBright", wrap: "truncate-end", children: presentation.label })
|
|
4384
4773
|
] }),
|
|
4385
|
-
presentation.error === void 0 ? null : /* @__PURE__ */ (0,
|
|
4386
|
-
/* @__PURE__ */ (0,
|
|
4387
|
-
/* @__PURE__ */ (0,
|
|
4774
|
+
presentation.error === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4775
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2502 " }),
|
|
4776
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#e06c50", wrap: "truncate-end", children: presentation.error })
|
|
4388
4777
|
] }),
|
|
4389
|
-
showLog ? /* @__PURE__ */ (0,
|
|
4390
|
-
/* @__PURE__ */ (0,
|
|
4391
|
-
/* @__PURE__ */ (0,
|
|
4392
|
-
/* @__PURE__ */ (0,
|
|
4393
|
-
/* @__PURE__ */ (0,
|
|
4778
|
+
showLog ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
4779
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4780
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u251C\u2500 " }),
|
|
4781
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, bold: true, children: "LOG" }),
|
|
4782
|
+
/* @__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
4783
|
] }),
|
|
4395
|
-
hiddenLines > 0 ? /* @__PURE__ */ (0,
|
|
4396
|
-
/* @__PURE__ */ (0,
|
|
4397
|
-
/* @__PURE__ */ (0,
|
|
4784
|
+
hiddenLines > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4785
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2502 " }),
|
|
4786
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { dimColor: true, children: [
|
|
4398
4787
|
"\u2026 ",
|
|
4399
4788
|
hiddenLines,
|
|
4400
4789
|
" earlier ",
|
|
@@ -4402,11 +4791,11 @@ function JobPresentationView({
|
|
|
4402
4791
|
" hidden"
|
|
4403
4792
|
] })
|
|
4404
4793
|
] }) : null,
|
|
4405
|
-
visibleLines.map((line, index) => /* @__PURE__ */ (0,
|
|
4794
|
+
visibleLines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(JobLogLine, { line, tone }, `${index}:${line}`))
|
|
4406
4795
|
] }) : null,
|
|
4407
|
-
/* @__PURE__ */ (0,
|
|
4408
|
-
/* @__PURE__ */ (0,
|
|
4409
|
-
/* @__PURE__ */ (0,
|
|
4796
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4797
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2514\u2500 " }),
|
|
4798
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: jobFooter(presentation) })
|
|
4410
4799
|
] })
|
|
4411
4800
|
] });
|
|
4412
4801
|
}
|
|
@@ -4416,41 +4805,41 @@ function JobListPresentationView({
|
|
|
4416
4805
|
}) {
|
|
4417
4806
|
const jobs = presentation.jobs ?? [];
|
|
4418
4807
|
const visibleJobs = expanded ? jobs : [];
|
|
4419
|
-
return /* @__PURE__ */ (0,
|
|
4420
|
-
/* @__PURE__ */ (0,
|
|
4421
|
-
/* @__PURE__ */ (0,
|
|
4422
|
-
/* @__PURE__ */ (0,
|
|
4808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
|
|
4809
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4810
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#d7a657", children: "\u250C\u2500 " }),
|
|
4811
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "#d7a657", bold: true, children: [
|
|
4423
4812
|
"JOBS \xB7 ",
|
|
4424
4813
|
jobs.length
|
|
4425
4814
|
] })
|
|
4426
4815
|
] }),
|
|
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,
|
|
4816
|
+
jobs.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4817
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#d7a657", children: "\u2502 " }),
|
|
4818
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { dimColor: true, children: "No background jobs" })
|
|
4819
|
+
] }) : visibleJobs.map((job) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4820
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#d7a657", children: "\u2502 " }),
|
|
4821
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: jobStateColor(job.state), bold: true, children: job.state.toUpperCase().padEnd(9) }),
|
|
4822
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "ansi:whiteBright", children: [
|
|
4434
4823
|
" ",
|
|
4435
4824
|
job.id
|
|
4436
4825
|
] }),
|
|
4437
|
-
/* @__PURE__ */ (0,
|
|
4826
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { dimColor: true, wrap: "truncate-end", children: [
|
|
4438
4827
|
" \xB7 ",
|
|
4439
4828
|
job.label
|
|
4440
4829
|
] })
|
|
4441
4830
|
] }, job.id)),
|
|
4442
|
-
/* @__PURE__ */ (0,
|
|
4443
|
-
/* @__PURE__ */ (0,
|
|
4444
|
-
/* @__PURE__ */ (0,
|
|
4831
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4832
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "#d7a657", children: "\u2514\u2500 " }),
|
|
4833
|
+
/* @__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
4834
|
] })
|
|
4446
4835
|
] });
|
|
4447
4836
|
}
|
|
4448
4837
|
function JobLogLine({ line, tone }) {
|
|
4449
4838
|
const error = /^(?:\[stderr\]|ERR(?:OR)?(?:!|:|\s)|npm ERR!)/iu.test(line.trimStart());
|
|
4450
4839
|
const stage = /^={3}.*={3}$/u.test(line.trim());
|
|
4451
|
-
return /* @__PURE__ */ (0,
|
|
4452
|
-
/* @__PURE__ */ (0,
|
|
4453
|
-
/* @__PURE__ */ (0,
|
|
4840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { children: [
|
|
4841
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: tone, children: "\u2502 " }),
|
|
4842
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4454
4843
|
Text,
|
|
4455
4844
|
{
|
|
4456
4845
|
...error ? { color: "#e06c50" } : stage ? { color: "ansi:cyanBright", bold: true } : { dimColor: true },
|
|
@@ -4622,11 +5011,11 @@ function PromptLineContent({
|
|
|
4622
5011
|
styledCount
|
|
4623
5012
|
}) {
|
|
4624
5013
|
const tokenStyle = completedSlashTokenPresentation();
|
|
4625
|
-
return /* @__PURE__ */ (0,
|
|
5014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { children: [
|
|
4626
5015
|
points.map((point, index) => {
|
|
4627
5016
|
const styled = index < styledCount;
|
|
4628
5017
|
const caret = cursorVisible && index === cursor;
|
|
4629
|
-
return /* @__PURE__ */ (0,
|
|
5018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4630
5019
|
Text,
|
|
4631
5020
|
{
|
|
4632
5021
|
...styled ? tokenStyle : {},
|
|
@@ -4636,7 +5025,7 @@ function PromptLineContent({
|
|
|
4636
5025
|
index
|
|
4637
5026
|
);
|
|
4638
5027
|
}),
|
|
4639
|
-
cursorVisible && cursor >= points.length ? /* @__PURE__ */ (0,
|
|
5028
|
+
cursorVisible && cursor >= points.length ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { inverse: true, children: " " }) : null
|
|
4640
5029
|
] });
|
|
4641
5030
|
}
|
|
4642
5031
|
function editPrompt(state, edit) {
|