astracode-agent 0.6.0 → 0.6.1

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.
@@ -6416,21 +6416,21 @@ async function readHead(file2, n) {
6416
6416
  await handle2.close();
6417
6417
  }
6418
6418
  }
6419
- var fs21, fssync, path20, import_node_child_process4, import_node_util, import_node_stream, import_promises, execFileAsync, INCONSISTENT_LISTING, PLAIN_TYPE_CHARS;
6419
+ var fs21, fssync, path20, import_node_child_process5, import_node_util, import_node_stream, import_promises, execFileAsync, INCONSISTENT_LISTING, PLAIN_TYPE_CHARS;
6420
6420
  var init_skills = __esm({
6421
6421
  "../editor/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.mjs"() {
6422
6422
  init_define_ASTRACODE_BUNDLED_SKILLS();
6423
6423
  fs21 = __toESM(require("node:fs/promises"), 1);
6424
6424
  fssync = __toESM(require("node:fs"), 1);
6425
6425
  path20 = __toESM(require("node:path"), 1);
6426
- import_node_child_process4 = require("node:child_process");
6426
+ import_node_child_process5 = require("node:child_process");
6427
6427
  import_node_util = require("node:util");
6428
6428
  import_node_stream = require("node:stream");
6429
6429
  import_promises = require("node:stream/promises");
6430
6430
  init_error();
6431
6431
  init_log();
6432
6432
  init_fs_util();
6433
- execFileAsync = (0, import_node_util.promisify)(import_node_child_process4.execFile);
6433
+ execFileAsync = (0, import_node_util.promisify)(import_node_child_process5.execFile);
6434
6434
  INCONSISTENT_LISTING = "skill archive listing is inconsistent; refusing to extract";
6435
6435
  PLAIN_TYPE_CHARS = { unzip: /* @__PURE__ */ new Set(["-", "d", "?"]), tar: /* @__PURE__ */ new Set(["-", "d", "C"]) };
6436
6436
  }
@@ -22891,7 +22891,7 @@ function looksDegenerate(text2, userScript = "latin") {
22891
22891
 
22892
22892
  // ../editor/src/agent/backgroundTasks.ts
22893
22893
  init_define_ASTRACODE_BUNDLED_SKILLS();
22894
- var import_node_child_process = require("node:child_process");
22894
+ var import_node_child_process2 = require("node:child_process");
22895
22895
  var fs10 = __toESM(require("node:fs"));
22896
22896
 
22897
22897
  // ../editor/src/agent/commandRisk.ts
@@ -23270,6 +23270,60 @@ function notificationSummary(text2) {
23270
23270
  return m ? m[1].trim() : text2.split("\n")[0];
23271
23271
  }
23272
23272
 
23273
+ // ../editor/src/agent/windowsTree.ts
23274
+ init_define_ASTRACODE_BUNDLED_SKILLS();
23275
+ var import_node_child_process = require("node:child_process");
23276
+ function descendantsOf(rows2, root2) {
23277
+ const found = /* @__PURE__ */ new Set();
23278
+ const walk5 = (parent) => {
23279
+ for (const r of rows2) {
23280
+ if (r.ppid === parent && r.pid !== root2 && !found.has(r.pid)) {
23281
+ found.add(r.pid);
23282
+ walk5(r.pid);
23283
+ }
23284
+ }
23285
+ };
23286
+ walk5(root2);
23287
+ return [...found];
23288
+ }
23289
+ function parseProcessRows(text2) {
23290
+ const rows2 = [];
23291
+ for (const line of text2.split(/\r?\n/)) {
23292
+ const m = /^\s*(\d+)\s+(\d+)\s*$/.exec(line);
23293
+ if (m) rows2.push({ pid: Number(m[1]), ppid: Number(m[2]) });
23294
+ }
23295
+ return rows2;
23296
+ }
23297
+ function listProcesses() {
23298
+ const r = (0, import_node_child_process.spawnSync)("powershell", [
23299
+ "-NoProfile",
23300
+ "-NonInteractive",
23301
+ "-Command",
23302
+ 'Get-CimInstance Win32_Process | ForEach-Object { "$($_.ProcessId) $($_.ParentProcessId)" }'
23303
+ ], { encoding: "utf8", windowsHide: true, timeout: 15e3 });
23304
+ return r.status === 0 ? parseProcessRows(r.stdout ?? "") : [];
23305
+ }
23306
+ function killWindowsTree(pid, deps2 = {}) {
23307
+ const list2 = deps2.list ?? listProcesses;
23308
+ const taskkill = deps2.taskkill ?? ((p) => {
23309
+ (0, import_node_child_process.spawnSync)("taskkill", ["/pid", String(p), "/T", "/F"], { stdio: "ignore", windowsHide: true });
23310
+ });
23311
+ const end = deps2.end ?? ((p) => {
23312
+ process.kill(p, "SIGKILL");
23313
+ });
23314
+ const tree = descendantsOf(list2(), pid);
23315
+ taskkill(pid);
23316
+ const ended = [];
23317
+ for (const p of [pid, ...tree]) {
23318
+ try {
23319
+ end(p);
23320
+ ended.push(p);
23321
+ } catch {
23322
+ }
23323
+ }
23324
+ return ended;
23325
+ }
23326
+
23273
23327
  // ../editor/src/agent/backgroundTasks.ts
23274
23328
  var MAX_TASK_LINES = 500;
23275
23329
  var HEAD_TASK_LINES = 60;
@@ -23545,7 +23599,7 @@ var BackgroundTasks = class {
23545
23599
  let child;
23546
23600
  try {
23547
23601
  const run4 = shellFor(command2);
23548
- child = (0, import_node_child_process.spawn)(run4.line, {
23602
+ child = (0, import_node_child_process2.spawn)(run4.line, {
23549
23603
  cwd,
23550
23604
  env: { ...process.env, ...AGENT_ENV },
23551
23605
  shell: run4.shell,
@@ -23632,7 +23686,7 @@ var BackgroundTasks = class {
23632
23686
  * spawns the actual server: killing the shell alone leaves the server
23633
23687
  * holding the port, with nothing left that knows it is there.
23634
23688
  */
23635
- stop(id) {
23689
+ stop(id, processes) {
23636
23690
  const entry = this.entries.get(id);
23637
23691
  if (!entry || entry.task.state !== "running") return false;
23638
23692
  if (entry.stopFn) {
@@ -23647,8 +23701,7 @@ var BackgroundTasks = class {
23647
23701
  entry.task.endedAt = Date.now();
23648
23702
  try {
23649
23703
  if (process.platform === "win32") {
23650
- const r = (0, import_node_child_process.spawnSync)("taskkill", ["/pid", String(entry.child.pid), "/T", "/F"], { stdio: "ignore", windowsHide: true });
23651
- if (r.status !== 0) entry.child.kill();
23704
+ killWindowsTree(entry.child.pid, processes ? { list: () => processes } : {});
23652
23705
  } else {
23653
23706
  process.kill(-entry.child.pid, "SIGTERM");
23654
23707
  const pid = entry.child.pid;
@@ -23677,7 +23730,9 @@ var BackgroundTasks = class {
23677
23730
  disposeAll() {
23678
23731
  if (this.outputTimer !== void 0) clearTimeout(this.outputTimer);
23679
23732
  this.outputTimer = void 0;
23680
- for (const id of this.entries.keys()) this.stop(id);
23733
+ const running = [...this.entries.values()].some((e) => e.task.state === "running" && e.child?.pid);
23734
+ const processes = running && process.platform === "win32" ? listProcesses() : void 0;
23735
+ for (const id of this.entries.keys()) this.stop(id, processes);
23681
23736
  }
23682
23737
  };
23683
23738
  function runToEnd(command2, cwd, timeoutMs, opts = {}) {
@@ -23697,7 +23752,7 @@ function runToEnd(command2, cwd, timeoutMs, opts = {}) {
23697
23752
  let child;
23698
23753
  try {
23699
23754
  const run4 = shellFor(command2);
23700
- child = (0, import_node_child_process.spawn)(run4.line, {
23755
+ child = (0, import_node_child_process2.spawn)(run4.line, {
23701
23756
  cwd,
23702
23757
  env: { ...process.env, ...AGENT_ENV, ...opts.env },
23703
23758
  shell: run4.shell,
@@ -23723,7 +23778,7 @@ function runToEnd(command2, cwd, timeoutMs, opts = {}) {
23723
23778
  const pid = child.pid;
23724
23779
  if (!pid) return;
23725
23780
  if (win) {
23726
- (0, import_node_child_process.spawnSync)("taskkill", ["/pid", String(pid), "/T", "/F"], { stdio: "ignore", windowsHide: true });
23781
+ killWindowsTree(pid);
23727
23782
  return;
23728
23783
  }
23729
23784
  try {
@@ -24412,7 +24467,7 @@ function setTaskRegistry(registry4) {
24412
24467
 
24413
24468
  // ../editor/src/agent/tasks/worktree.ts
24414
24469
  init_define_ASTRACODE_BUNDLED_SKILLS();
24415
- var import_node_child_process2 = require("node:child_process");
24470
+ var import_node_child_process3 = require("node:child_process");
24416
24471
 
24417
24472
  // ../editor/src/agent/worktrees.ts
24418
24473
  init_define_ASTRACODE_BUNDLED_SKILLS();
@@ -24580,7 +24635,7 @@ function parseNumstat(out2) {
24580
24635
 
24581
24636
  // ../editor/src/agent/tasks/worktree.ts
24582
24637
  var execGit = (args2, cwd) => new Promise((resolve26) => {
24583
- (0, import_node_child_process2.execFile)("git", args2, { cwd, maxBuffer: 8 * 1024 * 1024 }, (err2, stdout, stderr) => {
24638
+ (0, import_node_child_process3.execFile)("git", args2, { cwd, maxBuffer: 8 * 1024 * 1024 }, (err2, stdout, stderr) => {
24584
24639
  const code = err2 ? err2.code ?? 1 : 0;
24585
24640
  resolve26({ code: typeof code === "number" ? code : 1, out: (stdout ?? "") + (stderr ?? "") });
24586
24641
  });
@@ -24622,7 +24677,7 @@ async function cleanupIfUnchanged(wt, git3 = execGit) {
24622
24677
 
24623
24678
  // ../editor/src/agent/tasks/monitor.ts
24624
24679
  init_define_ASTRACODE_BUNDLED_SKILLS();
24625
- var import_node_child_process3 = require("node:child_process");
24680
+ var import_node_child_process4 = require("node:child_process");
24626
24681
  var fs14 = __toESM(require("fs"));
24627
24682
  var path11 = __toESM(require("path"));
24628
24683
 
@@ -24894,7 +24949,7 @@ function commandSource(command2, cwd, killGraceMs = 5e3) {
24894
24949
  let child;
24895
24950
  try {
24896
24951
  const run4 = shellFor(command2);
24897
- child = (0, import_node_child_process3.spawn)(run4.line, {
24952
+ child = (0, import_node_child_process4.spawn)(run4.line, {
24898
24953
  cwd,
24899
24954
  env: { ...process.env, ...AGENT_ENV },
24900
24955
  shell: run4.shell,
@@ -24925,7 +24980,7 @@ function commandSource(command2, cwd, killGraceMs = 5e3) {
24925
24980
  if (!child.pid) return;
24926
24981
  try {
24927
24982
  if (process.platform === "win32") {
24928
- (0, import_node_child_process3.spawnSync)("taskkill", ["/pid", String(child.pid), "/T", "/F"], { stdio: "ignore", windowsHide: true });
24983
+ killWindowsTree(child.pid);
24929
24984
  } else {
24930
24985
  process.kill(-child.pid, "SIGTERM");
24931
24986
  const pid = child.pid;
@@ -33499,7 +33554,7 @@ ${rows2.join("\n") || "(no features yet)"}`;
33499
33554
 
33500
33555
  // ../editor/src/agent/workspaceBrief.ts
33501
33556
  var path28 = __toESM(require("node:path"));
33502
- var import_node_child_process5 = require("node:child_process");
33557
+ var import_node_child_process6 = require("node:child_process");
33503
33558
  var MAX_BRIEF_CHARS = 3200;
33504
33559
  var MAX_TOP_LEVEL = 36;
33505
33560
  var MAX_DIRTY_FILES = 12;
@@ -33648,7 +33703,7 @@ function outline(root2) {
33648
33703
  function git(root2, args2) {
33649
33704
  return new Promise((resolve26) => {
33650
33705
  try {
33651
- (0, import_node_child_process5.execFile)(
33706
+ (0, import_node_child_process6.execFile)(
33652
33707
  "git",
33653
33708
  args2,
33654
33709
  { cwd: root2, timeout: GIT_TIMEOUT_MS, maxBuffer: 256 * 1024 },
@@ -34279,7 +34334,7 @@ init_define_ASTRACODE_BUNDLED_SKILLS();
34279
34334
  var crypto9 = __toESM(require("node:crypto"));
34280
34335
  var fs30 = __toESM(require("node:fs"));
34281
34336
  var path32 = __toESM(require("node:path"));
34282
- var import_node_child_process6 = require("node:child_process");
34337
+ var import_node_child_process7 = require("node:child_process");
34283
34338
  var import_node_util2 = require("node:util");
34284
34339
 
34285
34340
  // ../editor/src/agent/astChunker.ts
@@ -34656,7 +34711,7 @@ function declaring(chunks, query) {
34656
34711
  }
34657
34712
 
34658
34713
  // ../editor/src/agent/codeIndex.ts
34659
- var execFileAsync2 = (0, import_node_util2.promisify)(import_node_child_process6.execFile);
34714
+ var execFileAsync2 = (0, import_node_util2.promisify)(import_node_child_process7.execFile);
34660
34715
  var INDEX_VERSION = 1;
34661
34716
  var EMBEDDING_DIMS = 256;
34662
34717
  var MAX_INDEXED_FILES = 4e3;
@@ -35877,7 +35932,7 @@ function noteRead(relativePath) {
35877
35932
 
35878
35933
  // ../editor/src/agent/infraContext.ts
35879
35934
  init_define_ASTRACODE_BUNDLED_SKILLS();
35880
- var import_node_child_process7 = require("node:child_process");
35935
+ var import_node_child_process8 = require("node:child_process");
35881
35936
  var fs31 = __toESM(require("node:fs"));
35882
35937
  var path34 = __toESM(require("node:path"));
35883
35938
  function infraContext(command2, cwd) {
@@ -35887,7 +35942,7 @@ function infraContext(command2, cwd) {
35887
35942
  let context = explicit;
35888
35943
  if (!context) {
35889
35944
  try {
35890
- context = (0, import_node_child_process7.execFileSync)("kubectl", ["config", "current-context"], { timeout: 2e3, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
35945
+ context = (0, import_node_child_process8.execFileSync)("kubectl", ["config", "current-context"], { timeout: 2e3, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
35891
35946
  } catch {
35892
35947
  context = void 0;
35893
35948
  }
@@ -39411,7 +39466,7 @@ var fs40 = __toESM(require("node:fs"));
39411
39466
 
39412
39467
  // ../editor/src/agent/visual/capture.ts
39413
39468
  init_define_ASTRACODE_BUNDLED_SKILLS();
39414
- var import_node_child_process9 = require("node:child_process");
39469
+ var import_node_child_process10 = require("node:child_process");
39415
39470
  var fs39 = __toESM(require("node:fs"));
39416
39471
  var os13 = __toESM(require("node:os"));
39417
39472
  var path43 = __toESM(require("node:path"));
@@ -39419,11 +39474,11 @@ var import_node_util4 = require("node:util");
39419
39474
 
39420
39475
  // ../editor/src/agent/visual/flutterRender.ts
39421
39476
  init_define_ASTRACODE_BUNDLED_SKILLS();
39422
- var import_node_child_process8 = require("node:child_process");
39477
+ var import_node_child_process9 = require("node:child_process");
39423
39478
  var fs38 = __toESM(require("node:fs"));
39424
39479
  var path42 = __toESM(require("node:path"));
39425
39480
  var import_node_util3 = require("node:util");
39426
- var run2 = (0, import_node_util3.promisify)(import_node_child_process8.execFile);
39481
+ var run2 = (0, import_node_util3.promisify)(import_node_child_process9.execFile);
39427
39482
  var flutter = (args2, opts) => process.platform === "win32" ? run2("flutter", args2.map((a) => `"${a.replace(/"/g, '""')}"`), { ...opts, shell: true }) : run2("flutter", args2, opts);
39428
39483
  function readPubspec(text2) {
39429
39484
  const name3 = /^name:\s*([\w_]+)/m.exec(text2)?.[1];
@@ -39554,7 +39609,7 @@ ${errors || text2.slice(-800)}`);
39554
39609
  }
39555
39610
 
39556
39611
  // ../editor/src/agent/visual/capture.ts
39557
- var run3 = (0, import_node_util4.promisify)(import_node_child_process9.execFile);
39612
+ var run3 = (0, import_node_util4.promisify)(import_node_child_process10.execFile);
39558
39613
  function isCaptureTarget(v) {
39559
39614
  return v === "browser" || v === "ios-simulator" || v === "android-emulator" || v === "flutter";
39560
39615
  }
@@ -41970,7 +42025,7 @@ function designPlateaued(pctAtEvaluations) {
41970
42025
 
41971
42026
  // ../editor/src/agent/evaluator.ts
41972
42027
  init_define_ASTRACODE_BUNDLED_SKILLS();
41973
- var import_node_child_process10 = require("node:child_process");
42028
+ var import_node_child_process11 = require("node:child_process");
41974
42029
  var fs44 = __toESM(require("node:fs"));
41975
42030
  var path47 = __toESM(require("node:path"));
41976
42031
  var import_node_util5 = require("node:util");
@@ -42081,7 +42136,7 @@ async function withReconnect(call, opts = {}) {
42081
42136
  }
42082
42137
 
42083
42138
  // ../editor/src/agent/evaluator.ts
42084
- var execFileAsync3 = (0, import_node_util5.promisify)(import_node_child_process10.execFile);
42139
+ var execFileAsync3 = (0, import_node_util5.promisify)(import_node_child_process11.execFile);
42085
42140
  var EVALUATOR_MAX_STEPS = 10;
42086
42141
  var MAX_DIFF_CHARS = 6e4;
42087
42142
  function evaluatorEnabled() {
@@ -44511,7 +44566,7 @@ var import_node_crypto11 = require("node:crypto");
44511
44566
 
44512
44567
  // ../editor/src/cli/credentials.ts
44513
44568
  init_define_ASTRACODE_BUNDLED_SKILLS();
44514
- var import_node_child_process11 = require("node:child_process");
44569
+ var import_node_child_process12 = require("node:child_process");
44515
44570
  var fs46 = __toESM(require("node:fs"));
44516
44571
  var os15 = __toESM(require("node:os"));
44517
44572
  var path49 = __toESM(require("node:path"));
@@ -44551,7 +44606,7 @@ var FileStore2 = class {
44551
44606
  };
44552
44607
  function security(args2) {
44553
44608
  return new Promise((resolve26) => {
44554
- (0, import_node_child_process11.execFile)("/usr/bin/security", args2, (err2, stdout) => {
44609
+ (0, import_node_child_process12.execFile)("/usr/bin/security", args2, (err2, stdout) => {
44555
44610
  const code = err2 ? typeof err2.code === "number" ? err2.code : 1 : 0;
44556
44611
  resolve26({ code, stdout: String(stdout) });
44557
44612
  });
@@ -44569,7 +44624,7 @@ var KeychainStore = class {
44569
44624
  throw new Error("the gateway returned a token this CLI cannot store safely");
44570
44625
  }
44571
44626
  await new Promise((resolve26, reject) => {
44572
- const child = (0, import_node_child_process11.spawn)("/usr/bin/security", ["-i"], { stdio: ["pipe", "ignore", "pipe"] });
44627
+ const child = (0, import_node_child_process12.spawn)("/usr/bin/security", ["-i"], { stdio: ["pipe", "ignore", "pipe"] });
44573
44628
  let stderr = "";
44574
44629
  child.stderr.on("data", (c) => stderr += c);
44575
44630
  child.on("error", reject);
@@ -44637,7 +44692,7 @@ var KeychainSecrets = class {
44637
44692
  if (!SECRET_KEY.test(key)) throw new Error(`"${key}" cannot be used as a Keychain account name`);
44638
44693
  const hex5 = Buffer.from(`b64:${Buffer.from(value, "utf8").toString("base64")}`, "utf8").toString("hex");
44639
44694
  await new Promise((resolve26, reject) => {
44640
- const child = (0, import_node_child_process11.spawn)("/usr/bin/security", ["-i"], { stdio: ["pipe", "ignore", "pipe"] });
44695
+ const child = (0, import_node_child_process12.spawn)("/usr/bin/security", ["-i"], { stdio: ["pipe", "ignore", "pipe"] });
44641
44696
  let stderr = "";
44642
44697
  child.stderr.on("data", (c) => stderr += c);
44643
44698
  child.on("error", reject);
@@ -64653,7 +64708,7 @@ var import_node_stream2 = require("node:stream");
64653
64708
 
64654
64709
  // ../editor/src/cli/auth.ts
64655
64710
  init_define_ASTRACODE_BUNDLED_SKILLS();
64656
- var import_node_child_process12 = require("node:child_process");
64711
+ var import_node_child_process13 = require("node:child_process");
64657
64712
  var RENEW_WITHIN_SECONDS = 30 * 60 * 60;
64658
64713
  var SIGN_IN_HINT = "Run `astracode-agent login`, or set ASTRACODE_API_KEY.";
64659
64714
  async function credentialForRun(log2, opts = {}) {
@@ -64686,7 +64741,7 @@ async function credentialForRun(log2, opts = {}) {
64686
64741
  function openInBrowser(url2) {
64687
64742
  const [cmd, args2] = process.platform === "darwin" ? ["open", [url2]] : process.platform === "win32" ? ["cmd", ["/c", "start", '""', url2]] : ["xdg-open", [url2]];
64688
64743
  try {
64689
- const child = (0, import_node_child_process12.spawn)(cmd, args2, { stdio: "ignore", detached: true });
64744
+ const child = (0, import_node_child_process13.spawn)(cmd, args2, { stdio: "ignore", detached: true });
64690
64745
  child.on("error", () => {
64691
64746
  });
64692
64747
  child.unref();
@@ -66687,7 +66742,7 @@ ${PLUGIN_USAGE}
66687
66742
 
66688
66743
  // ../editor/src/cli/tui/onboard.ts
66689
66744
  init_define_ASTRACODE_BUNDLED_SKILLS();
66690
- var import_node_child_process17 = require("node:child_process");
66745
+ var import_node_child_process18 = require("node:child_process");
66691
66746
  var readline3 = __toESM(require("node:readline"));
66692
66747
 
66693
66748
  // ../editor/src/cli/tui/screen.ts
@@ -67884,7 +67939,7 @@ function toolResult2(app, e, turn) {
67884
67939
 
67885
67940
  // ../editor/src/cli/tui/commands.ts
67886
67941
  init_define_ASTRACODE_BUNDLED_SKILLS();
67887
- var import_node_child_process13 = require("node:child_process");
67942
+ var import_node_child_process14 = require("node:child_process");
67888
67943
  var fs55 = __toESM(require("node:fs"));
67889
67944
  var os18 = __toESM(require("node:os"));
67890
67945
  var path61 = __toESM(require("node:path"));
@@ -68013,7 +68068,7 @@ async function shell(app, command2) {
68013
68068
  if (!command2) return;
68014
68069
  app.print("\n" + yellow("! ") + command2);
68015
68070
  const output = await new Promise((resolve26) => {
68016
- (0, import_node_child_process13.execFile)(
68071
+ (0, import_node_child_process14.execFile)(
68017
68072
  process.env.SHELL || "/bin/sh",
68018
68073
  ["-c", command2],
68019
68074
  { cwd: app.host.cwd, maxBuffer: 16 * 1024 * 1024, timeout: 12e4 },
@@ -68051,7 +68106,7 @@ function externalEditor(app) {
68051
68106
  fs55.writeFileSync(file2, app.editor.text);
68052
68107
  app.screen.suspend();
68053
68108
  app.input.setRawMode?.(false);
68054
- (0, import_node_child_process13.spawnSync)(editor, [file2], { stdio: "inherit", shell: true });
68109
+ (0, import_node_child_process14.spawnSync)(editor, [file2], { stdio: "inherit", shell: true });
68055
68110
  app.input.setRawMode?.(true);
68056
68111
  try {
68057
68112
  app.editor.set(fs55.readFileSync(file2, "utf8").replace(/\n$/, ""));
@@ -68073,7 +68128,7 @@ async function pasteImage(app) {
68073
68128
  "write d to h",
68074
68129
  "close access h"
68075
68130
  ];
68076
- const r = (0, import_node_child_process13.spawnSync)(
68131
+ const r = (0, import_node_child_process14.spawnSync)(
68077
68132
  "osascript",
68078
68133
  script.flatMap((l) => ["-e", l]),
68079
68134
  { stdio: "ignore" }
@@ -68403,7 +68458,7 @@ async function memory(app, args2) {
68403
68458
  }
68404
68459
  async function review(app, base) {
68405
68460
  const git3 = (a) => new Promise(
68406
- (resolve26) => (0, import_node_child_process13.execFile)(
68461
+ (resolve26) => (0, import_node_child_process14.execFile)(
68407
68462
  "git",
68408
68463
  a,
68409
68464
  { cwd: app.host.cwd, maxBuffer: 64 * 1024 * 1024 },
@@ -68414,7 +68469,7 @@ async function review(app, base) {
68414
68469
  (r) => r.code === 0 ? { base: r.out.trim(), label: base } : void 0
68415
68470
  ) : await findBase(
68416
68471
  (a, cwd) => new Promise(
68417
- (res) => (0, import_node_child_process13.execFile)("git", a, { cwd }, (err2, out2) => res({ code: err2 ? 1 : 0, out: String(out2) }))
68472
+ (res) => (0, import_node_child_process14.execFile)("git", a, { cwd }, (err2, out2) => res({ code: err2 ? 1 : 0, out: String(out2) }))
68418
68473
  ),
68419
68474
  app.host.cwd
68420
68475
  );
@@ -68453,7 +68508,7 @@ async function review(app, base) {
68453
68508
  }
68454
68509
  async function diff(app) {
68455
68510
  const out2 = await new Promise(
68456
- (resolve26) => (0, import_node_child_process13.execFile)(
68511
+ (resolve26) => (0, import_node_child_process14.execFile)(
68457
68512
  "git",
68458
68513
  ["-c", "color.ui=always", "diff", "--stat", "--patch", "HEAD"],
68459
68514
  { cwd: app.host.cwd, maxBuffer: 64 * 1024 * 1024 },
@@ -68583,7 +68638,7 @@ async function offerBuild(app, plan) {
68583
68638
 
68584
68639
  // ../editor/src/cli/tui/suggest.ts
68585
68640
  init_define_ASTRACODE_BUNDLED_SKILLS();
68586
- var import_node_child_process14 = require("node:child_process");
68641
+ var import_node_child_process15 = require("node:child_process");
68587
68642
  var PHRASINGS = [
68588
68643
  (f) => `how does ${f} work?`,
68589
68644
  (f) => `write a test for ${f}`,
@@ -68596,7 +68651,7 @@ var SOURCE3 = /\.(ts|tsx|js|jsx|mjs|py|go|rs|java|kt|swift|rb|php|cs|cpp|cc|c|h|
68596
68651
  var SKIP2 = /(^|\/)(node_modules|dist|build|out|vendor|\.next|target|__pycache__)\/|\.min\.|\.d\.ts$|(^|\/)(test|tests|__tests__)\//;
68597
68652
  function recentFiles(cwd, commits = 30) {
68598
68653
  try {
68599
- const out2 = (0, import_node_child_process14.execFileSync)("git", ["log", `-n${commits}`, "--name-only", "--pretty=format:"], {
68654
+ const out2 = (0, import_node_child_process15.execFileSync)("git", ["log", `-n${commits}`, "--name-only", "--pretty=format:"], {
68600
68655
  cwd,
68601
68656
  encoding: "utf8",
68602
68657
  maxBuffer: 8 * 1024 * 1024,
@@ -69430,7 +69485,7 @@ function ago2(t2) {
69430
69485
 
69431
69486
  // ../editor/src/cli/tui/complete.ts
69432
69487
  init_define_ASTRACODE_BUNDLED_SKILLS();
69433
- var import_node_child_process15 = require("node:child_process");
69488
+ var import_node_child_process16 = require("node:child_process");
69434
69489
  var fs57 = __toESM(require("node:fs"));
69435
69490
  var path63 = __toESM(require("node:path"));
69436
69491
  function fuzzyScore(query, candidate) {
@@ -69469,7 +69524,7 @@ var SKIP3 = /* @__PURE__ */ new Set([
69469
69524
  var MAX_FILES3 = 2e4;
69470
69525
  function listFiles2(root2) {
69471
69526
  try {
69472
- const out2 = (0, import_node_child_process15.execFileSync)("git", ["ls-files", "--cached", "--others", "--exclude-standard"], {
69527
+ const out2 = (0, import_node_child_process16.execFileSync)("git", ["ls-files", "--cached", "--others", "--exclude-standard"], {
69473
69528
  cwd: root2,
69474
69529
  encoding: "utf8",
69475
69530
  maxBuffer: 64 * 1024 * 1024,
@@ -69501,7 +69556,7 @@ function listFiles2(root2) {
69501
69556
 
69502
69557
  // ../editor/src/cli/tui/welcome.ts
69503
69558
  init_define_ASTRACODE_BUNDLED_SKILLS();
69504
- var import_node_child_process16 = require("node:child_process");
69559
+ var import_node_child_process17 = require("node:child_process");
69505
69560
  var os19 = __toESM(require("node:os"));
69506
69561
  var MARK2 = [" \u2584\u2596 \u2588 \u2597\u2584 ", "\u2590\u258C\u2584\u2584\u2584\u259F\u2588\u2599\u2584\u2584\u2584\u2590\u258C", "\u259F\u2598\u259D\u259C\u2588\u2588\u2588\u2588\u2588\u259B\u2598\u259D\u2599", "\u2590\u258C \u259F\u2588\u2588\u2588\u2599 \u2590\u258C", "\u259D\u2599\u2596\u2597\u259B\u2580 \u2580\u259C\u2596\u2597\u259F\u2598"];
69507
69562
  var TWINKLE = ["\u2726", "\u2727", "\u22C6", "\u2727", "\u2726", " ", " ", " "];
@@ -69516,7 +69571,7 @@ function logo(ms) {
69516
69571
  }
69517
69572
  function branch(cwd) {
69518
69573
  try {
69519
- const b = (0, import_node_child_process16.execFileSync)("git", ["rev-parse", "--abbrev-ref", "HEAD"], {
69574
+ const b = (0, import_node_child_process17.execFileSync)("git", ["rev-parse", "--abbrev-ref", "HEAD"], {
69520
69575
  cwd,
69521
69576
  encoding: "utf8",
69522
69577
  stdio: ["ignore", "pipe", "ignore"]
@@ -70161,7 +70216,7 @@ function wrapUrl(url2, w) {
70161
70216
  function copyToClipboard(text2) {
70162
70217
  const cmd = process.platform === "darwin" ? ["pbcopy", []] : process.platform === "win32" ? ["clip", []] : ["xclip", ["-selection", "clipboard"]];
70163
70218
  try {
70164
- const child = (0, import_node_child_process17.execFile)(cmd[0], cmd[1], () => void 0);
70219
+ const child = (0, import_node_child_process18.execFile)(cmd[0], cmd[1], () => void 0);
70165
70220
  child.stdin?.end(text2);
70166
70221
  } catch {
70167
70222
  }
@@ -70528,11 +70583,11 @@ async function firstRun(opts, settings) {
70528
70583
 
70529
70584
  // ../editor/src/cli/review.ts
70530
70585
  init_define_ASTRACODE_BUNDLED_SKILLS();
70531
- var import_node_child_process18 = require("node:child_process");
70586
+ var import_node_child_process19 = require("node:child_process");
70532
70587
  var MAX_DIFF_CHARS3 = 12e4;
70533
70588
  function git2(args2, cwd) {
70534
70589
  return new Promise((resolve26) => {
70535
- (0, import_node_child_process18.execFile)("git", args2, { cwd, maxBuffer: 64 * 1024 * 1024 }, (err2, stdout) => {
70590
+ (0, import_node_child_process19.execFile)("git", args2, { cwd, maxBuffer: 64 * 1024 * 1024 }, (err2, stdout) => {
70536
70591
  resolve26({ code: err2 ? typeof err2.code === "number" ? err2.code : 1 : 0, out: String(stdout) });
70537
70592
  });
70538
70593
  });
@@ -70676,7 +70731,7 @@ ${lines2.join("\n\n")}
70676
70731
 
70677
70732
  // ../editor/src/cli/update.ts
70678
70733
  init_define_ASTRACODE_BUNDLED_SKILLS();
70679
- var import_node_child_process19 = require("node:child_process");
70734
+ var import_node_child_process20 = require("node:child_process");
70680
70735
  var fs58 = __toESM(require("node:fs"));
70681
70736
  var os20 = __toESM(require("node:os"));
70682
70737
  var path65 = __toESM(require("node:path"));
@@ -70743,7 +70798,7 @@ async function update2(current4) {
70743
70798
  env5.ASTRACODE_DATA_DIR = path65.dirname(versionDir);
70744
70799
  }
70745
70800
  return new Promise((resolve26) => {
70746
- const child = (0, import_node_child_process19.spawn)("sh", ["-s"], { env: env5, stdio: ["pipe", "inherit", "inherit"] });
70801
+ const child = (0, import_node_child_process20.spawn)("sh", ["-s"], { env: env5, stdio: ["pipe", "inherit", "inherit"] });
70747
70802
  child.on("error", (err2) => {
70748
70803
  process.stderr.write(`astracode-agent: could not run the installer (${err2.message})
70749
70804
  `);
@@ -70771,7 +70826,7 @@ function runWindowsInstaller(script, base) {
70771
70826
  fs58.rmSync(dir, { recursive: true, force: true });
70772
70827
  resolve26(code);
70773
70828
  };
70774
- const child = (0, import_node_child_process19.spawn)("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", command2], { env: env5, stdio: "inherit" });
70829
+ const child = (0, import_node_child_process20.spawn)("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", command2], { env: env5, stdio: "inherit" });
70775
70830
  child.on("error", (err2) => {
70776
70831
  process.stderr.write(`astracode-agent: could not run the installer (${err2.message})
70777
70832
  `);
@@ -70960,7 +71015,7 @@ var RunReporter = class {
70960
71015
 
70961
71016
  // ../editor/src/cli/main.ts
70962
71017
  var readline5 = __toESM(require("node:readline"));
70963
- var VERSION2 = true ? "0.6.0" : "dev";
71018
+ var VERSION2 = true ? "0.6.1" : "dev";
70964
71019
  function readStdin() {
70965
71020
  return new Promise((resolve26, reject) => {
70966
71021
  const chunks = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astracode-agent",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "The AstraCode agent, headless: run one task from a shell, a CI job or a script.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "homepage": "https://astracode.io",