OpenAgentIDDocumentation
API referencenpm packages@openagentid/sdk
OpenAgentIDAPI reference

@openagentid/sdk/agent

API contract shipped by @openagentid/sdk 0.7.2. Exact exports, signatures, dependencies and availability.

All packages · Runnable examples · Start an agent

ContractValue
Package@openagentid/sdk@0.7.2
Entry point@openagentid/sdk/agent
AvailabilityCurrent integration path
Reference sourcePublished TypeScript declarations
Package enginesnode >=20

Before integrating

The published VERSION constant is still the literal "0.6.0" in the 0.7.2 archive. Use package metadata or your lockfile to identify the installed release; do not use VERSION as a release check.

When using @openagentid/crypto-wasm 0.1.1 for ACT verification, call the SDK verifier builder .atTime(Math.floor(Date.now() / 1000)) on every verification. The default WASM system-clock path traps in Node. Supply trusted receiver current epoch seconds; never token-supplied time or a timestamp captured once at startup. The complete ACT example covers this requirement.

In SDK 0.7.2, withAct and requireActExpress do not expose a verification-clock option. The raw crypto-wasm 0.1.1 binding alone therefore traps for these wrappers; use the tested fluent .atTime(...) example, or qualify a binding adapter that supplies fresh trusted receiver time on every verification.

This reference is generated from the integrity-verified npm archive for this exact version. Signatures describe the public contract; they are not standalone programs. Complete examples are checked separately.

Import conditions

Use the public entry point above. The package resolves it to these shipped files; do not import its internal files directly.

ConditionPublished file
types./dist/agent.d.ts
import./dist/agent.js
require./dist/agent.cjs

Exports

OpenAgent

OpenAgent — the public namespace. All calls delegate to a singleton runtime created lazily on first use. Most apps never need more than this.

Signature
declare const OpenAgent: {
    readonly configure: (config?: OpenAgentConfig) => OpenAgentRuntime;
    readonly runtime: () => OpenAgentRuntime;
    readonly createAgent: (input: CreateAgentInput) => Promise<OpenAgentInstance>;
    readonly loadAgent: (did: Did, skills?: readonly SkillId[]) => Promise<OpenAgentInstance>;
    readonly authenticate: (req: Request, options?: VerifyRequestOptions) => Promise<AuthContext>;
};

Source: @openagentid/sdk@0.7.2, dist/agent.d.ts:83.

OpenAgentInstance

A live, fully-authenticated agent handle.

Type-only declaration; it is not a runtime value.

Signature
interface OpenAgentInstance {
    readonly did: Did;
    readonly document: IdentityDocument;
    skillsPolicy(): SkillsPolicy;
    withSkillsPolicy(policy: SkillsPolicy): OpenAgentInstance;
    credentialsFor(provider: string, scopes?: readonly string[]): Promise<CredentialHandle>;
    identity(): IdentityProvider;
}

Source: @openagentid/sdk@0.7.2, dist/agent.d.ts:32.

OpenAgentRuntime

Global, lazily-initialized OpenAgent runtime.

The default instance is populated by {@link OpenAgent.configure}. Callers who need multiple runtimes in one process can instantiate OpenAgentRuntime directly.

Signature
declare class OpenAgentRuntime {
    constructor(config?: OpenAgentConfig);
    config(): Readonly<ResolvedOpenAgentConfig>;
    identity(): IdentityProvider;
    arsenal(): ArsenalClient;
    verification(): VerificationClient;
    createAgent(input: CreateAgentInput): Promise<OpenAgentInstance>;
    loadAgent(did: Did, skills?: readonly SkillId[]): Promise<OpenAgentInstance>;
    authenticate(req: Request, options?: VerifyRequestOptions): Promise<AuthContext>;
}

Source: @openagentid/sdk@0.7.2, dist/agent.d.ts:53.

Supporting declarations

These package-owned declarations are referenced by the exports above. Their presence here does not make them importable from this entry point. Import only the names in Exports.

ArsenalClient

Arsenal broker client facade. The real client lives in @openagentid/arsenal-sdk and is injected by the application; see INTEGRATION_NOTES.md.

Type-only declaration; it is not a runtime value.

Signature
interface ArsenalClient {
    requestCredential(params: {
        agentDid: Did;
        provider: string;
        scopes?: readonly string[];
    }): Promise<IssuedCredential>;
    release?(credentialProxyUrl: string): Promise<void>;
}

Source: @openagentid/sdk@0.7.2, dist/credentials.d.ts:51.

AuthContext

A resolved, authenticated caller identity.

