@xingular/harness 1.5.0-unstable → 1.6.0-unstable

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.
Files changed (95) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/browser-extension/README.md +32 -0
  3. package/browser-extension/background.js +612 -0
  4. package/browser-extension/manifest.json +16 -0
  5. package/browser-extension/overlay.js +97 -0
  6. package/browser-extension/popup.css +19 -0
  7. package/browser-extension/popup.html +30 -0
  8. package/browser-extension/popup.js +101 -0
  9. package/browser-extension/site-access.js +63 -0
  10. package/dist/cli.js +1489 -680
  11. package/dist/sdk/browser/config.d.ts +3 -0
  12. package/dist/sdk/browser/config.js +2 -1
  13. package/dist/sdk/browser/extension/bridge.d.ts +55 -0
  14. package/dist/sdk/browser/extension/bridge.js +336 -0
  15. package/dist/sdk/browser/extension/session.d.ts +50 -0
  16. package/dist/sdk/browser/extension/session.js +321 -0
  17. package/dist/sdk/browser/index.d.ts +7 -2
  18. package/dist/sdk/browser/index.js +58 -25
  19. package/dist/sdk/browser/serverMethods.js +4 -1
  20. package/dist/sdk/browser/tools.d.ts +99 -2
  21. package/dist/sdk/browser/tools.js +6 -1
  22. package/dist/sdk/commands/registry.d.ts +5 -0
  23. package/dist/sdk/commands/registry.js +1 -0
  24. package/dist/sdk/harness.d.ts +4 -0
  25. package/dist/sdk/harness.js +1 -1
  26. package/dist/sdk/pi/retryPolicy.d.ts +19 -0
  27. package/dist/sdk/pi/retryPolicy.js +11 -0
  28. package/dist/sdk/prompt/compile.d.ts +0 -2
  29. package/dist/sdk/prompt/compile.js +2 -6
  30. package/dist/sdk/prompt/reporting.d.ts +1 -1
  31. package/dist/sdk/prompt/reporting.js +30 -13
  32. package/dist/sdk/prompt/standard.d.ts +1 -1
  33. package/dist/sdk/prompt/standard.js +1 -1
  34. package/dist/sdk/remote/webClient.js +6 -2
  35. package/dist/sdk/sessions/contracts.d.ts +2 -0
  36. package/dist/sdk/sessions/contracts.js +5 -1
  37. package/dist/sdk/sessions/planMode.d.ts +16 -6
  38. package/dist/sdk/sessions/planMode.js +59 -23
  39. package/dist/sdk/sessions/runner.js +14 -5
  40. package/dist/sdk/sessions/workSlice.d.ts +15 -1
  41. package/dist/sdk/sessions/workSlice.js +17 -9
  42. package/dist/sdk/terminal/controller.d.ts +6 -0
  43. package/dist/sdk/terminal/controller.js +44 -5
  44. package/dist/sdk/terminal/opentui/model.js +3 -1
  45. package/dist/sdk/terminal/piExtension.js +7 -2
  46. package/dist/sdk/terminal/stallWatch.d.ts +18 -0
  47. package/dist/sdk/terminal/stallWatch.js +20 -0
  48. package/dist/sdk/terminal/subagentMonitor.d.ts +2 -0
  49. package/dist/sdk/terminal/subagentMonitor.js +4 -1
  50. package/dist/sdk/terminal/terminals.js +35 -4
  51. package/dist/sdk/terminal/toolName.d.ts +6 -0
  52. package/dist/sdk/terminal/toolName.js +12 -0
  53. package/dist/sdk/terminal/tui/commandPages.d.ts +1 -1
  54. package/dist/sdk/terminal/tui/commandPages.js +3 -0
  55. package/dist/sdk/terminal/tui/commands.d.ts +14 -0
  56. package/dist/sdk/terminal/tui/commands.js +4 -1
  57. package/dist/sdk/terminal/tui/pages/followUpQueuePage.d.ts +34 -0
  58. package/dist/sdk/terminal/tui/pages/followUpQueuePage.js +130 -0
  59. package/dist/sdk/terminal/tui/pages/trajectoryPage.js +37 -7
  60. package/dist/sdk/terminal/tui/runtime.js +2 -1
  61. package/dist/sdk/terminal/tui/settingsModel.js +88 -7
  62. package/dist/sdk/tools/askUser.js +2 -2
  63. package/dist/sdk/world/world.d.ts +12 -2
  64. package/dist/sdk/world/world.js +42 -4
  65. package/dist/terminal-opentui.js +1456 -756
  66. package/dist/terminal-pi.js +62 -31
  67. package/docs/README.md +1 -0
  68. package/docs/architecture/02-sessions-and-runs.md +43 -25
  69. package/docs/architecture/04-prompt.md +23 -22
  70. package/docs/architecture/10-server-protocol.md +23 -3
  71. package/docs/architecture/11-terminal.md +41 -29
  72. package/docs/architecture/12-storage.md +2 -1
  73. package/docs/architecture/13-world-tools.md +35 -22
  74. package/docs/architecture/14-surfaces-and-parity.md +24 -20
  75. package/docs/architecture/README.md +4 -1
  76. package/docs/architecture/proposals/PROP-0026-connected-sketch-display.md +3 -1
  77. package/docs/decisions/ADR-0027-connected-sketch-display.md +4 -2
  78. package/docs/decisions/ADR-0076-codex-final-answer-verbatim.md +6 -1
  79. package/docs/decisions/ADR-0077-plan-runs-may-conclude-no-plan-needed.md +120 -0
  80. package/docs/decisions/ADR-0078-child-aware-stall-watch.md +46 -0
  81. package/docs/decisions/ADR-0079-phase-led-reporting-guidance.md +72 -0
  82. package/docs/decisions/ADR-0080-fixed-width-question-sketch-canvas.md +50 -0
  83. package/docs/decisions/ADR-0081-no-work-slice-budget-by-default.md +36 -0
  84. package/docs/decisions/ADR-0082-connected-brave-browser.md +72 -0
  85. package/docs/parity.md +7 -5
  86. package/docs/releases/1.5.0-unstable.md +12 -3
  87. package/docs/releases/1.5.1-unstable.md +24 -0
  88. package/docs/releases/1.6.0-unstable.md +59 -0
  89. package/docs/study/00-index.md +17 -1
  90. package/docs/study/STUDY-0007-claude-code-prompt.md +162 -0
  91. package/docs/study/STUDY-0008-browser-control.md +281 -0
  92. package/docs/study/STUDY-0009-claude-code-reporting.md +205 -0
  93. package/docs/study/sources/claude-code.md +51 -39
  94. package/docs/terminal-tui.md +46 -18
  95. package/package.json +2 -1
@@ -20,7 +20,7 @@ import {
20
20
  initTheme,
21
21
  resizeImage
22
22
  } from "@earendil-works/pi-coding-agent";
23
- import { matchesKey as matchesKey21 } from "@earendil-works/pi-tui";
23
+ import { matchesKey as matchesKey22 } from "@earendil-works/pi-tui";
24
24
 
25
25
  // src/terminal/client.ts
26
26
  import { createConnection } from "net";
