API Reference
The full TypeScript API reference is auto-generated from the SDK's source on every
documentation build by docusaurus-plugin-typedoc,
which drives TypeDoc over src/index.ts and renders the result
as Markdown pages in this section.
Browse the generated pages under API Reference in the left sidebar. Because they come straight from the source, the signatures, parameter types, and doc comments there are always in sync with the published package — they are never hand-edited.
What the public surface looks like
src/index.ts is the single public entrypoint of @agent-assembly/sdk. Everything it
re-exports is part of the supported surface (and everything it does not export is an
internal detail). At a glance, the public exports are:
Functions
| Export | Purpose |
|---|---|
initAssembly | The front door — resolve a gateway, detect frameworks, register the agent, wire adapters, and return an AssemblyContext. See Configuration. |
withAssembly | Low-level wrapper that governs a tool map using a gateway client you supply. See Guides. |
currentAgentId | Read the current agent id from the async-context lineage store. |
runWithAgentId | Run a function with a given agent id bound in the lineage store, so spawned work inherits lineage. |
encodeAuditEvent / decodeAuditEvent | Convert an AuditEvent to/from its JSON wire form (camelCase ⇄ snake_case). |
encodeCallStackNode / decodeCallStackNode | Same, for a single CallStackNode. |
findAasmBinary | Locate the aasm runtime binary on disk, or null if none is found. |
Values
| Export | Purpose |
|---|---|
ENFORCEMENT_MODES | Runtime-checkable list of valid EnforcementMode values (["enforce", "observe", "disabled"]). |
INSTALL_HINT | The install-instructions string surfaced when the runtime binary is missing. |
Types
AssemblyConfig, AssemblyContext, AssemblyMode, EnforcementMode, AuditEvent,
CallStackNode, CallStackNodeKind, ToolMap, WithAssemblyOptions,
WireAuditEvent, and WireCallStackNode.
The generated reference documents every one of these in full — follow the sidebar.
How regeneration works
The plugin runs as part of pnpm --dir website build. It reads src/index.ts,
traverses every exported symbol, and writes Markdown pages under
docs/06-api-reference/api/ (gitignored), which the autogenerated sidebar then nests
inside this API Reference section. Navigation, search, and dark mode all work
without extra configuration.
You do not need to commit anything under docs/06-api-reference/api/; the workflow
regenerates it on each push to master.
Manual regeneration
For local preview during development:
cd website
pnpm start # dev server; TypeDoc runs on first start and on file change
pnpm build # full production build, regenerates the API reference
If TypeDoc itself fails (e.g. a missing tsconfig reference or a syntax error in
src/index.ts), the Docusaurus build fails — fix the underlying TypeScript issue
before retrying.