@neriros/ralphy 2.22.0 → 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 +27 -21
  2. package/dist/cli/index.js +1124 -853
  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.0")
35033
- return "2.22.0";
35032
+ if ("2.23.0")
35033
+ return "2.23.0";
35034
35034
  } catch {}
35035
35035
  const dirsToTry = [];
35036
35036
  try {
@@ -35095,13 +35095,7 @@ function mergeIndicator(bag, key, marker) {
35095
35095
  bag[key] = { filter: filter2 };
35096
35096
  } else {
35097
35097
  const existing = bag[key];
35098
- let next;
35099
- if (!existing)
35100
- next = marker;
35101
- else if ("apply" in existing)
35102
- next = { apply: [...existing.apply, marker] };
35103
- else
35104
- next = { apply: [existing, marker] };
35098
+ const next = existing ? [...Array.isArray(existing) ? existing : [existing], marker] : marker;
35105
35099
  bag[key] = next;
35106
35100
  }
35107
35101
  }
@@ -35133,7 +35127,8 @@ async function parseArgs(argv) {
35133
35127
  codeReview: false,
35134
35128
  maxTickets: 0,
35135
35129
  projectRoot: undefined,
35136
- jsonOutput: false
35130
+ jsonOutput: false,
35131
+ debug: false
35137
35132
  };
35138
35133
  let expectModel = false;
35139
35134
  let expectModelFlag = false;
@@ -35339,6 +35334,9 @@ async function parseArgs(argv) {
35339
35334
  case "--project-root":
35340
35335
  expectProjectRoot = true;
35341
35336
  break;
35337
+ case "--debug":
35338
+ result2.debug = true;
35339
+ break;
35342
35340
  default:
35343
35341
  if (VALID_MODES.has(arg)) {
35344
35342
  result2.mode = arg;
@@ -35383,7 +35381,7 @@ var init_cli = __esm(() => {
35383
35381
  "",
35384
35382
  "Commands:",
35385
35383
  " task Run or resume a task",
35386
- " list List active changes",
35384
+ " list List active changes (with Linear tickets + PRs when configured)",
35387
35385
  " status Show detailed change status",
35388
35386
  " init Initialize OpenSpec in current directory",
35389
35387
  " agent Poll Linear for new tasks and run loops concurrently",
@@ -35429,6 +35427,10 @@ var init_cli = __esm(() => {
35429
35427
  " --max-tickets <n> Stop picking up new issues after N have been started (0 = unlimited)",
35430
35428
  " --json-output Emit JSONL to stdout instead of the Ink dashboard (for scripting/CI)",
35431
35429
  "",
35430
+ "",
35431
+ "List mode options:",
35432
+ " --debug --name <id> Explain why a Linear ticket was not picked up",
35433
+ "",
35432
35434
  " --help, -h Show this help message",
35433
35435
  "",
35434
35436
  "Examples:",
@@ -39410,7 +39412,7 @@ var init_zod = __esm(() => {
39410
39412
 
39411
39413
  // packages/types/src/types.ts
39412
39414
  function markersOf(set2) {
39413
- return "apply" in set2 ? set2.apply : [set2];
39415
+ return Array.isArray(set2) ? set2 : [set2];
39414
39416
  }
39415
39417
  var IterationUsageSchema, UsageSchema, HistoryEntrySchema, StateSchema, PhaseFrontmatterSchema;
39416
39418
  var init_types2 = __esm(() => {
@@ -39485,99 +39487,6 @@ var init_types2 = __esm(() => {
39485
39487
  });
39486
39488
  });
39487
39489
 
39488
- // apps/cli/src/agent/worktree.ts
39489
- import { basename, join as join3 } from "path";
39490
- import { homedir } from "os";
39491
- import { exists } from "fs/promises";
39492
- function worktreesDir(projectRoot) {
39493
- return join3(homedir(), ".ralph", basename(projectRoot), "worktrees");
39494
- }
39495
- function branchForChange(changeName) {
39496
- return `ralph/${changeName}`;
39497
- }
39498
- async function createWorktree(projectRoot, changeName, runner) {
39499
- const dir = worktreesDir(projectRoot);
39500
- const cwd2 = join3(dir, changeName);
39501
- const branch = branchForChange(changeName);
39502
- const list = await runner.run(["worktree", "list", "--porcelain"], projectRoot);
39503
- if (list.stdout.includes(`worktree ${cwd2}
39504
- `)) {
39505
- return { cwd: cwd2, branch };
39506
- }
39507
- let branchExists = true;
39508
- try {
39509
- await runner.run(["rev-parse", "--verify", "--quiet", `refs/heads/${branch}`], projectRoot);
39510
- } catch {
39511
- branchExists = false;
39512
- }
39513
- const cmd = branchExists ? ["worktree", "add", cwd2, branch] : ["worktree", "add", "-b", branch, cwd2];
39514
- await runner.run(cmd, projectRoot);
39515
- return { cwd: cwd2, branch };
39516
- }
39517
- async function removeWorktree(projectRoot, cwd2, runner) {
39518
- await runner.run(["worktree", "remove", "--force", cwd2], projectRoot);
39519
- }
39520
- async function isWorktreeSafeToRemove(cwd2, base2, runner) {
39521
- const status = await runner.run(["status", "--porcelain"], cwd2);
39522
- const dirty = status.stdout.trim();
39523
- let unpushedCommits = "";
39524
- try {
39525
- const log2 = await runner.run(["log", "--oneline", `${base2}..HEAD`, "--no-merges"], cwd2);
39526
- unpushedCommits = log2.stdout.trim();
39527
- } catch {
39528
- unpushedCommits = "<unknown: failed to compare against base>";
39529
- }
39530
- if (dirty && unpushedCommits) {
39531
- return {
39532
- safe: false,
39533
- reason: "uncommitted changes AND unpushed commits present",
39534
- dirty,
39535
- unpushedCommits
39536
- };
39537
- }
39538
- if (dirty) {
39539
- return {
39540
- safe: false,
39541
- reason: "uncommitted or untracked files present",
39542
- dirty,
39543
- unpushedCommits
39544
- };
39545
- }
39546
- if (unpushedCommits) {
39547
- return {
39548
- safe: false,
39549
- reason: `commits ahead of ${base2} were not pushed/PR'd`,
39550
- dirty,
39551
- unpushedCommits
39552
- };
39553
- }
39554
- return { safe: true, dirty, unpushedCommits };
39555
- }
39556
- async function seedWorktreeMcpConfig(projectRoot, worktreeCwd) {
39557
- const dst = join3(worktreeCwd, ".mcp.json");
39558
- const src = join3(projectRoot, ".mcp.json");
39559
- const source = await exists(dst) ? dst : await exists(src) ? src : null;
39560
- if (!source)
39561
- return;
39562
- let parsed;
39563
- try {
39564
- parsed = await Bun.file(source).json();
39565
- } catch {
39566
- return;
39567
- }
39568
- const servers = parsed.mcpServers;
39569
- if (servers && typeof servers === "object") {
39570
- for (const cfg of Object.values(servers)) {
39571
- if (Array.isArray(cfg.args)) {
39572
- cfg.args = cfg.args.map((a) => typeof a === "string" && a.startsWith(".ralph/") ? join3(projectRoot, a) : a);
39573
- }
39574
- }
39575
- }
39576
- await Bun.write(dst, JSON.stringify(parsed, null, 2) + `
39577
- `);
39578
- }
39579
- var init_worktree = () => {};
39580
-
39581
39490
  // node_modules/.bun/react@18.3.1/node_modules/react/cjs/react-jsx-dev-runtime.development.js
39582
39491
  var require_react_jsx_dev_runtime_development = __commonJS((exports) => {
39583
39492
  var React10 = __toESM(require_react());
@@ -59443,8 +59352,8 @@ var init_node = __esm(() => {
59443
59352
  });
59444
59353
 
59445
59354
  // packages/telemetry/src/index.ts
59446
- import { homedir as homedir2 } from "os";
59447
- import { join as join7 } from "path";
59355
+ import { homedir } from "os";
59356
+ import { join as join5 } from "path";
59448
59357
  import { randomUUID } from "crypto";
59449
59358
  function setDefaultProperties(props) {
59450
59359
  defaultProps = { ...defaultProps, ...props };
@@ -59452,7 +59361,7 @@ function setDefaultProperties(props) {
59452
59361
  async function init() {
59453
59362
  if (!enabled)
59454
59363
  return;
59455
- const idPath = join7(homedir2(), ".ralph", ".telemetry-id");
59364
+ const idPath = join5(homedir(), ".ralph", ".telemetry-id");
59456
59365
  const idFile = Bun.file(idPath);
59457
59366
  if (await idFile.exists()) {
59458
59367
  distinctId = (await idFile.text()).trim();
@@ -59527,22 +59436,40 @@ ${fence}`;
59527
59436
  }
59528
59437
 
59529
59438
  // apps/cli/src/agent/config.ts
59530
- import { join as join11 } from "path";
59439
+ import { join as join9 } from "path";
59531
59440
  function stripJsonComments(text) {
59532
59441
  return text.replace(/\/\/[^\n]*/g, "");
59533
59442
  }
59534
59443
  async function loadRalphyConfig(projectRoot) {
59535
- const path = join11(projectRoot, "ralphy.config.json");
59444
+ const path = join9(projectRoot, "ralphy.config.json");
59536
59445
  const file = Bun.file(path);
59537
59446
  if (!await file.exists()) {
59538
59447
  return RalphyConfigSchema.parse({});
59539
59448
  }
59540
59449
  const text = await file.text();
59541
- const raw = JSON.parse(stripJsonComments(text));
59542
- return RalphyConfigSchema.parse(raw);
59450
+ let raw;
59451
+ try {
59452
+ raw = JSON.parse(stripJsonComments(text));
59453
+ } catch (error) {
59454
+ throw new Error(`ralphy.config.json is not valid JSON.
59455
+ ` + ` File: ${path}
59456
+ ` + ` ${error instanceof Error ? error.message : String(error)}
59457
+
59458
+ ` + `Run \`ralph init\` to see the full default config with all available settings.`);
59459
+ }
59460
+ const result2 = RalphyConfigSchema.safeParse(raw);
59461
+ if (!result2.success) {
59462
+ const issues = result2.error.issues.map((issue) => ` \u2022 ${issue.path.join(".") || "(root)"}: ${issue.message}`).join(`
59463
+ `);
59464
+ throw new Error(`ralphy.config.json has invalid settings:
59465
+ ${issues}
59466
+
59467
+ ` + `Run \`ralph init\` to see the full default config with all available settings.`);
59468
+ }
59469
+ return result2.data;
59543
59470
  }
59544
59471
  async function ensureRalphyConfig(projectRoot) {
59545
- const path = join11(projectRoot, "ralphy.config.json");
59472
+ const path = join9(projectRoot, "ralphy.config.json");
59546
59473
  const file = Bun.file(path);
59547
59474
  if (await file.exists())
59548
59475
  return path;
@@ -59669,18 +59596,18 @@ var MarkerSchema, GetIndicatorSchema, SetIndicatorSchema, IndicatorsSchema, Ralp
59669
59596
  // after opening the PR so the PR merges as soon as required checks pass.
59670
59597
  // "getAutoMerge": { "filter": [{ "type": "label", "value": "ralph:auto-merge" }] },
59671
59598
 
59672
- // Applied when Ralph picks up an issue.
59599
+ // Applied when Ralph picks up an issue. Single marker or array of markers.
59673
59600
  // "setInProgress": { "type": "label", "value": "ralph:in-progress" },
59674
- // \u2014 or use attachment type to stamp a single "Ralphy" entry on the issue:
59675
59601
  // "setInProgress": { "type": "attachment", "value": "In Progress" },
59602
+ // "setInProgress": [{ "type": "status", "value": "In Progress" }, { "type": "attachment", "value": "In Progress" }],
59676
59603
 
59677
59604
  // Applied on clean success.
59678
59605
  // "setDone": { "type": "status", "value": "In Review" },
59679
- // "setDone": { "type": "attachment", "value": "Done" },
59606
+ // "setDone": [{ "type": "status", "value": "In Review" }, { "type": "attachment", "value": "Done" }],
59680
59607
 
59681
59608
  // Applied when the task exits with an error (quarantine signal).
59682
59609
  // "setError": { "type": "label", "value": "ralph:error" },
59683
- // "setError": { "type": "attachment", "value": "Error" },
59610
+ // "setError": [{ "type": "label", "value": "ralph:error" }, { "type": "attachment", "value": "Error" }],
59684
59611
 
59685
59612
  // Applied when a PR merge conflict is detected.
59686
59613
  // "setConflicted": { "type": "label", "value": "ralph:conflict" },
@@ -59703,10 +59630,7 @@ var init_config = __esm(() => {
59703
59630
  GetIndicatorSchema = exports_external.object({
59704
59631
  filter: exports_external.array(MarkerSchema).default([])
59705
59632
  });
59706
- SetIndicatorSchema = exports_external.union([
59707
- MarkerSchema,
59708
- exports_external.object({ apply: exports_external.array(MarkerSchema).min(1) })
59709
- ]);
59633
+ SetIndicatorSchema = exports_external.union([exports_external.array(MarkerSchema).min(1), MarkerSchema]);
59710
59634
  IndicatorsSchema = exports_external.object({
59711
59635
  getTodo: GetIndicatorSchema.optional(),
59712
59636
  getInProgress: GetIndicatorSchema.optional(),
@@ -59724,7 +59648,7 @@ var init_config = __esm(() => {
59724
59648
  const clear = value[key];
59725
59649
  if (!clear)
59726
59650
  continue;
59727
- const markers = "apply" in clear ? clear.apply : [clear];
59651
+ const markers = Array.isArray(clear) ? clear : [clear];
59728
59652
  for (const m of markers) {
59729
59653
  if (m.type !== "label") {
59730
59654
  ctx.addIssue({
@@ -59803,8 +59727,8 @@ var init_config = __esm(() => {
59803
59727
 
59804
59728
  // packages/log/src/log.ts
59805
59729
  import { appendFile } from "fs/promises";
59806
- import { join as join12, dirname as dirname4 } from "path";
59807
- import { homedir as homedir3 } from "os";
59730
+ import { join as join10, dirname as dirname4 } from "path";
59731
+ import { homedir as homedir2 } from "os";
59808
59732
  import { mkdir as mkdir2 } from "fs/promises";
59809
59733
  function fmt(type, text) {
59810
59734
  return `[${new Date().toISOString()}] [${type}] ${text}
@@ -59849,25 +59773,25 @@ async function initWorkerLog(logFile) {
59849
59773
  var ANSI_RE, AGENT_LOG_PATH;
59850
59774
  var init_log = __esm(() => {
59851
59775
  ANSI_RE = /\x1b(?:\[[0-9;]*[A-Za-z]|\][^\x07\x1b]*(?:\x07|\x1b\\)|.)/g;
59852
- AGENT_LOG_PATH = join12(homedir3(), ".ralph", "agent-mode.log");
59776
+ AGENT_LOG_PATH = join10(homedir2(), ".ralph", "agent-mode.log");
59853
59777
  mkdir2(dirname4(AGENT_LOG_PATH), { recursive: true }).catch(() => {
59854
59778
  return;
59855
59779
  });
59856
59780
  });
59857
59781
 
59858
59782
  // packages/core/src/layout.ts
59859
- import { join as join13 } from "path";
59783
+ import { join as join11 } from "path";
59860
59784
  function projectLayout(root) {
59861
- const statesDir = join13(root, ".ralph", "tasks");
59862
- const tasksDir = join13(root, "openspec", "changes");
59785
+ const statesDir = join11(root, ".ralph", "tasks");
59786
+ const tasksDir = join11(root, "openspec", "changes");
59863
59787
  return {
59864
59788
  root,
59865
59789
  statesDir,
59866
59790
  tasksDir,
59867
- agentStateFile: join13(root, ".ralph", "agent-state.json"),
59868
- changeDir: (name) => join13(tasksDir, name),
59869
- taskStateDir: (name) => join13(statesDir, name),
59870
- 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)
59871
59795
  };
59872
59796
  }
59873
59797
  var STATE_FILE2 = ".ralph-state.json";
@@ -59877,13 +59801,16 @@ var init_layout = () => {};
59877
59801
  function partition2(markers) {
59878
59802
  const statuses = [];
59879
59803
  const labels = [];
59804
+ const attachmentSubtitles = [];
59880
59805
  for (const m of markers) {
59881
59806
  if (m.type === "status")
59882
59807
  statuses.push(m.value);
59883
- else
59808
+ else if (m.type === "label")
59884
59809
  labels.push(m.value);
59810
+ else
59811
+ attachmentSubtitles.push(m.value);
59885
59812
  }
59886
- return { statuses, labels };
59813
+ return { statuses, labels, attachmentSubtitles };
59887
59814
  }
59888
59815
  function buildIssueFilter(spec) {
59889
59816
  const where = {};
@@ -59899,12 +59826,22 @@ function buildIssueFilter(spec) {
59899
59826
  }
59900
59827
  const inc = spec.include ?? [];
59901
59828
  if (inc.length > 0) {
59902
- const { statuses, labels } = partition2(inc);
59829
+ const { statuses, labels, attachmentSubtitles } = partition2(inc);
59903
59830
  const branches = [];
59904
59831
  if (statuses.length > 0)
59905
59832
  branches.push({ state: { name: { in: statuses } } });
59906
59833
  if (labels.length > 0)
59907
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
+ }
59908
59845
  for (const b of branches)
59909
59846
  Object.assign(where, b);
59910
59847
  } else {
@@ -59912,7 +59849,23 @@ function buildIssueFilter(spec) {
59912
59849
  }
59913
59850
  const exc = spec.exclude ?? [];
59914
59851
  if (exc.length > 0) {
59915
- 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
+ }
59916
59869
  if (statuses.length > 0) {
59917
59870
  const current = where.state;
59918
59871
  const noStatus = { state: { name: { nin: statuses } } };
@@ -60160,7 +60113,13 @@ function issueMatchesGetIndicator(issue, indicator) {
60160
60113
  return false;
60161
60114
  const labels = new Set(issue.labels.map((l) => l.toLowerCase()));
60162
60115
  const stateName = issue.state.name.toLowerCase();
60163
- 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
+ });
60164
60123
  }
60165
60124
  async function removeLabelFromIssue(apiKey, issueId, labelId) {
60166
60125
  const mutation = `mutation RemoveLabel($id: String!, $labelId: String!) {
@@ -60171,7 +60130,7 @@ async function removeLabelFromIssue(apiKey, issueId, labelId) {
60171
60130
  labelId
60172
60131
  });
60173
60132
  }
60174
- 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:";
60175
60134
 
60176
60135
  // apps/cli/src/agent/coordinator.ts
60177
60136
  class AgentCoordinator {
@@ -60623,7 +60582,7 @@ var init_coordinator = __esm(() => {
60623
60582
  });
60624
60583
 
60625
60584
  // apps/cli/src/agent/scaffold.ts
60626
- import { join as join14 } from "path";
60585
+ import { join as join12 } from "path";
60627
60586
  import { mkdir as mkdir3 } from "fs/promises";
60628
60587
  function changeNameForIssue(issue) {
60629
60588
  const slug = issue.title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40);
@@ -60631,10 +60590,10 @@ function changeNameForIssue(issue) {
60631
60590
  }
60632
60591
  async function scaffoldChangeForIssue(tasksDir, statesDir, issue, comments = [], appendPrompt = "") {
60633
60592
  const name = changeNameForIssue(issue);
60634
- const changeDir = join14(tasksDir, name);
60635
- const stateDir = join14(statesDir, name);
60593
+ const changeDir = join12(tasksDir, name);
60594
+ const stateDir = join12(statesDir, name);
60636
60595
  await mkdir3(changeDir, { recursive: true });
60637
- await mkdir3(join14(changeDir, "specs"), { recursive: true });
60596
+ await mkdir3(join12(changeDir, "specs"), { recursive: true });
60638
60597
  await mkdir3(stateDir, { recursive: true });
60639
60598
  const commentsBlock = comments.length > 0 ? [
60640
60599
  "",
@@ -60686,13 +60645,106 @@ async function scaffoldChangeForIssue(tasksDir, statesDir, issue, comments = [],
60686
60645
  ""
60687
60646
  ].join(`
60688
60647
  `);
60689
- await Bun.write(join14(changeDir, "proposal.md"), proposal);
60690
- await Bun.write(join14(changeDir, "tasks.md"), tasks);
60691
- 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);
60692
60651
  return name;
60693
60652
  }
60694
60653
  var init_scaffold = () => {};
60695
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
+
60696
60748
  // apps/cli/src/agent/pr.ts
60697
60749
  function defaultTitle(issue) {
60698
60750
  return `${issue.identifier}: ${issue.title}`;
@@ -60867,7 +60919,7 @@ var init_ci = __esm(() => {
60867
60919
  });
60868
60920
 
60869
60921
  // apps/cli/src/agent/post-task.ts
60870
- import { join as join15 } from "path";
60922
+ import { join as join14 } from "path";
60871
60923
  async function reactivateState(stateFilePath, log2, changeName) {
60872
60924
  const file = Bun.file(stateFilePath);
60873
60925
  if (!await file.exists())
@@ -60886,7 +60938,7 @@ async function reactivateState(stateFilePath, log2, changeName) {
60886
60938
  }
60887
60939
  async function runWorkerWithFixTask(ctx, heading, body) {
60888
60940
  try {
60889
- await prependFixTask(join15(ctx.changeDir, "tasks.md"), heading, body);
60941
+ await prependFixTask(join14(ctx.changeDir, "tasks.md"), heading, body);
60890
60942
  } catch (err) {
60891
60943
  ctx.log(`! could not prepend fix task: ${err.message}`, "red");
60892
60944
  return 1;
@@ -61254,7 +61306,7 @@ var init_post_task = __esm(() => {
61254
61306
  });
61255
61307
 
61256
61308
  // apps/cli/src/agent/wire.ts
61257
- import { join as join16 } from "path";
61309
+ import { join as join15 } from "path";
61258
61310
  import { mkdir as mkdir4 } from "fs/promises";
61259
61311
  function traceCmdRunner(base2, onStart, onEnd) {
61260
61312
  return {
@@ -61379,7 +61431,7 @@ function buildAgentCoordinator(input) {
61379
61431
  onWorkerOutput,
61380
61432
  onWorkerCmd
61381
61433
  } = input;
61382
- const logsDir = join16(projectRoot, ".ralph", "logs");
61434
+ const logsDir = join15(projectRoot, ".ralph", "logs");
61383
61435
  const concurrency = args.concurrency || cfg.concurrency;
61384
61436
  const pollInterval = args.pollInterval || cfg.pollIntervalSeconds;
61385
61437
  const indicators = mergeIndicators(cfg.linear.indicators, args.indicators);
@@ -61483,7 +61535,7 @@ function buildAgentCoordinator(input) {
61483
61535
  async function fetchByGet(inc, excl) {
61484
61536
  if (!inc)
61485
61537
  return [];
61486
- const include = "filter" in inc ? inc.filter : [];
61538
+ const include = !Array.isArray(inc) && "filter" in inc ? inc.filter : [];
61487
61539
  if (include.length === 0)
61488
61540
  return [];
61489
61541
  const spec = {
@@ -61579,7 +61631,7 @@ function buildAgentCoordinator(input) {
61579
61631
  branchByChange.set(changeName, branch);
61580
61632
  if (mode === "review") {
61581
61633
  const wtLayout = projectLayout(workerCwd);
61582
- const tasksFile = join16(wtLayout.changeDir(changeName), "tasks.md");
61634
+ const tasksFile = join15(wtLayout.changeDir(changeName), "tasks.md");
61583
61635
  let body;
61584
61636
  let heading;
61585
61637
  if (trigger) {
@@ -61604,7 +61656,7 @@ function buildAgentCoordinator(input) {
61604
61656
  await reactivateState2(wtLayout.stateFile(changeName), changeName);
61605
61657
  } else if (mode === "conflict-fix") {
61606
61658
  const wtLayout = projectLayout(workerCwd);
61607
- const tasksFile = join16(wtLayout.changeDir(changeName), "tasks.md");
61659
+ const tasksFile = join15(wtLayout.changeDir(changeName), "tasks.md");
61608
61660
  const prUrl = prByChange.get(changeName);
61609
61661
  const body = [
61610
61662
  `The PR for this change has merge conflicts with \`${cfg.prBaseBranch}\`.`,
@@ -61683,7 +61735,7 @@ PR: ${prUrl}` : ""
61683
61735
  return c;
61684
61736
  }
61685
61737
  function defaultSpawn(changeName, cmd, cwd2, note) {
61686
- const logFilePath = join16(logsDir, `${changeName}.log`);
61738
+ const logFilePath = join15(logsDir, `${changeName}.log`);
61687
61739
  const ANSI_RE2 = /\x1b(?:\[[0-9;]*[A-Za-z]|\][^\x07\x1b]*(?:\x07|\x1b\\)|.)/g;
61688
61740
  const BOX_ONLY_RE = /^[\s\u2500\u2502\u256D\u256E\u2570\u256F\u254C\u2504\u2501\u2503]+$/;
61689
61741
  const STATUS_BAR_LINE_RE = /^[\u280B\u2819\u2839\u2838\u283C\u2834\u2826\u2827\u2807\u280F\u2713\u2717]\s+iter\s+\d+/;
@@ -61745,7 +61797,7 @@ PR: ${prUrl}` : ""
61745
61797
  let logFilePath;
61746
61798
  let handle;
61747
61799
  if (injected) {
61748
- logFilePath = join16(logsDir, `${changeName}.log`);
61800
+ logFilePath = join15(logsDir, `${changeName}.log`);
61749
61801
  handle = injected(buildTaskCmdFor(changeName), cwd2);
61750
61802
  } else {
61751
61803
  const r = defaultSpawn(changeName, buildTaskCmdFor(changeName), cwd2, `spawn at ${new Date().toISOString()}`);
@@ -67523,7 +67575,7 @@ var import_react20 = __toESM(require_react(), 1);
67523
67575
  var import_react21 = __toESM(require_react(), 1);
67524
67576
  // apps/cli/src/index.ts
67525
67577
  init_cli();
67526
- var import_react59 = __toESM(require_react(), 1);
67578
+ var import_react58 = __toESM(require_react(), 1);
67527
67579
 
67528
67580
  // packages/context/src/context.ts
67529
67581
  import { AsyncLocalStorage } from "async_hooks";
@@ -67579,8 +67631,8 @@ function createDefaultContext() {
67579
67631
  }
67580
67632
 
67581
67633
  // apps/cli/src/components/App.tsx
67582
- var import_react58 = __toESM(require_react(), 1);
67583
- import { join as join20 } from "path";
67634
+ var import_react57 = __toESM(require_react(), 1);
67635
+ import { join as join19 } from "path";
67584
67636
 
67585
67637
  // packages/core/src/state.ts
67586
67638
  init_types2();
@@ -67651,193 +67703,9 @@ function ensureState(changeDir) {
67651
67703
  return state;
67652
67704
  }
67653
67705
 
67654
- // apps/cli/src/components/TaskList.tsx
67655
- var import_react22 = __toESM(require_react(), 1);
67656
- import { join as join4 } from "path";
67657
- init_worktree();
67658
- var jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
67659
- function countTaskItems(content) {
67660
- const checked = (content.match(/^- \[x\]/gm) ?? []).length;
67661
- const unchecked = (content.match(/^- \[ \]/gm) ?? []).length;
67662
- return { checked, unchecked };
67663
- }
67664
- function buildRows(statesDir, projectRoot) {
67665
- const storage = getStorage();
67666
- const rows = [];
67667
- const seenNames = new Set;
67668
- const sources = [{ dir: statesDir, label: "main" }];
67669
- if (projectRoot) {
67670
- const worktreesRoot = worktreesDir(projectRoot);
67671
- for (const wt of storage.list(worktreesRoot)) {
67672
- sources.push({
67673
- dir: join4(worktreesRoot, wt, ".ralph", "tasks"),
67674
- label: `wt:${wt}`
67675
- });
67676
- }
67677
- }
67678
- for (const { dir, label } of sources) {
67679
- for (const entry of storage.list(dir)) {
67680
- if (seenNames.has(entry))
67681
- continue;
67682
- const raw = storage.read(join4(dir, entry, ".ralph-state.json"));
67683
- if (raw === null)
67684
- continue;
67685
- let state;
67686
- try {
67687
- state = JSON.parse(raw);
67688
- } catch {
67689
- continue;
67690
- }
67691
- if (String(state.status ?? "") === "completed")
67692
- continue;
67693
- const promptRaw = String(state.prompt ?? "");
67694
- const firstLine = promptRaw.split(`
67695
- `).find((l) => l.trim() !== "") ?? "";
67696
- let progress = "\u2014";
67697
- let progressStyled = true;
67698
- const tasksContent = storage.read(join4(dir, entry, "tasks.md"));
67699
- if (tasksContent !== null) {
67700
- const { checked, unchecked } = countTaskItems(tasksContent);
67701
- const total = checked + unchecked;
67702
- if (total > 0) {
67703
- progress = `${checked}/${total}`;
67704
- progressStyled = false;
67705
- }
67706
- }
67707
- seenNames.add(entry);
67708
- rows.push({
67709
- name: String(state.name ?? entry),
67710
- phase: String(state.status ?? "active"),
67711
- status: String(state.status ?? "unknown"),
67712
- iters: String(state.iteration ?? 0),
67713
- progress,
67714
- progressStyled,
67715
- prompt: firstLine.replace(/^#+\s*/, "").trim().slice(0, 60),
67716
- source: label
67717
- });
67718
- }
67719
- }
67720
- return rows;
67721
- }
67722
- function TaskList({ statesDir, projectRoot }) {
67723
- const { exit } = use_app_default();
67724
- import_react22.useEffect(() => {
67725
- exit();
67726
- }, [exit]);
67727
- const rows = buildRows(statesDir, projectRoot);
67728
- if (rows.length === 0) {
67729
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Box_default, {
67730
- flexDirection: "column",
67731
- children: [
67732
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67733
- children: " "
67734
- }, undefined, false, undefined, this),
67735
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67736
- dimColor: true,
67737
- children: " No incomplete tasks."
67738
- }, undefined, false, undefined, this),
67739
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67740
- children: " "
67741
- }, undefined, false, undefined, this)
67742
- ]
67743
- }, undefined, true, undefined, this);
67744
- }
67745
- const cols = {
67746
- name: Math.max(4, ...rows.map((r) => r.name.length)),
67747
- phase: Math.max(5, ...rows.map((r) => r.phase.length)),
67748
- status: Math.max(6, ...rows.map((r) => r.status.length)),
67749
- iters: 5,
67750
- progress: 8,
67751
- source: Math.max(6, ...rows.map((r) => r.source.length))
67752
- };
67753
- const ruleWidth = cols.name + cols.phase + cols.status + cols.iters + cols.progress + cols.source + 60 + 12;
67754
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Box_default, {
67755
- flexDirection: "column",
67756
- children: [
67757
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67758
- children: " "
67759
- }, undefined, false, undefined, this),
67760
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67761
- children: [
67762
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67763
- bold: true,
67764
- children: "Name".padEnd(cols.name)
67765
- }, undefined, false, undefined, this),
67766
- " ",
67767
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67768
- bold: true,
67769
- children: "Phase".padEnd(cols.phase)
67770
- }, undefined, false, undefined, this),
67771
- " ",
67772
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67773
- bold: true,
67774
- children: "Status".padEnd(cols.status)
67775
- }, undefined, false, undefined, this),
67776
- " ",
67777
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67778
- bold: true,
67779
- children: "Iters".padEnd(cols.iters)
67780
- }, undefined, false, undefined, this),
67781
- " ",
67782
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67783
- bold: true,
67784
- children: "Progress".padEnd(cols.progress)
67785
- }, undefined, false, undefined, this),
67786
- " ",
67787
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67788
- bold: true,
67789
- children: "Source".padEnd(cols.source)
67790
- }, undefined, false, undefined, this),
67791
- " ",
67792
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67793
- bold: true,
67794
- children: "Description"
67795
- }, undefined, false, undefined, this)
67796
- ]
67797
- }, undefined, true, undefined, this),
67798
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67799
- dimColor: true,
67800
- children: "\u2500".repeat(ruleWidth)
67801
- }, undefined, false, undefined, this),
67802
- rows.map((row) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67803
- children: [
67804
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67805
- color: "cyan",
67806
- children: row.name.padEnd(cols.name)
67807
- }, undefined, false, undefined, this),
67808
- " ",
67809
- row.phase.padEnd(cols.phase),
67810
- " ",
67811
- row.status.padEnd(cols.status),
67812
- " ",
67813
- row.iters.padStart(cols.iters),
67814
- " ",
67815
- row.progressStyled ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67816
- dimColor: true,
67817
- children: row.progress.padStart(cols.progress)
67818
- }, undefined, false, undefined, this) : row.progress.padStart(cols.progress),
67819
- " ",
67820
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67821
- dimColor: true,
67822
- children: row.source.padEnd(cols.source)
67823
- }, undefined, false, undefined, this),
67824
- " ",
67825
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67826
- dimColor: true,
67827
- children: row.prompt
67828
- }, undefined, false, undefined, this)
67829
- ]
67830
- }, row.name, true, undefined, this)),
67831
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67832
- children: " "
67833
- }, undefined, false, undefined, this)
67834
- ]
67835
- }, undefined, true, undefined, this);
67836
- }
67837
-
67838
67706
  // apps/cli/src/components/TaskStatus.tsx
67839
- import { join as join5 } from "path";
67840
- 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);
67841
67709
  var HEAVY_RULE = "============================================";
