@sourcegraph/amp 0.0.1749442062-g8a8d46 → 0.0.1749470495-ga92dad

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.
@@ -26,7 +26,7 @@ let Oa = $A;
26
26
  function oge(n) {
27
27
  Oa = n;
28
28
  }
29
- const le = {
29
+ const ce = {
30
30
  error: (n, ...e) => Oa.error(n, ...e),
31
31
  warn: (n, ...e) => Oa.warn(n, ...e),
32
32
  info: (n, ...e) => Oa.info(n, ...e),
@@ -1045,7 +1045,7 @@ COMPLEMENTARY USE WITH CODEBASE_SEARCH:
1045
1045
  },
1046
1046
  source: "builtin"
1047
1047
  },
1048
- fn: import("./node-BRxPFRj7.js").then(({ nodeGrepTool: n }) => n)
1048
+ fn: import("./node-M7aoRuZI.js").then(({ nodeGrepTool: n }) => n)
1049
1049
  };
1050
1050
  var Age = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
1051
1051
  function ha(n) {
@@ -1952,7 +1952,7 @@ It's VERY IMPORTANT to use specific tools when searching for files, instead of i
1952
1952
  },
1953
1953
  source: "builtin"
1954
1954
  },
1955
- fn: import("./node-DkzowUWS.js").then(({ nodeBashTool: n }) => n),
1955
+ fn: import("./node-B5_7E1jQ.js").then(({ nodeBashTool: n }) => n),
1956
1956
  preprocessArgs: (n) => {
1957
1957
  if (!n.cwd)
1958
1958
  try {
@@ -2011,7 +2011,7 @@ Prefer this tool over \`edit_file\` when you want to ovewrite the entire content
2011
2011
  content: n.content + `
2012
2012
  `
2013
2013
  },
2014
- fn: import("./create_file.node-CG-jdMnt.js").then(
2014
+ fn: import("./create_file.node-wMeiNPRY.js").then(
2015
2015
  ({ nodeCreateFileTool: n }) => n
2016
2016
  )
2017
2017
  };
@@ -4843,7 +4843,7 @@ Returns the contents of the file with each line prefixed by its line number. For
4843
4843
  switch ("node") {
4844
4844
  case "node":
4845
4845
  case "vscode":
4846
- return import("./read_file.node-DLouxDlp.js").then(({ nodeReadFileTool: n }) => n);
4846
+ return import("./read_file.node-cUZpvR9L.js").then(({ nodeReadFileTool: n }) => n);
4847
4847
  }
4848
4848
  })()
4849
4849
  }, bI = Jw({
@@ -4872,7 +4872,7 @@ If you need to replace the entire contents of a file, use \`${Co}\` instead, sin
4872
4872
  inputSchema: fw(bI),
4873
4873
  source: "builtin"
4874
4874
  },
4875
- fn: import("./edit_file.node-oIkKjPxO.js").then(({ nodeEditFileTool: n }) => n)
4875
+ fn: import("./edit_file.node-zheSg82z.js").then(({ nodeEditFileTool: n }) => n)
4876
4876
  };
4877
4877
  function Sg(n) {
4878
4878
  return n.replace(/\\\\n/g, "\\n").replace(/\\\\t/g, "\\t").replace(/\\\\/g, "\\").replace(/\\"/g, '"').replace(/\\'/g, "'").replace(/\\n/g, `
@@ -5053,7 +5053,7 @@ Note: Results are sorted by modification time with the most recently modified fi
5053
5053
  },
5054
5054
  source: "builtin"
5055
5055
  },
