@stigmer/react 0.0.36 → 0.0.39
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 +69 -0
- package/agent/AgentDetailView.d.ts.map +1 -0
- package/agent/AgentDetailView.js +183 -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 +122 -0
- package/agent/agentSetupReducer.d.ts.map +1 -0
- package/agent/agentSetupReducer.js +75 -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 +244 -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/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 +568 -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 +32 -0
- package/index.d.ts.map +1 -1
- package/index.js +31 -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/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 +20 -0
- package/library/index.d.ts.map +1 -0
- package/library/index.js +11 -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/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 +43 -0
- package/mcp-server/McpServerDetailView.d.ts.map +1 -0
- package/mcp-server/McpServerDetailView.js +137 -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 +43 -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 +16 -6
- package/session/index.d.ts.map +1 -1
- package/session/index.js +8 -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 +86 -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 +51 -0
- package/skill/SkillDetailView.d.ts.map +1 -0
- package/skill/SkillDetailView.js +156 -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 +712 -0
- package/src/agent/AgentEnvForm.tsx +113 -0
- package/src/agent/AgentPicker.tsx +342 -0
- package/src/agent/agentSetupReducer.ts +222 -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 +384 -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/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 +1175 -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 +367 -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/detect-skill-package.ts +162 -0
- package/src/library/detect-stigmer-resource.ts +130 -0
- package/src/library/index.ts +42 -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/mcp-server/McpServerConfigPanel.tsx +265 -0
- package/src/mcp-server/McpServerDetailView.tsx +580 -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 +123 -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 +30 -10
- package/src/session/useAgentRefFromSession.ts +94 -0
- package/src/session/useCreateSession.ts +141 -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 +477 -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,1175 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useMemo, useRef, useState, type DragEvent, type KeyboardEvent } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { getUserMessage, type AttachmentInput, type EnvVarInput, type McpServerUsageInput, type ResourceRef } from "@stigmer/sdk";
|
|
6
|
+
import { useComposer } from "./useComposer";
|
|
7
|
+
import { ComposerToolbar } from "./ComposerToolbar";
|
|
8
|
+
import { type ConfigureMenuItem } from "./ConfigureMenu";
|
|
9
|
+
import { ContextChip, type ChipItem } from "./ContextChip";
|
|
10
|
+
import { WorkspaceEditor } from "../workspace/WorkspaceEditor";
|
|
11
|
+
import { AgentPicker } from "../agent/AgentPicker";
|
|
12
|
+
import { AgentEnvForm, type AgentEnvFormSubmitOptions } from "../agent/AgentEnvForm";
|
|
13
|
+
import { useAgentSetup, type AgentResolution } from "../agent/useAgentSetup";
|
|
14
|
+
import { SecretFlowErrorGuide, isSecretFlowError } from "../error/SecretFlowErrorGuide";
|
|
15
|
+
import { McpServerPicker } from "../mcp-server/McpServerPicker";
|
|
16
|
+
import { useMcpServerSetup } from "../mcp-server/useMcpServerSetup";
|
|
17
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
18
|
+
import { SkillPicker } from "../skill/SkillPicker";
|
|
19
|
+
import { SessionVariablesInput } from "../execution/SessionVariablesInput";
|
|
20
|
+
import type { UseSessionVariablesReturn } from "../execution/useSessionVariables";
|
|
21
|
+
import type { UseWorkspaceEntriesReturn } from "../workspace/useWorkspaceEntries";
|
|
22
|
+
import type { UseGitHubConnectionReturn } from "../github/useGitHubConnection";
|
|
23
|
+
import { useAttachments } from "../attachment/useAttachments";
|
|
24
|
+
import { AttachmentChipList } from "../attachment/AttachmentChipList";
|
|
25
|
+
import { useSessionEnvPool } from "../environment/useSessionEnvPool";
|
|
26
|
+
import { usePersonalEnvironment } from "../environment/usePersonalEnvironment";
|
|
27
|
+
import {
|
|
28
|
+
AgentIcon,
|
|
29
|
+
McpServerIcon,
|
|
30
|
+
SkillIcon,
|
|
31
|
+
SecretsIcon,
|
|
32
|
+
AlertTriangleIcon,
|
|
33
|
+
ResolveSpinner,
|
|
34
|
+
} from "./icons";
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Context provided to `onSubmit` at the moment of submission.
|
|
38
|
+
*
|
|
39
|
+
* Contains aggregated one-time environment variables from all setup
|
|
40
|
+
* flows managed by the composer (agent, MCP servers, manual secrets).
|
|
41
|
+
* The consumer passes `context.runtimeEnv` directly to execution
|
|
42
|
+
* creation without needing to understand the individual sources.
|
|
43
|
+
*/
|
|
44
|
+
export interface SessionComposerSubmitContext {
|
|
45
|
+
/**
|
|
46
|
+
* Aggregated one-time environment variables from all setup flows.
|
|
47
|
+
*
|
|
48
|
+
* Merged from (in precedence order, last-write-wins):
|
|
49
|
+
* 1. Agent one-time env vars (when agent resolution mode is `"oneTime"`)
|
|
50
|
+
* 2. MCP server one-time env vars (collected with `saveForFuture: false`)
|
|
51
|
+
* 3. Manual session variables (from {@link SessionVariablesInput})
|
|
52
|
+
*
|
|
53
|
+
* `undefined` when no runtime env vars were collected from any source.
|
|
54
|
+
* Pass directly to execution creation as `runtimeEnv`.
|
|
55
|
+
*/
|
|
56
|
+
readonly runtimeEnv?: Record<string, EnvVarInput>;
|
|
57
|
+
/**
|
|
58
|
+
* Pre-uploaded file attachments for the execution.
|
|
59
|
+
*
|
|
60
|
+
* Each entry contains a `storageKey` obtained from
|
|
61
|
+
* `agentExecution.uploadAttachment()`. Only successfully uploaded
|
|
62
|
+
* attachments are included. Pass directly to execution creation
|
|
63
|
+
* as `attachments`.
|
|
64
|
+
*
|
|
65
|
+
* `undefined` when no files were attached.
|
|
66
|
+
*/
|
|
67
|
+
readonly attachments?: AttachmentInput[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface SessionComposerProps {
|
|
71
|
+
/**
|
|
72
|
+
* Called when the user submits a message.
|
|
73
|
+
*
|
|
74
|
+
* The optional `context` parameter carries aggregated runtime data
|
|
75
|
+
* collected by the composer's setup flows. When present,
|
|
76
|
+
* `context.runtimeEnv` should be passed to execution creation.
|
|
77
|
+
*/
|
|
78
|
+
readonly onSubmit: (
|
|
79
|
+
message: string,
|
|
80
|
+
modelName?: string,
|
|
81
|
+
context?: SessionComposerSubmitContext,
|
|
82
|
+
) => void;
|
|
83
|
+
/** Shows loading indicator on the send button. */
|
|
84
|
+
readonly isSubmitting?: boolean;
|
|
85
|
+
/** Disables the entire composer (e.g., while an execution streams). */
|
|
86
|
+
readonly disabled?: boolean;
|
|
87
|
+
|
|
88
|
+
/** Initial model ID for the model selector. */
|
|
89
|
+
readonly defaultModelId?: string;
|
|
90
|
+
/** Called when the user changes the selected model. */
|
|
91
|
+
readonly onModelChange?: (modelId: string) => void;
|
|
92
|
+
/** Show the model selector. @default true */
|
|
93
|
+
readonly showModelSelector?: boolean;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Workspace state managed by {@link useWorkspaceEntries}.
|
|
97
|
+
* When provided, renders a workspace trigger in the toolbar
|
|
98
|
+
* that opens a popover with the workspace editor.
|
|
99
|
+
*/
|
|
100
|
+
readonly workspace?: UseWorkspaceEntriesReturn;
|
|
101
|
+
/** GitHub connection state for the repo picker. */
|
|
102
|
+
readonly gitHubConnection?: UseGitHubConnectionReturn;
|
|
103
|
+
/** Show the GitHub Repo source button. @default true */
|
|
104
|
+
readonly enableGitHub?: boolean;
|
|
105
|
+
/** Show the Local Folder source button. @default false */
|
|
106
|
+
readonly enableLocal?: boolean;
|
|
107
|
+
/** Use the visual folder browser instead of a text input. @default false */
|
|
108
|
+
readonly enableFolderBrowser?: boolean;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Organization slug for agent, MCP server, and skill searches.
|
|
112
|
+
* Required when agent, MCP, or skill pickers are enabled.
|
|
113
|
+
*/
|
|
114
|
+
readonly org?: string;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Currently selected agent reference, or null if none.
|
|
118
|
+
* When `onAgentRefChange` is provided, an agent trigger
|
|
119
|
+
* appears in the toolbar (single-select).
|
|
120
|
+
*/
|
|
121
|
+
readonly agentRef?: ResourceRef | null;
|
|
122
|
+
/** Called when the agent selection changes. Providing this enables the agent trigger. */
|
|
123
|
+
readonly onAgentRefChange?: (ref: ResourceRef | null) => void;
|
|
124
|
+
/**
|
|
125
|
+
* Called when the agent setup flow resolves how the agent should
|
|
126
|
+
* be used for session creation.
|
|
127
|
+
*
|
|
128
|
+
* The {@link AgentResolution} discriminated union tells the caller
|
|
129
|
+
* which session creation path to use:
|
|
130
|
+
* - `"saved"` — use `agentInstanceId`
|
|
131
|
+
* - `"oneTime"` — use `agentRef` + pass `runtimeEnv` to execution
|
|
132
|
+
* - `"direct"` — use `agentRef` (no secrets needed)
|
|
133
|
+
*
|
|
134
|
+
* Set to `null` when the agent is deselected.
|
|
135
|
+
*/
|
|
136
|
+
readonly onAgentResolutionChange?: (resolution: AgentResolution | null) => void;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Agent to auto-select when the composer mounts.
|
|
140
|
+
*
|
|
141
|
+
* When provided, the composer runs the full agent resolution flow
|
|
142
|
+
* on mount — exactly as if the user had picked this agent in the
|
|
143
|
+
* {@link AgentPicker}. If the agent requires credentials, the
|
|
144
|
+
* environment form appears automatically.
|
|
145
|
+
*
|
|
146
|
+
* One-time: consumed on mount; subsequent changes are ignored.
|
|
147
|
+
* To change the agent after mount, use the picker or
|
|
148
|
+
* `onAgentRefChange` externally.
|
|
149
|
+
*
|
|
150
|
+
* Requires `org` and `onAgentRefChange` to be set (same
|
|
151
|
+
* prerequisites as the agent picker).
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```tsx
|
|
155
|
+
* <SessionComposer
|
|
156
|
+
* onSubmit={handleCreate}
|
|
157
|
+
* org="acme"
|
|
158
|
+
* agentRef={agentRef}
|
|
159
|
+
* onAgentRefChange={setAgentRef}
|
|
160
|
+
* onAgentResolutionChange={setResolution}
|
|
161
|
+
* initialAgentRef={{ org: "stigmer", slug: "agent-creator" }}
|
|
162
|
+
* />
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
readonly initialAgentRef?: ResourceRef;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Currently selected MCP server usages.
|
|
169
|
+
* When `onMcpServerUsagesChange` is provided, a MCP server trigger
|
|
170
|
+
* appears in the toolbar.
|
|
171
|
+
*/
|
|
172
|
+
readonly mcpServerUsages?: McpServerUsageInput[];
|
|
173
|
+
/** Called when the MCP server selection changes. Providing this enables the MCP trigger. */
|
|
174
|
+
readonly onMcpServerUsagesChange?: (usages: McpServerUsageInput[]) => void;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Currently selected skill references.
|
|
178
|
+
* When `onSkillRefsChange` is provided, a skill trigger
|
|
179
|
+
* appears in the toolbar.
|
|
180
|
+
*/
|
|
181
|
+
readonly skillRefs?: ResourceRef[];
|
|
182
|
+
/** Called when the skill selection changes. Providing this enables the skill trigger. */
|
|
183
|
+
readonly onSkillRefsChange?: (refs: ResourceRef[]) => void;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Session variables state managed by {@link useSessionVariables}.
|
|
187
|
+
* When provided, renders a "Session Variables" trigger in the toolbar
|
|
188
|
+
* that opens a key-value editor for environment variables.
|
|
189
|
+
*
|
|
190
|
+
* Variables are ephemeral by default (single execution). Individual
|
|
191
|
+
* entries can be marked `saveForFuture: true` to persist them to
|
|
192
|
+
* the user's personal environment. The consumer should call
|
|
193
|
+
* `sessionVariables.clear()` after submission.
|
|
194
|
+
*/
|
|
195
|
+
readonly sessionVariables?: UseSessionVariablesReturn;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Enable file attachment support in the composer.
|
|
199
|
+
*
|
|
200
|
+
* When `true`, renders an attach button in the toolbar and enables
|
|
201
|
+
* drag-and-drop file upload on the textarea. Attachments are uploaded
|
|
202
|
+
* immediately via `agentExecution.uploadAttachment()` and included
|
|
203
|
+
* in `context.attachments` on submit.
|
|
204
|
+
*
|
|
205
|
+
* @default true
|
|
206
|
+
*/
|
|
207
|
+
readonly enableAttachments?: boolean;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Called when a file is rejected (e.g., exceeds the 10 MB limit).
|
|
211
|
+
* Consumers can use this for toast notifications.
|
|
212
|
+
*/
|
|
213
|
+
readonly onAttachmentValidationError?: (message: string) => void;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Files to attach programmatically when the composer mounts.
|
|
217
|
+
*
|
|
218
|
+
* When provided, the composer uploads these files via the same
|
|
219
|
+
* attachment pipeline as user-selected files. Attachment chips
|
|
220
|
+
* appear in the UI so the user sees what is attached.
|
|
221
|
+
*
|
|
222
|
+
* One-time: consumed when the value first becomes truthy.
|
|
223
|
+
* Subsequent changes are ignored. This allows async resource
|
|
224
|
+
* fetching — the effect waits for the files to be ready.
|
|
225
|
+
*
|
|
226
|
+
* Requires `enableAttachments` to be `true` (default).
|
|
227
|
+
*
|
|
228
|
+
* @example
|
|
229
|
+
* ```tsx
|
|
230
|
+
* const yaml = serializeAgentYaml(agent);
|
|
231
|
+
* const file = new File([yaml], "my-agent.yaml", { type: "text/yaml" });
|
|
232
|
+
*
|
|
233
|
+
* <SessionComposer
|
|
234
|
+
* onSubmit={handleSubmit}
|
|
235
|
+
* initialAttachments={[file]}
|
|
236
|
+
* initialAgentRef={{ org: "stigmer", slug: "agent-creator" }}
|
|
237
|
+
* />
|
|
238
|
+
* ```
|
|
239
|
+
*/
|
|
240
|
+
readonly initialAttachments?: File[];
|
|
241
|
+
|
|
242
|
+
/** Placeholder text for the textarea. @default "Reply\u2026" */
|
|
243
|
+
readonly placeholder?: string;
|
|
244
|
+
/** Initial number of visible rows. @default 1 */
|
|
245
|
+
readonly initialRows?: number;
|
|
246
|
+
/** Auto-focus the textarea on mount. @default false */
|
|
247
|
+
readonly autoFocus?: boolean;
|
|
248
|
+
/** ARIA label for the composer region. @default "Send message" */
|
|
249
|
+
readonly ariaLabel?: string;
|
|
250
|
+
|
|
251
|
+
readonly className?: string;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Unified message composer for Stigmer sessions.
|
|
256
|
+
*
|
|
257
|
+
* Combines a self-resizing textarea, model selector, and context pickers
|
|
258
|
+
* (agent, workspace, MCP servers, skills) into a single input card.
|
|
259
|
+
*
|
|
260
|
+
* The toolbar uses a two-tier layout:
|
|
261
|
+
* - **Tier 1** (always visible): Attach, Workspace, Model Selector
|
|
262
|
+
* - **Tier 2** (behind Configure menu): Agent, MCP, Skills, Secrets
|
|
263
|
+
*
|
|
264
|
+
* Selected items render as removable chips between the textarea and toolbar.
|
|
265
|
+
*
|
|
266
|
+
* Used for both new session creation (launcher) and follow-up messages
|
|
267
|
+
* within an existing session. Layout positioning is the consumer's
|
|
268
|
+
* responsibility.
|
|
269
|
+
*
|
|
270
|
+
* Uses `<div role="form">` instead of `<form>` so it can be embedded
|
|
271
|
+
* inside host application forms without nesting violations.
|
|
272
|
+
*
|
|
273
|
+
* All visual properties flow through `--stgm-*` tokens.
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* ```tsx
|
|
277
|
+
* // Launcher with all context types
|
|
278
|
+
* <SessionComposer
|
|
279
|
+
* onSubmit={handleCreate}
|
|
280
|
+
* org={org}
|
|
281
|
+
* agentRef={agentRef}
|
|
282
|
+
* onAgentRefChange={setAgentRef}
|
|
283
|
+
* onAgentResolutionChange={setResolution}
|
|
284
|
+
* workspace={workspace}
|
|
285
|
+
* enableGitHub
|
|
286
|
+
* mcpServerUsages={mcpUsages}
|
|
287
|
+
* onMcpServerUsagesChange={setMcpUsages}
|
|
288
|
+
* skillRefs={skillRefs}
|
|
289
|
+
* onSkillRefsChange={setSkillRefs}
|
|
290
|
+
* initialRows={3}
|
|
291
|
+
* placeholder="Describe what you need help with..."
|
|
292
|
+
* autoFocus
|
|
293
|
+
* />
|
|
294
|
+
*
|
|
295
|
+
* // Pre-filled launcher (auto-selects agent on mount)
|
|
296
|
+
* <SessionComposer
|
|
297
|
+
* onSubmit={handleCreate}
|
|
298
|
+
* org={org}
|
|
299
|
+
* agentRef={agentRef}
|
|
300
|
+
* onAgentRefChange={setAgentRef}
|
|
301
|
+
* onAgentResolutionChange={setResolution}
|
|
302
|
+
* initialAgentRef={{ org: "stigmer", slug: "agent-creator" }}
|
|
303
|
+
* placeholder="Describe the agent you want to create..."
|
|
304
|
+
* initialRows={3}
|
|
305
|
+
* autoFocus
|
|
306
|
+
* />
|
|
307
|
+
*
|
|
308
|
+
* // Follow-up (compact, workspace only)
|
|
309
|
+
* <SessionComposer
|
|
310
|
+
* onSubmit={(msg, model) => conv.sendFollowUp(msg, { modelName: model })}
|
|
311
|
+
* disabled={!conv.canSendFollowUp}
|
|
312
|
+
* isSubmitting={conv.isSending}
|
|
313
|
+
* workspace={workspace}
|
|
314
|
+
* />
|
|
315
|
+
* ```
|
|
316
|
+
*/
|
|
317
|
+
export function SessionComposer({
|
|
318
|
+
onSubmit,
|
|
319
|
+
isSubmitting = false,
|
|
320
|
+
disabled = false,
|
|
321
|
+
defaultModelId,
|
|
322
|
+
onModelChange,
|
|
323
|
+
showModelSelector = true,
|
|
324
|
+
workspace,
|
|
325
|
+
gitHubConnection,
|
|
326
|
+
enableGitHub = true,
|
|
327
|
+
enableLocal = false,
|
|
328
|
+
enableFolderBrowser = false,
|
|
329
|
+
org,
|
|
330
|
+
agentRef,
|
|
331
|
+
onAgentRefChange,
|
|
332
|
+
onAgentResolutionChange,
|
|
333
|
+
initialAgentRef,
|
|
334
|
+
mcpServerUsages,
|
|
335
|
+
onMcpServerUsagesChange,
|
|
336
|
+
skillRefs,
|
|
337
|
+
onSkillRefsChange,
|
|
338
|
+
sessionVariables,
|
|
339
|
+
enableAttachments = true,
|
|
340
|
+
onAttachmentValidationError,
|
|
341
|
+
initialAttachments,
|
|
342
|
+
placeholder = "Reply\u2026",
|
|
343
|
+
initialRows = 1,
|
|
344
|
+
autoFocus = false,
|
|
345
|
+
ariaLabel = "Send message",
|
|
346
|
+
className,
|
|
347
|
+
}: SessionComposerProps) {
|
|
348
|
+
const [modelId, setModelId] = useState<string | undefined>(defaultModelId);
|
|
349
|
+
|
|
350
|
+
const [displayNames, setDisplayNames] = useState<Map<string, string>>(
|
|
351
|
+
() => new Map(),
|
|
352
|
+
);
|
|
353
|
+
|
|
354
|
+
const isDisabled = disabled || isSubmitting;
|
|
355
|
+
|
|
356
|
+
const showAgent = onAgentRefChange != null && org != null;
|
|
357
|
+
const showMcp = onMcpServerUsagesChange != null && org != null;
|
|
358
|
+
const showWorkspace = workspace != null;
|
|
359
|
+
const showSkills = onSkillRefsChange != null && org != null;
|
|
360
|
+
const showSessionVars = sessionVariables != null;
|
|
361
|
+
const showAttach = enableAttachments;
|
|
362
|
+
|
|
363
|
+
// ---------------------------------------------------------------------------
|
|
364
|
+
// Configure menu state — drives the Tier 2 drill-down popover
|
|
365
|
+
// ---------------------------------------------------------------------------
|
|
366
|
+
|
|
367
|
+
const [configOpen, setConfigOpen] = useState(false);
|
|
368
|
+
const [configActivePanel, setConfigActivePanel] = useState<string | null>(null);
|
|
369
|
+
const configMcpInitialServerKeyRef = useRef<string | undefined>(undefined);
|
|
370
|
+
|
|
371
|
+
// ---------------------------------------------------------------------------
|
|
372
|
+
// Session env pool — cross-references secrets across all sources
|
|
373
|
+
// ---------------------------------------------------------------------------
|
|
374
|
+
|
|
375
|
+
const personalEnv = usePersonalEnvironment(
|
|
376
|
+
(showAgent || showMcp) ? (org ?? null) : null,
|
|
377
|
+
);
|
|
378
|
+
|
|
379
|
+
const personalEnvKeys = useMemo(
|
|
380
|
+
() => new Set(Object.keys(personalEnv.environment?.spec?.data ?? {})),
|
|
381
|
+
[personalEnv.environment],
|
|
382
|
+
);
|
|
383
|
+
|
|
384
|
+
const pool = useSessionEnvPool({
|
|
385
|
+
personalEnvKeys,
|
|
386
|
+
manualSecrets: sessionVariables?.entries,
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
// ---------------------------------------------------------------------------
|
|
390
|
+
// Setup hooks — instantiated before handleSubmit so it can read their state
|
|
391
|
+
// ---------------------------------------------------------------------------
|
|
392
|
+
|
|
393
|
+
const agentSetup = useAgentSetup(
|
|
394
|
+
showAgent ? (org ?? null) : null,
|
|
395
|
+
pool.availableKeys,
|
|
396
|
+
);
|
|
397
|
+
|
|
398
|
+
const mcpSetup = useMcpServerSetup(
|
|
399
|
+
showMcp ? (org ?? null) : null,
|
|
400
|
+
pool.availableKeys,
|
|
401
|
+
);
|
|
402
|
+
|
|
403
|
+
// ---------------------------------------------------------------------------
|
|
404
|
+
// Attachments — file upload state machine
|
|
405
|
+
// ---------------------------------------------------------------------------
|
|
406
|
+
|
|
407
|
+
const attachments = useAttachments(
|
|
408
|
+
enableAttachments
|
|
409
|
+
? { onValidationError: onAttachmentValidationError }
|
|
410
|
+
: undefined,
|
|
411
|
+
);
|
|
412
|
+
const fileInputRef = useRef<HTMLInputElement>(null);
|
|
413
|
+
const [isDragOver, setIsDragOver] = useState(false);
|
|
414
|
+
|
|
415
|
+
const handleFileInputChange = useCallback(
|
|
416
|
+
(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
417
|
+
if (e.target.files && e.target.files.length > 0) {
|
|
418
|
+
attachments.addFiles(e.target.files);
|
|
419
|
+
}
|
|
420
|
+
if (fileInputRef.current) fileInputRef.current.value = "";
|
|
421
|
+
},
|
|
422
|
+
[attachments],
|
|
423
|
+
);
|
|
424
|
+
|
|
425
|
+
const handleDragOver = useCallback(
|
|
426
|
+
(e: DragEvent) => {
|
|
427
|
+
if (!enableAttachments || isDisabled) return;
|
|
428
|
+
e.preventDefault();
|
|
429
|
+
e.stopPropagation();
|
|
430
|
+
setIsDragOver(true);
|
|
431
|
+
},
|
|
432
|
+
[enableAttachments, isDisabled],
|
|
433
|
+
);
|
|
434
|
+
|
|
435
|
+
const handleDragLeave = useCallback(
|
|
436
|
+
(e: DragEvent) => {
|
|
437
|
+
e.preventDefault();
|
|
438
|
+
e.stopPropagation();
|
|
439
|
+
setIsDragOver(false);
|
|
440
|
+
},
|
|
441
|
+
[],
|
|
442
|
+
);
|
|
443
|
+
|
|
444
|
+
const handleDrop = useCallback(
|
|
445
|
+
(e: DragEvent) => {
|
|
446
|
+
e.preventDefault();
|
|
447
|
+
e.stopPropagation();
|
|
448
|
+
setIsDragOver(false);
|
|
449
|
+
if (!enableAttachments || isDisabled) return;
|
|
450
|
+
if (e.dataTransfer.files.length > 0) {
|
|
451
|
+
attachments.addFiles(e.dataTransfer.files);
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
[enableAttachments, isDisabled, attachments],
|
|
455
|
+
);
|
|
456
|
+
|
|
457
|
+
// ---------------------------------------------------------------------------
|
|
458
|
+
// Submit — aggregates one-time runtimeEnv from all setup flows
|
|
459
|
+
// ---------------------------------------------------------------------------
|
|
460
|
+
|
|
461
|
+
const handleSubmit = useCallback(
|
|
462
|
+
async (message: string) => {
|
|
463
|
+
// Persist save-for-future manual secrets before building runtimeEnv
|
|
464
|
+
if (sessionVariables?.hasSaveForFutureEntries) {
|
|
465
|
+
const saveVars = sessionVariables.toSaveForFutureEnv();
|
|
466
|
+
if (Object.keys(saveVars).length > 0) {
|
|
467
|
+
try {
|
|
468
|
+
await personalEnv.getOrCreate();
|
|
469
|
+
await personalEnv.addVariables(saveVars);
|
|
470
|
+
} catch {
|
|
471
|
+
// Best-effort: if persistence fails, the values still flow
|
|
472
|
+
// into runtimeEnv for this execution via the one-time path.
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
const env: Record<string, EnvVarInput> = {};
|
|
478
|
+
|
|
479
|
+
if (
|
|
480
|
+
agentSetup.state.status === "ready" &&
|
|
481
|
+
agentSetup.state.resolution.mode === "oneTime"
|
|
482
|
+
) {
|
|
483
|
+
Object.assign(env, agentSetup.state.resolution.runtimeEnv);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
const mcpEnv = mcpSetup.pendingRuntimeEnv;
|
|
487
|
+
if (Object.keys(mcpEnv).length > 0) {
|
|
488
|
+
Object.assign(env, mcpEnv);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
if (sessionVariables && sessionVariables.hasValidEntries) {
|
|
492
|
+
Object.assign(env, sessionVariables.toRuntimeEnv());
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
const attachmentInputs = enableAttachments
|
|
496
|
+
? attachments.toAttachmentInputs()
|
|
497
|
+
: undefined;
|
|
498
|
+
|
|
499
|
+
const hasEnv = Object.keys(env).length > 0;
|
|
500
|
+
const hasAttachments =
|
|
501
|
+
attachmentInputs !== undefined && attachmentInputs.length > 0;
|
|
502
|
+
|
|
503
|
+
const context: SessionComposerSubmitContext | undefined =
|
|
504
|
+
hasEnv || hasAttachments
|
|
505
|
+
? {
|
|
506
|
+
runtimeEnv: hasEnv ? env : undefined,
|
|
507
|
+
attachments: hasAttachments ? attachmentInputs : undefined,
|
|
508
|
+
}
|
|
509
|
+
: undefined;
|
|
510
|
+
|
|
511
|
+
onSubmit(message, modelId, context);
|
|
512
|
+
|
|
513
|
+
if (enableAttachments) {
|
|
514
|
+
attachments.clear();
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
[onSubmit, modelId, agentSetup.state, mcpSetup.pendingRuntimeEnv, sessionVariables, enableAttachments, attachments, personalEnv],
|
|
518
|
+
);
|
|
519
|
+
|
|
520
|
+
const composer = useComposer({
|
|
521
|
+
onSubmit: handleSubmit,
|
|
522
|
+
disabled: isDisabled,
|
|
523
|
+
});
|
|
524
|
+
|
|
525
|
+
const handleModelChange = useCallback(
|
|
526
|
+
(id: string) => {
|
|
527
|
+
setModelId(id);
|
|
528
|
+
onModelChange?.(id);
|
|
529
|
+
},
|
|
530
|
+
[onModelChange],
|
|
531
|
+
);
|
|
532
|
+
|
|
533
|
+
const handleDisplayNameResolved = useCallback(
|
|
534
|
+
(key: string, name: string) => {
|
|
535
|
+
setDisplayNames((prev) => {
|
|
536
|
+
const next = new Map(prev);
|
|
537
|
+
next.set(key, name);
|
|
538
|
+
return next;
|
|
539
|
+
});
|
|
540
|
+
},
|
|
541
|
+
[],
|
|
542
|
+
);
|
|
543
|
+
|
|
544
|
+
// ---------------------------------------------------------------------------
|
|
545
|
+
// Agent setup: state-machine-driven popover + environment resolution
|
|
546
|
+
// ---------------------------------------------------------------------------
|
|
547
|
+
|
|
548
|
+
const showEnvForm = agentSetup.state.status === "needsEnvVars";
|
|
549
|
+
const isAgentBusy =
|
|
550
|
+
agentSetup.state.status === "resolving" ||
|
|
551
|
+
agentSetup.state.status === "submitting";
|
|
552
|
+
|
|
553
|
+
const handleConfigOpenChange = useCallback(
|
|
554
|
+
(open: boolean) => {
|
|
555
|
+
setConfigOpen(open);
|
|
556
|
+
if (!open) {
|
|
557
|
+
configMcpInitialServerKeyRef.current = undefined;
|
|
558
|
+
if (configActivePanel === "agent") {
|
|
559
|
+
agentSetup.reset();
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
[configActivePanel, agentSetup],
|
|
564
|
+
);
|
|
565
|
+
|
|
566
|
+
const handleConfigActivePanelChange = useCallback(
|
|
567
|
+
(panel: string | null) => {
|
|
568
|
+
if (configActivePanel === "agent" && panel !== "agent") {
|
|
569
|
+
agentSetup.reset();
|
|
570
|
+
}
|
|
571
|
+
setConfigActivePanel(panel);
|
|
572
|
+
},
|
|
573
|
+
[configActivePanel, agentSetup],
|
|
574
|
+
);
|
|
575
|
+
|
|
576
|
+
const handleAgentSelect = useCallback(
|
|
577
|
+
async (ref: ResourceRef | null) => {
|
|
578
|
+
if (!ref) {
|
|
579
|
+
onAgentRefChange?.(null);
|
|
580
|
+
onAgentResolutionChange?.(null);
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
try {
|
|
585
|
+
const result = await agentSetup.resolveAgent(ref);
|
|
586
|
+
|
|
587
|
+
if (result.status === "ready") {
|
|
588
|
+
onAgentRefChange?.(result.agentRef);
|
|
589
|
+
onAgentResolutionChange?.(result.resolution);
|
|
590
|
+
handleDisplayNameResolved(
|
|
591
|
+
`${result.agentRef.org}/${result.agentRef.slug}`,
|
|
592
|
+
result.agentName,
|
|
593
|
+
);
|
|
594
|
+
setConfigOpen(false);
|
|
595
|
+
}
|
|
596
|
+
// "needsEnvVars" — state machine transitions automatically,
|
|
597
|
+
// panel content switches to env form via `showEnvForm`.
|
|
598
|
+
} catch {
|
|
599
|
+
// Error is captured by agentSetup.state.error — displayed inline.
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
[
|
|
603
|
+
agentSetup,
|
|
604
|
+
onAgentRefChange,
|
|
605
|
+
onAgentResolutionChange,
|
|
606
|
+
handleDisplayNameResolved,
|
|
607
|
+
],
|
|
608
|
+
);
|
|
609
|
+
|
|
610
|
+
const handleEnvFormSubmit = useCallback(
|
|
611
|
+
async (
|
|
612
|
+
values: Record<string, EnvVarInput>,
|
|
613
|
+
{ saveForFuture }: AgentEnvFormSubmitOptions,
|
|
614
|
+
) => {
|
|
615
|
+
try {
|
|
616
|
+
const result = await agentSetup.submitEnvVars(values, { saveForFuture });
|
|
617
|
+
onAgentRefChange?.(result.agentRef);
|
|
618
|
+
onAgentResolutionChange?.(result.resolution);
|
|
619
|
+
handleDisplayNameResolved(
|
|
620
|
+
`${result.agentRef.org}/${result.agentRef.slug}`,
|
|
621
|
+
result.agentName,
|
|
622
|
+
);
|
|
623
|
+
setConfigOpen(false);
|
|
624
|
+
} catch {
|
|
625
|
+
// Error is captured by agentSetup.state.error — displayed inline.
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
[
|
|
629
|
+
agentSetup,
|
|
630
|
+
onAgentRefChange,
|
|
631
|
+
onAgentResolutionChange,
|
|
632
|
+
handleDisplayNameResolved,
|
|
633
|
+
],
|
|
634
|
+
);
|
|
635
|
+
|
|
636
|
+
const handleAgentChipRemove = useCallback(() => {
|
|
637
|
+
onAgentRefChange?.(null);
|
|
638
|
+
onAgentResolutionChange?.(null);
|
|
639
|
+
}, [onAgentRefChange, onAgentResolutionChange]);
|
|
640
|
+
|
|
641
|
+
// ---------------------------------------------------------------------------
|
|
642
|
+
// Initial agent: auto-resolve on mount when initialAgentRef is provided
|
|
643
|
+
// ---------------------------------------------------------------------------
|
|
644
|
+
|
|
645
|
+
const handleAgentSelectRef = useRef(handleAgentSelect);
|
|
646
|
+
handleAgentSelectRef.current = handleAgentSelect;
|
|
647
|
+
|
|
648
|
+
const initialAgentHandled = useRef(false);
|
|
649
|
+
|
|
650
|
+
useEffect(() => {
|
|
651
|
+
if (initialAgentRef && showAgent && !initialAgentHandled.current) {
|
|
652
|
+
initialAgentHandled.current = true;
|
|
653
|
+
handleAgentSelectRef.current(initialAgentRef);
|
|
654
|
+
}
|
|
655
|
+
}, [initialAgentRef, showAgent]);
|
|
656
|
+
|
|
657
|
+
// ---------------------------------------------------------------------------
|
|
658
|
+
// Initial attachments: upload files on mount when provided
|
|
659
|
+
// ---------------------------------------------------------------------------
|
|
660
|
+
|
|
661
|
+
const initialAttachmentsHandled = useRef(false);
|
|
662
|
+
|
|
663
|
+
useEffect(() => {
|
|
664
|
+
if (
|
|
665
|
+
initialAttachments &&
|
|
666
|
+
initialAttachments.length > 0 &&
|
|
667
|
+
enableAttachments &&
|
|
668
|
+
!initialAttachmentsHandled.current
|
|
669
|
+
) {
|
|
670
|
+
initialAttachmentsHandled.current = true;
|
|
671
|
+
attachments.addFiles(initialAttachments);
|
|
672
|
+
}
|
|
673
|
+
}, [initialAttachments, enableAttachments, attachments]);
|
|
674
|
+
|
|
675
|
+
// ---------------------------------------------------------------------------
|
|
676
|
+
// MCP server setup: sync usageInputs to consumer
|
|
677
|
+
// ---------------------------------------------------------------------------
|
|
678
|
+
|
|
679
|
+
useEffect(() => {
|
|
680
|
+
if (!showMcp) return;
|
|
681
|
+
onMcpServerUsagesChange?.(mcpSetup.usageInputs);
|
|
682
|
+
}, [showMcp, mcpSetup.usageInputs, onMcpServerUsagesChange]);
|
|
683
|
+
|
|
684
|
+
// ---------------------------------------------------------------------------
|
|
685
|
+
// Submission blocking: MCP servers must be fully configured before send
|
|
686
|
+
// ---------------------------------------------------------------------------
|
|
687
|
+
|
|
688
|
+
const mcpBlocked = showMcp && !mcpSetup.allReady;
|
|
689
|
+
const canSend = composer.canSubmit && !mcpBlocked;
|
|
690
|
+
|
|
691
|
+
const handleTextareaKeyDown = useCallback(
|
|
692
|
+
(e: KeyboardEvent<HTMLTextAreaElement>) => {
|
|
693
|
+
if (!canSend && e.key === "Enter" && !e.shiftKey) {
|
|
694
|
+
e.preventDefault();
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
composer.textareaProps.onKeyDown(e);
|
|
698
|
+
},
|
|
699
|
+
[canSend, composer.textareaProps],
|
|
700
|
+
);
|
|
701
|
+
|
|
702
|
+
// ---------------------------------------------------------------------------
|
|
703
|
+
// Chips — aggregated from all context sources
|
|
704
|
+
// ---------------------------------------------------------------------------
|
|
705
|
+
|
|
706
|
+
const chips = useMemo(() => {
|
|
707
|
+
const items: ChipItem[] = [];
|
|
708
|
+
|
|
709
|
+
if (agentRef) {
|
|
710
|
+
const refStr = `${agentRef.org}/${agentRef.slug}`;
|
|
711
|
+
items.push({
|
|
712
|
+
key: `agent:${refStr}`,
|
|
713
|
+
label: displayNames.get(refStr) ?? agentRef.slug,
|
|
714
|
+
type: "agent",
|
|
715
|
+
onRemove: handleAgentChipRemove,
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
if (workspace) {
|
|
720
|
+
for (const entry of workspace.entries) {
|
|
721
|
+
items.push({
|
|
722
|
+
key: `ws:${entry.id}`,
|
|
723
|
+
label: entry.name,
|
|
724
|
+
type: "workspace",
|
|
725
|
+
onRemove: () => workspace.remove(entry.id),
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
if (showMcp) {
|
|
731
|
+
for (const [key, entry] of Object.entries(mcpSetup.entries)) {
|
|
732
|
+
const slug = key.slice(key.indexOf("/") + 1);
|
|
733
|
+
const name =
|
|
734
|
+
entry.status !== "loading"
|
|
735
|
+
? (entry.mcpServer.metadata?.name ?? displayNames.get(key) ?? slug)
|
|
736
|
+
: (displayNames.get(key) ?? slug);
|
|
737
|
+
|
|
738
|
+
let detail: string | undefined;
|
|
739
|
+
if (
|
|
740
|
+
entry.status === "ready" &&
|
|
741
|
+
entry.discoveredTools.length > 0 &&
|
|
742
|
+
entry.enabledTools.length < entry.discoveredTools.length
|
|
743
|
+
) {
|
|
744
|
+
detail = `${entry.enabledTools.length}/${entry.discoveredTools.length}`;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
items.push({
|
|
748
|
+
key: `mcp:${key}`,
|
|
749
|
+
label: name,
|
|
750
|
+
type: "mcp",
|
|
751
|
+
onRemove: () => mcpSetup.removeServer(mcpRefFromKey(key)),
|
|
752
|
+
status: entry.status,
|
|
753
|
+
detail,
|
|
754
|
+
onClick:
|
|
755
|
+
entry.status === "needsSetup"
|
|
756
|
+
? () => {
|
|
757
|
+
configMcpInitialServerKeyRef.current = key;
|
|
758
|
+
setConfigOpen(true);
|
|
759
|
+
setConfigActivePanel("mcp");
|
|
760
|
+
}
|
|
761
|
+
: undefined,
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
if (skillRefs) {
|
|
767
|
+
for (const ref of skillRefs) {
|
|
768
|
+
const refStr = `${ref.org}/${ref.slug}`;
|
|
769
|
+
items.push({
|
|
770
|
+
key: `skill:${refStr}`,
|
|
771
|
+
label: displayNames.get(refStr) ?? ref.slug,
|
|
772
|
+
type: "skill",
|
|
773
|
+
onRemove: () => {
|
|
774
|
+
onSkillRefsChange?.(
|
|
775
|
+
skillRefs.filter((r) => `${r.org}/${r.slug}` !== refStr),
|
|
776
|
+
);
|
|
777
|
+
},
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
if (sessionVariables) {
|
|
783
|
+
for (const entry of sessionVariables.entries) {
|
|
784
|
+
const k = entry.key.trim();
|
|
785
|
+
if (k === "") continue;
|
|
786
|
+
items.push({
|
|
787
|
+
key: `secret:${entry.id}`,
|
|
788
|
+
label: k,
|
|
789
|
+
type: "secret",
|
|
790
|
+
onRemove: () => sessionVariables.removeEntry(entry.id),
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
return items;
|
|
796
|
+
}, [
|
|
797
|
+
agentRef,
|
|
798
|
+
handleAgentChipRemove,
|
|
799
|
+
workspace,
|
|
800
|
+
showMcp,
|
|
801
|
+
mcpSetup.entries,
|
|
802
|
+
mcpSetup.removeServer,
|
|
803
|
+
skillRefs,
|
|
804
|
+
sessionVariables,
|
|
805
|
+
displayNames,
|
|
806
|
+
onSkillRefsChange,
|
|
807
|
+
]);
|
|
808
|
+
|
|
809
|
+
const workspaceCount = workspace?.entries.length ?? 0;
|
|
810
|
+
const mcpCount = showMcp ? Object.keys(mcpSetup.entries).length : 0;
|
|
811
|
+
const skillCount = skillRefs?.length ?? 0;
|
|
812
|
+
const sessionVarCount = sessionVariables?.entries.length ?? 0;
|
|
813
|
+
|
|
814
|
+
// ---------------------------------------------------------------------------
|
|
815
|
+
// Required-by map — tracks which keys are needed by which resources
|
|
816
|
+
// ---------------------------------------------------------------------------
|
|
817
|
+
|
|
818
|
+
const requiredByMap = useMemo((): Record<string, string[]> => {
|
|
819
|
+
const map: Record<string, string[]> = {};
|
|
820
|
+
|
|
821
|
+
if (agentSetup.state.status === "needsEnvVars") {
|
|
822
|
+
const agentName = agentSetup.state.agentName;
|
|
823
|
+
for (const v of agentSetup.state.missingVariables) {
|
|
824
|
+
(map[v.key] ??= []).push(agentName);
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
if (showMcp) {
|
|
829
|
+
for (const entry of Object.values(mcpSetup.entries)) {
|
|
830
|
+
if (entry.status !== "needsSetup") continue;
|
|
831
|
+
const serverName = entry.mcpServer.metadata?.name ?? "MCP Server";
|
|
832
|
+
for (const v of entry.missingVariables) {
|
|
833
|
+
(map[v.key] ??= []).push(serverName);
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
return map;
|
|
839
|
+
}, [agentSetup.state, showMcp, mcpSetup.entries]);
|
|
840
|
+
|
|
841
|
+
// ---------------------------------------------------------------------------
|
|
842
|
+
// Configure menu — Tier 2 items and panel renderer
|
|
843
|
+
// ---------------------------------------------------------------------------
|
|
844
|
+
|
|
845
|
+
const configureItems = useMemo((): ConfigureMenuItem[] => {
|
|
846
|
+
const items: ConfigureMenuItem[] = [];
|
|
847
|
+
if (showAgent) {
|
|
848
|
+
items.push({
|
|
849
|
+
id: "agent",
|
|
850
|
+
icon: <AgentIcon />,
|
|
851
|
+
label: "Agent",
|
|
852
|
+
count: agentRef ? 1 : 0,
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
if (showMcp) {
|
|
856
|
+
items.push({
|
|
857
|
+
id: "mcp",
|
|
858
|
+
icon: <McpServerIcon />,
|
|
859
|
+
label: "MCP Servers",
|
|
860
|
+
count: mcpCount,
|
|
861
|
+
hasWarning: mcpSetup.needsSetupCount > 0,
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
if (showSkills) {
|
|
865
|
+
items.push({
|
|
866
|
+
id: "skills",
|
|
867
|
+
icon: <SkillIcon />,
|
|
868
|
+
label: "Skills",
|
|
869
|
+
count: skillCount,
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
if (showSessionVars) {
|
|
873
|
+
items.push({
|
|
874
|
+
id: "sessionVars",
|
|
875
|
+
icon: <SecretsIcon />,
|
|
876
|
+
label: "Session Variables",
|
|
877
|
+
count: sessionVarCount,
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
return items;
|
|
881
|
+
}, [showAgent, agentRef, showMcp, mcpCount, mcpSetup.needsSetupCount, showSkills, skillCount, showSessionVars, sessionVarCount]);
|
|
882
|
+
|
|
883
|
+
const renderConfigPanel = useCallback(
|
|
884
|
+
(panelId: string): React.ReactNode => {
|
|
885
|
+
switch (panelId) {
|
|
886
|
+
case "agent":
|
|
887
|
+
return showEnvForm ? (
|
|
888
|
+
<div>
|
|
889
|
+
<AgentEnvForm
|
|
890
|
+
agentName={
|
|
891
|
+
agentSetup.state.status === "needsEnvVars"
|
|
892
|
+
? agentSetup.state.agentName
|
|
893
|
+
: "Agent"
|
|
894
|
+
}
|
|
895
|
+
variables={
|
|
896
|
+
agentSetup.state.status === "needsEnvVars"
|
|
897
|
+
? agentSetup.state.missingVariables
|
|
898
|
+
: []
|
|
899
|
+
}
|
|
900
|
+
onSubmit={handleEnvFormSubmit}
|
|
901
|
+
onCancel={() => agentSetup.reset()}
|
|
902
|
+
isSubmitting={isAgentBusy}
|
|
903
|
+
disabled={isDisabled}
|
|
904
|
+
poolValues={pool.getAvailableValue}
|
|
905
|
+
/>
|
|
906
|
+
{agentSetup.state.error && (
|
|
907
|
+
<AgentSetupError error={agentSetup.state.error} />
|
|
908
|
+
)}
|
|
909
|
+
</div>
|
|
910
|
+
) : (
|
|
911
|
+
<div className="relative">
|
|
912
|
+
<AgentPicker
|
|
913
|
+
org={org!}
|
|
914
|
+
value={agentRef ?? null}
|
|
915
|
+
onChange={handleAgentSelect}
|
|
916
|
+
onDisplayNameResolved={handleDisplayNameResolved}
|
|
917
|
+
disabled={isDisabled || isAgentBusy}
|
|
918
|
+
/>
|
|
919
|
+
{isAgentBusy && (
|
|
920
|
+
<div className="absolute inset-0 flex items-center justify-center rounded-lg bg-popover/80">
|
|
921
|
+
<ResolveSpinner />
|
|
922
|
+
</div>
|
|
923
|
+
)}
|
|
924
|
+
{agentSetup.state.error && (
|
|
925
|
+
<AgentSetupError error={agentSetup.state.error} />
|
|
926
|
+
)}
|
|
927
|
+
</div>
|
|
928
|
+
);
|
|
929
|
+
|
|
930
|
+
case "mcp":
|
|
931
|
+
return (
|
|
932
|
+
<McpServerPicker
|
|
933
|
+
org={org!}
|
|
934
|
+
setup={{
|
|
935
|
+
entries: mcpSetup.entries,
|
|
936
|
+
onServerAdded: (ref) => mcpSetup.addServer(ref),
|
|
937
|
+
onServerRemoved: (ref) => mcpSetup.removeServer(ref),
|
|
938
|
+
onSubmitEnvVars: (ref, values, opts) =>
|
|
939
|
+
mcpSetup.submitEnvVars(ref, values, {
|
|
940
|
+
saveForFuture: opts.saveForFuture,
|
|
941
|
+
}),
|
|
942
|
+
onEnabledToolsChange: (ref, tools) =>
|
|
943
|
+
mcpSetup.setEnabledTools(ref, tools),
|
|
944
|
+
}}
|
|
945
|
+
initialServerKey={configMcpInitialServerKeyRef.current}
|
|
946
|
+
onDisplayNameResolved={handleDisplayNameResolved}
|
|
947
|
+
disabled={isDisabled}
|
|
948
|
+
poolValues={pool.getAvailableValue}
|
|
949
|
+
/>
|
|
950
|
+
);
|
|
951
|
+
|
|
952
|
+
case "skills":
|
|
953
|
+
return (
|
|
954
|
+
<SkillPicker
|
|
955
|
+
org={org!}
|
|
956
|
+
value={skillRefs ?? []}
|
|
957
|
+
onChange={onSkillRefsChange!}
|
|
958
|
+
onDisplayNameResolved={handleDisplayNameResolved}
|
|
959
|
+
disabled={isDisabled}
|
|
960
|
+
/>
|
|
961
|
+
);
|
|
962
|
+
|
|
963
|
+
case "sessionVars":
|
|
964
|
+
return (
|
|
965
|
+
<SessionVariablesInput
|
|
966
|
+
sessionVariables={sessionVariables!}
|
|
967
|
+
disabled={isDisabled}
|
|
968
|
+
requiredByMap={requiredByMap}
|
|
969
|
+
/>
|
|
970
|
+
);
|
|
971
|
+
|
|
972
|
+
default:
|
|
973
|
+
return null;
|
|
974
|
+
}
|
|
975
|
+
},
|
|
976
|
+
[
|
|
977
|
+
showEnvForm,
|
|
978
|
+
agentSetup,
|
|
979
|
+
isAgentBusy,
|
|
980
|
+
isDisabled,
|
|
981
|
+
org,
|
|
982
|
+
agentRef,
|
|
983
|
+
handleAgentSelect,
|
|
984
|
+
handleEnvFormSubmit,
|
|
985
|
+
handleDisplayNameResolved,
|
|
986
|
+
mcpSetup,
|
|
987
|
+
skillRefs,
|
|
988
|
+
onSkillRefsChange,
|
|
989
|
+
sessionVariables,
|
|
990
|
+
pool,
|
|
991
|
+
requiredByMap,
|
|
992
|
+
],
|
|
993
|
+
);
|
|
994
|
+
|
|
995
|
+
// ---------------------------------------------------------------------------
|
|
996
|
+
// Render
|
|
997
|
+
// ---------------------------------------------------------------------------
|
|
998
|
+
|
|
999
|
+
return (
|
|
1000
|
+
<div
|
|
1001
|
+
role="form"
|
|
1002
|
+
aria-label={ariaLabel}
|
|
1003
|
+
className={cn("shrink-0", className)}
|
|
1004
|
+
>
|
|
1005
|
+
<div
|
|
1006
|
+
className={cn(
|
|
1007
|
+
"rounded-xl border border-border bg-card shadow-sm",
|
|
1008
|
+
"focus-within:ring-2 focus-within:ring-ring",
|
|
1009
|
+
isDisabled && "opacity-50",
|
|
1010
|
+
isDragOver && "ring-2 ring-primary/50",
|
|
1011
|
+
)}
|
|
1012
|
+
onDragOver={handleDragOver}
|
|
1013
|
+
onDragLeave={handleDragLeave}
|
|
1014
|
+
onDrop={handleDrop}
|
|
1015
|
+
>
|
|
1016
|
+
{/* Zone 1: Textarea */}
|
|
1017
|
+
<div className="relative">
|
|
1018
|
+
<textarea
|
|
1019
|
+
{...composer.textareaProps}
|
|
1020
|
+
onKeyDown={handleTextareaKeyDown}
|
|
1021
|
+
placeholder={placeholder}
|
|
1022
|
+
rows={initialRows}
|
|
1023
|
+
autoFocus={autoFocus}
|
|
1024
|
+
className="block w-full resize-none bg-transparent px-4 pt-3 pb-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed"
|
|
1025
|
+
/>
|
|
1026
|
+
{isDragOver && (
|
|
1027
|
+
<div className="pointer-events-none absolute inset-0 flex items-center justify-center rounded-t-xl bg-primary/5">
|
|
1028
|
+
<span className="text-xs font-medium text-primary">
|
|
1029
|
+
Drop files to attach
|
|
1030
|
+
</span>
|
|
1031
|
+
</div>
|
|
1032
|
+
)}
|
|
1033
|
+
</div>
|
|
1034
|
+
|
|
1035
|
+
{/* Hidden file input for the attach button */}
|
|
1036
|
+
{showAttach && (
|
|
1037
|
+
<input
|
|
1038
|
+
ref={fileInputRef}
|
|
1039
|
+
type="file"
|
|
1040
|
+
multiple
|
|
1041
|
+
onChange={handleFileInputChange}
|
|
1042
|
+
className="hidden"
|
|
1043
|
+
aria-hidden="true"
|
|
1044
|
+
tabIndex={-1}
|
|
1045
|
+
/>
|
|
1046
|
+
)}
|
|
1047
|
+
|
|
1048
|
+
{/* Zone 2: Context chips */}
|
|
1049
|
+
{chips.length > 0 && (
|
|
1050
|
+
<div className="flex flex-wrap gap-1.5 px-3 pb-2">
|
|
1051
|
+
{chips.map((chip) => (
|
|
1052
|
+
<ContextChip
|
|
1053
|
+
key={chip.key}
|
|
1054
|
+
label={chip.label}
|
|
1055
|
+
type={chip.type}
|
|
1056
|
+
onRemove={chip.onRemove}
|
|
1057
|
+
disabled={isDisabled}
|
|
1058
|
+
status={chip.status}
|
|
1059
|
+
detail={chip.detail}
|
|
1060
|
+
onClick={chip.onClick}
|
|
1061
|
+
/>
|
|
1062
|
+
))}
|
|
1063
|
+
</div>
|
|
1064
|
+
)}
|
|
1065
|
+
|
|
1066
|
+
{/* Zone 2.5: Attachment chips */}
|
|
1067
|
+
{showAttach && attachments.hasEntries && (
|
|
1068
|
+
<AttachmentChipList
|
|
1069
|
+
entries={attachments.entries}
|
|
1070
|
+
onRemove={attachments.removeEntry}
|
|
1071
|
+
onRetry={attachments.retryEntry}
|
|
1072
|
+
disabled={isDisabled}
|
|
1073
|
+
className="px-3 pb-2"
|
|
1074
|
+
/>
|
|
1075
|
+
)}
|
|
1076
|
+
|
|
1077
|
+
{/* Zone 2.75: MCP setup warning */}
|
|
1078
|
+
{showMcp && mcpSetup.needsSetupCount > 0 && (
|
|
1079
|
+
<div
|
|
1080
|
+
role="status"
|
|
1081
|
+
className="mx-3 mb-2 flex items-center gap-2 rounded-md bg-warning/10 px-2.5 py-1.5 text-xs text-warning"
|
|
1082
|
+
>
|
|
1083
|
+
<AlertTriangleIcon />
|
|
1084
|
+
<span>
|
|
1085
|
+
{mcpSetup.needsSetupCount === 1
|
|
1086
|
+
? "1 MCP server needs configuration"
|
|
1087
|
+
: `${mcpSetup.needsSetupCount} MCP servers need configuration`}
|
|
1088
|
+
</span>
|
|
1089
|
+
<button
|
|
1090
|
+
type="button"
|
|
1091
|
+
onClick={() => {
|
|
1092
|
+
if (mcpSetup.needsSetupCount === 1) {
|
|
1093
|
+
const key = Object.entries(mcpSetup.entries).find(
|
|
1094
|
+
([, e]) => e.status === "needsSetup",
|
|
1095
|
+
)?.[0];
|
|
1096
|
+
configMcpInitialServerKeyRef.current = key;
|
|
1097
|
+
} else {
|
|
1098
|
+
configMcpInitialServerKeyRef.current = undefined;
|
|
1099
|
+
}
|
|
1100
|
+
setConfigOpen(true);
|
|
1101
|
+
setConfigActivePanel("mcp");
|
|
1102
|
+
}}
|
|
1103
|
+
disabled={isDisabled}
|
|
1104
|
+
className="ml-auto shrink-0 rounded px-1.5 py-0.5 text-[0.6rem] font-medium hover:bg-warning/20 disabled:pointer-events-none disabled:opacity-50"
|
|
1105
|
+
>
|
|
1106
|
+
Configure
|
|
1107
|
+
</button>
|
|
1108
|
+
</div>
|
|
1109
|
+
)}
|
|
1110
|
+
|
|
1111
|
+
{/* Zone 3: Toolbar */}
|
|
1112
|
+
<ComposerToolbar
|
|
1113
|
+
disabled={isDisabled}
|
|
1114
|
+
isSubmitting={isSubmitting}
|
|
1115
|
+
canSend={canSend}
|
|
1116
|
+
onSend={composer.submit}
|
|
1117
|
+
showAttach={showAttach}
|
|
1118
|
+
attachmentCount={attachments.entries.length}
|
|
1119
|
+
onAttachClick={() => fileInputRef.current?.click()}
|
|
1120
|
+
showWorkspace={showWorkspace}
|
|
1121
|
+
workspaceCount={workspaceCount}
|
|
1122
|
+
workspaceContent={
|
|
1123
|
+
workspace
|
|
1124
|
+
? <WorkspaceEditor
|
|
1125
|
+
workspace={workspace}
|
|
1126
|
+
disabled={isDisabled}
|
|
1127
|
+
gitHubConnection={gitHubConnection}
|
|
1128
|
+
enableGitHub={enableGitHub}
|
|
1129
|
+
enableLocal={enableLocal}
|
|
1130
|
+
enableFolderBrowser={enableFolderBrowser}
|
|
1131
|
+
/>
|
|
1132
|
+
: null
|
|
1133
|
+
}
|
|
1134
|
+
configureItems={configureItems}
|
|
1135
|
+
configOpen={configOpen}
|
|
1136
|
+
onConfigOpenChange={handleConfigOpenChange}
|
|
1137
|
+
configActivePanel={configActivePanel}
|
|
1138
|
+
onConfigActivePanelChange={handleConfigActivePanelChange}
|
|
1139
|
+
renderConfigPanel={renderConfigPanel}
|
|
1140
|
+
showModelSelector={showModelSelector}
|
|
1141
|
+
modelId={modelId}
|
|
1142
|
+
onModelChange={handleModelChange}
|
|
1143
|
+
/>
|
|
1144
|
+
</div>
|
|
1145
|
+
</div>
|
|
1146
|
+
);
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
// ---------------------------------------------------------------------------
|
|
1150
|
+
// Agent setup error — secret-flow guidance or generic fallback
|
|
1151
|
+
// ---------------------------------------------------------------------------
|
|
1152
|
+
|
|
1153
|
+
function AgentSetupError({ error }: { error: Error }) {
|
|
1154
|
+
if (isSecretFlowError(error)) {
|
|
1155
|
+
return <SecretFlowErrorGuide error={error} className="mt-2" />;
|
|
1156
|
+
}
|
|
1157
|
+
return (
|
|
1158
|
+
<p className="mt-2 text-xs text-destructive">
|
|
1159
|
+
{getUserMessage(error)}
|
|
1160
|
+
</p>
|
|
1161
|
+
);
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
// ---------------------------------------------------------------------------
|
|
1165
|
+
// MCP key-to-ref utility
|
|
1166
|
+
// ---------------------------------------------------------------------------
|
|
1167
|
+
|
|
1168
|
+
function mcpRefFromKey(key: string): ResourceRef {
|
|
1169
|
+
const idx = key.indexOf("/");
|
|
1170
|
+
return {
|
|
1171
|
+
org: key.slice(0, idx),
|
|
1172
|
+
slug: key.slice(idx + 1),
|
|
1173
|
+
kind: ApiResourceKind.mcp_server,
|
|
1174
|
+
};
|
|
1175
|
+
}
|