67842
67710
  var LIGHT_RULE = "--------------------------------------------";
67843
67711
  var OPENSPEC_ARTIFACTS = ["proposal.md", "design.md", "tasks.md"];
@@ -67847,37 +67715,37 @@ function TaskStatus({ state, stateDir }) {
67847
67715
  const time = Math.round(state.usage.total_duration_ms / 1000 * 10) / 10 + "s";
67848
67716
  const artifacts = OPENSPEC_ARTIFACTS.map((name) => ({
67849
67717
  name,
67850
- exists: storage.read(join5(stateDir, name)) !== null
67718
+ exists: storage.read(join3(stateDir, name)) !== null
67851
67719
  }));
67852
67720
  const recent = state.history.slice(-10);
67853
- return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Box_default, {
67721
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Box_default, {
67854
67722
  flexDirection: "column",
67855
67723
  children: [
67856
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67724
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67857
67725
  children: HEAVY_RULE
67858
67726
  }, undefined, false, undefined, this),
67859
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67727
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67860
67728
  children: [
67861
67729
  " Change Status: ",
67862
67730
  state.name
67863
67731
  ]
67864
67732
  }, undefined, true, undefined, this),
67865
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67733
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67866
67734
  children: HEAVY_RULE
67867
67735
  }, undefined, false, undefined, this),
67868
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67736
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67869
67737
  children: [
67870
67738
  " Status: ",
67871
67739
  state.status
67872
67740
  ]
67873
67741
  }, undefined, true, undefined, this),
67874
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67742
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67875
67743
  children: [
67876
67744
  " Iteration: ",
67877
67745
  state.iteration
67878
67746
  ]
67879
67747
  }, undefined, true, undefined, this),
67880
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67748
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67881
67749
  children: [
67882
67750
  " ",
67883
67751
  "Engine: ",
@@ -67887,73 +67755,73 @@ function TaskStatus({ state, stateDir }) {
67887
67755
  ")"
67888
67756
  ]
67889
67757
  }, undefined, true, undefined, this),
67890
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67758
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67891
67759
  children: [
67892
67760
  " Created: ",
67893
67761
  state.createdAt
67894
67762
  ]
67895
67763
  }, undefined, true, undefined, this),
67896
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67764
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67897
67765
  children: [
67898
67766
  " Last modified: ",
67899
67767
  state.lastModified
67900
67768
  ]
67901
67769
  }, undefined, true, undefined, this),
67902
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67770
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67903
67771
  children: [
67904
67772
  " Branch: ",
67905
67773
  state.metadata.branch ?? "\u2014"
67906
67774
  ]
67907
67775
  }, undefined, true, undefined, this),
67908
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67776
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67909
67777
  children: LIGHT_RULE
67910
67778
  }, undefined, false, undefined, this),
67911
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67779
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67912
67780
  children: " Usage:"
67913
67781
  }, undefined, false, undefined, this),
67914
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67782
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67915
67783
  children: [
67916
67784
  " Cost: $",
67917
67785
  cost
67918
67786
  ]
67919
67787
  }, undefined, true, undefined, this),
67920
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67788
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67921
67789
  children: [
67922
67790
  " Time: ",
67923
67791
  time
67924
67792
  ]
67925
67793
  }, undefined, true, undefined, this),
67926
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67794
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67927
67795
  children: [
67928
67796
  " Turns: ",
67929
67797
  state.usage.total_turns
67930
67798
  ]
67931
67799
  }, undefined, true, undefined, this),
67932
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67800
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67933
67801
  children: [
67934
67802
  " Input tokens: ",
67935
67803
  state.usage.total_input_tokens
67936
67804
  ]
67937
67805
  }, undefined, true, undefined, this),
