baro-ai 0.117.1 → 0.117.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/runner.mjs CHANGED
@@ -3823,12 +3823,21 @@ function writeGithubCredentials(dir, token2) {
3823
3823
  `);
3824
3824
  }
3825
3825
  var MAX_RECOVERY_DIFF_CHARS = 2e5;
3826
- function unpublishedWorkDiff(cwd, base) {
3826
+ function goalBranch(cwd) {
3827
3827
  try {
3828
3828
  const named = JSON.parse(readFileSync2(join2(cwd, "prd.json"), "utf8")).branchName;
3829
3829
  if (typeof named !== "string" || !named) return void 0;
3830
3830
  let branch = named;
3831
3831
  while (branch.startsWith("baro/baro/")) branch = branch.slice("baro/".length);
3832
+ return branch;
3833
+ } catch {
3834
+ return void 0;
3835
+ }
3836
+ }
3837
+ function unpublishedWorkDiff(cwd, base) {
3838
+ try {
3839
+ const branch = goalBranch(cwd);
3840
+ if (!branch) return void 0;
3832
3841
  const head = execFileSync("git", ["rev-parse", "--verify", "--quiet", `refs/heads/${branch}^{commit}`], { cwd }).toString().trim();
3833
3842
  const out = execFileSync("git", ["diff", "--binary", base, head], { cwd, maxBuffer: 16 * 1024 * 1024 }).toString();
3834
3843
  if (!out.trim()) return void 0;
@@ -3837,6 +3846,10 @@ function unpublishedWorkDiff(cwd, base) {
3837
3846
  return void 0;
3838
3847
  }
3839
3848
  }
3849
+ function unpublishedWork(cwd, base) {
3850
+ const diff = unpublishedWorkDiff(cwd, base);
3851
+ return diff ? { diff, diffBase: base, goalBranch: goalBranch(cwd) } : void 0;
3852
+ }
3840
3853
 
3841
3854
  // ../baro-orchestrator/scripts/runner.ts
3842
3855
  var encode = (m) => JSON.stringify(m);
@@ -3844,7 +3857,7 @@ var url = process.env.CONTROL_URL ?? "wss://api.baro.jigjoy.ai";
3844
3857
  var token = process.env.RUNNER_TOKEN;
3845
3858
  var httpBase = canonicalControlHttpOrigin(url);
3846
3859
  var credsPath = join3(homedir2(), ".baro", "credentials.json");
3847
- var VERSION = true ? "0.117.1" : "0.0.0-dev";
3860
+ var VERSION = true ? "0.117.2" : "0.0.0-dev";
3848
3861
  var RUNNER_VERSION = VERSION;
3849
3862
  var selfUpdateEnabled = VERSION !== "0.0.0-dev" && process.env.BARO_RUN_ONCE !== "1" && process.env.BARO_NO_SELF_UPDATE !== "1";
3850
3863
  var RUNNER_PROTOCOL_VERSION = 2;
@@ -4290,8 +4303,8 @@ async function runGoalInClone(d, emit, signal, bindCommandSink) {
4290
4303
  if ((d.diffOnly || scratch) && diffBase) {
4291
4304
  outcome.diff = captureDiff(cwd, diffBase);
4292
4305
  } else if (d.repo && !outcome.success && !prUrl && diffBase) {
4293
- const diff = unpublishedWorkDiff(cwd, diffBase);
4294
- if (diff) outcome.diff = diff;
4306
+ const work = unpublishedWork(cwd, diffBase);
4307
+ if (work) Object.assign(outcome, work);
4295
4308
  }
4296
4309
  if (process.env.BARO_PR_DOCTOR === "1" && d.repo && !d.diffOnly && !scratch && outcome.success && prUrl) {
4297
4310
  try {