/** * PEAC Kernel Types * Shared type definitions for kernel exports */ /** * JSON-safe primitive value * * Represents values that can be directly serialized to JSON. */ export type JsonPrimitive = string | number | boolean | null; /** * JSON-safe value (recursive) * * Use for any data that must be JSON-serializable. * Excludes undefined, functions, symbols, BigInt, Date, etc. */ export type JsonValue = JsonPrimitive | JsonArray | JsonObject; /** * JSON-safe array */ export type JsonArray = JsonValue[]; /** * JSON-safe object * * Use for opaque/extensible evidence fields instead of `unknown`. * Provides JSON-serializability guarantee without requiring full type knowledge. * * @example * // Before (type hole) * evidence: unknown; * * // After (JSON-safe guarantee) * evidence: JsonObject; */ export type JsonObject = { [key: string]: JsonValue; }; export { ERROR_CATEGORIES } from './error-categories.generated.js'; export type { ErrorCategory } from './error-categories.generated.js'; /** * Agent-actionable recovery hint. * * Best-effort guidance for agents; servers MAY change mappings between versions * without breaking the protocol. Agents SHOULD NOT build hard dependencies on * specific next_action values for specific error codes. */ export type NextAction = 'retry_after_delay' | 'retry_with_different_key' | 'retry_with_different_input' | 'refresh_attestation' | 'contact_issuer' | 'abort' | 'none'; /** * Error code definition * * The category type is generated from specs/kernel/errors.json by codegen-errors.ts. * Run: npx tsx scripts/codegen-errors.ts */ export interface ErrorDefinition { code: string; http_status: number; title: string; description: string; retryable: boolean; next_action: NextAction; category: import('./error-categories.generated.js').ErrorCategory; } /** * Payment rail registry entry */ export interface PaymentRailEntry { id: string; category: string; description: string; reference: string | null; status: string; } /** * Control engine registry entry */ export interface ControlEngineEntry { id: string; category: string; description: string; reference: string | null; status: string; } /** * Transport method registry entry */ export interface TransportMethodEntry { id: string; category: string; description: string; reference: string | null; status: string; } /** * Agent protocol registry entry */ export interface AgentProtocolEntry { id: string; category: string; description: string; reference: string | null; status: string; } /** * The two structural kind values for Wire 0.2 envelopes (closed forever). * Open semantic meaning is expressed via the 'type' field (reverse-DNS or URI). */ export type Wire02Kind = 'evidence' | 'challenge'; /** * The 10 closed pillar values (positioning and compliance-mapping frame). * When present in a receipt, pillars MUST be sorted alphabetically and unique. */ export type EvidencePillar = 'access' | 'attribution' | 'commerce' | 'compliance' | 'consent' | 'identity' | 'privacy' | 'provenance' | 'purpose' | 'safety'; //# sourceMappingURL=types.d.ts.map