export const SYNC_ATOM = "sync";
export const SYNC_MSG_REL8N_NAME = "syncmsg";
/**
 * payload addrs should be domain-only, i.e., we are not including the sync
 * saga ibgib, or its message stone, or identity keystones.
 */
export const SYNC_SAGA_PAYLOAD_ADDRS_DOMAIN = "@payloadAddrsDomain";
// #region SyncStage
export const SYNC_STAGE_INIT = "init";
export const SYNC_STAGE_ACK = "ack";
export const SYNC_STAGE_DELTA = "delta";
export const SYNC_STAGE_COMMIT = "commit";
export const SyncStage = {
    /**
     * first frame
     */
    init: SYNC_STAGE_INIT,
    /**
     * 2nd frame, response to init
     */
    ack: SYNC_STAGE_ACK,
    /**
     * exchanging/negotiating ibgibs
     */
    delta: SYNC_STAGE_DELTA,
    /**
     * final phases of sync
     */
    commit: SYNC_STAGE_COMMIT,
};
export const SYNC_STAGE_VALID_VALUES = Object.values(SyncStage);
// #endregion SyncStage
// #region SyncConflictStrategy
export const SYNC_CONFLICT_STRATEGY_ABORT = 'abort';
export const SYNC_CONFLICT_STRATEGY_OPTIMISTIC_GRAFT_LCS = 'optimistic-graft-longest-common-subsequence';
/**
 * @see {@link SyncOptions.conflictStrategy}
 */
export const SyncConflictStrategy = {
    /**
     * As soon as a conflict is detected, the sync aborts and fails completely.
     */
    abort: SYNC_CONFLICT_STRATEGY_ABORT,
    /**
     * * Optimistic: do something even if its wrong
     * * LCS: Longest common subsequence algorithm used when encountering
     *   data.text differences.
     *
     * ## notes
     *
     * If we are making changes to text, then we will try to merge that text
     * instead of last-one-wins.
     */
    optimisticWithLCS: SYNC_CONFLICT_STRATEGY_OPTIMISTIC_GRAFT_LCS,
    // manual: SYNC_CONFLICT_STRATEGY_MANUAL, // not implemented yet
};
export const SYNC_CONFLICT_STRATEGY_VALID_VALUES = Object.values(SyncConflictStrategy);
export function isValidSyncConflictStrategy(strategy) {
    return SYNC_CONFLICT_STRATEGY_VALID_VALUES.includes(strategy);
}
// #endregion SyncConflictStrategy
//# sourceMappingURL=sync-constants.mjs.map