@mwillbanks/ast-mcp 0.2.2 → 0.4.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/CONTRIBUTING.md +13 -0
- package/README.md +18 -16
- package/dist/ast-mcp.js +209 -147
- package/dist/ast-mcp.js.map +70 -50
- package/package.json +21 -15
- package/src/ast-bro/capability.ts +20 -10
- package/src/ast-bro/client.ts +12 -6
- package/src/ast-bro/result.ts +79 -0
- package/src/ast-bro/tools.json +29 -4
- package/src/cli.ts +10 -7
- package/src/config-cli.ts +166 -19
- package/src/config-edit.ts +236 -0
- package/src/config-migrate.ts +206 -0
- package/src/config-registry.ts +329 -0
- package/src/config-schema-common.ts +88 -0
- package/src/config-v2-schema.ts +109 -0
- package/src/config.ts +523 -170
- package/src/helpers/ast-bro.ts +1 -7
- package/src/helpers/config.ts +16 -3
- package/src/helpers/installer.ts +8 -0
- package/src/helpers/mcp-schema.ts +98 -4
- package/src/host-smoke.ts +182 -0
- package/src/http.ts +8 -3
- package/src/installer-transport.ts +6 -4
- package/src/installer.ts +242 -54
- package/src/patch/engine.ts +575 -280
- package/src/patch/languages.ts +9 -0
- package/src/patch/strategy/aiderBlock.ts +110 -0
- package/src/patch/strategy/ast.ts +170 -0
- package/src/patch/strategy.ts +61 -0
- package/src/runtime/approval.ts +438 -0
- package/src/runtime/config-write.ts +327 -0
- package/src/runtime/dependencies.ts +14 -78
- package/src/runtime/document-inspection.ts +78 -0
- package/src/runtime/file-capabilities.ts +250 -0
- package/src/runtime/file-delete.ts +110 -37
- package/src/runtime/file-read.ts +134 -15
- package/src/runtime/file-rename.ts +5 -2
- package/src/runtime/format.ts +90 -30
- package/src/runtime/git-worktrees.ts +179 -0
- package/src/runtime/path-policy.ts +643 -0
- package/src/runtime/path-utils.ts +80 -0
- package/src/runtime/paths.ts +171 -47
- package/src/server.ts +2 -1
- package/src/tools/ast-bro.ts +294 -75
- package/src/tools/configuration.ts +668 -0
- package/src/tools/configured.ts +49 -21
- package/src/tools/files.ts +169 -62
- package/src/tools/index.ts +2 -0
- package/src/tools/lifecycle.ts +82 -38
- package/templates/AGENTS.md +17 -15
- package/templates/skills/ast-mcp/SKILL.md +57 -20
- package/templates/skills/ast-mcp/evals/evals.json +319 -9
- package/templates/skills/ast-mcp/evals/score.ts +80 -0
- package/templates/skills/ast-mcp/evals/semantic.ts +3 -1
- package/templates/skills/ast-mcp/references/installation.md +12 -12
- package/templates/skills/ast-mcp/references/patch-state-machine.md +15 -14
- package/templates/skills/ast-mcp/references/tool-catalog.md +18 -8
- package/templates/skills/ast-mcp/scripts/binary-resolution.ts +112 -0
- package/templates/skills/ast-mcp/scripts/check-install.ts +165 -51
- package/templates/skills/ast-mcp/scripts/managed-hook.ts +34 -2
- package/src/ast-bro/rewrite-capability.ts +0 -9
package/src/tools/ast-bro.ts
CHANGED
|
@@ -9,12 +9,27 @@ import {
|
|
|
9
9
|
astBroMatchFiles,
|
|
10
10
|
astBroRewrittenFiles,
|
|
11
11
|
parseAstBroJson,
|
|
12
|
+
parseAstBroShowV2,
|
|
12
13
|
} from "../ast-bro/result";
|
|
13
14
|
import metadata from "../ast-bro/tools.json";
|
|
15
|
+
import { currentConfig } from "../config";
|
|
16
|
+
import {
|
|
17
|
+
structuredUpstreamToolResult,
|
|
18
|
+
toolFailure,
|
|
19
|
+
toolOutputSchema,
|
|
20
|
+
} from "../helpers/mcp-schema";
|
|
14
21
|
import { replaceFileAtomically } from "../runtime/atomic";
|
|
22
|
+
import { inspectFileCapabilities } from "../runtime/file-capabilities";
|
|
15
23
|
import { assertFormattable, formatFileAtomically } from "../runtime/format";
|
|
16
24
|
import { withFileLocks } from "../runtime/locks";
|
|
17
|
-
import {
|
|
25
|
+
import { assertReadableTree } from "../runtime/path-policy";
|
|
26
|
+
import { pathWithin } from "../runtime/path-utils";
|
|
27
|
+
import {
|
|
28
|
+
assertSingleProjectRoot,
|
|
29
|
+
intelligenceRoot,
|
|
30
|
+
resolveWorkspacePath,
|
|
31
|
+
resolveWritablePath,
|
|
32
|
+
} from "../runtime/paths";
|
|
18
33
|
import { type ConfiguredExecution, localExecution } from "./configured";
|
|
19
34
|
|
|
20
35
|
function upstreamSchema(
|
|
@@ -38,25 +53,253 @@ function upstreamSchema(
|
|
|
38
53
|
},
|
|
39
54
|
};
|
|
40
55
|
}
|
|
41
|
-
async function boundedPath(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
56
|
+
async function boundedPath(
|
|
57
|
+
root: string,
|
|
58
|
+
value: string,
|
|
59
|
+
operation: "read" | "write" = "read",
|
|
60
|
+
): Promise<string> {
|
|
61
|
+
const target = path.isAbsolute(value) ? value : path.resolve(root, value);
|
|
62
|
+
return operation === "write"
|
|
63
|
+
? resolveWritablePath(target, "write")
|
|
64
|
+
: resolveWorkspacePath(target);
|
|
45
65
|
}
|
|
46
66
|
|
|
47
67
|
const pathArguments = ["file", "path", "root"] as const;
|
|
68
|
+
const globPattern = /[*?{}[\]]/;
|
|
69
|
+
|
|
70
|
+
async function existingLiteralPath(root: string, value: string) {
|
|
71
|
+
const resolved = await boundedPath(root, value);
|
|
72
|
+
const metadata = await lstat(resolved).catch((error) => {
|
|
73
|
+
if ((error as NodeJS.ErrnoException).code === "ENOENT") return undefined;
|
|
74
|
+
throw error;
|
|
75
|
+
});
|
|
76
|
+
return metadata !== undefined;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async function validateReadableScanPath(
|
|
80
|
+
root: string,
|
|
81
|
+
value: string,
|
|
82
|
+
): Promise<string> {
|
|
83
|
+
const resolved = await boundedPath(root, value);
|
|
84
|
+
const metadata = await lstat(resolved).catch(() => undefined);
|
|
85
|
+
if (metadata?.isDirectory())
|
|
86
|
+
assertReadableTree(await currentConfig(), resolved);
|
|
87
|
+
return resolved;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function globBase(root: string, value: string) {
|
|
91
|
+
const globIndex = value.search(globPattern);
|
|
92
|
+
const prefix = value.slice(0, globIndex);
|
|
93
|
+
const separator = Math.max(prefix.lastIndexOf("/"), prefix.lastIndexOf("\\"));
|
|
94
|
+
const base = separator < 0 ? "." : prefix.slice(0, separator + 1);
|
|
95
|
+
return path.isAbsolute(value) ? base : path.resolve(root, base);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function scanGlob(root: string, value: string) {
|
|
99
|
+
const relativePattern = path.isAbsolute(value)
|
|
100
|
+
? path.relative(root, value)
|
|
101
|
+
: value;
|
|
102
|
+
const pattern = relativePattern.split(path.sep).join("/");
|
|
103
|
+
return [
|
|
104
|
+
...new Bun.Glob(pattern).scanSync({
|
|
105
|
+
absolute: true,
|
|
106
|
+
cwd: root,
|
|
107
|
+
dot: true,
|
|
108
|
+
followSymlinks: false,
|
|
109
|
+
onlyFiles: false,
|
|
110
|
+
}),
|
|
111
|
+
];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
async function resolveGlobPaths(root: string, value: string) {
|
|
115
|
+
const base = await validateReadableScanPath(root, globBase(root, value));
|
|
116
|
+
if (!pathWithin(root, base))
|
|
117
|
+
throw new Error(`Glob path is outside configured workspace root: ${value}`);
|
|
118
|
+
const matches = scanGlob(root, value);
|
|
119
|
+
const resolved = await Promise.all(
|
|
120
|
+
matches.map((match) => validateReadableScanPath(root, match)),
|
|
121
|
+
);
|
|
122
|
+
return resolved.length > 0 ? resolved : [base];
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
async function emptyShowResult(args: Record<string, unknown>, root: string) {
|
|
126
|
+
const target = args.path;
|
|
127
|
+
if (
|
|
128
|
+
typeof target !== "string" ||
|
|
129
|
+
!globPattern.test(target) ||
|
|
130
|
+
(await existingLiteralPath(root, target)) ||
|
|
131
|
+
scanGlob(root, target).length > 0
|
|
132
|
+
)
|
|
133
|
+
return undefined;
|
|
134
|
+
const symbols = Array.isArray(args.symbols)
|
|
135
|
+
? args.symbols.filter(
|
|
136
|
+
(symbol): symbol is string => typeof symbol === "string",
|
|
137
|
+
)
|
|
138
|
+
: [];
|
|
139
|
+
return {
|
|
140
|
+
content: [
|
|
141
|
+
{
|
|
142
|
+
text: JSON.stringify({
|
|
143
|
+
files: [],
|
|
144
|
+
files_matched: 0,
|
|
145
|
+
files_scanned: 0,
|
|
146
|
+
schema: "ast-bro.show.v2",
|
|
147
|
+
shown: 0,
|
|
148
|
+
symbols,
|
|
149
|
+
total: 0,
|
|
150
|
+
truncated: false,
|
|
151
|
+
unmatched: symbols,
|
|
152
|
+
}),
|
|
153
|
+
type: "text" as const,
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function astBroRequestPaths(args: Record<string, unknown>): string[] {
|
|
160
|
+
const candidates: string[] = [];
|
|
161
|
+
for (const name of pathArguments) {
|
|
162
|
+
const value = args[name];
|
|
163
|
+
if (typeof value === "string") candidates.push(value);
|
|
164
|
+
}
|
|
165
|
+
if (Array.isArray(args.paths))
|
|
166
|
+
candidates.push(
|
|
167
|
+
...args.paths.filter(
|
|
168
|
+
(value): value is string => typeof value === "string",
|
|
169
|
+
),
|
|
170
|
+
);
|
|
171
|
+
return candidates;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
async function resolveAstBroPaths(
|
|
175
|
+
args: Record<string, unknown>,
|
|
176
|
+
root: string,
|
|
177
|
+
): Promise<string[]> {
|
|
178
|
+
const candidates = astBroRequestPaths(args);
|
|
179
|
+
if (candidates.length === 0) candidates.push(root);
|
|
180
|
+
const resolved = await Promise.all(
|
|
181
|
+
candidates.map(async (value) => {
|
|
182
|
+
if (globPattern.test(value) && !(await existingLiteralPath(root, value)))
|
|
183
|
+
return resolveGlobPaths(root, value);
|
|
184
|
+
return [await validateReadableScanPath(root, value)];
|
|
185
|
+
}),
|
|
186
|
+
);
|
|
187
|
+
return resolved.flat();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
async function validateRunPath(
|
|
191
|
+
filePath: string,
|
|
192
|
+
args: Record<string, unknown>,
|
|
193
|
+
): Promise<void> {
|
|
194
|
+
const metadata = await lstat(filePath);
|
|
195
|
+
if (!metadata.isFile()) return;
|
|
196
|
+
const language = typeof args.lang === "string" ? args.lang : undefined;
|
|
197
|
+
const capabilities = await inspectFileCapabilities(filePath, language);
|
|
198
|
+
const rewrite = typeof args.rewrite === "string";
|
|
199
|
+
const available = rewrite
|
|
200
|
+
? capabilities.effective.patch.includes("ast")
|
|
201
|
+
: capabilities.effective.read.includes("ast");
|
|
202
|
+
if (available) return;
|
|
203
|
+
throw Object.assign(
|
|
204
|
+
new Error(
|
|
205
|
+
`run ${rewrite ? "rewrite" : "search"} is unavailable for ${filePath}; inspect file_capabilities and select a supported workflow`,
|
|
206
|
+
),
|
|
207
|
+
{
|
|
208
|
+
code: "ast_capability_unavailable",
|
|
209
|
+
details: { capabilities, rewrite },
|
|
210
|
+
retryable: true,
|
|
211
|
+
suggestedNextCall: "file_capabilities",
|
|
212
|
+
},
|
|
213
|
+
);
|
|
214
|
+
}
|
|
48
215
|
|
|
49
216
|
async function validateAstBroPaths(
|
|
50
217
|
args: Record<string, unknown>,
|
|
51
218
|
root: string,
|
|
219
|
+
toolName: (typeof AST_BRO_TOOLS)[number],
|
|
52
220
|
): Promise<void> {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
221
|
+
const resolvedPaths = await resolveAstBroPaths(args, root);
|
|
222
|
+
await assertSingleProjectRoot(resolvedPaths);
|
|
223
|
+
if (toolName !== "run") return;
|
|
224
|
+
await Promise.all(
|
|
225
|
+
resolvedPaths.map((filePath) => validateRunPath(filePath, args)),
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function sameFiles(left: string[], right: string[]): boolean {
|
|
230
|
+
return (
|
|
231
|
+
left.length === right.length &&
|
|
232
|
+
left.every((filePath, index) => filePath === right[index])
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
async function snapshotAstBroFiles(
|
|
237
|
+
files: string[],
|
|
238
|
+
): Promise<Map<string, { content: string; mode: number }>> {
|
|
239
|
+
const snapshots = new Map<string, { content: string; mode: number }>();
|
|
240
|
+
for (const filePath of files) {
|
|
241
|
+
await assertFormattable(filePath);
|
|
242
|
+
snapshots.set(filePath, {
|
|
243
|
+
content: await readFile(filePath, "utf8"),
|
|
244
|
+
mode: (await lstat(filePath)).mode,
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
return snapshots;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
async function formatAstBroFiles(
|
|
251
|
+
result: Awaited<ReturnType<typeof callAstBro>>,
|
|
252
|
+
root: string,
|
|
253
|
+
snapshots: Map<string, { content: string; mode: number }>,
|
|
254
|
+
): Promise<void> {
|
|
255
|
+
const rewritten = await Promise.all(
|
|
256
|
+
astBroRewrittenFiles(result).map((file) =>
|
|
257
|
+
boundedPath(root, file, "write"),
|
|
258
|
+
),
|
|
259
|
+
);
|
|
260
|
+
try {
|
|
261
|
+
for (const filePath of rewritten) await formatFileAtomically(filePath);
|
|
262
|
+
} catch (error) {
|
|
263
|
+
for (const filePath of rewritten) {
|
|
264
|
+
const snapshot = snapshots.get(filePath);
|
|
265
|
+
if (snapshot)
|
|
266
|
+
await replaceFileAtomically(filePath, snapshot.content, snapshot.mode);
|
|
267
|
+
}
|
|
268
|
+
throw error;
|
|
56
269
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
async function executeLockedAstBroWrite(
|
|
273
|
+
args: Record<string, unknown>,
|
|
274
|
+
root: string,
|
|
275
|
+
previewArgs: Record<string, unknown>,
|
|
276
|
+
initialFiles: string[],
|
|
277
|
+
): Promise<Awaited<ReturnType<typeof callAstBro>>> {
|
|
278
|
+
const previewResult = await callAstBro("run", previewArgs, root);
|
|
279
|
+
const lockedPreview = parseAstBroJson(previewResult);
|
|
280
|
+
if (lockedPreview.capped)
|
|
281
|
+
throw new Error(
|
|
282
|
+
"ast-bro run preview was capped; narrow paths or pattern before writing",
|
|
283
|
+
);
|
|
284
|
+
const lockedFiles = await Promise.all(
|
|
285
|
+
astBroMatchFiles(previewResult).map((file) =>
|
|
286
|
+
boundedPath(root, file, "write"),
|
|
287
|
+
),
|
|
288
|
+
);
|
|
289
|
+
if (!sameFiles(initialFiles, lockedFiles))
|
|
290
|
+
throw new Error(
|
|
291
|
+
"ast-bro run targets changed while waiting for the write lock; preview again",
|
|
292
|
+
);
|
|
293
|
+
if (lockedFiles.length === 0) return previewResult;
|
|
294
|
+
|
|
295
|
+
const snapshots = await snapshotAstBroFiles(lockedFiles);
|
|
296
|
+
const result = await callAstBro(
|
|
297
|
+
"run",
|
|
298
|
+
{ ...args, json: true, paths: lockedFiles },
|
|
299
|
+
root,
|
|
300
|
+
);
|
|
301
|
+
await formatAstBroFiles(result, root, snapshots);
|
|
302
|
+
return result;
|
|
60
303
|
}
|
|
61
304
|
|
|
62
305
|
async function callAstBroWithFormatting(
|
|
@@ -85,55 +328,14 @@ async function callAstBroWithFormatting(
|
|
|
85
328
|
"ast-bro run preview was capped; narrow paths or pattern before writing",
|
|
86
329
|
);
|
|
87
330
|
const initialFiles = await Promise.all(
|
|
88
|
-
astBroMatchFiles(initialPreview).map((file) =>
|
|
331
|
+
astBroMatchFiles(initialPreview).map((file) =>
|
|
332
|
+
boundedPath(root, file, "write"),
|
|
333
|
+
),
|
|
89
334
|
);
|
|
90
335
|
|
|
91
|
-
return withFileLocks(initialFiles,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (lockedPreview.capped)
|
|
95
|
-
throw new Error(
|
|
96
|
-
"ast-bro run preview was capped; narrow paths or pattern before writing",
|
|
97
|
-
);
|
|
98
|
-
const lockedFiles = await Promise.all(
|
|
99
|
-
astBroMatchFiles(previewResult).map((file) => boundedPath(root, file)),
|
|
100
|
-
);
|
|
101
|
-
if (
|
|
102
|
-
initialFiles.length !== lockedFiles.length ||
|
|
103
|
-
initialFiles.some((filePath, index) => filePath !== lockedFiles[index])
|
|
104
|
-
)
|
|
105
|
-
throw new Error(
|
|
106
|
-
"ast-bro run targets changed while waiting for the write lock; preview again",
|
|
107
|
-
);
|
|
108
|
-
|
|
109
|
-
const snapshots = new Map<string, { content: string; mode: number }>();
|
|
110
|
-
for (const filePath of lockedFiles) {
|
|
111
|
-
await assertFormattable(filePath);
|
|
112
|
-
snapshots.set(filePath, {
|
|
113
|
-
content: await readFile(filePath, "utf8"),
|
|
114
|
-
mode: (await lstat(filePath)).mode,
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
const result = await callAstBro("run", { ...args, json: true }, root);
|
|
118
|
-
const rewritten = await Promise.all(
|
|
119
|
-
astBroRewrittenFiles(result).map((file) => boundedPath(root, file)),
|
|
120
|
-
);
|
|
121
|
-
try {
|
|
122
|
-
for (const filePath of rewritten) await formatFileAtomically(filePath);
|
|
123
|
-
} catch (error) {
|
|
124
|
-
for (const filePath of rewritten) {
|
|
125
|
-
const snapshot = snapshots.get(filePath);
|
|
126
|
-
if (snapshot)
|
|
127
|
-
await replaceFileAtomically(
|
|
128
|
-
filePath,
|
|
129
|
-
snapshot.content,
|
|
130
|
-
snapshot.mode,
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
throw error;
|
|
134
|
-
}
|
|
135
|
-
return result;
|
|
136
|
-
});
|
|
336
|
+
return withFileLocks(initialFiles, () =>
|
|
337
|
+
executeLockedAstBroWrite(args, root, previewArgs, initialFiles),
|
|
338
|
+
);
|
|
137
339
|
}
|
|
138
340
|
|
|
139
341
|
export default function registerAstBroTools(
|
|
@@ -142,35 +344,52 @@ export default function registerAstBroTools(
|
|
|
142
344
|
) {
|
|
143
345
|
for (const toolName of AST_BRO_TOOLS) {
|
|
144
346
|
const definition = metadata[toolName];
|
|
347
|
+
const writesState = ["find_related", "index", "run", "search"].includes(
|
|
348
|
+
toolName,
|
|
349
|
+
);
|
|
350
|
+
const destructive = toolName === "run";
|
|
145
351
|
server.registerTool(
|
|
146
352
|
toolName,
|
|
147
353
|
{
|
|
354
|
+
annotations: {
|
|
355
|
+
destructiveHint: destructive,
|
|
356
|
+
idempotentHint: !destructive,
|
|
357
|
+
openWorldHint: false,
|
|
358
|
+
readOnlyHint: !writesState,
|
|
359
|
+
},
|
|
148
360
|
description:
|
|
149
361
|
toolName === "run"
|
|
150
362
|
? "AST structural search and rewrite. Use for bounded inspection and previews; direct write is a lower-level escape hatch for exceptional cases. Normal agent edits belong in file_patch's declared files batch, which supports ordered AST rules and Aider blocks."
|
|
151
363
|
: definition.description,
|
|
152
364
|
inputSchema: upstreamSchema(definition.inputSchema),
|
|
365
|
+
outputSchema: toolOutputSchema,
|
|
153
366
|
title: `ast-bro ${toolName}`,
|
|
154
367
|
},
|
|
155
|
-
async (args) => {
|
|
368
|
+
async (args, context) => {
|
|
156
369
|
try {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
370
|
+
const result = await execute(
|
|
371
|
+
args,
|
|
372
|
+
async () => {
|
|
373
|
+
const root = await intelligenceRoot(astBroRequestPaths(args));
|
|
374
|
+
await validateAstBroPaths(args, root, toolName);
|
|
375
|
+
const emptyShow =
|
|
376
|
+
toolName === "show" && args.json === true
|
|
377
|
+
? await emptyShowResult(args, root)
|
|
378
|
+
: undefined;
|
|
379
|
+
if (emptyShow) return emptyShow;
|
|
380
|
+
return toolName === "run"
|
|
381
|
+
? await callAstBroWithFormatting(args, root)
|
|
382
|
+
: await callAstBro(toolName, args, root);
|
|
383
|
+
},
|
|
384
|
+
context,
|
|
385
|
+
toolName,
|
|
386
|
+
);
|
|
387
|
+
|
|
388
|
+
if (toolName === "show" && args.json === true)
|
|
389
|
+
parseAstBroShowV2(result);
|
|
390
|
+
return structuredUpstreamToolResult(result, toolName);
|
|
164
391
|
} catch (error) {
|
|
165
|
-
return
|
|
166
|
-
content: [
|
|
167
|
-
{
|
|
168
|
-
text: error instanceof Error ? error.message : String(error),
|
|
169
|
-
type: "text",
|
|
170
|
-
},
|
|
171
|
-
],
|
|
172
|
-
isError: true,
|
|
173
|
-
};
|
|
392
|
+
return toolFailure(error);
|
|
174
393
|
}
|
|
175
394
|
},
|
|
176
395
|
);
|