@neriros/ralphy 2.22.1 → 2.23.0

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 (3) hide show
  1. package/README.md +9 -1
  2. package/dist/cli/index.js +1095 -833
  3. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -35029,8 +35029,8 @@ import { readFileSync as readFileSync2 } from "fs";
35029
35029
  import { resolve } from "path";
35030
35030
  function getVersion() {
35031
35031
  try {
35032
- if ("2.22.1")
35033
- return "2.22.1";
35032
+ if ("2.23.0")
35033
+ return "2.23.0";
35034
35034
  } catch {}
35035
35035
  const dirsToTry = [];
35036
35036
  try {
@@ -35127,7 +35127,8 @@ async function parseArgs(argv) {
35127
35127
  codeReview: false,
35128
35128
  maxTickets: 0,
35129
35129
  projectRoot: undefined,
35130
- jsonOutput: false
35130
+ jsonOutput: false,
35131
+ debug: false
35131
35132
  };
35132
35133
  let expectModel = false;
35133
35134
  let expectModelFlag = false;
@@ -35333,6 +35334,9 @@ async function parseArgs(argv) {
35333
35334
  case "--project-root":
35334
35335
  expectProjectRoot = true;
35335
35336
  break;
35337
+ case "--debug":
35338
+ result2.debug = true;
35339
+ break;
35336
35340
  default:
35337
35341
  if (VALID_MODES.has(arg)) {
35338
35342
  result2.mode = arg;
@@ -35377,7 +35381,7 @@ var init_cli = __esm(() => {
35377
35381
  "",
35378
35382
  "Commands:",
35379
35383
  " task Run or resume a task",
35380
- " list List active changes",
35384
+ " list List active changes (with Linear tickets + PRs when configured)",
35381
35385
  " status Show detailed change status",
35382
35386
  " init Initialize OpenSpec in current directory",
35383
35387
  " agent Poll Linear for new tasks and run loops concurrently",
@@ -35423,6 +35427,10 @@ var init_cli = __esm(() => {
35423
35427
  " --max-tickets <n> Stop picking up new issues after N have been started (0 = unlimited)",
35424
35428
  " --json-output Emit JSONL to stdout instead of the Ink dashboard (for scripting/CI)",
35425
35429
  "",
35430
+ "",
35431
+ "List mode options:",
35432
+ " --debug --name <id> Explain why a Linear ticket was not picked up",
35433
+ "",
35426
35434
  " --help, -h Show this help message",
35427
35435
  "",
35428
35436
  "Examples:",
@@ -39479,99 +39487,6 @@ var init_types2 = __esm(() => {
39479
39487
  });
39480
39488
  });
39481
39489
 
39482
- // apps/cli/src/agent/worktree.ts
39483
- import { basename, join as join3 } from "path";
39484
- import { homedir } from "os";
39485
- import { exists } from "fs/promises";
39486
- function worktreesDir(projectRoot) {
39487
- return join3(homedir(), ".ralph", basename(projectRoot), "worktrees");
39488
- }
39489
- function branchForChange(changeName) {
39490
- return `ralph/${changeName}`;
39491
- }
39492
- async function createWorktree(projectRoot, changeName, runner) {
39493
- const dir = worktreesDir(projectRoot);
39494
- const cwd2 = join3(dir, changeName);
39495
- const branch = branchForChange(changeName);
39496
- const list = await runner.run(["worktree", "list", "--porcelain"], projectRoot);
39497
- if (list.stdout.includes(`worktree ${cwd2}
39498
- `)) {
39499
- return { cwd: cwd2, branch };
39500
- }
39501
- let branchExists = true;
39502
- try {
39503
- await runner.run(["rev-parse", "--verify", "--quiet", `refs/heads/${branch}`], projectRoot);
39504
- } catch {
39505
- branchExists = false;
39506
- }
39507
- const cmd = branchExists ? ["worktree", "add", cwd2, branch] : ["worktree", "add", "-b", branch, cwd2];
39508
- await runner.run(cmd, projectRoot);
39509
- return { cwd: cwd2, branch };
39510
- }
39511
- async function removeWorktree(projectRoot, cwd2, runner) {
39512
- await runner.run(["worktree", "remove", "--force", cwd2], projectRoot);
39513
- }
39514
- async function isWorktreeSafeToRemove(cwd2, base2, runner) {
39515
- const status = await runner.run(["status", "--porcelain"], cwd2);
39516
- const dirty = status.stdout.trim();
39517
- let unpushedCommits = "";
39518
- try {
39519
- const log2 = await runner.run(["log", "--oneline", `${base2}..HEAD`, "--no-merges"], cwd2);
39520
- unpushedCommits = log2.stdout.trim();
39521
- } catch {
39522
- unpushedCommits = "<unknown: failed to compare against base>";
39523
- }
39524
- if (dirty && unpushedCommits) {
39525
- return {
39526
- safe: false,
39527
- reason: "uncommitted changes AND unpushed commits present",
39528
- dirty,
39529
- unpushedCommits
39530
- };
39531
- }
39532
- if (dirty) {
39533
- return {
39534
- safe: false,
39535
- reason: "uncommitted or untracked files present",
39536
- dirty,
39537
- unpushedCommits
39538
- };
39539
- }
39540
- if (unpushedCommits) {
39541
- return {
39542
- safe: false,
39543
- reason: `commits ahead of ${base2} were not pushed/PR'd`,
39544
- dirty,
39545
- unpushedCommits
39546
- };
39547
- }
39548
- return { safe: true, dirty, unpushedCommits };
39549
- }
39550
- async function seedWorktreeMcpConfig(projectRoot, worktreeCwd) {
39551
- const dst = join3(worktreeCwd, ".mcp.json");
39552
- const src = join3(projectRoot, ".mcp.json");
39553
- const source = await exists(dst) ? dst : await exists(src) ? src : null;
39554
- if (!source)
39555
- return;
39556
- let parsed;
39557
- try {
39558
- parsed = await Bun.file(source).json();
39559
- } catch {
39560
- return;
39561
- }
39562
- const servers = parsed.mcpServers;
39563
- if (servers && typeof servers === "object") {
39564
- for (const cfg of Object.values(servers)) {
39565
- if (Array.isArray(cfg.args)) {
39566
- cfg.args = cfg.args.map((a) => typeof a === "string" && a.startsWith(".ralph/") ? join3(projectRoot, a) : a);
39567
- }
39568
- }
39569
- }
39570
- await Bun.write(dst, JSON.stringify(parsed, null, 2) + `
39571
- `);
39572
- }
39573
- var init_worktree = () => {};
39574
-
39575
39490
  // node_modules/.bun/react@18.3.1/node_modules/react/cjs/react-jsx-dev-runtime.development.js
39576
39491
  var require_react_jsx_dev_runtime_development = __commonJS((exports) => {
39577
39492
  var React10 = __toESM(require_react());
@@ -59437,8 +59352,8 @@ var init_node = __esm(() => {
59437
59352
  });
59438
59353
 
59439
59354
  // packages/telemetry/src/index.ts
59440
- import { homedir as homedir2 } from "os";
59441
- import { join as join7 } from "path";
59355
+ import { homedir } from "os";
59356
+ import { join as join5 } from "path";
59442
59357
  import { randomUUID } from "crypto";
59443
59358
  function setDefaultProperties(props) {
59444
59359
  defaultProps = { ...defaultProps, ...props };
@@ -59446,7 +59361,7 @@ function setDefaultProperties(props) {
59446
59361
  async function init() {
59447
59362
  if (!enabled)
59448
59363
  return;
59449
- const idPath = join7(homedir2(), ".ralph", ".telemetry-id");
59364
+ const idPath = join5(homedir(), ".ralph", ".telemetry-id");
59450
59365
  const idFile = Bun.file(idPath);
59451
59366
  if (await idFile.exists()) {
59452
59367
  distinctId = (await idFile.text()).trim();
@@ -59521,12 +59436,12 @@ ${fence}`;
59521
59436
  }
59522
59437
 
59523
59438
  // apps/cli/src/agent/config.ts
59524
- import { join as join11 } from "path";
59439
+ import { join as join9 } from "path";
59525
59440
  function stripJsonComments(text) {
59526
59441
  return text.replace(/\/\/[^\n]*/g, "");
59527
59442
  }
59528
59443
  async function loadRalphyConfig(projectRoot) {
59529
- const path = join11(projectRoot, "ralphy.config.json");
59444
+ const path = join9(projectRoot, "ralphy.config.json");
59530
59445
  const file = Bun.file(path);
59531
59446
  if (!await file.exists()) {
59532
59447
  return RalphyConfigSchema.parse({});
@@ -59554,7 +59469,7 @@ ${issues}
59554
59469
  return result2.data;
59555
59470
  }
59556
59471
  async function ensureRalphyConfig(projectRoot) {
59557
- const path = join11(projectRoot, "ralphy.config.json");
59472
+ const path = join9(projectRoot, "ralphy.config.json");
59558
59473
  const file = Bun.file(path);
59559
59474
  if (await file.exists())
59560
59475
  return path;
@@ -59812,8 +59727,8 @@ var init_config = __esm(() => {
59812
59727
 
59813
59728
  // packages/log/src/log.ts
59814
59729
  import { appendFile } from "fs/promises";
59815
- import { join as join12, dirname as dirname4 } from "path";
59816
- import { homedir as homedir3 } from "os";
59730
+ import { join as join10, dirname as dirname4 } from "path";
59731
+ import { homedir as homedir2 } from "os";
59817
59732
  import { mkdir as mkdir2 } from "fs/promises";
59818
59733
  function fmt(type, text) {
59819
59734
  return `[${new Date().toISOString()}] [${type}] ${text}
@@ -59858,25 +59773,25 @@ async function initWorkerLog(logFile) {
59858
59773
  var ANSI_RE, AGENT_LOG_PATH;
59859
59774
  var init_log = __esm(() => {
59860
59775
  ANSI_RE = /\x1b(?:\[[0-9;]*[A-Za-z]|\][^\x07\x1b]*(?:\x07|\x1b\\)|.)/g;
59861
- AGENT_LOG_PATH = join12(homedir3(), ".ralph", "agent-mode.log");
59776
+ AGENT_LOG_PATH = join10(homedir2(), ".ralph", "agent-mode.log");
59862
59777
  mkdir2(dirname4(AGENT_LOG_PATH), { recursive: true }).catch(() => {
59863
59778
  return;
59864
59779
  });
59865
59780
  });
59866
59781
 
59867
59782
  // packages/core/src/layout.ts
59868
- import { join as join13 } from "path";
59783
+ import { join as join11 } from "path";
59869
59784
  function projectLayout(root) {
59870
- const statesDir = join13(root, ".ralph", "tasks");
59871
- const tasksDir = join13(root, "openspec", "changes");
59785
+ const statesDir = join11(root, ".ralph", "tasks");
59786
+ const tasksDir = join11(root, "openspec", "changes");
59872
59787
  return {
59873
59788
  root,
59874
59789
  statesDir,
59875
59790
  tasksDir,
59876
- agentStateFile: join13(root, ".ralph", "agent-state.json"),
59877
- changeDir: (name) => join13(tasksDir, name),
59878
- taskStateDir: (name) => join13(statesDir, name),
59879
- stateFile: (name) => join13(statesDir, name, STATE_FILE2)
59791
+ agentStateFile: join11(root, ".ralph", "agent-state.json"),
59792
+ changeDir: (name) => join11(tasksDir, name),
59793
+ taskStateDir: (name) => join11(statesDir, name),
59794
+ stateFile: (name) => join11(statesDir, name, STATE_FILE2)
59880
59795
  };
59881
59796
  }
59882
59797
  var STATE_FILE2 = ".ralph-state.json";
@@ -59886,13 +59801,16 @@ var init_layout = () => {};
59886
59801
  function partition2(markers) {
59887
59802
  const statuses = [];
59888
59803
  const labels = [];
59804
+ const attachmentSubtitles = [];
59889
59805
  for (const m of markers) {
59890
59806
  if (m.type === "status")
59891
59807
  statuses.push(m.value);
59892
- else
59808
+ else if (m.type === "label")
59893
59809
  labels.push(m.value);
59810
+ else
59811
+ attachmentSubtitles.push(m.value);
59894
59812
  }
59895
- return { statuses, labels };
59813
+ return { statuses, labels, attachmentSubtitles };
59896
59814
  }
59897
59815
  function buildIssueFilter(spec) {
59898
59816
  const where = {};
@@ -59908,12 +59826,22 @@ function buildIssueFilter(spec) {
59908
59826
  }
59909
59827
  const inc = spec.include ?? [];
59910
59828
  if (inc.length > 0) {
59911
- const { statuses, labels } = partition2(inc);
59829
+ const { statuses, labels, attachmentSubtitles } = partition2(inc);
59912
59830
  const branches = [];
59913
59831
  if (statuses.length > 0)
59914
59832
  branches.push({ state: { name: { in: statuses } } });
59915
59833
  if (labels.length > 0)
59916
59834
  branches.push({ labels: { some: { name: { in: labels } } } });
59835
+ if (attachmentSubtitles.length > 0) {
59836
+ branches.push({
59837
+ attachments: {
59838
+ some: {
59839
+ title: { eq: RALPHY_ATTACHMENT_TITLE_FILTER },
59840
+ subtitle: { in: attachmentSubtitles }
59841
+ }
59842
+ }
59843
+ });
59844
+ }
59917
59845
  for (const b of branches)
59918
59846
  Object.assign(where, b);
59919
59847
  } else {
@@ -59921,7 +59849,23 @@ function buildIssueFilter(spec) {
59921
59849
  }
59922
59850
  const exc = spec.exclude ?? [];
59923
59851
  if (exc.length > 0) {
59924
- const { statuses, labels } = partition2(exc);
59852
+ const { statuses, labels, attachmentSubtitles: excludedSubtitles } = partition2(exc);
59853
+ if (excludedSubtitles.length > 0) {
59854
+ const existingAnd = where.and ?? [];
59855
+ where.and = [
59856
+ ...existingAnd,
59857
+ {
59858
+ attachments: {
59859
+ every: {
59860
+ or: [
59861
+ { title: { neq: RALPHY_ATTACHMENT_TITLE_FILTER } },
59862
+ { subtitle: { nin: excludedSubtitles } }
59863
+ ]
59864
+ }
59865
+ }
59866
+ }
59867
+ ];
59868
+ }
59925
59869
  if (statuses.length > 0) {
59926
59870
  const current = where.state;
59927
59871
  const noStatus = { state: { name: { nin: statuses } } };
@@ -60169,7 +60113,13 @@ function issueMatchesGetIndicator(issue, indicator) {
60169
60113
  return false;
60170
60114
  const labels = new Set(issue.labels.map((l) => l.toLowerCase()));
60171
60115
  const stateName = issue.state.name.toLowerCase();
60172
- return indicator.filter.some((m) => m.type === "label" ? labels.has(m.value.toLowerCase()) : stateName === m.value.toLowerCase());
60116
+ return indicator.filter.some((m) => {
60117
+ if (m.type === "label")
60118
+ return labels.has(m.value.toLowerCase());
60119
+ if (m.type === "status")
60120
+ return stateName === m.value.toLowerCase();
60121
+ return false;
60122
+ });
60173
60123
  }
60174
60124
  async function removeLabelFromIssue(apiKey, issueId, labelId) {
60175
60125
  const mutation = `mutation RemoveLabel($id: String!, $labelId: String!) {
@@ -60180,7 +60130,7 @@ async function removeLabelFromIssue(apiKey, issueId, labelId) {
60180
60130
  labelId
60181
60131
  });
60182
60132
  }
60183
- var LINEAR_API = "https://api.linear.app/graphql", RALPHY_ATTACHMENT_TITLE = "Ralphy", BRANCH_LABEL_PREFIX = "ralph:branch:";
60133
+ var LINEAR_API = "https://api.linear.app/graphql", RALPHY_ATTACHMENT_TITLE_FILTER = "Ralphy", RALPHY_ATTACHMENT_TITLE = "Ralphy", BRANCH_LABEL_PREFIX = "ralph:branch:";
60184
60134
 
60185
60135
  // apps/cli/src/agent/coordinator.ts
60186
60136
  class AgentCoordinator {
@@ -60632,7 +60582,7 @@ var init_coordinator = __esm(() => {
60632
60582
  });
60633
60583
 
60634
60584
  // apps/cli/src/agent/scaffold.ts
60635
- import { join as join14 } from "path";
60585
+ import { join as join12 } from "path";
60636
60586
  import { mkdir as mkdir3 } from "fs/promises";
60637
60587
  function changeNameForIssue(issue) {
60638
60588
  const slug = issue.title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40);
@@ -60640,10 +60590,10 @@ function changeNameForIssue(issue) {
60640
60590
  }
60641
60591
  async function scaffoldChangeForIssue(tasksDir, statesDir, issue, comments = [], appendPrompt = "") {
60642
60592
  const name = changeNameForIssue(issue);
60643
- const changeDir = join14(tasksDir, name);
60644
- const stateDir = join14(statesDir, name);
60593
+ const changeDir = join12(tasksDir, name);
60594
+ const stateDir = join12(statesDir, name);
60645
60595
  await mkdir3(changeDir, { recursive: true });
60646
- await mkdir3(join14(changeDir, "specs"), { recursive: true });
60596
+ await mkdir3(join12(changeDir, "specs"), { recursive: true });
60647
60597
  await mkdir3(stateDir, { recursive: true });
60648
60598
  const commentsBlock = comments.length > 0 ? [
60649
60599
  "",
@@ -60695,13 +60645,106 @@ async function scaffoldChangeForIssue(tasksDir, statesDir, issue, comments = [],
60695
60645
  ""
60696
60646
  ].join(`
60697
60647
  `);
60698
- await Bun.write(join14(changeDir, "proposal.md"), proposal);
60699
- await Bun.write(join14(changeDir, "tasks.md"), tasks);
60700
- await Bun.write(join14(changeDir, "design.md"), design);
60648
+ await Bun.write(join12(changeDir, "proposal.md"), proposal);
60649
+ await Bun.write(join12(changeDir, "tasks.md"), tasks);
60650
+ await Bun.write(join12(changeDir, "design.md"), design);
60701
60651
  return name;
60702
60652
  }
60703
60653
  var init_scaffold = () => {};
60704
60654
 
60655
+ // apps/cli/src/agent/worktree.ts
60656
+ import { basename, join as join13 } from "path";
60657
+ import { homedir as homedir3 } from "os";
60658
+ import { exists } from "fs/promises";
60659
+ function worktreesDir(projectRoot) {
60660
+ return join13(homedir3(), ".ralph", basename(projectRoot), "worktrees");
60661
+ }
60662
+ function branchForChange(changeName) {
60663
+ return `ralph/${changeName}`;
60664
+ }
60665
+ async function createWorktree(projectRoot, changeName, runner) {
60666
+ const dir = worktreesDir(projectRoot);
60667
+ const cwd2 = join13(dir, changeName);
60668
+ const branch = branchForChange(changeName);
60669
+ const list = await runner.run(["worktree", "list", "--porcelain"], projectRoot);
60670
+ if (list.stdout.includes(`worktree ${cwd2}
60671
+ `)) {
60672
+ return { cwd: cwd2, branch };
60673
+ }
60674
+ let branchExists = true;
60675
+ try {
60676
+ await runner.run(["rev-parse", "--verify", "--quiet", `refs/heads/${branch}`], projectRoot);
60677
+ } catch {
60678
+ branchExists = false;
60679
+ }
60680
+ const cmd = branchExists ? ["worktree", "add", cwd2, branch] : ["worktree", "add", "-b", branch, cwd2];
60681
+ await runner.run(cmd, projectRoot);
60682
+ return { cwd: cwd2, branch };
60683
+ }
60684
+ async function removeWorktree(projectRoot, cwd2, runner) {
60685
+ await runner.run(["worktree", "remove", "--force", cwd2], projectRoot);
60686
+ }
60687
+ async function isWorktreeSafeToRemove(cwd2, base2, runner) {
60688
+ const status = await runner.run(["status", "--porcelain"], cwd2);
60689
+ const dirty = status.stdout.trim();
60690
+ let unpushedCommits = "";
60691
+ try {
60692
+ const log2 = await runner.run(["log", "--oneline", `${base2}..HEAD`, "--no-merges"], cwd2);
60693
+ unpushedCommits = log2.stdout.trim();
60694
+ } catch {
60695
+ unpushedCommits = "<unknown: failed to compare against base>";
60696
+ }
60697
+ if (dirty && unpushedCommits) {
60698
+ return {
60699
+ safe: false,
60700
+ reason: "uncommitted changes AND unpushed commits present",
60701
+ dirty,
60702
+ unpushedCommits
60703
+ };
60704
+ }
60705
+ if (dirty) {
60706
+ return {
60707
+ safe: false,
60708
+ reason: "uncommitted or untracked files present",
60709
+ dirty,
60710
+ unpushedCommits
60711
+ };
60712
+ }
60713
+ if (unpushedCommits) {
60714
+ return {
60715
+ safe: false,
60716
+ reason: `commits ahead of ${base2} were not pushed/PR'd`,
60717
+ dirty,
60718
+ unpushedCommits
60719
+ };
60720
+ }
60721
+ return { safe: true, dirty, unpushedCommits };
60722
+ }
60723
+ async function seedWorktreeMcpConfig(projectRoot, worktreeCwd) {
60724
+ const dst = join13(worktreeCwd, ".mcp.json");
60725
+ const src = join13(projectRoot, ".mcp.json");
60726
+ const source = await exists(dst) ? dst : await exists(src) ? src : null;
60727
+ if (!source)
60728
+ return;
60729
+ let parsed;
60730
+ try {
60731
+ parsed = await Bun.file(source).json();
60732
+ } catch {
60733
+ return;
60734
+ }
60735
+ const servers = parsed.mcpServers;
60736
+ if (servers && typeof servers === "object") {
60737
+ for (const cfg of Object.values(servers)) {
60738
+ if (Array.isArray(cfg.args)) {
60739
+ cfg.args = cfg.args.map((a) => typeof a === "string" && a.startsWith(".ralph/") ? join13(projectRoot, a) : a);
60740
+ }
60741
+ }
60742
+ }
60743
+ await Bun.write(dst, JSON.stringify(parsed, null, 2) + `
60744
+ `);
60745
+ }
60746
+ var init_worktree = () => {};
60747
+
60705
60748
  // apps/cli/src/agent/pr.ts
60706
60749
  function defaultTitle(issue) {
60707
60750
  return `${issue.identifier}: ${issue.title}`;
@@ -60876,7 +60919,7 @@ var init_ci = __esm(() => {
60876
60919
  });
60877
60920
 
60878
60921
  // apps/cli/src/agent/post-task.ts
60879
- import { join as join15 } from "path";
60922
+ import { join as join14 } from "path";
60880
60923
  async function reactivateState(stateFilePath, log2, changeName) {
60881
60924
  const file = Bun.file(stateFilePath);
60882
60925
  if (!await file.exists())
@@ -60895,7 +60938,7 @@ async function reactivateState(stateFilePath, log2, changeName) {
60895
60938
  }
60896
60939
  async function runWorkerWithFixTask(ctx, heading, body) {
60897
60940
  try {
60898
- await prependFixTask(join15(ctx.changeDir, "tasks.md"), heading, body);
60941
+ await prependFixTask(join14(ctx.changeDir, "tasks.md"), heading, body);
60899
60942
  } catch (err) {
60900
60943
  ctx.log(`! could not prepend fix task: ${err.message}`, "red");
60901
60944
  return 1;
@@ -61263,7 +61306,7 @@ var init_post_task = __esm(() => {
61263
61306
  });
61264
61307
 
61265
61308
  // apps/cli/src/agent/wire.ts
61266
- import { join as join16 } from "path";
61309
+ import { join as join15 } from "path";
61267
61310
  import { mkdir as mkdir4 } from "fs/promises";
61268
61311
  function traceCmdRunner(base2, onStart, onEnd) {
61269
61312
  return {
@@ -61388,7 +61431,7 @@ function buildAgentCoordinator(input) {
61388
61431
  onWorkerOutput,
61389
61432
  onWorkerCmd
61390
61433
  } = input;
61391
- const logsDir = join16(projectRoot, ".ralph", "logs");
61434
+ const logsDir = join15(projectRoot, ".ralph", "logs");
61392
61435
  const concurrency = args.concurrency || cfg.concurrency;
61393
61436
  const pollInterval = args.pollInterval || cfg.pollIntervalSeconds;
61394
61437
  const indicators = mergeIndicators(cfg.linear.indicators, args.indicators);
@@ -61588,7 +61631,7 @@ function buildAgentCoordinator(input) {
61588
61631
  branchByChange.set(changeName, branch);
61589
61632
  if (mode === "review") {
61590
61633
  const wtLayout = projectLayout(workerCwd);
61591
- const tasksFile = join16(wtLayout.changeDir(changeName), "tasks.md");
61634
+ const tasksFile = join15(wtLayout.changeDir(changeName), "tasks.md");
61592
61635
  let body;
61593
61636
  let heading;
61594
61637
  if (trigger) {
@@ -61613,7 +61656,7 @@ function buildAgentCoordinator(input) {
61613
61656
  await reactivateState2(wtLayout.stateFile(changeName), changeName);
61614
61657
  } else if (mode === "conflict-fix") {
61615
61658
  const wtLayout = projectLayout(workerCwd);
61616
- const tasksFile = join16(wtLayout.changeDir(changeName), "tasks.md");
61659
+ const tasksFile = join15(wtLayout.changeDir(changeName), "tasks.md");
61617
61660
  const prUrl = prByChange.get(changeName);
61618
61661
  const body = [
61619
61662
  `The PR for this change has merge conflicts with \`${cfg.prBaseBranch}\`.`,
@@ -61692,7 +61735,7 @@ PR: ${prUrl}` : ""
61692
61735
  return c;
61693
61736
  }
61694
61737
  function defaultSpawn(changeName, cmd, cwd2, note) {
61695
- const logFilePath = join16(logsDir, `${changeName}.log`);
61738
+ const logFilePath = join15(logsDir, `${changeName}.log`);
61696
61739
  const ANSI_RE2 = /\x1b(?:\[[0-9;]*[A-Za-z]|\][^\x07\x1b]*(?:\x07|\x1b\\)|.)/g;
61697
61740
  const BOX_ONLY_RE = /^[\s\u2500\u2502\u256D\u256E\u2570\u256F\u254C\u2504\u2501\u2503]+$/;
61698
61741
  const STATUS_BAR_LINE_RE = /^[\u280B\u2819\u2839\u2838\u283C\u2834\u2826\u2827\u2807\u280F\u2713\u2717]\s+iter\s+\d+/;
@@ -61754,7 +61797,7 @@ PR: ${prUrl}` : ""
61754
61797
  let logFilePath;
61755
61798
  let handle;
61756
61799
  if (injected) {
61757
- logFilePath = join16(logsDir, `${changeName}.log`);
61800
+ logFilePath = join15(logsDir, `${changeName}.log`);
61758
61801
  handle = injected(buildTaskCmdFor(changeName), cwd2);
61759
61802
  } else {
61760
61803
  const r = defaultSpawn(changeName, buildTaskCmdFor(changeName), cwd2, `spawn at ${new Date().toISOString()}`);
@@ -67532,7 +67575,7 @@ var import_react20 = __toESM(require_react(), 1);
67532
67575
  var import_react21 = __toESM(require_react(), 1);
67533
67576
  // apps/cli/src/index.ts
67534
67577
  init_cli();
67535
- var import_react59 = __toESM(require_react(), 1);
67578
+ var import_react58 = __toESM(require_react(), 1);
67536
67579
 
67537
67580
  // packages/context/src/context.ts
67538
67581
  import { AsyncLocalStorage } from "async_hooks";
@@ -67588,8 +67631,8 @@ function createDefaultContext() {
67588
67631
  }
67589
67632
 
67590
67633
  // apps/cli/src/components/App.tsx
67591
- var import_react58 = __toESM(require_react(), 1);
67592
- import { join as join20 } from "path";
67634
+ var import_react57 = __toESM(require_react(), 1);
67635
+ import { join as join19 } from "path";
67593
67636
 
67594
67637
  // packages/core/src/state.ts
67595
67638
  init_types2();
@@ -67660,193 +67703,9 @@ function ensureState(changeDir) {
67660
67703
  return state;
67661
67704
  }
67662
67705
 
67663
- // apps/cli/src/components/TaskList.tsx
67664
- var import_react22 = __toESM(require_react(), 1);
67665
- import { join as join4 } from "path";
67666
- init_worktree();
67667
- var jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
67668
- function countTaskItems(content) {
67669
- const checked = (content.match(/^- \[x\]/gm) ?? []).length;
67670
- const unchecked = (content.match(/^- \[ \]/gm) ?? []).length;
67671
- return { checked, unchecked };
67672
- }
67673
- function buildRows(statesDir, projectRoot) {
67674
- const storage = getStorage();
67675
- const rows = [];
67676
- const seenNames = new Set;
67677
- const sources = [{ dir: statesDir, label: "main" }];
67678
- if (projectRoot) {
67679
- const worktreesRoot = worktreesDir(projectRoot);
67680
- for (const wt of storage.list(worktreesRoot)) {
67681
- sources.push({
67682
- dir: join4(worktreesRoot, wt, ".ralph", "tasks"),
67683
- label: `wt:${wt}`
67684
- });
67685
- }
67686
- }
67687
- for (const { dir, label } of sources) {
67688
- for (const entry of storage.list(dir)) {
67689
- if (seenNames.has(entry))
67690
- continue;
67691
- const raw = storage.read(join4(dir, entry, ".ralph-state.json"));
67692
- if (raw === null)
67693
- continue;
67694
- let state;
67695
- try {
67696
- state = JSON.parse(raw);
67697
- } catch {
67698
- continue;
67699
- }
67700
- if (String(state.status ?? "") === "completed")
67701
- continue;
67702
- const promptRaw = String(state.prompt ?? "");
67703
- const firstLine = promptRaw.split(`
67704
- `).find((l) => l.trim() !== "") ?? "";
67705
- let progress = "\u2014";
67706
- let progressStyled = true;
67707
- const tasksContent = storage.read(join4(dir, entry, "tasks.md"));
67708
- if (tasksContent !== null) {
67709
- const { checked, unchecked } = countTaskItems(tasksContent);
67710
- const total = checked + unchecked;
67711
- if (total > 0) {
67712
- progress = `${checked}/${total}`;
67713
- progressStyled = false;
67714
- }
67715
- }
67716
- seenNames.add(entry);
67717
- rows.push({
67718
- name: String(state.name ?? entry),
67719
- phase: String(state.status ?? "active"),
67720
- status: String(state.status ?? "unknown"),
67721
- iters: String(state.iteration ?? 0),
67722
- progress,
67723
- progressStyled,
67724
- prompt: firstLine.replace(/^#+\s*/, "").trim().slice(0, 60),
67725
- source: label
67726
- });
67727
- }
67728
- }
67729
- return rows;
67730
- }
67731
- function TaskList({ statesDir, projectRoot }) {
67732
- const { exit } = use_app_default();
67733
- import_react22.useEffect(() => {
67734
- exit();
67735
- }, [exit]);
67736
- const rows = buildRows(statesDir, projectRoot);
67737
- if (rows.length === 0) {
67738
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Box_default, {
67739
- flexDirection: "column",
67740
- children: [
67741
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67742
- children: " "
67743
- }, undefined, false, undefined, this),
67744
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67745
- dimColor: true,
67746
- children: " No incomplete tasks."
67747
- }, undefined, false, undefined, this),
67748
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67749
- children: " "
67750
- }, undefined, false, undefined, this)
67751
- ]
67752
- }, undefined, true, undefined, this);
67753
- }
67754
- const cols = {
67755
- name: Math.max(4, ...rows.map((r) => r.name.length)),
67756
- phase: Math.max(5, ...rows.map((r) => r.phase.length)),
67757
- status: Math.max(6, ...rows.map((r) => r.status.length)),
67758
- iters: 5,
67759
- progress: 8,
67760
- source: Math.max(6, ...rows.map((r) => r.source.length))
67761
- };
67762
- const ruleWidth = cols.name + cols.phase + cols.status + cols.iters + cols.progress + cols.source + 60 + 12;
67763
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Box_default, {
67764
- flexDirection: "column",
67765
- children: [
67766
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67767
- children: " "
67768
- }, undefined, false, undefined, this),
67769
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67770
- children: [
67771
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67772
- bold: true,
67773
- children: "Name".padEnd(cols.name)
67774
- }, undefined, false, undefined, this),
67775
- " ",
67776
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67777
- bold: true,
67778
- children: "Phase".padEnd(cols.phase)
67779
- }, undefined, false, undefined, this),
67780
- " ",
67781
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67782
- bold: true,
67783
- children: "Status".padEnd(cols.status)
67784
- }, undefined, false, undefined, this),
67785
- " ",
67786
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67787
- bold: true,
67788
- children: "Iters".padEnd(cols.iters)
67789
- }, undefined, false, undefined, this),
67790
- " ",
67791
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67792
- bold: true,
67793
- children: "Progress".padEnd(cols.progress)
67794
- }, undefined, false, undefined, this),
67795
- " ",
67796
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67797
- bold: true,
67798
- children: "Source".padEnd(cols.source)
67799
- }, undefined, false, undefined, this),
67800
- " ",
67801
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67802
- bold: true,
67803
- children: "Description"
67804
- }, undefined, false, undefined, this)
67805
- ]
67806
- }, undefined, true, undefined, this),
67807
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67808
- dimColor: true,
67809
- children: "\u2500".repeat(ruleWidth)
67810
- }, undefined, false, undefined, this),
67811
- rows.map((row) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67812
- children: [
67813
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67814
- color: "cyan",
67815
- children: row.name.padEnd(cols.name)
67816
- }, undefined, false, undefined, this),
67817
- " ",
67818
- row.phase.padEnd(cols.phase),
67819
- " ",
67820
- row.status.padEnd(cols.status),
67821
- " ",
67822
- row.iters.padStart(cols.iters),
67823
- " ",
67824
- row.progressStyled ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67825
- dimColor: true,
67826
- children: row.progress.padStart(cols.progress)
67827
- }, undefined, false, undefined, this) : row.progress.padStart(cols.progress),
67828
- " ",
67829
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67830
- dimColor: true,
67831
- children: row.source.padEnd(cols.source)
67832
- }, undefined, false, undefined, this),
67833
- " ",
67834
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67835
- dimColor: true,
67836
- children: row.prompt
67837
- }, undefined, false, undefined, this)
67838
- ]
67839
- }, row.name, true, undefined, this)),
67840
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67841
- children: " "
67842
- }, undefined, false, undefined, this)
67843
- ]
67844
- }, undefined, true, undefined, this);
67845
- }
67846
-
67847
67706
  // apps/cli/src/components/TaskStatus.tsx
