export type PolicyEffect = 'allow' | 'deny'; export type PolicySubjectKind = 'agent' | 'background' | 'external'; export type PolicyResourceKind = 'automation' | 'credential' | 'evolution' | 'filesystem' | 'goal' | 'memory' | 'message' | 'network' | 'preference' | 'tool' | 'wiki'; export type PolicyInitiator = 'background' | 'external' | 'foreground'; export interface PolicySubject { kind: PolicySubjectKind; id: string; workspace?: string; principal?: string; } export interface PolicyResource { kind: PolicyResourceKind; id: string; } export interface PolicyContext { initiator: PolicyInitiator; } export interface PolicyRequest { subject: PolicySubject; action: string; resource: PolicyResource; context: PolicyContext; } export interface PolicySubjectMatcher { kind?: PolicySubjectKind | '*'; id?: string; workspace?: string; principal?: string; } export interface PolicyResourceMatcher { kind?: PolicyResourceKind | '*'; id?: string; } export interface PolicyContextMatcher { initiators?: PolicyInitiator[]; } export interface PolicyRule { id: string; effect: PolicyEffect; subject?: PolicySubjectMatcher; actions?: string[]; resource?: PolicyResourceMatcher; context?: PolicyContextMatcher; budget?: PolicyBudgetCharge; } export interface PolicyBudgetCharge { id: string; amount: number; } export type DecisionReasonCode = 'default-deny' | 'budget-exhausted' | 'budget-idempotency-required' | 'budget-not-configured' | 'emergency-stop' | 'missing-agent' | 'missing-agent-preset' | 'missing-workspace' | 'rule-allow' | 'rule-deny' | 'tool-default-allow'; export interface PolicyDecision { effect: PolicyEffect; reasonCode: DecisionReasonCode; ruleId: string | undefined; budget?: Readonly; } export interface CompiledPolicy { readonly rules: readonly CompiledPolicyRule[]; } export interface CompiledPolicyRule { readonly id: string; readonly effect: PolicyEffect; readonly subject?: Readonly; readonly actions?: readonly string[]; readonly resource?: Readonly; readonly context?: Readonly<{ initiators?: readonly PolicyInitiator[]; }>; readonly budget?: Readonly; readonly specificity: number; readonly order: number; } //# sourceMappingURL=types.d.ts.map