@morphllm/morphsdk 0.2.116 → 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 (72) hide show
  1. package/dist/{chunk-3JVHMOYJ.js → chunk-3Q7KXILI.js} +2 -2
  2. package/dist/{chunk-SITZC3U6.js → chunk-5IVVJMMX.js} +2 -2
  3. package/dist/{chunk-5JARN2NG.js → chunk-A2LIILDJ.js} +2 -2
  4. package/dist/{chunk-QOEZARHG.js → chunk-EAT5W3SH.js} +2 -2
  5. package/dist/{chunk-SNGGSPYJ.js → chunk-GHGJAQSJ.js} +15 -1
  6. package/dist/chunk-GHGJAQSJ.js.map +1 -0
  7. package/dist/{chunk-25APYVON.js → chunk-PR44LEQQ.js} +2 -2
  8. package/dist/{chunk-62OVBE6G.js → chunk-QFEVCGR6.js} +6 -6
  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-UR76P62F.js} +2 -2
  12. package/dist/{chunk-OVNPKTEG.js → chunk-YJXAMX3V.js} +2 -2
  13. package/dist/{chunk-Q6Y4R236.js → chunk-YTYCHRQ2.js} +7 -9
  14. package/dist/{chunk-Q6Y4R236.js.map → chunk-YTYCHRQ2.js.map} +1 -1
  15. package/dist/{chunk-4IOC2D5Y.js → chunk-ZYPLV3HP.js} +2 -2
  16. package/dist/client.cjs +43 -8
  17. package/dist/client.cjs.map +1 -1
  18. package/dist/client.js +9 -9
  19. package/dist/index.cjs +43 -8
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.js +9 -9
  22. package/dist/tools/browser/anthropic.js +3 -3
  23. package/dist/tools/browser/core.cjs +6 -8
  24. package/dist/tools/browser/core.cjs.map +1 -1
  25. package/dist/tools/browser/core.js +2 -2
  26. package/dist/tools/browser/index.cjs +6 -8
  27. package/dist/tools/browser/index.cjs.map +1 -1
  28. package/dist/tools/browser/index.js +5 -5
  29. package/dist/tools/browser/live.cjs +6 -8
  30. package/dist/tools/browser/live.cjs.map +1 -1
  31. package/dist/tools/browser/live.js +1 -1
  32. package/dist/tools/browser/openai.js +3 -3
  33. package/dist/tools/browser/vercel.js +3 -3
  34. package/dist/tools/warp_grep/agent/parser.cjs +14 -0
  35. package/dist/tools/warp_grep/agent/parser.cjs.map +1 -1
  36. package/dist/tools/warp_grep/agent/parser.js +1 -1
  37. package/dist/tools/warp_grep/agent/runner.cjs +37 -0
  38. package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
  39. package/dist/tools/warp_grep/agent/runner.js +2 -2
  40. package/dist/tools/warp_grep/anthropic.cjs +26 -0
  41. package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
  42. package/dist/tools/warp_grep/anthropic.js +4 -4
  43. package/dist/tools/warp_grep/client.cjs +37 -0
  44. package/dist/tools/warp_grep/client.cjs.map +1 -1
  45. package/dist/tools/warp_grep/client.js +3 -3
  46. package/dist/tools/warp_grep/gemini.cjs +26 -0
  47. package/dist/tools/warp_grep/gemini.cjs.map +1 -1
  48. package/dist/tools/warp_grep/gemini.js +3 -3
  49. package/dist/tools/warp_grep/harness.cjs +14 -0
  50. package/dist/tools/warp_grep/harness.cjs.map +1 -1
  51. package/dist/tools/warp_grep/harness.js +1 -1
  52. package/dist/tools/warp_grep/index.cjs +37 -0
  53. package/dist/tools/warp_grep/index.cjs.map +1 -1
  54. package/dist/tools/warp_grep/index.js +3 -3
  55. package/dist/tools/warp_grep/openai.cjs +26 -0
  56. package/dist/tools/warp_grep/openai.cjs.map +1 -1
  57. package/dist/tools/warp_grep/openai.js +4 -4
  58. package/dist/tools/warp_grep/vercel.cjs +37 -0
  59. package/dist/tools/warp_grep/vercel.cjs.map +1 -1
  60. package/dist/tools/warp_grep/vercel.js +4 -4
  61. package/package.json +1 -1
  62. package/dist/chunk-RBOCP2MX.js.map +0 -1
  63. package/dist/chunk-SNGGSPYJ.js.map +0 -1
  64. /package/dist/{chunk-3JVHMOYJ.js.map → chunk-3Q7KXILI.js.map} +0 -0
  65. /package/dist/{chunk-SITZC3U6.js.map → chunk-5IVVJMMX.js.map} +0 -0
  66. /package/dist/{chunk-5JARN2NG.js.map → chunk-A2LIILDJ.js.map} +0 -0
  67. /package/dist/{chunk-QOEZARHG.js.map → chunk-EAT5W3SH.js.map} +0 -0
  68. /package/dist/{chunk-25APYVON.js.map → chunk-PR44LEQQ.js.map} +0 -0
  69. /package/dist/{chunk-62OVBE6G.js.map → chunk-QFEVCGR6.js.map} +0 -0
  70. /package/dist/{chunk-GENFEPHG.js.map → chunk-UR76P62F.js.map} +0 -0
  71. /package/dist/{chunk-OVNPKTEG.js.map → chunk-YJXAMX3V.js.map} +0 -0
  72. /package/dist/{chunk-4IOC2D5Y.js.map → chunk-ZYPLV3HP.js.map} +0 -0
