fix(cli): isolate Web runtime context from headless
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import type { Context } from 'cordis'
|
||||
import type { PatchOptions } from '@cordisjs/plugin-include'
|
||||
import { addHarnessSourceSection, resolveConfigPath } from '@deepseek-ai/dsh-app-boot'
|
||||
import type {} from '@deepseek-ai/dsh-host-webserver'
|
||||
import type {} from '@deepseek-ai/dsh-system-prompt'
|
||||
@@ -24,6 +25,12 @@ const DSH_WEB_URL = 'DSH_WEB_URL' as const
|
||||
const DSH_WEB_MODE = 'DSH_WEB_MODE' as const
|
||||
const WEB_RUNTIME_CONTEXT_BUILTIN = 'web-runtime-context' as const
|
||||
|
||||
/** Web-launcher activation applied before personal or explicit configuration. */
|
||||
export const WEB_RUNTIME_CONTEXT_ENABLE_PATCH = {
|
||||
id: WEB_RUNTIME_CONTEXT_BUILTIN,
|
||||
disabled: false,
|
||||
} as const satisfies PatchOptions
|
||||
|
||||
type WebMode = 'production' | 'development'
|
||||
|
||||
// Display-only mirror of the webserver schema's loopback host: the address the
|
||||
@@ -125,6 +132,7 @@ export async function runWeb(
|
||||
const entry = new AppCLIEntry({
|
||||
configPath: BASE_CONFIG,
|
||||
overlayPath: WEB_OVERLAY,
|
||||
launcherPatches: [WEB_RUNTIME_CONTEXT_ENABLE_PATCH],
|
||||
...config !== undefined && { extraOverlayPath: resolveConfigPath(config, undefined) },
|
||||
dev,
|
||||
prepare: (ctx) => { prepareWebRuntimeContext(ctx, SOURCE_ROOT, mode) },
|
||||
|
||||
Reference in New Issue
Block a user