@burdenoff/microfe-botmanor 2026.1106.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 +40 -37
  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 +253 -0
  15. package/dist/botlit/components/AiOperationsPanel.js.map +1 -0
  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 +2 -3
  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 -13
  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 +154 -0
  90. package/dist/botlit/hooks/useAiOperations.js.map +1 -0
  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 +202 -190
  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 +165 -0
  173. package/dist/botlit/pages/AiOperationsPage.js.map +1 -0
  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 +246 -237
  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 +172 -75
  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 +6 -5
  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
@@ -1,10 +1,10 @@
1
- import { buildMutationInput as e, fieldsOf as t } from "./internal/mutationInput.js";
2
- import { CreatePromptTemplateDocument as n, DeletePromptTemplateDocument as r, GetPromptTemplateDocument as i, ListPromptTemplatesDocument as a, RenderPromptTemplateDocument as o, UpdatePromptTemplateDocument as s } from "../../generated/wspace-operations.js";
3
- import { useWorkspaceId as c, useWorkspaceMutation as l, useWorkspaceQuery as u } from "./internal/workspaceGateway.js";
4
- import { jsonRecords as d } from "../utils/unions.js";
1
+ import { CreatePromptTemplateDocument as e, DeletePromptTemplateDocument as t, GetPromptTemplateDocument as n, ListPromptTemplatesDocument as r, RenderPromptTemplateDocument as i, UpdatePromptTemplateDocument as a } from "../../generated/wspace-operations.js";
2
+ import { jsonRecords as o } from "../utils/unions.js";
3
+ import { buildMutationInput as s, fieldsOf as c } from "./internal/mutationInput.js";
4
+ import { useWorkspaceId as l, useWorkspaceMutation as u, useWorkspaceQuery as d } from "./internal/workspaceGateway.js";
5
5
  import { useCallback as f, useMemo as p } from "react";