67848
- import { join as join5 } from "path";
67849
- var jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
67707
+ import { join as join3 } from "path";
67708
+ var jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
67850
67709
  var HEAVY_RULE = "============================================";
67851
67710
  var LIGHT_RULE = "--------------------------------------------";
67852
67711
  var OPENSPEC_ARTIFACTS = ["proposal.md", "design.md", "tasks.md"];
@@ -67856,37 +67715,37 @@ function TaskStatus({ state, stateDir }) {
67856
67715
  const time = Math.round(state.usage.total_duration_ms / 1000 * 10) / 10 + "s";
67857
67716
  const artifacts = OPENSPEC_ARTIFACTS.map((name) => ({
67858
67717
  name,
67859
- exists: storage.read(join5(stateDir, name)) !== null
67718
+ exists: storage.read(join3(stateDir, name)) !== null
67860
67719
  }));
67861
67720
  const recent = state.history.slice(-10);
67862
- return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Box_default, {
67721
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Box_default, {
67863
67722
  flexDirection: "column",
67864
67723
  children: [
67865
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67724
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67866
67725
  children: HEAVY_RULE
67867
67726
  }, undefined, false, undefined, this),
67868
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67727
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67869
67728
  children: [
67870
67729
  " Change Status: ",
67871
67730
  state.name
67872
67731
  ]
67873
67732
  }, undefined, true, undefined, this),
67874
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67733
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67875
67734
  children: HEAVY_RULE
67876
67735
  }, undefined, false, undefined, this),
67877
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67736
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67878
67737
  children: [
67879
67738
  " Status: ",
67880
67739
  state.status
67881
67740
  ]
67882
67741
  }, undefined, true, undefined, this),
67883
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67742
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67884
67743
  children: [
67885
67744
  " Iteration: ",
67886
67745
  state.iteration
67887
67746
  ]
67888
67747
  }, undefined, true, undefined, this),
67889
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67748
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67890
67749
  children: [
67891
67750
  " ",
67892
67751
  "Engine: ",
@@ -67896,73 +67755,73 @@ function TaskStatus({ state, stateDir }) {
67896
67755
  ")"
67897
67756
  ]
67898
67757
  }, undefined, true, undefined, this),
67899
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67758
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67900
67759
  children: [
67901
67760
  " Created: ",
67902
67761
  state.createdAt
67903
67762
  ]
67904
67763
  }, undefined, true, undefined, this),
67905
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67764
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67906
67765
  children: [
67907
67766
  " Last modified: ",
67908
67767
  state.lastModified
67909
67768
  ]
67910
67769
  }, undefined, true, undefined, this),
67911
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67770
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67912
67771
  children: [
67913
67772
  " Branch: ",
67914
67773
  state.metadata.branch ?? "\u2014"
67915
67774
  ]
67916
67775
  }, undefined, true, undefined, this),
67917
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67776
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67918
67777
  children: LIGHT_RULE
67919
67778
  }, undefined, false, undefined, this),
67920
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67779
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67921
67780
  children: " Usage:"
67922
67781
  }, undefined, false, undefined, this),
67923
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67782
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67924
67783
  children: [
67925
67784
  " Cost: $",
67926
67785
  cost
67927
67786
  ]
67928
67787
  }, undefined, true, undefined, this),
67929
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67788
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67930
67789
  children: [
67931
67790
  " Time: ",
67932
67791
  time
67933
67792
  ]
67934
67793
  }, undefined, true, undefined, this),
67935
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67794
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67936
67795
  children: [
67937
67796
  " Turns: ",
67938
67797
  state.usage.total_turns
67939
67798
  ]
67940
67799
  }, undefined, true, undefined, this),
67941
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67800
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67942
67801
  children: [
67943
67802
  " Input tokens: ",
67944
67803
  state.usage.total_input_tokens
67945
67804
  ]
67946
67805
  }, undefined, true, undefined, this),
67947
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67806
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67948
67807
  children: [
67949
67808
  " Output tokens: ",
67950
67809
  state.usage.total_output_tokens
67951
67810
  ]
67952
67811
  }, undefined, true, undefined, this),
67953
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67812
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67954
67813
  children: [
67955
67814
  " Cached tokens: ",
67956
67815
  state.usage.total_cache_read_input_tokens
67957
67816
  ]
67958
67817
  }, undefined, true, undefined, this),
67959
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67818
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67960
67819
  children: LIGHT_RULE
67961
67820
  }, undefined, false, undefined, this),
67962
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67821
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67963
67822
  children: " Artifacts:"
67964
67823
  }, undefined, false, undefined, this),
67965
- artifacts.map((artifact) => /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67824
+ artifacts.map((artifact) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67966
67825
  children: [
67967
67826
  " ",
67968
67827
  artifact.exists ? "[x]" : "[ ]",
@@ -67970,13 +67829,13 @@ function TaskStatus({ state, stateDir }) {
67970
67829
  artifact.name
67971
67830
  ]
67972
67831
  }, artifact.name, true, undefined, this)),
67973
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67832
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67974
67833
  children: LIGHT_RULE
67975
67834
  }, undefined, false, undefined, this),
67976
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67835
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67977
67836
  children: " History (last 10):"
67978
67837
  }, undefined, false, undefined, this),
67979
- recent.map((entry, index) => /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67838
+ recent.map((entry, index) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67980
67839
  children: [
67981
67840
  " ",
67982
67841
  entry.timestamp,
@@ -67990,7 +67849,7 @@ function TaskStatus({ state, stateDir }) {
67990
67849
  entry.result
67991
67850
  ]
67992
67851
  }, index, true, undefined, this)),
67993
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67852
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67994
67853
  children: HEAVY_RULE
67995
67854
  }, undefined, false, undefined, this)
67996
67855
  ]
@@ -67998,14 +67857,14 @@ function TaskStatus({ state, stateDir }) {
67998
67857
  }
67999
67858
 
68000
67859
  // apps/cli/src/components/TaskLoop.tsx
68001
- var import_react56 = __toESM(require_react(), 1);
68002
- import { join as join10 } from "path";
67860
+ var import_react55 = __toESM(require_react(), 1);
67861
+ import { join as join8 } from "path";
68003
67862
 
68004
67863
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/badge/badge.js
68005
- var import_react24 = __toESM(require_react(), 1);
67864
+ var import_react23 = __toESM(require_react(), 1);
68006
67865
 
68007
67866
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/theme.js
68008
- var import_react23 = __toESM(require_react(), 1);
67867
+ var import_react22 = __toESM(require_react(), 1);
68009
67868
  var import_deepmerge = __toESM(require_cjs(), 1);
68010
67869
 
68011
67870
  // node_modules/.bun/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
@@ -68587,51 +68446,51 @@ var defaultTheme = {
68587
68446
  PasswordInput: theme_default13
68588
68447
  }
68589
68448
  };
68590
- var ThemeContext = import_react23.createContext(defaultTheme);
68449
+ var ThemeContext = import_react22.createContext(defaultTheme);
68591
68450
  var useComponentTheme = (component) => {
68592
- const theme14 = import_react23.useContext(ThemeContext);
68451
+ const theme14 = import_react22.useContext(ThemeContext);
68593
68452
  return theme14.components[component];
68594
68453
  };
68595
68454
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/confirm-input/confirm-input.js
68596
- var import_react25 = __toESM(require_react(), 1);
68455
+ var import_react24 = __toESM(require_react(), 1);
68597
68456
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/unordered-list/unordered-list.js
68598
- var import_react29 = __toESM(require_react(), 1);
68457
+ var import_react28 = __toESM(require_react(), 1);
68599
68458
 
68600
68459
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/unordered-list/unordered-list-item.js
68601
- var import_react27 = __toESM(require_react(), 1);
68460
+ var import_react26 = __toESM(require_react(), 1);
68602
68461
 
68603
68462
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/unordered-list/unordered-list-item-context.js
68604
- var import_react26 = __toESM(require_react(), 1);
68463
+ var import_react25 = __toESM(require_react(), 1);
68605
68464
 
68606
68465
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/unordered-list/constants.js
68607
68466
  var defaultMarker = figures_default.line;
68608
68467
 
