@pb33f/cowboy-components 0.7.18 → 0.9.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 (541) hide show
  1. package/dist/_basePickBy-D0MVaff7.js +151 -0
  2. package/dist/_baseUniq-DVhBEtEZ.js +614 -0
  3. package/dist/arc-DfidlRZC.js +83 -0
  4. package/dist/architecture-U656AL7Q-2l0oI7kq.js +5 -0
  5. package/dist/architectureDiagram-VXUJARFQ-CluOaK7l.js +4661 -0
  6. package/dist/assets/elk-layout.worker-B71_NI2D.js +1 -0
  7. package/dist/assets/equalizer.worker-A8HFNy4g.js +1 -0
  8. package/dist/assets/graph-dependent.worker-BgWuMZsb.js +1 -0
  9. package/dist/assets/rule-documentation.worker-BCKuwSgZ.js +1 -0
  10. package/dist/assets/search-graph.worker-Cwqb-ecv.js +1 -0
  11. package/dist/blockDiagram-VD42YOAC-RbyzthW7.js +2261 -0
  12. package/dist/c4Diagram-YG6GDRKO-Bx8eR5aW.js +1580 -0
  13. package/dist/channel-Dsjz0D5Z.js +5 -0
  14. package/dist/chunk-4BX2VUAB-Dk4r_XjO.js +8 -0
  15. package/dist/chunk-55IACEB6-O_k-h5nN.js +8 -0
  16. package/dist/chunk-B4BG7PRW-DVDQ5atJ.js +1375 -0
  17. package/dist/chunk-DI55MBZ5-CeD8zHDH.js +1370 -0
  18. package/dist/chunk-FMBD7UC4-_BECV2vM.js +19 -0
  19. package/dist/chunk-QN33PNHL-BZt9yPgN.js +19 -0
  20. package/dist/chunk-QZHKN3VN-VPFLLErx.js +15 -0
  21. package/dist/chunk-TZMSLE5B-DRZQTDqv.js +64 -0
  22. package/dist/classDiagram-2ON5EDUG-Pjlv98sa.js +16 -0
  23. package/dist/classDiagram-v2-WZHVMYZB-Pjlv98sa.js +16 -0
  24. package/dist/clone-CXHEQoEn.js +8 -0
  25. package/dist/components/attention-box/attention-box.css.js +8 -0
  26. package/dist/components/auth/login-button.js +1 -1
  27. package/dist/components/auth/login-panel.d.ts +4 -0
  28. package/dist/components/auth/login-panel.js +12 -4
  29. package/dist/components/auth/oauth-login.css.js +4 -0
  30. package/dist/components/auth/oauth-login.d.ts +2 -0
  31. package/dist/components/auth/oauth-login.js +12 -3
  32. package/dist/components/brokerable.d.ts +21 -0
  33. package/dist/components/brokerable.js +39 -0
  34. package/dist/components/bundle-toolbar/bundle-toolbar.css.js +110 -0
  35. package/dist/components/bundle-toolbar/bundle-toolbar.d.ts +21 -0
  36. package/dist/components/bundle-toolbar/bundle-toolbar.js +93 -0
  37. package/dist/components/changelog/changelog.css.js +2 -0
  38. package/dist/components/changelog/changelog.d.ts +2 -0
  39. package/dist/components/changelog/changelog.js +10 -1
  40. package/dist/components/changelog/release.css.js +5 -1
  41. package/dist/components/charts/beefy-chart.d.ts +1 -0
  42. package/dist/components/charts/beefy-chart.js +6 -3
  43. package/dist/components/charts/chart-colors.d.ts +8 -0
  44. package/dist/components/charts/chart-colors.js +46 -1
  45. package/dist/components/charts/doughnut-chart.d.ts +5 -1
  46. package/dist/components/charts/doughnut-chart.js +30 -6
  47. package/dist/components/credit-ticker/credit-ticker.d.ts +3 -0
  48. package/dist/components/credit-ticker/credit-ticker.js +22 -10
  49. package/dist/components/details-drawer/details-drawer.css.d.ts +2 -0
  50. package/dist/components/{problem-list → details-drawer}/details-drawer.css.js +18 -3
  51. package/dist/components/details-drawer/generic-details-drawer.css.d.ts +1 -0
  52. package/dist/components/details-drawer/generic-details-drawer.css.js +219 -0
  53. package/dist/components/details-drawer/generic-details-drawer.d.ts +38 -0
  54. package/dist/components/details-drawer/generic-details-drawer.js +245 -0
  55. package/dist/components/details-drawer/handlers/diagram-handler.d.ts +35 -0
  56. package/dist/components/details-drawer/handlers/diagram-handler.js +248 -0
  57. package/dist/components/details-drawer/handlers/documentation-handler.d.ts +11 -0
  58. package/dist/components/details-drawer/handlers/documentation-handler.js +46 -0
  59. package/dist/components/details-drawer/handlers/example-handler.d.ts +18 -0
  60. package/dist/components/details-drawer/handlers/example-handler.js +146 -0
  61. package/dist/components/details-drawer/handlers/howto-handler.d.ts +11 -0
  62. package/dist/components/details-drawer/handlers/howto-handler.js +36 -0
  63. package/dist/components/details-drawer/handlers/markdown-handler.d.ts +12 -0
  64. package/dist/components/details-drawer/handlers/markdown-handler.js +54 -0
  65. package/dist/components/editor/editor-breadcrumb.css.js +1 -1
  66. package/dist/components/editor/editor.css.js +42 -0
  67. package/dist/components/editor/editor.d.ts +29 -3
  68. package/dist/components/editor/editor.js +504 -88
  69. package/dist/components/editor/schemas/openapi32.json +1666 -0
  70. package/dist/components/github/github-workspace-view.css.d.ts +2 -0
  71. package/dist/components/github/github-workspace-view.css.js +166 -0
  72. package/dist/components/github/github-workspace-view.d.ts +61 -0
  73. package/dist/components/github/github-workspace-view.js +531 -0
  74. package/dist/components/global-task/global-task-view.css.d.ts +2 -0
  75. package/dist/components/global-task/global-task-view.css.js +392 -0
  76. package/dist/components/global-task/global-task-view.d.ts +48 -0
  77. package/dist/components/global-task/global-task-view.js +359 -0
  78. package/dist/components/header/header.css.js +9 -1
  79. package/dist/components/http-method/http-method.css.js +11 -1
  80. package/dist/components/indeterminate-loader/indeterminate-loader.css.d.ts +2 -0
  81. package/dist/components/indeterminate-loader/indeterminate-loader.css.js +135 -0
  82. package/dist/components/indeterminate-loader/indeterminate-loader.d.ts +35 -0
  83. package/dist/components/indeterminate-loader/indeterminate-loader.js +201 -0
  84. package/dist/components/kv-view/kv-view.css.js +2 -0
  85. package/dist/components/kv-view/kv-view.js +0 -1
  86. package/dist/components/logo-wall/logo-wall.css.js +9 -0
  87. package/dist/components/manage-ruleset/manage-ruleset.css.js +15 -2
  88. package/dist/components/manage-ruleset/manage-ruleset.d.ts +1 -0
  89. package/dist/components/manage-ruleset/manage-ruleset.js +55 -23
  90. package/dist/components/manage-ruleset/rule-action.css.js +2 -0
  91. package/dist/components/manage-ruleset/rule-action.d.ts +10 -3
  92. package/dist/components/manage-ruleset/rule-action.js +118 -129
  93. package/dist/components/manage-ruleset/rule-input.d.ts +4 -1
  94. package/dist/components/manage-ruleset/rule-input.js +47 -34
  95. package/dist/components/manage-ruleset/rule.css.js +15 -1
  96. package/dist/components/manage-ruleset/rule.d.ts +4 -1
  97. package/dist/components/manage-ruleset/rule.js +44 -17
  98. package/dist/components/mermaid/mermaid-renderer.css.d.ts +1 -0
  99. package/dist/components/mermaid/mermaid-renderer.css.js +121 -0
  100. package/dist/components/mermaid/mermaid-renderer.d.ts +75 -0
  101. package/dist/components/mermaid/mermaid-renderer.js +485 -0
  102. package/dist/components/model-icon/doctor-icon.d.ts +9 -0
  103. package/dist/components/model-icon/doctor-icon.js +60 -0
  104. package/dist/components/model-icon/model-icon.d.ts +2 -1
  105. package/dist/components/model-icon/model-icon.js +13 -1
  106. package/dist/components/model-renderer/change.css.js +33 -9
  107. package/dist/components/model-renderer/changes.d.ts +1 -0
  108. package/dist/components/model-renderer/changes.js +47 -32
  109. package/dist/components/model-renderer/clickable-ref.d.ts +9 -3
  110. package/dist/components/model-renderer/clickable-ref.js +49 -10
  111. package/dist/components/model-renderer/components.d.ts +2 -0
  112. package/dist/components/model-renderer/components.js +196 -116
  113. package/dist/components/model-renderer/contact.js +2 -2
  114. package/dist/components/model-renderer/description.css.js +2 -0
  115. package/dist/components/model-renderer/document.d.ts +1 -0
  116. package/dist/components/model-renderer/document.js +14 -9
  117. package/dist/components/model-renderer/encoding.d.ts +2 -0
  118. package/dist/components/model-renderer/encoding.js +16 -7
  119. package/dist/components/model-renderer/example.css.js +5 -1
  120. package/dist/components/model-renderer/example.d.ts +4 -1
  121. package/dist/components/model-renderer/example.js +72 -118
  122. package/dist/components/model-renderer/extensions.d.ts +2 -0
  123. package/dist/components/model-renderer/extensions.js +11 -2
  124. package/dist/components/model-renderer/external-docs.d.ts +2 -0
  125. package/dist/components/model-renderer/external-docs.js +13 -4
  126. package/dist/components/model-renderer/has-changes.js +3 -3
  127. package/dist/components/model-renderer/header.d.ts +2 -0
  128. package/dist/components/model-renderer/header.js +27 -14
  129. package/dist/components/model-renderer/info.d.ts +2 -0
  130. package/dist/components/model-renderer/info.js +20 -7
  131. package/dist/components/model-renderer/link.d.ts +2 -0
  132. package/dist/components/model-renderer/link.js +27 -10
  133. package/dist/components/model-renderer/media-type.js +2 -2
  134. package/dist/components/model-renderer/model-badge.d.ts +11 -0
  135. package/dist/components/model-renderer/model-badge.js +59 -0
  136. package/dist/components/model-renderer/model-shared.css.js +14 -2
  137. package/dist/components/model-renderer/oauth-flows.js +4 -4
  138. package/dist/components/model-renderer/operation.d.ts +2 -1
  139. package/dist/components/model-renderer/operation.js +37 -16
  140. package/dist/components/model-renderer/param-location.js +3 -3
  141. package/dist/components/model-renderer/parameter.d.ts +2 -0
  142. package/dist/components/model-renderer/parameter.js +28 -15
  143. package/dist/components/model-renderer/path-item.d.ts +3 -0
  144. package/dist/components/model-renderer/path-item.js +52 -80
  145. package/dist/components/model-renderer/paths.d.ts +2 -0
  146. package/dist/components/model-renderer/paths.js +10 -3
  147. package/dist/components/model-renderer/problem-node.js +10 -10
  148. package/dist/components/model-renderer/rendered-node.css.js +36 -7
  149. package/dist/components/model-renderer/rendered-node.d.ts +14 -4
  150. package/dist/components/model-renderer/rendered-node.js +121 -58
  151. package/dist/components/model-renderer/rendered-property.js +4 -4
  152. package/dist/components/model-renderer/request-body.d.ts +2 -0
  153. package/dist/components/model-renderer/request-body.js +16 -9
  154. package/dist/components/model-renderer/response.d.ts +2 -0
  155. package/dist/components/model-renderer/response.js +35 -17
  156. package/dist/components/model-renderer/schema.css.js +10 -1
  157. package/dist/components/model-renderer/schema.d.ts +3 -2
  158. package/dist/components/model-renderer/schema.js +127 -129
  159. package/dist/components/model-renderer/security-scheme.js +3 -3
  160. package/dist/components/model-renderer/server.js +18 -8
  161. package/dist/components/model-renderer/tag.js +1 -1
  162. package/dist/components/model-tree/tree.css.js +24 -10
  163. package/dist/components/model-tree/tree.d.ts +39 -22
  164. package/dist/components/model-tree/tree.js +240 -167
  165. package/dist/components/paginator/paginator-navigator.css.js +9 -5
  166. package/dist/components/paginator/paginator-navigator.js +6 -6
  167. package/dist/components/paginator/paginator.css.js +3 -1
  168. package/dist/components/paginator/paginator.js +5 -8
  169. package/dist/components/percent-bar/percent-bar.css.js +133 -13
  170. package/dist/components/percent-bar/percent-bar.d.ts +2 -0
  171. package/dist/components/percent-bar/percent-bar.js +28 -24
  172. package/dist/components/premium-gate/premium-gate.css.d.ts +1 -0
  173. package/dist/components/premium-gate/premium-gate.css.js +117 -0
  174. package/dist/components/premium-gate/premium-gate.d.ts +49 -0
  175. package/dist/components/premium-gate/premium-gate.js +336 -0
  176. package/dist/components/problem-list/problem-list.css.js +74 -3
  177. package/dist/components/problem-list/problem-list.d.ts +19 -9
  178. package/dist/components/problem-list/problem-list.js +241 -226
  179. package/dist/components/problem-list/problem-mainview.css.js +12 -2
  180. package/dist/components/problem-list/problem-mainview.d.ts +3 -0
  181. package/dist/components/problem-list/problem-mainview.js +37 -17
  182. package/dist/components/problem-list/problem-toolbar.css.js +10 -7
  183. package/dist/components/problems-overview/diagnostic-evaluation.css.js +11 -1
  184. package/dist/components/problems-overview/diagnostic-evaluation.js +6 -7
  185. package/dist/components/problems-overview/document-statistic.css.js +6 -0
  186. package/dist/components/problems-overview/document-statistic.js +1 -1
  187. package/dist/components/problems-overview/problem-overview-group.js +5 -5
  188. package/dist/components/problems-overview/problem-statistic.css.js +24 -5
  189. package/dist/components/problems-overview/problem-statistic.js +15 -6
  190. package/dist/components/problems-overview/problem-statistics.css.js +4 -4
  191. package/dist/components/problems-overview/problem-statistics.js +29 -25
  192. package/dist/components/problems-overview/problems-overview.css.js +3 -2
  193. package/dist/components/problems-overview/problems-overview.js +7 -6
  194. package/dist/components/property-view/property-view.css.js +2 -0
  195. package/dist/components/render-json-path/render-json-path.css.js +11 -3
  196. package/dist/components/render-json-path/render-json-path.js +3 -0
  197. package/dist/components/render-operation-path/render-operation-path.css.js +9 -0
  198. package/dist/components/render-operation-path/render-operation-path.js +7 -22
  199. package/dist/components/rodeo/rodeo.d.ts +1 -0
  200. package/dist/components/rodeo/rodeo.js +5 -0
  201. package/dist/components/rodeo/roundup.js +2 -2
  202. package/dist/components/rodeo/statistic.css.js +25 -2
  203. package/dist/components/rodeo/statistic.js +0 -4
  204. package/dist/components/shader-canvas/shader-canvas.css.d.ts +2 -0
  205. package/dist/components/shader-canvas/shader-canvas.css.js +66 -0
  206. package/dist/components/shader-canvas/shader-canvas.d.ts +36 -0
  207. package/dist/components/shader-canvas/shader-canvas.js +363 -0
  208. package/dist/components/shaders/flowing-waves-shader.d.ts +2 -0
  209. package/dist/components/shaders/flowing-waves-shader.js +70 -0
  210. package/dist/components/shaders/neon-canyon-shader.d.ts +2 -0
  211. package/dist/components/shaders/neon-canyon-shader.js +265 -0
  212. package/dist/components/shaders/neon-lines-shader.d.ts +2 -0
  213. package/dist/components/shaders/neon-lines-shader.js +181 -0
  214. package/dist/components/shaders/neon-squircles-shader.d.ts +2 -0
  215. package/dist/components/shaders/neon-squircles-shader.js +56 -0
  216. package/dist/components/shaders/retro-grid-shader.d.ts +2 -0
  217. package/dist/components/shaders/retro-grid-shader.js +53 -0
  218. package/dist/components/shaders/shader-base.d.ts +9 -0
  219. package/dist/components/shaders/shader-base.js +11 -0
  220. package/dist/components/terminal/terminal-example.css.js +4 -0
  221. package/dist/components/terminal/terminal-example.js +2 -3
  222. package/dist/components/terminal-emulator/terminal-emulator.css.js +13 -3
  223. package/dist/components/terminal-emulator/terminal-emulator.d.ts +7 -1
  224. package/dist/components/terminal-emulator/terminal-emulator.js +10 -5
  225. package/dist/components/the-doctor/doctor-controls-panel.css.d.ts +2 -0
  226. package/dist/components/the-doctor/doctor-controls-panel.css.js +53 -0
  227. package/dist/components/the-doctor/doctor-controls-panel.d.ts +20 -0
  228. package/dist/components/the-doctor/doctor-controls-panel.js +78 -0
  229. package/dist/components/the-doctor/doctor-editor-panel.css.d.ts +2 -0
  230. package/dist/components/the-doctor/doctor-editor-panel.css.js +209 -0
  231. package/dist/components/the-doctor/doctor-editor-panel.d.ts +41 -0
  232. package/dist/components/the-doctor/doctor-editor-panel.js +189 -0
  233. package/dist/components/the-doctor/doctor-navigator-panel.css.d.ts +2 -0
  234. package/dist/components/the-doctor/doctor-navigator-panel.css.js +134 -0
  235. package/dist/components/the-doctor/doctor-navigator-panel.d.ts +35 -0
  236. package/dist/components/the-doctor/doctor-navigator-panel.js +117 -0
  237. package/dist/components/the-doctor/doctor-sidebar-panel.css.d.ts +2 -0
  238. package/dist/components/the-doctor/doctor-sidebar-panel.css.js +143 -0
  239. package/dist/components/the-doctor/doctor-sidebar-panel.d.ts +31 -0
  240. package/dist/components/the-doctor/doctor-sidebar-panel.js +131 -0
  241. package/dist/components/the-doctor/doctor-url-overlay.css.d.ts +2 -0
  242. package/dist/components/the-doctor/doctor-url-overlay.css.js +59 -0
  243. package/dist/components/the-doctor/doctor-url-overlay.d.ts +23 -0
  244. package/dist/components/the-doctor/doctor-url-overlay.js +82 -0
  245. package/dist/components/the-doctor/nuke-workspace.js +4 -3
  246. package/dist/components/the-doctor/settings.css.js +2 -0
  247. package/dist/components/the-doctor/settings.js +5 -8
  248. package/dist/components/the-doctor/sparks.d.ts +3 -0
  249. package/dist/components/the-doctor/sparks.js +22 -4
  250. package/dist/components/the-doctor/status-bar.d.ts +2 -2
  251. package/dist/components/the-doctor/status-bar.js +32 -31
  252. package/dist/components/the-doctor/the-doctor.css.js +51 -242
  253. package/dist/components/the-doctor/the-doctor.d.ts +150 -37
  254. package/dist/components/the-doctor/the-doctor.js +967 -536
  255. package/dist/components/the-doctor/upload-archive.css.js +14 -2
  256. package/dist/components/the-doctor/upload-archive.js +4 -2
  257. package/dist/components/theme-switcher/theme-switcher.js +5 -1
  258. package/dist/components/time-vortex/change-list-item.css.js +18 -4
  259. package/dist/components/time-vortex/change-list-item.d.ts +1 -0
  260. package/dist/components/time-vortex/change-list-item.js +4 -3
  261. package/dist/components/time-vortex/history-picker.css.js +78 -2
  262. package/dist/components/time-vortex/history-picker.d.ts +7 -1
  263. package/dist/components/time-vortex/history-picker.js +127 -5
  264. package/dist/components/time-vortex/tardis-control.css.js +358 -15
  265. package/dist/components/time-vortex/tardis-control.d.ts +32 -3
  266. package/dist/components/time-vortex/tardis-control.js +322 -58
  267. package/dist/components/time-vortex/time-vortex.d.ts +8 -2
  268. package/dist/components/time-vortex/time-vortex.js +54 -13
  269. package/dist/components/toast/toast-component.css.js +1 -0
  270. package/dist/components/toast/toast-component.d.ts +1 -0
  271. package/dist/components/toast/toast-component.js +23 -8
  272. package/dist/components/toast/toast-manager.d.ts +5 -0
  273. package/dist/components/toast/toast-manager.js +35 -10
  274. package/dist/components/visualizer/edge.d.ts +11 -1
  275. package/dist/components/visualizer/edge.js +27 -22
  276. package/dist/components/visualizer/equalizer.css.js +119 -77
  277. package/dist/components/visualizer/equalizer.d.ts +24 -45
  278. package/dist/components/visualizer/equalizer.js +262 -363
  279. package/dist/components/visualizer/explorer.d.ts +94 -14
  280. package/dist/components/visualizer/explorer.js +580 -393
  281. package/dist/components/visualizer/foreign-object.d.ts +12 -2
  282. package/dist/components/visualizer/foreign-object.js +21 -10
  283. package/dist/components/visualizer/key.js +12 -1
  284. package/dist/components/visualizer/nodes/callback.d.ts +2 -1
  285. package/dist/components/visualizer/nodes/callback.js +2 -2
  286. package/dist/components/visualizer/nodes/components.d.ts +2 -1
  287. package/dist/components/visualizer/nodes/components.js +2 -2
  288. package/dist/components/visualizer/nodes/contact.d.ts +2 -1
  289. package/dist/components/visualizer/nodes/contact.js +2 -2
  290. package/dist/components/visualizer/nodes/document.d.ts +2 -1
  291. package/dist/components/visualizer/nodes/document.js +2 -2
  292. package/dist/components/visualizer/nodes/graph-node.d.ts +14 -3
  293. package/dist/components/visualizer/nodes/graph-node.js +94 -43
  294. package/dist/components/visualizer/nodes/header.d.ts +2 -1
  295. package/dist/components/visualizer/nodes/header.js +2 -2
  296. package/dist/components/visualizer/nodes/info.d.ts +2 -1
  297. package/dist/components/visualizer/nodes/info.js +2 -2
  298. package/dist/components/visualizer/nodes/license.d.ts +2 -1
  299. package/dist/components/visualizer/nodes/license.js +2 -2
  300. package/dist/components/visualizer/nodes/link.d.ts +2 -1
  301. package/dist/components/visualizer/nodes/link.js +2 -2
  302. package/dist/components/visualizer/nodes/media-type.d.ts +2 -1
  303. package/dist/components/visualizer/nodes/media-type.js +2 -2
  304. package/dist/components/visualizer/nodes/operation.d.ts +2 -1
  305. package/dist/components/visualizer/nodes/operation.js +3 -4
  306. package/dist/components/visualizer/nodes/parameter.d.ts +3 -1
  307. package/dist/components/visualizer/nodes/parameter.js +3 -4
  308. package/dist/components/visualizer/nodes/path-item.d.ts +2 -1
  309. package/dist/components/visualizer/nodes/path-item.js +2 -2
  310. package/dist/components/visualizer/nodes/request-body.d.ts +2 -1
  311. package/dist/components/visualizer/nodes/request-body.js +2 -2
  312. package/dist/components/visualizer/nodes/response.d.ts +2 -1
  313. package/dist/components/visualizer/nodes/response.js +2 -2
  314. package/dist/components/visualizer/nodes/schema.d.ts +2 -1
  315. package/dist/components/visualizer/nodes/schema.js +64 -9
  316. package/dist/components/visualizer/nodes/security-scheme.d.ts +2 -1
  317. package/dist/components/visualizer/nodes/security-scheme.js +2 -2
  318. package/dist/components/visualizer/nodes/server.d.ts +2 -1
  319. package/dist/components/visualizer/nodes/server.js +3 -4
  320. package/dist/components/visualizer/nodes/tag.d.ts +2 -1
  321. package/dist/components/visualizer/nodes/tag.js +4 -5
  322. package/dist/components/visualizer/nodes/xml.d.ts +2 -1
  323. package/dist/components/visualizer/nodes/xml.js +2 -2
  324. package/dist/components/visualizer/orientation-controls.d.ts +6 -1
  325. package/dist/components/visualizer/orientation-controls.js +65 -7
  326. package/dist/components/visualizer/search.d.ts +2 -1
  327. package/dist/components/visualizer/search.js +22 -29
  328. package/dist/components/visualizer/shared.css.js +55 -18
  329. package/dist/components/visualizer/templates/svg-markers.d.ts +2 -0
  330. package/dist/components/visualizer/templates/svg-markers.js +73 -0
  331. package/dist/components/waiting-line/waiting-line.css.d.ts +2 -0
  332. package/dist/components/waiting-line/waiting-line.css.js +26 -0
  333. package/dist/components/waiting-line/waiting-line.d.ts +30 -0
  334. package/dist/components/waiting-line/waiting-line.js +424 -0
  335. package/dist/components/workspaces/workspace-view.css.js +89 -8
  336. package/dist/components/workspaces/workspace-view.d.ts +8 -1
  337. package/dist/components/workspaces/workspace-view.js +77 -25
  338. package/dist/controllers/auth-controller.d.ts +9 -0
  339. package/dist/controllers/auth-controller.js +12 -5
  340. package/dist/controllers/broker-controller.d.ts +31 -4
  341. package/dist/controllers/broker-controller.js +153 -25
  342. package/dist/controllers/bundle-controller.d.ts +21 -0
  343. package/dist/controllers/bundle-controller.js +122 -0
  344. package/dist/controllers/countdown-controller.d.ts +17 -0
  345. package/dist/controllers/countdown-controller.js +59 -0
  346. package/dist/controllers/diagnostic-controller.d.ts +25 -5
  347. package/dist/controllers/diagnostic-controller.js +261 -217
  348. package/dist/controllers/diagramatron-controller.d.ts +33 -0
  349. package/dist/controllers/diagramatron-controller.js +128 -0
  350. package/dist/controllers/docs-controller.d.ts +11 -5
  351. package/dist/controllers/docs-controller.js +97 -97
  352. package/dist/controllers/github-controller.d.ts +47 -0
  353. package/dist/controllers/github-controller.js +504 -0
  354. package/dist/controllers/global-task-controller.d.ts +46 -0
  355. package/dist/controllers/global-task-controller.js +352 -0
  356. package/dist/controllers/model-controller.d.ts +26 -4
  357. package/dist/controllers/model-controller.js +98 -62
  358. package/dist/controllers/node-clicker-controller.d.ts +121 -4
  359. package/dist/controllers/node-clicker-controller.js +526 -253
  360. package/dist/controllers/problem-controller.d.ts +11 -4
  361. package/dist/controllers/problem-controller.js +98 -39
  362. package/dist/controllers/rolodex-controller.d.ts +8 -3
  363. package/dist/controllers/rolodex-controller.js +116 -84
  364. package/dist/controllers/rule-controller.d.ts +12 -5
  365. package/dist/controllers/rule-controller.js +154 -161
  366. package/dist/controllers/spec-controller.d.ts +17 -4
  367. package/dist/controllers/spec-controller.js +104 -61
  368. package/dist/controllers/state-controller.d.ts +4 -3
  369. package/dist/controllers/state-controller.js +208 -160
  370. package/dist/controllers/tab-cache-controller.d.ts +29 -0
  371. package/dist/controllers/tab-cache-controller.js +68 -0
  372. package/dist/controllers/timeline-controller.d.ts +18 -0
  373. package/dist/controllers/timeline-controller.js +129 -0
  374. package/dist/controllers/wallet-controller.d.ts +3 -3
  375. package/dist/controllers/wallet-controller.js +22 -41
  376. package/dist/controllers/workspace-controller.d.ts +10 -4
  377. package/dist/controllers/workspace-controller.js +67 -22
  378. package/dist/cose-bilkent-S5V4N54A-BgwjXRSW.js +2608 -0
  379. package/dist/cowboy-components-BRANjWMG.js +68686 -0
  380. package/dist/cowboy-components.css +1 -1
  381. package/dist/cowboy-components.umd.cjs +14243 -6638
  382. package/dist/css/alerts.css.js +2 -0
  383. package/dist/css/badges.css.js +2 -0
  384. package/dist/css/button.css.js +34 -1
  385. package/dist/css/chroma-synxtax.css.js +14 -14
  386. package/dist/css/cowboy-components.css +45 -1
  387. package/dist/css/dialog.css.js +11 -2
  388. package/dist/css/filter.css.js +17 -5
  389. package/dist/css/forms.css.js +14 -0
  390. package/dist/css/pb33f-theme.css +126 -16
  391. package/dist/css/scrollbar.css.js +1 -1
  392. package/dist/css/syntax.css.js +5 -0
  393. package/dist/css/tabs.css.js +19 -2
  394. package/dist/css/tooltip.css.js +4 -0
  395. package/dist/cytoscape.esm-DfdJODL8.js +18735 -0
  396. package/dist/dagre-6UL2VRFP-BzQ5nLXU.js +444 -0
  397. package/dist/defaultLocale-D7EN2tov.js +171 -0
  398. package/dist/diagram-PSM6KHXK-CdohCqjr.js +531 -0
  399. package/dist/diagram-QEK2KX5R-BP_3efmD.js +217 -0
  400. package/dist/diagram-S2PKOQOG-BftsBKuz.js +142 -0
  401. package/dist/erDiagram-Q2GNP2WA-fSbCC-Ow.js +841 -0
  402. package/dist/events/doctor.d.ts +64 -9
  403. package/dist/events/doctor.js +30 -1
  404. package/dist/events/drawer-events.d.ts +7 -0
  405. package/dist/events/drawer-events.js +3 -0
  406. package/dist/events/theme.d.ts +4 -0
  407. package/dist/events/theme.js +1 -0
  408. package/dist/factories/explorer-component-factory.d.ts +49 -0
  409. package/dist/factories/explorer-component-factory.js +205 -0
  410. package/dist/factories/state-controller-deps.factory.d.ts +88 -0
  411. package/dist/factories/state-controller-deps.factory.js +116 -0
  412. package/dist/flowDiagram-NV44I4VS-CCPxaTIx.js +1620 -0
  413. package/dist/ganttDiagram-LVOFAZNH-Cb2dn6QY.js +2505 -0
  414. package/dist/gitGraph-F6HP7TQM-B-Up3f_K.js +5 -0
  415. package/dist/gitGraphDiagram-NY62KEGX-DdaCm8WP.js +699 -0
  416. package/dist/graph-BSko0AhB.js +247 -0
  417. package/dist/helpers/event-wiring.d.ts +72 -0
  418. package/dist/helpers/event-wiring.js +58 -0
  419. package/dist/helpers/file-size-formatter.d.ts +3 -0
  420. package/dist/helpers/file-size-formatter.js +15 -0
  421. package/dist/helpers/filename-colorizer.d.ts +5 -0
  422. package/dist/helpers/filename-colorizer.js +32 -0
  423. package/dist/helpers/navigation-helper.d.ts +54 -0
  424. package/dist/helpers/navigation-helper.js +159 -0
  425. package/dist/helpers/typed-events.d.ts +1 -0
  426. package/dist/helpers/typed-events.js +3 -0
  427. package/dist/info-NVLQJR56-BNIO2OjW.js +5 -0
  428. package/dist/infoDiagram-F6ZHWCRC-DoDRDWc6.js +24 -0
  429. package/dist/init-DjUOC4st.js +16 -0
  430. package/dist/interfaces/bundle-interfaces.d.ts +7 -0
  431. package/dist/interfaces/bundle-interfaces.js +1 -0
  432. package/dist/interfaces/doctor-interfaces.d.ts +513 -0
  433. package/dist/interfaces/doctor-interfaces.js +1 -0
  434. package/dist/journeyDiagram-XKPGCS4Q-B8rBrT3-.js +834 -0
  435. package/dist/kanban-definition-3W4ZIXB7-qXzC-ucZ.js +719 -0
  436. package/dist/katex-SsTUIUTC.js +11688 -0
  437. package/dist/layout-crJEPmAx.js +1324 -0
  438. package/dist/linear-C9sTEJtE.js +259 -0
  439. package/dist/managers/drag-handler.d.ts +28 -0
  440. package/dist/managers/drag-handler.js +64 -0
  441. package/dist/managers/event-registration-manager.d.ts +17 -0
  442. package/dist/managers/event-registration-manager.js +34 -0
  443. package/dist/managers/expansion-manager.d.ts +58 -0
  444. package/dist/managers/expansion-manager.js +189 -0
  445. package/dist/managers/layout-filter-manager.d.ts +31 -0
  446. package/dist/managers/layout-filter-manager.js +109 -0
  447. package/dist/managers/panel-divider-manager.d.ts +33 -0
  448. package/dist/managers/panel-divider-manager.js +71 -0
  449. package/dist/managers/view-state-manager.d.ts +48 -0
  450. package/dist/managers/view-state-manager.js +101 -0
  451. package/dist/managers/viewport-manager.d.ts +53 -0
  452. package/dist/managers/viewport-manager.js +198 -0
  453. package/dist/mermaid-parser.core-quOEU4Mi.js +12966 -0
  454. package/dist/mindmap-definition-VGOIOE7T-BGn7cQVA.js +784 -0
  455. package/dist/mocks/task-mock-generator.d.ts +13 -0
  456. package/dist/mocks/task-mock-generator.js +200 -0
  457. package/dist/model/api-response.d.ts +2 -7
  458. package/dist/model/api-response.js +0 -2
  459. package/dist/model/bundle.d.ts +35 -0
  460. package/dist/model/bundle.js +1 -0
  461. package/dist/model/channels.d.ts +8 -1
  462. package/dist/model/channels.js +7 -0
  463. package/dist/model/drawer-content.d.ts +80 -0
  464. package/dist/model/drawer-content.js +14 -0
  465. package/dist/model/formable.js +22 -11
  466. package/dist/model/github.d.ts +125 -0
  467. package/dist/model/github.js +1 -0
  468. package/dist/model/graph.d.ts +15 -15
  469. package/dist/model/graph.js +24 -4
  470. package/dist/model/media-type.js +2 -2
  471. package/dist/model/node_type.d.ts +4 -0
  472. package/dist/model/node_type.js +4 -0
  473. package/dist/model/panel-state.d.ts +1 -0
  474. package/dist/model/rolodex.d.ts +3 -0
  475. package/dist/model/task.d.ts +50 -0
  476. package/dist/model/task.js +22 -0
  477. package/dist/model/timeline.d.ts +110 -1
  478. package/dist/model/tree-icon-config.d.ts +11 -0
  479. package/dist/model/tree-icon-config.js +46 -0
  480. package/dist/model/workspace.d.ts +2 -0
  481. package/dist/ordinal-DfAQgscy.js +61 -0
  482. package/dist/packet-BFZMPI3H-BKreTkjY.js +5 -0
  483. package/dist/pie-7BOR55EZ-DUWhTPH8.js +5 -0
  484. package/dist/pieDiagram-ADFJNKIX-BeLJhCCS.js +161 -0
  485. package/dist/quadrantDiagram-AYHSOK5B-z-oixLGm.js +1022 -0
  486. package/dist/radar-NHE76QYJ-DXE9hYwD.js +5 -0
  487. package/dist/requirementDiagram-UZGBJVZJ-Bso8sdSb.js +850 -0
  488. package/dist/sankeyDiagram-TZEHDZUN-BqcEpr7O.js +810 -0
  489. package/dist/sequenceDiagram-WL72ISMW-DTAwlNVG.js +2511 -0
  490. package/dist/services/diagramatron-service.d.ts +20 -0
  491. package/dist/services/diagramatron-service.js +48 -0
  492. package/dist/services/doctor-events.d.ts +58 -0
  493. package/dist/services/doctor-events.js +33 -0
  494. package/dist/services/drawer-content-registry.d.ts +9 -0
  495. package/dist/services/drawer-content-registry.js +37 -0
  496. package/dist/services/github-service.d.ts +9 -0
  497. package/dist/services/github-service.js +166 -0
  498. package/dist/services/global-task-service.d.ts +6 -0
  499. package/dist/services/global-task-service.js +27 -0
  500. package/dist/services/header-service.d.ts +5 -3
  501. package/dist/services/header-service.js +13 -0
  502. package/dist/services/linting-service.d.ts +3 -0
  503. package/dist/services/linting-service.js +41 -2
  504. package/dist/services/mermaid-config-service.d.ts +53 -0
  505. package/dist/services/mermaid-config-service.js +519 -0
  506. package/dist/services/model-service.d.ts +12 -7
  507. package/dist/services/model-service.js +64 -11
  508. package/dist/services/rodeo-service.js +12 -12
  509. package/dist/services/timeline-service.d.ts +12 -2
  510. package/dist/services/timeline-service.js +329 -0
  511. package/dist/services/wallet-service.d.ts +1 -1
  512. package/dist/services/wallet-service.js +4 -1
  513. package/dist/services/workspace-service.js +16 -2
  514. package/dist/stateDiagram-FKZM4ZOC-EGdzJIDA.js +263 -0
  515. package/dist/stateDiagram-v2-4FDKWEC3-DZo5Qb9X.js +16 -0
  516. package/dist/timeline-definition-IT6M3QCI-BjX2TakV.js +795 -0
  517. package/dist/treemap-KMMF4GRG-D8sK0Tmc.js +5 -0
  518. package/dist/utils/language-utils.d.ts +1 -0
  519. package/dist/utils/language-utils.js +23 -0
  520. package/dist/utils/lru-cache.d.ts +11 -0
  521. package/dist/utils/lru-cache.js +38 -0
  522. package/dist/utils/node-helpers.d.ts +6 -0
  523. package/dist/utils/node-helpers.js +62 -0
  524. package/dist/utils/path-utils.d.ts +5 -0
  525. package/dist/utils/path-utils.js +22 -0
  526. package/dist/workers/elk-layout.worker.d.ts +2 -0
  527. package/dist/workers/elk-layout.worker.js +31 -0
  528. package/dist/workers/equalizer.worker.d.ts +6 -1
  529. package/dist/workers/equalizer.worker.js +144 -195
  530. package/dist/workers/graph-dependent.worker.js +6 -6
  531. package/dist/workers/rule-documentation.worker.js +12 -48
  532. package/dist/workers/search-graph.worker.js +8 -23
  533. package/dist/xychartDiagram-PRI3JC2R-CWx19mhU.js +1340 -0
  534. package/package.json +17 -10
  535. package/dist/assets/equalizer.worker-B1FBgh0h.js +0 -1
  536. package/dist/assets/graph-dependent.worker-CxW1u577.js +0 -1
  537. package/dist/assets/rule-documentation.worker-B4_JKUg4.js +0 -1
  538. package/dist/assets/search-graph.worker-DJxOIWLn.js +0 -1
  539. package/dist/components/problem-list/details-drawer.d.ts +0 -34
  540. package/dist/components/problem-list/details-drawer.js +0 -200
  541. /package/dist/components/{problem-list/details-drawer.css.d.ts → bundle-toolbar/bundle-toolbar.css.d.ts} +0 -0
