@sourcegraph/amp 0.0.1749340926-g6cda64 → 0.0.1749367516-gcb962c

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.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import u from "node:path";
3
- import { p as d, aC as f, aD as l } from "./console-Dvb4mlt2.js";
3
+ import { p as d, aC as f, aD as l } from "./console-y67QVOnq.js";
4
4
  const w = ({ args: t }, { dir: a, dirs: n, trackFileChange: c, filesystem: o }) => d(async (e) => {
5
5
  if (f(a), typeof t.content != "string")
6
6
  throw new Error("create_file: content must be specified");
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { p, aC as m, aD as F, aE as v, aF as _, aG as b } from "./console-Dvb4mlt2.js";
3
- import { recordEdit as x } from "./undo_edit.node-CR56HIq6.js";
2
+ import { p, aC as m, aD as F, aE as v, aF as _, aG as b } from "./console-y67QVOnq.js";
3
+ import { recordEdit as x } from "./undo_edit.node-DonqqKq5.js";
4
4
  class E {
5
5
  #e = !1;
6
6
  #t = [];
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { existsSync as o } from "node:fs";
3
3
  import { createRequire as t } from "node:module";
4
- import { C as i } from "./console-Dvb4mlt2.js";
4
+ import { C as i } from "./console-y67QVOnq.js";
5
5
  function u() {
6
6
  {
7
7
  if (process.env.AMP_RIPGREP_PATH)
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import T from "node:path";
3
- import { b8 as B, b9 as I, C as v, ba as z, bb as C } from "./console-Dvb4mlt2.js";
3
+ import { b8 as B, b9 as I, C as v, ba as z, bb as C } from "./console-y67QVOnq.js";
4
4
  async function A(r, h, a) {
5
5
  const x = await a.listFiles(h), i = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), m = [], M = /\b([\w/_-]+(?:\\.|[\w/_-])*(?:\.[\w-]+)+)\b/g, F = /(\/(?:[\w-]+\/|[\w-]+\\[.\s\S])+[\w.-]+(?:\\.|[\w.-])*(?:\.[\w-]+)+)\b/g, y = /\b([A-Za-z]:[\\\\][^\s"'<>|]*(?:\.[\w-]+)+)\b/g;
6
6
  await l(M, !1), await l(F, !0), await l(y, !0);
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { spawn as w } from "node:child_process";
3
- import { p as I } from "./index-obyovEcz.js";
4
- import { O as v, g as N, m as E, aC as P, C as R } from "./console-Dvb4mlt2.js";
5
- import { r as D } from "./executable-BnwRQX_M.js";
3
+ import { p as I } from "./index-CxZeQtZd.js";
4
+ import { O as v, g as N, m as E, C as P, aC as R } from "./console-y67QVOnq.js";
5
+ import { r as D } from "./executable-3LtkLCkg.js";
6
6
  const S = ({ args: i }, { dirs: r }) => {
7
7
  if (r.length === 0)
8
8
  return new v((s) => {
@@ -39,7 +39,7 @@ function O(i, r, n) {
39
39
  );
40
40
  }
41
41
  function b(i, r, n) {
42
- return P(i), new v((s) => {
42
+ return R(i), new v((s) => {
43
43
  s.next({
44
44
  status: "in-progress",
45
45
  progress: []
@@ -98,7 +98,7 @@ function F(i, r, n) {
98
98
  g--;
99
99
  return;
100
100
  }
101
- c.push(a), c.length >= f && (R.warn("Glob limit reached. Returning partial results.", {
101
+ c.push(a), c.length >= f && (P.warn("Glob limit reached. Returning partial results.", {
102
102
  glob: r?.pattern,
103
103
  limit: f,
104
104
  dir: i
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { z as xt } from "./console-Dvb4mlt2.js";
2
+ import { z as xt } from "./console-y67QVOnq.js";
3
3
  var pt = {}, ft, Et;
4
4
  function ct() {
5
5
  if (Et) return ft;
@@ -2,7 +2,7 @@
2
2
  import c from "node:fs/promises";
3
3
  import u from "node:os";
4
4
  import s from "node:path";
5
- import { O as f, aH as i, aI as l, m, aJ as p } from "./console-Dvb4mlt2.js";
5
+ import { O as f, aH as i, aI as l, m, aJ as p } from "./console-y67QVOnq.js";
6
6
  const D = ({ args: r }, { dirs: t }) => {
7
7
  if (t.length === 0)
8
8
  return new f((e) => {
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import n from "node:os";
3
- import { O as r } from "./console-Dvb4mlt2.js";
3
+ import { O as r } from "./console-y67QVOnq.js";
4
4
  const e = process.env;
5
5
  function i(t, o = "always") {
6
6
  return o === "never" ? r.of(e) : r.of(e);
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { O as je, s as Dr, c as dh, a as _r, b as Zn, f as We, d as kt, p as Dt, m as Ee, e as Bn, g as br, h as $t, i as sp, j as ph, o as ue, l as be, k as oe, n as re, q as ye, r as Ge, t as Ke, u as He, v as Xn, w as it, x as mh, y as lp, z as ei, A as up, M as Je, B as gh, C as J, N as Fn, D as ri, E as Jr, F as Ss, G as cp, H as fp, I as Es, J as hp, K as vh, L as dp, P as al, Q as Mt, R as pp, S as mp, T as gp, U as vp, V as yp, W as bp, X as wp, Y as _p, Z as Sp, _ as Ep, $ as Pp, a0 as Cp, a1 as Rp, a2 as xp, a3 as Tp, a4 as Op, a5 as Ap, a6 as Lp, a7 as Ip, a8 as Dp, a9 as at, aa as $p, ab as Mp, ac as yh, ad as Et, ae as ts, af as ns, ag as jn, ah as kp, ai as Fp, aj as jp, ak as qp, al as Ps, am as ol, an as Cs, ao as qr, ap as is, aq as Np, ar as Hp, as as sl, at as Up, au as Bp, av as as, aw as bh, ax as wh, ay as zp, az as Vp } from "./console-Dvb4mlt2.js";
2
+ import { O as je, s as Dr, c as dh, a as _r, b as Zn, f as We, d as kt, p as Dt, m as Ee, e as Bn, g as br, h as $t, i as sp, j as ph, o as ue, l as be, k as oe, n as re, q as ye, r as Ge, t as Ke, u as He, v as Xn, w as it, x as mh, y as lp, z as ei, A as up, M as Je, B as gh, C as J, N as Fn, D as ri, E as Jr, F as Ss, G as cp, H as fp, I as Es, J as hp, K as vh, L as dp, P as al, Q as Mt, R as pp, S as mp, T as gp, U as vp, V as yp, W as bp, X as wp, Y as _p, Z as Sp, _ as Ep, $ as Pp, a0 as Cp, a1 as Rp, a2 as xp, a3 as Tp, a4 as Op, a5 as Ap, a6 as Lp, a7 as Ip, a8 as Dp, a9 as at, aa as $p, ab as Mp, ac as yh, ad as Et, ae as ts, af as ns, ag as jn, ah as kp, ai as Fp, aj as jp, ak as qp, al as Ps, am as ol, an as Cs, ao as qr, ap as is, aq as Np, ar as Hp, as as sl, at as Up, au as Bp, av as as, aw as bh, ax as wh, ay as zp, az as Vp } from "./console-y67QVOnq.js";
3
3
  import * as Wp from "node:fs/promises";
4
4
  import tt, { readdir as _h, stat as Sh, readFile as Or, mkdir as zn, writeFile as Tt, unlink as Gp, readlink as Kp, open as Jp } from "node:fs/promises";
5
5
  import * as Yp from "node:path";
6
6
  import me, { join as ze, dirname as ll } from "node:path";
7
- import { i as ul, F as yi, f as wr, a as Qp } from "./client-D-IY-U_F.js";
7
+ import { i as ul, F as yi, f as wr, a as Qp } from "./client-DTzW73uz.js";
8
8
  import Rs from "node:events";
9
9
  import * as Zp from "node:child_process";
10
10
  import Xp, { execFile as Eh, spawn as ti, exec as Nr } from "node:child_process";
@@ -18,7 +18,7 @@ import fm, { createGzip as hm } from "node:zlib";
18
18
  import dm from "node:string_decoder";
19
19
  import pm, { createServer as Ph } from "node:http";
20
20
  import mm from "node:https";
21
- import { r as gm } from "./executable-BnwRQX_M.js";
21
+ import { r as gm } from "./executable-3LtkLCkg.js";
22
22
  import { pipeline as vm } from "node:stream/promises";
23
23
  import { lookup as ym } from "node:dns";
24
24
  const Ir = Symbol.for("@@pendingOperation");
@@ -4991,10 +4991,10 @@ async function Nv(t, e, n) {
4991
4991
  if ("url" in t)
4992
4992
  i = new jv(new URL(t.url));
4993
4993
  else {
4994
- const { loadProfileEnvironmentVariables: r } = await import("./load-profile-DfwAD194.js"), a = n.loadProfile === "never" || !n.workingDirectory ? process.env : await We(
4994
+ const { loadProfileEnvironmentVariables: r } = await import("./load-profile-ByMlljkK.js"), a = n.loadProfile === "never" || !n.workingDirectory ? process.env : await We(
4995
4995
  r(n.workingDirectory, n.loadProfile)
4996
4996
  );
4997
- i = await import("./stdio-DfB-2s-H.js").then(
4997
+ i = await import("./stdio-DcmzvUF-.js").then(
4998
4998
  ({ StdioClientTransport: s }) => new s({
4999
4999
  ...t,
5000
5000
  stderr: "pipe",
@@ -5755,7 +5755,7 @@ IMPORTANT: The result of this tool (if any) should be displayed directly to the
5755
5755
  },
5756
5756
  source: "builtin"
5757
5757
  },
5758
- fn: import("./node-BBHud4Hw.js").then(({ runRoutine: t }) => t)
5758
+ fn: import("./node-Bk5xda6B.js").then(({ runRoutine: t }) => t)
5759
5759
  };
5760
5760
  let hu = !1;
5761
5761
  async function ed(t, e = !1) {
@@ -17638,7 +17638,7 @@ async function Ur(t, e, { stdin: n, stdout: i } = { stdin: process.stdin, stdout
17638
17638
  n.on("data", u), n.once("error", o);
17639
17639
  });
17640
17640
  }
17641
- const Bd = import("./node-CeVAo09v.js").then(
17641
+ const Bd = import("./node-0bVpGlb9.js").then(
17642
17642
  ({ nodeFileSystem: t }) => t
17643
17643
  ), Qo = Ft(Zp.exec);
17644
17644
  async function cw(t) {
@@ -18792,7 +18792,7 @@ async function Rw({
18792
18792
  }
18793
18793
  async function xw(t) {
18794
18794
  try {
18795
- const e = await _w("0.0.1749340926-g6cda64");
18795
+ const e = await _w("0.0.1749367516-gcb962c");
18796
18796
  e.hasUpdate && e.latestVersion ? (t.next({ type: "update-start-updating" }), setTimeout(async () => {
18797
18797
  try {
18798
18798
  await Cw(e.latestVersion), t.next({
@@ -20550,7 +20550,7 @@ async function Un(t, e) {
20550
20550
  Yn({
20551
20551
  logLevel: e.logLevel || process.env.AMP_LOG_LEVEL,
20552
20552
  logFile: e.logFile || process.env.AMP_LOG_FILE
20553
- }), Vp("0.0.1749340926-g6cda64");
20553
+ }), Vp("0.0.1749367516-gcb962c");
20554
20554
  const n = e.settingsFile ?? process.env.AMP_SETTINGS_FILE;
20555
20555
  J.info("Using settings file", { settingsFile: n });
20556
20556
  const i = Hn(), r = ad({ settingsFile: n }), a = process.env.AMP_API_KEY;
@@ -20658,7 +20658,7 @@ function Zw(t) {
20658
20658
  const e = new wu().name("amp").description("AI-powered coding assistant").option("--thread-id [THREAD_ID]", "ID of the thread to continue running", void 0);
20659
20659
  e.option("-V, --version", "output the version number", () => {
20660
20660
  if (t.isTTY) {
20661
- const a = "0.0.1749340926-g6cda64".match(/^(\d+\.\d+)\.(\d+)-(.+)$/);
20661
+ const a = "0.0.1749367516-gcb962c".match(/^(\d+\.\d+)\.(\d+)-(.+)$/);
20662
20662
  if (a) {
20663
20663
  const [, , s] = a;
20664
20664
  try {
@@ -20669,21 +20669,21 @@ function Zw(t) {
20669
20669
  day: "numeric"
20670
20670
  });
20671
20671
  Ie.write(
20672
- `0.0.1749340926-g6cda64 ${t.printer.print(`(released ${o})`, { foreground: "gray" })}
20672
+ `0.0.1749367516-gcb962c ${t.printer.print(`(released ${o})`, { foreground: "gray" })}
20673
20673
  `
20674
20674
  );
20675
20675
  } else
20676
- Ie.write(`0.0.1749340926-g6cda64
20676
+ Ie.write(`0.0.1749367516-gcb962c
20677
20677
  `);
20678
20678
  } catch {
20679
- Ie.write(`0.0.1749340926-g6cda64
20679
+ Ie.write(`0.0.1749367516-gcb962c
20680
20680
  `);
20681
20681
  }
20682
20682
  } else
20683
- Ie.write(`0.0.1749340926-g6cda64
20683
+ Ie.write(`0.0.1749367516-gcb962c
20684
20684
  `);
20685
20685
  } else
20686
- Ie.write(`0.0.1749340926-g6cda64
20686
+ Ie.write(`0.0.1749367516-gcb962c
20687
20687
  `);
20688
20688
  process.exit(0);
20689
20689
  }), e.addHelpText(
@@ -21129,5 +21129,6 @@ function r_(t, e, n = {}) {
21129
21129
  }
21130
21130
  export {
21131
21131
  Am as J,
21132
+ di as U,
21132
21133
  ey as r
21133
21134
  };
@@ -0,0 +1,132 @@
1
+ #!/usr/bin/env node
2
+ import { execFile as m } from "node:child_process";
3
+ import * as i from "node:fs";
4
+ import * as o from "node:path";
5
+ import { join as p } from "node:path";
6
+ import { promisify as w } from "node:util";
7
+ import { U as h } from "./main-CKyzkNHf.js";
8
+ import { N as y, C as n, aJ as c } from "./console-y67QVOnq.js";
9
+ import { ripgrepFiles as d } from "./glob.node-0aiTM2uj.js";
10
+ import { homedir as F } from "node:os";
11
+ const g = p(F(), ".amp", "file-changes"), u = w(m);
12
+ function B(a) {
13
+ const s = o.join(g, a);
14
+ return {
15
+ relativePath: (r, e) => o.relative(r, e),
16
+ joinPath: (...r) => o.join(...r),
17
+ readFile: async (r, e) => {
18
+ try {
19
+ return await i.promises.readFile(r, { encoding: "utf8", signal: e });
20
+ } catch (t) {
21
+ throw l(t) ? new c(r) : t;
22
+ }
23
+ },
24
+ readBinaryFile: async (r, e) => {
25
+ try {
26
+ return await i.promises.readFile(r, { signal: e });
27
+ } catch (t) {
28
+ throw l(t) ? new c(r) : t;
29
+ }
30
+ },
31
+ getMtime: async (r, e) => {
32
+ try {
33
+ return (await i.promises.stat(r)).mtimeMs;
34
+ } catch (t) {
35
+ throw l(t) ? new c(r) : t;
36
+ }
37
+ },
38
+ stat: async (r) => {
39
+ try {
40
+ return {
41
+ size: (await i.promises.stat(r)).size
42
+ };
43
+ } catch (e) {
44
+ throw l(e) ? new c(r) : e;
45
+ }
46
+ },
47
+ writeFile: async (r, e, t) => {
48
+ await i.promises.writeFile(r, e, { encoding: "utf-8", signal: t });
49
+ },
50
+ deleteFile: async (r, e) => {
51
+ try {
52
+ await i.promises.unlink(r);
53
+ } catch (t) {
54
+ throw l(t) ? new c(r) : t;
55
+ }
56
+ },
57
+ mkdirp: async (r) => {
58
+ await i.promises.mkdir(r, { recursive: !0 });
59
+ },
60
+ storeFileChange: async (r, e) => {
61
+ const t = o.join(s, r);
62
+ await i.promises.writeFile(t, JSON.stringify(e, null, 2), "utf8");
63
+ },
64
+ listBackupFiles: async () => {
65
+ try {
66
+ return await i.promises.stat(s).then((r) => r.isDirectory()).catch(() => !1) ? await i.promises.readdir(s) : (await i.promises.mkdir(s, { recursive: !0 }), []);
67
+ } catch (r) {
68
+ return n.error("Error listing backup files:", r), [];
69
+ }
70
+ },
71
+ loadFileChange: async (r) => {
72
+ try {
73
+ const e = o.join(s, r), t = await i.promises.readFile(e, "utf8");
74
+ return JSON.parse(t);
75
+ } catch (e) {
76
+ return n.error(`Error loading backup file ${r}:`, e), null;
77
+ }
78
+ },
79
+ cleanupBackupFiles: async () => {
80
+ try {
81
+ await i.promises.stat(s).then((r) => r.isDirectory()).catch(() => !1) && (await i.promises.rm(s, { recursive: !0, force: !0 }), n.debug(`Cleaned up backup directory: ${s}`));
82
+ } catch (r) {
83
+ n.error(`Error cleaning up backup files in ${s}:`, r);
84
+ }
85
+ },
86
+ listFiles: async (r) => E(r),
87
+ findFiles: async (r, e) => {
88
+ try {
89
+ return (await d(
90
+ r.base.fsPath,
91
+ { pattern: r.pattern, caseInsensitive: !0 },
92
+ {
93
+ limit: e?.maxResults,
94
+ signal: e?.signal
95
+ }
96
+ )).files.map((f) => h.file(o.join(r.base.fsPath, f)));
97
+ } catch (t) {
98
+ return n.error(
99
+ `Error finding files with pattern ${r.pattern}:`,
100
+ t instanceof Error ? t : new Error(String(t))
101
+ ), [];
102
+ }
103
+ },
104
+ watch: () => y,
105
+ exclusiveWriter: !1
106
+ };
107
+ }
108
+ function l(a) {
109
+ return a !== null && typeof a == "object" && "code" in a && a.code === "ENOENT";
110
+ }
111
+ async function E(a) {
112
+ try {
113
+ const { stdout: s } = await u("git", ["ls-files"], {
114
+ cwd: a
115
+ }), { stdout: r } = await u(
116
+ "git",
117
+ ["ls-files", "--others", "--exclude-standard"],
118
+ {
119
+ cwd: a
120
+ }
121
+ );
122
+ return [...s.split(`
123
+ `), ...r.split(`
124
+ `)].filter(Boolean);
125
+ } catch {
126
+ return [];
127
+ }
128
+ }
129
+ export {
130
+ E as listFilesGit,
131
+ B as nodeFileSystem
132
+ };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { i as a, F as c, f as i } from "./client-D-IY-U_F.js";
3
- import { p as m, aR as l } from "./console-Dvb4mlt2.js";
2
+ import { i as a, F as c, f as i } from "./client-DTzW73uz.js";
3
+ import { p as m, aR as l } from "./console-y67QVOnq.js";
4
4
  const h = ({ args: e }, { threadID: o }) => m(async (s) => {
5
5
  try {
6
6
  const r = await a.webSearch(
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { q as x, o as A, n as g, y as B, r as j, l as h, x as I, u as J, w as V, A as k, aY as z, aZ as W, a_ as Z, a$ as C, b0 as L, b1 as _, b2 as D, ax as M, f as q, b3 as G, b4 as H, b5 as F, b6 as K, O as Q, b7 as N, _ as X, av as ee, C as te } from "./console-Dvb4mlt2.js";
3
- import { r as se } from "./main-CjIHHXeY.js";
2
+ import { q as x, o as A, n as g, y as B, r as j, l as h, x as I, u as J, w as V, A as k, aY as z, aZ as W, a_ as Z, a$ as C, b0 as L, b1 as _, b2 as D, ax as M, f as q, b3 as G, b4 as H, b5 as F, b6 as K, O as Q, b7 as N, _ as X, av as ee, C as te } from "./console-y67QVOnq.js";
3
+ import { r as se } from "./main-CKyzkNHf.js";
4
4
  const v = A({
5
5
  context: V(["continue", "none"]).optional().default("continue"),
6
6
  tools: J([h("all"), x(g())]).optional(),
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { p as f } from "./index-obyovEcz.js";
3
- import { aC as m, g, m as c, aN as h, aO as d, aP as b, aQ as E, c as S, O as _ } from "./console-Dvb4mlt2.js";
4
- import { r as v } from "./executable-BnwRQX_M.js";
2
+ import { p as f } from "./index-CxZeQtZd.js";
3
+ import { aC as m, g, m as c, aN as h, aO as d, aP as b, aQ as E, c as S, O as _ } from "./console-y67QVOnq.js";
4
+ import { r as v } from "./executable-3LtkLCkg.js";
5
5
  const O = ({ args: a }, { dirs: s }) => {
6
6
  for (const e of s)
7
7
  m(e);
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import * as le from "node:os";
3
3
  import ee, { resolve as fe } from "node:path";
4
- import { aT as de, aU as _e, C as pe, aV as ne, aW as ge, aX as ve, aI as oe, aQ as me, aH as be, aC as Se, O as se } from "./console-Dvb4mlt2.js";
5
- import { loadProfileEnvironmentVariables as Ce } from "./load-profile-DfwAD194.js";
4
+ import { aT as de, aU as _e, C as pe, aV as ne, aW as ge, aX as ve, aI as oe, aQ as me, aH as be, aC as Se, O as se } from "./console-y67QVOnq.js";
5
+ import { loadProfileEnvironmentVariables as Ce } from "./load-profile-ByMlljkK.js";
6
6
  const ye = [
7
7
  // Basic read/info operations
8
8
  "ls",
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a9 as Pe, a8 as st, p as lt } from "./console-Dvb4mlt2.js";
2
+ import { a9 as Pe, a8 as st, p as lt } from "./console-y67QVOnq.js";
3
3
  var pe = {}, Pu = {}, be = {}, Me;
4
4
  function ne() {
5
5
  return Me || (Me = 1, function(u) {
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { aK as F, p as d } from "./console-Dvb4mlt2.js";
2
+ import { aK as F, p as d } from "./console-y67QVOnq.js";
3
3
  const s = ({ args: n }, { dir: o, dirs: r, threadID: a, filesystem: e }) => {
4
4
  const t = F({ readFileFn: e.readFile });
5
5
  return d(
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import { a9 as ee, z as re } from "./console-Dvb4mlt2.js";
2
+ import { a9 as ee, z as re } from "./console-y67QVOnq.js";
3
3
  import ne from "node:child_process";
4
4
  import D from "node:path";
5
5
  import L from "node:fs";
6
6
  import R from "node:process";
7
7
  import { PassThrough as te } from "node:stream";
8
- import { J as se } from "./main-CjIHHXeY.js";
8
+ import { J as se } from "./main-CKyzkNHf.js";
9
9
  var S = { exports: {} }, T, k;
10
10
  function oe() {
11
11
  if (k) return T;
package/dist/storybook.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { av as r, aA as a, an as c, aB as d, at as f, au as x, af as b, as as I } from "./console-Dvb4mlt2.js";
2
+ import { av as r, aA as a, an as c, aB as d, at as f, au as x, af as b, as as I } from "./console-y67QVOnq.js";
3
3
  import { stdout as s } from "node:process";
4
4
  import { parseArgs as w } from "node:util";
5
5
  function D() {
@@ -3,7 +3,7 @@ import E from "node:crypto";
3
3
  import d, { writeFile as D } from "node:fs/promises";
4
4
  import g from "node:os";
5
5
  import a from "node:path";
6
- import { C as p, p as C, aC as F, aL as b, aM as _ } from "./console-Dvb4mlt2.js";
6
+ import { C as p, p as C, aC as F, aL as b, aM as _ } from "./console-y67QVOnq.js";
7
7
  class v {
8
8
  MAX_TRACKED_EDITS = 50;
9
9
  editQueue = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sourcegraph/amp",
3
- "version": "0.0.1749340926-g6cda64",
3
+ "version": "0.0.1749367516-gcb962c",
4
4
  "description": "CLI for Amp, an agentic coding tool in research preview from Sourcegraph.",
5
5
  "homepage": "https://ampcode.com/",
6
6
  "author": {
@@ -1,112 +0,0 @@
1
- #!/usr/bin/env node
2
- import { execFile as m } from "node:child_process";
3
- import * as i from "node:fs";
4
- import * as o from "node:path";
5
- import { join as f } from "node:path";
6
- import { promisify as p } from "node:util";
7
- import { C as l, aJ as n } from "./console-Dvb4mlt2.js";
8
- import { homedir as w } from "node:os";
9
- const d = f(w(), ".amp", "file-changes"), u = p(m);
10
- function b(a) {
11
- const s = o.join(d, a);
12
- return {
13
- relativePath: (r, t) => o.relative(r, t),
14
- joinPath: (...r) => o.join(...r),
15
- readFile: async (r, t) => {
16
- try {
17
- return await i.promises.readFile(r, { encoding: "utf8", signal: t });
18
- } catch (e) {
19
- throw c(e) ? new n(r) : e;
20
- }
21
- },
22
- readBinaryFile: async (r, t) => {
23
- try {
24
- return await i.promises.readFile(r, { signal: t });
25
- } catch (e) {
26
- throw c(e) ? new n(r) : e;
27
- }
28
- },
29
- getMtime: async (r, t) => {
30
- try {
31
- return (await i.promises.stat(r)).mtimeMs;
32
- } catch (e) {
33
- throw c(e) ? new n(r) : e;
34
- }
35
- },
36
- stat: async (r) => {
37
- try {
38
- return {
39
- size: (await i.promises.stat(r)).size
40
- };
41
- } catch (t) {
42
- throw c(t) ? new n(r) : t;
43
- }
44
- },
45
- writeFile: async (r, t, e) => {
46
- await i.promises.writeFile(r, t, { encoding: "utf-8", signal: e });
47
- },
48
- deleteFile: async (r, t) => {
49
- try {
50
- await i.promises.unlink(r);
51
- } catch (e) {
52
- throw c(e) ? new n(r) : e;
53
- }
54
- },
55
- mkdirp: async (r) => {
56
- await i.promises.mkdir(r, { recursive: !0 });
57
- },
58
- storeFileChange: async (r, t) => {
59
- const e = o.join(s, r);
60
- await i.promises.writeFile(e, JSON.stringify(t, null, 2), "utf8");
61
- },
62
- listBackupFiles: async () => {
63
- try {
64
- return await i.promises.stat(s).then((r) => r.isDirectory()).catch(() => !1) ? await i.promises.readdir(s) : (await i.promises.mkdir(s, { recursive: !0 }), []);
65
- } catch (r) {
66
- return l.error("Error listing backup files:", r), [];
67
- }
68
- },
69
- loadFileChange: async (r) => {
70
- try {
71
- const t = o.join(s, r), e = await i.promises.readFile(t, "utf8");
72
- return JSON.parse(e);
73
- } catch (t) {
74
- return l.error(`Error loading backup file ${r}:`, t), null;
75
- }
76
- },
77
- cleanupBackupFiles: async () => {
78
- try {
79
- await i.promises.stat(s).then((r) => r.isDirectory()).catch(() => !1) && (await i.promises.rm(s, { recursive: !0, force: !0 }), l.debug(`Cleaned up backup directory: ${s}`));
80
- } catch (r) {
81
- l.error(`Error cleaning up backup files in ${s}:`, r);
82
- }
83
- },
84
- listFiles: async (r) => y(r),
85
- exclusiveWriter: !1
86
- };
87
- }
88
- function c(a) {
89
- return a !== null && typeof a == "object" && "code" in a && a.code === "ENOENT";
90
- }
91
- async function y(a) {
92
- try {
93
- const { stdout: s } = await u("git", ["ls-files"], {
94
- cwd: a
95
- }), { stdout: r } = await u(
96
- "git",
97
- ["ls-files", "--others", "--exclude-standard"],
98
- {
99
- cwd: a
100
- }
101
- );
102
- return [...s.split(`
103
- `), ...r.split(`
104
- `)].filter(Boolean);
105
- } catch {
106
- return [];
107
- }
108
- }
109
- export {
110
- y as listFilesGit,
111
- b as nodeFileSystem
112
- };