@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
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { DetailAction } from "./types";
|
|
2
|
+
export interface ResourceActionBarProps {
|
|
3
|
+
/**
|
|
4
|
+
* Primary action rendered as a visible button.
|
|
5
|
+
* Use for the most common action on this resource (e.g. "Edit").
|
|
6
|
+
*/
|
|
7
|
+
readonly primaryAction?: DetailAction;
|
|
8
|
+
/**
|
|
9
|
+
* Secondary and tertiary actions rendered in the overflow (kebab) menu.
|
|
10
|
+
* Actions with the same `group` are visually grouped with separators.
|
|
11
|
+
*/
|
|
12
|
+
readonly actions?: readonly DetailAction[];
|
|
13
|
+
/** Additional CSS classes for the root container. */
|
|
14
|
+
readonly className?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Horizontal action bar for resource detail page headers.
|
|
18
|
+
*
|
|
19
|
+
* Renders an optional primary action as a visible button and any
|
|
20
|
+
* remaining actions in a kebab overflow menu (using the SDK's
|
|
21
|
+
* {@link ActionMenu} compound component).
|
|
22
|
+
*
|
|
23
|
+
* When there are no actions at all, renders nothing.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <ResourceActionBar
|
|
28
|
+
* primaryAction={{
|
|
29
|
+
* id: "edit",
|
|
30
|
+
* label: "Edit",
|
|
31
|
+
* icon: <PencilIcon />,
|
|
32
|
+
* onAction: () => router.push(editUrl),
|
|
33
|
+
* }}
|
|
34
|
+
* actions={[
|
|
35
|
+
* { id: "copy-id", label: "Copy ID", onAction: () => copyId(id) },
|
|
36
|
+
* { id: "delete", label: "Delete", variant: "destructive", onAction: handleDelete },
|
|
37
|
+
* ]}
|
|
38
|
+
* />
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function ResourceActionBar({ primaryAction, actions, className, }: ResourceActionBarProps): import("react/jsx-runtime").JSX.Element | null;
|
|
42
|
+
//# sourceMappingURL=ResourceActionBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceActionBar.d.ts","sourceRoot":"","sources":["../../src/resource-detail/ResourceActionBar.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,YAAY,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAC3C,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,aAAa,EACb,OAAO,EACP,SAAS,GACV,EAAE,sBAAsB,kDAyBxB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { ActionMenu } from "../action-menu";
|
|
6
|
+
/**
|
|
7
|
+
* Horizontal action bar for resource detail page headers.
|
|
8
|
+
*
|
|
9
|
+
* Renders an optional primary action as a visible button and any
|
|
10
|
+
* remaining actions in a kebab overflow menu (using the SDK's
|
|
11
|
+
* {@link ActionMenu} compound component).
|
|
12
|
+
*
|
|
13
|
+
* When there are no actions at all, renders nothing.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <ResourceActionBar
|
|
18
|
+
* primaryAction={{
|
|
19
|
+
* id: "edit",
|
|
20
|
+
* label: "Edit",
|
|
21
|
+
* icon: <PencilIcon />,
|
|
22
|
+
* onAction: () => router.push(editUrl),
|
|
23
|
+
* }}
|
|
24
|
+
* actions={[
|
|
25
|
+
* { id: "copy-id", label: "Copy ID", onAction: () => copyId(id) },
|
|
26
|
+
* { id: "delete", label: "Delete", variant: "destructive", onAction: handleDelete },
|
|
27
|
+
* ]}
|
|
28
|
+
* />
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export function ResourceActionBar({ primaryAction, actions, className, }) {
|
|
32
|
+
const hasOverflow = actions != null && actions.length > 0;
|
|
33
|
+
if (!primaryAction && !hasOverflow)
|
|
34
|
+
return null;
|
|
35
|
+
return (_jsxs("div", { className: cn("flex items-center gap-2", className), children: [primaryAction && (_jsxs("button", { type: "button", onClick: primaryAction.onAction, disabled: primaryAction.disabled, className: cn("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "bg-primary text-primary-foreground hover:bg-primary-hover", "disabled:pointer-events-none disabled:opacity-50"), children: [primaryAction.icon, primaryAction.label] })), hasOverflow && _jsx(OverflowMenu, { actions: actions })] }));
|
|
36
|
+
}
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
// Overflow kebab menu
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
function OverflowMenu({ actions, }) {
|
|
41
|
+
const grouped = useGroupedActions(actions);
|
|
42
|
+
return (_jsxs(ActionMenu, { children: [_jsx(ActionMenu.Trigger, { "aria-label": "More actions", children: _jsx(KebabIcon, { className: "size-4" }) }), _jsx(ActionMenu.Content, { children: grouped.map((group, groupIndex) => (_jsxs(ActionMenu.Group, { children: [groupIndex > 0 && _jsx(ActionMenu.Separator, {}), group.items.map((action) => (_jsx(ActionMenu.Item, { icon: action.icon, shortcut: action.shortcut, variant: action.variant, disabled: action.disabled, onSelect: action.onAction, children: action.label }, action.id)))] }, group.key))) })] }));
|
|
43
|
+
}
|
|
44
|
+
function useGroupedActions(actions) {
|
|
45
|
+
return useMemo(() => {
|
|
46
|
+
const map = new Map();
|
|
47
|
+
for (const action of actions) {
|
|
48
|
+
const key = action.group ?? "__default";
|
|
49
|
+
const list = map.get(key);
|
|
50
|
+
if (list)
|
|
51
|
+
list.push(action);
|
|
52
|
+
else
|
|
53
|
+
map.set(key, [action]);
|
|
54
|
+
}
|
|
55
|
+
return Array.from(map.entries()).map(([key, items]) => ({ key, items }));
|
|
56
|
+
}, [actions]);
|
|
57
|
+
}
|
|
58
|
+
// ---------------------------------------------------------------------------
|
|
59
|
+
// Kebab icon (inline SVG — no icon library dependency)
|
|
60
|
+
// ---------------------------------------------------------------------------
|
|
61
|
+
function KebabIcon({ className }) {
|
|
62
|
+
return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: [_jsx("circle", { cx: "8", cy: "3", r: "1.25" }), _jsx("circle", { cx: "8", cy: "8", r: "1.25" }), _jsx("circle", { cx: "8", cy: "13", r: "1.25" })] }));
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=ResourceActionBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceActionBar.js","sourceRoot":"","sources":["../../src/resource-detail/ResourceActionBar.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ResourceDetailShellProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Shared layout shell for resource detail pages.
|
|
4
|
+
*
|
|
5
|
+
* Renders a standardized header (icon, name, org, timestamps, status,
|
|
6
|
+
* visibility control), an action bar (primary button + kebab overflow),
|
|
7
|
+
* optional tabs, and a content area — all themed via `--stgm-*` tokens.
|
|
8
|
+
*
|
|
9
|
+
* The shell receives pre-fetched data via props (DD-T03-001). It does
|
|
10
|
+
* NOT own data fetching — resource-specific hooks (`useAgent`, `useSkill`,
|
|
11
|
+
* etc.) handle that. The shell is a layout + behavior coordinator, not
|
|
12
|
+
* a data-fetching component.
|
|
13
|
+
*
|
|
14
|
+
* Zero Console dependencies — safe for platform builder embedding.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const { agent } = useAgent(org, slug);
|
|
19
|
+
*
|
|
20
|
+
* <ResourceDetailShell
|
|
21
|
+
* header={{
|
|
22
|
+
* name: agent.metadata.name,
|
|
23
|
+
* id: agent.metadata.id,
|
|
24
|
+
* org: agent.metadata.org,
|
|
25
|
+
* slug: agent.metadata.slug,
|
|
26
|
+
* description: agent.spec.description,
|
|
27
|
+
* }}
|
|
28
|
+
* primaryAction={{ id: "edit", label: "Edit", onAction: handleEdit }}
|
|
29
|
+
* actions={[...]}
|
|
30
|
+
* >
|
|
31
|
+
* <AgentOverview agent={agent} />
|
|
32
|
+
* </ResourceDetailShell>
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function ResourceDetailShell({ header, visibilityControl, primaryAction, actions, tabs, activeTab, onTabChange, tabsAriaLabel, children, className, }: ResourceDetailShellProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
//# sourceMappingURL=ResourceDetailShell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceDetailShell.d.ts","sourceRoot":"","sources":["../../src/resource-detail/ResourceDetailShell.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,iBAAiB,EACjB,aAAa,EACb,OAAO,EACP,IAAI,EACJ,SAAS,EACT,WAAW,EACX,aAAa,EACb,QAAQ,EACR,SAAS,GACV,EAAE,wBAAwB,2CAiC1B"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
import { StatusBadge } from "../resource-workbench/components/StatusBadge";
|
|
5
|
+
import { Tabs } from "../tabs/Tabs";
|
|
6
|
+
import { ResourceActionBar } from "./ResourceActionBar";
|
|
7
|
+
/**
|
|
8
|
+
* Shared layout shell for resource detail pages.
|
|
9
|
+
*
|
|
10
|
+
* Renders a standardized header (icon, name, org, timestamps, status,
|
|
11
|
+
* visibility control), an action bar (primary button + kebab overflow),
|
|
12
|
+
* optional tabs, and a content area — all themed via `--stgm-*` tokens.
|
|
13
|
+
*
|
|
14
|
+
* The shell receives pre-fetched data via props (DD-T03-001). It does
|
|
15
|
+
* NOT own data fetching — resource-specific hooks (`useAgent`, `useSkill`,
|
|
16
|
+
* etc.) handle that. The shell is a layout + behavior coordinator, not
|
|
17
|
+
* a data-fetching component.
|
|
18
|
+
*
|
|
19
|
+
* Zero Console dependencies — safe for platform builder embedding.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* const { agent } = useAgent(org, slug);
|
|
24
|
+
*
|
|
25
|
+
* <ResourceDetailShell
|
|
26
|
+
* header={{
|
|
27
|
+
* name: agent.metadata.name,
|
|
28
|
+
* id: agent.metadata.id,
|
|
29
|
+
* org: agent.metadata.org,
|
|
30
|
+
* slug: agent.metadata.slug,
|
|
31
|
+
* description: agent.spec.description,
|
|
32
|
+
* }}
|
|
33
|
+
* primaryAction={{ id: "edit", label: "Edit", onAction: handleEdit }}
|
|
34
|
+
* actions={[...]}
|
|
35
|
+
* >
|
|
36
|
+
* <AgentOverview agent={agent} />
|
|
37
|
+
* </ResourceDetailShell>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export function ResourceDetailShell({ header, visibilityControl, primaryAction, actions, tabs, activeTab, onTabChange, tabsAriaLabel, children, className, }) {
|
|
41
|
+
const hasTabs = tabs != null && tabs.length > 0;
|
|
42
|
+
return (_jsxs("div", { className: cn("flex flex-col gap-6", className), children: [_jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsx(Header, { header: header, visibilityControl: visibilityControl }), _jsx(ResourceActionBar, { primaryAction: primaryAction, actions: actions, className: "shrink-0" })] }), hasTabs && activeTab && onTabChange ? (_jsx(Tabs, { tabs: tabs, activeTab: activeTab, onTabChange: onTabChange, "aria-label": tabsAriaLabel, children: children })) : (children)] }));
|
|
43
|
+
}
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
// Header
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
function Header({ header, visibilityControl, }) {
|
|
48
|
+
const { name, org, slug, description, iconUrl, icon, createdAt, updatedAt, status, statusLabel, } = header;
|
|
49
|
+
const showSlug = slug && slug !== name;
|
|
50
|
+
return (_jsxs("div", { className: "flex min-w-0 items-start gap-3", children: [iconUrl ? (_jsx("img", { src: iconUrl, alt: "", className: "mt-0.5 size-8 shrink-0 rounded object-cover" })) : icon ? (_jsx("span", { className: "mt-1 shrink-0", children: icon })) : null, _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("h2", { className: "truncate text-lg font-semibold text-foreground", children: name }), showSlug && (_jsx("code", { className: "shrink-0 rounded bg-muted px-1.5 py-0.5 text-xs font-medium text-muted-foreground", children: slug })), status && (_jsx(StatusBadge, { phase: status, label: statusLabel })), visibilityControl] }), _jsxs("div", { className: "mt-0.5 flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground", children: [org && _jsx("span", { children: org }), createdAt && (_jsxs(_Fragment, { children: [_jsx(Dot, {}), _jsxs("span", { children: ["Created ", formatDate(createdAt)] })] })), updatedAt && (_jsxs(_Fragment, { children: [_jsx(Dot, {}), _jsxs("span", { children: ["Updated ", formatDate(updatedAt)] })] }))] }), description && (_jsx("p", { className: "mt-2 text-sm text-muted-foreground", children: description }))] })] }));
|
|
51
|
+
}
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
// Utilities
|
|
54
|
+
// ---------------------------------------------------------------------------
|
|
55
|
+
function Dot() {
|
|
56
|
+
return (_jsx("span", { className: "shrink-0", "aria-hidden": "true", children: "\u00B7" }));
|
|
57
|
+
}
|
|
58
|
+
function formatDate(date) {
|
|
59
|
+
return date.toLocaleDateString("en-US", {
|
|
60
|
+
month: "short",
|
|
61
|
+
day: "numeric",
|
|
62
|
+
year: "numeric",
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=ResourceDetailShell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceDetailShell.js","sourceRoot":"","sources":["../../src/resource-detail/ResourceDetailShell.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface SectionProps {
|
|
3
|
+
readonly title: string;
|
|
4
|
+
readonly count?: number;
|
|
5
|
+
readonly onEdit?: () => void;
|
|
6
|
+
readonly children: ReactNode;
|
|
7
|
+
readonly className?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Shared section layout for resource detail views.
|
|
11
|
+
*
|
|
12
|
+
* Renders a labeled section with an optional count badge and edit affordance
|
|
13
|
+
* in the header row. The content is wrapped in a bordered card.
|
|
14
|
+
*
|
|
15
|
+
* Used uniformly by AgentDetailView, McpServerDetailView, and SkillDetailView.
|
|
16
|
+
*/
|
|
17
|
+
export declare function Section({ title, count, onEdit, children, className, }: SectionProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=Section.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../../src/resource-detail/Section.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAS,GACV,EAAE,YAAY,2CAiCd"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
/**
|
|
5
|
+
* Shared section layout for resource detail views.
|
|
6
|
+
*
|
|
7
|
+
* Renders a labeled section with an optional count badge and edit affordance
|
|
8
|
+
* in the header row. The content is wrapped in a bordered card.
|
|
9
|
+
*
|
|
10
|
+
* Used uniformly by AgentDetailView, McpServerDetailView, and SkillDetailView.
|
|
11
|
+
*/
|
|
12
|
+
export function Section({ title, count, onEdit, children, className, }) {
|
|
13
|
+
return (_jsxs("section", { className: className, children: [_jsxs("div", { className: "mb-2 flex items-center gap-2", children: [_jsx("h3", { className: "text-xs font-medium uppercase tracking-wider text-muted-foreground", children: title }), count != null && count > 0 && (_jsx("span", { className: "inline-flex size-5 items-center justify-center rounded-full bg-muted text-[10px] font-semibold text-muted-foreground", children: count })), onEdit && (_jsx("button", { type: "button", onClick: onEdit, "aria-label": `Edit ${title.toLowerCase()}`, className: cn("ml-auto inline-flex size-6 items-center justify-center rounded-md text-muted-foreground", "hover:bg-accent-hover hover:text-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "transition-colors"), children: _jsx(PencilIcon, { className: "size-3.5" }) }))] }), _jsx("div", { className: "overflow-hidden rounded-lg border border-border", children: children })] }));
|
|
14
|
+
}
|
|
15
|
+
function PencilIcon({ className }) {
|
|
16
|
+
return (_jsx("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "M11.5 1.5a2.121 2.121 0 0 1 3 3L5 14l-4 1 1-4Z" }) }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=Section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Section.js","sourceRoot":"","sources":["../../src/resource-detail/Section.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAWpC;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAC,EACtB,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAS,GACI;IACb,OAAO,CACL,mBAAS,SAAS,EAAE,SAAS,aAC3B,eAAK,SAAS,EAAC,8BAA8B,aAC3C,aAAI,SAAS,EAAC,oEAAoE,YAC/E,KAAK,GACH,EACJ,KAAK,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC,IAAI,CAC7B,eAAM,SAAS,EAAC,sHAAsH,YACnI,KAAK,GACD,CACR,EACA,MAAM,IAAI,CACT,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,MAAM,gBACH,QAAQ,KAAK,CAAC,WAAW,EAAE,EAAE,EACzC,SAAS,EAAE,EAAE,CACX,yFAAyF,EACzF,6CAA6C,EAC7C,yEAAyE,EACzE,mBAAmB,CACpB,YAED,KAAC,UAAU,IAAC,SAAS,EAAC,UAAU,GAAG,GAC5B,CACV,IACG,EACN,cAAK,SAAS,EAAC,iDAAiD,YAC7D,QAAQ,GACL,IACE,CACX,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,EAAE,SAAS,EAAmC;IAChE,OAAO,CACL,cACE,SAAS,EAAE,SAAS,EACpB,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,YAElB,eAAM,CAAC,EAAC,gDAAgD,GAAG,GACvD,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type { AdditionalTab, DetailAction, ResourceHeaderMeta, ConfirmOptions, ConfirmState, ResourceDetailShellProps, } from "./types";
|
|
2
|
+
export { useCopyResource } from "./useCopyResource";
|
|
3
|
+
export type { UseCopyResourceReturn } from "./useCopyResource";
|
|
4
|
+
export { useConfirmAction } from "./useConfirmAction";
|
|
5
|
+
export type { UseConfirmActionReturn } from "./useConfirmAction";
|
|
6
|
+
export { useDeleteResource } from "./useDeleteResource";
|
|
7
|
+
export type { DeletableResourceKind, UseDeleteResourceReturn, } from "./useDeleteResource";
|
|
8
|
+
export { ResourceActionBar } from "./ResourceActionBar";
|
|
9
|
+
export type { ResourceActionBarProps } from "./ResourceActionBar";
|
|
10
|
+
export { ResourceDetailShell } from "./ResourceDetailShell";
|
|
11
|
+
export { ConfirmDialog } from "./ConfirmDialog";
|
|
12
|
+
export type { ConfirmDialogProps } from "./ConfirmDialog";
|
|
13
|
+
export { Section } from "./Section";
|
|
14
|
+
export type { SectionProps } from "./Section";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resource-detail/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EACV,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Hooks
|
|
2
|
+
export { useCopyResource } from "./useCopyResource";
|
|
3
|
+
export { useConfirmAction } from "./useConfirmAction";
|
|
4
|
+
export { useDeleteResource } from "./useDeleteResource";
|
|
5
|
+
// Components
|
|
6
|
+
export { ResourceActionBar } from "./ResourceActionBar";
|
|
7
|
+
export { ResourceDetailShell } from "./ResourceDetailShell";
|
|
8
|
+
export { ConfirmDialog } from "./ConfirmDialog";
|
|
9
|
+
export { Section } from "./Section";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resource-detail/index.ts"],"names":[],"mappings":"AAUA,QAAQ;AACR,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAMxD,aAAa;AACb,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { StatusPhase } from "../resource-workbench/types";
|
|
3
|
+
import type { TabItem } from "../tabs/Tabs";
|
|
4
|
+
/**
|
|
5
|
+
* Describes a consumer-provided tab that extends a detail view's built-in
|
|
6
|
+
* tabs. Used by {@link AgentDetailView} and {@link SkillDetailView} to let
|
|
7
|
+
* platform builders (or the Console) add custom tabs without forking the
|
|
8
|
+
* component.
|
|
9
|
+
*
|
|
10
|
+
* The SDK component defines its own built-in tabs (e.g., "Overview" for
|
|
11
|
+
* agents, "Content" for skills). Consumers extend via `additionalTabs` —
|
|
12
|
+
* providing both the tab metadata and the content to render.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <AgentDetailView
|
|
17
|
+
* org="acme"
|
|
18
|
+
* slug="my-agent"
|
|
19
|
+
* additionalTabs={[
|
|
20
|
+
* { id: "dependencies", label: "Dependencies", content: <DependencyGraph /> },
|
|
21
|
+
* ]}
|
|
22
|
+
* />
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export interface AdditionalTab extends TabItem {
|
|
26
|
+
/** Content rendered in the tab panel when this tab is active. */
|
|
27
|
+
readonly content: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Describes an action that can be performed on the currently viewed
|
|
31
|
+
* resource. Used by {@link ResourceActionBar} and the kebab overflow menu.
|
|
32
|
+
*
|
|
33
|
+
* Unlike the workbench's `ResourceAction<TData>`, this is not generic —
|
|
34
|
+
* the detail page already knows what resource it is showing.
|
|
35
|
+
*/
|
|
36
|
+
export interface DetailAction {
|
|
37
|
+
/** Stable action identifier. */
|
|
38
|
+
readonly id: string;
|
|
39
|
+
/** Display label (e.g. "Edit", "Copy ID", "Delete"). */
|
|
40
|
+
readonly label: string;
|
|
41
|
+
/** Optional icon rendered before the label. */
|
|
42
|
+
readonly icon?: ReactNode;
|
|
43
|
+
/** Optional keyboard shortcut hint. */
|
|
44
|
+
readonly shortcut?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Visual variant.
|
|
47
|
+
* - `"default"` — standard item
|
|
48
|
+
* - `"destructive"` — danger styling for delete, revoke, etc.
|
|
49
|
+
* @default "default"
|
|
50
|
+
*/
|
|
51
|
+
readonly variant?: "default" | "destructive";
|
|
52
|
+
/** Fires when the action is selected. */
|
|
53
|
+
readonly onAction: () => void;
|
|
54
|
+
/** When `true`, the action is shown but non-interactive. */
|
|
55
|
+
readonly disabled?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Group identifier for organizing actions in the overflow menu.
|
|
58
|
+
* Actions with the same group are visually grouped with separators.
|
|
59
|
+
*/
|
|
60
|
+
readonly group?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Metadata rendered in the {@link ResourceDetailShell} header.
|
|
64
|
+
*
|
|
65
|
+
* This is the shared shape for all resource types — agent, skill,
|
|
66
|
+
* MCP server, runner. Each detail page maps its resource-specific
|
|
67
|
+
* protobuf to this shape before passing it to the shell.
|
|
68
|
+
*/
|
|
69
|
+
export interface ResourceHeaderMeta {
|
|
70
|
+
/** Display name of the resource. */
|
|
71
|
+
readonly name: string;
|
|
72
|
+
/** Resource ID (opaque string). */
|
|
73
|
+
readonly id: string;
|
|
74
|
+
/** Organization slug that owns the resource. */
|
|
75
|
+
readonly org?: string;
|
|
76
|
+
/** URL-friendly slug. */
|
|
77
|
+
readonly slug?: string;
|
|
78
|
+
/** Resource description. */
|
|
79
|
+
readonly description?: string;
|
|
80
|
+
/** Optional icon URL (e.g. agent icon). */
|
|
81
|
+
readonly iconUrl?: string;
|
|
82
|
+
/** Optional custom icon element to render instead of `iconUrl`. */
|
|
83
|
+
readonly icon?: ReactNode;
|
|
84
|
+
/** Resource creation timestamp. */
|
|
85
|
+
readonly createdAt?: Date | null;
|
|
86
|
+
/** Last update timestamp. */
|
|
87
|
+
readonly updatedAt?: Date | null;
|
|
88
|
+
/** Resource status phase for the status badge. */
|
|
89
|
+
readonly status?: StatusPhase;
|
|
90
|
+
/** Custom status label (overrides the default phase label). */
|
|
91
|
+
readonly statusLabel?: string;
|
|
92
|
+
}
|
|
93
|
+
/** Options passed to `confirm()` to show a confirmation prompt. */
|
|
94
|
+
export interface ConfirmOptions {
|
|
95
|
+
/** Dialog title (e.g. "Delete agent?"). */
|
|
96
|
+
readonly title: string;
|
|
97
|
+
/** Descriptive body text explaining the consequences. */
|
|
98
|
+
readonly description: string;
|
|
99
|
+
/** Label for the confirm button. @default "Confirm" */
|
|
100
|
+
readonly confirmLabel?: string;
|
|
101
|
+
/** Label for the cancel button. @default "Cancel" */
|
|
102
|
+
readonly cancelLabel?: string;
|
|
103
|
+
/** Visual variant for the confirm button. @default "destructive" */
|
|
104
|
+
readonly variant?: "default" | "destructive";
|
|
105
|
+
}
|
|
106
|
+
/** Internal state of a pending confirmation. */
|
|
107
|
+
export interface ConfirmState extends ConfirmOptions {
|
|
108
|
+
/** Resolves the promise returned by `confirm()`. */
|
|
109
|
+
readonly resolve: (confirmed: boolean) => void;
|
|
110
|
+
}
|
|
111
|
+
export interface ResourceDetailShellProps {
|
|
112
|
+
/** Header metadata extracted from the resource. */
|
|
113
|
+
readonly header: ResourceHeaderMeta;
|
|
114
|
+
/**
|
|
115
|
+
* Visibility control rendered in the header.
|
|
116
|
+
* Typically a `<VisibilityToggle />` from the library module.
|
|
117
|
+
* Rendered inline after the resource name.
|
|
118
|
+
*/
|
|
119
|
+
readonly visibilityControl?: ReactNode;
|
|
120
|
+
/**
|
|
121
|
+
* Primary action rendered as a visible button in the header area.
|
|
122
|
+
* Use for the most common action (e.g. "Edit" for agents).
|
|
123
|
+
*/
|
|
124
|
+
readonly primaryAction?: DetailAction;
|
|
125
|
+
/**
|
|
126
|
+
* Secondary actions rendered in the kebab overflow menu.
|
|
127
|
+
* Grouped by the `group` field — groups are separated visually.
|
|
128
|
+
*/
|
|
129
|
+
readonly actions?: readonly DetailAction[];
|
|
130
|
+
/**
|
|
131
|
+
* Optional tabs to render below the header.
|
|
132
|
+
* When omitted, children are rendered directly without a tab strip.
|
|
133
|
+
*/
|
|
134
|
+
readonly tabs?: readonly TabItem[];
|
|
135
|
+
/** Active tab ID (required when `tabs` is provided). */
|
|
136
|
+
readonly activeTab?: string;
|
|
137
|
+
/** Tab change handler (required when `tabs` is provided). */
|
|
138
|
+
readonly onTabChange?: (tabId: string) => void;
|
|
139
|
+
/** Accessible label for the tab strip. */
|
|
140
|
+
readonly tabsAriaLabel?: string;
|
|
141
|
+
/** Content area — tab panel content or direct children. */
|
|
142
|
+
readonly children: ReactNode;
|
|
143
|
+
/** Additional CSS classes for the root container. */
|
|
144
|
+
readonly className?: string;
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/resource-detail/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAM5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,aAAc,SAAQ,OAAO;IAC5C,iEAAiE;IACjE,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;CAC7B;AAMD;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,gCAAgC;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,+CAA+C;IAC/C,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1B,uCAAuC;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;IAC7C,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;IAC9B,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAMD;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,oCAAoC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,yBAAyB;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,4BAA4B;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,2CAA2C;IAC3C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1B,mCAAmC;IACnC,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACjC,6BAA6B;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACjC,kDAAkD;IAClD,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAC9B,+DAA+D;IAC/D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAMD,mEAAmE;AACnE,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,uDAAuD;IACvD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,qDAAqD;IACrD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,oEAAoE;IACpE,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;CAC9C;AAED,gDAAgD;AAChD,MAAM,WAAW,YAAa,SAAQ,cAAc;IAClD,oDAAoD;IACpD,QAAQ,CAAC,OAAO,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAChD;AAMD,MAAM,WAAW,wBAAwB;IACvC,mDAAmD;IACnD,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IAEpC;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAEvC;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,YAAY,CAAC;IAEtC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAE3C;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACnC,wDAAwD;IACxD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,6DAA6D;IAC7D,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,0CAA0C;IAC1C,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEhC,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAE7B,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/resource-detail/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ConfirmOptions, ConfirmState } from "./types";
|
|
2
|
+
export interface UseConfirmActionReturn {
|
|
3
|
+
/**
|
|
4
|
+
* The pending confirmation state, or `null` when no confirmation
|
|
5
|
+
* is active. Pass this to a `ConfirmDialog` component to render
|
|
6
|
+
* the dialog UI.
|
|
7
|
+
*/
|
|
8
|
+
readonly confirmState: ConfirmState | null;
|
|
9
|
+
/**
|
|
10
|
+
* Trigger a confirmation prompt. Returns a promise that resolves
|
|
11
|
+
* to `true` when confirmed, `false` when cancelled.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const confirmed = await confirm({
|
|
16
|
+
* title: "Delete agent?",
|
|
17
|
+
* description: "This action cannot be undone.",
|
|
18
|
+
* confirmLabel: "Delete",
|
|
19
|
+
* variant: "destructive",
|
|
20
|
+
* });
|
|
21
|
+
* if (confirmed) await deleteAgent();
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
readonly confirm: (options: ConfirmOptions) => Promise<boolean>;
|
|
25
|
+
/** Accept the pending confirmation. */
|
|
26
|
+
readonly handleConfirm: () => void;
|
|
27
|
+
/** Dismiss the pending confirmation. */
|
|
28
|
+
readonly handleCancel: () => void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* State management hook for confirmation dialogs.
|
|
32
|
+
*
|
|
33
|
+
* Provides an imperative `confirm()` function that returns a promise,
|
|
34
|
+
* paired with `confirmState` for rendering a `ConfirmDialog`.
|
|
35
|
+
*
|
|
36
|
+
* Separates the state logic (this hook) from the visual presentation
|
|
37
|
+
* (ConfirmDialog component) following the headless-first architecture
|
|
38
|
+
* (DD-003).
|
|
39
|
+
*/
|
|
40
|
+
export declare function useConfirmAction(): UseConfirmActionReturn;
|
|
41
|
+
//# sourceMappingURL=useConfirmAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConfirmAction.d.ts","sourceRoot":"","sources":["../../src/resource-detail/useConfirmAction.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5D,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAE3C;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAEhE,uCAAuC;IACvC,QAAQ,CAAC,aAAa,EAAE,MAAM,IAAI,CAAC;IACnC,wCAAwC;IACxC,QAAQ,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC;CACnC;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,IAAI,sBAAsB,CAuBzD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useMemo, useState } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* State management hook for confirmation dialogs.
|
|
5
|
+
*
|
|
6
|
+
* Provides an imperative `confirm()` function that returns a promise,
|
|
7
|
+
* paired with `confirmState` for rendering a `ConfirmDialog`.
|
|
8
|
+
*
|
|
9
|
+
* Separates the state logic (this hook) from the visual presentation
|
|
10
|
+
* (ConfirmDialog component) following the headless-first architecture
|
|
11
|
+
* (DD-003).
|
|
12
|
+
*/
|
|
13
|
+
export function useConfirmAction() {
|
|
14
|
+
const [confirmState, setConfirmState] = useState(null);
|
|
15
|
+
const confirm = useCallback((options) => {
|
|
16
|
+
return new Promise((resolve) => {
|
|
17
|
+
setConfirmState({ ...options, resolve });
|
|
18
|
+
});
|
|
19
|
+
}, []);
|
|
20
|
+
const handleConfirm = useCallback(() => {
|
|
21
|
+
confirmState?.resolve(true);
|
|
22
|
+
setConfirmState(null);
|
|
23
|
+
}, [confirmState]);
|
|
24
|
+
const handleCancel = useCallback(() => {
|
|
25
|
+
confirmState?.resolve(false);
|
|
26
|
+
setConfirmState(null);
|
|
27
|
+
}, [confirmState]);
|
|
28
|
+
return useMemo(() => ({ confirmState, confirm, handleConfirm, handleCancel }), [confirmState, confirm, handleConfirm, handleCancel]);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=useConfirmAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConfirmAction.js","sourceRoot":"","sources":["../../src/resource-detail/useConfirmAction.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAkCvD;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAsB,IAAI,CAAC,CAAC;IAE5E,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC,OAAuB,EAAoB,EAAE;QACxE,OAAO,IAAI,OAAO,CAAU,CAAC,OAAO,EAAE,EAAE;YACtC,eAAe,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,aAAa,GAAG,WAAW,CAAC,GAAG,EAAE;QACrC,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAC5B,eAAe,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE;QACpC,YAAY,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAC7B,eAAe,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC,EAC9D,CAAC,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,CAAC,CACrD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface UseCopyResourceReturn {
|
|
2
|
+
/** Copy arbitrary text to the clipboard with toast feedback. */
|
|
3
|
+
readonly copy: (text: string, label: string) => Promise<void>;
|
|
4
|
+
/** Shortcut: copies `id` and toasts "ID copied". */
|
|
5
|
+
readonly copyId: (id: string) => Promise<void>;
|
|
6
|
+
/** Shortcut: copies `slug` and toasts "Slug copied". */
|
|
7
|
+
readonly copySlug: (slug: string) => Promise<void>;
|
|
8
|
+
/** Shortcut: copies the qualified slug (`org/slug`) and toasts. */
|
|
9
|
+
readonly copyQualifiedSlug: (org: string, slug: string) => Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Clipboard helper for resource detail pages.
|
|
13
|
+
*
|
|
14
|
+
* Wraps `navigator.clipboard.writeText` with toast feedback so every
|
|
15
|
+
* copy action is confirmed visually (Nielsen heuristic #1 — visibility
|
|
16
|
+
* of system status). Falls back to a hidden textarea for older browsers.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* const { copyId, copySlug, copy } = useCopyResource();
|
|
21
|
+
*
|
|
22
|
+
* <ActionMenu.Item onSelect={() => copyId(resource.id)}>
|
|
23
|
+
* Copy ID
|
|
24
|
+
* </ActionMenu.Item>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function useCopyResource(): UseCopyResourceReturn;
|
|
28
|
+
//# sourceMappingURL=useCopyResource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCopyResource.d.ts","sourceRoot":"","sources":["../../src/resource-detail/useCopyResource.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,qBAAqB;IACpC,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,oDAAoD;IACpD,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,wDAAwD;IACxD,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,mEAAmE;IACnE,QAAQ,CAAC,iBAAiB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,IAAI,qBAAqB,CA8BvD"}
|