@dsh-workbench/shared 0.1.2 → 0.1.3

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 (95) hide show
  1. package/dist/api/workbench-contract.d.ts +1 -1
  2. package/dist/components/ApprovalDetail.css +4 -0
  3. package/dist/components/ApprovalDetail.d.ts +1 -0
  4. package/dist/components/ApprovalDetail.js +5 -1
  5. package/dist/components/CardHead.css +92 -0
  6. package/dist/components/CardHead.d.ts +1 -0
  7. package/dist/components/CardHead.js +9 -7
  8. package/dist/components/ChoiceGroup.css +75 -0
  9. package/dist/components/ChoiceGroup.d.ts +1 -0
  10. package/dist/components/ChoiceGroup.js +1 -0
  11. package/dist/components/LongTaskRow.css +53 -0
  12. package/dist/components/LongTaskRow.d.ts +3 -0
  13. package/dist/components/LongTaskRow.js +11 -11
  14. package/dist/components/MockStrip.css +39 -0
  15. package/dist/components/MockStrip.d.ts +1 -0
  16. package/dist/components/MockStrip.js +1 -0
  17. package/dist/components/ResourceStates.css +111 -0
  18. package/dist/components/ResourceStates.d.ts +2 -1
  19. package/dist/components/ResourceStates.js +1 -0
  20. package/dist/components/SaveBar.css +7 -0
  21. package/dist/components/SaveBar.d.ts +1 -0
  22. package/dist/components/SaveBar.js +4 -2
  23. package/dist/components/TextField.css +22 -0
  24. package/dist/components/TextField.d.ts +6 -0
  25. package/dist/components/TextField.js +5 -0
  26. package/dist/components/icons.d.ts +0 -12
  27. package/dist/components/icons.js +0 -61
  28. package/dist/host/http.js +5 -29
  29. package/dist/host/provision.d.ts +18 -1
  30. package/dist/host/provision.js +73 -0
  31. package/dist/host.d.ts +6 -0
  32. package/dist/host.js +6 -0
  33. package/dist/i18n/en.js +126 -1
  34. package/dist/i18n/index.d.ts +129 -4
  35. package/dist/i18n/zh.d.ts +128 -3
  36. package/dist/i18n/zh.js +128 -3
  37. package/dist/index.d.ts +1 -1
  38. package/dist/index.js +1 -1
  39. package/package.json +5 -3
  40. package/src/api/workbench-contract.ts +5 -1
  41. package/src/components/ApprovalDetail.css +4 -0
  42. package/src/components/ApprovalDetail.tsx +11 -1
  43. package/src/components/CardHead.css +92 -0
  44. package/src/components/CardHead.tsx +43 -31
  45. package/src/components/ChoiceGroup.css +75 -0
  46. package/src/components/ChoiceGroup.tsx +1 -0
  47. package/src/components/LongTaskRow.css +53 -0
  48. package/src/components/LongTaskRow.tsx +52 -13
  49. package/src/components/MockStrip.css +39 -0
  50. package/src/components/MockStrip.tsx +1 -0
  51. package/src/components/ResourceStates.css +111 -0
  52. package/src/components/ResourceStates.tsx +2 -1
  53. package/src/components/SaveBar.css +7 -0
  54. package/src/components/SaveBar.tsx +8 -5
  55. package/src/components/TextField.css +22 -0
  56. package/src/components/TextField.tsx +17 -0
  57. package/src/components/icons.tsx +0 -164
  58. package/src/host/__tests__/provision.test.ts +90 -0
  59. package/src/host/http.ts +5 -33
  60. package/src/host/provision.ts +87 -0
  61. package/src/host.ts +6 -0
  62. package/src/i18n/en.ts +127 -1
  63. package/src/i18n/zh.ts +128 -4
  64. package/src/index.ts +1 -1
  65. package/dist/components/StateDot.d.ts +0 -5
  66. package/dist/components/StateDot.js +0 -10
  67. package/dist/host/__tests__/fakes.d.ts +0 -41
  68. package/dist/host/__tests__/fakes.js +0 -76
  69. package/dist/host/__tests__/preflight-fixtures.d.ts +0 -19
  70. package/dist/host/__tests__/preflight-fixtures.js +0 -47
  71. package/dist/host/context-inject.d.ts +0 -24
  72. package/dist/host/context-inject.js +0 -74
  73. package/dist/host/events.d.ts +0 -9
  74. package/dist/host/events.js +0 -70
  75. package/dist/host/mount-units.d.ts +0 -52
  76. package/dist/host/mount-units.js +0 -186
  77. package/dist/host/preflight.d.ts +0 -58
  78. package/dist/host/preflight.js +0 -233
  79. package/dist/host/probe-cache.d.ts +0 -6
  80. package/dist/host/probe-cache.js +0 -19
  81. package/dist/host/probe-libs.d.ts +0 -45
  82. package/dist/host/probe-libs.js +0 -61
  83. package/dist/host/probe-units.d.ts +0 -17
  84. package/dist/host/probe-units.js +0 -102
  85. package/dist/host/probe-verdict.d.ts +0 -7
  86. package/dist/host/probe-verdict.js +0 -143
  87. package/dist/host/tool-scope.d.ts +0 -32
  88. package/dist/host/tool-scope.js +0 -84
  89. package/dist/host/unit-readiness.d.ts +0 -7
  90. package/dist/host/unit-readiness.js +0 -5
  91. package/dist/host/unit-registry.d.ts +0 -9
  92. package/dist/host/unit-registry.js +0 -33
  93. package/dist/host/version-range.d.ts +0 -2
  94. package/dist/host/version-range.js +0 -73
  95. package/src/components/StateDot.tsx +0 -31
