@jini-ai/admin 0.3.10 → 0.4.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 (387) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +71 -37
  3. package/dist/agent-plugins/adapters/http.d.ts +7 -0
  4. package/dist/agent-plugins/adapters/http.js +15 -0
  5. package/dist/agent-plugins/adapters/memory.d.ts +8 -0
  6. package/dist/agent-plugins/adapters/memory.js +25 -0
  7. package/dist/agent-plugins/agent-plugins.module.d.ts +51 -0
  8. package/dist/agent-plugins/agent-plugins.module.js +6 -0
  9. package/dist/agent-plugins/conformance/agent-plugins-api.conformance.d.ts +12 -0
  10. package/dist/agent-plugins/conformance/agent-plugins-api.conformance.js +47 -0
  11. package/dist/agent-plugins/controllers/agent-plugin-files.controller.d.ts +20 -0
  12. package/dist/agent-plugins/controllers/agent-plugin-files.controller.js +43 -0
  13. package/dist/agent-plugins/controllers/agent-plugins.controller.d.ts +25 -0
  14. package/dist/agent-plugins/controllers/agent-plugins.controller.js +91 -0
  15. package/dist/agent-plugins/index.d.ts +9 -0
  16. package/dist/agent-plugins/index.js +9 -0
  17. package/dist/agent-plugins/messages.en.d.ts +23 -0
  18. package/dist/agent-plugins/messages.en.js +14 -0
  19. package/dist/agent-plugins/models.d.ts +57 -0
  20. package/dist/agent-plugins/models.js +2 -0
  21. package/dist/agent-plugins/package-file-tree.d.ts +111 -0
  22. package/dist/agent-plugins/package-file-tree.js +188 -0
  23. package/dist/agent-plugins/ports.d.ts +18 -0
  24. package/dist/agent-plugins/ports.js +3 -0
  25. package/dist/agent-plugins/react/components/AgentPluginFileContent.d.ts +5 -0
  26. package/dist/agent-plugins/react/components/AgentPluginFileContent.js +9 -0
  27. package/dist/agent-plugins/react/components/AgentPluginFileTree.d.ts +9 -0
  28. package/dist/agent-plugins/react/components/AgentPluginFileTree.js +7 -0
  29. package/dist/agent-plugins/react/components/AgentPluginInspector.d.ts +3 -0
  30. package/dist/agent-plugins/react/components/AgentPluginInspector.js +11 -0
  31. package/dist/agent-plugins/react/components/AgentPluginListPanel.d.ts +6 -0
  32. package/dist/agent-plugins/react/components/AgentPluginListPanel.js +10 -0
  33. package/dist/agent-plugins/react/components/AgentPluginRow.d.ts +5 -0
  34. package/dist/agent-plugins/react/components/AgentPluginRow.js +8 -0
  35. package/dist/agent-plugins/react/hooks/AgentPluginInspector.hooks.d.ts +90 -0
  36. package/dist/agent-plugins/react/hooks/AgentPluginInspector.hooks.js +74 -0
  37. package/dist/agent-plugins/react/hooks/AgentPluginPanel.hooks.d.ts +67 -0
  38. package/dist/agent-plugins/react/hooks/AgentPluginPanel.hooks.js +50 -0
  39. package/dist/agent-plugins/react/hooks/AgentPluginRow.hooks.d.ts +55 -0
  40. package/dist/agent-plugins/react/hooks/AgentPluginRow.hooks.js +6 -0
  41. package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.d.ts +64 -0
  42. package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.js +39 -0
  43. package/dist/agent-plugins/react/hooks/AgentPluginsPorts.hooks.d.ts +7 -0
  44. package/dist/agent-plugins/react/hooks/AgentPluginsPorts.hooks.js +10 -0
  45. package/dist/agent-plugins/react/hooks/MarketplaceTab.hooks.d.ts +6 -0
  46. package/dist/agent-plugins/react/hooks/MarketplaceTab.hooks.js +3 -0
  47. package/dist/agent-plugins/react/index.d.ts +245 -0
  48. package/dist/agent-plugins/react/index.js +13 -0
  49. package/dist/agent-plugins/react/pages/AgentPluginsPage.d.ts +4 -0
  50. package/dist/agent-plugins/react/pages/AgentPluginsPage.js +12 -0
  51. package/dist/agent-plugins/react/tabs/DownloadedTab.d.ts +4 -0
  52. package/dist/agent-plugins/react/tabs/DownloadedTab.js +5 -0
  53. package/dist/agent-plugins/react/tabs/InstalledTab.d.ts +4 -0
  54. package/dist/agent-plugins/react/tabs/InstalledTab.js +5 -0
  55. package/dist/agent-plugins/react/tabs/MarketplaceTab.d.ts +4 -0
  56. package/dist/agent-plugins/react/tabs/MarketplaceTab.js +10 -0
  57. package/dist/agent-plugins/rules.d.ts +33 -0
  58. package/dist/agent-plugins/rules.js +51 -0
  59. package/dist/browser/index.d.ts +1 -0
  60. package/dist/browser/index.js +1 -0
  61. package/dist/browser/navigation.d.ts +19 -4
  62. package/dist/browser/navigation.js +8 -8
  63. package/dist/browser/shell-navigation.d.ts +12 -0
  64. package/dist/browser/shell-navigation.js +16 -0
  65. package/dist/contracts/credential-management.d.ts +8 -0
  66. package/dist/contracts/credential-management.js +3 -0
  67. package/dist/contracts/media-picker.d.ts +17 -0
  68. package/dist/contracts/media-picker.js +5 -0
  69. package/dist/contracts/playground-render-target.d.ts +18 -0
  70. package/dist/contracts/playground-render-target.js +3 -0
  71. package/dist/core/entities/rules.d.ts +138 -0
  72. package/dist/core/entities/rules.js +344 -0
  73. package/dist/core/gated/types.d.ts +8 -4
  74. package/dist/core/index.d.ts +4 -0
  75. package/dist/core/index.js +1 -0
  76. package/dist/core/manifest/rules.d.ts +24 -6
  77. package/dist/core/manifest/rules.js +12 -11
  78. package/dist/core/module/controller-store.d.ts +22 -0
  79. package/dist/core/module/controller-store.js +32 -0
  80. package/dist/core/module/create-admin.d.ts +41 -0
  81. package/dist/core/module/create-admin.js +187 -0
  82. package/dist/core/module/define-admin-module.d.ts +4 -0
  83. package/dist/core/module/define-admin-module.js +5 -0
  84. package/dist/core/module/index.d.ts +7 -0
  85. package/dist/core/module/index.js +4 -0
  86. package/dist/core/module/token.d.ts +19 -0
  87. package/dist/core/module/token.js +4 -0
  88. package/dist/core/module/types.d.ts +79 -0
  89. package/dist/core/module/types.js +2 -0
  90. package/dist/core/permissions/rules.d.ts +4 -1
  91. package/dist/core/permissions/rules.js +1 -1
  92. package/dist/core/ports/analytics.d.ts +1 -1
  93. package/dist/core/ports/auth.d.ts +2 -2
  94. package/dist/core/ports/comments.d.ts +9 -6
  95. package/dist/core/ports/database.d.ts +13 -10
  96. package/dist/core/ports/entities.d.ts +302 -0
  97. package/dist/core/ports/entities.js +47 -0
  98. package/dist/core/ports/forms.d.ts +19 -7
  99. package/dist/core/ports/identity.d.ts +42 -17
  100. package/dist/core/ports/index.d.ts +2 -0
  101. package/dist/core/ports/integrations.d.ts +9 -4
  102. package/dist/core/ports/media.d.ts +16 -7
  103. package/dist/core/ports/members.d.ts +7 -3
  104. package/dist/core/ports/menus.d.ts +46 -0
  105. package/dist/core/ports/menus.js +43 -0
  106. package/dist/core/ports/plugins.d.ts +3 -2
  107. package/dist/core/ports/recovery.d.ts +10 -6
  108. package/dist/core/ports/redirects.d.ts +17 -7
  109. package/dist/core/ports/seo.d.ts +12 -6
  110. package/dist/core/ports/shell.d.ts +41 -0
  111. package/dist/core/ports/shell.js +2 -0
  112. package/dist/core/ports/workspace.d.ts +3 -3
  113. package/dist/core/routing/rules.d.ts +17 -4
  114. package/dist/core/routing/rules.js +4 -4
  115. package/dist/core/transport/errors.d.ts +13 -4
  116. package/dist/core/transport/errors.js +4 -4
  117. package/dist/core/transport/http.d.ts +26 -16
  118. package/dist/core/transport/http.js +59 -21
  119. package/dist/core/transport/types.d.ts +26 -14
  120. package/dist/core/transport/types.js +9 -7
  121. package/dist/media/adapters/http.d.ts +27 -0
  122. package/dist/media/adapters/http.js +44 -0
  123. package/dist/media/adapters/memory.d.ts +11 -0
  124. package/dist/media/adapters/memory.js +139 -0
  125. package/dist/media/conformance/media-api.conformance.d.ts +7 -0
  126. package/dist/media/conformance/media-api.conformance.js +69 -0
  127. package/dist/media/controllers/edit-media.controller.d.ts +24 -0
  128. package/dist/media/controllers/edit-media.controller.js +69 -0
  129. package/dist/media/controllers/library.controller.d.ts +47 -0
  130. package/dist/media/controllers/library.controller.js +173 -0
  131. package/dist/media/controllers/providers.controller.d.ts +30 -0
  132. package/dist/media/controllers/providers.controller.js +76 -0
  133. package/dist/media/html-attributes.d.ts +82 -0
  134. package/dist/media/html-attributes.js +204 -0
  135. package/dist/media/index.d.ts +12 -0
  136. package/dist/media/index.js +9 -0
  137. package/dist/media/media.module.d.ts +83 -0
  138. package/dist/media/media.module.js +43 -0
  139. package/dist/media/messages.en.d.ts +24 -0
  140. package/dist/media/messages.en.js +24 -0
  141. package/dist/media/models.d.ts +72 -0
  142. package/dist/media/models.js +2 -0
  143. package/dist/media/ports.d.ts +75 -0
  144. package/dist/media/ports.js +7 -0
  145. package/dist/media/react/components/EditMediaPanel.d.ts +3 -0
  146. package/dist/media/react/components/EditMediaPanel.js +10 -0
  147. package/dist/media/react/components/MediaCard.d.ts +5 -0
  148. package/dist/media/react/components/MediaCard.js +17 -0
  149. package/dist/media/react/components/MediaDialog.d.ts +3 -0
  150. package/dist/media/react/components/MediaDialog.js +8 -0
  151. package/dist/media/react/components/MediaGrid.d.ts +4 -0
  152. package/dist/media/react/components/MediaGrid.js +8 -0
  153. package/dist/media/react/components/MediaIcons.d.ts +14 -0
  154. package/dist/media/react/components/MediaIcons.js +39 -0
  155. package/dist/media/react/components/MediaLightbox.d.ts +5 -0
  156. package/dist/media/react/components/MediaLightbox.js +12 -0
  157. package/dist/media/react/components/MediaPicker.d.ts +3 -0
  158. package/dist/media/react/components/MediaPicker.js +10 -0
  159. package/dist/media/react/components/MediaPurgeDialog.d.ts +4 -0
  160. package/dist/media/react/components/MediaPurgeDialog.js +9 -0
  161. package/dist/media/react/components/UploadButton.d.ts +3 -0
  162. package/dist/media/react/components/UploadButton.js +8 -0
  163. package/dist/media/react/hooks/EditMediaPanel.hooks.d.ts +84 -0
  164. package/dist/media/react/hooks/EditMediaPanel.hooks.js +105 -0
  165. package/dist/media/react/hooks/LibraryTab.hooks.d.ts +103 -0
  166. package/dist/media/react/hooks/LibraryTab.hooks.js +164 -0
  167. package/dist/media/react/hooks/MediaCard.hooks.d.ts +83 -0
  168. package/dist/media/react/hooks/MediaCard.hooks.js +66 -0
  169. package/dist/media/react/hooks/MediaDialog.hooks.d.ts +10 -0
  170. package/dist/media/react/hooks/MediaDialog.hooks.js +20 -0
  171. package/dist/media/react/hooks/MediaGrid.hooks.d.ts +29 -0
  172. package/dist/media/react/hooks/MediaGrid.hooks.js +6 -0
  173. package/dist/media/react/hooks/MediaLightbox.hooks.d.ts +27 -0
  174. package/dist/media/react/hooks/MediaLightbox.hooks.js +64 -0
  175. package/dist/media/react/hooks/MediaPage.hooks.d.ts +68 -0
  176. package/dist/media/react/hooks/MediaPage.hooks.js +68 -0
  177. package/dist/media/react/hooks/MediaPicker.hooks.d.ts +26 -0
  178. package/dist/media/react/hooks/MediaPicker.hooks.js +25 -0
  179. package/dist/media/react/hooks/MediaPorts.hooks.d.ts +9 -0
  180. package/dist/media/react/hooks/MediaPorts.hooks.js +10 -0
  181. package/dist/media/react/hooks/MediaPurgeDialog.hooks.d.ts +22 -0
  182. package/dist/media/react/hooks/MediaPurgeDialog.hooks.js +6 -0
  183. package/dist/media/react/hooks/ProvidersTab.hooks.d.ts +55 -0
  184. package/dist/media/react/hooks/ProvidersTab.hooks.js +124 -0
  185. package/dist/media/react/hooks/UploadButton.hooks.d.ts +48 -0
  186. package/dist/media/react/hooks/UploadButton.hooks.js +118 -0
  187. package/dist/media/react/index.d.ts +373 -0
  188. package/dist/media/react/index.js +73 -0
  189. package/dist/media/react/pages/MediaPage.d.ts +4 -0
  190. package/dist/media/react/pages/MediaPage.js +9 -0
  191. package/dist/media/react/tabs/LibraryTab.d.ts +4 -0
  192. package/dist/media/react/tabs/LibraryTab.js +14 -0
  193. package/dist/media/react/tabs/ProvidersTab.d.ts +4 -0
  194. package/dist/media/react/tabs/ProvidersTab.js +10 -0
  195. package/dist/media/rules.d.ts +86 -0
  196. package/dist/media/rules.js +134 -0
  197. package/dist/media/styles.d.ts +4 -0
  198. package/dist/media/styles.js +5 -0
  199. package/dist/playground/adapters/http.d.ts +8 -0
  200. package/dist/playground/adapters/http.js +4 -0
  201. package/dist/playground/adapters/memory.d.ts +10 -0
  202. package/dist/playground/adapters/memory.js +30 -0
  203. package/dist/playground/conformance/playground-api.conformance.d.ts +6 -0
  204. package/dist/playground/conformance/playground-api.conformance.js +37 -0
  205. package/dist/playground/controllers/playground.controller.d.ts +16 -0
  206. package/dist/playground/controllers/playground.controller.js +21 -0
  207. package/dist/playground/index.d.ts +7 -0
  208. package/dist/playground/index.js +5 -0
  209. package/dist/playground/messages.en.d.ts +9 -0
  210. package/dist/playground/messages.en.js +2 -0
  211. package/dist/playground/models.d.ts +4 -0
  212. package/dist/playground/models.js +2 -0
  213. package/dist/playground/playground.module.d.ts +31 -0
  214. package/dist/playground/playground.module.js +5 -0
  215. package/dist/playground/ports.d.ts +5 -0
  216. package/dist/playground/ports.js +2 -0
  217. package/dist/playground/react/components/Canvas.d.ts +3 -0
  218. package/dist/playground/react/components/Canvas.js +9 -0
  219. package/dist/playground/react/hooks/Canvas.hooks.d.ts +7 -0
  220. package/dist/playground/react/hooks/Canvas.hooks.js +18 -0
  221. package/dist/playground/react/hooks/PlaygroundPage.hooks.d.ts +8 -0
  222. package/dist/playground/react/hooks/PlaygroundPage.hooks.js +2 -0
  223. package/dist/playground/react/hooks/PlaygroundPorts.hooks.d.ts +4 -0
  224. package/dist/playground/react/hooks/PlaygroundPorts.hooks.js +6 -0
  225. package/dist/playground/react/index.d.ts +136 -0
  226. package/dist/playground/react/index.js +10 -0
  227. package/dist/playground/react/pages/PlaygroundPage.d.ts +4 -0
  228. package/dist/playground/react/pages/PlaygroundPage.js +11 -0
  229. package/dist/playground/react/tabs/CanvasTab.d.ts +4 -0
  230. package/dist/playground/react/tabs/CanvasTab.js +5 -0
  231. package/dist/playground/rules.d.ts +4 -0
  232. package/dist/playground/rules.js +2 -0
  233. package/dist/react/OverlayHost.d.ts +3 -0
  234. package/dist/react/OverlayHost.hooks.d.ts +9 -0
  235. package/dist/react/OverlayHost.hooks.js +9 -0
  236. package/dist/react/OverlayHost.js +7 -0
  237. package/dist/react/bind-react.d.ts +46 -0
  238. package/dist/react/bind-react.js +28 -0
  239. package/dist/react/components/ConfirmButton/ConfirmButton.hooks.d.ts +7 -1
  240. package/dist/react/components/ConfirmButton/ConfirmButton.hooks.js +2 -2
  241. package/dist/react/components/ConfirmButton/ConfirmButton.js +1 -1
  242. package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.d.ts +17 -3
  243. package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.js +3 -3
  244. package/dist/react/components/ConfirmDialog/ConfirmDialog.js +5 -5
  245. package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.d.ts +6 -2
  246. package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.js +7 -8
  247. package/dist/react/components/RowMenu/RowMenu.d.ts +5 -1
  248. package/dist/react/components/RowMenu/RowMenu.hooks.d.ts +8 -2
  249. package/dist/react/components/RowMenu/RowMenu.hooks.js +4 -4
  250. package/dist/react/components/RowMenu/RowMenu.js +6 -6
  251. package/dist/react/components/Sidebar.d.ts +1 -1
  252. package/dist/react/components/Sidebar.js +103 -7
  253. package/dist/react/entities/EntityCell.d.ts +10 -0
  254. package/dist/react/entities/EntityCell.js +18 -0
  255. package/dist/react/entities/EntityDetail.d.ts +3 -0
  256. package/dist/react/entities/EntityDetail.js +21 -0
  257. package/dist/react/entities/EntityEdit.d.ts +13 -0
  258. package/dist/react/entities/EntityEdit.js +45 -0
  259. package/dist/react/entities/EntityField.d.ts +20 -0
  260. package/dist/react/entities/EntityField.js +31 -0
  261. package/dist/react/entities/EntityIndex.d.ts +3 -0
  262. package/dist/react/entities/EntityIndex.js +10 -0
  263. package/dist/react/entities/EntityList.d.ts +7 -0
  264. package/dist/react/entities/EntityList.js +52 -0
  265. package/dist/react/entities/contribution.d.ts +26 -0
  266. package/dist/react/entities/contribution.js +78 -0
  267. package/dist/react/entities/index.d.ts +10 -0
  268. package/dist/react/entities/index.js +7 -0
  269. package/dist/react/entities/rules.d.ts +179 -0
  270. package/dist/react/entities/rules.js +224 -0
  271. package/dist/react/entities/types.d.ts +45 -0
  272. package/dist/react/entities/types.js +5 -0
  273. package/dist/react/entities/use-entity-edit.d.ts +35 -0
  274. package/dist/react/entities/use-entity-edit.js +98 -0
  275. package/dist/react/entities/use-entity-read.d.ts +22 -0
  276. package/dist/react/entities/use-entity-read.js +27 -0
  277. package/dist/react/hooks/use-nav-sections.d.ts +12 -3
  278. package/dist/react/hooks/use-nav-sections.js +14 -14
  279. package/dist/react/hooks/use-sidebar-rail.d.ts +7 -1
  280. package/dist/react/hooks/use-sidebar-rail.js +11 -11
  281. package/dist/react/index.d.ts +3 -1
  282. package/dist/react/index.js +5 -2
  283. package/dist/react/overlays.d.ts +38 -0
  284. package/dist/react/overlays.js +46 -0
  285. package/dist/react/shell/AdminShell.d.ts +9 -0
  286. package/dist/react/shell/AdminShell.hooks.d.ts +15 -0
  287. package/dist/react/shell/AdminShell.hooks.js +27 -0
  288. package/dist/react/shell/AdminShell.js +46 -0
  289. package/dist/react/shell/index.d.ts +7 -0
  290. package/dist/react/shell/index.js +5 -0
  291. package/dist/react/shell/model.d.ts +25 -0
  292. package/dist/react/shell/model.js +29 -0
  293. package/dist/react/shell/theme-ports.d.ts +28 -0
  294. package/dist/react/shell/theme-ports.js +2 -0
  295. package/dist/react/shell/types.d.ts +99 -0
  296. package/dist/react/shell/types.js +2 -0
  297. package/dist/react/shell/use-admin-shell-session.d.ts +13 -0
  298. package/dist/react/shell/use-admin-shell-session.js +81 -0
  299. package/dist/react/shell/use-admin-theme.d.ts +16 -0
  300. package/dist/react/shell/use-admin-theme.js +57 -0
  301. package/dist/react/types.d.ts +6 -4
  302. package/dist/react/types.js +2 -2
  303. package/dist/react/use-controller.d.ts +16 -0
  304. package/dist/react/use-controller.js +18 -0
  305. package/dist/security/adapters/http.d.ts +16 -0
  306. package/dist/security/adapters/http.js +94 -0
  307. package/dist/security/adapters/memory.d.ts +15 -0
  308. package/dist/security/adapters/memory.js +60 -0
  309. package/dist/security/conformance/security-api.conformance.d.ts +10 -0
  310. package/dist/security/conformance/security-api.conformance.js +48 -0
  311. package/dist/security/controllers/access-tokens.controller.d.ts +44 -0
  312. package/dist/security/controllers/access-tokens.controller.js +112 -0
  313. package/dist/security/controllers/other-credentials.controller.d.ts +30 -0
  314. package/dist/security/controllers/other-credentials.controller.js +74 -0
  315. package/dist/security/controllers/root-key.controller.d.ts +35 -0
  316. package/dist/security/controllers/root-key.controller.js +90 -0
  317. package/dist/security/index.d.ts +9 -0
  318. package/dist/security/index.js +9 -0
  319. package/dist/security/messages.en.d.ts +12 -0
  320. package/dist/security/messages.en.js +2 -0
  321. package/dist/security/models.d.ts +112 -0
  322. package/dist/security/models.js +2 -0
  323. package/dist/security/ports.d.ts +58 -0
  324. package/dist/security/ports.js +5 -0
  325. package/dist/security/react/components/CredentialEditor.d.ts +3 -0
  326. package/dist/security/react/components/CredentialEditor.js +8 -0
  327. package/dist/security/react/hooks/AccessTokensTab.hooks.d.ts +94 -0
  328. package/dist/security/react/hooks/AccessTokensTab.hooks.js +36 -0
  329. package/dist/security/react/hooks/CredentialEditor.hooks.d.ts +49 -0
  330. package/dist/security/react/hooks/CredentialEditor.hooks.js +14 -0
  331. package/dist/security/react/hooks/RootKeyTab.hooks.d.ts +29 -0
  332. package/dist/security/react/hooks/RootKeyTab.hooks.js +19 -0
  333. package/dist/security/react/hooks/SecurityPage.hooks.d.ts +17 -0
  334. package/dist/security/react/hooks/SecurityPage.hooks.js +12 -0
  335. package/dist/security/react/hooks/SecurityPorts.hooks.d.ts +9 -0
  336. package/dist/security/react/hooks/SecurityPorts.hooks.js +6 -0
  337. package/dist/security/react/index.d.ts +215 -0
  338. package/dist/security/react/index.js +10 -0
  339. package/dist/security/react/pages/SecurityPage.d.ts +4 -0
  340. package/dist/security/react/pages/SecurityPage.js +10 -0
  341. package/dist/security/react/tabs/AccessTokensTab.d.ts +4 -0
  342. package/dist/security/react/tabs/AccessTokensTab.js +10 -0
  343. package/dist/security/react/tabs/RootKeyTab.d.ts +4 -0
  344. package/dist/security/react/tabs/RootKeyTab.js +9 -0
  345. package/dist/security/rules.d.ts +57 -0
  346. package/dist/security/rules.js +63 -0
  347. package/dist/security/security.module.d.ts +45 -0
  348. package/dist/security/security.module.js +5 -0
  349. package/dist/source-control/adapters/http.d.ts +6 -0
  350. package/dist/source-control/adapters/http.js +13 -0
  351. package/dist/source-control/adapters/memory.d.ts +9 -0
  352. package/dist/source-control/adapters/memory.js +35 -0
  353. package/dist/source-control/conformance/source-control-api.conformance.d.ts +10 -0
  354. package/dist/source-control/conformance/source-control-api.conformance.js +48 -0
  355. package/dist/source-control/controllers/source-control.controller.d.ts +26 -0
  356. package/dist/source-control/controllers/source-control.controller.js +70 -0
  357. package/dist/source-control/index.d.ts +8 -0
  358. package/dist/source-control/index.js +6 -0
  359. package/dist/source-control/messages.en.d.ts +11 -0
  360. package/dist/source-control/messages.en.js +2 -0
  361. package/dist/source-control/models.d.ts +70 -0
  362. package/dist/source-control/models.js +2 -0
  363. package/dist/source-control/ports.d.ts +23 -0
  364. package/dist/source-control/ports.js +3 -0
  365. package/dist/source-control/react/components/SourceControlCredentialFields.d.ts +5 -0
  366. package/dist/source-control/react/components/SourceControlCredentialFields.js +8 -0
  367. package/dist/source-control/react/components/SourceControlProviderRow.d.ts +5 -0
  368. package/dist/source-control/react/components/SourceControlProviderRow.js +7 -0
  369. package/dist/source-control/react/hooks/ProvidersTab.hooks.d.ts +45 -0
  370. package/dist/source-control/react/hooks/ProvidersTab.hooks.js +20 -0
  371. package/dist/source-control/react/hooks/SourceControlCredentialFields.hooks.d.ts +43 -0
  372. package/dist/source-control/react/hooks/SourceControlCredentialFields.hooks.js +9 -0
  373. package/dist/source-control/react/hooks/SourceControlPage.hooks.d.ts +17 -0
  374. package/dist/source-control/react/hooks/SourceControlPage.hooks.js +5 -0
  375. package/dist/source-control/react/hooks/SourceControlPorts.hooks.d.ts +9 -0
  376. package/dist/source-control/react/hooks/SourceControlPorts.hooks.js +6 -0
  377. package/dist/source-control/react/index.d.ts +156 -0
  378. package/dist/source-control/react/index.js +10 -0
  379. package/dist/source-control/react/pages/SourceControlPage.d.ts +4 -0
  380. package/dist/source-control/react/pages/SourceControlPage.js +11 -0
  381. package/dist/source-control/react/tabs/ProvidersTab.d.ts +4 -0
  382. package/dist/source-control/react/tabs/ProvidersTab.js +10 -0
  383. package/dist/source-control/rules.d.ts +32 -0
  384. package/dist/source-control/rules.js +35 -0
  385. package/dist/source-control/source-control.module.d.ts +36 -0
  386. package/dist/source-control/source-control.module.js +6 -0
  387. package/package.json +207 -4
