@great-arrow/cli 0.9.2 → 0.9.3

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 +9 -40
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -9483,7 +9483,7 @@ function isNodeError(value) {
9483
9483
 
9484
9484
  // src/lib/version.ts
9485
9485
  var CLI_PACKAGE_NAME = "@great-arrow/cli";
9486
- var CLI_VERSION = "0.9.2";
9486
+ var CLI_VERSION = "0.9.3";
9487
9487
  var GAD_INSTALL_VERSION = "2026.08.08";
9488
9488
  var GAD_INSTALL_MIN_VERSION = "2026.06.22";
9489
9489
  var GAD_INSTALL_HEADER = "X-GAD-Install-Version";
@@ -50463,21 +50463,6 @@ function worktreeGitBytes(layout, args, opts = {}) {
50463
50463
  return safeGitBytes(layout.worktree, [...layoutArgs(layout), ...args], opts);
50464
50464
  }
50465
50465
 
50466
- // src/lib/runner/boot-ticks.ts
50467
- import { readFileSync as readFileSync4 } from "node:fs";
50468
- var USER_HZ = 100;
50469
- function bootTicks(read = readFileSync4) {
50470
- if (process.platform !== "linux") return void 0;
50471
- try {
50472
- const seconds = Number.parseFloat(
50473
- read("/proc/uptime", "utf8").split(" ")[0] ?? ""
50474
- );
50475
- return Number.isFinite(seconds) ? Math.floor(seconds * USER_HZ) : void 0;
50476
- } catch {
50477
- return void 0;
50478
- }
50479
- }
50480
-
50481
50466
  // src/lib/runner/text.ts
50482
50467
  function cleanLine(text3) {
50483
50468
  return text3.replace(/[\u0000-\u001f\u007f-\u009f]+/g, " ").trim();
@@ -50833,7 +50818,6 @@ async function prepareWorktree(input2) {
50833
50818
  await privateDir(join13(runDir, "wt"));
50834
50819
  const path10 = join13(runDir, "wt", short(todoId));
50835
50820
  const branch = runnerBranch(runId, todoId);
50836
- const preparedAt = bootTicks();
50837
50821
  const fetch2 = await safeGit(repoRoot, [
50838
50822
  "fetch",
50839
50823
  "--no-tags",
@@ -50859,8 +50843,7 @@ async function prepareWorktree(input2) {
50859
50843
  worktreeGitDir: await gitPath(worktree, "--absolute-git-dir"),
50860
50844
  home: homedir10(),
50861
50845
  hooksDir: await configuredHooksDir(worktree, commonDir),
50862
- branch,
50863
- ...preparedAt === void 0 ? {} : { preparedAt }
50846
+ branch
50864
50847
  };
50865
50848
  const gad = join13(worktree, ".gad");
50866
50849
  await privateDir(gad);
@@ -51483,7 +51466,7 @@ async function reapGroup(pgid, waitMs = REAP_WAIT_MS) {
51483
51466
 
51484
51467
  // src/lib/runner/holders.ts
51485
51468
  import { execFile as execFile5 } from "node:child_process";
51486
- import { readFileSync as readFileSync5, readdirSync, readlinkSync, statSync as statSync2 } from "node:fs";
51469
+ import { readdirSync, readlinkSync, statSync as statSync2 } from "node:fs";
51487
51470
  var LSOF_DEADLINE_MS = 2e4;
51488
51471
  var CHECKS = 5;
51489
51472
  var PAUSE_MS = 250;
@@ -51595,18 +51578,8 @@ async function lsofUsers(root, uid, exec2 = run3) {
51595
51578
  for (const h of holders) if (!await isIndexer(h, exec2)) users.push(h.pid);
51596
51579
  return users;
51597
51580
  }
51598
- function startTicks(pid, fs6) {
51599
- try {
51600
- const stat3 = (fs6.readFileSync ?? readFileSync5)(`/proc/${pid}/stat`, "utf8");
51601
- const after = stat3.slice(stat3.lastIndexOf(")") + 1).trim().split(/\s+/);
51602
- const ticks = Number(after[19]);
51603
- return Number.isSafeInteger(ticks) ? ticks : null;
51604
- } catch {
51605
- return null;
51606
- }
51607
- }
51608
51581
  var errno = (error62) => error62.code;
51609
- function procUsers(root, uid, fs6 = { readdirSync, statSync: statSync2, readlinkSync, readFileSync: readFileSync5 }, notBefore) {
51582
+ function procUsers(root, uid, fs6 = { readdirSync, statSync: statSync2, readlinkSync }) {
51610
51583
  let entries;
51611
51584
  try {
51612
51585
  entries = fs6.readdirSync("/proc").filter((e) => /^\d+$/.test(e));
@@ -51636,24 +51609,20 @@ function procUsers(root, uid, fs6 = { readdirSync, statSync: statSync2, readlink
51636
51609
  if (holds) users.push(Number(pid));
51637
51610
  } catch (error62) {
51638
51611
  if (errno(error62) === "ENOENT" || errno(error62) === "ESRCH") continue;
51639
- if (errno(error62) === "EACCES" && notBefore !== void 0) {
51640
- const started = startTicks(pid, fs6);
51641
- if (started !== null && started < notBefore) continue;
51642
- }
51643
51612
  return null;
51644
51613
  }
51645
51614
  }
51646
51615
  return users;
51647
51616
  }
51648
- async function processesUsing(root, notBefore) {
51617
+ async function processesUsing(root) {
51649
51618
  const uid = process.getuid?.();
51650
51619
  if (uid === void 0) return null;
51651
- const found = process.platform === "darwin" ? await lsofUsers(root, uid) : process.platform === "linux" ? procUsers(root, uid, void 0, notBefore) : null;
51620
+ const found = process.platform === "darwin" ? await lsofUsers(root, uid) : process.platform === "linux" ? procUsers(root, uid) : null;
51652
51621
  return found?.filter((pid) => pid !== process.pid) ?? null;
51653
51622
  }
51654
- async function worktreeUnused(root, notBefore) {
51623
+ async function worktreeUnused(root) {
51655
51624
  for (let check2 = 0; check2 < CHECKS; check2++) {
51656
- const users = await processesUsing(root, notBefore);
51625
+ const users = await processesUsing(root);
51657
51626
  if (users === null) return false;
51658
51627
  if (users.length === 0) return true;
51659
51628
  if (check2 + 1 < CHECKS) await new Promise((r) => setTimeout(r, PAUSE_MS));
@@ -52059,7 +52028,7 @@ async function headSha(layout, opts) {
52059
52028
  }
52060
52029
  async function publishBranch(layout, branch, base, message, signal, options = {}) {
52061
52030
  if (!await verifyGitfile(layout)) return { failed: "sandbox_tampered" };
52062
- if (!await worktreeUnused(layout.worktree, layout.preparedAt))
52031
+ if (!await worktreeUnused(layout.worktree))
52063
52032
  return { failed: "agent_still_running" };
52064
52033
  if (!RUNNER_BRANCH.test(branch) || branch === base || !BASE_NAME.test(base))
52065
52034
  return { failed: "bad_branch" };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@great-arrow/cli",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "description": "GreatArrow.ai CLI tool",
5
5
  "type": "module",
6
6
  "bin": {