@stigmer/react 0.0.71 → 0.0.73

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 (440) hide show
  1. package/agent/AgentEnvForm.d.ts +2 -0
  2. package/agent/AgentEnvForm.d.ts.map +1 -1
  3. package/agent/AgentEnvForm.js.map +1 -1
  4. package/agent/AgentPicker.d.ts +2 -0
  5. package/agent/AgentPicker.d.ts.map +1 -1
  6. package/agent/AgentPicker.js.map +1 -1
  7. package/agent/agentSetupReducer.d.ts +69 -7
  8. package/agent/agentSetupReducer.d.ts.map +1 -1
  9. package/agent/agentSetupReducer.js.map +1 -1
  10. package/agent/useAgentCount.d.ts +2 -0
  11. package/agent/useAgentCount.d.ts.map +1 -1
  12. package/agent/useAgentCount.js.map +1 -1
  13. package/attachment/AttachmentChipList.d.ts +15 -0
  14. package/attachment/AttachmentChipList.d.ts.map +1 -1
  15. package/attachment/AttachmentChipList.js +15 -0
  16. package/attachment/AttachmentChipList.js.map +1 -1
  17. package/attachment/useAttachments.d.ts +14 -0
  18. package/attachment/useAttachments.d.ts.map +1 -1
  19. package/attachment/useAttachments.js.map +1 -1
  20. package/composer/useComposer.d.ts +5 -0
  21. package/composer/useComposer.d.ts.map +1 -1
  22. package/composer/useComposer.js.map +1 -1
  23. package/execution/ExecutionPhaseBadge.d.ts +1 -1
  24. package/execution/ExecutionPhaseBadge.js +1 -1
  25. package/execution/McpToolDetail.d.ts +16 -8
  26. package/execution/McpToolDetail.d.ts.map +1 -1
  27. package/execution/McpToolDetail.js +0 -6
  28. package/execution/McpToolDetail.js.map +1 -1
  29. package/execution/TodoList.d.ts +8 -0
  30. package/execution/TodoList.d.ts.map +1 -1
  31. package/execution/TodoList.js +8 -0
  32. package/execution/TodoList.js.map +1 -1
  33. package/execution/ToolArgsView.d.ts +1 -0
  34. package/execution/ToolArgsView.d.ts.map +1 -1
  35. package/execution/ToolArgsView.js.map +1 -1
  36. package/execution/UsageWidget.d.ts +1 -1
  37. package/execution/UsageWidget.js +1 -1
  38. package/execution/file-path-resolver.d.ts +10 -0
  39. package/execution/file-path-resolver.d.ts.map +1 -1
  40. package/execution/file-path-resolver.js.map +1 -1
  41. package/execution/index.d.ts +1 -1
  42. package/execution/index.d.ts.map +1 -1
  43. package/execution/index.js.map +1 -1
  44. package/execution/useArtifactContent.d.ts +33 -0
  45. package/execution/useArtifactContent.d.ts.map +1 -1
  46. package/execution/useArtifactContent.js +33 -0
  47. package/execution/useArtifactContent.js.map +1 -1
  48. package/execution/useSubmitApproval.d.ts +2 -0
  49. package/execution/useSubmitApproval.d.ts.map +1 -1
  50. package/execution/useSubmitApproval.js.map +1 -1
  51. package/github/GitHubRepoPicker.d.ts +13 -0
  52. package/github/GitHubRepoPicker.d.ts.map +1 -1
  53. package/github/GitHubRepoPicker.js +13 -0
  54. package/github/GitHubRepoPicker.js.map +1 -1
  55. package/github/useGitHubConnection.d.ts +29 -1
  56. package/github/useGitHubConnection.d.ts.map +1 -1
  57. package/github/useGitHubConnection.js +29 -1
  58. package/github/useGitHubConnection.js.map +1 -1
  59. package/github/useGitHubRepos.d.ts +31 -0
  60. package/github/useGitHubRepos.d.ts.map +1 -1
  61. package/github/useGitHubRepos.js +31 -0
  62. package/github/useGitHubRepos.js.map +1 -1
  63. package/github/useGitHubSearch.d.ts +25 -0
  64. package/github/useGitHubSearch.d.ts.map +1 -1
  65. package/github/useGitHubSearch.js +25 -0
  66. package/github/useGitHubSearch.js.map +1 -1
  67. package/iam-policy/GrantAccessForm.d.ts +39 -0
  68. package/iam-policy/GrantAccessForm.d.ts.map +1 -0
  69. package/iam-policy/GrantAccessForm.js +75 -0
  70. package/iam-policy/GrantAccessForm.js.map +1 -0
  71. package/iam-policy/OrgMembersPanel.d.ts +28 -0
  72. package/iam-policy/OrgMembersPanel.d.ts.map +1 -0
  73. package/iam-policy/OrgMembersPanel.js +192 -0
  74. package/iam-policy/OrgMembersPanel.js.map +1 -0
  75. package/iam-policy/RoleSelector.d.ts +37 -0
  76. package/iam-policy/RoleSelector.d.ts.map +1 -0
  77. package/iam-policy/RoleSelector.js +42 -0
  78. package/iam-policy/RoleSelector.js.map +1 -0
  79. package/iam-policy/index.d.ts +12 -0
  80. package/iam-policy/index.d.ts.map +1 -0
  81. package/iam-policy/index.js +12 -0
  82. package/iam-policy/index.js.map +1 -0
  83. package/iam-policy/useCreateIamPolicy.d.ts +35 -0
  84. package/iam-policy/useCreateIamPolicy.d.ts.map +1 -0
  85. package/iam-policy/useCreateIamPolicy.js +46 -0
  86. package/iam-policy/useCreateIamPolicy.js.map +1 -0
  87. package/iam-policy/useDeleteIamPolicy.d.ts +34 -0
  88. package/iam-policy/useDeleteIamPolicy.d.ts.map +1 -0
  89. package/iam-policy/useDeleteIamPolicy.js +45 -0
  90. package/iam-policy/useDeleteIamPolicy.js.map +1 -0
  91. package/iam-policy/useGrantableRoles.d.ts +28 -0
  92. package/iam-policy/useGrantableRoles.d.ts.map +1 -0
  93. package/iam-policy/useGrantableRoles.js +32 -0
  94. package/iam-policy/useGrantableRoles.js.map +1 -0
  95. package/iam-policy/usePrincipalsCount.d.ts +31 -0
  96. package/iam-policy/usePrincipalsCount.d.ts.map +1 -0
  97. package/iam-policy/usePrincipalsCount.js +72 -0
  98. package/iam-policy/usePrincipalsCount.js.map +1 -0
  99. package/iam-policy/useResourceAccess.d.ts +51 -0
  100. package/iam-policy/useResourceAccess.d.ts.map +1 -0
  101. package/iam-policy/useResourceAccess.js +85 -0
  102. package/iam-policy/useResourceAccess.js.map +1 -0
  103. package/iam-policy/useRevokeOrgAccess.d.ts +36 -0
  104. package/iam-policy/useRevokeOrgAccess.d.ts.map +1 -0
  105. package/iam-policy/useRevokeOrgAccess.js +48 -0
  106. package/iam-policy/useRevokeOrgAccess.js.map +1 -0
  107. package/iam-policy/useRoleSelector.d.ts +52 -0
  108. package/iam-policy/useRoleSelector.d.ts.map +1 -0
  109. package/iam-policy/useRoleSelector.js +50 -0
  110. package/iam-policy/useRoleSelector.js.map +1 -0
  111. package/iam-policy/useWhoAmI.d.ts +30 -0
  112. package/iam-policy/useWhoAmI.d.ts.map +1 -0
  113. package/iam-policy/useWhoAmI.js +56 -0
  114. package/iam-policy/useWhoAmI.js.map +1 -0
  115. package/identity-provider/CreateIdentityProviderForm.d.ts +39 -0
  116. package/identity-provider/CreateIdentityProviderForm.d.ts.map +1 -0
  117. package/identity-provider/CreateIdentityProviderForm.js +102 -0
  118. package/identity-provider/CreateIdentityProviderForm.js.map +1 -0
  119. package/identity-provider/IdentityProviderDetailPanel.d.ts +42 -0
  120. package/identity-provider/IdentityProviderDetailPanel.d.ts.map +1 -0
  121. package/identity-provider/IdentityProviderDetailPanel.js +156 -0
  122. package/identity-provider/IdentityProviderDetailPanel.js.map +1 -0
  123. package/identity-provider/IdentityProviderListPanel.d.ts +41 -0
  124. package/identity-provider/IdentityProviderListPanel.d.ts.map +1 -0
  125. package/identity-provider/IdentityProviderListPanel.js +110 -0
  126. package/identity-provider/IdentityProviderListPanel.js.map +1 -0
  127. package/identity-provider/IdentityProviderWizard.d.ts +40 -0
  128. package/identity-provider/IdentityProviderWizard.d.ts.map +1 -0
  129. package/identity-provider/IdentityProviderWizard.js +180 -0
  130. package/identity-provider/IdentityProviderWizard.js.map +1 -0
  131. package/identity-provider/ProviderPicker.d.ts +28 -0
  132. package/identity-provider/ProviderPicker.d.ts.map +1 -0
  133. package/identity-provider/ProviderPicker.js +64 -0
  134. package/identity-provider/ProviderPicker.js.map +1 -0
  135. package/identity-provider/SsoLoginPrompt.d.ts +51 -0
  136. package/identity-provider/SsoLoginPrompt.d.ts.map +1 -0
  137. package/identity-provider/SsoLoginPrompt.js +119 -0
  138. package/identity-provider/SsoLoginPrompt.js.map +1 -0
  139. package/identity-provider/index.d.ts +14 -0
  140. package/identity-provider/index.d.ts.map +1 -0
  141. package/identity-provider/index.js +14 -0
  142. package/identity-provider/index.js.map +1 -0
  143. package/identity-provider/presets.d.ts +65 -0
  144. package/identity-provider/presets.d.ts.map +1 -0
  145. package/identity-provider/presets.js +200 -0
  146. package/identity-provider/presets.js.map +1 -0
  147. package/identity-provider/useCreateIdentityProvider.d.ts +37 -0
  148. package/identity-provider/useCreateIdentityProvider.d.ts.map +1 -0
  149. package/identity-provider/useCreateIdentityProvider.js +48 -0
  150. package/identity-provider/useCreateIdentityProvider.js.map +1 -0
  151. package/identity-provider/useDeleteIdentityProvider.d.ts +34 -0
  152. package/identity-provider/useDeleteIdentityProvider.d.ts.map +1 -0
  153. package/identity-provider/useDeleteIdentityProvider.js +45 -0
  154. package/identity-provider/useDeleteIdentityProvider.js.map +1 -0
  155. package/identity-provider/useIdentityProvider.d.ts +37 -0
  156. package/identity-provider/useIdentityProvider.d.ts.map +1 -0
  157. package/identity-provider/useIdentityProvider.js +62 -0
  158. package/identity-provider/useIdentityProvider.js.map +1 -0
  159. package/identity-provider/useIdentityProviderList.d.ts +48 -0
  160. package/identity-provider/useIdentityProviderList.d.ts.map +1 -0
  161. package/identity-provider/useIdentityProviderList.js +75 -0
  162. package/identity-provider/useIdentityProviderList.js.map +1 -0
  163. package/identity-provider/useOidcDiscovery.d.ts +39 -0
  164. package/identity-provider/useOidcDiscovery.d.ts.map +1 -0
  165. package/identity-provider/useOidcDiscovery.js +76 -0
  166. package/identity-provider/useOidcDiscovery.js.map +1 -0
  167. package/identity-provider/useSsoProvider.d.ts +50 -0
  168. package/identity-provider/useSsoProvider.d.ts.map +1 -0
  169. package/identity-provider/useSsoProvider.js +83 -0
  170. package/identity-provider/useSsoProvider.js.map +1 -0
  171. package/identity-provider/useUpdateIdentityProvider.d.ts +38 -0
  172. package/identity-provider/useUpdateIdentityProvider.d.ts.map +1 -0
  173. package/identity-provider/useUpdateIdentityProvider.js +49 -0
  174. package/identity-provider/useUpdateIdentityProvider.js.map +1 -0
  175. package/index.d.ts +14 -5
  176. package/index.d.ts.map +1 -1
  177. package/index.js +10 -2
  178. package/index.js.map +1 -1
  179. package/internal/CloudFeatureNotice.d.ts +12 -0
  180. package/internal/CloudFeatureNotice.d.ts.map +1 -1
  181. package/internal/CloudFeatureNotice.js +12 -0
  182. package/internal/CloudFeatureNotice.js.map +1 -1
  183. package/invitation/InvitationCreatedAlert.d.ts +35 -0
  184. package/invitation/InvitationCreatedAlert.d.ts.map +1 -0
  185. package/invitation/InvitationCreatedAlert.js +60 -0
  186. package/invitation/InvitationCreatedAlert.js.map +1 -0
  187. package/invitation/InvitationManager.d.ts +44 -0
  188. package/invitation/InvitationManager.d.ts.map +1 -0
  189. package/invitation/InvitationManager.js +248 -0
  190. package/invitation/InvitationManager.js.map +1 -0
  191. package/invitation/InvitationRedemption.d.ts +69 -0
  192. package/invitation/InvitationRedemption.d.ts.map +1 -0
  193. package/invitation/InvitationRedemption.js +140 -0
  194. package/invitation/InvitationRedemption.js.map +1 -0
  195. package/invitation/index.d.ts +17 -0
  196. package/invitation/index.d.ts.map +1 -0
  197. package/invitation/index.js +9 -0
  198. package/invitation/index.js.map +1 -0
  199. package/invitation/useCreateInvitation.d.ts +52 -0
  200. package/invitation/useCreateInvitation.d.ts.map +1 -0
  201. package/invitation/useCreateInvitation.js +55 -0
  202. package/invitation/useCreateInvitation.js.map +1 -0
  203. package/invitation/useInvitationPreview.d.ts +51 -0
  204. package/invitation/useInvitationPreview.d.ts.map +1 -0
  205. package/invitation/useInvitationPreview.js +80 -0
  206. package/invitation/useInvitationPreview.js.map +1 -0
  207. package/invitation/useOrgInvitations.d.ts +36 -0
  208. package/invitation/useOrgInvitations.d.ts.map +1 -0
  209. package/invitation/useOrgInvitations.js +65 -0
  210. package/invitation/useOrgInvitations.js.map +1 -0
  211. package/invitation/useRedeemInvitation.d.ts +47 -0
  212. package/invitation/useRedeemInvitation.d.ts.map +1 -0
  213. package/invitation/useRedeemInvitation.js +53 -0
  214. package/invitation/useRedeemInvitation.js.map +1 -0
  215. package/invitation/useRevokeInvitation.d.ts +35 -0
  216. package/invitation/useRevokeInvitation.d.ts.map +1 -0
  217. package/invitation/useRevokeInvitation.js +47 -0
  218. package/invitation/useRevokeInvitation.js.map +1 -0
  219. package/library/detect-skill-package.d.ts +1 -0
  220. package/library/detect-skill-package.d.ts.map +1 -1
  221. package/library/detect-skill-package.js.map +1 -1
  222. package/library/detect-stigmer-resource.d.ts +1 -0
  223. package/library/detect-stigmer-resource.d.ts.map +1 -1
  224. package/library/detect-stigmer-resource.js.map +1 -1
  225. package/library/parse-resource-yaml.d.ts +4 -0
  226. package/library/parse-resource-yaml.d.ts.map +1 -1
  227. package/library/parse-resource-yaml.js.map +1 -1
  228. package/mcp-server/McpServerDetailView.d.ts +2 -2
  229. package/mcp-server/McpServerDetailView.d.ts.map +1 -1
  230. package/mcp-server/McpServerDetailView.js.map +1 -1
  231. package/mcp-server/index.d.ts +1 -1
  232. package/mcp-server/index.d.ts.map +1 -1
  233. package/mcp-server/index.js.map +1 -1
  234. package/mcp-server/mcpServerSetupReducer.d.ts +54 -0
  235. package/mcp-server/mcpServerSetupReducer.d.ts.map +1 -1
  236. package/mcp-server/mcpServerSetupReducer.js.map +1 -1
  237. package/models/ModelSelector.d.ts +9 -0
  238. package/models/ModelSelector.d.ts.map +1 -1
  239. package/models/ModelSelector.js +9 -0
  240. package/models/ModelSelector.js.map +1 -1
  241. package/models/registry.d.ts +11 -1
  242. package/models/registry.d.ts.map +1 -1
  243. package/models/registry.js.map +1 -1
  244. package/models/useModelRegistry.d.ts +20 -0
  245. package/models/useModelRegistry.d.ts.map +1 -1
  246. package/models/useModelRegistry.js +20 -0
  247. package/models/useModelRegistry.js.map +1 -1
  248. package/organization/OrgProfilePanel.d.ts +31 -0
  249. package/organization/OrgProfilePanel.d.ts.map +1 -0
  250. package/organization/OrgProfilePanel.js +147 -0
  251. package/organization/OrgProfilePanel.js.map +1 -0
  252. package/organization/index.d.ts +6 -0
  253. package/organization/index.d.ts.map +1 -1
  254. package/organization/index.js +3 -0
  255. package/organization/index.js.map +1 -1
  256. package/organization/useOrganization.d.ts +31 -0
  257. package/organization/useOrganization.d.ts.map +1 -0
  258. package/organization/useOrganization.js +56 -0
  259. package/organization/useOrganization.js.map +1 -0
  260. package/organization/useUpdateOrganization.d.ts +40 -0
  261. package/organization/useUpdateOrganization.d.ts.map +1 -0
  262. package/organization/useUpdateOrganization.js +51 -0
  263. package/organization/useUpdateOrganization.js.map +1 -0
  264. package/package.json +4 -4
  265. package/provider.d.ts +1 -0
  266. package/provider.d.ts.map +1 -1
  267. package/provider.js.map +1 -1
  268. package/search/useResourceList.d.ts +4 -2
  269. package/search/useResourceList.d.ts.map +1 -1
  270. package/search/useResourceList.js +2 -1
  271. package/search/useResourceList.js.map +1 -1
  272. package/search/useResourceSearch.d.ts +10 -2
  273. package/search/useResourceSearch.d.ts.map +1 -1
  274. package/search/useResourceSearch.js +2 -1
  275. package/search/useResourceSearch.js.map +1 -1
  276. package/session/group-sessions.d.ts +23 -0
  277. package/session/group-sessions.d.ts.map +1 -1
  278. package/session/group-sessions.js +23 -0
  279. package/session/group-sessions.js.map +1 -1
  280. package/session/index.d.ts +1 -1
  281. package/session/index.d.ts.map +1 -1
  282. package/session/index.js.map +1 -1
  283. package/session/useCreateSession.d.ts +11 -2
  284. package/session/useCreateSession.d.ts.map +1 -1
  285. package/session/useCreateSession.js.map +1 -1
  286. package/session/useSession.d.ts +24 -0
  287. package/session/useSession.d.ts.map +1 -1
  288. package/session/useSession.js +24 -0
  289. package/session/useSession.js.map +1 -1
  290. package/session/useSessionArtifacts.d.ts +1 -0
  291. package/session/useSessionArtifacts.d.ts.map +1 -1
  292. package/session/useSessionArtifacts.js.map +1 -1
  293. package/session/useSessionConversation.d.ts +7 -0
  294. package/session/useSessionConversation.d.ts.map +1 -1
  295. package/session/useSessionConversation.js.map +1 -1
  296. package/session/useSessionExecutions.d.ts +23 -0
  297. package/session/useSessionExecutions.d.ts.map +1 -1
  298. package/session/useSessionExecutions.js +23 -0
  299. package/session/useSessionExecutions.js.map +1 -1
  300. package/session/useSessionList.d.ts +19 -0
  301. package/session/useSessionList.d.ts.map +1 -1
  302. package/session/useSessionList.js +19 -0
  303. package/session/useSessionList.js.map +1 -1
  304. package/session/useSessionWriteBacks.d.ts +1 -0
  305. package/session/useSessionWriteBacks.d.ts.map +1 -1
  306. package/session/useSessionWriteBacks.js.map +1 -1
  307. package/session/useUpdateSession.d.ts +22 -0
  308. package/session/useUpdateSession.d.ts.map +1 -1
  309. package/session/useUpdateSession.js +22 -0
  310. package/session/useUpdateSession.js.map +1 -1
  311. package/skill/SkillPicker.d.ts +15 -0
  312. package/skill/SkillPicker.d.ts.map +1 -1
  313. package/skill/SkillPicker.js +15 -0
  314. package/skill/SkillPicker.js.map +1 -1
  315. package/src/agent/AgentEnvForm.tsx +2 -0
  316. package/src/agent/AgentPicker.tsx +2 -0
  317. package/src/agent/agentSetupReducer.ts +109 -20
  318. package/src/agent/useAgentCount.ts +2 -0
  319. package/src/attachment/AttachmentChipList.tsx +15 -0
  320. package/src/attachment/useAttachments.ts +14 -0
  321. package/src/composer/useComposer.ts +5 -0
  322. package/src/execution/ExecutionPhaseBadge.tsx +1 -1
  323. package/src/execution/McpToolDetail.tsx +18 -6
  324. package/src/execution/TodoList.tsx +8 -0
  325. package/src/execution/ToolArgsView.tsx +1 -0
  326. package/src/execution/UsageWidget.tsx +1 -1
  327. package/src/execution/file-path-resolver.ts +28 -4
  328. package/src/execution/index.ts +5 -1
  329. package/src/execution/useArtifactContent.ts +33 -0
  330. package/src/execution/useSubmitApproval.ts +2 -0
  331. package/src/github/GitHubRepoPicker.tsx +13 -0
  332. package/src/github/useGitHubConnection.ts +29 -1
  333. package/src/github/useGitHubRepos.ts +31 -0
  334. package/src/github/useGitHubSearch.ts +25 -0
  335. package/src/iam-policy/GrantAccessForm.tsx +198 -0
  336. package/src/iam-policy/OrgMembersPanel.tsx +572 -0
  337. package/src/iam-policy/RoleSelector.tsx +105 -0
  338. package/src/iam-policy/index.ts +51 -0
  339. package/src/iam-policy/useCreateIamPolicy.ts +66 -0
  340. package/src/iam-policy/useDeleteIamPolicy.ts +65 -0
  341. package/src/iam-policy/useGrantableRoles.ts +45 -0
  342. package/src/iam-policy/usePrincipalsCount.ts +96 -0
  343. package/src/iam-policy/useResourceAccess.ts +128 -0
  344. package/src/iam-policy/useRevokeOrgAccess.ts +74 -0
  345. package/src/iam-policy/useRoleSelector.ts +97 -0
  346. package/src/iam-policy/useWhoAmI.ts +78 -0
  347. package/src/identity-provider/CreateIdentityProviderForm.tsx +308 -0
  348. package/src/identity-provider/IdentityProviderDetailPanel.tsx +583 -0
  349. package/src/identity-provider/IdentityProviderListPanel.tsx +370 -0
  350. package/src/identity-provider/IdentityProviderWizard.tsx +684 -0
  351. package/src/identity-provider/ProviderPicker.tsx +152 -0
  352. package/src/identity-provider/SsoLoginPrompt.tsx +404 -0
  353. package/src/identity-provider/index.ts +67 -0
  354. package/src/identity-provider/presets.ts +262 -0
  355. package/src/identity-provider/useCreateIdentityProvider.ts +68 -0
  356. package/src/identity-provider/useDeleteIdentityProvider.ts +65 -0
  357. package/src/identity-provider/useIdentityProvider.ts +86 -0
  358. package/src/identity-provider/useIdentityProviderList.ts +100 -0
  359. package/src/identity-provider/useOidcDiscovery.ts +124 -0
  360. package/src/identity-provider/useSsoProvider.ts +99 -0
  361. package/src/identity-provider/useUpdateIdentityProvider.ts +69 -0
  362. package/src/index.ts +121 -1
  363. package/src/internal/CloudFeatureNotice.tsx +12 -0
  364. package/src/invitation/InvitationCreatedAlert.tsx +185 -0
  365. package/src/invitation/InvitationManager.tsx +842 -0
  366. package/src/invitation/InvitationRedemption.tsx +434 -0
  367. package/src/invitation/index.ts +16 -0
  368. package/src/invitation/useCreateInvitation.ts +83 -0
  369. package/src/invitation/useInvitationPreview.ts +103 -0
  370. package/src/invitation/useOrgInvitations.ts +88 -0
  371. package/src/invitation/useRedeemInvitation.ts +82 -0
  372. package/src/invitation/useRevokeInvitation.ts +66 -0
  373. package/src/library/detect-skill-package.ts +4 -1
  374. package/src/library/detect-stigmer-resource.ts +4 -1
  375. package/src/library/parse-resource-yaml.ts +12 -2
  376. package/src/mcp-server/McpServerDetailView.tsx +2 -1
  377. package/src/mcp-server/index.ts +4 -1
  378. package/src/mcp-server/mcpServerSetupReducer.ts +86 -8
  379. package/src/models/ModelSelector.tsx +9 -0
  380. package/src/models/registry.ts +11 -1
  381. package/src/models/useModelRegistry.ts +20 -0
  382. package/src/organization/OrgProfilePanel.tsx +451 -0
  383. package/src/organization/index.ts +6 -0
  384. package/src/organization/useOrganization.ts +79 -0
  385. package/src/organization/useUpdateOrganization.ts +71 -0
  386. package/src/provider.tsx +1 -0
  387. package/src/search/useResourceList.ts +6 -3
  388. package/src/search/useResourceSearch.ts +12 -3
  389. package/src/session/group-sessions.ts +23 -0
  390. package/src/session/index.ts +1 -0
  391. package/src/session/useCreateSession.ts +19 -3
  392. package/src/session/useSession.ts +24 -0
  393. package/src/session/useSessionArtifacts.ts +1 -0
  394. package/src/session/useSessionConversation.ts +7 -0
  395. package/src/session/useSessionExecutions.ts +23 -0
  396. package/src/session/useSessionList.ts +19 -0
  397. package/src/session/useSessionWriteBacks.ts +1 -0
  398. package/src/session/useUpdateSession.ts +22 -0
  399. package/src/skill/SkillPicker.tsx +15 -0
  400. package/src/usage/OrgUsagePanel.tsx +465 -0
  401. package/src/usage/date-range.ts +86 -0
  402. package/src/usage/index.ts +13 -0
  403. package/src/usage/useOrgUsageReport.ts +110 -0
  404. package/src/workspace/FolderBrowser.tsx +9 -0
  405. package/src/workspace/WorkspaceEditor.tsx +17 -0
  406. package/src/workspace/useFolderListing.ts +24 -0
  407. package/src/workspace/useWorkspaceEntries.ts +38 -0
  408. package/styles.css +1 -1
  409. package/usage/OrgUsagePanel.d.ts +24 -0
  410. package/usage/OrgUsagePanel.d.ts.map +1 -0
  411. package/usage/OrgUsagePanel.js +134 -0
  412. package/usage/OrgUsagePanel.js.map +1 -0
  413. package/usage/date-range.d.ts +36 -0
  414. package/usage/date-range.d.ts.map +1 -0
  415. package/usage/date-range.js +69 -0
  416. package/usage/date-range.js.map +1 -0
  417. package/usage/index.d.ts +7 -0
  418. package/usage/index.d.ts.map +1 -0
  419. package/usage/index.js +4 -0
  420. package/usage/index.js.map +1 -0
  421. package/usage/useOrgUsageReport.d.ts +48 -0
  422. package/usage/useOrgUsageReport.d.ts.map +1 -0
  423. package/usage/useOrgUsageReport.js +72 -0
  424. package/usage/useOrgUsageReport.js.map +1 -0
  425. package/workspace/FolderBrowser.d.ts +9 -0
  426. package/workspace/FolderBrowser.d.ts.map +1 -1
  427. package/workspace/FolderBrowser.js +9 -0
  428. package/workspace/FolderBrowser.js.map +1 -1
  429. package/workspace/WorkspaceEditor.d.ts +17 -0
  430. package/workspace/WorkspaceEditor.d.ts.map +1 -1
  431. package/workspace/WorkspaceEditor.js +17 -0
  432. package/workspace/WorkspaceEditor.js.map +1 -1
  433. package/workspace/useFolderListing.d.ts +24 -0
  434. package/workspace/useFolderListing.d.ts.map +1 -1
  435. package/workspace/useFolderListing.js +24 -0
  436. package/workspace/useFolderListing.js.map +1 -1
  437. package/workspace/useWorkspaceEntries.d.ts +38 -0
  438. package/workspace/useWorkspaceEntries.d.ts.map +1 -1
  439. package/workspace/useWorkspaceEntries.js +25 -0
  440. package/workspace/useWorkspaceEntries.js.map +1 -1
