lmcode-js skill

Use lmcode-js to embed the DSLB v6 bytecode verifier, 226-signature standard catalog, and REST/CLI controller into Node.js 22+ and 24+ applications.

Purpose

Run schema-bound lmcode DSLB v6 bytecode in pure JavaScript with lossless 64-bit BigInt math, raw byte buffers, REST/CLI dispatch, and LMCODE_RETURN framing.

When to use it

Use lmcode-js when building a Node.js host tool, CLI, or test runner that executes compiled .dslb v6 programs without native addons.

Install

Import @lmctl-ai/lmcode-js and @lmctl-ai/lmcode-js/rest in Node.js 22 or 24 LTS with zero external npm runtime dependencies.

Commands

npm run verify:pins
npm test
npm run mutation
npm run conformance
npm run conformance:rest
npm run sample-suite

Inputs and outputs

Safety rules

Worked examples

import { Context, Program, createRegistry } from '@lmctl-ai/lmcode-js';

const registry = createRegistry();
registry.context('greeter', 'Greeter');
registry.method('method Greeter.say(string) -> void', (greeter, text) => {
  greeter.messages.push(text);
});
const program = Program.load(bytecode, schemaBytes, registry);
const context = new Context({ greeter: { messages: [] } });
program.run(context);

Errors and exit codes

CodePhaseExitCondition
LOAD_BAD_BYTECODEload3Malformed DSLB v6 header, bad magic or version, truncated section, invalid opcode, or stack depth violation
LOAD_BAD_SCHEMAload3Host schema JSON fails dsl.schema 2 validation or declares an invalid result contract
LOAD_SCHEMA_MISMATCHload332-byte SHA-256 schema hash in DSLB v6 header does not match exact host schema bytes
LOAD_UNBOUNDload3Bytecode imports a context, function, or method signature not registered in the host Registry
RUN_ERRORrun3VM division or remainder by zero, or loop-free operand stack underflow
RUN_HOSTrun3Host callback failure, invalid encoding, expired collection handle, or REST route validation failure
APP_FAILapp4Post-run application domain validation failure or output stream write failure

How to verify

npm run check