Type-only declaration; it is not a runtime value.

Signature
interface AuthContext {
    readonly did: Did;
    readonly root: Did;
    readonly lineage: readonly Did[];
    readonly lineageAuthority?: LineageAuthorityContext;
    readonly scopes: readonly string[];
    readonly expiresAt: number;
    readonly presentedToken?: string;
    readonly claims?: Readonly<Record<string, unknown>>;
}

Source: @openagentid/sdk@0.7.2, dist/verification.d.ts:44.

AvatarExpression

Type-only declaration; it is not a runtime value.

Signature
type AvatarExpression = typeof CHARACTER_EXPRESSIONS[number];

Source: @openagentid/sdk@0.7.2, dist/character-state.d.ts:3.

CHARACTER_EXPRESSIONS

Portable presentation state. Status never grants identity or application authority.

Signature
declare const CHARACTER_EXPRESSIONS: readonly [
    "neutral",
    "attentive",
    "surprised",
    "excited",
    "happy",
    "laughing",
    "angry",
    "sad",
    "scared",
    "suspicious",
    "confused",
    "curious",
    "proud",
    "shy",
    "unimpressed",
    "sleepy",
    "thoughtful",
    "concerned"
];

Source: @openagentid/sdk@0.7.2, dist/character-state.d.ts:2.

CharacterAccessory

Independent, package-owned wearables in the shared face coordinate space.

Type-only declaration; it is not a runtime value.

Signature
type CharacterAccessory = 'glasses' | 'headphones';

Source: @openagentid/sdk@0.7.2, dist/characters.d.ts:6.

CharacterAppearance

Type-only declaration; it is not a runtime value.

Signature
interface CharacterAppearance {
    readonly skin: CharacterSkin;
    readonly skinVersion?: 1;
    readonly eyeStyle?: CharacterEyeStyle;
    readonly finish?: CharacterFinish;
    readonly eyePlacement?: CharacterEyePlacement;
    readonly shape?: CharacterShape;
    readonly accessories?: readonly CharacterAccessory[];
}

Source: @openagentid/sdk@0.7.2, dist/characters.d.ts:29.

CharacterEyePlacement

Type-only declaration; it is not a runtime value.

Signature
type CharacterEyePlacement = 'face' | 'raised';

Source: @openagentid/sdk@0.7.2, dist/characters.d.ts:27.

CharacterEyeStyle

Type-only declaration; it is not a runtime value.

Signature
type CharacterEyeStyle = 'live-v1';

Source: @openagentid/sdk@0.7.2, dist/characters.d.ts:26.

CharacterFinish

One self-contained material for every package-owned silhouette.

Type-only declaration; it is not a runtime value.

Signature
type CharacterFinish = 'plush' | 'flat';

Source: @openagentid/sdk@0.7.2, dist/characters.d.ts:19.

CharacterShape

Type-only declaration; it is not a runtime value.

Signature
type CharacterShape = 'standard' | 'slender' | 'wide' | 'circle' | 'pebble' | 'squircle' | 'capsule' | 'triangle' | 'hexagon' | 'cloud' | 'droplet' | 'kite' | 'fan' | 'bud' | 'leaf' | 'drop' | 'wave' | 'comet' | 'satellite' | 'mitt' | 'hood' | 'crystal' | 'obelisk' | 'spring' | 'bellows' | 'vase' | 'teapot' | 'flame' | 'curl' | 'radio' | 'beacon' | 'tower' | 'arch' | 'pom' | 'bear' | 'pumpkin' | 'ghost' | 'bat' | 'witch-hat' | 'candy-corn' | 'turkey' | 'acorn' | 'squash' | 'pie' | 'corn' | 'light' | 'tree' | 'snowman' | 'ornament' | 'gift';

Source: @openagentid/sdk@0.7.2, dist/characters.d.ts:28.

CharacterSkin

Type-only declaration; it is not a runtime value.

Signature
type CharacterSkin = 'autos' | 'spacex' | 'fold' | 'sprig' | 'ripple' | 'halo' | 'purl' | 'prism' | 'coil' | 'kiln' | 'wisp' | 'relay' | 'cairn' | 'tuft' | 'halloween' | 'thanksgiving' | 'christmas';

Source: @openagentid/sdk@0.7.2, dist/characters.d.ts:24.

CreateAgentInput

Type-only declaration; it is not a runtime value.

Signature
type CreateAgentInput = z.infer<typeof createAgentInputSchema>;

Source: @openagentid/sdk@0.7.2, dist/config.d.ts:56.

