Skip to content

Commit 520bd82

Browse files
committed
fix: formatting
1 parent fac3b99 commit 520bd82

247 files changed

Lines changed: 16203 additions & 12942 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

frontend/.prettierignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Ignore artifacts:
2+
.next
3+
dist
4+
build
5+
node_modules
6+
out
7+
8+
# Ignore content docs to prevent formatting issues
9+
*.mdx
10+
*.md

frontend/.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"trailingComma": "es5",
6+
"printWidth": 100
7+
}

frontend/dprint.json

Lines changed: 0 additions & 26 deletions
This file was deleted.

frontend/electron.d.ts

Lines changed: 65 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,80 @@
11
declare global {
22
interface Window {
33
electron: {
4-
onShowMenu: (callback: (text: string) => void) => () => void;
5-
replaceText: (text: string) => void;
6-
closeMenu: () => void;
7-
resizeWindow: (size: { width?: number; height?: number }) => void;
8-
moveWindow: (delta: { x: number; y: number }) => void;
9-
openSettings: () => void;
10-
onShowSuggestion: (callback: (data: { context: string }) => void) => () => void;
11-
acceptSuggestion: (text: string) => void;
12-
dismissSuggestion: () => void;
13-
getSuggestionMode: () => Promise<"hotkey" | "auto">;
14-
setSuggestionMode: (mode: "hotkey" | "auto") => void;
15-
getTextOutputMode: () => Promise<"paste" | "typewriter" | "typewriter-leetcode">;
16-
setTextOutputMode: (mode: "paste" | "typewriter" | "typewriter-leetcode") => void;
17-
toggleBrainPanel: () => void;
18-
setBrainPanelCollapsed: (collapsed: boolean) => void;
19-
onMemoryStored: (callback: (memory: string) => void) => () => void;
20-
onCaptureStatusChanged: (callback: (enabled: boolean) => void) => () => void;
21-
getContextCaptureEnabled: () => Promise<boolean>;
22-
setContextCaptureEnabled: (enabled: boolean) => void;
23-
onAnalyzeScreenshot: (callback: (data: { dataUrl: string; timestamp: string }) => void) => () => void;
24-
captureScreen: () => Promise<string | null>;
25-
openExternal: (url: string) => void;
26-
notifyAnalysisComplete: (success: boolean) => void;
4+
onShowMenu: (callback: (text: string) => void) => () => void
5+
replaceText: (text: string) => void
6+
closeMenu: () => void
7+
resizeWindow: (size: { width?: number; height?: number }) => void
8+
moveWindow: (delta: { x: number; y: number }) => void
9+
openSettings: () => void
10+
onShowSuggestion: (callback: (data: { context: string }) => void) => () => void
11+
acceptSuggestion: (text: string) => void
12+
dismissSuggestion: () => void
13+
getSuggestionMode: () => Promise<'hotkey' | 'auto'>
14+
setSuggestionMode: (mode: 'hotkey' | 'auto') => void
15+
getTextOutputMode: () => Promise<'paste' | 'typewriter' | 'typewriter-leetcode'>
16+
setTextOutputMode: (mode: 'paste' | 'typewriter' | 'typewriter-leetcode') => void
17+
toggleBrainPanel: () => void
18+
setBrainPanelCollapsed: (collapsed: boolean) => void
19+
onMemoryStored: (callback: (memory: string) => void) => () => void
20+
onCaptureStatusChanged: (callback: (enabled: boolean) => void) => () => void
21+
getContextCaptureEnabled: () => Promise<boolean>
22+
setContextCaptureEnabled: (enabled: boolean) => void
23+
onAnalyzeScreenshot: (
24+
callback: (data: { dataUrl: string; timestamp: string }) => void
25+
) => () => void
26+
captureScreen: () => Promise<string | null>
27+
openExternal: (url: string) => void
28+
notifyAnalysisComplete: (success: boolean) => void
2729
// Ghost Text Overlay
28-
on: (channel: string, callback: (...args: unknown[]) => void) => void;
29-
removeListener: (channel: string, callback: (...args: unknown[]) => void) => void;
30-
getGhostTextEnabled: () => Promise<boolean>;
31-
setGhostTextEnabled: (enabled: boolean) => void;
30+
on: (channel: string, callback: (...args: unknown[]) => void) => void
31+
removeListener: (channel: string, callback: (...args: unknown[]) => void) => void
32+
getGhostTextEnabled: () => Promise<boolean>
33+
setGhostTextEnabled: (enabled: boolean) => void
3234
// Ghost Text Auto-Trigger
33-
getGhostTextAutoTrigger: () => Promise<boolean>;
34-
setGhostTextAutoTrigger: (enabled: boolean) => void;
35-
getGhostTextAutoTriggerDelay: () => Promise<number>;
36-
setGhostTextAutoTriggerDelay: (delayMs: number) => void;
35+
getGhostTextAutoTrigger: () => Promise<boolean>
36+
setGhostTextAutoTrigger: (enabled: boolean) => void
37+
getGhostTextAutoTriggerDelay: () => Promise<number>
38+
setGhostTextAutoTriggerDelay: (delayMs: number) => void
3739
// User ID Persistence
38-
setUserId: (userId: string) => void;
39-
getUserId: () => Promise<string | null>;
40+
setUserId: (userId: string) => void
41+
getUserId: () => Promise<string | null>
4042
// Cached Memories for Inline Suggestions
41-
setCachedMemories: (memories: string[]) => void;
42-
getCachedMemories: () => Promise<string[]>;
43+
setCachedMemories: (memories: string[]) => void
44+
getCachedMemories: () => Promise<string[]>
4345
// Content Protection (Invisibility)
44-
getContentProtectionEnabled: () => Promise<boolean>;
45-
setContentProtectionEnabled: (enabled: boolean) => void;
46+
getContentProtectionEnabled: () => Promise<boolean>
47+
setContentProtectionEnabled: (enabled: boolean) => void
4648
// Voice Agent Panel
47-
onVoiceAgentStart: (callback: () => void) => () => void;
48-
onVoiceAgentStop: (callback: () => void) => () => void;
49-
onVoiceAgentState: (callback: (data: { state: string }) => void) => () => void;
50-
onVoiceAgentReset: (callback: () => void) => () => void;
51-
onVoiceAgentTranscript: (callback: (data: { role: string; text: string }) => void) => () => void;
52-
voiceAgentSessionStarted: () => void;
53-
voiceAgentSessionStopped: () => void;
54-
voiceAgentStateChange: (state: string) => void;
55-
voiceAgentHide: () => void;
56-
getVoiceAgentActive: () => Promise<boolean>;
49+
onVoiceAgentStart: (callback: () => void) => () => void
50+
onVoiceAgentStop: (callback: () => void) => () => void
51+
onVoiceAgentState: (callback: (data: { state: string }) => void) => () => void
52+
onVoiceAgentReset: (callback: () => void) => () => void
53+
onVoiceAgentTranscript: (
54+
callback: (data: { role: string; text: string }) => void
55+
) => () => void
56+
voiceAgentSessionStarted: () => void
57+
voiceAgentSessionStopped: () => void
58+
voiceAgentStateChange: (state: string) => void
59+
voiceAgentHide: () => void
60+
getVoiceAgentActive: () => Promise<boolean>
5761
// Transcribe Mode
58-
onTranscribeStart: (callback: () => void) => () => void;
59-
onTranscribeStop: (callback: () => void) => () => void;
60-
onTranscribeState: (callback: (data: { state: string }) => void) => () => void;
61-
onTranscribeAudioLevel: (callback: (data: { level: number }) => void) => () => void;
62-
sendTranscribeAudio: (audioBase64: string) => void;
63-
getTranscribeState: () => Promise<{ state: string }>;
62+
onTranscribeStart: (callback: () => void) => () => void
63+
onTranscribeStop: (callback: () => void) => () => void
64+
onTranscribeState: (callback: (data: { state: string }) => void) => () => void
65+
onTranscribeAudioLevel: (callback: (data: { level: number }) => void) => () => void
66+
sendTranscribeAudio: (audioBase64: string) => void
67+
getTranscribeState: () => Promise<{ state: string }>
6468
// Model Settings
65-
getDefaultModel: () => Promise<string>;
66-
setDefaultModel: (model: string) => void;
67-
getDefaultFastModel: () => Promise<string>;
68-
setDefaultFastModel: (model: string) => void;
69+
getDefaultModel: () => Promise<string>
70+
setDefaultModel: (model: string) => void
71+
getDefaultFastModel: () => Promise<string>
72+
setDefaultFastModel: (model: string) => void
6973
// Onboarding
70-
getOnboardingComplete: () => Promise<boolean>;
71-
setOnboardingComplete: (complete: boolean) => void;
72-
};
74+
getOnboardingComplete: () => Promise<boolean>
75+
setOnboardingComplete: (complete: boolean) => void
76+
}
7377
}
7478
}
7579

