import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { type VariantQaResult, type VisualEditorAttachment } from './contracts';
import { VariantHistoryService } from '../../services/VariantHistoryService';
import { slugifyPrompt } from './createZeroToOneTool';
export { slugifyPrompt };
import type { AgentVariantsOrchestrator } from './WorktreeOrchestrator';
/**
 * Coerce `output` to a structured value when an agent (incorrectly) sends a
 * stringified JSON. The MCP schema accepts `z.unknown()` so the call doesn't
 * fail validation, but downstream consumers (e.g. `output.html` in
 * WorktreeOrchestrator) expect an object and silently no-op on strings —
 * leaving the variant stuck at "not ready" until session expiry.
 */
export declare const normalizeAgentOutput: (output: unknown) => unknown;
export interface ToolDeps {
    orchestrator: AgentVariantsOrchestrator;
    leaseOwner: () => string;
    /**
     * Zero-to-one only: ensure the Rivet visual editor is up on the future
     * destination path so the iframe is ready when variants render. Wired
     * from server.ts; same hook used by create_zero_to_one_project. When
     * absent (e.g. unit tests), start_variants(mode='zero_to_one') skips
     * the auto-open and the caller can open the editor themselves.
     */
    ensureVisualEditorOpen?: (input: {
        /** The materialize target — where the generated subproject's files live
         *  (`<workspaceRoot>/.rivet/<slug>/`). */
        projectPath: string;
        /** The user's working dir that owns all Rivet artifacts. The session
         *  bridge tracks this so `bridge.getProjectPath()` resolves to a stable
         *  workspace across multiple zero-to-one sessions. */
        workspaceRoot: string;
        /** 'vite' for scaffolded apps; 'static' for an empty / HTML-only
         *  workspace opened in static mode (no dev server). */
        framework: 'vite' | 'static';
    }) => Promise<VisualEditorAttachment>;
    /** Test seam — defaults to process.cwd. */
    cwd?: () => string;
    /** Resolve the currently-open editor projectPath, if any. Used by
     *  `start_variants(mode='zero_to_one')` so new projects default to the
     *  workspace the user is already working in. Wired from server.ts. */
    getProjectPath?: () => string | null;
    telemetry?: unknown;
    /** Read-only access to the on-disk variant history under
     *  `<projectPath>/.rivet/variants/`. Defaults to a fresh
     *  `VariantHistoryService` since the service is stateless. */
    variantHistory?: VariantHistoryService;
}
export declare function registerAgentVariantsTools(mcp: McpServer, deps: ToolDeps): void;
/**
 * User-facing prompt template for QA failures. Lists each failed variant
 * with its summary + first asset/console issue, then asks the user
 * whether to retry, continue with healthy variants, or cancel. Kept as
 * data (not a log line) so the calling agent can present the choice
 * directly to the human.
 */
export declare function buildQaFailurePrompt(failures: Array<{
    label: string;
    qa: VariantQaResult;
}>, healthyCount: number): string;
//# sourceMappingURL=tools.d.ts.map