declare const CLAUDE_PROJECTS_DIR: string; /** * 将文件系统路径转换为 claude cli 的 project 目录名 * Unix: /Users/foo/bar → -Users-foo-bar * Windows: C:\Users\foo\bar → -C-Users-foo-bar */ declare function cwdToProjectDirName(cwd: string): string; /** 获取项目对应的目录名(project ID) */ declare function getProjectDirName(cwd: string): string; /** 获取项目目录的完整路径 */ declare function getProjectDir(dirName: string): string; /** 获取 session 的 .jsonl 文件路径 */ declare function getSessionFile(dirName: string, sessionId: string): string; interface RuntimeSession { /** SDK session UUID;新建 session 首次 query 前为 null */ sessionId: string | null; projectDirName: string; cwd: string; status: 'idle' | 'busy'; abort: AbortController | null; } declare function getRuntimeSession(sessionId: string): RuntimeSession | null; declare function setRuntimeSession(session: RuntimeSession): void; declare function deleteRuntimeSession(sessionId: string): void; /** 根据已知 sessionId 获取或新建运行时状态 */ declare function getOrCreateRuntime(sessionId: string, cwd: string): RuntimeSession; /** 为新 session(尚无 sessionId)创建运行时状态,query 完成后调用 assignSessionId */ declare function createPendingRuntime(cwd: string): RuntimeSession; /** SDK 分配了真实 sessionId 后,把 runtime 注册进 map */ declare function assignSessionId(runtime: RuntimeSession, sessionId: string): void; declare function setPendingApproval(sessionId: string, resolve: (decision: any) => void): void; declare function resolvePendingApproval(sessionId: string, decision: any): boolean; export { CLAUDE_PROJECTS_DIR, type RuntimeSession, assignSessionId, createPendingRuntime, cwdToProjectDirName, deleteRuntimeSession, getOrCreateRuntime, getProjectDir, getProjectDirName, getRuntimeSession, getSessionFile, resolvePendingApproval, setPendingApproval, setRuntimeSession };