@mohou/host 1.0.22 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/src/host/config.ts +10 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mohou/host",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"react-dom": "^19.2.0",
|
|
50
50
|
"tailwindcss": "^4.3.3",
|
|
51
51
|
"tw-animate-css": "^1.4.0",
|
|
52
|
-
"@mohou/
|
|
53
|
-
"@mohou/
|
|
54
|
-
"@mohou/
|
|
55
|
-
"@mohou/
|
|
56
|
-
"@mohou/
|
|
52
|
+
"@mohou/contract": "^1.0.23",
|
|
53
|
+
"@mohou/app-view": "^1.0.23",
|
|
54
|
+
"@mohou/mcp-client": "^1.0.23",
|
|
55
|
+
"@mohou/ui": "^1.0.23",
|
|
56
|
+
"@mohou/runtime-provider": "^1.0.23"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/better-sqlite3": "^9.6.0",
|
package/src/host/config.ts
CHANGED
|
@@ -50,7 +50,7 @@ export interface PortBound {
|
|
|
50
50
|
export const DEFAULT_PORT_BOUND: PortBound = { min: 1024, max: 65535 }
|
|
51
51
|
|
|
52
52
|
const PUBLIC_KEYS = ['runtimeRoot', 'hostPort', 'theme', 'palette', 'locale', 'chatLanguage', 'llm', 'runtimeProvider'] as const
|
|
53
|
-
const OPTIONAL_KEYS = ['defaultWorkbenchId'] as const
|
|
53
|
+
const OPTIONAL_KEYS = ['defaultWorkbenchId', 'updateRegistry'] as const
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* Read `host.json`. A missing file writes a complete seed. A present bad file throws and is left as it was.
|
|
@@ -189,9 +189,18 @@ function admitPolicy(raw: unknown, runtimeRoot: string, ports: PortBound): HostP
|
|
|
189
189
|
llm: admitLlm(raw.llm),
|
|
190
190
|
runtimeProvider: admitProvider(raw.runtimeProvider),
|
|
191
191
|
...admitWorkbench(raw.defaultWorkbenchId),
|
|
192
|
+
...admitUpdateRegistry(raw.updateRegistry),
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
195
|
|
|
196
|
+
/** An empty value means the packaged default, so it is not written at all. */
|
|
197
|
+
function admitUpdateRegistry(value: unknown): { updateRegistry: string } | Record<string, never> {
|
|
198
|
+
if (value === undefined) return {}
|
|
199
|
+
if (typeof value !== 'string') throw new ConfigError('config-invalid', 'host config updateRegistry is invalid')
|
|
200
|
+
const registry = value.trim()
|
|
201
|
+
return registry.length === 0 ? {} : { updateRegistry: registry }
|
|
202
|
+
}
|
|
203
|
+
|
|
195
204
|
function admitWorkbench(value: unknown): { defaultWorkbenchId: string } | Record<string, never> {
|
|
196
205
|
if (value === undefined || value === 'default') return {}
|
|
197
206
|
if (typeof value !== 'string' || value.length === 0) {
|