@morphllm/morphsdk 0.2.117 → 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 (50) hide show
  1. package/dist/{chunk-3JVHMOYJ.js → chunk-3Q7KXILI.js} +2 -2
  2. package/dist/{chunk-5JARN2NG.js → chunk-A2LIILDJ.js} +2 -2
  3. package/dist/{chunk-SNGGSPYJ.js → chunk-GHGJAQSJ.js} +15 -1
  4. package/dist/chunk-GHGJAQSJ.js.map +1 -0
  5. package/dist/{chunk-C3LJORIT.js → chunk-QFEVCGR6.js} +5 -5
  6. package/dist/{chunk-RBOCP2MX.js → chunk-QL7MV3GT.js} +25 -2
  7. package/dist/chunk-QL7MV3GT.js.map +1 -0
  8. package/dist/{chunk-GENFEPHG.js → chunk-UR76P62F.js} +2 -2
  9. package/dist/{chunk-OVNPKTEG.js → chunk-YJXAMX3V.js} +2 -2
  10. package/dist/client.cjs +37 -0
  11. package/dist/client.cjs.map +1 -1
  12. package/dist/client.js +7 -7
  13. package/dist/index.cjs +37 -0
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.js +7 -7
  16. package/dist/tools/warp_grep/agent/parser.cjs +14 -0
  17. package/dist/tools/warp_grep/agent/parser.cjs.map +1 -1
  18. package/dist/tools/warp_grep/agent/parser.js +1 -1
  19. package/dist/tools/warp_grep/agent/runner.cjs +37 -0
  20. package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
  21. package/dist/tools/warp_grep/agent/runner.js +2 -2
  22. package/dist/tools/warp_grep/anthropic.cjs +26 -0
  23. package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
  24. package/dist/tools/warp_grep/anthropic.js +4 -4
  25. package/dist/tools/warp_grep/client.cjs +37 -0
  26. package/dist/tools/warp_grep/client.cjs.map +1 -1
  27. package/dist/tools/warp_grep/client.js +3 -3
  28. package/dist/tools/warp_grep/gemini.cjs +26 -0
  29. package/dist/tools/warp_grep/gemini.cjs.map +1 -1
  30. package/dist/tools/warp_grep/gemini.js +3 -3
  31. package/dist/tools/warp_grep/harness.cjs +14 -0
  32. package/dist/tools/warp_grep/harness.cjs.map +1 -1
  33. package/dist/tools/warp_grep/harness.js +1 -1
  34. package/dist/tools/warp_grep/index.cjs +37 -0
  35. package/dist/tools/warp_grep/index.cjs.map +1 -1
  36. package/dist/tools/warp_grep/index.js +3 -3
  37. package/dist/tools/warp_grep/openai.cjs +26 -0
  38. package/dist/tools/warp_grep/openai.cjs.map +1 -1
  39. package/dist/tools/warp_grep/openai.js +4 -4
  40. package/dist/tools/warp_grep/vercel.cjs +37 -0
  41. package/dist/tools/warp_grep/vercel.cjs.map +1 -1
  42. package/dist/tools/warp_grep/vercel.js +4 -4
  43. package/package.json +1 -1
  44. package/dist/chunk-RBOCP2MX.js.map +0 -1
  45. package/dist/chunk-SNGGSPYJ.js.map +0 -1
  46. /package/dist/{chunk-3JVHMOYJ.js.map → chunk-3Q7KXILI.js.map} +0 -0
  47. /package/dist/{chunk-5JARN2NG.js.map → chunk-A2LIILDJ.js.map} +0 -0
  48. /package/dist/{chunk-C3LJORIT.js.map → chunk-QFEVCGR6.js.map} +0 -0
  49. /package/dist/{chunk-GENFEPHG.js.map → chunk-UR76P62F.js.map} +0 -0
  50. /package/dist/{chunk-OVNPKTEG.js.map → chunk-YJXAMX3V.js.map} +0 -0
