@morphllm/morphsdk 0.2.47 → 0.2.49

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 (46) hide show
  1. package/dist/{chunk-BLXC5R4W.js → chunk-3OB2FTEW.js} +4 -4
  2. package/dist/{chunk-SDI2FI6G.js → chunk-6URINEOK.js} +5 -5
  3. package/dist/{chunk-RAKREIXE.js → chunk-7X53XYJ4.js} +4 -4
  4. package/dist/{chunk-OOZSGWSK.js → chunk-CCYRHMJV.js} +4 -4
  5. package/dist/{chunk-7HS6YXA3.js → chunk-FGRMMG62.js} +22 -18
  6. package/dist/{chunk-7HS6YXA3.js.map → chunk-FGRMMG62.js.map} +1 -1
  7. package/dist/{chunk-UCWTZSW5.js → chunk-KM6V456Q.js} +2 -2
  8. package/dist/{chunk-FA6UGPVL.js → chunk-L4CPOZKO.js} +3 -3
  9. package/dist/chunk-TPP2UGQP.js +65 -0
  10. package/dist/chunk-TPP2UGQP.js.map +1 -0
  11. package/dist/client.cjs +50 -8
  12. package/dist/client.cjs.map +1 -1
  13. package/dist/client.js +13 -13
  14. package/dist/index.cjs +50 -8
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.js +13 -13
  17. package/dist/tools/warp_grep/agent/runner.cjs +9 -5
  18. package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
  19. package/dist/tools/warp_grep/agent/runner.js +6 -6
  20. package/dist/tools/warp_grep/anthropic.cjs +50 -8
  21. package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
  22. package/dist/tools/warp_grep/anthropic.js +10 -10
  23. package/dist/tools/warp_grep/index.cjs +50 -8
  24. package/dist/tools/warp_grep/index.cjs.map +1 -1
  25. package/dist/tools/warp_grep/index.js +12 -12
  26. package/dist/tools/warp_grep/openai.cjs +50 -8
  27. package/dist/tools/warp_grep/openai.cjs.map +1 -1
  28. package/dist/tools/warp_grep/openai.js +10 -10
  29. package/dist/tools/warp_grep/providers/local.cjs +41 -3
  30. package/dist/tools/warp_grep/providers/local.cjs.map +1 -1
  31. package/dist/tools/warp_grep/providers/local.js +2 -2
  32. package/dist/tools/warp_grep/utils/ripgrep.cjs +41 -3
  33. package/dist/tools/warp_grep/utils/ripgrep.cjs.map +1 -1
  34. package/dist/tools/warp_grep/utils/ripgrep.js +1 -1
  35. package/dist/tools/warp_grep/vercel.cjs +50 -8
  36. package/dist/tools/warp_grep/vercel.cjs.map +1 -1
  37. package/dist/tools/warp_grep/vercel.js +10 -10
  38. package/package.json +1 -1
  39. package/dist/chunk-XQIVYQD6.js +0 -27
  40. package/dist/chunk-XQIVYQD6.js.map +0 -1
  41. /package/dist/{chunk-BLXC5R4W.js.map → chunk-3OB2FTEW.js.map} +0 -0
  42. /package/dist/{chunk-SDI2FI6G.js.map → chunk-6URINEOK.js.map} +0 -0
  43. /package/dist/{chunk-RAKREIXE.js.map → chunk-7X53XYJ4.js.map} +0 -0
  44. /package/dist/{chunk-OOZSGWSK.js.map → chunk-CCYRHMJV.js.map} +0 -0
  45. /package/dist/{chunk-UCWTZSW5.js.map → chunk-KM6V456Q.js.map} +0 -0
  46. /package/dist/{chunk-FA6UGPVL.js.map → chunk-L4CPOZKO.js.map} +0 -0
package/dist/client.js CHANGED
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  MorphClient
3
- } from "./chunk-SDI2FI6G.js";
4
- import "./chunk-RAKREIXE.js";
5
- import "./chunk-BLXC5R4W.js";
6
- import "./chunk-OOZSGWSK.js";
7
- import "./chunk-FA6UGPVL.js";
8
- import "./chunk-7HS6YXA3.js";
9
- import "./chunk-EK7OQPWD.js";
10
- import "./chunk-Z2FBMSNE.js";
3
+ } from "./chunk-6URINEOK.js";
4
+ import "./chunk-7X53XYJ4.js";
5
+ import "./chunk-3OB2FTEW.js";
6
+ import "./chunk-CCYRHMJV.js";
7
+ import "./chunk-L4CPOZKO.js";
8
+ import "./chunk-FGRMMG62.js";
9
+ import "./chunk-TICMYDII.js";
10
+ import "./chunk-NDZO5IPV.js";
11
11
  import "./chunk-SWQPIKPY.js";
12
12
  import "./chunk-WETRQJGU.js";
13
- import "./chunk-UCWTZSW5.js";
13
+ import "./chunk-Z2FBMSNE.js";
14
+ import "./chunk-KM6V456Q.js";
14
15
  import "./chunk-G2RSY56Q.js";
