@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
@@ -3,7 +3,7 @@ import {
3
3
  } from "../../chunk-L5C6E32T.js";
4
4
  import {
5
5
  LocalRipgrepProvider
6
- } from "../../chunk-YJZP5ZL5.js";
6
+ } from "../../chunk-HMQSMEN2.js";
7
7
  import {
8
8
  fixPathRepetition
9
9
  } from "../../chunk-YPKNMYD4.js";
@@ -18,11 +18,11 @@ import {
18
18
  executeToolCall,
19
19
  executeWarpGrep,
20
20
  formatResult
21
- } from "../../chunk-OVNPKTEG.js";
21
+ } from "../../chunk-G7RSAZIK.js";
22
22
  import {
23
23
  runWarpGrep,
24
24
  runWarpGrepStreaming
25
- } from "../../chunk-RBOCP2MX.js";
25
+ } from "../../chunk-QL7MV3GT.js";
26
26
  import {
27
27
  RemoteCommandsProvider
28
28
  } from "../../chunk-PUGSTXLO.js";
@@ -33,7 +33,7 @@ import {
33
33
  toolListDirectory,
34
34
  toolRead
35
35
  } from "../../chunk-3MLWXJTJ.js";
36
- import "../../chunk-SNGGSPYJ.js";
36
+ import "../../chunk-GHGJAQSJ.js";
37
37
  import {
38
38
  SYSTEM_PROMPT,
39
39
  getSystemPrompt
@@ -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;
@@ -875,9 +880,23 @@ function parseNestedXmlTools(text) {
875
880
  }
876
881
  if (files.length > 0) {
877
882
  tools.push({ name: "finish", arguments: { files } });
883
+ } else {
884
+ const raw = content.replace(/<[^>]*>/g, "").trim();
885
+ const textResult = !raw || raw === "*" ? "No relevant code found." : raw;
886
+ tools.push({ name: "finish", arguments: { files: [], textResult } });
878
887
  }
879
888
  }
880
889
  }
890
+ if (tools.length === 0) {
891
+ const fnFinishMatch = text.match(/<function=finish>([\s\S]*?)<\/function>/i);
892
+ if (fnFinishMatch) {
893
+ const inner = fnFinishMatch[1];
894
+ const paramMatch = inner.match(/<parameter=result>([\s\S]*?)<\/parameter>/i);
895
+ const raw = (paramMatch ? paramMatch[1] : inner).trim();
896
+ const textResult = !raw || raw === "*" ? "No relevant code found." : raw;
897
+ tools.push({ name: "finish", arguments: { files: [], textResult } });
898
+ }
899
+ }
881
900
  return tools;
882
901
  }
883
902
  function preprocessText(text) {
@@ -1504,8 +1523,20 @@ async function runWarpGrep(config) {
1504
1523
  if (finishCalls.length) {
1505
1524
  const fc = finishCalls[0];
1506
1525
  const files = fc.arguments?.files ?? [];
1526
+ const textResult = fc.arguments?.textResult;
1507
1527
  finishMeta = { files };
1508
1528
  terminationReason = "completed";
1529
+ if (files.length === 0) {
1530
+ const payload2 = textResult || "No relevant code found.";
1531
+ timings.turns.push(turnMetrics);
1532
+ timings.total_ms = Date.now() - totalStart;
1533
+ return {
1534
+ terminationReason: "completed",
1535
+ messages,
1536
+ finish: { payload: payload2, metadata: finishMeta },
1537
+ timings
1538
+ };
1539
+ }
1509
1540
  break;
1510
1541
  }
1511
1542
  }