import { BotGuardConfig } from '../config'; /** * `fullcourtdefense ci-protect` — one-command runtime protection for CI jobs. * * A CI runner is born, runs one job with an AI agent inside, and dies — no * human to click a consent dialog, no durable disk for a fleet token. So the * flow differs from laptop onboarding in exactly two ways: * * 1. Auth is the org API key (FCD_API_KEY repo secret) — the admin who put * it there consented for the pipeline. * 2. Fleet identity is the PIPELINE (provider/repo/workflow), not the * runner: the backend converges every run onto one machine record, and * we export FCD_MACHINE_ID so the hooks installed here attribute all * events to that pipeline record. * * Everything else is the exact laptop stack: same Claude-format hook, same * MCP gateway, same vendored policy engine enforcing offline. */ export interface CiProtectArgs { apiKey?: string; apiUrl?: string; provider?: string; repo?: string; workflow?: string; runId?: string; runUrl?: string; /** 'false' => skip installing the Claude-format runtime hook. */ hooks?: string; /** 'false' => skip wrapping MCP client configs with the gateway. */ gateway?: string; } interface CiContext { provider: string; repo?: string; workflow?: string; runId?: string; runUrl?: string; } /** Detect the pipeline from standard CI env vars (GitHub Actions, GitLab CI). */ export declare function detectCiContext(env?: NodeJS.ProcessEnv): CiContext | undefined; export declare function ciProtectCommand(args: CiProtectArgs, config: BotGuardConfig): Promise; export {};