@dsh-workbench/core 1.1.14-beta.1 → 1.1.14

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.
Files changed (40) hide show
  1. package/README.md +1 -1
  2. package/bin/dsh-workbench +6 -52
  3. package/client.js +59 -16
  4. package/cordis.patch.yml +5 -6
  5. package/dist/client/client.body.js +59 -16
  6. package/dist/client/index.js +59 -16
  7. package/dist/host/index.js +1665 -623
  8. package/dist/types/app/layouts/env-gate/gate-text.d.ts +2 -3
  9. package/dist/types/app/units/manifests.d.ts +2 -0
  10. package/dist/types/kernel/host/mount-units.d.ts +2 -1
  11. package/dist/types/modules/panels/model/diy-browser-act.d.ts +3 -3
  12. package/dist/types/modules/panels/model/diy-browser-clip.d.ts +14 -0
  13. package/dist/types/modules/panels/model/diy-browser-tools.d.ts +1 -14
  14. package/dist/types/modules/panels/model/diy-browser.d.ts +6 -6
  15. package/dist/types/modules/panels/model/diy-page.d.ts +3 -2
  16. package/dist/types/modules/panels/model/diy-record-open.d.ts +2 -2
  17. package/dist/types/modules/panels/model/diy-record.d.ts +12 -11
  18. package/dist/types/modules/panels/model/market-discover.d.ts +2 -2
  19. package/dist/types/modules/panels/model/market-follow-up.d.ts +2 -1
  20. package/dist/types/modules/panels/model/market-route.d.ts +2 -3
  21. package/dist/types/modules/panels/model/market-update-bundle.d.ts +2 -3
  22. package/dist/types/modules/panels/model/market-workbench-update.d.ts +2 -2
  23. package/dist/types/modules/panels/model/market.d.ts +2 -2
  24. package/dist/types/modules/panels/model/plugin-actions.d.ts +2 -3
  25. package/dist/types/modules/panels/model/plugin-section.d.ts +3 -4
  26. package/dist/types/shared/api/host/bundle-routes.d.ts +3 -3
  27. package/dist/types/shared/api/host/diy-artifacts.d.ts +1 -2
  28. package/dist/types/shared/api/host/diy-components.d.ts +2 -2
  29. package/dist/types/shared/api/host/diy-release-staging.d.ts +6 -0
  30. package/dist/types/shared/api/host/diy.d.ts +1 -1
  31. package/dist/types/shared/api/host/git-exec.d.ts +1 -1
  32. package/dist/types/shared/api/host/git-process.d.ts +3 -0
  33. package/dist/types/shared/api/host/shipped-adapter-set.d.ts +4 -0
  34. package/dist/types/shared/api/host/workbench-seam.d.ts +3 -0
  35. package/package.json +3 -6
  36. package/scripts/seed-profile.sh +3 -3
  37. package/scripts/share-data-root.mjs +10 -13
  38. package/skills/workbench-module-diy/BUILD.md +38 -0
  39. package/skills/workbench-module-diy/SKILL.md +1 -0
  40. package/profile/sandbox.patch.yml +0 -28