67938
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67806
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67939
67807
  children: [
67940
67808
  " Output tokens: ",
67941
67809
  state.usage.total_output_tokens
67942
67810
  ]
67943
67811
  }, undefined, true, undefined, this),
67944
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67812
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67945
67813
  children: [
67946
67814
  " Cached tokens: ",
67947
67815
  state.usage.total_cache_read_input_tokens
67948
67816
  ]
67949
67817
  }, undefined, true, undefined, this),
67950
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67818
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67951
67819
  children: LIGHT_RULE
67952
67820
  }, undefined, false, undefined, this),
67953
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67821
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67954
67822
  children: " Artifacts:"
67955
67823
  }, undefined, false, undefined, this),
67956
- artifacts.map((artifact) => /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67824
+ artifacts.map((artifact) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67957
67825
  children: [
67958
67826
  " ",
67959
67827
  artifact.exists ? "[x]" : "[ ]",
@@ -67961,13 +67829,13 @@ function TaskStatus({ state, stateDir }) {
67961
67829
  artifact.name
67962
67830
  ]
67963
67831
  }, artifact.name, true, undefined, this)),
67964
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67832
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67965
67833
  children: LIGHT_RULE
67966
67834
  }, undefined, false, undefined, this),
67967
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67835
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67968
67836
  children: " History (last 10):"
67969
67837
  }, undefined, false, undefined, this),
67970
- recent.map((entry, index) => /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67838
+ recent.map((entry, index) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67971
67839
  children: [
67972
67840
  " ",
67973
67841
  entry.timestamp,
@@ -67981,7 +67849,7 @@ function TaskStatus({ state, stateDir }) {
67981
67849
  entry.result
67982
67850
  ]
67983
67851
  }, index, true, undefined, this)),
67984
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
67852
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
67985
67853
  children: HEAVY_RULE
67986
67854
  }, undefined, false, undefined, this)
67987
67855
  ]
@@ -67989,14 +67857,14 @@ function TaskStatus({ state, stateDir }) {
67989
67857
  }
67990
67858
 
67991
67859
  // apps/cli/src/components/TaskLoop.tsx
67992
- var import_react56 = __toESM(require_react(), 1);
67993
- import { join as join10 } from "path";
67860
+ var import_react55 = __toESM(require_react(), 1);
67861
+ import { join as join8 } from "path";
67994
67862
 
67995
67863
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/badge/badge.js
67996
- var import_react24 = __toESM(require_react(), 1);
67864
+ var import_react23 = __toESM(require_react(), 1);
67997
67865
 
67998
67866
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/theme.js
67999
- var import_react23 = __toESM(require_react(), 1);
67867
+ var import_react22 = __toESM(require_react(), 1);
68000
67868
  var import_deepmerge = __toESM(require_cjs(), 1);
68001
67869
 
68002
67870
  // node_modules/.bun/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
@@ -68578,51 +68446,51 @@ var defaultTheme = {
68578
68446
  PasswordInput: theme_default13
68579
68447
  }
68580
68448
  };
68581
- var ThemeContext = import_react23.createContext(defaultTheme);
68449
+ var ThemeContext = import_react22.createContext(defaultTheme);
68582
68450
  var useComponentTheme = (component) => {
68583
- const theme14 = import_react23.useContext(ThemeContext);
68451
+ const theme14 = import_react22.useContext(ThemeContext);
68584
68452
  return theme14.components[component];
68585
68453
  };
68586
68454
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/confirm-input/confirm-input.js
68587
- var import_react25 = __toESM(require_react(), 1);
68455
+ var import_react24 = __toESM(require_react(), 1);
68588
68456
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/unordered-list/unordered-list.js
68589
- var import_react29 = __toESM(require_react(), 1);
68457
+ var import_react28 = __toESM(require_react(), 1);
68590
68458
 
68591
68459
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/unordered-list/unordered-list-item.js
68592
- var import_react27 = __toESM(require_react(), 1);
68460
+ var import_react26 = __toESM(require_react(), 1);
68593
68461
 
68594
68462
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/unordered-list/unordered-list-item-context.js
68595
- var import_react26 = __toESM(require_react(), 1);
68463
+ var import_react25 = __toESM(require_react(), 1);
68596
68464
 
68597
68465
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/unordered-list/constants.js
68598
68466
  var defaultMarker = figures_default.line;
68599
68467
 
68600
68468
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/unordered-list/unordered-list-item-context.js
68601
- var UnorderedListItemContext = import_react26.createContext({
68469
+ var UnorderedListItemContext = import_react25.createContext({
68602
68470
  marker: defaultMarker
68603
68471
  });
68604
68472
 
68605
68473
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/unordered-list/unordered-list-item.js
68606
68474
  function UnorderedListItem({ children }) {
68607
- const { marker } = import_react27.useContext(UnorderedListItemContext);
68475
+ const { marker } = import_react26.useContext(UnorderedListItemContext);
68608
68476
  const { styles: styles5 } = useComponentTheme("UnorderedList");
68609
- 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));
68610
68478
  }
68611
68479
 
68612
68480
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/unordered-list/unordered-list-context.js
68613
- var import_react28 = __toESM(require_react(), 1);
68614
- var UnorderedListContext = import_react28.createContext({
68481
+ var import_react27 = __toESM(require_react(), 1);
68482
+ var UnorderedListContext = import_react27.createContext({
68615
68483
  depth: 0
68616
68484
  });
68617
68485
 
68618
68486
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/unordered-list/unordered-list.js
68619
68487
  function UnorderedList({ children }) {
68620
- const { depth } = import_react29.useContext(UnorderedListContext);
68488
+ const { depth } = import_react28.useContext(UnorderedListContext);
68621
68489
  const { styles: styles5, config } = useComponentTheme("UnorderedList");
68622
- const listContext = import_react29.useMemo(() => ({
68490
+ const listContext = import_react28.useMemo(() => ({
68623
68491
  depth: depth + 1
68624
68492
  }), [depth]);
68625
- const listItemContext = import_react29.useMemo(() => {
68493
+ const listItemContext = import_react28.useMemo(() => {
68626
68494
  const { marker } = config();
68627
68495
  if (typeof marker === "string") {
68628
68496
  return { marker };
@@ -68636,32 +68504,32 @@ function UnorderedList({ children }) {
68636
68504
  marker: defaultMarker
68637
68505
  };
68638
68506
  }, [config, depth]);
68639
- 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)));
68640
68508
  }
68641
68509
  UnorderedList.Item = UnorderedListItem;
68642
68510
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/multi-select/multi-select.js
68643
- var import_react32 = __toESM(require_react(), 1);
68511
+ var import_react31 = __toESM(require_react(), 1);
68644
68512
 
68645
68513
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/multi-select/multi-select-option.js
68646
- var import_react30 = __toESM(require_react(), 1);
68514
+ var import_react29 = __toESM(require_react(), 1);
68647
68515
 
68648
68516
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/multi-select/use-multi-select-state.js
68649
- var import_react31 = __toESM(require_react(), 1);
68517
+ var import_react30 = __toESM(require_react(), 1);
68650
68518
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/progress-bar/progress-bar.js
68651
- var import_react33 = __toESM(require_react(), 1);
68519
+ var import_react32 = __toESM(require_react(), 1);
68652
68520
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/select/select.js
68653
- var import_react36 = __toESM(require_react(), 1);
68521
+ var import_react35 = __toESM(require_react(), 1);
68654
68522
 
68655
68523
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/select/select-option.js
68656
- var import_react34 = __toESM(require_react(), 1);
68524
+ var import_react33 = __toESM(require_react(), 1);
68657
68525
 
68658
68526
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/select/use-select-state.js
68659
- var import_react35 = __toESM(require_react(), 1);
68527
+ var import_react34 = __toESM(require_react(), 1);
68660
68528
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/spinner/spinner.js
68661
- var import_react38 = __toESM(require_react(), 1);
68529
+ var import_react37 = __toESM(require_react(), 1);
68662
68530
 
68663
68531
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/spinner/use-spinner.js
68664
- var import_react37 = __toESM(require_react(), 1);
68532
+ var import_react36 = __toESM(require_react(), 1);
68665
68533
  // node_modules/.bun/cli-spinners@3.4.0/node_modules/cli-spinners/spinners.json
68666
68534
  var spinners_default = {
68667
68535
  dots: {
@@ -70367,9 +70235,9 @@ var spinnersList = Object.keys(spinners_default);
70367
70235
 
70368
70236
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/spinner/use-spinner.js
70369
70237
  function useSpinner({ type = "dots" }) {
70370
- const [frame, setFrame] = import_react37.useState(0);
70238
+ const [frame, setFrame] = import_react36.useState(0);
70371
70239
  const spinner = cli_spinners_default[type];
70372
- import_react37.useEffect(() => {
70240
+ import_react36.useEffect(() => {
70373
70241
  const timer = setInterval(() => {
70374
70242
  setFrame((previousFrame) => {
70375
70243
  const isLastFrame = previousFrame === spinner.frames.length - 1;
@@ -70389,13 +70257,13 @@ function useSpinner({ type = "dots" }) {
70389
70257
  function Spinner({ label, type }) {
70390
70258
  const { frame } = useSpinner({ type });
70391
70259
  const { styles: styles5 } = useComponentTheme("Spinner");
70392
- 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));
70393
70261
  }
70394
70262
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/text-input/text-input.js
70395
- var import_react41 = __toESM(require_react(), 1);
70263
+ var import_react40 = __toESM(require_react(), 1);
70396
70264
 
70397
70265
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/text-input/use-text-input-state.js
70398
- var import_react39 = __toESM(require_react(), 1);
70266
+ var import_react38 = __toESM(require_react(), 1);
70399
70267
  var reducer = (state, action) => {
70400
70268
  switch (action.type) {
70401
70269
  case "move-cursor-left": {
@@ -70430,39 +70298,39 @@ var reducer = (state, action) => {
70430
70298
  }
70431
70299
  };
70432
70300
  var useTextInputState = ({ defaultValue = "", suggestions, onChange, onSubmit }) => {
70433
- const [state, dispatch] = import_react39.useReducer(reducer, {
70301
+ const [state, dispatch] = import_react38.useReducer(reducer, {
70434
70302
  previousValue: defaultValue,
70435
70303
  value: defaultValue,
70436
70304
  cursorOffset: defaultValue.length
70437
70305
  });
70438
- const suggestion = import_react39.useMemo(() => {
70306
+ const suggestion = import_react38.useMemo(() => {
70439
70307
  if (state.value.length === 0) {
70440
70308
  return;
70441
70309
  }
70442
70310
  return suggestions?.find((suggestion2) => suggestion2.startsWith(state.value))?.replace(state.value, "");
70443
70311
  }, [state.value, suggestions]);
70444
- const moveCursorLeft = import_react39.useCallback(() => {
70312
+ const moveCursorLeft = import_react38.useCallback(() => {
70445
70313
  dispatch({
70446
70314
  type: "move-cursor-left"
70447
70315
  });
70448
70316
  }, []);
70449
- const moveCursorRight = import_react39.useCallback(() => {
70317
+ const moveCursorRight = import_react38.useCallback(() => {
70450
70318
  dispatch({
70451
70319
  type: "move-cursor-right"
70452
70320
  });
70453
70321
  }, []);
70454
- const insert = import_react39.useCallback((text) => {
70322
+ const insert = import_react38.useCallback((text) => {
70455
70323
  dispatch({
70456
70324
  type: "insert",
70457
70325
  text
70458
70326
  });
70459
70327
  }, []);
70460
- const deleteCharacter = import_react39.useCallback(() => {
70328
+ const deleteCharacter = import_react38.useCallback(() => {
70461
70329
  dispatch({
70462
70330
  type: "delete"
70463
70331
  });
70464
70332
  }, []);
70465
- const submit = import_react39.useCallback(() => {
70333
+ const submit = import_react38.useCallback(() => {
70466
70334
  if (suggestion) {
70467
70335
  insert(suggestion);
70468
70336
  onSubmit?.(state.value + suggestion);
@@ -70470,7 +70338,7 @@ var useTextInputState = ({ defaultValue = "", suggestions, onChange, onSubmit })
70470
70338
  }
70471
70339
  onSubmit?.(state.value);
70472
70340
  }, [state.value, suggestion, insert, onSubmit]);
70473
- import_react39.useEffect(() => {
70341
+ import_react38.useEffect(() => {
70474
70342
  if (state.value !== state.previousValue) {
70475
70343
  onChange?.(state.value);
70476
70344
  }
@@ -70487,17 +70355,17 @@ var useTextInputState = ({ defaultValue = "", suggestions, onChange, onSubmit })
70487
70355
  };
70488
70356
 
70489
70357
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/text-input/use-text-input.js
70490
- var import_react40 = __toESM(require_react(), 1);
70358
+ var import_react39 = __toESM(require_react(), 1);
70491
70359
  init_source();
70492
70360
  var cursor = source_default.inverse(" ");
70493
70361
  var useTextInput = ({ isDisabled = false, state, placeholder = "" }) => {
70494
- const renderedPlaceholder = import_react40.useMemo(() => {
70362
+ const renderedPlaceholder = import_react39.useMemo(() => {
70495
70363
  if (isDisabled) {
70496
70364
  return placeholder ? source_default.dim(placeholder) : "";
70497
70365
  }
70498
70366
  return placeholder && placeholder.length > 0 ? source_default.inverse(placeholder[0]) + source_default.dim(placeholder.slice(1)) : cursor;
70499
70367
  }, [isDisabled, placeholder]);
70500
- const renderedValue = import_react40.useMemo(() => {
70368
+ const renderedValue = import_react39.useMemo(() => {
70501
70369
  if (isDisabled) {
70502
70370
  return state.value;
70503
70371
  }
@@ -70557,81 +70425,81 @@ function TextInput({ isDisabled = false, defaultValue, placeholder = "", suggest
70557
70425
  state
70558
70426
  });
70559
70427
  const { styles: styles5 } = useComponentTheme("TextInput");
70560
- return import_react41.default.createElement(Text, { ...styles5.value() }, inputValue);
70428
+ return import_react40.default.createElement(Text, { ...styles5.value() }, inputValue);
70561
70429
  }
70562
70430
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/ordered-list/ordered-list.js
70563
- var import_react45 = __toESM(require_react(), 1);
70431
+ var import_react44 = __toESM(require_react(), 1);
70564
70432
 
70565
70433
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/ordered-list/ordered-list-item.js
70566
- var import_react43 = __toESM(require_react(), 1);
70434
+ var import_react42 = __toESM(require_react(), 1);
70567
70435
 
70568
70436
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/ordered-list/ordered-list-item-context.js
70569
- var import_react42 = __toESM(require_react(), 1);
70570
- var OrderedListItemContext = import_react42.createContext({
70437
+ var import_react41 = __toESM(require_react(), 1);
70438
+ var OrderedListItemContext = import_react41.createContext({
70571
70439
  marker: figures_default.line
70572
70440
  });
70573
70441
 
70574
70442
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/ordered-list/ordered-list-item.js
70575
70443
  function OrderedListItem({ children }) {
70576
- const { marker } = import_react43.useContext(OrderedListItemContext);
70444
+ const { marker } = import_react42.useContext(OrderedListItemContext);
70577
70445
  const { styles: styles5 } = useComponentTheme("OrderedList");
70578
- 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));
70579
70447
  }
70580
70448
 
70581
70449
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/ordered-list/ordered-list-context.js
70582
- var import_react44 = __toESM(require_react(), 1);
70583
- var OrderedListContext = import_react44.createContext({
70450
+ var import_react43 = __toESM(require_react(), 1);
70451
+ var OrderedListContext = import_react43.createContext({
70584
70452
  marker: ""
70585
70453
  });
70586
70454
 
70587
70455
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/ordered-list/ordered-list.js
70588
70456
  function OrderedList({ children }) {
70589
- const { marker: parentMarker } = import_react45.useContext(OrderedListContext);
70457
+ const { marker: parentMarker } = import_react44.useContext(OrderedListContext);
70590
70458
  const { styles: styles5 } = useComponentTheme("OrderedList");
70591
70459
  let numberOfItems = 0;
70592
- for (const child of import_react45.default.Children.toArray(children)) {
70593
- 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) {
70594
70462
  continue;
70595
70463
  }
70596
70464
  numberOfItems++;
70597
70465
  }
70598
70466
  const maxMarkerWidth = String(numberOfItems).length;
70599
- return import_react45.default.createElement(Box_default, { ...styles5.list() }, import_react45.default.Children.map(children, (child, index) => {
70600
- 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) {
70601
70469
  return child;
70602
70470
  }
70603
70471
  const paddedMarker = `${String(index + 1).padStart(maxMarkerWidth)}.`;
70604
70472
  const marker = `${parentMarker}${paddedMarker}`;
70605
- 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));
70606
70474
  }));
70607
70475
  }
70608
70476
  OrderedList.Item = OrderedListItem;
70609
70477
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/password-input/password-input.js
70610
- var import_react48 = __toESM(require_react(), 1);
70478
+ var import_react47 = __toESM(require_react(), 1);
70611
70479
 
70612
70480
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/password-input/use-password-input-state.js
70613
- var import_react46 = __toESM(require_react(), 1);
70481
+ var import_react45 = __toESM(require_react(), 1);
70614
70482
 
70615
70483
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/password-input/use-password-input.js
70616
- var import_react47 = __toESM(require_react(), 1);
70484
+ var import_react46 = __toESM(require_react(), 1);
70617
70485
  init_source();
70618
70486
  var cursor2 = source_default.inverse(" ");
70619
70487
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/status-message/status-message.js
70620
- var import_react49 = __toESM(require_react(), 1);
70488
+ var import_react48 = __toESM(require_react(), 1);
70621
70489
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/alert/alert.js
70622
- var import_react50 = __toESM(require_react(), 1);
70490
+ var import_react49 = __toESM(require_react(), 1);
70623
70491
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/email-input/email-input.js
70624
- var import_react53 = __toESM(require_react(), 1);
70492
+ var import_react52 = __toESM(require_react(), 1);
70625
70493
 
70626
70494
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/email-input/use-email-input-state.js
70627
- var import_react51 = __toESM(require_react(), 1);
70495
+ var import_react50 = __toESM(require_react(), 1);
70628
70496
 
70629
70497
  // node_modules/.bun/@inkjs+ui@2.0.0+5b84dde3d6cd3930/node_modules/@inkjs/ui/build/components/email-input/use-email-input.js
70630
- var import_react52 = __toESM(require_react(), 1);
70498
+ var import_react51 = __toESM(require_react(), 1);
70631
70499
  init_source();
70632
70500
  var cursor3 = source_default.inverse(" ");
70633
70501
  // apps/cli/src/components/Banner.tsx
70634
- var jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
70502
+ var jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
70635
70503
  var SEPARATOR = "\u2501".repeat(44);
70636
70504
  function Banner({ state, ...opts }) {
70637
70505
  const engineLabel = state.engine === "claude" ? `${state.engine} (${state.model})` : state.engine;
@@ -70639,46 +70507,46 @@ function Banner({ state, ...opts }) {
70639
70507
  const promptLines = opts.taskPrompt?.split(`
70640
70508
  `);
70641
70509
  const maxPromptLines = 6;
70642
- return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
70510
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Box_default, {
70643
70511
  flexDirection: "column",
70644
70512
  children: [
70645
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70513
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70646
70514
  color: "gray",
70647
70515
  children: SEPARATOR
70648
70516
  }, undefined, false, undefined, this),
70649
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70517
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70650
70518
  children: [
70651
70519
  " ",
70652
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70520
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70653
70521
  bold: true,
70654
70522
  color: "cyan",
70655
70523
  children: "Ralph Loop"
70656
70524
  }, undefined, false, undefined, this)
70657
70525
  ]
70658
70526
  }, undefined, true, undefined, this),
70659
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70527
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70660
70528
  color: "gray",
70661
70529
  children: SEPARATOR
70662
70530
  }, undefined, false, undefined, this),
70663
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70531
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70664
70532
  children: [
70665
70533
  " ",
70666
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70534
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70667
70535
  bold: true,
70668
70536
  children: "Mode:"
70669
70537
  }, undefined, false, undefined, this),
70670
70538
  " ",
70671
70539
  opts.mode,
70672
- opts.isResume && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70540
+ opts.isResume && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70673
70541
  dimColor: true,
70674
70542
  children: " (resumed)"
70675
70543
  }, undefined, false, undefined, this)
70676
70544
  ]
70677
70545
  }, undefined, true, undefined, this),
70678
- opts.mode === "task" && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70546
+ opts.mode === "task" && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70679
70547
  children: [
70680
70548
  " ",
70681
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70549
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70682
70550
  bold: true,
70683
70551
  children: "Task:"
70684
70552
  }, undefined, false, undefined, this),
@@ -70686,10 +70554,10 @@ function Banner({ state, ...opts }) {
70686
70554
  state.name
70687
70555
  ]
70688
70556
  }, undefined, true, undefined, this),
70689
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70557
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70690
70558
  children: [
70691
70559
  " ",
70692
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70560
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70693
70561
  bold: true,
70694
70562
  children: "Engine:"
70695
70563
  }, undefined, false, undefined, this),
@@ -70697,10 +70565,10 @@ function Banner({ state, ...opts }) {
70697
70565
  engineLabel
70698
70566
  ]
70699
70567
  }, undefined, true, undefined, this),
70700
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70568
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70701
70569
  children: [
70702
70570
  " ",
70703
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70571
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70704
70572
  bold: true,
70705
70573
  children: "Branch:"
70706
70574
  }, undefined, false, undefined, this),
@@ -70708,10 +70576,10 @@ function Banner({ state, ...opts }) {
70708
70576
  state.metadata.branch ?? "main"
70709
70577
  ]
70710
70578
  }, undefined, true, undefined, this),
70711
- opts.promptFile && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70579
+ opts.promptFile && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70712
70580
  children: [
70713
70581
  " ",
70714
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70582
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70715
70583
  bold: true,
70716
70584
  children: "Prompt:"
70717
70585
  }, undefined, false, undefined, this),
@@ -70719,20 +70587,20 @@ function Banner({ state, ...opts }) {
70719
70587
  opts.promptFile
70720
70588
  ]
70721
70589
  }, undefined, true, undefined, this),
70722
- opts.interactive && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70590
+ opts.interactive && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70723
70591
  children: [
70724
70592
  " ",
70725
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70593
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70726
70594
  bold: true,
70727
70595
  children: "Interactive:"
70728
70596
  }, undefined, false, undefined, this),
70729
70597
  " yes (research+plan phases)"
70730
70598
  ]
70731
70599
  }, undefined, true, undefined, this),
70732
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70600
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70733
70601
  children: [
70734
70602
  " ",
70735
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70603
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70736
70604
  bold: true,
70737
70605
  children: "No execute:"
70738
70606
  }, undefined, false, undefined, this),
@@ -70740,10 +70608,10 @@ function Banner({ state, ...opts }) {
70740
70608
  opts.noExecute ? "yes (research+plan only)" : "no"
70741
70609
  ]
70742
70610
  }, undefined, true, undefined, this),
70743
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70611
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70744
70612
  children: [
70745
70613
  " ",
70746
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70614
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70747
70615
  bold: true,
70748
70616
  children: "Max iters:"
70749
70617
  }, undefined, false, undefined, this),
@@ -70751,10 +70619,10 @@ function Banner({ state, ...opts }) {
70751
70619
  maxLabel
70752
70620
  ]
70753
70621
  }, undefined, true, undefined, this),
70754
- 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, {
70755
70623
  children: [
70756
70624
  " ",
70757
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70625
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70758
70626
  bold: true,
70759
70627
  children: "Cost cap:"
70760
70628
  }, undefined, false, undefined, this),
@@ -70762,10 +70630,10 @@ function Banner({ state, ...opts }) {
70762
70630
  opts.maxCostUsd
70763
70631
  ]
70764
70632
  }, undefined, true, undefined, this),
70765
- 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, {
70766
70634
  children: [
70767
70635
  " ",
70768
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70636
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70769
70637
  bold: true,
70770
70638
  children: "Runtime:"
70771
70639
  }, undefined, false, undefined, this),
@@ -70774,10 +70642,10 @@ function Banner({ state, ...opts }) {
70774
70642
  " min"
70775
70643
  ]
70776
70644
  }, undefined, true, undefined, this),
70777
- 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, {
70778
70646
  children: [
70779
70647
  " ",
70780
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70648
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70781
70649
  bold: true,
70782
70650
  children: "Fail limit:"
70783
70651
  }, undefined, false, undefined, this),
@@ -70786,10 +70654,10 @@ function Banner({ state, ...opts }) {
70786
70654
  " consecutive"
70787
70655
  ]
70788
70656
  }, undefined, true, undefined, this),
70789
- 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, {
70790
70658
  children: [
70791
70659
  " ",
70792
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70660
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70793
70661
  bold: true,
70794
70662
  children: "Delay:"
70795
70663
  }, undefined, false, undefined, this),
@@ -70798,31 +70666,31 @@ function Banner({ state, ...opts }) {
70798
70666
  "s between runs"
70799
70667
  ]
70800
70668
  }, undefined, true, undefined, this),
