@openagentid/aegis-sdk/delegate
API contract shipped by @openagentid/aegis-sdk 0.1.1. Exact exports, signatures, dependencies and availability.
All packages · Runnable examples · Start an agent
| Contract | Value |
|---|---|
| Package | @openagentid/aegis-sdk@0.1.1 |
| Entry point | @openagentid/aegis-sdk/delegate |
| Availability | Published package |
| Reference source | Published TypeScript declarations |
| Package engines | node >=20 |
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/delegate/index.d.ts |
| import | ./dist/delegate/index.js |
Exports
createDelegationProofCreatedSessionKey— typecreateSessionKeyDelegationStore— typeDelegationTreeInMemoryDelegationStoreInMemoryRevocationStoreintersectScopesisScopeSubsetRevocationRegistryRevocationStore— typevalidateScopeverifyDelegationProof
createDelegationProof
Create a delegation proof by signing the delegation with the delegator's key.
Steps per spec §9.7:
- Construct delegation object (excluding proof field)
- Canonicalize via JCS (RFC 8785)
- Sign canonical bytes with delegator's delegation key (Ed25519)
declare function createDelegationProof(params: {
delegatorDid: string;
delegateDid: string;
scope: DelegationScope;
expires?: string | null;
signingKey: Uint8Array;
verificationMethod: string;
}): Delegation;Source: @openagentid/aegis-sdk@0.1.1, dist/delegate/index.d.ts:33.
CreatedSessionKey
Type-only declaration; it is not a runtime value.
interface CreatedSessionKey {
sessionKey: SessionKey;
ephemeralSigningKey: Uint8Array;
ephemeralVerifyingKey: Uint8Array;
}Source: @openagentid/aegis-sdk@0.1.1, dist/delegate/index.d.ts:58.
createSessionKey
Create a session key (temporary, scoped, max 24h).
Generates a fresh Ed25519 keypair for the session and signs the grant with the principal's identity key.
declare function createSessionKey(params: {
principalDid: string;
scope: DelegationScope;
maxTransactions?: number | null;
lifetimeMs: number;
principalSigningKey: Uint8Array;
verificationMethod: string;
}): CreatedSessionKey;Source: @openagentid/aegis-sdk@0.1.1, dist/delegate/index.d.ts:70.
DelegationStore
Type-only declaration; it is not a runtime value.
interface DelegationStore {
storeDelegation(delegation: Delegation): Promise<void>;
getDelegation(id: string): Promise<Delegation | null>;
listByDelegator(delegatorDid: string, pagination?: Pagination): Promise<Delegation[]>;
listByDelegate(delegateDid: string, pagination?: Pagination): Promise<Delegation[]>;
deleteDelegation(id: string): Promise<boolean>;
}Source: @openagentid/aegis-sdk@0.1.1, dist/store-BqzEijTF.d.ts:33.
DelegationTree
declare class DelegationTree {
readonly maxDepth: number;
constructor(maxDepth?: number);
addDelegation(delegation: Delegation): void;
getDelegationChain(delegateDid: string): Delegation[];
effectiveScope(delegateDid: string): DelegationScope | null;
depth(delegateDid: string): number;
revoke(delegationId: string): string[];
}Source: @openagentid/aegis-sdk@0.1.1, dist/store-BqzEijTF.d.ts:3.
InMemoryDelegationStore
declare class InMemoryDelegationStore implements DelegationStore {
storeDelegation(delegation: Delegation): Promise<void>;
getDelegation(id: string): Promise<Delegation | null>;
listByDelegator(delegatorDid: string, pagination?: Pagination): Promise<Delegation[]>;
listByDelegate(delegateDid: string, pagination?: Pagination): Promise<Delegation[]>;
deleteDelegation(id: string): Promise<boolean>;
}Source: @openagentid/aegis-sdk@0.1.1, dist/store-BqzEijTF.d.ts:40.
InMemoryRevocationStore
declare class InMemoryRevocationStore implements RevocationStore {
revoke(delegationId: string): Promise<void>;
isRevoked(delegationId: string): Promise<boolean>;
revokeBatch(ids: readonly string[]): Promise<void>;
}Source: @openagentid/aegis-sdk@0.1.1, dist/store-BqzEijTF.d.ts:53.
intersectScopes
Compute the intersection of two scopes.
- Empty list = wildcard, take the other side
- Otherwise, set intersection
- For limits, take the most restrictive value
declare function intersectScopes(a: DelegationScope, b: DelegationScope): DelegationScope;Source: @openagentid/aegis-sdk@0.1.1, dist/delegate/index.d.ts:19.
isScopeSubset
Returns true if child scope is a subset of parent scope.
Empty fields on parent mean "wildcard" — they accept any child value.
Limits on child must be at least as restrictive as the parent's.
declare function isScopeSubset(child: DelegationScope, parent: DelegationScope): boolean;Source: @openagentid/aegis-sdk@0.1.1, dist/delegate/index.d.ts:11.
RevocationRegistry
declare class RevocationRegistry {
revoke(delegationId: string): void;
isRevoked(delegationId: string): boolean;
revokeCascade(ids: readonly string[]): void;
size(): number;
}Source: @openagentid/aegis-sdk@0.1.1, dist/delegate/index.d.ts:49.
RevocationStore
Type-only declaration; it is not a runtime value.
interface RevocationStore {
revoke(delegationId: string): Promise<void>;
isRevoked(delegationId: string): Promise<boolean>;
revokeBatch(ids: readonly string[]): Promise<void>;
}Source: @openagentid/aegis-sdk@0.1.1, dist/store-BqzEijTF.d.ts:48.
validateScope
declare function validateScope(scope: DelegationScope): void;Source: @openagentid/aegis-sdk@0.1.1, dist/delegate/index.d.ts:20.
verifyDelegationProof
Verify a delegation proof against the delegator's public key.
Reconstructs the canonical form of the delegation (without the proof), then verifies the Ed25519 signature in the proof's JWS field.
declare function verifyDelegationProof(delegation: Delegation, delegatorPublicKey: Uint8Array): boolean;Source: @openagentid/aegis-sdk@0.1.1, dist/delegate/index.d.ts:47.
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.
ActiveHours
Type-only declaration; it is not a runtime value.
interface ActiveHours {
startHour: number;
endHour: number;
timezone: string;
}Source: @openagentid/aegis-sdk@0.1.1, dist/types-Ck8QCcs2.d.ts:126.
Delegation
Type-only declaration; it is not a runtime value.
interface Delegation {
id: string;
delegator: string;
delegate: string;
scope: DelegationScope;
created: string;
expires?: string | null;
revocable: boolean;
proof: DelegationProof;
}Source: @openagentid/aegis-sdk@0.1.1, dist/types-Ck8QCcs2.d.ts:157.
DelegationProof
Type-only declaration; it is not a runtime value.
interface DelegationProof {
type: "AegisDelegationProof2025";
verificationMethod: string;
created: string;
jws: string;
}Source: @openagentid/aegis-sdk@0.1.1, dist/types-Ck8QCcs2.d.ts:151.
DelegationScope
Type-only declaration; it is not a runtime value.
interface DelegationScope {
actions: string[];
resources: string[];
chains: string[];
limits?: SpendingLimits | null;
temporal?: TemporalConstraints | null;
}Source: @openagentid/aegis-sdk@0.1.1, dist/types-Ck8QCcs2.d.ts:144.
Pagination
Type-only declaration; it is not a runtime value.
interface Pagination {
limit: number;
offset: number;
}Source: @openagentid/aegis-sdk@0.1.1, dist/types-Ck8QCcs2.d.ts:204.
SessionKey
Type-only declaration; it is not a runtime value.
interface SessionKey {
sessionKey: string;
principal: string;
scope: DelegationScope;
maxTransactions?: number | null;
created: string;
expires: string;
proof: DelegationProof;
}Source: @openagentid/aegis-sdk@0.1.1, dist/types-Ck8QCcs2.d.ts:167.
SpendingLimits
Type-only declaration; it is not a runtime value.
interface SpendingLimits {
maxAmount?: string | null;
dailyVolume?: string | null;
assetAllowlist: string[];
recipientAllowlist: string[];
approvalThreshold?: string | null;
}Source: @openagentid/aegis-sdk@0.1.1, dist/types-Ck8QCcs2.d.ts:137.
TemporalConstraints
Type-only declaration; it is not a runtime value.
interface TemporalConstraints {
validFrom?: string | null;
validUntil?: string | null;
activeHours?: ActiveHours | null;
cooldown?: string | null;
}Source: @openagentid/aegis-sdk@0.1.1, dist/types-Ck8QCcs2.d.ts:131.
Package requirements
Dependencies
| Package | Published range |
|---|---|
| uuid | ^11.0.0 |
| zod | ^3.23.0 |
Archive verification
Pinned integrity:
sha512-eKG79P17teM8i+ZQaNdBEPJnL0XT9723i04kDxgVRrOb0VOnNW5rt2doLq8g4mHBZ4rjHdPEuzZmj5LsL4iuVw==