dna-sdk
v0.19.2
Published
DNA — Domain Notation of Anything (TypeScript SDK)
Maintainers
Readme
dna-sdk (TypeScript)
TypeScript SDK for DNA — Domain Notation of Anything: a microkernel +
extensions runtime for declarative agent notation. 1:1 behavioral twin of
the Python SDK (packages/sdk-py) — same ports, same composition rules,
same outputs, parity-enforced by tests. See the
repository README for the thesis and the Kind catalog.
Install
npm install dna-sdk # or: bun add dna-sdkPre-release / exact-pin alternative — consume straight from the repo:
cd packages/sdk-ts
bun installESM-only, Node >= 20 or Bun. The published package ships compiled JS +
type declarations (dist/); inside the repo, dev and tests run the
TypeScript sources directly under Bun (no build step needed). The
publication build is bun run build (tsc emit + runtime-asset copy).
Minimal example
import { quickInstance } from "dna-sdk";
// Scan a scope (directory of YAML/Markdown manifests under .dna/)
const mi = await quickInstance("hello-genome", "examples/hello-genome/.dna");
// Every document is identified by (apiVersion, kind, name)
for (const d of mi.documents) {
console.log(d.apiVersion, d.kind, d.name);
}
// Compose agent + soul + skills + guardrails into one system prompt
console.log(await mi.buildPrompt({ agent: "greeter" }));Runnable version: examples/hello-genome/run.ts.
Prefer createKernelWithBuiltins() (from the same entrypoint) when you
want to wire sources, caches and resolvers yourself.
Tests
bun test # full suite
bun run typecheck # tsc --noEmitThe suite includes the market-fidelity conformance tests
(tests/market-conformance.test.ts) and the Py↔TS parity fixtures shared
with the Python twin.
