@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,416 @@
|
|
|
1
|
+
import { describe, it, expect, afterEach } from "vitest";
|
|
2
|
+
import { render, screen, cleanup } from "@testing-library/react";
|
|
3
|
+
import { create } from "@bufbuild/protobuf";
|
|
4
|
+
|
|
5
|
+
afterEach(cleanup);
|
|
6
|
+
import {
|
|
7
|
+
AgentExecutionSchema,
|
|
8
|
+
AgentExecutionStatusSchema,
|
|
9
|
+
type AgentExecution,
|
|
10
|
+
} from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
|
|
11
|
+
import { SubAgentExecutionSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/subagent_pb";
|
|
12
|
+
import {
|
|
13
|
+
UsageMetricsSchema,
|
|
14
|
+
ModelUsageSchema,
|
|
15
|
+
type ModelUsage,
|
|
16
|
+
} from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/usage_pb";
|
|
17
|
+
import {
|
|
18
|
+
ExecutionCostSummary,
|
|
19
|
+
formatCost,
|
|
20
|
+
formatTokenCount,
|
|
21
|
+
} from "../ExecutionCostSummary";
|
|
22
|
+
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
// Test helpers
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
|
|
27
|
+
function makeUsage(
|
|
28
|
+
overrides: Partial<{
|
|
29
|
+
promptTokens: number;
|
|
30
|
+
completionTokens: number;
|
|
31
|
+
totalTokens: number;
|
|
32
|
+
llmCallCount: number;
|
|
33
|
+
estimatedCostUsd: number;
|
|
34
|
+
primaryModel: string;
|
|
35
|
+
primaryProvider: string;
|
|
36
|
+
cacheCreationTokens: number;
|
|
37
|
+
cacheReadTokens: number;
|
|
38
|
+
}> = {},
|
|
39
|
+
) {
|
|
40
|
+
return create(UsageMetricsSchema, overrides);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function makeUsageWithModels(
|
|
44
|
+
overrides: {
|
|
45
|
+
promptTokens?: number;
|
|
46
|
+
completionTokens?: number;
|
|
47
|
+
totalTokens?: number;
|
|
48
|
+
llmCallCount?: number;
|
|
49
|
+
estimatedCostUsd?: number;
|
|
50
|
+
primaryModel?: string;
|
|
51
|
+
primaryProvider?: string;
|
|
52
|
+
cacheCreationTokens?: number;
|
|
53
|
+
cacheReadTokens?: number;
|
|
54
|
+
modelBreakdown?: ModelUsage[];
|
|
55
|
+
} = {},
|
|
56
|
+
) {
|
|
57
|
+
return create(UsageMetricsSchema, overrides);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function makeModelUsage(
|
|
61
|
+
model: string,
|
|
62
|
+
provider: string,
|
|
63
|
+
overrides: Partial<{
|
|
64
|
+
inputTokens: number;
|
|
65
|
+
outputTokens: number;
|
|
66
|
+
callCount: number;
|
|
67
|
+
estimatedCostUsd: number;
|
|
68
|
+
}> = {},
|
|
69
|
+
) {
|
|
70
|
+
return create(ModelUsageSchema, { model, provider, ...overrides });
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function makeExecution(
|
|
74
|
+
mainUsage?: ReturnType<typeof makeUsage>,
|
|
75
|
+
subAgents: Array<{
|
|
76
|
+
name: string;
|
|
77
|
+
usage?: ReturnType<typeof makeUsage>;
|
|
78
|
+
}> = [],
|
|
79
|
+
): AgentExecution {
|
|
80
|
+
const status = create(AgentExecutionStatusSchema, {
|
|
81
|
+
usage: mainUsage,
|
|
82
|
+
subAgentExecutions: subAgents.map((s) =>
|
|
83
|
+
create(SubAgentExecutionSchema, { name: s.name, usage: s.usage }),
|
|
84
|
+
),
|
|
85
|
+
});
|
|
86
|
+
return create(AgentExecutionSchema, { status });
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// ---------------------------------------------------------------------------
|
|
90
|
+
// formatCost
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
|
|
93
|
+
describe("formatCost", () => {
|
|
94
|
+
it("formats zero as $0.00", () => {
|
|
95
|
+
expect(formatCost(0)).toBe("$0.00");
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it("formats sub-dollar with 4 decimal places", () => {
|
|
99
|
+
expect(formatCost(0.0042)).toBe("$0.0042");
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it("formats sub-dollar with trailing zeros", () => {
|
|
103
|
+
expect(formatCost(0.15)).toBe("$0.1500");
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it("formats $1+ with 2 decimal places", () => {
|
|
107
|
+
expect(formatCost(1.5)).toBe("$1.50");
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it("rounds $1+ to 2 decimal places", () => {
|
|
111
|
+
expect(formatCost(123.456)).toBe("$123.46");
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it("formats exactly $1 with 2 decimal places", () => {
|
|
115
|
+
expect(formatCost(1)).toBe("$1.00");
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// ---------------------------------------------------------------------------
|
|
120
|
+
// formatTokenCount
|
|
121
|
+
// ---------------------------------------------------------------------------
|
|
122
|
+
|
|
123
|
+
describe("formatTokenCount", () => {
|
|
124
|
+
it("formats zero", () => {
|
|
125
|
+
expect(formatTokenCount(0)).toBe("0");
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it("formats small numbers without commas", () => {
|
|
129
|
+
expect(formatTokenCount(999)).toBe("999");
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it("formats thousands with commas", () => {
|
|
133
|
+
expect(formatTokenCount(1234)).toBe("1,234");
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it("formats millions with commas", () => {
|
|
137
|
+
expect(formatTokenCount(1234567)).toBe("1,234,567");
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
// ---------------------------------------------------------------------------
|
|
142
|
+
// ExecutionCostSummary — component rendering
|
|
143
|
+
// ---------------------------------------------------------------------------
|
|
144
|
+
|
|
145
|
+
describe("ExecutionCostSummary", () => {
|
|
146
|
+
it("returns null when execution is null", () => {
|
|
147
|
+
const { container } = render(
|
|
148
|
+
<ExecutionCostSummary execution={null} />,
|
|
149
|
+
);
|
|
150
|
+
expect(container.innerHTML).toBe("");
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it("returns null when usage is not yet available", () => {
|
|
154
|
+
const execution = create(AgentExecutionSchema, {
|
|
155
|
+
status: create(AgentExecutionStatusSchema),
|
|
156
|
+
});
|
|
157
|
+
const { container } = render(
|
|
158
|
+
<ExecutionCostSummary execution={execution} />,
|
|
159
|
+
);
|
|
160
|
+
expect(container.innerHTML).toBe("");
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
it("renders cost, tokens, calls, and model for a basic execution", () => {
|
|
164
|
+
const execution = makeExecution(
|
|
165
|
+
makeUsage({
|
|
166
|
+
estimatedCostUsd: 0.0042,
|
|
167
|
+
totalTokens: 1234,
|
|
168
|
+
promptTokens: 1000,
|
|
169
|
+
completionTokens: 234,
|
|
170
|
+
llmCallCount: 3,
|
|
171
|
+
primaryModel: "claude-sonnet-4",
|
|
172
|
+
primaryProvider: "anthropic",
|
|
173
|
+
}),
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
render(<ExecutionCostSummary execution={execution} />);
|
|
177
|
+
|
|
178
|
+
expect(screen.getByText("$0.0042")).toBeTruthy();
|
|
179
|
+
expect(screen.getByText("claude-sonnet-4 · anthropic")).toBeTruthy();
|
|
180
|
+
expect(screen.getByText(/1,234 tokens/)).toBeTruthy();
|
|
181
|
+
expect(screen.getByText(/3 calls/)).toBeTruthy();
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it("renders token breakdown with prompt and completion", () => {
|
|
185
|
+
const execution = makeExecution(
|
|
186
|
+
makeUsage({
|
|
187
|
+
totalTokens: 1234,
|
|
188
|
+
promptTokens: 1000,
|
|
189
|
+
completionTokens: 234,
|
|
190
|
+
llmCallCount: 1,
|
|
191
|
+
}),
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
render(<ExecutionCostSummary execution={execution} />);
|
|
195
|
+
|
|
196
|
+
expect(screen.getByText(/prompt 1,000/)).toBeTruthy();
|
|
197
|
+
expect(screen.getByText(/completion 234/)).toBeTruthy();
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
it("uses singular 'call' for a single LLM call", () => {
|
|
201
|
+
const execution = makeExecution(
|
|
202
|
+
makeUsage({
|
|
203
|
+
llmCallCount: 1,
|
|
204
|
+
totalTokens: 100,
|
|
205
|
+
promptTokens: 80,
|
|
206
|
+
completionTokens: 20,
|
|
207
|
+
}),
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
render(<ExecutionCostSummary execution={execution} />);
|
|
211
|
+
|
|
212
|
+
const metricsLine = screen.getByText(/100 tokens/);
|
|
213
|
+
expect(metricsLine.textContent).toContain("1 call");
|
|
214
|
+
expect(metricsLine.textContent).not.toContain("1 calls");
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
it("does not show cache line when cache tokens are zero", () => {
|
|
218
|
+
const execution = makeExecution(
|
|
219
|
+
makeUsage({
|
|
220
|
+
totalTokens: 100,
|
|
221
|
+
promptTokens: 80,
|
|
222
|
+
completionTokens: 20,
|
|
223
|
+
}),
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
const { container } = render(
|
|
227
|
+
<ExecutionCostSummary execution={execution} />,
|
|
228
|
+
);
|
|
229
|
+
expect(container.textContent).not.toContain("cache");
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
it("shows cache read tokens when present", () => {
|
|
233
|
+
const execution = makeExecution(
|
|
234
|
+
makeUsage({
|
|
235
|
+
totalTokens: 100,
|
|
236
|
+
promptTokens: 80,
|
|
237
|
+
completionTokens: 20,
|
|
238
|
+
cacheReadTokens: 500,
|
|
239
|
+
}),
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
const { container } = render(
|
|
243
|
+
<ExecutionCostSummary execution={execution} />,
|
|
244
|
+
);
|
|
245
|
+
expect(container.textContent).toContain("cache");
|
|
246
|
+
expect(container.textContent).toContain("500 read");
|
|
247
|
+
expect(container.textContent).not.toContain("write");
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
it("shows cache write tokens when present", () => {
|
|
251
|
+
const execution = makeExecution(
|
|
252
|
+
makeUsage({
|
|
253
|
+
totalTokens: 100,
|
|
254
|
+
promptTokens: 80,
|
|
255
|
+
completionTokens: 20,
|
|
256
|
+
cacheCreationTokens: 200,
|
|
257
|
+
}),
|
|
258
|
+
);
|
|
259
|
+
|
|
260
|
+
const { container } = render(
|
|
261
|
+
<ExecutionCostSummary execution={execution} />,
|
|
262
|
+
);
|
|
263
|
+
expect(container.textContent).toContain("cache");
|
|
264
|
+
expect(container.textContent).toContain("200 write");
|
|
265
|
+
expect(container.textContent).not.toContain("read");
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
it("shows both cache read and write when both present", () => {
|
|
269
|
+
const execution = makeExecution(
|
|
270
|
+
makeUsage({
|
|
271
|
+
totalTokens: 100,
|
|
272
|
+
promptTokens: 80,
|
|
273
|
+
completionTokens: 20,
|
|
274
|
+
cacheReadTokens: 500,
|
|
275
|
+
cacheCreationTokens: 100,
|
|
276
|
+
}),
|
|
277
|
+
);
|
|
278
|
+
|
|
279
|
+
const { container } = render(
|
|
280
|
+
<ExecutionCostSummary execution={execution} />,
|
|
281
|
+
);
|
|
282
|
+
expect(container.textContent).toContain("500 read");
|
|
283
|
+
expect(container.textContent).toContain("100 write");
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
it("shows sub-agent annotation when sub-agents have usage", () => {
|
|
287
|
+
const execution = makeExecution(
|
|
288
|
+
makeUsage({
|
|
289
|
+
totalTokens: 1000,
|
|
290
|
+
promptTokens: 800,
|
|
291
|
+
completionTokens: 200,
|
|
292
|
+
}),
|
|
293
|
+
[
|
|
294
|
+
{ name: "researcher", usage: makeUsage({ totalTokens: 500 }) },
|
|
295
|
+
{ name: "writer", usage: makeUsage({ totalTokens: 300 }) },
|
|
296
|
+
],
|
|
297
|
+
);
|
|
298
|
+
|
|
299
|
+
render(<ExecutionCostSummary execution={execution} />);
|
|
300
|
+
expect(screen.getByText("Includes 2 sub-agents")).toBeTruthy();
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
it("uses singular 'sub-agent' for one sub-agent", () => {
|
|
304
|
+
const execution = makeExecution(
|
|
305
|
+
makeUsage({
|
|
306
|
+
totalTokens: 1000,
|
|
307
|
+
promptTokens: 800,
|
|
308
|
+
completionTokens: 200,
|
|
309
|
+
}),
|
|
310
|
+
[{ name: "researcher", usage: makeUsage({ totalTokens: 500 }) }],
|
|
311
|
+
);
|
|
312
|
+
|
|
313
|
+
render(<ExecutionCostSummary execution={execution} />);
|
|
314
|
+
expect(screen.getByText("Includes 1 sub-agent")).toBeTruthy();
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
it("does not show sub-agent annotation when no sub-agents have usage", () => {
|
|
318
|
+
const execution = makeExecution(
|
|
319
|
+
makeUsage({
|
|
320
|
+
totalTokens: 1000,
|
|
321
|
+
promptTokens: 800,
|
|
322
|
+
completionTokens: 200,
|
|
323
|
+
}),
|
|
324
|
+
[{ name: "idle-agent" }],
|
|
325
|
+
);
|
|
326
|
+
|
|
327
|
+
const { container } = render(
|
|
328
|
+
<ExecutionCostSummary execution={execution} />,
|
|
329
|
+
);
|
|
330
|
+
expect(container.textContent).not.toContain("sub-agent");
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
it("shows per-model breakdown when multiple models exist", () => {
|
|
334
|
+
const execution = makeExecution(
|
|
335
|
+
makeUsageWithModels({
|
|
336
|
+
totalTokens: 2000,
|
|
337
|
+
promptTokens: 1500,
|
|
338
|
+
completionTokens: 500,
|
|
339
|
+
estimatedCostUsd: 0.0142,
|
|
340
|
+
primaryModel: "claude-sonnet-4",
|
|
341
|
+
primaryProvider: "anthropic",
|
|
342
|
+
modelBreakdown: [
|
|
343
|
+
makeModelUsage("claude-sonnet-4", "anthropic", {
|
|
344
|
+
estimatedCostUsd: 0.012,
|
|
345
|
+
}),
|
|
346
|
+
makeModelUsage("gpt-4o", "openai", {
|
|
347
|
+
estimatedCostUsd: 0.0022,
|
|
348
|
+
}),
|
|
349
|
+
],
|
|
350
|
+
}),
|
|
351
|
+
);
|
|
352
|
+
|
|
353
|
+
render(<ExecutionCostSummary execution={execution} />);
|
|
354
|
+
|
|
355
|
+
expect(screen.getByText("claude-sonnet-4")).toBeTruthy();
|
|
356
|
+
expect(screen.getByText("$0.0120")).toBeTruthy();
|
|
357
|
+
expect(screen.getByText("gpt-4o")).toBeTruthy();
|
|
358
|
+
expect(screen.getByText("$0.0022")).toBeTruthy();
|
|
359
|
+
expect(
|
|
360
|
+
screen.queryByText("claude-sonnet-4 · anthropic"),
|
|
361
|
+
).toBeNull();
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
it("shows model breakdown list with proper accessibility", () => {
|
|
365
|
+
const execution = makeExecution(
|
|
366
|
+
makeUsageWithModels({
|
|
367
|
+
totalTokens: 2000,
|
|
368
|
+
promptTokens: 1500,
|
|
369
|
+
completionTokens: 500,
|
|
370
|
+
modelBreakdown: [
|
|
371
|
+
makeModelUsage("model-a", "provider-a"),
|
|
372
|
+
makeModelUsage("model-b", "provider-b"),
|
|
373
|
+
],
|
|
374
|
+
}),
|
|
375
|
+
);
|
|
376
|
+
|
|
377
|
+
render(<ExecutionCostSummary execution={execution} />);
|
|
378
|
+
|
|
379
|
+
expect(
|
|
380
|
+
screen.getByRole("list", { name: "Model cost breakdown" }),
|
|
381
|
+
).toBeTruthy();
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
it("has proper region role and aria-label", () => {
|
|
385
|
+
const execution = makeExecution(
|
|
386
|
+
makeUsage({
|
|
387
|
+
totalTokens: 100,
|
|
388
|
+
promptTokens: 80,
|
|
389
|
+
completionTokens: 20,
|
|
390
|
+
}),
|
|
391
|
+
);
|
|
392
|
+
|
|
393
|
+
render(<ExecutionCostSummary execution={execution} />);
|
|
394
|
+
|
|
395
|
+
expect(
|
|
396
|
+
screen.getByRole("region", { name: "Execution cost summary" }),
|
|
397
|
+
).toBeTruthy();
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
it("accepts and applies className", () => {
|
|
401
|
+
const execution = makeExecution(
|
|
402
|
+
makeUsage({
|
|
403
|
+
totalTokens: 100,
|
|
404
|
+
promptTokens: 80,
|
|
405
|
+
completionTokens: 20,
|
|
406
|
+
}),
|
|
407
|
+
);
|
|
408
|
+
|
|
409
|
+
render(
|
|
410
|
+
<ExecutionCostSummary execution={execution} className="my-custom" />,
|
|
411
|
+
);
|
|
412
|
+
|
|
413
|
+
const region = screen.getByRole("region");
|
|
414
|
+
expect(region.className).toContain("my-custom");
|
|
415
|
+
});
|
|
416
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { ExecutionPhase } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
3
|
+
import { isTerminalPhase } from "../execution-phases";
|
|
4
|
+
|
|
5
|
+
describe("isTerminalPhase", () => {
|
|
6
|
+
const terminalPhases = [
|
|
7
|
+
ExecutionPhase.EXECUTION_COMPLETED,
|
|
8
|
+
ExecutionPhase.EXECUTION_FAILED,
|
|
9
|
+
ExecutionPhase.EXECUTION_CANCELLED,
|
|
10
|
+
ExecutionPhase.EXECUTION_TERMINATED,
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
it.each(terminalPhases)("returns true for terminal phase %i", (phase) => {
|
|
14
|
+
expect(isTerminalPhase(phase)).toBe(true);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const nonTerminalPhases = [
|
|
18
|
+
ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED,
|
|
19
|
+
ExecutionPhase.EXECUTION_PENDING,
|
|
20
|
+
ExecutionPhase.EXECUTION_IN_PROGRESS,
|
|
21
|
+
ExecutionPhase.EXECUTION_WAITING_FOR_APPROVAL,
|
|
22
|
+
ExecutionPhase.EXECUTION_PAUSED,
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
it.each(nonTerminalPhases)(
|
|
26
|
+
"returns false for non-terminal phase %i",
|
|
27
|
+
(phase) => {
|
|
28
|
+
expect(isTerminalPhase(phase)).toBe(false);
|
|
29
|
+
},
|
|
30
|
+
);
|
|
31
|
+
});
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
|
+
import { renderHook, act, waitFor } from "@testing-library/react";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import { create } from "@bufbuild/protobuf";
|
|
5
|
+
import {
|
|
6
|
+
AgentExecutionSchema,
|
|
7
|
+
AgentExecutionStatusSchema,
|
|
8
|
+
type AgentExecution,
|
|
9
|
+
} from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
|
|
10
|
+
import { ExecutionPhase } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
11
|
+
import type { Stigmer } from "@stigmer/sdk";
|
|
12
|
+
import { StigmerContext } from "../../context";
|
|
13
|
+
import { useExecutionStream } from "../useExecutionStream";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Creates a controllable async generator. Call `push(value)` to yield
|
|
17
|
+
* the next value, `finish()` to end the stream, or `fail(err)` to
|
|
18
|
+
* throw an error from the stream.
|
|
19
|
+
*/
|
|
20
|
+
function createControllableStream<T>() {
|
|
21
|
+
let resolve: ((v: IteratorResult<T>) => void) | null = null;
|
|
22
|
+
let reject: ((err: unknown) => void) | null = null;
|
|
23
|
+
|
|
24
|
+
const generator: AsyncGenerator<T> = {
|
|
25
|
+
next() {
|
|
26
|
+
return new Promise<IteratorResult<T>>((res, rej) => {
|
|
27
|
+
resolve = res;
|
|
28
|
+
reject = rej;
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
return(value?: unknown) {
|
|
32
|
+
return Promise.resolve({ done: true as const, value: value as T });
|
|
33
|
+
},
|
|
34
|
+
throw(err?: unknown) {
|
|
35
|
+
return Promise.reject(err);
|
|
36
|
+
},
|
|
37
|
+
[Symbol.asyncIterator]() {
|
|
38
|
+
return generator;
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
generator,
|
|
44
|
+
push(value: T) {
|
|
45
|
+
resolve?.({ done: false, value });
|
|
46
|
+
},
|
|
47
|
+
finish() {
|
|
48
|
+
resolve?.({ done: true, value: undefined as unknown as T });
|
|
49
|
+
},
|
|
50
|
+
fail(err: Error) {
|
|
51
|
+
reject?.(err);
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function makeSnapshot(phase: ExecutionPhase): AgentExecution {
|
|
57
|
+
const exec = create(AgentExecutionSchema);
|
|
58
|
+
const status = create(AgentExecutionStatusSchema);
|
|
59
|
+
status.phase = phase;
|
|
60
|
+
exec.status = status;
|
|
61
|
+
return exec;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function createMockStigmer(subscribeFn: Stigmer["agentExecution"]["subscribe"]) {
|
|
65
|
+
return {
|
|
66
|
+
agentExecution: { subscribe: subscribeFn },
|
|
67
|
+
} as unknown as Stigmer;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function createWrapper(client: Stigmer) {
|
|
71
|
+
return function Wrapper({ children }: { children: ReactNode }) {
|
|
72
|
+
return (
|
|
73
|
+
<StigmerContext.Provider value={client}>{children}</StigmerContext.Provider>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
describe("useExecutionStream", () => {
|
|
79
|
+
let stream: ReturnType<typeof createControllableStream<AgentExecution>>;
|
|
80
|
+
let subscribeFn: ReturnType<typeof vi.fn>;
|
|
81
|
+
let mockStigmer: Stigmer;
|
|
82
|
+
|
|
83
|
+
beforeEach(() => {
|
|
84
|
+
stream = createControllableStream<AgentExecution>();
|
|
85
|
+
subscribeFn = vi.fn().mockReturnValue(stream.generator);
|
|
86
|
+
mockStigmer = createMockStigmer(subscribeFn);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it("returns idle state when executionId is null", () => {
|
|
90
|
+
const { result } = renderHook(() => useExecutionStream(null), {
|
|
91
|
+
wrapper: createWrapper(mockStigmer),
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
expect(result.current.execution).toBeNull();
|
|
95
|
+
expect(result.current.isConnecting).toBe(false);
|
|
96
|
+
expect(result.current.isStreaming).toBe(false);
|
|
97
|
+
expect(result.current.error).toBeNull();
|
|
98
|
+
expect(subscribeFn).not.toHaveBeenCalled();
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it("starts in isConnecting state when given an ID", () => {
|
|
102
|
+
const { result } = renderHook(() => useExecutionStream("exec-1"), {
|
|
103
|
+
wrapper: createWrapper(mockStigmer),
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
expect(result.current.isConnecting).toBe(true);
|
|
107
|
+
expect(result.current.isStreaming).toBe(false);
|
|
108
|
+
expect(result.current.execution).toBeNull();
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it("transitions to isStreaming after first non-terminal snapshot", async () => {
|
|
112
|
+
const { result } = renderHook(() => useExecutionStream("exec-1"), {
|
|
113
|
+
wrapper: createWrapper(mockStigmer),
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
act(() => {
|
|
117
|
+
stream.push(makeSnapshot(ExecutionPhase.EXECUTION_IN_PROGRESS));
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
await waitFor(() => {
|
|
121
|
+
expect(result.current.isStreaming).toBe(true);
|
|
122
|
+
expect(result.current.isConnecting).toBe(false);
|
|
123
|
+
expect(result.current.execution).not.toBeNull();
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it("updates execution with each streamed snapshot", async () => {
|
|
128
|
+
const { result } = renderHook(() => useExecutionStream("exec-1"), {
|
|
129
|
+
wrapper: createWrapper(mockStigmer),
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
const snap1 = makeSnapshot(ExecutionPhase.EXECUTION_PENDING);
|
|
133
|
+
act(() => stream.push(snap1));
|
|
134
|
+
|
|
135
|
+
await waitFor(() => {
|
|
136
|
+
expect(result.current.execution).toBe(snap1);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
const snap2 = makeSnapshot(ExecutionPhase.EXECUTION_IN_PROGRESS);
|
|
140
|
+
act(() => stream.push(snap2));
|
|
141
|
+
|
|
142
|
+
await waitFor(() => {
|
|
143
|
+
expect(result.current.execution).toBe(snap2);
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
it("sets isStreaming to false when a terminal phase is received", async () => {
|
|
148
|
+
const { result } = renderHook(() => useExecutionStream("exec-1"), {
|
|
149
|
+
wrapper: createWrapper(mockStigmer),
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
act(() => {
|
|
153
|
+
stream.push(makeSnapshot(ExecutionPhase.EXECUTION_COMPLETED));
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
await waitFor(() => {
|
|
157
|
+
expect(result.current.isStreaming).toBe(false);
|
|
158
|
+
expect(result.current.execution).not.toBeNull();
|
|
159
|
+
expect(result.current.phase).toBe(ExecutionPhase.EXECUTION_COMPLETED);
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
it("sets error when the stream throws", async () => {
|
|
164
|
+
const { result } = renderHook(() => useExecutionStream("exec-1"), {
|
|
165
|
+
wrapper: createWrapper(mockStigmer),
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
act(() => {
|
|
169
|
+
stream.fail(new Error("connection lost"));
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
await waitFor(() => {
|
|
173
|
+
expect(result.current.error?.message).toBe("connection lost");
|
|
174
|
+
expect(result.current.isConnecting).toBe(false);
|
|
175
|
+
expect(result.current.isStreaming).toBe(false);
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
it("reconnect clears error and re-subscribes", async () => {
|
|
180
|
+
const { result } = renderHook(() => useExecutionStream("exec-1"), {
|
|
181
|
+
wrapper: createWrapper(mockStigmer),
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
act(() => stream.fail(new Error("timeout")));
|
|
185
|
+
|
|
186
|
+
await waitFor(() => {
|
|
187
|
+
expect(result.current.error?.message).toBe("timeout");
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
const newStream = createControllableStream<AgentExecution>();
|
|
191
|
+
subscribeFn.mockReturnValue(newStream.generator);
|
|
192
|
+
|
|
193
|
+
act(() => result.current.reconnect());
|
|
194
|
+
|
|
195
|
+
await waitFor(() => {
|
|
196
|
+
expect(result.current.error).toBeNull();
|
|
197
|
+
expect(result.current.isConnecting).toBe(true);
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
expect(subscribeFn).toHaveBeenCalledTimes(2);
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
it("aborts previous subscription when executionId changes", async () => {
|
|
204
|
+
const { result, rerender } = renderHook(
|
|
205
|
+
({ id }: { id: string | null }) => useExecutionStream(id),
|
|
206
|
+
{
|
|
207
|
+
wrapper: createWrapper(mockStigmer),
|
|
208
|
+
initialProps: { id: "exec-1" },
|
|
209
|
+
},
|
|
210
|
+
);
|
|
211
|
+
|
|
212
|
+
act(() => {
|
|
213
|
+
stream.push(makeSnapshot(ExecutionPhase.EXECUTION_IN_PROGRESS));
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
await waitFor(() => {
|
|
217
|
+
expect(result.current.isStreaming).toBe(true);
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
const newStream = createControllableStream<AgentExecution>();
|
|
221
|
+
subscribeFn.mockReturnValue(newStream.generator);
|
|
222
|
+
|
|
223
|
+
rerender({ id: "exec-2" });
|
|
224
|
+
|
|
225
|
+
expect(result.current.isConnecting).toBe(true);
|
|
226
|
+
expect(result.current.execution).toBeNull();
|
|
227
|
+
expect(subscribeFn).toHaveBeenCalledTimes(2);
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
it("cleans up subscription on unmount", () => {
|
|
231
|
+
const { unmount } = renderHook(() => useExecutionStream("exec-1"), {
|
|
232
|
+
wrapper: createWrapper(mockStigmer),
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
const signal = subscribeFn.mock.calls[0][1] as AbortSignal;
|
|
236
|
+
expect(signal.aborted).toBe(false);
|
|
237
|
+
|
|
238
|
+
unmount();
|
|
239
|
+
|
|
240
|
+
expect(signal.aborted).toBe(true);
|
|
241
|
+
});
|
|
242
|
+
});
|