@burdenoff/microfe-botmanor 2026.1108.1 → 2026.1109.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 (334) hide show
  1. package/dist/botlit/BotlitRoutes.d.ts +2 -0
  2. package/dist/botlit/BotlitRoutes.js +24 -25
  3. package/dist/botlit/BotlitRoutes.js.map +1 -1
  4. package/dist/botlit/BotmanorRoot.d.ts +3 -0
  5. package/dist/botlit/BotmanorRoot.js +1 -2
  6. package/dist/botlit/BotmanorRoot.js.map +1 -1
  7. package/dist/botlit/BotmanorRootInner.d.ts +3 -0
  8. package/dist/botlit/BotmanorRootInner.js +9 -10
  9. package/dist/botlit/BotmanorRootInner.js.map +1 -1
  10. package/dist/botlit/components/AgentApprovalPanel.d.ts +20 -0
  11. package/dist/botlit/components/AgentApprovalPanel.js +49 -50
  12. package/dist/botlit/components/AgentApprovalPanel.js.map +1 -1
  13. package/dist/botlit/components/AiOperationsPanel.d.ts +14 -0
  14. package/dist/botlit/components/AiOperationsPanel.js +54 -55
  15. package/dist/botlit/components/AiOperationsPanel.js.map +1 -1
  16. package/dist/botlit/components/AssistantChannelPanel.d.ts +3 -0
  17. package/dist/botlit/components/AssistantChannelPanel.js +12 -13
  18. package/dist/botlit/components/AssistantChannelPanel.js.map +1 -1
  19. package/dist/botlit/components/AssistantRuntimeSetupPanel.d.ts +4 -0
  20. package/dist/botlit/components/AssistantRuntimeSetupPanel.js +14 -14
  21. package/dist/botlit/components/AssistantRuntimeSetupPanel.js.map +1 -1
  22. package/dist/botlit/components/AssistantWebsitePanel.d.ts +5 -0
  23. package/dist/botlit/components/AssistantWebsitePanel.js +15 -16
  24. package/dist/botlit/components/AssistantWebsitePanel.js.map +1 -1
  25. package/dist/botlit/components/Badge.d.ts +9 -0
  26. package/dist/botlit/components/Badge.js +1 -2
  27. package/dist/botlit/components/Badge.js.map +1 -1
  28. package/dist/botlit/components/Button.d.ts +10 -0
  29. package/dist/botlit/components/Button.js +1 -2
  30. package/dist/botlit/components/Button.js.map +1 -1
  31. package/dist/botlit/components/Card.d.ts +16 -0
  32. package/dist/botlit/components/Card.js +1 -2
  33. package/dist/botlit/components/Card.js.map +1 -1
  34. package/dist/botlit/components/ChannelSelectorSheet.d.ts +23 -0
  35. package/dist/botlit/components/ChannelSelectorSheet.js +1 -2
  36. package/dist/botlit/components/ChannelSelectorSheet.js.map +1 -1
  37. package/dist/botlit/components/EmptyState.d.ts +12 -0
  38. package/dist/botlit/components/EmptyState.js +1 -2
  39. package/dist/botlit/components/EmptyState.js.map +1 -1
  40. package/dist/botlit/components/ErrorState.d.ts +10 -0
  41. package/dist/botlit/components/ErrorState.js +5 -6
  42. package/dist/botlit/components/ErrorState.js.map +1 -1
  43. package/dist/botlit/components/Input.d.ts +27 -0
  44. package/dist/botlit/components/Input.js +1 -2
  45. package/dist/botlit/components/Input.js.map +1 -1
  46. package/dist/botlit/components/KnowledgeSourceImportPanel.d.ts +3 -0
  47. package/dist/botlit/components/KnowledgeSourceImportPanel.js +12 -13
  48. package/dist/botlit/components/KnowledgeSourceImportPanel.js.map +1 -1
  49. package/dist/botlit/components/ModelRegistrationPanel.d.ts +5 -0
  50. package/dist/botlit/components/ModelRegistrationPanel.js +1 -2
  51. package/dist/botlit/components/ModelRegistrationPanel.js.map +1 -1
  52. package/dist/botlit/components/PageLayout.d.ts +12 -0
  53. package/dist/botlit/components/PageLayout.js +1 -2
  54. package/dist/botlit/components/PageLayout.js.map +1 -1
  55. package/dist/botlit/components/QuotaExhaustedDialog.d.ts +9 -0
  56. package/dist/botlit/components/QuotaExhaustedDialog.js +1 -2
  57. package/dist/botlit/components/QuotaExhaustedDialog.js.map +1 -1
  58. package/dist/botlit/components/RetentionStatusPanel.d.ts +2 -0
  59. package/dist/botlit/components/RetentionStatusPanel.js +18 -19
  60. package/dist/botlit/components/RetentionStatusPanel.js.map +1 -1
  61. package/dist/botlit/components/RouteLoader.d.ts +23 -0
  62. package/dist/botlit/components/RouteLoader.js +1 -2
  63. package/dist/botlit/components/RouteLoader.js.map +1 -1
  64. package/dist/botlit/components/VersionHistoryPanel.d.ts +12 -0
  65. package/dist/botlit/components/VersionHistoryPanel.js +23 -24
  66. package/dist/botlit/components/VersionHistoryPanel.js.map +1 -1
  67. package/dist/botlit/components/WorkspaceRequired.d.ts +18 -0
  68. package/dist/botlit/components/WorkspaceRequired.js +1 -2
  69. package/dist/botlit/components/WorkspaceRequired.js.map +1 -1
  70. package/dist/botlit/components/index.d.ts +14 -0
  71. package/dist/botlit/hooks/index.d.ts +36 -0
  72. package/dist/botlit/hooks/index.js +15 -14
  73. package/dist/botlit/hooks/internal/mutationInput.d.ts +56 -0
  74. package/dist/botlit/hooks/internal/mutationInput.js +1 -2
  75. package/dist/botlit/hooks/internal/mutationInput.js.map +1 -1
  76. package/dist/botlit/hooks/internal/workspaceGateway.d.ts +54 -0
  77. package/dist/botlit/hooks/internal/workspaceGateway.js +17 -19
  78. package/dist/botlit/hooks/internal/workspaceGateway.js.map +1 -1
  79. package/dist/botlit/hooks/useA2A.d.ts +104 -0
  80. package/dist/botlit/hooks/useA2A.js +45 -45
  81. package/dist/botlit/hooks/useA2A.js.map +1 -1
  82. package/dist/botlit/hooks/useAgentApprovals.d.ts +62 -0
  83. package/dist/botlit/hooks/useAgentApprovals.js +38 -39
  84. package/dist/botlit/hooks/useAgentApprovals.js.map +1 -1
  85. package/dist/botlit/hooks/useAgents.d.ts +105 -0
  86. package/dist/botlit/hooks/useAgents.js +53 -54
  87. package/dist/botlit/hooks/useAgents.js.map +1 -1
  88. package/dist/botlit/hooks/useAiOperations.d.ts +95 -0
  89. package/dist/botlit/hooks/useAiOperations.js +20 -19
  90. package/dist/botlit/hooks/useAiOperations.js.map +1 -1
  91. package/dist/botlit/hooks/useAssistantChannels.d.ts +16 -0
  92. package/dist/botlit/hooks/useAssistantChannels.js +1 -2
  93. package/dist/botlit/hooks/useAssistantChannels.js.map +1 -1
  94. package/dist/botlit/hooks/useAssistantRuntimeSetup.d.ts +17 -0
  95. package/dist/botlit/hooks/useAssistantRuntimeSetup.js +1 -2
  96. package/dist/botlit/hooks/useAssistantRuntimeSetup.js.map +1 -1
  97. package/dist/botlit/hooks/useAssistantWebsites.d.ts +18 -0
  98. package/dist/botlit/hooks/useAssistantWebsites.js +1 -2
  99. package/dist/botlit/hooks/useAssistantWebsites.js.map +1 -1
  100. package/dist/botlit/hooks/useBotWorkflow.d.ts +22 -0
  101. package/dist/botlit/hooks/useBotWorkflow.js +1 -2
  102. package/dist/botlit/hooks/useBotWorkflow.js.map +1 -1
  103. package/dist/botlit/hooks/useBots.d.ts +68 -0
  104. package/dist/botlit/hooks/useBots.js +32 -33
  105. package/dist/botlit/hooks/useBots.js.map +1 -1
  106. package/dist/botlit/hooks/useBuckets.d.ts +57 -0
  107. package/dist/botlit/hooks/useBuckets.js +38 -39
  108. package/dist/botlit/hooks/useBuckets.js.map +1 -1
  109. package/dist/botlit/hooks/useChannels.d.ts +87 -0
  110. package/dist/botlit/hooks/useChannels.js +73 -73
  111. package/dist/botlit/hooks/useChannels.js.map +1 -1
  112. package/dist/botlit/hooks/useConversations.d.ts +42 -0
  113. package/dist/botlit/hooks/useConversations.js +1 -2
  114. package/dist/botlit/hooks/useConversations.js.map +1 -1
  115. package/dist/botlit/hooks/useExecutions.d.ts +87 -0
  116. package/dist/botlit/hooks/useExecutions.js +37 -37
  117. package/dist/botlit/hooks/useExecutions.js.map +1 -1
  118. package/dist/botlit/hooks/useKnowledgeBases.d.ts +79 -0
  119. package/dist/botlit/hooks/useKnowledgeBases.js +40 -39
  120. package/dist/botlit/hooks/useKnowledgeBases.js.map +1 -1
  121. package/dist/botlit/hooks/useKnowledgeSourceImports.d.ts +21 -0
  122. package/dist/botlit/hooks/useKnowledgeSourceImports.js +1 -2
  123. package/dist/botlit/hooks/useKnowledgeSourceImports.js.map +1 -1
  124. package/dist/botlit/hooks/useLLMProviders.d.ts +66 -0
  125. package/dist/botlit/hooks/useLLMProviders.js +25 -26
  126. package/dist/botlit/hooks/useLLMProviders.js.map +1 -1
  127. package/dist/botlit/hooks/useMCPServers.d.ts +71 -0
  128. package/dist/botlit/hooks/useMCPServers.js +40 -38
  129. package/dist/botlit/hooks/useMCPServers.js.map +1 -1
  130. package/dist/botlit/hooks/usePolicies.d.ts +60 -0
  131. package/dist/botlit/hooks/usePolicies.js +49 -49
  132. package/dist/botlit/hooks/usePolicies.js.map +1 -1
  133. package/dist/botlit/hooks/usePromptTemplates.d.ts +88 -0
  134. package/dist/botlit/hooks/usePromptTemplates.js +57 -57
  135. package/dist/botlit/hooks/usePromptTemplates.js.map +1 -1
  136. package/dist/botlit/hooks/useRetention.d.ts +26 -0
  137. package/dist/botlit/hooks/useRetention.js +3 -3
  138. package/dist/botlit/hooks/useRetention.js.map +1 -1
  139. package/dist/botlit/hooks/useRetrievalProfiles.d.ts +75 -0
  140. package/dist/botlit/hooks/useRetrievalProfiles.js +47 -47
  141. package/dist/botlit/hooks/useRetrievalProfiles.js.map +1 -1
  142. package/dist/botlit/hooks/useSkills.d.ts +64 -0
  143. package/dist/botlit/hooks/useSkills.js +53 -53
  144. package/dist/botlit/hooks/useSkills.js.map +1 -1
  145. package/dist/botlit/hooks/useStore.d.ts +112 -0
  146. package/dist/botlit/hooks/useStore.js +55 -55
  147. package/dist/botlit/hooks/useStore.js.map +1 -1
  148. package/dist/botlit/hooks/useUserPlatformConnection.d.ts +80 -0
  149. package/dist/botlit/hooks/useUserPlatformConnection.js +19 -19
  150. package/dist/botlit/hooks/useUserPlatformConnection.js.map +1 -1
  151. package/dist/botlit/index.d.ts +16 -0
  152. package/dist/botlit/index.js +12 -11
  153. package/dist/botlit/pages/A2AAgentDetailPage.d.ts +6 -0
  154. package/dist/botlit/pages/A2AAgentDetailPage.js +171 -178
  155. package/dist/botlit/pages/A2AAgentDetailPage.js.map +1 -1
  156. package/dist/botlit/pages/A2ARegistryPage.d.ts +2 -0
  157. package/dist/botlit/pages/A2ARegistryPage.js +25 -26
  158. package/dist/botlit/pages/A2ARegistryPage.js.map +1 -1
  159. package/dist/botlit/pages/AgentApprovalsPage.d.ts +2 -0
  160. package/dist/botlit/pages/AgentApprovalsPage.js +32 -33
  161. package/dist/botlit/pages/AgentApprovalsPage.js.map +1 -1
  162. package/dist/botlit/pages/AgentBuilderPage.d.ts +2 -0
  163. package/dist/botlit/pages/AgentBuilderPage.js +59 -60
  164. package/dist/botlit/pages/AgentBuilderPage.js.map +1 -1
  165. package/dist/botlit/pages/AgentDetailPage.d.ts +2 -0
  166. package/dist/botlit/pages/AgentDetailPage.js +83 -84
  167. package/dist/botlit/pages/AgentDetailPage.js.map +1 -1
  168. package/dist/botlit/pages/AgentsListPage.d.ts +2 -0
  169. package/dist/botlit/pages/AgentsListPage.js +71 -72
  170. package/dist/botlit/pages/AgentsListPage.js.map +1 -1
  171. package/dist/botlit/pages/AiOperationsPage.d.ts +2 -0
  172. package/dist/botlit/pages/AiOperationsPage.js +52 -53
  173. package/dist/botlit/pages/AiOperationsPage.js.map +1 -1
  174. package/dist/botlit/pages/BotChannelsTab.d.ts +7 -0
  175. package/dist/botlit/pages/BotChannelsTab.js +120 -122
  176. package/dist/botlit/pages/BotChannelsTab.js.map +1 -1
  177. package/dist/botlit/pages/BotDetailPage.d.ts +7 -0
  178. package/dist/botlit/pages/BotDetailPage.js +353 -358
  179. package/dist/botlit/pages/BotDetailPage.js.map +1 -1
  180. package/dist/botlit/pages/BotWorkflowTab.d.ts +11 -0
  181. package/dist/botlit/pages/BotWorkflowTab.js +20 -21
  182. package/dist/botlit/pages/BotWorkflowTab.js.map +1 -1
  183. package/dist/botlit/pages/BotsListPage.d.ts +2 -0
  184. package/dist/botlit/pages/BotsListPage.js +52 -53
  185. package/dist/botlit/pages/BotsListPage.js.map +1 -1
  186. package/dist/botlit/pages/BucketsPage.d.ts +2 -0
  187. package/dist/botlit/pages/BucketsPage.js +260 -261
  188. package/dist/botlit/pages/BucketsPage.js.map +1 -1
  189. package/dist/botlit/pages/ChannelDetailPage.d.ts +6 -0
  190. package/dist/botlit/pages/ChannelDetailPage.js +97 -96
  191. package/dist/botlit/pages/ChannelDetailPage.js.map +1 -1
  192. package/dist/botlit/pages/ChannelRoutesPage.d.ts +2 -0
  193. package/dist/botlit/pages/ChannelRoutesPage.js +23 -24
  194. package/dist/botlit/pages/ChannelRoutesPage.js.map +1 -1
  195. package/dist/botlit/pages/ChannelsPage.d.ts +2 -0
  196. package/dist/botlit/pages/ChannelsPage.js +44 -45
  197. package/dist/botlit/pages/ChannelsPage.js.map +1 -1
  198. package/dist/botlit/pages/ChatPage.d.ts +1 -0
  199. package/dist/botlit/pages/ChatPage.js +10 -11
  200. package/dist/botlit/pages/ChatPage.js.map +1 -1
  201. package/dist/botlit/pages/ConversationDetailPage.d.ts +2 -0
  202. package/dist/botlit/pages/ConversationsPage.d.ts +2 -0
  203. package/dist/botlit/pages/DashboardPage.d.ts +2 -0
  204. package/dist/botlit/pages/DashboardPage.js +37 -38
  205. package/dist/botlit/pages/DashboardPage.js.map +1 -1
  206. package/dist/botlit/pages/ExecutionDetailPage.d.ts +2 -0
  207. package/dist/botlit/pages/ExecutionDetailPage.js +47 -48
  208. package/dist/botlit/pages/ExecutionDetailPage.js.map +1 -1
  209. package/dist/botlit/pages/ExecutionsPage.d.ts +2 -0
  210. package/dist/botlit/pages/ExecutionsPage.js +72 -70
  211. package/dist/botlit/pages/ExecutionsPage.js.map +1 -1
  212. package/dist/botlit/pages/InstalledPackagesPage.d.ts +2 -0
  213. package/dist/botlit/pages/InstalledPackagesPage.js +77 -78
  214. package/dist/botlit/pages/InstalledPackagesPage.js.map +1 -1
  215. package/dist/botlit/pages/KnowledgeBaseDetailPage.d.ts +6 -0
  216. package/dist/botlit/pages/KnowledgeBaseDetailPage.js +171 -181
  217. package/dist/botlit/pages/KnowledgeBaseDetailPage.js.map +1 -1
  218. package/dist/botlit/pages/KnowledgeBasesPage.d.ts +2 -0
  219. package/dist/botlit/pages/KnowledgeBasesPage.js +30 -31
  220. package/dist/botlit/pages/KnowledgeBasesPage.js.map +1 -1
  221. package/dist/botlit/pages/MCPServerDetailPage.d.ts +6 -0
  222. package/dist/botlit/pages/MCPServerDetailPage.js +82 -83
  223. package/dist/botlit/pages/MCPServerDetailPage.js.map +1 -1
  224. package/dist/botlit/pages/MCPServersPage.d.ts +2 -0
  225. package/dist/botlit/pages/MCPServersPage.js +54 -55
  226. package/dist/botlit/pages/MCPServersPage.js.map +1 -1
  227. package/dist/botlit/pages/PoliciesPage.d.ts +2 -0
  228. package/dist/botlit/pages/PoliciesPage.js +25 -26
  229. package/dist/botlit/pages/PoliciesPage.js.map +1 -1
  230. package/dist/botlit/pages/PolicyDetailPage.d.ts +6 -0
  231. package/dist/botlit/pages/PolicyDetailPage.js +257 -259
  232. package/dist/botlit/pages/PolicyDetailPage.js.map +1 -1
  233. package/dist/botlit/pages/PromptStudioPage.d.ts +2 -0
  234. package/dist/botlit/pages/PromptStudioPage.js +35 -35
  235. package/dist/botlit/pages/PromptStudioPage.js.map +1 -1
  236. package/dist/botlit/pages/PromptTemplateDetailPage.d.ts +6 -0
  237. package/dist/botlit/pages/PromptTemplateDetailPage.js +363 -362
  238. package/dist/botlit/pages/PromptTemplateDetailPage.js.map +1 -1
  239. package/dist/botlit/pages/PromptTemplatesPage.d.ts +2 -0
  240. package/dist/botlit/pages/PromptTemplatesPage.js +26 -27
  241. package/dist/botlit/pages/PromptTemplatesPage.js.map +1 -1
  242. package/dist/botlit/pages/RetrievalProfileDetailPage.d.ts +6 -0
  243. package/dist/botlit/pages/RetrievalProfileDetailPage.js +150 -158
  244. package/dist/botlit/pages/RetrievalProfileDetailPage.js.map +1 -1
  245. package/dist/botlit/pages/RetrievalProfilesPage.d.ts +2 -0
  246. package/dist/botlit/pages/RetrievalProfilesPage.js +24 -25
  247. package/dist/botlit/pages/RetrievalProfilesPage.js.map +1 -1
  248. package/dist/botlit/pages/SettingsPage.d.ts +2 -0
  249. package/dist/botlit/pages/SettingsPage.js +124 -125
  250. package/dist/botlit/pages/SettingsPage.js.map +1 -1
  251. package/dist/botlit/pages/SkillDetailPage.d.ts +6 -0
  252. package/dist/botlit/pages/SkillDetailPage.js +216 -217
  253. package/dist/botlit/pages/SkillDetailPage.js.map +1 -1
  254. package/dist/botlit/pages/SkillsPage.d.ts +2 -0
  255. package/dist/botlit/pages/SkillsPage.js +24 -25
  256. package/dist/botlit/pages/SkillsPage.js.map +1 -1
  257. package/dist/botlit/pages/StorePackageDetailPage.d.ts +2 -0
  258. package/dist/botlit/pages/StorePackageDetailPage.js +38 -39
  259. package/dist/botlit/pages/StorePackageDetailPage.js.map +1 -1
  260. package/dist/botlit/pages/StorePage.d.ts +2 -0
  261. package/dist/botlit/pages/StorePage.js +135 -136
  262. package/dist/botlit/pages/StorePage.js.map +1 -1
  263. package/dist/botlit/pages/index.d.ts +39 -0
  264. package/dist/botlit/permissions/PermissionRequired.d.ts +20 -0
  265. package/dist/botlit/permissions/PermissionRequired.js +10 -11
  266. package/dist/botlit/permissions/PermissionRequired.js.map +1 -1
  267. package/dist/botlit/permissions/botmanorPermissions.d.ts +82 -0
  268. package/dist/botlit/permissions/botmanorPermissions.js +1 -2
  269. package/dist/botlit/permissions/botmanorPermissions.js.map +1 -1
  270. package/dist/botlit/permissions/index.d.ts +7 -0
  271. package/dist/botlit/permissions/index.js +4 -3
  272. package/dist/botlit/permissions/useBotmanorPermissions.d.ts +41 -0
  273. package/dist/botlit/permissions/useBotmanorPermissions.js +1 -2
  274. package/dist/botlit/permissions/useBotmanorPermissions.js.map +1 -1
  275. package/dist/botlit/providers/BotlitProvider.d.ts +14 -0
  276. package/dist/botlit/providers/BotlitProvider.js +3 -3
  277. package/dist/botlit/providers/BotlitProvider.js.map +1 -1
  278. package/dist/botlit/store/botlitStore.d.ts +85 -0
  279. package/dist/botlit/store/botlitStore.js +1 -2
  280. package/dist/botlit/store/botlitStore.js.map +1 -1
  281. package/dist/botlit/store/renamedKeyStorage.d.ts +13 -0
  282. package/dist/botlit/store/renamedKeyStorage.js +1 -2
  283. package/dist/botlit/store/renamedKeyStorage.js.map +1 -1
  284. package/dist/botlit/types/index.d.ts +1008 -0
  285. package/dist/botlit/utils/cn.d.ts +2 -0
  286. package/dist/botlit/utils/cn.js +1 -2
  287. package/dist/botlit/utils/cn.js.map +1 -1
  288. package/dist/botlit/utils/embedding-models.d.ts +9 -0
  289. package/dist/botlit/utils/embedding-models.js +1 -2
  290. package/dist/botlit/utils/embedding-models.js.map +1 -1
  291. package/dist/botlit/utils/errors.d.ts +19 -0
  292. package/dist/botlit/utils/errors.js +1 -2
  293. package/dist/botlit/utils/errors.js.map +1 -1
  294. package/dist/botlit/utils/formatters.d.ts +38 -0
  295. package/dist/botlit/utils/formatters.js +0 -1
  296. package/dist/botlit/utils/formatters.js.map +1 -1
  297. package/dist/botlit/utils/navigation.d.ts +19 -0
  298. package/dist/botlit/utils/navigation.js +1 -2
  299. package/dist/botlit/utils/navigation.js.map +1 -1
  300. package/dist/botlit/utils/policyConfig.d.ts +68 -0
  301. package/dist/botlit/utils/policyConfig.js +2 -3
  302. package/dist/botlit/utils/policyConfig.js.map +1 -1
  303. package/dist/botlit/utils/unions.d.ts +25 -0
  304. package/dist/botlit/utils/unions.js +1 -2
  305. package/dist/botlit/utils/unions.js.map +1 -1
  306. package/dist/dev/App.d.ts +2 -0
  307. package/dist/dev/main.d.ts +0 -0
  308. package/dist/generated/global-operations.d.ts +197 -0
  309. package/dist/generated/global-operations.js +1 -2
  310. package/dist/generated/global-operations.js.map +1 -1
  311. package/dist/generated/global-types.d.ts +27678 -0
  312. package/dist/generated/global-types.js +1 -2
  313. package/dist/generated/global-types.js.map +1 -1
  314. package/dist/generated/wspace-operations.d.ts +5489 -0
  315. package/dist/generated/wspace-operations.js +64 -60
  316. package/dist/generated/wspace-operations.js.map +1 -1
  317. package/dist/generated/wspace-types.d.ts +152017 -0
  318. package/dist/generated/wspace-types.js +1 -2
  319. package/dist/generated/wspace-types.js.map +1 -1
  320. package/dist/index.d.ts +5 -0
  321. package/dist/shared/hooks/useTr.d.ts +16 -0
  322. package/dist/shared/hooks/useTr.js +1 -2
  323. package/dist/shared/hooks/useTr.js.map +1 -1
  324. package/dist/stories/Badge.stories.d.ts +11 -0
  325. package/dist/stories/Button.stories.d.ts +13 -0
  326. package/dist/stories/EmptyState.stories.d.ts +8 -0
  327. package/dist/stories/StatusBadge.stories.d.ts +9 -0
  328. package/dist/test/fixtures.d.ts +39 -0
  329. package/dist/test/happydom.d.ts +1 -0
  330. package/dist/test/renderPage.d.ts +18 -0
  331. package/dist/test/setup.d.ts +9 -0
  332. package/dist/utils/nativeBridge.d.ts +2 -0
  333. package/dist/utils/nativeBridge.js +1 -2
  334. package/package.json +87 -60
