@stigmer/react 0.4.8 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action-menu/ActionMenu.d.ts +64 -0
- package/action-menu/ActionMenu.d.ts.map +1 -0
- package/action-menu/ActionMenu.js +78 -0
- package/action-menu/ActionMenu.js.map +1 -0
- package/action-menu/index.d.ts +3 -0
- package/action-menu/index.d.ts.map +1 -0
- package/action-menu/index.js +2 -0
- package/action-menu/index.js.map +1 -0
- package/action-menu/types.d.ts +65 -0
- package/action-menu/types.d.ts.map +1 -0
- package/action-menu/types.js +2 -0
- package/action-menu/types.js.map +1 -0
- package/agent/AgentCreationWizard.d.ts +55 -0
- package/agent/AgentCreationWizard.d.ts.map +1 -0
- package/agent/AgentCreationWizard.js +115 -0
- package/agent/AgentCreationWizard.js.map +1 -0
- package/agent/AgentDetailView.d.ts +77 -9
- package/agent/AgentDetailView.d.ts.map +1 -1
- package/agent/AgentDetailView.js +265 -87
- package/agent/AgentDetailView.js.map +1 -1
- package/agent/index.d.ts +8 -0
- package/agent/index.d.ts.map +1 -1
- package/agent/index.js +4 -0
- package/agent/index.js.map +1 -1
- package/agent/internal/agentToInput.d.ts +12 -0
- package/agent/internal/agentToInput.d.ts.map +1 -0
- package/agent/internal/agentToInput.js +72 -0
- package/agent/internal/agentToInput.js.map +1 -0
- package/agent/steps/CapabilitiesStep.d.ts +16 -0
- package/agent/steps/CapabilitiesStep.d.ts.map +1 -0
- package/agent/steps/CapabilitiesStep.js +80 -0
- package/agent/steps/CapabilitiesStep.js.map +1 -0
- package/agent/steps/IdentityStep.d.ts +18 -0
- package/agent/steps/IdentityStep.d.ts.map +1 -0
- package/agent/steps/IdentityStep.js +43 -0
- package/agent/steps/IdentityStep.js.map +1 -0
- package/agent/steps/ReviewStep.d.ts +23 -0
- package/agent/steps/ReviewStep.d.ts.map +1 -0
- package/agent/steps/ReviewStep.js +73 -0
- package/agent/steps/ReviewStep.js.map +1 -0
- package/agent/steps/types.d.ts +35 -0
- package/agent/steps/types.d.ts.map +1 -0
- package/agent/steps/types.js +16 -0
- package/agent/steps/types.js.map +1 -0
- package/agent/useCreateAgent.d.ts +45 -0
- package/agent/useCreateAgent.d.ts.map +1 -0
- package/agent/useCreateAgent.js +50 -0
- package/agent/useCreateAgent.js.map +1 -0
- package/agent/useUpdateAgent.d.ts +24 -0
- package/agent/useUpdateAgent.d.ts.map +1 -0
- package/agent/useUpdateAgent.js +35 -0
- package/agent/useUpdateAgent.js.map +1 -0
- package/dependency-graph/DependencyGraph.d.ts +37 -0
- package/dependency-graph/DependencyGraph.d.ts.map +1 -0
- package/dependency-graph/DependencyGraph.js +88 -0
- package/dependency-graph/DependencyGraph.js.map +1 -0
- package/dependency-graph/DependencyTreeNode.d.ts +23 -0
- package/dependency-graph/DependencyTreeNode.d.ts.map +1 -0
- package/dependency-graph/DependencyTreeNode.js +99 -0
- package/dependency-graph/DependencyTreeNode.js.map +1 -0
- package/dependency-graph/index.d.ts +4 -0
- package/dependency-graph/index.d.ts.map +1 -0
- package/dependency-graph/index.js +5 -0
- package/dependency-graph/index.js.map +1 -0
- package/dependency-graph/types.d.ts +130 -0
- package/dependency-graph/types.d.ts.map +1 -0
- package/dependency-graph/types.js +2 -0
- package/dependency-graph/types.js.map +1 -0
- package/dependency-graph/useDependencyGraph.d.ts +27 -0
- package/dependency-graph/useDependencyGraph.d.ts.map +1 -0
- package/dependency-graph/useDependencyGraph.js +129 -0
- package/dependency-graph/useDependencyGraph.js.map +1 -0
- package/empty-state/EmptyState.d.ts +29 -0
- package/empty-state/EmptyState.d.ts.map +1 -0
- package/empty-state/EmptyState.js +45 -0
- package/empty-state/EmptyState.js.map +1 -0
- package/empty-state/index.d.ts +4 -0
- package/empty-state/index.d.ts.map +1 -0
- package/empty-state/index.js +3 -0
- package/empty-state/index.js.map +1 -0
- package/empty-state/types.d.ts +73 -0
- package/empty-state/types.d.ts.map +1 -0
- package/empty-state/types.js +2 -0
- package/empty-state/types.js.map +1 -0
- package/empty-state/useEmptyState.d.ts +18 -0
- package/empty-state/useEmptyState.d.ts.map +1 -0
- package/empty-state/useEmptyState.js +72 -0
- package/empty-state/useEmptyState.js.map +1 -0
- package/feedback/StigmerToaster.d.ts +18 -0
- package/feedback/StigmerToaster.d.ts.map +1 -0
- package/feedback/StigmerToaster.js +31 -0
- package/feedback/StigmerToaster.js.map +1 -0
- package/feedback/index.d.ts +4 -0
- package/feedback/index.d.ts.map +1 -0
- package/feedback/index.js +3 -0
- package/feedback/index.js.map +1 -0
- package/feedback/toast.d.ts +14 -0
- package/feedback/toast.d.ts.map +1 -0
- package/feedback/toast.js +14 -0
- package/feedback/toast.js.map +1 -0
- package/feedback/types.d.ts +4 -0
- package/feedback/types.d.ts.map +1 -0
- package/feedback/types.js +2 -0
- package/feedback/types.js.map +1 -0
- package/index.d.ts +30 -10
- package/index.d.ts.map +1 -1
- package/index.js +29 -9
- package/index.js.map +1 -1
- package/inline-edit/InlineEditImage.d.ts +20 -0
- package/inline-edit/InlineEditImage.d.ts.map +1 -0
- package/inline-edit/InlineEditImage.js +85 -0
- package/inline-edit/InlineEditImage.js.map +1 -0
- package/inline-edit/InlineEditKeyValue.d.ts +29 -0
- package/inline-edit/InlineEditKeyValue.d.ts.map +1 -0
- package/inline-edit/InlineEditKeyValue.js +67 -0
- package/inline-edit/InlineEditKeyValue.js.map +1 -0
- package/inline-edit/InlineEditResourceList.d.ts +34 -0
- package/inline-edit/InlineEditResourceList.d.ts.map +1 -0
- package/inline-edit/InlineEditResourceList.js +99 -0
- package/inline-edit/InlineEditResourceList.js.map +1 -0
- package/inline-edit/InlineEditSelect.d.ts +18 -0
- package/inline-edit/InlineEditSelect.d.ts.map +1 -0
- package/inline-edit/InlineEditSelect.js +54 -0
- package/inline-edit/InlineEditSelect.js.map +1 -0
- package/inline-edit/InlineEditText.d.ts +23 -0
- package/inline-edit/InlineEditText.d.ts.map +1 -0
- package/inline-edit/InlineEditText.js +79 -0
- package/inline-edit/InlineEditText.js.map +1 -0
- package/inline-edit/InlineEditTextarea.d.ts +22 -0
- package/inline-edit/InlineEditTextarea.d.ts.map +1 -0
- package/inline-edit/InlineEditTextarea.js +83 -0
- package/inline-edit/InlineEditTextarea.js.map +1 -0
- package/inline-edit/index.d.ts +16 -0
- package/inline-edit/index.d.ts.map +1 -0
- package/inline-edit/index.js +8 -0
- package/inline-edit/index.js.map +1 -0
- package/inline-edit/types.d.ts +42 -0
- package/inline-edit/types.d.ts.map +1 -0
- package/inline-edit/types.js +2 -0
- package/inline-edit/types.js.map +1 -0
- package/inline-edit/useInlineFieldSave.d.ts +23 -0
- package/inline-edit/useInlineFieldSave.d.ts.map +1 -0
- package/inline-edit/useInlineFieldSave.js +44 -0
- package/inline-edit/useInlineFieldSave.js.map +1 -0
- package/internal/Tabs.d.ts +4 -38
- package/internal/Tabs.d.ts.map +1 -1
- package/internal/Tabs.js +3 -62
- package/internal/Tabs.js.map +1 -1
- package/library/ImportResourceDialog.d.ts +43 -0
- package/library/ImportResourceDialog.d.ts.map +1 -0
- package/library/ImportResourceDialog.js +90 -0
- package/library/ImportResourceDialog.js.map +1 -0
- package/library/index.d.ts +7 -4
- package/library/index.d.ts.map +1 -1
- package/library/index.js +4 -2
- package/library/index.js.map +1 -1
- package/library/serialize-resource-yaml.d.ts +53 -0
- package/library/serialize-resource-yaml.d.ts.map +1 -1
- package/library/serialize-resource-yaml.js +275 -0
- package/library/serialize-resource-yaml.js.map +1 -1
- package/library/useExportResource.d.ts +56 -0
- package/library/useExportResource.d.ts.map +1 -0
- package/library/useExportResource.js +137 -0
- package/library/useExportResource.js.map +1 -0
- package/library/useImportResource.d.ts +84 -0
- package/library/useImportResource.d.ts.map +1 -0
- package/library/useImportResource.js +188 -0
- package/library/useImportResource.js.map +1 -0
- package/mcp-server/McpServerCreationWizard.d.ts +55 -0
- package/mcp-server/McpServerCreationWizard.d.ts.map +1 -0
- package/mcp-server/McpServerCreationWizard.js +121 -0
- package/mcp-server/McpServerCreationWizard.js.map +1 -0
- package/mcp-server/McpServerDetailView.d.ts +21 -1
- package/mcp-server/McpServerDetailView.d.ts.map +1 -1
- package/mcp-server/McpServerDetailView.js +113 -20
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/mcp-server/index.d.ts +8 -0
- package/mcp-server/index.d.ts.map +1 -1
- package/mcp-server/index.js +4 -0
- package/mcp-server/index.js.map +1 -1
- package/mcp-server/internal/mcpServerToInput.d.ts +12 -0
- package/mcp-server/internal/mcpServerToInput.d.ts.map +1 -0
- package/mcp-server/internal/mcpServerToInput.js +81 -0
- package/mcp-server/internal/mcpServerToInput.js.map +1 -0
- package/mcp-server/steps/EnvironmentAuthStep.d.ts +15 -0
- package/mcp-server/steps/EnvironmentAuthStep.d.ts.map +1 -0
- package/mcp-server/steps/EnvironmentAuthStep.js +55 -0
- package/mcp-server/steps/EnvironmentAuthStep.js.map +1 -0
- package/mcp-server/steps/IdentityTransportStep.d.ts +19 -0
- package/mcp-server/steps/IdentityTransportStep.d.ts.map +1 -0
- package/mcp-server/steps/IdentityTransportStep.js +73 -0
- package/mcp-server/steps/IdentityTransportStep.js.map +1 -0
- package/mcp-server/steps/ReviewStep.d.ts +23 -0
- package/mcp-server/steps/ReviewStep.d.ts.map +1 -0
- package/mcp-server/steps/ReviewStep.js +137 -0
- package/mcp-server/steps/ReviewStep.js.map +1 -0
- package/mcp-server/steps/types.d.ts +56 -0
- package/mcp-server/steps/types.d.ts.map +1 -0
- package/mcp-server/steps/types.js +27 -0
- package/mcp-server/steps/types.js.map +1 -0
- package/mcp-server/useCreateMcpServer.d.ts +45 -0
- package/mcp-server/useCreateMcpServer.d.ts.map +1 -0
- package/mcp-server/useCreateMcpServer.js +50 -0
- package/mcp-server/useCreateMcpServer.js.map +1 -0
- package/mcp-server/useUpdateMcpServer.d.ts +24 -0
- package/mcp-server/useUpdateMcpServer.d.ts.map +1 -0
- package/mcp-server/useUpdateMcpServer.js +35 -0
- package/mcp-server/useUpdateMcpServer.js.map +1 -0
- package/package.json +8 -4
- package/resource-creation/CreationPicker.d.ts +60 -0
- package/resource-creation/CreationPicker.d.ts.map +1 -0
- package/resource-creation/CreationPicker.js +74 -0
- package/resource-creation/CreationPicker.js.map +1 -0
- package/resource-creation/StepIndicator.d.ts +28 -0
- package/resource-creation/StepIndicator.d.ts.map +1 -0
- package/resource-creation/StepIndicator.js +40 -0
- package/resource-creation/StepIndicator.js.map +1 -0
- package/resource-creation/TemplateCard.d.ts +24 -0
- package/resource-creation/TemplateCard.d.ts.map +1 -0
- package/resource-creation/TemplateCard.js +68 -0
- package/resource-creation/TemplateCard.js.map +1 -0
- package/resource-creation/TemplateGallery.d.ts +43 -0
- package/resource-creation/TemplateGallery.d.ts.map +1 -0
- package/resource-creation/TemplateGallery.js +78 -0
- package/resource-creation/TemplateGallery.js.map +1 -0
- package/resource-creation/WizardNav.d.ts +31 -0
- package/resource-creation/WizardNav.d.ts.map +1 -0
- package/resource-creation/WizardNav.js +29 -0
- package/resource-creation/WizardNav.js.map +1 -0
- package/resource-creation/WizardShell.d.ts +41 -0
- package/resource-creation/WizardShell.d.ts.map +1 -0
- package/resource-creation/WizardShell.js +55 -0
- package/resource-creation/WizardShell.js.map +1 -0
- package/resource-creation/index.d.ts +21 -0
- package/resource-creation/index.d.ts.map +1 -0
- package/resource-creation/index.js +14 -0
- package/resource-creation/index.js.map +1 -0
- package/resource-creation/templates/agent-templates.d.ts +15 -0
- package/resource-creation/templates/agent-templates.d.ts.map +1 -0
- package/resource-creation/templates/agent-templates.js +148 -0
- package/resource-creation/templates/agent-templates.js.map +1 -0
- package/resource-creation/templates/index.d.ts +5 -0
- package/resource-creation/templates/index.d.ts.map +1 -0
- package/resource-creation/templates/index.js +5 -0
- package/resource-creation/templates/index.js.map +1 -0
- package/resource-creation/templates/mcp-server-templates.d.ts +15 -0
- package/resource-creation/templates/mcp-server-templates.d.ts.map +1 -0
- package/resource-creation/templates/mcp-server-templates.js +92 -0
- package/resource-creation/templates/mcp-server-templates.js.map +1 -0
- package/resource-creation/templates/types.d.ts +48 -0
- package/resource-creation/templates/types.d.ts.map +1 -0
- package/resource-creation/templates/types.js +16 -0
- package/resource-creation/templates/types.js.map +1 -0
- package/resource-creation/types.d.ts +88 -0
- package/resource-creation/types.d.ts.map +1 -0
- package/resource-creation/types.js +2 -0
- package/resource-creation/types.js.map +1 -0
- package/resource-creation/useTemplateFilter.d.ts +43 -0
- package/resource-creation/useTemplateFilter.d.ts.map +1 -0
- package/resource-creation/useTemplateFilter.js +73 -0
- package/resource-creation/useTemplateFilter.js.map +1 -0
- package/resource-creation/useWizardState.d.ts +67 -0
- package/resource-creation/useWizardState.d.ts.map +1 -0
- package/resource-creation/useWizardState.js +143 -0
- package/resource-creation/useWizardState.js.map +1 -0
- package/resource-detail/ConfirmDialog.d.ts +44 -0
- package/resource-detail/ConfirmDialog.d.ts.map +1 -0
- package/resource-detail/ConfirmDialog.js +62 -0
- package/resource-detail/ConfirmDialog.js.map +1 -0
- package/resource-detail/ResourceActionBar.d.ts +42 -0
- package/resource-detail/ResourceActionBar.d.ts.map +1 -0
- package/resource-detail/ResourceActionBar.js +64 -0
- package/resource-detail/ResourceActionBar.js.map +1 -0
- package/resource-detail/ResourceDetailShell.d.ts +36 -0
- package/resource-detail/ResourceDetailShell.d.ts.map +1 -0
- package/resource-detail/ResourceDetailShell.js +65 -0
- package/resource-detail/ResourceDetailShell.js.map +1 -0
- package/resource-detail/Section.d.ts +18 -0
- package/resource-detail/Section.d.ts.map +1 -0
- package/resource-detail/Section.js +18 -0
- package/resource-detail/Section.js.map +1 -0
- package/resource-detail/index.d.ts +15 -0
- package/resource-detail/index.d.ts.map +1 -0
- package/resource-detail/index.js +10 -0
- package/resource-detail/index.js.map +1 -0
- package/resource-detail/types.d.ts +146 -0
- package/resource-detail/types.d.ts.map +1 -0
- package/resource-detail/types.js +2 -0
- package/resource-detail/types.js.map +1 -0
- package/resource-detail/useConfirmAction.d.ts +41 -0
- package/resource-detail/useConfirmAction.d.ts.map +1 -0
- package/resource-detail/useConfirmAction.js +30 -0
- package/resource-detail/useConfirmAction.js.map +1 -0
- package/resource-detail/useCopyResource.d.ts +28 -0
- package/resource-detail/useCopyResource.d.ts.map +1 -0
- package/resource-detail/useCopyResource.js +46 -0
- package/resource-detail/useCopyResource.js.map +1 -0
- package/resource-detail/useDeleteResource.d.ts +40 -0
- package/resource-detail/useDeleteResource.d.ts.map +1 -0
- package/resource-detail/useDeleteResource.js +83 -0
- package/resource-detail/useDeleteResource.js.map +1 -0
- package/resource-detail/useDetailTabs.d.ts +46 -0
- package/resource-detail/useDetailTabs.d.ts.map +1 -0
- package/resource-detail/useDetailTabs.js +47 -0
- package/resource-detail/useDetailTabs.js.map +1 -0
- package/resource-workbench/components/BulkActionBar.d.ts +36 -0
- package/resource-workbench/components/BulkActionBar.d.ts.map +1 -0
- package/resource-workbench/components/BulkActionBar.js +35 -0
- package/resource-workbench/components/BulkActionBar.js.map +1 -0
- package/resource-workbench/components/ColumnHeader.d.ts +23 -0
- package/resource-workbench/components/ColumnHeader.d.ts.map +1 -0
- package/resource-workbench/components/ColumnHeader.js +25 -0
- package/resource-workbench/components/ColumnHeader.js.map +1 -0
- package/resource-workbench/components/FilterBar.d.ts +33 -0
- package/resource-workbench/components/FilterBar.d.ts.map +1 -0
- package/resource-workbench/components/FilterBar.js +72 -0
- package/resource-workbench/components/FilterBar.js.map +1 -0
- package/resource-workbench/components/ResourceAvatar.d.ts +29 -0
- package/resource-workbench/components/ResourceAvatar.d.ts.map +1 -0
- package/resource-workbench/components/ResourceAvatar.js +51 -0
- package/resource-workbench/components/ResourceAvatar.js.map +1 -0
- package/resource-workbench/components/ResourceCards.d.ts +39 -0
- package/resource-workbench/components/ResourceCards.d.ts.map +1 -0
- package/resource-workbench/components/ResourceCards.js +41 -0
- package/resource-workbench/components/ResourceCards.js.map +1 -0
- package/resource-workbench/components/ResourceInspector.d.ts +26 -0
- package/resource-workbench/components/ResourceInspector.d.ts.map +1 -0
- package/resource-workbench/components/ResourceInspector.js +22 -0
- package/resource-workbench/components/ResourceInspector.js.map +1 -0
- package/resource-workbench/components/ResourceList.d.ts +39 -0
- package/resource-workbench/components/ResourceList.d.ts.map +1 -0
- package/resource-workbench/components/ResourceList.js +41 -0
- package/resource-workbench/components/ResourceList.js.map +1 -0
- package/resource-workbench/components/ResourceTable.d.ts +47 -0
- package/resource-workbench/components/ResourceTable.d.ts.map +1 -0
- package/resource-workbench/components/ResourceTable.js +78 -0
- package/resource-workbench/components/ResourceTable.js.map +1 -0
- package/resource-workbench/components/ResourceWorkbench.d.ts +131 -0
- package/resource-workbench/components/ResourceWorkbench.d.ts.map +1 -0
- package/resource-workbench/components/ResourceWorkbench.js +170 -0
- package/resource-workbench/components/ResourceWorkbench.js.map +1 -0
- package/resource-workbench/components/SelectionCheckbox.d.ts +24 -0
- package/resource-workbench/components/SelectionCheckbox.d.ts.map +1 -0
- package/resource-workbench/components/SelectionCheckbox.js +16 -0
- package/resource-workbench/components/SelectionCheckbox.js.map +1 -0
- package/resource-workbench/components/StatusBadge.d.ts +31 -0
- package/resource-workbench/components/StatusBadge.d.ts.map +1 -0
- package/resource-workbench/components/StatusBadge.js +75 -0
- package/resource-workbench/components/StatusBadge.js.map +1 -0
- package/resource-workbench/components/ViewSwitcher.d.ts +21 -0
- package/resource-workbench/components/ViewSwitcher.d.ts.map +1 -0
- package/resource-workbench/components/ViewSwitcher.js +37 -0
- package/resource-workbench/components/ViewSwitcher.js.map +1 -0
- package/resource-workbench/hooks/useResourceCollection.d.ts +93 -0
- package/resource-workbench/hooks/useResourceCollection.d.ts.map +1 -0
- package/resource-workbench/hooks/useResourceCollection.js +133 -0
- package/resource-workbench/hooks/useResourceCollection.js.map +1 -0
- package/resource-workbench/hooks/useResourceFilters.d.ts +73 -0
- package/resource-workbench/hooks/useResourceFilters.d.ts.map +1 -0
- package/resource-workbench/hooks/useResourceFilters.js +105 -0
- package/resource-workbench/hooks/useResourceFilters.js.map +1 -0
- package/resource-workbench/hooks/useResourceSelection.d.ts +44 -0
- package/resource-workbench/hooks/useResourceSelection.d.ts.map +1 -0
- package/resource-workbench/hooks/useResourceSelection.js +123 -0
- package/resource-workbench/hooks/useResourceSelection.js.map +1 -0
- package/resource-workbench/hooks/useViewPreference.d.ts +32 -0
- package/resource-workbench/hooks/useViewPreference.d.ts.map +1 -0
- package/resource-workbench/hooks/useViewPreference.js +60 -0
- package/resource-workbench/hooks/useViewPreference.js.map +1 -0
- package/resource-workbench/index.d.ts +34 -0
- package/resource-workbench/index.d.ts.map +1 -0
- package/resource-workbench/index.js +19 -0
- package/resource-workbench/index.js.map +1 -0
- package/resource-workbench/types.d.ts +165 -0
- package/resource-workbench/types.d.ts.map +1 -0
- package/resource-workbench/types.js +2 -0
- package/resource-workbench/types.js.map +1 -0
- package/runner/RunnerDetailView.d.ts +44 -0
- package/runner/RunnerDetailView.d.ts.map +1 -0
- package/runner/RunnerDetailView.js +154 -0
- package/runner/RunnerDetailView.js.map +1 -0
- package/runner/RunnerListPanel.d.ts +26 -1
- package/runner/RunnerListPanel.d.ts.map +1 -1
- package/runner/RunnerListPanel.js +68 -46
- package/runner/RunnerListPanel.js.map +1 -1
- package/runner/index.d.ts +7 -1
- package/runner/index.d.ts.map +1 -1
- package/runner/index.js +3 -0
- package/runner/index.js.map +1 -1
- package/runner/shared.d.ts +31 -0
- package/runner/shared.d.ts.map +1 -0
- package/runner/shared.js +55 -0
- package/runner/shared.js.map +1 -0
- package/runner/useRunner.d.ts +37 -0
- package/runner/useRunner.d.ts.map +1 -0
- package/runner/useRunner.js +24 -0
- package/runner/useRunner.js.map +1 -0
- package/session/__tests__/group-sessions.test.js +3 -3
- package/session/__tests__/group-sessions.test.js.map +1 -1
- package/skill/SkillDetailView.d.ts +70 -7
- package/skill/SkillDetailView.d.ts.map +1 -1
- package/skill/SkillDetailView.js +107 -39
- package/skill/SkillDetailView.js.map +1 -1
- package/skill/SkillDiffDialog.d.ts +42 -0
- package/skill/SkillDiffDialog.d.ts.map +1 -0
- package/skill/SkillDiffDialog.js +72 -0
- package/skill/SkillDiffDialog.js.map +1 -0
- package/skill/SkillFileBrowser.d.ts +31 -0
- package/skill/SkillFileBrowser.d.ts.map +1 -0
- package/skill/SkillFileBrowser.js +105 -0
- package/skill/SkillFileBrowser.js.map +1 -0
- package/skill/SkillUploader.d.ts +39 -0
- package/skill/SkillUploader.d.ts.map +1 -0
- package/skill/SkillUploader.js +141 -0
- package/skill/SkillUploader.js.map +1 -0
- package/skill/index.d.ts +18 -0
- package/skill/index.d.ts.map +1 -1
- package/skill/index.js +9 -0
- package/skill/index.js.map +1 -1
- package/skill/internal/computeArtifactHash.d.ts +9 -0
- package/skill/internal/computeArtifactHash.d.ts.map +1 -0
- package/skill/internal/computeArtifactHash.js +14 -0
- package/skill/internal/computeArtifactHash.js.map +1 -0
- package/skill/internal/fetchAndUnpackArtifact.d.ts +16 -0
- package/skill/internal/fetchAndUnpackArtifact.d.ts.map +1 -0
- package/skill/internal/fetchAndUnpackArtifact.js +34 -0
- package/skill/internal/fetchAndUnpackArtifact.js.map +1 -0
- package/skill/usePushSkill.d.ts +53 -0
- package/skill/usePushSkill.d.ts.map +1 -0
- package/skill/usePushSkill.js +57 -0
- package/skill/usePushSkill.js.map +1 -0
- package/skill/useSkillArtifact.d.ts +37 -0
- package/skill/useSkillArtifact.d.ts.map +1 -0
- package/skill/useSkillArtifact.js +76 -0
- package/skill/useSkillArtifact.js.map +1 -0
- package/skill/useSkillDiff.d.ts +31 -0
- package/skill/useSkillDiff.d.ts.map +1 -0
- package/skill/useSkillDiff.js +97 -0
- package/skill/useSkillDiff.js.map +1 -0
- package/skill/useSkillDuplicateCheck.d.ts +34 -0
- package/skill/useSkillDuplicateCheck.d.ts.map +1 -0
- package/skill/useSkillDuplicateCheck.js +58 -0
- package/skill/useSkillDuplicateCheck.js.map +1 -0
- package/skill/useSkillUpload.d.ts +69 -0
- package/skill/useSkillUpload.d.ts.map +1 -0
- package/skill/useSkillUpload.js +157 -0
- package/skill/useSkillUpload.js.map +1 -0
- package/skill/useSkillVersions.d.ts +46 -0
- package/skill/useSkillVersions.d.ts.map +1 -0
- package/skill/useSkillVersions.js +104 -0
- package/skill/useSkillVersions.js.map +1 -0
- package/src/action-menu/ActionMenu.tsx +151 -0
- package/src/action-menu/index.ts +9 -0
- package/src/action-menu/types.ts +70 -0
- package/src/agent/AgentCreationWizard.tsx +201 -0
- package/src/agent/AgentDetailView.tsx +817 -321
- package/src/agent/index.ts +16 -0
- package/src/agent/internal/agentToInput.ts +95 -0
- package/src/agent/steps/CapabilitiesStep.tsx +363 -0
- package/src/agent/steps/IdentityStep.tsx +259 -0
- package/src/agent/steps/ReviewStep.tsx +211 -0
- package/src/agent/steps/types.ts +53 -0
- package/src/agent/useCreateAgent.ts +76 -0
- package/src/agent/useUpdateAgent.ts +55 -0
- package/src/dependency-graph/DependencyGraph.tsx +153 -0
- package/src/dependency-graph/DependencyTreeNode.tsx +282 -0
- package/src/dependency-graph/index.ts +15 -0
- package/src/dependency-graph/types.ts +131 -0
- package/src/dependency-graph/useDependencyGraph.ts +158 -0
- package/src/empty-state/EmptyState.tsx +90 -0
- package/src/empty-state/index.ts +9 -0
- package/src/empty-state/types.ts +81 -0
- package/src/empty-state/useEmptyState.ts +85 -0
- package/src/feedback/StigmerToaster.tsx +45 -0
- package/src/feedback/index.ts +3 -0
- package/src/feedback/toast.ts +13 -0
- package/src/feedback/types.ts +7 -0
- package/src/index.ts +270 -8
- package/src/inline-edit/InlineEditImage.tsx +208 -0
- package/src/inline-edit/InlineEditKeyValue.tsx +278 -0
- package/src/inline-edit/InlineEditResourceList.tsx +325 -0
- package/src/inline-edit/InlineEditSelect.tsx +150 -0
- package/src/inline-edit/InlineEditText.tsx +211 -0
- package/src/inline-edit/InlineEditTextarea.tsx +209 -0
- package/src/inline-edit/index.ts +28 -0
- package/src/inline-edit/types.ts +47 -0
- package/src/inline-edit/useInlineFieldSave.ts +62 -0
- package/src/internal/Tabs.tsx +4 -164
- package/src/library/ImportResourceDialog.tsx +227 -0
- package/src/library/index.ts +18 -8
- package/src/library/serialize-resource-yaml.ts +356 -0
- package/src/library/useExportResource.ts +183 -0
- package/src/library/useImportResource.ts +253 -0
- package/src/mcp-server/McpServerCreationWizard.tsx +206 -0
- package/src/mcp-server/McpServerDetailView.tsx +392 -105
- package/src/mcp-server/index.ts +16 -0
- package/src/mcp-server/internal/mcpServerToInput.ts +95 -0
- package/src/mcp-server/steps/EnvironmentAuthStep.tsx +462 -0
- package/src/mcp-server/steps/IdentityTransportStep.tsx +531 -0
- package/src/mcp-server/steps/ReviewStep.tsx +297 -0
- package/src/mcp-server/steps/types.ts +85 -0
- package/src/mcp-server/useCreateMcpServer.ts +76 -0
- package/src/mcp-server/useUpdateMcpServer.ts +55 -0
- package/src/resource-creation/CreationPicker.tsx +292 -0
- package/src/resource-creation/StepIndicator.tsx +156 -0
- package/src/resource-creation/TemplateCard.tsx +143 -0
- package/src/resource-creation/TemplateGallery.tsx +222 -0
- package/src/resource-creation/WizardNav.tsx +163 -0
- package/src/resource-creation/WizardShell.tsx +124 -0
- package/src/resource-creation/index.ts +45 -0
- package/src/resource-creation/templates/agent-templates.ts +160 -0
- package/src/resource-creation/templates/index.ts +7 -0
- package/src/resource-creation/templates/mcp-server-templates.ts +106 -0
- package/src/resource-creation/templates/types.ts +64 -0
- package/src/resource-creation/types.ts +105 -0
- package/src/resource-creation/useTemplateFilter.ts +117 -0
- package/src/resource-creation/useWizardState.ts +223 -0
- package/src/resource-detail/ConfirmDialog.tsx +127 -0
- package/src/resource-detail/ResourceActionBar.tsx +157 -0
- package/src/resource-detail/ResourceDetailShell.tsx +184 -0
- package/src/resource-detail/Section.tsx +78 -0
- package/src/resource-detail/index.ts +34 -0
- package/src/resource-detail/types.ts +177 -0
- package/src/resource-detail/useConfirmAction.ts +70 -0
- package/src/resource-detail/useCopyResource.ts +74 -0
- package/src/resource-detail/useDeleteResource.ts +110 -0
- package/src/resource-detail/useDetailTabs.ts +93 -0
- package/src/resource-workbench/components/BulkActionBar.tsx +122 -0
- package/src/resource-workbench/components/ColumnHeader.tsx +105 -0
- package/src/resource-workbench/components/FilterBar.tsx +173 -0
- package/src/resource-workbench/components/ResourceAvatar.tsx +109 -0
- package/src/resource-workbench/components/ResourceCards.tsx +126 -0
- package/src/resource-workbench/components/ResourceInspector.tsx +88 -0
- package/src/resource-workbench/components/ResourceList.tsx +121 -0
- package/src/resource-workbench/components/ResourceTable.tsx +222 -0
- package/src/resource-workbench/components/ResourceWorkbench.tsx +695 -0
- package/src/resource-workbench/components/SelectionCheckbox.tsx +52 -0
- package/src/resource-workbench/components/StatusBadge.tsx +119 -0
- package/src/resource-workbench/components/ViewSwitcher.tsx +135 -0
- package/src/resource-workbench/hooks/useResourceCollection.ts +261 -0
- package/src/resource-workbench/hooks/useResourceFilters.ts +216 -0
- package/src/resource-workbench/hooks/useResourceSelection.ts +178 -0
- package/src/resource-workbench/hooks/useViewPreference.ts +75 -0
- package/src/resource-workbench/index.ts +73 -0
- package/src/resource-workbench/types.ts +220 -0
- package/src/runner/RunnerDetailView.tsx +410 -0
- package/src/runner/RunnerListPanel.tsx +126 -111
- package/src/runner/index.ts +13 -1
- package/src/runner/shared.tsx +124 -0
- package/src/runner/useRunner.ts +59 -0
- package/src/session/__tests__/group-sessions.test.ts +5 -3
- package/src/skill/SkillDetailView.tsx +371 -165
- package/src/skill/SkillDiffDialog.tsx +213 -0
- package/src/skill/SkillFileBrowser.tsx +289 -0
- package/src/skill/SkillUploader.tsx +481 -0
- package/src/skill/index.ts +34 -0
- package/src/skill/internal/computeArtifactHash.ts +13 -0
- package/src/skill/internal/fetchAndUnpackArtifact.ts +48 -0
- package/src/skill/usePushSkill.ts +101 -0
- package/src/skill/useSkillArtifact.ts +107 -0
- package/src/skill/useSkillDiff.ts +128 -0
- package/src/skill/useSkillDuplicateCheck.ts +92 -0
- package/src/skill/useSkillUpload.ts +231 -0
- package/src/skill/useSkillVersions.ts +165 -0
- package/src/styles.css +28 -0
- package/src/tabs/Tabs.tsx +184 -0
- package/src/tabs/index.ts +2 -0
- package/src/version-history/DiffFileList.tsx +111 -0
- package/src/version-history/DiffSummary.tsx +61 -0
- package/src/version-history/DiffViewer.tsx +163 -0
- package/src/version-history/MultiFileDiffView.tsx +114 -0
- package/src/version-history/VersionTimeline.tsx +232 -0
- package/src/version-history/VersionTimelineEntry.tsx +254 -0
- package/src/version-history/computeDiff.ts +61 -0
- package/src/version-history/computeMultiFileDiff.ts +97 -0
- package/src/version-history/index.ts +22 -0
- package/src/version-history/types.ts +129 -0
- package/styles.css +1 -1
- package/tabs/Tabs.d.ts +58 -0
- package/tabs/Tabs.d.ts.map +1 -0
- package/tabs/Tabs.js +80 -0
- package/tabs/Tabs.js.map +1 -0
- package/tabs/index.d.ts +3 -0
- package/tabs/index.d.ts.map +1 -0
- package/tabs/index.js +2 -0
- package/tabs/index.js.map +1 -0
- package/version-history/DiffFileList.d.ts +22 -0
- package/version-history/DiffFileList.d.ts.map +1 -0
- package/version-history/DiffFileList.js +37 -0
- package/version-history/DiffFileList.js.map +1 -0
- package/version-history/DiffSummary.d.ts +21 -0
- package/version-history/DiffSummary.d.ts.map +1 -0
- package/version-history/DiffSummary.js +16 -0
- package/version-history/DiffSummary.js.map +1 -0
- package/version-history/DiffViewer.d.ts +31 -0
- package/version-history/DiffViewer.d.ts.map +1 -0
- package/version-history/DiffViewer.js +60 -0
- package/version-history/DiffViewer.js.map +1 -0
- package/version-history/MultiFileDiffView.d.ts +30 -0
- package/version-history/MultiFileDiffView.d.ts.map +1 -0
- package/version-history/MultiFileDiffView.js +40 -0
- package/version-history/MultiFileDiffView.js.map +1 -0
- package/version-history/VersionTimeline.d.ts +29 -0
- package/version-history/VersionTimeline.d.ts.map +1 -0
- package/version-history/VersionTimeline.js +87 -0
- package/version-history/VersionTimeline.js.map +1 -0
- package/version-history/VersionTimelineEntry.d.ts +22 -0
- package/version-history/VersionTimelineEntry.d.ts.map +1 -0
- package/version-history/VersionTimelineEntry.js +98 -0
- package/version-history/VersionTimelineEntry.js.map +1 -0
- package/version-history/computeDiff.d.ts +16 -0
- package/version-history/computeDiff.d.ts.map +1 -0
- package/version-history/computeDiff.js +54 -0
- package/version-history/computeDiff.js.map +1 -0
- package/version-history/computeMultiFileDiff.d.ts +15 -0
- package/version-history/computeMultiFileDiff.d.ts.map +1 -0
- package/version-history/computeMultiFileDiff.js +83 -0
- package/version-history/computeMultiFileDiff.js.map +1 -0
- package/version-history/index.d.ts +14 -0
- package/version-history/index.d.ts.map +1 -0
- package/version-history/index.js +9 -0
- package/version-history/index.js.map +1 -0
- package/version-history/types.d.ts +106 -0
- package/version-history/types.d.ts.map +1 -0
- package/version-history/types.js +2 -0
- package/version-history/types.js.map +1 -0
- package/library/ResourceListView.d.ts +0 -174
- package/library/ResourceListView.d.ts.map +0 -1
- package/library/ResourceListView.js +0 -318
- package/library/ResourceListView.js.map +0 -1
- package/src/library/ResourceListView.tsx +0 -956
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { useStigmer } from "../hooks";
|
|
5
|
+
import { toError } from "../internal/toError";
|
|
6
|
+
import type { SkillFileEntry } from "./useSkillUpload";
|
|
7
|
+
import { fetchAndUnpackArtifact } from "./internal/fetchAndUnpackArtifact";
|
|
8
|
+
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
// Public types
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
/** Return value of {@link useSkillArtifact}. */
|
|
14
|
+
export interface UseSkillArtifactReturn {
|
|
15
|
+
/** File entries in the skill package, or `null` while loading/on error. */
|
|
16
|
+
readonly files: SkillFileEntry[] | null;
|
|
17
|
+
/** `true` while the artifact is being fetched and unpacked. */
|
|
18
|
+
readonly isLoading: boolean;
|
|
19
|
+
/** Error from the fetch/unpack, or `null` when healthy. */
|
|
20
|
+
readonly error: Error | null;
|
|
21
|
+
/** Get the text content of a file by path, or `null` if not available. */
|
|
22
|
+
readonly getFileContent: (path: string) => string | null;
|
|
23
|
+
/** Re-fetch the artifact from the server. */
|
|
24
|
+
readonly refetch: () => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
// Hook implementation
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Data hook that fetches and unpacks a skill's ZIP artifact for browsing.
|
|
33
|
+
*
|
|
34
|
+
* Uses `stigmer.skill.getArtifact()` with the skill's storage key,
|
|
35
|
+
* then decompresses the ZIP using `fflate` to expose a file listing
|
|
36
|
+
* and content retrieval.
|
|
37
|
+
*
|
|
38
|
+
* Pass `null` for `artifactStorageKey` to skip fetching (stable no-op).
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* const { skill } = useSkill(org, slug);
|
|
43
|
+
* const { files, getFileContent, isLoading } = useSkillArtifact(
|
|
44
|
+
* skill?.status?.artifactStorageKey ?? null
|
|
45
|
+
* );
|
|
46
|
+
*
|
|
47
|
+
* if (files) {
|
|
48
|
+
* const readme = getFileContent("SKILL.md");
|
|
49
|
+
* }
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export function useSkillArtifact(
|
|
53
|
+
artifactStorageKey: string | null,
|
|
54
|
+
): UseSkillArtifactReturn {
|
|
55
|
+
const stigmer = useStigmer();
|
|
56
|
+
const [files, setFiles] = useState<SkillFileEntry[] | null>(null);
|
|
57
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
58
|
+
const [error, setError] = useState<Error | null>(null);
|
|
59
|
+
const contentMapRef = useRef<Map<string, string>>(new Map());
|
|
60
|
+
const fetchIdRef = useRef(0);
|
|
61
|
+
|
|
62
|
+
const doFetch = useCallback(async () => {
|
|
63
|
+
if (!artifactStorageKey) {
|
|
64
|
+
setFiles(null);
|
|
65
|
+
setError(null);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const fetchId = ++fetchIdRef.current;
|
|
70
|
+
setIsLoading(true);
|
|
71
|
+
setError(null);
|
|
72
|
+
|
|
73
|
+
try {
|
|
74
|
+
const result = await fetchAndUnpackArtifact(stigmer, artifactStorageKey);
|
|
75
|
+
|
|
76
|
+
if (fetchIdRef.current !== fetchId) return;
|
|
77
|
+
|
|
78
|
+
contentMapRef.current = new Map(result.contentMap);
|
|
79
|
+
setFiles(result.files);
|
|
80
|
+
} catch (err) {
|
|
81
|
+
if (fetchIdRef.current !== fetchId) return;
|
|
82
|
+
setError(toError(err));
|
|
83
|
+
setFiles(null);
|
|
84
|
+
} finally {
|
|
85
|
+
if (fetchIdRef.current === fetchId) {
|
|
86
|
+
setIsLoading(false);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}, [artifactStorageKey, stigmer]);
|
|
90
|
+
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
doFetch();
|
|
93
|
+
}, [doFetch]);
|
|
94
|
+
|
|
95
|
+
const getFileContent = useCallback((path: string): string | null => {
|
|
96
|
+
return contentMapRef.current.get(path) ?? null;
|
|
97
|
+
}, []);
|
|
98
|
+
|
|
99
|
+
const refetch = useCallback(() => {
|
|
100
|
+
doFetch();
|
|
101
|
+
}, [doFetch]);
|
|
102
|
+
|
|
103
|
+
return useMemo(
|
|
104
|
+
() => ({ files, isLoading, error, getFileContent, refetch }),
|
|
105
|
+
[files, isLoading, error, getFileContent, refetch],
|
|
106
|
+
);
|
|
107
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { useStigmer } from "../hooks";
|
|
5
|
+
import { toError } from "../internal/toError";
|
|
6
|
+
import { fetchAndUnpackArtifact } from "./internal/fetchAndUnpackArtifact";
|
|
7
|
+
import { computeMultiFileDiff } from "../version-history/computeMultiFileDiff";
|
|
8
|
+
import type { MultiFileDiffResult } from "../version-history/types";
|
|
9
|
+
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
// Public types
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
|
|
14
|
+
/** Return value of {@link useSkillDiff}. */
|
|
15
|
+
export interface UseSkillDiffReturn {
|
|
16
|
+
/** Multi-file diff result, or `null` while loading / on error / when disabled. */
|
|
17
|
+
readonly diff: MultiFileDiffResult | null;
|
|
18
|
+
/** `true` while both artifacts are being fetched, unpacked, and diffed. */
|
|
19
|
+
readonly isLoading: boolean;
|
|
20
|
+
/** Error from the fetch/unpack/diff, or `null` when healthy. */
|
|
21
|
+
readonly error: Error | null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Maximum artifact size (10 MB) to prevent excessive memory usage. */
|
|
25
|
+
const MAX_ARTIFACT_BYTES = 10 * 1024 * 1024;
|
|
26
|
+
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
// Hook implementation
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Data hook that fetches two skill version artifacts and computes a
|
|
33
|
+
* multi-file diff between them.
|
|
34
|
+
*
|
|
35
|
+
* Takes two artifact storage keys (obtained from `useSkillVersions.getArtifactKey()`).
|
|
36
|
+
* Fetches both ZIPs in parallel, unpacks them, and runs `computeMultiFileDiff`
|
|
37
|
+
* on the extracted text file maps.
|
|
38
|
+
*
|
|
39
|
+
* Pass `null` for either key to disable fetching (stable no-op).
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* const { getArtifactKey } = useSkillVersions(org, slug);
|
|
44
|
+
* const { diff, isLoading } = useSkillDiff(
|
|
45
|
+
* getArtifactKey(fromHash),
|
|
46
|
+
* getArtifactKey(toHash),
|
|
47
|
+
* );
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export function useSkillDiff(
|
|
51
|
+
fromArtifactKey: string | null,
|
|
52
|
+
toArtifactKey: string | null,
|
|
53
|
+
): UseSkillDiffReturn {
|
|
54
|
+
const stigmer = useStigmer();
|
|
55
|
+
const [diff, setDiff] = useState<MultiFileDiffResult | null>(null);
|
|
56
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
57
|
+
const [error, setError] = useState<Error | null>(null);
|
|
58
|
+
const fetchIdRef = useRef(0);
|
|
59
|
+
|
|
60
|
+
const doFetch = useCallback(async () => {
|
|
61
|
+
if (!fromArtifactKey || !toArtifactKey) {
|
|
62
|
+
setDiff(null);
|
|
63
|
+
setError(null);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const fetchId = ++fetchIdRef.current;
|
|
68
|
+
setIsLoading(true);
|
|
69
|
+
setError(null);
|
|
70
|
+
|
|
71
|
+
try {
|
|
72
|
+
const [fromResult, toResult] = await Promise.all([
|
|
73
|
+
fetchAndUnpackArtifact(stigmer, fromArtifactKey),
|
|
74
|
+
fetchAndUnpackArtifact(stigmer, toArtifactKey),
|
|
75
|
+
]);
|
|
76
|
+
|
|
77
|
+
if (fetchIdRef.current !== fetchId) return;
|
|
78
|
+
|
|
79
|
+
const totalBytes = estimateMapSize(fromResult.contentMap) + estimateMapSize(toResult.contentMap);
|
|
80
|
+
if (totalBytes > MAX_ARTIFACT_BYTES) {
|
|
81
|
+
throw new Error(
|
|
82
|
+
`Combined artifact size (${formatBytes(totalBytes)}) exceeds the ${formatBytes(MAX_ARTIFACT_BYTES)} limit. ` +
|
|
83
|
+
"Try comparing smaller skill packages.",
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const result = computeMultiFileDiff(fromResult.contentMap, toResult.contentMap);
|
|
88
|
+
|
|
89
|
+
if (fetchIdRef.current !== fetchId) return;
|
|
90
|
+
setDiff(result);
|
|
91
|
+
} catch (err) {
|
|
92
|
+
if (fetchIdRef.current !== fetchId) return;
|
|
93
|
+
setError(toError(err));
|
|
94
|
+
setDiff(null);
|
|
95
|
+
} finally {
|
|
96
|
+
if (fetchIdRef.current === fetchId) {
|
|
97
|
+
setIsLoading(false);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}, [fromArtifactKey, toArtifactKey, stigmer]);
|
|
101
|
+
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
doFetch();
|
|
104
|
+
}, [doFetch]);
|
|
105
|
+
|
|
106
|
+
return useMemo(
|
|
107
|
+
() => ({ diff, isLoading, error }),
|
|
108
|
+
[diff, isLoading, error],
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// ---------------------------------------------------------------------------
|
|
113
|
+
// Utilities
|
|
114
|
+
// ---------------------------------------------------------------------------
|
|
115
|
+
|
|
116
|
+
function estimateMapSize(map: ReadonlyMap<string, string>): number {
|
|
117
|
+
let total = 0;
|
|
118
|
+
for (const value of map.values()) {
|
|
119
|
+
total += value.length * 2;
|
|
120
|
+
}
|
|
121
|
+
return total;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function formatBytes(bytes: number): string {
|
|
125
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
126
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
127
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
128
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useRef, useState } from "react";
|
|
4
|
+
import { useStigmer } from "../hooks";
|
|
5
|
+
import { computeArtifactHash } from "./internal/computeArtifactHash";
|
|
6
|
+
|
|
7
|
+
/** Return value of {@link useSkillDuplicateCheck}. */
|
|
8
|
+
export interface UseSkillDuplicateCheckReturn {
|
|
9
|
+
/** Whether the uploaded artifact is identical to the current version. */
|
|
10
|
+
readonly isDuplicate: boolean;
|
|
11
|
+
/** `true` while the check is in progress. */
|
|
12
|
+
readonly isChecking: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Run the duplicate check for the given artifact.
|
|
15
|
+
*
|
|
16
|
+
* Computes a client-side SHA-256 hash of `artifactBytes`, fetches
|
|
17
|
+
* the existing skill by `(org, slug)`, and compares against
|
|
18
|
+
* `status.versionHash`. If they match, sets `isDuplicate` to `true`.
|
|
19
|
+
*
|
|
20
|
+
* Returns `true` if the content is a duplicate.
|
|
21
|
+
*/
|
|
22
|
+
readonly check: (params: {
|
|
23
|
+
org: string;
|
|
24
|
+
slug: string;
|
|
25
|
+
artifactBytes: Uint8Array;
|
|
26
|
+
}) => Promise<boolean>;
|
|
27
|
+
/** Reset the check state. */
|
|
28
|
+
readonly reset: () => void;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Behavior hook that checks whether a skill package's content is
|
|
33
|
+
* identical to the currently deployed version.
|
|
34
|
+
*
|
|
35
|
+
* Uses Web Crypto SHA-256 on the client side and compares against
|
|
36
|
+
* `SkillStatus.versionHash` from a `getByReference` RPC call.
|
|
37
|
+
* If the skill doesn't exist yet (NOT_FOUND), the check passes
|
|
38
|
+
* (not a duplicate).
|
|
39
|
+
*/
|
|
40
|
+
export function useSkillDuplicateCheck(): UseSkillDuplicateCheckReturn {
|
|
41
|
+
const stigmer = useStigmer();
|
|
42
|
+
const [isDuplicate, setIsDuplicate] = useState(false);
|
|
43
|
+
const [isChecking, setIsChecking] = useState(false);
|
|
44
|
+
const callIdRef = useRef(0);
|
|
45
|
+
|
|
46
|
+
const reset = useCallback(() => {
|
|
47
|
+
callIdRef.current++;
|
|
48
|
+
setIsDuplicate(false);
|
|
49
|
+
setIsChecking(false);
|
|
50
|
+
}, []);
|
|
51
|
+
|
|
52
|
+
const check = useCallback(
|
|
53
|
+
async (params: {
|
|
54
|
+
org: string;
|
|
55
|
+
slug: string;
|
|
56
|
+
artifactBytes: Uint8Array;
|
|
57
|
+
}): Promise<boolean> => {
|
|
58
|
+
const callId = ++callIdRef.current;
|
|
59
|
+
setIsChecking(true);
|
|
60
|
+
setIsDuplicate(false);
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
const [clientHash, existingSkill] = await Promise.all([
|
|
64
|
+
computeArtifactHash(params.artifactBytes),
|
|
65
|
+
stigmer.skill
|
|
66
|
+
.getByReference({ org: params.org, slug: params.slug })
|
|
67
|
+
.catch(() => null),
|
|
68
|
+
]);
|
|
69
|
+
|
|
70
|
+
if (callIdRef.current !== callId) return false;
|
|
71
|
+
|
|
72
|
+
if (!existingSkill) {
|
|
73
|
+
setIsDuplicate(false);
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const serverHash = existingSkill.status?.versionHash ?? "";
|
|
78
|
+
const match = serverHash !== "" && serverHash === clientHash;
|
|
79
|
+
setIsDuplicate(match);
|
|
80
|
+
return match;
|
|
81
|
+
} catch {
|
|
82
|
+
if (callIdRef.current === callId) setIsDuplicate(false);
|
|
83
|
+
return false;
|
|
84
|
+
} finally {
|
|
85
|
+
if (callIdRef.current === callId) setIsChecking(false);
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
[stigmer],
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
return { isDuplicate, isChecking, check, reset };
|
|
92
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useRef, useState } from "react";
|
|
4
|
+
import { parse as parseYaml } from "yaml";
|
|
5
|
+
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// Public types
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
|
|
10
|
+
/** A single file entry within a skill ZIP package. */
|
|
11
|
+
export interface SkillFileEntry {
|
|
12
|
+
/** Relative path within the ZIP (e.g. "SKILL.md", "scripts/validate.py"). */
|
|
13
|
+
readonly path: string;
|
|
14
|
+
/** Uncompressed file size in bytes. */
|
|
15
|
+
readonly size: number;
|
|
16
|
+
/** Whether this entry represents a directory. */
|
|
17
|
+
readonly isDirectory: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Preview metadata extracted from a validated skill package. */
|
|
21
|
+
export interface SkillUploadPreview {
|
|
22
|
+
/** Skill name extracted from SKILL.md YAML frontmatter. */
|
|
23
|
+
readonly name: string;
|
|
24
|
+
/** Skill description extracted from SKILL.md YAML frontmatter. */
|
|
25
|
+
readonly description: string;
|
|
26
|
+
/** All files contained in the ZIP package. */
|
|
27
|
+
readonly files: SkillFileEntry[];
|
|
28
|
+
/** Raw SKILL.md content (frontmatter + body). */
|
|
29
|
+
readonly skillMdContent: string;
|
|
30
|
+
/** Total uncompressed size of all files in bytes. */
|
|
31
|
+
readonly totalSize: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Return value of {@link useSkillUpload}. */
|
|
35
|
+
export interface UseSkillUploadReturn {
|
|
36
|
+
/** Validated preview of the uploaded package, or `null` before upload. */
|
|
37
|
+
readonly preview: SkillUploadPreview | null;
|
|
38
|
+
/** Validation error message, or `null` if valid/not yet uploaded. */
|
|
39
|
+
readonly validationError: string | null;
|
|
40
|
+
/** `true` while the file is being read and validated. */
|
|
41
|
+
readonly isProcessing: boolean;
|
|
42
|
+
/** Process a file selected by the user (triggers validation). */
|
|
43
|
+
readonly processFile: (file: File) => Promise<void>;
|
|
44
|
+
/** Reset to initial state (clear preview and errors). */
|
|
45
|
+
readonly reset: () => void;
|
|
46
|
+
/** Raw ZIP bytes ready for push, or `null` before successful validation. */
|
|
47
|
+
readonly artifact: Uint8Array | null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
// Constants
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
|
|
54
|
+
const ZIP_MAGIC_BYTES = [0x50, 0x4b, 0x03, 0x04];
|
|
55
|
+
const NAME_MAX_LENGTH = 64;
|
|
56
|
+
const NAME_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
|
|
57
|
+
const FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---/;
|
|
58
|
+
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
// Hook implementation
|
|
61
|
+
// ---------------------------------------------------------------------------
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Behavior hook for the skill upload workflow.
|
|
65
|
+
*
|
|
66
|
+
* Handles file reading, ZIP unpacking, structure validation, and
|
|
67
|
+
* metadata extraction. Produces a {@link SkillUploadPreview} that
|
|
68
|
+
* the UI can render, and exposes the raw artifact bytes for pushing.
|
|
69
|
+
*
|
|
70
|
+
* Validation rules (Anthropic Agent Skills spec):
|
|
71
|
+
* - File must be a valid ZIP archive (checked via magic bytes)
|
|
72
|
+
* - ZIP must contain `SKILL.md` at the root level
|
|
73
|
+
* - SKILL.md must have YAML frontmatter with a valid `name` field
|
|
74
|
+
* - Name must be lowercase letters/numbers/hyphens, max 64 chars
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```tsx
|
|
78
|
+
* const upload = useSkillUpload();
|
|
79
|
+
*
|
|
80
|
+
* const handleDrop = (file: File) => upload.processFile(file);
|
|
81
|
+
*
|
|
82
|
+
* if (upload.preview) {
|
|
83
|
+
* // Show preview UI
|
|
84
|
+
* console.log(upload.preview.name, upload.preview.files);
|
|
85
|
+
* }
|
|
86
|
+
*
|
|
87
|
+
* if (upload.artifact) {
|
|
88
|
+
* // Ready to push
|
|
89
|
+
* await push({ org: "acme", artifact: upload.artifact });
|
|
90
|
+
* }
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export function useSkillUpload(): UseSkillUploadReturn {
|
|
94
|
+
const [preview, setPreview] = useState<SkillUploadPreview | null>(null);
|
|
95
|
+
const [validationError, setValidationError] = useState<string | null>(null);
|
|
96
|
+
const [isProcessing, setIsProcessing] = useState(false);
|
|
97
|
+
const [artifact, setArtifact] = useState<Uint8Array | null>(null);
|
|
98
|
+
|
|
99
|
+
const abortRef = useRef(0);
|
|
100
|
+
|
|
101
|
+
const reset = useCallback(() => {
|
|
102
|
+
abortRef.current++;
|
|
103
|
+
setPreview(null);
|
|
104
|
+
setValidationError(null);
|
|
105
|
+
setIsProcessing(false);
|
|
106
|
+
setArtifact(null);
|
|
107
|
+
}, []);
|
|
108
|
+
|
|
109
|
+
const processFile = useCallback(async (file: File) => {
|
|
110
|
+
const callId = ++abortRef.current;
|
|
111
|
+
setIsProcessing(true);
|
|
112
|
+
setValidationError(null);
|
|
113
|
+
setPreview(null);
|
|
114
|
+
setArtifact(null);
|
|
115
|
+
|
|
116
|
+
try {
|
|
117
|
+
const bytes = new Uint8Array(await file.arrayBuffer());
|
|
118
|
+
|
|
119
|
+
if (abortRef.current !== callId) return;
|
|
120
|
+
|
|
121
|
+
if (!isZip(bytes)) {
|
|
122
|
+
setValidationError("File is not a valid ZIP archive");
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const { unzipSync, strFromU8 } = await import("fflate");
|
|
127
|
+
const unzipped = unzipSync(bytes);
|
|
128
|
+
|
|
129
|
+
if (abortRef.current !== callId) return;
|
|
130
|
+
|
|
131
|
+
const entries = Object.entries(unzipped);
|
|
132
|
+
const skillMdEntry = findSkillMd(entries);
|
|
133
|
+
|
|
134
|
+
if (!skillMdEntry) {
|
|
135
|
+
setValidationError("ZIP must contain a SKILL.md file at the root level");
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const skillMdContent = strFromU8(skillMdEntry[1]);
|
|
140
|
+
const frontmatter = parseFrontmatter(skillMdContent);
|
|
141
|
+
|
|
142
|
+
if (!frontmatter) {
|
|
143
|
+
setValidationError("SKILL.md must have valid YAML frontmatter (---\\n...\\n---)");
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (!frontmatter.name || typeof frontmatter.name !== "string") {
|
|
148
|
+
setValidationError("SKILL.md frontmatter must include a 'name' field");
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const name = frontmatter.name;
|
|
153
|
+
if (name.length > NAME_MAX_LENGTH) {
|
|
154
|
+
setValidationError(`Skill name must be ${NAME_MAX_LENGTH} characters or fewer`);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (!NAME_PATTERN.test(name)) {
|
|
159
|
+
setValidationError(
|
|
160
|
+
"Skill name must contain only lowercase letters, numbers, and hyphens, starting with a letter or number",
|
|
161
|
+
);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const files: SkillFileEntry[] = entries.map(([path, data]) => ({
|
|
166
|
+
path,
|
|
167
|
+
size: data.length,
|
|
168
|
+
isDirectory: data.length === 0 && path.endsWith("/"),
|
|
169
|
+
}));
|
|
170
|
+
|
|
171
|
+
const totalSize = files.reduce((sum, f) => sum + f.size, 0);
|
|
172
|
+
const description =
|
|
173
|
+
typeof frontmatter.description === "string"
|
|
174
|
+
? frontmatter.description
|
|
175
|
+
: "";
|
|
176
|
+
|
|
177
|
+
if (abortRef.current !== callId) return;
|
|
178
|
+
|
|
179
|
+
setPreview({ name, description, files, skillMdContent, totalSize });
|
|
180
|
+
setArtifact(bytes);
|
|
181
|
+
} catch (err) {
|
|
182
|
+
if (abortRef.current !== callId) return;
|
|
183
|
+
const message =
|
|
184
|
+
err instanceof Error ? err.message : "Failed to process file";
|
|
185
|
+
setValidationError(`Invalid ZIP archive: ${message}`);
|
|
186
|
+
} finally {
|
|
187
|
+
if (abortRef.current === callId) {
|
|
188
|
+
setIsProcessing(false);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}, []);
|
|
192
|
+
|
|
193
|
+
return { preview, validationError, isProcessing, processFile, reset, artifact };
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// ---------------------------------------------------------------------------
|
|
197
|
+
// Internal utilities
|
|
198
|
+
// ---------------------------------------------------------------------------
|
|
199
|
+
|
|
200
|
+
function isZip(bytes: Uint8Array): boolean {
|
|
201
|
+
if (bytes.length < 4) return false;
|
|
202
|
+
return (
|
|
203
|
+
bytes[0] === ZIP_MAGIC_BYTES[0] &&
|
|
204
|
+
bytes[1] === ZIP_MAGIC_BYTES[1] &&
|
|
205
|
+
bytes[2] === ZIP_MAGIC_BYTES[2] &&
|
|
206
|
+
bytes[3] === ZIP_MAGIC_BYTES[3]
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function findSkillMd(
|
|
211
|
+
entries: [string, Uint8Array][],
|
|
212
|
+
): [string, Uint8Array] | undefined {
|
|
213
|
+
return entries.find(
|
|
214
|
+
([path]) => path === "SKILL.md" || path.match(/^[^/]+\/SKILL\.md$/),
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function parseFrontmatter(content: string): Record<string, unknown> | null {
|
|
219
|
+
const match = content.match(FRONTMATTER_RE);
|
|
220
|
+
if (!match) return null;
|
|
221
|
+
|
|
222
|
+
try {
|
|
223
|
+
const parsed = parseYaml(match[1]);
|
|
224
|
+
if (typeof parsed === "object" && parsed !== null) {
|
|
225
|
+
return parsed as Record<string, unknown>;
|
|
226
|
+
}
|
|
227
|
+
return null;
|
|
228
|
+
} catch {
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
}
|