/**
 * @module outer-space
 * Outer spaces are spaces connecting local inner spaces.
 * ATOW there is just sync spaces, but definitely just the beginning.
 *
 * ## on future implementations, CRDT-like behavior
 *
 * I just realized that when merging, I can actually create a meta transform
 * ibgib to maintain the order of transforms.
 */
import { IbGibSpaceOptionsCmdModifier, } from '../space-types.mjs';
import { CIPHERTEXT_REL8N_NAME } from '../../../common/encrypt/encrypt-constants.mjs';
export const StatusCode = {
    /**
     * Using this as the code for the parent primitive.
     */
    undefined: 'undefined',
    /**
     * gt
     */
    preparing: 'preparing',
    /**
     * Communication between spaces has just started, but no evaluation as to
     * intrinsic ibgibs shared has been made.
     *
     * Using this for the start of the sync process, meaning the ball has begun
     * rolling, a metadata ibgib to track the operation has been created (but
     * not necessarily yet stored), but no intrinsic (non-meta) data has been
     * exchanged.
     */
    started: 'started',
    /**
     * New insertion of ibgib(s) into the outerspace.
     *
     * The outerspace did not have the timeline or ibgib(s) at all, so this is
     * the first time.
     */
    inserted: 'inserted',
    /**
     * Updated outerspace with local ibgib(s).
     *
     * The outerspace had the same timeline as the local space, just not as
     * recent.
     */
    updated: 'updated',
    /**
     * When syncing, this means that we've reconciled one or more timeline(s)
     * between the local and sync spaces. The process of this was by
     * automatically applying dna ibgibs that did not exist in one or the other
     * timelines, so that the end result is that the dna at the end is
     * "effectively equal". this does not guarantee order, it only guarantees
     * application.  anything sensitive to order must be done with locality.
     *
     * Note that in this case, we've created new ibgib to fulfill the operation
     * (besides the derivative metadata ibgibs created in the communication).
     * These ibgibs should be found on the status ibgib.
     *
     * @see {@link merged_state}
     */
    merged_dna: 'merged_dna',
    /**
     * Similar to {@link merged_dna}, but we didn't have dna to work with. So we
     * fudged and did our best guess at merging the state using some opinionated
     * algorithms.
     *
     * Note that in this case, we've created new ibgib to fulfill the operation
     * (besides the derivative metadata ibgibs created in the communication).
     * These ibgibs should be found on the status ibgib.
     *
     * @see {@link merged_dna}
     */
    merged_state: 'merged_state',
    /**
     * The operation has completed, but there were no intrinsic changes.
     *
     * For example, if we were to sync an ibGib but it's already up-to-date in a
     * space, then we have generated metadata ibgibs. But *intrinsically* we have
     * not altered any timeline ibgibs or added any stone ibgibs.
     */
    already_synced: 'already_synced',
    /**
     * Inter-spatial communication complete.
     *
     * * There should be no more status updates after this.
     * * syncStatus$ observable should be completed just after this.
     * * subscribers should unsubscribe if not already done.
     *   * I think this happens at the publishing end also, but always good
     *     to take care of your own cleanup if possible.
     *
     */
    completed: 'completed',
};
/**
 * Marker atm.
 *
 * {@see IbGibSpaceOptionsCmdModifier}
 */
export const OuterSpaceOptionsCmdModifier = {
    ...IbGibSpaceOptionsCmdModifier,
};
/**
 * Flags to affect the command's interpretation.
 *
 * {@see IbGibSpaceOptionsCmdModifier}
 * {@see OuterSpaceOptionsCmdModifier}
 */
export const SyncSpaceOptionsCmdModifier = {
    ...OuterSpaceOptionsCmdModifier, // "inherited"
    /**
     * special type of 'put' operation that will start a sync process.
     */
    sync: 'sync',
};
//# sourceMappingURL=outer-space-types.mjs.map