{"version":3,"file":"baseCommand.cjs","names":[],"sources":["../../../src/cli/commands/baseCommand.ts"],"sourcesContent":["import type { HarnessTelemetry } from '@agimon-ai/doompi-core/runtime-log-sink-telemetry';\n\nimport type { HarnessContext } from '../../builders/cli/harnessContext';\nimport type { HarnessOptions } from '../../composition/types/harness';\n\n/** Public compatibility contract for callers that use command classes. */\nexport abstract class BaseCommand {\n  /** Identifier used in diagnostics and tests. */\n  abstract readonly name: string;\n\n  /** True when the parsed options select this command. */\n  abstract matches(options: HarnessOptions): boolean;\n\n  /**\n   * Runs the command and resolves to the process exit code.\n   *\n   * Telemetry is handed in rather than created per command so every stage of\n   * one run reports under the same span.\n   */\n  abstract execute(context: HarnessContext, telemetry: HarnessTelemetry): Promise<number>;\n\n  /**\n   * Handle errors consistently across all commands.\n   */\n  protected handleError(error: unknown): never {\n    const message = error instanceof Error ? error.message : String(error);\n    process.stderr.write(`[doompi] ${this.name}: ${message}\\n`);\n    process.exit(1);\n  }\n}\n"],"mappings":";;AAMA,IAAsB,cAAtB,MAAkC;;;;CAkBhC,YAAsB,OAAuB;EAC3C,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EACrE,QAAQ,OAAO,MAAM,YAAY,KAAK,KAAK,IAAI,QAAQ,GAAG;EAC1D,QAAQ,KAAK,CAAC;CAChB;AACF"}