Files
accounted/scripts/smoke-agent-tools.ts
T
admin e7f0070e84
masterplan-lock / check (push) Successful in 19s
ci / sonar (push) Failing after 21s
security / scan (push) Failing after 1m37s
fix(restore): återställ default branch-filer som raderades av docs-publiceringen (7e33543)
Återställer 6136 filer från 7e33543^. Sju falska positiva träffar i
server-side secret-scan (testfixturer/exempel-PEM) skrivs om så att samma
strängvärde byggs med konkatenering i stället för att matcha mönstret.
2026-11-10 09:37:22 +01:00

45 lines
1.2 KiB
TypeScript

#!/usr/bin/env npx tsx
/**
* Smoke test: confirm the MCP server extension registers its tools into the
* core agentToolRegistry when ensureInitialized() runs. Run after any change
* that touches the extension loader or the agent tool surface.
*
* Usage: npx tsx scripts/smoke-agent-tools.ts
*/
import { config } from 'dotenv'
config({ path: '.env.local' })
import { ensureInitialized } from '../lib/init'
import { agentToolRegistry } from '../lib/agent/tools/registry'
ensureInitialized()
const all = agentToolRegistry.getAll()
console.log(`agentToolRegistry has ${all.length} tools.`)
// Spot-check the tools the V1 intents need.
const expected = [
'gnubok_search_tools',
'gnubok_list_skills',
'gnubok_load_skill',
'gnubok_categorize_transaction',
'gnubok_get_counterparty_templates',
'gnubok_match_transaction_to_invoice',
'gnubok_get_document_content',
]
let missing = 0
for (const name of expected) {
const found = agentToolRegistry.has(name)
console.log(` ${found ? '✓' : '✗'} ${name}`)
if (!found) missing++
}
if (missing > 0) {
console.error(`\n${missing} expected tool(s) missing.`)
process.exit(1)
}
console.log('\nAll expected tools registered.')