@@ -0,0 +1,20 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { BotmanorPermission } from './botmanorPermissions';
3
+ export interface PermissionRequiredStateProps {
4
+ /** Page title, e.g. "Create Policy". */
5
+ title: string;
6
+ /** Where "Back" goes, relative to the BotManor mount (e.g. `policies`). */
7
+ backTo: string;
8
+ /** Label for the back link, e.g. "Back to policies". */
9
+ backLabel: string;
10
+ }
11
+ export declare const PermissionRequiredState: FC<PermissionRequiredStateProps>;
12
+ export interface RequirePermissionProps extends PermissionRequiredStateProps {
13
+ permission: BotmanorPermission;
14
+ children: ReactNode;
15
+ }
16
+ /**
17
+ * Render a create page only for members who may create; everyone else gets the
18
+ * permission-required state. Nothing renders while permissions load.
19
+ */
20
+ export declare const RequirePermission: FC<RequirePermissionProps>;
@@ -1,15 +1,15 @@
1
1
  import { useTr as e } from "../../shared/hooks/useTr.js";
2
2
  import { useBotlit as t } from "../providers/BotlitProvider.js";
3
- import { BotmanorPermissionGate as n } from "./useBotmanorPermissions.js";
4
- import { PageLayout as r } from "../components/PageLayout.js";
5
- import { Button as i } from "../components/Button.js";
3
+ import { PageLayout as n } from "../components/PageLayout.js";
4
+ import { Button as r } from "../components/Button.js";
5
+ import { BotmanorPermissionGate as i } from "./useBotmanorPermissions.js";
6
6
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
7
  import { Lock as s } from "lucide-react";
