@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,7 +1,7 @@
1
1
  import { Tool } from '@anthropic-ai/sdk/resources/messages';
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';
@@ -2,14 +2,14 @@ import {
2
2
  createWarpGrepTool,
3
3
  execute,
4
4
  warpGrepTool
5
- } from "../../chunk-AFLEE2PO.js";
5
+ } from "../../chunk-ALTKGCG5.js";
6
6
  import "../../chunk-KW7OEGZK.js";
7
7
  import {
8
8
  formatResult
9
- } from "../../chunk-4CZPXV6R.js";
10
- import "../../chunk-ZROQPUCQ.js";
9
+ } from "../../chunk-23R562QJ.js";
10
+ import "../../chunk-YY7NZLAI.js";
11
11
  import "../../chunk-PUGSTXLO.js";
12
- import "../../chunk-KRDIR7GG.js";
12
+ import "../../chunk-3MLWXJTJ.js";
13
13
  import "../../chunk-SNGGSPYJ.js";
14
14
  import {
15
15
  getSystemPrompt
@@ -1143,7 +1143,13 @@ async function readFinishFiles(repoRoot, files, reader) {
1143
1143
  } else {
1144
1144
  const ranges = mergeRanges(validRanges);
1145
1145
  const chunks = [];
1146
- for (const [s, e] of ranges) {
1146
+ for (let i = 0; i < ranges.length; i++) {
1147
+ const [s, e] = ranges[i];
1148
+ if (i === 0 && s > 1) {
1149
+ chunks.push(`// ... existing code, block starting at line ${s} ...`);
1150
+ } else if (i > 0) {
1151
+ chunks.push(`// ... existing code, block starting at line ${s} ...`);
1152
+ }
1147
1153
  const lines = await reader(f.path, s, e);
1148
1154
  chunks.push(lines.join("\n"));
1149
1155
  }
@@ -1920,7 +1926,8 @@ async function executeToolCall(input, config) {
1920
1926
  }
1921
1927
  const contexts = (finish.resolved ?? []).map((r) => ({
1922
1928
  file: r.path,
1923
- content: r.content
1929
+ content: r.content,
1930
+ lines: r.ranges
1924
1931
  }));
1925
1932
  return { success: true, contexts, summary: finish.payload };
1926
1933
  }
@@ -1931,7 +1938,8 @@ function processAgentResult(result) {
1931
1938
  }
1932
1939
  const contexts = (finish.resolved ?? []).map((r) => ({
1933
1940
  file: r.path,
1934
- content: r.content
1941
+ content: r.content,
1942
+ lines: r.ranges
1935
1943
  }));
1936
1944
  return { success: true, contexts, summary: finish.payload };
1937
1945
  }
@@ -1968,20 +1976,22 @@ function formatResult(result) {
1968
1976
  if (!result.contexts || result.contexts.length === 0) {
1969
1977
  return "No relevant code found. Try rephrasing your query.";
1970
1978
  }
1971
- const lines = [];
1972
- lines.push(`Found ${result.contexts.length} relevant code sections:
1979
+ const parts = [];
1980
+ parts.push(`Morph Fast Context subagent performed search on repository:
1973
1981
  `);
1974
- result.contexts.forEach((ctx, i) => {
1975
- lines.push(`${i + 1}. ${ctx.file}`);
1976
- lines.push("```");
1977
- lines.push(ctx.content);
1978
- lines.push("```");
1979
- lines.push("");
1980
- });
1981
- if (result.summary) {
1982
- lines.push(`Summary: ${result.summary}`);
1983
- }
1984
- return lines.join("\n");
1982
+ parts.push("Relevant context found:");
1983
+ for (const ctx of result.contexts) {
1984
+ const rangeStr = !ctx.lines || ctx.lines === "*" ? "*" : ctx.lines.map(([s, e]) => `${s}-${e}`).join(",");
1985
+ parts.push(`- ${ctx.file}:${rangeStr}`);
1986
+ }
1987
+ parts.push("\nHere is the content of files:\n");
1988
+ for (const ctx of result.contexts) {
1989
+ const rangeStr = !ctx.lines || ctx.lines === "*" ? "" : ` lines="${ctx.lines.map(([s, e]) => `${s}-${e}`).join(",")}"`;
1990
+ parts.push(`<file path="${ctx.file}"${rangeStr}>`);
1991
+ parts.push(ctx.content);
1992
+ parts.push("</file>\n");
1993
+ }
1994
+ return parts.join("\n");
1985
1995
  }
1986
1996
  // Annotate the CommonJS export names for ESM import in node:
1987
1997
  0 && (module.exports = {