70801
- 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, {
70802
70670
  children: [
70803
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70671
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70804
70672
  color: "gray",
70805
70673
  children: SEPARATOR
70806
70674
  }, undefined, false, undefined, this),
70807
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70675
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70808
70676
  children: [
70809
70677
  " ",
70810
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70678
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70811
70679
  bold: true,
70812
70680
  children: "Prompt:"
70813
70681
  }, undefined, false, undefined, this)
70814
70682
  ]
70815
70683
  }, undefined, true, undefined, this),
70816
- 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, {
70817
70685
  children: [
70818
70686
  " ",
70819
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70687
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70820
70688
  color: "gray",
70821
70689
  children: line
70822
70690
  }, undefined, false, undefined, this)
70823
70691
  ]
70824
70692
  }, i, true, undefined, this)),
70825
- promptLines.length > maxPromptLines && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70693
+ promptLines.length > maxPromptLines && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70826
70694
  dimColor: true,
70827
70695
  children: [
70828
70696
  " ",
@@ -70833,7 +70701,7 @@ function Banner({ state, ...opts }) {
70833
70701
  }, undefined, true, undefined, this)
70834
70702
  ]
70835
70703
  }, undefined, true, undefined, this),
70836
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70704
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
70837
70705
  color: "gray",
70838
70706
  children: SEPARATOR
70839
70707
  }, undefined, false, undefined, this)
@@ -70842,15 +70710,15 @@ function Banner({ state, ...opts }) {
70842
70710
  }
70843
70711
 
70844
70712
  // apps/cli/src/components/IterationHeader.tsx
70845
- var jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
70713
+ var jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
70846
70714
  function IterationHeader({ iteration, time }) {
70847
- return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
70715
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
70848
70716
  children: [
70849
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70717
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70850
70718
  color: "gray",
70851
70719
  children: "\u2500\u2500\u2500 "
70852
70720
  }, undefined, false, undefined, this),
70853
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70721
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70854
70722
  bold: true,
70855
70723
  color: "cyan",
70856
70724
  children: [
@@ -70858,7 +70726,7 @@ function IterationHeader({ iteration, time }) {
70858
70726
  iteration
70859
70727
  ]
70860
70728
  }, undefined, true, undefined, this),
70861
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70729
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70862
70730
  color: "gray",
70863
70731
  children: [
70864
70732
  " ",
@@ -70866,7 +70734,7 @@ function IterationHeader({ iteration, time }) {
70866
70734
  " "
70867
70735
  ]
70868
70736
  }, undefined, true, undefined, this),
70869
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70737
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
70870
70738
  color: "gray",
70871
70739
  children: "\u2500\u2500\u2500"
70872
70740
  }, undefined, false, undefined, this)
@@ -70875,20 +70743,20 @@ function IterationHeader({ iteration, time }) {
70875
70743
  }
70876
70744
 
70877
70745
  // apps/cli/src/components/FeedLine.tsx
70878
- var jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
70746
+ var jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
70879
70747
  var INDENT = 2;
70880
70748
  function SessionLine({ event }) {
70881
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
70749
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
70882
70750
  children: [
70883
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70751
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70884
70752
  color: "gray",
70885
70753
  children: "\u2500\u2500 "
70886
70754
  }, undefined, false, undefined, this),
70887
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70755
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70888
70756
  bold: true,
70889
70757
  children: event.model
70890
70758
  }, undefined, false, undefined, this),
70891
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70759
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70892
70760
  color: "gray",
70893
70761
  children: [
70894
70762
  " (",
@@ -70900,18 +70768,18 @@ function SessionLine({ event }) {
70900
70768
  }, undefined, true, undefined, this);
70901
70769
  }
70902
70770
  function SessionUnknown({ event }) {
70903
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
70771
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
70904
70772
  paddingLeft: INDENT,
70905
70773
  children: [
70906
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70774
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70907
70775
  color: "red",
70908
70776
  children: "\u2717 "
70909
70777
  }, undefined, false, undefined, this),
70910
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70778
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70911
70779
  bold: true,
70912
70780
  children: "UNKNOWN"
70913
70781
  }, undefined, false, undefined, this),
70914
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70782
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70915
70783
  dimColor: true,
70916
70784
  children: [
70917
70785
  " (",
@@ -70924,14 +70792,14 @@ function SessionUnknown({ event }) {
70924
70792
  }
70925
70793
  function ThinkingLine({ event }) {
70926
70794
  if (event.preview) {
70927
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
70795
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
70928
70796
  paddingLeft: INDENT,
70929
70797
  children: [
70930
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70798
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70931
70799
  color: "white",
70932
70800
  children: "\uD83D\uDCAD "
70933
70801
  }, undefined, false, undefined, this),
70934
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70802
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70935
70803
  dimColor: true,
70936
70804
  children: event.preview.split(`
70937
70805
  `)[0]
@@ -70939,18 +70807,18 @@ function ThinkingLine({ event }) {
70939
70807
  ]
70940
70808
  }, undefined, true, undefined, this);
70941
70809
  }
70942
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
70810
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
70943
70811
  paddingLeft: INDENT,
70944
- children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70812
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70945
70813
  color: "white",
70946
70814
  children: "\uD83D\uDCAD"
70947
70815
  }, undefined, false, undefined, this)
70948
70816
  }, undefined, false, undefined, this);
70949
70817
  }
70950
70818
  function TextLine({ event }) {
70951
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
70819
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
70952
70820
  paddingLeft: INDENT,
70953
- children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70821
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70954
70822
  children: event.text
70955
70823
  }, undefined, false, undefined, this)
70956
70824
  }, undefined, false, undefined, this);
@@ -70966,16 +70834,16 @@ var summaryEmoji = {
70966
70834
  raw: ""
70967
70835
  };
70968
70836
  var summaryRenderers = {
70969
- file: (s) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
70837
+ file: (s) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
70970
70838
  children: [
70971
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70839
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70972
70840
  color: "white",
70973
70841
  children: [
70974
70842
  " ",
70975
70843
  summaryEmoji.file
70976
70844
  ]
70977
70845
  }, undefined, true, undefined, this),
70978
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70846
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70979
70847
  dimColor: true,
70980
70848
  children: [
70981
70849
  " ",
@@ -70984,16 +70852,16 @@ var summaryRenderers = {
70984
70852
  }, undefined, true, undefined, this)
70985
70853
  ]
70986
70854
  }, undefined, true, undefined, this),
70987
- command: (s) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
70855
+ command: (s) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
70988
70856
  children: [
70989
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70857
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70990
70858
  color: "white",
70991
70859
  children: [
70992
70860
  " ",
70993
70861
  summaryEmoji.command
70994
70862
  ]
70995
70863
  }, undefined, true, undefined, this),
70996
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70864
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
70997
70865
  dimColor: true,
70998
70866
  children: [
70999
70867
  " ",
@@ -71004,16 +70872,16 @@ var summaryRenderers = {
71004
70872
  }, undefined, true, undefined, this),
71005
70873
  search: (s) => {
71006
70874
  const { pattern, path } = s;
71007
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
70875
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
71008
70876
  children: [
71009
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70877
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71010
70878
  color: "white",
71011
70879
  children: [
71012
70880
  " ",
71013
70881
  summaryEmoji.search
71014
70882
  ]
71015
70883
  }, undefined, true, undefined, this),
71016
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70884
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71017
70885
  dimColor: true,
71018
70886
  children: [
71019
70887
  " ",
@@ -71024,16 +70892,16 @@ var summaryRenderers = {
71024
70892
  ]
71025
70893
  }, undefined, true, undefined, this);
71026
70894
  },
71027
- url: (s) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
70895
+ url: (s) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
71028
70896
  children: [
71029
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70897
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71030
70898
  color: "white",
71031
70899
  children: [
71032
70900
  " ",
71033
70901
  summaryEmoji.url
71034
70902
  ]
71035
70903
  }, undefined, true, undefined, this),
71036
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70904
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71037
70905
  dimColor: true,
71038
70906
  children: [
71039
70907
  " ",
@@ -71042,16 +70910,16 @@ var summaryRenderers = {
71042
70910
  }, undefined, true, undefined, this)
71043
70911
  ]
71044
70912
  }, undefined, true, undefined, this),
71045
- prompt: (s) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
70913
+ prompt: (s) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
71046
70914
  children: [
71047
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70915
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71048
70916
  color: "white",
71049
70917
  children: [
71050
70918
  " ",
71051
70919
  summaryEmoji.prompt
71052
70920
  ]
71053
70921
  }, undefined, true, undefined, this),
71054
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70922
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71055
70923
  dimColor: true,
71056
70924
  children: [
71057
70925
  " ",
@@ -71060,37 +70928,37 @@ var summaryRenderers = {
71060
70928
  }, undefined, true, undefined, this)
71061
70929
  ]
71062
70930
  }, undefined, true, undefined, this),
71063
- edit: () => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
70931
+ edit: () => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
71064
70932
  children: [
71065
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70933
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71066
70934
  color: "white",
71067
70935
  children: [
71068
70936
  " ",
71069
70937
  summaryEmoji.edit
71070
70938
  ]
71071
70939
  }, undefined, true, undefined, this),
71072
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70940
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71073
70941
  dimColor: true,
71074
70942
  children: " edit"
71075
70943
  }, undefined, false, undefined, this)
71076
70944
  ]
71077
70945
  }, undefined, true, undefined, this),
71078
- write: () => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
70946
+ write: () => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
71079
70947
  children: [
71080
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70948
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71081
70949
  color: "white",
71082
70950
  children: [
71083
70951
  " ",
71084
70952
  summaryEmoji.write
71085
70953
  ]
71086
70954
  }, undefined, true, undefined, this),
71087
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70955
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71088
70956
  dimColor: true,
71089
70957
  children: " write"
71090
70958
  }, undefined, false, undefined, this)
71091
70959
  ]
71092
70960
  }, undefined, true, undefined, this),
71093
- raw: (s) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70961
+ raw: (s) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71094
70962
  dimColor: true,
71095
70963
  children: [
71096
70964
  " ",
@@ -71099,10 +70967,10 @@ var summaryRenderers = {
71099
70967
  }, undefined, true, undefined, this)
71100
70968
  };
71101
70969
  function ToolStartLine({ event }) {
71102
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
70970
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71103
70971
  paddingLeft: INDENT,
71104
70972
  children: [
71105
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70973
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71106
70974
  color: "cyan",
71107
70975
  children: [
71108
70976
  "\u25B6 ",
@@ -71116,15 +70984,15 @@ function ToolStartLine({ event }) {
71116
70984
  function ToolResultPreview({
71117
70985
  event
71118
70986
  }) {
71119
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
70987
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71120
70988
  flexDirection: "column",
71121
70989
  paddingLeft: INDENT + 2,
71122
70990
  children: [
71123
- event.lines.map((line, i) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70991
+ event.lines.map((line, i) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71124
70992
  dimColor: true,
71125
70993
  children: line
71126
70994
  }, i, false, undefined, this)),
71127
- event.truncated ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
70995
+ event.truncated ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71128
70996
  dimColor: true,
71129
70997
  children: [
71130
70998
  "\u2026 (",
@@ -71136,23 +71004,23 @@ function ToolResultPreview({
71136
71004
  }, undefined, true, undefined, this);
71137
71005
  }
71138
71006
  function TurnStartLine() {
71139
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71007
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71140
71008
  paddingLeft: INDENT,
71141
- children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71009
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71142
71010
  bold: true,
71143
71011
  children: "\u25B6 turn started"
71144
71012
  }, undefined, false, undefined, this)
71145
71013
  }, undefined, false, undefined, this);
71146
71014
  }
71147
71015
  function TurnDoneLine({ event }) {
71148
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71016
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71149
71017
  paddingLeft: INDENT,
71150
71018
  children: [
71151
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71019
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71152
71020
  color: "green",
71153
71021
  children: "\u2713 done"
71154
71022
  }, undefined, false, undefined, this),
71155
- event.inputTokens !== undefined && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71023
+ event.inputTokens !== undefined && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71156
71024
  dimColor: true,
71157
71025
  children: [
71158
71026
  " ",
@@ -71177,14 +71045,14 @@ function ResultLine({ event }) {
71177
71045
  `out=${event.outputTokens}`,
71178
71046
  `cached=${event.cached}`
71179
71047
  ].join(" ");
71180
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71048
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71181
71049
  paddingLeft: INDENT,
71182
71050
  children: [
71183
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71051
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71184
71052
  color: "green",
71185
71053
  children: "\u2713 done"
71186
71054
  }, undefined, false, undefined, this),
71187
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71055
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71188
71056
  dimColor: true,
71189
71057
  children: [
71190
71058
  " ",
@@ -71195,15 +71063,15 @@ function ResultLine({ event }) {
71195
71063
  }, undefined, true, undefined, this);
71196
71064
  }
