import { type AccountSpendRow, type SpendWindow } from "./spendTypes.js"; export type ProjectSummary = { projectId: string; name: string; description: string | null; }; export type CreateProjectInput = { name: string; projectId: string; description?: string; }; type KeySummaryBase = { id: string; name: string | null; createdAt: string; }; /** A key summary in public terms: a project key's `projectId` is the slug (the * client has already translated it from the internal id). */ export type KeySummary = (KeySummaryBase & { scope: "account"; projectId: null; }) | (KeySummaryBase & { scope: "project"; projectId: string; }); export type CreatedKey = KeySummary & { plainKey: string; }; export type CreateProjectKeyInput = { name: string; projectId: string; }; /** Any account request that did not produce a usable result. */ export declare class AccountRequestError extends Error { } /** A 403 whose server error is the known account-scope error. The command layer * decorates it with the resolved API-key env var name; this file never knows * that name. */ export declare class AccountScopeError extends AccountRequestError { } export type AccountClient = { whoami(): Promise<{ userId: string; }>; listProjects(): Promise; createProject(input: CreateProjectInput): Promise; listKeys(): Promise; createProjectKey(input: CreateProjectKeyInput): Promise; getAccountSpend(window: SpendWindow): Promise; }; export declare function createAccountClient(origin: string, apiKey: string): AccountClient; export {};