@morphllm/morphsdk 0.2.108 → 0.2.110

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 (61) hide show
  1. package/dist/{chunk-4CZPXV6R.js → chunk-23R562QJ.js} +20 -16
  2. package/dist/chunk-23R562QJ.js.map +1 -0
  3. package/dist/{chunk-KRDIR7GG.js → chunk-3MLWXJTJ.js} +8 -2
  4. package/dist/chunk-3MLWXJTJ.js.map +1 -0
  5. package/dist/{chunk-AFLEE2PO.js → chunk-ALTKGCG5.js} +2 -2
  6. package/dist/{chunk-QUIGATZE.js → chunk-FL4ZBHK2.js} +2 -2
  7. package/dist/{chunk-MY4OU4ON.js → chunk-HI35Y6EZ.js} +2 -2
  8. package/dist/{chunk-GOPNOZVI.js → chunk-I72WZNZF.js} +5 -5
  9. package/dist/chunk-I72WZNZF.js.map +1 -0
  10. package/dist/{chunk-ZROQPUCQ.js → chunk-YY7NZLAI.js} +2 -2
  11. package/dist/{client-DYnecl6H.d.ts → client-BH1R-YHX.d.ts} +1 -1
  12. package/dist/client.cjs +26 -16
  13. package/dist/client.cjs.map +1 -1
  14. package/dist/client.d.ts +2 -2
  15. package/dist/client.js +7 -7
  16. package/dist/index.cjs +26 -16
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.js +7 -7
  20. package/dist/tools/warp_grep/agent/runner.cjs +7 -1
  21. package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
  22. package/dist/tools/warp_grep/agent/runner.js +2 -2
  23. package/dist/tools/warp_grep/agent/types.cjs.map +1 -1
  24. package/dist/tools/warp_grep/agent/types.d.ts +1 -1
  25. package/dist/tools/warp_grep/anthropic.cjs +23 -14
  26. package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
  27. package/dist/tools/warp_grep/anthropic.d.ts +1 -1
  28. package/dist/tools/warp_grep/anthropic.js +4 -4
  29. package/dist/tools/warp_grep/client.cjs +26 -16
  30. package/dist/tools/warp_grep/client.cjs.map +1 -1
  31. package/dist/tools/warp_grep/client.d.ts +1 -1
  32. package/dist/tools/warp_grep/client.js +3 -3
  33. package/dist/tools/warp_grep/gemini.cjs +23 -14
  34. package/dist/tools/warp_grep/gemini.cjs.map +1 -1
  35. package/dist/tools/warp_grep/gemini.d.ts +1 -1
  36. package/dist/tools/warp_grep/gemini.js +3 -3
  37. package/dist/tools/warp_grep/harness.cjs +7 -1
  38. package/dist/tools/warp_grep/harness.cjs.map +1 -1
  39. package/dist/tools/warp_grep/harness.js +1 -1
  40. package/dist/tools/warp_grep/index.cjs +26 -16
  41. package/dist/tools/warp_grep/index.cjs.map +1 -1
  42. package/dist/tools/warp_grep/index.d.ts +1 -1
  43. package/dist/tools/warp_grep/index.js +3 -3
  44. package/dist/tools/warp_grep/openai.cjs +23 -14
  45. package/dist/tools/warp_grep/openai.cjs.map +1 -1
  46. package/dist/tools/warp_grep/openai.d.ts +1 -1
  47. package/dist/tools/warp_grep/openai.js +4 -4
  48. package/dist/tools/warp_grep/providers/remote.d.ts +1 -1
  49. package/dist/tools/warp_grep/vercel.cjs +23 -14
  50. package/dist/tools/warp_grep/vercel.cjs.map +1 -1
  51. package/dist/tools/warp_grep/vercel.d.ts +1 -1
  52. package/dist/tools/warp_grep/vercel.js +4 -4
  53. package/dist/{types-BMowL9iZ.d.ts → types-D5p8QErL.d.ts} +2 -0
  54. package/package.json +1 -1
  55. package/dist/chunk-4CZPXV6R.js.map +0 -1
  56. package/dist/chunk-GOPNOZVI.js.map +0 -1
  57. package/dist/chunk-KRDIR7GG.js.map +0 -1
  58. /package/dist/{chunk-AFLEE2PO.js.map → chunk-ALTKGCG5.js.map} +0 -0
  59. /package/dist/{chunk-QUIGATZE.js.map → chunk-FL4ZBHK2.js.map} +0 -0
  60. /package/dist/{chunk-MY4OU4ON.js.map → chunk-HI35Y6EZ.js.map} +0 -0
  61. /package/dist/{chunk-ZROQPUCQ.js.map → chunk-YY7NZLAI.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { WarpGrepStep } from './agent/types.js';
2
- import { W as WarpGrepClientConfig, a as WarpGrepInput, b as WarpGrepResult, d as WarpGrepToolConfig } from '../../types-BMowL9iZ.js';
2
+ import { W as WarpGrepClientConfig, a as WarpGrepInput, b as WarpGrepResult, d as WarpGrepToolConfig } from '../../types-D5p8QErL.js';
3
3
  import '../utils/resilience.js';
4
4
  import './providers/types.js';
5
5
 
@@ -3,10 +3,10 @@ import {
3
3
  executeToolCall,
4
4
  executeWarpGrep,
5
5
  formatResult
6
- } from "../../chunk-4CZPXV6R.js";
7
- import "../../chunk-ZROQPUCQ.js";
6
+ } from "../../chunk-23R562QJ.js";
7
+ import "../../chunk-YY7NZLAI.js";
8
8
  import "../../chunk-PUGSTXLO.js";