71197
71065
  function ResultErrorLine({ event }) {
71198
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71066
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71199
71067
  paddingLeft: INDENT,
71200
71068
  children: [
71201
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71069
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71202
71070
  color: "red",
71203
71071
  bold: true,
71204
71072
  children: "\u2717 Error"
71205
71073
  }, undefined, false, undefined, this),
71206
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71074
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71207
71075
  color: "red",
71208
71076
  children: [
71209
71077
  " ",
@@ -71214,29 +71082,29 @@ function ResultErrorLine({ event }) {
71214
71082
  }, undefined, true, undefined, this);
71215
71083
  }
71216
71084
  function ErrorLine({ event }) {
71217
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71085
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71218
71086
  paddingLeft: INDENT,
71219
71087
  children: [
71220
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71088
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71221
71089
  color: "red",
71222
71090
  children: "error: "
71223
71091
  }, undefined, false, undefined, this),
71224
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71092
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71225
71093
  children: event.message
71226
71094
  }, undefined, false, undefined, this)
71227
71095
  ]
71228
71096
  }, undefined, true, undefined, this);
71229
71097
  }
71230
71098
  function RateLimitLine({ event }) {
71231
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71099
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71232
71100
  paddingLeft: INDENT,
71233
71101
  children: [
71234
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71102
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71235
71103
  color: "red",
71236
71104
  bold: true,
71237
71105
  children: "\u2717 Rate limit reached"
71238
71106
  }, undefined, false, undefined, this),
71239
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71107
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71240
71108
  color: "red",
71241
71109
  children: [
71242
71110
  " ",
@@ -71247,24 +71115,24 @@ function RateLimitLine({ event }) {
71247
71115
  }, undefined, true, undefined, this);
71248
71116
  }
71249
71117
  function InterruptedLine({ event }) {
71250
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71118
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71251
71119
  flexDirection: "column",
71252
71120
  paddingLeft: INDENT,
71253
71121
  children: [
71254
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71122
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71255
71123
  children: [
71256
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71124
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71257
71125
  color: "red",
71258
71126
  bold: true,
71259
71127
  children: "\u2717 Stream interrupted"
71260
71128
  }, undefined, false, undefined, this),
71261
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71129
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71262
71130
  dimColor: true,
71263
71131
  children: " (no result received)"
71264
71132
  }, undefined, false, undefined, this)
71265
71133
  ]
71266
71134
  }, undefined, true, undefined, this),
71267
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71135
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71268
71136
  dimColor: true,
71269
71137
  children: [
71270
71138
  "turns=",
@@ -71277,9 +71145,9 @@ function InterruptedLine({ event }) {
71277
71145
  }, undefined, true, undefined, this);
71278
71146
  }
71279
71147
  function AgentLine({ event }) {
71280
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71148
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
71281
71149
  paddingLeft: INDENT,
71282
- children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71150
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71283
71151
  dimColor: true,
71284
71152
  children: [
71285
71153
  "\u22B3 agent: ",
@@ -71291,27 +71159,27 @@ function AgentLine({ event }) {
71291
71159
  function FeedLine({ event, verbose }) {
71292
71160
  switch (event.type) {
71293
71161
  case "session":
71294
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(SessionLine, {
71162
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(SessionLine, {
71295
71163
  event
71296
71164
  }, undefined, false, undefined, this);
71297
71165
  case "session-unknown":
71298
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(SessionUnknown, {
71166
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(SessionUnknown, {
71299
71167
  event
71300
71168
  }, undefined, false, undefined, this);
71301
71169
  case "agent":
71302
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(AgentLine, {
71170
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(AgentLine, {
71303
71171
  event
71304
71172
  }, undefined, false, undefined, this);
71305
71173
  case "thinking":
71306
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThinkingLine, {
71174
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThinkingLine, {
71307
71175
  event
71308
71176
  }, undefined, false, undefined, this);
71309
71177
  case "text":
71310
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(TextLine, {
71178
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TextLine, {
71311
71179
  event
71312
71180
  }, undefined, false, undefined, this);
71313
71181
  case "tool-start":
71314
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ToolStartLine, {
71182
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ToolStartLine, {
71315
71183
  event
71316
71184
  }, undefined, false, undefined, this);
71317
71185
  case "tool-end":
@@ -71319,37 +71187,37 @@ function FeedLine({ event, verbose }) {
71319
71187
  case "tool-result-preview":
71320
71188
  if (!verbose)
71321
71189
  return null;
71322
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ToolResultPreview, {
71190
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ToolResultPreview, {
71323
71191
  event
71324
71192
  }, undefined, false, undefined, this);
71325
71193
  case "turn-start":
71326
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(TurnStartLine, {}, undefined, false, undefined, this);
71194
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TurnStartLine, {}, undefined, false, undefined, this);
71327
71195
  case "turn-done":
71328
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(TurnDoneLine, {
71196
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TurnDoneLine, {
71329
71197
  event
71330
71198
  }, undefined, false, undefined, this);
71331
71199
  case "result":
71332
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ResultLine, {
71200
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ResultLine, {
71333
71201
  event
71334
71202
  }, undefined, false, undefined, this);
71335
71203
  case "result-error":
71336
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ResultErrorLine, {
71204
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ResultErrorLine, {
71337
71205
  event
71338
71206
  }, undefined, false, undefined, this);
71339
71207
  case "error":
71340
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ErrorLine, {
71208
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ErrorLine, {
71341
71209
  event
71342
71210
  }, undefined, false, undefined, this);
71343
71211
  case "rate-limit":
71344
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(RateLimitLine, {
71212
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(RateLimitLine, {
71345
71213
  event
71346
71214
  }, undefined, false, undefined, this);
71347
71215
  case "interrupted":
71348
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(InterruptedLine, {
71216
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(InterruptedLine, {
71349
71217
  event
71350
71218
  }, undefined, false, undefined, this);
71351
71219
  case "raw":
71352
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71220
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
71353
71221
  dimColor: true,
71354
71222
  children: event.text
71355
71223
  }, undefined, false, undefined, this);
@@ -71357,8 +71225,8 @@ function FeedLine({ event, verbose }) {
71357
71225
  }
71358
71226
 
71359
71227
  // apps/cli/src/components/StatusBar.tsx
71360
- var import_react54 = __toESM(require_react(), 1);
71361
- 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);
71362
71230
  function formatElapsed(ms) {
71363
71231
  const totalSec = Math.floor(ms / 1000);
71364
71232
  if (totalSec < 60)
@@ -71371,7 +71239,7 @@ function formatElapsed(ms) {
71371
71239
  return `${hr}h ${min2 % 60}m`;
71372
71240
  }
71373
71241
  function Sep() {
71374
- return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71242
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71375
71243
  color: "gray",
71376
71244
  children: " \u2502 "
71377
71245
  }, undefined, false, undefined, this);
@@ -71384,46 +71252,46 @@ function StatusBar({
71384
71252
  model,
71385
71253
  isRunning
71386
71254
  }) {
71387
- const [elapsed, setElapsed] = import_react54.useState(0);
71388
- import_react54.useEffect(() => {
71255
+ const [elapsed, setElapsed] = import_react53.useState(0);
71256
+ import_react53.useEffect(() => {
71389
71257
  if (!isRunning)
71390
71258
  return;
71391
71259
  const id = setInterval(() => setElapsed(Date.now() - startedAt), 1000);
71392
71260
  return () => clearInterval(id);
71393
71261
  }, [isRunning, startedAt]);
71394
71262
  const bar = "\u2500".repeat(52);
71395
- return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
71263
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71396
71264
  flexDirection: "column",
71397
71265
  children: [
71398
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71266
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71399
71267
  color: "gray",
71400
71268
  children: bar
71401
71269
  }, undefined, false, undefined, this),
71402
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
71270
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
71403
71271
  children: [
71404
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71272
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71405
71273
  children: " "
71406
71274
  }, undefined, false, undefined, this),
71407
- isRunning ? /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Spinner, {
71275
+ isRunning ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Spinner, {
71408
71276
  label: ""
71409
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71277
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71410
71278
  color: "green",
71411
71279
  children: "\u2713"
71412
71280
  }, undefined, false, undefined, this),
71413
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71281
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71414
71282
  children: " "
71415
71283
  }, undefined, false, undefined, this),
71416
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71284
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71417
71285
  children: "iter "
71418
71286
  }, undefined, false, undefined, this),
71419
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71287
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71420
71288
  bold: true,
71421
71289
  children: iteration
71422
71290
  }, undefined, false, undefined, this),
71423
- costUsd > 0 && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(jsx_dev_runtime6.Fragment, {
71291
+ costUsd > 0 && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
71424
71292
  children: [
71425
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Sep, {}, undefined, false, undefined, this),
71426
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71293
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Sep, {}, undefined, false, undefined, this),
71294
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71427
71295
  color: "magenta",
71428
71296
  children: [
71429
71297
  "$",
@@ -71432,13 +71300,13 @@ function StatusBar({
71432
71300
  }, undefined, true, undefined, this)
71433
71301
  ]
71434
71302
  }, undefined, true, undefined, this),
71435
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Sep, {}, undefined, false, undefined, this),
71436
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71303
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Sep, {}, undefined, false, undefined, this),
71304
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71437
71305
  dimColor: true,
71438
71306
  children: formatElapsed(elapsed)
71439
71307
  }, undefined, false, undefined, this),
71440
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Sep, {}, undefined, false, undefined, this),
71441
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71308
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Sep, {}, undefined, false, undefined, this),
71309
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71442
71310
  dimColor: true,
71443
71311
  children: [
71444
71312
  engine,
@@ -71448,7 +71316,7 @@ function StatusBar({
71448
71316
  }, undefined, true, undefined, this)
71449
71317
  ]
71450
71318
  }, undefined, true, undefined, this),
71451
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71319
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
71452
71320
  color: "gray",
71453
71321
  children: bar
71454
71322
  }, undefined, false, undefined, this)
