@morphllm/morphsdk 0.2.46 → 0.2.48

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 (41) hide show
  1. package/dist/{chunk-5JTJOQUX.js → chunk-AJ6X4STK.js} +5 -5
  2. package/dist/{chunk-UXYK7WZX.js → chunk-KM6V456Q.js} +2 -2
  3. package/dist/{chunk-7T7YOPJV.js → chunk-NHOPUGBN.js} +3 -3
  4. package/dist/chunk-TPP2UGQP.js +65 -0
  5. package/dist/chunk-TPP2UGQP.js.map +1 -0
  6. package/dist/{chunk-CL45IWIU.js → chunk-WI23KSNI.js} +2 -2
  7. package/dist/{chunk-D6OD3IST.js → chunk-YQVSMU24.js} +3 -3
  8. package/dist/{chunk-PABIV7X6.js → chunk-ZGK6OGK3.js} +3 -3
  9. package/dist/client.cjs +42 -3
  10. package/dist/client.cjs.map +1 -1
  11. package/dist/client.js +7 -7
  12. package/dist/index.cjs +42 -3
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.js +7 -7
  15. package/dist/tools/warp_grep/anthropic.cjs +42 -3
  16. package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
  17. package/dist/tools/warp_grep/anthropic.js +4 -4
  18. package/dist/tools/warp_grep/index.cjs +42 -3
  19. package/dist/tools/warp_grep/index.cjs.map +1 -1
  20. package/dist/tools/warp_grep/index.js +6 -6
  21. package/dist/tools/warp_grep/openai.cjs +42 -3
  22. package/dist/tools/warp_grep/openai.cjs.map +1 -1
  23. package/dist/tools/warp_grep/openai.js +4 -4
  24. package/dist/tools/warp_grep/providers/local.cjs +42 -3
  25. package/dist/tools/warp_grep/providers/local.cjs.map +1 -1
  26. package/dist/tools/warp_grep/providers/local.js +2 -2
  27. package/dist/tools/warp_grep/utils/ripgrep.cjs +42 -3
  28. package/dist/tools/warp_grep/utils/ripgrep.cjs.map +1 -1
  29. package/dist/tools/warp_grep/utils/ripgrep.js +1 -1
  30. package/dist/tools/warp_grep/vercel.cjs +42 -3
  31. package/dist/tools/warp_grep/vercel.cjs.map +1 -1
  32. package/dist/tools/warp_grep/vercel.js +4 -4
  33. package/package.json +2 -1
  34. package/dist/chunk-RSLIOCOE.js +0 -26
  35. package/dist/chunk-RSLIOCOE.js.map +0 -1
  36. /package/dist/{chunk-5JTJOQUX.js.map → chunk-AJ6X4STK.js.map} +0 -0
  37. /package/dist/{chunk-UXYK7WZX.js.map → chunk-KM6V456Q.js.map} +0 -0
  38. /package/dist/{chunk-7T7YOPJV.js.map → chunk-NHOPUGBN.js.map} +0 -0
  39. /package/dist/{chunk-CL45IWIU.js.map → chunk-WI23KSNI.js.map} +0 -0
  40. /package/dist/{chunk-D6OD3IST.js.map → chunk-YQVSMU24.js.map} +0 -0
  41. /package/dist/{chunk-PABIV7X6.js.map → chunk-ZGK6OGK3.js.map} +0 -0
package/dist/client.js CHANGED
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  MorphClient
3
- } from "./chunk-5JTJOQUX.js";
4
- import "./chunk-PABIV7X6.js";
5
- import "./chunk-7T7YOPJV.js";
6
- import "./chunk-D6OD3IST.js";
7
- import "./chunk-CL45IWIU.js";
3
+ } from "./chunk-AJ6X4STK.js";
4
+ import "./chunk-ZGK6OGK3.js";
5
+ import "./chunk-NHOPUGBN.js";
6
+ import "./chunk-YQVSMU24.js";
7
+ import "./chunk-WI23KSNI.js";
8
8
  import "./chunk-7HS6YXA3.js";
