import { z } from "zod"; import { type PlanSpec } from "../contracts/spec.js"; import { type SprintContract } from "../contracts/sprint-contract.js"; export declare const AgentRoleSchema: z.ZodEnum<["planner", "generator", "evaluator", "human"]>; export type AgentRole = z.infer; export declare const DecisionSchema: z.ZodObject<{ timestamp: z.ZodString; description: z.ZodString; rationale: z.ZodString; madeBy: z.ZodEnum<["planner", "generator", "evaluator", "human"]>; }, "strip", z.ZodTypeAny, { timestamp: string; description: string; rationale: string; madeBy: "planner" | "generator" | "evaluator" | "human"; }, { timestamp: string; description: string; rationale: string; madeBy: "planner" | "generator" | "evaluator" | "human"; }>; export type Decision = z.infer; export declare const ProjectContextSchema: z.ZodObject<{ name: z.ZodString; type: z.ZodString; techStack: z.ZodArray; entryPoints: z.ZodArray; currentBranch: z.ZodString; }, "strip", z.ZodTypeAny, { type: string; name: string; techStack: string[]; entryPoints: string[]; currentBranch: string; }, { type: string; name: string; techStack: string[]; entryPoints: string[]; currentBranch: string; }>; export type ProjectContext = z.infer; export declare const ContextHandoffSchema: z.ZodObject<{ timestamp: z.ZodString; from: z.ZodEnum<["planner", "generator", "evaluator", "human"]>; to: z.ZodEnum<["planner", "generator", "evaluator", "human"]>; projectContext: z.ZodObject<{ name: z.ZodString; type: z.ZodString; techStack: z.ZodArray; entryPoints: z.ZodArray; currentBranch: z.ZodString; }, "strip", z.ZodTypeAny, { type: string; name: string; techStack: string[]; entryPoints: string[]; currentBranch: string; }, { type: string; name: string; techStack: string[]; entryPoints: string[]; currentBranch: string; }>; spec: z.ZodObject<{ specId: z.ZodString; version: z.ZodDefault; title: z.ZodString; description: z.ZodString; status: z.ZodEnum<["draft", "needs-clarification", "ready", "in-progress", "completed", "abandoned"]>; mode: z.ZodEnum<["greenfield", "brownfield"]>; features: z.ZodArray; acceptanceCriteria: z.ZodArray; dependencies: z.ZodDefault>; estimatedComplexity: z.ZodOptional>; estimatedSprints: z.ZodOptional; }, "strip", z.ZodTypeAny, { description: string; title: string; featureId: string; priority: "must-have" | "should-have" | "nice-to-have"; acceptanceCriteria: string[]; dependencies: string[]; estimatedComplexity?: "high" | "medium" | "low" | undefined; estimatedSprints?: number | undefined; }, { description: string; title: string; featureId: string; priority: "must-have" | "should-have" | "nice-to-have"; acceptanceCriteria: string[]; dependencies?: string[] | undefined; estimatedComplexity?: "high" | "medium" | "low" | undefined; estimatedSprints?: number | undefined; }>, "many">; assumptions: z.ZodDefault>; outOfScope: z.ZodDefault>; ambiguityScore: z.ZodOptional; clarificationQuestions: z.ZodDefault; question: z.ZodString; options: z.ZodOptional, "many">>; recommendation: z.ZodOptional; ambiguityWeight: z.ZodOptional; }, "strip", z.ZodTypeAny, { category: "other" | "scope" | "user-personas" | "data-model" | "tech-constraints" | "design-ux" | "integrations" | "non-functional" | "error-handling" | "integration-risk" | "pattern-conflict" | "regression-risk"; questionId: string; question: string; options?: { description: string; label: string; }[] | undefined; recommendation?: string | undefined; ambiguityWeight?: number | undefined; }, { category: "other" | "scope" | "user-personas" | "data-model" | "tech-constraints" | "design-ux" | "integrations" | "non-functional" | "error-handling" | "integration-risk" | "pattern-conflict" | "regression-risk"; questionId: string; question: string; options?: { description: string; label: string; }[] | undefined; recommendation?: string | undefined; ambiguityWeight?: number | undefined; }>, "many">>; resolvedClarifications: z.ZodDefault>; }, "strip", z.ZodTypeAny, { answer: string; questionId: string; resolvedAt: string; resolvedBy: "user" | "planner"; }, { answer: string; questionId: string; resolvedAt: string; resolvedBy?: "user" | "planner" | undefined; }>, "many">>; techStack: z.ZodDefault>; techNotes: z.ZodOptional>; nonFunctionalRequirements: z.ZodDefault>; constraints: z.ZodDefault>; sprints: z.ZodOptional>; metadata: z.ZodOptional>; createdAt: z.ZodString; updatedAt: z.ZodString; completedAt: z.ZodOptional; }, "strip", z.ZodTypeAny, { createdAt: string; status: "completed" | "draft" | "needs-clarification" | "ready" | "in-progress" | "abandoned"; mode: "greenfield" | "brownfield"; description: string; specId: string; version: number; title: string; features: { description: string; title: string; featureId: string; priority: "must-have" | "should-have" | "nice-to-have"; acceptanceCriteria: string[]; dependencies: string[]; estimatedComplexity?: "high" | "medium" | "low" | undefined; estimatedSprints?: number | undefined; }[]; assumptions: string[]; outOfScope: string[]; clarificationQuestions: { category: "other" | "scope" | "user-personas" | "data-model" | "tech-constraints" | "design-ux" | "integrations" | "non-functional" | "error-handling" | "integration-risk" | "pattern-conflict" | "regression-risk"; questionId: string; question: string; options?: { description: string; label: string; }[] | undefined; recommendation?: string | undefined; ambiguityWeight?: number | undefined; }[]; resolvedClarifications: { answer: string; questionId: string; resolvedAt: string; resolvedBy: "user" | "planner"; }[]; techStack: string[]; nonFunctionalRequirements: unknown[]; constraints: string[]; updatedAt: string; ambiguityScore?: number | undefined; techNotes?: Record | undefined; sprints?: unknown[] | undefined; metadata?: Record | undefined; completedAt?: string | undefined; }, { createdAt: string; status: "completed" | "draft" | "needs-clarification" | "ready" | "in-progress" | "abandoned"; mode: "greenfield" | "brownfield"; description: string; specId: string; title: string; features: { description: string; title: string; featureId: string; priority: "must-have" | "should-have" | "nice-to-have"; acceptanceCriteria: string[]; dependencies?: string[] | undefined; estimatedComplexity?: "high" | "medium" | "low" | undefined; estimatedSprints?: number | undefined; }[]; updatedAt: string; version?: number | undefined; assumptions?: string[] | undefined; outOfScope?: string[] | undefined; ambiguityScore?: number | undefined; clarificationQuestions?: { category: "other" | "scope" | "user-personas" | "data-model" | "tech-constraints" | "design-ux" | "integrations" | "non-functional" | "error-handling" | "integration-risk" | "pattern-conflict" | "regression-risk"; questionId: string; question: string; options?: { description: string; label: string; }[] | undefined; recommendation?: string | undefined; ambiguityWeight?: number | undefined; }[] | undefined; resolvedClarifications?: { answer: string; questionId: string; resolvedAt: string; resolvedBy?: "user" | "planner" | undefined; }[] | undefined; techStack?: string[] | undefined; techNotes?: Record | undefined; nonFunctionalRequirements?: unknown[] | undefined; constraints?: string[] | undefined; sprints?: unknown[] | undefined; metadata?: Record | undefined; completedAt?: string | undefined; }>; currentContract: z.ZodOptional; dependsOn: z.ZodDefault>; features: z.ZodDefault>; successCriteria: z.ZodArray; required: z.ZodBoolean; }, "strip", z.ZodTypeAny, { description: string; required: boolean; criterionId: string; verificationMethod: "build" | "lint" | "typecheck" | "manual" | "unit-test" | "playwright" | "api-check" | "agent-evaluation"; }, { description: string; required: boolean; criterionId: string; verificationMethod: "build" | "lint" | "typecheck" | "manual" | "unit-test" | "playwright" | "api-check" | "agent-evaluation"; }>, "many">; nonGoals: z.ZodArray; stopConditions: z.ZodArray; definitionOfDone: z.ZodString; assumptions: z.ZodDefault>; outOfScope: z.ZodDefault>; ambiguityScore: z.ZodOptional; generatorNotes: z.ZodOptional; evaluatorNotes: z.ZodOptional; estimatedFiles: z.ZodDefault>; estimatedDuration: z.ZodOptional>; evaluatorFeedback: z.ZodOptional; iterationHistory: z.ZodDefault>; lastEvalId: z.ZodOptional>; evalResults: z.ZodOptional>; createdAt: z.ZodOptional; updatedAt: z.ZodOptional; startedAt: z.ZodOptional; completedAt: z.ZodOptional; }, "strip", z.ZodTypeAny, { status: "failed" | "completed" | "evaluating" | "in-progress" | "proposed" | "negotiating" | "agreed" | "passed" | "needs-rework"; description: string; specId: string; title: string; features: string[]; assumptions: string[]; outOfScope: string[]; contractId: string; sprintNumber: number; dependsOn: string[]; successCriteria: { description: string; required: boolean; criterionId: string; verificationMethod: "build" | "lint" | "typecheck" | "manual" | "unit-test" | "playwright" | "api-check" | "agent-evaluation"; }[]; nonGoals: string[]; stopConditions: string[]; definitionOfDone: string; estimatedFiles: string[]; iterationHistory: unknown[]; createdAt?: string | undefined; ambiguityScore?: number | undefined; updatedAt?: string | undefined; completedAt?: string | undefined; generatorNotes?: string | undefined; evaluatorNotes?: string | undefined; estimatedDuration?: "small" | "medium" | "large" | undefined; evaluatorFeedback?: string | undefined; lastEvalId?: string | null | undefined; evalResults?: unknown[] | undefined; startedAt?: string | undefined; }, { status: "failed" | "completed" | "evaluating" | "in-progress" | "proposed" | "negotiating" | "agreed" | "passed" | "needs-rework"; description: string; specId: string; title: string; contractId: string; sprintNumber: number; successCriteria: { description: string; required: boolean; criterionId: string; verificationMethod: "build" | "lint" | "typecheck" | "manual" | "unit-test" | "playwright" | "api-check" | "agent-evaluation"; }[]; nonGoals: string[]; stopConditions: string[]; definitionOfDone: string; createdAt?: string | undefined; features?: string[] | undefined; assumptions?: string[] | undefined; outOfScope?: string[] | undefined; ambiguityScore?: number | undefined; updatedAt?: string | undefined; completedAt?: string | undefined; dependsOn?: string[] | undefined; generatorNotes?: string | undefined; evaluatorNotes?: string | undefined; estimatedFiles?: string[] | undefined; estimatedDuration?: "small" | "medium" | "large" | undefined; evaluatorFeedback?: string | undefined; iterationHistory?: unknown[] | undefined; lastEvalId?: string | null | undefined; evalResults?: unknown[] | undefined; startedAt?: string | undefined; }>>; sprintHistory: z.ZodArray; dependsOn: z.ZodDefault>; features: z.ZodDefault>; successCriteria: z.ZodArray; required: z.ZodBoolean; }, "strip", z.ZodTypeAny, { description: string; required: boolean; criterionId: string; verificationMethod: "build" | "lint" | "typecheck" | "manual" | "unit-test" | "playwright" | "api-check" | "agent-evaluation"; }, { description: string; required: boolean; criterionId: string; verificationMethod: "build" | "lint" | "typecheck" | "manual" | "unit-test" | "playwright" | "api-check" | "agent-evaluation"; }>, "many">; nonGoals: z.ZodArray; stopConditions: z.ZodArray; definitionOfDone: z.ZodString; assumptions: z.ZodDefault>; outOfScope: z.ZodDefault>; ambiguityScore: z.ZodOptional; generatorNotes: z.ZodOptional; evaluatorNotes: z.ZodOptional; estimatedFiles: z.ZodDefault>; estimatedDuration: z.ZodOptional>; evaluatorFeedback: z.ZodOptional; iterationHistory: z.ZodDefault>; lastEvalId: z.ZodOptional>; evalResults: z.ZodOptional>; createdAt: z.ZodOptional; updatedAt: z.ZodOptional; startedAt: z.ZodOptional; completedAt: z.ZodOptional; }, "strip", z.ZodTypeAny, { status: "failed" | "completed" | "evaluating" | "in-progress" | "proposed" | "negotiating" | "agreed" | "passed" | "needs-rework"; description: string; specId: string; title: string; features: string[]; assumptions: string[]; outOfScope: string[]; contractId: string; sprintNumber: number; dependsOn: string[]; successCriteria: { description: string; required: boolean; criterionId: string; verificationMethod: "build" | "lint" | "typecheck" | "manual" | "unit-test" | "playwright" | "api-check" | "agent-evaluation"; }[]; nonGoals: string[]; stopConditions: string[]; definitionOfDone: string; estimatedFiles: string[]; iterationHistory: unknown[]; createdAt?: string | undefined; ambiguityScore?: number | undefined; updatedAt?: string | undefined; completedAt?: string | undefined; generatorNotes?: string | undefined; evaluatorNotes?: string | undefined; estimatedDuration?: "small" | "medium" | "large" | undefined; evaluatorFeedback?: string | undefined; lastEvalId?: string | null | undefined; evalResults?: unknown[] | undefined; startedAt?: string | undefined; }, { status: "failed" | "completed" | "evaluating" | "in-progress" | "proposed" | "negotiating" | "agreed" | "passed" | "needs-rework"; description: string; specId: string; title: string; contractId: string; sprintNumber: number; successCriteria: { description: string; required: boolean; criterionId: string; verificationMethod: "build" | "lint" | "typecheck" | "manual" | "unit-test" | "playwright" | "api-check" | "agent-evaluation"; }[]; nonGoals: string[]; stopConditions: string[]; definitionOfDone: string; createdAt?: string | undefined; features?: string[] | undefined; assumptions?: string[] | undefined; outOfScope?: string[] | undefined; ambiguityScore?: number | undefined; updatedAt?: string | undefined; completedAt?: string | undefined; dependsOn?: string[] | undefined; generatorNotes?: string | undefined; evaluatorNotes?: string | undefined; estimatedFiles?: string[] | undefined; estimatedDuration?: "small" | "medium" | "large" | undefined; evaluatorFeedback?: string | undefined; iterationHistory?: unknown[] | undefined; lastEvalId?: string | null | undefined; evalResults?: unknown[] | undefined; startedAt?: string | undefined; }>, "many">; instructions: z.ZodString; changedFiles: z.ZodArray; decisions: z.ZodArray; }, "strip", z.ZodTypeAny, { timestamp: string; description: string; rationale: string; madeBy: "planner" | "generator" | "evaluator" | "human"; }, { timestamp: string; description: string; rationale: string; madeBy: "planner" | "generator" | "evaluator" | "human"; }>, "many">; issues: z.ZodArray; }, "strip", z.ZodTypeAny, { issues: string[]; timestamp: string; from: "planner" | "generator" | "evaluator" | "human"; to: "planner" | "generator" | "evaluator" | "human"; projectContext: { type: string; name: string; techStack: string[]; entryPoints: string[]; currentBranch: string; }; spec: { createdAt: string; status: "completed" | "draft" | "needs-clarification" | "ready" | "in-progress" | "abandoned"; mode: "greenfield" | "brownfield"; description: string; specId: string; version: number; title: string; features: { description: string; title: string; featureId: string; priority: "must-have" | "should-have" | "nice-to-have"; acceptanceCriteria: string[]; dependencies: string[]; estimatedComplexity?: "high" | "medium" | "low" | undefined; estimatedSprints?: number | undefined; }[]; assumptions: string[]; outOfScope: string[]; clarificationQuestions: { category: "other" | "scope" | "user-personas" | "data-model" | "tech-constraints" | "design-ux" | "integrations" | "non-functional" | "error-handling" | "integration-risk" | "pattern-conflict" | "regression-risk"; questionId: string; question: string; options?: { description: string; label: string; }[] | undefined; recommendation?: string | undefined; ambiguityWeight?: number | undefined; }[]; resolvedClarifications: { answer: string; questionId: string; resolvedAt: string; resolvedBy: "user" | "planner"; }[]; techStack: string[]; nonFunctionalRequirements: unknown[]; constraints: string[]; updatedAt: string; ambiguityScore?: number | undefined; techNotes?: Record | undefined; sprints?: unknown[] | undefined; metadata?: Record | undefined; completedAt?: string | undefined; }; sprintHistory: { status: "failed" | "completed" | "evaluating" | "in-progress" | "proposed" | "negotiating" | "agreed" | "passed" | "needs-rework"; description: string; specId: string; title: string; features: string[]; assumptions: string[]; outOfScope: string[]; contractId: string; sprintNumber: number; dependsOn: string[]; successCriteria: { description: string; required: boolean; criterionId: string; verificationMethod: "build" | "lint" | "typecheck" | "manual" | "unit-test" | "playwright" | "api-check" | "agent-evaluation"; }[]; nonGoals: string[]; stopConditions: string[]; definitionOfDone: string; estimatedFiles: string[]; iterationHistory: unknown[]; createdAt?: string | undefined; ambiguityScore?: number | undefined; updatedAt?: string | undefined; completedAt?: string | undefined; generatorNotes?: string | undefined; evaluatorNotes?: string | undefined; estimatedDuration?: "small" | "medium" | "large" | undefined; evaluatorFeedback?: string | undefined; lastEvalId?: string | null | undefined; evalResults?: unknown[] | undefined; startedAt?: string | undefined; }[]; instructions: string; changedFiles: string[]; decisions: { timestamp: string; description: string; rationale: string; madeBy: "planner" | "generator" | "evaluator" | "human"; }[]; currentContract?: { status: "failed" | "completed" | "evaluating" | "in-progress" | "proposed" | "negotiating" | "agreed" | "passed" | "needs-rework"; description: string; specId: string; title: string; features: string[]; assumptions: string[]; outOfScope: string[]; contractId: string; sprintNumber: number; dependsOn: string[]; successCriteria: { description: string; required: boolean; criterionId: string; verificationMethod: "build" | "lint" | "typecheck" | "manual" | "unit-test" | "playwright" | "api-check" | "agent-evaluation"; }[]; nonGoals: string[]; stopConditions: string[]; definitionOfDone: string; estimatedFiles: string[]; iterationHistory: unknown[]; createdAt?: string | undefined; ambiguityScore?: number | undefined; updatedAt?: string | undefined; completedAt?: string | undefined; generatorNotes?: string | undefined; evaluatorNotes?: string | undefined; estimatedDuration?: "small" | "medium" | "large" | undefined; evaluatorFeedback?: string | undefined; lastEvalId?: string | null | undefined; evalResults?: unknown[] | undefined; startedAt?: string | undefined; } | undefined; }, { issues: string[]; timestamp: string; from: "planner" | "generator" | "evaluator" | "human"; to: "planner" | "generator" | "evaluator" | "human"; projectContext: { type: string; name: string; techStack: string[]; entryPoints: string[]; currentBranch: string; }; spec: { createdAt: string; status: "completed" | "draft" | "needs-clarification" | "ready" | "in-progress" | "abandoned"; mode: "greenfield" | "brownfield"; description: string; specId: string; title: string; features: { description: string; title: string; featureId: string; priority: "must-have" | "should-have" | "nice-to-have"; acceptanceCriteria: string[]; dependencies?: string[] | undefined; estimatedComplexity?: "high" | "medium" | "low" | undefined; estimatedSprints?: number | undefined; }[]; updatedAt: string; version?: number | undefined; assumptions?: string[] | undefined; outOfScope?: string[] | undefined; ambiguityScore?: number | undefined; clarificationQuestions?: { category: "other" | "scope" | "user-personas" | "data-model" | "tech-constraints" | "design-ux" | "integrations" | "non-functional" | "error-handling" | "integration-risk" | "pattern-conflict" | "regression-risk"; questionId: string; question: string; options?: { description: string; label: string; }[] | undefined; recommendation?: string | undefined; ambiguityWeight?: number | undefined; }[] | undefined; resolvedClarifications?: { answer: string; questionId: string; resolvedAt: string; resolvedBy?: "user" | "planner" | undefined; }[] | undefined; techStack?: string[] | undefined; techNotes?: Record | undefined; nonFunctionalRequirements?: unknown[] | undefined; constraints?: string[] | undefined; sprints?: unknown[] | undefined; metadata?: Record | undefined; completedAt?: string | undefined; }; sprintHistory: { status: "failed" | "completed" | "evaluating" | "in-progress" | "proposed" | "negotiating" | "agreed" | "passed" | "needs-rework"; description: string; specId: string; title: string; contractId: string; sprintNumber: number; successCriteria: { description: string; required: boolean; criterionId: string; verificationMethod: "build" | "lint" | "typecheck" | "manual" | "unit-test" | "playwright" | "api-check" | "agent-evaluation"; }[]; nonGoals: string[]; stopConditions: string[]; definitionOfDone: string; createdAt?: string | undefined; features?: string[] | undefined; assumptions?: string[] | undefined; outOfScope?: string[] | undefined; ambiguityScore?: number | undefined; updatedAt?: string | undefined; completedAt?: string | undefined; dependsOn?: string[] | undefined; generatorNotes?: string | undefined; evaluatorNotes?: string | undefined; estimatedFiles?: string[] | undefined; estimatedDuration?: "small" | "medium" | "large" | undefined; evaluatorFeedback?: string | undefined; iterationHistory?: unknown[] | undefined; lastEvalId?: string | null | undefined; evalResults?: unknown[] | undefined; startedAt?: string | undefined; }[]; instructions: string; changedFiles: string[]; decisions: { timestamp: string; description: string; rationale: string; madeBy: "planner" | "generator" | "evaluator" | "human"; }[]; currentContract?: { status: "failed" | "completed" | "evaluating" | "in-progress" | "proposed" | "negotiating" | "agreed" | "passed" | "needs-rework"; description: string; specId: string; title: string; contractId: string; sprintNumber: number; successCriteria: { description: string; required: boolean; criterionId: string; verificationMethod: "build" | "lint" | "typecheck" | "manual" | "unit-test" | "playwright" | "api-check" | "agent-evaluation"; }[]; nonGoals: string[]; stopConditions: string[]; definitionOfDone: string; createdAt?: string | undefined; features?: string[] | undefined; assumptions?: string[] | undefined; outOfScope?: string[] | undefined; ambiguityScore?: number | undefined; updatedAt?: string | undefined; completedAt?: string | undefined; dependsOn?: string[] | undefined; generatorNotes?: string | undefined; evaluatorNotes?: string | undefined; estimatedFiles?: string[] | undefined; estimatedDuration?: "small" | "medium" | "large" | undefined; evaluatorFeedback?: string | undefined; iterationHistory?: unknown[] | undefined; lastEvalId?: string | null | undefined; evalResults?: unknown[] | undefined; startedAt?: string | undefined; } | undefined; }>; export type ContextHandoff = z.infer; /** * Create a new context handoff document. */ export declare function createHandoff(params: { from: AgentRole; to: AgentRole; projectContext: ProjectContext; spec: PlanSpec; currentContract?: SprintContract; sprintHistory: SprintContract[]; instructions: string; changedFiles?: string[]; decisions?: Decision[]; issues?: string[]; }): ContextHandoff; /** * Serialize a handoff document to a JSON string. */ export declare function serializeHandoff(handoff: ContextHandoff): string; /** * Deserialize and validate a JSON string into a ContextHandoff. * Throws on invalid input. */ export declare function deserializeHandoff(json: string): ContextHandoff; /** * Summarize older sprints in the handoff to keep document size manageable. * * Keeps the `keepRecent` most recent sprints in full detail, * and replaces older sprints with minimal summary contracts. * * Returns a new handoff with compacted sprint history. */ export declare function summarizeOlderSprints(handoff: ContextHandoff, keepRecent: number): ContextHandoff; //# sourceMappingURL=context-handoff.d.ts.map