@@ -2,67 +2,6 @@ import { h } from '../lib/react.js';
2
2
  function Shell({ size, strokeWidth = 1, viewBox = '0 0 16 16', children, }) {
3
3
  return (h("svg", { width: size, height: size, viewBox: viewBox, fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", strokeWidth: strokeWidth, style: { display: 'block' } }, children));
4
4
  }
5
- export function IconPanelLeft({ size = 16 }) {
6
- return (h(Shell, { size: size },
7
- h("path", { d: "M13.5 1.5H2.5C1.94772 1.5 1.5 1.94772 1.5 2.5V13.5C1.5 14.0523 1.94772 14.5 2.5 14.5H13.5C14.0523 14.5 14.5 14.0523 14.5 13.5V2.5C14.5 1.94772 14.0523 1.5 13.5 1.5Z", stroke: "currentColor" }),
8
- h("path", { d: "M5.5 1.5V14.5", stroke: "currentColor" })));
9
- }
10
- export function IconFolder({ size = 16 }) {
11
- return (h(Shell, { size: size },
12
- h("path", { d: "M1.50439 3.11059C1.50439 2.55831 1.95211 2.1106 2.50439 2.1106H5.43389C5.67773 2.1106 5.91318 2.19969 6.09593 2.36113L7.71649 3.79265C7.89924 3.95409 8.1347 4.04319 8.3785 4.04319H13.4958C14.0481 4.04319 14.4958 4.4909 14.4958 5.04319V12.8894C14.4958 13.4417 14.0481 13.8894 13.4958 13.8894H2.50439C1.95211 13.8894 1.50439 13.4417 1.50439 12.8894V4.04319V3.11059Z", stroke: "currentColor" }),
13
- h("path", { d: "M3.63501 7.66614H12.3647", stroke: "currentColor" })));
14
- }
15
- export function IconFolderOpen({ size = 16 }) {
16
- return (h(Shell, { size: size },
17
- h("path", { d: "M2.55912 7.93683C2.67584 7.49906 3.0723 7.19446 3.52536 7.19446H13.6491C14.3061 7.19446 14.7846 7.81725 14.6153 8.45209L13.4411 12.856C13.3244 13.2938 12.9279 13.5984 12.4748 13.5984H2.35113C1.69411 13.5984 1.21562 12.9756 1.38489 12.3407L2.55912 7.93683Z", fill: "currentColor", opacity: 0.16 }),
18
- h("path", { d: "M13.6491 6.69446C14.6346 6.69453 15.3522 7.62895 15.0983 8.58118L13.9245 12.9845C13.7494 13.6412 13.1539 14.0988 12.4743 14.0988H2.35126C1.36574 14.0988 0.648153 13.1643 0.902044 12.212L2.07587 7.80774C2.25102 7.15128 2.84567 6.69455 3.52509 6.69446H13.6491ZM3.52509 7.69446C3.29865 7.69455 3.10004 7.84674 3.04169 8.06555L1.86786 12.4698C1.78345 12.7872 2.02285 13.0988 2.35126 13.0988H12.4743C12.7007 13.0988 12.8992 12.9463 12.9577 12.7277L14.1325 8.32336C14.2171 8.00598 13.9776 7.69453 13.6491 7.69446H3.52509Z", fill: "currentColor" }),
19
- h("path", { d: "M4.7666 1.90137C5.13227 1.90144 5.48571 2.03525 5.75977 2.27734L7.27246 3.61328C7.36379 3.69382 7.48174 3.73828 7.60352 3.73828H12.3994C13.2276 3.73841 13.8993 4.41005 13.8994 5.23828V6.7168C13.8183 6.70327 13.735 6.69436 13.6494 6.69434H12.8994V5.23828C12.8993 4.96233 12.6754 4.73841 12.3994 4.73828H7.60352C7.23781 4.73828 6.88446 4.60438 6.61035 4.3623L5.09766 3.02637C5.00636 2.94576 4.88838 2.90144 4.7666 2.90137H2.0498C1.77366 2.90137 1.5498 3.12523 1.5498 3.40137V9.78223L0.902344 12.2119C0.648452 13.1642 1.36604 14.0986 2.35156 14.0986H2.0498C1.2214 14.0986 0.549838 13.427 0.549805 12.5986V3.40137C0.549805 2.57294 1.22138 1.90137 2.0498 1.90137H4.7666Z", fill: "currentColor" })));
20
- }
21
- export function IconChevronDown({ size = 14 }) {
22
- return (h(Shell, { size: size },
23
- h("path", { d: "M4 6L7.29289 9.29289C7.68342 9.68342 8.31658 9.68342 8.70711 9.29289L12 6", stroke: "currentColor" })));
24
- }
25
- export function IconPlus({ size = 16 }) {
26
- return (h(Shell, { size: size },
27
- h("path", { d: "M8 2V14", stroke: "currentColor" }),
28
- h("path", { d: "M2 8H14", stroke: "currentColor" })));
29
- }
30
- export function IconEllipsis({ size = 16 }) {
31
- return (h(Shell, { size: size },
32
- h("path", { d: "M3 9C3.55228 9 4 8.55228 4 8C4 7.44772 3.55228 7 3 7C2.44772 7 2 7.44772 2 8C2 8.55228 2.44772 9 3 9Z", fill: "currentColor" }),
33
- h("path", { d: "M8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9Z", fill: "currentColor" }),
34
- h("path", { d: "M13 9C13.5523 9 14 8.55228 14 8C14 7.44772 13.5523 7 13 7C12.4477 7 12 7.44772 12 8C12 8.55228 12.4477 9 13 9Z", fill: "currentColor" })));
35
- }
36
- export function IconSettings({ size = 16 }) {
37
- return (h(Shell, { size: size },
38
- h("path", { d: "M8 9.75012C8.9665 9.75012 9.75 8.96662 9.75 8.00012C9.75 7.03362 8.9665 6.25012 8 6.25012C7.0335 6.25012 6.25 7.03362 6.25 8.00012C6.25 8.96662 7.0335 9.75012 8 9.75012Z", stroke: "currentColor" }),
39
- h("path", { d: "M13.0107 7.79377C12.9505 7.89401 12.9205 7.94413 12.9205 7.99951C12.9205 8.0549 12.9505 8.10502 13.0106 8.20528L13.9849 9.83006C14.045 9.93029 14.0751 9.9804 14.0751 10.0358C14.0751 10.0911 14.045 10.1413 13.9849 10.2415L13.0037 11.8777C12.9468 11.9726 12.9184 12.0201 12.8725 12.0461C12.8267 12.072 12.7713 12.072 12.6607 12.072H10.6704C10.5598 12.072 10.5045 12.072 10.4586 12.098C10.4128 12.1239 10.3843 12.1714 10.3274 12.2662L9.33825 13.9142C9.28133 14.009 9.25287 14.0564 9.20703 14.0823C9.16118 14.1083 9.10588 14.1083 8.99529 14.1083H7.00486C6.89426 14.1083 6.83896 14.1083 6.79312 14.0823C6.74727 14.0564 6.71881 14.009 6.6619 13.9142L5.67273 12.2662C5.61581 12.1714 5.58735 12.1239 5.54151 12.098C5.49566 12.072 5.44036 12.072 5.32977 12.072H3.33945C3.2288 12.072 3.17347 12.072 3.12761 12.0461C3.08176 12.0201 3.0533 11.9726 2.9964 11.8777L2.0152 10.2415C1.9551 10.1413 1.92505 10.0911 1.92505 10.0358C1.92505 9.9804 1.9551 9.93029 2.0152 9.83006L2.98951 8.20528C3.04963 8.10502 3.07969 8.0549 3.07969 7.99951C3.07968 7.94413 3.04961 7.89401 2.98946 7.79377L2.01529 6.17011C1.95514 6.06987 1.92507 6.01975 1.92507 5.96437C1.92506 5.90899 1.95512 5.85886 2.01524 5.7586L2.9964 4.1224C3.0533 4.0275 3.08176 3.98005 3.12761 3.95408C3.17347 3.92811 3.2288 3.92811 3.33945 3.92811H5.32977C5.44036 3.92811 5.49566 3.92811 5.54151 3.90216C5.58735 3.87621 5.61581 3.82879 5.67273 3.73397L6.6619 2.08599C6.71881 1.99116 6.74727 1.94375 6.79312 1.9178C6.83896 1.89185 6.89426 1.89185 7.00486 1.89185H8.99529C9.10588 1.89185 9.16118 1.89185 9.20703 1.9178C9.25287 1.94375 9.28133 1.99116 9.33825 2.08599L10.3274 3.73397C10.3843 3.82879 10.4128 3.87621 10.4586 3.90216C10.5045 3.92811 10.5598 3.92811 10.6704 3.92811H12.6607C12.7713 3.92811 12.8267 3.92811 12.8725 3.95408C12.9184 3.98005 12.9468 4.0275 13.0037 4.1224L13.9849 5.7586C14.045 5.85886 14.0751 5.90899 14.0751 5.96437C14.0751 6.01975 14.045 6.06987 13.9849 6.17011L13.0107 7.79377Z", stroke: "currentColor", strokeMiterlimit: 10 })));
40
- }
41
- export function IconPin({ size = 16 }) {
42
- return (h(Shell, { size: size },
43
- h("path", { d: "M9.96976 1.70572L13.1554 3.93629L10.9019 8.12317L11.5158 11.605L10.7192 12.7427L2.52767 7.00693L3.3243 5.86922L6.80612 5.25528L9.96976 1.70572Z", fill: "currentColor", stroke: "currentColor", strokeLinejoin: "round" }),
44
- h("path", { d: "M6.05285 9.47511C6.27284 9.16094 6.70586 9.08458 7.02003 9.30457C7.3342 9.52455 7.41055 9.95757 7.19057 10.2717L3.98587 14.4708L3.21223 13.9291L6.05285 9.47511Z", fill: "currentColor" })));
45
- }
46
- export function IconCheck({ size = 16 }) {
47
- return (h(Shell, { size: size },
48
- h("path", { d: "M2.25 8.5L5.49732 11.7473C5.90519 12.1552 6.57263 12.1344 6.95426 11.7018L13.75 4", stroke: "currentColor" })));
49
- }
50
- export function IconNewChat({ size = 14 }) {
51
- return (h(Shell, { size: size, strokeWidth: 1.3 },
52
- h("path", { d: "M2.37091 11.2501C1.58745 9.89288 1.32067 8.29835 1.61969 6.76006C1.91872 5.22177 2.76342 3.8433 3.99826 2.87846C5.2331 1.91362 6.77494 1.42737 8.33988 1.50925C9.90482 1.59113 11.3875 2.23562 12.5149 3.32406C13.6425 4.41269 14.3387 5.87206 14.4754 7.4334C14.612 8.99474 14.18 10.5529 13.2587 11.8209C12.3375 13.0888 10.9891 13.9813 9.46194 14.3337C8.18691 14.628 6.85895 14.5294 5.64989 14.0605C5.1712 13.8748 4.76962 13.4932 4.26534 13.3967C3.67413 13.2835 2.95257 13.5598 2.03794 14.3337", stroke: "currentColor" }),
53
- h("path", { d: "M8 5V11", stroke: "currentColor" }),
54
- h("path", { d: "M5 8H11", stroke: "currentColor" })));
55
- }
56
- export function IconRefresh({ size = 16 }) {
57
- return (h(Shell, { size: size },
58
- h("path", { d: "M14.5001 8C14.5 9.28552 14.1188 10.5422 13.4045 11.611C12.6903 12.6799 11.6752 13.5129 10.4875 14.0049C9.29982 14.4968 7.99295 14.6255 6.73212 14.3747C5.4713 14.124 4.31314 13.505 3.4041 12.596C2.49514 11.687 1.87614 10.5288 1.62537 9.26798C1.37459 8.00716 1.50331 6.70028 1.99525 5.51261C2.48719 4.32494 3.32025 3.30981 4.3891 2.59557C5.45795 1.88134 6.71458 1.50008 8.0001 1.5C9.9001 1.5 11.7001 2.3 13.0001 3.6L14.5001 5.1", stroke: "currentColor" }),
59
- h("path", { d: "M14.4999 1.5V5.1H10.8999", stroke: "currentColor" })));
60
- }
61
- export function IconRightUp({ size = 14 }) {
62
- return (h(Shell, { size: size },
63
- h("path", { d: "M11.7256 2.77441C12.5538 2.77469 13.2256 3.44616 13.2256 4.27441V10.1416H12.2256V4.27441C12.2256 3.99844 12.0015 3.77469 11.7256 3.77441H5.7207V2.77441H11.7256Z", fill: "currentColor" }),
64
- h("path", { d: "M2.77441 13.2255L12.3756 3.62427", stroke: "currentColor" })));
65
- }
66
5
  export function IconConversation({ size = 16 }) {
67
6
  return (h(Shell, { size: size, strokeWidth: 1.3 },
68
7
  h("path", { d: "M2.5 7.2c0-2.3 2.1-4.2 4.8-4.2h1.4c2.7 0 4.8 1.9 4.8 4.2s-2.1 4.2-4.8 4.2H7.5l-3.2 2v-2.3c-1.1-.8-1.8-2-1.8-3.9Z", stroke: "currentColor", strokeLinejoin: "round" })));
package/dist/host/http.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { unitFactScope } from '../api/facts.js';
2
2
  import { ACTIONS_PREFIX, API_PREFIX, PLUGIN_ID, PREFS_PREFIX, PROVISION_PREFIX } from '../config/constants.js';
3
- import { isDependencyAction, PROVISION_ACTIONS, } from './provision.js';
3
+ import { parseProvisionBody, } from './provision.js';
4
4
  import { WorkbenchDataError } from '../host/opencli.js';
5
5
  import { writeResultForClient } from './write-result.js';
6
6
  const MAX_PREFS_BODY_BYTES = 8 * 1024;
@@ -93,36 +93,12 @@ export function registerProvision(ctx, provision, log) {
93
93
  sendJson(res, 400, { ok: false, error: { code: 'bad-json', message: String(error) } });
94
94
  return;
95
95
  }
96
- const body = typeof payload === 'object' && payload !== null
97
- ? payload
98
- : {};
99
- const action = body.action;
100
- if (typeof action !== 'string' || !PROVISION_ACTIONS.includes(action)) {
101
- sendJson(res, 400, {
102
- ok: false,
103
- error: {
104
- code: 'workbench/bad-action',
105
- message: `不认识的 action:${String(action)}(可用:${PROVISION_ACTIONS.join(' / ')})`,
106
- },
107
- });
96
+ const parsed = parseProvisionBody(payload);
97
+ if (!parsed.ok) {
98
+ sendJson(res, 400, { ok: false, error: { code: parsed.code, message: parsed.message } });
108
99
  return;
109
100
  }
110
- const wanted = action;
111
- const target = isDependencyAction(wanted) ? body.id : body.unit;
112
- if (typeof target !== 'string' || target.trim() === '') {
113
- sendJson(res, 400, {
114
- ok: false,
115
- error: {
116
- code: isDependencyAction(wanted) ? 'workbench/no-id' : 'workbench/no-unit',
117
- message: isDependencyAction(wanted) ? '缺少 id' : '缺少 unit',
118
- },
119
- });
120
- return;
121
- }
122
- const key = target.trim();
123
- const request = isDependencyAction(wanted)
124
- ? { action: wanted, id: key }
125
- : { action: wanted, unit: key };
101
+ const request = parsed.request;
126
102
  try {
127
103
  const result = await provision.handle(request);
128
104
  log?.bump(provisionFacts(provision, request));
@@ -1,14 +1,31 @@
1
1
  import type { ProvisionAction } from '../api/workbench-contract.js';
2
2
  export type { ProvisionAction };
3
- export declare const PROVISION_ACTIONS: readonly ["install", "update", "uninstall", "update-dependency"];
3
+ export declare const PROVISION_ACTIONS: readonly ["install", "update", "uninstall", "install-bundle", "update-bundle", "remove-bundle", "cancel-install", "update-dependency"];
4
4
  export declare const DEPENDENCY_ACTIONS: readonly ["update-dependency"];
5
5
  export declare function isDependencyAction(action: ProvisionAction): action is (typeof DEPENDENCY_ACTIONS)[number];
6
+ export type ProvisionTarget = 'unit' | 'id' | 'spec' | 'name' | 'requestId';
7
+ export declare function provisionTargetOf(action: ProvisionAction): ProvisionTarget;
6
8
  export interface ProvisionRequest {
7
9
  readonly action: ProvisionAction;
8
10
  readonly unit?: string;
9
11
  readonly id?: string;
12
+ readonly spec?: string;
13
+ readonly name?: string;
14
+ readonly requestId?: string;
15
+ readonly registry?: string;
16
+ readonly approvedBuilds?: readonly string[];
10
17
  }
11
18
  export interface ProvisionHandler {
12
19
  handle(request: ProvisionRequest): Promise<unknown> | unknown;
13
20
  affectedUnits?(request: ProvisionRequest): readonly string[];
14
21
  }
22
+ export interface ProvisionRejected {
23
+ readonly ok: false;
24
+ readonly code: string;
25
+ readonly message: string;
26
+ }
27
+ export type ProvisionParsed = {
28
+ readonly ok: true;
29
+ readonly request: ProvisionRequest;
30
+ } | ProvisionRejected;
31
+ export declare function parseProvisionBody(body: unknown): ProvisionParsed;
@@ -2,6 +2,10 @@ export const PROVISION_ACTIONS = [
2
2
  'install',
3
3
  'update',
4
4
  'uninstall',
5
+ 'install-bundle',
6
+ 'update-bundle',
7
+ 'remove-bundle',
8
+ 'cancel-install',
5
9
  'update-dependency',
6
10
  ];
7
11
  export const DEPENDENCY_ACTIONS = ['update-dependency'];
@@ -10,3 +14,72 @@ export function isDependencyAction(action) {
10
14
  }
11
15
  const ALL_ACTIONS_COVERED = true;
12
16
  void ALL_ACTIONS_COVERED;
17
+ export function provisionTargetOf(action) {
18
+ if (action === 'update-dependency')
19
+ return 'id';
20
+ if (action === 'install-bundle')
21
+ return 'spec';
22
+ if (action === 'remove-bundle')
23
+ return 'name';
24
+ if (action === 'cancel-install')
25
+ return 'requestId';
26
+ return 'unit';
27
+ }
28
+ const TARGET_CODE = {
29
+ unit: 'workbench/no-unit',
30
+ id: 'workbench/no-id',
31
+ spec: 'workbench/no-spec',
32
+ name: 'workbench/no-name',
33
+ requestId: 'workbench/no-request-id',
34
+ };
35
+ function asRecord(value) {
36
+ return typeof value === 'object' && value !== null ? value : {};
37
+ }
38
+ function stringsOf(value) {
39
+ if (!Array.isArray(value))
40
+ return undefined;
41
+ const items = value.filter((item) => typeof item === 'string' && item.trim() !== '');
42
+ return items.length === 0 ? undefined : items;
43
+ }
44
+ function requestOf(action, value) {
45
+ if (action === 'update-dependency')
46
+ return { action, id: value };
47
+ if (action === 'install-bundle')
48
+ return { action, spec: value };
49
+ if (action === 'remove-bundle')
50
+ return { action, name: value };
51
+ if (action === 'cancel-install')
52
+ return { action, requestId: value };
53
+ return { action, unit: value };
54
+ }
55
+ export function parseProvisionBody(body) {
56
+ const raw = asRecord(body);
57
+ const action = raw.action;
58
+ if (typeof action !== 'string' || !PROVISION_ACTIONS.includes(action)) {
59
+ return {
60
+ ok: false,
61
+ code: 'workbench/bad-action',
62
+ message: `不认识的 action:${String(action)}(可用:${PROVISION_ACTIONS.join(' / ')})`,
63
+ };
64
+ }
65
+ const wanted = action;
66
+ const target = provisionTargetOf(wanted);
67
+ const value = raw[target];
68
+ if (typeof value !== 'string' || value.trim() === '') {
69
+ return { ok: false, code: TARGET_CODE[target], message: `缺少 ${target}` };
70
+ }
71
+ if (wanted !== 'install-bundle')
72
+ return { ok: true, request: requestOf(wanted, value.trim()) };
73
+ const registry = typeof raw.registry === 'string' && raw.registry.trim() !== '' ? raw.registry.trim() : undefined;
74
+ const approvedBuilds = stringsOf(raw.approvedBuilds);
75
+ const requestId = typeof raw.requestId === 'string' && raw.requestId.trim() !== '' ? raw.requestId.trim() : undefined;
76
+ return {
77
+ ok: true,
78
+ request: {
79
+ ...requestOf(wanted, value.trim()),
80
+ ...(registry === undefined ? {} : { registry }),
81
+ ...(approvedBuilds === undefined ? {} : { approvedBuilds }),
82
+ ...(requestId === undefined ? {} : { requestId }),
83
+ },
84
+ };
85
+ }
package/dist/host.d.ts CHANGED
@@ -1,3 +1,9 @@
1
+ export * from './config/constants.js';
2
+ export * from './api/context-ref.js';
3
+ export * from './api/unit.js';
4
+ export * from './api/facts.js';
5
+ export * from './api/long-task.js';
6
+ export * from './lib/text.js';
1
7
  export * from './host/cli-error.js';
2
8
  export * from './host/data-root.js';
3
9
  export * from './host/facts.js';
package/dist/host.js CHANGED
@@ -1,3 +1,9 @@
1
+ export * from './config/constants.js';
2
+ export * from './api/context-ref.js';
3
+ export * from './api/unit.js';
4
+ export * from './api/facts.js';
5
+ export * from './api/long-task.js';
6
+ export * from './lib/text.js';
1
7
  export * from './host/cli-error.js';
2
8
  export * from './host/data-root.js';
3
9
  export * from './host/facts.js';
package/dist/i18n/en.js CHANGED
@@ -63,11 +63,13 @@ export const en = {
63
63
  'panels.market.install': 'Install',
64
64
  'panels.market.update': 'Update',
65
65
  'panels.market.uninstall': 'Uninstall',
66
+ 'panels.market.uninstallLabel': 'Uninstall {name}',
66
67
  'panels.market.installing': 'Installing…',
67
68
  'panels.market.updating': 'Updating…',
68
69
  'panels.market.uninstalling': 'Uninstalling…',
69
- 'panels.market.confirmUninstall': 'Uninstall?',
70
+ 'panels.market.confirmUninstallTitle': 'Uninstall "{name}"?',
70
71
  'panels.market.confirmUninstallDetail': 'It will be gone from this machine, and removed from every project panel (bindings and settings are kept).',
72
+ 'panels.market.confirmUninstallAck': 'I understand: using it again means reinstalling it.',
71
73
  'panels.market.confirmYes': 'Uninstall',
72
74
  'panels.market.confirmNo': 'Cancel',
73
75
  'panels.market.failed': 'Failed: {reason}',
@@ -75,6 +77,9 @@ export const en = {
75
77
  'panels.market.noSource': 'This module declares no install method — install it yourself',
76
78
  'panels.market.badSource': 'The install method is incomplete — install it yourself',
77
79
  'panels.market.empty': 'No modules available',
80
+ 'panels.market.installedSection': 'Installed',
81
+ 'panels.market.moduleUpdate': 'Version {version} is out: it may need a restart after installing.',
82
+ 'panels.market.restartNeeded': 'The new version is installed — restart once to pick it up.',
78
83
  'panels.market.foot': 'After installing, enable it in the panel page of that project.',
79
84
  'panels.market.recheck': 'Check for updates',
80
85
  'panels.market.checkUpdates': 'Check for updates',
@@ -82,6 +87,126 @@ export const en = {
82
87
  'panels.market.justNow': 'just now',
83
88
  'panels.market.minutesAgo': '{n} min ago',
84
89
  'panels.market.hoursAgo': '{n} h ago',
90
+ 'panels.market.add.description': 'Enter a package name, a Git URL, or a path to a local directory.',
91
+ 'panels.market.add.specPlaceholder': 'e.g. @dsh-workbench/module-hello',
92
+ 'panels.market.add.guideToggle': 'Install guide and examples',
93
+ 'panels.market.add.guideHide': 'Hide guide',
94
+ 'panels.market.add.guideIdTitle': 'Package name',
95
+ 'panels.market.add.guideIdExample': '@dsh-workbench/module-hello',
96
+ 'panels.market.add.guideIdHint': 'The module package name is its npm name (like dsh-workbench-module-xxx or @author/module) — whatever follows dsh plugin add or pnpm add in the README of a community module.',
97
+ 'panels.market.add.guideGitTitle': 'Git URL',
98
+ 'panels.market.add.guideGitExample': 'https://github.com/author/dsh-workbench-module-x',
99
+ 'panels.market.add.guideGitHint': 'The public repository of the module on GitHub; other Git hosts work too.',
100
+ 'panels.market.add.guidePathTitle': 'Local module directory',
101
+ 'panels.market.add.guidePathExample': '/Users/name/my-workbench-module',
102
+ 'panels.market.add.guidePathHint': 'Absolute path to the module directory on this machine, for modules you develop or have already downloaded.',
103
+ 'panels.market.add.guideExampleLabel': 'Example:',
104
+ 'panels.market.add.guideFill': 'Fill in',
105
+ 'panels.market.add.guideSafety': 'Make sure you trust the source. Modules run on this machine with your permissions; an unknown module can damage the workbench or read and leak your data.',
106
+ 'panels.market.add.registryLegend': 'Which npm registry to download from',
107
+ 'panels.market.add.registryOfficial': 'npm registry',
108
+ 'panels.market.add.registryMirror': 'China mirror',
109
+ 'panels.market.add.registryWithHost': '{name} ({host})',
110
+ 'panels.market.add.registryToggle': 'Source',
111
+ 'panels.market.add.installVersion': 'Version {version}',
112
+ 'panels.market.add.registryDefault': 'Default source',
113
+ 'panels.market.add.registryCustom': 'Custom address',
114
+ 'panels.market.add.registryCustomPlaceholder': 'https://npm.example.com/',
115
+ 'panels.market.add.registryCustomHint': 'A corporate or private npm registry; for one that needs auth, put the credentials in ~/.npmrc on this machine',
116
+ 'panels.market.add.registryCustomInvalid': 'Enter an address starting with http:// or https://',
117
+ 'panels.market.add.run': 'Install',
118
+ 'panels.market.add.edit': 'Edit',
119
+ 'panels.market.add.changeRegistry': 'Change source',
120
+ 'panels.market.add.installingTitle': 'Installing the module…',
121
+ 'panels.market.add.installedTitle': 'Installed',
122
+ 'panels.market.add.failedTitle': 'Module install failed',
123
+ 'panels.market.add.cancelledTitle': 'Cancelled',
124
+ 'panels.market.add.failureNetworkHost': 'Cannot reach {host}. Git URLs and .tgz links bypass the registry, so this machine needs direct access or a proxy; if the module is also on npm, use its package name instead.',
125
+ 'panels.market.add.problemInvalid': 'Cannot read this package name or address: {reason}',
126
+ 'panels.market.add.problemInstalled': 'This module is already installed',
127
+ 'panels.market.add.problemNotFound': 'No such module found',
128
+ 'panels.market.add.problemNotPackage': 'That path does not exist or is not a valid module package',
129
+ 'panels.market.add.problemNotBundle': 'This package declares no bundle, so it cannot be installed as a module: {reason}',
130
+ 'panels.market.add.problemNetwork': 'Cannot reach the module source; check the network and retry',
131
+ 'panels.market.add.problemUnknown': 'Cannot fetch module information: {reason}',
132
+ 'panels.market.add.failureNetwork': 'The network connection failed',
133
+ 'panels.market.add.failureNotFound': 'No such module found',
134
+ 'panels.market.add.failureNoMatchingVersion': 'No matching version',
135
+ 'panels.market.add.failureDiskFull': 'Out of disk space, install stopped',
136
+ 'panels.market.add.failurePermission': 'No write permission, cannot install',
137
+ 'panels.market.add.failureBuildBlocked': 'A dependency wants to run install scripts; you have to allow it first',
138
+ 'panels.market.add.failureIntegrity': 'The downloaded package failed its integrity check',
139
+ 'panels.market.add.failureTimeout': 'The install timed out',
140
+ 'panels.market.add.failurePnpmMissing': 'pnpm was not found, cannot install',
141
+ 'panels.market.add.failureGeneric': 'Something went wrong during install — see the install details',
142
+ 'panels.market.add.approveTitle': 'Your approval is needed for install scripts',
143
+ 'panels.market.add.approveCaution': 'Only allow packages you trust: install scripts run on this machine with your permissions.',
144
+ 'panels.market.add.approveRun': 'Allow and continue installing',
145
+ 'panels.market.add.restart': 'Installed — restart once to pick it up.',
146
+ 'panels.market.add.tookEffect': 'Live.',
147
+ 'panels.market.add.details': 'Install details',
148
+ 'panels.market.add.open': 'Add module',
149
+ 'panels.market.add.title': 'Add module',
150
+ 'panels.market.add.intro': 'Install a workbench module by package name. It goes on this machine, shared by every project.',
151
+ 'panels.market.add.specLabel': 'Package',
152
+ 'panels.market.add.specHint': 'The same thing you would put after `dsh plugin add`: a package name (optional @version), a git URL, a tarball, or an absolute local path.',
153
+ 'panels.market.add.exampleTitle': 'Examples',
154
+ 'panels.market.add.exampleFill': 'Fill in an example',
155
+ 'panels.market.add.registryLabel': 'Source',
156
+ 'panels.market.add.registryProfile': "This profile's registry",
157
+ 'panels.market.add.registryPnpm': "pnpm's own registry",
158
+ 'panels.market.add.check': 'Check',
159
+ 'panels.market.add.checking': 'Checking…',
160
+ 'panels.market.add.change': 'Edit',
161
+ 'panels.market.add.previewTitle': 'About to install',
162
+ 'panels.market.add.fieldName': 'Package',
163
+ 'panels.market.add.fieldVersion': 'Version',
164
+ 'panels.market.add.fieldDescription': 'Description',
165
+ 'panels.market.add.fieldSource': 'Source',
166
+ 'panels.market.add.install': 'Install',
167
+ 'panels.market.add.installing': 'Installing…',
168
+ 'panels.market.add.cancel': 'Cancel install',
169
+ 'panels.market.add.close': 'Close',
170
+ 'panels.market.add.retry': 'Retry',
171
+ 'panels.market.add.changeSource': 'Change source',
172
+ 'panels.market.add.approveBuilds': 'Allow these scripts and retry',
173
+ 'panels.market.add.approveHint': 'These packages want to run install scripts: {packages}',
174
+ 'panels.market.add.doneApplied': 'Installed and live.',
175
+ 'panels.market.add.doneRestart': 'Installed — restart once to pick it up.',
176
+ 'panels.market.add.cancelled': 'Cancelled.',
177
+ 'panels.market.add.failed': "Didn't work: {reason}",
178
+ 'panels.market.add.supplyInstalled': 'The plugins it needs are installed too.',
179
+ 'panels.market.add.supplyPending': 'Its plugins install after you restart.',
180
+ 'panels.market.add.supplyFailed': "Its plugins didn't install: {reason}",
181
+ 'panels.market.add.notModule': "This is not a workbench module (no dsh.workbench declaration), so it will not show up on the board.",
182
+ 'panels.market.add.removed': 'Removed.',
183
+ 'panels.market.add.removedRestart': 'Removed — restart once to finish.',
184
+ 'panels.market.add.remove': 'Remove it',
185
+ 'panels.market.add.problem.invalidSpec': "That is not a spec we accept: it cannot be empty or start with a dash.",
186
+ 'panels.market.add.problem.alreadyInstalled': 'That package is already in the profile (add @version to switch versions).',
187
+ 'panels.market.add.problem.notFound': 'No such package on that source.',
188
+ 'panels.market.add.problem.notAPackage': 'There is no package at that location.',
189
+ 'panels.market.add.problem.notABundle': 'It is an npm package, but not a dsh plugin (no bundle patch).',
190
+ 'panels.market.add.problem.network': 'The source is unreachable.',
191
+ 'panels.market.add.problem.unknown': 'The check did not pass (reason unknown).',
192
+ 'panels.market.add.reason.invalidSpec': 'the spec is not accepted',
193
+ 'panels.market.add.reason.incompatible': 'it wants a different dsh version than this machine runs',
194
+ 'panels.market.add.reason.notBundle': 'it is not a dsh plugin package',
195
+ 'panels.market.add.reason.notRemovable': 'it ships with the installation and cannot be removed',
196
+ 'panels.market.add.reason.bundleInUse': 'something is still using it',
197
+ 'panels.market.add.reason.stopProfile': 'this profile has no hot reload, so stop the process first',
198
+ 'panels.market.add.reason.staleApproval': 'the scripts to allow changed — start over',
199
+ 'panels.market.add.reason.operationError': 'pnpm failed (see the install output)',
200
+ 'panels.market.add.reason.buildBlocked': 'pnpm blocked install scripts',
201
+ 'panels.market.add.reason.pnpmMissing': 'pnpm is not on this machine',
202
+ 'panels.market.add.reason.noMatchingVersion': 'no version matching that range on the source',
203
+ 'panels.market.add.reason.diskFull': 'the disk is full',
204
+ 'panels.market.add.reason.permission': 'no permission to write',
205
+ 'panels.market.add.reason.integrity': 'the download failed its integrity check',
206
+ 'panels.market.add.reason.timeout': 'no output for too long, so it was stopped',
207
+ 'panels.market.add.reason.network': 'the network is unreachable',
208
+ 'panels.market.add.reason.notFound': 'no such package on the source',
209
+ 'panels.market.add.reason.unknown': 'It failed without saying why (see the install output)',
85
210
  'blocker.fix.install': 'Install for me',
86
211
  'blocker.fix.update': 'Upgrade for me',
87
212
  'blocker.fix.running': 'Running…',
@@ -65,18 +65,23 @@ export declare const dictionaries: {
65
65
  readonly 'panels.market.install': "安装";
66
66
  readonly 'panels.market.update': "更新";
67
67
  readonly 'panels.market.uninstall': "卸载";
68
+ readonly 'panels.market.uninstallLabel': "卸载 {name}";
68
69
  readonly 'panels.market.installing': "正在安装…";
69
70
  readonly 'panels.market.updating': "正在更新…";
70
71
  readonly 'panels.market.uninstalling': "正在卸载…";
71
- readonly 'panels.market.confirmUninstall': "要卸载吗?";
72
- readonly 'panels.market.confirmUninstallDetail': "卸载后这台机器上就没有它了,所有项目的面板也会把它一起拿掉(绑定与设置不会丢)。";
73
- readonly 'panels.market.confirmYes': "确定卸载";
72
+ readonly 'panels.market.confirmUninstallTitle': "卸载「{name}」?";
73
+ readonly 'panels.market.confirmUninstallDetail': "卸载后它提供的功能会消失。";
74
+ readonly 'panels.market.confirmUninstallAck': "我明白:卸载后想再用,得重新装一遍。";
75
+ readonly 'panels.market.confirmYes': "卸载";
74
76
  readonly 'panels.market.confirmNo': "取消";
75
77
  readonly 'panels.market.failed': "没成功:{reason}";
76
78
  readonly 'panels.market.needEnv': "先在启动工作台的终端里设 {env}";
77
79
  readonly 'panels.market.noSource': "这个模块没声明怎么装,只能自己动手";
78
80
  readonly 'panels.market.badSource': "安装方式没写全,只能自己动手";
79
81
  readonly 'panels.market.empty': "暂无可用模块";
82
+ readonly 'panels.market.installedSection': "已装";
83
+ readonly 'panels.market.moduleUpdate': "有新版 {version}:安装完成后可能需要重启才生效。";
84
+ readonly 'panels.market.restartNeeded': "新版装好了,重启一次才生效。";
80
85
  readonly 'panels.market.foot': "装好后到那个项目的面板页勾选它,模块才会出现。";
81
86
  readonly 'panels.market.recheck': "重新检查更新";
82
87
  readonly 'panels.market.checkUpdates': "检查更新";
@@ -84,6 +89,126 @@ export declare const dictionaries: {
84
89
  readonly 'panels.market.justNow': "刚刚";
85
90
  readonly 'panels.market.minutesAgo': "{n} 分钟前";
86
91
  readonly 'panels.market.hoursAgo': "{n} 小时前";
92
+ readonly 'panels.market.add.description': "输入模块的包名、Git 仓库地址或本地目录路径。";
93
+ readonly 'panels.market.add.specPlaceholder': "例如 @dsh-workbench/module-hello";
94
+ readonly 'panels.market.add.guideToggle': "模块安装引导和示例";
95
+ readonly 'panels.market.add.guideHide': "收起引导";
96
+ readonly 'panels.market.add.guideIdTitle': "包名";
97
+ readonly 'panels.market.add.guideIdExample': "@dsh-workbench/module-hello";
98
+ readonly 'panels.market.add.guideIdHint': "模块包名即 npm 包名(如 dsh-workbench-module-xxx 或 @作者/模块名),社区模块的 README 安装命令中 dsh plugin add 或 pnpm add 之后的部分。";
99
+ readonly 'panels.market.add.guideGitTitle': "Git 仓库地址";
100
+ readonly 'panels.market.add.guideGitExample': "https://github.com/author/dsh-workbench-module-x";
101
+ readonly 'panels.market.add.guideGitHint': "模块在 GitHub 上的开源仓库地址,也支持其他 Git 仓库。";
102
+ readonly 'panels.market.add.guidePathTitle': "本地模块目录";
103
+ readonly 'panels.market.add.guidePathExample': "/Users/name/my-workbench-module";
104
+ readonly 'panels.market.add.guidePathHint': "本机上模块目录的绝对路径,适用于自行开发或已下载的模块。";
105
+ readonly 'panels.market.add.guideExampleLabel': "示例:";
106
+ readonly 'panels.market.add.guideFill': "填入示例";
107
+ readonly 'panels.market.add.guideSafety': "请确认模块来源可信。模块在本机以你的权限运行,来源不明的模块可能损坏工作台,或读取和泄露你的数据。";
108
+ readonly 'panels.market.add.registryLegend': "从哪个 npm 源下载模块";
109
+ readonly 'panels.market.add.registryOfficial': "npm 官方源";
110
+ readonly 'panels.market.add.registryMirror': "中国大陆镜像源";
111
+ readonly 'panels.market.add.registryWithHost': "{name}({host})";
112
+ readonly 'panels.market.add.registryToggle': "安装源";
113
+ readonly 'panels.market.add.installVersion': "版本 {version}";
114
+ readonly 'panels.market.add.registryDefault': "默认安装源";
115
+ readonly 'panels.market.add.registryCustom': "自定义地址";
116
+ readonly 'panels.market.add.registryCustomPlaceholder': "https://npm.example.com/";
117
+ readonly 'panels.market.add.registryCustomHint': "公司内网或私有 npm 源;需要登录的源,把凭据放在本机的 ~/.npmrc 里";
118
+ readonly 'panels.market.add.registryCustomInvalid': "请输入以 http:// 或 https:// 开头的地址";
119
+ readonly 'panels.market.add.run': "安装";
120
+ readonly 'panels.market.add.edit': "编辑";
121
+ readonly 'panels.market.add.changeRegistry': "更换安装源";
122
+ readonly 'panels.market.add.installingTitle': "模块安装中…";
123
+ readonly 'panels.market.add.installedTitle': "已安装";
124
+ readonly 'panels.market.add.failedTitle': "模块安装失败";
125
+ readonly 'panels.market.add.cancelledTitle': "已取消";
126
+ readonly 'panels.market.add.failureNetworkHost': "无法连接 {host}。Git 地址和 .tgz 直链不经过安装源,需要本机能直接访问它或配置代理;如果这个模块也发布到了 npm,请改填包名。";
127
+ readonly 'panels.market.add.problemInvalid': "无法识别这个包名或地址:{reason}";
128
+ readonly 'panels.market.add.problemInstalled': "该模块已安装";
129
+ readonly 'panels.market.add.problemNotFound': "未找到相关模块";
130
+ readonly 'panels.market.add.problemNotPackage': "该路径不存在或不是有效的模块包";
131
+ readonly 'panels.market.add.problemNotBundle': "这个包没有声明组合包,无法作为模块安装:{reason}";
132
+ readonly 'panels.market.add.problemNetwork': "无法连接模块源,请检查网络后重试";
133
+ readonly 'panels.market.add.problemUnknown': "无法获取模块信息:{reason}";
134
+ readonly 'panels.market.add.failureNetwork': "网络连接失败";
135
+ readonly 'panels.market.add.failureNotFound': "未找到相关模块";
136
+ readonly 'panels.market.add.failureNoMatchingVersion': "没有匹配的版本";
137
+ readonly 'panels.market.add.failureDiskFull': "磁盘空间不足,安装已停止";
138
+ readonly 'panels.market.add.failurePermission': "没有写入权限,无法安装";
139
+ readonly 'panels.market.add.failureBuildBlocked': "有依赖的安装脚本需要你允许后才能继续";
140
+ readonly 'panels.market.add.failureIntegrity': "下载的安装包校验失败";
141
+ readonly 'panels.market.add.failureTimeout': "安装超时";
142
+ readonly 'panels.market.add.failurePnpmMissing': "没有找到 pnpm,无法安装";
143
+ readonly 'panels.market.add.failureGeneric': "安装过程中出错,原因见安装详情";
144
+ readonly 'panels.market.add.approveTitle': "需要你允许安装脚本";
145
+ readonly 'panels.market.add.approveCaution': "只允许你信得过的包:安装脚本会以你的权限在这台机器上运行。";
146
+ readonly 'panels.market.add.approveRun': "允许并继续安装";
147
+ readonly 'panels.market.add.restart': "装好了,重启一次才生效。";
148
+ readonly 'panels.market.add.tookEffect': "已生效。";
149
+ readonly 'panels.market.add.details': "安装详情";
150
+ readonly 'panels.market.add.open': "添加模块";
151
+ readonly 'panels.market.add.title': "添加模块";
152
+ readonly 'panels.market.add.intro': "按包名装工作台模块。装在这台机器上,所有项目共用。";
153
+ readonly 'panels.market.add.specLabel': "包名";
154
+ readonly 'panels.market.add.specHint': "就是命令里 `dsh plugin add` 后面那一段:包名(可带 @版本)、git 地址、压缩包或本地绝对路径。";
155
+ readonly 'panels.market.add.exampleTitle': "示例";
156
+ readonly 'panels.market.add.exampleFill': "填入示例";
157
+ readonly 'panels.market.add.registryLabel': "安装源";
158
+ readonly 'panels.market.add.registryProfile': "这个 profile 配的源";
159
+ readonly 'panels.market.add.registryPnpm': "pnpm 自己配的源";
160
+ readonly 'panels.market.add.check': "预检";
161
+ readonly 'panels.market.add.checking': "正在预检…";
162
+ readonly 'panels.market.add.change': "改一下";
163
+ readonly 'panels.market.add.previewTitle': "将要安装";
164
+ readonly 'panels.market.add.fieldName': "包名";
165
+ readonly 'panels.market.add.fieldVersion': "版本";
166
+ readonly 'panels.market.add.fieldDescription': "简介";
167
+ readonly 'panels.market.add.fieldSource': "来源";
168
+ readonly 'panels.market.add.install': "安装";
169
+ readonly 'panels.market.add.installing': "正在安装…";
170
+ readonly 'panels.market.add.cancel': "取消安装";
171
+ readonly 'panels.market.add.close': "关闭";
172
+ readonly 'panels.market.add.retry': "重试";
173
+ readonly 'panels.market.add.changeSource': "换源";
174
+ readonly 'panels.market.add.approveBuilds': "允许这些脚本并重试";
175
+ readonly 'panels.market.add.approveHint': "这几个包要跑安装脚本:{packages}";
176
+ readonly 'panels.market.add.doneApplied': "装好了,已经生效。";
177
+ readonly 'panels.market.add.doneRestart': "装好了,重启一次才生效。";
178
+ readonly 'panels.market.add.cancelled': "已取消。";
179
+ readonly 'panels.market.add.failed': "没成功:{reason}";
180
+ readonly 'panels.market.add.supplyInstalled': "它要的插件也装上了。";
181
+ readonly 'panels.market.add.supplyPending': "它要的插件重启后再装。";
182
+ readonly 'panels.market.add.supplyFailed': "它要的插件没装上:{reason}";
183
+ readonly 'panels.market.add.notModule': "这不是工作台模块(没有 dsh.workbench 声明),不会出现在面板上。";
184
+ readonly 'panels.market.add.removed': "已经移除了。";
185
+ readonly 'panels.market.add.removedRestart': "卸掉了,重启一次才彻底生效。";
186
+ readonly 'panels.market.add.remove': "移除它";
187
+ readonly 'panels.market.add.problem.invalidSpec': "这个写法不认:不能是空的,也不能以横杠开头。";
188
+ readonly 'panels.market.add.problem.alreadyInstalled': "这个包已经在 profile 里了(要换版本请带上 @版本)。";
189
+ readonly 'panels.market.add.problem.notFound': "源上没有这个包。";
190
+ readonly 'panels.market.add.problem.notAPackage': "这个位置没有包。";
191
+ readonly 'panels.market.add.problem.notABundle': "它是一个 npm 包,但不是 dsh 插件包(没有 bundle patch)。";
192
+ readonly 'panels.market.add.problem.network': "源连不上。";
193
+ readonly 'panels.market.add.problem.unknown': "预检没通过(原因未知)。";
194
+ readonly 'panels.market.add.reason.invalidSpec': "写法不认";
195
+ readonly 'panels.market.add.reason.incompatible': "它要的 dsh 版本和这台机器上的不一致";
196
+ readonly 'panels.market.add.reason.notBundle': "它不是一个 dsh 插件包";
197
+ readonly 'panels.market.add.reason.notRemovable': "它是安装自带的组合包,不能卸";
198
+ readonly 'panels.market.add.reason.bundleInUse': "还有东西在用它,卸不掉";
199
+ readonly 'panels.market.add.reason.stopProfile': "这个 profile 没开热更新,得先停掉进程";
200
+ readonly 'panels.market.add.reason.staleApproval': "要允许的安装脚本已经变了,重新来一次";
201
+ readonly 'panels.market.add.reason.operationError': "pnpm 执行出错(详情见安装输出)";
202
+ readonly 'panels.market.add.reason.buildBlocked': "pnpm 拦下了安装脚本";
203
+ readonly 'panels.market.add.reason.pnpmMissing': "这台机器上没有 pnpm";
204
+ readonly 'panels.market.add.reason.noMatchingVersion': "源上没有符合这个版本范围的版本";
205
+ readonly 'panels.market.add.reason.diskFull': "磁盘满了";
206
+ readonly 'panels.market.add.reason.permission': "没有写权限";
207
+ readonly 'panels.market.add.reason.integrity': "下载内容校验不过";
208
+ readonly 'panels.market.add.reason.timeout': "太久没有输出,被中断了";
209
+ readonly 'panels.market.add.reason.network': "网络不通";
210
+ readonly 'panels.market.add.reason.notFound': "源上没有这个包";
211
+ readonly 'panels.market.add.reason.unknown': "没成功,但它没说是为什么(详情见安装输出的那一行)";
87
212
  readonly 'blocker.fix.install': "帮我安装";
88
213
  readonly 'blocker.fix.update': "帮我升级";
89
214
  readonly 'blocker.fix.running': "正在执行…";
@@ -162,7 +287,7 @@ export declare const dictionaries: {
162
287
  readonly 'panel.conversation': "对话";
163
288
  readonly 'panels.label': "全局面板";
164
289
  };
165
- en: Record<"time.now" | "time.minutes" | "time.hours" | "time.days" | "blocker.retry" | "blocker.copy" | "blocker.unknown.title" | "blocker.login.go" | "blocker.login.titleGeneric" | "blocker.login.title" | "blocker.login.manual" | "blocker.login.hint" | "blocker.forbidden.open" | "blocker.forbidden.titleGeneric" | "blocker.forbidden.title" | "blocker.forbidden.hint" | "blocker.timeout.hint" | "blocker.exec.hint" | "blocker.fix.install" | "blocker.fix.update" | "blocker.market.open" | "env.unit.missingPlugin" | "env.unit.hint" | "env.unit.missingCommands" | "env.unit.missingCommandsHint" | "env.unit.unchecked" | "env.unit.uncheckedHint" | "brand.name" | "toggle.open" | "toggle.collapse" | "project.label" | "workspace.section" | "project.none" | "project.empty" | "project.add" | "session.new" | "session.new.label" | "session.empty" | "session.noProject" | "session.pinned" | "session.actions" | "status.idle" | "status.running" | "status.waitingApproval" | "status.planReview" | "status.waitingAnswer" | "status.completed" | "status.subagentsRunning.one" | "status.subagentsRunning.other" | "panels.title" | "panels.reset" | "panels.enabled" | "panels.disabled" | "panels.choose" | "panels.failed" | "panels.hintEffect" | "panels.dragHint" | "panels.unknownStep" | "panels.labelWithHint" | "panels.dep.missingPlugin" | "panels.dep.missingCommands" | "panels.dep.unchecked" | "panels.tab.modules" | "panels.tab.market" | "panels.browseMarket" | "panels.noneInstalled" | "panels.noneInstalledHint" | "panels.market.installed" | "panels.market.outdated" | "panels.market.hasNew" | "panels.market.missing" | "panels.market.unchecked" | "panels.market.checking" | "panels.market.sectionInstalled" | "panels.market.sectionPending" | "panels.market.sectionShared" | "panels.market.sharedUsedBy" | "panels.market.listSeparator" | "panels.market.sharedMissing" | "panels.market.sharedOutdated" | "panels.market.sharedUnsatisfied" | "panels.market.sharedOk" | "panels.market.versionArrow" | "panels.market.lead" | "panels.market.install" | "panels.market.update" | "panels.market.uninstall" | "panels.market.installing" | "panels.market.updating" | "panels.market.uninstalling" | "panels.market.confirmUninstall" | "panels.market.confirmUninstallDetail" | "panels.market.confirmYes" | "panels.market.confirmNo" | "panels.market.failed" | "panels.market.needEnv" | "panels.market.noSource" | "panels.market.badSource" | "panels.market.empty" | "panels.market.foot" | "panels.market.recheck" | "panels.market.checkUpdates" | "panels.market.checkedAt" | "panels.market.justNow" | "panels.market.minutesAgo" | "panels.market.hoursAgo" | "blocker.fix.running" | "blocker.fix.failed" | "blocker.retry.running" | "panels.reading" | "panels.empty" | "panels.emptyHint" | "env.title" | "env.checking" | "env.installing" | "env.failed" | "env.elapsed" | "env.stepFailed.install" | "env.stepFailed.path" | "env.stepFailed.shell" | "env.bridge.ok" | "env.bridge.short" | "env.bridge.why" | "env.bridge.daemon" | "env.bridge.extension" | "env.bridge.extensionLink" | "env.bridge.profile" | "env.bridge.stale" | "env.bridge.unknown" | "env.fix.title" | "env.fix.why" | "env.fix.whyPath" | "env.fix.whyShell" | "env.fix.step" | "env.fix.stepPath" | "env.fix.stepShell" | "env.fix.permission" | "env.fix.network" | "env.fix.details" | "env.retry" | "env.copyCommand" | "env.copied" | "env.step.opencli" | "env.step.codingPlugin" | "env.step.bridge" | "env.step.warm" | "env.warm.done" | "env.warm.short" | "rightbar.label" | "rightbar.expand" | "rightbar.collapse" | "rightbar.refresh" | "rightbar.refreshing" | "rightbar.updatedAt" | "rightbar.noProject" | "coding.notARepo.title" | "error.unknown" | "board.title" | "panel.conversation" | "panels.label", string>;
290
+ en: Record<"time.now" | "time.minutes" | "time.hours" | "time.days" | "blocker.retry" | "blocker.copy" | "blocker.unknown.title" | "blocker.login.go" | "blocker.login.titleGeneric" | "blocker.login.title" | "blocker.login.manual" | "blocker.login.hint" | "blocker.forbidden.open" | "blocker.forbidden.titleGeneric" | "blocker.forbidden.title" | "blocker.forbidden.hint" | "blocker.timeout.hint" | "blocker.exec.hint" | "blocker.fix.install" | "blocker.fix.update" | "blocker.market.open" | "env.unit.missingPlugin" | "env.unit.hint" | "env.unit.missingCommands" | "env.unit.missingCommandsHint" | "env.unit.unchecked" | "env.unit.uncheckedHint" | "brand.name" | "toggle.open" | "toggle.collapse" | "project.label" | "workspace.section" | "project.none" | "project.empty" | "project.add" | "session.new" | "session.new.label" | "session.empty" | "session.noProject" | "session.pinned" | "session.actions" | "status.idle" | "status.running" | "status.waitingApproval" | "status.planReview" | "status.waitingAnswer" | "status.completed" | "status.subagentsRunning.one" | "status.subagentsRunning.other" | "panels.title" | "panels.reset" | "panels.enabled" | "panels.disabled" | "panels.choose" | "panels.failed" | "panels.hintEffect" | "panels.dragHint" | "panels.unknownStep" | "panels.labelWithHint" | "panels.dep.missingPlugin" | "panels.dep.missingCommands" | "panels.dep.unchecked" | "panels.tab.modules" | "panels.tab.market" | "panels.browseMarket" | "panels.noneInstalled" | "panels.noneInstalledHint" | "panels.market.installed" | "panels.market.outdated" | "panels.market.hasNew" | "panels.market.missing" | "panels.market.unchecked" | "panels.market.checking" | "panels.market.sectionInstalled" | "panels.market.sectionPending" | "panels.market.sectionShared" | "panels.market.sharedUsedBy" | "panels.market.listSeparator" | "panels.market.sharedMissing" | "panels.market.sharedOutdated" | "panels.market.sharedUnsatisfied" | "panels.market.sharedOk" | "panels.market.versionArrow" | "panels.market.lead" | "panels.market.install" | "panels.market.update" | "panels.market.uninstall" | "panels.market.uninstallLabel" | "panels.market.installing" | "panels.market.updating" | "panels.market.uninstalling" | "panels.market.confirmUninstallTitle" | "panels.market.confirmUninstallDetail" | "panels.market.confirmUninstallAck" | "panels.market.confirmYes" | "panels.market.confirmNo" | "panels.market.failed" | "panels.market.needEnv" | "panels.market.noSource" | "panels.market.badSource" | "panels.market.empty" | "panels.market.installedSection" | "panels.market.moduleUpdate" | "panels.market.restartNeeded" | "panels.market.foot" | "panels.market.recheck" | "panels.market.checkUpdates" | "panels.market.checkedAt" | "panels.market.justNow" | "panels.market.minutesAgo" | "panels.market.hoursAgo" | "panels.market.add.description" | "panels.market.add.specPlaceholder" | "panels.market.add.guideToggle" | "panels.market.add.guideHide" | "panels.market.add.guideIdTitle" | "panels.market.add.guideIdExample" | "panels.market.add.guideIdHint" | "panels.market.add.guideGitTitle" | "panels.market.add.guideGitExample" | "panels.market.add.guideGitHint" | "panels.market.add.guidePathTitle" | "panels.market.add.guidePathExample" | "panels.market.add.guidePathHint" | "panels.market.add.guideExampleLabel" | "panels.market.add.guideFill" | "panels.market.add.guideSafety" | "panels.market.add.registryLegend" | "panels.market.add.registryOfficial" | "panels.market.add.registryMirror" | "panels.market.add.registryWithHost" | "panels.market.add.registryToggle" | "panels.market.add.installVersion" | "panels.market.add.registryDefault" | "panels.market.add.registryCustom" | "panels.market.add.registryCustomPlaceholder" | "panels.market.add.registryCustomHint" | "panels.market.add.registryCustomInvalid" | "panels.market.add.run" | "panels.market.add.edit" | "panels.market.add.changeRegistry" | "panels.market.add.installingTitle" | "panels.market.add.installedTitle" | "panels.market.add.failedTitle" | "panels.market.add.cancelledTitle" | "panels.market.add.failureNetworkHost" | "panels.market.add.problemInvalid" | "panels.market.add.problemInstalled" | "panels.market.add.problemNotFound" | "panels.market.add.problemNotPackage" | "panels.market.add.problemNotBundle" | "panels.market.add.problemNetwork" | "panels.market.add.problemUnknown" | "panels.market.add.failureNetwork" | "panels.market.add.failureNotFound" | "panels.market.add.failureNoMatchingVersion" | "panels.market.add.failureDiskFull" | "panels.market.add.failurePermission" | "panels.market.add.failureBuildBlocked" | "panels.market.add.failureIntegrity" | "panels.market.add.failureTimeout" | "panels.market.add.failurePnpmMissing" | "panels.market.add.failureGeneric" | "panels.market.add.approveTitle" | "panels.market.add.approveCaution" | "panels.market.add.approveRun" | "panels.market.add.restart" | "panels.market.add.tookEffect" | "panels.market.add.details" | "panels.market.add.open" | "panels.market.add.title" | "panels.market.add.intro" | "panels.market.add.specLabel" | "panels.market.add.specHint" | "panels.market.add.exampleTitle" | "panels.market.add.exampleFill" | "panels.market.add.registryLabel" | "panels.market.add.registryProfile" | "panels.market.add.registryPnpm" | "panels.market.add.check" | "panels.market.add.checking" | "panels.market.add.change" | "panels.market.add.previewTitle" | "panels.market.add.fieldName" | "panels.market.add.fieldVersion" | "panels.market.add.fieldDescription" | "panels.market.add.fieldSource" | "panels.market.add.install" | "panels.market.add.installing" | "panels.market.add.cancel" | "panels.market.add.close" | "panels.market.add.retry" | "panels.market.add.changeSource" | "panels.market.add.approveBuilds" | "panels.market.add.approveHint" | "panels.market.add.doneApplied" | "panels.market.add.doneRestart" | "panels.market.add.cancelled" | "panels.market.add.failed" | "panels.market.add.supplyInstalled" | "panels.market.add.supplyPending" | "panels.market.add.supplyFailed" | "panels.market.add.notModule" | "panels.market.add.removed" | "panels.market.add.removedRestart" | "panels.market.add.remove" | "panels.market.add.problem.invalidSpec" | "panels.market.add.problem.alreadyInstalled" | "panels.market.add.problem.notFound" | "panels.market.add.problem.notAPackage" | "panels.market.add.problem.notABundle" | "panels.market.add.problem.network" | "panels.market.add.problem.unknown" | "panels.market.add.reason.invalidSpec" | "panels.market.add.reason.incompatible" | "panels.market.add.reason.notBundle" | "panels.market.add.reason.notRemovable" | "panels.market.add.reason.bundleInUse" | "panels.market.add.reason.stopProfile" | "panels.market.add.reason.staleApproval" | "panels.market.add.reason.operationError" | "panels.market.add.reason.buildBlocked" | "panels.market.add.reason.pnpmMissing" | "panels.market.add.reason.noMatchingVersion" | "panels.market.add.reason.diskFull" | "panels.market.add.reason.permission" | "panels.market.add.reason.integrity" | "panels.market.add.reason.timeout" | "panels.market.add.reason.network" | "panels.market.add.reason.notFound" | "panels.market.add.reason.unknown" | "blocker.fix.running" | "blocker.fix.failed" | "blocker.retry.running" | "panels.reading" | "panels.empty" | "panels.emptyHint" | "env.title" | "env.checking" | "env.installing" | "env.failed" | "env.elapsed" | "env.stepFailed.install" | "env.stepFailed.path" | "env.stepFailed.shell" | "env.bridge.ok" | "env.bridge.short" | "env.bridge.why" | "env.bridge.daemon" | "env.bridge.extension" | "env.bridge.extensionLink" | "env.bridge.profile" | "env.bridge.stale" | "env.bridge.unknown" | "env.fix.title" | "env.fix.why" | "env.fix.whyPath" | "env.fix.whyShell" | "env.fix.step" | "env.fix.stepPath" | "env.fix.stepShell" | "env.fix.permission" | "env.fix.network" | "env.fix.details" | "env.retry" | "env.copyCommand" | "env.copied" | "env.step.opencli" | "env.step.codingPlugin" | "env.step.bridge" | "env.step.warm" | "env.warm.done" | "env.warm.short" | "rightbar.label" | "rightbar.expand" | "rightbar.collapse" | "rightbar.refresh" | "rightbar.refreshing" | "rightbar.updatedAt" | "rightbar.noProject" | "coding.notARepo.title" | "error.unknown" | "board.title" | "panel.conversation" | "panels.label", string>;
166
291
  };
167
292
  export type { WorkbenchMessages };
168
293
  export interface Dictionaries {