@morphllm/morphsdk 0.2.68 → 0.2.70
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.
- package/dist/{chunk-6RFT7K7F.js → chunk-26QXQFLZ.js} +88 -23
- package/dist/chunk-26QXQFLZ.js.map +1 -0
- package/dist/{chunk-RTDKF6NS.js → chunk-5QIWYEHJ.js} +2 -2
- package/dist/{chunk-BYNVJ4ON.js → chunk-7CJPKJEE.js} +2 -2
- package/dist/{chunk-SXE54MIC.js → chunk-AB27WETH.js} +8 -8
- package/dist/chunk-B5A4XLSQ.js +10 -0
- package/dist/chunk-B5A4XLSQ.js.map +1 -0
- package/dist/{chunk-VDJGZIQ5.js → chunk-BGSHC2UK.js} +2 -2
- package/dist/{chunk-VLZEBK7S.js → chunk-E4434A4Y.js} +3 -3
- package/dist/{chunk-QEGH3CWQ.js → chunk-GZP6HY5W.js} +4 -20
- package/dist/{chunk-QEGH3CWQ.js.map → chunk-GZP6HY5W.js.map} +1 -1
- package/dist/{chunk-JPGX6WEV.js → chunk-I2GXV3BQ.js} +3 -16
- package/dist/{chunk-JPGX6WEV.js.map → chunk-I2GXV3BQ.js.map} +1 -1
- package/dist/{chunk-W76ICQKY.js → chunk-IUG2FHNN.js} +2 -2
- package/dist/{chunk-K3EHH3C4.js → chunk-PT3DGIUF.js} +3 -15
- package/dist/{chunk-K3EHH3C4.js.map → chunk-PT3DGIUF.js.map} +1 -1
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/{chunk-223ZMZP6.js → chunk-QIG7YPFW.js} +89 -30
- package/dist/chunk-QIG7YPFW.js.map +1 -0
- package/dist/{chunk-HBWJLKNM.js → chunk-QZNGKOCZ.js} +2 -2
- package/dist/{chunk-AAIUUX4Y.js → chunk-X4WPMVCM.js} +2 -2
- package/dist/client.cjs +174 -434
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +11 -12
- package/dist/git/client.js +1 -1
- package/dist/git/config.js +1 -1
- package/dist/git/index.js +1 -1
- package/dist/index.cjs +179 -446
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -14
- package/dist/modelrouter/core.js +1 -1
- package/dist/modelrouter/index.js +1 -1
- package/dist/tools/browser/anthropic.js +2 -2
- package/dist/tools/browser/core.js +1 -1
- package/dist/tools/browser/index.js +4 -4
- package/dist/tools/browser/live.js +1 -1
- package/dist/tools/browser/openai.js +2 -2
- package/dist/tools/browser/prompts.js +1 -1
- package/dist/tools/browser/vercel.js +2 -2
- package/dist/tools/codebase_search/anthropic.js +1 -1
- package/dist/tools/codebase_search/core.js +1 -1
- package/dist/tools/codebase_search/index.js +1 -1
- package/dist/tools/codebase_search/openai.js +1 -1
- package/dist/tools/codebase_search/prompts.js +1 -1
- package/dist/tools/codebase_search/vercel.js +1 -1
- package/dist/tools/fastapply/anthropic.js +2 -2
- package/dist/tools/fastapply/core.js +1 -1
- package/dist/tools/fastapply/index.js +4 -4
- package/dist/tools/fastapply/openai.js +2 -2
- package/dist/tools/fastapply/prompts.js +1 -1
- package/dist/tools/fastapply/vercel.js +2 -2
- package/dist/tools/index.js +4 -4
- package/dist/tools/utils/resilience.js +1 -1
- package/dist/tools/warp_grep/agent/config.js +1 -1
- package/dist/tools/warp_grep/agent/formatter.js +1 -1
- package/dist/tools/warp_grep/agent/parser.js +1 -1
- package/dist/tools/warp_grep/agent/prompt.js +1 -1
- package/dist/tools/warp_grep/agent/runner.js +1 -1
- package/dist/tools/warp_grep/anthropic.cjs +174 -434
- package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
- package/dist/tools/warp_grep/anthropic.d.ts +78 -3
- package/dist/tools/warp_grep/anthropic.js +5 -6
- package/dist/tools/warp_grep/client.cjs +174 -434
- package/dist/tools/warp_grep/client.cjs.map +1 -1
- package/dist/tools/warp_grep/client.js +4 -5
- package/dist/tools/warp_grep/gemini.cjs +176 -437
- package/dist/tools/warp_grep/gemini.cjs.map +1 -1
- package/dist/tools/warp_grep/gemini.d.ts +109 -3
- package/dist/tools/warp_grep/gemini.js +48 -12
- package/dist/tools/warp_grep/gemini.js.map +1 -1
- package/dist/tools/warp_grep/harness.cjs +88 -417
- package/dist/tools/warp_grep/harness.cjs.map +1 -1
- package/dist/tools/warp_grep/harness.js +2 -3
- package/dist/tools/warp_grep/harness.js.map +1 -1
- package/dist/tools/warp_grep/index.cjs +180 -621
- package/dist/tools/warp_grep/index.cjs.map +1 -1
- package/dist/tools/warp_grep/index.d.ts +89 -9
- package/dist/tools/warp_grep/index.js +7 -21
- package/dist/tools/warp_grep/openai.cjs +174 -434
- package/dist/tools/warp_grep/openai.cjs.map +1 -1
- package/dist/tools/warp_grep/openai.d.ts +78 -3
- package/dist/tools/warp_grep/openai.js +5 -6
- package/dist/tools/warp_grep/providers/local.cjs +88 -417
- package/dist/tools/warp_grep/providers/local.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/local.d.ts +0 -6
- package/dist/tools/warp_grep/providers/local.js +2 -3
- package/dist/tools/warp_grep/providers/remote.cjs +86 -408
- package/dist/tools/warp_grep/providers/remote.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/remote.d.ts +0 -7
- package/dist/tools/warp_grep/providers/remote.js +2 -3
- package/dist/tools/warp_grep/utils/files.js +1 -1
- package/dist/tools/warp_grep/utils/paths.js +1 -1
- package/dist/tools/warp_grep/utils/ripgrep.js +1 -1
- package/dist/tools/warp_grep/vercel.cjs +174 -434
- package/dist/tools/warp_grep/vercel.cjs.map +1 -1
- package/dist/tools/warp_grep/vercel.d.ts +56 -3
- package/dist/tools/warp_grep/vercel.js +5 -6
- package/package.json +1 -1
- package/dist/anthropic-BC-AMEIN.d.ts +0 -89
- package/dist/chunk-223ZMZP6.js.map +0 -1
- package/dist/chunk-6RFT7K7F.js.map +0 -1
- package/dist/chunk-FURFQDXF.js +0 -75
- package/dist/chunk-FURFQDXF.js.map +0 -1
- package/dist/chunk-HKJ2B2AA.js +0 -15
- package/dist/chunk-ISWL67SF.js +0 -1
- package/dist/chunk-ISWL67SF.js.map +0 -1
- package/dist/chunk-S6KU22MU.js +0 -396
- package/dist/chunk-S6KU22MU.js.map +0 -1
- package/dist/gemini-BIFBiIjY.d.ts +0 -119
- package/dist/openai-Beb9escY.d.ts +0 -89
- package/dist/vercel-Bo84tpBe.d.ts +0 -66
- /package/dist/{chunk-RTDKF6NS.js.map → chunk-5QIWYEHJ.js.map} +0 -0
- /package/dist/{chunk-BYNVJ4ON.js.map → chunk-7CJPKJEE.js.map} +0 -0
- /package/dist/{chunk-SXE54MIC.js.map → chunk-AB27WETH.js.map} +0 -0
- /package/dist/{chunk-VDJGZIQ5.js.map → chunk-BGSHC2UK.js.map} +0 -0
- /package/dist/{chunk-VLZEBK7S.js.map → chunk-E4434A4Y.js.map} +0 -0
- /package/dist/{chunk-W76ICQKY.js.map → chunk-IUG2FHNN.js.map} +0 -0
- /package/dist/{chunk-HKJ2B2AA.js.map → chunk-PZ5AY32C.js.map} +0 -0
- /package/dist/{chunk-HBWJLKNM.js.map → chunk-QZNGKOCZ.js.map} +0 -0
- /package/dist/{chunk-AAIUUX4Y.js.map → chunk-X4WPMVCM.js.map} +0 -0
|
@@ -1,7 +1,113 @@
|
|
|
1
|
-
import '@google/generative-ai';
|
|
1
|
+
import { FunctionDeclaration } from '@google/generative-ai';
|
|
2
2
|
export { formatResult } from './client.js';
|
|
3
3
|
export { getSystemPrompt } from './agent/prompt.js';
|
|
4
|
-
import '../../types-CnvVDM63.js';
|
|
5
|
-
export { G as GeminiWarpGrepTool, a as createMorphWarpGrepTool, c as createWarpGrepTool, w as default, e as execute, w as warpGrepFunctionDeclaration } from '../../gemini-BIFBiIjY.js';
|
|
4
|
+
import { d as WarpGrepToolConfig, b as WarpGrepResult } from '../../types-CnvVDM63.js';
|
|
6
5
|
import './providers/types.js';
|
|
7
6
|
import '../utils/resilience.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Google Gemini SDK adapter for morph-warp-grep tool
|
|
10
|
+
*
|
|
11
|
+
* Requires @google/generative-ai as a peer dependency.
|
|
12
|
+
* Install with: npm install @google/generative-ai
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Gemini-native warp grep function declaration
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* import { GoogleGenerativeAI } from '@google/generative-ai';
|
|
21
|
+
* import { warpGrepFunctionDeclaration, execute } from '@morphllm/morphsdk/tools/warp-grep/gemini';
|
|
22
|
+
*
|
|
23
|
+
* const genAI = new GoogleGenerativeAI(process.env.GOOGLE_API_KEY);
|
|
24
|
+
* const model = genAI.getGenerativeModel({
|
|
25
|
+
* model: 'gemini-2.0-flash',
|
|
26
|
+
* tools: [{ functionDeclarations: [warpGrepFunctionDeclaration] }]
|
|
27
|
+
* });
|
|
28
|
+
*
|
|
29
|
+
* const chat = model.startChat();
|
|
30
|
+
* const result = await chat.sendMessage('Find authentication middleware');
|
|
31
|
+
*
|
|
32
|
+
* // Handle function call
|
|
33
|
+
* const call = result.response.functionCalls()?.[0];
|
|
34
|
+
* if (call) {
|
|
35
|
+
* const searchResult = await execute(call.args, { repoRoot: '.' });
|
|
36
|
+
* console.log(searchResult);
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
declare const warpGrepFunctionDeclaration: FunctionDeclaration;
|
|
41
|
+
/**
|
|
42
|
+
* Execute warp grep search
|
|
43
|
+
*
|
|
44
|
+
* @param input - Tool input with query
|
|
45
|
+
* @param config - Configuration with repoRoot and optional provider
|
|
46
|
+
* @returns Search results
|
|
47
|
+
*/
|
|
48
|
+
declare function execute(input: {
|
|
49
|
+
query: string;
|
|
50
|
+
} | string, config: WarpGrepToolConfig): Promise<WarpGrepResult>;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Gemini tool with execute method attached
|
|
54
|
+
*/
|
|
55
|
+
interface GeminiWarpGrepTool extends FunctionDeclaration {
|
|
56
|
+
execute: (input: unknown) => Promise<WarpGrepResult>;
|
|
57
|
+
formatResult: (result: WarpGrepResult) => string;
|
|
58
|
+
getSystemPrompt: () => string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Create a custom warp grep tool with configuration and methods
|
|
62
|
+
*
|
|
63
|
+
* @param config - Configuration options
|
|
64
|
+
* @returns Function declaration with execute and formatResult methods
|
|
65
|
+
*
|
|
66
|
+
* @example Local usage
|
|
67
|
+
* ```typescript
|
|
68
|
+
* import { GoogleGenerativeAI } from '@google/generative-ai';
|
|
69
|
+
* import { createMorphWarpGrepTool } from '@morphllm/morphsdk/tools/warp-grep/gemini';
|
|
70
|
+
*
|
|
71
|
+
* const tool = createMorphWarpGrepTool({ repoRoot: '.' });
|
|
72
|
+
*
|
|
73
|
+
* const genAI = new GoogleGenerativeAI(process.env.GOOGLE_API_KEY);
|
|
74
|
+
* const model = genAI.getGenerativeModel({
|
|
75
|
+
* model: 'gemini-2.0-flash',
|
|
76
|
+
* tools: [{ functionDeclarations: [tool] }]
|
|
77
|
+
* });
|
|
78
|
+
*
|
|
79
|
+
* const chat = model.startChat();
|
|
80
|
+
* const result = await chat.sendMessage('Find authentication middleware');
|
|
81
|
+
*
|
|
82
|
+
* // Handle function call
|
|
83
|
+
* const call = result.response.functionCalls()?.[0];
|
|
84
|
+
* if (call && call.name === tool.name) {
|
|
85
|
+
* const searchResult = await tool.execute(call.args);
|
|
86
|
+
* console.log(tool.formatResult(searchResult));
|
|
87
|
+
*
|
|
88
|
+
* // Send result back to model
|
|
89
|
+
* await chat.sendMessage([{
|
|
90
|
+
* functionResponse: {
|
|
91
|
+
* name: call.name,
|
|
92
|
+
* response: { result: tool.formatResult(searchResult) }
|
|
93
|
+
* }
|
|
94
|
+
* }]);
|
|
95
|
+
* }
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* @example Remote sandbox (E2B, Modal, etc.)
|
|
99
|
+
* ```typescript
|
|
100
|
+
* const tool = createMorphWarpGrepTool({
|
|
101
|
+
* repoRoot: '/home/repo',
|
|
102
|
+
* remoteCommands: {
|
|
103
|
+
* grep: async (pattern, path) => (await sandbox.run(`rg '${pattern}' '${path}'`)).stdout,
|
|
104
|
+
* read: async (path, start, end) => (await sandbox.run(`sed -n '${start},${end}p' '${path}'`)).stdout,
|
|
105
|
+
* listDir: async (path, maxDepth) => (await sandbox.run(`find '${path}' -maxdepth ${maxDepth}`)).stdout,
|
|
106
|
+
* },
|
|
107
|
+
* });
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
declare function createWarpGrepTool(config: WarpGrepToolConfig): GeminiWarpGrepTool;
|
|
111
|
+
declare const createMorphWarpGrepTool: typeof createWarpGrepTool;
|
|
112
|
+
|
|
113
|
+
export { type GeminiWarpGrepTool, createMorphWarpGrepTool, createWarpGrepTool, warpGrepFunctionDeclaration as default, execute, warpGrepFunctionDeclaration };
|
|
@@ -1,30 +1,66 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
gemini_default,
|
|
6
|
-
warpGrepFunctionDeclaration
|
|
7
|
-
} from "../../chunk-FURFQDXF.js";
|
|
8
|
-
import "../../chunk-KW7OEGZK.js";
|
|
2
|
+
WARP_GREP_DESCRIPTION,
|
|
3
|
+
WARP_GREP_TOOL_NAME
|
|
4
|
+
} from "../../chunk-KW7OEGZK.js";
|
|
9
5
|
import {
|
|
6
|
+
executeToolCall,
|
|
10
7
|
formatResult
|
|
11
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-E4434A4Y.js";
|
|
12
9
|
import "../../chunk-SUBBMTMY.js";
|
|
13
|
-
import "../../chunk-
|
|
10
|
+
import "../../chunk-26QXQFLZ.js";
|
|
14
11
|
import "../../chunk-DCIUCDWJ.js";
|
|
15
12
|
import "../../chunk-APP75CBN.js";
|
|
16
13
|
import "../../chunk-5QRN3JNB.js";
|
|
17
14
|
import {
|
|
18
15
|
getSystemPrompt
|
|
19
16
|
} from "../../chunk-Q5AHGIQO.js";
|
|
20
|
-
import "../../chunk-
|
|
17
|
+
import "../../chunk-QIG7YPFW.js";
|
|
21
18
|
import "../../chunk-G2RSY56Q.js";
|
|
22
19
|
import "../../chunk-SMGZ6A64.js";
|
|
23
20
|
import "../../chunk-TPP2UGQP.js";
|
|
24
|
-
import "../../chunk-S6KU22MU.js";
|
|
25
21
|
import "../../chunk-XT5ZO6ES.js";
|
|
26
22
|
import "../../chunk-4VWJFZVS.js";
|
|
27
|
-
import "../../chunk-
|
|
23
|
+
import "../../chunk-PZ5AY32C.js";
|
|
24
|
+
|
|
25
|
+
// tools/warp_grep/gemini.ts
|
|
26
|
+
var TOOL_PARAMETERS = {
|
|
27
|
+
type: "OBJECT",
|
|
28
|
+
properties: {
|
|
29
|
+
query: {
|
|
30
|
+
type: "STRING",
|
|
31
|
+
description: "Free-form repository question"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
required: ["query"]
|
|
35
|
+
};
|
|
36
|
+
var warpGrepFunctionDeclaration = {
|
|
37
|
+
name: WARP_GREP_TOOL_NAME,
|
|
38
|
+
description: WARP_GREP_DESCRIPTION,
|
|
39
|
+
parameters: TOOL_PARAMETERS
|
|
40
|
+
};
|
|
41
|
+
async function execute(input, config) {
|
|
42
|
+
return executeToolCall(input, config);
|
|
43
|
+
}
|
|
44
|
+
function createWarpGrepTool(config) {
|
|
45
|
+
const declaration = {
|
|
46
|
+
name: config.name ?? WARP_GREP_TOOL_NAME,
|
|
47
|
+
description: config.description ?? WARP_GREP_DESCRIPTION,
|
|
48
|
+
parameters: TOOL_PARAMETERS
|
|
49
|
+
};
|
|
50
|
+
return Object.assign(declaration, {
|
|
51
|
+
execute: async (input) => {
|
|
52
|
+
return executeToolCall(input, config);
|
|
53
|
+
},
|
|
54
|
+
formatResult: (result) => {
|
|
55
|
+
return formatResult(result);
|
|
56
|
+
},
|
|
57
|
+
getSystemPrompt: () => {
|
|
58
|
+
return getSystemPrompt();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
var createMorphWarpGrepTool = createWarpGrepTool;
|
|
63
|
+
var gemini_default = warpGrepFunctionDeclaration;
|
|
28
64
|
export {
|
|
29
65
|
createMorphWarpGrepTool,
|
|
30
66
|
createWarpGrepTool,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../tools/warp_grep/gemini.ts"],"sourcesContent":["/**\n * Google Gemini SDK adapter for morph-warp-grep tool\n * \n * Requires @google/generative-ai as a peer dependency.\n * Install with: npm install @google/generative-ai\n */\n\nimport type { FunctionDeclaration, FunctionDeclarationSchema } from '@google/generative-ai';\nimport { executeToolCall, formatResult } from './client.js';\nimport { WARP_GREP_DESCRIPTION, WARP_GREP_TOOL_NAME, getSystemPrompt } from './prompts.js';\nimport type { WarpGrepToolConfig, WarpGrepResult } from './types.js';\n\n// Use plain object to avoid runtime import of SchemaType enum\nconst TOOL_PARAMETERS = {\n type: 'OBJECT',\n properties: {\n query: { \n type: 'STRING', \n description: 'Free-form repository question' \n },\n },\n required: ['query'],\n} as unknown as FunctionDeclarationSchema;\n\n/**\n * Gemini-native warp grep function declaration\n * \n * @example\n * ```typescript\n * import { GoogleGenerativeAI } from '@google/generative-ai';\n * import { warpGrepFunctionDeclaration, execute } from '@morphllm/morphsdk/tools/warp-grep/gemini';\n * \n * const genAI = new GoogleGenerativeAI(process.env.GOOGLE_API_KEY);\n * const model = genAI.getGenerativeModel({\n * model: 'gemini-2.0-flash',\n * tools: [{ functionDeclarations: [warpGrepFunctionDeclaration] }]\n * });\n * \n * const chat = model.startChat();\n * const result = await chat.sendMessage('Find authentication middleware');\n * \n * // Handle function call\n * const call = result.response.functionCalls()?.[0];\n * if (call) {\n * const searchResult = await execute(call.args, { repoRoot: '.' });\n * console.log(searchResult);\n * }\n * ```\n */\nexport const warpGrepFunctionDeclaration: FunctionDeclaration = {\n name: WARP_GREP_TOOL_NAME,\n description: WARP_GREP_DESCRIPTION,\n parameters: TOOL_PARAMETERS,\n};\n\n/**\n * Execute warp grep search\n * \n * @param input - Tool input with query\n * @param config - Configuration with repoRoot and optional provider\n * @returns Search results\n */\nexport async function execute(\n input: { query: string } | string,\n config: WarpGrepToolConfig\n): Promise<WarpGrepResult> {\n return executeToolCall(input, config);\n}\n\nexport { formatResult, getSystemPrompt };\n\n/**\n * Gemini tool with execute method attached\n */\nexport interface GeminiWarpGrepTool extends FunctionDeclaration {\n execute: (input: unknown) => Promise<WarpGrepResult>;\n formatResult: (result: WarpGrepResult) => string;\n getSystemPrompt: () => string;\n}\n\n/**\n * Create a custom warp grep tool with configuration and methods\n * \n * @param config - Configuration options\n * @returns Function declaration with execute and formatResult methods\n * \n * @example Local usage\n * ```typescript\n * import { GoogleGenerativeAI } from '@google/generative-ai';\n * import { createMorphWarpGrepTool } from '@morphllm/morphsdk/tools/warp-grep/gemini';\n * \n * const tool = createMorphWarpGrepTool({ repoRoot: '.' });\n * \n * const genAI = new GoogleGenerativeAI(process.env.GOOGLE_API_KEY);\n * const model = genAI.getGenerativeModel({\n * model: 'gemini-2.0-flash',\n * tools: [{ functionDeclarations: [tool] }]\n * });\n * \n * const chat = model.startChat();\n * const result = await chat.sendMessage('Find authentication middleware');\n * \n * // Handle function call\n * const call = result.response.functionCalls()?.[0];\n * if (call && call.name === tool.name) {\n * const searchResult = await tool.execute(call.args);\n * console.log(tool.formatResult(searchResult));\n * \n * // Send result back to model\n * await chat.sendMessage([{\n * functionResponse: {\n * name: call.name,\n * response: { result: tool.formatResult(searchResult) }\n * }\n * }]);\n * }\n * ```\n * \n * @example Remote sandbox (E2B, Modal, etc.)\n * ```typescript\n * const tool = createMorphWarpGrepTool({\n * repoRoot: '/home/repo',\n * remoteCommands: {\n * grep: async (pattern, path) => (await sandbox.run(`rg '${pattern}' '${path}'`)).stdout,\n * read: async (path, start, end) => (await sandbox.run(`sed -n '${start},${end}p' '${path}'`)).stdout,\n * listDir: async (path, maxDepth) => (await sandbox.run(`find '${path}' -maxdepth ${maxDepth}`)).stdout,\n * },\n * });\n * ```\n */\nexport function createWarpGrepTool(config: WarpGrepToolConfig): GeminiWarpGrepTool {\n const declaration: FunctionDeclaration = {\n name: config.name ?? WARP_GREP_TOOL_NAME,\n description: config.description ?? WARP_GREP_DESCRIPTION,\n parameters: TOOL_PARAMETERS,\n };\n\n return Object.assign(declaration, {\n execute: async (input: unknown): Promise<WarpGrepResult> => {\n return executeToolCall(input as { query: string } | string, config);\n },\n formatResult: (result: WarpGrepResult): string => {\n return formatResult(result);\n },\n getSystemPrompt: (): string => {\n return getSystemPrompt();\n },\n });\n}\n\n// Legacy alias for backwards compatibility\nexport const createMorphWarpGrepTool = createWarpGrepTool;\n\nexport default warpGrepFunctionDeclaration;\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAM,kBAAkB;AAAA,EACtB,MAAM;AAAA,EACN,YAAY;AAAA,IACV,OAAO;AAAA,MACL,MAAM;AAAA,MACN,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,UAAU,CAAC,OAAO;AACpB;AA2BO,IAAM,8BAAmD;AAAA,EAC9D,MAAM;AAAA,EACN,aAAa;AAAA,EACb,YAAY;AACd;AASA,eAAsB,QACpB,OACA,QACyB;AACzB,SAAO,gBAAgB,OAAO,MAAM;AACtC;AA+DO,SAAS,mBAAmB,QAAgD;AACjF,QAAM,cAAmC;AAAA,IACvC,MAAM,OAAO,QAAQ;AAAA,IACrB,aAAa,OAAO,eAAe;AAAA,IACnC,YAAY;AAAA,EACd;AAEA,SAAO,OAAO,OAAO,aAAa;AAAA,IAChC,SAAS,OAAO,UAA4C;AAC1D,aAAO,gBAAgB,OAAqC,MAAM;AAAA,IACpE;AAAA,IACA,cAAc,CAAC,WAAmC;AAChD,aAAO,aAAa,MAAM;AAAA,IAC5B;AAAA,IACA,iBAAiB,MAAc;AAC7B,aAAO,gBAAgB;AAAA,IACzB;AAAA,EACF,CAAC;AACH;AAGO,IAAM,0BAA0B;AAEvC,IAAO,iBAAQ;","names":[]}
|