@@ -2,15 +2,15 @@ import {
2
2
  createWarpGrepTool,
3
3
  execute,
4
4
  warpGrepTool
5
- } from "../../chunk-5JARN2NG.js";
5
+ } from "../../chunk-A2LIILDJ.js";
6
6
  import "../../chunk-KW7OEGZK.js";
7
7
  import {
8
8
  formatResult
9
- } from "../../chunk-OVNPKTEG.js";
10
- import "../../chunk-RBOCP2MX.js";
9
+ } from "../../chunk-YJXAMX3V.js";
10
+ import "../../chunk-QL7MV3GT.js";
11
11
  import "../../chunk-PUGSTXLO.js";
12
12
  import "../../chunk-3MLWXJTJ.js";
13
- import "../../chunk-SNGGSPYJ.js";
13
+ import "../../chunk-GHGJAQSJ.js";
14
14
  import {
15
15
  getSystemPrompt
16
16
  } from "../../chunk-FMLHRJDF.js";
@@ -874,9 +874,23 @@ function parseNestedXmlTools(text) {
874
874
  }
875
875
  if (files.length > 0) {
876
876
  tools.push({ name: "finish", arguments: { files } });
877
+ } else {
878
+ const raw = content.replace(/<[^>]*>/g, "").trim();
879
+ const textResult = !raw || raw === "*" ? "No relevant code found." : raw;
880
+ tools.push({ name: "finish", arguments: { files: [], textResult } });
877
881
  }
878
882
  }
879
883
  }
884
+ if (tools.length === 0) {
885
+ const fnFinishMatch = text.match(/<function=finish>([\s\S]*?)<\/function>/i);
886
+ if (fnFinishMatch) {
887
+ const inner = fnFinishMatch[1];
888
+ const paramMatch = inner.match(/<parameter=result>([\s\S]*?)<\/parameter>/i);
889
+ const raw = (paramMatch ? paramMatch[1] : inner).trim();
890
+ const textResult = !raw || raw === "*" ? "No relevant code found." : raw;
891
+ tools.push({ name: "finish", arguments: { files: [], textResult } });
892
+ }
893
+ }
880
894
  return tools;
881
895
  }
882
896
  function preprocessText(text) {
@@ -1503,8 +1517,20 @@ async function runWarpGrep(config) {
1503
1517
  if (finishCalls.length) {
1504
1518
  const fc = finishCalls[0];
1505
1519
  const files = fc.arguments?.files ?? [];
1520
+ const textResult = fc.arguments?.textResult;
1506
1521
  finishMeta = { files };
1507
1522
  terminationReason = "completed";
1523
+ if (files.length === 0) {
1524
+ const payload2 = textResult || "No relevant code found.";
1525
+ timings.turns.push(turnMetrics);
1526
+ timings.total_ms = Date.now() - totalStart;
1527
+ return {
1528
+ terminationReason: "completed",
1529
+ messages,
1530
+ finish: { payload: payload2, metadata: finishMeta },
1531
+ timings
1532
+ };
1533
+ }
1508
1534
  break;
1509
1535
  }
1510
1536
  }
@@ -1657,8 +1683,19 @@ async function* runWarpGrepStreaming(config) {
1657
1683
  if (finishCalls.length) {
1658
1684
  const fc = finishCalls[0];
1659
1685
  const files = fc.arguments?.files ?? [];
1686
+ const textResult = fc.arguments?.textResult;
1660
1687
  finishMeta = { files };
1661
1688
  terminationReason = "completed";
1689
+ if (files.length === 0) {
1690
+ const payload2 = textResult || "No relevant code found.";
1691
+ timings.total_ms = Date.now() - totalStart;
1692
+ return {
1693
+ terminationReason: "completed",
1694
+ messages,
1695
+ finish: { payload: payload2, metadata: finishMeta },
1696
+ timings
1697
+ };
1698
+ }
1662
1699
  break;
1663
1700
  }
1664
1701
  }