@twinsearth/dsh-fang 3.1.4 → 3.1.5
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/client.js +14 -0
- package/package.json +2 -2
- package/src/kernel/types.mjs +1 -1
- package/src/lib/fork-config-lock.mjs +4 -0
- package/src/plugins/forker.mjs +12 -3
package/client.js
CHANGED
|
@@ -1404,6 +1404,15 @@ window.__ModuleLoader__.load({
|
|
|
1404
1404
|
|
|
1405
1405
|
async function refresh(options = {}) {
|
|
1406
1406
|
if (refreshingLock) return
|
|
1407
|
+
// 分身 Web UI 不请求任何母体 API;404 是预期,不应落成错误状态/横幅。
|
|
1408
|
+
const role = await detectRole()
|
|
1409
|
+
if (!alive) return
|
|
1410
|
+
if (role !== 'mother') {
|
|
1411
|
+
S.lastRefreshAt = Date.now()
|
|
1412
|
+
if (options.manual) S.refreshing = false
|
|
1413
|
+
if (!options.silent) schedule()
|
|
1414
|
+
return
|
|
1415
|
+
}
|
|
1407
1416
|
refreshingLock = true
|
|
1408
1417
|
const seq = ++refreshSeq
|
|
1409
1418
|
if (options.manual) { S.refreshing = true; schedule() }
|
|
@@ -4265,6 +4274,11 @@ window.__ModuleLoader__.load({
|
|
|
4265
4274
|
|
|
4266
4275
|
function renderApp(S, app) {
|
|
4267
4276
|
const frag = document.createDocumentFragment()
|
|
4277
|
+
// 分身 Web UI 只有一条宿主机说明:母体 API 的 404 是预期,不渲染任何错误横幅/母体控件。
|
|
4278
|
+
if (S.role.value === 'fork') {
|
|
4279
|
+
frag.append(renderHostNotice(S, app))
|
|
4280
|
+
return frag
|
|
4281
|
+
}
|
|
4268
4282
|
frag.append(renderHeader(S, app))
|
|
4269
4283
|
for (const node of renderNotices(S, app)) frag.append(node)
|
|
4270
4284
|
for (const node of renderApprovals(S, app)) frag.append(node)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twinsearth/dsh-fang",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "dsh-Fang (瓮城) — mother/fork plugin development environment for DeepSeek Harness: one readonly mother, a disposable child dsh-Web per task.",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"node": ">=22"
|
|
50
50
|
},
|
|
51
51
|
"optionalDependencies": {
|
|
52
|
-
"@twinsearth/dsh-fang-queue-journal": "0.1.
|
|
52
|
+
"@twinsearth/dsh-fang-queue-journal": "0.1.4",
|
|
53
53
|
"@twinsearth/dsh-fang-web-entry": "0.1.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
package/src/kernel/types.mjs
CHANGED
|
@@ -9,6 +9,10 @@ export const FORK_LOCKED_ENTRY_IDS = Object.freeze([
|
|
|
9
9
|
// 禁用 config-editor / ui-settings 会移除 configForms 服务,导致 locale 及之后
|
|
10
10
|
// 50 个客户端插件永久 pending(实测:web boot 50 entries did not activate)。
|
|
11
11
|
'tool-plugin-manager',
|
|
12
|
+
// 分身=生产盘:隐藏侧边栏「插件」页和设置页的插件清单,避免用户点启用后
|
|
13
|
+
// 因 package.json 只读而收到 EPERM。
|
|
14
|
+
'ui-plugin-manager',
|
|
15
|
+
'ui-settings-plugin-inventory',
|
|
12
16
|
])
|
|
13
17
|
|
|
14
18
|
/** DSH first-run notice needs a durable ui-settings-general config form in every fork profile. */
|
package/src/plugins/forker.mjs
CHANGED
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
z,
|
|
58
58
|
} from '../kernel/index.mjs'
|
|
59
59
|
import { computeBackoff, planRestart, reconcileOrphans, writeForkMeta, probeHttpAlive, SUPERVISION_DEFAULTS } from '../lib/fork-supervisor.mjs'
|
|
60
|
-
import { applyForkConfigLock, setProfileConfigReadonly } from '../lib/fork-config-lock.mjs'
|
|
60
|
+
import { applyForkConfigLock, clearForkConfigLock, setProfileConfigReadonly } from '../lib/fork-config-lock.mjs'
|
|
61
61
|
|
|
62
62
|
export const name = 'fang-forker'
|
|
63
63
|
export const inject = []
|
|
@@ -926,8 +926,17 @@ export function apply(ctx, config) {
|
|
|
926
926
|
rec.configSync = { at: nowMs(), ok: false, error: msgOf(e) }
|
|
927
927
|
}
|
|
928
928
|
}
|
|
929
|
-
|
|
930
|
-
|
|
929
|
+
const configInstance = path.basename(String(rec.profileDir)) === 'essence-runtime'
|
|
930
|
+
if (configInstance) {
|
|
931
|
+
// 配置态实例(元宝运行态)必须可写、可管理插件;spawn 不能再次套生产盘锁。
|
|
932
|
+
try { clearForkConfigLock(rec.profileDir) } catch { /* best effort */ }
|
|
933
|
+
try { setProfileConfigReadonly(rec.profileDir, false) } catch { /* ignore */ }
|
|
934
|
+
rec.configLock = { ok: true, skipped: true, runtime: true }
|
|
935
|
+
rec.profileReadonly = { ok: true, skipped: true, runtime: true }
|
|
936
|
+
} else {
|
|
937
|
+
try { rec.configLock = applyForkConfigLock(rec.profileDir) } catch { rec.configLock = { ok: false } }
|
|
938
|
+
try { rec.profileReadonly = setProfileConfigReadonly(rec.profileDir, true) } catch { rec.profileReadonly = { ok: false } }
|
|
939
|
+
}
|
|
931
940
|
writeForkMetaOf(rec)
|
|
932
941
|
// 广播新 token:首次派生 = 生成,重启 = 刷新;订阅者拿到的是「当前 token」,
|
|
933
942
|
// 不是「进程就绪」信号(进程就绪以 fang/fork-started 为准)。
|