package/dist/client.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  MorphClient
3
- } from "./chunk-62OVBE6G.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";
@@ -23,11 +23,11 @@ import "./chunk-Y5BB7JFH.js";
23
23
  import "./chunk-UNHHRMU7.js";
24
24
  import "./chunk-63WE2C5R.js";
25
25
  import "./chunk-M5DR2WOZ.js";
26
- import "./chunk-4IOC2D5Y.js";
26
+ import "./chunk-ZYPLV3HP.js";
27
27
  import "./chunk-SI2CKRKJ.js";
28
28
  import "./chunk-2AMEQAO2.js";
29
29
  import "./chunk-2VERUKO2.js";
30
- import "./chunk-Q6Y4R236.js";
30
+ import "./chunk-YTYCHRQ2.js";
31
31
  import "./chunk-FXBT4UDY.js";
32
32
  import "./chunk-GZMUGMOZ.js";
33
33
  import "./chunk-LE66XCOI.js";
package/dist/index.cjs CHANGED
@@ -1024,13 +1024,14 @@ function buildLiveUrl(debugUrl, options = {}) {
1024
1024
  }
1025
1025
  return url.toString();
1026
1026
  }
1027
+ function cdpToHttps(wsUrl) {
1028
+ return wsUrl.replace(/^wss:\/\//, "https://").replace(/^ws:\/\//, "http://");
1029
+ }
1027
1030
  function normalizeLiveUrl(debugUrl) {
1028
1031
  const trimmed = debugUrl.trim();
1029
- if (!trimmed) {
1030
- return trimmed;
1031
- }
1032
+ if (!trimmed) return trimmed;
1032
1033
  if (trimmed.startsWith("wss://") || trimmed.startsWith("ws://")) {
1033
- return `https://live.browser-use.com?wss=${encodeURIComponent(trimmed)}`;
1034
+ return `https://live.browser-use.com?wss=${encodeURIComponent(cdpToHttps(trimmed))}`;
1034
1035
  }
1035
1036
  let url;
1036
1037
  try {
@@ -1038,12 +1039,9 @@ function normalizeLiveUrl(debugUrl) {
1038
1039
  } catch {
1039
1040
  return trimmed;
1040
1041
  }
1041
- if (url.protocol === "wss:" || url.protocol === "ws:") {
1042
- return `https://live.browser-use.com?wss=${encodeURIComponent(trimmed)}`;
1043
- }
1044
1042
  const wssParam = url.searchParams.get("wss");
1045
1043
  if (wssParam && (wssParam.startsWith("wss://") || wssParam.startsWith("ws://"))) {
1046
- url.searchParams.set("wss", wssParam);
1044
+ url.searchParams.set("wss", cdpToHttps(wssParam));
1047
1045
  }
1048
1046
  return url.toString();
1049
1047
  }
@@ -2540,9 +2538,23 @@ function parseNestedXmlTools(text) {
2540
2538
  }
2541
2539
  if (files.length > 0) {
2542
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 } });
2543
2545
  }
2544
2546
  }
2545
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
+ }
2546
2558
  return tools;
2547
2559
  }
2548
2560
  function preprocessText(text) {
@@ -3169,8 +3181,20 @@ async function runWarpGrep(config) {
3169
3181
  if (finishCalls.length) {
3170
3182
  const fc = finishCalls[0];
3171
3183
  const files = fc.arguments?.files ?? [];
3184
+ const textResult = fc.arguments?.textResult;
3172
3185
  finishMeta = { files };
3173
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
+ }
3174
3198
  break;
3175
3199
  }
3176
3200
  }
@@ -3323,8 +3347,19 @@ async function* runWarpGrepStreaming(config) {
3323
3347
  if (finishCalls.length) {
3324
3348
  const fc = finishCalls[0];
3325
3349
  const files = fc.arguments?.files ?? [];
3350
+ const textResult = fc.arguments?.textResult;
3326
3351
  finishMeta = { files };
3327
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
+ }
3328
3363
  break;
3329
3364
  }
3330
3365
  }