// Types for onboard-rsp.js — WRITTEN, not `@ts-expect-error`'d, on retry.d.ts's criterion: this is // our module and getting it wrong is customer-facing. The specific thing a declaration buys here is // that `runnerToken` is the PLAINTEXT bearer and `runnerTokenHash`/`runnerTokenEnc` never appear in // this API at all — under `any` a caller could pass the plaintext through to the registry and it // would compile just as happily. /** What `create-site.js` hands the onboarder. The bearer arrives in the clear and leaves derived. */ export interface OnboardSiteInput { accountId: string; key: string; repo: string; /** The runner bearer, PLAINTEXT. Hashed and encrypted before it leaves this module. */ runnerToken?: string; domain?: string | null; previewProject?: string | null; previewBackend?: 'pages' | 'r2'; prodProject?: string | null; irDir?: string | null; postsDir?: string | null; ref?: string | null; pagetile?: string | null; shopId?: string | null; shopName?: string | null; canPublish?: boolean; /** Defaults to 'pending' — born-valid, invisible to scope() until activated. */ status?: string; createdAt?: string | null; createdPrompt?: string | null; } export interface RspOnboarder { /** `created:false` means the same (account, key) was already registered — a retry is idempotent. */ onboardSite(site: OnboardSiteInput): Promise<{ key: string; created: boolean }>; /** pending → active. ACCOUNT-SCOPED: a key owned by somebody else is refused, not flipped. */ activateSite(key: string, accountId: string): Promise; /** Every site this account OWNS, PENDING ONES INCLUDED — the quota guard counts them. */ countSitesForAccount(accountId: string): Promise; /** The configured cap, or null when the registry holds no row (the caller applies its default). */ quotaForAccount(accountId: string): Promise; } export function makeRspOnboarder(opts: { registry: unknown; encryptRunnerToken?: (token: string) => Promise; }): RspOnboarder;