@sourcegraph/amp 0.0.1748506378-g0b2c07 → 0.0.1748534542-g657cb9

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-Bs5UNAQf.js";
3
- import "./main-DKwRjnK-.js";
3
+ import "./main-Dojlq-Ds.js";
4
4
  import "node:crypto";
5
5
  import "node:fs/promises";
6
6
  import "node:path";
@@ -7755,7 +7755,7 @@ async function l2(i, e, t) {
7755
7755
  const { loadProfileEnvironmentVariables: r } = await import("./load-profile-Gn3gm8Ha.js"), o = t.loadProfile === "never" || !t.workingDirectory ? process.env : await pt(
7756
7756
  r(t.workingDirectory, t.loadProfile)
7757
7757
  );
7758
- n = await import("./stdio-Dpc0LHLt.js").then(
7758
+ n = await import("./stdio-Ctzk1-2g.js").then(
7759
7759
  ({ StdioClientTransport: s }) => new s({
7760
7760
  ...i,
7761
7761
  stderr: "pipe",
@@ -8103,7 +8103,7 @@ the \`${um}\` with the url.
8103
8103
  requiresNetwork: !0
8104
8104
  }
8105
8105
  },
8106
- fn: import("./node-D8oU-xnc.js").then(({ nodeWebSearchTool: i }) => i)
8106
+ fn: import("./node-C9OGtvwV.js").then(({ nodeWebSearchTool: i }) => i)
8107
8107
  };
8108
8108
  function y2(i) {
8109
8109
  const { interval: e, fn: t, cacheKey: n } = i, r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
@@ -25779,6 +25779,10 @@ function u4(i, e) {
25779
25779
  }
25780
25780
  break;
25781
25781
  }
25782
+ case "thread:truncate": {
25783
+ t.messages.splice(e.fromIndex);
25784
+ break;
25785
+ }
25782
25786
  case "user:message": {
25783
25787
  Il(t);
25784
25788
  const n = {
@@ -26418,7 +26422,7 @@ class Jo {
26418
26422
  });
26419
26423
  return;
26420
26424
  }
26421
- await this.resume(), this.handleCalled = !0, await this.acquireThread(), e.type === "user:message" && (e.index !== void 0 && await this.revertPriorFileChanges(e.index), e.message = await h4(
26425
+ await this.resume(), this.handleCalled = !0, await this.acquireThread(), e.type === "thread:truncate" && await this.revertPriorFileChanges(e.fromIndex), e.type === "user:message" && (e.index !== void 0 && await this.revertPriorFileChanges(e.index), e.message = await h4(
26422
26426
  { configService: this.deps.configService, filesystem: this.filesystem },
26423
26427
  e.message
26424
26428
  ), e.message.fileMentions?.imageBlocks?.length && (ae.debug(
@@ -26787,7 +26791,7 @@ class Jo {
26787
26791
  ae.debug("cancel: aborting inference operation and tools"), this.cancelInference(), this.cancelUnstartedTools(), this.cancelInProgressTools(), await this.handle({ type: "cancelled" }, void 0);
26788
26792
  }
26789
26793
  cancelInference() {
26790
- this.ops.inference && (this.ops.inference.abort(mM.USER_CANCELLED), this.ops.inference = null), this.inferenceState.next("cancelled");
26794
+ this.ops.inference && (this.ops.inference.abort(new Error(mM.USER_CANCELLED)), this.ops.inference = null), this.inferenceState.next("cancelled");
26791
26795
  }
26792
26796
  async retry() {
26793
26797
  ae.debug("retry: retrying inference operation"), this.ephemeralError.getValue() !== void 0 && this.ephemeralError.next(void 0), this.ops.inference && (this.ops.inference.abort(), this.ops.inference = null), this.inferenceState.next("idle"), await this.runInferenceAndUpdateThread();
@@ -26939,7 +26943,7 @@ IMPORTANT: The result of this tool (if any) should be displayed directly to the
26939
26943
  },
26940
26944
  source: "builtin"
26941
26945
  },
26942
- fn: import("./node-C0wxa4K3.js").then(({ runRoutine: i }) => i)
26946
+ fn: import("./node-BSxJt4fE.js").then(({ runRoutine: i }) => i)
26943
26947
  };
26944
26948
  let Fw = !1;
26945
26949
  async function JC(i, e = !1) {
@@ -39332,7 +39336,7 @@ async function Au(i, e) {
39332
39336
  Ag({
39333
39337
  logLevel: e.logLevel || process.env.AMP_LOG_LEVEL,
39334
39338
  logFile: e.logFile || process.env.AMP_LOG_FILE
39335
- }), GM("0.0.1748506378-g0b2c07");
39339
+ }), GM("0.0.1748534542-g657cb9");
39336
39340
  const t = e.settingsFile ?? process.env.AMP_SETTINGS_FILE;
39337
39341
  ae.info("Using settings file", { settingsFile: t });
39338
39342
  const n = Cu(), r = XC({ settingsFile: t }), o = process.env.AMP_API_KEY;
@@ -39429,7 +39433,7 @@ Login failed: ${r instanceof Error ? r.message : String(r)}
39429
39433
  }
39430
39434
  }
39431
39435
  function ZG(i) {
39432
- const e = new E4().name("amp").description("AI-powered coding assistant").version("0.0.1748506378-g0b2c07").option("--thread-id [THREAD_ID]", "ID of the thread to continue running", void 0);
39436
+ const e = new E4().name("amp").description("AI-powered coding assistant").version("0.0.1748534542-g657cb9").option("--thread-id [THREAD_ID]", "ID of the thread to continue running", void 0);
39433
39437
  e.addHelpText(
39434
39438
  "after",
39435
39439
  (() => {
@@ -40623,7 +40627,7 @@ function Tr() {
40623
40627
  }
40624
40628
  async function rW(i, e) {
40625
40629
  try {
40626
- const t = await BG("0.0.1748506378-g0b2c07");
40630
+ const t = await BG("0.0.1748534542-g657cb9");
40627
40631
  t.hasUpdate && t.latestVersion ? e ? (i.next({ type: "update-start-updating" }), setTimeout(async () => {
40628
40632
  try {
40629
40633
  await WG(t.latestVersion), i.next({
@@ -40638,7 +40642,7 @@ async function rW(i, e) {
40638
40642
  version: t.latestVersion
40639
40643
  });
40640
40644
  }
40641
- }, 100)) : ae.info(`New version available: 0.0.1748506378-g0b2c07 → ${t.latestVersion}`) : ae.info("No update available");
40645
+ }, 100)) : ae.info(`New version available: 0.0.1748534542-g657cb9 → ${t.latestVersion}`) : ae.info("No update available");
40642
40646
  } catch (t) {
40643
40647
  ae.debug("Update check failed", t);
40644
40648
  }
@@ -40693,4 +40697,4 @@ export {
40693
40697
  ve as s,
40694
40698
  lr as u
40695
40699
  };
40696
- //# sourceMappingURL=main-DKwRjnK-.js.map
40700
+ //# sourceMappingURL=main-Dojlq-Ds.js.map