@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
@@ -1,18 +1,19 @@
1
- import "./useBots.js";
1
+ import { useBots as e } from "./useBots.js";
2
2
  import "./useAgents.js";
3
3
  import "./useKnowledgeBases.js";
4
+ import { useRetrievalProfiles as t } from "./useRetrievalProfiles.js";
5
+ import { isMCPServerHealthy as n, mcpServerDescription as r, mcpServerEndpoint as i, useCreateMCPServer as a, useDeleteMCPServer as o, useMCPResources as s, useMCPServer as c, useMCPTools as l, useTestMCPConnection as u, useUpdateMCPServer as d, useUpdateMCPTool as f } from "./useMCPServers.js";
6
+ import { a2aAgentSkillCount as p, useA2AAgents as m } from "./useA2A.js";
7
+ import { routeMetadataString as h, useBotChannelRoutes as g, useChannelConnector as _, useChannelConnectors as v, useChannelRoutes as y, useCreateChannelConnector as b, useCreateChannelRoute as x, useDeleteChannelConnector as S, useDeleteChannelRoute as C, useUpdateChannelConnector as w } from "./useChannels.js";
8
+ import { useCreatePolicy as T, useDeletePolicy as E, usePolicies as D, usePolicy as O, useUpdatePolicy as k } from "./usePolicies.js";
9
+ import { useApplyRetention as A, useRetentionStatus as j } from "./useRetention.js";
10
+ import { useCreateSkill as M, useDeleteSkill as N, useSkill as P, useSkills as F, useUpdateSkill as I } from "./useSkills.js";
11
+ import { promptTemplateVariables as L, useCreatePromptTemplate as R, useDeletePromptTemplate as z, usePromptTemplate as B, usePromptTemplates as V, useRenderPromptTemplate as H, useUpdatePromptTemplate as U } from "./usePromptTemplates.js";
12
+ import { summariseExecutions as W, useExecutions as G } from "./useExecutions.js";
13
+ import { useBucketTree as K, useBuckets as q, useCreateBucket as J, useDeleteBucket as Y, useUpdateBucket as X } from "./useBuckets.js";
14
+ import { storePackageDescription as Z, storePackageName as Q, useInstallPackage as $, useInstalledPackages as ee, usePinPackageVersion as te, useStorePackage as ne, useStorePackages as re, useUninstallPackage as ie, useUpdateInstalledPackage as ae } from "./useStore.js";
4
15
  import "./useConversations.js";
5
16
  import "./useLLMProviders.js";
6
- import "./useMCPServers.js";
7
- import "./useA2A.js";
8
- import "./useRetrievalProfiles.js";
9
- import "./useChannels.js";
10
- import "./usePolicies.js";
11
- import "./useRetention.js";
12
- import "./useSkills.js";
13
- import "./usePromptTemplates.js";
14
- import "./useExecutions.js";
15
- import "./useBuckets.js";
16
- import "./useStore.js";
17
- import "./useUserPlatformConnection.js";
18
- import "./useAiOperations.js";
17
+ import { useInitiateSlackConnect as oe, useLinkIntegrationConnection as se, useMyUserPlatformConnection as ce, useRevokeSlackConnection as le, useToggleSlackNotifications as ue } from "./useUserPlatformConnection.js";
18
+ import { useConfigureSupervisor as de, useRunSupervisorNow as fe, useSupervisorConfig as pe, useSupervisorRuns as me } from "./useAiOperations.js";
19
+ export { p as a2aAgentSkillCount, n as isMCPServerHealthy, r as mcpServerDescription, i as mcpServerEndpoint, L as promptTemplateVariables, h as routeMetadataString, Z as storePackageDescription, Q as storePackageName, W as summariseExecutions, m as useA2AAgents, A as useApplyRetention, g as useBotChannelRoutes, e as useBots, K as useBucketTree, q as useBuckets, _ as useChannelConnector, v as useChannelConnectors, y as useChannelRoutes, de as useConfigureSupervisor, J as useCreateBucket, b as useCreateChannelConnector, x as useCreateChannelRoute, a as useCreateMCPServer, T as useCreatePolicy, R as useCreatePromptTemplate, M as useCreateSkill, Y as useDeleteBucket, S as useDeleteChannelConnector, C as useDeleteChannelRoute, o as useDeleteMCPServer, E as useDeletePolicy, z as useDeletePromptTemplate, N as useDeleteSkill, G as useExecutions, oe as useInitiateSlackConnect, $ as useInstallPackage, ee as useInstalledPackages, se as useLinkIntegrationConnection, s as useMCPResources, c as useMCPServer, l as useMCPTools, ce as useMyUserPlatformConnection, te as usePinPackageVersion, D as usePolicies, O as usePolicy, B as usePromptTemplate, V as usePromptTemplates, H as useRenderPromptTemplate, j as useRetentionStatus, t as useRetrievalProfiles, le as useRevokeSlackConnection, fe as useRunSupervisorNow, P as useSkill, F as useSkills, ne as useStorePackage, re as useStorePackages, pe as useSupervisorConfig, me as useSupervisorRuns, u as useTestMCPConnection, ue as useToggleSlackNotifications, ie as useUninstallPackage, X as useUpdateBucket, w as useUpdateChannelConnector, ae as useUpdateInstalledPackage, d as useUpdateMCPServer, f as useUpdateMCPTool, k as useUpdatePolicy, U as useUpdatePromptTemplate, I as useUpdateSkill };
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Mutation input primitives
3
+ * @module botlit/hooks/internal
4
+ *
5
+ * GraphQL rejects an input object that carries a field its input type does not
6
+ * declare, so a mutation payload must NEVER be assembled by spreading whatever
7
+ * value the UI happens to be holding. An Apollo result carries `__typename`,
8
+ * `id`, `revision` and the audit columns — no `Update*Input` on
9
+ * wspace-botlit-svc accepts any of them, and sending one fails the whole write.
10
+ *
11
+ * `fieldsOf` records the allow-list once per input type and `buildMutationInput`
12
+ * projects an arbitrary caller payload onto it. The `Record<keyof TInput, true>`
13
+ * shape is what makes this safe over time: when the schema grows a field, the
14
+ * allow-list stops compiling until it is declared here too.
15
+ */
16
+ /**
17
+ * Widens one generated input field to the values the gateway really accepts.
18
+ *
19
+ * Two codegen artefacts are corrected here:
20
+ * - Enums are emitted as real TypeScript enums (`Visibility.Private`), which a
21
+ * plain `'PRIVATE'` is not assignable to. Widening them to their string
22
+ * literals lets pages pass the values they already render in `<select>`
23
+ * options without a cast.
24
+ * - The `JSON` scalar is mapped to `Record<string, unknown>`, but a GraphQL
25
+ * JSON scalar accepts arrays just as happily (`variables`, `entitlements`
26
+ * and `exampleInputs` are all JSON arrays in practice).
27
+ *
28
+ * Arrays are widened element-wise, so an enum list such as
29
+ * `Array<BotmanorAgentCapability>` accepts `['MCP_TOOLS']`.
30
+ */
31
+ type WidenValue<TValue> = TValue extends string ? `${TValue}` : TValue extends readonly (infer TItem)[] ? WidenValue<TItem>[] : TValue extends Record<string, unknown> ? TValue | unknown[] : TValue;
32
+ /** Generated `*Input` type with its enum and JSON fields widened. */
33
+ export type GraphQLInput<TInput> = {
34
+ [TKey in keyof TInput]: WidenValue<TInput[TKey]>;
35
+ };
36
+ /** The complete, compiler-checked field list of one GraphQL input type. */
37
+ export interface MutationInputFields<TInput> {
38
+ readonly keys: readonly (keyof TInput)[];
39
+ }
40
+ /**
41
+ * Declares the complete field list of a GraphQL input type.
42
+ *
43
+ * Every key of `TInput` must be present, so a schema field added upstream
44
+ * surfaces as a compile error here instead of being silently dropped from
45
+ * every mutation the hook sends.
46
+ */
47
+ export declare function fieldsOf<TInput>(shape: Record<keyof TInput, true>): MutationInputFields<TInput>;
48
+ /**
49
+ * Projects `input` onto the declared fields, dropping every key the input type
50
+ * does not declare.
51
+ *
52
+ * `undefined` values are dropped (the caller left the field alone); `null` is
53
+ * preserved because GraphQL treats it as an explicit "clear this field".
54
+ */
55
+ export declare function buildMutationInput<TInput>(input: Partial<GraphQLInput<TInput>>, fields: MutationInputFields<TInput>): Partial<GraphQLInput<TInput>>;
56
+ export {};
@@ -1,4 +1,4 @@
1
- //#region src/botlit/hooks/internal/mutationInput.ts
1
+ // src/botlit/hooks/internal/mutationInput.ts
2
2
  function e(e) {
3
3
  return { keys: Object.keys(e) };
4
4
  }
@@ -10,7 +10,6 @@ function t(e, t) {
10
10
  }
11
11
  return r;
12
12
  }
13
- //#endregion
14
13
  export { t as buildMutationInput, e as fieldsOf };
15
14
 
