@aiwayds/dsh-opentui 0.23.3 → 0.25.0
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/NOTICE +35 -0
- package/bin/dsh-opentui.mjs +7 -13
- package/bin/lib/launcher.mjs +0 -1
- package/dist/bridge/bundle-fingerprint.json +1 -1
- package/dist/bridge/index.js +7153 -36
- package/dist/client/index.js +2677 -787
- package/dist/client/index.js.map +33 -25
- package/dist/host-launch.mjs +21 -8
- package/dist/host-launch.mjs.map +3 -3
- package/dist/locales/en.json +81 -0
- package/dist/locales/zh-CN.json +81 -0
- package/package.json +1 -1
- package/scripts/lib/bridge-failfast-text.d.mts +0 -1
- package/scripts/lib/bridge-failfast-text.mjs +3 -8
- package/scripts/provision-inproc-profile.mjs +89 -84
package/dist/locales/en.json
CHANGED
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"command.model.emptyCatalog": "no models in the catalog",
|
|
19
19
|
"command.model.unavailable": "/model unavailable: the in-process bridge has no model catalog or switch wire — set the model in the host's settings/selection surface, then reopen the TUI ({reason})",
|
|
20
20
|
"command.model.unchanged": "model unchanged",
|
|
21
|
+
"command.model.discovering": "discovering models for {provider}…",
|
|
22
|
+
"command.model.discovered": "discovered {n} models: {list}",
|
|
23
|
+
"command.model.discoverEmpty": "no models discovered from the endpoint",
|
|
24
|
+
"command.model.discoverUnavailable": "model discovery unavailable — {reason}",
|
|
21
25
|
"command.login.description": "log in a provider (bare opens the picker; Custom provider opens the form)",
|
|
22
26
|
"command.login.routeRegistrationFailed": "{id}: route registration failed — key not stored",
|
|
23
27
|
"command.login.keyStoreFailed": "{id}: key store failed — {detail}",
|
|
@@ -26,6 +30,13 @@
|
|
|
26
30
|
"command.login.cancelledEmptyKey": "login cancelled — empty key",
|
|
27
31
|
"command.login.cancelled": "login cancelled",
|
|
28
32
|
"command.login.unavailable": "/login unavailable in this session",
|
|
33
|
+
"command.login.directoryDegraded": "provider directory unavailable — showing the built-in provider list",
|
|
34
|
+
"command.login.directoryPartial": "provider directory partly unavailable — showing the providers that responded",
|
|
35
|
+
"command.account.description": "show account sign-in state (signin/signout)",
|
|
36
|
+
"command.account.unavailable": "/account unavailable in this session",
|
|
37
|
+
"command.account.state": "account: status={status} phase={phase} urlReady={urlReady} links={links}",
|
|
38
|
+
"command.account.failed": "account action failed: {reason}",
|
|
39
|
+
"command.account.unknownAction": "unknown account action: {action} (use signin/signout)",
|
|
29
40
|
"command.logout.description": "log out a provider (drops the stored key)",
|
|
30
41
|
"command.logout.failed": "logout failed — {reason}",
|
|
31
42
|
"command.logout.notLoggedIn": "not logged in: {provider}",
|
|
@@ -58,6 +69,11 @@
|
|
|
58
69
|
"command.flush.flushed": "queue flushed — {started} prompt(s) sending now, {remaining} still queued",
|
|
59
70
|
"command.flush.empty": "queue is empty — nothing to flush",
|
|
60
71
|
"command.btw.unavailable": "/btw unavailable in this session",
|
|
72
|
+
"command.btw.degraded": "/btw: side-session is unavailable in this session",
|
|
73
|
+
"command.btw.noModel": "/btw: no available model answered the side question (honest degrade)",
|
|
74
|
+
"command.btw.noAnswer": "/btw: the side session produced no answer (timeout or no assistant text)",
|
|
75
|
+
"command.btw.busy": "/btw: a side question is already running",
|
|
76
|
+
"command.btw.failed": "/btw: the side session failed",
|
|
61
77
|
"command.session.unavailable": "/session unavailable in this session",
|
|
62
78
|
"command.session.noActive": "no active session",
|
|
63
79
|
"command.btw.description": "side question (bare reopens the last answer)",
|
|
@@ -66,6 +82,38 @@
|
|
|
66
82
|
"command.plugins.entry": "● {name}@{version}",
|
|
67
83
|
"command.plugins.unavailable": "/plugins unavailable in this session",
|
|
68
84
|
"command.plugins.none": "no plugins installed",
|
|
85
|
+
"command.goals.description": "show the current goal / manage goals",
|
|
86
|
+
"command.goals.unavailable": "/goals unavailable in this session",
|
|
87
|
+
"command.goals.degraded": "/goals: goals service unavailable or no active session",
|
|
88
|
+
"command.goals.unknownOp": "unknown /goals subcommand \"{op}\" — showing status (try: create, edit, pause, resume, complete, clear)",
|
|
89
|
+
"command.goals.none": "no current goal",
|
|
90
|
+
"command.goals.header": "Current goal",
|
|
91
|
+
"command.goals.objective": " objective: {text}",
|
|
92
|
+
"command.goals.phase.line": " phase: {phase}",
|
|
93
|
+
"command.goals.activation.line": " activation: {activation}",
|
|
94
|
+
"command.goals.rounds": " rounds: {started}/{max}",
|
|
95
|
+
"command.goals.ref": " ref: {id} r{revision}",
|
|
96
|
+
"command.goals.blocked": " blocked: {code} — {message}",
|
|
97
|
+
"command.goals.phase.active": "active",
|
|
98
|
+
"command.goals.phase.paused": "paused",
|
|
99
|
+
"command.goals.phase.blocked": "blocked",
|
|
100
|
+
"command.goals.phase.complete": "complete",
|
|
101
|
+
"command.goals.activation.armed": "armed",
|
|
102
|
+
"command.goals.activation.disarmed": "disarmed",
|
|
103
|
+
"command.goals.prompt.objective": "goal objective",
|
|
104
|
+
"command.goals.aborted": "goal change aborted (no change made)",
|
|
105
|
+
"command.goals.confirm.yes": "Yes, apply",
|
|
106
|
+
"command.goals.confirm.no": "No, cancel",
|
|
107
|
+
"command.goals.confirm.create": "Create this goal?",
|
|
108
|
+
"command.goals.confirm.edit": "Edit the current goal's objective?",
|
|
109
|
+
"command.goals.confirm.pause": "Pause the current goal?",
|
|
110
|
+
"command.goals.confirm.resume": "Resume the current goal?",
|
|
111
|
+
"command.goals.confirm.complete": "Mark the current goal complete?",
|
|
112
|
+
"command.goals.confirm.clear": "Clear the current goal?",
|
|
113
|
+
"command.goals.created": "goal created: {id} r{revision}",
|
|
114
|
+
"command.goals.edited": "goal updated",
|
|
115
|
+
"command.goals.updated": "goal {op} applied",
|
|
116
|
+
"command.goals.failed": "goal change failed",
|
|
69
117
|
"command.skills.description": "manage skills (opens the panel)",
|
|
70
118
|
"command.skills.unavailable": "/skills unavailable in this session",
|
|
71
119
|
"command.search.description": "full-text search over stored sessions",
|
|
@@ -332,6 +380,12 @@
|
|
|
332
380
|
"panel.plugins.state.off": "off",
|
|
333
381
|
"panel.plugins.state.error": "{state} error",
|
|
334
382
|
"panel.plugins.state.readOnly": "{state} read-only",
|
|
383
|
+
"panel.plugins.state.unknown": "state unknown (manager unavailable)",
|
|
384
|
+
"panel.plugins.degrade.unavailable": "plugin manager unavailable — showing local install list (state unknown)",
|
|
385
|
+
"panel.plugins.detail.title": "detail — {name}",
|
|
386
|
+
"panel.plugins.detail.loading": "loading detail…",
|
|
387
|
+
"panel.plugins.detail.none": "no detail document",
|
|
388
|
+
"panel.plugins.detail.unavailable": "detail unavailable (manager not connected)",
|
|
335
389
|
"panel.plugins.notice.applied": "{target}: change applied",
|
|
336
390
|
"panel.plugins.notice.restartRequired": "{target}: change saved — restart the host for it to take effect",
|
|
337
391
|
"panel.plugins.notice.overridden": "{target}: change saved, but a higher-priority config keeps the previous state",
|
|
@@ -342,6 +396,7 @@
|
|
|
342
396
|
"panel.plugins.dialog.installBodyDescription": "{preview} — {description}",
|
|
343
397
|
"panel.plugins.status.readOnly": "{name}: read-only",
|
|
344
398
|
"panel.plugins.status.readOnlyReason": "{name}: read-only ({reason})",
|
|
399
|
+
"panel.plugins.status.toggleUnavailable": "{name}: toggling unavailable on this seam (write face not wired yet)",
|
|
345
400
|
"panel.plugins.status.disabling": "disabling {name}…",
|
|
346
401
|
"panel.plugins.status.enabling": "enabling {name}…",
|
|
347
402
|
"panel.plugins.status.changeFailed": "{name}: change failed — {error}",
|
|
@@ -495,6 +550,32 @@
|
|
|
495
550
|
"panel.subagents.keymap.stopTwice": "Transcript: press twice to stop",
|
|
496
551
|
"panel.agents.column.provider": "PROVIDER",
|
|
497
552
|
"panel.plugins.notice.failedNoError": "{target}: change failed",
|
|
553
|
+
"panel.plugins.confirm.object": "{operation}: {target}",
|
|
554
|
+
"panel.plugins.confirm.op.setBundleEnabled": "enable/disable bundle",
|
|
555
|
+
"panel.plugins.confirm.op.removeBundle": "uninstall bundle",
|
|
556
|
+
"panel.plugins.confirm.op.installBundle": "install plugin",
|
|
557
|
+
"panel.plugins.confirm.op.updateBundle": "update bundle",
|
|
558
|
+
"panel.plugins.confirm.op.setPluginEnabled": "enable/disable plugin",
|
|
559
|
+
"panel.plugins.confirm.op.setVersionExemption": "set version exemption",
|
|
560
|
+
"panel.plugins.confirm.op.remove": "remove",
|
|
561
|
+
"panel.plugins.confirm.op.update": "update",
|
|
562
|
+
"panel.plugins.confirm.consequence.setBundleEnabled": "Persists the choice and tries a live apply; a restart may still be required.",
|
|
563
|
+
"panel.plugins.confirm.consequence.removeBundle": "Removes the package from this profile. Its plugins stop at the change or the next host start.",
|
|
564
|
+
"panel.plugins.confirm.consequence.installBundle": "Installs the package into this profile and enables its bundle.",
|
|
565
|
+
"panel.plugins.confirm.risk.versionExemption": "WARNING: granting this exemption may cause crashes and data loss. Only accept for this exact plugin/runtime pair.",
|
|
566
|
+
"panel.plugins.dryRun.refused": "Preflight: refused ({problem}) — {reason}",
|
|
567
|
+
"panel.plugins.dryRun.accepted": "Preflight: {operation} {spec}",
|
|
568
|
+
"panel.plugins.dryRun.remove": "Preflight: remove {name}@{version} from this profile",
|
|
569
|
+
"panel.plugins.dryRun.install": "Preflight: install {spec}",
|
|
570
|
+
"panel.plugins.dialog.actionTitle": "Confirm {operation}?",
|
|
571
|
+
"panel.plugins.dialog.actionConfirm": "Confirm",
|
|
572
|
+
"panel.plugins.progress.running": "installing… (x to cancel)",
|
|
573
|
+
"panel.plugins.progress.done": "installed {target}",
|
|
574
|
+
"panel.plugins.progress.cancelled": "cancelled {target}",
|
|
575
|
+
"panel.plugins.progress.failed": "install failed {target}: {error}",
|
|
576
|
+
"panel.plugins.progress.unknown": "install state unknown (manager unavailable)",
|
|
577
|
+
"panel.plugins.progress.cancelResult": "cancel install: {status}",
|
|
578
|
+
"panel.plugins.keymap.cancelInstall": "Cancel in-flight install",
|
|
498
579
|
"overlay.delivery.title": "Turn running — steer or queue?",
|
|
499
580
|
"overlay.delivery.preview": "“{text}”",
|
|
500
581
|
"overlay.delivery.steerTitle": "Steer",
|
package/dist/locales/zh-CN.json
CHANGED
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"command.model.emptyCatalog": "目录中没有模型",
|
|
19
19
|
"command.model.unavailable": "/model 不可用:in-process bridge 没有模型目录/切换 wire — 请在宿主的设置/模型选择界面设定模型后重开 TUI({reason})",
|
|
20
20
|
"command.model.unchanged": "模型未变",
|
|
21
|
+
"command.model.discovering": "正在发现 {provider} 的模型…",
|
|
22
|
+
"command.model.discovered": "发现 {n} 个模型:{list}",
|
|
23
|
+
"command.model.discoverEmpty": "端点未返回模型",
|
|
24
|
+
"command.model.discoverUnavailable": "模型发现不可用 — {reason}",
|
|
21
25
|
"command.login.description": "登录 provider(不带参数打开选择器;Custom provider 打开表单)",
|
|
22
26
|
"command.login.routeRegistrationFailed": "{id}:路由注册失败 — 密钥未保存",
|
|
23
27
|
"command.login.keyStoreFailed": "{id}:密钥保存失败 — {detail}",
|
|
@@ -26,6 +30,13 @@
|
|
|
26
30
|
"command.login.cancelledEmptyKey": "登录取消 — 密钥为空",
|
|
27
31
|
"command.login.cancelled": "登录已取消",
|
|
28
32
|
"command.login.unavailable": "本会话中 /login 不可用",
|
|
33
|
+
"command.login.directoryDegraded": "provider 目录不可用 — 显示内置 provider 列表",
|
|
34
|
+
"command.login.directoryPartial": "provider 目录部分不可用 — 显示已响应的 provider",
|
|
35
|
+
"command.account.description": "查看账号登录态(signin/signout)",
|
|
36
|
+
"command.account.unavailable": "本会话中 /account 不可用",
|
|
37
|
+
"command.account.state": "账号:状态={status} 阶段={phase} 链接就绪={urlReady} 链接存在={links}",
|
|
38
|
+
"command.account.failed": "账号操作失败:{reason}",
|
|
39
|
+
"command.account.unknownAction": "未知账号操作:{action}(用 signin/signout)",
|
|
29
40
|
"command.logout.description": "登出 provider(删除已保存的密钥)",
|
|
30
41
|
"command.logout.failed": "登出失败 — {reason}",
|
|
31
42
|
"command.logout.notLoggedIn": "未登录:{provider}",
|
|
@@ -58,6 +69,11 @@
|
|
|
58
69
|
"command.flush.flushed": "队列已发送 — {started} 个 prompt 正在发送,{remaining} 个仍在排队",
|
|
59
70
|
"command.flush.empty": "队列为空 — 没有可发送的内容",
|
|
60
71
|
"command.btw.unavailable": "本会话中 /btw 不可用",
|
|
72
|
+
"command.btw.degraded": "/btw:本会话的 side-session 不可用",
|
|
73
|
+
"command.btw.noModel": "/btw:无可用模型回答旁路提问(诚实降级)",
|
|
74
|
+
"command.btw.noAnswer": "/btw:旁路会话没有返回答案(超时或无 assistant 文本)",
|
|
75
|
+
"command.btw.busy": "/btw:已有旁路提问正在进行",
|
|
76
|
+
"command.btw.failed": "/btw:旁路会话失败",
|
|
61
77
|
"command.session.unavailable": "本会话中 /session 不可用",
|
|
62
78
|
"command.session.noActive": "没有活动会话",
|
|
63
79
|
"command.btw.description": "插问(不带参数重新打开上一个回答)",
|
|
@@ -66,6 +82,38 @@
|
|
|
66
82
|
"command.plugins.entry": "● {name}@{version}",
|
|
67
83
|
"command.plugins.unavailable": "本会话中 /plugins 不可用",
|
|
68
84
|
"command.plugins.none": "未安装任何 plugins",
|
|
85
|
+
"command.goals.description": "显示当前目标 / 管理目标",
|
|
86
|
+
"command.goals.unavailable": "本会话中 /goals 不可用",
|
|
87
|
+
"command.goals.degraded": "/goals:goals 服务不可用或无活动会话",
|
|
88
|
+
"command.goals.unknownOp": "未知的 /goals 子命令“{op}”——显示状态(可用:create、edit、pause、resume、complete、clear)",
|
|
89
|
+
"command.goals.none": "当前没有目标",
|
|
90
|
+
"command.goals.header": "当前目标",
|
|
91
|
+
"command.goals.objective": " 目标: {text}",
|
|
92
|
+
"command.goals.phase.line": " 阶段: {phase}",
|
|
93
|
+
"command.goals.activation.line": " 激活态: {activation}",
|
|
94
|
+
"command.goals.rounds": " 轮次: {started}/{max}",
|
|
95
|
+
"command.goals.ref": " 引用: {id} r{revision}",
|
|
96
|
+
"command.goals.blocked": " 阻塞: {code} — {message}",
|
|
97
|
+
"command.goals.phase.active": "进行中",
|
|
98
|
+
"command.goals.phase.paused": "已暂停",
|
|
99
|
+
"command.goals.phase.blocked": "已阻塞",
|
|
100
|
+
"command.goals.phase.complete": "已完成",
|
|
101
|
+
"command.goals.activation.armed": "已就绪",
|
|
102
|
+
"command.goals.activation.disarmed": "未就绪",
|
|
103
|
+
"command.goals.prompt.objective": "目标内容",
|
|
104
|
+
"command.goals.aborted": "目标变更已取消(未做任何更改)",
|
|
105
|
+
"command.goals.confirm.yes": "确认应用",
|
|
106
|
+
"command.goals.confirm.no": "取消",
|
|
107
|
+
"command.goals.confirm.create": "创建此目标?",
|
|
108
|
+
"command.goals.confirm.edit": "编辑当前目标的内容?",
|
|
109
|
+
"command.goals.confirm.pause": "暂停当前目标?",
|
|
110
|
+
"command.goals.confirm.resume": "恢复当前目标?",
|
|
111
|
+
"command.goals.confirm.complete": "将当前目标标记为已完成?",
|
|
112
|
+
"command.goals.confirm.clear": "清除当前目标?",
|
|
113
|
+
"command.goals.created": "目标已创建: {id} r{revision}",
|
|
114
|
+
"command.goals.edited": "目标已更新",
|
|
115
|
+
"command.goals.updated": "目标 {op} 已应用",
|
|
116
|
+
"command.goals.failed": "目标变更失败",
|
|
69
117
|
"command.skills.description": "管理 skills(打开面板)",
|
|
70
118
|
"command.skills.unavailable": "本会话中 /skills 不可用",
|
|
71
119
|
"command.search.description": "全文搜索已存储的会话",
|
|
@@ -332,6 +380,12 @@
|
|
|
332
380
|
"panel.plugins.state.off": "关",
|
|
333
381
|
"panel.plugins.state.error": "{state} 错误",
|
|
334
382
|
"panel.plugins.state.readOnly": "{state} 只读",
|
|
383
|
+
"panel.plugins.state.unknown": "状态未知(管理器不可用)",
|
|
384
|
+
"panel.plugins.degrade.unavailable": "插件管理器不可用——显示本地安装列表(状态未知)",
|
|
385
|
+
"panel.plugins.detail.title": "详情 — {name}",
|
|
386
|
+
"panel.plugins.detail.loading": "正在加载详情…",
|
|
387
|
+
"panel.plugins.detail.none": "无详情文档",
|
|
388
|
+
"panel.plugins.detail.unavailable": "详情不可用(管理器未连接)",
|
|
335
389
|
"panel.plugins.notice.applied": "{target}:变更已生效",
|
|
336
390
|
"panel.plugins.notice.restartRequired": "{target}:变更已保存 — 需重启 host 才生效",
|
|
337
391
|
"panel.plugins.notice.overridden": "{target}:变更已保存,但更高优先级的配置保留了原状态",
|
|
@@ -342,6 +396,7 @@
|
|
|
342
396
|
"panel.plugins.dialog.installBodyDescription": "{preview} — {description}",
|
|
343
397
|
"panel.plugins.status.readOnly": "{name}:只读",
|
|
344
398
|
"panel.plugins.status.readOnlyReason": "{name}:只读({reason})",
|
|
399
|
+
"panel.plugins.status.toggleUnavailable": "{name}:此连接不支持切换(写接口尚未接线)",
|
|
345
400
|
"panel.plugins.status.disabling": "正在禁用 {name}…",
|
|
346
401
|
"panel.plugins.status.enabling": "正在启用 {name}…",
|
|
347
402
|
"panel.plugins.status.changeFailed": "{name}:变更失败 — {error}",
|
|
@@ -495,6 +550,32 @@
|
|
|
495
550
|
"panel.subagents.keymap.stopTwice": "记录:按两次停止",
|
|
496
551
|
"panel.agents.column.provider": "PROVIDER",
|
|
497
552
|
"panel.plugins.notice.failedNoError": "{target}:变更失败",
|
|
553
|
+
"panel.plugins.confirm.object": "{operation}:{target}",
|
|
554
|
+
"panel.plugins.confirm.op.setBundleEnabled": "启用/停用插件包",
|
|
555
|
+
"panel.plugins.confirm.op.removeBundle": "卸载插件包",
|
|
556
|
+
"panel.plugins.confirm.op.installBundle": "安装插件",
|
|
557
|
+
"panel.plugins.confirm.op.updateBundle": "更新插件包",
|
|
558
|
+
"panel.plugins.confirm.op.setPluginEnabled": "启用/停用插件",
|
|
559
|
+
"panel.plugins.confirm.op.setVersionExemption": "设置版本豁免",
|
|
560
|
+
"panel.plugins.confirm.op.remove": "移除",
|
|
561
|
+
"panel.plugins.confirm.op.update": "更新",
|
|
562
|
+
"panel.plugins.confirm.consequence.setBundleEnabled": "将保存选择并尝试实时生效;仍可能需要重启。",
|
|
563
|
+
"panel.plugins.confirm.consequence.removeBundle": "将从此配置移除该包。其插件在变更时或下次启动时停止。",
|
|
564
|
+
"panel.plugins.confirm.consequence.installBundle": "将安装该包到此配置并启用其插件包。",
|
|
565
|
+
"panel.plugins.confirm.risk.versionExemption": "警告:授予此豁免可能导致崩溃和数据丢失。仅对这一确切的插件/运行时组合接受。",
|
|
566
|
+
"panel.plugins.dryRun.refused": "预检:被拒绝({problem})— {reason}",
|
|
567
|
+
"panel.plugins.dryRun.accepted": "预检:{operation} {spec}",
|
|
568
|
+
"panel.plugins.dryRun.remove": "预检:从此配置移除 {name}@{version}",
|
|
569
|
+
"panel.plugins.dryRun.install": "预检:安装 {spec}",
|
|
570
|
+
"panel.plugins.dialog.actionTitle": "确认{operation}?",
|
|
571
|
+
"panel.plugins.dialog.actionConfirm": "确认",
|
|
572
|
+
"panel.plugins.progress.running": "安装中…(按 x 取消)",
|
|
573
|
+
"panel.plugins.progress.done": "已安装 {target}",
|
|
574
|
+
"panel.plugins.progress.cancelled": "已取消 {target}",
|
|
575
|
+
"panel.plugins.progress.failed": "安装失败 {target}:{error}",
|
|
576
|
+
"panel.plugins.progress.unknown": "安装状态未知(管理器不可用)",
|
|
577
|
+
"panel.plugins.progress.cancelResult": "取消安装:{status}",
|
|
578
|
+
"panel.plugins.keymap.cancelInstall": "取消进行中的安装",
|
|
498
579
|
"overlay.delivery.title": "轮次运行中 — 插话还是排队?",
|
|
499
580
|
"overlay.delivery.preview": "“{text}”",
|
|
500
581
|
"overlay.delivery.steerTitle": "插话",
|
package/package.json
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
export declare const BRIDGE_REPAIR_COMMAND: string
|
|
6
6
|
export declare const BRIDGE_APPEND_PRESET_NOTICE: string
|
|
7
|
-
export declare const BRIDGE_LEGACY_REMOTE_HINT: string
|
|
8
7
|
export declare const BRIDGE_REPAIR_HINT: string
|
|
9
8
|
|
|
10
9
|
export declare function formatBridgeFailFastMessage(
|
|
@@ -34,15 +34,10 @@ export const BRIDGE_REPAIR_COMMAND = 'dsh-opentui --repair-bridge'
|
|
|
34
34
|
export const BRIDGE_APPEND_PRESET_NOTICE =
|
|
35
35
|
'inproc bridge mode injects append-system via the bridge section; presets are standard only.'
|
|
36
36
|
|
|
37
|
-
/** The
|
|
38
|
-
*
|
|
39
|
-
* as its own constant so the host gate and the shared repair hint cannot drift. */
|
|
40
|
-
export const BRIDGE_LEGACY_REMOTE_HINT =
|
|
41
|
-
'To keep the legacy remote thin client for this launch: DSH_OPENTUI_INPROC=0'
|
|
42
|
-
|
|
43
|
-
/** The repair element with the link-vs-content caveat (provision-script wording). */
|
|
37
|
+
/** The repair element with the link-vs-content caveat (provision-script wording).
|
|
38
|
+
* S6: the legacy escape-hatch hint is gone with the seam it selected. */
|
|
44
39
|
export const BRIDGE_REPAIR_HINT =
|
|
45
|
-
`Run \`${BRIDGE_REPAIR_COMMAND}\` to rebuild the bridge
|
|
40
|
+
`Run \`${BRIDGE_REPAIR_COMMAND}\` to rebuild the bridge manifest (it fixes links, not corrupted artifact contents).`
|
|
46
41
|
|
|
47
42
|
/**
|
|
48
43
|
* Compose the three elements into one copy-pasteable, self-contained message.
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
// `opentui-inproc` host profile (ADR-0009 decision 3; T3 of the in-process
|
|
4
4
|
// bridge plan).
|
|
5
5
|
//
|
|
6
|
-
// Invoked by the launcher on EVERY start
|
|
7
|
-
//
|
|
8
|
-
// The
|
|
6
|
+
// Invoked by the launcher on EVERY start (S6: bridge is the sole seam; the
|
|
7
|
+
// former env escape hatch that skipped provisioning is removed with it).
|
|
8
|
+
// The `opentui` profile path is otherwise untouched.
|
|
9
9
|
// Seven local-FS steps (the first is the host-version gate), no pnpm/npm, no install scripts:
|
|
10
10
|
//
|
|
11
11
|
// [1/7] host — detect the running dsh version. OUTSIDE the supported
|
|
@@ -24,26 +24,27 @@
|
|
|
24
24
|
// resolution supplies those bundles from the running dsh
|
|
25
25
|
// closure (wild-package shadowing is the historical
|
|
26
26
|
// incident this guard prevents).
|
|
27
|
-
// [3/7]
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
27
|
+
// [3/7] copy — materialize node_modules/@aiwayds/dsh-opentui-bridge as a
|
|
28
|
+
// REAL DIRECTORY COPY of THIS installation's dist/bridge.
|
|
29
|
+
// S6 symlink-debt retirement: no absolute symlink (no path
|
|
30
|
+
// binding, no multi-worktree last-writer-wins, no dangling
|
|
31
|
+
// link when a worktree is removed). Converged every launch;
|
|
32
|
+
// idempotent when the copy's index.js hash matches.
|
|
33
|
+
// [4/7] verify — confirm the bridge is a real directory carrying the
|
|
34
|
+
// shipped files; refuse any @deepseek-ai copy in the profile.
|
|
35
|
+
// [5/7] identity — T5 guard: hash the materialized bridge's index.js and
|
|
36
|
+
// compare with the build-time fingerprint shipped in THIS
|
|
34
37
|
// installation's dist/bridge/bundle-fingerprint.json, plus
|
|
35
38
|
// name / version. No realpath-prefix hard binding.
|
|
36
|
-
// [6/7] patch —
|
|
37
|
-
// generate $DSH_HOME/profiles/opentui-inproc/cordis.patch.yml
|
|
39
|
+
// [6/7] patch — generate $DSH_HOME/profiles/opentui-inproc/cordis.patch.yml
|
|
38
40
|
// from the embedded inproc-only template (web-app
|
|
39
41
|
// compensation rows removed, profileRevision stamped). The
|
|
40
42
|
// template also registers the standalone sessionController
|
|
41
43
|
// shim plus the real @deepseek-ai/dsh-api-session-controller
|
|
42
|
-
// plugin — no dsh-web-app bundle is pulled in.
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
// scope) that the patch row above resolves. Its
|
|
44
|
+
// plugin — no dsh-web-app bundle is pulled in.
|
|
45
|
+
// [7/7] shim — generate the local shim package under the profile's
|
|
46
|
+
// node_modules (@aiwayds scope) that the patch row resolves.
|
|
47
|
+
// Its
|
|
47
48
|
// @deepseek-ai/cordis import is resolved by the host against
|
|
48
49
|
// the profile scope, exactly like the bridge. revision +
|
|
49
50
|
// backup converge it.
|
|
@@ -56,18 +57,14 @@
|
|
|
56
57
|
// taken over. The lock is released in `finally`, including on failure.
|
|
57
58
|
// Same-machine only: no cross-host / cross-user semantics.
|
|
58
59
|
//
|
|
59
|
-
// Idempotency: an existing
|
|
60
|
-
// is left untouched
|
|
61
|
-
//
|
|
62
|
-
// and decides whether the resolved artifact is acceptable).
|
|
60
|
+
// Idempotency: an existing bridge directory whose index.js hash matches THIS
|
|
61
|
+
// install's build-time fingerprint is left untouched; a stale directory, a
|
|
62
|
+
// leftover symlink, or a missing entry is replaced with a fresh copy.
|
|
63
63
|
//
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
// dist/bridge; a missing / wrong manifest is still converged as usual. The
|
|
69
|
-
// T5 identity guard runs afterwards either way — repair fixes the LINK,
|
|
70
|
-
// never the artifact CONTENT, so a fingerprint mismatch still fails.
|
|
64
|
+
// `--repair` / `--repair-bridge`: still accepted for CLI/caller compatibility,
|
|
65
|
+
// but a no-op for the bridge materialization — the copy converges
|
|
66
|
+
// unconditionally on every provision. The T5 identity guard always runs after
|
|
67
|
+
// convergence, so a fingerprint mismatch still fails loud.
|
|
71
68
|
//
|
|
72
69
|
// Hard guard: this script only ever touches the ONE profile named
|
|
73
70
|
// `opentui-inproc`. It never runs a package manager and never writes a
|
|
@@ -76,6 +73,7 @@
|
|
|
76
73
|
import { createHash } from 'node:crypto'
|
|
77
74
|
import {
|
|
78
75
|
closeSync,
|
|
76
|
+
cpSync,
|
|
79
77
|
existsSync,
|
|
80
78
|
lstatSync,
|
|
81
79
|
mkdirSync,
|
|
@@ -86,7 +84,6 @@ import {
|
|
|
86
84
|
renameSync,
|
|
87
85
|
rmSync,
|
|
88
86
|
statSync,
|
|
89
|
-
symlinkSync,
|
|
90
87
|
unlinkSync,
|
|
91
88
|
writeFileSync,
|
|
92
89
|
writeSync,
|
|
@@ -99,7 +96,6 @@ import { fileURLToPath } from 'node:url'
|
|
|
99
96
|
// BridgeBootstrapError (handshake) now carry the same three elements.
|
|
100
97
|
import {
|
|
101
98
|
BRIDGE_APPEND_PRESET_NOTICE,
|
|
102
|
-
BRIDGE_LEGACY_REMOTE_HINT,
|
|
103
99
|
BRIDGE_REPAIR_HINT,
|
|
104
100
|
} from './lib/bridge-failfast-text.mjs'
|
|
105
101
|
// Host-version gate. The host only records an incompatible profile bundle in
|
|
@@ -125,7 +121,10 @@ const LOCK_RETRY_MS = 25 // backoff between attempts while a peer holds the lock
|
|
|
125
121
|
const LOCK_MAX_ATTEMPTS = 40 // <= ~1s of waiting before a peer is skipped
|
|
126
122
|
|
|
127
123
|
const pkgRoot = dirname(dirname(fileURLToPath(import.meta.url)))
|
|
128
|
-
|
|
124
|
+
// Testability seam: the fail-fast tests point this at a bogus bridge dir to
|
|
125
|
+
// drive the fingerprint-mismatch path without mutating the real build artifact.
|
|
126
|
+
// Unset in production (the shipped dist/bridge is authoritative).
|
|
127
|
+
const bridgeDirRaw = process.env.DSH_OPENTUI_TEST_BRIDGE_DIR || join(pkgRoot, 'dist', 'bridge')
|
|
129
128
|
const fingerprintPath = join(bridgeDirRaw, 'bundle-fingerprint.json')
|
|
130
129
|
|
|
131
130
|
const dshHome = process.env.DSH_HOME || join(homedir(), '.dsh')
|
|
@@ -134,13 +133,11 @@ const manifestPath = join(profileDir, 'package.json')
|
|
|
134
133
|
const linkPath = join(profileDir, 'node_modules', ...BRIDGE_NAME.split('/'))
|
|
135
134
|
const lockPath = join(profileDir, LOCK_NAME)
|
|
136
135
|
|
|
137
|
-
// --- Inproc patch ownership
|
|
138
|
-
//
|
|
139
|
-
//
|
|
140
|
-
//
|
|
141
|
-
|
|
142
|
-
const INPROC_MODE = process.env.DSH_OPENTUI_INPROC !== '0'
|
|
143
|
-
const TOTAL_STEPS = INPROC_MODE ? 7 : 5
|
|
136
|
+
// --- Inproc patch ownership ------------------------------------------------
|
|
137
|
+
// S6: the patch/shim steps are unconditional (the env escape hatch that used
|
|
138
|
+
// to skip them is removed with the legacy seam). The launcher runs this script
|
|
139
|
+
// on every start; --repair-bridge and direct invocation converge identically.
|
|
140
|
+
const TOTAL_STEPS = 7
|
|
144
141
|
const PATCH_NAME = 'cordis.patch.yml'
|
|
145
142
|
const patchPath = join(profileDir, PATCH_NAME)
|
|
146
143
|
const PATCH_REVISION_MARKER = '# profileRevision: '
|
|
@@ -840,8 +837,21 @@ function linkState(path) {
|
|
|
840
837
|
return { kind: 'symlink', raw, abs, resolved }
|
|
841
838
|
}
|
|
842
839
|
|
|
840
|
+
/** True when `dir` is an up-to-date copy of this install's bridge: its
|
|
841
|
+
* index.js sha256 matches the build-time fingerprint. Used to make the
|
|
842
|
+
* bridge-copy materialization idempotent across launches/worktrees. */
|
|
843
|
+
function stateIsCurrentCopy(dir, fingerprintFile) {
|
|
844
|
+
try {
|
|
845
|
+
const fp = readJsonObject(fingerprintFile)
|
|
846
|
+
if (!fp || typeof fp.sha256 !== 'string') return false
|
|
847
|
+
return sha256File(join(dir, 'index.js')) === fp.sha256
|
|
848
|
+
} catch {
|
|
849
|
+
return false
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
|
|
843
853
|
/** Remove whatever occupies `path` (symlink, file or directory) so the correct
|
|
844
|
-
*
|
|
854
|
+
* copy can be created in its place. ENOENT is a no-op. */
|
|
845
855
|
function removePath(path) {
|
|
846
856
|
let st
|
|
847
857
|
try {
|
|
@@ -929,7 +939,7 @@ function verifyHostCompatibility(bridgeDir) {
|
|
|
929
939
|
} catch (error) {
|
|
930
940
|
fail(
|
|
931
941
|
'cannot verify the dsh host version before loading the bridge',
|
|
932
|
-
`${error instanceof Error ? error.message : String(error)}\nDetected with \`dsh --version\` (override: ${HOST_VERSION_ENV}=<exact version>)
|
|
942
|
+
`${error instanceof Error ? error.message : String(error)}\nDetected with \`dsh --version\` (override: ${HOST_VERSION_ENV}=<exact version>).`,
|
|
933
943
|
)
|
|
934
944
|
}
|
|
935
945
|
|
|
@@ -938,8 +948,7 @@ function verifyHostCompatibility(bridgeDir) {
|
|
|
938
948
|
`dsh host version is outside the bridge support window — expected ${HOST_PEER_RANGE}, actual ${hostVersion}`,
|
|
939
949
|
`The host would skip ${BRIDGE_NAME} without a usable error and bridge.hello would time out (BRIDGE_TIMEOUT). `
|
|
940
950
|
+ `Install a dsh host in ${HOST_PEER_RANGE}, or upgrade dsh-opentui. `
|
|
941
|
-
+ `Detection override: ${HOST_VERSION_ENV}=${process.env[HOST_VERSION_ENV] ?? '(unset)'}
|
|
942
|
-
+ `\n${BRIDGE_LEGACY_REMOTE_HINT}`,
|
|
951
|
+
+ `Detection override: ${HOST_VERSION_ENV}=${process.env[HOST_VERSION_ENV] ?? '(unset)'}.`,
|
|
943
952
|
)
|
|
944
953
|
}
|
|
945
954
|
|
|
@@ -1065,7 +1074,9 @@ function provisionShim() {
|
|
|
1065
1074
|
|
|
1066
1075
|
// --- The provision pass itself (runs under the lock) ------------------------
|
|
1067
1076
|
function runProvision({ repair = false } = {}) {
|
|
1068
|
-
|
|
1077
|
+
// S6: --repair is accepted for CLI compatibility but is a no-op — the bridge
|
|
1078
|
+
// copy converges unconditionally on every provision (no symlink to repair).
|
|
1079
|
+
if (repair) note('repair mode accepted (no-op — bridge copy converges every provision)')
|
|
1069
1080
|
// Prerequisites (read-only) are checked before any mutation.
|
|
1070
1081
|
if (!existsSync(bridgeDirRaw) || !statSync(bridgeDirRaw).isDirectory()) {
|
|
1071
1082
|
fail(
|
|
@@ -1116,51 +1127,48 @@ function runProvision({ repair = false } = {}) {
|
|
|
1116
1127
|
}
|
|
1117
1128
|
}
|
|
1118
1129
|
|
|
1119
|
-
// [3/7]
|
|
1120
|
-
//
|
|
1121
|
-
//
|
|
1122
|
-
let
|
|
1130
|
+
// [3/7] Materialize the bridge as a REAL DIRECTORY COPY (S6 symlink-debt
|
|
1131
|
+
// retirement). The old design wrote an ABSOLUTE symlink to THIS
|
|
1132
|
+
// installation's dist/bridge: that bound the profile to one install path and
|
|
1133
|
+
// let multiple worktrees sharing a DSH_HOME leave the link pointing at
|
|
1134
|
+
// whichever install provisioned last (A's dsh loading B's bundle = cross-
|
|
1135
|
+
// contamination); deleting a worktree left a dangling link → BRIDGE_TIMEOUT.
|
|
1136
|
+
// A copy removes the path binding entirely: every provision converges the
|
|
1137
|
+
// profile copy to THIS install's bytes, and the fingerprint identity guard
|
|
1138
|
+
// below rejects any drift. No symlink, no --repair branch, no conflict
|
|
1139
|
+
// report-only path (the flag is accepted for CLI compatibility but is a
|
|
1140
|
+
// no-op — convergence is unconditional).
|
|
1123
1141
|
{
|
|
1124
1142
|
const state = linkState(linkPath)
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
} catch (error) {
|
|
1130
|
-
fail(`could not create symlink ${linkPath}: ${error?.message ?? error}`)
|
|
1131
|
-
}
|
|
1132
|
-
say(3, 'symlink', `created ${linkPath} -> ${bridgeDir}`)
|
|
1133
|
-
} else if (state.kind === 'symlink' && (state.resolved === bridgeDir || state.abs === bridgeDir)) {
|
|
1134
|
-
say(3, 'symlink', 'already points at the bridge artifact, skipping')
|
|
1135
|
-
} else if (repair) {
|
|
1136
|
-
const desc = state.kind === 'not-symlink'
|
|
1137
|
-
? `${linkPath} is not a symlink`
|
|
1138
|
-
: `${linkPath} -> ${state.raw}`
|
|
1139
|
-
note(`repairing bridge link (${desc})`)
|
|
1143
|
+
const isReadyDir = state.kind === 'not-symlink' && stateIsCurrentCopy(linkPath, fingerprintPath)
|
|
1144
|
+
if (!isReadyDir) {
|
|
1145
|
+
const desc = state.kind === 'absent' ? 'absent' : state.kind === 'symlink' ? `symlink -> ${state.raw}` : 'stale directory'
|
|
1146
|
+
note(`materializing bridge copy (${desc})`)
|
|
1140
1147
|
try {
|
|
1141
1148
|
removePath(linkPath)
|
|
1142
1149
|
mkdirSync(dirname(linkPath), { recursive: true })
|
|
1143
|
-
|
|
1150
|
+
cpSync(bridgeDir, linkPath, { recursive: true })
|
|
1144
1151
|
} catch (error) {
|
|
1145
|
-
fail(`could not
|
|
1152
|
+
fail(`could not materialize bridge copy at ${linkPath}: ${error?.message ?? error}`)
|
|
1146
1153
|
}
|
|
1147
|
-
say(3, '
|
|
1148
|
-
} else if (state.kind === 'not-symlink') {
|
|
1149
|
-
conflict = `${linkPath} exists and is NOT a symlink`
|
|
1154
|
+
say(3, 'bridge-copy', `copied ${bridgeDir} -> ${linkPath}`)
|
|
1150
1155
|
} else {
|
|
1151
|
-
|
|
1156
|
+
say(3, 'bridge-copy', `${linkPath} already matches this install, skipping`)
|
|
1152
1157
|
}
|
|
1153
1158
|
}
|
|
1154
1159
|
|
|
1155
|
-
// [4/7] Verify:
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1160
|
+
// [4/7] Verify: linkPath is a REAL directory (never a symlink) carrying the
|
|
1161
|
+
// shipped bridge files, and no @deepseek-ai package leaked into the profile.
|
|
1162
|
+
{
|
|
1163
|
+
let st
|
|
1164
|
+
try { st = lstatSync(linkPath) } catch (error) { fail(`post-write verification failed for ${linkPath}: ${error?.message ?? error}`) }
|
|
1165
|
+
if (!st.isDirectory() || st.isSymbolicLink()) {
|
|
1166
|
+
fail(`post-write verification failed for ${linkPath}: bridge is not a real directory`)
|
|
1167
|
+
}
|
|
1168
|
+
for (const required of ['package.json', 'index.js', 'bundle-fingerprint.json']) {
|
|
1169
|
+
if (!existsSync(join(linkPath, required))) {
|
|
1170
|
+
fail(`post-write verification failed: ${linkPath} is missing ${required}`)
|
|
1171
|
+
}
|
|
1164
1172
|
}
|
|
1165
1173
|
// Explicit guard: no @deepseek-ai package may be present in the profile.
|
|
1166
1174
|
const deepseekDir = join(profileDir, 'node_modules', '@deepseek-ai')
|
|
@@ -1177,13 +1185,10 @@ function runProvision({ repair = false } = {}) {
|
|
|
1177
1185
|
// repointed / replaced bridge cannot slip through as a mere WARN.
|
|
1178
1186
|
verifyBridgeIdentity()
|
|
1179
1187
|
|
|
1180
|
-
// [6/7] Inproc
|
|
1181
|
-
//
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
provisionPatch()
|
|
1185
|
-
provisionShim()
|
|
1186
|
-
}
|
|
1188
|
+
// [6/7] Inproc patch generation + [7/7] the local shim package the patch row
|
|
1189
|
+
// resolves. S6: unconditional (no env escape hatch).
|
|
1190
|
+
provisionPatch()
|
|
1191
|
+
provisionShim()
|
|
1187
1192
|
|
|
1188
1193
|
console.log(`${PREFIX}PASS`)
|
|
1189
1194
|
}
|