import { type FixProject } from '../jobs/fix.js'; import type { AIProvider } from '../resolver/ai-provider.js'; import type { Incident, ResolutionResult } from '../resolver/types.js'; export interface TryCommandOptions { /** Repo root: the try command clones this, so the fix runs against real code, real tests, real build. */ root: string; /** Same blazeresolver.config.json the workflow reads: repo, testCommand, buildCommand, installCommand, sandbox. */ config: FixProject; env: NodeJS.ProcessEnv; incident: Incident; maxAttempts?: number; /** Tests: whether Docker is usable. */ dockerUp?: () => boolean; /** Tests inject a fake AI provider instead of a real model call. */ ai?: AIProvider; /** Called at the start of each stage, so a long run isn't a silent black box. */ onProgress?: (event: string) => void; } export interface TryCommandResult { result: ResolutionResult; /** Set when a fix passed: a real local branch, in this repo, holding the real commit. Never pushed. */ branch?: string; } /** * Runs the real resolver against this repo, locally: a real git clone, the project's own test and build commands * (offline in a container when the config says so, same as the workflow), and a real AI provider from .env/env. * On success the fix is committed in its workspace, then fetched into this repo as a local branch — nothing is * checked out, merged or pushed. Any user with a key in .env can run this after `blazeresolver init`. */ /** * Everything the working tree has beyond HEAD, new files included (a plain `git diff HEAD` leaves those out, so code * importing a file not yet committed would fail in the workspace). Built in a throwaway index, so the repo's own index * is untouched; `git add -A` honors .gitignore, so .env and other ignored files never reach the workspace. */ export declare function workingTreePatch(root: string): string; /** * Retries a model call the provider turned away for now (overloaded, rate-limited, timed out) after 15s, 30s and 60s, * so one busy moment at the provider doesn't end a run that already cloned, installed and tested. * Other errors (a bad key, a malformed request) fail at once. */ export declare function withBusyRetry(call: (system: string, user: string) => Promise, onProgress?: (event: string) => void, delaysMs?: number[]): (system: string, user: string) => Promise; export declare function runTryCommand(opts: TryCommandOptions): Promise; //# sourceMappingURL=try.d.ts.map