@@ -71457,7 +71325,7 @@ function StatusBar({
71457
71325
  }
71458
71326
 
71459
71327
  // apps/cli/src/components/StopMessage.tsx
71460
- var jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
71328
+ var jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
71461
71329
  function StopMessage({
71462
71330
  reason,
71463
71331
  state,
@@ -71469,17 +71337,17 @@ function StopMessage({
71469
71337
  }) {
71470
71338
  switch (reason) {
71471
71339
  case "completed": {
71472
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
71340
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
71473
71341
  flexDirection: "column",
71474
71342
  children: [
71475
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
71343
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71476
71344
  children: [
71477
71345
  `
71478
71346
  `,
71479
71347
  "All tasks completed \u2014 change archived."
71480
71348
  ]
71481
71349
  }, undefined, true, undefined, this),
71482
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
71350
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71483
71351
  children: [
71484
71352
  "See: ",
71485
71353
  stateDir,
@@ -71490,7 +71358,7 @@ function StopMessage({
71490
71358
  }, undefined, true, undefined, this);
71491
71359
  }
71492
71360
  case "maxIterations":
71493
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
71361
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71494
71362
  children: [
71495
71363
  `
71496
71364
  `,
@@ -71499,7 +71367,7 @@ function StopMessage({
71499
71367
  ]
71500
71368
  }, undefined, true, undefined, this);
71501
71369
  case "costCap":
71502
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
71370
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71503
71371
  color: "yellow",
71504
71372
  bold: true,
71505
71373
  children: [
@@ -71516,7 +71384,7 @@ function StopMessage({
71516
71384
  ]
71517
71385
  }, undefined, true, undefined, this);
71518
71386
  case "runtimeLimit":
71519
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
71387
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71520
71388
  color: "yellow",
71521
71389
  bold: true,
71522
71390
  children: [
@@ -71528,7 +71396,7 @@ function StopMessage({
71528
71396
  ]
71529
71397
  }, undefined, true, undefined, this);
71530
71398
  case "consecutiveFailures":
71531
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
71399
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71532
71400
  color: "red",
71533
71401
  bold: true,
71534
71402
  children: [
@@ -71540,7 +71408,7 @@ function StopMessage({
71540
71408
  ]
71541
71409
  }, undefined, true, undefined, this);
71542
71410
  case "rateLimited":
71543
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
71411
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
71544
71412
  color: "red",
71545
71413
  bold: true,
71546
71414
  children: [
@@ -71553,8 +71421,8 @@ function StopMessage({
71553
71421
  }
71554
71422
 
71555
71423
  // apps/cli/src/hooks/useLoop.ts
71556
- var import_react55 = __toESM(require_react(), 1);
71557
- import { join as join9 } from "path";
71424
+ var import_react54 = __toESM(require_react(), 1);
71425
+ import { join as join7 } from "path";
71558
71426
 
71559
71427
  // packages/engine/src/spawn.ts
71560
71428
  var {spawn: bunSpawn } = globalThis.Bun;
@@ -71564,7 +71432,7 @@ var spawn = bunSpawn;
71564
71432
  import { createWriteStream } from "fs";
71565
71433
  import { mkdtemp, unlink, mkdir } from "fs/promises";
71566
71434
  import { dirname as dirname2 } from "path";
71567
- import { join as join6 } from "path";
71435
+ import { join as join4 } from "path";
71568
71436
  import { tmpdir } from "os";
71569
71437
 
71570
71438
  // packages/engine/src/feed-events.ts
@@ -72297,7 +72165,7 @@ function buildCodexArgs() {
72297
72165
  return ["exec", "--json", "--color", "never", "--dangerously-bypass-approvals-and-sandbox", "-"];
72298
72166
  }
72299
72167
  async function runInteractive(model, prompt, taskDir) {
72300
- 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");
72301
72169
  await Bun.write(promptFile, prompt);
72302
72170
  try {
72303
72171
  const cmd = [
@@ -72323,7 +72191,7 @@ async function runInteractive(model, prompt, taskDir) {
72323
72191
  stderr: "inherit"
72324
72192
  });
72325
72193
  const exitCode = await proc.exited;
72326
- const doneFile = taskDir ? join6(taskDir, "_interactive_done") : null;
72194
+ const doneFile = taskDir ? join4(taskDir, "_interactive_done") : null;
72327
72195
  if (doneFile && await Bun.file(doneFile).exists()) {
72328
72196
  return { exitCode: 0, usage: null, sessionId: null, rateLimited: false };
72329
72197
  }
@@ -72540,12 +72408,12 @@ function commitTaskDir(taskDir, message) {
72540
72408
  init_src();
72541
72409
 
72542
72410
  // packages/core/src/loop.ts
72543
- import { join as join8 } from "path";
72411
+ import { join as join6 } from "path";
72544
72412
  var STEERING_MAX_LINES = 20;
72545
72413
  function buildTaskPrompt(state, taskDir) {
72546
72414
  const storage = getStorage();
72547
72415
  let prompt = "";
72548
- const steeringContent = storage.read(join8(taskDir, "steering.md"));
72416
+ const steeringContent = storage.read(join6(taskDir, "steering.md"));
72549
72417
  if (steeringContent !== null) {
72550
72418
  const steeringLines = steeringContent.split(`
72551
72419
  `).filter((line) => !line.startsWith("#")).filter((line) => line.trim()).slice(0, STEERING_MAX_LINES);
@@ -72564,7 +72432,7 @@ function buildTaskPrompt(state, taskDir) {
72564
72432
  `;
72565
72433
  }
72566
72434
  }
72567
- const tasksContent = storage.read(join8(taskDir, "tasks.md"));
72435
+ const tasksContent = storage.read(join6(taskDir, "tasks.md"));
72568
72436
  if (tasksContent !== null) {
72569
72437
  const section = firstUnchecked(tasksContent);
72570
72438
  if (section) {
@@ -72579,7 +72447,7 @@ function buildTaskPrompt(state, taskDir) {
72579
72447
  prompt += `---
72580
72448
 
72581
72449
  `;
72582
- 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.
72583
72451
 
72584
72452
  `;
72585
72453
  }
@@ -72600,7 +72468,7 @@ function buildTaskPrompt(state, taskDir) {
72600
72468
  `;
72601
72469
  }
72602
72470
  if (state.manualTest) {
72603
- const tasksContent2 = storage.read(join8(taskDir, "tasks.md"));
72471
+ const tasksContent2 = storage.read(join6(taskDir, "tasks.md"));
72604
72472
  const hasUncheckedTasks = tasksContent2 !== null && /^- \[ \]/m.test(tasksContent2);
72605
72473
  if (!hasUncheckedTasks) {
72606
72474
  const hasManualTestSection = tasksContent2 !== null && /^## Manual Testing/m.test(tasksContent2);
@@ -72649,7 +72517,7 @@ When all tasks are complete and all files are committed, push your branch and op
72649
72517
  }
72650
72518
  function checkStopSignal(taskDir, stateDir) {
72651
72519
  const storage = getStorage();
72652
- const stopFile = join8(taskDir, "STOP");
72520
+ const stopFile = join6(taskDir, "STOP");
72653
72521
  const reason = storage.read(stopFile);
72654
72522
  if (reason === null)
72655
72523
  return null;
@@ -72724,7 +72592,7 @@ function updateStateIteration(stateDir, result2, startedAt, engine, model, usage
72724
72592
  }
72725
72593
  function appendSteeringMessage(taskDir, message) {
72726
72594
  const storage = getStorage();
72727
- const steeringPath = join8(taskDir, "steering.md");
72595
+ const steeringPath = join6(taskDir, "steering.md");
72728
72596
  const existing = storage.read(steeringPath);
72729
72597
  const updated = existing ? `${message}
72730
72598
 
@@ -72760,22 +72628,22 @@ function sleep(seconds) {
72760
72628
  return new Promise((resolve2) => setTimeout(resolve2, seconds * 1000));
72761
72629
  }
72762
72630
  function useLoop(opts) {
72763
- const [state, setState] = import_react55.useState(null);
72764
- const [iteration, setIteration] = import_react55.useState(0);
72765
- const [consecutiveFailures, setConsecutiveFailures] = import_react55.useState(0);
72766
- const [logLines, setLogLines] = import_react55.useState([]);
72767
- const [stopReason, setStopReason] = import_react55.useState(null);
72768
- const [isRunning, setIsRunning] = import_react55.useState(true);
72769
- const [isResume, setIsResume] = import_react55.useState(false);
72770
- const [startedAt] = import_react55.useState(() => Date.now());
72771
- const lineIdRef = import_react55.useRef(0);
72772
- const steerControllerRef = import_react55.useRef(null);
72773
- 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);
72774
72642
  const steer = (message) => {
72775
72643
  pendingSteerRef.current = message;
72776
72644
  steerControllerRef.current?.abort();
72777
72645
  };
72778
- import_react55.useEffect(() => {
72646
+ import_react54.useEffect(() => {
72779
72647
  let cancelled = false;
72780
72648
  const nextId = () => String(lineIdRef.current++);
72781
72649
  const addInfo = (text) => {
@@ -72791,11 +72659,11 @@ function useLoop(opts) {
72791
72659
  setLogLines((prev) => [...prev, { id: nextId(), kind: "feed", event }]);
72792
72660
  };
72793
72661
  runWithContext(createDefaultContext(), async () => {
72794
- const stateDir = join9(opts.statesDir, opts.name);
72795
- const tasksDir = join9(opts.tasksDir, opts.name);
72662
+ const stateDir = join7(opts.statesDir, opts.name);
72663
+ const tasksDir = join7(opts.tasksDir, opts.name);
72796
72664
  const storage = getStorage();
72797
72665
  let currentState;
72798
- const existingStateRaw = storage.read(join9(stateDir, ".ralph-state.json"));
72666
+ const existingStateRaw = storage.read(join7(stateDir, ".ralph-state.json"));
72799
72667
  if (existingStateRaw !== null) {
72800
72668
  currentState = readState(stateDir);
72801
72669
  if (currentState.engine !== opts.engine || currentState.model !== opts.model) {
@@ -72842,7 +72710,7 @@ function useLoop(opts) {
72842
72710
  setStopReason(stop);
72843
72711
  break;
72844
72712
  }
72845
- const tasksContent = storage.read(join9(tasksDir, "tasks.md"));
72713
+ const tasksContent = storage.read(join7(tasksDir, "tasks.md"));
72846
72714
  if (tasksContent !== null) {
72847
72715
  const remaining = countUnchecked(tasksContent);
72848
72716
  addInfo(`tasks.md: ${remaining} unchecked item${remaining === 1 ? "" : "s"} remaining`);
@@ -72882,7 +72750,7 @@ function useLoop(opts) {
72882
72750
  model: opts.model,
72883
72751
  prompt,
72884
72752
  logFlag: opts.log,
72885
- logFile: join9(stateDir, "log.json"),
72753
+ logFile: join7(stateDir, "log.json"),
72886
72754
  taskDir: tasksDir,
72887
72755
  interactive: false,
72888
72756
  onFeedEvent: addFeedEvent,
@@ -72905,7 +72773,7 @@ function useLoop(opts) {
72905
72773
  model: opts.model,
72906
72774
  prompt: buildSteeringPrompt(steerMessage),
72907
72775
  logFlag: opts.log,
72908
- logFile: join9(stateDir, "log.json"),
72776
+ logFile: join7(stateDir, "log.json"),
72909
72777
  taskDir: tasksDir,
72910
72778
  onFeedEvent: addResumeFeedEvent,
72911
72779
  signal: resumeController.signal,
@@ -73002,16 +72870,16 @@ function useLoop(opts) {
73002
72870
  }
73003
72871
 
73004
72872
  // apps/cli/src/components/TaskLoop.tsx
73005
- var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
72873
+ var jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
73006
72874
  function LogLine({ entry, verbose }) {
73007
72875
  switch (entry.kind) {
73008
72876
  case "iterationHeader":
73009
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(IterationHeader, {
72877
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(IterationHeader, {
73010
72878
  iteration: entry.iteration,
73011
72879
  time: entry.time
73012
72880
  }, undefined, false, undefined, this);
73013
72881
  case "info":
73014
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
72882
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
73015
72883
  dimColor: true,
73016
72884
  children: [
73017
72885
  " ",
@@ -73019,7 +72887,7 @@ function LogLine({ entry, verbose }) {
73019
72887
  ]
73020
72888
  }, undefined, true, undefined, this);
73021
72889
  case "feed":
73022
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(FeedLine, {
72890
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(FeedLine, {
73023
72891
  event: entry.event,
73024
72892
  verbose
73025
72893
  }, undefined, false, undefined, this);
@@ -73053,10 +72921,10 @@ function handleSteerKeyInput(key, history, currentIndex) {
73053
72921
  return navigateHistory(history, currentIndex, dir);
73054
72922
  }
73055
72923
  function SteerInput({ onSubmit }) {
73056
- const [inputKey, setInputKey] = import_react56.useState(0);
73057
- const [defaultValue, setDefaultValue] = import_react56.useState("");
73058
- const historyRef = import_react56.useRef([]);
73059
- 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);
73060
72928
  use_input_default((_input, key) => {
73061
72929
  const result2 = handleSteerKeyInput(key, historyRef.current, historyIndexRef.current);
73062
72930
  if (result2) {
@@ -73065,13 +72933,13 @@ function SteerInput({ onSubmit }) {
73065
72933
  setInputKey((k) => k + 1);
73066
72934
  }
73067
72935
  });
73068
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
72936
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
73069
72937
  children: [
73070
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
72938
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
73071
72939
  dimColor: true,
73072
72940
  children: "steer: "
73073
72941
  }, undefined, false, undefined, this),
73074
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(TextInput, {
72942
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(TextInput, {
73075
72943
  defaultValue,
73076
72944
  onSubmit: (v) => {
73077
72945
  if (processSteerSubmit(v, historyRef.current, onSubmit)) {
@@ -73088,27 +72956,27 @@ function TaskLoop({ opts }) {
73088
72956
  const { exit } = use_app_default();
73089
72957
  const loop = useLoop(opts);
73090
72958
  const { isRawModeSupported } = use_stdin_default();
73091
- const bannerItem = import_react56.useRef({ id: "__banner__", kind: "banner" });
73092
- const feedItems = import_react56.useMemo(() => [
72959
+ const bannerItem = import_react55.useRef({ id: "__banner__", kind: "banner" });
72960
+ const feedItems = import_react55.useMemo(() => [
73093
72961
  bannerItem.current,
73094
72962
  ...loop.logLines.map((e) => ({ id: e.id, kind: "entry", entry: e }))
73095
72963
  ], [loop.logLines]);
73096
- import_react56.useEffect(() => {
72964
+ import_react55.useEffect(() => {
73097
72965
  if (!loop.isRunning) {
73098
72966
  exit();
73099
72967
  }
73100
72968
  }, [loop.isRunning, exit]);
73101
72969
  if (!loop.state)
73102
72970
  return null;
73103
- const stateDir = join10(opts.statesDir, opts.name);
73104
- 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, {
73105
72973
  flexDirection: "column",
73106
72974
  children: [
73107
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Static, {
72975
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Static, {
73108
72976
  items: feedItems,
73109
72977
  children: (item) => {
73110
72978
  if (item.kind === "banner") {
73111
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Banner, {
72979
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Banner, {
73112
72980
  state: loop.state,
73113
72981
  mode: "task",
73114
72982
  isResume: loop.isResume,
@@ -73120,15 +72988,15 @@ function TaskLoop({ opts }) {
73120
72988
  taskPrompt: opts.prompt || loop.state.prompt
73121
72989
  }, item.id, false, undefined, this);
73122
72990
  }
73123
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(LogLine, {
72991
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(LogLine, {
73124
72992
  entry: item.entry,
73125
72993
  verbose: opts.verbose
73126
72994
  }, item.id, false, undefined, this);
73127
72995
  }
73128
72996
  }, undefined, false, undefined, this),
73129
- loop.isRunning && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
72997
+ loop.isRunning && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
73130
72998
  children: [
73131
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(StatusBar, {
72999
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(StatusBar, {
73132
73000
  iteration: loop.iteration,
73133
73001
  costUsd: loop.state.usage.total_cost_usd,
73134
73002
  startedAt: loop.startedAt,
@@ -73136,14 +73004,14 @@ function TaskLoop({ opts }) {
73136
73004
  model: opts.model,
73137
73005
  isRunning: true
73138
73006
  }, undefined, false, undefined, this),
73139
- isRawModeSupported && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(SteerInput, {
73007
+ isRawModeSupported && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(SteerInput, {
73140
73008
  onSubmit: loop.steer
73141
73009
  }, undefined, false, undefined, this)
73142
73010
  ]
73143
73011
  }, undefined, true, undefined, this),
73144
- loop.stopReason && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
73012
+ loop.stopReason && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
73145
73013
  children: [
73146
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(StatusBar, {
73014
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(StatusBar, {
73147
73015
  iteration: loop.iteration,
73148
73016
  costUsd: loop.state.usage.total_cost_usd,
73149
73017
  startedAt: loop.startedAt,
@@ -73151,7 +73019,7 @@ function TaskLoop({ opts }) {
73151
73019
  model: opts.model,
73152
73020
  isRunning: false
73153
73021
  }, undefined, false, undefined, this),
73154
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(StopMessage, {
73022
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(StopMessage, {
73155
73023
  reason: loop.stopReason,
73156
73024
  state: loop.state,
73157
73025
  stateDir,
@@ -73167,12 +73035,11 @@ function TaskLoop({ opts }) {
73167
73035
  }
73168
73036
 
73169
73037
  // apps/cli/src/components/AgentMode.tsx
73170
- var import_react57 = __toESM(require_react(), 1);
73038
+ var import_react56 = __toESM(require_react(), 1);
73171
73039
  init_cli();
73172
73040
  init_config();
73173
73041
  init_wire();
73174
- import { join as join17 } from "path";
73175
- import { pathToFileURL } from "url";
73042
+ import { join as join16 } from "path";
73176
73043
 
73177
73044
  // packages/core/src/progress.ts
73178
73045
  function countProgress(content) {
@@ -73183,7 +73050,7 @@ function countProgress(content) {
73183
73050
 
73184
73051
  // apps/cli/src/components/AgentMode.tsx
73185
73052
  init_log();
73186
- var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
73053
+ var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
73187
73054
  var lineCounter = 0;
73188
73055
  function nextId() {
73189
73056
  lineCounter += 1;
@@ -73241,28 +73108,28 @@ function LabeledBox({
73241
73108
  const dashes = Math.max(0, innerWidth - visualLen);
73242
73109
  const left = Math.floor(dashes / 2);
73243
73110
  const right = dashes - left;
73244
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73111
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73245
73112
  flexDirection: "column",
73246
73113
  width,
73247
73114
  children: [
73248
- labelNode ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73115
+ labelNode ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73249
73116
  flexDirection: "row",
73250
73117
  children: [
73251
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73118
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73252
73119
  color: borderColor,
73253
73120
  children: `\u256D${"\u2500".repeat(left)}`
73254
73121
  }, undefined, false, undefined, this),
73255
73122
  labelNode,
73256
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73123
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73257
73124
  color: borderColor,
73258
73125
  children: `${"\u2500".repeat(right)}\u256E`
73259
73126
  }, undefined, false, undefined, this)
73260
73127
  ]
73261
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73128
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73262
73129
  color: borderColor,
73263
73130
  children: `\u256D${"\u2500".repeat(left)} ${label ?? ""} ${"\u2500".repeat(right)}\u256E`
73264
73131
  }, undefined, false, undefined, this),
73265
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73132
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73266
73133
  borderStyle: "round",
73267
73134
  borderTop: false,
73268
73135
  borderColor,
@@ -73275,13 +73142,13 @@ function LabeledBox({
73275
73142
  }
73276
73143
  function Link({ url, label, color }) {
73277
73144
  if (!HYPERLINKS_SUPPORTED)
73278
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73145
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73279
73146
  color,
73280
73147
  children: label
73281
73148
  }, undefined, false, undefined, this);
73282
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Transform, {
73149
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Transform, {
73283
73150
  transform: (output) => `\x1B]8;;${url}\x07${output}\x1B]8;;\x07`,
73284
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73151
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73285
73152
  color,
73286
73153
  underline: true,
73287
73154
  children: label
@@ -73392,15 +73259,15 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73392
73259
  const { exit } = use_app_default();
73393
73260
  const { stdout } = use_stdout_default();
73394
73261
  const { isRawModeSupported } = use_stdin_default();
73395
- const [logs, setLogs] = import_react57.useState([]);
73396
- const [, setTick] = import_react57.useState(0);
73397
- const [clock, setClock] = import_react57.useState(0);
73398
- const [focusedIdx, setFocusedIdx] = import_react57.useState(0);
73399
- const coordRef = import_react57.useRef(null);
73400
- const workerMetaRef = import_react57.useRef(new Map);
73401
- const nextPollAtRef = import_react57.useRef(0);
73402
- const cfgRef = import_react57.useRef(null);
73403
- 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({
73404
73271
  state: "idle",
73405
73272
  lastFound: null,
73406
73273
  lastAdded: null,
@@ -73412,7 +73279,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73412
73279
  setLogs((prev) => [...prev, { id: nextId(), text, color }]);
73413
73280
  logCoord(text, workerLogFile);
73414
73281
  }
73415
- import_react57.useEffect(() => {
73282
+ import_react56.useEffect(() => {
73416
73283
  let pollTimer = null;
73417
73284
  let cancelled = false;
73418
73285
  async function init2() {
@@ -73423,9 +73290,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73423
73290
  appendLog(`agent mode v${VERSION} \u2014 config: ${cfgPath}`, "gray");
73424
73291
  const apiKey = process.env["LINEAR_API_KEY"];
73425
73292
  if (!apiKey) {
73426
- appendLog("! LINEAR_API_KEY not set \u2014 cannot poll Linear", "red");
73427
- exit();
73428
- return;
73293
+ throw new Error("LINEAR_API_KEY not set \u2014 cannot poll Linear");
73429
73294
  }
73430
73295
  const { coord: coord2, filterDesc, concurrency, pollInterval } = buildAgentCoordinator({
73431
73296
  args,
@@ -73521,7 +73386,13 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73521
73386
  };
73522
73387
  tick();
73523
73388
  }
73524
- 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
+ });
73525
73396
  let shuttingDown = false;
73526
73397
  const onSig = () => {
73527
73398
  if (shuttingDown) {
@@ -73566,7 +73437,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73566
73437
  process.off("SIGTERM", onSig);
73567
73438
  };
73568
73439
  }, []);
73569
- import_react57.useEffect(() => {
73440
+ import_react56.useEffect(() => {
73570
73441
  let cancelled = false;
73571
73442
  const interval = setInterval(() => {
73572
73443
  if (cancelled)
@@ -73574,7 +73445,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73574
73445
  (async () => {
73575
73446
  for (const [changeName, meta] of workerMetaRef.current) {
73576
73447
  try {
73577
- const file = Bun.file(join17(meta.statesDir, changeName, ".ralph-state.json"));
73448
+ const file = Bun.file(join16(meta.statesDir, changeName, ".ralph-state.json"));
73578
73449
  if (await file.exists()) {
73579
73450
  const json = await file.json();
73580
73451
  meta.iter = json.iteration ?? meta.iter;
@@ -73584,7 +73455,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73584
73455
  }
73585
73456
  if (meta.changeDir) {
73586
73457
  try {
73587
- const tasksFile = Bun.file(join17(meta.changeDir, "tasks.md"));
73458
+ const tasksFile = Bun.file(join16(meta.changeDir, "tasks.md"));
73588
73459
  if (await tasksFile.exists()) {
73589
73460
  const text = await tasksFile.text();
73590
73461
  const match = text.match(/^- \[ \] (.+)$/m);
@@ -73633,49 +73504,49 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73633
73504
  const FIXED_OVERHEAD = 5 + 5 + tasksBoxLines + 8 + nonFocusedCount * 4;
73634
73505
  const focusedTailLines = Math.max(3, termHeight - FIXED_OVERHEAD);
73635
73506
  const compactTailLines = displayTailLines(activeCount);
73636
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73507
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73637
73508
  flexDirection: "column",
73638
73509
  children: [
73639
- logs.length > 0 && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(LabeledBox, {
73510
+ logs.length > 0 && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(LabeledBox, {
73640
73511
  label: "LOGS",
73641
73512
  borderColor: "gray",
73642
73513
  flexDirection: "column",
73643
73514
  paddingX: 1,
73644
73515
  width: termWidth,
73645
- 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, {
73646
73517
  color: line.color,
73647
73518
  children: line.text
73648
- }, line.id, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73519
+ }, line.id, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73649
73520
  children: line.text
73650
73521
  }, line.id, false, undefined, this))
73651
73522
  }, undefined, false, undefined, this),
73652
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73523
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73653
73524
  flexDirection: "column",
73654
73525
  marginTop: 0,
73655
73526
  children: [
73656
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(LabeledBox, {
73527
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(LabeledBox, {
73657
73528
  label: "\u25C8 RALPH AGENT",
73658
73529
  borderColor: "blue",
73659
73530
  width: termWidth,
73660
73531
  paddingX: 1,
73661
73532
  flexDirection: "column",
73662
73533
  children: [
73663
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73534
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73664
73535
  children: [
73665
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73536
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73666
73537
  dimColor: true,
73667
73538
  children: [
73668
73539
  "v",
73669
73540
  VERSION
73670
73541
  ]
73671
73542
  }, undefined, true, undefined, this),
73672
- cfg && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73543
+ cfg && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73673
73544
  children: [
73674
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73545
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73675
73546
  dimColor: true,
73676
73547
  children: " \u2502 "
73677
73548
  }, undefined, false, undefined, this),
73678
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73549
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73679
73550
  color: "cyan",
73680
73551
  bold: true,
73681
73552
  children: [
@@ -73684,14 +73555,14 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73684
73555
  cfg.model
73685
73556
  ]
73686
73557
  }, undefined, true, undefined, this),
73687
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73558
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73688
73559
  dimColor: true,
73689
73560
  children: [
73690
73561
  " \u2502 \xD7",
73691
73562
  cfg.concurrency
73692
73563
  ]
73693
73564
  }, undefined, true, undefined, this),
73694
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73565
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73695
73566
  dimColor: true,
73696
73567
  children: [
73697
73568
  " \u2502 poll ",
@@ -73699,36 +73570,36 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73699
73570
  "s"
73700
73571
  ]
73701
73572
  }, undefined, true, undefined, this),
73702
- cfg.maxIterationsPerTask > 0 && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73573
+ cfg.maxIterationsPerTask > 0 && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73703
73574
  color: "yellow",
73704
73575
  children: [
73705
73576
  " \u2502 iter \u2264",
73706
73577
  cfg.maxIterationsPerTask
73707
73578
  ]
73708
73579
  }, undefined, true, undefined, this),
73709
- cfg.maxCostUsdPerTask > 0 && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73580
+ cfg.maxCostUsdPerTask > 0 && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73710
73581
  color: "yellow",
73711
73582
  children: [
73712
73583
  " \u2502 cost \u2264$",
73713
73584
  cfg.maxCostUsdPerTask
73714
73585
  ]
73715
73586
  }, undefined, true, undefined, this),
73716
- args.maxTickets > 0 && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73587
+ args.maxTickets > 0 && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73717
73588
  color: "yellow",
73718
73589
  children: [
73719
73590
  " \u2502 tickets \u2264",
73720
73591
  args.maxTickets
73721
73592
  ]
73722
73593
  }, undefined, true, undefined, this),
73723
- cfg.createPrOnSuccess && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73594
+ cfg.createPrOnSuccess && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73724
73595
  color: "green",
73725
73596
  children: " \u25CF PR"
73726
73597
  }, undefined, false, undefined, this),
73727
- cfg.fixCiOnFailure && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73598
+ cfg.fixCiOnFailure && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73728
73599
  color: "green",
73729
73600
  children: " \u25CF fixCI"
73730
73601
  }, undefined, false, undefined, this),
73731
- cfg.useWorktree && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73602
+ cfg.useWorktree && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73732
73603
  color: "green",
73733
73604
  children: " \u25CF worktree"
73734
73605
  }, undefined, false, undefined, this)
@@ -73748,7 +73619,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73748
73619
  lines.push(remaining.slice(0, budget));
73749
73620
  remaining = remaining.slice(budget);
73750
73621
  }
73751
- return lines.map((segment, i) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73622
+ return lines.map((segment, i) => /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73752
73623
  dimColor: true,
73753
73624
  children: [
73754
73625
  i === 0 ? prefix : indent,
@@ -73758,105 +73629,105 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73758
73629
  })()
73759
73630
  ]
73760
73631
  }, undefined, true, undefined, this),
73761
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73632
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73762
73633
  flexDirection: "row",
73763
73634
  gap: 1,
73764
73635
  marginTop: 0,
73765
73636
  width: termWidth,
73766
73637
  children: [
73767
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(LabeledBox, {
73638
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(LabeledBox, {
73768
73639
  label: "POLL STATUS",
73769
73640
  borderColor: "gray",
73770
73641
  width: termWidth - 13,
73771
73642
  paddingX: 1,
73772
73643
  flexDirection: "column",
73773
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73644
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73774
73645
  gap: 2,
73775
73646
  children: [
73776
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73647
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73777
73648
  color: "gray",
73778
73649
  children: spinnerFrame
73779
73650
  }, undefined, false, undefined, this),
73780
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73651
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73781
73652
  children: pollStatus.state === "polling" ? "Polling Linear\u2026" : pollStatus.lastAt !== null ? "Idle" : "Starting\u2026"
73782
73653
  }, undefined, false, undefined, this),
73783
- 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, {
73784
73655
  children: [
73785
- pollStatus.lastBuckets && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
73656
+ pollStatus.lastBuckets && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
73786
73657
  children: [
73787
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73658
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73788
73659
  dimColor: true,
73789
73660
  children: "\u2502"
73790
73661
  }, undefined, false, undefined, this),
73791
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73662
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73792
73663
  dimColor: true,
73793
73664
  children: "todo"
73794
73665
  }, undefined, false, undefined, this),
73795
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73666
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73796
73667
  color: "white",
73797
73668
  children: pollStatus.lastBuckets.todo
73798
73669
  }, undefined, false, undefined, this),
73799
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73670
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73800
73671
  dimColor: true,
73801
73672
  children: "\xB7"
73802
73673
  }, undefined, false, undefined, this),
73803
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73674
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73804
73675
  dimColor: true,
73805
73676
  children: "res"
73806
73677
  }, undefined, false, undefined, this),
73807
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73678
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73808
73679
  color: pollStatus.lastBuckets.inProgress > 0 ? "cyan" : "white",
73809
73680
  children: pollStatus.lastBuckets.inProgress
73810
73681
  }, undefined, false, undefined, this),
73811
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73682
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73812
73683
  dimColor: true,
73813
73684
  children: "\xB7"
73814
73685
  }, undefined, false, undefined, this),
73815
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73686
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73816
73687
  dimColor: true,
73817
73688
  children: "conf"
73818
73689
  }, undefined, false, undefined, this),
73819
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73690
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73820
73691
  color: pollStatus.lastBuckets.conflicted > 0 ? "red" : "white",
73821
73692
  children: pollStatus.lastBuckets.conflicted
73822
73693
  }, undefined, false, undefined, this),
73823
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73694
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73824
73695
  dimColor: true,
73825
73696
  children: "\xB7"
73826
73697
  }, undefined, false, undefined, this),
73827
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73698
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73828
73699
  dimColor: true,
73829
73700
  children: "rev"
73830
73701
  }, undefined, false, undefined, this),
73831
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73702
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73832
73703
  color: pollStatus.lastBuckets.review > 0 ? "yellow" : "white",
73833
73704
  children: pollStatus.lastBuckets.review
73834
73705
  }, undefined, false, undefined, this),
73835
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73706
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73836
73707
  dimColor: true,
73837
73708
  children: "\xB7"
73838
73709
  }, undefined, false, undefined, this),
73839
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73710
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73840
73711
  dimColor: true,
73841
73712
  children: "@"
73842
73713
  }, undefined, false, undefined, this),
73843
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73714
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73844
73715
  color: pollStatus.lastBuckets.mentions > 0 ? "magenta" : "white",
73845
73716
  children: pollStatus.lastBuckets.mentions
73846
73717
  }, undefined, false, undefined, this)
73847
73718
  ]
73848
73719
  }, undefined, true, undefined, this),
73849
- secsToNextPoll !== null && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
73720
+ secsToNextPoll !== null && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
73850
73721
  children: [
73851
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73722
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73852
73723
  dimColor: true,
73853
73724
  children: "\u2502"
73854
73725
  }, undefined, false, undefined, this),
73855
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73726
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73856
73727
  dimColor: true,
73857
73728
  children: "\u21BA"
73858
73729
  }, undefined, false, undefined, this),
73859
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73730
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73860
73731
  color: "gray",
73861
73732
  children: [
73862
73733
  secsToNextPoll,
@@ -73870,37 +73741,37 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73870
73741
  ]
73871
73742
  }, undefined, true, undefined, this)
73872
73743
  }, undefined, false, undefined, this),
73873
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(LabeledBox, {
73744
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(LabeledBox, {
73874
73745
  label: "WORKERS",
73875
73746
  borderColor: "gray",
73876
73747
  width: 12,
73877
73748
  paddingX: 1,
73878
73749
  flexDirection: "column",
73879
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73750
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73880
73751
  gap: 2,
73881
73752
  children: [
73882
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73753
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73883
73754
  gap: 1,
73884
73755
  children: [
73885
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73756
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73886
73757
  dimColor: true,
73887
73758
  children: "A"
73888
73759
  }, undefined, false, undefined, this),
73889
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73760
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73890
73761
  color: activeCount > 0 ? "cyan" : "gray",
73891
73762
  bold: true,
73892
73763
  children: activeCount
73893
73764
  }, undefined, false, undefined, this)
73894
73765
  ]
73895
73766
  }, undefined, true, undefined, this),
73896
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73767
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73897
73768
  gap: 1,
73898
73769
  children: [
73899
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73770
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73900
73771
  dimColor: true,
73901
73772
  children: "Q"
73902
73773
  }, undefined, false, undefined, this),
73903
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73774
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73904
73775
  color: coord?.queuedCount ?? 0 > 0 ? "yellow" : "gray",
73905
73776
  bold: true,
73906
73777
  children: coord?.queuedCount ?? 0
@@ -73912,13 +73783,13 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73912
73783
  }, undefined, false, undefined, this)
73913
73784
  ]
73914
73785
  }, undefined, true, undefined, this),
73915
- activeCount > 1 && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(LabeledBox, {
73786
+ activeCount > 1 && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(LabeledBox, {
73916
73787
  label: `TASKS${activeCount > 1 ? " Tab/\u2190 \u2192 \xB7 1-9" : ""}`,
73917
73788
  borderColor: "gray",
73918
73789
  width: termWidth,
73919
73790
  paddingX: 1,
73920
73791
  flexDirection: "column",
73921
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73792
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73922
73793
  gap: 3,
73923
73794
  flexWrap: "wrap",
73924
73795
  children: coord?.activeWorkers.map((w, idx) => {
@@ -73926,10 +73797,10 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73926
73797
  const phase = meta?.phase ?? "working";
73927
73798
  const pBadge = priorityBadge(w.issue.priority);
73928
73799
  const isFocused = idx === safeFocusedIdx;
73929
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73800
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
73930
73801
  gap: 1,
73931
73802
  children: [
73932
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73803
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73933
73804
  color: isFocused ? "white" : "gray",
73934
73805
  bold: isFocused,
73935
73806
  children: [
@@ -73938,7 +73809,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73938
73809
  "]"
73939
73810
  ]
73940
73811
  }, undefined, true, undefined, this),
73941
- pBadge.label && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73812
+ pBadge.label && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73942
73813
  color: pBadge.color,
73943
73814
  children: [
73944
73815
  pBadge.text,
@@ -73946,17 +73817,17 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73946
73817
  pBadge.label
73947
73818
  ]
73948
73819
  }, undefined, true, undefined, this),
73949
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Link, {
73820
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Link, {
73950
73821
  url: w.issue.url,
73951
73822
  label: w.issueIdentifier,
73952
73823
  color: isFocused ? "cyan" : "gray"
73953
73824
  }, undefined, false, undefined, this),
73954
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73825
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73955
73826
  color: phaseColor(phase),
73956
73827
  dimColor: !isFocused,
73957
73828
  children: phase
73958
73829
  }, undefined, false, undefined, this),
73959
- isFocused && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73830
+ isFocused && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73960
73831
  color: "white",
73961
73832
  children: "\u25C0"
73962
73833
  }, undefined, false, undefined, this)
@@ -73985,33 +73856,33 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
73985
73856
  const visibleTailLines = isFocused ? focusedTailLines : compactTailLines;
73986
73857
  if (!isFocused && activeCount > 1) {
73987
73858
  const cardLabelWidth2 = (prUrl ? prLabel(prUrl).length + 3 : 0) + w.issueIdentifier.length + 2;
73988
- const cardLabelNode2 = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
73859
+ const cardLabelNode2 = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
73989
73860
  children: [
73990
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73861
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
73991
73862
  color: "gray",
73992
73863
  children: " "
73993
73864
  }, undefined, false, undefined, this),
73994
- prUrl && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Link, {
73865
+ prUrl && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Link, {
73995
73866
  url: prUrl,
73996
73867
  label: prLabel(prUrl),
73997
73868
  color: "green"
73998
73869
  }, undefined, false, undefined, this),
73999
- prUrl && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73870
+ prUrl && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74000
73871
  color: "gray",
74001
73872
  children: " \xB7 "
74002
73873
  }, undefined, false, undefined, this),
74003
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Link, {
73874
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Link, {
74004
73875
  url: w.issue.url,
74005
73876
  label: w.issueIdentifier,
74006
73877
  color: "cyan"
74007
73878
  }, undefined, false, undefined, this),
74008
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73879
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74009
73880
  color: "gray",
74010
73881
  children: " "
74011
73882
  }, undefined, false, undefined, this)
74012
73883
  ]
74013
73884
  }, undefined, true, undefined, this);
74014
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(LabeledBox, {
73885
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(LabeledBox, {
74015
73886
  labelNode: cardLabelNode2,
74016
73887
  labelVisualWidth: cardLabelWidth2,
74017
73888
  borderColor: "gray",
@@ -74019,7 +73890,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
74019
73890
  gap: 2,
74020
73891
  width: termWidth,
74021
73892
  children: [
74022
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73893
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74023
73894
  dimColor: true,
74024
73895
  children: [
74025
73896
  "[",
@@ -74027,54 +73898,54 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
74027
73898
  "]"
74028
73899
  ]
74029
73900
  }, undefined, true, undefined, this),
74030
- pBadge.label && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73901
+ pBadge.label && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74031
73902
  color: pBadge.color,
74032
73903
  children: pBadge.text
74033
73904
  }, undefined, false, undefined, this),
74034
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73905
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74035
73906
  color: "gray",
74036
73907
  bold: true,
74037
73908
  children: w.issueIdentifier
74038
73909
  }, undefined, false, undefined, this),
74039
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73910
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74040
73911
  dimColor: true,
74041
73912
  children: trunc(w.issue.title, 40)
74042
73913
  }, undefined, false, undefined, this),
74043
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73914
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74044
73915
  dimColor: true,
74045
73916
  children: "\u2502"
74046
73917
  }, undefined, false, undefined, this),
74047
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73918
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74048
73919
  color: pColor,
74049
73920
  dimColor: true,
74050
73921
  children: phase
74051
73922
  }, undefined, false, undefined, this),
