@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.
Files changed (38) hide show
  1. package/dist/{chunk-B3J2O2NW.js → chunk-AB27WETH.js} +4 -4
  2. package/dist/chunk-B5A4XLSQ.js +10 -0
  3. package/dist/chunk-B5A4XLSQ.js.map +1 -0
  4. package/dist/{chunk-P6OEPI4N.js → chunk-GZP6HY5W.js} +3 -19
  5. package/dist/{chunk-P6OEPI4N.js.map → chunk-GZP6HY5W.js.map} +1 -1
  6. package/dist/{chunk-XFCMTW5L.js → chunk-I2GXV3BQ.js} +2 -15
  7. package/dist/{chunk-XFCMTW5L.js.map → chunk-I2GXV3BQ.js.map} +1 -1
  8. package/dist/{chunk-Q6GHKKS5.js → chunk-PT3DGIUF.js} +2 -14
  9. package/dist/{chunk-Q6GHKKS5.js.map → chunk-PT3DGIUF.js.map} +1 -1
  10. package/dist/client.js +4 -4
  11. package/dist/index.cjs +5 -12
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.js +5 -6
  14. package/dist/tools/warp_grep/anthropic.d.ts +78 -3
  15. package/dist/tools/warp_grep/anthropic.js +1 -1
  16. package/dist/tools/warp_grep/gemini.cjs +2 -3
  17. package/dist/tools/warp_grep/gemini.cjs.map +1 -1
  18. package/dist/tools/warp_grep/gemini.d.ts +109 -3
  19. package/dist/tools/warp_grep/gemini.js +44 -7
  20. package/dist/tools/warp_grep/gemini.js.map +1 -1
  21. package/dist/tools/warp_grep/index.cjs +6 -187
  22. package/dist/tools/warp_grep/index.cjs.map +1 -1
  23. package/dist/tools/warp_grep/index.d.ts +89 -9
  24. package/dist/tools/warp_grep/index.js +3 -16
  25. package/dist/tools/warp_grep/openai.d.ts +78 -3
  26. package/dist/tools/warp_grep/openai.js +1 -1
  27. package/dist/tools/warp_grep/vercel.d.ts +56 -3
  28. package/dist/tools/warp_grep/vercel.js +1 -1
  29. package/package.json +1 -1
  30. package/dist/anthropic-BC-AMEIN.d.ts +0 -89
  31. package/dist/chunk-2LSVUHIE.js +0 -75
  32. package/dist/chunk-2LSVUHIE.js.map +0 -1
  33. package/dist/chunk-ISWL67SF.js +0 -1
  34. package/dist/chunk-ISWL67SF.js.map +0 -1
  35. package/dist/gemini-BIFBiIjY.d.ts +0 -119
  36. package/dist/openai-Beb9escY.d.ts +0 -89
  37. package/dist/vercel-Bo84tpBe.d.ts +0 -66
  38. /package/dist/{chunk-B3J2O2NW.js.map → chunk-AB27WETH.js.map} +0 -0
