@sourcegraph/amp 0.0.1748433686-g2e7c5c → 0.0.1748476906-g715cf0

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.
Files changed (42) hide show
  1. package/dist/amp.js +2 -2
  2. package/dist/{color-DGLUYaqf.js → color-BzIjJtnB.js} +79 -63
  3. package/dist/color-BzIjJtnB.js.map +1 -0
  4. package/dist/{create_file.node-BJ9db1t8.js → create_file.node-DChD1DjB.js} +2 -2
  5. package/dist/{create_file.node-BJ9db1t8.js.map → create_file.node-DChD1DjB.js.map} +1 -1
  6. package/dist/{edit_file.node-BMxxYIGr.js → edit_file.node-B1i7Irj_.js} +3 -3
  7. package/dist/{edit_file.node-BMxxYIGr.js.map → edit_file.node-B1i7Irj_.js.map} +1 -1
  8. package/dist/{executable-D-KMMXSM.js → executable-BQxnlFId.js} +2 -2
  9. package/dist/{executable-D-KMMXSM.js.map → executable-BQxnlFId.js.map} +1 -1
  10. package/dist/{files-CfkeQImL.js → files-CkJlqXKo.js} +2 -2
  11. package/dist/{files-CfkeQImL.js.map → files-CkJlqXKo.js.map} +1 -1
  12. package/dist/{glob.node-B0mTFFtz.js → glob.node-1g9lAvYU.js} +3 -3
  13. package/dist/{glob.node-B0mTFFtz.js.map → glob.node-1g9lAvYU.js.map} +1 -1
  14. package/dist/{list_directory.node-DHsYGwWf.js → list_directory.node-BoNGYthN.js} +2 -2
  15. package/dist/{list_directory.node-DHsYGwWf.js.map → list_directory.node-BoNGYthN.js.map} +1 -1
  16. package/dist/{load-profile-OVWYid8R.js → load-profile-DFLkW6WV.js} +2 -2
  17. package/dist/{load-profile-OVWYid8R.js.map → load-profile-DFLkW6WV.js.map} +1 -1
  18. package/dist/{main-cp81A1je.js → main-Cj-TDfxo.js} +8603 -8505
  19. package/dist/{main-cp81A1je.js.map → main-Cj-TDfxo.js.map} +1 -1
  20. package/dist/{node-BlKhyOsp.js → node-61NQS4s2.js} +7 -8
  21. package/dist/node-61NQS4s2.js.map +1 -0
  22. package/dist/{node-9ls77cDn.js → node-BMyzDv_R.js} +3 -3
  23. package/dist/{node-9ls77cDn.js.map → node-BMyzDv_R.js.map} +1 -1
  24. package/dist/{node-C_IajzJJ.js → node-BoOCJ7th.js} +2 -2
  25. package/dist/{node-C_IajzJJ.js.map → node-BoOCJ7th.js.map} +1 -1
  26. package/dist/{node-DOR8bmJd.js → node-C8RVGYJn.js} +3 -3
  27. package/dist/{node-DOR8bmJd.js.map → node-C8RVGYJn.js.map} +1 -1
  28. package/dist/{node-KD2UfqlA.js → node-CJv9CDhh.js} +3 -3
  29. package/dist/{node-KD2UfqlA.js.map → node-CJv9CDhh.js.map} +1 -1
  30. package/dist/{node-BZRHbCOQ.js → node-bkYFEYK7.js} +2 -2
  31. package/dist/{node-BZRHbCOQ.js.map → node-bkYFEYK7.js.map} +1 -1
  32. package/dist/{read_file.node-Bju6vvoS.js → read_file.node-wkKQeHGb.js} +2 -2
  33. package/dist/{read_file.node-Bju6vvoS.js.map → read_file.node-wkKQeHGb.js.map} +1 -1
  34. package/dist/{stdio-BUwVOdui.js → stdio-DQq9n086.js} +3 -3
  35. package/dist/{stdio-BUwVOdui.js.map → stdio-DQq9n086.js.map} +1 -1
  36. package/dist/storybook.js +2 -2
  37. package/dist/storybook.js.map +1 -1
  38. package/dist/{undo_edit.node-DlNuubCp.js → undo_edit.node-zOzdRUqj.js} +2 -2
  39. package/dist/{undo_edit.node-DlNuubCp.js.map → undo_edit.node-zOzdRUqj.js.map} +1 -1
  40. package/package.json +1 -1
  41. package/dist/color-DGLUYaqf.js.map +0 -1
  42. package/dist/node-BlKhyOsp.js.map +0 -1