@@ -6,10 +6,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { html } from "lit";
8
8
  import { customElement, state } from "lit/decorators.js";
9
+ import { GitHubWorkspaceView } from "../github/github-workspace-view.js";
9
10
  import { Formable } from "../../model/formable.js";
10
11
  import { WorkspaceForm } from "./workspace-form.js";
11
12
  import { WorkspaceDestroyView } from "./workspace-destroy-dialog.js";
12
- import { DeleteWorkspace, SwitchWorkspace, FormSubmitComplete, RefreshWorkspaces, CreateWorkspace, UpdateWorkspace, DailyCreditRequested, DailyCreditApplied, DailyCreditErrorChanged } from "../../events/doctor.js";
13
+ import { DeleteWorkspace, SwitchWorkspace, FormSubmitComplete, RefreshWorkspaces, CreateWorkspace, UpdateWorkspace, DailyCreditRequested, DailyCreditApplied, DailyCreditErrorChanged, LinkedWorkspaceHoverOver, LinkedWorkspaceHoverOut } from "../../events/doctor.js";
13
14
  import { AttentionType } from "../attention-box/attention-box.js";
14
15
  import listsCss from "../../css/lists.css.js";
15
16
  import workspaceViewCss from "./workspace-view.css.js";
@@ -17,16 +18,21 @@ import badgesCss from "../../css/badges.css.js";
17
18
  import linksCss from "../../css/links.css.js";