68609
68468
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/unordered-list/unordered-list-item-context.js
68610
- var UnorderedListItemContext = import_react26.createContext({
68469
+ var UnorderedListItemContext = import_react25.createContext({
68611
68470
  marker: defaultMarker
68612
68471
  });
68613
68472
 
68614
68473
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/unordered-list/unordered-list-item.js
68615
68474
  function UnorderedListItem({ children }) {
68616
- const { marker } = import_react27.useContext(UnorderedListItemContext);
68475
+ const { marker } = import_react26.useContext(UnorderedListItemContext);
68617
68476
  const { styles: styles5 } = useComponentTheme("UnorderedList");
68618
- return import_react27.default.createElement(Box_default, { ...styles5.listItem() }, import_react27.default.createElement(Text, { ...styles5.marker() }, marker), import_react27.default.createElement(Box_default, { ...styles5.content() }, children));
68477
+ return import_react26.default.createElement(Box_default, { ...styles5.listItem() }, import_react26.default.createElement(Text, { ...styles5.marker() }, marker), import_react26.default.createElement(Box_default, { ...styles5.content() }, children));
68619
68478
  }
68620
68479
 
68621
68480
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/unordered-list/unordered-list-context.js
68622
- var import_react28 = __toESM(require_react(), 1);
68623
- var UnorderedListContext = import_react28.createContext({
68481
+ var import_react27 = __toESM(require_react(), 1);
68482
+ var UnorderedListContext = import_react27.createContext({
68624
68483
  depth: 0
68625
68484
  });
68626
68485
 
68627
68486
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/unordered-list/unordered-list.js
68628
68487
  function UnorderedList({ children }) {
68629
- const { depth } = import_react29.useContext(UnorderedListContext);
68488
+ const { depth } = import_react28.useContext(UnorderedListContext);
68630
68489
  const { styles: styles5, config } = useComponentTheme("UnorderedList");
68631
- const listContext = import_react29.useMemo(() => ({
68490
+ const listContext = import_react28.useMemo(() => ({
68632
68491
  depth: depth + 1
68633
68492
  }), [depth]);
68634
- const listItemContext = import_react29.useMemo(() => {
68493
+ const listItemContext = import_react28.useMemo(() => {
68635
68494
  const { marker } = config();
68636
68495
  if (typeof marker === "string") {
68637
68496
  return { marker };
@@ -68645,32 +68504,32 @@ function UnorderedList({ children }) {
68645
68504
  marker: defaultMarker
68646
68505
  };
68647
68506
  }, [config, depth]);
68648
- return import_react29.default.createElement(UnorderedListContext.Provider, { value: listContext }, import_react29.default.createElement(UnorderedListItemContext.Provider, { value: listItemContext }, import_react29.default.createElement(Box_default, { ...styles5.list() }, children)));
68507
+ return import_react28.default.createElement(UnorderedListContext.Provider, { value: listContext }, import_react28.default.createElement(UnorderedListItemContext.Provider, { value: listItemContext }, import_react28.default.createElement(Box_default, { ...styles5.list() }, children)));
68649
68508
  }
68650
68509
  UnorderedList.Item = UnorderedListItem;
68651
68510
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/multi-select/multi-select.js
68652
- var import_react32 = __toESM(require_react(), 1);
68511
+ var import_react31 = __toESM(require_react(), 1);
68653
68512
 
68654
68513
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/multi-select/multi-select-option.js
68655
- var import_react30 = __toESM(require_react(), 1);
68514
+ var import_react29 = __toESM(require_react(), 1);
68656
68515
 
68657
68516
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/multi-select/use-multi-select-state.js
68658
- var import_react31 = __toESM(require_react(), 1);
68517
+ var import_react30 = __toESM(require_react(), 1);
68659
68518
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/progress-bar/progress-bar.js
68660
- var import_react33 = __toESM(require_react(), 1);
68519
+ var import_react32 = __toESM(require_react(), 1);
68661
68520
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/select/select.js
68662
- var import_react36 = __toESM(require_react(), 1);
68521
+ var import_react35 = __toESM(require_react(), 1);
68663
68522
 
68664
68523
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/select/select-option.js
68665
- var import_react34 = __toESM(require_react(), 1);
68524
+ var import_react33 = __toESM(require_react(), 1);
68666
68525
 
68667
68526
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/select/use-select-state.js
68668
- var import_react35 = __toESM(require_react(), 1);
68527
+ var import_react34 = __toESM(require_react(), 1);
68669
68528
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/spinner/spinner.js
68670
- var import_react38 = __toESM(require_react(), 1);
68529
+ var import_react37 = __toESM(require_react(), 1);
68671
68530
 
68672
68531
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/spinner/use-spinner.js
68673
- var import_react37 = __toESM(require_react(), 1);
68532
+ var import_react36 = __toESM(require_react(), 1);
68674
68533
  // node_modules/.bun/cli-spinners@3.4.0/node_modules/cli-spinners/spinners.json
68675
68534
  var spinners_default = {
68676
68535
  dots: {
@@ -70376,9 +70235,9 @@ var spinnersList = Object.keys(spinners_default);
70376
70235
 
70377
70236
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/spinner/use-spinner.js
70378
70237
  function useSpinner({ type = "dots" }) {
70379
- const [frame, setFrame] = import_react37.useState(0);
70238
+ const [frame, setFrame] = import_react36.useState(0);
70380
70239
  const spinner = cli_spinners_default[type];
70381
- import_react37.useEffect(() => {
70240
+ import_react36.useEffect(() => {
70382
70241
  const timer = setInterval(() => {
70383
70242
  setFrame((previousFrame) => {
70384
70243
  const isLastFrame = previousFrame === spinner.frames.length - 1;
@@ -70398,13 +70257,13 @@ function useSpinner({ type = "dots" }) {
70398
70257
  function Spinner({ label, type }) {
70399
70258
  const { frame } = useSpinner({ type });
70400
70259
  const { styles: styles5 } = useComponentTheme("Spinner");
70401
- return import_react38.default.createElement(Box_default, { ...styles5.container() }, import_react38.default.createElement(Text, { ...styles5.frame() }, frame), label && import_react38.default.createElement(Text, { ...styles5.label() }, label));
70260
+ return import_react37.default.createElement(Box_default, { ...styles5.container() }, import_react37.default.createElement(Text, { ...styles5.frame() }, frame), label && import_react37.default.createElement(Text, { ...styles5.label() }, label));
70402
70261
  }
70403
70262
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/text-input/text-input.js
70404
- var import_react41 = __toESM(require_react(), 1);
70263
+ var import_react40 = __toESM(require_react(), 1);
70405
70264
 
70406
70265
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/text-input/use-text-input-state.js
70407
- var import_react39 = __toESM(require_react(), 1);
70266
+ var import_react38 = __toESM(require_react(), 1);
70408
70267
  var reducer = (state, action) => {
70409
70268
  switch (action.type) {
70410
70269
  case "move-cursor-left": {
@@ -70439,39 +70298,39 @@ var reducer = (state, action) => {
70439
70298
  }
70440
70299
  };
70441
70300
  var useTextInputState = ({ defaultValue = "", suggestions, onChange, onSubmit }) => {
70442
- const [state, dispatch] = import_react39.useReducer(reducer, {
70301
+ const [state, dispatch] = import_react38.useReducer(reducer, {
70443
70302
  previousValue: defaultValue,
70444
70303
  value: defaultValue,
70445
70304
  cursorOffset: defaultValue.length
70446
70305
  });
70447
- const suggestion = import_react39.useMemo(() => {
70306
+ const suggestion = import_react38.useMemo(() => {
70448
70307
  if (state.value.length === 0) {
70449
70308
  return;
70450
70309
  }
70451
70310
  return suggestions?.find((suggestion2) => suggestion2.startsWith(state.value))?.replace(state.value, "");
70452
70311
  }, [state.value, suggestions]);
70453
- const moveCursorLeft = import_react39.useCallback(() => {
70312
+ const moveCursorLeft = import_react38.useCallback(() => {
70454
70313
  dispatch({
70455
70314
  type: "move-cursor-left"
70456
70315
  });
70457
70316
  }, []);
70458
- const moveCursorRight = import_react39.useCallback(() => {
70317
+ const moveCursorRight = import_react38.useCallback(() => {
70459
70318
  dispatch({
70460
70319
  type: "move-cursor-right"
70461
70320
  });
70462
70321
  }, []);
70463
- const insert = import_react39.useCallback((text) => {
70322
+ const insert = import_react38.useCallback((text) => {
70464
70323
  dispatch({
70465
70324
  type: "insert",
70466
70325
  text
70467
70326
  });
70468
70327
  }, []);
70469
- const deleteCharacter = import_react39.useCallback(() => {
70328
+ const deleteCharacter = import_react38.useCallback(() => {
70470
70329
  dispatch({
70471
70330
  type: "delete"
70472
70331
  });
70473
70332
  }, []);
70474
- const submit = import_react39.useCallback(() => {
70333
+ const submit = import_react38.useCallback(() => {
70475
70334
  if (suggestion) {
70476
70335
  insert(suggestion);
70477
70336
  onSubmit?.(state.value + suggestion);
@@ -70479,7 +70338,7 @@ var useTextInputState = ({ defaultValue = "", suggestions, onChange, onSubmit })
70479
70338
  }
70480
70339
  onSubmit?.(state.value);
70481
70340
  }, [state.value, suggestion, insert, onSubmit]);
70482
- import_react39.useEffect(() => {
70341
+ import_react38.useEffect(() => {
70483
70342
  if (state.value !== state.previousValue) {
70484
70343
  onChange?.(state.value);
70485
70344
  }
@@ -70496,17 +70355,17 @@ var useTextInputState = ({ defaultValue = "", suggestions, onChange, onSubmit })
70496
70355
  };
70497
70356
 
70498
70357
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/text-input/use-text-input.js
70499
- var import_react40 = __toESM(require_react(), 1);
70358
+ var import_react39 = __toESM(require_react(), 1);
70500
70359
  init_source();
70501
70360
  var cursor = source_default.inverse(" ");
70502
70361
  var useTextInput = ({ isDisabled = false, state, placeholder = "" }) => {
70503
- const renderedPlaceholder = import_react40.useMemo(() => {
70362
+ const renderedPlaceholder = import_react39.useMemo(() => {
70504
70363
  if (isDisabled) {
70505
70364
  return placeholder ? source_default.dim(placeholder) : "";
70506
70365
  }
70507
70366
  return placeholder && placeholder.length > 0 ? source_default.inverse(placeholder[0]) + source_default.dim(placeholder.slice(1)) : cursor;
70508
70367
  }, [isDisabled, placeholder]);
70509
- const renderedValue = import_react40.useMemo(() => {
70368
+ const renderedValue = import_react39.useMemo(() => {
70510
70369
  if (isDisabled) {
70511
70370
  return state.value;
70512
70371
  }
@@ -70566,81 +70425,81 @@ function TextInput({ isDisabled = false, defaultValue, placeholder = "", suggest
70566
70425
  state
70567
70426
  });
70568
70427
  const { styles: styles5 } = useComponentTheme("TextInput");
70569
- return import_react41.default.createElement(Text, { ...styles5.value() }, inputValue);
70428
+ return import_react40.default.createElement(Text, { ...styles5.value() }, inputValue);
70570
70429
  }
70571
70430
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/ordered-list/ordered-list.js
70572
- var import_react45 = __toESM(require_react(), 1);
70431
+ var import_react44 = __toESM(require_react(), 1);
70573
70432
 
70574
70433
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/ordered-list/ordered-list-item.js
70575
- var import_react43 = __toESM(require_react(), 1);
70434
+ var import_react42 = __toESM(require_react(), 1);
70576
70435
 
70577
70436
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/ordered-list/ordered-list-item-context.js
70578
- var import_react42 = __toESM(require_react(), 1);
70579
- var OrderedListItemContext = import_react42.createContext({
70437
+ var import_react41 = __toESM(require_react(), 1);
70438
+ var OrderedListItemContext = import_react41.createContext({
70580
70439
  marker: figures_default.line
70581
70440
  });
70582
70441
 
70583
70442
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/ordered-list/ordered-list-item.js
70584
70443
  function OrderedListItem({ children }) {
70585
- const { marker } = import_react43.useContext(OrderedListItemContext);
70444
+ const { marker } = import_react42.useContext(OrderedListItemContext);
70586
70445
  const { styles: styles5 } = useComponentTheme("OrderedList");
70587
- return import_react43.default.createElement(Box_default, { ...styles5.listItem() }, import_react43.default.createElement(Text, { ...styles5.marker() }, marker), import_react43.default.createElement(Box_default, { ...styles5.content() }, children));
70446
+ return import_react42.default.createElement(Box_default, { ...styles5.listItem() }, import_react42.default.createElement(Text, { ...styles5.marker() }, marker), import_react42.default.createElement(Box_default, { ...styles5.content() }, children));
70588
70447
  }
70589
70448
 
70590
70449
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/ordered-list/ordered-list-context.js
70591
- var import_react44 = __toESM(require_react(), 1);
70592
- var OrderedListContext = import_react44.createContext({
70450
+ var import_react43 = __toESM(require_react(), 1);
70451
+ var OrderedListContext = import_react43.createContext({
70593
70452
  marker: ""
70594
70453
  });
70595
70454
 
70596
70455
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/ordered-list/ordered-list.js
70597
70456
  function OrderedList({ children }) {
70598
- const { marker: parentMarker } = import_react45.useContext(OrderedListContext);
70457
+ const { marker: parentMarker } = import_react44.useContext(OrderedListContext);
70599
70458
  const { styles: styles5 } = useComponentTheme("OrderedList");
70600
70459
  let numberOfItems = 0;
70601
- for (const child of import_react45.default.Children.toArray(children)) {
70602
- if (!import_react45.isValidElement(child) || child.type !== OrderedListItem) {
70460
+ for (const child of import_react44.default.Children.toArray(children)) {
70461
+ if (!import_react44.isValidElement(child) || child.type !== OrderedListItem) {
70603
70462
  continue;
70604
70463
  }
70605
70464
  numberOfItems++;
70606
70465
  }
70607
70466
  const maxMarkerWidth = String(numberOfItems).length;
70608
- return import_react45.default.createElement(Box_default, { ...styles5.list() }, import_react45.default.Children.map(children, (child, index) => {
70609
- if (!import_react45.isValidElement(child) || child.type !== OrderedListItem) {
70467
+ return import_react44.default.createElement(Box_default, { ...styles5.list() }, import_react44.default.Children.map(children, (child, index) => {
70468
+ if (!import_react44.isValidElement(child) || child.type !== OrderedListItem) {
70610
70469
  return child;
70611
70470
  }
70612
70471
  const paddedMarker = `${String(index + 1).padStart(maxMarkerWidth)}.`;
70613
70472
  const marker = `${parentMarker}${paddedMarker}`;
70614
- return import_react45.default.createElement(OrderedListContext.Provider, { value: { marker } }, import_react45.default.createElement(OrderedListItemContext.Provider, { value: { marker } }, child));
70473
+ return import_react44.default.createElement(OrderedListContext.Provider, { value: { marker } }, import_react44.default.createElement(OrderedListItemContext.Provider, { value: { marker } }, child));
70615
70474
  }));
70616
70475
  }
70617
70476
  OrderedList.Item = OrderedListItem;
70618
70477
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/password-input/password-input.js
70619
- var import_react48 = __toESM(require_react(), 1);
70478
+ var import_react47 = __toESM(require_react(), 1);
70620
70479
 
70621
70480
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/password-input/use-password-input-state.js
70622
- var import_react46 = __toESM(require_react(), 1);
70481
+ var import_react45 = __toESM(require_react(), 1);
70623
70482
 
70624
70483
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/password-input/use-password-input.js
70625
- var import_react47 = __toESM(require_react(), 1);
70484
+ var import_react46 = __toESM(require_react(), 1);
70626
70485
  init_source();
70627
70486
  var cursor2 = source_default.inverse(" ");
70628
70487
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/status-message/status-message.js
70629
- var import_react49 = __toESM(require_react(), 1);
70488
+ var import_react48 = __toESM(require_react(), 1);
70630
70489
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/alert/alert.js
70631
- var import_react50 = __toESM(require_react(), 1);
70490
+ var import_react49 = __toESM(require_react(), 1);
70632
70491
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/email-input/email-input.js
70633
- var import_react53 = __toESM(require_react(), 1);
70492
+ var import_react52 = __toESM(require_react(), 1);
70634
70493
 
70635
70494
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/email-input/use-email-input-state.js
70636
- var import_react51 = __toESM(require_react(), 1);
70495
+ var import_react50 = __toESM(require_react(), 1);
70637
70496
 
70638
70497
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/email-input/use-email-input.js
70639
- var import_react52 = __toESM(require_react(), 1);
70498
+ var import_react51 = __toESM(require_react(), 1);
70640
70499
  init_source();
70641
70500
  var cursor3 = source_default.inverse(" ");
70642
70501
  // apps/cli/src/components/Banner.tsx
70643
- var jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
70502
+ var jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
70644
70503
  var SEPARATOR = "\u2501".repeat(44);
70645
70504
  function Banner({ state, ...opts }) {
70646
70505
  const engineLabel = state.engine === "claude" ? `${state.engine} (${state.model})` : state.engine;
@@ -70648,46 +70507,46 @@ function Banner({ state, ...opts }) {
70648
70507
  const promptLines = opts.taskPrompt?.split(`
70649
70508
  `);
70650
70509
  const maxPromptLines = 6;
70651
- return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
70510
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Box_default, {
70652
70511
  flexDirection: "column",
70653
70512
  children: [
70654
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70513
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70655
70514
  color: "gray",
70656
70515
  children: SEPARATOR
70657
70516
  }, undefined, false, undefined, this),
70658
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70517
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70659
70518
  children: [
70660
70519
  " ",
70661
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70520
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70662
70521
  bold: true,
70663
70522
  color: "cyan",
70664
70523
  children: "Ralph Loop"
70665
70524
  }, undefined, false, undefined, this)
70666
70525
  ]
70667
70526
  }, undefined, true, undefined, this),
70668
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70527
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70669
70528
  color: "gray",
70670
70529
  children: SEPARATOR
70671
70530
  }, undefined, false, undefined, this),
70672
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70531
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70673
70532
  children: [
70674
70533
  " ",
70675
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70534
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70676
70535
  bold: true,
70677
70536
  children: "Mode:"
70678
70537
  }, undefined, false, undefined, this),
70679
70538
  " ",
70680
70539
  opts.mode,
70681
- opts.isResume && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70540
+ opts.isResume && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70682
70541
  dimColor: true,
70683
70542
  children: " (resumed)"
70684
70543
  }, undefined, false, undefined, this)
70685
70544
  ]
70686
70545
  }, undefined, true, undefined, this),
70687
- opts.mode === "task" && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70546
+ opts.mode === "task" && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70688
70547
  children: [
70689
70548
  " ",
70690
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70549
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70691
70550
  bold: true,
70692
70551
  children: "Task:"
70693
70552
  }, undefined, false, undefined, this),
@@ -70695,10 +70554,10 @@ function Banner({ state, ...opts }) {
70695
70554
  state.name
70696
70555
  ]
70697
70556
  }, undefined, true, undefined, this),
70698
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70557
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70699
70558
  children: [
70700
70559
  " ",
70701
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70560
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70702
70561
  bold: true,
70703
70562
  children: "Engine:"
70704
70563
  }, undefined, false, undefined, this),
@@ -70706,10 +70565,10 @@ function Banner({ state, ...opts }) {
70706
70565
  engineLabel
70707
70566
  ]
70708
70567
  }, undefined, true, undefined, this),
70709
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70568
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70710
70569
  children: [
70711
70570
  " ",
70712
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70571
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70713
70572
  bold: true,
70714
70573
  children: "Branch:"
70715
70574
  }, undefined, false, undefined, this),
@@ -70717,10 +70576,10 @@ function Banner({ state, ...opts }) {
70717
70576
  state.metadata.branch ?? "main"
70718
70577
  ]
70719
70578
  }, undefined, true, undefined, this),
70720
- opts.promptFile && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70579
+ opts.promptFile && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70721
70580
  children: [
70722
70581
  " ",
70723
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70582
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70724
70583
  bold: true,
70725
70584
  children: "Prompt:"
70726
70585
  }, undefined, false, undefined, this),
@@ -70728,20 +70587,20 @@ function Banner({ state, ...opts }) {
70728
70587
  opts.promptFile
70729
70588
  ]
70730
70589
  }, undefined, true, undefined, this),
70731
- opts.interactive && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70590
+ opts.interactive && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70732
70591
  children: [
70733
70592
  " ",
70734
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70593
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70735
70594
  bold: true,
70736
70595
  children: "Interactive:"
70737
70596
  }, undefined, false, undefined, this),
70738
70597
  " yes (research+plan phases)"
70739
70598
  ]
70740
70599
  }, undefined, true, undefined, this),
70741
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70600
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70742
70601
  children: [
70743
70602
  " ",
70744
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70603
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70745
70604
  bold: true,
70746
70605
  children: "No execute:"
70747
70606
  }, undefined, false, undefined, this),
@@ -70749,10 +70608,10 @@ function Banner({ state, ...opts }) {
70749
70608
  opts.noExecute ? "yes (research+plan only)" : "no"
70750
70609
  ]
70751
70610
  }, undefined, true, undefined, this),
70752
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70611
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70753
70612
  children: [
70754
70613
  " ",
70755
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70614
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70756
70615
  bold: true,
70757
70616
  children: "Max iters:"
70758
70617
  }, undefined, false, undefined, this),
@@ -70760,10 +70619,10 @@ function Banner({ state, ...opts }) {
70760
70619
  maxLabel
70761
70620
  ]
70762
70621
  }, undefined, true, undefined, this),
70763
- opts.maxCostUsd !== undefined && opts.maxCostUsd > 0 && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70622
+ opts.maxCostUsd !== undefined && opts.maxCostUsd > 0 && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70764
70623
  children: [
70765
70624
  " ",
70766
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70625
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70767
70626
  bold: true,
70768
70627
  children: "Cost cap:"
70769
70628
  }, undefined, false, undefined, this),
@@ -70771,10 +70630,10 @@ function Banner({ state, ...opts }) {
70771
70630
  opts.maxCostUsd
70772
70631
  ]
70773
70632
  }, undefined, true, undefined, this),
70774
- opts.maxRuntimeMinutes !== undefined && opts.maxRuntimeMinutes > 0 && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70633
+ opts.maxRuntimeMinutes !== undefined && opts.maxRuntimeMinutes > 0 && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70775
70634
  children: [
70776
70635
  " ",
70777
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70636
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70778
70637
  bold: true,
70779
70638
  children: "Runtime:"
70780
70639
  }, undefined, false, undefined, this),
@@ -70783,10 +70642,10 @@ function Banner({ state, ...opts }) {
70783
70642
  " min"
70784
70643
  ]
70785
70644
  }, undefined, true, undefined, this),
70786
- opts.maxConsecutiveFailures !== undefined && opts.maxConsecutiveFailures > 0 && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70645
+ opts.maxConsecutiveFailures !== undefined && opts.maxConsecutiveFailures > 0 && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70787
70646
  children: [
70788
70647
  " ",
70789
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70648
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70790
70649
  bold: true,
70791
70650
  children: "Fail limit:"
70792
70651
  }, undefined, false, undefined, this),
@@ -70795,10 +70654,10 @@ function Banner({ state, ...opts }) {
70795
70654
  " consecutive"
70796
70655
  ]
70797
70656
  }, undefined, true, undefined, this),
70798
- opts.iterationDelay !== undefined && opts.iterationDelay > 0 && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70657
+ opts.iterationDelay !== undefined && opts.iterationDelay > 0 && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70799
70658
  children: [
70800
70659
  " ",
70801
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70660
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70802
70661
  bold: true,
70803
70662
  children: "Delay:"
70804
70663
  }, undefined, false, undefined, this),
@@ -70807,31 +70666,31 @@ function Banner({ state, ...opts }) {
70807
70666
  "s between runs"
70808
70667
  ]
70809
70668
  }, undefined, true, undefined, this),
70810
- opts.mode === "task" && promptLines && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
70669
+ opts.mode === "task" && promptLines && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(jsx_dev_runtime2.Fragment, {
70811
70670
  children: [
70812
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70671
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70813
70672
  color: "gray",
70814
70673
  children: SEPARATOR
70815
70674
  }, undefined, false, undefined, this),
70816
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70675
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70817
70676
  children: [
70818
70677
  " ",
70819
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70678
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70820
70679
  bold: true,
70821
70680
  children: "Prompt:"
70822
70681
  }, undefined, false, undefined, this)
70823
70682
  ]
70824
70683
  }, undefined, true, undefined, this),
70825
- promptLines.slice(0, maxPromptLines).map((line, i) => /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70684
+ promptLines.slice(0, maxPromptLines).map((line, i) => /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70826
70685
  children: [
70827
70686
  " ",
70828
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70687
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70829
70688
  color: "gray",
70830
70689
  children: line
70831
70690
  }, undefined, false, undefined, this)
70832
70691
  ]
70833
70692
  }, i, true, undefined, this)),
70834
- promptLines.length > maxPromptLines && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70693
+ promptLines.length > maxPromptLines && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70835
70694
  dimColor: true,
70836
70695
  children: [
70837
70696
  " ",
@@ -70842,7 +70701,7 @@ function Banner({ state, ...opts }) {
70842
70701
  }, undefined, true, undefined, this)
70843
70702
  ]
70844
70703
  }, undefined, true, undefined, this),
70845
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70704
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70846
70705
  color: "gray",
70847
70706
  children: SEPARATOR
70848
70707
  }, undefined, false, undefined, this)
@@ -70851,15 +70710,15 @@ function Banner({ state, ...opts }) {
70851
70710
  }
70852
70711
 
70853
70712
  // apps/cli/src/components/IterationHeader.tsx
70854
- var jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
70713
+ var jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
70855
70714
  function IterationHeader({ iteration, time }) {
70856
- return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
70715
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
70857
70716
  children: [
70858
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70717
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70859
70718
  color: "gray",
70860
70719
  children: "\u2500\u2500\u2500 "
70861
70720
  }, undefined, false, undefined, this),
70862
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70721
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70863
70722
  bold: true,
70864
70723
  color: "cyan",
70865
70724
  children: [
@@ -70867,7 +70726,7 @@ function IterationHeader({ iteration, time }) {
70867
70726
  iteration
70868
70727
  ]
70869
70728
  }, undefined, true, undefined, this),
70870
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70729
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70871
70730
  color: "gray",
70872
70731
  children: [
70873
70732
  " ",
@@ -70875,7 +70734,7 @@ function IterationHeader({ iteration, time }) {
70875
70734
  " "
70876
70735
  ]
70877
70736
  }, undefined, true, undefined, this),
70878
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70737
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70879
70738
  color: "gray",
70880
70739
  children: "\u2500\u2500\u2500"
70881
70740
  }, undefined, false, undefined, this)
