/** * pre-action-guards — the pure bailout / warning guards the bootstrap * `preAction` hook runs inside its decision window, BEFORE any side effect * fires (see `pre-action-hook.ts` for the load-bearing ordering). * * Extracted from `pre-action-hook.ts` as a cohesive unit: each guard is a * `(project, …) => void` that either exits the process with an actionable * message (schema-too-old, no-project) or warns to stderr (phantom runtimes), * and nothing else. Housing them here keeps the hook module focused on the * orchestration sequence and the per-tool `initialize()` lifecycle. */ import { type ProjectContext } from '@opensip-cli/core'; import type { CommandScopeIndex } from '../commands/command-scope-index.js'; /** * Schema-version bailout. THROWS a {@link BootstrapError} (exit 2) with the * "upgrade your CLI" message when the project config declares a schema newer than * this CLI knows. Direction-correct: `migrate` would go the other way (old → new); * when the CLI itself is behind, the user must upgrade it. The top-level boundary * renders it (human stderr / structured `--json`); this guard no longer writes or * exits (§4.7). * * @throws {BootstrapError} (exit 2) when the project config's schema is newer than * this CLI supports — the boundary renders the "upgrade your CLI" message. */ export declare function checkSchemaVersionAndBailout(project: ProjectContext, runId: string): void; /** * No-project-found bailout. THROWS a {@link BootstrapError} (exit 2) for * project-scoped commands when discovery resolved scope === 'none'. The top-level * boundary renders it: human mode writes the unchanged multi-line explainer to * stderr; `--json` emits a structured `bootstrap.error` outcome (§4.7). The guard * no longer branches on json or writes a stream itself. * * @throws {BootstrapError} (exit 2) when a project-scoped command runs with no * discoverable opensip-cli project (scope === 'none'). */ export declare function checkNoProjectAndBailout(project: ProjectContext, cwd: string, commandPath: string, runId: string, commandScopes: CommandScopeIndex): void; /** * Phantom-runtime warning. Detects orphaned opensip-cli/.runtime/ * subtrees between cwd and the discovered project root — fossils from * pre-discovery runs that scaffolded under subdirs. Warns to stderr * with a safe `rm -rf` hint; never auto-deletes. Suppressed for JSON * output (would corrupt the stream's stderr peer in some tools). */ export declare function warnAboutPhantomRuntimes(project: ProjectContext, jsonOutput: boolean): void; //# sourceMappingURL=pre-action-guards.d.ts.map