/** * GLOBAL 全量层管理核心模块 * 负责管理 GLOBAL/ 目录下的全量需求索引、项目映射、迭代关联 */ /** 需求状态 */ export type ReqStatus = '📦 已有实现' | '✅ 已实现' | '🔄 进行中' | '🔲 待开发' | '🗑️ 已废弃'; /** 项目类型 */ export type ProjectType = 'backend' | 'web' | 'h5' | 'miniapp'; /** 需求索引条目 */ export interface ReqIndexEntry { id: string; project: string; name: string; status: ReqStatus; version: string; iteration: string; task: string; filePath: string; } /** 项目条目 */ export interface ProjectEntry { name: string; type: ProjectType; reqCount: number; implemented: number; inProgress: number; pending: number; lastImport: string; } /** 迭代关联条目 */ export interface IterationLink { name: string; reqs: string[]; status: string; createdAt: string; } /** INDEX.md 解析后的全局索引 */ export interface GlobalIndex { reqs: ReqIndexEntry[]; projects: ProjectEntry[]; iterations: IterationLink[]; version: string; lastUpdated: string; } /** 导入项目参数 */ export interface ImportProjectParams { project: string; path: string; type: ProjectType; } /** 需求变更条目 */ export interface ReqChange { reqId: string; reqName: string; project: string; changeType: '新增' | '修改' | '废弃'; changeDesc: string; } declare function getGlobalDir(): string; declare function getIndexPath(): string; declare function getProjectReqPath(project: string): string; declare function getProjectMetaPath(project: string): string; /** * 解析 GLOBAL/INDEX.md */ export declare function readGlobalIndex(): Promise; /** * 获取下一个需求编号 */ export declare function getNextReqId(index: GlobalIndex): string; /** * 递增全局版本号 */ export declare function bumpGlobalVersion(currentVersion: string): string; /** * 追加需求条目到 INDEX.md 的需求索引表 */ export declare function appendReqToIndex(entry: ReqIndexEntry): Promise; /** * 更新 INDEX.md 中需求条目的状态、版本等信息 */ export declare function updateReqInIndex(reqId: string, updates: Partial): Promise; /** * 追加项目条目到 INDEX.md */ export declare function upsertProjectInIndex(project: ProjectEntry): Promise; /** * 追加迭代关联到 INDEX.md */ export declare function appendIterationLink(link: IterationLink): Promise; /** * 更新 INDEX.md 版本信息 */ export declare function updateIndexVersion(version: string): Promise; /** * 确保项目目录存在 */ export declare function ensureProjectDir(project: string): Promise; /** * 写入项目需求文档 */ export declare function writeProjectRequirements(project: string, projectType: ProjectType, requirements: { name: string; description: string; id: string; }[], techStack?: string): Promise; /** * 写入项目元数据 */ export declare function writeProjectMetadata(project: string, projectType: ProjectType, techStack?: string, repoUrl?: string): Promise; /** * 从指定项目中读取指定需求 ID 的详细内容 */ export declare function readRequirementDetail(project: string, reqId: string): Promise; /** * 对比两个需求描述并返回变更清单 */ export declare function diffRequirements(sourceTitle: string, sourceContent: string, targetContent: string): ReqChange[]; /** * 获取所有已导入项目的列表 */ export declare function listProjectDirs(): Promise; export { getGlobalDir, getIndexPath, getProjectReqPath, getProjectMetaPath }; //# sourceMappingURL=global-layer.d.ts.map