/** * This device's global CLEO store (the main brain) on Cleo Nexus: bind its * global-scope replica and attach it to the account's `home:` stream with * presence (T12952, cleo-nexus T084). `cleo login nexus` runs it after a * device login, so login stays the only setup step; `cleo cloud status` * reads the attachments back. * * A server that does not have the home-replica endpoints yet answers 404: * that is reported as a warning, never a failure. * * @task T12952 * @epic T12323 */ import type { NexusReplicaAttachment } from '@cleocode/contracts'; import { z } from 'zod'; import { type ProjectReplicaBinder } from './nexus-attach.js'; import { type NexusCloudOptions } from './nexus-cloud.js'; /** Warning code: the server has no home-replica endpoints yet. */ export declare const W_NEXUS_HOME_UNSUPPORTED = "W_NEXUS_HOME_UNSUPPORTED"; /** Options of {@link attachNexusGlobalStore}. */ export interface AttachNexusGlobalStoreOptions extends NexusCloudOptions { /** CLEO version reported in presence; defaults to the installed one. */ cliVersion?: string; /** Replica binding (tests); defaults to the canonical global store. */ binder?: ProjectReplicaBinder; } /** * Attach this device's global store to the account's home stream. * * @param opts - API URL, stores and overrides. * @returns The attachment (or `null` when the server does not support it) and warnings. * @throws {NexusAccountError} Not signed in, or `E_NEXUS_REPLICA_COPIED`. */ export declare function attachNexusGlobalStore(opts?: AttachNexusGlobalStoreOptions): Promise<{ replica: NexusReplicaAttachment | null; warnings: string[]; }>; /** One home-stream replica as `GET /v1/account/home/replicas` lists it. */ export declare const nexusHomeReplicaSchema: z.ZodObject<{ replicaId: z.ZodString; deviceId: z.ZodString; deviceState: z.ZodOptional; presenceAt: z.ZodOptional>; lastSyncAt: z.ZodOptional>; attachedAt: z.ZodOptional; }, z.core.$loose>; /** `GET /v1/account/home/replicas`. */ export declare const nexusHomeReplicaListSchema: z.ZodObject<{ replicas: z.ZodArray; presenceAt: z.ZodOptional>; lastSyncAt: z.ZodOptional>; attachedAt: z.ZodOptional; }, z.core.$loose>>; }, z.core.$loose>; /** The account's global-store attachments, as `cleo cloud status` reports them. */ export interface NexusGlobalStoreStatus { /** Whether the server lists home replicas at all. */ supported: boolean; /** This device's attachment, if any. */ thisDevice: z.infer | null; /** Every device's global store attached to the account. */ replicas: Array>; } /** * Read the account's global-store attachments (GET only). * * @param opts - API URL, stores and overrides. * @returns The attachments; `supported: false` when the server has no such endpoint. */ export declare function nexusGlobalStoreStatus(opts?: NexusCloudOptions): Promise; //# sourceMappingURL=nexus-home.d.ts.map