@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
package/dist/client.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  MorphClient
3
- } from "./chunk-C3LJORIT.js";
4
- import "./chunk-GENFEPHG.js";
5
- import "./chunk-3JVHMOYJ.js";
6
- import "./chunk-5JARN2NG.js";
3
+ } from "./chunk-QFEVCGR6.js";
4
+ import "./chunk-UR76P62F.js";
5
+ import "./chunk-3Q7KXILI.js";
6
+ import "./chunk-A2LIILDJ.js";
7
7
  import "./chunk-KW7OEGZK.js";
8
- import "./chunk-OVNPKTEG.js";
9
- import "./chunk-RBOCP2MX.js";
8
+ import "./chunk-YJXAMX3V.js";
9
+ import "./chunk-QL7MV3GT.js";
10
10
  import "./chunk-PUGSTXLO.js";
11
11
  import "./chunk-3MLWXJTJ.js";
12
- import "./chunk-SNGGSPYJ.js";
12
+ import "./chunk-GHGJAQSJ.js";
13
13
  import "./chunk-FMLHRJDF.js";
14
14
  import "./chunk-5PNMAWLC.js";
15
15
  import "./chunk-APP75CBN.js";
package/dist/index.cjs CHANGED
@@ -2538,9 +2538,23 @@ function parseNestedXmlTools(text) {
2538
2538
  }
2539
2539
  if (files.length > 0) {
2540
2540
  tools.push({ name: "finish", arguments: { files } });
2541
+ } else {
2542
+ const raw = content.replace(/<[^>]*>/g, "").trim();
2543
+ const textResult = !raw || raw === "*" ? "No relevant code found." : raw;
2544
+ tools.push({ name: "finish", arguments: { files: [], textResult } });
2541
2545
  }
2542
2546
  }
2543
2547
  }
2548
+ if (tools.length === 0) {
2549
+ const fnFinishMatch = text.match(/<function=finish>([\s\S]*?)<\/function>/i);
2550
+ if (fnFinishMatch) {
2551
+ const inner = fnFinishMatch[1];
2552
+ const paramMatch = inner.match(/<parameter=result>([\s\S]*?)<\/parameter>/i);
2553
+ const raw = (paramMatch ? paramMatch[1] : inner).trim();
2554
+ const textResult = !raw || raw === "*" ? "No relevant code found." : raw;
2555
+ tools.push({ name: "finish", arguments: { files: [], textResult } });
2556
+ }
2557
+ }
2544
2558
  return tools;
2545
2559
  }
2546
2560
  function preprocessText(text) {
@@ -3167,8 +3181,20 @@ async function runWarpGrep(config) {
3167
3181
  if (finishCalls.length) {
3168
3182
  const fc = finishCalls[0];
3169
3183
  const files = fc.arguments?.files ?? [];
3184
+ const textResult = fc.arguments?.textResult;
3170
3185
  finishMeta = { files };
3171
3186
  terminationReason = "completed";
3187
+ if (files.length === 0) {
3188
+ const payload2 = textResult || "No relevant code found.";
3189
+ timings.turns.push(turnMetrics);
3190
+ timings.total_ms = Date.now() - totalStart;
3191
+ return {
3192
+ terminationReason: "completed",
3193
+ messages,
3194
+ finish: { payload: payload2, metadata: finishMeta },
3195
+ timings
3196
+ };
3197
+ }
3172
3198
  break;
3173
3199
  }
3174
3200
  }
@@ -3321,8 +3347,19 @@ async function* runWarpGrepStreaming(config) {
3321
3347
  if (finishCalls.length) {
3322
3348
  const fc = finishCalls[0];
3323
3349
  const files = fc.arguments?.files ?? [];
3350
+ const textResult = fc.arguments?.textResult;
3324
3351
  finishMeta = { files };
3325
3352
  terminationReason = "completed";
3353
+ if (files.length === 0) {
3354
+ const payload2 = textResult || "No relevant code found.";
3355
+ timings.total_ms = Date.now() - totalStart;
3356
+ return {
3357
+ terminationReason: "completed",
3358
+ messages,
3359
+ finish: { payload: payload2, metadata: finishMeta },
3360
+ timings
3361
+ };
3362
+ }
3326
3363
  break;
3327
3364
  }
3328
3365
  }