@@ -1,89 +0,0 @@
1
- import { ChatCompletionTool } from 'openai/resources/chat/completions';
2
- import { formatResult } from './tools/warp_grep/client.js';
3
- import { getSystemPrompt } from './tools/warp_grep/agent/prompt.js';
4
- import { d as WarpGrepToolConfig, b as WarpGrepResult } from './types-CnvVDM63.js';
5
-
6
- /**
7
- * OpenAI SDK adapter for morph-warp-grep tool
8
- */
9
-
10
- /**
11
- * OpenAI-native warp grep tool definition
12
- *
13
- * @example
14
- * ```typescript
15
- * import OpenAI from 'openai';
16
- * import { warpGrepTool, execute } from '@morphllm/morphsdk/tools/warp-grep/openai';
17
- *
18
- * const client = new OpenAI();
19
- * const response = await client.chat.completions.create({
20
- * model: 'gpt-4o',
21
- * tools: [warpGrepTool],
22
- * messages: [{ role: 'user', content: 'Find authentication middleware' }]
23
- * });
24
- *
25
- * // Execute the tool call
26
- * const result = await execute({ query: '...' }, { repoRoot: '.' });
27
- * ```
28
- */
29
- declare const warpGrepTool: ChatCompletionTool;
30
- /**
31
- * Execute warp grep search
32
- *
33
- * @param input - Tool input with query
34
- * @param config - Configuration with repoRoot and optional provider
35
- * @returns Search results
36
- */
37
- declare function execute(input: {
38
- query: string;
39
- } | string, config: WarpGrepToolConfig): Promise<WarpGrepResult>;
40
-
41
- /**
42
- * Create a custom warp grep tool with configuration and methods
43
- *
44
- * @param config - Configuration options
45
- * @returns Tool definition with execute and formatResult methods
46
- *
47
- * @example Local usage
48
- * ```typescript
49
- * import OpenAI from 'openai';
50
- * import { createWarpGrepTool } from '@morphllm/morphsdk/tools/warp-grep/openai';
51
- *
52
- * const tool = createWarpGrepTool({ repoRoot: '.' });
53
- *
54
- * const client = new OpenAI();
55
- * const response = await client.chat.completions.create({
56
- * model: 'gpt-4o',
57
- * tools: [tool],
58
- * messages: [{ role: 'user', content: 'Find authentication middleware' }]
59
- * });
60
- * ```
61
- *
62
- * @example Remote sandbox (E2B, Modal, etc.)
63
- * ```typescript
64
- * const tool = createMorphWarpGrepTool({
65
- * repoRoot: '/home/repo',
66
- * remoteCommands: {
67
- * grep: async (pattern, path) => (await sandbox.run(`rg '${pattern}' '${path}'`)).stdout,
68
- * read: async (path, start, end) => (await sandbox.run(`sed -n '${start},${end}p' '${path}'`)).stdout,
69
- * listDir: async (path, maxDepth) => (await sandbox.run(`find '${path}' -maxdepth ${maxDepth}`)).stdout,
70
- * },
71
- * });
72
- * ```
73
- */
74
- declare function createWarpGrepTool(config: WarpGrepToolConfig): ChatCompletionTool & {
75
- execute: (input: unknown) => Promise<WarpGrepResult>;
76
- formatResult: (result: WarpGrepResult) => string;
77
- getSystemPrompt: () => string;
78
- };
79
-
80
- declare const openai_createWarpGrepTool: typeof createWarpGrepTool;
81
- declare const openai_execute: typeof execute;
82
- declare const openai_formatResult: typeof formatResult;
83
- declare const openai_getSystemPrompt: typeof getSystemPrompt;
84
- declare const openai_warpGrepTool: typeof warpGrepTool;
85
- declare namespace openai {
86
- export { openai_createWarpGrepTool as createWarpGrepTool, warpGrepTool as default, openai_execute as execute, openai_formatResult as formatResult, openai_getSystemPrompt as getSystemPrompt, openai_warpGrepTool as warpGrepTool };
87
- }
88
-
89
- export { createWarpGrepTool as c, execute as e, openai as o, warpGrepTool as w };
@@ -1,66 +0,0 @@
1
- import * as ai from 'ai';
2
- import { d as WarpGrepToolConfig, c as WarpGrepContext, b as WarpGrepResult } from './types-CnvVDM63.js';
3
- import { formatResult } from './tools/warp_grep/client.js';
4
- import { getSystemPrompt } from './tools/warp_grep/agent/prompt.js';
5
-
6
- /**
7
- * Execute warp grep search
8
- *
9
- * @param input - Tool input with query
10
- * @param config - Configuration with repoRoot and optional provider
11
- * @returns Search results
12
- */
13
- declare function execute(input: {
14
- query: string;
15
- }, config: WarpGrepToolConfig): Promise<WarpGrepResult>;
16
-
17
- /**
18
- * Create Vercel AI SDK warp grep tool
19
- *
20
- * @param config - Configuration options
21
- * @returns Vercel AI SDK tool
22
- *
23
- * @example Local usage
24
- * ```typescript
25
- * import { generateText } from 'ai';
26
- * import { anthropic } from '@ai-sdk/anthropic';
27
- * import { createWarpGrepTool } from '@morphllm/morphsdk/tools/warp-grep/vercel';
28
- *
29
- * const grepTool = createWarpGrepTool({ repoRoot: '.' });
30
- *
31
- * const result = await generateText({
32
- * model: anthropic('claude-sonnet-4-5-20250929'),
33
- * tools: { grep: grepTool },
34
- * prompt: 'Find authentication middleware'
35
- * });
36
- * ```
37
- *
38
- * @example Remote sandbox (E2B, Modal, etc.)
39
- * ```typescript
40
- * const grepTool = createMorphWarpGrepTool({
41
- * repoRoot: '/home/repo',
42
- * remoteCommands: {
43
- * grep: async (pattern, path) => (await sandbox.run(`rg '${pattern}' '${path}'`)).stdout,
44
- * read: async (path, start, end) => (await sandbox.run(`sed -n '${start},${end}p' '${path}'`)).stdout,
45
- * listDir: async (path, maxDepth) => (await sandbox.run(`find '${path}' -maxdepth ${maxDepth}`)).stdout,
46
- * },
47
- * });
48
- * ```
49
- */
50
- declare function createWarpGrepTool(config: WarpGrepToolConfig): ai.Tool<{
51
- query: string;
52
- }, {
53
- success: boolean;
54
- contexts: WarpGrepContext[] | undefined;
55
- summary: string | undefined;
56
- }>;
57
-
58
- declare const vercel_createWarpGrepTool: typeof createWarpGrepTool;
59
- declare const vercel_execute: typeof execute;
60
- declare const vercel_formatResult: typeof formatResult;
61
- declare const vercel_getSystemPrompt: typeof getSystemPrompt;
62
- declare namespace vercel {
63
- export { vercel_createWarpGrepTool as createWarpGrepTool, createWarpGrepTool as default, vercel_execute as execute, vercel_formatResult as formatResult, vercel_getSystemPrompt as getSystemPrompt };
64
- }
65
-
66
- export { createWarpGrepTool as c, execute as e, vercel as v };