@stigmer/react 0.4.8 → 0.5.1
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/composer/ContextChip.d.ts +7 -2
- package/composer/ContextChip.d.ts.map +1 -1
- package/composer/ContextChip.js +2 -1
- package/composer/ContextChip.js.map +1 -1
- package/composer/SessionComposer.d.ts +11 -0
- package/composer/SessionComposer.d.ts.map +1 -1
- package/composer/SessionComposer.js +33 -4
- package/composer/SessionComposer.js.map +1 -1
- 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/environment/usePersonalEnvironment.d.ts.map +1 -1
- package/environment/usePersonalEnvironment.js +1 -0
- package/environment/usePersonalEnvironment.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 +32 -12
- package/index.d.ts.map +1 -1
- package/index.js +30 -10
- 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 +33 -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/internal/useFetch.js +2 -2
- package/internal/useFetch.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 +235 -43
- 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/ModelRegistryContext.d.ts +2 -0
- package/models/ModelRegistryContext.d.ts.map +1 -1
- package/models/ModelRegistryContext.js +1 -0
- package/models/ModelRegistryContext.js.map +1 -1
- package/models/ModelSelector.d.ts.map +1 -1
- package/models/ModelSelector.js +2 -2
- package/models/ModelSelector.js.map +1 -1
- package/models/__tests__/useModelRegistry.test.js +4 -3
- package/models/__tests__/useModelRegistry.test.js.map +1 -1
- package/models/useModelRegistry.d.ts +2 -0
- package/models/useModelRegistry.d.ts.map +1 -1
- package/models/useModelRegistry.js +3 -2
- package/models/useModelRegistry.js.map +1 -1
- package/package.json +8 -4
- package/provider.d.ts.map +1 -1
- package/provider.js +69 -22
- 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/session/__tests__/session-spec-converters.test.d.ts +2 -0
- package/session/__tests__/session-spec-converters.test.d.ts.map +1 -0
- package/session/__tests__/session-spec-converters.test.js +162 -0
- package/session/__tests__/session-spec-converters.test.js.map +1 -0
- package/session/__tests__/useNewSessionFlow.test.js +2 -2
- package/session/__tests__/useNewSessionFlow.test.js.map +1 -1
- package/session/__tests__/usePersistedModel.test.js +1 -1
- package/session/__tests__/usePersistedModel.test.js.map +1 -1
- package/session/group-sessions.d.ts +17 -0
- package/session/group-sessions.d.ts.map +1 -1
- package/session/group-sessions.js +46 -0
- package/session/group-sessions.js.map +1 -1
- package/session/index.d.ts +4 -2
- package/session/index.d.ts.map +1 -1
- package/session/index.js +2 -1
- package/session/index.js.map +1 -1
- package/session/session-spec-converters.d.ts +24 -0
- package/session/session-spec-converters.d.ts.map +1 -0
- package/session/session-spec-converters.js +72 -0
- package/session/session-spec-converters.js.map +1 -0
- package/session/useSessionConversation.d.ts.map +1 -1
- package/session/useSessionConversation.js +1 -56
- package/session/useSessionConversation.js.map +1 -1
- package/session/useSessionPageFlow.d.ts +5 -0
- package/session/useSessionPageFlow.d.ts.map +1 -1
- package/session/useSessionPageFlow.js +20 -6
- package/session/useSessionPageFlow.js.map +1 -1
- package/session/useSessionSearch.d.ts +57 -0
- package/session/useSessionSearch.d.ts.map +1 -0
- package/session/useSessionSearch.js +94 -0
- package/session/useSessionSearch.js.map +1 -0
- 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/composer/ContextChip.tsx +20 -11
- package/src/composer/SessionComposer.tsx +52 -3
- 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/environment/usePersonalEnvironment.ts +1 -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 +275 -8
- package/src/inline-edit/InlineEditImage.tsx +208 -0
- package/src/inline-edit/InlineEditKeyValue.tsx +301 -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/internal/useFetch.ts +2 -2
- 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 +816 -155
- 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/ModelRegistryContext.ts +3 -0
- package/src/models/ModelSelector.tsx +25 -2
- package/src/models/__tests__/useModelRegistry.test.tsx +5 -3
- package/src/models/useModelRegistry.ts +5 -2
- package/src/provider.tsx +69 -18
- 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/session/__tests__/session-spec-converters.test.ts +185 -0
- package/src/session/__tests__/useNewSessionFlow.test.tsx +2 -2
- package/src/session/__tests__/usePersistedModel.test.tsx +1 -1
- package/src/session/group-sessions.ts +65 -0
- package/src/session/index.ts +8 -2
- package/src/session/session-spec-converters.ts +86 -0
- package/src/session/useSessionConversation.ts +5 -64
- package/src/session/useSessionPageFlow.ts +28 -7
- package/src/session/useSessionSearch.ts +149 -0
- 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,99 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
const KIND_LABELS = {
|
|
6
|
+
agent: "Agent",
|
|
7
|
+
"mcp-server": "MCP",
|
|
8
|
+
skill: "Skill",
|
|
9
|
+
"sub-agent": "Sub-Agent",
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Renders a single node in the dependency tree: icon, kind badge,
|
|
13
|
+
* label, metadata, and (for expandable nodes) an expand/collapse
|
|
14
|
+
* chevron with nested children.
|
|
15
|
+
*
|
|
16
|
+
* Leaf nodes (MCP servers, skills) with a `ref` are clickable —
|
|
17
|
+
* firing `onNodeClick` for consumer-wired navigation.
|
|
18
|
+
*
|
|
19
|
+
* Sub-agent nodes are collapsible containers, and the root agent
|
|
20
|
+
* node always renders its children expanded. Both recurse using
|
|
21
|
+
* the same component, keeping the ARIA tree structure correct
|
|
22
|
+
* (`<li role="treeitem">` wrapping a nested `<ul role="group">`).
|
|
23
|
+
*/
|
|
24
|
+
export function DependencyTreeNode({ node, depth, onNodeClick, defaultExpanded, }) {
|
|
25
|
+
const hasChildren = node.children.length > 0;
|
|
26
|
+
const isRoot = node.kind === "agent";
|
|
27
|
+
const isCollapsible = node.kind === "sub-agent" && hasChildren;
|
|
28
|
+
const isAlwaysExpanded = isRoot && hasChildren;
|
|
29
|
+
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
30
|
+
const isNavigable = node.ref != null && onNodeClick != null;
|
|
31
|
+
const showChildren = isAlwaysExpanded || (isCollapsible && expanded);
|
|
32
|
+
const handleClick = useCallback(() => {
|
|
33
|
+
if (isCollapsible) {
|
|
34
|
+
setExpanded((v) => !v);
|
|
35
|
+
}
|
|
36
|
+
else if (isNavigable) {
|
|
37
|
+
onNodeClick(node);
|
|
38
|
+
}
|
|
39
|
+
}, [isCollapsible, isNavigable, onNodeClick, node]);
|
|
40
|
+
const handleKeyDown = useCallback((e) => {
|
|
41
|
+
if (!isCollapsible)
|
|
42
|
+
return;
|
|
43
|
+
if (e.key === "ArrowRight" && !expanded) {
|
|
44
|
+
e.preventDefault();
|
|
45
|
+
setExpanded(true);
|
|
46
|
+
}
|
|
47
|
+
else if (e.key === "ArrowLeft" && expanded) {
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
setExpanded(false);
|
|
50
|
+
}
|
|
51
|
+
}, [isCollapsible, expanded]);
|
|
52
|
+
const content = (_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [isCollapsible && (_jsx(ChevronIcon, { className: cn("size-3.5 shrink-0 text-muted-foreground transition-transform", expanded && "rotate-90") })), _jsx(NodeIcon, { kind: node.kind, className: "size-4 shrink-0 text-muted-foreground" }), !isRoot && (_jsx("span", { className: cn("shrink-0 rounded px-1.5 py-px text-[10px] font-medium leading-tight", kindBadgeClasses(node.kind)), children: KIND_LABELS[node.kind] })), _jsx("span", { className: "min-w-0 truncate text-sm font-medium text-foreground", children: node.qualifiedLabel ?? node.label }), node.metadata &&
|
|
53
|
+
Object.entries(node.metadata).map(([key, value]) => (_jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: value }, key)))] }));
|
|
54
|
+
const isInteractive = isCollapsible || isNavigable;
|
|
55
|
+
const isChild = depth > 0;
|
|
56
|
+
return (_jsxs("li", { role: "treeitem", "aria-expanded": isCollapsible ? expanded : isAlwaysExpanded ? true : undefined, className: cn("list-none", isChild && "relative before:absolute before:left-[-12px] before:top-[14px] before:h-px before:w-3 before:bg-border before:content-['']"), children: [isInteractive ? (_jsx("button", { type: "button", onClick: handleClick, onKeyDown: handleKeyDown, tabIndex: -1, className: cn("flex w-full items-center rounded-md px-2 py-1.5 text-left transition-colors", "hover:bg-accent-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring"), children: content })) : (_jsx("div", { className: "flex items-center px-2 py-1.5", children: content })), node.description && !isRoot && (_jsx("p", { className: cn("px-2 pb-1 text-xs text-muted-foreground", isCollapsible ? "ml-[calc(0.5rem+14px+0.5rem)]" : "ml-2"), children: node.description })), showChildren && (_jsx("ul", { role: "group", className: "relative ml-[11px] border-l border-border pl-3", children: node.children.map((child) => (_jsx(DependencyTreeNode, { node: child, depth: depth + 1, onNodeClick: onNodeClick, defaultExpanded: defaultExpanded }, child.id))) }))] }));
|
|
57
|
+
}
|
|
58
|
+
// ---------------------------------------------------------------------------
|
|
59
|
+
// Kind badge styling — uses --stgm-* tokens, no hardcoded colors
|
|
60
|
+
// ---------------------------------------------------------------------------
|
|
61
|
+
function kindBadgeClasses(kind) {
|
|
62
|
+
switch (kind) {
|
|
63
|
+
case "mcp-server":
|
|
64
|
+
return "bg-[var(--stgm-status-running-subtle)] text-[var(--stgm-status-running)]";
|
|
65
|
+
case "skill":
|
|
66
|
+
return "bg-[var(--stgm-status-pending-subtle)] text-[var(--stgm-status-pending)]";
|
|
67
|
+
case "sub-agent":
|
|
68
|
+
return "bg-[var(--stgm-status-ready-subtle)] text-[var(--stgm-status-ready)]";
|
|
69
|
+
case "agent":
|
|
70
|
+
return "bg-muted text-muted-foreground";
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
// Icons — inline SVGs, consistent with AgentDetailView pattern
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
function NodeIcon({ kind, className, }) {
|
|
77
|
+
switch (kind) {
|
|
78
|
+
case "agent":
|
|
79
|
+
case "sub-agent":
|
|
80
|
+
return _jsx(AgentIcon, { className: className });
|
|
81
|
+
case "mcp-server":
|
|
82
|
+
return _jsx(McpServerIcon, { className: className });
|
|
83
|
+
case "skill":
|
|
84
|
+
return _jsx(SkillIcon, { className: className });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function AgentIcon({ className }) {
|
|
88
|
+
return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("rect", { x: "3", y: "5", width: "10", height: "8", rx: "1.5" }), _jsx("path", { d: "M6 9h.01M10 9h.01", strokeWidth: "2" }), _jsx("path", { d: "M8 2v3" })] }));
|
|
89
|
+
}
|
|
90
|
+
function McpServerIcon({ className }) {
|
|
91
|
+
return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("rect", { x: "2", y: "2", width: "12", height: "5", rx: "1" }), _jsx("rect", { x: "2", y: "9", width: "12", height: "5", rx: "1" }), _jsx("circle", { cx: "5", cy: "4.5", r: "0.75", fill: "currentColor", stroke: "none" }), _jsx("circle", { cx: "5", cy: "11.5", r: "0.75", fill: "currentColor", stroke: "none" })] }));
|
|
92
|
+
}
|
|
93
|
+
function SkillIcon({ className }) {
|
|
94
|
+
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: "M9 1.5 4 9h4l-1 5.5L12 7H8l1-5.5Z" }) }));
|
|
95
|
+
}
|
|
96
|
+
function ChevronIcon({ className }) {
|
|
97
|
+
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: "m6 3 5 5-5 5" }) }));
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=DependencyTreeNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DependencyTreeNode.js","sourceRoot":"","sources":["../../src/dependency-graph/DependencyTreeNode.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAsB,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAUpC,MAAM,WAAW,GAA6B;IAC5C,KAAK,EAAE,OAAO;IACd,YAAY,EAAE,KAAK;IACnB,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,WAAW;CACzB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,IAAI,EACJ,KAAK,EACL,WAAW,EACX,eAAe,GACS;IACxB,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC;IACrC,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,WAAW,CAAC;IAC/D,MAAM,gBAAgB,GAAG,MAAM,IAAI,WAAW,CAAC;IAC/C,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;IAC1D,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI,IAAI,WAAW,IAAI,IAAI,CAAC;IAE5D,MAAM,YAAY,GAAG,gBAAgB,IAAI,CAAC,aAAa,IAAI,QAAQ,CAAC,CAAC;IAErE,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE;QACnC,IAAI,aAAa,EAA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EAAC,mCAAmC,GAAG,GAC1C,CACP,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,SAAS,EAAmC;IACjE,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,cAAc,GAAG,GACrB,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { NodeKind, DependencyNode, DependencyTree, DependencyGraphProps, UseDependencyGraphOptions, UseDependencyGraphReturn, } from "./types";
|
|
2
|
+
export { useDependencyGraph } from "./useDependencyGraph";
|
|
3
|
+
export { DependencyGraph } from "./DependencyGraph";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dependency-graph/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dependency-graph/index.ts"],"names":[],"mappings":"AAUA,QAAQ;AACR,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,aAAa;AACb,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resource kind in a dependency tree.
|
|
3
|
+
*
|
|
4
|
+
* - `"agent"` — the root agent (always the tree root)
|
|
5
|
+
* - `"mcp-server"` — an MCP server referenced via `mcpServerUsages` or `mcpAccess`
|
|
6
|
+
* - `"skill"` — a skill referenced via `skillRefs`
|
|
7
|
+
* - `"sub-agent"` — an inline sub-agent definition with its own dependencies
|
|
8
|
+
*/
|
|
9
|
+
export type NodeKind = "agent" | "mcp-server" | "skill" | "sub-agent";
|
|
10
|
+
/**
|
|
11
|
+
* A single node in the agent dependency tree.
|
|
12
|
+
*
|
|
13
|
+
* The tree is recursive: sub-agent nodes contain their own children
|
|
14
|
+
* (MCP servers and skills they access). Edges are implicit in the
|
|
15
|
+
* parent-child relationship — no separate edge type is needed.
|
|
16
|
+
*
|
|
17
|
+
* Nodes are navigable when `ref` is defined (MCP servers, skills).
|
|
18
|
+
* Sub-agent nodes have no `ref` because they are inline definitions
|
|
19
|
+
* within the agent spec, not standalone resources.
|
|
20
|
+
*/
|
|
21
|
+
export interface DependencyNode {
|
|
22
|
+
/**
|
|
23
|
+
* Deterministic identifier. Format: `{kind}:{slug}` for referenced
|
|
24
|
+
* resources, `sub-agent:{name}` for sub-agents, or `agent:{slug}`
|
|
25
|
+
* for the root.
|
|
26
|
+
*/
|
|
27
|
+
readonly id: string;
|
|
28
|
+
/** What kind of resource this node represents. */
|
|
29
|
+
readonly kind: NodeKind;
|
|
30
|
+
/** Primary display label (slug for resources, name for sub-agents). */
|
|
31
|
+
readonly label: string;
|
|
32
|
+
/**
|
|
33
|
+
* Qualified label shown when the resource belongs to a different org
|
|
34
|
+
* than the agent (e.g., `"other-org/shared-server"`). Undefined when
|
|
35
|
+
* the resource is in the same org as the parent agent.
|
|
36
|
+
*/
|
|
37
|
+
readonly qualifiedLabel?: string;
|
|
38
|
+
/** Short description (sub-agent description, if available). */
|
|
39
|
+
readonly description?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Key-value metadata displayed as secondary info.
|
|
42
|
+
* Examples: `{ tools: "3 tools" }`, `{ model: "gpt-4" }`.
|
|
43
|
+
*/
|
|
44
|
+
readonly metadata?: Readonly<Record<string, string>>;
|
|
45
|
+
/** Child nodes. Empty array for leaf nodes (MCP servers, skills). */
|
|
46
|
+
readonly children: readonly DependencyNode[];
|
|
47
|
+
/**
|
|
48
|
+
* Navigation reference for clickable nodes. Defined for MCP servers
|
|
49
|
+
* and skills (standalone resources). Undefined for sub-agents (inline
|
|
50
|
+
* definitions) and the root agent.
|
|
51
|
+
*/
|
|
52
|
+
readonly ref?: {
|
|
53
|
+
readonly org: string;
|
|
54
|
+
readonly slug: string;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Complete dependency tree for an agent, rooted at the agent itself.
|
|
59
|
+
*/
|
|
60
|
+
export interface DependencyTree {
|
|
61
|
+
/** The agent node with all dependencies as descendants. */
|
|
62
|
+
readonly root: DependencyNode;
|
|
63
|
+
/** Total number of nodes in the tree (including root). */
|
|
64
|
+
readonly nodeCount: number;
|
|
65
|
+
}
|
|
66
|
+
/** Props for {@link DependencyGraph}. */
|
|
67
|
+
export interface DependencyGraphProps {
|
|
68
|
+
/** The dependency tree to render. */
|
|
69
|
+
readonly tree: DependencyTree;
|
|
70
|
+
/**
|
|
71
|
+
* Called when a navigable node is clicked. The `node.ref` field
|
|
72
|
+
* contains the `org` and `slug` for routing. Only fired for nodes
|
|
73
|
+
* where `ref` is defined (MCP servers, skills).
|
|
74
|
+
*/
|
|
75
|
+
readonly onNodeClick?: (node: DependencyNode) => void;
|
|
76
|
+
/**
|
|
77
|
+
* Whether sub-agent subtrees start expanded.
|
|
78
|
+
* @default true
|
|
79
|
+
*/
|
|
80
|
+
readonly defaultExpanded?: boolean;
|
|
81
|
+
/** Additional CSS classes for the root container. */
|
|
82
|
+
readonly className?: string;
|
|
83
|
+
}
|
|
84
|
+
/** Options for {@link useDependencyGraph}. */
|
|
85
|
+
export interface UseDependencyGraphOptions {
|
|
86
|
+
/** Display name of the agent (used as the root node label). */
|
|
87
|
+
readonly agentName: string;
|
|
88
|
+
/** Organization slug of the agent (used for cross-org label detection). */
|
|
89
|
+
readonly agentOrg: string;
|
|
90
|
+
/**
|
|
91
|
+
* The agent's spec containing dependency references.
|
|
92
|
+
* Pass `undefined` while the agent is loading — the hook returns
|
|
93
|
+
* `null` for `tree` and `true` for `isEmpty`.
|
|
94
|
+
*/
|
|
95
|
+
readonly spec: {
|
|
96
|
+
readonly mcpServerUsages: readonly {
|
|
97
|
+
readonly mcpServerRef?: {
|
|
98
|
+
readonly org: string;
|
|
99
|
+
readonly slug: string;
|
|
100
|
+
};
|
|
101
|
+
readonly enabledTools: readonly string[];
|
|
102
|
+
readonly toolApprovalOverrides: readonly unknown[];
|
|
103
|
+
}[];
|
|
104
|
+
readonly skillRefs: readonly {
|
|
105
|
+
readonly org: string;
|
|
106
|
+
readonly slug: string;
|
|
107
|
+
}[];
|
|
108
|
+
readonly subAgents: readonly {
|
|
109
|
+
readonly name: string;
|
|
110
|
+
readonly description: string;
|
|
111
|
+
readonly mcpAccess: readonly {
|
|
112
|
+
readonly mcpServer: string;
|
|
113
|
+
readonly enabledTools: readonly string[];
|
|
114
|
+
}[];
|
|
115
|
+
readonly skillRefs: readonly {
|
|
116
|
+
readonly org: string;
|
|
117
|
+
readonly slug: string;
|
|
118
|
+
}[];
|
|
119
|
+
readonly modelOverride: string;
|
|
120
|
+
}[];
|
|
121
|
+
} | undefined;
|
|
122
|
+
}
|
|
123
|
+
/** Return value of {@link useDependencyGraph}. */
|
|
124
|
+
export interface UseDependencyGraphReturn {
|
|
125
|
+
/** The computed tree, or `null` when spec is undefined. */
|
|
126
|
+
readonly tree: DependencyTree | null;
|
|
127
|
+
/** `true` when the agent has zero dependencies (or spec is undefined). */
|
|
128
|
+
readonly isEmpty: boolean;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/dependency-graph/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S,CAAC;CACf;AAED,kDAAkD;AAClD,MAAM,WAAW,wBAAwB;IACvC,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;IACrC,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/dependency-graph/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { UseDependencyGraphOptions, UseDependencyGraphReturn } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Pure transformation hook that converts an `AgentSpec` into a
|
|
4
|
+
* {@link DependencyTree} for rendering.
|
|
5
|
+
*
|
|
6
|
+
* No data fetching, no side effects — the tree is computed entirely
|
|
7
|
+
* from the spec fields already available via {@link useAgent}. The
|
|
8
|
+
* result is memoized and only recomputes when the spec reference
|
|
9
|
+
* changes.
|
|
10
|
+
*
|
|
11
|
+
* Returns `null` for `tree` when `spec` is `undefined` (loading state).
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const { tree, isEmpty } = useDependencyGraph({
|
|
16
|
+
* agentName: agent.metadata.name,
|
|
17
|
+
* agentOrg: agent.metadata.org,
|
|
18
|
+
* spec: agent.spec,
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* if (!isEmpty && tree) {
|
|
22
|
+
* return <DependencyGraph tree={tree} onNodeClick={handleClick} />;
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function useDependencyGraph({ agentName, agentOrg, spec, }: UseDependencyGraphOptions): UseDependencyGraphReturn;
|
|
27
|
+
//# sourceMappingURL=useDependencyGraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDependencyGraph.d.ts","sourceRoot":"","sources":["../../src/dependency-graph/useDependencyGraph.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAGV,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,QAAQ,EACR,IAAI,GACL,EAAE,yBAAyB,GAAG,wBAAwB,CAuHtD"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Pure transformation hook that converts an `AgentSpec` into a
|
|
5
|
+
* {@link DependencyTree} for rendering.
|
|
6
|
+
*
|
|
7
|
+
* No data fetching, no side effects — the tree is computed entirely
|
|
8
|
+
* from the spec fields already available via {@link useAgent}. The
|
|
9
|
+
* result is memoized and only recomputes when the spec reference
|
|
10
|
+
* changes.
|
|
11
|
+
*
|
|
12
|
+
* Returns `null` for `tree` when `spec` is `undefined` (loading state).
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const { tree, isEmpty } = useDependencyGraph({
|
|
17
|
+
* agentName: agent.metadata.name,
|
|
18
|
+
* agentOrg: agent.metadata.org,
|
|
19
|
+
* spec: agent.spec,
|
|
20
|
+
* });
|
|
21
|
+
*
|
|
22
|
+
* if (!isEmpty && tree) {
|
|
23
|
+
* return <DependencyGraph tree={tree} onNodeClick={handleClick} />;
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export function useDependencyGraph({ agentName, agentOrg, spec, }) {
|
|
28
|
+
return useMemo(() => {
|
|
29
|
+
if (!spec)
|
|
30
|
+
return { tree: null, isEmpty: true };
|
|
31
|
+
const { mcpServerUsages, skillRefs, subAgents } = spec;
|
|
32
|
+
const hasDeps = mcpServerUsages.length > 0 ||
|
|
33
|
+
skillRefs.length > 0 ||
|
|
34
|
+
subAgents.length > 0;
|
|
35
|
+
if (!hasDeps)
|
|
36
|
+
return { tree: null, isEmpty: true };
|
|
37
|
+
let nodeCount = 1; // root
|
|
38
|
+
const mcpNodes = mcpServerUsages
|
|
39
|
+
.filter((u) => u.mcpServerRef)
|
|
40
|
+
.map((usage) => {
|
|
41
|
+
nodeCount++;
|
|
42
|
+
const ref = usage.mcpServerRef;
|
|
43
|
+
const toolCount = usage.enabledTools.length;
|
|
44
|
+
return {
|
|
45
|
+
id: `mcp-server:${ref.slug}`,
|
|
46
|
+
kind: "mcp-server",
|
|
47
|
+
label: ref.slug,
|
|
48
|
+
qualifiedLabel: ref.org && ref.org !== agentOrg
|
|
49
|
+
? `${ref.org}/${ref.slug}`
|
|
50
|
+
: undefined,
|
|
51
|
+
metadata: {
|
|
52
|
+
tools: toolCount > 0
|
|
53
|
+
? `${toolCount} ${toolCount === 1 ? "tool" : "tools"}`
|
|
54
|
+
: "all tools",
|
|
55
|
+
},
|
|
56
|
+
children: [],
|
|
57
|
+
ref: { org: ref.org || agentOrg, slug: ref.slug },
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
const skillNodes = skillRefs.map((ref) => {
|
|
61
|
+
nodeCount++;
|
|
62
|
+
return {
|
|
63
|
+
id: `skill:${ref.slug}`,
|
|
64
|
+
kind: "skill",
|
|
65
|
+
label: ref.slug,
|
|
66
|
+
qualifiedLabel: ref.org && ref.org !== agentOrg
|
|
67
|
+
? `${ref.org}/${ref.slug}`
|
|
68
|
+
: undefined,
|
|
69
|
+
children: [],
|
|
70
|
+
ref: { org: ref.org || agentOrg, slug: ref.slug },
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
const subAgentNodes = subAgents.map((sa) => {
|
|
74
|
+
nodeCount++;
|
|
75
|
+
const saMcpNodes = sa.mcpAccess.map((access) => {
|
|
76
|
+
nodeCount++;
|
|
77
|
+
const toolCount = access.enabledTools.length;
|
|
78
|
+
return {
|
|
79
|
+
id: `sub-agent:${sa.name}:mcp-server:${access.mcpServer}`,
|
|
80
|
+
kind: "mcp-server",
|
|
81
|
+
label: access.mcpServer,
|
|
82
|
+
metadata: {
|
|
83
|
+
tools: toolCount > 0
|
|
84
|
+
? `${toolCount} ${toolCount === 1 ? "tool" : "tools"}`
|
|
85
|
+
: "all tools",
|
|
86
|
+
},
|
|
87
|
+
children: [],
|
|
88
|
+
ref: { org: agentOrg, slug: access.mcpServer },
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
const saSkillNodes = sa.skillRefs.map((ref) => {
|
|
92
|
+
nodeCount++;
|
|
93
|
+
return {
|
|
94
|
+
id: `sub-agent:${sa.name}:skill:${ref.slug}`,
|
|
95
|
+
kind: "skill",
|
|
96
|
+
label: ref.slug,
|
|
97
|
+
qualifiedLabel: ref.org && ref.org !== agentOrg
|
|
98
|
+
? `${ref.org}/${ref.slug}`
|
|
99
|
+
: undefined,
|
|
100
|
+
children: [],
|
|
101
|
+
ref: { org: ref.org || agentOrg, slug: ref.slug },
|
|
102
|
+
};
|
|
103
|
+
});
|
|
104
|
+
const metadata = {};
|
|
105
|
+
if (sa.modelOverride) {
|
|
106
|
+
metadata.model = sa.modelOverride;
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
id: `sub-agent:${sa.name}`,
|
|
110
|
+
kind: "sub-agent",
|
|
111
|
+
label: sa.name,
|
|
112
|
+
description: sa.description || undefined,
|
|
113
|
+
metadata: Object.keys(metadata).length > 0 ? metadata : undefined,
|
|
114
|
+
children: [...saMcpNodes, ...saSkillNodes],
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
const root = {
|
|
118
|
+
id: `agent:${agentName}`,
|
|
119
|
+
kind: "agent",
|
|
120
|
+
label: agentName,
|
|
121
|
+
children: [...mcpNodes, ...skillNodes, ...subAgentNodes],
|
|
122
|
+
};
|
|
123
|
+
return {
|
|
124
|
+
tree: { root, nodeCount },
|
|
125
|
+
isEmpty: false,
|
|
126
|
+
};
|
|
127
|
+
}, [agentName, agentOrg, spec]);
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=useDependencyGraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDependencyGraph.js","sourceRoot":"","sources":["../../src/dependency-graph/useDependencyGraph.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAQhC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,SAAS,EACT,QAAQ,EACR,IAAI,GACsB;IAC1B,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,IAAI,CAAC,IAAI;YAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAEhD,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QAEvD,MAAM,OAAO,GACX,eAAe,CAAC,MAAM,GAAG,CAAC;YAC1B,SAAS,CAAC,MAAM,GAAG,CAAC;YACpB,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;QAEvB,IAAI,CAAC,OAAO;YAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAEnD,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC,OAAO;QAE1B,MAAM,QAAQ,GAAqB,eAAe;aAC/C,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC;aAC7B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACb,SAAS,EAAE,CAAC;YACZ,MAAM,GAAG,GAAG,KAAK,CAAC,YAAa,CAAC;YAChC,MAAM,SAAS,GAAG,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC;YAE5C,OAAO;gBACL,EAAE,EAAE,cAAc,GAAG,CAAC,IAAI,EAAE;gBAC5B,IAAI,EAAE,YAAqB;gBAC3B,KAAK,EAAE,GAAG,CAAC,IAAI;gBACf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J,CAAC,CAAC,CAAC;YAEH,MAAM,QAAQ,GAA2B,EAAE,CAAC;YAC5C,IAAI,EAAE,CAAC,aAAa,EAAE,CAAC;gBACrB,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAC,aAAa,CAAC;YACpC,CAAC;YAED,OAAO;gBACL,EAAE,EAAE,aAAa,EAAE,CAAC,IAAI,EAAE;gBAC1B,IAAI,EAAE,WAAoB;gBAC1B,KAAK,EAAE,EAAE,CAAC,IAAI;gBACd,WAAW,EAAE,EAAE,CAAC,WAAW,IAAI,SAAS;gBACxC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;gBACjE,QAAQ,EAAE,CAAC,GAAG,UAAU,EAAE,GAAG,YAAY,CAAC;aAC3C,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,MAAM,IAAI,GAAmB;YAC3B,EAAE,EAAE,SAAS,SAAS,EAAE;YACxB,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,SAAS;YAChB,QAAQ,EAAE,CAAC,GAAG,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,aAAa,CAAC;SACzD,CAAC;QAEF,OAAO;YACL,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;YACzB,OAAO,EAAE,KAAK;SACf,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { EmptyStateProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* A semantic, accessible empty state component supporting four distinct
|
|
4
|
+
* variants: first-use, zero-results, permission, and error.
|
|
5
|
+
*
|
|
6
|
+
* Each variant provides appropriate default icons, copy, and ARIA roles.
|
|
7
|
+
* All defaults can be overridden via props. The `icon` prop accepts any
|
|
8
|
+
* ReactNode for full visual customization.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <EmptyState
|
|
13
|
+
* variant="first-use"
|
|
14
|
+
* resourceLabel="agents"
|
|
15
|
+
* action={{ label: "Create agent", onClick: handleCreate }}
|
|
16
|
+
* />
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <EmptyState
|
|
22
|
+
* variant="error"
|
|
23
|
+
* errorMessage="Network request failed"
|
|
24
|
+
* action={{ label: "Retry", onClick: handleRetry }}
|
|
25
|
+
* />
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function EmptyState({ variant, resourceLabel, icon, title, description, errorMessage, action, children, className, }: EmptyStateProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
//# sourceMappingURL=EmptyState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../src/empty-state/EmptyState.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,aAAa,EACb,IAAI,EACJ,KAAK,EACL,WAAW,EACX,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,SAAS,GACV,EAAE,eAAe,2CA+CjB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
import { useEmptyState } from "./useEmptyState";
|
|
5
|
+
/**
|
|
6
|
+
* A semantic, accessible empty state component supporting four distinct
|
|
7
|
+
* variants: first-use, zero-results, permission, and error.
|
|
8
|
+
*
|
|
9
|
+
* Each variant provides appropriate default icons, copy, and ARIA roles.
|
|
10
|
+
* All defaults can be overridden via props. The `icon` prop accepts any
|
|
11
|
+
* ReactNode for full visual customization.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <EmptyState
|
|
16
|
+
* variant="first-use"
|
|
17
|
+
* resourceLabel="agents"
|
|
18
|
+
* action={{ label: "Create agent", onClick: handleCreate }}
|
|
19
|
+
* />
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <EmptyState
|
|
25
|
+
* variant="error"
|
|
26
|
+
* errorMessage="Network request failed"
|
|
27
|
+
* action={{ label: "Retry", onClick: handleRetry }}
|
|
28
|
+
* />
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export function EmptyState({ variant, resourceLabel, icon, title, description, errorMessage, action, children, className, }) {
|
|
32
|
+
const resolved = useEmptyState({
|
|
33
|
+
variant,
|
|
34
|
+
resourceLabel,
|
|
35
|
+
title,
|
|
36
|
+
description,
|
|
37
|
+
errorMessage,
|
|
38
|
+
});
|
|
39
|
+
return (_jsxs("div", { role: resolved.role, className: cn("flex flex-col items-center gap-3 py-12 text-center", className), children: [_jsx("div", { className: "text-muted-foreground-faint", children: icon ?? resolved.defaultIcon }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("p", { className: "text-sm font-medium text-muted-foreground", children: resolved.title }), _jsx("p", { className: "max-w-sm text-xs text-muted-foreground-subtle", children: resolved.description })] }), children
|
|
40
|
+
? _jsx("div", { className: "mt-1", children: children })
|
|
41
|
+
: action && (_jsx("button", { type: "button", onClick: action.onClick, className: cn("mt-1 inline-flex items-center rounded-md px-3 py-1.5 text-xs font-medium", variant === "error"
|
|
42
|
+
? "border border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground"
|
|
43
|
+
: "bg-primary text-primary-foreground hover:bg-primary-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"), children: action.label }))] }));
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=EmptyState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../../src/empty-state/EmptyState.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,OAAO,EACP,aAAa,EACb,IAAI,EACJ,KAAK,EACL,WAAW,EACX,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,SAAS,GACO;IAChB,MAAM,QAAQ,GAAG,aAAa,CAAC;QAC7B,OAAO;QACP,aAAa;QACb,KAAK;QACL,WAAW;QACX,YAAY;KACb,CAAC,CAAC;IAEH,OAAO,CACL,eACE,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,SAAS,EAAE,EAAE,CACX,oDAAoD,EACpD,SAAS,CACV,aAED,cAAK,SAAS,EAAC,6BAA6B,YACzC,IAAI,IAAI,QAAQ,CAAC,WAAW,GACzB,EACN,eAAK,SAAS,EAAC,qBAAqB,aAClC,YAAG,SAAS,EAAC,2CAA2C,YACrD,QAAQ,CAAC,KAAK,GACb,EACJ,YAAG,SAAS,EAAC,+CAA+C,YACzD,QAAQ,CAAC,WAAW,GACnB,IACA,EACL,QAAQ;gBACP,CAAC,CAAC,cAAK,SAAS,EAAC,MAAM,YAAE,QAAQ,GAAO;gBACxC,CAAC,CAAC,MAAM,IAAI,CACV,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,SAAS,EAAE,EAAE,CACX,0EAA0E,EAC1E,OAAO,KAAK,OAAO;wBACjB,CAAC,CAAC,gGAAgG;wBAClG,CAAC,CAAC,2DAA2D,EAC/D,yEAAyE,CAC1E,YAEA,MAAM,CAAC,KAAK,GACN,CACV,IACC,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/empty-state/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/empty-state/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Semantic variant for an empty state, each representing a distinct
|
|
4
|
+
* reason why no content is visible.
|
|
5
|
+
*/
|
|
6
|
+
export type EmptyStateVariant = "first-use" | "zero-results" | "permission" | "error";
|
|
7
|
+
/** Action rendered as a button within the empty state. */
|
|
8
|
+
export interface EmptyStateAction {
|
|
9
|
+
/** Button label. */
|
|
10
|
+
readonly label: string;
|
|
11
|
+
/** Click handler. */
|
|
12
|
+
readonly onClick: () => void;
|
|
13
|
+
}
|
|
14
|
+
/** Options for the {@link useEmptyState} behavior hook. */
|
|
15
|
+
export interface UseEmptyStateOptions {
|
|
16
|
+
/** The semantic reason no content is shown. */
|
|
17
|
+
readonly variant: EmptyStateVariant;
|
|
18
|
+
/**
|
|
19
|
+
* Human-readable label for the resource type (e.g. "agents", "skills").
|
|
20
|
+
* Used to generate contextual default copy.
|
|
21
|
+
*/
|
|
22
|
+
readonly resourceLabel?: string;
|
|
23
|
+
/** Custom title override. When provided, replaces the generated default. */
|
|
24
|
+
readonly title?: string;
|
|
25
|
+
/** Custom description override. When provided, replaces the generated default. */
|
|
26
|
+
readonly description?: string;
|
|
27
|
+
/** Error message to display — relevant for the "error" variant. */
|
|
28
|
+
readonly errorMessage?: string;
|
|
29
|
+
}
|
|
30
|
+
/** Return value of the {@link useEmptyState} behavior hook. */
|
|
31
|
+
export interface UseEmptyStateReturn {
|
|
32
|
+
/** Resolved title text. */
|
|
33
|
+
readonly title: string;
|
|
34
|
+
/** Resolved description text. */
|
|
35
|
+
readonly description: string;
|
|
36
|
+
/** Suggested default icon for the variant (as a ReactNode). */
|
|
37
|
+
readonly defaultIcon: ReactNode;
|
|
38
|
+
/** The ARIA role appropriate for this variant. */
|
|
39
|
+
readonly role: "status" | "alert";
|
|
40
|
+
}
|
|
41
|
+
/** Props for the styled {@link EmptyState} component. */
|
|
42
|
+
export interface EmptyStateProps {
|
|
43
|
+
/**
|
|
44
|
+
* The semantic reason no content is shown.
|
|
45
|
+
* Determines default icon, copy, and ARIA role.
|
|
46
|
+
*/
|
|
47
|
+
readonly variant: EmptyStateVariant;
|
|
48
|
+
/**
|
|
49
|
+
* Human-readable label for the resource type (e.g. "agents", "skills").
|
|
50
|
+
* Used to generate contextual default copy.
|
|
51
|
+
*/
|
|
52
|
+
readonly resourceLabel?: string;
|
|
53
|
+
/** Custom icon to display. Defaults to a variant-appropriate Lucide icon. */
|
|
54
|
+
readonly icon?: ReactNode;
|
|
55
|
+
/** Custom title override. */
|
|
56
|
+
readonly title?: string;
|
|
57
|
+
/** Custom description override. */
|
|
58
|
+
readonly description?: string;
|
|
59
|
+
/** Error message — only used when variant is "error". */
|
|
60
|
+
readonly errorMessage?: string;
|
|
61
|
+
/** Primary action button. */
|
|
62
|
+
readonly action?: EmptyStateAction;
|
|
63
|
+
/**
|
|
64
|
+
* Custom action slot content. When provided, renders in the action
|
|
65
|
+
* area (centered, below the description) instead of the `action` button.
|
|
66
|
+
* Use this when you need full control over the CTA element — e.g. a
|
|
67
|
+
* `<Link>` for client-side routing or a button with an icon.
|
|
68
|
+
*/
|
|
69
|
+
readonly children?: ReactNode;
|
|
70
|
+
/** Additional CSS classes for the root container. */
|
|
71
|
+
readonly className?: string;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/empty-state/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GACzB,WAAW,GACX,cAAc,GACd,YAAY,GACZ,OAAO,CAAC;AAEZ,0DAA0D;AAC1D,MAAM,WAAW,gBAAgB;IAC/B,oBAAoB;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qBAAqB;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,2DAA2D;AAC3D,MAAM,WAAW,oBAAoB;IACnC,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,kFAAkF;IAClF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,mEAAmE;IACnE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,+DAA+D;AAC/D,MAAM,WAAW,mBAAmB;IAClC,2BAA2B;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,iCAAiC;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,+DAA+D;IAC/D,QAAQ,CAAC,WAAW,EAAE,SAAS,CAAC;IAChC,kDAAkD;IAClD,QAAQ,CAA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