76-
export { };
77-
80+
export {}

frontend/electron/src/app-state.ts

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
1-
import { BrowserWindow, Tray } from "electron";
2-
import Store from "electron-store";
3-
import type { ContextCaptureService } from "./services/context-capture";
4-
import type { GhostTextOverlay } from "./services/ghost-overlay";
5-
import type { InterviewGhostService } from "./services/interview-ghost";
6-
import type { KeyboardMonitor } from "./services/keyboard-monitor";
7-
import type { KeystrokeListener } from "./services/keystroke-listener";
8-
import type { TextOutputMode } from "./services/text-handler";
1+
import { BrowserWindow, Tray } from 'electron'
2+
import Store from 'electron-store'
3+
import type { ContextCaptureService } from './services/context-capture'
4+
import type { GhostTextOverlay } from './services/ghost-overlay'
5+
import type { InterviewGhostService } from './services/interview-ghost'
6+
import type { KeyboardMonitor } from './services/keyboard-monitor'
7+
import type { KeystrokeListener } from './services/keystroke-listener'
8+
import type { TextOutputMode } from './services/text-handler'
99

10-
export type VoiceMode = "transcribe" | "command" | "generate";
10+
export type VoiceMode = 'transcribe' | 'command' | 'generate'
1111

12-
const store = new Store();
12+
const store = new Store()
1313

