import type { OpenSpecScanOptions } from '../../services/openspec/openspec-scan-service.js'; import type { OpenSpecArchiveError, OpenSpecArchiveOptions } from '../../services/openspec/openspec-archive-service.js'; import type { OpenSpecRenderOptions, OpenSpecRenderRequest } from '../../services/openspec/openspec-render-service.js'; import type { OpenSpecValidateOptions } from '../../services/openspec/openspec-validate-service.js'; import { type ProgramIO } from '../cli-helpers.js'; export type OpenSpecListOptions = { project?: string; json?: boolean; }; export type OpenSpecShowOptions = OpenSpecListOptions; export type OpenSpecToRdOptions = OpenSpecListOptions; export type OpenSpecRenderCommandOptions = OpenSpecListOptions & { request: string; apply?: boolean; overwrite?: boolean; }; export type OpenSpecValidateCommandOptions = OpenSpecListOptions & { preferExternal?: boolean; }; export type OpenSpecArchiveCommandOptions = OpenSpecListOptions & { apply?: boolean; force?: boolean; coverageSummary?: string; archiveDir?: string; }; export type OpenSpecInitCommandOptions = { project: string; apply?: boolean; json?: boolean; }; /** The next action every path/layout failure carries. */ export declare const OPENSPEC_PATH_HINT: string[]; /** Everything a verb-specific catch needs to build its failure envelope. */ export type OpenSpecFailure = { readonly code: string; readonly error: unknown; readonly nextActions: string[]; readonly json: boolean | undefined; readonly data?: Record; }; export declare function resolveScanOptions(project: string | undefined): OpenSpecScanOptions; export declare function loadRenderRequest(requestPath: string): Promise; /** Print a verb failure and mark the run failed. One call site per catch. */ export declare function failOpenSpec(io: ProgramIO, command: string, failure: OpenSpecFailure): void; /** The `` resolution every change-scoped verb shares. */ export declare function printChangeNotFound(io: ProgramIO, command: string, changeId: string, json: boolean | undefined): void; /** * Translate `--project` into the service option shape, carrying only the flags * the caller actually set (a `false`/`undefined` flag must stay absent, not be * written as `false`). */ export declare function toRenderOptions(project: string | undefined, options: OpenSpecRenderCommandOptions): OpenSpecRenderOptions; export declare function toValidateOptions(project: string | undefined, options: OpenSpecValidateCommandOptions): OpenSpecValidateOptions; export declare function toArchiveOptions(project: string | undefined, options: OpenSpecArchiveCommandOptions): OpenSpecArchiveOptions; /** * Per-error-code remediation hints for the archive gate. * Centralized here so the catch block stays readable and the next-actions * can be reviewed in isolation. */ export declare function nextActionsForArchiveError(code: OpenSpecArchiveError['code']): string[]; /** The `openspec.archive` failure envelope for the gate's own error class. */ export declare function printArchiveError(io: ProgramIO, error: OpenSpecArchiveError, json: boolean | undefined): void;