import type { ResolvedConfig } from "../shared/config.js"; /** * A project as the Go API returns it. `liveUrl` is SERVER-COMPUTED — the apex * differs per environment, so a client that builds `.` itself would * print the wrong address on staging and dev. */ export interface ProjectView { id: string; slug: string; name: string; orgId: string; liveUrl: string; publishState: string; } export interface CreatedProject { projectId: string; slug: string; name: string; orgId: string; liveUrl: string; } export declare class BackendError extends Error { readonly status?: number | undefined; constructor(message: string, status?: number | undefined); } /** The address a caller asked for is not available. Carries the server's suggestions. */ export declare class SlugTakenError extends BackendError { readonly suggestions: string[]; constructor(suggestions: string[]); } /** * The uniform 404 for every unreachable-project cause. The message is the * server's, verbatim: the console shows the same six words, so a creator moving * between surfaces sees one product and support can match a screenshot to a log * line without a translation table. */ export declare class ProjectUnreachableError extends BackendError { constructor(message: string); } /** * Register a project in an org. `slug` is optional and the server NEVER assigns * one on a collision — it returns 409 with suggestions and the caller re-asks, so * a creator's address is always a name they chose. */ export declare function createProject(cfg: ResolvedConfig, orgSlug: string, name: string, slug?: string): Promise; /** Read a project by id. Backs `link`; the org is derived server-side from the row. */ export declare function getProject(cfg: ResolvedConfig, projectId: string): Promise; export interface MintedTunnel { tunnelId: string; /** The public host the phone opens: -.. */ hostname: string; /** cloudflared run token — `cloudflared tunnel run --token `. */ runToken: string; /** DNS record id, passed back on reap. */ dnsRecordId: string; } /** Mint a per-session dev tunnel for `localPort` (the backend holds CF creds). */ export declare function mintTunnel(cfg: ResolvedConfig, projectId: string, localPort: number): Promise; /** Tear down a session tunnel (DNS route + tunnel). Best-effort; never throws. */ export declare function reapTunnel(cfg: ResolvedConfig, projectId: string, ref: { tunnelId: string; dnsRecordId?: string; }): Promise; /** Recursively list files under `dir`, returning dir-relative POSIX paths. */ export declare function walkDir(dir: string, base?: string): Promise; export interface MeMembership { orgId: string; orgSlug: string; orgName: string; orgKind: "personal" | "team"; role: string; status: string; } export interface Me { id?: string; email?: string; name?: string; personalOrgId?: string; memberships?: MeMembership[]; } /** Resolve the signed-in identity for `vincentt whoami`. Throws on any non-2xx so * the caller can degrade to "token present, unverified". */ export declare function getMe(cfg: ResolvedConfig): Promise; /** The working tree's current commit, for publish provenance. Undefined if not a repo. */ export declare function gitHeadSha(cwd: string): Promise;