1414
export interface AppStateType {
15-
mainWindow: BrowserWindow | null;
16-
settingsWindow: BrowserWindow | null;
17-
suggestionWindow: BrowserWindow | null;
18-
brainPanelWindow: BrowserWindow | null;
19-
tray: Tray | null;
20-
nextJSPort: number | null;
21-
22-
contextCaptureService: ContextCaptureService | null;
23-
ghostOverlay: GhostTextOverlay | null;
24-
interviewGhostService: InterviewGhostService | null;
25-
keyboardMonitor: KeyboardMonitor | null;
26-
keystrokeListener: KeystrokeListener | null;
27-
28-
suggestionMode: "hotkey" | "auto";
29-
textOutputMode: TextOutputMode;
30-
ghostTextEnabled: boolean;
31-
ghostTextAutoTrigger: boolean;
32-
ghostTextAutoTriggerDelay: number;
33-
contentProtectionEnabled: boolean;
34-
35-
defaultModel: string;
36-
defaultFastModel: string;
37-
38-
clipboardWatcher: NodeJS.Timeout | null;
39-
lastClipboardContent: string;
40-
isInternalClipboardOp: boolean;
41-
42-
currentUserId: string | null;
43-
cachedMemories: string[];
44-
currentVoiceMode: VoiceMode;
45-
onboardingComplete: boolean;
15+
mainWindow: BrowserWindow | null
16+
settingsWindow: BrowserWindow | null
17+
suggestionWindow: BrowserWindow | null
18+
brainPanelWindow: BrowserWindow | null
19+
tray: Tray | null
20+
nextJSPort: number | null
21+
22+
contextCaptureService: ContextCaptureService | null
23+
ghostOverlay: GhostTextOverlay | null
24+
interviewGhostService: InterviewGhostService | null
25+
keyboardMonitor: KeyboardMonitor | null
26+
keystrokeListener: KeystrokeListener | null
27+
28+
suggestionMode: 'hotkey' | 'auto'
29+
textOutputMode: TextOutputMode
30+
ghostTextEnabled: boolean
31+
ghostTextAutoTrigger: boolean
32+
ghostTextAutoTriggerDelay: number
33+
contentProtectionEnabled: boolean
34+
35+
defaultModel: string
36+
defaultFastModel: string
37+
38+
clipboardWatcher: NodeJS.Timeout | null
39+
lastClipboardContent: string
40+
isInternalClipboardOp: boolean
41+
42+
currentUserId: string | null
43+
cachedMemories: string[]
44+
currentVoiceMode: VoiceMode
45+
onboardingComplete: boolean
4646
}
4747

