@morphllm/morphsdk 0.2.54 → 0.2.55

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 (35) hide show
  1. package/dist/{chunk-IFVROB4L.js → chunk-37SRI4GW.js} +6 -7
  2. package/dist/chunk-37SRI4GW.js.map +1 -0
  3. package/dist/{chunk-FB3E5BRY.js → chunk-BSHJGJ25.js} +3 -3
  4. package/dist/{chunk-KVMZPOUT.js → chunk-C6QQL6FX.js} +5 -5
  5. package/dist/{chunk-D5ZSGQT4.js → chunk-KO6JQFRE.js} +2 -2
  6. package/dist/{chunk-PYTBBWL6.js → chunk-X5HNQ7SB.js} +3 -3
  7. package/dist/{chunk-4HOUN5TW.js → chunk-ZWY434TS.js} +3 -3
  8. package/dist/client.cjs +12 -13
  9. package/dist/client.cjs.map +1 -1
  10. package/dist/client.js +6 -6
  11. package/dist/index.cjs +12 -13
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.js +6 -6
  14. package/dist/tools/warp_grep/agent/runner.cjs +5 -6
  15. package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
  16. package/dist/tools/warp_grep/agent/runner.js +1 -1
  17. package/dist/tools/warp_grep/anthropic.cjs +12 -13
  18. package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
  19. package/dist/tools/warp_grep/anthropic.js +3 -3
  20. package/dist/tools/warp_grep/index.cjs +12 -13
  21. package/dist/tools/warp_grep/index.cjs.map +1 -1
  22. package/dist/tools/warp_grep/index.js +5 -5
  23. package/dist/tools/warp_grep/openai.cjs +12 -13
  24. package/dist/tools/warp_grep/openai.cjs.map +1 -1
  25. package/dist/tools/warp_grep/openai.js +3 -3
  26. package/dist/tools/warp_grep/vercel.cjs +12 -13
  27. package/dist/tools/warp_grep/vercel.cjs.map +1 -1
  28. package/dist/tools/warp_grep/vercel.js +3 -3
  29. package/package.json +1 -1
  30. package/dist/chunk-IFVROB4L.js.map +0 -1
  31. /package/dist/{chunk-FB3E5BRY.js.map → chunk-BSHJGJ25.js.map} +0 -0
  32. /package/dist/{chunk-KVMZPOUT.js.map → chunk-C6QQL6FX.js.map} +0 -0
  33. /package/dist/{chunk-D5ZSGQT4.js.map → chunk-KO6JQFRE.js.map} +0 -0
  34. /package/dist/{chunk-PYTBBWL6.js.map → chunk-X5HNQ7SB.js.map} +0 -0
  35. /package/dist/{chunk-4HOUN5TW.js.map → chunk-ZWY434TS.js.map} +0 -0
package/dist/client.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  MorphClient
3
- } from "./chunk-KVMZPOUT.js";
4
- import "./chunk-FB3E5BRY.js";
5
- import "./chunk-4HOUN5TW.js";
6
- import "./chunk-PYTBBWL6.js";
7
- import "./chunk-D5ZSGQT4.js";
8
- import "./chunk-IFVROB4L.js";
3
+ } from "./chunk-C6QQL6FX.js";
4
+ import "./chunk-BSHJGJ25.js";
5
+ import "./chunk-ZWY434TS.js";
6
+ import "./chunk-X5HNQ7SB.js";
7
+ import "./chunk-KO6JQFRE.js";
8
+ import "./chunk-37SRI4GW.js";
9
9
  import "./chunk-EK7OQPWD.js";
10
10
  import "./chunk-HQO45BAJ.js";
11
11
  import "./chunk-LVPVVLTI.js";
