@dsh-workbench/shared 0.3.10 → 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +97 -0
  3. package/dist/api/blocker-table.d.ts +3 -3
  4. package/dist/api/blocker-table.js +47 -23
  5. package/dist/api/dsh.d.ts +19 -1
  6. package/dist/api/host-write.d.ts +0 -15
  7. package/dist/api/host-write.js +1 -35
  8. package/dist/api/workbench-client.js +2 -1
  9. package/dist/components/Activity.css +0 -1
  10. package/dist/components/ApprovalDetail.css +1 -2
  11. package/dist/components/ApprovalDetail.d.ts +1 -1
  12. package/dist/components/ApprovalPlan.css +0 -1
  13. package/dist/components/Card.css +0 -1
  14. package/dist/components/Card.d.ts +1 -1
  15. package/dist/components/CardBoundary.d.ts +1 -1
  16. package/dist/components/CardHead.css +0 -1
  17. package/dist/components/CardHead.d.ts +1 -1
  18. package/dist/components/ChoiceGroup.css +1 -2
  19. package/dist/components/ConfirmBar.d.ts +1 -1
  20. package/dist/components/ConfirmBar.js +1 -1
  21. package/dist/components/Form.css +1 -1
  22. package/dist/components/FormActions.js +1 -1
  23. package/dist/components/LongTaskRow.css +1 -2
  24. package/dist/components/LongTaskRow.d.ts +1 -1
  25. package/dist/components/LongTaskRow.js +1 -1
  26. package/dist/components/Note.css +0 -1
  27. package/dist/components/ResourceStates.css +0 -1
  28. package/dist/components/SettingsSection.css +0 -1
  29. package/dist/components/Spinner.css +0 -1
  30. package/dist/components/Stack.css +0 -1
  31. package/dist/components/StateBlock.css +0 -1
  32. package/dist/components/board-module.d.ts +3 -3
  33. package/dist/components/icons.d.ts +1 -7
  34. package/dist/components/icons.js +11 -16
  35. package/dist/config/constants.d.ts +2 -2
  36. package/dist/config/constants.js +2 -2
  37. package/dist/config/storage.d.ts +0 -4
  38. package/dist/config/storage.js +0 -11
  39. package/dist/contract/adapters.d.ts +10 -0
  40. package/dist/contract/cli.d.ts +3 -0
  41. package/dist/contract/data.d.ts +126 -0
  42. package/dist/{api → contract}/facts.d.ts +12 -3
  43. package/dist/{api → contract}/facts.js +19 -1
  44. package/dist/contract/needs.d.ts +132 -0
  45. package/dist/contract/needs.js +232 -0
  46. package/dist/contract/plugin-source.d.ts +1 -0
  47. package/dist/contract/plugin-source.js +1 -0
  48. package/dist/contract/protocol/bundle-install.d.ts +136 -0
  49. package/dist/contract/protocol/bundle-install.js +12 -0
  50. package/dist/contract/protocol/config-sync.d.ts +55 -0
  51. package/dist/contract/protocol/config-sync.js +2 -0
  52. package/dist/contract/protocol/diy.d.ts +4 -0
  53. package/dist/contract/protocol/diy.js +4 -0
  54. package/dist/contract/protocol/dsh-plugins.d.ts +11 -0
  55. package/dist/contract/protocol/dsh-plugins.js +1 -0
  56. package/dist/contract/protocol/long-tasks.d.ts +13 -0
  57. package/dist/contract/protocol/long-tasks.js +1 -0
  58. package/dist/contract/protocol/market-index.d.ts +195 -0
  59. package/dist/contract/protocol/market-index.js +7 -0
  60. package/dist/contract/protocol/platform.d.ts +44 -0
  61. package/dist/contract/protocol/platform.js +1 -0
  62. package/dist/contract/protocol/preflight-wake.d.ts +7 -0
  63. package/dist/contract/protocol/preflight-wake.js +1 -0
  64. package/dist/contract/protocol/profile-create.d.ts +30 -0
  65. package/dist/contract/protocol/profile-create.js +2 -0
  66. package/dist/contract/protocol/sidebar-edition.d.ts +14 -0
  67. package/dist/contract/protocol/sidebar-edition.js +2 -0
  68. package/dist/contract/protocol/unit-manifests.d.ts +6 -0
  69. package/dist/contract/protocol/unit-manifests.js +1 -0
  70. package/dist/contract/unit-board.d.ts +18 -0
  71. package/dist/contract/unit-board.js +1 -0
  72. package/dist/contract/unit-capability.d.ts +34 -0
  73. package/dist/contract/unit-capability.js +1 -0
  74. package/dist/{api → contract}/unit-declaration.d.ts +7 -5
  75. package/dist/{api → contract}/unit-declaration.js +19 -13
  76. package/dist/contract/unit.d.ts +57 -0
  77. package/dist/contract/unit.js +24 -0
  78. package/dist/contract/workbench-contract.d.ts +15 -0
  79. package/dist/contract/workbench-contract.js +1 -0
  80. package/dist/host/adapter-set.d.ts +26 -0
  81. package/dist/host/adapter-set.js +243 -0
  82. package/dist/host/adapter-types.d.ts +79 -0
  83. package/dist/host/adapter-types.js +23 -0
  84. package/dist/host/adapters.d.ts +22 -0
  85. package/dist/host/adapters.js +9 -0
  86. package/dist/host/browser.d.ts +3 -0
  87. package/dist/host/browser.js +3 -0
  88. package/dist/host/changelog.d.ts +21 -0
  89. package/dist/host/changelog.js +188 -0
  90. package/dist/host/channel-plugin.d.ts +15 -0
  91. package/dist/host/channel-plugin.js +42 -0
  92. package/dist/host/cli.d.ts +4 -0
  93. package/dist/host/cli.js +7 -0
  94. package/dist/host/command-name.d.ts +1 -0
  95. package/dist/host/command-name.js +14 -0
  96. package/dist/host/data-error.d.ts +13 -0
  97. package/dist/host/data-error.js +20 -0
  98. package/dist/host/data-root.js +3 -0
  99. package/dist/host/diy-debug.js +2 -1
  100. package/dist/host/diy-record.js +2 -1
  101. package/dist/host/facts.d.ts +1 -1
  102. package/dist/host/facts.js +3 -2
  103. package/dist/host/git.js +2 -2
  104. package/dist/host/http.js +1 -1
  105. package/dist/host/lib-capabilities.d.ts +22 -0
  106. package/dist/host/lib-capabilities.js +37 -0
  107. package/dist/host/lib-install.d.ts +9 -0
  108. package/dist/host/lib-install.js +10 -0
  109. package/dist/host/long-task.d.ts +1 -1
  110. package/dist/host/long-task.js +4 -3
  111. package/dist/host/market-index.d.ts +22 -0
  112. package/dist/host/market-index.js +420 -0
  113. package/dist/host/needs.d.ts +4 -0
  114. package/dist/host/needs.js +2 -0
  115. package/dist/host/patch.d.ts +9 -0
  116. package/dist/host/patch.js +78 -0
  117. package/dist/host/paths.d.ts +12 -0
  118. package/dist/host/paths.js +28 -0
  119. package/dist/host/platform.d.ts +14 -0
  120. package/dist/host/platform.js +40 -0
  121. package/dist/host/plugin-source.d.ts +8 -6
  122. package/dist/host/plugin-source.js +43 -33
  123. package/dist/host/plugin.d.ts +4 -0
  124. package/dist/host/plugin.js +39 -0
  125. package/dist/host/port-types.d.ts +191 -0
  126. package/dist/host/port-types.js +1 -0
  127. package/dist/host/preflight.d.ts +28 -0
  128. package/dist/host/preflight.js +1 -0
  129. package/dist/host/profile-port.d.ts +4 -0
  130. package/dist/host/profile-port.js +4 -0
  131. package/dist/host/provision.d.ts +2 -2
  132. package/dist/host/provision.js +5 -3
  133. package/dist/host/recipe-rules.d.ts +5 -0
  134. package/dist/host/recipe-rules.js +382 -0
  135. package/dist/host/recipe.d.ts +14 -0
  136. package/dist/host/recipe.js +283 -0
  137. package/dist/host/shell-text.d.ts +9 -2
  138. package/dist/host/shell-text.js +15 -3
  139. package/dist/host/shell.d.ts +2 -0
  140. package/dist/host/shell.js +7 -0
  141. package/dist/host/spec.d.ts +8 -0
  142. package/dist/host/spec.js +24 -0
  143. package/dist/host/supply-index.d.ts +34 -0
  144. package/dist/host/supply-index.js +202 -0
  145. package/dist/host/supply-port.d.ts +5 -0
  146. package/dist/host/supply-port.js +39 -0
  147. package/dist/host/time.d.ts +12 -0
  148. package/dist/host/time.js +19 -0
  149. package/dist/host/tokens.d.ts +26 -0
  150. package/dist/host/tokens.js +154 -0
  151. package/dist/host/tool-approval.d.ts +12 -0
  152. package/dist/host/tool-approval.js +4 -0
  153. package/dist/host/tool-kit.js +1 -1
  154. package/dist/host/unit-face.d.ts +5 -4
  155. package/dist/host/version-range.d.ts +2 -0
  156. package/dist/host/version-range.js +73 -0
  157. package/dist/host/version.d.ts +3 -0
  158. package/dist/host/version.js +29 -0
  159. package/dist/host.d.ts +47 -16
  160. package/dist/host.js +47 -16
  161. package/dist/i18n/en.js +259 -86
  162. package/dist/i18n/index.d.ts +333 -88
  163. package/dist/i18n/merge.js +1 -1
  164. package/dist/i18n/need-text.d.ts +26 -0
  165. package/dist/i18n/need-text.js +26 -0
  166. package/dist/i18n/settings.d.ts +70 -0
  167. package/dist/i18n/settings.js +136 -0
  168. package/dist/i18n/zh.d.ts +332 -87
  169. package/dist/i18n/zh.js +260 -87
  170. package/dist/index.d.ts +24 -8
  171. package/dist/index.js +24 -8
  172. package/dist/lib/blocker-action.d.ts +0 -15
  173. package/dist/lib/blocker-action.js +1 -25
  174. package/dist/{api → lib}/dsh-client.d.ts +12 -1
  175. package/dist/lib/dsh-client.js +1 -0
  176. package/dist/lib/market-index.d.ts +7 -0
  177. package/dist/lib/market-index.js +25 -0
  178. package/dist/lib/react-types.d.ts +5 -0
  179. package/dist/lib/react-types.js +1 -0
  180. package/dist/lib/react.d.ts +1 -40
  181. package/dist/lib/react.js +0 -36
  182. package/dist/lib/ui.js +3 -9
  183. package/dist/testing/data.d.ts +13 -0
  184. package/dist/testing/data.js +46 -0
  185. package/dist/testing/declaration.d.ts +1 -1
  186. package/dist/testing/declaration.js +1 -1
  187. package/dist/testing/host-fakes.d.ts +0 -13
  188. package/dist/testing/host-fakes.js +0 -24
  189. package/dist/testing/needs.d.ts +16 -0
  190. package/dist/testing/needs.js +46 -0
  191. package/dist/testing.d.ts +2 -0
  192. package/dist/testing.js +2 -0
  193. package/package.json +18 -2
  194. package/src/api/__tests__/blocker-table.test.ts +135 -86
  195. package/src/api/blocker-table.ts +52 -26
  196. package/src/api/dsh.ts +17 -1
  197. package/src/api/host-write.ts +0 -43
  198. package/src/api/workbench-client.test.ts +2 -2
  199. package/src/api/workbench-client.ts +2 -1
  200. package/src/components/Activity.css +0 -1
  201. package/src/components/ApprovalDetail.css +1 -2
  202. package/src/components/ApprovalDetail.tsx +1 -1
  203. package/src/components/ApprovalPlan.css +0 -1
  204. package/src/components/Card.css +0 -1
  205. package/src/components/Card.tsx +1 -1
  206. package/src/components/CardAnchor.test.tsx +1 -1
  207. package/src/components/CardBoundary.tsx +1 -1
  208. package/src/components/CardHead.css +0 -1
  209. package/src/components/CardHead.tsx +1 -1
  210. package/src/components/ChoiceGroup.css +1 -2
  211. package/src/components/ConfirmBar.tsx +1 -1
  212. package/src/components/Form.css +1 -1
  213. package/src/components/Form.tsx +1 -1
  214. package/src/components/FormActions.tsx +1 -1
  215. package/src/components/LongTaskRow.css +1 -2
  216. package/src/components/LongTaskRow.tsx +1 -1
  217. package/src/components/Note.css +0 -1
  218. package/src/components/ResourceStates.css +0 -1
  219. package/src/components/SelectFieldNodes.tsx +0 -1
  220. package/src/components/SettingsSection.css +0 -1
  221. package/src/components/Spinner.css +0 -1
  222. package/src/components/Stack.css +0 -1
  223. package/src/components/StateBlock.css +0 -1
  224. package/src/components/__tests__/long-task-row.test.ts +1 -1
  225. package/src/components/board-module.ts +3 -3
  226. package/src/components/icons.tsx +16 -24
  227. package/src/config/constants.ts +2 -2
  228. package/src/config/storage.test.ts +1 -25
  229. package/src/config/storage.ts +0 -12
  230. package/src/{api → contract}/__tests__/facts.test.ts +73 -25
  231. package/src/{api → contract}/__tests__/long-task.test.ts +3 -3
  232. package/src/contract/__tests__/needs.test.ts +74 -0
  233. package/src/{host → contract}/__tests__/unit-declaration.test.ts +1 -1
  234. package/src/contract/__tests__/unit.test.ts +43 -0
  235. package/src/contract/adapters.ts +9 -0
  236. package/src/contract/cli.ts +3 -0
  237. package/src/contract/data.ts +145 -0
  238. package/src/{api → contract}/facts.ts +34 -4
  239. package/src/contract/needs.ts +331 -0
  240. package/src/contract/plugin-source.ts +1 -0
  241. package/src/contract/protocol/bundle-install.ts +198 -0
  242. package/src/contract/protocol/config-sync.ts +65 -0
  243. package/src/contract/protocol/diy.ts +4 -0
  244. package/src/contract/protocol/dsh-plugins.ts +13 -0
  245. package/src/contract/protocol/long-tasks.ts +16 -0
  246. package/src/contract/protocol/market-index.ts +246 -0
  247. package/src/contract/protocol/platform.ts +47 -0
  248. package/src/contract/protocol/preflight-wake.ts +17 -0
  249. package/src/contract/protocol/profile-create.ts +36 -0
  250. package/src/contract/protocol/sidebar-edition.ts +19 -0
  251. package/src/contract/protocol/unit-manifests.ts +8 -0
  252. package/src/contract/unit-board.ts +23 -0
  253. package/src/contract/unit-capability.ts +37 -0
  254. package/src/{host → contract}/unit-declaration.ts +22 -18
  255. package/src/contract/unit.ts +76 -0
  256. package/src/contract/workbench-contract.ts +30 -0
  257. package/src/host/__tests__/adapter-set.test.ts +228 -0
  258. package/src/host/__tests__/adapters.test.ts +27 -0
  259. package/src/host/__tests__/changelog.test.ts +102 -0
  260. package/src/host/__tests__/command-name.test.ts +16 -0
  261. package/src/host/__tests__/diy-record.test.ts +3 -3
  262. package/src/host/__tests__/facts.test.ts +5 -5
  263. package/src/host/__tests__/long-task.test.ts +1 -1
  264. package/src/host/__tests__/market-index.test.ts +179 -0
  265. package/src/host/__tests__/plugin-ledger.test.ts +10 -10
  266. package/src/host/__tests__/provision.test.ts +7 -6
  267. package/src/host/__tests__/shell-text.test.ts +16 -1
  268. package/src/host/__tests__/supply-index.test.ts +137 -0
  269. package/src/host/__tests__/tokens.test.ts +110 -0
  270. package/src/host/__tests__/version-range.test.ts +21 -0
  271. package/src/host/adapter-set.ts +298 -0
  272. package/src/host/adapter-types.ts +105 -0
  273. package/src/host/adapters.ts +44 -0
  274. package/src/host/browser.ts +3 -0
  275. package/src/host/changelog.ts +212 -0
  276. package/src/host/channel-plugin.ts +55 -0
  277. package/src/host/cli.ts +11 -0
  278. package/src/host/command-name.ts +15 -0
  279. package/src/host/data-error.ts +21 -0
  280. package/src/host/data-root.ts +2 -0
  281. package/src/host/diy-debug.ts +2 -1
  282. package/src/host/diy-record.ts +2 -1
  283. package/src/host/facts.ts +4 -3
  284. package/src/host/git.ts +2 -2
  285. package/src/host/http.ts +1 -1
  286. package/src/host/lib-capabilities.ts +52 -0
  287. package/src/host/lib-install.ts +18 -0
  288. package/src/host/long-task.ts +4 -3
  289. package/src/host/market-index.ts +413 -0
  290. package/src/host/needs.ts +6 -0
  291. package/src/host/patch.ts +93 -0
  292. package/src/host/paths.ts +37 -0
  293. package/src/host/platform.ts +48 -0
  294. package/src/host/plugin-source.ts +48 -56
  295. package/src/host/plugin.ts +39 -0
  296. package/src/host/port-types.ts +222 -0
  297. package/src/host/preflight.ts +31 -0
  298. package/src/host/profile-port.ts +9 -0
  299. package/src/host/provision.ts +7 -4
  300. package/src/host/recipe-rules.ts +330 -0
  301. package/src/host/recipe.test.ts +334 -0
  302. package/src/host/recipe.ts +323 -0
  303. package/src/host/shell-text.ts +15 -3
  304. package/src/host/shell.ts +9 -0
  305. package/src/host/spec.ts +32 -0
  306. package/src/host/supply-index.ts +256 -0
  307. package/src/host/supply-port.ts +45 -0
  308. package/src/host/time.ts +22 -0
  309. package/src/host/tokens.ts +186 -0
  310. package/src/host/tool-approval.ts +17 -0
  311. package/src/host/tool-kit.ts +1 -1
  312. package/src/host/unit-face.ts +5 -4
  313. package/src/host/version-range.ts +71 -0
  314. package/src/host/version.ts +30 -0
  315. package/src/host.ts +47 -16
  316. package/src/i18n/en.ts +261 -86
  317. package/src/i18n/merge.test.ts +6 -6
  318. package/src/i18n/merge.ts +1 -1
  319. package/src/i18n/need-text.ts +27 -0
  320. package/src/i18n/settings.ts +141 -0
  321. package/src/i18n/zh.ts +263 -87
  322. package/src/index.ts +24 -8
  323. package/src/lib/blocker-action.ts +0 -28
  324. package/src/{api → lib}/dsh-client.ts +16 -2
  325. package/src/lib/market-index.ts +36 -0
  326. package/src/lib/react-types.ts +5 -0
  327. package/src/lib/react.ts +1 -40
  328. package/src/lib/text.test.ts +2 -2
  329. package/src/lib/ui.test.ts +6 -5
  330. package/src/lib/ui.ts +3 -9
  331. package/src/testing/__tests__/declaration.test.ts +1 -1
  332. package/src/testing/data.ts +66 -0
  333. package/src/testing/declaration.ts +2 -2
  334. package/src/testing/host-fakes.ts +0 -38
  335. package/src/testing/needs.ts +80 -0
  336. package/src/testing.ts +2 -0
  337. package/dist/api/unit-board.d.ts +0 -39
  338. package/dist/api/unit-board.js +0 -45
  339. package/dist/api/unit.d.ts +0 -85
  340. package/dist/api/unit.js +0 -8
  341. package/dist/api/workbench-contract.d.ts +0 -44
  342. package/dist/components/MockStrip.css +0 -39
  343. package/dist/components/MockStrip.d.ts +0 -15
  344. package/dist/components/MockStrip.js +0 -8
  345. package/dist/components/SaveBar.css +0 -7
  346. package/dist/host/browser-find.d.ts +0 -38
  347. package/dist/host/browser-find.js +0 -242
  348. package/dist/host/browser-read.d.ts +0 -28
  349. package/dist/host/browser-read.js +0 -243
  350. package/dist/host/opencli-runtime.d.ts +0 -25
  351. package/dist/host/opencli-runtime.js +0 -56
  352. package/dist/host/opencli-window.d.ts +0 -2
  353. package/dist/host/opencli-window.js +0 -8
  354. package/dist/host/opencli.d.ts +0 -37
  355. package/dist/host/opencli.js +0 -155
  356. package/dist/host/unit-declaration.d.ts +0 -65
  357. package/dist/host/unit-declaration.js +0 -213
  358. package/dist/host/unit-libs.d.ts +0 -37
  359. package/dist/lib/diy-debug.d.ts +0 -80
  360. package/dist/lib/diy-debug.js +0 -88
  361. package/dist/lib/diy-record.d.ts +0 -135
  362. package/dist/lib/diy-record.js +0 -162
  363. package/dist/lib/lint-probe.d.ts +0 -1
  364. package/dist/lib/lint-probe.js +0 -6
  365. package/dist/lib/panel-state.d.ts +0 -120
  366. package/dist/lib/panel-state.js +0 -176
  367. package/src/api/__tests__/host-write.test.ts +0 -75
  368. package/src/api/__tests__/unit-board.test.ts +0 -76
  369. package/src/api/__tests__/unit.test.ts +0 -38
  370. package/src/api/unit-board.ts +0 -69
  371. package/src/api/unit.ts +0 -93
  372. package/src/api/workbench-contract.ts +0 -59
  373. package/src/host/__tests__/browser-find.test.ts +0 -330
  374. package/src/host/__tests__/browser-read.test.ts +0 -228
  375. package/src/host/__tests__/opencli-runtime.test.ts +0 -46
  376. package/src/host/browser-find.ts +0 -311
  377. package/src/host/browser-read.ts +0 -311
  378. package/src/host/opencli-runtime.ts +0 -79
  379. package/src/host/opencli-window.ts +0 -11
  380. package/src/host/opencli.ts +0 -213
  381. package/src/host/unit-libs.ts +0 -41
  382. package/src/lib/blocker-action.test.ts +0 -40
  383. /package/dist/{api/blocker.js → contract/adapters.js} +0 -0
  384. /package/dist/{api → contract}/blocker.d.ts +0 -0
  385. /package/dist/{api/dsh-client.js → contract/blocker.js} +0 -0
  386. /package/dist/{api/workbench-contract.js → contract/cli.js} +0 -0
  387. /package/dist/{host/unit-libs.js → contract/data.js} +0 -0
  388. /package/dist/{api → contract}/long-task.d.ts +0 -0
  389. /package/dist/{api → contract}/long-task.js +0 -0
  390. /package/src/{api → contract}/blocker.ts +0 -0
  391. /package/src/{api → contract}/long-task.ts +0 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-workbench contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,97 @@
