@sourcegraph/amp 0.0.1748427377-geeb377 → 0.0.1748462555-g4327bb

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-CUPGkX15.js} +78 -60
  3. package/dist/color-CUPGkX15.js.map +1 -0
  4. package/dist/{create_file.node-BJ9db1t8.js → create_file.node-SpjRITEy.js} +2 -2
  5. package/dist/{create_file.node-BJ9db1t8.js.map → create_file.node-SpjRITEy.js.map} +1 -1
  6. package/dist/{edit_file.node-BMxxYIGr.js → edit_file.node-D5N7LO47.js} +3 -3
  7. package/dist/{edit_file.node-BMxxYIGr.js.map → edit_file.node-D5N7LO47.js.map} +1 -1
  8. package/dist/{executable-D-KMMXSM.js → executable-c0v_Cgtd.js} +2 -2
  9. package/dist/{executable-D-KMMXSM.js.map → executable-c0v_Cgtd.js.map} +1 -1
  10. package/dist/{files-CfkeQImL.js → files-BHaKzjeq.js} +2 -2
  11. package/dist/{files-CfkeQImL.js.map → files-BHaKzjeq.js.map} +1 -1
  12. package/dist/{glob.node-B0mTFFtz.js → glob.node-DElvFTve.js} +3 -3
  13. package/dist/{glob.node-B0mTFFtz.js.map → glob.node-DElvFTve.js.map} +1 -1
  14. package/dist/{list_directory.node-DHsYGwWf.js → list_directory.node-XFwN3yE0.js} +2 -2
  15. package/dist/{list_directory.node-DHsYGwWf.js.map → list_directory.node-XFwN3yE0.js.map} +1 -1
  16. package/dist/{load-profile-OVWYid8R.js → load-profile-BYmdPZi4.js} +2 -2
  17. package/dist/{load-profile-OVWYid8R.js.map → load-profile-BYmdPZi4.js.map} +1 -1
  18. package/dist/{main-C0CMTAuI.js → main-DR9dUGdY.js} +8604 -8506
  19. package/dist/{main-C0CMTAuI.js.map → main-DR9dUGdY.js.map} +1 -1
  20. package/dist/{node-fuc2ayQf.js → node-9bKk9FwK.js} +3 -3
  21. package/dist/{node-fuc2ayQf.js.map → node-9bKk9FwK.js.map} +1 -1
  22. package/dist/{node-DOR8bmJd.js → node-B09Ab5Cm.js} +3 -3
  23. package/dist/{node-DOR8bmJd.js.map → node-B09Ab5Cm.js.map} +1 -1
  24. package/dist/{node-C_IajzJJ.js → node-Bp6ny8-f.js} +2 -2
  25. package/dist/{node-C_IajzJJ.js.map → node-Bp6ny8-f.js.map} +1 -1
  26. package/dist/{node-BXVTFEWU.js → node-CUJPEKyh.js} +7 -8
  27. package/dist/node-CUJPEKyh.js.map +1 -0
  28. package/dist/{node-BZRHbCOQ.js → node-DBAQSiZY.js} +2 -2
  29. package/dist/{node-BZRHbCOQ.js.map → node-DBAQSiZY.js.map} +1 -1
  30. package/dist/{node-KD2UfqlA.js → node-XBUPK8tB.js} +3 -3
  31. package/dist/{node-KD2UfqlA.js.map → node-XBUPK8tB.js.map} +1 -1
  32. package/dist/{read_file.node-Bju6vvoS.js → read_file.node-QTo58SRd.js} +2 -2
  33. package/dist/{read_file.node-Bju6vvoS.js.map → read_file.node-QTo58SRd.js.map} +1 -1
  34. package/dist/{stdio-Cz3SGMSm.js → stdio-ZOtkCu09.js} +3 -3
  35. package/dist/{stdio-Cz3SGMSm.js.map → stdio-ZOtkCu09.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-DBBw_ukz.js} +2 -2
  39. package/dist/{undo_edit.node-DlNuubCp.js.map → undo_edit.node-DBBw_ukz.js.map} +1 -1
  40. package/package.json +1 -1
  41. package/dist/color-DGLUYaqf.js.map +0 -1
  42. package/dist/node-BXVTFEWU.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-C0CMTAuI.js";
