@agentscope-ai/agentscope 0.0.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/dist/agent/index.d.mts +234 -0
- package/dist/agent/index.d.ts +234 -0
- package/dist/agent/index.js +1412 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/index.mjs +1375 -0
- package/dist/agent/index.mjs.map +1 -0
- package/dist/base-BOx3UzOl.d.mts +41 -0
- package/dist/base-BoIps2RL.d.ts +41 -0
- package/dist/base-C7jwyH4Z.d.mts +52 -0
- package/dist/base-Cwi4bjze.d.ts +127 -0
- package/dist/base-DYlBMCy_.d.mts +127 -0
- package/dist/base-NX-knWOv.d.ts +52 -0
- package/dist/block-VsnHrllL.d.mts +48 -0
- package/dist/block-VsnHrllL.d.ts +48 -0
- package/dist/event/index.d.mts +181 -0
- package/dist/event/index.d.ts +181 -0
- package/dist/event/index.js +58 -0
- package/dist/event/index.js.map +1 -0
- package/dist/event/index.mjs +33 -0
- package/dist/event/index.mjs.map +1 -0
- package/dist/formatter/index.d.mts +187 -0
- package/dist/formatter/index.d.ts +187 -0
- package/dist/formatter/index.js +647 -0
- package/dist/formatter/index.js.map +1 -0
- package/dist/formatter/index.mjs +616 -0
- package/dist/formatter/index.mjs.map +1 -0
- package/dist/index-BTJDlKvQ.d.mts +195 -0
- package/dist/index-BcatlwXQ.d.ts +195 -0
- package/dist/index-CAxQAkiP.d.mts +21 -0
- package/dist/index-CAxQAkiP.d.ts +21 -0
- package/dist/mcp/index.d.mts +9 -0
- package/dist/mcp/index.d.ts +9 -0
- package/dist/mcp/index.js +432 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/index.mjs +408 -0
- package/dist/mcp/index.mjs.map +1 -0
- package/dist/message/index.d.mts +10 -0
- package/dist/message/index.d.ts +10 -0
- package/dist/message/index.js +67 -0
- package/dist/message/index.js.map +1 -0
- package/dist/message/index.mjs +37 -0
- package/dist/message/index.mjs.map +1 -0
- package/dist/message-CkN21KaY.d.mts +99 -0
- package/dist/message-CzLeTlua.d.ts +99 -0
- package/dist/model/index.d.mts +377 -0
- package/dist/model/index.d.ts +377 -0
- package/dist/model/index.js +1880 -0
- package/dist/model/index.js.map +1 -0
- package/dist/model/index.mjs +1849 -0
- package/dist/model/index.mjs.map +1 -0
- package/dist/storage/index.d.mts +68 -0
- package/dist/storage/index.d.ts +68 -0
- package/dist/storage/index.js +250 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/index.mjs +212 -0
- package/dist/storage/index.mjs.map +1 -0
- package/dist/tool/index.d.mts +311 -0
- package/dist/tool/index.d.ts +311 -0
- package/dist/tool/index.js +1494 -0
- package/dist/tool/index.js.map +1 -0
- package/dist/tool/index.mjs +1447 -0
- package/dist/tool/index.mjs.map +1 -0
- package/dist/toolkit-CEpulFi0.d.ts +99 -0
- package/dist/toolkit-CGEZSZPa.d.mts +99 -0
- package/jest.config.js +11 -0
- package/package.json +92 -0
- package/src/_utils/common.ts +104 -0
- package/src/_utils/index.ts +1 -0
- package/src/agent/agent-base.ts +0 -0
- package/src/agent/agent.test.ts +1028 -0
- package/src/agent/agent.ts +1032 -0
- package/src/agent/index.ts +2 -0
- package/src/agent/interfaces.ts +23 -0
- package/src/agent/test-compression.ts +72 -0
- package/src/event/index.ts +250 -0
- package/src/formatter/base.ts +133 -0
- package/src/formatter/dashscope-chat-formatter.test.ts +372 -0
- package/src/formatter/dashscope-chat-formatter.ts +163 -0
- package/src/formatter/deepseek-chat-formatter.ts +130 -0
- package/src/formatter/index.ts +5 -0
- package/src/formatter/ollama-chat-formatter.ts +67 -0
- package/src/formatter/openai-chat-formatter.test.ts +263 -0
- package/src/formatter/openai-chat-formatter.ts +301 -0
- package/src/formatter/openai.md +767 -0
- package/src/mcp/base.ts +114 -0
- package/src/mcp/http.test.ts +303 -0
- package/src/mcp/http.ts +224 -0
- package/src/mcp/index.ts +2 -0
- package/src/mcp/stdio.test.ts +91 -0
- package/src/mcp/stdio.ts +119 -0
- package/src/message/block.ts +60 -0
- package/src/message/enums.ts +4 -0
- package/src/message/index.ts +12 -0
- package/src/message/message.test.ts +80 -0
- package/src/message/message.ts +131 -0
- package/src/model/base.ts +226 -0
- package/src/model/dashscope-model.test.ts +335 -0
- package/src/model/dashscope-model.ts +441 -0
- package/src/model/deepseek-model.test.ts +279 -0
- package/src/model/deepseek-model.ts +401 -0
- package/src/model/index.ts +7 -0
- package/src/model/ollama-model.test.ts +307 -0
- package/src/model/ollama-model.ts +356 -0
- package/src/model/openai-model.ts +327 -0
- package/src/model/response.ts +22 -0
- package/src/model/usage.ts +12 -0
- package/src/storage/base.ts +52 -0
- package/src/storage/file-system.test.ts +587 -0
- package/src/storage/file-system.ts +269 -0
- package/src/storage/index.ts +2 -0
- package/src/tool/base.ts +23 -0
- package/src/tool/bash.test.ts +174 -0
- package/src/tool/bash.ts +152 -0
- package/src/tool/edit.test.ts +83 -0
- package/src/tool/edit.ts +95 -0
- package/src/tool/glob.test.ts +63 -0
- package/src/tool/glob.ts +166 -0
- package/src/tool/grep.test.ts +74 -0
- package/src/tool/grep.ts +256 -0
- package/src/tool/index.ts +10 -0
- package/src/tool/read.test.ts +77 -0
- package/src/tool/read.ts +117 -0
- package/src/tool/response.ts +82 -0
- package/src/tool/task.test.ts +299 -0
- package/src/tool/task.ts +399 -0
- package/src/tool/toolkit.test.ts +636 -0
- package/src/tool/toolkit.ts +601 -0
- package/src/tool/write.test.ts +52 -0
- package/src/tool/write.ts +57 -0
- package/src/type/index.ts +52 -0
- package/tsconfig.build.json +4 -0
- package/tsconfig.cjs.json +11 -0
- package/tsconfig.esm.json +10 -0
- package/tsconfig.json +14 -0
- package/tsup.config.ts +20 -0
- package/typedoc.json +52 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { a as ToolResponse } from '../index-BTJDlKvQ.mjs';
|
|
2
|
+
export { T as Tool } from '../index-BTJDlKvQ.mjs';
|
|
3
|
+
export { T as Toolkit } from '../toolkit-CGEZSZPa.mjs';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import '@modelcontextprotocol/sdk/client/index.js';
|
|
6
|
+
import '@modelcontextprotocol/sdk/client/sse.js';
|
|
7
|
+
import '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
8
|
+
import '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
9
|
+
import '../index-CAxQAkiP.mjs';
|
|
10
|
+
import '../block-VsnHrllL.mjs';
|
|
11
|
+
import '@modelcontextprotocol/sdk/client/stdio.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Tool for executing bash commands in a shell environment.
|
|
15
|
+
* Intended for terminal operations such as git, npm, and docker.
|
|
16
|
+
* File operations should use the dedicated Read, Write, Edit, Glob, and Grep tools instead.
|
|
17
|
+
*
|
|
18
|
+
* @returns A Tool object for executing bash commands, with a call method that performs the execution and returns the output or error message.
|
|
19
|
+
*/
|
|
20
|
+
declare function Bash(): {
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
inputSchema: z.ZodObject<{
|
|
24
|
+
command: z.ZodString;
|
|
25
|
+
description: z.ZodOptional<z.ZodString>;
|
|
26
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
requireUserConfirm: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Executes a bash command and returns its output.
|
|
31
|
+
*
|
|
32
|
+
* @param root0 - The parameters object
|
|
33
|
+
* @param root0.command - The bash command to execute
|
|
34
|
+
* @param root0.description - Optional description of what the command does
|
|
35
|
+
* @param root0.timeout - Optional timeout in milliseconds (default: 120000, max: 600000)
|
|
36
|
+
* @returns The stdout of the command, or an error message if the command fails
|
|
37
|
+
*/
|
|
38
|
+
call({ command, description: _description, timeout, }: {
|
|
39
|
+
command: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
timeout?: number;
|
|
42
|
+
}): Promise<ToolResponse>;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Tool for reading files from the local filesystem.
|
|
47
|
+
* Returns file contents with line numbers in cat -n format.
|
|
48
|
+
*
|
|
49
|
+
* @returns A Tool object for reading files, with a call method that performs the read operation and returns the formatted contents or a warning if the file is empty.
|
|
50
|
+
*/
|
|
51
|
+
declare function Read(): {
|
|
52
|
+
name: string;
|
|
53
|
+
description: string;
|
|
54
|
+
inputSchema: z.ZodObject<{
|
|
55
|
+
file_path: z.ZodString;
|
|
56
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
requireUserConfirm: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Reads a file and returns its contents with line numbers.
|
|
62
|
+
*
|
|
63
|
+
* @param root0 - The parameters object
|
|
64
|
+
* @param root0.file_path - Absolute path to the file to read
|
|
65
|
+
* @param root0.offset - Line number to start reading from (1-based)
|
|
66
|
+
* @param root0.limit - Maximum number of lines to read (capped at 2000)
|
|
67
|
+
* @returns The file contents formatted with line numbers, or a warning if the file is empty
|
|
68
|
+
* @throws If the path is not absolute, the file does not exist, or the path is a directory
|
|
69
|
+
*/
|
|
70
|
+
call({ file_path, offset, limit, }: {
|
|
71
|
+
file_path: string;
|
|
72
|
+
offset?: number;
|
|
73
|
+
limit?: number;
|
|
74
|
+
}): ToolResponse;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Tool for writing files to the local filesystem.
|
|
79
|
+
* Creates parent directories as needed and overwrites existing files.
|
|
80
|
+
*
|
|
81
|
+
* @returns A Tool object for writing files, with a call method that performs the write operation.
|
|
82
|
+
*/
|
|
83
|
+
declare function Write(): {
|
|
84
|
+
name: string;
|
|
85
|
+
description: string;
|
|
86
|
+
inputSchema: z.ZodObject<{
|
|
87
|
+
file_path: z.ZodString;
|
|
88
|
+
content: z.ZodString;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
requireUserConfirm: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Writes content to a file, creating parent directories if necessary.
|
|
93
|
+
*
|
|
94
|
+
* @param root0 - The parameters object
|
|
95
|
+
* @param root0.file_path - Absolute path to the file to write
|
|
96
|
+
* @param root0.content - The content to write to the file
|
|
97
|
+
* @returns A success message including the number of lines written
|
|
98
|
+
* @throws If the path is not absolute
|
|
99
|
+
*/
|
|
100
|
+
call({ file_path, content }: {
|
|
101
|
+
file_path: string;
|
|
102
|
+
content: string;
|
|
103
|
+
}): string;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Tool for performing exact string replacements in files.
|
|
108
|
+
* Requires the file to have been read at least once before editing.
|
|
109
|
+
*
|
|
110
|
+
* @returns A Tool object with a call method that performs the edit operation based on the provided parameters, ensuring uniqueness of the old_string unless replace_all is true.
|
|
111
|
+
*/
|
|
112
|
+
declare function Edit(): {
|
|
113
|
+
name: string;
|
|
114
|
+
description: string;
|
|
115
|
+
inputSchema: z.ZodObject<{
|
|
116
|
+
file_path: z.ZodString;
|
|
117
|
+
old_string: z.ZodString;
|
|
118
|
+
new_string: z.ZodString;
|
|
119
|
+
replace_all: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
120
|
+
}, z.core.$strip>;
|
|
121
|
+
requireUserConfirm: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Performs an exact string replacement in the specified file.
|
|
124
|
+
*
|
|
125
|
+
* @param root0 - The parameters object
|
|
126
|
+
* @param root0.file_path - Absolute path to the file to modify
|
|
127
|
+
* @param root0.old_string - The exact text to find and replace
|
|
128
|
+
* @param root0.new_string - The text to replace old_string with
|
|
129
|
+
* @param root0.replace_all - If true, replaces all occurrences; otherwise only the first
|
|
130
|
+
* @returns A success message indicating the file was updated
|
|
131
|
+
* @throws If the path is not absolute, file does not exist, strings are identical,
|
|
132
|
+
* old_string is not found, or old_string is not unique and replace_all is false
|
|
133
|
+
*/
|
|
134
|
+
call({ file_path, old_string, new_string, replace_all, }: {
|
|
135
|
+
file_path: string;
|
|
136
|
+
old_string: string;
|
|
137
|
+
new_string: string;
|
|
138
|
+
replace_all?: boolean;
|
|
139
|
+
}): string;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Tool for fast file pattern matching across a codebase.
|
|
144
|
+
* Supports glob patterns and returns results sorted by modification time.
|
|
145
|
+
*
|
|
146
|
+
* @returns A Tool object with a call method that performs glob matching based on the provided pattern and path.
|
|
147
|
+
*/
|
|
148
|
+
declare function Glob(): {
|
|
149
|
+
name: string;
|
|
150
|
+
description: string;
|
|
151
|
+
inputSchema: z.ZodObject<{
|
|
152
|
+
pattern: z.ZodString;
|
|
153
|
+
path: z.ZodOptional<z.ZodString>;
|
|
154
|
+
}, z.core.$strip>;
|
|
155
|
+
requireUserConfirm: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Finds files matching a glob pattern under the given directory.
|
|
158
|
+
*
|
|
159
|
+
* @param root0 - The parameters object
|
|
160
|
+
* @param root0.pattern - The glob pattern to match files against
|
|
161
|
+
* @param root0.path - The base directory to search in; defaults to cwd
|
|
162
|
+
* @returns A newline-separated list of matching file paths sorted by modification time,
|
|
163
|
+
* or a no-matches message if nothing is found
|
|
164
|
+
* @throws If the base directory does not exist
|
|
165
|
+
*/
|
|
166
|
+
call({ pattern, path: searchPath }: {
|
|
167
|
+
pattern: string;
|
|
168
|
+
path?: string;
|
|
169
|
+
}): string;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
type OutputMode = 'content' | 'files_with_matches' | 'count';
|
|
173
|
+
/**
|
|
174
|
+
* Tool for searching file contents using regular expressions.
|
|
175
|
+
* Supports multiple output modes, file type filtering, and multiline matching.
|
|
176
|
+
*
|
|
177
|
+
* @returns A Tool object for performing regex searches across files, with a call method that executes the search and returns results based on the specified output mode.
|
|
178
|
+
*/
|
|
179
|
+
declare function Grep(): {
|
|
180
|
+
name: string;
|
|
181
|
+
description: string;
|
|
182
|
+
inputSchema: z.ZodObject<{
|
|
183
|
+
pattern: z.ZodString;
|
|
184
|
+
path: z.ZodOptional<z.ZodString>;
|
|
185
|
+
glob: z.ZodOptional<z.ZodString>;
|
|
186
|
+
type: z.ZodOptional<z.ZodString>;
|
|
187
|
+
output_mode: z.ZodOptional<z.ZodEnum<{
|
|
188
|
+
content: "content";
|
|
189
|
+
files_with_matches: "files_with_matches";
|
|
190
|
+
count: "count";
|
|
191
|
+
}>>;
|
|
192
|
+
multiline: z.ZodOptional<z.ZodBoolean>;
|
|
193
|
+
case_insensitive: z.ZodOptional<z.ZodBoolean>;
|
|
194
|
+
context: z.ZodOptional<z.ZodNumber>;
|
|
195
|
+
head_limit: z.ZodOptional<z.ZodNumber>;
|
|
196
|
+
}, z.core.$strip>;
|
|
197
|
+
requireUserConfirm: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Searches files for a regex pattern and returns results in the specified output mode.
|
|
200
|
+
*
|
|
201
|
+
* @param root0 - The parameters object
|
|
202
|
+
* @param root0.pattern - The regular expression pattern to search for
|
|
203
|
+
* @param root0.path - File or directory to search in; defaults to cwd
|
|
204
|
+
* @param root0.glob - Glob pattern to filter which files are searched
|
|
205
|
+
* @param root0.type - File type shorthand (e.g. "ts", "py") to filter files
|
|
206
|
+
* @param root0.output_mode - How to format results: "content", "files_with_matches", or "count"
|
|
207
|
+
* @param root0.multiline - Whether the pattern can span multiple lines
|
|
208
|
+
* @param root0.case_insensitive - Whether the search is case-insensitive
|
|
209
|
+
* @param root0.context - Number of surrounding lines to include with each match
|
|
210
|
+
* @param root0.head_limit - Maximum number of result entries to return
|
|
211
|
+
* @returns A newline-separated string of results, or a no-matches message
|
|
212
|
+
*/
|
|
213
|
+
call({ pattern, path: searchPath, glob, type, output_mode, multiline, case_insensitive, context, head_limit, }: {
|
|
214
|
+
pattern: string;
|
|
215
|
+
path?: string;
|
|
216
|
+
glob?: string;
|
|
217
|
+
type?: string;
|
|
218
|
+
output_mode?: OutputMode;
|
|
219
|
+
multiline?: boolean;
|
|
220
|
+
case_insensitive?: boolean;
|
|
221
|
+
context?: number;
|
|
222
|
+
head_limit?: number;
|
|
223
|
+
}): string;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'deleted';
|
|
227
|
+
/**
|
|
228
|
+
* Tool for creating tasks
|
|
229
|
+
* @returns A Tool object for creating tasks
|
|
230
|
+
*/
|
|
231
|
+
declare function TaskCreate(): {
|
|
232
|
+
name: string;
|
|
233
|
+
description: string;
|
|
234
|
+
inputSchema: z.ZodObject<{
|
|
235
|
+
subject: z.ZodString;
|
|
236
|
+
description: z.ZodString;
|
|
237
|
+
activeForm: z.ZodOptional<z.ZodString>;
|
|
238
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
239
|
+
}, z.core.$strip>;
|
|
240
|
+
requireUserConfirm: boolean;
|
|
241
|
+
call({ subject, description, activeForm, metadata, }: {
|
|
242
|
+
subject: string;
|
|
243
|
+
description: string;
|
|
244
|
+
activeForm?: string;
|
|
245
|
+
metadata?: Record<string, unknown>;
|
|
246
|
+
}): ToolResponse;
|
|
247
|
+
};
|
|
248
|
+
/**
|
|
249
|
+
* Tool for updating tasks
|
|
250
|
+
* @returns A Tool object for updating tasks
|
|
251
|
+
*/
|
|
252
|
+
declare function TaskUpdate(): {
|
|
253
|
+
name: string;
|
|
254
|
+
description: string;
|
|
255
|
+
inputSchema: z.ZodObject<{
|
|
256
|
+
taskId: z.ZodString;
|
|
257
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
258
|
+
completed: "completed";
|
|
259
|
+
pending: "pending";
|
|
260
|
+
in_progress: "in_progress";
|
|
261
|
+
deleted: "deleted";
|
|
262
|
+
}>>;
|
|
263
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
264
|
+
description: z.ZodOptional<z.ZodString>;
|
|
265
|
+
activeForm: z.ZodOptional<z.ZodString>;
|
|
266
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
267
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
268
|
+
addBlocks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
269
|
+
addBlockedBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
270
|
+
}, z.core.$strip>;
|
|
271
|
+
requireUserConfirm: boolean;
|
|
272
|
+
call({ taskId, status, subject, description, activeForm, owner, metadata, addBlocks, addBlockedBy, }: {
|
|
273
|
+
taskId: string;
|
|
274
|
+
status?: TaskStatus;
|
|
275
|
+
subject?: string;
|
|
276
|
+
description?: string;
|
|
277
|
+
activeForm?: string;
|
|
278
|
+
owner?: string;
|
|
279
|
+
metadata?: Record<string, unknown>;
|
|
280
|
+
addBlocks?: string[];
|
|
281
|
+
addBlockedBy?: string[];
|
|
282
|
+
}): ToolResponse;
|
|
283
|
+
};
|
|
284
|
+
/**
|
|
285
|
+
* Tool for retrieving a single task
|
|
286
|
+
* @returns A Tool object for retrieving a task by ID
|
|
287
|
+
*/
|
|
288
|
+
declare function TaskGet(): {
|
|
289
|
+
name: string;
|
|
290
|
+
description: string;
|
|
291
|
+
inputSchema: z.ZodObject<{
|
|
292
|
+
taskId: z.ZodString;
|
|
293
|
+
}, z.core.$strip>;
|
|
294
|
+
requireUserConfirm: boolean;
|
|
295
|
+
call({ taskId }: {
|
|
296
|
+
taskId: string;
|
|
297
|
+
}): ToolResponse;
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* Tool for listing all active tasks
|
|
301
|
+
* @returns A Tool object for listing all active tasks
|
|
302
|
+
*/
|
|
303
|
+
declare function TaskList(): {
|
|
304
|
+
name: string;
|
|
305
|
+
description: string;
|
|
306
|
+
inputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
307
|
+
requireUserConfirm: boolean;
|
|
308
|
+
call(): ToolResponse;
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
export { Bash, Edit, Glob, Grep, Read, TaskCreate, TaskGet, TaskList, TaskUpdate, ToolResponse, Write };
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { a as ToolResponse } from '../index-BcatlwXQ.js';
|
|
2
|
+
export { T as Tool } from '../index-BcatlwXQ.js';
|
|
3
|
+
export { T as Toolkit } from '../toolkit-CEpulFi0.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import '@modelcontextprotocol/sdk/client/index.js';
|
|
6
|
+
import '@modelcontextprotocol/sdk/client/sse.js';
|
|
7
|
+
import '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
8
|
+
import '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
9
|
+
import '../index-CAxQAkiP.js';
|
|
10
|
+
import '../block-VsnHrllL.js';
|
|
11
|
+
import '@modelcontextprotocol/sdk/client/stdio.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Tool for executing bash commands in a shell environment.
|
|
15
|
+
* Intended for terminal operations such as git, npm, and docker.
|
|
16
|
+
* File operations should use the dedicated Read, Write, Edit, Glob, and Grep tools instead.
|
|
17
|
+
*
|
|
18
|
+
* @returns A Tool object for executing bash commands, with a call method that performs the execution and returns the output or error message.
|
|
19
|
+
*/
|
|
20
|
+
declare function Bash(): {
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
inputSchema: z.ZodObject<{
|
|
24
|
+
command: z.ZodString;
|
|
25
|
+
description: z.ZodOptional<z.ZodString>;
|
|
26
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
requireUserConfirm: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Executes a bash command and returns its output.
|
|
31
|
+
*
|
|
32
|
+
* @param root0 - The parameters object
|
|
33
|
+
* @param root0.command - The bash command to execute
|
|
34
|
+
* @param root0.description - Optional description of what the command does
|
|
35
|
+
* @param root0.timeout - Optional timeout in milliseconds (default: 120000, max: 600000)
|
|
36
|
+
* @returns The stdout of the command, or an error message if the command fails
|
|
37
|
+
*/
|
|
38
|
+
call({ command, description: _description, timeout, }: {
|
|
39
|
+
command: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
timeout?: number;
|
|
42
|
+
}): Promise<ToolResponse>;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Tool for reading files from the local filesystem.
|
|
47
|
+
* Returns file contents with line numbers in cat -n format.
|
|
48
|
+
*
|
|
49
|
+
* @returns A Tool object for reading files, with a call method that performs the read operation and returns the formatted contents or a warning if the file is empty.
|
|
50
|
+
*/
|
|
51
|
+
declare function Read(): {
|
|
52
|
+
name: string;
|
|
53
|
+
description: string;
|
|
54
|
+
inputSchema: z.ZodObject<{
|
|
55
|
+
file_path: z.ZodString;
|
|
56
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
requireUserConfirm: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Reads a file and returns its contents with line numbers.
|
|
62
|
+
*
|
|
63
|
+
* @param root0 - The parameters object
|
|
64
|
+
* @param root0.file_path - Absolute path to the file to read
|
|
65
|
+
* @param root0.offset - Line number to start reading from (1-based)
|
|
66
|
+
* @param root0.limit - Maximum number of lines to read (capped at 2000)
|
|
67
|
+
* @returns The file contents formatted with line numbers, or a warning if the file is empty
|
|
68
|
+
* @throws If the path is not absolute, the file does not exist, or the path is a directory
|
|
69
|
+
*/
|
|
70
|
+
call({ file_path, offset, limit, }: {
|
|
71
|
+
file_path: string;
|
|
72
|
+
offset?: number;
|
|
73
|
+
limit?: number;
|
|
74
|
+
}): ToolResponse;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Tool for writing files to the local filesystem.
|
|
79
|
+
* Creates parent directories as needed and overwrites existing files.
|
|
80
|
+
*
|
|
81
|
+
* @returns A Tool object for writing files, with a call method that performs the write operation.
|
|
82
|
+
*/
|
|
83
|
+
declare function Write(): {
|
|
84
|
+
name: string;
|
|
85
|
+
description: string;
|
|
86
|
+
inputSchema: z.ZodObject<{
|
|
87
|
+
file_path: z.ZodString;
|
|
88
|
+
content: z.ZodString;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
requireUserConfirm: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Writes content to a file, creating parent directories if necessary.
|
|
93
|
+
*
|
|
94
|
+
* @param root0 - The parameters object
|
|
95
|
+
* @param root0.file_path - Absolute path to the file to write
|
|
96
|
+
* @param root0.content - The content to write to the file
|
|
97
|
+
* @returns A success message including the number of lines written
|
|
98
|
+
* @throws If the path is not absolute
|
|
99
|
+
*/
|
|
100
|
+
call({ file_path, content }: {
|
|
101
|
+
file_path: string;
|
|
102
|
+
content: string;
|
|
103
|
+
}): string;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Tool for performing exact string replacements in files.
|
|
108
|
+
* Requires the file to have been read at least once before editing.
|
|
109
|
+
*
|
|
110
|
+
* @returns A Tool object with a call method that performs the edit operation based on the provided parameters, ensuring uniqueness of the old_string unless replace_all is true.
|
|
111
|
+
*/
|
|
112
|
+
declare function Edit(): {
|
|
113
|
+
name: string;
|
|
114
|
+
description: string;
|
|
115
|
+
inputSchema: z.ZodObject<{
|
|
116
|
+
file_path: z.ZodString;
|
|
117
|
+
old_string: z.ZodString;
|
|
118
|
+
new_string: z.ZodString;
|
|
119
|
+
replace_all: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
120
|
+
}, z.core.$strip>;
|
|
121
|
+
requireUserConfirm: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Performs an exact string replacement in the specified file.
|
|
124
|
+
*
|
|
125
|
+
* @param root0 - The parameters object
|
|
126
|
+
* @param root0.file_path - Absolute path to the file to modify
|
|
127
|
+
* @param root0.old_string - The exact text to find and replace
|
|
128
|
+
* @param root0.new_string - The text to replace old_string with
|
|
129
|
+
* @param root0.replace_all - If true, replaces all occurrences; otherwise only the first
|
|
130
|
+
* @returns A success message indicating the file was updated
|
|
131
|
+
* @throws If the path is not absolute, file does not exist, strings are identical,
|
|
132
|
+
* old_string is not found, or old_string is not unique and replace_all is false
|
|
133
|
+
*/
|
|
134
|
+
call({ file_path, old_string, new_string, replace_all, }: {
|
|
135
|
+
file_path: string;
|
|
136
|
+
old_string: string;
|
|
137
|
+
new_string: string;
|
|
138
|
+
replace_all?: boolean;
|
|
139
|
+
}): string;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Tool for fast file pattern matching across a codebase.
|
|
144
|
+
* Supports glob patterns and returns results sorted by modification time.
|
|
145
|
+
*
|
|
146
|
+
* @returns A Tool object with a call method that performs glob matching based on the provided pattern and path.
|
|
147
|
+
*/
|
|
148
|
+
declare function Glob(): {
|
|
149
|
+
name: string;
|
|
150
|
+
description: string;
|
|
151
|
+
inputSchema: z.ZodObject<{
|
|
152
|
+
pattern: z.ZodString;
|
|
153
|
+
path: z.ZodOptional<z.ZodString>;
|
|
154
|
+
}, z.core.$strip>;
|
|
155
|
+
requireUserConfirm: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Finds files matching a glob pattern under the given directory.
|
|
158
|
+
*
|
|
159
|
+
* @param root0 - The parameters object
|
|
160
|
+
* @param root0.pattern - The glob pattern to match files against
|
|
161
|
+
* @param root0.path - The base directory to search in; defaults to cwd
|
|
162
|
+
* @returns A newline-separated list of matching file paths sorted by modification time,
|
|
163
|
+
* or a no-matches message if nothing is found
|
|
164
|
+
* @throws If the base directory does not exist
|
|
165
|
+
*/
|
|
166
|
+
call({ pattern, path: searchPath }: {
|
|
167
|
+
pattern: string;
|
|
168
|
+
path?: string;
|
|
169
|
+
}): string;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
type OutputMode = 'content' | 'files_with_matches' | 'count';
|
|
173
|
+
/**
|
|
174
|
+
* Tool for searching file contents using regular expressions.
|
|
175
|
+
* Supports multiple output modes, file type filtering, and multiline matching.
|
|
176
|
+
*
|
|
177
|
+
* @returns A Tool object for performing regex searches across files, with a call method that executes the search and returns results based on the specified output mode.
|
|
178
|
+
*/
|
|
179
|
+
declare function Grep(): {
|
|
180
|
+
name: string;
|
|
181
|
+
description: string;
|
|
182
|
+
inputSchema: z.ZodObject<{
|
|
183
|
+
pattern: z.ZodString;
|
|
184
|
+
path: z.ZodOptional<z.ZodString>;
|
|
185
|
+
glob: z.ZodOptional<z.ZodString>;
|
|
186
|
+
type: z.ZodOptional<z.ZodString>;
|
|
187
|
+
output_mode: z.ZodOptional<z.ZodEnum<{
|
|
188
|
+
content: "content";
|
|
189
|
+
files_with_matches: "files_with_matches";
|
|
190
|
+
count: "count";
|
|
191
|
+
}>>;
|
|
192
|
+
multiline: z.ZodOptional<z.ZodBoolean>;
|
|
193
|
+
case_insensitive: z.ZodOptional<z.ZodBoolean>;
|
|
194
|
+
context: z.ZodOptional<z.ZodNumber>;
|
|
195
|
+
head_limit: z.ZodOptional<z.ZodNumber>;
|
|
196
|
+
}, z.core.$strip>;
|
|
197
|
+
requireUserConfirm: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Searches files for a regex pattern and returns results in the specified output mode.
|
|
200
|
+
*
|
|
201
|
+
* @param root0 - The parameters object
|
|
202
|
+
* @param root0.pattern - The regular expression pattern to search for
|
|
203
|
+
* @param root0.path - File or directory to search in; defaults to cwd
|
|
204
|
+
* @param root0.glob - Glob pattern to filter which files are searched
|
|
205
|
+
* @param root0.type - File type shorthand (e.g. "ts", "py") to filter files
|
|
206
|
+
* @param root0.output_mode - How to format results: "content", "files_with_matches", or "count"
|
|
207
|
+
* @param root0.multiline - Whether the pattern can span multiple lines
|
|
208
|
+
* @param root0.case_insensitive - Whether the search is case-insensitive
|
|
209
|
+
* @param root0.context - Number of surrounding lines to include with each match
|
|
210
|
+
* @param root0.head_limit - Maximum number of result entries to return
|
|
211
|
+
* @returns A newline-separated string of results, or a no-matches message
|
|
212
|
+
*/
|
|
213
|
+
call({ pattern, path: searchPath, glob, type, output_mode, multiline, case_insensitive, context, head_limit, }: {
|
|
214
|
+
pattern: string;
|
|
215
|
+
path?: string;
|
|
216
|
+
glob?: string;
|
|
217
|
+
type?: string;
|
|
218
|
+
output_mode?: OutputMode;
|
|
219
|
+
multiline?: boolean;
|
|
220
|
+
case_insensitive?: boolean;
|
|
221
|
+
context?: number;
|
|
222
|
+
head_limit?: number;
|
|
223
|
+
}): string;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'deleted';
|
|
227
|
+
/**
|
|
228
|
+
* Tool for creating tasks
|
|
229
|
+
* @returns A Tool object for creating tasks
|
|
230
|
+
*/
|
|
231
|
+
declare function TaskCreate(): {
|
|
232
|
+
name: string;
|
|
233
|
+
description: string;
|
|
234
|
+
inputSchema: z.ZodObject<{
|
|
235
|
+
subject: z.ZodString;
|
|
236
|
+
description: z.ZodString;
|
|
237
|
+
activeForm: z.ZodOptional<z.ZodString>;
|
|
238
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
239
|
+
}, z.core.$strip>;
|
|
240
|
+
requireUserConfirm: boolean;
|
|
241
|
+
call({ subject, description, activeForm, metadata, }: {
|
|
242
|
+
subject: string;
|
|
243
|
+
description: string;
|
|
244
|
+
activeForm?: string;
|
|
245
|
+
metadata?: Record<string, unknown>;
|
|
246
|
+
}): ToolResponse;
|
|
247
|
+
};
|
|
248
|
+
/**
|
|
249
|
+
* Tool for updating tasks
|
|
250
|
+
* @returns A Tool object for updating tasks
|
|
251
|
+
*/
|
|
252
|
+
declare function TaskUpdate(): {
|
|
253
|
+
name: string;
|
|
254
|
+
description: string;
|
|
255
|
+
inputSchema: z.ZodObject<{
|
|
256
|
+
taskId: z.ZodString;
|
|
257
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
258
|
+
completed: "completed";
|
|
259
|
+
pending: "pending";
|
|
260
|
+
in_progress: "in_progress";
|
|
261
|
+
deleted: "deleted";
|
|
262
|
+
}>>;
|
|
263
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
264
|
+
description: z.ZodOptional<z.ZodString>;
|
|
265
|
+
activeForm: z.ZodOptional<z.ZodString>;
|
|
266
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
267
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
268
|
+
addBlocks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
269
|
+
addBlockedBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
270
|
+
}, z.core.$strip>;
|
|
271
|
+
requireUserConfirm: boolean;
|
|
272
|
+
call({ taskId, status, subject, description, activeForm, owner, metadata, addBlocks, addBlockedBy, }: {
|
|
273
|
+
taskId: string;
|
|
274
|
+
status?: TaskStatus;
|
|
275
|
+
subject?: string;
|
|
276
|
+
description?: string;
|
|
277
|
+
activeForm?: string;
|
|
278
|
+
owner?: string;
|
|
279
|
+
metadata?: Record<string, unknown>;
|
|
280
|
+
addBlocks?: string[];
|
|
281
|
+
addBlockedBy?: string[];
|
|
282
|
+
}): ToolResponse;
|
|
283
|
+
};
|
|
284
|
+
/**
|
|
285
|
+
* Tool for retrieving a single task
|
|
286
|
+
* @returns A Tool object for retrieving a task by ID
|
|
287
|
+
*/
|
|
288
|
+
declare function TaskGet(): {
|
|
289
|
+
name: string;
|
|
290
|
+
description: string;
|
|
291
|
+
inputSchema: z.ZodObject<{
|
|
292
|
+
taskId: z.ZodString;
|
|
293
|
+
}, z.core.$strip>;
|
|
294
|
+
requireUserConfirm: boolean;
|
|
295
|
+
call({ taskId }: {
|
|
296
|
+
taskId: string;
|
|
297
|
+
}): ToolResponse;
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* Tool for listing all active tasks
|
|
301
|
+
* @returns A Tool object for listing all active tasks
|
|
302
|
+
*/
|
|
303
|
+
declare function TaskList(): {
|
|
304
|
+
name: string;
|
|
305
|
+
description: string;
|
|
306
|
+
inputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
307
|
+
requireUserConfirm: boolean;
|
|
308
|
+
call(): ToolResponse;
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
export { Bash, Edit, Glob, Grep, Read, TaskCreate, TaskGet, TaskList, TaskUpdate, ToolResponse, Write };
|