9
- import "../../chunk-KRDIR7GG.js";
9
+ import "../../chunk-3MLWXJTJ.js";
10
10
  import "../../chunk-SNGGSPYJ.js";
11
11
  import "../../chunk-FMLHRJDF.js";
12
12
  import "../../chunk-5PNMAWLC.js";
@@ -1146,7 +1146,13 @@ async function readFinishFiles(repoRoot, files, reader) {
1146
1146
  } else {
1147
1147
  const ranges = mergeRanges(validRanges);
1148
1148
  const chunks = [];
1149
- for (const [s, e] of ranges) {
1149
+ for (let i = 0; i < ranges.length; i++) {
1150
+ const [s, e] = ranges[i];
1151
+ if (i === 0 && s > 1) {
1152
+ chunks.push(`// ... existing code, block starting at line ${s} ...`);
1153
+ } else if (i > 0) {
1154
+ chunks.push(`// ... existing code, block starting at line ${s} ...`);
1155
+ }
1150
1156
  const lines = await reader(f.path, s, e);
1151
1157
  chunks.push(lines.join("\n"));
1152
1158
  }
@@ -1736,7 +1742,8 @@ async function executeToolCall(input, config) {
1736
1742
  }
1737
1743
  const contexts = (finish.resolved ?? []).map((r) => ({
1738
1744
  file: r.path,
1739
- content: r.content
1745
+ content: r.content,
1746
+ lines: r.ranges
1740
1747
  }));
1741
1748
  return { success: true, contexts, summary: finish.payload };
1742
1749
  }
@@ -1747,20 +1754,22 @@ function formatResult(result) {
1747
1754
  if (!result.contexts || result.contexts.length === 0) {
1748
1755
  return "No relevant code found. Try rephrasing your query.";
1749
1756
  }
1750
- const lines = [];
1751
- lines.push(`Found ${result.contexts.length} relevant code sections:
1757
+ const parts = [];
1758
+ parts.push(`Morph Fast Context subagent performed search on repository:
1752
1759
  `);
1753
- result.contexts.forEach((ctx, i) => {
1754
- lines.push(`${i + 1}. ${ctx.file}`);
1755
- lines.push("```");
1756
- lines.push(ctx.content);
1757
- lines.push("```");
1758
- lines.push("");
1759
- });
1760
- if (result.summary) {
1761
- lines.push(`Summary: ${result.summary}`);
1760
+ parts.push("Relevant context found:");
1761
+ for (const ctx of result.contexts) {
1762
+ const rangeStr = !ctx.lines || ctx.lines === "*" ? "*" : ctx.lines.map(([s, e]) => `${s}-${e}`).join(",");
1763
+ parts.push(`- ${ctx.file}:${rangeStr}`);
1764
+ }
1765
+ parts.push("\nHere is the content of files:\n");
1766
+ for (const ctx of result.contexts) {
1767
+ const rangeStr = !ctx.lines || ctx.lines === "*" ? "" : ` lines="${ctx.lines.map(([s, e]) => `${s}-${e}`).join(",")}"`;
1768
+ parts.push(`<file path="${ctx.file}"${rangeStr}>`);
1769
+ parts.push(ctx.content);
1770
+ parts.push("</file>\n");
1762
1771
  }
1763
- return lines.join("\n");
1772
+ return parts.join("\n");
1764
1773
  }
1765
1774
 
1766
1775
  // tools/warp_grep/prompts.ts