/** * OpesPro Workspace Types / 工作空间完整类型定义 * Types for .opop/ plugin self-managed workspace * .opop/ 插件自管工作空间的类型定义 */ export interface OpopConfig { version: number; initialized: boolean; createdAt: string; updatedAt: string; projectName?: string; gitRemotes: GitRemoteConfig[]; pluginSettings: PluginSettings; } export interface GitRemoteConfig { name: string; url: string; platform: GitPlatform; credentialId?: string; default?: boolean; } export type GitPlatform = "github" | "gitee" | "codeup" | "gitlab" | "other"; export interface CredentialEntry { id: string; platform: GitPlatform; type: "token" | "ssh" | "password" | "npm"; label: string; createdAt: string; updatedAt: string; lastUsed?: string; } export interface PluginSettings { autoInitOpop: boolean; persistState: boolean; persistMemory: boolean; logLevel: "debug" | "info" | "warn" | "error"; } export interface AgentState { agentName: string; role: string; totalTasks: number; successfulTasks: number; failedTasks: number; lastSessionId?: string; lastActiveAt?: string; firstActiveAt: string; modelUsed?: string; taskCategories?: Record; } export interface HookState { hookName: string; category: "orchestration" | "injection" | "recovery" | "context" | "monitoring"; invocationCount: number; lastInvokedAt?: string; errors: number; lastError?: string; avgDurationMs?: number; } export interface MemoryEntry { id: string; type: "decision" | "context" | "knowledge" | "fact"; title: string; content: string; tags: string[]; createdAt: string; agentName?: string; sessionId?: string; importance: "low" | "medium" | "high" | "critical"; relatedTaskId?: string; expiresAt?: string; } export interface DecisionRecord extends MemoryEntry { type: "decision"; options: string[]; chosen: string; rationale: string; alternatives: string[]; } export interface ContextSnapshot { id: string; sessionId: string; timestamp: string; summary: string; activeSkills: string[]; activeAgents: string[]; remainingTasks: string[]; keyFacts: string[]; fileReferences: string[]; } export interface TaskPlan { id: string; title: string; description: string; status: "draft" | "in_progress" | "completed" | "cancelled"; createdAt: string; updatedAt: string; steps: TaskStep[]; agentAssignments: Record; dependencies: TaskDependency[]; estimatedDuration?: number; actualDuration?: number; } export interface TaskStep { index: number; title: string; description: string; status: "pending" | "in_progress" | "completed" | "failed" | "skipped"; agentType: string; skillsRequired: string[]; output?: string; startedAt?: string; completedAt?: string; retryCount: number; maxRetries: number; } export interface TaskDependency { stepIndex: number; dependsOn: number[]; type: "sequential" | "parallel" | "conditional"; } export interface TaskTrackingEntry { taskId: string; planId?: string; agentName: string; action: "started" | "completed" | "failed" | "retried" | "cancelled"; timestamp: string; duration?: number; output?: string; error?: string; metadata?: Record; } export interface ChangelogEntry { version: string; date: string; type: "feat" | "fix" | "refactor" | "docs" | "style" | "perf" | "chore"; title: string; description: string; author: string; files: string[]; commitHash?: string; } export interface ProjectSnapshot { id: string; timestamp: string; version: string; directoryTree: string; fileCount: number; totalLines: number; keyChanges: string[]; } export interface SkillWorkspaceState { skillName: string; lastUsedAt?: string; totalInvocations: number; successfulInvocations: number; lastOutput?: string; lastBuildFile?: string; lastBuildDate?: string; cacheFiles: string[]; }