@dsh-workbench/core 1.1.11 → 1.1.13
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/README.md +1 -0
- package/client.js +181 -76
- package/dist/client/client.body.js +181 -76
- package/dist/client/index.js +174 -69
- package/dist/host/index.js +45 -15
- package/dist/types/app/layouts/env-gate/gate-text.d.ts +5 -0
- package/dist/types/app/layouts/market/use-market-reload.d.ts +10 -4
- package/dist/types/app/layouts/market/use-module-versions.d.ts +9 -8
- package/dist/types/app/layouts/rightbar/MarketView.d.ts +2 -3
- package/dist/types/app/layouts/rightbar/market-act.d.ts +2 -3
- package/dist/types/modules/panels/model/plugin-section.d.ts +1 -0
- package/dist/types/shared/hooks/bundle-queries.d.ts +2 -2
- package/package.json +3 -3
package/dist/client/index.js
CHANGED
|
@@ -3577,6 +3577,7 @@ var en = {
|
|
|
3577
3577
|
"env.stepFailed.install": "install failed",
|
|
3578
3578
|
"env.stepFailed.path": "installed but not found",
|
|
3579
3579
|
"env.stepFailed.shell": "cannot reach the command line",
|
|
3580
|
+
"env.stepFailed.host": "the command never returned",
|
|
3580
3581
|
"env.toolchain.ok": "Looks good",
|
|
3581
3582
|
"env.toolchain.warn": "Almost ready",
|
|
3582
3583
|
"env.runtime.ok": "Ready",
|
|
@@ -3589,9 +3590,11 @@ var en = {
|
|
|
3589
3590
|
"env.fix.why": "The workbench uses its own background tool (installed separately from the one in your terminal), and it is not set up on this machine yet.",
|
|
3590
3591
|
"env.fix.whyPath": "The background tool is installed, but this environment cannot find it — usually a PATH or shell-session issue.",
|
|
3591
3592
|
"env.fix.whyShell": "The workbench cannot reach the command line on this machine, so it cannot fetch data — you cannot install this from here; someone needs to fix the background environment.",
|
|
3593
|
+
"env.fix.whyHost": "The workbench runs a few checks on the command line and collects what they return; this time the command went out and nothing came back. The tools themselves are most likely fine — reinstalling Node / npm / pnpm will not help.",
|
|
3592
3594
|
"env.fix.step": "Run this in a terminal, then hit Retry:",
|
|
3593
3595
|
"env.fix.stepPath": "Open a new terminal window (or make sure npm’s global bin directory is on PATH), then hit Retry.",
|
|
3594
3596
|
"env.fix.stepShell": "Restart the workbench (or dsh); if it keeps happening, the workbench still cannot reach the command line.",
|
|
3597
|
+
"env.fix.stepHost": "Quit the workbench completely (including the tray icon), clear the dsh-* leftovers in the system temp folder, then open it again. If it keeps happening, update dsh.",
|
|
3595
3598
|
"env.fix.permission": "Permission denied: rerun with sudo, or point npm’s global directory at your home.",
|
|
3596
3599
|
"env.fix.network": "Network unreachable: check your network or proxy, then retry.",
|
|
3597
3600
|
"env.fix.details": "Details (for troubleshooting)",
|
|
@@ -4343,6 +4346,7 @@ var dictionaries = {
|
|
|
4343
4346
|
"env.stepFailed.install": "装不上",
|
|
4344
4347
|
"env.stepFailed.path": "装了但还找不到",
|
|
4345
4348
|
"env.stepFailed.shell": "连不上命令行",
|
|
4349
|
+
"env.stepFailed.host": "命令行没有返回",
|
|
4346
4350
|
"env.toolchain.ok": "正常",
|
|
4347
4351
|
"env.toolchain.warn": "还没完全准备好",
|
|
4348
4352
|
"env.runtime.ok": "已就绪",
|
|
@@ -4355,9 +4359,11 @@ var dictionaries = {
|
|
|
4355
4359
|
"env.fix.why": "工作台用它自己那份后台工具(与你在终端里那套分开装,互不影响),这台机器上还没装好它。",
|
|
4356
4360
|
"env.fix.whyPath": "后台工具装上了,但当前环境还找不到它 —— 通常是 PATH 或终端会话的问题。",
|
|
4357
4361
|
"env.fix.whyShell": "工作台拿不到这台机器的命令行,所以取不了数据 —— 这一步你装不了,需要有人处理后台环境。",
|
|
4362
|
+
"env.fix.whyHost": "工作台要靠命令行跑几条检查,再把结果收回来;这次命令发出去了,结果一直没回来。工具本身多半是好的 —— 重装 Node / npm / pnpm 不会有帮助。",
|
|
4358
4363
|
"env.fix.step": "在终端里运行下面这条命令,装好之后点「重试」:",
|
|
4359
4364
|
"env.fix.stepPath": "新开一个终端窗口(或确认 npm 的全局 bin 目录在 PATH 里),然后点「重试」。",
|
|
4360
4365
|
"env.fix.stepShell": "重启一次工作台(或 dsh);如果反复出现,说明工作台还是拿不到命令行。",
|
|
4366
|
+
"env.fix.stepHost": "完全退出工作台(托盘图标也要退),清掉系统临时目录里 dsh- 开头的残留,再重新打开;反复出现就升级 dsh。",
|
|
4361
4367
|
"env.fix.permission": "权限不够:在命令前加 sudo 重跑,或先把 npm 的全局目录配到你的用户目录。",
|
|
4362
4368
|
"env.fix.network": "网络不通:检查网络或代理设置后重试。",
|
|
4363
4369
|
"env.fix.details": "详细输出(排障用)",
|
|
@@ -10386,11 +10392,17 @@ function readBundleInspection(spec, registry) {
|
|
|
10386
10392
|
...registry === void 0 || registry === "" ? {} : { registry }
|
|
10387
10393
|
});
|
|
10388
10394
|
}
|
|
10389
|
-
function readModuleVersions(force = false) {
|
|
10390
|
-
return apiGet(MODULE_VERSIONS_ROUTE,
|
|
10395
|
+
function readModuleVersions(force = false, check = true) {
|
|
10396
|
+
return apiGet(MODULE_VERSIONS_ROUTE, {
|
|
10397
|
+
...force ? { force: "1" } : {},
|
|
10398
|
+
...check ? {} : { check: "0" }
|
|
10399
|
+
});
|
|
10391
10400
|
}
|
|
10392
|
-
function readInstalledPlugins(force = false) {
|
|
10393
|
-
return apiGet(INSTALLED_PLUGINS_ROUTE,
|
|
10401
|
+
function readInstalledPlugins(force = false, check = true) {
|
|
10402
|
+
return apiGet(INSTALLED_PLUGINS_ROUTE, {
|
|
10403
|
+
...force ? { force: "1" } : {},
|
|
10404
|
+
...check ? {} : { check: "0" }
|
|
10405
|
+
});
|
|
10394
10406
|
}
|
|
10395
10407
|
//#endregion
|
|
10396
10408
|
//#region src/app/layouts/market/use-module-versions.ts
|
|
@@ -10419,6 +10431,10 @@ var newestForceSeq = {
|
|
|
10419
10431
|
modules: -1,
|
|
10420
10432
|
plugins: -1
|
|
10421
10433
|
};
|
|
10434
|
+
var newestDataSeq = {
|
|
10435
|
+
modules: -1,
|
|
10436
|
+
plugins: -1
|
|
10437
|
+
};
|
|
10422
10438
|
var epoch = 0;
|
|
10423
10439
|
var allSeq = 0;
|
|
10424
10440
|
function bumpModuleVersionsEpoch() {
|
|
@@ -10445,9 +10461,39 @@ function withMarketUpdates(modules, rows) {
|
|
|
10445
10461
|
};
|
|
10446
10462
|
});
|
|
10447
10463
|
}
|
|
10448
|
-
function
|
|
10449
|
-
|
|
10450
|
-
|
|
10464
|
+
function withPreviousLatest(modules, previous) {
|
|
10465
|
+
if (previous.length === 0) return modules;
|
|
10466
|
+
const byPkg = new Map(previous.map((module) => [module.pkg, module]));
|
|
10467
|
+
return modules.map((module) => {
|
|
10468
|
+
const old = byPkg.get(module.pkg);
|
|
10469
|
+
if (old === void 0) return module;
|
|
10470
|
+
return {
|
|
10471
|
+
...module,
|
|
10472
|
+
...module.latest === void 0 && old.latest !== void 0 ? { latest: old.latest } : {},
|
|
10473
|
+
...module.latestBlocked === void 0 && old.latestBlocked !== void 0 ? { latestBlocked: old.latestBlocked } : {},
|
|
10474
|
+
...module.latestUnavailable === void 0 && old.latestUnavailable !== void 0 ? { latestUnavailable: old.latestUnavailable } : {}
|
|
10475
|
+
};
|
|
10476
|
+
});
|
|
10477
|
+
}
|
|
10478
|
+
function withPreviousPluginLatest(plugins, previous) {
|
|
10479
|
+
if (previous.length === 0) return plugins;
|
|
10480
|
+
const byPkg = new Map(previous.map((plugin) => [plugin.pkg, plugin]));
|
|
10481
|
+
return plugins.map((plugin) => {
|
|
10482
|
+
const old = byPkg.get(plugin.pkg);
|
|
10483
|
+
if (old === void 0 || plugin.latest !== void 0 || old.latest === void 0) return plugin;
|
|
10484
|
+
return {
|
|
10485
|
+
...plugin,
|
|
10486
|
+
latest: old.latest
|
|
10487
|
+
};
|
|
10488
|
+
});
|
|
10489
|
+
}
|
|
10490
|
+
function withPreviousWorkbenchLatest(next, previous) {
|
|
10491
|
+
if (next === null || previous === null) return next;
|
|
10492
|
+
if (next.latest !== void 0 || previous.latest === void 0 || next.pkg !== previous.pkg) return next;
|
|
10493
|
+
return {
|
|
10494
|
+
...next,
|
|
10495
|
+
latest: previous.latest
|
|
10496
|
+
};
|
|
10451
10497
|
}
|
|
10452
10498
|
function moduleVersionsChecking(value) {
|
|
10453
10499
|
return value.allChecking || value.modulesCheck.checking || value.pluginsCheck.checking;
|
|
@@ -10478,72 +10524,104 @@ function landed(seat, ticket, latest, ok, at) {
|
|
|
10478
10524
|
checkedAt: ok ? at : seat.checkedAt
|
|
10479
10525
|
};
|
|
10480
10526
|
}
|
|
10481
|
-
function readModulesOnce(force) {
|
|
10482
|
-
return Promise.all([readModuleVersions(force), readMarketInstalled()]).catch(() => null);
|
|
10527
|
+
function readModulesOnce(force, check) {
|
|
10528
|
+
return Promise.all([readModuleVersions(force, check), readMarketInstalled()]).catch(() => null);
|
|
10483
10529
|
}
|
|
10484
|
-
function readPluginsOnce(force) {
|
|
10485
|
-
return readInstalledPlugins(force).catch(() => null);
|
|
10530
|
+
function readPluginsOnce(force, check) {
|
|
10531
|
+
return readInstalledPlugins(force, check).catch(() => null);
|
|
10486
10532
|
}
|
|
10487
|
-
function
|
|
10533
|
+
function readKey(run) {
|
|
10534
|
+
return `${run.kind}:${run.scope}:${run.force ? "force" : "cached"}`;
|
|
10535
|
+
}
|
|
10536
|
+
function superseded(run, part, ticket) {
|
|
10537
|
+
if (run.kind === "data") return ticket < newestDataSeq[part];
|
|
10538
|
+
return !run.force && ticket < newestForceSeq[part];
|
|
10539
|
+
}
|
|
10540
|
+
function runRead(run) {
|
|
10488
10541
|
const at = epoch;
|
|
10489
|
-
const
|
|
10490
|
-
|
|
10491
|
-
|
|
10542
|
+
const key = readKey(run);
|
|
10543
|
+
const running = inFlight.get(key);
|
|
10544
|
+
if (!run.fresh && running !== void 0 && running.epoch === at) return running.promise;
|
|
10545
|
+
const check = run.kind === "check";
|
|
10546
|
+
const allTicket = run.scope === "all" ? allSeq += 1 : allSeq;
|
|
10492
10547
|
const tickets = /* @__PURE__ */ new Map();
|
|
10493
|
-
for (const part of partsOf(scope)) {
|
|
10548
|
+
for (const part of partsOf(run.scope)) {
|
|
10494
10549
|
const ticket = seq$1[part] += 1;
|
|
10495
10550
|
tickets.set(part, ticket);
|
|
10496
|
-
if (force) newestForceSeq[part] = ticket;
|
|
10551
|
+
if (run.force) newestForceSeq[part] = ticket;
|
|
10552
|
+
if (!check) newestDataSeq[part] = ticket;
|
|
10497
10553
|
}
|
|
10498
|
-
publish$1(checking(scope));
|
|
10499
|
-
const
|
|
10500
|
-
const
|
|
10501
|
-
const
|
|
10502
|
-
if (at !== epoch) return;
|
|
10503
|
-
const
|
|
10504
|
-
const
|
|
10505
|
-
const
|
|
10506
|
-
const
|
|
10507
|
-
const pluginsLanded = pluginsTicket !== void 0 && (force || pluginsTicket >= newestForceSeq.plugins);
|
|
10508
|
-
const modulesOk = modulesLanded && modules !== null && modules[0].ok === true;
|
|
10509
|
-
const pluginsOk = pluginsLanded && plugins !== null && plugins.ok === true;
|
|
10554
|
+
if (check) publish$1(checking(run.scope));
|
|
10555
|
+
const modulesTicket = tickets.get("modules");
|
|
10556
|
+
const pluginsTicket = tickets.get("plugins");
|
|
10557
|
+
const modulesRead = modulesTicket === void 0 ? null : readModulesOnce(run.force, check).then((response) => {
|
|
10558
|
+
if (at !== epoch || response === null || superseded(run, "modules", modulesTicket)) return;
|
|
10559
|
+
const [modules, market] = response;
|
|
10560
|
+
const payload = modules.ok === true ? modules : null;
|
|
10561
|
+
const listed = payload === null ? null : withMarketUpdates(payload.modules, market.ok === true ? market.modules : []);
|
|
10562
|
+
const shown = listed === null ? null : check ? listed : withPreviousLatest(listed, state.modules ?? []);
|
|
10510
10563
|
publish$1({
|
|
10511
10564
|
...state,
|
|
10512
|
-
modules:
|
|
10513
|
-
workbench:
|
|
10514
|
-
selfUpdate:
|
|
10515
|
-
plugins: pluginsOk ? plugins.plugins : state.plugins,
|
|
10565
|
+
modules: shown ?? state.modules,
|
|
10566
|
+
workbench: payload === null ? state.workbench : check ? payload.workbench ?? null : withPreviousWorkbenchLatest(payload.workbench ?? null, state.workbench),
|
|
10567
|
+
selfUpdate: payload === null ? state.selfUpdate : payload.selfUpdate ?? null,
|
|
10516
10568
|
read: true,
|
|
10517
|
-
|
|
10518
|
-
|
|
10519
|
-
|
|
10569
|
+
...check ? { modulesCheck: landed(state.modulesCheck, modulesTicket, seq$1.modules, payload !== null, Date.now()) } : {}
|
|
10570
|
+
});
|
|
10571
|
+
});
|
|
10572
|
+
const pluginsRead = pluginsTicket === void 0 ? null : readPluginsOnce(run.force, check).then((response) => {
|
|
10573
|
+
if (at !== epoch || response === null || superseded(run, "plugins", pluginsTicket)) return;
|
|
10574
|
+
const ok = response.ok === true;
|
|
10575
|
+
publish$1({
|
|
10576
|
+
...state,
|
|
10577
|
+
plugins: ok ? check ? response.plugins : withPreviousPluginLatest(response.plugins, state.plugins ?? []) : state.plugins,
|
|
10578
|
+
...check ? { pluginsCheck: landed(state.pluginsCheck, pluginsTicket, seq$1.plugins, ok, Date.now()) } : {}
|
|
10579
|
+
});
|
|
10580
|
+
});
|
|
10581
|
+
const promise = Promise.all([modulesRead, pluginsRead]).then(() => {
|
|
10582
|
+
if (at !== epoch || !check || run.scope !== "all" || allTicket !== allSeq) return;
|
|
10583
|
+
if (!state.allChecking) return;
|
|
10584
|
+
publish$1({
|
|
10585
|
+
...state,
|
|
10586
|
+
allChecking: false
|
|
10520
10587
|
});
|
|
10521
10588
|
}).finally(() => {
|
|
10522
|
-
if (inFlight.get(
|
|
10589
|
+
if (inFlight.get(key)?.promise === promise) inFlight.delete(key);
|
|
10523
10590
|
});
|
|
10524
|
-
inFlight.set(
|
|
10525
|
-
force,
|
|
10591
|
+
inFlight.set(key, {
|
|
10526
10592
|
epoch: at,
|
|
10527
10593
|
promise
|
|
10528
10594
|
});
|
|
10529
10595
|
return promise;
|
|
10530
10596
|
}
|
|
10597
|
+
function runModuleVersionsRead(force = false, fresh = false, scope = "all") {
|
|
10598
|
+
return runRead({
|
|
10599
|
+
kind: "check",
|
|
10600
|
+
force,
|
|
10601
|
+
fresh,
|
|
10602
|
+
scope
|
|
10603
|
+
});
|
|
10604
|
+
}
|
|
10605
|
+
function runInstalledRead(options = {}) {
|
|
10606
|
+
return runRead({
|
|
10607
|
+
kind: "data",
|
|
10608
|
+
force: false,
|
|
10609
|
+
fresh: options.fresh === true,
|
|
10610
|
+
scope: "all"
|
|
10611
|
+
});
|
|
10612
|
+
}
|
|
10531
10613
|
function useModuleVersions() {
|
|
10532
10614
|
const value = useSyncExternalStore(subscribeModuleVersions, moduleVersionsValue);
|
|
10533
10615
|
const factRev = useFactRevision(CAPABILITY_FACT);
|
|
10534
|
-
const mountedRef = useRef(false);
|
|
10535
10616
|
useEffect(() => {
|
|
10536
|
-
|
|
10537
|
-
mountedRef.current = true;
|
|
10538
|
-
if (first && !shouldProbeOnEnter({
|
|
10539
|
-
checkedAt: moduleVersionsCheckedAt(state),
|
|
10540
|
-
now: Date.now(),
|
|
10541
|
-
staleMs: MARKET_STALE_MS
|
|
10542
|
-
})) return;
|
|
10543
|
-
runModuleVersionsRead(false);
|
|
10617
|
+
runInstalledRead();
|
|
10544
10618
|
}, [factRev]);
|
|
10545
10619
|
const reload = useCallback((options) => {
|
|
10546
|
-
|
|
10620
|
+
if (options?.check === true) {
|
|
10621
|
+
runModuleVersionsRead(options.force === true, options.fresh === true, options.scope ?? "all");
|
|
10622
|
+
return;
|
|
10623
|
+
}
|
|
10624
|
+
runInstalledRead({ fresh: options?.fresh === true });
|
|
10547
10625
|
}, []);
|
|
10548
10626
|
return {
|
|
10549
10627
|
...value,
|
|
@@ -10560,29 +10638,36 @@ function useMarketReload(input) {
|
|
|
10560
10638
|
bumpModuleVersionsEpoch();
|
|
10561
10639
|
bumpCapabilityEpoch();
|
|
10562
10640
|
forceProbe();
|
|
10563
|
-
|
|
10564
|
-
force: true,
|
|
10565
|
-
fresh: true
|
|
10566
|
-
});
|
|
10567
|
-
return;
|
|
10568
|
-
}
|
|
10569
|
-
reloadCapability();
|
|
10641
|
+
} else reloadCapability();
|
|
10570
10642
|
reloadVersions();
|
|
10571
10643
|
}, [
|
|
10572
10644
|
reloadCapability,
|
|
10573
10645
|
reloadVersions,
|
|
10574
10646
|
forceProbe
|
|
10575
10647
|
]);
|
|
10576
|
-
const
|
|
10577
|
-
|
|
10578
|
-
|
|
10579
|
-
|
|
10580
|
-
|
|
10648
|
+
const check = useCallback((options) => {
|
|
10649
|
+
reloadVersions({
|
|
10650
|
+
check: true,
|
|
10651
|
+
force: options?.force === true,
|
|
10652
|
+
fresh: true,
|
|
10653
|
+
...options?.scope === void 0 ? {} : { scope: options.scope }
|
|
10654
|
+
});
|
|
10655
|
+
}, [reloadVersions]);
|
|
10656
|
+
const recheck = useCallback(() => {
|
|
10657
|
+
bumpCapabilityEpoch();
|
|
10658
|
+
forceProbe();
|
|
10659
|
+
check({ force: true });
|
|
10660
|
+
}, [check, forceProbe]);
|
|
10661
|
+
const checkPart = useCallback((part) => {
|
|
10662
|
+
check({
|
|
10663
|
+
force: true,
|
|
10664
|
+
scope: part
|
|
10665
|
+
});
|
|
10666
|
+
}, [check]);
|
|
10581
10667
|
const enteredRef = useRef(false);
|
|
10582
10668
|
useEffect(() => {
|
|
10583
10669
|
if (enteredRef.current) return;
|
|
10584
10670
|
enteredRef.current = true;
|
|
10585
|
-
reloadVersions();
|
|
10586
10671
|
if (!shouldProbeOnEnter({
|
|
10587
10672
|
checkedAt,
|
|
10588
10673
|
now: Date.now(),
|
|
@@ -10590,13 +10675,15 @@ function useMarketReload(input) {
|
|
|
10590
10675
|
})) return;
|
|
10591
10676
|
markNextProbeSilent();
|
|
10592
10677
|
forceProbe();
|
|
10678
|
+
check();
|
|
10593
10679
|
}, [
|
|
10594
10680
|
checkedAt,
|
|
10595
10681
|
forceProbe,
|
|
10596
|
-
|
|
10682
|
+
check
|
|
10597
10683
|
]);
|
|
10598
10684
|
return {
|
|
10599
10685
|
reload,
|
|
10686
|
+
recheck,
|
|
10600
10687
|
checkPart
|
|
10601
10688
|
};
|
|
10602
10689
|
}
|
|
@@ -11293,7 +11380,7 @@ function MarketPanel({ t, units, titleOf }) {
|
|
|
11293
11380
|
const openAddModule = useCallback(() => setAdding(true), []);
|
|
11294
11381
|
const updates = useMemo(() => marketUpdatesOf(modules), [modules]);
|
|
11295
11382
|
const installed = modules === null ? void 0 : withClientRefusals(modules, units.refusals());
|
|
11296
|
-
const { reload, checkPart } = useMarketReload({
|
|
11383
|
+
const { reload, recheck, checkPart } = useMarketReload({
|
|
11297
11384
|
checkedAt,
|
|
11298
11385
|
forceProbe,
|
|
11299
11386
|
reloadCapability,
|
|
@@ -11324,7 +11411,7 @@ function MarketPanel({ t, units, titleOf }) {
|
|
|
11324
11411
|
busy,
|
|
11325
11412
|
checking: checking || versionsAllChecking,
|
|
11326
11413
|
onTab: setTab,
|
|
11327
|
-
onReload:
|
|
11414
|
+
onReload: recheck,
|
|
11328
11415
|
onAdd: openAddModule
|
|
11329
11416
|
}), devMarket.strip, /* @__PURE__ */ createElement("div", {
|
|
11330
11417
|
id: `${MARKET_PANEL_ID}-panel-installed`,
|
|
@@ -12954,8 +13041,27 @@ var BootGate_module_default = {
|
|
|
12954
13041
|
function failedStepText(guidance, t) {
|
|
12955
13042
|
if (guidance === "path") return t("env.stepFailed.path");
|
|
12956
13043
|
if (guidance === "shell") return t("env.stepFailed.shell");
|
|
13044
|
+
if (guidance === "host") return t("env.stepFailed.host");
|
|
12957
13045
|
return t("env.stepFailed.install");
|
|
12958
13046
|
}
|
|
13047
|
+
function guidanceTextOf(guidance, t) {
|
|
13048
|
+
if (guidance === "path") return {
|
|
13049
|
+
why: t("env.fix.whyPath"),
|
|
13050
|
+
step: t("env.fix.stepPath")
|
|
13051
|
+
};
|
|
13052
|
+
if (guidance === "shell") return {
|
|
13053
|
+
why: t("env.fix.whyShell"),
|
|
13054
|
+
step: t("env.fix.stepShell")
|
|
13055
|
+
};
|
|
13056
|
+
if (guidance === "host") return {
|
|
13057
|
+
why: t("env.fix.whyHost"),
|
|
13058
|
+
step: t("env.fix.stepHost")
|
|
13059
|
+
};
|
|
13060
|
+
return {
|
|
13061
|
+
why: t("env.fix.why"),
|
|
13062
|
+
step: t("env.fix.step")
|
|
13063
|
+
};
|
|
13064
|
+
}
|
|
12959
13065
|
function stepDetailText(step, snapshot, t) {
|
|
12960
13066
|
if (step.status === "failed") return failedStepText(snapshot.guidance, t);
|
|
12961
13067
|
if (step.status === "pending" || step.status === "running") return "";
|
|
@@ -13299,10 +13405,9 @@ function createBootGate(ctx, options = {}) {
|
|
|
13299
13405
|
errorBox.hidden = snapshot.error === void 0;
|
|
13300
13406
|
const commandText = snapshot.steps.find((step) => step.status === "failed" && step.command !== void 0)?.command;
|
|
13301
13407
|
const guidance = snapshot.guidance ?? "install";
|
|
13302
|
-
const
|
|
13303
|
-
|
|
13304
|
-
|
|
13305
|
-
fixStep.textContent = step;
|
|
13408
|
+
const advice = guidanceTextOf(guidance, t);
|
|
13409
|
+
fixWhy.textContent = advice.why;
|
|
13410
|
+
fixStep.textContent = advice.step;
|
|
13306
13411
|
const showCommand = guidance === "install" && commandText !== void 0;
|
|
13307
13412
|
fixCommand.set(showCommand ? commandText : void 0);
|
|
13308
13413
|
fixAdvice.textContent = !showCommand ? "" : snapshot.failure === "permission" ? t("env.fix.permission") : snapshot.failure === "network" ? t("env.fix.network") : "";
|
package/dist/host/index.js
CHANGED
|
@@ -843,6 +843,29 @@ function refusalReason() {
|
|
|
843
843
|
//#endregion
|
|
844
844
|
//#region ../shared/dist/host/shell.js
|
|
845
845
|
var DEFAULT_MAX_BYTES$3 = 8388608;
|
|
846
|
+
var GUARD_SLACK_MS = 1e3;
|
|
847
|
+
function stalledResult() {
|
|
848
|
+
return {
|
|
849
|
+
exitCode: null,
|
|
850
|
+
timedOut: true,
|
|
851
|
+
aborted: false,
|
|
852
|
+
stdout: "",
|
|
853
|
+
stderr: "",
|
|
854
|
+
truncated: false,
|
|
855
|
+
stalled: true
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
async function settleWithin(work, limitMs) {
|
|
859
|
+
let timer;
|
|
860
|
+
const guard = new Promise((resolve) => {
|
|
861
|
+
timer = setTimeout(() => resolve(null), limitMs);
|
|
862
|
+
});
|
|
863
|
+
try {
|
|
864
|
+
return await Promise.race([work, guard]);
|
|
865
|
+
} finally {
|
|
866
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
846
869
|
async function runShell(shell, command, options = {}) {
|
|
847
870
|
const { workdir, timeoutMs = GIT_TIMEOUT_MS, signal } = options;
|
|
848
871
|
const spec = shell.resolve({
|
|
@@ -853,15 +876,18 @@ async function runShell(shell, command, options = {}) {
|
|
|
853
876
|
stdoutMaxBytes: DEFAULT_MAX_BYTES$3,
|
|
854
877
|
...signal === void 0 ? {} : { signal }
|
|
855
878
|
});
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
879
|
+
return await settleWithin((async () => {
|
|
880
|
+
const result = await (await shell.execute(spec)).result();
|
|
881
|
+
return {
|
|
882
|
+
exitCode: result.exitCode,
|
|
883
|
+
timedOut: result.timedOut === true,
|
|
884
|
+
aborted: result.aborted === true,
|
|
885
|
+
stdout: result.stdout.text,
|
|
886
|
+
stderr: result.stderr.text,
|
|
887
|
+
truncated: result.stdout.truncated || result.stderr.truncated,
|
|
888
|
+
stalled: false
|
|
889
|
+
};
|
|
890
|
+
})(), timeoutMs + GUARD_SLACK_MS) ?? stalledResult();
|
|
865
891
|
}
|
|
866
892
|
//#endregion
|
|
867
893
|
//#region ../shared/dist/host/shell-text.js
|
|
@@ -6583,7 +6609,7 @@ async function workbenchVersion(supply, input) {
|
|
|
6583
6609
|
const spec = dependencyReader(input.dir)(PLUGIN_ID);
|
|
6584
6610
|
const registry = read.registry ?? input.fallback;
|
|
6585
6611
|
const shell = input.shell;
|
|
6586
|
-
const queried = read.local === true || shell === void 0 || registry === void 0 ? void 0 : await supply.latestVersion({
|
|
6612
|
+
const queried = read.local === true || !input.check || shell === void 0 || registry === void 0 ? void 0 : await supply.latestVersion({
|
|
6587
6613
|
shell,
|
|
6588
6614
|
name: read.pkg,
|
|
6589
6615
|
registry,
|
|
@@ -6620,6 +6646,7 @@ function moduleVersionsHandler(ctx, shell, running, selfUpdate) {
|
|
|
6620
6646
|
const found = supply.profileModules(dir);
|
|
6621
6647
|
const refusals = new Map((ctx.get("workbenchUnits")?.refusals() ?? []).filter((one) => one.unit !== "").map((one) => [one.unit, one.reasons]));
|
|
6622
6648
|
const force = param(search, "force") === "1";
|
|
6649
|
+
const check = param(search, "check") !== "0";
|
|
6623
6650
|
const fallback = (await manager.registries())?.resolved ?? void 0;
|
|
6624
6651
|
const dependencyOf = dependencyReader(dir);
|
|
6625
6652
|
const modules = await Promise.all(found.map(async (module) => {
|
|
@@ -6627,7 +6654,7 @@ function moduleVersionsHandler(ctx, shell, running, selfUpdate) {
|
|
|
6627
6654
|
const fromRegistry = module.fromRegistry !== false;
|
|
6628
6655
|
const registry = fromRegistry ? module.registry ?? fallback : void 0;
|
|
6629
6656
|
const spec = dependencyOf(module.pkg);
|
|
6630
|
-
const latest = local || !fromRegistry || shell === void 0 || registry === void 0 ? void 0 : await supply.latestVersion({
|
|
6657
|
+
const latest = local || !fromRegistry || !check || shell === void 0 || registry === void 0 ? void 0 : await supply.latestVersion({
|
|
6631
6658
|
shell,
|
|
6632
6659
|
name: module.pkg,
|
|
6633
6660
|
registry,
|
|
@@ -6662,7 +6689,7 @@ function moduleVersionsHandler(ctx, shell, running, selfUpdate) {
|
|
|
6662
6689
|
...local ? {
|
|
6663
6690
|
local: true,
|
|
6664
6691
|
latestUnavailable: "local"
|
|
6665
|
-
} : latest !== void 0 ? {} : { latestUnavailable:
|
|
6692
|
+
} : latest !== void 0 ? {} : !fromRegistry ? { latestUnavailable: "not-registry" } : registry === void 0 ? { latestUnavailable: "no-registry" } : check ? { latestUnavailable: "probe-failed" } : {},
|
|
6666
6693
|
...refused === void 0 ? {} : { refused },
|
|
6667
6694
|
...spec === void 0 ? {} : { spec },
|
|
6668
6695
|
...registry === void 0 ? {} : { registry }
|
|
@@ -6681,6 +6708,7 @@ function moduleVersionsHandler(ctx, shell, running, selfUpdate) {
|
|
|
6681
6708
|
shell,
|
|
6682
6709
|
fallback,
|
|
6683
6710
|
force,
|
|
6711
|
+
check,
|
|
6684
6712
|
...running === void 0 ? {} : { running },
|
|
6685
6713
|
...followUp === void 0 ? {} : { followUp },
|
|
6686
6714
|
logger: ctx.logger
|
|
@@ -16643,7 +16671,7 @@ var INSTALLED_PLUGINS_ROUTE = "panels/plugins";
|
|
|
16643
16671
|
//#endregion
|
|
16644
16672
|
//#region src/modules/panels/model/plugin-section.ts
|
|
16645
16673
|
async function installedPlugins(options) {
|
|
16646
|
-
const { ledger, shell, force = false } = options;
|
|
16674
|
+
const { ledger, shell, force = false, check = true } = options;
|
|
16647
16675
|
const supply = options.supply ?? requireSupply();
|
|
16648
16676
|
const rows = [];
|
|
16649
16677
|
for (const entry of ledger.list()) {
|
|
@@ -16651,7 +16679,8 @@ async function installedPlugins(options) {
|
|
|
16651
16679
|
shell,
|
|
16652
16680
|
package: entry.package,
|
|
16653
16681
|
registry: entry.registry,
|
|
16654
|
-
force
|
|
16682
|
+
force,
|
|
16683
|
+
check
|
|
16655
16684
|
});
|
|
16656
16685
|
rows.push({
|
|
16657
16686
|
pkg: entry.package,
|
|
@@ -16676,7 +16705,8 @@ function pluginRoutes(options) {
|
|
|
16676
16705
|
ledger: options.ledger,
|
|
16677
16706
|
...options.shell === void 0 ? {} : { shell: options.shell },
|
|
16678
16707
|
...options.supply === void 0 ? {} : { supply: options.supply },
|
|
16679
|
-
force: param(search, "force") === "1"
|
|
16708
|
+
force: param(search, "force") === "1",
|
|
16709
|
+
check: param(search, "check") !== "0"
|
|
16680
16710
|
})
|
|
16681
16711
|
};
|
|
16682
16712
|
} };
|
|
@@ -2,6 +2,11 @@ import type { Translate } from '@dsh-workbench/shared';
|
|
|
2
2
|
import type { PreflightBridgeIssue, PreflightGuidance, PreflightSnapshot, PreflightStep } from '@dsh-workbench/shared/host';
|
|
3
3
|
import type { RuntimeProfile } from '@dsh-workbench/shared';
|
|
4
4
|
export declare function failedStepText(guidance: PreflightGuidance | undefined, t: Translate): string;
|
|
5
|
+
export interface GuidanceText {
|
|
6
|
+
readonly why: string;
|
|
7
|
+
readonly step: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function guidanceTextOf(guidance: PreflightGuidance | undefined, t: Translate): GuidanceText;
|
|
5
10
|
export declare function stepDetailText(step: PreflightStep, snapshot: PreflightSnapshot, t: Translate): string;
|
|
6
11
|
export declare function gateHintOf(snapshot: PreflightSnapshot, t: Translate): string;
|
|
7
12
|
export declare function showsRawDetails(snapshot: PreflightSnapshot): boolean;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { type ModuleVersionsView, type VersionsPart } from './use-module-versions';
|
|
1
|
+
import { type ModuleVersionsView, type VersionsPart, type VersionsScope } from './use-module-versions';
|
|
2
|
+
export interface MarketReloadOptions {
|
|
3
|
+
readonly force?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface MarketCheckOptions {
|
|
6
|
+
readonly force?: boolean;
|
|
7
|
+
readonly scope?: VersionsScope;
|
|
8
|
+
}
|
|
2
9
|
export interface MarketReload {
|
|
3
|
-
readonly reload: (options?:
|
|
4
|
-
|
|
5
|
-
}) => void;
|
|
10
|
+
readonly reload: (options?: MarketReloadOptions) => void;
|
|
11
|
+
readonly recheck: () => void;
|
|
6
12
|
readonly checkPart: (part: VersionsPart) => void;
|
|
7
13
|
}
|
|
8
14
|
export interface MarketReloadInput {
|
|
@@ -18,19 +18,19 @@ export interface ModuleVersionsState {
|
|
|
18
18
|
readonly modulesCheck: VersionsCheck;
|
|
19
19
|
readonly pluginsCheck: VersionsCheck;
|
|
20
20
|
}
|
|
21
|
-
export interface ModuleVersionsView extends ModuleVersionsState {
|
|
22
|
-
readonly checking: boolean;
|
|
23
|
-
reload(options?: {
|
|
24
|
-
readonly force?: boolean;
|
|
25
|
-
readonly fresh?: boolean;
|
|
26
|
-
readonly scope?: VersionsScope;
|
|
27
|
-
}): void;
|
|
28
|
-
}
|
|
29
21
|
export interface ModuleVersionsRead {
|
|
22
|
+
check?: boolean;
|
|
30
23
|
force?: boolean;
|
|
31
24
|
fresh?: boolean;
|
|
32
25
|
scope?: VersionsScope;
|
|
33
26
|
}
|
|
27
|
+
export interface InstalledReadOptions {
|
|
28
|
+
readonly fresh?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface ModuleVersionsView extends ModuleVersionsState {
|
|
31
|
+
readonly checking: boolean;
|
|
32
|
+
reload(options?: ModuleVersionsRead): void;
|
|
33
|
+
}
|
|
34
34
|
export declare function bumpModuleVersionsEpoch(): void;
|
|
35
35
|
export declare function moduleVersionsValue(): ModuleVersionsState;
|
|
36
36
|
export declare function resetModuleVersions(): void;
|
|
@@ -39,4 +39,5 @@ export declare function withMarketUpdates(modules: readonly ModuleVersion[], row
|
|
|
39
39
|
export declare function moduleVersionsCheckedAt(now: ModuleVersionsState): number | null;
|
|
40
40
|
export declare function moduleVersionsChecking(value: ModuleVersionsState): boolean;
|
|
41
41
|
export declare function runModuleVersionsRead(force?: boolean, fresh?: boolean, scope?: VersionsScope): Promise<void>;
|
|
42
|
+
export declare function runInstalledRead(options?: InstalledReadOptions): Promise<void>;
|
|
42
43
|
export declare function useModuleVersions(): ModuleVersionsView;
|
|
@@ -9,6 +9,7 @@ import type { MarketMock } from './market-mock';
|
|
|
9
9
|
import type { ModuleUpdateMap } from './market-rows';
|
|
10
10
|
import type { WorkbenchSelfUpdate, WorkbenchVersion } from '../../../kernel/contract/bundle-install';
|
|
11
11
|
import type { VersionsCheck, VersionsPart } from '../market/use-module-versions';
|
|
12
|
+
import type { MarketReloadOptions } from '../market/use-market-reload';
|
|
12
13
|
export interface MarketViewProps {
|
|
13
14
|
readonly t: Translate;
|
|
14
15
|
readonly titleOf: TitleResolve;
|
|
@@ -17,9 +18,7 @@ export interface MarketViewProps {
|
|
|
17
18
|
readonly capabilities: CapabilityMap | null;
|
|
18
19
|
readonly runtimePluginMarket?: boolean | undefined;
|
|
19
20
|
readonly freshness: MarketFreshness;
|
|
20
|
-
readonly onChanged: (options?:
|
|
21
|
-
readonly force?: boolean;
|
|
22
|
-
}) => void;
|
|
21
|
+
readonly onChanged: (options?: MarketReloadOptions) => void;
|
|
23
22
|
readonly onPending?: ((pending: boolean) => void) | undefined;
|
|
24
23
|
readonly updates?: ModuleUpdateMap | undefined;
|
|
25
24
|
readonly modulesCheck?: VersionsCheck | undefined;
|
|
@@ -2,6 +2,7 @@ import type { Translate, WriteOutcome } from '@dsh-workbench/shared';
|
|
|
2
2
|
import type { MarketFailure, MarketRow } from './market-row-types';
|
|
3
3
|
import { type MarketRowAction } from './market-rows';
|
|
4
4
|
import { type HeldRow, type Pending } from './market-view-text';
|
|
5
|
+
import type { MarketReloadOptions } from '../market/use-market-reload';
|
|
5
6
|
export interface MarketActSeats {
|
|
6
7
|
readonly setPending: (next: Pending | null) => void;
|
|
7
8
|
readonly setHeld: (next: HeldRow | undefined) => void;
|
|
@@ -15,8 +16,6 @@ export interface MarketActOptions {
|
|
|
15
16
|
readonly rowOf: (id: string) => MarketRow | undefined;
|
|
16
17
|
readonly seats: MarketActSeats;
|
|
17
18
|
readonly send: (body: Record<string, unknown>) => Promise<WriteOutcome<unknown>>;
|
|
18
|
-
readonly onChanged: (options?:
|
|
19
|
-
readonly force?: boolean;
|
|
20
|
-
}) => void;
|
|
19
|
+
readonly onChanged: (options?: MarketReloadOptions) => void;
|
|
21
20
|
}
|
|
22
21
|
export declare function marketActOf(options: MarketActOptions): (id: string, action: MarketRowAction) => Promise<void>;
|
|
@@ -6,6 +6,7 @@ export declare function installedPlugins(options: {
|
|
|
6
6
|
readonly ledger: PluginLedger;
|
|
7
7
|
readonly shell?: DshShell | undefined;
|
|
8
8
|
readonly force?: boolean;
|
|
9
|
+
readonly check?: boolean;
|
|
9
10
|
readonly supply?: SupplyPort | undefined;
|
|
10
11
|
}): Promise<readonly InstalledPlugin[]>;
|
|
11
12
|
export declare function pluginRoutes(options: {
|
|
@@ -3,5 +3,5 @@ import { type BundleInspectionPayload, type BundleRegistriesPayload, type Module
|
|
|
3
3
|
import { type InstalledPluginsPayload } from '../api/installed-plugins';
|
|
4
4
|
export declare function readBundleRegistries(): Promise<ApiResponse<BundleRegistriesPayload>>;
|
|
5
5
|
export declare function readBundleInspection(spec: string, registry?: string): Promise<ApiResponse<BundleInspectionPayload>>;
|
|
6
|
-
export declare function readModuleVersions(force?: boolean): Promise<ApiResponse<ModuleVersionsPayload>>;
|
|
7
|
-
export declare function readInstalledPlugins(force?: boolean): Promise<ApiResponse<InstalledPluginsPayload>>;
|
|
6
|
+
export declare function readModuleVersions(force?: boolean, check?: boolean): Promise<ApiResponse<ModuleVersionsPayload>>;
|
|
7
|
+
export declare function readInstalledPlugins(force?: boolean, check?: boolean): Promise<ApiResponse<InstalledPluginsPayload>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-workbench/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.13",
|
|
4
4
|
"description": "个人工作台:Agent 工作台(左栏 + 常驻对话 + 自研右侧数据面板)。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"icon": "./icon.svg",
|
|
@@ -100,8 +100,8 @@
|
|
|
100
100
|
"proper-lockfile": "^4.1.2",
|
|
101
101
|
"which": "^7.0.0",
|
|
102
102
|
"write-file-atomic": "^8.0.0",
|
|
103
|
-
"@dsh-workbench/shared": "1.1.
|
|
104
|
-
"@dsh-workbench/adapters-default": "1.1.
|
|
103
|
+
"@dsh-workbench/shared": "1.1.13",
|
|
104
|
+
"@dsh-workbench/adapters-default": "1.1.13"
|
|
105
105
|
},
|
|
106
106
|
"license": "MIT",
|
|
107
107
|
"repository": {
|