toolmenu 0.25.2 → 0.27.1
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 +170 -683
- package/dist/args.d.ts +14 -2
- package/dist/args.js +44 -1
- package/dist/auth-check.d.ts +27 -0
- package/dist/auth-check.js +177 -0
- package/dist/auth.d.ts +7 -0
- package/dist/auth.js +29 -1
- package/dist/auto.d.ts +8 -0
- package/dist/auto.js +9 -2
- package/dist/breakdown.js +14 -10
- package/dist/cli.js +151 -49
- package/dist/clients.d.ts +13 -2
- package/dist/clients.js +65 -11
- package/dist/config.js +6 -0
- package/dist/diff.d.ts +35 -1
- package/dist/diff.js +57 -12
- package/dist/failures.js +4 -3
- package/dist/help.d.ts +1 -1
- package/dist/help.js +45 -18
- package/dist/history.js +5 -0
- package/dist/html.d.ts +29 -0
- package/dist/html.js +360 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/init.d.ts +14 -0
- package/dist/init.js +20 -6
- package/dist/junit.d.ts +6 -1
- package/dist/junit.js +12 -3
- package/dist/mcp-env.d.ts +6 -0
- package/dist/mcp-env.js +6 -0
- package/dist/mcp.d.ts +11 -1
- package/dist/mcp.js +123 -22
- package/dist/menu.d.ts +6 -0
- package/dist/menu.js +12 -1
- package/dist/options.d.ts +10 -0
- package/dist/options.js +3 -0
- package/dist/report.d.ts +14 -0
- package/dist/report.js +57 -51
- package/dist/review.d.ts +48 -0
- package/dist/review.js +212 -0
- package/dist/rule-docs.json +49 -4
- package/dist/rules/clients.d.ts +11 -0
- package/dist/rules/clients.js +65 -2
- package/dist/rules/determinism.d.ts +3 -0
- package/dist/rules/determinism.js +44 -7
- package/dist/rules/ids.js +5 -1
- package/dist/rules/index.js +5 -2
- package/dist/rules/output.d.ts +21 -0
- package/dist/rules/output.js +49 -0
- package/dist/rules/search.js +1 -1
- package/dist/rules/spec.d.ts +19 -0
- package/dist/rules/spec.js +86 -1
- package/dist/sanitize.d.ts +42 -0
- package/dist/sanitize.js +142 -0
- package/dist/scan.d.ts +9 -2
- package/dist/scan.js +46 -24
- package/dist/session.d.ts +17 -0
- package/dist/session.js +119 -13
- package/dist/snapshot.js +2 -1
- package/package.json +5 -3
package/dist/mcp.js
CHANGED
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
* out, or the client closing the connection stops the child and the server it started.
|
|
9
9
|
*/
|
|
10
10
|
import { spawn, spawnSync } from 'node:child_process';
|
|
11
|
-
import { statSync } from 'node:fs';
|
|
12
|
-
import { isAbsolute, resolve } from 'node:path';
|
|
11
|
+
import { lstatSync, readFileSync, realpathSync, statSync } from 'node:fs';
|
|
12
|
+
import { dirname, isAbsolute, relative, resolve, sep } from 'node:path';
|
|
13
13
|
import { fileURLToPath } from 'node:url';
|
|
14
14
|
import { McpServer } from '@modelcontextprotocol/server';
|
|
15
15
|
import { serveStdio } from '@modelcontextprotocol/server/stdio';
|
|
16
16
|
import * as z from 'zod';
|
|
17
17
|
import { CLIENT_NAMES } from './clients.js';
|
|
18
18
|
import { VERSION } from './version.js';
|
|
19
|
-
import { SECRET_ARGS_ENV } from './mcp-env.js';
|
|
19
|
+
import { ARGS_ENV, SECRET_ARGS_ENV } from './mcp-env.js';
|
|
20
20
|
export { SECRET_ARGS_ENV };
|
|
21
21
|
const CLI = fileURLToPath(new URL('./cli.js', import.meta.url));
|
|
22
22
|
/** A whole run's ceiling. Each request inside it already has the CLI's own --timeout. */
|
|
@@ -90,6 +90,7 @@ export function runCli(args, cwd, options = {}) {
|
|
|
90
90
|
// were. Neither reaches the server under test: it gets a minimal environment.
|
|
91
91
|
const env = { ...process.env, NO_COLOR: '1', NODE_NO_WARNINGS: '1' };
|
|
92
92
|
delete env[SECRET_ARGS_ENV];
|
|
93
|
+
delete env[ARGS_ENV];
|
|
93
94
|
if (secretArgs.length)
|
|
94
95
|
env[SECRET_ARGS_ENV] = JSON.stringify(secretArgs);
|
|
95
96
|
// detached: its own process group (Linux, macOS). On Windows it would open a console
|
|
@@ -140,14 +141,14 @@ export function runCli(args, cwd, options = {}) {
|
|
|
140
141
|
});
|
|
141
142
|
}
|
|
142
143
|
/** A CLI run as a tool result. Findings are a report, not a failure: only exit 2 (couldn't run) is an error. */
|
|
143
|
-
export function toResult(run) {
|
|
144
|
+
export function toResult(run, exitOne = '\n\nExit 1: there are error-level findings.') {
|
|
144
145
|
const out = run.stdout.trim();
|
|
145
146
|
if (run.code === 2) {
|
|
146
147
|
const why = [run.stopped, run.stderr.trim()].filter(Boolean).join('\n\n') || out || 'toolmenu exited with code 2.';
|
|
147
148
|
return { content: [{ type: 'text', text: why }], isError: true };
|
|
148
149
|
}
|
|
149
150
|
const notes = run.stderr.trim();
|
|
150
|
-
const tail = run.code === 1 ?
|
|
151
|
+
const tail = run.code === 1 ? exitOne : '';
|
|
151
152
|
return { content: [{ type: 'text', text: `${out || 'No output.'}${tail}${notes ? `\n\nNotes:\n${notes}` : ''}` }] };
|
|
152
153
|
}
|
|
153
154
|
const serverShape = {
|
|
@@ -200,14 +201,62 @@ export function folder(baseCwd, cwd) {
|
|
|
200
201
|
}
|
|
201
202
|
/** A path as an absolute one, so a value starting with "-" can't be read as an option. */
|
|
202
203
|
const absolute = (dir, path) => (isAbsolute(path) ? path : resolve(dir, path));
|
|
204
|
+
/** Whether `path` is `dir` itself or inside it, by path alone. */
|
|
205
|
+
const inside = (dir, path) => {
|
|
206
|
+
const rel = relative(dir, path);
|
|
207
|
+
return rel === '' || (rel !== '..' && !rel.startsWith(`..${sep}`) && !isAbsolute(rel));
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* Where save_as may write, or why it can't: a file inside the call's folder (symlinks
|
|
211
|
+
* followed), either new or a toolmenu menu file already. The agent picks the path, so
|
|
212
|
+
* it can't be used to overwrite anything else (a shell profile, a source file).
|
|
213
|
+
*/
|
|
214
|
+
export function savePath(dir, saveAs) {
|
|
215
|
+
const path = absolute(dir, saveAs);
|
|
216
|
+
const outside = { error: `save_as "${saveAs}" is outside the folder the call runs in (${dir}). Give a path inside it, e.g. new-menu.json.` };
|
|
217
|
+
if (!inside(dir, path))
|
|
218
|
+
return outside;
|
|
219
|
+
let realDir;
|
|
220
|
+
let realParent;
|
|
221
|
+
try {
|
|
222
|
+
realDir = realpathSync(dir);
|
|
223
|
+
realParent = realpathSync(dirname(path));
|
|
224
|
+
}
|
|
225
|
+
catch {
|
|
226
|
+
return { error: `save_as "${saveAs}": the folder ${dirname(path)} doesn't exist.` };
|
|
227
|
+
}
|
|
228
|
+
if (!inside(realDir, realParent))
|
|
229
|
+
return outside;
|
|
230
|
+
let existing;
|
|
231
|
+
try {
|
|
232
|
+
existing = lstatSync(path);
|
|
233
|
+
}
|
|
234
|
+
catch {
|
|
235
|
+
return { path };
|
|
236
|
+
}
|
|
237
|
+
if (existing.isSymbolicLink() || !existing.isFile())
|
|
238
|
+
return { error: `save_as "${saveAs}" is ${existing.isSymbolicLink() ? 'a symbolic link' : 'not a file'}; toolmenu only writes a new file or replaces a menu file.` };
|
|
239
|
+
// A hard link: writing it would rewrite the same file wherever else it's linked.
|
|
240
|
+
if (existing.nlink > 1)
|
|
241
|
+
return { error: `save_as "${saveAs}" is a file with other names (a hard link), so writing it would change it there too. Pick a new name, e.g. new-menu.json.` };
|
|
242
|
+
let menu = false;
|
|
243
|
+
try {
|
|
244
|
+
menu = JSON.parse(readFileSync(path, 'utf8'))?.toolmenu === 1;
|
|
245
|
+
}
|
|
246
|
+
catch {
|
|
247
|
+
// not JSON: not a menu
|
|
248
|
+
}
|
|
249
|
+
return menu ? { path } : { error: `save_as "${saveAs}" already exists and isn't a toolmenu menu file, so it wasn't overwritten. Pick a new name, e.g. new-menu.json.` };
|
|
250
|
+
}
|
|
203
251
|
const failed = (text) => ({ content: [{ type: 'text', text }], isError: true });
|
|
204
252
|
export function build(baseCwd = process.cwd()) {
|
|
205
253
|
const server = new McpServer({ name: 'toolmenu', version: VERSION }, {
|
|
206
254
|
capabilities: { tools: {} },
|
|
207
|
-
// The same
|
|
255
|
+
// The same six tools for everyone, always: an hour, and shared caches may keep it.
|
|
208
256
|
cacheHints: { 'tools/list': { ttlMs: 3_600_000, cacheScope: 'public' }, 'server/discover': { ttlMs: 3_600_000, cacheScope: 'public' } },
|
|
209
|
-
instructions:
|
|
210
|
-
'After changing a server\'s tools: snapshot_menu for findings and token cost,
|
|
257
|
+
instructions: 'toolmenu tests an MCP server the way clients and agents meet it: the tool list (its menu), the calls, the results, the sign-in, and the next release. ' +
|
|
258
|
+
'After changing a server\'s tools: snapshot_menu for findings and token cost, check_session to call its read-only tools and see whether results match their schemas and whether the menu changes mid-session, ' +
|
|
259
|
+
'diff_menus against the committed menu.json for breaking changes, and review_baseline before replacing that baseline. check_auth for an HTTP server that answers 401. ' +
|
|
211
260
|
'Each finding ends with a → Next: step; explain_rule says what a rule checks.',
|
|
212
261
|
});
|
|
213
262
|
/** Run a command for a server: the folder checked, credentials kept out of argv. */
|
|
@@ -221,22 +270,35 @@ export function build(baseCwd = process.cwd()) {
|
|
|
221
270
|
return toResult(await runCli([...args(f.dir, s), ...s.after], f.dir, { secretArgs: s.secret, signal: ctx.mcpReq.signal }));
|
|
222
271
|
};
|
|
223
272
|
server.registerTool('snapshot_menu', {
|
|
224
|
-
description: "Check an MCP server's tool list: start or connect to it, list its tools, and report findings (what
|
|
225
|
-
'
|
|
273
|
+
description: "Check an MCP server's tool list as a client reads it: start or connect to it, list its tools, and report findings (what clients reject, what breaks prompt caches, what agents misread) and the token cost. " +
|
|
274
|
+
'A command server is started by running command as given, so only pass a command you would run yourself. ' +
|
|
275
|
+
'Writes the menu file only when save_as is given (the baseline for diff_menus): a new file inside cwd, or an existing menu file there.',
|
|
226
276
|
inputSchema: {
|
|
227
277
|
...serverShape,
|
|
228
|
-
save_as: z.string().optional().describe('Write the menu here (menu.json for a baseline), relative to cwd. Default: not written.'),
|
|
278
|
+
save_as: z.string().optional().describe('Write the menu here (menu.json for a baseline), relative to cwd and inside it: a new file, or a menu file to replace. Default: not written.'),
|
|
229
279
|
client: z.enum(CLIENT_NAMES).optional().describe('Also check the menu as this client loads it: what it cuts, finds and refuses.'),
|
|
230
280
|
catalog: z.boolean().optional().describe('Also read the operations behind a search tool or command routers.'),
|
|
231
281
|
},
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
282
|
+
// It runs an arbitrary command: destructive as far as a client deciding what to approve can know.
|
|
283
|
+
annotations: { title: 'Snapshot a server menu', readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
|
|
284
|
+
}, (a, ctx) => {
|
|
285
|
+
let out = '--no-write';
|
|
286
|
+
if (a.save_as) {
|
|
287
|
+
const f = folder(baseCwd, a.cwd);
|
|
288
|
+
const p = 'error' in f ? undefined : savePath(f.dir, a.save_as);
|
|
289
|
+
if (p && 'error' in p)
|
|
290
|
+
return failed(p.error);
|
|
291
|
+
if (p)
|
|
292
|
+
out = `--out=${p.path}`;
|
|
293
|
+
}
|
|
294
|
+
return forServer(a, ctx, (_dir, s) => [
|
|
295
|
+
'snapshot',
|
|
296
|
+
...s.before,
|
|
297
|
+
out,
|
|
298
|
+
...(a.client ? [`--client=${a.client}`] : []),
|
|
299
|
+
...(a.catalog ? ['--catalog'] : []),
|
|
300
|
+
]);
|
|
301
|
+
});
|
|
240
302
|
server.registerTool('diff_menus', {
|
|
241
303
|
description: 'Compare two menu files (from snapshot_menu save_as, or toolmenu snapshot): breaking changes for clients, the token change per conversation, and the version bump it needs. Reads files only.',
|
|
242
304
|
inputSchema: {
|
|
@@ -254,14 +316,14 @@ export function build(baseCwd = process.cwd()) {
|
|
|
254
316
|
return toResult(await runCli(args, f.dir, { signal: ctx.mcpReq.signal }));
|
|
255
317
|
});
|
|
256
318
|
server.registerTool('check_session', {
|
|
257
|
-
description: "
|
|
258
|
-
'Calls only read-only tools; never one marked openWorldHint unless open_world is set.',
|
|
319
|
+
description: "Call an MCP server's tools as an agent would and check what comes back: its tools marked readOnlyHint whose arguments the schema can fill are called, each result is checked against the tool's outputSchema, and the menu is listed after each call, with each change reported with the call that caused it. " +
|
|
320
|
+
'Calls only read-only tools; never one marked openWorldHint unless open_world is set. A command server is started by running command as given, so only pass a command you would run yourself.',
|
|
259
321
|
inputSchema: {
|
|
260
322
|
...serverShape,
|
|
261
323
|
max_calls: z.number().int().min(1).optional().describe('At most this many calls (default 20).'),
|
|
262
324
|
open_world: z.boolean().optional().describe('Also call read-only tools marked openWorldHint (web search, fetch): they may cost API credits.'),
|
|
263
325
|
},
|
|
264
|
-
annotations: { title: 'Run a session against a server', readOnlyHint: false, destructiveHint:
|
|
326
|
+
annotations: { title: 'Run a session against a server', readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
|
|
265
327
|
}, (a, ctx) => forServer(a, ctx, (_dir, s) => [
|
|
266
328
|
'session',
|
|
267
329
|
'--auto',
|
|
@@ -269,6 +331,45 @@ export function build(baseCwd = process.cwd()) {
|
|
|
269
331
|
...(a.max_calls ? [`--max-calls=${a.max_calls}`] : []),
|
|
270
332
|
...(a.open_world ? ['--open-world'] : []),
|
|
271
333
|
]));
|
|
334
|
+
server.registerTool('review_baseline', {
|
|
335
|
+
description: 'Say whether a new menu file should replace the baseline: one verdict (unchanged, safe, breaking-released, breaking, review), what breaks callers, and which findings the new menu adds, clears or makes worse. ' +
|
|
336
|
+
'Use it before overwriting a committed menu.json. Reads the two files only and starts no server.',
|
|
337
|
+
inputSchema: {
|
|
338
|
+
baseline: z.string().describe('The menu file to replace, e.g. the committed menu.json.'),
|
|
339
|
+
candidate: z.string().describe('The new menu file, e.g. new-menu.json from snapshot_menu save_as.'),
|
|
340
|
+
release: z.string().optional().describe('The release versions, so breaking changes pass when the bump allows them: "1.4.0..2.0.0".'),
|
|
341
|
+
cwd: serverShape.cwd,
|
|
342
|
+
},
|
|
343
|
+
annotations: { title: 'Review a new menu against the baseline', readOnlyHint: true, openWorldHint: false },
|
|
344
|
+
}, async (a, ctx) => {
|
|
345
|
+
const f = folder(baseCwd, a.cwd);
|
|
346
|
+
if ('error' in f)
|
|
347
|
+
return failed(f.error);
|
|
348
|
+
const args = ['review', ...(a.release ? [`--release=${a.release}`] : []), absolute(f.dir, a.baseline), absolute(f.dir, a.candidate)];
|
|
349
|
+
const run = await runCli(args, f.dir, { signal: ctx.mcpReq.signal });
|
|
350
|
+
// Exit 1 here is the verdict (don't accept as is), which the report already leads with.
|
|
351
|
+
return toResult(run, "\n\nExit 1: the verdict is not to accept the new menu as it is.");
|
|
352
|
+
});
|
|
353
|
+
server.registerTool('check_auth', {
|
|
354
|
+
description: "Check an HTTP MCP server's OAuth discovery the way a client that follows the spec walks it, without logging in: the 401 and its WWW-Authenticate, the protected resource metadata, the authorization server's metadata, PKCE and registration. " +
|
|
355
|
+
'Use it when a server answers 401 or a client cannot sign in. Sends unauthenticated requests to the URL and to the metadata addresses it names; no credentials, no tokens.',
|
|
356
|
+
inputSchema: { url: z.string().describe('The Streamable HTTP endpoint: https://mcp.example.com/mcp.') },
|
|
357
|
+
annotations: { title: "Check a server's OAuth discovery", readOnlyHint: true, openWorldHint: true },
|
|
358
|
+
}, async (a, ctx) => {
|
|
359
|
+
// The check is of what a client sees before it has credentials, so the URL carries none.
|
|
360
|
+
let parsed;
|
|
361
|
+
try {
|
|
362
|
+
parsed = new URL(a.url);
|
|
363
|
+
}
|
|
364
|
+
catch {
|
|
365
|
+
// not a URL: said below
|
|
366
|
+
}
|
|
367
|
+
if (parsed?.protocol !== 'https:')
|
|
368
|
+
return failed('url must be an https URL, such as https://mcp.example.com/mcp: OAuth discovery is checked over https.');
|
|
369
|
+
if (parsed.username || parsed.password)
|
|
370
|
+
return failed('Drop the user:password@ part of the URL: the check is made without credentials.');
|
|
371
|
+
return toResult(await runCli(['auth', 'check', a.url], baseCwd, { signal: ctx.mcpReq.signal }));
|
|
372
|
+
});
|
|
272
373
|
server.registerTool('explain_rule', {
|
|
273
374
|
description: "Explain a toolmenu rule by the name a finding gives (naming/vague-id): what it checks, its default level and how to change it. Without rule, lists every rule.",
|
|
274
375
|
inputSchema: { rule: z.string().optional().describe('The rule, as a finding names it: naming/vague-id, or just vague-id.') },
|
package/dist/menu.d.ts
CHANGED
|
@@ -12,5 +12,11 @@ export declare function toolTokens(tool: Record<string, unknown>): number;
|
|
|
12
12
|
export declare function toolDefinition(tool: MenuTool): Record<string, unknown>;
|
|
13
13
|
export declare function buildMenu(rawTools: Record<string, unknown>[], server: Menu['server'], listMeta?: Menu['listMeta']): Menu;
|
|
14
14
|
export declare function eraOf(protocolVersion: string | undefined): Era | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Where JSON.parse gave up, "at position 12 (line 1 column 13)", or '' when Node didn't
|
|
17
|
+
* say. Never its whole message: Node quotes the text around the error, and the file may
|
|
18
|
+
* be one the user didn't mean to show (a symlink, a path an agent gave).
|
|
19
|
+
*/
|
|
20
|
+
export declare function jsonErrorAt(error: unknown): string;
|
|
15
21
|
/** Read a menu.json written by `toolmenu snapshot`. */
|
|
16
22
|
export declare function loadMenu(path: string): Promise<Menu>;
|
package/dist/menu.js
CHANGED
|
@@ -39,6 +39,14 @@ export function eraOf(protocolVersion) {
|
|
|
39
39
|
return undefined;
|
|
40
40
|
return protocolVersion >= '2026-07-28' ? 'modern' : 'legacy';
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Where JSON.parse gave up, "at position 12 (line 1 column 13)", or '' when Node didn't
|
|
44
|
+
* say. Never its whole message: Node quotes the text around the error, and the file may
|
|
45
|
+
* be one the user didn't mean to show (a symlink, a path an agent gave).
|
|
46
|
+
*/
|
|
47
|
+
export function jsonErrorAt(error) {
|
|
48
|
+
return /at position \d+(?: \(line \d+ column \d+\))?/.exec(error instanceof Error ? error.message : '')?.[0] ?? '';
|
|
49
|
+
}
|
|
42
50
|
/** Read a menu.json written by `toolmenu snapshot`. */
|
|
43
51
|
export async function loadMenu(path) {
|
|
44
52
|
const { readFile } = await import('node:fs/promises');
|
|
@@ -55,7 +63,10 @@ export async function loadMenu(path) {
|
|
|
55
63
|
data = JSON.parse(text);
|
|
56
64
|
}
|
|
57
65
|
catch (error) {
|
|
58
|
-
|
|
66
|
+
// Where, not what: Node's message quotes the file's first bytes, and the path may be
|
|
67
|
+
// any file (toolmenu mcp's diff_menus takes one from an agent).
|
|
68
|
+
const at = jsonErrorAt(error);
|
|
69
|
+
throw new Error(`${path} isn't valid JSON${at ? ` (${at})` : ''}. If it was cut short or edited by hand, write it again with \`toolmenu snapshot\`.`);
|
|
59
70
|
}
|
|
60
71
|
const menu = data;
|
|
61
72
|
if (menu?.toolmenu !== 1 || !Array.isArray(menu.tools)) {
|
package/dist/options.d.ts
CHANGED
|
@@ -8,6 +8,9 @@ export declare const CLI_OPTIONS: {
|
|
|
8
8
|
readonly junit: {
|
|
9
9
|
readonly type: 'string';
|
|
10
10
|
};
|
|
11
|
+
readonly html: {
|
|
12
|
+
readonly type: 'string';
|
|
13
|
+
};
|
|
11
14
|
readonly badge: {
|
|
12
15
|
readonly type: 'string';
|
|
13
16
|
};
|
|
@@ -23,6 +26,10 @@ export declare const CLI_OPTIONS: {
|
|
|
23
26
|
readonly concurrency: {
|
|
24
27
|
readonly type: 'string';
|
|
25
28
|
};
|
|
29
|
+
readonly 'allow-env': {
|
|
30
|
+
readonly type: 'string';
|
|
31
|
+
readonly multiple: true;
|
|
32
|
+
};
|
|
26
33
|
readonly 'no-write': {
|
|
27
34
|
readonly type: 'boolean';
|
|
28
35
|
};
|
|
@@ -150,6 +157,9 @@ export declare const CLI_OPTIONS: {
|
|
|
150
157
|
readonly 'open-world': {
|
|
151
158
|
readonly type: 'boolean';
|
|
152
159
|
};
|
|
160
|
+
readonly 'call-everything': {
|
|
161
|
+
readonly type: 'boolean';
|
|
162
|
+
};
|
|
153
163
|
readonly 'max-calls': {
|
|
154
164
|
readonly type: 'string';
|
|
155
165
|
};
|
package/dist/options.js
CHANGED
|
@@ -6,11 +6,13 @@ export const CLI_OPTIONS = {
|
|
|
6
6
|
out: { type: 'string' },
|
|
7
7
|
sarif: { type: 'string' },
|
|
8
8
|
junit: { type: 'string' },
|
|
9
|
+
html: { type: 'string' },
|
|
9
10
|
badge: { type: 'string' },
|
|
10
11
|
'sarif-menu': { type: 'string' },
|
|
11
12
|
'out-dir': { type: 'string' },
|
|
12
13
|
'offline-check': { type: 'boolean' },
|
|
13
14
|
concurrency: { type: 'string' },
|
|
15
|
+
'allow-env': { type: 'string', multiple: true },
|
|
14
16
|
'no-write': { type: 'boolean' },
|
|
15
17
|
routes: { type: 'string' },
|
|
16
18
|
config: { type: 'string' },
|
|
@@ -52,6 +54,7 @@ export const CLI_OPTIONS = {
|
|
|
52
54
|
'with-session': { type: 'boolean' },
|
|
53
55
|
catalog: { type: 'boolean' },
|
|
54
56
|
'open-world': { type: 'boolean' },
|
|
57
|
+
'call-everything': { type: 'boolean' },
|
|
55
58
|
'max-calls': { type: 'string' },
|
|
56
59
|
'max-calls-per-unlock': { type: 'string' },
|
|
57
60
|
'save-scenario': { type: 'string' },
|
package/dist/report.d.ts
CHANGED
|
@@ -5,9 +5,23 @@ import { type Scenario, type SessionResult } from './session.js';
|
|
|
5
5
|
import { type Finding, type Menu, type Severity } from './types.js';
|
|
6
6
|
export type Format = 'text' | 'json' | 'github' | 'markdown';
|
|
7
7
|
export declare function counts(findings: Finding[]): Record<Severity, number>;
|
|
8
|
+
/** --client: "as Claude Code: up front ~N tokens (…) · on demand ~M per tool loaded (largest: x, ~K)". */
|
|
9
|
+
export declare function costLine(cost: ClientCost, name?: (tool: string) => string): string;
|
|
8
10
|
export declare function formatSnapshot(menu: Menu, findings: Finding[], format: Format, outPath?: string, cost?: ClientCost, notOffered?: string[]): string;
|
|
9
11
|
export declare function findingLines(findings: Finding[]): string[];
|
|
10
12
|
export declare function githubLines(findings: Finding[]): string[];
|
|
13
|
+
export declare function signed(n: number): string;
|
|
14
|
+
/** "3 breaking (25 tools) · 2 minor (2 tools) · 11 notice (10 tools)": changes, and the tools they touch. */
|
|
15
|
+
export declare function classLine(d: DiffResult): string;
|
|
16
|
+
/**
|
|
17
|
+
* The version verdict: the bump these changes suggest, then whether the release's
|
|
18
|
+
* bump is enough (and what to release instead), or why it wasn't checked.
|
|
19
|
+
*/
|
|
20
|
+
export declare function bumpVerdict(d: DiffResult, md?: boolean): {
|
|
21
|
+
line: string;
|
|
22
|
+
short: boolean;
|
|
23
|
+
};
|
|
24
|
+
export declare function releasePair(d: DiffResult, md?: boolean): string;
|
|
11
25
|
export declare function formatDiff(d: DiffResult, beforeTools: number, afterTools: number, format: Format): string;
|
|
12
26
|
export declare function formatHistory(h: HistoryResult, format: Format, outDir: string, csvPath?: string): string;
|
|
13
27
|
export declare function formatSession(s: SessionResult, format: Format): string;
|