9
9
  import "./chunk-EK7OQPWD.js";
10
10
  import "./chunk-Z2FBMSNE.js";
11
11
  import "./chunk-SWQPIKPY.js";
12
12
  import "./chunk-WETRQJGU.js";
13
- import "./chunk-UXYK7WZX.js";
13
+ import "./chunk-KM6V456Q.js";
14
14
  import "./chunk-G2RSY56Q.js";
15
15
  import "./chunk-SMGZ6A64.js";
16
- import "./chunk-RSLIOCOE.js";
16
+ import "./chunk-TPP2UGQP.js";
17
17
  import "./chunk-73RQWOQC.js";
18
18
  import "./chunk-TJIUA27P.js";
19
19
  import "./chunk-TICMYDII.js";
package/dist/index.cjs CHANGED
@@ -1720,9 +1720,12 @@ var import_path4 = __toESM(require("path"), 1);
1720
1720
 
1721
1721
  // tools/warp_grep/utils/ripgrep.ts
1722
1722
  var import_child_process = require("child_process");
1723
- function runRipgrep(args, opts) {
1723
+ var import_ripgrep = require("@vscode/ripgrep");
1724
+ var resolvedRgPath = null;
1725
+ var rgPathChecked = false;
1726
+ function spawnRg(rgBinary, args, opts) {
1724
1727
  return new Promise((resolve2) => {
1725
- const child = (0, import_child_process.spawn)("rg", args, {
1728
+ const child = (0, import_child_process.spawn)(rgBinary, args, {
1726
1729
  cwd: opts?.cwd,
1727
1730
  env: { ...process.env, ...opts?.env || {} },
1728
1731
  stdio: ["ignore", "pipe", "pipe"]
@@ -1735,10 +1738,46 @@ function runRipgrep(args, opts) {
1735
1738
  resolve2({ stdout, stderr, exitCode: typeof code === "number" ? code : -1 });
1736
1739
  });
1737
1740
  child.on("error", () => {
1738
- resolve2({ stdout: "", stderr: "Failed to spawn ripgrep (rg). Ensure it is installed.", exitCode: -1 });
1741
+ resolve2({ stdout: "", stderr: "Failed to spawn ripgrep.", exitCode: -1 });
1739
1742
  });
1740
1743
  });
1741
1744
  }
1745
+ function isBinaryFailure(result) {
1746
+ if (result.exitCode === -1) return true;
1747
+ if (result.stderr.includes("jemalloc") || result.stderr.includes("Unsupported system page size")) return true;
1748
+ if (result.exitCode === 134) return true;
1749
+ return false;
1750
+ }
1751
+ async function runRipgrep(args, opts) {
1752
+ if (rgPathChecked && resolvedRgPath) {
1753
+ return spawnRg(resolvedRgPath, args, opts);
1754
+ }
1755
+ if (!rgPathChecked) {
1756
+ const result = await spawnRg(import_ripgrep.rgPath, args, opts);
1757
+ if (!isBinaryFailure(result)) {
1758
+ resolvedRgPath = import_ripgrep.rgPath;
1759
+ rgPathChecked = true;
1760
+ return result;
1761
+ }
1762
+ const fallbackResult = await spawnRg("rg", args, opts);
1763
+ if (!isBinaryFailure(fallbackResult)) {
1764
+ resolvedRgPath = "rg";
1765
+ rgPathChecked = true;
1766
+ return fallbackResult;
1767
+ }
1768
+ rgPathChecked = true;
1769
+ return {
1770
+ stdout: "",
1771
+ stderr: "Failed to spawn ripgrep. Neither bundled nor system rg is available.",
1772
+ exitCode: -1
1773
+ };
1774
+ }
1775
+ return {
1776
+ stdout: "",
1777
+ stderr: "Failed to spawn ripgrep. Neither bundled nor system rg is available.",
1778
+ exitCode: -1
1779
+ };
1780
+ }
1742
1781
 
1743
1782
  // tools/warp_grep/utils/paths.ts
1744
1783
  var import_fs = __toESM(require("fs"), 1);