lean-agentic
Version:
High-performance WebAssembly theorem prover with dependent types, hash-consing (150x faster), Ed25519 proof signatures, MCP support for Claude Code, AgentDB vector search, episodic memory, and ReasoningBank learning. Formal verification with cryptographic
82 lines (71 loc) • 1.55 kB
JavaScript
/**
* lean-agentic - Hash-consed dependent types with 150x faster equality
*
* @module lean-agentic
* @author ruv.io
* @license Apache-2.0
*/
import * as wasm from '../wasm/leanr_wasm.js';
/**
* Initialize the WASM module
* @returns {Promise<void>}
*/
export async function init() {
// WASM is already initialized when imported
return Promise.resolve();
}
/**
* LeanDemo - Main interface for lean-agentic
*/
export class LeanDemo {
constructor() {
this._inner = new wasm.LeanDemo();
}
/**
* Create identity function: λx:Type. x
* @returns {string} JSON representation of the identity function
*/
createIdentity() {
return this._inner.create_identity();
}
/**
* Create and verify an application
* @returns {string} JSON representation of the application
*/
createApplication() {
return this._inner.create_application();
}
/**
* Demonstrate hash-consing by creating identical terms
* @returns {string} JSON showing term equality
*/
demonstrateHashConsing() {
return this._inner.demonstrate_hash_consing();
}
}
/**
* Create a new LeanDemo instance
* @returns {LeanDemo}
*/
export function createDemo() {
return new LeanDemo();
}
/**
* Quick start: Create identity function
* @returns {Promise<string>}
*/
export async function quickStart() {
await init();
const demo = createDemo();
return demo.createIdentity();
}
// Re-export WASM types
export { wasm };
// Default export
export default {
init,
LeanDemo,
createDemo,
quickStart,
wasm
};