import { Fact, FactContentRelationship } from '@happyvertical/smrt-facts'; import { DatabaseInterface } from '@happyvertical/sql'; import { Content } from './content'; export type ContentReviewKind = 'facts' | 'safety' | 'custom'; export type ContentReviewStatus = 'pending' | 'passed' | 'flagged' | 'failed' | 'waived'; export type ContentReviewSeverity = 'info' | 'warning' | 'error'; export type ContentVersionKind = 'manual' | 'draft' | 'review' | 'publication' | 'correction' | 'auto-generated'; export type ContentCorrectionType = 'fact' | 'safety' | 'copy' | 'custom'; export type ContentCorrectionStatus = 'draft' | 'published' | 'retracted'; export interface ContentReviewFinding { severity: ContentReviewSeverity; title: string; detail: string; factId?: string; quote?: string; suggestedChange?: string; ruleId?: string; } export interface ContentReviewResult { status: ContentReviewStatus; summary: string; findings: ContentReviewFinding[]; } export interface ContentReviewRequirement { policyKey: string; label?: string; blocking?: boolean; acceptedStatuses?: ContentReviewStatus[]; } export interface ContentReviewProfileEvaluationItem { kind: ContentReviewKind; policyKey: string; label: string; blocking: boolean; acceptedStatuses: ContentReviewStatus[]; missing: boolean; stale: boolean; executed: boolean; satisfied: boolean; latestReviewId: string | null; latestStatus: ContentReviewStatus | null; latestSummary: string | null; } export interface ContentReviewProfileEvaluation { profileKey: string; ready: boolean; complete: boolean; requirements: ContentReviewProfileEvaluationItem[]; } export interface ContentReviewPolicyDefinition { key: string; label: string; kind: ContentReviewKind; instructions: string; enabled?: boolean; metadata?: Record; } export interface ContentGovernanceProfileDefinition { key: string; label: string; description?: string; enabled?: boolean; requirements: ContentReviewRequirement[]; metadata?: Record; } export interface ContentGovernanceAssignmentDefinition { key?: string; label?: string; contentType: string; contentVariant?: string | null; enabled?: boolean; factLinkingEnabled?: boolean; transparencyEnabled?: boolean; publicationProfileKey?: string | null; correctionProfileKey?: string | null; enforcePublishReadiness?: boolean; defaultFactRelationship?: FactContentRelationship; metadata?: Record; } export interface ContentGovernanceConfig { policies: ContentReviewPolicyDefinition[]; profiles: ContentGovernanceProfileDefinition[]; assignments: ContentGovernanceAssignmentDefinition[]; } export interface PersistedContentGovernancePolicyRecord extends ContentReviewPolicyDefinition { id?: string; tenantId?: string | null; createdAt?: string | null; updatedAt?: string | null; } export interface PersistedContentGovernanceProfileRecord extends ContentGovernanceProfileDefinition { id?: string; tenantId?: string | null; createdAt?: string | null; updatedAt?: string | null; } export interface PersistedContentGovernanceAssignmentRecord extends ContentGovernanceAssignmentDefinition { id?: string; tenantId?: string | null; createdAt?: string | null; updatedAt?: string | null; } export interface PersistedContentGovernanceDefinitions { policies: PersistedContentGovernancePolicyRecord[]; profiles: PersistedContentGovernanceProfileRecord[]; assignments: PersistedContentGovernanceAssignmentRecord[]; } export interface ResolvedContentGovernance { isGoverned: boolean; factLinkingEnabled: boolean; transparencyEnabled: boolean; publicationProfileKey: string | null; correctionProfileKey: string | null; enforcePublishReadiness: boolean; defaultFactRelationship: FactContentRelationship; reviewPolicies: ContentReviewPolicyDefinition[]; availableProfiles: ContentGovernanceProfileDefinition[]; assignment: ContentGovernanceAssignmentDefinition | null; } export interface ContentGovernanceState extends ResolvedContentGovernance { reviewProfiles: ContentReviewProfileEvaluation[]; } export interface CreateContentVersionOptions { kind?: ContentVersionKind; summary?: string; metadata?: Record; snapshot?: Record; } export interface RunContentReviewOptions { kind?: ContentReviewKind; policyKey?: string; reviewer?: string; instructions?: string; facts?: Fact[]; factIds?: string[]; metadata?: Record; createVersion?: boolean; } export interface IssueContentCorrectionOptions { correctionType?: ContentCorrectionType; factId?: string; correctedFactText?: string; summary: string; incorrectText?: string; correctedText?: string; publicNote?: string; metadata?: Record; createVersion?: boolean; publish?: boolean; } export interface BuildContentReviewPromptOptions { kind: ContentReviewKind; content: Pick; facts?: Fact[]; policy?: ContentReviewPolicyDefinition | null; customInstructions?: string; } export interface ResolveContentGovernanceOptions { contentType?: string | null; contentVariant?: string | null; db?: DatabaseInterface | null; tenantId?: string | null; } export declare function buildContentGovernanceAssignmentKey(contentType: string, contentVariant?: string | null): string; export declare function getFallbackPolicyKind(key: string): ContentReviewKind; export declare function loadPersistedContentGovernanceDefinitions(options?: { db?: DatabaseInterface | null; tenantId?: string | null; }): Promise; export declare function getContentGovernanceConfig(): ContentGovernanceConfig; export declare function getStaticContentGovernanceConfig(): ContentGovernanceConfig; export declare function configureContentGovernance(config: Partial): ContentGovernanceConfig; export declare function resetContentGovernanceConfig(): ContentGovernanceConfig; export declare function getEffectiveContentGovernanceConfig(options?: { db?: DatabaseInterface | null; tenantId?: string | null; }): Promise; export declare function hasStaticContentGovernancePolicy(key: string): boolean; export declare function hasStaticContentGovernanceProfile(key: string): boolean; export declare function getContentReviewPolicy(policyKey: string, policies?: ContentReviewPolicyDefinition[]): ContentReviewPolicyDefinition | null; export declare function getContentReviewKind(policyKey: string, policies?: ContentReviewPolicyDefinition[]): ContentReviewKind; export declare function getContentReviewProfile(profileKey: string, profiles?: ContentGovernanceProfileDefinition[]): ContentGovernanceProfileDefinition | null; export declare function getContentReviewProfileKeys(profiles?: ContentGovernanceProfileDefinition[]): string[]; export declare function getContentReviewPolicies(policies?: ContentReviewPolicyDefinition[]): ContentReviewPolicyDefinition[]; export declare function getContentReviewRequirements(profileKey: string, profiles?: ContentGovernanceProfileDefinition[]): ContentReviewRequirement[]; export declare function getAcceptedContentReviewStatuses(requirement: Pick): ContentReviewStatus[]; export declare function resolveConfiguredContentGovernance(options: Pick): ResolvedContentGovernance; export declare function resolveEffectiveContentGovernance(options: ResolveContentGovernanceOptions): Promise; export declare function buildContentReviewPrompt(options: BuildContentReviewPromptOptions): string; export declare function parseContentReviewResponse(raw: string): ContentReviewResult; //# sourceMappingURL=content-governance.d.ts.map