package/dist/amp.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import "./color-DGLUYaqf.js";
3
- import "./main-cp81A1je.js";
2
+ import "./color-BzIjJtnB.js";
3
+ import "./main-Cj-TDfxo.js";
4
4
  import "node:crypto";
5
5
  import "node:fs/promises";
6
6
  import "node:path";
@@ -7062,7 +7062,7 @@ Prefer this tool over \`edit_file\` when you want to ovewrite the entire content
7062
7062
  },
7063
7063
  source: "builtin"
7064
7064
  },
7065
- fn: import("./create_file.node-BJ9db1t8.js").then(
7065
+ fn: import("./create_file.node-DChD1DjB.js").then(
7066
7066
  ({ nodeCreateFileTool: t }) => t
7067
7067
  )
7068
7068
  }, ar = "Grep", UC = 15, zC = 250, GC = `Search for exact text patterns in files using ripgrep, a fast keyword search tool.
@@ -7195,7 +7195,7 @@ COMPLEMENTARY USE WITH CODEBASE_SEARCH:
7195
7195
  },
7196
7196
  source: "builtin"
7197
7197
  },
7198
- fn: import("./node-DOR8bmJd.js").then(({ nodeGrepTool: t }) => t)
7198
+ fn: import("./node-C8RVGYJn.js").then(({ nodeGrepTool: t }) => t)
7199
7199
  }, wr = "read_file", YC = 1e3, jn = {
7200
7200
  spec: {
7201
7201
  name: wr,
@@ -7227,7 +7227,7 @@ Returns the contents of the file with each line prefixed by its line number. For
7227
7227
  switch ("node") {
7228
7228
  case "node":
7229
7229
  case "vscode":
7230
- return import("./read_file.node-Bju6vvoS.js").then(({ nodeReadFileTool: t }) => t);
7230
+ return import("./read_file.node-wkKQeHGb.js").then(({ nodeReadFileTool: t }) => t);
7231
7231
  }
7232
7232
  })()
