@jini-ai/admin 0.3.10 → 0.4.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 (399) hide show
  1. package/CHANGELOG.md +58 -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 +43 -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 +79 -0
  168. package/dist/media/react/hooks/MediaCard.hooks.js +63 -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 +28 -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 +80 -0
  196. package/dist/media/rules.js +127 -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/kit/Kit.hooks.d.ts +13 -0
  284. package/dist/react/kit/Kit.hooks.js +10 -0
  285. package/dist/react/kit/Native.hooks.d.ts +38 -0
  286. package/dist/react/kit/Native.hooks.js +65 -0
  287. package/dist/react/kit/index.d.ts +12 -0
  288. package/dist/react/kit/index.js +21 -0
  289. package/dist/react/kit/native.d.ts +3 -0
  290. package/dist/react/kit/native.js +21 -0
  291. package/dist/react/kit/types.d.ts +40 -0
  292. package/dist/react/kit/types.js +2 -0
  293. package/dist/react/overlay.d.ts +36 -0
  294. package/dist/react/overlay.js +35 -0
  295. package/dist/react/overlays.d.ts +38 -0
  296. package/dist/react/overlays.js +46 -0
  297. package/dist/react/shell/AdminShell.d.ts +9 -0
  298. package/dist/react/shell/AdminShell.hooks.d.ts +15 -0
  299. package/dist/react/shell/AdminShell.hooks.js +27 -0
  300. package/dist/react/shell/AdminShell.js +46 -0
  301. package/dist/react/shell/index.d.ts +7 -0
  302. package/dist/react/shell/index.js +5 -0
  303. package/dist/react/shell/model.d.ts +25 -0
  304. package/dist/react/shell/model.js +29 -0
  305. package/dist/react/shell/theme-ports.d.ts +28 -0
  306. package/dist/react/shell/theme-ports.js +2 -0
  307. package/dist/react/shell/types.d.ts +99 -0
  308. package/dist/react/shell/types.js +2 -0
  309. package/dist/react/shell/use-admin-shell-session.d.ts +13 -0
  310. package/dist/react/shell/use-admin-shell-session.js +81 -0
  311. package/dist/react/shell/use-admin-theme.d.ts +16 -0
  312. package/dist/react/shell/use-admin-theme.js +57 -0
  313. package/dist/react/types.d.ts +6 -4
  314. package/dist/react/types.js +2 -2
  315. package/dist/react/use-controller.d.ts +16 -0
  316. package/dist/react/use-controller.js +18 -0
  317. package/dist/security/adapters/http.d.ts +16 -0
  318. package/dist/security/adapters/http.js +94 -0
  319. package/dist/security/adapters/memory.d.ts +15 -0
  320. package/dist/security/adapters/memory.js +60 -0
  321. package/dist/security/conformance/security-api.conformance.d.ts +10 -0
  322. package/dist/security/conformance/security-api.conformance.js +48 -0
  323. package/dist/security/controllers/access-tokens.controller.d.ts +44 -0
  324. package/dist/security/controllers/access-tokens.controller.js +112 -0
  325. package/dist/security/controllers/other-credentials.controller.d.ts +30 -0
  326. package/dist/security/controllers/other-credentials.controller.js +74 -0
  327. package/dist/security/controllers/root-key.controller.d.ts +35 -0
  328. package/dist/security/controllers/root-key.controller.js +90 -0
  329. package/dist/security/index.d.ts +9 -0
  330. package/dist/security/index.js +9 -0
  331. package/dist/security/messages.en.d.ts +12 -0
  332. package/dist/security/messages.en.js +2 -0
  333. package/dist/security/models.d.ts +112 -0
  334. package/dist/security/models.js +2 -0
  335. package/dist/security/ports.d.ts +58 -0
  336. package/dist/security/ports.js +5 -0
  337. package/dist/security/react/components/CredentialEditor.d.ts +3 -0
  338. package/dist/security/react/components/CredentialEditor.js +8 -0
  339. package/dist/security/react/hooks/AccessTokensTab.hooks.d.ts +94 -0
  340. package/dist/security/react/hooks/AccessTokensTab.hooks.js +36 -0
  341. package/dist/security/react/hooks/CredentialEditor.hooks.d.ts +49 -0
  342. package/dist/security/react/hooks/CredentialEditor.hooks.js +14 -0
  343. package/dist/security/react/hooks/RootKeyTab.hooks.d.ts +29 -0
  344. package/dist/security/react/hooks/RootKeyTab.hooks.js +19 -0
  345. package/dist/security/react/hooks/SecurityPage.hooks.d.ts +17 -0
  346. package/dist/security/react/hooks/SecurityPage.hooks.js +12 -0
  347. package/dist/security/react/hooks/SecurityPorts.hooks.d.ts +9 -0
  348. package/dist/security/react/hooks/SecurityPorts.hooks.js +6 -0
  349. package/dist/security/react/index.d.ts +215 -0
  350. package/dist/security/react/index.js +10 -0
  351. package/dist/security/react/pages/SecurityPage.d.ts +4 -0
  352. package/dist/security/react/pages/SecurityPage.js +10 -0
  353. package/dist/security/react/tabs/AccessTokensTab.d.ts +4 -0
  354. package/dist/security/react/tabs/AccessTokensTab.js +10 -0
  355. package/dist/security/react/tabs/RootKeyTab.d.ts +4 -0
  356. package/dist/security/react/tabs/RootKeyTab.js +9 -0
  357. package/dist/security/rules.d.ts +57 -0
  358. package/dist/security/rules.js +63 -0
  359. package/dist/security/security.module.d.ts +45 -0
  360. package/dist/security/security.module.js +5 -0
  361. package/dist/source-control/adapters/http.d.ts +6 -0
  362. package/dist/source-control/adapters/http.js +13 -0
  363. package/dist/source-control/adapters/memory.d.ts +9 -0
  364. package/dist/source-control/adapters/memory.js +35 -0
  365. package/dist/source-control/conformance/source-control-api.conformance.d.ts +10 -0
  366. package/dist/source-control/conformance/source-control-api.conformance.js +48 -0
  367. package/dist/source-control/controllers/source-control.controller.d.ts +26 -0
  368. package/dist/source-control/controllers/source-control.controller.js +70 -0
  369. package/dist/source-control/index.d.ts +8 -0
  370. package/dist/source-control/index.js +6 -0
  371. package/dist/source-control/messages.en.d.ts +11 -0
  372. package/dist/source-control/messages.en.js +2 -0
  373. package/dist/source-control/models.d.ts +70 -0
  374. package/dist/source-control/models.js +2 -0
  375. package/dist/source-control/ports.d.ts +23 -0
  376. package/dist/source-control/ports.js +3 -0
  377. package/dist/source-control/react/components/SourceControlCredentialFields.d.ts +5 -0
  378. package/dist/source-control/react/components/SourceControlCredentialFields.js +8 -0
  379. package/dist/source-control/react/components/SourceControlProviderRow.d.ts +5 -0
  380. package/dist/source-control/react/components/SourceControlProviderRow.js +7 -0
  381. package/dist/source-control/react/hooks/ProvidersTab.hooks.d.ts +45 -0
  382. package/dist/source-control/react/hooks/ProvidersTab.hooks.js +20 -0
  383. package/dist/source-control/react/hooks/SourceControlCredentialFields.hooks.d.ts +43 -0
  384. package/dist/source-control/react/hooks/SourceControlCredentialFields.hooks.js +9 -0
  385. package/dist/source-control/react/hooks/SourceControlPage.hooks.d.ts +17 -0
  386. package/dist/source-control/react/hooks/SourceControlPage.hooks.js +5 -0
  387. package/dist/source-control/react/hooks/SourceControlPorts.hooks.d.ts +9 -0
  388. package/dist/source-control/react/hooks/SourceControlPorts.hooks.js +6 -0
  389. package/dist/source-control/react/index.d.ts +156 -0
  390. package/dist/source-control/react/index.js +10 -0
  391. package/dist/source-control/react/pages/SourceControlPage.d.ts +4 -0
  392. package/dist/source-control/react/pages/SourceControlPage.js +11 -0
  393. package/dist/source-control/react/tabs/ProvidersTab.d.ts +4 -0
  394. package/dist/source-control/react/tabs/ProvidersTab.js +10 -0
  395. package/dist/source-control/rules.d.ts +32 -0
  396. package/dist/source-control/rules.js +35 -0
  397. package/dist/source-control/source-control.module.d.ts +36 -0
  398. package/dist/source-control/source-control.module.js +6 -0
  399. package/package.json +207 -4
