@stigmer/react 3.11.0 → 3.12.0
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/activity/useRecentActivity.d.ts +3 -2
- package/activity/useRecentActivity.d.ts.map +1 -1
- package/activity/useRecentActivity.js +3 -2
- package/activity/useRecentActivity.js.map +1 -1
- package/agent/AgentDetailView.d.ts +2 -12
- package/agent/AgentDetailView.d.ts.map +1 -1
- package/agent/AgentDetailView.js +10 -42
- package/agent/AgentDetailView.js.map +1 -1
- package/agent/internal/agentToInput.d.ts.map +1 -1
- package/agent/internal/agentToInput.js +0 -8
- package/agent/internal/agentToInput.js.map +1 -1
- package/agent-instance/AgentInstanceList.d.ts.map +1 -1
- package/agent-instance/AgentInstanceList.js +2 -1
- package/agent-instance/AgentInstanceList.js.map +1 -1
- package/api-key/ApiKeyListPanel.d.ts.map +1 -1
- package/api-key/ApiKeyListPanel.js +2 -1
- package/api-key/ApiKeyListPanel.js.map +1 -1
- package/attachment/AttachmentChipList.d.ts.map +1 -1
- package/attachment/AttachmentChipList.js +9 -8
- package/attachment/AttachmentChipList.js.map +1 -1
- package/attachment/AttachmentImageLightbox.d.ts.map +1 -1
- package/attachment/AttachmentImageLightbox.js +1 -1
- package/attachment/AttachmentImageLightbox.js.map +1 -1
- package/channel/AgentChannelsPanel.d.ts.map +1 -1
- package/channel/AgentChannelsPanel.js +2 -1
- package/channel/AgentChannelsPanel.js.map +1 -1
- package/channel/ChannelConversationsDialog.d.ts.map +1 -1
- package/channel/ChannelConversationsDialog.js +2 -1
- package/channel/ChannelConversationsDialog.js.map +1 -1
- package/channel/ChannelTemplatesDialog.d.ts.map +1 -1
- package/channel/ChannelTemplatesDialog.js +2 -1
- package/channel/ChannelTemplatesDialog.js.map +1 -1
- package/channel-app/internal.d.ts.map +1 -1
- package/channel-app/internal.js +2 -1
- package/channel-app/internal.js.map +1 -1
- package/composer/ComposerToolbar.d.ts.map +1 -1
- package/composer/ComposerToolbar.js +10 -7
- package/composer/ComposerToolbar.js.map +1 -1
- package/composer/ConfigureMenu.d.ts.map +1 -1
- package/composer/ConfigureMenu.js +2 -1
- package/composer/ConfigureMenu.js.map +1 -1
- package/composer/ContextChip.d.ts.map +1 -1
- package/composer/ContextChip.js +2 -1
- package/composer/ContextChip.js.map +1 -1
- package/composer/ContextPopover.d.ts.map +1 -1
- package/composer/ContextPopover.js +2 -1
- package/composer/ContextPopover.js.map +1 -1
- package/composer/SessionComposer.d.ts +13 -0
- package/composer/SessionComposer.d.ts.map +1 -1
- package/composer/SessionComposer.js +12 -2
- package/composer/SessionComposer.js.map +1 -1
- package/conversation/ConversationMediaAttachment.d.ts.map +1 -1
- package/conversation/ConversationMediaAttachment.js +2 -1
- package/conversation/ConversationMediaAttachment.js.map +1 -1
- package/conversation/ConversationTimelineView.d.ts.map +1 -1
- package/conversation/ConversationTimelineView.js +14 -4
- package/conversation/ConversationTimelineView.js.map +1 -1
- package/conversation/conversationPresentation.d.ts +28 -0
- package/conversation/conversationPresentation.d.ts.map +1 -1
- package/conversation/conversationPresentation.js +38 -1
- package/conversation/conversationPresentation.js.map +1 -1
- package/cursor-accounts/MemberCoverageTable.d.ts.map +1 -1
- package/cursor-accounts/MemberCoverageTable.js +6 -5
- package/cursor-accounts/MemberCoverageTable.js.map +1 -1
- package/dashboard/DashboardKPICards.d.ts.map +1 -1
- package/dashboard/DashboardKPICards.js +3 -1
- package/dashboard/DashboardKPICards.js.map +1 -1
- package/dependency-graph/DependencyTreeNode.d.ts.map +1 -1
- package/dependency-graph/DependencyTreeNode.js +1 -7
- package/dependency-graph/DependencyTreeNode.js.map +1 -1
- package/dependency-graph/types.d.ts +8 -20
- package/dependency-graph/types.d.ts.map +1 -1
- package/dependency-graph/useDependencyGraph.d.ts.map +1 -1
- package/dependency-graph/useDependencyGraph.js +2 -20
- package/dependency-graph/useDependencyGraph.js.map +1 -1
- package/environment/EnvironmentVariableEditor.d.ts.map +1 -1
- package/environment/EnvironmentVariableEditor.js +2 -1
- package/environment/EnvironmentVariableEditor.js.map +1 -1
- package/execution/ApprovalCard.d.ts.map +1 -1
- package/execution/ApprovalCard.js +1 -1
- package/execution/ApprovalCard.js.map +1 -1
- package/execution/ArtifactRowView.d.ts.map +1 -1
- package/execution/ArtifactRowView.js +2 -1
- package/execution/ArtifactRowView.js.map +1 -1
- package/execution/FilePathLink.d.ts +4 -4
- package/execution/FilePathLink.d.ts.map +1 -1
- package/execution/FilePathLink.js +4 -4
- package/execution/FilePathLink.js.map +1 -1
- package/execution/McpToolDetail.d.ts.map +1 -1
- package/execution/McpToolDetail.js +2 -1
- package/execution/McpToolDetail.js.map +1 -1
- package/execution/MessageAttachments.d.ts.map +1 -1
- package/execution/MessageAttachments.js +10 -8
- package/execution/MessageAttachments.js.map +1 -1
- package/execution/MessageEntry.d.ts.map +1 -1
- package/execution/MessageEntry.js +2 -1
- package/execution/MessageEntry.js.map +1 -1
- package/execution/PlanArtifactCard.d.ts.map +1 -1
- package/execution/PlanArtifactCard.js +7 -4
- package/execution/PlanArtifactCard.js.map +1 -1
- package/execution/ToolCallDetail.d.ts.map +1 -1
- package/execution/ToolCallDetail.js +1 -1
- package/execution/ToolCallDetail.js.map +1 -1
- package/execution/ToolCallItem.d.ts.map +1 -1
- package/execution/ToolCallItem.js +5 -1
- package/execution/ToolCallItem.js.map +1 -1
- package/execution/WriteBackCard.d.ts.map +1 -1
- package/execution/WriteBackCard.js +6 -4
- package/execution/WriteBackCard.js.map +1 -1
- package/execution/artifact-row-item.d.ts +1 -1
- package/execution/artifact-row-item.d.ts.map +1 -1
- package/file-reference/FileReferenceChipList.d.ts.map +1 -1
- package/file-reference/FileReferenceChipList.js +6 -1
- package/file-reference/FileReferenceChipList.js.map +1 -1
- package/iam-policy/OrgMembersPanel.d.ts.map +1 -1
- package/iam-policy/OrgMembersPanel.js +6 -5
- package/iam-policy/OrgMembersPanel.js.map +1 -1
- package/iam-policy/ProviderBadge.d.ts.map +1 -1
- package/iam-policy/ProviderBadge.js +3 -2
- package/iam-policy/ProviderBadge.js.map +1 -1
- package/iam-policy/RoleSelector.d.ts.map +1 -1
- package/iam-policy/RoleSelector.js +1 -1
- package/iam-policy/RoleSelector.js.map +1 -1
- package/identity-provider/IdentityProviderListPanel.d.ts.map +1 -1
- package/identity-provider/IdentityProviderListPanel.js +2 -1
- package/identity-provider/IdentityProviderListPanel.js.map +1 -1
- package/index.d.ts +0 -2
- package/index.d.ts.map +1 -1
- package/index.js +0 -6
- package/index.js.map +1 -1
- package/internal/truncated-text.d.ts +17 -0
- package/internal/truncated-text.d.ts.map +1 -0
- package/internal/truncated-text.js +27 -0
- package/internal/truncated-text.js.map +1 -0
- package/invitation/InvitationManager.d.ts.map +1 -1
- package/invitation/InvitationManager.js +4 -3
- package/invitation/InvitationManager.js.map +1 -1
- package/library/ScopeToggle.d.ts.map +1 -1
- package/library/ScopeToggle.js +10 -2
- package/library/ScopeToggle.js.map +1 -1
- package/library/VisibilitySelector.d.ts.map +1 -1
- package/library/VisibilitySelector.js +2 -1
- package/library/VisibilitySelector.js.map +1 -1
- package/library/useExportResource.d.ts +3 -4
- package/library/useExportResource.d.ts.map +1 -1
- package/library/useExportResource.js +1 -1
- package/library/useExportResource.js.map +1 -1
- package/manifest/EditResourceYamlDialog.d.ts.map +1 -1
- package/manifest/EditResourceYamlDialog.js.map +1 -1
- package/mcp-server/McpServerConfigPanel.d.ts +30 -1
- package/mcp-server/McpServerConfigPanel.d.ts.map +1 -1
- package/mcp-server/McpServerConfigPanel.js +18 -8
- package/mcp-server/McpServerConfigPanel.js.map +1 -1
- package/mcp-server/McpServerConnectDialog.d.ts +12 -1
- package/mcp-server/McpServerConnectDialog.d.ts.map +1 -1
- package/mcp-server/McpServerConnectDialog.js +8 -7
- package/mcp-server/McpServerConnectDialog.js.map +1 -1
- package/mcp-server/McpServerDetailView.d.ts.map +1 -1
- package/mcp-server/McpServerDetailView.js +4 -4
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/mcp-server/McpServerPicker.d.ts.map +1 -1
- package/mcp-server/McpServerPicker.js +86 -5
- package/mcp-server/McpServerPicker.js.map +1 -1
- package/mcp-server/McpToolSelector.d.ts.map +1 -1
- package/mcp-server/McpToolSelector.js +2 -1
- package/mcp-server/McpToolSelector.js.map +1 -1
- package/mcp-server/VendorApprovalBlockedNotice.d.ts +77 -0
- package/mcp-server/VendorApprovalBlockedNotice.d.ts.map +1 -0
- package/mcp-server/VendorApprovalBlockedNotice.js +62 -0
- package/mcp-server/VendorApprovalBlockedNotice.js.map +1 -0
- package/mcp-server/mcpServerSetupReducer.d.ts +18 -0
- package/mcp-server/mcpServerSetupReducer.d.ts.map +1 -1
- package/mcp-server/mcpServerSetupReducer.js +6 -0
- package/mcp-server/mcpServerSetupReducer.js.map +1 -1
- package/mcp-server/useMcpServerSetup.d.ts.map +1 -1
- package/mcp-server/useMcpServerSetup.js +7 -0
- package/mcp-server/useMcpServerSetup.js.map +1 -1
- package/oauth-app/OAuthAppListPanel.d.ts.map +1 -1
- package/oauth-app/OAuthAppListPanel.js +2 -1
- package/oauth-app/OAuthAppListPanel.js.map +1 -1
- package/package.json +4 -4
- package/platform-client/PlatformClientListPanel.d.ts.map +1 -1
- package/platform-client/PlatformClientListPanel.js +3 -2
- package/platform-client/PlatformClientListPanel.js.map +1 -1
- package/pricing-governance/BaselineEditor.d.ts.map +1 -1
- package/pricing-governance/BaselineEditor.js +7 -1
- package/pricing-governance/BaselineEditor.js.map +1 -1
- package/pricing-governance/ModelCatalogPanel.d.ts.map +1 -1
- package/pricing-governance/ModelCatalogPanel.js +2 -1
- package/pricing-governance/ModelCatalogPanel.js.map +1 -1
- package/pricing-governance/PricingGovernanceConsole.d.ts.map +1 -1
- package/pricing-governance/PricingGovernanceConsole.js +2 -1
- package/pricing-governance/PricingGovernanceConsole.js.map +1 -1
- package/pricing-governance/PricingGovernancePanel.d.ts.map +1 -1
- package/pricing-governance/PricingGovernancePanel.js +2 -1
- package/pricing-governance/PricingGovernancePanel.js.map +1 -1
- package/resource-workbench/components/StatusBadge.d.ts.map +1 -1
- package/resource-workbench/components/StatusBadge.js +2 -1
- package/resource-workbench/components/StatusBadge.js.map +1 -1
- package/schedule/CadenceField.d.ts.map +1 -1
- package/schedule/CadenceField.js +15 -8
- package/schedule/CadenceField.js.map +1 -1
- package/schedule/ScheduleRunsTable.d.ts.map +1 -1
- package/schedule/ScheduleRunsTable.js +3 -2
- package/schedule/ScheduleRunsTable.js.map +1 -1
- package/session/PlanEditor.d.ts.map +1 -1
- package/session/PlanEditor.js +3 -5
- package/session/PlanEditor.js.map +1 -1
- package/sharing/AgentShareList.d.ts.map +1 -1
- package/sharing/AgentShareList.js +3 -1
- package/sharing/AgentShareList.js.map +1 -1
- package/sharing/ShareAgentDialog.d.ts.map +1 -1
- package/sharing/ShareAgentDialog.js +2 -1
- package/sharing/ShareAgentDialog.js.map +1 -1
- package/skill/SkillDetailView.d.ts.map +1 -1
- package/skill/SkillDetailView.js +3 -2
- package/skill/SkillDetailView.js.map +1 -1
- package/src/__tests__/helpers/open-menu.ts +88 -0
- package/src/__tests__/portal-container.test.tsx +3 -3
- package/src/activity/useRecentActivity.ts +3 -2
- package/src/agent/AgentDetailView.tsx +6 -130
- package/src/agent/internal/__tests__/agentToInput.test.ts +2 -11
- package/src/agent/internal/agentToInput.ts +0 -11
- package/src/agent-instance/AgentInstanceList.tsx +5 -6
- package/src/agent-instance/__tests__/AgentInstanceList.test.tsx +5 -4
- package/src/api-key/ApiKeyListPanel.tsx +11 -3
- package/src/attachment/AttachmentChipList.tsx +74 -65
- package/src/attachment/AttachmentImageLightbox.tsx +5 -4
- package/src/attachment/__tests__/AttachmentChipList.test.tsx +4 -3
- package/src/channel/AgentChannelsPanel.tsx +5 -6
- package/src/channel/ChannelConversationsDialog.tsx +5 -3
- package/src/channel/ChannelTemplatesDialog.tsx +5 -6
- package/src/channel/__tests__/AgentChannelsPanel.test.tsx +14 -9
- package/src/channel-app/internal.tsx +5 -6
- package/src/composer/ComposerToolbar.tsx +122 -90
- package/src/composer/ConfigureMenu.tsx +33 -24
- package/src/composer/ContextChip.tsx +2 -3
- package/src/composer/ContextPopover.tsx +27 -18
- package/src/composer/SessionComposer.tsx +41 -9
- package/src/composer/__tests__/SessionComposer-agentSetupError.test.tsx +124 -0
- package/src/composer/__tests__/SessionComposer-lockAgent.test.tsx +4 -9
- package/src/conversation/ConversationMediaAttachment.tsx +2 -2
- package/src/conversation/ConversationTimelineView.tsx +19 -2
- package/src/conversation/__tests__/ConversationTimelineView.test.tsx +106 -3
- package/src/conversation/conversationPresentation.ts +52 -1
- package/src/cursor-accounts/MemberCoverageTable.tsx +15 -13
- package/src/cursor-accounts/__tests__/CursorAccountsConsole.test.tsx +4 -4
- package/src/dashboard/DashboardKPICards.tsx +2 -1
- package/src/dependency-graph/DependencyTreeNode.tsx +1 -7
- package/src/dependency-graph/__tests__/useDependencyGraph.test.ts +18 -34
- package/src/dependency-graph/types.ts +8 -20
- package/src/dependency-graph/useDependencyGraph.ts +2 -22
- package/src/environment/EnvironmentVariableEditor.tsx +17 -6
- package/src/execution/ApprovalCard.tsx +1 -3
- package/src/execution/ArtifactRowView.tsx +68 -48
- package/src/execution/FilePathLink.tsx +43 -27
- package/src/execution/McpToolDetail.tsx +6 -2
- package/src/execution/MessageAttachments.tsx +57 -41
- package/src/execution/MessageEntry.tsx +22 -15
- package/src/execution/PlanArtifactCard.tsx +25 -18
- package/src/execution/ToolCallDetail.tsx +1 -4
- package/src/execution/ToolCallItem.tsx +18 -7
- package/src/execution/WriteBackCard.tsx +38 -29
- package/src/execution/__tests__/ArtifactRow.test.tsx +6 -2
- package/src/execution/__tests__/ArtifactRowView.test.tsx +5 -2
- package/src/execution/__tests__/FilePathLink.test.tsx +10 -6
- package/src/execution/__tests__/FileReviewCard.test.tsx +2 -1
- package/src/execution/__tests__/MessageEntry-attachments.test.tsx +3 -2
- package/src/execution/__tests__/MessageThread.test.tsx +6 -1
- package/src/execution/__tests__/artifact-row-tooltips.layout.test.tsx +115 -0
- package/src/execution/artifact-row-item.ts +1 -1
- package/src/file-reference/FileReferenceChipList.tsx +29 -17
- package/src/file-reference/__tests__/FileReferenceChipList.test.tsx +5 -2
- package/src/iam-policy/OrgMembersPanel.tsx +26 -19
- package/src/iam-policy/ProviderBadge.tsx +17 -10
- package/src/iam-policy/RoleSelector.tsx +0 -1
- package/src/identity-provider/IdentityProviderListPanel.tsx +11 -3
- package/src/index.ts +0 -82
- package/src/internal/__tests__/truncated-text.layout.test.tsx +68 -0
- package/src/internal/__tests__/truncated-text.test.tsx +33 -0
- package/src/internal/truncated-text.tsx +81 -0
- package/src/invitation/InvitationManager.tsx +18 -5
- package/src/library/ScopeToggle.tsx +14 -2
- package/src/library/VisibilitySelector.tsx +21 -14
- package/src/library/useExportResource.ts +3 -4
- package/src/manifest/EditResourceYamlDialog.tsx +1 -2
- package/src/manifest/__tests__/ApplyManifestDialog.test.tsx +2 -2
- package/src/manifest/__tests__/EditResourceYamlDialog.test.tsx +9 -9
- package/src/mcp-server/McpServerConfigPanel.tsx +79 -37
- package/src/mcp-server/McpServerConnectDialog.tsx +41 -5
- package/src/mcp-server/McpServerDetailView.tsx +23 -39
- package/src/mcp-server/McpServerPicker.tsx +99 -7
- package/src/mcp-server/McpToolSelector.tsx +12 -7
- package/src/mcp-server/VendorApprovalBlockedNotice.tsx +221 -0
- package/src/mcp-server/__tests__/McpServerPicker.test.tsx +504 -0
- package/src/mcp-server/__tests__/VendorApprovalBlocked.surfaces.test.tsx +321 -0
- package/src/mcp-server/__tests__/VendorApprovalBlockedNotice.test.tsx +154 -0
- package/src/mcp-server/mcpServerSetupReducer.ts +24 -0
- package/src/mcp-server/useMcpServerSetup.ts +9 -0
- package/src/oauth-app/OAuthAppListPanel.tsx +11 -3
- package/src/platform-client/PlatformClientListPanel.tsx +35 -18
- package/src/pricing-governance/BaselineEditor.tsx +20 -0
- package/src/pricing-governance/ModelCatalogPanel.tsx +9 -5
- package/src/pricing-governance/PricingGovernanceConsole.tsx +9 -5
- package/src/pricing-governance/PricingGovernancePanel.tsx +13 -4
- package/src/pricing-governance/__tests__/ModelCatalogPanel.test.tsx +37 -0
- package/src/resource-workbench/components/StatusBadge.tsx +7 -3
- package/src/schedule/CadenceField.tsx +38 -27
- package/src/schedule/ScheduleRunsTable.tsx +23 -11
- package/src/schedule/__tests__/cadence-tooltips.layout.test.tsx +86 -0
- package/src/session/PlanEditor.tsx +9 -8
- package/src/sharing/AgentShareList.tsx +28 -22
- package/src/sharing/ShareAgentDialog.tsx +5 -6
- package/src/sharing/__tests__/AgentShareList.test.tsx +4 -4
- package/src/skill/SkillDetailView.tsx +23 -12
- package/src/version-history/VersionTimelineEntry.tsx +21 -12
- package/src/workflow/CanvasTransitionEdge.tsx +23 -16
- package/src/workflow/ExecutionActiveTaskIndicator.tsx +74 -59
- package/src/workflow/TaskPickerPopover.tsx +0 -1
- package/src/workflow/WorkflowCanvasEditor.tsx +95 -64
- package/src/workflow/WorkflowNode.tsx +13 -6
- package/src/workflow/WorkflowTaskApprovalSummary.tsx +18 -11
- package/src/workflow/WorkflowTaskList.tsx +2 -2
- package/src/workflow/WorkflowVersionBadge.tsx +33 -18
- package/src/workflow/WorkflowVersionTimeline.tsx +7 -6
- package/src/workflow/__tests__/WorkflowTaskApprovalSummary.test.tsx +3 -1
- package/src/workflow/__tests__/structured-data-viewer.test.tsx +5 -2
- package/src/workflow/execution-comparison/ExecutionComparisonView.tsx +5 -3
- package/src/workflow/execution-comparison/TaskComparisonTable.tsx +12 -5
- package/src/workflow/execution-history/ExecutionHistoryTable.tsx +24 -15
- package/src/workflow/inspector/InspectorHeader.tsx +20 -11
- package/src/workflow/inspector/NestedTaskList.tsx +18 -11
- package/src/workflow/inspector/WorkflowSummaryPanel.tsx +5 -3
- package/src/workflow/inspector/tabs/BranchesTab.tsx +61 -31
- package/src/workflow/instance/WorkflowInstanceList.tsx +5 -6
- package/src/workflow/instance/__tests__/WorkflowInstanceList.test.tsx +5 -4
- package/src/workflow/node-shell/DiffBadge.tsx +18 -11
- package/src/workflow/node-shell/ExecutionBadge.tsx +73 -46
- package/src/workflow/node-shell/NodeActions.tsx +128 -94
- package/src/workflow/task-detail/StructuredDataViewer.tsx +4 -2
- package/src/workspace/EditorTabs.tsx +102 -85
- package/src/workspace/ExplorerTree.tsx +47 -30
- package/src/workspace/FileViewer.tsx +11 -3
- package/src/workspace/PanelChip.tsx +32 -23
- package/src/workspace/WorkspaceEditor.tsx +21 -9
- package/src/workspace/WorkspaceSummary.tsx +21 -12
- package/src/workspace/WorkspaceSurface.tsx +86 -61
- package/src/workspace/__tests__/EditorTabs.test.tsx +5 -2
- package/src/workspace/__tests__/WorkspaceSurface.test.tsx +5 -2
- package/styles.css +1 -1
- package/version-history/VersionTimelineEntry.d.ts.map +1 -1
- package/version-history/VersionTimelineEntry.js +2 -1
- package/version-history/VersionTimelineEntry.js.map +1 -1
- package/workflow/CanvasTransitionEdge.d.ts +1 -1
- package/workflow/CanvasTransitionEdge.d.ts.map +1 -1
- package/workflow/CanvasTransitionEdge.js +3 -2
- package/workflow/CanvasTransitionEdge.js.map +1 -1
- package/workflow/ExecutionActiveTaskIndicator.d.ts.map +1 -1
- package/workflow/ExecutionActiveTaskIndicator.js +12 -11
- package/workflow/ExecutionActiveTaskIndicator.js.map +1 -1
- package/workflow/TaskPickerPopover.js +1 -1
- package/workflow/TaskPickerPopover.js.map +1 -1
- package/workflow/WorkflowCanvasEditor.d.ts.map +1 -1
- package/workflow/WorkflowCanvasEditor.js +9 -2
- package/workflow/WorkflowCanvasEditor.js.map +1 -1
- package/workflow/WorkflowNode.d.ts.map +1 -1
- package/workflow/WorkflowNode.js +2 -1
- package/workflow/WorkflowNode.js.map +1 -1
- package/workflow/WorkflowTaskApprovalSummary.d.ts.map +1 -1
- package/workflow/WorkflowTaskApprovalSummary.js +6 -4
- package/workflow/WorkflowTaskApprovalSummary.js.map +1 -1
- package/workflow/WorkflowTaskList.js +2 -2
- package/workflow/WorkflowTaskList.js.map +1 -1
- package/workflow/WorkflowVersionBadge.d.ts.map +1 -1
- package/workflow/WorkflowVersionBadge.js +2 -1
- package/workflow/WorkflowVersionBadge.js.map +1 -1
- package/workflow/WorkflowVersionTimeline.d.ts.map +1 -1
- package/workflow/WorkflowVersionTimeline.js +2 -1
- package/workflow/WorkflowVersionTimeline.js.map +1 -1
- package/workflow/execution-comparison/ExecutionComparisonView.d.ts.map +1 -1
- package/workflow/execution-comparison/ExecutionComparisonView.js +2 -1
- package/workflow/execution-comparison/ExecutionComparisonView.js.map +1 -1
- package/workflow/execution-comparison/TaskComparisonTable.d.ts.map +1 -1
- package/workflow/execution-comparison/TaskComparisonTable.js +2 -1
- package/workflow/execution-comparison/TaskComparisonTable.js.map +1 -1
- package/workflow/execution-history/ExecutionHistoryTable.d.ts.map +1 -1
- package/workflow/execution-history/ExecutionHistoryTable.js +6 -4
- package/workflow/execution-history/ExecutionHistoryTable.js.map +1 -1
- package/workflow/inspector/InspectorHeader.d.ts.map +1 -1
- package/workflow/inspector/InspectorHeader.js +4 -2
- package/workflow/inspector/InspectorHeader.js.map +1 -1
- package/workflow/inspector/NestedTaskList.d.ts.map +1 -1
- package/workflow/inspector/NestedTaskList.js +2 -1
- package/workflow/inspector/NestedTaskList.js.map +1 -1
- package/workflow/inspector/WorkflowSummaryPanel.d.ts.map +1 -1
- package/workflow/inspector/WorkflowSummaryPanel.js +2 -1
- package/workflow/inspector/WorkflowSummaryPanel.js.map +1 -1
- package/workflow/inspector/tabs/BranchesTab.d.ts.map +1 -1
- package/workflow/inspector/tabs/BranchesTab.js +5 -2
- package/workflow/inspector/tabs/BranchesTab.js.map +1 -1
- package/workflow/instance/WorkflowInstanceList.d.ts.map +1 -1
- package/workflow/instance/WorkflowInstanceList.js +2 -1
- package/workflow/instance/WorkflowInstanceList.js.map +1 -1
- package/workflow/node-shell/DiffBadge.d.ts.map +1 -1
- package/workflow/node-shell/DiffBadge.js +3 -2
- package/workflow/node-shell/DiffBadge.js.map +1 -1
- package/workflow/node-shell/ExecutionBadge.d.ts.map +1 -1
- package/workflow/node-shell/ExecutionBadge.js +5 -4
- package/workflow/node-shell/ExecutionBadge.js.map +1 -1
- package/workflow/node-shell/NodeActions.d.ts.map +1 -1
- package/workflow/node-shell/NodeActions.js +12 -11
- package/workflow/node-shell/NodeActions.js.map +1 -1
- package/workflow/task-detail/StructuredDataViewer.d.ts.map +1 -1
- package/workflow/task-detail/StructuredDataViewer.js +5 -1
- package/workflow/task-detail/StructuredDataViewer.js.map +1 -1
- package/workspace/EditorTabs.d.ts.map +1 -1
- package/workspace/EditorTabs.js +38 -37
- package/workspace/EditorTabs.js.map +1 -1
- package/workspace/ExplorerTree.d.ts.map +1 -1
- package/workspace/ExplorerTree.js +2 -1
- package/workspace/ExplorerTree.js.map +1 -1
- package/workspace/FileViewer.d.ts.map +1 -1
- package/workspace/FileViewer.js +2 -1
- package/workspace/FileViewer.js.map +1 -1
- package/workspace/PanelChip.d.ts.map +1 -1
- package/workspace/PanelChip.js +2 -1
- package/workspace/PanelChip.js.map +1 -1
- package/workspace/WorkspaceEditor.d.ts.map +1 -1
- package/workspace/WorkspaceEditor.js +2 -1
- package/workspace/WorkspaceEditor.js.map +1 -1
- package/workspace/WorkspaceSummary.d.ts.map +1 -1
- package/workspace/WorkspaceSummary.js +7 -2
- package/workspace/WorkspaceSummary.js.map +1 -1
- package/workspace/WorkspaceSurface.d.ts.map +1 -1
- package/workspace/WorkspaceSurface.js +12 -11
- package/workspace/WorkspaceSurface.js.map +1 -1
- package/datastore/CollectionRecordsBrowser.d.ts +0 -34
- package/datastore/CollectionRecordsBrowser.d.ts.map +0 -1
- package/datastore/CollectionRecordsBrowser.js +0 -223
- package/datastore/CollectionRecordsBrowser.js.map +0 -1
- package/datastore/CollectionSchemaView.d.ts +0 -29
- package/datastore/CollectionSchemaView.d.ts.map +0 -1
- package/datastore/CollectionSchemaView.js +0 -93
- package/datastore/CollectionSchemaView.js.map +0 -1
- package/datastore/DatastoreDetailView.d.ts +0 -44
- package/datastore/DatastoreDetailView.d.ts.map +0 -1
- package/datastore/DatastoreDetailView.js +0 -76
- package/datastore/DatastoreDetailView.js.map +0 -1
- package/datastore/DatastoreSyncReport.d.ts +0 -19
- package/datastore/DatastoreSyncReport.d.ts.map +0 -1
- package/datastore/DatastoreSyncReport.js +0 -45
- package/datastore/DatastoreSyncReport.js.map +0 -1
- package/datastore/DeleteDatastoreDialog.d.ts +0 -35
- package/datastore/DeleteDatastoreDialog.d.ts.map +0 -1
- package/datastore/DeleteDatastoreDialog.js +0 -90
- package/datastore/DeleteDatastoreDialog.js.map +0 -1
- package/datastore/FieldValueControl.d.ts +0 -55
- package/datastore/FieldValueControl.d.ts.map +0 -1
- package/datastore/FieldValueControl.js +0 -138
- package/datastore/FieldValueControl.js.map +0 -1
- package/datastore/RecordFilterBuilder.d.ts +0 -37
- package/datastore/RecordFilterBuilder.d.ts.map +0 -1
- package/datastore/RecordFilterBuilder.js +0 -122
- package/datastore/RecordFilterBuilder.js.map +0 -1
- package/datastore/RecordFormPanel.d.ts +0 -45
- package/datastore/RecordFormPanel.d.ts.map +0 -1
- package/datastore/RecordFormPanel.js +0 -215
- package/datastore/RecordFormPanel.js.map +0 -1
- package/datastore/index.d.ts +0 -43
- package/datastore/index.d.ts.map +0 -1
- package/datastore/index.js +0 -22
- package/datastore/index.js.map +0 -1
- package/datastore/recordFilter.d.ts +0 -62
- package/datastore/recordFilter.d.ts.map +0 -1
- package/datastore/recordFilter.js +0 -104
- package/datastore/recordFilter.js.map +0 -1
- package/datastore/recordValues.d.ts +0 -85
- package/datastore/recordValues.d.ts.map +0 -1
- package/datastore/recordValues.js +0 -282
- package/datastore/recordValues.js.map +0 -1
- package/datastore/useDatastore.d.ts +0 -39
- package/datastore/useDatastore.d.ts.map +0 -1
- package/datastore/useDatastore.js +0 -44
- package/datastore/useDatastore.js.map +0 -1
- package/datastore/useDatastoreCount.d.ts +0 -50
- package/datastore/useDatastoreCount.d.ts.map +0 -1
- package/datastore/useDatastoreCount.js +0 -27
- package/datastore/useDatastoreCount.js.map +0 -1
- package/datastore/useDatastoreDescription.d.ts +0 -54
- package/datastore/useDatastoreDescription.d.ts.map +0 -1
- package/datastore/useDatastoreDescription.js +0 -50
- package/datastore/useDatastoreDescription.js.map +0 -1
- package/datastore/useDatastoreList.d.ts +0 -57
- package/datastore/useDatastoreList.d.ts.map +0 -1
- package/datastore/useDatastoreList.js +0 -29
- package/datastore/useDatastoreList.js.map +0 -1
- package/datastore/useDatastoreSearch.d.ts +0 -19
- package/datastore/useDatastoreSearch.d.ts.map +0 -1
- package/datastore/useDatastoreSearch.js +0 -22
- package/datastore/useDatastoreSearch.js.map +0 -1
- package/datastore/useDeleteDatastore.d.ts +0 -53
- package/datastore/useDeleteDatastore.d.ts.map +0 -1
- package/datastore/useDeleteDatastore.js +0 -40
- package/datastore/useDeleteDatastore.js.map +0 -1
- package/datastore/useDeleteRecord.d.ts +0 -34
- package/datastore/useDeleteRecord.d.ts.map +0 -1
- package/datastore/useDeleteRecord.js +0 -43
- package/datastore/useDeleteRecord.js.map +0 -1
- package/datastore/useInsertRecord.d.ts +0 -50
- package/datastore/useInsertRecord.d.ts.map +0 -1
- package/datastore/useInsertRecord.js +0 -55
- package/datastore/useInsertRecord.js.map +0 -1
- package/datastore/useRecordCollection.d.ts +0 -104
- package/datastore/useRecordCollection.d.ts.map +0 -1
- package/datastore/useRecordCollection.js +0 -136
- package/datastore/useRecordCollection.js.map +0 -1
- package/datastore/useRecordList.d.ts +0 -66
- package/datastore/useRecordList.d.ts.map +0 -1
- package/datastore/useRecordList.js +0 -58
- package/datastore/useRecordList.js.map +0 -1
- package/datastore/useUpdateRecord.d.ts +0 -52
- package/datastore/useUpdateRecord.d.ts.map +0 -1
- package/datastore/useUpdateRecord.js +0 -55
- package/datastore/useUpdateRecord.js.map +0 -1
- package/src/agent/__tests__/AgentDetailView.datastores.test.tsx +0 -166
- package/src/datastore/CollectionRecordsBrowser.tsx +0 -570
- package/src/datastore/CollectionSchemaView.tsx +0 -247
- package/src/datastore/DatastoreDetailView.tsx +0 -201
- package/src/datastore/DatastoreSyncReport.tsx +0 -105
- package/src/datastore/DeleteDatastoreDialog.tsx +0 -202
- package/src/datastore/FieldValueControl.tsx +0 -289
- package/src/datastore/RecordFilterBuilder.tsx +0 -422
- package/src/datastore/RecordFormPanel.tsx +0 -432
- package/src/datastore/__tests__/CollectionRecordsBrowser.test.tsx +0 -245
- package/src/datastore/__tests__/DeleteDatastoreDialog.test.tsx +0 -133
- package/src/datastore/__tests__/FieldValueControl.test.tsx +0 -160
- package/src/datastore/__tests__/RecordFilterBuilder.test.tsx +0 -155
- package/src/datastore/__tests__/RecordFormPanel.test.tsx +0 -227
- package/src/datastore/__tests__/recordFilter.test.ts +0 -169
- package/src/datastore/__tests__/recordMutations.test.tsx +0 -195
- package/src/datastore/__tests__/recordValues.test.ts +0 -359
- package/src/datastore/__tests__/schemaAndSyncViews.test.tsx +0 -142
- package/src/datastore/__tests__/useDatastoreDescription.test.tsx +0 -143
- package/src/datastore/__tests__/useRecordCollection.test.tsx +0 -250
- package/src/datastore/__tests__/useRecordList.test.tsx +0 -85
- package/src/datastore/index.ts +0 -111
- package/src/datastore/recordFilter.ts +0 -154
- package/src/datastore/recordValues.ts +0 -327
- package/src/datastore/useDatastore.ts +0 -67
- package/src/datastore/useDatastoreCount.ts +0 -69
- package/src/datastore/useDatastoreDescription.ts +0 -90
- package/src/datastore/useDatastoreList.ts +0 -79
- package/src/datastore/useDatastoreSearch.ts +0 -39
- package/src/datastore/useDeleteDatastore.ts +0 -87
- package/src/datastore/useDeleteRecord.ts +0 -77
- package/src/datastore/useInsertRecord.ts +0 -92
- package/src/datastore/useRecordCollection.ts +0 -256
- package/src/datastore/useRecordList.ts +0 -131
- package/src/datastore/useUpdateRecord.ts +0 -95
|
@@ -1,570 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useCallback, useMemo, useState } from "react";
|
|
4
|
-
import { cn } from "@stigmer/theme";
|
|
5
|
-
import { timestampDate } from "@bufbuild/protobuf/wkt";
|
|
6
|
-
import { getUserMessage, isPermissionDenied } from "@stigmer/sdk";
|
|
7
|
-
import {
|
|
8
|
-
DatastoreVerb,
|
|
9
|
-
FieldType,
|
|
10
|
-
type CollectionDeclaration,
|
|
11
|
-
type DatastoreSpec,
|
|
12
|
-
} from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/spec_pb";
|
|
13
|
-
import type {
|
|
14
|
-
CollectionDescription,
|
|
15
|
-
RecordEnvelope,
|
|
16
|
-
} from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/record_io_pb";
|
|
17
|
-
import { ResourceTable } from "../resource-workbench/components/ResourceTable.js";
|
|
18
|
-
import { ConfirmDialog } from "../resource-detail/ConfirmDialog.js";
|
|
19
|
-
import { useConfirmAction } from "../resource-detail/useConfirmAction.js";
|
|
20
|
-
import { toast } from "../feedback/toast.js";
|
|
21
|
-
import { FIELD_INPUT_CLASSES } from "./FieldValueControl.js";
|
|
22
|
-
import { RecordFilterBuilder } from "./RecordFilterBuilder.js";
|
|
23
|
-
import { RecordFormPanel } from "./RecordFormPanel.js";
|
|
24
|
-
import { buildRecordFilter, type RecordConditionDraft } from "./recordFilter.js";
|
|
25
|
-
import {
|
|
26
|
-
formatFieldValue,
|
|
27
|
-
formatSystemTimestamp,
|
|
28
|
-
isSortableField,
|
|
29
|
-
} from "./recordValues.js";
|
|
30
|
-
import { useDatastoreDescription } from "./useDatastoreDescription.js";
|
|
31
|
-
import { useRecordCollection, type RecordColumnDef } from "./useRecordCollection.js";
|
|
32
|
-
import { useDeleteRecord } from "./useDeleteRecord.js";
|
|
33
|
-
import type { SortValue } from "../resource-workbench/types.js";
|
|
34
|
-
|
|
35
|
-
/** Props for {@link CollectionRecordsBrowser}. */
|
|
36
|
-
export interface CollectionRecordsBrowserProps {
|
|
37
|
-
/** Organization slug. */
|
|
38
|
-
readonly org: string;
|
|
39
|
-
/** Datastore slug. */
|
|
40
|
-
readonly datastoreSlug: string;
|
|
41
|
-
/** The datastore spec — collections and fields drive the grid columns. */
|
|
42
|
-
readonly spec: DatastoreSpec;
|
|
43
|
-
/** Additional CSS classes for the root container. */
|
|
44
|
-
readonly className?: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const PAGE_SIZE = 25;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* The records browser (DD-008 SD-3): collection selector, partition
|
|
51
|
-
* picker, schema-aware filter builder, typed-cell grid, RPC-paged
|
|
52
|
-
* navigation, and verb-gated write affordances — the console surface
|
|
53
|
-
* that absorbs the Supabase-dashboard capability the datastore
|
|
54
|
-
* primitive retires.
|
|
55
|
-
*
|
|
56
|
-
* Authorization is rendered as the two layers it is:
|
|
57
|
-
* - Write affordances gate on `describeDatastore`'s per-collection
|
|
58
|
-
* effective verbs (projections, never authority — the server's
|
|
59
|
-
* record layer stays the enforcer).
|
|
60
|
-
* - **The denied state is a first-class render**, driven primarily by
|
|
61
|
-
* empty access lists (deny-by-default renders as empty access, never
|
|
62
|
-
* an error) with a caught reach-level `PERMISSION_DENIED` as the
|
|
63
|
-
* defensive branch. Both show the relayable message plus operator
|
|
64
|
-
* guidance — never a silently empty grid.
|
|
65
|
-
*
|
|
66
|
-
* All visual properties flow through `--stgm-*` design tokens.
|
|
67
|
-
* Zero Console dependencies — safe for platform builder embedding.
|
|
68
|
-
*/
|
|
69
|
-
export function CollectionRecordsBrowser({
|
|
70
|
-
org,
|
|
71
|
-
datastoreSlug,
|
|
72
|
-
spec,
|
|
73
|
-
className,
|
|
74
|
-
}: CollectionRecordsBrowserProps) {
|
|
75
|
-
const collections = spec.collections;
|
|
76
|
-
const [collectionName, setCollectionName] = useState(collections[0]?.name ?? "");
|
|
77
|
-
const collection = collections.find((c) => c.name === collectionName);
|
|
78
|
-
|
|
79
|
-
const description = useDatastoreDescription(org, datastoreSlug);
|
|
80
|
-
const [partition, setPartition] = useState("default");
|
|
81
|
-
|
|
82
|
-
// Filter, sort, and page state — per collection selection.
|
|
83
|
-
const [conditions, setConditions] = useState<readonly RecordConditionDraft[]>([]);
|
|
84
|
-
const [sort, setSort] = useState<SortValue | null>(null);
|
|
85
|
-
const [page, setPage] = useState(1);
|
|
86
|
-
|
|
87
|
-
const selectCollection = useCallback((name: string) => {
|
|
88
|
-
setCollectionName(name);
|
|
89
|
-
setConditions([]);
|
|
90
|
-
setSort(null);
|
|
91
|
-
setPage(1);
|
|
92
|
-
}, []);
|
|
93
|
-
|
|
94
|
-
const selectPartition = useCallback((name: string) => {
|
|
95
|
-
setPartition(name);
|
|
96
|
-
setPage(1);
|
|
97
|
-
}, []);
|
|
98
|
-
|
|
99
|
-
const applyConditions = useCallback((next: readonly RecordConditionDraft[]) => {
|
|
100
|
-
setConditions(next);
|
|
101
|
-
setPage(1);
|
|
102
|
-
}, []);
|
|
103
|
-
|
|
104
|
-
if (collections.length === 0) {
|
|
105
|
-
return (
|
|
106
|
-
<p className={cn("stg:px-3 stg:py-6 stg:text-center stg:text-sm stg:text-muted-foreground", className)}>
|
|
107
|
-
This datastore declares no collections.
|
|
108
|
-
</p>
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
if (!collection) return null;
|
|
112
|
-
|
|
113
|
-
const collectionAccess = description.description?.collections.find(
|
|
114
|
-
(c) => c.name === collection.name,
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
return (
|
|
118
|
-
<div className={cn("stg:flex stg:flex-col stg:gap-3", className)}>
|
|
119
|
-
<div className="stg:flex stg:flex-wrap stg:items-center stg:gap-2">
|
|
120
|
-
<label className="stg:flex stg:items-center stg:gap-1.5 stg:text-xs stg:font-medium stg:text-muted-foreground">
|
|
121
|
-
Collection
|
|
122
|
-
<select
|
|
123
|
-
className={cn(FIELD_INPUT_CLASSES, "stg:w-auto")}
|
|
124
|
-
value={collectionName}
|
|
125
|
-
onChange={(e) => selectCollection(e.target.value)}
|
|
126
|
-
>
|
|
127
|
-
{collections.map((c) => (
|
|
128
|
-
<option key={c.name} value={c.name}>
|
|
129
|
-
{c.name}
|
|
130
|
-
</option>
|
|
131
|
-
))}
|
|
132
|
-
</select>
|
|
133
|
-
</label>
|
|
134
|
-
<label className="stg:flex stg:items-center stg:gap-1.5 stg:text-xs stg:font-medium stg:text-muted-foreground">
|
|
135
|
-
Partition
|
|
136
|
-
<select
|
|
137
|
-
className={cn(FIELD_INPUT_CLASSES, "stg:w-auto")}
|
|
138
|
-
value={partition}
|
|
139
|
-
onChange={(e) => selectPartition(e.target.value)}
|
|
140
|
-
>
|
|
141
|
-
{description.partitions.map((p) => (
|
|
142
|
-
<option key={p} value={p}>
|
|
143
|
-
{p}
|
|
144
|
-
</option>
|
|
145
|
-
))}
|
|
146
|
-
</select>
|
|
147
|
-
</label>
|
|
148
|
-
</div>
|
|
149
|
-
|
|
150
|
-
<RecordsPane
|
|
151
|
-
org={org}
|
|
152
|
-
datastoreSlug={datastoreSlug}
|
|
153
|
-
collection={collection}
|
|
154
|
-
partition={partition}
|
|
155
|
-
conditions={conditions}
|
|
156
|
-
onConditionsChange={applyConditions}
|
|
157
|
-
sort={sort}
|
|
158
|
-
onSortChange={setSort}
|
|
159
|
-
page={page}
|
|
160
|
-
onPageChange={setPage}
|
|
161
|
-
access={collectionAccess}
|
|
162
|
-
describeError={description.error}
|
|
163
|
-
describeLoaded={description.description !== null}
|
|
164
|
-
/>
|
|
165
|
-
</div>
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// ---------------------------------------------------------------------------
|
|
170
|
-
// The per-collection pane: denied panel or grid
|
|
171
|
-
// ---------------------------------------------------------------------------
|
|
172
|
-
|
|
173
|
-
function RecordsPane({
|
|
174
|
-
org,
|
|
175
|
-
datastoreSlug,
|
|
176
|
-
collection,
|
|
177
|
-
partition,
|
|
178
|
-
conditions,
|
|
179
|
-
onConditionsChange,
|
|
180
|
-
sort,
|
|
181
|
-
onSortChange,
|
|
182
|
-
page,
|
|
183
|
-
onPageChange,
|
|
184
|
-
access,
|
|
185
|
-
describeError,
|
|
186
|
-
describeLoaded,
|
|
187
|
-
}: {
|
|
188
|
-
readonly org: string;
|
|
189
|
-
readonly datastoreSlug: string;
|
|
190
|
-
readonly collection: CollectionDeclaration;
|
|
191
|
-
readonly partition: string;
|
|
192
|
-
readonly conditions: readonly RecordConditionDraft[];
|
|
193
|
-
readonly onConditionsChange: (c: readonly RecordConditionDraft[]) => void;
|
|
194
|
-
readonly sort: SortValue | null;
|
|
195
|
-
readonly onSortChange: (s: SortValue | null) => void;
|
|
196
|
-
readonly page: number;
|
|
197
|
-
readonly onPageChange: (p: number) => void;
|
|
198
|
-
readonly access: CollectionDescription | undefined;
|
|
199
|
-
readonly describeError: Error | null;
|
|
200
|
-
readonly describeLoaded: boolean;
|
|
201
|
-
}) {
|
|
202
|
-
const verbs = useMemo(() => {
|
|
203
|
-
const set = new Set<DatastoreVerb>();
|
|
204
|
-
for (const grant of access?.access ?? []) set.add(grant.verb);
|
|
205
|
-
return set;
|
|
206
|
-
}, [access]);
|
|
207
|
-
const canRead = verbs.has(DatastoreVerb.read);
|
|
208
|
-
const canInsert = verbs.has(DatastoreVerb.insert);
|
|
209
|
-
const canUpdate = verbs.has(DatastoreVerb.update);
|
|
210
|
-
const canDelete = verbs.has(DatastoreVerb.delete);
|
|
211
|
-
|
|
212
|
-
// The caller's column-level read access (empty means every field): a
|
|
213
|
-
// field-restricted read grant returns only these fields, so the grid
|
|
214
|
-
// and the filter builder narrow to them — no permanently-empty
|
|
215
|
-
// columns, no filter the server would refuse (DD-008 invariant 2).
|
|
216
|
-
const readableFields = useMemo(
|
|
217
|
-
() => access?.access.find((a) => a.verb === DatastoreVerb.read)?.readableFields ?? [],
|
|
218
|
-
[access],
|
|
219
|
-
);
|
|
220
|
-
|
|
221
|
-
const scope = { org, datastore: datastoreSlug, collection: collection.name, partition };
|
|
222
|
-
|
|
223
|
-
const filter = useMemo(() => buildRecordFilter(conditions), [conditions]);
|
|
224
|
-
const columns = useMemo(
|
|
225
|
-
() => buildRecordColumns(collection, readableFields),
|
|
226
|
-
[collection, readableFields],
|
|
227
|
-
);
|
|
228
|
-
|
|
229
|
-
// Fetch only once read access is confirmed — the denied panel is the
|
|
230
|
-
// primary render for deny-by-default, not a failed query.
|
|
231
|
-
const records = useRecordCollection({
|
|
232
|
-
org: describeLoaded && canRead ? org : null,
|
|
233
|
-
datastore: datastoreSlug,
|
|
234
|
-
collection: collection.name,
|
|
235
|
-
partition,
|
|
236
|
-
filter,
|
|
237
|
-
page,
|
|
238
|
-
pageSize: PAGE_SIZE,
|
|
239
|
-
sort,
|
|
240
|
-
onSortChange,
|
|
241
|
-
columns,
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
// Row actions and write panel state.
|
|
245
|
-
const [formOpen, setFormOpen] = useState(false);
|
|
246
|
-
const [editing, setEditing] = useState<RecordEnvelope | null>(null);
|
|
247
|
-
const { confirmState, confirm, handleConfirm, handleCancel } = useConfirmAction();
|
|
248
|
-
const deleteRecord = useDeleteRecord();
|
|
249
|
-
|
|
250
|
-
const openInsert = useCallback(() => {
|
|
251
|
-
setEditing(null);
|
|
252
|
-
setFormOpen(true);
|
|
253
|
-
}, []);
|
|
254
|
-
|
|
255
|
-
const openEdit = useCallback((record: RecordEnvelope) => {
|
|
256
|
-
setEditing(record);
|
|
257
|
-
setFormOpen(true);
|
|
258
|
-
}, []);
|
|
259
|
-
|
|
260
|
-
// Deps narrowed to the specific stable callbacks used (DD-010).
|
|
261
|
-
const deleteRecordFn = deleteRecord.deleteRecord;
|
|
262
|
-
const refetchRecords = records.refetch;
|
|
263
|
-
const collectionName = collection.name;
|
|
264
|
-
const handleDelete = useCallback(
|
|
265
|
-
async (record: RecordEnvelope) => {
|
|
266
|
-
const ok = await confirm({
|
|
267
|
-
title: "Delete record?",
|
|
268
|
-
description: `Record ${record.id} will be permanently deleted.`,
|
|
269
|
-
confirmLabel: "Delete",
|
|
270
|
-
variant: "destructive",
|
|
271
|
-
});
|
|
272
|
-
if (!ok) return;
|
|
273
|
-
try {
|
|
274
|
-
await deleteRecordFn({
|
|
275
|
-
org,
|
|
276
|
-
datastore: datastoreSlug,
|
|
277
|
-
collection: collectionName,
|
|
278
|
-
partition,
|
|
279
|
-
id: record.id,
|
|
280
|
-
});
|
|
281
|
-
toast.success("Record deleted");
|
|
282
|
-
refetchRecords();
|
|
283
|
-
} catch (err) {
|
|
284
|
-
toast.error(getUserMessage(err));
|
|
285
|
-
}
|
|
286
|
-
},
|
|
287
|
-
[confirm, deleteRecordFn, refetchRecords, org, datastoreSlug, collectionName, partition],
|
|
288
|
-
);
|
|
289
|
-
|
|
290
|
-
// --- Denied states (DD-008 SD-3): first-class renders ---------------------
|
|
291
|
-
if (describeError && isPermissionDenied(describeError)) {
|
|
292
|
-
return <DeniedPanel message={getUserMessage(describeError)} />;
|
|
293
|
-
}
|
|
294
|
-
if (describeLoaded && !canRead) {
|
|
295
|
-
return (
|
|
296
|
-
<DeniedPanel
|
|
297
|
-
message={`You do not have record access to “${collection.name}”.`}
|
|
298
|
-
/>
|
|
299
|
-
);
|
|
300
|
-
}
|
|
301
|
-
if (records.error && isPermissionDenied(records.error)) {
|
|
302
|
-
return <DeniedPanel message={getUserMessage(records.error)} />;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
const totalPages = Math.max(records.totalPages, 1);
|
|
306
|
-
|
|
307
|
-
return (
|
|
308
|
-
<div className="stg:flex stg:flex-col stg:gap-3">
|
|
309
|
-
<div className="stg:flex stg:flex-wrap stg:items-center stg:gap-2">
|
|
310
|
-
<RecordFilterBuilder
|
|
311
|
-
collection={collection}
|
|
312
|
-
readableFields={readableFields}
|
|
313
|
-
conditions={conditions}
|
|
314
|
-
onChange={onConditionsChange}
|
|
315
|
-
className="stg:min-w-0 stg:flex-1"
|
|
316
|
-
/>
|
|
317
|
-
{canInsert && (
|
|
318
|
-
<button
|
|
319
|
-
type="button"
|
|
320
|
-
onClick={openInsert}
|
|
321
|
-
className={cn(
|
|
322
|
-
"stg:shrink-0 stg:rounded-md stg:bg-primary stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium stg:text-primary-foreground",
|
|
323
|
-
"stg:hover:bg-primary-hover",
|
|
324
|
-
"stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",
|
|
325
|
-
)}
|
|
326
|
-
>
|
|
327
|
-
Insert record
|
|
328
|
-
</button>
|
|
329
|
-
)}
|
|
330
|
-
</div>
|
|
331
|
-
|
|
332
|
-
{records.error ? (
|
|
333
|
-
<div
|
|
334
|
-
role="alert"
|
|
335
|
-
className="stg:rounded-md stg:border stg:border-destructive stg:bg-card stg:px-3 stg:py-2 stg:text-sm stg:text-destructive"
|
|
336
|
-
>
|
|
337
|
-
{getUserMessage(records.error)}
|
|
338
|
-
</div>
|
|
339
|
-
) : records.isLoading ? (
|
|
340
|
-
<div className="stg:rounded-lg stg:border stg:border-border stg:px-3 stg:py-6 stg:text-center stg:text-sm stg:text-muted-foreground">
|
|
341
|
-
Loading records…
|
|
342
|
-
</div>
|
|
343
|
-
) : records.records.length === 0 ? (
|
|
344
|
-
<div className="stg:rounded-lg stg:border stg:border-border stg:px-3 stg:py-6 stg:text-center stg:text-sm stg:text-muted-foreground">
|
|
345
|
-
{conditions.length > 0
|
|
346
|
-
? "No records match the current filters."
|
|
347
|
-
: `No records in “${collection.name}” yet.`}
|
|
348
|
-
</div>
|
|
349
|
-
) : (
|
|
350
|
-
records.table && (
|
|
351
|
-
<div className="stg:overflow-x-auto stg:rounded-lg stg:border stg:border-border">
|
|
352
|
-
<ResourceTable
|
|
353
|
-
table={records.table}
|
|
354
|
-
aria-label={`Records in ${collection.name}`}
|
|
355
|
-
renderRowAction={
|
|
356
|
-
canUpdate || canDelete
|
|
357
|
-
? (record) => (
|
|
358
|
-
<RowActions
|
|
359
|
-
record={record}
|
|
360
|
-
canUpdate={canUpdate}
|
|
361
|
-
canDelete={canDelete}
|
|
362
|
-
onEdit={openEdit}
|
|
363
|
-
onDelete={handleDelete}
|
|
364
|
-
/>
|
|
365
|
-
)
|
|
366
|
-
: undefined
|
|
367
|
-
}
|
|
368
|
-
/>
|
|
369
|
-
</div>
|
|
370
|
-
)
|
|
371
|
-
)}
|
|
372
|
-
|
|
373
|
-
<div className="stg:flex stg:items-center stg:justify-between stg:text-xs stg:text-muted-foreground">
|
|
374
|
-
<span>
|
|
375
|
-
{records.total} record{records.total === 1 ? "" : "s"}
|
|
376
|
-
</span>
|
|
377
|
-
<div className="stg:flex stg:items-center stg:gap-2">
|
|
378
|
-
<button
|
|
379
|
-
type="button"
|
|
380
|
-
onClick={() => onPageChange(page - 1)}
|
|
381
|
-
disabled={page <= 1}
|
|
382
|
-
className={paginationButtonClass}
|
|
383
|
-
>
|
|
384
|
-
Previous
|
|
385
|
-
</button>
|
|
386
|
-
<span>
|
|
387
|
-
Page {page} of {totalPages}
|
|
388
|
-
</span>
|
|
389
|
-
<button
|
|
390
|
-
type="button"
|
|
391
|
-
onClick={() => onPageChange(page + 1)}
|
|
392
|
-
disabled={page >= totalPages}
|
|
393
|
-
className={paginationButtonClass}
|
|
394
|
-
>
|
|
395
|
-
Next
|
|
396
|
-
</button>
|
|
397
|
-
</div>
|
|
398
|
-
</div>
|
|
399
|
-
|
|
400
|
-
<RecordFormPanel
|
|
401
|
-
open={formOpen}
|
|
402
|
-
onOpenChange={setFormOpen}
|
|
403
|
-
scope={scope}
|
|
404
|
-
collection={collection}
|
|
405
|
-
record={editing}
|
|
406
|
-
onSaved={() => records.refetch()}
|
|
407
|
-
/>
|
|
408
|
-
<ConfirmDialog state={confirmState} onConfirm={handleConfirm} onCancel={handleCancel} />
|
|
409
|
-
</div>
|
|
410
|
-
);
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
const paginationButtonClass = cn(
|
|
414
|
-
"stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2 stg:py-1 stg:text-xs stg:font-medium stg:text-foreground",
|
|
415
|
-
"stg:hover:bg-accent stg:hover:text-accent-foreground",
|
|
416
|
-
"stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring",
|
|
417
|
-
"stg:disabled:pointer-events-none stg:disabled:opacity-50",
|
|
418
|
-
);
|
|
419
|
-
|
|
420
|
-
// ---------------------------------------------------------------------------
|
|
421
|
-
// Denied panel — an explanation, never an empty grid
|
|
422
|
-
// ---------------------------------------------------------------------------
|
|
423
|
-
|
|
424
|
-
function DeniedPanel({ message }: { readonly message: string }) {
|
|
425
|
-
return (
|
|
426
|
-
<div
|
|
427
|
-
role="status"
|
|
428
|
-
className="stg:flex stg:flex-col stg:items-center stg:gap-2 stg:rounded-lg stg:border stg:border-border stg:bg-muted stg:px-4 stg:py-8 stg:text-center"
|
|
429
|
-
>
|
|
430
|
-
<p className="stg:text-sm stg:font-medium stg:text-foreground">{message}</p>
|
|
431
|
-
<p className="stg:max-w-md stg:text-xs stg:text-muted-foreground">
|
|
432
|
-
Record access is granted by the datastore's authorization block. To
|
|
433
|
-
gain access, add a role binding for your principal or set a{" "}
|
|
434
|
-
<code className="stg:font-mono">default_role</code> in the datastore YAML,
|
|
435
|
-
with the verbs you need granted on this collection.
|
|
436
|
-
</p>
|
|
437
|
-
</div>
|
|
438
|
-
);
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
// ---------------------------------------------------------------------------
|
|
442
|
-
// Columns: typed cells from FieldDeclaration + system columns
|
|
443
|
-
// ---------------------------------------------------------------------------
|
|
444
|
-
|
|
445
|
-
/**
|
|
446
|
-
* Grid columns for a collection: declared fields with typed cells, then
|
|
447
|
-
* `created_at` (visible by default). The remaining system columns
|
|
448
|
-
* (`id`, `updated_at`, `created_by`) stay out of the default grid —
|
|
449
|
-
* they are shown in the record form's read-only summary; a column
|
|
450
|
-
* toggle is recorded growth.
|
|
451
|
-
*
|
|
452
|
-
* `readableFields` narrows the declared columns to the caller's
|
|
453
|
-
* column-level read access (empty means every field): a hidden field's
|
|
454
|
-
* cells would be permanently empty, which reads as missing data rather
|
|
455
|
-
* than restricted access.
|
|
456
|
-
*/
|
|
457
|
-
function buildRecordColumns(
|
|
458
|
-
collection: CollectionDeclaration,
|
|
459
|
-
readableFields: readonly string[],
|
|
460
|
-
): RecordColumnDef[] {
|
|
461
|
-
const readable = readableFields.length > 0 ? new Set(readableFields) : null;
|
|
462
|
-
const declaredColumns =
|
|
463
|
-
readable === null
|
|
464
|
-
? collection.fields
|
|
465
|
-
: collection.fields.filter((field) => readable.has(field.name));
|
|
466
|
-
const fieldColumns: RecordColumnDef[] = declaredColumns.map((field) => ({
|
|
467
|
-
id: field.name,
|
|
468
|
-
header: field.name,
|
|
469
|
-
sortable: isSortableField(field),
|
|
470
|
-
cell: (record) => (
|
|
471
|
-
<TypedCell
|
|
472
|
-
value={formatFieldValue(field.type, record.fields?.[field.name])}
|
|
473
|
-
numeric={field.type === FieldType.integer || field.type === FieldType.number}
|
|
474
|
-
mono={field.type === FieldType.json}
|
|
475
|
-
/>
|
|
476
|
-
),
|
|
477
|
-
}));
|
|
478
|
-
|
|
479
|
-
return [
|
|
480
|
-
...fieldColumns,
|
|
481
|
-
{
|
|
482
|
-
id: "created_at",
|
|
483
|
-
header: "created_at",
|
|
484
|
-
sortable: true,
|
|
485
|
-
cell: (record) => (
|
|
486
|
-
<TypedCell
|
|
487
|
-
value={
|
|
488
|
-
record.createdAt
|
|
489
|
-
? formatSystemTimestamp(timestampDate(record.createdAt).toISOString())
|
|
490
|
-
: ""
|
|
491
|
-
}
|
|
492
|
-
mono
|
|
493
|
-
/>
|
|
494
|
-
),
|
|
495
|
-
},
|
|
496
|
-
];
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
function TypedCell({
|
|
500
|
-
value,
|
|
501
|
-
numeric,
|
|
502
|
-
mono,
|
|
503
|
-
}: {
|
|
504
|
-
readonly value: string;
|
|
505
|
-
readonly numeric?: boolean;
|
|
506
|
-
readonly mono?: boolean;
|
|
507
|
-
}) {
|
|
508
|
-
const truncated = value.length > 80 ? `${value.slice(0, 79)}…` : value;
|
|
509
|
-
return (
|
|
510
|
-
<span
|
|
511
|
-
title={value.length > 80 ? value : undefined}
|
|
512
|
-
className={cn(
|
|
513
|
-
"stg:block stg:max-w-xs stg:truncate",
|
|
514
|
-
numeric && "stg:text-right stg:tabular-nums",
|
|
515
|
-
mono && "stg:font-mono",
|
|
516
|
-
)}
|
|
517
|
-
>
|
|
518
|
-
{truncated}
|
|
519
|
-
</span>
|
|
520
|
-
);
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
// ---------------------------------------------------------------------------
|
|
524
|
-
// Row actions
|
|
525
|
-
// ---------------------------------------------------------------------------
|
|
526
|
-
|
|
527
|
-
function RowActions({
|
|
528
|
-
record,
|
|
529
|
-
canUpdate,
|
|
530
|
-
canDelete,
|
|
531
|
-
onEdit,
|
|
532
|
-
onDelete,
|
|
533
|
-
}: {
|
|
534
|
-
readonly record: RecordEnvelope;
|
|
535
|
-
readonly canUpdate: boolean;
|
|
536
|
-
readonly canDelete: boolean;
|
|
537
|
-
readonly onEdit: (record: RecordEnvelope) => void;
|
|
538
|
-
readonly onDelete: (record: RecordEnvelope) => void;
|
|
539
|
-
}) {
|
|
540
|
-
return (
|
|
541
|
-
<div className="stg:flex stg:items-center stg:gap-1">
|
|
542
|
-
{canUpdate && (
|
|
543
|
-
<button
|
|
544
|
-
type="button"
|
|
545
|
-
onClick={() => onEdit(record)}
|
|
546
|
-
aria-label={`Edit record ${record.id}`}
|
|
547
|
-
className={rowActionClass}
|
|
548
|
-
>
|
|
549
|
-
Edit
|
|
550
|
-
</button>
|
|
551
|
-
)}
|
|
552
|
-
{canDelete && (
|
|
553
|
-
<button
|
|
554
|
-
type="button"
|
|
555
|
-
onClick={() => onDelete(record)}
|
|
556
|
-
aria-label={`Delete record ${record.id}`}
|
|
557
|
-
className={cn(rowActionClass, "stg:text-destructive stg:hover:text-destructive")}
|
|
558
|
-
>
|
|
559
|
-
Delete
|
|
560
|
-
</button>
|
|
561
|
-
)}
|
|
562
|
-
</div>
|
|
563
|
-
);
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
const rowActionClass = cn(
|
|
567
|
-
"stg:rounded-md stg:px-1.5 stg:py-0.5 stg:text-xs stg:font-medium stg:text-muted-foreground",
|
|
568
|
-
"stg:hover:bg-accent stg:hover:text-foreground",
|
|
569
|
-
"stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring",
|
|
570
|
-
);
|