/** * Base class for LLM commands that share common patterns: * - Database open/close lifecycle * - Flag unpacking into a typed LlmContext * - Header logging * - Existence check + force/clear pattern */ import { Command } from '@oclif/core'; import type { IndexDatabase } from '../../../db/database.js'; export type LlmOptions = { showLlmRequests: boolean; showLlmResponses: boolean; }; export interface LlmContext { db: IndexDatabase; isJson: boolean; dryRun: boolean; verbose: boolean; model: string; llmOptions: LlmOptions; } export declare abstract class BaseLlmCommand extends Command { /** * Subclasses implement this instead of run(). * The db is opened before and closed after (in finally). */ protected abstract execute(ctx: LlmContext, flags: Record): Promise; run(): Promise; /** * Print a bold title + gray model line. */ protected logHeader(ctx: LlmContext, title: string): void; /** * Handle the existence check + force/clear pattern. * Returns true if the command should continue, false if it should return early. */ protected checkExistingAndClear(ctx: LlmContext, opts: { entityName: string; existingCount: number; force: boolean; clearFn: () => void; forceHint?: string; }): boolean; } //# sourceMappingURL=base-llm-command.d.ts.map