/** * @module galaxy-helpers * * Helper functions for Universal GalaxyIbGib: genesis, ib parsing/validation, * policy resolution, and archetype helpers. */ import { IbGib_V1 } from '@ibgib/ts-gib/dist/V1/types.mjs'; import { MetaspaceService } from '../../witness/space/metaspace/metaspace-types.mjs'; import { IbGibSpaceAny } from '../../witness/space/space-base-v1.mjs'; import { GalaxyIbGib_V1, GalaxyData_V1, GalaxyRel8ns_V1, GalaxyIb_V1, GalaxyPolicy, GalaxyTopology, GalaxyStorageMode } from './galaxy-types.mjs'; /** * Validates whether a given string is a valid galaxy name. * Enforces URL-path friendly naming without whitespace or tildes (~). */ export declare function validateGalaxyName(name: string): boolean; /** * Builds canonical galaxy ib string: `galaxy `. */ export declare function getGalaxyIb({ galaxyName, topology, storageMode, concreteClassname, }: { galaxyName: string; topology?: GalaxyTopology; storageMode?: GalaxyStorageMode; concreteClassname?: string; }): string; /** * Parses a galaxy ib string into its constituent parts. */ export declare function parseGalaxyIb({ ib }: { ib: string; }): Promise; /** * Validates whether an ib string corresponds to a valid galaxy ib. */ export declare function validateGalaxyIb({ ib }: { ib: string; }): Promise; /** * Type guard for Universal GalaxyIbGib_V1. */ export declare function isGalaxy(ibGib?: IbGib_V1 | null): ibGib is GalaxyIbGib_V1; /** * Returns true if the galaxy has a branching topology (multiple branch spaces / worktrees). */ export declare function isBranchingGalaxy(galaxy: GalaxyIbGib_V1): boolean; /** * Returns true if the galaxy has a linear topology (single CAS space / append-only). */ export declare function isLinearGalaxy(galaxy: GalaxyIbGib_V1): boolean; export interface CreateGalaxyIbGibOpts { /** * Unique name for this galaxy within its containing cosmos (e.g. 'code-1', 'notes-1'). */ galaxyName: string; /** * Archetype discriminator (standard preset like 'code', 'notes', or downstream custom string). */ discriminator: string; /** * Explicit policy override. If omitted, resolved from preset config or fallback defaults. */ policy?: GalaxyPolicy; description?: string; icon?: string; label?: string; space: IbGibSpaceAny; metaspace?: MetaspaceService; customData?: Record; } /** * Creates a new genesis Universal GalaxyIbGib in the given space, optionally relating it * to the metaspace special anchor. */ export declare function createGalaxyIbGib({ galaxyName, discriminator, policy: explicitPolicy, description: explicitDescription, icon: explicitIcon, label: explicitLabel, space, metaspace, customData, }: CreateGalaxyIbGibOpts): Promise; /** * Retrieves authoritative GalaxyIbGib_V1 from space by address or via * special ibgib anchor, and resolves its latest frame in space. */ export declare function getGalaxyIbGib({ space, metaspace, galaxyAddr, }: { /** * space for galaxy. */ space: IbGibSpaceAny; /** * ref to metaspace for driving getting at the galaxy via the "special" ibgib anchor. * * @throws if both this and {@link galaxyAddr} are falsy * * @see {@link MetaspaceService.getSpecialRel8dIbGibs} */ metaspace?: MetaspaceService; /** * if provided, this will drive getting the galaxy. if not, will get the * "special" anchor ibgib via {@link metaspace} * * @throws if both this and {@link metaspace} are falsy */ galaxyAddr?: string; }): Promise | undefined>; //# sourceMappingURL=galaxy-helpers.d.mts.map