@remcp/runtime 0.2.149 → 0.2.151
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/CHANGELOG.md +16 -0
- package/package.json +1 -1
- package/src/catalog.mjs +5 -829
- package/src/core-catalog-part1.mjs +373 -0
- package/src/core-catalog-part2.mjs +374 -0
- package/src/core-catalog-shared.mjs +92 -0
- package/src/extended/browser.mjs +24 -4
- package/src/extended/catalog-rules.mjs +253 -0
- package/src/extended/catalog-schemas.mjs +252 -0
- package/src/extended/catalog.mjs +2 -505
- package/src/extended/desktop-macos-windows.mjs +66 -0
- package/src/extended/desktop-macos.mjs +2 -64
- package/src/extended/desktop-windows-msaa.mjs +104 -0
- package/src/extended/desktop-windows.mjs +1 -103
package/src/catalog.mjs
CHANGED
|
@@ -1,834 +1,10 @@
|
|
|
1
|
-
import { archiveBackendAvailable,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { statsToolHandlers } from './tools/stats.mjs';
|
|
6
|
-
import { configToolHandlers } from './tools/config.mjs';
|
|
1
|
+
import { archiveBackendAvailable, TEXT_OUTPUT_SCHEMA } from './core-catalog-shared.mjs';
|
|
2
|
+
import { coreToolDefinitionsPart1 } from './core-catalog-part1.mjs';
|
|
3
|
+
import { coreToolDefinitionsPart2 } from './core-catalog-part2.mjs';
|
|
4
|
+
export { TEXT_OUTPUT_SCHEMA };
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
// declared output schema is the same shape everywhere and clients can rely on it.
|
|
10
|
-
export const TEXT_OUTPUT_SCHEMA = {
|
|
11
|
-
type: 'object',
|
|
12
|
-
properties: {
|
|
13
|
-
text: { type: 'string', description: 'Human-readable result of the tool call.' },
|
|
14
|
-
},
|
|
15
|
-
required: ['text'],
|
|
16
|
-
additionalProperties: false,
|
|
17
|
-
};
|
|
6
|
+
export const toolDefinitions = [...coreToolDefinitionsPart1, ...coreToolDefinitionsPart2];
|
|
18
7
|
|
|
19
|
-
const NULLABLE_NUMBER_SCHEMA = { anyOf:[{ type:'number' }, { type:'null' }] };
|
|
20
|
-
const NULLABLE_STRING_SCHEMA = { anyOf:[{ type:'string' }, { type:'null' }] };
|
|
21
|
-
const TERMINAL_SESSION_PROPERTIES = {
|
|
22
|
-
pid:{ type:'number', description:'Process/session id used by follow-up terminal tools.' },
|
|
23
|
-
status:{ type:'string', description:'running or exited, with an exit code/signal when known.' },
|
|
24
|
-
runtimeMs:{ type:'number' },
|
|
25
|
-
lines:{ type:'number', description:'Total output lines produced by the session.' },
|
|
26
|
-
exited:{ type:'boolean' },
|
|
27
|
-
exitCode:NULLABLE_NUMBER_SCHEMA,
|
|
28
|
-
signal:NULLABLE_STRING_SCHEMA,
|
|
29
|
-
};
|
|
30
|
-
function terminalOutputSchema(extraProperties = {}, extraRequired = []) {
|
|
31
|
-
return {
|
|
32
|
-
type:'object',
|
|
33
|
-
properties:{ ...TERMINAL_SESSION_PROPERTIES, ...extraProperties },
|
|
34
|
-
required:['pid','status','runtimeMs','lines','exited','exitCode','signal', ...extraRequired],
|
|
35
|
-
additionalProperties:false,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
const START_PROCESS_OUTPUT_SCHEMA = terminalOutputSchema({
|
|
39
|
-
command:{ type:'string' },
|
|
40
|
-
output:{ type:'string' },
|
|
41
|
-
partial:{ type:'string' },
|
|
42
|
-
warning:{ type:'string' },
|
|
43
|
-
}, ['command','output']);
|
|
44
|
-
const READ_PROCESS_OUTPUT_SCHEMA = terminalOutputSchema({
|
|
45
|
-
range:{ type:'string' },
|
|
46
|
-
output:{ type:'string' },
|
|
47
|
-
explicitOffset:{ type:'boolean' },
|
|
48
|
-
}, ['range','output','explicitOffset']);
|
|
49
|
-
const WAIT_PROCESS_OUTPUT_SCHEMA = terminalOutputSchema({
|
|
50
|
-
pattern:{ type:'string' },
|
|
51
|
-
matched:{ type:'boolean' },
|
|
52
|
-
bufferedMatch:{ type:'boolean' },
|
|
53
|
-
timeoutMs:{ type:'number' },
|
|
54
|
-
output:{ type:'string' },
|
|
55
|
-
}, ['pattern','matched','bufferedMatch','timeoutMs','output']);
|
|
56
|
-
const INTERACT_PROCESS_OUTPUT_SCHEMA = terminalOutputSchema({
|
|
57
|
-
output:{ type:'string' },
|
|
58
|
-
}, ['output']);
|
|
59
|
-
const TERMINATE_PROCESS_OUTPUT_SCHEMA = terminalOutputSchema({
|
|
60
|
-
terminated:{ type:'boolean' },
|
|
61
|
-
alreadyExited:{ type:'boolean' },
|
|
62
|
-
escalated:{ type:'boolean' },
|
|
63
|
-
}, ['terminated','alreadyExited','escalated']);
|
|
64
|
-
const LIST_SESSIONS_OUTPUT_SCHEMA = {
|
|
65
|
-
type:'object',
|
|
66
|
-
properties:{
|
|
67
|
-
sessions:{
|
|
68
|
-
type:'array',
|
|
69
|
-
items:{
|
|
70
|
-
type:'object',
|
|
71
|
-
properties:{
|
|
72
|
-
...TERMINAL_SESSION_PROPERTIES,
|
|
73
|
-
blocked:{ type:'string' },
|
|
74
|
-
command:{ type:'string' },
|
|
75
|
-
},
|
|
76
|
-
required:['pid','status','runtimeMs','lines','exited','exitCode','signal','blocked','command'],
|
|
77
|
-
additionalProperties:false,
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
required:['sessions'],
|
|
82
|
-
additionalProperties:false,
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
const readOnly = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
|
|
86
|
-
const readOnlyNonIdempotent = { readOnlyHint: true, destructiveHint: false, idempotentHint: false, openWorldHint: false };
|
|
87
|
-
const additive = { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false };
|
|
88
|
-
const mutating = { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false };
|
|
89
|
-
const command = { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true };
|
|
90
|
-
|
|
91
|
-
export const toolDefinitions = [
|
|
92
|
-
{
|
|
93
|
-
name: 'read_file',
|
|
94
|
-
title: 'Read file',
|
|
95
|
-
description: 'Read a plain text or line-oriented file on this computer: source, config, Markdown, scripts or logs. Use read_document for PDF, DOCX, XLSX and other structured documents. Legacy .docx/.pdf extraction remains supported for compatibility. Use offset and length to page through large text files; a negative offset reads from the end.',
|
|
96
|
-
inputSchema: {
|
|
97
|
-
type: 'object',
|
|
98
|
-
properties: {
|
|
99
|
-
path: { type: 'string', description: 'Absolute path of the file to read. Relative paths resolve against the runtime working directory.' },
|
|
100
|
-
offset: { type: 'number', description: 'Zero-based first line to read. Negative values read the last N lines.' },
|
|
101
|
-
length: { type: 'number', description: 'Maximum number of lines to return.' },
|
|
102
|
-
},
|
|
103
|
-
required: ['path'],
|
|
104
|
-
additionalProperties: false,
|
|
105
|
-
},
|
|
106
|
-
annotations: readOnly,
|
|
107
|
-
handler: fileToolHandlers.read_file,
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: 'read_files',
|
|
111
|
-
title: 'Read files by glob',
|
|
112
|
-
description: 'Read the contents of files discovered by one glob under a directory, each section prefixed with its path and line count. Use this when the matched file contents are the result you want. Use start_search instead to find filenames or text matches without reading every matched file. If you already know the exact paths, use read_multiple_files; for one known path use read_file.',
|
|
113
|
-
inputSchema: {
|
|
114
|
-
type: 'object',
|
|
115
|
-
properties: {
|
|
116
|
-
path: { type: 'string', description: 'Absolute directory (or single file) to start from.' },
|
|
117
|
-
pattern: { type: 'string', description: 'Glob matched against the relative path and the file name, such as "src/**/*.ts" or "*.md". Default **/* .' },
|
|
118
|
-
max_files: { type: 'number', description: 'Stop after this many files. Default 100, maximum 500.' },
|
|
119
|
-
max_lines_per_file: { type: 'number', description: 'Lines kept per file. Default 2000.' },
|
|
120
|
-
include_ignored: { type: 'boolean', description: 'Also descend into .git and node_modules. Default false.' },
|
|
121
|
-
},
|
|
122
|
-
additionalProperties: false,
|
|
123
|
-
},
|
|
124
|
-
annotations: readOnly,
|
|
125
|
-
handler: fileToolHandlers.read_files,
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
name: 'read_multiple_files',
|
|
129
|
-
title: 'Read multiple files',
|
|
130
|
-
description: 'Read several explicitly named text files in one call. Use this when the exact paths are already known; each file is returned separately and one failure does not stop the others. Do not use this for glob discovery: use read_files instead. For one path use read_file.',
|
|
131
|
-
inputSchema: {
|
|
132
|
-
type: 'object',
|
|
133
|
-
properties: {
|
|
134
|
-
paths: { type: 'array', items: { type: 'string' }, description: 'Absolute paths of the files to read, at most 50 per call.' },
|
|
135
|
-
},
|
|
136
|
-
required: ['paths'],
|
|
137
|
-
additionalProperties: false,
|
|
138
|
-
},
|
|
139
|
-
annotations: readOnly,
|
|
140
|
-
handler: fileToolHandlers.read_multiple_files,
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
name: 'read_image',
|
|
144
|
-
title: 'Read image',
|
|
145
|
-
description: 'Return an image file (PNG, JPEG, GIF, WebP, BMP, AVIF, or SVG) as native MCP image content so screenshots, photos, and diagrams can be inspected or shown. Use read_binary only for byte-for-byte transfer, not merely to display an image. Fails above the inline size limit.',
|
|
146
|
-
inputSchema: {
|
|
147
|
-
type: 'object',
|
|
148
|
-
properties: {
|
|
149
|
-
path: { type: 'string', description: 'Absolute path of the image file.' },
|
|
150
|
-
},
|
|
151
|
-
required: ['path'],
|
|
152
|
-
additionalProperties: false,
|
|
153
|
-
},
|
|
154
|
-
annotations: readOnly,
|
|
155
|
-
handler: fileToolHandlers.read_image,
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
name: 'read_binary',
|
|
159
|
-
title: 'Read binary chunk',
|
|
160
|
-
description: 'Read any file as base64 chunks for byte-for-byte transfer of binaries, archives, documents, or oversized media. For a normal image that should be inspected or shown, use read_image instead. Returns size, offset, and nextOffsetBytes; call again with offset_bytes set to nextOffsetBytes until complete is true.',
|
|
161
|
-
inputSchema: {
|
|
162
|
-
type: 'object',
|
|
163
|
-
properties: {
|
|
164
|
-
path: { type: 'string', description: 'Absolute path of the file to read.' },
|
|
165
|
-
offset_bytes: { type: 'number', description: 'Byte offset to start at. Default 0.' },
|
|
166
|
-
length_bytes: { type: 'number', description: 'Chunk size in bytes. Default and maximum 1048576 (1 MiB).' },
|
|
167
|
-
},
|
|
168
|
-
required: ['path'],
|
|
169
|
-
additionalProperties: false,
|
|
170
|
-
},
|
|
171
|
-
annotations: readOnly,
|
|
172
|
-
handler: fileToolHandlers.read_binary,
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
name: 'write_binary',
|
|
176
|
-
title: 'Write binary chunk',
|
|
177
|
-
description: 'Write base64 data to a file byte for byte, creating parent directories. Use mode "append" to send a large file as consecutive chunks. Replaces the file by default.',
|
|
178
|
-
inputSchema: {
|
|
179
|
-
type: 'object',
|
|
180
|
-
properties: {
|
|
181
|
-
path: { type: 'string', description: 'Absolute path of the file to write.' },
|
|
182
|
-
data: { type: 'string', description: 'Base64-encoded content.' },
|
|
183
|
-
mode: { type: 'string', enum: ['rewrite', 'append'], description: 'rewrite replaces the file, append adds to the end. Default rewrite.' },
|
|
184
|
-
},
|
|
185
|
-
required: ['path', 'data'],
|
|
186
|
-
additionalProperties: false,
|
|
187
|
-
},
|
|
188
|
-
annotations: mutating,
|
|
189
|
-
handler: fileToolHandlers.write_binary,
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
name: 'hash_file',
|
|
193
|
-
title: 'Hash file',
|
|
194
|
-
description: 'Compute a checksum of a file without reading it into memory. Useful to verify a copy, compare two files, or confirm a download.',
|
|
195
|
-
inputSchema: {
|
|
196
|
-
type: 'object',
|
|
197
|
-
properties: {
|
|
198
|
-
path: { type: 'string', description: 'Absolute path of the file to hash.' },
|
|
199
|
-
algorithm: { type: 'string', enum: ['sha256', 'sha1', 'md5'], description: 'Hash algorithm. Default sha256.' },
|
|
200
|
-
},
|
|
201
|
-
required: ['path'],
|
|
202
|
-
additionalProperties: false,
|
|
203
|
-
},
|
|
204
|
-
annotations: readOnly,
|
|
205
|
-
handler: fileToolHandlers.hash_file,
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
name: 'list_directory',
|
|
209
|
-
title: 'List directory',
|
|
210
|
-
description: 'List the files and directories at a path. Entries are prefixed with [DIR], [FILE], [LINK], or [DENIED] when a subdirectory cannot be read. depth controls how many directory levels are included and pattern filters file names by glob.',
|
|
211
|
-
inputSchema: {
|
|
212
|
-
type: 'object',
|
|
213
|
-
properties: {
|
|
214
|
-
path: { type: 'string', description: 'Absolute path of the directory to list.' },
|
|
215
|
-
depth: { type: 'number', description: 'Directory levels to list, from 1 to 5. Default 1.' },
|
|
216
|
-
pattern: { type: 'string', description: 'Optional glob that filters file names, such as "*.log". Directories are always listed.' },
|
|
217
|
-
},
|
|
218
|
-
required: ['path'],
|
|
219
|
-
additionalProperties: false,
|
|
220
|
-
},
|
|
221
|
-
annotations: readOnly,
|
|
222
|
-
handler: fileToolHandlers.list_directory,
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
name: 'get_file_info',
|
|
226
|
-
title: 'Get file info',
|
|
227
|
-
description: 'Return metadata for a file or directory: type, size, timestamps, permissions, and for small text files the line count.',
|
|
228
|
-
inputSchema: {
|
|
229
|
-
type: 'object',
|
|
230
|
-
properties: {
|
|
231
|
-
path: { type: 'string', description: 'Absolute path to inspect.' },
|
|
232
|
-
},
|
|
233
|
-
required: ['path'],
|
|
234
|
-
additionalProperties: false,
|
|
235
|
-
},
|
|
236
|
-
annotations: readOnly,
|
|
237
|
-
handler: fileToolHandlers.get_file_info,
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
name: 'write_file',
|
|
241
|
-
title: 'Write file',
|
|
242
|
-
description: 'Create or replace the complete contents of exactly one text file. Parent directories are created automatically; mode "append" adds to the end. For a small exact-block edit use edit_block, for a known line range use replace_lines, and when you already have a unified diff use apply_patch. Use write_files for two or more independent complete files, and write_binary for binary bytes.',
|
|
243
|
-
inputSchema: {
|
|
244
|
-
type: 'object',
|
|
245
|
-
properties: {
|
|
246
|
-
path: { type: 'string', description: 'Absolute path of the file to write.' },
|
|
247
|
-
content: { type: 'string', description: 'Full file content, or the text to append.' },
|
|
248
|
-
mode: { type: 'string', enum: ['rewrite', 'append'], description: 'rewrite replaces the file content, append adds to the end. Default rewrite.' },
|
|
249
|
-
},
|
|
250
|
-
required: ['path', 'content'],
|
|
251
|
-
additionalProperties: false,
|
|
252
|
-
},
|
|
253
|
-
annotations: mutating,
|
|
254
|
-
handler: fileToolHandlers.write_file,
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
name: 'write_files',
|
|
258
|
-
title: 'Write multiple files',
|
|
259
|
-
description: 'Create or replace the complete contents of two or more text files in one batch, each with its own path, content, and optional mode. Use this for scaffolding or coherent multi-file writes; for one path use write_file. For partial edits use edit_block, replace_lines, replace_in_files, or apply_patch instead of rewriting whole files.',
|
|
260
|
-
inputSchema: {
|
|
261
|
-
type: 'object',
|
|
262
|
-
properties: {
|
|
263
|
-
files: {
|
|
264
|
-
type: 'array',
|
|
265
|
-
description: 'Files to write, at most 200 per call.',
|
|
266
|
-
items: {
|
|
267
|
-
type: 'object',
|
|
268
|
-
properties: {
|
|
269
|
-
path: { type: 'string', description: 'Absolute path of the file.' },
|
|
270
|
-
content: { type: 'string', description: 'Full file content.' },
|
|
271
|
-
mode: { type: 'string', enum: ['rewrite', 'append'], description: 'rewrite replaces the file (default), append adds to the end.' },
|
|
272
|
-
},
|
|
273
|
-
required: ['path', 'content'],
|
|
274
|
-
additionalProperties: false,
|
|
275
|
-
},
|
|
276
|
-
},
|
|
277
|
-
},
|
|
278
|
-
required: ['files'],
|
|
279
|
-
additionalProperties: false,
|
|
280
|
-
},
|
|
281
|
-
annotations: mutating,
|
|
282
|
-
handler: fileToolHandlers.write_files,
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
name: 'apply_patch',
|
|
286
|
-
title: 'Apply patch',
|
|
287
|
-
description: 'Apply an already-prepared unified diff to one file or several files, matching each hunk with a little fuzz so small offsets and whitespace differences still apply. Prefer this when the change is naturally patch-shaped; use edit_block for one exact text block and write_file only when replacing a complete file. Pass dry_run to see the result first.',
|
|
288
|
-
inputSchema: {
|
|
289
|
-
type: 'object',
|
|
290
|
-
properties: {
|
|
291
|
-
patch: { type: 'string', description: 'Unified diff, including ---/+++ headers and @@ hunks.' },
|
|
292
|
-
path: { type: 'string', description: 'Apply every hunk to this file, ignoring the patch headers.' },
|
|
293
|
-
dry_run: { type: 'boolean', description: 'Report the diff without writing. Default false.' },
|
|
294
|
-
},
|
|
295
|
-
required: ['patch'],
|
|
296
|
-
additionalProperties: false,
|
|
297
|
-
},
|
|
298
|
-
annotations: mutating,
|
|
299
|
-
handler: fileToolHandlers.apply_patch,
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
name: 'set_permissions',
|
|
303
|
-
title: 'Set permissions',
|
|
304
|
-
description: 'Change the permission mode of a file or directory, optionally recursively and optionally with a numeric owner. Use this to make a script executable after writing it.',
|
|
305
|
-
inputSchema: {
|
|
306
|
-
type: 'object',
|
|
307
|
-
properties: {
|
|
308
|
-
path: { type: 'string', description: 'Absolute path whose permissions should change.' },
|
|
309
|
-
mode: { type: 'string', description: 'Octal mode such as "755" or "0644".' },
|
|
310
|
-
recursive: { type: 'boolean', description: 'Apply to a directory and everything inside it. Default false.' },
|
|
311
|
-
uid: { type: 'number', description: 'Optional numeric user id to set as owner.' },
|
|
312
|
-
gid: { type: 'number', description: 'Optional numeric group id to set as owner.' },
|
|
313
|
-
},
|
|
314
|
-
required: ['path', 'mode'],
|
|
315
|
-
additionalProperties: false,
|
|
316
|
-
},
|
|
317
|
-
annotations: mutating,
|
|
318
|
-
handler: fileToolHandlers.set_permissions,
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
name: 'edit_block',
|
|
322
|
-
title: 'Edit file',
|
|
323
|
-
description: 'Replace one known text block in one file. Provide enough surrounding context to make old_string unique; the call fails unless the number of matches equals expected_replacements. Use write_file for a whole-file replacement and replace_lines for a known line range. When exact text is not found, a whitespace-tolerant match is attempted and reported. Pass dry_run to preview without writing.',
|
|
324
|
-
inputSchema: {
|
|
325
|
-
type: 'object',
|
|
326
|
-
properties: {
|
|
327
|
-
file_path: { type: 'string', description: 'Absolute path of the file to edit.' },
|
|
328
|
-
old_string: { type: 'string', description: 'Exact existing text to replace.' },
|
|
329
|
-
new_string: { type: 'string', description: 'Replacement text.' },
|
|
330
|
-
expected_replacements: { type: 'number', description: 'Number of matches required for the edit to apply. Default 1.' },
|
|
331
|
-
allow_fuzzy: { type: 'boolean', description: 'Allow a whitespace-tolerant fallback when the exact text is not found. Default true.' },
|
|
332
|
-
dry_run: { type: 'boolean', description: 'Return the diff without changing the file. Default false.' },
|
|
333
|
-
},
|
|
334
|
-
required: ['file_path', 'old_string', 'new_string'],
|
|
335
|
-
additionalProperties: false,
|
|
336
|
-
},
|
|
337
|
-
annotations: mutating,
|
|
338
|
-
handler: fileToolHandlers.edit_block,
|
|
339
|
-
},
|
|
340
|
-
{
|
|
341
|
-
name: 'replace_lines',
|
|
342
|
-
title: 'Replace lines',
|
|
343
|
-
description: 'Replace an inclusive 1-based line range with new text. Use this when line numbers define the target; use edit_block when matching existing text and write_file for a complete rewrite. The rest of the file, including its line endings, is preserved. Pass dry_run to preview without writing.',
|
|
344
|
-
inputSchema: {
|
|
345
|
-
type: 'object',
|
|
346
|
-
properties: {
|
|
347
|
-
path: { type: 'string', description: 'Absolute path of the file to edit.' },
|
|
348
|
-
start_line: { type: 'number', description: 'First line to replace, 1-based and inclusive.' },
|
|
349
|
-
end_line: { type: 'number', description: 'Last line to replace, 1-based and inclusive.' },
|
|
350
|
-
content: { type: 'string', description: 'Replacement text; an empty string deletes the range.' },
|
|
351
|
-
dry_run: { type: 'boolean', description: 'Return the diff without changing the file. Default false.' },
|
|
352
|
-
},
|
|
353
|
-
required: ['path', 'start_line', 'end_line', 'content'],
|
|
354
|
-
additionalProperties: false,
|
|
355
|
-
},
|
|
356
|
-
annotations: mutating,
|
|
357
|
-
handler: fileToolHandlers.replace_lines,
|
|
358
|
-
},
|
|
359
|
-
{
|
|
360
|
-
name: 'replace_in_files',
|
|
361
|
-
title: 'Replace in files',
|
|
362
|
-
description: 'Search and replace the same text or regular expression across multiple text files under a path and report what changed. Use edit_block for one known block in one file and write_file for one complete known file. Applies immediately; pass dry_run true to preview the affected files first.',
|
|
363
|
-
inputSchema: {
|
|
364
|
-
type: 'object',
|
|
365
|
-
properties: {
|
|
366
|
-
path: { type: 'string', description: 'Absolute path of a file or directory to search.' },
|
|
367
|
-
pattern: { type: 'string', description: 'Text or regular expression to find.' },
|
|
368
|
-
replacement: { type: 'string', description: 'Replacement text. In regex mode, $1 and friends refer to capture groups.' },
|
|
369
|
-
filePattern: { type: 'string', description: 'Optional glob limiting which file names are changed, such as "*.ts".' },
|
|
370
|
-
regex: { type: 'boolean', description: 'Treat pattern as a regular expression. Default false (plain text).' },
|
|
371
|
-
dry_run: { type: 'boolean', description: 'Only report the files that would change. Default false.' },
|
|
372
|
-
maxFiles: { type: 'number', description: 'Stop after this many changed files. Default 100, maximum 500.' },
|
|
373
|
-
},
|
|
374
|
-
required: ['path', 'pattern', 'replacement'],
|
|
375
|
-
additionalProperties: false,
|
|
376
|
-
},
|
|
377
|
-
annotations: mutating,
|
|
378
|
-
handler: fileToolHandlers.replace_in_files,
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
name: 'diff_files',
|
|
382
|
-
title: 'Diff files',
|
|
383
|
-
description: 'Show a unified diff between two local text files, with line counts. Useful to check what changed before reporting or reverting it.',
|
|
384
|
-
inputSchema: {
|
|
385
|
-
type: 'object',
|
|
386
|
-
properties: {
|
|
387
|
-
left: { type: 'string', description: 'Absolute path of the original file.' },
|
|
388
|
-
right: { type: 'string', description: 'Absolute path of the file to compare against it.' },
|
|
389
|
-
context_lines: { type: 'number', description: 'Lines of context around each change. Default 3, maximum 20.' },
|
|
390
|
-
},
|
|
391
|
-
required: ['left', 'right'],
|
|
392
|
-
additionalProperties: false,
|
|
393
|
-
},
|
|
394
|
-
annotations: readOnly,
|
|
395
|
-
handler: fileToolHandlers.diff_files,
|
|
396
|
-
},
|
|
397
|
-
{
|
|
398
|
-
name: 'move_to_trash',
|
|
399
|
-
title: 'Move to trash',
|
|
400
|
-
description: 'Move a file or directory to the system trash instead of deleting it, so the change can be undone. When the trash is outside the device allowed roots, a .remcp-trash folder beside the file is used instead.',
|
|
401
|
-
inputSchema: {
|
|
402
|
-
type: 'object',
|
|
403
|
-
properties: {
|
|
404
|
-
source: { type: 'string', description: 'Absolute path to move to the trash.' },
|
|
405
|
-
},
|
|
406
|
-
required: ['source'],
|
|
407
|
-
additionalProperties: false,
|
|
408
|
-
},
|
|
409
|
-
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
|
|
410
|
-
handler: fileToolHandlers.move_to_trash,
|
|
411
|
-
},
|
|
412
|
-
{
|
|
413
|
-
name: 'create_directory',
|
|
414
|
-
title: 'Create directories',
|
|
415
|
-
description: 'Create one directory or many in a single call, including any missing parent directories. Succeeds when a directory already exists.',
|
|
416
|
-
inputSchema: {
|
|
417
|
-
type: 'object',
|
|
418
|
-
properties: {
|
|
419
|
-
path: { type: 'string', description: 'Absolute path of the directory to create.' },
|
|
420
|
-
paths: { type: 'array', items: { type: 'string' }, description: 'Several directories to create at once, at most 200.' },
|
|
421
|
-
},
|
|
422
|
-
additionalProperties: false,
|
|
423
|
-
},
|
|
424
|
-
annotations: additive,
|
|
425
|
-
handler: fileToolHandlers.create_directory,
|
|
426
|
-
},
|
|
427
|
-
{
|
|
428
|
-
name: 'move_file',
|
|
429
|
-
title: 'Move or rename',
|
|
430
|
-
description: 'Move or rename exactly one file or directory from one source to one destination. Replaces an existing destination file by default; pass overwrite false to refuse instead. Use move_paths for two or more moves.',
|
|
431
|
-
inputSchema: {
|
|
432
|
-
type: 'object',
|
|
433
|
-
properties: {
|
|
434
|
-
source: { type: 'string', description: 'Absolute path to move.' },
|
|
435
|
-
destination: { type: 'string', description: 'Absolute destination path.' },
|
|
436
|
-
overwrite: { type: 'boolean', description: 'Replace an existing destination file. Default true.' },
|
|
437
|
-
},
|
|
438
|
-
required: ['source', 'destination'],
|
|
439
|
-
additionalProperties: false,
|
|
440
|
-
},
|
|
441
|
-
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
|
|
442
|
-
handler: fileToolHandlers.move_file,
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
name: 'copy_file',
|
|
446
|
-
title: 'Copy file',
|
|
447
|
-
description: 'Copy exactly one regular file to a new path. Directories are not copied recursively. Use copy_paths for directories or two or more copy operations; pass overwrite false to refuse an existing destination.',
|
|
448
|
-
inputSchema: {
|
|
449
|
-
type: 'object',
|
|
450
|
-
properties: {
|
|
451
|
-
source: { type: 'string', description: 'Absolute path of the file to copy.' },
|
|
452
|
-
destination: { type: 'string', description: 'Absolute destination path.' },
|
|
453
|
-
overwrite: { type: 'boolean', description: 'Replace the destination when it already exists. Default true.' },
|
|
454
|
-
},
|
|
455
|
-
required: ['source', 'destination'],
|
|
456
|
-
additionalProperties: false,
|
|
457
|
-
},
|
|
458
|
-
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
|
|
459
|
-
handler: fileToolHandlers.copy_file,
|
|
460
|
-
},
|
|
461
|
-
{
|
|
462
|
-
name: 'copy_paths',
|
|
463
|
-
title: 'Copy paths',
|
|
464
|
-
description: 'Copy two or more paths, or copy a directory recursively, in one call. Each item has its own source and destination. For exactly one regular file use copy_file.',
|
|
465
|
-
inputSchema: {
|
|
466
|
-
type: 'object',
|
|
467
|
-
properties: {
|
|
468
|
-
paths: {
|
|
469
|
-
type: 'array',
|
|
470
|
-
description: 'Pairs to copy, at most 200 per call.',
|
|
471
|
-
items: {
|
|
472
|
-
type: 'object',
|
|
473
|
-
properties: {
|
|
474
|
-
source: { type: 'string', description: 'Absolute path to copy.' },
|
|
475
|
-
destination: { type: 'string', description: 'Absolute destination path.' },
|
|
476
|
-
},
|
|
477
|
-
required: ['source', 'destination'],
|
|
478
|
-
additionalProperties: false,
|
|
479
|
-
},
|
|
480
|
-
},
|
|
481
|
-
overwrite: { type: 'boolean', description: 'Replace an existing destination. Default true.' },
|
|
482
|
-
},
|
|
483
|
-
required: ['paths'],
|
|
484
|
-
additionalProperties: false,
|
|
485
|
-
},
|
|
486
|
-
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
|
|
487
|
-
handler: fileToolHandlers.copy_paths,
|
|
488
|
-
},
|
|
489
|
-
{
|
|
490
|
-
name: 'move_paths',
|
|
491
|
-
title: 'Move paths',
|
|
492
|
-
description: 'Move or rename two or more files/directories in one batch, each with its own source and destination. Falls back to copy-and-delete across filesystems. For one source/destination pair use move_file.',
|
|
493
|
-
inputSchema: {
|
|
494
|
-
type: 'object',
|
|
495
|
-
properties: {
|
|
496
|
-
paths: {
|
|
497
|
-
type: 'array',
|
|
498
|
-
description: 'Pairs to move, at most 200 per call.',
|
|
499
|
-
items: {
|
|
500
|
-
type: 'object',
|
|
501
|
-
properties: {
|
|
502
|
-
source: { type: 'string', description: 'Absolute path to move.' },
|
|
503
|
-
destination: { type: 'string', description: 'Absolute destination path.' },
|
|
504
|
-
},
|
|
505
|
-
required: ['source', 'destination'],
|
|
506
|
-
additionalProperties: false,
|
|
507
|
-
},
|
|
508
|
-
},
|
|
509
|
-
overwrite: { type: 'boolean', description: 'Replace an existing destination. Default true.' },
|
|
510
|
-
},
|
|
511
|
-
required: ['paths'],
|
|
512
|
-
additionalProperties: false,
|
|
513
|
-
},
|
|
514
|
-
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
|
|
515
|
-
handler: fileToolHandlers.move_paths,
|
|
516
|
-
},
|
|
517
|
-
{
|
|
518
|
-
name: 'delete_path',
|
|
519
|
-
title: 'Delete path',
|
|
520
|
-
description: 'Delete exactly one file or directory. Directories are removed with their contents unless recursive is false; the filesystem root is refused. Use delete_paths for two or more targets, or move_to_trash when deletion should be reversible.',
|
|
521
|
-
inputSchema: {
|
|
522
|
-
type: 'object',
|
|
523
|
-
properties: {
|
|
524
|
-
path: { type: 'string', description: 'Absolute path to delete.' },
|
|
525
|
-
recursive: { type: 'boolean', description: 'Delete a non-empty directory with its contents. Default true.' },
|
|
526
|
-
},
|
|
527
|
-
required: ['path'],
|
|
528
|
-
additionalProperties: false,
|
|
529
|
-
},
|
|
530
|
-
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
|
|
531
|
-
handler: fileToolHandlers.delete_path,
|
|
532
|
-
},
|
|
533
|
-
{
|
|
534
|
-
name: 'delete_paths',
|
|
535
|
-
title: 'Delete paths',
|
|
536
|
-
description: 'Delete two or more files/directories in one batch and report each result. For one target use delete_path. Use move_to_trash instead when deletion should be reversible.',
|
|
537
|
-
inputSchema: {
|
|
538
|
-
type: 'object',
|
|
539
|
-
properties: {
|
|
540
|
-
paths: { type: 'array', items: { type: 'string' }, description: 'Absolute paths to delete, at most 500 per call.' },
|
|
541
|
-
recursive: { type: 'boolean', description: 'Delete non-empty directories with their contents. Default true.' },
|
|
542
|
-
},
|
|
543
|
-
required: ['paths'],
|
|
544
|
-
additionalProperties: false,
|
|
545
|
-
},
|
|
546
|
-
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
|
|
547
|
-
handler: fileToolHandlers.delete_paths,
|
|
548
|
-
},
|
|
549
|
-
{
|
|
550
|
-
name: 'create_archive',
|
|
551
|
-
title: 'Create archive',
|
|
552
|
-
description: 'Pack files and directories into a tar, tar.gz, or zip archive on the device, so a whole tree can be transferred or backed up in one call.',
|
|
553
|
-
inputSchema: {
|
|
554
|
-
type: 'object',
|
|
555
|
-
properties: {
|
|
556
|
-
paths: { type: 'array', items: { type: 'string' }, description: 'Absolute paths of the files and directories to include.' },
|
|
557
|
-
destination: { type: 'string', description: 'Absolute path of the archive to create.' },
|
|
558
|
-
format: { type: 'string', enum: ['tar', 'tar.gz', 'zip'], description: 'Archive format. Default tar.gz, or zip when the destination ends in .zip.' },
|
|
559
|
-
},
|
|
560
|
-
required: ['paths', 'destination'],
|
|
561
|
-
additionalProperties: false,
|
|
562
|
-
},
|
|
563
|
-
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
|
|
564
|
-
handler: fileToolHandlers.create_archive,
|
|
565
|
-
},
|
|
566
|
-
{
|
|
567
|
-
name: 'extract_archive',
|
|
568
|
-
title: 'Extract archive',
|
|
569
|
-
description: 'Extract a tar, tar.gz, tar.bz2, tar.xz, or zip archive on the device into a directory, creating it when needed.',
|
|
570
|
-
inputSchema: {
|
|
571
|
-
type: 'object',
|
|
572
|
-
properties: {
|
|
573
|
-
archive: { type: 'string', description: 'Absolute path of the archive to extract.' },
|
|
574
|
-
destination: { type: 'string', description: 'Absolute directory to extract into. Defaults to the archive directory.' },
|
|
575
|
-
},
|
|
576
|
-
required: ['archive'],
|
|
577
|
-
additionalProperties: false,
|
|
578
|
-
},
|
|
579
|
-
annotations: mutating,
|
|
580
|
-
handler: fileToolHandlers.extract_archive,
|
|
581
|
-
},
|
|
582
|
-
{
|
|
583
|
-
name: 'take_screenshot',
|
|
584
|
-
title: 'Take screenshot',
|
|
585
|
-
description: 'Capture the entire desktop only when full-screen pixels are actually needed. Prefer ui_snapshot or browser_snapshot for semantic inspection, and screenshot_region for one window, monitor, or rectangle. This tool uses the platform screenshot portal/utility and returns an image.',
|
|
586
|
-
inputSchema: {
|
|
587
|
-
type: 'object',
|
|
588
|
-
properties: {
|
|
589
|
-
directory: { type: 'string', description: 'Absolute directory to write the temporary PNG into. Defaults to the system temp directory.' },
|
|
590
|
-
keep: { type: 'boolean', description: 'Keep the PNG on disk instead of deleting it after it is returned. Default false.' },
|
|
591
|
-
},
|
|
592
|
-
additionalProperties: false,
|
|
593
|
-
},
|
|
594
|
-
// keep=true and oversized fallbacks persist a timestamped PNG, so a repeated call can add files.
|
|
595
|
-
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
596
|
-
handler: fileToolHandlers.take_screenshot,
|
|
597
|
-
},
|
|
598
|
-
{
|
|
599
|
-
name: 'start_search',
|
|
600
|
-
title: 'Start search',
|
|
601
|
-
description: 'Start a filename or content search on this computer and return the first matches without reading every matched file in full. Use read_files instead when a glob is already known and the contents of all matching files are the desired result. Content searches return "path:line: text" rows. Use get_more_search_results to page and stop_search to stop a long search.',
|
|
602
|
-
inputSchema: {
|
|
603
|
-
type: 'object',
|
|
604
|
-
properties: {
|
|
605
|
-
path: { type: 'string', description: 'Absolute path of the directory or file to search.' },
|
|
606
|
-
pattern: { type: 'string', description: 'Regular expression for content searches, or a glob such as "*.ts" when searchType is files.' },
|
|
607
|
-
searchType: { type: 'string', enum: ['content', 'files'], description: 'Search file contents (default) or file names.' },
|
|
608
|
-
filePattern: { type: 'string', description: 'Optional relative glob that limits which files are searched, such as "*.ts".' },
|
|
609
|
-
ignoreCase: { type: 'boolean', description: 'Case-insensitive content matching.' },
|
|
610
|
-
maxResults: { type: 'number', description: 'Stop the search after this many results. Default 200.' },
|
|
611
|
-
includeHidden: { type: 'boolean', description: 'Include hidden files and directories.' },
|
|
612
|
-
includeIgnored: { type: 'boolean', description: 'Also search directories normally skipped, such as node_modules, dist, build, and virtualenvs.' },
|
|
613
|
-
contextLines: { type: 'number', description: 'Number of context lines to return around each content match, up to 10.' },
|
|
614
|
-
literalSearch: { type: 'boolean', description: 'Treat the pattern as literal text instead of a regular expression.' },
|
|
615
|
-
},
|
|
616
|
-
required: ['path', 'pattern'],
|
|
617
|
-
additionalProperties: false,
|
|
618
|
-
},
|
|
619
|
-
annotations: readOnlyNonIdempotent,
|
|
620
|
-
handler: searchToolHandlers.start_search,
|
|
621
|
-
},
|
|
622
|
-
{
|
|
623
|
-
name: 'get_more_search_results',
|
|
624
|
-
title: 'Get more search results',
|
|
625
|
-
description: 'Read more results from a search started with start_search. Offset is zero-based; a negative offset returns the last N results.',
|
|
626
|
-
inputSchema: {
|
|
627
|
-
type: 'object',
|
|
628
|
-
properties: {
|
|
629
|
-
sessionId: { type: 'string', description: 'Search id returned by start_search.' },
|
|
630
|
-
offset: { type: 'number', description: 'Zero-based first result to return. Negative values read from the end.' },
|
|
631
|
-
length: { type: 'number', description: 'Maximum number of results to return. Default 100.' },
|
|
632
|
-
},
|
|
633
|
-
required: ['sessionId'],
|
|
634
|
-
additionalProperties: false,
|
|
635
|
-
},
|
|
636
|
-
annotations: readOnly,
|
|
637
|
-
handler: searchToolHandlers.get_more_search_results,
|
|
638
|
-
},
|
|
639
|
-
{
|
|
640
|
-
name: 'stop_search',
|
|
641
|
-
title: 'Stop search',
|
|
642
|
-
description: 'Stop a running search. Results collected so far stay readable until the search is cleaned up.',
|
|
643
|
-
inputSchema: {
|
|
644
|
-
type: 'object',
|
|
645
|
-
properties: {
|
|
646
|
-
sessionId: { type: 'string', description: 'Search id returned by start_search.' },
|
|
647
|
-
},
|
|
648
|
-
required: ['sessionId'],
|
|
649
|
-
additionalProperties: false,
|
|
650
|
-
},
|
|
651
|
-
annotations: additive,
|
|
652
|
-
handler: searchToolHandlers.stop_search,
|
|
653
|
-
},
|
|
654
|
-
{
|
|
655
|
-
name: 'list_searches',
|
|
656
|
-
title: 'List searches',
|
|
657
|
-
description: 'List active and recent searches on this computer with their status and result counts.',
|
|
658
|
-
inputSchema: { type: 'object', properties: {}, additionalProperties: false },
|
|
659
|
-
annotations: readOnly,
|
|
660
|
-
handler: searchToolHandlers.list_searches,
|
|
661
|
-
},
|
|
662
|
-
{
|
|
663
|
-
name: 'start_process',
|
|
664
|
-
title: 'Start process',
|
|
665
|
-
description: 'Run a shell command, script, build, test suite, or terminal server and return its initial output. Prefer dedicated semantic tools for jobs they already cover: launch_app for GUI apps, service for service-manager operations, power_action for lock/sleep/restart/shutdown, network for routine network inspection/tests, event_log for OS logs, installed_apps for software inventory, environment for environment facts, and open_path/reveal_path for opening or revealing files. The process keeps running so read_process_output or interact_with_process can be used later.',
|
|
666
|
-
inputSchema: {
|
|
667
|
-
type: 'object',
|
|
668
|
-
properties: {
|
|
669
|
-
command: { type: 'string', description: 'Shell command to run.' },
|
|
670
|
-
timeout_ms: { type: 'number', description: 'How long to wait for initial output before returning, in milliseconds. Default 1000.' },
|
|
671
|
-
},
|
|
672
|
-
required: ['command'],
|
|
673
|
-
additionalProperties: false,
|
|
674
|
-
},
|
|
675
|
-
annotations: command,
|
|
676
|
-
outputSchema: START_PROCESS_OUTPUT_SCHEMA,
|
|
677
|
-
handler: terminalToolHandlers.start_process,
|
|
678
|
-
},
|
|
679
|
-
{
|
|
680
|
-
name: 'read_process_output',
|
|
681
|
-
title: 'Read process output',
|
|
682
|
-
description: 'Read buffered output from a session started with start_process. Without an offset it returns output produced since the previous read.',
|
|
683
|
-
inputSchema: {
|
|
684
|
-
type: 'object',
|
|
685
|
-
properties: {
|
|
686
|
-
pid: { type: 'number', description: 'Session pid returned by start_process.' },
|
|
687
|
-
offset: { type: 'number', description: 'Zero-based line number to start from, counted across everything the session has produced; a negative value reads the last N lines. Omit for new output. Lines evicted by the buffer cap are no longer available.' },
|
|
688
|
-
length: { type: 'number', description: 'Maximum number of lines to return.' },
|
|
689
|
-
timeout_ms: { type: 'number', description: 'How long to wait for new output when no offset is given, in milliseconds.' },
|
|
690
|
-
},
|
|
691
|
-
required: ['pid'],
|
|
692
|
-
additionalProperties: false,
|
|
693
|
-
},
|
|
694
|
-
// Reading without an explicit offset advances the session cursor, so retries can return
|
|
695
|
-
// different output even after the process exits. It never modifies user files.
|
|
696
|
-
annotations: readOnlyNonIdempotent,
|
|
697
|
-
outputSchema: READ_PROCESS_OUTPUT_SCHEMA,
|
|
698
|
-
handler: terminalToolHandlers.read_process_output,
|
|
699
|
-
},
|
|
700
|
-
{
|
|
701
|
-
name: 'interact_with_process',
|
|
702
|
-
title: 'Interact with process',
|
|
703
|
-
description: 'Send one line of input to a running session and return the output it produces. Use this for REPLs and other interactive commands.',
|
|
704
|
-
inputSchema: {
|
|
705
|
-
type: 'object',
|
|
706
|
-
properties: {
|
|
707
|
-
pid: { type: 'number', description: 'Session pid returned by start_process.' },
|
|
708
|
-
input: { type: 'string', description: 'Line of input to send; a newline is appended.' },
|
|
709
|
-
timeout_ms: { type: 'number', description: 'How long to wait for the response, in milliseconds. Default 1000.' },
|
|
710
|
-
},
|
|
711
|
-
required: ['pid', 'input'],
|
|
712
|
-
additionalProperties: false,
|
|
713
|
-
},
|
|
714
|
-
annotations: command,
|
|
715
|
-
outputSchema: INTERACT_PROCESS_OUTPUT_SCHEMA,
|
|
716
|
-
handler: terminalToolHandlers.interact_with_process,
|
|
717
|
-
},
|
|
718
|
-
{
|
|
719
|
-
name: 'wait_for_process_output',
|
|
720
|
-
title: 'Wait for process output',
|
|
721
|
-
description: 'Wait until output from a running session matches a regular expression or literal string, then return the output collected since the previous read. Use this instead of polling read_process_output in a loop.',
|
|
722
|
-
inputSchema: {
|
|
723
|
-
type: 'object',
|
|
724
|
-
properties: {
|
|
725
|
-
pid: { type: 'number', description: 'Session pid returned by start_process.' },
|
|
726
|
-
pattern: { type: 'string', description: 'Regular expression or literal text to wait for.' },
|
|
727
|
-
timeout_ms: { type: 'number', description: 'How long to wait before returning the output collected so far, in milliseconds. Default 10000.' },
|
|
728
|
-
},
|
|
729
|
-
required: ['pid', 'pattern'],
|
|
730
|
-
additionalProperties: false,
|
|
731
|
-
},
|
|
732
|
-
annotations: readOnlyNonIdempotent,
|
|
733
|
-
outputSchema: WAIT_PROCESS_OUTPUT_SCHEMA,
|
|
734
|
-
handler: terminalToolHandlers.wait_for_process_output,
|
|
735
|
-
},
|
|
736
|
-
{
|
|
737
|
-
name: 'force_terminate',
|
|
738
|
-
title: 'Stop session',
|
|
739
|
-
description: 'Stop a ReMCP terminal session started with start_process, escalating from SIGTERM to SIGKILL when it does not exit. Use kill_process for an arbitrary operating-system PID that is not a ReMCP terminal session.',
|
|
740
|
-
inputSchema: {
|
|
741
|
-
type: 'object',
|
|
742
|
-
properties: {
|
|
743
|
-
pid: { type: 'number', description: 'Session pid returned by start_process.' },
|
|
744
|
-
},
|
|
745
|
-
required: ['pid'],
|
|
746
|
-
additionalProperties: false,
|
|
747
|
-
},
|
|
748
|
-
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
|
|
749
|
-
outputSchema: TERMINATE_PROCESS_OUTPUT_SCHEMA,
|
|
750
|
-
handler: terminalToolHandlers.force_terminate,
|
|
751
|
-
},
|
|
752
|
-
{
|
|
753
|
-
name: 'list_sessions',
|
|
754
|
-
title: 'List sessions',
|
|
755
|
-
description: 'List only terminal sessions started through ReMCP start_process, with status and runtime. Use list_processes for the computer-wide operating-system process list.',
|
|
756
|
-
inputSchema: { type: 'object', properties: {}, additionalProperties: false },
|
|
757
|
-
annotations: readOnly,
|
|
758
|
-
outputSchema: LIST_SESSIONS_OUTPUT_SCHEMA,
|
|
759
|
-
handler: terminalToolHandlers.list_sessions,
|
|
760
|
-
},
|
|
761
|
-
{
|
|
762
|
-
name: 'get_system_info',
|
|
763
|
-
title: 'Get system info',
|
|
764
|
-
description: 'Report machine health and host facts for the paired computer: operating system and kernel, CPU model/load, memory pressure, free disk space, uptime, and default shell. Use environment for PATH/shell/runtime environment variables and get_runtime_info for ReMCP-specific version, policy, roots, and limits.',
|
|
765
|
-
inputSchema: { type: 'object', properties: {}, additionalProperties: false },
|
|
766
|
-
annotations: readOnly,
|
|
767
|
-
handler: systemToolHandlers.get_system_info,
|
|
768
|
-
},
|
|
769
|
-
{
|
|
770
|
-
name: 'list_processes',
|
|
771
|
-
title: 'List processes',
|
|
772
|
-
description: 'List the computer-wide operating-system processes, highest CPU first, with pid, parent pid, CPU/memory usage, and command. Use list_sessions when the question is only about commands started through ReMCP start_process. Values that look like secrets are masked.',
|
|
773
|
-
inputSchema: {
|
|
774
|
-
type: 'object',
|
|
775
|
-
properties: {
|
|
776
|
-
limit: { type: 'number', description: 'Maximum number of processes to return. Default 100, maximum 1000.' },
|
|
777
|
-
},
|
|
778
|
-
additionalProperties: false,
|
|
779
|
-
},
|
|
780
|
-
annotations: readOnly,
|
|
781
|
-
handler: systemToolHandlers.list_processes,
|
|
782
|
-
},
|
|
783
|
-
{
|
|
784
|
-
name: 'kill_process',
|
|
785
|
-
title: 'Kill process',
|
|
786
|
-
description: 'Terminate an arbitrary operating-system process by pid. If the pid belongs to a ReMCP terminal session created by start_process, prefer force_terminate so ReMCP updates the session consistently and handles its process tree. Terminates the process and its children on Windows.',
|
|
787
|
-
inputSchema: {
|
|
788
|
-
type: 'object',
|
|
789
|
-
properties: {
|
|
790
|
-
pid: { type: 'number', description: 'Process id to terminate.' },
|
|
791
|
-
},
|
|
792
|
-
required: ['pid'],
|
|
793
|
-
additionalProperties: false,
|
|
794
|
-
},
|
|
795
|
-
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
|
|
796
|
-
handler: systemToolHandlers.kill_process,
|
|
797
|
-
},
|
|
798
|
-
{
|
|
799
|
-
name: 'get_runtime_info',
|
|
800
|
-
title: 'Get runtime info',
|
|
801
|
-
description: 'Report this computer\'s local ReMCP runtime: version, allowed roots, command policy, output limits, settable preferences, and usage-metric setting. Use get_system_info for OS/CPU/memory/disk facts and hosted get_configuration for deployment/account configuration. Read-only; use set_config_value only for telemetryEnabled, maxReadLines, maxBufferedLines, or maxOutputBytes. Access roots and command security stay local to the computer.',
|
|
802
|
-
inputSchema: { type: 'object', properties: {}, additionalProperties: false },
|
|
803
|
-
annotations: readOnly,
|
|
804
|
-
handler: statsToolHandlers.get_runtime_info,
|
|
805
|
-
},
|
|
806
|
-
{
|
|
807
|
-
name: 'get_runtime_stats',
|
|
808
|
-
title: 'Get runtime stats',
|
|
809
|
-
description: 'Report counters from the current local runtime session on this machine: tool calls/failures, blocked commands, active terminal/search sessions, and usage-metric queue state. Use hosted get_usage_statistics for account-level historical usage aggregated across devices and days.',
|
|
810
|
-
inputSchema: { type: 'object', properties: {}, additionalProperties: false },
|
|
811
|
-
annotations: readOnly,
|
|
812
|
-
handler: statsToolHandlers.get_runtime_stats,
|
|
813
|
-
},
|
|
814
|
-
{
|
|
815
|
-
name: 'set_config_value',
|
|
816
|
-
title: 'Change runtime setting',
|
|
817
|
-
description: 'Change one of this local runtime’s own preferences on the selected computer: telemetryEnabled, maxReadLines, maxBufferedLines or maxOutputBytes. This is not account-level device administration; use hosted device_action for ping, rename, enable/disable or removal. Access roots, blocked commands, shell/guardrails and the write limit remain local-only.',
|
|
818
|
-
inputSchema: {
|
|
819
|
-
type: 'object',
|
|
820
|
-
properties: {
|
|
821
|
-
key: { type: 'string', description: 'telemetryEnabled (true/false), maxReadLines, maxBufferedLines or maxOutputBytes.' },
|
|
822
|
-
value: { description: 'New value: a boolean for telemetryEnabled, a number for the limits.' },
|
|
823
|
-
},
|
|
824
|
-
required: ['key', 'value'],
|
|
825
|
-
additionalProperties: false,
|
|
826
|
-
},
|
|
827
|
-
// Preference only, and the same call twice leaves the same state.
|
|
828
|
-
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
829
|
-
handler: configToolHandlers.set_config_value,
|
|
830
|
-
},
|
|
831
|
-
];
|
|
832
8
|
|
|
833
9
|
export function coreToolSupported(definition, {
|
|
834
10
|
platform = process.platform,
|