@@ -0,0 +1,112 @@
1
+ export type CredentialKind = 'publish' | 'source-control' | 'custom';
2
+ export type CredentialCategory = 'source-control' | 'hosting' | 'media' | 'ai' | 'ops' | 'general';
3
+ export interface RequestOptions {
4
+ readonly signal?: AbortSignal;
5
+ }
6
+ export interface CredentialField {
7
+ readonly name: string;
8
+ readonly label: string;
9
+ readonly required?: boolean;
10
+ readonly secret?: boolean;
11
+ readonly type?: string;
12
+ readonly help?: string;
13
+ }
14
+ export interface CredentialProvider {
15
+ readonly kind: Exclude<CredentialKind, 'custom'>;
16
+ readonly id: string;
17
+ readonly label: string;
18
+ readonly vendorLabel: string;
19
+ readonly category: CredentialCategory;
20
+ readonly tokenField: string;
21
+ readonly fields: readonly CredentialField[];
22
+ readonly tokenPageUrl?: string;
23
+ readonly help?: string;
24
+ }
25
+ /** A saved token is never read back: label and updatedAt identify a connection without a last-4 hint. */
26
+ export interface CredentialSummary {
27
+ readonly kind: CredentialKind;
28
+ readonly id: string;
29
+ readonly providerId: string;
30
+ readonly label: string;
31
+ readonly configured: boolean;
32
+ readonly isDefault: boolean;
33
+ readonly createdAt: string;
34
+ readonly updatedAt: string;
35
+ readonly accountLabel?: string | null;
36
+ readonly category?: CredentialCategory;
37
+ readonly baseUrl?: string;
38
+ readonly additionalHosts?: readonly string[];
39
+ readonly username?: string;
40
+ }
41
+ export interface CredentialInput {
42
+ readonly label: string;
43
+ readonly connection: Readonly<Record<string, string>>;
44
+ readonly isDefault?: boolean;
45
+ readonly category?: CredentialCategory;
46
+ readonly baseUrl?: string;
47
+ readonly additionalHosts?: readonly string[];
48
+ }
49
+ export interface CredentialPatch {
50
+ readonly label?: string;
51
+ readonly connection?: Readonly<Record<string, string>>;
52
+ readonly isDefault?: boolean;
53
+ readonly category?: CredentialCategory;
54
+ readonly baseUrl?: string;
55
+ readonly additionalHosts?: readonly string[];
56
+ /** Omit preserves, null clears, string replaces independently of secret replacement. */
57
+ readonly username?: string | null;
58
+ }
59
+ export interface CredentialDraft {
60
+ readonly kind: CredentialKind;
61
+ readonly id?: string;
62
+ readonly providerId: string;
63
+ readonly label: string;
64
+ readonly token: string;
65
+ readonly values: Readonly<Record<string, string>>;
66
+ readonly category: CredentialCategory;
67
+ readonly baseUrl: string;
68
+ readonly additionalHosts: string;
69
+ readonly username: string;
70
+ }
71
+ export type OtherStoreId = 'site-assistant' | 'admin-byok' | 'media-provider' | 'external-mcp';
72
+ export interface OtherCredentialSummary {
73
+ readonly store: OtherStoreId;
74
+ readonly id: string;
75
+ readonly label: string;
76
+ readonly category: CredentialCategory;
77
+ readonly configured: boolean;
78
+ readonly supportsReplace: boolean;
79
+ readonly envNames?: readonly string[];
80
+ readonly updatedAt?: string | null;
81
+ }
82
+ export type RootKeyState = 'active' | 'missing' | 'missing-with-data' | 'mismatch' | 'invalid';
83
+ export interface RootKeyStatus {
84
+ readonly active: boolean;
85
+ readonly source: 'env' | 'file' | 'none';
86
+ readonly state: RootKeyState;
87
+ readonly fingerprint?: string;
88
+ readonly invalid?: boolean;
89
+ readonly keyFilePath: string;
90
+ readonly runtimeMode: 'production' | 'local';
91
+ }
92
+ export interface RootKeyPreview {
93
+ readonly removes: number;
94
+ readonly affectedWebhooks: readonly {
95
+ readonly label: string;
96
+ readonly targetUrl: string;
97
+ }[];
98
+ readonly detail: string;
99
+ readonly runtimeMode: 'production' | 'local';
100
+ }
101
+ export interface RootKeyResult {
102
+ readonly outcome: string;
103
+ readonly fingerprint: string;
104
+ readonly keyFilePath: string;
105
+ readonly runtimeMode: 'production' | 'local';
106
+ readonly resealed?: number;
107
+ readonly discarded?: number;
108
+ readonly kept?: number;
109
+ readonly affectedWebhooks?: RootKeyPreview['affectedWebhooks'];
110
+ readonly restorePointId?: string;
111
+ }
112
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1,58 @@
1
+ import type { CredentialSummary, CredentialProvider, CredentialInput, CredentialPatch, RequestOptions, OtherStoreId, OtherCredentialSummary, RootKeyStatus, RootKeyPreview, RootKeyResult } from './models.js';
2
+ /** Separate method groups: connection shapes differ, and deployment and source identities must never merge. */
3
+ export interface CredentialStorePort {
4
+ list(required: Record<string, never>, optional?: RequestOptions): Promise<readonly CredentialSummary[]>;
5
+ create(required: CredentialInput, optional?: RequestOptions): Promise<CredentialSummary>;
6
+ update(required: {
7
+ id: string;
8
+ patch: CredentialPatch;
9
+ }, optional?: RequestOptions): Promise<CredentialSummary>;
10
+ /** Idempotent, including stale lists and double clicks. */
11
+ remove(required: {
12
+ id: string;
13
+ }, optional?: RequestOptions): Promise<void>;
14
+ }
15
+ export interface SecurityApiPort {
16
+ providers(required: Record<string, never>, optional?: RequestOptions): Promise<readonly CredentialProvider[]>;
17
+ readonly publish: CredentialStorePort;
18
+ readonly sourceControl: CredentialStorePort;
19
+ readonly custom: CredentialStorePort;
20
+ }
21
+ /** Other stores keep their own endpoint shapes inside the adapter. No saved material leaves it. */
22
+ export interface OtherCredentialsPort {
23
+ list(required: {
24
+ store: OtherStoreId;
25
+ }, optional?: RequestOptions): Promise<readonly OtherCredentialSummary[]>;
26
+ replace(required: {
27
+ store: OtherStoreId;
28
+ id: string;
29
+ token: string;
30
+ }, optional?: RequestOptions): Promise<void>;
31
+ remove(required: {
32
+ store: OtherStoreId;
33
+ id: string;
34
+ }, optional?: RequestOptions): Promise<void>;
35
+ }
36
+ /** No reveal operation: the host owns storage, encryption, key creation and recovery. */
37
+ export interface RootKeyPort {
38
+ status(required: Record<string, never>, optional?: RequestOptions): Promise<RootKeyStatus>;
39
+ generate(required: Record<string, never>, optional?: RequestOptions): Promise<RootKeyResult>;
40
+ importToken(required: {
41
+ token: string;
42
+ }, optional?: RequestOptions): Promise<RootKeyResult>;
43
+ previewStartFresh(required: Record<string, never>, optional?: RequestOptions): Promise<RootKeyPreview>;
44
+ startFresh(required: {
45
+ confirm: string;
46
+ }, optional?: RequestOptions): Promise<RootKeyResult>;
47
+ }
48
+ export declare const securityApiToken: import("../core/module/token.js").AdminPortToken<SecurityApiPort, "admin.security.api">;
49
+ export declare const otherCredentialsToken: import("../core/module/token.js").AdminPortToken<OtherCredentialsPort, "admin.security.other">;
50
+ export declare const rootKeyToken: import("../core/module/token.js").AdminPortToken<RootKeyPort, "admin.security.root-key">;
51
+ export interface SecurityTransportPort {
52
+ request<T>(required: {
53
+ path: string;
54
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE';
55
+ body?: unknown;
56
+ }, optional?: RequestOptions): Promise<T>;
57
+ }
58
+ //# sourceMappingURL=ports.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { adminPort } from '../core/module/token.js';
2
+ export const securityApiToken = adminPort({ id: 'admin.security.api' });
3
+ export const otherCredentialsToken = adminPort({ id: 'admin.security.other' });
4
+ export const rootKeyToken = adminPort({ id: 'admin.security.root-key' });
5
+ //# sourceMappingURL=ports.js.map
@@ -0,0 +1,3 @@
1
+ import { type CredentialEditorProps } from '../hooks/CredentialEditor.hooks.js';
2
+ export declare function CredentialEditor(props: CredentialEditorProps, _optional?: {}): import("react").JSX.Element;
3
+ //# sourceMappingURL=CredentialEditor.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, TextField, TextArea, Select, Dialog } from '@jini-ai/ui-kit/react';
3
+ import { useCredentialEditor } from '../hooks/CredentialEditor.hooks.js';
4
+ export function CredentialEditor(props, _optional = {}) {
5
+ const vm = useCredentialEditor(props);
6
+ return _jsxs(Dialog, { open: true, title: vm.title, onClose: vm.cancel, pending: vm.saving, children: [_jsx(TextField, { label: "Name", value: props.draft.label, onValueChange: vm.onLabel, disabled: vm.saving }), _jsx(TextField, { label: vm.tokenLabel, type: "password", value: props.draft.token, onValueChange: vm.onToken, disabled: vm.saving, attrs: { 'data-agent-private': 'true' } }), vm.fields.map(field => _jsx(TextField, { label: field.label, type: field.secret ? 'password' : 'text', value: field.value, onValueChange: field.onValueChange, required: field.required === true, disabled: vm.saving }, field.name)), props.draft.kind === 'custom' && _jsxs(_Fragment, { children: [_jsx(Select, { label: "Category", value: props.draft.category, options: vm.categories, onValueChange: vm.onCategory, disabled: vm.saving }), _jsx(TextField, { label: "Base URL", type: "url", value: props.draft.baseUrl, onValueChange: vm.onUrl, disabled: vm.saving }), _jsx(TextField, { label: "Username", value: props.draft.username, onValueChange: vm.onUsername, disabled: vm.saving }), _jsx(TextArea, { label: "Additional hosts", value: props.draft.additionalHosts, onValueChange: vm.onHosts, disabled: vm.saving })] }), _jsx(Button, { onPress: vm.save, pending: vm.saving, children: "Save" }), _jsx(Button, { onPress: vm.cancel, disabled: vm.saving, children: "Cancel" })] });
7
+ }
8
+ //# sourceMappingURL=CredentialEditor.js.map
@@ -0,0 +1,94 @@
1
+ import type { TabViewProps } from '../../../react/bind-react.js';
2
+ import type { CredentialSummary, OtherCredentialSummary, CredentialCategory } from '../../models.js';
3
+ export declare function useAccessTokensTab({ permissions }: TabViewProps, _optional?: {}): {
4
+ denied: boolean;
5
+ loading: boolean;
6
+ saving: boolean;
7
+ rows: {
8
+ row: CredentialSummary;
9
+ label: string;
10
+ canWrite: boolean;
11
+ edit(): void;
12
+ remove(): void;
13
+ makeDefault(): void;
14
+ }[];
15
+ otherRows: {
16
+ row: OtherCredentialSummary;
17
+ canWrite: boolean;
18
+ token: string;
19
+ onToken({ value }: {
20
+ value: string;
21
+ }): void;
22
+ replace(): void;
23
+ remove(): void;
24
+ }[];
25
+ providers: {
26
+ provider: import("../../models.js").CredentialProvider;
27
+ canWrite: boolean;
28
+ add(): void;
29
+ }[];
30
+ categories: readonly {
31
+ value: CredentialCategory | "all";
32
+ label: string;
33
+ }[];
34
+ query: string;
35
+ category: "all" | CredentialCategory;
36
+ total: number;
37
+ matched: number;
38
+ removal: {
39
+ row: CredentialSummary | OtherCredentialSummary;
40
+ type: "access" | "other";
41
+ } | null;
42
+ draft: import("../../models.js").CredentialDraft | null;
43
+ errors: string[];
44
+ canAddCustom: boolean;
45
+ addCustom(): void;
46
+ onQuery({ value }: {
47
+ value: string;
48
+ }): void;
49
+ onCategory({ value }: {
50
+ value: string;
51
+ }): void;
52
+ reload(): void;
53
+ cancelRemove(): void;
54
+ confirmRemove(): Promise<void>;
55
+ controller: {
56
+ getSnapshot: () => Readonly<{
57
+ rows: readonly CredentialSummary[];
58
+ providers: readonly import("../../models.js").CredentialProvider[];
59
+ draft: import("../../models.js").CredentialDraft | null;
60
+ loading: boolean;
61
+ saving: boolean;
62
+ error: string | null;
63
+ errors: Readonly<Record<string, string>>;
64
+ query: string;
65
+ category: CredentialCategory | "all";
66
+ }>;
67
+ subscribe: ({ listener }: {
68
+ listener: () => void;
69
+ }) => () => void;
70
+ load: (_required: Record<string, never>, _optional?: {}) => Promise<void>;
71
+ begin: ({ row, kind, providerId }: {
72
+ row?: CredentialSummary;
73
+ kind?: import("../../models.js").CredentialKind;
74
+ providerId?: string;
75
+ }, _optional?: {}) => void;
76
+ save: (_required: Record<string, never>, _optional?: {}) => Promise<boolean>;
77
+ setDraft({ patch }: {
78
+ patch: Partial<Omit<import("../../models.js").CredentialDraft, "kind" | "id" | "providerId">>;
79
+ }, _optional?: {}): void;
80
+ cancel(_required: Record<string, never>, _optional?: {}): void;
81
+ filter({ query, category }: {
82
+ query?: string;
83
+ category?: CredentialCategory | "all";
84
+ }, _optional?: {}): void;
85
+ remove({ row }: {
86
+ row: CredentialSummary;
87
+ }, _optional?: {}): Promise<boolean>;
88
+ makeDefault({ row }: {
89
+ row: CredentialSummary;
90
+ }, _optional?: {}): Promise<boolean>;
91
+ dispose(_required?: Record<string, never>, _optional?: {}): void;
92
+ } | null;
93
+ };
94
+ //# sourceMappingURL=AccessTokensTab.hooks.d.ts.map
@@ -0,0 +1,36 @@
1
+ import { useState } from 'react';
2
+ import { useController } from '../../../react/use-controller.js';
3
+ import { createAccessTokensController } from '../../controllers/access-tokens.controller.js';
4
+ import { createOtherCredentialsController } from '../../controllers/other-credentials.controller.js';
5
+ import { CATEGORIES, credentialLabel, filterCredentials, filterOtherCredentials, otherWritePermission, writePermission } from '../../rules.js';
6
+ import { useSecurityPorts } from './SecurityPorts.hooks.js';
7
+ export function useAccessTokensTab({ permissions = [] }, _optional = {}) {
8
+ const ports = useSecurityPorts({});
9
+ const key = permissions.join('\0');
10
+ const canRead = permissions.includes('security.read');
11
+ const access = useController({ create: () => createAccessTokensController({ api: ports.securityApi, permissions }), dependencies: [ports.securityApi, key] }, { start: ({ controller }) => { void controller.load({}); } });
12
+ const other = useController({ create: () => createOtherCredentialsController({ api: ports.otherCredentials ?? { async list() { return []; }, async replace() { throw new Error('Unavailable'); }, async remove() { throw new Error('Unavailable'); } }, permissions }), dependencies: [ports.otherCredentials, key] }, { start: ({ controller }) => { void controller.load({}); } });
13
+ const [removal, setRemoval] = useState(null);
14
+ const s = access.snapshot, o = other.snapshot;
15
+ const query = s?.query ?? '', category = s?.category ?? 'all';
16
+ const rows = s ? filterCredentials({ rows: s.rows, providers: s.providers, query, category }).map(row => ({ row, label: credentialLabel({ row, providers: s.providers }), canWrite: permissions.includes(writePermission({ kind: row.kind })), edit() { access.controller?.begin({ row }); }, remove() { setRemoval({ row, type: 'access' }); }, makeDefault() { void access.controller?.makeDefault({ row }); } })) : [];
17
+ const otherRows = o ? filterOtherCredentials({ rows: o.rows, query, category }).map(row => ({ row, canWrite: permissions.includes(otherWritePermission({ store: row.store })), token: o.drafts[`${row.store}:${row.id}`] ?? '', onToken({ value }) { other.controller?.setDraft({ key: `${row.store}:${row.id}`, token: value }); }, replace() { void other.controller?.replace({ row }); }, remove() { setRemoval({ row, type: 'other' }); } })) : [];
18
+ const providers = (s?.providers ?? []).filter(p => (category === 'all' || p.category === category) && `${p.label} ${p.id}`.toLowerCase().includes(query.trim().toLowerCase())).map(provider => ({ provider, canWrite: permissions.includes(writePermission({ kind: provider.kind })), add() { access.controller?.begin({ kind: provider.kind, providerId: provider.id }); } }));
19
+ // Count remains global across categories; the search count answers how many saved tokens this host holds.
20
+ const total = (s?.rows.length ?? 0) + (o?.rows.length ?? 0);
21
+ const matched = (s ? filterCredentials({ rows: s.rows, providers: s.providers, query, category: 'all' }).length : 0) + (o ? filterOtherCredentials({ rows: o.rows, query, category: 'all' }).length : 0);
22
+ return { denied: !canRead, loading: s?.loading ?? true, saving: (s?.saving ?? false) || (o?.saving ?? false), rows, otherRows, providers, categories: CATEGORIES, query, category, total, matched, removal,
23
+ draft: s?.draft ?? null, errors: [...(s?.error ? [s.error] : []), ...Object.values(s?.errors ?? {}), ...Object.values(o?.errors ?? {})],
24
+ canAddCustom: permissions.includes('custom-credentials.write'),
25
+ addCustom() { access.controller?.begin({ kind: 'custom' }); },
26
+ onQuery({ value }) { access.controller?.filter({ query: value }); },
27
+ onCategory({ value }) { access.controller?.filter({ category: value }); },
28
+ reload() { void access.controller?.load({}); void other.controller?.load({}); },
29
+ cancelRemove() { if (!s?.saving && !o?.saving)
30
+ setRemoval(null); },
31
+ async confirmRemove() { if (!removal)
32
+ return; const ok = removal.type === 'access' ? await access.controller?.remove({ row: removal.row }) : await other.controller?.remove({ row: removal.row }); if (!ok)
33
+ throw new Error('Unable to remove credential'); setRemoval(null); },
34
+ controller: access.controller, };
35
+ }
36
+ //# sourceMappingURL=AccessTokensTab.hooks.js.map
@@ -0,0 +1,49 @@
1
+ import type { CredentialDraft, CredentialCategory } from '../../models.js';
2
+ import type { createAccessTokensController } from '../../controllers/access-tokens.controller.js';
3
+ export interface CredentialEditorProps {
4
+ readonly controller: ReturnType<typeof createAccessTokensController> | null;
5
+ readonly draft: CredentialDraft;
6
+ readonly saving: boolean;
7
+ }
8
+ export declare function useCredentialEditor({ controller, draft, saving }: CredentialEditorProps, _optional?: {}): {
9
+ categories: {
10
+ value: CredentialCategory | "all";
11
+ label: string;
12
+ }[];
13
+ fields: {
14
+ value: string;
15
+ onValueChange({ value }: {
16
+ value: string;
17
+ }): void;
18
+ name: string;
19
+ label: string;
20
+ required?: boolean;
21
+ secret?: boolean;
22
+ type?: string;
23
+ help?: string;
24
+ }[];
25
+ tokenLabel: string;
26
+ title: string;
27
+ saving: boolean;
28
+ onLabel({ value }: {
29
+ value: string;
30
+ }): void;
31
+ onToken({ value }: {
32
+ value: string;
33
+ }): void;
34
+ onUrl({ value }: {
35
+ value: string;
36
+ }): void;
37
+ onUsername({ value }: {
38
+ value: string;
39
+ }): void;
40
+ onHosts({ value }: {
41
+ value: string;
42
+ }): void;
43
+ onCategory({ value }: {
44
+ value: string;
45
+ }): void;
46
+ save(): void;
47
+ cancel(): void;
48
+ };
49
+ //# sourceMappingURL=CredentialEditor.hooks.d.ts.map
@@ -0,0 +1,14 @@
1
+ import { CATEGORIES } from '../../rules.js';
2
+ export function useCredentialEditor({ controller, draft, saving }, _optional = {}) {
3
+ const provider = controller?.getSnapshot().providers.find(p => p.kind === draft.kind && p.id === draft.providerId);
4
+ const fields = (provider?.fields ?? []).filter(f => f.name !== provider?.tokenField).map(field => ({ ...field, value: draft.values[field.name] ?? '', onValueChange({ value }) { controller?.setDraft({ patch: { values: { ...draft.values, [field.name]: value } } }); } }));
5
+ return { categories: CATEGORIES.slice(1), fields, tokenLabel: provider?.fields.find(f => f.name === provider.tokenField)?.label ?? 'Access token', title: draft.id ? 'Edit credential' : 'Add credential', saving,
6
+ onLabel({ value }) { controller?.setDraft({ patch: { label: value } }); },
7
+ onToken({ value }) { controller?.setDraft({ patch: { token: value } }); },
8
+ onUrl({ value }) { controller?.setDraft({ patch: { baseUrl: value } }); },
9
+ onUsername({ value }) { controller?.setDraft({ patch: { username: value } }); },
10
+ onHosts({ value }) { controller?.setDraft({ patch: { additionalHosts: value } }); },
11
+ onCategory({ value }) { controller?.setDraft({ patch: { category: value } }); },
12
+ save() { void controller?.save({}); }, cancel() { controller?.cancel({}); }, };
13
+ }
14
+ //# sourceMappingURL=CredentialEditor.hooks.js.map
@@ -0,0 +1,29 @@
1
+ import type { TabViewProps } from '../../../react/bind-react.js';
2
+ export declare function useRootKeyTab({ permissions, params }: TabViewProps, _optional?: {}): {
3
+ denied: boolean;
4
+ loading: boolean;
5
+ saving: boolean;
6
+ status: import("../../models.js").RootKeyStatus | null | undefined;
7
+ error: string | null | undefined;
8
+ result: string | null | undefined;
9
+ scopeNotice: string;
10
+ token: string;
11
+ confirm: string;
12
+ confirming: boolean;
13
+ preview: import("../../models.js").RootKeyPreview | null | undefined;
14
+ locked: boolean;
15
+ canGenerate: boolean;
16
+ canConfirm: boolean;
17
+ onToken({ value }: {
18
+ value: string;
19
+ }): void;
20
+ onConfirmText({ value }: {
21
+ value: string;
22
+ }): void;
23
+ generate(): void;
24
+ unlock(): void;
25
+ previewFresh(): void;
26
+ cancelFresh(): void;
27
+ confirmFresh(): Promise<void>;
28
+ };
29
+ //# sourceMappingURL=RootKeyTab.hooks.d.ts.map
@@ -0,0 +1,19 @@
1
+ import { useController } from '../../../react/use-controller.js';
2
+ import { createRootKeyController } from '../../controllers/root-key.controller.js';
3
+ import { ROOT_KEY_PERMISSION, START_FRESH_CONFIRMATION, isRootKeyLocked } from '../../rules.js';
4
+ import { useSecurityPorts } from './SecurityPorts.hooks.js';
5
+ const unavailable = { async status() { throw new Error('Unavailable'); }, async generate() { throw new Error('Unavailable'); }, async importToken() { throw new Error('Unavailable'); }, async previewStartFresh() { throw new Error('Unavailable'); }, async startFresh() { throw new Error('Unavailable'); } };
6
+ export function useRootKeyTab({ permissions = [], params }, _optional = {}) {
7
+ const { rootKey } = useSecurityPorts({});
8
+ const key = permissions.join('\0');
9
+ const { controller, snapshot: s } = useController({ create: () => createRootKeyController({ api: rootKey ?? unavailable, permissions }), dependencies: [rootKey, key] }, { start: ({ controller }) => { void controller.load({}); } });
10
+ return { denied: !rootKey || !permissions.includes(ROOT_KEY_PERMISSION), loading: s?.loading ?? true, saving: s?.saving ?? false, status: s?.status, error: s?.error, result: s?.result,
11
+ scopeNotice: typeof params.scopeNotice === 'string' ? params.scopeNotice : 'This key protects saved credentials. Keep its backup separate from the database.',
12
+ token: s?.token ?? '', confirm: s?.confirm ?? '', confirming: s?.confirming ?? false, preview: s?.preview,
13
+ locked: isRootKeyLocked({ status: s?.status ?? null }), canGenerate: s?.status?.state === 'missing' && !s.status.active, canConfirm: !!s?.preview && s.confirm === START_FRESH_CONFIRMATION,
14
+ onToken({ value }) { controller?.setToken({ value }); }, onConfirmText({ value }) { controller?.setConfirm({ value }); },
15
+ generate() { void controller?.generate({}); }, unlock() { void controller?.importToken({}); }, previewFresh() { void controller?.preview({}); },
16
+ cancelFresh() { controller?.cancel({}); }, async confirmFresh() { if (!await controller?.startFresh({}))
17
+ throw new Error('Recovery was not completed'); }, };
18
+ }
19
+ //# sourceMappingURL=RootKeyTab.hooks.js.map
@@ -0,0 +1,17 @@
1
+ import type { ModulePageProps } from '../../../react/bind-react.js';
2
+ export declare function useSecurityPage(props: ModulePageProps, _optional?: {}): {
3
+ denied: boolean;
4
+ active: string;
5
+ ActiveTab: import("react").LazyExoticComponent<import("react").ComponentType<import("../../../react/bind-react.js").TabViewProps>> | undefined;
6
+ params: Readonly<Record<string, unknown>>;
7
+ permissions: readonly string[];
8
+ items: {
9
+ id: string;
10
+ label: string;
11
+ content: null;
12
+ }[];
13
+ onValueChange({ value }: {
14
+ value: string;
15
+ }): void;
16
+ };
17
+ //# sourceMappingURL=SecurityPage.hooks.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { useState } from 'react';
2
+ export function useSecurityPage(props, _optional = {}) {
3
+ const [local, setLocal] = useState('access-tokens');
4
+ const visible = props.description.visible ? props.description.tabs.filter(t => t.visible) : [];
5
+ const active = visible.find(t => t.id.endsWith(`.${props.requestedTab ?? local}`)) ?? visible[0];
6
+ const id = active?.id.split('.').at(-1);
7
+ return { denied: !props.description.visible, active: id ?? '', ActiveTab: id ? props.tabs[id] : undefined, params: active?.params ?? {}, permissions: props.description.grants,
8
+ items: visible.map(t => ({ id: t.id.split('.').at(-1), label: t.label, content: null })),
9
+ onValueChange({ value }) { setLocal(value); props.onTabChange?.({ tab: value }); },
10
+ };
11
+ }
12
+ //# sourceMappingURL=SecurityPage.hooks.js.map
@@ -0,0 +1,9 @@
1
+ import type { SecurityApiPort, OtherCredentialsPort, RootKeyPort } from '../../ports.js';
2
+ export interface SecurityPorts {
3
+ readonly securityApi: SecurityApiPort;
4
+ readonly otherCredentials?: OtherCredentialsPort;
5
+ readonly rootKey?: RootKeyPort;
6
+ }
7
+ export declare const SecurityPortsContext: import("react").Context<SecurityPorts | null>;
8
+ export declare function useSecurityPorts(_required?: Record<string, never>, _optional?: {}): SecurityPorts;
9
+ //# sourceMappingURL=SecurityPorts.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 SecurityPortsContext = createContext(null);
4
+ export function useSecurityPorts(_required = {}, _optional = {}) { const ports = useContext(SecurityPortsContext); if (!ports)
5
+ throw new AdminConfigError({ issues: ['React scope unavailable: security'] }); return ports; }
6
+ //# sourceMappingURL=SecurityPorts.hooks.js.map