@stigmer/react 0.4.8 → 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/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/package.json +8 -4
- 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/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/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
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import type { BulkAction } from "../types";
|
|
6
|
+
|
|
7
|
+
/** Props for {@link BulkActionBar}. */
|
|
8
|
+
export interface BulkActionBarProps<TData> {
|
|
9
|
+
/** Number of selected items. */
|
|
10
|
+
readonly selectedCount: number;
|
|
11
|
+
/** The selected items to pass to action handlers. */
|
|
12
|
+
readonly selectedItems: readonly TData[];
|
|
13
|
+
/** Available bulk actions. */
|
|
14
|
+
readonly actions: readonly BulkAction<TData>[];
|
|
15
|
+
/** Called when the user clicks "Cancel" (deselect all). */
|
|
16
|
+
readonly onCancel: () => void;
|
|
17
|
+
/** Additional CSS classes for the bar. */
|
|
18
|
+
readonly className?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Floating action bar that appears when items are selected in the
|
|
23
|
+
* workbench. Shows selected count, available bulk actions, and a
|
|
24
|
+
* cancel button.
|
|
25
|
+
*
|
|
26
|
+
* Uses `aria-live="polite"` so screen readers announce the selection
|
|
27
|
+
* count when it changes.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* {selection.hasSelection && (
|
|
32
|
+
* <BulkActionBar
|
|
33
|
+
* selectedCount={selection.selectedCount}
|
|
34
|
+
* selectedItems={selection.selectedItems}
|
|
35
|
+
* actions={agentBulkActions}
|
|
36
|
+
* onCancel={selection.clearSelection}
|
|
37
|
+
* />
|
|
38
|
+
* )}
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export function BulkActionBar<TData>({
|
|
42
|
+
selectedCount,
|
|
43
|
+
selectedItems,
|
|
44
|
+
actions,
|
|
45
|
+
onCancel,
|
|
46
|
+
className,
|
|
47
|
+
}: BulkActionBarProps<TData>) {
|
|
48
|
+
if (selectedCount === 0) return null;
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div
|
|
52
|
+
role="toolbar"
|
|
53
|
+
aria-label="Bulk actions"
|
|
54
|
+
aria-live="polite"
|
|
55
|
+
className={cn(
|
|
56
|
+
"flex items-center gap-3 rounded-lg border border-border bg-card px-4 py-2 shadow-md",
|
|
57
|
+
className,
|
|
58
|
+
)}
|
|
59
|
+
>
|
|
60
|
+
<span className="text-xs font-medium text-foreground">
|
|
61
|
+
{selectedCount} {selectedCount === 1 ? "item" : "items"} selected
|
|
62
|
+
</span>
|
|
63
|
+
|
|
64
|
+
<span className="h-4 w-px bg-border" aria-hidden="true" />
|
|
65
|
+
|
|
66
|
+
<div className="flex items-center gap-1">
|
|
67
|
+
{actions.map((action) => (
|
|
68
|
+
<BulkActionButton
|
|
69
|
+
key={action.id}
|
|
70
|
+
action={action}
|
|
71
|
+
selectedItems={selectedItems}
|
|
72
|
+
/>
|
|
73
|
+
))}
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<button
|
|
77
|
+
type="button"
|
|
78
|
+
onClick={onCancel}
|
|
79
|
+
className={cn(
|
|
80
|
+
"ml-auto text-xs text-muted-foreground transition-colors",
|
|
81
|
+
"hover:text-foreground",
|
|
82
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:rounded-sm",
|
|
83
|
+
)}
|
|
84
|
+
>
|
|
85
|
+
Cancel
|
|
86
|
+
</button>
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function BulkActionButton<TData>({
|
|
92
|
+
action,
|
|
93
|
+
selectedItems,
|
|
94
|
+
}: {
|
|
95
|
+
readonly action: BulkAction<TData>;
|
|
96
|
+
readonly selectedItems: readonly TData[];
|
|
97
|
+
}) {
|
|
98
|
+
const isDestructive = action.variant === "destructive";
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<button
|
|
102
|
+
type="button"
|
|
103
|
+
disabled={action.disabled}
|
|
104
|
+
onClick={() => action.onAction(selectedItems)}
|
|
105
|
+
className={cn(
|
|
106
|
+
"inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",
|
|
107
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
108
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
109
|
+
isDestructive
|
|
110
|
+
? "text-destructive hover:bg-destructive-subtle"
|
|
111
|
+
: "text-foreground hover:bg-accent-hover",
|
|
112
|
+
)}
|
|
113
|
+
>
|
|
114
|
+
{action.icon && (
|
|
115
|
+
<span className="shrink-0" aria-hidden="true">
|
|
116
|
+
{action.icon}
|
|
117
|
+
</span>
|
|
118
|
+
)}
|
|
119
|
+
{action.label}
|
|
120
|
+
</button>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
import type { SortDirection } from "../types";
|
|
5
|
+
|
|
6
|
+
/** Props for {@link ColumnHeader}. */
|
|
7
|
+
export interface ColumnHeaderProps {
|
|
8
|
+
/** Column header label. */
|
|
9
|
+
readonly label: string;
|
|
10
|
+
/** Whether clicking this header toggles sort. */
|
|
11
|
+
readonly sortable: boolean;
|
|
12
|
+
/** Current sort direction for this column, or `null` if not sorted. */
|
|
13
|
+
readonly sortDirection: SortDirection | null;
|
|
14
|
+
/** Called when the user clicks a sortable header. */
|
|
15
|
+
readonly onSort?: () => void;
|
|
16
|
+
/** Additional CSS classes. */
|
|
17
|
+
readonly className?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Sortable table column header with accessible sort indicators.
|
|
22
|
+
*
|
|
23
|
+
* Uses `aria-sort` to communicate sort state to screen readers.
|
|
24
|
+
* The sort indicator uses both an icon and text direction so the
|
|
25
|
+
* sort state is never conveyed by icon alone.
|
|
26
|
+
*/
|
|
27
|
+
export function ColumnHeader({
|
|
28
|
+
label,
|
|
29
|
+
sortable,
|
|
30
|
+
sortDirection,
|
|
31
|
+
onSort,
|
|
32
|
+
className,
|
|
33
|
+
}: ColumnHeaderProps) {
|
|
34
|
+
const ariaSort = sortDirection === "asc"
|
|
35
|
+
? "ascending" as const
|
|
36
|
+
: sortDirection === "desc"
|
|
37
|
+
? "descending" as const
|
|
38
|
+
: undefined;
|
|
39
|
+
|
|
40
|
+
if (!sortable) {
|
|
41
|
+
return (
|
|
42
|
+
<th
|
|
43
|
+
scope="col"
|
|
44
|
+
className={cn(
|
|
45
|
+
"px-3 py-2 text-left text-xs font-medium text-muted-foreground",
|
|
46
|
+
className,
|
|
47
|
+
)}
|
|
48
|
+
>
|
|
49
|
+
{label}
|
|
50
|
+
</th>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<th
|
|
56
|
+
scope="col"
|
|
57
|
+
aria-sort={ariaSort}
|
|
58
|
+
className={cn(
|
|
59
|
+
"px-3 py-2 text-left text-xs font-medium text-muted-foreground",
|
|
60
|
+
className,
|
|
61
|
+
)}
|
|
62
|
+
>
|
|
63
|
+
<button
|
|
64
|
+
type="button"
|
|
65
|
+
onClick={onSort}
|
|
66
|
+
className={cn(
|
|
67
|
+
"inline-flex items-center gap-1 rounded-sm px-0.5 py-0.5 -mx-0.5",
|
|
68
|
+
"hover:text-foreground transition-colors",
|
|
69
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
70
|
+
sortDirection && "text-foreground",
|
|
71
|
+
)}
|
|
72
|
+
>
|
|
73
|
+
{label}
|
|
74
|
+
<SortIndicator direction={sortDirection} />
|
|
75
|
+
</button>
|
|
76
|
+
</th>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function SortIndicator({
|
|
81
|
+
direction,
|
|
82
|
+
}: {
|
|
83
|
+
readonly direction: SortDirection | null;
|
|
84
|
+
}) {
|
|
85
|
+
return (
|
|
86
|
+
<svg
|
|
87
|
+
width="12"
|
|
88
|
+
height="12"
|
|
89
|
+
viewBox="0 0 12 12"
|
|
90
|
+
fill="none"
|
|
91
|
+
stroke="currentColor"
|
|
92
|
+
strokeWidth="1.5"
|
|
93
|
+
strokeLinecap="round"
|
|
94
|
+
strokeLinejoin="round"
|
|
95
|
+
aria-hidden="true"
|
|
96
|
+
className={cn(
|
|
97
|
+
"shrink-0 transition-transform",
|
|
98
|
+
!direction && "opacity-0 group-hover:opacity-40",
|
|
99
|
+
direction === "desc" && "rotate-180",
|
|
100
|
+
)}
|
|
101
|
+
>
|
|
102
|
+
<path d="M6 2.5v7M3 6.5l3-4 3 4" />
|
|
103
|
+
</svg>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
import type { FilterValue, FilterDef } from "../types";
|
|
5
|
+
|
|
6
|
+
/** Props for {@link FilterBar}. */
|
|
7
|
+
export interface FilterBarProps {
|
|
8
|
+
/** Currently active filter values. */
|
|
9
|
+
readonly filters: readonly FilterValue[];
|
|
10
|
+
/** Available filter definitions (used to resolve labels). */
|
|
11
|
+
readonly filterDefs: readonly FilterDef[];
|
|
12
|
+
/** Called when a filter chip's "remove" button is clicked. */
|
|
13
|
+
readonly onRemoveFilter: (filterId: string) => void;
|
|
14
|
+
/** Called when the "Clear all" button is clicked. */
|
|
15
|
+
readonly onClearAll: () => void;
|
|
16
|
+
/** Additional CSS classes. */
|
|
17
|
+
readonly className?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Displays active filters as removable chips with a "Clear all" action.
|
|
22
|
+
*
|
|
23
|
+
* The filter bar is a lightweight presentation component — filter state
|
|
24
|
+
* and mutation logic live in {@link useResourceFilters}. The parent
|
|
25
|
+
* `ResourceWorkbench` wires them together.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <FilterBar
|
|
30
|
+
* filters={filtersHook.filters}
|
|
31
|
+
* filterDefs={agentFilterDefs}
|
|
32
|
+
* onRemoveFilter={filtersHook.removeFilter}
|
|
33
|
+
* onClearAll={filtersHook.clearFilters}
|
|
34
|
+
* />
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export function FilterBar({
|
|
38
|
+
filters,
|
|
39
|
+
filterDefs,
|
|
40
|
+
onRemoveFilter,
|
|
41
|
+
onClearAll,
|
|
42
|
+
className,
|
|
43
|
+
}: FilterBarProps) {
|
|
44
|
+
if (filters.length === 0) return null;
|
|
45
|
+
|
|
46
|
+
const defMap = new Map(filterDefs.map((d) => [d.id, d]));
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div
|
|
50
|
+
role="toolbar"
|
|
51
|
+
aria-label="Active filters"
|
|
52
|
+
className={cn("flex flex-wrap items-center gap-1.5", className)}
|
|
53
|
+
>
|
|
54
|
+
{filters.map((filter) => {
|
|
55
|
+
const def = defMap.get(filter.filterId);
|
|
56
|
+
const label = def?.label ?? filter.filterId;
|
|
57
|
+
const displayValue = formatFilterValue(filter, def);
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<FilterChip
|
|
61
|
+
key={`${filter.filterId}:${filter.operator}`}
|
|
62
|
+
label={label}
|
|
63
|
+
value={displayValue}
|
|
64
|
+
onRemove={() => onRemoveFilter(filter.filterId)}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
67
|
+
})}
|
|
68
|
+
|
|
69
|
+
{filters.length > 1 && (
|
|
70
|
+
<button
|
|
71
|
+
type="button"
|
|
72
|
+
onClick={onClearAll}
|
|
73
|
+
className={cn(
|
|
74
|
+
"text-xs text-muted-foreground transition-colors",
|
|
75
|
+
"hover:text-foreground",
|
|
76
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:rounded-sm",
|
|
77
|
+
)}
|
|
78
|
+
>
|
|
79
|
+
Clear all
|
|
80
|
+
</button>
|
|
81
|
+
)}
|
|
82
|
+
</div>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
// Internal: Filter chip
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
89
|
+
|
|
90
|
+
function FilterChip({
|
|
91
|
+
label,
|
|
92
|
+
value,
|
|
93
|
+
onRemove,
|
|
94
|
+
}: {
|
|
95
|
+
readonly label: string;
|
|
96
|
+
readonly value: string;
|
|
97
|
+
readonly onRemove: () => void;
|
|
98
|
+
}) {
|
|
99
|
+
return (
|
|
100
|
+
<span
|
|
101
|
+
className={cn(
|
|
102
|
+
"inline-flex items-center gap-1 rounded-md bg-muted px-2 py-0.5 text-xs text-muted-foreground",
|
|
103
|
+
)}
|
|
104
|
+
>
|
|
105
|
+
<span className="font-medium">{label}:</span>
|
|
106
|
+
<span>{value}</span>
|
|
107
|
+
<button
|
|
108
|
+
type="button"
|
|
109
|
+
onClick={onRemove}
|
|
110
|
+
aria-label={`Remove ${label} filter`}
|
|
111
|
+
className={cn(
|
|
112
|
+
"ml-0.5 inline-flex items-center justify-center rounded-sm p-0.5",
|
|
113
|
+
"text-muted-foreground-subtle hover:text-foreground hover:bg-accent-hover",
|
|
114
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
115
|
+
)}
|
|
116
|
+
>
|
|
117
|
+
<XIcon />
|
|
118
|
+
</button>
|
|
119
|
+
</span>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function formatFilterValue(
|
|
124
|
+
filter: FilterValue,
|
|
125
|
+
def: FilterDef | undefined,
|
|
126
|
+
): string {
|
|
127
|
+
const { value, operator } = filter;
|
|
128
|
+
if (Array.isArray(value)) {
|
|
129
|
+
// For multi-select, try to resolve option labels.
|
|
130
|
+
if (def?.options) {
|
|
131
|
+
const optMap = new Map(def.options.map((o) => [o.value, o.label]));
|
|
132
|
+
return value.map((v) => optMap.get(v) ?? v).join(", ");
|
|
133
|
+
}
|
|
134
|
+
return value.join(", ");
|
|
135
|
+
}
|
|
136
|
+
// For select with options, resolve the label.
|
|
137
|
+
if (def?.options) {
|
|
138
|
+
const opt = def.options.find((o) => o.value === value);
|
|
139
|
+
if (opt) return opt.label;
|
|
140
|
+
}
|
|
141
|
+
const prefix =
|
|
142
|
+
operator === "gt"
|
|
143
|
+
? "> "
|
|
144
|
+
: operator === "lt"
|
|
145
|
+
? "< "
|
|
146
|
+
: operator === "gte"
|
|
147
|
+
? ">= "
|
|
148
|
+
: operator === "lte"
|
|
149
|
+
? "<= "
|
|
150
|
+
: operator === "neq"
|
|
151
|
+
? "not "
|
|
152
|
+
: operator === "contains"
|
|
153
|
+
? "~ "
|
|
154
|
+
: "";
|
|
155
|
+
return `${prefix}${value}`;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function XIcon() {
|
|
159
|
+
return (
|
|
160
|
+
<svg
|
|
161
|
+
width="10"
|
|
162
|
+
height="10"
|
|
163
|
+
viewBox="0 0 10 10"
|
|
164
|
+
fill="none"
|
|
165
|
+
stroke="currentColor"
|
|
166
|
+
strokeWidth="1.5"
|
|
167
|
+
strokeLinecap="round"
|
|
168
|
+
aria-hidden="true"
|
|
169
|
+
>
|
|
170
|
+
<path d="M2.5 2.5l5 5M7.5 2.5l-5 5" />
|
|
171
|
+
</svg>
|
|
172
|
+
);
|
|
173
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
|
|
5
|
+
/** Props for {@link ResourceAvatar}. */
|
|
6
|
+
export interface ResourceAvatarProps {
|
|
7
|
+
/** Display name used for the initial fallback. */
|
|
8
|
+
readonly name: string;
|
|
9
|
+
/** Slug used to derive a deterministic background color. */
|
|
10
|
+
readonly slug: string;
|
|
11
|
+
/** Icon URL from the resource's spec. Empty string means no icon. */
|
|
12
|
+
readonly iconUrl?: string;
|
|
13
|
+
/**
|
|
14
|
+
* When `true`, renders nothing — no image, no initial avatar.
|
|
15
|
+
* Used for resource types like skills that don't support icons.
|
|
16
|
+
*/
|
|
17
|
+
readonly hidden?: boolean;
|
|
18
|
+
/** Size variant. @default "md" */
|
|
19
|
+
readonly size?: "sm" | "md";
|
|
20
|
+
/** Additional CSS classes. */
|
|
21
|
+
readonly className?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const AVATAR_COLORS = [
|
|
25
|
+
"bg-[#6366f1]",
|
|
26
|
+
"bg-[#8b5cf6]",
|
|
27
|
+
"bg-[#a855f7]",
|
|
28
|
+
"bg-[#d946ef]",
|
|
29
|
+
"bg-[#ec4899]",
|
|
30
|
+
"bg-[#f43f5e]",
|
|
31
|
+
"bg-[#ef4444]",
|
|
32
|
+
"bg-[#f97316]",
|
|
33
|
+
"bg-[#eab308]",
|
|
34
|
+
"bg-[#22c55e]",
|
|
35
|
+
"bg-[#14b8a6]",
|
|
36
|
+
"bg-[#06b6d4]",
|
|
37
|
+
"bg-[#3b82f6]",
|
|
38
|
+
"bg-[#2563eb]",
|
|
39
|
+
] as const;
|
|
40
|
+
|
|
41
|
+
function hashSlug(slug: string): number {
|
|
42
|
+
let h = 0;
|
|
43
|
+
for (let i = 0; i < slug.length; i++) {
|
|
44
|
+
h = ((h << 5) - h + slug.charCodeAt(i)) | 0;
|
|
45
|
+
}
|
|
46
|
+
return Math.abs(h);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const SIZE_CLASSES = {
|
|
50
|
+
sm: "size-6 text-[10px]",
|
|
51
|
+
md: "size-8 text-xs",
|
|
52
|
+
} as const;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Compact resource avatar for cards, rows, and detail headers.
|
|
56
|
+
*
|
|
57
|
+
* Renders one of three states:
|
|
58
|
+
* 1. **Image** — when `iconUrl` is a non-empty string
|
|
59
|
+
* 2. **Initial** — colored circle with the first letter of `name`,
|
|
60
|
+
* deterministic color derived from `slug`
|
|
61
|
+
* 3. **Hidden** — nothing (for resource types that don't support icons)
|
|
62
|
+
*/
|
|
63
|
+
export function ResourceAvatar({
|
|
64
|
+
name,
|
|
65
|
+
slug,
|
|
66
|
+
iconUrl,
|
|
67
|
+
hidden,
|
|
68
|
+
size = "md",
|
|
69
|
+
className,
|
|
70
|
+
}: ResourceAvatarProps) {
|
|
71
|
+
if (hidden) return null;
|
|
72
|
+
|
|
73
|
+
const sizeClass = SIZE_CLASSES[size];
|
|
74
|
+
|
|
75
|
+
if (iconUrl) {
|
|
76
|
+
return (
|
|
77
|
+
<span
|
|
78
|
+
className={cn(
|
|
79
|
+
"inline-flex shrink-0 items-center justify-center rounded-full bg-muted",
|
|
80
|
+
sizeClass,
|
|
81
|
+
className,
|
|
82
|
+
)}
|
|
83
|
+
>
|
|
84
|
+
<img
|
|
85
|
+
src={iconUrl}
|
|
86
|
+
alt=""
|
|
87
|
+
className="size-4/5 object-contain"
|
|
88
|
+
/>
|
|
89
|
+
</span>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const initial = (name || slug).charAt(0).toUpperCase();
|
|
94
|
+
const colorClass = AVATAR_COLORS[hashSlug(slug) % AVATAR_COLORS.length];
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<span
|
|
98
|
+
aria-hidden="true"
|
|
99
|
+
className={cn(
|
|
100
|
+
"inline-flex shrink-0 items-center justify-center rounded-full font-medium text-white",
|
|
101
|
+
sizeClass,
|
|
102
|
+
colorClass,
|
|
103
|
+
className,
|
|
104
|
+
)}
|
|
105
|
+
>
|
|
106
|
+
{initial}
|
|
107
|
+
</span>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { SelectionCheckbox } from "./SelectionCheckbox";
|
|
6
|
+
|
|
7
|
+
/** Props for {@link ResourceCards}. */
|
|
8
|
+
export interface ResourceCardsProps<TData> {
|
|
9
|
+
/** Items to render as cards. */
|
|
10
|
+
readonly items: readonly TData[];
|
|
11
|
+
/** Render function for each card's content. */
|
|
12
|
+
readonly renderCard: (item: TData, index: number) => ReactNode;
|
|
13
|
+
/** Whether selection checkboxes are shown on cards. */
|
|
14
|
+
readonly enableSelection?: boolean;
|
|
15
|
+
/** Set of selected item IDs. */
|
|
16
|
+
readonly selectedIds?: ReadonlySet<string>;
|
|
17
|
+
/** Called when an item's selection state is toggled. */
|
|
18
|
+
readonly onToggleSelection?: (id: string) => void;
|
|
19
|
+
/** Extracts a stable unique ID from an item. */
|
|
20
|
+
readonly getItemId?: (item: TData) => string;
|
|
21
|
+
/**
|
|
22
|
+
* Render function for per-card actions (e.g. an `ActionMenu`).
|
|
23
|
+
* Shown in the top-right corner of the card.
|
|
24
|
+
*/
|
|
25
|
+
readonly renderCardAction?: (item: TData) => ReactNode;
|
|
26
|
+
/** Called when a card is clicked (not when a control inside is clicked). */
|
|
27
|
+
readonly onCardClick?: (item: TData) => void;
|
|
28
|
+
/** Accessible label for the card grid region. @default "Resource cards" */
|
|
29
|
+
readonly "aria-label"?: string;
|
|
30
|
+
/** Additional CSS classes for the grid container. */
|
|
31
|
+
readonly className?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Card grid view for the resource workbench.
|
|
36
|
+
*
|
|
37
|
+
* Renders items as a responsive grid of cards. Each card supports an
|
|
38
|
+
* optional selection checkbox, an action slot, and click handling.
|
|
39
|
+
* Card content is fully customizable via the `renderCard` prop.
|
|
40
|
+
*
|
|
41
|
+
* This component renders **only the card grid**. Search, filters, and
|
|
42
|
+
* pagination are handled by the parent `ResourceWorkbench`.
|
|
43
|
+
*/
|
|
44
|
+
export function ResourceCards<TData>({
|
|
45
|
+
items,
|
|
46
|
+
renderCard,
|
|
47
|
+
enableSelection = false,
|
|
48
|
+
selectedIds,
|
|
49
|
+
onToggleSelection,
|
|
50
|
+
getItemId = defaultGetId,
|
|
51
|
+
renderCardAction,
|
|
52
|
+
onCardClick,
|
|
53
|
+
"aria-label": ariaLabel = "Resource cards",
|
|
54
|
+
className,
|
|
55
|
+
}: ResourceCardsProps<TData>) {
|
|
56
|
+
return (
|
|
57
|
+
<div
|
|
58
|
+
role="list"
|
|
59
|
+
aria-label={ariaLabel}
|
|
60
|
+
className={cn(
|
|
61
|
+
"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
62
|
+
className,
|
|
63
|
+
)}
|
|
64
|
+
>
|
|
65
|
+
{items.map((item, index) => {
|
|
66
|
+
const id = getItemId(item);
|
|
67
|
+
const isSelected = selectedIds?.has(id) ?? false;
|
|
68
|
+
const isClickable = !!onCardClick;
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<div
|
|
72
|
+
key={id || `card-${index}`}
|
|
73
|
+
role="listitem"
|
|
74
|
+
aria-selected={enableSelection ? isSelected : undefined}
|
|
75
|
+
onClick={
|
|
76
|
+
isClickable
|
|
77
|
+
? (e) => {
|
|
78
|
+
const target = e.target as HTMLElement;
|
|
79
|
+
if (
|
|
80
|
+
target.closest("button") ||
|
|
81
|
+
target.closest("input") ||
|
|
82
|
+
target.closest("[role='menu']")
|
|
83
|
+
) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
onCardClick!(item);
|
|
87
|
+
}
|
|
88
|
+
: undefined
|
|
89
|
+
}
|
|
90
|
+
className={cn(
|
|
91
|
+
"relative flex rounded-lg border border-border bg-card p-4 transition-colors",
|
|
92
|
+
isSelected && "border-primary/40 bg-primary-subtle",
|
|
93
|
+
isClickable && "cursor-pointer hover:border-primary/40 hover:bg-accent-hover",
|
|
94
|
+
isClickable && "focus-within:ring-2 focus-within:ring-ring",
|
|
95
|
+
)}
|
|
96
|
+
>
|
|
97
|
+
{enableSelection && onToggleSelection && (
|
|
98
|
+
<div className="absolute left-2 top-2">
|
|
99
|
+
<SelectionCheckbox
|
|
100
|
+
checked={isSelected}
|
|
101
|
+
onChange={() => onToggleSelection(id)}
|
|
102
|
+
aria-label={`Select item ${id}`}
|
|
103
|
+
/>
|
|
104
|
+
</div>
|
|
105
|
+
)}
|
|
106
|
+
<div className={cn("min-w-0 flex-1", enableSelection && "pl-5")}>
|
|
107
|
+
{renderCard(item, index)}
|
|
108
|
+
</div>
|
|
109
|
+
{renderCardAction && (
|
|
110
|
+
<div className="ml-2 shrink-0" onClick={(e) => e.stopPropagation()}>
|
|
111
|
+
{renderCardAction(item)}
|
|
112
|
+
</div>
|
|
113
|
+
)}
|
|
114
|
+
</div>
|
|
115
|
+
);
|
|
116
|
+
})}
|
|
117
|
+
</div>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function defaultGetId<TData>(item: TData): string {
|
|
122
|
+
const r = item as Record<string, unknown>;
|
|
123
|
+
if (typeof r.id === "string") return r.id;
|
|
124
|
+
if (typeof r.slug === "string") return r.slug;
|
|
125
|
+
return "";
|
|
126
|
+
}
|