import { InputBase, type InputOptions } from '@maelys-dev/datalog/wasm' // The try covers setup as well as the displayed example. try { const engine = keepEngine(await Engine.create({ profile: 'small' })) registerDocuments(engine) const ruleset = engine.loadInlineRuleset(documentDomain, 'reference-context', documentPolicy) const session = ruleset.prepare() const facts: Fact[] = [ { predicate: 'user', terms: ['alice'] }, { predicate: 'owns', terms: ['alice', 'roadmap.pdf'] }, ] /* API_REFERENCE_EXAMPLE */ } finally { // Engine.close cascades to the session, retained input and live result. closeEngines() }