mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
feat(hub,web): support custom Claude models via settings.json (customClaudeModels)
This commit is contained in:
@@ -25,6 +25,7 @@ import { createCodexDesktopRoutes } from './routes/codexDesktop'
|
||||
import { createPushRoutes } from './routes/push'
|
||||
import { createDevicesRoutes } from './routes/devices'
|
||||
import { createVoiceRoutes } from './routes/voice'
|
||||
import { createClaudeModelsRoutes } from './routes/claudeModels'
|
||||
import type { SSEManager } from '../sse/sseManager'
|
||||
import type { VisibilityTracker } from '../visibility/visibilityTracker'
|
||||
import type { Server as BunServer, ServerWebSocket } from 'bun'
|
||||
@@ -219,6 +220,7 @@ function createWebApp(options: {
|
||||
embeddedAssetMap: Map<string, EmbeddedWebAsset> | null
|
||||
relayMode?: boolean
|
||||
officialWebUrl?: string
|
||||
dataDir: string
|
||||
}): Hono<WebAppEnv> {
|
||||
const app = new Hono<WebAppEnv>()
|
||||
|
||||
@@ -257,6 +259,7 @@ function createWebApp(options: {
|
||||
getSyncEngine: options.getSyncEngine
|
||||
}))
|
||||
app.route('/api', createPushRoutes(options.store, options.vapidPublicKey))
|
||||
app.route('/api', createClaudeModelsRoutes(options.dataDir))
|
||||
app.route('/api', createDevicesRoutes(options.store))
|
||||
app.route('/api', createVoiceRoutes())
|
||||
|
||||
@@ -374,6 +377,7 @@ export async function startWebServer(options: {
|
||||
corsOrigins?: string[]
|
||||
relayMode?: boolean
|
||||
officialWebUrl?: string
|
||||
dataDir: string
|
||||
}): Promise<BunServer<WebSocketData>> {
|
||||
const isCompiled = isBunCompiled()
|
||||
const embeddedAssetMap = isCompiled ? await loadEmbeddedAssetMap() : null
|
||||
@@ -386,6 +390,7 @@ export async function startWebServer(options: {
|
||||
vapidPublicKey: options.vapidPublicKey,
|
||||
corsOrigins: options.corsOrigins,
|
||||
embeddedAssetMap,
|
||||
dataDir: options.dataDir,
|
||||
relayMode: options.relayMode,
|
||||
officialWebUrl: options.officialWebUrl
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user