@stigmer/react 0.4.8 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action-menu/ActionMenu.d.ts +64 -0
- package/action-menu/ActionMenu.d.ts.map +1 -0
- package/action-menu/ActionMenu.js +78 -0
- package/action-menu/ActionMenu.js.map +1 -0
- package/action-menu/index.d.ts +3 -0
- package/action-menu/index.d.ts.map +1 -0
- package/action-menu/index.js +2 -0
- package/action-menu/index.js.map +1 -0
- package/action-menu/types.d.ts +65 -0
- package/action-menu/types.d.ts.map +1 -0
- package/action-menu/types.js +2 -0
- package/action-menu/types.js.map +1 -0
- package/agent/AgentCreationWizard.d.ts +55 -0
- package/agent/AgentCreationWizard.d.ts.map +1 -0
- package/agent/AgentCreationWizard.js +115 -0
- package/agent/AgentCreationWizard.js.map +1 -0
- package/agent/AgentDetailView.d.ts +77 -9
- package/agent/AgentDetailView.d.ts.map +1 -1
- package/agent/AgentDetailView.js +265 -87
- package/agent/AgentDetailView.js.map +1 -1
- package/agent/index.d.ts +8 -0
- package/agent/index.d.ts.map +1 -1
- package/agent/index.js +4 -0
- package/agent/index.js.map +1 -1
- package/agent/internal/agentToInput.d.ts +12 -0
- package/agent/internal/agentToInput.d.ts.map +1 -0
- package/agent/internal/agentToInput.js +72 -0
- package/agent/internal/agentToInput.js.map +1 -0
- package/agent/steps/CapabilitiesStep.d.ts +16 -0
- package/agent/steps/CapabilitiesStep.d.ts.map +1 -0
- package/agent/steps/CapabilitiesStep.js +80 -0
- package/agent/steps/CapabilitiesStep.js.map +1 -0
- package/agent/steps/IdentityStep.d.ts +18 -0
- package/agent/steps/IdentityStep.d.ts.map +1 -0
- package/agent/steps/IdentityStep.js +43 -0
- package/agent/steps/IdentityStep.js.map +1 -0
- package/agent/steps/ReviewStep.d.ts +23 -0
- package/agent/steps/ReviewStep.d.ts.map +1 -0
- package/agent/steps/ReviewStep.js +73 -0
- package/agent/steps/ReviewStep.js.map +1 -0
- package/agent/steps/types.d.ts +35 -0
- package/agent/steps/types.d.ts.map +1 -0
- package/agent/steps/types.js +16 -0
- package/agent/steps/types.js.map +1 -0
- package/agent/useCreateAgent.d.ts +45 -0
- package/agent/useCreateAgent.d.ts.map +1 -0
- package/agent/useCreateAgent.js +50 -0
- package/agent/useCreateAgent.js.map +1 -0
- package/agent/useUpdateAgent.d.ts +24 -0
- package/agent/useUpdateAgent.d.ts.map +1 -0
- package/agent/useUpdateAgent.js +35 -0
- package/agent/useUpdateAgent.js.map +1 -0
- package/dependency-graph/DependencyGraph.d.ts +37 -0
- package/dependency-graph/DependencyGraph.d.ts.map +1 -0
- package/dependency-graph/DependencyGraph.js +88 -0
- package/dependency-graph/DependencyGraph.js.map +1 -0
- package/dependency-graph/DependencyTreeNode.d.ts +23 -0
- package/dependency-graph/DependencyTreeNode.d.ts.map +1 -0
- package/dependency-graph/DependencyTreeNode.js +99 -0
- package/dependency-graph/DependencyTreeNode.js.map +1 -0
- package/dependency-graph/index.d.ts +4 -0
- package/dependency-graph/index.d.ts.map +1 -0
- package/dependency-graph/index.js +5 -0
- package/dependency-graph/index.js.map +1 -0
- package/dependency-graph/types.d.ts +130 -0
- package/dependency-graph/types.d.ts.map +1 -0
- package/dependency-graph/types.js +2 -0
- package/dependency-graph/types.js.map +1 -0
- package/dependency-graph/useDependencyGraph.d.ts +27 -0
- package/dependency-graph/useDependencyGraph.d.ts.map +1 -0
- package/dependency-graph/useDependencyGraph.js +129 -0
- package/dependency-graph/useDependencyGraph.js.map +1 -0
- package/empty-state/EmptyState.d.ts +29 -0
- package/empty-state/EmptyState.d.ts.map +1 -0
- package/empty-state/EmptyState.js +45 -0
- package/empty-state/EmptyState.js.map +1 -0
- package/empty-state/index.d.ts +4 -0
- package/empty-state/index.d.ts.map +1 -0
- package/empty-state/index.js +3 -0
- package/empty-state/index.js.map +1 -0
- package/empty-state/types.d.ts +73 -0
- package/empty-state/types.d.ts.map +1 -0
- package/empty-state/types.js +2 -0
- package/empty-state/types.js.map +1 -0
- package/empty-state/useEmptyState.d.ts +18 -0
- package/empty-state/useEmptyState.d.ts.map +1 -0
- package/empty-state/useEmptyState.js +72 -0
- package/empty-state/useEmptyState.js.map +1 -0
- package/feedback/StigmerToaster.d.ts +18 -0
- package/feedback/StigmerToaster.d.ts.map +1 -0
- package/feedback/StigmerToaster.js +31 -0
- package/feedback/StigmerToaster.js.map +1 -0
- package/feedback/index.d.ts +4 -0
- package/feedback/index.d.ts.map +1 -0
- package/feedback/index.js +3 -0
- package/feedback/index.js.map +1 -0
- package/feedback/toast.d.ts +14 -0
- package/feedback/toast.d.ts.map +1 -0
- package/feedback/toast.js +14 -0
- package/feedback/toast.js.map +1 -0
- package/feedback/types.d.ts +4 -0
- package/feedback/types.d.ts.map +1 -0
- package/feedback/types.js +2 -0
- package/feedback/types.js.map +1 -0
- package/index.d.ts +30 -10
- package/index.d.ts.map +1 -1
- package/index.js +29 -9
- package/index.js.map +1 -1
- package/inline-edit/InlineEditImage.d.ts +20 -0
- package/inline-edit/InlineEditImage.d.ts.map +1 -0
- package/inline-edit/InlineEditImage.js +85 -0
- package/inline-edit/InlineEditImage.js.map +1 -0
- package/inline-edit/InlineEditKeyValue.d.ts +29 -0
- package/inline-edit/InlineEditKeyValue.d.ts.map +1 -0
- package/inline-edit/InlineEditKeyValue.js +67 -0
- package/inline-edit/InlineEditKeyValue.js.map +1 -0
- package/inline-edit/InlineEditResourceList.d.ts +34 -0
- package/inline-edit/InlineEditResourceList.d.ts.map +1 -0
- package/inline-edit/InlineEditResourceList.js +99 -0
- package/inline-edit/InlineEditResourceList.js.map +1 -0
- package/inline-edit/InlineEditSelect.d.ts +18 -0
- package/inline-edit/InlineEditSelect.d.ts.map +1 -0
- package/inline-edit/InlineEditSelect.js +54 -0
- package/inline-edit/InlineEditSelect.js.map +1 -0
- package/inline-edit/InlineEditText.d.ts +23 -0
- package/inline-edit/InlineEditText.d.ts.map +1 -0
- package/inline-edit/InlineEditText.js +79 -0
- package/inline-edit/InlineEditText.js.map +1 -0
- package/inline-edit/InlineEditTextarea.d.ts +22 -0
- package/inline-edit/InlineEditTextarea.d.ts.map +1 -0
- package/inline-edit/InlineEditTextarea.js +83 -0
- package/inline-edit/InlineEditTextarea.js.map +1 -0
- package/inline-edit/index.d.ts +16 -0
- package/inline-edit/index.d.ts.map +1 -0
- package/inline-edit/index.js +8 -0
- package/inline-edit/index.js.map +1 -0
- package/inline-edit/types.d.ts +42 -0
- package/inline-edit/types.d.ts.map +1 -0
- package/inline-edit/types.js +2 -0
- package/inline-edit/types.js.map +1 -0
- package/inline-edit/useInlineFieldSave.d.ts +23 -0
- package/inline-edit/useInlineFieldSave.d.ts.map +1 -0
- package/inline-edit/useInlineFieldSave.js +44 -0
- package/inline-edit/useInlineFieldSave.js.map +1 -0
- package/internal/Tabs.d.ts +4 -38
- package/internal/Tabs.d.ts.map +1 -1
- package/internal/Tabs.js +3 -62
- package/internal/Tabs.js.map +1 -1
- package/library/ImportResourceDialog.d.ts +43 -0
- package/library/ImportResourceDialog.d.ts.map +1 -0
- package/library/ImportResourceDialog.js +90 -0
- package/library/ImportResourceDialog.js.map +1 -0
- package/library/index.d.ts +7 -4
- package/library/index.d.ts.map +1 -1
- package/library/index.js +4 -2
- package/library/index.js.map +1 -1
- package/library/serialize-resource-yaml.d.ts +53 -0
- package/library/serialize-resource-yaml.d.ts.map +1 -1
- package/library/serialize-resource-yaml.js +275 -0
- package/library/serialize-resource-yaml.js.map +1 -1
- package/library/useExportResource.d.ts +56 -0
- package/library/useExportResource.d.ts.map +1 -0
- package/library/useExportResource.js +137 -0
- package/library/useExportResource.js.map +1 -0
- package/library/useImportResource.d.ts +84 -0
- package/library/useImportResource.d.ts.map +1 -0
- package/library/useImportResource.js +188 -0
- package/library/useImportResource.js.map +1 -0
- package/mcp-server/McpServerCreationWizard.d.ts +55 -0
- package/mcp-server/McpServerCreationWizard.d.ts.map +1 -0
- package/mcp-server/McpServerCreationWizard.js +121 -0
- package/mcp-server/McpServerCreationWizard.js.map +1 -0
- package/mcp-server/McpServerDetailView.d.ts +21 -1
- package/mcp-server/McpServerDetailView.d.ts.map +1 -1
- package/mcp-server/McpServerDetailView.js +113 -20
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/mcp-server/index.d.ts +8 -0
- package/mcp-server/index.d.ts.map +1 -1
- package/mcp-server/index.js +4 -0
- package/mcp-server/index.js.map +1 -1
- package/mcp-server/internal/mcpServerToInput.d.ts +12 -0
- package/mcp-server/internal/mcpServerToInput.d.ts.map +1 -0
- package/mcp-server/internal/mcpServerToInput.js +81 -0
- package/mcp-server/internal/mcpServerToInput.js.map +1 -0
- package/mcp-server/steps/EnvironmentAuthStep.d.ts +15 -0
- package/mcp-server/steps/EnvironmentAuthStep.d.ts.map +1 -0
- package/mcp-server/steps/EnvironmentAuthStep.js +55 -0
- package/mcp-server/steps/EnvironmentAuthStep.js.map +1 -0
- package/mcp-server/steps/IdentityTransportStep.d.ts +19 -0
- package/mcp-server/steps/IdentityTransportStep.d.ts.map +1 -0
- package/mcp-server/steps/IdentityTransportStep.js +73 -0
- package/mcp-server/steps/IdentityTransportStep.js.map +1 -0
- package/mcp-server/steps/ReviewStep.d.ts +23 -0
- package/mcp-server/steps/ReviewStep.d.ts.map +1 -0
- package/mcp-server/steps/ReviewStep.js +137 -0
- package/mcp-server/steps/ReviewStep.js.map +1 -0
- package/mcp-server/steps/types.d.ts +56 -0
- package/mcp-server/steps/types.d.ts.map +1 -0
- package/mcp-server/steps/types.js +27 -0
- package/mcp-server/steps/types.js.map +1 -0
- package/mcp-server/useCreateMcpServer.d.ts +45 -0
- package/mcp-server/useCreateMcpServer.d.ts.map +1 -0
- package/mcp-server/useCreateMcpServer.js +50 -0
- package/mcp-server/useCreateMcpServer.js.map +1 -0
- package/mcp-server/useUpdateMcpServer.d.ts +24 -0
- package/mcp-server/useUpdateMcpServer.d.ts.map +1 -0
- package/mcp-server/useUpdateMcpServer.js +35 -0
- package/mcp-server/useUpdateMcpServer.js.map +1 -0
- package/package.json +8 -4
- package/resource-creation/CreationPicker.d.ts +60 -0
- package/resource-creation/CreationPicker.d.ts.map +1 -0
- package/resource-creation/CreationPicker.js +74 -0
- package/resource-creation/CreationPicker.js.map +1 -0
- package/resource-creation/StepIndicator.d.ts +28 -0
- package/resource-creation/StepIndicator.d.ts.map +1 -0
- package/resource-creation/StepIndicator.js +40 -0
- package/resource-creation/StepIndicator.js.map +1 -0
- package/resource-creation/TemplateCard.d.ts +24 -0
- package/resource-creation/TemplateCard.d.ts.map +1 -0
- package/resource-creation/TemplateCard.js +68 -0
- package/resource-creation/TemplateCard.js.map +1 -0
- package/resource-creation/TemplateGallery.d.ts +43 -0
- package/resource-creation/TemplateGallery.d.ts.map +1 -0
- package/resource-creation/TemplateGallery.js +78 -0
- package/resource-creation/TemplateGallery.js.map +1 -0
- package/resource-creation/WizardNav.d.ts +31 -0
- package/resource-creation/WizardNav.d.ts.map +1 -0
- package/resource-creation/WizardNav.js +29 -0
- package/resource-creation/WizardNav.js.map +1 -0
- package/resource-creation/WizardShell.d.ts +41 -0
- package/resource-creation/WizardShell.d.ts.map +1 -0
- package/resource-creation/WizardShell.js +55 -0
- package/resource-creation/WizardShell.js.map +1 -0
- package/resource-creation/index.d.ts +21 -0
- package/resource-creation/index.d.ts.map +1 -0
- package/resource-creation/index.js +14 -0
- package/resource-creation/index.js.map +1 -0
- package/resource-creation/templates/agent-templates.d.ts +15 -0
- package/resource-creation/templates/agent-templates.d.ts.map +1 -0
- package/resource-creation/templates/agent-templates.js +148 -0
- package/resource-creation/templates/agent-templates.js.map +1 -0
- package/resource-creation/templates/index.d.ts +5 -0
- package/resource-creation/templates/index.d.ts.map +1 -0
- package/resource-creation/templates/index.js +5 -0
- package/resource-creation/templates/index.js.map +1 -0
- package/resource-creation/templates/mcp-server-templates.d.ts +15 -0
- package/resource-creation/templates/mcp-server-templates.d.ts.map +1 -0
- package/resource-creation/templates/mcp-server-templates.js +92 -0
- package/resource-creation/templates/mcp-server-templates.js.map +1 -0
- package/resource-creation/templates/types.d.ts +48 -0
- package/resource-creation/templates/types.d.ts.map +1 -0
- package/resource-creation/templates/types.js +16 -0
- package/resource-creation/templates/types.js.map +1 -0
- package/resource-creation/types.d.ts +88 -0
- package/resource-creation/types.d.ts.map +1 -0
- package/resource-creation/types.js +2 -0
- package/resource-creation/types.js.map +1 -0
- package/resource-creation/useTemplateFilter.d.ts +43 -0
- package/resource-creation/useTemplateFilter.d.ts.map +1 -0
- package/resource-creation/useTemplateFilter.js +73 -0
- package/resource-creation/useTemplateFilter.js.map +1 -0
- package/resource-creation/useWizardState.d.ts +67 -0
- package/resource-creation/useWizardState.d.ts.map +1 -0
- package/resource-creation/useWizardState.js +143 -0
- package/resource-creation/useWizardState.js.map +1 -0
- package/resource-detail/ConfirmDialog.d.ts +44 -0
- package/resource-detail/ConfirmDialog.d.ts.map +1 -0
- package/resource-detail/ConfirmDialog.js +62 -0
- package/resource-detail/ConfirmDialog.js.map +1 -0
- package/resource-detail/ResourceActionBar.d.ts +42 -0
- package/resource-detail/ResourceActionBar.d.ts.map +1 -0
- package/resource-detail/ResourceActionBar.js +64 -0
- package/resource-detail/ResourceActionBar.js.map +1 -0
- package/resource-detail/ResourceDetailShell.d.ts +36 -0
- package/resource-detail/ResourceDetailShell.d.ts.map +1 -0
- package/resource-detail/ResourceDetailShell.js +65 -0
- package/resource-detail/ResourceDetailShell.js.map +1 -0
- package/resource-detail/Section.d.ts +18 -0
- package/resource-detail/Section.d.ts.map +1 -0
- package/resource-detail/Section.js +18 -0
- package/resource-detail/Section.js.map +1 -0
- package/resource-detail/index.d.ts +15 -0
- package/resource-detail/index.d.ts.map +1 -0
- package/resource-detail/index.js +10 -0
- package/resource-detail/index.js.map +1 -0
- package/resource-detail/types.d.ts +146 -0
- package/resource-detail/types.d.ts.map +1 -0
- package/resource-detail/types.js +2 -0
- package/resource-detail/types.js.map +1 -0
- package/resource-detail/useConfirmAction.d.ts +41 -0
- package/resource-detail/useConfirmAction.d.ts.map +1 -0
- package/resource-detail/useConfirmAction.js +30 -0
- package/resource-detail/useConfirmAction.js.map +1 -0
- package/resource-detail/useCopyResource.d.ts +28 -0
- package/resource-detail/useCopyResource.d.ts.map +1 -0
- package/resource-detail/useCopyResource.js +46 -0
- package/resource-detail/useCopyResource.js.map +1 -0
- package/resource-detail/useDeleteResource.d.ts +40 -0
- package/resource-detail/useDeleteResource.d.ts.map +1 -0
- package/resource-detail/useDeleteResource.js +83 -0
- package/resource-detail/useDeleteResource.js.map +1 -0
- package/resource-detail/useDetailTabs.d.ts +46 -0
- package/resource-detail/useDetailTabs.d.ts.map +1 -0
- package/resource-detail/useDetailTabs.js +47 -0
- package/resource-detail/useDetailTabs.js.map +1 -0
- package/resource-workbench/components/BulkActionBar.d.ts +36 -0
- package/resource-workbench/components/BulkActionBar.d.ts.map +1 -0
- package/resource-workbench/components/BulkActionBar.js +35 -0
- package/resource-workbench/components/BulkActionBar.js.map +1 -0
- package/resource-workbench/components/ColumnHeader.d.ts +23 -0
- package/resource-workbench/components/ColumnHeader.d.ts.map +1 -0
- package/resource-workbench/components/ColumnHeader.js +25 -0
- package/resource-workbench/components/ColumnHeader.js.map +1 -0
- package/resource-workbench/components/FilterBar.d.ts +33 -0
- package/resource-workbench/components/FilterBar.d.ts.map +1 -0
- package/resource-workbench/components/FilterBar.js +72 -0
- package/resource-workbench/components/FilterBar.js.map +1 -0
- package/resource-workbench/components/ResourceAvatar.d.ts +29 -0
- package/resource-workbench/components/ResourceAvatar.d.ts.map +1 -0
- package/resource-workbench/components/ResourceAvatar.js +51 -0
- package/resource-workbench/components/ResourceAvatar.js.map +1 -0
- package/resource-workbench/components/ResourceCards.d.ts +39 -0
- package/resource-workbench/components/ResourceCards.d.ts.map +1 -0
- package/resource-workbench/components/ResourceCards.js +41 -0
- package/resource-workbench/components/ResourceCards.js.map +1 -0
- package/resource-workbench/components/ResourceInspector.d.ts +26 -0
- package/resource-workbench/components/ResourceInspector.d.ts.map +1 -0
- package/resource-workbench/components/ResourceInspector.js +22 -0
- package/resource-workbench/components/ResourceInspector.js.map +1 -0
- package/resource-workbench/components/ResourceList.d.ts +39 -0
- package/resource-workbench/components/ResourceList.d.ts.map +1 -0
- package/resource-workbench/components/ResourceList.js +41 -0
- package/resource-workbench/components/ResourceList.js.map +1 -0
- package/resource-workbench/components/ResourceTable.d.ts +47 -0
- package/resource-workbench/components/ResourceTable.d.ts.map +1 -0
- package/resource-workbench/components/ResourceTable.js +78 -0
- package/resource-workbench/components/ResourceTable.js.map +1 -0
- package/resource-workbench/components/ResourceWorkbench.d.ts +131 -0
- package/resource-workbench/components/ResourceWorkbench.d.ts.map +1 -0
- package/resource-workbench/components/ResourceWorkbench.js +170 -0
- package/resource-workbench/components/ResourceWorkbench.js.map +1 -0
- package/resource-workbench/components/SelectionCheckbox.d.ts +24 -0
- package/resource-workbench/components/SelectionCheckbox.d.ts.map +1 -0
- package/resource-workbench/components/SelectionCheckbox.js +16 -0
- package/resource-workbench/components/SelectionCheckbox.js.map +1 -0
- package/resource-workbench/components/StatusBadge.d.ts +31 -0
- package/resource-workbench/components/StatusBadge.d.ts.map +1 -0
- package/resource-workbench/components/StatusBadge.js +75 -0
- package/resource-workbench/components/StatusBadge.js.map +1 -0
- package/resource-workbench/components/ViewSwitcher.d.ts +21 -0
- package/resource-workbench/components/ViewSwitcher.d.ts.map +1 -0
- package/resource-workbench/components/ViewSwitcher.js +37 -0
- package/resource-workbench/components/ViewSwitcher.js.map +1 -0
- package/resource-workbench/hooks/useResourceCollection.d.ts +93 -0
- package/resource-workbench/hooks/useResourceCollection.d.ts.map +1 -0
- package/resource-workbench/hooks/useResourceCollection.js +133 -0
- package/resource-workbench/hooks/useResourceCollection.js.map +1 -0
- package/resource-workbench/hooks/useResourceFilters.d.ts +73 -0
- package/resource-workbench/hooks/useResourceFilters.d.ts.map +1 -0
- package/resource-workbench/hooks/useResourceFilters.js +105 -0
- package/resource-workbench/hooks/useResourceFilters.js.map +1 -0
- package/resource-workbench/hooks/useResourceSelection.d.ts +44 -0
- package/resource-workbench/hooks/useResourceSelection.d.ts.map +1 -0
- package/resource-workbench/hooks/useResourceSelection.js +123 -0
- package/resource-workbench/hooks/useResourceSelection.js.map +1 -0
- package/resource-workbench/hooks/useViewPreference.d.ts +32 -0
- package/resource-workbench/hooks/useViewPreference.d.ts.map +1 -0
- package/resource-workbench/hooks/useViewPreference.js +60 -0
- package/resource-workbench/hooks/useViewPreference.js.map +1 -0
- package/resource-workbench/index.d.ts +34 -0
- package/resource-workbench/index.d.ts.map +1 -0
- package/resource-workbench/index.js +19 -0
- package/resource-workbench/index.js.map +1 -0
- package/resource-workbench/types.d.ts +165 -0
- package/resource-workbench/types.d.ts.map +1 -0
- package/resource-workbench/types.js +2 -0
- package/resource-workbench/types.js.map +1 -0
- package/runner/RunnerDetailView.d.ts +44 -0
- package/runner/RunnerDetailView.d.ts.map +1 -0
- package/runner/RunnerDetailView.js +154 -0
- package/runner/RunnerDetailView.js.map +1 -0
- package/runner/RunnerListPanel.d.ts +26 -1
- package/runner/RunnerListPanel.d.ts.map +1 -1
- package/runner/RunnerListPanel.js +68 -46
- package/runner/RunnerListPanel.js.map +1 -1
- package/runner/index.d.ts +7 -1
- package/runner/index.d.ts.map +1 -1
- package/runner/index.js +3 -0
- package/runner/index.js.map +1 -1
- package/runner/shared.d.ts +31 -0
- package/runner/shared.d.ts.map +1 -0
- package/runner/shared.js +55 -0
- package/runner/shared.js.map +1 -0
- package/runner/useRunner.d.ts +37 -0
- package/runner/useRunner.d.ts.map +1 -0
- package/runner/useRunner.js +24 -0
- package/runner/useRunner.js.map +1 -0
- package/session/__tests__/group-sessions.test.js +3 -3
- package/session/__tests__/group-sessions.test.js.map +1 -1
- package/skill/SkillDetailView.d.ts +70 -7
- package/skill/SkillDetailView.d.ts.map +1 -1
- package/skill/SkillDetailView.js +107 -39
- package/skill/SkillDetailView.js.map +1 -1
- package/skill/SkillDiffDialog.d.ts +42 -0
- package/skill/SkillDiffDialog.d.ts.map +1 -0
- package/skill/SkillDiffDialog.js +72 -0
- package/skill/SkillDiffDialog.js.map +1 -0
- package/skill/SkillFileBrowser.d.ts +31 -0
- package/skill/SkillFileBrowser.d.ts.map +1 -0
- package/skill/SkillFileBrowser.js +105 -0
- package/skill/SkillFileBrowser.js.map +1 -0
- package/skill/SkillUploader.d.ts +39 -0
- package/skill/SkillUploader.d.ts.map +1 -0
- package/skill/SkillUploader.js +141 -0
- package/skill/SkillUploader.js.map +1 -0
- package/skill/index.d.ts +18 -0
- package/skill/index.d.ts.map +1 -1
- package/skill/index.js +9 -0
- package/skill/index.js.map +1 -1
- package/skill/internal/computeArtifactHash.d.ts +9 -0
- package/skill/internal/computeArtifactHash.d.ts.map +1 -0
- package/skill/internal/computeArtifactHash.js +14 -0
- package/skill/internal/computeArtifactHash.js.map +1 -0
- package/skill/internal/fetchAndUnpackArtifact.d.ts +16 -0
- package/skill/internal/fetchAndUnpackArtifact.d.ts.map +1 -0
- package/skill/internal/fetchAndUnpackArtifact.js +34 -0
- package/skill/internal/fetchAndUnpackArtifact.js.map +1 -0
- package/skill/usePushSkill.d.ts +53 -0
- package/skill/usePushSkill.d.ts.map +1 -0
- package/skill/usePushSkill.js +57 -0
- package/skill/usePushSkill.js.map +1 -0
- package/skill/useSkillArtifact.d.ts +37 -0
- package/skill/useSkillArtifact.d.ts.map +1 -0
- package/skill/useSkillArtifact.js +76 -0
- package/skill/useSkillArtifact.js.map +1 -0
- package/skill/useSkillDiff.d.ts +31 -0
- package/skill/useSkillDiff.d.ts.map +1 -0
- package/skill/useSkillDiff.js +97 -0
- package/skill/useSkillDiff.js.map +1 -0
- package/skill/useSkillDuplicateCheck.d.ts +34 -0
- package/skill/useSkillDuplicateCheck.d.ts.map +1 -0
- package/skill/useSkillDuplicateCheck.js +58 -0
- package/skill/useSkillDuplicateCheck.js.map +1 -0
- package/skill/useSkillUpload.d.ts +69 -0
- package/skill/useSkillUpload.d.ts.map +1 -0
- package/skill/useSkillUpload.js +157 -0
- package/skill/useSkillUpload.js.map +1 -0
- package/skill/useSkillVersions.d.ts +46 -0
- package/skill/useSkillVersions.d.ts.map +1 -0
- package/skill/useSkillVersions.js +104 -0
- package/skill/useSkillVersions.js.map +1 -0
- package/src/action-menu/ActionMenu.tsx +151 -0
- package/src/action-menu/index.ts +9 -0
- package/src/action-menu/types.ts +70 -0
- package/src/agent/AgentCreationWizard.tsx +201 -0
- package/src/agent/AgentDetailView.tsx +817 -321
- package/src/agent/index.ts +16 -0
- package/src/agent/internal/agentToInput.ts +95 -0
- package/src/agent/steps/CapabilitiesStep.tsx +363 -0
- package/src/agent/steps/IdentityStep.tsx +259 -0
- package/src/agent/steps/ReviewStep.tsx +211 -0
- package/src/agent/steps/types.ts +53 -0
- package/src/agent/useCreateAgent.ts +76 -0
- package/src/agent/useUpdateAgent.ts +55 -0
- package/src/dependency-graph/DependencyGraph.tsx +153 -0
- package/src/dependency-graph/DependencyTreeNode.tsx +282 -0
- package/src/dependency-graph/index.ts +15 -0
- package/src/dependency-graph/types.ts +131 -0
- package/src/dependency-graph/useDependencyGraph.ts +158 -0
- package/src/empty-state/EmptyState.tsx +90 -0
- package/src/empty-state/index.ts +9 -0
- package/src/empty-state/types.ts +81 -0
- package/src/empty-state/useEmptyState.ts +85 -0
- package/src/feedback/StigmerToaster.tsx +45 -0
- package/src/feedback/index.ts +3 -0
- package/src/feedback/toast.ts +13 -0
- package/src/feedback/types.ts +7 -0
- package/src/index.ts +270 -8
- package/src/inline-edit/InlineEditImage.tsx +208 -0
- package/src/inline-edit/InlineEditKeyValue.tsx +278 -0
- package/src/inline-edit/InlineEditResourceList.tsx +325 -0
- package/src/inline-edit/InlineEditSelect.tsx +150 -0
- package/src/inline-edit/InlineEditText.tsx +211 -0
- package/src/inline-edit/InlineEditTextarea.tsx +209 -0
- package/src/inline-edit/index.ts +28 -0
- package/src/inline-edit/types.ts +47 -0
- package/src/inline-edit/useInlineFieldSave.ts +62 -0
- package/src/internal/Tabs.tsx +4 -164
- package/src/library/ImportResourceDialog.tsx +227 -0
- package/src/library/index.ts +18 -8
- package/src/library/serialize-resource-yaml.ts +356 -0
- package/src/library/useExportResource.ts +183 -0
- package/src/library/useImportResource.ts +253 -0
- package/src/mcp-server/McpServerCreationWizard.tsx +206 -0
- package/src/mcp-server/McpServerDetailView.tsx +392 -105
- package/src/mcp-server/index.ts +16 -0
- package/src/mcp-server/internal/mcpServerToInput.ts +95 -0
- package/src/mcp-server/steps/EnvironmentAuthStep.tsx +462 -0
- package/src/mcp-server/steps/IdentityTransportStep.tsx +531 -0
- package/src/mcp-server/steps/ReviewStep.tsx +297 -0
- package/src/mcp-server/steps/types.ts +85 -0
- package/src/mcp-server/useCreateMcpServer.ts +76 -0
- package/src/mcp-server/useUpdateMcpServer.ts +55 -0
- package/src/resource-creation/CreationPicker.tsx +292 -0
- package/src/resource-creation/StepIndicator.tsx +156 -0
- package/src/resource-creation/TemplateCard.tsx +143 -0
- package/src/resource-creation/TemplateGallery.tsx +222 -0
- package/src/resource-creation/WizardNav.tsx +163 -0
- package/src/resource-creation/WizardShell.tsx +124 -0
- package/src/resource-creation/index.ts +45 -0
- package/src/resource-creation/templates/agent-templates.ts +160 -0
- package/src/resource-creation/templates/index.ts +7 -0
- package/src/resource-creation/templates/mcp-server-templates.ts +106 -0
- package/src/resource-creation/templates/types.ts +64 -0
- package/src/resource-creation/types.ts +105 -0
- package/src/resource-creation/useTemplateFilter.ts +117 -0
- package/src/resource-creation/useWizardState.ts +223 -0
- package/src/resource-detail/ConfirmDialog.tsx +127 -0
- package/src/resource-detail/ResourceActionBar.tsx +157 -0
- package/src/resource-detail/ResourceDetailShell.tsx +184 -0
- package/src/resource-detail/Section.tsx +78 -0
- package/src/resource-detail/index.ts +34 -0
- package/src/resource-detail/types.ts +177 -0
- package/src/resource-detail/useConfirmAction.ts +70 -0
- package/src/resource-detail/useCopyResource.ts +74 -0
- package/src/resource-detail/useDeleteResource.ts +110 -0
- package/src/resource-detail/useDetailTabs.ts +93 -0
- package/src/resource-workbench/components/BulkActionBar.tsx +122 -0
- package/src/resource-workbench/components/ColumnHeader.tsx +105 -0
- package/src/resource-workbench/components/FilterBar.tsx +173 -0
- package/src/resource-workbench/components/ResourceAvatar.tsx +109 -0
- package/src/resource-workbench/components/ResourceCards.tsx +126 -0
- package/src/resource-workbench/components/ResourceInspector.tsx +88 -0
- package/src/resource-workbench/components/ResourceList.tsx +121 -0
- package/src/resource-workbench/components/ResourceTable.tsx +222 -0
- package/src/resource-workbench/components/ResourceWorkbench.tsx +695 -0
- package/src/resource-workbench/components/SelectionCheckbox.tsx +52 -0
- package/src/resource-workbench/components/StatusBadge.tsx +119 -0
- package/src/resource-workbench/components/ViewSwitcher.tsx +135 -0
- package/src/resource-workbench/hooks/useResourceCollection.ts +261 -0
- package/src/resource-workbench/hooks/useResourceFilters.ts +216 -0
- package/src/resource-workbench/hooks/useResourceSelection.ts +178 -0
- package/src/resource-workbench/hooks/useViewPreference.ts +75 -0
- package/src/resource-workbench/index.ts +73 -0
- package/src/resource-workbench/types.ts +220 -0
- package/src/runner/RunnerDetailView.tsx +410 -0
- package/src/runner/RunnerListPanel.tsx +126 -111
- package/src/runner/index.ts +13 -1
- package/src/runner/shared.tsx +124 -0
- package/src/runner/useRunner.ts +59 -0
- package/src/session/__tests__/group-sessions.test.ts +5 -3
- package/src/skill/SkillDetailView.tsx +371 -165
- package/src/skill/SkillDiffDialog.tsx +213 -0
- package/src/skill/SkillFileBrowser.tsx +289 -0
- package/src/skill/SkillUploader.tsx +481 -0
- package/src/skill/index.ts +34 -0
- package/src/skill/internal/computeArtifactHash.ts +13 -0
- package/src/skill/internal/fetchAndUnpackArtifact.ts +48 -0
- package/src/skill/usePushSkill.ts +101 -0
- package/src/skill/useSkillArtifact.ts +107 -0
- package/src/skill/useSkillDiff.ts +128 -0
- package/src/skill/useSkillDuplicateCheck.ts +92 -0
- package/src/skill/useSkillUpload.ts +231 -0
- package/src/skill/useSkillVersions.ts +165 -0
- package/src/styles.css +28 -0
- package/src/tabs/Tabs.tsx +184 -0
- package/src/tabs/index.ts +2 -0
- package/src/version-history/DiffFileList.tsx +111 -0
- package/src/version-history/DiffSummary.tsx +61 -0
- package/src/version-history/DiffViewer.tsx +163 -0
- package/src/version-history/MultiFileDiffView.tsx +114 -0
- package/src/version-history/VersionTimeline.tsx +232 -0
- package/src/version-history/VersionTimelineEntry.tsx +254 -0
- package/src/version-history/computeDiff.ts +61 -0
- package/src/version-history/computeMultiFileDiff.ts +97 -0
- package/src/version-history/index.ts +22 -0
- package/src/version-history/types.ts +129 -0
- package/styles.css +1 -1
- package/tabs/Tabs.d.ts +58 -0
- package/tabs/Tabs.d.ts.map +1 -0
- package/tabs/Tabs.js +80 -0
- package/tabs/Tabs.js.map +1 -0
- package/tabs/index.d.ts +3 -0
- package/tabs/index.d.ts.map +1 -0
- package/tabs/index.js +2 -0
- package/tabs/index.js.map +1 -0
- package/version-history/DiffFileList.d.ts +22 -0
- package/version-history/DiffFileList.d.ts.map +1 -0
- package/version-history/DiffFileList.js +37 -0
- package/version-history/DiffFileList.js.map +1 -0
- package/version-history/DiffSummary.d.ts +21 -0
- package/version-history/DiffSummary.d.ts.map +1 -0
- package/version-history/DiffSummary.js +16 -0
- package/version-history/DiffSummary.js.map +1 -0
- package/version-history/DiffViewer.d.ts +31 -0
- package/version-history/DiffViewer.d.ts.map +1 -0
- package/version-history/DiffViewer.js +60 -0
- package/version-history/DiffViewer.js.map +1 -0
- package/version-history/MultiFileDiffView.d.ts +30 -0
- package/version-history/MultiFileDiffView.d.ts.map +1 -0
- package/version-history/MultiFileDiffView.js +40 -0
- package/version-history/MultiFileDiffView.js.map +1 -0
- package/version-history/VersionTimeline.d.ts +29 -0
- package/version-history/VersionTimeline.d.ts.map +1 -0
- package/version-history/VersionTimeline.js +87 -0
- package/version-history/VersionTimeline.js.map +1 -0
- package/version-history/VersionTimelineEntry.d.ts +22 -0
- package/version-history/VersionTimelineEntry.d.ts.map +1 -0
- package/version-history/VersionTimelineEntry.js +98 -0
- package/version-history/VersionTimelineEntry.js.map +1 -0
- package/version-history/computeDiff.d.ts +16 -0
- package/version-history/computeDiff.d.ts.map +1 -0
- package/version-history/computeDiff.js +54 -0
- package/version-history/computeDiff.js.map +1 -0
- package/version-history/computeMultiFileDiff.d.ts +15 -0
- package/version-history/computeMultiFileDiff.d.ts.map +1 -0
- package/version-history/computeMultiFileDiff.js +83 -0
- package/version-history/computeMultiFileDiff.js.map +1 -0
- package/version-history/index.d.ts +14 -0
- package/version-history/index.d.ts.map +1 -0
- package/version-history/index.js +9 -0
- package/version-history/index.js.map +1 -0
- package/version-history/types.d.ts +106 -0
- package/version-history/types.d.ts.map +1 -0
- package/version-history/types.js +2 -0
- package/version-history/types.js.map +1 -0
- package/library/ResourceListView.d.ts +0 -174
- package/library/ResourceListView.d.ts.map +0 -1
- package/library/ResourceListView.js +0 -318
- package/library/ResourceListView.js.map +0 -1
- package/src/library/ResourceListView.tsx +0 -956
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useMemo } from "react";
|
|
3
|
+
import { parse as parseYaml } from "yaml";
|
|
4
|
+
import { toast } from "../feedback/toast";
|
|
5
|
+
import { serializeAgentYaml, serializeMcpServerYaml } from "./serialize-resource-yaml";
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// Hook
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
/**
|
|
10
|
+
* Headless export hook for Stigmer resources (Agent, McpServer).
|
|
11
|
+
*
|
|
12
|
+
* Serializes the resource into YAML and JSON formats and provides
|
|
13
|
+
* stable callbacks for copying to clipboard or triggering a file
|
|
14
|
+
* download. All operations are client-side — no additional API calls.
|
|
15
|
+
*
|
|
16
|
+
* The serialized output uses the canonical Stigmer resource format
|
|
17
|
+
* (`apiVersion`, `kind`, `metadata`, `spec`) with snake_case field
|
|
18
|
+
* names, identical to what the CLI produces and what `parseResourceYaml`
|
|
19
|
+
* accepts — ensuring full round-trip compatibility.
|
|
20
|
+
*
|
|
21
|
+
* @param options - Resource kind and the proto resource object.
|
|
22
|
+
* @returns Stable callbacks and memoized serialized strings.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* const { agent } = useAgent(org, slug);
|
|
27
|
+
* const { copyYaml, downloadYaml } = useExportResource({
|
|
28
|
+
* kind: "Agent",
|
|
29
|
+
* resource: agent,
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* <ActionMenu.Item onSelect={copyYaml}>Export YAML</ActionMenu.Item>
|
|
33
|
+
* <ActionMenu.Item onSelect={downloadYaml}>Download YAML</ActionMenu.Item>
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @see {@link serializeAgentYaml} for the underlying Agent serializer
|
|
37
|
+
* @see {@link serializeMcpServerYaml} for the underlying McpServer serializer
|
|
38
|
+
*/
|
|
39
|
+
export function useExportResource({ kind, resource, }) {
|
|
40
|
+
const yaml = useMemo(() => {
|
|
41
|
+
if (!resource)
|
|
42
|
+
return null;
|
|
43
|
+
if (kind === "Agent")
|
|
44
|
+
return serializeAgentYaml(resource);
|
|
45
|
+
return serializeMcpServerYaml(resource);
|
|
46
|
+
}, [kind, resource]);
|
|
47
|
+
const json = useMemo(() => {
|
|
48
|
+
if (!resource)
|
|
49
|
+
return null;
|
|
50
|
+
if (kind === "Agent")
|
|
51
|
+
return serializeResourceJson(resource, "Agent");
|
|
52
|
+
return serializeResourceJson(resource, "McpServer");
|
|
53
|
+
}, [kind, resource]);
|
|
54
|
+
const slug = useMemo(() => {
|
|
55
|
+
if (!resource)
|
|
56
|
+
return "resource";
|
|
57
|
+
return resource.metadata?.slug || resource.metadata?.name || "resource";
|
|
58
|
+
}, [resource]);
|
|
59
|
+
const copyYaml = useCallback(async () => {
|
|
60
|
+
if (!yaml)
|
|
61
|
+
return;
|
|
62
|
+
await copyToClipboard(yaml);
|
|
63
|
+
toast.success("YAML copied to clipboard");
|
|
64
|
+
}, [yaml]);
|
|
65
|
+
const copyJson = useCallback(async () => {
|
|
66
|
+
if (!json)
|
|
67
|
+
return;
|
|
68
|
+
await copyToClipboard(json);
|
|
69
|
+
toast.success("JSON copied to clipboard");
|
|
70
|
+
}, [json]);
|
|
71
|
+
const downloadYaml = useCallback(() => {
|
|
72
|
+
if (!yaml)
|
|
73
|
+
return;
|
|
74
|
+
downloadFile(yaml, `${slug}.yaml`, "text/yaml");
|
|
75
|
+
}, [yaml, slug]);
|
|
76
|
+
const downloadJson = useCallback(() => {
|
|
77
|
+
if (!json)
|
|
78
|
+
return;
|
|
79
|
+
downloadFile(json, `${slug}.json`, "application/json");
|
|
80
|
+
}, [json, slug]);
|
|
81
|
+
return useMemo(() => ({ copyYaml, copyJson, downloadYaml, downloadJson, yaml, json }), [copyYaml, copyJson, downloadYaml, downloadJson, yaml, json]);
|
|
82
|
+
}
|
|
83
|
+
// ---------------------------------------------------------------------------
|
|
84
|
+
// JSON serialization
|
|
85
|
+
// ---------------------------------------------------------------------------
|
|
86
|
+
/**
|
|
87
|
+
* Produces a JSON representation of the resource using the same canonical
|
|
88
|
+
* structure as the YAML export (apiVersion, kind, metadata, spec).
|
|
89
|
+
*
|
|
90
|
+
* Internally parses the YAML output to get a clean plain object, then
|
|
91
|
+
* re-stringifies as JSON. This guarantees the JSON structure is identical
|
|
92
|
+
* to the YAML structure (snake_case fields, no status).
|
|
93
|
+
*/
|
|
94
|
+
function serializeResourceJson(resource, kind) {
|
|
95
|
+
const yamlStr = kind === "Agent"
|
|
96
|
+
? serializeAgentYaml(resource)
|
|
97
|
+
: serializeMcpServerYaml(resource);
|
|
98
|
+
const doc = parseYaml(yamlStr);
|
|
99
|
+
return JSON.stringify(doc, null, 2);
|
|
100
|
+
}
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
// Clipboard
|
|
103
|
+
// ---------------------------------------------------------------------------
|
|
104
|
+
async function copyToClipboard(text) {
|
|
105
|
+
try {
|
|
106
|
+
await navigator.clipboard.writeText(text);
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
fallbackCopy(text);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function fallbackCopy(text) {
|
|
113
|
+
const textarea = document.createElement("textarea");
|
|
114
|
+
textarea.value = text;
|
|
115
|
+
textarea.style.position = "fixed";
|
|
116
|
+
textarea.style.opacity = "0";
|
|
117
|
+
document.body.appendChild(textarea);
|
|
118
|
+
textarea.select();
|
|
119
|
+
document.execCommand("copy");
|
|
120
|
+
document.body.removeChild(textarea);
|
|
121
|
+
}
|
|
122
|
+
// ---------------------------------------------------------------------------
|
|
123
|
+
// File download
|
|
124
|
+
// ---------------------------------------------------------------------------
|
|
125
|
+
function downloadFile(content, filename, mimeType) {
|
|
126
|
+
const blob = new Blob([content], { type: `${mimeType};charset=utf-8;` });
|
|
127
|
+
const url = URL.createObjectURL(blob);
|
|
128
|
+
const link = document.createElement("a");
|
|
129
|
+
link.href = url;
|
|
130
|
+
link.download = filename;
|
|
131
|
+
link.style.display = "none";
|
|
132
|
+
document.body.appendChild(link);
|
|
133
|
+
link.click();
|
|
134
|
+
document.body.removeChild(link);
|
|
135
|
+
URL.revokeObjectURL(url);
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=useExportResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useExportResource.js","sourceRoot":"","sources":["../../src/library/useExportResource.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAG1C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AA8BvF,8EAA8E;AAC9E,OAAO;AACP,8EAA8E;AAE9E;;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AC,OAAO,GAAG,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC,IAAI,CAAC,KAAK,EAAE,CAAC;IACb,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { ApplyResourceResult } from "./useApplyResource";
|
|
2
|
+
/** Detected format of the imported file content. */
|
|
3
|
+
export type ImportFormat = "yaml" | "json";
|
|
4
|
+
/**
|
|
5
|
+
* Validated preview of an imported resource, shown to the user before
|
|
6
|
+
* they confirm the apply operation.
|
|
7
|
+
*/
|
|
8
|
+
export interface ImportPreview {
|
|
9
|
+
/** The detected resource kind. */
|
|
10
|
+
readonly kind: "Agent" | "McpServer";
|
|
11
|
+
/** The resource name from `metadata.name`. */
|
|
12
|
+
readonly name: string;
|
|
13
|
+
/** The resource slug from `metadata.slug`, if present. */
|
|
14
|
+
readonly slug?: string;
|
|
15
|
+
/** The detected file format. */
|
|
16
|
+
readonly format: ImportFormat;
|
|
17
|
+
/** The raw file content (for potential display or debugging). */
|
|
18
|
+
readonly rawContent: string;
|
|
19
|
+
}
|
|
20
|
+
/** Return value of {@link useImportResource}. */
|
|
21
|
+
export interface UseImportResourceReturn {
|
|
22
|
+
/**
|
|
23
|
+
* Read and validate a file selected by the user. On success, populates
|
|
24
|
+
* `preview`. On failure, populates `error`. In both cases, clears the
|
|
25
|
+
* previous state first.
|
|
26
|
+
*/
|
|
27
|
+
readonly readFile: (file: File) => Promise<void>;
|
|
28
|
+
/** The validation preview, or `null` when no file has been validated. */
|
|
29
|
+
readonly preview: ImportPreview | null;
|
|
30
|
+
/** Validation or apply error message, or `null` when healthy. */
|
|
31
|
+
readonly error: string | null;
|
|
32
|
+
/** Clear all state (preview, error, internal content). */
|
|
33
|
+
readonly reset: () => void;
|
|
34
|
+
/**
|
|
35
|
+
* Apply the previewed resource to the given organization.
|
|
36
|
+
* Only callable when `preview` is non-null.
|
|
37
|
+
*
|
|
38
|
+
* @throws Re-throws the original error after setting `error` state.
|
|
39
|
+
*/
|
|
40
|
+
readonly apply: (org: string) => Promise<ApplyResourceResult>;
|
|
41
|
+
/** `true` while the apply RPC is in-flight. */
|
|
42
|
+
readonly isApplying: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Headless import hook for Stigmer resources.
|
|
46
|
+
*
|
|
47
|
+
* Orchestrates the file import workflow:
|
|
48
|
+
* 1. User selects a `.yaml`, `.yml`, or `.json` file
|
|
49
|
+
* 2. `readFile` reads the content, detects the format, and validates
|
|
50
|
+
* the structure via `parseResourceYaml`
|
|
51
|
+
* 3. On success, `preview` is populated with kind, name, slug, format
|
|
52
|
+
* 4. On validation error, `error` is populated with a user-facing message
|
|
53
|
+
* 5. User confirms → `apply(org)` calls the appropriate SDK `apply()` method
|
|
54
|
+
*
|
|
55
|
+
* Follows the established mutation-hook pattern: `isApplying` + `error` +
|
|
56
|
+
* `reset`. The `preview` state enables a confirmation step before committing
|
|
57
|
+
* (Nielsen heuristic #3: user control, #5: error prevention).
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```tsx
|
|
61
|
+
* const { readFile, preview, error, reset, apply, isApplying } = useImportResource();
|
|
62
|
+
*
|
|
63
|
+
* const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
64
|
+
* const file = e.target.files?.[0];
|
|
65
|
+
* if (file) readFile(file);
|
|
66
|
+
* };
|
|
67
|
+
*
|
|
68
|
+
* if (preview) {
|
|
69
|
+
* return (
|
|
70
|
+
* <div>
|
|
71
|
+
* <p>Import {preview.kind}: {preview.name}</p>
|
|
72
|
+
* <button onClick={() => apply(org)} disabled={isApplying}>
|
|
73
|
+
* Confirm
|
|
74
|
+
* </button>
|
|
75
|
+
* </div>
|
|
76
|
+
* );
|
|
77
|
+
* }
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* @see {@link parseResourceYaml} for the validation logic
|
|
81
|
+
* @see {@link ImportResourceDialog} for the styled component that composes this hook
|
|
82
|
+
*/
|
|
83
|
+
export declare function useImportResource(): UseImportResourceReturn;
|
|
84
|
+
//# sourceMappingURL=useImportResource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useImportResource.d.ts","sourceRoot":"","sources":["../../src/library/useImportResource.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAM9D,oDAAoD;AACpD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3C;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,WAAW,CAAC;IACrC,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,iEAAiE;IACjE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,iDAAiD;AACjD,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IACvC,iEAAiE;IACjE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC9D,+CAA+C;IAC/C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;CAC9B;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,iBAAiB,IAAI,uBAAuB,CA8H3D"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { stringify as stringifyYaml } from "yaml";
|
|
4
|
+
import { useStigmer } from "../hooks";
|
|
5
|
+
import { toError } from "../internal/toError";
|
|
6
|
+
import { parseResourceYaml } from "./parse-resource-yaml";
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
// Hook
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
/**
|
|
11
|
+
* Headless import hook for Stigmer resources.
|
|
12
|
+
*
|
|
13
|
+
* Orchestrates the file import workflow:
|
|
14
|
+
* 1. User selects a `.yaml`, `.yml`, or `.json` file
|
|
15
|
+
* 2. `readFile` reads the content, detects the format, and validates
|
|
16
|
+
* the structure via `parseResourceYaml`
|
|
17
|
+
* 3. On success, `preview` is populated with kind, name, slug, format
|
|
18
|
+
* 4. On validation error, `error` is populated with a user-facing message
|
|
19
|
+
* 5. User confirms → `apply(org)` calls the appropriate SDK `apply()` method
|
|
20
|
+
*
|
|
21
|
+
* Follows the established mutation-hook pattern: `isApplying` + `error` +
|
|
22
|
+
* `reset`. The `preview` state enables a confirmation step before committing
|
|
23
|
+
* (Nielsen heuristic #3: user control, #5: error prevention).
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* const { readFile, preview, error, reset, apply, isApplying } = useImportResource();
|
|
28
|
+
*
|
|
29
|
+
* const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
30
|
+
* const file = e.target.files?.[0];
|
|
31
|
+
* if (file) readFile(file);
|
|
32
|
+
* };
|
|
33
|
+
*
|
|
34
|
+
* if (preview) {
|
|
35
|
+
* return (
|
|
36
|
+
* <div>
|
|
37
|
+
* <p>Import {preview.kind}: {preview.name}</p>
|
|
38
|
+
* <button onClick={() => apply(org)} disabled={isApplying}>
|
|
39
|
+
* Confirm
|
|
40
|
+
* </button>
|
|
41
|
+
* </div>
|
|
42
|
+
* );
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @see {@link parseResourceYaml} for the validation logic
|
|
47
|
+
* @see {@link ImportResourceDialog} for the styled component that composes this hook
|
|
48
|
+
*/
|
|
49
|
+
export function useImportResource() {
|
|
50
|
+
const stigmer = useStigmer();
|
|
51
|
+
const [preview, setPreview] = useState(null);
|
|
52
|
+
const [error, setError] = useState(null);
|
|
53
|
+
const [isApplying, setIsApplying] = useState(false);
|
|
54
|
+
const contentRef = useRef(null);
|
|
55
|
+
const parsedRef = useRef(null);
|
|
56
|
+
const reset = useCallback(() => {
|
|
57
|
+
setPreview(null);
|
|
58
|
+
setError(null);
|
|
59
|
+
setIsApplying(false);
|
|
60
|
+
contentRef.current = null;
|
|
61
|
+
parsedRef.current = null;
|
|
62
|
+
}, []);
|
|
63
|
+
const readFile = useCallback(async (file) => {
|
|
64
|
+
setPreview(null);
|
|
65
|
+
setError(null);
|
|
66
|
+
contentRef.current = null;
|
|
67
|
+
parsedRef.current = null;
|
|
68
|
+
let text;
|
|
69
|
+
try {
|
|
70
|
+
text = await file.text();
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
setError("Failed to read the selected file.");
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (!text.trim()) {
|
|
77
|
+
setError("The selected file is empty.");
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const format = detectFormat(file.name, text);
|
|
81
|
+
// For JSON files, convert to YAML-parseable content first.
|
|
82
|
+
// parseResourceYaml expects YAML, but since YAML is a superset of JSON,
|
|
83
|
+
// we can pass JSON directly. However for cleaner error messages, we
|
|
84
|
+
// normalize JSON → plain object → YAML string if needed.
|
|
85
|
+
let yamlContent;
|
|
86
|
+
if (format === "json") {
|
|
87
|
+
try {
|
|
88
|
+
const parsed = JSON.parse(text);
|
|
89
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
90
|
+
setError("JSON file must contain a single object (not an array or primitive).");
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
yamlContent = stringifyYaml(parsed);
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
setError("The file does not contain valid JSON.");
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
yamlContent = text;
|
|
102
|
+
}
|
|
103
|
+
// Validate structure using the existing parser. We use a dummy org
|
|
104
|
+
// here — the real org is provided at apply time.
|
|
105
|
+
let parsed;
|
|
106
|
+
try {
|
|
107
|
+
parsed = parseResourceYaml(yamlContent, "__preview__");
|
|
108
|
+
}
|
|
109
|
+
catch (err) {
|
|
110
|
+
setError(err instanceof Error ? err.message : "Failed to validate resource file.");
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
contentRef.current = yamlContent;
|
|
114
|
+
parsedRef.current = parsed;
|
|
115
|
+
setPreview({
|
|
116
|
+
kind: parsed.kind,
|
|
117
|
+
name: parsed.input.name,
|
|
118
|
+
slug: "slug" in parsed.input ? parsed.input.slug : undefined,
|
|
119
|
+
format,
|
|
120
|
+
rawContent: text,
|
|
121
|
+
});
|
|
122
|
+
}, []);
|
|
123
|
+
const apply = useCallback(async (org) => {
|
|
124
|
+
const content = contentRef.current;
|
|
125
|
+
if (!content) {
|
|
126
|
+
throw new Error("No file has been validated. Call readFile first.");
|
|
127
|
+
}
|
|
128
|
+
setIsApplying(true);
|
|
129
|
+
setError(null);
|
|
130
|
+
try {
|
|
131
|
+
const parsed = parseResourceYaml(content, org);
|
|
132
|
+
switch (parsed.kind) {
|
|
133
|
+
case "Agent": {
|
|
134
|
+
const agent = await stigmer.agent.apply(parsed.input);
|
|
135
|
+
return {
|
|
136
|
+
kind: "Agent",
|
|
137
|
+
name: agent.metadata?.name ?? parsed.input.name,
|
|
138
|
+
org: agent.metadata?.org ?? org,
|
|
139
|
+
slug: agent.metadata?.slug ?? parsed.input.name,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
case "McpServer": {
|
|
143
|
+
const mcpServer = await stigmer.mcpServer.apply(parsed.input);
|
|
144
|
+
return {
|
|
145
|
+
kind: "McpServer",
|
|
146
|
+
name: mcpServer.metadata?.name ?? parsed.input.name,
|
|
147
|
+
org: mcpServer.metadata?.org ?? org,
|
|
148
|
+
slug: mcpServer.metadata?.slug ?? parsed.input.name,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
catch (err) {
|
|
154
|
+
const message = toError(err).message;
|
|
155
|
+
setError(message);
|
|
156
|
+
throw err;
|
|
157
|
+
}
|
|
158
|
+
finally {
|
|
159
|
+
setIsApplying(false);
|
|
160
|
+
}
|
|
161
|
+
}, [stigmer]);
|
|
162
|
+
return useMemo(() => ({ readFile, preview, error, reset, apply, isApplying }), [readFile, preview, error, reset, apply, isApplying]);
|
|
163
|
+
}
|
|
164
|
+
// ---------------------------------------------------------------------------
|
|
165
|
+
// Format detection
|
|
166
|
+
// ---------------------------------------------------------------------------
|
|
167
|
+
const JSON_EXTENSIONS = new Set([".json"]);
|
|
168
|
+
const YAML_EXTENSIONS = new Set([".yaml", ".yml"]);
|
|
169
|
+
function detectFormat(filename, content) {
|
|
170
|
+
const lowerName = filename.toLowerCase();
|
|
171
|
+
const dotIndex = lowerName.lastIndexOf(".");
|
|
172
|
+
if (dotIndex >= 0) {
|
|
173
|
+
const ext = lowerName.slice(dotIndex);
|
|
174
|
+
if (JSON_EXTENSIONS.has(ext))
|
|
175
|
+
return "json";
|
|
176
|
+
if (YAML_EXTENSIONS.has(ext))
|
|
177
|
+
return "yaml";
|
|
178
|
+
}
|
|
179
|
+
// Fallback: try parsing as JSON. If it parses, treat as JSON.
|
|
180
|
+
try {
|
|
181
|
+
JSON.parse(content);
|
|
182
|
+
return "json";
|
|
183
|
+
}
|
|
184
|
+
catch {
|
|
185
|
+
return "yaml";
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=useImportResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useImportResource.js","sourceRoot":"","sources":["../../src/library/useImportResource.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAuB,MAAM,uBAAuB,CAAC;AAoD/E,8EAA8E;AAC9E,OAAO;AACP,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAuB,IAAI,CAAC,CAAC;IACnE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpD,MAAM,UAAU,GAAG,MAAM,CAAgB,IAAI,CAAC,CAAC;IAC/C,MAAM,SAAS,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAC;IAEtD,MAAM,KAAK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. */
|
|
3
|
+
export interface McpServerCreationResult {
|
|
4
|
+
/** Organization slug of the created MCP server. */
|
|
5
|
+
readonly org: string;
|
|
6
|
+
/** MCP server slug (for URL construction). */
|
|
7
|
+
readonly slug: string;
|
|
8
|
+
/** MCP server display name. */
|
|
9
|
+
readonly name: string;
|
|
10
|
+
}
|
|
11
|
+
/** Props for {@link McpServerCreationWizard}. */
|
|
12
|
+
export interface McpServerCreationWizardProps {
|
|
13
|
+
/** Organization to create the MCP server in. */
|
|
14
|
+
readonly org: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional partial data to pre-fill the wizard with.
|
|
17
|
+
*
|
|
18
|
+
* Merged with defaults via `{ ...createInitialMcpServerWizardData(), ...initialData }`.
|
|
19
|
+
* Use this for template-based creation, resource duplication, or any
|
|
20
|
+
* flow that starts the wizard with pre-populated fields.
|
|
21
|
+
*/
|
|
22
|
+
readonly initialData?: Partial<McpServerWizardData>;
|
|
23
|
+
/** Called after the MCP server is successfully created. */
|
|
24
|
+
readonly onComplete: (result: McpServerCreationResult) => void;
|
|
25
|
+
/** Called when the user cancels the wizard. */
|
|
26
|
+
readonly onCancel?: () => void;
|
|
27
|
+
/** Additional CSS classes for the root container. */
|
|
28
|
+
readonly className?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Multi-step wizard for creating a new MCP server blueprint.
|
|
32
|
+
*
|
|
33
|
+
* Three steps:
|
|
34
|
+
* 1. **Identity & Transport** — name, slug, description, visibility, transport config
|
|
35
|
+
* 2. **Environment & Auth** — env var declarations, OAuth auth configuration (all optional)
|
|
36
|
+
* 3. **Review & Create** — YAML preview + submission
|
|
37
|
+
*
|
|
38
|
+
* Uses the shared `WizardShell` layout and `useWizardState` hook for
|
|
39
|
+
* navigation. Form data accumulates in the wizard state; on the final
|
|
40
|
+
* step the user reviews and confirms creation.
|
|
41
|
+
*
|
|
42
|
+
* This component is an SDK-first, embeddable wizard with zero Console
|
|
43
|
+
* dependencies. Platform builders can mount it anywhere.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <McpServerCreationWizard
|
|
48
|
+
* org="acme"
|
|
49
|
+
* onComplete={({ org, slug }) => navigate(`/mcp-servers/${org}/${slug}`)}
|
|
50
|
+
* onCancel={() => navigate("/mcp-servers")}
|
|
51
|
+
* />
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare function McpServerCreationWizard({ org, initialData, onComplete, onCancel, className, }: McpServerCreationWizardProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
//# sourceMappingURL=McpServerCreationWizard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"McpServerCreationWizard.d.ts","sourceRoot":"","sources":["../../src/mcp-server/McpServerCreationWizard.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAMzD,0EAA0E;AAC1E,MAAM,WAAW,uBAAuB;IACtC,mDAAmD;IACnD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+BAA+B;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,iDAAiD;AACjD,MAAM,WAAW,4BAA4B;IAC3C,gDAAgD;IAChD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;;;;OAMG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACpD,2DAA2D;IAC3D,QAAQ,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAC/D,+CAA+C;IAC/C,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAmCD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,GAAG,EACH,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,GACV,EAAE,4BAA4B,2CA+F9B"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useMemo } from "react";
|
|
4
|
+
import { useWizardState } from "../resource-creation/useWizardState";
|
|
5
|
+
import { WizardShell } from "../resource-creation/WizardShell";
|
|
6
|
+
import { useCreateMcpServer } from "./useCreateMcpServer";
|
|
7
|
+
import { IdentityTransportStep } from "./steps/IdentityTransportStep";
|
|
8
|
+
import { EnvironmentAuthStep } from "./steps/EnvironmentAuthStep";
|
|
9
|
+
import { ReviewStep, buildMcpServerInput } from "./steps/ReviewStep";
|
|
10
|
+
import { createInitialMcpServerWizardData } from "./steps/types";
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Step definitions
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
const STEPS = [
|
|
15
|
+
{
|
|
16
|
+
id: "identity-transport",
|
|
17
|
+
label: "Identity & Transport",
|
|
18
|
+
validate: (data) => {
|
|
19
|
+
if (!data.name.trim())
|
|
20
|
+
return "Name is required";
|
|
21
|
+
if (data.transportType === "http" && !data.httpUrl.trim()) {
|
|
22
|
+
return "HTTP URL is required";
|
|
23
|
+
}
|
|
24
|
+
if (data.transportType === "stdio" && !data.stdioCommand.trim()) {
|
|
25
|
+
return "Stdio command is required";
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "environment-auth",
|
|
32
|
+
label: "Environment & Auth",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "review",
|
|
36
|
+
label: "Review & Create",
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
// Component
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
/**
|
|
43
|
+
* Multi-step wizard for creating a new MCP server blueprint.
|
|
44
|
+
*
|
|
45
|
+
* Three steps:
|
|
46
|
+
* 1. **Identity & Transport** — name, slug, description, visibility, transport config
|
|
47
|
+
* 2. **Environment & Auth** — env var declarations, OAuth auth configuration (all optional)
|
|
48
|
+
* 3. **Review & Create** — YAML preview + submission
|
|
49
|
+
*
|
|
50
|
+
* Uses the shared `WizardShell` layout and `useWizardState` hook for
|
|
51
|
+
* navigation. Form data accumulates in the wizard state; on the final
|
|
52
|
+
* step the user reviews and confirms creation.
|
|
53
|
+
*
|
|
54
|
+
* This component is an SDK-first, embeddable wizard with zero Console
|
|
55
|
+
* dependencies. Platform builders can mount it anywhere.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```tsx
|
|
59
|
+
* <McpServerCreationWizard
|
|
60
|
+
* org="acme"
|
|
61
|
+
* onComplete={({ org, slug }) => navigate(`/mcp-servers/${org}/${slug}`)}
|
|
62
|
+
* onCancel={() => navigate("/mcp-servers")}
|
|
63
|
+
* />
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export function McpServerCreationWizard({ org, initialData, onComplete, onCancel, className, }) {
|
|
67
|
+
const mergedInitialData = useMemo(() => ({ ...createInitialMcpServerWizardData(), ...initialData }),
|
|
68
|
+
// initialData is consumed once at mount — not reactive by design
|
|
69
|
+
[initialData]);
|
|
70
|
+
const wizard = useWizardState({
|
|
71
|
+
steps: STEPS,
|
|
72
|
+
initialData: mergedInitialData,
|
|
73
|
+
});
|
|
74
|
+
const { create, isCreating, error, clearError } = useCreateMcpServer();
|
|
75
|
+
const handleNext = useCallback(() => {
|
|
76
|
+
if (wizard.isLastStep) {
|
|
77
|
+
handleSubmit();
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
clearError();
|
|
81
|
+
wizard.goNext();
|
|
82
|
+
}
|
|
83
|
+
}, [wizard.isLastStep, wizard.goNext, clearError]);
|
|
84
|
+
const handleSubmit = useCallback(async () => {
|
|
85
|
+
clearError();
|
|
86
|
+
const input = buildMcpServerInput(org, wizard.data);
|
|
87
|
+
try {
|
|
88
|
+
const server = await create(input);
|
|
89
|
+
onComplete({
|
|
90
|
+
org: server.metadata?.org ?? org,
|
|
91
|
+
slug: server.metadata?.slug ?? input.slug ?? input.name,
|
|
92
|
+
name: server.metadata?.name ?? input.name,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
// Error is captured by useCreateMcpServer and displayed in ReviewStep
|
|
97
|
+
}
|
|
98
|
+
}, [org, wizard.data, create, clearError, onComplete]);
|
|
99
|
+
const currentStepContent = useMemo(() => {
|
|
100
|
+
switch (wizard.currentStep.id) {
|
|
101
|
+
case "identity-transport":
|
|
102
|
+
return (_jsx(IdentityTransportStep, { data: wizard.data, updateData: wizard.updateData, validationError: wizard.validationError }));
|
|
103
|
+
case "environment-auth":
|
|
104
|
+
return (_jsx(EnvironmentAuthStep, { data: wizard.data, updateData: wizard.updateData }));
|
|
105
|
+
case "review":
|
|
106
|
+
return (_jsx(ReviewStep, { org: org, data: wizard.data, isCreating: isCreating, error: error }));
|
|
107
|
+
default:
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
}, [
|
|
111
|
+
wizard.currentStep.id,
|
|
112
|
+
wizard.data,
|
|
113
|
+
wizard.updateData,
|
|
114
|
+
wizard.validationError,
|
|
115
|
+
org,
|
|
116
|
+
isCreating,
|
|
117
|
+
error,
|
|
118
|
+
]);
|
|
119
|
+
return (_jsx(WizardShell, { steps: STEPS, currentStepIndex: wizard.currentStepIndex, submitLabel: "Create MCP server", isSubmitting: isCreating, canGoNext: wizard.canGoNext, canGoBack: wizard.canGoBack, onNext: handleNext, onBack: wizard.goBack, onGoToStep: wizard.goToStep, onCancel: onCancel, className: className, children: currentStepContent }));
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=McpServerCreationWizard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"McpServerCreationWizard.js","sourceRoot":"","sources":["../../src/mcp-server/McpServerCreationWizard.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC;AAqCjE,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,MAAM,KAAK,GAAyC;IAClD;QACE,EAAE,EAAE,oBAAoB;QACxB,KAAK,EAAE,sBAAsB;QAC7B,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;YACjB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;gBAAE,OAAO,kBAAkB,CAAC;YACjD,IAAI,IAAI,CAAC,aAAa,KAAK,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;gBAC1D,OAAO,sBAAsB,CAAC;YAChC,CAAC;YACD,IAAI,IAAI,CAAC,aAAa,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC;gBAChE,OAAO,2BAA2B,CAAC;YACrC,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IACD;QACE,EAAE,EAAE,kBAAkB;QACt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,WAAW,IACV,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,EACzC,WAAW,EAAC,mBAAmB,EAC/B,YAAY,EAAE,UAAU,EACxB,SAAS,EAAE,MAAM,CAAC,SAAS,EAC3B,SAAS,EAAE,MAAM,CAAC,SAAS,EAC3B,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,UAAU,EAAE,MAAM,CAAC,QAAQ,EAC3B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,YAEnB,kBAAkB,GACP,CACf,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { McpServer } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
|
|
1
2
|
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
3
|
+
import type { DetailAction } from "../resource-detail/types";
|
|
2
4
|
/** Tab identifier for the MCP server capability panel. */
|
|
3
5
|
export type CapabilityTab = "tools" | "policies" | "resources";
|
|
4
6
|
/** Props for {@link McpServerDetailView}. */
|
|
@@ -56,6 +58,24 @@ export interface McpServerDetailViewProps {
|
|
|
56
58
|
* When omitted, falls back to the `org` prop (MCP server's org).
|
|
57
59
|
*/
|
|
58
60
|
readonly activeOrg?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Primary action rendered as a visible button in the header area.
|
|
63
|
+
*/
|
|
64
|
+
readonly primaryAction?: DetailAction;
|
|
65
|
+
/**
|
|
66
|
+
* Secondary actions rendered in the kebab overflow menu.
|
|
67
|
+
*/
|
|
68
|
+
readonly actions?: readonly DetailAction[];
|
|
69
|
+
/**
|
|
70
|
+
* When `true`, fields on the detail view become click-to-edit.
|
|
71
|
+
* Each field saves independently via `stigmer.mcpServer.update()`.
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
74
|
+
readonly editable?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Called after a successful inline field save with the updated server.
|
|
77
|
+
*/
|
|
78
|
+
readonly onResourceUpdated?: (server: McpServer) => void;
|
|
59
79
|
/** Additional CSS classes for the root container. */
|
|
60
80
|
readonly className?: string;
|
|
61
81
|
}
|
|
@@ -83,5 +103,5 @@ export interface McpServerDetailViewProps {
|
|
|
83
103
|
* <McpServerDetailView org="acme" slug="github" />
|
|
84
104
|
* ```
|
|
85
105
|
*/
|
|
86
|
-
export declare function McpServerDetailView({ org, slug, onResourceLoad, onVisibilityChange, isVisibilityPending, defaultCapabilityTab, defaultShowCredentialForm, credentialPoolValues, activeOrg, className, }: McpServerDetailViewProps): import("react/jsx-runtime").JSX.Element;
|
|
106
|
+
export declare function McpServerDetailView({ org, slug, onResourceLoad, onVisibilityChange, isVisibilityPending, defaultCapabilityTab, defaultShowCredentialForm, credentialPoolValues, activeOrg, primaryAction, actions, editable, onResourceUpdated, className, }: McpServerDetailViewProps): import("react/jsx-runtime").JSX.Element;
|
|
87
107
|
//# sourceMappingURL=McpServerDetailView.d.ts.map
|