16
15
  //# sourceMappingURL=mutationInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mutationInput.js","names":[],"sources":["../../../../src/botlit/hooks/internal/mutationInput.ts"],"sourcesContent":["/**\n * Mutation input primitives\n * @module botlit/hooks/internal\n *\n * GraphQL rejects an input object that carries a field its input type does not\n * declare, so a mutation payload must NEVER be assembled by spreading whatever\n * value the UI happens to be holding. An Apollo result carries `__typename`,\n * `id`, `revision` and the audit columns — no `Update*Input` on\n * wspace-botlit-svc accepts any of them, and sending one fails the whole write.\n *\n * `fieldsOf` records the allow-list once per input type and `buildMutationInput`\n * projects an arbitrary caller payload onto it. The `Record<keyof TInput, true>`\n * shape is what makes this safe over time: when the schema grows a field, the\n * allow-list stops compiling until it is declared here too.\n */\n\n/**\n * Widens one generated input field to the values the gateway really accepts.\n *\n * Two codegen artefacts are corrected here:\n * - Enums are emitted as real TypeScript enums (`Visibility.Private`), which a\n * plain `'PRIVATE'` is not assignable to. Widening them to their string\n * literals lets pages pass the values they already render in `<select>`\n * options without a cast.\n * - The `JSON` scalar is mapped to `Record<string, unknown>`, but a GraphQL\n * JSON scalar accepts arrays just as happily (`variables`, `entitlements`\n * and `exampleInputs` are all JSON arrays in practice).\n *\n * Arrays are widened element-wise, so an enum list such as\n * `Array<BotmanorAgentCapability>` accepts `['MCP_TOOLS']`.\n */\ntype WidenValue<TValue> = TValue extends string\n ? `${TValue}`\n : TValue extends readonly (infer TItem)[]\n ? WidenValue<TItem>[]\n : TValue extends Record<string, unknown>\n ? TValue | unknown[]\n : TValue;\n\n/** Generated `*Input` type with its enum and JSON fields widened. */\nexport type GraphQLInput<TInput> = {\n [TKey in keyof TInput]: WidenValue<TInput[TKey]>;\n};\n\n/** The complete, compiler-checked field list of one GraphQL input type. */\nexport interface MutationInputFields<TInput> {\n readonly keys: readonly (keyof TInput)[];\n}\n\n/**\n * Declares the complete field list of a GraphQL input type.\n *\n * Every key of `TInput` must be present, so a schema field added upstream\n * surfaces as a compile error here instead of being silently dropped from\n * every mutation the hook sends.\n */\nexport function fieldsOf<TInput>(shape: Record<keyof TInput, true>): MutationInputFields<TInput> {\n return { keys: Object.keys(shape) as (keyof TInput)[] };\n}\n\n/**\n * Projects `input` onto the declared fields, dropping every key the input type\n * does not declare.\n *\n * `undefined` values are dropped (the caller left the field alone); `null` is\n * preserved because GraphQL treats it as an explicit \"clear this field\".\n */\nexport function buildMutationInput<TInput>(\n input: Partial<GraphQLInput<TInput>>,\n fields: MutationInputFields<TInput>\n): Partial<GraphQLInput<TInput>> {\n // Erased views: `TInput` is unresolved here, so the compiler cannot relate\n // `keyof TInput` to an index of the mapped type. The keys come from\n // `fieldsOf`, so every one of them is a real field of the input type.\n const source = input as Record<string, unknown>;\n const payload: Record<string, unknown> = {};\n\n for (const field of fields.keys) {\n const key = field as string;\n const value = source[key];\n if (value !== undefined) {\n payload[key] = value;\n }\n }\n\n return payload as Partial<GraphQLInput<TInput>>;\n}\n"],"mappings":";AAwDA,SAAgB,EAAiB,GAAgE;AAC/F,QAAO,EAAE,MAAM,OAAO,KAAK,EAAM,EAAsB;;AAUzD,SAAgB,EACd,GACA,GAC+B;CAI/B,IAAM,IAAS,GACT,IAAmC,EAAE;AAE3C,MAAK,IAAM,KAAS,EAAO,MAAM;EAC/B,IAAM,IAAM,GACN,IAAQ,EAAO;AACrB,EAAI,MAAU,KAAA,MACZ,EAAQ,KAAO;;AAInB,QAAO"}
1
+ {"version":3,"file":"mutationInput.js","names":["fieldsOf","shape","buildMutationInput","source","input","payload","field","fields","key","value"],"sources":["../../../../src/botlit/hooks/internal/mutationInput.ts"],"sourcesContent":["/**\n * Mutation input primitives\n * @module botlit/hooks/internal\n *\n * GraphQL rejects an input object that carries a field its input type does not\n * declare, so a mutation payload must NEVER be assembled by spreading whatever\n * value the UI happens to be holding. An Apollo result carries `__typename`,\n * `id`, `revision` and the audit columns — no `Update*Input` on\n * wspace-botlit-svc accepts any of them, and sending one fails the whole write.\n *\n * `fieldsOf` records the allow-list once per input type and `buildMutationInput`\n * projects an arbitrary caller payload onto it. The `Record<keyof TInput, true>`\n * shape is what makes this safe over time: when the schema grows a field, the\n * allow-list stops compiling until it is declared here too.\n */\n\n/**\n * Widens one generated input field to the values the gateway really accepts.\n *\n * Two codegen artefacts are corrected here:\n * - Enums are emitted as real TypeScript enums (`Visibility.Private`), which a\n * plain `'PRIVATE'` is not assignable to. Widening them to their string\n * literals lets pages pass the values they already render in `<select>`\n * options without a cast.\n * - The `JSON` scalar is mapped to `Record<string, unknown>`, but a GraphQL\n * JSON scalar accepts arrays just as happily (`variables`, `entitlements`\n * and `exampleInputs` are all JSON arrays in practice).\n *\n * Arrays are widened element-wise, so an enum list such as\n * `Array<BotmanorAgentCapability>` accepts `['MCP_TOOLS']`.\n */\ntype WidenValue<TValue> = TValue extends string\n ? `${TValue}`\n : TValue extends readonly (infer TItem)[]\n ? WidenValue<TItem>[]\n : TValue extends Record<string, unknown>\n ? TValue | unknown[]\n : TValue;\n\n/** Generated `*Input` type with its enum and JSON fields widened. */\nexport type GraphQLInput<TInput> = {\n [TKey in keyof TInput]: WidenValue<TInput[TKey]>;\n};\n\n/** The complete, compiler-checked field list of one GraphQL input type. */\nexport interface MutationInputFields<TInput> {\n readonly keys: readonly (keyof TInput)[];\n}\n\n/**\n * Declares the complete field list of a GraphQL input type.\n *\n * Every key of `TInput` must be present, so a schema field added upstream\n * surfaces as a compile error here instead of being silently dropped from\n * every mutation the hook sends.\n */\nexport function fieldsOf<TInput>(shape: Record<keyof TInput, true>): MutationInputFields<TInput> {\n return { keys: Object.keys(shape) as (keyof TInput)[] };\n}\n\n/**\n * Projects `input` onto the declared fields, dropping every key the input type\n * does not declare.\n *\n * `undefined` values are dropped (the caller left the field alone); `null` is\n * preserved because GraphQL treats it as an explicit \"clear this field\".\n */\nexport function buildMutationInput<TInput>(\n input: Partial<GraphQLInput<TInput>>,\n fields: MutationInputFields<TInput>\n): Partial<GraphQLInput<TInput>> {\n // Erased views: `TInput` is unresolved here, so the compiler cannot relate\n // `keyof TInput` to an index of the mapped type. The keys come from\n // `fieldsOf`, so every one of them is a real field of the input type.\n const source = input as Record<string, unknown>;\n const payload: Record<string, unknown> = {};\n\n for (const field of fields.keys) {\n const key = field as string;\n const value = source[key];\n if (value !== undefined) {\n payload[key] = value;\n }\n }\n\n return payload as Partial<GraphQLInput<TInput>>;\n}\n"],"mappings":";AAwDA,SAAgBA,EAAiB,GAAgE;CAC/F,OAAO,EAAE,MAAM,OAAO,KAAKC,CAAK,EAAsB;AACxD;AASA,SAAgBC,EACd,GACA,GAC+B;CAI/B,IAAMC,IAASC,GACTC,IAAmC,CAAC;CAE1C,KAAK,IAAMC,KAASC,EAAO,MAAM;EAC/B,IAAMC,IAAMF,GACNG,IAAQN,EAAOK;EACrB,AAAIC,MAAU,KAAA,MACZ,EAAQD,KAAOC;CAEnB;CAEA,OAAOJ;AACT"}
@@ -0,0 +1,54 @@
1
+ import { ApolloClient, DocumentNode } from '../../../../node_modules/@apollo/client';
2
+ export type WorkspaceClient = ApolloClient;
3
+ /** Apollo client for the workspace gateway, provided by the host shell. */
4
+ export declare function useWorkspaceClient(): WorkspaceClient;
5
+ /** Current workspace id from the BotManor context (undefined until the shell resolves it). */
6
+ export declare function useWorkspaceId(): string | undefined;
7
+ export interface QueryResult<T> {
8
+ data: T;
9
+ loading: boolean;
10
+ /** Set only when the request FAILED. An empty `data` with no `error` means "no records yet". */
11
+ error: Error | undefined;
12
+ refetch: () => Promise<void>;
13
+ }
14
+ export interface MutationState<T> {
15
+ data: T | undefined;
16
+ loading: boolean;
17
+ error: Error | undefined;
18
+ }
19
+ export interface WorkspaceQueryOptions<TData, TResult> {
20
+ /** Generated GraphQL document (see `src/generated/wspace-operations.ts`). */
21
+ document: DocumentNode;
22
+ /** Must be referentially stable — memoize at the call site. */
23
+ variables: Record<string, unknown> | undefined;
24
+ /** Projects the raw payload onto the record shape the UI consumes. */
25
+ select: (data: TData | undefined) => TResult;
26
+ /** Value held while disabled or before the first successful read. */
27
+ fallback: TResult;
28
+ /** When false the request is skipped (e.g. no workspace id / no entity id yet). */
29
+ enabled: boolean;
30
+ /** Used when the thrown value is not an Error. */
31
+ errorMessage: string;
32
+ }
33
+ /**
34
+ * Reads from the workspace gateway and keeps `{ data, loading, error, refetch }`
35
+ * in sync. `error` is reserved for real failures so callers can tell an empty
36
+ * collection apart from a failed request.
37
+ */
38
+ export declare function useWorkspaceQuery<TData, TResult>(options: WorkspaceQueryOptions<TData, TResult>): QueryResult<TResult>;
39
+ export interface WorkspaceMutationOptions<TData, TInput, TResult> {
40
+ /** Generated GraphQL document (see `src/generated/wspace-operations.ts`). */
41
+ document: DocumentNode;
42
+ /** Maps the caller's input onto GraphQL variables. */
43
+ variables: (input: TInput) => Record<string, unknown>;
44
+ /** Projects the raw payload onto the record shape the UI consumes. */
45
+ select: (data: TData | undefined) => TResult | undefined;
46
+ /** Thrown (and stored) when the payload is missing or the request fails. */
47
+ errorMessage: string;
48
+ }
49
+ /**
50
+ * Writes to the workspace gateway. Returns the `[mutate, state]` tuple used by
51
+ * the reference hooks. `mutate` REJECTS on failure so callers cannot mistake a
52
+ * failed write for a successful one.
53
+ */
54
+ export declare function useWorkspaceMutation<TData, TInput, TResult>(options: WorkspaceMutationOptions<TData, TInput, TResult>): readonly [(input: TInput) => Promise<TResult>, MutationState<TResult>];
@@ -2,7 +2,7 @@ import { useBotlit as e } from "../../providers/BotlitProvider.js";
2
2
  import { extractGraphqlFailureMessage as t } from "../../utils/errors.js";
3
3
  import { useCallback as n, useEffect as r, useLayoutEffect as i, useRef as a, useState as o } from "react";
4
4
  import { useGatewayClient as s } from "@burdenoff/fe-libs/shared/graphql";
