[codex] add version preview workflow (#1086)
* add version preview workflow * fix sidebar group test * fix legacy usage schema migration
This commit is contained in:
@@ -3,6 +3,7 @@ import router from '@/router'
|
||||
const DEFAULT_BASE_URL = ''
|
||||
|
||||
function getBaseUrl(): string {
|
||||
if (import.meta.env.VITE_HERMES_PREVIEW === '1') return DEFAULT_BASE_URL
|
||||
return localStorage.getItem('hermes_server_url') || DEFAULT_BASE_URL
|
||||
}
|
||||
|
||||
|
||||
@@ -267,8 +267,9 @@ export function buildKanbanEventsWebSocketUrl(opts?: KanbanBoardOptions): string
|
||||
return `${websocketProtocol(base)}//${new URL(base).host}${path}`
|
||||
}
|
||||
|
||||
const host = import.meta.env.DEV
|
||||
? formatHostForPort(location.hostname, 8648)
|
||||
const directDevPort = import.meta.env.VITE_HERMES_DIRECT_WS_PORT
|
||||
const host = import.meta.env.DEV && directDevPort
|
||||
? formatHostForPort(location.hostname, Number(directDevPort))
|
||||
: location.host
|
||||
return `${websocketProtocol()}//${host}${path}`
|
||||
}
|
||||
|
||||
@@ -9,6 +9,34 @@ export interface HealthResponse {
|
||||
node_version?: string
|
||||
}
|
||||
|
||||
export interface PreviewTag {
|
||||
name: string
|
||||
sha: string
|
||||
}
|
||||
|
||||
export interface PreviewStatus {
|
||||
preview_dir: string
|
||||
exists: boolean
|
||||
has_package: boolean
|
||||
installed: boolean
|
||||
running: boolean
|
||||
pid: number | null
|
||||
current_tag: string
|
||||
frontend_url: string
|
||||
agent_bridge_endpoint: string
|
||||
log_path: string
|
||||
webui_home: string
|
||||
action_log_path: string
|
||||
dev_log_path: string
|
||||
action_log: string
|
||||
dev_log: string
|
||||
}
|
||||
|
||||
export interface PreviewActionResponse extends PreviewStatus {
|
||||
success: boolean
|
||||
message?: string
|
||||
}
|
||||
|
||||
// Config-based model types
|
||||
export interface ModelInfo {
|
||||
id: string
|
||||
@@ -84,6 +112,36 @@ export async function triggerUpdate(): Promise<{ success: boolean; message: stri
|
||||
return request<{ success: boolean; message: string }>('/api/hermes/update', { method: 'POST' })
|
||||
}
|
||||
|
||||
export async function fetchPreviewStatus(): Promise<PreviewStatus> {
|
||||
return request<PreviewStatus>('/api/hermes/update/preview')
|
||||
}
|
||||
|
||||
export async function fetchPreviewTags(): Promise<{ tags: PreviewTag[] }> {
|
||||
return request<{ tags: PreviewTag[] }>('/api/hermes/update/preview/tags')
|
||||
}
|
||||
|
||||
export async function preparePreview(tag: string): Promise<PreviewActionResponse> {
|
||||
return request<PreviewActionResponse>('/api/hermes/update/preview/prepare', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ tag }),
|
||||
})
|
||||
}
|
||||
|
||||
export async function installPreview(): Promise<PreviewActionResponse> {
|
||||
return request<PreviewActionResponse>('/api/hermes/update/preview/install', { method: 'POST' })
|
||||
}
|
||||
|
||||
export async function startPreview(tag?: string): Promise<PreviewActionResponse> {
|
||||
return request<PreviewActionResponse>('/api/hermes/update/preview/start', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ tag }),
|
||||
})
|
||||
}
|
||||
|
||||
export async function stopPreview(): Promise<PreviewActionResponse> {
|
||||
return request<PreviewActionResponse>('/api/hermes/update/preview/stop', { method: 'POST' })
|
||||
}
|
||||
|
||||
export async function fetchConfigModels(): Promise<ConfigModelsResponse> {
|
||||
return request<ConfigModelsResponse>('/api/hermes/config/models')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user