@@ -70884,20 +70743,20 @@ function IterationHeader({ iteration, time }) {
70884
70743
  }
70885
70744
 
70886
70745
  // apps/cli/src/components/FeedLine.tsx
70887
- var jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
70746
+ var jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
70888
70747
  var INDENT = 2;
70889
70748
  function SessionLine({ event }) {
70890
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
70749
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
70891
70750
  children: [
70892
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70751
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70893
70752
  color: "gray",
70894
70753
  children: "\u2500\u2500 "
70895
70754
  }, undefined, false, undefined, this),
70896
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70755
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70897
70756
  bold: true,
70898
70757
  children: event.model
70899
70758
  }, undefined, false, undefined, this),
70900
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70759
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70901
70760
  color: "gray",
70902
70761
  children: [
70903
70762
  " (",
@@ -70909,18 +70768,18 @@ function SessionLine({ event }) {
70909
70768
  }, undefined, true, undefined, this);
70910
70769
  }
70911
70770
  function SessionUnknown({ event }) {
70912
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
70771
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
70913
70772
  paddingLeft: INDENT,
70914
70773
  children: [
70915
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70774
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70916
70775
  color: "red",
70917
70776
  children: "\u2717 "
70918
70777
  }, undefined, false, undefined, this),
70919
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70778
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70920
70779
  bold: true,
70921
70780
  children: "UNKNOWN"
70922
70781
  }, undefined, false, undefined, this),
70923
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70782
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70924
70783
  dimColor: true,
70925
70784
  children: [
70926
70785
  " (",
@@ -70933,14 +70792,14 @@ function SessionUnknown({ event }) {
70933
70792
  }
70934
70793
  function ThinkingLine({ event }) {
70935
70794
  if (event.preview) {
70936
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
70795
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
70937
70796
  paddingLeft: INDENT,
70938
70797
  children: [
70939
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70798
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70940
70799
  color: "white",
70941
70800
  children: "\uD83D\uDCAD "
70942
70801
  }, undefined, false, undefined, this),
70943
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70802
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70944
70803
  dimColor: true,
70945
70804
  children: event.preview.split(`
70946
70805
  `)[0]
@@ -70948,18 +70807,18 @@ function ThinkingLine({ event }) {
70948
70807
  ]
70949
70808
  }, undefined, true, undefined, this);
70950
70809
  }
70951
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
70810
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
70952
70811
  paddingLeft: INDENT,
70953
- children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70812
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70954
70813
  color: "white",
70955
70814
  children: "\uD83D\uDCAD"
70956
70815
  }, undefined, false, undefined, this)
70957
70816
  }, undefined, false, undefined, this);
70958
70817
  }
70959
70818
  function TextLine({ event }) {
70960
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
70819
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
70961
70820
  paddingLeft: INDENT,
70962
- children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70821
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70963
70822
  children: event.text
70964
70823
  }, undefined, false, undefined, this)
70965
70824
  }, undefined, false, undefined, this);
@@ -70975,16 +70834,16 @@ var summaryEmoji = {
70975
70834
  raw: ""
70976
70835
  };
70977
70836
  var summaryRenderers = {
70978
- file: (s) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
70837
+ file: (s) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
70979
70838
  children: [
70980
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70839
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70981
70840
  color: "white",
70982
70841
  children: [
70983
70842
  " ",
70984
70843
  summaryEmoji.file
70985
70844
  ]
70986
70845
  }, undefined, true, undefined, this),
70987
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70846
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70988
70847
  dimColor: true,
70989
70848
  children: [
70990
70849
  " ",
@@ -70993,16 +70852,16 @@ var summaryRenderers = {
70993
70852
  }, undefined, true, undefined, this)
70994
70853
  ]
70995
70854
  }, undefined, true, undefined, this),
70996
- command: (s) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
70855
+ command: (s) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
70997
70856
  children: [
70998
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70857
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70999
70858
  color: "white",
71000
70859
  children: [
71001
70860
  " ",
71002
70861
  summaryEmoji.command
71003
70862
  ]
71004
70863
  }, undefined, true, undefined, this),
71005
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70864
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71006
70865
  dimColor: true,
71007
70866
  children: [
71008
70867
  " ",
@@ -71013,16 +70872,16 @@ var summaryRenderers = {
71013
70872
  }, undefined, true, undefined, this),
71014
70873
  search: (s) => {
71015
70874
  const { pattern, path } = s;
71016
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
70875
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
71017
70876
  children: [
71018
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70877
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71019
70878
  color: "white",
71020
70879
  children: [
71021
70880
  " ",
71022
70881
  summaryEmoji.search
71023
70882
  ]
71024
70883
  }, undefined, true, undefined, this),
71025
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70884
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71026
70885
  dimColor: true,
71027
70886
  children: [
71028
70887
  " ",
@@ -71033,16 +70892,16 @@ var summaryRenderers = {
71033
70892
  ]
71034
70893
  }, undefined, true, undefined, this);
71035
70894
  },
71036
- url: (s) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
70895
+ url: (s) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
71037
70896
  children: [
71038
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70897
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71039
70898
  color: "white",
71040
70899
  children: [
71041
70900
  " ",
71042
70901
  summaryEmoji.url
71043
70902
  ]
71044
70903
  }, undefined, true, undefined, this),
71045
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70904
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71046
70905
  dimColor: true,
71047
70906
  children: [
71048
70907
  " ",
@@ -71051,16 +70910,16 @@ var summaryRenderers = {
71051
70910
  }, undefined, true, undefined, this)
71052
70911
  ]
71053
70912
  }, undefined, true, undefined, this),
71054
- prompt: (s) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
70913
+ prompt: (s) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
71055
70914
  children: [
71056
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70915
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71057
70916
  color: "white",
71058
70917
  children: [
71059
70918
  " ",
71060
70919
  summaryEmoji.prompt
71061
70920
  ]
71062
70921
  }, undefined, true, undefined, this),
71063
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70922
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71064
70923
  dimColor: true,
71065
70924
  children: [
71066
70925
  " ",
@@ -71069,37 +70928,37 @@ var summaryRenderers = {
71069
70928
  }, undefined, true, undefined, this)
71070
70929
  ]
71071
70930
  }, undefined, true, undefined, this),
71072
- edit: () => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
70931
+ edit: () => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
71073
70932
  children: [
71074
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70933
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71075
70934
  color: "white",
71076
70935
  children: [
71077
70936
  " ",
71078
70937
  summaryEmoji.edit
71079
70938
  ]
71080
70939
  }, undefined, true, undefined, this),
71081
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70940
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71082
70941
  dimColor: true,
71083
70942
  children: " edit"
71084
70943
  }, undefined, false, undefined, this)
71085
70944
  ]
71086
70945
  }, undefined, true, undefined, this),
71087
- write: () => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
70946
+ write: () => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
71088
70947
  children: [
71089
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70948
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71090
70949
  color: "white",
71091
70950
  children: [
71092
70951
  " ",
71093
70952
  summaryEmoji.write
71094
70953
  ]
71095
70954
  }, undefined, true, undefined, this),
71096
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70955
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71097
70956
  dimColor: true,
71098
70957
  children: " write"
71099
70958
  }, undefined, false, undefined, this)
71100
70959
  ]
71101
70960
  }, undefined, true, undefined, this),
71102
- raw: (s) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70961
+ raw: (s) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71103
70962
  dimColor: true,
71104
70963
  children: [
71105
70964
  " ",
@@ -71108,10 +70967,10 @@ var summaryRenderers = {
71108
70967
  }, undefined, true, undefined, this)
71109
70968
  };
71110
70969
  function ToolStartLine({ event }) {
71111
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
70970
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71112
70971
  paddingLeft: INDENT,
71113
70972
  children: [
71114
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70973
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71115
70974
  color: "cyan",
71116
70975
  children: [
71117
70976
  "\u25B6 ",
@@ -71125,15 +70984,15 @@ function ToolStartLine({ event }) {
71125
70984
  function ToolResultPreview({
71126
70985
  event
71127
70986
  }) {
71128
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
70987
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71129
70988
  flexDirection: "column",
71130
70989
  paddingLeft: INDENT + 2,
71131
70990
  children: [
71132
- event.lines.map((line, i) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70991
+ event.lines.map((line, i) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71133
70992
  dimColor: true,
71134
70993
  children: line
71135
70994
  }, i, false, undefined, this)),
71136
- event.truncated ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70995
+ event.truncated ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71137
70996
  dimColor: true,
71138
70997
  children: [
71139
70998
  "\u2026 (",
@@ -71145,23 +71004,23 @@ function ToolResultPreview({
71145
71004
  }, undefined, true, undefined, this);
71146
71005
  }
71147
71006
  function TurnStartLine() {
71148
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71007
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71149
71008
  paddingLeft: INDENT,
71150
- children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71009
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71151
71010
  bold: true,
71152
71011
  children: "\u25B6 turn started"
71153
71012
  }, undefined, false, undefined, this)
71154
71013
  }, undefined, false, undefined, this);
71155
71014
  }
71156
71015
  function TurnDoneLine({ event }) {
71157
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71016
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71158
71017
  paddingLeft: INDENT,
71159
71018
  children: [
71160
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71019
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71161
71020
  color: "green",
71162
71021
  children: "\u2713 done"
71163
71022
  }, undefined, false, undefined, this),
71164
- event.inputTokens !== undefined && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71023
+ event.inputTokens !== undefined && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71165
71024
  dimColor: true,
71166
71025
  children: [
71167
71026
  " ",
@@ -71186,14 +71045,14 @@ function ResultLine({ event }) {
71186
71045
  `out=${event.outputTokens}`,
71187
71046
  `cached=${event.cached}`
71188
71047
  ].join(" ");
71189
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71048
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71190
71049
  paddingLeft: INDENT,
71191
71050
  children: [
71192
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71051
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71193
71052
  color: "green",
71194
71053
  children: "\u2713 done"
71195
71054
  }, undefined, false, undefined, this),
71196
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71055
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71197
71056
  dimColor: true,
71198
71057
  children: [
71199
71058
  " ",
@@ -71204,15 +71063,15 @@ function ResultLine({ event }) {
71204
71063
  }, undefined, true, undefined, this);
71205
71064
  }
71206
71065
  function ResultErrorLine({ event }) {
71207
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71066
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71208
71067
  paddingLeft: INDENT,
71209
71068
  children: [
71210
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71069
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71211
71070
  color: "red",
71212
71071
  bold: true,
71213
71072
  children: "\u2717 Error"
71214
71073
  }, undefined, false, undefined, this),
71215
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71074
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71216
71075
  color: "red",
71217
71076
  children: [
71218
71077
  " ",
@@ -71223,29 +71082,29 @@ function ResultErrorLine({ event }) {
71223
71082
  }, undefined, true, undefined, this);
71224
71083
  }
71225
71084
  function ErrorLine({ event }) {
71226
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71085
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71227
71086
  paddingLeft: INDENT,
71228
71087
  children: [
71229
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71088
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71230
71089
  color: "red",
71231
71090
  children: "error: "
71232
71091
  }, undefined, false, undefined, this),
71233
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71092
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71234
71093
  children: event.message
71235
71094
  }, undefined, false, undefined, this)
71236
71095
  ]
71237
71096
  }, undefined, true, undefined, this);
71238
71097
  }
71239
71098
  function RateLimitLine({ event }) {
71240
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71099
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71241
71100
  paddingLeft: INDENT,
71242
71101
  children: [
71243
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71102
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71244
71103
  color: "red",
71245
71104
  bold: true,
71246
71105
  children: "\u2717 Rate limit reached"
71247
71106
  }, undefined, false, undefined, this),
71248
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71107
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71249
71108
  color: "red",
71250
71109
  children: [
71251
71110
  " ",
@@ -71256,24 +71115,24 @@ function RateLimitLine({ event }) {
71256
71115
  }, undefined, true, undefined, this);
71257
71116
  }
71258
71117
  function InterruptedLine({ event }) {
71259
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71118
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71260
71119
  flexDirection: "column",
71261
71120
  paddingLeft: INDENT,
71262
71121
  children: [
71263
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71122
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71264
71123
  children: [
71265
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71124
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71266
71125
  color: "red",
71267
71126
  bold: true,
71268
71127
  children: "\u2717 Stream interrupted"
71269
71128
  }, undefined, false, undefined, this),
71270
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71129
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71271
71130
  dimColor: true,
71272
71131
  children: " (no result received)"
71273
71132
  }, undefined, false, undefined, this)
71274
71133
  ]
71275
71134
  }, undefined, true, undefined, this),
71276
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71135
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71277
71136
  dimColor: true,
71278
71137
  children: [
71279
71138
  "turns=",
@@ -71286,9 +71145,9 @@ function InterruptedLine({ event }) {
71286
71145
  }, undefined, true, undefined, this);
71287
71146
  }
71288
71147
  function AgentLine({ event }) {
71289
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71148
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71290
71149
  paddingLeft: INDENT,
71291
- children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71150
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71292
71151
  dimColor: true,
71293
71152
  children: [
71294
71153
  "\u22B3 agent: ",
@@ -71300,27 +71159,27 @@ function AgentLine({ event }) {
71300
71159
  function FeedLine({ event, verbose }) {
71301
71160
  switch (event.type) {
71302
71161
  case "session":
71303
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(SessionLine, {
71162
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(SessionLine, {
71304
71163
  event
71305
71164
  }, undefined, false, undefined, this);
71306
71165
  case "session-unknown":
71307
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(SessionUnknown, {
71166
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(SessionUnknown, {
71308
71167
  event
71309
71168
  }, undefined, false, undefined, this);
71310
71169
  case "agent":
71311
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(AgentLine, {
71170
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(AgentLine, {
71312
71171
  event
71313
71172
  }, undefined, false, undefined, this);
71314
71173
  case "thinking":
71315
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThinkingLine, {
71174
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThinkingLine, {
71316
71175
  event
71317
71176
  }, undefined, false, undefined, this);
71318
71177
  case "text":
71319
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(TextLine, {
71178
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TextLine, {
71320
71179
  event
71321
71180
  }, undefined, false, undefined, this);
71322
71181
  case "tool-start":
71323
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ToolStartLine, {
71182
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ToolStartLine, {
71324
71183
  event
71325
71184
  }, undefined, false, undefined, this);
71326
71185
  case "tool-end":
@@ -71328,37 +71187,37 @@ function FeedLine({ event, verbose }) {
71328
71187
  case "tool-result-preview":
71329
71188
  if (!verbose)
71330
71189
  return null;
71331
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ToolResultPreview, {
71190
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ToolResultPreview, {
71332
71191
  event
71333
71192
  }, undefined, false, undefined, this);
71334
71193
  case "turn-start":
71335
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(TurnStartLine, {}, undefined, false, undefined, this);
71194
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TurnStartLine, {}, undefined, false, undefined, this);
71336
71195
  case "turn-done":
71337
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(TurnDoneLine, {
71196
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TurnDoneLine, {
71338
71197
  event
71339
71198
  }, undefined, false, undefined, this);
71340
71199
  case "result":
71341
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ResultLine, {
71200
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ResultLine, {
71342
71201
  event
71343
71202
  }, undefined, false, undefined, this);
71344
71203
  case "result-error":
71345
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ResultErrorLine, {
71204
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ResultErrorLine, {
71346
71205
  event
71347
71206
  }, undefined, false, undefined, this);
71348
71207
  case "error":
71349
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ErrorLine, {
71208
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ErrorLine, {
71350
71209
  event
71351
71210
  }, undefined, false, undefined, this);
71352
71211
  case "rate-limit":
71353
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(RateLimitLine, {
71212
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(RateLimitLine, {
71354
71213
  event
71355
71214
  }, undefined, false, undefined, this);
71356
71215
  case "interrupted":
71357
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(InterruptedLine, {
71216
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(InterruptedLine, {
71358
71217
  event
71359
71218
  }, undefined, false, undefined, this);
71360
71219
  case "raw":
71361
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71220
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71362
71221
  dimColor: true,
71363
71222
  children: event.text
71364
71223
  }, undefined, false, undefined, this);
@@ -71366,8 +71225,8 @@ function FeedLine({ event, verbose }) {
71366
71225
  }
71367
71226
 
71368
71227
  // apps/cli/src/components/StatusBar.tsx
71369
- var import_react54 = __toESM(require_react(), 1);
71370
- var jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
71228
+ var import_react53 = __toESM(require_react(), 1);
71229
+ var jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
71371
71230
  function formatElapsed(ms) {
71372
71231
  const totalSec = Math.floor(ms / 1000);
71373
71232
  if (totalSec < 60)
@@ -71380,7 +71239,7 @@ function formatElapsed(ms) {
71380
71239
  return `${hr}h ${min2 % 60}m`;
71381
71240
  }
71382
71241
  function Sep() {
71383
- return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71242
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71384
71243
  color: "gray",
71385
71244
  children: " \u2502 "
71386
71245
  }, undefined, false, undefined, this);
@@ -71393,46 +71252,46 @@ function StatusBar({
71393
71252
  model,
71394
71253
  isRunning
71395
71254
  }) {
71396
- const [elapsed, setElapsed] = import_react54.useState(0);
71397
- import_react54.useEffect(() => {
71255
+ const [elapsed, setElapsed] = import_react53.useState(0);
71256
+ import_react53.useEffect(() => {
71398
71257
  if (!isRunning)
71399
71258
  return;
71400
71259
  const id = setInterval(() => setElapsed(Date.now() - startedAt), 1000);
71401
71260
  return () => clearInterval(id);
71402
71261
  }, [isRunning, startedAt]);
71403
71262
  const bar = "\u2500".repeat(52);
71404
- return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
71263
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71405
71264
  flexDirection: "column",
71406
71265
  children: [
71407
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71266
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71408
71267
  color: "gray",
71409
71268
  children: bar
71410
71269
  }, undefined, false, undefined, this),
71411
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
71270
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71412
71271
  children: [
71413
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71272
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71414
71273
  children: " "
71415
71274
  }, undefined, false, undefined, this),
71416
- isRunning ? /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Spinner, {
71275
+ isRunning ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Spinner, {
71417
71276
  label: ""
71418
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71277
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71419
71278
  color: "green",
71420
71279
  children: "\u2713"
71421
71280
  }, undefined, false, undefined, this),
71422
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71281
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71423
71282
  children: " "
71424
71283
  }, undefined, false, undefined, this),
71425
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71284
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71426
71285
  children: "iter "
71427
71286
  }, undefined, false, undefined, this),
71428
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71287
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71429
71288
  bold: true,
71430
71289
  children: iteration
71431
71290
  }, undefined, false, undefined, this),
71432
- costUsd > 0 && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(jsx_dev_runtime6.Fragment, {
71291
+ costUsd > 0 && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
71433
71292
  children: [
71434
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Sep, {}, undefined, false, undefined, this),
71435
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71293
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Sep, {}, undefined, false, undefined, this),
71294
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71436
71295
  color: "magenta",
71437
71296
  children: [
71438
71297
  "$",
@@ -71441,13 +71300,13 @@ function StatusBar({
71441
71300
  }, undefined, true, undefined, this)
71442
71301
  ]
71443
71302
  }, undefined, true, undefined, this),
71444
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Sep, {}, undefined, false, undefined, this),
71445
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71303
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Sep, {}, undefined, false, undefined, this),
71304
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71446
71305
  dimColor: true,
71447
71306
  children: formatElapsed(elapsed)
71448
71307
  }, undefined, false, undefined, this),
71449
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Sep, {}, undefined, false, undefined, this),
71450
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71308
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Sep, {}, undefined, false, undefined, this),
71309
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71451
71310
  dimColor: true,
71452
71311
  children: [
71453
71312
  engine,
@@ -71457,7 +71316,7 @@ function StatusBar({
71457
71316
  }, undefined, true, undefined, this)
71458
71317
  ]
71459
71318
  }, undefined, true, undefined, this),
71460
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71319
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71461
71320
  color: "gray",
71462
71321
  children: bar
71463
71322
  }, undefined, false, undefined, this)
