-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
65 lines (55 loc) · 1.95 KB
/
types.ts
File metadata and controls
65 lines (55 loc) · 1.95 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
export interface ProjectFile {
name: string;
content: string;
language: string;
}
// Fix: Add 'axiom' to MemoryAtomType to resolve type errors in arbiterService.ts and recallWeaverService.ts
export type MemoryAtomType = 'user_message' | 'model_response' | 'steward_note' | 'conscious_thought' | 'subconscious_reflection' | 'axiom';
export interface GeneratedFile {
name: string;
content: string;
language: string;
}
export interface MemoryAtom {
uuid: string;
timestamp: number;
role: 'user' | 'model';
type: MemoryAtomType;
text: string;
isInContext: boolean;
isCollapsed: boolean;
concepts?: string[];
generatedFiles?: GeneratedFile[];
// New properties for STM/LTM with Fibonacci decay
activationScore?: number;
lastActivatedTurn?: number;
// New properties for nesting cognitive artifacts
cognitiveTrace?: MemoryAtom[];
backgroundInsight?: BackgroundInsight;
}
export interface SessionState {
messages: MemoryAtom[];
projectFiles: ProjectFile[];
contextFileNames: string[];
selfNarrative?: string;
}
// New type for background cognition results
export interface BackgroundInsight {
query: string;
insight: string;
sources: { web: { uri: string; title: string } }[];
}
// FIX: Resolved a type collision by defining the `AIStudio` interface and using it on the global `Window` object.
// The previous inline/anonymous type for `aistudio` conflicted with another declaration.
// The `AIStudio` interface is now defined inside the `declare global` block to prevent type conflicts.
declare global {
// FIX: Moved the AIStudio interface into the `declare global` block to ensure it becomes a single, mergeable global type.
// This resolves the "Subsequent property declarations must have the same type" error by preventing module-scoped type conflicts.
interface AIStudio {
hasSelectedApiKey: () => Promise<boolean>;
openSelectKey: () => Promise<void>;
}
interface Window {
aistudio?: AIStudio;
}
}