@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,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { useStigmer } from "../hooks";
|
|
4
|
+
import { toError } from "../internal/toError";
|
|
5
|
+
/**
|
|
6
|
+
* Mutation hook that updates an existing Agent resource.
|
|
7
|
+
*
|
|
8
|
+
* Wraps `stigmer.agent.update(input)` with loading and error state.
|
|
9
|
+
* The caller must provide a **complete** `AgentInput` — the backend
|
|
10
|
+
* performs full spec replacement. Use `agentToInput()` to reconstruct
|
|
11
|
+
* the input from a fetched agent, modify the desired field, and pass
|
|
12
|
+
* the result here.
|
|
13
|
+
*/
|
|
14
|
+
export function useUpdateAgent() {
|
|
15
|
+
const stigmer = useStigmer();
|
|
16
|
+
const [isUpdating, setIsUpdating] = useState(false);
|
|
17
|
+
const [error, setError] = useState(null);
|
|
18
|
+
const clearError = useCallback(() => setError(null), []);
|
|
19
|
+
const update = useCallback(async (input) => {
|
|
20
|
+
setIsUpdating(true);
|
|
21
|
+
setError(null);
|
|
22
|
+
try {
|
|
23
|
+
return await stigmer.agent.update(input);
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
setError(toError(err));
|
|
27
|
+
throw err;
|
|
28
|
+
}
|
|
29
|
+
finally {
|
|
30
|
+
setIsUpdating(false);
|
|
31
|
+
}
|
|
32
|
+
}, [stigmer]);
|
|
33
|
+
return { update, isUpdating, error, clearError };
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=useUpdateAgent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUpdateAgent.js","sourceRoot":"","sources":["../../src/agent/useUpdateAgent.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAc9C;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IAEvD,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAEzD,MAAM,MAAM,GAAG,WAAW,CACxB,KAAK,EAAE,KAAiB,EAAkB,EAAE;QAC1C,aAAa,CAAC,IAAI,CAAC,CAAC;QACpB,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEf,IAAI,CAAC;YACH,OAAO,MAAM,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;YACvB,MAAM,GAAG,CAAC;QACZ,CAAC;gBAAS,CAAC;YACT,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { DependencyGraphProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Accessible CSS-based tree visualization of an agent's dependencies.
|
|
4
|
+
*
|
|
5
|
+
* Renders `MCP Servers`, `Skills`, and `Sub-Agents` (with recursive
|
|
6
|
+
* sub-agent children) as a nested tree with visual connector lines.
|
|
7
|
+
* The root node represents the agent itself.
|
|
8
|
+
*
|
|
9
|
+
* Implements the WAI-ARIA TreeView pattern:
|
|
10
|
+
* - `role="tree"` on the root list
|
|
11
|
+
* - `role="treeitem"` on each node (via {@link DependencyTreeNode})
|
|
12
|
+
* - Arrow-key navigation between visible nodes (roving tabindex)
|
|
13
|
+
* - `Home`/`End` to jump to first/last visible node
|
|
14
|
+
*
|
|
15
|
+
* All visual properties flow through `--stgm-*` design tokens.
|
|
16
|
+
* Zero Console dependencies — safe for platform builder embedding.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* const { tree } = useDependencyGraph({
|
|
21
|
+
* agentName: "pr-review-agent",
|
|
22
|
+
* agentOrg: "acme",
|
|
23
|
+
* spec: agent.spec,
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* {tree && (
|
|
27
|
+
* <DependencyGraph
|
|
28
|
+
* tree={tree}
|
|
29
|
+
* onNodeClick={(node) => {
|
|
30
|
+
* if (node.kind === "mcp-server") navigateTo(`/mcp-servers/${node.ref!.slug}`);
|
|
31
|
+
* }}
|
|
32
|
+
* />
|
|
33
|
+
* )}
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function DependencyGraph({ tree, onNodeClick, defaultExpanded, className, }: DependencyGraphProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
//# sourceMappingURL=DependencyGraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DependencyGraph.d.ts","sourceRoot":"","sources":["../../src/dependency-graph/DependencyGraph.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAGpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,WAAW,EACX,eAAsB,EACtB,SAAS,GACV,EAAE,oBAAoB,2CAiFtB"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useRef } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { DependencyTreeNode } from "./DependencyTreeNode";
|
|
6
|
+
/**
|
|
7
|
+
* Accessible CSS-based tree visualization of an agent's dependencies.
|
|
8
|
+
*
|
|
9
|
+
* Renders `MCP Servers`, `Skills`, and `Sub-Agents` (with recursive
|
|
10
|
+
* sub-agent children) as a nested tree with visual connector lines.
|
|
11
|
+
* The root node represents the agent itself.
|
|
12
|
+
*
|
|
13
|
+
* Implements the WAI-ARIA TreeView pattern:
|
|
14
|
+
* - `role="tree"` on the root list
|
|
15
|
+
* - `role="treeitem"` on each node (via {@link DependencyTreeNode})
|
|
16
|
+
* - Arrow-key navigation between visible nodes (roving tabindex)
|
|
17
|
+
* - `Home`/`End` to jump to first/last visible node
|
|
18
|
+
*
|
|
19
|
+
* All visual properties flow through `--stgm-*` design tokens.
|
|
20
|
+
* Zero Console dependencies — safe for platform builder embedding.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* const { tree } = useDependencyGraph({
|
|
25
|
+
* agentName: "pr-review-agent",
|
|
26
|
+
* agentOrg: "acme",
|
|
27
|
+
* spec: agent.spec,
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* {tree && (
|
|
31
|
+
* <DependencyGraph
|
|
32
|
+
* tree={tree}
|
|
33
|
+
* onNodeClick={(node) => {
|
|
34
|
+
* if (node.kind === "mcp-server") navigateTo(`/mcp-servers/${node.ref!.slug}`);
|
|
35
|
+
* }}
|
|
36
|
+
* />
|
|
37
|
+
* )}
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export function DependencyGraph({ tree, onNodeClick, defaultExpanded = true, className, }) {
|
|
41
|
+
const treeRef = useRef(null);
|
|
42
|
+
const handleKeyDown = useCallback((e) => {
|
|
43
|
+
const container = treeRef.current;
|
|
44
|
+
if (!container)
|
|
45
|
+
return;
|
|
46
|
+
const items = Array.from(container.querySelectorAll("[role='treeitem'] > button, [role='treeitem'] > div")).filter((el) => {
|
|
47
|
+
let parent = el.closest("[role='treeitem']")?.parentElement?.closest("[role='treeitem']");
|
|
48
|
+
while (parent) {
|
|
49
|
+
if (parent.getAttribute("aria-expanded") === "false")
|
|
50
|
+
return false;
|
|
51
|
+
parent = parent.parentElement?.closest("[role='treeitem']");
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
54
|
+
});
|
|
55
|
+
if (items.length === 0)
|
|
56
|
+
return;
|
|
57
|
+
const activeEl = document.activeElement;
|
|
58
|
+
const currentIndex = activeEl ? items.indexOf(activeEl) : -1;
|
|
59
|
+
let nextIndex = null;
|
|
60
|
+
switch (e.key) {
|
|
61
|
+
case "ArrowDown":
|
|
62
|
+
nextIndex = currentIndex < items.length - 1 ? currentIndex + 1 : 0;
|
|
63
|
+
break;
|
|
64
|
+
case "ArrowUp":
|
|
65
|
+
nextIndex = currentIndex > 0 ? currentIndex - 1 : items.length - 1;
|
|
66
|
+
break;
|
|
67
|
+
case "Home":
|
|
68
|
+
nextIndex = 0;
|
|
69
|
+
break;
|
|
70
|
+
case "End":
|
|
71
|
+
nextIndex = items.length - 1;
|
|
72
|
+
break;
|
|
73
|
+
default:
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
items[nextIndex].focus();
|
|
78
|
+
}, []);
|
|
79
|
+
const { root } = tree;
|
|
80
|
+
return (_jsxs("div", { className: cn("py-2", className), children: [_jsxs("div", { className: "mb-3 flex items-center gap-2 px-2", children: [_jsx(TreeIcon, { className: "size-4 text-muted-foreground" }), _jsx("h3", { className: "text-xs font-medium uppercase tracking-wider text-muted-foreground", children: "Dependency Tree" }), _jsxs("span", { className: "text-xs text-muted-foreground", children: [tree.nodeCount, " ", tree.nodeCount === 1 ? "node" : "nodes"] })] }), _jsx("ul", { ref: treeRef, role: "tree", "aria-label": `Dependencies of ${root.label}`, onKeyDown: handleKeyDown, className: "rounded-lg border border-border p-2", children: _jsx(DependencyTreeNode, { node: root, depth: 0, onNodeClick: onNodeClick, defaultExpanded: defaultExpanded }) })] }));
|
|
81
|
+
}
|
|
82
|
+
// ---------------------------------------------------------------------------
|
|
83
|
+
// Header icon
|
|
84
|
+
// ---------------------------------------------------------------------------
|
|
85
|
+
function TreeIcon({ className }) {
|
|
86
|
+
return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "M8 2v4M8 6 4 10M8 6l4 4" }), _jsx("circle", { cx: "8", cy: "2", r: "1", fill: "currentColor", stroke: "none" }), _jsx("circle", { cx: "4", cy: "11", r: "1.5" }), _jsx("circle", { cx: "8", cy: "11", r: "1.5" }), _jsx("circle", { cx: "12", cy: "11", r: "1.5" })] }));
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=DependencyGraph.js.map
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,IACpD,IACH,EAEN,aACE,GAAG,EAAE,OAAO,EACZ,IAAI,EAAC,MAAM,gBACC,mBAAmB,IAAI,CAAC,KAAK,EAAE,EAC3C,SAAS,EAAE,aAAa,EACxB,SAAS,EAAC,qCAAqC,YAE/C,KAAC,kBAAkB,IACjB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,EACR,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,eAAe,GAChC,GACC,IACD,CACP,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,cAAc;AACd,8EAA8E;AAE9E,SAAS,QAAQ,CAAC,EAAE,SAAS,EAAmC;IAC9D,OAAO,CACL,eACE,SAAS,EAAE,SAAS,EACpB,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,aAElB,eAAM,CAAC,EAAC,yBAAyB,GAAG,EACpC,iBAAQ,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,IAAI,EAAC,cAAc,EAAC,MAAM,EAAC,MAAM,GAAG,EAChE,iBAAQ,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,KAAK,GAAG,EACjC,iBAAQ,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,KAAK,GAAG,EACjC,iBAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,KAAK,GAAG,IAC9B,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { DependencyNode } from "./types";
|
|
2
|
+
interface DependencyTreeNodeProps {
|
|
3
|
+
readonly node: DependencyNode;
|
|
4
|
+
readonly depth: number;
|
|
5
|
+
readonly onNodeClick?: (node: DependencyNode) => void;
|
|
6
|
+
readonly defaultExpanded: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Renders a single node in the dependency tree: icon, kind badge,
|
|
10
|
+
* label, metadata, and (for expandable nodes) an expand/collapse
|
|
11
|
+
* chevron with nested children.
|
|
12
|
+
*
|
|
13
|
+
* Leaf nodes (MCP servers, skills) with a `ref` are clickable —
|
|
14
|
+
* firing `onNodeClick` for consumer-wired navigation.
|
|
15
|
+
*
|
|
16
|
+
* Sub-agent nodes are collapsible containers, and the root agent
|
|
17
|
+
* node always renders its children expanded. Both recurse using
|
|
18
|
+
* the same component, keeping the ARIA tree structure correct
|
|
19
|
+
* (`<li role="treeitem">` wrapping a nested `<ul role="group">`).
|
|
20
|
+
*/
|
|
21
|
+
export declare function DependencyTreeNode({ node, depth, onNodeClick, defaultExpanded, }: DependencyTreeNodeProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=DependencyTreeNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DependencyTreeNode.d.ts","sourceRoot":"","sources":["../../src/dependency-graph/DependencyTreeNode.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAY,MAAM,SAAS,CAAC;AAExD,UAAU,uBAAuB;IAC/B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IACtD,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;CACnC;AASD;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,KAAK,EACL,WAAW,EACX,eAAe,GAChB,EAAE,uBAAuB,2CAmIzB"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
const KIND_LABELS = {
|
|
6
|
+
agent: "Agent",
|
|
7
|
+
"mcp-server": "MCP",
|
|
8
|
+
skill: "Skill",
|
|
9
|
+
"sub-agent": "Sub-Agent",
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Renders a single node in the dependency tree: icon, kind badge,
|
|
13
|
+
* label, metadata, and (for expandable nodes) an expand/collapse
|
|
14
|
+
* chevron with nested children.
|
|
15
|
+
*
|
|
16
|
+
* Leaf nodes (MCP servers, skills) with a `ref` are clickable —
|
|
17
|
+
* firing `onNodeClick` for consumer-wired navigation.
|
|
18
|
+
*
|
|
19
|
+
* Sub-agent nodes are collapsible containers, and the root agent
|
|
20
|
+
* node always renders its children expanded. Both recurse using
|
|
21
|
+
* the same component, keeping the ARIA tree structure correct
|
|
22
|
+
* (`<li role="treeitem">` wrapping a nested `<ul role="group">`).
|
|
23
|
+
*/
|
|
24
|
+
export function DependencyTreeNode({ node, depth, onNodeClick, defaultExpanded, }) {
|
|
25
|
+
const hasChildren = node.children.length > 0;
|
|
26
|
+
const isRoot = node.kind === "agent";
|
|
27
|
+
const isCollapsible = node.kind === "sub-agent" && hasChildren;
|
|
28
|
+
const isAlwaysExpanded = isRoot && hasChildren;
|
|
29
|
+
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
30
|
+
const isNavigable = node.ref != null && onNodeClick != null;
|
|
31
|
+
const showChildren = isAlwaysExpanded || (isCollapsible && expanded);
|
|
32
|
+
const handleClick = useCallback(() => {
|
|
33
|
+
if (isCollapsible) {
|
|
34
|
+
setExpanded((v) => !v);
|
|
35
|
+
}
|
|
36
|
+
else if (isNavigable) {
|
|
37
|
+
onNodeClick(node);
|
|
38
|
+
}
|
|
39
|
+
}, [isCollapsible, isNavigable, onNodeClick, node]);
|
|
40
|
+
const handleKeyDown = useCallback((e) => {
|
|
41
|
+
if (!isCollapsible)
|
|
42
|
+
return;
|
|
43
|
+
if (e.key === "ArrowRight" && !expanded) {
|
|
44
|
+
e.preventDefault();
|
|
45
|
+
setExpanded(true);
|
|
46
|
+
}
|
|
47
|
+
else if (e.key === "ArrowLeft" && expanded) {
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
setExpanded(false);
|
|
50
|
+
}
|
|
51
|
+
}, [isCollapsible, expanded]);
|
|
52
|
+
const content = (_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [isCollapsible && (_jsx(ChevronIcon, { className: cn("size-3.5 shrink-0 text-muted-foreground transition-transform", expanded && "rotate-90") })), _jsx(NodeIcon, { kind: node.kind, className: "size-4 shrink-0 text-muted-foreground" }), !isRoot && (_jsx("span", { className: cn("shrink-0 rounded px-1.5 py-px text-[10px] font-medium leading-tight", kindBadgeClasses(node.kind)), children: KIND_LABELS[node.kind] })), _jsx("span", { className: "min-w-0 truncate text-sm font-medium text-foreground", children: node.qualifiedLabel ?? node.label }), node.metadata &&
|
|
53
|
+
Object.entries(node.metadata).map(([key, value]) => (_jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: value }, key)))] }));
|
|
54
|
+
const isInteractive = isCollapsible || isNavigable;
|
|
55
|
+
const isChild = depth > 0;
|
|
56
|
+
return (_jsxs("li", { role: "treeitem", "aria-expanded": isCollapsible ? expanded : isAlwaysExpanded ? true : undefined, className: cn("list-none", isChild && "relative before:absolute before:left-[-12px] before:top-[14px] before:h-px before:w-3 before:bg-border before:content-['']"), children: [isInteractive ? (_jsx("button", { type: "button", onClick: handleClick, onKeyDown: handleKeyDown, tabIndex: -1, className: cn("flex w-full items-center rounded-md px-2 py-1.5 text-left transition-colors", "hover:bg-accent-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring"), children: content })) : (_jsx("div", { className: "flex items-center px-2 py-1.5", children: content })), node.description && !isRoot && (_jsx("p", { className: cn("px-2 pb-1 text-xs text-muted-foreground", isCollapsible ? "ml-[calc(0.5rem+14px+0.5rem)]" : "ml-2"), children: node.description })), showChildren && (_jsx("ul", { role: "group", className: "relative ml-[11px] border-l border-border pl-3", children: node.children.map((child) => (_jsx(DependencyTreeNode, { node: child, depth: depth + 1, onNodeClick: onNodeClick, defaultExpanded: defaultExpanded }, child.id))) }))] }));
|
|
57
|
+
}
|
|
58
|
+
// ---------------------------------------------------------------------------
|
|
59
|
+
// Kind badge styling — uses --stgm-* tokens, no hardcoded colors
|
|
60
|
+
// ---------------------------------------------------------------------------
|
|
61
|
+
function kindBadgeClasses(kind) {
|
|
62
|
+
switch (kind) {
|
|
63
|
+
case "mcp-server":
|
|
64
|
+
return "bg-[var(--stgm-status-running-subtle)] text-[var(--stgm-status-running)]";
|
|
65
|
+
case "skill":
|
|
66
|
+
return "bg-[var(--stgm-status-pending-subtle)] text-[var(--stgm-status-pending)]";
|
|
67
|
+
case "sub-agent":
|
|
68
|
+
return "bg-[var(--stgm-status-ready-subtle)] text-[var(--stgm-status-ready)]";
|
|
69
|
+
case "agent":
|
|
70
|
+
return "bg-muted text-muted-foreground";
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
// Icons — inline SVGs, consistent with AgentDetailView pattern
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
function NodeIcon({ kind, className, }) {
|
|
77
|
+
switch (kind) {
|
|
78
|
+
case "agent":
|
|
79
|
+
case "sub-agent":
|
|
80
|
+
return _jsx(AgentIcon, { className: className });
|
|
81
|
+
case "mcp-server":
|
|
82
|
+
return _jsx(McpServerIcon, { className: className });
|
|
83
|
+
case "skill":
|
|
84
|
+
return _jsx(SkillIcon, { className: className });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function AgentIcon({ className }) {
|
|
88
|
+
return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("rect", { x: "3", y: "5", width: "10", height: "8", rx: "1.5" }), _jsx("path", { d: "M6 9h.01M10 9h.01", strokeWidth: "2" }), _jsx("path", { d: "M8 2v3" })] }));
|
|
89
|
+
}
|
|
90
|
+
function McpServerIcon({ className }) {
|
|
91
|
+
return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("rect", { x: "2", y: "2", width: "12", height: "5", rx: "1" }), _jsx("rect", { x: "2", y: "9", width: "12", height: "5", rx: "1" }), _jsx("circle", { cx: "5", cy: "4.5", r: "0.75", fill: "currentColor", stroke: "none" }), _jsx("circle", { cx: "5", cy: "11.5", r: "0.75", fill: "currentColor", stroke: "none" })] }));
|
|
92
|
+
}
|
|
93
|
+
function SkillIcon({ className }) {
|
|
94
|
+
return (_jsx("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "M9 1.5 4 9h4l-1 5.5L12 7H8l1-5.5Z" }) }));
|
|
95
|
+
}
|
|
96
|
+
function ChevronIcon({ className }) {
|
|
97
|
+
return (_jsx("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "m6 3 5 5-5 5" }) }));
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=DependencyTreeNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DependencyTreeNode.js","sourceRoot":"","sources":["../../src/dependency-graph/DependencyTreeNode.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAsB,MAAM,OAAO,CAAC;AAClE,OA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@
|
|
|
1
|
+
export type { NodeKind, DependencyNode, DependencyTree, DependencyGraphProps, UseDependencyGraphOptions, UseDependencyGraphReturn, } from "./types";
|
|
2
|
+
export { useDependencyGraph } from "./useDependencyGraph";
|
|
3
|
+
export { DependencyGraph } from "./DependencyGraph";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dependency-graph/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dependency-graph/index.ts"],"names":[],"mappings":"AAUA,QAAQ;AACR,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,aAAa;AACb,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resource kind in a dependency tree.
|
|
3
|
+
*
|
|
4
|
+
* - `"agent"` — the root agent (always the tree root)
|
|
5
|
+
* - `"mcp-server"` — an MCP server referenced via `mcpServerUsages` or `mcpAccess`
|
|
6
|
+
* - `"skill"` — a skill referenced via `skillRefs`
|
|
7
|
+
* - `"sub-agent"` — an inline sub-agent definition with its own dependencies
|
|
8
|
+
*/
|
|
9
|
+
export type NodeKind = "agent" | "mcp-server" | "skill" | "sub-agent";
|
|
10
|
+
/**
|
|
11
|
+
* A single node in the agent dependency tree.
|
|
12
|
+
*
|
|
13
|
+
* The tree is recursive: sub-agent nodes contain their own children
|
|
14
|
+
* (MCP servers and skills they access). Edges are implicit in the
|
|
15
|
+
* parent-child relationship — no separate edge type is needed.
|
|
16
|
+
*
|
|
17
|
+
* Nodes are navigable when `ref` is defined (MCP servers, skills).
|
|
18
|
+
* Sub-agent nodes have no `ref` because they are inline definitions
|
|
19
|
+
* within the agent spec, not standalone resources.
|
|
20
|
+
*/
|
|
21
|
+
export interface DependencyNode {
|
|
22
|
+
/**
|
|
23
|
+
* Deterministic identifier. Format: `{kind}:{slug}` for referenced
|
|
24
|
+
* resources, `sub-agent:{name}` for sub-agents, or `agent:{slug}`
|
|
25
|
+
* for the root.
|
|
26
|
+
*/
|
|
27
|
+
readonly id: string;
|
|
28
|
+
/** What kind of resource this node represents. */
|
|
29
|
+
readonly kind: NodeKind;
|
|
30
|
+
/** Primary display label (slug for resources, name for sub-agents). */
|
|
31
|
+
readonly label: string;
|
|
32
|
+
/**
|
|
33
|
+
* Qualified label shown when the resource belongs to a different org
|
|
34
|
+
* than the agent (e.g., `"other-org/shared-server"`). Undefined when
|
|
35
|
+
* the resource is in the same org as the parent agent.
|
|
36
|
+
*/
|
|
37
|
+
readonly qualifiedLabel?: string;
|
|
38
|
+
/** Short description (sub-agent description, if available). */
|
|
39
|
+
readonly description?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Key-value metadata displayed as secondary info.
|
|
42
|
+
* Examples: `{ tools: "3 tools" }`, `{ model: "gpt-4" }`.
|
|
43
|
+
*/
|
|
44
|
+
readonly metadata?: Readonly<Record<string, string>>;
|
|
45
|
+
/** Child nodes. Empty array for leaf nodes (MCP servers, skills). */
|
|
46
|
+
readonly children: readonly DependencyNode[];
|
|
47
|
+
/**
|
|
48
|
+
* Navigation reference for clickable nodes. Defined for MCP servers
|
|
49
|
+
* and skills (standalone resources). Undefined for sub-agents (inline
|
|
50
|
+
* definitions) and the root agent.
|
|
51
|
+
*/
|
|
52
|
+
readonly ref?: {
|
|
53
|
+
readonly org: string;
|
|
54
|
+
readonly slug: string;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Complete dependency tree for an agent, rooted at the agent itself.
|
|
59
|
+
*/
|
|
60
|
+
export interface DependencyTree {
|
|
61
|
+
/** The agent node with all dependencies as descendants. */
|
|
62
|
+
readonly root: DependencyNode;
|
|
63
|
+
/** Total number of nodes in the tree (including root). */
|
|
64
|
+
readonly nodeCount: number;
|
|
65
|
+
}
|
|
66
|
+
/** Props for {@link DependencyGraph}. */
|
|
67
|
+
export interface DependencyGraphProps {
|
|
68
|
+
/** The dependency tree to render. */
|
|
69
|
+
readonly tree: DependencyTree;
|
|
70
|
+
/**
|
|
71
|
+
* Called when a navigable node is clicked. The `node.ref` field
|
|
72
|
+
* contains the `org` and `slug` for routing. Only fired for nodes
|
|
73
|
+
* where `ref` is defined (MCP servers, skills).
|
|
74
|
+
*/
|
|
75
|
+
readonly onNodeClick?: (node: DependencyNode) => void;
|
|
76
|
+
/**
|
|
77
|
+
* Whether sub-agent subtrees start expanded.
|
|
78
|
+
* @default true
|
|
79
|
+
*/
|
|
80
|
+
readonly defaultExpanded?: boolean;
|
|
81
|
+
/** Additional CSS classes for the root container. */
|
|
82
|
+
readonly className?: string;
|
|
83
|
+
}
|
|
84
|
+
/** Options for {@link useDependencyGraph}. */
|
|
85
|
+
export interface UseDependencyGraphOptions {
|
|
86
|
+
/** Display name of the agent (used as the root node label). */
|
|
87
|
+
readonly agentName: string;
|
|
88
|
+
/** Organization slug of the agent (used for cross-org label detection). */
|
|
89
|
+
readonly agentOrg: string;
|
|
90
|
+
/**
|
|
91
|
+
* The agent's spec containing dependency references.
|
|
92
|
+
* Pass `undefined` while the agent is loading — the hook returns
|
|
93
|
+
* `null` for `tree` and `true` for `isEmpty`.
|
|
94
|
+
*/
|
|
95
|
+
readonly spec: {
|
|
96
|
+
readonly mcpServerUsages: readonly {
|
|
97
|
+
readonly mcpServerRef?: {
|
|
98
|
+
readonly org: string;
|
|
99
|
+
readonly slug: string;
|
|
100
|
+
};
|
|
101
|
+
readonly enabledTools: readonly string[];
|
|
102
|
+
readonly toolApprovalOverrides: readonly unknown[];
|
|
103
|
+
}[];
|
|
104
|
+
readonly skillRefs: readonly {
|
|
105
|
+
readonly org: string;
|
|
106
|
+
readonly slug: string;
|
|
107
|
+
}[];
|
|
108
|
+
readonly subAgents: readonly {
|
|
109
|
+
readonly name: string;
|
|
110
|
+
readonly description: string;
|
|
111
|
+
readonly mcpAccess: readonly {
|
|
112
|
+
readonly mcpServer: string;
|
|
113
|
+
readonly enabledTools: readonly string[];
|
|
114
|
+
}[];
|
|
115
|
+
readonly skillRefs: readonly {
|
|
116
|
+
readonly org: string;
|
|
117
|
+
readonly slug: string;
|
|
118
|
+
}[];
|
|
119
|
+
readonly modelOverride: string;
|
|
120
|
+
}[];
|
|
121
|
+
} | undefined;
|
|
122
|
+
}
|
|
123
|
+
/** Return value of {@link useDependencyGraph}. */
|
|
124
|
+
export interface UseDependencyGraphReturn {
|
|
125
|
+
/** The computed tree, or `null` when spec is undefined. */
|
|
126
|
+
readonly tree: DependencyTree | null;
|
|
127
|
+
/** `true` when the agent has zero dependencies (or spec is undefined). */
|
|
128
|
+
readonly isEmpty: boolean;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/dependency-graph/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,YAAY,GAAG,OAAO,GAAG,WAAW,CAAC;AAEtE;;;;;;;;;;GAUG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,uEAAuE;IACvE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,cA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EAAE,MAAM,CAAC;gBACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;aACvB,CAAC;YACF,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;YACzC,QAAQ,CAAC,qBAAqB,EAAE,SAAS,OAAO,EAAE,CAAC;SACpD,EAAE,CAAC;QACJ,QAAQ,CAAC,SAAS,EAAE,SAAS;YAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;YACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;SACvB,EAAE,CAAC;QACJ,QAAQ,CAAC,SAAS,EAAE,SAAS;YAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;YACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;YAC7B,QAAQ,CAAC,SAAS,EAAE,SAAS;gBAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBAC3B,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;aAC1C,EAAE,CAAC;YACJ,QAAQ,CAAC,SAAS,EAAE,SAAS;gBAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;gBACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;aACvB,EAAE,CAAC;YACJ,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;SAChC,EAAE,CAAC;KACL,GAAG,SAAS,CAAC;CACf;AAED,kDAAkD;AAClD,MAAM,WAAW,wBAAwB;IACvC,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;IACrC,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/dependency-graph/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { UseDependencyGraphOptions, UseDependencyGraphReturn } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Pure transformation hook that converts an `AgentSpec` into a
|
|
4
|
+
* {@link DependencyTree} for rendering.
|
|
5
|
+
*
|
|
6
|
+
* No data fetching, no side effects — the tree is computed entirely
|
|
7
|
+
* from the spec fields already available via {@link useAgent}. The
|
|
8
|
+
* result is memoized and only recomputes when the spec reference
|
|
9
|
+
* changes.
|
|
10
|
+
*
|
|
11
|
+
* Returns `null` for `tree` when `spec` is `undefined` (loading state).
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const { tree, isEmpty } = useDependencyGraph({
|
|
16
|
+
* agentName: agent.metadata.name,
|
|
17
|
+
* agentOrg: agent.metadata.org,
|
|
18
|
+
* spec: agent.spec,
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* if (!isEmpty && tree) {
|
|
22
|
+
* return <DependencyGraph tree={tree} onNodeClick={handleClick} />;
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function useDependencyGraph({ agentName, agentOrg, spec, }: UseDependencyGraphOptions): UseDependencyGraphReturn;
|
|
27
|
+
//# sourceMappingURL=useDependencyGraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDependencyGraph.d.ts","sourceRoot":"","sources":["../../src/dependency-graph/useDependencyGraph.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAGV,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,QAAQ,EACR,IAAI,GACL,EAAE,yBAAyB,GAAG,wBAAwB,CAuHtD"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Pure transformation hook that converts an `AgentSpec` into a
|
|
5
|
+
* {@link DependencyTree} for rendering.
|
|
6
|
+
*
|
|
7
|
+
* No data fetching, no side effects — the tree is computed entirely
|
|
8
|
+
* from the spec fields already available via {@link useAgent}. The
|
|
9
|
+
* result is memoized and only recomputes when the spec reference
|
|
10
|
+
* changes.
|
|
11
|
+
*
|
|
12
|
+
* Returns `null` for `tree` when `spec` is `undefined` (loading state).
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const { tree, isEmpty } = useDependencyGraph({
|
|
17
|
+
* agentName: agent.metadata.name,
|
|
18
|
+
* agentOrg: agent.metadata.org,
|
|
19
|
+
* spec: agent.spec,
|
|
20
|
+
* });
|
|
21
|
+
*
|
|
22
|
+
* if (!isEmpty && tree) {
|
|
23
|
+
* return <DependencyGraph tree={tree} onNodeClick={handleClick} />;
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export function useDependencyGraph({ agentName, agentOrg, spec, }) {
|
|
28
|
+
return useMemo(() => {
|
|
29
|
+
if (!spec)
|
|
30
|
+
return { tree: null, isEmpty: true };
|
|
31
|
+
const { mcpServerUsages, skillRefs, subAgents } = spec;
|
|
32
|
+
const hasDeps = mcpServerUsages.length > 0 ||
|
|
33
|
+
skillRefs.length > 0 ||
|
|
34
|
+
subAgents.length > 0;
|
|
35
|
+
if (!hasDeps)
|
|
36
|
+
return { tree: null, isEmpty: true };
|
|
37
|
+
let nodeCount = 1; // root
|
|
38
|
+
const mcpNodes = mcpServerUsages
|
|
39
|
+
.filter((u) => u.mcpServerRef)
|
|
40
|
+
.map((usage) => {
|
|
41
|
+
nodeCount++;
|
|
42
|
+
const ref = usage.mcpServerRef;
|
|
43
|
+
const toolCount = usage.enabledTools.length;
|
|
44
|
+
return {
|
|
45
|
+
id: `mcp-server:${ref.slug}`,
|
|
46
|
+
kind: "mcp-server",
|
|
47
|
+
label: ref.slug,
|
|
48
|
+
qualifiedLabel: ref.org && ref.org !== agentOrg
|
|
49
|
+
? `${ref.org}/${ref.slug}`
|
|
50
|
+
: undefined,
|
|
51
|
+
metadata: {
|
|
52
|
+
tools: toolCount > 0
|
|
53
|
+
? `${toolCount} ${toolCount === 1 ? "tool" : "tools"}`
|
|
54
|
+
: "all tools",
|
|
55
|
+
},
|
|
56
|
+
children: [],
|
|
57
|
+
ref: { org: ref.org || agentOrg, slug: ref.slug },
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
const skillNodes = skillRefs.map((ref) => {
|
|
61
|
+
nodeCount++;
|
|
62
|
+
return {
|
|
63
|
+
id: `skill:${ref.slug}`,
|
|
64
|
+
kind: "skill",
|
|
65
|
+
label: ref.slug,
|
|
66
|
+
qualifiedLabel: ref.org && ref.org !== agentOrg
|
|
67
|
+
? `${ref.org}/${ref.slug}`
|
|
68
|
+
: undefined,
|
|
69
|
+
children: [],
|
|
70
|
+
ref: { org: ref.org || agentOrg, slug: ref.slug },
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
const subAgentNodes = subAgents.map((sa) => {
|
|
74
|
+
nodeCount++;
|
|
75
|
+
const saMcpNodes = sa.mcpAccess.map((access) => {
|
|
76
|
+
nodeCount++;
|
|
77
|
+
const toolCount = access.enabledTools.length;
|
|
78
|
+
return {
|
|
79
|
+
id: `sub-agent:${sa.name}:mcp-server:${access.mcpServer}`,
|
|
80
|
+
kind: "mcp-server",
|
|
81
|
+
label: access.mcpServer,
|
|
82
|
+
metadata: {
|
|
83
|
+
tools: toolCount > 0
|
|
84
|
+
? `${toolCount} ${toolCount === 1 ? "tool" : "tools"}`
|
|
85
|
+
: "all tools",
|
|
86
|
+
},
|
|
87
|
+
children: [],
|
|
88
|
+
ref: { org: agentOrg, slug: access.mcpServer },
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
const saSkillNodes = sa.skillRefs.map((ref) => {
|
|
92
|
+
nodeCount++;
|
|
93
|
+
return {
|
|
94
|
+
id: `sub-agent:${sa.name}:skill:${ref.slug}`,
|
|
95
|
+
kind: "skill",
|
|
96
|
+
label: ref.slug,
|
|
97
|
+
qualifiedLabel: ref.org && ref.org !== agentOrg
|
|
98
|
+
? `${ref.org}/${ref.slug}`
|
|
99
|
+
: undefined,
|
|
100
|
+
children: [],
|
|
101
|
+
ref: { org: ref.org || agentOrg, slug: ref.slug },
|
|
102
|
+
};
|
|
103
|
+
});
|
|
104
|
+
const metadata = {};
|
|
105
|
+
if (sa.modelOverride) {
|
|
106
|
+
metadata.model = sa.modelOverride;
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
id: `sub-agent:${sa.name}`,
|
|
110
|
+
kind: "sub-agent",
|
|
111
|
+
label: sa.name,
|
|
112
|
+
description: sa.description || undefined,
|
|
113
|
+
metadata: Object.keys(metadata).length > 0 ? metadata : undefined,
|
|
114
|
+
children: [...saMcpNodes, ...saSkillNodes],
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
const root = {
|
|
118
|
+
id: `agent:${agentName}`,
|
|
119
|
+
kind: "agent",
|
|
120
|
+
label: agentName,
|
|
121
|
+
children: [...mcpNodes, ...skillNodes, ...subAgentNodes],
|
|
122
|
+
};
|
|
123
|
+
return {
|
|
124
|
+
tree: { root, nodeCount },
|
|
125
|
+
isEmpty: false,
|
|
126
|
+
};
|
|
127
|
+
}, [agentName, agentOrg, spec]);
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=useDependencyGraph.js.map
|