@@ -71466,7 +71325,7 @@ function StatusBar({
71466
71325
  }
71467
71326
 
71468
71327
  // apps/cli/src/components/StopMessage.tsx
71469
- var jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
71328
+ var jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
71470
71329
  function StopMessage({
71471
71330
  reason,
71472
71331
  state,
@@ -71478,17 +71337,17 @@ function StopMessage({
71478
71337
  }) {
71479
71338
  switch (reason) {
71480
71339
  case "completed": {
71481
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
71340
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
71482
71341
  flexDirection: "column",
71483
71342
  children: [
71484
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
71343
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71485
71344
  children: [
71486
71345
  `
71487
71346
  `,
71488
71347
  "All tasks completed \u2014 change archived."
71489
71348
  ]
71490
71349
  }, undefined, true, undefined, this),
71491
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
71350
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71492
71351
  children: [
71493
71352
  "See: ",
71494
71353
  stateDir,
@@ -71499,7 +71358,7 @@ function StopMessage({
71499
71358
  }, undefined, true, undefined, this);
71500
71359
  }
71501
71360
  case "maxIterations":
71502
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
71361
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71503
71362
  children: [
71504
71363
  `
71505
71364
  `,
@@ -71508,7 +71367,7 @@ function StopMessage({
71508
71367
  ]
71509
71368
  }, undefined, true, undefined, this);
71510
71369
  case "costCap":
71511
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
71370
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71512
71371
  color: "yellow",
71513
71372
  bold: true,
71514
71373
  children: [
@@ -71525,7 +71384,7 @@ function StopMessage({
71525
71384
  ]
71526
71385
  }, undefined, true, undefined, this);
71527
71386
  case "runtimeLimit":
71528
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
71387
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71529
71388
  color: "yellow",
71530
71389
  bold: true,
71531
71390
  children: [
@@ -71537,7 +71396,7 @@ function StopMessage({
71537
71396
  ]
71538
71397
  }, undefined, true, undefined, this);
71539
71398
  case "consecutiveFailures":
71540
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
71399
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71541
71400
  color: "red",
71542
71401
  bold: true,
71543
71402
  children: [
@@ -71549,7 +71408,7 @@ function StopMessage({
71549
71408
  ]
71550
71409
  }, undefined, true, undefined, this);
71551
71410
  case "rateLimited":
71552
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
71411
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71553
71412
  color: "red",
71554
71413
  bold: true,
71555
71414
  children: [
@@ -71562,8 +71421,8 @@ function StopMessage({
71562
71421
  }
71563
71422
 
71564
71423
  // apps/cli/src/hooks/useLoop.ts
71565
- var import_react55 = __toESM(require_react(), 1);
71566
- import { join as join9 } from "path";
71424
+ var import_react54 = __toESM(require_react(), 1);
71425
+ import { join as join7 } from "path";
71567
71426
 
71568
71427
  // packages/engine/src/spawn.ts
71569
71428
  var {spawn: bunSpawn } = globalThis.Bun;
@@ -71573,7 +71432,7 @@ var spawn = bunSpawn;
71573
71432
  import { createWriteStream } from "fs";
71574
71433
  import { mkdtemp, unlink, mkdir } from "fs/promises";
71575
71434
  import { dirname as dirname2 } from "path";
71576
- import { join as join6 } from "path";
71435
+ import { join as join4 } from "path";
71577
71436
  import { tmpdir } from "os";
71578
71437
 
71579
71438
  // packages/engine/src/feed-events.ts
@@ -72306,7 +72165,7 @@ function buildCodexArgs() {
72306
72165
  return ["exec", "--json", "--color", "never", "--dangerously-bypass-approvals-and-sandbox", "-"];
72307
72166
  }
72308
72167
  async function runInteractive(model, prompt, taskDir) {
72309
- const promptFile = taskDir ? join6(taskDir, "_interactive_prompt.md") : join6(await mkdtemp(join6(tmpdir(), "ralph-")), "prompt.md");
72168
+ const promptFile = taskDir ? join4(taskDir, "_interactive_prompt.md") : join4(await mkdtemp(join4(tmpdir(), "ralph-")), "prompt.md");
72310
72169
  await Bun.write(promptFile, prompt);
72311
72170
  try {
72312
72171
  const cmd = [
@@ -72332,7 +72191,7 @@ async function runInteractive(model, prompt, taskDir) {
72332
72191
  stderr: "inherit"
72333
72192
  });
72334
72193
  const exitCode = await proc.exited;
72335
- const doneFile = taskDir ? join6(taskDir, "_interactive_done") : null;
72194
+ const doneFile = taskDir ? join4(taskDir, "_interactive_done") : null;
72336
72195
  if (doneFile && await Bun.file(doneFile).exists()) {
72337
72196
  return { exitCode: 0, usage: null, sessionId: null, rateLimited: false };
72338
72197
  }
@@ -72549,12 +72408,12 @@ function commitTaskDir(taskDir, message) {
72549
72408
  init_src();
72550
72409
 
72551
72410
  // packages/core/src/loop.ts
72552
- import { join as join8 } from "path";
72411
+ import { join as join6 } from "path";
72553
72412
  var STEERING_MAX_LINES = 20;
72554
72413
  function buildTaskPrompt(state, taskDir) {
72555
72414
  const storage = getStorage();
72556
72415
  let prompt = "";
72557
- const steeringContent = storage.read(join8(taskDir, "steering.md"));
72416
+ const steeringContent = storage.read(join6(taskDir, "steering.md"));
72558
72417
  if (steeringContent !== null) {
72559
72418
  const steeringLines = steeringContent.split(`
72560
72419
  `).filter((line) => !line.startsWith("#")).filter((line) => line.trim()).slice(0, STEERING_MAX_LINES);
@@ -72573,7 +72432,7 @@ function buildTaskPrompt(state, taskDir) {
72573
72432
  `;
72574
72433
  }
72575
72434
  }
72576
- const tasksContent = storage.read(join8(taskDir, "tasks.md"));
72435
+ const tasksContent = storage.read(join6(taskDir, "tasks.md"));
72577
72436
  if (tasksContent !== null) {
72578
72437
  const section = firstUnchecked(tasksContent);
72579
72438
  if (section) {
@@ -72588,7 +72447,7 @@ function buildTaskPrompt(state, taskDir) {
72588
72447
  prompt += `---
72589
72448
 
72590
72449
  `;
72591
- prompt += `**Tracking progress**: as you finish each item above, edit ` + `\`${join8(taskDir, "tasks.md")}\` and change its \`- [ ]\` to ` + `\`- [x]\` in the same commit. The loop reads this file between ` + `iterations and stops when no \`- [ ]\` items remain \u2014 if you do ` + `not tick the box, the next iteration will repeat this task.
72450
+ prompt += `**Tracking progress**: as you finish each item above, edit ` + `\`${join6(taskDir, "tasks.md")}\` and change its \`- [ ]\` to ` + `\`- [x]\` in the same commit. The loop reads this file between ` + `iterations and stops when no \`- [ ]\` items remain \u2014 if you do ` + `not tick the box, the next iteration will repeat this task.
72592
72451
 
72593
72452
  `;
72594
72453
  }
@@ -72609,7 +72468,7 @@ function buildTaskPrompt(state, taskDir) {
72609
72468
  `;
72610
72469
  }
72611
72470
  if (state.manualTest) {
72612
- const tasksContent2 = storage.read(join8(taskDir, "tasks.md"));
72471
+ const tasksContent2 = storage.read(join6(taskDir, "tasks.md"));
72613
72472
  const hasUncheckedTasks = tasksContent2 !== null && /^- \[ \]/m.test(tasksContent2);
72614
72473
  if (!hasUncheckedTasks) {
72615
72474
  const hasManualTestSection = tasksContent2 !== null && /^## Manual Testing/m.test(tasksContent2);
@@ -72658,7 +72517,7 @@ When all tasks are complete and all files are committed, push your branch and op
72658
72517
  }
72659
72518
  function checkStopSignal(taskDir, stateDir) {
72660
72519
  const storage = getStorage();
72661
- const stopFile = join8(taskDir, "STOP");
72520
+ const stopFile = join6(taskDir, "STOP");
72662
72521
  const reason = storage.read(stopFile);
72663
72522
  if (reason === null)
72664
72523
  return null;
@@ -72733,7 +72592,7 @@ function updateStateIteration(stateDir, result2, startedAt, engine, model, usage
72733
72592
  }
72734
72593
  function appendSteeringMessage(taskDir, message) {
72735
72594
  const storage = getStorage();
72736
- const steeringPath = join8(taskDir, "steering.md");
72595
+ const steeringPath = join6(taskDir, "steering.md");
72737
72596
  const existing = storage.read(steeringPath);
72738
72597
  const updated = existing ? `${message}
72739
72598
 
@@ -72769,22 +72628,22 @@ function sleep(seconds) {
72769
72628
  return new Promise((resolve2) => setTimeout(resolve2, seconds * 1000));
72770
72629
  }
72771
72630
  function useLoop(opts) {
72772
- const [state, setState] = import_react55.useState(null);
72773
- const [iteration, setIteration] = import_react55.useState(0);
72774
- const [consecutiveFailures, setConsecutiveFailures] = import_react55.useState(0);
72775
- const [logLines, setLogLines] = import_react55.useState([]);
72776
- const [stopReason, setStopReason] = import_react55.useState(null);
72777
- const [isRunning, setIsRunning] = import_react55.useState(true);
72778
- const [isResume, setIsResume] = import_react55.useState(false);
72779
- const [startedAt] = import_react55.useState(() => Date.now());
72780
- const lineIdRef = import_react55.useRef(0);
72781
- const steerControllerRef = import_react55.useRef(null);
72782
- const pendingSteerRef = import_react55.useRef(null);
72631
+ const [state, setState] = import_react54.useState(null);
72632
+ const [iteration, setIteration] = import_react54.useState(0);
72633
+ const [consecutiveFailures, setConsecutiveFailures] = import_react54.useState(0);
72634
+ const [logLines, setLogLines] = import_react54.useState([]);
72635
+ const [stopReason, setStopReason] = import_react54.useState(null);
72636
+ const [isRunning, setIsRunning] = import_react54.useState(true);
72637
+ const [isResume, setIsResume] = import_react54.useState(false);
72638
+ const [startedAt] = import_react54.useState(() => Date.now());
72639
+ const lineIdRef = import_react54.useRef(0);
72640
+ const steerControllerRef = import_react54.useRef(null);
72641
+ const pendingSteerRef = import_react54.useRef(null);
72783
72642
  const steer = (message) => {
72784
72643
  pendingSteerRef.current = message;
72785
72644
  steerControllerRef.current?.abort();
72786
72645
  };
72787
- import_react55.useEffect(() => {
72646
+ import_react54.useEffect(() => {
72788
72647
  let cancelled = false;
72789
72648
  const nextId = () => String(lineIdRef.current++);
72790
72649
  const addInfo = (text) => {
@@ -72800,11 +72659,11 @@ function useLoop(opts) {
72800
72659
  setLogLines((prev) => [...prev, { id: nextId(), kind: "feed", event }]);
72801
72660
  };
72802
72661
  runWithContext(createDefaultContext(), async () => {
72803
- const stateDir = join9(opts.statesDir, opts.name);
72804
- const tasksDir = join9(opts.tasksDir, opts.name);
72662
+ const stateDir = join7(opts.statesDir, opts.name);
72663
+ const tasksDir = join7(opts.tasksDir, opts.name);
72805
72664
  const storage = getStorage();
72806
72665
  let currentState;
72807
- const existingStateRaw = storage.read(join9(stateDir, ".ralph-state.json"));
72666
+ const existingStateRaw = storage.read(join7(stateDir, ".ralph-state.json"));
72808
72667
  if (existingStateRaw !== null) {
72809
72668
  currentState = readState(stateDir);
72810
72669
  if (currentState.engine !== opts.engine || currentState.model !== opts.model) {
@@ -72851,7 +72710,7 @@ function useLoop(opts) {
72851
72710
  setStopReason(stop);
72852
72711
  break;
72853
72712
  }
72854
- const tasksContent = storage.read(join9(tasksDir, "tasks.md"));
72713
+ const tasksContent = storage.read(join7(tasksDir, "tasks.md"));
72855
72714
  if (tasksContent !== null) {
72856
72715
  const remaining = countUnchecked(tasksContent);
72857
72716
  addInfo(`tasks.md: ${remaining} unchecked item${remaining === 1 ? "" : "s"} remaining`);
@@ -72891,7 +72750,7 @@ function useLoop(opts) {
72891
72750
  model: opts.model,
72892
72751
  prompt,
72893
72752
  logFlag: opts.log,
72894
- logFile: join9(stateDir, "log.json"),
72753
+ logFile: join7(stateDir, "log.json"),
72895
72754
  taskDir: tasksDir,
72896
72755
  interactive: false,
72897
72756
  onFeedEvent: addFeedEvent,
@@ -72914,7 +72773,7 @@ function useLoop(opts) {
72914
72773
  model: opts.model,
72915
72774
  prompt: buildSteeringPrompt(steerMessage),
72916
72775
  logFlag: opts.log,
72917
- logFile: join9(stateDir, "log.json"),
72776
+ logFile: join7(stateDir, "log.json"),
72918
72777
  taskDir: tasksDir,
72919
72778
  onFeedEvent: addResumeFeedEvent,
72920
72779
  signal: resumeController.signal,
@@ -73011,16 +72870,16 @@ function useLoop(opts) {
73011
72870
  }
73012
72871
 
73013
72872
  // apps/cli/src/components/TaskLoop.tsx
73014
- var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
72873
+ var jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
73015
72874
  function LogLine({ entry, verbose }) {
73016
72875
  switch (entry.kind) {
73017
72876
  case "iterationHeader":
73018
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(IterationHeader, {
72877
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(IterationHeader, {
73019
72878
  iteration: entry.iteration,
73020
72879
  time: entry.time
73021
72880
  }, undefined, false, undefined, this);
73022
72881
  case "info":
73023
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
72882
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
73024
72883
  dimColor: true,
73025
72884
  children: [
73026
72885
  " ",
@@ -73028,7 +72887,7 @@ function LogLine({ entry, verbose }) {
73028
72887
  ]
73029
72888
  }, undefined, true, undefined, this);
73030
72889
  case "feed":
73031
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(FeedLine, {
72890
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(FeedLine, {
73032
72891
  event: entry.event,
73033
72892
  verbose
73034
72893
  }, undefined, false, undefined, this);
@@ -73062,10 +72921,10 @@ function handleSteerKeyInput(key, history, currentIndex) {
73062
72921
  return navigateHistory(history, currentIndex, dir);
73063
72922
  }
73064
72923
  function SteerInput({ onSubmit }) {
73065
- const [inputKey, setInputKey] = import_react56.useState(0);
73066
- const [defaultValue, setDefaultValue] = import_react56.useState("");
73067
- const historyRef = import_react56.useRef([]);
73068
- const historyIndexRef = import_react56.useRef(-1);
72924
+ const [inputKey, setInputKey] = import_react55.useState(0);
72925
+ const [defaultValue, setDefaultValue] = import_react55.useState("");
72926
+ const historyRef = import_react55.useRef([]);
72927
+ const historyIndexRef = import_react55.useRef(-1);
73069
72928
  use_input_default((_input, key) => {
73070
72929
  const result2 = handleSteerKeyInput(key, historyRef.current, historyIndexRef.current);
73071
72930
  if (result2) {
@@ -73074,13 +72933,13 @@ function SteerInput({ onSubmit }) {
73074
72933
  setInputKey((k) => k + 1);
73075
72934
  }
73076
72935
  });
73077
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
72936
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
73078
72937
  children: [
73079
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
72938
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
73080
72939
  dimColor: true,
73081
72940
  children: "steer: "
73082
72941
  }, undefined, false, undefined, this),
73083
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(TextInput, {
72942
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(TextInput, {
73084
72943
  defaultValue,
73085
72944
  onSubmit: (v) => {
73086
72945
  if (processSteerSubmit(v, historyRef.current, onSubmit)) {
@@ -73097,27 +72956,27 @@ function TaskLoop({ opts }) {
73097
72956
  const { exit } = use_app_default();
73098
72957
  const loop = useLoop(opts);
73099
72958
  const { isRawModeSupported } = use_stdin_default();
73100
- const bannerItem = import_react56.useRef({ id: "__banner__", kind: "banner" });
73101
- const feedItems = import_react56.useMemo(() => [
72959
+ const bannerItem = import_react55.useRef({ id: "__banner__", kind: "banner" });
72960
+ const feedItems = import_react55.useMemo(() => [
73102
72961
  bannerItem.current,
73103
72962
  ...loop.logLines.map((e) => ({ id: e.id, kind: "entry", entry: e }))
73104
72963
  ], [loop.logLines]);
73105
- import_react56.useEffect(() => {
72964
+ import_react55.useEffect(() => {
73106
72965
  if (!loop.isRunning) {
73107
72966
  exit();
73108
72967
  }
73109
72968
  }, [loop.isRunning, exit]);
73110
72969
  if (!loop.state)
73111
72970
  return null;
73112
- const stateDir = join10(opts.statesDir, opts.name);
73113
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
72971
+ const stateDir = join8(opts.statesDir, opts.name);
72972
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
73114
72973
  flexDirection: "column",
73115
72974
  children: [
73116
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Static, {
72975
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Static, {
73117
72976
  items: feedItems,
73118
72977
  children: (item) => {
73119
72978
  if (item.kind === "banner") {
73120
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Banner, {
72979
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Banner, {
73121
72980
  state: loop.state,
73122
72981
  mode: "task",
73123
72982
  isResume: loop.isResume,
@@ -73129,15 +72988,15 @@ function TaskLoop({ opts }) {
73129
72988
  taskPrompt: opts.prompt || loop.state.prompt
73130
72989
  }, item.id, false, undefined, this);
73131
72990
  }
73132
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(LogLine, {
72991
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(LogLine, {
73133
72992
  entry: item.entry,
73134
72993
  verbose: opts.verbose
73135
72994
  }, item.id, false, undefined, this);
73136
72995
  }
73137
72996
  }, undefined, false, undefined, this),
73138
- loop.isRunning && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
72997
+ loop.isRunning && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
73139
72998
  children: [
73140
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(StatusBar, {
72999
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(StatusBar, {
73141
73000
  iteration: loop.iteration,
73142
73001
  costUsd: loop.state.usage.total_cost_usd,
73143
73002
  startedAt: loop.startedAt,
@@ -73145,14 +73004,14 @@ function TaskLoop({ opts }) {
73145
73004
  model: opts.model,
73146
73005
  isRunning: true
73147
73006
  }, undefined, false, undefined, this),
73148
- isRawModeSupported && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(SteerInput, {
73007
+ isRawModeSupported && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(SteerInput, {
73149
73008
  onSubmit: loop.steer
73150
73009
  }, undefined, false, undefined, this)
73151
73010
  ]
73152
73011
  }, undefined, true, undefined, this),
73153
- loop.stopReason && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
73012
+ loop.stopReason && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
73154
73013
  children: [
73155
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(StatusBar, {
73014
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(StatusBar, {
73156
73015
  iteration: loop.iteration,
73157
73016
  costUsd: loop.state.usage.total_cost_usd,
73158
73017
  startedAt: loop.startedAt,
@@ -73160,7 +73019,7 @@ function TaskLoop({ opts }) {
73160
73019
  model: opts.model,
73161
73020
  isRunning: false
73162
73021
  }, undefined, false, undefined, this),
73163
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(StopMessage, {
73022
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(StopMessage, {
73164
73023
  reason: loop.stopReason,
73165
73024
  state: loop.state,
73166
73025
  stateDir,
@@ -73176,12 +73035,11 @@ function TaskLoop({ opts }) {
73176
73035
  }
73177
73036
 
73178
73037
  // apps/cli/src/components/AgentMode.tsx
73179
- var import_react57 = __toESM(require_react(), 1);
73038
+ var import_react56 = __toESM(require_react(), 1);
73180
73039
  init_cli();
73181
73040
  init_config();
73182
73041
  init_wire();
73183
- import { join as join17 } from "path";
73184
- import { pathToFileURL } from "url";
73042
+ import { join as join16 } from "path";
73185
73043
 
73186
73044
  // packages/core/src/progress.ts
73187
73045
  function countProgress(content) {
@@ -73192,7 +73050,7 @@ function countProgress(content) {
73192
73050
 
73193
73051
  // apps/cli/src/components/AgentMode.tsx
73194
73052
  init_log();
73195
- var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
73053
+ var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
73196
73054
  var lineCounter = 0;
73197
73055
  function nextId() {
73198
73056
  lineCounter += 1;
@@ -73250,28 +73108,28 @@ function LabeledBox({
73250
73108
  const dashes = Math.max(0, innerWidth - visualLen);
73251
73109
  const left = Math.floor(dashes / 2);
73252
73110
  const right = dashes - left;
73253
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73111
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73254
73112
  flexDirection: "column",
73255
73113
  width,
73256
73114
  children: [
73257
- labelNode ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73115
+ labelNode ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73258
73116
  flexDirection: "row",
73259
73117
  children: [
73260
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73118
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73261
73119
  color: borderColor,
73262
73120
  children: `\u256D${"\u2500".repeat(left)}`
73263
73121
  }, undefined, false, undefined, this),
73264
73122
  labelNode,
73265
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73123
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73266
73124
  color: borderColor,
73267
73125
  children: `${"\u2500".repeat(right)}\u256E`
73268
73126
  }, undefined, false, undefined, this)
73269
73127
  ]
73270
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73128
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73271
73129
  color: borderColor,
73272
73130
  children: `\u256D${"\u2500".repeat(left)} ${label ?? ""} ${"\u2500".repeat(right)}\u256E`
73273
73131
  }, undefined, false, undefined, this),
73274
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73132
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73275
73133
  borderStyle: "round",
73276
73134
  borderTop: false,
73277
73135
  borderColor,
@@ -73284,13 +73142,13 @@ function LabeledBox({
73284
73142
  }
73285
73143
  function Link({ url, label, color }) {
73286
73144
  if (!HYPERLINKS_SUPPORTED)
73287
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73145
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73288
73146
  color,
73289
73147
  children: label
73290
73148
  }, undefined, false, undefined, this);
73291
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Transform, {
73149
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Transform, {
73292
73150
  transform: (output) => `\x1B]8;;${url}\x07${output}\x1B]8;;\x07`,
73293
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73151
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73294
73152
  color,
73295
73153
  underline: true,
73296
73154
  children: label
@@ -73401,15 +73259,15 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73401
73259
  const { exit } = use_app_default();
73402
73260
  const { stdout } = use_stdout_default();
73403
73261
  const { isRawModeSupported } = use_stdin_default();
73404
- const [logs, setLogs] = import_react57.useState([]);
73405
- const [, setTick] = import_react57.useState(0);
73406
- const [clock, setClock] = import_react57.useState(0);
73407
- const [focusedIdx, setFocusedIdx] = import_react57.useState(0);
73408
- const coordRef = import_react57.useRef(null);
73409
- const workerMetaRef = import_react57.useRef(new Map);
73410
- const nextPollAtRef = import_react57.useRef(0);
73411
- const cfgRef = import_react57.useRef(null);
73412
- const [pollStatus, setPollStatus] = import_react57.useState({
73262
+ const [logs, setLogs] = import_react56.useState([]);
73263
+ const [, setTick] = import_react56.useState(0);
73264
+ const [clock, setClock] = import_react56.useState(0);
73265
+ const [focusedIdx, setFocusedIdx] = import_react56.useState(0);
73266
+ const coordRef = import_react56.useRef(null);
73267
+ const workerMetaRef = import_react56.useRef(new Map);
73268
+ const nextPollAtRef = import_react56.useRef(0);
73269
+ const cfgRef = import_react56.useRef(null);
73270
+ const [pollStatus, setPollStatus] = import_react56.useState({
73413
73271
  state: "idle",
73414
73272
  lastFound: null,
73415
73273
  lastAdded: null,
@@ -73421,7 +73279,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73421
73279
  setLogs((prev) => [...prev, { id: nextId(), text, color }]);
73422
73280
  logCoord(text, workerLogFile);
73423
73281
  }
73424
- import_react57.useEffect(() => {
73282
+ import_react56.useEffect(() => {
73425
73283
  let pollTimer = null;
73426
73284
  let cancelled = false;
73427
73285
  async function init2() {
@@ -73432,9 +73290,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73432
73290
  appendLog(`agent mode v${VERSION} \u2014 config: ${cfgPath}`, "gray");
73433
73291
  const apiKey = process.env["LINEAR_API_KEY"];
73434
73292
  if (!apiKey) {
73435
- appendLog("! LINEAR_API_KEY not set \u2014 cannot poll Linear", "red");
73436
- exit();
73437
- return;
73293
+ throw new Error("LINEAR_API_KEY not set \u2014 cannot poll Linear");
73438
73294
  }
73439
73295
  const { coord: coord2, filterDesc, concurrency, pollInterval } = buildAgentCoordinator({
73440
73296
  args,
@@ -73530,7 +73386,13 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73530
73386
  };
73531
73387
  tick();
73532
73388
  }
73533
- init2();
73389
+ init2().catch((err) => {
73390
+ appendLog(`! ${err instanceof Error ? err.message : String(err)}`, "red");
73391
+ setTimeout(() => {
73392
+ exit();
73393
+ setTimeout(() => process.exit(1), 200);
73394
+ }, 100);
73395
+ });
73534
73396
  let shuttingDown = false;
73535
73397
  const onSig = () => {
73536
73398
  if (shuttingDown) {
@@ -73575,7 +73437,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73575
73437
  process.off("SIGTERM", onSig);
73576
73438
  };
73577
73439
  }, []);
73578
- import_react57.useEffect(() => {
73440
+ import_react56.useEffect(() => {
73579
73441
  let cancelled = false;
73580
73442
  const interval = setInterval(() => {
73581
73443
  if (cancelled)
@@ -73583,7 +73445,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73583
73445
  (async () => {
73584
73446
  for (const [changeName, meta] of workerMetaRef.current) {
73585
73447
  try {
73586
- const file = Bun.file(join17(meta.statesDir, changeName, ".ralph-state.json"));
73448
+ const file = Bun.file(join16(meta.statesDir, changeName, ".ralph-state.json"));
73587
73449
  if (await file.exists()) {
73588
73450
  const json = await file.json();
73589
73451
  meta.iter = json.iteration ?? meta.iter;
@@ -73593,7 +73455,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73593
73455
  }
73594
73456
  if (meta.changeDir) {
73595
73457
  try {
73596
- const tasksFile = Bun.file(join17(meta.changeDir, "tasks.md"));
73458
+ const tasksFile = Bun.file(join16(meta.changeDir, "tasks.md"));
73597
73459
  if (await tasksFile.exists()) {
73598
73460
  const text = await tasksFile.text();
73599
73461
  const match = text.match(/^- \[ \] (.+)$/m);
@@ -73642,49 +73504,49 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73642
73504
  const FIXED_OVERHEAD = 5 + 5 + tasksBoxLines + 8 + nonFocusedCount * 4;
73643
73505
  const focusedTailLines = Math.max(3, termHeight - FIXED_OVERHEAD);
73644
73506
  const compactTailLines = displayTailLines(activeCount);
73645
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73507
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73646
73508
  flexDirection: "column",
73647
73509
  children: [
73648
- logs.length > 0 && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(LabeledBox, {
73510
+ logs.length > 0 && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(LabeledBox, {
73649
73511
  label: "LOGS",
73650
73512
  borderColor: "gray",
73651
73513
  flexDirection: "column",
73652
73514
  paddingX: 1,
73653
73515
  width: termWidth,
73654
- children: logs.slice(-5).map((line) => line.color ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73516
+ children: logs.slice(-5).map((line) => line.color ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73655
73517
  color: line.color,
73656
73518
  children: line.text
73657
- }, line.id, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73519
+ }, line.id, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73658
73520
  children: line.text
73659
73521
  }, line.id, false, undefined, this))
73660
73522
  }, undefined, false, undefined, this),
73661
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73523
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73662
73524
  flexDirection: "column",
73663
73525
  marginTop: 0,
73664
73526
  children: [
73665
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(LabeledBox, {
73527
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(LabeledBox, {
73666
73528
  label: "\u25C8 RALPH AGENT",
73667
73529
  borderColor: "blue",
73668
73530
  width: termWidth,
73669
73531
  paddingX: 1,
73670
73532
  flexDirection: "column",
73671
73533
  children: [
73672
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73534
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73673
73535
  children: [
73674
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73536
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73675
73537
  dimColor: true,
73676
73538
  children: [
73677
73539
  "v",
73678
73540
  VERSION
73679
73541
  ]
73680
73542
  }, undefined, true, undefined, this),
73681
- cfg && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73543
+ cfg && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73682
73544
  children: [
73683
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73545
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73684
73546
  dimColor: true,
73685
73547
  children: " \u2502 "
73686
73548
  }, undefined, false, undefined, this),
73687
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73549
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73688
73550
  color: "cyan",
73689
73551
  bold: true,
73690
73552
  children: [
@@ -73693,14 +73555,14 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73693
73555
  cfg.model
73694
73556
  ]
73695
73557
  }, undefined, true, undefined, this),
73696
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73558
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73697
73559
  dimColor: true,
73698
73560
  children: [
73699
73561
  " \u2502 \xD7",
73700
73562
  cfg.concurrency
73701
73563
  ]
73702
73564
  }, undefined, true, undefined, this),
73703
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73565
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73704
73566
  dimColor: true,
73705
73567
  children: [
73706
73568
  " \u2502 poll ",
@@ -73708,36 +73570,36 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73708
73570
  "s"
73709
73571
  ]
73710
73572
  }, undefined, true, undefined, this),
73711
- cfg.maxIterationsPerTask > 0 && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73573
+ cfg.maxIterationsPerTask > 0 && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73712
73574
  color: "yellow",
73713
73575
  children: [
73714
73576
  " \u2502 iter \u2264",
73715
73577
  cfg.maxIterationsPerTask
73716
73578
  ]
73717
73579
  }, undefined, true, undefined, this),
73718
- cfg.maxCostUsdPerTask > 0 && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73580
+ cfg.maxCostUsdPerTask > 0 && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73719
73581
  color: "yellow",
73720
73582
  children: [
73721
73583
  " \u2502 cost \u2264$",
73722
73584
  cfg.maxCostUsdPerTask
73723
73585
  ]
73724
73586
  }, undefined, true, undefined, this),
73725
- args.maxTickets > 0 && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73587
+ args.maxTickets > 0 && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73726
73588
  color: "yellow",
73727
73589
  children: [
73728
73590
  " \u2502 tickets \u2264",
73729
73591
  args.maxTickets
73730
73592
  ]
73731
73593
  }, undefined, true, undefined, this),
73732
- cfg.createPrOnSuccess && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73594
+ cfg.createPrOnSuccess && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73733
73595
  color: "green",
73734
73596
  children: " \u25CF PR"
73735
73597
  }, undefined, false, undefined, this),
73736
- cfg.fixCiOnFailure && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73598
+ cfg.fixCiOnFailure && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73737
73599
  color: "green",
73738
73600
  children: " \u25CF fixCI"
73739
73601
  }, undefined, false, undefined, this),
73740
- cfg.useWorktree && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73602
+ cfg.useWorktree && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73741
73603
  color: "green",
73742
73604
  children: " \u25CF worktree"
73743
73605
  }, undefined, false, undefined, this)
@@ -73757,7 +73619,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73757
73619
  lines.push(remaining.slice(0, budget));
73758
73620
  remaining = remaining.slice(budget);
73759
73621
  }
73760
- return lines.map((segment, i) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73622
+ return lines.map((segment, i) => /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73761
73623
  dimColor: true,
73762
73624
  children: [
73763
73625
  i === 0 ? prefix : indent,
@@ -73767,105 +73629,105 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73767
73629
  })()
73768
73630
  ]
73769
73631
  }, undefined, true, undefined, this),
73770
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73632
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73771
73633
  flexDirection: "row",
73772
73634
  gap: 1,
73773
73635
  marginTop: 0,
73774
73636
  width: termWidth,
73775
73637
  children: [
73776
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(LabeledBox, {
73638
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(LabeledBox, {
73777
73639
  label: "POLL STATUS",
73778
73640
  borderColor: "gray",
73779
73641
  width: termWidth - 13,
73780
73642
  paddingX: 1,
73781
73643
  flexDirection: "column",
73782
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73644
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73783
73645
  gap: 2,
73784
73646
  children: [
73785
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73647
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73786
73648
  color: "gray",
73787
73649
  children: spinnerFrame
73788
73650
  }, undefined, false, undefined, this),
73789
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73651
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73790
73652
  children: pollStatus.state === "polling" ? "Polling Linear\u2026" : pollStatus.lastAt !== null ? "Idle" : "Starting\u2026"
73791
73653
  }, undefined, false, undefined, this),
73792
- pollStatus.lastAt !== null && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
73654
+ pollStatus.lastAt !== null && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
73793
73655
  children: [
73794
- pollStatus.lastBuckets && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
73656
+ pollStatus.lastBuckets && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
73795
73657
  children: [
73796
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73658
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73797
73659
  dimColor: true,
73798
73660
  children: "\u2502"
73799
73661
  }, undefined, false, undefined, this),
73800
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73662
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73801
73663
  dimColor: true,
73802
73664
  children: "todo"
73803
73665
  }, undefined, false, undefined, this),
73804
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73666
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73805
73667
  color: "white",
73806
73668
  children: pollStatus.lastBuckets.todo
73807
73669
  }, undefined, false, undefined, this),
73808
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73670
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73809
73671
  dimColor: true,
73810
73672
  children: "\xB7"
73811
73673
  }, undefined, false, undefined, this),
73812
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73674
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73813
73675
  dimColor: true,
73814
73676
  children: "res"
73815
73677
  }, undefined, false, undefined, this),
73816
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73678
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73817
73679
  color: pollStatus.lastBuckets.inProgress > 0 ? "cyan" : "white",
73818
73680
  children: pollStatus.lastBuckets.inProgress
73819
73681
  }, undefined, false, undefined, this),
73820
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73682
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73821
73683
  dimColor: true,
73822
73684
  children: "\xB7"
73823
73685
  }, undefined, false, undefined, this),
73824
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73686
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73825
73687
  dimColor: true,
73826
73688
  children: "conf"
73827
73689
  }, undefined, false, undefined, this),
73828
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73690
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73829
73691
  color: pollStatus.lastBuckets.conflicted > 0 ? "red" : "white",
73830
73692
  children: pollStatus.lastBuckets.conflicted
73831
73693
  }, undefined, false, undefined, this),
73832
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73694
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73833
73695
  dimColor: true,
73834
73696
  children: "\xB7"
73835
73697
  }, undefined, false, undefined, this),
73836
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73698
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73837
73699
  dimColor: true,
73838
73700
  children: "rev"
73839
73701
  }, undefined, false, undefined, this),
73840
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73702
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73841
73703
  color: pollStatus.lastBuckets.review > 0 ? "yellow" : "white",
73842
73704
  children: pollStatus.lastBuckets.review
73843
73705
  }, undefined, false, undefined, this),
73844
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73706
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73845
73707
  dimColor: true,
73846
73708
  children: "\xB7"
73847
73709
  }, undefined, false, undefined, this),
73848
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73710
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73849
73711
  dimColor: true,
73850
73712
  children: "@"
73851
73713
  }, undefined, false, undefined, this),
73852
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73714
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73853
73715
  color: pollStatus.lastBuckets.mentions > 0 ? "magenta" : "white",
73854
73716
  children: pollStatus.lastBuckets.mentions
73855
73717
  }, undefined, false, undefined, this)
73856
73718
  ]
73857
73719
  }, undefined, true, undefined, this),
73858
- secsToNextPoll !== null && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
73720
+ secsToNextPoll !== null && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
73859
73721
  children: [
73860
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73722
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73861
73723
  dimColor: true,
73862
73724
  children: "\u2502"
73863
73725
  }, undefined, false, undefined, this),
73864
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73726
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73865
73727
  dimColor: true,
73866
73728
  children: "\u21BA"
73867
73729
  }, undefined, false, undefined, this),
73868
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73730
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73869
73731
  color: "gray",
73870
73732
  children: [
73871
73733
  secsToNextPoll,
@@ -73879,37 +73741,37 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73879
73741
  ]
73880
73742
  }, undefined, true, undefined, this)
73881
73743
  }, undefined, false, undefined, this),
73882
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(LabeledBox, {
73744
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(LabeledBox, {
73883
73745
  label: "WORKERS",
73884
73746
  borderColor: "gray",
73885
73747
  width: 12,
73886
73748
  paddingX: 1,
73887
73749
  flexDirection: "column",
73888
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73750
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73889
73751
  gap: 2,
73890
73752
  children: [
73891
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73753
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73892
73754
  gap: 1,
73893
73755
  children: [
73894
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73756
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73895
73757
  dimColor: true,
73896
73758
  children: "A"
73897
73759
  }, undefined, false, undefined, this),
73898
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73760
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73899
73761
  color: activeCount > 0 ? "cyan" : "gray",
73900
73762
  bold: true,
73901
73763
  children: activeCount
73902
73764
  }, undefined, false, undefined, this)
73903
73765
  ]
73904
73766
  }, undefined, true, undefined, this),
73905
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73767
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73906
73768
  gap: 1,
73907
73769
  children: [
73908
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73770
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73909
73771
  dimColor: true,
73910
73772
  children: "Q"
73911
73773
  }, undefined, false, undefined, this),
73912
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73774
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73913
73775
  color: coord?.queuedCount ?? 0 > 0 ? "yellow" : "gray",
73914
73776
  bold: true,
73915
73777
  children: coord?.queuedCount ?? 0
@@ -73921,13 +73783,13 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73921
73783
  }, undefined, false, undefined, this)
73922
73784
  ]
73923
73785
  }, undefined, true, undefined, this),
73924
- activeCount > 1 && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(LabeledBox, {
73786
+ activeCount > 1 && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(LabeledBox, {
73925
73787
  label: `TASKS${activeCount > 1 ? " Tab/\u2190 \u2192 \xB7 1-9" : ""}`,
73926
73788
  borderColor: "gray",
73927
73789
  width: termWidth,
73928
73790
  paddingX: 1,
73929
73791
  flexDirection: "column",
73930
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73792
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73931
73793
  gap: 3,
73932
73794
  flexWrap: "wrap",
73933
73795
  children: coord?.activeWorkers.map((w, idx) => {
@@ -73935,10 +73797,10 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73935
73797
  const phase = meta?.phase ?? "working";
73936
73798
  const pBadge = priorityBadge(w.issue.priority);
73937
73799
  const isFocused = idx === safeFocusedIdx;
73938
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73800
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73939
73801
  gap: 1,
73940
73802
  children: [
73941
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73803
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73942
73804
  color: isFocused ? "white" : "gray",
73943
73805
  bold: isFocused,
73944
73806
  children: [
@@ -73947,7 +73809,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73947
73809
  "]"
73948
73810
  ]
73949
73811
  }, undefined, true, undefined, this),
73950
- pBadge.label && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73812
+ pBadge.label && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73951
73813
  color: pBadge.color,
73952
73814
  children: [
73953
73815
  pBadge.text,
@@ -73955,17 +73817,17 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73955
73817
  pBadge.label
73956
73818
  ]
73957
73819
  }, undefined, true, undefined, this),
73958
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Link, {
73820
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Link, {
73959
73821
  url: w.issue.url,
73960
73822
  label: w.issueIdentifier,
73961
73823
  color: isFocused ? "cyan" : "gray"
73962
73824
  }, undefined, false, undefined, this),
73963
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73825
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73964
73826
  color: phaseColor(phase),
73965
73827
  dimColor: !isFocused,
73966
73828
  children: phase
73967
73829
  }, undefined, false, undefined, this),
73968
- isFocused && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73830
+ isFocused && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73969
73831
  color: "white",
73970
73832
  children: "\u25C0"
73971
73833
  }, undefined, false, undefined, this)
@@ -73994,33 +73856,33 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73994
73856
  const visibleTailLines = isFocused ? focusedTailLines : compactTailLines;
73995
73857
  if (!isFocused && activeCount > 1) {
73996
73858
  const cardLabelWidth2 = (prUrl ? prLabel(prUrl).length + 3 : 0) + w.issueIdentifier.length + 2;
73997
- const cardLabelNode2 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
73859
+ const cardLabelNode2 = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
73998
73860
  children: [
73999
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73861
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74000
73862
  color: "gray",
74001
73863
  children: " "
74002
73864
  }, undefined, false, undefined, this),
74003
- prUrl && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Link, {
73865
+ prUrl && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Link, {
74004
73866
  url: prUrl,
74005
73867
  label: prLabel(prUrl),
74006
73868
  color: "green"
74007
73869
  }, undefined, false, undefined, this),
74008
- prUrl && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73870
+ prUrl && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74009
73871
  color: "gray",
74010
73872
  children: " \xB7 "
74011
73873
  }, undefined, false, undefined, this),
74012
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Link, {
73874
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Link, {
74013
73875
  url: w.issue.url,
74014
73876
  label: w.issueIdentifier,
74015
73877
  color: "cyan"
74016
73878
  }, undefined, false, undefined, this),
74017
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73879
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74018
73880
  color: "gray",
74019
73881
  children: " "
74020
73882
  }, undefined, false, undefined, this)
74021
73883
  ]
74022
73884
  }, undefined, true, undefined, this);
74023
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(LabeledBox, {
73885
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(LabeledBox, {
74024
73886
  labelNode: cardLabelNode2,
74025
73887
  labelVisualWidth: cardLabelWidth2,
74026
73888
  borderColor: "gray",
@@ -74028,7 +73890,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
74028
73890
  gap: 2,
74029
73891
  width: termWidth,
74030
73892
  children: [
74031
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73893
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74032
73894
  dimColor: true,
74033
73895
  children: [
74034
73896
  "[",
@@ -74036,54 +73898,54 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
74036
73898
  "]"
74037
73899
  ]
74038
73900
  }, undefined, true, undefined, this),
74039
- pBadge.label && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73901
+ pBadge.label && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74040
73902
  color: pBadge.color,
74041
73903
  children: pBadge.text
74042
73904
  }, undefined, false, undefined, this),
74043
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73905
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74044
73906
  color: "gray",
74045
73907
  bold: true,
74046
73908
  children: w.issueIdentifier
74047
73909
  }, undefined, false, undefined, this),
74048
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73910
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74049
73911
  dimColor: true,
74050
73912
  children: trunc(w.issue.title, 40)
74051
73913
  }, undefined, false, undefined, this),
74052
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73914
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74053
73915
  dimColor: true,
74054
73916
  children: "\u2502"
74055
73917
  }, undefined, false, undefined, this),
74056
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73918
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74057
73919
  color: pColor,
74058
73920
  dimColor: true,
74059
73921
  children: phase
74060
73922
  }, undefined, false, undefined, this),
74061
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73923
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74062
73924
  dimColor: true,
74063
73925
  children: "\u2502"
74064
73926
  }, undefined, false, undefined, this),
74065
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73927
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74066
73928
  dimColor: true,
74067
73929
  children: elapsed
74068
73930
  }, undefined, false, undefined, this),
74069
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73931
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74070
73932
  dimColor: true,
74071
73933
  children: "\xB7"
74072
73934
  }, undefined, false, undefined, this),
