Playground Interactif
Exécutez les modules standalone directement dans votre navigateur. Tous les tests s'exécutent côté client — aucune clé API, aucun appel réseau.
Les tests ci-dessous reproduisent la suite de tests officielle (smoke-test.mts) livrée avec le package.
PII4 tests
detectPII finds email
detectPII finds French NIR
redactPII replaces email
redactPII custom replaceWith
Injection3 tests
detects classic attack
cumulative scoring — multiple patterns
passes clean input
Schema Repair4 tests
cleanMarkdown strips fences
repairAndParse Level 1 — markdown
repairAndParse Level 2 — trailing comma
repairAndParse Level 2 — surrounding text
Budget5 tests
calculateCost known model (gpt-4o-mini)
calculateCost returns 0 for unknown model
registerModelPricing — custom model
buildUsage with real token counts
new models — gemini-2.5-flash pricing
Canary3 tests
generateCanaryToken is unique each call
checkCanaryLeak detects leaked token
checkCanaryLeak passes clean output
Content Policy2 tests
flags violence
passes clean text
Hallucination3 tests
extractEntities filters trivial numbers
suspects ungrounded entities
passes grounded response
Click "Run All" to execute all tests in your browser.