import { FieldAuditRecord } from './projectFieldAudit'; import { OpSubject, OpSubjectKind } from './opSubject'; export type ActionSubjectKind = OpSubjectKind; /** * 무엇이 바뀐 대상인가. entityRef는 자식(속성/연산/인덱스) subject의 부모(이름 조회·복원 스코프). * 정의는 `opSubject`(어휘 해석 단일 출처)가 갖고 여기선 공개 이름만 유지한다. */ export type ActionSubject = OpSubject; /** 한 대상의 한 필드 변경(old→new / tombstone). */ export interface ActionFieldChange { field: string; value: unknown; oldValue?: unknown; removed?: boolean; } /** 한 seq에서 한 대상에 일어난 액션 — verb + 변경 필드들(born=추가 요약, update=필드별). */ export interface SubjectAction { subject: ActionSubject; verb: 'add' | 'update' | 'remove'; fields: ActionFieldChange[]; } /** 한 seq(= 한 op 배치 = 한 사용자 액션) 그룹. */ export interface ActionGroup { seq: number; ts?: string | number | Date; origin?: string; author?: string; kind?: 'edit' | 'restore'; restoredFromSeq?: number; actions: SubjectAction[]; } /** * op 이력 스트림을 seq(액션) 단위 그룹으로 투영한다(diagram-wide). * * @param records seq 정렬 이력 레코드. * @returns seq **내림차순**(최신 먼저) 액션 그룹. 각 그룹은 subject별 액션(verb+필드)으로 구성. */ export declare function projectActionLog(records: readonly FieldAuditRecord[]): ActionGroup[];