1
+ # @dsh-workbench/shared
2
+
3
+ 工作台与模块共用的**契约与纯代码**:类型、纯函数、哑组件、i18n、宿主侧工具。
4
+ 它不持有状态、不依赖外壳运行时、不产生全局副作用 —— 所以外壳和每个模块都可以各自打一份,
5
+ 不会打架。
6
+
7
+ 对模块作者来说,这里是「不用自己重画」的那一层:卡片壳、行、表单、链接、加载态都在
8
+ `components/`,契约类型都在 `api/`。**dsh 有的原语走 kit,工作台自己的视觉用这里的组件**,
9
+ 两者拼出面板,不要从 DOM + CSS 重写一遍。
10
+
11
+ ## 三个入口
12
+
13
+ | 入口 | 谁用 | 有什么 |
14
+ |---|---|---|
15
+ | `@dsh-workbench/shared` | 浏览器侧 | 契约类型、纯函数、哑组件(样式随组件)、i18n、读通道 `apiGet` / `factOfRoute` |
16
+ | `@dsh-workbench/shared/host` | 宿主侧(Node) | 数据根、opencli 运行时、git、http、面板状态、单元声明、请求配方 composer、公共通道插件计划等,**有 `node:*`** |
17
+ | `@dsh-workbench/shared/testing` | 测试 | 宿主侧假件、从 `package.json` 读模块声明 |
18
+
19
+ 两条硬边界:
20
+
21
+ - **根入口是浏览器安全的**:不许出现 `node:*`。宿主侧取运行值只走 `/host`。
22
+ - **模块源码对根入口只许 `import type`**:取运行值会在浏览器里打进第二份实例,也会让
23
+ `dist/host.js` 在 Node 里 import 不进来。这条由 module-tools 的 `source` 判据盯着。
24
+
25
+ 组件样式与组件同目录(`X.css` / `X.module.css`),构建时原样搬到 `dist/` —— 消费方不用另配
26
+ CSS 处理。
27
+
28
+ ## 收录判据
29
+
30
+ 进这个包的东西要同时满足三条,缺一条就留在外壳里:
31
+
32
+ 1. **无模块级可变状态**:顶层 `let` / `var`、被写入的顶层 `Map` / `Set` 都不行。共享包会被每个
33
+ 消费者各打一份,带状态就是各说各话。`scripts/check-state.mjs` 守这一条。
34
+ 2. **不依赖外壳运行时**:不 import 外壳的代码、不假设自己在哪一列里渲染。
35
+ 3. **不产生全局副作用**:import 即注册、改全局、读环境都不行;要环境就从参数或 `/host` 进。
36
+
37
+ 判断不了就问一句:**这份东西被复制成两份,会有什么坏结果?** 答案不是「没有」就别放进来。
38
+
39
+ ## 目录
40
+
41
+ | 落点 | 是什么 |
42
+ |---|---|
43
+ | `src/api/` | 契约:单元清单、卡片面、读通道、写通道、长任务、审批、面板状态 |
44
+ | `src/components/` | 哑组件:`Card` / `CardHead` / `Rows` / `Form` / `FormRow(s)` / `FormActions` / `Link` / `Stack` / 各态块 |
45
+ | `src/config/` | 常量与存储键 |
46
+ | `src/i18n/` | zh / en 字典、合并与设置 |
47
+ | `src/lib/` | 纯函数:文本、忙碌态、表单问题、看板事实 |
48
+ | `src/host/` | 宿主侧内核与领域:http、facts、面板状态、workspace、单元声明 |
49
+ | `src/testing/` | 测试假件与声明读取 |
50
+
51
+ `src/index.ts` 与 `src/host.ts` 是**生成的 barrel**:新增文件后跑 `pnpm run barrels`,别手抄。
52
+ 它会拦重名导出(`export *` 会静默丢掉其中一个)。
53
+
54
+ ## 怎么用
55
+
56
+ ```ts
57
+ // 外壳
58
+ import { Card, Rows, type UnitManifest } from '@dsh-workbench/shared';
59
+ import { workbenchRoot } from '@dsh-workbench/shared/host';
60
+
61
+ // 模块
62
+ import type { UnitClientFace } from '@dsh-workbench/shared';
63
+ import { kit } from '@dsh-workbench/core/client';
64
+ ```
65
+
66
+ 规矩按调用方分:
67
+
68
+ - **外壳自己**从根入口取运行值(组件、`apiGet`…),它是这份代码的主人。
69
+ - **模块**的组件从 kit 取:`import { kit } from '@dsh-workbench/core/client'`,根入口只许
70
+ `import type`。宿主侧要运行值走 `/host`,浏览器侧要纯函数走 kit —— 两侧都不该从根入口取,
71
+ 否则浏览器会打进第二份实例、宿主侧会让 `dist/host.js` 在 Node 里 import 不进来。
72
+ - 模块里只取类型时写成单独一行 `import type { … }`,别和运行值混在一条语句里 ——
73
+ `source` 判据按语句判「是不是只取类型」。
74
+
75
+ 组件是**哑的**:props 进、界面出,不取数、不读宿主、不自己决定什么时候刷新。取数在外壳的
76
+ hooks 或模块自己的 `model/` 里,所以同一张卡片在真数据和夹具下长得一样。
77
+
78
+ ## 开发
79
+
80
+ ```bash
81
+ pnpm --filter @dsh-workbench/shared run build # tsc + 搬 CSS
82
+ pnpm --filter @dsh-workbench/shared run test
83
+ pnpm --filter @dsh-workbench/shared run selfcheck # check-state:无模块级可变状态
84
+ ```
85
+
86
+ 两个 barrel 用 `pnpm run barrels` 重生成;`pnpm run arch` 跑这个包自己的分层配置。
87
+ 代码零注释,只有公开成员的导出 JSDoc 例外(它会进 `.d.ts`,是给消费方看的)。
88
+
89
+ ## 相关文档
90
+
91
+ | 想了解 | 读 |
92
+ |---|---|
93
+ | 层序、两个运行时、槽位、数据通路 | [ARCHITECTURE.md](../../ARCHITECTURE.md) |
94
+ | 组件怎么选、kit 里有什么 | [KIT.md](../core/skills/workbench-module-diy/KIT.md) |
95
+ | 模块的构建与门禁 | [module-tools](../module-tools/README.md) |
96
+ | 最小模块样本 | [module-hello](../module-hello/README.md) |
97
+ | 环境与提交 | [CONTRIBUTING.md](../../CONTRIBUTING.md) |
@@ -1,7 +1,7 @@
1
- import type { Translate } from './dsh-client.js';
2
- import type { CapabilityPayload } from './workbench-contract.js';
1
+ import type { Translate } from '../lib/dsh-client.js';
2
+ import type { CapabilityPayload } from '../contract/workbench-contract.js';
3
3
  import type { ApiError } from './workbench-client.js';