74073
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73935
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74074
73936
  dimColor: true,
74075
73937
  children: [
74076
73938
  "iter ",
74077
73939
  iter
74078
73940
  ]
74079
73941
  }, undefined, true, undefined, this),
74080
- currentTask && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
73942
+ currentTask && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
74081
73943
  children: [
74082
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73944
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74083
73945
  dimColor: true,
74084
73946
  children: "\u2502"
74085
73947
  }, undefined, false, undefined, this),
74086
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73948
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74087
73949
  dimColor: true,
74088
73950
  children: [
74089
73951
  "\u25B6 ",
@@ -74096,33 +73958,33 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
74096
73958
  }, w.changeName, true, undefined, this);
74097
73959
  }
74098
73960
  const cardLabelWidth = (prUrl ? prLabel(prUrl).length + 3 : 0) + w.issueIdentifier.length + 2;
74099
- const cardLabelNode = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
73961
+ const cardLabelNode = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
74100
73962
  children: [
74101
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73963
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74102
73964
  color: bColor,
74103
73965
  children: " "
74104
73966
  }, undefined, false, undefined, this),
74105
- prUrl && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Link, {
73967
+ prUrl && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Link, {
74106
73968
  url: prUrl,
74107
73969
  label: prLabel(prUrl),
74108
73970
  color: "green"
74109
73971
  }, undefined, false, undefined, this),
