import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; /** session JSONL 通用接口的最小子集(结构类型,不用 ReadonlySessionManager——不在 pi 包顶层 export)。 */ export interface MinimalSessionManager { getEntries(): Array<{ type: string; customType?: string; data?: unknown; }>; } /** session JSONL 中持久化 activeProfile 的 custom entry customType。 * 用 `pt:` 命名空间避免污染 pi 通用命名空间。 */ export declare const PT_PROFILE_ENTRY = "pt:active-profile"; /** 从 session JSONL 读上次保存的 profile。 * - 反向遍历 entries,取最后一个 `pt:active-profile`(最新一次切换覆盖前一次)。 * - 静默 fallback:SessionManager 不可用 / ephemeral session / entry 损坏 → 返 undefined。 * - 不校验 profile 是否仍存在于 assets——校验留给 transpileActive(transpile 失败会被 session_start catch)。 * - 用结构类型而非 `ReadonlySessionManager`(该类型不在 pi 包顶层 export.d.ts 里)。 */ export declare function readProfileFromSession(sessionManager: MinimalSessionManager): string | undefined; /** 把当前 activeProfile 写入 session JSONL(Pi 自带持久化)。 * - 用 `pi.appendEntry()`(dist/core/extensions/types.d.ts:78 官方 API)。 * - 失败静默(ephemeral session / 旧版 pi 无此 API)——内存中 activeProfile 仍可用本进程。 */ export declare function persistProfileToSession(pi: ExtensionAPI, name: string): void;