4
- import type { ModuleBlocker } from './blocker.js';
4
+ import type { ModuleBlocker } from '../contract/blocker.js';
5
5
  /**
6
6
  * 把一次读失败翻成一张卡住态,交给卡片直接渲染。
7
7
  * @param error 读口回的错误;undefined 表示连错误都没拿到(多半是网络断,回「原因未知」)。
@@ -98,20 +98,23 @@ export function blockerOfError(error, t, context = {}) {
98
98
  export function blockerOfCapability(capability, t) {
99
99
  if (capability.status === 'ok')
100
100
  return undefined;
101
- const fixAction = capability.fix === undefined
101
+ const problem = capability.needs.find((need) => need.status !== 'ok');
102
+ const fix = problem?.provision === 'ready' ? 'install' : undefined;
103
+ const fixAction = fix === undefined
102
104
  ? undefined
103
105
  : {
104
106
  kind: 'run-fix',
105
- label: capability.fix === 'install' ? t('blocker.fix.install') : t('blocker.fix.update'),
107
+ label: t('blocker.fix.install'),
106
108
  unit: capability.unit,
107
- fix: capability.fix,
109
+ fix,
108
110
  };
109
- const sourceUnknown = capability.fix === undefined && capability.install !== undefined && capability.install !== 'ready';
111
+ const sourceUnknown = problem?.provision !== undefined && problem.provision !== 'ready';
110
112
  const install = [
111
113
  ...(fixAction === undefined ? [] : [fixAction]),
112
114
  ...(sourceUnknown ? [{ kind: 'open-market', label: t('blocker.market.open'), unit: capability.unit }] : []),
113
- ...(capability.command === undefined || sourceUnknown ? [] : [copyAction(t, capability.command)]),
115
+ ...(problem?.command === undefined || sourceUnknown ? [] : [copyAction(t, problem.command)]),
114
116
  ];
117
+ const detail = problem?.detail ?? capability.detail;
115
118
  if (capability.status === 'failed') {
116
119
  return {
117
120
  id: 'unit-mount-failed',
@@ -122,32 +125,53 @@ export function blockerOfCapability(capability, t) {
122
125
  actions: [retryAction(t)],
123
126
  };
124
127
  }
125
- if (capability.status === 'missing-plugin') {
128
+ if (capability.status === 'unsupported') {
126
129
  return {
127
- id: 'unit-missing-plugin',
130
+ id: 'unit-unsupported',
128
131
  severity: 'block',
129
- title: t('env.unit.missingPlugin'),
130
- hint: t('env.unit.hint'),
131
- ...(capability.detail === undefined ? {} : { detail: capability.detail }),
132
- actions: [...install, retryAction(t)],
132
+ title: t('env.unit.unsupported'),
133
+ hint: t('env.unit.unsupportedHint'),
134
+ ...(detail === undefined ? {} : { detail }),
135
+ actions: [retryAction(t)],
133
136
  };
134
137
  }
135
- if (capability.status === 'missing-commands') {
138
+ if (capability.status === 'degraded') {
136
139
  return {
137
- id: 'unit-missing-commands',
138
- severity: 'block',
139
- title: t('env.unit.missingCommands'),
140
- hint: t('env.unit.missingCommandsHint'),
140
+ id: 'unit-degraded',
141
+ severity: 'notice',
142
+ title: t('env.unit.degraded'),
143
+ hint: t('env.unit.degradedHint'),
144
+ ...(detail === undefined ? {} : { detail }),
145
+ actions: [retryAction(t)],
146
+ };
147
+ }
148
+ if (problem === undefined) {
149
+ return {
150
+ id: 'unit-unchecked',
151
+ severity: 'notice',
152
+ title: t('env.unit.unchecked'),
153
+ hint: t('env.unit.uncheckedHint'),
141
154
  ...(capability.detail === undefined ? {} : { detail: capability.detail }),
142
- actions: [...install, retryAction(t)],
155
+ actions: [retryAction(t)],
156
+ };
157
+ }
158
+ if (problem.status === 'unchecked') {
159
+ return {
160
+ id: 'unit-unchecked',
161
+ severity: 'notice',
162
+ title: t('env.unit.unchecked'),
163
+ hint: t('env.unit.uncheckedHint'),
164
+ ...(detail === undefined ? {} : { detail }),
165
+ actions: [retryAction(t)],
143
166
  };
144
167
  }
168
+ const kindTitle = `env.need.${problem.kind}.${problem.status}`;
145
169
  return {
146
- id: 'unit-unchecked',
147
- severity: 'notice',
148
- title: t('env.unit.unchecked'),
149
- hint: t('env.unit.uncheckedHint'),
150
- ...(capability.detail === undefined ? {} : { detail: capability.detail }),
151
- actions: [retryAction(t)],
170
+ id: `unit-need-${problem.kind}-${problem.status}`,
171
+ severity: 'block',
172
+ title: t(kindTitle),
173
+ hint: t(`env.need.${problem.kind}.hint`),
174
+ ...(detail === undefined ? {} : { detail }),
175
+ actions: [...install, retryAction(t)],
152
176
  };
153
177
  }
package/dist/api/dsh.d.ts CHANGED
@@ -115,7 +115,7 @@ export interface DshHostContext {
115
115
  messages?: readonly unknown[];
116
116
  }>): (() => void) | undefined;
117
117
  };
118
- get<T = unknown>(name: string): T | undefined;
118
+ get<T = unknown>(name: string, strict?: boolean): T | undefined;
119
119
  provide(name: string, value: unknown): () => void;
120
120
  effect(effect: () => void | (() => void), label?: string): () => void;
121
121
  inject(names: readonly string[], effect: (scoped: DshHostContext) => void): () => void;
@@ -222,6 +222,24 @@ export interface DshToolRunContext {
222
222
  } | undefined;
223
223
  } | undefined;
224
224
  }
225
+ /**
226
+ * dsh 的审批服务(服务名 `approval`):读一个会话此刻生效的审批策略。
227
+ * 方法可选:服务缺席或老版本没有它时,调用方必须当成「不知道」而不是「已关闭」。
228
+ */
229
+ export interface DshApprovalService {
230
+ effectivePolicy?(session: unknown): 'ask' | 'never' | undefined;
231
+ }
232
+ /**
233
+ * dsh 的沙箱策略服务(服务名 `sandboxPolicy`):按会话解析这次调用生效的文件边界。
234
+ * 方法可选:服务缺席或老版本没有它时,调用方必须当成「不知道」而不是「完全放行」。
235
+ */
236
+ export interface DshSandboxPolicy {
237
+ resolve?(request?: {
238
+ readonly session?: unknown;
239
+ }): {
240
+ readonly mode?: string;
241
+ } | undefined;
242
+ }
225
243
  /**
226
244
  * dsh 的工具表;register 回的清理函数负责在插件卸载时摘掉这条工具。
227
245
  */
