@molecule/api-ai-tools 1.0.9 → 1.1.0
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/README.md +241 -1
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -0
- package/dist/input-normalizer.d.ts +92 -0
- package/dist/input-normalizer.d.ts.map +1 -0
- package/dist/input-normalizer.js +191 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +69 -4
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +450 -88
- package/dist/utilities.d.ts +79 -0
- package/dist/utilities.d.ts.map +1 -1
- package/dist/utilities.js +130 -2
- package/package.json +1 -1
package/dist/schemas.js
CHANGED
|
@@ -24,16 +24,39 @@ export const TOOL_SCHEMAS = {
|
|
|
24
24
|
},
|
|
25
25
|
read_file: {
|
|
26
26
|
name: 'read_file',
|
|
27
|
-
description: 'Read the full content of
|
|
27
|
+
description: 'Read the full content of one file, or of SEVERAL files in a single call. Always read a ' +
|
|
28
|
+
'file before editing it. When you need more than one file — surveying a project, ' +
|
|
29
|
+
'gathering the files behind one feature — pass them all as `paths` in ONE call rather ' +
|
|
30
|
+
'than calling this tool once per file: same content, a fraction of the time. ' +
|
|
31
|
+
'For a @molecule package\u2019s docs call read_molecule_doc instead — one call, the whole ' +
|
|
32
|
+
'document. A file under 80 KB comes back whole; do not page through it with offset/limit.',
|
|
28
33
|
parameters: {
|
|
29
34
|
type: 'object',
|
|
30
35
|
properties: {
|
|
31
36
|
path: {
|
|
32
37
|
type: 'string',
|
|
33
|
-
description: 'Path to
|
|
38
|
+
description: 'Path to a single file to read (relative or absolute).',
|
|
39
|
+
},
|
|
40
|
+
paths: {
|
|
41
|
+
type: 'array',
|
|
42
|
+
items: { type: 'string' },
|
|
43
|
+
description: 'Paths to SEVERAL files to read in one call — preferred whenever you want more ' +
|
|
44
|
+
'than one file. Returns `files`, one entry per path in the order given, each ' +
|
|
45
|
+
"with that file's content or its own error.",
|
|
46
|
+
},
|
|
47
|
+
offset: {
|
|
48
|
+
type: 'number',
|
|
49
|
+
description: 'First line to return, 1-based. NEGATIVE counts from the end, so `offset: -30` ' +
|
|
50
|
+
'is the last 30 lines. Use with `limit` to read PART of a large file instead of ' +
|
|
51
|
+
'all of it — never pipe a file through head/tail in the shell.',
|
|
52
|
+
},
|
|
53
|
+
limit: {
|
|
54
|
+
type: 'number',
|
|
55
|
+
description: 'How many lines to return from `offset`. The result reports `offset`, `lines` ' +
|
|
56
|
+
'and `totalLines` so you can ask for the next window.',
|
|
34
57
|
},
|
|
35
58
|
},
|
|
36
|
-
required: [
|
|
59
|
+
required: [],
|
|
37
60
|
},
|
|
38
61
|
},
|
|
39
62
|
write_file: {
|
|
@@ -104,6 +127,12 @@ export const TOOL_SCHEMAS = {
|
|
|
104
127
|
type: 'string',
|
|
105
128
|
description: "File glob pattern to filter files (e.g. '*.ts', '*.tsx'). Optional.",
|
|
106
129
|
},
|
|
130
|
+
contextLines: {
|
|
131
|
+
type: 'number',
|
|
132
|
+
description: 'Lines of surrounding context to return with each match, like `grep -C`. Each ' +
|
|
133
|
+
'result carries `match: true` for the matching line and `false` for context. ' +
|
|
134
|
+
'Use this instead of grepping through the shell.',
|
|
135
|
+
},
|
|
107
136
|
},
|
|
108
137
|
required: ['pattern'],
|
|
109
138
|
},
|
|
@@ -174,7 +203,9 @@ export const TOOL_SCHEMAS = {
|
|
|
174
203
|
},
|
|
175
204
|
exec_command: {
|
|
176
205
|
name: 'exec_command',
|
|
177
|
-
description: 'Run a shell command and return its output. Use for build checks, npm commands, verification, etc.'
|
|
206
|
+
description: 'Run a shell command and return its output. Use for build checks, npm commands, verification, etc. ' +
|
|
207
|
+
'Pass `run_in_background` for anything long-running: it returns a handle at once instead of ' +
|
|
208
|
+
'being cut off at the time limit.',
|
|
178
209
|
parameters: {
|
|
179
210
|
type: 'object',
|
|
180
211
|
properties: {
|
|
@@ -186,10 +217,44 @@ export const TOOL_SCHEMAS = {
|
|
|
186
217
|
type: 'string',
|
|
187
218
|
description: 'Working directory. Defaults to project root.',
|
|
188
219
|
},
|
|
220
|
+
timeout: {
|
|
221
|
+
type: 'number',
|
|
222
|
+
description: "Optional time budget in milliseconds. Clamped to this tool's ceiling — ask for more and the ceiling applies and is reported, so split the work into smaller commands instead of re-running the same long one.",
|
|
223
|
+
},
|
|
224
|
+
run_in_background: {
|
|
225
|
+
type: 'boolean',
|
|
226
|
+
description: 'Start the command DETACHED and return immediately with a handle instead of waiting. ' +
|
|
227
|
+
'Use it for anything that may outrun the ceiling — a full test suite, a production ' +
|
|
228
|
+
'build, a long install. The result gives a log path to read with read_file and an ' +
|
|
229
|
+
'exit-code file that appears when it finishes. Do the next piece of work while it ' +
|
|
230
|
+
'runs; when you need its result, call wait_for_task (one call, no polling).',
|
|
231
|
+
},
|
|
189
232
|
},
|
|
190
233
|
required: ['command'],
|
|
191
234
|
},
|
|
192
235
|
},
|
|
236
|
+
wait_for_task: {
|
|
237
|
+
name: 'wait_for_task',
|
|
238
|
+
description: 'Wait for a command started with `run_in_background` and return its output and exit ' +
|
|
239
|
+
'code. Blocks until it finishes or the time budget runs out, then returns — one call, ' +
|
|
240
|
+
'no polling. Use it the moment you need that result to continue; never `sleep` and ' +
|
|
241
|
+
'read the log by hand. If it is still running when the budget ends, the result says so ' +
|
|
242
|
+
'and you can call it again.',
|
|
243
|
+
parameters: {
|
|
244
|
+
type: 'object',
|
|
245
|
+
properties: {
|
|
246
|
+
taskId: {
|
|
247
|
+
type: 'string',
|
|
248
|
+
description: 'The `taskId` the background command returned.',
|
|
249
|
+
},
|
|
250
|
+
timeout: {
|
|
251
|
+
type: 'number',
|
|
252
|
+
description: 'Optional time budget in milliseconds. Clamped to this tool’s ceiling.',
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
required: ['taskId'],
|
|
256
|
+
},
|
|
257
|
+
},
|
|
193
258
|
save_plan: {
|
|
194
259
|
name: 'save_plan',
|
|
195
260
|
description: 'Save an implementation plan as a markdown file in .agents/plans/.',
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAY9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AA6BnE;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,eAAe,GAAG,MAAM,EAAE,CA8rCxF"}
|