@morphllm/morphsdk 0.2.69 → 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-B3J2O2NW.js → chunk-AB27WETH.js} +4 -4
- package/dist/chunk-B5A4XLSQ.js +10 -0
- package/dist/chunk-B5A4XLSQ.js.map +1 -0
- package/dist/{chunk-P6OEPI4N.js → chunk-GZP6HY5W.js} +3 -19
- package/dist/{chunk-P6OEPI4N.js.map → chunk-GZP6HY5W.js.map} +1 -1
- package/dist/{chunk-XFCMTW5L.js → chunk-I2GXV3BQ.js} +2 -15
- package/dist/{chunk-XFCMTW5L.js.map → chunk-I2GXV3BQ.js.map} +1 -1
- package/dist/{chunk-Q6GHKKS5.js → chunk-PT3DGIUF.js} +2 -14
- package/dist/{chunk-Q6GHKKS5.js.map → chunk-PT3DGIUF.js.map} +1 -1
- package/dist/client.js +4 -4
- package/dist/index.cjs +5 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -6
- package/dist/tools/warp_grep/anthropic.d.ts +78 -3
- package/dist/tools/warp_grep/anthropic.js +1 -1
- package/dist/tools/warp_grep/gemini.cjs +2 -3
- 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 +44 -7
- package/dist/tools/warp_grep/gemini.js.map +1 -1
- package/dist/tools/warp_grep/index.cjs +6 -187
- 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 +3 -16
- package/dist/tools/warp_grep/openai.d.ts +78 -3
- package/dist/tools/warp_grep/openai.js +1 -1
- package/dist/tools/warp_grep/vercel.d.ts +56 -3
- package/dist/tools/warp_grep/vercel.js +1 -1
- package/package.json +1 -1
- package/dist/anthropic-BC-AMEIN.d.ts +0 -89
- package/dist/chunk-2LSVUHIE.js +0 -75
- package/dist/chunk-2LSVUHIE.js.map +0 -1
- package/dist/chunk-ISWL67SF.js +0 -1
- package/dist/chunk-ISWL67SF.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-B3J2O2NW.js.map → chunk-AB27WETH.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import "./chunk-
|
|
2
|
-
import "./chunk-2LSVUHIE.js";
|
|
1
|
+
import "./chunk-B5A4XLSQ.js";
|
|
3
2
|
import {
|
|
4
3
|
AnthropicToolFactory,
|
|
5
4
|
MorphClient,
|
|
6
5
|
OpenAIToolFactory,
|
|
7
6
|
VercelToolFactory
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-AB27WETH.js";
|
|
8
|
+
import "./chunk-PT3DGIUF.js";
|
|
9
|
+
import "./chunk-I2GXV3BQ.js";
|
|
10
|
+
import "./chunk-GZP6HY5W.js";
|
|
12
11
|
import "./chunk-KW7OEGZK.js";
|
|
13
12
|
import {
|
|
14
13
|
WarpGrepClient
|
|
@@ -1,7 +1,82 @@
|
|
|
1
|
-
import '@anthropic-ai/sdk/resources/messages';
|
|
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 '../../types-CnvVDM63.js';
|
|
5
|
-
export { c as createWarpGrepTool, e as execute, w as warpGrepTool } from '../../anthropic-BC-AMEIN.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
|
+
* Anthropic SDK adapter for morph-warp-grep tool
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Anthropic-native warp grep tool definition
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import Anthropic from '@anthropic-ai/sdk';
|
|
18
|
+
* import { warpGrepTool, execute } from '@morphllm/morphsdk/tools/warp-grep/anthropic';
|
|
19
|
+
*
|
|
20
|
+
* const client = new Anthropic();
|
|
21
|
+
* const response = await client.messages.create({
|
|
22
|
+
* model: 'claude-sonnet-4-5-20250929',
|
|
23
|
+
* tools: [warpGrepTool],
|
|
24
|
+
* messages: [{ role: 'user', content: 'Find authentication middleware' }]
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* // Execute the tool call
|
|
28
|
+
* const result = await execute({ query: '...' }, { repoRoot: '.' });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
declare const warpGrepTool: Tool;
|
|
32
|
+
/**
|
|
33
|
+
* Execute warp grep search
|
|
34
|
+
*
|
|
35
|
+
* @param input - Tool input with query
|
|
36
|
+
* @param config - Configuration with repoRoot and optional provider
|
|
37
|
+
* @returns Search results
|
|
38
|
+
*/
|
|
39
|
+
declare function execute(input: {
|
|
40
|
+
query: string;
|
|
41
|
+
} | string, config: WarpGrepToolConfig): Promise<WarpGrepResult>;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Create a custom warp grep tool with configuration and methods
|
|
45
|
+
*
|
|
46
|
+
* @param config - Configuration options
|
|
47
|
+
* @returns Tool definition with execute and formatResult methods
|
|
48
|
+
*
|
|
49
|
+
* @example Local usage
|
|
50
|
+
* ```typescript
|
|
51
|
+
* import Anthropic from '@anthropic-ai/sdk';
|
|
52
|
+
* import { createWarpGrepTool } from '@morphllm/morphsdk/tools/warp-grep/anthropic';
|
|
53
|
+
*
|
|
54
|
+
* const tool = createWarpGrepTool({ repoRoot: '.' });
|
|
55
|
+
*
|
|
56
|
+
* const client = new Anthropic();
|
|
57
|
+
* const response = await client.messages.create({
|
|
58
|
+
* model: 'claude-sonnet-4-5-20250929',
|
|
59
|
+
* tools: [tool],
|
|
60
|
+
* messages: [{ role: 'user', content: 'Find authentication middleware' }]
|
|
61
|
+
* });
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @example Remote sandbox (E2B, Modal, etc.)
|
|
65
|
+
* ```typescript
|
|
66
|
+
* const tool = createMorphWarpGrepTool({
|
|
67
|
+
* repoRoot: '/home/repo',
|
|
68
|
+
* remoteCommands: {
|
|
69
|
+
* grep: async (pattern, path) => (await sandbox.run(`rg '${pattern}' '${path}'`)).stdout,
|
|
70
|
+
* read: async (path, start, end) => (await sandbox.run(`sed -n '${start},${end}p' '${path}'`)).stdout,
|
|
71
|
+
* listDir: async (path, maxDepth) => (await sandbox.run(`find '${path}' -maxdepth ${maxDepth}`)).stdout,
|
|
72
|
+
* },
|
|
73
|
+
* });
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
declare function createWarpGrepTool(config: WarpGrepToolConfig): Tool & {
|
|
77
|
+
execute: (input: unknown) => Promise<WarpGrepResult>;
|
|
78
|
+
formatResult: (result: WarpGrepResult) => string;
|
|
79
|
+
getSystemPrompt: () => string;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export { createWarpGrepTool, execute, warpGrepTool };
|
|
@@ -39,7 +39,6 @@ __export(gemini_exports, {
|
|
|
39
39
|
warpGrepFunctionDeclaration: () => warpGrepFunctionDeclaration
|
|
40
40
|
});
|
|
41
41
|
module.exports = __toCommonJS(gemini_exports);
|
|
42
|
-
var import_generative_ai = require("@google/generative-ai");
|
|
43
42
|
|
|
44
43
|
// tools/warp_grep/agent/config.ts
|
|
45
44
|
var AGENT_CONFIG = {
|
|
@@ -1691,10 +1690,10 @@ var WARP_GREP_DESCRIPTION = 'IMPORTANT: If you need to explore the codebase to g
|
|
|
1691
1690
|
|
|
1692
1691
|
// tools/warp_grep/gemini.ts
|
|
1693
1692
|
var TOOL_PARAMETERS = {
|
|
1694
|
-
type:
|
|
1693
|
+
type: "OBJECT",
|
|
1695
1694
|
properties: {
|
|
1696
1695
|
query: {
|
|
1697
|
-
type:
|
|
1696
|
+
type: "STRING",
|
|
1698
1697
|
description: "Free-form repository question"
|
|
1699
1698
|
}
|
|
1700
1699
|
},
|