@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
@@ -18,11 +18,11 @@ import {
18
18
  executeToolCall,
19
19
  executeWarpGrep,
20
20
  formatResult
21
- } from "../../chunk-OVNPKTEG.js";
21
+ } from "../../chunk-YJXAMX3V.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
@@ -875,9 +875,23 @@ function parseNestedXmlTools(text) {
875
875
  }
876
876
  if (files.length > 0) {
877
877
  tools.push({ name: "finish", arguments: { files } });
878
+ } else {
879
+ const raw = content.replace(/<[^>]*>/g, "").trim();
880
+ const textResult = !raw || raw === "*" ? "No relevant code found." : raw;
881
+ tools.push({ name: "finish", arguments: { files: [], textResult } });
878
882
  }
879
883
  }
880
884
  }
885
+ if (tools.length === 0) {
886
+ const fnFinishMatch = text.match(/<function=finish>([\s\S]*?)<\/function>/i);
887
+ if (fnFinishMatch) {
888
+ const inner = fnFinishMatch[1];
889
+ const paramMatch = inner.match(/<parameter=result>([\s\S]*?)<\/parameter>/i);
890
+ const raw = (paramMatch ? paramMatch[1] : inner).trim();
891
+ const textResult = !raw || raw === "*" ? "No relevant code found." : raw;
892
+ tools.push({ name: "finish", arguments: { files: [], textResult } });
893
+ }
894
+ }
881
895
  return tools;
882
896
  }
883
897
  function preprocessText(text) {
@@ -1504,8 +1518,20 @@ async function runWarpGrep(config) {
1504
1518
  if (finishCalls.length) {
1505
1519
  const fc = finishCalls[0];
1506
1520
  const files = fc.arguments?.files ?? [];
1521
+ const textResult = fc.arguments?.textResult;
1507
1522
  finishMeta = { files };
1508
1523
  terminationReason = "completed";
1524
+ if (files.length === 0) {
1525
+ const payload2 = textResult || "No relevant code found.";
1526
+ timings.turns.push(turnMetrics);
1527
+ timings.total_ms = Date.now() - totalStart;
1528
+ return {
1529
+ terminationReason: "completed",
1530
+ messages,
1531
+ finish: { payload: payload2, metadata: finishMeta },
1532
+ timings
1533
+ };
1534
+ }
1509
1535
  break;
1510
1536
  }
1511
1537
  }