返回 DeepSeek-Reasonix
pinnedContextBridge.ts
根目录 / desktop / frontend / src / lib / pinnedContextBridge.ts
1 export interface PinnedFileInfo {
2 path: string;
3 sizeBytes: number;
4 tokenEstimate: number;
5 error?: string;
6 }
7
8 export interface PinnedContextBindings {
9 PinFileForTab(tabID: string, rel: string): Promise<PinnedFileInfo>;
10 UnpinFileForTab(tabID: string, rel: string): Promise<void>;
11 GetPinnedFilesForTab(tabID: string): Promise<PinnedFileInfo[]>;
12 }
13
14 export function makeMockPinnedContextBindings(): PinnedContextBindings {
15 return {
16 async PinFileForTab(_tabID: string, rel: string) {
17 return { path: rel, sizeBytes: 1024, tokenEstimate: 256 };
18 },
19 async UnpinFileForTab(_tabID: string, _rel: string) {},
20 async GetPinnedFilesForTab(_tabID: string) { return []; },
21 };
22 }
23
23 lines TYPESCRIPT