@morphllm/morphsdk 0.2.116 → 0.2.118

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 (72) hide show
  1. package/dist/{chunk-3JVHMOYJ.js → chunk-3Q7KXILI.js} +2 -2
  2. package/dist/{chunk-SITZC3U6.js → chunk-5IVVJMMX.js} +2 -2
  3. package/dist/{chunk-5JARN2NG.js → chunk-A2LIILDJ.js} +2 -2
  4. package/dist/{chunk-QOEZARHG.js → chunk-EAT5W3SH.js} +2 -2
  5. package/dist/{chunk-SNGGSPYJ.js → chunk-GHGJAQSJ.js} +15 -1
  6. package/dist/chunk-GHGJAQSJ.js.map +1 -0
  7. package/dist/{chunk-25APYVON.js → chunk-PR44LEQQ.js} +2 -2
  8. package/dist/{chunk-62OVBE6G.js → chunk-QFEVCGR6.js} +6 -6
  9. package/dist/{chunk-RBOCP2MX.js → chunk-QL7MV3GT.js} +25 -2
  10. package/dist/chunk-QL7MV3GT.js.map +1 -0
  11. package/dist/{chunk-GENFEPHG.js → chunk-UR76P62F.js} +2 -2
  12. package/dist/{chunk-OVNPKTEG.js → chunk-YJXAMX3V.js} +2 -2
  13. package/dist/{chunk-Q6Y4R236.js → chunk-YTYCHRQ2.js} +7 -9
  14. package/dist/{chunk-Q6Y4R236.js.map → chunk-YTYCHRQ2.js.map} +1 -1
  15. package/dist/{chunk-4IOC2D5Y.js → chunk-ZYPLV3HP.js} +2 -2
  16. package/dist/client.cjs +43 -8
  17. package/dist/client.cjs.map +1 -1
  18. package/dist/client.js +9 -9
  19. package/dist/index.cjs +43 -8
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.js +9 -9
  22. package/dist/tools/browser/anthropic.js +3 -3
  23. package/dist/tools/browser/core.cjs +6 -8
  24. package/dist/tools/browser/core.cjs.map +1 -1
  25. package/dist/tools/browser/core.js +2 -2
  26. package/dist/tools/browser/index.cjs +6 -8
  27. package/dist/tools/browser/index.cjs.map +1 -1
  28. package/dist/tools/browser/index.js +5 -5
  29. package/dist/tools/browser/live.cjs +6 -8
  30. package/dist/tools/browser/live.cjs.map +1 -1
  31. package/dist/tools/browser/live.js +1 -1
  32. package/dist/tools/browser/openai.js +3 -3
  33. package/dist/tools/browser/vercel.js +3 -3
  34. package/dist/tools/warp_grep/agent/parser.cjs +14 -0
  35. package/dist/tools/warp_grep/agent/parser.cjs.map +1 -1
  36. package/dist/tools/warp_grep/agent/parser.js +1 -1
  37. package/dist/tools/warp_grep/agent/runner.cjs +37 -0
  38. package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
  39. package/dist/tools/warp_grep/agent/runner.js +2 -2
  40. package/dist/tools/warp_grep/anthropic.cjs +26 -0
  41. package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
  42. package/dist/tools/warp_grep/anthropic.js +4 -4
  43. package/dist/tools/warp_grep/client.cjs +37 -0
  44. package/dist/tools/warp_grep/client.cjs.map +1 -1
  45. package/dist/tools/warp_grep/client.js +3 -3
  46. package/dist/tools/warp_grep/gemini.cjs +26 -0
  47. package/dist/tools/warp_grep/gemini.cjs.map +1 -1
  48. package/dist/tools/warp_grep/gemini.js +3 -3
  49. package/dist/tools/warp_grep/harness.cjs +14 -0
  50. package/dist/tools/warp_grep/harness.cjs.map +1 -1
  51. package/dist/tools/warp_grep/harness.js +1 -1
  52. package/dist/tools/warp_grep/index.cjs +37 -0
  53. package/dist/tools/warp_grep/index.cjs.map +1 -1
  54. package/dist/tools/warp_grep/index.js +3 -3
  55. package/dist/tools/warp_grep/openai.cjs +26 -0
  56. package/dist/tools/warp_grep/openai.cjs.map +1 -1
  57. package/dist/tools/warp_grep/openai.js +4 -4
  58. package/dist/tools/warp_grep/vercel.cjs +37 -0
  59. package/dist/tools/warp_grep/vercel.cjs.map +1 -1
  60. package/dist/tools/warp_grep/vercel.js +4 -4
  61. package/package.json +1 -1
  62. package/dist/chunk-RBOCP2MX.js.map +0 -1
  63. package/dist/chunk-SNGGSPYJ.js.map +0 -1
  64. /package/dist/{chunk-3JVHMOYJ.js.map → chunk-3Q7KXILI.js.map} +0 -0
  65. /package/dist/{chunk-SITZC3U6.js.map → chunk-5IVVJMMX.js.map} +0 -0
  66. /package/dist/{chunk-5JARN2NG.js.map → chunk-A2LIILDJ.js.map} +0 -0
  67. /package/dist/{chunk-QOEZARHG.js.map → chunk-EAT5W3SH.js.map} +0 -0
  68. /package/dist/{chunk-25APYVON.js.map → chunk-PR44LEQQ.js.map} +0 -0
  69. /package/dist/{chunk-62OVBE6G.js.map → chunk-QFEVCGR6.js.map} +0 -0
  70. /package/dist/{chunk-GENFEPHG.js.map → chunk-UR76P62F.js.map} +0 -0
  71. /package/dist/{chunk-OVNPKTEG.js.map → chunk-YJXAMX3V.js.map} +0 -0
  72. /package/dist/{chunk-4IOC2D5Y.js.map → chunk-ZYPLV3HP.js.map} +0 -0