18
19
  import tooltipCss from "../../css/tooltip.css.js";
19
20
  import hrCss from "../../css/hr.css.js";
21
+ import { DoctorIcon } from "../model-icon/doctor-icon.js";
20
22
  let WorkspacesView = class WorkspacesView extends Formable {
21
- constructor(doc, wsController, walletController) {
23
+ constructor(doc, wsController, walletController, githubController) {
22
24
  super(doc);
23
25
  this.doc = doc;
24
26
  this.wsController = wsController;
25
27
  this.walletController = walletController;
28
+ this.githubController = githubController;
26
29
  this.active = false;
27
30
  this.mutateWorkspaceActive = false;
28
31
  this.workspaceForm = new WorkspaceForm();
29
32
  this.destroyDialog = new WorkspaceDestroyView();
33
+ this.githubView = new GitHubWorkspaceView();
34
+ this.githubView.githubController = this.githubController;
35
+ this.githubController.setGitHubView(this.githubView);
30
36
  this.setupDestroyDialogEvents();
31
37
  this.setupWorkspaceFormEvents();
32
38
  this.setupWalletEvents();
@@ -58,6 +64,13 @@ let WorkspacesView = class WorkspacesView extends Formable {
58
64
  this.walletController.addEventListener(DailyCreditApplied, () => this.requestUpdate());
59
65
  this.walletController.addEventListener(DailyCreditErrorChanged, () => this.requestUpdate());
60
66
  }
67
+ async firstUpdated() {
68
+ // Initialize GitHub controller after the view is rendered
69
+ if (this.githubController && this.doc?.brokerController) {
70
+ await this.doc.brokerController.waitUntilReady();
71
+ await this.githubController.init();
72
+ }
73
+ }
61
74
  handleDailyCreditRequest() {
62
75
  this.walletController.dispatchEvent(new CustomEvent(DailyCreditRequested, {
63
76
  bubbles: true,
@@ -84,17 +97,17 @@ let WorkspacesView = class WorkspacesView extends Formable {
84
97
  }
85
98
  lightWorkspace(id) {
86
99
  if (id) {
87
- let li = this.shadowRoot?.querySelector('li#workspace-' + id);
88
- if (li) {
89
- li.classList.add('active');
100
+ let row = this.shadowRoot?.querySelector('.workspace-row#workspace-' + id);
101
+ if (row) {
102
+ row.classList.add('active');
90
103
  }
91
104
  }
92
105
  }
93
106
  dimWorkspace(id) {
94
107
  if (id) {
95
- let li = this.shadowRoot?.querySelector('li#workspace-' + id);
96
- if (li) {
97
- li.classList.remove('active');
108
+ let row = this.shadowRoot?.querySelector('.workspace-row#workspace-' + id);
109
+ if (row) {
110
+ row.classList.remove('active');
98
111
  }
99
112
  }
100
113
  }
@@ -123,10 +136,40 @@ let WorkspacesView = class WorkspacesView extends Formable {
123
136
  deleteWorkspaceError(error) {
124
137
  this.destroyDialog.setError(error);
125
138
  }
139
+ handleWorkspaceHover(workspace) {
140
+ this.lightWorkspace(workspace.workspaceId);
141
+ if (workspace.linkedRepo && workspace.workspaceId) {
142
+ this.githubController.dispatchEvent(new CustomEvent(LinkedWorkspaceHoverOver, {
143
+ bubbles: true,
144
+ composed: true,
145
+ detail: {
146
+ repositoryId: workspace.linkedRepo,
147
+ workspaceId: workspace.workspaceId,
148
+ workspaceName: workspace.name
149
+ }
150
+ }));
151
+ }
152
+ }
153
+ handleWorkspaceUnhover(workspace) {
154
+ this.dimWorkspace(workspace.workspaceId);
155
+ if (workspace.linkedRepo && workspace.workspaceId) {
156
+ this.githubController.dispatchEvent(new CustomEvent(LinkedWorkspaceHoverOut, {
157
+ bubbles: true,
158
+ composed: true,
159
+ detail: {
160
+ repositoryId: workspace.linkedRepo,
161
+ workspaceId: workspace.workspaceId,
162
+ workspaceName: workspace.name
163
+ }
164
+ }));
165
+ }
166
+ }
126
167
  render() {
127
168
  if (!this.workspaces || this.workspaces.length === 0) {
128
169
  return html ``;
129
170
  }
171
+ const activeWorkspace = this.workspaces.find(w => w.active);
172
+ this.githubView.workspaceReadOnly = activeWorkspace?.readOnly ?? false;
130
173
  return html `
131
174
  <div class="workspace-area">
132
175
  ${this.destroyDialog}
@@ -160,42 +203,51 @@ let WorkspacesView = class WorkspacesView extends Formable {
160
203
  ` : ''}
161
204
 
162
205
  <hr class="main-break"/>
163
- <ul>
164
-
206
+ <div class="workspace-grid">
165
207
  ${this.workspaces.map((w) => {
166
208
  // Determine workspace content based on active status
167
209
  const workspaceContent = w.active
168
210
  ? html `<strong>${w.name}</strong> &nbsp;<sl-badge pulse>active</sl-badge>`
169
211
  : html `<a href="#" class="workspace-link" @click=${() => this.selectWorkspace(w)}>${w.name}</a>`;
170
- // Determine CSS classes and styling
171
- const liClasses = w.active ? 'secondary' : '';
172
- const liStyles = w.active ? 'color: var(--secondary-color)' : '';
212
+ // Determine chevron color based on active status
213
+ const chevronColor = w.active ? 'var(--secondary-color)' : 'var(--primary-color)';
173
214
  return html `
174
- <li id="workspace-${w.workspaceId}"
175
- class="${liClasses}"
176
- style="${liStyles}"
177
- @mouseover="${() => this.lightWorkspace(w.workspaceId)}"
178
- @mouseout="${() => this.dimWorkspace(w.workspaceId)}">
215
+ <div class="workspace-row"
216
+ id="workspace-${w.workspaceId}"
217
+ @mouseover="${() => this.handleWorkspaceHover(w)}"
218
+ @mouseout="${() => this.handleWorkspaceUnhover(w)}">
219
+
220
+ <div class="col-github-icon">
221
+ ${w.linkedRepo ? DoctorIcon.getGitHubIcon(16) : ''}
222
+ </div>
179
223
 
180
- ${workspaceContent}
224
+ <div class="col-chevron" style="color: ${chevronColor}">></div>
181
225
 
182
- <div style="display: inline-block; float: right">
183
- <sl-icon-button class="edit-workspace" name="pencil-square"
226
+ <div class="col-name">
227
+ ${workspaceContent}
228
+ </div>
229
+
230
+ <div class="col-actions">
231
+ <sl-icon-button class="edit-workspace" name="pencil-square" label="Edit workspace"
184
232
  @click="${() => { this.showEditDialog(w); }}"></sl-icon-button>
185
233
  ${!w.default && !w.active ? html `
186
- <sl-icon-button class="delete-workspace" name="trash3"
234
+ <sl-icon-button class="delete-workspace" name="trash3" label="Delete workspace"
187
235
  @click="${() => { this.showDestroyDialog(w); }}"></sl-icon-button>
188
236
  ` : ''}
189
237
  </div>
190
- </li>
238
+ </div>
191
239
  `;
192
240
  })}
193
- </ul>
241
+ </div>
242
+
243
+ <hr/>
244
+
245
+ ${this.githubView}
194
246
 
195
247
  <hr/>
196
248
  <h3>
197
249
  <span style="color: var(--terminal-text)">$</span>
198
- Free Daily Credit <span style="color: var(--terminal-text)">$</span>
250
+ FREE DAILY CREDIT <span style="color: var(--terminal-text)">$</span>
199
251
  </h3>
200
252
 
201
253
  <p>
@@ -1,6 +1,15 @@
1
1
  import { AuthenticationMeta } from "../events/doctor.js";
2
2
  import { AuthenticationState } from "../model/auth.js";
3
3
  import { Session } from "../model/session.js";
4
+ /**
5
+ * AuthController uses a singleton pattern intentionally:
6
+ * - Maintains shared auth state across components outside TheDoctor
7
+ * - Tracks multiple host components via hosts[] array for coordinated updates
8
+ * - Listens for window-level auth events (GitHub auth, logout)
9
+ * - Constructor returns existing instance if one exists, adding new host to hosts[]
10
+ *
11
+ * For testing: Use vi.mocked(AuthController.getInstance).mockReturnValue(mockAuthController)
12
+ */
4
13
  export declare class AuthController extends EventTarget {
5
14
  private static _instance;
6
15
  static getInstance(): AuthController | null;
@@ -1,6 +1,16 @@
1
1
  import { AuthenticationGithubRequested, AuthenticationStateChange, CreditEmpty, LogoutRequested, NukeWorkspaceEvent, StartSessionFailed } from "../events/doctor.js";
2
2
  import { AuthService } from "../services/auth-service.js";
3
3
  import { HeaderService } from "../services/header-service.js";
4
+ import { typedEventHandler } from "../helpers/typed-events.js";
5
+ /**
6
+ * AuthController uses a singleton pattern intentionally:
7
+ * - Maintains shared auth state across components outside TheDoctor
8
+ * - Tracks multiple host components via hosts[] array for coordinated updates
9
+ * - Listens for window-level auth events (GitHub auth, logout)
10
+ * - Constructor returns existing instance if one exists, adding new host to hosts[]
11
+ *
12
+ * For testing: Use vi.mocked(AuthController.getInstance).mockReturnValue(mockAuthController)
13
+ */
4
14
  export class AuthController extends EventTarget {
5
15
  static getInstance() {
6
16
  const t = AuthController._instance;
@@ -20,7 +30,6 @@ export class AuthController extends EventTarget {
20
30
  }
21
31
  t.startSessionAutomatically = autoStart;
22
32
  t.brokerStarted = false;
23
- // t.start()
24
33
  return t;
25
34
  }
26
35
  this.checkingState = false;
@@ -41,10 +50,8 @@ export class AuthController extends EventTarget {
41
50
  }
42
51
  // cache the one and only instance
43
52
  AuthController._instance = this;
44
- // @ts-ignore
45
- window.addEventListener(AuthenticationGithubRequested, this.authGithub.bind(this));
46
- // @ts-ignore
47
- window.addEventListener(LogoutRequested, this.logout.bind(this));
53
+ window.addEventListener(AuthenticationGithubRequested, typedEventHandler(this.authGithub.bind(this)));
54
+ window.addEventListener(LogoutRequested, typedEventHandler(this.logout.bind(this)));
48
55
  }
49
56
  start() {
50
57
  if (!this.brokerStarted) {
@@ -1,22 +1,49 @@
1
- import { TheDoctor } from "../components/the-doctor/the-doctor.js";
2
- import { BusCallback, CommandResponse } from "@pb33f/ranch";
1
+ import type { BrokerControllerDeps } from "../interfaces/doctor-interfaces.js";
2
+ import { BusCallback, CommandResponse, StompError } from "@pb33f/ranch";
3
3
  export declare class BrokerController extends EventTarget {
4
4
  private readonly specStreamChannel;
5
5
  private readonly creditStreamChannel;
6
+ private readonly rulesetChannel;
6
7
  private readonly doctorServiceChannel;
8
+ private readonly modelServiceChannel;
9
+ private readonly errorChannel;
7
10
  private readonly busPort;
8
11
  private readonly busHost;
9
12
  private readonly busVersion;
10
13
  private readonly bus;
11
- readonly doc: TheDoctor;
14
+ private readonly deps;
12
15
  readonly useTLS: boolean;
13
16
  brokerConnectionId: string;
14
17
  currentVersion: string;
15
- constructor(doc: TheDoctor);
18
+ private readyPromise;
19
+ private readyResolver;
20
+ private heartbeatInterval;
21
+ private readonly HEARTBEAT_INTERVAL_MS;
22
+ private doctorServiceSubscription;
23
+ private specStreamSubscription;
24
+ private creditStreamSubscription;
25
+ private errorStreamSubscription;
26
+ private _doctorStarted;
27
+ constructor(deps: BrokerControllerDeps);
16
28
  connectToBroker(): void;
17
29
  doctorServiceHandler(): BusCallback<CommandResponse>;
18
30
  whoAmI(): void;
19
31
  startTheDoctor(): void;
20
32
  specStreamHandler(): BusCallback<CommandResponse>;
21
33
  creditStreamHandler(): BusCallback<CommandResponse>;
34
+ errorStreamHandler(): BusCallback<StompError>;
35
+ /**
36
+ * Returns a promise that resolves when the broker connection is established and ready.
37
+ * If already connected, resolves immediately.
38
+ */
39
+ waitUntilReady(): Promise<void>;
40
+ /**
41
+ * Checks if the broker is currently connected and ready.
42
+ */
43
+ isReady(): boolean;
44
+ private mapChannels;
45
+ private confirmBrokerConnection;
46
+ private startBrokerHeartbeat;
47
+ private stopBrokerHeartbeat;
48
+ destroy(): void;
22
49
  }
@@ -1,18 +1,32 @@
1
1
  import { DefaultDocument } from "../components/the-doctor/the-doctor.js";
2
- import { Command, CreditStreamChannel, DoctorServiceChannel, isBrokerResponse, QueuePrefix, SpecStreamChannel } from "../model/channels.js";
3
- import { CreditStreamUpdated } from "../events/doctor.js";
2
+ import { Command, CreditStreamChannel, DoctorServiceChannel, isBrokerResponse, ModelServiceChannel, QueuePrefix, PublishQueuePrefix, SpecStreamChannel, WalletServiceChannel, BrokerConfirmChannel, BrokerHeartbeatChannel, RuleSetServiceChannel } from "../model/channels.js";
3
+ import { CreditStreamUpdated, BrokerConnected, SocketDisconnected } from "../events/doctor.js";
4
4
  export class BrokerController extends EventTarget {
5
- constructor(doc) {
5
+ constructor(deps) {
6
6
  super();
7
7
  this.useTLS = false;
8
- this.doc = doc;
9
- this.bus = doc.bus;
8
+ this.currentVersion = '';
9
+ this.readyResolver = null;
10
+ this.heartbeatInterval = null;
11
+ this.HEARTBEAT_INTERVAL_MS = 30000;
12
+ this.doctorServiceSubscription = null;
13
+ this.specStreamSubscription = null;
14
+ this.creditStreamSubscription = null;
15
+ this.errorStreamSubscription = null;
16
+ this._doctorStarted = false;
17
+ this.deps = deps;
18
+ this.bus = deps.bus;
19
+ this.readyPromise = new Promise((resolve) => {
20
+ this.readyResolver = resolve;
21
+ });
10
22
  this.doctorServiceChannel = this.bus.createChannel(DoctorServiceChannel);
23
+ this.modelServiceChannel = this.bus.createChannel(ModelServiceChannel);
11
24
  this.specStreamChannel = this.bus.createChannel(SpecStreamChannel);
12
25
  this.creditStreamChannel = this.bus.createChannel(CreditStreamChannel);
13
- this.bus.mapChannelToBrokerDestination(QueuePrefix + DoctorServiceChannel, DoctorServiceChannel);
14
- this.doctorServiceChannel.subscribe(this.doctorServiceHandler());
15
- // extract port from session storage.
26
+ this.rulesetChannel = this.bus.createChannel(RuleSetServiceChannel);
27
+ this.errorChannel = this.bus.getChannel('errors');
28
+ this.mapChannels(DoctorServiceChannel, ModelServiceChannel, RuleSetServiceChannel);
29
+ this.doctorServiceSubscription = this.doctorServiceChannel.subscribe(this.doctorServiceHandler());
16
30
  this.busPort = sessionStorage.getItem("pb33f-doctor-port");
17
31
  this.busHost = sessionStorage.getItem("pb33f-doctor-host");
18
32
  if (!this.busPort) {
@@ -31,7 +45,6 @@ export class BrokerController extends EventTarget {
31
45
  if (this.useTLS) {
32
46
  protocol = "wss://";
33
47
  }
34
- // configure wiretap broker.
35
48
  const config = {
36
49
  brokerURL: protocol + this.busHost + ':' + this.busPort + '/ranch',
37
50
  heartbeatIncoming: 0,
@@ -40,6 +53,20 @@ export class BrokerController extends EventTarget {
40
53
  console.log("💊 Connected to the %cOpenAPI Doctor%c, we are ready to communicate.", 'background: #0d1117; color: #62C4FFFF; font-weight: bold', 'color: default');
41
54
  this.bus.mapChannels();
42
55
  this.whoAmI();
56
+ },
57
+ onStompError: (frame) => {
58
+ console.log("🛑 Socket Error received:", frame.body || frame.headers?.message || 'Unknown error', "- Stopping all STOMP communication");
59
+ this.stopBrokerHeartbeat();
60
+ const client = this.bus.getClient();
61
+ if (client) {
62
+ client.reconnectDelay = 0;
63
+ client.deactivate();
64
+ }
65
+ this.deps.dispatchEvent(new CustomEvent(SocketDisconnected, {
66
+ bubbles: true,
67
+ composed: true,
68
+ detail: { frame }
69
+ }));
43
70
  }
44
71
  };
45
72
  this.bus.connectToBroker(config);
@@ -49,7 +76,7 @@ export class BrokerController extends EventTarget {
49
76
  if (msg.payload?.payload != null) {
50
77
  if (isBrokerResponse(msg.payload.payload)) {
51
78
  this.brokerConnectionId = msg.payload.payload.broker;
52
- this.doc.authController.associateBroker(this.brokerConnectionId).then(() => {
79
+ this.deps.authController.associateBroker(this.brokerConnectionId).then(() => {
53
80
  // check version from the server
54
81
  const version = msg.payload.payload.version;
55
82
  if (version !== "") {
@@ -58,11 +85,11 @@ export class BrokerController extends EventTarget {
58
85
  const memVersion = localStorage.getItem("pb33f-doctor-version");
59
86
  if (memVersion) {
60
87
  if (this.currentVersion != memVersion) {
61
- if (!this.doc.authController.authenticated) {
62
- this.doc.nukeWorkspaceHandler();
88
+ if (!this.deps.authController.authenticated) {
89
+ this.deps.nukeWorkspaceHandler();
63
90
  }
64
91
  else {
65
- this.doc.bagManager.resetBags();
92
+ this.deps.bagManager.resetBags();
66
93
  localStorage.removeItem("pb33f-doctor-version");
67
94
  window.location.reload();
68
95
  }
@@ -73,6 +100,17 @@ export class BrokerController extends EventTarget {
73
100
  localStorage.setItem("pb33f-doctor-version", this.currentVersion);
74
101
  }
75
102
  console.log("💊 Welcome to the clinic, the %cdoctor %cis ready to see you. [" + "v" + version + "]", 'color: #62C4FFFF; font-weight: bold', 'color: default');
103
+ // Resolve the ready promise
104
+ if (this.readyResolver) {
105
+ this.readyResolver();
106
+ this.readyResolver = null;
107
+ }
108
+ // Dispatch broker connected event so components can start using the broker
109
+ this.deps.dispatchEvent(new CustomEvent(BrokerConnected, {
110
+ bubbles: true,
111
+ composed: true,
112
+ detail: { brokerId: this.brokerConnectionId }
113
+ }));
76
114
  this.startTheDoctor();
77
115
  });
78
116
  }
@@ -86,22 +124,28 @@ export class BrokerController extends EventTarget {
86
124
  });
87
125
  }
88
126
  startTheDoctor() {
89
- this.specStreamChannel.subscribe(this.specStreamHandler());
90
- this.creditStreamChannel.subscribe(this.creditStreamHandler());
91
- this.bus.mapChannelToBrokerDestination(QueuePrefix + SpecStreamChannel, SpecStreamChannel);
92
- this.bus.mapChannelToBrokerDestination(QueuePrefix + CreditStreamChannel, CreditStreamChannel);
93
- this.doc.boostrap();
127
+ if (!this._doctorStarted) {
128
+ this.specStreamSubscription = this.specStreamChannel.subscribe(this.specStreamHandler());
129
+ this.creditStreamSubscription = this.creditStreamChannel.subscribe(this.creditStreamHandler());
130
+ this.errorStreamSubscription = this.errorChannel.subscribe(this.errorStreamHandler());
131
+ this.mapChannels(SpecStreamChannel, CreditStreamChannel, WalletServiceChannel);
132
+ this.deps.globalTaskController.init();
133
+ this.deps.timelineController.init();
134
+ this.deps.boostrap();
135
+ this._doctorStarted = true;
136
+ }
137
+ this.confirmBrokerConnection();
138
+ this.startBrokerHeartbeat();
94
139
  }
95
140
  specStreamHandler() {
96
141
  return (msg) => {
97
142
  if (msg.payload?.payload != null) {
98
- // base64 decode the payload and update the editor!
99
143
  const decoded = atob(msg.payload.payload);
100
- if (this.doc.docBag) {
101
- this.doc.docBag.set(DefaultDocument, decoded);
144
+ if (this.deps.docBag) {
145
+ this.deps.docBag.set(DefaultDocument, decoded);
102
146
  }
103
- this.doc.editor?.setValue(decoded, true);
104
- this.doc.requestUpdate();
147
+ this.deps.editor?.setValue(decoded, true);
148
+ this.deps.requestUpdate();
105
149
  }
106
150
  };
107
151
  }
@@ -109,9 +153,9 @@ export class BrokerController extends EventTarget {
109
153
  return (msg) => {
110
154
  if (msg.payload?.payload != null) {
111
155
  const newCredits = parseInt(msg.payload.payload);
112
- this.doc.creditTicker.credits = newCredits;
156
+ this.deps.creditTicker.credits = newCredits;
113
157
  // Dispatch event to the doctor for credit stream updates
114
- this.doc.dispatchEvent(new CustomEvent(CreditStreamUpdated, {
158
+ this.deps.dispatchEvent(new CustomEvent(CreditStreamUpdated, {
115
159
  bubbles: true,
116
160
  composed: true,
117
161
  detail: { credits: newCredits }
@@ -119,4 +163,88 @@ export class BrokerController extends EventTarget {
119
163
  }
120
164
  };
121
165
  }
166
+ errorStreamHandler() {
167
+ return (msg) => {
168
+ if (msg.command === 'STOMP_ERROR' && msg.payload) {
169
+ const error = msg.payload;
170
+ console.log("💊 Centralized error handler:", error.message);
171
+ }
172
+ };
173
+ }
174
+ /**
175
+ * Returns a promise that resolves when the broker connection is established and ready.
176
+ * If already connected, resolves immediately.
177
+ */
178
+ async waitUntilReady() {
179
+ if (this.brokerConnectionId) {
180
+ return;
181
+ }
182
+ return this.readyPromise;
183
+ }
184
+ /**
185
+ * Checks if the broker is currently connected and ready.
186
+ */
187
+ isReady() {
188
+ return Boolean(this.brokerConnectionId);
189
+ }
190
+ mapChannels(...channels) {
191
+ channels.forEach(channel => {
192
+ this.bus.mapChannelToBrokerDestination(QueuePrefix + channel, channel);
193
+ });
194
+ }
195
+ confirmBrokerConnection() {
196
+ try {
197
+ this.bus.publish({
198
+ destination: PublishQueuePrefix + BrokerConfirmChannel,
199
+ body: JSON.stringify({
200
+ request: 'confirm',
201
+ payload: { brokerId: this.brokerConnectionId }
202
+ })
203
+ });
204
+ }
205
+ catch (error) {
206
+ console.error('failed to confirm broker connection:', error);
207
+ }
208
+ }
209
+ startBrokerHeartbeat() {
210
+ this.stopBrokerHeartbeat();
211
+ this.heartbeatInterval = setInterval(() => {
212
+ const client = this.bus.getClient();
213
+ if (!client || !client.connected) {
214
+ this.stopBrokerHeartbeat();
215
+ return;
216
+ }
217
+ try {
218
+ this.bus.publish({
219
+ destination: PublishQueuePrefix + BrokerHeartbeatChannel,
220
+ body: JSON.stringify({
221
+ request: 'heartbeat',
222
+ payload: { brokerId: this.brokerConnectionId }
223
+ })
224
+ });
225
+ }
226
+ catch (error) {
227
+ console.warn('heartbeat publish failed:', error);
228
+ this.stopBrokerHeartbeat();
229
+ }
230
+ }, this.HEARTBEAT_INTERVAL_MS);
231
+ }
232
+ stopBrokerHeartbeat() {
233
+ if (this.heartbeatInterval) {
234
+ clearInterval(this.heartbeatInterval);
235
+ this.heartbeatInterval = null;
236
+ }
237
+ }
238
+ destroy() {
239
+ this.stopBrokerHeartbeat();
240
+ this.doctorServiceSubscription?.unsubscribe();
241
+ this.doctorServiceSubscription = null;
242
+ this.specStreamSubscription?.unsubscribe();
243
+ this.specStreamSubscription = null;
244
+ this.creditStreamSubscription?.unsubscribe();
245
+ this.creditStreamSubscription = null;
246
+ this.errorStreamSubscription?.unsubscribe();
247
+ this.errorStreamSubscription = null;
248
+ this._doctorStarted = false;
249
+ }
122
250
  }
@@ -0,0 +1,21 @@
1
+ import { BundleControllerDeps } from "../interfaces/bundle-interfaces.js";
2
+ import { BundleReferenceMapping, BundleResponse } from "../model/bundle.js";
3
+ export declare class BundleController extends EventTarget {
4
+ private readonly deps;
5
+ private _bundleResponse;
6
+ private _loading;
7
+ private _referenceMapIndex;
8
+ constructor(deps: BundleControllerDeps);
9
+ get isBundled(): boolean;
10
+ get isLoading(): boolean;
11
+ getBundledSpec(): string | null;
12
+ getBundleResponse(): BundleResponse | null;
13
+ private createToast;
14
+ bundleSpec(): Promise<void>;
15
+ downloadBundledSpec(): void;
16
+ copyToClipboard(): Promise<void>;
17
+ reset(): void;
18
+ private buildReferenceMapIndex;
19
+ private normalizeBracketNotation;
20
+ findOriginalLocation(nodePath: string): BundleReferenceMapping | null;
21
+ }