mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-11-17 04:11:35 +00:00
* refactor(desktop): remove the onboarding intro cinematic and the guided-onboarding tests The guided first run now opens straight into the guide: the gate's `cinematic` phase becomes `pending`, and OnboardingChatGate owes the guide on mount (the old HERMES_SKIP_INTRO path, now the only path). Removes the native intro window, its IPC bridge, the `?win=intro` renderer, its assets, and the skipIntro launch flag. Deletes the guided-onboarding test files ahead of the rewrite, plus the reset helpers only they called. * refactor(onboarding): strip comments from the guided-onboarding modules Clears comments and docstrings from the guided-onboarding files ahead of their rewrite, desktop and backend. Lint and type pragmas stay. No code changes.
44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
import { type BrowserWindow, ipcMain, screen } from 'electron'
|
|
|
|
import { centeredBounds, type GrowRequest, growWindowBounds } from './window-growth'
|
|
|
|
interface ChatOnboardingWindowOptions {
|
|
enabled: boolean
|
|
mainWindow: () => BrowserWindow | null
|
|
}
|
|
|
|
export function registerChatOnboardingWindow({ enabled, mainWindow }: ChatOnboardingWindowOptions): void {
|
|
ipcMain.on('hermes:chat-onboarding:grow', (event, request: GrowRequest) => {
|
|
const win = mainWindow()
|
|
|
|
if (!enabled || !win || win.isDestroyed() || event.sender !== win.webContents) {
|
|
return
|
|
}
|
|
|
|
const bounds = win.getBounds()
|
|
|
|
win.setBounds(
|
|
growWindowBounds(request, {
|
|
bounds,
|
|
frameWidth: bounds.width - win.getContentBounds().width,
|
|
workArea: screen.getDisplayMatching(bounds).workArea,
|
|
zoom: event.sender.getZoomFactor() || 1
|
|
}),
|
|
true
|
|
)
|
|
})
|
|
|
|
ipcMain.on('hermes:chat-onboarding:solo-boot', event => {
|
|
const win = mainWindow()
|
|
|
|
if (!enabled || !win || win.isDestroyed() || event.sender !== win.webContents) {
|
|
return
|
|
}
|
|
|
|
const area = screen.getDisplayMatching(win.getBounds()).workArea
|
|
const width = Math.min(600, area.width)
|
|
const height = Math.min(640, area.height)
|
|
|
|
win.setBounds(centeredBounds(area, width, height), true)
|
|
})
|
|
}
|