package/dist/index.cjs CHANGED
@@ -1610,13 +1610,12 @@ function mergeRanges(ranges) {
1610
1610
 
1611
1611
  // tools/warp_grep/agent/runner.ts
1612
1612
  var import_path2 = __toESM(require("path"), 1);
1613
- var import_promises2 = __toESM(require("fs/promises"), 1);
1614
1613
  var parser = new LLMResponseParser();
1615
- async function buildInitialState(repoRoot, query) {
1614
+ async function buildInitialState(repoRoot, query, provider) {
1616
1615
  try {
1617
- const entries = await import_promises2.default.readdir(repoRoot, { withFileTypes: true });
1618
- const dirs = entries.filter((e) => e.isDirectory()).map((d) => d.name).slice(0, 50);
1619
- const files = entries.filter((e) => e.isFile()).map((f) => f.name).slice(0, 50);
1616
+ const entries = await provider.analyse({ path: ".", maxResults: 100 });
1617
+ const dirs = entries.filter((e) => e.type === "dir").map((d) => d.name).slice(0, 50);
1618
+ const files = entries.filter((e) => e.type === "file").map((f) => f.name).slice(0, 50);
1620
1619
  const parts = [
1621
1620
  `<repo_root>${repoRoot}</repo_root>`,
1622
1621
  `<top_dirs>${dirs.join(", ")}</top_dirs>`,
@@ -1665,7 +1664,7 @@ async function runWarpGrep(config) {
1665
1664
  messages.push(systemMessage);
1666
1665
  const queryContent = `<query>${config.query}</query>`;
1667
1666
  messages.push({ role: "user", content: queryContent });
1668
- const initialState = await buildInitialState(repoRoot, config.query);
1667
+ const initialState = await buildInitialState(repoRoot, config.query, config.provider);
1669
1668
  messages.push({ role: "user", content: initialState });
1670
1669
  const maxRounds = AGENT_CONFIG.MAX_ROUNDS;
1671
1670
  const model = config.model || DEFAULT_MODEL;
@@ -1808,7 +1807,7 @@ async function runWarpGrep(config) {
1808
1807
  }
1809
1808
 
1810
1809
  // tools/warp_grep/providers/local.ts
1811
- var import_promises4 = __toESM(require("fs/promises"), 1);
1810
+ var import_promises3 = __toESM(require("fs/promises"), 1);
1812
1811
  var import_path4 = __toESM(require("path"), 1);
1813
1812
 
1814
1813
  // tools/warp_grep/utils/ripgrep.ts
@@ -1918,9 +1917,9 @@ function isTextualFile(filePath, maxBytes = 2e6) {
1918
1917
  }
1919
1918
 
1920
1919
  // tools/warp_grep/utils/files.ts
1921
- var import_promises3 = __toESM(require("fs/promises"), 1);
1920
+ var import_promises2 = __toESM(require("fs/promises"), 1);
1922
1921
  async function readAllLines(filePath) {
1923
- const content = await import_promises3.default.readFile(filePath, "utf8");
1922
+ const content = await import_promises2.default.readFile(filePath, "utf8");
1924
1923
  return content.split(/\r?\n/);
1925
1924
  }
1926
1925
 
@@ -1932,7 +1931,7 @@ var LocalRipgrepProvider = class {
1932
1931
  }
1933
1932
  async grep(params) {
1934
1933
  const abs = resolveUnderRepo(this.repoRoot, params.path);
1935
- const stat = await import_promises4.default.stat(abs).catch(() => null);
1934
+ const stat = await import_promises3.default.stat(abs).catch(() => null);
1936
1935
  if (!stat) return { lines: [] };
1937
1936
  const targetArg = abs === import_path4.default.resolve(this.repoRoot) ? "." : toRepoRelative(this.repoRoot, abs);
1938
1937
  const args = [
@@ -1990,7 +1989,7 @@ Details: ${res.stderr}` : ""}`
1990
1989
  }
1991
1990
  async read(params) {
1992
1991
  const abs = resolveUnderRepo(this.repoRoot, params.path);
1993
- const stat = await import_promises4.default.stat(abs).catch(() => null);
1992
+ const stat = await import_promises3.default.stat(abs).catch(() => null);
1994
1993
  if (!stat || !stat.isFile()) {
1995
1994
  return {
1996
1995
  lines: [],
@@ -2026,7 +2025,7 @@ Details: ${res.stderr}` : ""}`
2026
2025
  }
2027
2026
  async analyse(params) {
2028
2027
  const abs = resolveUnderRepo(this.repoRoot, params.path);
2029
- const stat = await import_promises4.default.stat(abs).catch(() => null);
2028
+ const stat = await import_promises3.default.stat(abs).catch(() => null);
2030
2029
  if (!stat || !stat.isDirectory()) {
2031
2030
  return [];
2032
2031
  }
@@ -2036,7 +2035,7 @@ Details: ${res.stderr}` : ""}`
2036
2035
  const results = [];
2037
2036
  async function walk(dir, depth) {
2038
2037
  if (depth > maxDepth || results.length >= maxResults) return;
2039
- const entries = await import_promises4.default.readdir(dir, { withFileTypes: true });
2038
+ const entries = await import_promises3.default.readdir(dir, { withFileTypes: true });
2040
2039
  for (const entry of entries) {
2041
2040
  const full = import_path4.default.join(dir, entry.name);
2042
2041
  const rel = toRepoRelative(abs, full).replace(/^[.][/\\]?/, "");