import { z } from "zod";
// ── Zod Schema 定义 ──
export const ClassifySchema = {
    intent: z.string().describe("开发者意图描述"),
    project_path: z.string().optional().describe("项目路径（默认当前目录）"),
};
export const ExpandSchema = {
    task_id: z.string().describe("sf_classify 返回的任务 ID"),
    clarification_answers: z.array(z.string()).optional().describe("对澄清问题的回答"),
    input_material_confirmations: z.array(z.string()).optional().describe("已确认安全的输入材料路径列表"),
    architecture_decision_workshop: z.record(z.unknown()).optional().describe("架构设计前六域决策记录。示例 {domains:[{domain:'backend',options:[{id:'opt-a',title:'...'}],recommended_option_id:'opt-a',user_confirmation_ref:'confirm:...'}],status:'confirmed'}"),
    decision_workshop: z.record(z.unknown()).optional().describe("通用决策研讨合同。示例 {activated_packs:['delivery_validation'],domains:[{domain:'delivery_validation',options:[{id:'opt-a',title:'...'}],recommended_option_id:'opt-a',user_confirmation_ref:'confirm:...'}],status:'confirmed'}"),
    technology_decision_contract: z.record(z.unknown()).optional().describe("技术决策主权契约。示例 {decision_id:'TECH-001',decision_scope:'architecture',options:[{option_id:'opt-a',title:'A',description:'...'}],recommended_option:'opt-a',rejected_options:[{option:'opt-b',reason:'...'}],evidence:[{claim:'...',supporting_facts:['...']}],falsification:['...'],failure_conditions:['...'],validation_plan:['...'],rollback_or_exit_plan:['...'],human_gate_required:true,human_gate_evidence:'confirm:...',executable_without_human:false}"),
    technology_decision_record: z.record(z.unknown()).optional().describe("技术决策执行记录。示例 {decision_id:'TECH-001',selected_option:'opt-a',status:'approved',approved_by:'user',evidence_refs:['confirm:...']}"),
    detail_discipline_contract: z.record(z.unknown()).optional().describe("细节纪律契约。示例 {contract_id:'detail-001',required_dimensions:['boundary','failure_path','rollback'],blocking_dimensions:['boundary'],status:'ready'}"),
    provided_details: z.record(z.unknown()).optional().describe("细节纪律已提供证据。示例 {boundary:['只检查 readiness，不改代码'],failure_path:['unknown 时标记证据不足'],rollback:['无写入，无需回滚']}"),
    first_principles_frame: z.record(z.unknown()).optional().describe("高影响任务第一性原理框架。示例 {fundamental_need:'...',known_facts:['...'],assumptions:['...'],candidate_solutions:[{solution_id:'s1',description:'...',complexity:'low'}],simplest_viable_solution:'s1',chosen_solution:'s1',falsification_questions:['...'],why_not_legacy_path:'...'}"),
    brainstorm_session: z.record(z.unknown()).optional().describe("不确定项/方案选择会话。示例 {trigger:'uncertainty',options:[{option_id:'opt-a',title:'...',description:'...',pros:['...'],cons:['...']}],recommended_option_id:'opt-a',rejected_option_ids:['opt-b'],failure_conditions:['...'],brainstorm_status:'options_ready'}"),
    design_artifact_pack: z.record(z.unknown()).optional().describe("设计产物包路径映射或复验状态。示例 {status:'implementation_ready',paths:{architecture_document:'docs/architecture/01-架构设计文档.md'},verification_refs:['verification:...']}"),
    ood_solid_summary: z.record(z.unknown()).optional().describe("复杂编码任务 OOD/SOLID 摘要。示例 {status:'confirmed',responsibilities:['...'],interfaces:['...'],risks:['...'],evidence_refs:['...']}"),
    backend_implementation_work_package: z.record(z.unknown()).optional().describe("后端接口实现工程工作包。示例 {status:'confirmed',api_boundary:['...'],transaction_boundary:['...'],error_contract:['...'],evidence_refs:['...']}"),
    code_observability_work_package: z.record(z.unknown()).optional().describe("代码可维护性与可观测性工作包。示例 {status:'confirmed',logging_plan:['...'],comment_plan:['...'],sensitive_logging_policy:'redact',evidence_refs:['...']}"),
};
export const VerifySchema = {
    task_id: z.string().describe("任务 ID"),
    changed_files: z.array(z.string()).describe("本次修改的文件列表"),
};
export const LearnSchema = {
    task_id: z.string().describe("任务 ID"),
    result: z.enum(["success", "failure"]).describe("执行结果"),
    failure_type: z.enum(["deterministic", "fixable", "scope_insufficient"]).optional().describe("失败类型"),
    verify_output: z.object({
        build_passed: z.boolean(),
        tests_passed: z.boolean(),
        acceptance_results: z.record(z.string(), z.boolean()).optional(),
    }).optional().describe("验证输出"),
    confirm: z.boolean().optional().describe("确认执行学习（写入状态）"),
    authorized: z.boolean().optional().describe("confirm 的兼容别名"),
};
export const StatusSchema = {
    task_id: z.string().optional().describe("任务 ID（不传则查当前任务）"),
    action: z.enum(["current", "recent", "resume", "cancel", "archive_stale", "retry_expand"]).optional().describe("操作类型"),
    confirm: z.boolean().optional().describe("确认执行会写入状态的操作，例如 cancel/archive_stale/job_cancel"),
    authorized: z.boolean().optional().describe("confirm 的兼容别名"),
    job_id: z.string().optional().describe("Job ID（用于 job_status / job_resume / job_cancel）"),
    job_action: z.enum(["job_status", "job_resume", "job_cancel"]).optional().describe("Job 操作: 查询状态、从 checkpoint 恢复、取消 job（advisory）"),
};
export const PlanSchema = {
    task_id: z.string().describe("sf_classify 返回的任务 ID"),
};
export const AnalyzeSchema = {
    task_id: z.string().describe("sf_expand 返回的任务 ID（需要先执行 expand）"),
};
export const ReviewSchema = {
    task_id: z.string().describe("任务 ID"),
    changed_files: z.array(z.string()).describe("本次修改的文件列表"),
    file_contents: z.record(z.string(), z.string()).optional().describe("变更文件的当前内容（key=文件路径，value=文件内容），不传则自动读取"),
};
export const ScaffoldSchema = {
    task_id: z.string().describe("sf_classify 返回的任务 ID（task_type 应为 scaffold）"),
};
export const RecordVerificationExecutionSchema = {
    task_id: z.string().describe("任务 ID"),
    plan_id: z.string().describe("关联的 VerificationPlan ID"),
    execution_records: z.array(z.object({
        command: z.string().describe("执行的验证命令"),
        exit_code: z.number().describe("命令退出码，0 表示通过"),
        stdout_hash: z.string().describe("stdout 的 SHA256 hash"),
        stderr_hash: z.string().describe("stderr 的 SHA256 hash"),
        started_at: z.string().describe("命令开始时间 ISO 8601"),
        finished_at: z.string().describe("命令结束时间 ISO 8601"),
        evidence_id: z.string().describe("执行证据 ID"),
    })).describe("真实执行记录列表"),
};
export const AcceptSchema = {
    task_id: z.string().describe("任务 ID"),
    confirm: z.boolean().describe("用户显式确认验收结果，必须为 true"),
    confirmed_by: z.string().describe("执行确认的用户或审批者标识"),
    confirmation_ref: z.string().describe("可审计的用户确认引用"),
    acceptance_notes: z.string().describe("验收备注或不适用理由"),
    run_mode: z.enum(["manual_review", "not_applicable"]).describe("验收模式"),
    final_access: z.object({
        frontend_urls: z.array(z.string()),
        backend_urls: z.array(z.string()),
        docs_or_swagger_urls: z.array(z.string()),
        start_commands: z.array(z.string()),
        stop_commands: z.array(z.string()),
        running_status: z.string(),
        manual_review_steps_zh: z.array(z.string()),
        known_limits_zh: z.array(z.string()),
    }).optional().describe("manual_review 模式下的真实本地访问证据"),
};
export const DeliverSchema = {
    task_id: z.string().describe("任务 ID"),
    changed_files: z.array(z.string()).optional().describe("变更文件列表（不传则使用任务记录中的文件）"),
    skip_push: z.boolean().optional().describe("跳过推送"),
    skip_pr: z.boolean().optional().describe("跳过 PR 创建"),
    confirm: z.boolean().optional().describe("确认执行交付（破坏性操作）"),
    authorized: z.boolean().optional().describe("confirm 的兼容别名"),
};
export const CoordCheckSchema = {
    task_id: z.string().optional().describe("任务 ID（用于获取变更文件列表）"),
    branch: z.string().optional().describe("指定分支（不传则使用当前分支）"),
};
export const TeamStatusSchema = {
    since: z.string().optional().describe("起始日期（ISO 格式，默认 7 天前）"),
    include_knowledge: z.boolean().optional().describe("包含知识库更新信息"),
};
export const ContractCheckSchema = {
    task_id: z.string().describe("任务 ID"),
    changed_files: z.array(z.string()).optional().describe("变更文件列表（不传则从任务记录获取）"),
};
export const OnboardSchema = {
    step: z.enum(["project_overview", "code_tour", "knowledge_review", "first_task"]).optional().describe("当前引导步骤"),
    reset: z.boolean().optional().describe("重置引导会话"),
};
export const FeasibilityCheckSchema = {
    task_id: z.string().describe("任务 ID（需要已完成 classify）"),
};
export const DebugSchema = {
    error_output: z.string().describe("错误输出文本"),
    task_id: z.string().optional().describe("关联任务 ID"),
};
export const ObservabilitySchema = {
    period_days: z.number().optional().describe("报告周期天数（默认 30）"),
};
export const MigrationCheckSchema = {
    content: z.string().describe("迁移文件内容（SQL/DDL）"),
    filename: z.string().describe("文件名（如 V001__create_users.sql）"),
};
export const TestGuideSchema = {
    changed_files: z.array(z.string()).describe("变更文件列表"),
};
export const TestQualitySchema = {
    content: z.string().describe("测试文件内容"),
    filename: z.string().describe("测试文件名"),
};
export const DependencyScanSchema = {
    content: z.string().describe("依赖声明文件内容（package.json / pom.xml / build.gradle）"),
    filename: z.string().describe("文件名"),
};
export const ExploreSchema = {
    domain_query: z.string().describe("技术选型领域关键词（如：分布式锁、流式处理、复杂表单状态管理、缓存策略）"),
    task_id: z.string().optional().describe("关联任务 ID（可选，用于关联项目上下文）"),
};
//# sourceMappingURL=schemas.js.map