@@ -0,0 +1,86 @@
1
+ import type { MediaAsset, MediaContentTabId, MediaTabId, MediaQuery, MediaMetadataPatch } from './models.js';
2
+ /** Falls back to "all" for an absent or unrecognized ?tab= value — don't trust a raw
3
+ * query value: a stale link or a typo must not blank the panel. */
4
+ export declare function resolveActiveTab({ tabId }: {
5
+ tabId?: string | null | undefined;
6
+ }, _optional?: Record<string, never>): MediaTabId;
7
+ /** Prefix matching on image/ and video/ rather than an enumerated list of the sniffer's
8
+ * current outputs: the server's sniffer allowlist can gain a format without this file
9
+ * having to learn about it, and a prefix cannot mis-sort a type it has never seen.
10
+ * application/octet-stream and null belong in All. SVG appears in Images, but its
11
+ * byte-serving route must force download as a stored-XSS defusal. */
12
+ export declare function filterMediaByTab({ media, tab }: {
13
+ media: readonly MediaAsset[];
14
+ tab: MediaContentTabId;
15
+ }, _optional?: Record<string, never>): readonly MediaAsset[];
16
+ export declare function queryMedia({ media, query }: {
17
+ media: readonly MediaAsset[];
18
+ query: MediaQuery;
19
+ }, _optional?: Record<string, never>): readonly MediaAsset[];
20
+ /** item MUST be the same snapshot draft was seeded from, frozen for the caller's whole
21
+ * edit session — never a live value that can advance independently of draft. If item
22
+ * moves out from under a frozen draft, an untouched field whose server value changed
23
+ * in the interim reads as "changed" and silently reverts the other operator's change. */
24
+ export declare function diffMediaMetadata({ item, draft }: {
25
+ item: MediaAsset;
26
+ draft: MediaMetadataPatch;
27
+ }, _optional?: Record<string, never>): MediaMetadataPatch;
28
+ export declare function acceptsMedia({ item, accept }: {
29
+ item: Pick<MediaAsset, 'contentType'>;
30
+ accept: readonly string[];
31
+ }, _optional?: Record<string, never>): boolean;
32
+ export declare function safeMediaUrl({ url }: {
33
+ url: string;
34
+ }, _optional?: Record<string, never>): string | undefined;
35
+ /** A callable optional port, plus the legacy explicit-disable flag, is required. */
36
+ export declare function canReplaceMedia({ api }: {
37
+ api: import('./ports.js').MediaApiPort;
38
+ }, _optional?: Record<string, never>): boolean;
39
+ export declare function canRestoreMedia({ api }: {
40
+ api: import('./ports.js').MediaApiPort;
41
+ }, _optional?: Record<string, never>): boolean;
42
+ /** Prefer the transport's retryability decision. Older transports only expose HTTP
43
+ * status in their message; network failures and temporary server failures recover too.
44
+ * Authorization/validation failures must never produce an automatic request loop. */
45
+ export declare function isRetryableMediaError({ error }: {
46
+ error: unknown;
47
+ }, _optional?: Record<string, never>): boolean;
48
+ /** Blank means native size; invalid values reach the server's positive-integer validator. */
49
+ export declare function parseOptionalPixelSize({ value }: {
50
+ value: string;
51
+ }, _optional?: Record<string, never>): number | null;
52
+ /** 1024-based to agree with upload limits. Whole B/KB, one decimal MB/GB distinguishes
53
+ * similarly sized clips; locale controls the decimal separator, never a hardcoded dot. */
54
+ export declare function formatByteSize({ bytes }: {
55
+ bytes: number;
56
+ }, { locale }?: {
57
+ locale?: string;
58
+ }): string;
59
+ /** Full-library counts, independent of search/order/type selection; Providers has no count. */
60
+ export declare function countMediaTabs({ media }: {
61
+ media: readonly MediaAsset[];
62
+ }, _optional?: Record<string, never>): {
63
+ all: number;
64
+ images: number;
65
+ videos: number;
66
+ };
67
+ /** Readable slug markers survive title/hash changes. Escape attribute delimiters even
68
+ * though real hosts validate slugs; a test or third-party adapter must not inject markup. */
69
+ export declare function mediaEmbedSnippet({ slug }: {
70
+ slug?: string | undefined;
71
+ }, _optional?: Record<string, never>): string | null;
72
+ /** Legacy row handles derive from stable IDs across the ENTIRE visible list. Per-card
73
+ * slugification cannot resolve collisions: duplicate handles silently make page.click/fill
74
+ * target the first DOM match. Search suffixes, because [x, x-2, X] can collide again.
75
+ * This media-local shape mirrors the agent runtime's canonical list-handle contract without
76
+ * adding a package dependency in a source-only change. */
77
+ export declare function mediaRowHandles({ media }: {
78
+ media: readonly Pick<MediaAsset, 'id'>[];
79
+ }, _optional?: Record<string, never>): readonly string[];
80
+ /** A calendar date in UTC, so cards do not shift an upload to yesterday across host timezones. */
81
+ export declare function formatUploadDate({ createdAt }: {
82
+ createdAt: string;
83
+ }, { locale }?: {
84
+ locale?: string;
85
+ }): string | null;
86
+ //# sourceMappingURL=rules.d.ts.map
@@ -0,0 +1,134 @@
1
+ /** Falls back to "all" for an absent or unrecognized ?tab= value — don't trust a raw
2
+ * query value: a stale link or a typo must not blank the panel. */
3
+ export function resolveActiveTab({ tabId }, _optional = {}) {
4
+ return tabId === 'images' || tabId === 'videos' || tabId === 'external-providers' ? tabId : 'all';
5
+ }
6
+ /** Prefix matching on image/ and video/ rather than an enumerated list of the sniffer's
7
+ * current outputs: the server's sniffer allowlist can gain a format without this file
8
+ * having to learn about it, and a prefix cannot mis-sort a type it has never seen.
9
+ * application/octet-stream and null belong in All. SVG appears in Images, but its
10
+ * byte-serving route must force download as a stored-XSS defusal. */
11
+ export function filterMediaByTab({ media, tab }, _optional = {}) {
12
+ if (tab === 'images')
13
+ return media.filter((item) => item.contentType?.startsWith('image/'));
14
+ if (tab === 'videos')
15
+ return media.filter((item) => item.contentType?.startsWith('video/'));
16
+ return media;
17
+ }
18
+ export function queryMedia({ media, query }, _optional = {}) {
19
+ const search = query.search?.trim().toLocaleLowerCase() ?? '';
20
+ const filtered = filterMediaByTab({ media, tab: query.filter ?? 'all' }).filter((item) => (!query.status || item.status === query.status) &&
21
+ (!search || `${item.title} ${item.alt}`.toLocaleLowerCase().includes(search)));
22
+ // Newest-first with id descending tiebreak, so same-tick batch uploads have deterministic order.
23
+ // Alphabetical is case-insensitive A–Z, with id ascending on a title collision.
24
+ return [...filtered].sort((a, b) => query.orderBy === 'alphabetical'
25
+ ? a.title.trim().toLocaleLowerCase().localeCompare(b.title.trim().toLocaleLowerCase()) ||
26
+ a.id.localeCompare(b.id)
27
+ : b.createdAt.localeCompare(a.createdAt) || b.id.localeCompare(a.id));
28
+ }
29
+ /** item MUST be the same snapshot draft was seeded from, frozen for the caller's whole
30
+ * edit session — never a live value that can advance independently of draft. If item
31
+ * moves out from under a frozen draft, an untouched field whose server value changed
32
+ * in the interim reads as "changed" and silently reverts the other operator's change. */
33
+ export function diffMediaMetadata({ item, draft }, _optional = {}) {
34
+ const patch = {};
35
+ for (const key of ['title', 'slug', 'alt', 'caption', 'credit', 'width', 'height', 'cssClass', 'htmlAttributes'])
36
+ if (draft[key] !== undefined && draft[key] !== item[key])
37
+ patch[key] = draft[key];
38
+ return patch;
39
+ }
40
+ export function acceptsMedia({ item, accept }, _optional = {}) {
41
+ if (accept.length === 0 || accept.includes('*/*'))
42
+ return true;
43
+ return (item.contentType !== null &&
44
+ accept.some((type) => type === item.contentType ||
45
+ (type.endsWith('/*') && item.contentType.startsWith(type.slice(0, -1)))));
46
+ }
47
+ export function safeMediaUrl({ url }, _optional = {}) {
48
+ // Fail closed on javascript:, data:, scheme-relative and backslash URLs. The host owns
49
+ // same-origin authentication and attachment headers for HTML/SVG originals.
50
+ if (url.startsWith('/') && !url.startsWith('//') && !url.includes('\\'))
51
+ return url;
52
+ try {
53
+ const parsed = new URL(url);
54
+ if (parsed.protocol === 'https:' || parsed.protocol === 'http:' || parsed.protocol === 'blob:')
55
+ return url;
56
+ }
57
+ catch {
58
+ /* invalid URL */
59
+ }
60
+ return undefined;
61
+ }
62
+ /** A callable optional port, plus the legacy explicit-disable flag, is required. */
63
+ export function canReplaceMedia({ api }, _optional = {}) {
64
+ return typeof api.replace === 'function' && api.replaceSupported !== false;
65
+ }
66
+ export function canRestoreMedia({ api }, _optional = {}) {
67
+ return typeof api.restore === 'function' && api.restoreSupported !== false;
68
+ }
69
+ /** Prefer the transport's retryability decision. Older transports only expose HTTP
70
+ * status in their message; network failures and temporary server failures recover too.
71
+ * Authorization/validation failures must never produce an automatic request loop. */
72
+ export function isRetryableMediaError({ error }, _optional = {}) {
73
+ if (!error || typeof error !== 'object')
74
+ return false;
75
+ const failure = error;
76
+ if (typeof failure.retryable === 'boolean')
77
+ return failure.retryable;
78
+ const status = failure.status ?? failure.statusCode ?? Number(failure.message?.match(/HTTP\s+(\d{3})/i)?.[1]);
79
+ return status === 408 || status === 429 || (status >= 500 && status <= 599) || error instanceof TypeError;
80
+ }
81
+ /** Blank means native size; invalid values reach the server's positive-integer validator. */
82
+ export function parseOptionalPixelSize({ value }, _optional = {}) {
83
+ return value.trim() === '' ? null : Number(value);
84
+ }
85
+ /** 1024-based to agree with upload limits. Whole B/KB, one decimal MB/GB distinguishes
86
+ * similarly sized clips; locale controls the decimal separator, never a hardcoded dot. */
87
+ export function formatByteSize({ bytes }, { locale = 'en-US' } = {}) {
88
+ if (bytes < 1024)
89
+ return `${Math.round(bytes)} B`;
90
+ const kb = bytes / 1024;
91
+ if (kb < 1024)
92
+ return `${Math.round(kb)} KB`;
93
+ const decimal = new Intl.NumberFormat(locale, { minimumFractionDigits: 1, maximumFractionDigits: 1 });
94
+ const mb = kb / 1024;
95
+ return mb < 1024 ? `${decimal.format(mb)} MB` : `${decimal.format(mb / 1024)} GB`;
96
+ }
97
+ /** Full-library counts, independent of search/order/type selection; Providers has no count. */
98
+ export function countMediaTabs({ media }, _optional = {}) {
99
+ return { all: media.length, images: filterMediaByTab({ media, tab: 'images' }).length,
100
+ videos: filterMediaByTab({ media, tab: 'videos' }).length };
101
+ }
102
+ /** Readable slug markers survive title/hash changes. Escape attribute delimiters even
103
+ * though real hosts validate slugs; a test or third-party adapter must not inject markup. */
104
+ export function mediaEmbedSnippet({ slug }, _optional = {}) {
105
+ if (!slug)
106
+ return null;
107
+ const config = JSON.stringify({ type: 'media', slug }).replace(/&/g, '&amp;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
108
+ return `<div data-embed-config='${config}'></div>`;
109
+ }
110
+ /** Legacy row handles derive from stable IDs across the ENTIRE visible list. Per-card
111
+ * slugification cannot resolve collisions: duplicate handles silently make page.click/fill
112
+ * target the first DOM match. Search suffixes, because [x, x-2, X] can collide again.
113
+ * This media-local shape mirrors the agent runtime's canonical list-handle contract without
114
+ * adding a package dependency in a source-only change. */
115
+ export function mediaRowHandles({ media }, _optional = {}) {
116
+ const used = new Set();
117
+ return media.map((item, index) => {
118
+ const slug = item.id.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
119
+ const preferred = `media-item-${slug || index + 1}`;
120
+ let handle = preferred, suffix = 2;
121
+ while (used.has(handle))
122
+ handle = `${preferred}-${suffix++}`;
123
+ used.add(handle);
124
+ return handle;
125
+ });
126
+ }
127
+ /** A calendar date in UTC, so cards do not shift an upload to yesterday across host timezones. */
128
+ export function formatUploadDate({ createdAt }, { locale = 'en-US' } = {}) {
129
+ const date = new Date(createdAt);
130
+ if (!Number.isFinite(date.getTime()))
131
+ return null;
132
+ return new Intl.DateTimeFormat(locale, { month: 'short', day: 'numeric', year: 'numeric', timeZone: 'UTC' }).format(date);
133
+ }
134
+ //# sourceMappingURL=rules.js.map
@@ -0,0 +1,4 @@
1
+ /** Scoped feature presentation travels with compiled JS. It also overrides host dialog
2
+ * CSS that can accidentally display a closed dialog or shrink a large media preview. */
3
+ export declare const mediaStyles = "";
4
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1,5 @@
1
+ /** Scoped feature presentation travels with compiled JS. It also overrides host dialog
2
+ * CSS that can accidentally display a closed dialog or shrink a large media preview. */
3
+ // Host CSS now supplies presentation and the closed-dialog safeguards on jini- classes.
4
+ export const mediaStyles = '';
5
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1,8 @@
1
+ /** The source registers a local portal node. It has no server route to adapt.
2
+ * Serializing that node or inventing a backend would change the whiteboard contract. */
3
+ export declare const playgroundHttpSupport: Readonly<{
4
+ supported: false;
5
+ routes: readonly string[];
6
+ reason: "Playground is a browser render-target handshake with no HTTP routes.";
7
+ }>;
8
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1,4 @@
1
+ /** The source registers a local portal node. It has no server route to adapt.
2
+ * Serializing that node or inventing a backend would change the whiteboard contract. */
3
+ export const playgroundHttpSupport = Object.freeze({ supported: false, routes: Object.freeze([]), reason: 'Playground is a browser render-target handshake with no HTTP routes.' });
4
+ //# sourceMappingURL=http.js.map
@@ -0,0 +1,10 @@
1
+ import type { PlaygroundRenderTargetPort } from '../../contracts/playground-render-target.js';
2
+ /** Instance-local browser bus as well as a headless fake; no global module singleton. */
3
+ export declare function createMemoryPlaygroundTargets(_required: Record<string, never>, { onListenerError }?: {
4
+ onListenerError?: (required: {
5
+ error: unknown;
6
+ }, optional?: Record<string, never>) => void;
7
+ }): PlaygroundRenderTargetPort & {
8
+ dispose(required?: Record<string, never>, optional?: Record<string, never>): void;
9
+ };
10
+ //# sourceMappingURL=memory.d.ts.map
@@ -0,0 +1,30 @@
1
+ /** Instance-local browser bus as well as a headless fake; no global module singleton. */
2
+ export function createMemoryPlaygroundTargets(_required, { onListenerError } = {}) {
3
+ let snapshot = Object.freeze({ target: null }), owner = null, disposed = false;
4
+ const listeners = new Set();
5
+ function publish(target) {
6
+ // No-op on unchanged value: ref replay cannot produce a notification storm.
7
+ if (snapshot.target === target)
8
+ return;
9
+ snapshot = Object.freeze({ target });
10
+ for (const listener of [...listeners]) {
11
+ try {
12
+ listener();
13
+ }
14
+ catch (error) {
15
+ onListenerError?.({ error });
16
+ }
17
+ }
18
+ }
19
+ return {
20
+ getSnapshot: (_required = {}, _optional = {}) => snapshot,
21
+ subscribe({ listener }, _optional = {}) { if (!disposed)
22
+ listeners.add(listener); return () => listeners.delete(listener); },
23
+ register({ target }, _optional = {}) { if (disposed)
24
+ throw new Error('Playground target scope disposed'); const ticket = {}; owner = ticket; publish(target); return { release(_required = {}, _optional = {}) { if (owner !== ticket)
25
+ return; owner = null; publish(null); } }; },
26
+ dispose(_required = {}, _optional = {}) { if (disposed)
27
+ return; disposed = true; owner = null; publish(null); listeners.clear(); },
28
+ };
29
+ }
30
+ //# sourceMappingURL=memory.js.map
@@ -0,0 +1,6 @@
1
+ import type { PlaygroundRenderTargetPort } from '../../contracts/playground-render-target.js';
2
+ /** Run with an isolated bus; this temporarily registers and releases test targets. */
3
+ export declare function runPlaygroundApiConformance({ targets }: {
4
+ targets: PlaygroundRenderTargetPort;
5
+ }, _optional?: {}): readonly string[];
6
+ //# sourceMappingURL=playground-api.conformance.d.ts.map
@@ -0,0 +1,37 @@
1
+ /** Run with an isolated bus; this temporarily registers and releases test targets. */
2
+ export function runPlaygroundApiConformance({ targets }, _optional = {}) {
3
+ const checks = [];
4
+ const assert = (ok, name) => { if (!ok)
5
+ throw new Error(`Playground conformance: ${name}`); checks.push(name); };
6
+ const a = {}, b = {};
7
+ let count = 0;
8
+ const stop = targets.subscribe({ listener: () => count++ });
9
+ const first = targets.register({ target: a });
10
+ let second;
11
+ try {
12
+ assert(targets.getSnapshot().target === a, 'published target is readable');
13
+ const snapshot = targets.getSnapshot();
14
+ assert(snapshot === targets.getSnapshot(), 'snapshot identity is cached');
15
+ const same = targets.register({ target: a });
16
+ assert(count === 1, 'unchanged node does not notify');
17
+ first.release({});
18
+ assert(targets.getSnapshot().target === a, 'stale publisher cannot clear current target');
19
+ second = targets.register({ target: b });
20
+ assert(snapshot.target === a, 'prior snapshots do not mutate');
21
+ same.release({});
22
+ assert(targets.getSnapshot().target === b, 'release cannot clear a newer node');
23
+ second.release({});
24
+ assert(targets.getSnapshot().target === null && count === 3, 'detach publishes inline fallback');
25
+ stop();
26
+ const last = targets.register({ target: a });
27
+ last.release({});
28
+ assert(count === 3, 'unsubscribe stops notifications');
29
+ return Object.freeze(checks);
30
+ }
31
+ finally {
32
+ first.release({});
33
+ second?.release({});
34
+ stop();
35
+ }
36
+ }
37
+ //# sourceMappingURL=playground-api.conformance.js.map
@@ -0,0 +1,16 @@
1
+ import type { PlaygroundRenderTargetPort } from '../../contracts/playground-render-target.js';
2
+ import type { PlaygroundState } from '../models.js';
3
+ export declare function createPlaygroundController({ targets, permissions }: {
4
+ targets: PlaygroundRenderTargetPort;
5
+ permissions?: readonly string[];
6
+ }, _optional?: {}): {
7
+ getSnapshot: () => Readonly<PlaygroundState>;
8
+ subscribe: ({ listener }: {
9
+ listener: () => void;
10
+ }) => () => void;
11
+ attach({ target }: {
12
+ target: object | null;
13
+ }, _optional?: {}): void;
14
+ dispose(_required?: Record<string, never>, _optional?: {}): void;
15
+ };
16
+ //# sourceMappingURL=playground.controller.d.ts.map
@@ -0,0 +1,21 @@
1
+ import { createControllerStore } from '../../core/module/controller-store.js';
2
+ import { canMountPlayground } from '../rules.js';
3
+ export function createPlaygroundController({ targets, permissions = [] }, _optional = {}) {
4
+ const store = createControllerStore({ initial: { attached: false } });
5
+ let node = null, lease = null;
6
+ function detach() { lease?.release({}); lease = null; node = null; store.set({ patch: { attached: false } }); }
7
+ return { getSnapshot: store.getSnapshot, subscribe: store.subscribe,
8
+ attach({ target }, _optional = {}) {
9
+ if (store.signal.aborted || !canMountPlayground({ permissions }) || target === node)
10
+ return;
11
+ detach();
12
+ if (target) {
13
+ lease = targets.register({ target });
14
+ node = target;
15
+ store.set({ patch: { attached: true } });
16
+ }
17
+ },
18
+ dispose(_required = {}, _optional = {}) { detach(); store.dispose(); },
19
+ };
20
+ }
21
+ //# sourceMappingURL=playground.controller.js.map
@@ -0,0 +1,7 @@
1
+ export { playgroundModule } from './playground.module.js';
2
+ export { createPlaygroundController } from './controllers/playground.controller.js';
3
+ export { canMountPlayground } from './rules.js';
4
+ export { playgroundMessagesEn } from './messages.en.js';
5
+ export type { PlaygroundState } from './models.js';
6
+ export type { PlaygroundPorts } from './ports.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ export { playgroundModule } from './playground.module.js';
2
+ export { createPlaygroundController } from './controllers/playground.controller.js';
3
+ export { canMountPlayground } from './rules.js';
4
+ export { playgroundMessagesEn } from './messages.en.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,9 @@
1
+ export declare const playgroundMessagesEn: Readonly<{
2
+ title: "Playground";
3
+ studio: "Studio";
4
+ canvas: "Canvas";
5
+ description: "Ask the assistant to build anything — try “Show a pie chart of my data.”";
6
+ empty: "Nothing drawn yet — ask the assistant.";
7
+ denied: "Permission denied";
8
+ }>;
9
+ //# sourceMappingURL=messages.en.d.ts.map
@@ -0,0 +1,2 @@
1
+ export const playgroundMessagesEn = Object.freeze({ title: 'Playground', studio: 'Studio', canvas: 'Canvas', description: 'Ask the assistant to build anything — try “Show a pie chart of my data.”', empty: 'Nothing drawn yet — ask the assistant.', denied: 'Permission denied' });
2
+ //# sourceMappingURL=messages.en.js.map
@@ -0,0 +1,4 @@
1
+ export interface PlaygroundState {
2
+ readonly attached: boolean;
3
+ }
4
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1,31 @@
1
+ export declare const playgroundModule: {
2
+ readonly id: "playground";
3
+ readonly requires: {
4
+ readonly playgroundTargets: import("../core/module/token.js").AdminPortToken<import("../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
5
+ };
6
+ readonly messages: Readonly<{
7
+ title: "Playground";
8
+ studio: "Studio";
9
+ canvas: "Canvas";
10
+ description: "Ask the assistant to build anything — try “Show a pie chart of my data.”";
11
+ empty: "Nothing drawn yet — ask the assistant.";
12
+ denied: "Permission denied";
13
+ }>;
14
+ readonly pages: {
15
+ readonly playground: {
16
+ readonly path: "/playground";
17
+ readonly label: "Playground";
18
+ readonly permissions: readonly ["playground.read"];
19
+ readonly nav: {
20
+ readonly group: "studio";
21
+ readonly icon: "canvas";
22
+ };
23
+ readonly tabs: {
24
+ readonly canvas: {
25
+ readonly label: "Canvas";
26
+ };
27
+ };
28
+ };
29
+ };
30
+ };
31
+ //# sourceMappingURL=playground.module.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { defineAdminModule } from '../core/module/index.js';
2
+ import { playgroundRenderTargetToken } from '../contracts/playground-render-target.js';
3
+ import { playgroundMessagesEn } from './messages.en.js';
4
+ export const playgroundModule = defineAdminModule({ id: 'playground', requires: { playgroundTargets: playgroundRenderTargetToken }, messages: playgroundMessagesEn, pages: { playground: { path: '/playground', label: playgroundMessagesEn.title, permissions: ['playground.read'], nav: { group: 'studio', icon: 'canvas' }, tabs: { canvas: { label: playgroundMessagesEn.canvas } } } } });
5
+ //# sourceMappingURL=playground.module.js.map
@@ -0,0 +1,5 @@
1
+ import type { PlaygroundRenderTargetPort } from '../contracts/playground-render-target.js';
2
+ export interface PlaygroundPorts {
3
+ readonly playgroundTargets: PlaygroundRenderTargetPort;
4
+ }
5
+ //# sourceMappingURL=ports.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ports.js.map
@@ -0,0 +1,3 @@
1
+ import type { TabViewProps } from '../../../react/bind-react.js';
2
+ export declare function Canvas(props: TabViewProps, _optional?: {}): import("react").JSX.Element;
3
+ //# sourceMappingURL=Canvas.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Notice } from '@jini-ai/ui-kit/react';
3
+ import { useCanvas } from '../hooks/Canvas.hooks.js';
4
+ import { playgroundMessagesEn as m } from '../../messages.en.js';
5
+ export function Canvas(props, _optional = {}) {
6
+ const vm = useCanvas(props);
7
+ return vm.denied ? _jsx(Notice, { tone: "danger", children: m.denied }) : _jsxs("section", { children: [_jsx("h2", { children: m.canvas }), _jsx("style", { children: vm.styles }), _jsx("div", { "data-jini-part": "playground.canvas", className: "jini-playground-canvas", ref: vm.registerCanvas }), _jsx("p", { "data-jini-part": "playground.empty", className: "jini-playground-empty", children: m.empty })] });
8
+ }
9
+ //# sourceMappingURL=Canvas.js.map
@@ -0,0 +1,7 @@
1
+ import type { TabViewProps } from '../../../react/bind-react.js';
2
+ export declare function useCanvas({ permissions }: TabViewProps, _optional?: {}): {
3
+ denied: boolean;
4
+ registerCanvas: (node: HTMLDivElement | null) => void | undefined;
5
+ styles: string;
6
+ };
7
+ //# sourceMappingURL=Canvas.hooks.d.ts.map
@@ -0,0 +1,18 @@
1
+ import { useCallback } from 'react';
2
+ import { useController } from '../../../react/use-controller.js';
3
+ import { createPlaygroundController } from '../../controllers/playground.controller.js';
4
+ import { canMountPlayground } from '../../rules.js';
5
+ import { usePlaygroundPorts } from './PlaygroundPorts.hooks.js';
6
+ export function useCanvas({ permissions = [] }, _optional = {}) {
7
+ const { playgroundTargets } = usePlaygroundPorts({});
8
+ const key = permissions.join('\0');
9
+ const { controller } = useController({ create: () => createPlaygroundController({ targets: playgroundTargets, permissions }), dependencies: [playgroundTargets, key] });
10
+ // Stable ref callback registers the actual node on attach and releases on detach;
11
+ // an ordinary rerender must never temporarily revert assistant routing to inline.
12
+ const registerCanvas = useCallback((node) => controller?.attach({ target: node }), [controller]);
13
+ return { denied: !canMountPlayground({ permissions }), registerCanvas,
14
+ // CSS sibling matching keeps the canvas a pure portal target, with no React-owned children.
15
+ styles: '.jini-playground-canvas{display:flex;flex-direction:column;gap:1rem}.jini-playground-empty{display:none}.jini-playground-canvas:empty + .jini-playground-empty{display:block}',
16
+ };
17
+ }
18
+ //# sourceMappingURL=Canvas.hooks.js.map
@@ -0,0 +1,8 @@
1
+ import type { ModulePageProps } from '../../../react/bind-react.js';
2
+ export declare function usePlaygroundPage(props: ModulePageProps, _optional?: {}): {
3
+ denied: boolean;
4
+ ActiveTab: import("react").LazyExoticComponent<import("react").ComponentType<import("../../../react/bind-react.js").TabViewProps>> | undefined;
5
+ params: Readonly<Record<string, unknown>>;
6
+ permissions: readonly string[];
7
+ };
8
+ //# sourceMappingURL=PlaygroundPage.hooks.d.ts.map
@@ -0,0 +1,2 @@
1
+ export function usePlaygroundPage(props, _optional = {}) { const tab = props.description.tabs.find(t => t.visible); return { denied: !props.description.visible, ActiveTab: tab ? props.tabs.canvas : undefined, params: tab?.params ?? {}, permissions: props.description.grants }; }
2
+ //# sourceMappingURL=PlaygroundPage.hooks.js.map
@@ -0,0 +1,4 @@
1
+ import type { PlaygroundPorts } from '../../ports.js';
2
+ export declare const PlaygroundPortsContext: import("react").Context<PlaygroundPorts | null>;
3
+ export declare function usePlaygroundPorts(_required?: Record<string, never>, _optional?: {}): PlaygroundPorts;
4
+ //# sourceMappingURL=PlaygroundPorts.hooks.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { createContext, useContext } from 'react';
2
+ import { AdminConfigError } from '../../../core/module/index.js';
3
+ export const PlaygroundPortsContext = createContext(null);
4
+ export function usePlaygroundPorts(_required = {}, _optional = {}) { const ports = useContext(PlaygroundPortsContext); if (!ports)
5
+ throw new AdminConfigError({ issues: ['React scope unavailable: playground'] }); return ports; }
6
+ //# sourceMappingURL=PlaygroundPorts.hooks.js.map