/** * `pikkufabric.config.json` lives next to `pikku.config.json` in the project * root. Pins the project link (id, default api url) and declares deployable * apps + production domain. Discovered by walking up from cwd until found. */ export interface ProjectConfig { projectId: string; apiUrl?: string; frontends?: Record; production?: FabricProductionConfig; } /** One entry per deployable frontend in the repo. Key is a short slug. */ export interface FabricAppConfig { cwd: string; primary?: boolean; deploy?: boolean; kind?: 'spa' | 'ssr' | 'static'; dev?: { command?: string[]; port?: number; healthPath?: string; }; } /** * Production custom domain config. Production always maps to `main`; if * `domain` is set, fabric expects users to CNAME `.` and * `api.` at the matching `*.pikkufabric.app` hostnames. If absent, * production lives only on the platform-managed `*.pikkufabric.app` * hostnames. */ export interface FabricProductionConfig { domain?: string; } /** * `~/.fabric/auth.json` keys auth tokens by api-url so a single user can * stay logged into prod + local dev side-by-side. */ export interface AuthFile { tokens: Record; } export declare function findProjectConfig(startDir?: string): Promise<{ path: string; config: ProjectConfig; } | null>; /** * Templates ship `pikkufabric.config.json` with a `__PROJECT_ID__` placeholder * so the file's shape is visible before the repo is linked. A placeholder is * not a link: without this, `fabric init` on a fresh scaffold reports * "Already linked: __PROJECT_ID__" and every other command sends the * placeholder to the API as if it were a real id. */ export declare function isLinkedProjectId(projectId?: string | null): boolean; export declare function writeProjectConfig(cwd: string, config: ProjectConfig): Promise; export declare function readAuthFile(): Promise; export declare function writeAuthFile(file: AuthFile): Promise; export interface ResolvedApiContext { apiUrl: string; token: string | null; projectId: string | null; } /** * Stitch together the api-url + auth token from the standard sources: * 1. explicit override (e.g. --api-url flag) * 2. pikkufabric.config.json apiUrl * 3. FABRIC_API_URL env var * 4. hardcoded default * * Token comes from ~/.fabric/auth.json keyed by the resolved api-url. */ export declare function resolveApiContext(opts?: { apiUrlOverride?: string; }): Promise;