xab 11.0.0 → 12.0.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 (2) hide show
  1. package/dist/index.js +36 -53
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -476,7 +476,7 @@ async function runStreamedWithProgress(thread, prompt, onProgress, turnOpts) {
476
476
  const lines = output.split(`
477
477
  `).filter(Boolean);
478
478
  for (const line of lines.slice(-3)) {
479
- onProgress("exec", ` ${line.slice(0, 120)}`);
479
+ onProgress("output", ` ${line.slice(0, 120)}`);
480
480
  }
481
481
  }
482
482
  }
@@ -511,8 +511,10 @@ async function runStreamedWithProgress(thread, prompt, onProgress, turnOpts) {
511
511
  if (text) {
512
512
  const lines = text.split(`
513
513
  `).filter(Boolean);
514
- for (const line of lines.slice(0, 3)) {
515
- onProgress("think", line.slice(0, 150));
514
+ if (lines[0])
515
+ onProgress("think", lines[0].slice(0, 150));
516
+ for (const line of lines.slice(1, 3)) {
517
+ onProgress("output", ` ${line.slice(0, 150)}`);
516
518
  }
517
519
  }
518
520
  break;
@@ -1547,28 +1549,8 @@ async function runEngine(opts, cb) {
1547
1549
  await createDetachedWorktree(git, wtPath, wbHead);
1548
1550
  cb.onLog(`Eval worktree (detached): ${wtPath}`, "green");
1549
1551
  const wtGit = createGit(wtPath);
1550
- const runId = `run-${ts}`;
1551
- const audit = new AuditLog(repoPath, runId);
1552
- const runMeta = {
1553
- runId,
1554
- startedAt: new Date().toISOString(),
1555
- sourceRef,
1556
- targetRef,
1557
- workBranch: wbName,
1558
- mergeBase,
1559
- worktreePath: wtPath,
1560
- totalCandidates: commitsToProcess.length,
1561
- cherrySkipped: cherrySkipped.size,
1562
- dryRun,
1563
- repoPath
1564
- };
1565
- audit.runStart(runMeta);
1566
- for (const [hash, reason] of cherrySkipped) {
1567
- const c = allSourceCommits.find((x) => x.hash === hash);
1568
- if (c)
1569
- audit.cherrySkip(hash, c.message, reason);
1570
- }
1571
1552
  let resumeFromIndex = 0;
1553
+ let resumedRunId;
1572
1554
  if (opts.resume && effectiveWorkBranch) {
1573
1555
  const resumeInfo = findResumableRun(repoPath, effectiveWorkBranch);
1574
1556
  if (resumeInfo && resumeInfo.lastCommitIndex >= 0) {
@@ -1580,7 +1562,31 @@ async function runEngine(opts, cb) {
1580
1562
  resumeFromIndex = commitsToProcess.findIndex((c) => !prevHashes.has(c.hash));
1581
1563
  if (resumeFromIndex < 0)
1582
1564
  resumeFromIndex = commitsToProcess.length;
1583
- cb.onLog(`Resuming from commit ${resumeFromIndex + 1}/${commitsToProcess.length} (${resumeInfo.decisions.length} already decided)`, "green");
1565
+ resumedRunId = resumeInfo.runId;
1566
+ cb.onLog(`Resuming run ${resumeInfo.runId} from commit ${resumeFromIndex + 1}/${commitsToProcess.length} (${resumeInfo.decisions.length} already decided)`, "green");
1567
+ }
1568
+ }
1569
+ const runId = resumedRunId ?? `run-${ts}`;
1570
+ const audit = new AuditLog(repoPath, runId);
1571
+ if (!resumedRunId) {
1572
+ const runMeta = {
1573
+ runId,
1574
+ startedAt: new Date().toISOString(),
1575
+ sourceRef,
1576
+ targetRef,
1577
+ workBranch: wbName,
1578
+ mergeBase,
1579
+ worktreePath: wtPath,
1580
+ totalCandidates: commitsToProcess.length,
1581
+ cherrySkipped: cherrySkipped.size,
1582
+ dryRun,
1583
+ repoPath
1584
+ };
1585
+ audit.runStart(runMeta);
1586
+ for (const [hash, reason] of cherrySkipped) {
1587
+ const c = allSourceCommits.find((x) => x.hash === hash);
1588
+ if (c)
1589
+ audit.cherrySkip(hash, c.message, reason);
1584
1590
  }
1585
1591
  }
1586
1592
  const sourceLatestDiff = await getLatestCommitDiff(git, resolvedSource);
@@ -2059,43 +2065,20 @@ async function runBatch(opts) {
2059
2065
  const subMatch = msg.match(/^\[(\w+)\]\s*(.*)/);
2060
2066
  const sub = subMatch ? subMatch[1] : phase;
2061
2067
  const text = subMatch ? subMatch[2] : msg;
2062
- let icon;
2063
2068
  switch (sub) {
2064
- case "read":
2065
- icon = chalk.cyan("\uD83D\uDCD6");
2066
- break;
2067
- case "grep":
2068
- icon = chalk.cyan("\uD83D\uDD0D");
2069
- break;
2070
- case "glob":
2071
- icon = chalk.cyan("\uD83D\uDCC2");
2072
- break;
2073
- case "exec":
2074
- icon = chalk.yellow("\u26A1");
2075
- break;
2076
2069
  case "file":
2077
- icon = chalk.green("\u270F\uFE0F");
2070
+ log(` ${ts()} \u270F\uFE0F ${chalk.green(text)}`);
2078
2071
  break;
2079
2072
  case "think":
2080
- icon = chalk.blue("\uD83D\uDCAD");
2081
- break;
2082
- case "tool":
2083
- icon = chalk.dim("\uD83D\uDD27");
2073
+ log(` ${ts()} \uD83D\uDCAD ${chalk.blue(text)}`);
2084
2074
  break;
2085
- case "analyze":
2086
- icon = chalk.blue("\u25C6");
2087
- break;
2088
- case "apply":
2089
- icon = chalk.green("\u25B8");
2090
- break;
2091
- case "review":
2092
- icon = chalk.magenta("\u25CF");
2075
+ case "read":
2076
+ log(` ${ts()} \uD83D\uDCD6 ${chalk.dim(text)}`);
2093
2077
  break;
2094
2078
  default:
2095
- icon = chalk.dim("\xB7");
2079
+ log(` ${ts()} ${chalk.dim(text)}`);
2096
2080
  break;
2097
2081
  }
2098
- log(` ${ts()} ${icon} ${chalk.dim(text)}`);
2099
2082
  },
2100
2083
  onLog(msg, color) {
2101
2084
  if (jsonl)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xab",
3
- "version": "11.0.0",
3
+ "version": "12.0.0",
4
4
  "description": "AI-powered curated branch reconciliation engine",
5
5
  "type": "module",
6
6
  "bin": {