feat(settings): configure Jev evaluation and model transitions

This commit is contained in:
yilsem committed 2026-10-13 01:07:58 +03:00
1 parent 369f6c2ca8
commit 883b1dc824
20 files changed
+1195 -37

No files matched your search

+44
View File
@@ -378,6 +378,7 @@ import { ensureLoginShellPath } from './shell-path'
import { createBootstrapCoordinator, sshConfigFingerprint } from './ssh-bootstrap-coordinator'
import { collectSshConfigHosts, parseSshGOutput } from './ssh-config'
import { createSshProbeConnection, pickLocalPort, redactSecrets, SshConnection } from './ssh-connection'
import { createStagedTransitionStore } from './staged-transition'
import { createStreamThrottle } from './stream-throttle'
import { registerTerminalIpc } from './terminal-ipc'
import { nativeOverlayWidth as computeNativeOverlayWidth, macTitleBarOverlayHeight } from './titlebar-overlay-width'
@@ -17192,6 +17193,21 @@ ipcMain.handle('hermes:quick-entry:settings:set', async (_event, patch) => {
// resulting state and asks for changes over IPC. Windows only (the login item is
// a Run-key value). All decisions live in electron/codex-link.ts.
const AITURK_IDE_DATA_ROOT = path.dirname(HERMES_HOME)
const stagedTransition = createStagedTransitionStore(
path.join(AITURK_IDE_DATA_ROOT, 'codex-bridge'),
path.join(app.getPath('home'), '.typesafe', 'typesafe.env'),
value =>
execFileSync(
'powershell.exe',
[
'-NoProfile',
'-NonInteractive',
'-Command',
'Add-Type -AssemblyName System.Security; $bytes=[Text.Encoding]::UTF8.GetBytes([Console]::In.ReadToEnd()); [Console]::Out.Write([Convert]::ToBase64String([Security.Cryptography.ProtectedData]::Protect($bytes,$null,[Security.Cryptography.DataProtectionScope]::CurrentUser)))'
],
{ input: value, encoding: 'utf8', windowsHide: true, timeout: 15000 }
).trim()
)
const codexLink = createCodexLink(
createNodeCodexLinkDeps(
@@ -17243,6 +17259,34 @@ ipcMain.handle('aiturk:codex-link:get', async event => {
return codexLink.getStatus()
})
async function stagedTransitionState() {
const state = stagedTransition.get()
try {
const response = await fetch('http://127.0.0.1:8795/aiturk/codex-baglama/status', {
signal: AbortSignal.timeout(5000)
})
if (!response.ok) throw new Error('Bridge unavailable')
const body = await response.json()
const models = Array.isArray(body.jev_models)
? body.jev_models.filter(m => typeof m?.id === 'string' && typeof m?.name === 'string')
: []
return { ...state, models, modelsAvailable: Array.isArray(body.jev_models) }
} catch {
return { ...state, models: [], modelsAvailable: false }
}
}
ipcMain.handle('aiturk:staged-transition:get', async event => {
assertCodexLinkSender(event)
return stagedTransitionState()
})
ipcMain.handle('aiturk:staged-transition:set', async (event, patch) => {
assertCodexLinkSender(event)
stagedTransition.save(patch)
return stagedTransitionState()
})
ipcMain.handle('aiturk:codex-link:set', async (event, patch) => {
assertCodexLinkSender(event)