import { probeCodexLaunch, resolveCliCommandAvailability } from "../adapters/index.js"; import { type MartinAdapter } from "../core/index.js"; import { type LoopBudget, type MartinRunListFilters, type MartinRunSelector, type MutationMode } from "../contracts/index.js"; import { type NativePhaseSubcommand } from "./phase-command-center.js"; import { type MartinMcpHost, type MartinMcpPlatform, type MartinMcpProfile, type MartinMcpScope, type MartinMcpTransport } from "./mcp-config.js"; export type RunCommandRequest = { workspaceId: string; projectId: string; title: string; objective: string; verificationPlan: string[]; verifyTimeoutMs?: number; providerExecutionTimeoutMs?: number; metadata: Record; budget: LoopBudget; budgetOverrides?: Partial>; configPath?: string; cwd?: string; runsDir?: string; model?: string; engine?: string; liveMode?: "live" | "proof"; mutationMode?: MutationMode; unsafeAllowUnguardedRun?: boolean; allowOutdated?: boolean; allowedPaths?: string[]; deniedPaths?: string[]; acceptanceCriteria?: string[]; approvalPolicy?: import("../contracts/index.js").ApprovalPolicy; }; type InspectCommand = { command: "inspect"; file: string; runsDir?: string; }; type ResumeCommand = { command: "resume"; selector: MartinRunSelector; }; type DoctorCommand = { command: "doctor"; cwd?: string; runsDir?: string; engine?: "auto" | "claude" | "codex" | "gemini" | "openai"; configPath?: string; }; type StartCommand = { command: "start"; cwd?: string; runsDir?: string; }; type EnableCommand = { command: "enable"; cwd?: string; runsDir?: string; configPath?: string; engine?: "auto" | "claude" | "codex" | "gemini" | "openai"; verifier?: string; budgetUsd?: number; maxIterations?: number; force: boolean; }; type EnvCommand = { command: "env"; cwd?: string; runsDir?: string; }; type ReviewCommand = { command: "review"; selector: MartinRunSelector; }; type ReceiptsExplainCommand = { command: "receipts_explain"; selector: MartinRunSelector; }; type NativePhaseCommand = { command: "native_phase"; subcommand: NativePhaseSubcommand; cwd?: string; runsDir?: string; host?: string; runScanLimit?: number; execute: boolean; }; type PreflightCommand = { command: "preflight"; request: RunCommandRequest; }; type TriageCommand = { command: "triage"; filters: MartinRunListFilters; }; type DossierCommand = { command: "dossier"; selector: MartinRunSelector; }; type RunsCommand = { command: "runs_list"; filters: MartinRunListFilters; } | { command: "runs_get"; selector: MartinRunSelector; } | { command: "runs_attempt"; selector: MartinRunSelector; } | { command: "runs_verify"; selector: MartinRunSelector; }; type McpCommand = { command: "mcp_print_config"; host: MartinMcpHost; scope: MartinMcpScope; cwd?: string; runsDir?: string; transport: MartinMcpTransport; profile: MartinMcpProfile; remoteUrl?: string; remoteTokenEnv?: string; experimentalRemoteHosts: boolean; platform?: MartinMcpPlatform; } | { command: "mcp_install"; host: MartinMcpHost; scope: MartinMcpScope; cwd?: string; runsDir?: string; transport: MartinMcpTransport; profile: MartinMcpProfile; remoteUrl?: string; remoteTokenEnv?: string; experimentalRemoteHosts: boolean; platform?: MartinMcpPlatform; dryRun: boolean; installGovernance: boolean; } | { command: "mcp_verify_install" | "mcp_rollback" | "mcp_uninstall"; host: MartinMcpHost; scope: MartinMcpScope; cwd?: string; runsDir?: string; }; type EstimateCommand = { command: "estimate"; objective: string; engine: string; budgetUsd: number; fileScope: string[]; cwd?: string; runsDir?: string; budget?: LoopBudget; }; type GateCommand = { command: "gate"; cwd?: string; runsDir?: string; }; type ModeCommand = { command: "mode"; /** undefined = show current mode */ mode?: "auto" | "plan" | "edits"; scope: "global" | "project"; cwd?: string; }; type CleanCommand = { command: "clean"; cwd?: string; runsDir?: string; cleanRuns: boolean; cleanAll: boolean; }; type ChallengeCommand = { command: "challenge"; selector?: MartinRunSelector; format: "markdown" | "svg"; }; type ShareCommand = { command: "share"; selector: MartinRunSelector; outputDir?: string; }; type BadgeCommand = { command: "badge"; format: "svg" | "json"; runsDir?: string; governed?: boolean; }; type CancelCommand = { command: "cancel"; runId: string; reason?: string; runsDir?: string; }; type SignalCommand = { command: "signal"; runId: string; event: string; disposition: "stop" | "continue"; reason?: string; runsDir?: string; }; type SyncCommand = { command: "sync"; sub: "flush" | "status"; }; export type ParsedCliArguments = { command: "help"; } | { command: "version"; } | { command: "run"; request: RunCommandRequest; } | { command: "bench"; suiteId: string; } | { command: "demo"; directory: string; force: boolean; } | InspectCommand | ResumeCommand | DoctorCommand | StartCommand | EnableCommand | EnvCommand | ReviewCommand | ReceiptsExplainCommand | NativePhaseCommand | PreflightCommand | TriageCommand | DossierCommand | RunsCommand | McpCommand | EstimateCommand | GateCommand | ModeCommand | CleanCommand | ChallengeCommand | ShareCommand | BadgeCommand | CancelCommand | SignalCommand | SyncCommand | { command: "telemetry"; action: "status" | "explain" | "on" | "off"; }; export declare function executeCli(args: string[]): Promise<{ exitCode: number; stdout: string; stderr: string; }>; export declare function __setRunAdapterOverrideForTests(adapter?: MartinAdapter): void; type CodexAvailabilityForTests = ReturnType; type CodexProbeForTests = ReturnType; export declare function __setCodexHostOverridesForTests(overrides?: { availability?: CodexAvailabilityForTests; probe?: CodexProbeForTests | ((input: { workingDirectory: string; availability: CodexAvailabilityForTests; model?: string; providerExecutionTimeoutMs?: number; }) => CodexProbeForTests); }): void; export declare function parseCliArguments(args: string[]): ParsedCliArguments; export declare function renderCliHelp(): string; export declare function __setVersionGateOverrideForTests(override: (() => Promise<{ outdated: boolean; latestVersion?: string; }>) | undefined): void; export {};