OpenAgentIDDocumentation
API referencenpm packages@openagentid/sdk
OpenAgentIDAPI reference

@openagentid/sdk/errors

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/errors
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/errors.d.ts
import./dist/errors.js
require./dist/errors.cjs

Exports

ConfigError

Configuration or usage violation (invalid input, missing dependency).

Signature
declare class ConfigError extends OpenAgentError {
    constructor(message: string, context?: Record<string, unknown>);
}

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

CredentialError

Arsenal credentials subsystem failure.

Signature
declare class CredentialError extends OpenAgentError {
    constructor(message: string, details: ErrorDetails);
}

Source: @openagentid/sdk@0.7.2, dist/errors.d.ts:80.

ErrorCode

Stable machine-readable error codes. These are part of the SDK's public contract and MUST stay in sync with the Rust reference implementation.

Signature
declare const ErrorCode: {
    readonly INVALID_CONFIG: "openagent/invalid-config";
    readonly INVALID_INPUT: "openagent/invalid-input";
    readonly NOT_INITIALIZED: "openagent/not-initialized";
    readonly IDENTITY_CREATE_FAILED: "openagent/identity/create-failed";
    readonly IDENTITY_RESOLVE_FAILED: "openagent/identity/resolve-failed";
    readonly IDENTITY_SIGNATURE_INVALID: "openagent/identity/signature-invalid";
    readonly IDENTITY_LINEAGE_INVALID: "openagent/identity/lineage-invalid";
    readonly CREDENTIAL_FETCH_FAILED: "openagent/credentials/fetch-failed";
    readonly CREDENTIAL_SCOPE_DENIED: "openagent/credentials/scope-denied";
    readonly CREDENTIAL_PROVIDER_UNKNOWN: "openagent/credentials/provider-unknown";
    readonly CREDENTIAL_EXPIRED: "openagent/credentials/expired";
    readonly VERIFICATION_FAILED: "openagent/verification/failed";
    readonly AUTH_REQUIRED: "openagent/verification/auth-required";
    readonly AUTH_CHALLENGE_INVALID: "openagent/verification/challenge-invalid";
    readonly SKILL_DENIED: "openagent/skills/denied";
    readonly SKILL_UNKNOWN: "openagent/skills/unknown";
    readonly NETWORK_ERROR: "openagent/network-error";
    readonly SERIALIZATION_ERROR: "openagent/serialization-error";
    readonly UNKNOWN: "openagent/unknown";
};

Source: @openagentid/sdk@0.7.2, dist/errors.d.ts:15.

ErrorCodeValue

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

Signature
type ErrorCodeValue = (typeof ErrorCode)[keyof typeof ErrorCode];

Source: @openagentid/sdk@0.7.2, dist/errors.d.ts:36.

ErrorDetails

Structured error metadata attached to every {@link OpenAgentError}.

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

Signature
interface ErrorDetails {
    code: ErrorCodeValue;
    cause?: unknown;
    context?: Record<string, unknown>;
}

Source: @openagentid/sdk@0.7.2, dist/errors.d.ts:38.

getErrorMessage

Narrow an unknown caught value to a human-readable message.

Signature
declare function getErrorMessage(err: unknown): string;

Source: @openagentid/sdk@0.7.2, dist/errors.d.ts:95.

IdentityError

OAS identity subsystem failure.

Signature
declare class IdentityError extends OpenAgentError {
    constructor(message: string, details: ErrorDetails);
}

Source: @openagentid/sdk@0.7.2, dist/errors.d.ts:76.

InputValidationError

Runtime input validation failure (Zod, boundary checks).

Signature
declare class InputValidationError extends OpenAgentError {
    constructor(message: string, cause?: unknown, context?: Record<string, unknown>);
}

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

OpenAgentError

Root of the OpenAgent SDK error hierarchy.

Signature
declare class OpenAgentError extends Error {
    readonly code: ErrorCodeValue;
    readonly cause?: unknown;
    readonly context?: Record<string, unknown>;
    constructor(message: string, details: ErrorDetails);
    toJSON(): Record<string, unknown>;
}

Source: @openagentid/sdk@0.7.2, dist/errors.d.ts:59.

SkillDeniedError

Skills policy denial.

Signature
declare class SkillDeniedError extends OpenAgentError {
    readonly skill: string;
    constructor(skill: string, reason?: string, context?: Record<string, unknown>);
}

Source: @openagentid/sdk@0.7.2, dist/errors.d.ts:88.

VerificationError

AEGIS verification subsystem failure.

Signature
declare class VerificationError extends OpenAgentError {
    constructor(message: string, details: ErrorDetails);
}

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

wrapError

Wraps any non-OpenAgentError into the SDK hierarchy without losing the cause.

Signature
declare function wrapError(err: unknown, fallbackMessage: string): OpenAgentError;

Source: @openagentid/sdk@0.7.2, dist/errors.d.ts:93.

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