@wrongstack/tui 1.0.13 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -10472,10 +10472,10 @@ var require_react_reconciler_development = __commonJS({
10472
10472
  fiber = fiber.next, id--;
10473
10473
  return fiber;
10474
10474
  }
10475
- function copyWithSetImpl(obj, path12, index, value) {
10476
- if (index >= path12.length) return value;
10477
- var key = path12[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
10478
- updated[key] = copyWithSetImpl(obj[key], path12, index + 1, value);
10475
+ function copyWithSetImpl(obj, path13, index, value) {
10476
+ if (index >= path13.length) return value;
10477
+ var key = path13[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
10478
+ updated[key] = copyWithSetImpl(obj[key], path13, index + 1, value);
10479
10479
  return updated;
10480
10480
  }
10481
10481
  function copyWithRename(obj, oldPath, newPath) {
@@ -10502,11 +10502,11 @@ var require_react_reconciler_development = __commonJS({
10502
10502
  );
10503
10503
  return updated;
10504
10504
  }
10505
- function copyWithDeleteImpl(obj, path12, index) {
10506
- var key = path12[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
10507
- if (index + 1 === path12.length)
10505
+ function copyWithDeleteImpl(obj, path13, index) {
10506
+ var key = path13[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
10507
+ if (index + 1 === path13.length)
10508
10508
  return isArrayImpl(updated) ? updated.splice(key, 1) : delete updated[key], updated;
10509
- updated[key] = copyWithDeleteImpl(obj[key], path12, index + 1);
10509
+ updated[key] = copyWithDeleteImpl(obj[key], path13, index + 1);
10510
10510
  return updated;
10511
10511
  }
10512
10512
  function shouldSuspendImpl() {
@@ -23783,29 +23783,29 @@ var require_react_reconciler_development = __commonJS({
23783
23783
  var didWarnAboutNestedUpdates = false;
23784
23784
  var didWarnAboutFindNodeInStrictMode = {};
23785
23785
  var overrideHookState = null, overrideHookStateDeletePath = null, overrideHookStateRenamePath = null, overrideProps = null, overridePropsDeletePath = null, overridePropsRenamePath = null, scheduleUpdate = null, scheduleRetry = null, setErrorHandler = null, setSuspenseHandler = null;
23786
- overrideHookState = function(fiber, id, path12, value) {
23786
+ overrideHookState = function(fiber, id, path13, value) {
23787
23787
  id = findHook(fiber, id);
23788
- null !== id && (path12 = copyWithSetImpl(id.memoizedState, path12, 0, value), id.memoizedState = path12, id.baseState = path12, fiber.memoizedProps = assign({}, fiber.memoizedProps), path12 = enqueueConcurrentRenderForLane(fiber, 2), null !== path12 && scheduleUpdateOnFiber(path12, fiber, 2));
23788
+ null !== id && (path13 = copyWithSetImpl(id.memoizedState, path13, 0, value), id.memoizedState = path13, id.baseState = path13, fiber.memoizedProps = assign({}, fiber.memoizedProps), path13 = enqueueConcurrentRenderForLane(fiber, 2), null !== path13 && scheduleUpdateOnFiber(path13, fiber, 2));
23789
23789
  };
23790
- overrideHookStateDeletePath = function(fiber, id, path12) {
23790
+ overrideHookStateDeletePath = function(fiber, id, path13) {
23791
23791
  id = findHook(fiber, id);
23792
- null !== id && (path12 = copyWithDeleteImpl(id.memoizedState, path12, 0), id.memoizedState = path12, id.baseState = path12, fiber.memoizedProps = assign({}, fiber.memoizedProps), path12 = enqueueConcurrentRenderForLane(fiber, 2), null !== path12 && scheduleUpdateOnFiber(path12, fiber, 2));
23792
+ null !== id && (path13 = copyWithDeleteImpl(id.memoizedState, path13, 0), id.memoizedState = path13, id.baseState = path13, fiber.memoizedProps = assign({}, fiber.memoizedProps), path13 = enqueueConcurrentRenderForLane(fiber, 2), null !== path13 && scheduleUpdateOnFiber(path13, fiber, 2));
23793
23793
  };
23794
23794
  overrideHookStateRenamePath = function(fiber, id, oldPath, newPath) {
23795
23795
  id = findHook(fiber, id);
23796
23796
  null !== id && (oldPath = copyWithRename(id.memoizedState, oldPath, newPath), id.memoizedState = oldPath, id.baseState = oldPath, fiber.memoizedProps = assign({}, fiber.memoizedProps), oldPath = enqueueConcurrentRenderForLane(fiber, 2), null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, 2));
23797
23797
  };
23798
- overrideProps = function(fiber, path12, value) {
23799
- fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path12, 0, value);
23798
+ overrideProps = function(fiber, path13, value) {
23799
+ fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path13, 0, value);
23800
23800
  fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
23801
- path12 = enqueueConcurrentRenderForLane(fiber, 2);
23802
- null !== path12 && scheduleUpdateOnFiber(path12, fiber, 2);
23801
+ path13 = enqueueConcurrentRenderForLane(fiber, 2);
23802
+ null !== path13 && scheduleUpdateOnFiber(path13, fiber, 2);
23803
23803
  };
23804
- overridePropsDeletePath = function(fiber, path12) {
23805
- fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path12, 0);
23804
+ overridePropsDeletePath = function(fiber, path13) {
23805
+ fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path13, 0);
23806
23806
  fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
23807
- path12 = enqueueConcurrentRenderForLane(fiber, 2);
23808
- null !== path12 && scheduleUpdateOnFiber(path12, fiber, 2);
23807
+ path13 = enqueueConcurrentRenderForLane(fiber, 2);
23808
+ null !== path13 && scheduleUpdateOnFiber(path13, fiber, 2);
23809
23809
  };
23810
23810
  overridePropsRenamePath = function(fiber, oldPath, newPath) {
23811
23811
  fiber.pendingProps = copyWithRename(
@@ -31818,8 +31818,8 @@ function Text({ color, backgroundColor, dimColor = false, bold = false, italic =
31818
31818
  }
31819
31819
 
31820
31820
  // ../../node_modules/.pnpm/ink@7.1.1_patch_hash=98833c_0fdd2846ba9ee0f07e76b94de69eda49/node_modules/ink/build/components/ErrorOverview.js
31821
- var cleanupPath = (path12) => {
31822
- return path12?.replace(`file://${cwd()}/`, "");
31821
+ var cleanupPath = (path13) => {
31822
+ return path13?.replace(`file://${cwd()}/`, "");
31823
31823
  };
31824
31824
  var stackUtils = new import_stack_utils.default({
31825
31825
  cwd: cwd(),
@@ -36223,6 +36223,9 @@ function useTerminalSize(options = {}) {
36223
36223
  }
36224
36224
 
36225
36225
  // src/ui-glyphs.ts
36226
+ import { readdirSync } from "node:fs";
36227
+ import * as os3 from "node:os";
36228
+ import * as path from "node:path";
36226
36229
  var UNICODE = Object.freeze({
36227
36230
  brand: "\u25C6",
36228
36231
  prompt: "\u276F",
@@ -36531,11 +36534,90 @@ var ASCII = Object.freeze({
36531
36534
  treeBranch: "|-",
36532
36535
  treeThrough: "| "
36533
36536
  });
36534
- function resolveIconStyle(env3 = process.env) {
36537
+ var NERD_FONT_FILE_RE = /nerd[-_ ]?font/i;
36538
+ var FONT_FILE_RE = /\.(?:otf|ttc|ttf)$/i;
36539
+ var MAX_FONT_SCAN_ENTRIES = 8192;
36540
+ var MAX_FONT_SCAN_DEPTH = 4;
36541
+ function isRemoteTerminal(env3) {
36542
+ return Boolean(env3["SSH_CONNECTION"] || env3["SSH_CLIENT"] || env3["SSH_TTY"]);
36543
+ }
36544
+ function fontDirectories(platform2, homeDir, env3) {
36545
+ const paths = platform2 === "win32" ? path.win32 : path.posix;
36546
+ if (platform2 === "win32") {
36547
+ return [
36548
+ env3["LOCALAPPDATA"] ? paths.join(env3["LOCALAPPDATA"], "Microsoft", "Windows", "Fonts") : "",
36549
+ paths.join(env3["SystemRoot"] || "C:\\Windows", "Fonts")
36550
+ ].filter(Boolean);
36551
+ }
36552
+ if (platform2 === "darwin") {
36553
+ return [paths.join(homeDir, "Library", "Fonts"), "/Library/Fonts", "/System/Library/Fonts"];
36554
+ }
36555
+ return [
36556
+ paths.join(homeDir, ".local", "share", "fonts"),
36557
+ paths.join(homeDir, ".fonts"),
36558
+ "/usr/local/share/fonts",
36559
+ "/usr/share/fonts",
36560
+ ...env3["WSL_DISTRO_NAME"] ? ["/mnt/c/Windows/Fonts"] : []
36561
+ ];
36562
+ }
36563
+ function readFontDirectory(directory) {
36564
+ return readdirSync(directory, { withFileTypes: true }).map((entry2) => ({
36565
+ name: entry2.name,
36566
+ isDirectory: entry2.isDirectory()
36567
+ }));
36568
+ }
36569
+ function hasInstalledNerdFont(options = {}) {
36570
+ const platform2 = options.platform ?? process.platform;
36571
+ const homeDir = options.homeDir ?? os3.homedir();
36572
+ const env3 = options.env ?? process.env;
36573
+ if (isRemoteTerminal(env3)) return false;
36574
+ const paths = platform2 === "win32" ? path.win32 : path.posix;
36575
+ const readDirectory = options.readDirectory ?? readFontDirectory;
36576
+ const pending = fontDirectories(platform2, homeDir, env3).map((directory) => ({
36577
+ directory,
36578
+ depth: 0
36579
+ }));
36580
+ const visited = /* @__PURE__ */ new Set();
36581
+ let scanned = 0;
36582
+ while (pending.length > 0 && scanned < MAX_FONT_SCAN_ENTRIES) {
36583
+ const current = pending.shift();
36584
+ if (!current || visited.has(current.directory)) continue;
36585
+ visited.add(current.directory);
36586
+ let entries;
36587
+ try {
36588
+ entries = readDirectory(current.directory);
36589
+ } catch {
36590
+ continue;
36591
+ }
36592
+ for (const entry2 of entries) {
36593
+ scanned += 1;
36594
+ if (scanned > MAX_FONT_SCAN_ENTRIES) return false;
36595
+ if (entry2.isDirectory) {
36596
+ if (current.depth < MAX_FONT_SCAN_DEPTH) {
36597
+ pending.push({
36598
+ directory: paths.join(current.directory, entry2.name),
36599
+ depth: current.depth + 1
36600
+ });
36601
+ }
36602
+ continue;
36603
+ }
36604
+ if (FONT_FILE_RE.test(entry2.name) && NERD_FONT_FILE_RE.test(entry2.name)) return true;
36605
+ }
36606
+ }
36607
+ return false;
36608
+ }
36609
+ var installedNerdFont;
36610
+ function detectInstalledNerdFont(env3) {
36611
+ if (env3 !== process.env) return hasInstalledNerdFont({ env: env3 });
36612
+ installedNerdFont ??= hasInstalledNerdFont({ env: env3 });
36613
+ return installedNerdFont;
36614
+ }
36615
+ function resolveIconStyle(env3 = process.env, detectNerdFont = detectInstalledNerdFont) {
36535
36616
  const raw = env3.WRONGSTACK_TUI_ICON_STYLE?.trim().toLowerCase();
36536
36617
  if (raw === "nerd" || raw === "nerd-font" || raw === "nerdfont") return "nerd";
36537
36618
  if (raw === "ascii" || raw === "plain") return "ascii";
36538
- return "unicode";
36619
+ if (raw) return "unicode";
36620
+ return detectNerdFont(env3) ? "nerd" : "unicode";
36539
36621
  }
36540
36622
  function glyphSet(style = resolveIconStyle()) {
36541
36623
  if (style === "nerd") return NERD;
@@ -37130,9 +37212,9 @@ function pickRandomTuiThinkingWord(previous) {
37130
37212
  function truncateChip(text, max) {
37131
37213
  return truncateDisplay(text, max);
37132
37214
  }
37133
- function shortenPath(path12, segments) {
37134
- const parts = path12.split(/[\\/]+/).filter(Boolean);
37135
- if (parts.length <= segments) return parts.join("/") || path12;
37215
+ function shortenPath(path13, segments) {
37216
+ const parts = path13.split(/[\\/]+/).filter(Boolean);
37217
+ if (parts.length <= segments) return parts.join("/") || path13;
37136
37218
  return `\u2026/${parts.slice(-Math.max(1, segments)).join("/")}`;
37137
37219
  }
37138
37220
  function tokenDisplayTotals(usage, currentRequest, estimatedInput) {
@@ -42006,7 +42088,7 @@ function PhasePanel({ phases, nowTick }) {
42006
42088
  // src/components/plan-panel.tsx
42007
42089
  var import_react51 = __toESM(require_react(), 1);
42008
42090
  import * as fs3 from "node:fs/promises";
42009
- import * as path from "node:path";
42091
+ import * as path2 from "node:path";
42010
42092
  import { resolveWstackPaths, sessionScopedPath } from "@wrongstack/core/utils";
42011
42093
 
42012
42094
  // src/components/status-bar.tsx
@@ -42240,7 +42322,9 @@ function visibleNodeText(node) {
42240
42322
  }
42241
42323
  return "";
42242
42324
  }
42243
- var RAIL_SEP_COST = 2;
42325
+ var RAIL_SEP_COST = 3;
42326
+ var RAIL_FIRST_CHROME_COST = 3;
42327
+ var RAIL_END_CAP_COST = 1;
42244
42328
  function markerWidth(dropped) {
42245
42329
  return dropped > 0 ? 2 + String(dropped).length : 0;
42246
42330
  }
@@ -42266,11 +42350,12 @@ function layoutRail(entries, budget, rightAnchor) {
42266
42350
  const leftWidth = () => {
42267
42351
  let total2 = 0;
42268
42352
  for (let i = 0; i < keep; i++) total2 += chips[i].widths[chips[i].level];
42269
- return total2 + Math.max(0, keep - 1) * RAIL_SEP_COST;
42353
+ if (keep === 0) return 0;
42354
+ return total2 + RAIL_FIRST_CHROME_COST + Math.max(0, keep - 1) * RAIL_SEP_COST + RAIL_END_CAP_COST;
42270
42355
  };
42271
42356
  const total = () => {
42272
42357
  const dropped = chips.length - keep;
42273
- const anchor = rightVisible ? (keep > 0 ? RAIL_SEP_COST : 0) + rightWidth : 0;
42358
+ const anchor = rightVisible ? rightWidth + RAIL_SEP_COST + (keep === 0 ? RAIL_END_CAP_COST : 0) : 0;
42274
42359
  return leftWidth() + anchor + markerWidth(dropped);
42275
42360
  };
42276
42361
  while (total() > budget) {
@@ -42297,19 +42382,19 @@ function layoutRail(entries, budget, rightAnchor) {
42297
42382
  let col = 0;
42298
42383
  for (let i = 0; i < keep; i++) {
42299
42384
  const chip = chips[i];
42300
- if (i > 0) col += RAIL_SEP_COST;
42385
+ const chrome = i === 0 ? RAIL_FIRST_CHROME_COST : RAIL_SEP_COST;
42301
42386
  items.push({
42302
42387
  id: chip.id,
42303
42388
  start: col,
42304
- len: chip.widths[chip.level],
42389
+ len: chrome + chip.widths[chip.level],
42305
42390
  level: chip.level,
42306
42391
  node: chip.nodes[chip.level]
42307
42392
  });
42308
- col += chip.widths[chip.level];
42393
+ col += chrome + chip.widths[chip.level];
42309
42394
  }
42310
42395
  const droppedIds = chips.slice(keep).map((chip) => chip.id);
42311
42396
  const used = total();
42312
- const gap = rightVisible ? Math.max(0, budget - used) : 0;
42397
+ const gap = 0;
42313
42398
  return { items, droppedIds, rightVisible, gap, used };
42314
42399
  }
42315
42400
  function toEntries(segments) {
@@ -42317,28 +42402,79 @@ function toEntries(segments) {
42317
42402
  (segment, index) => (0, import_react49.isValidElement)(segment) ? { id: `seg-${index}`, node: segment } : segment
42318
42403
  );
42319
42404
  }
42405
+ function segmentBackground(index) {
42406
+ const colors = [theme.accent, theme.brand, theme.success, theme.warn, theme.brandPrimary];
42407
+ return mixHexColors(colors[index % colors.length], theme.surfaceRaised, 0.48);
42408
+ }
42409
+ function RailCapsule({
42410
+ items,
42411
+ dropped = 0,
42412
+ droppedAfter = items.length - 1,
42413
+ monochrome
42414
+ }) {
42415
+ const painted = !monochrome && theme.supportsBackground;
42416
+ const backgrounds = items.map((_, index) => segmentBackground(index));
42417
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text2, { children: [
42418
+ items.map((item, index) => {
42419
+ const background = backgrounds[index];
42420
+ const previous = index > 0 ? backgrounds[index - 1] : void 0;
42421
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text2, { children: [
42422
+ index === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text2, { color: painted ? background : void 0, children: glyphs.segmentStart }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
42423
+ Text2,
42424
+ {
42425
+ color: painted ? previous : void 0,
42426
+ backgroundColor: painted ? background : void 0,
42427
+ children: glyphs.segmentTransition
42428
+ }
42429
+ ),
42430
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
42431
+ Text2,
42432
+ {
42433
+ color: painted ? theme.textPrimary : void 0,
42434
+ backgroundColor: painted ? background : void 0,
42435
+ children: [
42436
+ " ",
42437
+ visibleNodeText(item.node),
42438
+ " ",
42439
+ index === droppedAfter && dropped > 0 ? `+${dropped} ` : null
42440
+ ]
42441
+ }
42442
+ )
42443
+ ] }, item.id);
42444
+ }),
42445
+ items.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text2, { color: painted ? backgrounds.at(-1) : void 0, children: glyphs.segmentEnd }) : null
42446
+ ] });
42447
+ }
42320
42448
  function PowerlineRail({
42321
42449
  segments,
42322
42450
  budget,
42323
- rightAnchor
42451
+ rightAnchor,
42452
+ monochrome = false
42324
42453
  }) {
42325
42454
  if (segments.length === 0 && !rightAnchor) {
42326
42455
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text2, { children: " " });
42327
42456
  }
42328
42457
  const layout = layoutRail(toEntries(segments), budget, rightAnchor);
42329
42458
  const dropped = layout.droppedIds.length;
42330
- const content = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text2, { children: [
42331
- layout.items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text2, { children: [
42332
- index > 0 ? " " : null,
42333
- item.node
42334
- ] }, item.id)),
42335
- layout.rightVisible && rightAnchor ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text2, { children: [
42336
- layout.items.length > 0 ? " " : null,
42337
- layout.gap > 0 ? " ".repeat(layout.gap) : null,
42338
- rightAnchor
42339
- ] }) : null,
42340
- dropped > 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text2, { color: theme.textMuted, children: ` +${dropped}` }) : null
42341
- ] });
42459
+ const capsuleItems = [...layout.items];
42460
+ if (layout.rightVisible && rightAnchor) {
42461
+ capsuleItems.push({
42462
+ id: "right-anchor",
42463
+ start: 0,
42464
+ len: displayWidth(visibleNodeText(rightAnchor)) + RAIL_SEP_COST,
42465
+ level: 0,
42466
+ node: rightAnchor
42467
+ });
42468
+ }
42469
+ const content = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text2, { children: capsuleItems.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
42470
+ RailCapsule,
42471
+ {
42472
+ items: capsuleItems,
42473
+ dropped,
42474
+ droppedAfter: layout.items.length - 1,
42475
+ monochrome
42476
+ }
42477
+ ) : null });
42342
42478
  return content;
42343
42479
  }
42344
42480
 
@@ -43646,6 +43782,7 @@ function buildMemoryDetailEntries(p) {
43646
43782
  import {
43647
43783
  clampLine,
43648
43784
  DEFAULT_LINES,
43785
+ resolveStatuslineOrder,
43649
43786
  STATUSLINE_ITEMS
43650
43787
  } from "@wrongstack/core/statusline";
43651
43788
  var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
@@ -43666,7 +43803,7 @@ function assignedLine(key, fallback, lines) {
43666
43803
  if (override != null) return clampLine(override);
43667
43804
  return key != null ? DEFAULT_LINES[key] : fallback;
43668
43805
  }
43669
- function partitionRailEntries(sources, lines = {}) {
43806
+ function partitionRailEntries(sources, lines = {}, order = []) {
43670
43807
  const rails = [1, 2, 3, 4].map(() => ({ entries: [], rightAnchor: null }));
43671
43808
  for (const source of sources) {
43672
43809
  for (const entry2 of source.entries) {
@@ -43674,6 +43811,18 @@ function partitionRailEntries(sources, lines = {}) {
43674
43811
  rails[line - 1].entries.push(entry2);
43675
43812
  }
43676
43813
  }
43814
+ if (order.length > 0) {
43815
+ const ranks = new Map(resolveStatuslineOrder(order).map((item, index) => [item, index]));
43816
+ for (const rail of rails) {
43817
+ rail.entries.sort((a, b) => {
43818
+ const aKey = canonicalChipKey(a.id);
43819
+ const bKey = canonicalChipKey(b.id);
43820
+ const aRank = aKey ? ranks.get(aKey) ?? Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER;
43821
+ const bRank = bKey ? ranks.get(bKey) ?? Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER;
43822
+ return aRank - bRank;
43823
+ });
43824
+ }
43825
+ }
43677
43826
  return rails;
43678
43827
  }
43679
43828
  function placeAnchors(rails, anchors, lines) {
@@ -43690,31 +43839,38 @@ function placeAnchors(rails, anchors, lines) {
43690
43839
  }
43691
43840
  function buildDetailedRails(p, opts) {
43692
43841
  const lines = opts.lines ?? {};
43842
+ const order = opts.order ?? [];
43843
+ const workspaceEntries = buildWorkspaceChipEntries(
43844
+ p,
43845
+ opts.modelChip,
43846
+ opts.modelShortChip,
43847
+ opts.modelMicroChip
43848
+ );
43849
+ const vitalsEntries = buildVitalsChipEntries(p);
43850
+ if (order.length > 0) {
43851
+ if (opts.versionChip) workspaceEntries.push({ id: "version", node: opts.versionChip });
43852
+ if (opts.indexChip) vitalsEntries.push({ id: "index", node: opts.indexChip });
43853
+ }
43693
43854
  const rails = partitionRailEntries(
43694
43855
  [
43695
- {
43696
- entries: buildWorkspaceChipEntries(
43697
- p,
43698
- opts.modelChip,
43699
- opts.modelShortChip,
43700
- opts.modelMicroChip
43701
- ),
43702
- fallbackLine: 1
43703
- },
43704
- { entries: buildVitalsChipEntries(p), fallbackLine: 2 },
43856
+ { entries: workspaceEntries, fallbackLine: 1 },
43857
+ { entries: vitalsEntries, fallbackLine: 2 },
43705
43858
  { entries: buildSafetyWorkEntries(p), fallbackLine: 3 },
43706
43859
  { entries: buildAsyncChipEntries(p), fallbackLine: 4 }
43707
43860
  ],
43708
- lines
43709
- );
43710
- placeAnchors(
43711
- rails,
43712
- [
43713
- { key: "version", node: opts.versionChip },
43714
- { key: "index", node: opts.indexChip }
43715
- ],
43716
- lines
43861
+ lines,
43862
+ order
43717
43863
  );
43864
+ if (order.length === 0) {
43865
+ placeAnchors(
43866
+ rails,
43867
+ [
43868
+ { key: "version", node: opts.versionChip },
43869
+ { key: "index", node: opts.indexChip }
43870
+ ],
43871
+ lines
43872
+ );
43873
+ }
43718
43874
  return rails;
43719
43875
  }
43720
43876
 
@@ -43755,6 +43911,7 @@ function StatusBar({
43755
43911
  hiddenItems,
43756
43912
  statuslineLines,
43757
43913
  statuslineDensities,
43914
+ statuslineOrder,
43758
43915
  mode = "detailed",
43759
43916
  events,
43760
43917
  sessionId,
@@ -43960,6 +44117,7 @@ function StatusBar({
43960
44117
  const minimumChips = buildMinimumChips(buildParams);
43961
44118
  const detailedRails = buildDetailedRails(buildParams, {
43962
44119
  lines: statuslineLines,
44120
+ order: statuslineOrder,
43963
44121
  modelChip: modelStatusChip,
43964
44122
  modelShortChip,
43965
44123
  modelMicroChip,
@@ -44000,7 +44158,8 @@ function StatusBar({
44000
44158
  {
44001
44159
  segments: minimumChips,
44002
44160
  rightAnchor: versionStatusChip,
44003
- budget: railBudget
44161
+ budget: railBudget,
44162
+ monochrome: isNoColor
44004
44163
  }
44005
44164
  )
44006
44165
  },
@@ -44018,7 +44177,8 @@ function StatusBar({
44018
44177
  {
44019
44178
  segments: rail.entries,
44020
44179
  rightAnchor: rail.rightAnchor,
44021
- budget: railBudget
44180
+ budget: railBudget,
44181
+ monochrome: isNoColor
44022
44182
  },
44023
44183
  `rail-${logical}`
44024
44184
  ) : null
@@ -44043,12 +44203,12 @@ var STATUS_ICON = {
44043
44203
  function planFilePath(projectRoot, sessionId, scope) {
44044
44204
  const base = resolveWstackPaths({ projectRoot }).projectSessions;
44045
44205
  if (scope === "project") {
44046
- return path.join(base, "backlog.plan.json");
44206
+ return path2.join(base, "backlog.plan.json");
44047
44207
  }
44048
44208
  if (sessionId) {
44049
44209
  return sessionScopedPath(base, sessionId, ".plan.json");
44050
44210
  }
44051
- return path.join(base, "backlog.plan.json");
44211
+ return path2.join(base, "backlog.plan.json");
44052
44212
  }
44053
44213
  function usePlanPanelData(projectRoot, sessionId, enabled = true) {
44054
44214
  const [items, setItems] = (0, import_react51.useState)([]);
@@ -44936,6 +45096,7 @@ import {
44936
45096
  effectiveLine,
44937
45097
  LINE_SUBTITLES,
44938
45098
  LINE_TITLES,
45099
+ resolveStatuslineOrder as resolveStatuslineOrder2,
44939
45100
  STATUSLINE_DENSITY_CYCLE,
44940
45101
  STATUSLINE_FIELD_COUNT,
44941
45102
  STATUSLINE_ITEMS as STATUSLINE_ITEMS2
@@ -44959,10 +45120,8 @@ function matchesFilter(item, filter) {
44959
45120
  if (!needle) return true;
44960
45121
  return item.includes(needle) || CHIP_DESCRIPTIONS[item].toLowerCase().includes(needle);
44961
45122
  }
44962
- function navigableFields(filter) {
44963
- const fields = STATUSLINE_ITEMS2.map(
44964
- (item, index) => matchesFilter(item, filter) ? index : -1
44965
- ).filter((index) => index >= 0);
45123
+ function navigableFields(filter, order = []) {
45124
+ const fields = resolveStatuslineOrder2(order).map((item) => matchesFilter(item, filter) ? STATUSLINE_ITEMS2.indexOf(item) : -1).filter((index) => index >= 0);
44966
45125
  return fields.length > 0 ? fields : STATUSLINE_ITEMS2.map((_, index) => index);
44967
45126
  }
44968
45127
  function readRailFills(clickMap) {
@@ -44985,11 +45144,15 @@ var DENSITY_LABEL = {
44985
45144
  short: "short",
44986
45145
  micro: "micro"
44987
45146
  };
45147
+ function lineSelectorText(active) {
45148
+ return [1, 2, 3, 4].map((line) => line === active ? `[${line}]` : String(line)).join(" ");
45149
+ }
44988
45150
  function StatuslinePicker({
44989
45151
  field,
44990
45152
  hiddenItems,
44991
45153
  lines = {},
44992
45154
  densities = {},
45155
+ order = [],
44993
45156
  visibleChips = [],
44994
45157
  filter = "",
44995
45158
  filtering = false,
@@ -45003,8 +45166,9 @@ function StatuslinePicker({
45003
45166
  const totalFields = STATUSLINE_ITEMS2.length;
45004
45167
  const fills = readRailFills(clickMap);
45005
45168
  const focused = STATUSLINE_ITEMS2[field];
45006
- const enabledOn = (line) => STATUSLINE_ITEMS2.filter((item) => effectiveLine(item, lines) === line && !hiddenSet.has(item));
45007
- const visibleFields = navigableFields(filter);
45169
+ const resolvedOrder = resolveStatuslineOrder2(order);
45170
+ const enabledOn = (line) => resolvedOrder.filter((item) => effectiveLine(item, lines) === line && !hiddenSet.has(item));
45171
+ const visibleFields = navigableFields(filter, order);
45008
45172
  const fieldRank = Math.max(0, visibleFields.indexOf(field));
45009
45173
  const chipTone = (fill, item) => {
45010
45174
  if (!fill) return [theme.textMuted, ""];
@@ -45063,15 +45227,15 @@ function StatuslinePicker({
45063
45227
  }
45064
45228
  return theme.success;
45065
45229
  };
45066
- const descWidth = Math.max(10, size.contentWidth - 44);
45067
- const showDescriptions = size.columns >= 88;
45230
+ const descWidth = Math.max(10, size.contentWidth - 56);
45231
+ const showDescriptions = size.columns >= 140;
45068
45232
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
45069
45233
  MonitorShell,
45070
45234
  {
45071
45235
  accent: theme.warn,
45072
45236
  icon: glyphs.terminal,
45073
45237
  title: "STATUS LINE",
45074
- kicker: size.columns >= 82 ? "chips \xB7 lines \xB7 density" : void 0,
45238
+ kicker: size.columns >= 140 ? "chip \xB7 on/off \xB7 line 1-4 \xB7 order \xB7 density" : void 0,
45075
45239
  right: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text2, { color: theme.textMuted, children: [
45076
45240
  totalFields - hiddenItems.length,
45077
45241
  "/",
@@ -45083,6 +45247,7 @@ function StatuslinePicker({
45083
45247
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(KeyCap, { keyName: "\u2191\u2193", label: "select", color: theme.warn }),
45084
45248
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(KeyCap, { keyName: "\u2190\u2192", label: "on/off", color: theme.accent }),
45085
45249
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(KeyCap, { keyName: "1-4", label: "line", color: theme.accent }),
45250
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(KeyCap, { keyName: "o/O", label: "order", color: theme.accent }),
45086
45251
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(KeyCap, { keyName: "d", label: "density", color: theme.accent })
45087
45252
  ] }),
45088
45253
  /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box2, { gap: 2, children: [
@@ -45091,7 +45256,7 @@ function StatuslinePicker({
45091
45256
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(KeyCap, { keyName: "r", label: "reset layout", color: theme.error }),
45092
45257
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(KeyCap, { keyName: "Esc", label: "close", color: theme.error })
45093
45258
  ] }),
45094
- size.columns >= 100 ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text2, { color: theme.textMuted, children: [
45259
+ size.columns >= 140 ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text2, { color: theme.textMuted, children: [
45095
45260
  " ",
45096
45261
  "\u2039 shortened \xAB micro \xB7 dropped \u2014 saved to the active profile/statusline.json"
45097
45262
  ] }) : null
@@ -45143,11 +45308,26 @@ function StatuslinePicker({
45143
45308
  const line = effectiveLine(item, lines);
45144
45309
  const moved = line !== DEFAULT_LINES2[item];
45145
45310
  const density = effectiveDensity2(item, densities);
45311
+ const lineItems = resolvedOrder.filter(
45312
+ (candidate) => effectiveLine(candidate, lines) === line
45313
+ );
45314
+ const orderIndex = lineItems.indexOf(item) + 1;
45146
45315
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box2, { children: [
45147
45316
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text2, { color: selected ? theme.warn : theme.textMuted, children: selected ? "\u203A " : " " }),
45148
45317
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text2, { color: selected ? theme.textPrimary : theme.textSecondary, bold: selected, children: item.padEnd(16) }),
45149
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text2, { color: stateColor(item), bold: true, children: stateOf(item).padEnd(5) }),
45150
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text2, { color: moved ? theme.warn : theme.textMuted, children: `L${line}${moved ? "*" : " "} ` }),
45318
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text2, { color: stateColor(item), bold: true, children: stateOf(item).padEnd(6) }),
45319
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
45320
+ Text2,
45321
+ {
45322
+ color: selected ? theme.accent : moved ? theme.warn : theme.textMuted,
45323
+ bold: selected,
45324
+ children: [
45325
+ lineSelectorText(line),
45326
+ " "
45327
+ ]
45328
+ }
45329
+ ),
45330
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text2, { color: selected ? theme.warn : theme.textMuted, children: `#${String(orderIndex).padStart(2, "0")} ` }),
45151
45331
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text2, { color: density === "auto" ? theme.textMuted : theme.brand, children: DENSITY_LABEL[density].padEnd(6) }),
45152
45332
  composerOwned.has(item) ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text2, { color: theme.textMuted, children: "in composer" }) : showDescriptions ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text2, { color: theme.textMuted, children: truncatePanelText(CHIP_DESCRIPTIONS[item], descWidth) }) : null
45153
45333
  ] }, `row-${item}`);
@@ -45646,6 +45826,7 @@ function AppStatusRegion({
45646
45826
  hiddenItems,
45647
45827
  lines,
45648
45828
  densities,
45829
+ order,
45649
45830
  sessionCount,
45650
45831
  memoryContextMonitor,
45651
45832
  memoryRecordTotal,
@@ -45719,6 +45900,7 @@ function AppStatusRegion({
45719
45900
  hiddenItems: mergeComposerOwnedChips(hiddenItems),
45720
45901
  statuslineLines: lines,
45721
45902
  statuslineDensities: densities,
45903
+ statuslineOrder: order,
45722
45904
  mode: liveStatuslineMode,
45723
45905
  visibleChips: state.statuslinePicker.visibleChips,
45724
45906
  events,
@@ -47906,8 +48088,8 @@ function detectLang(fenceInfo) {
47906
48088
  const tag = fenceInfo.trim().toLowerCase().split(/\s+/)[0] ?? "";
47907
48089
  return LANG_ALIASES[tag] ?? "plain";
47908
48090
  }
47909
- function langFromPath(path12) {
47910
- const m = /\.([A-Za-z0-9]+)$/.exec(path12.trim());
48091
+ function langFromPath(path13) {
48092
+ const m = /\.([A-Za-z0-9]+)$/.exec(path13.trim());
47911
48093
  const ext = m?.[1]?.toLowerCase() ?? "";
47912
48094
  return LANG_ALIASES[ext] ?? "plain";
47913
48095
  }
@@ -49406,9 +49588,9 @@ function formatToolArgs(toolName, input) {
49406
49588
  case "codebase-stats":
49407
49589
  return "index health";
49408
49590
  case "lsp_diagnostics": {
49409
- const path12 = stringOf(obj["path"]);
49591
+ const path13 = stringOf(obj["path"]);
49410
49592
  const severity = stringArrayOf(obj["severity"]) ?? stringArrayOf(obj["severities"]);
49411
- return [path12 ? shortenPath2(path12, 40) : "workspace", severity?.join("+")].filter(Boolean).join(" \xB7 ");
49593
+ return [path13 ? shortenPath2(path13, 40) : "workspace", severity?.join("+")].filter(Boolean).join(" \xB7 ");
49412
49594
  }
49413
49595
  case "lsp_definition":
49414
49596
  case "lsp_references":
@@ -49416,22 +49598,22 @@ function formatToolArgs(toolName, input) {
49416
49598
  case "lsp_completion":
49417
49599
  case "lsp_code_actions":
49418
49600
  case "lsp_rename": {
49419
- const path12 = stringOf(obj["path"]) ?? stringOf(obj["file"]);
49601
+ const path13 = stringOf(obj["path"]) ?? stringOf(obj["file"]);
49420
49602
  const line = numOf(obj["line"]);
49421
49603
  const character = numOf(obj["character"]);
49422
49604
  const position = line !== void 0 ? `L${line}:${character ?? 1}` : "";
49423
49605
  const rename = toolName === "lsp_rename" ? stringOf(obj["new_name"]) : void 0;
49424
- return [path12 ? shortenPath2(path12, 38) : "", position, rename ? `\u2192 ${rename}` : ""].filter(Boolean).join(" \xB7 ");
49606
+ return [path13 ? shortenPath2(path13, 38) : "", position, rename ? `\u2192 ${rename}` : ""].filter(Boolean).join(" \xB7 ");
49425
49607
  }
49426
49608
  case "lsp_symbols": {
49427
- const path12 = stringOf(obj["path"]) ?? stringOf(obj["file"]);
49428
- return path12 ? shortenPath2(path12, 40) : "";
49609
+ const path13 = stringOf(obj["path"]) ?? stringOf(obj["file"]);
49610
+ return path13 ? shortenPath2(path13, 40) : "";
49429
49611
  }
49430
49612
  case "lsp_execute_command":
49431
49613
  case "lsp_request": {
49432
- const path12 = stringOf(obj["path"]) ?? stringOf(obj["file"]);
49614
+ const path13 = stringOf(obj["path"]) ?? stringOf(obj["file"]);
49433
49615
  const operation = toolName === "lsp_request" ? stringOf(obj["method"]) : stringOf(obj["command"]);
49434
- return [operation, path12 ? shortenPath2(path12, 36) : ""].filter(Boolean).join(" \xB7 ");
49616
+ return [operation, path13 ? shortenPath2(path13, 36) : ""].filter(Boolean).join(" \xB7 ");
49435
49617
  }
49436
49618
  case "set_working_dir": {
49437
49619
  const p = stringOf(obj["path"]);
@@ -49878,19 +50060,19 @@ function visualEdit(toolName, text, ok) {
49878
50060
  const parsed = tryParseJson(text);
49879
50061
  if (parsed && typeof parsed === "object") {
49880
50062
  const obj = parsed;
49881
- const path12 = typeof obj["path"] === "string" ? obj["path"] : void 0;
50063
+ const path13 = typeof obj["path"] === "string" ? obj["path"] : void 0;
49882
50064
  const replacements = typeof obj["replacements"] === "number" ? obj["replacements"] : void 0;
49883
50065
  const bytes = typeof obj["bytes"] === "number" ? obj["bytes"] : void 0;
49884
50066
  const created = obj["created"] === true;
49885
50067
  const files = Array.isArray(obj["files"]) ? obj["files"] : void 0;
49886
50068
  const results = Array.isArray(obj["results"]) ? obj["results"] : void 0;
49887
- if (toolName === "edit" && path12 !== void 0) {
50069
+ if (toolName === "edit" && path13 !== void 0) {
49888
50070
  const repText = replacements !== void 0 ? `${replacements} replacement${replacements === 1 ? "" : "s"}` : void 0;
49889
- rows.push({ kind: "ok", text: "", marker: "edit ", path: path12 });
50071
+ rows.push({ kind: "ok", text: "", marker: "edit ", path: path13 });
49890
50072
  if (repText) rows.push({ kind: "meta", text: repText });
49891
- } else if (toolName === "write" && path12 !== void 0) {
50073
+ } else if (toolName === "write" && path13 !== void 0) {
49892
50074
  const sizeText = bytes !== void 0 ? `${bytes} bytes` : created ? "new file" : "updated";
49893
- rows.push({ kind: "ok", text: "", marker: "write ", path: path12 });
50075
+ rows.push({ kind: "ok", text: "", marker: "write ", path: path13 });
49894
50076
  rows.push({ kind: "meta", text: sizeText });
49895
50077
  } else if ((toolName === "diff" || toolName === "patch") && files && files.length > 0) {
49896
50078
  rows.push({
@@ -49913,8 +50095,8 @@ function visualEdit(toolName, text, ok) {
49913
50095
  marker: "replace ",
49914
50096
  text: `${results.length} replacement${results.length === 1 ? "" : "s"} across ${fileCount} file${fileCount === 1 ? "" : "s"}`
49915
50097
  });
49916
- } else if (path12 !== void 0) {
49917
- rows.push({ kind: "ok", text: "", marker: `${toolName} `, path: path12 });
50098
+ } else if (path13 !== void 0) {
50099
+ rows.push({ kind: "ok", text: "", marker: `${toolName} `, path: path13 });
49918
50100
  } else {
49919
50101
  return void 0;
49920
50102
  }
@@ -50013,13 +50195,13 @@ function parseMatchHit(hit) {
50013
50195
  }
50014
50196
  if (hit && typeof hit === "object") {
50015
50197
  const o = hit;
50016
- const path12 = stringOf(o["file"]) ?? stringOf(o["path"]) ?? stringOf(o["url"]) ?? stringOf(o["filename"]) ?? stringOf(o["Filename"]);
50198
+ const path13 = stringOf(o["file"]) ?? stringOf(o["path"]) ?? stringOf(o["url"]) ?? stringOf(o["filename"]) ?? stringOf(o["Filename"]);
50017
50199
  const lineNum = numOf(o["line"]) ?? numOf(o["lineNumber"]) ?? numOf(o["line_number"]) ?? numOf(o["LineNumber"]);
50018
50200
  const line = lineNum === void 0 ? void 0 : String(lineNum);
50019
50201
  const title = stringOf(o["title"]);
50020
50202
  const snippet2 = stringOf(o["snippet"]) ?? stringOf(o["lineContent"]) ?? stringOf(o["LineContent"]) ?? stringOf(o["line_content"]);
50021
50203
  const text = stringOf(o["text"]) ?? stringOf(o["match"]) ?? stringOf(o["preview"]) ?? snippet2 ?? title ?? [title, snippet2].filter(Boolean).join(" \u2014 ");
50022
- return { path: path12, line, text };
50204
+ return { path: path13, line, text };
50023
50205
  }
50024
50206
  return void 0;
50025
50207
  }
@@ -50137,8 +50319,8 @@ function splitReplaceDiffs(obj) {
50137
50319
  const record = result;
50138
50320
  const diff2 = stringOf(record["diff"]);
50139
50321
  if (!diff2?.trim()) continue;
50140
- const path12 = stringOf(record["path"]);
50141
- items.push(path12 ? { path: path12, diff: diff2 } : { diff: diff2 });
50322
+ const path13 = stringOf(record["path"]);
50323
+ items.push(path13 ? { path: path13, diff: diff2 } : { diff: diff2 });
50142
50324
  }
50143
50325
  return items;
50144
50326
  }
@@ -50213,8 +50395,8 @@ function collectMultiFileDiffItems(toolName, output, _input) {
50213
50395
  if (!diffText?.trim()) return void 0;
50214
50396
  const blocks = splitGitStyleDiff(diffText);
50215
50397
  if (blocks.length === 0) {
50216
- const path12 = explicitFiles[0] ?? extractPatchHeaderPath(diffText);
50217
- return [{ path: path12, diff: diffText }];
50398
+ const path13 = explicitFiles[0] ?? extractPatchHeaderPath(diffText);
50399
+ return [{ path: path13, diff: diffText }];
50218
50400
  }
50219
50401
  return blocks.map((block, idx) => ({
50220
50402
  path: explicitFiles[idx] ?? block.path,
@@ -50248,9 +50430,9 @@ function newFileDiffFromWriteInput(output, input) {
50248
50430
  const obj = input;
50249
50431
  const content = stringOf(obj["content"]);
50250
50432
  if (content === void 0) return void 0;
50251
- const path12 = stringOf(output["path"]) ?? stringOf(obj["path"]) ?? "new file";
50433
+ const path13 = stringOf(output["path"]) ?? stringOf(obj["path"]) ?? "new file";
50252
50434
  const lines = content === "" ? [] : content.replace(/\n$/, "").split("\n");
50253
- const header = [`+++ ${path12}`, `@@ -0,0 +1,${lines.length} @@`];
50435
+ const header = [`+++ ${path13}`, `@@ -0,0 +1,${lines.length} @@`];
50254
50436
  return [...header, ...lines.map((line) => `+${line}`)].join("\n");
50255
50437
  }
50256
50438
  function splitGitStyleDiff(diff2) {
@@ -50290,8 +50472,8 @@ function splitGitStyleDiff(diff2) {
50290
50472
  }
50291
50473
  flush();
50292
50474
  if (blocks.length === 1 && !blocks[0].path) {
50293
- const path12 = extractPatchHeaderPath(blocks[0].diff);
50294
- if (path12) blocks[0] = { path: path12, diff: blocks[0].diff };
50475
+ const path13 = extractPatchHeaderPath(blocks[0].diff);
50476
+ if (path13) blocks[0] = { path: path13, diff: blocks[0].diff };
50295
50477
  }
50296
50478
  return blocks;
50297
50479
  }
@@ -50312,8 +50494,8 @@ function parseDiffGitPath(line) {
50312
50494
  function extractPatchHeaderPath(diffText) {
50313
50495
  for (const line of diffText.split("\n")) {
50314
50496
  if (line.startsWith("+++ ")) {
50315
- const path12 = line.slice(4).trim();
50316
- const cleaned = path12.replace(/^b\//, "").split(" ")[0].trim();
50497
+ const path13 = line.slice(4).trim();
50498
+ const cleaned = path13.replace(/^b\//, "").split(" ")[0].trim();
50317
50499
  return cleaned || void 0;
50318
50500
  }
50319
50501
  }
@@ -50431,14 +50613,14 @@ function formatMultiDiffSummary(summary, threshold = MULTI_DIFF_SUMMARY_THRESHOL
50431
50613
  return parts.join(" \xB7 ");
50432
50614
  }
50433
50615
  function DiffFileBlock({
50434
- path: path12,
50616
+ path: path13,
50435
50617
  preview,
50436
50618
  useColor = true,
50437
50619
  contentWidth
50438
50620
  }) {
50439
50621
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
50440
50622
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Box2, { flexDirection: "row", marginBottom: 0, children: [
50441
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text2, { bold: true, color: theme.accent, children: `\u25B8 ${path12}` }),
50623
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text2, { bold: true, color: theme.accent, children: `\u25B8 ${path13}` }),
50442
50624
  preview.added > 0 || preview.removed > 0 ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text2, { dimColor: true, children: ` (${preview.added > 0 ? `+${preview.added}` : ""}${preview.added > 0 && preview.removed > 0 ? " " : ""}${preview.removed > 0 ? `-${preview.removed}` : ""})` }) : null
50443
50625
  ] }),
50444
50626
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
@@ -50451,7 +50633,7 @@ function DiffFileBlock({
50451
50633
  hiddenAdded: preview.hiddenAdded,
50452
50634
  hiddenRemoved: preview.hiddenRemoved,
50453
50635
  useColor,
50454
- lang: langFromPath(path12),
50636
+ lang: langFromPath(path13),
50455
50637
  showStats: false,
50456
50638
  contentWidth
50457
50639
  }
@@ -50727,7 +50909,7 @@ function renderDiffLine(line) {
50727
50909
  "\n"
50728
50910
  ] }, line);
50729
50911
  }
50730
- function renderDiff(diff2, path12) {
50912
+ function renderDiff(diff2, path13) {
50731
50913
  const preview = parseUnifiedDiff(diff2, CONFIRM_DIFF_MAX_LINES);
50732
50914
  if (preview.rows.length > 0) {
50733
50915
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
@@ -50740,7 +50922,7 @@ function renderDiff(diff2, path12) {
50740
50922
  hiddenAdded: preview.hiddenAdded,
50741
50923
  hiddenRemoved: preview.hiddenRemoved,
50742
50924
  useColor: theme.supportsBackground,
50743
- lang: langFromPath(path12 ?? "")
50925
+ lang: langFromPath(path13 ?? "")
50744
50926
  }
50745
50927
  );
50746
50928
  }
@@ -51873,8 +52055,8 @@ function FilePicker({ query, matches, selected }) {
51873
52055
  ] }, m))
51874
52056
  ] });
51875
52057
  }
51876
- function highlight(path12, _query) {
51877
- return path12;
52058
+ function highlight(path13, _query) {
52059
+ return path13;
51878
52060
  }
51879
52061
 
51880
52062
  // src/components/help-panel.tsx
@@ -56031,6 +56213,7 @@ function AppViewPickers({
56031
56213
  hiddenItems: state.statuslinePicker.hiddenItems,
56032
56214
  lines: state.statuslinePicker.lines,
56033
56215
  densities: state.statuslinePicker.densities,
56216
+ order: state.statuslinePicker.order,
56034
56217
  visibleChips: state.statuslinePicker.visibleChips,
56035
56218
  filter: state.statuslinePicker.filter,
56036
56219
  filtering: state.statuslinePicker.filtering,
@@ -62095,16 +62278,16 @@ function ToolEntry({
62095
62278
  const verb = name === "diff" ? "Diff" : created ? "Write" : "Update";
62096
62279
  const outFiles = Array.isArray(outObj?.["files"]) ? outObj?.["files"] : void 0;
62097
62280
  const firstOutFile = outFiles && outFiles.length > 0 ? stringOf(outFiles[0]) : void 0;
62098
- const path12 = stringOf(inputObj?.["path"]) ?? stringOf(inputObj?.["TargetFile"]) ?? stringOf(inputObj?.["file"]) ?? stringOf(inputObj?.["files"]) ?? stringOf(inputObj?.["a"]) ?? stringOf(outObj?.["path"]) ?? firstOutFile;
62281
+ const path13 = stringOf(inputObj?.["path"]) ?? stringOf(inputObj?.["TargetFile"]) ?? stringOf(inputObj?.["file"]) ?? stringOf(inputObj?.["files"]) ?? stringOf(inputObj?.["a"]) ?? stringOf(outObj?.["path"]) ?? firstOutFile;
62099
62282
  const agg = multiDiffs2 ? summarizeMultiFileDiffs(multiDiffs2) : void 0;
62100
- const target = multiDiffs2 ? agg?.fileCount === 1 ? multiDiffs2[0].path : `${agg?.fileCount ?? multiDiffs2.length} files` : path12 ?? "changes";
62283
+ const target = multiDiffs2 ? agg?.fileCount === 1 ? multiDiffs2[0].path : `${agg?.fileCount ?? multiDiffs2.length} files` : path13 ?? "changes";
62101
62284
  return {
62102
62285
  verb,
62103
62286
  target,
62104
62287
  added: agg ? agg.added : diff3?.added ?? 0,
62105
62288
  removed: agg ? agg.removed : diff3?.removed ?? 0,
62106
62289
  lang: langFromPath(
62107
- multiDiffs2 && multiDiffs2.length > 1 ? "" : multiDiffs2?.[0]?.path ?? path12 ?? ""
62290
+ multiDiffs2 && multiDiffs2.length > 1 ? "" : multiDiffs2?.[0]?.path ?? path13 ?? ""
62108
62291
  )
62109
62292
  };
62110
62293
  })();
@@ -65025,7 +65208,7 @@ function visibleWindow(items, selected, limit) {
65025
65208
 
65026
65209
  // src/hooks/use-app-environment.ts
65027
65210
  var import_react100 = __toESM(require_react(), 1);
65028
- import path3 from "node:path";
65211
+ import path4 from "node:path";
65029
65212
 
65030
65213
  // src/hooks/use-autonomy-drivers.ts
65031
65214
  var import_react86 = __toESM(require_react(), 1);
@@ -65675,10 +65858,13 @@ function useStatuslineLayoutSync({
65675
65858
  layoutSeeded,
65676
65859
  pickerLines,
65677
65860
  pickerDensities,
65861
+ pickerOrder,
65678
65862
  lines,
65679
65863
  densities,
65864
+ order,
65680
65865
  setLines,
65681
- setDensities
65866
+ setDensities,
65867
+ setOrder
65682
65868
  }) {
65683
65869
  (0, import_react93.useEffect)(() => {
65684
65870
  if (!pickerOpen || !layoutSeeded) return;
@@ -65688,6 +65874,12 @@ function useStatuslineLayoutSync({
65688
65874
  if (!pickerOpen || !layoutSeeded) return;
65689
65875
  if (statuslineLayoutDiffers(densities, pickerDensities)) setDensities({ ...pickerDensities });
65690
65876
  }, [pickerOpen, layoutSeeded, pickerDensities, densities, setDensities]);
65877
+ (0, import_react93.useEffect)(() => {
65878
+ if (!pickerOpen || !layoutSeeded) return;
65879
+ if (pickerOrder.length !== order.length || pickerOrder.some((item, index) => item !== order[index])) {
65880
+ setOrder([...pickerOrder]);
65881
+ }
65882
+ }, [pickerOpen, layoutSeeded, pickerOrder, order, setOrder]);
65691
65883
  }
65692
65884
 
65693
65885
  // src/hooks/use-stream-chip-expiration.ts
@@ -65786,7 +65978,7 @@ function useThemeState({ configStore }) {
65786
65978
  // src/hooks/use-tui-activity.ts
65787
65979
  var import_react96 = __toESM(require_react(), 1);
65788
65980
  import * as fs4 from "node:fs/promises";
65789
- import * as os3 from "node:os";
65981
+ import * as os4 from "node:os";
65790
65982
  import { loadGoal } from "@wrongstack/core/storage";
65791
65983
  import { resolveWstackPaths as resolveWstackPaths3 } from "@wrongstack/core/utils";
65792
65984
 
@@ -65813,8 +66005,8 @@ function directorInFlight(ctx) {
65813
66005
  const directorCtx = ctx;
65814
66006
  return directorCtx.director?.coordinator?.inFlight ?? 0;
65815
66007
  }
65816
- var CPU_CORES = os3.cpus().length || 1;
65817
- var TOTAL_MEM = os3.totalmem() || 1;
66008
+ var CPU_CORES = os4.cpus().length || 1;
66009
+ var TOTAL_MEM = os4.totalmem() || 1;
65818
66010
  var MAX_METRIC_HISTORY = 24;
65819
66011
  function pushMetricHistory(buffer, value) {
65820
66012
  buffer.push(value);
@@ -66055,6 +66247,7 @@ function useStatuslineState(opts) {
66055
66247
  );
66056
66248
  const [lines, setLines] = (0, import_react97.useState)(opts.statuslineLines ?? {});
66057
66249
  const [densities, setDensities] = (0, import_react97.useState)(opts.statuslineDensities ?? {});
66250
+ const [order, setOrder] = (0, import_react97.useState)(opts.statuslineOrder ?? []);
66058
66251
  const [sessionCount, setSessionCount] = (0, import_react97.useState)(0);
66059
66252
  return {
66060
66253
  liveModel,
@@ -66075,6 +66268,8 @@ function useStatuslineState(opts) {
66075
66268
  setLines,
66076
66269
  densities,
66077
66270
  setDensities,
66271
+ order,
66272
+ setOrder,
66078
66273
  sessionCount,
66079
66274
  setSessionCount
66080
66275
  };
@@ -66105,6 +66300,7 @@ function useTuiEnvironmentState({
66105
66300
  statuslineHiddenItems,
66106
66301
  statuslineLines,
66107
66302
  statuslineDensities,
66303
+ statuslineOrder,
66108
66304
  toolCount,
66109
66305
  getSettings,
66110
66306
  setStatuslineHiddenItems,
@@ -66112,7 +66308,9 @@ function useTuiEnvironmentState({
66112
66308
  setStatuslineLines,
66113
66309
  saveStatuslineLines,
66114
66310
  setStatuslineDensities,
66115
- saveStatuslineDensities
66311
+ saveStatuslineDensities,
66312
+ setStatuslineOrder,
66313
+ saveStatuslineOrder
66116
66314
  }) {
66117
66315
  const [memoryContextMonitor, setMemoryContextMonitor] = (0, import_react98.useState)(emptyMemoryContextMonitor);
66118
66316
  const [memoryRecordTotal, setMemoryRecordTotal] = (0, import_react98.useState)();
@@ -66147,7 +66345,8 @@ function useTuiEnvironmentState({
66147
66345
  modeLabel,
66148
66346
  statuslineHiddenItems,
66149
66347
  statuslineLines,
66150
- statuslineDensities
66348
+ statuslineDensities,
66349
+ statuslineOrder
66151
66350
  });
66152
66351
  const hiddenItemsRef = (0, import_react98.useRef)(statusline.hiddenItems);
66153
66352
  hiddenItemsRef.current = statusline.hiddenItems;
@@ -66218,6 +66417,17 @@ function useTuiEnvironmentState({
66218
66417
  logPersistFailure("statusline.persist_densities_failed")
66219
66418
  );
66220
66419
  }, [setStatuslineDensities, saveStatuslineDensities, statusline.densities]);
66420
+ const orderHydrated = (0, import_react98.useRef)(false);
66421
+ (0, import_react98.useEffect)(() => {
66422
+ if (!orderHydrated.current) {
66423
+ orderHydrated.current = true;
66424
+ return;
66425
+ }
66426
+ setStatuslineOrder?.(statusline.order);
66427
+ saveStatuslineOrder?.(statusline.order).catch?.(
66428
+ logPersistFailure("statusline.persist_order_failed")
66429
+ );
66430
+ }, [setStatuslineOrder, saveStatuslineOrder, statusline.order]);
66221
66431
  return {
66222
66432
  ...statusline,
66223
66433
  hiddenItemsRef,
@@ -66236,10 +66446,10 @@ function useTuiEnvironmentState({
66236
66446
 
66237
66447
  // src/hooks/use-working-dir-chip.ts
66238
66448
  var import_react99 = __toESM(require_react(), 1);
66239
- import * as path2 from "node:path";
66449
+ import * as path3 from "node:path";
66240
66450
  function formatWorkingDirChip(workingDir, projectRoot) {
66241
66451
  if (!workingDir || workingDir === projectRoot) return void 0;
66242
- const impl = workingDir.includes("\\") || projectRoot.includes("\\") ? path2.win32 : path2;
66452
+ const impl = workingDir.includes("\\") || projectRoot.includes("\\") ? path3.win32 : path3;
66243
66453
  const rel = impl.relative(projectRoot, workingDir) || ".";
66244
66454
  if (rel === ".") return void 0;
66245
66455
  return rel.replaceAll(impl.sep, "/");
@@ -66281,6 +66491,14 @@ function useAppEnvironment(deps) {
66281
66491
  setStatuslineHiddenItems,
66282
66492
  saveStatuslineHiddenItems,
66283
66493
  statuslineLines,
66494
+ setStatuslineLines,
66495
+ saveStatuslineLines,
66496
+ statuslineDensities,
66497
+ setStatuslineDensities,
66498
+ saveStatuslineDensities,
66499
+ statuslineOrder,
66500
+ setStatuslineOrder,
66501
+ saveStatuslineOrder,
66284
66502
  titleController,
66285
66503
  chime,
66286
66504
  confirmExit,
@@ -66316,7 +66534,15 @@ function useAppEnvironment(deps) {
66316
66534
  getSettings,
66317
66535
  setStatuslineHiddenItems,
66318
66536
  saveStatuslineHiddenItems,
66319
- statuslineLines
66537
+ statuslineLines,
66538
+ setStatuslineLines,
66539
+ saveStatuslineLines,
66540
+ statuslineDensities,
66541
+ setStatuslineDensities,
66542
+ saveStatuslineDensities,
66543
+ statuslineOrder,
66544
+ setStatuslineOrder,
66545
+ saveStatuslineOrder
66320
66546
  });
66321
66547
  const {
66322
66548
  liveModel,
@@ -66335,6 +66561,8 @@ function useAppEnvironment(deps) {
66335
66561
  setLines,
66336
66562
  densities,
66337
66563
  setDensities,
66564
+ order,
66565
+ setOrder,
66338
66566
  setSessionCount,
66339
66567
  hiddenItemsRef,
66340
66568
  setMemoryContextMonitor,
@@ -66346,10 +66574,12 @@ function useAppEnvironment(deps) {
66346
66574
  linesRef.current = lines;
66347
66575
  const densitiesRef = (0, import_react100.useRef)(densities);
66348
66576
  densitiesRef.current = densities;
66577
+ const orderRef = (0, import_react100.useRef)(order);
66578
+ orderRef.current = order;
66349
66579
  const projectRoot = agent.ctx.projectRoot;
66350
66580
  const projectName = import_react100.default.useMemo(() => {
66351
- const base = path3.basename(projectRoot);
66352
- return base && base !== path3.sep ? base : void 0;
66581
+ const base = path4.basename(projectRoot);
66582
+ return base && base !== path4.sep ? base : void 0;
66353
66583
  }, [projectRoot]);
66354
66584
  const workingDirChip = useWorkingDirChip(agent.ctx, projectRoot);
66355
66585
  const {
@@ -66393,10 +66623,13 @@ function useAppEnvironment(deps) {
66393
66623
  layoutSeeded: state.statuslinePicker.layoutSeeded,
66394
66624
  pickerLines: state.statuslinePicker.lines,
66395
66625
  pickerDensities: state.statuslinePicker.densities,
66626
+ pickerOrder: state.statuslinePicker.order,
66396
66627
  lines,
66397
66628
  densities,
66629
+ order,
66398
66630
  setLines,
66399
- setDensities
66631
+ setDensities,
66632
+ setOrder
66400
66633
  });
66401
66634
  useStreamChipExpiration({
66402
66635
  brainPrompt: state.brainPrompt,
@@ -66458,6 +66691,7 @@ function useAppEnvironment(deps) {
66458
66691
  refreshGoalSummary,
66459
66692
  linesRef,
66460
66693
  densitiesRef,
66694
+ orderRef,
66461
66695
  projectRoot,
66462
66696
  projectName,
66463
66697
  workingDirChip,
@@ -70277,6 +70511,10 @@ function tryToolsSettingsPickerKeys(host, input, key, isEnter, debouncedEnter2)
70277
70511
  dispatch({ type: "statuslineFieldMove", delta: key.mouse.wheel > 0 ? -1 : 1 });
70278
70512
  return true;
70279
70513
  }
70514
+ if (focused && key.shift && (key.upArrow || key.downArrow)) {
70515
+ dispatch({ type: "statuslineMoveOrder", item: focused, delta: key.upArrow ? -1 : 1 });
70516
+ return true;
70517
+ }
70280
70518
  if (key.upArrow) {
70281
70519
  dispatch({ type: "statuslineFieldMove", delta: -1 });
70282
70520
  return true;
@@ -70317,7 +70555,11 @@ function tryToolsSettingsPickerKeys(host, input, key, isEnter, debouncedEnter2)
70317
70555
  return true;
70318
70556
  }
70319
70557
  if (focused && (input === "[" || input === "]")) {
70320
- dispatch({ type: "statuslineMoveLine", item: focused, delta: input === "[" ? -1 : 1 });
70558
+ dispatch({ type: "statuslineMoveOrder", item: focused, delta: input === "[" ? -1 : 1 });
70559
+ return true;
70560
+ }
70561
+ if (focused && (input === "o" || input === "O")) {
70562
+ dispatch({ type: "statuslineMoveOrder", item: focused, delta: input === "O" ? -1 : 1 });
70321
70563
  return true;
70322
70564
  }
70323
70565
  if (focused && (input === "d" || input === "D")) {
@@ -71966,6 +72208,7 @@ function createInitialState(options) {
71966
72208
  visibleChips: [],
71967
72209
  lines: {},
71968
72210
  densities: {},
72211
+ order: [],
71969
72212
  filter: "",
71970
72213
  filtering: false,
71971
72214
  layoutSeeded: false,
@@ -74141,6 +74384,7 @@ import {
74141
74384
  effectiveDensity as effectiveDensity3,
74142
74385
  effectiveLine as effectiveLine3,
74143
74386
  LINE_TITLES as LINE_TITLES2,
74387
+ resolveStatuslineOrder as resolveStatuslineOrder3,
74144
74388
  STATUSLINE_ITEMS as STATUSLINE_ITEMS3
74145
74389
  } from "@wrongstack/core/statusline";
74146
74390
  var panelPickerActionTypes = [
@@ -74151,6 +74395,7 @@ var panelPickerActionTypes = [
74151
74395
  "statuslineToggle",
74152
74396
  "statuslineSetLine",
74153
74397
  "statuslineMoveLine",
74398
+ "statuslineMoveOrder",
74154
74399
  "statuslineSetDensity",
74155
74400
  "statuslineToggleLine",
74156
74401
  "statuslineResetLayout",
@@ -74222,9 +74467,10 @@ function reducePanelPickers(state, action) {
74222
74467
  visibleChips: state.statuslinePicker.visibleChips,
74223
74468
  lines: action.lines ?? state.statuslinePicker.lines,
74224
74469
  densities: action.densities ?? state.statuslinePicker.densities,
74470
+ order: action.order ?? state.statuslinePicker.order,
74225
74471
  filter: "",
74226
74472
  filtering: false,
74227
- layoutSeeded: action.lines != null || action.densities != null,
74473
+ layoutSeeded: action.lines != null || action.densities != null || action.order != null,
74228
74474
  hint: void 0
74229
74475
  }
74230
74476
  };
@@ -74234,7 +74480,7 @@ function reducePanelPickers(state, action) {
74234
74480
  statuslinePicker: { ...state.statuslinePicker, open: false, hint: void 0 }
74235
74481
  };
74236
74482
  case "statuslineFieldMove": {
74237
- const fields = navigableFields(state.statuslinePicker.filter);
74483
+ const fields = navigableFields(state.statuslinePicker.filter, state.statuslinePicker.order);
74238
74484
  const at = fields.indexOf(state.statuslinePicker.field);
74239
74485
  const from = at >= 0 ? at : 0;
74240
74486
  const next = fields[(from + action.delta + fields.length) % fields.length];
@@ -74288,6 +74534,28 @@ function reducePanelPickers(state, action) {
74288
74534
  }
74289
74535
  };
74290
74536
  }
74537
+ case "statuslineMoveOrder": {
74538
+ const cur = state.statuslinePicker;
74539
+ const resolved = resolveStatuslineOrder3(cur.order);
74540
+ const line = effectiveLine3(action.item, cur.lines);
74541
+ const siblings = resolved.filter((item) => effectiveLine3(item, cur.lines) === line);
74542
+ const at = siblings.indexOf(action.item);
74543
+ const target = Math.min(siblings.length - 1, Math.max(0, at + action.delta));
74544
+ if (at < 0 || target === at) return state;
74545
+ const other = siblings[target];
74546
+ const itemIndex = resolved.indexOf(action.item);
74547
+ const otherIndex = resolved.indexOf(other);
74548
+ [resolved[itemIndex], resolved[otherIndex]] = [resolved[otherIndex], resolved[itemIndex]];
74549
+ return {
74550
+ ...state,
74551
+ statuslinePicker: {
74552
+ ...cur,
74553
+ order: resolved,
74554
+ layoutSeeded: true,
74555
+ hint: `${action.item} \u2192 position ${target + 1} on line ${line}`
74556
+ }
74557
+ };
74558
+ }
74291
74559
  case "statuslineSetDensity": {
74292
74560
  const cur = state.statuslinePicker;
74293
74561
  const current = effectiveDensity3(action.item, cur.densities);
@@ -74332,8 +74600,9 @@ function reducePanelPickers(state, action) {
74332
74600
  ...state.statuslinePicker,
74333
74601
  lines: {},
74334
74602
  densities: {},
74603
+ order: [],
74335
74604
  layoutSeeded: true,
74336
- hint: "layout reset \u2014 default lines and densities restored"
74605
+ hint: "layout reset \u2014 default lines, order and densities restored"
74337
74606
  }
74338
74607
  };
74339
74608
  case "statuslineFilter": {
@@ -75570,7 +75839,7 @@ function reducer(state, action) {
75570
75839
  }
75571
75840
 
75572
75841
  // src/layout-store.ts
75573
- import * as path4 from "node:path";
75842
+ import * as path5 from "node:path";
75574
75843
  var LAYOUT_FILENAME = "tui-layout.json";
75575
75844
  var DEBOUNCE_MS = 500;
75576
75845
  var LayoutStore = class {
@@ -75718,7 +75987,7 @@ var LayoutStore = class {
75718
75987
  */
75719
75988
  async load() {
75720
75989
  if (this.ephemeral || !this.sessionDataDir) return 0;
75721
- const filePath = path4.join(this.sessionDataDir, LAYOUT_FILENAME);
75990
+ const filePath = path5.join(this.sessionDataDir, LAYOUT_FILENAME);
75722
75991
  let raw;
75723
75992
  try {
75724
75993
  raw = await import("node:fs/promises").then((fs8) => fs8.readFile(filePath, "utf8"));
@@ -75758,12 +76027,12 @@ var LayoutStore = class {
75758
76027
  version: LAYOUT_VERSION,
75759
76028
  entries: Object.fromEntries(this.layouts)
75760
76029
  };
75761
- const filePath = path4.join(this.sessionDataDir, LAYOUT_FILENAME);
76030
+ const filePath = path5.join(this.sessionDataDir, LAYOUT_FILENAME);
75762
76031
  try {
75763
76032
  const fs8 = await import("node:fs/promises");
75764
- const dir = path4.dirname(filePath);
76033
+ const dir = path5.dirname(filePath);
75765
76034
  await fs8.mkdir(dir, { recursive: true });
75766
- const tmp = path4.join(dir, `.${path4.basename(filePath)}.${Date.now().toString(36)}.tmp`);
76035
+ const tmp = path5.join(dir, `.${path5.basename(filePath)}.${Date.now().toString(36)}.tmp`);
75767
76036
  await fs8.writeFile(tmp, JSON.stringify(snapshot, null, 2), "utf8");
75768
76037
  await fs8.rename(tmp, filePath);
75769
76038
  } catch {
@@ -79862,12 +80131,12 @@ function useExitCommand({
79862
80131
  // src/hooks/use-file-search.ts
79863
80132
  var import_react119 = __toESM(require_react(), 1);
79864
80133
  import * as fs6 from "node:fs/promises";
79865
- import * as path6 from "node:path";
80134
+ import * as path7 from "node:path";
79866
80135
  import { toErrorMessage as toErrorMessage8 } from "@wrongstack/core/utils";
79867
80136
 
79868
80137
  // src/file-search.ts
79869
80138
  import * as fs5 from "node:fs/promises";
79870
- import * as path5 from "node:path";
80139
+ import * as path6 from "node:path";
79871
80140
  var IGNORED_DIRS = /* @__PURE__ */ new Set([
79872
80141
  "node_modules",
79873
80142
  ".git",
@@ -79898,7 +80167,7 @@ async function loadIndex(root) {
79898
80167
  async function walk(root, rel, depth, out) {
79899
80168
  if (out.length >= MAX_FILES_INDEXED) return;
79900
80169
  if (depth > MAX_DEPTH) return;
79901
- const dir = rel ? path5.join(root, rel) : root;
80170
+ const dir = rel ? path6.join(root, rel) : root;
79902
80171
  let entries;
79903
80172
  try {
79904
80173
  entries = await fs5.readdir(dir, { withFileTypes: true });
@@ -80010,7 +80279,7 @@ function useFileSearch(options) {
80010
80279
  dispatch({ type: "pickerClose" });
80011
80280
  return;
80012
80281
  }
80013
- const absPath = path6.isAbsolute(picked) ? picked : path6.join(projectRoot, picked);
80282
+ const absPath = path7.isAbsolute(picked) ? picked : path7.join(projectRoot, picked);
80014
80283
  try {
80015
80284
  const stat4 = await fs6.stat(absPath);
80016
80285
  let data;
@@ -80073,11 +80342,11 @@ function useHelpPanel(dispatch, slashRegistry) {
80073
80342
  // src/hooks/use-history-archive.ts
80074
80343
  var import_react121 = __toESM(require_react(), 1);
80075
80344
  import * as fsp2 from "node:fs/promises";
80076
- import * as path8 from "node:path";
80345
+ import * as path9 from "node:path";
80077
80346
 
80078
80347
  // src/history-archive.ts
80079
80348
  import * as fsp from "node:fs/promises";
80080
- import * as path7 from "node:path";
80349
+ import * as path8 from "node:path";
80081
80350
  var ARCHIVE_PAGE_SIZE = 100;
80082
80351
  function isBlankLine(line) {
80083
80352
  let sawHighByte = false;
@@ -80105,7 +80374,7 @@ var HistoryArchive = class {
80105
80374
  /** In-flight `fsp.open`, so concurrent first-uses share one handle. */
80106
80375
  opening = null;
80107
80376
  constructor(sessionDir) {
80108
- this.filePath = path7.join(sessionDir, "history-archive.jsonl");
80377
+ this.filePath = path8.join(sessionDir, "history-archive.jsonl");
80109
80378
  }
80110
80379
  /**
80111
80380
  * Append an entry to the archive. Fire-and-forget: the write is queued
@@ -80176,7 +80445,7 @@ var HistoryArchive = class {
80176
80445
  const existing = this.handle;
80177
80446
  if (existing) return existing;
80178
80447
  this.opening ??= (async () => {
80179
- await fsp.mkdir(path7.dirname(this.filePath), { recursive: true });
80448
+ await fsp.mkdir(path8.dirname(this.filePath), { recursive: true });
80180
80449
  const handle = await fsp.open(this.filePath, "a+", 384);
80181
80450
  this.handle = handle;
80182
80451
  return handle;
@@ -80261,7 +80530,7 @@ var HistoryArchive = class {
80261
80530
  }
80262
80531
  };
80263
80532
  function historyArchivePath(sessionDir) {
80264
- return path7.join(sessionDir, "history-archive.jsonl");
80533
+ return path8.join(sessionDir, "history-archive.jsonl");
80265
80534
  }
80266
80535
 
80267
80536
  // src/hooks/use-history-archive.ts
@@ -80283,7 +80552,7 @@ function useHistoryArchive({
80283
80552
  if (!sessionsDir || !sessionId) return;
80284
80553
  let disposed = false;
80285
80554
  let created = null;
80286
- const directory = path8.join(sessionsDir, sessionId);
80555
+ const directory = path9.join(sessionsDir, sessionId);
80287
80556
  void (async () => {
80288
80557
  try {
80289
80558
  await fsp2.rm(historyArchivePath(directory), { force: true });
@@ -81797,7 +82066,7 @@ function usePasteHandling({
81797
82066
  // src/hooks/use-prompt-picker.ts
81798
82067
  var import_react134 = __toESM(require_react(), 1);
81799
82068
  import { createRequire } from "node:module";
81800
- import * as path9 from "node:path";
82069
+ import * as path10 from "node:path";
81801
82070
  import { DefaultPromptLoader } from "@wrongstack/core/execution";
81802
82071
  import { PromptUsageStore } from "@wrongstack/core/storage";
81803
82072
  import { resolveWstackPaths as resolveWstackPaths5 } from "@wrongstack/core/utils";
@@ -81828,8 +82097,8 @@ function usePromptPicker({ projectRoot, dispatch }) {
81828
82097
  let bundledDir;
81829
82098
  try {
81830
82099
  const req = createRequire(import.meta.url);
81831
- bundledDir = path9.join(
81832
- path9.dirname(req.resolve("@wrongstack/core/package.json")),
82100
+ bundledDir = path10.join(
82101
+ path10.dirname(req.resolve("@wrongstack/core/package.json")),
81833
82102
  "data",
81834
82103
  "prompts"
81835
82104
  );
@@ -85234,6 +85503,14 @@ function App2(props) {
85234
85503
  setStatuslineHiddenItems,
85235
85504
  saveStatuslineHiddenItems,
85236
85505
  statuslineLines,
85506
+ setStatuslineLines,
85507
+ saveStatuslineLines,
85508
+ statuslineDensities,
85509
+ setStatuslineDensities,
85510
+ saveStatuslineDensities,
85511
+ statuslineOrder,
85512
+ setStatuslineOrder,
85513
+ saveStatuslineOrder,
85237
85514
  agentsMonitorController,
85238
85515
  initialGoal,
85239
85516
  initialAsk,
@@ -85387,6 +85664,7 @@ function App2(props) {
85387
85664
  refreshGoalSummary,
85388
85665
  linesRef,
85389
85666
  densitiesRef,
85667
+ orderRef,
85390
85668
  projectName,
85391
85669
  workingDirChip,
85392
85670
  liveSettings,
@@ -85444,6 +85722,14 @@ function App2(props) {
85444
85722
  setStatuslineHiddenItems,
85445
85723
  saveStatuslineHiddenItems,
85446
85724
  statuslineLines,
85725
+ setStatuslineLines,
85726
+ saveStatuslineLines,
85727
+ statuslineDensities,
85728
+ setStatuslineDensities,
85729
+ saveStatuslineDensities,
85730
+ statuslineOrder,
85731
+ setStatuslineOrder,
85732
+ saveStatuslineOrder,
85447
85733
  titleController,
85448
85734
  getYolo: props.getYolo,
85449
85735
  getModeLabel,
@@ -85518,10 +85804,11 @@ function App2(props) {
85518
85804
  type: "statuslineOpen",
85519
85805
  hiddenItems: statuslineHiddenForPicker(),
85520
85806
  lines: linesRef.current,
85521
- densities: densitiesRef.current
85807
+ densities: densitiesRef.current,
85808
+ order: orderRef.current
85522
85809
  });
85523
85810
  },
85524
- [dispatch, statuslineHiddenForPicker, linesRef, densitiesRef]
85811
+ [dispatch, statuslineHiddenForPicker, linesRef, densitiesRef, orderRef]
85525
85812
  );
85526
85813
  const { handleRewindTo } = useSessionRewind({
85527
85814
  agent,
@@ -86023,7 +86310,7 @@ import { getProcessRegistry as getProcessRegistry10 } from "@wrongstack/tools";
86023
86310
 
86024
86311
  // src/run-tui-client-registration.ts
86025
86312
  import { randomUUID } from "node:crypto";
86026
- import * as path10 from "node:path";
86313
+ import * as path11 from "node:path";
86027
86314
  import { RemoteMailbox, resolveProjectDir } from "@wrongstack/core/coordination";
86028
86315
  import {
86029
86316
  createHqPublisherFromEnv,
@@ -86122,7 +86409,7 @@ function createRunTuiClientRegistration(opts) {
86122
86409
  await mailbox.registerClient({
86123
86410
  clientId,
86124
86411
  sessionId: opts.getSessionId?.() ?? opts.projectRoot,
86125
- name: `TUI [${path10.basename(opts.projectRoot)}]`,
86412
+ name: `TUI [${path11.basename(opts.projectRoot)}]`,
86126
86413
  source: "tui",
86127
86414
  pid: process.pid
86128
86415
  });
@@ -86140,7 +86427,7 @@ function createRunTuiClientRegistration(opts) {
86140
86427
  tuiHqPublisher = createHqPublisherFromEnv({
86141
86428
  clientKind: "tui",
86142
86429
  projectRoot: opts.projectRoot,
86143
- projectName: path10.basename(opts.projectRoot),
86430
+ projectName: path11.basename(opts.projectRoot),
86144
86431
  appConfig: opts.appConfig
86145
86432
  });
86146
86433
  tuiHqPublisher?.connect();
@@ -86153,7 +86440,7 @@ function createRunTuiClientRegistration(opts) {
86153
86440
  events: opts.events,
86154
86441
  sessionId: tuiSessionId,
86155
86442
  projectRoot: opts.projectRoot,
86156
- projectName: path10.basename(opts.projectRoot)
86443
+ projectName: path11.basename(opts.projectRoot)
86157
86444
  })
86158
86445
  );
86159
86446
  } catch {
@@ -86612,7 +86899,7 @@ function mountInkApp(deps) {
86612
86899
  }
86613
86900
 
86614
86901
  // src/run-tui-title-controller.ts
86615
- import * as path11 from "node:path";
86902
+ import * as path12 from "node:path";
86616
86903
 
86617
86904
  // src/terminal-title.ts
86618
86905
  var SPINNER = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
@@ -86695,7 +86982,7 @@ function createRunTuiTitleController(opts) {
86695
86982
  stdout: opts.stdout,
86696
86983
  events: opts.events,
86697
86984
  model: currentModel,
86698
- appName: opts.projectRoot ? path11.basename(opts.projectRoot) : void 0
86985
+ appName: opts.projectRoot ? path12.basename(opts.projectRoot) : void 0
86699
86986
  });
86700
86987
  };
86701
86988
  const stop = () => {
@@ -86860,6 +87147,15 @@ async function runTui(opts) {
86860
87147
  statuslineHiddenItems: opts.statuslineHiddenItems,
86861
87148
  setStatuslineHiddenItems: opts.setStatuslineHiddenItems,
86862
87149
  saveStatuslineHiddenItems: opts.saveStatuslineHiddenItems,
87150
+ statuslineLines: opts.statuslineLines,
87151
+ setStatuslineLines: opts.setStatuslineLines,
87152
+ saveStatuslineLines: opts.saveStatuslineLines,
87153
+ statuslineDensities: opts.statuslineDensities,
87154
+ setStatuslineDensities: opts.setStatuslineDensities,
87155
+ saveStatuslineDensities: opts.saveStatuslineDensities,
87156
+ statuslineOrder: opts.statuslineOrder,
87157
+ setStatuslineOrder: opts.setStatuslineOrder,
87158
+ saveStatuslineOrder: opts.saveStatuslineOrder,
86863
87159
  agentsMonitorController: opts.agentsMonitorController,
86864
87160
  initialGoal: opts.initialGoal,
86865
87161
  initialAsk: opts.initialAsk,