@stigmer/react 0.4.8 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action-menu/ActionMenu.d.ts +64 -0
- package/action-menu/ActionMenu.d.ts.map +1 -0
- package/action-menu/ActionMenu.js +78 -0
- package/action-menu/ActionMenu.js.map +1 -0
- package/action-menu/index.d.ts +3 -0
- package/action-menu/index.d.ts.map +1 -0
- package/action-menu/index.js +2 -0
- package/action-menu/index.js.map +1 -0
- package/action-menu/types.d.ts +65 -0
- package/action-menu/types.d.ts.map +1 -0
- package/action-menu/types.js +2 -0
- package/action-menu/types.js.map +1 -0
- package/agent/AgentCreationWizard.d.ts +55 -0
- package/agent/AgentCreationWizard.d.ts.map +1 -0
- package/agent/AgentCreationWizard.js +115 -0
- package/agent/AgentCreationWizard.js.map +1 -0
- package/agent/AgentDetailView.d.ts +77 -9
- package/agent/AgentDetailView.d.ts.map +1 -1
- package/agent/AgentDetailView.js +265 -87
- package/agent/AgentDetailView.js.map +1 -1
- package/agent/index.d.ts +8 -0
- package/agent/index.d.ts.map +1 -1
- package/agent/index.js +4 -0
- package/agent/index.js.map +1 -1
- package/agent/internal/agentToInput.d.ts +12 -0
- package/agent/internal/agentToInput.d.ts.map +1 -0
- package/agent/internal/agentToInput.js +72 -0
- package/agent/internal/agentToInput.js.map +1 -0
- package/agent/steps/CapabilitiesStep.d.ts +16 -0
- package/agent/steps/CapabilitiesStep.d.ts.map +1 -0
- package/agent/steps/CapabilitiesStep.js +80 -0
- package/agent/steps/CapabilitiesStep.js.map +1 -0
- package/agent/steps/IdentityStep.d.ts +18 -0
- package/agent/steps/IdentityStep.d.ts.map +1 -0
- package/agent/steps/IdentityStep.js +43 -0
- package/agent/steps/IdentityStep.js.map +1 -0
- package/agent/steps/ReviewStep.d.ts +23 -0
- package/agent/steps/ReviewStep.d.ts.map +1 -0
- package/agent/steps/ReviewStep.js +73 -0
- package/agent/steps/ReviewStep.js.map +1 -0
- package/agent/steps/types.d.ts +35 -0
- package/agent/steps/types.d.ts.map +1 -0
- package/agent/steps/types.js +16 -0
- package/agent/steps/types.js.map +1 -0
- package/agent/useCreateAgent.d.ts +45 -0
- package/agent/useCreateAgent.d.ts.map +1 -0
- package/agent/useCreateAgent.js +50 -0
- package/agent/useCreateAgent.js.map +1 -0
- package/agent/useUpdateAgent.d.ts +24 -0
- package/agent/useUpdateAgent.d.ts.map +1 -0
- package/agent/useUpdateAgent.js +35 -0
- package/agent/useUpdateAgent.js.map +1 -0
- package/composer/ContextChip.d.ts +7 -2
- package/composer/ContextChip.d.ts.map +1 -1
- package/composer/ContextChip.js +2 -1
- package/composer/ContextChip.js.map +1 -1
- package/composer/SessionComposer.d.ts +11 -0
- package/composer/SessionComposer.d.ts.map +1 -1
- package/composer/SessionComposer.js +33 -4
- package/composer/SessionComposer.js.map +1 -1
- package/dependency-graph/DependencyGraph.d.ts +37 -0
- package/dependency-graph/DependencyGraph.d.ts.map +1 -0
- package/dependency-graph/DependencyGraph.js +88 -0
- package/dependency-graph/DependencyGraph.js.map +1 -0
- package/dependency-graph/DependencyTreeNode.d.ts +23 -0
- package/dependency-graph/DependencyTreeNode.d.ts.map +1 -0
- package/dependency-graph/DependencyTreeNode.js +99 -0
- package/dependency-graph/DependencyTreeNode.js.map +1 -0
- package/dependency-graph/index.d.ts +4 -0
- package/dependency-graph/index.d.ts.map +1 -0
- package/dependency-graph/index.js +5 -0
- package/dependency-graph/index.js.map +1 -0
- package/dependency-graph/types.d.ts +130 -0
- package/dependency-graph/types.d.ts.map +1 -0
- package/dependency-graph/types.js +2 -0
- package/dependency-graph/types.js.map +1 -0
- package/dependency-graph/useDependencyGraph.d.ts +27 -0
- package/dependency-graph/useDependencyGraph.d.ts.map +1 -0
- package/dependency-graph/useDependencyGraph.js +129 -0
- package/dependency-graph/useDependencyGraph.js.map +1 -0
- package/empty-state/EmptyState.d.ts +29 -0
- package/empty-state/EmptyState.d.ts.map +1 -0
- package/empty-state/EmptyState.js +45 -0
- package/empty-state/EmptyState.js.map +1 -0
- package/empty-state/index.d.ts +4 -0
- package/empty-state/index.d.ts.map +1 -0
- package/empty-state/index.js +3 -0
- package/empty-state/index.js.map +1 -0
- package/empty-state/types.d.ts +73 -0
- package/empty-state/types.d.ts.map +1 -0
- package/empty-state/types.js +2 -0
- package/empty-state/types.js.map +1 -0
- package/empty-state/useEmptyState.d.ts +18 -0
- package/empty-state/useEmptyState.d.ts.map +1 -0
- package/empty-state/useEmptyState.js +72 -0
- package/empty-state/useEmptyState.js.map +1 -0
- package/environment/usePersonalEnvironment.d.ts.map +1 -1
- package/environment/usePersonalEnvironment.js +1 -0
- package/environment/usePersonalEnvironment.js.map +1 -1
- package/feedback/StigmerToaster.d.ts +18 -0
- package/feedback/StigmerToaster.d.ts.map +1 -0
- package/feedback/StigmerToaster.js +31 -0
- package/feedback/StigmerToaster.js.map +1 -0
- package/feedback/index.d.ts +4 -0
- package/feedback/index.d.ts.map +1 -0
- package/feedback/index.js +3 -0
- package/feedback/index.js.map +1 -0
- package/feedback/toast.d.ts +14 -0
- package/feedback/toast.d.ts.map +1 -0
- package/feedback/toast.js +14 -0
- package/feedback/toast.js.map +1 -0
- package/feedback/types.d.ts +4 -0
- package/feedback/types.d.ts.map +1 -0
- package/feedback/types.js +2 -0
- package/feedback/types.js.map +1 -0
- package/index.d.ts +32 -12
- package/index.d.ts.map +1 -1
- package/index.js +30 -10
- package/index.js.map +1 -1
- package/inline-edit/InlineEditImage.d.ts +20 -0
- package/inline-edit/InlineEditImage.d.ts.map +1 -0
- package/inline-edit/InlineEditImage.js +85 -0
- package/inline-edit/InlineEditImage.js.map +1 -0
- package/inline-edit/InlineEditKeyValue.d.ts +33 -0
- package/inline-edit/InlineEditKeyValue.d.ts.map +1 -0
- package/inline-edit/InlineEditKeyValue.js +67 -0
- package/inline-edit/InlineEditKeyValue.js.map +1 -0
- package/inline-edit/InlineEditResourceList.d.ts +34 -0
- package/inline-edit/InlineEditResourceList.d.ts.map +1 -0
- package/inline-edit/InlineEditResourceList.js +99 -0
- package/inline-edit/InlineEditResourceList.js.map +1 -0
- package/inline-edit/InlineEditSelect.d.ts +18 -0
- package/inline-edit/InlineEditSelect.d.ts.map +1 -0
- package/inline-edit/InlineEditSelect.js +54 -0
- package/inline-edit/InlineEditSelect.js.map +1 -0
- package/inline-edit/InlineEditText.d.ts +23 -0
- package/inline-edit/InlineEditText.d.ts.map +1 -0
- package/inline-edit/InlineEditText.js +79 -0
- package/inline-edit/InlineEditText.js.map +1 -0
- package/inline-edit/InlineEditTextarea.d.ts +22 -0
- package/inline-edit/InlineEditTextarea.d.ts.map +1 -0
- package/inline-edit/InlineEditTextarea.js +83 -0
- package/inline-edit/InlineEditTextarea.js.map +1 -0
- package/inline-edit/index.d.ts +16 -0
- package/inline-edit/index.d.ts.map +1 -0
- package/inline-edit/index.js +8 -0
- package/inline-edit/index.js.map +1 -0
- package/inline-edit/types.d.ts +42 -0
- package/inline-edit/types.d.ts.map +1 -0
- package/inline-edit/types.js +2 -0
- package/inline-edit/types.js.map +1 -0
- package/inline-edit/useInlineFieldSave.d.ts +23 -0
- package/inline-edit/useInlineFieldSave.d.ts.map +1 -0
- package/inline-edit/useInlineFieldSave.js +44 -0
- package/inline-edit/useInlineFieldSave.js.map +1 -0
- package/internal/Tabs.d.ts +4 -38
- package/internal/Tabs.d.ts.map +1 -1
- package/internal/Tabs.js +3 -62
- package/internal/Tabs.js.map +1 -1
- package/internal/useFetch.js +2 -2
- package/internal/useFetch.js.map +1 -1
- package/library/ImportResourceDialog.d.ts +43 -0
- package/library/ImportResourceDialog.d.ts.map +1 -0
- package/library/ImportResourceDialog.js +90 -0
- package/library/ImportResourceDialog.js.map +1 -0
- package/library/index.d.ts +7 -4
- package/library/index.d.ts.map +1 -1
- package/library/index.js +4 -2
- package/library/index.js.map +1 -1
- package/library/serialize-resource-yaml.d.ts +53 -0
- package/library/serialize-resource-yaml.d.ts.map +1 -1
- package/library/serialize-resource-yaml.js +275 -0
- package/library/serialize-resource-yaml.js.map +1 -1
- package/library/useExportResource.d.ts +56 -0
- package/library/useExportResource.d.ts.map +1 -0
- package/library/useExportResource.js +137 -0
- package/library/useExportResource.js.map +1 -0
- package/library/useImportResource.d.ts +84 -0
- package/library/useImportResource.d.ts.map +1 -0
- package/library/useImportResource.js +188 -0
- package/library/useImportResource.js.map +1 -0
- package/mcp-server/McpServerCreationWizard.d.ts +55 -0
- package/mcp-server/McpServerCreationWizard.d.ts.map +1 -0
- package/mcp-server/McpServerCreationWizard.js +121 -0
- package/mcp-server/McpServerCreationWizard.js.map +1 -0
- package/mcp-server/McpServerDetailView.d.ts +21 -1
- package/mcp-server/McpServerDetailView.d.ts.map +1 -1
- package/mcp-server/McpServerDetailView.js +235 -43
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/mcp-server/index.d.ts +8 -0
- package/mcp-server/index.d.ts.map +1 -1
- package/mcp-server/index.js +4 -0
- package/mcp-server/index.js.map +1 -1
- package/mcp-server/internal/mcpServerToInput.d.ts +12 -0
- package/mcp-server/internal/mcpServerToInput.d.ts.map +1 -0
- package/mcp-server/internal/mcpServerToInput.js +81 -0
- package/mcp-server/internal/mcpServerToInput.js.map +1 -0
- package/mcp-server/steps/EnvironmentAuthStep.d.ts +15 -0
- package/mcp-server/steps/EnvironmentAuthStep.d.ts.map +1 -0
- package/mcp-server/steps/EnvironmentAuthStep.js +55 -0
- package/mcp-server/steps/EnvironmentAuthStep.js.map +1 -0
- package/mcp-server/steps/IdentityTransportStep.d.ts +19 -0
- package/mcp-server/steps/IdentityTransportStep.d.ts.map +1 -0
- package/mcp-server/steps/IdentityTransportStep.js +73 -0
- package/mcp-server/steps/IdentityTransportStep.js.map +1 -0
- package/mcp-server/steps/ReviewStep.d.ts +23 -0
- package/mcp-server/steps/ReviewStep.d.ts.map +1 -0
- package/mcp-server/steps/ReviewStep.js +137 -0
- package/mcp-server/steps/ReviewStep.js.map +1 -0
- package/mcp-server/steps/types.d.ts +56 -0
- package/mcp-server/steps/types.d.ts.map +1 -0
- package/mcp-server/steps/types.js +27 -0
- package/mcp-server/steps/types.js.map +1 -0
- package/mcp-server/useCreateMcpServer.d.ts +45 -0
- package/mcp-server/useCreateMcpServer.d.ts.map +1 -0
- package/mcp-server/useCreateMcpServer.js +50 -0
- package/mcp-server/useCreateMcpServer.js.map +1 -0
- package/mcp-server/useUpdateMcpServer.d.ts +24 -0
- package/mcp-server/useUpdateMcpServer.d.ts.map +1 -0
- package/mcp-server/useUpdateMcpServer.js +35 -0
- package/mcp-server/useUpdateMcpServer.js.map +1 -0
- package/models/ModelRegistryContext.d.ts +2 -0
- package/models/ModelRegistryContext.d.ts.map +1 -1
- package/models/ModelRegistryContext.js +1 -0
- package/models/ModelRegistryContext.js.map +1 -1
- package/models/ModelSelector.d.ts.map +1 -1
- package/models/ModelSelector.js +2 -2
- package/models/ModelSelector.js.map +1 -1
- package/models/__tests__/useModelRegistry.test.js +4 -3
- package/models/__tests__/useModelRegistry.test.js.map +1 -1
- package/models/useModelRegistry.d.ts +2 -0
- package/models/useModelRegistry.d.ts.map +1 -1
- package/models/useModelRegistry.js +3 -2
- package/models/useModelRegistry.js.map +1 -1
- package/package.json +8 -4
- package/provider.d.ts.map +1 -1
- package/provider.js +69 -22
- package/provider.js.map +1 -1
- package/resource-creation/CreationPicker.d.ts +60 -0
- package/resource-creation/CreationPicker.d.ts.map +1 -0
- package/resource-creation/CreationPicker.js +74 -0
- package/resource-creation/CreationPicker.js.map +1 -0
- package/resource-creation/StepIndicator.d.ts +28 -0
- package/resource-creation/StepIndicator.d.ts.map +1 -0
- package/resource-creation/StepIndicator.js +40 -0
- package/resource-creation/StepIndicator.js.map +1 -0
- package/resource-creation/TemplateCard.d.ts +24 -0
- package/resource-creation/TemplateCard.d.ts.map +1 -0
- package/resource-creation/TemplateCard.js +68 -0
- package/resource-creation/TemplateCard.js.map +1 -0
- package/resource-creation/TemplateGallery.d.ts +43 -0
- package/resource-creation/TemplateGallery.d.ts.map +1 -0
- package/resource-creation/TemplateGallery.js +78 -0
- package/resource-creation/TemplateGallery.js.map +1 -0
- package/resource-creation/WizardNav.d.ts +31 -0
- package/resource-creation/WizardNav.d.ts.map +1 -0
- package/resource-creation/WizardNav.js +29 -0
- package/resource-creation/WizardNav.js.map +1 -0
- package/resource-creation/WizardShell.d.ts +41 -0
- package/resource-creation/WizardShell.d.ts.map +1 -0
- package/resource-creation/WizardShell.js +55 -0
- package/resource-creation/WizardShell.js.map +1 -0
- package/resource-creation/index.d.ts +21 -0
- package/resource-creation/index.d.ts.map +1 -0
- package/resource-creation/index.js +14 -0
- package/resource-creation/index.js.map +1 -0
- package/resource-creation/templates/agent-templates.d.ts +15 -0
- package/resource-creation/templates/agent-templates.d.ts.map +1 -0
- package/resource-creation/templates/agent-templates.js +148 -0
- package/resource-creation/templates/agent-templates.js.map +1 -0
- package/resource-creation/templates/index.d.ts +5 -0
- package/resource-creation/templates/index.d.ts.map +1 -0
- package/resource-creation/templates/index.js +5 -0
- package/resource-creation/templates/index.js.map +1 -0
- package/resource-creation/templates/mcp-server-templates.d.ts +15 -0
- package/resource-creation/templates/mcp-server-templates.d.ts.map +1 -0
- package/resource-creation/templates/mcp-server-templates.js +92 -0
- package/resource-creation/templates/mcp-server-templates.js.map +1 -0
- package/resource-creation/templates/types.d.ts +48 -0
- package/resource-creation/templates/types.d.ts.map +1 -0
- package/resource-creation/templates/types.js +16 -0
- package/resource-creation/templates/types.js.map +1 -0
- package/resource-creation/types.d.ts +88 -0
- package/resource-creation/types.d.ts.map +1 -0
- package/resource-creation/types.js +2 -0
- package/resource-creation/types.js.map +1 -0
- package/resource-creation/useTemplateFilter.d.ts +43 -0
- package/resource-creation/useTemplateFilter.d.ts.map +1 -0
- package/resource-creation/useTemplateFilter.js +73 -0
- package/resource-creation/useTemplateFilter.js.map +1 -0
- package/resource-creation/useWizardState.d.ts +67 -0
- package/resource-creation/useWizardState.d.ts.map +1 -0
- package/resource-creation/useWizardState.js +143 -0
- package/resource-creation/useWizardState.js.map +1 -0
- package/resource-detail/ConfirmDialog.d.ts +44 -0
- package/resource-detail/ConfirmDialog.d.ts.map +1 -0
- package/resource-detail/ConfirmDialog.js +62 -0
- package/resource-detail/ConfirmDialog.js.map +1 -0
- package/resource-detail/ResourceActionBar.d.ts +42 -0
- package/resource-detail/ResourceActionBar.d.ts.map +1 -0
- package/resource-detail/ResourceActionBar.js +64 -0
- package/resource-detail/ResourceActionBar.js.map +1 -0
- package/resource-detail/ResourceDetailShell.d.ts +36 -0
- package/resource-detail/ResourceDetailShell.d.ts.map +1 -0
- package/resource-detail/ResourceDetailShell.js +65 -0
- package/resource-detail/ResourceDetailShell.js.map +1 -0
- package/resource-detail/Section.d.ts +18 -0
- package/resource-detail/Section.d.ts.map +1 -0
- package/resource-detail/Section.js +18 -0
- package/resource-detail/Section.js.map +1 -0
- package/resource-detail/index.d.ts +15 -0
- package/resource-detail/index.d.ts.map +1 -0
- package/resource-detail/index.js +10 -0
- package/resource-detail/index.js.map +1 -0
- package/resource-detail/types.d.ts +146 -0
- package/resource-detail/types.d.ts.map +1 -0
- package/resource-detail/types.js +2 -0
- package/resource-detail/types.js.map +1 -0
- package/resource-detail/useConfirmAction.d.ts +41 -0
- package/resource-detail/useConfirmAction.d.ts.map +1 -0
- package/resource-detail/useConfirmAction.js +30 -0
- package/resource-detail/useConfirmAction.js.map +1 -0
- package/resource-detail/useCopyResource.d.ts +28 -0
- package/resource-detail/useCopyResource.d.ts.map +1 -0
- package/resource-detail/useCopyResource.js +46 -0
- package/resource-detail/useCopyResource.js.map +1 -0
- package/resource-detail/useDeleteResource.d.ts +40 -0
- package/resource-detail/useDeleteResource.d.ts.map +1 -0
- package/resource-detail/useDeleteResource.js +83 -0
- package/resource-detail/useDeleteResource.js.map +1 -0
- package/resource-detail/useDetailTabs.d.ts +46 -0
- package/resource-detail/useDetailTabs.d.ts.map +1 -0
- package/resource-detail/useDetailTabs.js +47 -0
- package/resource-detail/useDetailTabs.js.map +1 -0
- package/resource-workbench/components/BulkActionBar.d.ts +36 -0
- package/resource-workbench/components/BulkActionBar.d.ts.map +1 -0
- package/resource-workbench/components/BulkActionBar.js +35 -0
- package/resource-workbench/components/BulkActionBar.js.map +1 -0
- package/resource-workbench/components/ColumnHeader.d.ts +23 -0
- package/resource-workbench/components/ColumnHeader.d.ts.map +1 -0
- package/resource-workbench/components/ColumnHeader.js +25 -0
- package/resource-workbench/components/ColumnHeader.js.map +1 -0
- package/resource-workbench/components/FilterBar.d.ts +33 -0
- package/resource-workbench/components/FilterBar.d.ts.map +1 -0
- package/resource-workbench/components/FilterBar.js +72 -0
- package/resource-workbench/components/FilterBar.js.map +1 -0
- package/resource-workbench/components/ResourceAvatar.d.ts +29 -0
- package/resource-workbench/components/ResourceAvatar.d.ts.map +1 -0
- package/resource-workbench/components/ResourceAvatar.js +51 -0
- package/resource-workbench/components/ResourceAvatar.js.map +1 -0
- package/resource-workbench/components/ResourceCards.d.ts +39 -0
- package/resource-workbench/components/ResourceCards.d.ts.map +1 -0
- package/resource-workbench/components/ResourceCards.js +41 -0
- package/resource-workbench/components/ResourceCards.js.map +1 -0
- package/resource-workbench/components/ResourceInspector.d.ts +26 -0
- package/resource-workbench/components/ResourceInspector.d.ts.map +1 -0
- package/resource-workbench/components/ResourceInspector.js +22 -0
- package/resource-workbench/components/ResourceInspector.js.map +1 -0
- package/resource-workbench/components/ResourceList.d.ts +39 -0
- package/resource-workbench/components/ResourceList.d.ts.map +1 -0
- package/resource-workbench/components/ResourceList.js +41 -0
- package/resource-workbench/components/ResourceList.js.map +1 -0
- package/resource-workbench/components/ResourceTable.d.ts +47 -0
- package/resource-workbench/components/ResourceTable.d.ts.map +1 -0
- package/resource-workbench/components/ResourceTable.js +78 -0
- package/resource-workbench/components/ResourceTable.js.map +1 -0
- package/resource-workbench/components/ResourceWorkbench.d.ts +131 -0
- package/resource-workbench/components/ResourceWorkbench.d.ts.map +1 -0
- package/resource-workbench/components/ResourceWorkbench.js +170 -0
- package/resource-workbench/components/ResourceWorkbench.js.map +1 -0
- package/resource-workbench/components/SelectionCheckbox.d.ts +24 -0
- package/resource-workbench/components/SelectionCheckbox.d.ts.map +1 -0
- package/resource-workbench/components/SelectionCheckbox.js +16 -0
- package/resource-workbench/components/SelectionCheckbox.js.map +1 -0
- package/resource-workbench/components/StatusBadge.d.ts +31 -0
- package/resource-workbench/components/StatusBadge.d.ts.map +1 -0
- package/resource-workbench/components/StatusBadge.js +75 -0
- package/resource-workbench/components/StatusBadge.js.map +1 -0
- package/resource-workbench/components/ViewSwitcher.d.ts +21 -0
- package/resource-workbench/components/ViewSwitcher.d.ts.map +1 -0
- package/resource-workbench/components/ViewSwitcher.js +37 -0
- package/resource-workbench/components/ViewSwitcher.js.map +1 -0
- package/resource-workbench/hooks/useResourceCollection.d.ts +93 -0
- package/resource-workbench/hooks/useResourceCollection.d.ts.map +1 -0
- package/resource-workbench/hooks/useResourceCollection.js +133 -0
- package/resource-workbench/hooks/useResourceCollection.js.map +1 -0
- package/resource-workbench/hooks/useResourceFilters.d.ts +73 -0
- package/resource-workbench/hooks/useResourceFilters.d.ts.map +1 -0
- package/resource-workbench/hooks/useResourceFilters.js +105 -0
- package/resource-workbench/hooks/useResourceFilters.js.map +1 -0
- package/resource-workbench/hooks/useResourceSelection.d.ts +44 -0
- package/resource-workbench/hooks/useResourceSelection.d.ts.map +1 -0
- package/resource-workbench/hooks/useResourceSelection.js +123 -0
- package/resource-workbench/hooks/useResourceSelection.js.map +1 -0
- package/resource-workbench/hooks/useViewPreference.d.ts +32 -0
- package/resource-workbench/hooks/useViewPreference.d.ts.map +1 -0
- package/resource-workbench/hooks/useViewPreference.js +60 -0
- package/resource-workbench/hooks/useViewPreference.js.map +1 -0
- package/resource-workbench/index.d.ts +34 -0
- package/resource-workbench/index.d.ts.map +1 -0
- package/resource-workbench/index.js +19 -0
- package/resource-workbench/index.js.map +1 -0
- package/resource-workbench/types.d.ts +165 -0
- package/resource-workbench/types.d.ts.map +1 -0
- package/resource-workbench/types.js +2 -0
- package/resource-workbench/types.js.map +1 -0
- package/runner/RunnerDetailView.d.ts +44 -0
- package/runner/RunnerDetailView.d.ts.map +1 -0
- package/runner/RunnerDetailView.js +154 -0
- package/runner/RunnerDetailView.js.map +1 -0
- package/runner/RunnerListPanel.d.ts +26 -1
- package/runner/RunnerListPanel.d.ts.map +1 -1
- package/runner/RunnerListPanel.js +68 -46
- package/runner/RunnerListPanel.js.map +1 -1
- package/runner/index.d.ts +7 -1
- package/runner/index.d.ts.map +1 -1
- package/runner/index.js +3 -0
- package/runner/index.js.map +1 -1
- package/runner/shared.d.ts +31 -0
- package/runner/shared.d.ts.map +1 -0
- package/runner/shared.js +55 -0
- package/runner/shared.js.map +1 -0
- package/runner/useRunner.d.ts +37 -0
- package/runner/useRunner.d.ts.map +1 -0
- package/runner/useRunner.js +24 -0
- package/runner/useRunner.js.map +1 -0
- package/session/__tests__/group-sessions.test.js +3 -3
- package/session/__tests__/group-sessions.test.js.map +1 -1
- package/session/__tests__/session-spec-converters.test.d.ts +2 -0
- package/session/__tests__/session-spec-converters.test.d.ts.map +1 -0
- package/session/__tests__/session-spec-converters.test.js +162 -0
- package/session/__tests__/session-spec-converters.test.js.map +1 -0
- package/session/__tests__/useNewSessionFlow.test.js +2 -2
- package/session/__tests__/useNewSessionFlow.test.js.map +1 -1
- package/session/__tests__/usePersistedModel.test.js +1 -1
- package/session/__tests__/usePersistedModel.test.js.map +1 -1
- package/session/group-sessions.d.ts +17 -0
- package/session/group-sessions.d.ts.map +1 -1
- package/session/group-sessions.js +46 -0
- package/session/group-sessions.js.map +1 -1
- package/session/index.d.ts +4 -2
- package/session/index.d.ts.map +1 -1
- package/session/index.js +2 -1
- package/session/index.js.map +1 -1
- package/session/session-spec-converters.d.ts +24 -0
- package/session/session-spec-converters.d.ts.map +1 -0
- package/session/session-spec-converters.js +72 -0
- package/session/session-spec-converters.js.map +1 -0
- package/session/useSessionConversation.d.ts.map +1 -1
- package/session/useSessionConversation.js +1 -56
- package/session/useSessionConversation.js.map +1 -1
- package/session/useSessionPageFlow.d.ts +5 -0
- package/session/useSessionPageFlow.d.ts.map +1 -1
- package/session/useSessionPageFlow.js +20 -6
- package/session/useSessionPageFlow.js.map +1 -1
- package/session/useSessionSearch.d.ts +57 -0
- package/session/useSessionSearch.d.ts.map +1 -0
- package/session/useSessionSearch.js +94 -0
- package/session/useSessionSearch.js.map +1 -0
- package/skill/SkillDetailView.d.ts +70 -7
- package/skill/SkillDetailView.d.ts.map +1 -1
- package/skill/SkillDetailView.js +107 -39
- package/skill/SkillDetailView.js.map +1 -1
- package/skill/SkillDiffDialog.d.ts +42 -0
- package/skill/SkillDiffDialog.d.ts.map +1 -0
- package/skill/SkillDiffDialog.js +72 -0
- package/skill/SkillDiffDialog.js.map +1 -0
- package/skill/SkillFileBrowser.d.ts +31 -0
- package/skill/SkillFileBrowser.d.ts.map +1 -0
- package/skill/SkillFileBrowser.js +105 -0
- package/skill/SkillFileBrowser.js.map +1 -0
- package/skill/SkillUploader.d.ts +39 -0
- package/skill/SkillUploader.d.ts.map +1 -0
- package/skill/SkillUploader.js +141 -0
- package/skill/SkillUploader.js.map +1 -0
- package/skill/index.d.ts +18 -0
- package/skill/index.d.ts.map +1 -1
- package/skill/index.js +9 -0
- package/skill/index.js.map +1 -1
- package/skill/internal/computeArtifactHash.d.ts +9 -0
- package/skill/internal/computeArtifactHash.d.ts.map +1 -0
- package/skill/internal/computeArtifactHash.js +14 -0
- package/skill/internal/computeArtifactHash.js.map +1 -0
- package/skill/internal/fetchAndUnpackArtifact.d.ts +16 -0
- package/skill/internal/fetchAndUnpackArtifact.d.ts.map +1 -0
- package/skill/internal/fetchAndUnpackArtifact.js +34 -0
- package/skill/internal/fetchAndUnpackArtifact.js.map +1 -0
- package/skill/usePushSkill.d.ts +53 -0
- package/skill/usePushSkill.d.ts.map +1 -0
- package/skill/usePushSkill.js +57 -0
- package/skill/usePushSkill.js.map +1 -0
- package/skill/useSkillArtifact.d.ts +37 -0
- package/skill/useSkillArtifact.d.ts.map +1 -0
- package/skill/useSkillArtifact.js +76 -0
- package/skill/useSkillArtifact.js.map +1 -0
- package/skill/useSkillDiff.d.ts +31 -0
- package/skill/useSkillDiff.d.ts.map +1 -0
- package/skill/useSkillDiff.js +97 -0
- package/skill/useSkillDiff.js.map +1 -0
- package/skill/useSkillDuplicateCheck.d.ts +34 -0
- package/skill/useSkillDuplicateCheck.d.ts.map +1 -0
- package/skill/useSkillDuplicateCheck.js +58 -0
- package/skill/useSkillDuplicateCheck.js.map +1 -0
- package/skill/useSkillUpload.d.ts +69 -0
- package/skill/useSkillUpload.d.ts.map +1 -0
- package/skill/useSkillUpload.js +157 -0
- package/skill/useSkillUpload.js.map +1 -0
- package/skill/useSkillVersions.d.ts +46 -0
- package/skill/useSkillVersions.d.ts.map +1 -0
- package/skill/useSkillVersions.js +104 -0
- package/skill/useSkillVersions.js.map +1 -0
- package/src/action-menu/ActionMenu.tsx +151 -0
- package/src/action-menu/index.ts +9 -0
- package/src/action-menu/types.ts +70 -0
- package/src/agent/AgentCreationWizard.tsx +201 -0
- package/src/agent/AgentDetailView.tsx +817 -321
- package/src/agent/index.ts +16 -0
- package/src/agent/internal/agentToInput.ts +95 -0
- package/src/agent/steps/CapabilitiesStep.tsx +363 -0
- package/src/agent/steps/IdentityStep.tsx +259 -0
- package/src/agent/steps/ReviewStep.tsx +211 -0
- package/src/agent/steps/types.ts +53 -0
- package/src/agent/useCreateAgent.ts +76 -0
- package/src/agent/useUpdateAgent.ts +55 -0
- package/src/composer/ContextChip.tsx +20 -11
- package/src/composer/SessionComposer.tsx +52 -3
- package/src/dependency-graph/DependencyGraph.tsx +153 -0
- package/src/dependency-graph/DependencyTreeNode.tsx +282 -0
- package/src/dependency-graph/index.ts +15 -0
- package/src/dependency-graph/types.ts +131 -0
- package/src/dependency-graph/useDependencyGraph.ts +158 -0
- package/src/empty-state/EmptyState.tsx +90 -0
- package/src/empty-state/index.ts +9 -0
- package/src/empty-state/types.ts +81 -0
- package/src/empty-state/useEmptyState.ts +85 -0
- package/src/environment/usePersonalEnvironment.ts +1 -0
- package/src/feedback/StigmerToaster.tsx +45 -0
- package/src/feedback/index.ts +3 -0
- package/src/feedback/toast.ts +13 -0
- package/src/feedback/types.ts +7 -0
- package/src/index.ts +275 -8
- package/src/inline-edit/InlineEditImage.tsx +208 -0
- package/src/inline-edit/InlineEditKeyValue.tsx +301 -0
- package/src/inline-edit/InlineEditResourceList.tsx +325 -0
- package/src/inline-edit/InlineEditSelect.tsx +150 -0
- package/src/inline-edit/InlineEditText.tsx +211 -0
- package/src/inline-edit/InlineEditTextarea.tsx +209 -0
- package/src/inline-edit/index.ts +28 -0
- package/src/inline-edit/types.ts +47 -0
- package/src/inline-edit/useInlineFieldSave.ts +62 -0
- package/src/internal/Tabs.tsx +4 -164
- package/src/internal/useFetch.ts +2 -2
- package/src/library/ImportResourceDialog.tsx +227 -0
- package/src/library/index.ts +18 -8
- package/src/library/serialize-resource-yaml.ts +356 -0
- package/src/library/useExportResource.ts +183 -0
- package/src/library/useImportResource.ts +253 -0
- package/src/mcp-server/McpServerCreationWizard.tsx +206 -0
- package/src/mcp-server/McpServerDetailView.tsx +816 -155
- package/src/mcp-server/index.ts +16 -0
- package/src/mcp-server/internal/mcpServerToInput.ts +95 -0
- package/src/mcp-server/steps/EnvironmentAuthStep.tsx +462 -0
- package/src/mcp-server/steps/IdentityTransportStep.tsx +531 -0
- package/src/mcp-server/steps/ReviewStep.tsx +297 -0
- package/src/mcp-server/steps/types.ts +85 -0
- package/src/mcp-server/useCreateMcpServer.ts +76 -0
- package/src/mcp-server/useUpdateMcpServer.ts +55 -0
- package/src/models/ModelRegistryContext.ts +3 -0
- package/src/models/ModelSelector.tsx +25 -2
- package/src/models/__tests__/useModelRegistry.test.tsx +5 -3
- package/src/models/useModelRegistry.ts +5 -2
- package/src/provider.tsx +69 -18
- package/src/resource-creation/CreationPicker.tsx +292 -0
- package/src/resource-creation/StepIndicator.tsx +156 -0
- package/src/resource-creation/TemplateCard.tsx +143 -0
- package/src/resource-creation/TemplateGallery.tsx +222 -0
- package/src/resource-creation/WizardNav.tsx +163 -0
- package/src/resource-creation/WizardShell.tsx +124 -0
- package/src/resource-creation/index.ts +45 -0
- package/src/resource-creation/templates/agent-templates.ts +160 -0
- package/src/resource-creation/templates/index.ts +7 -0
- package/src/resource-creation/templates/mcp-server-templates.ts +106 -0
- package/src/resource-creation/templates/types.ts +64 -0
- package/src/resource-creation/types.ts +105 -0
- package/src/resource-creation/useTemplateFilter.ts +117 -0
- package/src/resource-creation/useWizardState.ts +223 -0
- package/src/resource-detail/ConfirmDialog.tsx +127 -0
- package/src/resource-detail/ResourceActionBar.tsx +157 -0
- package/src/resource-detail/ResourceDetailShell.tsx +184 -0
- package/src/resource-detail/Section.tsx +78 -0
- package/src/resource-detail/index.ts +34 -0
- package/src/resource-detail/types.ts +177 -0
- package/src/resource-detail/useConfirmAction.ts +70 -0
- package/src/resource-detail/useCopyResource.ts +74 -0
- package/src/resource-detail/useDeleteResource.ts +110 -0
- package/src/resource-detail/useDetailTabs.ts +93 -0
- package/src/resource-workbench/components/BulkActionBar.tsx +122 -0
- package/src/resource-workbench/components/ColumnHeader.tsx +105 -0
- package/src/resource-workbench/components/FilterBar.tsx +173 -0
- package/src/resource-workbench/components/ResourceAvatar.tsx +109 -0
- package/src/resource-workbench/components/ResourceCards.tsx +126 -0
- package/src/resource-workbench/components/ResourceInspector.tsx +88 -0
- package/src/resource-workbench/components/ResourceList.tsx +121 -0
- package/src/resource-workbench/components/ResourceTable.tsx +222 -0
- package/src/resource-workbench/components/ResourceWorkbench.tsx +695 -0
- package/src/resource-workbench/components/SelectionCheckbox.tsx +52 -0
- package/src/resource-workbench/components/StatusBadge.tsx +119 -0
- package/src/resource-workbench/components/ViewSwitcher.tsx +135 -0
- package/src/resource-workbench/hooks/useResourceCollection.ts +261 -0
- package/src/resource-workbench/hooks/useResourceFilters.ts +216 -0
- package/src/resource-workbench/hooks/useResourceSelection.ts +178 -0
- package/src/resource-workbench/hooks/useViewPreference.ts +75 -0
- package/src/resource-workbench/index.ts +73 -0
- package/src/resource-workbench/types.ts +220 -0
- package/src/runner/RunnerDetailView.tsx +410 -0
- package/src/runner/RunnerListPanel.tsx +126 -111
- package/src/runner/index.ts +13 -1
- package/src/runner/shared.tsx +124 -0
- package/src/runner/useRunner.ts +59 -0
- package/src/session/__tests__/group-sessions.test.ts +5 -3
- package/src/session/__tests__/session-spec-converters.test.ts +185 -0
- package/src/session/__tests__/useNewSessionFlow.test.tsx +2 -2
- package/src/session/__tests__/usePersistedModel.test.tsx +1 -1
- package/src/session/group-sessions.ts +65 -0
- package/src/session/index.ts +8 -2
- package/src/session/session-spec-converters.ts +86 -0
- package/src/session/useSessionConversation.ts +5 -64
- package/src/session/useSessionPageFlow.ts +28 -7
- package/src/session/useSessionSearch.ts +149 -0
- package/src/skill/SkillDetailView.tsx +371 -165
- package/src/skill/SkillDiffDialog.tsx +213 -0
- package/src/skill/SkillFileBrowser.tsx +289 -0
- package/src/skill/SkillUploader.tsx +481 -0
- package/src/skill/index.ts +34 -0
- package/src/skill/internal/computeArtifactHash.ts +13 -0
- package/src/skill/internal/fetchAndUnpackArtifact.ts +48 -0
- package/src/skill/usePushSkill.ts +101 -0
- package/src/skill/useSkillArtifact.ts +107 -0
- package/src/skill/useSkillDiff.ts +128 -0
- package/src/skill/useSkillDuplicateCheck.ts +92 -0
- package/src/skill/useSkillUpload.ts +231 -0
- package/src/skill/useSkillVersions.ts +165 -0
- package/src/styles.css +28 -0
- package/src/tabs/Tabs.tsx +184 -0
- package/src/tabs/index.ts +2 -0
- package/src/version-history/DiffFileList.tsx +111 -0
- package/src/version-history/DiffSummary.tsx +61 -0
- package/src/version-history/DiffViewer.tsx +163 -0
- package/src/version-history/MultiFileDiffView.tsx +114 -0
- package/src/version-history/VersionTimeline.tsx +232 -0
- package/src/version-history/VersionTimelineEntry.tsx +254 -0
- package/src/version-history/computeDiff.ts +61 -0
- package/src/version-history/computeMultiFileDiff.ts +97 -0
- package/src/version-history/index.ts +22 -0
- package/src/version-history/types.ts +129 -0
- package/styles.css +1 -1
- package/tabs/Tabs.d.ts +58 -0
- package/tabs/Tabs.d.ts.map +1 -0
- package/tabs/Tabs.js +80 -0
- package/tabs/Tabs.js.map +1 -0
- package/tabs/index.d.ts +3 -0
- package/tabs/index.d.ts.map +1 -0
- package/tabs/index.js +2 -0
- package/tabs/index.js.map +1 -0
- package/version-history/DiffFileList.d.ts +22 -0
- package/version-history/DiffFileList.d.ts.map +1 -0
- package/version-history/DiffFileList.js +37 -0
- package/version-history/DiffFileList.js.map +1 -0
- package/version-history/DiffSummary.d.ts +21 -0
- package/version-history/DiffSummary.d.ts.map +1 -0
- package/version-history/DiffSummary.js +16 -0
- package/version-history/DiffSummary.js.map +1 -0
- package/version-history/DiffViewer.d.ts +31 -0
- package/version-history/DiffViewer.d.ts.map +1 -0
- package/version-history/DiffViewer.js +60 -0
- package/version-history/DiffViewer.js.map +1 -0
- package/version-history/MultiFileDiffView.d.ts +30 -0
- package/version-history/MultiFileDiffView.d.ts.map +1 -0
- package/version-history/MultiFileDiffView.js +40 -0
- package/version-history/MultiFileDiffView.js.map +1 -0
- package/version-history/VersionTimeline.d.ts +29 -0
- package/version-history/VersionTimeline.d.ts.map +1 -0
- package/version-history/VersionTimeline.js +87 -0
- package/version-history/VersionTimeline.js.map +1 -0
- package/version-history/VersionTimelineEntry.d.ts +22 -0
- package/version-history/VersionTimelineEntry.d.ts.map +1 -0
- package/version-history/VersionTimelineEntry.js +98 -0
- package/version-history/VersionTimelineEntry.js.map +1 -0
- package/version-history/computeDiff.d.ts +16 -0
- package/version-history/computeDiff.d.ts.map +1 -0
- package/version-history/computeDiff.js +54 -0
- package/version-history/computeDiff.js.map +1 -0
- package/version-history/computeMultiFileDiff.d.ts +15 -0
- package/version-history/computeMultiFileDiff.d.ts.map +1 -0
- package/version-history/computeMultiFileDiff.js +83 -0
- package/version-history/computeMultiFileDiff.js.map +1 -0
- package/version-history/index.d.ts +14 -0
- package/version-history/index.d.ts.map +1 -0
- package/version-history/index.js +9 -0
- package/version-history/index.js.map +1 -0
- package/version-history/types.d.ts +106 -0
- package/version-history/types.d.ts.map +1 -0
- package/version-history/types.js +2 -0
- package/version-history/types.js.map +1 -0
- package/library/ResourceListView.d.ts +0 -174
- package/library/ResourceListView.d.ts.map +0 -1
- package/library/ResourceListView.js +0 -318
- package/library/ResourceListView.js.map +0 -1
- package/src/library/ResourceListView.tsx +0 -956
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { generateSlug } from "../../internal/slug";
|
|
6
|
+
import type { AgentWizardData } from "./types";
|
|
7
|
+
|
|
8
|
+
/** Props for {@link IdentityStep}. */
|
|
9
|
+
export interface IdentityStepProps {
|
|
10
|
+
readonly data: AgentWizardData;
|
|
11
|
+
readonly updateData: (partial: Partial<AgentWizardData>) => void;
|
|
12
|
+
readonly validationError: string | null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const SLUG_PATTERN = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Wizard step 1: Agent identity and instructions.
|
|
19
|
+
*
|
|
20
|
+
* Collects: name (required), slug (auto-derived), description,
|
|
21
|
+
* icon URL, visibility, and the instructions textarea.
|
|
22
|
+
*
|
|
23
|
+
* The slug auto-derives from the name until the user manually edits it.
|
|
24
|
+
* Follows the same pattern as `CreateOrganizationForm`.
|
|
25
|
+
*/
|
|
26
|
+
export function IdentityStep({
|
|
27
|
+
data,
|
|
28
|
+
updateData,
|
|
29
|
+
validationError,
|
|
30
|
+
}: IdentityStepProps) {
|
|
31
|
+
const handleNameChange = useCallback(
|
|
32
|
+
(value: string) => {
|
|
33
|
+
if (!data.slugTouched) {
|
|
34
|
+
updateData({ name: value, slug: generateSlug(value) });
|
|
35
|
+
} else {
|
|
36
|
+
updateData({ name: value });
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
[data.slugTouched, updateData],
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const handleSlugChange = useCallback(
|
|
43
|
+
(value: string) => {
|
|
44
|
+
updateData({ slug: value, slugTouched: true });
|
|
45
|
+
},
|
|
46
|
+
[updateData],
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
const slugError =
|
|
50
|
+
data.slug.length > 0 && !SLUG_PATTERN.test(data.slug)
|
|
51
|
+
? "Slug must be lowercase letters, numbers, and hyphens only"
|
|
52
|
+
: null;
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<div className="flex flex-col gap-6">
|
|
56
|
+
<div>
|
|
57
|
+
<h2 className="text-lg font-semibold text-foreground">
|
|
58
|
+
Identity & Instructions
|
|
59
|
+
</h2>
|
|
60
|
+
<p className="mt-1 text-sm text-muted-foreground">
|
|
61
|
+
Define what this agent is and what it does.
|
|
62
|
+
</p>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
{validationError && (
|
|
66
|
+
<p className="text-sm text-destructive" role="alert">
|
|
67
|
+
{validationError}
|
|
68
|
+
</p>
|
|
69
|
+
)}
|
|
70
|
+
|
|
71
|
+
<div className="grid gap-4 sm:grid-cols-2">
|
|
72
|
+
{/* Name */}
|
|
73
|
+
<div className="space-y-1.5">
|
|
74
|
+
<label
|
|
75
|
+
htmlFor="stgm-wizard-agent-name"
|
|
76
|
+
className="text-sm font-medium text-foreground"
|
|
77
|
+
>
|
|
78
|
+
Name <span className="text-destructive">*</span>
|
|
79
|
+
</label>
|
|
80
|
+
<input
|
|
81
|
+
id="stgm-wizard-agent-name"
|
|
82
|
+
type="text"
|
|
83
|
+
value={data.name}
|
|
84
|
+
onChange={(e) => handleNameChange(e.target.value)}
|
|
85
|
+
placeholder="e.g. PR Review Bot"
|
|
86
|
+
autoFocus
|
|
87
|
+
className={cn(
|
|
88
|
+
"w-full rounded-md border border-input bg-input-bg px-3 py-2 text-sm text-foreground",
|
|
89
|
+
"placeholder:text-muted-foreground",
|
|
90
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
91
|
+
)}
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
{/* Slug */}
|
|
96
|
+
<div className="space-y-1.5">
|
|
97
|
+
<label
|
|
98
|
+
htmlFor="stgm-wizard-agent-slug"
|
|
99
|
+
className="text-sm font-medium text-foreground"
|
|
100
|
+
>
|
|
101
|
+
Slug
|
|
102
|
+
</label>
|
|
103
|
+
<input
|
|
104
|
+
id="stgm-wizard-agent-slug"
|
|
105
|
+
type="text"
|
|
106
|
+
value={data.slug}
|
|
107
|
+
onChange={(e) => handleSlugChange(e.target.value)}
|
|
108
|
+
placeholder="auto-generated"
|
|
109
|
+
className={cn(
|
|
110
|
+
"w-full rounded-md border px-3 py-2 font-mono text-sm text-foreground",
|
|
111
|
+
slugError
|
|
112
|
+
? "border-destructive bg-input-bg"
|
|
113
|
+
: "border-input bg-input-bg",
|
|
114
|
+
"placeholder:text-muted-foreground",
|
|
115
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
116
|
+
)}
|
|
117
|
+
/>
|
|
118
|
+
{slugError && (
|
|
119
|
+
<p className="text-xs text-destructive">{slugError}</p>
|
|
120
|
+
)}
|
|
121
|
+
{!slugError && data.slug && (
|
|
122
|
+
<p className="text-xs text-muted-foreground">
|
|
123
|
+
Referenced as <code className="font-mono">{data.slug}</code>
|
|
124
|
+
</p>
|
|
125
|
+
)}
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
{/* Description */}
|
|
130
|
+
<div className="space-y-1.5">
|
|
131
|
+
<label
|
|
132
|
+
htmlFor="stgm-wizard-agent-description"
|
|
133
|
+
className="text-sm font-medium text-foreground"
|
|
134
|
+
>
|
|
135
|
+
Description
|
|
136
|
+
</label>
|
|
137
|
+
<input
|
|
138
|
+
id="stgm-wizard-agent-description"
|
|
139
|
+
type="text"
|
|
140
|
+
value={data.description}
|
|
141
|
+
onChange={(e) => updateData({ description: e.target.value })}
|
|
142
|
+
placeholder="A brief description of what this agent does"
|
|
143
|
+
maxLength={200}
|
|
144
|
+
className={cn(
|
|
145
|
+
"w-full rounded-md border border-input bg-input-bg px-3 py-2 text-sm text-foreground",
|
|
146
|
+
"placeholder:text-muted-foreground",
|
|
147
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
148
|
+
)}
|
|
149
|
+
/>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
{/* Icon URL + Visibility (same row) */}
|
|
153
|
+
<div className="grid gap-4 sm:grid-cols-2">
|
|
154
|
+
<div className="space-y-1.5">
|
|
155
|
+
<label
|
|
156
|
+
htmlFor="stgm-wizard-agent-icon"
|
|
157
|
+
className="text-sm font-medium text-foreground"
|
|
158
|
+
>
|
|
159
|
+
Icon URL
|
|
160
|
+
</label>
|
|
161
|
+
<input
|
|
162
|
+
id="stgm-wizard-agent-icon"
|
|
163
|
+
type="url"
|
|
164
|
+
value={data.iconUrl}
|
|
165
|
+
onChange={(e) => updateData({ iconUrl: e.target.value })}
|
|
166
|
+
placeholder="https://example.com/icon.png"
|
|
167
|
+
className={cn(
|
|
168
|
+
"w-full rounded-md border border-input bg-input-bg px-3 py-2 text-sm text-foreground",
|
|
169
|
+
"placeholder:text-muted-foreground",
|
|
170
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
171
|
+
)}
|
|
172
|
+
/>
|
|
173
|
+
</div>
|
|
174
|
+
|
|
175
|
+
<fieldset className="space-y-1.5">
|
|
176
|
+
<legend className="text-sm font-medium text-foreground">
|
|
177
|
+
Visibility
|
|
178
|
+
</legend>
|
|
179
|
+
<div className="flex gap-2">
|
|
180
|
+
<VisibilityOption
|
|
181
|
+
value="private"
|
|
182
|
+
label="Private"
|
|
183
|
+
checked={data.visibility === "private"}
|
|
184
|
+
onChange={() => updateData({ visibility: "private" })}
|
|
185
|
+
/>
|
|
186
|
+
<VisibilityOption
|
|
187
|
+
value="public"
|
|
188
|
+
label="Public"
|
|
189
|
+
checked={data.visibility === "public"}
|
|
190
|
+
onChange={() => updateData({ visibility: "public" })}
|
|
191
|
+
/>
|
|
192
|
+
</div>
|
|
193
|
+
</fieldset>
|
|
194
|
+
</div>
|
|
195
|
+
|
|
196
|
+
{/* Instructions */}
|
|
197
|
+
<div className="space-y-1.5">
|
|
198
|
+
<label
|
|
199
|
+
htmlFor="stgm-wizard-agent-instructions"
|
|
200
|
+
className="text-sm font-medium text-foreground"
|
|
201
|
+
>
|
|
202
|
+
Instructions
|
|
203
|
+
</label>
|
|
204
|
+
<p className="text-xs text-muted-foreground">
|
|
205
|
+
The system prompt that defines this agent's behavior.
|
|
206
|
+
</p>
|
|
207
|
+
<textarea
|
|
208
|
+
id="stgm-wizard-agent-instructions"
|
|
209
|
+
value={data.instructions}
|
|
210
|
+
onChange={(e) => updateData({ instructions: e.target.value })}
|
|
211
|
+
placeholder="You are a helpful assistant that..."
|
|
212
|
+
rows={12}
|
|
213
|
+
className={cn(
|
|
214
|
+
"w-full resize-y rounded-md border border-input bg-input-bg px-3 py-2 font-mono text-sm text-foreground",
|
|
215
|
+
"placeholder:text-muted-foreground",
|
|
216
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
217
|
+
)}
|
|
218
|
+
/>
|
|
219
|
+
</div>
|
|
220
|
+
</div>
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// ---------------------------------------------------------------------------
|
|
225
|
+
// Visibility radio option
|
|
226
|
+
// ---------------------------------------------------------------------------
|
|
227
|
+
|
|
228
|
+
function VisibilityOption({
|
|
229
|
+
value,
|
|
230
|
+
label,
|
|
231
|
+
checked,
|
|
232
|
+
onChange,
|
|
233
|
+
}: {
|
|
234
|
+
readonly value: string;
|
|
235
|
+
readonly label: string;
|
|
236
|
+
readonly checked: boolean;
|
|
237
|
+
readonly onChange: () => void;
|
|
238
|
+
}) {
|
|
239
|
+
return (
|
|
240
|
+
<label
|
|
241
|
+
className={cn(
|
|
242
|
+
"inline-flex cursor-pointer items-center rounded-md border px-3 py-1.5 text-sm transition-colors",
|
|
243
|
+
checked
|
|
244
|
+
? "border-primary bg-primary-subtle text-primary font-medium"
|
|
245
|
+
: "border-input bg-input-bg text-muted-foreground hover:border-border hover:text-foreground",
|
|
246
|
+
)}
|
|
247
|
+
>
|
|
248
|
+
<input
|
|
249
|
+
type="radio"
|
|
250
|
+
name="stgm-wizard-agent-visibility"
|
|
251
|
+
value={value}
|
|
252
|
+
checked={checked}
|
|
253
|
+
onChange={onChange}
|
|
254
|
+
className="sr-only"
|
|
255
|
+
/>
|
|
256
|
+
{label}
|
|
257
|
+
</label>
|
|
258
|
+
);
|
|
259
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { getUserMessage } from "@stigmer/sdk";
|
|
6
|
+
import type { AgentInput } from "@stigmer/sdk";
|
|
7
|
+
import { serializeAgentInputYaml } from "../../library/serialize-resource-yaml";
|
|
8
|
+
import type { AgentWizardData } from "./types";
|
|
9
|
+
|
|
10
|
+
/** Props for {@link ReviewStep}. */
|
|
11
|
+
export interface ReviewStepProps {
|
|
12
|
+
readonly org: string;
|
|
13
|
+
readonly data: AgentWizardData;
|
|
14
|
+
readonly isCreating: boolean;
|
|
15
|
+
readonly error: Error | null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Wizard step 3: Review and create.
|
|
20
|
+
*
|
|
21
|
+
* Shows a summary card with key configuration details and a full
|
|
22
|
+
* YAML preview of the agent that will be created. The "Create" action
|
|
23
|
+
* is in the WizardNav footer, not in this component.
|
|
24
|
+
*/
|
|
25
|
+
export function ReviewStep({
|
|
26
|
+
org,
|
|
27
|
+
data,
|
|
28
|
+
isCreating,
|
|
29
|
+
error,
|
|
30
|
+
}: ReviewStepProps) {
|
|
31
|
+
const agentInput = useMemo(() => buildAgentInput(org, data), [org, data]);
|
|
32
|
+
const yamlPreview = useMemo(
|
|
33
|
+
() => serializeAgentInputYaml(agentInput),
|
|
34
|
+
[agentInput],
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<div className="flex flex-col gap-6">
|
|
39
|
+
<div>
|
|
40
|
+
<h2 className="text-lg font-semibold text-foreground">
|
|
41
|
+
Review & Create
|
|
42
|
+
</h2>
|
|
43
|
+
<p className="mt-1 text-sm text-muted-foreground">
|
|
44
|
+
Review the agent configuration below, then create it.
|
|
45
|
+
</p>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
{/* Summary card */}
|
|
49
|
+
<div className="rounded-lg border border-border p-4">
|
|
50
|
+
<dl className="grid gap-x-6 gap-y-3 text-sm sm:grid-cols-2">
|
|
51
|
+
<SummaryItem label="Name" value={data.name} />
|
|
52
|
+
<SummaryItem label="Slug" value={data.slug} mono />
|
|
53
|
+
<SummaryItem label="Organization" value={org} mono />
|
|
54
|
+
<SummaryItem
|
|
55
|
+
label="Visibility"
|
|
56
|
+
value={data.visibility === "public" ? "Public" : "Private"}
|
|
57
|
+
/>
|
|
58
|
+
{data.description && (
|
|
59
|
+
<SummaryItem
|
|
60
|
+
label="Description"
|
|
61
|
+
value={data.description}
|
|
62
|
+
className="sm:col-span-2"
|
|
63
|
+
/>
|
|
64
|
+
)}
|
|
65
|
+
{data.instructions && (
|
|
66
|
+
<SummaryItem
|
|
67
|
+
label="Instructions"
|
|
68
|
+
value={truncate(data.instructions, 120)}
|
|
69
|
+
className="sm:col-span-2"
|
|
70
|
+
/>
|
|
71
|
+
)}
|
|
72
|
+
<SummaryItem
|
|
73
|
+
label="MCP Servers"
|
|
74
|
+
value={
|
|
75
|
+
data.mcpServerUsages.length > 0
|
|
76
|
+
? `${data.mcpServerUsages.length} configured`
|
|
77
|
+
: "None"
|
|
78
|
+
}
|
|
79
|
+
/>
|
|
80
|
+
<SummaryItem
|
|
81
|
+
label="Skills"
|
|
82
|
+
value={
|
|
83
|
+
data.skillRefs.length > 0
|
|
84
|
+
? `${data.skillRefs.length} attached`
|
|
85
|
+
: "None"
|
|
86
|
+
}
|
|
87
|
+
/>
|
|
88
|
+
{data.env.length > 0 && (
|
|
89
|
+
<SummaryItem
|
|
90
|
+
label="Env Variables"
|
|
91
|
+
value={`${data.env.length} declared`}
|
|
92
|
+
/>
|
|
93
|
+
)}
|
|
94
|
+
</dl>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
{/* YAML preview */}
|
|
98
|
+
<div className="space-y-2">
|
|
99
|
+
<h3 className="text-xs font-medium uppercase tracking-wider text-muted-foreground">
|
|
100
|
+
YAML Preview
|
|
101
|
+
</h3>
|
|
102
|
+
<div className="max-h-80 overflow-auto rounded-lg border border-border bg-muted-faint">
|
|
103
|
+
<pre className="p-4 font-mono text-xs leading-relaxed text-foreground">
|
|
104
|
+
{yamlPreview}
|
|
105
|
+
</pre>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
{/* Error display */}
|
|
110
|
+
{error && (
|
|
111
|
+
<div className="rounded-md border border-destructive bg-muted-faint px-4 py-3" role="alert">
|
|
112
|
+
<p className="text-sm font-medium text-destructive">
|
|
113
|
+
Failed to create agent
|
|
114
|
+
</p>
|
|
115
|
+
<p className="mt-1 text-xs text-muted-foreground">
|
|
116
|
+
{getUserMessage(error)}
|
|
117
|
+
</p>
|
|
118
|
+
</div>
|
|
119
|
+
)}
|
|
120
|
+
|
|
121
|
+
{/* Creating state */}
|
|
122
|
+
{isCreating && (
|
|
123
|
+
<p className="text-sm text-muted-foreground" aria-live="polite">
|
|
124
|
+
Creating agent…
|
|
125
|
+
</p>
|
|
126
|
+
)}
|
|
127
|
+
</div>
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// ---------------------------------------------------------------------------
|
|
132
|
+
// Summary item
|
|
133
|
+
// ---------------------------------------------------------------------------
|
|
134
|
+
|
|
135
|
+
function SummaryItem({
|
|
136
|
+
label,
|
|
137
|
+
value,
|
|
138
|
+
mono,
|
|
139
|
+
className,
|
|
140
|
+
}: {
|
|
141
|
+
readonly label: string;
|
|
142
|
+
readonly value: string;
|
|
143
|
+
readonly mono?: boolean;
|
|
144
|
+
readonly className?: string;
|
|
145
|
+
}) {
|
|
146
|
+
return (
|
|
147
|
+
<div className={className}>
|
|
148
|
+
<dt className="text-xs text-muted-foreground">{label}</dt>
|
|
149
|
+
<dd
|
|
150
|
+
className={cn(
|
|
151
|
+
"mt-0.5 text-sm text-foreground",
|
|
152
|
+
mono && "font-mono",
|
|
153
|
+
)}
|
|
154
|
+
>
|
|
155
|
+
{value}
|
|
156
|
+
</dd>
|
|
157
|
+
</div>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// ---------------------------------------------------------------------------
|
|
162
|
+
// Helpers
|
|
163
|
+
// ---------------------------------------------------------------------------
|
|
164
|
+
|
|
165
|
+
function truncate(text: string, maxLength: number): string {
|
|
166
|
+
if (text.length <= maxLength) return text;
|
|
167
|
+
return text.slice(0, maxLength) + "…";
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Transforms wizard data into the SDK `AgentInput` shape for submission.
|
|
172
|
+
* Exported for reuse by `AgentCreationWizard`.
|
|
173
|
+
*/
|
|
174
|
+
export function buildAgentInput(
|
|
175
|
+
org: string,
|
|
176
|
+
data: AgentWizardData,
|
|
177
|
+
): AgentInput {
|
|
178
|
+
const input: AgentInput = {
|
|
179
|
+
name: data.name.trim(),
|
|
180
|
+
org,
|
|
181
|
+
...(data.slug && { slug: data.slug }),
|
|
182
|
+
...(data.description && { description: data.description.trim() }),
|
|
183
|
+
...(data.iconUrl && { iconUrl: data.iconUrl.trim() }),
|
|
184
|
+
...(data.instructions && { instructions: data.instructions }),
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
if (data.mcpServerUsages.length > 0) {
|
|
188
|
+
input.mcpServerUsages = data.mcpServerUsages;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (data.skillRefs.length > 0) {
|
|
192
|
+
input.skillRefs = data.skillRefs;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (data.env.length > 0) {
|
|
196
|
+
const env: Record<string, { isSecret?: boolean; description?: string; optional?: boolean }> = {};
|
|
197
|
+
for (const entry of data.env) {
|
|
198
|
+
if (!entry.key) continue;
|
|
199
|
+
env[entry.key] = {
|
|
200
|
+
...(entry.isSecret && { isSecret: true }),
|
|
201
|
+
...(entry.description && { description: entry.description }),
|
|
202
|
+
...(entry.optional && { optional: true }),
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
if (Object.keys(env).length > 0) {
|
|
206
|
+
input.env = env;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return input;
|
|
211
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { McpServerUsageInput, ResourceRef } from "@stigmer/sdk";
|
|
2
|
+
import type { EnvVarEntry } from "../../resource-creation/types";
|
|
3
|
+
|
|
4
|
+
export type { EnvVarEntry } from "../../resource-creation/types";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Accumulated form state for the agent creation wizard.
|
|
8
|
+
*
|
|
9
|
+
* Each field corresponds to a property on `AgentInput`. The wizard
|
|
10
|
+
* builds this incrementally across steps, then transforms it into
|
|
11
|
+
* an `AgentInput` for submission on the final step.
|
|
12
|
+
*/
|
|
13
|
+
export interface AgentWizardData {
|
|
14
|
+
// --- Step 1: Identity & Instructions ---
|
|
15
|
+
/** Agent display name (required). */
|
|
16
|
+
readonly name: string;
|
|
17
|
+
/** URL-friendly slug (auto-derived from name, editable). */
|
|
18
|
+
readonly slug: string;
|
|
19
|
+
/** Whether the slug has been manually edited by the user. */
|
|
20
|
+
readonly slugTouched: boolean;
|
|
21
|
+
/** Short description (optional). */
|
|
22
|
+
readonly description: string;
|
|
23
|
+
/** Icon URL (optional). */
|
|
24
|
+
readonly iconUrl: string;
|
|
25
|
+
/** Resource visibility. */
|
|
26
|
+
readonly visibility: "private" | "public";
|
|
27
|
+
/** System prompt / instructions (the agent's core content). */
|
|
28
|
+
readonly instructions: string;
|
|
29
|
+
|
|
30
|
+
// --- Step 2: Capabilities ---
|
|
31
|
+
/** MCP server usages with tool configuration. */
|
|
32
|
+
readonly mcpServerUsages: McpServerUsageInput[];
|
|
33
|
+
/** Skill references. */
|
|
34
|
+
readonly skillRefs: ResourceRef[];
|
|
35
|
+
/** Environment variable declarations. */
|
|
36
|
+
readonly env: EnvVarEntry[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Creates the initial empty wizard data. */
|
|
40
|
+
export function createInitialWizardData(): AgentWizardData {
|
|
41
|
+
return {
|
|
42
|
+
name: "",
|
|
43
|
+
slug: "",
|
|
44
|
+
slugTouched: false,
|
|
45
|
+
description: "",
|
|
46
|
+
iconUrl: "",
|
|
47
|
+
visibility: "private",
|
|
48
|
+
instructions: "",
|
|
49
|
+
mcpServerUsages: [],
|
|
50
|
+
skillRefs: [],
|
|
51
|
+
env: [],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import type { AgentInput } from "@stigmer/sdk";
|
|
5
|
+
import type { Agent } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
6
|
+
import { useStigmer } from "../hooks";
|
|
7
|
+
import { toError } from "../internal/toError";
|
|
8
|
+
|
|
9
|
+
/** Return value of {@link useCreateAgent}. */
|
|
10
|
+
export interface UseCreateAgentReturn {
|
|
11
|
+
/**
|
|
12
|
+
* Submit an {@link AgentInput} to create (or upsert) an agent blueprint.
|
|
13
|
+
*
|
|
14
|
+
* Uses `stigmer.agent.apply()` — the idempotent upsert operation.
|
|
15
|
+
* Resolves with the server-created/updated `Agent` proto including
|
|
16
|
+
* populated metadata (id, slug, audit timestamps).
|
|
17
|
+
*/
|
|
18
|
+
readonly create: (input: AgentInput) => Promise<Agent>;
|
|
19
|
+
/** `true` while the apply request is in flight. */
|
|
20
|
+
readonly isCreating: boolean;
|
|
21
|
+
/** Error from the last failed create, or `null` when healthy. */
|
|
22
|
+
readonly error: Error | null;
|
|
23
|
+
/** Reset `error` to `null`. */
|
|
24
|
+
readonly clearError: () => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Behavior hook that wraps `agent.apply()` with loading and error state.
|
|
29
|
+
*
|
|
30
|
+
* Creates an agent blueprint from an {@link AgentInput}. Uses `apply()`
|
|
31
|
+
* (upsert) rather than `create()` so re-submissions are idempotent —
|
|
32
|
+
* matching the CLI's `stigmer apply` semantics.
|
|
33
|
+
*
|
|
34
|
+
* Follows the established SDK mutation hook pattern: `isCreating` flag,
|
|
35
|
+
* `error` state, `clearError` reset, result returned from the promise
|
|
36
|
+
* (not stored in hook state).
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* const { create, isCreating, error, clearError } = useCreateAgent();
|
|
41
|
+
*
|
|
42
|
+
* const agent = await create({
|
|
43
|
+
* name: "pr-review-bot",
|
|
44
|
+
* org: "acme",
|
|
45
|
+
* instructions: "Review pull requests for code quality...",
|
|
46
|
+
* mcpServerUsages: [{ mcpServerRef: { org: "acme", slug: "github" } }],
|
|
47
|
+
* });
|
|
48
|
+
* // agent.metadata?.slug → "pr-review-bot"
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export function useCreateAgent(): UseCreateAgentReturn {
|
|
52
|
+
const stigmer = useStigmer();
|
|
53
|
+
const [isCreating, setIsCreating] = useState(false);
|
|
54
|
+
const [error, setError] = useState<Error | null>(null);
|
|
55
|
+
|
|
56
|
+
const clearError = useCallback(() => setError(null), []);
|
|
57
|
+
|
|
58
|
+
const create = useCallback(
|
|
59
|
+
async (input: AgentInput): Promise<Agent> => {
|
|
60
|
+
setIsCreating(true);
|
|
61
|
+
setError(null);
|
|
62
|
+
|
|
63
|
+
try {
|
|
64
|
+
return await stigmer.agent.apply(input);
|
|
65
|
+
} catch (err) {
|
|
66
|
+
setError(toError(err));
|
|
67
|
+
throw err;
|
|
68
|
+
} finally {
|
|
69
|
+
setIsCreating(false);
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
[stigmer],
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
return { create, isCreating, error, clearError };
|
|
76
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import type { Agent } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
5
|
+
import type { AgentInput } from "@stigmer/sdk";
|
|
6
|
+
import { useStigmer } from "../hooks";
|
|
7
|
+
import { toError } from "../internal/toError";
|
|
8
|
+
|
|
9
|
+
/** Return value of {@link useUpdateAgent}. */
|
|
10
|
+
export interface UseUpdateAgentReturn {
|
|
11
|
+
/** Update an existing agent with a full input. Returns the updated resource. */
|
|
12
|
+
readonly update: (input: AgentInput) => Promise<Agent>;
|
|
13
|
+
/** `true` while the update RPC is in flight. */
|
|
14
|
+
readonly isUpdating: boolean;
|
|
15
|
+
/** Error from the last failed update, or `null` when healthy. */
|
|
16
|
+
readonly error: Error | null;
|
|
17
|
+
/** Clear the error state. */
|
|
18
|
+
readonly clearError: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Mutation hook that updates an existing Agent resource.
|
|
23
|
+
*
|
|
24
|
+
* Wraps `stigmer.agent.update(input)` with loading and error state.
|
|
25
|
+
* The caller must provide a **complete** `AgentInput` — the backend
|
|
26
|
+
* performs full spec replacement. Use `agentToInput()` to reconstruct
|
|
27
|
+
* the input from a fetched agent, modify the desired field, and pass
|
|
28
|
+
* the result here.
|
|
29
|
+
*/
|
|
30
|
+
export function useUpdateAgent(): UseUpdateAgentReturn {
|
|
31
|
+
const stigmer = useStigmer();
|
|
32
|
+
const [isUpdating, setIsUpdating] = useState(false);
|
|
33
|
+
const [error, setError] = useState<Error | null>(null);
|
|
34
|
+
|
|
35
|
+
const clearError = useCallback(() => setError(null), []);
|
|
36
|
+
|
|
37
|
+
const update = useCallback(
|
|
38
|
+
async (input: AgentInput): Promise<Agent> => {
|
|
39
|
+
setIsUpdating(true);
|
|
40
|
+
setError(null);
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
return await stigmer.agent.update(input);
|
|
44
|
+
} catch (err) {
|
|
45
|
+
setError(toError(err));
|
|
46
|
+
throw err;
|
|
47
|
+
} finally {
|
|
48
|
+
setIsUpdating(false);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
[stigmer],
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
return { update, isUpdating, error, clearError };
|
|
55
|
+
}
|