forked from NoeFabris/opencode-antigravity-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignature-store.ts
More file actions
30 lines (25 loc) · 799 Bytes
/
Copy pathsignature-store.ts
File metadata and controls
30 lines (25 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import type { SignatureStore, SignedThinking, ThoughtBuffer } from '../core/streaming/types';
export function createSignatureStore(): SignatureStore {
const store = new Map<string, SignedThinking>();
return {
get: (key: string) => store.get(key),
set: (key: string, value: SignedThinking) => {
store.set(key, value);
},
has: (key: string) => store.has(key),
delete: (key: string) => {
store.delete(key);
},
};
}
export function createThoughtBuffer(): ThoughtBuffer {
const buffer = new Map<number, string>();
return {
get: (index: number) => buffer.get(index),
set: (index: number, text: string) => {
buffer.set(index, text);
},
clear: () => buffer.clear(),
};
}
export const defaultSignatureStore = createSignatureStore();