Files
zalbot/scripts/list-tools.ts
Kaysser Kayyali b884a13d98
Some checks failed
tests / Unit tests (Node 22) (push) Failing after 28s
fix wizard for new stories
2026-06-20 06:52:19 +00:00

24 lines
1.0 KiB
TypeScript

// List the engine's registered tool plugins (name + description + args).
// The only valid source of names for a spec's `tools:` field — the engine's
// tests/unit/specsToolsConsistency.test.ts fails the build if a spec references
// a tool name that isn't registered here.
//
// Usage (run from the engine repo root):
// npx tsx scripts/list-tools.ts
//
// The side-effect import of src/harness/tools/index.js populates the registry
// (each tool module calls registerTool() at load time) — the same pattern the
// AC3 skill-check test uses.
import '../src/harness/tools/index.js';
import { getAllToolNames, getPlugin } from '../src/harness/toolRegistry.js';
const names = [...getAllToolNames()].sort();
console.log(`Registered tool plugins (${names.length}):`);
for (const name of names) {
const p = getPlugin(name);
if (!p) continue;
console.log(` ${name}${p.description}`);
const args = Object.entries(p.args).map(([k, v]) => `${k}:${v.type}`).join(', ');
if (args) console.log(` args: ${args}`);
}