createAgentInputSchema

Parameters accepted by {@link OpenAgent.createAgent }.

Signature
declare const createAgentInputSchema: z.ZodObject<{
    parent: z.ZodEffects<z.ZodString, string, string>;
    name: z.ZodString;
    scopes: z.ZodArray<z.ZodString, "many">;
    namespace: z.ZodOptional<z.ZodString>;
    skills: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
    metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, "strict", z.ZodTypeAny, {
    parent: string;
    name: string;
    scopes: string[];
    namespace?: string | undefined;
    skills?: string[] | undefined;
    metadata?: Record<string, unknown> | undefined;
}, {
    parent: string;
    name: string;
    scopes: string[];
    namespace?: string | undefined;
    skills?: string[] | undefined;
    metadata?: Record<string, unknown> | undefined;
}>;

Source: @openagentid/sdk@0.7.2, dist/config.d.ts:28.

CredentialHandle

A live, fetch-ready credential bound to an agent DID + provider.

The fetch method is a drop-in replacement for globalThis.fetch. The underlying credential is refreshed lazily when the caller invokes refresh() — auto-rotation stays out of the per-request hot path.

Type-only declaration; it is not a runtime value.

Signature
interface CredentialHandle {
    readonly provider: string;
    readonly agentDid: Did;
    readonly expiresAt: number;
    fetch: typeof fetch;
    refresh(): Promise<CredentialHandle>;
    release(): Promise<void>;
}

Source: @openagentid/sdk@0.7.2, dist/credentials.d.ts:68.

Did

Fully qualified did:oas identifier.

Type-only declaration; it is not a runtime value.

Signature
type Did = string;

Source: @openagentid/sdk@0.7.2, dist/identity.d.ts:7.

IdentityDocument

OAS identity document fragment — minimum fields needed by the SDK.

Type-only declaration; it is not a runtime value.

Signature
interface IdentityDocument {
    did: Did;
    parent: Did;
    publicKeyMultibase: string;
    kind: string;
    scopes: readonly string[];
    createdAt: string;
    avatarOverride?: string | null;
    avatarSkin?: CharacterAppearance | null;
    avatarExpression?: AvatarExpression;
    metadata?: Record<string, unknown>;
}

Source: @openagentid/sdk@0.7.2, dist/identity.d.ts:9.

IdentityProvider

The OAS identity facade. Concrete providers come from @openagentid/oas-sdk (production) or from {@link StubIdentityProvider } (test / offline dev).

Type-only declaration; it is not a runtime value.

Signature
interface IdentityProvider {
    createAgentIdentity(input: CreateAgentInput): Promise<IdentityDocument>;
    resolve(did: Did): Promise<IdentityDocument>;
    signChallenge(did: Did, challenge: Uint8Array): Promise<SignedAssertion>;
    publicKey(did: Did): Promise<string>;
}

Source: @openagentid/sdk@0.7.2, dist/identity.d.ts:48.

IssuedCredential

A short-lived credential minted by the Arsenal broker.

Type-only declaration; it is not a runtime value.

Signature
interface IssuedCredential {
    provider: string;
    proxyUrl: string;
    expiresAt: number;
    remainingCalls?: number;
    metadata?: Record<string, unknown>;
}

Source: @openagentid/sdk@0.7.2, dist/credentials.d.ts:32.

LineageAuthorityContext

Sigil-backed lineage authority attached by an OAS verifier.

Type-only declaration; it is not a runtime value.

Signature
interface LineageAuthorityContext {
    readonly subject: Did;
    readonly source: string;
    readonly root: Did;
    readonly path: readonly Did[];
    readonly finalizedBlock: number;
    readonly pathKind: string;
    readonly scopes: readonly string[];
    readonly generation: number;
    readonly rootKind?: string;
    readonly orgRootCommitment?: string;
    readonly expiresAt?: string;
}

Source: @openagentid/sdk@0.7.2, dist/verification.d.ts:19.

Logger

Logger interface — structured, dependency-free.

Type-only declaration; it is not a runtime value.

Signature
interface Logger {
    debug(msg: string, fields?: Record<string, unknown>): void;
    info(msg: string, fields?: Record<string, unknown>): void;
    warn(msg: string, fields?: Record<string, unknown>): void;
    error(msg: string, fields?: Record<string, unknown>): void;
}

Source: @openagentid/sdk@0.7.2, dist/config.d.ts:58.

OpenAgentClients

Forward-declared clients for the three wrapped subsystems.

Concrete interfaces live in the per-module files so that this config file does not depend on internal implementation details.

Type-only declaration; it is not a runtime value.

Signature
interface OpenAgentClients {
    readonly identity?: unknown;
    readonly credentials?: unknown;
    readonly verification?: unknown;
}

Source: @openagentid/sdk@0.7.2, dist/config.d.ts:72.

OpenAgentConfig

Global SDK configuration.

All fields are optional at construction. Identity, credentials and request verification each require their configured client when used. For a complete file-backed Node identity authority, use the separate SDK ./local export.

Type-only declaration; it is not a runtime value.

Signature
interface OpenAgentConfig {
    namespace?: string;
    endpoints?: {
        oasResolver?: string;
        arsenalBroker?: string;
        aegisVerifier?: string;
    };
    fetch?: typeof fetch;
    logger?: Logger;
    requestTimeoutMs?: number;
    clients?: OpenAgentClients;
}

Source: @openagentid/sdk@0.7.2, dist/config.d.ts:84.

ResolvedOpenAgentConfig

Resolved configuration with all defaults applied.

Type-only declaration; it is not a runtime value.

Signature
interface ResolvedOpenAgentConfig {
    namespace: string;
    endpoints: {
        oasResolver?: string;
        arsenalBroker?: string;
        aegisVerifier?: string;
    };
    fetch: typeof fetch;
    logger: Logger;
    requestTimeoutMs: number;
    clients: OpenAgentClients;
}

Source: @openagentid/sdk@0.7.2, dist/config.d.ts:113.

SignedAssertion

Signed credential returned by the identity provider.

Type-only declaration; it is not a runtime value.

Signature
interface SignedAssertion {
    token: string;
    signature: string;
    signer: Did;
    issuedAt: number;
    expiresAt: number;
}

Source: @openagentid/sdk@0.7.2, dist/identity.d.ts:32.

SkillId

A skill identifier such as frontend-design or sql-query.

Type-only declaration; it is not a runtime value.

Signature
type SkillId = string;

Source: @openagentid/sdk@0.7.2, dist/skills.d.ts:14.

SkillsPolicy

The minimum contract the OpenAgent SDK expects from a skills policy.

Type-only declaration; it is not a runtime value.

Signature
interface SkillsPolicy {
    canInvoke(skill: SkillId): boolean;
    assertCanInvoke(skill: SkillId): void;
    listAllowed(): readonly SkillId[];
    grant(skill: SkillId): SkillsPolicy;
    revoke(skill: SkillId): SkillsPolicy;
}

Source: @openagentid/sdk@0.7.2, dist/skills.d.ts:16.

VerificationClient

AEGIS verifier facade. Concrete implementation lives in @openagentid/aegis-sdk.

The OpenAgent SDK never decodes assertions itself — it delegates to AEGIS for all verification, lineage walking, and policy evaluation.

Type-only declaration; it is not a runtime value.

Signature
interface VerificationClient {
    verifyRequest(req: Request, options?: VerifyRequestOptions): Promise<AuthContext>;
    issueChallenge(): Promise<{
        challenge: Uint8Array;
        challengeId: string;
    }>;
    verifyChallengeResponse(params: {
        challengeId: string;
        agentDid: Did;
        signatureBase64: string;
    }): Promise<AuthContext>;
}

Source: @openagentid/sdk@0.7.2, dist/verification.d.ts:81.

VerifyRequestOptions

Options for {@link VerificationClient.verifyRequest}.

Type-only declaration; it is not a runtime value.

Signature
interface VerifyRequestOptions {
    requiredScopes?: readonly string[];
    requiredAncestor?: Did;
    requirePrivilegedAuthority?: boolean;
    requiredAuthorityPath?: string;
    clockSkewSeconds?: number;
}

Source: @openagentid/sdk@0.7.2, dist/verification.d.ts:63.

Package requirements

Dependencies

PackagePublished range
zod^3.23.8
jose^5.10.0
@noble/hashes^1.8.0
@scure/base^1.2.6

Peer dependencies

PackagePublished rangeOptional
@openagentid/aegis-sdk^0.1.0Yes
@openagentid/arsenal-sdk^0.1.0Yes
@openagentid/crypto-wasm^0.1.0Yes
@openagentid/oas-sdk^1.0.2Yes

Archive verification

Pinned integrity:

SHA-512 integrity
sha512-9YlDb02di8sGffhuMOwNAQa/M3oBrhaqPc7t+qBltdoQRCqlxDmYB/nTRSB4eZgwE4lvM4TKzI72nJtJSVm/ww==

Machine-readable API manifest · Coverage

On this page