@morphllm/morphsdk 0.2.57 → 0.2.59

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 (170) hide show
  1. package/dist/anthropic-CaFUHxBW.d.ts +89 -0
  2. package/dist/{chunk-6X5UOY7B.js → chunk-2CASO3ZO.js} +46 -79
  3. package/dist/chunk-2CASO3ZO.js.map +1 -0
  4. package/dist/chunk-374N3GIA.js +118 -0
  5. package/dist/chunk-374N3GIA.js.map +1 -0
  6. package/dist/chunk-3IQIT6MC.js +65 -0
  7. package/dist/chunk-3IQIT6MC.js.map +1 -0
  8. package/dist/chunk-4VGOBA2J.js +57 -0
  9. package/dist/chunk-4VGOBA2J.js.map +1 -0
  10. package/dist/chunk-527P5X2E.js +98 -0
  11. package/dist/chunk-527P5X2E.js.map +1 -0
  12. package/dist/chunk-6N6ZYZYD.js +74 -0
  13. package/dist/chunk-6N6ZYZYD.js.map +1 -0
  14. package/dist/chunk-6Y5JB4JC.js +195 -0
  15. package/dist/chunk-6Y5JB4JC.js.map +1 -0
  16. package/dist/{chunk-TICMYDII.js → chunk-APP75CBN.js} +33 -16
  17. package/dist/chunk-APP75CBN.js.map +1 -0
  18. package/dist/{chunk-QFIHUCTF.js → chunk-FN4EP3WY.js} +19 -19
  19. package/dist/chunk-FN4EP3WY.js.map +1 -0
  20. package/dist/chunk-ILJ3J5IA.js +72 -0
  21. package/dist/chunk-ILJ3J5IA.js.map +1 -0
  22. package/dist/chunk-ISWL67SF.js +1 -0
  23. package/dist/chunk-KW7OEGZK.js +9 -0
  24. package/dist/chunk-KW7OEGZK.js.map +1 -0
  25. package/dist/chunk-Q5AHGIQO.js +205 -0
  26. package/dist/chunk-Q5AHGIQO.js.map +1 -0
  27. package/dist/{chunk-OXHGFHEU.js → chunk-VJU3BRET.js} +3 -3
  28. package/dist/chunk-VJU3BRET.js.map +1 -0
  29. package/dist/{chunk-TJIUA27P.js → chunk-XT5ZO6ES.js} +9 -5
  30. package/dist/chunk-XT5ZO6ES.js.map +1 -0
  31. package/dist/{chunk-LVPVVLTI.js → chunk-YV75OQTE.js} +105 -17
  32. package/dist/chunk-YV75OQTE.js.map +1 -0
  33. package/dist/{chunk-ZJIIICRA.js → chunk-ZO4PPFCZ.js} +60 -29
  34. package/dist/chunk-ZO4PPFCZ.js.map +1 -0
  35. package/dist/{client-CFoR--IU.d.ts → client-CextMMm9.d.ts} +10 -15
  36. package/dist/client.cjs +689 -343
  37. package/dist/client.cjs.map +1 -1
  38. package/dist/client.d.ts +3 -2
  39. package/dist/client.js +15 -15
  40. package/dist/finish-kXAcUJyB.d.ts +33 -0
  41. package/dist/gemini-CE80Pbdy.d.ts +117 -0
  42. package/dist/git/client.cjs +2 -2
  43. package/dist/git/client.cjs.map +1 -1
  44. package/dist/git/client.d.ts +1 -1
  45. package/dist/git/client.js +1 -1
  46. package/dist/git/index.cjs +2 -2
  47. package/dist/git/index.cjs.map +1 -1
  48. package/dist/git/index.js +1 -1
  49. package/dist/git/types.cjs.map +1 -1
  50. package/dist/git/types.d.ts +1 -1
  51. package/dist/index.cjs +702 -343
  52. package/dist/index.cjs.map +1 -1
  53. package/dist/index.d.ts +4 -3
  54. package/dist/index.js +17 -16
  55. package/dist/openai-Fvpqln7F.d.ts +89 -0
  56. package/dist/tools/warp_grep/agent/config.cjs +8 -4
  57. package/dist/tools/warp_grep/agent/config.cjs.map +1 -1
  58. package/dist/tools/warp_grep/agent/config.d.ts +7 -2
  59. package/dist/tools/warp_grep/agent/config.js +1 -1
  60. package/dist/tools/warp_grep/agent/formatter.cjs +32 -15
  61. package/dist/tools/warp_grep/agent/formatter.cjs.map +1 -1
  62. package/dist/tools/warp_grep/agent/formatter.d.ts +1 -1
  63. package/dist/tools/warp_grep/agent/formatter.js +1 -1
  64. package/dist/tools/warp_grep/agent/parser.cjs +104 -17
  65. package/dist/tools/warp_grep/agent/parser.cjs.map +1 -1
  66. package/dist/tools/warp_grep/agent/parser.d.ts +3 -5
  67. package/dist/tools/warp_grep/agent/parser.js +1 -3
  68. package/dist/tools/warp_grep/agent/prompt.cjs +132 -56
  69. package/dist/tools/warp_grep/agent/prompt.cjs.map +1 -1
  70. package/dist/tools/warp_grep/agent/prompt.d.ts +1 -1
  71. package/dist/tools/warp_grep/agent/prompt.js +1 -1
  72. package/dist/tools/warp_grep/agent/runner.cjs +459 -192
  73. package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
  74. package/dist/tools/warp_grep/agent/runner.d.ts +1 -0
  75. package/dist/tools/warp_grep/agent/runner.js +6 -8
  76. package/dist/tools/warp_grep/agent/types.cjs.map +1 -1
  77. package/dist/tools/warp_grep/agent/types.d.ts +9 -2
  78. package/dist/tools/warp_grep/anthropic.cjs +650 -260
  79. package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
  80. package/dist/tools/warp_grep/anthropic.d.ts +4 -74
  81. package/dist/tools/warp_grep/anthropic.js +13 -15
  82. package/dist/tools/warp_grep/client.cjs +1593 -0
  83. package/dist/tools/warp_grep/client.cjs.map +1 -0
  84. package/dist/tools/warp_grep/client.d.ts +87 -0
  85. package/dist/tools/warp_grep/client.js +26 -0
  86. package/dist/tools/warp_grep/gemini.cjs +1587 -0
  87. package/dist/tools/warp_grep/gemini.cjs.map +1 -0
  88. package/dist/tools/warp_grep/gemini.d.ts +7 -0
  89. package/dist/tools/warp_grep/gemini.js +34 -0
  90. package/dist/tools/warp_grep/harness.cjs +556 -220
  91. package/dist/tools/warp_grep/harness.cjs.map +1 -1
  92. package/dist/tools/warp_grep/harness.d.ts +50 -119
  93. package/dist/tools/warp_grep/harness.js +33 -41
  94. package/dist/tools/warp_grep/harness.js.map +1 -1
  95. package/dist/tools/warp_grep/index.cjs +812 -346
  96. package/dist/tools/warp_grep/index.cjs.map +1 -1
  97. package/dist/tools/warp_grep/index.d.ts +11 -6
  98. package/dist/tools/warp_grep/index.js +43 -22
  99. package/dist/tools/warp_grep/openai.cjs +650 -258
  100. package/dist/tools/warp_grep/openai.cjs.map +1 -1
  101. package/dist/tools/warp_grep/openai.d.ts +4 -74
  102. package/dist/tools/warp_grep/openai.js +13 -13
  103. package/dist/tools/warp_grep/providers/local.cjs +66 -27
  104. package/dist/tools/warp_grep/providers/local.cjs.map +1 -1
  105. package/dist/tools/warp_grep/providers/local.d.ts +4 -9
  106. package/dist/tools/warp_grep/providers/local.js +2 -2
  107. package/dist/tools/warp_grep/providers/remote.cjs +211 -0
  108. package/dist/tools/warp_grep/providers/remote.cjs.map +1 -0
  109. package/dist/tools/warp_grep/providers/remote.d.ts +67 -0
  110. package/dist/tools/warp_grep/providers/remote.js +9 -0
  111. package/dist/tools/warp_grep/providers/types.cjs.map +1 -1
  112. package/dist/tools/warp_grep/providers/types.d.ts +7 -15
  113. package/dist/tools/warp_grep/vercel.cjs +662 -277
  114. package/dist/tools/warp_grep/vercel.cjs.map +1 -1
  115. package/dist/tools/warp_grep/vercel.d.ts +4 -51
  116. package/dist/tools/warp_grep/vercel.js +16 -14
  117. package/dist/types-a_hxdPI6.d.ts +144 -0
  118. package/dist/vercel-3yjvfmVB.d.ts +66 -0
  119. package/package.json +12 -2
  120. package/dist/chunk-6X5UOY7B.js.map +0 -1
  121. package/dist/chunk-73RQWOQC.js +0 -16
  122. package/dist/chunk-73RQWOQC.js.map +0 -1
  123. package/dist/chunk-7OQOOB3R.js +0 -1
  124. package/dist/chunk-CFF636UC.js +0 -70
  125. package/dist/chunk-CFF636UC.js.map +0 -1
  126. package/dist/chunk-EK7OQPWD.js +0 -44
  127. package/dist/chunk-EK7OQPWD.js.map +0 -1
  128. package/dist/chunk-GJ5TYNRD.js +0 -107
  129. package/dist/chunk-GJ5TYNRD.js.map +0 -1
  130. package/dist/chunk-HQO45BAJ.js +0 -14
  131. package/dist/chunk-HQO45BAJ.js.map +0 -1
  132. package/dist/chunk-IMYQOKFO.js +0 -83
  133. package/dist/chunk-IMYQOKFO.js.map +0 -1
  134. package/dist/chunk-KBQWGT5L.js +0 -77
  135. package/dist/chunk-KBQWGT5L.js.map +0 -1
  136. package/dist/chunk-LVPVVLTI.js.map +0 -1
  137. package/dist/chunk-OXHGFHEU.js.map +0 -1
  138. package/dist/chunk-QFIHUCTF.js.map +0 -1
  139. package/dist/chunk-TICMYDII.js.map +0 -1
  140. package/dist/chunk-TJIUA27P.js.map +0 -1
  141. package/dist/chunk-WETRQJGU.js +0 -129
  142. package/dist/chunk-WETRQJGU.js.map +0 -1
  143. package/dist/chunk-ZJIIICRA.js.map +0 -1
  144. package/dist/core-CpkYEi_T.d.ts +0 -158
  145. package/dist/tools/warp_grep/tools/analyse.cjs +0 -40
  146. package/dist/tools/warp_grep/tools/analyse.cjs.map +0 -1
  147. package/dist/tools/warp_grep/tools/analyse.d.ts +0 -10
  148. package/dist/tools/warp_grep/tools/analyse.js +0 -8
  149. package/dist/tools/warp_grep/tools/finish.cjs +0 -69
  150. package/dist/tools/warp_grep/tools/finish.cjs.map +0 -1
  151. package/dist/tools/warp_grep/tools/finish.d.ts +0 -10
  152. package/dist/tools/warp_grep/tools/finish.js +0 -10
  153. package/dist/tools/warp_grep/tools/grep.cjs +0 -38
  154. package/dist/tools/warp_grep/tools/grep.cjs.map +0 -1
  155. package/dist/tools/warp_grep/tools/grep.d.ts +0 -8
  156. package/dist/tools/warp_grep/tools/grep.js +0 -15
  157. package/dist/tools/warp_grep/tools/grep.js.map +0 -1
  158. package/dist/tools/warp_grep/tools/read.cjs +0 -38
  159. package/dist/tools/warp_grep/tools/read.cjs.map +0 -1
  160. package/dist/tools/warp_grep/tools/read.d.ts +0 -9
  161. package/dist/tools/warp_grep/tools/read.js +0 -8
  162. package/dist/tools/warp_grep/utils/format.cjs +0 -42
  163. package/dist/tools/warp_grep/utils/format.cjs.map +0 -1
  164. package/dist/tools/warp_grep/utils/format.d.ts +0 -4
  165. package/dist/tools/warp_grep/utils/format.js +0 -18
  166. package/dist/tools/warp_grep/utils/format.js.map +0 -1
  167. /package/dist/{chunk-7OQOOB3R.js.map → chunk-ISWL67SF.js.map} +0 -0
  168. /package/dist/tools/warp_grep/{tools/analyse.js.map → client.js.map} +0 -0
  169. /package/dist/tools/warp_grep/{tools/finish.js.map → gemini.js.map} +0 -0
  170. /package/dist/tools/warp_grep/{tools/read.js.map → providers/remote.js.map} +0 -0
