@sourcegraph/amp 0.0.1748338101-g3716f1 → 0.0.1748339241-g4bad6a

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/amp.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import "./color-DH4c3nvN.js";
3
- import "./main-XzserkUB.js";
3
+ import "./main-VhmuSMX3.js";
4
4
  import "node:crypto";
5
5
  import "node:fs/promises";
6
6
  import "node:path";
@@ -4821,7 +4821,7 @@ async function oL(r, t, e) {
4821
4821
  const { loadProfileEnvironmentVariables: i } = await import("./load-profile-noOyWkOF.js"), o = e.loadProfile === "never" || !e.workingDirectory ? process.env : await rt(
4822
4822
  i(e.workingDirectory, e.loadProfile)
4823
4823
  );
4824
- n = await import("./stdio-L9eSubEK.js").then(
4824
+ n = await import("./stdio-b2NNJPn1.js").then(
4825
4825
  ({ StdioClientTransport: s }) => new s({
4826
4826
  ...r,
4827
4827
  stderr: "pipe",
@@ -16885,7 +16885,7 @@ function print() { __p += __j.call(arguments, '') }
16885
16885
  }).call(Cq);
16886
16886
  }(es, es.exports)), es.exports;
16887
16887
  }
16888
- var l3 = Sq();
16888
+ var l4 = Sq();
16889
16889
  const Eq = {
16890
16890
  fromNativeThread(r) {
16891
16891
  const t = [];
@@ -23105,7 +23105,7 @@ IMPORTANT: The result of this tool (if any) should be displayed directly to the
23105
23105
  },
23106
23106
  source: "builtin"
23107
23107
  },
23108
- fn: import("./node-CGa3o78d.js").then(({ runRoutine: r }) => r)
23108
+ fn: import("./node-CR6PuGwJ.js").then(({ runRoutine: r }) => r)
23109
23109
  };
23110
23110
  let s_ = !1;
23111
23111
  async function dC(r, t = !1) {
@@ -25140,18 +25140,18 @@ function uV() {
25140
25140
  }
25141
25141
  var cV = uV();
25142
25142
  const fV = /* @__PURE__ */ Yh(cV), {
25143
- program: u3,
25144
- createCommand: c3,
25145
- createArgument: f3,
25146
- createOption: d3,
25147
- CommanderError: h3,
25148
- InvalidArgumentError: p3,
25149
- InvalidOptionArgumentError: m3,
25143
+ program: u4,
25144
+ createCommand: c4,
25145
+ createArgument: f4,
25146
+ createOption: d4,
25147
+ CommanderError: h4,
25148
+ InvalidArgumentError: p4,
25149
+ InvalidOptionArgumentError: m4,
25150
25150
  // deprecated old name
25151
25151
  Command: dV,
25152
- Argument: g3,
25153
- Option: y3,
25154
- Help: v3
25152
+ Argument: g4,
25153
+ Option: y4,
25154
+ Help: v4
25155
25155
  } = fV;
25156
25156
  var mC;
25157
25157
  (() => {
@@ -35338,7 +35338,7 @@ async function El(r, t) {
35338
35338
  Dp({
35339
35339
  logLevel: t.logLevel || process.env.AMP_LOG_LEVEL,
35340
35340
  logFile: t.logFile || process.env.AMP_LOG_FILE
35341
- }), Uk("0.0.1748338101-g3716f1");
35341
+ }), Uk("0.0.1748339241-g4bad6a");
35342
35342
  const e = t.settingsFile ?? process.env.AMP_SETTINGS_FILE;
35343
35343
  oe.info("Using settings file", { settingsFile: e });
35344
35344
  const n = Vh(), i = wV({ settingsFile: e }), o = process.env.AMP_API_KEY;
@@ -35435,7 +35435,7 @@ Login failed: ${i instanceof Error ? i.message : String(i)}
35435
35435
  }
35436
35436
  }
