@openagentid/sdk/identity
API contract shipped by @openagentid/sdk 0.7.2. Exact exports, signatures, dependencies and availability.
All packages · Runnable examples · Start an agent
| Contract | Value |
|---|---|
| Package | @openagentid/sdk@0.7.2 |
| Entry point | @openagentid/sdk/identity |
| Availability | Current integration path |
| Reference source | Published TypeScript declarations |
| Package engines | node >=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.
| Condition | Published file |
|---|---|
| types | ./dist/identity.d.ts |
| import | ./dist/identity.js |
| require | ./dist/identity.cjs |
Exports
avatarExpressionSchemacharacterAppearanceSchemaDid— typeIdentityDocument— typeidentityDocumentSchemaIdentityProvider— typeparseIdentityDocumentSignedAssertion— typetoIdentityProvider
avatarExpressionSchema
declare const avatarExpressionSchema: z.ZodEnum<[
"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/identity.d.ts:100.
characterAppearanceSchema
Versioned body/face selection. Runtime expression and gaze are independent.
declare const characterAppearanceSchema: z.ZodEffects<z.ZodObject<{
skin: z.ZodEnum<[
CharacterSkin,
...CharacterSkin[]
]>;
skinVersion: z.ZodOptional<z.ZodLiteral<1>>;
eyeStyle: z.ZodOptional<z.ZodLiteral<"live-v1">>;
finish: z.ZodOptional<z.ZodEnum<[
"plush",
"flat"
]>>;
eyePlacement: z.ZodOptional<z.ZodEnum<[
"face",
"raised"
]>>;
shape: z.ZodOptional<z.ZodEnum<[
NonNullable<CharacterShape | undefined>,
...NonNullable<CharacterShape | undefined>[]
]>>;
accessories: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodEnum<[
"glasses",
"headphones"
]>, "many">, readonly CharacterAccessory[], ("glasses" | "headphones")[]>>;
}, "strict", z.ZodTypeAny, {
skin: CharacterSkin;
skinVersion?: 1 | undefined;
eyeStyle?: "live-v1" | undefined;
finish?: "flat" | "plush" | undefined;
eyePlacement?: "face" | "raised" | undefined;
shape?: NonNullable<CharacterShape | undefined> | undefined;
accessories?: readonly CharacterAccessory[] | undefined;
}, {
skin: CharacterSkin;
skinVersion?: 1 | undefined;
eyeStyle?: "live-v1" | undefined;
finish?: "flat" | "plush" | undefined;
eyePlacement?: "face" | "raised" | undefined;
shape?: NonNullable<CharacterShape | undefined> | undefined;
accessories?: ("glasses" | "headphones")[] | undefined;
}>, {
skin: CharacterSkin;
skinVersion?: 1 | undefined;
eyeStyle?: "live-v1" | undefined;
finish?: "flat" | "plush" | undefined;
eyePlacement?: "face" | "raised" | undefined;
shape?: NonNullable<CharacterShape | undefined> | undefined;
accessories?: readonly CharacterAccessory[] | undefined;
}, {
skin: CharacterSkin;
skinVersion?: 1 | undefined;
eyeStyle?: "live-v1" | undefined;
finish?: "flat" | "plush" | undefined;
eyePlacement?: "face" | "raised" | undefined;
shape?: NonNullable<CharacterShape | undefined> | undefined;
accessories?: ("glasses" | "headphones")[] | undefined;
}>;Source: @openagentid/sdk@0.7.2, dist/identity.d.ts:59.
Did
Fully qualified did:oas identifier.
Type-only declaration; it is not a runtime value.
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.
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.
identityDocumentSchema
Runtime-validated identity document schema.
declare const identityDocumentSchema: z.ZodObject<{
did: z.ZodEffects<z.ZodString, string, string>;
parent: z.ZodEffects<z.ZodString, string, string>;
publicKeyMultibase: z.ZodString;
kind: z.ZodString;
scopes: z.ZodReadonly<z.ZodArray<z.ZodString, "many">>;
createdAt: z.ZodString;
avatarOverride: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | null | undefined, string | null | undefined>;
avatarSkin: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodObject<{
skin: z.ZodEnum<[
CharacterSkin,
...CharacterSkin[]
]>;
skinVersion: z.ZodOptional<z.ZodLiteral<1>>;
eyeStyle: z.ZodOptional<z.ZodLiteral<"live-v1">>;
finish: z.ZodOptional<z.ZodEnum<[
"plush",
"flat"
]>>;
eyePlacement: z.ZodOptional<z.ZodEnum<[
"face",
"raised"
]>>;
shape: z.ZodOptional<z.ZodEnum<[
NonNullable<CharacterShape | undefined>,
...NonNullable<CharacterShape | undefined>[]
]>>;
accessories: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodEnum<[
"glasses",
"headphones"
]>, "many">, readonly CharacterAccessory[], ("glasses" | "headphones")[]>>;
}, "strict", z.ZodTypeAny, {
skin: CharacterSkin;
skinVersion?: 1 | undefined;
eyeStyle?: "live-v1" | undefined;
finish?: "flat" | "plush" | undefined;
eyePlacement?: "face" | "raised" | undefined;
shape?: NonNullable<CharacterShape | undefined> | undefined;
accessories?: readonly CharacterAccessory[] | undefined;
}, {
skin: CharacterSkin;
skinVersion?: 1 | undefined;
eyeStyle?: "live-v1" | undefined;
finish?: "flat" | "plush" | undefined;
eyePlacement?: "face" | "raised" | undefined;
shape?: NonNullable<CharacterShape | undefined> | undefined;
accessories?: ("glasses" | "headphones")[] | undefined;
}>, {
skin: CharacterSkin;
skinVersion?: 1 | undefined;
eyeStyle?: "live-v1" | undefined;
finish?: "flat" | "plush" | undefined;
eyePlacement?: "face" | "raised" | undefined;
shape?: NonNullable<CharacterShape | undefined> | undefined;
accessories?: readonly CharacterAccessory[] | undefined;
}, {
skin: CharacterSkin;
skinVersion?: 1 | undefined;
eyeStyle?: "live-v1" | undefined;
finish?: "flat" | "plush" | undefined;
eyePlacement?: "face" | "raised" | undefined;
shape?: NonNullable<CharacterShape | undefined> | undefined;
accessories?: ("glasses" | "headphones")[] | undefined;
}>>>;
avatarExpression: z.ZodOptional<z.ZodEnum<[
"neutral",
"attentive",
"surprised",
"excited",
"happy",
"laughing",
"angry",
"sad",
"scared",
"suspicious",
"confused",
"curious",
"proud",
"shy",
"unimpressed",
"sleepy",
"thoughtful",
"concerned"
]>>;
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, "strict", z.ZodTypeAny, {
parent: string;
scopes: readonly string[];
kind: string;
did: string;
publicKeyMultibase: string;
createdAt: string;
metadata?: Record<string, unknown> | undefined;
avatarOverride?: string | null | undefined;
avatarSkin?: {
skin: CharacterSkin;
skinVersion?: 1 | undefined;
eyeStyle?: "live-v1" | undefined;
finish?: "flat" | "plush" | undefined;
eyePlacement?: "face" | "raised" | undefined;
shape?: NonNullable<CharacterShape | undefined> | undefined;
accessories?: readonly CharacterAccessory[] | undefined;
} | null | undefined;
avatarExpression?: "neutral" | "attentive" | "surprised" | "excited" | "happy" | "laughing" | "angry" | "sad" | "scared" | "suspicious" | "confused" | "curious" | "proud" | "shy" | "unimpressed" | "sleepy" | "thoughtful" | "concerned" | undefined;
}, {
parent: string;
scopes: readonly string[];
kind: string;
did: string;
publicKeyMultibase: string;
createdAt: string;
metadata?: Record<string, unknown> | undefined;
avatarOverride?: string | null | undefined;
avatarSkin?: {
skin: CharacterSkin;
skinVersion?: 1 | undefined;
eyeStyle?: "live-v1" | undefined;
finish?: "flat" | "plush" | undefined;
eyePlacement?: "face" | "raised" | undefined;
shape?: NonNullable<CharacterShape | undefined> | undefined;
accessories?: ("glasses" | "headphones")[] | undefined;
} | null | undefined;
avatarExpression?: "neutral" | "attentive" | "surprised" | "excited" | "happy" | "laughing" | "angry" | "sad" | "scared" | "suspicious" | "confused" | "curious" | "proud" | "shy" | "unimpressed" | "sleepy" | "thoughtful" | "concerned" | undefined;
}>;Source: @openagentid/sdk@0.7.2, dist/identity.d.ts:102.
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.
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.
parseIdentityDocument
Validate an untrusted identity document. Throws {@link IdentityError } on failure.
declare function parseIdentityDocument(raw: unknown): IdentityDocument;Source: @openagentid/sdk@0.7.2, dist/identity.d.ts:193.
SignedAssertion
Signed credential returned by the identity provider.
Type-only declaration; it is not a runtime value.
interface SignedAssertion {
token: string;
signature: string;
signer: Did;
issuedAt: number;
expiresAt: number;
}Source: @openagentid/sdk@0.7.2, dist/identity.d.ts:32.
toIdentityProvider
Narrow any unknown value into an {@link IdentityProvider}, or throw.
This is the integration point where @openagentid/oas-sdk's client is adapted into
our interface. When that SDK is finalized, replace the duck-typing below
with a direct import.
declare function toIdentityProvider(client: unknown): IdentityProvider;Source: @openagentid/sdk@0.7.2, dist/identity.d.ts:201.
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.
AvatarExpression
Type-only declaration; it is not a runtime value.
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.
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.
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.
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.
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.
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.
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.
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.
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.
type CreateAgentInput = z.infer<typeof createAgentInputSchema>;Source: @openagentid/sdk@0.7.2, dist/config.d.ts:56.
createAgentInputSchema
Parameters accepted by {@link OpenAgent.createAgent }.
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.
Package requirements
Dependencies
| Package | Published range |
|---|---|
| zod | ^3.23.8 |
| jose | ^5.10.0 |
| @noble/hashes | ^1.8.0 |
| @scure/base | ^1.2.6 |
Peer dependencies
| Package | Published range | Optional |
|---|---|---|
| @openagentid/aegis-sdk | ^0.1.0 | Yes |
| @openagentid/arsenal-sdk | ^0.1.0 | Yes |
| @openagentid/crypto-wasm | ^0.1.0 | Yes |
| @openagentid/oas-sdk | ^1.0.2 | Yes |
Archive verification
Pinned integrity:
sha512-9YlDb02di8sGffhuMOwNAQa/M3oBrhaqPc7t+qBltdoQRCqlxDmYB/nTRSB4eZgwE4lvM4TKzI72nJtJSVm/ww==