74110
- prUrl && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73972
+ prUrl && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74111
73973
  color: bColor,
74112
73974
  children: " \xB7 "
74113
73975
  }, undefined, false, undefined, this),
74114
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Link, {
73976
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Link, {
74115
73977
  url: w.issue.url,
74116
73978
  label: w.issueIdentifier,
74117
73979
  color: "cyan"
74118
73980
  }, undefined, false, undefined, this),
74119
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73981
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74120
73982
  color: bColor,
74121
73983
  children: " "
74122
73984
  }, undefined, false, undefined, this)
74123
73985
  ]
74124
73986
  }, undefined, true, undefined, this);
74125
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(LabeledBox, {
73987
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(LabeledBox, {
74126
73988
  labelNode: cardLabelNode,
74127
73989
  labelVisualWidth: cardLabelWidth,
74128
73990
  borderColor: bColor,
@@ -74130,18 +73992,18 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
74130
73992
  paddingX: 1,
74131
73993
  width: termWidth,
74132
73994
  children: [
74133
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73995
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
74134
73996
  gap: 2,
74135
73997
  children: [
74136
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73998
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74137
73999
  children: spinnerFrame
74138
74000
  }, undefined, false, undefined, this),
74139
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74001
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74140
74002
  color: "white",
74141
74003
  bold: true,
74142
74004
  children: trunc(w.issue.title, Math.max(20, termWidth - 55))
74143
74005
  }, undefined, false, undefined, this),
74144
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74006
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74145
74007
  color: mBadge.color,
74146
74008
  bold: true,
74147
74009
  children: [
@@ -74150,7 +74012,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
74150
74012
  "]"
74151
74013
  ]
74152
74014
  }, undefined, true, undefined, this),
74153
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74015
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74154
74016
  color: pColor,
74155
74017
  bold: true,
74156
74018
  children: [
@@ -74158,35 +74020,26 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
74158
74020
  phaseDetail ? ` (${phaseDetail})` : ""
74159
74021
  ]
74160
74022
  }, undefined, true, undefined, this),
74161
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74023
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74162
74024
  dimColor: true,
74163
74025
  children: "\u2502"
74164
74026
  }, undefined, false, undefined, this),
74165
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74027
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74166
74028
  color: "white",
74167
74029
  children: elapsed
74168
74030
  }, undefined, false, undefined, this),
74169
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74031
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74170
74032
  dimColor: true,
74171
74033
  children: "\u2502"
74172
74034
  }, undefined, false, undefined, this),
74173
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74035
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74174
74036
  dimColor: true,
74175
74037
  children: "\u21BA"
74176
74038
  }, undefined, false, undefined, this),
74177
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74039
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74178
74040
  color: "white",
74179
74041
  bold: true,
74180
74042
  children: iter
74181
- }, undefined, false, undefined, this),
74182
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74183
- dimColor: true,
74184
- children: "\u2502"
74185
- }, undefined, false, undefined, this),
74186
- meta?.logFile && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Link, {
74187
- url: pathToFileURL(meta.logFile).href,
74188
- label: "LOG",
74189
- color: "gray"
74190
74043
  }, undefined, false, undefined, this)
74191
74044
  ]
74192
74045
  }, undefined, true, undefined, this),
@@ -74195,86 +74048,86 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
74195
74048
  if (!bar)
74196
74049
  return null;
74197
74050
  const { countStr, filledLeft, leftSlot, filledRight, rightSlot } = bar;
74198
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
74051
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
74199
74052
  marginTop: 0,
74200
74053
  children: [
74201
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74054
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74202
74055
  dimColor: true,
74203
74056
  children: "["
74204
74057
  }, undefined, false, undefined, this),
74205
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74058
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74206
74059
  color: "green",
74207
74060
  children: "\u2588".repeat(filledLeft)
74208
74061
  }, undefined, false, undefined, this),
74209
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74062
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74210
74063
  dimColor: true,
74211
74064
  children: "\u2591".repeat(leftSlot - filledLeft)
74212
74065
  }, undefined, false, undefined, this),
74213
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74066
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74214
74067
  color: "white",
74215
74068
  bold: true,
74216
74069
  children: countStr
74217
74070
  }, undefined, false, undefined, this),
74218
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74071
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74219
74072
  color: "green",
74220
74073
  children: "\u2588".repeat(filledRight)
74221
74074
  }, undefined, false, undefined, this),
74222
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74075
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74223
74076
  dimColor: true,
74224
74077
  children: "\u2591".repeat(rightSlot - filledRight)
74225
74078
  }, undefined, false, undefined, this),
74226
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74079
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74227
74080
  dimColor: true,
74228
74081
  children: "]"
74229
74082
  }, undefined, false, undefined, this)
74230
74083
  ]
74231
74084
  }, undefined, true, undefined, this);
74232
74085
  })(),
74233
- currentTask && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
74086
+ currentTask && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
74234
74087
  gap: 1,
74235
74088
  marginTop: 0,
74236
74089
  children: [
74237
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74090
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74238
74091
  color: "yellow",
74239
74092
  bold: true,
74240
74093
  children: "\u25B6 TASK"
74241
74094
  }, undefined, false, undefined, this),
74242
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74095
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74243
74096
  color: "white",
74244
74097
  children: trunc(currentTask, termWidth - 14)
74245
74098
  }, undefined, false, undefined, this)
74246
74099
  ]
74247
74100
  }, undefined, true, undefined, this),
74248
- cmd && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
74101
+ cmd && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
74249
74102
  gap: 1,
74250
74103
  marginTop: 0,
74251
74104
  children: [
74252
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74105
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74253
74106
  color: "yellow",
74254
74107
  children: "\u23F5 CMD"
74255
74108
  }, undefined, false, undefined, this),
74256
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74109
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74257
74110
  color: "yellow",
74258
74111
  children: fmtCmd(cmd.argv)
74259
74112
  }, undefined, false, undefined, this),
74260
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74113
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74261
74114
  dimColor: true,
74262
74115
  children: cmdElapsed
74263
74116
  }, undefined, false, undefined, this)
74264
74117
  ]
74265
74118
  }, undefined, true, undefined, this),
74266
- tail2.length > 0 && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
74119
+ tail2.length > 0 && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
74267
74120
  flexDirection: "column",
74268
74121
  marginTop: 0,
74269
74122
  children: [
74270
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74123
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74271
74124
  dimColor: true,
74272
74125
  children: [
74273
74126
  "\u2500 OUTPUT ",
74274
74127
  "\u2500".repeat(Math.max(4, termWidth - 14))
74275
74128
  ]
74276
74129
  }, undefined, true, undefined, this),