@@ -1,15 +1,7 @@
1
- import type { ApiResponse } from './workbench-client.js';
2
1
  /**
3
2
  * 宿主写口的五条通道(偏好、动作、供给、工坊调试、工坊录制),是写路由的第一段。
4
3
  */
5
4
  export type WriteChannel = 'prefs' | 'actions' | 'provision' | 'diy-debug' | 'diy-record';
6
- /**
7
- * 由通道与资源拼出写路由。
8
- * @param channel 写通道。
9
- * @param resource 该通道下的资源名。
10
- * @returns 路由字符串;provision 只有一段,其余是 channel/resource。
11
- */
12
- export declare function writeRoute(channel: WriteChannel, resource: string): string;
13
5
  /**
14
6
  * 写通道统一的结果:成了带值,没成带一句能给人看的话(可选明细与帮助链接)。
15
7
  */
@@ -22,10 +14,3 @@ export type WriteOutcome<T> = {
22
14
  readonly detail?: string;
23
15
  readonly helpUrl?: string;
24
16
  };
25
- /**
26
- * 把写通道的响应翻成 WriteOutcome。
27
- * @param response 写口回的响应;null 表示请求本身没成(网络断了,宿主没答)。
28
- * @param networkText 拿不到任何服务端文案时兜底的那句。
29
- * @returns 失败时 message 优先用服务端自己的话,没有才用响应正文或 networkText。
30
- */
31
- export declare function writeOutcomeOf<T>(response: ApiResponse<T> | null, networkText: string): WriteOutcome<T>;
@@ -1,35 +1 @@
1
- /**
2
- * 由通道与资源拼出写路由。
3
- * @param channel 写通道。
4
- * @param resource 该通道下的资源名。
5
- * @returns 路由字符串;provision 只有一段,其余是 channel/resource。
6
- */
7
- export function writeRoute(channel, resource) {
8
- if (channel === 'provision')
9
- return 'provision';
10
- return `${channel}/${resource}`;
11
- }
12
- /**
13
- * 把写通道的响应翻成 WriteOutcome。
14
- * @param response 写口回的响应;null 表示请求本身没成(网络断了,宿主没答)。
15
- * @param networkText 拿不到任何服务端文案时兜底的那句。
16
- * @returns 失败时 message 优先用服务端自己的话,没有才用响应正文或 networkText。
17
- */
18
- export function writeOutcomeOf(response, networkText) {
19
- if (response === null)
20
- return { ok: false, message: networkText };
21
- if (!response.ok) {
22
- const box = response;
23
- const own = typeof box.error?.message === 'string' && box.error.message !== '' ? box.error.message : undefined;
24
- const fallback = typeof box.text === 'string' && box.text !== '' ? box.text : networkText;
25
- const detail = typeof box.error?.detail === 'string' ? box.error.detail : undefined;
26
- const helpUrl = typeof box.error?.helpUrl === 'string' && box.error.helpUrl !== '' ? box.error.helpUrl : undefined;
27
- return {
28
- ok: false,
29
- message: own ?? fallback,
30
- ...(detail === undefined ? {} : { detail }),
31
- ...(helpUrl === undefined ? {} : { helpUrl }),
32
- };
33
- }
34
- return { ok: true, value: response };
35
- }
1
+ export {};
@@ -14,7 +14,8 @@ export async function apiGet(route, query = {}, options = {}) {
14
14
  search.set(key, String(value));
15
15
  }