7233
7233
  }, HC = fC({
@@ -7256,7 +7256,7 @@ If you need to replace the entire contents of a file, use \`${ei}\` instead, sin
7256
7256
  inputSchema: wD(HC),
7257
7257
  source: "builtin"
7258
7258
  },
7259
- fn: import("./edit_file.node-BMxxYIGr.js").then(({ nodeEditFileTool: t }) => t)
7259
+ fn: import("./edit_file.node-B1i7Irj_.js").then(({ nodeEditFileTool: t }) => t)
7260
7260
  };
7261
7261
  async function tJ(t, e, r, n) {
7262
7262
  e = Xn(e);
@@ -8261,7 +8261,7 @@ Note: Results are sorted by modification time with the most recently modified fi
8261
8261
  },
8262
8262
  source: "builtin"
8263
8263
  },
8264
- fn: import("./glob.node-B0mTFFtz.js").then(({ nodeGlobTool: t }) => t)
8264
+ fn: import("./glob.node-1g9lAvYU.js").then(({ nodeGlobTool: t }) => t)
8265
8265
  }, ai = "list_directory", nh = {
8266
8266
  spec: {
8267
8267
  name: ai,
@@ -8282,7 +8282,7 @@ Note: Results are sorted by modification time with the most recently modified fi
8282
8282
  switch ("node") {
8283
8283
  case "node":
8284
8284
  case "vscode":
8285
- return import("./list_directory.node-DHsYGwWf.js").then(
8285
+ return import("./list_directory.node-BoNGYthN.js").then(
8286
8286
  ({ nodeListDirectoryTool: t }) => t
8287
8287
  );
8288
8288
  }
@@ -9106,7 +9106,7 @@ It's VERY IMPORTANT to use specific tools when searching for files, instead of i
9106
9106
  },
9107
9107
  source: "builtin"
9108
9108
  },
9109
- fn: import("./node-KD2UfqlA.js").then(({ nodeBashTool: t }) => t)
9109
+ fn: import("./node-CJv9CDhh.js").then(({ nodeBashTool: t }) => t)
9110
9110
  }, Y0 = [
9111
9111
  "ls",
9112
9112
  "dir",
@@ -9603,11 +9603,9 @@ Only add code comments when:
9603
9603
 
9604
9604
  ## Citations
9605
9605
 
9606
- To keep the user in the loop, it is important to cite your work with Markdown links.
9607
-
9608
9606
  If you respond with information from a web search, link to the page that contained the important information.
9609
9607
 
9610
- If you are referring to a specific file or location within a file, link to that file. The URL should use \`file\` as the scheme, the absolute path to the file as the path, and an optional fragment with the line range.
9608
+ To make it easy for the user to look into code you are referring to, you always link to the code with markdown links. The URL should use \`file\` as the scheme, the absolute path to the file as the path, and an optional fragment with the line range.
9611
9609
 
9612
9610
  Here is an example URL for linking to a file:
9613
9611
  <example-file-url>file:///Users/bob/src/test.py</example-file-url>
@@ -9693,7 +9691,7 @@ Here are some examples to concise, direct communication:
9693
9691
 
9694
9692
  IMPORTANT: Always use the ${lr} tool to plan and track tasks throughout the conversation. Make sure to check off single TODOs once they're done. Not just all of them at the end.`, uh = "You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless the user asks for more detail.";
9695
9693
  async function _h(t, e) {
9696
- const r = await t.environment(), n = await t.agentFile(En), a = [];
9694
+ const r = e?.systemPromptData ?? await t.environment(), n = await t.agentFile(En), a = [];
9697
9695
  n && a.push({
9698
9696
  type: "text",
9699
9697
  text: `# AGENT.md
@@ -9701,11 +9699,12 @@ async function _h(t, e) {
9701
9699
  ${n}
9702
9700
  `
9703
9701
  });
9704
- function s(i) {
9705
- if (!i.trees || i.trees.length === 0) return null;
9706
- const o = i.trees.map((l) => l.repository?.url).filter((l) => l !== void 0);
9707
- return o.length === 0 ? null : `${h0(o.length, "Repository", "Repositories")}: ${o.join(", ")}`;
9702
+ function s(o) {
9703
+ if (!o.trees || o.trees.length === 0) return null;
9704
+ const l = o.trees.map((u) => u.repository?.url).filter((u) => u !== void 0);
9705
+ return l.length === 0 ? null : `${h0(l.length, "Repository", "Repositories")}: ${l.join(", ")}`;
9708
9706
  }
9707
+ const i = e?.threadEnv;
9709
9708
  return a.push({
9710
9709
  type: "text",
9711
9710
  text: [
@@ -9714,29 +9713,29 @@ ${n}
9714
9713
  `Today's date: ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`,
9715
9714
  `Working directory: ${r.workingDirectory}`,
9716
9715
  `Workspace paths: ${r.workspacePaths.join(", ")}`,
9717
- e && e.platform ? `Operating system: ${e.platform.os}${e.platform.webBrowser ? " (running in web browser)" : ""}` : null,
9718
- e ? s(e) : null,
9719
- `Directory listing of the user's workspace paths:
9716
+ i && i.platform ? `Operating system: ${i.platform.os}${i.platform.webBrowser ? " (running in web browser)" : ""}` : null,
9717
+ i ? s(i) : null,
9718
+ `Directory listing of the user's workspace paths (will NOT change during the conversation):
9720
9719
  <directoryListing>
9721
9720
  ${r.rootDirectoryListing || ""}
9722
9721
  </directoryListing>`
9723
- ].filter((i) => i !== null).join(`
9722
+ ].filter((o) => o !== null).join(`
9724
9723
 
9725
9724
  `),
9726
9725
  cache_control: { type: "ephemeral" }
9727
9726
  }), a;
9728
9727
  }
9729
- async function W0(t, e, r = !1) {
9730
- const n = [
9731
- { type: "text", text: ch(r) }
9732
- ], a = await _h(t, e);
9733
- return n.push(...a), n.push({
9728
+ async function W0(t, e) {
9729
+ const r = [
9730
+ { type: "text", text: ch(e?.enabledTodos) }
9731
+ ], n = await _h(t, e);
9732
+ return r.push(...n), r.push({
9734
9733
  type: "text",
9735
- text: r ? lh : uh
9736
- }), n;
9734
+ text: e?.enabledTodos ? lh : uh
9735
+ }), r;
9737
9736
  }
9738
9737
  async function CJ(t, e, r = !1) {
9739
- const n = [ch(r)], a = await _h(t, e);
9738
+ const n = [ch(r)], a = await _h(t, { threadEnv: e });
9740
9739
  for (const s of a)
9741
9740
  n.push(s.text);
9742
9741
  return n.push(r ? lh : uh), n.join(`
@@ -9926,7 +9925,7 @@ async function Z0(t, e) {
9926
9925
  return [
9927
9926
  e ? { type: "text", text: e } : null,
9928
9927
  // Always use false for enabledTodos in sub-agent mode
9929
- ...await W0(t, void 0, !1)
9928
+ ...await W0(t, { enabledTodos: !1 })
9930
9929
  ].filter((n) => n !== null);
9931
9930
  }
9932
9931
  const Xr = "codebase_search", Lu = [
@@ -10036,77 +10035,94 @@ Returns a git-style diff showing the changes that were undone as formatted markd
10036
10035
  },
10037
10036
  source: "builtin"
10038
10037
  },
10039
- fn: import("./undo_edit.node-DlNuubCp.js").then(({ nodeUndoEditTool: t }) => t)
10038
+ fn: import("./undo_edit.node-zOzdRUqj.js").then(({ nodeUndoEditTool: t }) => t)
10040
10039
  };
10041
- function NJ(t, e, r) {
10042
- const n = [], a = [];
10043
- for (const [s, i] of t.messages.entries())
10044
- switch (i.role) {
10040
+ function NJ(t, e, r, n) {
10041
+ const a = [], s = [];
10042
+ for (const [i, o] of t.messages.entries())
10043
+ switch (o.role) {
10045
10044
  case "assistant":
10046
10045
  case "info":
10047
- if (e?.has(s) || i.role === "assistant" && i.state.type === "streaming")
10046
+ if (e?.has(i) || o.role === "assistant" && o.state.type === "streaming")
10048
10047
  continue;
10049
- e?.add(s), n.push([s, i]);
10048
+ e?.add(i), a.push([i, o]);
10050
10049
  break;
10051
10050
  case "user":
10052
- for (const o of i.content)
10053
- if (o.type === "tool_result") {
10054
- if (r?.has(o.toolUseID) || !Ku(o.run))
10051
+ n && !e?.has(i) && (e?.add(i), a.push([i, o]));
10052
+ for (const l of o.content)
10053
+ if (l.type === "tool_result") {
10054
+ if (r?.has(l.toolUseID) || !Ku(l.run))
10055
10055
  continue;
10056
- r?.add(o.toolUseID);
10057
- const l = FT(t, o.toolUseID);
10058
- if (!l)
10059
- throw new Error(`(bug) tool use ${o.toolUseID} not found`);
10060
- a.push([l, o]);
10056
+ r?.add(l.toolUseID);
10057
+ const u = FT(t, l.toolUseID);
10058
+ if (!u)
10059
+ throw new Error(`(bug) tool use ${l.toolUseID} not found`);
10060
+ s.push([u, l]);
10061
10061
  }
10062
10062
  break;
10063
10063
  }
10064
- return { messages: n, toolResults: a };
10064
+ return { messages: a, toolResults: s };
10065
10065
  }
10066
- function OJ({ messages: t, toolResults: e }, r = (i) => _S.write(i + `
10067
- `), n, a, s) {
10068
- for (const [, i] of t)
10069
- if (i.role === "assistant") {
10070
- if (i.state.type === "error") {
10071
- r(a.print(`Error: ${i.state.error.message}`, { foreground: "red" }));
10066
+ function OJ({ messages: t, toolResults: e }, r = (o) => _S.write(o + `
10067
+ `), n, a, s, i) {
10068
+ for (const [, o] of t)
10069
+ if (o.role === "user") {
10070
+ if (i !== void 0) {
10071
+ for (const l of o.content)
10072
+ if (l.type === "text") {
10073
+ const u = l.text.split(`
10074
+ `);
10075
+ for (const d of u)
10076
+ r(
10077
+ a.print(`${i}${d}`, {
10078
+ foreground: "green",
10079
+ style: "italic"
10080
+ })
10081
+ );
10082
+ r("");
10083
+ }
10084
+ }
10085
+ } else if (o.role === "assistant") {
10086
+ if (o.state.type === "error") {
10087
+ r(a.print(`Error: ${o.state.error.message}`, { foreground: "red" }));
10072
10088
  continue;
10073
10089
  }
10074
- for (const o of i.content)
10075
- switch (o.type) {
10090
+ for (const l of o.content)
10091
+ switch (l.type) {
10076
10092
  case "text":
10077
10093
  r(
10078
- a.printMarkdown(o.text.trim(), {
10094
+ a.printMarkdown(l.text.trim(), {
10079
10095
  width: n
10080
10096
  })
10081
10097
  ), r("");
10082
10098
  break;
10083
10099
  }
10084
- } else if (i.role === "info")
10085
- for (const o of i.content)
10086
- o.type === "summary" && (o.summary.type === "message" ? (r(
10100
+ } else if (o.role === "info")
10101
+ for (const l of o.content)
10102
+ l.type === "summary" && (l.summary.type === "message" ? (r(
10087
10103
  Sn(
10088
10104
  a,
10089
10105
  "default",
10090
10106
  n,
10091
10107
  "Compaction Summary",
10092
- o.summary.summary,
10108
+ l.summary.summary,
10093
10109
  void 0,
10094
10110
  void 0
10095
10111
  )
10096
- ), r("")) : o.summary.type === "thread" && (r(
10112
+ ), r("")) : l.summary.type === "thread" && (r(
10097
10113
  Sn(
10098
10114
  a,
10099
10115
  "default",
10100
10116
  n,
10101
10117
  "Compaction Summary",
10102
- `Based on thread: ${o.summary.thread}`,
10118
+ `Based on thread: ${l.summary.thread}`,
10103
10119
  void 0,
10104
10120
  void 0
10105
10121
  )
10106
10122
  ), r("")));
10107
- for (const [i, o] of e) {
10108
- const l = rR(i, o, n, a, s);
10109
- l && (r(l), r(""));
10123
+ for (const [o, l] of e) {
10124
+ const u = rR(o, l, n, a, s);
10125
+ u && (r(u), r(""));
10110
10126
  }
10111
10127
  }
10112
10128
  function rR(t, e, r, n, a) {
@@ -54276,4 +54292,4 @@ export {
54276
54292
  uZ as y,
54277
54293
  mZ as z
54278
54294
  };
54279
- //# sourceMappingURL=color-DGLUYaqf.js.map
54295
+ //# sourceMappingURL=color-BzIjJtnB.js.map