74277
- tail2.slice(-visibleTailLines).map((line, i) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74130
+ tail2.slice(-visibleTailLines).map((line, i) => /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74278
74131
  dimColor: true,
74279
74132
  children: [
74280
74133
  "\u2502 ",
@@ -74293,11 +74146,11 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
74293
74146
  }
74294
74147
 
74295
74148
  // packages/openspec/src/openspec-change-store.ts
74296
- import { dirname as dirname6, join as join19 } from "path";
74149
+ import { dirname as dirname6, join as join18 } from "path";
74297
74150
  import { readdir, mkdir as mkdir5 } from "fs/promises";
74298
74151
 
74299
74152
  // packages/openspec/src/openspec-bin.ts
74300
- import { dirname as dirname5, join as join18 } from "path";
74153
+ import { dirname as dirname5, join as join17 } from "path";
74301
74154
  var bunInstallRunner = {
74302
74155
  spawnSync: (cmd, cwd2) => {
74303
74156
  const proc = Bun.spawnSync({
@@ -74315,9 +74168,9 @@ var bunInstallRunner = {
74315
74168
  function findPackageRoot(startDir) {
74316
74169
  let dir = startDir;
74317
74170
  for (let i = 0;i < 8; i++) {
74318
- if (Bun.file(join18(dir, "package.json")).size >= 0) {
74171
+ if (Bun.file(join17(dir, "package.json")).size >= 0) {
74319
74172
  try {
74320
- if (Bun.file(join18(dir, "package.json")).size > 0)
74173
+ if (Bun.file(join17(dir, "package.json")).size > 0)
74321
74174
  return dir;
74322
74175
  } catch {}
74323
74176
  }
@@ -74353,11 +74206,11 @@ function ensureOpenspecInstalled(fromDir, runner) {
74353
74206
  function resolveOpenspecBin(fromDir, runner = bunInstallRunner) {
74354
74207
  try {
74355
74208
  const pkgJsonPath = runner.resolveSync("@fission-ai/openspec/package.json", fromDir);
74356
- return join18(dirname5(pkgJsonPath), "bin", "openspec.js");
74209
+ return join17(dirname5(pkgJsonPath), "bin", "openspec.js");
74357
74210
  } catch {
74358
74211
  ensureOpenspecInstalled(fromDir, runner);
74359
74212
  const pkgJsonPath = runner.resolveSync("@fission-ai/openspec/package.json", fromDir);
74360
- return join18(dirname5(pkgJsonPath), "bin", "openspec.js");
74213
+ return join17(dirname5(pkgJsonPath), "bin", "openspec.js");
74361
74214
  }
74362
74215
  }
74363
74216
 
@@ -74386,7 +74239,7 @@ class OpenSpecChangeStore {
74386
74239
  }
74387
74240
  }
74388
74241
  getChangeDirectory(name) {
74389
- return join19("openspec", "changes", name);
74242
+ return join18("openspec", "changes", name);
74390
74243
  }
74391
74244
  async listChanges() {
74392
74245
  const result2 = runOpenspec(["list", "--json"]);
@@ -74400,7 +74253,7 @@ class OpenSpecChangeStore {
74400
74253
  }
74401
74254
  } catch {}
74402
74255
  }
74403
- const changesDir = join19("openspec", "changes");
74256
+ const changesDir = join18("openspec", "changes");
74404
74257
  if (!await Bun.file(changesDir).exists())
74405
74258
  return [];
74406
74259
  try {
@@ -74411,18 +74264,18 @@ class OpenSpecChangeStore {
74411
74264
  }
74412
74265
  }
74413
74266
  async readTaskList(name) {
74414
- const file = Bun.file(join19("openspec", "changes", name, "tasks.md"));
74267
+ const file = Bun.file(join18("openspec", "changes", name, "tasks.md"));
74415
74268
  if (!await file.exists())
74416
74269
  return "";
74417
74270
  return await file.text();
74418
74271
  }
74419
74272
  async writeTaskList(name, content) {
74420
- const path = join19("openspec", "changes", name, "tasks.md");
74273
+ const path = join18("openspec", "changes", name, "tasks.md");
74421
74274
  await mkdir5(dirname6(path), { recursive: true });
74422
74275
  await Bun.write(path, content);
74423
74276
  }
74424
74277
  async appendSteering(name, message) {
74425
- const path = join19("openspec", "changes", name, "steering.md");
74278
+ const path = join18("openspec", "changes", name, "steering.md");
74426
74279
  const file = Bun.file(path);
74427
74280
  const existing = await file.exists() ? await file.text() : null;
74428
74281
  const updated = existing ? `${message}
@@ -74433,7 +74286,7 @@ ${existing.trimStart()}` : `${message}
74433
74286
  await Bun.write(path, updated);
74434
74287
  }
74435
74288
  async readSection(name, artifact, heading) {
74436
- const file = Bun.file(join19("openspec", "changes", name, artifact));
74289
+ const file = Bun.file(join18("openspec", "changes", name, artifact));
74437
74290
  if (!await file.exists())
74438
74291
  return "";
74439
74292
  const content = await file.text();
@@ -74475,43 +74328,43 @@ ${existing.trimStart()}` : `${message}
74475
74328
  }
74476
74329
  // apps/cli/src/components/App.tsx
74477
74330
  init_config();
74478
- var jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
74331
+ var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
74479
74332
  function ExitAfterRender({ children }) {
74480
74333
  const { exit } = use_app_default();
74481
- import_react58.useEffect(() => {
74334
+ import_react57.useEffect(() => {
74482
74335
  exit();
74483
74336
  }, [exit]);
74484
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
74337
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
74485
74338
  children
74486
74339
  }, undefined, false, undefined, this);
74487
74340
  }
74488
74341
  function ErrorMessage({ message }) {
74489
74342
  const { exit } = use_app_default();
74490
- import_react58.useEffect(() => {
74343
+ import_react57.useEffect(() => {
74491
74344
  process.exitCode = 1;
74492
74345
  exit();
74493
74346
  }, [exit]);
74494
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
74347
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74495
74348
  color: "red",
74496
74349
  children: message
74497
74350
  }, undefined, false, undefined, this);
74498
74351
  }
74499
74352
  function TaskModeWrapper({ args, statesDir, tasksDir, projectRoot }) {
74500
- const [config, setConfig] = import_react58.useState(null);
74501
- const [error, setError] = import_react58.useState(null);
74502
- import_react58.useEffect(() => {
74353
+ const [config, setConfig] = import_react57.useState(null);
74354
+ const [error, setError] = import_react57.useState(null);
74355
+ import_react57.useEffect(() => {
74503
74356
  loadRalphyConfig(projectRoot).then((cfg) => setConfig({ manualTest: cfg.enableManualTest })).catch((err) => setError(err.message));
74504
74357
  }, [projectRoot]);
74505
74358
  if (error) {
74506
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ErrorMessage, {
74359
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ErrorMessage, {
74507
74360
  message: `Error loading config: ${error}`
74508
74361
  }, undefined, false, undefined, this);
74509
74362
  }
74510
74363
  if (!config) {
74511
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {}, undefined, false, undefined, this);
74364
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {}, undefined, false, undefined, this);
74512
74365
  }
74513
74366
  const manualTest = args.manualTest || config.manualTest;
74514
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(TaskLoop, {
74367
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(TaskLoop, {
74515
74368
  opts: {
74516
74369
  name: args.name,
74517
74370
  prompt: args.prompt,
@@ -74535,12 +74388,11 @@ function TaskModeWrapper({ args, statesDir, tasksDir, projectRoot }) {
74535
74388
  function App2({ args, statesDir, tasksDir, projectRoot }) {
74536
74389
  switch (args.mode) {
74537
74390
  case "list":
74538
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(TaskList, {
74539
- statesDir,
74540
- projectRoot
74391
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ExitAfterRender, {
74392
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {}, undefined, false, undefined, this)
74541
74393
  }, undefined, false, undefined, this);
74542
74394
  case "agent":
74543
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(AgentMode, {
74395
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(AgentMode, {
74544
74396
  args,
74545
74397
  projectRoot,
74546
74398
  statesDir,
@@ -74548,43 +74400,43 @@ function App2({ args, statesDir, tasksDir, projectRoot }) {
74548
74400
  }, undefined, false, undefined, this);
74549
74401
  case "status": {
74550
74402
  if (!args.name) {
74551
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ErrorMessage, {
74403
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ErrorMessage, {
74552
74404
  message: "Error: --name is required for status mode"
74553
74405
  }, undefined, false, undefined, this);
74554
74406
  }
74555
- const stateDir = join20(statesDir, args.name);
74556
- if (getStorage().read(join20(stateDir, ".ralph-state.json")) === null) {
74557
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ErrorMessage, {
74407
+ const stateDir = join19(statesDir, args.name);
74408
+ if (getStorage().read(join19(stateDir, ".ralph-state.json")) === null) {
74409
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ErrorMessage, {
74558
74410
  message: `Error: change '${args.name}' not found`
74559
74411
  }, undefined, false, undefined, this);
74560
74412
  }
74561
74413
  const state = readState(stateDir);
74562
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ExitAfterRender, {
74563
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(TaskStatus, {
74414
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ExitAfterRender, {
74415
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(TaskStatus, {
74564
74416
  state,
74565
74417
  stateDir
74566
74418
  }, undefined, false, undefined, this)
74567
74419
  }, undefined, false, undefined, this);
74568
74420
  }
74569
74421
  case "init":
74570
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ExitAfterRender, {
74571
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
74422
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ExitAfterRender, {
74423
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74572
74424
  color: "green",
74573
74425
  children: "Initialized openspec directory"
74574
74426
  }, undefined, false, undefined, this)
74575
74427
  }, undefined, false, undefined, this);
74576
74428
  case "clean":
74577
74429
  case "debug":
74578
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ExitAfterRender, {
74579
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {}, undefined, false, undefined, this)
74430
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ExitAfterRender, {
74431
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {}, undefined, false, undefined, this)
74580
74432
  }, undefined, false, undefined, this);
74581
74433
  case "task": {
74582
74434
  if (!args.name) {
74583
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ErrorMessage, {
74435
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ErrorMessage, {
74584
74436
  message: "Error: --name is required for task mode"
74585
74437
  }, undefined, false, undefined, this);
74586
74438
  }
74587
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(TaskModeWrapper, {
74439
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(TaskModeWrapper, {
74588
74440
  args,
74589
74441
  statesDir,
74590
74442
  tasksDir,
@@ -74600,7 +74452,7 @@ init_worktree();
74600
74452
 
74601
74453
  // apps/cli/src/debug.ts
74602
74454
  init_log();
74603
- import { join as join21 } from "path";
74455
+ import { join as join20 } from "path";
74604
74456
  function fmtTs(d) {
74605
74457
  return d.toISOString().replace("T", " ").slice(0, 23);
74606
74458
  }
@@ -74713,7 +74565,7 @@ function detectStuck(lines) {
74713
74565
  };
74714
74566
  }
74715
74567
  async function inspectBinary(projectRoot) {
74716
- const binPath = join21(projectRoot, ".ralph", "bin", "cli.js");
74568
+ const binPath = join20(projectRoot, ".ralph", "bin", "cli.js");
74717
74569
  const file = Bun.file(binPath);
74718
74570
  if (!await file.exists())
74719
74571
  return null;
@@ -74739,7 +74591,7 @@ var SPAWN_RE = /\u25B6 (\S+) \u2192 (\S+)/;
74739
74591
  async function resolveDebugTarget(projectRoot, opts) {
74740
74592
  const agentLogFile = Bun.file(AGENT_LOG_PATH);
74741
74593
  const textLines = await agentLogFile.exists() ? parseTextLog(await agentLogFile.text()) : [];
74742
- const jsonlLogFile = Bun.file(join21(projectRoot, ".ralph", "agent.log"));
74594
+ const jsonlLogFile = Bun.file(join20(projectRoot, ".ralph", "agent.log"));
74743
74595
  const jsonlLines = await jsonlLogFile.exists() ? parseJsonlLog(await jsonlLogFile.text()) : [];
74744
74596
  const allLines = [...textLines, ...jsonlLines];
74745
74597
  if (opts.name && !opts.issue) {
@@ -74844,7 +74696,7 @@ async function runDebug(opts) {
74844
74696
  `);
74845
74697
  const agentLogFile = Bun.file(AGENT_LOG_PATH);
74846
74698
  const textLines = await agentLogFile.exists() ? parseTextLog(await agentLogFile.text()) : [];
74847
- const jsonlLogPath = join21(projectRoot, ".ralph", "agent.log");
74699
+ const jsonlLogPath = join20(projectRoot, ".ralph", "agent.log");
74848
74700
  const jsonlLogFile = Bun.file(jsonlLogPath);
74849
74701
  const hasJsonlLog = await jsonlLogFile.exists();
74850
74702
  let { changeName, identifier: issueIdentifier } = await resolveDebugTarget(projectRoot, {
@@ -74858,7 +74710,7 @@ async function runDebug(opts) {
74858
74710
  }
74859
74711
  const jsonlLines = hasJsonlLog ? parseJsonlLog(await jsonlLogFile.text(), changeName) : [];
74860
74712
  const relevantText = textLines.filter((l) => l.text.includes(changeName) || issueIdentifier !== undefined && l.text.includes(issueIdentifier));
74861
- const workerLogFile = Bun.file(join21(projectRoot, ".ralph", "logs", `${changeName}.log`));
74713
+ const workerLogFile = Bun.file(join20(projectRoot, ".ralph", "logs", `${changeName}.log`));
74862
74714
  const workerLines = await workerLogFile.exists() ? parseTextLog(await workerLogFile.text()) : [];
74863
74715
  const merged = [...relevantText, ...jsonlLines, ...workerLines].sort((a, b) => +a.ts - +b.ts);
74864
74716
  const seen = new Set;
@@ -75015,8 +74867,8 @@ async function runDebug(opts) {
75015
74867
  out(" \u26A0 PR currently has merge conflicts");
75016
74868
  if (pr?.checks.some((c) => c.conclusion === "FAILURE"))
75017
74869
  out(" \u26A0 PR has failing CI checks");
75018
- const worktreePath = join21(projectRoot, ".ralph", "worktrees", changeName);
75019
- if (await Bun.file(join21(worktreePath, ".git")).exists()) {
74870
+ const worktreePath = join20(projectRoot, ".ralph", "worktrees", changeName);
74871
+ if (await Bun.file(join20(worktreePath, ".git")).exists()) {
75020
74872
  out(` Worktree : ${worktreePath}`);
75021
74873
  }
75022
74874
  if (!timeline.length)
@@ -75024,6 +74876,378 @@ async function runDebug(opts) {
75024
74876
  out("");
75025
74877
  }
75026
74878
 
74879
+ // apps/cli/src/list.ts
74880
+ import { join as join21 } from "path";
74881
+ init_types2();
74882
+ init_worktree();
74883
+ init_config();
74884
+ function countTaskItems(content) {
74885
+ const checked = (content.match(/^- \[x\]/gm) ?? []).length;
74886
+ const unchecked = (content.match(/^- \[ \]/gm) ?? []).length;
74887
+ return { checked, unchecked };
74888
+ }
74889
+ function buildLocalRows(statesDir, projectRoot) {
74890
+ const storage = getStorage();
74891
+ const rows = [];
74892
+ const seen = new Set;
74893
+ const sources = [{ dir: statesDir, label: "main" }];
74894
+ const worktreesRoot = worktreesDir(projectRoot);
74895
+ for (const wt of storage.list(worktreesRoot)) {
74896
+ sources.push({ dir: join21(worktreesRoot, wt, ".ralph", "tasks"), label: `wt:${wt}` });
74897
+ }
74898
+ for (const { dir, label } of sources) {
74899
+ for (const entry of storage.list(dir)) {
74900
+ if (seen.has(entry))
74901
+ continue;
74902
+ const raw = storage.read(join21(dir, entry, ".ralph-state.json"));
74903
+ if (raw === null)
74904
+ continue;
74905
+ let state;
74906
+ try {
74907
+ state = JSON.parse(raw);
74908
+ } catch {
74909
+ continue;
74910
+ }
74911
+ if (String(state.status ?? "") === "completed")
74912
+ continue;
74913
+ const promptRaw = String(state.prompt ?? "");
74914
+ const firstLine = promptRaw.split(`
74915
+ `).find((l) => l.trim() !== "") ?? "";
74916
+ let progress = "\u2014";
74917
+ const tasksContent = storage.read(join21(dir, entry, "tasks.md"));
74918
+ if (tasksContent !== null) {
74919
+ const { checked, unchecked } = countTaskItems(tasksContent);
74920
+ const total = checked + unchecked;
74921
+ if (total > 0)
74922
+ progress = `${checked}/${total}`;
74923
+ }
74924
+ seen.add(entry);
74925
+ rows.push({
74926
+ name: String(state.name ?? entry),
74927
+ status: String(state.status ?? "unknown"),
74928
+ iters: String(state.iteration ?? 0),
74929
+ progress,
74930
+ prompt: firstLine.replace(/^#+\s*/, "").trim().slice(0, 60),
74931
+ source: label
74932
+ });
74933
+ }
74934
+ }
74935
+ return rows;
74936
+ }
74937
+ function pad2(str, width) {
74938
+ return str.length >= width ? str : str + " ".repeat(width - str.length);
74939
+ }
74940
+ function printLocalRows(rows) {
74941
+ if (rows.length === 0) {
74942
+ process.stdout.write(`
74943
+ No incomplete local tasks.
74944
+ `);
74945
+ return;
74946
+ }
74947
+ const cols = {
74948
+ name: Math.max(4, ...rows.map((r) => r.name.length)),
74949
+ status: Math.max(6, ...rows.map((r) => r.status.length)),
74950
+ iters: 5,
74951
+ progress: 8,
74952
+ source: Math.max(6, ...rows.map((r) => r.source.length))
74953
+ };
74954
+ process.stdout.write(`
74955
+ Local tasks:
74956
+ `);
74957
+ process.stdout.write(`${pad2("Name", cols.name)} ${pad2("Status", cols.status)} ${pad2("Iters", cols.iters)} ${pad2("Progress", cols.progress)} ${pad2("Source", cols.source)} Description
74958
+ `);
74959
+ for (const r of rows) {
74960
+ process.stdout.write(`${pad2(r.name, cols.name)} ${pad2(r.status, cols.status)} ${pad2(r.iters, cols.iters)} ${pad2(r.progress, cols.progress)} ${pad2(r.source, cols.source)} ${r.prompt}
74961
+ `);
74962
+ }
74963
+ }
74964
+ function findPullRequestUrl(attachments) {
74965
+ for (const a of attachments) {
74966
+ if (/github\.com\/[^/]+\/[^/]+\/pull\/\d+/.test(a.url))
74967
+ return a.url;
74968
+ }
74969
+ return null;
74970
+ }
74971
+ function unionMarkers2(...sets) {
74972
+ const out = [];
74973
+ const seen = new Set;
74974
+ for (const s of sets) {
74975
+ if (!s)
74976
+ continue;
74977
+ for (const m of markersOf(s)) {
74978
+ const key = `${m.type}:${m.value}`;
74979
+ if (seen.has(key))
74980
+ continue;
74981
+ seen.add(key);
74982
+ out.push(m);
74983
+ }
74984
+ }
74985
+ return out;
74986
+ }
74987
+ function buildBuckets(indicators) {
74988
+ const excludeFromTodo = unionMarkers2(indicators.setDone, indicators.setError, indicators.setConflicted);
74989
+ const excludeFromReview = unionMarkers2(indicators.setInProgress, indicators.setError, indicators.setConflicted);
74990
+ return [
74991
+ { label: "todo", indicator: indicators.getTodo, exclude: excludeFromTodo },
74992
+ { label: "in-progress", indicator: indicators.getInProgress, exclude: [] },
74993
+ { label: "conflicted", indicator: indicators.getConflicted, exclude: [] },
74994
+ { label: "review", indicator: indicators.getReview, exclude: excludeFromReview },
74995
+ { label: "auto-merge", indicator: indicators.getAutoMerge, exclude: [] }
74996
+ ];
74997
+ }
74998
+ async function fetchBucketIssues(apiKey, bucket, team, assignee) {
74999
+ if (!bucket.indicator || bucket.indicator.filter.length === 0)
75000
+ return [];
75001
+ const spec = {
75002
+ team,
75003
+ assignee,
75004
+ include: bucket.indicator.filter,
75005
+ exclude: bucket.exclude
75006
+ };
75007
+ return fetchOpenIssues(apiKey, spec);
75008
+ }
75009
+ async function printBucket(apiKey, bucket, team, assignee) {
75010
+ if (!bucket.indicator || bucket.indicator.filter.length === 0) {
75011
+ return;
75012
+ }
75013
+ let issues = [];
75014
+ try {
75015
+ issues = await fetchBucketIssues(apiKey, bucket, team, assignee);
75016
+ } catch (err) {
75017
+ process.stdout.write(`
75018
+ ${bucket.label}: error fetching from Linear \u2014 ${err instanceof Error ? err.message : String(err)}
75019
+ `);
75020
+ return;
75021
+ }
75022
+ const filterStr = bucket.indicator.filter.map((m) => `${m.type}:${m.value}`).join(", ");
75023
+ process.stdout.write(`
75024
+ ${bucket.label} [${filterStr}] \u2014 ${issues.length} issue(s)
75025
+ `);
75026
+ if (issues.length === 0)
75027
+ return;
75028
+ const prUrls = await Promise.all(issues.map(async (issue) => {
75029
+ try {
75030
+ const attachments = await fetchIssueAttachments(apiKey, issue.id);
75031
+ return findPullRequestUrl(attachments);
75032
+ } catch {
75033
+ return null;
75034
+ }
75035
+ }));
75036
+ const idWidth = Math.max(3, ...issues.map((i) => i.identifier.length));
75037
+ const stateWidth = Math.max(5, ...issues.map((i) => i.state.name.length));
75038
+ for (let index = 0;index < issues.length; index += 1) {
75039
+ const issue = issues[index];
75040
+ const pr = prUrls[index];
75041
+ const title = issue.title.slice(0, 60);
75042
+ process.stdout.write(` ${pad2(issue.identifier, idWidth)} ${pad2(issue.state.name, stateWidth)} ${pad2(title, 60)} ${pr ?? "(no PR)"}
75043
+ `);
75044
+ }
75045
+ }
75046
+ async function runList(input) {
75047
+ const { statesDir, projectRoot, debug, name } = input;
75048
+ if (debug) {
75049
+ if (!name) {
75050
+ process.stderr.write(`Error: --name is required when using --debug
75051
+ `);
75052
+ process.exitCode = 1;
75053
+ return;
75054
+ }
75055
+ await runListDebug({
75056
+ identifier: name,
75057
+ projectRoot,
75058
+ linearTeamOverride: input.linearTeamOverride,
75059
+ linearAssigneeOverride: input.linearAssigneeOverride
75060
+ });
75061
+ return;
75062
+ }
75063
+ const rows = buildLocalRows(statesDir, projectRoot);
75064
+ printLocalRows(rows);
75065
+ const cfg = await loadRalphyConfig(projectRoot);
75066
+ const apiKey = process.env["LINEAR_API_KEY"];
75067
+ const indicators = cfg.linear.indicators;
75068
+ const team = input.linearTeamOverride || cfg.linear.team;
75069
+ const assignee = input.linearAssigneeOverride || cfg.linear.assignee;
75070
+ const buckets = buildBuckets(indicators);
75071
+ const anyConfigured = buckets.some((b) => b.indicator && b.indicator.filter.length > 0);
75072
+ if (!anyConfigured) {
75073
+ process.stdout.write(`
75074
+ Linear: no get* indicators configured in ralphy.config.json \u2014 skipping ticket fetch.
75075
+ `);
75076
+ return;
75077
+ }
75078
+ if (!apiKey) {
75079
+ process.stdout.write(`
75080
+ Linear: LINEAR_API_KEY not set \u2014 cannot fetch tickets. Configured buckets:
75081
+ `);
75082
+ for (const bucket of buckets) {
75083
+ if (!bucket.indicator || bucket.indicator.filter.length === 0)
75084
+ continue;
75085
+ const filterStr = bucket.indicator.filter.map((m) => `${m.type}:${m.value}`).join(", ");
75086
+ process.stdout.write(` ${bucket.label} [${filterStr}]
75087
+ `);
75088
+ }
75089
+ return;
75090
+ }
75091
+ process.stdout.write(`
75092
+ Linear tickets:
75093
+ `);
75094
+ if (team)
75095
+ process.stdout.write(` team: ${team}
75096
+ `);
75097
+ if (assignee)
75098
+ process.stdout.write(` assignee: ${assignee}
75099
+ `);
75100
+ for (const bucket of buckets) {
75101
+ await printBucket(apiKey, bucket, team, assignee);
75102
+ }
75103
+ }
75104
+ function normalizeIdentifier(input) {
75105
+ const match = input.match(/^([A-Za-z]+)-(\d+)(?:-.*)?$/);
75106
+ if (!match)
75107
+ return null;
75108
+ return `${match[1].toUpperCase()}-${match[2]}`;
75109
+ }
75110
+ async function fetchIssueByIdentifier(apiKey, identifier) {
75111
+ const match = identifier.match(/^([A-Z]+)-(\d+)$/);
75112
+ if (!match)
75113
+ return null;
75114
+ const teamKey = match[1];
75115
+ const number = Number(match[2]);
75116
+ const query = `query($team: String!, $number: Float!) {
75117
+ issues(filter: { team: { key: { eq: $team } }, number: { eq: $number } }, first: 1) {
75118
+ nodes {
75119
+ id identifier title url
75120
+ state { name type }
75121
+ assignee { id email name }
75122
+ team { key }
75123
+ labels { nodes { name } }
75124
+ attachments(first: 25) { nodes { title subtitle } }
75125
+ relations(first: 50) {
75126
+ nodes { type relatedIssue { id identifier state { type } } }
75127
+ }
75128
+ }
75129
+ }
75130
+ }`;
75131
+ const res = await fetch("https://api.linear.app/graphql", {
75132
+ method: "POST",
75133
+ headers: { "Content-Type": "application/json", Authorization: apiKey },
75134
+ body: JSON.stringify({ query, variables: { team: teamKey, number } })
75135
+ });
75136
+ if (!res.ok)
75137
+ return null;
75138
+ const json = await res.json();
75139
+ return json.data?.issues?.nodes?.[0] ?? null;
75140
+ }
75141
+ var RALPHY_ATTACHMENT_TITLE2 = "Ralphy";
75142
+ function markerMatches(issue, marker) {
75143
+ if (marker.type === "label") {
75144
+ const labels = new Set(issue.labels.nodes.map((l) => l.name.toLowerCase()));
75145
+ return labels.has(marker.value.toLowerCase());
75146
+ }
75147
+ if (marker.type === "attachment") {
75148
+ return issue.attachments.nodes.some((a) => a.title === RALPHY_ATTACHMENT_TITLE2 && (a.subtitle ?? "").toLowerCase() === marker.value.toLowerCase());
75149
+ }
75150
+ if (marker.type === "status") {
75151
+ return issue.state.name.toLowerCase() === marker.value.toLowerCase();
75152
+ }
75153
+ return false;
75154
+ }
75155
+ function assigneeMatches(issue, assignee) {
75156
+ if (!assignee)
75157
+ return true;
75158
+ const a = issue.assignee;
75159
+ if (!a)
75160
+ return false;
75161
+ if (assignee === "me")
75162
+ return true;
75163
+ if (assignee.includes("@"))
75164
+ return a.email?.toLowerCase() === assignee.toLowerCase();
75165
+ return a.id === assignee;
75166
+ }
75167
+ async function runListDebug(input) {
75168
+ const { identifier, projectRoot } = input;
75169
+ const apiKey = process.env["LINEAR_API_KEY"];
75170
+ if (!apiKey) {
75171
+ process.stderr.write(`Error: LINEAR_API_KEY not set \u2014 cannot query Linear
75172
+ `);
75173
+ process.exitCode = 1;
75174
+ return;
75175
+ }
75176
+ const cfg = await loadRalphyConfig(projectRoot);
75177
+ const indicators = cfg.linear.indicators;
75178
+ const team = input.linearTeamOverride || cfg.linear.team;
75179
+ const assignee = input.linearAssigneeOverride || cfg.linear.assignee;
75180
+ const normalized = normalizeIdentifier(identifier);
75181
+ if (!normalized) {
75182
+ process.stdout.write(`Error: '${identifier}' does not look like a Linear identifier (expected e.g. DOO-6, or a local change name beginning with one).
75183
+ `);
75184
+ process.exitCode = 1;
75185
+ return;
75186
+ }
75187
+ process.stdout.write(`Looking up ${normalized}${normalized === identifier ? "" : ` (from '${identifier}')`} on Linear\u2026
75188
+ `);
75189
+ const issue = await fetchIssueByIdentifier(apiKey, normalized);
75190
+ if (!issue) {
75191
+ process.stdout.write(`Issue ${normalized} not found (or LINEAR_API_KEY lacks access).
75192
+ `);
75193
+ return;
75194
+ }
75195
+ process.stdout.write(`
75196
+ Found ${issue.identifier} \u2014 "${issue.title}"
75197
+ ` + ` url: ${issue.url}
75198
+ ` + ` state: ${issue.state.name} (${issue.state.type})
75199
+ ` + ` team: ${issue.team?.key ?? "(unknown)"}
75200
+ ` + ` assignee: ${issue.assignee ? `${issue.assignee.name} <${issue.assignee.email ?? "no-email"}>` : "(unassigned)"}
75201
+ ` + ` labels: ${issue.labels.nodes.map((l) => l.name).join(", ") || "(none)"}
75202
+ `);
75203
+ const blockedBy = issue.relations.nodes.filter((r) => r.type === "blocked_by" && r.relatedIssue.state.type !== "completed" && r.relatedIssue.state.type !== "cancelled").map((r) => r.relatedIssue.identifier);
75204
+ process.stdout.write(`
75205
+ Per-bucket diagnostics:
75206
+ `);
75207
+ const buckets = buildBuckets(indicators);
75208
+ for (const bucket of buckets) {
75209
+ if (!bucket.indicator || bucket.indicator.filter.length === 0) {
75210
+ process.stdout.write(`
75211
+ ${bucket.label}: not configured.
75212
+ `);
75213
+ continue;
75214
+ }
75215
+ const reasons = [];
75216
+ if (team && issue.team?.key && issue.team.key !== team) {
75217
+ reasons.push(`team mismatch: issue=${issue.team.key}, config=${team}`);
75218
+ }
75219
+ if (!assigneeMatches(issue, assignee)) {
75220
+ reasons.push(`assignee mismatch: issue=${issue.assignee ? issue.assignee.email ?? issue.assignee.id : "unassigned"}, config=${assignee}`);
75221
+ }
75222
+ const includeMatches = bucket.indicator.filter.some((m) => markerMatches(issue, m));
75223
+ if (!includeMatches) {
75224
+ const want = bucket.indicator.filter.map((m) => `${m.type}:${m.value}`).join(" OR ");
75225
+ reasons.push(`include filter not matched (needs any of: ${want})`);
75226
+ }
75227
+ const excludedBy = bucket.exclude.filter((m) => markerMatches(issue, m));
75228
+ if (excludedBy.length > 0) {
75229
+ reasons.push(`excluded by markers: ${excludedBy.map((m) => `${m.type}:${m.value}`).join(", ")}`);
75230
+ }
75231
+ if (bucket.label === "todo" || bucket.label === "in-progress") {
75232
+ if (blockedBy.length > 0) {
75233
+ reasons.push(`blocked by unfinished issues: ${blockedBy.join(", ")}`);
75234
+ }
75235
+ }
75236
+ if (reasons.length === 0) {
75237
+ process.stdout.write(`
75238
+ ${bucket.label}: \u2713 would be picked up by this bucket.
75239
+ `);
75240
+ } else {
75241
+ process.stdout.write(`
75242
+ ${bucket.label}: \u2717 skipped
75243
+ `);
75244
+ for (const reason of reasons)
75245
+ process.stdout.write(` - ${reason}
75246
+ `);
75247
+ }
75248
+ }
75249
+ }
75250
+
75027
75251
  // apps/cli/src/index.ts
75028
75252
  init_src();
75029
75253
  if (typeof globalThis.Bun === "undefined") {
@@ -75040,6 +75264,28 @@ async function findProjectRoot() {
75040
75264
  }
75041
75265
  return process.cwd();
75042
75266
  }
75267
+ async function ensureRalphGitignore(projectRoot) {
75268
+ const ralphDir = join23(projectRoot, ".ralph");
75269
+ await mkdir7(ralphDir, { recursive: true });
75270
+ const gitignorePath = join23(ralphDir, ".gitignore");
75271
+ const file = Bun.file(gitignorePath);
75272
+ if (await file.exists()) {
75273
+ const existing = await file.text();
75274
+ const lines = existing.split(`
75275
+ `).map((l) => l.trim());
75276
+ if (lines.includes("bin") || lines.includes("bin/"))
75277
+ return;
75278
+ const next = existing.endsWith(`
75279
+ `) ? `${existing}bin
75280
+ ` : `${existing}
75281
+ bin
75282
+ `;
75283
+ await Bun.write(gitignorePath, next);
75284
+ return;
75285
+ }
75286
+ await Bun.write(gitignorePath, `bin
75287
+ `);
75288
+ }
75043
75289
  await init();
75044
75290
  var rawArgs = process.argv.slice(2);
75045
75291
  if (rawArgs.length === 0) {
@@ -75075,6 +75321,7 @@ try {
75075
75321
  const tasksDir = layout.tasksDir;
75076
75322
  if (args.mode === "init") {
75077
75323
  await mkdir7(statesDir, { recursive: true });
75324
+ await ensureRalphGitignore(projectRoot);
75078
75325
  const openspecBin = resolveOpenspecBin(import.meta.dir);
75079
75326
  Bun.spawnSync({
75080
75327
  cmd: [process.execPath, openspecBin, "init", "--tools", "none", "--force"],
@@ -75082,6 +75329,20 @@ try {
75082
75329
  cwd: process.cwd()
75083
75330
  });
75084
75331
  }
75332
+ if (args.mode === "list") {
75333
+ await runWithContext(createDefaultContext(), async () => {
75334
+ await runList({
75335
+ statesDir,
75336
+ projectRoot: args.projectRoot ?? projectRoot,
75337
+ linearTeamOverride: args.linearTeam,
75338
+ linearAssigneeOverride: args.linearAssignee,
75339
+ debug: args.debug,
75340
+ name: args.name
75341
+ });
75342
+ });
75343
+ await shutdown();
75344
+ process.exit(process.exitCode ?? 0);
75345
+ }
75085
75346
  if (args.mode === "debug") {
75086
75347
  if (!args.name) {
75087
75348
  process.stderr.write(`Error: --name is required for debug mode
@@ -75154,11 +75415,12 @@ try {
75154
75415
  if (args.mode === "task" && args.name) {
75155
75416
  await mkdir7(join23(statesDir, args.name), { recursive: true });
75156
75417
  await mkdir7(join23(tasksDir, args.name), { recursive: true });
75418
+ await ensureRalphGitignore(projectRoot);
75157
75419
  }
75158
75420
  if (args.mode === "agent") {
75159
75421
  await mkdir7(statesDir, { recursive: true });
75160
75422
  await mkdir7(tasksDir, { recursive: true });
75161
- await mkdir7(join23(projectRoot, ".ralph"), { recursive: true });
75423
+ await ensureRalphGitignore(projectRoot);
75162
75424
  }
75163
75425
  if (args.mode === "agent" && args.jsonOutput) {
75164
75426
  const { runAgentJson: runAgentJson2 } = await Promise.resolve().then(() => (init_json_runner(), exports_json_runner));
@@ -75167,7 +75429,7 @@ try {
75167
75429
  process.exit(process.exitCode ?? 0);
75168
75430
  }
75169
75431
  await runWithContext(createDefaultContext(), async () => {
75170
- const { waitUntilExit } = render_default(import_react59.createElement(App2, { args, statesDir, tasksDir, projectRoot }));
75432
+ const { waitUntilExit } = render_default(import_react58.createElement(App2, { args, statesDir, tasksDir, projectRoot }));
75171
75433
  await waitUntilExit();
75172
75434
  });
75173
75435
  await shutdown();