@kira905/dsh-butler-install 0.3.8 → 0.3.10
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/bin/install-ui.mjs +11 -0
- package/lib/plan.mjs +9 -0
- package/package.json +1 -1
- package/suite-manifest.json +9 -0
package/bin/install-ui.mjs
CHANGED
|
@@ -92,6 +92,17 @@ export async function runEntry({
|
|
|
92
92
|
out.write(`端口 ${port} 上没有我们自己的向导页(${found.reason})⇒ 现在起一个。\n`);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
// 桌面版探测**在这里做一次**(允许探进程),结果挂到 options 上给每个请求复用:
|
|
96
|
+
// · 向导要求"每请求零 spawn" ⇒ 不能每次请求都去探进程;
|
|
97
|
+
// · 而要知道"桌面版正开着",又必须探进程(source === 'process')——
|
|
98
|
+
// 不然同机装了 CLI + 桌面版的人会默认落回 web,装完桌面版界面一个插件都看不到(2026-11-07 实测)。
|
|
99
|
+
if (options.ui && !options.desktopPre) {
|
|
100
|
+
try {
|
|
101
|
+
const { detectDesktop } = await import('../lib/desktop.mjs');
|
|
102
|
+
options.desktopPre = await detectDesktop({ home: options.home, allowProcessProbe: true });
|
|
103
|
+
} catch { /* 探测失败就当没桌面版:退回原来的默认 web */ }
|
|
104
|
+
}
|
|
105
|
+
|
|
95
106
|
const started = await startServer({ options, port: options.uiPort });
|
|
96
107
|
if (!started.ok) {
|
|
97
108
|
for (const line of started.log) out.write(`${line}\n`);
|
package/lib/plan.mjs
CHANGED
|
@@ -208,6 +208,8 @@ export function resetDesktopDetectCache() {
|
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
async function desktopFor(home, options) {
|
|
211
|
+
// 启动时已解析过的(--ui 用它保证每请求零 spawn,同时也才有资格做进程探测)
|
|
212
|
+
if (options.desktopPre) return options.desktopPre;
|
|
211
213
|
const env = options.env || process.env;
|
|
212
214
|
const key = `${home}|${env.DSH_DESKTOP_DIR || ''}|${env.DSH_DESKTOP_CLI || ''}`;
|
|
213
215
|
if (desktopDetectCache.has(key)) return desktopDetectCache.get(key);
|
|
@@ -247,6 +249,13 @@ export function decideProfile({ options, home, desktop }) {
|
|
|
247
249
|
return { profile: requested, changed: false, source: 'explicit', notices };
|
|
248
250
|
}
|
|
249
251
|
if (!options.profileExplicit) {
|
|
252
|
+
// ① 桌面版**正在运行** ⇒ 用户此刻就在用它,默认就该装 desktop。
|
|
253
|
+
// 为什么要这条:下面 ② 只处理"只有 desktop、没有 web"的机器;而同时装了 CLI 与桌面版的人
|
|
254
|
+
// 两个 profile 都在,② 不命中 ⇒ 会落回 web ⇒ 装完桌面版界面上一个插件都看不到(2026-11-07 实测)。
|
|
255
|
+
if (desktop.source === 'process' && desktop.cliCmd) {
|
|
256
|
+
notices.push('检测到桌面版(Electron)正在运行,已默认改成 --profile desktop —— 装进 web 的那套界面,桌面版永远不加载');
|
|
257
|
+
return { profile: 'desktop', changed: true, source: 'auto-desktop-running', notices };
|
|
258
|
+
}
|
|
250
259
|
const webExists = readProfile(home, 'web').exists;
|
|
251
260
|
if (desktop.desktopProfileExists && desktop.cliCmd && !webExists) {
|
|
252
261
|
notices.push('这台机器的数据根里只有桌面版自建的 desktop profile(没有 web),已改成 --profile desktop —— 装进 web 的那套界面桌面版永远不加载');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kira905/dsh-butler-install",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.10",
|
|
4
4
|
"description": "Thin installer for the DSH butler suite: one command installs the plugin + CLI bundle through the host's own commands, then tells you whether it actually took effect, and can roll the whole batch back. Also ships a local wizard page (--ui) that lives outside DSH and can install from the browser: nothing runs until you press confirm; loopback only, per-process token + same-origin check, four POST entry points (preview/start/cancel/rollback), two honest rollbacks. It does not isolate you from other programs running as the same local user.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/suite-manifest.json
CHANGED
|
@@ -81,6 +81,15 @@
|
|
|
81
81
|
"probe": { "kind": "existence", "cmd": "ops-tickd" },
|
|
82
82
|
"note": "大管家的调度与记账命令。注意 ops-tickd 是常驻调度,装完不是跑一次就完。"
|
|
83
83
|
},
|
|
84
|
+
{
|
|
85
|
+
"name": "@kira905/dsh-butler-engine",
|
|
86
|
+
"versionRange": "^0.1.0",
|
|
87
|
+
"type": "cli",
|
|
88
|
+
"group": "CLI",
|
|
89
|
+
"aliases": ["调度内核", "自治引擎"],
|
|
90
|
+
"probe": { "kind": "existence", "cmd": "butler-tickd" },
|
|
91
|
+
"note": "真常驻调度的内核(作业表 + 单实例锁 + 放行矩阵 + 哈希链审计)。⚠️ 装完一条作业都不会自己跑:它不附带作业脚本,默认全关,要哪条自己在配置里放行。"
|
|
92
|
+
},
|
|
84
93
|
{
|
|
85
94
|
"name": "@kira905/dsh-session-toolkit",
|
|
86
95
|
"versionRange": "^0.1.2",
|