35437
35437
  function DG(r) {
35438
- const t = new dV().name("amp").description("AI-powered coding assistant").version("0.0.1748338101-g3716f1").option("--thread-id [THREAD_ID]", "ID of the thread to continue running", void 0);
35438
+ const t = new dV().name("amp").description("AI-powered coding assistant").version("0.0.1748339241-g4bad6a").option("--thread-id [THREAD_ID]", "ID of the thread to continue running", void 0);
35439
35439
  t.addHelpText(
35440
35440
  "after",
35441
35441
  (() => {
@@ -35632,23 +35632,28 @@ Provide a thread ID as an argument or run a thread first.
35632
35632
  const d = await c.json();
35633
35633
  d.length === 0 && (ot.write(`No threads found.
35634
35634
  `), process.exit(0));
35635
- const g = ["Thread ID", "Share", "Last Updated", "Messages", "Title"], y = d.map((w) => {
35635
+ const g = ["Title", "Last Updated", "Visibility", "Messages", "Thread ID"], y = d.map((w) => {
35636
35636
  const b = w.title || "Untitled";
35637
35637
  let _ = "Team";
35638
35638
  w.meta.private ? _ = "Private" : w.meta.public && (_ = "Public");
35639
35639
  const C = VG(new Date(w.updatedAt));
35640
35640
  return [
35641
- w.id,
35642
- _,
35641
+ b,
35643
35642
  C,
35643
+ _,
35644
35644
  w.messageCount.toString(),
35645
- b
35645
+ w.id
35646
35646
  ];
35647
35647
  });
35648
35648
  HG(g, y, {
35649
35649
  columnFormatters: [
35650
+ (w, b) => (w.length > b ? w.substring(0, b - 3) + "..." : w).padEnd(b),
35651
+ void 0,
35652
+ void 0,
35653
+ (w, b) => w.padStart(b),
35650
35654
  (w, b) => u.printer.print(w.padEnd(b), { foreground: "green" })
35651
- ]
35655
+ ],
35656
+ truncateColumnIndex: 0
35652
35657
  }), l.threadSyncService?.dispose(), l.threadService.dispose(), await l.mcpService.dispose(), process.exit(0);
35653
35658
  } catch (c) {
35654
35659
  Ge.write(
@@ -36349,7 +36354,7 @@ function _n() {
36349
36354
  }
36350
36355
  async function BG(r, t) {
36351
36356
  try {
36352
- const e = await RG("0.0.1748338101-g3716f1");
36357
+ const e = await RG("0.0.1748339241-g4bad6a");
36353
36358
  e.hasUpdate && e.latestVersion && (t ? (r.next({ type: "update-start-updating" }), setTimeout(async () => {
36354
36359
  try {
36355
36360
  await PG(), r.next({
@@ -36364,7 +36369,7 @@ async function BG(r, t) {
36364
36369
  version: e.latestVersion
36365
36370
  });
36366
36371
  }
36367
- }, 100)) : oe.info(`New version available: 0.0.1748338101-g3716f1 → ${e.latestVersion}`));
36372
+ }, 100)) : oe.info(`New version available: 0.0.1748339241-g4bad6a → ${e.latestVersion}`));
36368
36373
  } catch (e) {
36369
36374
  oe.debug("Update check failed", e);
36370
36375
  }
@@ -36372,29 +36377,32 @@ async function BG(r, t) {
36372
36377
  const oS = 0.8, sS = 0.9;
36373
36378
  function VG(r) {
36374
36379
  const e = (/* @__PURE__ */ new Date()).getTime() - r.getTime(), n = Math.floor(e / 1e3), i = Math.floor(n / 60), o = Math.floor(i / 60), s = Math.floor(o / 24), u = Math.floor(s / 7), l = Math.floor(s / 30), c = Math.floor(s / 365);
36375
- return n < 60 ? n <= 1 ? "just now" : `${n} seconds ago` : i < 60 ? i === 1 ? "1 minute ago" : `${i} minutes ago` : o < 24 ? o === 1 ? "1 hour ago" : `${o} hours ago` : s < 7 ? s === 1 ? "1 day ago" : `${s} days ago` : u < 4 ? u === 1 ? "1 week ago" : `${u} weeks ago` : l < 12 ? l === 1 ? "1 month ago" : `${l} months ago` : c === 1 ? "1 year ago" : `${c} years ago`;
36380
+ return n < 60 ? n <= 1 ? "now" : `${n}s ago` : i < 60 ? `${i}m ago` : o < 24 ? `${o}h ago` : s < 7 ? `${s}d ago` : u < 4 ? `${u}w ago` : l < 12 ? `${l}mo ago` : `${c}y ago`;
36376
36381
  }
36377
36382
  function HG(r, t, e = {}) {
36378
- const { columnFormatters: n = [], minimumLastColumnWidth: i = 20 } = e;
36379
- for (let _ = 0; _ < t.length; _++)
36380
- if (t[_].length !== r.length)
36383
+ const { columnFormatters: n = [], minimumTruncatedColumnWidth: i = 20, truncateColumnIndex: o } = e;
36384
+ for (let C = 0; C < t.length; C++)
36385
+ if (t[C].length !== r.length)
36381
36386
  throw new Error(
36382
- `Row ${_} has ${t[_].length} columns, but headers have ${r.length} columns`
36387
+ `Row ${C} has ${t[C].length} columns, but headers have ${r.length} columns`
36383
36388
  );
36384
- const o = ot.columns || 120, s = " ", u = r.length - 1, l = r.slice(0, -1).map(
36385
- (_, C) => Math.max(_.length, ...t.map((m) => m[C].length))
36386
- ), c = l.reduce((_, C) => _ + C, 0) + u * s.length, d = Math.max(i, o - c), g = Math.max(r[r.length - 1].length, d), y = [...l, g], w = r.map((_, C) => _.padEnd(y[C])).join(s);
36387
- ot.write(w + `
36388
- `);
36389
- const b = y.map((_) => "─".repeat(_)).join(s);
36389
+ const s = ot.columns || 120, u = " ", l = r.length - 1, c = o ?? r.length - 1, d = [];
36390
+ for (let C = 0; C < r.length; C++)
36391
+ C === c ? d.push(0) : d.push(Math.max(r[C].length, ...t.map((m) => m[C].length)));
36392
+ const g = d.reduce((C, m) => C + m, 0) + l * u.length, y = Math.max(i, s - g);
36393
+ d[c] = y;
36394
+ const w = d, b = r.map((C, m) => C.padEnd(w[m])).join(u);
36390
36395
  ot.write(b + `
36391
36396
  `);
36392
- for (const _ of t) {
36393
- const C = _.map((m, T) => {
36394
- const S = y[T], A = m.length > S ? m.substring(0, S - 3) + "..." : m, x = n[T];
36395
- return x ? x(A, S) : A.padEnd(S);
36397
+ const _ = w.map((C) => "─".repeat(C)).join(u);
36398
+ ot.write(_ + `
36399
+ `);
36400
+ for (const C of t) {
36401
+ const m = C.map((T, S) => {
36402
+ const A = w[S], x = n[S];
36403
+ return x ? x(T, A) : (T.length > A ? T.substring(0, A - 3) + "..." : T).padEnd(A);
36396
36404
  });
36397
- ot.write(C.join(s) + `
36405
+ ot.write(m.join(u) + `
36398
36406
  `);
36399
36407
  }
36400
36408
  }
@@ -36415,4 +36423,4 @@ export {
36415
36423
  ue as s,
36416
36424
  Ft as u
36417
36425
  };
36418
- //# sourceMappingURL=main-XzserkUB.js.map
36426
+ //# sourceMappingURL=main-VhmuSMX3.js.map