@stigmer/react 0.0.36 → 0.0.40
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/README.md +4 -88
- package/__tests__/hooks.test.d.ts +2 -0
- package/__tests__/hooks.test.d.ts.map +1 -0
- package/__tests__/hooks.test.js +18 -0
- package/__tests__/hooks.test.js.map +1 -0
- package/agent/AgentDetailView.d.ts +80 -0
- package/agent/AgentDetailView.d.ts.map +1 -0
- package/agent/AgentDetailView.js +184 -0
- package/agent/AgentDetailView.js.map +1 -0
- package/agent/AgentEnvForm.d.ts +83 -0
- package/agent/AgentEnvForm.d.ts.map +1 -0
- package/agent/AgentEnvForm.js +31 -0
- package/agent/AgentEnvForm.js.map +1 -0
- package/agent/AgentPicker.d.ts +44 -0
- package/agent/AgentPicker.d.ts.map +1 -0
- package/agent/AgentPicker.js +121 -0
- package/agent/AgentPicker.js.map +1 -0
- package/agent/agentSetupReducer.d.ts +123 -0
- package/agent/agentSetupReducer.d.ts.map +1 -0
- package/agent/agentSetupReducer.js +86 -0
- package/agent/agentSetupReducer.js.map +1 -0
- package/agent/index.d.ts +19 -8
- package/agent/index.d.ts.map +1 -1
- package/agent/index.js +10 -6
- package/agent/index.js.map +1 -1
- package/agent/useAgent.d.ts +48 -0
- package/agent/useAgent.d.ts.map +1 -0
- package/agent/useAgent.js +82 -0
- package/agent/useAgent.js.map +1 -0
- package/agent/useAgentCount.d.ts +49 -0
- package/agent/useAgentCount.d.ts.map +1 -0
- package/agent/useAgentCount.js +32 -0
- package/agent/useAgentCount.js.map +1 -0
- package/agent/useAgentList.d.ts +62 -0
- package/agent/useAgentList.d.ts.map +1 -0
- package/agent/useAgentList.js +38 -0
- package/agent/useAgentList.js.map +1 -0
- package/agent/useAgentSearch.d.ts +23 -0
- package/agent/useAgentSearch.d.ts.map +1 -0
- package/agent/useAgentSearch.js +28 -0
- package/agent/useAgentSearch.js.map +1 -0
- package/agent/useAgentSetup.d.ts +115 -0
- package/agent/useAgentSetup.d.ts.map +1 -0
- package/agent/useAgentSetup.js +279 -0
- package/agent/useAgentSetup.js.map +1 -0
- package/agent/useDefaultAgent.d.ts +29 -0
- package/agent/useDefaultAgent.d.ts.map +1 -0
- package/agent/useDefaultAgent.js +60 -0
- package/agent/useDefaultAgent.js.map +1 -0
- package/agent-instance/buildPersonalInstanceInput.d.ts +20 -0
- package/agent-instance/buildPersonalInstanceInput.d.ts.map +1 -0
- package/agent-instance/buildPersonalInstanceInput.js +29 -0
- package/agent-instance/buildPersonalInstanceInput.js.map +1 -0
- package/agent-instance/index.d.ts +9 -0
- package/agent-instance/index.d.ts.map +1 -0
- package/agent-instance/index.js +5 -0
- package/agent-instance/index.js.map +1 -0
- package/agent-instance/useAgentInstance.d.ts +35 -0
- package/agent-instance/useAgentInstance.d.ts.map +1 -0
- package/agent-instance/useAgentInstance.js +67 -0
- package/agent-instance/useAgentInstance.js.map +1 -0
- package/agent-instance/useAgentInstanceList.d.ts +29 -0
- package/agent-instance/useAgentInstanceList.d.ts.map +1 -0
- package/agent-instance/useAgentInstanceList.js +74 -0
- package/agent-instance/useAgentInstanceList.js.map +1 -0
- package/agent-instance/useCreateAgentInstance.d.ts +44 -0
- package/agent-instance/useCreateAgentInstance.d.ts.map +1 -0
- package/agent-instance/useCreateAgentInstance.js +60 -0
- package/agent-instance/useCreateAgentInstance.js.map +1 -0
- package/agent-instance/usePersonalAgentInstance.d.ts +93 -0
- package/agent-instance/usePersonalAgentInstance.d.ts.map +1 -0
- package/agent-instance/usePersonalAgentInstance.js +103 -0
- package/agent-instance/usePersonalAgentInstance.js.map +1 -0
- package/api-key/ApiKeyCreatedAlert.d.ts +33 -0
- package/api-key/ApiKeyCreatedAlert.d.ts.map +1 -0
- package/api-key/ApiKeyCreatedAlert.js +61 -0
- package/api-key/ApiKeyCreatedAlert.js.map +1 -0
- package/api-key/ApiKeyListPanel.d.ts +30 -0
- package/api-key/ApiKeyListPanel.d.ts.map +1 -0
- package/api-key/ApiKeyListPanel.js +126 -0
- package/api-key/ApiKeyListPanel.js.map +1 -0
- package/api-key/CreateApiKeyForm.d.ts +35 -0
- package/api-key/CreateApiKeyForm.d.ts.map +1 -0
- package/api-key/CreateApiKeyForm.js +81 -0
- package/api-key/CreateApiKeyForm.js.map +1 -0
- package/api-key/index.d.ts +13 -0
- package/api-key/index.d.ts.map +1 -0
- package/api-key/index.js +7 -0
- package/api-key/index.js.map +1 -0
- package/api-key/useApiKeyList.d.ts +28 -0
- package/api-key/useApiKeyList.d.ts.map +1 -0
- package/api-key/useApiKeyList.js +52 -0
- package/api-key/useApiKeyList.js.map +1 -0
- package/api-key/useCreateApiKey.d.ts +40 -0
- package/api-key/useCreateApiKey.d.ts.map +1 -0
- package/api-key/useCreateApiKey.js +56 -0
- package/api-key/useCreateApiKey.js.map +1 -0
- package/api-key/useDeleteApiKey.d.ts +26 -0
- package/api-key/useDeleteApiKey.d.ts.map +1 -0
- package/api-key/useDeleteApiKey.js +43 -0
- package/api-key/useDeleteApiKey.js.map +1 -0
- package/attachment/AttachmentChipList.d.ts +24 -0
- package/attachment/AttachmentChipList.d.ts.map +1 -0
- package/attachment/AttachmentChipList.js +45 -0
- package/attachment/AttachmentChipList.js.map +1 -0
- package/attachment/attachment-utils.d.ts +32 -0
- package/attachment/attachment-utils.d.ts.map +1 -0
- package/attachment/attachment-utils.js +104 -0
- package/attachment/attachment-utils.js.map +1 -0
- package/attachment/index.d.ts +6 -0
- package/attachment/index.d.ts.map +1 -0
- package/attachment/index.js +4 -0
- package/attachment/index.js.map +1 -0
- package/attachment/useAttachments.d.ts +113 -0
- package/attachment/useAttachments.d.ts.map +1 -0
- package/attachment/useAttachments.js +175 -0
- package/attachment/useAttachments.js.map +1 -0
- package/composer/ComposerToolbar.d.ts +37 -0
- package/composer/ComposerToolbar.d.ts.map +1 -0
- package/composer/ComposerToolbar.js +24 -0
- package/composer/ComposerToolbar.js.map +1 -0
- package/composer/ConfigureMenu.d.ts +37 -0
- package/composer/ConfigureMenu.d.ts.map +1 -0
- package/composer/ConfigureMenu.js +53 -0
- package/composer/ConfigureMenu.js.map +1 -0
- package/composer/ContextChip.d.ts +22 -0
- package/composer/ContextChip.d.ts.map +1 -0
- package/composer/ContextChip.js +19 -0
- package/composer/ContextChip.js.map +1 -0
- package/composer/ContextPopover.d.ts +10 -0
- package/composer/ContextPopover.d.ts.map +1 -0
- package/composer/ContextPopover.js +11 -0
- package/composer/ContextPopover.js.map +1 -0
- package/composer/SessionComposer.d.ts +269 -0
- package/composer/SessionComposer.d.ts.map +1 -0
- package/composer/SessionComposer.js +580 -0
- package/composer/SessionComposer.js.map +1 -0
- package/composer/icons.d.ts +15 -0
- package/composer/icons.d.ts.map +1 -0
- package/composer/icons.js +42 -0
- package/composer/icons.js.map +1 -0
- package/composer/index.d.ts +5 -0
- package/composer/index.d.ts.map +1 -0
- package/composer/index.js +3 -0
- package/composer/index.js.map +1 -0
- package/composer/useComposer.d.ts +74 -0
- package/composer/useComposer.d.ts.map +1 -0
- package/composer/useComposer.js +94 -0
- package/composer/useComposer.js.map +1 -0
- package/environment/CreateEnvironmentForm.d.ts +31 -0
- package/environment/CreateEnvironmentForm.d.ts.map +1 -0
- package/environment/CreateEnvironmentForm.js +57 -0
- package/environment/CreateEnvironmentForm.js.map +1 -0
- package/environment/EnvVarForm.d.ts +134 -0
- package/environment/EnvVarForm.d.ts.map +1 -0
- package/environment/EnvVarForm.js +122 -0
- package/environment/EnvVarForm.js.map +1 -0
- package/environment/EnvironmentListPanel.d.ts +51 -0
- package/environment/EnvironmentListPanel.d.ts.map +1 -0
- package/environment/EnvironmentListPanel.js +96 -0
- package/environment/EnvironmentListPanel.js.map +1 -0
- package/environment/EnvironmentVariableEditor.d.ts +43 -0
- package/environment/EnvironmentVariableEditor.d.ts.map +1 -0
- package/environment/EnvironmentVariableEditor.js +269 -0
- package/environment/EnvironmentVariableEditor.js.map +1 -0
- package/environment/diffEnvSpec.d.ts +34 -0
- package/environment/diffEnvSpec.d.ts.map +1 -0
- package/environment/diffEnvSpec.js +44 -0
- package/environment/diffEnvSpec.js.map +1 -0
- package/environment/index.d.ts +28 -0
- package/environment/index.d.ts.map +1 -0
- package/environment/index.js +15 -0
- package/environment/index.js.map +1 -0
- package/environment/useCreateEnvironment.d.ts +43 -0
- package/environment/useCreateEnvironment.d.ts.map +1 -0
- package/environment/useCreateEnvironment.js +59 -0
- package/environment/useCreateEnvironment.js.map +1 -0
- package/environment/useEnvironment.d.ts +37 -0
- package/environment/useEnvironment.d.ts.map +1 -0
- package/environment/useEnvironment.js +69 -0
- package/environment/useEnvironment.js.map +1 -0
- package/environment/useEnvironmentList.d.ts +31 -0
- package/environment/useEnvironmentList.d.ts.map +1 -0
- package/environment/useEnvironmentList.js +88 -0
- package/environment/useEnvironmentList.js.map +1 -0
- package/environment/usePersonalEnvironment.d.ts +100 -0
- package/environment/usePersonalEnvironment.d.ts.map +1 -0
- package/environment/usePersonalEnvironment.js +168 -0
- package/environment/usePersonalEnvironment.js.map +1 -0
- package/environment/useRemoveEnvironmentVariables.d.ts +45 -0
- package/environment/useRemoveEnvironmentVariables.d.ts.map +1 -0
- package/environment/useRemoveEnvironmentVariables.js +57 -0
- package/environment/useRemoveEnvironmentVariables.js.map +1 -0
- package/environment/useRevealSecretValue.d.ts +66 -0
- package/environment/useRevealSecretValue.d.ts.map +1 -0
- package/environment/useRevealSecretValue.js +92 -0
- package/environment/useRevealSecretValue.js.map +1 -0
- package/environment/useSessionEnvPool.d.ts +80 -0
- package/environment/useSessionEnvPool.d.ts.map +1 -0
- package/environment/useSessionEnvPool.js +72 -0
- package/environment/useSessionEnvPool.js.map +1 -0
- package/environment/useUpdateEnvironment.d.ts +43 -0
- package/environment/useUpdateEnvironment.d.ts.map +1 -0
- package/environment/useUpdateEnvironment.js +59 -0
- package/environment/useUpdateEnvironment.js.map +1 -0
- package/environment/useUpdateEnvironmentVariables.d.ts +53 -0
- package/environment/useUpdateEnvironmentVariables.d.ts.map +1 -0
- package/environment/useUpdateEnvironmentVariables.js +71 -0
- package/environment/useUpdateEnvironmentVariables.js.map +1 -0
- package/error/ErrorMessage.d.ts +33 -0
- package/error/ErrorMessage.d.ts.map +1 -0
- package/error/ErrorMessage.js +60 -0
- package/error/ErrorMessage.js.map +1 -0
- package/error/SecretFlowErrorGuide.d.ts +41 -0
- package/error/SecretFlowErrorGuide.d.ts.map +1 -0
- package/error/SecretFlowErrorGuide.js +87 -0
- package/error/SecretFlowErrorGuide.js.map +1 -0
- package/error/index.d.ts +5 -0
- package/error/index.d.ts.map +1 -0
- package/error/index.js +3 -0
- package/error/index.js.map +1 -0
- package/execution/ApprovalCard.d.ts +35 -0
- package/execution/ApprovalCard.d.ts.map +1 -0
- package/execution/ApprovalCard.js +192 -0
- package/execution/ApprovalCard.js.map +1 -0
- package/execution/ArtifactCard.d.ts +70 -0
- package/execution/ArtifactCard.d.ts.map +1 -0
- package/execution/ArtifactCard.js +109 -0
- package/execution/ArtifactCard.js.map +1 -0
- package/execution/ArtifactPreviewModal.d.ts +77 -0
- package/execution/ArtifactPreviewModal.d.ts.map +1 -0
- package/execution/ArtifactPreviewModal.js +310 -0
- package/execution/ArtifactPreviewModal.js.map +1 -0
- package/execution/ArtifactsWidget.d.ts +63 -0
- package/execution/ArtifactsWidget.d.ts.map +1 -0
- package/execution/ArtifactsWidget.js +61 -0
- package/execution/ArtifactsWidget.js.map +1 -0
- package/execution/ExecutionCostSummary.d.ts +47 -0
- package/execution/ExecutionCostSummary.d.ts.map +1 -0
- package/execution/ExecutionCostSummary.js +77 -0
- package/execution/ExecutionCostSummary.js.map +1 -0
- package/execution/ExecutionPhaseBadge.d.ts +20 -0
- package/execution/ExecutionPhaseBadge.d.ts.map +1 -0
- package/execution/ExecutionPhaseBadge.js +112 -0
- package/execution/ExecutionPhaseBadge.js.map +1 -0
- package/execution/ExecutionProgress.d.ts +32 -0
- package/execution/ExecutionProgress.d.ts.map +1 -0
- package/execution/ExecutionProgress.js +96 -0
- package/execution/ExecutionProgress.js.map +1 -0
- package/execution/FilePathContext.d.ts +22 -0
- package/execution/FilePathContext.d.ts.map +1 -0
- package/execution/FilePathContext.js +6 -0
- package/execution/FilePathContext.js.map +1 -0
- package/execution/FilePathLink.d.ts +26 -0
- package/execution/FilePathLink.d.ts.map +1 -0
- package/execution/FilePathLink.js +64 -0
- package/execution/FilePathLink.js.map +1 -0
- package/execution/FollowUpInput.d.ts +55 -0
- package/execution/FollowUpInput.d.ts.map +1 -0
- package/execution/FollowUpInput.js +95 -0
- package/execution/FollowUpInput.js.map +1 -0
- package/execution/MessageEntry.d.ts +25 -0
- package/execution/MessageEntry.d.ts.map +1 -0
- package/execution/MessageEntry.js +46 -0
- package/execution/MessageEntry.js.map +1 -0
- package/execution/MessageThread.d.ts +88 -0
- package/execution/MessageThread.d.ts.map +1 -0
- package/execution/MessageThread.js +157 -0
- package/execution/MessageThread.js.map +1 -0
- package/execution/SessionVariablesInput.d.ts +47 -0
- package/execution/SessionVariablesInput.d.ts.map +1 -0
- package/execution/SessionVariablesInput.js +80 -0
- package/execution/SessionVariablesInput.js.map +1 -0
- package/execution/SubAgentSection.d.ts +23 -0
- package/execution/SubAgentSection.d.ts.map +1 -0
- package/execution/SubAgentSection.js +103 -0
- package/execution/SubAgentSection.js.map +1 -0
- package/execution/ToolCallDetail.d.ts +32 -0
- package/execution/ToolCallDetail.d.ts.map +1 -0
- package/execution/ToolCallDetail.js +204 -0
- package/execution/ToolCallDetail.js.map +1 -0
- package/execution/ToolCallGroup.d.ts +45 -0
- package/execution/ToolCallGroup.d.ts.map +1 -0
- package/execution/ToolCallGroup.js +160 -0
- package/execution/ToolCallGroup.js.map +1 -0
- package/execution/ToolCallItem.d.ts +39 -0
- package/execution/ToolCallItem.d.ts.map +1 -0
- package/execution/ToolCallItem.js +164 -0
- package/execution/ToolCallItem.js.map +1 -0
- package/execution/__tests__/ExecutionCostSummary.test.d.ts +2 -0
- package/execution/__tests__/ExecutionCostSummary.test.d.ts.map +1 -0
- package/execution/__tests__/ExecutionCostSummary.test.js +255 -0
- package/execution/__tests__/ExecutionCostSummary.test.js.map +1 -0
- package/execution/__tests__/execution-phases.test.d.ts +2 -0
- package/execution/__tests__/execution-phases.test.d.ts.map +1 -0
- package/execution/__tests__/execution-phases.test.js +25 -0
- package/execution/__tests__/execution-phases.test.js.map +1 -0
- package/execution/__tests__/useExecutionStream.test.d.ts +2 -0
- package/execution/__tests__/useExecutionStream.test.d.ts.map +1 -0
- package/execution/__tests__/useExecutionStream.test.js +190 -0
- package/execution/__tests__/useExecutionStream.test.js.map +1 -0
- package/execution/__tests__/useExecutionUsage.test.d.ts +2 -0
- package/execution/__tests__/useExecutionUsage.test.d.ts.map +1 -0
- package/execution/__tests__/useExecutionUsage.test.js +303 -0
- package/execution/__tests__/useExecutionUsage.test.js.map +1 -0
- package/execution/artifact-utils.d.ts +58 -0
- package/execution/artifact-utils.d.ts.map +1 -0
- package/execution/artifact-utils.js +123 -0
- package/execution/artifact-utils.js.map +1 -0
- package/execution/execution-phases.d.ts +7 -0
- package/execution/execution-phases.d.ts.map +1 -0
- package/execution/execution-phases.js +15 -0
- package/execution/execution-phases.js.map +1 -0
- package/execution/file-path-resolver.d.ts +63 -0
- package/execution/file-path-resolver.d.ts.map +1 -0
- package/execution/file-path-resolver.js +121 -0
- package/execution/file-path-resolver.js.map +1 -0
- package/execution/index.d.ts +55 -0
- package/execution/index.d.ts.map +1 -0
- package/execution/index.js +29 -0
- package/execution/index.js.map +1 -0
- package/execution/tool-categories.d.ts +36 -0
- package/execution/tool-categories.d.ts.map +1 -0
- package/execution/tool-categories.js +110 -0
- package/execution/tool-categories.js.map +1 -0
- package/execution/useArtifactContent.d.ts +75 -0
- package/execution/useArtifactContent.d.ts.map +1 -0
- package/execution/useArtifactContent.js +102 -0
- package/execution/useArtifactContent.js.map +1 -0
- package/execution/useCreateAgentExecution.d.ts +84 -0
- package/execution/useCreateAgentExecution.d.ts.map +1 -0
- package/execution/useCreateAgentExecution.js +79 -0
- package/execution/useCreateAgentExecution.js.map +1 -0
- package/execution/useExecutionArtifacts.d.ts +42 -0
- package/execution/useExecutionArtifacts.d.ts.map +1 -0
- package/execution/useExecutionArtifacts.js +43 -0
- package/execution/useExecutionArtifacts.js.map +1 -0
- package/execution/useExecutionStream.d.ts +62 -0
- package/execution/useExecutionStream.d.ts.map +1 -0
- package/execution/useExecutionStream.js +99 -0
- package/execution/useExecutionStream.js.map +1 -0
- package/execution/useExecutionUsage.d.ts +45 -0
- package/execution/useExecutionUsage.d.ts.map +1 -0
- package/execution/useExecutionUsage.js +157 -0
- package/execution/useExecutionUsage.js.map +1 -0
- package/execution/useSessionVariables.d.ts +102 -0
- package/execution/useSessionVariables.d.ts.map +1 -0
- package/execution/useSessionVariables.js +102 -0
- package/execution/useSessionVariables.js.map +1 -0
- package/execution/useSubmitApproval.d.ts +39 -0
- package/execution/useSubmitApproval.d.ts.map +1 -0
- package/execution/useSubmitApproval.js +62 -0
- package/execution/useSubmitApproval.js.map +1 -0
- package/github/GitHubRepoPicker.d.ts +24 -0
- package/github/GitHubRepoPicker.d.ts.map +1 -0
- package/github/GitHubRepoPicker.js +248 -0
- package/github/GitHubRepoPicker.js.map +1 -0
- package/github/index.d.ts +4 -0
- package/github/index.d.ts.map +1 -0
- package/github/index.js +4 -0
- package/github/index.js.map +1 -0
- package/github/useGitHubConnection.d.ts +72 -0
- package/github/useGitHubConnection.d.ts.map +1 -0
- package/github/useGitHubConnection.js +268 -0
- package/github/useGitHubConnection.js.map +1 -0
- package/github/useGitHubRepos.d.ts +39 -0
- package/github/useGitHubRepos.d.ts.map +1 -0
- package/github/useGitHubRepos.js +135 -0
- package/github/useGitHubRepos.js.map +1 -0
- package/index.d.ts +34 -0
- package/index.d.ts.map +1 -1
- package/index.js +33 -0
- package/index.js.map +1 -1
- package/internal/ScrollFade.d.ts +15 -0
- package/internal/ScrollFade.d.ts.map +1 -0
- package/internal/ScrollFade.js +24 -0
- package/internal/ScrollFade.js.map +1 -0
- package/internal/markdown-components.d.ts +18 -0
- package/internal/markdown-components.d.ts.map +1 -0
- package/internal/markdown-components.js +78 -0
- package/internal/markdown-components.js.map +1 -0
- package/internal/slug.d.ts +32 -0
- package/internal/slug.d.ts.map +1 -0
- package/internal/slug.js +41 -0
- package/internal/slug.js.map +1 -0
- package/internal/toError.d.ts +16 -0
- package/internal/toError.d.ts.map +1 -0
- package/internal/toError.js +22 -0
- package/internal/toError.js.map +1 -0
- package/internal/useScrollShadows.d.ts +22 -0
- package/internal/useScrollShadows.d.ts.map +1 -0
- package/internal/useScrollShadows.js +40 -0
- package/internal/useScrollShadows.js.map +1 -0
- package/library/ResourceCountCard.d.ts +104 -0
- package/library/ResourceCountCard.d.ts.map +1 -0
- package/library/ResourceCountCard.js +80 -0
- package/library/ResourceCountCard.js.map +1 -0
- package/library/ResourceListView.d.ts +123 -0
- package/library/ResourceListView.d.ts.map +1 -0
- package/library/ResourceListView.js +208 -0
- package/library/ResourceListView.js.map +1 -0
- package/library/ScopeToggle.d.ts +38 -0
- package/library/ScopeToggle.d.ts.map +1 -0
- package/library/ScopeToggle.js +61 -0
- package/library/ScopeToggle.js.map +1 -0
- package/library/VisibilityToggle.d.ts +41 -0
- package/library/VisibilityToggle.d.ts.map +1 -0
- package/library/VisibilityToggle.js +80 -0
- package/library/VisibilityToggle.js.map +1 -0
- package/library/detect-skill-package.d.ts +79 -0
- package/library/detect-skill-package.d.ts.map +1 -0
- package/library/detect-skill-package.js +113 -0
- package/library/detect-skill-package.js.map +1 -0
- package/library/detect-stigmer-resource.d.ts +66 -0
- package/library/detect-stigmer-resource.d.ts.map +1 -0
- package/library/detect-stigmer-resource.js +77 -0
- package/library/detect-stigmer-resource.js.map +1 -0
- package/library/index.d.ts +24 -0
- package/library/index.d.ts.map +1 -0
- package/library/index.js +13 -0
- package/library/index.js.map +1 -0
- package/library/parse-resource-yaml.d.ts +59 -0
- package/library/parse-resource-yaml.d.ts.map +1 -0
- package/library/parse-resource-yaml.js +397 -0
- package/library/parse-resource-yaml.js.map +1 -0
- package/library/serialize-resource-yaml.d.ts +50 -0
- package/library/serialize-resource-yaml.d.ts.map +1 -0
- package/library/serialize-resource-yaml.js +294 -0
- package/library/serialize-resource-yaml.js.map +1 -0
- package/library/useApplyResource.d.ts +115 -0
- package/library/useApplyResource.d.ts.map +1 -0
- package/library/useApplyResource.js +124 -0
- package/library/useApplyResource.js.map +1 -0
- package/library/useDetectSkillPackage.d.ts +54 -0
- package/library/useDetectSkillPackage.d.ts.map +1 -0
- package/library/useDetectSkillPackage.js +59 -0
- package/library/useDetectSkillPackage.js.map +1 -0
- package/library/useDetectStigmerResource.d.ts +30 -0
- package/library/useDetectStigmerResource.d.ts.map +1 -0
- package/library/useDetectStigmerResource.js +35 -0
- package/library/useDetectStigmerResource.js.map +1 -0
- package/library/useUpdateVisibility.d.ts +40 -0
- package/library/useUpdateVisibility.d.ts.map +1 -0
- package/library/useUpdateVisibility.js +67 -0
- package/library/useUpdateVisibility.js.map +1 -0
- package/mcp-server/McpServerConfigPanel.d.ts +116 -0
- package/mcp-server/McpServerConfigPanel.d.ts.map +1 -0
- package/mcp-server/McpServerConfigPanel.js +72 -0
- package/mcp-server/McpServerConfigPanel.js.map +1 -0
- package/mcp-server/McpServerDetailView.d.ts +54 -0
- package/mcp-server/McpServerDetailView.d.ts.map +1 -0
- package/mcp-server/McpServerDetailView.js +138 -0
- package/mcp-server/McpServerDetailView.js.map +1 -0
- package/mcp-server/McpServerPicker.d.ts +158 -0
- package/mcp-server/McpServerPicker.d.ts.map +1 -0
- package/mcp-server/McpServerPicker.js +265 -0
- package/mcp-server/McpServerPicker.js.map +1 -0
- package/mcp-server/McpToolSelector.d.ts +44 -0
- package/mcp-server/McpToolSelector.d.ts.map +1 -0
- package/mcp-server/McpToolSelector.js +75 -0
- package/mcp-server/McpToolSelector.js.map +1 -0
- package/mcp-server/index.d.ts +18 -2
- package/mcp-server/index.d.ts.map +1 -1
- package/mcp-server/index.js +9 -2
- package/mcp-server/index.js.map +1 -1
- package/mcp-server/mcpServerSetupReducer.d.ts +138 -0
- package/mcp-server/mcpServerSetupReducer.d.ts.map +1 -0
- package/mcp-server/mcpServerSetupReducer.js +163 -0
- package/mcp-server/mcpServerSetupReducer.js.map +1 -0
- package/mcp-server/useMcpServer.d.ts +48 -0
- package/mcp-server/useMcpServer.d.ts.map +1 -0
- package/mcp-server/useMcpServer.js +82 -0
- package/mcp-server/useMcpServer.js.map +1 -0
- package/mcp-server/useMcpServerCount.d.ts +49 -0
- package/mcp-server/useMcpServerCount.d.ts.map +1 -0
- package/mcp-server/useMcpServerCount.js +32 -0
- package/mcp-server/useMcpServerCount.js.map +1 -0
- package/mcp-server/useMcpServerList.d.ts +62 -0
- package/mcp-server/useMcpServerList.d.ts.map +1 -0
- package/mcp-server/useMcpServerList.js +38 -0
- package/mcp-server/useMcpServerList.js.map +1 -0
- package/mcp-server/useMcpServerSearch.d.ts +18 -0
- package/mcp-server/useMcpServerSearch.d.ts.map +1 -0
- package/mcp-server/useMcpServerSearch.js +23 -0
- package/mcp-server/useMcpServerSearch.js.map +1 -0
- package/mcp-server/useMcpServerSetup.d.ts +162 -0
- package/mcp-server/useMcpServerSetup.d.ts.map +1 -0
- package/mcp-server/useMcpServerSetup.js +269 -0
- package/mcp-server/useMcpServerSetup.js.map +1 -0
- package/models/ModelSelector.d.ts +22 -0
- package/models/ModelSelector.d.ts.map +1 -0
- package/models/ModelSelector.js +59 -0
- package/models/ModelSelector.js.map +1 -0
- package/models/index.d.ts +7 -0
- package/models/index.d.ts.map +1 -0
- package/models/index.js +4 -0
- package/models/index.js.map +1 -0
- package/models/registry.d.ts +22 -0
- package/models/registry.d.ts.map +1 -0
- package/models/registry.js +43 -0
- package/models/registry.js.map +1 -0
- package/models/useModelRegistry.d.ts +18 -0
- package/models/useModelRegistry.d.ts.map +1 -0
- package/models/useModelRegistry.js +40 -0
- package/models/useModelRegistry.js.map +1 -0
- package/organization/CreateOrganizationForm.d.ts +28 -0
- package/organization/CreateOrganizationForm.d.ts.map +1 -0
- package/organization/CreateOrganizationForm.js +91 -0
- package/organization/CreateOrganizationForm.js.map +1 -0
- package/organization/index.d.ts +5 -0
- package/organization/index.d.ts.map +1 -0
- package/organization/index.js +3 -0
- package/organization/index.js.map +1 -0
- package/organization/useCreateOrganization.d.ts +34 -0
- package/organization/useCreateOrganization.d.ts.map +1 -0
- package/organization/useCreateOrganization.js +50 -0
- package/organization/useCreateOrganization.js.map +1 -0
- package/package.json +12 -40
- package/search/index.d.ts +7 -0
- package/search/index.d.ts.map +1 -0
- package/search/index.js +4 -0
- package/search/index.js.map +1 -0
- package/search/useResourceCount.d.ts +42 -0
- package/search/useResourceCount.d.ts.map +1 -0
- package/search/useResourceCount.js +58 -0
- package/search/useResourceCount.js.map +1 -0
- package/search/useResourceList.d.ts +48 -0
- package/search/useResourceList.d.ts.map +1 -0
- package/search/useResourceList.js +73 -0
- package/search/useResourceList.js.map +1 -0
- package/search/useResourceSearch.d.ts +27 -0
- package/search/useResourceSearch.d.ts.map +1 -0
- package/search/useResourceSearch.js +55 -0
- package/search/useResourceSearch.js.map +1 -0
- package/session/__tests__/group-sessions.test.d.ts +2 -0
- package/session/__tests__/group-sessions.test.d.ts.map +1 -0
- package/session/__tests__/group-sessions.test.js +91 -0
- package/session/__tests__/group-sessions.test.js.map +1 -0
- package/session/__tests__/useSessionConversation.test.d.ts +2 -0
- package/session/__tests__/useSessionConversation.test.d.ts.map +1 -0
- package/session/__tests__/useSessionConversation.test.js +209 -0
- package/session/__tests__/useSessionConversation.test.js.map +1 -0
- package/session/group-sessions.d.ts +20 -0
- package/session/group-sessions.d.ts.map +1 -0
- package/session/group-sessions.js +61 -0
- package/session/group-sessions.js.map +1 -0
- package/session/index.d.ts +17 -6
- package/session/index.d.ts.map +1 -1
- package/session/index.js +10 -5
- package/session/index.js.map +1 -1
- package/session/useAgentRefFromSession.d.ts +28 -0
- package/session/useAgentRefFromSession.d.ts.map +1 -0
- package/session/useAgentRefFromSession.js +73 -0
- package/session/useAgentRefFromSession.js.map +1 -0
- package/session/useCreateSession.d.ts +73 -0
- package/session/useCreateSession.d.ts.map +1 -0
- package/session/useCreateSession.js +87 -0
- package/session/useCreateSession.js.map +1 -0
- package/session/useSession.d.ts +17 -0
- package/session/useSession.d.ts.map +1 -0
- package/session/useSession.js +46 -0
- package/session/useSession.js.map +1 -0
- package/session/useSessionConversation.d.ts +151 -0
- package/session/useSessionConversation.d.ts.map +1 -0
- package/session/useSessionConversation.js +282 -0
- package/session/useSessionConversation.js.map +1 -0
- package/session/useSessionExecutions.d.ts +20 -0
- package/session/useSessionExecutions.d.ts.map +1 -0
- package/session/useSessionExecutions.js +57 -0
- package/session/useSessionExecutions.js.map +1 -0
- package/session/useSessionList.d.ts +25 -0
- package/session/useSessionList.d.ts.map +1 -0
- package/session/useSessionList.js +57 -0
- package/session/useSessionList.js.map +1 -0
- package/session/useUpdateSession.d.ts +22 -0
- package/session/useUpdateSession.d.ts.map +1 -0
- package/session/useUpdateSession.js +38 -0
- package/session/useUpdateSession.js.map +1 -0
- package/skill/SkillDetailView.d.ts +62 -0
- package/skill/SkillDetailView.d.ts.map +1 -0
- package/skill/SkillDetailView.js +157 -0
- package/skill/SkillDetailView.js.map +1 -0
- package/skill/SkillPicker.d.ts +26 -0
- package/skill/SkillPicker.d.ts.map +1 -0
- package/skill/SkillPicker.js +102 -0
- package/skill/SkillPicker.js.map +1 -0
- package/skill/index.d.ts +12 -2
- package/skill/index.d.ts.map +1 -1
- package/skill/index.js +6 -2
- package/skill/index.js.map +1 -1
- package/skill/useSkill.d.ts +49 -0
- package/skill/useSkill.d.ts.map +1 -0
- package/skill/useSkill.js +83 -0
- package/skill/useSkill.js.map +1 -0
- package/skill/useSkillCount.d.ts +49 -0
- package/skill/useSkillCount.d.ts.map +1 -0
- package/skill/useSkillCount.js +32 -0
- package/skill/useSkillCount.js.map +1 -0
- package/skill/useSkillList.d.ts +62 -0
- package/skill/useSkillList.d.ts.map +1 -0
- package/skill/useSkillList.js +38 -0
- package/skill/useSkillList.js.map +1 -0
- package/skill/useSkillSearch.d.ts +18 -0
- package/skill/useSkillSearch.d.ts.map +1 -0
- package/skill/useSkillSearch.js +23 -0
- package/skill/useSkillSearch.js.map +1 -0
- package/src/__tests__/hooks.test.tsx +28 -0
- package/src/agent/AgentDetailView.tsx +738 -0
- package/src/agent/AgentEnvForm.tsx +113 -0
- package/src/agent/AgentPicker.tsx +342 -0
- package/src/agent/agentSetupReducer.ts +234 -0
- package/src/agent/index.ts +43 -11
- package/src/agent/useAgent.ts +103 -0
- package/src/agent/useAgentCount.ts +68 -0
- package/src/agent/useAgentList.ts +84 -0
- package/src/agent/useAgentSearch.ts +43 -0
- package/src/agent/useAgentSetup.ts +434 -0
- package/src/agent/useDefaultAgent.ts +77 -0
- package/src/agent-instance/buildPersonalInstanceInput.ts +40 -0
- package/src/agent-instance/index.ts +11 -0
- package/src/agent-instance/useAgentInstance.ts +87 -0
- package/src/agent-instance/useAgentInstanceList.ts +99 -0
- package/src/agent-instance/useCreateAgentInstance.ts +75 -0
- package/src/agent-instance/usePersonalAgentInstance.ts +185 -0
- package/src/api-key/ApiKeyCreatedAlert.tsx +184 -0
- package/src/api-key/ApiKeyListPanel.tsx +359 -0
- package/src/api-key/CreateApiKeyForm.tsx +250 -0
- package/src/api-key/index.ts +12 -0
- package/src/api-key/useApiKeyList.ts +68 -0
- package/src/api-key/useCreateApiKey.ts +71 -0
- package/src/api-key/useDeleteApiKey.ts +57 -0
- package/src/attachment/AttachmentChipList.tsx +189 -0
- package/src/attachment/attachment-utils.ts +114 -0
- package/src/attachment/index.ts +17 -0
- package/src/attachment/useAttachments.ts +293 -0
- package/src/composer/ComposerToolbar.tsx +169 -0
- package/src/composer/ConfigureMenu.tsx +237 -0
- package/src/composer/ContextChip.tsx +104 -0
- package/src/composer/ContextPopover.tsx +54 -0
- package/src/composer/SessionComposer.tsx +1188 -0
- package/src/composer/icons.tsx +253 -0
- package/src/composer/index.ts +8 -0
- package/src/composer/useComposer.ts +163 -0
- package/src/environment/CreateEnvironmentForm.tsx +188 -0
- package/src/environment/EnvVarForm.tsx +475 -0
- package/src/environment/EnvironmentListPanel.tsx +258 -0
- package/src/environment/EnvironmentVariableEditor.tsx +811 -0
- package/src/environment/diffEnvSpec.ts +50 -0
- package/src/environment/index.ts +43 -0
- package/src/environment/useCreateEnvironment.ts +74 -0
- package/src/environment/useEnvironment.ts +89 -0
- package/src/environment/useEnvironmentList.ts +112 -0
- package/src/environment/usePersonalEnvironment.ts +285 -0
- package/src/environment/useRemoveEnvironmentVariables.ts +86 -0
- package/src/environment/useRevealSecretValue.ts +141 -0
- package/src/environment/useSessionEnvPool.ts +151 -0
- package/src/environment/useUpdateEnvironment.ts +74 -0
- package/src/environment/useUpdateEnvironmentVariables.ts +106 -0
- package/src/error/ErrorMessage.tsx +225 -0
- package/src/error/SecretFlowErrorGuide.tsx +189 -0
- package/src/error/index.ts +5 -0
- package/src/execution/ApprovalCard.tsx +499 -0
- package/src/execution/ArtifactCard.tsx +275 -0
- package/src/execution/ArtifactPreviewModal.tsx +942 -0
- package/src/execution/ArtifactsWidget.tsx +128 -0
- package/src/execution/ExecutionCostSummary.tsx +172 -0
- package/src/execution/ExecutionPhaseBadge.tsx +223 -0
- package/src/execution/ExecutionProgress.tsx +191 -0
- package/src/execution/FilePathContext.tsx +32 -0
- package/src/execution/FilePathLink.tsx +147 -0
- package/src/execution/FollowUpInput.tsx +220 -0
- package/src/execution/MessageEntry.tsx +120 -0
- package/src/execution/MessageThread.tsx +343 -0
- package/src/execution/SessionVariablesInput.tsx +374 -0
- package/src/execution/SubAgentSection.tsx +243 -0
- package/src/execution/ToolCallDetail.tsx +452 -0
- package/src/execution/ToolCallGroup.tsx +342 -0
- package/src/execution/ToolCallItem.tsx +426 -0
- package/src/execution/__tests__/ExecutionCostSummary.test.tsx +416 -0
- package/src/execution/__tests__/execution-phases.test.ts +31 -0
- package/src/execution/__tests__/useExecutionStream.test.tsx +242 -0
- package/src/execution/__tests__/useExecutionUsage.test.tsx +408 -0
- package/src/execution/artifact-utils.ts +136 -0
- package/src/execution/execution-phases.ts +16 -0
- package/src/execution/file-path-resolver.ts +171 -0
- package/src/execution/index.ts +97 -0
- package/src/execution/tool-categories.ts +171 -0
- package/src/execution/useArtifactContent.ts +156 -0
- package/src/execution/useCreateAgentExecution.ts +137 -0
- package/src/execution/useExecutionArtifacts.ts +58 -0
- package/src/execution/useExecutionStream.ts +149 -0
- package/src/execution/useExecutionUsage.ts +213 -0
- package/src/execution/useSessionVariables.ts +189 -0
- package/src/execution/useSubmitApproval.ts +98 -0
- package/src/github/GitHubRepoPicker.tsx +568 -0
- package/src/github/index.ts +19 -0
- package/src/github/useGitHubConnection.ts +368 -0
- package/src/github/useGitHubRepos.ts +197 -0
- package/src/index.ts +392 -0
- package/src/internal/ScrollFade.tsx +29 -0
- package/src/internal/markdown-components.tsx +197 -0
- package/src/internal/slug.ts +41 -0
- package/src/internal/toError.ts +19 -0
- package/src/internal/useScrollShadows.ts +54 -0
- package/src/library/ResourceCountCard.tsx +187 -0
- package/src/library/ResourceListView.tsx +698 -0
- package/src/library/ScopeToggle.tsx +121 -0
- package/src/library/VisibilityToggle.tsx +205 -0
- package/src/library/detect-skill-package.ts +162 -0
- package/src/library/detect-stigmer-resource.ts +130 -0
- package/src/library/index.ts +51 -0
- package/src/library/parse-resource-yaml.ts +611 -0
- package/src/library/serialize-resource-yaml.ts +407 -0
- package/src/library/useApplyResource.ts +211 -0
- package/src/library/useDetectSkillPackage.ts +91 -0
- package/src/library/useDetectStigmerResource.ts +45 -0
- package/src/library/useUpdateVisibility.ts +94 -0
- package/src/mcp-server/McpServerConfigPanel.tsx +265 -0
- package/src/mcp-server/McpServerDetailView.tsx +606 -0
- package/src/mcp-server/McpServerPicker.tsx +857 -0
- package/src/mcp-server/McpToolSelector.tsx +243 -0
- package/src/mcp-server/index.ts +44 -3
- package/src/mcp-server/mcpServerSetupReducer.ts +308 -0
- package/src/mcp-server/useMcpServer.ts +103 -0
- package/src/mcp-server/useMcpServerCount.ts +68 -0
- package/src/mcp-server/useMcpServerList.ts +84 -0
- package/src/mcp-server/useMcpServerSearch.ts +38 -0
- package/src/mcp-server/useMcpServerSetup.ts +487 -0
- package/src/models/ModelSelector.tsx +132 -0
- package/src/models/index.ts +6 -0
- package/src/models/registry.ts +60 -0
- package/src/models/useModelRegistry.ts +58 -0
- package/src/organization/CreateOrganizationForm.tsx +269 -0
- package/src/organization/index.ts +4 -0
- package/src/organization/useCreateOrganization.ts +65 -0
- package/src/search/index.ts +18 -0
- package/src/search/useResourceCount.ts +102 -0
- package/src/search/useResourceList.ts +128 -0
- package/src/search/useResourceSearch.ts +90 -0
- package/src/session/__tests__/group-sessions.test.ts +113 -0
- package/src/session/__tests__/useSessionConversation.test.tsx +305 -0
- package/src/session/group-sessions.ts +80 -0
- package/src/session/index.ts +33 -10
- package/src/session/useAgentRefFromSession.ts +94 -0
- package/src/session/useCreateSession.ts +142 -0
- package/src/session/useSession.ts +60 -0
- package/src/session/useSessionConversation.ts +515 -0
- package/src/session/useSessionExecutions.ts +77 -0
- package/src/session/useSessionList.ts +90 -0
- package/src/session/useUpdateSession.ts +54 -0
- package/src/skill/SkillDetailView.tsx +503 -0
- package/src/skill/SkillPicker.tsx +331 -0
- package/src/skill/index.ts +23 -3
- package/src/skill/useSkill.ts +105 -0
- package/src/skill/useSkillCount.ts +68 -0
- package/src/skill/useSkillList.ts +84 -0
- package/src/skill/useSkillSearch.ts +38 -0
- package/src/styles.css +2 -0
- package/src/workspace/FolderBrowser.tsx +568 -0
- package/src/workspace/WorkspaceEditor.tsx +480 -0
- package/src/workspace/WorkspaceSummary.tsx +109 -0
- package/src/workspace/index.ts +17 -0
- package/src/workspace/useFolderListing.ts +126 -0
- package/src/workspace/useWorkspaceEntries.ts +98 -0
- package/styles.css +1 -1
- package/workspace/FolderBrowser.d.ts +26 -0
- package/workspace/FolderBrowser.d.ts.map +1 -0
- package/workspace/FolderBrowser.js +179 -0
- package/workspace/FolderBrowser.js.map +1 -0
- package/workspace/WorkspaceEditor.d.ts +30 -0
- package/workspace/WorkspaceEditor.d.ts.map +1 -0
- package/workspace/WorkspaceEditor.js +116 -0
- package/workspace/WorkspaceEditor.js.map +1 -0
- package/workspace/WorkspaceSummary.d.ts +30 -0
- package/workspace/WorkspaceSummary.d.ts.map +1 -0
- package/workspace/WorkspaceSummary.js +53 -0
- package/workspace/WorkspaceSummary.js.map +1 -0
- package/workspace/index.d.ts +11 -0
- package/workspace/index.d.ts.map +1 -0
- package/workspace/index.js +6 -0
- package/workspace/index.js.map +1 -0
- package/workspace/useFolderListing.d.ts +35 -0
- package/workspace/useFolderListing.d.ts.map +1 -0
- package/workspace/useFolderListing.js +86 -0
- package/workspace/useFolderListing.js.map +1 -0
- package/workspace/useWorkspaceEntries.d.ts +28 -0
- package/workspace/useWorkspaceEntries.d.ts.map +1 -0
- package/workspace/useWorkspaceEntries.js +66 -0
- package/workspace/useWorkspaceEntries.js.map +1 -0
- package/agent/components/AgentCard.d.ts +0 -9
- package/agent/components/AgentCard.d.ts.map +0 -1
- package/agent/components/AgentCard.js +0 -26
- package/agent/components/AgentCard.js.map +0 -1
- package/agent/components/AgentOverview.d.ts +0 -7
- package/agent/components/AgentOverview.d.ts.map +0 -1
- package/agent/components/AgentOverview.js +0 -36
- package/agent/components/AgentOverview.js.map +0 -1
- package/agent/components/AgentPicker.d.ts +0 -17
- package/agent/components/AgentPicker.d.ts.map +0 -1
- package/agent/components/AgentPicker.js +0 -86
- package/agent/components/AgentPicker.js.map +0 -1
- package/agent/hooks/useAgentSearch.d.ts +0 -28
- package/agent/hooks/useAgentSearch.d.ts.map +0 -1
- package/agent/hooks/useAgentSearch.js +0 -63
- package/agent/hooks/useAgentSearch.js.map +0 -1
- package/agent-execution/components/ApprovalControls.d.ts +0 -10
- package/agent-execution/components/ApprovalControls.d.ts.map +0 -1
- package/agent-execution/components/ApprovalControls.js +0 -19
- package/agent-execution/components/ApprovalControls.js.map +0 -1
- package/agent-execution/components/ExecutionStatus.d.ts +0 -8
- package/agent-execution/components/ExecutionStatus.d.ts.map +0 -1
- package/agent-execution/components/ExecutionStatus.js +0 -14
- package/agent-execution/components/ExecutionStatus.js.map +0 -1
- package/agent-execution/components/ExecutionStream.d.ts +0 -16
- package/agent-execution/components/ExecutionStream.d.ts.map +0 -1
- package/agent-execution/components/ExecutionStream.js +0 -39
- package/agent-execution/components/ExecutionStream.js.map +0 -1
- package/agent-execution/components/MessageEntry.d.ts +0 -17
- package/agent-execution/components/MessageEntry.d.ts.map +0 -1
- package/agent-execution/components/MessageEntry.js +0 -36
- package/agent-execution/components/MessageEntry.js.map +0 -1
- package/agent-execution/components/MessageInput.d.ts +0 -10
- package/agent-execution/components/MessageInput.d.ts.map +0 -1
- package/agent-execution/components/MessageInput.js +0 -27
- package/agent-execution/components/MessageInput.js.map +0 -1
- package/agent-execution/components/OutputBlock.d.ts +0 -9
- package/agent-execution/components/OutputBlock.d.ts.map +0 -1
- package/agent-execution/components/OutputBlock.js +0 -15
- package/agent-execution/components/OutputBlock.js.map +0 -1
- package/agent-execution/components/SubAgentCard.d.ts +0 -11
- package/agent-execution/components/SubAgentCard.d.ts.map +0 -1
- package/agent-execution/components/SubAgentCard.js +0 -19
- package/agent-execution/components/SubAgentCard.js.map +0 -1
- package/agent-execution/components/ToolCallCard.d.ts +0 -11
- package/agent-execution/components/ToolCallCard.d.ts.map +0 -1
- package/agent-execution/components/ToolCallCard.js +0 -25
- package/agent-execution/components/ToolCallCard.js.map +0 -1
- package/agent-execution/helpers.d.ts +0 -35
- package/agent-execution/helpers.d.ts.map +0 -1
- package/agent-execution/helpers.js +0 -157
- package/agent-execution/helpers.js.map +0 -1
- package/agent-execution/hooks/useAgentExecution.d.ts +0 -21
- package/agent-execution/hooks/useAgentExecution.d.ts.map +0 -1
- package/agent-execution/hooks/useAgentExecution.js +0 -99
- package/agent-execution/hooks/useAgentExecution.js.map +0 -1
- package/agent-execution/hooks/useApproval.d.ts +0 -12
- package/agent-execution/hooks/useApproval.d.ts.map +0 -1
- package/agent-execution/hooks/useApproval.js +0 -32
- package/agent-execution/hooks/useApproval.js.map +0 -1
- package/agent-execution/index.d.ts +0 -14
- package/agent-execution/index.d.ts.map +0 -1
- package/agent-execution/index.js +0 -15
- package/agent-execution/index.js.map +0 -1
- package/catalog/components/ResourceSearchCard.d.ts +0 -23
- package/catalog/components/ResourceSearchCard.d.ts.map +0 -1
- package/catalog/components/ResourceSearchCard.js +0 -36
- package/catalog/components/ResourceSearchCard.js.map +0 -1
- package/catalog/index.d.ts +0 -4
- package/catalog/index.d.ts.map +0 -1
- package/catalog/index.js +0 -5
- package/catalog/index.js.map +0 -1
- package/catalog/internal/time.d.ts +0 -13
- package/catalog/internal/time.d.ts.map +0 -1
- package/catalog/internal/time.js +0 -41
- package/catalog/internal/time.js.map +0 -1
- package/internal/badge.d.ts +0 -8
- package/internal/badge.d.ts.map +0 -1
- package/internal/badge.js +0 -34
- package/internal/badge.js.map +0 -1
- package/internal/button.d.ts +0 -9
- package/internal/button.d.ts.map +0 -1
- package/internal/button.js +0 -36
- package/internal/button.js.map +0 -1
- package/internal/collapsible.d.ts +0 -6
- package/internal/collapsible.d.ts.map +0 -1
- package/internal/collapsible.js +0 -14
- package/internal/collapsible.js.map +0 -1
- package/internal/section.d.ts +0 -8
- package/internal/section.d.ts.map +0 -1
- package/internal/section.js +0 -6
- package/internal/section.js.map +0 -1
- package/internal/textarea.d.ts +0 -4
- package/internal/textarea.d.ts.map +0 -1
- package/internal/textarea.js +0 -9
- package/internal/textarea.js.map +0 -1
- package/mcp-server/hooks/useMcpServerSearch.d.ts +0 -25
- package/mcp-server/hooks/useMcpServerSearch.d.ts.map +0 -1
- package/mcp-server/hooks/useMcpServerSearch.js +0 -57
- package/mcp-server/hooks/useMcpServerSearch.js.map +0 -1
- package/session/components/AgentSessionHistory.d.ts +0 -8
- package/session/components/AgentSessionHistory.d.ts.map +0 -1
- package/session/components/AgentSessionHistory.js +0 -11
- package/session/components/AgentSessionHistory.js.map +0 -1
- package/session/components/SessionCard.d.ts +0 -8
- package/session/components/SessionCard.d.ts.map +0 -1
- package/session/components/SessionCard.js +0 -57
- package/session/components/SessionCard.js.map +0 -1
- package/session/hooks/useAgentSessionList.d.ts +0 -21
- package/session/hooks/useAgentSessionList.d.ts.map +0 -1
- package/session/hooks/useAgentSessionList.js +0 -90
- package/session/hooks/useAgentSessionList.js.map +0 -1
- package/skill/hooks/useSkillSearch.d.ts +0 -25
- package/skill/hooks/useSkillSearch.d.ts.map +0 -1
- package/skill/hooks/useSkillSearch.js +0 -57
- package/skill/hooks/useSkillSearch.js.map +0 -1
- package/src/agent/components/AgentCard.tsx +0 -125
- package/src/agent/components/AgentOverview.tsx +0 -209
- package/src/agent/components/AgentPicker.tsx +0 -255
- package/src/agent/hooks/useAgentSearch.ts +0 -94
- package/src/agent-execution/components/ApprovalControls.tsx +0 -99
- package/src/agent-execution/components/ExecutionStatus.tsx +0 -33
- package/src/agent-execution/components/ExecutionStream.tsx +0 -148
- package/src/agent-execution/components/MessageEntry.tsx +0 -125
- package/src/agent-execution/components/MessageInput.tsx +0 -70
- package/src/agent-execution/components/OutputBlock.tsx +0 -43
- package/src/agent-execution/components/SubAgentCard.tsx +0 -138
- package/src/agent-execution/components/ToolCallCard.tsx +0 -153
- package/src/agent-execution/helpers.ts +0 -193
- package/src/agent-execution/hooks/useAgentExecution.ts +0 -147
- package/src/agent-execution/hooks/useApproval.ts +0 -56
- package/src/agent-execution/index.ts +0 -46
- package/src/catalog/components/ResourceSearchCard.tsx +0 -137
- package/src/catalog/index.ts +0 -6
- package/src/catalog/internal/time.ts +0 -40
- package/src/internal/badge.tsx +0 -52
- package/src/internal/button.tsx +0 -60
- package/src/internal/collapsible.tsx +0 -21
- package/src/internal/section.tsx +0 -18
- package/src/internal/textarea.tsx +0 -23
- package/src/mcp-server/hooks/useMcpServerSearch.ts +0 -79
- package/src/session/components/AgentSessionHistory.tsx +0 -109
- package/src/session/components/SessionCard.tsx +0 -113
- package/src/session/hooks/useAgentSessionList.ts +0 -117
- package/src/skill/hooks/useSkillSearch.ts +0 -79
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type ResourceListScope } from "../search";
|
|
2
|
+
export interface UseAgentCountOptions {
|
|
3
|
+
/** Text query to filter agents before counting. */
|
|
4
|
+
readonly query?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Controls which agents are counted.
|
|
7
|
+
*
|
|
8
|
+
* - `"org"` — only agents owned by the given organization.
|
|
9
|
+
* - `"all"` — includes public/platform agents (e.g. `stigmer/agent-creator`).
|
|
10
|
+
*
|
|
11
|
+
* @default "org"
|
|
12
|
+
*/
|
|
13
|
+
readonly scope?: ResourceListScope;
|
|
14
|
+
}
|
|
15
|
+
export interface UseAgentCountReturn {
|
|
16
|
+
/**
|
|
17
|
+
* Total number of agents matching the current filters. `undefined`
|
|
18
|
+
* until the first successful fetch completes.
|
|
19
|
+
*/
|
|
20
|
+
readonly count: number | undefined;
|
|
21
|
+
readonly isLoading: boolean;
|
|
22
|
+
readonly error: string | null;
|
|
23
|
+
/** Re-fetch the count with the same parameters. */
|
|
24
|
+
readonly refetch: () => void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Data hook that fetches the total count of agents.
|
|
28
|
+
*
|
|
29
|
+
* Issues a minimal `stigmer.agent.list()` call to retrieve only the
|
|
30
|
+
* total count — no agent entries are returned or stored. Useful for
|
|
31
|
+
* summary cards, badges, and dashboard widgets.
|
|
32
|
+
*
|
|
33
|
+
* For the full paginated agent list, use {@link useAgentList} instead.
|
|
34
|
+
*
|
|
35
|
+
* Pass `null` as `org` to skip fetching (stable no-op).
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* const { count, isLoading } = useAgentCount("acme");
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* // Count all accessible agents including public/platform ones
|
|
45
|
+
* const { count } = useAgentCount("acme", { scope: "all" });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare function useAgentCount(org: string | null, options?: UseAgentCountOptions): UseAgentCountReturn;
|
|
49
|
+
//# sourceMappingURL=useAgentCount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgentCount.d.ts","sourceRoot":"","sources":["../../src/agent/useAgentCount.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAErE,MAAM,WAAW,oBAAoB;IACnC,mDAAmD;IACnD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC;CACpC;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,GAAG,IAAI,EAClB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,mBAAmB,CAUrB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { useStigmer } from "../hooks";
|
|
4
|
+
import { useResourceCount } from "../search";
|
|
5
|
+
/**
|
|
6
|
+
* Data hook that fetches the total count of agents.
|
|
7
|
+
*
|
|
8
|
+
* Issues a minimal `stigmer.agent.list()` call to retrieve only the
|
|
9
|
+
* total count — no agent entries are returned or stored. Useful for
|
|
10
|
+
* summary cards, badges, and dashboard widgets.
|
|
11
|
+
*
|
|
12
|
+
* For the full paginated agent list, use {@link useAgentList} instead.
|
|
13
|
+
*
|
|
14
|
+
* Pass `null` as `org` to skip fetching (stable no-op).
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const { count, isLoading } = useAgentCount("acme");
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* // Count all accessible agents including public/platform ones
|
|
24
|
+
* const { count } = useAgentCount("acme", { scope: "all" });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export function useAgentCount(org, options) {
|
|
28
|
+
const stigmer = useStigmer();
|
|
29
|
+
const listFn = useCallback((params) => stigmer.agent.list(params), [stigmer]);
|
|
30
|
+
return useResourceCount(listFn, org, options);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=useAgentCount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgentCount.js","sourceRoot":"","sources":["../../src/agent/useAgentCount.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAA0B,MAAM,WAAW,CAAC;AA4BrE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,aAAa,CAC3B,GAAkB,EAClB,OAA8B;IAE9B,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAE7B,MAAM,MAAM,GAAG,WAAW,CACxB,CAAC,MAAgD,EAAE,EAAE,CACnD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAC5B,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { SearchResult } from "@stigmer/protos/ai/stigmer/search/v1/io_pb";
|
|
2
|
+
import { type ResourceListScope } from "../search";
|
|
3
|
+
export interface UseAgentListOptions {
|
|
4
|
+
/** Maximum agents per page. @default 20 */
|
|
5
|
+
readonly pageSize?: number;
|
|
6
|
+
/** Page number (1-indexed). @default 1 */
|
|
7
|
+
readonly page?: number;
|
|
8
|
+
/** Text query to filter agents by name, description, or tags. */
|
|
9
|
+
readonly query?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Controls which agents are visible.
|
|
12
|
+
*
|
|
13
|
+
* - `"org"` — only agents owned by the given organization.
|
|
14
|
+
* - `"all"` — includes public/platform agents (e.g. `stigmer/agent-creator`).
|
|
15
|
+
*
|
|
16
|
+
* @default "org"
|
|
17
|
+
*/
|
|
18
|
+
readonly scope?: ResourceListScope;
|
|
19
|
+
}
|
|
20
|
+
export interface UseAgentListReturn {
|
|
21
|
+
/** Paginated agent entries for the current page. */
|
|
22
|
+
readonly agents: readonly SearchResult[];
|
|
23
|
+
/** Total number of agents matching the current filters. */
|
|
24
|
+
readonly totalCount: number;
|
|
25
|
+
/** Total pages available at the current page size. */
|
|
26
|
+
readonly totalPages: number;
|
|
27
|
+
/** The current page number (mirrors the `page` option). */
|
|
28
|
+
readonly currentPage: number;
|
|
29
|
+
readonly isLoading: boolean;
|
|
30
|
+
readonly error: string | null;
|
|
31
|
+
/** Re-fetch the current page with the same parameters. */
|
|
32
|
+
readonly refetch: () => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Data hook that fetches a paginated list of agents for the Library.
|
|
36
|
+
*
|
|
37
|
+
* Wraps `stigmer.agent.list()` with pagination, scope filtering,
|
|
38
|
+
* and text search. All parameters are externally controlled — the
|
|
39
|
+
* consumer manages page state, query debouncing, and scope toggling.
|
|
40
|
+
*
|
|
41
|
+
* For picker/type-ahead search with internal debouncing and query
|
|
42
|
+
* state management, use {@link useAgentSearch} instead.
|
|
43
|
+
*
|
|
44
|
+
* Pass `null` as `org` to skip fetching (stable no-op).
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* const { agents, totalCount, isLoading } = useAgentList("acme", {
|
|
49
|
+
* page: 1,
|
|
50
|
+
* pageSize: 20,
|
|
51
|
+
* scope: "org",
|
|
52
|
+
* });
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* // Show all agents including public/platform ones
|
|
58
|
+
* const { agents } = useAgentList("acme", { scope: "all" });
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function useAgentList(org: string | null, options?: UseAgentListOptions): UseAgentListReturn;
|
|
62
|
+
//# sourceMappingURL=useAgentList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgentList.d.ts","sourceRoot":"","sources":["../../src/agent/useAgentList.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAE/E,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEpE,MAAM,WAAW,mBAAmB;IAClC,2CAA2C;IAC3C,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,iEAAiE;IACjE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC;CACpC;AAED,MAAM,WAAW,kBAAkB;IACjC,oDAAoD;IACpD,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;IACzC,2DAA2D;IAC3D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,sDAAsD;IACtD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,2DAA2D;IAC3D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,GAAG,IAAI,EAClB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,kBAAkB,CAapB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { useStigmer } from "../hooks";
|
|
4
|
+
import { useResourceList } from "../search";
|
|
5
|
+
/**
|
|
6
|
+
* Data hook that fetches a paginated list of agents for the Library.
|
|
7
|
+
*
|
|
8
|
+
* Wraps `stigmer.agent.list()` with pagination, scope filtering,
|
|
9
|
+
* and text search. All parameters are externally controlled — the
|
|
10
|
+
* consumer manages page state, query debouncing, and scope toggling.
|
|
11
|
+
*
|
|
12
|
+
* For picker/type-ahead search with internal debouncing and query
|
|
13
|
+
* state management, use {@link useAgentSearch} instead.
|
|
14
|
+
*
|
|
15
|
+
* Pass `null` as `org` to skip fetching (stable no-op).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const { agents, totalCount, isLoading } = useAgentList("acme", {
|
|
20
|
+
* page: 1,
|
|
21
|
+
* pageSize: 20,
|
|
22
|
+
* scope: "org",
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* // Show all agents including public/platform ones
|
|
29
|
+
* const { agents } = useAgentList("acme", { scope: "all" });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export function useAgentList(org, options) {
|
|
33
|
+
const stigmer = useStigmer();
|
|
34
|
+
const listFn = useCallback((params) => stigmer.agent.list(params), [stigmer]);
|
|
35
|
+
const { entries, totalCount, totalPages, currentPage, isLoading, error, refetch } = useResourceList(listFn, org, options);
|
|
36
|
+
return { agents: entries, totalCount, totalPages, currentPage, isLoading, error, refetch };
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=useAgentList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgentList.js","sourceRoot":"","sources":["../../src/agent/useAgentList.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,eAAe,EAA0B,MAAM,WAAW,CAAC;AAmCpE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,YAAY,CAC1B,GAAkB,EAClB,OAA6B;IAE7B,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAE7B,MAAM,MAAM,GAAG,WAAW,CACxB,CAAC,MAAgD,EAAE,EAAE,CACnD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAC5B,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,GAC/E,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAExC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC7F,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type UseResourceSearchOptions, type UseResourceSearchReturn } from "../search";
|
|
2
|
+
export type UseAgentSearchOptions = UseResourceSearchOptions;
|
|
3
|
+
export type UseAgentSearchReturn = UseResourceSearchReturn;
|
|
4
|
+
/**
|
|
5
|
+
* Data hook that searches agents available in the given organization.
|
|
6
|
+
*
|
|
7
|
+
* Wraps `stigmer.agent.list()` with debounced search, loading/error
|
|
8
|
+
* tracking, and cancellation-safe fetching. Platform builders use this
|
|
9
|
+
* when they want full control over rendering; the {@link AgentPicker}
|
|
10
|
+
* styled component uses it internally.
|
|
11
|
+
*
|
|
12
|
+
* This is a Layer 1 building-block hook used by both platform builders
|
|
13
|
+
* (Profile A) and direct Stigmer users (Profile B). Platform builders
|
|
14
|
+
* can use it standalone to build custom agent selection UIs. The
|
|
15
|
+
* Stigmer Console composes it via higher-level orchestration hooks.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const { results, isLoading, query, setQuery } = useAgentSearch("acme");
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useAgentSearch(org: string, options?: UseAgentSearchOptions): UseAgentSearchReturn;
|
|
23
|
+
//# sourceMappingURL=useAgentSearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgentSearch.d.ts","sourceRoot":"","sources":["../../src/agent/useAgentSearch.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC7B,MAAM,WAAW,CAAC;AAEnB,MAAM,MAAM,qBAAqB,GAAG,wBAAwB,CAAC;AAC7D,MAAM,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAE3D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,qBAAqB,GAC9B,oBAAoB,CAQtB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { useStigmer } from "../hooks";
|
|
4
|
+
import { useResourceSearch, } from "../search";
|
|
5
|
+
/**
|
|
6
|
+
* Data hook that searches agents available in the given organization.
|
|
7
|
+
*
|
|
8
|
+
* Wraps `stigmer.agent.list()` with debounced search, loading/error
|
|
9
|
+
* tracking, and cancellation-safe fetching. Platform builders use this
|
|
10
|
+
* when they want full control over rendering; the {@link AgentPicker}
|
|
11
|
+
* styled component uses it internally.
|
|
12
|
+
*
|
|
13
|
+
* This is a Layer 1 building-block hook used by both platform builders
|
|
14
|
+
* (Profile A) and direct Stigmer users (Profile B). Platform builders
|
|
15
|
+
* can use it standalone to build custom agent selection UIs. The
|
|
16
|
+
* Stigmer Console composes it via higher-level orchestration hooks.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* const { results, isLoading, query, setQuery } = useAgentSearch("acme");
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export function useAgentSearch(org, options) {
|
|
24
|
+
const stigmer = useStigmer();
|
|
25
|
+
const listFn = useCallback((params) => stigmer.agent.list(params), [stigmer]);
|
|
26
|
+
return useResourceSearch(listFn, org, options);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=useAgentSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgentSearch.js","sourceRoot":"","sources":["../../src/agent/useAgentSearch.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EACL,iBAAiB,GAGlB,MAAM,WAAW,CAAC;AAKnB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,cAAc,CAC5B,GAAW,EACX,OAA+B;IAE/B,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,WAAW,CACxB,CAAC,MAAgD,EAAE,EAAE,CACnD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAC5B,CAAC,OAAO,CAAC,CACV,CAAC;IACF,OAAO,iBAAiB,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { EnvVarInput, ResourceRef } from "@stigmer/sdk";
|
|
2
|
+
import { type AgentSetupResult, type AgentSetupReadyResult, type AgentSetupState } from "./agentSetupReducer";
|
|
3
|
+
export type { AgentResolution, AgentSetupResult, AgentSetupReadyResult, AgentSetupState, AgentSetupPhase, } from "./agentSetupReducer";
|
|
4
|
+
export interface SubmitEnvVarsOptions {
|
|
5
|
+
/**
|
|
6
|
+
* When `true` (default), the provided values are saved to the user's
|
|
7
|
+
* personal environment and a personal agent instance is created.
|
|
8
|
+
* Subsequent runs of the same agent will reuse these credentials.
|
|
9
|
+
*
|
|
10
|
+
* When `false`, the values are collected as `runtimeEnv` for this
|
|
11
|
+
* execution only — no data is persisted and no agent instance is
|
|
12
|
+
* created. This path is instant (no network calls).
|
|
13
|
+
*
|
|
14
|
+
* @default true
|
|
15
|
+
*/
|
|
16
|
+
readonly saveForFuture?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface UseAgentSetupReturn {
|
|
19
|
+
/**
|
|
20
|
+
* Current state of the agent setup flow.
|
|
21
|
+
*
|
|
22
|
+
* A discriminated union on `status`:
|
|
23
|
+
* - `"idle"` — no agent selected
|
|
24
|
+
* - `"resolving"` — evaluating an agent's requirements
|
|
25
|
+
* - `"needsEnvVars"` — waiting for user to provide missing variables
|
|
26
|
+
* - `"submitting"` — saving environment / creating instance
|
|
27
|
+
* - `"ready"` — agent resolved, `resolution` describes how to proceed
|
|
28
|
+
*
|
|
29
|
+
* `error` is available on all variants (orthogonal to phase).
|
|
30
|
+
*/
|
|
31
|
+
readonly state: AgentSetupState;
|
|
32
|
+
/**
|
|
33
|
+
* Evaluate whether an agent is ready to use or needs env var collection.
|
|
34
|
+
*
|
|
35
|
+
* Fetches the full agent to read its `env_spec`, checks for an existing
|
|
36
|
+
* personal instance, and diffs env_spec keys against the personal
|
|
37
|
+
* environment. Returns `"ready"` when the agent can be used immediately,
|
|
38
|
+
* or `"needsEnvVars"` when the caller should present {@link AgentEnvForm}.
|
|
39
|
+
*/
|
|
40
|
+
readonly resolveAgent: (ref: ResourceRef) => Promise<AgentSetupResult>;
|
|
41
|
+
/**
|
|
42
|
+
* Complete the env var collection flow for the pending agent.
|
|
43
|
+
*
|
|
44
|
+
* Behavior depends on `options.saveForFuture`:
|
|
45
|
+
* - `true` (default) — Creates or updates the personal environment
|
|
46
|
+
* with the provided values, then creates a personal agent instance.
|
|
47
|
+
* Returns `{ resolution: { mode: "saved", instanceId } }`.
|
|
48
|
+
* - `false` — Collects values as `runtimeEnv` without any API calls.
|
|
49
|
+
* Returns `{ resolution: { mode: "oneTime", runtimeEnv } }`.
|
|
50
|
+
*
|
|
51
|
+
* Must only be called when `state.status === "needsEnvVars"`.
|
|
52
|
+
*/
|
|
53
|
+
readonly submitEnvVars: (values: Record<string, EnvVarInput>, options?: SubmitEnvVarsOptions) => Promise<AgentSetupReadyResult>;
|
|
54
|
+
/** Clear the error without changing the current phase. */
|
|
55
|
+
readonly clearError: () => void;
|
|
56
|
+
/** Reset to `idle` state, clearing all phase data and errors. */
|
|
57
|
+
readonly reset: () => void;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Layer 2 behavior hook that encapsulates the agent selection,
|
|
61
|
+
* personal environment resolution, and secret delivery routing flow.
|
|
62
|
+
*
|
|
63
|
+
* When a user picks an agent in the {@link AgentPicker}, this hook
|
|
64
|
+
* determines whether the agent requires credentials (via its
|
|
65
|
+
* `env_spec`), checks what the user has already provided in their
|
|
66
|
+
* personal environment, and either reports the agent as ready or
|
|
67
|
+
* identifies the missing variables so the caller can render
|
|
68
|
+
* {@link AgentEnvForm}.
|
|
69
|
+
*
|
|
70
|
+
* The hook supports two secret delivery paths via the `saveForFuture`
|
|
71
|
+
* option on {@link submitEnvVars}:
|
|
72
|
+
* - **Saved** — secrets are persisted to the personal environment and
|
|
73
|
+
* a personal agent instance is created for reuse.
|
|
74
|
+
* - **One-time** — secrets are returned as `runtimeEnv` for a single
|
|
75
|
+
* execution, with no data persisted.
|
|
76
|
+
*
|
|
77
|
+
* State is managed by a `useReducer` state machine with five phases:
|
|
78
|
+
* `idle → resolving → needsEnvVars → submitting → ready`.
|
|
79
|
+
*
|
|
80
|
+
* Composes {@link usePersonalEnvironment} for personal environment
|
|
81
|
+
* operations and calls the Stigmer client directly for agent and
|
|
82
|
+
* agent instance queries.
|
|
83
|
+
*
|
|
84
|
+
* > **Why not compose `usePersonalAgentInstance`?**
|
|
85
|
+
* > `resolveAgent` is an imperative async callback that needs
|
|
86
|
+
* > immediate results within a single invocation. Hook state
|
|
87
|
+
* > updates require a render cycle. Instance creation is delegated
|
|
88
|
+
* > through the shared `buildPersonalInstanceInput` helper instead.
|
|
89
|
+
*
|
|
90
|
+
* Pass `null` as `org` to disable all operations (stable no-op).
|
|
91
|
+
*
|
|
92
|
+
* @param org - Organization slug. Pass `null` to disable.
|
|
93
|
+
* @param poolKeys - Optional set of env-var keys already available
|
|
94
|
+
* from the session env pool (manual secrets, one-time env vars from
|
|
95
|
+
* other components). When provided, agents whose `env_spec` keys
|
|
96
|
+
* are fully covered by `poolKeys` + personal env auto-resolve to
|
|
97
|
+
* `ready` without prompting. Reactive — when `poolKeys` changes,
|
|
98
|
+
* `needsEnvVars` is re-evaluated.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```tsx
|
|
102
|
+
* const { state, resolveAgent, submitEnvVars } = useAgentSetup("acme", pool.availableKeys);
|
|
103
|
+
*
|
|
104
|
+
* const result = await resolveAgent({ org: "acme", slug: "code-reviewer" });
|
|
105
|
+
*
|
|
106
|
+
* if (result.status === "needsEnvVars") {
|
|
107
|
+
* // Render AgentEnvForm with result.missingVariables
|
|
108
|
+
* // On form submit:
|
|
109
|
+
* const ready = await submitEnvVars(formValues, { saveForFuture: true });
|
|
110
|
+
* // ready.resolution.mode === "saved" | "oneTime"
|
|
111
|
+
* }
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
export declare function useAgentSetup(org: string | null, poolKeys?: Set<string>): UseAgentSetupReturn;
|
|
115
|
+
//# sourceMappingURL=useAgentSetup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgentSetup.d.ts","sourceRoot":"","sources":["../../src/agent/useAgentSetup.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAW,MAAM,cAAc,CAAC;AAStE,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAC;AA6C7B,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAEhC;;;;;;;OAOG;IACH,QAAQ,CAAC,YAAY,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEvE;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,aAAa,EAAE,CACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EACnC,OAAO,CAAC,EAAE,oBAAoB,KAC3B,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAEpC,0DAA0D;IAC1D,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;IAEhC,iEAAiE;IACjE,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,GAAG,IAAI,EAClB,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GACrB,mBAAmB,CA8OrB"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useEffect, useReducer } from "react";
|
|
3
|
+
import { create } from "@bufbuild/protobuf";
|
|
4
|
+
import { ListAgentInstancesRequestSchema } from "@stigmer/protos/ai/stigmer/agentic/agentinstance/v1/io_pb";
|
|
5
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
6
|
+
import { useStigmer } from "../hooks";
|
|
7
|
+
import { toError } from "../internal/toError";
|
|
8
|
+
import { usePersonalEnvironment } from "../environment/usePersonalEnvironment";
|
|
9
|
+
import { buildPersonalInstanceInput } from "../agent-instance/buildPersonalInstanceInput";
|
|
10
|
+
import { diffEnvSpec } from "../environment/diffEnvSpec";
|
|
11
|
+
import { agentSetupReducer, INITIAL_STATE, } from "./agentSetupReducer";
|
|
12
|
+
const PERSONAL_LABEL = "stigmer.ai/personal";
|
|
13
|
+
const FOR_AGENT_LABEL = "stigmer.ai/for-agent";
|
|
14
|
+
/**
|
|
15
|
+
* Re-checks for an existing personal instance immediately before
|
|
16
|
+
* creating one. Narrows the race window when multiple clients
|
|
17
|
+
* (tabs, double-clicks) attempt to create simultaneously.
|
|
18
|
+
*/
|
|
19
|
+
async function findOrCreatePersonalInstance(stigmer, params) {
|
|
20
|
+
const { org, agentId, agentSlug, agentLabel, environmentRef } = params;
|
|
21
|
+
const recheck = await stigmer.agentInstance.list(create(ListAgentInstancesRequestSchema, {
|
|
22
|
+
org,
|
|
23
|
+
labels: {
|
|
24
|
+
[PERSONAL_LABEL]: "true",
|
|
25
|
+
[FOR_AGENT_LABEL]: agentLabel,
|
|
26
|
+
},
|
|
27
|
+
}));
|
|
28
|
+
if (recheck.items.length > 0) {
|
|
29
|
+
return recheck.items[0];
|
|
30
|
+
}
|
|
31
|
+
return stigmer.agentInstance.create(buildPersonalInstanceInput({ org, agentId, agentSlug, environmentRef }));
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Layer 2 behavior hook that encapsulates the agent selection,
|
|
35
|
+
* personal environment resolution, and secret delivery routing flow.
|
|
36
|
+
*
|
|
37
|
+
* When a user picks an agent in the {@link AgentPicker}, this hook
|
|
38
|
+
* determines whether the agent requires credentials (via its
|
|
39
|
+
* `env_spec`), checks what the user has already provided in their
|
|
40
|
+
* personal environment, and either reports the agent as ready or
|
|
41
|
+
* identifies the missing variables so the caller can render
|
|
42
|
+
* {@link AgentEnvForm}.
|
|
43
|
+
*
|
|
44
|
+
* The hook supports two secret delivery paths via the `saveForFuture`
|
|
45
|
+
* option on {@link submitEnvVars}:
|
|
46
|
+
* - **Saved** — secrets are persisted to the personal environment and
|
|
47
|
+
* a personal agent instance is created for reuse.
|
|
48
|
+
* - **One-time** — secrets are returned as `runtimeEnv` for a single
|
|
49
|
+
* execution, with no data persisted.
|
|
50
|
+
*
|
|
51
|
+
* State is managed by a `useReducer` state machine with five phases:
|
|
52
|
+
* `idle → resolving → needsEnvVars → submitting → ready`.
|
|
53
|
+
*
|
|
54
|
+
* Composes {@link usePersonalEnvironment} for personal environment
|
|
55
|
+
* operations and calls the Stigmer client directly for agent and
|
|
56
|
+
* agent instance queries.
|
|
57
|
+
*
|
|
58
|
+
* > **Why not compose `usePersonalAgentInstance`?**
|
|
59
|
+
* > `resolveAgent` is an imperative async callback that needs
|
|
60
|
+
* > immediate results within a single invocation. Hook state
|
|
61
|
+
* > updates require a render cycle. Instance creation is delegated
|
|
62
|
+
* > through the shared `buildPersonalInstanceInput` helper instead.
|
|
63
|
+
*
|
|
64
|
+
* Pass `null` as `org` to disable all operations (stable no-op).
|
|
65
|
+
*
|
|
66
|
+
* @param org - Organization slug. Pass `null` to disable.
|
|
67
|
+
* @param poolKeys - Optional set of env-var keys already available
|
|
68
|
+
* from the session env pool (manual secrets, one-time env vars from
|
|
69
|
+
* other components). When provided, agents whose `env_spec` keys
|
|
70
|
+
* are fully covered by `poolKeys` + personal env auto-resolve to
|
|
71
|
+
* `ready` without prompting. Reactive — when `poolKeys` changes,
|
|
72
|
+
* `needsEnvVars` is re-evaluated.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* const { state, resolveAgent, submitEnvVars } = useAgentSetup("acme", pool.availableKeys);
|
|
77
|
+
*
|
|
78
|
+
* const result = await resolveAgent({ org: "acme", slug: "code-reviewer" });
|
|
79
|
+
*
|
|
80
|
+
* if (result.status === "needsEnvVars") {
|
|
81
|
+
* // Render AgentEnvForm with result.missingVariables
|
|
82
|
+
* // On form submit:
|
|
83
|
+
* const ready = await submitEnvVars(formValues, { saveForFuture: true });
|
|
84
|
+
* // ready.resolution.mode === "saved" | "oneTime"
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export function useAgentSetup(org, poolKeys) {
|
|
89
|
+
const stigmer = useStigmer();
|
|
90
|
+
const personalEnv = usePersonalEnvironment(org);
|
|
91
|
+
const [state, dispatch] = useReducer(agentSetupReducer, INITIAL_STATE);
|
|
92
|
+
const clearError = useCallback(() => dispatch({ type: "CLEAR_ERROR" }), []);
|
|
93
|
+
const reset = useCallback(() => dispatch({ type: "RESET" }), []);
|
|
94
|
+
// -------------------------------------------------------------------------
|
|
95
|
+
// resolveAgent
|
|
96
|
+
// -------------------------------------------------------------------------
|
|
97
|
+
const resolveAgent = useCallback(async (ref) => {
|
|
98
|
+
if (!org) {
|
|
99
|
+
throw new Error("useAgentSetup: cannot resolve agent when org is null.");
|
|
100
|
+
}
|
|
101
|
+
dispatch({ type: "RESOLVE_START", agentRef: ref });
|
|
102
|
+
try {
|
|
103
|
+
const agent = await stigmer.agent.getByReference(ref);
|
|
104
|
+
const agentName = agent.metadata?.name ?? ref.slug;
|
|
105
|
+
const envSpecData = agent.spec?.envSpec?.data;
|
|
106
|
+
// No env_spec — agent is immediately ready (direct mode).
|
|
107
|
+
if (!envSpecData || Object.keys(envSpecData).length === 0) {
|
|
108
|
+
const resolution = { mode: "direct" };
|
|
109
|
+
dispatch({
|
|
110
|
+
type: "RESOLVE_READY",
|
|
111
|
+
agentRef: ref,
|
|
112
|
+
agentName,
|
|
113
|
+
resolution,
|
|
114
|
+
});
|
|
115
|
+
return { status: "ready", agentRef: ref, agentName, resolution };
|
|
116
|
+
}
|
|
117
|
+
// Agent has env_spec — check for existing personal instance.
|
|
118
|
+
const agentLabel = `${ref.org}/${ref.slug}`;
|
|
119
|
+
const instanceList = await stigmer.agentInstance.list(create(ListAgentInstancesRequestSchema, {
|
|
120
|
+
org,
|
|
121
|
+
labels: {
|
|
122
|
+
[PERSONAL_LABEL]: "true",
|
|
123
|
+
[FOR_AGENT_LABEL]: agentLabel,
|
|
124
|
+
},
|
|
125
|
+
}));
|
|
126
|
+
if (instanceList.items.length > 0) {
|
|
127
|
+
const resolution = {
|
|
128
|
+
mode: "saved",
|
|
129
|
+
instanceId: instanceList.items[0].metadata.id,
|
|
130
|
+
};
|
|
131
|
+
dispatch({
|
|
132
|
+
type: "RESOLVE_READY",
|
|
133
|
+
agentRef: ref,
|
|
134
|
+
agentName,
|
|
135
|
+
resolution,
|
|
136
|
+
});
|
|
137
|
+
return { status: "ready", agentRef: ref, agentName, resolution };
|
|
138
|
+
}
|
|
139
|
+
// No personal instance — diff against existing env keys + pool.
|
|
140
|
+
const existingKeys = new Set(Object.keys(personalEnv.environment?.spec?.data ?? {}));
|
|
141
|
+
const personalOnlyMissing = diffEnvSpec(envSpecData, existingKeys);
|
|
142
|
+
const missingVariables = diffEnvSpec(envSpecData, existingKeys, poolKeys);
|
|
143
|
+
if (personalOnlyMissing.length === 0) {
|
|
144
|
+
// Personal env covers all keys — create personal instance.
|
|
145
|
+
const env = await personalEnv.getOrCreate();
|
|
146
|
+
const envRef = {
|
|
147
|
+
org,
|
|
148
|
+
slug: env.metadata.slug,
|
|
149
|
+
kind: ApiResourceKind.environment,
|
|
150
|
+
};
|
|
151
|
+
const instance = await findOrCreatePersonalInstance(stigmer, {
|
|
152
|
+
org,
|
|
153
|
+
agentId: agent.metadata.id,
|
|
154
|
+
agentSlug: ref.slug,
|
|
155
|
+
agentLabel,
|
|
156
|
+
environmentRef: envRef,
|
|
157
|
+
});
|
|
158
|
+
const resolution = {
|
|
159
|
+
mode: "saved",
|
|
160
|
+
instanceId: instance.metadata.id,
|
|
161
|
+
};
|
|
162
|
+
dispatch({
|
|
163
|
+
type: "RESOLVE_READY",
|
|
164
|
+
agentRef: ref,
|
|
165
|
+
agentName,
|
|
166
|
+
resolution,
|
|
167
|
+
});
|
|
168
|
+
return { status: "ready", agentRef: ref, agentName, resolution };
|
|
169
|
+
}
|
|
170
|
+
if (missingVariables.length === 0) {
|
|
171
|
+
// Pool covers remaining keys — use default instance, pool
|
|
172
|
+
// values flow via sessionVariables.toRuntimeEnv() at submit.
|
|
173
|
+
const resolution = { mode: "direct" };
|
|
174
|
+
dispatch({
|
|
175
|
+
type: "RESOLVE_READY",
|
|
176
|
+
agentRef: ref,
|
|
177
|
+
agentName,
|
|
178
|
+
resolution,
|
|
179
|
+
});
|
|
180
|
+
return { status: "ready", agentRef: ref, agentName, resolution };
|
|
181
|
+
}
|
|
182
|
+
// Missing variables — transition to needsEnvVars.
|
|
183
|
+
dispatch({
|
|
184
|
+
type: "RESOLVE_NEEDS_ENV",
|
|
185
|
+
agentRef: ref,
|
|
186
|
+
agentId: agent.metadata.id,
|
|
187
|
+
agentName,
|
|
188
|
+
missingVariables,
|
|
189
|
+
});
|
|
190
|
+
return {
|
|
191
|
+
status: "needsEnvVars",
|
|
192
|
+
agentRef: ref,
|
|
193
|
+
agentName,
|
|
194
|
+
missingVariables,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
catch (err) {
|
|
198
|
+
dispatch({ type: "ERROR", error: toError(err) });
|
|
199
|
+
throw err;
|
|
200
|
+
}
|
|
201
|
+
}, [org, stigmer, personalEnv, poolKeys]);
|
|
202
|
+
// -------------------------------------------------------------------------
|
|
203
|
+
// Pool re-evaluation — auto-resolve needsEnvVars when pool changes
|
|
204
|
+
// -------------------------------------------------------------------------
|
|
205
|
+
const agentMissingVars = state.status === "needsEnvVars" ? state.missingVariables : null;
|
|
206
|
+
useEffect(() => {
|
|
207
|
+
if (!poolKeys || poolKeys.size === 0)
|
|
208
|
+
return;
|
|
209
|
+
if (!agentMissingVars)
|
|
210
|
+
return;
|
|
211
|
+
const stillMissing = agentMissingVars.filter((v) => !poolKeys.has(v.key));
|
|
212
|
+
dispatch({ type: "POOL_RESOLVE", missingVariables: stillMissing });
|
|
213
|
+
}, [poolKeys, agentMissingVars]);
|
|
214
|
+
// -------------------------------------------------------------------------
|
|
215
|
+
// submitEnvVars
|
|
216
|
+
// -------------------------------------------------------------------------
|
|
217
|
+
const submitEnvVars = useCallback(async (values, options) => {
|
|
218
|
+
if (state.status !== "needsEnvVars") {
|
|
219
|
+
throw new Error("useAgentSetup: submitEnvVars requires state.status === 'needsEnvVars'. " +
|
|
220
|
+
`Current status is '${state.status}'. Call resolveAgent() first ` +
|
|
221
|
+
"and ensure it returned status 'needsEnvVars'.");
|
|
222
|
+
}
|
|
223
|
+
if (!org) {
|
|
224
|
+
throw new Error("useAgentSetup: cannot submit env vars when org is null.");
|
|
225
|
+
}
|
|
226
|
+
const { agentRef, agentId, agentName } = state;
|
|
227
|
+
const saveForFuture = options?.saveForFuture ?? true;
|
|
228
|
+
// ----- One-time path: no API calls, instant result -----
|
|
229
|
+
if (!saveForFuture) {
|
|
230
|
+
const resolution = {
|
|
231
|
+
mode: "oneTime",
|
|
232
|
+
runtimeEnv: values,
|
|
233
|
+
};
|
|
234
|
+
dispatch({
|
|
235
|
+
type: "SUBMIT_READY",
|
|
236
|
+
agentRef,
|
|
237
|
+
agentName,
|
|
238
|
+
resolution,
|
|
239
|
+
});
|
|
240
|
+
return { status: "ready", agentRef, agentName, resolution };
|
|
241
|
+
}
|
|
242
|
+
// ----- Save path: persist to environment + create instance -----
|
|
243
|
+
dispatch({ type: "SUBMIT_START" });
|
|
244
|
+
try {
|
|
245
|
+
const env = await personalEnv.getOrCreate();
|
|
246
|
+
await personalEnv.addVariables(values);
|
|
247
|
+
const envRef = {
|
|
248
|
+
org,
|
|
249
|
+
slug: env.metadata.slug,
|
|
250
|
+
kind: ApiResourceKind.environment,
|
|
251
|
+
};
|
|
252
|
+
const agentLabel = `${agentRef.org}/${agentRef.slug}`;
|
|
253
|
+
const instance = await findOrCreatePersonalInstance(stigmer, {
|
|
254
|
+
org,
|
|
255
|
+
agentId,
|
|
256
|
+
agentSlug: agentRef.slug,
|
|
257
|
+
agentLabel,
|
|
258
|
+
environmentRef: envRef,
|
|
259
|
+
});
|
|
260
|
+
const resolution = {
|
|
261
|
+
mode: "saved",
|
|
262
|
+
instanceId: instance.metadata.id,
|
|
263
|
+
};
|
|
264
|
+
dispatch({
|
|
265
|
+
type: "SUBMIT_READY",
|
|
266
|
+
agentRef,
|
|
267
|
+
agentName,
|
|
268
|
+
resolution,
|
|
269
|
+
});
|
|
270
|
+
return { status: "ready", agentRef, agentName, resolution };
|
|
271
|
+
}
|
|
272
|
+
catch (err) {
|
|
273
|
+
dispatch({ type: "ERROR", error: toError(err) });
|
|
274
|
+
throw err;
|
|
275
|
+
}
|
|
276
|
+
}, [org, stigmer, personalEnv, state]);
|
|
277
|
+
return { state, resolveAgent, submitEnvVars, clearError, reset };
|
|
278
|
+
}
|
|
279
|
+
//# sourceMappingURL=useAgentSetup.js.map
|