crca 1.4.0__py3-none-any.whl
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.
- .github/ISSUE_TEMPLATE/bug_report.md +65 -0
- .github/ISSUE_TEMPLATE/feature_request.md +41 -0
- .github/PULL_REQUEST_TEMPLATE.md +20 -0
- .github/workflows/publish-manual.yml +61 -0
- .github/workflows/publish.yml +64 -0
- .gitignore +214 -0
- CRCA.py +4156 -0
- LICENSE +201 -0
- MANIFEST.in +43 -0
- PKG-INFO +5035 -0
- README.md +4959 -0
- __init__.py +17 -0
- branches/CRCA-Q.py +2728 -0
- branches/crca_cg/corposwarm.py +9065 -0
- branches/crca_cg/fix_rancher_docker_creds.ps1 +155 -0
- branches/crca_cg/package.json +5 -0
- branches/crca_cg/test_bolt_integration.py +446 -0
- branches/crca_cg/test_corposwarm_comprehensive.py +773 -0
- branches/crca_cg/test_new_features.py +163 -0
- branches/crca_sd/__init__.py +149 -0
- branches/crca_sd/crca_sd_core.py +770 -0
- branches/crca_sd/crca_sd_governance.py +1325 -0
- branches/crca_sd/crca_sd_mpc.py +1130 -0
- branches/crca_sd/crca_sd_realtime.py +1844 -0
- branches/crca_sd/crca_sd_tui.py +1133 -0
- crca-1.4.0.dist-info/METADATA +5035 -0
- crca-1.4.0.dist-info/RECORD +501 -0
- crca-1.4.0.dist-info/WHEEL +4 -0
- crca-1.4.0.dist-info/licenses/LICENSE +201 -0
- docs/CRCA-Q.md +2333 -0
- examples/config.yaml.example +25 -0
- examples/crca_sd_example.py +513 -0
- examples/data_broker_example.py +294 -0
- examples/logistics_corporation.py +861 -0
- examples/palantir_example.py +299 -0
- examples/policy_bench.py +934 -0
- examples/pridnestrovia-sd.py +705 -0
- examples/pridnestrovia_realtime.py +1902 -0
- prompts/__init__.py +10 -0
- prompts/default_crca.py +101 -0
- pyproject.toml +151 -0
- requirements.txt +76 -0
- schemas/__init__.py +43 -0
- schemas/mcpSchemas.py +51 -0
- schemas/policy.py +458 -0
- templates/__init__.py +38 -0
- templates/base_specialized_agent.py +195 -0
- templates/drift_detection.py +325 -0
- templates/examples/causal_agent_template.py +309 -0
- templates/examples/drag_drop_example.py +213 -0
- templates/examples/logistics_agent_template.py +207 -0
- templates/examples/trading_agent_template.py +206 -0
- templates/feature_mixins.py +253 -0
- templates/graph_management.py +442 -0
- templates/llm_integration.py +194 -0
- templates/module_registry.py +276 -0
- templates/mpc_planner.py +280 -0
- templates/policy_loop.py +1168 -0
- templates/prediction_framework.py +448 -0
- templates/statistical_methods.py +778 -0
- tests/sanity.yml +31 -0
- tests/sanity_check +406 -0
- tests/test_core.py +47 -0
- tests/test_crca_excel.py +166 -0
- tests/test_crca_sd.py +780 -0
- tests/test_data_broker.py +424 -0
- tests/test_palantir.py +349 -0
- tools/__init__.py +38 -0
- tools/actuators.py +437 -0
- tools/bolt.diy/Dockerfile +103 -0
- tools/bolt.diy/app/components/@settings/core/AvatarDropdown.tsx +175 -0
- tools/bolt.diy/app/components/@settings/core/ControlPanel.tsx +345 -0
- tools/bolt.diy/app/components/@settings/core/constants.tsx +108 -0
- tools/bolt.diy/app/components/@settings/core/types.ts +114 -0
- tools/bolt.diy/app/components/@settings/index.ts +12 -0
- tools/bolt.diy/app/components/@settings/shared/components/TabTile.tsx +151 -0
- tools/bolt.diy/app/components/@settings/shared/service-integration/ConnectionForm.tsx +193 -0
- tools/bolt.diy/app/components/@settings/shared/service-integration/ConnectionTestIndicator.tsx +60 -0
- tools/bolt.diy/app/components/@settings/shared/service-integration/ErrorState.tsx +102 -0
- tools/bolt.diy/app/components/@settings/shared/service-integration/LoadingState.tsx +94 -0
- tools/bolt.diy/app/components/@settings/shared/service-integration/ServiceHeader.tsx +72 -0
- tools/bolt.diy/app/components/@settings/shared/service-integration/index.ts +6 -0
- tools/bolt.diy/app/components/@settings/tabs/data/DataTab.tsx +721 -0
- tools/bolt.diy/app/components/@settings/tabs/data/DataVisualization.tsx +384 -0
- tools/bolt.diy/app/components/@settings/tabs/event-logs/EventLogsTab.tsx +1013 -0
- tools/bolt.diy/app/components/@settings/tabs/features/FeaturesTab.tsx +295 -0
- tools/bolt.diy/app/components/@settings/tabs/github/GitHubTab.tsx +281 -0
- tools/bolt.diy/app/components/@settings/tabs/github/components/GitHubAuthDialog.tsx +173 -0
- tools/bolt.diy/app/components/@settings/tabs/github/components/GitHubCacheManager.tsx +367 -0
- tools/bolt.diy/app/components/@settings/tabs/github/components/GitHubConnection.tsx +233 -0
- tools/bolt.diy/app/components/@settings/tabs/github/components/GitHubErrorBoundary.tsx +105 -0
- tools/bolt.diy/app/components/@settings/tabs/github/components/GitHubProgressiveLoader.tsx +266 -0
- tools/bolt.diy/app/components/@settings/tabs/github/components/GitHubRepositoryCard.tsx +121 -0
- tools/bolt.diy/app/components/@settings/tabs/github/components/GitHubRepositorySelector.tsx +312 -0
- tools/bolt.diy/app/components/@settings/tabs/github/components/GitHubStats.tsx +291 -0
- tools/bolt.diy/app/components/@settings/tabs/github/components/GitHubUserProfile.tsx +46 -0
- tools/bolt.diy/app/components/@settings/tabs/github/components/shared/GitHubStateIndicators.tsx +264 -0
- tools/bolt.diy/app/components/@settings/tabs/github/components/shared/RepositoryCard.tsx +361 -0
- tools/bolt.diy/app/components/@settings/tabs/github/components/shared/index.ts +11 -0
- tools/bolt.diy/app/components/@settings/tabs/gitlab/GitLabTab.tsx +305 -0
- tools/bolt.diy/app/components/@settings/tabs/gitlab/components/GitLabAuthDialog.tsx +186 -0
- tools/bolt.diy/app/components/@settings/tabs/gitlab/components/GitLabConnection.tsx +253 -0
- tools/bolt.diy/app/components/@settings/tabs/gitlab/components/GitLabRepositorySelector.tsx +358 -0
- tools/bolt.diy/app/components/@settings/tabs/gitlab/components/RepositoryCard.tsx +79 -0
- tools/bolt.diy/app/components/@settings/tabs/gitlab/components/RepositoryList.tsx +142 -0
- tools/bolt.diy/app/components/@settings/tabs/gitlab/components/StatsDisplay.tsx +91 -0
- tools/bolt.diy/app/components/@settings/tabs/gitlab/components/index.ts +4 -0
- tools/bolt.diy/app/components/@settings/tabs/mcp/McpServerList.tsx +99 -0
- tools/bolt.diy/app/components/@settings/tabs/mcp/McpServerListItem.tsx +70 -0
- tools/bolt.diy/app/components/@settings/tabs/mcp/McpStatusBadge.tsx +37 -0
- tools/bolt.diy/app/components/@settings/tabs/mcp/McpTab.tsx +239 -0
- tools/bolt.diy/app/components/@settings/tabs/netlify/NetlifyTab.tsx +1393 -0
- tools/bolt.diy/app/components/@settings/tabs/netlify/components/NetlifyConnection.tsx +990 -0
- tools/bolt.diy/app/components/@settings/tabs/netlify/components/index.ts +1 -0
- tools/bolt.diy/app/components/@settings/tabs/notifications/NotificationsTab.tsx +300 -0
- tools/bolt.diy/app/components/@settings/tabs/profile/ProfileTab.tsx +181 -0
- tools/bolt.diy/app/components/@settings/tabs/providers/cloud/CloudProvidersTab.tsx +308 -0
- tools/bolt.diy/app/components/@settings/tabs/providers/local/ErrorBoundary.tsx +68 -0
- tools/bolt.diy/app/components/@settings/tabs/providers/local/HealthStatusBadge.tsx +64 -0
- tools/bolt.diy/app/components/@settings/tabs/providers/local/LoadingSkeleton.tsx +107 -0
- tools/bolt.diy/app/components/@settings/tabs/providers/local/LocalProvidersTab.tsx +556 -0
- tools/bolt.diy/app/components/@settings/tabs/providers/local/ModelCard.tsx +106 -0
- tools/bolt.diy/app/components/@settings/tabs/providers/local/ProviderCard.tsx +120 -0
- tools/bolt.diy/app/components/@settings/tabs/providers/local/SetupGuide.tsx +671 -0
- tools/bolt.diy/app/components/@settings/tabs/providers/local/StatusDashboard.tsx +91 -0
- tools/bolt.diy/app/components/@settings/tabs/providers/local/types.ts +44 -0
- tools/bolt.diy/app/components/@settings/tabs/settings/SettingsTab.tsx +215 -0
- tools/bolt.diy/app/components/@settings/tabs/supabase/SupabaseTab.tsx +1089 -0
- tools/bolt.diy/app/components/@settings/tabs/vercel/VercelTab.tsx +909 -0
- tools/bolt.diy/app/components/@settings/tabs/vercel/components/VercelConnection.tsx +368 -0
- tools/bolt.diy/app/components/@settings/tabs/vercel/components/index.ts +1 -0
- tools/bolt.diy/app/components/@settings/utils/tab-helpers.ts +54 -0
- tools/bolt.diy/app/components/chat/APIKeyManager.tsx +169 -0
- tools/bolt.diy/app/components/chat/Artifact.tsx +296 -0
- tools/bolt.diy/app/components/chat/AssistantMessage.tsx +192 -0
- tools/bolt.diy/app/components/chat/BaseChat.module.scss +47 -0
- tools/bolt.diy/app/components/chat/BaseChat.tsx +522 -0
- tools/bolt.diy/app/components/chat/Chat.client.tsx +670 -0
- tools/bolt.diy/app/components/chat/ChatAlert.tsx +108 -0
- tools/bolt.diy/app/components/chat/ChatBox.tsx +334 -0
- tools/bolt.diy/app/components/chat/CodeBlock.module.scss +10 -0
- tools/bolt.diy/app/components/chat/CodeBlock.tsx +85 -0
- tools/bolt.diy/app/components/chat/DicussMode.tsx +17 -0
- tools/bolt.diy/app/components/chat/ExamplePrompts.tsx +37 -0
- tools/bolt.diy/app/components/chat/FilePreview.tsx +38 -0
- tools/bolt.diy/app/components/chat/GitCloneButton.tsx +327 -0
- tools/bolt.diy/app/components/chat/ImportFolderButton.tsx +141 -0
- tools/bolt.diy/app/components/chat/LLMApiAlert.tsx +109 -0
- tools/bolt.diy/app/components/chat/MCPTools.tsx +129 -0
- tools/bolt.diy/app/components/chat/Markdown.module.scss +171 -0
- tools/bolt.diy/app/components/chat/Markdown.spec.ts +48 -0
- tools/bolt.diy/app/components/chat/Markdown.tsx +252 -0
- tools/bolt.diy/app/components/chat/Messages.client.tsx +102 -0
- tools/bolt.diy/app/components/chat/ModelSelector.tsx +797 -0
- tools/bolt.diy/app/components/chat/NetlifyDeploymentLink.client.tsx +51 -0
- tools/bolt.diy/app/components/chat/ProgressCompilation.tsx +110 -0
- tools/bolt.diy/app/components/chat/ScreenshotStateManager.tsx +33 -0
- tools/bolt.diy/app/components/chat/SendButton.client.tsx +39 -0
- tools/bolt.diy/app/components/chat/SpeechRecognition.tsx +28 -0
- tools/bolt.diy/app/components/chat/StarterTemplates.tsx +38 -0
- tools/bolt.diy/app/components/chat/SupabaseAlert.tsx +199 -0
- tools/bolt.diy/app/components/chat/SupabaseConnection.tsx +339 -0
- tools/bolt.diy/app/components/chat/ThoughtBox.tsx +43 -0
- tools/bolt.diy/app/components/chat/ToolInvocations.tsx +409 -0
- tools/bolt.diy/app/components/chat/UserMessage.tsx +101 -0
- tools/bolt.diy/app/components/chat/VercelDeploymentLink.client.tsx +158 -0
- tools/bolt.diy/app/components/chat/chatExportAndImport/ExportChatButton.tsx +49 -0
- tools/bolt.diy/app/components/chat/chatExportAndImport/ImportButtons.tsx +96 -0
- tools/bolt.diy/app/components/deploy/DeployAlert.tsx +197 -0
- tools/bolt.diy/app/components/deploy/DeployButton.tsx +277 -0
- tools/bolt.diy/app/components/deploy/GitHubDeploy.client.tsx +171 -0
- tools/bolt.diy/app/components/deploy/GitHubDeploymentDialog.tsx +1041 -0
- tools/bolt.diy/app/components/deploy/GitLabDeploy.client.tsx +171 -0
- tools/bolt.diy/app/components/deploy/GitLabDeploymentDialog.tsx +764 -0
- tools/bolt.diy/app/components/deploy/NetlifyDeploy.client.tsx +246 -0
- tools/bolt.diy/app/components/deploy/VercelDeploy.client.tsx +235 -0
- tools/bolt.diy/app/components/editor/codemirror/BinaryContent.tsx +7 -0
- tools/bolt.diy/app/components/editor/codemirror/CodeMirrorEditor.tsx +555 -0
- tools/bolt.diy/app/components/editor/codemirror/EnvMasking.ts +80 -0
- tools/bolt.diy/app/components/editor/codemirror/cm-theme.ts +192 -0
- tools/bolt.diy/app/components/editor/codemirror/indent.ts +68 -0
- tools/bolt.diy/app/components/editor/codemirror/languages.ts +112 -0
- tools/bolt.diy/app/components/git/GitUrlImport.client.tsx +147 -0
- tools/bolt.diy/app/components/header/Header.tsx +42 -0
- tools/bolt.diy/app/components/header/HeaderActionButtons.client.tsx +54 -0
- tools/bolt.diy/app/components/mandate/MandateSubmission.tsx +167 -0
- tools/bolt.diy/app/components/observability/DeploymentStatus.tsx +168 -0
- tools/bolt.diy/app/components/observability/EventTimeline.tsx +119 -0
- tools/bolt.diy/app/components/observability/FileDiffViewer.tsx +121 -0
- tools/bolt.diy/app/components/observability/GovernanceStatus.tsx +197 -0
- tools/bolt.diy/app/components/observability/GovernorMetrics.tsx +246 -0
- tools/bolt.diy/app/components/observability/LogStream.tsx +244 -0
- tools/bolt.diy/app/components/observability/MandateDetails.tsx +201 -0
- tools/bolt.diy/app/components/observability/ObservabilityDashboard.tsx +200 -0
- tools/bolt.diy/app/components/sidebar/HistoryItem.tsx +187 -0
- tools/bolt.diy/app/components/sidebar/Menu.client.tsx +536 -0
- tools/bolt.diy/app/components/sidebar/date-binning.ts +59 -0
- tools/bolt.diy/app/components/txt +1 -0
- tools/bolt.diy/app/components/ui/BackgroundRays/index.tsx +18 -0
- tools/bolt.diy/app/components/ui/BackgroundRays/styles.module.scss +246 -0
- tools/bolt.diy/app/components/ui/Badge.tsx +53 -0
- tools/bolt.diy/app/components/ui/BranchSelector.tsx +270 -0
- tools/bolt.diy/app/components/ui/Breadcrumbs.tsx +101 -0
- tools/bolt.diy/app/components/ui/Button.tsx +46 -0
- tools/bolt.diy/app/components/ui/Card.tsx +55 -0
- tools/bolt.diy/app/components/ui/Checkbox.tsx +32 -0
- tools/bolt.diy/app/components/ui/CloseButton.tsx +49 -0
- tools/bolt.diy/app/components/ui/CodeBlock.tsx +103 -0
- tools/bolt.diy/app/components/ui/Collapsible.tsx +9 -0
- tools/bolt.diy/app/components/ui/ColorSchemeDialog.tsx +378 -0
- tools/bolt.diy/app/components/ui/Dialog.tsx +449 -0
- tools/bolt.diy/app/components/ui/Dropdown.tsx +63 -0
- tools/bolt.diy/app/components/ui/EmptyState.tsx +154 -0
- tools/bolt.diy/app/components/ui/FileIcon.tsx +346 -0
- tools/bolt.diy/app/components/ui/FilterChip.tsx +92 -0
- tools/bolt.diy/app/components/ui/GlowingEffect.tsx +192 -0
- tools/bolt.diy/app/components/ui/GradientCard.tsx +100 -0
- tools/bolt.diy/app/components/ui/IconButton.tsx +84 -0
- tools/bolt.diy/app/components/ui/Input.tsx +22 -0
- tools/bolt.diy/app/components/ui/Label.tsx +20 -0
- tools/bolt.diy/app/components/ui/LoadingDots.tsx +27 -0
- tools/bolt.diy/app/components/ui/LoadingOverlay.tsx +32 -0
- tools/bolt.diy/app/components/ui/PanelHeader.tsx +20 -0
- tools/bolt.diy/app/components/ui/PanelHeaderButton.tsx +36 -0
- tools/bolt.diy/app/components/ui/Popover.tsx +29 -0
- tools/bolt.diy/app/components/ui/Progress.tsx +22 -0
- tools/bolt.diy/app/components/ui/RepositoryStats.tsx +87 -0
- tools/bolt.diy/app/components/ui/ScrollArea.tsx +41 -0
- tools/bolt.diy/app/components/ui/SearchInput.tsx +80 -0
- tools/bolt.diy/app/components/ui/SearchResultItem.tsx +134 -0
- tools/bolt.diy/app/components/ui/Separator.tsx +22 -0
- tools/bolt.diy/app/components/ui/SettingsButton.tsx +35 -0
- tools/bolt.diy/app/components/ui/Slider.tsx +73 -0
- tools/bolt.diy/app/components/ui/StatusIndicator.tsx +90 -0
- tools/bolt.diy/app/components/ui/Switch.tsx +37 -0
- tools/bolt.diy/app/components/ui/Tabs.tsx +52 -0
- tools/bolt.diy/app/components/ui/TabsWithSlider.tsx +112 -0
- tools/bolt.diy/app/components/ui/ThemeSwitch.tsx +29 -0
- tools/bolt.diy/app/components/ui/Tooltip.tsx +122 -0
- tools/bolt.diy/app/components/ui/index.ts +38 -0
- tools/bolt.diy/app/components/ui/use-toast.ts +66 -0
- tools/bolt.diy/app/components/workbench/DiffView.tsx +796 -0
- tools/bolt.diy/app/components/workbench/EditorPanel.tsx +174 -0
- tools/bolt.diy/app/components/workbench/ExpoQrModal.tsx +55 -0
- tools/bolt.diy/app/components/workbench/FileBreadcrumb.tsx +150 -0
- tools/bolt.diy/app/components/workbench/FileTree.tsx +565 -0
- tools/bolt.diy/app/components/workbench/Inspector.tsx +126 -0
- tools/bolt.diy/app/components/workbench/InspectorPanel.tsx +146 -0
- tools/bolt.diy/app/components/workbench/LockManager.tsx +262 -0
- tools/bolt.diy/app/components/workbench/PortDropdown.tsx +91 -0
- tools/bolt.diy/app/components/workbench/Preview.tsx +1049 -0
- tools/bolt.diy/app/components/workbench/ScreenshotSelector.tsx +293 -0
- tools/bolt.diy/app/components/workbench/Search.tsx +257 -0
- tools/bolt.diy/app/components/workbench/Workbench.client.tsx +506 -0
- tools/bolt.diy/app/components/workbench/terminal/Terminal.tsx +131 -0
- tools/bolt.diy/app/components/workbench/terminal/TerminalManager.tsx +68 -0
- tools/bolt.diy/app/components/workbench/terminal/TerminalTabs.tsx +277 -0
- tools/bolt.diy/app/components/workbench/terminal/theme.ts +36 -0
- tools/bolt.diy/app/components/workflow/WorkflowPhase.tsx +109 -0
- tools/bolt.diy/app/components/workflow/WorkflowStatus.tsx +60 -0
- tools/bolt.diy/app/components/workflow/WorkflowTimeline.tsx +150 -0
- tools/bolt.diy/app/entry.client.tsx +7 -0
- tools/bolt.diy/app/entry.server.tsx +80 -0
- tools/bolt.diy/app/root.tsx +156 -0
- tools/bolt.diy/app/routes/_index.tsx +175 -0
- tools/bolt.diy/app/routes/api.bug-report.ts +254 -0
- tools/bolt.diy/app/routes/api.chat.ts +463 -0
- tools/bolt.diy/app/routes/api.check-env-key.ts +41 -0
- tools/bolt.diy/app/routes/api.configured-providers.ts +110 -0
- tools/bolt.diy/app/routes/api.corporate-swarm-status.ts +55 -0
- tools/bolt.diy/app/routes/api.enhancer.ts +137 -0
- tools/bolt.diy/app/routes/api.export-api-keys.ts +44 -0
- tools/bolt.diy/app/routes/api.git-info.ts +69 -0
- tools/bolt.diy/app/routes/api.git-proxy.$.ts +178 -0
- tools/bolt.diy/app/routes/api.github-branches.ts +166 -0
- tools/bolt.diy/app/routes/api.github-deploy.ts +67 -0
- tools/bolt.diy/app/routes/api.github-stats.ts +198 -0
- tools/bolt.diy/app/routes/api.github-template.ts +242 -0
- tools/bolt.diy/app/routes/api.github-user.ts +287 -0
- tools/bolt.diy/app/routes/api.gitlab-branches.ts +143 -0
- tools/bolt.diy/app/routes/api.gitlab-deploy.ts +67 -0
- tools/bolt.diy/app/routes/api.gitlab-projects.ts +105 -0
- tools/bolt.diy/app/routes/api.health.ts +8 -0
- tools/bolt.diy/app/routes/api.llmcall.ts +298 -0
- tools/bolt.diy/app/routes/api.mandate.ts +351 -0
- tools/bolt.diy/app/routes/api.mcp-check.ts +16 -0
- tools/bolt.diy/app/routes/api.mcp-update-config.ts +23 -0
- tools/bolt.diy/app/routes/api.models.$provider.ts +2 -0
- tools/bolt.diy/app/routes/api.models.ts +90 -0
- tools/bolt.diy/app/routes/api.netlify-deploy.ts +240 -0
- tools/bolt.diy/app/routes/api.netlify-user.ts +142 -0
- tools/bolt.diy/app/routes/api.supabase-user.ts +199 -0
- tools/bolt.diy/app/routes/api.supabase.query.ts +92 -0
- tools/bolt.diy/app/routes/api.supabase.ts +56 -0
- tools/bolt.diy/app/routes/api.supabase.variables.ts +32 -0
- tools/bolt.diy/app/routes/api.system.diagnostics.ts +142 -0
- tools/bolt.diy/app/routes/api.system.disk-info.ts +311 -0
- tools/bolt.diy/app/routes/api.system.git-info.ts +332 -0
- tools/bolt.diy/app/routes/api.update.ts +21 -0
- tools/bolt.diy/app/routes/api.vercel-deploy.ts +497 -0
- tools/bolt.diy/app/routes/api.vercel-user.ts +161 -0
- tools/bolt.diy/app/routes/api.workflow-status.$proposalId.ts +309 -0
- tools/bolt.diy/app/routes/chat.$id.tsx +8 -0
- tools/bolt.diy/app/routes/execute.$mandateId.tsx +432 -0
- tools/bolt.diy/app/routes/git.tsx +25 -0
- tools/bolt.diy/app/routes/observability.$mandateId.tsx +50 -0
- tools/bolt.diy/app/routes/webcontainer.connect.$id.tsx +32 -0
- tools/bolt.diy/app/routes/webcontainer.preview.$id.tsx +97 -0
- tools/bolt.diy/app/routes/workflow.$proposalId.tsx +170 -0
- tools/bolt.diy/app/styles/animations.scss +49 -0
- tools/bolt.diy/app/styles/components/code.scss +9 -0
- tools/bolt.diy/app/styles/components/editor.scss +135 -0
- tools/bolt.diy/app/styles/components/resize-handle.scss +30 -0
- tools/bolt.diy/app/styles/components/terminal.scss +3 -0
- tools/bolt.diy/app/styles/components/toast.scss +23 -0
- tools/bolt.diy/app/styles/diff-view.css +72 -0
- tools/bolt.diy/app/styles/index.scss +73 -0
- tools/bolt.diy/app/styles/variables.scss +255 -0
- tools/bolt.diy/app/styles/z-index.scss +37 -0
- tools/bolt.diy/app/types/GitHub.ts +182 -0
- tools/bolt.diy/app/types/GitLab.ts +103 -0
- tools/bolt.diy/app/types/actions.ts +85 -0
- tools/bolt.diy/app/types/artifact.ts +5 -0
- tools/bolt.diy/app/types/context.ts +26 -0
- tools/bolt.diy/app/types/design-scheme.ts +93 -0
- tools/bolt.diy/app/types/global.d.ts +13 -0
- tools/bolt.diy/app/types/mandate.ts +333 -0
- tools/bolt.diy/app/types/model.ts +25 -0
- tools/bolt.diy/app/types/netlify.ts +94 -0
- tools/bolt.diy/app/types/supabase.ts +54 -0
- tools/bolt.diy/app/types/template.ts +8 -0
- tools/bolt.diy/app/types/terminal.ts +9 -0
- tools/bolt.diy/app/types/theme.ts +1 -0
- tools/bolt.diy/app/types/vercel.ts +67 -0
- tools/bolt.diy/app/utils/buffer.ts +29 -0
- tools/bolt.diy/app/utils/classNames.ts +65 -0
- tools/bolt.diy/app/utils/constants.ts +147 -0
- tools/bolt.diy/app/utils/debounce.ts +13 -0
- tools/bolt.diy/app/utils/debugLogger.ts +1284 -0
- tools/bolt.diy/app/utils/diff.spec.ts +11 -0
- tools/bolt.diy/app/utils/diff.ts +117 -0
- tools/bolt.diy/app/utils/easings.ts +3 -0
- tools/bolt.diy/app/utils/fileLocks.ts +96 -0
- tools/bolt.diy/app/utils/fileUtils.ts +121 -0
- tools/bolt.diy/app/utils/folderImport.ts +73 -0
- tools/bolt.diy/app/utils/formatSize.ts +12 -0
- tools/bolt.diy/app/utils/getLanguageFromExtension.ts +24 -0
- tools/bolt.diy/app/utils/githubStats.ts +9 -0
- tools/bolt.diy/app/utils/gitlabStats.ts +54 -0
- tools/bolt.diy/app/utils/logger.ts +162 -0
- tools/bolt.diy/app/utils/markdown.ts +155 -0
- tools/bolt.diy/app/utils/mobile.ts +4 -0
- tools/bolt.diy/app/utils/os.ts +4 -0
- tools/bolt.diy/app/utils/path.ts +19 -0
- tools/bolt.diy/app/utils/projectCommands.ts +197 -0
- tools/bolt.diy/app/utils/promises.ts +19 -0
- tools/bolt.diy/app/utils/react.ts +6 -0
- tools/bolt.diy/app/utils/sampler.ts +49 -0
- tools/bolt.diy/app/utils/selectStarterTemplate.ts +255 -0
- tools/bolt.diy/app/utils/shell.ts +384 -0
- tools/bolt.diy/app/utils/stacktrace.ts +27 -0
- tools/bolt.diy/app/utils/stripIndent.ts +23 -0
- tools/bolt.diy/app/utils/terminal.ts +11 -0
- tools/bolt.diy/app/utils/unreachable.ts +3 -0
- tools/bolt.diy/app/vite-env.d.ts +2 -0
- tools/bolt.diy/assets/entitlements.mac.plist +25 -0
- tools/bolt.diy/assets/icons/icon.icns +0 -0
- tools/bolt.diy/assets/icons/icon.ico +0 -0
- tools/bolt.diy/assets/icons/icon.png +0 -0
- tools/bolt.diy/bindings.js +78 -0
- tools/bolt.diy/bindings.sh +33 -0
- tools/bolt.diy/docker-compose.yaml +145 -0
- tools/bolt.diy/electron/main/index.ts +201 -0
- tools/bolt.diy/electron/main/tsconfig.json +30 -0
- tools/bolt.diy/electron/main/ui/menu.ts +29 -0
- tools/bolt.diy/electron/main/ui/window.ts +54 -0
- tools/bolt.diy/electron/main/utils/auto-update.ts +110 -0
- tools/bolt.diy/electron/main/utils/constants.ts +4 -0
- tools/bolt.diy/electron/main/utils/cookie.ts +40 -0
- tools/bolt.diy/electron/main/utils/reload.ts +35 -0
- tools/bolt.diy/electron/main/utils/serve.ts +71 -0
- tools/bolt.diy/electron/main/utils/store.ts +3 -0
- tools/bolt.diy/electron/main/utils/vite-server.ts +44 -0
- tools/bolt.diy/electron/main/vite.config.ts +44 -0
- tools/bolt.diy/electron/preload/index.ts +22 -0
- tools/bolt.diy/electron/preload/tsconfig.json +7 -0
- tools/bolt.diy/electron/preload/vite.config.ts +31 -0
- tools/bolt.diy/electron-builder.yml +64 -0
- tools/bolt.diy/electron-update.yml +4 -0
- tools/bolt.diy/eslint.config.mjs +57 -0
- tools/bolt.diy/functions/[[path]].ts +12 -0
- tools/bolt.diy/icons/angular.svg +1 -0
- tools/bolt.diy/icons/astro.svg +8 -0
- tools/bolt.diy/icons/chat.svg +1 -0
- tools/bolt.diy/icons/expo-brand.svg +1 -0
- tools/bolt.diy/icons/expo.svg +4 -0
- tools/bolt.diy/icons/logo-text.svg +1 -0
- tools/bolt.diy/icons/logo.svg +4 -0
- tools/bolt.diy/icons/mcp.svg +1 -0
- tools/bolt.diy/icons/nativescript.svg +1 -0
- tools/bolt.diy/icons/netlify.svg +10 -0
- tools/bolt.diy/icons/nextjs.svg +1 -0
- tools/bolt.diy/icons/nuxt.svg +1 -0
- tools/bolt.diy/icons/qwik.svg +1 -0
- tools/bolt.diy/icons/react.svg +1 -0
- tools/bolt.diy/icons/remix.svg +24 -0
- tools/bolt.diy/icons/remotion.svg +1 -0
- tools/bolt.diy/icons/shadcn.svg +21 -0
- tools/bolt.diy/icons/slidev.svg +60 -0
- tools/bolt.diy/icons/solidjs.svg +1 -0
- tools/bolt.diy/icons/stars.svg +1 -0
- tools/bolt.diy/icons/svelte.svg +1 -0
- tools/bolt.diy/icons/typescript.svg +1 -0
- tools/bolt.diy/icons/vite.svg +1 -0
- tools/bolt.diy/icons/vue.svg +1 -0
- tools/bolt.diy/load-context.ts +9 -0
- tools/bolt.diy/notarize.cjs +31 -0
- tools/bolt.diy/package.json +218 -0
- tools/bolt.diy/playwright.config.preview.ts +35 -0
- tools/bolt.diy/pre-start.cjs +26 -0
- tools/bolt.diy/public/apple-touch-icon-precomposed.png +0 -0
- tools/bolt.diy/public/apple-touch-icon.png +0 -0
- tools/bolt.diy/public/favicon.ico +0 -0
- tools/bolt.diy/public/favicon.svg +4 -0
- tools/bolt.diy/public/icons/AmazonBedrock.svg +1 -0
- tools/bolt.diy/public/icons/Anthropic.svg +4 -0
- tools/bolt.diy/public/icons/Cohere.svg +4 -0
- tools/bolt.diy/public/icons/Deepseek.svg +5 -0
- tools/bolt.diy/public/icons/Default.svg +4 -0
- tools/bolt.diy/public/icons/Google.svg +4 -0
- tools/bolt.diy/public/icons/Groq.svg +4 -0
- tools/bolt.diy/public/icons/HuggingFace.svg +4 -0
- tools/bolt.diy/public/icons/Hyperbolic.svg +3 -0
- tools/bolt.diy/public/icons/LMStudio.svg +5 -0
- tools/bolt.diy/public/icons/Mistral.svg +4 -0
- tools/bolt.diy/public/icons/Ollama.svg +4 -0
- tools/bolt.diy/public/icons/OpenAI.svg +4 -0
- tools/bolt.diy/public/icons/OpenAILike.svg +4 -0
- tools/bolt.diy/public/icons/OpenRouter.svg +4 -0
- tools/bolt.diy/public/icons/Perplexity.svg +4 -0
- tools/bolt.diy/public/icons/Together.svg +4 -0
- tools/bolt.diy/public/icons/xAI.svg +5 -0
- tools/bolt.diy/public/inspector-script.js +292 -0
- tools/bolt.diy/public/logo-dark-styled.png +0 -0
- tools/bolt.diy/public/logo-dark.png +0 -0
- tools/bolt.diy/public/logo-light-styled.png +0 -0
- tools/bolt.diy/public/logo-light.png +0 -0
- tools/bolt.diy/public/logo.svg +15 -0
- tools/bolt.diy/public/social_preview_index.jpg +0 -0
- tools/bolt.diy/scripts/clean.js +45 -0
- tools/bolt.diy/scripts/electron-dev.mjs +181 -0
- tools/bolt.diy/scripts/setup-env.sh +41 -0
- tools/bolt.diy/scripts/update-imports.sh +7 -0
- tools/bolt.diy/scripts/update.sh +52 -0
- tools/bolt.diy/services/execution-governor/Dockerfile +41 -0
- tools/bolt.diy/services/execution-governor/config.ts +42 -0
- tools/bolt.diy/services/execution-governor/index.ts +683 -0
- tools/bolt.diy/services/execution-governor/metrics.ts +141 -0
- tools/bolt.diy/services/execution-governor/package.json +31 -0
- tools/bolt.diy/services/execution-governor/priority-queue.ts +139 -0
- tools/bolt.diy/services/execution-governor/tsconfig.json +21 -0
- tools/bolt.diy/services/execution-governor/types.ts +145 -0
- tools/bolt.diy/services/headless-executor/Dockerfile +43 -0
- tools/bolt.diy/services/headless-executor/executor.ts +210 -0
- tools/bolt.diy/services/headless-executor/index.ts +323 -0
- tools/bolt.diy/services/headless-executor/package.json +27 -0
- tools/bolt.diy/services/headless-executor/tsconfig.json +21 -0
- tools/bolt.diy/services/headless-executor/types.ts +38 -0
- tools/bolt.diy/test-workflows.sh +240 -0
- tools/bolt.diy/tests/integration/corporate-swarm.test.ts +208 -0
- tools/bolt.diy/tests/mandates/budget-limited.json +34 -0
- tools/bolt.diy/tests/mandates/complex.json +53 -0
- tools/bolt.diy/tests/mandates/constraint-enforced.json +36 -0
- tools/bolt.diy/tests/mandates/simple.json +35 -0
- tools/bolt.diy/tsconfig.json +37 -0
- tools/bolt.diy/types/istextorbinary.d.ts +15 -0
- tools/bolt.diy/uno.config.ts +279 -0
- tools/bolt.diy/vite-electron.config.ts +76 -0
- tools/bolt.diy/vite.config.ts +112 -0
- tools/bolt.diy/worker-configuration.d.ts +22 -0
- tools/bolt.diy/wrangler.toml +6 -0
- tools/code_generator.py +461 -0
- tools/file_operations.py +465 -0
- tools/mandate_generator.py +337 -0
- tools/mcpClientUtils.py +1216 -0
- tools/sensors.py +285 -0
- utils/Agent_types.py +15 -0
- utils/AnyToStr.py +0 -0
- utils/HHCS.py +277 -0
- utils/__init__.py +30 -0
- utils/agent.py +3627 -0
- utils/aop.py +2948 -0
- utils/canonical.py +143 -0
- utils/conversation.py +1195 -0
- utils/doctrine_versioning +230 -0
- utils/formatter.py +474 -0
- utils/ledger.py +311 -0
- utils/out_types.py +16 -0
- utils/rollback.py +339 -0
- utils/router.py +929 -0
- utils/tui.py +1908 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import type { ExecutionEvent } from '~/types/mandate';
|
|
3
|
+
import { classNames } from '~/utils/classNames';
|
|
4
|
+
|
|
5
|
+
interface GovernanceStatusProps {
|
|
6
|
+
events: ExecutionEvent[];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* GovernanceStatus component displays ESG scores, risk assessments, and compliance status.
|
|
11
|
+
*/
|
|
12
|
+
export function GovernanceStatus({ events }: GovernanceStatusProps) {
|
|
13
|
+
const governanceEvents = useMemo(() => {
|
|
14
|
+
return events.filter((event) => event.type === 'governance_check');
|
|
15
|
+
}, [events]);
|
|
16
|
+
|
|
17
|
+
const latestGovernance = useMemo(() => {
|
|
18
|
+
if (governanceEvents.length === 0) return null;
|
|
19
|
+
return governanceEvents[governanceEvents.length - 1];
|
|
20
|
+
}, [governanceEvents]);
|
|
21
|
+
|
|
22
|
+
const getRiskColor = (level?: string) => {
|
|
23
|
+
switch (level) {
|
|
24
|
+
case 'critical':
|
|
25
|
+
return 'text-red-600 bg-red-500/20';
|
|
26
|
+
case 'high':
|
|
27
|
+
return 'text-orange-600 bg-orange-500/20';
|
|
28
|
+
case 'medium':
|
|
29
|
+
return 'text-yellow-600 bg-yellow-500/20';
|
|
30
|
+
case 'low':
|
|
31
|
+
return 'text-green-600 bg-green-500/20';
|
|
32
|
+
default:
|
|
33
|
+
return 'text-gray-600 bg-gray-500/20';
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
if (governanceEvents.length === 0) {
|
|
38
|
+
return (
|
|
39
|
+
<div className="text-center py-12">
|
|
40
|
+
<p className="text-bolt-elements-textSecondary">
|
|
41
|
+
No governance checks yet. Governance status will appear here during execution.
|
|
42
|
+
</p>
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<div className="space-y-6">
|
|
49
|
+
{/* Latest Governance Status */}
|
|
50
|
+
{latestGovernance && (
|
|
51
|
+
<div>
|
|
52
|
+
<h3 className="text-lg font-semibold text-bolt-elements-textPrimary mb-4">
|
|
53
|
+
Latest Governance Check (Iteration {latestGovernance.iteration})
|
|
54
|
+
</h3>
|
|
55
|
+
|
|
56
|
+
{/* ESG Scores */}
|
|
57
|
+
{latestGovernance.data.esg_score && (
|
|
58
|
+
<div className="mb-6">
|
|
59
|
+
<h4 className="text-md font-medium text-bolt-elements-textPrimary mb-3">ESG Scores</h4>
|
|
60
|
+
<div className="grid grid-cols-2 gap-4">
|
|
61
|
+
{typeof latestGovernance.data.esg_score === 'object' ? (
|
|
62
|
+
<>
|
|
63
|
+
<div>
|
|
64
|
+
<div className="text-sm text-bolt-elements-textSecondary mb-1">Environmental</div>
|
|
65
|
+
<div className="text-2xl font-bold text-green-500">
|
|
66
|
+
{(latestGovernance.data.esg_score as any).environmental_score?.toFixed(1) || 'N/A'}
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
<div>
|
|
70
|
+
<div className="text-sm text-bolt-elements-textSecondary mb-1">Social</div>
|
|
71
|
+
<div className="text-2xl font-bold text-blue-500">
|
|
72
|
+
{(latestGovernance.data.esg_score as any).social_score?.toFixed(1) || 'N/A'}
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
<div>
|
|
76
|
+
<div className="text-sm text-bolt-elements-textSecondary mb-1">Governance</div>
|
|
77
|
+
<div className="text-2xl font-bold text-purple-500">
|
|
78
|
+
{(latestGovernance.data.esg_score as any).governance_score?.toFixed(1) || 'N/A'}
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
<div>
|
|
82
|
+
<div className="text-sm text-bolt-elements-textSecondary mb-1">Overall</div>
|
|
83
|
+
<div className="text-2xl font-bold text-accent-500">
|
|
84
|
+
{(latestGovernance.data.esg_score as any).overall_score?.toFixed(1) || 'N/A'}
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</>
|
|
88
|
+
) : (
|
|
89
|
+
<div>
|
|
90
|
+
<div className="text-sm text-bolt-elements-textSecondary mb-1">Overall Score</div>
|
|
91
|
+
<div className="text-2xl font-bold text-accent-500">
|
|
92
|
+
{Number(latestGovernance.data.esg_score).toFixed(1)}
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
)}
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
)}
|
|
99
|
+
|
|
100
|
+
{/* Risk Assessment */}
|
|
101
|
+
{latestGovernance.data.risk_assessment && (
|
|
102
|
+
<div className="mb-6">
|
|
103
|
+
<h4 className="text-md font-medium text-bolt-elements-textPrimary mb-3">Risk Assessment</h4>
|
|
104
|
+
<div className="space-y-3">
|
|
105
|
+
<div>
|
|
106
|
+
<div className="flex items-center justify-between mb-2">
|
|
107
|
+
<span className="text-sm text-bolt-elements-textSecondary">Risk Level</span>
|
|
108
|
+
<span
|
|
109
|
+
className={classNames(
|
|
110
|
+
'px-3 py-1 rounded text-sm font-medium',
|
|
111
|
+
getRiskColor(
|
|
112
|
+
(latestGovernance.data.risk_assessment as any)?.risk_level || 'unknown'
|
|
113
|
+
)
|
|
114
|
+
)}
|
|
115
|
+
>
|
|
116
|
+
{(latestGovernance.data.risk_assessment as any)?.risk_level?.toUpperCase() || 'UNKNOWN'}
|
|
117
|
+
</span>
|
|
118
|
+
</div>
|
|
119
|
+
<div className="flex items-center justify-between">
|
|
120
|
+
<span className="text-sm text-bolt-elements-textSecondary">Risk Score</span>
|
|
121
|
+
<span className="text-sm font-medium text-bolt-elements-textPrimary">
|
|
122
|
+
{(latestGovernance.data.risk_assessment as any)?.risk_score?.toFixed(1) || 'N/A'} / 100
|
|
123
|
+
</span>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
{(latestGovernance.data.risk_assessment as any)?.mitigation_strategy && (
|
|
127
|
+
<div>
|
|
128
|
+
<div className="text-sm text-bolt-elements-textSecondary mb-1">Mitigation Strategy</div>
|
|
129
|
+
<p className="text-sm text-bolt-elements-textPrimary">
|
|
130
|
+
{(latestGovernance.data.risk_assessment as any).mitigation_strategy}
|
|
131
|
+
</p>
|
|
132
|
+
</div>
|
|
133
|
+
)}
|
|
134
|
+
{(latestGovernance.data.risk_assessment as any)?.impact_areas &&
|
|
135
|
+
(latestGovernance.data.risk_assessment as any).impact_areas.length > 0 && (
|
|
136
|
+
<div>
|
|
137
|
+
<div className="text-sm text-bolt-elements-textSecondary mb-1">Impact Areas</div>
|
|
138
|
+
<div className="flex flex-wrap gap-2">
|
|
139
|
+
{((latestGovernance.data.risk_assessment as any).impact_areas as string[]).map(
|
|
140
|
+
(area, idx) => (
|
|
141
|
+
<span
|
|
142
|
+
key={idx}
|
|
143
|
+
className="px-2 py-1 rounded text-xs bg-bolt-elements-background-depth-3 text-bolt-elements-textSecondary"
|
|
144
|
+
>
|
|
145
|
+
{area}
|
|
146
|
+
</span>
|
|
147
|
+
)
|
|
148
|
+
)}
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
)}
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
)}
|
|
155
|
+
|
|
156
|
+
{/* Budget Consumption */}
|
|
157
|
+
{latestGovernance.data.budget_consumed !== undefined && (
|
|
158
|
+
<div>
|
|
159
|
+
<h4 className="text-md font-medium text-bolt-elements-textPrimary mb-3">Budget Consumption</h4>
|
|
160
|
+
<div className="text-2xl font-bold text-bolt-elements-textPrimary">
|
|
161
|
+
${Number(latestGovernance.data.budget_consumed).toFixed(2)}
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
)}
|
|
165
|
+
</div>
|
|
166
|
+
)}
|
|
167
|
+
|
|
168
|
+
{/* Governance History */}
|
|
169
|
+
{governanceEvents.length > 1 && (
|
|
170
|
+
<div>
|
|
171
|
+
<h3 className="text-lg font-semibold text-bolt-elements-textPrimary mb-4">Governance History</h3>
|
|
172
|
+
<div className="space-y-2">
|
|
173
|
+
{governanceEvents.map((event, index) => (
|
|
174
|
+
<div
|
|
175
|
+
key={`${event.timestamp}-${index}`}
|
|
176
|
+
className="p-3 rounded border border-bolt-elements-borderColor bg-bolt-elements-background-depth-3"
|
|
177
|
+
>
|
|
178
|
+
<div className="flex items-center justify-between">
|
|
179
|
+
<span className="text-sm font-medium text-bolt-elements-textPrimary">
|
|
180
|
+
Iteration {event.iteration}
|
|
181
|
+
</span>
|
|
182
|
+
<span className="text-xs text-bolt-elements-textTertiary">
|
|
183
|
+
{new Date(event.timestamp).toLocaleTimeString()}
|
|
184
|
+
</span>
|
|
185
|
+
</div>
|
|
186
|
+
{event.data.message && (
|
|
187
|
+
<p className="text-sm text-bolt-elements-textSecondary mt-1">{event.data.message}</p>
|
|
188
|
+
)}
|
|
189
|
+
</div>
|
|
190
|
+
))}
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
)}
|
|
194
|
+
</div>
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Governor Metrics Component
|
|
3
|
+
*
|
|
4
|
+
* Displays Execution Governor state and metrics.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { useState, useEffect } from 'react';
|
|
8
|
+
import { createScopedLogger } from '~/utils/logger';
|
|
9
|
+
|
|
10
|
+
const logger = createScopedLogger('GovernorMetrics');
|
|
11
|
+
|
|
12
|
+
interface GovernorState {
|
|
13
|
+
queueDepth: number;
|
|
14
|
+
activeExecutions: number;
|
|
15
|
+
maxConcurrentExecutions: number;
|
|
16
|
+
registeredWorkers: number;
|
|
17
|
+
healthyWorkers: number;
|
|
18
|
+
totalMandatesProcessed: number;
|
|
19
|
+
totalMandatesFailed: number;
|
|
20
|
+
averageExecutionTime: number;
|
|
21
|
+
currentBudgetUsage: number;
|
|
22
|
+
globalBudgetLimit: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface GovernorMetrics {
|
|
26
|
+
totalMandatesProcessed: number;
|
|
27
|
+
totalMandatesFailed: number;
|
|
28
|
+
totalMandatesCompleted: number;
|
|
29
|
+
averageExecutionTime: number;
|
|
30
|
+
successRate: number;
|
|
31
|
+
failureRate: number;
|
|
32
|
+
byStatus: Record<string, number>;
|
|
33
|
+
byWorker: Record<string, { processed: number; failed: number; avgTime: number }>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface GovernorMetricsProps {
|
|
37
|
+
mandateId: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Governor Metrics display component.
|
|
42
|
+
*/
|
|
43
|
+
export function GovernorMetrics({ mandateId }: GovernorMetricsProps) {
|
|
44
|
+
const [state, setState] = useState<GovernorState | null>(null);
|
|
45
|
+
const [metrics, setMetrics] = useState<GovernorMetrics | null>(null);
|
|
46
|
+
const [loading, setLoading] = useState(true);
|
|
47
|
+
const [error, setError] = useState<string | null>(null);
|
|
48
|
+
|
|
49
|
+
const governorUrl = typeof window !== 'undefined'
|
|
50
|
+
? (window as any).__GOVERNOR_URL__ || process.env.EXECUTION_GOVERNOR_URL || 'http://localhost:3000'
|
|
51
|
+
: 'http://localhost:3000';
|
|
52
|
+
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
const fetchData = async () => {
|
|
55
|
+
try {
|
|
56
|
+
// Fetch governor state
|
|
57
|
+
const stateResponse = await fetch(`${governorUrl}/governor/state`, {
|
|
58
|
+
signal: AbortSignal.timeout(3000) // 3 second timeout
|
|
59
|
+
});
|
|
60
|
+
if (stateResponse.ok) {
|
|
61
|
+
const stateData = await stateResponse.json() as GovernorState;
|
|
62
|
+
setState(stateData);
|
|
63
|
+
} else {
|
|
64
|
+
// Not available, but not an error - Governor is optional
|
|
65
|
+
setLoading(false);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Fetch governor metrics
|
|
70
|
+
const metricsResponse = await fetch(`${governorUrl}/governor/metrics`, {
|
|
71
|
+
signal: AbortSignal.timeout(3000) // 3 second timeout
|
|
72
|
+
});
|
|
73
|
+
if (metricsResponse.ok) {
|
|
74
|
+
const metricsData = await metricsResponse.json() as GovernorMetrics;
|
|
75
|
+
setMetrics(metricsData);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
setLoading(false);
|
|
79
|
+
} catch (err) {
|
|
80
|
+
// Governor service is optional - don't treat as error
|
|
81
|
+
if (err instanceof Error && (
|
|
82
|
+
err.name === 'AbortError' ||
|
|
83
|
+
err.message.includes('NetworkError') ||
|
|
84
|
+
err.message.includes('Failed to fetch')
|
|
85
|
+
)) {
|
|
86
|
+
// Governor service not available - this is expected and OK
|
|
87
|
+
logger.debug('Governor service not available (this is optional)');
|
|
88
|
+
setLoading(false);
|
|
89
|
+
setError(null); // Don't show error for optional service
|
|
90
|
+
} else {
|
|
91
|
+
logger.error('Error fetching governor data:', err);
|
|
92
|
+
setError(err instanceof Error ? err.message : 'Unknown error');
|
|
93
|
+
setLoading(false);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
fetchData();
|
|
99
|
+
const interval = setInterval(fetchData, 5000); // Refresh every 5 seconds
|
|
100
|
+
|
|
101
|
+
return () => clearInterval(interval);
|
|
102
|
+
}, [governorUrl]);
|
|
103
|
+
|
|
104
|
+
if (loading) {
|
|
105
|
+
return (
|
|
106
|
+
<div className="p-4">
|
|
107
|
+
<div className="animate-pulse">Loading governor metrics...</div>
|
|
108
|
+
</div>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (error) {
|
|
113
|
+
return (
|
|
114
|
+
<div className="p-4 text-yellow-500">
|
|
115
|
+
<p>Error loading governor metrics: {error}</p>
|
|
116
|
+
<p className="text-sm text-bolt-elements-textSecondary mt-2">
|
|
117
|
+
Governor service may not be enabled or accessible at {governorUrl}
|
|
118
|
+
</p>
|
|
119
|
+
</div>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// If Governor service is not available, show a friendly message instead of error
|
|
124
|
+
if (!state && !loading) {
|
|
125
|
+
return (
|
|
126
|
+
<div className="p-4">
|
|
127
|
+
<div className="bg-bolt-elements-background-depth-2 border border-bolt-elements-borderColor rounded-lg p-6 text-center">
|
|
128
|
+
<p className="text-bolt-elements-textSecondary mb-2">
|
|
129
|
+
Execution Governor service is not available
|
|
130
|
+
</p>
|
|
131
|
+
<p className="text-sm text-bolt-elements-textTertiary">
|
|
132
|
+
The Governor service provides queue management and execution metrics.
|
|
133
|
+
It's optional and bolt.diy works without it.
|
|
134
|
+
</p>
|
|
135
|
+
<p className="text-xs text-bolt-elements-textTertiary mt-2">
|
|
136
|
+
To enable: Start the Governor service at {governorUrl}
|
|
137
|
+
</p>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (!state) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const budgetUsagePercent = state.globalBudgetLimit > 0
|
|
148
|
+
? (state.currentBudgetUsage / state.globalBudgetLimit) * 100
|
|
149
|
+
: 0;
|
|
150
|
+
|
|
151
|
+
const executionSlotUsage = state.maxConcurrentExecutions > 0
|
|
152
|
+
? (state.activeExecutions / state.maxConcurrentExecutions) * 100
|
|
153
|
+
: 0;
|
|
154
|
+
|
|
155
|
+
return (
|
|
156
|
+
<div className="p-4 space-y-4">
|
|
157
|
+
<h3 className="text-lg font-semibold mb-4">Execution Governor Metrics</h3>
|
|
158
|
+
|
|
159
|
+
{/* Queue Status */}
|
|
160
|
+
<div className="grid grid-cols-2 gap-4">
|
|
161
|
+
<div className="bg-bolt-elements-background-depth-2 p-4 rounded-lg">
|
|
162
|
+
<div className="text-sm text-bolt-elements-textSecondary">Queue Depth</div>
|
|
163
|
+
<div className="text-2xl font-bold text-bolt-elements-textPrimary">{state.queueDepth}</div>
|
|
164
|
+
</div>
|
|
165
|
+
|
|
166
|
+
<div className="bg-bolt-elements-background-depth-2 p-4 rounded-lg">
|
|
167
|
+
<div className="text-sm text-bolt-elements-textSecondary">Active Executions</div>
|
|
168
|
+
<div className="text-2xl font-bold text-bolt-elements-textPrimary">
|
|
169
|
+
{state.activeExecutions} / {state.maxConcurrentExecutions}
|
|
170
|
+
</div>
|
|
171
|
+
<div className="mt-2">
|
|
172
|
+
<div className="w-full bg-gray-700 rounded-full h-2">
|
|
173
|
+
<div
|
|
174
|
+
className="bg-accent-500 h-2 rounded-full transition-all"
|
|
175
|
+
style={{ width: `${Math.min(executionSlotUsage, 100)}%` }}
|
|
176
|
+
/>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
{/* Workers */}
|
|
183
|
+
<div className="bg-bolt-elements-background-depth-2 p-4 rounded-lg">
|
|
184
|
+
<div className="text-sm text-bolt-elements-textSecondary mb-2">Workers</div>
|
|
185
|
+
<div className="flex items-center gap-4">
|
|
186
|
+
<div>
|
|
187
|
+
<span className="text-2xl font-bold text-green-500">{state.healthyWorkers}</span>
|
|
188
|
+
<span className="text-sm text-bolt-elements-textSecondary ml-2">Healthy</span>
|
|
189
|
+
</div>
|
|
190
|
+
<div>
|
|
191
|
+
<span className="text-2xl font-bold text-bolt-elements-textPrimary">{state.registeredWorkers}</span>
|
|
192
|
+
<span className="text-sm text-bolt-elements-textSecondary ml-2">Total</span>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
|
|
197
|
+
{/* Budget Usage */}
|
|
198
|
+
<div className="bg-bolt-elements-background-depth-2 p-4 rounded-lg">
|
|
199
|
+
<div className="text-sm text-bolt-elements-textSecondary mb-2">Budget Usage</div>
|
|
200
|
+
<div className="flex items-center justify-between mb-2">
|
|
201
|
+
<span className="text-lg font-semibold">
|
|
202
|
+
${state.currentBudgetUsage.toFixed(2)} / ${state.globalBudgetLimit.toFixed(2)}
|
|
203
|
+
</span>
|
|
204
|
+
<span className="text-sm text-bolt-elements-textSecondary">
|
|
205
|
+
{budgetUsagePercent.toFixed(1)}%
|
|
206
|
+
</span>
|
|
207
|
+
</div>
|
|
208
|
+
<div className="w-full bg-gray-700 rounded-full h-2">
|
|
209
|
+
<div
|
|
210
|
+
className={`h-2 rounded-full transition-all ${
|
|
211
|
+
budgetUsagePercent > 90 ? 'bg-red-500' :
|
|
212
|
+
budgetUsagePercent > 70 ? 'bg-yellow-500' :
|
|
213
|
+
'bg-green-500'
|
|
214
|
+
}`}
|
|
215
|
+
style={{ width: `${Math.min(budgetUsagePercent, 100)}%` }}
|
|
216
|
+
/>
|
|
217
|
+
</div>
|
|
218
|
+
</div>
|
|
219
|
+
|
|
220
|
+
{/* Statistics */}
|
|
221
|
+
{metrics && (
|
|
222
|
+
<div className="grid grid-cols-3 gap-4">
|
|
223
|
+
<div className="bg-bolt-elements-background-depth-2 p-4 rounded-lg">
|
|
224
|
+
<div className="text-sm text-bolt-elements-textSecondary">Processed</div>
|
|
225
|
+
<div className="text-xl font-bold text-bolt-elements-textPrimary">
|
|
226
|
+
{metrics.totalMandatesProcessed}
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
<div className="bg-bolt-elements-background-depth-2 p-4 rounded-lg">
|
|
230
|
+
<div className="text-sm text-bolt-elements-textSecondary">Success Rate</div>
|
|
231
|
+
<div className="text-xl font-bold text-green-500">
|
|
232
|
+
{(metrics.successRate * 100).toFixed(1)}%
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
<div className="bg-bolt-elements-background-depth-2 p-4 rounded-lg">
|
|
236
|
+
<div className="text-sm text-bolt-elements-textSecondary">Avg Time</div>
|
|
237
|
+
<div className="text-xl font-bold text-bolt-elements-textPrimary">
|
|
238
|
+
{Math.round(metrics.averageExecutionTime / 1000)}s
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
)}
|
|
243
|
+
</div>
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { useState, useMemo } from 'react';
|
|
2
|
+
import type { ExecutionEvent } from '~/types/mandate';
|
|
3
|
+
import { classNames } from '~/utils/classNames';
|
|
4
|
+
|
|
5
|
+
interface LogStreamProps {
|
|
6
|
+
events: ExecutionEvent[];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type LogLevel = 'all' | 'info' | 'warn' | 'error' | 'debug';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* LogStream component displays real-time logs from execution events.
|
|
13
|
+
*/
|
|
14
|
+
export function LogStream({ events }: LogStreamProps) {
|
|
15
|
+
const [logLevel, setLogLevel] = useState<LogLevel>('all');
|
|
16
|
+
const [searchQuery, setSearchQuery] = useState('');
|
|
17
|
+
|
|
18
|
+
const logEvents = useMemo(() => {
|
|
19
|
+
// Include all event types that have log-like data
|
|
20
|
+
return events.filter((event) =>
|
|
21
|
+
event.type === 'log' ||
|
|
22
|
+
event.type === 'error' ||
|
|
23
|
+
event.type === 'initialization_start' ||
|
|
24
|
+
event.type === 'webcontainer_init' ||
|
|
25
|
+
event.type === 'api_keys_loaded' ||
|
|
26
|
+
event.type === 'provider_configured' ||
|
|
27
|
+
event.type === 'shell_ready' ||
|
|
28
|
+
event.type === 'executor_ready' ||
|
|
29
|
+
event.type === 'iteration_start' ||
|
|
30
|
+
event.type === 'iteration_end' ||
|
|
31
|
+
event.type === 'governance_check' ||
|
|
32
|
+
event.type === 'deployment_status' ||
|
|
33
|
+
event.type === 'budget_warning' ||
|
|
34
|
+
event.type === 'constraint_violation'
|
|
35
|
+
);
|
|
36
|
+
}, [events]);
|
|
37
|
+
|
|
38
|
+
const filteredLogs = useMemo(() => {
|
|
39
|
+
let filtered = logEvents;
|
|
40
|
+
|
|
41
|
+
// Filter by level
|
|
42
|
+
if (logLevel !== 'all') {
|
|
43
|
+
filtered = filtered.filter((event) => {
|
|
44
|
+
if (event.type === 'error') return logLevel === 'error';
|
|
45
|
+
if (event.type === 'constraint_violation') return logLevel === 'error';
|
|
46
|
+
if (event.type === 'budget_warning') return logLevel === 'warn';
|
|
47
|
+
// For initialization events, treat as info unless they're errors
|
|
48
|
+
if (['initialization_start', 'webcontainer_init', 'api_keys_loaded', 'provider_configured', 'shell_ready', 'executor_ready'].includes(event.type)) {
|
|
49
|
+
return logLevel === 'info' || logLevel === 'debug';
|
|
50
|
+
}
|
|
51
|
+
return event.data.level === logLevel;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Filter by search query
|
|
56
|
+
if (searchQuery) {
|
|
57
|
+
const query = searchQuery.toLowerCase();
|
|
58
|
+
filtered = filtered.filter((event) => {
|
|
59
|
+
const message = event.data.message?.toLowerCase() || '';
|
|
60
|
+
const source = event.data.source?.toLowerCase() || '';
|
|
61
|
+
const type = event.type.toLowerCase();
|
|
62
|
+
return message.includes(query) || source.includes(query) || type.includes(query);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return filtered;
|
|
67
|
+
}, [logEvents, logLevel, searchQuery]);
|
|
68
|
+
|
|
69
|
+
const logLevels: { value: LogLevel; label: string; color: string }[] = [
|
|
70
|
+
{ value: 'all', label: 'All', color: 'text-gray-500' },
|
|
71
|
+
{ value: 'info', label: 'Info', color: 'text-blue-500' },
|
|
72
|
+
{ value: 'warn', label: 'Warn', color: 'text-yellow-500' },
|
|
73
|
+
{ value: 'error', label: 'Error', color: 'text-red-500' },
|
|
74
|
+
{ value: 'debug', label: 'Debug', color: 'text-gray-400' },
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
const getLogColor = (level?: string) => {
|
|
78
|
+
switch (level) {
|
|
79
|
+
case 'info':
|
|
80
|
+
return 'text-blue-500';
|
|
81
|
+
case 'warn':
|
|
82
|
+
return 'text-yellow-500';
|
|
83
|
+
case 'error':
|
|
84
|
+
return 'text-red-500';
|
|
85
|
+
case 'debug':
|
|
86
|
+
return 'text-gray-400';
|
|
87
|
+
default:
|
|
88
|
+
return 'text-bolt-elements-textSecondary';
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
if (logEvents.length === 0) {
|
|
93
|
+
return (
|
|
94
|
+
<div className="text-center py-12">
|
|
95
|
+
<p className="text-bolt-elements-textSecondary">No logs yet. Waiting for execution to start...</p>
|
|
96
|
+
</div>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<div className="flex flex-col h-full">
|
|
102
|
+
{/* Filters */}
|
|
103
|
+
<div className="mb-4 flex gap-4 items-center">
|
|
104
|
+
<div className="flex gap-2">
|
|
105
|
+
{logLevels.map(({ value, label, color }) => (
|
|
106
|
+
<button
|
|
107
|
+
key={value}
|
|
108
|
+
onClick={() => setLogLevel(value)}
|
|
109
|
+
className={classNames(
|
|
110
|
+
'px-3 py-1 rounded text-sm font-medium transition-colors',
|
|
111
|
+
logLevel === value
|
|
112
|
+
? 'bg-accent-500 text-white'
|
|
113
|
+
: 'bg-bolt-elements-background-depth-3 text-bolt-elements-textSecondary hover:text-bolt-elements-textPrimary'
|
|
114
|
+
)}
|
|
115
|
+
>
|
|
116
|
+
{label}
|
|
117
|
+
</button>
|
|
118
|
+
))}
|
|
119
|
+
</div>
|
|
120
|
+
<input
|
|
121
|
+
type="text"
|
|
122
|
+
placeholder="Search logs..."
|
|
123
|
+
value={searchQuery}
|
|
124
|
+
onChange={(e) => setSearchQuery(e.target.value)}
|
|
125
|
+
className="flex-1 px-3 py-1 rounded bg-bolt-elements-background-depth-3 border border-bolt-elements-borderColor text-sm text-bolt-elements-textPrimary placeholder:text-bolt-elements-textTertiary"
|
|
126
|
+
/>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
{/* Logs */}
|
|
130
|
+
<div className="flex-1 overflow-auto font-mono text-sm space-y-1">
|
|
131
|
+
{filteredLogs.length === 0 ? (
|
|
132
|
+
<div className="text-center py-8 text-bolt-elements-textSecondary">
|
|
133
|
+
No logs match the current filters.
|
|
134
|
+
</div>
|
|
135
|
+
) : (
|
|
136
|
+
filteredLogs.map((event, index) => {
|
|
137
|
+
// Determine level and message based on event type
|
|
138
|
+
let level: string = 'info';
|
|
139
|
+
let message: string = '';
|
|
140
|
+
let eventTypeLabel: string = event.type;
|
|
141
|
+
|
|
142
|
+
if (event.type === 'error' || event.type === 'constraint_violation') {
|
|
143
|
+
level = 'error';
|
|
144
|
+
message = event.data.message || event.data.error_message || event.data.violation_details || 'Unknown error';
|
|
145
|
+
} else if (event.type === 'budget_warning') {
|
|
146
|
+
level = 'warn';
|
|
147
|
+
message = event.data.message || 'Budget warning';
|
|
148
|
+
} else if (event.type === 'log') {
|
|
149
|
+
level = event.data.level || 'info';
|
|
150
|
+
message = event.data.message || '';
|
|
151
|
+
} else if (event.type === 'initialization_start') {
|
|
152
|
+
level = 'info';
|
|
153
|
+
message = event.data.message || 'Initialization started';
|
|
154
|
+
eventTypeLabel = 'INIT';
|
|
155
|
+
} else if (event.type === 'webcontainer_init') {
|
|
156
|
+
level = 'debug';
|
|
157
|
+
message = event.data.message || 'WebContainer initialization';
|
|
158
|
+
eventTypeLabel = 'WC';
|
|
159
|
+
} else if (event.type === 'api_keys_loaded') {
|
|
160
|
+
level = 'info';
|
|
161
|
+
message = event.data.message || `Loaded ${event.data.keys_count || 0} API key(s)`;
|
|
162
|
+
eventTypeLabel = 'API';
|
|
163
|
+
} else if (event.type === 'provider_configured') {
|
|
164
|
+
level = 'info';
|
|
165
|
+
message = event.data.message || `Provider configured: ${event.data.provider || 'unknown'}`;
|
|
166
|
+
eventTypeLabel = 'PROV';
|
|
167
|
+
} else if (event.type === 'shell_ready') {
|
|
168
|
+
level = 'info';
|
|
169
|
+
message = event.data.message || 'Shell terminal ready';
|
|
170
|
+
eventTypeLabel = 'SHELL';
|
|
171
|
+
} else if (event.type === 'executor_ready') {
|
|
172
|
+
level = 'info';
|
|
173
|
+
message = event.data.message || 'MandateExecutor ready';
|
|
174
|
+
eventTypeLabel = 'EXEC';
|
|
175
|
+
} else if (event.type === 'iteration_start') {
|
|
176
|
+
level = 'info';
|
|
177
|
+
message = `Iteration ${event.data.iteration_number || event.iteration} started`;
|
|
178
|
+
eventTypeLabel = 'ITER';
|
|
179
|
+
} else if (event.type === 'iteration_end') {
|
|
180
|
+
level = event.data.status === 'failed' ? 'error' : 'info';
|
|
181
|
+
message = `Iteration ${event.data.iteration_number || event.iteration} ${event.data.status || 'completed'}`;
|
|
182
|
+
eventTypeLabel = 'ITER';
|
|
183
|
+
} else if (event.type === 'governance_check') {
|
|
184
|
+
level = 'info';
|
|
185
|
+
message = 'Governance check performed';
|
|
186
|
+
eventTypeLabel = 'GOV';
|
|
187
|
+
} else if (event.type === 'deployment_status') {
|
|
188
|
+
level = event.data.deployment_status === 'failed' ? 'error' : 'info';
|
|
189
|
+
message = event.data.message || `Deployment ${event.data.deployment_status || 'unknown'}`;
|
|
190
|
+
eventTypeLabel = 'DEPLOY';
|
|
191
|
+
} else {
|
|
192
|
+
message = event.data.message || JSON.stringify(event.data);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const timestamp = new Date(event.timestamp).toISOString();
|
|
196
|
+
const source = event.data.source || eventTypeLabel;
|
|
197
|
+
const timing = event.metadata?.init_time || event.metadata?.load_time || event.metadata?.execution_time;
|
|
198
|
+
const timingStr = timing ? ` (${timing}ms)` : '';
|
|
199
|
+
|
|
200
|
+
return (
|
|
201
|
+
<div
|
|
202
|
+
key={`${event.timestamp}-${index}`}
|
|
203
|
+
className={classNames(
|
|
204
|
+
'p-2 rounded border-l-2',
|
|
205
|
+
level === 'error'
|
|
206
|
+
? 'bg-red-500/10 border-red-500'
|
|
207
|
+
: level === 'warn'
|
|
208
|
+
? 'bg-yellow-500/10 border-yellow-500'
|
|
209
|
+
: level === 'debug'
|
|
210
|
+
? 'bg-gray-500/5 border-gray-500/30'
|
|
211
|
+
: 'bg-bolt-elements-background-depth-3 border-bolt-elements-borderColor'
|
|
212
|
+
)}
|
|
213
|
+
>
|
|
214
|
+
<div className="flex gap-2 items-center flex-wrap">
|
|
215
|
+
<span className={classNames('font-semibold text-xs', getLogColor(level))}>
|
|
216
|
+
[{level.toUpperCase()}]
|
|
217
|
+
</span>
|
|
218
|
+
<span className="text-xs font-mono text-bolt-elements-textTertiary">{eventTypeLabel}</span>
|
|
219
|
+
<span className="text-xs text-bolt-elements-textTertiary">{timestamp}</span>
|
|
220
|
+
{source && source !== eventTypeLabel && (
|
|
221
|
+
<span className="text-xs text-bolt-elements-textTertiary">from {source}</span>
|
|
222
|
+
)}
|
|
223
|
+
{timingStr && (
|
|
224
|
+
<span className="text-xs text-bolt-elements-textTertiary">{timingStr}</span>
|
|
225
|
+
)}
|
|
226
|
+
</div>
|
|
227
|
+
<div className={classNames('mt-1 text-sm', getLogColor(level))}>{message}</div>
|
|
228
|
+
{event.metadata && Object.keys(event.metadata).length > 0 && (
|
|
229
|
+
<details className="mt-1 text-xs text-bolt-elements-textTertiary">
|
|
230
|
+
<summary className="cursor-pointer hover:text-bolt-elements-textSecondary">Details</summary>
|
|
231
|
+
<pre className="mt-1 p-2 bg-bolt-elements-background-depth-2 rounded text-xs overflow-auto">
|
|
232
|
+
{JSON.stringify(event.metadata, null, 2)}
|
|
233
|
+
</pre>
|
|
234
|
+
</details>
|
|
235
|
+
)}
|
|
236
|
+
</div>
|
|
237
|
+
);
|
|
238
|
+
})
|
|
239
|
+
)}
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|