74052
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73923
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74053
73924
  dimColor: true,
74054
73925
  children: "\u2502"
74055
73926
  }, undefined, false, undefined, this),
74056
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73927
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74057
73928
  dimColor: true,
74058
73929
  children: elapsed
74059
73930
  }, undefined, false, undefined, this),
74060
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73931
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74061
73932
  dimColor: true,
74062
73933
  children: "\xB7"
74063
73934
  }, undefined, false, undefined, this),
74064
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73935
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74065
73936
  dimColor: true,
74066
73937
  children: [
74067
73938
  "iter ",
74068
73939
  iter
74069
73940
  ]
74070
73941
  }, undefined, true, undefined, this),
74071
- currentTask && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
73942
+ currentTask && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
74072
73943
  children: [
74073
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73944
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74074
73945
  dimColor: true,
74075
73946
  children: "\u2502"
74076
73947
  }, undefined, false, undefined, this),
74077
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73948
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74078
73949
  dimColor: true,
74079
73950
  children: [
74080
73951
  "\u25B6 ",
@@ -74087,33 +73958,33 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
74087
73958
  }, w.changeName, true, undefined, this);
74088
73959
  }
74089
73960
  const cardLabelWidth = (prUrl ? prLabel(prUrl).length + 3 : 0) + w.issueIdentifier.length + 2;
74090
- const cardLabelNode = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
73961
+ const cardLabelNode = /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
74091
73962
  children: [
74092
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73963
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74093
73964
  color: bColor,
74094
73965
  children: " "
74095
73966
  }, undefined, false, undefined, this),
74096
- prUrl && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Link, {
73967
+ prUrl && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Link, {
74097
73968
  url: prUrl,
74098
73969
  label: prLabel(prUrl),
74099
73970
  color: "green"
74100
73971
  }, undefined, false, undefined, this),
74101
- prUrl && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73972
+ prUrl && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74102
73973
  color: bColor,
74103
73974
  children: " \xB7 "
74104
73975
  }, undefined, false, undefined, this),
74105
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Link, {
73976
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Link, {
74106
73977
  url: w.issue.url,
74107
73978
  label: w.issueIdentifier,
74108
73979
  color: "cyan"
74109
73980
  }, undefined, false, undefined, this),
74110
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73981
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74111
73982
  color: bColor,
74112
73983
  children: " "
74113
73984
  }, undefined, false, undefined, this)
74114
73985
  ]
74115
73986
  }, undefined, true, undefined, this);
74116
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(LabeledBox, {
73987
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(LabeledBox, {
74117
73988
  labelNode: cardLabelNode,
74118
73989
  labelVisualWidth: cardLabelWidth,
74119
73990
  borderColor: bColor,
@@ -74121,18 +73992,18 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
74121
73992
  paddingX: 1,
74122
73993
  width: termWidth,
74123
73994
  children: [
74124
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
73995
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
74125
73996
  gap: 2,
74126
73997
  children: [
74127
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
73998
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74128
73999
  children: spinnerFrame
74129
74000
  }, undefined, false, undefined, this),
74130
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74001
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74131
74002
  color: "white",
74132
74003
  bold: true,
74133
74004
  children: trunc(w.issue.title, Math.max(20, termWidth - 55))
74134
74005
  }, undefined, false, undefined, this),
74135
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74006
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74136
74007
  color: mBadge.color,
74137
74008
  bold: true,
74138
74009
  children: [
@@ -74141,7 +74012,7 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
74141
74012
  "]"
74142
74013
  ]
74143
74014
  }, undefined, true, undefined, this),
74144
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74015
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74145
74016
  color: pColor,
74146
74017
  bold: true,
74147
74018
  children: [
@@ -74149,35 +74020,26 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
74149
74020
  phaseDetail ? ` (${phaseDetail})` : ""
74150
74021
  ]
74151
74022
  }, undefined, true, undefined, this),
74152
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74023
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74153
74024
  dimColor: true,
74154
74025
  children: "\u2502"
74155
74026
  }, undefined, false, undefined, this),
74156
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74027
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74157
74028
  color: "white",
74158
74029
  children: elapsed
74159
74030
  }, undefined, false, undefined, this),
74160
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74031
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74161
74032
  dimColor: true,
74162
74033
  children: "\u2502"
74163
74034
  }, undefined, false, undefined, this),
74164
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74035
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74165
74036
  dimColor: true,
74166
74037
  children: "\u21BA"
74167
74038
  }, undefined, false, undefined, this),
74168
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74039
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74169
74040
  color: "white",
74170
74041
  bold: true,
74171
74042
  children: iter
74172
- }, undefined, false, undefined, this),
74173
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74174
- dimColor: true,
74175
- children: "\u2502"
74176
- }, undefined, false, undefined, this),
74177
- meta?.logFile && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Link, {
74178
- url: pathToFileURL(meta.logFile).href,
74179
- label: "LOG",
74180
- color: "gray"
74181
74043
  }, undefined, false, undefined, this)
74182
74044
  ]
74183
74045
  }, undefined, true, undefined, this),
@@ -74186,86 +74048,86 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
74186
74048
  if (!bar)
74187
74049
  return null;
74188
74050
  const { countStr, filledLeft, leftSlot, filledRight, rightSlot } = bar;
74189
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
74051
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
74190
74052
  marginTop: 0,
74191
74053
  children: [
74192
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74054
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74193
74055
  dimColor: true,
74194
74056
  children: "["
74195
74057
  }, undefined, false, undefined, this),
74196
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74058
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74197
74059
  color: "green",
74198
74060
  children: "\u2588".repeat(filledLeft)
74199
74061
  }, undefined, false, undefined, this),
74200
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74062
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74201
74063
  dimColor: true,
74202
74064
  children: "\u2591".repeat(leftSlot - filledLeft)
74203
74065
  }, undefined, false, undefined, this),
74204
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74066
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74205
74067
  color: "white",
74206
74068
  bold: true,
74207
74069
  children: countStr
74208
74070
  }, undefined, false, undefined, this),
74209
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74071
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74210
74072
  color: "green",
74211
74073
  children: "\u2588".repeat(filledRight)
74212
74074
  }, undefined, false, undefined, this),