16
16
  const suffix = search.toString();
17
- const response = await fetch(`${API_PREFIX}/${route}${suffix ? `?${suffix}` : ''}`, {
17
+ const target = suffix === '' ? `${API_PREFIX}/${route}` : `${API_PREFIX}/${route}?${suffix}`;
18
+ const response = await fetch(target, {
18
19
  method: 'GET',
19
20
  headers: { accept: 'application/json' },
20
21
  ...(signal === undefined ? {} : { signal }),
@@ -1,4 +1,3 @@
1
-
2
1
  .wb-activityBlock {
3
2
  display: flex;
4
3
  flex-direction: column;
@@ -1,4 +1,3 @@
1
-
2
1
  .wb-approvalCommand {
3
2
  max-width: 100%;
4
- }
3
+ }
@@ -1,4 +1,4 @@
1
- import type { Translate } from '../api/dsh-client.js';
1
+ import type { Translate } from '../lib/dsh-client.js';
2
2
  import type { ApprovalInput, UnitClientFace } from '../components/board-module.js';
3
3
  import { type ReactNode } from '../lib/react.js';
4
4
  import './ApprovalDetail.css';
@@ -1,4 +1,3 @@
1
-
2
1
  .wb-approvalPlan {
3
2
  display: flex;
4
3
  flex-direction: column;
@@ -1,4 +1,3 @@
1
-
2
1
  .wb-card {
3
2
  border: 0.5px solid var(--dsw-alias-border-l3);
4
3
  border-radius: var(--dsw-radius-xl);
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from '../lib/react.js';
2
- import type { Translate } from '../api/dsh-client.js';
2
+ import type { Translate } from '../lib/dsh-client.js';
3
3
  import './Card.css';
4
4
  /**
5
5
  * `Card` 的契约:标题、刷新、卡片体,以及可整块替换的卡头。
@@ -1,4 +1,4 @@
1
- import type { Translate } from '../api/dsh-client.js';
1
+ import type { Translate } from '../lib/dsh-client.js';
2
2
  import type { ReactNode } from '../lib/react.js';
3
3
  import { Component } from '../lib/react.js';
4
4
  /**
@@ -1,4 +1,3 @@
1
-
2
1
  .wb-cardHead {
3
2
  display: flex;
4
3
  align-items: center;
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from '../lib/react.js';
2
- import type { Translate } from '../api/dsh-client.js';
2
+ import type { Translate } from '../lib/dsh-client.js';
3
3
  import './CardHead.css';
4
4
  /**
5
5
  * `CardHead` 的契约:标题、补充、刷新,外加齿轮与平台跳转两格。
@@ -1,4 +1,3 @@
1
-
2
1
  .wb-choiceMenu {
3
2
  display: flex;
4
3
  flex-direction: column;
@@ -180,4 +179,4 @@
180
179
  .wb-radio:focus-visible {
181
180
  outline: var(--dsw-focus-ring-width, var(--wb-len-2)) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
182
181
  outline-offset: 2px;
183
- }
182
+ }
@@ -23,7 +23,7 @@ export interface ConfirmBarProps {
23
23
  }
24
24
  /**
25
25
  * 「先问一句再动手」那一条:标题 + 说明 + 键值 + 失败那句 + 动作区,形状一次收口。
26
- * **要不要问**归调用点(ADR-0054 §2 规则三),这一件只回答"问的时候长什么样"。
26
+ * **要不要问**归调用点,这一件只回答"问的时候长什么样"。
27
27
  * @param props.title - 那一句问话("发布到 prod?")。
28
28
  * @param props.hint - 标题下面那句说明或正文;不给不占位。
29
29
  * @param props.rows - 键值两格(键值列宽与分隔线归 `Rows` / `Row`);不给或空数组不渲染。值那一格可以放控件。
@@ -5,7 +5,7 @@ import { Row, Rows } from './Rows.js';
5
5
  import './ConfirmBar.css';
6
6
  /**
7
7
  * 「先问一句再动手」那一条:标题 + 说明 + 键值 + 失败那句 + 动作区,形状一次收口。
8
- * **要不要问**归调用点(ADR-0054 §2 规则三),这一件只回答"问的时候长什么样"。
8
+ * **要不要问**归调用点,这一件只回答"问的时候长什么样"。
9
9
  * @param props.title - 那一句问话("发布到 prod?")。
10
10
  * @param props.hint - 标题下面那句说明或正文;不给不占位。
11
11
  * @param props.rows - 键值两格(键值列宽与分隔线归 `Rows` / `Row`);不给或空数组不渲染。值那一格可以放控件。
@@ -3,4 +3,4 @@
3
3
  flex-direction: column;
4
4
  gap: var(--wb-len-12);
5
5
  width: 100%;
6
- }
6
+ }
@@ -17,7 +17,7 @@ function reportExtraPrimaries(actions) {
17
17
  if (keys.length < 2)
18
18
  return;
19
19
  console.error(`[dsh-workbench] FormActions 一个区里出现了 ${keys.length} 颗 primary(${keys.join('、')})—— ` +
20
- '一个区只许一颗主操作(ADR-0054 §2 规则二):多余的这颗该改成 default');
20
+ '一个区只许一颗主操作:多余的这颗该改成 default');
21
21
  }
22
22
  function variantOf(kind) {
23
23
  if (kind === 'primary')
@@ -1,4 +1,3 @@
1
-
2
1
  .wb-longTask {
3
2
  padding-top: var(--wb-len-12);
4
3
  border-top: 0.5px solid var(--dsw-alias-border-l2);
@@ -97,4 +96,4 @@
97
96
  line-height: var(--wb-line-16);
98
97
  color: var(--dsw-alias-state-error-primary);
99
98
  overflow-wrap: anywhere;
100
- }
99
+ }
@@ -1,4 +1,4 @@
1
- import { type LongTaskStatus } from '../api/long-task.js';
1
+ import { type LongTaskStatus } from '../contract/long-task.js';
2
2
  import './LongTaskRow.css';
3
3
  /**
4
4
  * 长任务行尾的一个链接:地址与文字。
@@ -1,4 +1,4 @@
1
- import { longTaskDot, longTaskStopPress, longTaskStopStage, LONG_TASK_STOP_ARM_MS } from '../api/long-task.js';
1
+ import { longTaskDot, longTaskStopPress, longTaskStopStage, LONG_TASK_STOP_ARM_MS } from '../contract/long-task.js';
2
2
  import { Link } from './Link.js';
3
3
  import { Fragment, h, useEffect, useState } from '../lib/react.js';
4
4
  import { CodeBlock, DisclosureRow, IconCodeOutlineRegular, IconFlatListOutlineRegular, IconStopFillRegular, StateDot, } from '@deepseek-ai/dsh-client-ui-primitives';
@@ -1,4 +1,3 @@
1
-
2
1
  .wb-note {
3
2
  margin: 0;
4
3
  font-size: var(--dsw-font-xxs-12-font-size);
@@ -1,4 +1,3 @@
1
-
2
1
  .wb-centered.wb-centeredCompact {
3
2
  flex: none;
4
3
  min-height: 0;
@@ -1,4 +1,3 @@
1
-
2
1
  section.wb-settings {
3
2
  display: flex;
4
3
  flex-direction: column;
@@ -1,4 +1,3 @@
1
-
2
1
  .wb-spinner {
3
2
  display: inline-flex;
4
3
  align-items: center;
@@ -1,4 +1,3 @@
1
-
2
1
  .wb-stack {
3
2
  display: flex;
4
3
  flex-direction: column;
@@ -1,4 +1,3 @@
1
-
2
1
  .wb-stateBlock {
3
2
  display: flex;
4
3
  flex-direction: column;
@@ -1,7 +1,7 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { SessionsSnapshot, Translate, WorkspaceSnapshot, WorkspaceView } from '../api/dsh-client.js';
3
- import type { UnitManifest } from '../api/unit.js';
4
- import type { CapabilityPayload } from '../api/workbench-contract.js';
2
+ import type { SessionsSnapshot, Translate, WorkspaceSnapshot, WorkspaceView } from '../lib/dsh-client.js';
3
+ import type { UnitManifest } from '../contract/unit.js';
4
+ import type { CapabilityPayload } from '../contract/workbench-contract.js';
5
5
  import type { Dictionaries } from '../i18n/index.js';
6
6
  /**
7
7
  * 面板要跳去的一格:只用 `kind` 说去哪,具体负载由各 unit 自己约定。
@@ -11,7 +11,7 @@ export interface IconProps {
11
11
  */
12
12
  export declare function IconConversation({ size }: IconProps): JSX.Element;
13
13
  /**
14
- * 品牌标:侧栏顶上那枚工作台方块标;默认 24px(它是品牌物,别拿它当通用图标)。
14
+ * 品牌标:一台显示器里放着 dsh 的鲸鱼尾巴;默认 24px(它是品牌物,别拿它当通用图标)。
15
15
  * @param props.size - 边长像素,同时给 `width` 与 `height`。
16
16
  * @returns 一枚 `aria-hidden` 的 svg。
17
17
  */
@@ -28,12 +28,6 @@ export declare function IconOpencli({ size }: IconProps): JSX.Element;
28
28
  * @returns 一枚 `aria-hidden` 的 svg。
29
29
  */
30
30
  export declare function IconNpm({ size }: IconProps): JSX.Element;
31
- /**
32
- * 四宫格:"模块"这个概念的通用单色图标(侧栏、面板那颗钮、市场节的标题);默认 16px。
33
- * @param props.size - 边长像素,同时给 `width` 与 `height`。
34
- * @returns 一枚 `aria-hidden` 的 svg。
35
- */
36
- export declare function IconModules({ size }: IconProps): JSX.Element;
37
31
  /**
38
32
  * 模块类型标:渐变方块 + 白四宫格,用在"这是个模块"的行首;品牌物,颜色不跟主题走。默认 16px。
39
33
  * @param props.size - 边长像素,同时给 `width` 与 `height`。
@@ -11,15 +11,22 @@ export function IconConversation({ size = 16 }) {
11
11
  return (h(Shell, { size: size, strokeWidth: 1.3 },
12
12
  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" })));
13
13
  }
14
+ const BRAND_FRAME = 'M10 6H54A5 5 0 0 1 59 11V43A5 5 0 0 1 54 48H10A5 5 0 0 1 5 43V11A5 5 0 0 1 10 6Z M12 10H52A3 3 0 0 1 55 13V41A3 3 0 0 1 52 44H12A3 3 0 0 1 9 41V13A3 3 0 0 1 12 10Z';
15
+ const BRAND_TAIL = 'M8.844 13.742C8.967 12.328 8.45 10.4 8.45 9.65C8.45 8.94 8.88 8.43 9.6 8.43C11.285 8.43 12.106 8.281 12.685 8.104C13.71 7.791 14.585 6.768 15.055 5.945C15.137 5.803 14.99 5.641 14.829 5.671C13.829 5.86 12.828 5.376 11.827 4.978C10.659 4.514 9.491 4.707 8.935 4.876C8.805 4.915 8.658 4.819 8.636 4.686C8.468 3.643 7.405 2.615 5.498 2.238C4.54 2.048 3.748 1.574 3.347 1.202C3.252 1.113 3.088 1.125 3.03 1.242C2.628 2.059 2.168 3.82 5.248 6.115C5.82 6.494 6.31 6.785 6.574 7.637C6.72 8.104 6.157 9.168 6.061 9.368C5.157 11.27 5.089 12.19 4.926 13.742Z';
16
+ const BRAND_TAIL_TRANSFORM = 'translate(14.6263 10.5853) scale(1.95)';
14
17
  /**
15
- * 品牌标:侧栏顶上那枚工作台方块标;默认 24px(它是品牌物,别拿它当通用图标)。
18
+ * 品牌标:一台显示器里放着 dsh 的鲸鱼尾巴;默认 24px(它是品牌物,别拿它当通用图标)。
16
19
  * @param props.size - 边长像素,同时给 `width` 与 `height`。
17
20
  * @returns 一枚 `aria-hidden` 的 svg。
18
21
  */
19
22
  export function IconBrandMark({ size = 24 }) {
20
- return (h(Shell, { size: size, strokeWidth: 1.6, viewBox: "0 0 24 24" },
21
- h("rect", { x: 3, y: 3, width: 18, height: 18, rx: 5, stroke: "currentColor" }),
22
- h("path", { d: "M8 9.5h8M8 12.5h8M8 15.5h5", stroke: "currentColor", strokeLinecap: "round" })));
23
+ return (h(Shell, { size: size, viewBox: "0 0 64 64" },
24
+ h("path", { d: BRAND_FRAME, fill: "currentColor", fillRule: "evenodd" }),
25
+ h("rect", { x: 27.5, y: 48, width: 9, height: 4.75, fill: "currentColor" }),
26
+ h("rect", { x: 19, y: 52.75, width: 26, height: 4.75, rx: 2.375, fill: "currentColor" }),
27
+ h("g", { transform: BRAND_TAIL_TRANSFORM },
28
+ h("path", { d: BRAND_TAIL, fill: "currentColor" }),
29
+ h("circle", { cx: 6.885, cy: 13.742, r: 1.95, fill: "currentColor" }))));
23
30
  }
24
31
  /**
25
32
  * opencli 的标:包类型那一格用它;颜色写死的品牌物,不跟主题走。默认 16px。
@@ -45,18 +52,6 @@ export function IconNpm({ size = 16 }) {
45
52
  return (h(Shell, { size: size, viewBox: "0 0 1024 1024" },
46
53
  h("path", { d: "M64 337.76h896v298.72H512v49.792H312.896v-49.824H64z m49.792 248.928h99.552v-149.376h49.76v149.344h49.792v-199.104H113.792z m248.896-199.136v248.928h99.552v-49.792h99.552v-199.136z m99.552 49.792H512v99.584h-49.792z m149.344-49.792v199.136h99.552v-149.376h49.792v149.344h49.792v-149.344h49.792v149.344h49.792v-199.104z", fill: "#CB3837" })));
47
54
  }
48
- /**
49
- * 四宫格:"模块"这个概念的通用单色图标(侧栏、面板那颗钮、市场节的标题);默认 16px。
50
- * @param props.size - 边长像素,同时给 `width` 与 `height`。
51
- * @returns 一枚 `aria-hidden` 的 svg。
52
- */
53
- export function IconModules({ size = 16 }) {
54
- return (h("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" },
55
- h("rect", { x: "2.5", y: "2.5", width: "4.6", height: "4.6", rx: "1.2", stroke: "currentColor", strokeWidth: "1.2" }),
56
- h("rect", { x: "8.9", y: "2.5", width: "4.6", height: "4.6", rx: "1.2", stroke: "currentColor", strokeWidth: "1.2" }),
57
- h("rect", { x: "2.5", y: "8.9", width: "4.6", height: "4.6", rx: "1.2", stroke: "currentColor", strokeWidth: "1.2" }),
58
- h("rect", { x: "8.9", y: "8.9", width: "4.6", height: "4.6", rx: "1.2", stroke: "currentColor", strokeWidth: "1.2" })));
59
- }
60
55
  /**
61
56
  * 模块类型标:渐变方块 + 白四宫格,用在"这是个模块"的行首;品牌物,颜色不跟主题走。默认 16px。
62
57
  * @param props.size - 边长像素,同时给 `width` 与 `height`。
@@ -26,8 +26,8 @@ export declare const DIY_RECORD_ACT_PATH = "diy-record/act";
26
26
  export declare const PANEL_STATE_PREFIX = "/workbench/api/panel-state";
27
27
  /** 钉住的 opencli 插件版本:`opencli-runtime` 按它校验、取那一份。 */
28
28
  export declare const OPENCLI_PIN = "1.8.8";
29
- /** 缺陷看板套件的 dsh 服务名(`workbenchCodingIssues`):套件照它登记自己那份服务。 */
30
- export declare const CODING_ISSUES_SERVICE = "workbenchCodingIssues";
29
+ /** 缺陷看板套件的 dsh 服务名(`workbenchIssues`):套件照它登记自己那份服务。 */
30
+ export declare const ISSUES_SERVICE = "workbenchIssues";
31
31
  /** 面板套件的 dsh 服务名(`workbenchPanels`):宿主经它取套件公布的清单与订阅。 */
32
32
  export declare const PANELS_SERVICE = "workbenchPanels";
33
33
  /** 单元花名册服务的 dsh 服务名(`workbenchUnits`):模块经它认领自己的单元。 */
@@ -29,8 +29,8 @@ export const DIY_RECORD_ACT_PATH = `${DIY_RECORD_PATH}/act`;
29
29
  export const PANEL_STATE_PREFIX = `${API_PREFIX}/${PANEL_STATE_PATH}`;
30
30
  /** 钉住的 opencli 插件版本:`opencli-runtime` 按它校验、取那一份。 */
31
31
  export const OPENCLI_PIN = "1.8.8";
32
- /** 缺陷看板套件的 dsh 服务名(`workbenchCodingIssues`):套件照它登记自己那份服务。 */
33
- export const CODING_ISSUES_SERVICE = "workbenchCodingIssues";
32
+ /** 缺陷看板套件的 dsh 服务名(`workbenchIssues`):套件照它登记自己那份服务。 */
33
+ export const ISSUES_SERVICE = "workbenchIssues";
34
34
  /** 面板套件的 dsh 服务名(`workbenchPanels`):宿主经它取套件公布的清单与订阅。 */
35
35
  export const PANELS_SERVICE = "workbenchPanels";
36
36
  /** 单元花名册服务的 dsh 服务名(`workbenchUnits`):模块经它认领自己的单元。 */