@@ -382,6 +382,7 @@ var CORE_COMMANDS = [
382
382
  { name: "copy", description: "Copy the last reply", group: "Inspect", kind: "local", methods: ["sessions.lastReply"] },
383
383
  { name: "export", args: "[path.html|path.jsonl]", description: "Export this branch to HTML or JSONL", group: "Inspect", kind: "session", methods: ["sessions.export", "sessions.run"] },
384
384
  { name: "todo", aliases: ["checklist"], description: "Show the current todo list", group: "Inspect", kind: "session", methods: ["runs.todo"] },
385
+ { name: "follow-up", description: "Manage queued follow-up and steering messages", group: "Run", kind: "page" },
385
386
  { name: "trajectory", args: "[run-id]", description: "Inspect recorded runs for this session", group: "Inspect", kind: "page", methods: ["runs.list", "runs.events"] },
386
387
  { name: "reload", description: "Reload trusted resources and keybindings", group: "Harness", kind: "session", methods: ["sessions.reload"] },
387
388
  { name: "accounts", description: "Sign in, switch, check and remove Pi accounts", group: "Harness", kind: "page", methods: ["accounts.list"] },
@@ -1232,7 +1233,9 @@ var heartbeatPayload = z.object({
1232
1233
  lastTool: z.string().max(120).nullable(),
1233
1234
  compactions: z.number().int().nonnegative(),
1234
1235
  slice: z.number().int().positive(),
1235
- maxToolCalls: z.number().int().nonnegative()
1236
+ maxToolCalls: z.number().int().nonnegative(),
1237
+ activeTools: z.array(z.string().max(120)).max(16).optional(),
1238
+ oldestToolMs: z.number().nonnegative().optional()
1236
1239
  }).strict();
1237
1240
  var artifactPayload = z.object({ artifactId: z.string(), name: z.string(), file: z.unknown().optional() });
1238
1241
  var fileChangedPayload = z.object({ path: z.string(), change: z.enum(["added", "modified", "deleted"]) });
@@ -1666,7 +1669,7 @@ function askUserTool(run) {
1666
1669
  return {
1667
1670
  name: ASK_USER,
1668
1671
  label: "Ask the user",
1669
- description: "Ask the user one to five related questions in one request and wait until they answer the batch. Give each question a concise 1\u20132 word label and aim to keep each question to 25 words or fewer. " + "Every question must offer 1\u20136 short choices, each with a helpful description of 25 words or fewer, and at least one choice must be marked recommended: true. Recommendations are visual only: they never preselect an answer, and submitted choices keep their original labels. Mark at most one recommended choice for a single-choice question, or several when multiSelect is true. Every question also includes a free-text \u201CSomething else\u201D answer. Set multiSelect when several can apply. When a UI diagram helps compare choices, set uiSketch: true and give every choice a detailed, bounded ASCII wireframe. Use ASCII tables and panel borders to show the affected element with relevant neighboring UI, readable labels and spacing. Keep each panel\u2019s outer `+` corners in fixed columns, include side edges at those same columns on every content row, and run horizontal borders corner to corner; if a title sits in a top border, leave at least two dashes on both sides. Keep framing consistent across alternatives and concentrate detail on what changes. Do not substitute a symbolic logo or one-line illustration. The preview supplies its outer border; draw internal borders only for actual UI panels. Use it when you need a decision the request and the files do not answer, not for small talk and never to ask permission for work inside the request. If no answer arrives, continue with your best judgment instead of asking again or treating the turn as blocked. Never use it to ask for a login, a secret or a credential: give the exact command in the reply instead.",
1672
+ description: "Ask the user one to five related questions in one request and wait until they answer the batch. Give each question a concise 1\u20132 word label and aim to keep each question to 25 words or fewer. " + "Every question must offer 1\u20136 short choices, each with a helpful description of 25 words or fewer, and at least one choice must be marked recommended: true. Recommendations are visual only: they never preselect an answer, and submitted choices keep their original labels. Mark at most one recommended choice for a single-choice question, or several when multiSelect is true. Every question also includes a free-text \u201CSomething else\u201D answer. Set multiSelect when several can apply. When a UI diagram helps compare choices, set uiSketch: true and give every choice a detailed ASCII wireframe on a fixed 80-column canvas. Use the full canvas to show the affected element and relevant neighboring UI with readable labels, controls and spacing; keep rows aligned but omit trailing spaces where convenient. Keep each panel\u2019s outer `+` corners in fixed columns, include side edges at those same columns on every content row, and run horizontal borders corner to corner; if a title sits in a top border, leave at least two dashes on both sides. Keep framing consistent across alternatives and concentrate detail on what changes. Do not substitute a symbolic logo or one-line illustration. The preview supplies its outer border; draw internal borders only for actual UI panels. Use it when you need a decision the request and the files do not answer, not for small talk and never to ask permission for work inside the request. If no answer arrives, continue with your best judgment instead of asking again or treating the turn as blocked. Never use it to ask for a login, a secret or a credential: give the exact command in the reply instead.",
1670
1673
  parameters: (Type) => Type.Object({
1671
1674
  questions: Type.Array(Type.Object({
1672
1675
  summary: Type.String({ description: "A concise label of one or two words" }),
@@ -1676,7 +1679,7 @@ function askUserTool(run) {
1676
1679
  label: Type.String({ description: "A short choice; do not add a recommendation suffix to the label" }),
1677
1680
  description: Type.String({ description: "Required. Briefly explain this choice in 25 words or fewer." }),
1678
1681
  recommended: Type.Optional(Type.Boolean({ description: "Whether to show this choice as a visual recommendation; at least one choice per question must be recommended, it is not preselected, and answers use the original label" })),
1679
- sketch: Type.Optional(Type.String({ minLength: 1, maxLength: QUESTION_SKETCH_MAX_LENGTH, pattern: QUESTION_SKETCH_PATTERN, description: "Literal ASCII UI wireframe: 1\u201324 LF-separated lines, at most 80 printable ASCII characters per line. Include the affected element and neighboring UI using structured table/panel borders with fixed, matching outer-edge columns on every row. Required for every choice when uiSketch is true." }))
1682
+ sketch: Type.Optional(Type.String({ minLength: 1, maxLength: QUESTION_SKETCH_MAX_LENGTH, pattern: QUESTION_SKETCH_PATTERN, description: "Literal ASCII UI wireframe on a fixed 80-column canvas: 1\u201324 LF-separated lines, at most 80 printable ASCII characters per line; shorter rows are padded in the terminal preview. Include the affected element and neighboring UI using structured table/panel borders with fixed, matching outer-edge columns on every row. Required for every choice when uiSketch is true." }))
1680
1683
  }), {
1681
1684
  minItems: 1,
1682
1685
  maxItems: MAX_OPTIONS,
@@ -3003,6 +3006,12 @@ function webPart(options) {
3003
3006
  // src/browser/network.ts
3004
3007
  var OPEN_SCHEMES = new Set(["data:", "blob:", "about:"]);
3005
3008
 
3009
+ // src/browser/extension/bridge.ts
3010
+ var PAIR_MS = 5 * 60000;
3011
+
3012
+ // src/browser/extension/session.ts
3013
+ var ACTIONABLE = new Set(["button", "link", "textbox", "combobox", "checkbox", "radio", "menuitem", "tab", "switch", "option"]);
3014
+
3006
3015
  // src/browser/contracts.ts
3007
3016
  var SNAPSHOT_LINES = 500;
3008
3017
  var PAGE_CHARS2 = 20000;
@@ -3137,7 +3146,7 @@ var BROWSER_TOOLS = [
3137
3146
  var BROWSER_PLUGIN = {
3138
3147
  id: "browser",
3139
3148
  title: "Browser",
3140
- description: "A browser the agent drives: open pages that need scripts, read them, click, type and choose. Each session has its own; sign-ins are kept per agent on this device. Sending, buying, deleting, account changes and granting access always ask you.",
3149
+ description: "The browser backend selected by the person: an isolated Harness profile or the connected Brave profile. Brave exposes only normal tabs on sites explicitly allowed in the extension, never Incognito; a disconnect refuses calls and never switches backends. Sending, buying, deleting, account changes and granting access always ask you.",
3141
3150
  manage: "tools",
3142
3151
  switchable: { on: true },
3143
3152
  tools: BROWSER_TOOL_NAMES.map((name) => ({ name }))
@@ -3634,7 +3643,10 @@ function webServerMethods(harness) {
3634
3643
  function browserServerMethods(harness) {
3635
3644
  return {
3636
3645
  "browser.config": () => harness.world.browserConfig(),
3637
- "browser.configure": (params) => harness.world.configureBrowser(pick(params, ["headed", "cdpUrl", "executablePath", "allowPrivate", "allowedDomains"]))
3646
+ "browser.configure": (params) => harness.world.configureBrowser(pick(params, ["backend", "headed", "cdpUrl", "executablePath", "allowPrivate", "allowedDomains"])),
3647
+ "browser.extension.status": () => harness.world.browserExtensionStatus(),
3648
+ "browser.extension.start": () => harness.world.browserExtensionStart(),
3649
+ "browser.extension.stop": () => harness.world.browserExtensionStop()
3638
3650
  };
3639
3651
  }
3640
3652
 
@@ -11262,6 +11274,234 @@ class SettingsPage {
11262
11274
 
11263
11275
  // src/terminal/tui/pages/trajectoryPage.ts
11264
11276
  import { matchesKey as matchesKey14, stripTerminalSequences as stripTerminalSequences4, truncateToWidth as truncateToWidth14, visibleWidth as visibleWidth9, wrapTextWithAnsi as wrapTextWithAnsi9 } from "@earendil-works/pi-tui";
11277
+
11278
+ // src/terminal/tui/workingStatus.ts
11279
+ var WORKING_VERBS = [
11280
+ "Accomplishing",
11281
+ "Actioning",
11282
+ "Actualizing",
11283
+ "Architecting",
11284
+ "Baking",
11285
+ "Beaming",
11286
+ "Beboppin'",
11287
+ "Befuddling",
11288
+ "Billowing",
11289
+ "Blanching",
11290
+ "Bloviating",
11291
+ "Boogieing",
11292
+ "Boondoggling",
11293
+ "Booping",
11294
+ "Bootstrapping",
11295
+ "Brewing",
11296
+ "Bunning",
11297
+ "Burrowing",
11298
+ "Calculating",
11299
+ "Canoodling",
11300
+ "Caramelizing",
11301
+ "Cascading",
11302
+ "Catapulting",
11303
+ "Cerebrating",
11304
+ "Channeling",
11305
+ "Choreographing",
11306
+ "Churning",
11307
+ "Clauding",
11308
+ "Coalescing",
11309
+ "Cogitating",
11310
+ "Combobulating",
11311
+ "Composing",
11312
+ "Computing",
11313
+ "Concocting",
11314
+ "Considering",
11315
+ "Contemplating",
11316
+ "Cooking",
11317
+ "Crafting",
11318
+ "Creating",
11319
+ "Crunching",
11320
+ "Crystallizing",
11321
+ "Cultivating",
11322
+ "Deciphering",
11323
+ "Deliberating",
11324
+ "Determining",
11325
+ "Dilly-dallying",
11326
+ "Discombobulating",
11327
+ "Doing",
11328
+ "Doodling",
11329
+ "Drizzling",
11330
+ "Ebbing",
11331
+ "Effecting",
11332
+ "Elucidating",
11333
+ "Embellishing",
11334
+ "Enchanting",
11335
+ "Envisioning",
11336
+ "Fermenting",
11337
+ "Fiddle-faddling",
11338
+ "Finagling",
11339
+ "Flamb\xE9ing",
11340
+ "Flibbertigibbeting",
11341
+ "Flowing",
11342
+ "Flummoxing",
11343
+ "Fluttering",
11344
+ "Forging",
11345
+ "Forming",
11346
+ "Frolicking",
11347
+ "Frosting",
11348
+ "Gallivanting",
11349
+ "Galloping",
11350
+ "Garnishing",
11351
+ "Generating",
11352
+ "Gesticulating",
11353
+ "Germinating",
11354
+ "Gitifying",
11355
+ "Grooving",
11356
+ "Gusting",
11357
+ "Harmonizing",
11358
+ "Hashing",
11359
+ "Hatching",
11360
+ "Herding",
11361
+ "Honking",
11362
+ "Hullaballooing",
11363
+ "Hyperspacing",
11364
+ "Ideating",
11365
+ "Imagining",
11366
+ "Improvising",
11367
+ "Incubating",
11368
+ "Inferring",
11369
+ "Infusing",
11370
+ "Ionizing",
11371
+ "Jitterbugging",
11372
+ "Julienning",
11373
+ "Kerfuffling",
11374
+ "Kneading",
11375
+ "Leavening",
11376
+ "Levitating",
11377
+ "Lollygagging",
11378
+ "Manifesting",
11379
+ "Marinating",
11380
+ "Meandering",
11381
+ "Metamorphosing",
11382
+ "Misting",
11383
+ "Moonwalking",
11384
+ "Moseying",
11385
+ "Mulling",
11386
+ "Mustering",
11387
+ "Nebulizing",
11388
+ "Nesting",
11389
+ "Newspapering",
11390
+ "Noodling",
11391
+ "Nucleating",
11392
+ "Onioning",
11393
+ "Orbiting",
11394
+ "Orchestrating",
11395
+ "Osmosing",
11396
+ "Perambulating",
11397
+ "Percolating",
11398
+ "Perusing",
11399
+ "Philosophizing",
11400
+ "Photosynthesizing",
11401
+ "Polishing",
11402
+ "Pollinating",
11403
+ "Pondering",
11404
+ "Pontificating",
11405
+ "Pouncing",
11406
+ "Precipitating",
11407
+ "Prestidigitating",
11408
+ "Processing",
11409
+ "Proofing",
11410
+ "Propagating",
11411
+ "Puttering",
11412
+ "Puzzling",
11413
+ "Quantumizing",
11414
+ "Razzle-dazzling",
11415
+ "Razzmatazzing",
11416
+ "Recombobulating",
11417
+ "Reticulating",
11418
+ "Roosting",
11419
+ "Ruminating",
11420
+ "Saut\xE9ing",
11421
+ "Scampering",
11422
+ "Schlepping",
11423
+ "Scurrying",
11424
+ "Seasoning",
11425
+ "Shenaniganing",
11426
+ "Shimmying",
11427
+ "Simmering",
11428
+ "Skedaddling",
11429
+ "Sketching",
11430
+ "Slithering",
11431
+ "Smooshing",
11432
+ "Sock-hopping",
11433
+ "Spelunking",
11434
+ "Spinning",
11435
+ "Sprouting",
11436
+ "Stewing",
11437
+ "Sublimating",
11438
+ "Swirling",
11439
+ "Swooping",
11440
+ "Symbioting",
11441
+ "Synthesizing",
11442
+ "Tempering",
11443
+ "Thinking",
11444
+ "Thundering",
11445
+ "Tinkering",
11446
+ "Tomfoolering",
11447
+ "Topsy-turvying",
11448
+ "Transfiguring",
11449
+ "Transmogrifying",
11450
+ "Transmuting",
11451
+ "Twisting",
11452
+ "Undulating",
11453
+ "Unfurling",
11454
+ "Unraveling",
11455
+ "Vibing",
11456
+ "Waddling",
11457
+ "Wandering",
11458
+ "Warping",
11459
+ "Whatchamacalliting",
11460
+ "Whirlpooling",
11461
+ "Whirring",
11462
+ "Whisking",
11463
+ "Wibbling",
11464
+ "Working",
11465
+ "Wrangling",
11466
+ "Zesting",
11467
+ "Zigzagging"
11468
+ ];
11469
+ var COMPLETION_VERBS = ["Baked", "Brewed", "Churned", "Cogitated", "Cooked", "Crunched", "Saut\xE9ed", "Worked"];
11470
+ var SPINNER_INTERVAL_MS = 80;
11471
+ var spinnerSequence = ["\xB7", "\u2722", "\u2733", "\u2736", "\u273B", "\u273D"];
11472
+ var ghosttySpinnerSequence = ["\xB7", "\u2722", "\u2733", "\u2736", "\u273B", "\u273B"];
11473
+ var spinnerFrames = [...spinnerSequence, ...spinnerSequence.slice().reverse()];
11474
+ var ghosttySpinnerFrames = [...ghosttySpinnerSequence, ...ghosttySpinnerSequence.slice().reverse()];
11475
+ function getWorkingSpinnerFrames(term) {
11476
+ return term === "xterm-ghostty" ? ghosttySpinnerFrames : spinnerFrames;
11477
+ }
11478
+ function spinnerFrameAt(elapsedMs, frames, intervalMs = SPINNER_INTERVAL_MS) {
11479
+ if (frames.length === 0)
11480
+ return "";
11481
+ const elapsed = Number.isFinite(elapsedMs) ? Math.max(0, elapsedMs) : 0;
11482
+ const interval = Number.isFinite(intervalMs) ? Math.max(1, intervalMs) : SPINNER_INTERVAL_MS;
11483
+ return frames[Math.floor(elapsed / interval) % frames.length] ?? "";
11484
+ }
11485
+ function chooseWorkingVerb(random = Math.random) {
11486
+ const sample = random();
11487
+ const index = Number.isFinite(sample) ? Math.min(WORKING_VERBS.length - 1, Math.max(0, Math.floor(sample * WORKING_VERBS.length))) : 0;
11488
+ return WORKING_VERBS[index] ?? "Working";
11489
+ }
11490
+ function chooseCompletionVerb(turnId) {
11491
+ let hash = 0;
11492
+ for (let index = 0;index < turnId.length; index += 1) {
11493
+ hash = (hash << 5) - hash + turnId.charCodeAt(index) | 0;
11494
+ }
11495
+ return COMPLETION_VERBS[(hash >>> 0) % COMPLETION_VERBS.length] ?? "Worked";
11496
+ }
11497
+ function formatWorkingDuration(durationMs) {
11498
+ const seconds = Math.floor((Number.isFinite(durationMs) ? Math.max(0, durationMs) : 0) / 1000);
11499
+ const minutes = Math.floor(seconds / 60);
11500
+ const remainingSeconds = seconds % 60;
11501
+ return minutes > 0 ? `${minutes}m${remainingSeconds ? ` ${remainingSeconds}s` : ""}` : `${seconds}s`;
11502
+ }
11503
+
11504
+ // src/terminal/tui/pages/trajectoryPage.ts
11265
11505
  var ACTIVE = new Set(["queued", "running", "waiting_for_approval", "waiting_for_input"]);
11266
11506
  var payloadOf2 = (event) => event.payload && typeof event.payload === "object" ? event.payload : {};
11267
11507
  var stringOf2 = (value) => typeof value === "string" ? value : undefined;
@@ -11305,10 +11545,17 @@ function eventDescription(event) {
11305
11545
  return "Recorded prompt and tool definitions";
11306
11546
  case "failed":
11307
11547
  return stringOf2(payload.message) ?? stringOf2(payload.code) ?? "run failed";
11548
+ case "heartbeat":
11549
+ return heartbeatDescription(payload);
11308
11550
  default:
11309
11551
  return stringOf2(payload.text) ?? stringOf2(payload.name) ?? "";
11310
11552
  }
11311
11553
  }
11554
+ function heartbeatDescription(payload) {
11555
+ const tools = Array.isArray(payload.activeTools) ? payload.activeTools.filter((name) => typeof name === "string") : [];
11556
+ const oldest = numberOf2(payload.oldestToolMs);
11557
+ return tools.length ? `${tools.join(", ")}${oldest === undefined ? "" : ` ${formatWorkingDuration(oldest)}`}` : "no tool running";
11558
+ }
11312
11559
  function usageLine(events) {
11313
11560
  const event = [...events].reverse().find((item) => item.type === "usage.updated");
11314
11561
  if (!event)
@@ -11505,13 +11752,33 @@ class TrajectoryPage {
11505
11752
  }));
11506
11753
  }
11507
11754
  eventRows() {
11508
- return this.events.map((event) => ({
11509
- id: String(event.sequence),
11510
- label: `${timeOf2(event.timestamp)} ${event.type}`,
11511
- detail: safe2(eventDescription(event)),
11512
- searchText: `${event.timestamp} ${event.type} ${safe2(eventDescription(event))} ${safe2(JSON.stringify(payloadOf2(event)))}`,
11513
- data: event
11514
- }));
11755
+ const rows = [];
11756
+ let beats = [];
11757
+ const flush = () => {
11758
+ const last = beats.at(-1);
11759
+ if (!last)
11760
+ return;
11761
+ const count = beats.length > 1 ? `\xD7${beats.length} \xB7 ` : "";
11762
+ const detail = count + safe2(eventDescription(last));
11763
+ rows.push({ id: String(last.sequence), label: `${timeOf2(last.timestamp)} ${last.type}`, detail, searchText: `${last.timestamp} ${last.type} ${detail}`, data: last });
11764
+ beats = [];
11765
+ };
11766
+ for (const event of this.events) {
11767
+ if (event.type === "heartbeat") {
11768
+ beats.push(event);
11769
+ continue;
11770
+ }
11771
+ flush();
11772
+ rows.push({
11773
+ id: String(event.sequence),
11774
+ label: `${timeOf2(event.timestamp)} ${event.type}`,
11775
+ detail: safe2(eventDescription(event)),
11776
+ searchText: `${event.timestamp} ${event.type} ${safe2(eventDescription(event))} ${safe2(JSON.stringify(payloadOf2(event)))}`,
11777
+ data: event
11778
+ });
11779
+ }
11780
+ flush();
11781
+ return rows;
11515
11782
  }
11516
11783
  eventJson(event) {
11517
11784
  return JSON.stringify({ payload: event.payload, type: event.type, sequence: event.sequence, timestamp: event.timestamp }, null, 2);
@@ -12610,6 +12877,11 @@ class AnnotatePage {
12610
12877
  // src/terminal/tui/pages/subagentsPage.ts
12611
12878
  import { matchesKey as matchesKey16, stripTerminalSequences as stripTerminalSequences7, truncateToWidth as truncateToWidth19, wrapTextWithAnsi as wrapTextWithAnsi11 } from "@earendil-works/pi-tui";
12612
12879
 
12880
+ // src/terminal/toolName.ts
12881
+ function toolDisplayName(name) {
12882
+ return name.split(/[^A-Za-z0-9]+/u).filter((part) => part !== "").map((part) => `${part.slice(0, 1).toUpperCase()}${part.slice(1)}`).join("");
12883
+ }
12884
+
12613
12885
  // src/terminal/subagentMonitor.ts
12614
12886
  var ACTIVE_SUBAGENT_STATUSES = new Set(["queued", "running", "waiting_for_approval", "waiting_for_input"]);
12615
12887
  function terminalSubagentDuration(activity, now = Date.now()) {
@@ -12720,234 +12992,6 @@ function toolColor(theme, status) {
12720
12992
 
12721
12993
  // src/terminal/opentui/subagentsWidget.ts
12722
12994
  import { stripTerminalSequences as stripTerminalSequences5, truncateToWidth as truncateToWidth17, visibleWidth as visibleWidth11 } from "@earendil-works/pi-tui";
12723
-
12724
- // src/terminal/tui/workingStatus.ts
12725
- var WORKING_VERBS = [
12726
- "Accomplishing",
12727
- "Actioning",
12728
- "Actualizing",
12729
- "Architecting",
12730
- "Baking",
12731
- "Beaming",
12732
- "Beboppin'",
12733
- "Befuddling",
12734
- "Billowing",
12735
- "Blanching",
12736
- "Bloviating",
12737
- "Boogieing",
12738
- "Boondoggling",
12739
- "Booping",
12740
- "Bootstrapping",
12741
- "Brewing",
12742
- "Bunning",
12743
- "Burrowing",
12744
- "Calculating",
12745
- "Canoodling",
12746
- "Caramelizing",
12747
- "Cascading",
12748
- "Catapulting",
12749
- "Cerebrating",
12750
- "Channeling",
12751
- "Choreographing",
12752
- "Churning",
12753
- "Clauding",
12754
- "Coalescing",
12755
- "Cogitating",
12756
- "Combobulating",
12757
- "Composing",
12758
- "Computing",
12759
- "Concocting",
12760
- "Considering",
12761
- "Contemplating",
12762
- "Cooking",
12763
- "Crafting",
12764
- "Creating",
12765
- "Crunching",
12766
- "Crystallizing",
12767
- "Cultivating",
12768
- "Deciphering",
12769
- "Deliberating",
12770
- "Determining",
12771
- "Dilly-dallying",
12772
- "Discombobulating",
12773
- "Doing",
12774
- "Doodling",
12775
- "Drizzling",
12776
- "Ebbing",
12777
- "Effecting",
12778
- "Elucidating",
12779
- "Embellishing",
12780
- "Enchanting",
12781
- "Envisioning",
12782
- "Fermenting",
12783
- "Fiddle-faddling",
12784
- "Finagling",
12785
- "Flamb\xE9ing",
12786
- "Flibbertigibbeting",
12787
- "Flowing",
12788
- "Flummoxing",
12789
- "Fluttering",
12790
- "Forging",
12791
- "Forming",
12792
- "Frolicking",
12793
- "Frosting",
12794
- "Gallivanting",
12795
- "Galloping",
12796
- "Garnishing",
12797
- "Generating",
12798
- "Gesticulating",
12799
- "Germinating",
12800
- "Gitifying",
12801
- "Grooving",
12802
- "Gusting",
12803
- "Harmonizing",
12804
- "Hashing",
12805
- "Hatching",
12806
- "Herding",
12807
- "Honking",
12808
- "Hullaballooing",
12809
- "Hyperspacing",
12810
- "Ideating",
12811
- "Imagining",
12812
- "Improvising",
12813
- "Incubating",
12814
- "Inferring",
12815
- "Infusing",
12816
- "Ionizing",
12817
- "Jitterbugging",
12818
- "Julienning",
12819
- "Kerfuffling",
12820
- "Kneading",
12821
- "Leavening",
12822
- "Levitating",
12823
- "Lollygagging",
12824
- "Manifesting",
12825
- "Marinating",
12826
- "Meandering",
12827
- "Metamorphosing",
12828
- "Misting",
12829
- "Moonwalking",
12830
- "Moseying",
12831
- "Mulling",
12832
- "Mustering",
12833
- "Nebulizing",
12834
- "Nesting",
12835
- "Newspapering",
12836
- "Noodling",
12837
- "Nucleating",
12838
- "Onioning",
12839
- "Orbiting",
12840
- "Orchestrating",
12841
- "Osmosing",
12842
- "Perambulating",
12843
- "Percolating",
12844
- "Perusing",
12845
- "Philosophizing",
12846
- "Photosynthesizing",
12847
- "Polishing",
12848
- "Pollinating",
12849
- "Pondering",
12850
- "Pontificating",
12851
- "Pouncing",
12852
- "Precipitating",
12853
- "Prestidigitating",
12854
- "Processing",
12855
- "Proofing",
12856
- "Propagating",
12857
- "Puttering",
12858
- "Puzzling",
12859
- "Quantumizing",
12860
- "Razzle-dazzling",
12861
- "Razzmatazzing",
12862
- "Recombobulating",
12863
- "Reticulating",
12864
- "Roosting",
12865
- "Ruminating",
12866
- "Saut\xE9ing",
12867
- "Scampering",
12868
- "Schlepping",
12869
- "Scurrying",
12870
- "Seasoning",
12871
- "Shenaniganing",
12872
- "Shimmying",
12873
- "Simmering",
12874
- "Skedaddling",
12875
- "Sketching",
12876
- "Slithering",
12877
- "Smooshing",
12878
- "Sock-hopping",
12879
- "Spelunking",
12880
- "Spinning",
12881
- "Sprouting",
12882
- "Stewing",
12883
- "Sublimating",
12884
- "Swirling",
12885
- "Swooping",
12886
- "Symbioting",
12887
- "Synthesizing",
12888
- "Tempering",
12889
- "Thinking",
12890
- "Thundering",
12891
- "Tinkering",
12892
- "Tomfoolering",
12893
- "Topsy-turvying",
12894
- "Transfiguring",
12895
- "Transmogrifying",
12896
- "Transmuting",
12897
- "Twisting",
12898
- "Undulating",
12899
- "Unfurling",
12900
- "Unraveling",
12901
- "Vibing",
12902
- "Waddling",
12903
- "Wandering",
12904
- "Warping",
12905
- "Whatchamacalliting",
12906
- "Whirlpooling",
12907
- "Whirring",
12908
- "Whisking",
12909
- "Wibbling",
12910
- "Working",
12911
- "Wrangling",
12912
- "Zesting",
12913
- "Zigzagging"
12914
- ];
12915
- var COMPLETION_VERBS = ["Baked", "Brewed", "Churned", "Cogitated", "Cooked", "Crunched", "Saut\xE9ed", "Worked"];
12916
- var SPINNER_INTERVAL_MS = 80;
12917
- var spinnerSequence = ["\xB7", "\u2722", "\u2733", "\u2736", "\u273B", "\u273D"];
12918
- var ghosttySpinnerSequence = ["\xB7", "\u2722", "\u2733", "\u2736", "\u273B", "\u273B"];
12919
- var spinnerFrames = [...spinnerSequence, ...spinnerSequence.slice().reverse()];
12920
- var ghosttySpinnerFrames = [...ghosttySpinnerSequence, ...ghosttySpinnerSequence.slice().reverse()];
12921
- function getWorkingSpinnerFrames(term) {
12922
- return term === "xterm-ghostty" ? ghosttySpinnerFrames : spinnerFrames;
12923
- }
12924
- function spinnerFrameAt(elapsedMs, frames, intervalMs = SPINNER_INTERVAL_MS) {
12925
- if (frames.length === 0)
12926
- return "";
12927
- const elapsed = Number.isFinite(elapsedMs) ? Math.max(0, elapsedMs) : 0;
12928
- const interval = Number.isFinite(intervalMs) ? Math.max(1, intervalMs) : SPINNER_INTERVAL_MS;
12929
- return frames[Math.floor(elapsed / interval) % frames.length] ?? "";
12930
- }
12931
- function chooseWorkingVerb(random = Math.random) {
12932
- const sample = random();
12933
- const index = Number.isFinite(sample) ? Math.min(WORKING_VERBS.length - 1, Math.max(0, Math.floor(sample * WORKING_VERBS.length))) : 0;
12934
- return WORKING_VERBS[index] ?? "Working";
12935
- }
12936
- function chooseCompletionVerb(turnId) {
12937
- let hash = 0;
12938
- for (let index = 0;index < turnId.length; index += 1) {
12939
- hash = (hash << 5) - hash + turnId.charCodeAt(index) | 0;
12940
- }
12941
- return COMPLETION_VERBS[(hash >>> 0) % COMPLETION_VERBS.length] ?? "Worked";
12942
- }
12943
- function formatWorkingDuration(durationMs) {
12944
- const seconds = Math.floor((Number.isFinite(durationMs) ? Math.max(0, durationMs) : 0) / 1000);
12945
- const minutes = Math.floor(seconds / 60);
12946
- const remainingSeconds = seconds % 60;
12947
- return minutes > 0 ? `${minutes}m${remainingSeconds ? ` ${remainingSeconds}s` : ""}` : `${seconds}s`;
12948
- }
12949
-
12950
- // src/terminal/opentui/subagentsWidget.ts
12951
12995
  var MAX_VISIBLE_ROWS = 3;
12952
12996
  var GAP = " ";
12953
12997
  function cut(text, width) {
@@ -14711,11 +14755,159 @@ class RemoteControlPage {
14711
14755
  }
14712
14756
  }
14713
14757
 
14758
+ // src/terminal/tui/pages/followUpQueuePage.ts
14759
+ import { matchesKey as matchesKey19 } from "@earendil-works/pi-tui";
14760
+ var TABS5 = [{ id: "queue", title: "Follow-up queue" }];
14761
+
14762
+ class FollowUpQueuePage {
14763
+ options;
14764
+ presentation = "centered";
14765
+ selected = 0;
14766
+ disposed = false;
14767
+ closed = false;
14768
+ constructor(options) {
14769
+ this.options = options;
14770
+ }
14771
+ get focused() {
14772
+ return true;
14773
+ }
14774
+ set focused(_value) {}
14775
+ tabs() {
14776
+ return TABS5;
14777
+ }
14778
+ activeTab() {
14779
+ return "queue";
14780
+ }
14781
+ hint() {
14782
+ return "\u2191\u2193 select \xB7 Enter actions \xB7 e edit \xB7 s send next \xB7 d remove \xB7 r return \xB7 Esc close";
14783
+ }
14784
+ activate() {
14785
+ this.options.changed();
14786
+ }
14787
+ dispose() {
14788
+ if (this.disposed)
14789
+ return;
14790
+ this.disposed = true;
14791
+ this.closeEditor();
14792
+ }
14793
+ closeEditor() {
14794
+ if (this.closed)
14795
+ return;
14796
+ this.closed = true;
14797
+ this.options.editor.close();
14798
+ }
14799
+ entries() {
14800
+ return this.options.editor.entries();
14801
+ }
14802
+ render(_width, _rows) {
14803
+ const entries = this.entries();
14804
+ const steering = entries.filter((entry) => entry.kind === "steering");
14805
+ const followUp = entries.filter((entry) => entry.kind === "followUp");
14806
+ const result = ["Follow-up and steering are shown in FIFO order.", ""];
14807
+ for (const [title, group] of [["Steer", steering], ["Follow-up", followUp]]) {
14808
+ result.push(title);
14809
+ if (!group.length)
14810
+ result.push(" (empty)");
14811
+ for (const entry of group) {
14812
+ const index = entries.indexOf(entry);
14813
+ const marker = index === this.selected ? "\u203A" : " ";
14814
+ const kind = entry.kind === "steering" ? "Steer" : "Follow-up";
14815
+ result.push(`${marker} ${kind}${entry.hasImages ? " \xB7 images" : ""} ${entry.text.replace(/\s+/g, " ")}`);
14816
+ }
14817
+ result.push("");
14818
+ }
14819
+ if (!entries.length)
14820
+ result.push("Queue is empty. Plan, Bash, and deferred inputs are managed elsewhere.");
14821
+ else
14822
+ result.push("e edit in place \xB7 s send next \xB7 d remove \xB7 r return to composer");
14823
+ return result;
14824
+ }
14825
+ async act(action) {
14826
+ if (action === "return") {
14827
+ this.options.close();
14828
+ return;
14829
+ }
14830
+ const entries = this.entries();
14831
+ if (!entries.length)
14832
+ return;
14833
+ const entry = entries[Math.min(this.selected, entries.length - 1)];
14834
+ if (action === "edit")
14835
+ await this.options.editor.edit(entry.id);
14836
+ if (action === "send")
14837
+ await this.options.editor.sendNext();
14838
+ if (action === "remove")
14839
+ this.options.editor.remove(entry.id);
14840
+ this.selected = Math.min(this.selected, Math.max(0, this.entries().length - 1));
14841
+ this.options.changed();
14842
+ }
14843
+ handleInput(data) {
14844
+ const count = this.entries().length;
14845
+ if (matchesKey19(data, "escape"))
14846
+ return false;
14847
+ if (matchesKey19(data, "up")) {
14848
+ this.selected = Math.max(0, this.selected - 1);
14849
+ this.options.changed();
14850
+ return true;
14851
+ }
14852
+ if (matchesKey19(data, "down")) {
14853
+ this.selected = Math.min(Math.max(0, count - 1), this.selected + 1);
14854
+ this.options.changed();
14855
+ return true;
14856
+ }
14857
+ const key = data.toLowerCase();
14858
+ if (key === "e") {
14859
+ this.act("edit");
14860
+ return true;
14861
+ }
14862
+ if (key === "s") {
14863
+ this.act("send");
14864
+ return true;
14865
+ }
14866
+ if (key === "d" || key === "delete" || key === "\\x7f") {
14867
+ this.act("remove");
14868
+ return true;
14869
+ }
14870
+ if (key === "r") {
14871
+ this.act("return");
14872
+ return true;
14873
+ }
14874
+ if (matchesKey19(data, "enter")) {
14875
+ this.act("edit");
14876
+ return true;
14877
+ }
14878
+ return false;
14879
+ }
14880
+ handleMouse(event) {
14881
+ if (!isPrimaryClick(event))
14882
+ return;
14883
+ const entries = this.entries();
14884
+ const rendered = this.render(120, 100);
14885
+ const line = Math.floor(event.y);
14886
+ const displayed = [...entries.filter((entry) => entry.kind === "steering"), ...entries.filter((entry) => entry.kind === "followUp")];
14887
+ let index = 0;
14888
+ for (let row = 0;row < rendered.length; row++) {
14889
+ if (rendered[row].startsWith("\u203A ") || rendered[row].startsWith(" Steer") || rendered[row].startsWith(" Follow-up")) {
14890
+ if (row === line) {
14891
+ this.selected = entries.indexOf(displayed[index]);
14892
+ this.options.changed();
14893
+ return { handled: true, render: true };
14894
+ }
14895
+ index++;
14896
+ }
14897
+ }
14898
+ return;
14899
+ }
14900
+ }
14901
+
14714
14902
  // src/terminal/tui/settingsModel.ts
14903
+ var BROWSER_BACKEND_ID = "browser.backend";
14904
+ var BROWSER_CONNECTION_ID = "browser.connection";
14715
14905
  var PRIVATE_ACCESS_ID = "browser.allowPrivate";
14716
- var GROUP_ORDER = ["Theme", "Display", "Images", "Thinking", "Recovery", "Editor", "Queues", "Commands", "Terminal", "Keyboard", "Compaction", "Network"];
14906
+ var GROUP_ORDER = ["Theme", "Display", "Images", "Thinking", "Recovery", "Editor", "Queues", "Commands", "Terminal", "Keyboard", "Compaction", "Connection", "Network"];
14717
14907
  function createSettingsModel(host) {
14718
14908
  let browserSettings = null;
14909
+ let extensionSettings = null;
14910
+ let pairingCode = null;
14719
14911
  const booleans = (session) => {
14720
14912
  const settings = session.settingsManager;
14721
14913
  return [
@@ -14775,24 +14967,93 @@ function createSettingsModel(host) {
14775
14967
  const split = option.indexOf(":");
14776
14968
  return { id: String(index), tab: locations[index][0], group: locations[index][1], label: split < 0 ? option : option.slice(0, split), value: split < 0 ? "" : option.slice(split + 1).trim(), description: descriptions[index] };
14777
14969
  });
14778
- if (browserSettings)
14970
+ if (browserSettings) {
14971
+ result.push({
14972
+ id: BROWSER_BACKEND_ID,
14973
+ tab: "Browser",
14974
+ group: "Connection",
14975
+ label: "Browser backend",
14976
+ value: browserSettings.backend === "brave" ? "Brave profile" : "Isolated browser",
14977
+ description: "Choose the browser the agent controls. Brave uses your existing signed-in profile and only sites you allow in the extension; Incognito is excluded. The extension does not request history or cookie permissions or export cookies. A disconnect never switches to the other backend."
14978
+ });
14979
+ result.push({
14980
+ id: BROWSER_CONNECTION_ID,
14981
+ tab: "Browser",
14982
+ group: "Connection",
14983
+ label: "Brave extension",
14984
+ value: extensionSettings?.state ?? "Checking",
14985
+ description: pairingCode ? `Enter pairing code ${pairingCode} in the extension popup. It expires in five minutes.` : extensionSettings?.state === "connected" ? "Connected to Brave. Use the in-page badge to pause or stop control." : extensionSettings?.paired ? "The extension is paired and waiting. Open its toolbar popup to reconnect, or select this row to reset pairing." : "Select this row to start the loopback bridge and get a one-time pairing code."
14986
+ });
14779
14987
  result.push({
14780
14988
  id: PRIVATE_ACCESS_ID,
14781
14989
  tab: "Browser",
14782
14990
  group: "Network",
14783
14991
  label: "Private address access",
14784
14992
  value: browserSettings.allowPrivate ? "On" : "Off",
14785
- description: "This device-wide setting affects agent browsing and annotation capture. When on, pages can reach localhost and private networks."
14993
+ description: "This device-wide setting lets agent browsing and annotation capture reach localhost and private networks."
14786
14994
  });
14995
+ }
14787
14996
  return result.sort((a, b) => GROUP_ORDER.indexOf(a.group) - GROUP_ORDER.indexOf(b.group));
14788
14997
  }
14789
14998
  async function load() {
14790
- const config = await host.control("terminal.browser.config");
14791
- if (!config || typeof config.allowPrivate !== "boolean")
14999
+ const [config, extension] = await Promise.all([
15000
+ host.control("terminal.browser.config"),
15001
+ host.control("terminal.browser.extension.status")
15002
+ ]);
15003
+ if (!config || typeof config.allowPrivate !== "boolean" || !["isolated", "brave"].includes(config.backend))
14792
15004
  throw new Error("The Harness returned invalid browser settings.");
14793
- browserSettings = { allowPrivate: config.allowPrivate };
15005
+ if (!extension || typeof extension.connected !== "boolean" || typeof extension.paired !== "boolean" || !["stopped", "pairing", "waiting", "connected", "paused"].includes(extension.state))
15006
+ throw new Error("The Harness returned invalid Brave extension status.");
15007
+ browserSettings = { backend: config.backend, allowPrivate: config.allowPrivate };
15008
+ extensionSettings = extension;
15009
+ if (extension.paired)
15010
+ pairingCode = null;
14794
15011
  }
14795
15012
  async function apply(id) {
15013
+ if (id === BROWSER_BACKEND_ID) {
15014
+ if (!browserSettings)
15015
+ return;
15016
+ const selected = await host.ui.select("Browser backend", ["Isolated browser", "Brave profile"]);
15017
+ const backend = selected === "Brave profile" ? "brave" : selected === "Isolated browser" ? "isolated" : null;
15018
+ if (!backend || backend === browserSettings.backend)
15019
+ return;
15020
+ if (backend === "brave" && !await host.ui.confirm("Use your Brave profile?", "The agent can see and control normal tabs on sites you explicitly allow in the extension. Your signed-in pages may contain private information. The extension requires Brave\u2019s debugger permission but does not request history or cookie permissions or export cookies. Incognito is never available, and a disconnect will not switch browsers automatically."))
15021
+ return;
15022
+ const saved = await host.control("terminal.browser.configure", { backend });
15023
+ if (!saved || saved.backend !== backend)
15024
+ throw new Error("The Harness did not save the browser backend.");
15025
+ browserSettings = { ...browserSettings, backend: saved.backend };
15026
+ extensionSettings = await host.control("terminal.browser.extension.status");
15027
+ host.refresh();
15028
+ return;
15029
+ }
15030
+ if (id === BROWSER_CONNECTION_ID) {
15031
+ if (!extensionSettings)
15032
+ return;
15033
+ let start = false;
15034
+ if (extensionSettings.paired) {
15035
+ const action = await host.ui.select("Brave extension", ["Keep waiting", "Stop and pair again"]);
15036
+ if (action === "Stop and pair again") {
15037
+ await host.control("terminal.browser.extension.stop");
15038
+ extensionSettings = await host.control("terminal.browser.extension.status");
15039
+ start = true;
15040
+ } else if (action === "Keep waiting") {
15041
+ const result = await host.control("terminal.browser.extension.start");
15042
+ extensionSettings = result.status;
15043
+ pairingCode = result.pairingCode ?? null;
15044
+ }
15045
+ } else
15046
+ start = true;
15047
+ if (start) {
15048
+ const result = await host.control("terminal.browser.extension.start");
15049
+ extensionSettings = result.status;
15050
+ pairingCode = result.pairingCode ?? null;
15051
+ if (pairingCode)
15052
+ host.ui.notify(`Pair the Brave extension with code ${pairingCode}.`, "info");
15053
+ }
15054
+ host.refresh();
15055
+ return;
15056
+ }
14796
15057
  if (id === PRIVATE_ACCESS_ID) {
14797
15058
  if (!browserSettings)
14798
15059
  return;
@@ -14802,7 +15063,7 @@ function createSettingsModel(host) {
14802
15063
  const saved = await host.control("terminal.browser.configure", { allowPrivate });
14803
15064
  if (!saved || typeof saved.allowPrivate !== "boolean")
14804
15065
  throw new Error("The Harness returned invalid browser settings.");
14805
- browserSettings = { allowPrivate: saved.allowPrivate };
15066
+ browserSettings = { ...browserSettings, allowPrivate: saved.allowPrivate };
14806
15067
  host.refresh();
14807
15068
  return;
14808
15069
  }
@@ -14847,6 +15108,8 @@ function createCommandPage(host, id, options = {}) {
14847
15108
  const theme = () => host.ui.theme;
14848
15109
  const notify = (message, type) => host.ui.notify(message, type === "error" || type === "warning" ? type : "info");
14849
15110
  switch (id) {
15111
+ case "follow-up":
15112
+ return new FollowUpQueuePage({ editor: host.followUpQueue(), theme, changed: host.changed, close: options.close ?? (() => {}) });
14850
15113
  case "remote-control":
14851
15114
  return new RemoteControlPage({ theme, call: host.control, changed: host.changed, copy: host.copyText, notify });
14852
15115
  case "context":
@@ -15216,7 +15479,7 @@ function createBuiltinPluginCommandHandlers(host, openPage) {
15216
15479
  }
15217
15480
 
15218
15481
  // src/terminal/tui/pages/textPage.ts
15219
- import { matchesKey as matchesKey19, truncateToWidth as truncateToWidth24, wrapTextWithAnsi as wrapTextWithAnsi16 } from "@earendil-works/pi-tui";
15482
+ import { matchesKey as matchesKey20, truncateToWidth as truncateToWidth24, wrapTextWithAnsi as wrapTextWithAnsi16 } from "@earendil-works/pi-tui";
15220
15483
 
15221
15484
  class TextPage {
15222
15485
  title;
@@ -15248,17 +15511,17 @@ class TextPage {
15248
15511
  }
15249
15512
  handleInput(data) {
15250
15513
  const page = Math.max(1, this.rows - 1);
15251
- if (matchesKey19(data, "up"))
15514
+ if (matchesKey20(data, "up"))
15252
15515
  this.offset = Math.max(0, this.offset - 1);
15253
- else if (matchesKey19(data, "down"))
15516
+ else if (matchesKey20(data, "down"))
15254
15517
  this.offset += 1;
15255
- else if (matchesKey19(data, "pageUp"))
15518
+ else if (matchesKey20(data, "pageUp"))
15256
15519
  this.offset = Math.max(0, this.offset - page);
15257
- else if (matchesKey19(data, "pageDown") || data === " ")
15520
+ else if (matchesKey20(data, "pageDown") || data === " ")
15258
15521
  this.offset += page;
15259
- else if (matchesKey19(data, "home"))
15522
+ else if (matchesKey20(data, "home"))
15260
15523
  this.offset = 0;
15261
- else if (matchesKey19(data, "end"))
15524
+ else if (matchesKey20(data, "end"))
15262
15525
  this.offset = Number.MAX_SAFE_INTEGER;
15263
15526
  else
15264
15527
  return false;
@@ -15986,13 +16249,16 @@ function createTerminalCommands(host) {
15986
16249
  case "worktree":
15987
16250
  await openPage("worktree");
15988
16251
  break;
16252
+ case "follow-up":
16253
+ await openPage("follow-up");
16254
+ break;
15989
16255
  case "trajectory":
15990
16256
  await openPage("trajectory", { runId: argument });
15991
16257
  break;
15992
16258
  case "todo": {
15993
16259
  const items = await host.todo();
15994
16260
  if (!items.length)
15995
- notify("No todo list in this reply yet. The agent writes one with todo_write for multi-step work.");
16261
+ notify("No todo list in this reply yet. The agent writes one with TodoWrite for multi-step work.");
15996
16262
  else
15997
16263
  host.showTodo(items);
15998
16264
  break;
@@ -16722,11 +16988,13 @@ var PLAN_BLOCKED_OPEN_TAG = "<plan_blocked>";
16722
16988
  var PLAN_BLOCKED_CLOSE_TAG = "</plan_blocked>";
16723
16989
  var LEGACY_CLARIFICATION_TAGS = ["<plan_clarification>", "</plan_clarification>"];
16724
16990
  var PLAN_REPAIR_CUSTOM_TYPE = "xingular-plan-repair";
16725
- var PLAN_REPAIR_INSTRUCTIONS = `Your last reply to this plan request did not end with the required plan block.
16991
+ var PLAN_REPAIR_INSTRUCTIONS = `Your last reply to this plan request did not end with a usable ending: the block it declared was incomplete, empty or in conflict with another.
16726
16992
  - If you already proposed a sound plan, re-send it unchanged and complete inside one ${PLAN_OPEN_TAG} ... ${PLAN_CLOSE_TAG} block. Its first line must be the plan title as an H1 heading.
16993
+ - If the request is already satisfied or there is nothing to plan, say so in your own words and end with no block. That is a valid ending, and it is the answer when the person asked you not to plan.
16727
16994
  - Do not research again or change an existing plan. If necessary user input is missing, call ${ASK_USER} when available, then return a complete plan informed by the answer. Never ask a question in free text.
16728
- - Only if necessary input cannot be obtained because ${ASK_USER} is unavailable, return one ${PLAN_BLOCKED_OPEN_TAG} ... ${PLAN_BLOCKED_CLOSE_TAG} block with a nonempty explanation of the blocker, not a question. Do not invent an answer.`;
16995
+ - Only if necessary input cannot be obtained because ${ASK_USER} is unavailable, return one ${PLAN_BLOCKED_OPEN_TAG} ... ${PLAN_BLOCKED_CLOSE_TAG} block with a nonempty explanation of the blocker, not a question. Do not invent an answer, and do not invent work to fill a block.`;
16729
16996
  var PLAN_INSTRUCTIONS = `Plan mode is on for this request. Research and design; do not carry out the work.
16997
+ - Check whether the requested work already exists before designing it. Search the repository, the docs and the changelog; when it is already there, name the files and symbols that do it, say that no plan is needed, and stop. Do not plan work that exists, and do not invent work to fill a block. When the person says not to plan, or asks you to reject a plan, that instruction outranks this section: answer in your own words and end with no block.
16730
16998
  - Classify the task and scale investigation and plan detail to it. For repository work, read the governing instructions and relevant source, callers and tests before asserting paths, symbols, behavior or checks. Cite inspected code as path:line; cite external research with source URLs, and mark unverified claims as unknown.
16731
16999
  - Explore first to resolve facts available from the repository or other sources. Then identify user-owned decisions about the desired outcome, audience, scope, success criteria, constraints and tradeoffs. If a reasonable answer could materially change what is built, who it serves, or how success is judged, use ${ASK_USER} before finalizing\u2014even if you have a recommended default. Also ask to confirm an important assumption when the user may reasonably want to choose it.
16732
17000
  - Batch related questions. Explain what each answer changes, offer meaningful choices with tradeoffs, and recommend a default when appropriate. Do not ask about discoverable facts, manufacture questions for routine work, or ask about decisions the user has explicitly delegated. When interaction is unavailable, state reasonable assumptions only when the task can proceed without the missing input.
@@ -16742,11 +17010,12 @@ var PLAN_INSTRUCTIONS = `Plan mode is on for this request. Research and design;
16742
17010
  - Add \`Findings\` when inspection or research reveals material facts. Cite sources, separate facts from assumptions, and mark unverified claims as unknown; omit the section when there are no useful findings.
16743
17011
  - Before finalizing, check request coverage, evidence, dependencies, edge cases and specific verification. Scale detail, not word count: a small fix may have only a few steps but must still cover the requested outcome, scope and a specific verification; cross-cutting work needs ordered steps for owners and boundaries, dependencies, compatibility and important edge cases. Name verified files and symbols for code changes, and give repository-grounded checks with expected results without claiming they ran.
16744
17012
  - When revising a plan, use the latest request, preserve still-valid decisions and return a complete replacement, not a delta.
16745
- - When ready, end the reply with exactly one block in this form, after any other text:
17013
+ - When there is work to design, end the reply with exactly one block in this form, after any other text:
16746
17014
  ${PLAN_OPEN_TAG}
16747
17015
  # <Plan title>
16748
17016
  <Markdown: Goal or Summary first; Findings when useful; ordered Steps with files and behavior; Verification with expected results; material Assumptions>
16749
17017
  ${PLAN_CLOSE_TAG}
17018
+ - A reply that ends with neither a plan block nor a blocked block is a valid ending: it says there is nothing to plan. A block you do start must be complete, nonempty, and the only one.
16750
17019
  - If the user's input is necessary before a sound plan is possible, call ${ASK_USER} when available and continue planning after the answer. Never ask the user a question in free text. Only when ${ASK_USER} is unavailable and necessary input cannot be obtained, end with exactly one ${PLAN_BLOCKED_OPEN_TAG} ... ${PLAN_BLOCKED_CLOSE_TAG} block containing a nonempty explanation of the blocker, not a question, instead of a plan. Do not invent an answer.`;
16751
17020
  var PLAN_BASH = "bash";
16752
17021
  function planModeTools(normal, readOnly = [], planOnlyQuestions = []) {
@@ -16811,14 +17080,32 @@ function planRefusal(tool, readOnly, args, planModeSafe) {
16811
17080
  }
16812
17081
  return `Plan mode is research-only: ${tool} is not permitted for this call. Use an approved research operation, or finish with a ${PLAN_OPEN_TAG} block.`;
16813
17082
  }
17083
+ function tagOutsideCode(text, tag) {
17084
+ const found = [];
17085
+ let fence = null;
17086
+ let offset = 0;
17087
+ for (const line of text.split(`
17088
+ `)) {
17089
+ const marker = /^\s{0,3}(`{3,}|~{3,})/u.exec(line)?.[1];
17090
+ if (marker && (fence === null || marker[0] === fence[0] && marker.length >= fence.length)) {
17091
+ fence = fence === null ? marker : null;
17092
+ } else if (fence === null) {
17093
+ for (let at = line.indexOf(tag);at >= 0; at = line.indexOf(tag, at + tag.length)) {
17094
+ if (line.slice(0, at).split("`").length % 2 === 1)
17095
+ found.push(offset + at);
17096
+ }
17097
+ }
17098
+ offset += line.length + 1;
17099
+ }
17100
+ return found;
17101
+ }
16814
17102
  function parseProposedPlan(text) {
16815
- const open = text.lastIndexOf(PLAN_OPEN_TAG);
16816
- if (open < 0)
17103
+ const open = tagOutsideCode(text, PLAN_OPEN_TAG).at(-1);
17104
+ if (open === undefined)
16817
17105
  return null;
16818
17106
  const start = open + PLAN_OPEN_TAG.length;
16819
- const close = text.indexOf(PLAN_CLOSE_TAG, start);
16820
- const complete = close >= 0;
16821
- const inner = (complete ? text.slice(start, close) : text.slice(start)).trim();
17107
+ const close = tagOutsideCode(text, PLAN_CLOSE_TAG).find((at) => at >= start);
17108
+ const inner = (close === undefined ? text.slice(start) : text.slice(start, close)).trim();
16822
17109
  const heading = /^#\s+(.+)$/mu.exec(inner);
16823
17110
  const title = heading?.[1]?.trim() || "Plan";
16824
17111
  const body = heading ? `${inner.slice(0, heading.index)}${inner.slice(heading.index + heading[0].length)}`.trim() : inner;
@@ -16826,34 +17113,38 @@ function parseProposedPlan(text) {
16826
17113
  before: text.slice(0, open).trim(),
16827
17114
  title,
16828
17115
  body,
16829
- after: complete ? text.slice(close + PLAN_CLOSE_TAG.length).trim() : "",
16830
- complete
17116
+ after: close === undefined ? "" : text.slice(close + PLAN_CLOSE_TAG.length).trim(),
17117
+ complete: close !== undefined
16831
17118
  };
16832
17119
  }
16833
17120
  function parsePlanOutcome(text) {
16834
- if (LEGACY_CLARIFICATION_TAGS.some((tag) => text.includes(tag)))
17121
+ if (LEGACY_CLARIFICATION_TAGS.some((tag) => tagOutsideCode(text, tag).length > 0))
16835
17122
  return { kind: "invalid" };
16836
- const tags = [PLAN_OPEN_TAG, PLAN_CLOSE_TAG, PLAN_BLOCKED_OPEN_TAG, PLAN_BLOCKED_CLOSE_TAG];
16837
- const counts = tags.map((tag) => text.split(tag).length - 1);
16838
- if (counts[0] === 1 && counts[1] === 1 && counts[2] === 0 && counts[3] === 0) {
17123
+ const opens = tagOutsideCode(text, PLAN_OPEN_TAG);
17124
+ const closes = tagOutsideCode(text, PLAN_CLOSE_TAG);
17125
+ const blockedOpens = tagOutsideCode(text, PLAN_BLOCKED_OPEN_TAG);
17126
+ const blockedCloses = tagOutsideCode(text, PLAN_BLOCKED_CLOSE_TAG);
17127
+ if (opens.length === 1 && closes.length === 1 && blockedOpens.length === 0 && blockedCloses.length === 0) {
17128
+ const start = opens[0] + PLAN_OPEN_TAG.length;
17129
+ const end = closes[0];
16839
17130
  const plan = parseProposedPlan(text);
16840
- const start = text.indexOf(PLAN_OPEN_TAG) + PLAN_OPEN_TAG.length;
16841
- const end = text.indexOf(PLAN_CLOSE_TAG);
16842
17131
  if (plan?.complete && end >= start && text.slice(start, end).trim())
16843
17132
  return { kind: "plan_ready", plan };
16844
17133
  }
16845
- if (counts[0] === 0 && counts[1] === 0 && counts[2] === 1 && counts[3] === 1) {
16846
- const start = text.indexOf(PLAN_BLOCKED_OPEN_TAG) + PLAN_BLOCKED_OPEN_TAG.length;
16847
- const end = text.indexOf(PLAN_BLOCKED_CLOSE_TAG);
17134
+ if (opens.length === 0 && closes.length === 0 && blockedOpens.length === 1 && blockedCloses.length === 1) {
17135
+ const start = blockedOpens[0] + PLAN_BLOCKED_OPEN_TAG.length;
17136
+ const end = blockedCloses[0];
16848
17137
  const reason = end >= start ? text.slice(start, end).trim() : "";
16849
17138
  if (reason)
16850
17139
  return { kind: "blocked", reason };
16851
17140
  }
17141
+ if (opens.length + closes.length + blockedOpens.length + blockedCloses.length === 0 && text.trim())
17142
+ return { kind: "no_plan" };
16852
17143
  return { kind: "invalid" };
16853
17144
  }
16854
17145
 
16855
17146
  // src/terminal/tui/dialogs.ts
16856
- import { Editor, matchesKey as matchesKey20, stripTerminalSequences as stripTerminalSequences11, truncateToWidth as truncateToWidth25, visibleWidth as visibleWidth16, wrapTextWithAnsi as wrapTextWithAnsi17 } from "@earendil-works/pi-tui";
17147
+ import { Editor, matchesKey as matchesKey21, stripTerminalSequences as stripTerminalSequences11, truncateToWidth as truncateToWidth25, visibleWidth as visibleWidth16, wrapTextWithAnsi as wrapTextWithAnsi17 } from "@earendil-works/pi-tui";
16857
17148
  function selectTheme(theme) {
16858
17149
  return {
16859
17150
  selectedPrefix: (text) => selectionText(theme, text),
@@ -16926,7 +17217,7 @@ class SearchableSelect {
16926
17217
  return this.list.handleMouse(event);
16927
17218
  }
16928
17219
  handleInput(data) {
16929
- if (matchesKey20(data, "ctrl+c")) {
17220
+ if (matchesKey21(data, "ctrl+c")) {
16930
17221
  this.cancel();
16931
17222
  return;
16932
17223
  }
@@ -16999,8 +17290,8 @@ class DialogPanel {
16999
17290
  return mouseAware.handleMouse?.({ ...event, y: row });
17000
17291
  }
17001
17292
  handleInput(data) {
17002
- if (this.detailTotal > this.detailRows && (matchesKey20(data, "pageUp") || matchesKey20(data, "pageDown"))) {
17003
- const delta = matchesKey20(data, "pageUp") ? -1 : 1;
17293
+ if (this.detailTotal > this.detailRows && (matchesKey21(data, "pageUp") || matchesKey21(data, "pageDown"))) {
17294
+ const delta = matchesKey21(data, "pageUp") ? -1 : 1;
17004
17295
  this.detailOffset = Math.max(0, Math.min(this.detailTotal - this.detailRows, this.detailOffset + delta * Math.max(1, this.detailRows)));
17005
17296
  return;
17006
17297
  }
@@ -17160,7 +17451,7 @@ class TerminalDialogs {
17160
17451
  invalidate: () => editor.invalidate(),
17161
17452
  render: (width) => editor.render(Math.max(4, width)).map((line) => truncateToWidth25(line, width, "")),
17162
17453
  handleInput: (data) => {
17163
- if (matchesKey20(data, "escape") || matchesKey20(data, "ctrl+c"))
17454
+ if (matchesKey21(data, "escape") || matchesKey21(data, "ctrl+c"))
17164
17455
  done(undefined);
17165
17456
  else
17166
17457
  editor.handleInput(data);
@@ -17668,8 +17959,8 @@ function goalNotice(event) {
17668
17959
  var WORK_SLICE_EXTENSION = "work-slice";
17669
17960
  var DEFAULT_SLICE_POLICY = {
17670
17961
  enabled: true,
17671
- maxToolCalls: 320,
17672
- maxMinutes: 60,
17962
+ maxToolCalls: 0,
17963
+ maxMinutes: 0,
17673
17964
  maxNewTokens: 0,
17674
17965
  maxSlices: 8,
17675
17966
  continue: true
@@ -17861,6 +18152,12 @@ function sliceContinuation(options) {
17861
18152
  });
17862
18153
  };
17863
18154
  }
18155
+ function activeToolBeat(tools, now = Date.now()) {
18156
+ if (!tools.size)
18157
+ return {};
18158
+ const names = [...new Set([...tools.values()].map((tool) => tool.name))].slice(0, 16);
18159
+ return { activeTools: names, oldestToolMs: Math.max(0, now - Math.min(...[...tools.values()].map((tool) => tool.at))) };
18160
+ }
17864
18161
 
17865
18162
  // src/core/commandBudget.ts
17866
18163
  var DEFAULT_COMMAND_TIMEOUT_SECONDS = 120;
@@ -18840,6 +19137,7 @@ async function piExtension_default(pi, planRun, getSession, goal) {
18840
19137
  let requestStartedAt = null;
18841
19138
  let pendingRefusals = [];
18842
19139
  const toolStartedAt = new Map;
19140
+ const toolsInFlight = new Map;
18843
19141
  const fileTools = new Map;
18844
19142
  const writeAuthorizations = new Map;
18845
19143
  let workspaceRoot = null;
@@ -19047,6 +19345,7 @@ async function piExtension_default(pi, planRun, getSession, goal) {
19047
19345
  throw new Error("The active project workspace could not be resolved; the turn was not started.");
19048
19346
  pi.appendEntry(SUBAGENT_OWNER, { runId: begun.runId });
19049
19347
  turnStartedAt = Date.now();
19348
+ toolsInFlight.clear();
19050
19349
  if (heartbeat)
19051
19350
  clearInterval(heartbeat);
19052
19351
  heartbeat = setInterval(() => {
@@ -19056,7 +19355,8 @@ async function piExtension_default(pi, planRun, getSession, goal) {
19056
19355
  lastTool: sliceState.lastTool,
19057
19356
  compactions: sliceState.compactions,
19058
19357
  slice: sliceState.slice,
19059
- maxToolCalls: slicePolicy.enabled ? slicePolicy.maxToolCalls : 0
19358
+ maxToolCalls: slicePolicy.enabled ? slicePolicy.maxToolCalls : 0,
19359
+ ...activeToolBeat(toolsInFlight)
19060
19360
  }, 1e4).catch(() => {});
19061
19361
  }, 30000);
19062
19362
  heartbeat.unref?.();
@@ -19466,11 +19766,13 @@ async function piExtension_default(pi, planRun, getSession, goal) {
19466
19766
  if (["edit", "write"].includes(event.toolName) && typeof event.args.path === "string")
19467
19767
  fileTools.set(event.toolCallId, event.args.path);
19468
19768
  toolStartedAt.set(event.toolCallId, Date.now());
19769
+ toolsInFlight.set(event.toolCallId, { name: event.toolName, at: Date.now() });
19469
19770
  await terminalCall("tool", { phase: "start", id: event.toolCallId, name: event.toolName, summary: JSON.stringify(event.args).slice(0, 200) });
19470
19771
  });
19471
19772
  pi.on("tool_execution_end", async (event) => {
19472
19773
  const started = toolStartedAt.get(event.toolCallId);
19473
19774
  toolStartedAt.delete(event.toolCallId);
19775
+ toolsInFlight.delete(event.toolCallId);
19474
19776
  const resultChars = resultSize(event.result);
19475
19777
  await terminalCall("tool", { phase: "end", id: event.toolCallId, name: event.toolName, ok: !event.isError, ...started === undefined ? {} : { durationMs: Date.now() - started }, ...resultChars === null ? {} : { resultChars } });
19476
19778
  const path = fileTools.get(event.toolCallId);
@@ -19575,6 +19877,13 @@ async function piExtension_default(pi, planRun, getSession, goal) {
19575
19877
  await terminalCall("startup", { phase: "Pi hooks registered" });
19576
19878
  }
19577
19879
 
19880
+ // src/pi/retryPolicy.ts
19881
+ var TRANSIENT_RETRY = { enabled: true, maxRetries: 8, baseDelayMs: 2000, maxAgentDelayMs: 60000 };
19882
+ function withTransientRetry(manager) {
19883
+ manager.applyOverrides({ retry: { ...TRANSIENT_RETRY, ...manager.getGlobalSettings().retry, ...manager.getProjectSettings().retry } });
19884
+ return manager;
19885
+ }
19886
+
19578
19887
  // src/terminal/credentialStore.ts
19579
19888
  var LEASE_CALL_MS = 60000;
19580
19889
  function terminalCredentialStore(call = controlCall) {
@@ -20154,7 +20463,7 @@ async function createTerminalRuntime(args, host) {
20154
20463
  const factory = async ({ cwd: targetCwd, sessionManager, sessionStartEvent }) => {
20155
20464
  if (realpathSync4(targetCwd) !== cwd)
20156
20465
  throw new Error("A native session cannot change this terminal working folder.");
20157
- const settingsManager = SettingsManager.create(cwd, agentDir);
20466
+ const settingsManager = withTransientRetry(SettingsManager.create(cwd, agentDir));
20158
20467
  const resourceLoader = new DefaultResourceLoader({
20159
20468
  cwd,
20160
20469
  agentDir,
@@ -21003,6 +21312,55 @@ function createTerminalUi(options) {
21003
21312
  };
21004
21313
  }
21005
21314
 
21315
+ // src/terminal/opentui/workingPhase.ts
21316
+ var TOOL_PHASE_AFTER_MS = 1e4;
21317
+ var MODEL_QUIET_AFTER_MS = 60000;
21318
+ var STOP_HINT_AFTER_MS = 5 * 60000;
21319
+ var CHILD_WAIT_TOOLS = new Set(["wait_subagents", "spawn_subagent"]);
21320
+ var ago2 = (ms) => formatWorkingDuration(Math.max(0, ms));
21321
+ function waitingOnChildren(input) {
21322
+ const active = input.subagents.filter((child) => child.relation === "subagent" && ACTIVE_SUBAGENT_STATUSES.has(child.status));
21323
+ if (!active.length)
21324
+ return "Waiting on subagents";
21325
+ const heads = `Waiting on ${active.length} subagent${active.length === 1 ? "" : "s"}`;
21326
+ const freshest = active.flatMap((child) => {
21327
+ const at = child.lastEventAt ? Date.parse(child.lastEventAt) : Number.NaN;
21328
+ return Number.isFinite(at) ? [{ at, activity: child.activity }] : [];
21329
+ }).sort((left, right) => right.at - left.at)[0];
21330
+ if (!freshest)
21331
+ return heads;
21332
+ const quiet = input.now - freshest.at;
21333
+ return quiet < 5000 ? `${heads} \xB7 ${freshest.activity}` : `${heads} \xB7 last activity ${ago2(quiet)} ago (${freshest.activity})`;
21334
+ }
21335
+ function workingPhase(input) {
21336
+ const { now, tools, retry, progressAt } = input;
21337
+ if (retry) {
21338
+ const head = `Reconnecting ${retry.attempt}/${retry.maxAttempts}`;
21339
+ const when = retry.retryAt > now ? ` \xB7 retry in ${Math.ceil((retry.retryAt - now) / 1000)}s` : "";
21340
+ return `${head}${when} \xB7 ${retry.error.replace(/\s+/g, " ").slice(0, 80)}`;
21341
+ }
21342
+ const running = [...tools.values()];
21343
+ if (running.length) {
21344
+ if (running.every((tool) => CHILD_WAIT_TOOLS.has(tool.name)))
21345
+ return waitingOnChildren(input);
21346
+ const oldest = Math.min(...running.map((tool) => tool.at));
21347
+ if (now - oldest < TOOL_PHASE_AFTER_MS)
21348
+ return null;
21349
+ const names = [...new Set(running.map((tool) => toolDisplayName(tool.name) || tool.name))];
21350
+ const label = running.length > 1 && names.length === 1 ? `${names[0]} \xD7${running.length}` : names.join(", ");
21351
+ return `Running ${label} \xB7 ${ago2(now - oldest)}`;
21352
+ }
21353
+ if (input.answered) {
21354
+ return input.subagents.some((child) => child.relation === "subagent" && ACTIVE_SUBAGENT_STATUSES.has(child.status)) ? waitingOnChildren(input) : null;
21355
+ }
21356
+ if (progressAt === null)
21357
+ return null;
21358
+ const quiet = now - progressAt;
21359
+ if (quiet < MODEL_QUIET_AFTER_MS)
21360
+ return null;
21361
+ return quiet < STOP_HINT_AFTER_MS ? `Waiting for the model \xB7 no output for ${ago2(quiet)}` : `No progress for ${ago2(quiet)} \xB7 Esc to stop`;
21362
+ }
21363
+
21006
21364
  // src/terminal/tui/clipboardFiles.ts
21007
21365
  import { execFile } from "child_process";
21008
21366
  import { chmod, mkdtemp, open, rm, stat as stat2 } from "fs/promises";
@@ -22156,7 +22514,8 @@ class TranscriptModel {
22156
22514
  const text = contentText2(message.content);
22157
22515
  if (!text.trim())
22158
22516
  return items;
22159
- items.push({ kind: "custom", id: `m${index}`, label: stringField(message, "customType") ?? "Extension", text });
22517
+ const customType = stringField(message, "customType") ?? "";
22518
+ items.push({ kind: "custom", id: `m${index}`, label: toolDisplayName(customType) || "Extension", text });
22160
22519
  return items;
22161
22520
  }
22162
22521
  if (role === "compactionSummary") {
@@ -22937,6 +23296,10 @@ class OpenTuiApplication {
22937
23296
  lastResponseTokensPerSecond = null;
22938
23297
  completedWorkingStatus;
22939
23298
  activeVerb;
23299
+ toolsInFlight = new Map;
23300
+ retryPhase = null;
23301
+ progressAt = null;
23302
+ answered = false;
22940
23303
  toastMessage;
22941
23304
  toastTimer;
22942
23305
  hoveredLink = null;
@@ -22945,6 +23308,14 @@ class OpenTuiApplication {
22945
23308
  activeTurnId;
22946
23309
  toolsExpanded = false;
22947
23310
  deferredInputs = [];
23311
+ steeringMetadata = [];
23312
+ followUpMetadata = [];
23313
+ heldQueue = [];
23314
+ editorQueue = null;
23315
+ explicitStopRequested = false;
23316
+ queueDispatchEligible = false;
23317
+ queueRemainderPending = false;
23318
+ startingQueuedEntry = false;
22948
23319
  planBarrierOpen = false;
22949
23320
  planActive = false;
22950
23321
  planChoice = new PlanChoice;
@@ -23031,6 +23402,208 @@ class OpenTuiApplication {
23031
23402
  setStopHandler(handler) {
23032
23403
  this.stopHandler = handler;
23033
23404
  }
23405
+ openFollowUpQueue() {
23406
+ if (!this.commands)
23407
+ return;
23408
+ this.attempt(async () => {
23409
+ await this.commands.execute("/follow-up");
23410
+ });
23411
+ }
23412
+ orderedQueue(entries) {
23413
+ return [...entries.filter((entry) => entry.kind === "steering"), ...entries.filter((entry) => entry.kind === "followUp")];
23414
+ }
23415
+ syncQueueMetadata() {
23416
+ if (!this.runtime)
23417
+ return;
23418
+ const reconcile = (kind, messages, current) => {
23419
+ const remaining = current.slice();
23420
+ return messages.map((text) => {
23421
+ const index = remaining.findIndex((entry) => entry.text === text);
23422
+ if (index >= 0)
23423
+ return remaining.splice(index, 1)[0];
23424
+ return { id: randomUUID6(), kind, text };
23425
+ });
23426
+ };
23427
+ const session = this.runtime?.session;
23428
+ this.steeringMetadata = reconcile("steering", session?.getSteeringMessages?.() ?? [], this.steeringMetadata);
23429
+ this.followUpMetadata = reconcile("followUp", session?.getFollowUpMessages?.() ?? [], this.followUpMetadata);
23430
+ }
23431
+ captureNativeQueue(clear = false) {
23432
+ this.syncQueueMetadata();
23433
+ const entries = this.orderedQueue([...this.steeringMetadata, ...this.followUpMetadata]);
23434
+ if (clear) {
23435
+ this.session.clearQueue?.();
23436
+ this.steeringMetadata = [];
23437
+ this.followUpMetadata = [];
23438
+ }
23439
+ return entries;
23440
+ }
23441
+ queueEntries() {
23442
+ if (this.editorQueue)
23443
+ return this.orderedQueue(this.editorQueue);
23444
+ return this.orderedQueue([...this.heldQueue, ...this.captureNativeQueue()]);
23445
+ }
23446
+ openFollowUpQueueEditor() {
23447
+ if (!this.editorQueue) {
23448
+ this.editorQueue = this.orderedQueue([...this.heldQueue, ...this.captureNativeQueue(true)]);
23449
+ this.heldQueue = [];
23450
+ this.change();
23451
+ }
23452
+ return {
23453
+ entries: () => this.editorQueue.map(({ id, kind, text, images }) => ({ id, kind, text, hasImages: Boolean(images?.length) })),
23454
+ edit: async (id) => {
23455
+ const entry = this.editorQueue?.find((item) => item.id === id);
23456
+ if (!entry)
23457
+ return;
23458
+ try {
23459
+ const text = await this.ui.editor("Edit queued message", entry.text);
23460
+ if (text === undefined)
23461
+ return;
23462
+ if (!text.trim()) {
23463
+ this.notify("A queued message cannot be empty.", "warning");
23464
+ return;
23465
+ }
23466
+ entry.text = text;
23467
+ this.change();
23468
+ } catch (error) {
23469
+ this.notify(error instanceof Error ? error.message : String(error), "error");
23470
+ }
23471
+ },
23472
+ sendNext: async () => {
23473
+ try {
23474
+ await this.sendNextQueuedMessage();
23475
+ } catch (error) {
23476
+ this.notify(error instanceof Error ? error.message : String(error), "error");
23477
+ }
23478
+ },
23479
+ remove: (id) => {
23480
+ if (!this.editorQueue)
23481
+ return;
23482
+ this.editorQueue = this.editorQueue.filter((entry) => entry.id !== id);
23483
+ this.change();
23484
+ },
23485
+ close: () => this.closeFollowUpQueueEditor()
23486
+ };
23487
+ }
23488
+ closeFollowUpQueueEditor() {
23489
+ if (!this.editorQueue)
23490
+ return;
23491
+ const entries = this.orderedQueue(this.editorQueue);
23492
+ this.editorQueue = null;
23493
+ if (this.session.isStreaming) {
23494
+ this.heldQueue = this.orderedQueue([...this.heldQueue, ...entries]);
23495
+ this.attempt(() => this.restoreHeldQueueAfterStart());
23496
+ } else {
23497
+ this.heldQueue = this.orderedQueue([...this.heldQueue, ...entries]);
23498
+ this.dispatchManagedQueue();
23499
+ }
23500
+ this.change();
23501
+ }
23502
+ async sendNextQueuedMessage() {
23503
+ if (!this.editorQueue?.length)
23504
+ return;
23505
+ const entries = this.orderedQueue(this.editorQueue);
23506
+ const [next, ...remaining] = entries;
23507
+ if (!next)
23508
+ return;
23509
+ this.editorQueue = remaining;
23510
+ this.queueDispatchEligible = true;
23511
+ if (this.session.isIdle) {
23512
+ this.startQueuedMessage(next);
23513
+ } else {
23514
+ try {
23515
+ const queued = await this.submitQueuedWhileRunning(next);
23516
+ if (!queued)
23517
+ this.startQueuedMessage(next);
23518
+ } catch (error) {
23519
+ this.editorQueue = this.orderedQueue([next, ...remaining]);
23520
+ this.queueDispatchEligible = false;
23521
+ this.change();
23522
+ throw error;
23523
+ }
23524
+ }
23525
+ this.change();
23526
+ }
23527
+ async submitQueuedWhileRunning(entry) {
23528
+ if (!this.session.isStreaming)
23529
+ return false;
23530
+ const metadata = entry.kind === "steering" ? this.steeringMetadata : this.followUpMetadata;
23531
+ metadata.push(entry);
23532
+ try {
23533
+ await this.runtime.submit(entry.text, entry.kind === "followUp", entry.images);
23534
+ } catch (error) {
23535
+ const index = metadata.findIndex((item) => item.id === entry.id);
23536
+ if (index >= 0)
23537
+ metadata.splice(index, 1);
23538
+ throw error;
23539
+ }
23540
+ return true;
23541
+ }
23542
+ startQueuedMessage(entry) {
23543
+ this.startingQueuedEntry = true;
23544
+ this.queueRemainderPending = this.heldQueue.length > 0;
23545
+ this.queueDispatchEligible = false;
23546
+ this.attempt(async () => {
23547
+ try {
23548
+ await this.runtime.submit(entry.text, false, entry.images);
23549
+ } catch (error) {
23550
+ if (this.startingQueuedEntry) {
23551
+ this.startingQueuedEntry = false;
23552
+ this.queueRemainderPending = false;
23553
+ if (this.editorQueue !== null)
23554
+ this.editorQueue = this.orderedQueue([entry, ...this.editorQueue]);
23555
+ else
23556
+ this.heldQueue = this.orderedQueue([entry, ...this.heldQueue]);
23557
+ this.queueDispatchEligible = false;
23558
+ this.change();
23559
+ }
23560
+ throw error;
23561
+ }
23562
+ });
23563
+ }
23564
+ async restoreHeldQueueAfterStart() {
23565
+ this.queueRemainderPending = false;
23566
+ while (this.heldQueue.length && this.session.isStreaming) {
23567
+ const entry = this.heldQueue[0];
23568
+ try {
23569
+ const queued = await this.submitQueuedWhileRunning(entry);
23570
+ if (!queued)
23571
+ return;
23572
+ } catch (error) {
23573
+ this.notify(error instanceof Error ? error.message : String(error), "error");
23574
+ return;
23575
+ }
23576
+ this.heldQueue = this.heldQueue.filter((item) => item.id !== entry.id);
23577
+ }
23578
+ this.change();
23579
+ }
23580
+ dispatchManagedQueue() {
23581
+ if (!this.runtime || !this.queueDispatchEligible || this.editorQueue || this.startingQueuedEntry || !this.session.isIdle || this.planBarrierOpen || this.planActive || this.deferredInputs.length || this.activeDeferredKind)
23582
+ return;
23583
+ const entries = this.orderedQueue([...this.heldQueue, ...this.captureNativeQueue(true)]);
23584
+ if (!entries.length) {
23585
+ this.queueDispatchEligible = false;
23586
+ return;
23587
+ }
23588
+ const [next, ...remaining] = entries;
23589
+ if (!next)
23590
+ return;
23591
+ this.heldQueue = remaining;
23592
+ this.startQueuedMessage(next);
23593
+ }
23594
+ requestUserInterrupt() {
23595
+ if (!this.runtime || this.session.isIdle)
23596
+ return;
23597
+ this.explicitStopRequested = true;
23598
+ this.attempt(async () => {
23599
+ try {
23600
+ await this.runtime.interrupt();
23601
+ } catch (error) {
23602
+ this.explicitStopRequested = false;
23603
+ throw error;
23604
+ }
23605
+ });
23606
+ }
23034
23607
  resize(width, height) {
23035
23608
  this.host.resize(width, height);
23036
23609
  }
@@ -23277,6 +23850,7 @@ class OpenTuiApplication {
23277
23850
  cwd: () => this.runtime.cwd,
23278
23851
  branch: () => this.branch,
23279
23852
  sessionDirectory: () => this.runtime.sessionDirectory,
23853
+ followUpQueue: () => this.openFollowUpQueueEditor(),
23280
23854
  refresh: () => this.refresh(),
23281
23855
  shutdown: () => {
23282
23856
  this.shutdown();
@@ -23507,6 +24081,14 @@ class OpenTuiApplication {
23507
24081
  this.questionDock = undefined;
23508
24082
  this.dismissedDecisions.clear();
23509
24083
  this.deferredInputs = [];
24084
+ this.steeringMetadata = [];
24085
+ this.followUpMetadata = [];
24086
+ this.heldQueue = [];
24087
+ this.editorQueue = null;
24088
+ this.explicitStopRequested = false;
24089
+ this.queueDispatchEligible = false;
24090
+ this.queueRemainderPending = false;
24091
+ this.startingQueuedEntry = false;
23510
24092
  this.planBarrierOpen = false;
23511
24093
  this.planActive = false;
23512
24094
  this.planChoice.clear();
@@ -23568,8 +24150,14 @@ class OpenTuiApplication {
23568
24150
  this.lastResponseTokensPerSecond = null;
23569
24151
  this.activeVerb = undefined;
23570
24152
  this.activeTurnId = undefined;
24153
+ this.toolsInFlight.clear();
24154
+ this.retryPhase = null;
24155
+ this.progressAt = null;
24156
+ this.answered = false;
23571
24157
  }
23572
24158
  accept(event) {
24159
+ if (event.type === "queue_update")
24160
+ this.syncQueueMetadata();
23573
24161
  if (event.type !== "message_update")
23574
24162
  this.statistics = undefined;
23575
24163
  if (event.type === "bash_execution_update" && event.id?.startsWith("initial-bash:")) {
@@ -23577,6 +24165,18 @@ class OpenTuiApplication {
23577
24165
  }
23578
24166
  if (event.type === "turn_start")
23579
24167
  this.requestStartedAt = performance.now();
24168
+ if (this.startedAt !== null)
24169
+ this.progressAt = Date.now();
24170
+ if (event.type === "turn_start" || event.type === "message_start" || event.type === "tool_execution_start")
24171
+ this.answered = false;
24172
+ if (event.type === "message_end" && event.message.role === "assistant")
24173
+ this.answered = event.message.stopReason === "stop";
24174
+ if (event.type === "tool_execution_start")
24175
+ this.toolsInFlight.set(event.toolCallId, { name: event.toolName, at: Date.now() });
24176
+ if (event.type === "tool_execution_end")
24177
+ this.toolsInFlight.delete(event.toolCallId);
24178
+ if (event.type === "message_start" || event.type === "message_update")
24179
+ this.retryPhase = null;
23580
24180
  if (event.type === "message_end" && event.message.role === "assistant") {
23581
24181
  const outputTokens = event.message.usage?.output;
23582
24182
  const requestStartedAt = this.requestStartedAt;
@@ -23589,6 +24189,11 @@ class OpenTuiApplication {
23589
24189
  this.requestStartedAt = null;
23590
24190
  }
23591
24191
  if (event.type === "agent_start") {
24192
+ if (this.startingQueuedEntry) {
24193
+ this.startingQueuedEntry = false;
24194
+ if (this.queueRemainderPending)
24195
+ this.attempt(() => this.restoreHeldQueueAfterStart());
24196
+ }
23592
24197
  this.subagentGeneration += 1;
23593
24198
  this.subagentsRefreshPending = false;
23594
24199
  this.startedAt = Date.now();
@@ -23598,8 +24203,24 @@ class OpenTuiApplication {
23598
24203
  this.completedWorkingStatus = undefined;
23599
24204
  this.activeVerb = chooseWorkingVerb();
23600
24205
  this.activeTurnId = randomUUID6();
24206
+ this.toolsInFlight.clear();
24207
+ this.retryPhase = null;
24208
+ this.progressAt = Date.now();
24209
+ this.answered = false;
23601
24210
  }
23602
24211
  if (event.type === "agent_settled") {
24212
+ const last = this.runtime?.session.messages.at(-1);
24213
+ const failed = last?.role === "assistant" && last.stopReason === "error";
24214
+ const explicitlyStopped = event.aborted === true && this.explicitStopRequested;
24215
+ this.explicitStopRequested = false;
24216
+ if (explicitlyStopped) {
24217
+ this.heldQueue = this.orderedQueue([...this.heldQueue, ...this.captureNativeQueue(true)]);
24218
+ this.queueDispatchEligible = true;
24219
+ } else if (event.aborted === true || failed) {
24220
+ this.queueDispatchEligible = false;
24221
+ } else if (this.editorQueue !== null || this.heldQueue.length) {
24222
+ this.queueDispatchEligible = true;
24223
+ }
23603
24224
  this.subagentGeneration += 1;
23604
24225
  this.transcript.finishBash();
23605
24226
  if (this.startedAt !== null) {
@@ -23613,8 +24234,15 @@ class OpenTuiApplication {
23613
24234
  this.requestStartedAt = null;
23614
24235
  this.activeVerb = undefined;
23615
24236
  this.activeTurnId = undefined;
24237
+ this.toolsInFlight.clear();
24238
+ this.retryPhase = null;
24239
+ this.progressAt = null;
24240
+ this.answered = false;
23616
24241
  this.refreshSubagents(true);
23617
- queueMicrotask(() => this.drainDeferred());
24242
+ queueMicrotask(() => {
24243
+ this.drainDeferred();
24244
+ this.dispatchManagedQueue();
24245
+ });
23618
24246
  }
23619
24247
  if (event.type === "compaction_start")
23620
24248
  this.compacting = { since: Date.now(), label: "Compacting context" };
@@ -23626,7 +24254,10 @@ class OpenTuiApplication {
23626
24254
  }
23627
24255
  if (event.type === "auto_retry_start") {
23628
24256
  this.notify(retryNotice(event.attempt, event.maxAttempts, event.delayMs, event.errorMessage), "warning");
24257
+ this.retryPhase = { attempt: event.attempt, maxAttempts: event.maxAttempts, retryAt: Date.now() + event.delayMs, error: event.errorMessage };
23629
24258
  }
24259
+ if (event.type === "auto_retry_end")
24260
+ this.retryPhase = null;
23630
24261
  if (event.type === "auto_retry_end" && event.finalError)
23631
24262
  this.notify(event.finalError, "error");
23632
24263
  if (event.type === "summarization_retry_scheduled") {
@@ -23975,7 +24606,7 @@ class OpenTuiApplication {
23975
24606
  async chooseApproval(request, signal) {
23976
24607
  if (signal.aborted)
23977
24608
  return { decision: "denied", alwaysAllow: false };
23978
- const tool = request.target ?? "action";
24609
+ const tool = toolDisplayName(request.target ?? "") || "action";
23979
24610
  const choices = [
23980
24611
  { value: "once", label: "Allow once" },
23981
24612
  ...request.rememberable ? [{ value: "global", label: `Always allow ${tool} everywhere` }] : [],
@@ -24032,7 +24663,7 @@ class OpenTuiApplication {
24032
24663
  this.session.setThinkingLevel(next);
24033
24664
  }
24034
24665
  extensionShortcut(data) {
24035
- const shortcut = [...this.session.extensionRunner.getShortcuts(this.keybindings.getResolvedBindings()).entries()].find(([key]) => matchesKey21(data, key));
24666
+ const shortcut = [...this.session.extensionRunner.getShortcuts(this.keybindings.getResolvedBindings()).entries()].find(([key]) => matchesKey22(data, key));
24036
24667
  if (!shortcut)
24037
24668
  return false;
24038
24669
  this.attempt(() => shortcut[1].handler(this.session.extensionRunner.createContext()));
@@ -24098,7 +24729,8 @@ class OpenTuiApplication {
24098
24729
  return null;
24099
24730
  let items = [];
24100
24731
  try {
24101
- items = skill && !this.paletteOpen ? this.commands?.skills().map((item) => ({ name: item.name, description: item.description, prefix: "$" })) ?? [] : this.commands?.completions().map((item) => ({
24732
+ items = skill && !this.paletteOpen ? this.commands?.skills().map((item) => ({ id: `$${item.name}`, name: item.name, description: item.description, prefix: "$" })) ?? [] : this.commands?.completions().map((item) => ({
24733
+ id: `/${item.name}`,
24102
24734
  name: item.name,
24103
24735
  ...item.aliases?.length ? { aliases: item.aliases } : {},
24104
24736
  description: item.description
@@ -24374,6 +25006,9 @@ class OpenTuiApplication {
24374
25006
  this.notify("Images are only sent with a message; this one runs without them.", "warning");
24375
25007
  if (command)
24376
25008
  this.commandBusy = true;
25009
+ const explicitStopCommand = command && text.trim() === "/stop" && !this.session.isIdle;
25010
+ if (explicitStopCommand)
25011
+ this.explicitStopRequested = true;
24377
25012
  this.clearDraft();
24378
25013
  this.attempt(async () => {
24379
25014
  try {
@@ -24384,6 +25019,8 @@ class OpenTuiApplication {
24384
25019
  this.rememberSlashCommand(draft);
24385
25020
  return;
24386
25021
  }
25022
+ if (explicitStopCommand)
25023
+ this.explicitStopRequested = false;
24387
25024
  if (bangMode) {
24388
25025
  if (this.planBarrierOpen || !this.session.isIdle) {
24389
25026
  this.planBarrierOpen = true;
@@ -24405,9 +25042,22 @@ class OpenTuiApplication {
24405
25042
  this.change();
24406
25043
  return;
24407
25044
  }
24408
- if (!this.session.isIdle)
25045
+ const queued = !this.session.isIdle ? { id: randomUUID6(), kind: followUp ? "followUp" : "steering", text, ...images ? { images } : {} } : undefined;
25046
+ if (queued)
25047
+ (followUp ? this.followUpMetadata : this.steeringMetadata).push(queued);
25048
+ if (queued)
24409
25049
  this.notify(followUp ? "Follow-up message queued." : "Steering message queued.");
24410
- await this.runtime.submit(text, followUp, images);
25050
+ try {
25051
+ await this.runtime.submit(text, followUp, images);
25052
+ } catch (error) {
25053
+ if (queued) {
25054
+ const metadata = followUp ? this.followUpMetadata : this.steeringMetadata;
25055
+ const index = metadata.findIndex((entry) => entry.id === queued.id);
25056
+ if (index >= 0)
25057
+ metadata.splice(index, 1);
25058
+ }
25059
+ throw error;
25060
+ }
24411
25061
  } finally {
24412
25062
  if (command)
24413
25063
  this.commandBusy = false;
@@ -24433,7 +25083,7 @@ class OpenTuiApplication {
24433
25083
  if (outcome.kind === "blocked")
24434
25084
  this.notify("Planning stopped because user input is unavailable.", "warning");
24435
25085
  else if (outcome.kind === "invalid")
24436
- this.notify("The plan reply did not include a valid plan or blocked outcome.", "warning");
25086
+ this.notify("The plan reply left its plan block incomplete, so no plan was offered.", "warning");
24437
25087
  }
24438
25088
  }
24439
25089
  implementPlan(title) {
@@ -24790,10 +25440,10 @@ class OpenTuiApplication {
24790
25440
  if (this.sideQuestion?.visible)
24791
25441
  this.sideQuestion.dismiss();
24792
25442
  else
24793
- this.attempt(() => this.runtime.interrupt());
25443
+ this.requestUserInterrupt();
24794
25444
  } else if (is("app.clear")) {
24795
25445
  if (this.session.isStreaming)
24796
- this.attempt(() => this.runtime.interrupt());
25446
+ this.requestUserInterrupt();
24797
25447
  else if (this.draft)
24798
25448
  this.clearDraft();
24799
25449
  else
@@ -24820,13 +25470,15 @@ class OpenTuiApplication {
24820
25470
  const editor = this.customEditor;
24821
25471
  this.submit(editor?.getExpandedText?.() ?? (this.bashMode ? `!${this.draft}` : this.draft), false);
24822
25472
  } else if (is("app.message.dequeue")) {
24823
- const pending = this.session.clearQueue();
25473
+ const pending = this.orderedQueue([...this.heldQueue, ...this.captureNativeQueue(true)]);
24824
25474
  const deferred = this.deferredInputs.map((input) => input.kind === "plan" ? `/plan ${input.text}` : input.text);
24825
- if (this.deferredInputs.some((input) => input.kind !== "bash" && input.images?.length))
25475
+ if (pending.some((entry) => entry.images?.length) || this.deferredInputs.some((input) => input.kind !== "bash" && input.images?.length))
24826
25476
  this.notify("Images on queued messages were dropped; paste them again.", "warning");
25477
+ this.heldQueue = [];
25478
+ this.queueDispatchEligible = false;
24827
25479
  this.deferredInputs = [];
24828
25480
  this.planBarrierOpen = this.planActive || this.activeDeferredKind === "plan";
24829
- this.setDraftExternal([...pending.steering, ...pending.followUp, ...deferred, this.draft].filter(Boolean).join(`
25481
+ this.setDraftExternal([...pending.map((entry) => entry.text), ...deferred, this.draft].filter(Boolean).join(`
24830
25482
  `));
24831
25483
  } else if (is("app.editor.external"))
24832
25484
  this.attempt(() => this.externalEditor());
@@ -24885,6 +25537,9 @@ class OpenTuiApplication {
24885
25537
  const frames = indicator?.frames ?? getWorkingSpinnerFrames(process.env.TERM);
24886
25538
  return spinnerFrameAt(Date.now() - since, frames, indicator?.intervalMs ?? SPINNER_INTERVAL_MS);
24887
25539
  }
25540
+ phaseLabel() {
25541
+ return workingPhase({ now: Date.now(), tools: this.toolsInFlight, subagents: this.subagents, retry: this.retryPhase, progressAt: this.progressAt, answered: this.answered });
25542
+ }
24888
25543
  working() {
24889
25544
  const since = this.startedAt ?? this.compacting?.since ?? null;
24890
25545
  const active = since !== null;
@@ -24892,7 +25547,7 @@ class OpenTuiApplication {
24892
25547
  return { active: false, frame: "", ...this.completedWorkingStatus };
24893
25548
  }
24894
25549
  const state = this.ui?.state;
24895
- const label = !active ? "" : this.compacting ? this.compacting.label : state?.workingVisible === false ? "" : state?.workingMessage ?? this.activeVerb ?? "Working\u2026";
25550
+ const label = !active ? "" : this.compacting ? this.compacting.label : state?.workingVisible === false ? "" : state?.workingMessage ?? this.phaseLabel() ?? this.activeVerb ?? "Working\u2026";
24896
25551
  const elapsedMs = since !== null ? Math.max(0, Date.now() - since) : null;
24897
25552
  const frame = since !== null ? this.workingSpinnerFrame(since) : "";
24898
25553
  return {
@@ -24972,8 +25627,7 @@ class OpenTuiApplication {
24972
25627
  sideQuestionDock,
24973
25628
  questionDock: this.questionDock?.view ?? null,
24974
25629
  pendingMessages: [
24975
- ...(this.runtime?.session?.getSteeringMessages?.() ?? []).map((text) => ({ kind: "steering", text })),
24976
- ...(this.runtime?.session?.getFollowUpMessages?.() ?? []).map((text) => ({ kind: "followUp", text })),
25630
+ ...this.queueEntries().map((entry) => ({ kind: entry.kind, text: entry.text })),
24977
25631
  ...this.deferredInputs.map((input) => ({ kind: input.kind, text: input.text }))
24978
25632
  ],
24979
25633
  working: { ...this.working(), sessionName: snapshot?.name },
@@ -25291,6 +25945,11 @@ function questionDockColumns(availableWidth) {
25291
25945
  const label = Math.max(0, Math.floor(remaining / 3));
25292
25946
  return { marker, label, gap, description: remaining - label };
25293
25947
  }
25948
+ function questionDockSketchFrameWidth(availableContentWidth, canvasWidth) {
25949
+ const viewportWidth = Math.max(1, Math.floor(availableContentWidth));
25950
+ const sketchWidth = Math.max(1, Math.floor(canvasWidth));
25951
+ return Math.min(viewportWidth, sketchWidth) + 2;
25952
+ }
25294
25953
  var sketchBorder = {
25295
25954
  topLeft: "\u250C",
25296
25955
  topRight: "\u2510",
@@ -25441,10 +26100,10 @@ function connectFrames(lines, cells, kinds) {
25441
26100
  }
25442
26101
  }
25443
26102
  }
25444
- function layoutSketchPanel(sketch, availableWidth) {
26103
+ function layoutSketchPanel(sketch) {
25445
26104
  const source = sketch.split(`
25446
26105
  `);
25447
- const width = Math.max(1, Math.floor(availableWidth), ...source.map((line) => line.length));
26106
+ const width = Math.max(QUESTION_SKETCH_MAX_COLUMNS, ...source.map((line) => line.length));
25448
26107
  const dividers = [];
25449
26108
  const lines = source.map((line, row) => {
25450
26109
  if (!/^\s*-{3,}\s*$/u.test(line))
@@ -25664,8 +26323,9 @@ function QuestionDock(props) {
25664
26323
  const columns = () => questionDockColumns(Math.max(0, contentWidth() - 2));
25665
26324
  const sketchLines = () => (props.view.sketchPreview?.sketch ?? "").split(`
25666
26325
  `);
25667
- const sketchPanel = createMemo(() => layoutSketchPanel(props.view.sketchPreview?.sketch ?? "", Math.max(1, contentWidth() - 2)));
26326
+ const sketchPanel = createMemo(() => layoutSketchPanel(props.view.sketchPreview?.sketch ?? ""));
25668
26327
  const sketchWidth = () => sketchPanel().width;
26328
+ const sketchFrameWidth = () => questionDockSketchFrameWidth(Math.max(1, contentWidth() - 2), sketchWidth());
25669
26329
  const previewHeight = () => sketchViewportHeight(props.view.sketchPreview?.sketch ?? "", dimensions().height);
25670
26330
  const revealPreview = (direction) => {
25671
26331
  if (!body || !previewFrame)
@@ -26015,18 +26675,19 @@ function QuestionDock(props) {
26015
26675
  _$setProp(_el$38, "wrapMode", "none");
26016
26676
  _$insert(_el$38, () => sketchPanel().text);
26017
26677
  _$effect((_p$) => {
26018
- var _v$42 = previewHeight() + 2, _v$43 = theme.dim, _v$44 = previewHeight(), _v$45 = {
26678
+ var _v$42 = sketchFrameWidth(), _v$43 = previewHeight() + 2, _v$44 = theme.dim, _v$45 = previewHeight(), _v$46 = {
26019
26679
  flexShrink: 0,
26020
26680
  minWidth: sketchWidth(),
26021
26681
  maxWidth: sketchWidth(),
26022
26682
  height: sketchLines().length
26023
- }, _v$46 = sketchWidth(), _v$47 = theme.text;
26024
- _v$42 !== _p$.e && (_p$.e = _$setProp(_el$36, "height", _v$42, _p$.e));
26025
- _v$43 !== _p$.t && (_p$.t = _$setProp(_el$36, "borderColor", _v$43, _p$.t));
26026
- _v$44 !== _p$.a && (_p$.a = _$setProp(_el$37, "height", _v$44, _p$.a));
26027
- _v$45 !== _p$.o && (_p$.o = _$setProp(_el$37, "contentOptions", _v$45, _p$.o));
26028
- _v$46 !== _p$.i && (_p$.i = _$setProp(_el$38, "width", _v$46, _p$.i));
26029
- _v$47 !== _p$.n && (_p$.n = _$setProp(_el$38, "fg", _v$47, _p$.n));
26683
+ }, _v$47 = sketchWidth(), _v$48 = theme.text;
26684
+ _v$42 !== _p$.e && (_p$.e = _$setProp(_el$36, "width", _v$42, _p$.e));
26685
+ _v$43 !== _p$.t && (_p$.t = _$setProp(_el$36, "height", _v$43, _p$.t));
26686
+ _v$44 !== _p$.a && (_p$.a = _$setProp(_el$36, "borderColor", _v$44, _p$.a));
26687
+ _v$45 !== _p$.o && (_p$.o = _$setProp(_el$37, "height", _v$45, _p$.o));
26688
+ _v$46 !== _p$.i && (_p$.i = _$setProp(_el$37, "contentOptions", _v$46, _p$.i));
26689
+ _v$47 !== _p$.n && (_p$.n = _$setProp(_el$38, "width", _v$47, _p$.n));
26690
+ _v$48 !== _p$.s && (_p$.s = _$setProp(_el$38, "fg", _v$48, _p$.s));
26030
26691
  return _p$;
26031
26692
  }, {
26032
26693
  e: undefined,
@@ -26034,7 +26695,8 @@ function QuestionDock(props) {
26034
26695
  a: undefined,
26035
26696
  o: undefined,
26036
26697
  i: undefined,
26037
- n: undefined
26698
+ n: undefined,
26699
+ s: undefined
26038
26700
  });
26039
26701
  return _el$36;
26040
26702
  })() : null;
@@ -26480,11 +27142,11 @@ function pendingMessageRows(messages, width, maxRows = 4) {
26480
27142
  const { label, accent } = labels[message.kind];
26481
27143
  const room = columns - visibleWidth20(label) - 1;
26482
27144
  if (room < 1)
26483
- return { label: "", text: fit(body(message), columns), accent: false };
26484
- return { label, text: fit(body(message), room), accent };
27145
+ return { kind: message.kind, label: "", text: fit(body(message), columns), accent: false };
27146
+ return { kind: message.kind, label, text: fit(body(message), room), accent };
26485
27147
  });
26486
27148
  if (messages.length > shown) {
26487
- result.push({ label: "", text: fit(`+${messages.length - shown} more pending`, columns), accent: false });
27149
+ result.push({ kind: null, label: "", text: fit(`+${messages.length - shown} more pending`, columns), accent: false });
26488
27150
  }
26489
27151
  return result;
26490
27152
  }
@@ -27037,7 +27699,7 @@ function TranscriptItemView(props) {
27037
27699
  get attributes() {
27038
27700
  return TextAttributes2.BOLD;
27039
27701
  },
27040
- children: " todo"
27702
+ children: " Todo"
27041
27703
  }), null);
27042
27704
  _$insert2(_el$28, _$createComponent2(Span, {
27043
27705
  get fg() {
@@ -27230,7 +27892,7 @@ function TranscriptItemView(props) {
27230
27892
  return TextAttributes2.BOLD;
27231
27893
  },
27232
27894
  get children() {
27233
- return [" ", _$memo2(() => item.name)];
27895
+ return [" ", _$memo2(() => toolDisplayName(item.name))];
27234
27896
  }
27235
27897
  }), null);
27236
27898
  _$insert2(_el$45, _$createComponent2(Show2, {
@@ -27746,36 +28408,71 @@ function PendingMessages(props) {
27746
28408
  get each() {
27747
28409
  return rows();
27748
28410
  },
27749
- children: (row) => (() => {
27750
- var _el$90 = _$createElement2("text");
27751
- _$setProp2(_el$90, "wrapMode", "none");
27752
- _$setProp2(_el$90, "truncate", true);
27753
- _$insert2(_el$90, _$createComponent2(Show2, {
27754
- get when() {
27755
- return row.label;
27756
- },
27757
- get children() {
27758
- return _$createComponent2(Span, {
27759
- get fg() {
27760
- return _$memo2(() => !!row.accent)() ? theme2.accent : theme2.muted;
27761
- },
27762
- get children() {
27763
- return `${row.label} `;
27764
- }
27765
- });
27766
- }
27767
- }), null);
27768
- _$insert2(_el$90, _$createComponent2(Span, {
27769
- get fg() {
27770
- return theme2.muted;
27771
- },
27772
- get children() {
27773
- return row.text;
27774
- }
27775
- }), null);
27776
- _$effect2((_$p) => _$setProp2(_el$90, "fg", theme2.muted, _$p));
27777
- return _el$90;
27778
- })()
28411
+ children: (row) => {
28412
+ const actionable = row.kind === "followUp" || row.kind === "steering";
28413
+ const [hovered, setHovered] = createSignal2(false);
28414
+ return (() => {
28415
+ var _el$90 = _$createElement2("box"), _el$91 = _$createElement2("text");
28416
+ _$insertNode2(_el$90, _el$91);
28417
+ _$setProp2(_el$90, "onMouseOver", () => {
28418
+ if (actionable)
28419
+ setHovered(true);
28420
+ });
28421
+ _$setProp2(_el$90, "onMouseOut", () => setHovered(false));
28422
+ _$setProp2(_el$90, "onMouseUp", (event) => {
28423
+ if (!actionable || event.button !== 0 || event.isDragging)
28424
+ return;
28425
+ event.stopPropagation();
28426
+ props.app.openFollowUpQueue();
28427
+ });
28428
+ _$setProp2(_el$91, "wrapMode", "none");
28429
+ _$setProp2(_el$91, "truncate", true);
28430
+ _$insert2(_el$91, _$createComponent2(Show2, {
28431
+ get when() {
28432
+ return row.label;
28433
+ },
28434
+ get children() {
28435
+ return _$createComponent2(Span, {
28436
+ get fg() {
28437
+ return _$memo2(() => !!row.accent)() ? theme2.accent : theme2.muted;
28438
+ },
28439
+ get children() {
28440
+ return `${row.label} `;
28441
+ }
28442
+ });
28443
+ }
28444
+ }), null);
28445
+ _$insert2(_el$91, _$createComponent2(Span, {
28446
+ get fg() {
28447
+ return theme2.muted;
28448
+ },
28449
+ get children() {
28450
+ return row.text;
28451
+ }
28452
+ }), null);
28453
+ _$insert2(_el$91, _$createComponent2(Show2, {
28454
+ when: actionable,
28455
+ get children() {
28456
+ return _$createComponent2(Span, {
28457
+ get fg() {
28458
+ return theme2.accent;
28459
+ },
28460
+ children: " \xB7 manage"
28461
+ });
28462
+ }
28463
+ }), null);
28464
+ _$effect2((_p$) => {
28465
+ var _v$59 = hovered() && actionable ? theme2.selectionBg : undefined, _v$60 = hovered() && actionable ? theme2.selectionText : theme2.muted;
28466
+ _v$59 !== _p$.e && (_p$.e = _$setProp2(_el$90, "backgroundColor", _v$59, _p$.e));
28467
+ _v$60 !== _p$.t && (_p$.t = _$setProp2(_el$91, "fg", _v$60, _p$.t));
28468
+ return _p$;
28469
+ }, {
28470
+ e: undefined,
28471
+ t: undefined
28472
+ });
28473
+ return _el$90;
28474
+ })();
28475
+ }
27779
28476
  }));
27780
28477
  return _el$89;
27781
28478
  }
@@ -27794,22 +28491,22 @@ function WorkingLine(props) {
27794
28491
  },
27795
28492
  get fallback() {
27796
28493
  return (() => {
27797
- var _el$93 = _$createElement2("box");
27798
- _$setProp2(_el$93, "height", 0);
27799
- _$setProp2(_el$93, "flexShrink", 0);
27800
- return _el$93;
28494
+ var _el$94 = _$createElement2("box");
28495
+ _$setProp2(_el$94, "height", 0);
28496
+ _$setProp2(_el$94, "flexShrink", 0);
28497
+ return _el$94;
27801
28498
  })();
27802
28499
  },
27803
28500
  get children() {
27804
- var _el$91 = _$createElement2("box"), _el$92 = _$createElement2("text");
27805
- _$insertNode2(_el$91, _el$92);
27806
- _$setProp2(_el$91, "width", "100%");
27807
- _$setProp2(_el$91, "paddingX", 1);
27808
- _$setProp2(_el$91, "marginTop", 1);
27809
- _$setProp2(_el$91, "flexShrink", 0);
27810
- _$setProp2(_el$92, "wrapMode", "none");
27811
- _$setProp2(_el$92, "truncate", true);
27812
- _$insert2(_el$92, _$createComponent2(Span, {
28501
+ var _el$92 = _$createElement2("box"), _el$93 = _$createElement2("text");
28502
+ _$insertNode2(_el$92, _el$93);
28503
+ _$setProp2(_el$92, "width", "100%");
28504
+ _$setProp2(_el$92, "paddingX", 1);
28505
+ _$setProp2(_el$92, "marginTop", 1);
28506
+ _$setProp2(_el$92, "flexShrink", 0);
28507
+ _$setProp2(_el$93, "wrapMode", "none");
28508
+ _$setProp2(_el$93, "truncate", true);
28509
+ _$insert2(_el$93, _$createComponent2(Span, {
27813
28510
  get fg() {
27814
28511
  return statusColor();
27815
28512
  },
@@ -27817,7 +28514,7 @@ function WorkingLine(props) {
27817
28514
  return parts().prefix;
27818
28515
  }
27819
28516
  }), null);
27820
- _$insert2(_el$92, _$createComponent2(For2, {
28517
+ _$insert2(_el$93, _$createComponent2(For2, {
27821
28518
  get each() {
27822
28519
  return Array.from(parts().label);
27823
28520
  },
@@ -27828,7 +28525,7 @@ function WorkingLine(props) {
27828
28525
  children: character
27829
28526
  })
27830
28527
  }), null);
27831
- _$insert2(_el$92, _$createComponent2(Span, {
28528
+ _$insert2(_el$93, _$createComponent2(Span, {
27832
28529
  get fg() {
27833
28530
  return statusColor();
27834
28531
  },
@@ -27836,8 +28533,8 @@ function WorkingLine(props) {
27836
28533
  return parts().suffix;
27837
28534
  }
27838
28535
  }), null);
27839
- _$effect2((_$p) => _$setProp2(_el$92, "fg", statusColor(), _$p));
27840
- return _el$91;
28536
+ _$effect2((_$p) => _$setProp2(_el$93, "fg", statusColor(), _$p));
28537
+ return _el$92;
27841
28538
  }
27842
28539
  });
27843
28540
  }
@@ -27883,20 +28580,20 @@ function subagentToneColor(t, tone) {
27883
28580
  function SubagentRoster(props) {
27884
28581
  const t = theme2;
27885
28582
  return (() => {
27886
- var _el$94 = _$createElement2("box");
27887
- _$setProp2(_el$94, "flexDirection", "column");
27888
- _$setProp2(_el$94, "marginTop", 1);
27889
- _$setProp2(_el$94, "paddingX", 1);
27890
- _$setProp2(_el$94, "flexShrink", 0);
27891
- _$insert2(_el$94, _$createComponent2(For2, {
28583
+ var _el$95 = _$createElement2("box");
28584
+ _$setProp2(_el$95, "flexDirection", "column");
28585
+ _$setProp2(_el$95, "marginTop", 1);
28586
+ _$setProp2(_el$95, "paddingX", 1);
28587
+ _$setProp2(_el$95, "flexShrink", 0);
28588
+ _$insert2(_el$95, _$createComponent2(For2, {
27892
28589
  get each() {
27893
28590
  return props.roster.rows;
27894
28591
  },
27895
28592
  children: (row) => (() => {
27896
- var _el$96 = _$createElement2("text");
27897
- _$setProp2(_el$96, "wrapMode", "none");
27898
- _$setProp2(_el$96, "truncate", true);
27899
- _$insert2(_el$96, _$createComponent2(Span, {
28593
+ var _el$97 = _$createElement2("text");
28594
+ _$setProp2(_el$97, "wrapMode", "none");
28595
+ _$setProp2(_el$97, "truncate", true);
28596
+ _$insert2(_el$97, _$createComponent2(Span, {
27900
28597
  get fg() {
27901
28598
  return _$memo2(() => !!(row.tone === "warning" && row.color))() ? profileColor(t, row.color) : subagentToneColor(t, row.tone);
27902
28599
  },
@@ -27904,7 +28601,7 @@ function SubagentRoster(props) {
27904
28601
  return row.mark;
27905
28602
  }
27906
28603
  }), null);
27907
- _$insert2(_el$96, _$createComponent2(Span, {
28604
+ _$insert2(_el$97, _$createComponent2(Span, {
27908
28605
  get fg() {
27909
28606
  return _$memo2(() => !!row.color)() ? profileColor(t, row.color) : t.muted;
27910
28607
  },
@@ -27915,7 +28612,7 @@ function SubagentRoster(props) {
27915
28612
  return ` ${row.profile}`;
27916
28613
  }
27917
28614
  }), null);
27918
- _$insert2(_el$96, _$createComponent2(Span, {
28615
+ _$insert2(_el$97, _$createComponent2(Span, {
27919
28616
  get fg() {
27920
28617
  return t.text;
27921
28618
  },
@@ -27923,7 +28620,7 @@ function SubagentRoster(props) {
27923
28620
  return ` ${row.title}`;
27924
28621
  }
27925
28622
  }), null);
27926
- _$insert2(_el$96, _$createComponent2(Show2, {
28623
+ _$insert2(_el$97, _$createComponent2(Show2, {
27927
28624
  get when() {
27928
28625
  return row.tasks;
27929
28626
  },
@@ -27938,23 +28635,23 @@ function SubagentRoster(props) {
27938
28635
  });
27939
28636
  }
27940
28637
  }), null);
27941
- return _el$96;
28638
+ return _el$97;
27942
28639
  })()
27943
28640
  }), null);
27944
- _$insert2(_el$94, _$createComponent2(Show2, {
28641
+ _$insert2(_el$95, _$createComponent2(Show2, {
27945
28642
  get when() {
27946
28643
  return props.roster.overflow;
27947
28644
  },
27948
28645
  get children() {
27949
- var _el$95 = _$createElement2("text");
27950
- _$setProp2(_el$95, "wrapMode", "none");
27951
- _$setProp2(_el$95, "truncate", true);
27952
- _$insert2(_el$95, () => props.roster.overflow);
27953
- _$effect2((_$p) => _$setProp2(_el$95, "fg", t.muted, _$p));
27954
- return _el$95;
28646
+ var _el$96 = _$createElement2("text");
28647
+ _$setProp2(_el$96, "wrapMode", "none");
28648
+ _$setProp2(_el$96, "truncate", true);
28649
+ _$insert2(_el$96, () => props.roster.overflow);
28650
+ _$effect2((_$p) => _$setProp2(_el$96, "fg", t.muted, _$p));
28651
+ return _el$96;
27955
28652
  }
27956
28653
  }), null);
27957
- return _el$94;
28654
+ return _el$95;
27958
28655
  })();
27959
28656
  }
27960
28657
  function Prompt(props) {
@@ -28020,98 +28717,98 @@ function Prompt(props) {
28020
28717
  overlay: Boolean(view().overlay)
28021
28718
  });
28022
28719
  return (() => {
28023
- var _el$97 = _$createElement2("box");
28024
- _$setProp2(_el$97, "flexDirection", "column");
28025
- _$setProp2(_el$97, "flexShrink", 0);
28026
- _$insert2(_el$97, _$createComponent2(Show2, {
28720
+ var _el$98 = _$createElement2("box");
28721
+ _$setProp2(_el$98, "flexDirection", "column");
28722
+ _$setProp2(_el$98, "flexShrink", 0);
28723
+ _$insert2(_el$98, _$createComponent2(Show2, {
28027
28724
  get when() {
28028
28725
  return view().customEditor;
28029
28726
  },
28030
28727
  get fallback() {
28031
28728
  return (() => {
28032
- var _el$98 = _$createElement2("box"), _el$99 = _$createElement2("box"), _el$100 = _$createElement2("box"), _el$104 = _$createElement2("box"), _el$105 = _$createElement2("box"), _el$106 = _$createElement2("textarea");
28033
- _$insertNode2(_el$98, _el$99);
28034
- _$insertNode2(_el$98, _el$104);
28035
- _$setProp2(_el$98, "flexDirection", "column");
28036
- _$setProp2(_el$98, "border", ["bottom"]);
28037
- _$setProp2(_el$98, "borderStyle", "single");
28038
- _$setProp2(_el$98, "backgroundColor", "transparent");
28039
- _$setProp2(_el$98, "flexShrink", 0);
28729
+ var _el$99 = _$createElement2("box"), _el$100 = _$createElement2("box"), _el$101 = _$createElement2("box"), _el$105 = _$createElement2("box"), _el$106 = _$createElement2("box"), _el$107 = _$createElement2("textarea");
28040
28730
  _$insertNode2(_el$99, _el$100);
28041
- _$setProp2(_el$99, "flexDirection", "row");
28042
- _$setProp2(_el$99, "width", "100%");
28043
- _$setProp2(_el$99, "height", 1);
28731
+ _$insertNode2(_el$99, _el$105);
28732
+ _$setProp2(_el$99, "flexDirection", "column");
28733
+ _$setProp2(_el$99, "border", ["bottom"]);
28734
+ _$setProp2(_el$99, "borderStyle", "single");
28735
+ _$setProp2(_el$99, "backgroundColor", "transparent");
28044
28736
  _$setProp2(_el$99, "flexShrink", 0);
28045
- _$setProp2(_el$100, "flexGrow", 1);
28046
- _$setProp2(_el$100, "minWidth", 0);
28737
+ _$insertNode2(_el$100, _el$101);
28738
+ _$setProp2(_el$100, "flexDirection", "row");
28739
+ _$setProp2(_el$100, "width", "100%");
28047
28740
  _$setProp2(_el$100, "height", 1);
28048
- _$setProp2(_el$100, "border", ["top"]);
28049
- _$setProp2(_el$100, "borderStyle", "single");
28050
- _$setProp2(_el$100, "backgroundColor", "transparent");
28051
- _$insert2(_el$99, _$createComponent2(Show2, {
28741
+ _$setProp2(_el$100, "flexShrink", 0);
28742
+ _$setProp2(_el$101, "flexGrow", 1);
28743
+ _$setProp2(_el$101, "minWidth", 0);
28744
+ _$setProp2(_el$101, "height", 1);
28745
+ _$setProp2(_el$101, "border", ["top"]);
28746
+ _$setProp2(_el$101, "borderStyle", "single");
28747
+ _$setProp2(_el$101, "backgroundColor", "transparent");
28748
+ _$insert2(_el$100, _$createComponent2(Show2, {
28052
28749
  get when() {
28053
28750
  return plan();
28054
28751
  },
28055
28752
  get children() {
28056
28753
  return [(() => {
28057
- var _el$101 = _$createElement2("text");
28058
- _$insertNode2(_el$101, _$createTextNode2(` plan mode `));
28059
- _$setProp2(_el$101, "wrapMode", "none");
28754
+ var _el$102 = _$createElement2("text");
28755
+ _$insertNode2(_el$102, _$createTextNode2(` plan mode `));
28756
+ _$setProp2(_el$102, "wrapMode", "none");
28060
28757
  _$effect2((_p$) => {
28061
- var _v$59 = composerColor(), _v$60 = TextAttributes2.BOLD;
28062
- _v$59 !== _p$.e && (_p$.e = _$setProp2(_el$101, "fg", _v$59, _p$.e));
28063
- _v$60 !== _p$.t && (_p$.t = _$setProp2(_el$101, "attributes", _v$60, _p$.t));
28758
+ var _v$61 = composerColor(), _v$62 = TextAttributes2.BOLD;
28759
+ _v$61 !== _p$.e && (_p$.e = _$setProp2(_el$102, "fg", _v$61, _p$.e));
28760
+ _v$62 !== _p$.t && (_p$.t = _$setProp2(_el$102, "attributes", _v$62, _p$.t));
28064
28761
  return _p$;
28065
28762
  }, {
28066
28763
  e: undefined,
28067
28764
  t: undefined
28068
28765
  });
28069
- return _el$101;
28766
+ return _el$102;
28070
28767
  })(), (() => {
28071
- var _el$103 = _$createElement2("box");
28072
- _$setProp2(_el$103, "width", 1);
28073
- _$setProp2(_el$103, "minWidth", 1);
28074
- _$setProp2(_el$103, "height", 1);
28075
- _$setProp2(_el$103, "border", ["top"]);
28076
- _$setProp2(_el$103, "borderStyle", "single");
28077
- _$setProp2(_el$103, "backgroundColor", "transparent");
28078
- _$effect2((_$p) => _$setProp2(_el$103, "borderColor", composerColor(), _$p));
28079
- return _el$103;
28768
+ var _el$104 = _$createElement2("box");
28769
+ _$setProp2(_el$104, "width", 1);
28770
+ _$setProp2(_el$104, "minWidth", 1);
28771
+ _$setProp2(_el$104, "height", 1);
28772
+ _$setProp2(_el$104, "border", ["top"]);
28773
+ _$setProp2(_el$104, "borderStyle", "single");
28774
+ _$setProp2(_el$104, "backgroundColor", "transparent");
28775
+ _$effect2((_$p) => _$setProp2(_el$104, "borderColor", composerColor(), _$p));
28776
+ return _el$104;
28080
28777
  })()];
28081
28778
  }
28082
28779
  }), null);
28083
- _$insertNode2(_el$104, _el$105);
28084
- _$insertNode2(_el$104, _el$106);
28085
- _$setProp2(_el$104, "flexDirection", "row");
28086
- _$setProp2(_el$104, "paddingX", 1);
28087
- _$setProp2(_el$104, "alignItems", "stretch");
28088
- _$setProp2(_el$105, "width", 2);
28089
- _$setProp2(_el$105, "minWidth", 2);
28090
- _$setProp2(_el$105, "flexDirection", "column");
28091
- _$setProp2(_el$105, "flexShrink", 0);
28092
- _$insert2(_el$105, _$createComponent2(For2, {
28780
+ _$insertNode2(_el$105, _el$106);
28781
+ _$insertNode2(_el$105, _el$107);
28782
+ _$setProp2(_el$105, "flexDirection", "row");
28783
+ _$setProp2(_el$105, "paddingX", 1);
28784
+ _$setProp2(_el$105, "alignItems", "stretch");
28785
+ _$setProp2(_el$106, "width", 2);
28786
+ _$setProp2(_el$106, "minWidth", 2);
28787
+ _$setProp2(_el$106, "flexDirection", "column");
28788
+ _$setProp2(_el$106, "flexShrink", 0);
28789
+ _$insert2(_el$106, _$createComponent2(For2, {
28093
28790
  get each() {
28094
28791
  return Array.from({
28095
28792
  length: inputHeight()
28096
28793
  }, (_, index) => index);
28097
28794
  },
28098
28795
  children: (_, index) => (() => {
28099
- var _el$107 = _$createElement2("text");
28100
- _$setProp2(_el$107, "wrapMode", "none");
28101
- _$insert2(_el$107, (() => {
28796
+ var _el$108 = _$createElement2("text");
28797
+ _$setProp2(_el$108, "wrapMode", "none");
28798
+ _$insert2(_el$108, (() => {
28102
28799
  var _c$2 = _$memo2(() => index() === 0);
28103
28800
  return () => _c$2() ? bash() ? "! " : "\u276F " : " ";
28104
28801
  })());
28105
28802
  _$effect2((_p$) => {
28106
- var _v$70 = composerColor(), _v$71 = TextAttributes2.BOLD;
28107
- _v$70 !== _p$.e && (_p$.e = _$setProp2(_el$107, "fg", _v$70, _p$.e));
28108
- _v$71 !== _p$.t && (_p$.t = _$setProp2(_el$107, "attributes", _v$71, _p$.t));
28803
+ var _v$72 = composerColor(), _v$73 = TextAttributes2.BOLD;
28804
+ _v$72 !== _p$.e && (_p$.e = _$setProp2(_el$108, "fg", _v$72, _p$.e));
28805
+ _v$73 !== _p$.t && (_p$.t = _$setProp2(_el$108, "attributes", _v$73, _p$.t));
28109
28806
  return _p$;
28110
28807
  }, {
28111
28808
  e: undefined,
28112
28809
  t: undefined
28113
28810
  });
28114
- return _el$107;
28811
+ return _el$108;
28115
28812
  })()
28116
28813
  }));
28117
28814
  _$use2((value) => {
@@ -28119,38 +28816,38 @@ function Prompt(props) {
28119
28816
  if (value)
28120
28817
  value.syntaxStyle = props.syntax;
28121
28818
  props.promptRef(value);
28122
- }, _el$106);
28123
- _$setProp2(_el$106, "flexGrow", 1);
28124
- _$setProp2(_el$106, "minHeight", 1);
28125
- _$setProp2(_el$106, "maxHeight", 8);
28126
- _$setProp2(_el$106, "wrapMode", "word");
28127
- _$setProp2(_el$106, "backgroundColor", "transparent");
28128
- _$setProp2(_el$106, "focusedBackgroundColor", "transparent");
28129
- _$setProp2(_el$106, "keyBindings", promptKeyBindings);
28130
- _$setProp2(_el$106, "onPaste", (event) => {
28819
+ }, _el$107);
28820
+ _$setProp2(_el$107, "flexGrow", 1);
28821
+ _$setProp2(_el$107, "minHeight", 1);
28822
+ _$setProp2(_el$107, "maxHeight", 8);
28823
+ _$setProp2(_el$107, "wrapMode", "word");
28824
+ _$setProp2(_el$107, "backgroundColor", "transparent");
28825
+ _$setProp2(_el$107, "focusedBackgroundColor", "transparent");
28826
+ _$setProp2(_el$107, "keyBindings", promptKeyBindings);
28827
+ _$setProp2(_el$107, "onPaste", (event) => {
28131
28828
  event.preventDefault();
28132
28829
  props.app.paste(pastedText(event.bytes));
28133
28830
  });
28134
- _$setProp2(_el$106, "onSubmit", () => {
28831
+ _$setProp2(_el$107, "onSubmit", () => {
28135
28832
  reportDraft();
28136
28833
  props.app.submitPrompt();
28137
28834
  });
28138
- _$setProp2(_el$106, "onContentChange", () => {
28835
+ _$setProp2(_el$107, "onContentChange", () => {
28139
28836
  measure();
28140
28837
  reportDraft();
28141
28838
  });
28142
- _$setProp2(_el$106, "onSizeChange", () => measure());
28839
+ _$setProp2(_el$107, "onSizeChange", () => measure());
28143
28840
  _$effect2((_p$) => {
28144
- var _v$61 = composerColor(), _v$62 = composerColor(), _v$63 = inputHeight(), _v$64 = inputHeight(), { text: _v$65, text: _v$66 } = theme2, _v$67 = bash() ? "Run a shell command\u2026" : view().questionDock ? "Or reply directly to this question\u2026" : plan() ? "Describe a plan\u2026" : view().home ? "Ask anything\u2026" : "Reply\u2026", _v$68 = theme2.dim, _v$69 = composerFocused();
28145
- _v$61 !== _p$.e && (_p$.e = _$setProp2(_el$98, "borderColor", _v$61, _p$.e));
28146
- _v$62 !== _p$.t && (_p$.t = _$setProp2(_el$100, "borderColor", _v$62, _p$.t));
28147
- _v$63 !== _p$.a && (_p$.a = _$setProp2(_el$105, "height", _v$63, _p$.a));
28148
- _v$64 !== _p$.o && (_p$.o = _$setProp2(_el$106, "height", _v$64, _p$.o));
28149
- _v$65 !== _p$.i && (_p$.i = _$setProp2(_el$106, "textColor", _v$65, _p$.i));
28150
- _v$66 !== _p$.n && (_p$.n = _$setProp2(_el$106, "focusedTextColor", _v$66, _p$.n));
28151
- _v$67 !== _p$.s && (_p$.s = _$setProp2(_el$106, "placeholder", _v$67, _p$.s));
28152
- _v$68 !== _p$.h && (_p$.h = _$setProp2(_el$106, "placeholderColor", _v$68, _p$.h));
28153
- _v$69 !== _p$.r && (_p$.r = _$setProp2(_el$106, "focused", _v$69, _p$.r));
28841
+ var _v$63 = composerColor(), _v$64 = composerColor(), _v$65 = inputHeight(), _v$66 = inputHeight(), { text: _v$67, text: _v$68 } = theme2, _v$69 = bash() ? "Run a shell command\u2026" : view().questionDock ? "Or reply directly to this question\u2026" : plan() ? "Describe a plan\u2026" : view().home ? "Ask anything\u2026" : "Reply\u2026", _v$70 = theme2.dim, _v$71 = composerFocused();
28842
+ _v$63 !== _p$.e && (_p$.e = _$setProp2(_el$99, "borderColor", _v$63, _p$.e));
28843
+ _v$64 !== _p$.t && (_p$.t = _$setProp2(_el$101, "borderColor", _v$64, _p$.t));
28844
+ _v$65 !== _p$.a && (_p$.a = _$setProp2(_el$106, "height", _v$65, _p$.a));
28845
+ _v$66 !== _p$.o && (_p$.o = _$setProp2(_el$107, "height", _v$66, _p$.o));
28846
+ _v$67 !== _p$.i && (_p$.i = _$setProp2(_el$107, "textColor", _v$67, _p$.i));
28847
+ _v$68 !== _p$.n && (_p$.n = _$setProp2(_el$107, "focusedTextColor", _v$68, _p$.n));
28848
+ _v$69 !== _p$.s && (_p$.s = _$setProp2(_el$107, "placeholder", _v$69, _p$.s));
28849
+ _v$70 !== _p$.h && (_p$.h = _$setProp2(_el$107, "placeholderColor", _v$70, _p$.h));
28850
+ _v$71 !== _p$.r && (_p$.r = _$setProp2(_el$107, "focused", _v$71, _p$.r));
28154
28851
  return _p$;
28155
28852
  }, {
28156
28853
  e: undefined,
@@ -28163,14 +28860,14 @@ function Prompt(props) {
28163
28860
  h: undefined,
28164
28861
  r: undefined
28165
28862
  });
28166
- return _el$98;
28863
+ return _el$99;
28167
28864
  })();
28168
28865
  },
28169
28866
  children: (lines) => (() => {
28170
- var _el$108 = _$createElement2("box");
28171
- _$setProp2(_el$108, "flexDirection", "column");
28172
- _$setProp2(_el$108, "flexShrink", 0);
28173
- _$insert2(_el$108, _$createComponent2(AnsiView, {
28867
+ var _el$109 = _$createElement2("box");
28868
+ _$setProp2(_el$109, "flexDirection", "column");
28869
+ _$setProp2(_el$109, "flexShrink", 0);
28870
+ _$insert2(_el$109, _$createComponent2(AnsiView, {
28174
28871
  get lines() {
28175
28872
  return lines();
28176
28873
  },
@@ -28178,15 +28875,15 @@ function Prompt(props) {
28178
28875
  return theme2.text;
28179
28876
  }
28180
28877
  }));
28181
- return _el$108;
28878
+ return _el$109;
28182
28879
  })()
28183
28880
  }), null);
28184
- _$insert2(_el$97, _$createComponent2(StatusBar, {
28881
+ _$insert2(_el$98, _$createComponent2(StatusBar, {
28185
28882
  get view() {
28186
28883
  return view();
28187
28884
  }
28188
28885
  }), null);
28189
- return _el$97;
28886
+ return _el$98;
28190
28887
  })();
28191
28888
  }
28192
28889
  function cut2(text, limit) {
@@ -28204,10 +28901,10 @@ function Footer(props) {
28204
28901
  },
28205
28902
  get fallback() {
28206
28903
  return (() => {
28207
- var _el$109 = _$createElement2("box");
28208
- _$setProp2(_el$109, "height", 0);
28209
- _$setProp2(_el$109, "flexShrink", 0);
28210
- return _el$109;
28904
+ var _el$110 = _$createElement2("box");
28905
+ _$setProp2(_el$110, "height", 0);
28906
+ _$setProp2(_el$110, "flexShrink", 0);
28907
+ return _el$110;
28211
28908
  })();
28212
28909
  },
28213
28910
  get children() {
@@ -28217,37 +28914,37 @@ function Footer(props) {
28217
28914
  },
28218
28915
  get fallback() {
28219
28916
  return (() => {
28220
- var _el$110 = _$createElement2("box"), _el$111 = _$createElement2("text");
28221
- _$insertNode2(_el$110, _el$111);
28222
- _$setProp2(_el$110, "flexDirection", "row");
28223
- _$setProp2(_el$110, "justifyContent", "flex-end");
28224
- _$setProp2(_el$110, "flexShrink", 0);
28225
- _$setProp2(_el$110, "paddingX", 1);
28226
- _$setProp2(_el$110, "height", 1);
28227
- _$setProp2(_el$111, "wrapMode", "none");
28228
- _$insert2(_el$111, right);
28229
- _$effect2((_$p) => _$setProp2(_el$111, "fg", theme2.dim, _$p));
28230
- return _el$110;
28917
+ var _el$111 = _$createElement2("box"), _el$112 = _$createElement2("text");
28918
+ _$insertNode2(_el$111, _el$112);
28919
+ _$setProp2(_el$111, "flexDirection", "row");
28920
+ _$setProp2(_el$111, "justifyContent", "flex-end");
28921
+ _$setProp2(_el$111, "flexShrink", 0);
28922
+ _$setProp2(_el$111, "paddingX", 1);
28923
+ _$setProp2(_el$111, "height", 1);
28924
+ _$setProp2(_el$112, "wrapMode", "none");
28925
+ _$insert2(_el$112, right);
28926
+ _$effect2((_$p) => _$setProp2(_el$112, "fg", theme2.dim, _$p));
28927
+ return _el$111;
28231
28928
  })();
28232
28929
  },
28233
28930
  children: (lines) => (() => {
28234
- var _el$112 = _$createElement2("box"), _el$113 = _$createElement2("text");
28235
- _$insertNode2(_el$112, _el$113);
28236
- _$setProp2(_el$112, "flexDirection", "column");
28237
- _$setProp2(_el$112, "flexShrink", 0);
28238
- _$setProp2(_el$112, "paddingX", 1);
28239
- _$insert2(_el$112, _$createComponent2(AnsiView, {
28931
+ var _el$113 = _$createElement2("box"), _el$114 = _$createElement2("text");
28932
+ _$insertNode2(_el$113, _el$114);
28933
+ _$setProp2(_el$113, "flexDirection", "column");
28934
+ _$setProp2(_el$113, "flexShrink", 0);
28935
+ _$setProp2(_el$113, "paddingX", 1);
28936
+ _$insert2(_el$113, _$createComponent2(AnsiView, {
28240
28937
  get lines() {
28241
28938
  return lines();
28242
28939
  },
28243
28940
  get fg() {
28244
28941
  return theme2.muted;
28245
28942
  }
28246
- }), _el$113);
28247
- _$setProp2(_el$113, "wrapMode", "none");
28248
- _$insert2(_el$113, right);
28249
- _$effect2((_$p) => _$setProp2(_el$113, "fg", theme2.dim, _$p));
28250
- return _el$112;
28943
+ }), _el$114);
28944
+ _$setProp2(_el$114, "wrapMode", "none");
28945
+ _$insert2(_el$114, right);
28946
+ _$effect2((_$p) => _$setProp2(_el$114, "fg", theme2.dim, _$p));
28947
+ return _el$113;
28251
28948
  })()
28252
28949
  });
28253
28950
  }
@@ -28256,35 +28953,35 @@ function Footer(props) {
28256
28953
  function JumpToLatestBadge(props) {
28257
28954
  const [hovered, setHovered] = createSignal2(false);
28258
28955
  return (() => {
28259
- var _el$114 = _$createElement2("box"), _el$115 = _$createElement2("text");
28260
- _$insertNode2(_el$114, _el$115);
28261
- _$setProp2(_el$114, "position", "absolute");
28262
- _$setProp2(_el$114, "right", 1);
28263
- _$setProp2(_el$114, "bottom", 1);
28264
- _$setProp2(_el$114, "zIndex", 2);
28265
- _$setProp2(_el$114, "paddingX", 1);
28266
- _$setProp2(_el$114, "onMouseOver", () => setHovered(true));
28267
- _$setProp2(_el$114, "onMouseOut", () => setHovered(false));
28268
- _$setProp2(_el$114, "onMouseDown", (event) => {
28956
+ var _el$115 = _$createElement2("box"), _el$116 = _$createElement2("text");
28957
+ _$insertNode2(_el$115, _el$116);
28958
+ _$setProp2(_el$115, "position", "absolute");
28959
+ _$setProp2(_el$115, "right", 1);
28960
+ _$setProp2(_el$115, "bottom", 1);
28961
+ _$setProp2(_el$115, "zIndex", 2);
28962
+ _$setProp2(_el$115, "paddingX", 1);
28963
+ _$setProp2(_el$115, "onMouseOver", () => setHovered(true));
28964
+ _$setProp2(_el$115, "onMouseOut", () => setHovered(false));
28965
+ _$setProp2(_el$115, "onMouseDown", (event) => {
28269
28966
  if (event.button !== 0 || event.isDragging)
28270
28967
  return;
28271
28968
  event.stopPropagation();
28272
28969
  props.activate();
28273
28970
  });
28274
- _$insertNode2(_el$115, _$createTextNode2(`\u2193 Jump to latest`));
28275
- _$setProp2(_el$115, "wrapMode", "none");
28971
+ _$insertNode2(_el$116, _$createTextNode2(`\u2193 Jump to latest`));
28972
+ _$setProp2(_el$116, "wrapMode", "none");
28276
28973
  _$effect2((_p$) => {
28277
- var _v$72 = hovered() ? theme2.selectionBg : theme2.panel, _v$73 = hovered() ? theme2.selectionText : theme2.accent, _v$74 = TextAttributes2.BOLD;
28278
- _v$72 !== _p$.e && (_p$.e = _$setProp2(_el$114, "backgroundColor", _v$72, _p$.e));
28279
- _v$73 !== _p$.t && (_p$.t = _$setProp2(_el$115, "fg", _v$73, _p$.t));
28280
- _v$74 !== _p$.a && (_p$.a = _$setProp2(_el$115, "attributes", _v$74, _p$.a));
28974
+ var _v$74 = hovered() ? theme2.selectionBg : theme2.panel, _v$75 = hovered() ? theme2.selectionText : theme2.accent, _v$76 = TextAttributes2.BOLD;
28975
+ _v$74 !== _p$.e && (_p$.e = _$setProp2(_el$115, "backgroundColor", _v$74, _p$.e));
28976
+ _v$75 !== _p$.t && (_p$.t = _$setProp2(_el$116, "fg", _v$75, _p$.t));
28977
+ _v$76 !== _p$.a && (_p$.a = _$setProp2(_el$116, "attributes", _v$76, _p$.a));
28281
28978
  return _p$;
28282
28979
  }, {
28283
28980
  e: undefined,
28284
28981
  t: undefined,
28285
28982
  a: undefined
28286
28983
  });
28287
- return _el$114;
28984
+ return _el$115;
28288
28985
  })();
28289
28986
  }
28290
28987
  function Toast(props) {
@@ -28294,22 +28991,22 @@ function Toast(props) {
28294
28991
  return layout();
28295
28992
  },
28296
28993
  children: (value) => (() => {
28297
- var _el$117 = _$createElement2("box"), _el$118 = _$createElement2("text");
28298
- _$insertNode2(_el$117, _el$118);
28299
- _$setProp2(_el$117, "position", "absolute");
28300
- _$setProp2(_el$117, "height", 1);
28301
- _$setProp2(_el$117, "zIndex", 200);
28302
- _$setProp2(_el$117, "paddingX", 1);
28303
- _$setProp2(_el$118, "wrapMode", "none");
28304
- _$setProp2(_el$118, "truncate", true);
28305
- _$insert2(_el$118, () => value().message);
28994
+ var _el$118 = _$createElement2("box"), _el$119 = _$createElement2("text");
28995
+ _$insertNode2(_el$118, _el$119);
28996
+ _$setProp2(_el$118, "position", "absolute");
28997
+ _$setProp2(_el$118, "height", 1);
28998
+ _$setProp2(_el$118, "zIndex", 200);
28999
+ _$setProp2(_el$118, "paddingX", 1);
29000
+ _$setProp2(_el$119, "wrapMode", "none");
29001
+ _$setProp2(_el$119, "truncate", true);
29002
+ _$insert2(_el$119, () => value().message);
28306
29003
  _$effect2((_p$) => {
28307
- var _v$75 = value().top, _v$76 = value().right, _v$77 = value().width, { selectionBg: _v$78, selectionText: _v$79 } = theme2;
28308
- _v$75 !== _p$.e && (_p$.e = _$setProp2(_el$117, "top", _v$75, _p$.e));
28309
- _v$76 !== _p$.t && (_p$.t = _$setProp2(_el$117, "right", _v$76, _p$.t));
28310
- _v$77 !== _p$.a && (_p$.a = _$setProp2(_el$117, "width", _v$77, _p$.a));
28311
- _v$78 !== _p$.o && (_p$.o = _$setProp2(_el$117, "backgroundColor", _v$78, _p$.o));
28312
- _v$79 !== _p$.i && (_p$.i = _$setProp2(_el$118, "fg", _v$79, _p$.i));
29004
+ var _v$77 = value().top, _v$78 = value().right, _v$79 = value().width, { selectionBg: _v$80, selectionText: _v$81 } = theme2;
29005
+ _v$77 !== _p$.e && (_p$.e = _$setProp2(_el$118, "top", _v$77, _p$.e));
29006
+ _v$78 !== _p$.t && (_p$.t = _$setProp2(_el$118, "right", _v$78, _p$.t));
29007
+ _v$79 !== _p$.a && (_p$.a = _$setProp2(_el$118, "width", _v$79, _p$.a));
29008
+ _v$80 !== _p$.o && (_p$.o = _$setProp2(_el$118, "backgroundColor", _v$80, _p$.o));
29009
+ _v$81 !== _p$.i && (_p$.i = _$setProp2(_el$119, "fg", _v$81, _p$.i));
28313
29010
  return _p$;
28314
29011
  }, {
28315
29012
  e: undefined,
@@ -28318,110 +29015,110 @@ function Toast(props) {
28318
29015
  o: undefined,
28319
29016
  i: undefined
28320
29017
  });
28321
- return _el$117;
29018
+ return _el$118;
28322
29019
  })()
28323
29020
  });
28324
29021
  }
28325
29022
  function Home(props) {
28326
29023
  return (() => {
28327
- var _el$119 = _$createElement2("box"), _el$120 = _$createElement2("box"), _el$121 = _$createElement2("ascii_font"), _el$123 = _$createElement2("box"), _el$124 = _$createElement2("text"), _el$126 = _$createElement2("text"), _el$128 = _$createElement2("text"), _el$129 = _$createTextNode2(`Ask anything, or `), _el$131 = _$createTextNode2(` for commands`);
28328
- _$insertNode2(_el$119, _el$120);
28329
- _$insertNode2(_el$119, _el$123);
28330
- _$insertNode2(_el$119, _el$124);
28331
- _$insertNode2(_el$119, _el$126);
28332
- _$insertNode2(_el$119, _el$128);
28333
- _$setProp2(_el$119, "flexGrow", 1);
28334
- _$setProp2(_el$119, "flexDirection", "column");
28335
- _$setProp2(_el$119, "alignItems", "center");
28336
- _$setProp2(_el$119, "justifyContent", "center");
28337
- _$setProp2(_el$119, "minHeight", 0);
29024
+ var _el$120 = _$createElement2("box"), _el$121 = _$createElement2("box"), _el$122 = _$createElement2("ascii_font"), _el$124 = _$createElement2("box"), _el$125 = _$createElement2("text"), _el$127 = _$createElement2("text"), _el$129 = _$createElement2("text"), _el$130 = _$createTextNode2(`Ask anything, or `), _el$132 = _$createTextNode2(` for commands`);
28338
29025
  _$insertNode2(_el$120, _el$121);
28339
- _$setProp2(_el$120, "height", 7);
28340
- _$setProp2(_el$120, "minHeight", 7);
28341
- _$setProp2(_el$120, "flexShrink", 0);
28342
- _$setProp2(_el$121, "font", "block");
28343
- _$setProp2(_el$121, "backgroundColor", "transparent");
28344
- _$setProp2(_el$121, "selectable", false);
28345
- _$insert2(_el$119, _$createComponent2(Show2, {
29026
+ _$insertNode2(_el$120, _el$124);
29027
+ _$insertNode2(_el$120, _el$125);
29028
+ _$insertNode2(_el$120, _el$127);
29029
+ _$insertNode2(_el$120, _el$129);
29030
+ _$setProp2(_el$120, "flexGrow", 1);
29031
+ _$setProp2(_el$120, "flexDirection", "column");
29032
+ _$setProp2(_el$120, "alignItems", "center");
29033
+ _$setProp2(_el$120, "justifyContent", "center");
29034
+ _$setProp2(_el$120, "minHeight", 0);
29035
+ _$insertNode2(_el$121, _el$122);
29036
+ _$setProp2(_el$121, "height", 7);
29037
+ _$setProp2(_el$121, "minHeight", 7);
29038
+ _$setProp2(_el$121, "flexShrink", 0);
29039
+ _$setProp2(_el$122, "font", "block");
29040
+ _$setProp2(_el$122, "backgroundColor", "transparent");
29041
+ _$setProp2(_el$122, "selectable", false);
29042
+ _$insert2(_el$120, _$createComponent2(Show2, {
28346
29043
  get when() {
28347
29044
  return productSubline();
28348
29045
  },
28349
29046
  get fallback() {
28350
29047
  return (() => {
28351
- var _el$134 = _$createElement2("box");
28352
- _$setProp2(_el$134, "height", 0);
28353
- _$setProp2(_el$134, "flexShrink", 0);
28354
- return _el$134;
29048
+ var _el$135 = _$createElement2("box");
29049
+ _$setProp2(_el$135, "height", 0);
29050
+ _$setProp2(_el$135, "flexShrink", 0);
29051
+ return _el$135;
28355
29052
  })();
28356
29053
  },
28357
29054
  get children() {
28358
- var _el$122 = _$createElement2("text");
28359
- _$setProp2(_el$122, "wrapMode", "none");
28360
- _$setProp2(_el$122, "truncate", true);
28361
- _$insert2(_el$122, productSubline);
29055
+ var _el$123 = _$createElement2("text");
29056
+ _$setProp2(_el$123, "wrapMode", "none");
29057
+ _$setProp2(_el$123, "truncate", true);
29058
+ _$insert2(_el$123, productSubline);
28362
29059
  _$effect2((_p$) => {
28363
- var _v$80 = theme2.accent, _v$81 = TextAttributes2.BOLD;
28364
- _v$80 !== _p$.e && (_p$.e = _$setProp2(_el$122, "fg", _v$80, _p$.e));
28365
- _v$81 !== _p$.t && (_p$.t = _$setProp2(_el$122, "attributes", _v$81, _p$.t));
29060
+ var _v$82 = theme2.accent, _v$83 = TextAttributes2.BOLD;
29061
+ _v$82 !== _p$.e && (_p$.e = _$setProp2(_el$123, "fg", _v$82, _p$.e));
29062
+ _v$83 !== _p$.t && (_p$.t = _$setProp2(_el$123, "attributes", _v$83, _p$.t));
28366
29063
  return _p$;
28367
29064
  }, {
28368
29065
  e: undefined,
28369
29066
  t: undefined
28370
29067
  });
28371
- return _el$122;
28372
- }
28373
- }), _el$123);
28374
- _$setProp2(_el$123, "height", 1);
28375
- _$insertNode2(_el$124, _$createTextNode2(`Welcome.`));
28376
- _$setProp2(_el$124, "wrapMode", "none");
28377
- _$setProp2(_el$124, "truncate", true);
28378
- _$insertNode2(_el$126, _$createTextNode2(`One run, done well.`));
28379
- _$setProp2(_el$126, "wrapMode", "none");
28380
- _$setProp2(_el$126, "truncate", true);
28381
- _$insertNode2(_el$128, _el$129);
28382
- _$insertNode2(_el$128, _el$131);
28383
- _$setProp2(_el$128, "wrapMode", "none");
28384
- _$setProp2(_el$128, "truncate", true);
28385
- _$insert2(_el$128, _$createComponent2(Span, {
29068
+ return _el$123;
29069
+ }
29070
+ }), _el$124);
29071
+ _$setProp2(_el$124, "height", 1);
29072
+ _$insertNode2(_el$125, _$createTextNode2(`Welcome.`));
29073
+ _$setProp2(_el$125, "wrapMode", "none");
29074
+ _$setProp2(_el$125, "truncate", true);
29075
+ _$insertNode2(_el$127, _$createTextNode2(`One run, done well.`));
29076
+ _$setProp2(_el$127, "wrapMode", "none");
29077
+ _$setProp2(_el$127, "truncate", true);
29078
+ _$insertNode2(_el$129, _el$130);
29079
+ _$insertNode2(_el$129, _el$132);
29080
+ _$setProp2(_el$129, "wrapMode", "none");
29081
+ _$setProp2(_el$129, "truncate", true);
29082
+ _$insert2(_el$129, _$createComponent2(Span, {
28386
29083
  get fg() {
28387
29084
  return theme2.accent;
28388
29085
  },
28389
29086
  children: "/help"
28390
- }), _el$131);
28391
- _$insert2(_el$119, _$createComponent2(Show2, {
29087
+ }), _el$132);
29088
+ _$insert2(_el$120, _$createComponent2(Show2, {
28392
29089
  get when() {
28393
29090
  return props.view.model;
28394
29091
  },
28395
29092
  get fallback() {
28396
29093
  return (() => {
28397
- var _el$135 = _$createElement2("box");
28398
- _$setProp2(_el$135, "height", 0);
28399
- _$setProp2(_el$135, "flexShrink", 0);
28400
- return _el$135;
29094
+ var _el$136 = _$createElement2("box");
29095
+ _$setProp2(_el$136, "height", 0);
29096
+ _$setProp2(_el$136, "flexShrink", 0);
29097
+ return _el$136;
28401
29098
  })();
28402
29099
  },
28403
29100
  get children() {
28404
- var _el$132 = _$createElement2("text"), _el$133 = _$createTextNode2(` \xB7 `);
28405
- _$insertNode2(_el$132, _el$133);
28406
- _$setProp2(_el$132, "wrapMode", "none");
28407
- _$setProp2(_el$132, "truncate", true);
28408
- _$insert2(_el$132, () => props.view.model.name, _el$133);
28409
- _$insert2(_el$132, (() => {
29101
+ var _el$133 = _$createElement2("text"), _el$134 = _$createTextNode2(` \xB7 `);
29102
+ _$insertNode2(_el$133, _el$134);
29103
+ _$setProp2(_el$133, "wrapMode", "none");
29104
+ _$setProp2(_el$133, "truncate", true);
29105
+ _$insert2(_el$133, () => props.view.model.name, _el$134);
29106
+ _$insert2(_el$133, (() => {
28410
29107
  var _c$3 = _$memo2(() => props.view.thinking === "off");
28411
29108
  return () => _c$3() ? "thinking off" : `thinking ${props.view.thinking}`;
28412
29109
  })(), null);
28413
- _$effect2((_$p) => _$setProp2(_el$132, "fg", theme2.dim, _$p));
28414
- return _el$132;
29110
+ _$effect2((_$p) => _$setProp2(_el$133, "fg", theme2.dim, _$p));
29111
+ return _el$133;
28415
29112
  }
28416
29113
  }), null);
28417
29114
  _$effect2((_p$) => {
28418
- var _v$82 = productMark(), { primary: _v$83, text: _v$84 } = theme2, _v$85 = TextAttributes2.BOLD, { muted: _v$86, muted: _v$87 } = theme2;
28419
- _v$82 !== _p$.e && (_p$.e = _$setProp2(_el$121, "text", _v$82, _p$.e));
28420
- _v$83 !== _p$.t && (_p$.t = _$setProp2(_el$121, "color", _v$83, _p$.t));
28421
- _v$84 !== _p$.a && (_p$.a = _$setProp2(_el$124, "fg", _v$84, _p$.a));
28422
- _v$85 !== _p$.o && (_p$.o = _$setProp2(_el$124, "attributes", _v$85, _p$.o));
28423
- _v$86 !== _p$.i && (_p$.i = _$setProp2(_el$126, "fg", _v$86, _p$.i));
28424
- _v$87 !== _p$.n && (_p$.n = _$setProp2(_el$128, "fg", _v$87, _p$.n));
29115
+ var _v$84 = productMark(), { primary: _v$85, text: _v$86 } = theme2, _v$87 = TextAttributes2.BOLD, { muted: _v$88, muted: _v$89 } = theme2;
29116
+ _v$84 !== _p$.e && (_p$.e = _$setProp2(_el$122, "text", _v$84, _p$.e));
29117
+ _v$85 !== _p$.t && (_p$.t = _$setProp2(_el$122, "color", _v$85, _p$.t));
29118
+ _v$86 !== _p$.a && (_p$.a = _$setProp2(_el$125, "fg", _v$86, _p$.a));
29119
+ _v$87 !== _p$.o && (_p$.o = _$setProp2(_el$125, "attributes", _v$87, _p$.o));
29120
+ _v$88 !== _p$.i && (_p$.i = _$setProp2(_el$127, "fg", _v$88, _p$.i));
29121
+ _v$89 !== _p$.n && (_p$.n = _$setProp2(_el$129, "fg", _v$89, _p$.n));
28425
29122
  return _p$;
28426
29123
  }, {
28427
29124
  e: undefined,
@@ -28431,18 +29128,18 @@ function Home(props) {
28431
29128
  i: undefined,
28432
29129
  n: undefined
28433
29130
  });
28434
- return _el$119;
29131
+ return _el$120;
28435
29132
  })();
28436
29133
  }
28437
29134
  function PageDialog(props) {
28438
29135
  const rect = () => centeredRect(props.width, props.height, props.value().width, Math.min(props.value().lines.length, Math.max(1, props.height - 2)));
28439
29136
  return (() => {
28440
- var _el$136 = _$createElement2("box");
28441
- _$setProp2(_el$136, "position", "absolute");
28442
- _$setProp2(_el$136, "zIndex", 100);
28443
- _$setProp2(_el$136, "flexDirection", "column");
28444
- _$setProp2(_el$136, "overflow", "hidden");
28445
- _$insert2(_el$136, _$createComponent2(AnsiView, {
29137
+ var _el$137 = _$createElement2("box");
29138
+ _$setProp2(_el$137, "position", "absolute");
29139
+ _$setProp2(_el$137, "zIndex", 100);
29140
+ _$setProp2(_el$137, "flexDirection", "column");
29141
+ _$setProp2(_el$137, "overflow", "hidden");
29142
+ _$insert2(_el$137, _$createComponent2(AnsiView, {
28446
29143
  get lines() {
28447
29144
  return props.value().lines;
28448
29145
  },
@@ -28451,15 +29148,15 @@ function PageDialog(props) {
28451
29148
  }
28452
29149
  }));
28453
29150
  _$effect2((_p$) => {
28454
- var _v$88 = rect().top, _v$89 = rect().left, _v$90 = rect().width, _v$91 = rect().height, _v$92 = theme2.panel, { routeMouse: _v$93, routeMouse: _v$94, routeMouse: _v$95 } = props;
28455
- _v$88 !== _p$.e && (_p$.e = _$setProp2(_el$136, "top", _v$88, _p$.e));
28456
- _v$89 !== _p$.t && (_p$.t = _$setProp2(_el$136, "left", _v$89, _p$.t));
28457
- _v$90 !== _p$.a && (_p$.a = _$setProp2(_el$136, "width", _v$90, _p$.a));
28458
- _v$91 !== _p$.o && (_p$.o = _$setProp2(_el$136, "height", _v$91, _p$.o));
28459
- _v$92 !== _p$.i && (_p$.i = _$setProp2(_el$136, "backgroundColor", _v$92, _p$.i));
28460
- _v$93 !== _p$.n && (_p$.n = _$setProp2(_el$136, "onMouseMove", _v$93, _p$.n));
28461
- _v$94 !== _p$.s && (_p$.s = _$setProp2(_el$136, "onMouseUp", _v$94, _p$.s));
28462
- _v$95 !== _p$.h && (_p$.h = _$setProp2(_el$136, "onMouseScroll", _v$95, _p$.h));
29151
+ var _v$90 = rect().top, _v$91 = rect().left, _v$92 = rect().width, _v$93 = rect().height, _v$94 = theme2.panel, { routeMouse: _v$95, routeMouse: _v$96, routeMouse: _v$97 } = props;
29152
+ _v$90 !== _p$.e && (_p$.e = _$setProp2(_el$137, "top", _v$90, _p$.e));
29153
+ _v$91 !== _p$.t && (_p$.t = _$setProp2(_el$137, "left", _v$91, _p$.t));
29154
+ _v$92 !== _p$.a && (_p$.a = _$setProp2(_el$137, "width", _v$92, _p$.a));
29155
+ _v$93 !== _p$.o && (_p$.o = _$setProp2(_el$137, "height", _v$93, _p$.o));
29156
+ _v$94 !== _p$.i && (_p$.i = _$setProp2(_el$137, "backgroundColor", _v$94, _p$.i));
29157
+ _v$95 !== _p$.n && (_p$.n = _$setProp2(_el$137, "onMouseMove", _v$95, _p$.n));
29158
+ _v$96 !== _p$.s && (_p$.s = _$setProp2(_el$137, "onMouseUp", _v$96, _p$.s));
29159
+ _v$97 !== _p$.h && (_p$.h = _$setProp2(_el$137, "onMouseScroll", _v$97, _p$.h));
28463
29160
  return _p$;
28464
29161
  }, {
28465
29162
  e: undefined,
@@ -28471,7 +29168,7 @@ function PageDialog(props) {
28471
29168
  s: undefined,
28472
29169
  h: undefined
28473
29170
  });
28474
- return _el$136;
29171
+ return _el$137;
28475
29172
  })();
28476
29173
  }
28477
29174
  function OverlayView(props) {
@@ -28497,10 +29194,10 @@ function OverlayView(props) {
28497
29194
  },
28498
29195
  get fallback() {
28499
29196
  return (() => {
28500
- var _el$137 = _$createElement2("box");
28501
- _$setProp2(_el$137, "height", 0);
28502
- _$setProp2(_el$137, "flexShrink", 0);
28503
- return _el$137;
29197
+ var _el$138 = _$createElement2("box");
29198
+ _$setProp2(_el$138, "height", 0);
29199
+ _$setProp2(_el$138, "flexShrink", 0);
29200
+ return _el$138;
28504
29201
  })();
28505
29202
  },
28506
29203
  children: (value) => _$createComponent2(Show2, {
@@ -28514,18 +29211,18 @@ function OverlayView(props) {
28514
29211
  },
28515
29212
  get fallback() {
28516
29213
  return (() => {
28517
- var _el$140 = _$createElement2("box");
28518
- _$setProp2(_el$140, "position", "absolute");
28519
- _$setProp2(_el$140, "zIndex", 100);
28520
- _$setProp2(_el$140, "border", true);
28521
- _$setProp2(_el$140, "borderStyle", "rounded");
28522
- _$setProp2(_el$140, "padding", 1);
28523
- _$setProp2(_el$140, "flexDirection", "column");
28524
- _$setProp2(_el$140, "overflow", "hidden");
28525
- _$setProp2(_el$140, "onMouseMove", routeMouse);
28526
- _$setProp2(_el$140, "onMouseUp", routeMouse);
28527
- _$setProp2(_el$140, "onMouseScroll", routeMouse);
28528
- _$insert2(_el$140, _$createComponent2(AnsiView, {
29214
+ var _el$141 = _$createElement2("box");
29215
+ _$setProp2(_el$141, "position", "absolute");
29216
+ _$setProp2(_el$141, "zIndex", 100);
29217
+ _$setProp2(_el$141, "border", true);
29218
+ _$setProp2(_el$141, "borderStyle", "rounded");
29219
+ _$setProp2(_el$141, "padding", 1);
29220
+ _$setProp2(_el$141, "flexDirection", "column");
29221
+ _$setProp2(_el$141, "overflow", "hidden");
29222
+ _$setProp2(_el$141, "onMouseMove", routeMouse);
29223
+ _$setProp2(_el$141, "onMouseUp", routeMouse);
29224
+ _$setProp2(_el$141, "onMouseScroll", routeMouse);
29225
+ _$insert2(_el$141, _$createComponent2(AnsiView, {
28529
29226
  get lines() {
28530
29227
  return value().lines;
28531
29228
  },
@@ -28534,13 +29231,13 @@ function OverlayView(props) {
28534
29231
  }
28535
29232
  }));
28536
29233
  _$effect2((_p$) => {
28537
- var _v$96 = value().bounds.row, _v$97 = value().bounds.col, _v$98 = value().bounds.width, _v$99 = value().bounds.height, { panel: _v$100, borderFocus: _v$101 } = theme2;
28538
- _v$96 !== _p$.e && (_p$.e = _$setProp2(_el$140, "top", _v$96, _p$.e));
28539
- _v$97 !== _p$.t && (_p$.t = _$setProp2(_el$140, "left", _v$97, _p$.t));
28540
- _v$98 !== _p$.a && (_p$.a = _$setProp2(_el$140, "width", _v$98, _p$.a));
28541
- _v$99 !== _p$.o && (_p$.o = _$setProp2(_el$140, "height", _v$99, _p$.o));
28542
- _v$100 !== _p$.i && (_p$.i = _$setProp2(_el$140, "backgroundColor", _v$100, _p$.i));
28543
- _v$101 !== _p$.n && (_p$.n = _$setProp2(_el$140, "borderColor", _v$101, _p$.n));
29234
+ var _v$98 = value().bounds.row, _v$99 = value().bounds.col, _v$100 = value().bounds.width, _v$101 = value().bounds.height, { panel: _v$102, borderFocus: _v$103 } = theme2;
29235
+ _v$98 !== _p$.e && (_p$.e = _$setProp2(_el$141, "top", _v$98, _p$.e));
29236
+ _v$99 !== _p$.t && (_p$.t = _$setProp2(_el$141, "left", _v$99, _p$.t));
29237
+ _v$100 !== _p$.a && (_p$.a = _$setProp2(_el$141, "width", _v$100, _p$.a));
29238
+ _v$101 !== _p$.o && (_p$.o = _$setProp2(_el$141, "height", _v$101, _p$.o));
29239
+ _v$102 !== _p$.i && (_p$.i = _$setProp2(_el$141, "backgroundColor", _v$102, _p$.i));
29240
+ _v$103 !== _p$.n && (_p$.n = _$setProp2(_el$141, "borderColor", _v$103, _p$.n));
28544
29241
  return _p$;
28545
29242
  }, {
28546
29243
  e: undefined,
@@ -28550,22 +29247,22 @@ function OverlayView(props) {
28550
29247
  i: undefined,
28551
29248
  n: undefined
28552
29249
  });
28553
- return _el$140;
29250
+ return _el$141;
28554
29251
  })();
28555
29252
  },
28556
29253
  get children() {
28557
- var _el$139 = _$createElement2("box");
28558
- _$setProp2(_el$139, "position", "absolute");
28559
- _$setProp2(_el$139, "top", 0);
28560
- _$setProp2(_el$139, "left", 0);
28561
- _$setProp2(_el$139, "width", "100%");
28562
- _$setProp2(_el$139, "height", "100%");
28563
- _$setProp2(_el$139, "zIndex", 100);
28564
- _$setProp2(_el$139, "flexDirection", "column");
28565
- _$setProp2(_el$139, "onMouseMove", routeMouse);
28566
- _$setProp2(_el$139, "onMouseUp", routeMouse);
28567
- _$setProp2(_el$139, "onMouseScroll", routeMouse);
28568
- _$insert2(_el$139, _$createComponent2(AnsiView, {
29254
+ var _el$140 = _$createElement2("box");
29255
+ _$setProp2(_el$140, "position", "absolute");
29256
+ _$setProp2(_el$140, "top", 0);
29257
+ _$setProp2(_el$140, "left", 0);
29258
+ _$setProp2(_el$140, "width", "100%");
29259
+ _$setProp2(_el$140, "height", "100%");
29260
+ _$setProp2(_el$140, "zIndex", 100);
29261
+ _$setProp2(_el$140, "flexDirection", "column");
29262
+ _$setProp2(_el$140, "onMouseMove", routeMouse);
29263
+ _$setProp2(_el$140, "onMouseUp", routeMouse);
29264
+ _$setProp2(_el$140, "onMouseScroll", routeMouse);
29265
+ _$insert2(_el$140, _$createComponent2(AnsiView, {
28569
29266
  get lines() {
28570
29267
  return value().lines;
28571
29268
  },
@@ -28573,25 +29270,25 @@ function OverlayView(props) {
28573
29270
  return theme2.text;
28574
29271
  }
28575
29272
  }));
28576
- _$effect2((_$p) => _$setProp2(_el$139, "backgroundColor", theme2.background, _$p));
28577
- return _el$139;
29273
+ _$effect2((_$p) => _$setProp2(_el$140, "backgroundColor", theme2.background, _$p));
29274
+ return _el$140;
28578
29275
  }
28579
29276
  });
28580
29277
  },
28581
29278
  get children() {
28582
29279
  return [(() => {
28583
- var _el$138 = _$createElement2("box");
28584
- _$setProp2(_el$138, "position", "absolute");
28585
- _$setProp2(_el$138, "top", 0);
28586
- _$setProp2(_el$138, "left", 0);
28587
- _$setProp2(_el$138, "width", "100%");
28588
- _$setProp2(_el$138, "height", "100%");
28589
- _$setProp2(_el$138, "zIndex", 99);
28590
- _$setProp2(_el$138, "onMouseMove", routeMouse);
28591
- _$setProp2(_el$138, "onMouseUp", routeMouse);
28592
- _$setProp2(_el$138, "onMouseScroll", routeMouse);
28593
- _$effect2((_$p) => _$setProp2(_el$138, "backgroundColor", theme2.scrim, _$p));
28594
- return _el$138;
29280
+ var _el$139 = _$createElement2("box");
29281
+ _$setProp2(_el$139, "position", "absolute");
29282
+ _$setProp2(_el$139, "top", 0);
29283
+ _$setProp2(_el$139, "left", 0);
29284
+ _$setProp2(_el$139, "width", "100%");
29285
+ _$setProp2(_el$139, "height", "100%");
29286
+ _$setProp2(_el$139, "zIndex", 99);
29287
+ _$setProp2(_el$139, "onMouseMove", routeMouse);
29288
+ _$setProp2(_el$139, "onMouseUp", routeMouse);
29289
+ _$setProp2(_el$139, "onMouseScroll", routeMouse);
29290
+ _$effect2((_$p) => _$setProp2(_el$139, "backgroundColor", theme2.scrim, _$p));
29291
+ return _el$139;
28595
29292
  })(), _$createComponent2(PageDialog, {
28596
29293
  value,
28597
29294
  get width() {
@@ -28824,29 +29521,29 @@ function OpenTuiRoot(props) {
28824
29521
  }
28825
29522
  });
28826
29523
  return (() => {
28827
- var _el$141 = _$createElement2("box"), _el$142 = _$createElement2("box");
28828
- _$insertNode2(_el$141, _el$142);
28829
- _$setProp2(_el$141, "position", "relative");
28830
- _$setProp2(_el$141, "flexDirection", "column");
28831
- _$setProp2(_el$141, "width", "100%");
28832
- _$setProp2(_el$141, "height", "100%");
28833
- _$setProp2(_el$141, "backgroundColor", "transparent");
28834
- _$setProp2(_el$141, "onMouseMove", (event) => props.app.updateLinkHover(event.x, event.y));
28835
- _$setProp2(_el$141, "onMouseUp", handleRootMouseUp);
29524
+ var _el$142 = _$createElement2("box"), _el$143 = _$createElement2("box");
29525
+ _$insertNode2(_el$142, _el$143);
29526
+ _$setProp2(_el$142, "position", "relative");
28836
29527
  _$setProp2(_el$142, "flexDirection", "column");
28837
- _$setProp2(_el$142, "flexGrow", 1);
28838
- _$setProp2(_el$142, "minHeight", 0);
28839
- _$setProp2(_el$142, "paddingX", 1);
28840
- _$insert2(_el$142, _$createComponent2(Show2, {
29528
+ _$setProp2(_el$142, "width", "100%");
29529
+ _$setProp2(_el$142, "height", "100%");
29530
+ _$setProp2(_el$142, "backgroundColor", "transparent");
29531
+ _$setProp2(_el$142, "onMouseMove", (event) => props.app.updateLinkHover(event.x, event.y));
29532
+ _$setProp2(_el$142, "onMouseUp", handleRootMouseUp);
29533
+ _$setProp2(_el$143, "flexDirection", "column");
29534
+ _$setProp2(_el$143, "flexGrow", 1);
29535
+ _$setProp2(_el$143, "minHeight", 0);
29536
+ _$setProp2(_el$143, "paddingX", 1);
29537
+ _$insert2(_el$143, _$createComponent2(Show2, {
28841
29538
  get when() {
28842
29539
  return view().header;
28843
29540
  },
28844
29541
  get fallback() {
28845
29542
  return (() => {
28846
- var _el$145 = _$createElement2("box");
28847
- _$setProp2(_el$145, "height", 0);
28848
- _$setProp2(_el$145, "flexShrink", 0);
28849
- return _el$145;
29543
+ var _el$146 = _$createElement2("box");
29544
+ _$setProp2(_el$146, "height", 0);
29545
+ _$setProp2(_el$146, "flexShrink", 0);
29546
+ return _el$146;
28850
29547
  })();
28851
29548
  },
28852
29549
  children: (lines) => _$createComponent2(AnsiView, {
@@ -28858,22 +29555,22 @@ function OpenTuiRoot(props) {
28858
29555
  }
28859
29556
  })
28860
29557
  }), null);
28861
- _$insert2(_el$142, _$createComponent2(Show2, {
29558
+ _$insert2(_el$143, _$createComponent2(Show2, {
28862
29559
  get when() {
28863
29560
  return !view().home;
28864
29561
  },
28865
29562
  get fallback() {
28866
29563
  return (() => {
28867
- var _el$146 = _$createElement2("box");
28868
- _$setProp2(_el$146, "flexGrow", 1);
28869
- _$setProp2(_el$146, "minHeight", 0);
28870
- _$setProp2(_el$146, "flexDirection", "column");
28871
- _$insert2(_el$146, _$createComponent2(Home, {
29564
+ var _el$147 = _$createElement2("box");
29565
+ _$setProp2(_el$147, "flexGrow", 1);
29566
+ _$setProp2(_el$147, "minHeight", 0);
29567
+ _$setProp2(_el$147, "flexDirection", "column");
29568
+ _$insert2(_el$147, _$createComponent2(Home, {
28872
29569
  get view() {
28873
29570
  return view();
28874
29571
  }
28875
29572
  }), null);
28876
- _$insert2(_el$146, _$createComponent2(TranscriptItems, {
29573
+ _$insert2(_el$147, _$createComponent2(TranscriptItems, {
28877
29574
  get items() {
28878
29575
  return view().items;
28879
29576
  },
@@ -28888,38 +29585,38 @@ function OpenTuiRoot(props) {
28888
29585
  return view().slashCommandNames;
28889
29586
  }
28890
29587
  }), null);
28891
- return _el$146;
29588
+ return _el$147;
28892
29589
  })();
28893
29590
  },
28894
29591
  get children() {
28895
- var _el$143 = _$createElement2("box"), _el$144 = _$createElement2("scrollbox");
28896
- _$insertNode2(_el$143, _el$144);
28897
- _$setProp2(_el$143, "position", "relative");
28898
- _$setProp2(_el$143, "flexDirection", "column");
28899
- _$setProp2(_el$143, "flexGrow", 1);
28900
- _$setProp2(_el$143, "minHeight", 0);
28901
- _$use2((value) => {
28902
- scroll = value;
28903
- }, _el$144);
29592
+ var _el$144 = _$createElement2("box"), _el$145 = _$createElement2("scrollbox");
29593
+ _$insertNode2(_el$144, _el$145);
29594
+ _$setProp2(_el$144, "position", "relative");
29595
+ _$setProp2(_el$144, "flexDirection", "column");
28904
29596
  _$setProp2(_el$144, "flexGrow", 1);
28905
29597
  _$setProp2(_el$144, "minHeight", 0);
28906
- _$setProp2(_el$144, "stickyScroll", true);
28907
- _$setProp2(_el$144, "stickyStart", "bottom");
28908
- _$setProp2(_el$144, "scrollY", true);
28909
- _$setProp2(_el$144, "verticalScrollbarOptions", {
29598
+ _$use2((value) => {
29599
+ scroll = value;
29600
+ }, _el$145);
29601
+ _$setProp2(_el$145, "flexGrow", 1);
29602
+ _$setProp2(_el$145, "minHeight", 0);
29603
+ _$setProp2(_el$145, "stickyScroll", true);
29604
+ _$setProp2(_el$145, "stickyStart", "bottom");
29605
+ _$setProp2(_el$145, "scrollY", true);
29606
+ _$setProp2(_el$145, "verticalScrollbarOptions", {
28910
29607
  width: 1,
28911
29608
  trackOptions: {
28912
29609
  backgroundColor: "transparent",
28913
29610
  foregroundColor: "transparent"
28914
29611
  }
28915
29612
  });
28916
- _$setProp2(_el$144, "renderAfter", (buffer) => drawTranscriptScrollbar(buffer, scroll));
28917
- _$setProp2(_el$144, "backgroundColor", "transparent");
28918
- _$setProp2(_el$144, "paddingBottom", 1);
28919
- _$setProp2(_el$144, "onMouseScroll", scheduleTranscriptScrollState);
28920
- _$setProp2(_el$144, "onMouseDrag", scheduleTranscriptScrollState);
28921
- _$setProp2(_el$144, "onMouseUp", scheduleTranscriptScrollState);
28922
- _$insert2(_el$144, _$createComponent2(TranscriptItems, {
29613
+ _$setProp2(_el$145, "renderAfter", (buffer) => drawTranscriptScrollbar(buffer, scroll));
29614
+ _$setProp2(_el$145, "backgroundColor", "transparent");
29615
+ _$setProp2(_el$145, "paddingBottom", 1);
29616
+ _$setProp2(_el$145, "onMouseScroll", scheduleTranscriptScrollState);
29617
+ _$setProp2(_el$145, "onMouseDrag", scheduleTranscriptScrollState);
29618
+ _$setProp2(_el$145, "onMouseUp", scheduleTranscriptScrollState);
29619
+ _$insert2(_el$145, _$createComponent2(TranscriptItems, {
28923
29620
  get items() {
28924
29621
  return view().items;
28925
29622
  },
@@ -28934,7 +29631,7 @@ function OpenTuiRoot(props) {
28934
29631
  return view().slashCommandNames;
28935
29632
  }
28936
29633
  }));
28937
- _$insert2(_el$143, _$createComponent2(Show2, {
29634
+ _$insert2(_el$144, _$createComponent2(Show2, {
28938
29635
  get when() {
28939
29636
  return showJumpToLatest();
28940
29637
  },
@@ -28944,10 +29641,10 @@ function OpenTuiRoot(props) {
28944
29641
  });
28945
29642
  }
28946
29643
  }), null);
28947
- return _el$143;
29644
+ return _el$144;
28948
29645
  }
28949
29646
  }), null);
28950
- _$insert2(_el$142, _$createComponent2(PendingMessages, {
29647
+ _$insert2(_el$143, _$createComponent2(PendingMessages, {
28951
29648
  get messages() {
28952
29649
  return view().pendingMessages ?? [];
28953
29650
  },
@@ -28956,9 +29653,12 @@ function OpenTuiRoot(props) {
28956
29653
  },
28957
29654
  get height() {
28958
29655
  return dimensions().height;
29656
+ },
29657
+ get app() {
29658
+ return props.app;
28959
29659
  }
28960
29660
  }), null);
28961
- _$insert2(_el$142, _$createComponent2(WorkingLine, {
29661
+ _$insert2(_el$143, _$createComponent2(WorkingLine, {
28962
29662
  get view() {
28963
29663
  return view();
28964
29664
  },
@@ -28966,7 +29666,7 @@ function OpenTuiRoot(props) {
28966
29666
  return Math.max(0, dimensions().width - 4);
28967
29667
  }
28968
29668
  }), null);
28969
- _$insert2(_el$142, _$createComponent2(For2, {
29669
+ _$insert2(_el$143, _$createComponent2(For2, {
28970
29670
  get each() {
28971
29671
  return view().widgets.above;
28972
29672
  },
@@ -28977,29 +29677,29 @@ function OpenTuiRoot(props) {
28977
29677
  }
28978
29678
  })
28979
29679
  }), null);
28980
- _$insert2(_el$142, _$createComponent2(Show2, {
29680
+ _$insert2(_el$143, _$createComponent2(Show2, {
28981
29681
  get when() {
28982
29682
  return view().sideQuestionDock;
28983
29683
  },
28984
29684
  get fallback() {
28985
29685
  return (() => {
28986
- var _el$147 = _$createElement2("box");
28987
- _$setProp2(_el$147, "height", 0);
28988
- _$setProp2(_el$147, "flexShrink", 0);
28989
- return _el$147;
29686
+ var _el$148 = _$createElement2("box");
29687
+ _$setProp2(_el$148, "height", 0);
29688
+ _$setProp2(_el$148, "flexShrink", 0);
29689
+ return _el$148;
28990
29690
  })();
28991
29691
  },
28992
29692
  children: (lines) => (() => {
28993
- var _el$148 = _$createElement2("box");
28994
- _$setProp2(_el$148, "flexShrink", 0);
28995
- _$setProp2(_el$148, "onMouseScroll", (event) => {
29693
+ var _el$149 = _$createElement2("box");
29694
+ _$setProp2(_el$149, "flexShrink", 0);
29695
+ _$setProp2(_el$149, "onMouseScroll", (event) => {
28996
29696
  const direction = event.scroll?.direction;
28997
29697
  if (direction !== "up" && direction !== "down")
28998
29698
  return;
28999
29699
  if (props.app.scrollSideQuestion(direction))
29000
29700
  event.stopPropagation();
29001
29701
  });
29002
- _$insert2(_el$148, _$createComponent2(AnsiView, {
29702
+ _$insert2(_el$149, _$createComponent2(AnsiView, {
29003
29703
  get lines() {
29004
29704
  return lines();
29005
29705
  },
@@ -29007,19 +29707,19 @@ function OpenTuiRoot(props) {
29007
29707
  return theme2.text;
29008
29708
  }
29009
29709
  }));
29010
- return _el$148;
29710
+ return _el$149;
29011
29711
  })()
29012
29712
  }), null);
29013
- _$insert2(_el$142, _$createComponent2(Show2, {
29713
+ _$insert2(_el$143, _$createComponent2(Show2, {
29014
29714
  get when() {
29015
29715
  return view().planChoice;
29016
29716
  },
29017
29717
  get fallback() {
29018
29718
  return (() => {
29019
- var _el$149 = _$createElement2("box");
29020
- _$setProp2(_el$149, "height", 0);
29021
- _$setProp2(_el$149, "flexShrink", 0);
29022
- return _el$149;
29719
+ var _el$150 = _$createElement2("box");
29720
+ _$setProp2(_el$150, "height", 0);
29721
+ _$setProp2(_el$150, "flexShrink", 0);
29722
+ return _el$150;
29023
29723
  })();
29024
29724
  },
29025
29725
  children: (choice) => _$createComponent2(PlanChoiceBlock, {
@@ -29031,16 +29731,16 @@ function OpenTuiRoot(props) {
29031
29731
  }
29032
29732
  })
29033
29733
  }), null);
29034
- _$insert2(_el$142, _$createComponent2(Show2, {
29734
+ _$insert2(_el$143, _$createComponent2(Show2, {
29035
29735
  get when() {
29036
29736
  return view().fileCompletion;
29037
29737
  },
29038
29738
  get fallback() {
29039
29739
  return (() => {
29040
- var _el$150 = _$createElement2("box");
29041
- _$setProp2(_el$150, "height", 0);
29042
- _$setProp2(_el$150, "flexShrink", 0);
29043
- return _el$150;
29740
+ var _el$151 = _$createElement2("box");
29741
+ _$setProp2(_el$151, "height", 0);
29742
+ _$setProp2(_el$151, "flexShrink", 0);
29743
+ return _el$151;
29044
29744
  })();
29045
29745
  },
29046
29746
  children: (completion) => _$createComponent2(FileCompletionList, {
@@ -29052,16 +29752,16 @@ function OpenTuiRoot(props) {
29052
29752
  }
29053
29753
  })
29054
29754
  }), null);
29055
- _$insert2(_el$142, _$createComponent2(Show2, {
29755
+ _$insert2(_el$143, _$createComponent2(Show2, {
29056
29756
  get when() {
29057
29757
  return view().palette;
29058
29758
  },
29059
29759
  get fallback() {
29060
29760
  return (() => {
29061
- var _el$151 = _$createElement2("box");
29062
- _$setProp2(_el$151, "height", 0);
29063
- _$setProp2(_el$151, "flexShrink", 0);
29064
- return _el$151;
29761
+ var _el$152 = _$createElement2("box");
29762
+ _$setProp2(_el$152, "height", 0);
29763
+ _$setProp2(_el$152, "flexShrink", 0);
29764
+ return _el$152;
29065
29765
  })();
29066
29766
  },
29067
29767
  children: (palette) => _$createComponent2(Palette, {
@@ -29076,16 +29776,16 @@ function OpenTuiRoot(props) {
29076
29776
  }
29077
29777
  })
29078
29778
  }), null);
29079
- _$insert2(_el$142, _$createComponent2(Show2, {
29779
+ _$insert2(_el$143, _$createComponent2(Show2, {
29080
29780
  get when() {
29081
29781
  return view().questionDock;
29082
29782
  },
29083
29783
  get fallback() {
29084
29784
  return (() => {
29085
- var _el$152 = _$createElement2("box");
29086
- _$setProp2(_el$152, "height", 0);
29087
- _$setProp2(_el$152, "flexShrink", 0);
29088
- return _el$152;
29785
+ var _el$153 = _$createElement2("box");
29786
+ _$setProp2(_el$153, "height", 0);
29787
+ _$setProp2(_el$153, "flexShrink", 0);
29788
+ return _el$153;
29089
29789
  })();
29090
29790
  },
29091
29791
  children: (question) => _$createComponent2(QuestionDock, {
@@ -29097,16 +29797,16 @@ function OpenTuiRoot(props) {
29097
29797
  }
29098
29798
  })
29099
29799
  }), null);
29100
- _$insert2(_el$142, _$createComponent2(Show2, {
29800
+ _$insert2(_el$143, _$createComponent2(Show2, {
29101
29801
  get when() {
29102
29802
  return !view().questionDock;
29103
29803
  },
29104
29804
  get fallback() {
29105
29805
  return (() => {
29106
- var _el$153 = _$createElement2("box");
29107
- _$setProp2(_el$153, "height", 0);
29108
- _$setProp2(_el$153, "flexShrink", 0);
29109
- return _el$153;
29806
+ var _el$154 = _$createElement2("box");
29807
+ _$setProp2(_el$154, "height", 0);
29808
+ _$setProp2(_el$154, "flexShrink", 0);
29809
+ return _el$154;
29110
29810
  })();
29111
29811
  },
29112
29812
  get children() {
@@ -29124,16 +29824,16 @@ function OpenTuiRoot(props) {
29124
29824
  });
29125
29825
  }
29126
29826
  }), null);
29127
- _$insert2(_el$142, _$createComponent2(Show2, {
29827
+ _$insert2(_el$143, _$createComponent2(Show2, {
29128
29828
  get when() {
29129
29829
  return view().subagents;
29130
29830
  },
29131
29831
  get fallback() {
29132
29832
  return (() => {
29133
- var _el$154 = _$createElement2("box");
29134
- _$setProp2(_el$154, "height", 0);
29135
- _$setProp2(_el$154, "flexShrink", 0);
29136
- return _el$154;
29833
+ var _el$155 = _$createElement2("box");
29834
+ _$setProp2(_el$155, "height", 0);
29835
+ _$setProp2(_el$155, "flexShrink", 0);
29836
+ return _el$155;
29137
29837
  })();
29138
29838
  },
29139
29839
  children: (roster) => _$createComponent2(SubagentRoster, {
@@ -29142,7 +29842,7 @@ function OpenTuiRoot(props) {
29142
29842
  }
29143
29843
  })
29144
29844
  }), null);
29145
- _$insert2(_el$142, _$createComponent2(For2, {
29845
+ _$insert2(_el$143, _$createComponent2(For2, {
29146
29846
  get each() {
29147
29847
  return view().widgets.below;
29148
29848
  },
@@ -29153,7 +29853,7 @@ function OpenTuiRoot(props) {
29153
29853
  }
29154
29854
  })
29155
29855
  }), null);
29156
- _$insert2(_el$142, _$createComponent2(Footer, {
29856
+ _$insert2(_el$143, _$createComponent2(Footer, {
29157
29857
  get view() {
29158
29858
  return view();
29159
29859
  },
@@ -29161,7 +29861,7 @@ function OpenTuiRoot(props) {
29161
29861
  return dimensions().width;
29162
29862
  }
29163
29863
  }), null);
29164
- _$insert2(_el$141, _$createComponent2(OverlayView, {
29864
+ _$insert2(_el$142, _$createComponent2(OverlayView, {
29165
29865
  get app() {
29166
29866
  return props.app;
29167
29867
  },
@@ -29175,7 +29875,7 @@ function OpenTuiRoot(props) {
29175
29875
  return dimensions().height;
29176
29876
  }
29177
29877
  }), null);
29178
- _$insert2(_el$141, _$createComponent2(Toast, {
29878
+ _$insert2(_el$142, _$createComponent2(Toast, {
29179
29879
  get message() {
29180
29880
  return view().toast;
29181
29881
  },
@@ -29183,7 +29883,7 @@ function OpenTuiRoot(props) {
29183
29883
  return dimensions().width;
29184
29884
  }
29185
29885
  }), null);
29186
- return _el$141;
29886
+ return _el$142;
29187
29887
  })();
29188
29888
  }
29189
29889