@@ -1,158 +0,0 @@
1
- import { WarpGrepProvider } from './tools/warp_grep/providers/types.js';
2
- import { RetryConfig } from './tools/utils/resilience.js';
3
-
4
- /**
5
- * Configuration for WarpGrepClient
6
- */
7
- interface WarpGrepClientConfig {
8
- /** Morph API key (defaults to MORPH_API_KEY env var) */
9
- apiKey?: string;
10
- /** Enable debug logging */
11
- debug?: boolean;
12
- /** Request timeout in milliseconds */
13
- timeout?: number;
14
- /** Retry configuration */
15
- retryConfig?: RetryConfig;
16
- }
17
- /**
18
- * Input for warp grep execution
19
- */
20
- interface WarpGrepInput {
21
- /** Free-form repository question */
22
- query: string;
23
- /** Root directory of the repository to search */
24
- repoRoot: string;
25
- /** Optional custom provider (defaults to LocalRipgrepProvider) */
26
- provider?: WarpGrepProvider;
27
- /** Glob patterns to exclude from search */
28
- excludes?: string[];
29
- /** Glob patterns to include in search */
30
- includes?: string[];
31
- /** Enable debug logging for this request */
32
- debug?: boolean;
33
- }
34
- /**
35
- * A single context result with file path and content
36
- */
37
- interface WarpGrepContext {
38
- /** File path relative to repo root */
39
- file: string;
40
- /** Content of the relevant code section */
41
- content: string;
42
- }
43
- /**
44
- * Result from warp grep execution
45
- */
46
- interface WarpGrepResult {
47
- /** Whether the search completed successfully */
48
- success: boolean;
49
- /** Relevant code contexts found */
50
- contexts?: WarpGrepContext[];
51
- /** Summary of what was found */
52
- summary?: string;
53
- /** Error message if search failed */
54
- error?: string;
55
- }
56
- /**
57
- * Configuration for creating a warp grep tool
58
- */
59
- interface WarpGrepToolConfig {
60
- /** Root directory of the repository to search */
61
- repoRoot: string;
62
- /** Optional custom provider (defaults to LocalRipgrepProvider) */
63
- provider?: WarpGrepProvider;
64
- /** Glob patterns to exclude from search */
65
- excludes?: string[];
66
- /** Glob patterns to include in search */
67
- includes?: string[];
68
- /** Enable debug logging */
69
- debug?: boolean;
70
- /** Morph API key (defaults to MORPH_API_KEY env var) */
71
- apiKey?: string;
72
- /** Custom tool name (defaults to 'warpgrep_codebase_search') */
73
- name?: string;
74
- /** Custom tool description */
75
- description?: string;
76
- }
77
-
78
- /**
79
- * Core implementation for morph-warp-grep
80
- * Provides a client class for programmatic code search
81
- */
82
-
83
- /**
84
- * WarpGrep client for programmatic code search
85
- *
86
- * @example
87
- * ```typescript
88
- * import { WarpGrepClient } from '@morphllm/morphsdk';
89
- *
90
- * const client = new WarpGrepClient({ apiKey: process.env.MORPH_API_KEY });
91
- *
92
- * // Simple usage - defaults to LocalRipgrepProvider
93
- * const result = await client.execute({
94
- * query: 'Find authentication middleware',
95
- * repoRoot: '.'
96
- * });
97
- *
98
- * // With custom excludes
99
- * const result = await client.execute({
100
- * query: 'Find database models',
101
- * repoRoot: '.',
102
- * excludes: ['node_modules', '.git', 'dist']
103
- * });
104
- * ```
105
- */
106
- declare class WarpGrepClient {
107
- private config;
108
- constructor(config?: WarpGrepClientConfig);
109
- /**
110
- * Execute a code search query
111
- *
112
- * @param input - Search parameters including query, repoRoot, and optional provider
113
- * @returns Search results with relevant code contexts
114
- *
115
- * @example
116
- * ```typescript
117
- * const result = await client.execute({
118
- * query: 'Find authentication middleware',
119
- * repoRoot: '.'
120
- * });
121
- *
122
- * if (result.success) {
123
- * for (const ctx of result.contexts) {
124
- * console.log(`File: ${ctx.file}`);
125
- * console.log(ctx.content);
126
- * }
127
- * }
128
- * ```
129
- */
130
- execute(input: WarpGrepInput): Promise<WarpGrepResult>;
131
- }
132
- /**
133
- * Execute a warp grep search directly
134
- *
135
- * @param input - Search parameters
136
- * @param config - Optional client configuration
137
- * @returns Search results
138
- *
139
- * @example
140
- * ```typescript
141
- * import { executeWarpGrep } from '@morphllm/morphsdk/tools/warp-grep';
142
- *
143
- * const result = await executeWarpGrep({
144
- * query: 'Find authentication middleware',
145
- * repoRoot: '.'
146
- * });
147
- * ```
148
- */
149
- declare function executeWarpGrep(input: WarpGrepInput, config?: WarpGrepClientConfig): Promise<WarpGrepResult>;
150
- /**
151
- * Format warp grep results for display or tool responses
152
- *
153
- * @param result - The search result
154
- * @returns Formatted string representation
155
- */
156
- declare function formatResult(result: WarpGrepResult): string;
157
-
158
- export { WarpGrepClient as W, type WarpGrepClientConfig as a, type WarpGrepInput as b, type WarpGrepResult as c, type WarpGrepContext as d, type WarpGrepToolConfig as e, formatResult as f, executeWarpGrep as g };
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // tools/warp_grep/tools/analyse.ts
21
- var analyse_exports = {};
22
- __export(analyse_exports, {
23
- toolAnalyse: () => toolAnalyse
24
- });
25
- module.exports = __toCommonJS(analyse_exports);
26
- async function toolAnalyse(provider, args) {
27
- const list = await provider.analyse({
28
- path: args.path,
29
- pattern: args.pattern ?? null,
30
- maxResults: args.maxResults ?? 100,
31
- maxDepth: args.maxDepth ?? 2
32
- });
33
- if (!list.length) return "empty";
34
- return list.map((e) => `${" ".repeat(e.depth)}- ${e.type === "dir" ? "[D]" : "[F]"} ${e.name}`).join("\n");
35
- }
36
- // Annotate the CommonJS export names for ESM import in node:
37
- 0 && (module.exports = {
38
- toolAnalyse
39
- });
40
- //# sourceMappingURL=analyse.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../tools/warp_grep/tools/analyse.ts"],"sourcesContent":["import type { WarpGrepProvider } from '../providers/types.js';\n\nexport async function toolAnalyse(\n provider: WarpGrepProvider,\n args: { path: string; pattern?: string | null; maxResults?: number; maxDepth?: number }\n): Promise<string> {\n const list = await provider.analyse({\n path: args.path,\n pattern: args.pattern ?? null,\n maxResults: args.maxResults ?? 100,\n maxDepth: args.maxDepth ?? 2,\n });\n if (!list.length) return 'empty';\n return list\n .map((e) => `${' '.repeat(e.depth)}- ${e.type === 'dir' ? '[D]' : '[F]'} ${e.name}`)\n .join('\\n');\n}\n\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,eAAsB,YACpB,UACA,MACiB;AACjB,QAAM,OAAO,MAAM,SAAS,QAAQ;AAAA,IAClC,MAAM,KAAK;AAAA,IACX,SAAS,KAAK,WAAW;AAAA,IACzB,YAAY,KAAK,cAAc;AAAA,IAC/B,UAAU,KAAK,YAAY;AAAA,EAC7B,CAAC;AACD,MAAI,CAAC,KAAK,OAAQ,QAAO;AACzB,SAAO,KACJ,IAAI,CAAC,MAAM,GAAG,KAAK,OAAO,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,QAAQ,QAAQ,KAAK,IAAI,EAAE,IAAI,EAAE,EACnF,KAAK,IAAI;AACd;","names":[]}
@@ -1,10 +0,0 @@
1
- import { WarpGrepProvider } from '../providers/types.js';
2
-
3
- declare function toolAnalyse(provider: WarpGrepProvider, args: {
4
- path: string;
5
- pattern?: string | null;
6
- maxResults?: number;
7
- maxDepth?: number;
8
- }): Promise<string>;
9
-
10
- export { toolAnalyse };
@@ -1,8 +0,0 @@
1
- import {
2
- toolAnalyse
3
- } from "../../../chunk-73RQWOQC.js";
4
- import "../../../chunk-PZ5AY32C.js";
5
- export {
6
- toolAnalyse
7
- };
8
- //# sourceMappingURL=analyse.js.map
@@ -1,69 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // tools/warp_grep/tools/finish.ts
21
- var finish_exports = {};
22
- __export(finish_exports, {
23
- normalizeFinishFiles: () => normalizeFinishFiles,
24
- readFinishFiles: () => readFinishFiles
25
- });
26
- module.exports = __toCommonJS(finish_exports);
27
- function normalizeFinishFiles(files) {
28
- return files.map((f) => {
29
- const merged = mergeRanges(f.lines);
30
- return { path: f.path, lines: merged };
31
- });
32
- }
33
- async function readFinishFiles(repoRoot, files, reader) {
34
- const out = [];
35
- for (const f of files) {
36
- const ranges = mergeRanges(f.lines);
37
- const chunks = [];
38
- for (const [s, e] of ranges) {
39
- const lines = await reader(f.path, s, e);
40
- chunks.push(lines.join("\n"));
41
- }
42
- out.push({ path: f.path, ranges, content: chunks.join("\n") });
43
- }
44
- return out;
45
- }
46
- function mergeRanges(ranges) {
47
- if (!ranges.length) return [];
48
- const sorted = [...ranges].sort((a, b) => a[0] - b[0]);
49
- const merged = [];
50
- let [cs, ce] = sorted[0];
51
- for (let i = 1; i < sorted.length; i++) {
52
- const [s, e] = sorted[i];
53
- if (s <= ce + 1) {
54
- ce = Math.max(ce, e);
55
- } else {
56
- merged.push([cs, ce]);
57
- cs = s;
58
- ce = e;
59
- }
60
- }
61
- merged.push([cs, ce]);
62
- return merged;
63
- }
64
- // Annotate the CommonJS export names for ESM import in node:
65
- 0 && (module.exports = {
66
- normalizeFinishFiles,
67
- readFinishFiles
68
- });
69
- //# sourceMappingURL=finish.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../tools/warp_grep/tools/finish.ts"],"sourcesContent":["import type { FinishFileSpec } from '../agent/types.js';\nimport fs from 'fs/promises';\n\nexport function normalizeFinishFiles(files: FinishFileSpec[]): FinishFileSpec[] {\n return files.map((f) => {\n const merged = mergeRanges(f.lines);\n return { path: f.path, lines: merged };\n });\n}\n\nexport async function readFinishFiles(\n repoRoot: string,\n files: FinishFileSpec[],\n reader: (path: string, start: number, end: number) => Promise<string[]>\n): Promise<{ path: string; ranges: Array<[number, number]>; content: string }[]> {\n const out: { path: string; ranges: Array<[number, number]>; content: string }[] = [];\n for (const f of files) {\n const ranges = mergeRanges(f.lines);\n const chunks: string[] = [];\n for (const [s, e] of ranges) {\n const lines = await reader(f.path, s, e);\n chunks.push(lines.join('\\n'));\n }\n out.push({ path: f.path, ranges, content: chunks.join('\\n') });\n }\n return out;\n}\n\nfunction mergeRanges(ranges: Array<[number, number]>): Array<[number, number]> {\n if (!ranges.length) return [];\n const sorted = [...ranges].sort((a, b) => a[0] - b[0]);\n const merged: Array<[number, number]> = [];\n let [cs, ce] = sorted[0];\n for (let i = 1; i < sorted.length; i++) {\n const [s, e] = sorted[i];\n if (s <= ce + 1) {\n ce = Math.max(ce, e);\n } else {\n merged.push([cs, ce]);\n cs = s;\n ce = e;\n }\n }\n merged.push([cs, ce]);\n return merged;\n}\n\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,SAAS,qBAAqB,OAA2C;AAC9E,SAAO,MAAM,IAAI,CAAC,MAAM;AACtB,UAAM,SAAS,YAAY,EAAE,KAAK;AAClC,WAAO,EAAE,MAAM,EAAE,MAAM,OAAO,OAAO;AAAA,EACvC,CAAC;AACH;AAEA,eAAsB,gBACpB,UACA,OACA,QAC+E;AAC/E,QAAM,MAA4E,CAAC;AACnF,aAAW,KAAK,OAAO;AACrB,UAAM,SAAS,YAAY,EAAE,KAAK;AAClC,UAAM,SAAmB,CAAC;AAC1B,eAAW,CAAC,GAAG,CAAC,KAAK,QAAQ;AAC3B,YAAM,QAAQ,MAAM,OAAO,EAAE,MAAM,GAAG,CAAC;AACvC,aAAO,KAAK,MAAM,KAAK,IAAI,CAAC;AAAA,IAC9B;AACA,QAAI,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,SAAS,OAAO,KAAK,IAAI,EAAE,CAAC;AAAA,EAC/D;AACA,SAAO;AACT;AAEA,SAAS,YAAY,QAA0D;AAC7E,MAAI,CAAC,OAAO,OAAQ,QAAO,CAAC;AAC5B,QAAM,SAAS,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,GAAG,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;AACrD,QAAM,SAAkC,CAAC;AACzC,MAAI,CAAC,IAAI,EAAE,IAAI,OAAO,CAAC;AACvB,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACtC,UAAM,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC;AACvB,QAAI,KAAK,KAAK,GAAG;AACf,WAAK,KAAK,IAAI,IAAI,CAAC;AAAA,IACrB,OAAO;AACL,aAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACpB,WAAK;AACL,WAAK;AAAA,IACP;AAAA,EACF;AACA,SAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACpB,SAAO;AACT;","names":[]}
@@ -1,10 +0,0 @@
1
- import { FinishFileSpec } from '../agent/types.js';
2
-
3
- declare function normalizeFinishFiles(files: FinishFileSpec[]): FinishFileSpec[];
4
- declare function readFinishFiles(repoRoot: string, files: FinishFileSpec[], reader: (path: string, start: number, end: number) => Promise<string[]>): Promise<{
5
- path: string;
6
- ranges: Array<[number, number]>;
7
- content: string;
8
- }[]>;
9
-
10
- export { normalizeFinishFiles, readFinishFiles };
@@ -1,10 +0,0 @@
1
- import {
2
- normalizeFinishFiles,
3
- readFinishFiles
4
- } from "../../../chunk-EK7OQPWD.js";
5
- import "../../../chunk-PZ5AY32C.js";
6
- export {
7
- normalizeFinishFiles,
8
- readFinishFiles
9
- };
10
- //# sourceMappingURL=finish.js.map
@@ -1,38 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // tools/warp_grep/tools/grep.ts
21
- var grep_exports = {};
22
- __export(grep_exports, {
23
- toolGrep: () => toolGrep
24
- });
25
- module.exports = __toCommonJS(grep_exports);
26
- async function toolGrep(provider, args) {
27
- const result = await provider.grep({ pattern: args.pattern, path: args.path });
28
- if (result.error) {
29
- return `[ERROR] ${result.error}`;
30
- }
31
- if (!result.lines.length) return "no new matches";
32
- return result.lines.join("\n");
33
- }
34
- // Annotate the CommonJS export names for ESM import in node:
35
- 0 && (module.exports = {
36
- toolGrep
37
- });
38
- //# sourceMappingURL=grep.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../tools/warp_grep/tools/grep.ts"],"sourcesContent":["import type { WarpGrepProvider } from '../providers/types.js';\n\nexport async function toolGrep(\n provider: WarpGrepProvider,\n args: { pattern: string; path: string }\n): Promise<string> {\n const result = await provider.grep({ pattern: args.pattern, path: args.path });\n // Return error message if present (graceful handling)\n if (result.error) {\n return `[ERROR] ${result.error}`;\n }\n if (!result.lines.length) return 'no new matches';\n return result.lines.join('\\n');\n}\n\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,eAAsB,SACpB,UACA,MACiB;AACjB,QAAM,SAAS,MAAM,SAAS,KAAK,EAAE,SAAS,KAAK,SAAS,MAAM,KAAK,KAAK,CAAC;AAE7E,MAAI,OAAO,OAAO;AAChB,WAAO,WAAW,OAAO,KAAK;AAAA,EAChC;AACA,MAAI,CAAC,OAAO,MAAM,OAAQ,QAAO;AACjC,SAAO,OAAO,MAAM,KAAK,IAAI;AAC/B;","names":[]}
@@ -1,8 +0,0 @@
1
- import { WarpGrepProvider } from '../providers/types.js';
2
-
3
- declare function toolGrep(provider: WarpGrepProvider, args: {
4
- pattern: string;
5
- path: string;
6
- }): Promise<string>;
7
-
8
- export { toolGrep };
@@ -1,15 +0,0 @@
1
- import "../../../chunk-PZ5AY32C.js";
2
-
3
- // tools/warp_grep/tools/grep.ts
4
- async function toolGrep(provider, args) {
5
- const result = await provider.grep({ pattern: args.pattern, path: args.path });
6
- if (result.error) {
7
- return `[ERROR] ${result.error}`;
8
- }
9
- if (!result.lines.length) return "no new matches";
10
- return result.lines.join("\n");
11
- }
12
- export {
13
- toolGrep
14
- };
15
- //# sourceMappingURL=grep.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../tools/warp_grep/tools/grep.ts"],"sourcesContent":["import type { WarpGrepProvider } from '../providers/types.js';\n\nexport async function toolGrep(\n provider: WarpGrepProvider,\n args: { pattern: string; path: string }\n): Promise<string> {\n const result = await provider.grep({ pattern: args.pattern, path: args.path });\n // Return error message if present (graceful handling)\n if (result.error) {\n return `[ERROR] ${result.error}`;\n }\n if (!result.lines.length) return 'no new matches';\n return result.lines.join('\\n');\n}\n\n\n"],"mappings":";;;AAEA,eAAsB,SACpB,UACA,MACiB;AACjB,QAAM,SAAS,MAAM,SAAS,KAAK,EAAE,SAAS,KAAK,SAAS,MAAM,KAAK,KAAK,CAAC;AAE7E,MAAI,OAAO,OAAO;AAChB,WAAO,WAAW,OAAO,KAAK;AAAA,EAChC;AACA,MAAI,CAAC,OAAO,MAAM,OAAQ,QAAO;AACjC,SAAO,OAAO,MAAM,KAAK,IAAI;AAC/B;","names":[]}
@@ -1,38 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // tools/warp_grep/tools/read.ts
21
- var read_exports = {};
22
- __export(read_exports, {
23
- toolRead: () => toolRead
24
- });
25
- module.exports = __toCommonJS(read_exports);
26
- async function toolRead(provider, args) {
27
- const res = await provider.read({ path: args.path, start: args.start, end: args.end });
28
- if (res.error) {
29
- return res.error;
30
- }
31
- if (!res.lines.length) return "(empty file)";
32
- return res.lines.join("\n");
33
- }
34
- // Annotate the CommonJS export names for ESM import in node:
35
- 0 && (module.exports = {
36
- toolRead
37
- });
38
- //# sourceMappingURL=read.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../tools/warp_grep/tools/read.ts"],"sourcesContent":["import type { WarpGrepProvider } from '../providers/types.js';\n\nexport async function toolRead(\n provider: WarpGrepProvider,\n args: { path: string; start?: number; end?: number }\n): Promise<string> {\n const res = await provider.read({ path: args.path, start: args.start, end: args.end });\n // Return error message if present (graceful handling)\n if (res.error) {\n return res.error;\n }\n if (!res.lines.length) return '(empty file)';\n return res.lines.join('\\n');\n}\n\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,eAAsB,SACpB,UACA,MACiB;AACjB,QAAM,MAAM,MAAM,SAAS,KAAK,EAAE,MAAM,KAAK,MAAM,OAAO,KAAK,OAAO,KAAK,KAAK,IAAI,CAAC;AAErF,MAAI,IAAI,OAAO;AACb,WAAO,IAAI;AAAA,EACb;AACA,MAAI,CAAC,IAAI,MAAM,OAAQ,QAAO;AAC9B,SAAO,IAAI,MAAM,KAAK,IAAI;AAC5B;","names":[]}
@@ -1,9 +0,0 @@
1
- import { WarpGrepProvider } from '../providers/types.js';
2
-
3
- declare function toolRead(provider: WarpGrepProvider, args: {
4
- path: string;
5
- start?: number;
6
- end?: number;
7
- }): Promise<string>;
8
-
9
- export { toolRead };
@@ -1,8 +0,0 @@
1
- import {
2
- toolRead
3
- } from "../../../chunk-HQO45BAJ.js";
4
- import "../../../chunk-PZ5AY32C.js";
5
- export {
6
- toolRead
7
- };
8
- //# sourceMappingURL=read.js.map
@@ -1,42 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // tools/warp_grep/utils/format.ts
21
- var format_exports = {};
22
- __export(format_exports, {
23
- joinSections: () => joinSections,
24
- section: () => section
25
- });
26
- module.exports = __toCommonJS(format_exports);
27
- function section(name, content) {
28
- const body = content.trim();
29
- if (!body) return "";
30
- return `<${name}>
31
- ${body}
32
- </${name}>`;
33
- }
34
- function joinSections(sections) {
35
- return sections.filter(Boolean).join("\n");
36
- }
37
- // Annotate the CommonJS export names for ESM import in node:
38
- 0 && (module.exports = {
39
- joinSections,
40
- section
41
- });
42
- //# sourceMappingURL=format.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../tools/warp_grep/utils/format.ts"],"sourcesContent":["// Minimal formatting helpers for tool outputs shown to the model\n\nexport function section(name: string, content: string): string {\n const body = content.trim();\n if (!body) return '';\n return `<${name}>\\n${body}\\n</${name}>`;\n}\n\nexport function joinSections(sections: string[]): string {\n return sections.filter(Boolean).join('\\n');\n}\n\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,SAAS,QAAQ,MAAc,SAAyB;AAC7D,QAAM,OAAO,QAAQ,KAAK;AAC1B,MAAI,CAAC,KAAM,QAAO;AAClB,SAAO,IAAI,IAAI;AAAA,EAAM,IAAI;AAAA,IAAO,IAAI;AACtC;AAEO,SAAS,aAAa,UAA4B;AACvD,SAAO,SAAS,OAAO,OAAO,EAAE,KAAK,IAAI;AAC3C;","names":[]}
@@ -1,4 +0,0 @@
1
- declare function section(name: string, content: string): string;
2
- declare function joinSections(sections: string[]): string;
3
-
4
- export { joinSections, section };
@@ -1,18 +0,0 @@
1
- import "../../../chunk-PZ5AY32C.js";
2
-
3
- // tools/warp_grep/utils/format.ts
4
- function section(name, content) {
5
- const body = content.trim();
6
- if (!body) return "";
7
- return `<${name}>
8
- ${body}
9
- </${name}>`;
10
- }
11
- function joinSections(sections) {
12
- return sections.filter(Boolean).join("\n");
13
- }
14
- export {
15
- joinSections,
16
- section
17
- };
18
- //# sourceMappingURL=format.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../tools/warp_grep/utils/format.ts"],"sourcesContent":["// Minimal formatting helpers for tool outputs shown to the model\n\nexport function section(name: string, content: string): string {\n const body = content.trim();\n if (!body) return '';\n return `<${name}>\\n${body}\\n</${name}>`;\n}\n\nexport function joinSections(sections: string[]): string {\n return sections.filter(Boolean).join('\\n');\n}\n\n\n"],"mappings":";;;AAEO,SAAS,QAAQ,MAAc,SAAyB;AAC7D,QAAM,OAAO,QAAQ,KAAK;AAC1B,MAAI,CAAC,KAAM,QAAO;AAClB,SAAO,IAAI,IAAI;AAAA,EAAM,IAAI;AAAA,IAAO,IAAI;AACtC;AAEO,SAAS,aAAa,UAA4B;AACvD,SAAO,SAAS,OAAO,OAAO,EAAE,KAAK,IAAI;AAC3C;","names":[]}