import type { RuntimePluginManifest } from '../runtime/composition/plugin-manifest.js'; export interface CliBinarySpec { readonly name: string; readonly borrowsFrom?: string; readonly unixCandidates?: (home: string) => string[]; readonly windowsCandidates?: (home: string) => string[]; readonly parentExePattern?: RegExp; readonly delegationKey?: string; readonly bootVersionProbe?: boolean; } export interface CliCredentialProviderSpec { readonly id: string; readonly label: string; readonly fields: readonly string[]; readonly required: readonly string[]; readonly kind?: 'subscription' | 'api_key'; } export interface CliCredentialSpec { readonly prefix: string; readonly providers: readonly CliCredentialProviderSpec[]; } export interface CliLoginPlanArgs { readonly homeDir: string; readonly cliProvider?: string; readonly cliMethod?: string; } export interface CliLoginPlan { readonly spawnArgs: readonly string[]; readonly env: Readonly>; } export interface CliLoginParsed { readonly verification_url?: string; readonly user_code?: string; } export interface CliLoginSpec { readonly harvestProvider: string; readonly providerScoped?: boolean; plan(args: CliLoginPlanArgs): CliLoginPlan; createLineParser(): (line: string) => CliLoginParsed | null; harvest(homeDir: string): Promise>; } export interface CliAcpCommand { readonly command: string; readonly args: readonly string[]; } export interface CliSessionSummary { cli: string; session_id: string; cwd: string; title: string; created_at: string | null; updated_at: string; source: 'cli' | 'awb'; size_bytes?: number; } export interface CliSessionHistoryEvent { id: string; seq: number; turn_id: string; type: string; payload: Record; created_at: string; } export interface CliSessionHistoryRead { events: CliSessionHistoryEvent[]; total: number; offset: number; title: string; cwd: string; createdAt: string | null; updatedAt: string | null; sizeBytes?: number; } export interface CliSessionIndexEntry { cli: string; session_id: string; cwd: string; title: string; created_at: string; updated_at: string; } export interface CliSessionStoreContext { readonly home: string; readonly listLimit: number; readonly historyLimit: number; readonly exec: (bin: string, args: string[]) => Promise; } export interface CliSessionStoreDriver { listSessions(ctx: CliSessionStoreContext): Promise; readHistory(ctx: CliSessionStoreContext, sessionId: string, indexEntry: CliSessionIndexEntry | null): Promise; findSessionFile?(ctx: CliSessionStoreContext, sessionId: string): Promise; } export interface CliSessionSpec { detect(env: NodeJS.ProcessEnv, findOnPath: (name: string) => Promise): Promise; resolveAcpCommand(findOnPath: (name: string) => Promise): Promise; operatorHome(env: NodeJS.ProcessEnv): string; readonly storeSubdir?: string; adjustEnv?(env: Record): void; readonly supportsBackendProfile?: boolean; readonly store?: CliSessionStoreDriver; } export type CliEffortKey = 'model' | 'effort' | 'ultracode'; export interface CliEffortSpec { readonly sliceKey?: string; readonly keys: readonly CliEffortKey[]; } export interface CliDispatchSpec { readonly ticketDispatch?: 'allowed' | 'blocked'; readonly inlineImages?: boolean; readonly pluginUpdates?: boolean; readonly cliHomePrepFatal?: boolean; readonly runtimeProfile?: boolean; readonly scanStderrForTools?: boolean; } export interface CliModule extends RuntimePluginManifest { readonly label: string; listProfiles?(): Promise; readonly binary?: CliBinarySpec; readonly credentials?: CliCredentialSpec; readonly login?: CliLoginSpec; readonly sessions?: CliSessionSpec; readonly effort?: CliEffortSpec; readonly dispatch?: CliDispatchSpec; } export declare function defineCliModule(module: CliModule): CliModule;