import type { GenerateOptions, GenerationPlan } from '../generate/index.ts'; import type { HostedProject, ProjectListResult } from './projects.ts'; import type { AuthenticationSnapshot, AuthenticationStatus } from './status.ts'; export { listProjects, requireProjectBackendURL, resolveProject, selectProject, } from './projects.ts'; export type { HostedProject, ProjectListResult } from './projects.ts'; export { getAuthenticationStatus } from './status.ts'; export type { AuthenticationSnapshot, AuthenticationStatus } from './status.ts'; /** Explicit frontend state supplied by Inth or a standalone CLI adapter. */ export interface FrontendCommandContext { /** Generation defaults. Mode defaults to hosted; framework must be supplied. */ generation?: Partial; /** Already-fetched projects; omitted when the host supplies a backend URL directly. */ projects?: HostedProject[]; /** Selected project ID or organization/name, used when no backend URL is supplied. */ selectedProject?: string; /** Already-resolved session state. No tokens are accepted or returned. */ authentication?: AuthenticationSnapshot; } /** Frontend command data. The host owns serialization, writes, and persistence. */ export type FrontendCommandResult = { command: 'generate' | 'setup'; data: GenerationPlan; } | { command: 'projects list'; data: ProjectListResult; } | { command: 'projects select'; data: { project: HostedProject; selectedProject: string; }; } | { command: 'status'; data: AuthenticationStatus; }; /** * Dispatch frontend commands with explicit host state and no runtime dependencies. * @param args Arguments after the host's c15t namespace. * @param context Generation defaults, projects, and session state supplied by the host. * @returns A generation plan, project selection/list, or account status. * @throws {Error} When arguments or required host state are invalid or unavailable. * @example * const result = runFrontendCommand(['setup', '--framework', 'react'], { * generation: { backendURL: 'https://consent.example.com' }, * }); */ export declare const runFrontendCommand: (args: string[], context?: FrontendCommandContext) => FrontendCommandResult;