import type { AssetPack, Blueprint, Domain, PackSource, Profile, SourceAdapterContext } from "../schema.js"; /** * v15.x PR2:文件系统 Pack 实现——读 /{domains,blueprints,profiles}/。 * 与 src/parse/{domain,blueprint,profile}.ts 现有 parser 共用,不重写 parse 算法。 * * PR2:构造从 sync 改 async(读 manifest),走 `MdFilePack.create()` 工厂方法。 * name 解析优先级(§2.4.2): * - reserved pack(source=project/builtin)→ 固定名 prj/pt,跳过 manifest * - 显式 pack + 合法 manifest.name → manifest.name * - 隐式 pack(无 manifest / manifest 无 name / name 校验失败)→ basename 兜底 * * PR1 补丁(S2 修复):构造可选接 adapterCtx——loadXxx 内部 parse 失败时调 * reportError,恢复 v10.x 旧 loadDir 行为的"错误可见性"。未传则 fallback * console.error(diagnostics.ts:reportError 三通道 fallback)。 */ export declare class MdFilePack implements AssetPack { readonly name: string; readonly version: string; readonly rootDir: string; readonly description: string | undefined; readonly source: PackSource; /** adapterCtx 可选——parse 失败时调 reportError 走 notify + log 通道。 */ private readonly adapterCtx; /** issue pt-cold-start-warning-noise(§短期方案 2):manifest 警告列表(name/version/desc 校验失败)。 * parseManifest.warnings 原样透传——session_start 不弹通知,由 /pt packs 主动展示。 */ readonly manifestWarnings: string[]; /** issue pt-cold-start-warning-noise(§短期方案 2):settings pack 无 manifest 时的提示。 * undefined = 不展示(reserved pack 无 manifest 是 back-compat 设计)。 */ readonly manifestMissingHint: string | undefined; private constructor(); /** 位置别名退化表(v15.x §2.4.2 缺口 1-b):reserved pack 无 manifest 时 name 退化到位置别名。 * 用途:back-compat——今天无 manifest 的项目 pack.name 仍是 prj/pt,行为等价。 * v15.x PR7(issue pt-remove-global-pack 移除):global 行删除,reserved pack 从 3 类收敛为 2 类。 */ private static readonly RESERVED_FALLBACK_NAME; /** PR2(v15.x §2.4.2 双层语义):工厂方法(async,读 manifest)。 * 所有 pack 都走 manifest 解析;reserved pack 无 manifest 时 name 退化到位置别名(back-compat)。 * - manifest.name 优先(身份 alias) * - reserved pack 无 manifest → 退化到 RESERVED_FALLBACK_NAME.get(source) * - 非 reserved pack 无 manifest → basename 兜底 * PR7(issue pt-remove-global-pack 移除):reserved pack 从 3 类收敛为 2 类(project/builtin)。 */ static create(args: { rootDir: string; source: PackSource; adapterCtx?: SourceAdapterContext; }): Promise; loadDomains(): Promise; loadBlueprints(): Promise; loadProfiles(): Promise; }