@morphllm/morphsdk 0.2.117 → 0.2.119

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 (55) hide show
  1. package/dist/{chunk-C3LJORIT.js → chunk-3T4BGWCV.js} +5 -5
  2. package/dist/{chunk-OVNPKTEG.js → chunk-G7RSAZIK.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-YJZP5ZL5.js → chunk-HMQSMEN2.js} +7 -2
  6. package/dist/{chunk-YJZP5ZL5.js.map → chunk-HMQSMEN2.js.map} +1 -1
  7. package/dist/{chunk-3JVHMOYJ.js → chunk-K4EO7S2O.js} +2 -2
  8. package/dist/{chunk-5JARN2NG.js → chunk-OOCSNAA5.js} +2 -2
  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-WVTX3QS6.js} +2 -2
  12. package/dist/client.cjs +43 -1
  13. package/dist/client.cjs.map +1 -1
  14. package/dist/client.js +7 -7
  15. package/dist/index.cjs +43 -1
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.js +8 -8
  18. package/dist/tools/warp_grep/agent/parser.cjs +14 -0
  19. package/dist/tools/warp_grep/agent/parser.cjs.map +1 -1
  20. package/dist/tools/warp_grep/agent/parser.js +1 -1
  21. package/dist/tools/warp_grep/agent/runner.cjs +37 -0
  22. package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
  23. package/dist/tools/warp_grep/agent/runner.js +2 -2
  24. package/dist/tools/warp_grep/anthropic.cjs +32 -1
  25. package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
  26. package/dist/tools/warp_grep/anthropic.js +4 -4
  27. package/dist/tools/warp_grep/client.cjs +43 -1
  28. package/dist/tools/warp_grep/client.cjs.map +1 -1
  29. package/dist/tools/warp_grep/client.js +3 -3
  30. package/dist/tools/warp_grep/gemini.cjs +32 -1
  31. package/dist/tools/warp_grep/gemini.cjs.map +1 -1
  32. package/dist/tools/warp_grep/gemini.js +3 -3
  33. package/dist/tools/warp_grep/harness.cjs +20 -1
  34. package/dist/tools/warp_grep/harness.cjs.map +1 -1
  35. package/dist/tools/warp_grep/harness.js +2 -2
  36. package/dist/tools/warp_grep/index.cjs +43 -1
  37. package/dist/tools/warp_grep/index.cjs.map +1 -1
  38. package/dist/tools/warp_grep/index.js +4 -4
  39. package/dist/tools/warp_grep/openai.cjs +32 -1
  40. package/dist/tools/warp_grep/openai.cjs.map +1 -1
  41. package/dist/tools/warp_grep/openai.js +4 -4
  42. package/dist/tools/warp_grep/providers/local.cjs +6 -1
  43. package/dist/tools/warp_grep/providers/local.cjs.map +1 -1
  44. package/dist/tools/warp_grep/providers/local.js +1 -1
  45. package/dist/tools/warp_grep/vercel.cjs +43 -1
  46. package/dist/tools/warp_grep/vercel.cjs.map +1 -1
  47. package/dist/tools/warp_grep/vercel.js +4 -4
  48. package/package.json +1 -1
  49. package/dist/chunk-RBOCP2MX.js.map +0 -1
  50. package/dist/chunk-SNGGSPYJ.js.map +0 -1
  51. /package/dist/{chunk-C3LJORIT.js.map → chunk-3T4BGWCV.js.map} +0 -0
  52. /package/dist/{chunk-OVNPKTEG.js.map → chunk-G7RSAZIK.js.map} +0 -0
  53. /package/dist/{chunk-3JVHMOYJ.js.map → chunk-K4EO7S2O.js.map} +0 -0
  54. /package/dist/{chunk-5JARN2NG.js.map → chunk-OOCSNAA5.js.map} +0 -0
  55. /package/dist/{chunk-GENFEPHG.js.map → chunk-WVTX3QS6.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-OOCSNAA5.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-G7RSAZIK.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";
@@ -539,7 +539,12 @@ Details: ${res.stderr}` : ""}`
539
539
  return;
540
540
  }
541
541
  if (depth > maxDepth || results.length >= maxResults) return;
542
- const entries = await import_promises2.default.readdir(dir, { withFileTypes: true });
542
+ let entries;
543
+ try {
544
+ entries = await import_promises2.default.readdir(dir, { withFileTypes: true });
545
+ } catch {
546
+ return;
547
+ }
543
548
  for (const entry of entries) {
544
549
  if (timedOut || results.length >= maxResults) break;
545
550
  if (shouldSkip2(entry.name)) continue;
@@ -874,9 +879,23 @@ function parseNestedXmlTools(text) {
874
879
  }
875
880
  if (files.length > 0) {
876
881
  tools.push({ name: "finish", arguments: { files } });
882
+ } else {
883
+ const raw = content.replace(/<[^>]*>/g, "").trim();
884
+ const textResult = !raw || raw === "*" ? "No relevant code found." : raw;
885
+ tools.push({ name: "finish", arguments: { files: [], textResult } });
877
886
  }
878
887
  }
879
888
  }
889
+ if (tools.length === 0) {
890
+ const fnFinishMatch = text.match(/<function=finish>([\s\S]*?)<\/function>/i);
891
+ if (fnFinishMatch) {
892
+ const inner = fnFinishMatch[1];
893
+ const paramMatch = inner.match(/<parameter=result>([\s\S]*?)<\/parameter>/i);
894
+ const raw = (paramMatch ? paramMatch[1] : inner).trim();
895
+ const textResult = !raw || raw === "*" ? "No relevant code found." : raw;
896
+ tools.push({ name: "finish", arguments: { files: [], textResult } });
897
+ }
898
+ }
880
899
  return tools;
881
900
  }
882
901
  function preprocessText(text) {
@@ -1503,8 +1522,20 @@ async function runWarpGrep(config) {
1503
1522
  if (finishCalls.length) {
1504
1523
  const fc = finishCalls[0];
1505
1524
  const files = fc.arguments?.files ?? [];
1525
+ const textResult = fc.arguments?.textResult;
1506
1526
  finishMeta = { files };
1507
1527
  terminationReason = "completed";
1528
+ if (files.length === 0) {
1529
+ const payload2 = textResult || "No relevant code found.";
1530
+ timings.turns.push(turnMetrics);
1531
+ timings.total_ms = Date.now() - totalStart;
1532
+ return {
1533
+ terminationReason: "completed",
1534
+ messages,
1535
+ finish: { payload: payload2, metadata: finishMeta },
1536
+ timings
1537
+ };
1538
+ }
1508
1539
  break;
1509
1540
  }
1510
1541
  }
@@ -1657,8 +1688,19 @@ async function* runWarpGrepStreaming(config) {
1657
1688
  if (finishCalls.length) {
1658
1689
  const fc = finishCalls[0];
1659
1690
  const files = fc.arguments?.files ?? [];
1691
+ const textResult = fc.arguments?.textResult;
1660
1692
  finishMeta = { files };
1661
1693
  terminationReason = "completed";
1694
+ if (files.length === 0) {
1695
+ const payload2 = textResult || "No relevant code found.";
1696
+ timings.total_ms = Date.now() - totalStart;
1697
+ return {
1698
+ terminationReason: "completed",
1699
+ messages,
1700
+ finish: { payload: payload2, metadata: finishMeta },
1701
+ timings
1702
+ };
1703
+ }
1662
1704
  break;
1663
1705
  }
1664
1706
  }