@morphllm/morphsdk 0.2.109 → 0.2.111

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