/** * Capability + Agent Metadata + Cedar Schemas * * Runtime validation for capability metadata, the agent identity tile, and * Cedar policy fragments. Cedar fragments are validated only for shape here; * full grammar validation is performed by the dashboard's existing * `compile-policy.ts` before persistence. * * @module @kya-os/consent/schemas/capabilities */ import { z } from "zod"; /** * Risk classification. */ export declare const RiskLevelSchema: z.ZodEnum<["low", "medium", "high", "critical"]>; /** * Allowlist of icon tokens recognized by ``. */ export declare const CapabilityIconSchema: z.ZodEnum<["search", "cart", "card", "pin", "pin-new", "shield", "key", "tools", "user", "calendar", "lock", "eye", "send", "package", "neutral"]>; /** * Cedar policy fragment shape check. Full grammar validation runs in the * dashboard's compile-policy.ts; here we only enforce a length cap and confirm * the fragment opens with the `permit` or `forbid` keyword (the only two valid * Cedar effects). */ export declare const CedarPolicySchema: z.ZodEffects; /** * A single capability row. */ export declare const CapabilitySchema: z.ZodObject<{ id: z.ZodString; label: z.ZodString; description: z.ZodString; icon: z.ZodEnum<["search", "cart", "card", "pin", "pin-new", "shield", "key", "tools", "user", "calendar", "lock", "eye", "send", "package", "neutral"]>; riskLevel: z.ZodEnum<["low", "medium", "high", "critical"]>; defaultOn: z.ZodBoolean; cedar: z.ZodEffects; scopes: z.ZodArray; category: z.ZodOptional; }, "strip", z.ZodTypeAny, { id: string; label: string; description: string; icon: "search" | "cart" | "card" | "pin" | "pin-new" | "shield" | "key" | "tools" | "user" | "calendar" | "lock" | "eye" | "send" | "package" | "neutral"; riskLevel: "low" | "medium" | "high" | "critical"; defaultOn: boolean; cedar: string; scopes: string[]; category?: string | undefined; }, { id: string; label: string; description: string; icon: "search" | "cart" | "card" | "pin" | "pin-new" | "shield" | "key" | "tools" | "user" | "calendar" | "lock" | "eye" | "send" | "package" | "neutral"; riskLevel: "low" | "medium" | "high" | "critical"; defaultOn: boolean; cedar: string; scopes: string[]; category?: string | undefined; }>; export type CapabilitySchemaType = z.infer; /** * Capability group (optional clustering). */ export declare const CapabilityGroupSchema: z.ZodObject<{ id: z.ZodString; label: z.ZodString; capabilities: z.ZodArray; riskLevel: z.ZodEnum<["low", "medium", "high", "critical"]>; defaultOn: z.ZodBoolean; cedar: z.ZodEffects; scopes: z.ZodArray; category: z.ZodOptional; }, "strip", z.ZodTypeAny, { id: string; label: string; description: string; icon: "search" | "cart" | "card" | "pin" | "pin-new" | "shield" | "key" | "tools" | "user" | "calendar" | "lock" | "eye" | "send" | "package" | "neutral"; riskLevel: "low" | "medium" | "high" | "critical"; defaultOn: boolean; cedar: string; scopes: string[]; category?: string | undefined; }, { id: string; label: string; description: string; icon: "search" | "cart" | "card" | "pin" | "pin-new" | "shield" | "key" | "tools" | "user" | "calendar" | "lock" | "eye" | "send" | "package" | "neutral"; riskLevel: "low" | "medium" | "high" | "critical"; defaultOn: boolean; cedar: string; scopes: string[]; category?: string | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { id: string; label: string; capabilities: { id: string; label: string; description: string; icon: "search" | "cart" | "card" | "pin" | "pin-new" | "shield" | "key" | "tools" | "user" | "calendar" | "lock" | "eye" | "send" | "package" | "neutral"; riskLevel: "low" | "medium" | "high" | "critical"; defaultOn: boolean; cedar: string; scopes: string[]; category?: string | undefined; }[]; }, { id: string; label: string; capabilities: { id: string; label: string; description: string; icon: "search" | "cart" | "card" | "pin" | "pin-new" | "shield" | "key" | "tools" | "user" | "calendar" | "lock" | "eye" | "send" | "package" | "neutral"; riskLevel: "low" | "medium" | "high" | "critical"; defaultOn: boolean; cedar: string; scopes: string[]; category?: string | undefined; }[]; }>; export type CapabilityGroupSchemaType = z.infer; /** * Agent identity tile data. */ export declare const AgentMetadataSchema: z.ZodObject<{ name: z.ZodString; did: z.ZodString; vendor: z.ZodOptional; surfaceLabel: z.ZodOptional; verified: z.ZodBoolean; logoUrl: z.ZodOptional; connectedAt: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; did: string; verified: boolean; logoUrl?: string | undefined; vendor?: string | undefined; surfaceLabel?: string | undefined; connectedAt?: string | undefined; }, { name: string; did: string; verified: boolean; logoUrl?: string | undefined; vendor?: string | undefined; surfaceLabel?: string | undefined; connectedAt?: string | undefined; }>; export type AgentMetadataSchemaType = z.infer; /** * Theme selection. */ export declare const ConsentThemeSchema: z.ZodEnum<["light", "dark"]>; export type ConsentThemeSchemaType = z.infer; /** * Cedar template context bound at compile time. */ export declare const CedarTemplateContextSchema: z.ZodObject<{ agent_did: z.ZodString; user_did: z.ZodString; org: z.ZodString; deployment: z.ZodString; }, "strip", z.ZodTypeAny, { agent_did: string; user_did: string; org: string; deployment: string; }, { agent_did: string; user_did: string; org: string; deployment: string; }>; export type CedarTemplateContextSchemaType = z.infer; export declare function validateCapability(value: unknown): z.SafeParseReturnType; export declare function validateCapabilityGroup(value: unknown): z.SafeParseReturnType; export declare function validateAgentMetadata(value: unknown): z.SafeParseReturnType; //# sourceMappingURL=capabilities.schemas.d.ts.map