@stigmer/react 0.4.7 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action-menu/ActionMenu.d.ts +64 -0
- package/action-menu/ActionMenu.d.ts.map +1 -0
- package/action-menu/ActionMenu.js +78 -0
- package/action-menu/ActionMenu.js.map +1 -0
- package/action-menu/index.d.ts +3 -0
- package/action-menu/index.d.ts.map +1 -0
- package/action-menu/index.js +2 -0
- package/action-menu/index.js.map +1 -0
- package/action-menu/types.d.ts +65 -0
- package/action-menu/types.d.ts.map +1 -0
- package/action-menu/types.js +2 -0
- package/action-menu/types.js.map +1 -0
- package/agent/AgentCreationWizard.d.ts +55 -0
- package/agent/AgentCreationWizard.d.ts.map +1 -0
- package/agent/AgentCreationWizard.js +115 -0
- package/agent/AgentCreationWizard.js.map +1 -0
- package/agent/AgentDetailView.d.ts +77 -9
- package/agent/AgentDetailView.d.ts.map +1 -1
- package/agent/AgentDetailView.js +265 -87
- package/agent/AgentDetailView.js.map +1 -1
- package/agent/index.d.ts +8 -0
- package/agent/index.d.ts.map +1 -1
- package/agent/index.js +4 -0
- package/agent/index.js.map +1 -1
- package/agent/internal/agentToInput.d.ts +12 -0
- package/agent/internal/agentToInput.d.ts.map +1 -0
- package/agent/internal/agentToInput.js +72 -0
- package/agent/internal/agentToInput.js.map +1 -0
- package/agent/steps/CapabilitiesStep.d.ts +16 -0
- package/agent/steps/CapabilitiesStep.d.ts.map +1 -0
- package/agent/steps/CapabilitiesStep.js +80 -0
- package/agent/steps/CapabilitiesStep.js.map +1 -0
- package/agent/steps/IdentityStep.d.ts +18 -0
- package/agent/steps/IdentityStep.d.ts.map +1 -0
- package/agent/steps/IdentityStep.js +43 -0
- package/agent/steps/IdentityStep.js.map +1 -0
- package/agent/steps/ReviewStep.d.ts +23 -0
- package/agent/steps/ReviewStep.d.ts.map +1 -0
- package/agent/steps/ReviewStep.js +73 -0
- package/agent/steps/ReviewStep.js.map +1 -0
- package/agent/steps/types.d.ts +35 -0
- package/agent/steps/types.d.ts.map +1 -0
- package/agent/steps/types.js +16 -0
- package/agent/steps/types.js.map +1 -0
- package/agent/useCreateAgent.d.ts +45 -0
- package/agent/useCreateAgent.d.ts.map +1 -0
- package/agent/useCreateAgent.js +50 -0
- package/agent/useCreateAgent.js.map +1 -0
- package/agent/useUpdateAgent.d.ts +24 -0
- package/agent/useUpdateAgent.d.ts.map +1 -0
- package/agent/useUpdateAgent.js +35 -0
- package/agent/useUpdateAgent.js.map +1 -0
- package/dependency-graph/DependencyGraph.d.ts +37 -0
- package/dependency-graph/DependencyGraph.d.ts.map +1 -0
- package/dependency-graph/DependencyGraph.js +88 -0
- package/dependency-graph/DependencyGraph.js.map +1 -0
- package/dependency-graph/DependencyTreeNode.d.ts +23 -0
- package/dependency-graph/DependencyTreeNode.d.ts.map +1 -0
- package/dependency-graph/DependencyTreeNode.js +99 -0
- package/dependency-graph/DependencyTreeNode.js.map +1 -0
- package/dependency-graph/index.d.ts +4 -0
- package/dependency-graph/index.d.ts.map +1 -0
- package/dependency-graph/index.js +5 -0
- package/dependency-graph/index.js.map +1 -0
- package/dependency-graph/types.d.ts +130 -0
- package/dependency-graph/types.d.ts.map +1 -0
- package/dependency-graph/types.js +2 -0
- package/dependency-graph/types.js.map +1 -0
- package/dependency-graph/useDependencyGraph.d.ts +27 -0
- package/dependency-graph/useDependencyGraph.d.ts.map +1 -0
- package/dependency-graph/useDependencyGraph.js +129 -0
- package/dependency-graph/useDependencyGraph.js.map +1 -0
- package/empty-state/EmptyState.d.ts +29 -0
- package/empty-state/EmptyState.d.ts.map +1 -0
- package/empty-state/EmptyState.js +45 -0
- package/empty-state/EmptyState.js.map +1 -0
- package/empty-state/index.d.ts +4 -0
- package/empty-state/index.d.ts.map +1 -0
- package/empty-state/index.js +3 -0
- package/empty-state/index.js.map +1 -0
- package/empty-state/types.d.ts +73 -0
- package/empty-state/types.d.ts.map +1 -0
- package/empty-state/types.js +2 -0
- package/empty-state/types.js.map +1 -0
- package/empty-state/useEmptyState.d.ts +18 -0
- package/empty-state/useEmptyState.d.ts.map +1 -0
- package/empty-state/useEmptyState.js +72 -0
- package/empty-state/useEmptyState.js.map +1 -0
- package/execution/MessageThread.d.ts +1 -0
- package/execution/MessageThread.d.ts.map +1 -1
- package/execution/MessageThread.js +22 -12
- package/execution/MessageThread.js.map +1 -1
- package/execution/SetupProgress.d.ts +23 -9
- package/execution/SetupProgress.d.ts.map +1 -1
- package/execution/SetupProgress.js +30 -14
- package/execution/SetupProgress.js.map +1 -1
- package/execution/__tests__/thread-keys.test.js +82 -0
- package/execution/__tests__/thread-keys.test.js.map +1 -1
- package/feedback/StigmerToaster.d.ts +18 -0
- package/feedback/StigmerToaster.d.ts.map +1 -0
- package/feedback/StigmerToaster.js +31 -0
- package/feedback/StigmerToaster.js.map +1 -0
- package/feedback/index.d.ts +4 -0
- package/feedback/index.d.ts.map +1 -0
- package/feedback/index.js +3 -0
- package/feedback/index.js.map +1 -0
- package/feedback/toast.d.ts +14 -0
- package/feedback/toast.d.ts.map +1 -0
- package/feedback/toast.js +14 -0
- package/feedback/toast.js.map +1 -0
- package/feedback/types.d.ts +4 -0
- package/feedback/types.d.ts.map +1 -0
- package/feedback/types.js +2 -0
- package/feedback/types.js.map +1 -0
- package/index.d.ts +30 -10
- package/index.d.ts.map +1 -1
- package/index.js +29 -9
- package/index.js.map +1 -1
- package/inline-edit/InlineEditImage.d.ts +20 -0
- package/inline-edit/InlineEditImage.d.ts.map +1 -0
- package/inline-edit/InlineEditImage.js +85 -0
- package/inline-edit/InlineEditImage.js.map +1 -0
- package/inline-edit/InlineEditKeyValue.d.ts +29 -0
- package/inline-edit/InlineEditKeyValue.d.ts.map +1 -0
- package/inline-edit/InlineEditKeyValue.js +67 -0
- package/inline-edit/InlineEditKeyValue.js.map +1 -0
- package/inline-edit/InlineEditResourceList.d.ts +34 -0
- package/inline-edit/InlineEditResourceList.d.ts.map +1 -0
- package/inline-edit/InlineEditResourceList.js +99 -0
- package/inline-edit/InlineEditResourceList.js.map +1 -0
- package/inline-edit/InlineEditSelect.d.ts +18 -0
- package/inline-edit/InlineEditSelect.d.ts.map +1 -0
- package/inline-edit/InlineEditSelect.js +54 -0
- package/inline-edit/InlineEditSelect.js.map +1 -0
- package/inline-edit/InlineEditText.d.ts +23 -0
- package/inline-edit/InlineEditText.d.ts.map +1 -0
- package/inline-edit/InlineEditText.js +79 -0
- package/inline-edit/InlineEditText.js.map +1 -0
- package/inline-edit/InlineEditTextarea.d.ts +22 -0
- package/inline-edit/InlineEditTextarea.d.ts.map +1 -0
- package/inline-edit/InlineEditTextarea.js +83 -0
- package/inline-edit/InlineEditTextarea.js.map +1 -0
- package/inline-edit/index.d.ts +16 -0
- package/inline-edit/index.d.ts.map +1 -0
- package/inline-edit/index.js +8 -0
- package/inline-edit/index.js.map +1 -0
- package/inline-edit/types.d.ts +42 -0
- package/inline-edit/types.d.ts.map +1 -0
- package/inline-edit/types.js +2 -0
- package/inline-edit/types.js.map +1 -0
- package/inline-edit/useInlineFieldSave.d.ts +23 -0
- package/inline-edit/useInlineFieldSave.d.ts.map +1 -0
- package/inline-edit/useInlineFieldSave.js +44 -0
- package/inline-edit/useInlineFieldSave.js.map +1 -0
- package/internal/Tabs.d.ts +4 -38
- package/internal/Tabs.d.ts.map +1 -1
- package/internal/Tabs.js +3 -62
- package/internal/Tabs.js.map +1 -1
- package/library/ImportResourceDialog.d.ts +43 -0
- package/library/ImportResourceDialog.d.ts.map +1 -0
- package/library/ImportResourceDialog.js +90 -0
- package/library/ImportResourceDialog.js.map +1 -0
- package/library/index.d.ts +7 -4
- package/library/index.d.ts.map +1 -1
- package/library/index.js +4 -2
- package/library/index.js.map +1 -1
- package/library/serialize-resource-yaml.d.ts +53 -0
- package/library/serialize-resource-yaml.d.ts.map +1 -1
- package/library/serialize-resource-yaml.js +275 -0
- package/library/serialize-resource-yaml.js.map +1 -1
- package/library/useExportResource.d.ts +56 -0
- package/library/useExportResource.d.ts.map +1 -0
- package/library/useExportResource.js +137 -0
- package/library/useExportResource.js.map +1 -0
- package/library/useImportResource.d.ts +84 -0
- package/library/useImportResource.d.ts.map +1 -0
- package/library/useImportResource.js +188 -0
- package/library/useImportResource.js.map +1 -0
- package/mcp-server/McpServerCreationWizard.d.ts +55 -0
- package/mcp-server/McpServerCreationWizard.d.ts.map +1 -0
- package/mcp-server/McpServerCreationWizard.js +121 -0
- package/mcp-server/McpServerCreationWizard.js.map +1 -0
- package/mcp-server/McpServerDetailView.d.ts +21 -1
- package/mcp-server/McpServerDetailView.d.ts.map +1 -1
- package/mcp-server/McpServerDetailView.js +113 -20
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/mcp-server/index.d.ts +8 -0
- package/mcp-server/index.d.ts.map +1 -1
- package/mcp-server/index.js +4 -0
- package/mcp-server/index.js.map +1 -1
- package/mcp-server/internal/mcpServerToInput.d.ts +12 -0
- package/mcp-server/internal/mcpServerToInput.d.ts.map +1 -0
- package/mcp-server/internal/mcpServerToInput.js +81 -0
- package/mcp-server/internal/mcpServerToInput.js.map +1 -0
- package/mcp-server/steps/EnvironmentAuthStep.d.ts +15 -0
- package/mcp-server/steps/EnvironmentAuthStep.d.ts.map +1 -0
- package/mcp-server/steps/EnvironmentAuthStep.js +55 -0
- package/mcp-server/steps/EnvironmentAuthStep.js.map +1 -0
- package/mcp-server/steps/IdentityTransportStep.d.ts +19 -0
- package/mcp-server/steps/IdentityTransportStep.d.ts.map +1 -0
- package/mcp-server/steps/IdentityTransportStep.js +73 -0
- package/mcp-server/steps/IdentityTransportStep.js.map +1 -0
- package/mcp-server/steps/ReviewStep.d.ts +23 -0
- package/mcp-server/steps/ReviewStep.d.ts.map +1 -0
- package/mcp-server/steps/ReviewStep.js +137 -0
- package/mcp-server/steps/ReviewStep.js.map +1 -0
- package/mcp-server/steps/types.d.ts +56 -0
- package/mcp-server/steps/types.d.ts.map +1 -0
- package/mcp-server/steps/types.js +27 -0
- package/mcp-server/steps/types.js.map +1 -0
- package/mcp-server/useCreateMcpServer.d.ts +45 -0
- package/mcp-server/useCreateMcpServer.d.ts.map +1 -0
- package/mcp-server/useCreateMcpServer.js +50 -0
- package/mcp-server/useCreateMcpServer.js.map +1 -0
- package/mcp-server/useUpdateMcpServer.d.ts +24 -0
- package/mcp-server/useUpdateMcpServer.d.ts.map +1 -0
- package/mcp-server/useUpdateMcpServer.js +35 -0
- package/mcp-server/useUpdateMcpServer.js.map +1 -0
- package/models/registry.d.ts +4 -1
- package/models/registry.d.ts.map +1 -1
- package/models/registry.js +6 -2
- package/models/registry.js.map +1 -1
- package/package.json +8 -4
- package/provider.js +1 -1
- package/provider.js.map +1 -1
- package/resource-creation/CreationPicker.d.ts +60 -0
- package/resource-creation/CreationPicker.d.ts.map +1 -0
- package/resource-creation/CreationPicker.js +74 -0
- package/resource-creation/CreationPicker.js.map +1 -0
- package/resource-creation/StepIndicator.d.ts +28 -0
- package/resource-creation/StepIndicator.d.ts.map +1 -0
- package/resource-creation/StepIndicator.js +40 -0
- package/resource-creation/StepIndicator.js.map +1 -0
- package/resource-creation/TemplateCard.d.ts +24 -0
- package/resource-creation/TemplateCard.d.ts.map +1 -0
- package/resource-creation/TemplateCard.js +68 -0
- package/resource-creation/TemplateCard.js.map +1 -0
- package/resource-creation/TemplateGallery.d.ts +43 -0
- package/resource-creation/TemplateGallery.d.ts.map +1 -0
- package/resource-creation/TemplateGallery.js +78 -0
- package/resource-creation/TemplateGallery.js.map +1 -0
- package/resource-creation/WizardNav.d.ts +31 -0
- package/resource-creation/WizardNav.d.ts.map +1 -0
- package/resource-creation/WizardNav.js +29 -0
- package/resource-creation/WizardNav.js.map +1 -0
- package/resource-creation/WizardShell.d.ts +41 -0
- package/resource-creation/WizardShell.d.ts.map +1 -0
- package/resource-creation/WizardShell.js +55 -0
- package/resource-creation/WizardShell.js.map +1 -0
- package/resource-creation/index.d.ts +21 -0
- package/resource-creation/index.d.ts.map +1 -0
- package/resource-creation/index.js +14 -0
- package/resource-creation/index.js.map +1 -0
- package/resource-creation/templates/agent-templates.d.ts +15 -0
- package/resource-creation/templates/agent-templates.d.ts.map +1 -0
- package/resource-creation/templates/agent-templates.js +148 -0
- package/resource-creation/templates/agent-templates.js.map +1 -0
- package/resource-creation/templates/index.d.ts +5 -0
- package/resource-creation/templates/index.d.ts.map +1 -0
- package/resource-creation/templates/index.js +5 -0
- package/resource-creation/templates/index.js.map +1 -0
- package/resource-creation/templates/mcp-server-templates.d.ts +15 -0
- package/resource-creation/templates/mcp-server-templates.d.ts.map +1 -0
- package/resource-creation/templates/mcp-server-templates.js +92 -0
- package/resource-creation/templates/mcp-server-templates.js.map +1 -0
- package/resource-creation/templates/types.d.ts +48 -0
- package/resource-creation/templates/types.d.ts.map +1 -0
- package/resource-creation/templates/types.js +16 -0
- package/resource-creation/templates/types.js.map +1 -0
- package/resource-creation/types.d.ts +88 -0
- package/resource-creation/types.d.ts.map +1 -0
- package/resource-creation/types.js +2 -0
- package/resource-creation/types.js.map +1 -0
- package/resource-creation/useTemplateFilter.d.ts +43 -0
- package/resource-creation/useTemplateFilter.d.ts.map +1 -0
- package/resource-creation/useTemplateFilter.js +73 -0
- package/resource-creation/useTemplateFilter.js.map +1 -0
- package/resource-creation/useWizardState.d.ts +67 -0
- package/resource-creation/useWizardState.d.ts.map +1 -0
- package/resource-creation/useWizardState.js +143 -0
- package/resource-creation/useWizardState.js.map +1 -0
- package/resource-detail/ConfirmDialog.d.ts +44 -0
- package/resource-detail/ConfirmDialog.d.ts.map +1 -0
- package/resource-detail/ConfirmDialog.js +62 -0
- package/resource-detail/ConfirmDialog.js.map +1 -0
- package/resource-detail/ResourceActionBar.d.ts +42 -0
- package/resource-detail/ResourceActionBar.d.ts.map +1 -0
- package/resource-detail/ResourceActionBar.js +64 -0
- package/resource-detail/ResourceActionBar.js.map +1 -0
- package/resource-detail/ResourceDetailShell.d.ts +36 -0
- package/resource-detail/ResourceDetailShell.d.ts.map +1 -0
- package/resource-detail/ResourceDetailShell.js +65 -0
- package/resource-detail/ResourceDetailShell.js.map +1 -0
- package/resource-detail/Section.d.ts +18 -0
- package/resource-detail/Section.d.ts.map +1 -0
- package/resource-detail/Section.js +18 -0
- package/resource-detail/Section.js.map +1 -0
- package/resource-detail/index.d.ts +15 -0
- package/resource-detail/index.d.ts.map +1 -0
- package/resource-detail/index.js +10 -0
- package/resource-detail/index.js.map +1 -0
- package/resource-detail/types.d.ts +146 -0
- package/resource-detail/types.d.ts.map +1 -0
- package/resource-detail/types.js +2 -0
- package/resource-detail/types.js.map +1 -0
- package/resource-detail/useConfirmAction.d.ts +41 -0
- package/resource-detail/useConfirmAction.d.ts.map +1 -0
- package/resource-detail/useConfirmAction.js +30 -0
- package/resource-detail/useConfirmAction.js.map +1 -0
- package/resource-detail/useCopyResource.d.ts +28 -0
- package/resource-detail/useCopyResource.d.ts.map +1 -0
- package/resource-detail/useCopyResource.js +46 -0
- package/resource-detail/useCopyResource.js.map +1 -0
- package/resource-detail/useDeleteResource.d.ts +40 -0
- package/resource-detail/useDeleteResource.d.ts.map +1 -0
- package/resource-detail/useDeleteResource.js +83 -0
- package/resource-detail/useDeleteResource.js.map +1 -0
- package/resource-detail/useDetailTabs.d.ts +46 -0
- package/resource-detail/useDetailTabs.d.ts.map +1 -0
- package/resource-detail/useDetailTabs.js +47 -0
- package/resource-detail/useDetailTabs.js.map +1 -0
- package/resource-workbench/components/BulkActionBar.d.ts +36 -0
- package/resource-workbench/components/BulkActionBar.d.ts.map +1 -0
- package/resource-workbench/components/BulkActionBar.js +35 -0
- package/resource-workbench/components/BulkActionBar.js.map +1 -0
- package/resource-workbench/components/ColumnHeader.d.ts +23 -0
- package/resource-workbench/components/ColumnHeader.d.ts.map +1 -0
- package/resource-workbench/components/ColumnHeader.js +25 -0
- package/resource-workbench/components/ColumnHeader.js.map +1 -0
- package/resource-workbench/components/FilterBar.d.ts +33 -0
- package/resource-workbench/components/FilterBar.d.ts.map +1 -0
- package/resource-workbench/components/FilterBar.js +72 -0
- package/resource-workbench/components/FilterBar.js.map +1 -0
- package/resource-workbench/components/ResourceAvatar.d.ts +29 -0
- package/resource-workbench/components/ResourceAvatar.d.ts.map +1 -0
- package/resource-workbench/components/ResourceAvatar.js +51 -0
- package/resource-workbench/components/ResourceAvatar.js.map +1 -0
- package/resource-workbench/components/ResourceCards.d.ts +39 -0
- package/resource-workbench/components/ResourceCards.d.ts.map +1 -0
- package/resource-workbench/components/ResourceCards.js +41 -0
- package/resource-workbench/components/ResourceCards.js.map +1 -0
- package/resource-workbench/components/ResourceInspector.d.ts +26 -0
- package/resource-workbench/components/ResourceInspector.d.ts.map +1 -0
- package/resource-workbench/components/ResourceInspector.js +22 -0
- package/resource-workbench/components/ResourceInspector.js.map +1 -0
- package/resource-workbench/components/ResourceList.d.ts +39 -0
- package/resource-workbench/components/ResourceList.d.ts.map +1 -0
- package/resource-workbench/components/ResourceList.js +41 -0
- package/resource-workbench/components/ResourceList.js.map +1 -0
- package/resource-workbench/components/ResourceTable.d.ts +47 -0
- package/resource-workbench/components/ResourceTable.d.ts.map +1 -0
- package/resource-workbench/components/ResourceTable.js +78 -0
- package/resource-workbench/components/ResourceTable.js.map +1 -0
- package/resource-workbench/components/ResourceWorkbench.d.ts +131 -0
- package/resource-workbench/components/ResourceWorkbench.d.ts.map +1 -0
- package/resource-workbench/components/ResourceWorkbench.js +170 -0
- package/resource-workbench/components/ResourceWorkbench.js.map +1 -0
- package/resource-workbench/components/SelectionCheckbox.d.ts +24 -0
- package/resource-workbench/components/SelectionCheckbox.d.ts.map +1 -0
- package/resource-workbench/components/SelectionCheckbox.js +16 -0
- package/resource-workbench/components/SelectionCheckbox.js.map +1 -0
- package/resource-workbench/components/StatusBadge.d.ts +31 -0
- package/resource-workbench/components/StatusBadge.d.ts.map +1 -0
- package/resource-workbench/components/StatusBadge.js +75 -0
- package/resource-workbench/components/StatusBadge.js.map +1 -0
- package/resource-workbench/components/ViewSwitcher.d.ts +21 -0
- package/resource-workbench/components/ViewSwitcher.d.ts.map +1 -0
- package/resource-workbench/components/ViewSwitcher.js +37 -0
- package/resource-workbench/components/ViewSwitcher.js.map +1 -0
- package/resource-workbench/hooks/useResourceCollection.d.ts +93 -0
- package/resource-workbench/hooks/useResourceCollection.d.ts.map +1 -0
- package/resource-workbench/hooks/useResourceCollection.js +133 -0
- package/resource-workbench/hooks/useResourceCollection.js.map +1 -0
- package/resource-workbench/hooks/useResourceFilters.d.ts +73 -0
- package/resource-workbench/hooks/useResourceFilters.d.ts.map +1 -0
- package/resource-workbench/hooks/useResourceFilters.js +105 -0
- package/resource-workbench/hooks/useResourceFilters.js.map +1 -0
- package/resource-workbench/hooks/useResourceSelection.d.ts +44 -0
- package/resource-workbench/hooks/useResourceSelection.d.ts.map +1 -0
- package/resource-workbench/hooks/useResourceSelection.js +123 -0
- package/resource-workbench/hooks/useResourceSelection.js.map +1 -0
- package/resource-workbench/hooks/useViewPreference.d.ts +32 -0
- package/resource-workbench/hooks/useViewPreference.d.ts.map +1 -0
- package/resource-workbench/hooks/useViewPreference.js +60 -0
- package/resource-workbench/hooks/useViewPreference.js.map +1 -0
- package/resource-workbench/index.d.ts +34 -0
- package/resource-workbench/index.d.ts.map +1 -0
- package/resource-workbench/index.js +19 -0
- package/resource-workbench/index.js.map +1 -0
- package/resource-workbench/types.d.ts +165 -0
- package/resource-workbench/types.d.ts.map +1 -0
- package/resource-workbench/types.js +2 -0
- package/resource-workbench/types.js.map +1 -0
- package/runner/RunnerDetailView.d.ts +44 -0
- package/runner/RunnerDetailView.d.ts.map +1 -0
- package/runner/RunnerDetailView.js +154 -0
- package/runner/RunnerDetailView.js.map +1 -0
- package/runner/RunnerListPanel.d.ts +26 -1
- package/runner/RunnerListPanel.d.ts.map +1 -1
- package/runner/RunnerListPanel.js +68 -46
- package/runner/RunnerListPanel.js.map +1 -1
- package/runner/index.d.ts +7 -1
- package/runner/index.d.ts.map +1 -1
- package/runner/index.js +3 -0
- package/runner/index.js.map +1 -1
- package/runner/shared.d.ts +31 -0
- package/runner/shared.d.ts.map +1 -0
- package/runner/shared.js +55 -0
- package/runner/shared.js.map +1 -0
- package/runner/useRunner.d.ts +37 -0
- package/runner/useRunner.d.ts.map +1 -0
- package/runner/useRunner.js +24 -0
- package/runner/useRunner.js.map +1 -0
- package/session/__tests__/group-sessions.test.js +3 -3
- package/session/__tests__/group-sessions.test.js.map +1 -1
- package/skill/SkillDetailView.d.ts +70 -7
- package/skill/SkillDetailView.d.ts.map +1 -1
- package/skill/SkillDetailView.js +107 -39
- package/skill/SkillDetailView.js.map +1 -1
- package/skill/SkillDiffDialog.d.ts +42 -0
- package/skill/SkillDiffDialog.d.ts.map +1 -0
- package/skill/SkillDiffDialog.js +72 -0
- package/skill/SkillDiffDialog.js.map +1 -0
- package/skill/SkillFileBrowser.d.ts +31 -0
- package/skill/SkillFileBrowser.d.ts.map +1 -0
- package/skill/SkillFileBrowser.js +105 -0
- package/skill/SkillFileBrowser.js.map +1 -0
- package/skill/SkillUploader.d.ts +39 -0
- package/skill/SkillUploader.d.ts.map +1 -0
- package/skill/SkillUploader.js +141 -0
- package/skill/SkillUploader.js.map +1 -0
- package/skill/index.d.ts +18 -0
- package/skill/index.d.ts.map +1 -1
- package/skill/index.js +9 -0
- package/skill/index.js.map +1 -1
- package/skill/internal/computeArtifactHash.d.ts +9 -0
- package/skill/internal/computeArtifactHash.d.ts.map +1 -0
- package/skill/internal/computeArtifactHash.js +14 -0
- package/skill/internal/computeArtifactHash.js.map +1 -0
- package/skill/internal/fetchAndUnpackArtifact.d.ts +16 -0
- package/skill/internal/fetchAndUnpackArtifact.d.ts.map +1 -0
- package/skill/internal/fetchAndUnpackArtifact.js +34 -0
- package/skill/internal/fetchAndUnpackArtifact.js.map +1 -0
- package/skill/usePushSkill.d.ts +53 -0
- package/skill/usePushSkill.d.ts.map +1 -0
- package/skill/usePushSkill.js +57 -0
- package/skill/usePushSkill.js.map +1 -0
- package/skill/useSkillArtifact.d.ts +37 -0
- package/skill/useSkillArtifact.d.ts.map +1 -0
- package/skill/useSkillArtifact.js +76 -0
- package/skill/useSkillArtifact.js.map +1 -0
- package/skill/useSkillDiff.d.ts +31 -0
- package/skill/useSkillDiff.d.ts.map +1 -0
- package/skill/useSkillDiff.js +97 -0
- package/skill/useSkillDiff.js.map +1 -0
- package/skill/useSkillDuplicateCheck.d.ts +34 -0
- package/skill/useSkillDuplicateCheck.d.ts.map +1 -0
- package/skill/useSkillDuplicateCheck.js +58 -0
- package/skill/useSkillDuplicateCheck.js.map +1 -0
- package/skill/useSkillUpload.d.ts +69 -0
- package/skill/useSkillUpload.d.ts.map +1 -0
- package/skill/useSkillUpload.js +157 -0
- package/skill/useSkillUpload.js.map +1 -0
- package/skill/useSkillVersions.d.ts +46 -0
- package/skill/useSkillVersions.d.ts.map +1 -0
- package/skill/useSkillVersions.js +104 -0
- package/skill/useSkillVersions.js.map +1 -0
- package/src/action-menu/ActionMenu.tsx +151 -0
- package/src/action-menu/index.ts +9 -0
- package/src/action-menu/types.ts +70 -0
- package/src/agent/AgentCreationWizard.tsx +201 -0
- package/src/agent/AgentDetailView.tsx +817 -321
- package/src/agent/index.ts +16 -0
- package/src/agent/internal/agentToInput.ts +95 -0
- package/src/agent/steps/CapabilitiesStep.tsx +363 -0
- package/src/agent/steps/IdentityStep.tsx +259 -0
- package/src/agent/steps/ReviewStep.tsx +211 -0
- package/src/agent/steps/types.ts +53 -0
- package/src/agent/useCreateAgent.ts +76 -0
- package/src/agent/useUpdateAgent.ts +55 -0
- package/src/dependency-graph/DependencyGraph.tsx +153 -0
- package/src/dependency-graph/DependencyTreeNode.tsx +282 -0
- package/src/dependency-graph/index.ts +15 -0
- package/src/dependency-graph/types.ts +131 -0
- package/src/dependency-graph/useDependencyGraph.ts +158 -0
- package/src/empty-state/EmptyState.tsx +90 -0
- package/src/empty-state/index.ts +9 -0
- package/src/empty-state/types.ts +81 -0
- package/src/empty-state/useEmptyState.ts +85 -0
- package/src/execution/MessageThread.tsx +26 -15
- package/src/execution/SetupProgress.tsx +35 -14
- package/src/execution/__tests__/thread-keys.test.ts +101 -0
- package/src/feedback/StigmerToaster.tsx +45 -0
- package/src/feedback/index.ts +3 -0
- package/src/feedback/toast.ts +13 -0
- package/src/feedback/types.ts +7 -0
- package/src/index.ts +270 -8
- package/src/inline-edit/InlineEditImage.tsx +208 -0
- package/src/inline-edit/InlineEditKeyValue.tsx +278 -0
- package/src/inline-edit/InlineEditResourceList.tsx +325 -0
- package/src/inline-edit/InlineEditSelect.tsx +150 -0
- package/src/inline-edit/InlineEditText.tsx +211 -0
- package/src/inline-edit/InlineEditTextarea.tsx +209 -0
- package/src/inline-edit/index.ts +28 -0
- package/src/inline-edit/types.ts +47 -0
- package/src/inline-edit/useInlineFieldSave.ts +62 -0
- package/src/internal/Tabs.tsx +4 -164
- package/src/library/ImportResourceDialog.tsx +227 -0
- package/src/library/index.ts +18 -8
- package/src/library/serialize-resource-yaml.ts +356 -0
- package/src/library/useExportResource.ts +183 -0
- package/src/library/useImportResource.ts +253 -0
- package/src/mcp-server/McpServerCreationWizard.tsx +206 -0
- package/src/mcp-server/McpServerDetailView.tsx +392 -105
- package/src/mcp-server/index.ts +16 -0
- package/src/mcp-server/internal/mcpServerToInput.ts +95 -0
- package/src/mcp-server/steps/EnvironmentAuthStep.tsx +462 -0
- package/src/mcp-server/steps/IdentityTransportStep.tsx +531 -0
- package/src/mcp-server/steps/ReviewStep.tsx +297 -0
- package/src/mcp-server/steps/types.ts +85 -0
- package/src/mcp-server/useCreateMcpServer.ts +76 -0
- package/src/mcp-server/useUpdateMcpServer.ts +55 -0
- package/src/models/registry.ts +10 -2
- package/src/provider.tsx +1 -1
- package/src/resource-creation/CreationPicker.tsx +292 -0
- package/src/resource-creation/StepIndicator.tsx +156 -0
- package/src/resource-creation/TemplateCard.tsx +143 -0
- package/src/resource-creation/TemplateGallery.tsx +222 -0
- package/src/resource-creation/WizardNav.tsx +163 -0
- package/src/resource-creation/WizardShell.tsx +124 -0
- package/src/resource-creation/index.ts +45 -0
- package/src/resource-creation/templates/agent-templates.ts +160 -0
- package/src/resource-creation/templates/index.ts +7 -0
- package/src/resource-creation/templates/mcp-server-templates.ts +106 -0
- package/src/resource-creation/templates/types.ts +64 -0
- package/src/resource-creation/types.ts +105 -0
- package/src/resource-creation/useTemplateFilter.ts +117 -0
- package/src/resource-creation/useWizardState.ts +223 -0
- package/src/resource-detail/ConfirmDialog.tsx +127 -0
- package/src/resource-detail/ResourceActionBar.tsx +157 -0
- package/src/resource-detail/ResourceDetailShell.tsx +184 -0
- package/src/resource-detail/Section.tsx +78 -0
- package/src/resource-detail/index.ts +34 -0
- package/src/resource-detail/types.ts +177 -0
- package/src/resource-detail/useConfirmAction.ts +70 -0
- package/src/resource-detail/useCopyResource.ts +74 -0
- package/src/resource-detail/useDeleteResource.ts +110 -0
- package/src/resource-detail/useDetailTabs.ts +93 -0
- package/src/resource-workbench/components/BulkActionBar.tsx +122 -0
- package/src/resource-workbench/components/ColumnHeader.tsx +105 -0
- package/src/resource-workbench/components/FilterBar.tsx +173 -0
- package/src/resource-workbench/components/ResourceAvatar.tsx +109 -0
- package/src/resource-workbench/components/ResourceCards.tsx +126 -0
- package/src/resource-workbench/components/ResourceInspector.tsx +88 -0
- package/src/resource-workbench/components/ResourceList.tsx +121 -0
- package/src/resource-workbench/components/ResourceTable.tsx +222 -0
- package/src/resource-workbench/components/ResourceWorkbench.tsx +695 -0
- package/src/resource-workbench/components/SelectionCheckbox.tsx +52 -0
- package/src/resource-workbench/components/StatusBadge.tsx +119 -0
- package/src/resource-workbench/components/ViewSwitcher.tsx +135 -0
- package/src/resource-workbench/hooks/useResourceCollection.ts +261 -0
- package/src/resource-workbench/hooks/useResourceFilters.ts +216 -0
- package/src/resource-workbench/hooks/useResourceSelection.ts +178 -0
- package/src/resource-workbench/hooks/useViewPreference.ts +75 -0
- package/src/resource-workbench/index.ts +73 -0
- package/src/resource-workbench/types.ts +220 -0
- package/src/runner/RunnerDetailView.tsx +410 -0
- package/src/runner/RunnerListPanel.tsx +126 -111
- package/src/runner/index.ts +13 -1
- package/src/runner/shared.tsx +124 -0
- package/src/runner/useRunner.ts +59 -0
- package/src/session/__tests__/group-sessions.test.ts +5 -3
- package/src/skill/SkillDetailView.tsx +371 -165
- package/src/skill/SkillDiffDialog.tsx +213 -0
- package/src/skill/SkillFileBrowser.tsx +289 -0
- package/src/skill/SkillUploader.tsx +481 -0
- package/src/skill/index.ts +34 -0
- package/src/skill/internal/computeArtifactHash.ts +13 -0
- package/src/skill/internal/fetchAndUnpackArtifact.ts +48 -0
- package/src/skill/usePushSkill.ts +101 -0
- package/src/skill/useSkillArtifact.ts +107 -0
- package/src/skill/useSkillDiff.ts +128 -0
- package/src/skill/useSkillDuplicateCheck.ts +92 -0
- package/src/skill/useSkillUpload.ts +231 -0
- package/src/skill/useSkillVersions.ts +165 -0
- package/src/styles.css +28 -0
- package/src/tabs/Tabs.tsx +184 -0
- package/src/tabs/index.ts +2 -0
- package/src/version-history/DiffFileList.tsx +111 -0
- package/src/version-history/DiffSummary.tsx +61 -0
- package/src/version-history/DiffViewer.tsx +163 -0
- package/src/version-history/MultiFileDiffView.tsx +114 -0
- package/src/version-history/VersionTimeline.tsx +232 -0
- package/src/version-history/VersionTimelineEntry.tsx +254 -0
- package/src/version-history/computeDiff.ts +61 -0
- package/src/version-history/computeMultiFileDiff.ts +97 -0
- package/src/version-history/index.ts +22 -0
- package/src/version-history/types.ts +129 -0
- package/styles.css +1 -1
- package/tabs/Tabs.d.ts +58 -0
- package/tabs/Tabs.d.ts.map +1 -0
- package/tabs/Tabs.js +80 -0
- package/tabs/Tabs.js.map +1 -0
- package/tabs/index.d.ts +3 -0
- package/tabs/index.d.ts.map +1 -0
- package/tabs/index.js +2 -0
- package/tabs/index.js.map +1 -0
- package/version-history/DiffFileList.d.ts +22 -0
- package/version-history/DiffFileList.d.ts.map +1 -0
- package/version-history/DiffFileList.js +37 -0
- package/version-history/DiffFileList.js.map +1 -0
- package/version-history/DiffSummary.d.ts +21 -0
- package/version-history/DiffSummary.d.ts.map +1 -0
- package/version-history/DiffSummary.js +16 -0
- package/version-history/DiffSummary.js.map +1 -0
- package/version-history/DiffViewer.d.ts +31 -0
- package/version-history/DiffViewer.d.ts.map +1 -0
- package/version-history/DiffViewer.js +60 -0
- package/version-history/DiffViewer.js.map +1 -0
- package/version-history/MultiFileDiffView.d.ts +30 -0
- package/version-history/MultiFileDiffView.d.ts.map +1 -0
- package/version-history/MultiFileDiffView.js +40 -0
- package/version-history/MultiFileDiffView.js.map +1 -0
- package/version-history/VersionTimeline.d.ts +29 -0
- package/version-history/VersionTimeline.d.ts.map +1 -0
- package/version-history/VersionTimeline.js +87 -0
- package/version-history/VersionTimeline.js.map +1 -0
- package/version-history/VersionTimelineEntry.d.ts +22 -0
- package/version-history/VersionTimelineEntry.d.ts.map +1 -0
- package/version-history/VersionTimelineEntry.js +98 -0
- package/version-history/VersionTimelineEntry.js.map +1 -0
- package/version-history/computeDiff.d.ts +16 -0
- package/version-history/computeDiff.d.ts.map +1 -0
- package/version-history/computeDiff.js +54 -0
- package/version-history/computeDiff.js.map +1 -0
- package/version-history/computeMultiFileDiff.d.ts +15 -0
- package/version-history/computeMultiFileDiff.d.ts.map +1 -0
- package/version-history/computeMultiFileDiff.js +83 -0
- package/version-history/computeMultiFileDiff.js.map +1 -0
- package/version-history/index.d.ts +14 -0
- package/version-history/index.d.ts.map +1 -0
- package/version-history/index.js +9 -0
- package/version-history/index.js.map +1 -0
- package/version-history/types.d.ts +106 -0
- package/version-history/types.d.ts.map +1 -0
- package/version-history/types.js +2 -0
- package/version-history/types.js.map +1 -0
- package/library/ResourceListView.d.ts +0 -174
- package/library/ResourceListView.d.ts.map +0 -1
- package/library/ResourceListView.js +0 -318
- package/library/ResourceListView.js.map +0 -1
- package/src/library/ResourceListView.tsx +0 -956
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useState } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import type { InlineEditBaseProps, KeyValueRow } from "./types";
|
|
6
|
+
|
|
7
|
+
/** Props for {@link InlineEditKeyValue}. */
|
|
8
|
+
export interface InlineEditKeyValueProps extends InlineEditBaseProps {
|
|
9
|
+
/** Current key-value entries. */
|
|
10
|
+
readonly value: readonly KeyValueRow[];
|
|
11
|
+
/** Called with the updated rows when a change is confirmed. */
|
|
12
|
+
readonly onSave: (rows: KeyValueRow[]) => Promise<boolean>;
|
|
13
|
+
/** Label for the "key" column. @default "Key" */
|
|
14
|
+
readonly keyLabel?: string;
|
|
15
|
+
/** Show the "secret" toggle per row. @default false */
|
|
16
|
+
readonly showSecretToggle?: boolean;
|
|
17
|
+
/** Show the "optional" toggle per row. @default false */
|
|
18
|
+
readonly showOptionalToggle?: boolean;
|
|
19
|
+
/** Show the description field per row. @default false */
|
|
20
|
+
readonly showDescription?: boolean;
|
|
21
|
+
/** Controlled editing state. */
|
|
22
|
+
readonly editing?: boolean;
|
|
23
|
+
/** Called when editing state changes (controlled mode). */
|
|
24
|
+
readonly onEditingChange?: (editing: boolean) => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Inline editor for key-value pair lists (env vars, tags, etc.).
|
|
29
|
+
*
|
|
30
|
+
* Read mode shows a compact table. Edit mode adds/removes/edits
|
|
31
|
+
* rows with per-row confirmation. The full updated list is saved
|
|
32
|
+
* when the user clicks "Save changes".
|
|
33
|
+
*/
|
|
34
|
+
export function InlineEditKeyValue({
|
|
35
|
+
value,
|
|
36
|
+
onSave,
|
|
37
|
+
keyLabel = "Key",
|
|
38
|
+
showSecretToggle = false,
|
|
39
|
+
showOptionalToggle = false,
|
|
40
|
+
showDescription = false,
|
|
41
|
+
editing: controlledEditing,
|
|
42
|
+
onEditingChange,
|
|
43
|
+
disabled,
|
|
44
|
+
isSaving,
|
|
45
|
+
error,
|
|
46
|
+
className,
|
|
47
|
+
}: InlineEditKeyValueProps) {
|
|
48
|
+
const [internalEditing, setInternalEditing] = useState(false);
|
|
49
|
+
const isEditing = controlledEditing ?? internalEditing;
|
|
50
|
+
const setIsEditing = useCallback(
|
|
51
|
+
(v: boolean) => {
|
|
52
|
+
setInternalEditing(v);
|
|
53
|
+
onEditingChange?.(v);
|
|
54
|
+
},
|
|
55
|
+
[onEditingChange],
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
if (controlledEditing !== undefined) setInternalEditing(controlledEditing);
|
|
60
|
+
}, [controlledEditing]);
|
|
61
|
+
|
|
62
|
+
const [draft, setDraft] = useState<KeyValueRow[]>([...value]);
|
|
63
|
+
|
|
64
|
+
const handleEdit = useCallback(() => {
|
|
65
|
+
setDraft([...value]);
|
|
66
|
+
setIsEditing(true);
|
|
67
|
+
}, [value, setIsEditing]);
|
|
68
|
+
|
|
69
|
+
const handleCancel = useCallback(() => {
|
|
70
|
+
setIsEditing(false);
|
|
71
|
+
setDraft([...value]);
|
|
72
|
+
}, [value, setIsEditing]);
|
|
73
|
+
|
|
74
|
+
const handleSave = useCallback(async () => {
|
|
75
|
+
const filtered = draft.filter((r) => r.key.trim());
|
|
76
|
+
const ok = await onSave(filtered);
|
|
77
|
+
if (ok) setIsEditing(false);
|
|
78
|
+
}, [draft, onSave, setIsEditing]);
|
|
79
|
+
|
|
80
|
+
const updateRow = useCallback((index: number, patch: Partial<KeyValueRow>) => {
|
|
81
|
+
setDraft((prev) => prev.map((r, i) => (i === index ? { ...r, ...patch } : r)));
|
|
82
|
+
}, []);
|
|
83
|
+
|
|
84
|
+
const removeRow = useCallback((index: number) => {
|
|
85
|
+
setDraft((prev) => prev.filter((_, i) => i !== index));
|
|
86
|
+
}, []);
|
|
87
|
+
|
|
88
|
+
const addRow = useCallback(() => {
|
|
89
|
+
setDraft((prev) => [...prev, { key: "", value: "", isSecret: false, description: "" }]);
|
|
90
|
+
}, []);
|
|
91
|
+
|
|
92
|
+
if (disabled || !isEditing) {
|
|
93
|
+
return (
|
|
94
|
+
<div className={cn("flex flex-col", className)}>
|
|
95
|
+
{value.length > 0 ? (
|
|
96
|
+
<div className="flex flex-col divide-y divide-border">
|
|
97
|
+
{value.map((row) => (
|
|
98
|
+
<div key={row.key} className="flex items-start gap-3 px-3 py-2.5">
|
|
99
|
+
<code className="shrink-0 font-mono text-sm font-medium text-foreground">
|
|
100
|
+
{row.key}
|
|
101
|
+
</code>
|
|
102
|
+
{showSecretToggle && (
|
|
103
|
+
<span className="shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground">
|
|
104
|
+
{row.isSecret ? "secret" : "config"}
|
|
105
|
+
</span>
|
|
106
|
+
)}
|
|
107
|
+
{showOptionalToggle && row.optional && (
|
|
108
|
+
<span className="shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground-subtle">
|
|
109
|
+
optional
|
|
110
|
+
</span>
|
|
111
|
+
)}
|
|
112
|
+
{row.description && (
|
|
113
|
+
<span className="text-xs text-muted-foreground">{row.description}</span>
|
|
114
|
+
)}
|
|
115
|
+
</div>
|
|
116
|
+
))}
|
|
117
|
+
</div>
|
|
118
|
+
) : (
|
|
119
|
+
<p className="px-3 py-3 text-xs text-muted-foreground italic">No entries</p>
|
|
120
|
+
)}
|
|
121
|
+
</div>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return (
|
|
126
|
+
<div className={cn("flex flex-col gap-3", className)}>
|
|
127
|
+
{draft.map((row, i) => (
|
|
128
|
+
<div key={i} className="flex items-start gap-2 rounded-md border border-border bg-muted-faint p-2.5">
|
|
129
|
+
<div className="flex flex-1 flex-col gap-1.5">
|
|
130
|
+
<input
|
|
131
|
+
type="text"
|
|
132
|
+
value={row.key}
|
|
133
|
+
onChange={(e) => updateRow(i, { key: e.target.value })}
|
|
134
|
+
placeholder={keyLabel}
|
|
135
|
+
className={cn(
|
|
136
|
+
"rounded-md border border-border bg-input-bg px-2 py-1 font-mono text-sm text-foreground",
|
|
137
|
+
"focus:outline-none focus:ring-2 focus:ring-ring",
|
|
138
|
+
)}
|
|
139
|
+
/>
|
|
140
|
+
{showDescription && (
|
|
141
|
+
<input
|
|
142
|
+
type="text"
|
|
143
|
+
value={row.description ?? ""}
|
|
144
|
+
onChange={(e) => updateRow(i, { description: e.target.value })}
|
|
145
|
+
placeholder="Description"
|
|
146
|
+
className={cn(
|
|
147
|
+
"rounded-md border border-border bg-input-bg px-2 py-1 text-xs text-foreground",
|
|
148
|
+
"focus:outline-none focus:ring-2 focus:ring-ring",
|
|
149
|
+
)}
|
|
150
|
+
/>
|
|
151
|
+
)}
|
|
152
|
+
<div className="flex items-center gap-3">
|
|
153
|
+
{showSecretToggle && (
|
|
154
|
+
<label className="inline-flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer">
|
|
155
|
+
<input
|
|
156
|
+
type="checkbox"
|
|
157
|
+
checked={row.isSecret ?? false}
|
|
158
|
+
onChange={(e) => updateRow(i, { isSecret: e.target.checked })}
|
|
159
|
+
className="size-3.5 rounded border-border"
|
|
160
|
+
/>
|
|
161
|
+
Secret
|
|
162
|
+
</label>
|
|
163
|
+
)}
|
|
164
|
+
{showOptionalToggle && (
|
|
165
|
+
<label className="inline-flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer">
|
|
166
|
+
<input
|
|
167
|
+
type="checkbox"
|
|
168
|
+
checked={row.optional ?? false}
|
|
169
|
+
onChange={(e) => updateRow(i, { optional: e.target.checked })}
|
|
170
|
+
className="size-3.5 rounded border-border"
|
|
171
|
+
/>
|
|
172
|
+
Optional
|
|
173
|
+
</label>
|
|
174
|
+
)}
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
<button
|
|
178
|
+
type="button"
|
|
179
|
+
onClick={() => removeRow(i)}
|
|
180
|
+
aria-label={`Remove ${row.key || "entry"}`}
|
|
181
|
+
className={cn(
|
|
182
|
+
"mt-1 inline-flex size-6 items-center justify-center rounded-md text-muted-foreground",
|
|
183
|
+
"hover:bg-destructive-subtle hover:text-destructive",
|
|
184
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
185
|
+
)}
|
|
186
|
+
>
|
|
187
|
+
<TrashIcon className="size-3.5" />
|
|
188
|
+
</button>
|
|
189
|
+
</div>
|
|
190
|
+
))}
|
|
191
|
+
|
|
192
|
+
<button
|
|
193
|
+
type="button"
|
|
194
|
+
onClick={addRow}
|
|
195
|
+
className={cn(
|
|
196
|
+
"inline-flex items-center gap-1 rounded-md px-2.5 py-1.5 text-xs font-medium",
|
|
197
|
+
"border border-dashed border-border text-muted-foreground",
|
|
198
|
+
"hover:border-muted-foreground hover:text-foreground hover:bg-muted-subtle",
|
|
199
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
200
|
+
"transition-colors",
|
|
201
|
+
)}
|
|
202
|
+
>
|
|
203
|
+
<PlusIcon className="size-3" />
|
|
204
|
+
Add entry
|
|
205
|
+
</button>
|
|
206
|
+
|
|
207
|
+
<div className="flex items-center justify-end gap-1.5">
|
|
208
|
+
<button
|
|
209
|
+
type="button"
|
|
210
|
+
onClick={handleCancel}
|
|
211
|
+
disabled={isSaving}
|
|
212
|
+
className={cn(
|
|
213
|
+
"rounded-md px-2.5 py-1 text-xs font-medium",
|
|
214
|
+
"border border-border bg-background text-foreground hover:bg-accent",
|
|
215
|
+
"disabled:opacity-50",
|
|
216
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
217
|
+
)}
|
|
218
|
+
>
|
|
219
|
+
Cancel
|
|
220
|
+
</button>
|
|
221
|
+
<button
|
|
222
|
+
type="button"
|
|
223
|
+
onClick={handleSave}
|
|
224
|
+
disabled={isSaving}
|
|
225
|
+
className={cn(
|
|
226
|
+
"inline-flex items-center gap-1 rounded-md px-2.5 py-1 text-xs font-medium",
|
|
227
|
+
"bg-primary text-primary-foreground hover:bg-primary-hover",
|
|
228
|
+
"disabled:opacity-50",
|
|
229
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
230
|
+
)}
|
|
231
|
+
>
|
|
232
|
+
{isSaving && <Spinner />}
|
|
233
|
+
Save changes
|
|
234
|
+
</button>
|
|
235
|
+
</div>
|
|
236
|
+
|
|
237
|
+
{error && (
|
|
238
|
+
<p className="px-1 text-xs text-destructive" role="alert">{error}</p>
|
|
239
|
+
)}
|
|
240
|
+
</div>
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// ---------------------------------------------------------------------------
|
|
245
|
+
// Icons
|
|
246
|
+
// ---------------------------------------------------------------------------
|
|
247
|
+
|
|
248
|
+
function PencilIcon({ className }: { readonly className?: string }) {
|
|
249
|
+
return (
|
|
250
|
+
<svg className={className} viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
|
251
|
+
<path d="M11.5 1.5a2.121 2.121 0 0 1 3 3L5 14l-4 1 1-4Z" />
|
|
252
|
+
</svg>
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function PlusIcon({ className }: { readonly className?: string }) {
|
|
257
|
+
return (
|
|
258
|
+
<svg className={className} viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" aria-hidden="true">
|
|
259
|
+
<path d="M8 3v10M3 8h10" />
|
|
260
|
+
</svg>
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
function TrashIcon({ className }: { readonly className?: string }) {
|
|
265
|
+
return (
|
|
266
|
+
<svg className={className} viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
|
267
|
+
<path d="M2 4h12M5.333 4V2.667a1.333 1.333 0 0 1 1.334-1.334h2.666a1.333 1.333 0 0 1 1.334 1.334V4M12.667 4v9.333a1.333 1.333 0 0 1-1.334 1.334H4.667a1.333 1.333 0 0 1-1.334-1.334V4" />
|
|
268
|
+
</svg>
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
function Spinner() {
|
|
273
|
+
return (
|
|
274
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" className="animate-spin" aria-hidden="true">
|
|
275
|
+
<path d="M8 2a6 6 0 1 0 6 6" />
|
|
276
|
+
</svg>
|
|
277
|
+
);
|
|
278
|
+
}
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useState } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import type { InlineEditBaseProps, ResourceRefRow } from "./types";
|
|
6
|
+
|
|
7
|
+
/** Props for {@link InlineEditResourceList}. */
|
|
8
|
+
export interface InlineEditResourceListProps extends InlineEditBaseProps {
|
|
9
|
+
/** Current resource references. */
|
|
10
|
+
readonly value: readonly ResourceRefRow[];
|
|
11
|
+
/** Called with the updated list when a change is confirmed. */
|
|
12
|
+
readonly onSave: (refs: ResourceRefRow[]) => Promise<boolean>;
|
|
13
|
+
/**
|
|
14
|
+
* Inline picker rendered when the user clicks "Add".
|
|
15
|
+
* Receives `onSelect` to call when a resource is chosen.
|
|
16
|
+
* The consumer provides the appropriate domain-specific picker.
|
|
17
|
+
*/
|
|
18
|
+
readonly renderPicker?: (onSelect: (ref: ResourceRefRow) => void) => React.ReactNode;
|
|
19
|
+
/** Click handler for navigating to a referenced resource. */
|
|
20
|
+
readonly onItemClick?: (ref: ResourceRefRow) => void;
|
|
21
|
+
/** Icon rendered next to each item. */
|
|
22
|
+
readonly itemIcon?: React.ReactNode;
|
|
23
|
+
/** Label for the resource type (e.g. "MCP Server", "Skill"). */
|
|
24
|
+
readonly resourceLabel?: string;
|
|
25
|
+
/** Controlled editing state. When provided, component is in controlled mode. */
|
|
26
|
+
readonly editing?: boolean;
|
|
27
|
+
/** Called when editing state changes (controlled mode). */
|
|
28
|
+
readonly onEditingChange?: (editing: boolean) => void;
|
|
29
|
+
/** Default org to pre-fill in the generic add form. */
|
|
30
|
+
readonly defaultOrg?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Inline editor for a list of resource references.
|
|
35
|
+
*
|
|
36
|
+
* Read mode shows clickable reference items. Edit mode adds a remove
|
|
37
|
+
* button per item and an "Add" button that reveals the domain picker.
|
|
38
|
+
*/
|
|
39
|
+
export function InlineEditResourceList({
|
|
40
|
+
value,
|
|
41
|
+
onSave,
|
|
42
|
+
renderPicker,
|
|
43
|
+
onItemClick,
|
|
44
|
+
itemIcon,
|
|
45
|
+
resourceLabel = "resource",
|
|
46
|
+
editing: controlledEditing,
|
|
47
|
+
onEditingChange,
|
|
48
|
+
defaultOrg = "",
|
|
49
|
+
disabled,
|
|
50
|
+
isSaving,
|
|
51
|
+
error,
|
|
52
|
+
className,
|
|
53
|
+
}: InlineEditResourceListProps) {
|
|
54
|
+
const [internalEditing, setInternalEditing] = useState(false);
|
|
55
|
+
const isEditing = controlledEditing ?? internalEditing;
|
|
56
|
+
const setIsEditing = useCallback(
|
|
57
|
+
(v: boolean) => {
|
|
58
|
+
setInternalEditing(v);
|
|
59
|
+
onEditingChange?.(v);
|
|
60
|
+
},
|
|
61
|
+
[onEditingChange],
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
if (controlledEditing !== undefined) setInternalEditing(controlledEditing);
|
|
66
|
+
}, [controlledEditing]);
|
|
67
|
+
|
|
68
|
+
const [draft, setDraft] = useState<ResourceRefRow[]>([...value]);
|
|
69
|
+
const [showPicker, setShowPicker] = useState(false);
|
|
70
|
+
const [showGenericAdd, setShowGenericAdd] = useState(false);
|
|
71
|
+
const [addSlug, setAddSlug] = useState("");
|
|
72
|
+
const [addOrg, setAddOrg] = useState(defaultOrg);
|
|
73
|
+
|
|
74
|
+
const handleEdit = useCallback(() => {
|
|
75
|
+
setDraft([...value]);
|
|
76
|
+
setIsEditing(true);
|
|
77
|
+
setShowPicker(false);
|
|
78
|
+
setShowGenericAdd(false);
|
|
79
|
+
}, [value, setIsEditing]);
|
|
80
|
+
|
|
81
|
+
const handleCancel = useCallback(() => {
|
|
82
|
+
setIsEditing(false);
|
|
83
|
+
setDraft([...value]);
|
|
84
|
+
setShowPicker(false);
|
|
85
|
+
setShowGenericAdd(false);
|
|
86
|
+
}, [value, setIsEditing]);
|
|
87
|
+
|
|
88
|
+
const handleSave = useCallback(async () => {
|
|
89
|
+
const ok = await onSave(draft);
|
|
90
|
+
if (ok) {
|
|
91
|
+
setIsEditing(false);
|
|
92
|
+
setShowPicker(false);
|
|
93
|
+
setShowGenericAdd(false);
|
|
94
|
+
}
|
|
95
|
+
}, [draft, onSave, setIsEditing]);
|
|
96
|
+
|
|
97
|
+
const removeItem = useCallback((index: number) => {
|
|
98
|
+
setDraft((prev) => prev.filter((_, i) => i !== index));
|
|
99
|
+
}, []);
|
|
100
|
+
|
|
101
|
+
const addItem = useCallback((ref: ResourceRefRow) => {
|
|
102
|
+
setDraft((prev) => {
|
|
103
|
+
const exists = prev.some((r) => r.org === ref.org && r.slug === ref.slug);
|
|
104
|
+
if (exists) return prev;
|
|
105
|
+
return [...prev, ref];
|
|
106
|
+
});
|
|
107
|
+
setShowPicker(false);
|
|
108
|
+
}, []);
|
|
109
|
+
|
|
110
|
+
if (disabled || !isEditing) {
|
|
111
|
+
return (
|
|
112
|
+
<div className={cn("flex flex-col", className)}>
|
|
113
|
+
{value.length > 0 ? (
|
|
114
|
+
<div className="flex flex-col divide-y divide-border">
|
|
115
|
+
{value.map((ref, index) => {
|
|
116
|
+
const label = ref.label ?? ref.slug;
|
|
117
|
+
const row = (
|
|
118
|
+
<div className="flex items-center gap-3">
|
|
119
|
+
{itemIcon && <span className="size-4 shrink-0 text-muted-foreground">{itemIcon}</span>}
|
|
120
|
+
<span className="text-sm font-medium text-foreground">{label}</span>
|
|
121
|
+
</div>
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
return onItemClick ? (
|
|
125
|
+
<button
|
|
126
|
+
key={`${ref.org}/${ref.slug}` || index}
|
|
127
|
+
type="button"
|
|
128
|
+
onClick={() => onItemClick(ref)}
|
|
129
|
+
className={cn(
|
|
130
|
+
"w-full px-3 py-2.5 text-left transition-colors",
|
|
131
|
+
"hover:bg-accent-hover",
|
|
132
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
|
|
133
|
+
)}
|
|
134
|
+
>
|
|
135
|
+
{row}
|
|
136
|
+
</button>
|
|
137
|
+
) : (
|
|
138
|
+
<div key={`${ref.org}/${ref.slug}` || index} className="px-3 py-2.5">
|
|
139
|
+
{row}
|
|
140
|
+
</div>
|
|
141
|
+
);
|
|
142
|
+
})}
|
|
143
|
+
</div>
|
|
144
|
+
) : (
|
|
145
|
+
<p className="px-3 py-3 text-xs text-muted-foreground italic">
|
|
146
|
+
No {resourceLabel}s configured
|
|
147
|
+
</p>
|
|
148
|
+
)}
|
|
149
|
+
</div>
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return (
|
|
154
|
+
<div className={cn("flex flex-col gap-2", className)}>
|
|
155
|
+
{draft.length > 0 && (
|
|
156
|
+
<div className="flex flex-col divide-y divide-border rounded-md border border-border">
|
|
157
|
+
{draft.map((ref, i) => (
|
|
158
|
+
<div key={`${ref.org}/${ref.slug}`} className="flex items-center gap-2 px-3 py-1.5">
|
|
159
|
+
{itemIcon && <span className="size-4 shrink-0 text-muted-foreground">{itemIcon}</span>}
|
|
160
|
+
<span className="flex-1 text-sm font-medium text-foreground">
|
|
161
|
+
{ref.label ?? ref.slug}
|
|
162
|
+
</span>
|
|
163
|
+
<button
|
|
164
|
+
type="button"
|
|
165
|
+
onClick={() => removeItem(i)}
|
|
166
|
+
aria-label={`Remove ${ref.label ?? ref.slug}`}
|
|
167
|
+
className={cn(
|
|
168
|
+
"inline-flex size-6 items-center justify-center rounded-md text-muted-foreground",
|
|
169
|
+
"hover:bg-destructive-subtle hover:text-destructive",
|
|
170
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
171
|
+
)}
|
|
172
|
+
>
|
|
173
|
+
<XIcon className="size-3.5" />
|
|
174
|
+
</button>
|
|
175
|
+
</div>
|
|
176
|
+
))}
|
|
177
|
+
</div>
|
|
178
|
+
)}
|
|
179
|
+
|
|
180
|
+
{showPicker && renderPicker ? (
|
|
181
|
+
<div className="rounded-md border border-border bg-muted-faint p-2">
|
|
182
|
+
{renderPicker(addItem)}
|
|
183
|
+
</div>
|
|
184
|
+
) : showGenericAdd ? (
|
|
185
|
+
<div className="flex items-center gap-2 rounded-md border border-border bg-muted-faint p-2">
|
|
186
|
+
<input
|
|
187
|
+
type="text"
|
|
188
|
+
value={addOrg}
|
|
189
|
+
onChange={(e) => setAddOrg(e.target.value)}
|
|
190
|
+
placeholder="org"
|
|
191
|
+
className={cn(
|
|
192
|
+
"w-24 rounded-md border border-border bg-input-bg px-2 py-1 text-xs text-foreground",
|
|
193
|
+
"focus:outline-none focus:ring-2 focus:ring-ring",
|
|
194
|
+
)}
|
|
195
|
+
/>
|
|
196
|
+
<span className="text-xs text-muted-foreground">/</span>
|
|
197
|
+
<input
|
|
198
|
+
type="text"
|
|
199
|
+
value={addSlug}
|
|
200
|
+
onChange={(e) => setAddSlug(e.target.value)}
|
|
201
|
+
placeholder="slug"
|
|
202
|
+
onKeyDown={(e) => {
|
|
203
|
+
if (e.key === "Enter" && addSlug.trim()) {
|
|
204
|
+
addItem({ org: addOrg.trim() || defaultOrg, slug: addSlug.trim(), label: addSlug.trim() });
|
|
205
|
+
setAddSlug("");
|
|
206
|
+
setShowGenericAdd(false);
|
|
207
|
+
} else if (e.key === "Escape") {
|
|
208
|
+
setShowGenericAdd(false);
|
|
209
|
+
setAddSlug("");
|
|
210
|
+
}
|
|
211
|
+
}}
|
|
212
|
+
className={cn(
|
|
213
|
+
"flex-1 rounded-md border border-border bg-input-bg px-2 py-1 text-xs text-foreground",
|
|
214
|
+
"focus:outline-none focus:ring-2 focus:ring-ring",
|
|
215
|
+
)}
|
|
216
|
+
/>
|
|
217
|
+
<button
|
|
218
|
+
type="button"
|
|
219
|
+
onClick={() => {
|
|
220
|
+
if (addSlug.trim()) {
|
|
221
|
+
addItem({ org: addOrg.trim() || defaultOrg, slug: addSlug.trim(), label: addSlug.trim() });
|
|
222
|
+
setAddSlug("");
|
|
223
|
+
setShowGenericAdd(false);
|
|
224
|
+
}
|
|
225
|
+
}}
|
|
226
|
+
disabled={!addSlug.trim()}
|
|
227
|
+
className={cn(
|
|
228
|
+
"inline-flex size-6 items-center justify-center rounded-md",
|
|
229
|
+
"bg-primary text-primary-foreground hover:bg-primary-hover",
|
|
230
|
+
"disabled:opacity-50",
|
|
231
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
232
|
+
)}
|
|
233
|
+
>
|
|
234
|
+
<PlusIcon className="size-3" />
|
|
235
|
+
</button>
|
|
236
|
+
</div>
|
|
237
|
+
) : (
|
|
238
|
+
<button
|
|
239
|
+
type="button"
|
|
240
|
+
onClick={() => renderPicker ? setShowPicker(true) : setShowGenericAdd(true)}
|
|
241
|
+
className={cn(
|
|
242
|
+
"inline-flex items-center gap-1 rounded-md px-2.5 py-1.5 text-xs font-medium",
|
|
243
|
+
"border border-dashed border-border text-muted-foreground",
|
|
244
|
+
"hover:border-muted-foreground hover:text-foreground hover:bg-muted-subtle",
|
|
245
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
246
|
+
"transition-colors",
|
|
247
|
+
)}
|
|
248
|
+
>
|
|
249
|
+
<PlusIcon className="size-3" />
|
|
250
|
+
Add {resourceLabel}
|
|
251
|
+
</button>
|
|
252
|
+
)}
|
|
253
|
+
|
|
254
|
+
<div className="flex items-center justify-end gap-1.5">
|
|
255
|
+
<button
|
|
256
|
+
type="button"
|
|
257
|
+
onClick={handleCancel}
|
|
258
|
+
disabled={isSaving}
|
|
259
|
+
className={cn(
|
|
260
|
+
"rounded-md px-2.5 py-1 text-xs font-medium",
|
|
261
|
+
"border border-border bg-background text-foreground hover:bg-accent",
|
|
262
|
+
"disabled:opacity-50",
|
|
263
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
264
|
+
)}
|
|
265
|
+
>
|
|
266
|
+
Cancel
|
|
267
|
+
</button>
|
|
268
|
+
<button
|
|
269
|
+
type="button"
|
|
270
|
+
onClick={handleSave}
|
|
271
|
+
disabled={isSaving}
|
|
272
|
+
className={cn(
|
|
273
|
+
"inline-flex items-center gap-1 rounded-md px-2.5 py-1 text-xs font-medium",
|
|
274
|
+
"bg-primary text-primary-foreground hover:bg-primary-hover",
|
|
275
|
+
"disabled:opacity-50",
|
|
276
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
277
|
+
)}
|
|
278
|
+
>
|
|
279
|
+
{isSaving && <Spinner />}
|
|
280
|
+
Save changes
|
|
281
|
+
</button>
|
|
282
|
+
</div>
|
|
283
|
+
|
|
284
|
+
{error && (
|
|
285
|
+
<p className="px-1 text-xs text-destructive" role="alert">{error}</p>
|
|
286
|
+
)}
|
|
287
|
+
</div>
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// ---------------------------------------------------------------------------
|
|
292
|
+
// Icons
|
|
293
|
+
// ---------------------------------------------------------------------------
|
|
294
|
+
|
|
295
|
+
function PencilIcon({ className }: { readonly className?: string }) {
|
|
296
|
+
return (
|
|
297
|
+
<svg className={className} viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
|
298
|
+
<path d="M11.5 1.5a2.121 2.121 0 0 1 3 3L5 14l-4 1 1-4Z" />
|
|
299
|
+
</svg>
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function PlusIcon({ className }: { readonly className?: string }) {
|
|
304
|
+
return (
|
|
305
|
+
<svg className={className} viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" aria-hidden="true">
|
|
306
|
+
<path d="M8 3v10M3 8h10" />
|
|
307
|
+
</svg>
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
function XIcon({ className }: { readonly className?: string }) {
|
|
312
|
+
return (
|
|
313
|
+
<svg className={className} viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
|
314
|
+
<path d="m4 4 8 8M12 4l-8 8" />
|
|
315
|
+
</svg>
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
function Spinner() {
|
|
320
|
+
return (
|
|
321
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" className="animate-spin" aria-hidden="true">
|
|
322
|
+
<path d="M8 2a6 6 0 1 0 6 6" />
|
|
323
|
+
</svg>
|
|
324
|
+
);
|
|
325
|
+
}
|