@@ -0,0 +1,262 @@
1
+ /**
2
+ * Provider presets for well-known OIDC identity providers.
3
+ *
4
+ * Each preset defines URL templates and required user variables for a
5
+ * specific provider. The {@link ProviderPreset.buildConfig} function
6
+ * constructs the full OIDC configuration from the user's input without
7
+ * any network calls — URL patterns are deterministic for known providers.
8
+ *
9
+ * The "custom" preset is a special case: it collects an issuer URL and
10
+ * delegates to OIDC Discovery for auto-population.
11
+ */
12
+
13
+ /** OIDC configuration derived from a provider preset or discovery. */
14
+ export interface ProviderConfig {
15
+ /** The OIDC issuer URL (e.g. `https://accounts.google.com`). */
16
+ readonly issuer: string;
17
+ /** URL of the JSON Web Key Set endpoint for token verification. */
18
+ readonly jwksUri: string;
19
+ /** Issuer URLs accepted during token validation (may include aliases). */
20
+ readonly allowedIssuers: readonly string[];
21
+ /** OIDC UserInfo endpoint for fetching profile claims. */
22
+ readonly userinfoEndpoint?: string;
23
+ }
24
+
25
+ /** A user-fillable variable required by a provider preset. */
26
+ export interface ProviderVariable {
27
+ /** Unique identifier used as the key in the collected values record. */
28
+ readonly key: string;
29
+ /** Human-readable label displayed next to the input field. */
30
+ readonly label: string;
31
+ /** Placeholder text shown inside the empty input field. */
32
+ readonly placeholder: string;
33
+ /** Optional helper text displayed below the input field. */
34
+ readonly hint?: string;
35
+ /** Input type: `"text"` for free-form input, `"select"` for a dropdown. */
36
+ readonly type: "text" | "select";
37
+ /** Available options when `type` is `"select"`. */
38
+ readonly options?: readonly {
39
+ /** Option value submitted to the config builder. */
40
+ readonly value: string;
41
+ /** Display label shown in the dropdown. */
42
+ readonly label: string;
43
+ }[];
44
+ }
45
+
46
+ /** A well-known identity provider preset with URL templates. */
47
+ export interface ProviderPreset {
48
+ /** Stable identifier for this preset (e.g. `"auth0"`, `"okta"`, `"custom"`). */
49
+ readonly id: string;
50
+ /** Display name shown in the provider selection UI. */
51
+ readonly label: string;
52
+ /** Short description of the provider, shown below the label. */
53
+ readonly description: string;
54
+ /** Variables the user must fill in to construct the OIDC configuration. */
55
+ readonly variables: readonly ProviderVariable[];
56
+ /**
57
+ * Build the OIDC configuration from the user's variable values.
58
+ *
59
+ * Returns `null` for the "custom" preset — custom providers use OIDC
60
+ * Discovery instead of template-based construction.
61
+ */
62
+ readonly buildConfig: (vars: Record<string, string>) => ProviderConfig | null;
63
+ }
64
+
65
+ // ---------------------------------------------------------------------------
66
+ // Auth0
67
+ // ---------------------------------------------------------------------------
68
+
69
+ const auth0Preset: ProviderPreset = {
70
+ id: "auth0",
71
+ label: "Auth0",
72
+ description: "Auth0 by Okta — universal login and identity platform",
73
+ variables: [
74
+ {
75
+ key: "tenant",
76
+ label: "Tenant name",
77
+ placeholder: "acme-prod",
78
+ hint: "The subdomain from your Auth0 tenant URL",
79
+ type: "text",
80
+ },
81
+ {
82
+ key: "region",
83
+ label: "Region",
84
+ placeholder: "us",
85
+ type: "select",
86
+ options: [
87
+ { value: "us", label: "US" },
88
+ { value: "eu", label: "EU" },
89
+ { value: "au", label: "AU" },
90
+ { value: "jp", label: "JP" },
91
+ ],
92
+ },
93
+ ],
94
+ buildConfig(vars) {
95
+ const { tenant, region } = vars;
96
+ if (!tenant || !region) return null;
97
+ const domain = `${tenant}.${region}.auth0.com`;
98
+ const issuer = `https://${domain}/`;
99
+ return {
100
+ issuer,
101
+ jwksUri: `https://${domain}/.well-known/jwks.json`,
102
+ allowedIssuers: [issuer],
103
+ userinfoEndpoint: `https://${domain}/userinfo`,
104
+ };
105
+ },
106
+ };
107
+
108
+ // ---------------------------------------------------------------------------
109
+ // Okta
110
+ // ---------------------------------------------------------------------------
111
+
112
+ const oktaPreset: ProviderPreset = {
113
+ id: "okta",
114
+ label: "Okta",
115
+ description: "Okta — enterprise identity and access management",
116
+ variables: [
117
+ {
118
+ key: "domain",
119
+ label: "Okta domain",
120
+ placeholder: "acme.okta.com",
121
+ hint: "Your Okta organization domain (e.g., acme.okta.com)",
122
+ type: "text",
123
+ },
124
+ ],
125
+ buildConfig(vars) {
126
+ const { domain } = vars;
127
+ if (!domain) return null;
128
+ const base = `https://${domain}/oauth2/default`;
129
+ return {
130
+ issuer: base,
131
+ jwksUri: `${base}/v1/keys`,
132
+ allowedIssuers: [base],
133
+ userinfoEndpoint: `${base}/v1/userinfo`,
134
+ };
135
+ },
136
+ };
137
+
138
+ // ---------------------------------------------------------------------------
139
+ // Google
140
+ // ---------------------------------------------------------------------------
141
+
142
+ const googlePreset: ProviderPreset = {
143
+ id: "google",
144
+ label: "Google",
145
+ description: "Google Identity — Workspace and consumer accounts",
146
+ variables: [],
147
+ buildConfig() {
148
+ return {
149
+ issuer: "https://accounts.google.com",
150
+ jwksUri: "https://www.googleapis.com/oauth2/v3/certs",
151
+ allowedIssuers: ["https://accounts.google.com"],
152
+ userinfoEndpoint: "https://openidconnect.googleapis.com/v1/userinfo",
153
+ };
154
+ },
155
+ };
156
+
157
+ // ---------------------------------------------------------------------------
158
+ // Microsoft Entra ID (Azure AD)
159
+ // ---------------------------------------------------------------------------
160
+
161
+ const azureAdPreset: ProviderPreset = {
162
+ id: "azure-ad",
163
+ label: "Microsoft Entra ID",
164
+ description: "Microsoft Entra ID (formerly Azure AD) — enterprise identity",
165
+ variables: [
166
+ {
167
+ key: "tenantId",
168
+ label: "Tenant ID",
169
+ placeholder: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
170
+ hint: "Your Entra ID / Azure AD tenant identifier (GUID)",
171
+ type: "text",
172
+ },
173
+ ],
174
+ buildConfig(vars) {
175
+ const { tenantId } = vars;
176
+ if (!tenantId) return null;
177
+ const issuer = `https://login.microsoftonline.com/${tenantId}/v2.0`;
178
+ return {
179
+ issuer,
180
+ jwksUri: `https://login.microsoftonline.com/${tenantId}/discovery/v2.0/keys`,
181
+ allowedIssuers: [issuer],
182
+ userinfoEndpoint: "https://graph.microsoft.com/oidc/userinfo",
183
+ };
184
+ },
185
+ };
186
+
187
+ // ---------------------------------------------------------------------------
188
+ // AWS Cognito
189
+ // ---------------------------------------------------------------------------
190
+
191
+ const cognitoPreset: ProviderPreset = {
192
+ id: "aws-cognito",
193
+ label: "AWS Cognito",
194
+ description: "Amazon Cognito — user pools for AWS applications",
195
+ variables: [
196
+ {
197
+ key: "region",
198
+ label: "AWS region",
199
+ placeholder: "us-east-1",
200
+ hint: "The AWS region of your Cognito user pool",
201
+ type: "text",
202
+ },
203
+ {
204
+ key: "userPoolId",
205
+ label: "User Pool ID",
206
+ placeholder: "us-east-1_aBcDeFgHi",
207
+ hint: "Your Cognito user pool identifier",
208
+ type: "text",
209
+ },
210
+ ],
211
+ buildConfig(vars) {
212
+ const { region, userPoolId } = vars;
213
+ if (!region || !userPoolId) return null;
214
+ const base = `https://cognito-idp.${region}.amazonaws.com/${userPoolId}`;
215
+ return {
216
+ issuer: base,
217
+ jwksUri: `${base}/.well-known/jwks.json`,
218
+ allowedIssuers: [base],
219
+ };
220
+ },
221
+ };
222
+
223
+ // ---------------------------------------------------------------------------
224
+ // Custom OIDC
225
+ // ---------------------------------------------------------------------------
226
+
227
+ const customPreset: ProviderPreset = {
228
+ id: "custom",
229
+ label: "Custom OIDC",
230
+ description: "Any OpenID Connect compliant identity provider",
231
+ variables: [
232
+ {
233
+ key: "issuerUrl",
234
+ label: "Issuer URL",
235
+ placeholder: "https://idp.example.com",
236
+ hint: "The OIDC issuer URL — configuration will be auto-discovered",
237
+ type: "text",
238
+ },
239
+ ],
240
+ buildConfig() {
241
+ return null;
242
+ },
243
+ };
244
+
245
+ // ---------------------------------------------------------------------------
246
+ // Public API
247
+ // ---------------------------------------------------------------------------
248
+
249
+ /** All available provider presets in display order. */
250
+ export const PROVIDER_PRESETS: readonly ProviderPreset[] = [
251
+ auth0Preset,
252
+ oktaPreset,
253
+ googlePreset,
254
+ azureAdPreset,
255
+ cognitoPreset,
256
+ customPreset,
257
+ ];
258
+
259
+ /** Look up a preset by ID. Returns `undefined` if not found. */
260
+ export function getPreset(id: string): ProviderPreset | undefined {
261
+ return PROVIDER_PRESETS.find((p) => p.id === id);
262
+ }
@@ -0,0 +1,68 @@
1
+ "use client";
2
+
3
+ import { useCallback, useState } from "react";
4
+ import type { IdentityProviderInput } from "@stigmer/sdk";
5
+ import type { IdentityProvider } from "@stigmer/protos/ai/stigmer/iam/identityprovider/v1/api_pb";
6
+ import { useStigmer } from "../hooks";
7
+ import { toError } from "../internal/toError";
8
+
9
+ /** Return value of {@link useCreateIdentityProvider}. */
10
+ export interface UseCreateIdentityProviderReturn {
11
+ /** Submit an {@link IdentityProviderInput} to create a new identity provider. Resolves with the server-created resource. */
12
+ readonly create: (input: IdentityProviderInput) => Promise<IdentityProvider>;
13
+ /** `true` while the create request is in flight. */
14
+ readonly isCreating: boolean;
15
+ /** Error from the last failed create, or `null` when healthy. */
16
+ readonly error: Error | null;
17
+ /** Reset `error` to `null`. */
18
+ readonly clearError: () => void;
19
+ }
20
+
21
+ /**
22
+ * Mutation hook that wraps `identityProvider.create()` with loading
23
+ * and error state.
24
+ *
25
+ * Creates an identity provider resource within an organization. The
26
+ * caller provides an {@link IdentityProviderInput} with the required
27
+ * metadata (name, org) and spec fields (JWKS URI, allowed issuers,
28
+ * expected audience).
29
+ *
30
+ * @example
31
+ * ```tsx
32
+ * const { create, isCreating, error } = useCreateIdentityProvider();
33
+ *
34
+ * const idp = await create({
35
+ * name: "Acme Corp SSO",
36
+ * org: "acme",
37
+ * jwksUri: "https://acme.us.auth0.com/.well-known/jwks.json",
38
+ * allowedIssuers: ["https://acme.us.auth0.com/"],
39
+ * expectedAudience: "stigmer-api",
40
+ * });
41
+ * ```
42
+ */
43
+ export function useCreateIdentityProvider(): UseCreateIdentityProviderReturn {
44
+ const stigmer = useStigmer();
45
+ const [isCreating, setIsCreating] = useState(false);
46
+ const [error, setError] = useState<Error | null>(null);
47
+
48
+ const clearError = useCallback(() => setError(null), []);
49
+
50
+ const create = useCallback(
51
+ async (input: IdentityProviderInput): Promise<IdentityProvider> => {
52
+ setIsCreating(true);
53
+ setError(null);
54
+
55
+ try {
56
+ return await stigmer.identityProvider.create(input);
57
+ } catch (err) {
58
+ setError(toError(err));
59
+ throw err;
60
+ } finally {
61
+ setIsCreating(false);
62
+ }
63
+ },
64
+ [stigmer],
65
+ );
66
+
67
+ return { create, isCreating, error, clearError };
68
+ }
@@ -0,0 +1,65 @@
1
+ "use client";
2
+
3
+ import { useCallback, useState } from "react";
4
+ import type { DeleteResourceInput } from "@stigmer/sdk";
5
+ import type { IdentityProvider } from "@stigmer/protos/ai/stigmer/iam/identityprovider/v1/api_pb";
6
+ import { useStigmer } from "../hooks";
7
+ import { toError } from "../internal/toError";
8
+
9
+ /** Return value of {@link useDeleteIdentityProvider}. */
10
+ export interface UseDeleteIdentityProviderReturn {
11
+ /** Delete an identity provider. Resolves with the deleted resource for confirmation display. */
12
+ readonly deleteProvider: (input: DeleteResourceInput) => Promise<IdentityProvider>;
13
+ /** `true` while the delete request is in flight. */
14
+ readonly isDeleting: boolean;
15
+ /** Error from the last failed delete, or `null` when healthy. */
16
+ readonly error: Error | null;
17
+ /** Reset `error` to `null`. */
18
+ readonly clearError: () => void;
19
+ }
20
+
21
+ /**
22
+ * Mutation hook that wraps `identityProvider.delete()` with loading
23
+ * and error state.
24
+ *
25
+ * Deletes an identity provider by its resource ID. Returns the deleted
26
+ * {@link IdentityProvider} on success so callers can confirm which
27
+ * provider was removed.
28
+ *
29
+ * Deletion is blocked by the backend if any platform-managed
30
+ * organizations still reference this identity provider.
31
+ *
32
+ * @example
33
+ * ```tsx
34
+ * const { deleteProvider, isDeleting, error } = useDeleteIdentityProvider();
35
+ *
36
+ * await deleteProvider({ resourceId: "idp-abc123" });
37
+ * refetch(); // refresh the list after deletion
38
+ * ```
39
+ */
40
+ export function useDeleteIdentityProvider(): UseDeleteIdentityProviderReturn {
41
+ const stigmer = useStigmer();
42
+ const [isDeleting, setIsDeleting] = useState(false);
43
+ const [error, setError] = useState<Error | null>(null);
44
+
45
+ const clearError = useCallback(() => setError(null), []);
46
+
47
+ const deleteProvider = useCallback(
48
+ async (input: DeleteResourceInput): Promise<IdentityProvider> => {
49
+ setIsDeleting(true);
50
+ setError(null);
51
+
52
+ try {
53
+ return await stigmer.identityProvider.delete(input);
54
+ } catch (err) {
55
+ setError(toError(err));
56
+ throw err;
57
+ } finally {
58
+ setIsDeleting(false);
59
+ }
60
+ },
61
+ [stigmer],
62
+ );
63
+
64
+ return { deleteProvider, isDeleting, error, clearError };
65
+ }
@@ -0,0 +1,86 @@
1
+ "use client";
2
+
3
+ import { useCallback, useEffect, useState } from "react";
4
+ import type { IdentityProvider } from "@stigmer/protos/ai/stigmer/iam/identityprovider/v1/api_pb";
5
+ import { useStigmer } from "../hooks";
6
+ import { toError } from "../internal/toError";
7
+
8
+ /** Return value of {@link useIdentityProvider}. */
9
+ export interface UseIdentityProviderReturn {
10
+ /** The fetched IdentityProvider, or `null` while loading or on error. */
11
+ readonly identityProvider: IdentityProvider | null;
12
+ /** `true` while the initial fetch or a refetch is in flight. */
13
+ readonly isLoading: boolean;
14
+ /** Error from the last failed request, or `null` when healthy. */
15
+ readonly error: Error | null;
16
+ /** Discard cached data and re-fetch from the server. */
17
+ readonly refetch: () => void;
18
+ }
19
+
20
+ /**
21
+ * Data hook that fetches a single IdentityProvider by ID.
22
+ *
23
+ * Pass `null` to skip fetching (stable no-op). When the `id` changes,
24
+ * the previous in-flight request is discarded and a fresh fetch begins.
25
+ *
26
+ * Returns the full proto {@link IdentityProvider} resource so consumers
27
+ * have access to metadata, spec (JWKS URI, issuers, SSO config), and
28
+ * status without additional calls.
29
+ *
30
+ * @example
31
+ * ```tsx
32
+ * function IdpDetail({ idpId }: { idpId: string }) {
33
+ * const { identityProvider, isLoading, error } = useIdentityProvider(idpId);
34
+ *
35
+ * if (isLoading) return <Skeleton />;
36
+ * if (error) return <ErrorMessage error={error} />;
37
+ * if (!identityProvider) return <NotFound />;
38
+ *
39
+ * return <h1>{identityProvider.spec?.displayName}</h1>;
40
+ * }
41
+ * ```
42
+ */
43
+ export function useIdentityProvider(
44
+ id: string | null,
45
+ ): UseIdentityProviderReturn {
46
+ const stigmer = useStigmer();
47
+ const [identityProvider, setIdentityProvider] =
48
+ useState<IdentityProvider | null>(null);
49
+ const [isLoading, setIsLoading] = useState(false);
50
+ const [error, setError] = useState<Error | null>(null);
51
+ const [fetchKey, setFetchKey] = useState(0);
52
+
53
+ const refetch = useCallback(() => setFetchKey((k) => k + 1), []);
54
+
55
+ useEffect(() => {
56
+ if (!id) {
57
+ setIdentityProvider(null);
58
+ setIsLoading(false);
59
+ setError(null);
60
+ return;
61
+ }
62
+
63
+ const cancelled = { current: false };
64
+ setIsLoading(true);
65
+ setError(null);
66
+
67
+ stigmer.identityProvider.get(id).then(
68
+ (result) => {
69
+ if (cancelled.current) return;
70
+ setIdentityProvider(result);
71
+ setIsLoading(false);
72
+ },
73
+ (err) => {
74
+ if (cancelled.current) return;
75
+ setError(toError(err));
76
+ setIsLoading(false);
77
+ },
78
+ );
79
+
80
+ return () => {
81
+ cancelled.current = true;
82
+ };
83
+ }, [id, stigmer, fetchKey]);
84
+
85
+ return { identityProvider, isLoading, error, refetch };
86
+ }
@@ -0,0 +1,100 @@
1
+ "use client";
2
+
3
+ import { useCallback, useEffect, useState } from "react";
4
+ import { create } from "@bufbuild/protobuf";
5
+ import type { IdentityProvider } from "@stigmer/protos/ai/stigmer/iam/identityprovider/v1/api_pb";
6
+ import { ListIdentityProvidersByOrgInputSchema } from "@stigmer/protos/ai/stigmer/iam/identityprovider/v1/io_pb";
7
+ import { useStigmer } from "../hooks";
8
+ import { toError } from "../internal/toError";
9
+
10
+ /** Return value of {@link useIdentityProviderList}. */
11
+ export interface UseIdentityProviderListReturn {
12
+ /** All identity providers for the organization. Empty while loading or on error. */
13
+ readonly identityProviders: readonly IdentityProvider[];
14
+ /** `true` while the initial fetch or a refetch is in flight. */
15
+ readonly isLoading: boolean;
16
+ /** Error from the last failed request, or `null` when healthy. */
17
+ readonly error: Error | null;
18
+ /** Discard cached data and re-fetch from the server. */
19
+ readonly refetch: () => void;
20
+ }
21
+
22
+ /**
23
+ * Data hook that fetches all identity providers for an organization.
24
+ *
25
+ * Identity providers are admin-level resources with small cardinality
26
+ * (typically 1–3 per org), so results are returned as a flat list
27
+ * without pagination.
28
+ *
29
+ * Pass `null` to skip fetching (stable no-op). Call `refetch()` to
30
+ * re-query after mutations (create / update / delete).
31
+ *
32
+ * @example
33
+ * ```tsx
34
+ * function IdpSettings({ orgId }: { orgId: string }) {
35
+ * const { identityProviders, isLoading, error } = useIdentityProviderList(orgId);
36
+ *
37
+ * if (isLoading) return <Skeleton />;
38
+ * if (error) return <ErrorMessage error={error} />;
39
+ *
40
+ * return (
41
+ * <ul>
42
+ * {identityProviders.map((idp) => (
43
+ * <li key={idp.metadata?.id}>{idp.metadata?.name}</li>
44
+ * ))}
45
+ * </ul>
46
+ * );
47
+ * }
48
+ * ```
49
+ *
50
+ * @example
51
+ * ```tsx
52
+ * // Skip fetching until org is known
53
+ * const { identityProviders } = useIdentityProviderList(org ?? null);
54
+ * ```
55
+ */
56
+ export function useIdentityProviderList(
57
+ org: string | null,
58
+ ): UseIdentityProviderListReturn {
59
+ const stigmer = useStigmer();
60
+ const [identityProviders, setIdentityProviders] = useState<
61
+ IdentityProvider[]
62
+ >([]);
63
+ const [isLoading, setIsLoading] = useState(false);
64
+ const [error, setError] = useState<Error | null>(null);
65
+ const [fetchKey, setFetchKey] = useState(0);
66
+
67
+ const refetch = useCallback(() => setFetchKey((k) => k + 1), []);
68
+
69
+ useEffect(() => {
70
+ if (!org) {
71
+ setIdentityProviders([]);
72
+ setIsLoading(false);
73
+ setError(null);
74
+ return;
75
+ }
76
+
77
+ const cancelled = { current: false };
78
+ setIsLoading(true);
79
+ setError(null);
80
+
81
+ stigmer.identityProvider.listByOrg(create(ListIdentityProvidersByOrgInputSchema, { org })).then(
82
+ (result) => {
83
+ if (cancelled.current) return;
84
+ setIdentityProviders([...result.entries]);
85
+ setIsLoading(false);
86
+ },
87
+ (err) => {
88
+ if (cancelled.current) return;
89
+ setError(toError(err));
90
+ setIsLoading(false);
91
+ },
92
+ );
93
+
94
+ return () => {
95
+ cancelled.current = true;
96
+ };
97
+ }, [org, stigmer, fetchKey]);
98
+
99
+ return { identityProviders, isLoading, error, refetch };
100
+ }