/** * Copy stored provider credentials between machines. * * `omp auth export` prints every active credential in the local credential * store (`agent.db`) as JSON — API keys and OAuth logins, refresh tokens * included. `omp auth import ` merges such a file into the local store: * an imported OAuth login replaces the stored login of the same provider * account, an imported API key replaces the provider's stored API key, and * everything else is kept. */ import { type AuthCredential, type AuthCredentialStore } from "@oh-my-pi/pi-ai"; import { Command } from "@oh-my-pi/pi-utils/cli"; /** Format version of the `omp auth export` document. */ export declare const AUTH_EXPORT_VERSION = 1; /** One stored credential in an `omp auth export` document. */ export interface AuthExportEntry { /** Provider id the credential authenticates (e.g. `anthropic`). */ provider: string; /** The credential exactly as stored, OAuth refresh token included. */ credential: AuthCredential; } /** The document `omp auth export` prints and `omp auth import` reads. */ export interface AuthExport { version: typeof AUTH_EXPORT_VERSION; credentials: AuthExportEntry[]; } /** Result of {@link importAuthCredentials}. */ export interface AuthImportSummary { /** Number of credentials written. */ imported: number; /** Providers that received credentials, in first-seen order. */ providers: string[]; } /** A malformed or unsupported credential export. */ export declare class AuthTransferError extends Error { constructor(message: string); } /** Every active credential in `store`, in storage order. */ export declare function exportAuthCredentials(store: Pick): AuthExport; /** * Parse and validate an `omp auth export` document. Throws * {@link AuthTransferError} naming the first offending entry. */ export declare function parseAuthExport(text: string, source?: string): AuthExport; /** * Merge `data` into `store`, one provider at a time: stored credentials that * an imported one replaces (same provider and account) are swapped for it, * all others are kept. Each provider is written in one store transaction. */ export declare function importAuthCredentials(store: Pick, data: AuthExport): Promise; export default class Auth extends Command { static description: string; static args: { action: import("@oh-my-pi/pi-utils/cli").ArgDescriptor & { description: string; required: true; options: string[]; }; file: import("@oh-my-pi/pi-utils/cli").ArgDescriptor & { description: string; required: false; }; }; static examples: string[]; run(): Promise; }