5
- //#region src/botlit/hooks/internal/workspaceGateway.ts
5
+ // src/botlit/hooks/internal/workspaceGateway.ts
6
6
  function c() {
7
7
  return s("workspace");
8
8
  }
@@ -21,23 +21,22 @@ function d(e) {
21
21
  }
22
22
  function f(e) {
23
23
  let { document: t, variables: i, enabled: a, errorMessage: s } = e, l = c(), f = d(e.select), p = d(e.fallback), [m, h] = o(e.fallback), [g, _] = o(!1), [v, y] = o(), b = n(async () => {
24
- if (!a) {
25
- h(p.current), y(void 0);
26
- return;
27
- }
28
- _(!0), y(void 0);
29
- try {
30
- let e = await l.query({
31
- query: t,
32
- variables: i,
33
- fetchPolicy: "network-only"
34
- }), n = e.error;
35
- if (n != null) throw u(n, s);
36
- h(f.current(e.data ?? void 0));
37
- } catch (e) {
38
- h(p.current), y(u(e, s));
39
- } finally {
40
- _(!1);
24
+ if (!a) h(p.current), y(void 0);
25
+ else {
26
+ _(!0), y(void 0);
27
+ try {
28
+ let e = await l.query({
29
+ query: t,
30
+ variables: i,
31
+ fetchPolicy: "network-only"
32
+ }), n = e.error;
33
+ if (n != null) throw u(n, s);
34
+ h(f.current(e.data ?? void 0));
35
+ } catch (e) {
36
+ h(p.current), y(u(e, s));
37
+ } finally {
38
+ _(!1);
39
+ }
41
40
  }
42
41
  }, [
43
42
  l,
@@ -98,7 +97,6 @@ function p(e) {
98
97
  a
99
98
  ]), l];
100
99
  }
101
- //#endregion
102
100
  export { c as useWorkspaceClient, l as useWorkspaceId, p as useWorkspaceMutation, f as useWorkspaceQuery };
103
101
 
104
102
  //# sourceMappingURL=workspaceGateway.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workspaceGateway.js","names":[],"sources":["../../../../src/botlit/hooks/internal/workspaceGateway.ts"],"sourcesContent":["/**\n * Workspace gateway hook primitives\n * @module botlit/hooks/internal\n *\n * Every BotManor hook talks to the workspace public gateway through the Apollo\n * client the shell installs (`useGatewayClient('workspace')`) — never through a\n * client of its own. These primitives capture the exact shape used by the\n * reference hooks (`useAgents`, `useBots`): `network-only` reads, an explicit\n * `Error` in state rather than a thrown promise, and a `refetch` the caller can\n * run after a mutation.\n */\n\nimport type { ApolloClient, DocumentNode } from '@apollo/client';\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { useGatewayClient } from '@burdenoff/fe-libs/shared/graphql';\n\nimport { useBotlit } from '../../providers/BotlitProvider';\nimport { extractGraphqlFailureMessage } from '../../utils/errors';\n\nexport type WorkspaceClient = ApolloClient;\n\n/** Apollo client for the workspace gateway, provided by the host shell. */\nexport function useWorkspaceClient(): WorkspaceClient {\n return useGatewayClient('workspace');\n}\n\n/** Current workspace id from the BotManor context (undefined until the shell resolves it). */\nexport function useWorkspaceId(): string | undefined {\n return useBotlit().workspaceId;\n}\n\nexport interface QueryResult<T> {\n data: T;\n loading: boolean;\n /** Set only when the request FAILED. An empty `data` with no `error` means \"no records yet\". */\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\n\nexport interface MutationState<T> {\n data: T | undefined;\n loading: boolean;\n error: Error | undefined;\n}\n\n/**\n * Normalises any mutation failure to an Error with the server's\n * user-actionable message where one exists.\n *\n * Apollo Client v4 does not reject with a plain Error: failures arrive as\n * `{ networkError }` / `{ graphQLErrors }` objects, and the batched fetch\n * layer attaches the structured GraphQL errors as `.errors` on the\n * networkError. `extractGraphqlFailureMessage` unwraps all of those; only\n * when nothing user-actionable is present do we fall back to the hook's\n * generic `errorMessage`.\n */\nfunction toError(cause: unknown, fallbackMessage: string): Error {\n const message = extractGraphqlFailureMessage(cause);\n if (message) {\n // Preserve the original rejection on the chain so error monitoring can\n // still reach the structured GraphQL errors (extensions.code, requestId…).\n return new Error(message, { cause });\n }\n if (cause instanceof Error) return cause;\n return new Error(fallbackMessage, { cause });\n}\n\n/** Keeps a mutable ref pointing at the latest value without re-running effects. */\nfunction useLatest<T>(value: T): { readonly current: T } {\n const ref = useRef(value);\n useLayoutEffect(() => {\n ref.current = value;\n }, [value]);\n return ref;\n}\n\nexport interface WorkspaceQueryOptions<TData, TResult> {\n /** Generated GraphQL document (see `src/generated/wspace-operations.ts`). */\n document: DocumentNode;\n /** Must be referentially stable — memoize at the call site. */\n variables: Record<string, unknown> | undefined;\n /** Projects the raw payload onto the record shape the UI consumes. */\n select: (data: TData | undefined) => TResult;\n /** Value held while disabled or before the first successful read. */\n fallback: TResult;\n /** When false the request is skipped (e.g. no workspace id / no entity id yet). */\n enabled: boolean;\n /** Used when the thrown value is not an Error. */\n errorMessage: string;\n}\n\n/**\n * Reads from the workspace gateway and keeps `{ data, loading, error, refetch }`\n * in sync. `error` is reserved for real failures so callers can tell an empty\n * collection apart from a failed request.\n */\nexport function useWorkspaceQuery<TData, TResult>(\n options: WorkspaceQueryOptions<TData, TResult>\n): QueryResult<TResult> {\n const { document, variables, enabled, errorMessage } = options;\n const client = useWorkspaceClient();\n const selectRef = useLatest(options.select);\n const fallbackRef = useLatest(options.fallback);\n\n const [data, setData] = useState<TResult>(options.fallback);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | undefined>();\n\n const refetch = useCallback(async () => {\n if (!enabled) {\n setData(fallbackRef.current);\n setError(undefined);\n return;\n }\n\n setLoading(true);\n setError(undefined);\n try {\n const result = await client.query<TData>({\n query: document,\n variables,\n fetchPolicy: 'network-only',\n });\n // Apollo v4 resolves (not rejects) with `result.error` set on GraphQL\n // errors — same handling as useWorkspaceMutation.\n const operationError = (result as { error?: unknown }).error;\n if (operationError != null) {\n throw toError(operationError, errorMessage);\n }\n setData(selectRef.current(result.data ?? undefined));\n } catch (queryError) {\n setData(fallbackRef.current);\n setError(toError(queryError, errorMessage));\n } finally {\n setLoading(false);\n }\n // fallbackRef/selectRef are stable refs by construction\n }, [client, document, variables, enabled, errorMessage, fallbackRef, selectRef]);\n\n useEffect(() => {\n void refetch();\n }, [refetch]);\n\n return { data, loading, error, refetch };\n}\n\nexport interface WorkspaceMutationOptions<TData, TInput, TResult> {\n /** Generated GraphQL document (see `src/generated/wspace-operations.ts`). */\n document: DocumentNode;\n /** Maps the caller's input onto GraphQL variables. */\n variables: (input: TInput) => Record<string, unknown>;\n /** Projects the raw payload onto the record shape the UI consumes. */\n select: (data: TData | undefined) => TResult | undefined;\n /** Thrown (and stored) when the payload is missing or the request fails. */\n errorMessage: string;\n}\n\n/**\n * Writes to the workspace gateway. Returns the `[mutate, state]` tuple used by\n * the reference hooks. `mutate` REJECTS on failure so callers cannot mistake a\n * failed write for a successful one.\n */\nexport function useWorkspaceMutation<TData, TInput, TResult>(\n options: WorkspaceMutationOptions<TData, TInput, TResult>\n): readonly [(input: TInput) => Promise<TResult>, MutationState<TResult>] {\n const { document, errorMessage } = options;\n const client = useWorkspaceClient();\n const variablesRef = useLatest(options.variables);\n const selectRef = useLatest(options.select);\n\n const [state, setState] = useState<MutationState<TResult>>({\n data: undefined,\n loading: false,\n error: undefined,\n });\n\n const mutate = useCallback(\n async (input: TInput): Promise<TResult> => {\n setState({ data: undefined, loading: true, error: undefined });\n try {\n const result = await client.mutate<TData>({\n mutation: document,\n variables: variablesRef.current(input),\n });\n // Apollo v4 does not reject on GraphQL errors by default: the mutation\n // RESOLVES with `data` undefined and the failure on `result.error`\n // (CombinedGraphQLErrors / networkError). Surface it like a rejection\n // so callers see the server's field-level message, not the fallback.\n const operationError = (result as { error?: unknown }).error;\n if (operationError != null) {\n throw toError(operationError, errorMessage);\n }\n const selected = selectRef.current(result.data ?? undefined);\n if (selected === undefined) {\n throw new Error(errorMessage);\n }\n setState({ data: selected, loading: false, error: undefined });\n return selected;\n } catch (mutationError) {\n const failure = toError(mutationError, errorMessage);\n setState({ data: undefined, loading: false, error: failure });\n throw failure;\n }\n },\n [client, document, errorMessage, selectRef, variablesRef]\n );\n\n return [mutate, state] as const;\n}\n"],"mappings":";;;;;AAsBA,SAAgB,IAAsC;AACpD,QAAO,EAAiB,YAAY;;AAItC,SAAgB,IAAqC;AACnD,QAAO,GAAW,CAAC;;AA4BrB,SAAS,EAAQ,GAAgB,GAAgC;CAC/D,IAAM,IAAU,EAA6B,EAAM;AAOnD,QANI,IAGS,MAAM,GAAS,EAAE,UAAO,CAAC,GAElC,aAAiB,QAAc,IACxB,MAAM,GAAiB,EAAE,UAAO,CAAC;;AAI9C,SAAS,EAAa,GAAmC;CACvD,IAAM,IAAM,EAAO,EAAM;AAIzB,QAHA,QAAsB;AACpB,IAAI,UAAU;IACb,CAAC,EAAM,CAAC,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M,OAAO,KAAA;GAAW,CAAC;AAC9D,MAAI;GACF,IAAM,IAAS,MAAM,EAAO,OAAc;IACxC,UAAU;IACV,WAAW,EAAa,QAAQ,EAAM;IACvC,CAAC,EAKI,IAAkB,EAA+B;AACvD,OAAI,KAAkB,KACpB,OAAM,EAAQ,GAAgB,EAAa;GAE7C,IAAM,IAAW,EAAU,QAAQ,EAAO,QAAQ,KAAA,EAAU;AAC5D,OAAI,MAAa,KAAA,EACf,OAAU,MAAM,EAAa;AAG/B,UADA,EAAS;IAAE,MAAM;IAAU,SAAS;IAAO,OAAO,KAAA;IAAW,CAAC,EACvD;WACA,GAAe;GACtB,IAAM,IAAU,EAAQ,GAAe,EAAa;AAEpD,SADA,EAAS;IAAE,MAAM,KAAA;IAAW,SAAS;IAAO,OAAO;IAAS,CAAC,EACvD;;IAGV;EAAC;EAAQ;EAAU;EAAc;EAAW;EAAa,CAC1D,EAEe,EAAM"}
1
+ {"version":3,"file":"workspaceGateway.js","names":["useWorkspaceClient","useGatewayClient","useWorkspaceId","useBotlit","toError","message","extractGraphqlFailureMessage","cause","fallbackMessage","useLatest","ref","useRef","value","useLayoutEffect","useWorkspaceQuery","options","client","selectRef","fallbackRef","data","setData","useState","loading","setLoading","error","setError","refetch","useCallback","enabled","result","document","operationError","errorMessage","queryError","variables","useEffect","useWorkspaceMutation","variablesRef","state","setState","input","selected","mutationError","failure"],"sources":["../../../../src/botlit/hooks/internal/workspaceGateway.ts"],"sourcesContent":["/**\n * Workspace gateway hook primitives\n * @module botlit/hooks/internal\n *\n * Every BotManor hook talks to the workspace public gateway through the Apollo\n * client the shell installs (`useGatewayClient('workspace')`) — never through a\n * client of its own. These primitives capture the exact shape used by the\n * reference hooks (`useAgents`, `useBots`): `network-only` reads, an explicit\n * `Error` in state rather than a thrown promise, and a `refetch` the caller can\n * run after a mutation.\n */\n\nimport type { ApolloClient, DocumentNode } from '@apollo/client';\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { useGatewayClient } from '@burdenoff/fe-libs/shared/graphql';\n\nimport { useBotlit } from '../../providers/BotlitProvider';\nimport { extractGraphqlFailureMessage } from '../../utils/errors';\n\nexport type WorkspaceClient = ApolloClient;\n\n/** Apollo client for the workspace gateway, provided by the host shell. */\nexport function useWorkspaceClient(): WorkspaceClient {\n return useGatewayClient('workspace');\n}\n\n/** Current workspace id from the BotManor context (undefined until the shell resolves it). */\nexport function useWorkspaceId(): string | undefined {\n return useBotlit().workspaceId;\n}\n\nexport interface QueryResult<T> {\n data: T;\n loading: boolean;\n /** Set only when the request FAILED. An empty `data` with no `error` means \"no records yet\". */\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\n\nexport interface MutationState<T> {\n data: T | undefined;\n loading: boolean;\n error: Error | undefined;\n}\n\n/**\n * Normalises any mutation failure to an Error with the server's\n * user-actionable message where one exists.\n *\n * Apollo Client v4 does not reject with a plain Error: failures arrive as\n * `{ networkError }` / `{ graphQLErrors }` objects, and the batched fetch\n * layer attaches the structured GraphQL errors as `.errors` on the\n * networkError. `extractGraphqlFailureMessage` unwraps all of those; only\n * when nothing user-actionable is present do we fall back to the hook's\n * generic `errorMessage`.\n */\nfunction toError(cause: unknown, fallbackMessage: string): Error {\n const message = extractGraphqlFailureMessage(cause);\n if (message) {\n // Preserve the original rejection on the chain so error monitoring can\n // still reach the structured GraphQL errors (extensions.code, requestId…).\n return new Error(message, { cause });\n }\n if (cause instanceof Error) return cause;\n return new Error(fallbackMessage, { cause });\n}\n\n/** Keeps a mutable ref pointing at the latest value without re-running effects. */\nfunction useLatest<T>(value: T): { readonly current: T } {\n const ref = useRef(value);\n useLayoutEffect(() => {\n ref.current = value;\n }, [value]);\n return ref;\n}\n\nexport interface WorkspaceQueryOptions<TData, TResult> {\n /** Generated GraphQL document (see `src/generated/wspace-operations.ts`). */\n document: DocumentNode;\n /** Must be referentially stable — memoize at the call site. */\n variables: Record<string, unknown> | undefined;\n /** Projects the raw payload onto the record shape the UI consumes. */\n select: (data: TData | undefined) => TResult;\n /** Value held while disabled or before the first successful read. */\n fallback: TResult;\n /** When false the request is skipped (e.g. no workspace id / no entity id yet). */\n enabled: boolean;\n /** Used when the thrown value is not an Error. */\n errorMessage: string;\n}\n\n/**\n * Reads from the workspace gateway and keeps `{ data, loading, error, refetch }`\n * in sync. `error` is reserved for real failures so callers can tell an empty\n * collection apart from a failed request.\n */\nexport function useWorkspaceQuery<TData, TResult>(\n options: WorkspaceQueryOptions<TData, TResult>\n): QueryResult<TResult> {\n const { document, variables, enabled, errorMessage } = options;\n const client = useWorkspaceClient();\n const selectRef = useLatest(options.select);\n const fallbackRef = useLatest(options.fallback);\n\n const [data, setData] = useState<TResult>(options.fallback);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | undefined>();\n\n const refetch = useCallback(async () => {\n if (!enabled) {\n setData(fallbackRef.current);\n setError(undefined);\n return;\n }\n\n setLoading(true);\n setError(undefined);\n try {\n const result = await client.query<TData>({\n query: document,\n variables,\n fetchPolicy: 'network-only',\n });\n // Apollo v4 resolves (not rejects) with `result.error` set on GraphQL\n // errors — same handling as useWorkspaceMutation.\n const operationError = (result as { error?: unknown }).error;\n if (operationError != null) {\n throw toError(operationError, errorMessage);\n }\n setData(selectRef.current(result.data ?? undefined));\n } catch (queryError) {\n setData(fallbackRef.current);\n setError(toError(queryError, errorMessage));\n } finally {\n setLoading(false);\n }\n // fallbackRef/selectRef are stable refs by construction\n }, [client, document, variables, enabled, errorMessage, fallbackRef, selectRef]);\n\n useEffect(() => {\n void refetch();\n }, [refetch]);\n\n return { data, loading, error, refetch };\n}\n\nexport interface WorkspaceMutationOptions<TData, TInput, TResult> {\n /** Generated GraphQL document (see `src/generated/wspace-operations.ts`). */\n document: DocumentNode;\n /** Maps the caller's input onto GraphQL variables. */\n variables: (input: TInput) => Record<string, unknown>;\n /** Projects the raw payload onto the record shape the UI consumes. */\n select: (data: TData | undefined) => TResult | undefined;\n /** Thrown (and stored) when the payload is missing or the request fails. */\n errorMessage: string;\n}\n\n/**\n * Writes to the workspace gateway. Returns the `[mutate, state]` tuple used by\n * the reference hooks. `mutate` REJECTS on failure so callers cannot mistake a\n * failed write for a successful one.\n */\nexport function useWorkspaceMutation<TData, TInput, TResult>(\n options: WorkspaceMutationOptions<TData, TInput, TResult>\n): readonly [(input: TInput) => Promise<TResult>, MutationState<TResult>] {\n const { document, errorMessage } = options;\n const client = useWorkspaceClient();\n const variablesRef = useLatest(options.variables);\n const selectRef = useLatest(options.select);\n\n const [state, setState] = useState<MutationState<TResult>>({\n data: undefined,\n loading: false,\n error: undefined,\n });\n\n const mutate = useCallback(\n async (input: TInput): Promise<TResult> => {\n setState({ data: undefined, loading: true, error: undefined });\n try {\n const result = await client.mutate<TData>({\n mutation: document,\n variables: variablesRef.current(input),\n });\n // Apollo v4 does not reject on GraphQL errors by default: the mutation\n // RESOLVES with `data` undefined and the failure on `result.error`\n // (CombinedGraphQLErrors / networkError). Surface it like a rejection\n // so callers see the server's field-level message, not the fallback.\n const operationError = (result as { error?: unknown }).error;\n if (operationError != null) {\n throw toError(operationError, errorMessage);\n }\n const selected = selectRef.current(result.data ?? undefined);\n if (selected === undefined) {\n throw new Error(errorMessage);\n }\n setState({ data: selected, loading: false, error: undefined });\n return selected;\n } catch (mutationError) {\n const failure = toError(mutationError, errorMessage);\n setState({ data: undefined, loading: false, error: failure });\n throw failure;\n }\n },\n [client, document, errorMessage, selectRef, variablesRef]\n );\n\n return [mutate, state] as const;\n}\n"],"mappings":";;;;;AAsBA,SAAgBA,IAAsC;CACpD,OAAOC,EAAiB,WAAW;AACrC;AAGA,SAAgBC,IAAqC;CACnD,OAAOC,EAAU,CAAC,CAAC;AACrB;AA2BA,SAASC,EAAQ,GAAgB,GAAgC;CAC/D,IAAMC,IAAUC,EAA6BC,CAAK;CAOlD,OANIF,IAGS,MAAMA,GAAS,EAAE,SAAM,CAAC,IAEjCE,aAAiB,QAAcA,IACxB,MAAMC,GAAiB,EAAE,SAAM,CAAC;AAC7C;AAG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B,EAAUM,EAAQ,SAAS,GAC1CE,IAAYR,EAAUM,EAAQ,MAAM,GAEpC,CAACuB,GAAOC,KAAYlB,EAAiC;EACzD,MAAM,KAAA;EACN,SAAS;EACT,OAAO,KAAA;CACT,CAAC;CAiCD,OAAO,CA/BQM,EACb,OAAO,MAAoC;EACzC,EAAS;GAAE,MAAM,KAAA;GAAW,SAAS;GAAM,OAAO,KAAA;EAAU,CAAC;EAC7D,IAAI;GACF,IAAME,IAAS,MAAMb,EAAO,OAAc;IACxC,UAAUc;IACV,WAAWO,EAAa,QAAQG,CAAK;GACvC,CAAC,GAKKT,IAAkBF,EAA+B;GACvD,IAAIE,KAAkB,MACpB,MAAM3B,EAAQ2B,GAAgBC,CAAY;GAE5C,IAAMS,IAAWxB,EAAU,QAAQY,EAAO,QAAQ,KAAA,CAAS;GAC3D,IAAIY,MAAa,KAAA,GACf,MAAU,MAAMT,CAAY;GAG9B,OADAO,EAAS;IAAE,MAAME;IAAU,SAAS;IAAO,OAAO,KAAA;GAAU,CAAC,GACtDA;EACT,SAASC,GAAe;GACtB,IAAMC,IAAUvC,EAAQsC,GAAeV,CAAY;GAEnD,MADAO,EAAS;IAAE,MAAM,KAAA;IAAW,SAAS;IAAO,OAAOI;GAAQ,CAAC,GACtDA;EACR;CACF,GACA;EAAC3B;EAAQc;EAAUE;EAAcf;EAAWoB;CAAY,CAGlD,GAAQC,CAAK;AACvB"}
@@ -0,0 +1,104 @@
1
+ import { CreateA2ARegistryEntryInput, UpdateA2ARegistryEntryInput } from '../../generated/wspace-types';
2
+ import { A2AAgentFilter } from '../types';
3
+ import { GraphQLInput } from './internal/mutationInput';
4
+ import { QueryResult } from './internal/workspaceGateway';
5
+ export interface A2AAgentRecord {
6
+ id: string;
7
+ name: string;
8
+ status: string;
9
+ visibility: string;
10
+ trustLevel: string;
11
+ /** A2A agent card (the `/.well-known/agent.json` document). */
12
+ agentCard: Record<string, unknown>;
13
+ entitlements: Record<string, unknown> | unknown[];
14
+ description?: string | null;
15
+ wellKnownUrl?: string | null;
16
+ bucketId?: string | null;
17
+ metadata?: Record<string, unknown> | null;
18
+ revision: number;
19
+ tags: string[];
20
+ createdAt: string;
21
+ updatedAt: string;
22
+ createdById: string;
23
+ updatedById: string;
24
+ workspaceId: string;
25
+ }
26
+ /** `CreateA2ARegistryEntryInput` minus the `workspaceId` the hook supplies. */
27
+ export type RegisterA2AAgentVariables = Omit<GraphQLInput<CreateA2ARegistryEntryInput>, 'workspaceId'>;
28
+ export interface UpdateA2AAgentVariables {
29
+ agentId: string;
30
+ input: GraphQLInput<UpdateA2ARegistryEntryInput>;
31
+ }
32
+ export interface AgentCardValidation {
33
+ valid: boolean;
34
+ errors: string[];
35
+ }
36
+ /**
37
+ * The agent-card fields the UI renders. `agentCard` is a free-form `JSON`
38
+ * column on the service, so every field is read defensively — a card that is
39
+ * missing `capabilities`, or that stores `skills` as an object instead of an
40
+ * array, must render as "not supported"/"none" rather than throw.
41
+ */
42
+ export interface A2AAgentCardView {
43
+ url: string;
44
+ version: string;
45
+ providerOrganization: string;
46
+ documentationUrl: string;
47
+ capabilities: {
48
+ streaming: boolean;
49
+ pushNotifications: boolean;
50
+ stateTransitionHistory: boolean;
51
+ };
52
+ authenticationSchemes: string[];
53
+ defaultInputModes: string[];
54
+ defaultOutputModes: string[];
55
+ skills: A2AAgentCardSkill[];
56
+ }
57
+ export interface A2AAgentCardSkill {
58
+ id: string;
59
+ name: string;
60
+ description: string;
61
+ tags: string[];
62
+ examples: string[];
63
+ }
64
+ /** One row of the `entitlements` JSON, normalised for rendering. */
65
+ export interface A2AEntitlementView {
66
+ id: string;
67
+ sourceType: string;
68
+ sourceId: string;
69
+ allowedSkills: string[];
70
+ disallowedSkills: string[];
71
+ maxHops?: number;
72
+ }
73
+ /** Reads the renderable view of an A2A agent card out of its JSON document. */
74
+ export declare function readAgentCard(card: Record<string, unknown> | undefined): A2AAgentCardView;
75
+ /** Reads the entitlement rows out of the `entitlements` JSON column. */
76
+ export declare function readEntitlements(entitlements: Record<string, unknown> | unknown[] | null | undefined): A2AEntitlementView[];
77
+ /** Number of skills the registered agent card advertises. */
78
+ export declare function a2aAgentSkillCount(agent: Pick<A2AAgentRecord, 'agentCard'>): number;
79
+ /**
80
+ * Structural check of an A2A agent card before it is registered. This validates
81
+ * the document the caller supplies — it does NOT contact the remote agent.
82
+ */
83
+ export declare function validateAgentCard(card: Record<string, unknown> | undefined): AgentCardValidation;
84
+ export declare const a2aKeys: {
85
+ all: readonly ["a2a"];
86
+ lists: () => readonly ["a2a", "list"];
87
+ list: (filter?: A2AAgentFilter) => readonly ["a2a", "list", A2AAgentFilter | undefined];
88
+ details: () => readonly ["a2a", "detail"];
89
+ detail: (id: string) => readonly ["a2a", "detail", string];
90
+ };
91
+ export declare function useA2AAgents(filter?: A2AAgentFilter): QueryResult<A2AAgentRecord[]>;
92
+ export declare function useA2AAgent(agentId: string | undefined): QueryResult<A2AAgentRecord | null>;
93
+ export declare function useRegisterA2AAgent(): readonly [(input: RegisterA2AAgentVariables) => Promise<A2AAgentRecord>, import('./internal/workspaceGateway').MutationState<A2AAgentRecord>];
94
+ export declare function useUpdateA2AAgent(): readonly [(input: UpdateA2AAgentVariables) => Promise<A2AAgentRecord>, import('./internal/workspaceGateway').MutationState<A2AAgentRecord>];
95
+ export declare function useDeleteA2AAgent(): readonly [(input: string) => Promise<boolean>, import('./internal/workspaceGateway').MutationState<boolean>];
96
+ /**
97
+ * Validates an agent card locally before registration. There is no server-side
98
+ * validation operation, so this deliberately reports only what can be checked
99
+ * from the document itself.
100
+ */
101
+ export declare function useValidateA2AAgent(): readonly [(card: Record<string, unknown> | undefined) => Promise<AgentCardValidation>, {
102
+ readonly loading: false;
103
+ readonly error: undefined;
104
+ }];
@@ -1,9 +1,9 @@
1
- import { buildMutationInput as e, fieldsOf as t } from "./internal/mutationInput.js";
2
- import { CreateA2ARegistryEntryDocument as n, DeleteA2ARegistryEntryDocument as r, GetA2ARegistryEntryDocument as i, ListA2ARegistryEntriesDocument as a, UpdateA2ARegistryEntryDocument as o } from "../../generated/wspace-operations.js";
1
+ import { CreateA2ARegistryEntryDocument as e, DeleteA2ARegistryEntryDocument as t, GetA2ARegistryEntryDocument as n, ListA2ARegistryEntriesDocument as r, UpdateA2ARegistryEntryDocument 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/useA2A.ts
6
- var f = 100, p = t({
5
+ // src/botlit/hooks/useA2A.ts
6
+ var f = 100, p = o({
7
7
  agentCard: !0,
8
8
  bucketId: !0,
9
9
  description: !0,
@@ -16,7 +16,7 @@ var f = 100, p = t({
16
16
  visibility: !0,
17
17
  wellKnownUrl: !0,
18
18
  workspaceId: !0
19
- }), m = t({
19
+ }), m = o({
20
20
  agentCard: !0,
21
21
  bucketId: !0,
22
22
  description: !0,
@@ -97,7 +97,7 @@ function w(e) {
97
97
  "url",
98
98
  "version"
99
99
  ]) (typeof e[n] != "string" || e[n].trim() === "") && t.push(`Agent card is missing "${n}"`);
100
- return (!Array.isArray(e.skills) || e.skills.length === 0) && t.push("Agent card must advertise at least one skill"), {
100
+ return Array.isArray(e.skills) && e.skills.length !== 0 || t.push("Agent card must advertise at least one skill"), {
101
101
  valid: t.length === 0,
102
102
  errors: t
103
103
  };
@@ -106,41 +106,42 @@ function T(e) {
106
106
  return e?.listA2ARegistryEntries ?? h;
107
107
  }
108
108
  function E(e) {
109
- let t = s(), n = e?.search?.trim().toLowerCase() ?? "", r = e?.status?.[0], i = e?.visibility?.[0], o = e?.trustLevel?.[0], c = e?.bucketId;
109
+ let t = s(), n = e?.search?.trim().toLowerCase() ?? "", i = e?.status?.[0], a = e?.visibility?.[0], o = e?.trustLevel?.[0], c = e?.bucketId, p = d(() => ({
110
+ filters: {
111
+ workspaceId: t,
112
+ status: i,
113
+ visibility: a,
114
+ trustLevel: o,
115
+ bucketId: c
116
+ },
117
+ pagination: {
118
+ limit: f,
119
+ offset: 0
120
+ }
121
+ }), [
122
+ t,
123
+ i,
124
+ a,
125
+ o,
126
+ c
127
+ ]), m = u((e) => {
128
+ let t = T(e);
129
+ return n ? t.filter((e) => e.name.toLowerCase().includes(n) || (e.description ?? "").toLowerCase().includes(n)) : t;
130
+ }, [n]);
110
131
  return l({
111
- document: a,
112
- variables: d(() => ({
113
- filters: {
114
- workspaceId: t,
115
- status: r,
116
- visibility: i,
117
- trustLevel: o,
118
- bucketId: c
119
- },
120
- pagination: {
121
- limit: f,
122
- offset: 0
123
- }
124
- }), [
125
- t,
126
- r,
127
- i,
128
- o,
129
- c
130
- ]),
131
- select: u((e) => {
132
- let t = T(e);
133
- return n ? t.filter((e) => e.name.toLowerCase().includes(n) || (e.description ?? "").toLowerCase().includes(n)) : t;
134
- }, [n]),
132
+ document: r,
133
+ variables: p,
134
+ select: m,
135
135
  fallback: h,
136
136
  enabled: !!t,
137
137
  errorMessage: "Failed to load the A2A registry"
138
138
  });
139
139
  }
140
140
  function D(e) {
141
+ let t = d(() => ({ id: e ?? "" }), [e]);
141
142
  return l({
142
- document: i,
143
- variables: d(() => ({ id: e ?? "" }), [e]),
143
+ document: n,
144
+ variables: t,
144
145
  select: (e) => e?.getA2ARegistryEntry ?? null,
145
146
  fallback: null,
146
147
  enabled: !!e,
@@ -148,23 +149,23 @@ function D(e) {
148
149
  });
149
150
  }
150
151
  function O() {
151
- let t = s();
152
+ let t = s(), n = u((e) => ({ input: a({
153
+ ...e,
154
+ workspaceId: t
155
+ }, p) }), [t]);
152
156
  return c({
153
- document: n,
154
- variables: u((n) => ({ input: e({
155
- ...n,
156
- workspaceId: t
157
- }, p) }), [t]),
157
+ document: e,
158
+ variables: n,
158
159
  select: (e) => e?.createA2ARegistryEntry,
159
160
  errorMessage: "Failed to register A2A agent"
160
161
  });
161
162
  }
162
163
  function k() {
163
164
  return c({
164
- document: o,
165
- variables: ({ agentId: t, input: n }) => ({
166
- id: t,
167
- input: e(n, m)
165
+ document: i,
166
+ variables: ({ agentId: e, input: t }) => ({
167
+ id: e,
168
+ input: a(t, m)
168
169
  }),
169
170
  select: (e) => e?.updateA2ARegistryEntry,
170
171
  errorMessage: "Failed to update A2A agent"
@@ -172,13 +173,12 @@ function k() {
172
173
  }
173
174
  function A() {
174
175
  return c({
175
- document: r,
176
+ document: t,
176
177
  variables: (e) => ({ id: e }),
177
178
  select: (e) => e?.deleteA2ARegistryEntry,
178
179
  errorMessage: "Failed to remove A2A agent"
179
180
  });
180
181
  }
181
- //#endregion
182
182
  export { C as a2aAgentSkillCount, x as readAgentCard, S as readEntitlements, D as useA2AAgent, E as useA2AAgents, A as useDeleteA2AAgent, O as useRegisterA2AAgent, k as useUpdateA2AAgent, w as validateAgentCard };
183
183
 
184
184
  //# sourceMappingURL=useA2A.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useA2A.js","names":[],"sources":["../../../src/botlit/hooks/useA2A.ts"],"sourcesContent":["/**\n * A2A Registry Hooks\n * @module botlit/hooks\n *\n * Backed by the live `listA2ARegistryEntries` / `getA2ARegistryEntry`\n * operations and the create/update/delete mutations on wspace-botlit-svc.\n */\n\nimport { useCallback, useMemo } from 'react';\nimport {\n CreateA2ARegistryEntryDocument,\n DeleteA2ARegistryEntryDocument,\n GetA2ARegistryEntryDocument,\n ListA2ARegistryEntriesDocument,\n UpdateA2ARegistryEntryDocument,\n type CreateA2ARegistryEntryMutation,\n type DeleteA2ARegistryEntryMutation,\n type GetA2ARegistryEntryQuery,\n type ListA2ARegistryEntriesQuery,\n type UpdateA2ARegistryEntryMutation,\n} from '../../generated/wspace-operations';\nimport type {\n CreateA2ARegistryEntryInput,\n UpdateA2ARegistryEntryInput,\n} from '../../generated/wspace-types';\nimport type { A2AAgentFilter } from '../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 A2AAgentRecord {\n id: string;\n name: string;\n status: string;\n visibility: string;\n trustLevel: string;\n /** A2A agent card (the `/.well-known/agent.json` document). */\n agentCard: Record<string, unknown>;\n entitlements: Record<string, unknown> | unknown[];\n description?: string | null;\n wellKnownUrl?: string | null;\n bucketId?: string | 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\n/** `CreateA2ARegistryEntryInput` minus the `workspaceId` the hook supplies. */\nexport type RegisterA2AAgentVariables = Omit<\n GraphQLInput<CreateA2ARegistryEntryInput>,\n 'workspaceId'\n>;\n\nexport interface UpdateA2AAgentVariables {\n agentId: string;\n input: GraphQLInput<UpdateA2ARegistryEntryInput>;\n}\n\nconst REGISTER_AGENT_FIELDS = fieldsOf<CreateA2ARegistryEntryInput>({\n agentCard: true,\n bucketId: true,\n description: true,\n entitlements: true,\n metadata: true,\n name: true,\n status: true,\n tags: true,\n trustLevel: true,\n visibility: true,\n wellKnownUrl: true,\n workspaceId: true,\n});\n\nconst UPDATE_AGENT_FIELDS = fieldsOf<UpdateA2ARegistryEntryInput>({\n agentCard: true,\n bucketId: true,\n description: true,\n entitlements: true,\n metadata: true,\n name: true,\n status: true,\n tags: true,\n trustLevel: true,\n visibility: true,\n wellKnownUrl: true,\n});\n\nexport interface AgentCardValidation {\n valid: boolean;\n errors: string[];\n}\n\n/**\n * The agent-card fields the UI renders. `agentCard` is a free-form `JSON`\n * column on the service, so every field is read defensively — a card that is\n * missing `capabilities`, or that stores `skills` as an object instead of an\n * array, must render as \"not supported\"/\"none\" rather than throw.\n */\nexport interface A2AAgentCardView {\n url: string;\n version: string;\n providerOrganization: string;\n documentationUrl: string;\n capabilities: {\n streaming: boolean;\n pushNotifications: boolean;\n stateTransitionHistory: boolean;\n };\n authenticationSchemes: string[];\n defaultInputModes: string[];\n defaultOutputModes: string[];\n skills: A2AAgentCardSkill[];\n}\n\nexport interface A2AAgentCardSkill {\n id: string;\n name: string;\n description: string;\n tags: string[];\n examples: string[];\n}\n\n/** One row of the `entitlements` JSON, normalised for rendering. */\nexport interface A2AEntitlementView {\n id: string;\n sourceType: string;\n sourceId: string;\n allowedSkills: string[];\n disallowedSkills: string[];\n maxHops?: number;\n}\n\nconst NO_AGENTS: A2AAgentRecord[] = [];\n\nfunction asRecord(value: unknown): Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : {};\n}\n\nfunction asString(value: unknown, fallback = ''): string {\n return typeof value === 'string' ? value : fallback;\n}\n\nfunction asBoolean(value: unknown): boolean {\n return value === true;\n}\n\nfunction asStringArray(value: unknown): string[] {\n return Array.isArray(value)\n ? value.filter((entry): entry is string => typeof entry === 'string')\n : [];\n}\n\nfunction asObjectArray(value: unknown): Record<string, unknown>[] {\n return Array.isArray(value) ? value.map(asRecord) : [];\n}\n\n/** Reads the renderable view of an A2A agent card out of its JSON document. */\nexport function readAgentCard(card: Record<string, unknown> | undefined): A2AAgentCardView {\n const source = asRecord(card);\n const capabilities = asRecord(source.capabilities);\n const authentication = asRecord(source.authentication);\n\n return {\n url: asString(source.url),\n version: asString(source.version),\n providerOrganization: asString(asRecord(source.provider).organization),\n documentationUrl: asString(source.documentationUrl),\n capabilities: {\n streaming: asBoolean(capabilities.streaming),\n pushNotifications: asBoolean(capabilities.pushNotifications),\n stateTransitionHistory: asBoolean(capabilities.stateTransitionHistory),\n },\n authenticationSchemes: asStringArray(authentication.schemes),\n defaultInputModes: asStringArray(source.defaultInputModes),\n defaultOutputModes: asStringArray(source.defaultOutputModes),\n skills: asObjectArray(source.skills).map((skill, index) => ({\n id: asString(skill.id, `skill-${index}`),\n name: asString(skill.name),\n description: asString(skill.description),\n tags: asStringArray(skill.tags),\n examples: asStringArray(skill.examples),\n })),\n };\n}\n\n/** Reads the entitlement rows out of the `entitlements` JSON column. */\nexport function readEntitlements(\n entitlements: Record<string, unknown> | unknown[] | null | undefined\n): A2AEntitlementView[] {\n return asObjectArray(entitlements).map((entitlement, index) => {\n const maxHops = entitlement.maxHops;\n return {\n id: asString(entitlement.id, `entitlement-${index}`),\n sourceType: asString(entitlement.sourceType, 'unknown'),\n sourceId: asString(entitlement.sourceId),\n allowedSkills: asStringArray(entitlement.allowedSkills),\n disallowedSkills: asStringArray(entitlement.disallowedSkills),\n maxHops: typeof maxHops === 'number' ? maxHops : undefined,\n };\n });\n}\n\n/** Number of skills the registered agent card advertises. */\nexport function a2aAgentSkillCount(agent: Pick<A2AAgentRecord, 'agentCard'>): number {\n const skills = agent.agentCard?.skills;\n return Array.isArray(skills) ? skills.length : 0;\n}\n\n/**\n * Structural check of an A2A agent card before it is registered. This validates\n * the document the caller supplies — it does NOT contact the remote agent.\n */\nexport function validateAgentCard(card: Record<string, unknown> | undefined): AgentCardValidation {\n const errors: string[] = [];\n if (!card) {\n return { valid: false, errors: ['An agent card is required'] };\n }\n for (const field of ['name', 'description', 'url', 'version'] as const) {\n if (typeof card[field] !== 'string' || (card[field] as string).trim() === '') {\n errors.push(`Agent card is missing \"${field}\"`);\n }\n }\n if (!Array.isArray(card.skills) || card.skills.length === 0) {\n errors.push('Agent card must advertise at least one skill');\n }\n return { valid: errors.length === 0, errors };\n}\n\nfunction selectAgents(data: ListA2ARegistryEntriesQuery | undefined): A2AAgentRecord[] {\n return data?.listA2ARegistryEntries ?? NO_AGENTS;\n}\n\nexport const a2aKeys = {\n all: ['a2a'] as const,\n lists: () => [...a2aKeys.all, 'list'] as const,\n list: (filter?: A2AAgentFilter) => [...a2aKeys.lists(), filter] as const,\n details: () => [...a2aKeys.all, 'detail'] as const,\n detail: (id: string) => [...a2aKeys.details(), id] as const,\n};\n\nexport function useA2AAgents(filter?: A2AAgentFilter): QueryResult<A2AAgentRecord[]> {\n const workspaceId = useWorkspaceId();\n const search = filter?.search?.trim().toLowerCase() ?? '';\n const status = filter?.status?.[0];\n const visibility = filter?.visibility?.[0];\n const trustLevel = filter?.trustLevel?.[0];\n const bucketId = filter?.bucketId;\n\n const variables = useMemo(\n () => ({\n // A2ARegistryEntryFilterInput has no free-text field — search is client-side.\n filters: { workspaceId, status, visibility, trustLevel, bucketId },\n pagination: { limit: LIST_LIMIT, offset: 0 },\n }),\n [workspaceId, status, visibility, trustLevel, bucketId]\n );\n\n const select = useCallback(\n (data: ListA2ARegistryEntriesQuery | undefined): A2AAgentRecord[] => {\n const rows = selectAgents(data);\n if (!search) return rows;\n return rows.filter(\n (row) =>\n row.name.toLowerCase().includes(search) ||\n (row.description ?? '').toLowerCase().includes(search)\n );\n },\n [search]\n );\n\n return useWorkspaceQuery<ListA2ARegistryEntriesQuery, A2AAgentRecord[]>({\n document: ListA2ARegistryEntriesDocument,\n variables,\n select,\n fallback: NO_AGENTS,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load the A2A registry',\n });\n}\n\nexport function useA2AAgent(agentId: string | undefined): QueryResult<A2AAgentRecord | null> {\n const variables = useMemo(() => ({ id: agentId ?? '' }), [agentId]);\n\n return useWorkspaceQuery<GetA2ARegistryEntryQuery, A2AAgentRecord | null>({\n document: GetA2ARegistryEntryDocument,\n variables,\n select: (data) => data?.getA2ARegistryEntry ?? null,\n fallback: null,\n enabled: Boolean(agentId),\n errorMessage: 'Failed to load A2A agent',\n });\n}\n\nexport function useRegisterA2AAgent() {\n const workspaceId = useWorkspaceId();\n\n const variables = useCallback(\n (input: RegisterA2AAgentVariables) => ({\n input: buildMutationInput({ ...input, workspaceId }, REGISTER_AGENT_FIELDS),\n }),\n [workspaceId]\n );\n\n return useWorkspaceMutation<\n CreateA2ARegistryEntryMutation,\n RegisterA2AAgentVariables,\n A2AAgentRecord\n >({\n document: CreateA2ARegistryEntryDocument,\n variables,\n select: (data) => data?.createA2ARegistryEntry,\n errorMessage: 'Failed to register A2A agent',\n });\n}\n\nexport function useUpdateA2AAgent() {\n return useWorkspaceMutation<\n UpdateA2ARegistryEntryMutation,\n UpdateA2AAgentVariables,\n A2AAgentRecord\n >({\n document: UpdateA2ARegistryEntryDocument,\n variables: ({ agentId, input }) => ({\n id: agentId,\n input: buildMutationInput(input, UPDATE_AGENT_FIELDS),\n }),\n select: (data) => data?.updateA2ARegistryEntry,\n errorMessage: 'Failed to update A2A agent',\n });\n}\n\nexport function useDeleteA2AAgent() {\n return useWorkspaceMutation<DeleteA2ARegistryEntryMutation, string, boolean>({\n document: DeleteA2ARegistryEntryDocument,\n variables: (agentId) => ({ id: agentId }),\n select: (data) => data?.deleteA2ARegistryEntry,\n errorMessage: 'Failed to remove A2A agent',\n });\n}\n\n/**\n * Validates an agent card locally before registration. There is no server-side\n * validation operation, so this deliberately reports only what can be checked\n * from the document itself.\n */\nexport function useValidateA2AAgent() {\n const validate = useCallback(\n async (card: Record<string, unknown> | undefined): Promise<AgentCardValidation> =>\n validateAgentCard(card),\n []\n );\n\n return [validate, { loading: false, error: undefined }] as const;\n}\n"],"mappings":";;;;;AAkCA,IAAM,IAAa,KAmCb,IAAwB,EAAsC;CAClE,WAAW;CACX,UAAU;CACV,aAAa;CACb,cAAc;CACd,UAAU;CACV,MAAM;CACN,QAAQ;CACR,MAAM;CACN,YAAY;CACZ,YAAY;CACZ,cAAc;CACd,aAAa;CACd,CAAC,EAEI,IAAsB,EAAsC;CAChE,WAAW;CACX,UAAU;CACV,aAAa;CACb,cAAc;CACd,UAAU;CACV,MAAM;CACN,QAAQ;CACR,MAAM;CACN,YAAY;CACZ,YAAY;CACZ,cAAc;CACf,CAAC,EA+CI,IAA8B,EAAE;AAEtC,SAAS,EAAS,GAAyC;AACzD,QAAO,OAAO,KAAU,YAAY,KAAkB,CAAC,MAAM,QAAQ,EAAM,GACtE,IACD,EAAE;;AAGR,SAAS,EAAS,GAAgB,IAAW,IAAY;AACvD,QAAO,OAAO,KAAU,WAAW,IAAQ;;AAG7C,SAAS,E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e,IAAI,aAAa,CAAC,SAAS,EAAO,CACzD,GALmB;KAOtB,CAAC,EAAO,CACT;EAMC,UAAU;EACV,SAAS,EAAQ;EACjB,cAAc;EACf,CAAC;;AAGJ,SAAgB,EAAY,GAAiE;AAG3F,QAAO,EAAmE;EACxE,UAAU;EACV,WAJgB,SAAe,EAAE,IAAI,KAAW,IAAI,GAAG,CAAC,EAAQ,CAAC;EAKjE,SAAS,MAAS,GAAM,uBAAuB;EAC/C,UAAU;EACV,SAAS,EAAQ;EACjB,cAAc;EACf,CAAC;;AAGJ,SAAgB,IAAsB;CACpC,IAAM,IAAc,GAAgB;AASpC,QAAO,EAIL;EACA,UAAU;EACV,WAbgB,GACf,OAAsC,EACrC,OAAO,EAAmB;GAAE,GAAG;GAAO;GAAa,EAAE,EAAsB,EAC5E,GACD,CAAC,EAAY,CACd;EASC,SAAS,MAAS,GAAM;EACxB,cAAc;EACf,CAAC;;AAGJ,SAAgB,IAAoB;AAClC,QAAO,EAIL;EACA,UAAU;EACV,YAAY,EAAE,YAAS,gBAAa;GAClC,IAAI;GACJ,OAAO,EAAmB,GAAO,EAAoB;GACtD;EACD,SAAS,MAAS,GAAM;EACxB,cAAc;EACf,CAAC;;AAGJ,SAAgB,IAAoB;AAClC,QAAO,EAAsE;EAC3E,UAAU;EACV,YAAY,OAAa,EAAE,IAAI,GAAS;EACxC,SAAS,MAAS,GAAM;EACxB,cAAc;EACf,CAAC"}
1
+ {"version":3,"file":"useA2A.js","names":["LIST_LIMIT","REGISTER_AGENT_FIELDS","fieldsOf","UPDATE_AGENT_FIELDS","NO_AGENTS","asRecord","value","asString","fallback","asBoolean","asStringArray","entry","asObjectArray","readAgentCard","source","card","capabilities","authentication","skill","index","readEntitlements","entitlements","maxHops","entitlement","a2aAgentSkillCount","skills","agent","validateAgentCard","errors","field","selectAgents","data","useA2AAgents","workspaceId","useWorkspaceId","search","filter","status","visibility","trustLevel","bucketId","variables","useMemo","select","useCallback","rows","row","useWorkspaceQuery","ListA2ARegistryEntriesDocument","useA2AAgent","agentId","GetA2ARegistryEntryDocument","useRegisterA2AAgent","buildMutationInput","input","useWorkspaceMutation","CreateA2ARegistryEntryDocument","useUpdateA2AAgent","UpdateA2ARegistryEntryDocument","useDeleteA2AAgent","DeleteA2ARegistryEntryDocument"],"sources":["../../../src/botlit/hooks/useA2A.ts"],"sourcesContent":["/**\n * A2A Registry Hooks\n * @module botlit/hooks\n *\n * Backed by the live `listA2ARegistryEntries` / `getA2ARegistryEntry`\n * operations and the create/update/delete mutations on wspace-botlit-svc.\n */\n\nimport { useCallback, useMemo } from 'react';\nimport {\n CreateA2ARegistryEntryDocument,\n DeleteA2ARegistryEntryDocument,\n GetA2ARegistryEntryDocument,\n ListA2ARegistryEntriesDocument,\n UpdateA2ARegistryEntryDocument,\n type CreateA2ARegistryEntryMutation,\n type DeleteA2ARegistryEntryMutation,\n type GetA2ARegistryEntryQuery,\n type ListA2ARegistryEntriesQuery,\n type UpdateA2ARegistryEntryMutation,\n} from '../../generated/wspace-operations';\nimport type {\n CreateA2ARegistryEntryInput,\n UpdateA2ARegistryEntryInput,\n} from '../../generated/wspace-types';\nimport type { A2AAgentFilter } from '../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 A2AAgentRecord {\n id: string;\n name: string;\n status: string;\n visibility: string;\n trustLevel: string;\n /** A2A agent card (the `/.well-known/agent.json` document). */\n agentCard: Record<string, unknown>;\n entitlements: Record<string, unknown> | unknown[];\n description?: string | null;\n wellKnownUrl?: string | null;\n bucketId?: string | 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\n/** `CreateA2ARegistryEntryInput` minus the `workspaceId` the hook supplies. */\nexport type RegisterA2AAgentVariables = Omit<\n GraphQLInput<CreateA2ARegistryEntryInput>,\n 'workspaceId'\n>;\n\nexport interface UpdateA2AAgentVariables {\n agentId: string;\n input: GraphQLInput<UpdateA2ARegistryEntryInput>;\n}\n\nconst REGISTER_AGENT_FIELDS = fieldsOf<CreateA2ARegistryEntryInput>({\n agentCard: true,\n bucketId: true,\n description: true,\n entitlements: true,\n metadata: true,\n name: true,\n status: true,\n tags: true,\n trustLevel: true,\n visibility: true,\n wellKnownUrl: true,\n workspaceId: true,\n});\n\nconst UPDATE_AGENT_FIELDS = fieldsOf<UpdateA2ARegistryEntryInput>({\n agentCard: true,\n bucketId: true,\n description: true,\n entitlements: true,\n metadata: true,\n name: true,\n status: true,\n tags: true,\n trustLevel: true,\n visibility: true,\n wellKnownUrl: true,\n});\n\nexport interface AgentCardValidation {\n valid: boolean;\n errors: string[];\n}\n\n/**\n * The agent-card fields the UI renders. `agentCard` is a free-form `JSON`\n * column on the service, so every field is read defensively — a card that is\n * missing `capabilities`, or that stores `skills` as an object instead of an\n * array, must render as \"not supported\"/\"none\" rather than throw.\n */\nexport interface A2AAgentCardView {\n url: string;\n version: string;\n providerOrganization: string;\n documentationUrl: string;\n capabilities: {\n streaming: boolean;\n pushNotifications: boolean;\n stateTransitionHistory: boolean;\n };\n authenticationSchemes: string[];\n defaultInputModes: string[];\n defaultOutputModes: string[];\n skills: A2AAgentCardSkill[];\n}\n\nexport interface A2AAgentCardSkill {\n id: string;\n name: string;\n description: string;\n tags: string[];\n examples: string[];\n}\n\n/** One row of the `entitlements` JSON, normalised for rendering. */\nexport interface A2AEntitlementView {\n id: string;\n sourceType: string;\n sourceId: string;\n allowedSkills: string[];\n disallowedSkills: string[];\n maxHops?: number;\n}\n\nconst NO_AGENTS: A2AAgentRecord[] = [];\n\nfunction asRecord(value: unknown): Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : {};\n}\n\nfunction asString(value: unknown, fallback = ''): string {\n return typeof value === 'string' ? value : fallback;\n}\n\nfunction asBoolean(value: unknown): boolean {\n return value === true;\n}\n\nfunction asStringArray(value: unknown): string[] {\n return Array.isArray(value)\n ? value.filter((entry): entry is string => typeof entry === 'string')\n : [];\n}\n\nfunction asObjectArray(value: unknown): Record<string, unknown>[] {\n return Array.isArray(value) ? value.map(asRecord) : [];\n}\n\n/** Reads the renderable view of an A2A agent card out of its JSON document. */\nexport function readAgentCard(card: Record<string, unknown> | undefined): A2AAgentCardView {\n const source = asRecord(card);\n const capabilities = asRecord(source.capabilities);\n const authentication = asRecord(source.authentication);\n\n return {\n url: asString(source.url),\n version: asString(source.version),\n providerOrganization: asString(asRecord(source.provider).organization),\n documentationUrl: asString(source.documentationUrl),\n capabilities: {\n streaming: asBoolean(capabilities.streaming),\n pushNotifications: asBoolean(capabilities.pushNotifications),\n stateTransitionHistory: asBoolean(capabilities.stateTransitionHistory),\n },\n authenticationSchemes: asStringArray(authentication.schemes),\n defaultInputModes: asStringArray(source.defaultInputModes),\n defaultOutputModes: asStringArray(source.defaultOutputModes),\n skills: asObjectArray(source.skills).map((skill, index) => ({\n id: asString(skill.id, `skill-${index}`),\n name: asString(skill.name),\n description: asString(skill.description),\n tags: asStringArray(skill.tags),\n examples: asStringArray(skill.examples),\n })),\n };\n}\n\n/** Reads the entitlement rows out of the `entitlements` JSON column. */\nexport function readEntitlements(\n entitlements: Record<string, unknown> | unknown[] | null | undefined\n): A2AEntitlementView[] {\n return asObjectArray(entitlements).map((entitlement, index) => {\n const maxHops = entitlement.maxHops;\n return {\n id: asString(entitlement.id, `entitlement-${index}`),\n sourceType: asString(entitlement.sourceType, 'unknown'),\n sourceId: asString(entitlement.sourceId),\n allowedSkills: asStringArray(entitlement.allowedSkills),\n disallowedSkills: asStringArray(entitlement.disallowedSkills),\n maxHops: typeof maxHops === 'number' ? maxHops : undefined,\n };\n });\n}\n\n/** Number of skills the registered agent card advertises. */\nexport function a2aAgentSkillCount(agent: Pick<A2AAgentRecord, 'agentCard'>): number {\n const skills = agent.agentCard?.skills;\n return Array.isArray(skills) ? skills.length : 0;\n}\n\n/**\n * Structural check of an A2A agent card before it is registered. This validates\n * the document the caller supplies — it does NOT contact the remote agent.\n */\nexport function validateAgentCard(card: Record<string, unknown> | undefined): AgentCardValidation {\n const errors: string[] = [];\n if (!card) {\n return { valid: false, errors: ['An agent card is required'] };\n }\n for (const field of ['name', 'description', 'url', 'version'] as const) {\n if (typeof card[field] !== 'string' || (card[field] as string).trim() === '') {\n errors.push(`Agent card is missing \"${field}\"`);\n }\n }\n if (!Array.isArray(card.skills) || card.skills.length === 0) {\n errors.push('Agent card must advertise at least one skill');\n }\n return { valid: errors.length === 0, errors };\n}\n\nfunction selectAgents(data: ListA2ARegistryEntriesQuery | undefined): A2AAgentRecord[] {\n return data?.listA2ARegistryEntries ?? NO_AGENTS;\n}\n\nexport const a2aKeys = {\n all: ['a2a'] as const,\n lists: () => [...a2aKeys.all, 'list'] as const,\n list: (filter?: A2AAgentFilter) => [...a2aKeys.lists(), filter] as const,\n details: () => [...a2aKeys.all, 'detail'] as const,\n detail: (id: string) => [...a2aKeys.details(), id] as const,\n};\n\nexport function useA2AAgents(filter?: A2AAgentFilter): QueryResult<A2AAgentRecord[]> {\n const workspaceId = useWorkspaceId();\n const search = filter?.search?.trim().toLowerCase() ?? '';\n const status = filter?.status?.[0];\n const visibility = filter?.visibility?.[0];\n const trustLevel = filter?.trustLevel?.[0];\n const bucketId = filter?.bucketId;\n\n const variables = useMemo(\n () => ({\n // A2ARegistryEntryFilterInput has no free-text field — search is client-side.\n filters: { workspaceId, status, visibility, trustLevel, bucketId },\n pagination: { limit: LIST_LIMIT, offset: 0 },\n }),\n [workspaceId, status, visibility, trustLevel, bucketId]\n );\n\n const select = useCallback(\n (data: ListA2ARegistryEntriesQuery | undefined): A2AAgentRecord[] => {\n const rows = selectAgents(data);\n if (!search) return rows;\n return rows.filter(\n (row) =>\n row.name.toLowerCase().includes(search) ||\n (row.description ?? '').toLowerCase().includes(search)\n );\n },\n [search]\n );\n\n return useWorkspaceQuery<ListA2ARegistryEntriesQuery, A2AAgentRecord[]>({\n document: ListA2ARegistryEntriesDocument,\n variables,\n select,\n fallback: NO_AGENTS,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load the A2A registry',\n });\n}\n\nexport function useA2AAgent(agentId: string | undefined): QueryResult<A2AAgentRecord | null> {\n const variables = useMemo(() => ({ id: agentId ?? '' }), [agentId]);\n\n return useWorkspaceQuery<GetA2ARegistryEntryQuery, A2AAgentRecord | null>({\n document: GetA2ARegistryEntryDocument,\n variables,\n select: (data) => data?.getA2ARegistryEntry ?? null,\n fallback: null,\n enabled: Boolean(agentId),\n errorMessage: 'Failed to load A2A agent',\n });\n}\n\nexport function useRegisterA2AAgent() {\n const workspaceId = useWorkspaceId();\n\n const variables = useCallback(\n (input: RegisterA2AAgentVariables) => ({\n input: buildMutationInput({ ...input, workspaceId }, REGISTER_AGENT_FIELDS),\n }),\n [workspaceId]\n );\n\n return useWorkspaceMutation<\n CreateA2ARegistryEntryMutation,\n RegisterA2AAgentVariables,\n A2AAgentRecord\n >({\n document: CreateA2ARegistryEntryDocument,\n variables,\n select: (data) => data?.createA2ARegistryEntry,\n errorMessage: 'Failed to register A2A agent',\n });\n}\n\nexport function useUpdateA2AAgent() {\n return useWorkspaceMutation<\n UpdateA2ARegistryEntryMutation,\n UpdateA2AAgentVariables,\n A2AAgentRecord\n >({\n document: UpdateA2ARegistryEntryDocument,\n variables: ({ agentId, input }) => ({\n id: agentId,\n input: buildMutationInput(input, UPDATE_AGENT_FIELDS),\n }),\n select: (data) => data?.updateA2ARegistryEntry,\n errorMessage: 'Failed to update A2A agent',\n });\n}\n\nexport function useDeleteA2AAgent() {\n return useWorkspaceMutation<DeleteA2ARegistryEntryMutation, string, boolean>({\n document: DeleteA2ARegistryEntryDocument,\n variables: (agentId) => ({ id: agentId }),\n select: (data) => data?.deleteA2ARegistryEntry,\n errorMessage: 'Failed to remove A2A agent',\n });\n}\n\n/**\n * Validates an agent card locally before registration. There is no server-side\n * validation operation, so this deliberately reports only what can be checked\n * from the document itself.\n */\nexport function useValidateA2AAgent() {\n const validate = useCallback(\n async (card: Record<string, unknown> | undefined): Promise<AgentCardValidation> =>\n validateAgentCard(card),\n []\n );\n\n return [validate, { loading: false, error: undefined }] as const;\n}\n"],"mappings":";;;;;AAkCA,IAAMA,IAAa,KAmCbC,IAAwBC,EAAsC;CAClE,WAAW;CACX,UAAU;CACV,aAAa;CACb,cAAc;CACd,UAAU;CACV,MAAM;CACN,QAAQ;CACR,MAAM;CACN,YAAY;CACZ,YAAY;CACZ,cAAc;CACd,aAAa;AACf,CAAC,GAEKC,IAAsBD,EAAsC;CAChE,WAAW;CACX,UAAU;CACV,aAAa;CACb,cAAc;CACd,UAAU;CACV,MAAM;CACN,QAAQ;CACR,MAAM;CACN,YAAY;CACZ,YAAY;CACZ,cAAc;AAChB,CAAC,GA+CKE,IAA8B,CAAC;AAErC,SAASC,EAAS,GAAyC;CACzD,OAAO,OAAOC,KAAU,YAAYA,KAAkB,CAAC,MAAM,QAAQA,CAAK,IACrEA,IACD,CAAC;AACP;AAEA,SAASC,EAAS,GAAgB,IAAW,IAAY;CACvD,OAAO,OAAOD,KAAU,WAAWA,IAAQE;AAC7C;AAEA,SAASC,EAAU,GAAyB;CAC1C,OAAOH,MAAU;AACnB;AAEA,SAASI,EAAc,GAA0B;CAC/C,OAAO,MAAM,QAAQJ,CAAK,IACtBA,EAAM,QAAQ,MAA2B,OAAOK,KAAU,QAAQ,IAClE,CAAC;AACP;AAEA,SAASC,EAAc,GAA2C;CAChE,OAAO,MAAM,QAAQN,CAAK,IAAIA,EAAM,IAAID,CAAQ,IAAI,CAAC;AACvD;AAGA,SAAgBQ,EAAc,GAA6D;CACzF,IAAMC,IAAST,EAASU,CAAI,GACtBC,IAAeX,EAASS,EAAO,YAAY,GAC3CG,IAAiBZ,EAASS,EAAO,cAAc;CAErD,OAAO;EACL,KAAKP,EAASO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