74213
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74075
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74214
74076
  dimColor: true,
74215
74077
  children: "\u2591".repeat(rightSlot - filledRight)
74216
74078
  }, undefined, false, undefined, this),
74217
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74079
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74218
74080
  dimColor: true,
74219
74081
  children: "]"
74220
74082
  }, undefined, false, undefined, this)
74221
74083
  ]
74222
74084
  }, undefined, true, undefined, this);
74223
74085
  })(),
74224
- currentTask && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
74086
+ currentTask && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
74225
74087
  gap: 1,
74226
74088
  marginTop: 0,
74227
74089
  children: [
74228
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74090
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74229
74091
  color: "yellow",
74230
74092
  bold: true,
74231
74093
  children: "\u25B6 TASK"
74232
74094
  }, undefined, false, undefined, this),
74233
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74095
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74234
74096
  color: "white",
74235
74097
  children: trunc(currentTask, termWidth - 14)
74236
74098
  }, undefined, false, undefined, this)
74237
74099
  ]
74238
74100
  }, undefined, true, undefined, this),
74239
- cmd && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
74101
+ cmd && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
74240
74102
  gap: 1,
74241
74103
  marginTop: 0,
74242
74104
  children: [
74243
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74105
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74244
74106
  color: "yellow",
74245
74107
  children: "\u23F5 CMD"
74246
74108
  }, undefined, false, undefined, this),
74247
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74109
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74248
74110
  color: "yellow",
74249
74111
  children: fmtCmd(cmd.argv)
74250
74112
  }, undefined, false, undefined, this),
74251
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74113
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74252
74114
  dimColor: true,
74253
74115
  children: cmdElapsed
74254
74116
  }, undefined, false, undefined, this)
74255
74117
  ]
74256
74118
  }, undefined, true, undefined, this),
74257
- tail2.length > 0 && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
74119
+ tail2.length > 0 && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
74258
74120
  flexDirection: "column",
74259
74121
  marginTop: 0,
74260
74122
  children: [
74261
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74123
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
74262
74124
  dimColor: true,
74263
74125
  children: [
74264
74126
  "\u2500 OUTPUT ",
74265
74127
  "\u2500".repeat(Math.max(4, termWidth - 14))
74266
74128
  ]
74267
74129
  }, undefined, true, undefined, this),
74268
- 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, {
74269
74131
  dimColor: true,
74270
74132
  children: [
74271
74133
  "\u2502 ",
@@ -74284,11 +74146,11 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
74284
74146
  }
74285
74147
 
74286
74148
  // packages/openspec/src/openspec-change-store.ts
74287
- import { dirname as dirname6, join as join19 } from "path";
74149
+ import { dirname as dirname6, join as join18 } from "path";
74288
74150
  import { readdir, mkdir as mkdir5 } from "fs/promises";
74289
74151
 
74290
74152
  // packages/openspec/src/openspec-bin.ts
74291
- import { dirname as dirname5, join as join18 } from "path";
74153
+ import { dirname as dirname5, join as join17 } from "path";
74292
74154
  var bunInstallRunner = {
74293
74155
  spawnSync: (cmd, cwd2) => {
74294
74156
  const proc = Bun.spawnSync({
@@ -74306,9 +74168,9 @@ var bunInstallRunner = {
74306
74168
  function findPackageRoot(startDir) {
74307
74169
  let dir = startDir;
74308
74170
  for (let i = 0;i < 8; i++) {
74309
- if (Bun.file(join18(dir, "package.json")).size >= 0) {
74171
+ if (Bun.file(join17(dir, "package.json")).size >= 0) {
74310
74172
  try {
74311
- if (Bun.file(join18(dir, "package.json")).size > 0)
74173
+ if (Bun.file(join17(dir, "package.json")).size > 0)
74312
74174
  return dir;
74313
74175
  } catch {}
74314
74176
  }
@@ -74344,11 +74206,11 @@ function ensureOpenspecInstalled(fromDir, runner) {
74344
74206
  function resolveOpenspecBin(fromDir, runner = bunInstallRunner) {
74345
74207
  try {
74346
74208
  const pkgJsonPath = runner.resolveSync("@fission-ai/openspec/package.json", fromDir);
74347
- return join18(dirname5(pkgJsonPath), "bin", "openspec.js");
74209
+ return join17(dirname5(pkgJsonPath), "bin", "openspec.js");
74348
74210
  } catch {
74349
74211
  ensureOpenspecInstalled(fromDir, runner);
74350
74212
  const pkgJsonPath = runner.resolveSync("@fission-ai/openspec/package.json", fromDir);
74351
- return join18(dirname5(pkgJsonPath), "bin", "openspec.js");
74213
+ return join17(dirname5(pkgJsonPath), "bin", "openspec.js");
74352
74214
  }
74353
74215
  }
74354
74216
 
@@ -74377,7 +74239,7 @@ class OpenSpecChangeStore {
74377
74239
  }
74378
74240
  }
74379
74241
  getChangeDirectory(name) {
74380
- return join19("openspec", "changes", name);
74242
+ return join18("openspec", "changes", name);
74381
74243
  }
74382
74244
  async listChanges() {
74383
74245
  const result2 = runOpenspec(["list", "--json"]);
@@ -74391,7 +74253,7 @@ class OpenSpecChangeStore {
74391
74253
  }
74392
74254
  } catch {}
74393
74255
  }
74394
- const changesDir = join19("openspec", "changes");
74256
+ const changesDir = join18("openspec", "changes");
74395
74257
  if (!await Bun.file(changesDir).exists())
74396
74258
  return [];
74397
74259
  try {
@@ -74402,18 +74264,18 @@ class OpenSpecChangeStore {
74402
74264
  }
74403
74265
  }
74404
74266
  async readTaskList(name) {
74405
- const file = Bun.file(join19("openspec", "changes", name, "tasks.md"));
74267
+ const file = Bun.file(join18("openspec", "changes", name, "tasks.md"));
74406
74268
  if (!await file.exists())
74407
74269
  return "";
74408
74270
  return await file.text();
74409
74271
  }
74410
74272
  async writeTaskList(name, content) {
74411
- const path = join19("openspec", "changes", name, "tasks.md");
74273
+ const path = join18("openspec", "changes", name, "tasks.md");
74412
74274
  await mkdir5(dirname6(path), { recursive: true });
74413
74275
  await Bun.write(path, content);
74414
74276
  }
74415
74277
  async appendSteering(name, message) {
74416
- const path = join19("openspec", "changes", name, "steering.md");
74278
+ const path = join18("openspec", "changes", name, "steering.md");
74417
74279
  const file = Bun.file(path);
74418
74280
  const existing = await file.exists() ? await file.text() : null;
74419
74281
  const updated = existing ? `${message}
@@ -74424,7 +74286,7 @@ ${existing.trimStart()}` : `${message}
74424
74286
  await Bun.write(path, updated);
74425
74287
  }
74426
74288
  async readSection(name, artifact, heading) {
74427
- const file = Bun.file(join19("openspec", "changes", name, artifact));
74289
+ const file = Bun.file(join18("openspec", "changes", name, artifact));
74428
74290
  if (!await file.exists())
74429
74291
  return "";
74430
74292
  const content = await file.text();
@@ -74466,43 +74328,43 @@ ${existing.trimStart()}` : `${message}
74466
74328
  }
74467
74329
  // apps/cli/src/components/App.tsx
74468
74330
  init_config();
74469
- var jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
74331
+ var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
74470
74332
  function ExitAfterRender({ children }) {
74471
74333
  const { exit } = use_app_default();
74472
- import_react58.useEffect(() => {
74334
+ import_react57.useEffect(() => {
74473
74335
  exit();
74474
74336
  }, [exit]);
74475
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
74337
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
74476
74338
  children
74477
74339
  }, undefined, false, undefined, this);
74478
74340
  }
74479
74341
  function ErrorMessage({ message }) {
74480
74342
  const { exit } = use_app_default();
74481
- import_react58.useEffect(() => {
74343
+ import_react57.useEffect(() => {
74482
74344
  process.exitCode = 1;
74483
74345
  exit();
74484
74346
  }, [exit]);
74485
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
74347
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74486
74348
  color: "red",
74487
74349
  children: message
74488
74350
  }, undefined, false, undefined, this);
74489
74351
  }
74490
74352
  function TaskModeWrapper({ args, statesDir, tasksDir, projectRoot }) {
74491
- const [config, setConfig] = import_react58.useState(null);
74492
- const [error, setError] = import_react58.useState(null);
74493
- import_react58.useEffect(() => {
74353
+ const [config, setConfig] = import_react57.useState(null);
74354
+ const [error, setError] = import_react57.useState(null);
74355
+ import_react57.useEffect(() => {
74494
74356
  loadRalphyConfig(projectRoot).then((cfg) => setConfig({ manualTest: cfg.enableManualTest })).catch((err) => setError(err.message));
74495
74357
  }, [projectRoot]);
74496
74358
  if (error) {
74497
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ErrorMessage, {
74359
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ErrorMessage, {
74498
74360
  message: `Error loading config: ${error}`
74499
74361
  }, undefined, false, undefined, this);
74500
74362
  }
74501
74363
  if (!config) {
74502
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {}, undefined, false, undefined, this);
74364
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {}, undefined, false, undefined, this);
74503
74365
  }
74504
74366
  const manualTest = args.manualTest || config.manualTest;
74505
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(TaskLoop, {
74367
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(TaskLoop, {
74506
74368
  opts: {
74507
74369
  name: args.name,
74508
74370
  prompt: args.prompt,
@@ -74526,12 +74388,11 @@ function TaskModeWrapper({ args, statesDir, tasksDir, projectRoot }) {
74526
74388
  function App2({ args, statesDir, tasksDir, projectRoot }) {
74527
74389
  switch (args.mode) {
74528
74390
  case "list":
74529
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(TaskList, {
74530
- statesDir,
74531
- projectRoot
74391
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ExitAfterRender, {
74392
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {}, undefined, false, undefined, this)
74532
74393
  }, undefined, false, undefined, this);
74533
74394
  case "agent":
74534
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(AgentMode, {
74395
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(AgentMode, {
74535
74396
  args,
74536
74397
  projectRoot,
74537
74398
  statesDir,
@@ -74539,43 +74400,43 @@ function App2({ args, statesDir, tasksDir, projectRoot }) {
74539
74400
  }, undefined, false, undefined, this);
74540
74401
  case "status": {
74541
74402
  if (!args.name) {
74542
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ErrorMessage, {
74403
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ErrorMessage, {
74543
74404
  message: "Error: --name is required for status mode"
74544
74405
  }, undefined, false, undefined, this);
74545
74406
  }
74546
- const stateDir = join20(statesDir, args.name);
74547
- if (getStorage().read(join20(stateDir, ".ralph-state.json")) === null) {
74548
- 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, {
74549
74410
  message: `Error: change '${args.name}' not found`
74550
74411
  }, undefined, false, undefined, this);
74551
74412
  }
74552
74413
  const state = readState(stateDir);
74553
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ExitAfterRender, {
74554
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(TaskStatus, {
74414
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ExitAfterRender, {
74415
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(TaskStatus, {
74555
74416
  state,
74556
74417
  stateDir
74557
74418
  }, undefined, false, undefined, this)
74558
74419
  }, undefined, false, undefined, this);
74559
74420
  }
74560
74421
  case "init":
74561
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ExitAfterRender, {
74562
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
74422
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ExitAfterRender, {
74423
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
74563
74424
  color: "green",
74564
74425
  children: "Initialized openspec directory"
74565
74426
  }, undefined, false, undefined, this)
74566
74427
  }, undefined, false, undefined, this);
74567
74428
  case "clean":
74568
74429
  case "debug":
74569
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ExitAfterRender, {
74570
- 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)
74571
74432
  }, undefined, false, undefined, this);
74572
74433
  case "task": {
74573
74434
  if (!args.name) {
74574
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ErrorMessage, {
74435
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ErrorMessage, {
74575
74436
  message: "Error: --name is required for task mode"
74576
74437
  }, undefined, false, undefined, this);
74577
74438
  }
74578
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(TaskModeWrapper, {
74439
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(TaskModeWrapper, {
74579
74440
  args,
74580
74441
  statesDir,
74581
74442
  tasksDir,
@@ -74591,7 +74452,7 @@ init_worktree();
74591
74452
 
74592
74453
  // apps/cli/src/debug.ts
74593
74454
  init_log();
74594
- import { join as join21 } from "path";
74455
+ import { join as join20 } from "path";
74595
74456
  function fmtTs(d) {
74596
74457
  return d.toISOString().replace("T", " ").slice(0, 23);
74597
74458
  }
@@ -74704,7 +74565,7 @@ function detectStuck(lines) {
74704
74565
  };
74705
74566
  }
74706
74567
  async function inspectBinary(projectRoot) {
74707
- const binPath = join21(projectRoot, ".ralph", "bin", "cli.js");
74568
+ const binPath = join20(projectRoot, ".ralph", "bin", "cli.js");
74708
74569
  const file = Bun.file(binPath);
74709
74570
  if (!await file.exists())
74710
74571
  return null;
@@ -74730,7 +74591,7 @@ var SPAWN_RE = /\u25B6 (\S+) \u2192 (\S+)/;
74730
74591
  async function resolveDebugTarget(projectRoot, opts) {
74731
74592
  const agentLogFile = Bun.file(AGENT_LOG_PATH);
74732
74593
  const textLines = await agentLogFile.exists() ? parseTextLog(await agentLogFile.text()) : [];
74733
- const jsonlLogFile = Bun.file(join21(projectRoot, ".ralph", "agent.log"));
74594
+ const jsonlLogFile = Bun.file(join20(projectRoot, ".ralph", "agent.log"));
74734
74595
  const jsonlLines = await jsonlLogFile.exists() ? parseJsonlLog(await jsonlLogFile.text()) : [];
74735
74596
  const allLines = [...textLines, ...jsonlLines];
74736
74597
  if (opts.name && !opts.issue) {
@@ -74835,7 +74696,7 @@ async function runDebug(opts) {
74835
74696
  `);
74836
74697
  const agentLogFile = Bun.file(AGENT_LOG_PATH);
74837
74698
  const textLines = await agentLogFile.exists() ? parseTextLog(await agentLogFile.text()) : [];
74838
- const jsonlLogPath = join21(projectRoot, ".ralph", "agent.log");
74699
+ const jsonlLogPath = join20(projectRoot, ".ralph", "agent.log");
74839
74700
  const jsonlLogFile = Bun.file(jsonlLogPath);
74840
74701
  const hasJsonlLog = await jsonlLogFile.exists();
74841
74702
  let { changeName, identifier: issueIdentifier } = await resolveDebugTarget(projectRoot, {
@@ -74849,7 +74710,7 @@ async function runDebug(opts) {
74849
74710
  }
74850
74711
  const jsonlLines = hasJsonlLog ? parseJsonlLog(await jsonlLogFile.text(), changeName) : [];
74851
74712
  const relevantText = textLines.filter((l) => l.text.includes(changeName) || issueIdentifier !== undefined && l.text.includes(issueIdentifier));
74852
- const workerLogFile = Bun.file(join21(projectRoot, ".ralph", "logs", `${changeName}.log`));
74713
+ const workerLogFile = Bun.file(join20(projectRoot, ".ralph", "logs", `${changeName}.log`));
74853
74714
  const workerLines = await workerLogFile.exists() ? parseTextLog(await workerLogFile.text()) : [];
74854
74715
  const merged = [...relevantText, ...jsonlLines, ...workerLines].sort((a, b) => +a.ts - +b.ts);
74855
74716
  const seen = new Set;
@@ -75006,8 +74867,8 @@ async function runDebug(opts) {
75006
74867
  out(" \u26A0 PR currently has merge conflicts");
75007
74868
  if (pr?.checks.some((c) => c.conclusion === "FAILURE"))
75008
74869
  out(" \u26A0 PR has failing CI checks");
75009
- const worktreePath = join21(projectRoot, ".ralph", "worktrees", changeName);
75010
- 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()) {
75011
74872
  out(` Worktree : ${worktreePath}`);
75012
74873
  }
75013
74874
  if (!timeline.length)
@@ -75015,6 +74876,378 @@ async function runDebug(opts) {
75015
74876
  out("");
75016
74877
  }
75017
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
+
75018
75251
  // apps/cli/src/index.ts
75019
75252
  init_src();
75020
75253
  if (typeof globalThis.Bun === "undefined") {
@@ -75031,6 +75264,28 @@ async function findProjectRoot() {
75031
75264
  }
75032
75265
  return process.cwd();
75033
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
+ }
75034
75289
  await init();
75035
75290
  var rawArgs = process.argv.slice(2);
75036
75291
  if (rawArgs.length === 0) {
@@ -75066,6 +75321,7 @@ try {
75066
75321
  const tasksDir = layout.tasksDir;
75067
75322
  if (args.mode === "init") {
75068
75323
  await mkdir7(statesDir, { recursive: true });
75324
+ await ensureRalphGitignore(projectRoot);
75069
75325
  const openspecBin = resolveOpenspecBin(import.meta.dir);
75070
75326
  Bun.spawnSync({
75071
75327
  cmd: [process.execPath, openspecBin, "init", "--tools", "none", "--force"],
@@ -75073,6 +75329,20 @@ try {
75073
75329
  cwd: process.cwd()
75074
75330
  });
75075
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
+ }
75076
75346
  if (args.mode === "debug") {
75077
75347
  if (!args.name) {
75078
75348
  process.stderr.write(`Error: --name is required for debug mode
@@ -75145,11 +75415,12 @@ try {
75145
75415
  if (args.mode === "task" && args.name) {
75146
75416
  await mkdir7(join23(statesDir, args.name), { recursive: true });
75147
75417
  await mkdir7(join23(tasksDir, args.name), { recursive: true });
75418
+ await ensureRalphGitignore(projectRoot);
75148
75419
  }
75149
75420
  if (args.mode === "agent") {
75150
75421
  await mkdir7(statesDir, { recursive: true });
75151
75422
  await mkdir7(tasksDir, { recursive: true });
75152
- await mkdir7(join23(projectRoot, ".ralph"), { recursive: true });
75423
+ await ensureRalphGitignore(projectRoot);
75153
75424
  }
75154
75425
  if (args.mode === "agent" && args.jsonOutput) {
75155
75426
  const { runAgentJson: runAgentJson2 } = await Promise.resolve().then(() => (init_json_runner(), exports_json_runner));
@@ -75158,7 +75429,7 @@ try {
75158
75429
  process.exit(process.exitCode ?? 0);
75159
75430
  }
75160
75431
  await runWithContext(createDefaultContext(), async () => {
75161
- 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 }));
75162
75433
  await waitUntilExit();
75163
75434
  });
75164
75435
  await shutdown();