4848
export const AppState: AppStateType = {
@@ -59,29 +59,29 @@ export const AppState: AppStateType = {
5959
keyboardMonitor: null,
6060
keystrokeListener: null,
6161

62-
suggestionMode: "hotkey",
63-
textOutputMode: "paste",
62+
suggestionMode: 'hotkey',
63+
textOutputMode: 'paste',
6464
ghostTextEnabled: false,
6565
ghostTextAutoTrigger: false,
6666
ghostTextAutoTriggerDelay: 3000,
6767
contentProtectionEnabled: true,
6868

69-
defaultModel: (store.get("defaultModel") as string) || "gpt-4.1-mini",
70-
defaultFastModel: (store.get("defaultFastModel") as string) || "gpt-4.1-mini",
69+
defaultModel: (store.get('defaultModel') as string) || 'gpt-4.1-mini',
70+
defaultFastModel: (store.get('defaultFastModel') as string) || 'gpt-4.1-mini',
7171

7272
clipboardWatcher: null,
73-
lastClipboardContent: "",
73+
lastClipboardContent: '',
7474
isInternalClipboardOp: false,
7575

76-
currentUserId: store.get("userId") as string | null,
77-
cachedMemories: (store.get("cachedMemories") as string[]) || [],
78-
currentVoiceMode: "transcribe",
79-
onboardingComplete: store.get("onboardingComplete") as boolean || false,
80-
};
76+
currentUserId: store.get('userId') as string | null,
77+
cachedMemories: (store.get('cachedMemories') as string[]) || [],
78+
currentVoiceMode: 'transcribe',
79+
onboardingComplete: (store.get('onboardingComplete') as boolean) || false,
80+
}
8181

82-
export const getStore = () => store;
82+
export const getStore = () => store
8383

8484
export const getPort = (): number => {
85-
const { is } = require("@electron-toolkit/utils");
86-
return is.dev ? 3000 : (AppState.nextJSPort || 3000);
87-
};
85+
const { is } = require('@electron-toolkit/utils')
86+
return is.dev ? 3000 : AppState.nextJSPort || 3000
87+
}
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import { desktopCapturer, ipcMain } from "electron";
1+
import { desktopCapturer, ipcMain } from 'electron'
22

33
export const registerCaptureHandlers = (): void => {
4-
ipcMain.handle("capture-screen", async () => {
4+
ipcMain.handle('capture-screen', async () => {
55
try {
66
const sources = await desktopCapturer.getSources({
7-
types: ["screen"],
7+
types: ['screen'],
88
thumbnailSize: { width: 1280, height: 720 },
9-
});
9+
})
1010

1111
if (sources.length === 0) {
12-
console.log("[IPC] No screen sources found");
13-
return null;
12+
console.log('[IPC] No screen sources found')
13+
return null
1414
}
1515

16-
return sources[0].thumbnail.toDataURL();
16+
return sources[0].thumbnail.toDataURL()
1717
} catch (error) {
18-
console.error("[IPC] Screenshot capture failed:", error);
19-
return null;
18+
console.error('[IPC] Screenshot capture failed:', error)
19+
return null
2020
}
21-
});
22-
};
21+
})
22+
}

0 commit comments

Comments
 (0)