6
- //#region src/botlit/hooks/usePromptTemplates.ts
7
- var m = 100, h = t({
6
+ // src/botlit/hooks/usePromptTemplates.ts
7
+ var m = 100, h = c({
8
8
  bucketId: !0,
9
9
  description: !0,
10
10
  exampleInputs: !0,
@@ -18,7 +18,7 @@ var m = 100, h = t({
18
18
  version: !0,
19
19
  visibility: !0,
20
20
  workspaceId: !0
21
- }), g = t({
21
+ }), g = c({
22
22
  bucketId: !0,
23
23
  description: !0,
24
24
  exampleInputs: !0,
@@ -39,7 +39,7 @@ var m = 100, h = t({
39
39
  "object"
40
40
  ];
41
41
  function y(e) {
42
- return d(e.variables).map((e, t) => ({
42
+ return o(e.variables).map((e, t) => ({
43
43
  name: typeof e.name == "string" ? e.name : `variable_${t + 1}`,
44
44
  type: v.find((t) => typeof e.type == "string" && t === e.type) ?? "string",
45
45
  required: e.required === !0,
@@ -48,36 +48,36 @@ function y(e) {
48
48
  }));
49
49
  }
50
50
  function b(e) {
51
- return d(e.exampleInputs);
51
+ return o(e.exampleInputs);
52
52
  }
53
53
  function x(e) {
54
54
  return e?.listPromptTemplates ?? _;
55
55
  }
56
56
  function S(e) {
57
- let t = c(), { search: n, status: r, visibility: i, bucketId: o } = e ?? {}, s = e?.tags?.join(",") ?? "";
58
- return u({
59
- document: a,
60
- variables: p(() => ({
61
- filters: {
62
- workspaceId: t,
63
- search: n || void 0,
64
- status: r,
65
- visibility: i,
66
- bucketId: o,
67
- tags: s ? s.split(",") : void 0
68
- },
69
- pagination: {
70
- limit: m,
71
- offset: 0
72
- }
73
- }), [
74
- t,
75
- n,
76
- r,
77
- i,
78
- o,
79
- s
80
- ]),
57
+ let t = l(), { search: n, status: i, visibility: a, bucketId: o } = e ?? {}, s = e?.tags?.join(",") ?? "", c = p(() => ({
58
+ filters: {
59
+ workspaceId: t,
60
+ search: n || void 0,
61
+ status: i,
62
+ visibility: a,
63
+ bucketId: o,
64
+ tags: s ? s.split(",") : void 0
65
+ },
66
+ pagination: {
67
+ limit: m,
68
+ offset: 0
69
+ }
70
+ }), [
71
+ t,
72
+ n,
73
+ i,
74
+ a,
75
+ o,
76
+ s
77
+ ]);
78
+ return d({
79
+ document: r,
80
+ variables: c,
81
81
  select: x,
82
82
  fallback: _,
83
83
  enabled: !!t,
@@ -85,9 +85,10 @@ function S(e) {
85
85
  });
86
86
  }
87
87
  function C(e) {
88
- return u({
89
- document: i,
90
- variables: p(() => ({ id: e ?? "" }), [e]),
88
+ let t = p(() => ({ id: e ?? "" }), [e]);
89
+ return d({
90
+ document: n,
91
+ variables: t,
91
92
  select: (e) => e?.getPromptTemplate ?? null,
92
93
  fallback: null,
93
94
  enabled: !!e,
@@ -95,12 +96,12 @@ function C(e) {
95
96
  });
96
97
  }
97
98
  function w() {
98
- let t = c(), [r, i] = l({
99
- document: n,
100
- variables: f((n) => ({ input: e({
101
- ...n,
102
- workspaceId: t
103
- }, h) }), [t]),
99
+ let t = l(), n = f((e) => ({ input: s({
100
+ ...e,
101
+ workspaceId: t
102
+ }, h) }), [t]), [r, i] = u({
103
+ document: e,
104
+ variables: n,
104
105
  select: (e) => e?.createPromptTemplate,
105
106
  errorMessage: "Failed to create prompt template"
106
107
  });
@@ -111,37 +112,37 @@ function w() {
111
112
  };
112
113
  }
113
114
  function T() {
114
- let [t, n] = l({
115
- document: s,
116
- variables: ({ templateId: t, input: n }) => ({
117
- id: t,
118
- input: e(n, g)
115
+ let [e, t] = u({
116
+ document: a,
117
+ variables: ({ templateId: e, input: t }) => ({
118
+ id: e,
119
+ input: s(t, g)
119
120
  }),
120
121
  select: (e) => e?.updatePromptTemplate,
121
122
  errorMessage: "Failed to update prompt template"
122
123
  });
123
124
  return {
124
- update: t,
125
- loading: n.loading,
126
- error: n.error
125
+ update: e,
126
+ loading: t.loading,
127
+ error: t.error
127
128
  };
128
129
  }
129
130
  function E() {
130
- let [e, t] = l({
131
- document: r,
131
+ let [e, n] = u({
132
+ document: t,
132
133
  variables: (e) => ({ id: e }),
133
134
  select: (e) => e?.deletePromptTemplate,
134
135
  errorMessage: "Failed to delete prompt template"
135
136
  });
136
137
  return {
137
138
  remove: e,
138
- loading: t.loading,
139
- error: t.error
139
+ loading: n.loading,
140
+ error: n.error
140
141
  };
141
142
  }
142
143
  function D() {
143
- let [e, t] = l({
144
- document: o,
144
+ let [e, t] = u({
145
+ document: i,
145
146
  variables: ({ templateId: e, variables: t }) => ({
146
147
  id: e,
147
148
  variables: t
@@ -155,7 +156,6 @@ function D() {
155
156
  error: t.error
156
157
  };
157
158
  }
158
- //#endregion
159
159
  export { b as promptTemplateExamples, y as promptTemplateVariables, w as useCreatePromptTemplate, E as useDeletePromptTemplate, C as usePromptTemplate, S as usePromptTemplates, D as useRenderPromptTemplate, T as useUpdatePromptTemplate };
160
160
 
161
161
  //# sourceMappingURL=usePromptTemplates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePromptTemplates.js","names":[],"sources":["../../../src/botlit/hooks/usePromptTemplates.ts"],"sourcesContent":["/**\n * Prompt Templates Hooks\n * @module botlit/hooks\n *\n * Backed by the live `listPromptTemplates` / `getPromptTemplate` operations and\n * the create/update/delete/render mutations on wspace-botlit-svc.\n */\n\nimport { useCallback, useMemo } from 'react';\nimport {\n CreatePromptTemplateDocument,\n DeletePromptTemplateDocument,\n GetPromptTemplateDocument,\n ListPromptTemplatesDocument,\n RenderPromptTemplateDocument,\n UpdatePromptTemplateDocument,\n type CreatePromptTemplateMutation,\n type DeletePromptTemplateMutation,\n type GetPromptTemplateQuery,\n type ListPromptTemplatesQuery,\n type RenderPromptTemplateMutation,\n type UpdatePromptTemplateMutation,\n} from '../../generated/wspace-operations';\nimport type {\n CreatePromptTemplateInput,\n UpdatePromptTemplateInput,\n} from '../../generated/wspace-types';\nimport { jsonRecords } from '../utils/unions';\nimport { buildMutationInput, fieldsOf, type GraphQLInput } from './internal/mutationInput';\nimport {\n useWorkspaceId,\n useWorkspaceMutation,\n useWorkspaceQuery,\n type QueryResult,\n} from './internal/workspaceGateway';\n\nconst LIST_LIMIT = 100;\n\nexport interface PromptTemplateRecord {\n id: string;\n name: string;\n slug: string;\n version: string;\n templateText: string;\n status: string;\n visibility: string;\n description?: string | null;\n bucketId?: string | null;\n /** Free-form JSON — the UI stores an array of `PromptVariable` here. */\n variables: Record<string, unknown> | unknown[];\n exampleInputs: Record<string, unknown> | unknown[];\n metadata?: Record<string, unknown> | null;\n revision: number;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n createdById: string;\n updatedById: string;\n workspaceId: string;\n}\n\nexport interface PromptTemplateFilterVariables {\n search?: string;\n status?: string;\n visibility?: string;\n bucketId?: string;\n tags?: string[];\n}\n\n/** `CreatePromptTemplateInput` minus the `workspaceId` the hook supplies. */\nexport type CreatePromptTemplateVariables = Omit<\n GraphQLInput<CreatePromptTemplateInput>,\n 'workspaceId'\n>;\n\nexport interface UpdatePromptTemplateVariables {\n templateId: string;\n input: GraphQLInput<UpdatePromptTemplateInput>;\n}\n\nconst CREATE_TEMPLATE_FIELDS = fieldsOf<CreatePromptTemplateInput>({\n bucketId: true,\n description: true,\n exampleInputs: true,\n metadata: true,\n name: true,\n slug: true,\n status: true,\n tags: true,\n templateText: true,\n variables: true,\n version: true,\n visibility: true,\n workspaceId: true,\n});\n\nconst UPDATE_TEMPLATE_FIELDS = fieldsOf<UpdatePromptTemplateInput>({\n bucketId: true,\n description: true,\n exampleInputs: true,\n metadata: true,\n name: true,\n slug: true,\n status: true,\n tags: true,\n templateText: true,\n variables: true,\n version: true,\n visibility: true,\n});\n\nexport interface RenderPromptTemplateVariables {\n templateId: string;\n variables?: Record<string, unknown>;\n}\n\nconst NO_TEMPLATES: PromptTemplateRecord[] = [];\n\n/** The variable types the editor offers; anything else falls back to `string`. */\nconst VARIABLE_TYPES: PromptVariableType[] = ['string', 'number', 'boolean', 'array', 'object'];\n\nexport type PromptVariableType = 'string' | 'number' | 'boolean' | 'array' | 'object';\n\n/**\n * One declared template variable. `variables` is a free-form `JSON` column, so\n * a template whose variables were written by another client (or stored as an\n * object rather than an array) must still render.\n */\nexport interface PromptTemplateVariable {\n name: string;\n type: PromptVariableType;\n required: boolean;\n description?: string;\n defaultValue?: unknown;\n}\n\n/** The template's declared variables, normalised for rendering. */\nexport function promptTemplateVariables(\n template: Pick<PromptTemplateRecord, 'variables'>\n): PromptTemplateVariable[] {\n return jsonRecords(template.variables).map((variable, index) => ({\n name: typeof variable.name === 'string' ? variable.name : `variable_${index + 1}`,\n type:\n VARIABLE_TYPES.find(\n (candidate) => typeof variable.type === 'string' && candidate === variable.type\n ) ?? 'string',\n required: variable.required === true,\n description: typeof variable.description === 'string' ? variable.description : undefined,\n defaultValue: variable.defaultValue,\n }));\n}\n\n/** The template's example input sets, normalised for rendering. */\nexport function promptTemplateExamples(\n template: Pick<PromptTemplateRecord, 'exampleInputs'>\n): Record<string, unknown>[] {\n return jsonRecords(template.exampleInputs);\n}\n\nfunction selectTemplates(data: ListPromptTemplatesQuery | undefined): PromptTemplateRecord[] {\n return data?.listPromptTemplates ?? NO_TEMPLATES;\n}\n\nexport const promptTemplateKeys = {\n all: ['promptTemplates'] as const,\n lists: () => [...promptTemplateKeys.all, 'list'] as const,\n list: (filter?: PromptTemplateFilterVariables) =>\n [...promptTemplateKeys.lists(), filter] as const,\n details: () => [...promptTemplateKeys.all, 'detail'] as const,\n detail: (id: string) => [...promptTemplateKeys.details(), id] as const,\n};\n\nexport function usePromptTemplates(\n filter?: PromptTemplateFilterVariables\n): QueryResult<PromptTemplateRecord[]> {\n const workspaceId = useWorkspaceId();\n const { search, status, visibility, bucketId } = filter ?? {};\n const tagsKey = filter?.tags?.join(',') ?? '';\n\n const variables = useMemo(\n () => ({\n filters: {\n workspaceId,\n search: search || undefined,\n status,\n visibility,\n bucketId,\n tags: tagsKey ? tagsKey.split(',') : undefined,\n },\n pagination: { limit: LIST_LIMIT, offset: 0 },\n }),\n [workspaceId, search, status, visibility, bucketId, tagsKey]\n );\n\n return useWorkspaceQuery<ListPromptTemplatesQuery, PromptTemplateRecord[]>({\n document: ListPromptTemplatesDocument,\n variables,\n select: selectTemplates,\n fallback: NO_TEMPLATES,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load prompt templates',\n });\n}\n\nexport function usePromptTemplate(\n templateId: string | undefined\n): QueryResult<PromptTemplateRecord | null> {\n const variables = useMemo(() => ({ id: templateId ?? '' }), [templateId]);\n\n return useWorkspaceQuery<GetPromptTemplateQuery, PromptTemplateRecord | null>({\n document: GetPromptTemplateDocument,\n variables,\n select: (data) => data?.getPromptTemplate ?? null,\n fallback: null,\n enabled: Boolean(templateId),\n errorMessage: 'Failed to load prompt template',\n });\n}\n\nexport function useCreatePromptTemplate() {\n const workspaceId = useWorkspaceId();\n\n const variables = useCallback(\n (input: CreatePromptTemplateVariables) => ({\n input: buildMutationInput({ ...input, workspaceId }, CREATE_TEMPLATE_FIELDS),\n }),\n [workspaceId]\n );\n\n const [create, state] = useWorkspaceMutation<\n CreatePromptTemplateMutation,\n CreatePromptTemplateVariables,\n PromptTemplateRecord\n >({\n document: CreatePromptTemplateDocument,\n variables,\n select: (data) => data?.createPromptTemplate,\n errorMessage: 'Failed to create prompt template',\n });\n\n return { create, loading: state.loading, error: state.error };\n}\n\nexport function useUpdatePromptTemplate() {\n const [update, state] = useWorkspaceMutation<\n UpdatePromptTemplateMutation,\n UpdatePromptTemplateVariables,\n PromptTemplateRecord\n >({\n document: UpdatePromptTemplateDocument,\n variables: ({ templateId, input }) => ({\n id: templateId,\n input: buildMutationInput(input, UPDATE_TEMPLATE_FIELDS),\n }),\n select: (data) => data?.updatePromptTemplate,\n errorMessage: 'Failed to update prompt template',\n });\n\n return { update, loading: state.loading, error: state.error };\n}\n\nexport function useDeletePromptTemplate() {\n const [remove, state] = useWorkspaceMutation<DeletePromptTemplateMutation, string, boolean>({\n document: DeletePromptTemplateDocument,\n variables: (templateId) => ({ id: templateId }),\n select: (data) => data?.deletePromptTemplate,\n errorMessage: 'Failed to delete prompt template',\n });\n\n return { remove, loading: state.loading, error: state.error };\n}\n\nexport function useRenderPromptTemplate() {\n const [render, state] = useWorkspaceMutation<\n RenderPromptTemplateMutation,\n RenderPromptTemplateVariables,\n string\n >({\n document: RenderPromptTemplateDocument,\n variables: ({ templateId, variables }) => ({ id: templateId, variables }),\n select: (data) => data?.renderPromptTemplate,\n errorMessage: 'Failed to render prompt template',\n });\n\n return { render, loading: state.loading, error: state.error };\n}\n"],"mappings":";;;;;;AAoCA,IAAM,IAAa,KA4Cb,IAAyB,EAAoC;CACjE,UAAU;CACV,aAAa;CACb,eAAe;CACf,UAAU;CACV,MAAM;CACN,MAAM;CACN,QAAQ;CACR,MAAM;CACN,cAAc;CACd,WAAW;CACX,SAAS;CACT,YAAY;CACZ,aAAa;CACd,CAAC,EAEI,IAAyB,EAAoC;CACjE,UAAU;CACV,aAAa;CACb,eAAe;CACf,UAAU;CACV,MAAM;CACN,MAAM;CACN,QAAQ;CACR,MAAM;CACN,cAAc;CACd,WAAW;CACX,SAAS;CACT,YAAY;CACb,CAAC,EAOI,IAAuC,EAAE,EAGzC,IAAuC;CAAC;CAAU;CAAU;CAAW;CAAS;CAAS;AAkB/F,SAAgB,EACd,GAC0B;AAC1B,QAAO,EAAY,EAAS,UAAU,CAAC,KAAK,GAAU,OAAW;EAC/D,MAAM,OAAO,EAAS,QAAS,WAAW,EAAS,OAAO,YAAY,IAAQ;EAC9E,MACE,EAAe,MACZ,MAAc,OAAO,EAAS,QAAS,YAAY,MAAc,EAAS,KAC5E,IAAI;EACP,UAAU,EAAS,aAAa;EAChC,aAAa,OAAO,EAAS,eAAgB,WAAW,EAAS,cAAc,KAAA;EAC/E,cAAc,EAAS;EACxB,EAAE;;AAIL,SAAgB,EACd,GAC2B;AAC3B,QAAO,EAAY,EAAS,cAAc;;AAG5C,SAAS,EAAgB,GAAoE;AAC3F,QAAO,GAAM,uBAAuB;;AAYtC,SAAgB,EACd,GACqC;CACrC,IAAM,IAAc,GAAgB,EAC9B,EAAE,WAAQ,WAAQ,eAAY,gBAAa,KAAU,EAAE,EACvD,IAAU,GAAQ,MAAM,KAAK,IAAI,IAAI;AAiB3C,QAAO,EAAoE;EACzE,UAAU;EACV,WAjBgB,SACT;GACL,SAAS;IACP;IACA,QAAQ,KAAU,KAAA;IAClB;IACA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O;;AAG/D,SAAgB,IAA0B;CACxC,IAAM,CAAC,GAAQ,KAAS,EAItB;EACA,UAAU;EACV,YAAY,EAAE,eAAY,oBAAiB;GAAE,IAAI;GAAY;GAAW;EACxE,SAAS,MAAS,GAAM;EACxB,cAAc;EACf,CAAC;AAEF,QAAO;EAAE;EAAQ,SAAS,EAAM;EAAS,OAAO,EAAM;EAAO"}
1
+ {"version":3,"file":"usePromptTemplates.js","names":["LIST_LIMIT","CREATE_TEMPLATE_FIELDS","fieldsOf","UPDATE_TEMPLATE_FIELDS","NO_TEMPLATES","VARIABLE_TYPES","promptTemplateVariables","jsonRecords","template","variable","index","candidate","promptTemplateExamples","selectTemplates","data","usePromptTemplates","workspaceId","useWorkspaceId","filter","tagsKey","variables","useMemo","search","status","visibility","bucketId","useWorkspaceQuery","ListPromptTemplatesDocument","usePromptTemplate","templateId","GetPromptTemplateDocument","useCreatePromptTemplate","useCallback","buildMutationInput","input","create","state","useWorkspaceMutation","CreatePromptTemplateDocument","useUpdatePromptTemplate","update","UpdatePromptTemplateDocument","useDeletePromptTemplate","remove","DeletePromptTemplateDocument","useRenderPromptTemplate","render","RenderPromptTemplateDocument"],"sources":["../../../src/botlit/hooks/usePromptTemplates.ts"],"sourcesContent":["/**\n * Prompt Templates Hooks\n * @module botlit/hooks\n *\n * Backed by the live `listPromptTemplates` / `getPromptTemplate` operations and\n * the create/update/delete/render mutations on wspace-botlit-svc.\n */\n\nimport { useCallback, useMemo } from 'react';\nimport {\n CreatePromptTemplateDocument,\n DeletePromptTemplateDocument,\n GetPromptTemplateDocument,\n ListPromptTemplatesDocument,\n RenderPromptTemplateDocument,\n UpdatePromptTemplateDocument,\n type CreatePromptTemplateMutation,\n type DeletePromptTemplateMutation,\n type GetPromptTemplateQuery,\n type ListPromptTemplatesQuery,\n type RenderPromptTemplateMutation,\n type UpdatePromptTemplateMutation,\n} from '../../generated/wspace-operations';\nimport type {\n CreatePromptTemplateInput,\n UpdatePromptTemplateInput,\n} from '../../generated/wspace-types';\nimport { jsonRecords } from '../utils/unions';\nimport { buildMutationInput, fieldsOf, type GraphQLInput } from './internal/mutationInput';\nimport {\n useWorkspaceId,\n useWorkspaceMutation,\n useWorkspaceQuery,\n type QueryResult,\n} from './internal/workspaceGateway';\n\nconst LIST_LIMIT = 100;\n\nexport interface PromptTemplateRecord {\n id: string;\n name: string;\n slug: string;\n version: string;\n templateText: string;\n status: string;\n visibility: string;\n description?: string | null;\n bucketId?: string | null;\n /** Free-form JSON — the UI stores an array of `PromptVariable` here. */\n variables: Record<string, unknown> | unknown[];\n exampleInputs: Record<string, unknown> | unknown[];\n metadata?: Record<string, unknown> | null;\n revision: number;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n createdById: string;\n updatedById: string;\n workspaceId: string;\n}\n\nexport interface PromptTemplateFilterVariables {\n search?: string;\n status?: string;\n visibility?: string;\n bucketId?: string;\n tags?: string[];\n}\n\n/** `CreatePromptTemplateInput` minus the `workspaceId` the hook supplies. */\nexport type CreatePromptTemplateVariables = Omit<\n GraphQLInput<CreatePromptTemplateInput>,\n 'workspaceId'\n>;\n\nexport interface UpdatePromptTemplateVariables {\n templateId: string;\n input: GraphQLInput<UpdatePromptTemplateInput>;\n}\n\nconst CREATE_TEMPLATE_FIELDS = fieldsOf<CreatePromptTemplateInput>({\n bucketId: true,\n description: true,\n exampleInputs: true,\n metadata: true,\n name: true,\n slug: true,\n status: true,\n tags: true,\n templateText: true,\n variables: true,\n version: true,\n visibility: true,\n workspaceId: true,\n});\n\nconst UPDATE_TEMPLATE_FIELDS = fieldsOf<UpdatePromptTemplateInput>({\n bucketId: true,\n description: true,\n exampleInputs: true,\n metadata: true,\n name: true,\n slug: true,\n status: true,\n tags: true,\n templateText: true,\n variables: true,\n version: true,\n visibility: true,\n});\n\nexport interface RenderPromptTemplateVariables {\n templateId: string;\n variables?: Record<string, unknown>;\n}\n\nconst NO_TEMPLATES: PromptTemplateRecord[] = [];\n\n/** The variable types the editor offers; anything else falls back to `string`. */\nconst VARIABLE_TYPES: PromptVariableType[] = ['string', 'number', 'boolean', 'array', 'object'];\n\nexport type PromptVariableType = 'string' | 'number' | 'boolean' | 'array' | 'object';\n\n/**\n * One declared template variable. `variables` is a free-form `JSON` column, so\n * a template whose variables were written by another client (or stored as an\n * object rather than an array) must still render.\n */\nexport interface PromptTemplateVariable {\n name: string;\n type: PromptVariableType;\n required: boolean;\n description?: string;\n defaultValue?: unknown;\n}\n\n/** The template's declared variables, normalised for rendering. */\nexport function promptTemplateVariables(\n template: Pick<PromptTemplateRecord, 'variables'>\n): PromptTemplateVariable[] {\n return jsonRecords(template.variables).map((variable, index) => ({\n name: typeof variable.name === 'string' ? variable.name : `variable_${index + 1}`,\n type:\n VARIABLE_TYPES.find(\n (candidate) => typeof variable.type === 'string' && candidate === variable.type\n ) ?? 'string',\n required: variable.required === true,\n description: typeof variable.description === 'string' ? variable.description : undefined,\n defaultValue: variable.defaultValue,\n }));\n}\n\n/** The template's example input sets, normalised for rendering. */\nexport function promptTemplateExamples(\n template: Pick<PromptTemplateRecord, 'exampleInputs'>\n): Record<string, unknown>[] {\n return jsonRecords(template.exampleInputs);\n}\n\nfunction selectTemplates(data: ListPromptTemplatesQuery | undefined): PromptTemplateRecord[] {\n return data?.listPromptTemplates ?? NO_TEMPLATES;\n}\n\nexport const promptTemplateKeys = {\n all: ['promptTemplates'] as const,\n lists: () => [...promptTemplateKeys.all, 'list'] as const,\n list: (filter?: PromptTemplateFilterVariables) =>\n [...promptTemplateKeys.lists(), filter] as const,\n details: () => [...promptTemplateKeys.all, 'detail'] as const,\n detail: (id: string) => [...promptTemplateKeys.details(), id] as const,\n};\n\nexport function usePromptTemplates(\n filter?: PromptTemplateFilterVariables\n): QueryResult<PromptTemplateRecord[]> {\n const workspaceId = useWorkspaceId();\n const { search, status, visibility, bucketId } = filter ?? {};\n const tagsKey = filter?.tags?.join(',') ?? '';\n\n const variables = useMemo(\n () => ({\n filters: {\n workspaceId,\n search: search || undefined,\n status,\n visibility,\n bucketId,\n tags: tagsKey ? tagsKey.split(',') : undefined,\n },\n pagination: { limit: LIST_LIMIT, offset: 0 },\n }),\n [workspaceId, search, status, visibility, bucketId, tagsKey]\n );\n\n return useWorkspaceQuery<ListPromptTemplatesQuery, PromptTemplateRecord[]>({\n document: ListPromptTemplatesDocument,\n variables,\n select: selectTemplates,\n fallback: NO_TEMPLATES,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load prompt templates',\n });\n}\n\nexport function usePromptTemplate(\n templateId: string | undefined\n): QueryResult<PromptTemplateRecord | null> {\n const variables = useMemo(() => ({ id: templateId ?? '' }), [templateId]);\n\n return useWorkspaceQuery<GetPromptTemplateQuery, PromptTemplateRecord | null>({\n document: GetPromptTemplateDocument,\n variables,\n select: (data) => data?.getPromptTemplate ?? null,\n fallback: null,\n enabled: Boolean(templateId),\n errorMessage: 'Failed to load prompt template',\n });\n}\n\nexport function useCreatePromptTemplate() {\n const workspaceId = useWorkspaceId();\n\n const variables = useCallback(\n (input: CreatePromptTemplateVariables) => ({\n input: buildMutationInput({ ...input, workspaceId }, CREATE_TEMPLATE_FIELDS),\n }),\n [workspaceId]\n );\n\n const [create, state] = useWorkspaceMutation<\n CreatePromptTemplateMutation,\n CreatePromptTemplateVariables,\n PromptTemplateRecord\n >({\n document: CreatePromptTemplateDocument,\n variables,\n select: (data) => data?.createPromptTemplate,\n errorMessage: 'Failed to create prompt template',\n });\n\n return { create, loading: state.loading, error: state.error };\n}\n\nexport function useUpdatePromptTemplate() {\n const [update, state] = useWorkspaceMutation<\n UpdatePromptTemplateMutation,\n UpdatePromptTemplateVariables,\n PromptTemplateRecord\n >({\n document: UpdatePromptTemplateDocument,\n variables: ({ templateId, input }) => ({\n id: templateId,\n input: buildMutationInput(input, UPDATE_TEMPLATE_FIELDS),\n }),\n select: (data) => data?.updatePromptTemplate,\n errorMessage: 'Failed to update prompt template',\n });\n\n return { update, loading: state.loading, error: state.error };\n}\n\nexport function useDeletePromptTemplate() {\n const [remove, state] = useWorkspaceMutation<DeletePromptTemplateMutation, string, boolean>({\n document: DeletePromptTemplateDocument,\n variables: (templateId) => ({ id: templateId }),\n select: (data) => data?.deletePromptTemplate,\n errorMessage: 'Failed to delete prompt template',\n });\n\n return { remove, loading: state.loading, error: state.error };\n}\n\nexport function useRenderPromptTemplate() {\n const [render, state] = useWorkspaceMutation<\n RenderPromptTemplateMutation,\n RenderPromptTemplateVariables,\n string\n >({\n document: RenderPromptTemplateDocument,\n variables: ({ templateId, variables }) => ({ id: templateId, variables }),\n select: (data) => data?.renderPromptTemplate,\n errorMessage: 'Failed to render prompt template',\n });\n\n return { render, loading: state.loading, error: state.error };\n}\n"],"mappings":";;;;;;AAoCA,IAAMA,IAAa,KA4CbC,IAAyBC,EAAoC;CACjE,UAAU;CACV,aAAa;CACb,eAAe;CACf,UAAU;CACV,MAAM;CACN,MAAM;CACN,QAAQ;CACR,MAAM;CACN,cAAc;CACd,WAAW;CACX,SAAS;CACT,YAAY;CACZ,aAAa;AACf,CAAC,GAEKC,IAAyBD,EAAoC;CACjE,UAAU;CACV,aAAa;CACb,eAAe;CACf,UAAU;CACV,MAAM;CACN,MAAM;CACN,QAAQ;CACR,MAAM;CACN,cAAc;CACd,WAAW;CACX,SAAS;CACT,YAAY;AACd,CAAC,GAOKE,IAAuC,CAAC,GAGxCC,IAAuC;CAAC;CAAU;CAAU;CAAW;CAAS;AAAQ;AAkB9F,SAAgBC,EACd,GAC0B;CAC1B,OAAOC,EAAYC,EAAS,SAAS,CAAC,CAAC,KAAK,GAAU,OAAW;EAC/D,MAAM,OAAOC,EAAS,QAAS,WAAWA,EAAS,OAAO,YAAYC,IAAQ;EAC9E,MACEL,EAAe,MACZ,MAAc,OAAOI,EAAS,QAAS,YAAYE,MAAcF,EAAS,IAC7E,KAAK;EACP,UAAUA,EAAS,aAAa;EAChC,aAAa,OAAOA,EAAS,eAAgB,WAAWA,EAAS,cAAc,KAAA;EAC/E,cAAcA,EAAS;CACzB,EAAE;AACJ;AA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AAM,CAACC,GAAQJ,KAASC,EAItB;EACA,UAAUI;EACV,YAAY,EAAE,eAAY,gBAAa;GACrC,IAAIZ;GACJ,OAAOI,EAAmBC,GAAO/B,CAAsB;EACzD;EACA,SAAS,MAASW,GAAM;EACxB,cAAc;CAChB,CAAC;CAED,OAAO;EAAE;EAAQ,SAASsB,EAAM;EAAS,OAAOA,EAAM;CAAM;AAC9D;AAEA,SAAgBM,IAA0B;CACxC,IAAM,CAACC,GAAQP,KAASC,EAAoE;EAC1F,UAAUO;EACV,YAAY,OAAgB,EAAE,IAAIf,EAAW;EAC7C,SAAS,MAASf,GAAM;EACxB,cAAc;CAChB,CAAC;CAED,OAAO;EAAE;EAAQ,SAASsB,EAAM;EAAS,OAAOA,EAAM;CAAM;AAC9D;AAEA,SAAgBS,IAA0B;CACxC,IAAM,CAACC,GAAQV,KAASC,EAItB;EACA,UAAUU;EACV,YAAY,EAAE,eAAY,oBAAiB;GAAE,IAAIlB;GAAY;EAAU;EACvE,SAAS,MAASf,GAAM;EACxB,cAAc;CAChB,CAAC;CAED,OAAO;EAAE;EAAQ,SAASsB,EAAM;EAAS,OAAOA,EAAM;CAAM;AAC9D"}
@@ -0,0 +1,26 @@
1
+ import { QueryResult } from './internal/workspaceGateway';
2
+ export interface RetentionRunRecord {
3
+ id: string;
4
+ trigger: string;
5
+ status: string;
6
+ executionDataRetentionDays?: number | null;
7
+ conversationRetentionDays?: number | null;
8
+ executionsPurged: number;
9
+ a2aMessagesPurged: number;
10
+ errorMessage?: string | null;
11
+ startedAt: string;
12
+ finishedAt: string;
13
+ }
14
+ export interface RetentionStatusRecord {
15
+ executionDataRetentionDays?: number | null;
16
+ conversationRetentionDays?: number | null;
17
+ activePolicyCount: number;
18
+ endOfTermErasureGraceDays: number;
19
+ recentRuns: RetentionRunRecord[];
20
+ }
21
+ export declare function useRetentionStatus(): QueryResult<RetentionStatusRecord | null>;
22
+ export declare function useApplyRetention(): {
23
+ apply: (input: void) => Promise<RetentionRunRecord>;
24
+ loading: boolean;
25
+ error: Error | undefined;
26
+ };
@@ -1,14 +1,15 @@
1
1
  import { ApplyBotmanorRetentionDocument as e, BotmanorRetentionStatusDocument as t } from "../../generated/wspace-operations.js";
2
2
  import { useWorkspaceId as n, useWorkspaceMutation as r, useWorkspaceQuery as i } from "./internal/workspaceGateway.js";
3
- //#region src/botlit/hooks/useRetention.ts
3
+ // src/botlit/hooks/useRetention.ts
4
4
  var a = {};
5
5
  function o() {
6
+ let e = n();
6
7
  return i({
7
8
  document: t,
8
9
  variables: a,
9
10
  select: (e) => e?.botmanorRetentionStatus ?? null,
10
11
  fallback: null,
11
- enabled: !!n(),
12
+ enabled: !!e,
12
13
  errorMessage: "Failed to load retention status"
13
14
  });
14
15
  }
@@ -25,7 +26,6 @@ function s() {
25
26
  error: n.error
26
27
  };
27
28
  }
28
- //#endregion
29
29
  export { s as useApplyRetention, o as useRetentionStatus };
30
30
 
31
31
  //# sourceMappingURL=useRetention.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRetention.js","names":[],"sources":["../../../src/botlit/hooks/useRetention.ts"],"sourcesContent":["/**\n * Retention hooks (BOFF-9661)\n * @module botlit/hooks\n *\n * Reads the retention settings in force for the workspace and its recent\n * retention passes, and runs a pass on demand. Retention itself is enforced\n * hourly by wspace-botmanor-svc; `applyBotmanorRetention` only runs it now.\n */\n\nimport {\n ApplyBotmanorRetentionDocument,\n BotmanorRetentionStatusDocument,\n type ApplyBotmanorRetentionMutation,\n type BotmanorRetentionStatusQuery,\n} from '../../generated/wspace-operations';\nimport {\n useWorkspaceId,\n useWorkspaceMutation,\n useWorkspaceQuery,\n type QueryResult,\n} from './internal/workspaceGateway';\n\nconst NO_VARIABLES: Record<string, unknown> = {};\n\nexport interface RetentionRunRecord {\n id: string;\n trigger: string;\n status: string;\n executionDataRetentionDays?: number | null;\n conversationRetentionDays?: number | null;\n executionsPurged: number;\n a2aMessagesPurged: number;\n errorMessage?: string | null;\n startedAt: string;\n finishedAt: string;\n}\n\nexport interface RetentionStatusRecord {\n executionDataRetentionDays?: number | null;\n conversationRetentionDays?: number | null;\n activePolicyCount: number;\n endOfTermErasureGraceDays: number;\n recentRuns: RetentionRunRecord[];\n}\n\nexport function useRetentionStatus(): QueryResult<RetentionStatusRecord | null> {\n const workspaceId = useWorkspaceId();\n return useWorkspaceQuery<BotmanorRetentionStatusQuery, RetentionStatusRecord | null>({\n document: BotmanorRetentionStatusDocument,\n // No arguments: the workspace comes from the gateway-verified token.\n variables: NO_VARIABLES,\n select: (data) => data?.botmanorRetentionStatus ?? null,\n fallback: null,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load retention status',\n });\n}\n\nexport function useApplyRetention() {\n const [apply, state] = useWorkspaceMutation<\n ApplyBotmanorRetentionMutation,\n void,\n RetentionRunRecord\n >({\n document: ApplyBotmanorRetentionDocument,\n variables: () => ({}),\n select: (data) => data?.applyBotmanorRetention,\n errorMessage: 'Failed to apply retention',\n });\n return { apply, loading: state.loading, error: state.error };\n}\n"],"mappings":";;;AAsBA,IAAM,IAAwC,EAAE;AAuBhD,SAAgB,IAAgE;AAE9E,QAAO,EAA8E;EACnF,UAAU;EAEV,WAAW;EACX,SAAS,MAAS,GAAM,2BAA2B;EACnD,UAAU;EACV,SAAS,EAPS,GAAgB;EAQlC,cAAc;EACf,CAAC;;AAGJ,SAAgB,IAAoB;CAClC,IAAM,CAAC,GAAO,KAAS,EAIrB;EACA,UAAU;EACV,kBAAkB,EAAE;EACpB,SAAS,MAAS,GAAM;EACxB,cAAc;EACf,CAAC;AACF,QAAO;EAAE;EAAO,SAAS,EAAM;EAAS,OAAO,EAAM;EAAO"}
1
+ {"version":3,"file":"useRetention.js","names":["NO_VARIABLES","useRetentionStatus","workspaceId","useWorkspaceId","useWorkspaceQuery","BotmanorRetentionStatusDocument","data","useApplyRetention","apply","state","useWorkspaceMutation","ApplyBotmanorRetentionDocument"],"sources":["../../../src/botlit/hooks/useRetention.ts"],"sourcesContent":["/**\n * Retention hooks (BOFF-9661)\n * @module botlit/hooks\n *\n * Reads the retention settings in force for the workspace and its recent\n * retention passes, and runs a pass on demand. Retention itself is enforced\n * hourly by wspace-botmanor-svc; `applyBotmanorRetention` only runs it now.\n */\n\nimport {\n ApplyBotmanorRetentionDocument,\n BotmanorRetentionStatusDocument,\n type ApplyBotmanorRetentionMutation,\n type BotmanorRetentionStatusQuery,\n} from '../../generated/wspace-operations';\nimport {\n useWorkspaceId,\n useWorkspaceMutation,\n useWorkspaceQuery,\n type QueryResult,\n} from './internal/workspaceGateway';\n\nconst NO_VARIABLES: Record<string, unknown> = {};\n\nexport interface RetentionRunRecord {\n id: string;\n trigger: string;\n status: string;\n executionDataRetentionDays?: number | null;\n conversationRetentionDays?: number | null;\n executionsPurged: number;\n a2aMessagesPurged: number;\n errorMessage?: string | null;\n startedAt: string;\n finishedAt: string;\n}\n\nexport interface RetentionStatusRecord {\n executionDataRetentionDays?: number | null;\n conversationRetentionDays?: number | null;\n activePolicyCount: number;\n endOfTermErasureGraceDays: number;\n recentRuns: RetentionRunRecord[];\n}\n\nexport function useRetentionStatus(): QueryResult<RetentionStatusRecord | null> {\n const workspaceId = useWorkspaceId();\n return useWorkspaceQuery<BotmanorRetentionStatusQuery, RetentionStatusRecord | null>({\n document: BotmanorRetentionStatusDocument,\n // No arguments: the workspace comes from the gateway-verified token.\n variables: NO_VARIABLES,\n select: (data) => data?.botmanorRetentionStatus ?? null,\n fallback: null,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load retention status',\n });\n}\n\nexport function useApplyRetention() {\n const [apply, state] = useWorkspaceMutation<\n ApplyBotmanorRetentionMutation,\n void,\n RetentionRunRecord\n >({\n document: ApplyBotmanorRetentionDocument,\n variables: () => ({}),\n select: (data) => data?.applyBotmanorRetention,\n errorMessage: 'Failed to apply retention',\n });\n return { apply, loading: state.loading, error: state.error };\n}\n"],"mappings":";;;AAsBA,IAAMA,IAAwC,CAAC;AAuB/C,SAAgBC,IAAgE;CAC9E,IAAMC,IAAcC,EAAe;CACnC,OAAOC,EAA8E;EACnF,UAAUC;EAEV,WAAWL;EACX,SAAS,MAASM,GAAM,2BAA2B;EACnD,UAAU;EACV,SAAS,EAAQJ;EACjB,cAAc;CAChB,CAAC;AACH;AAEA,SAAgBK,IAAoB;CAClC,IAAM,CAACC,GAAOC,KAASC,EAIrB;EACA,UAAUC;EACV,kBAAkB,CAAC;EACnB,SAAS,MAASL,GAAM;EACxB,cAAc;CAChB,CAAC;CACD,OAAO;EAAE;EAAO,SAASG,EAAM;EAAS,OAAOA,EAAM;CAAM;AAC7D"}
@@ -0,0 +1,75 @@
1
+ import { CreateRetrievalProfileInput, UpdateRetrievalProfileInput } from '../../generated/wspace-types';
2
+ import { GraphQLInput } from './internal/mutationInput';
3
+ import { QueryResult } from './internal/workspaceGateway';
4
+ export interface RetrievalProfileRecord {
5
+ id: string;
6
+ name: string;
7
+ status: string;
8
+ visibility: string;
9
+ strategyMode: string;
10
+ topK: number;
11
+ snippetMaxChars: number;
12
+ minSources: number;
13
+ citationsRequired: boolean;
14
+ showSources: boolean;
15
+ noAnswerIfBelowThreshold: boolean;
16
+ multiHop: string;
17
+ queryRewrite: string;
18
+ reranker: string;
19
+ description?: string | null;
20
+ bucketId?: string | null;
21
+ citationFormat?: string | null;
22
+ hybridWeights?: Record<string, unknown> | null;
23
+ minRelevanceScore?: number | null;
24
+ multiHopDepth?: number | null;
25
+ rerankerModelPolicyId?: string | null;
26
+ testQueries?: Record<string, unknown> | null;
27
+ metadata?: Record<string, unknown> | null;
28
+ revision: number;
29
+ tags: string[];
30
+ createdAt: string;
31
+ updatedAt: string;
32
+ createdById: string;
33
+ updatedById: string;
34
+ workspaceId: string;
35
+ }
36
+ export interface RetrievalProfileFilterVariables {
37
+ search?: string;
38
+ status?: string;
39
+ strategyMode?: string;
40
+ bucketId?: string;
41
+ }
42
+ /**
43
+ * `CreateRetrievalProfileInput` minus the `workspaceId` the hook supplies.
44
+ * The service's input is FLAT — there is no nested `strategy`/`grounding`/
45
+ * `thresholds` object anywhere in the schema.
46
+ */
47
+ export type CreateRetrievalProfileVariables = Omit<GraphQLInput<CreateRetrievalProfileInput>, 'workspaceId'>;
48
+ export interface UpdateRetrievalProfileVariables {
49
+ profileId: string;
50
+ input: GraphQLInput<UpdateRetrievalProfileInput>;
51
+ }
52
+ export declare const retrievalProfileKeys: {
53
+ all: readonly ["retrieval-profiles"];
54
+ lists: () => readonly ["retrieval-profiles", "list"];
55
+ list: (filter?: RetrievalProfileFilterVariables) => readonly ["retrieval-profiles", "list", RetrievalProfileFilterVariables | undefined];
56
+ details: () => readonly ["retrieval-profiles", "detail"];
57
+ detail: (id: string) => readonly ["retrieval-profiles", "detail", string];
58
+ };
59
+ export declare function useRetrievalProfiles(filter?: RetrievalProfileFilterVariables): QueryResult<RetrievalProfileRecord[]>;
60
+ export declare function useRetrievalProfile(profileId: string | undefined): QueryResult<RetrievalProfileRecord | null>;
61
+ export declare function useCreateRetrievalProfile(): {
62
+ create: (input: CreateRetrievalProfileVariables) => Promise<RetrievalProfileRecord>;
63
+ loading: boolean;
64
+ error: Error | undefined;
65
+ };
66
+ export declare function useUpdateRetrievalProfile(): {
67
+ update: (input: UpdateRetrievalProfileVariables) => Promise<RetrievalProfileRecord>;
68
+ loading: boolean;
69
+ error: Error | undefined;
70
+ };
71
+ export declare function useDeleteRetrievalProfile(): {
72
+ remove: (input: string) => Promise<boolean>;
73
+ loading: boolean;
74
+ error: Error | undefined;
75
+ };
@@ -1,9 +1,9 @@
1
- import { buildMutationInput as e, fieldsOf as t } from "./internal/mutationInput.js";
2
- import { CreateRetrievalProfileDocument as n, DeleteRetrievalProfileDocument as r, GetRetrievalProfileDocument as i, ListRetrievalProfilesDocument as a, UpdateRetrievalProfileDocument as o } from "../../generated/wspace-operations.js";
1
+ import { CreateRetrievalProfileDocument as e, DeleteRetrievalProfileDocument as t, GetRetrievalProfileDocument as n, ListRetrievalProfilesDocument as r, UpdateRetrievalProfileDocument as i } from "../../generated/wspace-operations.js";
2
+ import { buildMutationInput as a, fieldsOf as o } from "./internal/mutationInput.js";
3
3
  import { useWorkspaceId as s, useWorkspaceMutation as c, useWorkspaceQuery as l } from "./internal/workspaceGateway.js";
4
4
  import { useCallback as u, useMemo as d } from "react";
5
- //#region src/botlit/hooks/useRetrievalProfiles.ts
6
- var f = 100, p = t({
5
+ // src/botlit/hooks/useRetrievalProfiles.ts
6
+ var f = 100, p = o({
7
7
  bucketId: !0,
8
8
  citationFormat: !0,
9
9
  citationsRequired: !0,
@@ -28,7 +28,7 @@ var f = 100, p = t({
28
28
  topK: !0,
29
29
  visibility: !0,
30
30
  workspaceId: !0
31
- }), m = t({
31
+ }), m = o({
32
32
  bucketId: !0,
33
33
  citationFormat: !0,
34
34
  citationsRequired: !0,
@@ -57,28 +57,28 @@ function g(e) {
57
57
  return e?.listRetrievalProfiles ?? h;
58
58
  }
59
59
  function _(e) {
60
- let t = s(), { search: n, status: r, strategyMode: i, bucketId: o } = e ?? {};
60
+ let t = s(), { search: n, status: i, strategyMode: a, bucketId: o } = e ?? {}, c = d(() => ({
61
+ filters: {
62
+ workspaceId: t,
63
+ search: n || void 0,
64
+ status: i,
65
+ strategyMode: a,
66
+ bucketId: o
67
+ },
68
+ pagination: {
69
+ limit: f,
70
+ offset: 0
71
+ }
72
+ }), [
73
+ t,
74
+ n,
75
+ i,
76
+ a,
77
+ o
78
+ ]);
61
79
  return l({
62
- document: a,
63
- variables: d(() => ({
64
- filters: {
65
- workspaceId: t,
66
- search: n || void 0,
67
- status: r,
68
- strategyMode: i,
69
- bucketId: o
70
- },
71
- pagination: {
72
- limit: f,
73
- offset: 0
74
- }
75
- }), [
76
- t,
77
- n,
78
- r,
79
- i,
80
- o
81
- ]),
80
+ document: r,
81
+ variables: c,
82
82
  select: g,
83
83
  fallback: h,
84
84
  enabled: !!t,
@@ -86,9 +86,10 @@ function _(e) {
86
86
  });
87
87
  }
88
88
  function v(e) {
89
+ let t = d(() => ({ id: e ?? "" }), [e]);
89
90
  return l({
90
- document: i,
91
- variables: d(() => ({ id: e ?? "" }), [e]),
91
+ document: n,
92
+ variables: t,
92
93
  select: (e) => e?.getRetrievalProfile ?? null,
93
94
  fallback: null,
94
95
  enabled: !!e,
@@ -96,12 +97,12 @@ function v(e) {
96
97
  });
97
98
  }
98
99
  function y() {
99
- let t = s(), [r, i] = c({
100
- document: n,
101
- variables: u((n) => ({ input: e({
102
- ...n,
103
- workspaceId: t
104
- }, p) }), [t]),
100
+ let t = s(), n = u((e) => ({ input: a({
101
+ ...e,
102
+ workspaceId: t
103
+ }, p) }), [t]), [r, i] = c({
104
+ document: e,
105
+ variables: n,
105
106
  select: (e) => e?.createRetrievalProfile,
106
107
  errorMessage: "Failed to create retrieval profile"
107
108
  });
@@ -112,35 +113,34 @@ function y() {
112
113
  };
113
114
  }
114
115
  function b() {
115
- let [t, n] = c({
116
- document: o,
117
- variables: ({ profileId: t, input: n }) => ({
118
- id: t,
119
- input: e(n, m)
116
+ let [e, t] = c({
117
+ document: i,
118
+ variables: ({ profileId: e, input: t }) => ({
119
+ id: e,
120
+ input: a(t, m)
120
121
  }),
121
122
  select: (e) => e?.updateRetrievalProfile,
122
123
  errorMessage: "Failed to update retrieval profile"
123
124
  });
124
125
  return {
125
- update: t,
126
- loading: n.loading,
127
- error: n.error
126
+ update: e,
127
+ loading: t.loading,
128
+ error: t.error
128
129
  };
129
130
  }
130
131
  function x() {
131
- let [e, t] = c({
132
- document: r,
132
+ let [e, n] = c({
133
+ document: t,
133
134
  variables: (e) => ({ id: e }),
134
135
  select: (e) => e?.deleteRetrievalProfile,
135
136
  errorMessage: "Failed to delete retrieval profile"
136
137
  });
137
138
  return {
138
139
  remove: e,
139
- loading: t.loading,
140
- error: t.error
140
+ loading: n.loading,
141
+ error: n.error
141
142
  };
142
143
  }
143
- //#endregion
144
144
  export { y as useCreateRetrievalProfile, x as useDeleteRetrievalProfile, v as useRetrievalProfile, _ as useRetrievalProfiles, b as useUpdateRetrievalProfile };
145
145
 
146
146
  //# sourceMappingURL=useRetrievalProfiles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRetrievalProfiles.js","names":[],"sources":["../../../src/botlit/hooks/useRetrievalProfiles.ts"],"sourcesContent":["/**\n * Retrieval Profiles Hooks\n * @module botlit/hooks\n *\n * Backed by the live `listRetrievalProfiles` / `getRetrievalProfile` operations\n * and the create/update/delete mutations on wspace-botlit-svc.\n */\n\nimport { useCallback, useMemo } from 'react';\nimport {\n CreateRetrievalProfileDocument,\n DeleteRetrievalProfileDocument,\n GetRetrievalProfileDocument,\n ListRetrievalProfilesDocument,\n UpdateRetrievalProfileDocument,\n type CreateRetrievalProfileMutation,\n type DeleteRetrievalProfileMutation,\n type GetRetrievalProfileQuery,\n type ListRetrievalProfilesQuery,\n type UpdateRetrievalProfileMutation,\n} from '../../generated/wspace-operations';\nimport type {\n CreateRetrievalProfileInput,\n UpdateRetrievalProfileInput,\n} from '../../generated/wspace-types';\nimport { buildMutationInput, fieldsOf, type GraphQLInput } from './internal/mutationInput';\nimport {\n useWorkspaceId,\n useWorkspaceMutation,\n useWorkspaceQuery,\n type QueryResult,\n} from './internal/workspaceGateway';\n\nconst LIST_LIMIT = 100;\n\nexport interface RetrievalProfileRecord {\n id: string;\n name: string;\n status: string;\n visibility: string;\n strategyMode: string;\n topK: number;\n snippetMaxChars: number;\n minSources: number;\n citationsRequired: boolean;\n showSources: boolean;\n noAnswerIfBelowThreshold: boolean;\n multiHop: string;\n queryRewrite: string;\n reranker: string;\n description?: string | null;\n bucketId?: string | null;\n citationFormat?: string | null;\n hybridWeights?: Record<string, unknown> | null;\n minRelevanceScore?: number | null;\n multiHopDepth?: number | null;\n rerankerModelPolicyId?: string | null;\n testQueries?: Record<string, unknown> | null;\n metadata?: Record<string, unknown> | null;\n revision: number;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n createdById: string;\n updatedById: string;\n workspaceId: string;\n}\n\nexport interface RetrievalProfileFilterVariables {\n search?: string;\n status?: string;\n strategyMode?: string;\n bucketId?: string;\n}\n\n/**\n * `CreateRetrievalProfileInput` minus the `workspaceId` the hook supplies.\n * The service's input is FLAT — there is no nested `strategy`/`grounding`/\n * `thresholds` object anywhere in the schema.\n */\nexport type CreateRetrievalProfileVariables = Omit<\n GraphQLInput<CreateRetrievalProfileInput>,\n 'workspaceId'\n>;\n\nexport interface UpdateRetrievalProfileVariables {\n profileId: string;\n input: GraphQLInput<UpdateRetrievalProfileInput>;\n}\n\nconst CREATE_PROFILE_FIELDS = fieldsOf<CreateRetrievalProfileInput>({\n bucketId: true,\n citationFormat: true,\n citationsRequired: true,\n description: true,\n hybridWeights: true,\n metadata: true,\n minRelevanceScore: true,\n minSources: true,\n multiHop: true,\n multiHopDepth: true,\n name: true,\n noAnswerIfBelowThreshold: true,\n queryRewrite: true,\n reranker: true,\n rerankerModelPolicyId: true,\n showSources: true,\n snippetMaxChars: true,\n status: true,\n strategyMode: true,\n tags: true,\n testQueries: true,\n topK: true,\n visibility: true,\n workspaceId: true,\n});\n\nconst UPDATE_PROFILE_FIELDS = fieldsOf<UpdateRetrievalProfileInput>({\n bucketId: true,\n citationFormat: true,\n citationsRequired: true,\n description: true,\n hybridWeights: true,\n metadata: true,\n minRelevanceScore: true,\n minSources: true,\n multiHop: true,\n multiHopDepth: true,\n name: true,\n noAnswerIfBelowThreshold: true,\n queryRewrite: true,\n reranker: true,\n rerankerModelPolicyId: true,\n showSources: true,\n snippetMaxChars: true,\n status: true,\n strategyMode: true,\n tags: true,\n testQueries: true,\n topK: true,\n visibility: true,\n});\n\nconst NO_PROFILES: RetrievalProfileRecord[] = [];\n\nfunction selectProfiles(data: ListRetrievalProfilesQuery | undefined): RetrievalProfileRecord[] {\n return data?.listRetrievalProfiles ?? NO_PROFILES;\n}\n\nexport const retrievalProfileKeys = {\n all: ['retrieval-profiles'] as const,\n lists: () => [...retrievalProfileKeys.all, 'list'] as const,\n list: (filter?: RetrievalProfileFilterVariables) =>\n [...retrievalProfileKeys.lists(), filter] as const,\n details: () => [...retrievalProfileKeys.all, 'detail'] as const,\n detail: (id: string) => [...retrievalProfileKeys.details(), id] as const,\n};\n\nexport function useRetrievalProfiles(\n filter?: RetrievalProfileFilterVariables\n): QueryResult<RetrievalProfileRecord[]> {\n const workspaceId = useWorkspaceId();\n const { search, status, strategyMode, bucketId } = filter ?? {};\n\n const variables = useMemo(\n () => ({\n filters: {\n workspaceId,\n search: search || undefined,\n status,\n strategyMode,\n bucketId,\n },\n pagination: { limit: LIST_LIMIT, offset: 0 },\n }),\n [workspaceId, search, status, strategyMode, bucketId]\n );\n\n return useWorkspaceQuery<ListRetrievalProfilesQuery, RetrievalProfileRecord[]>({\n document: ListRetrievalProfilesDocument,\n variables,\n select: selectProfiles,\n fallback: NO_PROFILES,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load retrieval profiles',\n });\n}\n\nexport function useRetrievalProfile(\n profileId: string | undefined\n): QueryResult<RetrievalProfileRecord | null> {\n const variables = useMemo(() => ({ id: profileId ?? '' }), [profileId]);\n\n return useWorkspaceQuery<GetRetrievalProfileQuery, RetrievalProfileRecord | null>({\n document: GetRetrievalProfileDocument,\n variables,\n select: (data) => data?.getRetrievalProfile ?? null,\n fallback: null,\n enabled: Boolean(profileId),\n errorMessage: 'Failed to load retrieval profile',\n });\n}\n\nexport function useCreateRetrievalProfile() {\n const workspaceId = useWorkspaceId();\n\n const variables = useCallback(\n (input: CreateRetrievalProfileVariables) => ({\n input: buildMutationInput({ ...input, workspaceId }, CREATE_PROFILE_FIELDS),\n }),\n [workspaceId]\n );\n\n const [create, state] = useWorkspaceMutation<\n CreateRetrievalProfileMutation,\n CreateRetrievalProfileVariables,\n RetrievalProfileRecord\n >({\n document: CreateRetrievalProfileDocument,\n variables,\n select: (data) => data?.createRetrievalProfile,\n errorMessage: 'Failed to create retrieval profile',\n });\n\n return { create, loading: state.loading, error: state.error };\n}\n\nexport function useUpdateRetrievalProfile() {\n const [update, state] = useWorkspaceMutation<\n UpdateRetrievalProfileMutation,\n UpdateRetrievalProfileVariables,\n RetrievalProfileRecord\n >({\n document: UpdateRetrievalProfileDocument,\n variables: ({ profileId, input }) => ({\n id: profileId,\n input: buildMutationInput(input, UPDATE_PROFILE_FIELDS),\n }),\n select: (data) => data?.updateRetrievalProfile,\n errorMessage: 'Failed to update retrieval profile',\n });\n\n return { update, loading: state.loading, error: state.error };\n}\n\nexport function useDeleteRetrievalProfile() {\n const [remove, state] = useWorkspaceMutation<DeleteRetrievalProfileMutation, string, boolean>({\n document: DeleteRetrievalProfileDocument,\n variables: (profileId) => ({ id: profileId }),\n select: (data) => data?.deleteRetrievalProfile,\n errorMessage: 'Failed to delete retrieval profile',\n });\n\n return { remove, loading: state.loading, error: state.error };\n}\n"],"mappings":";;;;;AAiCA,IAAM,IAAa,KAyDb,IAAwB,EAAsC;CAClE,UAAU;CACV,gBAAgB;CAChB,mBAAmB;CACnB,aAAa;CACb,eAAe;CACf,UAAU;CACV,mBAAmB;CACnB,YAAY;CACZ,UAAU;CACV,eAAe;CACf,MAAM;CACN,0BAA0B;CAC1B,cAAc;CACd,UAAU;CACV,uBAAuB;CACvB,aAAa;CACb,iBAAiB;CACjB,QAAQ;CACR,cAAc;CACd,MAAM;CACN,aAAa;CACb,MAAM;CACN,YAAY;CACZ,aAAa;CACd,CAAC,EAEI,IAAwB,EAAsC;CAClE,UAAU;CACV,gBAAgB;CAChB,mBAAmB;CACnB,aAAa;CACb,eAAe;CACf,UAAU;CACV,mBAAmB;CACnB,YAAY;CACZ,UAAU;CACV,eAAe;CACf,MAAM;CACN,0BAA0B;CAC1B,cAAc;CACd,UAAU;CACV,uBAAuB;CACvB,aAAa;CACb,iBAAiB;CACjB,QAAQ;CACR,cAAc;CACd,MAAM;CACN,aAAa;CACb,MAAM;CACN,YAAY;CACb,CAAC,EAEI,IAAwC,EAAE;AAEhD,SAAS,EAAe,GAAwE;AAC9F,QAAO,GAAM,yBAAyB;;AAYxC,SAAgB,EACd,GACuC;CACvC,IAAM,IAAc,GAA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C5C,SAAS,MAAS,GAAM;EACxB,cAAc;EACf,CAAC;AAEF,QAAO;EAAE;EAAQ,SAAS,EAAM;EAAS,OAAO,EAAM;EAAO"}
1
+ {"version":3,"file":"useRetrievalProfiles.js","names":["LIST_LIMIT","CREATE_PROFILE_FIELDS","fieldsOf","UPDATE_PROFILE_FIELDS","NO_PROFILES","selectProfiles","data","useRetrievalProfiles","workspaceId","useWorkspaceId","filter","variables","useMemo","search","status","strategyMode","bucketId","useWorkspaceQuery","ListRetrievalProfilesDocument","useRetrievalProfile","profileId","GetRetrievalProfileDocument","useCreateRetrievalProfile","useCallback","buildMutationInput","input","create","state","useWorkspaceMutation","CreateRetrievalProfileDocument","useUpdateRetrievalProfile","update","UpdateRetrievalProfileDocument","useDeleteRetrievalProfile","remove","DeleteRetrievalProfileDocument"],"sources":["../../../src/botlit/hooks/useRetrievalProfiles.ts"],"sourcesContent":["/**\n * Retrieval Profiles Hooks\n * @module botlit/hooks\n *\n * Backed by the live `listRetrievalProfiles` / `getRetrievalProfile` operations\n * and the create/update/delete mutations on wspace-botlit-svc.\n */\n\nimport { useCallback, useMemo } from 'react';\nimport {\n CreateRetrievalProfileDocument,\n DeleteRetrievalProfileDocument,\n GetRetrievalProfileDocument,\n ListRetrievalProfilesDocument,\n UpdateRetrievalProfileDocument,\n type CreateRetrievalProfileMutation,\n type DeleteRetrievalProfileMutation,\n type GetRetrievalProfileQuery,\n type ListRetrievalProfilesQuery,\n type UpdateRetrievalProfileMutation,\n} from '../../generated/wspace-operations';\nimport type {\n CreateRetrievalProfileInput,\n UpdateRetrievalProfileInput,\n} from '../../generated/wspace-types';\nimport { buildMutationInput, fieldsOf, type GraphQLInput } from './internal/mutationInput';\nimport {\n useWorkspaceId,\n useWorkspaceMutation,\n useWorkspaceQuery,\n type QueryResult,\n} from './internal/workspaceGateway';\n\nconst LIST_LIMIT = 100;\n\nexport interface RetrievalProfileRecord {\n id: string;\n name: string;\n status: string;\n visibility: string;\n strategyMode: string;\n topK: number;\n snippetMaxChars: number;\n minSources: number;\n citationsRequired: boolean;\n showSources: boolean;\n noAnswerIfBelowThreshold: boolean;\n multiHop: string;\n queryRewrite: string;\n reranker: string;\n description?: string | null;\n bucketId?: string | null;\n citationFormat?: string | null;\n hybridWeights?: Record<string, unknown> | null;\n minRelevanceScore?: number | null;\n multiHopDepth?: number | null;\n rerankerModelPolicyId?: string | null;\n testQueries?: Record<string, unknown> | null;\n metadata?: Record<string, unknown> | null;\n revision: number;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n createdById: string;\n updatedById: string;\n workspaceId: string;\n}\n\nexport interface RetrievalProfileFilterVariables {\n search?: string;\n status?: string;\n strategyMode?: string;\n bucketId?: string;\n}\n\n/**\n * `CreateRetrievalProfileInput` minus the `workspaceId` the hook supplies.\n * The service's input is FLAT — there is no nested `strategy`/`grounding`/\n * `thresholds` object anywhere in the schema.\n */\nexport type CreateRetrievalProfileVariables = Omit<\n GraphQLInput<CreateRetrievalProfileInput>,\n 'workspaceId'\n>;\n\nexport interface UpdateRetrievalProfileVariables {\n profileId: string;\n input: GraphQLInput<UpdateRetrievalProfileInput>;\n}\n\nconst CREATE_PROFILE_FIELDS = fieldsOf<CreateRetrievalProfileInput>({\n bucketId: true,\n citationFormat: true,\n citationsRequired: true,\n description: true,\n hybridWeights: true,\n metadata: true,\n minRelevanceScore: true,\n minSources: true,\n multiHop: true,\n multiHopDepth: true,\n name: true,\n noAnswerIfBelowThreshold: true,\n queryRewrite: true,\n reranker: true,\n rerankerModelPolicyId: true,\n showSources: true,\n snippetMaxChars: true,\n status: true,\n strategyMode: true,\n tags: true,\n testQueries: true,\n topK: true,\n visibility: true,\n workspaceId: true,\n});\n\nconst UPDATE_PROFILE_FIELDS = fieldsOf<UpdateRetrievalProfileInput>({\n bucketId: true,\n citationFormat: true,\n citationsRequired: true,\n description: true,\n hybridWeights: true,\n metadata: true,\n minRelevanceScore: true,\n minSources: true,\n multiHop: true,\n multiHopDepth: true,\n name: true,\n noAnswerIfBelowThreshold: true,\n queryRewrite: true,\n reranker: true,\n rerankerModelPolicyId: true,\n showSources: true,\n snippetMaxChars: true,\n status: true,\n strategyMode: true,\n tags: true,\n testQueries: true,\n topK: true,\n visibility: true,\n});\n\nconst NO_PROFILES: RetrievalProfileRecord[] = [];\n\nfunction selectProfiles(data: ListRetrievalProfilesQuery | undefined): RetrievalProfileRecord[] {\n return data?.listRetrievalProfiles ?? NO_PROFILES;\n}\n\nexport const retrievalProfileKeys = {\n all: ['retrieval-profiles'] as const,\n lists: () => [...retrievalProfileKeys.all, 'list'] as const,\n list: (filter?: RetrievalProfileFilterVariables) =>\n [...retrievalProfileKeys.lists(), filter] as const,\n details: () => [...retrievalProfileKeys.all, 'detail'] as const,\n detail: (id: string) => [...retrievalProfileKeys.details(), id] as const,\n};\n\nexport function useRetrievalProfiles(\n filter?: RetrievalProfileFilterVariables\n): QueryResult<RetrievalProfileRecord[]> {\n const workspaceId = useWorkspaceId();\n const { search, status, strategyMode, bucketId } = filter ?? {};\n\n const variables = useMemo(\n () => ({\n filters: {\n workspaceId,\n search: search || undefined,\n status,\n strategyMode,\n bucketId,\n },\n pagination: { limit: LIST_LIMIT, offset: 0 },\n }),\n [workspaceId, search, status, strategyMode, bucketId]\n );\n\n return useWorkspaceQuery<ListRetrievalProfilesQuery, RetrievalProfileRecord[]>({\n document: ListRetrievalProfilesDocument,\n variables,\n select: selectProfiles,\n fallback: NO_PROFILES,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load retrieval profiles',\n });\n}\n\nexport function useRetrievalProfile(\n profileId: string | undefined\n): QueryResult<RetrievalProfileRecord | null> {\n const variables = useMemo(() => ({ id: profileId ?? '' }), [profileId]);\n\n return useWorkspaceQuery<GetRetrievalProfileQuery, RetrievalProfileRecord | null>({\n document: GetRetrievalProfileDocument,\n variables,\n select: (data) => data?.getRetrievalProfile ?? null,\n fallback: null,\n enabled: Boolean(profileId),\n errorMessage: 'Failed to load retrieval profile',\n });\n}\n\nexport function useCreateRetrievalProfile() {\n const workspaceId = useWorkspaceId();\n\n const variables = useCallback(\n (input: CreateRetrievalProfileVariables) => ({\n input: buildMutationInput({ ...input, workspaceId }, CREATE_PROFILE_FIELDS),\n }),\n [workspaceId]\n );\n\n const [create, state] = useWorkspaceMutation<\n CreateRetrievalProfileMutation,\n CreateRetrievalProfileVariables,\n RetrievalProfileRecord\n >({\n document: CreateRetrievalProfileDocument,\n variables,\n select: (data) => data?.createRetrievalProfile,\n errorMessage: 'Failed to create retrieval profile',\n });\n\n return { create, loading: state.loading, error: state.error };\n}\n\nexport function useUpdateRetrievalProfile() {\n const [update, state] = useWorkspaceMutation<\n UpdateRetrievalProfileMutation,\n UpdateRetrievalProfileVariables,\n RetrievalProfileRecord\n >({\n document: UpdateRetrievalProfileDocument,\n variables: ({ profileId, input }) => ({\n id: profileId,\n input: buildMutationInput(input, UPDATE_PROFILE_FIELDS),\n }),\n select: (data) => data?.updateRetrievalProfile,\n errorMessage: 'Failed to update retrieval profile',\n });\n\n return { update, loading: state.loading, error: state.error };\n}\n\nexport function useDeleteRetrievalProfile() {\n const [remove, state] = useWorkspaceMutation<DeleteRetrievalProfileMutation, string, boolean>({\n document: DeleteRetrievalProfileDocument,\n variables: (profileId) => ({ id: profileId }),\n select: (data) => data?.deleteRetrievalProfile,\n errorMessage: 'Failed to delete retrieval profile',\n });\n\n return { remove, loading: state.loading, error: state.error };\n}\n"],"mappings":";;;;;AAiCA,IAAMA,IAAa,KAyDbC,IAAwBC,EAAsC;CAClE,UAAU;CACV,gBAAgB;CAChB,mBAAmB;CACnB,aAAa;CACb,eAAe;CACf,UAAU;CACV,mBAAmB;CACnB,YAAY;CACZ,UAAU;CACV,eAAe;CACf,MAAM;CACN,0BAA0B;CAC1B,cAAc;CACd,UAAU;CACV,uBAAuB;CACvB,aAAa;CACb,iBAAiB;CACjB,QAAQ;CACR,cAAc;CACd,MAAM;CACN,aAAa;CACb,MAAM;CACN,YAAY;CACZ,aAAa;AACf,CAAC,GAEK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