import type { AgentContext, Blueprint, Domain, Profile, SchemaBundle, SourceAdapterContext } from "./schema.js"; export interface TranspileResult { /** 注入 session 的字符串段(聚合所有 inject=session 的聚合组) */ segment: string; /** 各 adapter 返回的 SchemaBundle(保留给 input handler 找 FlowTemplate / listManuals 用) */ bundles: SchemaBundle[]; /** 缓存命中信息 */ cacheHit: boolean; /** v9 新增(给 AgentAdapter 用)。Phase term-P1:context → agentContext(IR 改名同步)。 */ agentContext: AgentContext; blueprint: Blueprint; domains: Domain[]; /** 当前激活的 Profile 名 */ activeProfile: string; /** 当前激活的 Profile(listManuals 范围过滤用) */ profile: Profile; /** v15.x PR6(fix pt-active-profile-fallback-mismatch):bundle.activeProfile 由来 * caller 层依据 origin 决定是否同步 s.activeProfile / loadedFrom / notify。 */ activeProfileOrigin: "exact" | "fallback"; /** origin="fallback" 时记录用户原始请求名(caller 用作 notify 文案 + log) */ originalProfileName?: string; } /** 三段式转译:parse → compile → cache → render。 */ export declare function loadAndTranspile(cwd: string, profileName: string, adapterCtx?: SourceAdapterContext): Promise; /** 删除孤儿 cache 文件(Profile 已不存在的 cache)。 * v13.x(issue pt-no-agent-context-prune-orphan-caches):transpile 末尾自动清理, * 避免 Profile 删改后旧 cache 文件残留误导排查。 * * @param cwd 项目根目录 * @param cacheDir 缓存目录(从 Blueprint.compilation.cacheDir 读,默认 `.pt/cache/agent-contexts/`) * @param validProfileNames 当前 bundle.profiles 合并后的全集(项目覆盖 builtin) * @returns 被 unlink 的 cache 名列表(用于 trace) */ export declare function pruneOrphanCaches(cwd: string, cacheDir: string, validProfileNames: Set): Promise;