import { ArtifactManager, ArtifactType } from '../core/artifact-manager'; import { ProjectState } from '../core/project-state'; /** * Subagent Protocols - Strict protocols for AI persona behavior * * Defines mandatory protocols that every AI subagent must follow: * - Asset creation and tracking requirements * - State management obligations * - Handoff procedures between personas * - Quality gates and validation checkpoints */ export interface SubagentProtocol { readonly personaName: string; readonly primaryArtifacts: ArtifactType[]; readonly secondaryArtifacts: ArtifactType[]; readonly requiredInputs: ArtifactType[]; initialize(context: SubagentContext): Promise; validatePrerequisites(): Promise; executeCore(): Promise; createArtifacts(): Promise; validateOutputs(): Promise; handoffToNext(): Promise; cleanup(): Promise; } export interface SubagentContext { projectState: ProjectState; artifactManager: ArtifactManager; sessionId: string; userContext: string; parentPersona?: string; } export interface ValidationResult { valid: boolean; errors: string[]; warnings: string[]; blockers: string[]; } export interface ExecutionResult { success: boolean; outputs: string[]; artifacts: string[]; nextSteps: string[]; recommendedPersona?: string; } export interface ArtifactCreationResult { artifactId: string; type: ArtifactType; status: 'created' | 'updated' | 'failed'; message: string; } export interface HandoffResult { nextPersona: string; context: string; artifacts: string[]; instructions: string; } /** * Base Protocol Implementation - All AI personas must extend this */ export declare abstract class BaseSubagentProtocol implements SubagentProtocol { abstract readonly personaName: string; abstract readonly primaryArtifacts: ArtifactType[]; abstract readonly secondaryArtifacts: ArtifactType[]; abstract readonly requiredInputs: ArtifactType[]; protected context: SubagentContext; protected executionLog: string[]; initialize(context: SubagentContext): Promise; validatePrerequisites(): Promise; abstract executeCore(): Promise; abstract createArtifacts(): Promise; abstract validatePersonaSpecific(): Promise; validateOutputs(): Promise; handoffToNext(): Promise; cleanup(): Promise; protected log(message: string): void; protected abstract determineNextPersona(): string; protected abstract getCreatedArtifacts(): string[]; protected abstract buildHandoffContext(): string; protected abstract buildHandoffInstructions(nextPersona: string): string; } /** * Specific Protocol Implementations */ export declare class MentorProtocol extends BaseSubagentProtocol { readonly personaName = "The Mentor"; readonly primaryArtifacts: ArtifactType[]; readonly secondaryArtifacts: ArtifactType[]; readonly requiredInputs: ArtifactType[]; executeCore(): Promise; createArtifacts(): Promise; validatePersonaSpecific(): Promise; protected determineNextPersona(): string; protected getCreatedArtifacts(): string[]; protected buildHandoffContext(): string; protected buildHandoffInstructions(nextPersona: string): string; private generateProjectRoadmap; } export declare class GauntletProtocol extends BaseSubagentProtocol { readonly personaName = "The Gauntlet"; readonly primaryArtifacts: ArtifactType[]; readonly secondaryArtifacts: ArtifactType[]; readonly requiredInputs: ArtifactType[]; executeCore(): Promise; createArtifacts(): Promise; private generateValidationReport; private generateConceptBrief; validatePersonaSpecific(): Promise; protected determineNextPersona(): string; protected getCreatedArtifacts(): string[]; protected buildHandoffContext(): string; protected buildHandoffInstructions(nextPersona: string): string; } export declare class ArchitectProtocol extends BaseSubagentProtocol { readonly personaName = "The Architect"; readonly primaryArtifacts: ArtifactType[]; readonly secondaryArtifacts: ArtifactType[]; readonly requiredInputs: ArtifactType[]; executeCore(): Promise; createArtifacts(): Promise; private generatePRDDocument; private generateTechnicalArchitecture; validatePersonaSpecific(): Promise; protected determineNextPersona(): string; protected getCreatedArtifacts(): string[]; protected buildHandoffContext(): string; protected buildHandoffInstructions(nextPersona: string): string; } /** * Protocol Factory - Creates appropriate protocol instance for each persona */ export declare class SubagentProtocolFactory { static createProtocol(personaName: string): BaseSubagentProtocol; }