8
- //#region src/botlit/permissions/PermissionRequired.tsx
9
- var c = ({ title: n, backTo: c, backLabel: l }) => {
8
+ // src/botlit/permissions/PermissionRequired.tsx
9
+ var c = ({ title: i, backTo: c, backLabel: l }) => {
10
10
  let u = e(), { navigateTo: d } = t();
11
- return /* @__PURE__ */ a(r, {
12
- title: n,
11
+ return /* @__PURE__ */ a(n, {
12
+ title: i,
13
13
  children: /* @__PURE__ */ o("div", {
14
14
  role: "status",
15
15
  className: "flex flex-col items-center justify-center gap-3 rounded-lg border border-border-subtle bg-bg-surface px-4 py-12 text-center",
@@ -25,7 +25,7 @@ var c = ({ title: n, backTo: c, backLabel: l }) => {
25
25
  className: "mt-2 max-w-md text-sm text-text-secondary",
26
26
  children: u("permissions.required.description", "Your role in this workspace can view BotManor resources but not change them. Ask a workspace admin for edit access.")
27
27
  })] }),
28
- /* @__PURE__ */ a(i, {
28
+ /* @__PURE__ */ a(r, {
29
29
  variant: "outline",
30
30
  size: "sm",
31
31
  onClick: () => d(c),
@@ -34,12 +34,11 @@ var c = ({ title: n, backTo: c, backLabel: l }) => {
34
34
  ]
35
35
  })
36
36
  });
37
- }, l = ({ permission: e, children: t, ...r }) => /* @__PURE__ */ a(n, {
37
+ }, l = ({ permission: e, children: t, ...n }) => /* @__PURE__ */ a(i, {
38
38
  permission: e,
39
- fallback: /* @__PURE__ */ a(c, { ...r }),
39
+ fallback: /* @__PURE__ */ a(c, { ...n }),
40
40
  children: t
41
41
  });
42
- //#endregion
43
42
  export { c as PermissionRequiredState, l as RequirePermission };
44
43
 
45
44
  //# sourceMappingURL=PermissionRequired.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PermissionRequired.js","names":[],"sources":["../../../src/botlit/permissions/PermissionRequired.tsx"],"sourcesContent":["/**\n * Permission-required state\n * @module botlit/permissions\n *\n * Shown in place of a create form when a member opens a `/new` route (from a\n * bookmark or a pasted link) without the permission to create that resource.\n * The member still sees where they are and how to get back; they are not shown\n * a form whose submit the gateway would refuse.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { Lock } from 'lucide-react';\n\nimport { useTr } from '../../shared/hooks/useTr';\nimport { useBotlit } from '../providers/BotlitProvider';\nimport { PageLayout } from '../components/PageLayout';\nimport { Button } from '../components/Button';\nimport type { BotmanorPermission } from './botmanorPermissions';\nimport { BotmanorPermissionGate } from './useBotmanorPermissions';\n\nexport interface PermissionRequiredStateProps {\n /** Page title, e.g. \"Create Policy\". */\n title: string;\n /** Where \"Back\" goes, relative to the BotManor mount (e.g. `policies`). */\n backTo: string;\n /** Label for the back link, e.g. \"Back to policies\". */\n backLabel: string;\n}\n\nexport const PermissionRequiredState: FC<PermissionRequiredStateProps> = ({\n title,\n backTo,\n backLabel,\n}) => {\n const t = useTr();\n const { navigateTo } = useBotlit();\n return (\n <PageLayout title={title}>\n <div\n role=\"status\"\n className=\"flex flex-col items-center justify-center gap-3 rounded-lg border border-border-subtle bg-bg-surface px-4 py-12 text-center\"\n >\n <Lock size={28} className=\"text-text-secondary\" />\n <div>\n <h2 className=\"text-lg font-medium text-text-primary\">\n {t('permissions.required.title', 'You do not have access to this action')}\n </h2>\n <p className=\"mt-2 max-w-md text-sm text-text-secondary\">\n {t(\n 'permissions.required.description',\n 'Your role in this workspace can view BotManor resources but not change them. Ask a workspace admin for edit access.'\n )}\n </p>\n </div>\n <Button variant=\"outline\" size=\"sm\" onClick={() => navigateTo(backTo)}>\n {backLabel}\n </Button>\n </div>\n </PageLayout>\n );\n};\n\nexport interface RequirePermissionProps extends PermissionRequiredStateProps {\n permission: BotmanorPermission;\n children: ReactNode;\n}\n\n/**\n * Render a create page only for members who may create; everyone else gets the\n * permission-required state. Nothing renders while permissions load.\n */\nexport const RequirePermission: FC<RequirePermissionProps> = ({\n permission,\n children,\n ...state\n}) => (\n <BotmanorPermissionGate permission={permission} fallback={<PermissionRequiredState {...state} />}>\n {children}\n </BotmanorPermissionGate>\n);\n"],"mappings":";;;;;;;;AA6BA,IAAa,KAA6D,EACxE,UACA,WACA,mBACI;CACJ,IAAM,IAAI,GAAO,EACX,EAAE,kBAAe,GAAW;AAClC,QACE,kBAAC,GAAD;EAAmB;YACjB,kBAAC,OAAD;GACE,MAAK;GACL,WAAU;aAFZ;IAIE,kBAAC,GAAD;KAAM,MAAM;KAAI,WAAU;KAAwB,CAAA;IAClD,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;KAAI,WAAU;eACX,EAAE,8BAA8B,wCAAwC;KACtE,CAAA,EACL,kBAAC,KAAD;KAAG,WAAU;eACV,EACC,oCACA,sHACD;KACC,CAAA,CACA,EAAA,CAAA;IACN,kBAAC,GAAD;KAAQ,SAAQ;KAAU,MAAK;KAAK,eAAe,EAAW,EAAO;eAClE;KACM,CAAA;IACL;;EACK,CAAA;GAaJ,KAAiD,EAC5D,eACA,aACA,GAAG,QAEH,kBAAC,GAAD;CAAoC;CAAY,UAAU,kBAAC,GAAD,EAAyB,GAAI,GAAS,CAAA;CAC7F;CACsB,CAAA"}
1
+ {"version":3,"file":"PermissionRequired.js","names":["PermissionRequiredState","t","useTr","useBotlit","PageLayout","Lock","Button","navigateTo","backTo","backLabel","RequirePermission","state","BotmanorPermissionGate"],"sources":["../../../src/botlit/permissions/PermissionRequired.tsx"],"sourcesContent":["/**\n * Permission-required state\n * @module botlit/permissions\n *\n * Shown in place of a create form when a member opens a `/new` route (from a\n * bookmark or a pasted link) without the permission to create that resource.\n * The member still sees where they are and how to get back; they are not shown\n * a form whose submit the gateway would refuse.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { Lock } from 'lucide-react';\n\nimport { useTr } from '../../shared/hooks/useTr';\nimport { useBotlit } from '../providers/BotlitProvider';\nimport { PageLayout } from '../components/PageLayout';\nimport { Button } from '../components/Button';\nimport type { BotmanorPermission } from './botmanorPermissions';\nimport { BotmanorPermissionGate } from './useBotmanorPermissions';\n\nexport interface PermissionRequiredStateProps {\n /** Page title, e.g. \"Create Policy\". */\n title: string;\n /** Where \"Back\" goes, relative to the BotManor mount (e.g. `policies`). */\n backTo: string;\n /** Label for the back link, e.g. \"Back to policies\". */\n backLabel: string;\n}\n\nexport const PermissionRequiredState: FC<PermissionRequiredStateProps> = ({\n title,\n backTo,\n backLabel,\n}) => {\n const t = useTr();\n const { navigateTo } = useBotlit();\n return (\n <PageLayout title={title}>\n <div\n role=\"status\"\n className=\"flex flex-col items-center justify-center gap-3 rounded-lg border border-border-subtle bg-bg-surface px-4 py-12 text-center\"\n >\n <Lock size={28} className=\"text-text-secondary\" />\n <div>\n <h2 className=\"text-lg font-medium text-text-primary\">\n {t('permissions.required.title', 'You do not have access to this action')}\n </h2>\n <p className=\"mt-2 max-w-md text-sm text-text-secondary\">\n {t(\n 'permissions.required.description',\n 'Your role in this workspace can view BotManor resources but not change them. Ask a workspace admin for edit access.'\n )}\n </p>\n </div>\n <Button variant=\"outline\" size=\"sm\" onClick={() => navigateTo(backTo)}>\n {backLabel}\n </Button>\n </div>\n </PageLayout>\n );\n};\n\nexport interface RequirePermissionProps extends PermissionRequiredStateProps {\n permission: BotmanorPermission;\n children: ReactNode;\n}\n\n/**\n * Render a create page only for members who may create; everyone else gets the\n * permission-required state. Nothing renders while permissions load.\n */\nexport const RequirePermission: FC<RequirePermissionProps> = ({\n permission,\n children,\n ...state\n}) => (\n <BotmanorPermissionGate permission={permission} fallback={<PermissionRequiredState {...state} />}>\n {children}\n </BotmanorPermissionGate>\n);\n"],"mappings":";;;;;;;;AA6BA,IAAaA,KAA6D,EACxE,UACA,WACA,mBACI;CACJ,IAAMC,IAAIC,EAAM,GACV,EAAE,kBAAeC,EAAU;CACjC,OACE,kBAACC,GAAD;EAAmB;EACjB,UAAA,kBAAC,OAAD;GACE,MAAK;GACL,WAAU;GAFZ,UAAA;IAIE,kBAACC,GAAD;KAAM,MAAM;KAAI,WAAU;IAAuB,CAAA;IACjD,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;KAAI,WAAU;KACX,UAAAJ,EAAE,8BAA8B,uCAAuC;IACtE,CAAA,GACJ,kBAAC,KAAD;KAAG,WAAU;KACV,UAAAA,EACC,oCACA,qHACF;IACC,CAAA,CACA,EAAA,CAAA;IACL,kBAACK,GAAD;KAAQ,SAAQ;KAAU,MAAK;KAAK,eAAeC,EAAWC,CAAM;KACjE,UAAAC;IACK,CAAA;GACL;;CACK,CAAA;AAEhB,GAWaC,KAAiD,EAC5D,eACA,aACA,GAAGC,QAEH,kBAACC,GAAD;CAAoC;CAAY,UAAU,kBAACZ,GAAD,EAAyB,GAAIW,EAAQ,CAAA;CAC5F;AACqB,CAAA"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * BotManor permission catalogue
3
+ * @module botlit/permissions
4
+ *
5
+ * The `resource:action` pairs the BotManor UI checks before it offers a write
6
+ * control. Every pair mirrors the `@rbac(resource, action)` directive on the
7
+ * wspace-botmanor-svc mutation that the control calls, so the UI hides exactly
8
+ * what the gateway would refuse. The gateway stays the only enforcement point:
9
+ * hiding a button never grants or denies anything, it only stops a member from
10
+ * attempting an action the gateway will answer with FORBIDDEN.
11
+ *
12
+ * Keep this file in step with the service schema. When a mutation's directive
13
+ * changes, change the pair here and the control that calls it.
14
+ */
15
+ export declare const BOTMANOR_PERMISSIONS: {
16
+ readonly APP_CREATE: "botmanor-app:create";
17
+ readonly APP_UPDATE: "botmanor-app:update";
18
+ readonly APP_DELETE: "botmanor-app:delete";
19
+ readonly APP_PUBLISH: "botmanor-app:publish";
20
+ readonly APP_ROLLBACK: "botmanor-app:rollback";
21
+ readonly APP_AGENT_CREATE: "botmanor-app-agent:create";
22
+ readonly APP_AGENT_UPDATE: "botmanor-app-agent:update";
23
+ readonly APP_AGENT_DELETE: "botmanor-app-agent:delete";
24
+ readonly AGENT_CREATE: "botmanor-agent:create";
25
+ readonly AGENT_UPDATE: "botmanor-agent:update";
26
+ readonly AGENT_DELETE: "botmanor-agent:delete";
27
+ readonly AGENT_PUBLISH: "botmanor-agent:publish";
28
+ readonly AGENT_ROLLBACK: "botmanor-agent:rollback";
29
+ readonly AGENT_EXECUTE: "botmanor-agent:execute";
30
+ readonly AGENT_APPROVE: "botmanor-agent:approve";
31
+ readonly KNOWLEDGE_CREATE: "botmanor-knowledge-base:create";
32
+ readonly KNOWLEDGE_UPDATE: "botmanor-knowledge-base:update";
33
+ readonly KNOWLEDGE_DELETE: "botmanor-knowledge-base:delete";
34
+ readonly KNOWLEDGE_MANAGE: "botmanor-knowledge-base:manage";
35
+ readonly RETRIEVAL_PROFILE_CREATE: "botmanor-retrieval-profile:create";
36
+ readonly RETRIEVAL_PROFILE_UPDATE: "botmanor-retrieval-profile:update";
37
+ readonly RETRIEVAL_PROFILE_DELETE: "botmanor-retrieval-profile:delete";
38
+ readonly MCP_CREATE: "botmanor-mcp:create";
39
+ readonly MCP_UPDATE: "botmanor-mcp:update";
40
+ readonly MCP_DELETE: "botmanor-mcp:delete";
41
+ readonly MCP_TEST: "botmanor-mcp:test";
42
+ readonly MCP_EXECUTE: "botmanor-mcp:execute";
43
+ readonly LLM_CREATE: "botmanor-llm:create";
44
+ readonly LLM_UPDATE: "botmanor-llm:update";
45
+ readonly LLM_DELETE: "botmanor-llm:delete";
46
+ readonly LLM_TEST: "botmanor-llm:test";
47
+ readonly A2A_CREATE: "botmanor-a2a:create";
48
+ readonly A2A_UPDATE: "botmanor-a2a:update";
49
+ readonly A2A_DELETE: "botmanor-a2a:delete";
50
+ readonly A2A_SEND: "botmanor-a2a:send";
51
+ readonly A2A_EXECUTE: "botmanor-a2a:execute";
52
+ readonly A2A_REGISTRY_CREATE: "botmanor-a2a-registry:create";
53
+ readonly A2A_REGISTRY_UPDATE: "botmanor-a2a-registry:update";
54
+ readonly A2A_REGISTRY_DELETE: "botmanor-a2a-registry:delete";
55
+ readonly CHANNEL_CREATE: "botmanor-channel:create";
56
+ readonly CHANNEL_UPDATE: "botmanor-channel:update";
57
+ readonly CHANNEL_DELETE: "botmanor-channel:delete";
58
+ readonly CHANNEL_MESSAGE_CREATE: "botmanor-channel-message:create";
59
+ readonly CHANNEL_MESSAGE_EXECUTE: "botmanor-channel-message:execute";
60
+ readonly POLICY_CREATE: "botmanor-policy:create";
61
+ readonly POLICY_UPDATE: "botmanor-policy:update";
62
+ readonly POLICY_DELETE: "botmanor-policy:delete";
63
+ readonly SKILL_CREATE: "botmanor-skill:create";
64
+ readonly SKILL_UPDATE: "botmanor-skill:update";
65
+ readonly SKILL_DELETE: "botmanor-skill:delete";
66
+ readonly PROMPT_TEMPLATE_CREATE: "botmanor-prompt-template:create";
67
+ readonly PROMPT_TEMPLATE_UPDATE: "botmanor-prompt-template:update";
68
+ readonly PROMPT_TEMPLATE_DELETE: "botmanor-prompt-template:delete";
69
+ readonly PROMPT_TEMPLATE_EXECUTE: "botmanor-prompt-template:execute";
70
+ readonly EXECUTION_CREATE: "botmanor-execution:create";
71
+ readonly EXECUTION_UPDATE: "botmanor-execution:update";
72
+ readonly BUCKET_CREATE: "botmanor-bucket:create";
73
+ readonly BUCKET_UPDATE: "botmanor-bucket:update";
74
+ readonly BUCKET_DELETE: "botmanor-bucket:delete";
75
+ readonly STORE_CREATE: "botmanor-store:create";
76
+ readonly STORE_UPDATE: "botmanor-store:update";
77
+ readonly STORE_DELETE: "botmanor-store:delete";
78
+ readonly TEMPLATE_CREATE: "botmanor-template:create";
79
+ readonly TEMPLATE_UPDATE: "botmanor-template:update";
80
+ readonly TEMPLATE_DELETE: "botmanor-template:delete";
81
+ };
82
+ export type BotmanorPermission = (typeof BOTMANOR_PERMISSIONS)[keyof typeof BOTMANOR_PERMISSIONS];
@@ -1,4 +1,4 @@
1
- //#region src/botlit/permissions/botmanorPermissions.ts
1
+ // src/botlit/permissions/botmanorPermissions.ts
2
2
  var e = {
3
3
  APP_CREATE: "botmanor-app:create",
4
4
  APP_UPDATE: "botmanor-app:update",
@@ -66,7 +66,6 @@ var e = {
66
66
  TEMPLATE_UPDATE: "botmanor-template:update",
67
67
  TEMPLATE_DELETE: "botmanor-template:delete"
68
68
  };
69
- //#endregion
70
69
  export { e as BOTMANOR_PERMISSIONS };
71
70
 
72
71
  //# sourceMappingURL=botmanorPermissions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"botmanorPermissions.js","names":[],"sources":["../../../src/botlit/permissions/botmanorPermissions.ts"],"sourcesContent":["/**\n * BotManor permission catalogue\n * @module botlit/permissions\n *\n * The `resource:action` pairs the BotManor UI checks before it offers a write\n * control. Every pair mirrors the `@rbac(resource, action)` directive on the\n * wspace-botmanor-svc mutation that the control calls, so the UI hides exactly\n * what the gateway would refuse. The gateway stays the only enforcement point:\n * hiding a button never grants or denies anything, it only stops a member from\n * attempting an action the gateway will answer with FORBIDDEN.\n *\n * Keep this file in step with the service schema. When a mutation's directive\n * changes, change the pair here and the control that calls it.\n */\n\nexport const BOTMANOR_PERMISSIONS = {\n // Bot apps — createBotApp / updateBotApp / deleteBotApp / publishBotAppVersion /\n // rollbackBotAppVersion\n APP_CREATE: 'botmanor-app:create',\n APP_UPDATE: 'botmanor-app:update',\n APP_DELETE: 'botmanor-app:delete',\n APP_PUBLISH: 'botmanor-app:publish',\n APP_ROLLBACK: 'botmanor-app:rollback',\n\n // Agents behind an app — createAppAgent / updateAppAgent / deleteAppAgent\n APP_AGENT_CREATE: 'botmanor-app-agent:create',\n APP_AGENT_UPDATE: 'botmanor-app-agent:update',\n APP_AGENT_DELETE: 'botmanor-app-agent:delete',\n\n // Agents — createBotmanorAgent / updateBotmanorAgent / deleteBotmanorAgent /\n // publishAgentVersion / rollbackAgentVersion / chatWithAgent /\n // approve|rejectBotmanorAgentActivation / updateBotmanorAgentApprovalSettings /\n // configureAssistantRuntime / publishAssistantWebsite / configureAssistantChannel\n AGENT_CREATE: 'botmanor-agent:create',\n AGENT_UPDATE: 'botmanor-agent:update',\n AGENT_DELETE: 'botmanor-agent:delete',\n AGENT_PUBLISH: 'botmanor-agent:publish',\n AGENT_ROLLBACK: 'botmanor-agent:rollback',\n AGENT_EXECUTE: 'botmanor-agent:execute',\n AGENT_APPROVE: 'botmanor-agent:approve',\n\n // Knowledge bases — createKnowledgeBase / addKnowledgeDocument /\n // updateKnowledgeBase / deleteKnowledgeBase / removeKnowledgeDocument /\n // rebuildKnowledgeBaseIndex / queueKnowledgeSource / retry*\n KNOWLEDGE_CREATE: 'botmanor-knowledge-base:create',\n KNOWLEDGE_UPDATE: 'botmanor-knowledge-base:update',\n KNOWLEDGE_DELETE: 'botmanor-knowledge-base:delete',\n KNOWLEDGE_MANAGE: 'botmanor-knowledge-base:manage',\n\n // Retrieval profiles\n RETRIEVAL_PROFILE_CREATE: 'botmanor-retrieval-profile:create',\n RETRIEVAL_PROFILE_UPDATE: 'botmanor-retrieval-profile:update',\n RETRIEVAL_PROFILE_DELETE: 'botmanor-retrieval-profile:delete',\n\n // MCP servers — create/update/deleteMCPConnection, updateMCPTool,\n // testMCPConnection, refreshMCPTools / refreshMCPResources / callMCPTool\n MCP_CREATE: 'botmanor-mcp:create',\n MCP_UPDATE: 'botmanor-mcp:update',\n MCP_DELETE: 'botmanor-mcp:delete',\n MCP_TEST: 'botmanor-mcp:test',\n MCP_EXECUTE: 'botmanor-mcp:execute',\n\n // LLM providers and models — create/update/delete*, testLlmConnection\n LLM_CREATE: 'botmanor-llm:create',\n LLM_UPDATE: 'botmanor-llm:update',\n LLM_DELETE: 'botmanor-llm:delete',\n LLM_TEST: 'botmanor-llm:test',\n\n // A2A — create/update/deleteA2AConnection, sendA2AMessage, delegateA2ATask\n A2A_CREATE: 'botmanor-a2a:create',\n A2A_UPDATE: 'botmanor-a2a:update',\n A2A_DELETE: 'botmanor-a2a:delete',\n A2A_SEND: 'botmanor-a2a:send',\n A2A_EXECUTE: 'botmanor-a2a:execute',\n\n // A2A registry (the external agents the Registry page lists) —\n // create/update/deleteA2ARegistryEntry\n A2A_REGISTRY_CREATE: 'botmanor-a2a-registry:create',\n A2A_REGISTRY_UPDATE: 'botmanor-a2a-registry:update',\n A2A_REGISTRY_DELETE: 'botmanor-a2a-registry:delete',\n\n // Channels — connectors and routes\n CHANNEL_CREATE: 'botmanor-channel:create',\n CHANNEL_UPDATE: 'botmanor-channel:update',\n CHANNEL_DELETE: 'botmanor-channel:delete',\n // sendChannelMessage is :create, handleChannelMessage is :execute\n CHANNEL_MESSAGE_CREATE: 'botmanor-channel-message:create',\n CHANNEL_MESSAGE_EXECUTE: 'botmanor-channel-message:execute',\n\n // Policies\n POLICY_CREATE: 'botmanor-policy:create',\n POLICY_UPDATE: 'botmanor-policy:update',\n POLICY_DELETE: 'botmanor-policy:delete',\n\n // Skills\n SKILL_CREATE: 'botmanor-skill:create',\n SKILL_UPDATE: 'botmanor-skill:update',\n SKILL_DELETE: 'botmanor-skill:delete',\n\n // Prompt templates — create/duplicate share :create; renderPromptTemplate is :execute\n PROMPT_TEMPLATE_CREATE: 'botmanor-prompt-template:create',\n PROMPT_TEMPLATE_UPDATE: 'botmanor-prompt-template:update',\n PROMPT_TEMPLATE_DELETE: 'botmanor-prompt-template:delete',\n PROMPT_TEMPLATE_EXECUTE: 'botmanor-prompt-template:execute',\n\n // Executions — createExecution / triggerBotmanorBoundWorkflow are :create,\n // runExecution / updateExecutionStatus are :update\n EXECUTION_CREATE: 'botmanor-execution:create',\n EXECUTION_UPDATE: 'botmanor-execution:update',\n\n // Buckets\n BUCKET_CREATE: 'botmanor-bucket:create',\n BUCKET_UPDATE: 'botmanor-bucket:update',\n BUCKET_DELETE: 'botmanor-bucket:delete',\n\n // Store — installPackage / forkInstalledPackage are :create,\n // updateInstalledPackage :update, uninstallPackage :delete\n STORE_CREATE: 'botmanor-store:create',\n STORE_UPDATE: 'botmanor-store:update',\n STORE_DELETE: 'botmanor-store:delete',\n\n // Agent and app templates\n TEMPLATE_CREATE: 'botmanor-template:create',\n TEMPLATE_UPDATE: 'botmanor-template:update',\n TEMPLATE_DELETE: 'botmanor-template:delete',\n} as const;\n\nexport type BotmanorPermission = (typeof BOTMANOR_PERMISSIONS)[keyof typeof BOTMANOR_PERMISSIONS];\n"],"mappings":";AAeA,IAAa,IAAuB;CAGlC,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,aAAa;CACb,cAAc;CAGd,kBAAkB;CAClB,kBAAkB;CAClB,kBAAkB;CAMlB,cAAc;CACd,cAAc;CACd,cAAc;CACd,eAAe;CACf,gBAAgB;CAChB,eAAe;CACf,eAAe;CAKf,kBAAkB;CAClB,kBAAkB;CAClB,kBAAkB;CAClB,kBAAkB;CAGlB,0BAA0B;CAC1B,0BAA0B;CAC1B,0BAA0B;CAI1B,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,UAAU;CACV,aAAa;CAGb,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,UAAU;CAGV,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,UAAU;CACV,aAAa;CAIb,qBAAqB;CACrB,qBAAqB;CACrB,qBAAqB;CAGrB,gBAAgB;CAChB,gBAAgB;CAChB,gBAAgB;CAEhB,wBAAwB;CACxB,yBAAyB;CAGzB,eAAe;CACf,eAAe;CACf,eAAe;CAGf,cAAc;CACd,cAAc;CACd,cAAc;CAGd,wBAAwB;CACxB,wBAAwB;CACxB,wBAAwB;CACxB,yBAAyB;CAIzB,kBAAkB;CAClB,kBAAkB;CAGlB,eAAe;CACf,eAAe;CACf,eAAe;CAIf,cAAc;CACd,cAAc;CACd,cAAc;CAGd,iBAAiB;CACjB,iBAAiB;CACjB,iBAAiB;CAClB"}
1
+ {"version":3,"file":"botmanorPermissions.js","names":["BOTMANOR_PERMISSIONS"],"sources":["../../../src/botlit/permissions/botmanorPermissions.ts"],"sourcesContent":["/**\n * BotManor permission catalogue\n * @module botlit/permissions\n *\n * The `resource:action` pairs the BotManor UI checks before it offers a write\n * control. Every pair mirrors the `@rbac(resource, action)` directive on the\n * wspace-botmanor-svc mutation that the control calls, so the UI hides exactly\n * what the gateway would refuse. The gateway stays the only enforcement point:\n * hiding a button never grants or denies anything, it only stops a member from\n * attempting an action the gateway will answer with FORBIDDEN.\n *\n * Keep this file in step with the service schema. When a mutation's directive\n * changes, change the pair here and the control that calls it.\n */\n\nexport const BOTMANOR_PERMISSIONS = {\n // Bot apps — createBotApp / updateBotApp / deleteBotApp / publishBotAppVersion /\n // rollbackBotAppVersion\n APP_CREATE: 'botmanor-app:create',\n APP_UPDATE: 'botmanor-app:update',\n APP_DELETE: 'botmanor-app:delete',\n APP_PUBLISH: 'botmanor-app:publish',\n APP_ROLLBACK: 'botmanor-app:rollback',\n\n // Agents behind an app — createAppAgent / updateAppAgent / deleteAppAgent\n APP_AGENT_CREATE: 'botmanor-app-agent:create',\n APP_AGENT_UPDATE: 'botmanor-app-agent:update',\n APP_AGENT_DELETE: 'botmanor-app-agent:delete',\n\n // Agents — createBotmanorAgent / updateBotmanorAgent / deleteBotmanorAgent /\n // publishAgentVersion / rollbackAgentVersion / chatWithAgent /\n // approve|rejectBotmanorAgentActivation / updateBotmanorAgentApprovalSettings /\n // configureAssistantRuntime / publishAssistantWebsite / configureAssistantChannel\n AGENT_CREATE: 'botmanor-agent:create',\n AGENT_UPDATE: 'botmanor-agent:update',\n AGENT_DELETE: 'botmanor-agent:delete',\n AGENT_PUBLISH: 'botmanor-agent:publish',\n AGENT_ROLLBACK: 'botmanor-agent:rollback',\n AGENT_EXECUTE: 'botmanor-agent:execute',\n AGENT_APPROVE: 'botmanor-agent:approve',\n\n // Knowledge bases — createKnowledgeBase / addKnowledgeDocument /\n // updateKnowledgeBase / deleteKnowledgeBase / removeKnowledgeDocument /\n // rebuildKnowledgeBaseIndex / queueKnowledgeSource / retry*\n KNOWLEDGE_CREATE: 'botmanor-knowledge-base:create',\n KNOWLEDGE_UPDATE: 'botmanor-knowledge-base:update',\n KNOWLEDGE_DELETE: 'botmanor-knowledge-base:delete',\n KNOWLEDGE_MANAGE: 'botmanor-knowledge-base:manage',\n\n // Retrieval profiles\n RETRIEVAL_PROFILE_CREATE: 'botmanor-retrieval-profile:create',\n RETRIEVAL_PROFILE_UPDATE: 'botmanor-retrieval-profile:update',\n RETRIEVAL_PROFILE_DELETE: 'botmanor-retrieval-profile:delete',\n\n // MCP servers — create/update/deleteMCPConnection, updateMCPTool,\n // testMCPConnection, refreshMCPTools / refreshMCPResources / callMCPTool\n MCP_CREATE: 'botmanor-mcp:create',\n MCP_UPDATE: 'botmanor-mcp:update',\n MCP_DELETE: 'botmanor-mcp:delete',\n MCP_TEST: 'botmanor-mcp:test',\n MCP_EXECUTE: 'botmanor-mcp:execute',\n\n // LLM providers and models — create/update/delete*, testLlmConnection\n LLM_CREATE: 'botmanor-llm:create',\n LLM_UPDATE: 'botmanor-llm:update',\n LLM_DELETE: 'botmanor-llm:delete',\n LLM_TEST: 'botmanor-llm:test',\n\n // A2A — create/update/deleteA2AConnection, sendA2AMessage, delegateA2ATask\n A2A_CREATE: 'botmanor-a2a:create',\n A2A_UPDATE: 'botmanor-a2a:update',\n A2A_DELETE: 'botmanor-a2a:delete',\n A2A_SEND: 'botmanor-a2a:send',\n A2A_EXECUTE: 'botmanor-a2a:execute',\n\n // A2A registry (the external agents the Registry page lists) —\n // create/update/deleteA2ARegistryEntry\n A2A_REGISTRY_CREATE: 'botmanor-a2a-registry:create',\n A2A_REGISTRY_UPDATE: 'botmanor-a2a-registry:update',\n A2A_REGISTRY_DELETE: 'botmanor-a2a-registry:delete',\n\n // Channels — connectors and routes\n CHANNEL_CREATE: 'botmanor-channel:create',\n CHANNEL_UPDATE: 'botmanor-channel:update',\n CHANNEL_DELETE: 'botmanor-channel:delete',\n // sendChannelMessage is :create, handleChannelMessage is :execute\n CHANNEL_MESSAGE_CREATE: 'botmanor-channel-message:create',\n CHANNEL_MESSAGE_EXECUTE: 'botmanor-channel-message:execute',\n\n // Policies\n POLICY_CREATE: 'botmanor-policy:create',\n POLICY_UPDATE: 'botmanor-policy:update',\n POLICY_DELETE: 'botmanor-policy:delete',\n\n // Skills\n SKILL_CREATE: 'botmanor-skill:create',\n SKILL_UPDATE: 'botmanor-skill:update',\n SKILL_DELETE: 'botmanor-skill:delete',\n\n // Prompt templates — create/duplicate share :create; renderPromptTemplate is :execute\n PROMPT_TEMPLATE_CREATE: 'botmanor-prompt-template:create',\n PROMPT_TEMPLATE_UPDATE: 'botmanor-prompt-template:update',\n PROMPT_TEMPLATE_DELETE: 'botmanor-prompt-template:delete',\n PROMPT_TEMPLATE_EXECUTE: 'botmanor-prompt-template:execute',\n\n // Executions — createExecution / triggerBotmanorBoundWorkflow are :create,\n // runExecution / updateExecutionStatus are :update\n EXECUTION_CREATE: 'botmanor-execution:create',\n EXECUTION_UPDATE: 'botmanor-execution:update',\n\n // Buckets\n BUCKET_CREATE: 'botmanor-bucket:create',\n BUCKET_UPDATE: 'botmanor-bucket:update',\n BUCKET_DELETE: 'botmanor-bucket:delete',\n\n // Store — installPackage / forkInstalledPackage are :create,\n // updateInstalledPackage :update, uninstallPackage :delete\n STORE_CREATE: 'botmanor-store:create',\n STORE_UPDATE: 'botmanor-store:update',\n STORE_DELETE: 'botmanor-store:delete',\n\n // Agent and app templates\n TEMPLATE_CREATE: 'botmanor-template:create',\n TEMPLATE_UPDATE: 'botmanor-template:update',\n TEMPLATE_DELETE: 'botmanor-template:delete',\n} as const;\n\nexport type BotmanorPermission = (typeof BOTMANOR_PERMISSIONS)[keyof typeof BOTMANOR_PERMISSIONS];\n"],"mappings":";AAeA,IAAaA,IAAuB;CAGlC,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,aAAa;CACb,cAAc;CAGd,kBAAkB;CAClB,kBAAkB;CAClB,kBAAkB;CAMlB,cAAc;CACd,cAAc;CACd,cAAc;CACd,eAAe;CACf,gBAAgB;CAChB,eAAe;CACf,eAAe;CAKf,kBAAkB;CAClB,kBAAkB;CAClB,kBAAkB;CAClB,kBAAkB;CAGlB,0BAA0B;CAC1B,0BAA0B;CAC1B,0BAA0B;CAI1B,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,UAAU;CACV,aAAa;CAGb,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,UAAU;CAGV,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,UAAU;CACV,aAAa;CAIb,qBAAqB;CACrB,qBAAqB;CACrB,qBAAqB;CAGrB,gBAAgB;CAChB,gBAAgB;CAChB,gBAAgB;CAEhB,wBAAwB;CACxB,yBAAyB;CAGzB,eAAe;CACf,eAAe;CACf,eAAe;CAGf,cAAc;CACd,cAAc;CACd,cAAc;CAGd,wBAAwB;CACxB,wBAAwB;CACxB,wBAAwB;CACxB,yBAAyB;CAIzB,kBAAkB;CAClB,kBAAkB;CAGlB,eAAe;CACf,eAAe;CACf,eAAe;CAIf,cAAc;CACd,cAAc;CACd,cAAc;CAGd,iBAAiB;CACjB,iBAAiB;CACjB,iBAAiB;AACnB"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * BotManor permissions
3
+ * @module botlit/permissions
4
+ */
5
+ export { BOTMANOR_PERMISSIONS, type BotmanorPermission } from './botmanorPermissions';
6
+ export { useBotmanorCan, useBotmanorPermission, BotmanorPermissionGate, resolvePermission, type BotmanorPermissionCheck, type BotmanorPermissionGateProps, type PermissionDecision, } from './useBotmanorPermissions';
7
+ export { PermissionRequiredState, RequirePermission, type PermissionRequiredStateProps, type RequirePermissionProps, } from './PermissionRequired';
@@ -1,3 +1,4 @@
1
- import "./botmanorPermissions.js";
2
- import "./useBotmanorPermissions.js";
3
- import "./PermissionRequired.js";
1
+ import { BOTMANOR_PERMISSIONS as e } from "./botmanorPermissions.js";
2
+ import { BotmanorPermissionGate as t, useBotmanorCan as n } from "./useBotmanorPermissions.js";
3
+ import { RequirePermission as r } from "./PermissionRequired.js";
4
+ export { e as BOTMANOR_PERMISSIONS, t as BotmanorPermissionGate, r as RequirePermission, n as useBotmanorCan };
@@ -0,0 +1,41 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { useSafePermissions } from '@burdenoff/fe-libs/shared/providers/shell';
3
+ import { BotmanorPermission } from './botmanorPermissions';
4
+ /** Answers whether the current member may use the control behind `permission`. */
5
+ export type BotmanorPermissionCheck = (permission: BotmanorPermission) => boolean;
6
+ /** Outcome of resolving a permission against the shell context. */
7
+ export type PermissionDecision = 'allowed' | 'denied' | 'loading';
8
+ /**
9
+ * Resolve one permission against a (possibly absent) permission context.
10
+ * Exported for unit tests; components use the hooks below.
11
+ */
12
+ export declare function resolvePermission(context: ReturnType<typeof useSafePermissions>, permission: BotmanorPermission): PermissionDecision;
13
+ /**
14
+ * Returns a stable checker for any number of permissions on one page.
15
+ *
16
+ * @example
17
+ * const can = useBotmanorCan();
18
+ * {can(BOTMANOR_PERMISSIONS.POLICY_DELETE) && <Button onClick={remove}>Delete</Button>}
19
+ */
20
+ export declare function useBotmanorCan(): BotmanorPermissionCheck;
21
+ /** Single-permission form of {@link useBotmanorCan}. */
22
+ export declare function useBotmanorPermission(permission: BotmanorPermission): boolean;
23
+ export interface BotmanorPermissionGateProps {
24
+ /** The `resource:action` pair the wrapped control needs. */
25
+ permission: BotmanorPermission;
26
+ /** Rendered when the member has the permission. */
27
+ children: ReactNode;
28
+ /** Rendered when the member lacks the permission. Nothing by default. */
29
+ fallback?: ReactNode;
30
+ /** Rendered while permissions load. Nothing by default. */
31
+ loading?: ReactNode;
32
+ }
33
+ /**
34
+ * Render `children` only for members who hold `permission`.
35
+ *
36
+ * @example
37
+ * <BotmanorPermissionGate permission={BOTMANOR_PERMISSIONS.POLICY_CREATE}>
38
+ * <Button>Create Policy</Button>
39
+ * </BotmanorPermissionGate>
40
+ */
41
+ export declare const BotmanorPermissionGate: FC<BotmanorPermissionGateProps>;
@@ -1,7 +1,7 @@
1
1
  import { useCallback as e } from "react";
2
2
  import { Fragment as t, jsx as n } from "react/jsx-runtime";
3
3
  import { useSafePermissions as r } from "@burdenoff/fe-libs/shared/providers/shell";
4
- //#region src/botlit/permissions/useBotmanorPermissions.tsx
4
+ // src/botlit/permissions/useBotmanorPermissions.tsx
5
5
  function i(e, t) {
6
6
  return e ? e.isLoading ? "loading" : e.hasPermission(t) ? "allowed" : "denied" : "allowed";
7
7
  }
@@ -13,7 +13,6 @@ var o = ({ permission: e, children: a, fallback: o = null, loading: s = null })
13
13
  let c = i(r(), e);
14
14
  return c === "allowed" ? /* @__PURE__ */ n(t, { children: a }) : c === "loading" ? /* @__PURE__ */ n(t, { children: s }) : /* @__PURE__ */ n(t, { children: o });
15
15
  };
16
- //#endregion
17
16
  export { o as BotmanorPermissionGate, i as resolvePermission, a as useBotmanorCan };
18
17
 
19
18
  //# sourceMappingURL=useBotmanorPermissions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useBotmanorPermissions.js","names":[],"sources":["../../../src/botlit/permissions/useBotmanorPermissions.tsx"],"sourcesContent":["/**\n * BotManor permission hooks and gate\n * @module botlit/permissions\n *\n * Thin wrappers over the shell's fe-libs `PermissionProvider` that decide\n * whether the UI should offer a write control. They follow the fe-libs\n * `PermissionGate` contract (render children when allowed, `fallback` when\n * denied, `loading` while the permission set is still being fetched) with one\n * difference: they read the context through `useSafePermissions`, so the MFE\n * keeps rendering in a host that has not mounted RBAC (the standalone dev\n * host, Storybook, unit tests). With no provider every control is offered,\n * which is exactly the behaviour before gating existed; the gateway's `@rbac`\n * directive remains the enforcement point either way.\n *\n * While permissions load, checks answer `false` so a viewer never sees a\n * control flash on and then disappear.\n */\n\nimport { useCallback, type FC, type ReactNode } from 'react';\nimport { useSafePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\n\nimport type { BotmanorPermission } from './botmanorPermissions';\n\n/** Answers whether the current member may use the control behind `permission`. */\nexport type BotmanorPermissionCheck = (permission: BotmanorPermission) => boolean;\n\n/** Outcome of resolving a permission against the shell context. */\nexport type PermissionDecision = 'allowed' | 'denied' | 'loading';\n\n/**\n * Resolve one permission against a (possibly absent) permission context.\n * Exported for unit tests; components use the hooks below.\n */\nexport function resolvePermission(\n context: ReturnType<typeof useSafePermissions>,\n permission: BotmanorPermission\n): PermissionDecision {\n if (!context) return 'allowed';\n if (context.isLoading) return 'loading';\n return context.hasPermission(permission) ? 'allowed' : 'denied';\n}\n\n/**\n * Returns a stable checker for any number of permissions on one page.\n *\n * @example\n * const can = useBotmanorCan();\n * {can(BOTMANOR_PERMISSIONS.POLICY_DELETE) && <Button onClick={remove}>Delete</Button>}\n */\nexport function useBotmanorCan(): BotmanorPermissionCheck {\n const context = useSafePermissions();\n return useCallback(\n (permission: BotmanorPermission) => resolvePermission(context, permission) === 'allowed',\n [context]\n );\n}\n\n/** Single-permission form of {@link useBotmanorCan}. */\nexport function useBotmanorPermission(permission: BotmanorPermission): boolean {\n return useBotmanorCan()(permission);\n}\n\nexport interface BotmanorPermissionGateProps {\n /** The `resource:action` pair the wrapped control needs. */\n permission: BotmanorPermission;\n /** Rendered when the member has the permission. */\n children: ReactNode;\n /** Rendered when the member lacks the permission. Nothing by default. */\n fallback?: ReactNode;\n /** Rendered while permissions load. Nothing by default. */\n loading?: ReactNode;\n}\n\n/**\n * Render `children` only for members who hold `permission`.\n *\n * @example\n * <BotmanorPermissionGate permission={BOTMANOR_PERMISSIONS.POLICY_CREATE}>\n * <Button>Create Policy</Button>\n * </BotmanorPermissionGate>\n */\nexport const BotmanorPermissionGate: FC<BotmanorPermissionGateProps> = ({\n permission,\n children,\n fallback = null,\n loading = null,\n}) => {\n const decision = resolvePermission(useSafePermissions(), permission);\n if (decision === 'allowed') return <>{children}</>;\n if (decision === 'loading') return <>{loading}</>;\n return <>{fallback}</>;\n};\n"],"mappings":";;;;AAiCA,SAAgB,EACd,GACA,GACoB;AAGpB,QAFK,IACD,EAAQ,YAAkB,YACvB,EAAQ,cAAc,EAAW,GAAG,YAAY,WAFlC;;AAYvB,SAAgB,IAA0C;CACxD,IAAM,IAAU,GAAoB;AACpC,QAAO,GACJ,MAAmC,EAAkB,GAAS,EAAW,KAAK,WAC/E,CAAC,EAAQ,CACV;;AA2BH,IAAa,KAA2D,EACtE,eACA,aACA,cAAW,MACX,aAAU,WACN;CACJ,IAAM,IAAW,EAAkB,GAAoB,EAAE,EAAW;AAGpE,QAFI,MAAa,YAAkB,kBAAA,GAAA,EAAG,aAAY,CAAA,GAC9C,MAAa,YAAkB,kBAAA,GAAA,EAAA,UAAG,GAAW,CAAA,GAC1C,kBAAA,GAAA,EAAA,UAAG,GAAY,CAAA"}
1
+ {"version":3,"file":"useBotmanorPermissions.js","names":["_Fragment","resolvePermission","context","permission","useBotmanorCan","useSafePermissions","useCallback","BotmanorPermissionGate","decision","Fragment","loading","fallback"],"sources":["../../../src/botlit/permissions/useBotmanorPermissions.tsx"],"sourcesContent":["/**\n * BotManor permission hooks and gate\n * @module botlit/permissions\n *\n * Thin wrappers over the shell's fe-libs `PermissionProvider` that decide\n * whether the UI should offer a write control. They follow the fe-libs\n * `PermissionGate` contract (render children when allowed, `fallback` when\n * denied, `loading` while the permission set is still being fetched) with one\n * difference: they read the context through `useSafePermissions`, so the MFE\n * keeps rendering in a host that has not mounted RBAC (the standalone dev\n * host, Storybook, unit tests). With no provider every control is offered,\n * which is exactly the behaviour before gating existed; the gateway's `@rbac`\n * directive remains the enforcement point either way.\n *\n * While permissions load, checks answer `false` so a viewer never sees a\n * control flash on and then disappear.\n */\n\nimport { useCallback, type FC, type ReactNode } from 'react';\nimport { useSafePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\n\nimport type { BotmanorPermission } from './botmanorPermissions';\n\n/** Answers whether the current member may use the control behind `permission`. */\nexport type BotmanorPermissionCheck = (permission: BotmanorPermission) => boolean;\n\n/** Outcome of resolving a permission against the shell context. */\nexport type PermissionDecision = 'allowed' | 'denied' | 'loading';\n\n/**\n * Resolve one permission against a (possibly absent) permission context.\n * Exported for unit tests; components use the hooks below.\n */\nexport function resolvePermission(\n context: ReturnType<typeof useSafePermissions>,\n permission: BotmanorPermission\n): PermissionDecision {\n if (!context) return 'allowed';\n if (context.isLoading) return 'loading';\n return context.hasPermission(permission) ? 'allowed' : 'denied';\n}\n\n/**\n * Returns a stable checker for any number of permissions on one page.\n *\n * @example\n * const can = useBotmanorCan();\n * {can(BOTMANOR_PERMISSIONS.POLICY_DELETE) && <Button onClick={remove}>Delete</Button>}\n */\nexport function useBotmanorCan(): BotmanorPermissionCheck {\n const context = useSafePermissions();\n return useCallback(\n (permission: BotmanorPermission) => resolvePermission(context, permission) === 'allowed',\n [context]\n );\n}\n\n/** Single-permission form of {@link useBotmanorCan}. */\nexport function useBotmanorPermission(permission: BotmanorPermission): boolean {\n return useBotmanorCan()(permission);\n}\n\nexport interface BotmanorPermissionGateProps {\n /** The `resource:action` pair the wrapped control needs. */\n permission: BotmanorPermission;\n /** Rendered when the member has the permission. */\n children: ReactNode;\n /** Rendered when the member lacks the permission. Nothing by default. */\n fallback?: ReactNode;\n /** Rendered while permissions load. Nothing by default. */\n loading?: ReactNode;\n}\n\n/**\n * Render `children` only for members who hold `permission`.\n *\n * @example\n * <BotmanorPermissionGate permission={BOTMANOR_PERMISSIONS.POLICY_CREATE}>\n * <Button>Create Policy</Button>\n * </BotmanorPermissionGate>\n */\nexport const BotmanorPermissionGate: FC<BotmanorPermissionGateProps> = ({\n permission,\n children,\n fallback = null,\n loading = null,\n}) => {\n const decision = resolvePermission(useSafePermissions(), permission);\n if (decision === 'allowed') return <>{children}</>;\n if (decision === 'loading') return <>{loading}</>;\n return <>{fallback}</>;\n};\n"],"mappings":";;;;AAiCA,SAAgBC,EACd,GACA,GACoB;CAGpB,OAFKC,IACDA,EAAQ,YAAkB,YACvBA,EAAQ,cAAcC,CAAU,IAAI,YAAY,WAFlC;AAGvB;AASA,SAAgBC,IAA0C;CACxD,IAAMF,IAAUG,EAAmB;CACnC,OAAOC,GACJ,MAAmCL,EAAkBC,GAASC,CAAU,MAAM,WAC/E,CAACD,CAAO,CACV;AACF;AA0BA,IAAaK,KAA2D,EACtE,eACA,aACA,cAAW,MACX,aAAU,WACN;CACJ,IAAMC,IAAWP,EAAkBI,EAAmB,GAAGF,CAAU;CAGnE,OAFIK,MAAa,YAAkB,kBAAAR,GAAA,EAAG,YAAW,CAAA,IAC7CQ,MAAa,YAAkB,kBAAAR,GAAA,EAAA,UAAGU,EAAU,CAAA,IACzC,kBAAAV,GAAA,EAAA,UAAGW,EAAW,CAAA;AACvB"}
@@ -0,0 +1,14 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { BotmanorRootProps } from '../types';
3
+ interface BotlitContextValue extends Omit<BotmanorRootProps, 'registerNavItems' | 'registerFooterItems' | 'navigate'> {
4
+ isStandalone: boolean;
5
+ /** Shell's navigate function (only available in integrated mode) */
6
+ navigate?: (path: string) => void;
7
+ /** Navigate to a path relative to basePath */
8
+ navigateTo: (relativePath: string) => void;
9
+ /** Get the full path for a relative path */
10
+ getPath: (relativePath: string) => string;
11
+ }
12
+ export declare function useBotlit(): BotlitContextValue;
13
+ export declare const BotlitProvider: FC<PropsWithChildren<BotmanorRootProps>>;
14
+ export {};
@@ -2,7 +2,7 @@ import { joinPath as e } from "../utils/navigation.js";
2
2
  import { createContext as t, useCallback as n, useContext as r, useMemo as i } from "react";
3
3
  import { jsx as a } from "react/jsx-runtime";
4
4
  import { MemoryRouter as o, useNavigate as s } from "react-router";
5
- //#region src/botlit/providers/BotlitProvider.tsx
5
+ // src/botlit/providers/BotlitProvider.tsx
6
6
  var c = t(null);
7
7
  function l() {
8
8
  let e = r(c);
@@ -11,7 +11,8 @@ function l() {
11
11
  }
12
12
  var u = ({ children: t, basePath: r, currentUser: o, tenantId: l, workspaceId: u, apiGatewayUrl: d, authToken: f, productId: p, onBotSelect: m, onAgentSelect: h }) => {
13
13
  let g = s(), _ = r || "/", v = n((t) => e(_, t), [_]), y = n((t) => {
14
- g(e(_, t));
14
+ let n = e(_, t);
15
+ g(n);
15
16
  }, [_, g]), b = i(() => ({
16
17
  basePath: _,
17
18
  navigate: void 0,
@@ -91,7 +92,6 @@ var u = ({ children: t, basePath: r, currentUser: o, tenantId: l, workspaceId: u
91
92
  children: t
92
93
  }) });
93
94
  };
94
- //#endregion
95
95
  export { f as BotlitProvider, l as useBotlit };
96
96
 
97
97
  //# sourceMappingURL=BotlitProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BotlitProvider.js","names":[],"sources":["../../../src/botlit/providers/BotlitProvider.tsx"],"sourcesContent":["/**\n * BotManor Context Provider\n * @module botlit/providers\n */\n\nimport type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useCallback } from 'react';\nimport { MemoryRouter, useNavigate as useRouterNavigate } from 'react-router';\nimport type { BotmanorRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface BotlitContextValue extends Omit<\n BotmanorRootProps,\n 'registerNavItems' | 'registerFooterItems' | 'navigate'\n> {\n isStandalone: boolean;\n /** Shell's navigate function (only available in integrated mode) */\n navigate?: (path: string) => void;\n /** Navigate to a path relative to basePath */\n navigateTo: (relativePath: string) => void;\n /** Get the full path for a relative path */\n getPath: (relativePath: string) => string;\n}\n\nconst BotlitContext = createContext<BotlitContextValue | null>(null);\n\n// ============================================================================\n// Hook\n// ============================================================================\n\nexport function useBotlit(): BotlitContextValue {\n const context = useContext(BotlitContext);\n if (!context) {\n throw new Error('useBotlit must be used within a BotlitProvider');\n }\n return context;\n}\n\n// ============================================================================\n// Provider Component\n// ============================================================================\n\ntype ProviderProps = Omit<BotmanorRootProps, 'registerNavItems' | 'registerFooterItems'> & {\n isStandalone: boolean;\n};\n\n/** Provider for standalone mode (has access to MemoryRouter) */\nconst StandaloneProviderInner: FC<PropsWithChildren<ProviderProps>> = ({\n children,\n basePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n}) => {\n // Always call hooks unconditionally in this component\n const routerNavigate = useRouterNavigate();\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n routerNavigate(fullPath);\n },\n [effectiveBasePath, routerNavigate]\n );\n\n const contextValue = useMemo<BotlitContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate: undefined,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n isStandalone: true,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n navigateTo,\n getPath,\n ]\n );\n\n return <BotlitContext.Provider value={contextValue}>{children}</BotlitContext.Provider>;\n};\n\n/** Provider for integrated mode (shell provides navigate) */\nconst IntegratedProviderInner: FC<\n PropsWithChildren<ProviderProps & { navigate: (path: string) => void }>\n> = ({\n children,\n basePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n}) => {\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n navigate(fullPath);\n },\n [effectiveBasePath, navigate]\n );\n\n const contextValue = useMemo<BotlitContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n isStandalone: false,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n navigateTo,\n getPath,\n ]\n );\n\n return <BotlitContext.Provider value={contextValue}>{children}</BotlitContext.Provider>;\n};\n\nexport const BotlitProvider: FC<PropsWithChildren<BotmanorRootProps>> = (props) => {\n const { children, navigate } = props;\n // Standalone mode: no navigate function provided (MFE manages its own router)\n // Integrated mode: navigate function provided by shell (shell provides router)\n const isStandalone = !navigate;\n\n // Standalone mode: wrap in MemoryRouter\n if (isStandalone) {\n return (\n <MemoryRouter>\n <StandaloneProviderInner {...props} isStandalone={true}>\n {children}\n </StandaloneProviderInner>\n </MemoryRouter>\n );\n }\n\n // Integrated mode: shell provides router\n return (\n <IntegratedProviderInner {...props} navigate={navigate} isStandalone={false}>\n {children}\n </IntegratedProviderInner>\n );\n};\n"],"mappings":";;;;;AA4BA,IAAM,IAAgB,EAAyC,KAAK;AAMpE,SAAgB,IAAgC;CAC9C,IAAM,IAAU,EAAW,EAAc;AACzC,KAAI,CAAC,EACH,OAAU,MAAM,iDAAiD;AAEnE,QAAO;;AAYT,IAAM,KAAiE,EACrE,aACA,aACA,gBACA,aACA,gBACA,kBACA,cACA,cACA,gBACA,uBACI;CAEJ,IAAM,IAAiB,GAAmB,EACpC,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,EAAa,EACnE,CAAC,EAAkB,CACpB,EAEK,IAAa,GAChB,MAAyB;AAExB,IADiB,EAAS,GAAmB,EAAa,CAClC;IAE1B,CAAC,GAAmB,EAAe,CACpC,EAEK,IAAe,SACZ;EACL,UAAU;EACV,UAAU,KAAA;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACD,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,QAAO,kBAAC,EAAc,UAAf;EAAwB,OAAO;EAAe;EAAkC,CAAA;GAInF,KAED,EACH,aACA,aACA,aACA,gBACA,aACA,gBACA,kBACA,cACA,cACA,gBACA,uBACI;CACJ,IAAM,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,EAAa,EACnE,CAAC,EAAkB,CACpB,EAEK,IAAa,GAChB,MAAyB;AAExB,IADiB,EAAS,GAAmB,EAAa,CACxC;IAEpB,CAAC,GAAmB,EAAS,CAC9B,EAEK,IAAe,SACZ;EACL,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACD,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,QAAO,kBAAC,EAAc,UAAf;EAAwB,OAAO;EAAe;EAAkC,CAAA;GAG5E,KAA4D,MAAU;CACjF,IAAM,EAAE,aAAU,gBAAa;AAiB/B,QAdsB,IAepB,kBAAC,GAAD;EAAyB,GAAI;EAAiB;EAAU,cAAc;EACnE;EACuB,CAAA,GAZxB,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAAyB,GAAI;EAAO,cAAc;EAC/C;EACuB,CAAA,EACb,CAAA"}
1
+ {"version":3,"file":"BotlitProvider.js","names":["useRouterNavigate","BotlitContext","createContext","useBotlit","context","useContext","StandaloneProviderInner","routerNavigate","useNavigate","effectiveBasePath","basePath","getPath","useCallback","joinPath","relativePath","navigateTo","fullPath","contextValue","useMemo","currentUser","tenantId","workspaceId","apiGatewayUrl","authToken","productId","onBotSelect","onAgentSelect","IntegratedProviderInner","navigate","BotlitProvider","props","MemoryRouter"],"sources":["../../../src/botlit/providers/BotlitProvider.tsx"],"sourcesContent":["/**\n * BotManor Context Provider\n * @module botlit/providers\n */\n\nimport type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useCallback } from 'react';\nimport { MemoryRouter, useNavigate as useRouterNavigate } from 'react-router';\nimport type { BotmanorRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface BotlitContextValue extends Omit<\n BotmanorRootProps,\n 'registerNavItems' | 'registerFooterItems' | 'navigate'\n> {\n isStandalone: boolean;\n /** Shell's navigate function (only available in integrated mode) */\n navigate?: (path: string) => void;\n /** Navigate to a path relative to basePath */\n navigateTo: (relativePath: string) => void;\n /** Get the full path for a relative path */\n getPath: (relativePath: string) => string;\n}\n\nconst BotlitContext = createContext<BotlitContextValue | null>(null);\n\n// ============================================================================\n// Hook\n// ============================================================================\n\nexport function useBotlit(): BotlitContextValue {\n const context = useContext(BotlitContext);\n if (!context) {\n throw new Error('useBotlit must be used within a BotlitProvider');\n }\n return context;\n}\n\n// ============================================================================\n// Provider Component\n// ============================================================================\n\ntype ProviderProps = Omit<BotmanorRootProps, 'registerNavItems' | 'registerFooterItems'> & {\n isStandalone: boolean;\n};\n\n/** Provider for standalone mode (has access to MemoryRouter) */\nconst StandaloneProviderInner: FC<PropsWithChildren<ProviderProps>> = ({\n children,\n basePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n}) => {\n // Always call hooks unconditionally in this component\n const routerNavigate = useRouterNavigate();\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n routerNavigate(fullPath);\n },\n [effectiveBasePath, routerNavigate]\n );\n\n const contextValue = useMemo<BotlitContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate: undefined,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n isStandalone: true,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n navigateTo,\n getPath,\n ]\n );\n\n return <BotlitContext.Provider value={contextValue}>{children}</BotlitContext.Provider>;\n};\n\n/** Provider for integrated mode (shell provides navigate) */\nconst IntegratedProviderInner: FC<\n PropsWithChildren<ProviderProps & { navigate: (path: string) => void }>\n> = ({\n children,\n basePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n}) => {\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n navigate(fullPath);\n },\n [effectiveBasePath, navigate]\n );\n\n const contextValue = useMemo<BotlitContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n isStandalone: false,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n navigateTo,\n getPath,\n ]\n );\n\n return <BotlitContext.Provider value={contextValue}>{children}</BotlitContext.Provider>;\n};\n\nexport const BotlitProvider: FC<PropsWithChildren<BotmanorRootProps>> = (props) => {\n const { children, navigate } = props;\n // Standalone mode: no navigate function provided (MFE manages its own router)\n // Integrated mode: navigate function provided by shell (shell provides router)\n const isStandalone = !navigate;\n\n // Standalone mode: wrap in MemoryRouter\n if (isStandalone) {\n return (\n <MemoryRouter>\n <StandaloneProviderInner {...props} isStandalone={true}>\n {children}\n </StandaloneProviderInner>\n </MemoryRouter>\n );\n }\n\n // Integrated mode: shell provides router\n return (\n <IntegratedProviderInner {...props} navigate={navigate} isStandalone={false}>\n {children}\n </IntegratedProviderInner>\n );\n};\n"],"mappings":";;;;;AA4BA,IAAMC,IAAgBC,EAAyC,IAAI;AAMnE,SAAgBC,IAAgC;CAC9C,IAAMC,IAAUC,EAAWJ,CAAa;CACxC,IAAI,CAACG,GACH,MAAU,MAAM,gDAAgD;CAElE,OAAOA;AACT;AAWA,IAAME,KAAiE,EACrE,aACA,aACA,gBACA,aACA,gBACA,kBACA,cACA,cACA,gBACA,uBACI;CAEJ,IAAMC,IAAiBP,EAAkB,GACnCS,IAAoBC,KAAY,KAEhCC,IAAUC,GACb,MAAyBC,EAASJ,GAAmBK,CAAY,GAClE,CAACL,CAAiB,CACpB,GAEMM,IAAaH,GAChB,MAAyB;EACxB,IAAMI,IAAWH,EAASJ,GAAmBK,CAAY;EACzD,EAAeE,CAAQ;CACzB,GACA,CAACP,GAAmBF,CAAc,CACpC,GAEMU,IAAeC,SACZ;EACL,UAAUT;EACV,UAAU,KAAA;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;CACF,IACA;EACEA;EACAU;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAX;EACAJ;CACF,CACF;CAEA,OAAO,kBAACV,EAAc,UAAf;EAAwB,OAAOgB;EAAe;CAAiC,CAAA;AACxF,GAGMU,KAED,EACH,aACA,aACA,aACA,gBACA,aACA,gBACA,kBACA,cACA,cACA,gBACA,uBACI;CACJ,IAAMlB,IAAoBC,KAAY,KAEhCC,IAAUC,GACb,MAAyBC,EAASJ,GAAmBK,CAAY,GAClE,CAACL,CAAiB,CACpB,GAEMM,IAAaH,GAChB,MAAyB;EAExB,EADiBC,EAASJ,GAAmBK,CACpC,CAAQ;CACnB,GACA,CAACL,GAAmBmB,CAAQ,CAC9B,GAEMX,IAAeC,SACZ;EACL,UAAUT;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;CACF,IACA;EACEA;EACAmB;EACAT;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAX;EACAJ;CACF,CACF;CAEA,OAAO,kBAACV,EAAc,UAAf;EAAwB,OAAOgB;EAAe;CAAiC,CAAA;AACxF,GAEaY,KAA4D,MAAU;CACjF,IAAM,EAAE,aAAU,gBAAaC;CAiB/B,OAdsBF,IAepB,kBAACD,GAAD;EAAyB,GAAIG;EAAiB;EAAU,cAAc;EACnE;CACsB,CAAA,IAZvB,kBAACC,GAAD,EAAA,UACE,kBAACzB,GAAD;EAAyB,GAAIwB;EAAO,cAAc;EAC/C;CACsB,CAAA,EACb,CAAA;AAUpB"}
@@ -0,0 +1,85 @@
1
+ import { BotSummary, AgentSummary, KnowledgeBaseSummary, Conversation, ViewMode, BotFilter, AgentFilter, BaseFilter } from '../types';
2
+ interface ConversationFilter extends BaseFilter {
3
+ botId?: string;
4
+ agentId?: string;
5
+ }
6
+ interface BotlitState {
7
+ viewMode: ViewMode;
8
+ sidebarCollapsed: boolean;
9
+ activeTab: string;
10
+ selectedBot: BotSummary | null;
11
+ selectedAgent: AgentSummary | null;
12
+ selectedKnowledgeBase: KnowledgeBaseSummary | null;
13
+ selectedConversation: Conversation | null;
14
+ botFilter: BotFilter;
15
+ agentFilter: AgentFilter;
16
+ conversationFilter: ConversationFilter;
17
+ isCreatingBot: boolean;
18
+ isCreatingAgent: boolean;
19
+ isUploadingDocument: boolean;
20
+ isChatOpen: boolean;
21
+ chatAgentId: string | null;
22
+ recentBots: string[];
23
+ recentAgents: string[];
24
+ recentConversations: string[];
25
+ setViewMode: (mode: ViewMode) => void;
26
+ toggleSidebar: () => void;
27
+ setActiveTab: (tab: string) => void;
28
+ setSelectedBot: (bot: BotSummary | null) => void;
29
+ setSelectedAgent: (agent: AgentSummary | null) => void;
30
+ setSelectedKnowledgeBase: (kb: KnowledgeBaseSummary | null) => void;
31
+ setSelectedConversation: (conversation: Conversation | null) => void;
32
+ updateBotFilter: (filter: Partial<BotFilter>) => void;
33
+ updateAgentFilter: (filter: Partial<AgentFilter>) => void;
34
+ updateConversationFilter: (filter: Partial<ConversationFilter>) => void;
35
+ resetFilters: () => void;
36
+ setIsCreatingBot: (value: boolean) => void;
37
+ setIsCreatingAgent: (value: boolean) => void;
38
+ setIsUploadingDocument: (value: boolean) => void;
39
+ openChat: (agentId: string) => void;
40
+ closeChat: () => void;
41
+ addRecentBot: (botId: string) => void;
42
+ addRecentAgent: (agentId: string) => void;
43
+ addRecentConversation: (conversationId: string) => void;
44
+ reset: () => void;
45
+ }
46
+ export declare const useBotlitStore: import('zustand').UseBoundStore<Omit<Omit<import('zustand').StoreApi<BotlitState>, "setState" | "devtools"> & {
47
+ setState(partial: BotlitState | Partial<BotlitState> | ((state: BotlitState) => BotlitState | Partial<BotlitState>), replace?: false | undefined, action?: (string | {
48
+ [x: string]: unknown;
49
+ [x: number]: unknown;
50
+ [x: symbol]: unknown;
51
+ type: string;
52
+ }) | undefined): void;
53
+ setState(state: BotlitState | ((state: BotlitState) => BotlitState), replace: true, action?: (string | {
54
+ [x: string]: unknown;
55
+ [x: number]: unknown;
56
+ [x: symbol]: unknown;
57
+ type: string;
58
+ }) | undefined): void;
59
+ devtools: {
60
+ cleanup: () => void;
61
+ };
62
+ }, "setState" | "persist"> & {
63
+ setState(partial: BotlitState | Partial<BotlitState> | ((state: BotlitState) => BotlitState | Partial<BotlitState>), replace?: false | undefined, action?: (string | {
64
+ [x: string]: unknown;
65
+ [x: number]: unknown;
66
+ [x: symbol]: unknown;
67
+ type: string;
68
+ }) | undefined): unknown;
69
+ setState(state: BotlitState | ((state: BotlitState) => BotlitState), replace: true, action?: (string | {
70
+ [x: string]: unknown;
71
+ [x: number]: unknown;
72
+ [x: symbol]: unknown;
73
+ type: string;
74
+ }) | undefined): unknown;
75
+ persist: {
76
+ setOptions: (options: Partial<import('zustand/middleware').PersistOptions<BotlitState, unknown, unknown>>) => void;
77
+ clearStorage: () => void;
78
+ rehydrate: () => Promise<void> | void;
79
+ hasHydrated: () => boolean;
80
+ onHydrate: (fn: (state: BotlitState) => void) => () => void;
81
+ onFinishHydration: (fn: (state: BotlitState) => void) => () => void;
82
+ getOptions: () => Partial<import('zustand/middleware').PersistOptions<BotlitState, unknown, unknown>>;
83
+ };
84
+ }>;
85
+ export {};
@@ -2,7 +2,7 @@ import { withRenamedKey as e } from "./renamedKeyStorage.js";
2
2
  import { create as t } from "zustand";
3
3
  import { devtools as n, persist as r } from "zustand/middleware";
4
4
  import { createProfileScopedStorage as i } from "@burdenoff/fe-libs/shared/utils";
5
- //#region src/botlit/store/botlitStore.ts
5
+ // src/botlit/store/botlitStore.ts
6
6
  var a = {
7
7
  viewMode: "grid",
8
8
  sidebarCollapsed: !1,
@@ -96,7 +96,6 @@ var a = {
96
96
  name: "BotManor Store",
97
97
  enabled: !1
98
98
  }));
99
- //#endregion
100
99
  export { o as useBotlitStore };
101
100
 
102
101
  //# sourceMappingURL=botlitStore.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"botlitStore.js","names":[],"sources":["../../../src/botlit/store/botlitStore.ts"],"sourcesContent":["/**\n * BotManor Zustand Store\n * @module botlit/store\n */\n\nimport { create } from 'zustand';\nimport { devtools, persist } from 'zustand/middleware';\nimport { createProfileScopedStorage } from '@burdenoff/fe-libs/shared/utils';\nimport { withRenamedKey } from './renamedKeyStorage';\nimport type {\n BotSummary,\n AgentSummary,\n KnowledgeBaseSummary,\n Conversation,\n ViewMode,\n BotFilter,\n AgentFilter,\n BaseFilter,\n} from '../types';\n\n// ConversationFilter extends BaseFilter with conversation-specific fields\ninterface ConversationFilter extends BaseFilter {\n botId?: string;\n agentId?: string;\n}\n\n// ============================================================================\n// State Interface\n// ============================================================================\n\ninterface BotlitState {\n // View state\n viewMode: ViewMode;\n sidebarCollapsed: boolean;\n activeTab: string;\n\n // Selected entities\n selectedBot: BotSummary | null;\n selectedAgent: AgentSummary | null;\n selectedKnowledgeBase: KnowledgeBaseSummary | null;\n selectedConversation: Conversation | null;\n\n // Filters\n botFilter: BotFilter;\n agentFilter: AgentFilter;\n conversationFilter: ConversationFilter;\n\n // UI State\n isCreatingBot: boolean;\n isCreatingAgent: boolean;\n isUploadingDocument: boolean;\n isChatOpen: boolean;\n chatAgentId: string | null;\n\n // Recent items\n recentBots: string[];\n recentAgents: string[];\n recentConversations: string[];\n\n // Actions\n setViewMode: (mode: ViewMode) => void;\n toggleSidebar: () => void;\n setActiveTab: (tab: string) => void;\n\n setSelectedBot: (bot: BotSummary | null) => void;\n setSelectedAgent: (agent: AgentSummary | null) => void;\n setSelectedKnowledgeBase: (kb: KnowledgeBaseSummary | null) => void;\n setSelectedConversation: (conversation: Conversation | null) => void;\n\n updateBotFilter: (filter: Partial<BotFilter>) => void;\n updateAgentFilter: (filter: Partial<AgentFilter>) => void;\n updateConversationFilter: (filter: Partial<ConversationFilter>) => void;\n resetFilters: () => void;\n\n setIsCreatingBot: (value: boolean) => void;\n setIsCreatingAgent: (value: boolean) => void;\n setIsUploadingDocument: (value: boolean) => void;\n openChat: (agentId: string) => void;\n closeChat: () => void;\n\n addRecentBot: (botId: string) => void;\n addRecentAgent: (agentId: string) => void;\n addRecentConversation: (conversationId: string) => void;\n\n reset: () => void;\n}\n\n// ============================================================================\n// Initial State\n// ============================================================================\n\nconst initialState = {\n viewMode: 'grid' as ViewMode,\n sidebarCollapsed: false,\n activeTab: 'bots',\n\n selectedBot: null,\n selectedAgent: null,\n selectedKnowledgeBase: null,\n selectedConversation: null,\n\n botFilter: {\n search: '',\n status: undefined,\n sortBy: 'updatedAt' as const,\n sortOrder: 'desc' as const,\n },\n agentFilter: {\n search: '',\n appId: undefined,\n type: undefined,\n status: undefined,\n sortBy: 'updatedAt' as const,\n sortOrder: 'desc' as const,\n },\n conversationFilter: {\n search: '',\n botId: undefined,\n agentId: undefined,\n status: undefined,\n sortBy: 'updatedAt' as const,\n sortOrder: 'desc' as const,\n },\n\n isCreatingBot: false,\n isCreatingAgent: false,\n isUploadingDocument: false,\n isChatOpen: false,\n chatAgentId: null,\n\n recentBots: [] as string[],\n recentAgents: [] as string[],\n recentConversations: [] as string[],\n};\n\n// ============================================================================\n// Store\n// ============================================================================\n\nexport const useBotlitStore = create<BotlitState>()(\n devtools(\n persist(\n (set) => ({\n ...initialState,\n\n // View actions\n setViewMode: (mode) => set({ viewMode: mode }),\n toggleSidebar: () => set((state) => ({ sidebarCollapsed: !state.sidebarCollapsed })),\n setActiveTab: (tab) => set({ activeTab: tab }),\n\n // Selection actions\n setSelectedBot: (bot) => set({ selectedBot: bot }),\n setSelectedAgent: (agent) => set({ selectedAgent: agent }),\n setSelectedKnowledgeBase: (kb) => set({ selectedKnowledgeBase: kb }),\n setSelectedConversation: (conversation) => set({ selectedConversation: conversation }),\n\n // Filter actions\n updateBotFilter: (filter) =>\n set((state) => ({\n botFilter: { ...state.botFilter, ...filter },\n })),\n updateAgentFilter: (filter) =>\n set((state) => ({\n agentFilter: { ...state.agentFilter, ...filter },\n })),\n updateConversationFilter: (filter) =>\n set((state) => ({\n conversationFilter: { ...state.conversationFilter, ...filter },\n })),\n resetFilters: () =>\n set({\n botFilter: initialState.botFilter,\n agentFilter: initialState.agentFilter,\n conversationFilter: initialState.conversationFilter,\n }),\n\n // UI state actions\n setIsCreatingBot: (value) => set({ isCreatingBot: value }),\n setIsCreatingAgent: (value) => set({ isCreatingAgent: value }),\n setIsUploadingDocument: (value) => set({ isUploadingDocument: value }),\n openChat: (agentId) => set({ isChatOpen: true, chatAgentId: agentId }),\n closeChat: () => set({ isChatOpen: false, chatAgentId: null }),\n\n // Recent items actions\n addRecentBot: (botId) =>\n set((state) => ({\n recentBots: [botId, ...state.recentBots.filter((id) => id !== botId)].slice(0, 10),\n })),\n addRecentAgent: (agentId) =>\n set((state) => ({\n recentAgents: [agentId, ...state.recentAgents.filter((id) => id !== agentId)].slice(\n 0,\n 10\n ),\n })),\n addRecentConversation: (conversationId) =>\n set((state) => ({\n recentConversations: [\n conversationId,\n ...state.recentConversations.filter((id) => id !== conversationId),\n ].slice(0, 10),\n })),\n\n // Reset\n reset: () => set(initialState),\n }),\n {\n name: 'burdenoff-botmanor-storage',\n // Renamed from the Botlit-era key; saved UI state moves over on first load.\n storage: withRenamedKey(createProfileScopedStorage(), 'burdenoff-botlit-storage'),\n partialize: (state) => ({\n viewMode: state.viewMode,\n sidebarCollapsed: state.sidebarCollapsed,\n recentBots: state.recentBots,\n recentAgents: state.recentAgents,\n recentConversations: state.recentConversations,\n }),\n }\n ),\n { name: 'BotManor Store', enabled: import.meta.env?.DEV === true }\n )\n);\n"],"mappings":";;;;;AA2FA,IAAM,IAAe;CACnB,UAAU;CACV,kBAAkB;CAClB,WAAW;CAEX,aAAa;CACb,eAAe;CACf,uBAAuB;CACvB,sBAAsB;CAEtB,WAAW;EACT,QAAQ;EACR,QAAQ,KAAA;EACR,QAAQ;EACR,WAAW;EACZ;CACD,aAAa;EACX,QAAQ;EACR,OAAO,KAAA;EACP,MAAM,KAAA;EACN,QAAQ,KAAA;EACR,QAAQ;EACR,WAAW;EACZ;CACD,oBAAoB;EAClB,QAAQ;EACR,OAAO,KAAA;EACP,SAAS,KAAA;EACT,QAAQ,KAAA;EACR,QAAQ;EACR,WAAW;EACZ;CAED,eAAe;CACf,iBAAiB;CACjB,qBAAqB;CACrB,YAAY;CACZ,aAAa;CAEb,YAAY,EAAE;CACd,cAAc,EAAE;CAChB,qBAAqB,EAAE;CACxB,EAMY,IAAiB,GAAqB,CACjD,EACE,GACG,OAAS;CACR,GAAG;CAGH,cAAc,MAAS,EAAI,EAAE,UAAU,GAAM,CAAC;CAC9C,qBAAqB,GAAK,OAAW,EAAE,kBAAkB,CAAC,EAAM,kBAAkB,EAAE;CACpF,eAAe,MAAQ,EAAI,EAAE,WAAW,GAAK,CAAC;CAG9C,iBAAiB,MAAQ,EAAI,EAAE,aAAa,GAAK,CAAC;CAClD,mBAAmB,MAAU,EAAI,EAAE,eAAe,GAAO,CAAC;CAC1D,2BAA2B,MAAO,EAAI,EAAE,uBAAuB,GAAI,CAAC;CACpE,0BAA0B,MAAiB,EAAI,EAAE,sBAAsB,GAAc,CAAC;CAGtF,kBAAkB,MAChB,GAAK,OAAW,EACd,WAAW;EAAE,GAAG,EAAM;EAAW,GAAG;EAAQ,EAC7C,EAAE;CACL,oBAAoB,MAClB,GAAK,OAAW,EACd,aAAa;EAAE,GAAG,EAAM;EAAa,GAAG;EAAQ,EACjD,EAAE;CACL,2BAA2B,MACzB,GAAK,OAAW,EACd,oBAAoB;EAAE,GAAG,EAAM;EAAoB,GAAG;EAAQ,EAC/D,EAAE;CACL,oBACE,EAAI;EACF,WAAW,EAAa;EACxB,aAAa,EAAa;EAC1B,oBAAoB,EAAa;EAClC,CAAC;CAGJ,mBAAmB,MAAU,EAAI,EAAE,eAAe,GAAO,CAAC;CAC1D,qBAAqB,MAAU,EAAI,EAAE,iBAAiB,GAAO,CAAC;CAC9D,yBAAyB,MAAU,EAAI,EAAE,qBAAqB,GAAO,CAAC;CACtE,WAAW,MAAY,EAAI;EAAE,YAAY;EAAM,aAAa;EAAS,CAAC;CACtE,iBAAiB,EAAI;EAAE,YAAY;EAAO,aAAa;EAAM,CAAC;CAG9D,eAAe,MACb,GAAK,OAAW,EACd,YAAY,CAAC,GAAO,GAAG,EAAM,WAAW,QAAQ,MAAO,MAAO,EAAM,CAAC,CAAC,MAAM,GAAG,GAAG,EACnF,EAAE;CACL,iBAAiB,MACf,GAAK,OAAW,EACd,cAAc,CAAC,GAAS,GAAG,EAAM,aAAa,QAAQ,MAAO,MAAO,EAAQ,CAAC,CAAC,MAC5E,GACA,GACD,EACF,EAAE;CACL,wBAAwB,MACtB,GAAK,OAAW,EACd,qBAAqB,CACnB,GACA,GAAG,EAAM,oBAAoB,QAAQ,MAAO,MAAO,EAAe,CACnE,CAAC,MAAM,GAAG,GAAG,EACf,EAAE;CAGL,aAAa,EAAI,EAAa;CAC/B,GACD;CACE,MAAM;CAEN,SAAS,EAAe,GAA4B,EAAE,2BAA2B;CACjF,aAAa,OAAW;EACtB,UAAU,EAAM;EAChB,kBAAkB,EAAM;EACxB,YAAY,EAAM;EAClB,cAAc,EAAM;EACpB,qBAAqB,EAAM;EAC5B;CACF,CACF,EACD;CAAE,MAAM;CAAkB,SAAS;CAA+B,CACnE,CACF"}
1
+ {"version":3,"file":"botlitStore.js","names":["initialState","useBotlitStore","create","devtools","persist","set","mode","state","tab","bot","agent","kb","conversation","filter","value","agentId","botId","id","conversationId","withRenamedKey","createProfileScopedStorage"],"sources":["../../../src/botlit/store/botlitStore.ts"],"sourcesContent":["/**\n * BotManor Zustand Store\n * @module botlit/store\n */\n\nimport { create } from 'zustand';\nimport { devtools, persist } from 'zustand/middleware';\nimport { createProfileScopedStorage } from '@burdenoff/fe-libs/shared/utils';\nimport { withRenamedKey } from './renamedKeyStorage';\nimport type {\n BotSummary,\n AgentSummary,\n KnowledgeBaseSummary,\n Conversation,\n ViewMode,\n BotFilter,\n AgentFilter,\n BaseFilter,\n} from '../types';\n\n// ConversationFilter extends BaseFilter with conversation-specific fields\ninterface ConversationFilter extends BaseFilter {\n botId?: string;\n agentId?: string;\n}\n\n// ============================================================================\n// State Interface\n// ============================================================================\n\ninterface BotlitState {\n // View state\n viewMode: ViewMode;\n sidebarCollapsed: boolean;\n activeTab: string;\n\n // Selected entities\n selectedBot: BotSummary | null;\n selectedAgent: AgentSummary | null;\n selectedKnowledgeBase: KnowledgeBaseSummary | null;\n selectedConversation: Conversation | null;\n\n // Filters\n botFilter: BotFilter;\n agentFilter: AgentFilter;\n conversationFilter: ConversationFilter;\n\n // UI State\n isCreatingBot: boolean;\n isCreatingAgent: boolean;\n isUploadingDocument: boolean;\n isChatOpen: boolean;\n chatAgentId: string | null;\n\n // Recent items\n recentBots: string[];\n recentAgents: string[];\n recentConversations: string[];\n\n // Actions\n setViewMode: (mode: ViewMode) => void;\n toggleSidebar: () => void;\n setActiveTab: (tab: string) => void;\n\n setSelectedBot: (bot: BotSummary | null) => void;\n setSelectedAgent: (agent: AgentSummary | null) => void;\n setSelectedKnowledgeBase: (kb: KnowledgeBaseSummary | null) => void;\n setSelectedConversation: (conversation: Conversation | null) => void;\n\n updateBotFilter: (filter: Partial<BotFilter>) => void;\n updateAgentFilter: (filter: Partial<AgentFilter>) => void;\n updateConversationFilter: (filter: Partial<ConversationFilter>) => void;\n resetFilters: () => void;\n\n setIsCreatingBot: (value: boolean) => void;\n setIsCreatingAgent: (value: boolean) => void;\n setIsUploadingDocument: (value: boolean) => void;\n openChat: (agentId: string) => void;\n closeChat: () => void;\n\n addRecentBot: (botId: string) => void;\n addRecentAgent: (agentId: string) => void;\n addRecentConversation: (conversationId: string) => void;\n\n reset: () => void;\n}\n\n// ============================================================================\n// Initial State\n// ============================================================================\n\nconst initialState = {\n viewMode: 'grid' as ViewMode,\n sidebarCollapsed: false,\n activeTab: 'bots',\n\n selectedBot: null,\n selectedAgent: null,\n selectedKnowledgeBase: null,\n selectedConversation: null,\n\n botFilter: {\n search: '',\n status: undefined,\n sortBy: 'updatedAt' as const,\n sortOrder: 'desc' as const,\n },\n agentFilter: {\n search: '',\n appId: undefined,\n type: undefined,\n status: undefined,\n sortBy: 'updatedAt' as const,\n sortOrder: 'desc' as const,\n },\n conversationFilter: {\n search: '',\n botId: undefined,\n agentId: undefined,\n status: undefined,\n sortBy: 'updatedAt' as const,\n sortOrder: 'desc' as const,\n },\n\n isCreatingBot: false,\n isCreatingAgent: false,\n isUploadingDocument: false,\n isChatOpen: false,\n chatAgentId: null,\n\n recentBots: [] as string[],\n recentAgents: [] as string[],\n recentConversations: [] as string[],\n};\n\n// ============================================================================\n// Store\n// ============================================================================\n\nexport const useBotlitStore = create<BotlitState>()(\n devtools(\n persist(\n (set) => ({\n ...initialState,\n\n // View actions\n setViewMode: (mode) => set({ viewMode: mode }),\n toggleSidebar: () => set((state) => ({ sidebarCollapsed: !state.sidebarCollapsed })),\n setActiveTab: (tab) => set({ activeTab: tab }),\n\n // Selection actions\n setSelectedBot: (bot) => set({ selectedBot: bot }),\n setSelectedAgent: (agent) => set({ selectedAgent: agent }),\n setSelectedKnowledgeBase: (kb) => set({ selectedKnowledgeBase: kb }),\n setSelectedConversation: (conversation) => set({ selectedConversation: conversation }),\n\n // Filter actions\n updateBotFilter: (filter) =>\n set((state) => ({\n botFilter: { ...state.botFilter, ...filter },\n })),\n updateAgentFilter: (filter) =>\n set((state) => ({\n agentFilter: { ...state.agentFilter, ...filter },\n })),\n updateConversationFilter: (filter) =>\n set((state) => ({\n conversationFilter: { ...state.conversationFilter, ...filter },\n })),\n resetFilters: () =>\n set({\n botFilter: initialState.botFilter,\n agentFilter: initialState.agentFilter,\n conversationFilter: initialState.conversationFilter,\n }),\n\n // UI state actions\n setIsCreatingBot: (value) => set({ isCreatingBot: value }),\n setIsCreatingAgent: (value) => set({ isCreatingAgent: value }),\n setIsUploadingDocument: (value) => set({ isUploadingDocument: value }),\n openChat: (agentId) => set({ isChatOpen: true, chatAgentId: agentId }),\n closeChat: () => set({ isChatOpen: false, chatAgentId: null }),\n\n // Recent items actions\n addRecentBot: (botId) =>\n set((state) => ({\n recentBots: [botId, ...state.recentBots.filter((id) => id !== botId)].slice(0, 10),\n })),\n addRecentAgent: (agentId) =>\n set((state) => ({\n recentAgents: [agentId, ...state.recentAgents.filter((id) => id !== agentId)].slice(\n 0,\n 10\n ),\n })),\n addRecentConversation: (conversationId) =>\n set((state) => ({\n recentConversations: [\n conversationId,\n ...state.recentConversations.filter((id) => id !== conversationId),\n ].slice(0, 10),\n })),\n\n // Reset\n reset: () => set(initialState),\n }),\n {\n name: 'burdenoff-botmanor-storage',\n // Renamed from the Botlit-era key; saved UI state moves over on first load.\n storage: withRenamedKey(createProfileScopedStorage(), 'burdenoff-botlit-storage'),\n partialize: (state) => ({\n viewMode: state.viewMode,\n sidebarCollapsed: state.sidebarCollapsed,\n recentBots: state.recentBots,\n recentAgents: state.recentAgents,\n recentConversations: state.recentConversations,\n }),\n }\n ),\n { name: 'BotManor Store', enabled: import.meta.env?.DEV === true }\n )\n);\n"],"mappings":";;;;;AA2FA,IAAMA,IAAe;CACnB,UAAU;CACV,kBAAkB;CAClB,WAAW;CAEX,aAAa;CACb,eAAe;CACf,uBAAuB;CACvB,sBAAsB;CAEtB,WAAW;EACT,QAAQ;EACR,QAAQ,KAAA;EACR,QAAQ;EACR,WAAW;CACb;CACA,aAAa;EACX,QAAQ;EACR,OAAO,KAAA;EACP,MAAM,KAAA;EACN,QAAQ,KAAA;EACR,QAAQ;EACR,WAAW;CACb;CACA,oBAAoB;EAClB,QAAQ;EACR,OAAO,KAAA;EACP,SAAS,KAAA;EACT,QAAQ,KAAA;EACR,QAAQ;EACR,WAAW;CACb;CAEA,eAAe;CACf,iBAAiB;CACjB,qBAAqB;CACrB,YAAY;CACZ,aAAa;CAEb,YAAY,CAAC;CACb,cAAc,CAAC;CACf,qBAAqB,CAAC;AACxB,GAMaC,IAAiBC,EAAoB,CAAC,CACjDC,EACEC,GACG,OAAS;CACR,GAAGJ;CAGH,cAAc,MAASK,EAAI,EAAE,UAAUC,EAAK,CAAC;CAC7C,qBAAqBD,GAAK,OAAW,EAAE,kBAAkB,CAACE,EAAM,iBAAiB,EAAE;CACnF,eAAe,MAAQF,EAAI,EAAE,WAAWG,EAAI,CAAC;CAG7C,iBAAiB,MAAQH,EAAI,EAAE,aAAaI,EAAI,CAAC;CACjD,mBAAmB,MAAUJ,EAAI,EAAE,eAAeK,EAAM,CAAC;CACzD,2BAA2B,MAAOL,EAAI,EAAE,uBAAuBM,EAAG,CAAC;CACnE,0BAA0B,MAAiBN,EAAI,EAAE,sBAAsBO,EAAa,CAAC;CAGrF,kBAAkB,MAChBP,GAAK,OAAW,EACd,WAAW;EAAE,GAAGE,EAAM;EAAW,GAAGM;CAAO,EAC7C,EAAE;CACJ,oBAAoB,MAClBR,GAAK,OAAW,EACd,aAAa;EAAE,GAAGE,EAAM;EAAa,GAAGM;CAAO,EACjD,EAAE;CACJ,2BAA2B,MACzBR,GAAK,OAAW,EACd,oBAAoB;EAAE,GAAGE,EAAM;EAAoB,GAAGM;CAAO,EAC/D,EAAE;CACJ,oBACER,EAAI;EACF,WAAWL,EAAa;EACxB,aAAaA,EAAa;EAC1B,oBAAoBA,EAAa;CACnC,CAAC;CAGH,mBAAmB,MAAUK,EAAI,EAAE,eAAeS,EAAM,CAAC;CACzD,qBAAqB,MAAUT,EAAI,EAAE,iBAAiBS,EAAM,CAAC;CAC7D,yBAAyB,MAAUT,EAAI,EAAE,qBAAqBS,EAAM,CAAC;CACrE,WAAW,MAAYT,EAAI;EAAE,YAAY;EAAM,aAAaU;CAAQ,CAAC;CACrE,iBAAiBV,EAAI;EAAE,YAAY;EAAO,aAAa;CAAK,CAAC;CAG7D,eAAe,MACbA,GAAK,OAAW,EACd,YAAY,CAACW,GAAO,GAAGT,EAAM,WAAW,QAAQ,MAAOU,MAAOD,CAAK,CAAC,CAAC,CAAC,MAAM,GAAG,EAAE,EACnF,EAAE;CACJ,iBAAiB,MACfX,GAAK,OAAW,EACd,cAAc,CAACU,GAAS,GAAGR,EAAM,aAAa,QAAQ,MAAOU,MAAOF,CAAO,CAAC,CAAC,CAAC,MAC5E,GACA,EACF,EACF,EAAE;CACJ,wBAAwB,MACtBV,GAAK,OAAW,EACd,qBAAqB,CACnBa,GACA,GAAGX,EAAM,oBAAoB,QAAQ,MAAOU,MAAOC,CAAc,CACnE,CAAC,CAAC,MAAM,GAAG,EAAE,EACf,EAAE;CAGJ,aAAab,EAAIL,CAAY;AAC/B,IACA;CACE,MAAM;CAEN,SAASmB,EAAeC,EAA2B,GAAG,0BAA0B;CAChF,aAAa,OAAW;EACtB,UAAUb,EAAM;EAChB,kBAAkBA,EAAM;EACxB,YAAYA,EAAM;EAClB,cAAcA,EAAM;EACpB,qBAAqBA,EAAM;CAC7B;AACF,CACF,GACA;CAAE,MAAM;CAAkB,SAAS;AAA8B,CACnE,CACF"}
@@ -0,0 +1,13 @@
1
+ import { PersistStorage } from 'zustand/middleware';
2
+ /**
3
+ * Wrap a persist storage so a store renamed from `legacyName` keeps its
4
+ * saved state. On a read that finds nothing under the new name, the value
5
+ * under `legacyName` is copied to the new name and the legacy entry is
6
+ * removed, so the move happens once, on first load. Writes and removals go
7
+ * to the new name only (removals also clear any legacy leftover).
8
+ *
9
+ * Used for the Botlit -> BotManor rename (`burdenoff-botlit-storage` ->
10
+ * `burdenoff-botmanor-storage`); the wrapped storage keeps its own profile
11
+ * scoping, so each profile's entry moves independently.
12
+ */
13
+ export declare function withRenamedKey<S>(inner: PersistStorage<S> | undefined, legacyName: string): PersistStorage<S> | undefined;
@@ -1,4 +1,4 @@
1
- //#region src/botlit/store/renamedKeyStorage.ts
1
+ // src/botlit/store/renamedKeyStorage.ts
2
2
  function e(e, t) {
3
3
  return e instanceof Promise ? e.then(t) : t(e);
4
4
  }
@@ -9,7 +9,6 @@ function t(t, n) {
9
9
  removeItem: (r) => e(t.removeItem(r), () => r === n ? void 0 : t.removeItem(n))
10
10
  };
11
11
  }
12
- //#endregion
13
12
  export { t as withRenamedKey };
14
13
 
15
14
  //# sourceMappingURL=renamedKeyStorage.js.map