2
+ import "./color-CUPGkX15.js";
3
+ import "./main-DR9dUGdY.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-SpjRITEy.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-B09Ab5Cm.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-QTo58SRd.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-D5N7LO47.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-DElvFTve.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-XFwN3yE0.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-XBUPK8tB.js").then(({ nodeBashTool: t }) => t)
9110
9110
  }, Y0 = [
9111
9111
  "ls",
9112
9112
  "dir",
@@ -9693,7 +9693,7 @@ Here are some examples to concise, direct communication:
9693
9693
 
9694
9694
  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
9695
  async function _h(t, e) {
9696
- const r = await t.environment(), n = await t.agentFile(En), a = [];
9696
+ const r = e?.systemPromptData ?? await t.environment(), n = await t.agentFile(En), a = [];
9697
9697
  n && a.push({
9698
9698
  type: "text",
9699
9699
  text: `# AGENT.md
@@ -9701,11 +9701,12 @@ async function _h(t, e) {
9701
9701
  ${n}
9702
9702
  `
9703
9703
  });
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(", ")}`;
9704
+ function s(o) {
9705
+ if (!o.trees || o.trees.length === 0) return null;
9706
+ const l = o.trees.map((u) => u.repository?.url).filter((u) => u !== void 0);
9707
+ return l.length === 0 ? null : `${h0(l.length, "Repository", "Repositories")}: ${l.join(", ")}`;
9708
9708
  }
9709
+ const i = e?.threadEnv;
9709
9710
  return a.push({
9710
9711
  type: "text",
9711
9712
  text: [
@@ -9714,29 +9715,29 @@ ${n}
9714
9715
  `Today's date: ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`,
9715
9716
  `Working directory: ${r.workingDirectory}`,
9716
9717
  `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:
9718
+ i && i.platform ? `Operating system: ${i.platform.os}${i.platform.webBrowser ? " (running in web browser)" : ""}` : null,
9719
+ i ? s(i) : null,
9720
+ `Directory listing of the user's workspace paths (will NOT change during the conversation):
9720
9721
  <directoryListing>
9721
9722
  ${r.rootDirectoryListing || ""}
9722
9723
  </directoryListing>`
9723
- ].filter((i) => i !== null).join(`
9724
+ ].filter((o) => o !== null).join(`
9724
9725
 
9725
9726
  `),
9726
9727
  cache_control: { type: "ephemeral" }
9727
9728
  }), a;
9728
9729
  }
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({
9730
+ async function W0(t, e) {
9731
+ const r = [
9732
+ { type: "text", text: ch(e?.enabledTodos) }
9733
+ ], n = await _h(t, e);
9734
+ return r.push(...n), r.push({
9734
9735
  type: "text",
9735
- text: r ? lh : uh
9736
- }), n;
9736
+ text: e?.enabledTodos ? lh : uh
9737
+ }), r;
9737
9738
  }
