UNPKG

mcard-js

Version:

MCard - Content-addressable storage with cryptographic hashing, handle resolution, and vector search for Node.js and browsers

77 lines 2.65 kB
/** * CLMRunner - Execute JavaScript logic from CLM specifications * * Node.js PTR runtime for interpreting Cubical Logic Models. * * Refactored to use modular components from ./clm/ */ import { CardCollection } from '../../../model/CardCollection.js'; import type { CLMSpec, ExecutionResult, VerificationResult, RunExamplesSummary, ExecutionReport, SummaryReport, CLMBannerLines, MultiRuntimeResult } from './types.js'; export declare class CLMRunner { private loader; private timeout; private collection?; constructor(basePath?: string, timeout?: number, collection?: CardCollection); /** * Run a CLM directly from a file path. */ runFile(clmPath: string, input?: unknown): Promise<ExecutionResult>; /** * Execute a CLM specification with given input. * * Implements Petri Net Transition Semantics: * 1. Constructs PCard (Transition) * 2. Checks Pre-conditions (Firing Rule) * 3. Executes Logic * 4. Produces VerificationVCard (Token) * 5. Persists to Collection (Place) */ executeCLM(clm: CLMSpec, chapterDir: string, input: unknown): Promise<ExecutionResult>; /** * Execute a CLM across multiple runtimes and verify consensus. */ executeMultiRuntime(clm: CLMSpec, chapterDir: string, input: unknown): Promise<MultiRuntimeResult>; /** * Check if a CLM is a multi-runtime CLM. */ isMultiRuntime(clm: CLMSpec): boolean; /** * Verify CLM output against expected result. */ verifyCLM(clm: CLMSpec, chapterDir: string, input: unknown, expected: unknown): Promise<VerificationResult>; /** * Run all examples from a CLM specification. */ runExamples(clm: CLMSpec, chapterDir: string): Promise<Array<{ name: string; result: ExecutionResult; }>>; /** * Summarize example runs. */ summarizeExampleRuns(clm: CLMSpec, results: Array<{ name: string; result: ExecutionResult; }>): RunExamplesSummary; /** * Build CLM banner for display. */ buildCLMBanner(clm: CLMSpec): CLMBannerLines; /** * Build execution report. */ buildExecutionReport(clm: CLMSpec, execution: ExecutionResult): ExecutionReport; /** * Build summary report. */ buildSummaryReport(clm: CLMSpec, summary: RunExamplesSummary): SummaryReport; private executeLoader; private executeNetwork; private executeStandard; private executeRecursive; private resolveCodeOrPath; private buildNetworkContext; private buildJavaScriptContext; private buildRunCLM; } //# sourceMappingURL=runner.d.ts.map