@codeany/open-agent-sdk 0.2.1 → 0.2.2
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/.env.example +8 -0
- package/examples/01-simple-query.ts +43 -0
- package/examples/02-multi-tool.ts +44 -0
- package/examples/03-multi-turn.ts +39 -0
- package/examples/04-prompt-api.ts +29 -0
- package/examples/05-custom-system-prompt.ts +26 -0
- package/examples/06-mcp-server.ts +49 -0
- package/examples/07-custom-tools.ts +87 -0
- package/examples/08-official-api-compat.ts +38 -0
- package/examples/09-subagents.ts +48 -0
- package/examples/10-permissions.ts +40 -0
- package/examples/11-custom-mcp-tools.ts +101 -0
- package/examples/12-skills.ts +88 -0
- package/examples/13-hooks.ts +88 -0
- package/examples/14-openai-compat.ts +71 -0
- package/examples/web/index.html +365 -0
- package/examples/web/server.ts +157 -0
- package/package.json +1 -7
- package/src/engine.ts +3 -0
- package/tsconfig.json +19 -0
- package/dist/agent.d.ts +0 -113
- package/dist/agent.d.ts.map +0 -1
- package/dist/agent.js +0 -446
- package/dist/agent.js.map +0 -1
- package/dist/engine.d.ts +0 -62
- package/dist/engine.d.ts.map +0 -1
- package/dist/engine.js +0 -494
- package/dist/engine.js.map +0 -1
- package/dist/hooks.d.ts +0 -111
- package/dist/hooks.d.ts.map +0 -1
- package/dist/hooks.js +0 -179
- package/dist/hooks.js.map +0 -1
- package/dist/index.d.ts +0 -66
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -133
- package/dist/index.js.map +0 -1
- package/dist/mcp/client.d.ts +0 -19
- package/dist/mcp/client.d.ts.map +0 -1
- package/dist/mcp/client.js +0 -126
- package/dist/mcp/client.js.map +0 -1
- package/dist/providers/anthropic.d.ts +0 -17
- package/dist/providers/anthropic.d.ts.map +0 -1
- package/dist/providers/anthropic.js +0 -47
- package/dist/providers/anthropic.js.map +0 -1
- package/dist/providers/index.d.ts +0 -20
- package/dist/providers/index.d.ts.map +0 -1
- package/dist/providers/index.js +0 -26
- package/dist/providers/index.js.map +0 -1
- package/dist/providers/openai.d.ts +0 -26
- package/dist/providers/openai.d.ts.map +0 -1
- package/dist/providers/openai.js +0 -212
- package/dist/providers/openai.js.map +0 -1
- package/dist/providers/types.d.ts +0 -84
- package/dist/providers/types.d.ts.map +0 -1
- package/dist/providers/types.js +0 -11
- package/dist/providers/types.js.map +0 -1
- package/dist/sdk-mcp-server.d.ts +0 -52
- package/dist/sdk-mcp-server.d.ts.map +0 -1
- package/dist/sdk-mcp-server.js +0 -57
- package/dist/sdk-mcp-server.js.map +0 -1
- package/dist/session.d.ts +0 -73
- package/dist/session.d.ts.map +0 -1
- package/dist/session.js +0 -159
- package/dist/session.js.map +0 -1
- package/dist/skills/bundled/commit.d.ts +0 -7
- package/dist/skills/bundled/commit.d.ts.map +0 -1
- package/dist/skills/bundled/commit.js +0 -35
- package/dist/skills/bundled/commit.js.map +0 -1
- package/dist/skills/bundled/debug.d.ts +0 -7
- package/dist/skills/bundled/debug.d.ts.map +0 -1
- package/dist/skills/bundled/debug.js +0 -46
- package/dist/skills/bundled/debug.js.map +0 -1
- package/dist/skills/bundled/index.d.ts +0 -11
- package/dist/skills/bundled/index.d.ts.map +0 -1
- package/dist/skills/bundled/index.js +0 -26
- package/dist/skills/bundled/index.js.map +0 -1
- package/dist/skills/bundled/review.d.ts +0 -7
- package/dist/skills/bundled/review.d.ts.map +0 -1
- package/dist/skills/bundled/review.js +0 -38
- package/dist/skills/bundled/review.js.map +0 -1
- package/dist/skills/bundled/simplify.d.ts +0 -8
- package/dist/skills/bundled/simplify.d.ts.map +0 -1
- package/dist/skills/bundled/simplify.js +0 -48
- package/dist/skills/bundled/simplify.js.map +0 -1
- package/dist/skills/bundled/test.d.ts +0 -7
- package/dist/skills/bundled/test.d.ts.map +0 -1
- package/dist/skills/bundled/test.js +0 -40
- package/dist/skills/bundled/test.js.map +0 -1
- package/dist/skills/index.d.ts +0 -7
- package/dist/skills/index.d.ts.map +0 -1
- package/dist/skills/index.js +0 -8
- package/dist/skills/index.js.map +0 -1
- package/dist/skills/registry.d.ts +0 -43
- package/dist/skills/registry.d.ts.map +0 -1
- package/dist/skills/registry.js +0 -111
- package/dist/skills/registry.js.map +0 -1
- package/dist/skills/types.d.ts +0 -83
- package/dist/skills/types.d.ts.map +0 -1
- package/dist/skills/types.js +0 -8
- package/dist/skills/types.js.map +0 -1
- package/dist/tool-helper.d.ts +0 -73
- package/dist/tool-helper.d.ts.map +0 -1
- package/dist/tool-helper.js +0 -86
- package/dist/tool-helper.js.map +0 -1
- package/dist/tools/agent-tool.d.ts +0 -17
- package/dist/tools/agent-tool.d.ts.map +0 -1
- package/dist/tools/agent-tool.js +0 -146
- package/dist/tools/agent-tool.js.map +0 -1
- package/dist/tools/ask-user.d.ts +0 -18
- package/dist/tools/ask-user.d.ts.map +0 -1
- package/dist/tools/ask-user.js +0 -72
- package/dist/tools/ask-user.js.map +0 -1
- package/dist/tools/bash.d.ts +0 -5
- package/dist/tools/bash.d.ts.map +0 -1
- package/dist/tools/bash.js +0 -67
- package/dist/tools/bash.js.map +0 -1
- package/dist/tools/config-tool.d.ts +0 -20
- package/dist/tools/config-tool.d.ts.map +0 -1
- package/dist/tools/config-tool.js +0 -83
- package/dist/tools/config-tool.js.map +0 -1
- package/dist/tools/cron-tools.d.ts +0 -33
- package/dist/tools/cron-tools.d.ts.map +0 -1
- package/dist/tools/cron-tools.js +0 -128
- package/dist/tools/cron-tools.js.map +0 -1
- package/dist/tools/edit.d.ts +0 -5
- package/dist/tools/edit.d.ts.map +0 -1
- package/dist/tools/edit.js +0 -70
- package/dist/tools/edit.js.map +0 -1
- package/dist/tools/glob.d.ts +0 -5
- package/dist/tools/glob.d.ts.map +0 -1
- package/dist/tools/glob.js +0 -75
- package/dist/tools/glob.js.map +0 -1
- package/dist/tools/grep.d.ts +0 -5
- package/dist/tools/grep.d.ts.map +0 -1
- package/dist/tools/grep.js +0 -168
- package/dist/tools/grep.js.map +0 -1
- package/dist/tools/index.d.ts +0 -45
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -162
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/lsp-tool.d.ts +0 -9
- package/dist/tools/lsp-tool.d.ts.map +0 -1
- package/dist/tools/lsp-tool.js +0 -137
- package/dist/tools/lsp-tool.js.map +0 -1
- package/dist/tools/mcp-resource-tools.d.ts +0 -14
- package/dist/tools/mcp-resource-tools.d.ts.map +0 -1
- package/dist/tools/mcp-resource-tools.js +0 -117
- package/dist/tools/mcp-resource-tools.js.map +0 -1
- package/dist/tools/notebook-edit.d.ts +0 -5
- package/dist/tools/notebook-edit.d.ts.map +0 -1
- package/dist/tools/notebook-edit.js +0 -85
- package/dist/tools/notebook-edit.js.map +0 -1
- package/dist/tools/plan-tools.d.ts +0 -12
- package/dist/tools/plan-tools.d.ts.map +0 -1
- package/dist/tools/plan-tools.js +0 -77
- package/dist/tools/plan-tools.js.map +0 -1
- package/dist/tools/read.d.ts +0 -5
- package/dist/tools/read.d.ts.map +0 -1
- package/dist/tools/read.js +0 -66
- package/dist/tools/read.js.map +0 -1
- package/dist/tools/send-message.d.ts +0 -31
- package/dist/tools/send-message.d.ts.map +0 -1
- package/dist/tools/send-message.js +0 -77
- package/dist/tools/send-message.js.map +0 -1
- package/dist/tools/skill-tool.d.ts +0 -9
- package/dist/tools/skill-tool.d.ts.map +0 -1
- package/dist/tools/skill-tool.js +0 -115
- package/dist/tools/skill-tool.js.map +0 -1
- package/dist/tools/task-tools.d.ts +0 -48
- package/dist/tools/task-tools.d.ts.map +0 -1
- package/dist/tools/task-tools.js +0 -242
- package/dist/tools/task-tools.js.map +0 -1
- package/dist/tools/team-tools.d.ts +0 -34
- package/dist/tools/team-tools.d.ts.map +0 -1
- package/dist/tools/team-tools.js +0 -103
- package/dist/tools/team-tools.js.map +0 -1
- package/dist/tools/todo-tool.d.ts +0 -22
- package/dist/tools/todo-tool.d.ts.map +0 -1
- package/dist/tools/todo-tool.js +0 -93
- package/dist/tools/todo-tool.js.map +0 -1
- package/dist/tools/tool-search.d.ts +0 -13
- package/dist/tools/tool-search.d.ts.map +0 -1
- package/dist/tools/tool-search.js +0 -76
- package/dist/tools/tool-search.js.map +0 -1
- package/dist/tools/types.d.ts +0 -29
- package/dist/tools/types.d.ts.map +0 -1
- package/dist/tools/types.js +0 -52
- package/dist/tools/types.js.map +0 -1
- package/dist/tools/web-fetch.d.ts +0 -5
- package/dist/tools/web-fetch.d.ts.map +0 -1
- package/dist/tools/web-fetch.js +0 -60
- package/dist/tools/web-fetch.js.map +0 -1
- package/dist/tools/web-search.d.ts +0 -5
- package/dist/tools/web-search.d.ts.map +0 -1
- package/dist/tools/web-search.js +0 -77
- package/dist/tools/web-search.js.map +0 -1
- package/dist/tools/worktree-tools.d.ts +0 -10
- package/dist/tools/worktree-tools.d.ts.map +0 -1
- package/dist/tools/worktree-tools.js +0 -130
- package/dist/tools/worktree-tools.js.map +0 -1
- package/dist/tools/write.d.ts +0 -5
- package/dist/tools/write.d.ts.map +0 -1
- package/dist/tools/write.js +0 -40
- package/dist/tools/write.js.map +0 -1
- package/dist/types.d.ts +0 -423
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -5
- package/dist/types.js.map +0 -1
- package/dist/utils/compact.d.ts +0 -44
- package/dist/utils/compact.d.ts.map +0 -1
- package/dist/utils/compact.js +0 -162
- package/dist/utils/compact.js.map +0 -1
- package/dist/utils/context.d.ts +0 -35
- package/dist/utils/context.d.ts.map +0 -1
- package/dist/utils/context.js +0 -174
- package/dist/utils/context.js.map +0 -1
- package/dist/utils/fileCache.d.ts +0 -64
- package/dist/utils/fileCache.d.ts.map +0 -1
- package/dist/utils/fileCache.js +0 -117
- package/dist/utils/fileCache.js.map +0 -1
- package/dist/utils/messages.d.ts +0 -57
- package/dist/utils/messages.d.ts.map +0 -1
- package/dist/utils/messages.js +0 -152
- package/dist/utils/messages.js.map +0 -1
- package/dist/utils/retry.d.ts +0 -48
- package/dist/utils/retry.d.ts.map +0 -1
- package/dist/utils/retry.js +0 -111
- package/dist/utils/retry.js.map +0 -1
- package/dist/utils/tokens.d.ts +0 -57
- package/dist/utils/tokens.d.ts.map +0 -1
- package/dist/utils/tokens.js +0 -134
- package/dist/utils/tokens.js.map +0 -1
package/dist/tools/edit.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* FileEditTool - Precise string replacement in files
|
|
3
|
-
*/
|
|
4
|
-
import { readFile, writeFile } from 'fs/promises';
|
|
5
|
-
import { resolve } from 'path';
|
|
6
|
-
import { defineTool } from './types.js';
|
|
7
|
-
export const FileEditTool = defineTool({
|
|
8
|
-
name: 'Edit',
|
|
9
|
-
description: 'Perform exact string replacements in files. The old_string must match exactly (including whitespace and indentation). Use replace_all to change every occurrence.',
|
|
10
|
-
inputSchema: {
|
|
11
|
-
type: 'object',
|
|
12
|
-
properties: {
|
|
13
|
-
file_path: {
|
|
14
|
-
type: 'string',
|
|
15
|
-
description: 'The absolute path to the file to modify',
|
|
16
|
-
},
|
|
17
|
-
old_string: {
|
|
18
|
-
type: 'string',
|
|
19
|
-
description: 'The exact text to find and replace',
|
|
20
|
-
},
|
|
21
|
-
new_string: {
|
|
22
|
-
type: 'string',
|
|
23
|
-
description: 'The replacement text',
|
|
24
|
-
},
|
|
25
|
-
replace_all: {
|
|
26
|
-
type: 'boolean',
|
|
27
|
-
description: 'Replace all occurrences (default false)',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
required: ['file_path', 'old_string', 'new_string'],
|
|
31
|
-
},
|
|
32
|
-
isReadOnly: false,
|
|
33
|
-
isConcurrencySafe: false,
|
|
34
|
-
async call(input, context) {
|
|
35
|
-
const filePath = resolve(context.cwd, input.file_path);
|
|
36
|
-
const { old_string, new_string, replace_all } = input;
|
|
37
|
-
if (old_string === new_string) {
|
|
38
|
-
return { data: 'Error: old_string and new_string are identical', is_error: true };
|
|
39
|
-
}
|
|
40
|
-
try {
|
|
41
|
-
let content = await readFile(filePath, 'utf-8');
|
|
42
|
-
if (!content.includes(old_string)) {
|
|
43
|
-
return { data: `Error: old_string not found in ${filePath}. Make sure it matches exactly including whitespace.`, is_error: true };
|
|
44
|
-
}
|
|
45
|
-
if (!replace_all) {
|
|
46
|
-
// Check uniqueness
|
|
47
|
-
const count = content.split(old_string).length - 1;
|
|
48
|
-
if (count > 1) {
|
|
49
|
-
return {
|
|
50
|
-
data: `Error: old_string appears ${count} times in the file. Provide more context to make it unique, or set replace_all: true.`,
|
|
51
|
-
is_error: true,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
content = content.replace(old_string, new_string);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
content = content.split(old_string).join(new_string);
|
|
58
|
-
}
|
|
59
|
-
await writeFile(filePath, content, 'utf-8');
|
|
60
|
-
return `File edited: ${filePath}`;
|
|
61
|
-
}
|
|
62
|
-
catch (err) {
|
|
63
|
-
if (err.code === 'ENOENT') {
|
|
64
|
-
return { data: `Error: File not found: ${filePath}`, is_error: true };
|
|
65
|
-
}
|
|
66
|
-
return { data: `Error editing file: ${err.message}`, is_error: true };
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
//# sourceMappingURL=edit.js.map
|
package/dist/tools/edit.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../src/tools/edit.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;IACrC,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,mKAAmK;IAChL,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EA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AAI,EAAE,6BAA6B,KAAK,uFAAuF;wBAC/H,QAAQ,EAAE,IAAI;qBACf,CAAA;gBACH,CAAC;gBACD,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;YACnD,CAAC;iBAAM,CAAC;gBACN,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;YACtD,CAAC;YAED,MAAM,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;YAC3C,OAAO,gBAAgB,QAAQ,EAAE,CAAA;QACnC,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC1B,OAAO,EAAE,IAAI,EAAE,0BAA0B,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;YACvE,CAAC;YACD,OAAO,EAAE,IAAI,EAAE,uBAAuB,GAAG,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;QACvE,CAAC;IACH,CAAC;CACF,CAAC,CAAA"}
|
package/dist/tools/glob.d.ts
DELETED
package/dist/tools/glob.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../src/tools/glob.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,eAAO,MAAM,QAAQ,sCAqEnB,CAAA"}
|
package/dist/tools/glob.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GlobTool - File pattern matching
|
|
3
|
-
*/
|
|
4
|
-
import { resolve } from 'path';
|
|
5
|
-
import { defineTool } from './types.js';
|
|
6
|
-
export const GlobTool = defineTool({
|
|
7
|
-
name: 'Glob',
|
|
8
|
-
description: 'Find files matching a glob pattern. Returns matching file paths sorted by modification time. Supports patterns like "**/*.ts", "src/**/*.js".',
|
|
9
|
-
inputSchema: {
|
|
10
|
-
type: 'object',
|
|
11
|
-
properties: {
|
|
12
|
-
pattern: {
|
|
13
|
-
type: 'string',
|
|
14
|
-
description: 'The glob pattern to match files against',
|
|
15
|
-
},
|
|
16
|
-
path: {
|
|
17
|
-
type: 'string',
|
|
18
|
-
description: 'The directory to search in (defaults to cwd)',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
required: ['pattern'],
|
|
22
|
-
},
|
|
23
|
-
isReadOnly: true,
|
|
24
|
-
isConcurrencySafe: true,
|
|
25
|
-
async call(input, context) {
|
|
26
|
-
const searchDir = input.path ? resolve(context.cwd, input.path) : context.cwd;
|
|
27
|
-
const { pattern } = input;
|
|
28
|
-
try {
|
|
29
|
-
// Use Node.js glob (available in Node 22+) or fall back to bash find
|
|
30
|
-
const { glob } = await import('fs/promises');
|
|
31
|
-
// @ts-ignore - glob is available in Node 22+
|
|
32
|
-
if (typeof glob === 'function') {
|
|
33
|
-
const matches = [];
|
|
34
|
-
// @ts-ignore
|
|
35
|
-
for await (const entry of glob(pattern, { cwd: searchDir })) {
|
|
36
|
-
matches.push(entry);
|
|
37
|
-
if (matches.length >= 500)
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
if (matches.length === 0) {
|
|
41
|
-
return `No files matching pattern "${pattern}" in ${searchDir}`;
|
|
42
|
-
}
|
|
43
|
-
return matches.join('\n');
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
catch {
|
|
47
|
-
// Fall through to bash-based approach
|
|
48
|
-
}
|
|
49
|
-
// Fallback: use bash find/glob
|
|
50
|
-
const { spawn } = await import('child_process');
|
|
51
|
-
return new Promise((resolvePromise) => {
|
|
52
|
-
// Use bash glob expansion or find
|
|
53
|
-
const cmd = `shopt -s globstar nullglob 2>/dev/null; cd ${JSON.stringify(searchDir)} && ls -1d ${pattern} 2>/dev/null | head -500`;
|
|
54
|
-
const proc = spawn('bash', ['-c', cmd], {
|
|
55
|
-
cwd: searchDir,
|
|
56
|
-
timeout: 30000,
|
|
57
|
-
});
|
|
58
|
-
const chunks = [];
|
|
59
|
-
proc.stdout?.on('data', (d) => chunks.push(d));
|
|
60
|
-
proc.on('close', () => {
|
|
61
|
-
const result = Buffer.concat(chunks).toString('utf-8').trim();
|
|
62
|
-
if (!result) {
|
|
63
|
-
resolvePromise(`No files matching pattern "${pattern}" in ${searchDir}`);
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
resolvePromise(result);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
proc.on('error', () => {
|
|
70
|
-
resolvePromise(`Error searching for files with pattern "${pattern}"`);
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
//# sourceMappingURL=glob.js.map
|
package/dist/tools/glob.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../src/tools/glob.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;IACjC,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,+IAA+I;IAC5J,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yCAAyC;aACvD;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,8CAA8C;aAC5D;SACF;QACD,QAAQ,EAAE,CAAC,SAAS,CAAC;KACtB;IACD,UAAU,EAAE,IAAI;IAChB,iBAAiB,EAAE,IAAI;IACvB,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO;QACvB,MAAM,SAAS,GAAG,KAAK,CA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E,SAAS;gBACd,OAAO,EAAE,KAAK;aACf,CAAC,CAAA;YAEF,MAAM,MAAM,GAAa,EAAE,CAAA;YAC3B,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YACtD,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;gBACpB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAA;gBAC7D,IAAI,CAAC,MAAM,EAAE,CAAC;oBACZ,cAAc,CAAC,8BAA8B,OAAO,QAAQ,SAAS,EAAE,CAAC,CAAA;gBAC1E,CAAC;qBAAM,CAAC;oBACN,cAAc,CAAC,MAAM,CAAC,CAAA;gBACxB,CAAC;YACH,CAAC,CAAC,CAAA;YACF,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;gBACpB,cAAc,CAAC,2CAA2C,OAAO,GAAG,CAAC,CAAA;YACvE,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAC,CAAA"}
|
package/dist/tools/grep.d.ts
DELETED
package/dist/tools/grep.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grep.d.ts","sourceRoot":"","sources":["../../src/tools/grep.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,eAAO,MAAM,QAAQ,sCA+JnB,CAAA"}
|
package/dist/tools/grep.js
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GrepTool - Search file contents using regex
|
|
3
|
-
*/
|
|
4
|
-
import { spawn } from 'child_process';
|
|
5
|
-
import { resolve } from 'path';
|
|
6
|
-
import { defineTool } from './types.js';
|
|
7
|
-
export const GrepTool = defineTool({
|
|
8
|
-
name: 'Grep',
|
|
9
|
-
description: 'Search file contents using regex patterns. Uses ripgrep (rg) if available, falls back to grep. Supports file type filtering and context lines.',
|
|
10
|
-
inputSchema: {
|
|
11
|
-
type: 'object',
|
|
12
|
-
properties: {
|
|
13
|
-
pattern: {
|
|
14
|
-
type: 'string',
|
|
15
|
-
description: 'The regex pattern to search for',
|
|
16
|
-
},
|
|
17
|
-
path: {
|
|
18
|
-
type: 'string',
|
|
19
|
-
description: 'File or directory to search in (defaults to cwd)',
|
|
20
|
-
},
|
|
21
|
-
glob: {
|
|
22
|
-
type: 'string',
|
|
23
|
-
description: 'Glob pattern to filter files (e.g., "*.ts", "*.{js,jsx}")',
|
|
24
|
-
},
|
|
25
|
-
type: {
|
|
26
|
-
type: 'string',
|
|
27
|
-
description: 'File type filter (e.g., "ts", "py", "js")',
|
|
28
|
-
},
|
|
29
|
-
output_mode: {
|
|
30
|
-
type: 'string',
|
|
31
|
-
enum: ['content', 'files_with_matches', 'count'],
|
|
32
|
-
description: 'Output mode (default: files_with_matches)',
|
|
33
|
-
},
|
|
34
|
-
'-i': {
|
|
35
|
-
type: 'boolean',
|
|
36
|
-
description: 'Case insensitive search',
|
|
37
|
-
},
|
|
38
|
-
'-n': {
|
|
39
|
-
type: 'boolean',
|
|
40
|
-
description: 'Show line numbers (default: true)',
|
|
41
|
-
},
|
|
42
|
-
'-A': { type: 'number', description: 'Lines after match' },
|
|
43
|
-
'-B': { type: 'number', description: 'Lines before match' },
|
|
44
|
-
'-C': { type: 'number', description: 'Context lines' },
|
|
45
|
-
context: { type: 'number', description: 'Context lines (alias for -C)' },
|
|
46
|
-
head_limit: { type: 'number', description: 'Limit output entries (default: 250)' },
|
|
47
|
-
},
|
|
48
|
-
required: ['pattern'],
|
|
49
|
-
},
|
|
50
|
-
isReadOnly: true,
|
|
51
|
-
isConcurrencySafe: true,
|
|
52
|
-
async call(input, context) {
|
|
53
|
-
const searchPath = input.path ? resolve(context.cwd, input.path) : context.cwd;
|
|
54
|
-
const outputMode = input.output_mode || 'files_with_matches';
|
|
55
|
-
const headLimit = input.head_limit ?? 250;
|
|
56
|
-
// Build rg command (fall back to grep if rg unavailable)
|
|
57
|
-
const args = [];
|
|
58
|
-
// Try ripgrep first
|
|
59
|
-
let cmd = 'rg';
|
|
60
|
-
if (outputMode === 'files_with_matches') {
|
|
61
|
-
args.push('--files-with-matches');
|
|
62
|
-
}
|
|
63
|
-
else if (outputMode === 'count') {
|
|
64
|
-
args.push('--count');
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
// content mode
|
|
68
|
-
if (input['-n'] !== false)
|
|
69
|
-
args.push('--line-number');
|
|
70
|
-
}
|
|
71
|
-
if (input['-i'])
|
|
72
|
-
args.push('--ignore-case');
|
|
73
|
-
if (input['-A'])
|
|
74
|
-
args.push('-A', String(input['-A']));
|
|
75
|
-
if (input['-B'])
|
|
76
|
-
args.push('-B', String(input['-B']));
|
|
77
|
-
const ctx = input['-C'] ?? input.context;
|
|
78
|
-
if (ctx)
|
|
79
|
-
args.push('-C', String(ctx));
|
|
80
|
-
if (input.glob)
|
|
81
|
-
args.push('--glob', input.glob);
|
|
82
|
-
if (input.type)
|
|
83
|
-
args.push('--type', input.type);
|
|
84
|
-
args.push('--', input.pattern, searchPath);
|
|
85
|
-
return new Promise((resolvePromise) => {
|
|
86
|
-
const proc = spawn(cmd, args, {
|
|
87
|
-
cwd: context.cwd,
|
|
88
|
-
timeout: 30000,
|
|
89
|
-
});
|
|
90
|
-
const chunks = [];
|
|
91
|
-
const errChunks = [];
|
|
92
|
-
proc.stdout?.on('data', (d) => chunks.push(d));
|
|
93
|
-
proc.stderr?.on('data', (d) => errChunks.push(d));
|
|
94
|
-
proc.on('close', (code) => {
|
|
95
|
-
let result = Buffer.concat(chunks).toString('utf-8').trim();
|
|
96
|
-
if (!result && code !== 0) {
|
|
97
|
-
// Try fallback to grep
|
|
98
|
-
const grepArgs = ['-r'];
|
|
99
|
-
if (input['-i'])
|
|
100
|
-
grepArgs.push('-i');
|
|
101
|
-
if (outputMode === 'files_with_matches')
|
|
102
|
-
grepArgs.push('-l');
|
|
103
|
-
if (outputMode === 'count')
|
|
104
|
-
grepArgs.push('-c');
|
|
105
|
-
if (outputMode === 'content' && input['-n'] !== false)
|
|
106
|
-
grepArgs.push('-n');
|
|
107
|
-
if (input.glob)
|
|
108
|
-
grepArgs.push('--include', input.glob);
|
|
109
|
-
grepArgs.push('--', input.pattern, searchPath);
|
|
110
|
-
const grepProc = spawn('grep', grepArgs, {
|
|
111
|
-
cwd: context.cwd,
|
|
112
|
-
timeout: 30000,
|
|
113
|
-
});
|
|
114
|
-
const grepChunks = [];
|
|
115
|
-
grepProc.stdout?.on('data', (d) => grepChunks.push(d));
|
|
116
|
-
grepProc.on('close', () => {
|
|
117
|
-
const grepResult = Buffer.concat(grepChunks).toString('utf-8').trim();
|
|
118
|
-
if (!grepResult) {
|
|
119
|
-
resolvePromise(`No matches found for pattern "${input.pattern}"`);
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
// Apply head limit
|
|
123
|
-
const lines = grepResult.split('\n');
|
|
124
|
-
if (headLimit > 0 && lines.length > headLimit) {
|
|
125
|
-
resolvePromise(lines.slice(0, headLimit).join('\n') + `\n... (${lines.length - headLimit} more)`);
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
resolvePromise(grepResult);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
grepProc.on('error', () => {
|
|
133
|
-
resolvePromise(`No matches found for pattern "${input.pattern}"`);
|
|
134
|
-
});
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
if (!result) {
|
|
138
|
-
resolvePromise(`No matches found for pattern "${input.pattern}"`);
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
// Apply head limit
|
|
142
|
-
const lines = result.split('\n');
|
|
143
|
-
if (headLimit > 0 && lines.length > headLimit) {
|
|
144
|
-
result = lines.slice(0, headLimit).join('\n') + `\n... (${lines.length - headLimit} more)`;
|
|
145
|
-
}
|
|
146
|
-
resolvePromise(result);
|
|
147
|
-
});
|
|
148
|
-
proc.on('error', () => {
|
|
149
|
-
// rg not found, try grep directly
|
|
150
|
-
const grepArgs = ['-r', '-n', '--', input.pattern, searchPath];
|
|
151
|
-
const grepProc = spawn('grep', grepArgs, {
|
|
152
|
-
cwd: context.cwd,
|
|
153
|
-
timeout: 30000,
|
|
154
|
-
});
|
|
155
|
-
const grepChunks = [];
|
|
156
|
-
grepProc.stdout?.on('data', (d) => grepChunks.push(d));
|
|
157
|
-
grepProc.on('close', () => {
|
|
158
|
-
const grepResult = Buffer.concat(grepChunks).toString('utf-8').trim();
|
|
159
|
-
resolvePromise(grepResult || `No matches found for pattern "${input.pattern}"`);
|
|
160
|
-
});
|
|
161
|
-
grepProc.on('error', () => {
|
|
162
|
-
resolvePromise(`Error: neither rg nor grep available`);
|
|
163
|
-
});
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
},
|
|
167
|
-
});
|
|
168
|
-
//# sourceMappingURL=grep.js.map
|
package/dist/tools/grep.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grep.js","sourceRoot":"","sources":["../../src/tools/grep.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;IACjC,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,gJAAgJ;IAC7J,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iCAAiC;aAC/C;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAA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AAI,CAAC,CAAC,CAAC,CAAC,CAAA;gBAC9D,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;oBACxB,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAA;oBACrE,cAAc,CAAC,UAAU,IAAI,iCAAiC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAA;gBACjF,CAAC,CAAC,CAAA;gBACF,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;oBACxB,cAAc,CAAC,sCAAsC,CAAC,CAAA;gBACxD,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAC,CAAA"}
|
package/dist/tools/index.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tool Registry - All built-in tool definitions
|
|
3
|
-
*
|
|
4
|
-
* 30+ tools covering file I/O, execution, search, web, agents,
|
|
5
|
-
* tasks, teams, messaging, worktree, planning, scheduling, and more.
|
|
6
|
-
*/
|
|
7
|
-
import type { ToolDefinition } from '../types.js';
|
|
8
|
-
import { BashTool } from './bash.js';
|
|
9
|
-
import { FileReadTool } from './read.js';
|
|
10
|
-
import { FileWriteTool } from './write.js';
|
|
11
|
-
import { FileEditTool } from './edit.js';
|
|
12
|
-
import { GlobTool } from './glob.js';
|
|
13
|
-
import { GrepTool } from './grep.js';
|
|
14
|
-
import { NotebookEditTool } from './notebook-edit.js';
|
|
15
|
-
import { WebFetchTool } from './web-fetch.js';
|
|
16
|
-
import { WebSearchTool } from './web-search.js';
|
|
17
|
-
import { AgentTool } from './agent-tool.js';
|
|
18
|
-
import { SendMessageTool } from './send-message.js';
|
|
19
|
-
import { TeamCreateTool, TeamDeleteTool } from './team-tools.js';
|
|
20
|
-
import { TaskCreateTool, TaskListTool, TaskUpdateTool, TaskGetTool, TaskStopTool, TaskOutputTool } from './task-tools.js';
|
|
21
|
-
import { EnterWorktreeTool, ExitWorktreeTool } from './worktree-tools.js';
|
|
22
|
-
import { EnterPlanModeTool, ExitPlanModeTool } from './plan-tools.js';
|
|
23
|
-
import { AskUserQuestionTool } from './ask-user.js';
|
|
24
|
-
import { ToolSearchTool } from './tool-search.js';
|
|
25
|
-
import { ListMcpResourcesTool, ReadMcpResourceTool } from './mcp-resource-tools.js';
|
|
26
|
-
import { CronCreateTool, CronDeleteTool, CronListTool, RemoteTriggerTool } from './cron-tools.js';
|
|
27
|
-
import { LSPTool } from './lsp-tool.js';
|
|
28
|
-
import { ConfigTool } from './config-tool.js';
|
|
29
|
-
import { TodoWriteTool } from './todo-tool.js';
|
|
30
|
-
import { SkillTool } from './skill-tool.js';
|
|
31
|
-
/**
|
|
32
|
-
* Get all built-in tools.
|
|
33
|
-
*/
|
|
34
|
-
export declare function getAllBaseTools(): ToolDefinition[];
|
|
35
|
-
/**
|
|
36
|
-
* Filter tools by allowed/disallowed lists.
|
|
37
|
-
*/
|
|
38
|
-
export declare function filterTools(tools: ToolDefinition[], allowedTools?: string[], disallowedTools?: string[]): ToolDefinition[];
|
|
39
|
-
/**
|
|
40
|
-
* Assemble tool pool: base tools + MCP tools, with deduplication.
|
|
41
|
-
*/
|
|
42
|
-
export declare function assembleToolPool(baseTools: ToolDefinition[], mcpTools?: ToolDefinition[], allowedTools?: string[], disallowedTools?: string[]): ToolDefinition[];
|
|
43
|
-
export { BashTool, FileReadTool, FileWriteTool, FileEditTool, GlobTool, GrepTool, NotebookEditTool, WebFetchTool, WebSearchTool, AgentTool, SendMessageTool, TeamCreateTool, TeamDeleteTool, TaskCreateTool, TaskListTool, TaskUpdateTool, TaskGetTool, TaskStopTool, TaskOutputTool, EnterWorktreeTool, ExitWorktreeTool, EnterPlanModeTool, ExitPlanModeTool, AskUserQuestionTool, ToolSearchTool, ListMcpResourcesTool, ReadMcpResourceTool, CronCreateTool, CronDeleteTool, CronListTool, RemoteTriggerTool, LSPTool, ConfigTool, TodoWriteTool, SkillTool, };
|
|
44
|
-
export { defineTool, toApiTool } from './types.js';
|
|
45
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAGjD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAGrD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAG/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAGhE,OAAO,EACL,cAAc,EACd,YAAY,EACZ,cAAc,EACd,WAAW,EACX,YAAY,EACZ,cAAc,EACf,MAAM,iBAAiB,CAAA;AAGxB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAGzE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAGrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAGnD,OAAO,EAA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AAU,EAEV,aAAa,EAEb,SAAS,GACV,CAAA;AAGD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/tools/index.js
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tool Registry - All built-in tool definitions
|
|
3
|
-
*
|
|
4
|
-
* 30+ tools covering file I/O, execution, search, web, agents,
|
|
5
|
-
* tasks, teams, messaging, worktree, planning, scheduling, and more.
|
|
6
|
-
*/
|
|
7
|
-
// File I/O
|
|
8
|
-
import { BashTool } from './bash.js';
|
|
9
|
-
import { FileReadTool } from './read.js';
|
|
10
|
-
import { FileWriteTool } from './write.js';
|
|
11
|
-
import { FileEditTool } from './edit.js';
|
|
12
|
-
import { GlobTool } from './glob.js';
|
|
13
|
-
import { GrepTool } from './grep.js';
|
|
14
|
-
import { NotebookEditTool } from './notebook-edit.js';
|
|
15
|
-
// Web
|
|
16
|
-
import { WebFetchTool } from './web-fetch.js';
|
|
17
|
-
import { WebSearchTool } from './web-search.js';
|
|
18
|
-
// Agent & Multi-agent
|
|
19
|
-
import { AgentTool } from './agent-tool.js';
|
|
20
|
-
import { SendMessageTool } from './send-message.js';
|
|
21
|
-
import { TeamCreateTool, TeamDeleteTool } from './team-tools.js';
|
|
22
|
-
// Tasks
|
|
23
|
-
import { TaskCreateTool, TaskListTool, TaskUpdateTool, TaskGetTool, TaskStopTool, TaskOutputTool, } from './task-tools.js';
|
|
24
|
-
// Worktree
|
|
25
|
-
import { EnterWorktreeTool, ExitWorktreeTool } from './worktree-tools.js';
|
|
26
|
-
// Planning
|
|
27
|
-
import { EnterPlanModeTool, ExitPlanModeTool } from './plan-tools.js';
|
|
28
|
-
// User interaction
|
|
29
|
-
import { AskUserQuestionTool } from './ask-user.js';
|
|
30
|
-
// Discovery
|
|
31
|
-
import { ToolSearchTool } from './tool-search.js';
|
|
32
|
-
// MCP Resources
|
|
33
|
-
import { ListMcpResourcesTool, ReadMcpResourceTool } from './mcp-resource-tools.js';
|
|
34
|
-
// Scheduling
|
|
35
|
-
import { CronCreateTool, CronDeleteTool, CronListTool, RemoteTriggerTool } from './cron-tools.js';
|
|
36
|
-
// LSP
|
|
37
|
-
import { LSPTool } from './lsp-tool.js';
|
|
38
|
-
// Config
|
|
39
|
-
import { ConfigTool } from './config-tool.js';
|
|
40
|
-
// Todo
|
|
41
|
-
import { TodoWriteTool } from './todo-tool.js';
|
|
42
|
-
// Skill
|
|
43
|
-
import { SkillTool } from './skill-tool.js';
|
|
44
|
-
/**
|
|
45
|
-
* All built-in tools (30+).
|
|
46
|
-
*/
|
|
47
|
-
const ALL_TOOLS = [
|
|
48
|
-
// Core file I/O & execution
|
|
49
|
-
BashTool,
|
|
50
|
-
FileReadTool,
|
|
51
|
-
FileWriteTool,
|
|
52
|
-
FileEditTool,
|
|
53
|
-
GlobTool,
|
|
54
|
-
GrepTool,
|
|
55
|
-
NotebookEditTool,
|
|
56
|
-
// Web
|
|
57
|
-
WebFetchTool,
|
|
58
|
-
WebSearchTool,
|
|
59
|
-
// Agent & Multi-agent
|
|
60
|
-
AgentTool,
|
|
61
|
-
SendMessageTool,
|
|
62
|
-
TeamCreateTool,
|
|
63
|
-
TeamDeleteTool,
|
|
64
|
-
// Tasks
|
|
65
|
-
TaskCreateTool,
|
|
66
|
-
TaskListTool,
|
|
67
|
-
TaskUpdateTool,
|
|
68
|
-
TaskGetTool,
|
|
69
|
-
TaskStopTool,
|
|
70
|
-
TaskOutputTool,
|
|
71
|
-
// Worktree
|
|
72
|
-
EnterWorktreeTool,
|
|
73
|
-
ExitWorktreeTool,
|
|
74
|
-
// Planning
|
|
75
|
-
EnterPlanModeTool,
|
|
76
|
-
ExitPlanModeTool,
|
|
77
|
-
// User interaction
|
|
78
|
-
AskUserQuestionTool,
|
|
79
|
-
// Discovery
|
|
80
|
-
ToolSearchTool,
|
|
81
|
-
// MCP Resources
|
|
82
|
-
ListMcpResourcesTool,
|
|
83
|
-
ReadMcpResourceTool,
|
|
84
|
-
// Scheduling
|
|
85
|
-
CronCreateTool,
|
|
86
|
-
CronDeleteTool,
|
|
87
|
-
CronListTool,
|
|
88
|
-
RemoteTriggerTool,
|
|
89
|
-
// LSP
|
|
90
|
-
LSPTool,
|
|
91
|
-
// Config
|
|
92
|
-
ConfigTool,
|
|
93
|
-
// Todo
|
|
94
|
-
TodoWriteTool,
|
|
95
|
-
// Skill
|
|
96
|
-
SkillTool,
|
|
97
|
-
];
|
|
98
|
-
/**
|
|
99
|
-
* Get all built-in tools.
|
|
100
|
-
*/
|
|
101
|
-
export function getAllBaseTools() {
|
|
102
|
-
return [...ALL_TOOLS];
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Filter tools by allowed/disallowed lists.
|
|
106
|
-
*/
|
|
107
|
-
export function filterTools(tools, allowedTools, disallowedTools) {
|
|
108
|
-
let filtered = tools;
|
|
109
|
-
if (allowedTools && allowedTools.length > 0) {
|
|
110
|
-
const allowed = new Set(allowedTools);
|
|
111
|
-
filtered = filtered.filter((t) => allowed.has(t.name));
|
|
112
|
-
}
|
|
113
|
-
if (disallowedTools && disallowedTools.length > 0) {
|
|
114
|
-
const disallowed = new Set(disallowedTools);
|
|
115
|
-
filtered = filtered.filter((t) => !disallowed.has(t.name));
|
|
116
|
-
}
|
|
117
|
-
return filtered;
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Assemble tool pool: base tools + MCP tools, with deduplication.
|
|
121
|
-
*/
|
|
122
|
-
export function assembleToolPool(baseTools, mcpTools = [], allowedTools, disallowedTools) {
|
|
123
|
-
const combined = [...baseTools, ...mcpTools];
|
|
124
|
-
// Deduplicate by name (later definitions override)
|
|
125
|
-
const byName = new Map();
|
|
126
|
-
for (const tool of combined) {
|
|
127
|
-
byName.set(tool.name, tool);
|
|
128
|
-
}
|
|
129
|
-
let tools = Array.from(byName.values());
|
|
130
|
-
return filterTools(tools, allowedTools, disallowedTools);
|
|
131
|
-
}
|
|
132
|
-
// Re-export individual tools
|
|
133
|
-
export {
|
|
134
|
-
// Core
|
|
135
|
-
BashTool, FileReadTool, FileWriteTool, FileEditTool, GlobTool, GrepTool, NotebookEditTool, WebFetchTool, WebSearchTool,
|
|
136
|
-
// Agent
|
|
137
|
-
AgentTool, SendMessageTool, TeamCreateTool, TeamDeleteTool,
|
|
138
|
-
// Tasks
|
|
139
|
-
TaskCreateTool, TaskListTool, TaskUpdateTool, TaskGetTool, TaskStopTool, TaskOutputTool,
|
|
140
|
-
// Worktree
|
|
141
|
-
EnterWorktreeTool, ExitWorktreeTool,
|
|
142
|
-
// Planning
|
|
143
|
-
EnterPlanModeTool, ExitPlanModeTool,
|
|
144
|
-
// User
|
|
145
|
-
AskUserQuestionTool,
|
|
146
|
-
// Discovery
|
|
147
|
-
ToolSearchTool,
|
|
148
|
-
// MCP
|
|
149
|
-
ListMcpResourcesTool, ReadMcpResourceTool,
|
|
150
|
-
// Scheduling
|
|
151
|
-
CronCreateTool, CronDeleteTool, CronListTool, RemoteTriggerTool,
|
|
152
|
-
// LSP
|
|
153
|
-
LSPTool,
|
|
154
|
-
// Config
|
|
155
|
-
ConfigTool,
|
|
156
|
-
// Todo
|
|
157
|
-
TodoWriteTool,
|
|
158
|
-
// Skill
|
|
159
|
-
SkillTool, };
|
|
160
|
-
// Re-export helpers
|
|
161
|
-
export { defineTool, toApiTool } from './types.js';
|
|
162
|
-
//# sourceMappingURL=index.js.map
|
package/dist/tools/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,WAAW;AACX,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACx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oBAAoB,EACpB,mBAAmB;AACnB,aAAa;AACb,cAAc,EACd,cAAc,EACd,YAAY,EACZ,iBAAiB;AACjB,MAAM;AACN,OAAO;AACP,SAAS;AACT,UAAU;AACV,OAAO;AACP,aAAa;AACb,QAAQ;AACR,SAAS,GACV,CAAA;AAED,oBAAoB;AACpB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/tools/lsp-tool.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LSPTool - Language Server Protocol integration
|
|
3
|
-
*
|
|
4
|
-
* Provides code intelligence: go-to-definition, find-references,
|
|
5
|
-
* hover, document symbols, workspace symbols, etc.
|
|
6
|
-
*/
|
|
7
|
-
import type { ToolDefinition } from '../types.js';
|
|
8
|
-
export declare const LSPTool: ToolDefinition;
|
|
9
|
-
//# sourceMappingURL=lsp-tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lsp-tool.d.ts","sourceRoot":"","sources":["../../src/tools/lsp-tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,aAAa,CAAA;AAE7D,eAAO,MAAM,OAAO,EAAE,cAqHrB,CAAA"}
|