9738
9739
  async function CJ(t, e, r = !1) {
9739
- const n = [ch(r)], a = await _h(t, e);
9740
+ const n = [ch(r)], a = await _h(t, { threadEnv: e });
9740
9741
  for (const s of a)
9741
9742
  n.push(s.text);
9742
9743
  return n.push(r ? lh : uh), n.join(`
@@ -9926,7 +9927,7 @@ async function Z0(t, e) {
9926
9927
  return [
9927
9928
  e ? { type: "text", text: e } : null,
9928
9929
  // Always use false for enabledTodos in sub-agent mode
9929
- ...await W0(t, void 0, !1)
9930
+ ...await W0(t, { enabledTodos: !1 })
9930
9931
  ].filter((n) => n !== null);
9931
9932
  }
9932
9933
  const Xr = "codebase_search", Lu = [
@@ -10036,77 +10037,94 @@ Returns a git-style diff showing the changes that were undone as formatted markd
10036
10037
  },
10037
10038
  source: "builtin"
10038
10039
  },
10039
- fn: import("./undo_edit.node-DlNuubCp.js").then(({ nodeUndoEditTool: t }) => t)
10040
+ fn: import("./undo_edit.node-DBBw_ukz.js").then(({ nodeUndoEditTool: t }) => t)
10040
10041
  };
10041
- function NJ(t, e, r) {
10042
- const n = [], a = [];
10043
- for (const [s, i] of t.messages.entries())
10044
- switch (i.role) {
10042
+ function NJ(t, e, r, n) {
10043
+ const a = [], s = [];
10044
+ for (const [i, o] of t.messages.entries())
10045
+ switch (o.role) {
10045
10046
  case "assistant":
10046
10047
  case "info":
10047
- if (e?.has(s) || i.role === "assistant" && i.state.type === "streaming")
10048
+ if (e?.has(i) || o.role === "assistant" && o.state.type === "streaming")
10048
10049
  continue;
10049
- e?.add(s), n.push([s, i]);
10050
+ e?.add(i), a.push([i, o]);
10050
10051
  break;
10051
10052
  case "user":
10052
- for (const o of i.content)
10053
- if (o.type === "tool_result") {
10054
- if (r?.has(o.toolUseID) || !Ku(o.run))
10053
+ n && !e?.has(i) && (e?.add(i), a.push([i, o]));
10054
+ for (const l of o.content)
10055
+ if (l.type === "tool_result") {
10056
+ if (r?.has(l.toolUseID) || !Ku(l.run))
10055
10057
  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]);
10058
+ r?.add(l.toolUseID);
10059
+ const u = FT(t, l.toolUseID);
10060
+ if (!u)
10061
+ throw new Error(`(bug) tool use ${l.toolUseID} not found`);
10062
+ s.push([u, l]);
10061
10063
  }
10062
10064
  break;
10063
10065
  }
10064
- return { messages: n, toolResults: a };
10066
+ return { messages: a, toolResults: s };
10065
10067
  }
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" }));
10068
+ function OJ({ messages: t, toolResults: e }, r = (o) => _S.write(o + `
10069
+ `), n, a, s, i) {
10070
+ for (const [, o] of t)
10071
+ if (o.role === "user") {
10072
+ if (i !== void 0) {
10073
+ for (const l of o.content)
10074
+ if (l.type === "text") {
10075
+ const u = l.text.split(`
10076
+ `);
10077
+ for (const d of u)
10078
+ r(
10079
+ a.print(`${i}${d}`, {
10080
+ foreground: "green",
10081
+ style: "italic"
10082
+ })
10083
+ );
10084
+ r("");
10085
+ }
10086
+ }
10087
+ } else if (o.role === "assistant") {
10088
+ if (o.state.type === "error") {
10089
+ r(a.print(`Error: ${o.state.error.message}`, { foreground: "red" }));
10072
10090
  continue;
10073
10091
  }
10074
- for (const o of i.content)
10075
- switch (o.type) {
10092
+ for (const l of o.content)
10093
+ switch (l.type) {
10076
10094
  case "text":
10077
10095
  r(
10078
- a.printMarkdown(o.text.trim(), {
10096
+ a.printMarkdown(l.text.trim(), {
10079
10097
  width: n
10080
10098
  })
10081
10099
  ), r("");
10082
10100
  break;
10083
10101
  }
10084
- } else if (i.role === "info")
10085
- for (const o of i.content)
10086
- o.type === "summary" && (o.summary.type === "message" ? (r(
10102
+ } else if (o.role === "info")
10103
+ for (const l of o.content)
10104
+ l.type === "summary" && (l.summary.type === "message" ? (r(
10087
10105
  Sn(
10088
10106
  a,
10089
10107
  "default",
10090
10108
  n,
10091
10109
  "Compaction Summary",
10092
- o.summary.summary,
10110
+ l.summary.summary,
10093
10111
  void 0,
10094
10112
  void 0
10095
10113
  )
10096
- ), r("")) : o.summary.type === "thread" && (r(
10114
+ ), r("")) : l.summary.type === "thread" && (r(
10097
10115
  Sn(
10098
10116
  a,
10099
10117
  "default",
10100
10118
  n,
10101
10119
  "Compaction Summary",
10102
- `Based on thread: ${o.summary.thread}`,
10120
+ `Based on thread: ${l.summary.thread}`,
10103
10121
  void 0,
10104
10122
  void 0
10105
10123
  )
10106
10124
  ), r("")));
10107
- for (const [i, o] of e) {
10108
- const l = rR(i, o, n, a, s);
10109
- l && (r(l), r(""));
10125
+ for (const [o, l] of e) {
10126
+ const u = rR(o, l, n, a, s);
10127
+ u && (r(u), r(""));
10110
10128
  }
10111
10129
  }
10112
10130
  function rR(t, e, r, n, a) {
@@ -54276,4 +54294,4 @@ export {
54276
54294
  uZ as y,
54277
54295
  mZ as z
54278
54296
  };
54279
- //# sourceMappingURL=color-DGLUYaqf.js.map
54297
+ //# sourceMappingURL=color-CUPGkX15.js.map