/** * Deterministic outbox payload builders for all v1 Sheet projections. * * The public repository never exposes insert/update/delete mechanics here. * These helpers translate a writer-approved canonical/candidate/resolution * decision into one immutable effect payload; the effect worker later performs * the remote compare-and-set through the provider. */ import type { EffectTargetKind } from "../../../contracts/domain/model/constants.js"; import { type DispatchClass } from "../../../contracts/domain/model/constants.js"; import type { Applicability, Presence } from "../../../contracts/state/types.js"; import type { NormalizedCell } from "../../../contracts/encoding/types.js"; import { SYNC_PROJECTIONS } from "../../../contracts/sheets/constants.js"; import { type SyncEffectKind, type SyncProjection } from "../../../contracts/sheets/syncSheets.js"; import type { NewEffect } from "@hikoutei/ikisaki"; /** * Classifies the opaque worker dispatch bucket for one projection effect. * * This is the single entity-side interpretation of domain kinds into the * opaque `dispatchClass` label the protocol worker routes on: a fast append * needs an empty visible baseline (`createIfMissing` at revision 0) plus a * new System_State entity row or a new Sync_Conflicts resolution row. * Everything else rides the regular CAS path. The worker must read only the * stamped label, never re-derive this decision. */ export declare function classifyDispatchClass(input: { readonly effectKind: SyncEffectKind; readonly projection: SyncProjection; readonly targetKind: EffectTargetKind; readonly createIfMissing: boolean; readonly expectedVisibleRevision: number; readonly expectedVisibleHash: string; }): DispatchClass; /** Common immutable coordinates of a writer-approved projection effect. */ export interface ProjectionEffectInput { readonly effectId: string; readonly effectKind: SyncEffectKind; readonly commitId: string; readonly logicalSheetId: string; readonly physicalSheetId: string; readonly sheetName: string; readonly registeredRange: string; readonly projection: SyncProjection; readonly schemaVersion: number; readonly targetKind: EffectTargetKind; readonly targetId: string; readonly rowBindingId: Presence; readonly conflictId: Presence; readonly targetAnchor: string; readonly fields: Readonly>; readonly createIfMissing: boolean; readonly expectedVisibleRevision: number; readonly expectedVisibleHash: string; readonly expectedCandidateHash?: Applicability; readonly repairGuardHash?: Presence; readonly sourceQuarantineId?: Presence; readonly targetEntityRevision?: Applicability; readonly targetFieldRevisionHash?: Applicability; readonly targetCanonicalCommitId?: Applicability; readonly streamSequence: number; } /** Input for a System_State projection effect. */ export type SystemProjectionEffectInput = Omit; /** Input for a User_Input candidate reconciliation effect. */ export type CandidateReconcileEffectInput = Omit & { readonly projection?: typeof SYNC_PROJECTIONS.USER_INPUT; }; /** Input for a guarded physical deletion from a User_Input projection. */ export type UserInputDeleteEffectInput = Omit & { readonly projection?: typeof SYNC_PROJECTIONS.USER_INPUT; }; /** Shared input for effects projected to the Sync_Conflicts control sheet. */ export type ResolutionEffectInput = Omit & { readonly projection?: typeof SYNC_PROJECTIONS.SYNC_CONFLICTS; }; /** Builds an immutable outbox row, including stable payload/dedupe identities. */ export declare function createProjectionEffect(input: ProjectionEffectInput): NewEffect; /** Creates a canonical System_State projection effect. */ export declare function createSystemProjectionEffect(input: SystemProjectionEffectInput): NewEffect; /** Creates a baseline-CAS User_Input reconcile that cannot overwrite a candidate. */ export declare function createCandidateReconcileEffect(input: CandidateReconcileEffectInput): NewEffect; /** * Creates a full-row, candidate-preserving deletion for one User_Input row. * * The payload must represent the exact current visible row. The provider can * therefore remove only the anchored row that the canonical delete observed, * while the worker blocks the effect if an unresolved user candidate exists. */ export declare function createUserInputDeleteEffect(input: UserInputDeleteEffectInput): NewEffect; /** Creates a guard-specific repair effect; caller must preserve the quarantine link. */ export declare function createSystemRepairEffect(input: Omit): NewEffect; /** Creates the system-owned Sync_Conflicts control-row projection effect. */ export declare function createResolutionProjectionEffect(input: ResolutionEffectInput): NewEffect; /** * Creates a guarded deletion for one resolved system-owned conflict row. * * The payload carries the full currently visible conflict row as the expected * state. The provider therefore deletes only the exact anchored row that the * resolver observed; it never deletes by mutable sheet row number. */ export declare function createResolutionDeleteEffect(input: ResolutionEffectInput): NewEffect; //# sourceMappingURL=ProjectionEffectFactory.d.ts.map