@nhtio/adk/common
Core value classes, runtime primitives, media helpers, and their companion input types.
Remarks
A convenience barrel that re-exports the data primitives most consumers reach for: the value classes (@nhtio/adk!Tokenizable, @nhtio/adk!Registry, @nhtio/adk!Identity, @nhtio/adk!Memory, @nhtio/adk!Message, @nhtio/adk!Thought, @nhtio/adk!ToolCall, @nhtio/adk!Tool, @nhtio/adk!ToolRegistry, and the spooled artifact family) plus their Raw* constructor inputs and small companion types. @nhtio/adk!TurnGate is exported as a type only — it is constructed internally by the runner and only surfaced to observers, never instantiated by user code.
Use this barrel when you want one import for the everyday primitives without pulling the runners or context surfaces. Per-class barrels remain available when you want narrower imports.
Classes
| Class | Description |
|---|---|
| Identity | An immutable, validated participant identity attached to a @nhtio/adk!Message. |
| Media | Lazy, re-openable view over a binary asset (image, audio, video, document). |
| Memory | An immutable, validated memory entry held by the agent. |
| Message | An immutable, validated conversation message from a human participant or the model. |
| Registry | A controlled-mutation key-value store with dot-path access and deep-clone isolation. |
| Retrievable | An immutable, validated retrieved record (RAG content) held by the agent. |
| Thought | An immutable, validated internal reasoning trace produced by an agent. |
| Tokenizable | A mutable string with a built-in token counter. |
Interfaces
| Interface | Description |
|---|---|
| MediaReader | Re-openable byte source contract for a Media instance. |
| MediaStashEntry | Per-entry shape stored in a Media's stash register. |
| MergeOptions | Options accepted by ToolRegistry.merge. |
| RawIdentity | Plain input object supplied to Identity at construction time. |
| RawMedia | Plain input object supplied to Media at construction time. |
| RawMemory | Plain input object supplied to Memory at construction time. |
| RawMessage | Plain input object supplied to Message at construction time. |
| RawRetrievable | Plain input object supplied to Retrievable at construction time. |
| RawThought | Plain input object supplied to Thought at construction time. |
| RawTurnGate | Plain input object supplied to TurnGate at construction time. |
| SerializedMedia | Shape returned by Media.toJSON. Metadata-only — bytes and the reader are stripped so naive event/log serialisation never materialises bytes. |
| ToolMethodDescriptor | Metadata table entry for one of the artifact's existing query methods, used by SpooledArtifact.forgeTools to surface that method as an @nhtio/adk!ArtifactTool. |
| TurnGate | A cooperative suspension gate that blocks a turn's middleware pipeline until resolved, rejected, aborted, or timed out. |
Type Aliases
| Type Alias | Description |
|---|---|
| MediaKind | The set of supported media kinds. |
| MediaKind | Union of all recognised media kind identifier strings. |
| MediaModalityHazard | Modality-hazard axis. How dangerous is it to let the model decode these bytes? |
| MediaModalityHazard | Modality-hazard axis. How dangerous is it to let the model decode these bytes? |
| MediaTrustTier | Provenance axis. Who is the framework willing to vouch for as the source of these bytes? |
| MediaTrustTier | Provenance axis. Who is the framework willing to vouch for as the source of these bytes? |
| MessageRole | The roles a Message author can hold. |
| RetrievableTrustTier | Trust-tier discriminator declared by the retrieval middleware at construction time. Drives which envelope the LLM battery wraps the record in. |
| TokenEncoding | Union of all recognised token encoding identifier strings. |
| ToolCallResults | Union of every shape a ToolCall.results field may carry. |
Variables
| Variable | Description |
|---|---|
| mediaReaderSchema | Validator schema used to validate a MediaReader value. |
| TokenEncoding | The set of supported token encoding identifiers. |
Functions
| Function | Description |
|---|---|
| fromFetch | Constructs a @nhtio/adk!MediaReader backed by a fetch call. |
| fromWebFile | Constructs a @nhtio/adk!MediaReader backed by a browser File or Blob. |
| implementsMediaReader | Returns true if value implements the MediaReader interface. |
| inMemoryMediaReader | Constructs a @nhtio/adk!MediaReader backed by an in-memory Uint8Array. |
| isMedia | Returns true if value is a Media instance. |
References
ArtifactTool
Re-exports ArtifactTool
ArtifactToolHandler
Re-exports ArtifactToolHandler
implementsSpoolReader
Re-exports implementsSpoolReader
JsonArtifactFormat
Re-exports JsonArtifactFormat
MarkdownCodeEntry
Re-exports MarkdownCodeEntry
MarkdownHeadingEntry
Re-exports MarkdownHeadingEntry
MarkdownSection
Re-exports MarkdownSection
RawArtifactTool
Re-exports RawArtifactTool
RawTool
Re-exports RawTool
RawToolCall
Re-exports RawToolCall
SpooledArtifact
Re-exports SpooledArtifact
SpooledArtifactConstructor
Re-exports SpooledArtifactConstructor
SpooledJsonArtifact
Re-exports SpooledJsonArtifact
SpooledMarkdownArtifact
Re-exports SpooledMarkdownArtifact
SpoolReader
Re-exports SpoolReader
Tool
Re-exports Tool
ToolCall
Re-exports ToolCall
ToolHandler
Re-exports ToolHandler
ToolRegistry
Re-exports ToolRegistry