@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.
- package/agent/AgentEnvForm.d.ts +2 -0
- package/agent/AgentEnvForm.d.ts.map +1 -1
- package/agent/AgentEnvForm.js.map +1 -1
- package/agent/AgentPicker.d.ts +2 -0
- package/agent/AgentPicker.d.ts.map +1 -1
- package/agent/AgentPicker.js.map +1 -1
- package/agent/agentSetupReducer.d.ts +69 -7
- package/agent/agentSetupReducer.d.ts.map +1 -1
- package/agent/agentSetupReducer.js.map +1 -1
- package/agent/useAgentCount.d.ts +2 -0
- package/agent/useAgentCount.d.ts.map +1 -1
- package/agent/useAgentCount.js.map +1 -1
- package/attachment/AttachmentChipList.d.ts +15 -0
- package/attachment/AttachmentChipList.d.ts.map +1 -1
- package/attachment/AttachmentChipList.js +15 -0
- package/attachment/AttachmentChipList.js.map +1 -1
- package/attachment/useAttachments.d.ts +14 -0
- package/attachment/useAttachments.d.ts.map +1 -1
- package/attachment/useAttachments.js.map +1 -1
- package/composer/useComposer.d.ts +5 -0
- package/composer/useComposer.d.ts.map +1 -1
- package/composer/useComposer.js.map +1 -1
- package/execution/ExecutionPhaseBadge.d.ts +1 -1
- package/execution/ExecutionPhaseBadge.js +1 -1
- package/execution/McpToolDetail.d.ts +16 -8
- package/execution/McpToolDetail.d.ts.map +1 -1
- package/execution/McpToolDetail.js +0 -6
- package/execution/McpToolDetail.js.map +1 -1
- package/execution/TodoList.d.ts +8 -0
- package/execution/TodoList.d.ts.map +1 -1
- package/execution/TodoList.js +8 -0
- package/execution/TodoList.js.map +1 -1
- package/execution/ToolArgsView.d.ts +1 -0
- package/execution/ToolArgsView.d.ts.map +1 -1
- package/execution/ToolArgsView.js.map +1 -1
- package/execution/UsageWidget.d.ts +1 -1
- package/execution/UsageWidget.js +1 -1
- package/execution/file-path-resolver.d.ts +10 -0
- package/execution/file-path-resolver.d.ts.map +1 -1
- package/execution/file-path-resolver.js.map +1 -1
- package/execution/index.d.ts +1 -1
- package/execution/index.d.ts.map +1 -1
- package/execution/index.js.map +1 -1
- package/execution/useArtifactContent.d.ts +33 -0
- package/execution/useArtifactContent.d.ts.map +1 -1
- package/execution/useArtifactContent.js +33 -0
- package/execution/useArtifactContent.js.map +1 -1
- package/execution/useSubmitApproval.d.ts +2 -0
- package/execution/useSubmitApproval.d.ts.map +1 -1
- package/execution/useSubmitApproval.js.map +1 -1
- package/github/GitHubRepoPicker.d.ts +13 -0
- package/github/GitHubRepoPicker.d.ts.map +1 -1
- package/github/GitHubRepoPicker.js +13 -0
- package/github/GitHubRepoPicker.js.map +1 -1
- package/github/useGitHubConnection.d.ts +29 -1
- package/github/useGitHubConnection.d.ts.map +1 -1
- package/github/useGitHubConnection.js +29 -1
- package/github/useGitHubConnection.js.map +1 -1
- package/github/useGitHubRepos.d.ts +31 -0
- package/github/useGitHubRepos.d.ts.map +1 -1
- package/github/useGitHubRepos.js +31 -0
- package/github/useGitHubRepos.js.map +1 -1
- package/github/useGitHubSearch.d.ts +25 -0
- package/github/useGitHubSearch.d.ts.map +1 -1
- package/github/useGitHubSearch.js +25 -0
- package/github/useGitHubSearch.js.map +1 -1
- package/iam-policy/GrantAccessForm.d.ts +39 -0
- package/iam-policy/GrantAccessForm.d.ts.map +1 -0
- package/iam-policy/GrantAccessForm.js +75 -0
- package/iam-policy/GrantAccessForm.js.map +1 -0
- package/iam-policy/OrgMembersPanel.d.ts +28 -0
- package/iam-policy/OrgMembersPanel.d.ts.map +1 -0
- package/iam-policy/OrgMembersPanel.js +192 -0
- package/iam-policy/OrgMembersPanel.js.map +1 -0
- package/iam-policy/RoleSelector.d.ts +37 -0
- package/iam-policy/RoleSelector.d.ts.map +1 -0
- package/iam-policy/RoleSelector.js +42 -0
- package/iam-policy/RoleSelector.js.map +1 -0
- package/iam-policy/index.d.ts +12 -0
- package/iam-policy/index.d.ts.map +1 -0
- package/iam-policy/index.js +12 -0
- package/iam-policy/index.js.map +1 -0
- package/iam-policy/useCreateIamPolicy.d.ts +35 -0
- package/iam-policy/useCreateIamPolicy.d.ts.map +1 -0
- package/iam-policy/useCreateIamPolicy.js +46 -0
- package/iam-policy/useCreateIamPolicy.js.map +1 -0
- package/iam-policy/useDeleteIamPolicy.d.ts +34 -0
- package/iam-policy/useDeleteIamPolicy.d.ts.map +1 -0
- package/iam-policy/useDeleteIamPolicy.js +45 -0
- package/iam-policy/useDeleteIamPolicy.js.map +1 -0
- package/iam-policy/useGrantableRoles.d.ts +28 -0
- package/iam-policy/useGrantableRoles.d.ts.map +1 -0
- package/iam-policy/useGrantableRoles.js +32 -0
- package/iam-policy/useGrantableRoles.js.map +1 -0
- package/iam-policy/usePrincipalsCount.d.ts +31 -0
- package/iam-policy/usePrincipalsCount.d.ts.map +1 -0
- package/iam-policy/usePrincipalsCount.js +72 -0
- package/iam-policy/usePrincipalsCount.js.map +1 -0
- package/iam-policy/useResourceAccess.d.ts +51 -0
- package/iam-policy/useResourceAccess.d.ts.map +1 -0
- package/iam-policy/useResourceAccess.js +85 -0
- package/iam-policy/useResourceAccess.js.map +1 -0
- package/iam-policy/useRevokeOrgAccess.d.ts +36 -0
- package/iam-policy/useRevokeOrgAccess.d.ts.map +1 -0
- package/iam-policy/useRevokeOrgAccess.js +48 -0
- package/iam-policy/useRevokeOrgAccess.js.map +1 -0
- package/iam-policy/useRoleSelector.d.ts +52 -0
- package/iam-policy/useRoleSelector.d.ts.map +1 -0
- package/iam-policy/useRoleSelector.js +50 -0
- package/iam-policy/useRoleSelector.js.map +1 -0
- package/iam-policy/useWhoAmI.d.ts +30 -0
- package/iam-policy/useWhoAmI.d.ts.map +1 -0
- package/iam-policy/useWhoAmI.js +56 -0
- package/iam-policy/useWhoAmI.js.map +1 -0
- package/identity-provider/CreateIdentityProviderForm.d.ts +39 -0
- package/identity-provider/CreateIdentityProviderForm.d.ts.map +1 -0
- package/identity-provider/CreateIdentityProviderForm.js +102 -0
- package/identity-provider/CreateIdentityProviderForm.js.map +1 -0
- package/identity-provider/IdentityProviderDetailPanel.d.ts +42 -0
- package/identity-provider/IdentityProviderDetailPanel.d.ts.map +1 -0
- package/identity-provider/IdentityProviderDetailPanel.js +156 -0
- package/identity-provider/IdentityProviderDetailPanel.js.map +1 -0
- package/identity-provider/IdentityProviderListPanel.d.ts +41 -0
- package/identity-provider/IdentityProviderListPanel.d.ts.map +1 -0
- package/identity-provider/IdentityProviderListPanel.js +110 -0
- package/identity-provider/IdentityProviderListPanel.js.map +1 -0
- package/identity-provider/IdentityProviderWizard.d.ts +40 -0
- package/identity-provider/IdentityProviderWizard.d.ts.map +1 -0
- package/identity-provider/IdentityProviderWizard.js +180 -0
- package/identity-provider/IdentityProviderWizard.js.map +1 -0
- package/identity-provider/ProviderPicker.d.ts +28 -0
- package/identity-provider/ProviderPicker.d.ts.map +1 -0
- package/identity-provider/ProviderPicker.js +64 -0
- package/identity-provider/ProviderPicker.js.map +1 -0
- package/identity-provider/SsoLoginPrompt.d.ts +51 -0
- package/identity-provider/SsoLoginPrompt.d.ts.map +1 -0
- package/identity-provider/SsoLoginPrompt.js +119 -0
- package/identity-provider/SsoLoginPrompt.js.map +1 -0
- package/identity-provider/index.d.ts +14 -0
- package/identity-provider/index.d.ts.map +1 -0
- package/identity-provider/index.js +14 -0
- package/identity-provider/index.js.map +1 -0
- package/identity-provider/presets.d.ts +65 -0
- package/identity-provider/presets.d.ts.map +1 -0
- package/identity-provider/presets.js +200 -0
- package/identity-provider/presets.js.map +1 -0
- package/identity-provider/useCreateIdentityProvider.d.ts +37 -0
- package/identity-provider/useCreateIdentityProvider.d.ts.map +1 -0
- package/identity-provider/useCreateIdentityProvider.js +48 -0
- package/identity-provider/useCreateIdentityProvider.js.map +1 -0
- package/identity-provider/useDeleteIdentityProvider.d.ts +34 -0
- package/identity-provider/useDeleteIdentityProvider.d.ts.map +1 -0
- package/identity-provider/useDeleteIdentityProvider.js +45 -0
- package/identity-provider/useDeleteIdentityProvider.js.map +1 -0
- package/identity-provider/useIdentityProvider.d.ts +37 -0
- package/identity-provider/useIdentityProvider.d.ts.map +1 -0
- package/identity-provider/useIdentityProvider.js +62 -0
- package/identity-provider/useIdentityProvider.js.map +1 -0
- package/identity-provider/useIdentityProviderList.d.ts +48 -0
- package/identity-provider/useIdentityProviderList.d.ts.map +1 -0
- package/identity-provider/useIdentityProviderList.js +75 -0
- package/identity-provider/useIdentityProviderList.js.map +1 -0
- package/identity-provider/useOidcDiscovery.d.ts +39 -0
- package/identity-provider/useOidcDiscovery.d.ts.map +1 -0
- package/identity-provider/useOidcDiscovery.js +76 -0
- package/identity-provider/useOidcDiscovery.js.map +1 -0
- package/identity-provider/useSsoProvider.d.ts +50 -0
- package/identity-provider/useSsoProvider.d.ts.map +1 -0
- package/identity-provider/useSsoProvider.js +83 -0
- package/identity-provider/useSsoProvider.js.map +1 -0
- package/identity-provider/useUpdateIdentityProvider.d.ts +38 -0
- package/identity-provider/useUpdateIdentityProvider.d.ts.map +1 -0
- package/identity-provider/useUpdateIdentityProvider.js +49 -0
- package/identity-provider/useUpdateIdentityProvider.js.map +1 -0
- package/index.d.ts +14 -5
- package/index.d.ts.map +1 -1
- package/index.js +10 -2
- package/index.js.map +1 -1
- package/internal/CloudFeatureNotice.d.ts +12 -0
- package/internal/CloudFeatureNotice.d.ts.map +1 -1
- package/internal/CloudFeatureNotice.js +12 -0
- package/internal/CloudFeatureNotice.js.map +1 -1
- package/invitation/InvitationCreatedAlert.d.ts +35 -0
- package/invitation/InvitationCreatedAlert.d.ts.map +1 -0
- package/invitation/InvitationCreatedAlert.js +60 -0
- package/invitation/InvitationCreatedAlert.js.map +1 -0
- package/invitation/InvitationManager.d.ts +44 -0
- package/invitation/InvitationManager.d.ts.map +1 -0
- package/invitation/InvitationManager.js +248 -0
- package/invitation/InvitationManager.js.map +1 -0
- package/invitation/InvitationRedemption.d.ts +69 -0
- package/invitation/InvitationRedemption.d.ts.map +1 -0
- package/invitation/InvitationRedemption.js +140 -0
- package/invitation/InvitationRedemption.js.map +1 -0
- package/invitation/index.d.ts +17 -0
- package/invitation/index.d.ts.map +1 -0
- package/invitation/index.js +9 -0
- package/invitation/index.js.map +1 -0
- package/invitation/useCreateInvitation.d.ts +52 -0
- package/invitation/useCreateInvitation.d.ts.map +1 -0
- package/invitation/useCreateInvitation.js +55 -0
- package/invitation/useCreateInvitation.js.map +1 -0
- package/invitation/useInvitationPreview.d.ts +51 -0
- package/invitation/useInvitationPreview.d.ts.map +1 -0
- package/invitation/useInvitationPreview.js +80 -0
- package/invitation/useInvitationPreview.js.map +1 -0
- package/invitation/useOrgInvitations.d.ts +36 -0
- package/invitation/useOrgInvitations.d.ts.map +1 -0
- package/invitation/useOrgInvitations.js +65 -0
- package/invitation/useOrgInvitations.js.map +1 -0
- package/invitation/useRedeemInvitation.d.ts +47 -0
- package/invitation/useRedeemInvitation.d.ts.map +1 -0
- package/invitation/useRedeemInvitation.js +53 -0
- package/invitation/useRedeemInvitation.js.map +1 -0
- package/invitation/useRevokeInvitation.d.ts +35 -0
- package/invitation/useRevokeInvitation.d.ts.map +1 -0
- package/invitation/useRevokeInvitation.js +47 -0
- package/invitation/useRevokeInvitation.js.map +1 -0
- package/library/detect-skill-package.d.ts +1 -0
- package/library/detect-skill-package.d.ts.map +1 -1
- package/library/detect-skill-package.js.map +1 -1
- package/library/detect-stigmer-resource.d.ts +1 -0
- package/library/detect-stigmer-resource.d.ts.map +1 -1
- package/library/detect-stigmer-resource.js.map +1 -1
- package/library/parse-resource-yaml.d.ts +4 -0
- package/library/parse-resource-yaml.d.ts.map +1 -1
- package/library/parse-resource-yaml.js.map +1 -1
- package/mcp-server/McpServerDetailView.d.ts +2 -2
- package/mcp-server/McpServerDetailView.d.ts.map +1 -1
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/mcp-server/index.d.ts +1 -1
- package/mcp-server/index.d.ts.map +1 -1
- package/mcp-server/index.js.map +1 -1
- package/mcp-server/mcpServerSetupReducer.d.ts +54 -0
- package/mcp-server/mcpServerSetupReducer.d.ts.map +1 -1
- package/mcp-server/mcpServerSetupReducer.js.map +1 -1
- package/models/ModelSelector.d.ts +9 -0
- package/models/ModelSelector.d.ts.map +1 -1
- package/models/ModelSelector.js +9 -0
- package/models/ModelSelector.js.map +1 -1
- package/models/registry.d.ts +11 -1
- package/models/registry.d.ts.map +1 -1
- package/models/registry.js.map +1 -1
- package/models/useModelRegistry.d.ts +20 -0
- package/models/useModelRegistry.d.ts.map +1 -1
- package/models/useModelRegistry.js +20 -0
- package/models/useModelRegistry.js.map +1 -1
- package/organization/OrgProfilePanel.d.ts +31 -0
- package/organization/OrgProfilePanel.d.ts.map +1 -0
- package/organization/OrgProfilePanel.js +147 -0
- package/organization/OrgProfilePanel.js.map +1 -0
- package/organization/index.d.ts +6 -0
- package/organization/index.d.ts.map +1 -1
- package/organization/index.js +3 -0
- package/organization/index.js.map +1 -1
- package/organization/useOrganization.d.ts +31 -0
- package/organization/useOrganization.d.ts.map +1 -0
- package/organization/useOrganization.js +56 -0
- package/organization/useOrganization.js.map +1 -0
- package/organization/useUpdateOrganization.d.ts +40 -0
- package/organization/useUpdateOrganization.d.ts.map +1 -0
- package/organization/useUpdateOrganization.js +51 -0
- package/organization/useUpdateOrganization.js.map +1 -0
- package/package.json +4 -4
- package/provider.d.ts +1 -0
- package/provider.d.ts.map +1 -1
- package/provider.js.map +1 -1
- package/search/useResourceList.d.ts +4 -2
- package/search/useResourceList.d.ts.map +1 -1
- package/search/useResourceList.js +2 -1
- package/search/useResourceList.js.map +1 -1
- package/search/useResourceSearch.d.ts +10 -2
- package/search/useResourceSearch.d.ts.map +1 -1
- package/search/useResourceSearch.js +2 -1
- package/search/useResourceSearch.js.map +1 -1
- package/session/group-sessions.d.ts +23 -0
- package/session/group-sessions.d.ts.map +1 -1
- package/session/group-sessions.js +23 -0
- package/session/group-sessions.js.map +1 -1
- package/session/index.d.ts +1 -1
- package/session/index.d.ts.map +1 -1
- package/session/index.js.map +1 -1
- package/session/useCreateSession.d.ts +11 -2
- package/session/useCreateSession.d.ts.map +1 -1
- package/session/useCreateSession.js.map +1 -1
- package/session/useSession.d.ts +24 -0
- package/session/useSession.d.ts.map +1 -1
- package/session/useSession.js +24 -0
- package/session/useSession.js.map +1 -1
- package/session/useSessionArtifacts.d.ts +1 -0
- package/session/useSessionArtifacts.d.ts.map +1 -1
- package/session/useSessionArtifacts.js.map +1 -1
- package/session/useSessionConversation.d.ts +7 -0
- package/session/useSessionConversation.d.ts.map +1 -1
- package/session/useSessionConversation.js.map +1 -1
- package/session/useSessionExecutions.d.ts +23 -0
- package/session/useSessionExecutions.d.ts.map +1 -1
- package/session/useSessionExecutions.js +23 -0
- package/session/useSessionExecutions.js.map +1 -1
- package/session/useSessionList.d.ts +19 -0
- package/session/useSessionList.d.ts.map +1 -1
- package/session/useSessionList.js +19 -0
- package/session/useSessionList.js.map +1 -1
- package/session/useSessionWriteBacks.d.ts +1 -0
- package/session/useSessionWriteBacks.d.ts.map +1 -1
- package/session/useSessionWriteBacks.js.map +1 -1
- package/session/useUpdateSession.d.ts +22 -0
- package/session/useUpdateSession.d.ts.map +1 -1
- package/session/useUpdateSession.js +22 -0
- package/session/useUpdateSession.js.map +1 -1
- package/skill/SkillPicker.d.ts +15 -0
- package/skill/SkillPicker.d.ts.map +1 -1
- package/skill/SkillPicker.js +15 -0
- package/skill/SkillPicker.js.map +1 -1
- package/src/agent/AgentEnvForm.tsx +2 -0
- package/src/agent/AgentPicker.tsx +2 -0
- package/src/agent/agentSetupReducer.ts +109 -20
- package/src/agent/useAgentCount.ts +2 -0
- package/src/attachment/AttachmentChipList.tsx +15 -0
- package/src/attachment/useAttachments.ts +14 -0
- package/src/composer/useComposer.ts +5 -0
- package/src/execution/ExecutionPhaseBadge.tsx +1 -1
- package/src/execution/McpToolDetail.tsx +18 -6
- package/src/execution/TodoList.tsx +8 -0
- package/src/execution/ToolArgsView.tsx +1 -0
- package/src/execution/UsageWidget.tsx +1 -1
- package/src/execution/file-path-resolver.ts +28 -4
- package/src/execution/index.ts +5 -1
- package/src/execution/useArtifactContent.ts +33 -0
- package/src/execution/useSubmitApproval.ts +2 -0
- package/src/github/GitHubRepoPicker.tsx +13 -0
- package/src/github/useGitHubConnection.ts +29 -1
- package/src/github/useGitHubRepos.ts +31 -0
- package/src/github/useGitHubSearch.ts +25 -0
- package/src/iam-policy/GrantAccessForm.tsx +198 -0
- package/src/iam-policy/OrgMembersPanel.tsx +572 -0
- package/src/iam-policy/RoleSelector.tsx +105 -0
- package/src/iam-policy/index.ts +51 -0
- package/src/iam-policy/useCreateIamPolicy.ts +66 -0
- package/src/iam-policy/useDeleteIamPolicy.ts +65 -0
- package/src/iam-policy/useGrantableRoles.ts +45 -0
- package/src/iam-policy/usePrincipalsCount.ts +96 -0
- package/src/iam-policy/useResourceAccess.ts +128 -0
- package/src/iam-policy/useRevokeOrgAccess.ts +74 -0
- package/src/iam-policy/useRoleSelector.ts +97 -0
- package/src/iam-policy/useWhoAmI.ts +78 -0
- package/src/identity-provider/CreateIdentityProviderForm.tsx +308 -0
- package/src/identity-provider/IdentityProviderDetailPanel.tsx +583 -0
- package/src/identity-provider/IdentityProviderListPanel.tsx +370 -0
- package/src/identity-provider/IdentityProviderWizard.tsx +684 -0
- package/src/identity-provider/ProviderPicker.tsx +152 -0
- package/src/identity-provider/SsoLoginPrompt.tsx +404 -0
- package/src/identity-provider/index.ts +67 -0
- package/src/identity-provider/presets.ts +262 -0
- package/src/identity-provider/useCreateIdentityProvider.ts +68 -0
- package/src/identity-provider/useDeleteIdentityProvider.ts +65 -0
- package/src/identity-provider/useIdentityProvider.ts +86 -0
- package/src/identity-provider/useIdentityProviderList.ts +100 -0
- package/src/identity-provider/useOidcDiscovery.ts +124 -0
- package/src/identity-provider/useSsoProvider.ts +99 -0
- package/src/identity-provider/useUpdateIdentityProvider.ts +69 -0
- package/src/index.ts +121 -1
- package/src/internal/CloudFeatureNotice.tsx +12 -0
- package/src/invitation/InvitationCreatedAlert.tsx +185 -0
- package/src/invitation/InvitationManager.tsx +842 -0
- package/src/invitation/InvitationRedemption.tsx +434 -0
- package/src/invitation/index.ts +16 -0
- package/src/invitation/useCreateInvitation.ts +83 -0
- package/src/invitation/useInvitationPreview.ts +103 -0
- package/src/invitation/useOrgInvitations.ts +88 -0
- package/src/invitation/useRedeemInvitation.ts +82 -0
- package/src/invitation/useRevokeInvitation.ts +66 -0
- package/src/library/detect-skill-package.ts +4 -1
- package/src/library/detect-stigmer-resource.ts +4 -1
- package/src/library/parse-resource-yaml.ts +12 -2
- package/src/mcp-server/McpServerDetailView.tsx +2 -1
- package/src/mcp-server/index.ts +4 -1
- package/src/mcp-server/mcpServerSetupReducer.ts +86 -8
- package/src/models/ModelSelector.tsx +9 -0
- package/src/models/registry.ts +11 -1
- package/src/models/useModelRegistry.ts +20 -0
- package/src/organization/OrgProfilePanel.tsx +451 -0
- package/src/organization/index.ts +6 -0
- package/src/organization/useOrganization.ts +79 -0
- package/src/organization/useUpdateOrganization.ts +71 -0
- package/src/provider.tsx +1 -0
- package/src/search/useResourceList.ts +6 -3
- package/src/search/useResourceSearch.ts +12 -3
- package/src/session/group-sessions.ts +23 -0
- package/src/session/index.ts +1 -0
- package/src/session/useCreateSession.ts +19 -3
- package/src/session/useSession.ts +24 -0
- package/src/session/useSessionArtifacts.ts +1 -0
- package/src/session/useSessionConversation.ts +7 -0
- package/src/session/useSessionExecutions.ts +23 -0
- package/src/session/useSessionList.ts +19 -0
- package/src/session/useSessionWriteBacks.ts +1 -0
- package/src/session/useUpdateSession.ts +22 -0
- package/src/skill/SkillPicker.tsx +15 -0
- package/src/usage/OrgUsagePanel.tsx +465 -0
- package/src/usage/date-range.ts +86 -0
- package/src/usage/index.ts +13 -0
- package/src/usage/useOrgUsageReport.ts +110 -0
- package/src/workspace/FolderBrowser.tsx +9 -0
- package/src/workspace/WorkspaceEditor.tsx +17 -0
- package/src/workspace/useFolderListing.ts +24 -0
- package/src/workspace/useWorkspaceEntries.ts +38 -0
- package/styles.css +1 -1
- package/usage/OrgUsagePanel.d.ts +24 -0
- package/usage/OrgUsagePanel.d.ts.map +1 -0
- package/usage/OrgUsagePanel.js +134 -0
- package/usage/OrgUsagePanel.js.map +1 -0
- package/usage/date-range.d.ts +36 -0
- package/usage/date-range.d.ts.map +1 -0
- package/usage/date-range.js +69 -0
- package/usage/date-range.js.map +1 -0
- package/usage/index.d.ts +7 -0
- package/usage/index.d.ts.map +1 -0
- package/usage/index.js +4 -0
- package/usage/index.js.map +1 -0
- package/usage/useOrgUsageReport.d.ts +48 -0
- package/usage/useOrgUsageReport.d.ts.map +1 -0
- package/usage/useOrgUsageReport.js +72 -0
- package/usage/useOrgUsageReport.js.map +1 -0
- package/workspace/FolderBrowser.d.ts +9 -0
- package/workspace/FolderBrowser.d.ts.map +1 -1
- package/workspace/FolderBrowser.js +9 -0
- package/workspace/FolderBrowser.js.map +1 -1
- package/workspace/WorkspaceEditor.d.ts +17 -0
- package/workspace/WorkspaceEditor.d.ts.map +1 -1
- package/workspace/WorkspaceEditor.js +17 -0
- package/workspace/WorkspaceEditor.js.map +1 -1
- package/workspace/useFolderListing.d.ts +24 -0
- package/workspace/useFolderListing.d.ts.map +1 -1
- package/workspace/useFolderListing.js +24 -0
- package/workspace/useFolderListing.js.map +1 -1
- package/workspace/useWorkspaceEntries.d.ts +38 -0
- package/workspace/useWorkspaceEntries.d.ts.map +1 -1
- package/workspace/useWorkspaceEntries.js +25 -0
- package/workspace/useWorkspaceEntries.js.map +1 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export {
|
|
2
|
+
useGrantableRoles,
|
|
3
|
+
type UseGrantableRolesReturn,
|
|
4
|
+
} from "./useGrantableRoles";
|
|
5
|
+
|
|
6
|
+
export {
|
|
7
|
+
useRoleSelector,
|
|
8
|
+
type RoleOption,
|
|
9
|
+
type UseRoleSelectorReturn,
|
|
10
|
+
} from "./useRoleSelector";
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
useResourceAccess,
|
|
14
|
+
type ResourceAccessRef,
|
|
15
|
+
type UseResourceAccessOptions,
|
|
16
|
+
type UseResourceAccessReturn,
|
|
17
|
+
} from "./useResourceAccess";
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
usePrincipalsCount,
|
|
21
|
+
type UsePrincipalsCountReturn,
|
|
22
|
+
} from "./usePrincipalsCount";
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
useWhoAmI,
|
|
26
|
+
type UseWhoAmIReturn,
|
|
27
|
+
} from "./useWhoAmI";
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
useCreateIamPolicy,
|
|
31
|
+
type UseCreateIamPolicyReturn,
|
|
32
|
+
} from "./useCreateIamPolicy";
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
useDeleteIamPolicy,
|
|
36
|
+
type UseDeleteIamPolicyReturn,
|
|
37
|
+
} from "./useDeleteIamPolicy";
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
useRevokeOrgAccess,
|
|
41
|
+
type UseRevokeOrgAccessReturn,
|
|
42
|
+
} from "./useRevokeOrgAccess";
|
|
43
|
+
|
|
44
|
+
export { RoleSelector, type RoleSelectorProps } from "./RoleSelector";
|
|
45
|
+
|
|
46
|
+
export { GrantAccessForm, type GrantAccessFormProps } from "./GrantAccessForm";
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
OrgMembersPanel,
|
|
50
|
+
type OrgMembersPanelProps,
|
|
51
|
+
} from "./OrgMembersPanel";
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import type { IamPolicy } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/api_pb";
|
|
5
|
+
import type { IamPolicySpec } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/spec_pb";
|
|
6
|
+
import { useStigmer } from "../hooks";
|
|
7
|
+
import { toError } from "../internal/toError";
|
|
8
|
+
|
|
9
|
+
/** Return value of {@link useCreateIamPolicy}. */
|
|
10
|
+
export interface UseCreateIamPolicyReturn {
|
|
11
|
+
/** Grant access by creating an IAM policy binding. */
|
|
12
|
+
readonly create: (spec: IamPolicySpec) => Promise<IamPolicy>;
|
|
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
|
+
* Behavior hook that wraps `iamPolicy.create()` with loading/error
|
|
23
|
+
* state.
|
|
24
|
+
*
|
|
25
|
+
* Creates an IAM policy binding — granting a principal (identity
|
|
26
|
+
* account, team, etc.) a specific role on a resource. The caller
|
|
27
|
+
* provides the full {@link IamPolicySpec} with `principal`, `resource`,
|
|
28
|
+
* and `relation` (the role string, e.g. "admin").
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* const { create, isCreating, error } = useCreateIamPolicy();
|
|
33
|
+
*
|
|
34
|
+
* await create({
|
|
35
|
+
* principal: { kind: "identity_account", id: accountId },
|
|
36
|
+
* resource: { kind: "organization", id: orgId },
|
|
37
|
+
* relation: "admin",
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export function useCreateIamPolicy(): UseCreateIamPolicyReturn {
|
|
42
|
+
const stigmer = useStigmer();
|
|
43
|
+
const [isCreating, setIsCreating] = useState(false);
|
|
44
|
+
const [error, setError] = useState<Error | null>(null);
|
|
45
|
+
|
|
46
|
+
const clearError = useCallback(() => setError(null), []);
|
|
47
|
+
|
|
48
|
+
const create = useCallback(
|
|
49
|
+
async (spec: IamPolicySpec): Promise<IamPolicy> => {
|
|
50
|
+
setIsCreating(true);
|
|
51
|
+
setError(null);
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
return await stigmer.iamPolicy.create(spec);
|
|
55
|
+
} catch (err) {
|
|
56
|
+
setError(toError(err));
|
|
57
|
+
throw err;
|
|
58
|
+
} finally {
|
|
59
|
+
setIsCreating(false);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
[stigmer],
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
return { create, isCreating, error, clearError };
|
|
66
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import type { IamPolicy } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/api_pb";
|
|
5
|
+
import type { IamPolicySpec } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/spec_pb";
|
|
6
|
+
import { useStigmer } from "../hooks";
|
|
7
|
+
import { toError } from "../internal/toError";
|
|
8
|
+
|
|
9
|
+
/** Return value of {@link useDeleteIamPolicy}. */
|
|
10
|
+
export interface UseDeleteIamPolicyReturn {
|
|
11
|
+
/** Revoke access by deleting an IAM policy binding. */
|
|
12
|
+
readonly remove: (spec: IamPolicySpec) => Promise<IamPolicy>;
|
|
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
|
+
* Behavior hook that wraps `iamPolicy.delete()` with loading/error
|
|
23
|
+
* state.
|
|
24
|
+
*
|
|
25
|
+
* Removes an IAM policy binding — revoking a principal's role on a
|
|
26
|
+
* resource. The caller provides the same {@link IamPolicySpec} that was
|
|
27
|
+
* used when creating the binding.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* const { remove, isDeleting, error } = useDeleteIamPolicy();
|
|
32
|
+
*
|
|
33
|
+
* await remove({
|
|
34
|
+
* principal: { kind: "identity_account", id: accountId },
|
|
35
|
+
* resource: { kind: "organization", id: orgId },
|
|
36
|
+
* relation: "admin",
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export function useDeleteIamPolicy(): UseDeleteIamPolicyReturn {
|
|
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 remove = useCallback(
|
|
48
|
+
async (spec: IamPolicySpec): Promise<IamPolicy> => {
|
|
49
|
+
setIsDeleting(true);
|
|
50
|
+
setError(null);
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
return await stigmer.iamPolicy.delete(spec);
|
|
54
|
+
} catch (err) {
|
|
55
|
+
setError(toError(err));
|
|
56
|
+
throw err;
|
|
57
|
+
} finally {
|
|
58
|
+
setIsDeleting(false);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
[stigmer],
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
return { remove, isDeleting, error, clearError };
|
|
65
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import type { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
5
|
+
import type { IamRole } from "@stigmer/protos/ai/stigmer/iam/v1/enum_pb";
|
|
6
|
+
import { getGrantableRoles, hasGrantableRoles } from "@stigmer/sdk";
|
|
7
|
+
|
|
8
|
+
/** Return value of {@link useGrantableRoles}. */
|
|
9
|
+
export interface UseGrantableRolesReturn {
|
|
10
|
+
/** Roles that can be granted on the given resource kind. Empty if none. */
|
|
11
|
+
readonly roles: readonly IamRole[];
|
|
12
|
+
/** Whether the kind has at least one user-grantable role. */
|
|
13
|
+
readonly hasRoles: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Returns the list of IAM roles that can be granted on the given
|
|
18
|
+
* resource kind.
|
|
19
|
+
*
|
|
20
|
+
* This is a local read — no network call. The data comes from the
|
|
21
|
+
* `grantable_roles` field in each `ApiResourceKind`'s proto metadata,
|
|
22
|
+
* generated at build time.
|
|
23
|
+
*
|
|
24
|
+
* @param kind - The resource kind to query, or `null` while loading.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* const { roles, hasRoles } = useGrantableRoles(ApiResourceKind.agent);
|
|
29
|
+
* // roles = [IamRole.owner, IamRole.viewer]
|
|
30
|
+
* // hasRoles = true
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export function useGrantableRoles(
|
|
34
|
+
kind: ApiResourceKind | null,
|
|
35
|
+
): UseGrantableRolesReturn {
|
|
36
|
+
return useMemo(() => {
|
|
37
|
+
if (kind === null) {
|
|
38
|
+
return { roles: [], hasRoles: false };
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
roles: getGrantableRoles(kind),
|
|
42
|
+
hasRoles: hasGrantableRoles(kind),
|
|
43
|
+
};
|
|
44
|
+
}, [kind]);
|
|
45
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useState } from "react";
|
|
4
|
+
import { create } from "@bufbuild/protobuf";
|
|
5
|
+
import { GetPrincipalsCountInputSchema } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/io_pb";
|
|
6
|
+
import { useStigmer } from "../hooks";
|
|
7
|
+
import { toError } from "../internal/toError";
|
|
8
|
+
|
|
9
|
+
/** Return value of {@link usePrincipalsCount}. */
|
|
10
|
+
export interface UsePrincipalsCountReturn {
|
|
11
|
+
/** Number of distinct principals with access. `0` while loading. */
|
|
12
|
+
readonly count: number;
|
|
13
|
+
/** `true` while the fetch is in flight. */
|
|
14
|
+
readonly isLoading: boolean;
|
|
15
|
+
/** Error from the last failed request, or `null` when healthy. */
|
|
16
|
+
readonly error: Error | null;
|
|
17
|
+
/** Re-fetch the count from the server. */
|
|
18
|
+
readonly refetch: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Data hook that fetches the count of principals with access to an
|
|
23
|
+
* organization.
|
|
24
|
+
*
|
|
25
|
+
* Wraps `iamPolicy.getPrincipalsCount()`. Useful for member count
|
|
26
|
+
* badges in navigation and summary statistics.
|
|
27
|
+
*
|
|
28
|
+
* Pass `null` as `orgId` to skip fetching (stable no-op).
|
|
29
|
+
*
|
|
30
|
+
* @param orgId - Organization ID, or `null` to skip.
|
|
31
|
+
* @param principalKind - Kind of principals to count. Defaults to `"identity_account"`.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* const { count, isLoading } = usePrincipalsCount(orgId);
|
|
36
|
+
* // count = 5
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export function usePrincipalsCount(
|
|
40
|
+
orgId: string | null,
|
|
41
|
+
principalKind: string = "identity_account",
|
|
42
|
+
): UsePrincipalsCountReturn {
|
|
43
|
+
const stigmer = useStigmer();
|
|
44
|
+
const [count, setCount] = useState(0);
|
|
45
|
+
const [isLoading, setIsLoading] = useState(!!orgId);
|
|
46
|
+
const [error, setError] = useState<Error | null>(null);
|
|
47
|
+
const [fetchKey, setFetchKey] = useState(0);
|
|
48
|
+
|
|
49
|
+
const [prevOrgId, setPrevOrgId] = useState(orgId);
|
|
50
|
+
if (orgId !== prevOrgId) {
|
|
51
|
+
setPrevOrgId(orgId);
|
|
52
|
+
if (orgId) {
|
|
53
|
+
setIsLoading(true);
|
|
54
|
+
setCount(0);
|
|
55
|
+
setError(null);
|
|
56
|
+
} else {
|
|
57
|
+
setIsLoading(false);
|
|
58
|
+
setCount(0);
|
|
59
|
+
setError(null);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const refetch = useCallback(() => setFetchKey((k) => k + 1), []);
|
|
64
|
+
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (!orgId) return;
|
|
67
|
+
|
|
68
|
+
const cancelled = { current: false };
|
|
69
|
+
|
|
70
|
+
stigmer.iamPolicy
|
|
71
|
+
.getPrincipalsCount(
|
|
72
|
+
create(GetPrincipalsCountInputSchema, {
|
|
73
|
+
orgId,
|
|
74
|
+
principalKind,
|
|
75
|
+
}),
|
|
76
|
+
)
|
|
77
|
+
.then(
|
|
78
|
+
(result) => {
|
|
79
|
+
if (cancelled.current) return;
|
|
80
|
+
setCount(result.count);
|
|
81
|
+
setIsLoading(false);
|
|
82
|
+
},
|
|
83
|
+
(err) => {
|
|
84
|
+
if (cancelled.current) return;
|
|
85
|
+
setError(toError(err));
|
|
86
|
+
setIsLoading(false);
|
|
87
|
+
},
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
return () => {
|
|
91
|
+
cancelled.current = true;
|
|
92
|
+
};
|
|
93
|
+
}, [orgId, principalKind, stigmer, fetchKey]);
|
|
94
|
+
|
|
95
|
+
return { count, isLoading, error, refetch };
|
|
96
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useState } from "react";
|
|
4
|
+
import { create } from "@bufbuild/protobuf";
|
|
5
|
+
import type { PrincipalAccess } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/io_pb";
|
|
6
|
+
import {
|
|
7
|
+
ListResourceAccessInputSchema,
|
|
8
|
+
} from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/io_pb";
|
|
9
|
+
import { ApiResourceRefSchema } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/spec_pb";
|
|
10
|
+
import { useStigmer } from "../hooks";
|
|
11
|
+
import { toError } from "../internal/toError";
|
|
12
|
+
|
|
13
|
+
/** Resource reference for the access query. */
|
|
14
|
+
export interface ResourceAccessRef {
|
|
15
|
+
/** Resource kind (e.g. "organization", "agent"). */
|
|
16
|
+
readonly kind: string;
|
|
17
|
+
/** Resource ID. */
|
|
18
|
+
readonly id: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Options for {@link useResourceAccess}. */
|
|
22
|
+
export interface UseResourceAccessOptions {
|
|
23
|
+
/** Include roles inherited from parent resources. Defaults to `false`. */
|
|
24
|
+
readonly includeInherited?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Return value of {@link useResourceAccess}. */
|
|
28
|
+
export interface UseResourceAccessReturn {
|
|
29
|
+
/** Principals with their role grants on the resource. */
|
|
30
|
+
readonly members: readonly PrincipalAccess[];
|
|
31
|
+
/** `true` while the fetch is in flight. */
|
|
32
|
+
readonly isLoading: boolean;
|
|
33
|
+
/** Error from the last failed request, or `null` when healthy. */
|
|
34
|
+
readonly error: Error | null;
|
|
35
|
+
/** Re-fetch the access list from the server. */
|
|
36
|
+
readonly refetch: () => void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Data hook that fetches the list of principals and their roles on a
|
|
41
|
+
* resource.
|
|
42
|
+
*
|
|
43
|
+
* Wraps `iamPolicy.listResourceAccessByPrincipal()`. Returns each
|
|
44
|
+
* principal with full display information (`ApiResourceRefView`) and
|
|
45
|
+
* all their role grants, optionally including roles inherited from
|
|
46
|
+
* parent resources.
|
|
47
|
+
*
|
|
48
|
+
* Pass `null` as `resource` to skip fetching (stable no-op).
|
|
49
|
+
*
|
|
50
|
+
* **Generic** — works for organizations, agents, environments, or any
|
|
51
|
+
* resource kind that has IAM policies.
|
|
52
|
+
*
|
|
53
|
+
* @param resource - The resource to query access for, or `null` to skip.
|
|
54
|
+
* @param options - Optional configuration.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```tsx
|
|
58
|
+
* const { members, isLoading } = useResourceAccess(
|
|
59
|
+
* { kind: "organization", id: orgId },
|
|
60
|
+
* { includeInherited: true },
|
|
61
|
+
* );
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export function useResourceAccess(
|
|
65
|
+
resource: ResourceAccessRef | null,
|
|
66
|
+
options?: UseResourceAccessOptions,
|
|
67
|
+
): UseResourceAccessReturn {
|
|
68
|
+
const stigmer = useStigmer();
|
|
69
|
+
const [members, setMembers] = useState<PrincipalAccess[]>([]);
|
|
70
|
+
const [isLoading, setIsLoading] = useState(!!resource);
|
|
71
|
+
const [error, setError] = useState<Error | null>(null);
|
|
72
|
+
const [fetchKey, setFetchKey] = useState(0);
|
|
73
|
+
|
|
74
|
+
const kind = resource?.kind ?? null;
|
|
75
|
+
const id = resource?.id ?? null;
|
|
76
|
+
const includeInherited = options?.includeInherited ?? false;
|
|
77
|
+
|
|
78
|
+
const [prevKey, setPrevKey] = useState<string | null>(
|
|
79
|
+
kind && id ? `${kind}:${id}` : null,
|
|
80
|
+
);
|
|
81
|
+
const currentKey = kind && id ? `${kind}:${id}` : null;
|
|
82
|
+
if (currentKey !== prevKey) {
|
|
83
|
+
setPrevKey(currentKey);
|
|
84
|
+
if (currentKey) {
|
|
85
|
+
setIsLoading(true);
|
|
86
|
+
setMembers([]);
|
|
87
|
+
setError(null);
|
|
88
|
+
} else {
|
|
89
|
+
setIsLoading(false);
|
|
90
|
+
setMembers([]);
|
|
91
|
+
setError(null);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const refetch = useCallback(() => setFetchKey((k) => k + 1), []);
|
|
96
|
+
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (!kind || !id) return;
|
|
99
|
+
|
|
100
|
+
const cancelled = { current: false };
|
|
101
|
+
|
|
102
|
+
const input = create(ListResourceAccessInputSchema, {
|
|
103
|
+
resource: create(ApiResourceRefSchema, { kind, id }),
|
|
104
|
+
includeInherited,
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
stigmer.iamPolicy
|
|
108
|
+
.listResourceAccessByPrincipal(input)
|
|
109
|
+
.then(
|
|
110
|
+
(result) => {
|
|
111
|
+
if (cancelled.current) return;
|
|
112
|
+
setMembers([...result.entries]);
|
|
113
|
+
setIsLoading(false);
|
|
114
|
+
},
|
|
115
|
+
(err) => {
|
|
116
|
+
if (cancelled.current) return;
|
|
117
|
+
setError(toError(err));
|
|
118
|
+
setIsLoading(false);
|
|
119
|
+
},
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
return () => {
|
|
123
|
+
cancelled.current = true;
|
|
124
|
+
};
|
|
125
|
+
}, [kind, id, includeInherited, stigmer, fetchKey]);
|
|
126
|
+
|
|
127
|
+
return { members, isLoading, error, refetch };
|
|
128
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import { create } from "@bufbuild/protobuf";
|
|
5
|
+
import { RevokeOrgAccessInputSchema } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/io_pb";
|
|
6
|
+
import { useStigmer } from "../hooks";
|
|
7
|
+
import { toError } from "../internal/toError";
|
|
8
|
+
|
|
9
|
+
/** Return value of {@link useRevokeOrgAccess}. */
|
|
10
|
+
export interface UseRevokeOrgAccessReturn {
|
|
11
|
+
/**
|
|
12
|
+
* Remove all of a user's access to an organization.
|
|
13
|
+
*
|
|
14
|
+
* Deletes every IAM policy granting the identity account access
|
|
15
|
+
* to the organization and its child resources (agents, environments,
|
|
16
|
+
* etc.) in a single operation.
|
|
17
|
+
*/
|
|
18
|
+
readonly revoke: (accountId: string, orgId: string) => Promise<void>;
|
|
19
|
+
/** `true` while the revoke request is in flight. */
|
|
20
|
+
readonly isRevoking: boolean;
|
|
21
|
+
/** Error from the last failed revoke, or `null` when healthy. */
|
|
22
|
+
readonly error: Error | null;
|
|
23
|
+
/** Reset `error` to `null`. */
|
|
24
|
+
readonly clearError: () => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Behavior hook that wraps `iamPolicy.revokeOrgAccess()` with
|
|
29
|
+
* loading/error state.
|
|
30
|
+
*
|
|
31
|
+
* Removes all IAM policy bindings for a specific identity account
|
|
32
|
+
* within an organization — including bindings on child resources
|
|
33
|
+
* (agents, environments, etc.). This is the "remove member from org"
|
|
34
|
+
* operation.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* const { revoke, isRevoking, error } = useRevokeOrgAccess();
|
|
39
|
+
*
|
|
40
|
+
* await revoke("ia-alice-123", "org-demo-456");
|
|
41
|
+
* refetchMembers();
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export function useRevokeOrgAccess(): UseRevokeOrgAccessReturn {
|
|
45
|
+
const stigmer = useStigmer();
|
|
46
|
+
const [isRevoking, setIsRevoking] = useState(false);
|
|
47
|
+
const [error, setError] = useState<Error | null>(null);
|
|
48
|
+
|
|
49
|
+
const clearError = useCallback(() => setError(null), []);
|
|
50
|
+
|
|
51
|
+
const revoke = useCallback(
|
|
52
|
+
async (accountId: string, orgId: string): Promise<void> => {
|
|
53
|
+
setIsRevoking(true);
|
|
54
|
+
setError(null);
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
await stigmer.iamPolicy.revokeOrgAccess(
|
|
58
|
+
create(RevokeOrgAccessInputSchema, {
|
|
59
|
+
identityAccountId: accountId,
|
|
60
|
+
organizationId: orgId,
|
|
61
|
+
}),
|
|
62
|
+
);
|
|
63
|
+
} catch (err) {
|
|
64
|
+
setError(toError(err));
|
|
65
|
+
throw err;
|
|
66
|
+
} finally {
|
|
67
|
+
setIsRevoking(false);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
[stigmer],
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
return { revoke, isRevoking, error, clearError };
|
|
74
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useMemo, useState } from "react";
|
|
4
|
+
import type { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
5
|
+
import { IamRole } from "@stigmer/protos/ai/stigmer/iam/v1/enum_pb";
|
|
6
|
+
import {
|
|
7
|
+
getGrantableRoles,
|
|
8
|
+
iamRoleDisplayName,
|
|
9
|
+
iamRoleDescription,
|
|
10
|
+
iamRoleToString,
|
|
11
|
+
} from "@stigmer/sdk";
|
|
12
|
+
|
|
13
|
+
/** A single role option with display metadata. */
|
|
14
|
+
export interface RoleOption {
|
|
15
|
+
/** The IamRole enum value. */
|
|
16
|
+
readonly role: IamRole;
|
|
17
|
+
/** Human-readable display name (e.g. "Admin"). */
|
|
18
|
+
readonly label: string;
|
|
19
|
+
/** Short description suitable for tooltips (e.g. "Edit access and member management"). */
|
|
20
|
+
readonly description: string;
|
|
21
|
+
/** The FGA relation string (e.g. "admin"). */
|
|
22
|
+
readonly value: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Return value of {@link useRoleSelector}. */
|
|
26
|
+
export interface UseRoleSelectorReturn {
|
|
27
|
+
/** Available role options for the given resource kind. */
|
|
28
|
+
readonly options: readonly RoleOption[];
|
|
29
|
+
/** Currently selected role, or `null` if nothing is selected. */
|
|
30
|
+
readonly selected: IamRole | null;
|
|
31
|
+
/** FGA relation string for the selected role, or `""` if nothing is selected. */
|
|
32
|
+
readonly selectedValue: string;
|
|
33
|
+
/** Select a role. */
|
|
34
|
+
readonly select: (role: IamRole) => void;
|
|
35
|
+
/** Clear the selection. */
|
|
36
|
+
readonly clear: () => void;
|
|
37
|
+
/** Whether at least one role option exists. */
|
|
38
|
+
readonly hasOptions: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Headless hook for selecting an IAM role for a given resource kind.
|
|
43
|
+
*
|
|
44
|
+
* Provides role options with display metadata (label, description,
|
|
45
|
+
* FGA relation string) and selection state. Use this directly if you
|
|
46
|
+
* need a custom role picker UI; for the styled version, use
|
|
47
|
+
* {@link RoleSelector}.
|
|
48
|
+
*
|
|
49
|
+
* @param kind - The resource kind to show grantable roles for, or `null`.
|
|
50
|
+
* @param defaultRole - Optional initial selection.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```tsx
|
|
54
|
+
* const { options, selected, select } = useRoleSelector(ApiResourceKind.organization);
|
|
55
|
+
*
|
|
56
|
+
* options.map(opt => (
|
|
57
|
+
* <button key={opt.value} onClick={() => select(opt.role)}>
|
|
58
|
+
* {opt.label} — {opt.description}
|
|
59
|
+
* </button>
|
|
60
|
+
* ));
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export function useRoleSelector(
|
|
64
|
+
kind: ApiResourceKind | null,
|
|
65
|
+
defaultRole?: IamRole,
|
|
66
|
+
): UseRoleSelectorReturn {
|
|
67
|
+
const [selected, setSelected] = useState<IamRole | null>(
|
|
68
|
+
defaultRole ?? null,
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const options = useMemo<readonly RoleOption[]>(() => {
|
|
72
|
+
if (kind === null) return [];
|
|
73
|
+
return getGrantableRoles(kind).map((role) => ({
|
|
74
|
+
role,
|
|
75
|
+
label: iamRoleDisplayName(role),
|
|
76
|
+
description: iamRoleDescription(role),
|
|
77
|
+
value: iamRoleToString(role),
|
|
78
|
+
}));
|
|
79
|
+
}, [kind]);
|
|
80
|
+
|
|
81
|
+
const selectedValue = useMemo(
|
|
82
|
+
() => (selected !== null ? iamRoleToString(selected) : ""),
|
|
83
|
+
[selected],
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
const select = useCallback((role: IamRole) => setSelected(role), []);
|
|
87
|
+
const clear = useCallback(() => setSelected(null), []);
|
|
88
|
+
|
|
89
|
+
return {
|
|
90
|
+
options,
|
|
91
|
+
selected,
|
|
92
|
+
selectedValue,
|
|
93
|
+
select,
|
|
94
|
+
clear,
|
|
95
|
+
hasOptions: options.length > 0,
|
|
96
|
+
};
|
|
97
|
+
}
|