5056
- fn: import("./glob.node-Bn-P9pn3.js").then(({ nodeGlobTool: n }) => n)
5056
+ fn: import("./glob.node-DMBP8NxK.js").then(({ nodeGlobTool: n }) => n)
5057
5057
  }, Ro = "list_directory", Qf = {
5058
5058
  spec: {
5059
5059
  name: Ro,
@@ -5074,7 +5074,7 @@ Note: Results are sorted by modification time with the most recently modified fi
5074
5074
  switch ("node") {
5075
5075
  case "node":
5076
5076
  case "vscode":
5077
- return import("./list_directory.node-CzAI_wrF.js").then(
5077
+ return import("./list_directory.node-BPymje82.js").then(
5078
5078
  ({ nodeListDirectoryTool: n }) => n
5079
5079
  );
5080
5080
  }
@@ -5161,7 +5161,7 @@ This tool converts web content to markdown format for better readability.`,
5161
5161
  requiresNetwork: !0
5162
5162
  }
5163
5163
  },
5164
- fn: import("./node-C7-4IEoj.js").then(({ nodeReadWebPageTool: n }) => n)
5164
+ fn: import("./node-G97pRVyC.js").then(({ nodeReadWebPageTool: n }) => n)
5165
5165
  }, wI = "web_search", II = `Search the web for information.
5166
5166
 
5167
5167
  Returns search result titles, associated URLs, and a small summary of the
@@ -5209,7 +5209,7 @@ the \`${ef}\` with the url.
5209
5209
  requiresNetwork: !0
5210
5210
  }
5211
5211
  },
5212
- fn: import("./node-BwLwdVsX.js").then(({ nodeWebSearchTool: n }) => n)
5212
+ fn: import("./node-B-LsLVRT.js").then(({ nodeWebSearchTool: n }) => n)
5213
5213
  };
5214
5214
  function EC({ onlyFirst: n = !1 } = {}) {
5215
5215
  const t = [
@@ -8539,7 +8539,7 @@ function qk({
8539
8539
  u === null ? (l = !0, c = "") : (l = !1, c = u);
8540
8540
  }
8541
8541
  } catch (u) {
8542
- le.error(`Error reading file ${a} before modification:`, u);
8542
+ ce.error(`Error reading file ${a} before modification:`, u);
8543
8543
  }
8544
8544
  if (await i(a), !o.has(a))
8545
8545
  try {
@@ -8558,13 +8558,13 @@ function qk({
8558
8558
  };
8559
8559
  o.set(a, y);
8560
8560
  const b = a0(n, E);
8561
- await t.storeFileChange(b, y), le.debug("Generated diff for file", {
8561
+ await t.storeFileChange(b, y), ce.debug("Generated diff for file", {
8562
8562
  isNewFile: l,
8563
8563
  filePath: a,
8564
8564
  toolUseID: n
8565
8565
  }), r && r0(a, r, p);
8566
8566
  } catch (u) {
8567
- le.error(`Error generating diff for ${a} after tool use:`, u);
8567
+ ce.error(`Error generating diff for ${a} after tool use:`, u);
8568
8568
  }
8569
8569
  };
8570
8570
  }
@@ -8597,7 +8597,7 @@ async function Wg(n, e, t) {
8597
8597
  const c = await af(n, s) !== null;
8598
8598
  o.isNewFile && c ? (await n.deleteFile(s), a.add(s)) : c && (await n.writeFile(s, o.before), a.add(s));
8599
8599
  } catch (l) {
8600
- le.error(`Error reverting file ${s}:`, l);
8600
+ ce.error(`Error reverting file ${s}:`, l);
8601
8601
  }
8602
8602
  const i = Date.now();
8603
8603
  for (const s of a)
@@ -8614,7 +8614,7 @@ async function Wg(n, e, t) {
8614
8614
  const u = a0(s, c.id);
8615
8615
  await n.storeFileChange(u, c);
8616
8616
  } catch (u) {
8617
- le.error(`Error updating backup for file ${l}:`, u);
8617
+ ce.error(`Error updating backup for file ${l}:`, u);
8618
8618
  }
8619
8619
  }
8620
8620
  }
@@ -8643,7 +8643,7 @@ function Wk(n) {
8643
8643
  try {
8644
8644
  process.platform !== "win32" && n.pid ? process.kill(-n.pid, "SIGKILL") : n.kill("SIGKILL");
8645
8645
  } catch (e) {
8646
- le.error(`Failed to kill process ${n.pid}`, e);
8646
+ ce.error(`Failed to kill process ${n.pid}`, e);
8647
8647
  return;
8648
8648
  }
8649
8649
  }
@@ -9158,7 +9158,7 @@ async function $ge(n, e, t) {
9158
9158
  tools: t
9159
9159
  })).input_tokens;
9160
9160
  } catch (r) {
9161
- return le.warn("Failed to count tokens via Anthropic API:", r), null;
9161
+ return ce.warn("Failed to count tokens via Anthropic API:", r), null;
9162
9162
  }
9163
9163
  }
9164
9164
  function Zg(n) {
@@ -9244,7 +9244,7 @@ function pO(n) {
9244
9244
  }
9245
9245
  function sf(n, e) {
9246
9246
  if (!bs(e)) {
9247
- le.error("runToBlockParam", "run is not terminal", { run: e });
9247
+ ce.error("runToBlockParam", "run is not terminal", { run: e });
9248
9248
  return;
9249
9249
  }
9250
9250
  let t = [];
@@ -20697,7 +20697,7 @@ async function* i4(n, e, t, r, a) {
20697
20697
  a?.throwIfAborted();
20698
20698
  const o = n.pop();
20699
20699
  if (o?.role !== "user")
20700
- throw le.warn("expected last message to be a user message", o), new Error("expected last message to be a user message");
20700
+ throw ce.warn("expected last message to be a user message", o), new Error("expected last message to be a user message");
20701
20701
  const l = s4(e), c = {
20702
20702
  model: Df,
20703
20703
  history: n,
@@ -25787,7 +25787,7 @@ function R8(n, e) {
25787
25787
  continue;
25788
25788
  const a = JSON.stringify(e.toolUse.input), i = Array.isArray(t.on["input.contains"]) ? t.on["input.contains"] : [t.on["input.contains"]];
25789
25789
  for (const s of i)
25790
- if (a.includes(s) && (le.debug(`Hook triggered: ${t.id}`, {
25790
+ if (a.includes(s) && (ce.debug(`Hook triggered: ${t.id}`, {
25791
25791
  hookID: t.id,
25792
25792
  threadID: e.threadID,
25793
25793
  toolName: e.toolUse.name,
@@ -25822,7 +25822,7 @@ async function N8(n, e) {
25822
25822
  }
25823
25823
  }
25824
25824
  async function w8(n, e) {
25825
- return (await import("./list_directory.node-CzAI_wrF.js")).resolveArgumentDirectoryNode(n, e);
25825
+ return (await import("./list_directory.node-BPymje82.js")).resolveArgumentDirectoryNode(n, e);
25826
25826
  }
25827
25827
  class I8 extends sl {
25828
25828
  #e = new AbortController();
@@ -26447,7 +26447,7 @@ function U8(n) {
26447
26447
  try {
26448
26448
  n._regex = new RegExp(n.pattern, n.caseInsensitive ? "gi" : "g");
26449
26449
  } catch (e) {
26450
- le.warn("Error compiling regex", { pattern: n.id, error: e }), n._regex = new RegExp("$^");
26450
+ ce.warn("Error compiling regex", { pattern: n.id, error: e }), n._regex = new RegExp("$^");
26451
26451
  }
26452
26452
  return n._regex;
26453
26453
  }
@@ -27312,14 +27312,14 @@ function Y8(n, e) {
27312
27312
  }
27313
27313
  case "user:tool-input": {
27314
27314
  if (!Ba(t, e.toolUse)) {
27315
- le.debug(
27315
+ ce.debug(
27316
27316
  `Ignoring user:tool-input delta for missing tool use ${e.toolUse} (likely deleted due to thread edit/truncation)`
27317
27317
  );
27318
27318
  break;
27319
27319
  }
27320
27320
  const a = SC(t, e.toolUse);
27321
27321
  if (!a) {
27322
- le.debug(
27322
+ ce.debug(
27323
27323
  `Ignoring user:tool-input delta for missing tool result block ${e.toolUse} (likely deleted due to thread edit/truncation)`
27324
27324
  );
27325
27325
  break;
@@ -27329,7 +27329,7 @@ function Y8(n, e) {
27329
27329
  }
27330
27330
  case "tool:data": {
27331
27331
  if (!Cg(t, e.toolUse)) {
27332
- le.debug(
27332
+ ce.debug(
27333
27333
  `Ignoring tool:data delta for missing tool use ${e.toolUse} (likely deleted due to thread edit/truncation)`
27334
27334
  );
27335
27335
  break;
@@ -27341,7 +27341,7 @@ function Y8(n, e) {
27341
27341
  case "tool:processed": {
27342
27342
  const r = Cg(t, e.toolUse);
27343
27343
  if (!r) {
27344
- le.debug(
27344
+ ce.debug(
27345
27345
  `Ignoring tool:processed delta for missing tool use ${e.toolUse} (likely deleted due to thread edit/truncation)`
27346
27346
  );
27347
27347
  break;
@@ -27476,13 +27476,13 @@ function Y8(n, e) {
27476
27476
  else
27477
27477
  for (const s of i.content)
27478
27478
  if (s.type === "tool_use" && s.inputPartialJSON) {
27479
- le.debug(
27479
+ ce.debug(
27480
27480
  "Found a block with inputPartialJSON still set on message_delta"
27481
27481
  );
27482
27482
  try {
27483
27483
  s.inputPartialJSON.json !== "" ? s.input = JSON.parse(s.inputPartialJSON.json) : s.input = {};
27484
27484
  } catch (o) {
27485
- le.error(
27485
+ ce.error(
27486
27486
  `Failed to parse malformed JSON for tool_use ${s.id}`,
27487
27487
  o,
27488
27488
  {
@@ -27548,7 +27548,7 @@ function to(n) {
27548
27548
  ) && (e.state = { type: "cancelled" }, t = !0), t) {
27549
27549
  for (const r of e.content)
27550
27550
  if (r.type === "tool_use" && r.inputPartialJSON) {
27551
- le.debug(`Cleaning up partial tool_use ${r.id}`, {
27551
+ ce.debug(`Cleaning up partial tool_use ${r.id}`, {
27552
27552
  name: "markPriorStreamingAssistantMessageAsCancelled",
27553
27553
  threadID: n.id,
27554
27554
  blockID: r.id
@@ -27556,7 +27556,7 @@ function to(n) {
27556
27556
  try {
27557
27557
  r.inputPartialJSON.json !== "" ? r.input = gl(r.inputPartialJSON.json) : r.input = {};
27558
27558
  } catch (a) {
27559
- le.warn(
27559
+ ce.warn(
27560
27560
  `Failed to parse partial JSON for cancelled tool_use ${r.id}:`,
27561
27561
  a,
27562
27562
  {
@@ -27652,7 +27652,7 @@ async function W8({
27652
27652
  fileMentions: void 0,
27653
27653
  userState: void 0
27654
27654
  };
27655
- const i = (await import("./files-BIHX1ZTx.js").then(
27655
+ const i = (await import("./files-DxXZFbCN.js").then(
27656
27656
  ({ getFileMentions: o }) => o(
27657
27657
  CC(t.content),
27658
27658
  a,
@@ -27751,9 +27751,9 @@ class Zi {
27751
27751
  else {
27752
27752
  const a = e.createFileSystem(t);
27753
27753
  try {
27754
- await a.cleanupBackupFiles(), le.debug(`Cleaned up backup files for thread ${t}`, { threadID: t });
27754
+ await a.cleanupBackupFiles(), ce.debug(`Cleaned up backup files for thread ${t}`, { threadID: t });
27755
27755
  } catch (i) {
27756
- le.error("Error cleaning up thread backups", i, { threadID: t });
27756
+ ce.error("Error cleaning up thread backups", i, { threadID: t });
27757
27757
  }
27758
27758
  }
27759
27759
  }
@@ -27775,7 +27775,7 @@ class Zi {
27775
27775
  this.findAndCancelToolRun(t.toolUseID);
27776
27776
  continue;
27777
27777
  }
27778
- le.debug(`re-invoking tool ${a.name} with ID ${t.toolUseID}`, {
27778
+ ce.debug(`re-invoking tool ${a.name} with ID ${t.toolUseID}`, {
27779
27779
  name: "resumeInProgressTools",
27780
27780
  threadID: this.threadID
27781
27781
  }), this.invokeTool(a, t.userInput);
@@ -27797,7 +27797,7 @@ class Zi {
27797
27797
  * Scan thread history and track all file mentions and tool result files
27798
27798
  */
27799
27799
  trackFilesFromHistory() {
27800
- le.debug("Tracking files from thread history", {
27800
+ ce.debug("Tracking files from thread history", {
27801
27801
  name: "trackFilesFromHistory",
27802
27802
  threadID: this.threadID
27803
27803
  });
@@ -27833,7 +27833,7 @@ class Zi {
27833
27833
  try {
27834
27834
  await this.deps.threadHistoryService.delete(i.threadID);
27835
27835
  } catch (s) {
27836
- le.error(
27836
+ ce.error(
27837
27837
  `Failed to delete Task tool sub-thread: ${i.threadID}`,
27838
27838
  s,
27839
27839
  {
@@ -27843,7 +27843,7 @@ class Zi {
27843
27843
  );
27844
27844
  }
27845
27845
  else
27846
- le.warn(
27846
+ ce.warn(
27847
27847
  `Cannot delete Task tool sub-thread: ${i.threadID} - threadHistoryService not available`,
27848
27848
  {
27849
27849
  threadID: this.threadID,
@@ -28002,21 +28002,21 @@ class Zi {
28002
28002
  this.handlePromise = this.handlePromise.then(async () => {
28003
28003
  await this.innerHandle(e, t);
28004
28004
  }).catch((r) => {
28005
- le.error("Unhandled error in handle promise queue", r, {
28005
+ ce.error("Unhandled error in handle promise queue", r, {
28006
28006
  threadID: this.threadID
28007
28007
  });
28008
28008
  }), await this.handlePromise;
28009
28009
  }
28010
28010
  async innerHandle(e, t) {
28011
28011
  if (this.isDisposed) {
28012
- le.debug(`Skipping ${e.type} - worker disposed.`, {
28012
+ ce.debug(`Skipping ${e.type} - worker disposed.`, {
28013
28013
  name: "handle queue",
28014
28014
  threadID: this.threadID
28015
28015
  });
28016
28016
  return;
28017
28017
  }
28018
28018
  if (t?.aborted) {
28019
- le.debug(`Skipping ${e.type} - signal aborted.`, {
28019
+ ce.debug(`Skipping ${e.type} - signal aborted.`, {
28020
28020
  name: "handle queue",
28021
28021
  threadID: this.threadID
28022
28022
  });
@@ -28036,7 +28036,7 @@ class Zi {
28036
28036
  e.message = await W8(
28037
28037
  { configService: this.deps.configService, filesystem: this.filesystem },
28038
28038
  e.message
28039
- ), e.message.fileMentions?.imageBlocks?.length && (le.debug(
28039
+ ), e.message.fileMentions?.imageBlocks?.length && (ce.debug(
28040
28040
  `Adding ${e.message.fileMentions.imageBlocks.length} image attachments to message`,
28041
28041
  {
28042
28042
  name: "adding image attachments",
@@ -28050,10 +28050,10 @@ class Zi {
28050
28050
  try {
28051
28051
  this.ephemeralError.getValue() !== void 0 && this.ephemeralError.next(void 0), this.updateThread(e), this.onThreadDelta(e);
28052
28052
  } catch (r) {
28053
- $l(r) ? le.debug(`AbortError caught during handle processing for ${e.type}.`, {
28053
+ $l(r) ? ce.debug(`AbortError caught during handle processing for ${e.type}.`, {
28054
28054
  name: "handle queue",
28055
28055
  threadID: this.threadID
28056
- }) : (le.error("Ephemeral error during handle processing", r, {
28056
+ }) : (ce.error("Ephemeral error during handle processing", r, {
28057
28057
  name: "ThreadWorker",
28058
28058
  threadID: this.threadID
28059
28059
  }), this.ephemeralError.next(r instanceof Error ? r : new Error(String(r))));
@@ -28078,11 +28078,11 @@ class Zi {
28078
28078
  for (const r of t.content)
28079
28079
  if (r.type === "tool_result" && r.run.status === "done")
28080
28080
  for (const a of r.run.files ?? [])
28081
- le.info(`tracking (again) ${a}`, {
28081
+ ce.info(`tracking (again) ${a}`, {
28082
28082
  threadID: this.threadID
28083
28083
  }), this.trackFile(a);
28084
28084
  for (const r of t.fileMentions?.files ?? [])
28085
- le.debug(`file: ${r.path}`, {
28085
+ ce.debug(`file: ${r.path}`, {
28086
28086
  name: "tracking file mention",
28087
28087
  threadID: this.threadID
28088
28088
  }), this.trackFile(r.path);
@@ -28090,7 +28090,7 @@ class Zi {
28090
28090
  });
28091
28091
  else
28092
28092
  for (const t of e.message.fileMentions?.files ?? [])
28093
- le.debug(`file: ${t.path}`, {
28093
+ ce.debug(`file: ${t.path}`, {
28094
28094
  name: "tracking file mention",
28095
28095
  threadID: this.threadID
28096
28096
  }), this.trackFile(t.path);
@@ -28108,7 +28108,7 @@ class Zi {
28108
28108
  r && this.registerSubthread(e.toolUse, r);
28109
28109
  }
28110
28110
  const t = k1(this.thread, e.toolUse);
28111
- le.debug(
28111
+ ce.debug(
28112
28112
  `updated tool_result${t ? " and running inference because all tools completed" : ""}`,
28113
28113
  {
28114
28114
  name: `handleThreadDelta(${e.type}, ${e.toolUse}, ${e.data.status})`,
@@ -28119,7 +28119,7 @@ class Zi {
28119
28119
  }
28120
28120
  case "assistant:message": {
28121
28121
  const t = this.findToolUsesNeedingInvocation(e.message);
28122
- le.debug(
28122
+ ce.debug(
28123
28123
  `saw ${t.length} tool uses (${t.map((r) => r.name).join(", ")})`,
28124
28124
  { name: `handleThreadDelta(${e.type})`, threadID: this.threadID }
28125
28125
  );
@@ -28129,10 +28129,10 @@ class Zi {
28129
28129
  }
28130
28130
  case "assistant:message-delta": {
28131
28131
  if (e.event.type === "message_start")
28132
- le.debug("token usage", e.event.message.usage);
28132
+ ce.debug("token usage", e.event.message.usage);
28133
28133
  else if (e.event.type === "message_delta" && e.inferenceStart && e.event.usage?.output_tokens) {
28134
28134
  const i = performance.now() - e.inferenceStart;
28135
- le.debug("completed message", {
28135
+ ce.debug("completed message", {
28136
28136
  outputTokens: e.event.usage.output_tokens,
28137
28137
  tokensPerSecond: e.event.usage.output_tokens / i * 1e3,
28138
28138
  inferenceDuration: QI(i)
@@ -28172,7 +28172,7 @@ class Zi {
28172
28172
  if (s)
28173
28173
  return;
28174
28174
  }
28175
- le.debug("Invoking tool", {
28175
+ ce.debug("Invoking tool", {
28176
28176
  name: "invokeTool",
28177
28177
  threadID: this.threadID,
28178
28178
  toolUse: e,
@@ -28220,12 +28220,12 @@ class Zi {
28220
28220
  })
28221
28221
  ).subscribe({
28222
28222
  next: async (p) => {
28223
- if (le.debug(`${e.id}, ${p.status}`, {
28223
+ if (ce.debug(`${e.id}, ${p.status}`, {
28224
28224
  name: "invokeTool",
28225
28225
  threadID: this.threadID
28226
28226
  }), bs(p) && (delete this.ops.tools[e.id], m.unsubscribe(), p.status === "done" && p.files?.length))
28227
28227
  for (const d of p.files)
28228
- le.debug(`file: ${d}`, {
28228
+ ce.debug(`file: ${d}`, {
28229
28229
  name: "tracking file from tool call",
28230
28230
  threadID: this.threadID
28231
28231
  }), this.trackFile(d);
@@ -28295,7 +28295,7 @@ class Zi {
28295
28295
  H8(a, e.signal).then((i) => {
28296
28296
  e.signal.aborted || this.isDisposed || this.thread.title !== i && this.updateThread({ type: "title", value: i });
28297
28297
  }).catch((i) => {
28298
- $l(i) || le.error("generateThreadTitle error", i, {
28298
+ $l(i) || ce.error("generateThreadTitle error", i, {
28299
28299
  name: "ThreadWorker",
28300
28300
  threadID: this.threadID
28301
28301
  });
@@ -28308,7 +28308,7 @@ class Zi {
28308
28308
  }
28309
28309
  });
28310
28310
  }).catch((i) => {
28311
- le.error("Failed to initialize thread environment", i, {
28311
+ ce.error("Failed to initialize thread environment", i, {
28312
28312
  threadID: this.threadID
28313
28313
  });
28314
28314
  });
@@ -28412,7 +28412,7 @@ class Zi {
28412
28412
  if (!Ba(this.thread, e)) return;
28413
28413
  const a = this.ops.toolMessages[e];
28414
28414
  if (!a) {
28415
- le.warn("unable to detach tool use, missing toolMessages", { id: e });
28415
+ ce.warn("unable to detach tool use, missing toolMessages", { id: e });
28416
28416
  return;
28417
28417
  }
28418
28418
  a.next(t);
@@ -28427,7 +28427,7 @@ class Zi {
28427
28427
  }
28428
28428
  async cancelTool(e, t) {
28429
28429
  const r = this.cancelDataForToolRun(e);
28430
- this.abortToolOp(e), this.cancelSubthread(e), le.debug(`cancelToolRun(${e})`), await this.handle(
28430
+ this.abortToolOp(e), this.cancelSubthread(e), ce.debug(`cancelToolRun(${e})`), await this.handle(
28431
28431
  {
28432
28432
  type: "tool:data",
28433
28433
  toolUse: e,
@@ -28437,13 +28437,13 @@ class Zi {
28437
28437
  );
28438
28438
  }
28439
28439
  async cancel() {
28440
- le.debug("cancel: aborting inference operation and tools"), this.cancelInference(), this.cancelUnstartedTools(), this.cancelInProgressTools(), await this.handle({ type: "cancelled" }, void 0);
28440
+ ce.debug("cancel: aborting inference operation and tools"), this.cancelInference(), this.cancelUnstartedTools(), this.cancelInProgressTools(), await this.handle({ type: "cancelled" }, void 0);
28441
28441
  }
28442
28442
  cancelInference() {
28443
28443
  this.ops.inference && (this.ops.inference.abort(new Error(DC.USER_CANCELLED)), this.ops.inference = null), this.inferenceState.next("cancelled");
28444
28444
  }
28445
28445
  async retry() {
28446
- le.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();
28446
+ ce.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();
28447
28447
  }
28448
28448
  cancelSubthread(e) {
28449
28449
  const t = this.subthreads.get(e);
@@ -28463,16 +28463,16 @@ class Zi {
28463
28463
  t.map((a) => a.fsPath),
28464
28464
  e
28465
28465
  ) : await s0(this.filesystem, t, e);
28466
- le.debug("tracking file", { absolutePath: r }), this.trackedFiles.add(r);
28466
+ ce.debug("tracking file", { absolutePath: r }), this.trackedFiles.add(r);
28467
28467
  }
28468
28468
  async restoreFileChangesFromBackups() {
28469
28469
  try {
28470
28470
  const e = await Hk(this.filesystem);
28471
28471
  for (const [t, r] of e.toolDiffs.entries())
28472
28472
  this.fileChangeRecords.set(t, r);
28473
- le.debug(`Restored ${e.toolDiffs.size} file changes from disk`), await this.updateFileChanges();
28473
+ ce.debug(`Restored ${e.toolDiffs.size} file changes from disk`), await this.updateFileChanges();
28474
28474
  } catch (e) {
28475
- le.error("Error restoring file changes", e, { threadID: this.threadID });
28475
+ ce.error("Error restoring file changes", e, { threadID: this.threadID });
28476
28476
  }
28477
28477
  }
28478
28478
  createToolUseFileChangeTracker(e) {
@@ -28619,9 +28619,14 @@ function Q8(n, e, t) {
28619
28619
  },
28620
28620
  m
28621
28621
  ), o = i.status.pipe(Zb((d) => d.state === "active")).subscribe((d) => {
28622
- a || d.ephemeralError && (r.next({
28622
+ if (a) return;
28623
+ const E = { threadID: m };
28624
+ d.inferenceState === "cancelled" ? (r.next({
28625
+ status: "cancelled",
28626
+ progress: E
28627
+ }), r.complete(), c()) : d.ephemeralError && (r.next({
28623
28628
  status: "error",
28624
- progress: { threadID: m },
28629
+ progress: E,
28625
28630
  error: {
28626
28631
  message: d.ephemeralError.message
28627
28632
  }
@@ -28677,7 +28682,7 @@ function Q8(n, e, t) {
28677
28682
  }
28678
28683
  });
28679
28684
  })().catch((m) => {
28680
- le.warn("down here!!!"), a || (r.error(m), c());
28685
+ a || (r.error(m), c());
28681
28686
  }), c;
28682
28687
  });
28683
28688
  }
@@ -28816,7 +28821,7 @@ function UD() {
28816
28821
  try {
28817
28822
  return l(i, s);
28818
28823
  } catch (c) {
28819
- le.error("preprocessArgs", { id: a, args: i, error: String(c) });
28824
+ ce.error("preprocessArgs", { id: a, args: i, error: String(c) });
28820
28825
  return;
28821
28826
  }
28822
28827
  },
@@ -28861,7 +28866,7 @@ Returns a git-style diff showing the changes that were undone as formatted markd
28861
28866
  switch ("node") {
28862
28867
  case "node":
28863
28868
  case "vscode":
28864
- return import("./undo_edit.node-CVDhtmI5.js").then(({ nodeUndoEditTool: n }) => n);
28869
+ return import("./undo_edit.node-D1QQpU-v.js").then(({ nodeUndoEditTool: n }) => n);
28865
28870
  }
28866
28871
  })()
28867
28872
  }, bm = globalThis.window?.document !== void 0;
@@ -64351,8 +64356,8 @@ function e7() {
64351
64356
  S || (S = this.treeAdapter.createElement(d.TEMPLATE, E.HTML, []));
64352
64357
  const Q = this.treeAdapter.createElement("documentmock", E.HTML, []);
64353
64358
  this._bootstrap(Q, S), this.treeAdapter.getTagName(S) === d.TEMPLATE && this._pushTmplInsertionMode(tt), this._initTokenizerForFragmentParsing(), this._insertFakeRootElement(), this._resetInsertionMode(), this._findFormInFragmentContext(), this.tokenizer.write(T, !0), this._runParsingLoop(null);
64354
- const ce = this.treeAdapter.getFirstChild(Q), qe = this.treeAdapter.createDocumentFragment();
64355
- return this._adoptNodes(ce, qe), qe;
64359
+ const le = this.treeAdapter.getFirstChild(Q), qe = this.treeAdapter.createDocumentFragment();
64360
+ return this._adoptNodes(le, qe), qe;
64356
64361
  }
64357
64362
  //Bootstrap parser
64358
64363
  _bootstrap(T, S) {
@@ -64419,8 +64424,8 @@ function e7() {
64419
64424
  }
64420
64425
  //Tree mutation
64421
64426
  _setDocumentType(T) {
64422
- const S = T.name || "", Q = T.publicId || "", ce = T.systemId || "";
64423
- this.treeAdapter.setDocumentType(this.document, S, Q, ce);
64427
+ const S = T.name || "", Q = T.publicId || "", le = T.systemId || "";
64428
+ this.treeAdapter.setDocumentType(this.document, S, Q, le);
64424
64429
  }
64425
64430
  _attachElementToTree(T) {
64426
64431
  if (this._shouldFosterParentOnInsertion())
@@ -64474,8 +64479,8 @@ function e7() {
64474
64479
  const Q = this.treeAdapter.getNamespaceURI(S);
64475
64480
  if (Q === E.HTML || this.treeAdapter.getTagName(S) === d.ANNOTATION_XML && Q === E.MATHML && T.type === n.START_TAG_TOKEN && T.tagName === d.SVG)
64476
64481
  return !1;
64477
- const ce = T.type === n.CHARACTER_TOKEN || T.type === n.NULL_CHARACTER_TOKEN || T.type === n.WHITESPACE_CHARACTER_TOKEN;
64478
- return (T.type === n.START_TAG_TOKEN && T.tagName !== d.MGLYPH && T.tagName !== d.MALIGNMARK || ce) && this._isIntegrationPoint(S, E.MATHML) || (T.type === n.START_TAG_TOKEN || ce) && this._isIntegrationPoint(S, E.HTML) ? !1 : T.type !== n.EOF_TOKEN;
64482
+ const le = T.type === n.CHARACTER_TOKEN || T.type === n.NULL_CHARACTER_TOKEN || T.type === n.WHITESPACE_CHARACTER_TOKEN;
64483
+ return (T.type === n.START_TAG_TOKEN && T.tagName !== d.MGLYPH && T.tagName !== d.MALIGNMARK || le) && this._isIntegrationPoint(S, E.MATHML) || (T.type === n.START_TAG_TOKEN || le) && this._isIntegrationPoint(S, E.HTML) ? !1 : T.type !== n.EOF_TOKEN;
64479
64484
  }
64480
64485
  _processToken(T) {
64481
64486
  Lt[this.insertionMode][T.type](this, T);
@@ -64491,8 +64496,8 @@ function e7() {
64491
64496
  }
64492
64497
  //Integration points
64493
64498
  _isIntegrationPoint(T, S) {
64494
- const Q = this.treeAdapter.getTagName(T), ce = this.treeAdapter.getNamespaceURI(T), qe = this.treeAdapter.getAttrList(T);
64495
- return c.isIntegrationPoint(Q, ce, qe, S);
64499
+ const Q = this.treeAdapter.getTagName(T), le = this.treeAdapter.getNamespaceURI(T), qe = this.treeAdapter.getAttrList(T);
64500
+ return c.isIntegrationPoint(Q, le, qe, S);
64496
64501
  }
64497
64502
  //Active formatting elements reconstruction
64498
64503
  _reconstructActiveFormattingElements() {
@@ -64505,8 +64510,8 @@ function e7() {
64505
64510
  break;
64506
64511
  }
64507
64512
  while (S > 0);
64508
- for (let ce = S; ce < T; ce++)
64509
- Q = this.activeFormattingElements.entries[ce], this._insertElement(Q.token, this.treeAdapter.getNamespaceURI(Q.element)), Q.element = this.openElements.current;
64513
+ for (let le = S; le < T; le++)
64514
+ Q = this.activeFormattingElements.entries[le], this._insertElement(Q.token, this.treeAdapter.getNamespaceURI(Q.element)), Q.element = this.openElements.current;
64510
64515
  }
64511
64516
  }
64512
64517
  //Close elements
@@ -64521,23 +64526,23 @@ function e7() {
64521
64526
  for (let T = this.openElements.stackTop, S = !1; T >= 0; T--) {
64522
64527
  let Q = this.openElements.items[T];
64523
64528
  T === 0 && (S = !0, this.fragmentContext && (Q = this.fragmentContext));
64524
- const ce = this.treeAdapter.getTagName(Q), qe = Kt[ce];
64529
+ const le = this.treeAdapter.getTagName(Q), qe = Kt[le];
64525
64530
  if (qe) {
64526
64531
  this.insertionMode = qe;
64527
64532
  break;
64528
- } else if (!S && (ce === d.TD || ce === d.TH)) {
64533
+ } else if (!S && (le === d.TD || le === d.TH)) {
64529
64534
  this.insertionMode = Qe;
64530
64535
  break;
64531
- } else if (!S && ce === d.HEAD) {
64536
+ } else if (!S && le === d.HEAD) {
64532
64537
  this.insertionMode = v;
64533
64538
  break;
64534
- } else if (ce === d.SELECT) {
64539
+ } else if (le === d.SELECT) {
64535
64540
  this._resetInsertionModeForSelect(T);
64536
64541
  break;
64537
- } else if (ce === d.TEMPLATE) {
64542
+ } else if (le === d.TEMPLATE) {
64538
64543
  this.insertionMode = this.currentTmplInsertionMode;
64539
64544
  break;
64540
- } else if (ce === d.HTML) {
64545
+ } else if (le === d.HTML) {
64541
64546
  this.insertionMode = this.headElement ? x : h;
64542
64547
  break;
64543
64548
  } else if (S) {
@@ -64549,10 +64554,10 @@ function e7() {
64549
64554
  _resetInsertionModeForSelect(T) {
64550
64555
  if (T > 0)
64551
64556
  for (let S = T - 1; S > 0; S--) {
64552
- const Q = this.openElements.items[S], ce = this.treeAdapter.getTagName(Q);
64553
- if (ce === d.TEMPLATE)
64557
+ const Q = this.openElements.items[S], le = this.treeAdapter.getTagName(Q);
64558
+ if (le === d.TEMPLATE)
64554
64559
  break;
64555
- if (ce === d.TABLE) {
64560
+ if (le === d.TABLE) {
64556
64561
  this.insertionMode = Tt;
64557
64562
  return;
64558
64563
  }
@@ -64579,11 +64584,11 @@ function e7() {
64579
64584
  beforeElement: null
64580
64585
  };
64581
64586
  for (let S = this.openElements.stackTop; S >= 0; S--) {
64582
- const Q = this.openElements.items[S], ce = this.treeAdapter.getTagName(Q), qe = this.treeAdapter.getNamespaceURI(Q);
64583
- if (ce === d.TEMPLATE && qe === E.HTML) {
64587
+ const Q = this.openElements.items[S], le = this.treeAdapter.getTagName(Q), qe = this.treeAdapter.getNamespaceURI(Q);
64588
+ if (le === d.TEMPLATE && qe === E.HTML) {
64584
64589
  T.parent = this.treeAdapter.getTemplateContent(Q);
64585
64590
  break;
64586
- } else if (ce === d.TABLE) {
64591
+ } else if (le === d.TABLE) {
64587
64592
  T.parent = this.treeAdapter.getParentNode(Q), T.parent ? T.beforeElement = Q : T.parent = this.openElements.items[S - 1];
64588
64593
  break;
64589
64594
  }
@@ -64612,17 +64617,17 @@ function e7() {
64612
64617
  function Pt(g, T) {
64613
64618
  let S = null;
64614
64619
  for (let Q = g.openElements.stackTop; Q >= 0; Q--) {
64615
- const ce = g.openElements.items[Q];
64616
- if (ce === T.element)
64620
+ const le = g.openElements.items[Q];
64621
+ if (le === T.element)
64617
64622
  break;
64618
- g._isSpecialElement(ce) && (S = ce);
64623
+ g._isSpecialElement(le) && (S = le);
64619
64624
  }
64620
64625
  return S || (g.openElements.popUntilElementPopped(T.element), g.activeFormattingElements.removeEntry(T)), S;
64621
64626
  }
64622
64627
  function nn(g, T, S) {
64623
- let Q = T, ce = g.openElements.getCommonAncestor(T);
64624
- for (let qe = 0, Jt = ce; Jt !== S; qe++, Jt = ce) {
64625
- ce = g.openElements.getCommonAncestor(Jt);
64628
+ let Q = T, le = g.openElements.getCommonAncestor(T);
64629
+ for (let qe = 0, Jt = le; Jt !== S; qe++, Jt = le) {
64630
+ le = g.openElements.getCommonAncestor(Jt);
64626
64631
  const hi = g.activeFormattingElements.getElementEntry(Jt), qm = hi && qe >= k;
64627
64632
  !hi || qm ? (qm && g.activeFormattingElements.removeEntry(hi), g.openElements.remove(Jt)) : (Jt = bt(g, hi), Q === T && (g.activeFormattingElements.bookmark = hi), g.treeAdapter.detachNode(Q), g.treeAdapter.appendChild(Jt, Q), Q = Jt);
64628
64633
  }
@@ -64636,23 +64641,23 @@ function e7() {
64636
64641
  if (g._isElementCausesFosterParenting(T))
64637
64642
  g._fosterParentElement(S);
64638
64643
  else {
64639
- const Q = g.treeAdapter.getTagName(T), ce = g.treeAdapter.getNamespaceURI(T);
64640
- Q === d.TEMPLATE && ce === E.HTML && (T = g.treeAdapter.getTemplateContent(T)), g.treeAdapter.appendChild(T, S);
64644
+ const Q = g.treeAdapter.getTagName(T), le = g.treeAdapter.getNamespaceURI(T);
64645
+ Q === d.TEMPLATE && le === E.HTML && (T = g.treeAdapter.getTemplateContent(T)), g.treeAdapter.appendChild(T, S);
64641
64646
  }
64642
64647
  }
64643
64648
  function It(g, T, S) {
64644
- const Q = g.treeAdapter.getNamespaceURI(S.element), ce = S.token, qe = g.treeAdapter.createElement(ce.tagName, Q, ce.attrs);
64649
+ const Q = g.treeAdapter.getNamespaceURI(S.element), le = S.token, qe = g.treeAdapter.createElement(le.tagName, Q, le.attrs);
64645
64650
  g._adoptNodes(T, qe), g.treeAdapter.appendChild(T, qe), g.activeFormattingElements.insertElementAfterBookmark(qe, S.token), g.activeFormattingElements.removeEntry(S), g.openElements.remove(S.element), g.openElements.insertAfter(T, qe);
64646
64651
  }
64647
64652
  function Ct(g, T) {
64648
64653
  let S;
64649
64654
  for (let Q = 0; Q < w && (S = St(g, T), !!S); Q++) {
64650
- const ce = Pt(g, S);
64651
- if (!ce)
64655
+ const le = Pt(g, S);
64656
+ if (!le)
64652
64657
  break;
64653
64658
  g.activeFormattingElements.bookmark = S;
64654
- const qe = nn(g, ce, S.element), Jt = g.openElements.getCommonAncestor(S.element);
64655
- g.treeAdapter.detachNode(qe), gt(g, Jt, qe), It(g, ce, S);
64659
+ const qe = nn(g, le, S.element), Jt = g.openElements.getCommonAncestor(S.element);
64660
+ g.treeAdapter.detachNode(qe), gt(g, Jt, qe), It(g, le, S);
64656
64661
  }
64657
64662
  }
64658
64663
  function de() {
@@ -64774,13 +64779,13 @@ function e7() {
64774
64779
  g.framesetOk = !1;
64775
64780
  const S = T.tagName;
64776
64781
  for (let Q = g.openElements.stackTop; Q >= 0; Q--) {
64777
- const ce = g.openElements.items[Q], qe = g.treeAdapter.getTagName(ce);
64782
+ const le = g.openElements.items[Q], qe = g.treeAdapter.getTagName(le);
64778
64783
  let Jt = null;
64779
64784
  if (S === d.LI && qe === d.LI ? Jt = d.LI : (S === d.DD || S === d.DT) && (qe === d.DD || qe === d.DT) && (Jt = qe), Jt) {
64780
64785
  g.openElements.generateImpliedEndTagsWithExclusion(Jt), g.openElements.popUntilTagNamePopped(Jt);
64781
64786
  break;
64782
64787
  }
64783
- if (qe !== d.ADDRESS && qe !== d.DIV && qe !== d.P && g._isSpecialElement(ce))
64788
+ if (qe !== d.ADDRESS && qe !== d.DIV && qe !== d.P && g._isSpecialElement(le))
64784
64789
  break;
64785
64790
  }
64786
64791
  g.openElements.hasInButtonScope(d.P) && g._closePElement(), g._insertElement(T, E.HTML);
@@ -64934,12 +64939,12 @@ function e7() {
64934
64939
  function _n(g, T) {
64935
64940
  const S = T.tagName;
64936
64941
  for (let Q = g.openElements.stackTop; Q > 0; Q--) {
64937
- const ce = g.openElements.items[Q];
64938
- if (g.treeAdapter.getTagName(ce) === S) {
64939
- g.openElements.generateImpliedEndTagsWithExclusion(S), g.openElements.popUntilElementPopped(ce);
64942
+ const le = g.openElements.items[Q];
64943
+ if (g.treeAdapter.getTagName(le) === S) {
64944
+ g.openElements.generateImpliedEndTagsWithExclusion(S), g.openElements.popUntilElementPopped(le);
64940
64945
  break;
64941
64946
  }
64942
- if (g._isSpecialElement(ce))
64947
+ if (g._isSpecialElement(le))
64943
64948
  break;
64944
64949
  }
64945
64950
  }
@@ -65117,8 +65122,8 @@ function e7() {
65117
65122
  function zm(g, T) {
65118
65123
  const S = T.tagName;
65119
65124
  if (S === d.OPTGROUP) {
65120
- const Q = g.openElements.items[g.openElements.stackTop - 1], ce = Q && g.treeAdapter.getTagName(Q);
65121
- g.openElements.currentTagName === d.OPTION && ce === d.OPTGROUP && g.openElements.pop(), g.openElements.currentTagName === d.OPTGROUP && g.openElements.pop();
65125
+ const Q = g.openElements.items[g.openElements.stackTop - 1], le = Q && g.treeAdapter.getTagName(Q);
65126
+ g.openElements.currentTagName === d.OPTION && le === d.OPTGROUP && g.openElements.pop(), g.openElements.currentTagName === d.OPTGROUP && g.openElements.pop();
65122
65127
  } else S === d.OPTION ? g.openElements.currentTagName === d.OPTION && g.openElements.pop() : S === d.SELECT && g.openElements.hasInSelectScope(d.SELECT) ? (g.openElements.popUntilTagNamePopped(d.SELECT), g._resetInsertionMode()) : S === d.TEMPLATE && At(g, T);
65123
65128
  }
65124
65129
  function DA(g, T) {
@@ -72669,7 +72674,7 @@ class jme {
72669
72674
  EA = t.width;
72670
72675
  try {
72671
72676
  const r = Ue(e, { async: !1 }).trimEnd();
72672
- return le.info("marked output", { out: r }), r;
72677
+ return ce.info("marked output", { out: r }), r;
72673
72678
  } catch {
72674
72679
  return e;
72675
72680
  }
@@ -73058,7 +73063,7 @@ export {
73058
73063
  Dv as $,
73059
73064
  Vge as A,
73060
73065
  Sge as B,
73061
- le as C,
73066
+ ce as C,
73062
73067
  jA as D,
73063
73068
  ir as E,
73064
73069
  hge as F,