@stigmer/react 0.4.7 → 0.5.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/action-menu/ActionMenu.d.ts +64 -0
- package/action-menu/ActionMenu.d.ts.map +1 -0
- package/action-menu/ActionMenu.js +78 -0
- package/action-menu/ActionMenu.js.map +1 -0
- package/action-menu/index.d.ts +3 -0
- package/action-menu/index.d.ts.map +1 -0
- package/action-menu/index.js +2 -0
- package/action-menu/index.js.map +1 -0
- package/action-menu/types.d.ts +65 -0
- package/action-menu/types.d.ts.map +1 -0
- package/action-menu/types.js +2 -0
- package/action-menu/types.js.map +1 -0
- package/agent/AgentCreationWizard.d.ts +55 -0
- package/agent/AgentCreationWizard.d.ts.map +1 -0
- package/agent/AgentCreationWizard.js +115 -0
- package/agent/AgentCreationWizard.js.map +1 -0
- package/agent/AgentDetailView.d.ts +77 -9
- package/agent/AgentDetailView.d.ts.map +1 -1
- package/agent/AgentDetailView.js +265 -87
- package/agent/AgentDetailView.js.map +1 -1
- package/agent/index.d.ts +8 -0
- package/agent/index.d.ts.map +1 -1
- package/agent/index.js +4 -0
- package/agent/index.js.map +1 -1
- package/agent/internal/agentToInput.d.ts +12 -0
- package/agent/internal/agentToInput.d.ts.map +1 -0
- package/agent/internal/agentToInput.js +72 -0
- package/agent/internal/agentToInput.js.map +1 -0
- package/agent/steps/CapabilitiesStep.d.ts +16 -0
- package/agent/steps/CapabilitiesStep.d.ts.map +1 -0
- package/agent/steps/CapabilitiesStep.js +80 -0
- package/agent/steps/CapabilitiesStep.js.map +1 -0
- package/agent/steps/IdentityStep.d.ts +18 -0
- package/agent/steps/IdentityStep.d.ts.map +1 -0
- package/agent/steps/IdentityStep.js +43 -0
- package/agent/steps/IdentityStep.js.map +1 -0
- package/agent/steps/ReviewStep.d.ts +23 -0
- package/agent/steps/ReviewStep.d.ts.map +1 -0
- package/agent/steps/ReviewStep.js +73 -0
- package/agent/steps/ReviewStep.js.map +1 -0
- package/agent/steps/types.d.ts +35 -0
- package/agent/steps/types.d.ts.map +1 -0
- package/agent/steps/types.js +16 -0
- package/agent/steps/types.js.map +1 -0
- package/agent/useCreateAgent.d.ts +45 -0
- package/agent/useCreateAgent.d.ts.map +1 -0
- package/agent/useCreateAgent.js +50 -0
- package/agent/useCreateAgent.js.map +1 -0
- package/agent/useUpdateAgent.d.ts +24 -0
- package/agent/useUpdateAgent.d.ts.map +1 -0
- package/agent/useUpdateAgent.js +35 -0
- package/agent/useUpdateAgent.js.map +1 -0
- package/dependency-graph/DependencyGraph.d.ts +37 -0
- package/dependency-graph/DependencyGraph.d.ts.map +1 -0
- package/dependency-graph/DependencyGraph.js +88 -0
- package/dependency-graph/DependencyGraph.js.map +1 -0
- package/dependency-graph/DependencyTreeNode.d.ts +23 -0
- package/dependency-graph/DependencyTreeNode.d.ts.map +1 -0
- package/dependency-graph/DependencyTreeNode.js +99 -0
- package/dependency-graph/DependencyTreeNode.js.map +1 -0
- package/dependency-graph/index.d.ts +4 -0
- package/dependency-graph/index.d.ts.map +1 -0
- package/dependency-graph/index.js +5 -0
- package/dependency-graph/index.js.map +1 -0
- package/dependency-graph/types.d.ts +130 -0
- package/dependency-graph/types.d.ts.map +1 -0
- package/dependency-graph/types.js +2 -0
- package/dependency-graph/types.js.map +1 -0
- package/dependency-graph/useDependencyGraph.d.ts +27 -0
- package/dependency-graph/useDependencyGraph.d.ts.map +1 -0
- package/dependency-graph/useDependencyGraph.js +129 -0
- package/dependency-graph/useDependencyGraph.js.map +1 -0
- package/empty-state/EmptyState.d.ts +29 -0
- package/empty-state/EmptyState.d.ts.map +1 -0
- package/empty-state/EmptyState.js +45 -0
- package/empty-state/EmptyState.js.map +1 -0
- package/empty-state/index.d.ts +4 -0
- package/empty-state/index.d.ts.map +1 -0
- package/empty-state/index.js +3 -0
- package/empty-state/index.js.map +1 -0
- package/empty-state/types.d.ts +73 -0
- package/empty-state/types.d.ts.map +1 -0
- package/empty-state/types.js +2 -0
- package/empty-state/types.js.map +1 -0
- package/empty-state/useEmptyState.d.ts +18 -0
- package/empty-state/useEmptyState.d.ts.map +1 -0
- package/empty-state/useEmptyState.js +72 -0
- package/empty-state/useEmptyState.js.map +1 -0
- package/execution/MessageThread.d.ts +1 -0
- package/execution/MessageThread.d.ts.map +1 -1
- package/execution/MessageThread.js +22 -12
- package/execution/MessageThread.js.map +1 -1
- package/execution/SetupProgress.d.ts +23 -9
- package/execution/SetupProgress.d.ts.map +1 -1
- package/execution/SetupProgress.js +30 -14
- package/execution/SetupProgress.js.map +1 -1
- package/execution/__tests__/thread-keys.test.js +82 -0
- package/execution/__tests__/thread-keys.test.js.map +1 -1
- package/feedback/StigmerToaster.d.ts +18 -0
- package/feedback/StigmerToaster.d.ts.map +1 -0
- package/feedback/StigmerToaster.js +31 -0
- package/feedback/StigmerToaster.js.map +1 -0
- package/feedback/index.d.ts +4 -0
- package/feedback/index.d.ts.map +1 -0
- package/feedback/index.js +3 -0
- package/feedback/index.js.map +1 -0
- package/feedback/toast.d.ts +14 -0
- package/feedback/toast.d.ts.map +1 -0
- package/feedback/toast.js +14 -0
- package/feedback/toast.js.map +1 -0
- package/feedback/types.d.ts +4 -0
- package/feedback/types.d.ts.map +1 -0
- package/feedback/types.js +2 -0
- package/feedback/types.js.map +1 -0
- package/index.d.ts +30 -10
- package/index.d.ts.map +1 -1
- package/index.js +29 -9
- package/index.js.map +1 -1
- package/inline-edit/InlineEditImage.d.ts +20 -0
- package/inline-edit/InlineEditImage.d.ts.map +1 -0
- package/inline-edit/InlineEditImage.js +85 -0
- package/inline-edit/InlineEditImage.js.map +1 -0
- package/inline-edit/InlineEditKeyValue.d.ts +29 -0
- package/inline-edit/InlineEditKeyValue.d.ts.map +1 -0
- package/inline-edit/InlineEditKeyValue.js +67 -0
- package/inline-edit/InlineEditKeyValue.js.map +1 -0
- package/inline-edit/InlineEditResourceList.d.ts +34 -0
- package/inline-edit/InlineEditResourceList.d.ts.map +1 -0
- package/inline-edit/InlineEditResourceList.js +99 -0
- package/inline-edit/InlineEditResourceList.js.map +1 -0
- package/inline-edit/InlineEditSelect.d.ts +18 -0
- package/inline-edit/InlineEditSelect.d.ts.map +1 -0
- package/inline-edit/InlineEditSelect.js +54 -0
- package/inline-edit/InlineEditSelect.js.map +1 -0
- package/inline-edit/InlineEditText.d.ts +23 -0
- package/inline-edit/InlineEditText.d.ts.map +1 -0
- package/inline-edit/InlineEditText.js +79 -0
- package/inline-edit/InlineEditText.js.map +1 -0
- package/inline-edit/InlineEditTextarea.d.ts +22 -0
- package/inline-edit/InlineEditTextarea.d.ts.map +1 -0
- package/inline-edit/InlineEditTextarea.js +83 -0
- package/inline-edit/InlineEditTextarea.js.map +1 -0
- package/inline-edit/index.d.ts +16 -0
- package/inline-edit/index.d.ts.map +1 -0
- package/inline-edit/index.js +8 -0
- package/inline-edit/index.js.map +1 -0
- package/inline-edit/types.d.ts +42 -0
- package/inline-edit/types.d.ts.map +1 -0
- package/inline-edit/types.js +2 -0
- package/inline-edit/types.js.map +1 -0
- package/inline-edit/useInlineFieldSave.d.ts +23 -0
- package/inline-edit/useInlineFieldSave.d.ts.map +1 -0
- package/inline-edit/useInlineFieldSave.js +44 -0
- package/inline-edit/useInlineFieldSave.js.map +1 -0
- package/internal/Tabs.d.ts +4 -38
- package/internal/Tabs.d.ts.map +1 -1
- package/internal/Tabs.js +3 -62
- package/internal/Tabs.js.map +1 -1
- package/library/ImportResourceDialog.d.ts +43 -0
- package/library/ImportResourceDialog.d.ts.map +1 -0
- package/library/ImportResourceDialog.js +90 -0
- package/library/ImportResourceDialog.js.map +1 -0
- package/library/index.d.ts +7 -4
- package/library/index.d.ts.map +1 -1
- package/library/index.js +4 -2
- package/library/index.js.map +1 -1
- package/library/serialize-resource-yaml.d.ts +53 -0
- package/library/serialize-resource-yaml.d.ts.map +1 -1
- package/library/serialize-resource-yaml.js +275 -0
- package/library/serialize-resource-yaml.js.map +1 -1
- package/library/useExportResource.d.ts +56 -0
- package/library/useExportResource.d.ts.map +1 -0
- package/library/useExportResource.js +137 -0
- package/library/useExportResource.js.map +1 -0
- package/library/useImportResource.d.ts +84 -0
- package/library/useImportResource.d.ts.map +1 -0
- package/library/useImportResource.js +188 -0
- package/library/useImportResource.js.map +1 -0
- package/mcp-server/McpServerCreationWizard.d.ts +55 -0
- package/mcp-server/McpServerCreationWizard.d.ts.map +1 -0
- package/mcp-server/McpServerCreationWizard.js +121 -0
- package/mcp-server/McpServerCreationWizard.js.map +1 -0
- package/mcp-server/McpServerDetailView.d.ts +21 -1
- package/mcp-server/McpServerDetailView.d.ts.map +1 -1
- package/mcp-server/McpServerDetailView.js +113 -20
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/mcp-server/index.d.ts +8 -0
- package/mcp-server/index.d.ts.map +1 -1
- package/mcp-server/index.js +4 -0
- package/mcp-server/index.js.map +1 -1
- package/mcp-server/internal/mcpServerToInput.d.ts +12 -0
- package/mcp-server/internal/mcpServerToInput.d.ts.map +1 -0
- package/mcp-server/internal/mcpServerToInput.js +81 -0
- package/mcp-server/internal/mcpServerToInput.js.map +1 -0
- package/mcp-server/steps/EnvironmentAuthStep.d.ts +15 -0
- package/mcp-server/steps/EnvironmentAuthStep.d.ts.map +1 -0
- package/mcp-server/steps/EnvironmentAuthStep.js +55 -0
- package/mcp-server/steps/EnvironmentAuthStep.js.map +1 -0
- package/mcp-server/steps/IdentityTransportStep.d.ts +19 -0
- package/mcp-server/steps/IdentityTransportStep.d.ts.map +1 -0
- package/mcp-server/steps/IdentityTransportStep.js +73 -0
- package/mcp-server/steps/IdentityTransportStep.js.map +1 -0
- package/mcp-server/steps/ReviewStep.d.ts +23 -0
- package/mcp-server/steps/ReviewStep.d.ts.map +1 -0
- package/mcp-server/steps/ReviewStep.js +137 -0
- package/mcp-server/steps/ReviewStep.js.map +1 -0
- package/mcp-server/steps/types.d.ts +56 -0
- package/mcp-server/steps/types.d.ts.map +1 -0
- package/mcp-server/steps/types.js +27 -0
- package/mcp-server/steps/types.js.map +1 -0
- package/mcp-server/useCreateMcpServer.d.ts +45 -0
- package/mcp-server/useCreateMcpServer.d.ts.map +1 -0
- package/mcp-server/useCreateMcpServer.js +50 -0
- package/mcp-server/useCreateMcpServer.js.map +1 -0
- package/mcp-server/useUpdateMcpServer.d.ts +24 -0
- package/mcp-server/useUpdateMcpServer.d.ts.map +1 -0
- package/mcp-server/useUpdateMcpServer.js +35 -0
- package/mcp-server/useUpdateMcpServer.js.map +1 -0
- package/models/registry.d.ts +4 -1
- package/models/registry.d.ts.map +1 -1
- package/models/registry.js +6 -2
- package/models/registry.js.map +1 -1
- package/package.json +8 -4
- package/provider.js +1 -1
- package/provider.js.map +1 -1
- package/resource-creation/CreationPicker.d.ts +60 -0
- package/resource-creation/CreationPicker.d.ts.map +1 -0
- package/resource-creation/CreationPicker.js +74 -0
- package/resource-creation/CreationPicker.js.map +1 -0
- package/resource-creation/StepIndicator.d.ts +28 -0
- package/resource-creation/StepIndicator.d.ts.map +1 -0
- package/resource-creation/StepIndicator.js +40 -0
- package/resource-creation/StepIndicator.js.map +1 -0
- package/resource-creation/TemplateCard.d.ts +24 -0
- package/resource-creation/TemplateCard.d.ts.map +1 -0
- package/resource-creation/TemplateCard.js +68 -0
- package/resource-creation/TemplateCard.js.map +1 -0
- package/resource-creation/TemplateGallery.d.ts +43 -0
- package/resource-creation/TemplateGallery.d.ts.map +1 -0
- package/resource-creation/TemplateGallery.js +78 -0
- package/resource-creation/TemplateGallery.js.map +1 -0
- package/resource-creation/WizardNav.d.ts +31 -0
- package/resource-creation/WizardNav.d.ts.map +1 -0
- package/resource-creation/WizardNav.js +29 -0
- package/resource-creation/WizardNav.js.map +1 -0
- package/resource-creation/WizardShell.d.ts +41 -0
- package/resource-creation/WizardShell.d.ts.map +1 -0
- package/resource-creation/WizardShell.js +55 -0
- package/resource-creation/WizardShell.js.map +1 -0
- package/resource-creation/index.d.ts +21 -0
- package/resource-creation/index.d.ts.map +1 -0
- package/resource-creation/index.js +14 -0
- package/resource-creation/index.js.map +1 -0
- package/resource-creation/templates/agent-templates.d.ts +15 -0
- package/resource-creation/templates/agent-templates.d.ts.map +1 -0
- package/resource-creation/templates/agent-templates.js +148 -0
- package/resource-creation/templates/agent-templates.js.map +1 -0
- package/resource-creation/templates/index.d.ts +5 -0
- package/resource-creation/templates/index.d.ts.map +1 -0
- package/resource-creation/templates/index.js +5 -0
- package/resource-creation/templates/index.js.map +1 -0
- package/resource-creation/templates/mcp-server-templates.d.ts +15 -0
- package/resource-creation/templates/mcp-server-templates.d.ts.map +1 -0
- package/resource-creation/templates/mcp-server-templates.js +92 -0
- package/resource-creation/templates/mcp-server-templates.js.map +1 -0
- package/resource-creation/templates/types.d.ts +48 -0
- package/resource-creation/templates/types.d.ts.map +1 -0
- package/resource-creation/templates/types.js +16 -0
- package/resource-creation/templates/types.js.map +1 -0
- package/resource-creation/types.d.ts +88 -0
- package/resource-creation/types.d.ts.map +1 -0
- package/resource-creation/types.js +2 -0
- package/resource-creation/types.js.map +1 -0
- package/resource-creation/useTemplateFilter.d.ts +43 -0
- package/resource-creation/useTemplateFilter.d.ts.map +1 -0
- package/resource-creation/useTemplateFilter.js +73 -0
- package/resource-creation/useTemplateFilter.js.map +1 -0
- package/resource-creation/useWizardState.d.ts +67 -0
- package/resource-creation/useWizardState.d.ts.map +1 -0
- package/resource-creation/useWizardState.js +143 -0
- package/resource-creation/useWizardState.js.map +1 -0
- package/resource-detail/ConfirmDialog.d.ts +44 -0
- package/resource-detail/ConfirmDialog.d.ts.map +1 -0
- package/resource-detail/ConfirmDialog.js +62 -0
- package/resource-detail/ConfirmDialog.js.map +1 -0
- package/resource-detail/ResourceActionBar.d.ts +42 -0
- package/resource-detail/ResourceActionBar.d.ts.map +1 -0
- package/resource-detail/ResourceActionBar.js +64 -0
- package/resource-detail/ResourceActionBar.js.map +1 -0
- package/resource-detail/ResourceDetailShell.d.ts +36 -0
- package/resource-detail/ResourceDetailShell.d.ts.map +1 -0
- package/resource-detail/ResourceDetailShell.js +65 -0
- package/resource-detail/ResourceDetailShell.js.map +1 -0
- package/resource-detail/Section.d.ts +18 -0
- package/resource-detail/Section.d.ts.map +1 -0
- package/resource-detail/Section.js +18 -0
- package/resource-detail/Section.js.map +1 -0
- package/resource-detail/index.d.ts +15 -0
- package/resource-detail/index.d.ts.map +1 -0
- package/resource-detail/index.js +10 -0
- package/resource-detail/index.js.map +1 -0
- package/resource-detail/types.d.ts +146 -0
- package/resource-detail/types.d.ts.map +1 -0
- package/resource-detail/types.js +2 -0
- package/resource-detail/types.js.map +1 -0
- package/resource-detail/useConfirmAction.d.ts +41 -0
- package/resource-detail/useConfirmAction.d.ts.map +1 -0
- package/resource-detail/useConfirmAction.js +30 -0
- package/resource-detail/useConfirmAction.js.map +1 -0
- package/resource-detail/useCopyResource.d.ts +28 -0
- package/resource-detail/useCopyResource.d.ts.map +1 -0
- package/resource-detail/useCopyResource.js +46 -0
- package/resource-detail/useCopyResource.js.map +1 -0
- package/resource-detail/useDeleteResource.d.ts +40 -0
- package/resource-detail/useDeleteResource.d.ts.map +1 -0
- package/resource-detail/useDeleteResource.js +83 -0
- package/resource-detail/useDeleteResource.js.map +1 -0
- package/resource-detail/useDetailTabs.d.ts +46 -0
- package/resource-detail/useDetailTabs.d.ts.map +1 -0
- package/resource-detail/useDetailTabs.js +47 -0
- package/resource-detail/useDetailTabs.js.map +1 -0
- package/resource-workbench/components/BulkActionBar.d.ts +36 -0
- package/resource-workbench/components/BulkActionBar.d.ts.map +1 -0
- package/resource-workbench/components/BulkActionBar.js +35 -0
- package/resource-workbench/components/BulkActionBar.js.map +1 -0
- package/resource-workbench/components/ColumnHeader.d.ts +23 -0
- package/resource-workbench/components/ColumnHeader.d.ts.map +1 -0
- package/resource-workbench/components/ColumnHeader.js +25 -0
- package/resource-workbench/components/ColumnHeader.js.map +1 -0
- package/resource-workbench/components/FilterBar.d.ts +33 -0
- package/resource-workbench/components/FilterBar.d.ts.map +1 -0
- package/resource-workbench/components/FilterBar.js +72 -0
- package/resource-workbench/components/FilterBar.js.map +1 -0
- package/resource-workbench/components/ResourceAvatar.d.ts +29 -0
- package/resource-workbench/components/ResourceAvatar.d.ts.map +1 -0
- package/resource-workbench/components/ResourceAvatar.js +51 -0
- package/resource-workbench/components/ResourceAvatar.js.map +1 -0
- package/resource-workbench/components/ResourceCards.d.ts +39 -0
- package/resource-workbench/components/ResourceCards.d.ts.map +1 -0
- package/resource-workbench/components/ResourceCards.js +41 -0
- package/resource-workbench/components/ResourceCards.js.map +1 -0
- package/resource-workbench/components/ResourceInspector.d.ts +26 -0
- package/resource-workbench/components/ResourceInspector.d.ts.map +1 -0
- package/resource-workbench/components/ResourceInspector.js +22 -0
- package/resource-workbench/components/ResourceInspector.js.map +1 -0
- package/resource-workbench/components/ResourceList.d.ts +39 -0
- package/resource-workbench/components/ResourceList.d.ts.map +1 -0
- package/resource-workbench/components/ResourceList.js +41 -0
- package/resource-workbench/components/ResourceList.js.map +1 -0
- package/resource-workbench/components/ResourceTable.d.ts +47 -0
- package/resource-workbench/components/ResourceTable.d.ts.map +1 -0
- package/resource-workbench/components/ResourceTable.js +78 -0
- package/resource-workbench/components/ResourceTable.js.map +1 -0
- package/resource-workbench/components/ResourceWorkbench.d.ts +131 -0
- package/resource-workbench/components/ResourceWorkbench.d.ts.map +1 -0
- package/resource-workbench/components/ResourceWorkbench.js +170 -0
- package/resource-workbench/components/ResourceWorkbench.js.map +1 -0
- package/resource-workbench/components/SelectionCheckbox.d.ts +24 -0
- package/resource-workbench/components/SelectionCheckbox.d.ts.map +1 -0
- package/resource-workbench/components/SelectionCheckbox.js +16 -0
- package/resource-workbench/components/SelectionCheckbox.js.map +1 -0
- package/resource-workbench/components/StatusBadge.d.ts +31 -0
- package/resource-workbench/components/StatusBadge.d.ts.map +1 -0
- package/resource-workbench/components/StatusBadge.js +75 -0
- package/resource-workbench/components/StatusBadge.js.map +1 -0
- package/resource-workbench/components/ViewSwitcher.d.ts +21 -0
- package/resource-workbench/components/ViewSwitcher.d.ts.map +1 -0
- package/resource-workbench/components/ViewSwitcher.js +37 -0
- package/resource-workbench/components/ViewSwitcher.js.map +1 -0
- package/resource-workbench/hooks/useResourceCollection.d.ts +93 -0
- package/resource-workbench/hooks/useResourceCollection.d.ts.map +1 -0
- package/resource-workbench/hooks/useResourceCollection.js +133 -0
- package/resource-workbench/hooks/useResourceCollection.js.map +1 -0
- package/resource-workbench/hooks/useResourceFilters.d.ts +73 -0
- package/resource-workbench/hooks/useResourceFilters.d.ts.map +1 -0
- package/resource-workbench/hooks/useResourceFilters.js +105 -0
- package/resource-workbench/hooks/useResourceFilters.js.map +1 -0
- package/resource-workbench/hooks/useResourceSelection.d.ts +44 -0
- package/resource-workbench/hooks/useResourceSelection.d.ts.map +1 -0
- package/resource-workbench/hooks/useResourceSelection.js +123 -0
- package/resource-workbench/hooks/useResourceSelection.js.map +1 -0
- package/resource-workbench/hooks/useViewPreference.d.ts +32 -0
- package/resource-workbench/hooks/useViewPreference.d.ts.map +1 -0
- package/resource-workbench/hooks/useViewPreference.js +60 -0
- package/resource-workbench/hooks/useViewPreference.js.map +1 -0
- package/resource-workbench/index.d.ts +34 -0
- package/resource-workbench/index.d.ts.map +1 -0
- package/resource-workbench/index.js +19 -0
- package/resource-workbench/index.js.map +1 -0
- package/resource-workbench/types.d.ts +165 -0
- package/resource-workbench/types.d.ts.map +1 -0
- package/resource-workbench/types.js +2 -0
- package/resource-workbench/types.js.map +1 -0
- package/runner/RunnerDetailView.d.ts +44 -0
- package/runner/RunnerDetailView.d.ts.map +1 -0
- package/runner/RunnerDetailView.js +154 -0
- package/runner/RunnerDetailView.js.map +1 -0
- package/runner/RunnerListPanel.d.ts +26 -1
- package/runner/RunnerListPanel.d.ts.map +1 -1
- package/runner/RunnerListPanel.js +68 -46
- package/runner/RunnerListPanel.js.map +1 -1
- package/runner/index.d.ts +7 -1
- package/runner/index.d.ts.map +1 -1
- package/runner/index.js +3 -0
- package/runner/index.js.map +1 -1
- package/runner/shared.d.ts +31 -0
- package/runner/shared.d.ts.map +1 -0
- package/runner/shared.js +55 -0
- package/runner/shared.js.map +1 -0
- package/runner/useRunner.d.ts +37 -0
- package/runner/useRunner.d.ts.map +1 -0
- package/runner/useRunner.js +24 -0
- package/runner/useRunner.js.map +1 -0
- package/session/__tests__/group-sessions.test.js +3 -3
- package/session/__tests__/group-sessions.test.js.map +1 -1
- package/skill/SkillDetailView.d.ts +70 -7
- package/skill/SkillDetailView.d.ts.map +1 -1
- package/skill/SkillDetailView.js +107 -39
- package/skill/SkillDetailView.js.map +1 -1
- package/skill/SkillDiffDialog.d.ts +42 -0
- package/skill/SkillDiffDialog.d.ts.map +1 -0
- package/skill/SkillDiffDialog.js +72 -0
- package/skill/SkillDiffDialog.js.map +1 -0
- package/skill/SkillFileBrowser.d.ts +31 -0
- package/skill/SkillFileBrowser.d.ts.map +1 -0
- package/skill/SkillFileBrowser.js +105 -0
- package/skill/SkillFileBrowser.js.map +1 -0
- package/skill/SkillUploader.d.ts +39 -0
- package/skill/SkillUploader.d.ts.map +1 -0
- package/skill/SkillUploader.js +141 -0
- package/skill/SkillUploader.js.map +1 -0
- package/skill/index.d.ts +18 -0
- package/skill/index.d.ts.map +1 -1
- package/skill/index.js +9 -0
- package/skill/index.js.map +1 -1
- package/skill/internal/computeArtifactHash.d.ts +9 -0
- package/skill/internal/computeArtifactHash.d.ts.map +1 -0
- package/skill/internal/computeArtifactHash.js +14 -0
- package/skill/internal/computeArtifactHash.js.map +1 -0
- package/skill/internal/fetchAndUnpackArtifact.d.ts +16 -0
- package/skill/internal/fetchAndUnpackArtifact.d.ts.map +1 -0
- package/skill/internal/fetchAndUnpackArtifact.js +34 -0
- package/skill/internal/fetchAndUnpackArtifact.js.map +1 -0
- package/skill/usePushSkill.d.ts +53 -0
- package/skill/usePushSkill.d.ts.map +1 -0
- package/skill/usePushSkill.js +57 -0
- package/skill/usePushSkill.js.map +1 -0
- package/skill/useSkillArtifact.d.ts +37 -0
- package/skill/useSkillArtifact.d.ts.map +1 -0
- package/skill/useSkillArtifact.js +76 -0
- package/skill/useSkillArtifact.js.map +1 -0
- package/skill/useSkillDiff.d.ts +31 -0
- package/skill/useSkillDiff.d.ts.map +1 -0
- package/skill/useSkillDiff.js +97 -0
- package/skill/useSkillDiff.js.map +1 -0
- package/skill/useSkillDuplicateCheck.d.ts +34 -0
- package/skill/useSkillDuplicateCheck.d.ts.map +1 -0
- package/skill/useSkillDuplicateCheck.js +58 -0
- package/skill/useSkillDuplicateCheck.js.map +1 -0
- package/skill/useSkillUpload.d.ts +69 -0
- package/skill/useSkillUpload.d.ts.map +1 -0
- package/skill/useSkillUpload.js +157 -0
- package/skill/useSkillUpload.js.map +1 -0
- package/skill/useSkillVersions.d.ts +46 -0
- package/skill/useSkillVersions.d.ts.map +1 -0
- package/skill/useSkillVersions.js +104 -0
- package/skill/useSkillVersions.js.map +1 -0
- package/src/action-menu/ActionMenu.tsx +151 -0
- package/src/action-menu/index.ts +9 -0
- package/src/action-menu/types.ts +70 -0
- package/src/agent/AgentCreationWizard.tsx +201 -0
- package/src/agent/AgentDetailView.tsx +817 -321
- package/src/agent/index.ts +16 -0
- package/src/agent/internal/agentToInput.ts +95 -0
- package/src/agent/steps/CapabilitiesStep.tsx +363 -0
- package/src/agent/steps/IdentityStep.tsx +259 -0
- package/src/agent/steps/ReviewStep.tsx +211 -0
- package/src/agent/steps/types.ts +53 -0
- package/src/agent/useCreateAgent.ts +76 -0
- package/src/agent/useUpdateAgent.ts +55 -0
- package/src/dependency-graph/DependencyGraph.tsx +153 -0
- package/src/dependency-graph/DependencyTreeNode.tsx +282 -0
- package/src/dependency-graph/index.ts +15 -0
- package/src/dependency-graph/types.ts +131 -0
- package/src/dependency-graph/useDependencyGraph.ts +158 -0
- package/src/empty-state/EmptyState.tsx +90 -0
- package/src/empty-state/index.ts +9 -0
- package/src/empty-state/types.ts +81 -0
- package/src/empty-state/useEmptyState.ts +85 -0
- package/src/execution/MessageThread.tsx +26 -15
- package/src/execution/SetupProgress.tsx +35 -14
- package/src/execution/__tests__/thread-keys.test.ts +101 -0
- package/src/feedback/StigmerToaster.tsx +45 -0
- package/src/feedback/index.ts +3 -0
- package/src/feedback/toast.ts +13 -0
- package/src/feedback/types.ts +7 -0
- package/src/index.ts +270 -8
- package/src/inline-edit/InlineEditImage.tsx +208 -0
- package/src/inline-edit/InlineEditKeyValue.tsx +278 -0
- package/src/inline-edit/InlineEditResourceList.tsx +325 -0
- package/src/inline-edit/InlineEditSelect.tsx +150 -0
- package/src/inline-edit/InlineEditText.tsx +211 -0
- package/src/inline-edit/InlineEditTextarea.tsx +209 -0
- package/src/inline-edit/index.ts +28 -0
- package/src/inline-edit/types.ts +47 -0
- package/src/inline-edit/useInlineFieldSave.ts +62 -0
- package/src/internal/Tabs.tsx +4 -164
- package/src/library/ImportResourceDialog.tsx +227 -0
- package/src/library/index.ts +18 -8
- package/src/library/serialize-resource-yaml.ts +356 -0
- package/src/library/useExportResource.ts +183 -0
- package/src/library/useImportResource.ts +253 -0
- package/src/mcp-server/McpServerCreationWizard.tsx +206 -0
- package/src/mcp-server/McpServerDetailView.tsx +392 -105
- package/src/mcp-server/index.ts +16 -0
- package/src/mcp-server/internal/mcpServerToInput.ts +95 -0
- package/src/mcp-server/steps/EnvironmentAuthStep.tsx +462 -0
- package/src/mcp-server/steps/IdentityTransportStep.tsx +531 -0
- package/src/mcp-server/steps/ReviewStep.tsx +297 -0
- package/src/mcp-server/steps/types.ts +85 -0
- package/src/mcp-server/useCreateMcpServer.ts +76 -0
- package/src/mcp-server/useUpdateMcpServer.ts +55 -0
- package/src/models/registry.ts +10 -2
- package/src/provider.tsx +1 -1
- package/src/resource-creation/CreationPicker.tsx +292 -0
- package/src/resource-creation/StepIndicator.tsx +156 -0
- package/src/resource-creation/TemplateCard.tsx +143 -0
- package/src/resource-creation/TemplateGallery.tsx +222 -0
- package/src/resource-creation/WizardNav.tsx +163 -0
- package/src/resource-creation/WizardShell.tsx +124 -0
- package/src/resource-creation/index.ts +45 -0
- package/src/resource-creation/templates/agent-templates.ts +160 -0
- package/src/resource-creation/templates/index.ts +7 -0
- package/src/resource-creation/templates/mcp-server-templates.ts +106 -0
- package/src/resource-creation/templates/types.ts +64 -0
- package/src/resource-creation/types.ts +105 -0
- package/src/resource-creation/useTemplateFilter.ts +117 -0
- package/src/resource-creation/useWizardState.ts +223 -0
- package/src/resource-detail/ConfirmDialog.tsx +127 -0
- package/src/resource-detail/ResourceActionBar.tsx +157 -0
- package/src/resource-detail/ResourceDetailShell.tsx +184 -0
- package/src/resource-detail/Section.tsx +78 -0
- package/src/resource-detail/index.ts +34 -0
- package/src/resource-detail/types.ts +177 -0
- package/src/resource-detail/useConfirmAction.ts +70 -0
- package/src/resource-detail/useCopyResource.ts +74 -0
- package/src/resource-detail/useDeleteResource.ts +110 -0
- package/src/resource-detail/useDetailTabs.ts +93 -0
- package/src/resource-workbench/components/BulkActionBar.tsx +122 -0
- package/src/resource-workbench/components/ColumnHeader.tsx +105 -0
- package/src/resource-workbench/components/FilterBar.tsx +173 -0
- package/src/resource-workbench/components/ResourceAvatar.tsx +109 -0
- package/src/resource-workbench/components/ResourceCards.tsx +126 -0
- package/src/resource-workbench/components/ResourceInspector.tsx +88 -0
- package/src/resource-workbench/components/ResourceList.tsx +121 -0
- package/src/resource-workbench/components/ResourceTable.tsx +222 -0
- package/src/resource-workbench/components/ResourceWorkbench.tsx +695 -0
- package/src/resource-workbench/components/SelectionCheckbox.tsx +52 -0
- package/src/resource-workbench/components/StatusBadge.tsx +119 -0
- package/src/resource-workbench/components/ViewSwitcher.tsx +135 -0
- package/src/resource-workbench/hooks/useResourceCollection.ts +261 -0
- package/src/resource-workbench/hooks/useResourceFilters.ts +216 -0
- package/src/resource-workbench/hooks/useResourceSelection.ts +178 -0
- package/src/resource-workbench/hooks/useViewPreference.ts +75 -0
- package/src/resource-workbench/index.ts +73 -0
- package/src/resource-workbench/types.ts +220 -0
- package/src/runner/RunnerDetailView.tsx +410 -0
- package/src/runner/RunnerListPanel.tsx +126 -111
- package/src/runner/index.ts +13 -1
- package/src/runner/shared.tsx +124 -0
- package/src/runner/useRunner.ts +59 -0
- package/src/session/__tests__/group-sessions.test.ts +5 -3
- package/src/skill/SkillDetailView.tsx +371 -165
- package/src/skill/SkillDiffDialog.tsx +213 -0
- package/src/skill/SkillFileBrowser.tsx +289 -0
- package/src/skill/SkillUploader.tsx +481 -0
- package/src/skill/index.ts +34 -0
- package/src/skill/internal/computeArtifactHash.ts +13 -0
- package/src/skill/internal/fetchAndUnpackArtifact.ts +48 -0
- package/src/skill/usePushSkill.ts +101 -0
- package/src/skill/useSkillArtifact.ts +107 -0
- package/src/skill/useSkillDiff.ts +128 -0
- package/src/skill/useSkillDuplicateCheck.ts +92 -0
- package/src/skill/useSkillUpload.ts +231 -0
- package/src/skill/useSkillVersions.ts +165 -0
- package/src/styles.css +28 -0
- package/src/tabs/Tabs.tsx +184 -0
- package/src/tabs/index.ts +2 -0
- package/src/version-history/DiffFileList.tsx +111 -0
- package/src/version-history/DiffSummary.tsx +61 -0
- package/src/version-history/DiffViewer.tsx +163 -0
- package/src/version-history/MultiFileDiffView.tsx +114 -0
- package/src/version-history/VersionTimeline.tsx +232 -0
- package/src/version-history/VersionTimelineEntry.tsx +254 -0
- package/src/version-history/computeDiff.ts +61 -0
- package/src/version-history/computeMultiFileDiff.ts +97 -0
- package/src/version-history/index.ts +22 -0
- package/src/version-history/types.ts +129 -0
- package/styles.css +1 -1
- package/tabs/Tabs.d.ts +58 -0
- package/tabs/Tabs.d.ts.map +1 -0
- package/tabs/Tabs.js +80 -0
- package/tabs/Tabs.js.map +1 -0
- package/tabs/index.d.ts +3 -0
- package/tabs/index.d.ts.map +1 -0
- package/tabs/index.js +2 -0
- package/tabs/index.js.map +1 -0
- package/version-history/DiffFileList.d.ts +22 -0
- package/version-history/DiffFileList.d.ts.map +1 -0
- package/version-history/DiffFileList.js +37 -0
- package/version-history/DiffFileList.js.map +1 -0
- package/version-history/DiffSummary.d.ts +21 -0
- package/version-history/DiffSummary.d.ts.map +1 -0
- package/version-history/DiffSummary.js +16 -0
- package/version-history/DiffSummary.js.map +1 -0
- package/version-history/DiffViewer.d.ts +31 -0
- package/version-history/DiffViewer.d.ts.map +1 -0
- package/version-history/DiffViewer.js +60 -0
- package/version-history/DiffViewer.js.map +1 -0
- package/version-history/MultiFileDiffView.d.ts +30 -0
- package/version-history/MultiFileDiffView.d.ts.map +1 -0
- package/version-history/MultiFileDiffView.js +40 -0
- package/version-history/MultiFileDiffView.js.map +1 -0
- package/version-history/VersionTimeline.d.ts +29 -0
- package/version-history/VersionTimeline.d.ts.map +1 -0
- package/version-history/VersionTimeline.js +87 -0
- package/version-history/VersionTimeline.js.map +1 -0
- package/version-history/VersionTimelineEntry.d.ts +22 -0
- package/version-history/VersionTimelineEntry.d.ts.map +1 -0
- package/version-history/VersionTimelineEntry.js +98 -0
- package/version-history/VersionTimelineEntry.js.map +1 -0
- package/version-history/computeDiff.d.ts +16 -0
- package/version-history/computeDiff.d.ts.map +1 -0
- package/version-history/computeDiff.js +54 -0
- package/version-history/computeDiff.js.map +1 -0
- package/version-history/computeMultiFileDiff.d.ts +15 -0
- package/version-history/computeMultiFileDiff.d.ts.map +1 -0
- package/version-history/computeMultiFileDiff.js +83 -0
- package/version-history/computeMultiFileDiff.js.map +1 -0
- package/version-history/index.d.ts +14 -0
- package/version-history/index.d.ts.map +1 -0
- package/version-history/index.js +9 -0
- package/version-history/index.js.map +1 -0
- package/version-history/types.d.ts +106 -0
- package/version-history/types.d.ts.map +1 -0
- package/version-history/types.js +2 -0
- package/version-history/types.js.map +1 -0
- package/library/ResourceListView.d.ts +0 -174
- package/library/ResourceListView.d.ts.map +0 -1
- package/library/ResourceListView.js +0 -318
- package/library/ResourceListView.js.map +0 -1
- package/src/library/ResourceListView.tsx +0 -956
|
@@ -1,956 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
|
-
import { cn } from "@stigmer/theme";
|
|
5
|
-
import type { SearchResult } from "@stigmer/protos/ai/stigmer/search/v1/io_pb";
|
|
6
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
7
|
-
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
8
|
-
import { ScopeToggle } from "./ScopeToggle";
|
|
9
|
-
import type { ResourceListScope } from "../search";
|
|
10
|
-
|
|
11
|
-
const DEBOUNCE_MS = 300;
|
|
12
|
-
const SKELETON_COUNT = 5;
|
|
13
|
-
const GRID_SKELETON_COUNT = 6;
|
|
14
|
-
const MAX_VISIBLE_TAGS = 3;
|
|
15
|
-
|
|
16
|
-
/** Layout mode for {@link ResourceListView}. */
|
|
17
|
-
export type ResourceListLayout = "list" | "grid";
|
|
18
|
-
|
|
19
|
-
/** Props for {@link ResourceListView}. */
|
|
20
|
-
export interface ResourceListViewProps {
|
|
21
|
-
/** Resource entries to display. */
|
|
22
|
-
readonly items: readonly SearchResult[];
|
|
23
|
-
/** Whether data is currently being fetched. */
|
|
24
|
-
readonly isLoading: boolean;
|
|
25
|
-
/** Error from the data hook. Shown as an alert when present and not loading. */
|
|
26
|
-
readonly error?: Error | null;
|
|
27
|
-
/** Total number of results across all pages. Shown in the pagination bar when provided. */
|
|
28
|
-
readonly totalCount?: number;
|
|
29
|
-
/** Total number of pages available. Enables pagination controls when greater than 1. */
|
|
30
|
-
readonly totalPages?: number;
|
|
31
|
-
/** Current page number (1-indexed). */
|
|
32
|
-
readonly currentPage?: number;
|
|
33
|
-
/**
|
|
34
|
-
* Called with the debounced search query (300ms delay) when the user types.
|
|
35
|
-
* Providing this prop enables the search input in the toolbar.
|
|
36
|
-
*
|
|
37
|
-
* The component manages the raw input value internally and only calls
|
|
38
|
-
* this handler with the debounced value, so the parent does not need
|
|
39
|
-
* to implement debouncing.
|
|
40
|
-
*/
|
|
41
|
-
readonly onSearchChange?: (query: string) => void;
|
|
42
|
-
/** Placeholder text for the search input. @default "Search\u2026" */
|
|
43
|
-
readonly searchPlaceholder?: string;
|
|
44
|
-
/** Initial value for the search input, read only on mount (e.g. from URL params). */
|
|
45
|
-
readonly initialSearch?: string;
|
|
46
|
-
/**
|
|
47
|
-
* The currently active resource scope.
|
|
48
|
-
* Providing both `scope` and `onScopeChange` enables the ScopeToggle
|
|
49
|
-
* in the toolbar.
|
|
50
|
-
*/
|
|
51
|
-
readonly scope?: ResourceListScope;
|
|
52
|
-
/** Called when the user toggles the scope. Also resets the page to 1 via `onPageChange`. */
|
|
53
|
-
readonly onScopeChange?: (scope: ResourceListScope) => void;
|
|
54
|
-
/**
|
|
55
|
-
* Called when the user navigates to a different page.
|
|
56
|
-
* Pagination controls appear when this is provided and `totalPages > 1`.
|
|
57
|
-
* Also called with `1` automatically when the search query or scope changes.
|
|
58
|
-
*/
|
|
59
|
-
readonly onPageChange?: (page: number) => void;
|
|
60
|
-
/**
|
|
61
|
-
* Visual layout for items.
|
|
62
|
-
*
|
|
63
|
-
* - `"list"` (default) — vertical single-column rows
|
|
64
|
-
* - `"grid"` — responsive multi-column card grid
|
|
65
|
-
* (`grid-cols-1 sm:grid-cols-2 lg:grid-cols-3`)
|
|
66
|
-
*
|
|
67
|
-
* When `layout` is `"grid"` and no `renderItem` is provided, the built-in
|
|
68
|
-
* {@link DefaultResourceCard} is used instead of {@link DefaultResourceRow}.
|
|
69
|
-
*
|
|
70
|
-
* @default "list"
|
|
71
|
-
*/
|
|
72
|
-
readonly layout?: ResourceListLayout;
|
|
73
|
-
/**
|
|
74
|
-
* Custom renderer for list items. Receives the `SearchResult` and its
|
|
75
|
-
* index. Falls back to a built-in row showing name, org, description,
|
|
76
|
-
* visibility badge, and tags.
|
|
77
|
-
*/
|
|
78
|
-
readonly renderItem?: (item: SearchResult, index: number) => React.ReactNode;
|
|
79
|
-
/**
|
|
80
|
-
* Renders an action element (e.g. a button) for each item.
|
|
81
|
-
*
|
|
82
|
-
* In grid mode the action is placed in the card's top-right corner.
|
|
83
|
-
* In list mode it is appended after the row content.
|
|
84
|
-
*
|
|
85
|
-
* The consumer is responsible for calling `e.stopPropagation()` if
|
|
86
|
-
* the action should not also trigger `onItemClick`.
|
|
87
|
-
*/
|
|
88
|
-
readonly renderItemAction?: (item: SearchResult) => React.ReactNode;
|
|
89
|
-
/**
|
|
90
|
-
* Called when a list item is clicked or activated via keyboard (Enter/Space).
|
|
91
|
-
* Providing this makes items interactive with hover/focus styles and
|
|
92
|
-
* keyboard navigation (Arrow Up/Down).
|
|
93
|
-
*/
|
|
94
|
-
readonly onItemClick?: (item: SearchResult) => void;
|
|
95
|
-
/** Icon element rendered in the empty state. */
|
|
96
|
-
readonly emptyIcon?: React.ReactNode;
|
|
97
|
-
/** Title for the empty state. @default "No resources found" */
|
|
98
|
-
readonly emptyTitle?: string;
|
|
99
|
-
/** Description for the empty state. @default "Try adjusting your search or scope." */
|
|
100
|
-
readonly emptyDescription?: string;
|
|
101
|
-
/** Called when the user clicks "Retry" after an error. */
|
|
102
|
-
readonly onRetry?: () => void;
|
|
103
|
-
/** Additional CSS classes for the root container. */
|
|
104
|
-
readonly className?: string;
|
|
105
|
-
/** Accessible label for the list region. @default "Resource list" */
|
|
106
|
-
readonly "aria-label"?: string;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Paginated, searchable view for browsing Stigmer resources.
|
|
111
|
-
*
|
|
112
|
-
* Supports two layout modes:
|
|
113
|
-
*
|
|
114
|
-
* - **`"list"`** (default) — vertical single-column rows, same as
|
|
115
|
-
* before. Each row shows a kind icon, name, org, description, and tags.
|
|
116
|
-
* - **`"grid"`** — responsive multi-column card grid
|
|
117
|
-
* (`grid-cols-1 sm:grid-cols-2 lg:grid-cols-3`). Each card shows a
|
|
118
|
-
* large icon container, name, org, description, and an optional
|
|
119
|
-
* action slot in the top-right corner.
|
|
120
|
-
*
|
|
121
|
-
* Both modes share the same toolbar (search, scope toggle), pagination,
|
|
122
|
-
* loading/error/empty states, and keyboard navigation (grid mode adds
|
|
123
|
-
* ArrowLeft/Right and column-aware Up/Down).
|
|
124
|
-
*
|
|
125
|
-
* The component is controlled — the parent owns data and filter state.
|
|
126
|
-
* Search debouncing (300ms) is managed internally so the parent only
|
|
127
|
-
* receives debounced query values via {@link ResourceListViewProps.onSearchChange}.
|
|
128
|
-
*
|
|
129
|
-
* Only `items` and `isLoading` are required. Search, scope toggle,
|
|
130
|
-
* pagination, layout mode, and custom row rendering activate
|
|
131
|
-
* progressively when their corresponding props are provided.
|
|
132
|
-
*
|
|
133
|
-
* When the debounced search query or scope changes, the component
|
|
134
|
-
* automatically resets the page to 1 via `onPageChange` to prevent
|
|
135
|
-
* stale pagination after filter changes.
|
|
136
|
-
*
|
|
137
|
-
* @example
|
|
138
|
-
* ```tsx
|
|
139
|
-
* // Minimal — plain list with loading indicator
|
|
140
|
-
* <ResourceListView items={agents} isLoading={isLoading} />
|
|
141
|
-
* ```
|
|
142
|
-
*
|
|
143
|
-
* @example
|
|
144
|
-
* ```tsx
|
|
145
|
-
* // Grid layout with action button
|
|
146
|
-
* <ResourceListView
|
|
147
|
-
* layout="grid"
|
|
148
|
-
* items={mcpServers}
|
|
149
|
-
* isLoading={isLoading}
|
|
150
|
-
* onItemClick={(item) => navigate(item.slug)}
|
|
151
|
-
* renderItemAction={(item) => (
|
|
152
|
-
* <button onClick={(e) => { e.stopPropagation(); connect(item); }}>
|
|
153
|
-
* <PlusIcon />
|
|
154
|
-
* </button>
|
|
155
|
-
* )}
|
|
156
|
-
* />
|
|
157
|
-
* ```
|
|
158
|
-
*
|
|
159
|
-
* @example
|
|
160
|
-
* ```tsx
|
|
161
|
-
* // Full — search, scope toggle, pagination, and click handling
|
|
162
|
-
* const [scope, setScope] = useState<ResourceListScope>("org");
|
|
163
|
-
* const [query, setQuery] = useState("");
|
|
164
|
-
* const [page, setPage] = useState(1);
|
|
165
|
-
* const { agents, totalCount, totalPages, isLoading, error, refetch } =
|
|
166
|
-
* useAgentList(org, { query, scope, page });
|
|
167
|
-
*
|
|
168
|
-
* <ResourceListView
|
|
169
|
-
* items={agents}
|
|
170
|
-
* isLoading={isLoading}
|
|
171
|
-
* error={error}
|
|
172
|
-
* totalCount={totalCount}
|
|
173
|
-
* totalPages={totalPages}
|
|
174
|
-
* currentPage={page}
|
|
175
|
-
* onSearchChange={setQuery}
|
|
176
|
-
* searchPlaceholder="Search agents\u2026"
|
|
177
|
-
* scope={scope}
|
|
178
|
-
* onScopeChange={setScope}
|
|
179
|
-
* onPageChange={setPage}
|
|
180
|
-
* onItemClick={(item) => console.log(item.slug)}
|
|
181
|
-
* onRetry={refetch}
|
|
182
|
-
* />
|
|
183
|
-
* ```
|
|
184
|
-
*
|
|
185
|
-
* @see {@link useAgentList}, {@link useSkillList}, {@link useMcpServerList}
|
|
186
|
-
* @see {@link ScopeToggle} for the scope toggle used in the toolbar
|
|
187
|
-
*/
|
|
188
|
-
export function ResourceListView({
|
|
189
|
-
items,
|
|
190
|
-
isLoading,
|
|
191
|
-
error,
|
|
192
|
-
totalCount,
|
|
193
|
-
totalPages = 1,
|
|
194
|
-
currentPage = 1,
|
|
195
|
-
onSearchChange,
|
|
196
|
-
searchPlaceholder = "Search\u2026",
|
|
197
|
-
initialSearch = "",
|
|
198
|
-
scope,
|
|
199
|
-
onScopeChange,
|
|
200
|
-
onPageChange,
|
|
201
|
-
layout = "list",
|
|
202
|
-
renderItem,
|
|
203
|
-
renderItemAction,
|
|
204
|
-
onItemClick,
|
|
205
|
-
emptyIcon,
|
|
206
|
-
emptyTitle = "No resources found",
|
|
207
|
-
emptyDescription = "Try adjusting your search or scope.",
|
|
208
|
-
onRetry,
|
|
209
|
-
className,
|
|
210
|
-
"aria-label": ariaLabel = "Resource list",
|
|
211
|
-
}: ResourceListViewProps) {
|
|
212
|
-
const isGrid = layout === "grid";
|
|
213
|
-
const showToolbar =
|
|
214
|
-
!!onSearchChange || (scope !== undefined && !!onScopeChange);
|
|
215
|
-
const showPagination = !!onPageChange && totalPages > 1;
|
|
216
|
-
const isInteractive = !!onItemClick;
|
|
217
|
-
|
|
218
|
-
// --- Search debounce ------------------------------------------------
|
|
219
|
-
// The raw input value lives here; the parent only sees debounced values.
|
|
220
|
-
const [inputValue, setInputValue] = useState(initialSearch);
|
|
221
|
-
const isFirstRender = useRef(true);
|
|
222
|
-
|
|
223
|
-
// Stable callback refs so the debounce timer is not reset when
|
|
224
|
-
// the parent passes new callback identities on re-render.
|
|
225
|
-
const onSearchChangeRef = useRef(onSearchChange);
|
|
226
|
-
onSearchChangeRef.current = onSearchChange;
|
|
227
|
-
const onPageChangeRef = useRef(onPageChange);
|
|
228
|
-
onPageChangeRef.current = onPageChange;
|
|
229
|
-
|
|
230
|
-
useEffect(() => {
|
|
231
|
-
if (isFirstRender.current) {
|
|
232
|
-
isFirstRender.current = false;
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
if (!onSearchChangeRef.current) return;
|
|
236
|
-
|
|
237
|
-
const timer = setTimeout(() => {
|
|
238
|
-
onSearchChangeRef.current?.(inputValue);
|
|
239
|
-
onPageChangeRef.current?.(1);
|
|
240
|
-
}, DEBOUNCE_MS);
|
|
241
|
-
|
|
242
|
-
return () => clearTimeout(timer);
|
|
243
|
-
}, [inputValue]);
|
|
244
|
-
|
|
245
|
-
// --- Scope change resets page ---------------------------------------
|
|
246
|
-
const handleScopeChange = useCallback(
|
|
247
|
-
(newScope: ResourceListScope) => {
|
|
248
|
-
onScopeChange?.(newScope);
|
|
249
|
-
onPageChange?.(1);
|
|
250
|
-
},
|
|
251
|
-
[onScopeChange, onPageChange],
|
|
252
|
-
);
|
|
253
|
-
|
|
254
|
-
// --- Keyboard navigation for interactive items ----------------------
|
|
255
|
-
// Implements roving tabindex: only the focused item has tabIndex 0,
|
|
256
|
-
// all others have -1. Arrow keys move focus between items.
|
|
257
|
-
// In list mode: Up/Down. In grid mode: all four arrow keys with
|
|
258
|
-
// column-aware wrapping.
|
|
259
|
-
const itemRefs = useRef<(HTMLDivElement | null)[]>([]);
|
|
260
|
-
const gridColumnsRef = useRef(1);
|
|
261
|
-
|
|
262
|
-
const moveFocus = useCallback(
|
|
263
|
-
(from: HTMLDivElement, toIndex: number) => {
|
|
264
|
-
const clamped = Math.max(0, Math.min(toIndex, items.length - 1));
|
|
265
|
-
const el = itemRefs.current[clamped];
|
|
266
|
-
if (el && el !== from) {
|
|
267
|
-
from.tabIndex = -1;
|
|
268
|
-
el.tabIndex = 0;
|
|
269
|
-
el.focus();
|
|
270
|
-
}
|
|
271
|
-
},
|
|
272
|
-
[items.length],
|
|
273
|
-
);
|
|
274
|
-
|
|
275
|
-
const detectGridColumns = useCallback(() => {
|
|
276
|
-
if (!isGrid) return 1;
|
|
277
|
-
const first = itemRefs.current[0];
|
|
278
|
-
const second = itemRefs.current[1];
|
|
279
|
-
if (!first || !second) return 1;
|
|
280
|
-
const firstRect = first.getBoundingClientRect();
|
|
281
|
-
const secondRect = second.getBoundingClientRect();
|
|
282
|
-
if (Math.abs(firstRect.top - secondRect.top) < 4) {
|
|
283
|
-
let cols = 1;
|
|
284
|
-
for (let i = 1; i < itemRefs.current.length; i++) {
|
|
285
|
-
const r = itemRefs.current[i]?.getBoundingClientRect();
|
|
286
|
-
if (r && Math.abs(r.top - firstRect.top) < 4) {
|
|
287
|
-
cols++;
|
|
288
|
-
} else {
|
|
289
|
-
break;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
return cols;
|
|
293
|
-
}
|
|
294
|
-
return 1;
|
|
295
|
-
}, [isGrid]);
|
|
296
|
-
|
|
297
|
-
const handleItemKeyDown = useCallback(
|
|
298
|
-
(
|
|
299
|
-
e: React.KeyboardEvent<HTMLDivElement>,
|
|
300
|
-
index: number,
|
|
301
|
-
item: SearchResult,
|
|
302
|
-
) => {
|
|
303
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
304
|
-
e.preventDefault();
|
|
305
|
-
onItemClick?.(item);
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
const cols = isGrid ? detectGridColumns() : 1;
|
|
310
|
-
gridColumnsRef.current = cols;
|
|
311
|
-
let target = index;
|
|
312
|
-
|
|
313
|
-
switch (e.key) {
|
|
314
|
-
case "ArrowDown":
|
|
315
|
-
e.preventDefault();
|
|
316
|
-
target = isGrid ? Math.min(index + cols, items.length - 1) : Math.min(index + 1, items.length - 1);
|
|
317
|
-
break;
|
|
318
|
-
case "ArrowUp":
|
|
319
|
-
e.preventDefault();
|
|
320
|
-
target = isGrid ? Math.max(index - cols, 0) : Math.max(index - 1, 0);
|
|
321
|
-
break;
|
|
322
|
-
case "ArrowRight":
|
|
323
|
-
if (isGrid) {
|
|
324
|
-
e.preventDefault();
|
|
325
|
-
target = Math.min(index + 1, items.length - 1);
|
|
326
|
-
}
|
|
327
|
-
break;
|
|
328
|
-
case "ArrowLeft":
|
|
329
|
-
if (isGrid) {
|
|
330
|
-
e.preventDefault();
|
|
331
|
-
target = Math.max(index - 1, 0);
|
|
332
|
-
}
|
|
333
|
-
break;
|
|
334
|
-
default:
|
|
335
|
-
return;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
if (target !== index) moveFocus(e.currentTarget, target);
|
|
339
|
-
},
|
|
340
|
-
[onItemClick, items.length, isGrid, detectGridColumns, moveFocus],
|
|
341
|
-
);
|
|
342
|
-
|
|
343
|
-
// --- Content resolution ---------------------------------------------
|
|
344
|
-
const showSkeletons = isLoading && items.length === 0;
|
|
345
|
-
const showError = !!error && !isLoading;
|
|
346
|
-
const showEmpty = !isLoading && !error && items.length === 0;
|
|
347
|
-
const showItems = items.length > 0;
|
|
348
|
-
|
|
349
|
-
return (
|
|
350
|
-
<div className={cn("flex flex-col gap-3", className)}>
|
|
351
|
-
{showToolbar && (
|
|
352
|
-
<div role="search" className="flex items-center gap-2">
|
|
353
|
-
{onSearchChange && (
|
|
354
|
-
<div className="relative flex-1">
|
|
355
|
-
<SearchIcon className="pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground-subtle" />
|
|
356
|
-
<input
|
|
357
|
-
type="text"
|
|
358
|
-
value={inputValue}
|
|
359
|
-
onChange={(e) => setInputValue(e.target.value)}
|
|
360
|
-
placeholder={searchPlaceholder}
|
|
361
|
-
aria-label={searchPlaceholder}
|
|
362
|
-
className={cn(
|
|
363
|
-
"w-full rounded-md border border-input bg-background py-1.5 pl-8 pr-3 text-sm",
|
|
364
|
-
"placeholder:text-muted-foreground-subtle",
|
|
365
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
366
|
-
)}
|
|
367
|
-
/>
|
|
368
|
-
</div>
|
|
369
|
-
)}
|
|
370
|
-
{scope !== undefined && onScopeChange && (
|
|
371
|
-
<ScopeToggle value={scope} onChange={handleScopeChange} />
|
|
372
|
-
)}
|
|
373
|
-
</div>
|
|
374
|
-
)}
|
|
375
|
-
|
|
376
|
-
{showSkeletons && (isGrid ? <SkeletonCards /> : <SkeletonRows />)}
|
|
377
|
-
|
|
378
|
-
{showError && <ErrorState message={error!.message} onRetry={onRetry} />}
|
|
379
|
-
|
|
380
|
-
{showEmpty && (
|
|
381
|
-
<EmptyState
|
|
382
|
-
icon={emptyIcon}
|
|
383
|
-
title={emptyTitle}
|
|
384
|
-
description={emptyDescription}
|
|
385
|
-
/>
|
|
386
|
-
)}
|
|
387
|
-
|
|
388
|
-
{showItems && (
|
|
389
|
-
<div
|
|
390
|
-
role="list"
|
|
391
|
-
aria-label={ariaLabel}
|
|
392
|
-
aria-busy={isLoading || undefined}
|
|
393
|
-
className={cn(
|
|
394
|
-
isGrid
|
|
395
|
-
? "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3"
|
|
396
|
-
: "flex flex-col",
|
|
397
|
-
isLoading &&
|
|
398
|
-
"pointer-events-none opacity-60 transition-opacity",
|
|
399
|
-
)}
|
|
400
|
-
>
|
|
401
|
-
{items.map((item, index) => {
|
|
402
|
-
const content = renderItem
|
|
403
|
-
? renderItem(item, index)
|
|
404
|
-
: isGrid
|
|
405
|
-
? <DefaultResourceCard item={item} action={renderItemAction?.(item)} />
|
|
406
|
-
: <DefaultResourceRow item={item} action={renderItemAction?.(item)} />;
|
|
407
|
-
|
|
408
|
-
return (
|
|
409
|
-
<div key={item.id || `resource-${index}`} role="listitem">
|
|
410
|
-
{isInteractive ? (
|
|
411
|
-
<div
|
|
412
|
-
ref={(el) => {
|
|
413
|
-
itemRefs.current[index] = el;
|
|
414
|
-
}}
|
|
415
|
-
role="button"
|
|
416
|
-
tabIndex={index === 0 ? 0 : -1}
|
|
417
|
-
onClick={() => onItemClick!(item)}
|
|
418
|
-
onKeyDown={(e) => handleItemKeyDown(e, index, item)}
|
|
419
|
-
className={cn(
|
|
420
|
-
"group transition-colors",
|
|
421
|
-
isGrid
|
|
422
|
-
? [
|
|
423
|
-
"flex h-full rounded-lg border border-border bg-card p-4",
|
|
424
|
-
"cursor-pointer hover:border-primary/40 hover:bg-accent-hover",
|
|
425
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
426
|
-
]
|
|
427
|
-
: [
|
|
428
|
-
"rounded-lg px-3 py-2.5",
|
|
429
|
-
"cursor-pointer hover:bg-accent-hover",
|
|
430
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
|
|
431
|
-
],
|
|
432
|
-
)}
|
|
433
|
-
>
|
|
434
|
-
{content}
|
|
435
|
-
</div>
|
|
436
|
-
) : (
|
|
437
|
-
<div
|
|
438
|
-
className={cn(
|
|
439
|
-
isGrid
|
|
440
|
-
? "flex h-full rounded-lg border border-border bg-card p-4"
|
|
441
|
-
: "px-3 py-2.5",
|
|
442
|
-
)}
|
|
443
|
-
>
|
|
444
|
-
{content}
|
|
445
|
-
</div>
|
|
446
|
-
)}
|
|
447
|
-
</div>
|
|
448
|
-
);
|
|
449
|
-
})}
|
|
450
|
-
</div>
|
|
451
|
-
)}
|
|
452
|
-
|
|
453
|
-
{showPagination && (
|
|
454
|
-
<PaginationBar
|
|
455
|
-
currentPage={currentPage}
|
|
456
|
-
totalPages={totalPages}
|
|
457
|
-
totalCount={totalCount}
|
|
458
|
-
onPageChange={onPageChange!}
|
|
459
|
-
/>
|
|
460
|
-
)}
|
|
461
|
-
</div>
|
|
462
|
-
);
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
// ---------------------------------------------------------------------------
|
|
466
|
-
// Internal components
|
|
467
|
-
// ---------------------------------------------------------------------------
|
|
468
|
-
|
|
469
|
-
function DefaultResourceRow({
|
|
470
|
-
item,
|
|
471
|
-
action,
|
|
472
|
-
}: {
|
|
473
|
-
readonly item: SearchResult;
|
|
474
|
-
readonly action?: React.ReactNode;
|
|
475
|
-
}) {
|
|
476
|
-
const displayName = item.name || item.slug;
|
|
477
|
-
|
|
478
|
-
return (
|
|
479
|
-
<div className="flex items-start gap-3">
|
|
480
|
-
<RowIcon kind={item.kind} iconUrl={item.iconUrl} />
|
|
481
|
-
<div className="min-w-0 flex-1">
|
|
482
|
-
<div className="flex items-center gap-2">
|
|
483
|
-
<span className="truncate text-sm font-medium text-foreground">
|
|
484
|
-
{displayName}
|
|
485
|
-
</span>
|
|
486
|
-
{item.visibility === ApiResourceVisibility.visibility_public && (
|
|
487
|
-
<VisibilityBadge />
|
|
488
|
-
)}
|
|
489
|
-
</div>
|
|
490
|
-
<div className="mt-0.5 flex items-start gap-1.5 text-xs text-muted-foreground">
|
|
491
|
-
<span className="shrink-0">{item.org}</span>
|
|
492
|
-
{item.description && (
|
|
493
|
-
<>
|
|
494
|
-
<span className="shrink-0" aria-hidden="true">
|
|
495
|
-
{"\u00B7"}
|
|
496
|
-
</span>
|
|
497
|
-
<span className="line-clamp-2 group-hover:line-clamp-none">
|
|
498
|
-
{item.description}
|
|
499
|
-
</span>
|
|
500
|
-
</>
|
|
501
|
-
)}
|
|
502
|
-
</div>
|
|
503
|
-
{item.tags.length > 0 && (
|
|
504
|
-
<div className="mt-1.5 flex flex-wrap gap-1">
|
|
505
|
-
{item.tags.slice(0, MAX_VISIBLE_TAGS).map((tag) => (
|
|
506
|
-
<span
|
|
507
|
-
key={tag}
|
|
508
|
-
className="rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground"
|
|
509
|
-
>
|
|
510
|
-
{tag}
|
|
511
|
-
</span>
|
|
512
|
-
))}
|
|
513
|
-
{item.tags.length > MAX_VISIBLE_TAGS && (
|
|
514
|
-
<span className="text-[10px] text-muted-foreground-subtle">
|
|
515
|
-
+{item.tags.length - MAX_VISIBLE_TAGS} more
|
|
516
|
-
</span>
|
|
517
|
-
)}
|
|
518
|
-
</div>
|
|
519
|
-
)}
|
|
520
|
-
</div>
|
|
521
|
-
{action && <div className="ml-auto shrink-0">{action}</div>}
|
|
522
|
-
</div>
|
|
523
|
-
);
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
function DefaultResourceCard({
|
|
527
|
-
item,
|
|
528
|
-
action,
|
|
529
|
-
}: {
|
|
530
|
-
readonly item: SearchResult;
|
|
531
|
-
readonly action?: React.ReactNode;
|
|
532
|
-
}) {
|
|
533
|
-
const displayName = item.name || item.slug;
|
|
534
|
-
|
|
535
|
-
return (
|
|
536
|
-
<div className="flex min-w-0 flex-1 flex-col gap-3">
|
|
537
|
-
<div className="flex items-start gap-3">
|
|
538
|
-
<ResourceIcon kind={item.kind} iconUrl={item.iconUrl} />
|
|
539
|
-
<div className="min-w-0 flex-1">
|
|
540
|
-
<span className="line-clamp-2 text-sm font-semibold leading-snug text-foreground">
|
|
541
|
-
{displayName}
|
|
542
|
-
</span>
|
|
543
|
-
<span className="mt-0.5 block text-xs text-muted-foreground">
|
|
544
|
-
{item.org}
|
|
545
|
-
</span>
|
|
546
|
-
</div>
|
|
547
|
-
{action && <div className="shrink-0">{action}</div>}
|
|
548
|
-
</div>
|
|
549
|
-
{item.description && (
|
|
550
|
-
<p className="line-clamp-2 text-xs leading-relaxed text-muted-foreground">
|
|
551
|
-
{item.description}
|
|
552
|
-
</p>
|
|
553
|
-
)}
|
|
554
|
-
{item.visibility === ApiResourceVisibility.visibility_public && (
|
|
555
|
-
<div className="mt-auto">
|
|
556
|
-
<VisibilityBadge />
|
|
557
|
-
</div>
|
|
558
|
-
)}
|
|
559
|
-
</div>
|
|
560
|
-
);
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
function ResourceIcon({
|
|
564
|
-
kind,
|
|
565
|
-
iconUrl,
|
|
566
|
-
}: {
|
|
567
|
-
readonly kind: ApiResourceKind;
|
|
568
|
-
readonly iconUrl?: string;
|
|
569
|
-
}) {
|
|
570
|
-
const [imgError, setImgError] = useState(false);
|
|
571
|
-
|
|
572
|
-
return (
|
|
573
|
-
<span className="flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted">
|
|
574
|
-
{iconUrl && !imgError ? (
|
|
575
|
-
<img
|
|
576
|
-
src={iconUrl}
|
|
577
|
-
alt=""
|
|
578
|
-
className="size-6 rounded object-contain"
|
|
579
|
-
onError={() => setImgError(true)}
|
|
580
|
-
/>
|
|
581
|
-
) : (
|
|
582
|
-
<KindIcon kind={kind} size="lg" />
|
|
583
|
-
)}
|
|
584
|
-
</span>
|
|
585
|
-
);
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
function RowIcon({
|
|
589
|
-
kind,
|
|
590
|
-
iconUrl,
|
|
591
|
-
}: {
|
|
592
|
-
readonly kind: ApiResourceKind;
|
|
593
|
-
readonly iconUrl?: string;
|
|
594
|
-
}) {
|
|
595
|
-
const [imgError, setImgError] = useState(false);
|
|
596
|
-
|
|
597
|
-
if (iconUrl && !imgError) {
|
|
598
|
-
return (
|
|
599
|
-
<img
|
|
600
|
-
src={iconUrl}
|
|
601
|
-
alt=""
|
|
602
|
-
className="mt-0.5 h-4 w-4 shrink-0 rounded-sm object-contain"
|
|
603
|
-
onError={() => setImgError(true)}
|
|
604
|
-
/>
|
|
605
|
-
);
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
return <KindIcon kind={kind} />;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
function VisibilityBadge() {
|
|
612
|
-
return (
|
|
613
|
-
<span className="shrink-0 rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground">
|
|
614
|
-
Public
|
|
615
|
-
</span>
|
|
616
|
-
);
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
function KindIcon({
|
|
620
|
-
kind,
|
|
621
|
-
size = "sm",
|
|
622
|
-
}: {
|
|
623
|
-
readonly kind: ApiResourceKind;
|
|
624
|
-
readonly size?: "sm" | "lg";
|
|
625
|
-
}) {
|
|
626
|
-
const cls = size === "lg"
|
|
627
|
-
? "h-5 w-5 shrink-0 text-muted-foreground"
|
|
628
|
-
: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground";
|
|
629
|
-
|
|
630
|
-
switch (kind) {
|
|
631
|
-
case ApiResourceKind.agent:
|
|
632
|
-
return <AgentIcon className={cls} />;
|
|
633
|
-
case ApiResourceKind.skill:
|
|
634
|
-
return <SkillIcon className={cls} />;
|
|
635
|
-
case ApiResourceKind.mcp_server:
|
|
636
|
-
return <McpServerIcon className={cls} />;
|
|
637
|
-
case ApiResourceKind.workflow:
|
|
638
|
-
return <WorkflowIcon className={cls} />;
|
|
639
|
-
default:
|
|
640
|
-
return <DocumentIcon className={cls} />;
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
function SkeletonRows() {
|
|
645
|
-
const widths = [36, 45, 30, 52, 40];
|
|
646
|
-
|
|
647
|
-
return (
|
|
648
|
-
<div aria-busy="true">
|
|
649
|
-
{Array.from({ length: SKELETON_COUNT }, (_, i) => (
|
|
650
|
-
<div
|
|
651
|
-
key={i}
|
|
652
|
-
className="flex items-start gap-3 px-3 py-2.5"
|
|
653
|
-
aria-hidden="true"
|
|
654
|
-
>
|
|
655
|
-
<div className="mt-0.5 h-4 w-4 shrink-0 animate-pulse rounded bg-muted" />
|
|
656
|
-
<div className="flex-1 space-y-2">
|
|
657
|
-
<div
|
|
658
|
-
className="h-4 animate-pulse rounded bg-muted"
|
|
659
|
-
style={{ width: `${widths[i]}%` }}
|
|
660
|
-
/>
|
|
661
|
-
<div
|
|
662
|
-
className="h-3 animate-pulse rounded bg-muted"
|
|
663
|
-
style={{ width: `${widths[i] + 25}%` }}
|
|
664
|
-
/>
|
|
665
|
-
</div>
|
|
666
|
-
</div>
|
|
667
|
-
))}
|
|
668
|
-
</div>
|
|
669
|
-
);
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
function SkeletonCards() {
|
|
673
|
-
return (
|
|
674
|
-
<div
|
|
675
|
-
className="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3"
|
|
676
|
-
aria-busy="true"
|
|
677
|
-
>
|
|
678
|
-
{Array.from({ length: GRID_SKELETON_COUNT }, (_, i) => (
|
|
679
|
-
<div
|
|
680
|
-
key={i}
|
|
681
|
-
className="flex flex-col gap-3 rounded-lg border border-border bg-card p-4"
|
|
682
|
-
aria-hidden="true"
|
|
683
|
-
>
|
|
684
|
-
<div className="flex items-start gap-3">
|
|
685
|
-
<div className="size-10 shrink-0 animate-pulse rounded-lg bg-muted" />
|
|
686
|
-
<div className="flex-1 space-y-2">
|
|
687
|
-
<div className="h-4 w-3/5 animate-pulse rounded bg-muted" />
|
|
688
|
-
<div className="h-3 w-2/5 animate-pulse rounded bg-muted" />
|
|
689
|
-
</div>
|
|
690
|
-
</div>
|
|
691
|
-
<div className="space-y-1.5">
|
|
692
|
-
<div className="h-3 w-full animate-pulse rounded bg-muted" />
|
|
693
|
-
<div className="h-3 w-4/5 animate-pulse rounded bg-muted" />
|
|
694
|
-
</div>
|
|
695
|
-
</div>
|
|
696
|
-
))}
|
|
697
|
-
</div>
|
|
698
|
-
);
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
function EmptyState({
|
|
702
|
-
icon,
|
|
703
|
-
title,
|
|
704
|
-
description,
|
|
705
|
-
}: {
|
|
706
|
-
readonly icon?: React.ReactNode;
|
|
707
|
-
readonly title: string;
|
|
708
|
-
readonly description: string;
|
|
709
|
-
}) {
|
|
710
|
-
return (
|
|
711
|
-
<div
|
|
712
|
-
role="status"
|
|
713
|
-
className="flex flex-col items-center gap-2 py-8 text-center"
|
|
714
|
-
>
|
|
715
|
-
{icon && <div className="text-muted-foreground-faint">{icon}</div>}
|
|
716
|
-
<p className="text-sm font-medium text-muted-foreground">{title}</p>
|
|
717
|
-
<p className="text-xs text-muted-foreground-subtle">{description}</p>
|
|
718
|
-
</div>
|
|
719
|
-
);
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
function ErrorState({
|
|
723
|
-
message,
|
|
724
|
-
onRetry,
|
|
725
|
-
}: {
|
|
726
|
-
readonly message: string;
|
|
727
|
-
readonly onRetry?: () => void;
|
|
728
|
-
}) {
|
|
729
|
-
return (
|
|
730
|
-
<div
|
|
731
|
-
role="alert"
|
|
732
|
-
className="flex flex-col items-center gap-2 py-8 text-center"
|
|
733
|
-
>
|
|
734
|
-
<p className="text-sm text-destructive">{message}</p>
|
|
735
|
-
{onRetry && (
|
|
736
|
-
<button
|
|
737
|
-
type="button"
|
|
738
|
-
onClick={onRetry}
|
|
739
|
-
className={cn(
|
|
740
|
-
"inline-flex items-center rounded-md px-3 py-1.5 text-xs font-medium",
|
|
741
|
-
"border border-input bg-background text-foreground",
|
|
742
|
-
"hover:bg-accent hover:text-accent-foreground",
|
|
743
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
744
|
-
)}
|
|
745
|
-
>
|
|
746
|
-
Retry
|
|
747
|
-
</button>
|
|
748
|
-
)}
|
|
749
|
-
</div>
|
|
750
|
-
);
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
function PaginationBar({
|
|
754
|
-
currentPage,
|
|
755
|
-
totalPages,
|
|
756
|
-
totalCount,
|
|
757
|
-
onPageChange,
|
|
758
|
-
}: {
|
|
759
|
-
readonly currentPage: number;
|
|
760
|
-
readonly totalPages: number;
|
|
761
|
-
readonly totalCount?: number;
|
|
762
|
-
readonly onPageChange: (page: number) => void;
|
|
763
|
-
}) {
|
|
764
|
-
const navButtonClass = cn(
|
|
765
|
-
"inline-flex items-center rounded-md p-1.5",
|
|
766
|
-
"border border-input bg-background text-foreground",
|
|
767
|
-
"hover:bg-accent hover:text-accent-foreground",
|
|
768
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
769
|
-
"disabled:pointer-events-none disabled:opacity-50",
|
|
770
|
-
);
|
|
771
|
-
|
|
772
|
-
return (
|
|
773
|
-
<nav
|
|
774
|
-
aria-label="Pagination"
|
|
775
|
-
className="flex items-center justify-between border-t border-border pt-3"
|
|
776
|
-
>
|
|
777
|
-
<span className="text-xs text-muted-foreground">
|
|
778
|
-
{totalCount !== undefined &&
|
|
779
|
-
`${totalCount.toLocaleString()} ${totalCount === 1 ? "result" : "results"}`}
|
|
780
|
-
</span>
|
|
781
|
-
<div className="flex items-center gap-2">
|
|
782
|
-
<button
|
|
783
|
-
type="button"
|
|
784
|
-
onClick={() => onPageChange(currentPage - 1)}
|
|
785
|
-
disabled={currentPage <= 1}
|
|
786
|
-
aria-label="Previous page"
|
|
787
|
-
className={navButtonClass}
|
|
788
|
-
>
|
|
789
|
-
<ChevronLeftIcon className="h-3.5 w-3.5" />
|
|
790
|
-
</button>
|
|
791
|
-
<span className="text-xs text-muted-foreground">
|
|
792
|
-
Page {currentPage} of {totalPages}
|
|
793
|
-
</span>
|
|
794
|
-
<button
|
|
795
|
-
type="button"
|
|
796
|
-
onClick={() => onPageChange(currentPage + 1)}
|
|
797
|
-
disabled={currentPage >= totalPages}
|
|
798
|
-
aria-label="Next page"
|
|
799
|
-
className={navButtonClass}
|
|
800
|
-
>
|
|
801
|
-
<ChevronRightIcon className="h-3.5 w-3.5" />
|
|
802
|
-
</button>
|
|
803
|
-
</div>
|
|
804
|
-
</nav>
|
|
805
|
-
);
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
// ---------------------------------------------------------------------------
|
|
809
|
-
// Icons — inline SVGs following the existing SDK pattern
|
|
810
|
-
// ---------------------------------------------------------------------------
|
|
811
|
-
|
|
812
|
-
function SearchIcon({ className }: { readonly className?: string }) {
|
|
813
|
-
return (
|
|
814
|
-
<svg
|
|
815
|
-
className={className}
|
|
816
|
-
viewBox="0 0 16 16"
|
|
817
|
-
fill="none"
|
|
818
|
-
stroke="currentColor"
|
|
819
|
-
strokeWidth="1.5"
|
|
820
|
-
strokeLinecap="round"
|
|
821
|
-
strokeLinejoin="round"
|
|
822
|
-
aria-hidden="true"
|
|
823
|
-
>
|
|
824
|
-
<circle cx="6.5" cy="6.5" r="4.5" />
|
|
825
|
-
<path d="m10 10 4 4" />
|
|
826
|
-
</svg>
|
|
827
|
-
);
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
function ChevronLeftIcon({ className }: { readonly className?: string }) {
|
|
831
|
-
return (
|
|
832
|
-
<svg
|
|
833
|
-
className={className}
|
|
834
|
-
viewBox="0 0 16 16"
|
|
835
|
-
fill="none"
|
|
836
|
-
stroke="currentColor"
|
|
837
|
-
strokeWidth="1.5"
|
|
838
|
-
strokeLinecap="round"
|
|
839
|
-
strokeLinejoin="round"
|
|
840
|
-
aria-hidden="true"
|
|
841
|
-
>
|
|
842
|
-
<path d="m10 3-5 5 5 5" />
|
|
843
|
-
</svg>
|
|
844
|
-
);
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
function ChevronRightIcon({ className }: { readonly className?: string }) {
|
|
848
|
-
return (
|
|
849
|
-
<svg
|
|
850
|
-
className={className}
|
|
851
|
-
viewBox="0 0 16 16"
|
|
852
|
-
fill="none"
|
|
853
|
-
stroke="currentColor"
|
|
854
|
-
strokeWidth="1.5"
|
|
855
|
-
strokeLinecap="round"
|
|
856
|
-
strokeLinejoin="round"
|
|
857
|
-
aria-hidden="true"
|
|
858
|
-
>
|
|
859
|
-
<path d="m6 3 5 5-5 5" />
|
|
860
|
-
</svg>
|
|
861
|
-
);
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
function AgentIcon({ className }: { readonly className?: string }) {
|
|
865
|
-
return (
|
|
866
|
-
<svg
|
|
867
|
-
className={className}
|
|
868
|
-
viewBox="0 0 16 16"
|
|
869
|
-
fill="none"
|
|
870
|
-
stroke="currentColor"
|
|
871
|
-
strokeWidth="1.5"
|
|
872
|
-
strokeLinecap="round"
|
|
873
|
-
strokeLinejoin="round"
|
|
874
|
-
aria-hidden="true"
|
|
875
|
-
>
|
|
876
|
-
<rect x="3" y="5" width="10" height="8" rx="1.5" />
|
|
877
|
-
<path d="M6 9h.01M10 9h.01" strokeWidth="2" />
|
|
878
|
-
<path d="M8 2v3" />
|
|
879
|
-
</svg>
|
|
880
|
-
);
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
function SkillIcon({ className }: { readonly className?: string }) {
|
|
884
|
-
return (
|
|
885
|
-
<svg
|
|
886
|
-
className={className}
|
|
887
|
-
viewBox="0 0 16 16"
|
|
888
|
-
fill="none"
|
|
889
|
-
stroke="currentColor"
|
|
890
|
-
strokeWidth="1.5"
|
|
891
|
-
strokeLinecap="round"
|
|
892
|
-
strokeLinejoin="round"
|
|
893
|
-
aria-hidden="true"
|
|
894
|
-
>
|
|
895
|
-
<path d="M9 1.5 4 9h4l-1 5.5L12 7H8l1-5.5Z" />
|
|
896
|
-
</svg>
|
|
897
|
-
);
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
function McpServerIcon({ className }: { readonly className?: string }) {
|
|
901
|
-
return (
|
|
902
|
-
<svg
|
|
903
|
-
className={className}
|
|
904
|
-
viewBox="0 0 16 16"
|
|
905
|
-
fill="none"
|
|
906
|
-
stroke="currentColor"
|
|
907
|
-
strokeWidth="1.5"
|
|
908
|
-
strokeLinecap="round"
|
|
909
|
-
strokeLinejoin="round"
|
|
910
|
-
aria-hidden="true"
|
|
911
|
-
>
|
|
912
|
-
<rect x="2" y="2" width="12" height="5" rx="1" />
|
|
913
|
-
<rect x="2" y="9" width="12" height="5" rx="1" />
|
|
914
|
-
<circle cx="5" cy="4.5" r="0.75" fill="currentColor" stroke="none" />
|
|
915
|
-
<circle cx="5" cy="11.5" r="0.75" fill="currentColor" stroke="none" />
|
|
916
|
-
</svg>
|
|
917
|
-
);
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
function WorkflowIcon({ className }: { readonly className?: string }) {
|
|
921
|
-
return (
|
|
922
|
-
<svg
|
|
923
|
-
className={className}
|
|
924
|
-
viewBox="0 0 16 16"
|
|
925
|
-
fill="none"
|
|
926
|
-
stroke="currentColor"
|
|
927
|
-
strokeWidth="1.5"
|
|
928
|
-
strokeLinecap="round"
|
|
929
|
-
strokeLinejoin="round"
|
|
930
|
-
aria-hidden="true"
|
|
931
|
-
>
|
|
932
|
-
<circle cx="4" cy="4" r="2" />
|
|
933
|
-
<circle cx="12" cy="4" r="2" />
|
|
934
|
-
<circle cx="8" cy="12" r="2" />
|
|
935
|
-
<path d="M4 6v2a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2V6" />
|
|
936
|
-
</svg>
|
|
937
|
-
);
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
function DocumentIcon({ className }: { readonly className?: string }) {
|
|
941
|
-
return (
|
|
942
|
-
<svg
|
|
943
|
-
className={className}
|
|
944
|
-
viewBox="0 0 16 16"
|
|
945
|
-
fill="none"
|
|
946
|
-
stroke="currentColor"
|
|
947
|
-
strokeWidth="1.5"
|
|
948
|
-
strokeLinecap="round"
|
|
949
|
-
strokeLinejoin="round"
|
|
950
|
-
aria-hidden="true"
|
|
951
|
-
>
|
|
952
|
-
<path d="M9 1.5H5c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V5Z" />
|
|
953
|
-
<path d="M9 1.5V5h3" />
|
|
954
|
-
</svg>
|
|
955
|
-
);
|
|
956
|
-
}
|