@@ -3591,9 +3591,8 @@ var en = {
3591
3591
  "env.title": "Preparing the workbench",
3592
3592
  "env.checking": "Getting the runtime ready…",
3593
3593
  "env.installing": "Installing background tools — the first run takes a moment…",
3594
- "env.installingToolchain": "Installing the workbench’s own npm / pnpm — the first run downloads them, so it can take a while.",
3594
+ "env.installingToolchain": "Installing the workbench’s own pnpm — the first run downloads it, so it can take a while.",
3595
3595
  "env.failed": "One step away",
3596
- "env.elapsed": "Waiting {seconds}s",
3597
3596
  "env.stepFailed.install": "install failed",
3598
3597
  "env.stepFailed.path": "installed but not found",
3599
3598
  "env.stepFailed.shell": "cannot reach the command line",
@@ -3612,14 +3611,15 @@ var en = {
3612
3611
  "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.",
3613
3612
  "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.",
3614
3613
  "env.fix.step": "Run this in a terminal, then hit Retry:",
3614
+ "env.fix.stepRetry": "Hit Retry to try again; if it still fails you can enter the workbench anyway and restart it once the install succeeds.",
3615
3615
  "env.fix.stepPath": "Open a new terminal window (or make sure npm’s global bin directory is on PATH), then hit Retry.",
3616
3616
  "env.fix.stepShell": "Restart the workbench (or dsh); if it keeps happening, the workbench still cannot reach the command line.",
3617
3617
  "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.",
3618
3618
  "env.fix.permission": "Permission denied: rerun with sudo, or point npm’s global directory at your home.",
3619
3619
  "env.fix.network": "Network unreachable: check your network or proxy, then retry.",
3620
3620
  "env.fix.details": "Details (for troubleshooting)",
3621
- "env.log": "Detailed output",
3622
3621
  "env.retry": "Retry",
3622
+ "env.failed.continue": "Enter workbench anyway",
3623
3623
  "env.wake": "Open browser",
3624
3624
  "env.wake.opening": "Opening the browser…",
3625
3625
  "env.wake.browserOpen": "The browser is already running but the extension is not connected — check that it is enabled.",
@@ -4361,9 +4361,8 @@ var dictionaries = {
4361
4361
  "env.title": "准备工作台",
4362
4362
  "env.checking": "正在准备运行环境…",
4363
4363
  "env.installing": "正在安装后台工具,第一次会慢一点…",
4364
- "env.installingToolchain": "正在装工作台自己那份 npm / pnpm —— 第一次要下载,慢一点正常。",
4364
+ "env.installingToolchain": "正在装工作台自己那份 pnpm —— 第一次要下载,慢一点正常。",
4365
4365
  "env.failed": "还差一步就能用了",
4366
- "env.elapsed": "已等待 {seconds} 秒",
4367
4366
  "env.stepFailed.install": "装不上",
4368
4367
  "env.stepFailed.path": "装了但还找不到",
4369
4368
  "env.stepFailed.shell": "连不上命令行",
@@ -4382,14 +4381,15 @@ var dictionaries = {
4382
4381
  "env.fix.whyShell": "工作台拿不到这台机器的命令行,所以取不了数据 —— 这一步你装不了,需要有人处理后台环境。",
4383
4382
  "env.fix.whyHost": "工作台要靠命令行跑几条检查,再把结果收回来;这次命令发出去了,结果一直没回来。工具本身多半是好的 —— 重装 Node / npm / pnpm 不会有帮助。",
4384
4383
  "env.fix.step": "在终端里运行下面这条命令,装好之后点「重试」:",
4384
+ "env.fix.stepRetry": "点「重试」再装一次;还装不上也可以先进入工作台 —— 装好之后重启工作台就会用上。",
4385
4385
  "env.fix.stepPath": "新开一个终端窗口(或确认 npm 的全局 bin 目录在 PATH 里),然后点「重试」。",
4386
4386
  "env.fix.stepShell": "重启一次工作台(或 dsh);如果反复出现,说明工作台还是拿不到命令行。",
4387
4387
  "env.fix.stepHost": "完全退出工作台(托盘图标也要退),清掉系统临时目录里 dsh- 开头的残留,再重新打开;反复出现就升级 dsh。",
4388
4388
  "env.fix.permission": "权限不够:在命令前加 sudo 重跑,或先把 npm 的全局目录配到你的用户目录。",
4389
4389
  "env.fix.network": "网络不通:检查网络或代理设置后重试。",
4390
4390
  "env.fix.details": "详细输出(排障用)",
4391
- "env.log": "详细输出",
4392
4391
  "env.retry": "重试",
4392
+ "env.failed.continue": "先进入工作台",
4393
4393
  "env.wake": "打开浏览器",
4394
4394
  "env.wake.opening": "正在打开浏览器…",
4395
4395
  "env.wake.browserOpen": "浏览器已经开着,但扩展没连上 —— 检查扩展是否启用。",
@@ -13014,10 +13014,16 @@ function createClientUnitRegistry(options = {}) {
13014
13014
  }
13015
13015
  //#endregion
13016
13016
  //#region src/app/units/manifests.ts
13017
+ var DEFAULT_RETRY_DELAY_MS = 1e3;
13018
+ var DEFAULT_MAX_RETRIES = 30;
13017
13019
  function createUnitManifestLoader(options = {}) {
13018
13020
  let inFlight = false;
13019
13021
  let queued = false;
13020
13022
  let watching = false;
13023
+ let retries = 0;
13024
+ let timer = null;
13025
+ const retryDelayMs = options.retryDelayMs ?? DEFAULT_RETRY_DELAY_MS;
13026
+ const maxRetries = options.maxRetries ?? DEFAULT_MAX_RETRIES;
13021
13027
  const subscribeFacts = options.subscribeFacts ?? subscribeFactRevision;
13022
13028
  const load = async (registry) => {
13023
13029
  if (inFlight) {
@@ -13025,11 +13031,23 @@ function createUnitManifestLoader(options = {}) {
13025
13031
  return;
13026
13032
  }
13027
13033
  inFlight = true;
13034
+ let settled = false;
13028
13035
  try {
13029
13036
  const response = await apiGet(UNIT_MANIFESTS_ROUTE).catch(() => null);
13030
- if (response?.ok === true && Array.isArray(response.manifests)) registry.setManifests(response.manifests, Array.isArray(response.installable) ? response.installable : void 0);
13037
+ if (response?.ok === true && Array.isArray(response.manifests)) {
13038
+ registry.setManifests(response.manifests, Array.isArray(response.installable) ? response.installable : void 0);
13039
+ settled = !registry.refusals().some((item) => item.kind === "no-manifest");
13040
+ }
13031
13041
  } finally {
13032
13042
  inFlight = false;
13043
+ if (settled) retries = 0;
13044
+ else if (retries < maxRetries && timer === null) {
13045
+ retries += 1;
13046
+ timer = setTimeout(() => {
13047
+ timer = null;
13048
+ load(registry);
13049
+ }, retryDelayMs);
13050
+ }
13033
13051
  if (queued) {
13034
13052
  queued = false;
13035
13053
  load(registry);
@@ -13039,7 +13057,10 @@ function createUnitManifestLoader(options = {}) {
13039
13057
  return (registry) => {
13040
13058
  if (!watching) {
13041
13059
  watching = true;
13042
- subscribeFacts(factOfRoute(UNIT_MANIFESTS_ROUTE), () => void load(registry));
13060
+ subscribeFacts(factOfRoute(UNIT_MANIFESTS_ROUTE), () => {
13061
+ retries = 0;
13062
+ load(registry);
13063
+ });
13043
13064
  }
13044
13065
  load(registry);
13045
13066
  };
@@ -13084,7 +13105,7 @@ function failedStepText(guidance, t) {
13084
13105
  if (guidance === "host") return t("env.stepFailed.host");
13085
13106
  return t("env.stepFailed.install");
13086
13107
  }
13087
- function guidanceTextOf(guidance, t) {
13108
+ function guidanceTextOf(guidance, t, hasCommand = true) {
13088
13109
  if (guidance === "path") return {
13089
13110
  why: t("env.fix.whyPath"),
13090
13111
  step: t("env.fix.stepPath")
@@ -13099,7 +13120,7 @@ function guidanceTextOf(guidance, t) {
13099
13120
  };
13100
13121
  return {
13101
13122
  why: t("env.fix.why"),
13102
- step: t("env.fix.step")
13123
+ step: hasCommand ? t("env.fix.step") : t("env.fix.stepRetry")
13103
13124
  };
13104
13125
  }
13105
13126
  function stepDetailText(step, snapshot, t) {
@@ -13124,6 +13145,19 @@ function bridgeAdvice(issue, t, fixes) {
13124
13145
  };
13125
13146
  return { text: t("env.bridge.unknown") };
13126
13147
  }
13148
+ function bridgeAdviceLines(issues, t, fixes) {
13149
+ const listed = issues.length === 0 ? ["unknown"] : issues;
13150
+ const seen = /* @__PURE__ */ new Set();
13151
+ const out = [];
13152
+ for (const issue of listed) {
13153
+ const advice = bridgeAdvice(issue, t, fixes);
13154
+ const key = `${advice.text}|${advice.link?.href ?? ""}`;
13155
+ if (seen.has(key)) continue;
13156
+ seen.add(key);
13157
+ out.push(advice);
13158
+ }
13159
+ return out;
13160
+ }
13127
13161
  //#endregion
13128
13162
  //#region src/app/layouts/env-gate/gate-deadline.ts
13129
13163
  function createGateDeadline(giveUpMs, expire) {
@@ -13284,8 +13318,10 @@ function createBootGate(ctx, options = {}) {
13284
13318
  const buttons = el("div", BootGate_module_default.buttons);
13285
13319
  const retry = el("button", BootGate_module_default.button, t("env.retry"));
13286
13320
  retry.setAttribute("type", "button");
13321
+ const failedSkip = el("button", BootGate_module_default.button, t("env.failed.continue"));
13322
+ failedSkip.setAttribute("type", "button");
13287
13323
  const fixCommand = commandRow(t);
13288
- buttons.append(retry);
13324
+ buttons.append(retry, failedSkip);
13289
13325
  actions.append(fixTitle, fixWhy, fixStep, fixCommand.row, fixAdvice, buttons);
13290
13326
  const bridge = el("div", BootGate_module_default.bridge);
13291
13327
  bridge.hidden = true;
@@ -13329,6 +13365,8 @@ function createBootGate(ctx, options = {}) {
13329
13365
  let cancelled = false;
13330
13366
  const forcePlan = createForcePlan();
13331
13367
  let pinned = null;
13368
+ let lastSnapshot = null;
13369
+ let runtimeProfile;
13332
13370
  function close() {
13333
13371
  if (closed) return;
13334
13372
  closed = true;
@@ -13385,6 +13423,7 @@ function createBootGate(ctx, options = {}) {
13385
13423
  return row;
13386
13424
  }
13387
13425
  function render(snapshot) {
13426
+ lastSnapshot = snapshot;
13388
13427
  wakeNote.hidden = true;
13389
13428
  if (bootHintShown && (snapshot.phase !== "idle" || snapshot.steps.length > 0)) {
13390
13429
  bootHintShown = false;
@@ -13425,10 +13464,10 @@ function createBootGate(ctx, options = {}) {
13425
13464
  bridgeRetry.removeAttribute("disabled");
13426
13465
  const commandText = snapshot.steps.find((step) => step.status === "failed" && step.command !== void 0)?.command;
13427
13466
  const guidance = snapshot.guidance ?? "install";
13428
- const advice = guidanceTextOf(guidance, t);
13467
+ const showCommand = guidance === "install" && commandText !== void 0;
13468
+ const advice = guidanceTextOf(guidance, t, showCommand);
13429
13469
  fixWhy.textContent = advice.why;
13430
13470
  fixStep.textContent = advice.step;
13431
- const showCommand = guidance === "install" && commandText !== void 0;
13432
13471
  fixCommand.set(showCommand ? commandText : void 0);
13433
13472
  fixAdvice.textContent = !showCommand ? "" : snapshot.failure === "permission" ? t("env.fix.permission") : snapshot.failure === "network" ? t("env.fix.network") : "";
13434
13473
  const bridgeStep = snapshot.steps.find((step) => step.id === "bridge");
@@ -13436,9 +13475,7 @@ function createBootGate(ctx, options = {}) {
13436
13475
  const bridgeBroken = bridgeIssues.length > 0 || bridgeStep !== void 0 && (bridgeStep.status === "warn" || bridgeStep.status === "failed");
13437
13476
  bridge.hidden = !bridgeBroken;
13438
13477
  if (bridgeBroken) {
13439
- const listed = bridgeIssues.length === 0 ? ["unknown"] : bridgeIssues;
13440
- bridgeLines.replaceChildren(...listed.map((issue) => {
13441
- const advice = bridgeAdvice(issue, t, runtimeProfileValue()?.bridge);
13478
+ bridgeLines.replaceChildren(...bridgeAdviceLines(bridgeIssues, t, runtimeProfile?.bridge ?? runtimeProfileValue()?.bridge).map((advice) => {
13442
13479
  const item = el("li", BootGate_module_default.bridgeLine, advice.text);
13443
13480
  if (advice.link !== void 0) {
13444
13481
  const link = document.createElement("a");
@@ -13520,6 +13557,7 @@ function createBootGate(ctx, options = {}) {
13520
13557
  wakeNote.hidden = false;
13521
13558
  }
13522
13559
  retry.addEventListener("click", retryNow);
13560
+ failedSkip.addEventListener("click", close);
13523
13561
  bridgeWake.addEventListener("click", () => void wakeBrowserNow());
13524
13562
  bridgeRetry.addEventListener("click", retryNow);
13525
13563
  bridgeSkip.addEventListener("click", close);
@@ -13537,6 +13575,11 @@ function createBootGate(ctx, options = {}) {
13537
13575
  } });
13538
13576
  if (strip !== null) overlay.append(strip);
13539
13577
  }
13578
+ readRuntimeCapabilities().then((answer) => {
13579
+ runtimeProfile = answer.ok ? answer.runtimeProfile ?? void 0 : void 0;
13580
+ if (pinned !== null) render(pinned);
13581
+ else if (lastSnapshot !== null) render(lastSnapshot);
13582
+ }).catch(() => void 0);
13540
13583
  poll();
13541
13584
  return { close };
13542
13585
  }