import { type CompositionResult } from './compose.js'; import { type ArtifactPin, type DecisionResult, type DecisionRuleset, type JsonValue, type RulesetResult } from './types.js'; export declare const DECISION_INTEROP_PROFILE_VERSION: "decision-interop.aiwg.io/v1"; export declare const DECISION_INTEROP_DMN_VERSION: "1.6"; export declare const DECISION_INTEROP_DMN_NAMESPACE: "https://www.omg.org/spec/DMN/20240513/MODEL/"; export type DmnHitPolicy = 'UNIQUE' | 'ANY' | 'FIRST' | 'RULE ORDER' | 'COLLECT'; export type DmnCollectAggregation = 'LIST' | 'SUM' | 'MIN' | 'MAX' | 'COUNT'; export interface DecisionInteropSource { format: 'dmn-xml' | 'opa-profile' | 'aiwg-profile'; version: string; origin: string; digest: `sha256:${string}`; signature: { state: 'not-provided' | 'verified' | 'untrusted'; keyId?: string; }; parser: { id: 'aiwg-decision-interop'; version: typeof DECISION_INTEROP_PROFILE_VERSION; }; bounds: DecisionInteropBoundsReport; } export interface DecisionInteropBounds { maxBytes: number; maxElements: number; maxDepth: number; maxRules: number; maxInputs: number; maxOutputs: number; maxTextBytes: number; maxParseMs: number; } export interface DecisionInteropBoundsReport extends DecisionInteropBounds { bytes: number; elements: number; maxObservedDepth: number; rules: number; inputs: number; outputs: number; parseTimeMs: number; } export interface DecisionInteropDmnProfile { profileVersion: typeof DECISION_INTEROP_PROFILE_VERSION; dmnVersion: typeof DECISION_INTEROP_DMN_VERSION; namespace: typeof DECISION_INTEROP_DMN_NAMESPACE; hitPolicy: DmnHitPolicy; aggregation: DmnCollectAggregation | null; ruleOrder: string[]; supportedUnaryTests: Array<'dash' | 'literal' | 'eq' | 'ne' | 'lt' | 'lte' | 'gt' | 'gte'>; unsupportedConstructs: string[]; extensions: Array<'aiwg:order' | 'aiwg:defer-on-conflict'>; } export interface DecisionInteropMapping { apiVersion: typeof DECISION_INTEROP_PROFILE_VERSION; kind: 'DecisionInteropMapping'; metadata: { id: string; version: string; description: string; }; spec: { source: DecisionInteropSource; dryRun: true; activation: 'requires-review-publish'; profile: DecisionInteropDmnProfile; normalizedRuleset: DecisionRuleset; normalizedDigest: `sha256:${string}`; warnings: string[]; errors: string[]; roundTripStatus: 'not-run' | 'equivalent' | 'not-equivalent'; }; } export interface OpaDecisionLogExport { schemaVersion: typeof DECISION_INTEROP_PROFILE_VERSION; decision_id: string; trace_id?: string; span_id?: string; path: string; timestamp?: string; bundles: Record; result: JsonValue; input: JsonValue; metrics?: Record; labels?: Record; revisionLineage: Array<{ kind: 'ruleset' | 'binding' | 'policy-bundle' | 'calibration'; id: string; version: string; digest: `sha256:${string}`; }>; redaction: { mode: 'default-deny-sensitive'; removed: string[]; }; enforcement: { separated: true; contract: 'decision-only-action-requires-aiwg-authorization'; }; } export interface OpaInteropEnvelope { profileVersion: typeof DECISION_INTEROP_PROFILE_VERSION; input: JsonValue; result?: JsonValue; bundle: { name: string; revision: string; digest?: `sha256:${string}`; }; decisionId: string; traceId?: string; spanId?: string; metrics?: Record; policyPath: string; inputProjectionAllowlist?: string[]; } export declare class DecisionInteropError extends Error { readonly code: string; constructor(code: string, message: string); } export declare function decisionInteropDefaultBounds(overrides?: Partial): DecisionInteropBounds; export declare function importDmnDecisionTable(xml: string, options?: { origin?: string; trustedSource?: boolean; signatureState?: 'not-provided' | 'verified' | 'untrusted'; signatureKeyId?: string; bounds?: Partial; externalDecisionPins?: Record; }): DecisionInteropMapping; export declare function exportDmnDecisionTable(mapping: Pick): string; export declare function evaluateDmnProfile(mapping: Pick, input: unknown, evaluations?: Record): CompositionResult; export declare function exportOpaDecisionLog(result: RulesetResult, envelope: OpaInteropEnvelope): OpaDecisionLogExport; export declare function validateOpaInteropEnvelope(envelope: OpaInteropEnvelope): void; //# sourceMappingURL=interop.d.ts.map