/** * WebForge 核心类型定义 */ export type TaskStatus = 'pending' | 'ready' | 'in_progress' | 'blocked' | 'completed' | 'failed'; export type TaskExecutionMode = 'auto' | 'manual'; export type TaskModule = 'frontend' | 'backend' | 'database' | 'auth' | 'testing' | 'architecture' | 'devops' | 'pm'; export interface Task { id: string; phase: string; title: string; description?: string; status: TaskStatus; assignee: string; depends_on: string[]; blocked_by?: string[]; priority: number; created_at: string; updated_at: string; completed_at?: string; executionMode?: TaskExecutionMode; workflowContext?: WorkspaceWorkflowContext; metadata?: Record; /** * 任务涉及的模块/领域列表 * 用于自动推断关联的知识文档 * 示例: ["frontend", "auth"] */ modules?: TaskModule[]; /** * 关联的知识文档路径列表 * 用于 onboard 时推荐 Agent 先阅读相关文档 * 示例: [".webforge/knowledge/decisions/ADR-001-clean-architecture.md"] */ knowledgeRefs?: string[]; } export type PhaseStatus = 'pending' | 'in_progress' | 'blocked' | 'completed'; export interface Phase { id: string; name: string; description?: string; status: PhaseStatus; progress: number; depends_on: string[]; created_at: string; updated_at: string; completed_at?: string; } export type WorkerState = 'idle' | 'busy' | 'paused' | 'error'; export interface Worker { id: string; role: string; name: string; description: string; skills: string[]; tools: string[]; state: WorkerState; current_task?: string; system_prompt?: string; } export interface WorkerConfig { role: string; name: string; description: string; skills: string[]; tools: string[]; system_prompt: string; } export type MessageType = 'task_assign' | 'task_complete' | 'task_blocked' | 'question' | 'answer' | 'notification' | 'approval_request' | 'approval_result'; export interface Message { id: string; from: string; to: string; type: MessageType; task_id?: string; content: string; timestamp: string; read?: boolean; metadata?: Record; } export interface ProjectConfig { name: string; version: string; description: string; } export interface OrchestratorConfig { max_parallel_workers: number; checkpoint_interval: number; } export type AgentProvider = 'stub' | 'codex' | 'claude-code'; export type AgentPermissionProfile = 'read-only' | 'workspace-write' | 'approval-required'; export interface AgentProfileConfig { provider: AgentProvider; fallback_provider?: AgentProvider; permission_profile: AgentPermissionProfile; model?: string; command?: string; } export interface WebForgeConfig { project: ProjectConfig; orchestrator: OrchestratorConfig; agent?: AgentProfileConfig; workers: string[]; phases: Phase[]; } export type WorkspaceVersion = '0.2'; export type WorkspaceRuntimeStatus = 'idle' | 'active' | 'blocked' | 'error'; export interface WorkspaceRuntime { version: WorkspaceVersion; status: WorkspaceRuntimeStatus; updatedAt: string; sessionId: string | null; phaseId: string | null; taskId: string | null; summary: string; workflowContext: WorkspaceWorkflowContext | null; } export interface WorkspacePaths { root: string; workspace: string; config: string; tasks: string; phases: string; runtime: string; superpowers: string; superpowersRuns: string; knowledge: string; knowledgeIndex: string; knowledgeRequirements: string; knowledgeDesign: string; knowledgeDecisions: string; knowledgeParsed: string; deliverables: string; deliverablesIndex: string; sessions: string; sessionsIndex: string; threadsIndex: string; mailboxes: string; logs: string; } export type WorkspaceKnowledgeEntryType = 'requirement' | 'design' | 'decision' | 'parsed' | 'note'; export interface WorkspaceKnowledgeIndexEntry { id: string; type: WorkspaceKnowledgeEntryType; title: string; path: string; createdAt: string; updatedAt: string; tags?: string[]; } export type WorkspaceDeliverableStatus = 'draft' | 'pending_review' | 'approved' | 'rejected'; export type WorkspaceDeliverableType = 'document' | 'code' | 'test' | 'config' | 'design' | 'review'; export interface WorkspaceDeliverableIndexEntry { id: string; taskId: string; type: WorkspaceDeliverableType; title: string; path: string; createdBy: string; createdAt: string; status: WorkspaceDeliverableStatus; reviewComment?: string; } export type WorkspaceSessionStatus = 'active' | 'paused' | 'completed'; export interface WorkspaceSessionIndexEntry { id: string; name: string; createdAt: string; lastActive: string; status: WorkspaceSessionStatus; currentPhase?: string; currentTask?: string; context?: string; workflowContext?: WorkspaceWorkflowContext; stats: { tasksCompleted: number; totalTasks: number; }; } export interface WorkspaceIndexes { knowledge: WorkspaceKnowledgeIndexEntry[]; deliverables: WorkspaceDeliverableIndexEntry[]; sessions: WorkspaceSessionIndexEntry[]; threads: WorkspaceThreadLink[]; superpowersRuns: WorkspaceSuperpowersRun[]; } export interface WorkspaceState { basePath: string; paths: WorkspacePaths; runtime: WorkspaceRuntime; tasks: { tasks: Task[]; }; phases: { phases: Phase[]; }; indexes: WorkspaceIndexes; } export interface WorkspaceInitOptions { projectName: string; template?: string; } export type WorkspaceSuperpowersExecutionMode = 'subagent' | 'inline'; export type WorkspaceSuperpowersCapabilityKind = 'workflow'; export type WorkspaceSuperpowersCapabilityOwner = 'superpowers'; export interface WorkspaceSuperpowersCapability { id: string; kind: WorkspaceSuperpowersCapabilityKind; owner: WorkspaceSuperpowersCapabilityOwner; purpose: string; writes: string[]; artifacts: string[]; recommended: boolean; } export interface WorkspaceSuperpowersRegistry { version: '1'; required: string[]; optional: string[]; execution: WorkspaceSuperpowersExecutionMode | null; generatedAt: string; capabilities: WorkspaceSuperpowersCapability[]; techStack?: Record; } export interface WorkspaceWorkflowContext { workflow: string; runId?: string; recordedAt?: string; summary?: string; owner?: string; waveId?: string; threadId?: string; branch?: string; worktreePath?: string; compactFromSession?: string; artifacts?: string[]; } export type WorkspaceSuperpowersArtifactKind = 'note' | 'knowledge' | 'decision' | 'plan' | 'compact-handoff' | 'thread' | 'worktree-metadata'; export interface WorkspaceSuperpowersArtifact { kind: WorkspaceSuperpowersArtifactKind; path: string; label?: string; } export interface WorkspaceSuperpowersRunMetadata { owner?: string; waveId?: string; threadId?: string; branch?: string; worktreePath?: string; compactFromSession?: string; } export interface WorkspaceSuperpowersRun { id: string; workflow: string; recordedAt: string; summary: string; taskId?: string; sessionId?: string; artifacts: WorkspaceSuperpowersArtifact[]; metadata?: WorkspaceSuperpowersRunMetadata; } export interface WorkspaceThreadLink { id: string; recordedAt: string; workflow: string; summary: string; runId?: string; taskId?: string; sessionId?: string; owner?: string; branch?: string; worktreePath?: string; artifacts: string[]; } export interface CheckpointDeliverableSnapshot { id: string; taskId: string; type: WorkspaceDeliverableType; title: string; path: string; content: string; createdBy: string; createdAt: string; status: WorkspaceDeliverableStatus; reviewComment?: string; snapshotPath: string; } export interface Checkpoint { id: string; name: string; createdAt: string; description?: string; tasks: Task[]; phases: Phase[]; gitCommit?: string; deliverables: CheckpointDeliverableSnapshot[]; } export interface Session { id: string; created_at: string; last_active: string; agent_type: string; agent_model: string; active_worker?: string; context_summary?: string; } export interface RunOptions { dryRun?: boolean; phase?: string; worker?: string; } export interface InitOptions { template?: string; } //# sourceMappingURL=index.d.ts.map