JavaScript/TypeScript reference SDK for LLTP (Lab-in-the-Loop Transport Protocol) v0.1.
Maintained by BioLM during protocol kickoff. See the spec repo GOVERNANCE.md for long-term stewardship intent.
Status: v0.1-alpha. Message signing (sign / verify) is not yet implemented.
npm install lltp
# from source:
npm install
npm run buildRequires Node.js >=18 (native fetch).
import { validateEnvelope, deriveOrderStatus } from "lltp";
import { readFileSync } from "node:fs";
const order = JSON.parse(
readFileSync("tests/fixtures/scenario-a-dna-synthesis/01-order.json", "utf8"),
);
validateEnvelope(order);
console.log(deriveOrderStatus(order.requirements)); // IN_PROGRESSnpm run mock-provider -- --port 8765In another shell:
import { LLTPClient } from "lltp";
import { readFileSync } from "node:fs";
const order = JSON.parse(
readFileSync("tests/fixtures/scenario-a-dna-synthesis/01-order.json", "utf8"),
);
const client = new LLTPClient();
const catalog = await client.fetchCatalog("http://127.0.0.1:8765");
const summary = await client.submitOrder("http://127.0.0.1:8765", order);
console.log(summary);| Export | Purpose |
|---|---|
validateEnvelope, validateCatalog |
JSON Schema validation (Ajv) |
deriveOrderStatus, mergeRequirements |
Lifecycle derivation and STATUS merge |
LLTPClient |
HTTP client for provider endpoints |
WebhookHandler |
Merge STATUS/RESULT deltas with dedupe |
OrderEnvelope, StatusEnvelope, … |
Vendored wire types from spec |
npm ci
npm run build
npm testWhen the spec repo changes:
cp ../lltp/schema/0.1/{envelope,provider}.schema.json src/schemas/
cp ../lltp/schema/0.1/*.ts src/schema/
cp ../lltp/examples/catalog/twist.json tests/fixtures/catalog/
cp ../lltp/examples/scenario-a-dna-synthesis/*.json tests/fixtures/scenario-a-dna-synthesis/
cp ../lltp/examples/scenario-b-approval-gate/0{1,2,3}*.json tests/fixtures/scenario-b-approval-gate/See CONFORMANCE.md for what this alpha SDK implements vs deferred.
- lltp — protocol specification
- BioLM/lltp-py — Python reference SDK
- BioLM/lltp-js — this repository
Apache-2.0. See LICENSE.