@twinsearth/dsh-fang 3.1.4 → 3.1.6

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 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.4",
3
+ "version": "3.1.6",
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.3",
52
+ "@twinsearth/dsh-fang-queue-journal": "0.1.4",
53
53
  "@twinsearth/dsh-fang-web-entry": "0.1.1"
54
54
  },
55
55
  "devDependencies": {
@@ -128,7 +128,7 @@ export const AUDIT = {
128
128
  RUNTIME_ERROR: 'runtime-error',
129
129
  }
130
130
 
131
- export const FANG_VERSION = '3.1.4'
131
+ export const FANG_VERSION = '3.1.6'
132
132
 
133
133
  /**
134
134
  * @typedef {object} ForkInfo
@@ -9,6 +9,9 @@ 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
+ // 只隐藏设置页的插件清单;不能禁用 ui-plugin-manager:它提供 pluginNavigation,
13
+ // 禁掉会让 dsh-client-ui-plugin-recommendations 永久 pending(v3.1.5 实测)。
14
+ 'ui-settings-plugin-inventory',
12
15
  ])
13
16
 
14
17
  /** DSH first-run notice needs a durable ui-settings-general config form in every fork profile. */
@@ -21,7 +24,11 @@ const WELCOME_NOTICE_ENTRY = Object.freeze({
21
24
  // cordis.yml 不加只读:DSH 启动时会打开它做规范化写入,只读会导致 EPERM 启动失败。
22
25
  export const PROFILE_CONFIG_FILES = Object.freeze(['package.json', 'cordis.patch.yml'])
23
26
 
24
- /** 把分身 profile 的配置文件设为只读(防止误写;不防有意绕过)。 */
27
+ /** v3.1.5 曾错误禁用 ui-plugin-manager(它提供 pluginNavigation);升级时自动移除该历史锁。 */
28
+ export const LEGACY_LOCKED_ENTRY_IDS = Object.freeze(['ui-plugin-manager'])
29
+
30
+ /**
31
+ * 把分身 profile 的配置文件设为只读(防止误写;不防有意绕过)。 */
25
32
  export function setProfileConfigReadonly(profileDir, readonly = true) {
26
33
  if (String(process.env.DSH_FANG_FORK_PROFILE_RO ?? '1') === '0') return { ok: true, skipped: true, changed: [] }
27
34
  // essence-runtime 是元主的配置态实例:DSH 设置/内置插件开关需要原子写 package.json。
@@ -74,7 +81,10 @@ function withLockRows(entries, ids) {
74
81
  return { entries: out, added }
75
82
  }
76
83
 
77
- export function applyForkConfigLock(profileDir, options = {}) { if (String(process.env.DSH_FANG_FORK_CONFIG_LOCK ?? '1') === '0') return { ok: true, skipped: true }
84
+ export function applyForkConfigLock(profileDir, options = {}) {
85
+ if (String(process.env.DSH_FANG_FORK_CONFIG_LOCK ?? '1') === '0') return { ok: true, skipped: true }
86
+ // 自动修复 v3.1.5 遗留的 ui-plugin-manager disabled:true(会断 pluginNavigation)。
87
+ try { clearForkConfigLock(profileDir, { ids: LEGACY_LOCKED_ENTRY_IDS }) } catch { /* best effort */ }
78
88
  const file = path.join(String(profileDir), 'cordis.patch.yml')
79
89
  let text = ''
80
90
  try { text = fs.readFileSync(file, 'utf8') } catch { text = '' }