@nextera.one/lim-core
v0.1.0
Published
TypeScript execution kernel for the Lawful Intent Model (LIM)
Maintainers
Readme
@nextera.one/lim-core
@nextera.one/lim-core is the TypeScript execution kernel for the Lawful Intent Model.
It validates intent, enforces law, executes deterministically, and produces proof.
Install
npm i @nextera.one/lim-coreMinimal Usage
import {
createIntent,
createLIM,
LocalExecutionEngine,
SequentialLawEngine,
InMemoryLawResolver,
BasicIdentityValidator,
BasicTemporalValidator,
BasicStructuralValidator,
BasicProofBuilder,
type LIMSignedIntent,
type LIMLaw,
} from '@nextera.one/lim-core';
const laws: LIMLaw[] = [];
const lim = createLIM()
.useStructuralValidator(new BasicStructuralValidator())
.useIdentityValidator(new BasicIdentityValidator())
.useTemporalValidator(new BasicTemporalValidator())
.useLawResolver(new InMemoryLawResolver(laws))
.useLawEngine(new SequentialLawEngine())
.useExecutionEngine(new LocalExecutionEngine())
.useProofBuilder(new BasicProofBuilder())
.build();
const rawIntent = createIntent<{ amount: number }>()
.type('payment.transfer')
.actor({ anchorId: 'anch_01HXYZ' })
.payload({ amount: 100 })
.build();
const signedIntent: LIMSignedIntent = {
intent: rawIntent,
signature: {
scheme: 'softid.ed25519',
value: 'sig_abc123',
},
};
const result = await lim.execute(signedIntent, { mode: 'strict' });