/** * Resolver — 配置层模块。 * * 职责边界: * - 负责:ResolvedConfig 等 配置层职责 * - 不负责:不属于本模块的职责由对应模块承担 * * 被谁调用:项目初始化、配置加载 * 调用谁:node:path、intent、intent_schema、fingerprint、framework_map、logger * * 数据流:输入 → ResolvedConfig 处理 → 输出 * 持久化:无持久化(纯计算/内存态) */ import type { LenientIntent } from "./intent_schema.js"; import { type Fingerprint, type DeploymentFingerprint } from "./detector/fingerprint.js"; /** 解析后的完整配置 */ export interface ResolvedConfig { /** 项目名称 */ name: string; /** 技术栈 */ tech_stack: { backend: { lang: string; framework: string; version: string; }; frontend: { lang: string; framework: string; version: string; }; }; /** 构建命令 */ build_commands: { backend: { build: string; test: string; full: string; }; frontend: { build: string; test: string; full: string; }; }; /** 作用域 */ scope: { backend: string[]; frontend: string[]; }; /** 多工程项目目录(每端一个工程;build scope 据此派生,空则回退探测/根 src/) */ projects?: Array<{ id: string; dir: string; kind?: "frontend-end" | "backend" | "shared"; deployable?: boolean; release_unit?: boolean; tech_stack: { lang: string; framework: string; }; }>; /** 产品画像 */ product_profile: string; /** 交付偏好 */ delivery: { auto_push: boolean; auto_pr: boolean; auto_deploy?: boolean; }; /** 仓库配置 */ repos: Array<{ name: string; path: string; lang?: string; framework?: string; scope?: string[]; }>; /** 脚手架配置 */ scaffold?: { base_package?: string; custom_templates_dir?: string; }; /** 约定文件 */ conventions_file?: string; /** 验证超时 */ verify_timeout?: { build: number; test: number; }; /** 源码扫描排除(glob/路径前缀,相对项目根):排除参考原型包/vendored 等,不入质量扫描与源码摘要 */ scan_exclude?: string[]; /** 产品映射 */ product_mapping?: Record; /** 文件位置表(override 层,brownfield 声明实际位置;空 = greenfield = 现状)。 * 透传 intent.project_map;消费点取 config.project_map?.overrides 传 resolveFilePath。 */ project_map?: { overrides?: Record; }; /** 部署基础设施(自动探测 + intent 覆盖) */ deployment?: DeploymentFingerprint; /** 内部:项目路径 */ _projectPath: string; /** 内部:知识索引降级 */ _knowledgeDegraded?: boolean; /** 内部:探测指纹(供冲突检测使用) */ _fingerprint?: Fingerprint; /** 内部:原始 intent(供冲突检测使用) */ _intent?: LenientIntent; /** 内部:提示信息 */ _hints?: { conflicts: unknown[]; redundancies: unknown[]; }; } /** 配置就绪状态 */ export interface ConfigReadiness { /** 配置是否就绪 */ ready: boolean; /** 缺失的必填字段 */ missing: string[]; } /** 配置阻断信号 */ export interface ConfigBlockedSignal { status: "blocked"; reason: string; missing: string[]; recovery: string; } export declare function resolveConfig(projectRoot: string, skipFingerprint?: boolean): Promise; /** * 检查配置是否就绪。 * * 阻断项(设计文档 第3.3节): * - tech_stack 全 unknown → 缺 tech_stack * - build_commands 全空 → 缺 build_commands * 不阻断: * - product_profile = "default" * - delivery 全 false * - scope 为空 * - repos 为空 */ export declare function checkConfigReadiness(config: ResolvedConfig): ConfigReadiness; /** * 配置就绪守卫 — MCP 入口调用。 * 返回 blocked 信号或附加 hints 的通过信号。 */ export declare function ensureConfigReady(config: ResolvedConfig): ConfigBlockedSignal | { status: "ready"; config: ResolvedConfig; hints: ResolvedConfig["_hints"]; };