hostlet 0.0.0-stage → 0.1.0-alpha.1

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 (512) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +233 -2
  3. package/bin/hostlet.js +61 -0
  4. package/console/app/api.js +1223 -0
  5. package/console/app/boot.js +165 -0
  6. package/console/app/cards.js +222 -0
  7. package/console/app/compose-quote.js +127 -0
  8. package/console/app/config-form.js +727 -0
  9. package/console/app/document-drafts.js +62 -0
  10. package/console/app/document-tools.mjs +67 -0
  11. package/console/app/documents.js +106 -0
  12. package/console/app/pages.js +6483 -0
  13. package/console/app/plugins.js +509 -0
  14. package/console/app/preview-tools.js +172 -0
  15. package/console/app/reference-labels.js +118 -0
  16. package/console/app/selection.js +372 -0
  17. package/console/app/store.js +57 -0
  18. package/console/app/text-anchor.js +26 -0
  19. package/console/app/topic-local.js +322 -0
  20. package/console/app/topic-nav.js +414 -0
  21. package/console/app/topic-status.js +109 -0
  22. package/console/app/views.js +43 -0
  23. package/console/apple-touch-icon.png +0 -0
  24. package/console/avatars/agy.svg +34 -0
  25. package/console/avatars/alhena.svg +36 -0
  26. package/console/avatars/castor.svg +38 -0
  27. package/console/avatars/claude.svg +34 -0
  28. package/console/avatars/codex.svg +34 -0
  29. package/console/avatars/devin.svg +34 -0
  30. package/console/avatars/echo.svg +34 -0
  31. package/console/avatars/kimi.svg +33 -0
  32. package/console/avatars/opencode.svg +33 -0
  33. package/console/avatars/pinion.svg +34 -0
  34. package/console/avatars/sprocket.svg +34 -0
  35. package/console/avatars/vela.svg +44 -0
  36. package/console/avatars/wasat.svg +38 -0
  37. package/console/clients/agy.svg +1 -0
  38. package/console/clients/claude.svg +1 -0
  39. package/console/clients/codex.svg +1 -0
  40. package/console/clients/devin.svg +1 -0
  41. package/console/clients/kimi.svg +1 -0
  42. package/console/clients/opencode.svg +1 -0
  43. package/console/favicon.ico +0 -0
  44. package/console/favicon.svg +16 -0
  45. package/console/index.html +99 -0
  46. package/console/pdl/engine/README.md +13 -0
  47. package/console/pdl/engine/anchor.js +195 -0
  48. package/console/pdl/engine/core.js +1340 -0
  49. package/console/pdl/engine/frame.js +1252 -0
  50. package/console/pdl/engine/i18n.js +67 -0
  51. package/console/pdl/engine/pdl-check.js +102 -0
  52. package/console/pdl/engine/pdl-doc.js +353 -0
  53. package/console/pdl/engine/pdl-view.js +280 -0
  54. package/console/pdl/engine/pdl.js +1064 -0
  55. package/console/pdl/engine/platform.js +18 -0
  56. package/console/pdl/engine/proj.js +279 -0
  57. package/console/pdl/engine/theme.js +176 -0
  58. package/console/pdl/engine/tree.js +171 -0
  59. package/console/pdl/engine/units.js +546 -0
  60. package/console/pdl/library/README.md +28 -0
  61. package/console/pdl/library/blocks.js +1512 -0
  62. package/console/pdl/library/buttons.js +86 -0
  63. package/console/pdl/library/capsules.js +130 -0
  64. package/console/pdl/library/charts.js +287 -0
  65. package/console/pdl/library/code.js +98 -0
  66. package/console/pdl/library/css/base.css +12 -0
  67. package/console/pdl/library/css/blocks.css +98 -0
  68. package/console/pdl/library/css/capsules.css +42 -0
  69. package/console/pdl/library/css/catalog-page.css +24 -0
  70. package/console/pdl/library/css/chat.css +100 -0
  71. package/console/pdl/library/css/composer-top.css +145 -0
  72. package/console/pdl/library/css/controls.css +195 -0
  73. package/console/pdl/library/css/drag.css +29 -0
  74. package/console/pdl/library/css/edit-layout.css +93 -0
  75. package/console/pdl/library/css/floating-window.css +30 -0
  76. package/console/pdl/library/css/hover.css +50 -0
  77. package/console/pdl/library/css/label-search.css +37 -0
  78. package/console/pdl/library/css/layers.css +43 -0
  79. package/console/pdl/library/css/library-parts.css +33 -0
  80. package/console/pdl/library/css/library.css +117 -0
  81. package/console/pdl/library/css/member-select.css +34 -0
  82. package/console/pdl/library/css/message.css +72 -0
  83. package/console/pdl/library/css/page.css +104 -0
  84. package/console/pdl/library/css/parts.css +338 -0
  85. package/console/pdl/library/css/responsive.css +40 -0
  86. package/console/pdl/library/css/roles.css +28 -0
  87. package/console/pdl/library/css/rows.css +231 -0
  88. package/console/pdl/library/css/settings-rows.css +37 -0
  89. package/console/pdl/library/css/shell.css +59 -0
  90. package/console/pdl/library/css/stream.css +296 -0
  91. package/console/pdl/library/css/theme-calculator.css +18 -0
  92. package/console/pdl/library/css/thumb-choice.css +69 -0
  93. package/console/pdl/library/css/tweaks.css +16 -0
  94. package/console/pdl/library/css/widgets.css +211 -0
  95. package/console/pdl/library/css/workbench.css +59 -0
  96. package/console/pdl/library/feedback.js +83 -0
  97. package/console/pdl/library/floating-window.mjs +100 -0
  98. package/console/pdl/library/fold.js +238 -0
  99. package/console/pdl/library/format.js +53 -0
  100. package/console/pdl/library/frames.js +123 -0
  101. package/console/pdl/library/icons.js +165 -0
  102. package/console/pdl/library/identity.js +149 -0
  103. package/console/pdl/library/inputs.js +801 -0
  104. package/console/pdl/library/label-search.js +214 -0
  105. package/console/pdl/library/markdown-text.js +115 -0
  106. package/console/pdl/library/markdown.js +150 -0
  107. package/console/pdl/library/media-viewer.js +293 -0
  108. package/console/pdl/library/member-select.mjs +32 -0
  109. package/console/pdl/library/message.js +105 -0
  110. package/console/pdl/library/motion.js +56 -0
  111. package/console/pdl/library/overlays.js +165 -0
  112. package/console/pdl/library/page.js +142 -0
  113. package/console/pdl/library/plugin-form.js +154 -0
  114. package/console/pdl/library/registry.js +198 -0
  115. package/console/pdl/library/rows.js +523 -0
  116. package/console/pdl/library/shell.js +151 -0
  117. package/console/pdl/library/stream.js +58 -0
  118. package/console/pdl/library/tabs.js +259 -0
  119. package/console/pdl/library/theme-calculator.js +300 -0
  120. package/console/pdl/library/widgets.js +114 -0
  121. package/console/pdl/load-order.json +74 -0
  122. package/console/pdl/platform/README.md +3 -0
  123. package/console/pdl/platform/rich-markdown.mjs +17 -0
  124. package/console/pdl/platform/web-links.js +26 -0
  125. package/console/pdl/platform/web.js +80 -0
  126. package/console/sdk-browser/mentions.d.mts +16 -0
  127. package/console/sdk-browser/mentions.mjs +84 -0
  128. package/console/theme/assets.js +21 -0
  129. package/console/theme/theme.json +9417 -0
  130. package/console/theme/tokens.json +444 -0
  131. package/dist/core/a2a.d.ts +288 -0
  132. package/dist/core/a2a.js +2197 -0
  133. package/dist/core/address.d.ts +34 -0
  134. package/dist/core/address.js +33 -0
  135. package/dist/core/approval-inputs.d.ts +17 -0
  136. package/dist/core/approval-inputs.js +70 -0
  137. package/dist/core/archive.d.ts +19 -0
  138. package/dist/core/archive.js +135 -0
  139. package/dist/core/attachments.d.ts +17 -0
  140. package/dist/core/attachments.js +143 -0
  141. package/dist/core/blocked-handoffs.d.ts +132 -0
  142. package/dist/core/blocked-handoffs.js +349 -0
  143. package/dist/core/config-schema.d.ts +124 -0
  144. package/dist/core/config-schema.js +192 -0
  145. package/dist/core/config.d.ts +117 -0
  146. package/dist/core/config.js +638 -0
  147. package/dist/core/disk-usage.d.ts +26 -0
  148. package/dist/core/disk-usage.js +83 -0
  149. package/dist/core/documents.d.ts +9 -0
  150. package/dist/core/documents.js +48 -0
  151. package/dist/core/entry.d.ts +316 -0
  152. package/dist/core/entry.js +711 -0
  153. package/dist/core/home.d.ts +76 -0
  154. package/dist/core/home.js +449 -0
  155. package/dist/core/i18n.d.ts +36 -0
  156. package/dist/core/i18n.js +458 -0
  157. package/dist/core/instances.d.ts +224 -0
  158. package/dist/core/instances.js +1272 -0
  159. package/dist/core/members.d.ts +190 -0
  160. package/dist/core/members.js +358 -0
  161. package/dist/core/mentions.d.ts +12 -0
  162. package/dist/core/mentions.js +49 -0
  163. package/dist/core/messages.d.ts +876 -0
  164. package/dist/core/messages.js +916 -0
  165. package/dist/core/notices.d.ts +88 -0
  166. package/dist/core/notices.js +54 -0
  167. package/dist/core/ops.d.ts +117 -0
  168. package/dist/core/ops.js +146 -0
  169. package/dist/core/package.d.ts +2 -0
  170. package/dist/core/package.js +14 -0
  171. package/dist/core/parts.d.ts +25 -0
  172. package/dist/core/parts.js +119 -0
  173. package/dist/core/plugins/catalog.d.ts +14 -0
  174. package/dist/core/plugins/catalog.js +54 -0
  175. package/dist/core/plugins/external.d.ts +7 -0
  176. package/dist/core/plugins/external.js +921 -0
  177. package/dist/core/plugins/index.d.ts +5 -0
  178. package/dist/core/plugins/index.js +51 -0
  179. package/dist/core/plugins/npm.d.ts +12 -0
  180. package/dist/core/plugins/npm.js +99 -0
  181. package/dist/core/plugins/plugin-manifest.d.ts +12 -0
  182. package/dist/core/plugins/plugin-manifest.js +231 -0
  183. package/dist/core/push.d.ts +22 -0
  184. package/dist/core/push.js +63 -0
  185. package/dist/core/resource.d.ts +77 -0
  186. package/dist/core/resource.js +48 -0
  187. package/dist/core/spawn.d.ts +12 -0
  188. package/dist/core/spawn.js +30 -0
  189. package/dist/core/storage-inventory.d.ts +118 -0
  190. package/dist/core/storage-inventory.js +279 -0
  191. package/dist/core/storage.d.ts +45 -0
  192. package/dist/core/storage.js +602 -0
  193. package/dist/core/store.d.ts +15 -0
  194. package/dist/core/store.js +33 -0
  195. package/dist/core/topic-index.d.ts +19 -0
  196. package/dist/core/topic-index.js +70 -0
  197. package/dist/core/topic-ops.d.ts +139 -0
  198. package/dist/core/topic-ops.js +507 -0
  199. package/dist/core/topic-status.d.ts +32 -0
  200. package/dist/core/topic-status.js +105 -0
  201. package/dist/core/topics.d.ts +327 -0
  202. package/dist/core/topics.js +786 -0
  203. package/dist/core/turn-clients.d.ts +1 -0
  204. package/dist/core/turn-clients.js +5 -0
  205. package/dist/core/types.d.ts +2866 -0
  206. package/dist/core/types.js +166 -0
  207. package/dist/core/util.d.ts +10 -0
  208. package/dist/core/util.js +47 -0
  209. package/dist/main.d.ts +12 -0
  210. package/dist/main.js +82 -0
  211. package/dist/plugins/adapter-acp/index.d.ts +3 -0
  212. package/dist/plugins/adapter-acp/index.js +57 -0
  213. package/dist/plugins/adapter-acp/plugin.yaml +100 -0
  214. package/dist/plugins/adapter-agy/command.d.ts +9 -0
  215. package/dist/plugins/adapter-agy/command.js +34 -0
  216. package/dist/plugins/adapter-agy/index.d.ts +5 -0
  217. package/dist/plugins/adapter-agy/index.js +65 -0
  218. package/dist/plugins/adapter-agy/quota.d.ts +2 -0
  219. package/dist/plugins/adapter-agy/quota.js +155 -0
  220. package/dist/plugins/adapter-agy/terminal.d.ts +6 -0
  221. package/dist/plugins/adapter-agy/terminal.js +132 -0
  222. package/dist/plugins/adapter-agy/version.d.ts +9 -0
  223. package/dist/plugins/adapter-agy/version.js +17 -0
  224. package/dist/plugins/adapter-claude/index.d.ts +43 -0
  225. package/dist/plugins/adapter-claude/index.js +412 -0
  226. package/dist/plugins/adapter-claude/quota.d.ts +14 -0
  227. package/dist/plugins/adapter-claude/quota.js +103 -0
  228. package/dist/plugins/adapter-codex/index.d.ts +4 -0
  229. package/dist/plugins/adapter-codex/index.js +688 -0
  230. package/dist/plugins/adapter-codex/responses-model.d.ts +9 -0
  231. package/dist/plugins/adapter-codex/responses-model.js +82 -0
  232. package/dist/plugins/adapter-kimi/index.d.ts +4 -0
  233. package/dist/plugins/adapter-kimi/index.js +51 -0
  234. package/dist/plugins/adapter-kimi/quota.d.ts +3 -0
  235. package/dist/plugins/adapter-kimi/quota.js +171 -0
  236. package/dist/plugins/adapter-opencode/index.d.ts +12 -0
  237. package/dist/plugins/adapter-opencode/index.js +64 -0
  238. package/dist/plugins/annotations/console/cards.css +189 -0
  239. package/dist/plugins/annotations/console/cards.mjs +439 -0
  240. package/dist/plugins/annotations/console/pdl.json +52 -0
  241. package/dist/plugins/annotations/console/view.mjs +241 -0
  242. package/dist/plugins/annotations/console/window.mjs +219 -0
  243. package/dist/plugins/annotations/followups.d.ts +51 -0
  244. package/dist/plugins/annotations/followups.js +112 -0
  245. package/dist/plugins/annotations/index.d.ts +3 -0
  246. package/dist/plugins/annotations/index.js +298 -0
  247. package/dist/plugins/annotations/plugin.yaml +3 -0
  248. package/dist/plugins/ask-choice/index.d.ts +9 -0
  249. package/dist/plugins/ask-choice/index.js +24 -0
  250. package/dist/plugins/ask-choice/plugin.yaml +2 -0
  251. package/dist/plugins/background/index.d.ts +2 -0
  252. package/dist/plugins/background/index.js +398 -0
  253. package/dist/plugins/background/plugin.yaml +7 -0
  254. package/dist/plugins/builtin.json +37 -0
  255. package/dist/plugins/cards/console/pdl.json +516 -0
  256. package/dist/plugins/cards/console/view.mjs +67 -0
  257. package/dist/plugins/cards/index.d.ts +8 -0
  258. package/dist/plugins/cards/index.js +627 -0
  259. package/dist/plugins/cards/plugin.yaml +3 -0
  260. package/dist/plugins/console/browser.d.ts +2 -0
  261. package/dist/plugins/console/browser.js +115 -0
  262. package/dist/plugins/console/console/pdl.json +38 -0
  263. package/dist/plugins/console/console/view.mjs +26 -0
  264. package/dist/plugins/console/index.d.ts +4 -0
  265. package/dist/plugins/console/index.js +94 -0
  266. package/dist/plugins/console/picker.d.ts +2 -0
  267. package/dist/plugins/console/picker.js +48 -0
  268. package/dist/plugins/console/plugin.yaml +3 -0
  269. package/dist/plugins/console/topic-view.d.ts +3 -0
  270. package/dist/plugins/console/topic-view.js +388 -0
  271. package/dist/plugins/handoff/index.d.ts +2 -0
  272. package/dist/plugins/handoff/index.js +147 -0
  273. package/dist/plugins/handoff/plugin.yaml +8 -0
  274. package/dist/plugins/host-api/index.d.ts +7 -0
  275. package/dist/plugins/host-api/index.js +310 -0
  276. package/dist/plugins/host-api/plugin.yaml +2 -0
  277. package/dist/plugins/host-api/signing.d.ts +63 -0
  278. package/dist/plugins/host-api/signing.js +427 -0
  279. package/dist/plugins/host-api/skills/host-ops/SKILL.md +28 -0
  280. package/dist/plugins/host-api/skills/hostlet-plugin-dev/SKILL.md +38 -0
  281. package/dist/plugins/inbox/index.d.ts +15 -0
  282. package/dist/plugins/inbox/index.js +161 -0
  283. package/dist/plugins/inbox/plugin.yaml +2 -0
  284. package/dist/plugins/keys/account-directories.d.ts +18 -0
  285. package/dist/plugins/keys/account-directories.js +86 -0
  286. package/dist/plugins/keys/account-storage.d.ts +18 -0
  287. package/dist/plugins/keys/account-storage.js +112 -0
  288. package/dist/plugins/keys/console/pdl.json +710 -0
  289. package/dist/plugins/keys/console/view.mjs +619 -0
  290. package/dist/plugins/keys/index.d.ts +7 -0
  291. package/dist/plugins/keys/index.js +842 -0
  292. package/dist/plugins/keys/login-link.d.ts +2 -0
  293. package/dist/plugins/keys/login-link.js +15 -0
  294. package/dist/plugins/keys/plugin.yaml +3 -0
  295. package/dist/plugins/keys/quota-history.d.ts +91 -0
  296. package/dist/plugins/keys/quota-history.js +420 -0
  297. package/dist/plugins/mcp/console/pdl.json +412 -0
  298. package/dist/plugins/mcp/console/view.mjs +207 -0
  299. package/dist/plugins/mcp/index.d.ts +7 -0
  300. package/dist/plugins/mcp/index.js +494 -0
  301. package/dist/plugins/mcp/plugin.yaml +3 -0
  302. package/dist/plugins/member-health/index.d.ts +2 -0
  303. package/dist/plugins/member-health/index.js +478 -0
  304. package/dist/plugins/member-health/plugin.yaml +2 -0
  305. package/dist/plugins/memory/capabilities.d.ts +10 -0
  306. package/dist/plugins/memory/capabilities.js +70 -0
  307. package/dist/plugins/memory/console/pdl.json +459 -0
  308. package/dist/plugins/memory/console/view.mjs +254 -0
  309. package/dist/plugins/memory/corpus.d.ts +60 -0
  310. package/dist/plugins/memory/corpus.js +521 -0
  311. package/dist/plugins/memory/engines/fts-tree-diversity.d.ts +8 -0
  312. package/dist/plugins/memory/engines/fts-tree-diversity.js +49 -0
  313. package/dist/plugins/memory/engines/fts-tree-text.d.ts +12 -0
  314. package/dist/plugins/memory/engines/fts-tree-text.js +93 -0
  315. package/dist/plugins/memory/engines/fts-tree.d.ts +4 -0
  316. package/dist/plugins/memory/engines/fts-tree.js +387 -0
  317. package/dist/plugins/memory/engines/search.d.ts +9 -0
  318. package/dist/plugins/memory/engines/search.js +35 -0
  319. package/dist/plugins/memory/index.d.ts +3 -0
  320. package/dist/plugins/memory/index.js +465 -0
  321. package/dist/plugins/memory/notes.d.ts +22 -0
  322. package/dist/plugins/memory/notes.js +140 -0
  323. package/dist/plugins/memory/plugin.yaml +23 -0
  324. package/dist/plugins/model-profiles/index.d.ts +2 -0
  325. package/dist/plugins/model-profiles/index.js +916 -0
  326. package/dist/plugins/model-profiles/plugin.yaml +13 -0
  327. package/dist/plugins/model-profiles/review-source.d.ts +11 -0
  328. package/dist/plugins/model-profiles/review-source.js +640 -0
  329. package/dist/plugins/model-profiles/rules.d.ts +130 -0
  330. package/dist/plugins/model-profiles/rules.js +729 -0
  331. package/dist/plugins/model-profiles/skills/model-profile/SKILL.md +59 -0
  332. package/dist/plugins/model-profiles/sources.d.ts +61 -0
  333. package/dist/plugins/model-profiles/sources.js +375 -0
  334. package/dist/plugins/model-profiles/storage.d.ts +84 -0
  335. package/dist/plugins/model-profiles/storage.js +315 -0
  336. package/dist/plugins/model-profiles/types.d.ts +179 -0
  337. package/dist/plugins/model-profiles/types.js +12 -0
  338. package/dist/plugins/model-profiles/wakeup.d.ts +29 -0
  339. package/dist/plugins/model-profiles/wakeup.js +390 -0
  340. package/dist/plugins/models/index.d.ts +2 -0
  341. package/dist/plugins/models/index.js +63 -0
  342. package/dist/plugins/models/plugin.yaml +8 -0
  343. package/dist/plugins/ops/collector.d.ts +22 -0
  344. package/dist/plugins/ops/collector.js +48 -0
  345. package/dist/plugins/ops/config.d.ts +11 -0
  346. package/dist/plugins/ops/config.js +13 -0
  347. package/dist/plugins/ops/console/pdl.json +676 -0
  348. package/dist/plugins/ops/console/view.mjs +700 -0
  349. package/dist/plugins/ops/index.d.ts +3 -0
  350. package/dist/plugins/ops/index.js +20 -0
  351. package/dist/plugins/ops/journal.d.ts +7 -0
  352. package/dist/plugins/ops/journal.js +109 -0
  353. package/dist/plugins/ops/metrics.d.ts +3 -0
  354. package/dist/plugins/ops/metrics.js +81 -0
  355. package/dist/plugins/ops/plugin.yaml +63 -0
  356. package/dist/plugins/ops/samples.d.ts +54 -0
  357. package/dist/plugins/ops/samples.js +100 -0
  358. package/dist/plugins/ops/trace.d.ts +3 -0
  359. package/dist/plugins/ops/trace.js +104 -0
  360. package/dist/plugins/ops/usage.d.ts +2 -0
  361. package/dist/plugins/ops/usage.js +152 -0
  362. package/dist/plugins/plans/acceptance.d.ts +284 -0
  363. package/dist/plugins/plans/acceptance.js +247 -0
  364. package/dist/plugins/plans/blocked.d.ts +25 -0
  365. package/dist/plugins/plans/blocked.js +66 -0
  366. package/dist/plugins/plans/console/pdl.json +639 -0
  367. package/dist/plugins/plans/console/view.d.mts +2 -0
  368. package/dist/plugins/plans/console/view.mjs +855 -0
  369. package/dist/plugins/plans/dependencies.d.ts +5 -0
  370. package/dist/plugins/plans/dependencies.js +21 -0
  371. package/dist/plugins/plans/index.d.ts +72 -0
  372. package/dist/plugins/plans/index.js +2057 -0
  373. package/dist/plugins/plans/plugin.yaml +44 -0
  374. package/dist/plugins/plans/progress.d.ts +82 -0
  375. package/dist/plugins/plans/progress.js +516 -0
  376. package/dist/plugins/prompt/index.d.ts +8 -0
  377. package/dist/plugins/prompt/index.js +361 -0
  378. package/dist/plugins/prompt/plugin.yaml +2 -0
  379. package/dist/plugins/recovery/console/pdl.json +50 -0
  380. package/dist/plugins/recovery/console/view.mjs +46 -0
  381. package/dist/plugins/recovery/index.d.ts +9 -0
  382. package/dist/plugins/recovery/index.js +454 -0
  383. package/dist/plugins/recovery/plugin.yaml +9 -0
  384. package/dist/plugins/recovery/probe.d.ts +11 -0
  385. package/dist/plugins/recovery/probe.js +128 -0
  386. package/dist/plugins/restart/console/pdl.json +112 -0
  387. package/dist/plugins/restart/console/view.mjs +85 -0
  388. package/dist/plugins/restart/index.d.ts +10 -0
  389. package/dist/plugins/restart/index.js +669 -0
  390. package/dist/plugins/restart/plugin.yaml +9 -0
  391. package/dist/plugins/restart/scope.d.ts +6 -0
  392. package/dist/plugins/restart/scope.js +44 -0
  393. package/dist/plugins/schedule/console/pdl.json +696 -0
  394. package/dist/plugins/schedule/console/view.mjs +398 -0
  395. package/dist/plugins/schedule/events.d.ts +76 -0
  396. package/dist/plugins/schedule/events.js +158 -0
  397. package/dist/plugins/schedule/index.d.ts +32 -0
  398. package/dist/plugins/schedule/index.js +1199 -0
  399. package/dist/plugins/schedule/plugin.yaml +26 -0
  400. package/dist/plugins/schedule/when.d.ts +14 -0
  401. package/dist/plugins/schedule/when.js +83 -0
  402. package/dist/plugins/sessions/console/pdl.json +259 -0
  403. package/dist/plugins/sessions/console/view.mjs +355 -0
  404. package/dist/plugins/sessions/index.d.ts +3 -0
  405. package/dist/plugins/sessions/index.js +126 -0
  406. package/dist/plugins/sessions/participants.d.ts +28 -0
  407. package/dist/plugins/sessions/participants.js +83 -0
  408. package/dist/plugins/sessions/plugin.yaml +3 -0
  409. package/dist/plugins/signals/console/pdl.json +802 -0
  410. package/dist/plugins/signals/console/view.mjs +284 -0
  411. package/dist/plugins/signals/content.d.ts +31 -0
  412. package/dist/plugins/signals/content.js +151 -0
  413. package/dist/plugins/signals/index.d.ts +2 -0
  414. package/dist/plugins/signals/index.js +601 -0
  415. package/dist/plugins/signals/plugin.yaml +32 -0
  416. package/dist/plugins/signals/skills/signal-sources/SKILL.md +27 -0
  417. package/dist/plugins/skills/console/pdl.json +254 -0
  418. package/dist/plugins/skills/console/view.mjs +204 -0
  419. package/dist/plugins/skills/index.d.ts +11 -0
  420. package/dist/plugins/skills/index.js +567 -0
  421. package/dist/plugins/skills/install.d.ts +69 -0
  422. package/dist/plugins/skills/install.js +265 -0
  423. package/dist/plugins/skills/plugin.yaml +24 -0
  424. package/dist/plugins/skills/safety-scan.d.ts +17 -0
  425. package/dist/plugins/skills/safety-scan.js +78 -0
  426. package/dist/plugins/skills/skills/skill-ops/SKILL.md +29 -0
  427. package/dist/plugins/terminal/console/pdl.json +115 -0
  428. package/dist/plugins/terminal/console/view.mjs +178 -0
  429. package/dist/plugins/terminal/index.d.ts +3 -0
  430. package/dist/plugins/terminal/index.js +204 -0
  431. package/dist/plugins/terminal/plugin.yaml +2 -0
  432. package/dist/plugins/tools/index.d.ts +3 -0
  433. package/dist/plugins/tools/index.js +455 -0
  434. package/dist/plugins/tools/plugin.yaml +2 -0
  435. package/dist/plugins/tools/token.d.ts +61 -0
  436. package/dist/plugins/tools/token.js +179 -0
  437. package/dist/plugins/topic-tools/index.d.ts +9 -0
  438. package/dist/plugins/topic-tools/index.js +29 -0
  439. package/dist/plugins/topic-tools/plugin.yaml +2 -0
  440. package/dist/plugins/topic-tools/skills/topic-tidy/SKILL.md +108 -0
  441. package/dist/plugins/works/console/pdl.json +120 -0
  442. package/dist/plugins/works/console/view.mjs +91 -0
  443. package/dist/plugins/works/document-words.d.ts +50 -0
  444. package/dist/plugins/works/document-words.js +27 -0
  445. package/dist/plugins/works/editors.d.ts +3 -0
  446. package/dist/plugins/works/editors.js +162 -0
  447. package/dist/plugins/works/events.d.ts +58 -0
  448. package/dist/plugins/works/events.js +82 -0
  449. package/dist/plugins/works/files.d.ts +23 -0
  450. package/dist/plugins/works/files.js +53 -0
  451. package/dist/plugins/works/index.d.ts +9 -0
  452. package/dist/plugins/works/index.js +1088 -0
  453. package/dist/plugins/works/plugin.yaml +9 -0
  454. package/dist/plugins/works/preview.d.ts +10 -0
  455. package/dist/plugins/works/preview.js +30 -0
  456. package/dist/plugins/works/project.d.ts +3 -0
  457. package/dist/plugins/works/project.js +245 -0
  458. package/dist/plugins/works/resource.d.ts +28 -0
  459. package/dist/plugins/works/resource.js +71 -0
  460. package/dist/plugins/works/retention.d.ts +36 -0
  461. package/dist/plugins/works/retention.js +295 -0
  462. package/dist/plugins/works/skills/works-ops/SKILL.md +14 -0
  463. package/dist/plugins/works/viewers.d.ts +13 -0
  464. package/dist/plugins/works/viewers.js +87 -0
  465. package/dist/plugins/works/web/anchors.js +94 -0
  466. package/dist/plugins/works/web/document-edit.js +245 -0
  467. package/dist/plugins/works/web/preview-bridge.js +142 -0
  468. package/dist/plugins/works/web/reading-position.js +74 -0
  469. package/dist/plugins/works/web/view.html +1118 -0
  470. package/dist/runtime/runtime.d.ts +210 -0
  471. package/dist/runtime/runtime.js +338 -0
  472. package/dist/sdk/adapter-kit.d.ts +1 -0
  473. package/dist/sdk/adapter-kit.js +1 -0
  474. package/dist/sdk/client.d.ts +163 -0
  475. package/dist/sdk/client.js +43 -0
  476. package/dist/sdk/contracts.d.ts +1263 -0
  477. package/dist/sdk/contracts.js +1 -0
  478. package/dist/sdk/index.d.ts +57 -0
  479. package/dist/sdk/index.js +27 -0
  480. package/dist/sdk/source-choice.d.ts +40 -0
  481. package/dist/sdk/source-choice.js +217 -0
  482. package/dist/sdk/topic-text.d.ts +5 -0
  483. package/dist/sdk/topic-text.js +26 -0
  484. package/dist/sdk/transport.d.ts +12 -0
  485. package/dist/sdk/transport.js +34 -0
  486. package/node_modules/@hostlet/adapter-kit/dist/acp.d.ts +88 -0
  487. package/node_modules/@hostlet/adapter-kit/dist/acp.js +674 -0
  488. package/node_modules/@hostlet/adapter-kit/dist/command.d.ts +18 -0
  489. package/node_modules/@hostlet/adapter-kit/dist/command.js +39 -0
  490. package/node_modules/@hostlet/adapter-kit/dist/index.d.ts +8 -0
  491. package/node_modules/@hostlet/adapter-kit/dist/index.js +6 -0
  492. package/node_modules/@hostlet/adapter-kit/dist/models.d.ts +29 -0
  493. package/node_modules/@hostlet/adapter-kit/dist/models.js +108 -0
  494. package/node_modules/@hostlet/adapter-kit/dist/quota.d.ts +3 -0
  495. package/node_modules/@hostlet/adapter-kit/dist/quota.js +4 -0
  496. package/node_modules/@hostlet/adapter-kit/dist/rpc.d.ts +29 -0
  497. package/node_modules/@hostlet/adapter-kit/dist/rpc.js +84 -0
  498. package/node_modules/@hostlet/adapter-kit/dist/upstream-failure.d.ts +5 -0
  499. package/node_modules/@hostlet/adapter-kit/dist/upstream-failure.js +37 -0
  500. package/node_modules/@hostlet/adapter-kit/package.json +16 -0
  501. package/node_modules/@hostlet/platform/dist/desktop.d.ts +16 -0
  502. package/node_modules/@hostlet/platform/dist/desktop.js +270 -0
  503. package/node_modules/@hostlet/platform/dist/files.d.ts +24 -0
  504. package/node_modules/@hostlet/platform/dist/files.js +113 -0
  505. package/node_modules/@hostlet/platform/dist/index.d.ts +6 -0
  506. package/node_modules/@hostlet/platform/dist/index.js +4 -0
  507. package/node_modules/@hostlet/platform/dist/paths.d.ts +4 -0
  508. package/node_modules/@hostlet/platform/dist/paths.js +9 -0
  509. package/node_modules/@hostlet/platform/dist/process.d.ts +45 -0
  510. package/node_modules/@hostlet/platform/dist/process.js +297 -0
  511. package/node_modules/@hostlet/platform/package.json +14 -0
  512. package/package.json +60 -4
