OpenAgentID documentation
Source referencesTypeScript reference

@openagentid/skills-policy API

Exported TypeScript types, signatures and source documentation.

Package manifest, subpaths, and integration guide.

This reference resolves exported symbols from the package entry point with the TypeScript parser/type checker. It includes declarations and inferred types, not implementation bodies. External dependencies unavailable to the extraction environment can remain unresolved; this is source documentation, not proof that all packages typecheck or are published.

AuditChain

export declare class AuditChain {
  length(): number;
  isEmpty(): boolean;
  head(): string;
  get(sequence: number): Receipt | undefined;
  all(): readonly Receipt[];
  verify(): boolean;
  append(skill: string, agent: string, session: string, invokedAt: Date, level: AuditLevel, args: unknown): Receipt;
}

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/audit.ts:34.

Receipt

export interface Receipt {
    sequence: number;
    skill: string;
    agent: string;
    session: string;
    invokedAt: string;
    auditLevel: AuditLevel;
    argumentsHash: string;
    arguments?: unknown;
    previousHash: string;
    receiptHash: string;
}

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/audit.ts:21.

HASH_LEN

export declare const HASH_LEN: 32;

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/audit.ts:17.

Did

export declare class Did {
  parse(input: string): Did;
  toString(): string;
  equals(other: Did): boolean;
  asString(): string;
}

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/did.ts:13.

InvocationContext

Context describing a single attempted skill invocation. Immutable; builder-style helpers return new instances.

export declare class InvocationContext {
  agentDid: Did;
  sessionId: string;
  arguments: unknown;
  invokedAt: Date;
  consentGranted: boolean;
  constructor(init: InvocationContextInit): InvocationContext;
  withConsent(): InvocationContext;
  withInvokedAt(invokedAt: Date): InvocationContext;
}

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/engine.ts:52.

SkillsPolicy

export declare class SkillsPolicy {
  fromYaml(yaml: string): SkillsPolicy;
  fromFile(path: string): Promise<SkillsPolicy>;
  agent(): Did;
  hasRule(skill: string): boolean;
  auditChain(): AuditChain;
  resetRateLimit(skill: string): void;
  canInvoke(skill: string, ctx: InvocationContext): void;
  recordInvocation(skill: string, ctx: InvocationContext): Receipt;
}

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/engine.ts:88.

ArgumentConstraintError

export declare class ArgumentConstraintError {
  name: "ArgumentConstraintError";
  skill: string;
  details: string;
  constructor(skill: string, details: string): ArgumentConstraintError;
}

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/errors.ts:63.

ConsentRequiredError

export declare class ConsentRequiredError {
  name: "ConsentRequiredError";
  skill: string;
  constructor(skill: string): ConsentRequiredError;
}

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/errors.ts:87.

InvalidPolicyError

export declare class InvalidPolicyError {
  name: "InvalidPolicyError";
  constructor(message: string): InvalidPolicyError;
}

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/errors.ts:17.

InvalidSkillsMarkdownError

export declare class InvalidSkillsMarkdownError {
  name: "InvalidSkillsMarkdownError";
  constructor(message: string): InvalidSkillsMarkdownError;
}

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/errors.ts:25.

NotAllowedError

export declare class NotAllowedError {
  name: "NotAllowedError";
  skill: string;
  reason: string;
  constructor(skill: string, reason: string): NotAllowedError;
}

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/errors.ts:33.

OutsideTimeWindowError

export declare class OutsideTimeWindowError {
  name: "OutsideTimeWindowError";
  skill: string;
  constructor(skill: string): OutsideTimeWindowError;
}

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/errors.ts:75.

RateLimitExceededError

export declare class RateLimitExceededError {
  name: "RateLimitExceededError";
  skill: string;
  used: number;
  max: number;
  windowSecs: number;
  constructor(skill: string, used: number, max: number, windowSecs: number): RateLimitExceededError;
}

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/errors.ts:45.

SkillsPolicyError

Typed error hierarchy for the skills policy engine.

Each failing dimension has its own subclass so callers can pattern-match with instanceof rather than parsing error messages.

export declare class SkillsPolicyError {
  name: string;
  constructor(message: string): SkillsPolicyError;
}

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/errors.ts:8.

RateLimiter

export declare class RateLimiter {
  checkAndRecord(skill: string, limit: RateLimit, nowSecs: number): RateLimitDecision;
  reset(skill: string): void;
  snapshot(): Array<[string, number]>;
}

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/rate.ts:16.

RateLimitDecision

export type RateLimitDecision = {
    kind: "allowed";
} | {
    kind: "denied";
    used: number;
};

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/rate.ts:12.

AuditLevel

export type AuditLevel = z.infer<typeof AuditLevelSchema>;

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/schema.ts:15.

CURRENT_VERSION

export declare const CURRENT_VERSION: 1;

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/schema.ts:11.

DefaultRule

export type DefaultRule = z.infer<typeof DefaultRuleSchema>;

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/schema.ts:50.

MAX_SKILL_RULES

export declare const MAX_SKILL_RULES: 256;

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/schema.ts:12.

RateLimit

export type RateLimit = z.infer<typeof RateLimitSchema>;

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/schema.ts:21.

SkillRule

export type SkillRule = z.infer<typeof SkillRuleSchema>;

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/schema.ts:42.

SkillsPolicyDoc

export type SkillsPolicyDoc = z.infer<typeof SkillsPolicyDocSchema>;

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/schema.ts:69.

TimeWindow

export type TimeWindow = z.infer<typeof TimeWindowSchema>;

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/schema.ts:28.

SkillEntry

export interface SkillEntry {
    readonly name: string;
    readonly description: string;
}

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/skillsMd.ts:14.

SkillsManifest

export declare class SkillsManifest {
  skills: readonly SkillEntry[];
  fromMarkdown(input: string): SkillsManifest;
  fromFile(path: string): Promise<SkillsManifest>;
  length(): number;
  isEmpty(): boolean;
  get(name: string): SkillEntry | undefined;
  names(): string[];
}

Source: openagent-sdk/crates/openagent-skills-policy/typescript/src/skillsMd.ts:19.

On this page