@@ -3,15 +3,15 @@ import {
3
3
  execute,
4
4
  openai_default,
5
5
  warpGrepTool
6
- } from "../../chunk-GENFEPHG.js";
6
+ } from "../../chunk-UR76P62F.js";
7
7
  import "../../chunk-KW7OEGZK.js";
8
8
  import {
9
9
  formatResult
10
- } from "../../chunk-OVNPKTEG.js";
11
- import "../../chunk-RBOCP2MX.js";
10
+ } from "../../chunk-YJXAMX3V.js";
11
+ import "../../chunk-QL7MV3GT.js";
12
12
  import "../../chunk-PUGSTXLO.js";
13
13
  import "../../chunk-3MLWXJTJ.js";
14
- import "../../chunk-SNGGSPYJ.js";
14
+ import "../../chunk-GHGJAQSJ.js";
15
15
  import {
16
16
  getSystemPrompt
17
17
  } from "../../chunk-FMLHRJDF.js";
@@ -877,9 +877,23 @@ function parseNestedXmlTools(text) {
877
877
  }
878
878
  if (files.length > 0) {
879
879
  tools.push({ name: "finish", arguments: { files } });
880
+ } else {
881
+ const raw = content.replace(/<[^>]*>/g, "").trim();
882
+ const textResult = !raw || raw === "*" ? "No relevant code found." : raw;
883
+ tools.push({ name: "finish", arguments: { files: [], textResult } });
880
884
  }
881
885
  }
882
886
  }
887
+ if (tools.length === 0) {
888
+ const fnFinishMatch = text.match(/<function=finish>([\s\S]*?)<\/function>/i);
889
+ if (fnFinishMatch) {
890
+ const inner = fnFinishMatch[1];
891
+ const paramMatch = inner.match(/<parameter=result>([\s\S]*?)<\/parameter>/i);
892
+ const raw = (paramMatch ? paramMatch[1] : inner).trim();
893
+ const textResult = !raw || raw === "*" ? "No relevant code found." : raw;
894
+ tools.push({ name: "finish", arguments: { files: [], textResult } });
895
+ }
896
+ }
883
897
  return tools;
884
898
  }
885
899
  function preprocessText(text) {
@@ -1506,8 +1520,20 @@ async function runWarpGrep(config) {
1506
1520
  if (finishCalls.length) {
1507
1521
  const fc = finishCalls[0];
1508
1522
  const files = fc.arguments?.files ?? [];
1523
+ const textResult = fc.arguments?.textResult;
1509
1524
  finishMeta = { files };
1510
1525
  terminationReason = "completed";
1526
+ if (files.length === 0) {
1527
+ const payload2 = textResult || "No relevant code found.";
1528
+ timings.turns.push(turnMetrics);
1529
+ timings.total_ms = Date.now() - totalStart;
1530
+ return {
1531
+ terminationReason: "completed",
1532
+ messages,
1533
+ finish: { payload: payload2, metadata: finishMeta },
1534
+ timings
1535
+ };
1536
+ }
1511
1537
  break;
1512
1538
  }
1513
1539
  }
@@ -1660,8 +1686,19 @@ async function* runWarpGrepStreaming(config) {
1660
1686
  if (finishCalls.length) {
1661
1687
  const fc = finishCalls[0];
1662
1688
  const files = fc.arguments?.files ?? [];
1689
+ const textResult = fc.arguments?.textResult;
1663
1690
  finishMeta = { files };
1664
1691
  terminationReason = "completed";
1692
+ if (files.length === 0) {
1693
+ const payload2 = textResult || "No relevant code found.";
1694
+ timings.total_ms = Date.now() - totalStart;
1695
+ return {
1696
+ terminationReason: "completed",
1697
+ messages,
1698
+ finish: { payload: payload2, metadata: finishMeta },
1699
+ timings
1700
+ };
1701
+ }
1665
1702
  break;
1666
1703
  }
1667
1704
  }