@@ -0,0 +1,165 @@
1
+ /* 边界:一个含义一个组件、不为接口定制、不按位置推导样式 */
2
+ /* 图标:图形登记与 icon() 一种画法 */
3
+ /* 图标登记(组件库的一部分,只有这一处):键是图形名,含义 → 图形在 frame.js 的 ICON_MEANING。
4
+ 一个含义只对应一个图形;同一个图形不登记两个名字 */
5
+ 'use strict';
6
+ const ICONS = {
7
+ markupArrow: '<path d="M5 19 19 5M9 5h10v10"/>',
8
+ markupText: '<path d="M4 5h16M12 5v14M8 19h8M4 5v3M20 5v3"/>',
9
+ copy: "<rect x=\"9\" y=\"9\" width=\"12\" height=\"12\" rx=\"2\"/><path d=\"M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1\"/>",
10
+ refresh: "<path d=\"M21 12a9 9 0 1 1-2.6-6.4L21 8\"/><path d=\"M21 3v5h-5\"/>",
11
+ select: "<rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"3\"/><path d=\"m8 12 3 3 5-6\"/>",
12
+ speaker: "<path d=\"M11 5 6 9H3v6h3l5 4z\"/><path d=\"M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13\"/>",
13
+ move: "<path d=\"M12 3v18M3 12h18\"/><path d=\"m9 6 3-3 3 3M9 18l3 3 3-3M6 9l-3 3 3 3M18 9l3 3-3 3\"/>",
14
+ branch: "<circle cx=\"6\" cy=\"5\" r=\"2\"/><circle cx=\"6\" cy=\"19\" r=\"2\"/><circle cx=\"18\" cy=\"7\" r=\"2\"/><path d=\"M6 7v10M18 9c0 4-5 4-11 8\"/>",
15
+ star: "<path d=\"m12 3 2.8 5.7 6.2.9-4.5 4.4 1.1 6.2L12 17.3 6.4 20.2l1.1-6.2L3 9.6l6.2-.9z\"/>",
16
+ folder: "<path d=\"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\"/>",
17
+ forward: "<path d=\"m15 14 5-5-5-5\"/><path d=\"M20 9H10a6 6 0 0 0-6 6v4\"/>",
18
+ relayIn: "<path d=\"M17 7 7 17\"/><path d=\"M15 17H7V9\"/>",
19
+ relayOut: "<path d=\"M7 17 17 7\"/><path d=\"M9 7h8v8\"/>",
20
+ locate: "<circle cx=\"12\" cy=\"12\" r=\"8\"/><path d=\"M12 4v4M12 16v4M4 12h4M16 12h4\"/>",
21
+ download: "<path d=\"M12 4v11M7 10l5 5 5-5\"/><path d=\"M4 20h16\"/>",
22
+ file: "<path d=\"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z\"/><path d=\"M14 3v6h6\"/>",
23
+ play: "<path d=\"M7 4v16l13-8z\"/>",
24
+ pause: "<path d=\"M7 4h4v16H7zM14 4h4v16h-4z\"/>",
25
+ flag: "<path d=\"M5 21V4M5 4h11l-2 4 2 4H5\"/>",
26
+ link: "<path d=\"M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7\"/><path d=\"M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7\"/>",
27
+ ext: "<path d=\"M14 4h6v6M20 4l-9 9\"/><path d=\"M19 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h5\"/>",
28
+ tag: "<path d=\"M3 12V4a1 1 0 0 1 1-1h8l9 9-9 9z\"/><circle cx=\"8\" cy=\"8\" r=\"1.5\"/>",
29
+ hash: "<path d=\"M5 9h14M5 15h14M10 4 8 20M16 4l-2 16\"/>",
30
+ at: "<circle cx=\"12\" cy=\"12\" r=\"4\"/><path d=\"M16 12v1.5a2.5 2.5 0 0 0 5 0V12a9 9 0 1 0-3.5 7.1\"/>",
31
+ slash: "<path d=\"M16 3 8 21\"/>",
32
+ whisper: "<path d=\"M4 5h16v11H8l-4 4z\"/><path d=\"M9 10h.01M12 10h.01M15 10h.01\"/>",
33
+ game: "<rect x=\"2\" y=\"7\" width=\"20\" height=\"11\" rx=\"4\"/><path d=\"M7 11v3M5.5 12.5h3M15 12h.01M18 13h.01\"/>",
34
+ send2: "<path d=\"M4 12h12M12 6l6 6-6 6\"/>",
35
+ arrowdown: "<path d=\"M12 5v14M5 12l7 7 7-7\"/>",
36
+ sun2: "<circle cx=\"12\" cy=\"12\" r=\"4\"/>",
37
+ archive: "<rect x=\"3\" y=\"4\" width=\"18\" height=\"4\" rx=\"1\"/><path d=\"M5 8v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V8M10 12h4\"/>",
38
+ check: "<path d=\"M20 6 9 17l-5-5\"/>",
39
+ eyeoff: "<path d=\"M3 3l18 18\"/><path d=\"M10.6 5.1A10 10 0 0 1 12 5c6.5 0 10 7 10 7a17 17 0 0 1-3.2 4.1M6.6 6.6A17 17 0 0 0 2 12s3.5 7 10 7a10 10 0 0 0 5.4-1.6\"/>",
40
+ kanban: "<rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\"/><path d=\"M8 8v6M12 8v9M16 8v4\"/>",
41
+ chat: "<path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\"/>",
42
+ stickyNote: "<path d=\"M15 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-6 6Z\"/><path d=\"M15 21v-4a2 2 0 0 1 2-2h4M7 8h10M7 12h5\"/>",
43
+ grid: "<rect x=\"3\" y=\"3\" width=\"7\" height=\"7\" rx=\"1.5\"/><rect x=\"14\" y=\"3\" width=\"7\" height=\"7\" rx=\"1.5\"/><rect x=\"3\" y=\"14\" width=\"7\" height=\"7\" rx=\"1.5\"/><rect x=\"14\" y=\"14\" width=\"7\" height=\"7\" rx=\"1.5\"/>",
44
+ globe: "<circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18\"/>",
45
+ planet: "<circle cx=\"12\" cy=\"12\" r=\"5\"/><path d=\"M4.5 15.5C1.8 17.7 1 19.6 2 20.5c1.6 1.4 7.2-1.3 12.4-6s8.1-9.8 6.6-11.2c-.9-.9-2.9-.2-5.2 1.6\"/>",
46
+ inbox: "<path d=\"M22 12h-6l-2 3h-4l-2-3H2\"/><path d=\"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\"/>",
47
+ cat: "<path d=\"M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9 9 0 0 1 12 5Z\"/><path d=\"M8 14v.5M16 14v.5\"/>",
48
+ gear: "<circle cx=\"12\" cy=\"12\" r=\"3\"/><path d=\"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z\"/>",
49
+ search: "<circle cx=\"11\" cy=\"11\" r=\"7\"/><path d=\"m20 20-3.5-3.5\"/>",
50
+ plus: "<path d=\"M12 5v14M5 12h14\"/>",
51
+ more: "<circle cx=\"5\" cy=\"12\" r=\"1.2\"/><circle cx=\"12\" cy=\"12\" r=\"1.2\"/><circle cx=\"19\" cy=\"12\" r=\"1.2\"/>",
52
+ down: "<path d=\"m6 9 6 6 6-6\"/>",
53
+ chevup: "<path d=\"m6 15 6-6 6 6\"/>",
54
+ chevboth: "<path d=\"m7 9 5-5 5 5M7 15l5 5 5-5\"/>",
55
+ chevin: "<path d=\"m7 4 5 5 5-5M7 20l5-5 5 5\"/>",
56
+ right: "<path d=\"m9 6 6 6-6 6\"/>",
57
+ doubleRight: "<path d=\"m5 6 6 6-6 6\"/><path d=\"m13 6 6 6-6 6\"/>",
58
+ left: "<path d=\"m15 18-6-6 6-6\"/>",
59
+ mic: "<rect x=\"9\" y=\"3\" width=\"6\" height=\"11\" rx=\"3\"/><path d=\"M5 11a7 7 0 0 0 14 0M12 18v3\"/>",
60
+ up: "<path d=\"M12 19V5M5 12l7-7 7 7\"/>",
61
+ send2r: "<path d=\"M22 2 11 13\"/><path d=\"M22 2 15 22l-4-9-9-4z\"/>",
62
+ upload: "<path d=\"M12 16V4M7 9l5-5 5 5\"/><path d=\"M4 16v3a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-3\"/>",
63
+ ban: "<circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"m5.6 5.6 12.8 12.8\"/>",
64
+ linkoff: "<path d=\"M9 15l-2 2a3.5 3.5 0 0 1-5-5l2-2M15 9l2-2a3.5 3.5 0 0 1 5 5l-2 2\"/><path d=\"m3 3 18 18\"/>",
65
+ unlock: "<rect x=\"4\" y=\"11\" width=\"16\" height=\"10\" rx=\"2\"/><path d=\"M8 11V7a4 4 0 0 1 7.5-2\"/>",
66
+ stop: "<rect x=\"7\" y=\"7\" width=\"10\" height=\"10\" rx=\"1.5\" fill=\"currentColor\" stroke=\"none\"/>",
67
+ x: "<path d=\"M18 6 6 18M6 6l12 12\"/>",
68
+ pen: "<path d=\"M12 20h9\"/><path d=\"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z\"/>",
69
+ works: "<rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\"/><circle cx=\"9\" cy=\"9\" r=\"2\"/><path d=\"m21 15-5-5L5 21\"/>",
70
+ bookmark: "<path d=\"M19 21l-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z\"/>",
71
+ trace: "<path d=\"M3 12h4l3-8 4 16 3-8h4\"/>",
72
+ menu: "<path d=\"M4 6h16M4 12h16M4 18h16\"/>",
73
+ mail: "<rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\"/><path d=\"m3 7 9 6 9-6\"/>",
74
+ hook: "<path d=\"M9 14 4 9l5-5\"/><path d=\"M4 9h10a6 6 0 0 1 6 6v3\"/>",
75
+ alert: "<path d=\"M12 9v4M12 17h.01\"/><path d=\"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z\"/>",
76
+ info: "<circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M12 16v-4M12 8h.01\"/>",
77
+ users: "<path d=\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\"/><circle cx=\"9\" cy=\"7\" r=\"4\"/><path d=\"M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75\"/>",
78
+ key: "<circle cx=\"7.5\" cy=\"15.5\" r=\"4.5\"/><path d=\"m10.7 12.3 9.3-9.3M17 6l3 3M14 9l2 2\"/>",
79
+ bolt: "<path d=\"M13 2 3 14h9l-1 8 10-12h-9l1-8z\"/>",
80
+ box: "<path d=\"M21 8 12 3 3 8v8l9 5 9-5z\"/><path d=\"m3 8 9 5 9-5M12 13v8\"/>",
81
+ robot: "<rect x=\"4\" y=\"8\" width=\"16\" height=\"12\" rx=\"3\"/><path d=\"M12 4v4M9 13v2M15 13v2\"/>",
82
+ puzzle: "<path d=\"M19.4 13a2 2 0 1 0 0-4H18V6a2 2 0 0 0-2-2h-3V2.6a2 2 0 1 0-4 0V4H6a2 2 0 0 0-2 2v3h1.4a2 2 0 1 1 0 4H4v3a2 2 0 0 0 2 2h3v-1.4a2 2 0 1 1 4 0V18h3a2 2 0 0 0 2-2v-3z\"/>",
83
+ store: "<path d=\"M3 9 4.5 4h15L21 9\"/><path d=\"M3 9h18v2a3 3 0 0 1-6 0 3 3 0 0 1-6 0 3 3 0 0 1-6 0z\"/><path d=\"M5 13v7h14v-7\"/>",
84
+ msg: "<path d=\"M4 5h16v11H8l-4 4z\"/><path d=\"M8 10h8\"/>",
85
+ sliders: "<path d=\"M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6\"/>",
86
+ net: "<rect x=\"3\" y=\"4\" width=\"18\" height=\"6\" rx=\"1.5\"/><rect x=\"3\" y=\"14\" width=\"18\" height=\"6\" rx=\"1.5\"/><path d=\"M7 7h.01M7 17h.01\"/>",
87
+ bell: "<path d=\"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9\"/><path d=\"M10.3 21a1.94 1.94 0 0 0 3.4 0\"/>",
88
+ wave: "<path d=\"M2 12h2M6 8v8M10 5v14M14 8v8M18 10v4M22 12h0\"/>",
89
+ palette: "<circle cx=\"13.5\" cy=\"6.5\" r=\"1\"/><circle cx=\"17.5\" cy=\"10.5\" r=\"1\"/><circle cx=\"8.5\" cy=\"7.5\" r=\"1\"/><circle cx=\"6.5\" cy=\"12.5\" r=\"1\"/><path d=\"M12 2a10 10 0 0 0 0 20 2 2 0 0 0 2-2v-.5a2 2 0 0 1 2-2h1.5A4.5 4.5 0 0 0 22 13 11 11 0 0 0 12 2z\"/>",
90
+ clock: "<circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M12 7v5l3 2\"/>",
91
+ spark: "<path d=\"M12 3v4M12 17v4M3 12h4M17 12h4M6 6l2.5 2.5M15.5 15.5 18 18M6 18l2.5-2.5M15.5 8.5 18 6\"/>",
92
+ chart: "<path d=\"M3 3v18h18\"/><path d=\"M7 15l4-4 3 3 5-6\"/>",
93
+ board: "<rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\"/><path d=\"M9 3v18M15 3v18\"/>",
94
+ signal: "<path d=\"M2 20h.01M7 20v-4M12 20v-8M17 20V8M22 4v16\"/>",
95
+ pulse: "<path d=\"M22 12h-4l-3 9L9 3l-3 9H2\"/>",
96
+ layers: "<path d=\"m12 2 10 5-10 5L2 7z\"/><path d=\"m2 12 10 5 10-5M2 17l10 5 10-5\"/>",
97
+ map: "<path d=\"M9 4 3 6v14l6-2 6 2 6-2V4l-6 2z\"/><path d=\"M9 4v14M15 6v14\"/>",
98
+ video: "<rect x=\"2\" y=\"6\" width=\"14\" height=\"12\" rx=\"2\"/><path d=\"m22 8-6 4 6 4z\"/>",
99
+ eye: "<path d=\"M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/>",
100
+ megaphone: "<path d=\"m3 11 18-5v12L3 14v-3z\"/><path d=\"M11.6 16.8a3 3 0 1 1-5.8-1.6\"/>",
101
+ tabLeft: "<path d=\"M15.5 2 8.5 12l7 10\"/>", /* 侧边抽屉标签上的高箭头(窄而高,铺满标签) */
102
+ panel: "<rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\"/><path d=\"M15 4v16\"/>",
103
+ panelLeft: "<rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\"/><path d=\"M9 4v16\"/>",
104
+ expand: "<path d=\"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7\"/>",
105
+ shrink: "<path d=\"M4 14h6v6M20 10h-6V4M14 10l7-7M3 21l7-7\"/>",
106
+ trash: "<path d=\"M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6\"/>",
107
+ tasks: "<path d=\"M9 11l3 3L22 4\"/><path d=\"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11\"/>",
108
+ sun: "<circle cx=\"12\" cy=\"12\" r=\"4\"/><path d=\"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4\"/>",
109
+ moon: "<path d=\"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z\"/>",
110
+ rules: "<path d=\"M4 4h16v16H4z\"/><path d=\"M8 9h8M8 13h8M8 17h5\"/>",
111
+ person: "<circle cx=\"12\" cy=\"8\" r=\"4\"/><path d=\"M4 21a8 8 0 0 1 16 0\"/>",
112
+ newchat: "<path d=\"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"/><path d=\"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z\"/>",
113
+ memory: "<g fill=\"currentColor\" stroke=\"none\" transform=\"scale(0.018433)\"><g transform=\"translate(0.000000,1302.000000) scale(0.100000,-0.100000)\"><path d=\"M9003 11606 c-99 -32 -189 -109 -230 -196 -12 -25 -71 -150 -132 -278 -61 -128 -111 -234 -111 -237 0 -8 -150 -335 -225 -492 -59 -123 -78 -153 -97 -157 -12 -3 -66 -10 -118 -16 -52 -6 -187 -24 -300 -40 -113 -16 -293 -41 -400 -55 -444 -60 -514 -79 -589 -160 -82 -89 -101 -157 -101 -360 0 -158 10 -217 49 -293 22 -43 196 -232 507 -552 215 -222 394 -418 394 -431 0 -7 -18 -101 -39 -208 -22 -108 -49 -250 -61 -316 -12 -66 -41 -220 -66 -342 -43 -216 -44 -228 -44 -412 0 -229 10 -268 95 -359 88 -96 119 -106 320 -110 249 -6 298 9 569 162 54 31 100 56 102 56 2 0 64 35 137 79 279 166 522 301 542 301 11 0 37 -11 57 -25 36 -24 215 -134 618 -378 355 -215 377 -222 640 -214 243 6 330 49 402 195 33 66 33 66 36 262 3 210 2 220 -97 805 -16 99 -39 243 -51 320 -11 77 -23 152 -26 167 -5 25 33 67 441 482 246 250 458 470 471 490 52 77 58 107 58 316 1 195 1 195 -31 261 -62 125 -145 176 -343 208 -199 33 -852 126 -1053 150 -73 9 -127 30 -127 50 0 5 -18 48 -41 96 -22 48 -51 110 -63 139 -93 205 -169 376 -233 526 -184 428 -218 480 -352 544 -66 31 -66 31 -266 33 -148 2 -211 -1 -242 -11z m278 -1213 c82 -172 118 -251 169 -368 212 -482 188 -457 465 -494 196 -26 736 -97 773 -101 19 -2 -49 -76 -322 -350 -381 -381 -356 -342 -356 -579 0 -142 6 -192 50 -431 32 -173 80 -453 80 -467 0 -27 -39 -7 -365 192 -191 116 -356 210 -380 216 -26 7 -113 10 -217 8 l-173 -4 -105 -59 c-58 -33 -179 -105 -270 -160 -307 -186 -360 -214 -360 -189 0 3 13 74 30 157 116 595 120 619 120 752 0 228 20 195 -353 571 -199 200 -318 327 -314 335 3 9 46 19 133 31 71 10 179 24 239 32 61 9 210 28 332 44 315 42 338 54 417 221 76 163 262 571 301 663 21 48 41 87 46 87 5 0 32 -48 60 -107z M3130 8364 c-606 -35 -1182 -165 -1717 -390 -264 -111 -325 -142 -376 -192 -94 -91 -100 -113 -142 -522 -14 -140 -37 -356 -50 -480 -14 -124 -29 -274 -35 -335 -5 -60 -17 -171 -24 -245 -8 -74 -22 -200 -30 -280 -8 -80 -22 -212 -31 -295 -9 -82 -23 -208 -30 -280 -8 -71 -23 -215 -34 -320 -21 -196 -34 -319 -76 -755 -14 -140 -32 -313 -40 -385 -7 -71 -21 -193 -29 -270 -37 -333 -46 -427 -56 -535 -6 -63 -15 -142 -20 -175 -17 -105 -12 -394 6 -451 27 -80 76 -139 146 -173 61 -31 61 -31 257 -31 180 0 203 2 286 26 50 14 130 37 179 50 144 41 544 132 678 154 67 11 186 32 263 45 164 29 512 62 745 71 909 35 1971 -324 2995 -1014 197 -132 223 -142 400 -149 259 -10 277 -4 605 192 398 238 806 453 1070 563 843 352 1587 482 2305 403 237 -26 325 -37 395 -51 30 -5 129 -24 220 -40 297 -55 605 -131 879 -217 116 -37 116 -37 311 -37 218 -1 256 8 329 77 76 73 91 128 91 344 0 106 -7 255 -15 330 -8 76 -19 192 -25 258 -5 66 -17 183 -25 260 -8 77 -29 286 -45 465 -38 415 -56 597 -75 790 -9 85 -22 223 -30 305 -8 83 -22 218 -30 300 -16 150 -33 330 -60 628 -39 414 -46 490 -55 602 -6 66 -15 154 -20 195 -5 41 -16 152 -25 245 -8 94 -20 220 -26 280 -6 61 -15 151 -19 201 -21 217 -87 280 -418 402 -339 125 -306 117 -487 117 -181 0 -214 -9 -263 -73 -27 -35 -27 -35 -27 -241 1 -181 3 -215 22 -276 43 -142 40 -140 188 -185 131 -41 244 -89 254 -109 5 -9 11 -65 15 -126 4 -60 16 -195 27 -300 11 -104 33 -332 50 -505 16 -173 37 -382 45 -465 7 -82 19 -204 24 -270 6 -66 13 -131 15 -145 3 -14 12 -101 20 -195 15 -168 30 -331 60 -635 9 -85 22 -225 30 -310 18 -201 41 -437 60 -625 38 -364 44 -440 36 -448 -5 -5 -37 -2 -73 7 -335 83 -765 157 -1118 193 -253 26 -1108 26 -1319 0 -804 -97 -1546 -345 -2319 -774 -96 -54 -157 -82 -163 -76 -12 12 -8 4311 4 4333 9 18 214 145 395 245 78 42 126 75 131 89 72 192 101 340 101 521 0 244 5 239 -216 233 -126 -3 -145 -6 -209 -32 -135 -56 -271 -123 -412 -204 -78 -45 -151 -82 -161 -82 -11 0 -55 20 -98 43 -718 396 -1523 648 -2279 712 -179 16 -781 27 -935 19z m628 -759 c432 -38 959 -153 1254 -274 12 -5 68 -26 123 -46 287 -105 838 -377 913 -452 22 -22 22 -22 22 -2163 0 -1963 -1 -2140 -16 -2140 -9 0 -48 20 -88 44 -171 106 -551 296 -771 387 -493 202 -899 301 -1520 370 -180 20 -822 23 -1070 5 -422 -31 -955 -111 -1283 -193 -37 -9 -67 -12 -72 -7 -5 5 -3 65 5 144 14 137 45 460 66 670 15 159 36 367 54 545 8 83 22 213 29 290 8 77 30 289 49 470 19 182 40 380 46 440 6 61 18 175 26 255 9 80 22 210 31 290 30 286 44 417 59 535 8 66 19 174 26 240 15 165 16 166 107 208 320 149 741 277 1102 336 374 61 604 72 908 46z\"/></g></g>",
114
+ history: "<path d=\"M3 12a9 9 0 1 0 3-6.7L3 8\"/><path d=\"M3 3v5h5M12 7v5l3 2\"/>",
115
+ macreturn: "<path d=\"M14 5h3a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3H5\"/><path d=\"m9 12-4 4 4 4\"/>",
116
+ shield: "<path d=\"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z\"/>",
117
+ shieldCheck: "<path d=\"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z\"/><path d=\"m9 12 2 2 4-4\"/>",
118
+ grip: "<circle cx=\"9\" cy=\"6\" r=\"1\"/><circle cx=\"15\" cy=\"6\" r=\"1\"/><circle cx=\"9\" cy=\"12\" r=\"1\"/><circle cx=\"15\" cy=\"12\" r=\"1\"/><circle cx=\"9\" cy=\"18\" r=\"1\"/><circle cx=\"15\" cy=\"18\" r=\"1\"/>",
119
+ code: "<path d=\"m16 18 6-6-6-6M8 6l-6 6 6 6\"/>",
120
+ updown: "<path d=\"m8 9 4-4 4 4M8 15l4 4 4-4\"/>",
121
+ reveal: "<circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"m10 8 4 4-4 4\"/>",
122
+ pin: "<g transform=\"rotate(45 12 12)\"><path d=\"M12 17v5\"/><path d=\"M9 10.76V6h6v4.76a2 2 0 0 0 1.1 1.79l1.8.9A2 2 0 0 1 19 15.24V17H5v-1.76a2 2 0 0 1 1.1-1.79l1.8-.9A2 2 0 0 0 9 10.76z\"/><path d=\"M8 3h8\"/></g>",
123
+ home: "<path d=\"M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z\"/>",
124
+ lock: "<rect x=\"5\" y=\"11\" width=\"14\" height=\"9\" rx=\"2\"/><path d=\"M8 11V8a4 4 0 0 1 8 0v3\"/>",
125
+ diff: "<path d=\"M12 3v10M7 8h10\"/><path d=\"M7 19h10\"/>",
126
+ git: "<circle cx=\"6\" cy=\"5\" r=\"2.2\"/><circle cx=\"6\" cy=\"19\" r=\"2.2\"/><circle cx=\"18\" cy=\"8\" r=\"2.2\"/><path d=\"M6 7.2v9.6M18 10.2c0 4-6 3.5-11 7\"/>",
127
+ terminal: "<path d=\"m4 17 6-5-6-5\"/><path d=\"M12 19h8\"/>",
128
+ sessions: "<rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\"/><path d=\"M7 9h10M7 13h6\"/>",
129
+ live: "<circle cx=\"12\" cy=\"12\" r=\"3\"/><path d=\"M5.6 5.6a9 9 0 0 0 0 12.8M18.4 5.6a9 9 0 0 1 0 12.8\"/>",
130
+ wrench: "<path d=\"M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18l3 3 6.3-6.3a4 4 0 0 0 5.4-5.4l-2.6 2.6-2.4-.6-.6-2.4z\"/>",
131
+ camera: "<path d=\"M4 8h3l2-3h6l2 3h3v11H4z\"/><circle cx=\"12\" cy=\"13\" r=\"3.5\"/>",
132
+ console: "<rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\"/><path d=\"m7 9 3 3-3 3M12 15h5\"/>",
133
+ review: "<circle cx=\"11\" cy=\"11\" r=\"6\"/><path d=\"m20 20-4.2-4.2M8.5 11l1.8 1.8 3.2-3.6\"/>",
134
+ magnifyPlus: "<circle cx=\"11\" cy=\"11\" r=\"6\"/><path d=\"m20 20-4.2-4.2M8 11h6M11 8v6\"/>",
135
+ magnifyMinus: "<circle cx=\"11\" cy=\"11\" r=\"6\"/><path d=\"m20 20-4.2-4.2M8 11h6\"/>",
136
+ split2: "<rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\"/><path d=\"M12 4v16\"/>",
137
+ rows2: "<rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\"/><path d=\"M3 12h18\"/>",
138
+ power: "<path d=\"M12 3v8\"/><path d=\"M6.3 6.8a8 8 0 1 0 11.4 0\"/>",
139
+ pr: "<circle cx=\"6\" cy=\"6\" r=\"2\"/><circle cx=\"6\" cy=\"18\" r=\"2\"/><circle cx=\"18\" cy=\"18\" r=\"2\"/><path d=\"M6 8v8M18 16V9a3 3 0 0 0-3-3h-4\"/><path d=\"m13 4-2 2 2 2\"/>",
140
+ image: "<rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\"/><circle cx=\"9\" cy=\"10\" r=\"1.6\"/><path d=\"m21 16-5-5-9 9\"/>",
141
+ audio: "<path d=\"M4 10v4M8 7v10M12 4v16M16 8v8M20 11v2\"/>",
142
+ widget: "<rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\"/><path d=\"M3 9h18M8 4v5\"/>",
143
+ issue: "<circle cx=\"12\" cy=\"12\" r=\"9\"/><circle cx=\"12\" cy=\"12\" r=\"1.5\"/>",
144
+ ledger: "<path d=\"M5 4h11a3 3 0 0 1 3 3v13H8a3 3 0 0 1-3-3z\"/><path d=\"M5 17a3 3 0 0 1 3-3h11M9 8h6\"/>",
145
+ circleq: "<circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M9.5 9.5a2.5 2.5 0 0 1 4.6 1.3c0 1.7-2.1 2-2.1 3.2M12 17h.01\"/>",
146
+ dash: "<path d=\"M6 12h12\"/>",
147
+ undo: "<path d=\"M9 14 4 9l5-5\"/><path d=\"M4 9h11a5 5 0 0 1 0 10h-3\"/>",
148
+ film: "<rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\"/><path d=\"M7 4v16M17 4v16M3 9h4M3 15h4M17 9h4M17 15h4\"/>",
149
+ skipIdle: "<path d=\"m5 5 7 7-7 7M13 5l7 7-7 7\"/>",
150
+ stepBack: "<path d=\"M18 6 10 12l8 6zM6 6v12\"/>",
151
+ stepFwd: "<path d=\"m6 6 8 6-8 6zM18 6v12\"/>"
152
+ };
153
+ /* 图标按含义取:组件和 PDL 只写含义名(send、close、delete…),这里把每个含义映射到唯一的字形。
154
+ 一个含义只有一个字形,一个字形只表达一个含义;保留字形(ICON_RESERVED)只能通过含义名用 */
155
+ /* 几个容易混的含义(reply 和 jump 是上下镜像的两个字形,16px 下要一眼分得开):
156
+ reply(Mac 回车键形:上面一小段、右边下去、底下一横、箭头在下朝左)是“在这条对话里回复”:输入框的发送键、+ 菜单的发送策略、消息工具条的回复 / 引用;
157
+ send(纸飞机)只给排队的“现在发出”(把已经排好的消息推出去);
158
+ jump(弯钩:箭头在上朝左、右边弧线往下)是应用内“回到原处”(待办的一项、补充消息的跳到原文、回复引用、回到来源对话 / 卡片),全站只有这一个动作和这一个字形;openExternal(斜上箭头)只用于真正的外部网址(http / https);
159
+ latest 是“到最新” */
160
+ const ICON_MEANING = {
161
+ send: 'send2r', close: 'x', delete: 'trash', edit: 'pen', copy: 'copy', reply: 'macreturn', more: 'more', back: 'left', forward: 'forward', maximize: 'expand', zoomIn: 'magnifyPlus', zoomOut: 'magnifyMinus', system: 'megaphone',
162
+ expand: 'down', collapse: 'chevup', latest: 'arrowdown', jump: 'hook', openExternal: 'ext', prev: 'up', next: 'arrowdown', upload: 'upload', reject: 'ban', unlink: 'linkoff', release: 'unlock'
163
+ };
164
+ const ICON_RESERVED = ['x', 'trash', 'send2', 'send2r', 'up', 'arrowdown', 'chevup', 'ext', 'macreturn', 'hook'];
165
+ function icon(n, s, cls) { const k = n && (ICON_MEANING[n] || n), g = k && ICONS[k]; if (!g) return ''; s = s || 16; return '<svg class="ic' + (cls ? ' ' + cls : '') + '" data-i="' + k + '" width="' + s + '" height="' + s + '" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">' + g + '</svg>'; }
@@ -0,0 +1,149 @@
1
+ /* 边界:一个含义一个组件、不为接口定制、不按位置推导样式 */
2
+ /* 身份:成员、用户、插件、系统的名字 / 头像 / 身份色,图标或图片的方块(glyph) */
3
+ /* 身份:成员、用户、插件、系统都是同一个 from 结构 { kind, id }。
4
+ 对话消息、引用、队列、正在执行、工作台列表……所有位置都用这一份渲染;
5
+ 不同组件只是选不同的形态,决定显示到哪一级:
6
+ dot 只有颜色(悬停看全名)
7
+ avatar 头像(悬停看全名)
8
+ chip 头像,悬停展开成 头像 + 名字
9
+ name 名字(成员色)
10
+ title 名字 + 句柄(列表行标题用)
11
+ line 头像 + 名字(默认带句柄,handle: false 仅头像与名字)
12
+ text 纯文字(提示、通知里用) */
13
+ 'use strict';
14
+ /* 身份的数据(应用登记):这个文件的身份组件、选成员、提及、徽标只经这里读数据,不认识应用的数据——
15
+ member(id) 成员 · members() 全部成员 · me() 你 · builtinConnector(id) 宿主内置的连接器 ·
16
+ health() 回调授权健康(没有就 null)· live(id, 回合) 执行状态 · handleWho(句柄) 这个 @ 是谁(成员 / 你 / 插件,和消息作者同一种写法;不是有效的 @ 给 null) */
17
+ const WHO_DATA = pdlReads('who', { member: function () { return null; }, members: function () { return []; }, me: function () { return {}; }, builtinConnector: function () { return false; }, health: function () { return null; }, live: null, handleWho: function () { return null; } });
18
+ function avatar(m, size) { return whoAva(m, { size: size }); } /* 身份统一走 whoAva */
19
+ /* 可上传的头像(组件库唯一一个):点头像本身就是上传,悬停出现上传提示;成员表单和对话框的头像字段都用它 */
20
+ function avatarUp(lead, size, up, data) {
21
+ return '<label class="ava-up" data-tip="' + h(up.label) + '">' + avatar(lead, size) + '<span class="ava-up-ic" aria-hidden="true">' + icon('upload', 16) + '</span><input type="file" accept="' + h(up.accept || '') + '" class="sr" aria-label="' + h(up.label) + '" data-filemsg="' + h(up.msg || '') + '"' + (data || '') + '></label>';
22
+ }
23
+ function glyphSrc(n) { return n && typeof n === 'object' ? n.src : /^(https?:|data:|blob:|\/|\.{1,2}\/)/.test(n) ? n : ''; }
24
+ /* 图片图标:读到之前用骨架同一个节拍闪;读过的地址记住,重画时直接是读到的样子(不再闪) */
25
+ const GLYPH_LOADED = new Set();
26
+ function glyph(n, cls) { const src = glyphSrc(n); return '<span class="glyph' + (cls ? ' ' + cls : '') + '">' + (src ? '<img src="' + h(src) + '" alt=""' + (GLYPH_LOADED.has(src) ? ' data-loaded' : '') + '>' : icon(n, 18)) + '</span>'; }
27
+ ['load', 'error'].forEach(function (type) {
28
+ document.addEventListener(type, function (e) { const img = e.target; if (img.tagName !== 'IMG' || !img.parentNode || !img.parentNode.classList.contains('glyph')) return; GLYPH_LOADED.add(img.getAttribute('src')); img.setAttribute('data-loaded', ''); }, true);
29
+ });
30
+ /* 频道发送方按成员编号解析。成员对象和编辑中的身份也经同一个组件呈现。 */
31
+ function fromOf(x) {
32
+ if (!x) return { kind: 'system', service: 'system' };
33
+ if (typeof x === 'string') return x === 'user' || x === 'me' ? { kind: 'user', userId: 'me' } : x === 'system' ? { kind: 'system', service: 'system' } : { kind: 'agent', catId: x };
34
+ if (x.kind === 'agent' || x.kind === 'member') return { kind: 'agent', catId: x.catId || x.id, name: x.name };
35
+ if (x.kind === 'user') return { kind: 'user', userId: x.userId || 'me' };
36
+ if (x.kind === 'external') return x;
37
+ if (x.kind === 'system') return { kind: 'system', service: x.service || x.id || 'system', name: x.name };
38
+ if (x.id == null && x.name != null) return { kind: 'draft', name: x.name, tint: x.tint, color: x.color, fixedColor: x.fixedColor, avatarPath: x.avatarPath }; /* 还不是成员的身份(新建成员的表单、所有者):名字 + 代表色,不按 id 去查 */
39
+ return { kind: 'agent', catId: x.id, name: x.name }; /* 传进来的是成员对象 */
40
+ }
41
+ /* 声明了颜色的身份:只取色相(数据),明度 / 彩度跟当前主题的成员色走——CSS 相对颜色直接算,主题变了自动跟着变,不在渲染时读样式 */
42
+ function senderHue(hex) { return Math.round(hexOk(hex).H); }
43
+ /* 你的消息气泡:色相和彩度来自你的代表色,明度和每种外观下的彩度比例由主题定(--bg-bubble、--bubble-cmul);没有代表色就是主题的气泡色 */
44
+ function whoMeBubble() { const c = WHO_DATA.me().color, o = c && c.primary ? hexOk(c.primary) : null; return o ? ';--me-h:' + Math.round(o.H) + ';--me-c:' + o.C.toFixed(3) : ''; }
45
+ /* 原始身份色对应主题声明的参考色档;精确匹配优先,其余按色相距离,等距保持声明顺序。 */
46
+ function whoTint(color) {
47
+ const palette = PDL_WHO.member.palette, p = color && color.primary ? color.primary.toLowerCase() : '', k = palette.indexOf(p);
48
+ if (k >= 0) return k + 1;
49
+ if (!p) return 0;
50
+ const hue = function (hex) { const n = parseInt(hex.slice(1), 16), r = (n >> 16 & 255) / 255, g = (n >> 8 & 255) / 255, b = (n & 255) / 255, mx = Math.max(r, g, b), mn = Math.min(r, g, b), d = mx - mn || 1; return ((mx === r ? (g - b) / d : mx === g ? 2 + (b - r) / d : 4 + (r - g) / d) * 60 + 360) % 360; };
51
+ const hh = hue(p); let best = 0, bd = 999;
52
+ palette.forEach(function (x, i) { const dd = Math.min(Math.abs(hue(x) - hh), 360 - Math.abs(hue(x) - hh)); if (dd < bd) { bd = dd; best = i; } });
53
+ return best + 1;
54
+ }
55
+ /* 后端身份色与手选的固定 hex 是两份数据;固定色覆盖文字,底色仍使用身份的主题档。 */
56
+ function whoColors(m) {
57
+ const step = m.color && typeof m.color === 'object' ? whoTint(m.color) : m.tint || 0, fixed = m.fixedColor || (typeof m.color === 'string' ? m.color : '');
58
+ return { step: step, fixed: fixed, color: fixed || (step ? 'var(--name-' + step + ')' : null), bg: 'var(--tint-' + (step || 1) + ')' };
59
+ }
60
+ /* 解析成显示需要的一份信息;颜色只取 token。source 是消息上的来源(可选)。side:只有你是 right,其余没写就是 left(消息模板的左右只从这里推出) */
61
+ function whoInfo(x, source) {
62
+ const f = fromOf(x); source = source || {};
63
+ if (f.kind === 'draft') { const nm = String(f.name || '?'), c = whoColors(f); return { kind: 'member', id: '', name: nm, handle: '', glyph: h(nm.slice(0, 1)), img: f.avatarPath ? ioFile(f.avatarPath) : null, step: c.step, color: c.color, bg: c.fixed || c.bg, ink: 'var(--fg-strong)', shape: 'round' }; }
64
+ if (f.kind === 'agent') {
65
+ const m = WHO_DATA.member(f.catId, f.name), c = whoColors(m);
66
+ const profile = m.profile ? { act: 'open', data: argAttrs({ page: 'member', p: m.id }), verb: tc('who.viewMember') } : {};
67
+ const visual = m.kind === 'plugin' && !m.persona
68
+ ? { kind: 'plugin', glyph: icon(m.icon, 13) || icon('robot', 13), bg: 'var(--bg-raised)', ink: c.color || 'var(--fg-strong)', shape: 'square' }
69
+ : { kind: 'member', glyph: h(m.name.slice(0, 1)), bg: c.bg, ink: 'var(--fg-strong)', shape: 'round' };
70
+ return { ...visual, id: m.id, name: m.name, handle: m.handle, img: ioFile(m.avatarPath),
71
+ step: c.step, color: c.color, ...profile };
72
+ }
73
+ if (f.kind === 'user') { const ME = WHO_DATA.me(); return { kind: 'user', side: 'right', id: 'me', name: ME.name, handle: ME.handle, img: ioFile(ME.avatarPath), glyph: h(ME.name.slice(0, 1).toUpperCase()), color: ME.color && ME.color.primary ? 'oklch(from var(--name-1) l c ' + senderHue(ME.color.primary) + ')' : 'var(--fg-strong)', bg: 'var(--bg-selected)', ink: 'var(--fg-strong)', shape: 'round' }; }
74
+ /* 外部的人(不是宿主内置连接器来的):和成员同一个外壳——圆形首字头像 + 自己的名字,不带来源名和种类 */
75
+ if (f.kind === 'external' && !WHO_DATA.builtinConnector(f.connectorId) && f.sender) { const nm = f.sender.name || f.sender.id; return { kind: 'external', id: f.connectorId + ':' + f.sender.id, name: nm, handle: '', glyph: h(nm.slice(0, 1)), color: null, bg: 'var(--bg-raised)', ink: 'var(--fg-strong)', shape: 'round' }; }
76
+ const id = f.kind === 'external' ? f.connectorId : f.service;
77
+ const base = source.label || f.name || id || tc('who.unknown');
78
+ const actor = source.sender && source.sender.name || f.sender && f.sender.name || '';
79
+ const col = source.themeColor, hue = col ? senderHue(col) : null, nm = hue != null ? 'oklch(from var(--name-1) l c ' + hue + ')' : null;
80
+ const ic = [source.icon, f.icon].find(function (n) { return n && (glyphSrc(n) || ICONS[n]); }) || (f.kind === 'system' ? 'system' : 'robot'), img = glyphSrc(ic);
81
+ return { kind: f.kind, id: id, name: actor ? base + ' · ' + actor : base, handle: '',
82
+ glyph: icon(img ? (f.kind === 'system' ? 'system' : 'robot') : ic, 13), img: img, /* 包图片沿用同一个头像铺满口;图标仍用原来的尺寸。 */
83
+ color: nm, bg: 'var(--bg-raised)', ink: nm || 'var(--fg-strong)', shape: 'square' };
84
+ }
85
+ /* 悬停打开的声明只在 PDL_WHO 声明的放置处生效(place:调用方说这是哪个放置,比如消息的作者行 author);别处的头像 / 名字没有悬停卡 */
86
+ function whoHover(w, place) { const d = PDL_WHO[w.kind]; return d && d.hover && place && d.at === place ? ' data-hover="' + d.hover + '"' + argAttrs(d.hoverArgs) + ' data-who="' + h(w.id) + '"' : ''; }
87
+ function whoTip(w) { return w.name + (w.handle ? ' ' + w.handle : ''); }
88
+ /* 头像:一个组件,只有尺寸不同——o.size 是档位 xs(和所在那行文字一样高,约 1.25em)| s | m | l | xl;成员数据有头像图(avatarPath)就画图,没有就是首字;
89
+ 执行中(外圈扩散,和全局节拍同相位)/ 卡住(静止警示圈)由 whoLive(成员 id) 决定,不接受调用方传入;o.click 为真时点头像去看这个成员/插件;o.tip 覆盖悬停文字;o.place 放置处(悬停卡只在 PDL_WHO 声明的放置处,见 whoHover) */
90
+ /* 档位:xs | s | m(默认)| l | xl;line / sm / lg …映射到档位 */
91
+ const AV_STEP = { line: 'xs', sm: 's', md: 'm', base: 'm', lg: 'xl' };
92
+ /* 成员头像总带 data-live(谁)/ data-turn(哪一回合)/ data-status(现在的状态,空 = 不在执行):应用可直接更新这些属性。上游的例子是 cafe.js 的 liveSync。 */
93
+ /* 圈的状态表里的节拍档(颜色和幅度在 CSS 的同一张表里):卡住和出错用 alert(1 拍,快),其余 ambient */
94
+ function whoAva(x, o) {
95
+ o = o || {};
96
+ const step = AV_STEP[o.size] || o.size || 'm';
97
+ const w = whoInfo(x, o.source), tip = o.tip || whoTip(w), fixed = o.live !== undefined, live = w.kind !== 'member' ? '' : fixed ? o.live || '' : WHO_DATA.live ? WHO_DATA.live(w.id, o.turn) : '', /* live:调用的数据已经给出这个头像代表的那件事的执行状态(投递头像),组件只按它画,不再自己读 */ /* 执行状态只有一个来源:成员这一回合的状态(whoLive 给出 CatStatusType),调用方不能按位置传;所有位置的这只猫一起变 */
98
+ cls = 'avatar av-' + step + (live ? ' run' : ''),
99
+ attrs = ' data-kind="' + w.kind + '" data-shape="' + w.shape + '"' + (w.kind === 'member' ? (fixed ? '' : ' data-live="' + h(w.id) + '"' + (o.turn != null ? ' data-turn="' + h(o.turn) + '"' : '')) + ' data-status="' + live + '"' : '') + (w.img ? ' data-img' : '') + whoHover(w, o.place), bg = '--av-bg:' + w.bg + ';--av-ink:' + w.ink + ';--c:' + (w.color || 'initial') + (w.img ? ';--av-img:url(&quot;' + h(w.img) + '&quot;)' : ''); /* 形状、底色、字色、头像图都来自 whoInfo 推出的属性;样式只认 data-shape / data-img(图盖在首字上,读不到图时首字露出来) */
100
+ const face = w.img ? '' : w.glyph; /* 有图就只画图,首字和图二选一 */
101
+ const hd = whoHealth(w, o), wrap = function (a) { return hd ? '<span class="av-wrap">' + a + hd + '</span>' : a; };
102
+ if (o.click && w.act) return wrap('<button type="button" class="' + cls + '"' + attrs + ' style="' + bg + '" data-act="' + w.act + '"' + (w.data || ' data-id="' + w.id + '"') + ' data-tip="' + h((w.verb || tc('who.view')) + tip) + '" aria-label="' + h(tip) + '">' + face + '</button>');
103
+ return wrap('<span class="' + cls + '"' + attrs + ' style="' + bg + '"' + (o.tip !== false ? ' data-tip="' + h(tip) + '"' : '') + ' aria-hidden="' + (o.tip === false) + '"' + (o.tip !== false ? ' role="img" aria-label="' + h(tip) + '"' : '') + '>' + face + '</span>');
104
+ }
105
+ /* 回调授权健康点(头像的能力,o.health 开):只用在 运维 › 可观测 › 回调鉴权 的“受影响的猫”里(对话侧每只猫挂点的做法被否了,见 hub-icons.tsx)——近 24 小时有失败就挂一个点,
106
+ 悬停看原因 × 次数、常用工具;点它去设置 › 运维看详情(区域模型自动给“返回”)。数据只读 CB_AUTH(/api/callback-auth/snapshot) */
107
+ function whoHealth(w, o) {
108
+ const CB_AUTH = WHO_DATA.health(); if (!o.health || w.kind !== 'member' || !CB_AUTH) return '';
109
+ const c = CB_AUTH.byCat[w.id]; if (!c || c.status === 'healthy') return '';
110
+ const tip = tc('cbauth.healthTip', c.failures24h) + ' · ' + CB_AUTH.topReasons.map(function (r) { return r.name + ' ×' + r.count; }).join('、') + ' · ' + tc('cbauth.topTools') + ' ' + CB_AUTH.topTools.slice(0, 3).map(function (r) { return r.name; }).join('、');
111
+ return '<span class="av-health" role="button" tabindex="0" data-health="' + c.status + '" data-act="cbAuthOpen" data-tip="' + h(tip) + '" aria-label="' + h(tip) + '"></span>'; /* 不能是 button:头像常在可点的行里(按钮里不能套按钮) */
112
+ }
113
+ function who(x, form, o) {
114
+ o = o || {};
115
+ const w = whoInfo(x);
116
+ if (form === 'text') return w.name + (o.handle && w.handle ? ' ' + w.handle : '');
117
+ if (form === 'dot') return lrDot('id', whoTip(w), w.color || 'initial');
118
+ if (form === 'avatar') return whoAva(x, o);
119
+ if (form === 'name') return '<span class="who-name" style="--c:' + (w.color || 'initial') + '">' + h(w.name) + '</span>';
120
+ if (form === 'title') return h(w.name) + (w.handle ? ' <span class="plain">' + h(w.handle) + '</span>' : '');
121
+ if (form === 'chip') return capsule({ lead: whoAva(x, { size: 'sm', tip: false }), body: '<span class="who-name" style="--c:' + (w.color || 'initial') + '">' + h(w.name) + '</span>' + (o.body || ''), tip: whoTip(w), cls: 'cap-who', style: whoVar(x) });
122
+ return '<span class="who-line"' + (o.handle === false ? ' data-tip="' + h(whoTip(w)) + '"' : '') + '>' + whoAva(x, { size: o.size || 'sm', tip: false, click: o.click }) + '<span class="who-name" style="--c:' + (w.color || 'initial') + '">' + h(w.name) + '</span>' + (o.handle !== false && w.handle ? '<span class="plain">' + h(w.handle) + '</span>' : '') + '</span>';
123
+ }
124
+ /* 颜色:身份自带的颜色是数据(和名字一样随身份来)。支持颜色的组件在自己的根元素上写一个 --c(没有颜色就写 initial,不继承外层),
125
+ 默认值在组件自己的样式里声明:var(--c, var(--identity-fallback))——所有组件的默认都是同一个主题 token(中性色;主色只留给操作和链接) */
126
+ function whoVar(x, source) { return '--c:' + (whoInfo(x, source).color || 'initial'); }
127
+
128
+
129
+
130
+ /* ───────── 目录登记:身份 ───────── */
131
+ Object.assign(LIB_CATALOG, {
132
+ avatarSteps: { g: 'identity', inline: true, via: ['prop:who', 'type:avatar'], ex: function () { return ['xs', 's', 'm', 'l', 'xl'].map(function (z) { return '<span class="cat-st">' + whoAva('sol', { size: z, tip: false }) + '<span class="mono faint">' + z + '</span></span>'; }).join(''); } },
133
+ avatarShapes: { g: 'identity', inline: true, via: ['prop:who'], ex: function (s) { return ['sol', 'me', 'system', s.packageIdentity].map(function (x) { return whoAva(x, { size: 'l' }); }).join('') + who('opus', 'line') + who('sol', 'chip'); } },
134
+ /* 执行光圈:状态 = 颜色 + 节奏;出问题时借用严重度的 warn / danger(通道唯一的有意重叠)。info / ok 不是光圈的状态:执行中用成员色,完成后光圈消失 */
135
+ ring: { g: 'identity', inline: true, via: ['type:capsules', 'prop:who'], ex: function (s) { return s.executions.map(function (e) { return '<span class="cat-st">' + whoAva(e.id, { size: 'l', tip: false }) + '<span class="mono faint">' + e.status + '</span></span>'; }).join(''); },
136
+ tones: function (t, s) { const st = { warn: 'suspected_stall', danger: 'error' }[t]; if (!st) return null; const e = s.executions.find(function (x) { return x.status === st; }); return e ? whoAva(e.id, { size: 'l', tip: false }) : null; } }
137
+ });
138
+ /* 身份的显示文字交给引擎(ENGINE_PARTS.whoText,应用经 whoText 取) */
139
+ ENGINE_PARTS.whoText = function (x, o) { return who(x, 'text', o); };
140
+
141
+ /* 身份组件只更新自己的状态属性;业务状态由 WHO_DATA 给出。 */
142
+ ENGINE_PARTS.whoSync = function () {
143
+ document.querySelectorAll('[data-live]').forEach(function (el) {
144
+ const row = el.closest('[data-tid]'), st = row ? WHO_DATA.threadLive(row.dataset.tid, el.dataset.live) : WHO_DATA.live(el.dataset.live, el.hasAttribute('data-turn') ? el.dataset.turn : null);
145
+ if ((el.dataset.status || '') === st) return;
146
+ el.setAttribute('data-status', st); if (el.classList.contains('avatar')) el.classList.toggle('run', !!st);
147
+ localSync(el);
148
+ });
149
+ };