/** * @module cosmology/workspace/cosmos-url-helper * * Helpers for parsing and resolving remote Cosmos URLs and endpoints. * Supports friendly (@owner/cosmosName) and direct WebSocket API URLs. */ export interface ResolvedRemoteCosmos { /** HTTP base URL of the remote server (e.g. 'http://localhost:8080' or 'https://space-gib.com') */ baseUrl: string; /** WebSocket base URL of the remote server (e.g. 'ws://localhost:8080' or 'wss://space-gib.com') */ wsBaseUrl: string; /** Primary Keystone TJP address of the remote domain owner */ domainAddr: string; /** Owner display handle if present (e.g. '@alice') */ ownerHandle?: string; /** Name of the remote Cosmos */ cosmosName: string; /** Full WebSocket endpoint for Cosmos-level sync */ cosmosWsUrl: string; /** Dedicated read-only clone WebSocket endpoint (if senderDomainAddr is provided) */ cloneWsUrl?: string; /** Full HTTP evolve endpoint for upfront session authentication */ httpEvolveUrl: string; } export interface ResolveRemoteCosmosUrlOpts { /** * Remote URL or shorthand identifier: * - `@alice/project-x` * - `http://localhost:8080/@alice/project-x` * - `https://space-gib.com/api/sync/ws/:domainAddr/:cosmosName` */ remoteUrl: string; /** * Fallback base URL if remoteUrl is a shorthand like `@alice/project-x`. * Defaults to DEFAULT_VCS_REMOTE_URL. */ defaultBaseUrl?: string; /** * Optional custom fetch implementation (useful for testing). */ fnFetch?: typeof fetch; /** * Optional caller identity domain TJP address (Bob's domain address) for constructing clone WebSocket endpoint. */ senderDomainAddr?: string; } /** * Builds a dedicated read-only clone WebSocket endpoint URL. */ export declare function buildCloneWsUrl({ wsBaseUrl, senderDomainAddr, targetDomainAddr, cosmosName, galaxyName, branchName, }: { wsBaseUrl: string; senderDomainAddr: string; targetDomainAddr: string; cosmosName: string; galaxyName?: string; branchName?: string; }): string; /** * Parses and resolves a remote Cosmos URL into structured endpoints and domain coordinates. * If an `@owner` handle is provided, queries `POST /api/keystone/lookup` on the remote server * to resolve the authoritative primary Keystone TJP address. */ export declare function resolveRemoteCosmosUrl({ remoteUrl, defaultBaseUrl, fnFetch, senderDomainAddr, }: ResolveRemoteCosmosUrlOpts): Promise; //# sourceMappingURL=cosmos-url-helper.d.mts.map