15
16
  import "./chunk-SMGZ6A64.js";
16
- import "./chunk-XQIVYQD6.js";
17
- import "./chunk-73RQWOQC.js";
17
+ import "./chunk-TPP2UGQP.js";
18
18
  import "./chunk-TJIUA27P.js";
19
- import "./chunk-TICMYDII.js";
20
- import "./chunk-NDZO5IPV.js";
19
+ import "./chunk-73RQWOQC.js";
20
+ import "./chunk-EK7OQPWD.js";
21
21
  import "./chunk-UBX7QYBD.js";
22
22
  import "./chunk-GJU7UOFL.js";
23
23
  import "./chunk-76DJEQEP.js";
package/dist/index.cjs CHANGED
@@ -1700,11 +1700,15 @@ async function runWarpGrep(config) {
1700
1700
  repoRoot,
1701
1701
  finishMeta.files,
1702
1702
  async (p, s, e) => {
1703
- const rr = await provider.read({ path: p, start: s, end: e });
1704
- return rr.lines.map((l) => {
1705
- const idx = l.indexOf("|");
1706
- return idx >= 0 ? l.slice(idx + 1) : l;
1707
- });
1703
+ try {
1704
+ const rr = await provider.read({ path: p, start: s, end: e });
1705
+ return rr.lines.map((l) => {
1706
+ const idx = l.indexOf("|");
1707
+ return idx >= 0 ? l.slice(idx + 1) : l;
1708
+ });
1709
+ } catch {
1710
+ return [`[couldn't find: ${p}]`];
1711
+ }
1708
1712
  }
1709
1713
  );
1710
1714
  return {
@@ -1721,9 +1725,11 @@ var import_path4 = __toESM(require("path"), 1);
1721
1725
  // tools/warp_grep/utils/ripgrep.ts
1722
1726
  var import_child_process = require("child_process");
1723
1727
  var import_ripgrep = require("@vscode/ripgrep");
1724
- function runRipgrep(args, opts) {
1728
+ var resolvedRgPath = null;
1729
+ var rgPathChecked = false;
1730
+ function spawnRg(rgBinary, args, opts) {
1725
1731
  return new Promise((resolve2) => {
1726
- const child = (0, import_child_process.spawn)(import_ripgrep.rgPath, args, {
1732
+ const child = (0, import_child_process.spawn)(rgBinary, args, {
1727
1733
  cwd: opts?.cwd,
1728
1734
  env: { ...process.env, ...opts?.env || {} },
1729
1735
  stdio: ["ignore", "pipe", "pipe"]
@@ -1736,10 +1742,46 @@ function runRipgrep(args, opts) {
1736
1742
  resolve2({ stdout, stderr, exitCode: typeof code === "number" ? code : -1 });
1737
1743
  });
1738
1744
  child.on("error", () => {
1739
- resolve2({ stdout: "", stderr: "Failed to spawn ripgrep (rg). Ensure it is installed.", exitCode: -1 });
1745
+ resolve2({ stdout: "", stderr: "Failed to spawn ripgrep.", exitCode: -1 });
1740
1746
  });
1741
1747
  });
1742
1748
  }
1749
+ function isBinaryFailure(result) {
1750
+ if (result.exitCode === -1) return true;
1751
+ if (result.stderr.includes("jemalloc") || result.stderr.includes("Unsupported system page size")) return true;
1752
+ if (result.exitCode === 134) return true;
1753
+ return false;
1754
+ }
1755
+ async function runRipgrep(args, opts) {
1756
+ if (rgPathChecked && resolvedRgPath) {
1757
+ return spawnRg(resolvedRgPath, args, opts);
1758
+ }
1759
+ if (!rgPathChecked) {
1760
+ const result = await spawnRg(import_ripgrep.rgPath, args, opts);
1761
+ if (!isBinaryFailure(result)) {
1762
+ resolvedRgPath = import_ripgrep.rgPath;
1763
+ rgPathChecked = true;
1764
+ return result;
1765
+ }
1766
+ const fallbackResult = await spawnRg("rg", args, opts);
1767
+ if (!isBinaryFailure(fallbackResult)) {
1768
+ resolvedRgPath = "rg";
1769
+ rgPathChecked = true;
1770
+ return fallbackResult;
1771
+ }
1772
+ rgPathChecked = true;
1773
+ return {
1774
+ stdout: "",
1775
+ stderr: "Failed to spawn ripgrep. Neither bundled nor system rg is available.",
1776
+ exitCode: -1
1777
+ };
1778
+ }
1779
+ return {
1780
+ stdout: "",
1781
+ stderr: "Failed to spawn ripgrep. Neither bundled nor system rg is available.",
1782
+ exitCode: -1
1783
+ };
1784
+ }
1743
1785
 
1744
1786
  // tools/warp_grep/utils/paths.ts
1745
1787
  var import_fs = __toESM(require("fs"), 1);