codex-linux 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +10 -0
- package/.eslintrc.json +27 -0
- package/.github/workflows/ci.yml +156 -0
- package/.huskyrc +7 -0
- package/.lintstagedrc +13 -0
- package/.prettierrc +12 -0
- package/CLAUDE.md +163 -0
- package/DESIGN_SUPERIOR.md +73 -0
- package/Dockerfile +64 -0
- package/INSTALLATION.md +152 -0
- package/LICENSE +21 -0
- package/README.md +245 -0
- package/assets/skills/code-review/instructions.md +102 -0
- package/assets/skills/code-review/skill.yaml +15 -0
- package/assets/skills/refactoring/instructions.md +149 -0
- package/assets/skills/refactoring/skill.yaml +15 -0
- package/assets/skills/testing/skill.yaml +15 -0
- package/commitlint.config.js +23 -0
- package/dist/main/DatabaseManager.js +763 -0
- package/dist/main/DatabaseManager.js.map +1 -0
- package/dist/main/SettingsManager.js +61 -0
- package/dist/main/SettingsManager.js.map +1 -0
- package/dist/main/agents/AgentOrchestrator.js +787 -0
- package/dist/main/agents/AgentOrchestrator.js.map +1 -0
- package/dist/main/agents/AgentSDK.js +219 -0
- package/dist/main/agents/AgentSDK.js.map +1 -0
- package/dist/main/agents/AgentTools.js +348 -0
- package/dist/main/agents/AgentTools.js.map +1 -0
- package/dist/main/agents/CodeIndex.js +233 -0
- package/dist/main/agents/CodeIndex.js.map +1 -0
- package/dist/main/agents/EmbeddingService.js +80 -0
- package/dist/main/agents/EmbeddingService.js.map +1 -0
- package/dist/main/agents/NativeToolCalling.js +206 -0
- package/dist/main/agents/NativeToolCalling.js.map +1 -0
- package/dist/main/api/APIServer.js +278 -0
- package/dist/main/api/APIServer.js.map +1 -0
- package/dist/main/api/RateLimiter.js +138 -0
- package/dist/main/api/RateLimiter.js.map +1 -0
- package/dist/main/api/WebSocketManager.js +300 -0
- package/dist/main/api/WebSocketManager.js.map +1 -0
- package/dist/main/assistant/ContextOptimizer.js +192 -0
- package/dist/main/assistant/ContextOptimizer.js.map +1 -0
- package/dist/main/assistant/PredictedOutputManager.js +172 -0
- package/dist/main/assistant/PredictedOutputManager.js.map +1 -0
- package/dist/main/assistant/PromptCacheManager.js +193 -0
- package/dist/main/assistant/PromptCacheManager.js.map +1 -0
- package/dist/main/assistant/PromptOptimizer.js +626 -0
- package/dist/main/assistant/PromptOptimizer.js.map +1 -0
- package/dist/main/assistant/SmartCodeAssistant.js +224 -0
- package/dist/main/assistant/SmartCodeAssistant.js.map +1 -0
- package/dist/main/auth/SessionManager.js +300 -0
- package/dist/main/auth/SessionManager.js.map +1 -0
- package/dist/main/automations/AdvancedWebhookSystem.js +212 -0
- package/dist/main/automations/AdvancedWebhookSystem.js.map +1 -0
- package/dist/main/automations/AutomationScheduler.js +269 -0
- package/dist/main/automations/AutomationScheduler.js.map +1 -0
- package/dist/main/automations/BatchProcessingSystem.js +159 -0
- package/dist/main/automations/BatchProcessingSystem.js.map +1 -0
- package/dist/main/automations/BrowserAutomationManager.js +195 -0
- package/dist/main/automations/BrowserAutomationManager.js.map +1 -0
- package/dist/main/automations/GitHubActionsManager.js +129 -0
- package/dist/main/automations/GitHubActionsManager.js.map +1 -0
- package/dist/main/automations/GitLabCIManager.js +122 -0
- package/dist/main/automations/GitLabCIManager.js.map +1 -0
- package/dist/main/automations/PriorityQueueManager.js +240 -0
- package/dist/main/automations/PriorityQueueManager.js.map +1 -0
- package/dist/main/background/BackgroundModeManager.js +117 -0
- package/dist/main/background/BackgroundModeManager.js.map +1 -0
- package/dist/main/backup/BackupManager.js +254 -0
- package/dist/main/backup/BackupManager.js.map +1 -0
- package/dist/main/backup/MigrationManager.js +114 -0
- package/dist/main/backup/MigrationManager.js.map +1 -0
- package/dist/main/commands/SlashCommandManager.js +399 -0
- package/dist/main/commands/SlashCommandManager.js.map +1 -0
- package/dist/main/config/ClaudeMdParser.js +519 -0
- package/dist/main/config/ClaudeMdParser.js.map +1 -0
- package/dist/main/config/CustomizationManager.js +381 -0
- package/dist/main/config/CustomizationManager.js.map +1 -0
- package/dist/main/config/LaunchConfigManager.js +211 -0
- package/dist/main/config/LaunchConfigManager.js.map +1 -0
- package/dist/main/config/SettingsManager.js +166 -0
- package/dist/main/config/SettingsManager.js.map +1 -0
- package/dist/main/connectors/ConnectorManager.js +151 -0
- package/dist/main/connectors/ConnectorManager.js.map +1 -0
- package/dist/main/connectors/DatabaseConnector.js +222 -0
- package/dist/main/connectors/DatabaseConnector.js.map +1 -0
- package/dist/main/cowork/CoworkManager.js +324 -0
- package/dist/main/cowork/CoworkManager.js.map +1 -0
- package/dist/main/evals/AgentEvalFramework.js +538 -0
- package/dist/main/evals/AgentEvalFramework.js.map +1 -0
- package/dist/main/evals/GraderManager.js +285 -0
- package/dist/main/evals/GraderManager.js.map +1 -0
- package/dist/main/git/GitWorktreeManager.js +214 -0
- package/dist/main/git/GitWorktreeManager.js.map +1 -0
- package/dist/main/github/GitHubPRMonitor.js +244 -0
- package/dist/main/github/GitHubPRMonitor.js.map +1 -0
- package/dist/main/ide/ContinueInManager.js +181 -0
- package/dist/main/ide/ContinueInManager.js.map +1 -0
- package/dist/main/ide/IDEIntegration.js +277 -0
- package/dist/main/ide/IDEIntegration.js.map +1 -0
- package/dist/main/integrations/LinearManager.js +252 -0
- package/dist/main/integrations/LinearManager.js.map +1 -0
- package/dist/main/integrations/SlackBotManager.js +247 -0
- package/dist/main/integrations/SlackBotManager.js.map +1 -0
- package/dist/main/lsp/LSPManager.js +394 -0
- package/dist/main/lsp/LSPManager.js.map +1 -0
- package/dist/main/main.js +1087 -0
- package/dist/main/main.js.map +1 -0
- package/dist/main/mcp/MCPConfigurationManager.js +281 -0
- package/dist/main/mcp/MCPConfigurationManager.js.map +1 -0
- package/dist/main/mcp/MCPManager.js +710 -0
- package/dist/main/mcp/MCPManager.js.map +1 -0
- package/dist/main/mcp/MCPRegistry.js +272 -0
- package/dist/main/mcp/MCPRegistry.js.map +1 -0
- package/dist/main/monitoring/ErrorRecoveryManager.js +268 -0
- package/dist/main/monitoring/ErrorRecoveryManager.js.map +1 -0
- package/dist/main/monitoring/ErrorTracker.js +57 -0
- package/dist/main/monitoring/ErrorTracker.js.map +1 -0
- package/dist/main/monitoring/MetricsCollector.js +155 -0
- package/dist/main/monitoring/MetricsCollector.js.map +1 -0
- package/dist/main/monitoring/TraceGradingSystem.js +148 -0
- package/dist/main/monitoring/TraceGradingSystem.js.map +1 -0
- package/dist/main/notifications/NotificationManager.js +67 -0
- package/dist/main/notifications/NotificationManager.js.map +1 -0
- package/dist/main/pair/AIPairProgramming.js +200 -0
- package/dist/main/pair/AIPairProgramming.js.map +1 -0
- package/dist/main/plugins/PluginManager.js +222 -0
- package/dist/main/plugins/PluginManager.js.map +1 -0
- package/dist/main/plugins/PluginMarketplace.js +237 -0
- package/dist/main/plugins/PluginMarketplace.js.map +1 -0
- package/dist/main/preload.js +189 -0
- package/dist/main/preload.js.map +1 -0
- package/dist/main/preview/PreviewSessionManager.js +170 -0
- package/dist/main/preview/PreviewSessionManager.js.map +1 -0
- package/dist/main/providers/AIProviderManager.js +327 -0
- package/dist/main/providers/AIProviderManager.js.map +1 -0
- package/dist/main/providers/FineTuningManager.js +276 -0
- package/dist/main/providers/FineTuningManager.js.map +1 -0
- package/dist/main/providers/FreeModelsProvider.js +1104 -0
- package/dist/main/providers/FreeModelsProvider.js.map +1 -0
- package/dist/main/realtime/RealtimeManager.js +116 -0
- package/dist/main/realtime/RealtimeManager.js.map +1 -0
- package/dist/main/remote/CloudEnvironmentManager.js +232 -0
- package/dist/main/remote/CloudEnvironmentManager.js.map +1 -0
- package/dist/main/remote/RemoteSessionManager.js +255 -0
- package/dist/main/remote/RemoteSessionManager.js.map +1 -0
- package/dist/main/search/DeepResearchManager.js +335 -0
- package/dist/main/search/DeepResearchManager.js.map +1 -0
- package/dist/main/search/WebSearchIntegration.js +147 -0
- package/dist/main/search/WebSearchIntegration.js.map +1 -0
- package/dist/main/security/AdminConsoleManager.js +223 -0
- package/dist/main/security/AdminConsoleManager.js.map +1 -0
- package/dist/main/security/AuditLogger.js +136 -0
- package/dist/main/security/AuditLogger.js.map +1 -0
- package/dist/main/security/PermissionManager.js +144 -0
- package/dist/main/security/PermissionManager.js.map +1 -0
- package/dist/main/security/SSOManager.js +173 -0
- package/dist/main/security/SSOManager.js.map +1 -0
- package/dist/main/security/SecurityManager.js +152 -0
- package/dist/main/security/SecurityManager.js.map +1 -0
- package/dist/main/skills/SkillsManager.js +223 -0
- package/dist/main/skills/SkillsManager.js.map +1 -0
- package/dist/main/ssh/SSHManager.js +65 -0
- package/dist/main/ssh/SSHManager.js.map +1 -0
- package/dist/main/streaming/StreamingManager.js +225 -0
- package/dist/main/streaming/StreamingManager.js.map +1 -0
- package/dist/main/sync/CloudSyncManager.js +422 -0
- package/dist/main/sync/CloudSyncManager.js.map +1 -0
- package/dist/main/types.js +28 -0
- package/dist/main/types.js.map +1 -0
- package/dist/main/verification/AutoVerifyManager.js +235 -0
- package/dist/main/verification/AutoVerifyManager.js.map +1 -0
- package/dist/main/vision/ComputerUseManager.js +376 -0
- package/dist/main/vision/ComputerUseManager.js.map +1 -0
- package/dist/main/vision/ImageVideoGenerationManager.js +401 -0
- package/dist/main/vision/ImageVideoGenerationManager.js.map +1 -0
- package/dist/main/vision/VisionManager.js +172 -0
- package/dist/main/vision/VisionManager.js.map +1 -0
- package/dist/renderer/assets/main-DJlZQBCA.js +304 -0
- package/dist/renderer/assets/main-N33ZXEr8.css +1 -0
- package/dist/renderer/index.html +21 -0
- package/dist/renderer/manifest.json +42 -0
- package/dist/renderer/sw.ts +109 -0
- package/dist/shared/types.js +35 -0
- package/dist/shared/types.js.map +1 -0
- package/docker-compose.yml +65 -0
- package/docs/API.md +307 -0
- package/docs/USER_GUIDE.md +476 -0
- package/examples/plugins/sample-plugin/package.json +41 -0
- package/examples/plugins/sample-plugin/src/index.ts +75 -0
- package/index.html +20 -0
- package/jest.config.js +39 -0
- package/package.json +180 -0
- package/packages/cli/package.json +29 -0
- package/packages/cli/src/commands/agents.ts +199 -0
- package/packages/cli/src/commands/tasks.ts +61 -0
- package/packages/cli/src/index.ts +91 -0
- package/packages/cli/src/utils/api.ts +45 -0
- package/packages/cli/src/utils/config.ts +61 -0
- package/packages/npm-installer/bin/codex-linux +126 -0
- package/packages/npm-installer/lib/download.js +273 -0
- package/packages/npm-installer/package.json +42 -0
- package/packages/vscode-extension/package.json +167 -0
- package/packages/vscode-extension/src/api.ts +68 -0
- package/packages/vscode-extension/src/extension.ts +161 -0
- package/packages/vscode-extension/src/panels/chatPanel.ts +265 -0
- package/packages/vscode-extension/src/panels/createAgentPanel.ts +227 -0
- package/packages/vscode-extension/src/providers/agentsProvider.ts +80 -0
- package/postcss.config.js +6 -0
- package/public/manifest.json +42 -0
- package/public/sw.ts +109 -0
- package/scripts/install-dev.sh +103 -0
- package/scripts/install.sh +275 -0
- package/src/main/DatabaseManager.ts +950 -0
- package/src/main/SettingsManager.ts +63 -0
- package/src/main/agents/AgentOrchestrator.ts +930 -0
- package/src/main/agents/AgentSDK.ts +269 -0
- package/src/main/agents/AgentTools.ts +380 -0
- package/src/main/agents/CodeIndex.ts +240 -0
- package/src/main/agents/EmbeddingService.ts +88 -0
- package/src/main/agents/NativeToolCalling.ts +245 -0
- package/src/main/api/APIServer.ts +316 -0
- package/src/main/api/RateLimiter.ts +165 -0
- package/src/main/api/WebSocketManager.ts +398 -0
- package/src/main/assistant/ContextOptimizer.ts +214 -0
- package/src/main/assistant/PredictedOutputManager.ts +265 -0
- package/src/main/assistant/PromptCacheManager.ts +280 -0
- package/src/main/assistant/PromptOptimizer.ts +746 -0
- package/src/main/assistant/SmartCodeAssistant.ts +234 -0
- package/src/main/auth/SessionManager.ts +415 -0
- package/src/main/automations/AdvancedWebhookSystem.ts +281 -0
- package/src/main/automations/AutomationScheduler.ts +272 -0
- package/src/main/automations/BatchProcessingSystem.ts +207 -0
- package/src/main/automations/BrowserAutomationManager.ts +203 -0
- package/src/main/automations/GitHubActionsManager.ts +151 -0
- package/src/main/automations/GitLabCIManager.ts +206 -0
- package/src/main/automations/PriorityQueueManager.ts +328 -0
- package/src/main/background/BackgroundModeManager.ts +130 -0
- package/src/main/backup/BackupManager.ts +287 -0
- package/src/main/backup/MigrationManager.ts +132 -0
- package/src/main/commands/SlashCommandManager.ts +407 -0
- package/src/main/config/ClaudeMdParser.ts +539 -0
- package/src/main/config/CustomizationManager.ts +493 -0
- package/src/main/config/LaunchConfigManager.ts +212 -0
- package/src/main/config/SettingsManager.ts +163 -0
- package/src/main/connectors/ConnectorManager.ts +175 -0
- package/src/main/connectors/DatabaseConnector.ts +212 -0
- package/src/main/cowork/CoworkManager.ts +431 -0
- package/src/main/evals/AgentEvalFramework.ts +665 -0
- package/src/main/evals/GraderManager.ts +417 -0
- package/src/main/git/GitWorktreeManager.ts +211 -0
- package/src/main/github/GitHubPRMonitor.ts +317 -0
- package/src/main/ide/ContinueInManager.ts +180 -0
- package/src/main/ide/IDEIntegration.ts +288 -0
- package/src/main/integrations/LinearManager.ts +327 -0
- package/src/main/integrations/SlackBotManager.ts +312 -0
- package/src/main/lsp/LSPManager.ts +445 -0
- package/src/main/main.ts +1221 -0
- package/src/main/mcp/MCPConfigurationManager.ts +281 -0
- package/src/main/mcp/MCPManager.ts +799 -0
- package/src/main/mcp/MCPRegistry.ts +273 -0
- package/src/main/monitoring/ErrorRecoveryManager.ts +359 -0
- package/src/main/monitoring/ErrorTracker.ts +60 -0
- package/src/main/monitoring/MetricsCollector.ts +196 -0
- package/src/main/monitoring/TraceGradingSystem.ts +196 -0
- package/src/main/notifications/NotificationManager.ts +96 -0
- package/src/main/pair/AIPairProgramming.ts +290 -0
- package/src/main/plugins/PluginManager.ts +266 -0
- package/src/main/plugins/PluginMarketplace.ts +318 -0
- package/src/main/preload.ts +215 -0
- package/src/main/preview/PreviewSessionManager.ts +186 -0
- package/src/main/providers/AIProviderManager.ts +394 -0
- package/src/main/providers/FineTuningManager.ts +390 -0
- package/src/main/providers/FreeModelsProvider.ts +1156 -0
- package/src/main/realtime/RealtimeManager.ts +147 -0
- package/src/main/remote/CloudEnvironmentManager.ts +253 -0
- package/src/main/remote/RemoteSessionManager.ts +323 -0
- package/src/main/search/DeepResearchManager.ts +458 -0
- package/src/main/search/WebSearchIntegration.ts +203 -0
- package/src/main/security/AdminConsoleManager.ts +244 -0
- package/src/main/security/AuditLogger.ts +143 -0
- package/src/main/security/PermissionManager.ts +184 -0
- package/src/main/security/SSOManager.ts +241 -0
- package/src/main/security/SecurityManager.ts +139 -0
- package/src/main/skills/SkillsManager.ts +218 -0
- package/src/main/ssh/SSHManager.ts +86 -0
- package/src/main/streaming/StreamingManager.ts +306 -0
- package/src/main/sync/CloudSyncManager.ts +532 -0
- package/src/main/verification/AutoVerifyManager.ts +285 -0
- package/src/main/vision/ComputerUseManager.ts +475 -0
- package/src/main/vision/ImageVideoGenerationManager.ts +526 -0
- package/src/main/vision/VisionManager.ts +186 -0
- package/src/renderer/App.tsx +314 -0
- package/src/renderer/components/AdvancedSettingsPanel.tsx +225 -0
- package/src/renderer/components/AgentPanel.tsx +760 -0
- package/src/renderer/components/AppPreview.tsx +220 -0
- package/src/renderer/components/AuditTrailPanel.tsx +148 -0
- package/src/renderer/components/AutomationPanel.tsx +220 -0
- package/src/renderer/components/ChatInterface.tsx +595 -0
- package/src/renderer/components/ChatTab.tsx +296 -0
- package/src/renderer/components/CodeEditor.tsx +257 -0
- package/src/renderer/components/CodeReviewPanel.tsx +256 -0
- package/src/renderer/components/CodeWorkspace.tsx +192 -0
- package/src/renderer/components/CodebaseDashboard.tsx +295 -0
- package/src/renderer/components/ComputerUsePanel.tsx +262 -0
- package/src/renderer/components/ConnectorsPanel.tsx +471 -0
- package/src/renderer/components/ContextMenu.tsx +155 -0
- package/src/renderer/components/ContextUsageDisplay.tsx +248 -0
- package/src/renderer/components/CoworkPanel.tsx +415 -0
- package/src/renderer/components/DiffViewer.tsx +452 -0
- package/src/renderer/components/ErrorBoundary.tsx +273 -0
- package/src/renderer/components/ExtendedThinkingToggle.tsx +244 -0
- package/src/renderer/components/FileAttachments.tsx +247 -0
- package/src/renderer/components/FileExplorer.tsx +242 -0
- package/src/renderer/components/FileExplorerPanel.tsx +302 -0
- package/src/renderer/components/GitPanel.tsx +154 -0
- package/src/renderer/components/Header.tsx +113 -0
- package/src/renderer/components/MCPPanel.tsx +326 -0
- package/src/renderer/components/MentionAutocomplete.tsx +239 -0
- package/src/renderer/components/PermissionPanel.tsx +159 -0
- package/src/renderer/components/PermissionSelector.tsx +203 -0
- package/src/renderer/components/PluginMarketplace.tsx +325 -0
- package/src/renderer/components/PromptOptimizerPanel.tsx +399 -0
- package/src/renderer/components/SearchPanel.tsx +173 -0
- package/src/renderer/components/SearchReplace.tsx +284 -0
- package/src/renderer/components/SessionSidebar.tsx +367 -0
- package/src/renderer/components/SettingsPanel.tsx +426 -0
- package/src/renderer/components/Sidebar.tsx +100 -0
- package/src/renderer/components/SkillsPanel.tsx +245 -0
- package/src/renderer/components/SplitPane.tsx +173 -0
- package/src/renderer/components/Terminal.tsx +190 -0
- package/src/renderer/components/VoiceCommand.tsx +129 -0
- package/src/renderer/components/WorktreePanel.tsx +163 -0
- package/src/renderer/components/ui/AriaComponents.tsx +193 -0
- package/src/renderer/components/ui/Button.tsx +68 -0
- package/src/renderer/components/ui/Card.tsx +102 -0
- package/src/renderer/components/ui/Input.tsx +44 -0
- package/src/renderer/components/ui/Skeleton.tsx +55 -0
- package/src/renderer/components/ui/VirtualList.tsx +196 -0
- package/src/renderer/i18n/I18nProvider.tsx +101 -0
- package/src/renderer/i18n/de.ts +161 -0
- package/src/renderer/i18n/en.ts +163 -0
- package/src/renderer/i18n/es.ts +161 -0
- package/src/renderer/i18n/fr.ts +161 -0
- package/src/renderer/i18n/index.ts +44 -0
- package/src/renderer/index.css +129 -0
- package/src/renderer/lib/accessibility.tsx +287 -0
- package/src/renderer/lib/hooks.ts +304 -0
- package/src/renderer/lib/utils.ts +6 -0
- package/src/renderer/main.tsx +25 -0
- package/src/renderer/styles/minimalist.css +539 -0
- package/src/renderer/sw.ts +180 -0
- package/src/renderer/types.d.ts +138 -0
- package/src/shared/types.ts +813 -0
- package/supabase/schema.sql +234 -0
- package/tailwind.config.js +78 -0
- package/tests/e2e/package.json +15 -0
- package/tests/e2e/playwright.config.ts +31 -0
- package/tests/e2e/specs/app.spec.ts +194 -0
- package/tests/setup.ts +99 -0
- package/tests/unit/AgentOrchestrator.test.ts +274 -0
- package/tests/unit/DatabaseManager.test.ts +262 -0
- package/tests/unit/GitWorktreeManager.test.ts +150 -0
- package/tests/unit/SecurityManager.test.ts +110 -0
- package/tsconfig.main.json +22 -0
- package/tsconfig.renderer.json +27 -0
- package/vite.config.ts +28 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
2
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
import * as fs from 'fs/promises';
|
|
5
|
+
import log from 'electron-log';
|
|
6
|
+
import fetch from 'node-fetch';
|
|
7
|
+
|
|
8
|
+
export type PluginPermission =
|
|
9
|
+
| 'file:read'
|
|
10
|
+
| 'file:write'
|
|
11
|
+
| 'file:delete'
|
|
12
|
+
| 'command:execute'
|
|
13
|
+
| 'network:request'
|
|
14
|
+
| 'storage:read'
|
|
15
|
+
| 'storage:write'
|
|
16
|
+
| 'agent:create'
|
|
17
|
+
| 'agent:control'
|
|
18
|
+
| 'ui:render'
|
|
19
|
+
| 'clipboard:read'
|
|
20
|
+
| 'clipboard:write';
|
|
21
|
+
|
|
22
|
+
export interface PluginMarketplaceItem {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
version: string;
|
|
27
|
+
author: string;
|
|
28
|
+
authorUrl?: string;
|
|
29
|
+
homepage?: string;
|
|
30
|
+
repository?: string;
|
|
31
|
+
license: string;
|
|
32
|
+
keywords: string[];
|
|
33
|
+
downloads: number;
|
|
34
|
+
rating: number;
|
|
35
|
+
createdAt: Date;
|
|
36
|
+
updatedAt: Date;
|
|
37
|
+
iconUrl?: string;
|
|
38
|
+
manifest: Record<string, unknown>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface PluginPermissionRequest {
|
|
42
|
+
pluginId: string;
|
|
43
|
+
permissions: PluginPermission[];
|
|
44
|
+
reason: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface PluginInstallOptions {
|
|
48
|
+
version?: string;
|
|
49
|
+
force?: boolean;
|
|
50
|
+
dependencies?: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface PluginSecurityPolicy {
|
|
54
|
+
allowedHosts?: string[];
|
|
55
|
+
allowedCommands?: string[];
|
|
56
|
+
sandboxed?: boolean;
|
|
57
|
+
maxMemory?: number;
|
|
58
|
+
maxCpu?: number;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export class PluginMarketplace extends EventEmitter {
|
|
62
|
+
private marketplaceUrl: string;
|
|
63
|
+
private cache: Map<string, { data: PluginMarketplaceItem; expiresAt: Date }> = new Map();
|
|
64
|
+
private cacheTimeout = 15 * 60 * 1000;
|
|
65
|
+
|
|
66
|
+
constructor(marketplaceUrl: string = 'https://marketplace.codex-linux.dev/api') {
|
|
67
|
+
super();
|
|
68
|
+
this.marketplaceUrl = marketplaceUrl;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
configure(marketplaceUrl: string): void {
|
|
72
|
+
this.marketplaceUrl = marketplaceUrl;
|
|
73
|
+
log.info('PluginMarketplace configured', { url: marketplaceUrl });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private getCache(key: string): PluginMarketplaceItem | null {
|
|
77
|
+
const cached = this.cache.get(key);
|
|
78
|
+
if (cached && cached.expiresAt > new Date()) {
|
|
79
|
+
return cached.data;
|
|
80
|
+
}
|
|
81
|
+
this.cache.delete(key);
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
private setCache(key: string, data: PluginMarketplaceItem): void {
|
|
86
|
+
this.cache.set(key, {
|
|
87
|
+
data,
|
|
88
|
+
expiresAt: new Date(Date.now() + this.cacheTimeout),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
async search(query: string, options?: {
|
|
93
|
+
category?: string;
|
|
94
|
+
sort?: 'popular' | 'recent' | 'rating';
|
|
95
|
+
limit?: number;
|
|
96
|
+
}): Promise<PluginMarketplaceItem[]> {
|
|
97
|
+
const cacheKey = `search:${query}:${JSON.stringify(options)}`;
|
|
98
|
+
const cached = this.getCache(cacheKey);
|
|
99
|
+
if (cached) return [cached];
|
|
100
|
+
|
|
101
|
+
try {
|
|
102
|
+
const params = new URLSearchParams({
|
|
103
|
+
q: query,
|
|
104
|
+
...(options?.category && { category: options.category }),
|
|
105
|
+
sort: options?.sort || 'popular',
|
|
106
|
+
limit: String(options?.limit || 20),
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const response = await fetch(`${this.marketplaceUrl}/plugins?${params}`, {
|
|
110
|
+
headers: { 'User-Agent': 'CodexLinux/1.0' },
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
if (!response.ok) {
|
|
114
|
+
throw new Error(`Marketplace API error: ${response.statusText}`);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const data = await response.json() as { plugins: PluginMarketplaceItem[] };
|
|
118
|
+
|
|
119
|
+
data.plugins.forEach((plugin) => this.setCache(plugin.id, plugin));
|
|
120
|
+
|
|
121
|
+
return data.plugins;
|
|
122
|
+
} catch (error) {
|
|
123
|
+
log.error('Failed to search marketplace:', error);
|
|
124
|
+
return this.mockSearch(query);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
async getPlugin(pluginId: string): Promise<PluginMarketplaceItem | null> {
|
|
129
|
+
const cached = this.getCache(pluginId);
|
|
130
|
+
if (cached) return cached;
|
|
131
|
+
|
|
132
|
+
try {
|
|
133
|
+
const response = await fetch(`${this.marketplaceUrl}/plugins/${pluginId}`, {
|
|
134
|
+
headers: { 'User-Agent': 'CodexLinux/1.0' },
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
if (!response.ok) {
|
|
138
|
+
if (response.status === 404) return null;
|
|
139
|
+
throw new Error(`Marketplace API error: ${response.statusText}`);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const data = await response.json() as PluginMarketplaceItem;
|
|
143
|
+
this.setCache(pluginId, data);
|
|
144
|
+
return data;
|
|
145
|
+
} catch (error) {
|
|
146
|
+
log.error('Failed to get plugin:', error);
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
async getCategories(): Promise<string[]> {
|
|
152
|
+
try {
|
|
153
|
+
const response = await fetch(`${this.marketplaceUrl}/categories`, {
|
|
154
|
+
headers: { 'User-Agent': 'CodexLinux/1.0' },
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
if (!response.ok) {
|
|
158
|
+
throw new Error(`Marketplace API error: ${response.statusText}`);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const data = await response.json() as { categories: string[] };
|
|
162
|
+
return data.categories;
|
|
163
|
+
} catch (error) {
|
|
164
|
+
log.error('Failed to get categories:', error);
|
|
165
|
+
return ['AI Agents', 'Productivity', 'Integrations', 'Themes', 'Utilities'];
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
async getFeatured(): Promise<PluginMarketplaceItem[]> {
|
|
170
|
+
try {
|
|
171
|
+
const response = await fetch(`${this.marketplaceUrl}/featured`, {
|
|
172
|
+
headers: { 'User-Agent': 'CodexLinux/1.0' },
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
if (!response.ok) {
|
|
176
|
+
throw new Error(`Marketplace API error: ${response.statusText}`);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const data = await response.json() as { plugins: PluginMarketplaceItem[] };
|
|
180
|
+
return data.plugins;
|
|
181
|
+
} catch (error) {
|
|
182
|
+
log.error('Failed to get featured plugins:', error);
|
|
183
|
+
return [];
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
private mockSearch(query: string): PluginMarketplaceItem[] {
|
|
188
|
+
return [
|
|
189
|
+
{
|
|
190
|
+
id: 'github-integration',
|
|
191
|
+
name: 'GitHub Integration',
|
|
192
|
+
description: 'Seamless GitHub integration for PRs, issues, and workflows',
|
|
193
|
+
version: '1.0.0',
|
|
194
|
+
author: 'Codex Team',
|
|
195
|
+
license: 'MIT',
|
|
196
|
+
keywords: ['github', 'git', 'integration'],
|
|
197
|
+
downloads: 15000,
|
|
198
|
+
rating: 4.8,
|
|
199
|
+
createdAt: new Date('2024-01-01'),
|
|
200
|
+
updatedAt: new Date('2024-06-15'),
|
|
201
|
+
manifest: {},
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: 'slack-notifications',
|
|
205
|
+
name: 'Slack Notifications',
|
|
206
|
+
description: 'Get agent updates directly in Slack',
|
|
207
|
+
version: '1.2.0',
|
|
208
|
+
author: 'Codex Team',
|
|
209
|
+
license: 'MIT',
|
|
210
|
+
keywords: ['slack', 'notifications'],
|
|
211
|
+
downloads: 8000,
|
|
212
|
+
rating: 4.5,
|
|
213
|
+
createdAt: new Date('2024-02-01'),
|
|
214
|
+
updatedAt: new Date('2024-07-01'),
|
|
215
|
+
manifest: {},
|
|
216
|
+
},
|
|
217
|
+
];
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
clearCache(): void {
|
|
221
|
+
this.cache.clear();
|
|
222
|
+
this.emit('cache:cleared');
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
cleanup(): void {
|
|
226
|
+
this.cache.clear();
|
|
227
|
+
this.removeAllListeners();
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export class PluginPermissionManager extends EventEmitter {
|
|
232
|
+
private permissions: Map<string, Set<PluginPermission>> = new Map();
|
|
233
|
+
private pendingRequests: Map<string, PluginPermissionRequest> = new Map();
|
|
234
|
+
private defaultPermissions: PluginPermission[] = [
|
|
235
|
+
'storage:read',
|
|
236
|
+
'storage:write',
|
|
237
|
+
'ui:render',
|
|
238
|
+
];
|
|
239
|
+
|
|
240
|
+
constructor() {
|
|
241
|
+
super();
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
requestPermissions(pluginId: string, permissions: PluginPermission[], reason: string): string {
|
|
245
|
+
const requestId = uuidv4();
|
|
246
|
+
this.pendingRequests.set(requestId, {
|
|
247
|
+
pluginId,
|
|
248
|
+
permissions,
|
|
249
|
+
reason,
|
|
250
|
+
});
|
|
251
|
+
this.emit('permission:requested', { requestId, pluginId, permissions });
|
|
252
|
+
return requestId;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
async approvePermissions(requestId: string): Promise<boolean> {
|
|
256
|
+
const request = this.pendingRequests.get(requestId);
|
|
257
|
+
if (!request) return false;
|
|
258
|
+
|
|
259
|
+
if (!this.permissions.has(request.pluginId)) {
|
|
260
|
+
this.permissions.set(request.pluginId, new Set(this.defaultPermissions));
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const pluginPerms = this.permissions.get(request.pluginId)!;
|
|
264
|
+
request.permissions.forEach((p) => pluginPerms.add(p));
|
|
265
|
+
|
|
266
|
+
this.pendingRequests.delete(requestId);
|
|
267
|
+
this.emit('permission:approved', { requestId, pluginId: request.pluginId });
|
|
268
|
+
log.info(`Permissions approved for plugin ${request.pluginId}`);
|
|
269
|
+
return true;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
rejectPermissions(requestId: string): boolean {
|
|
273
|
+
const request = this.pendingRequests.get(requestId);
|
|
274
|
+
if (!request) return false;
|
|
275
|
+
|
|
276
|
+
this.pendingRequests.delete(requestId);
|
|
277
|
+
this.emit('permission:rejected', { requestId, pluginId: request.pluginId });
|
|
278
|
+
return true;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
getPermissions(pluginId: string): PluginPermission[] {
|
|
282
|
+
return Array.from(this.permissions.get(pluginId) || new Set(this.defaultPermissions));
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
hasPermission(pluginId: string, permission: PluginPermission): boolean {
|
|
286
|
+
const pluginPerms = this.permissions.get(pluginId);
|
|
287
|
+
if (!pluginPerms) return this.defaultPermissions.includes(permission);
|
|
288
|
+
return pluginPerms.has(permission);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
revokePermission(pluginId: string, permission: PluginPermission): boolean {
|
|
292
|
+
const pluginPerms = this.permissions.get(pluginId);
|
|
293
|
+
if (!pluginPerms) return false;
|
|
294
|
+
|
|
295
|
+
const removed = pluginPerms.delete(permission);
|
|
296
|
+
if (removed) {
|
|
297
|
+
this.emit('permission:revoked', { pluginId, permission });
|
|
298
|
+
}
|
|
299
|
+
return removed;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
revokeAllPermissions(pluginId: string): void {
|
|
303
|
+
this.permissions.delete(pluginId);
|
|
304
|
+
this.emit('permissions:revoked', { pluginId });
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
getPendingRequests(): PluginPermissionRequest[] {
|
|
308
|
+
return Array.from(this.pendingRequests.values());
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
cleanup(): void {
|
|
312
|
+
this.permissions.clear();
|
|
313
|
+
this.pendingRequests.clear();
|
|
314
|
+
this.removeAllListeners();
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export default PluginMarketplace;
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { contextBridge, ipcRenderer } from 'electron';
|
|
2
|
+
|
|
3
|
+
// Expose protected methods that allow the renderer process to use
|
|
4
|
+
// the ipcRenderer without exposing the entire object
|
|
5
|
+
contextBridge.exposeInMainWorld('electronAPI', {
|
|
6
|
+
// Window controls
|
|
7
|
+
window: {
|
|
8
|
+
minimize: () => ipcRenderer.invoke('window:minimize'),
|
|
9
|
+
maximize: () => ipcRenderer.invoke('window:maximize'),
|
|
10
|
+
close: () => ipcRenderer.invoke('window:close'),
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
// Dialog operations
|
|
14
|
+
dialog: {
|
|
15
|
+
selectFolder: () => ipcRenderer.invoke('dialog:selectFolder'),
|
|
16
|
+
selectFile: (filters?: Electron.FileFilter[]) => ipcRenderer.invoke('dialog:selectFile', filters),
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
// Shell operations
|
|
20
|
+
shell: {
|
|
21
|
+
openExternal: (url: string) => ipcRenderer.invoke('shell:openExternal', url),
|
|
22
|
+
openPath: (path: string) => ipcRenderer.invoke('shell:openPath', path),
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
// Agent operations
|
|
26
|
+
agent: {
|
|
27
|
+
create: (config: any) => ipcRenderer.invoke('agent:create', config),
|
|
28
|
+
list: () => ipcRenderer.invoke('agent:list'),
|
|
29
|
+
get: (agentId: string) => ipcRenderer.invoke('agent:get', agentId),
|
|
30
|
+
sendMessage: (agentId: string, message: string) => ipcRenderer.invoke('agent:sendMessage', agentId, message),
|
|
31
|
+
sendMessageStream: (agentId: string, message: string) => ipcRenderer.invoke('agent:sendMessageStream', agentId, message),
|
|
32
|
+
executeTask: (agentId: string, task: string) => ipcRenderer.invoke('agent:executeTask', agentId, task),
|
|
33
|
+
pause: (agentId: string) => ipcRenderer.invoke('agent:pause', agentId),
|
|
34
|
+
resume: (agentId: string) => ipcRenderer.invoke('agent:resume', agentId),
|
|
35
|
+
stop: (agentId: string) => ipcRenderer.invoke('agent:stop', agentId),
|
|
36
|
+
delete: (agentId: string) => ipcRenderer.invoke('agent:delete', agentId),
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
// Cowork operations
|
|
40
|
+
cowork: {
|
|
41
|
+
create: (name: string, objective: string, projectPath: string, options?: any) => ipcRenderer.invoke('cowork:create', name, objective, projectPath, options),
|
|
42
|
+
start: (sessionId: string) => ipcRenderer.invoke('cowork:start', sessionId),
|
|
43
|
+
pause: (sessionId: string) => ipcRenderer.invoke('cowork:pause', sessionId),
|
|
44
|
+
stop: (sessionId: string) => ipcRenderer.invoke('cowork:stop', sessionId),
|
|
45
|
+
list: () => ipcRenderer.invoke('cowork:list'),
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
// Pair programming operations
|
|
49
|
+
pair: {
|
|
50
|
+
start: (projectPath: string, mode: string, userId: string) => ipcRenderer.invoke('pair:start', projectPath, mode, userId),
|
|
51
|
+
chat: (sessionId: string, message: string) => ipcRenderer.invoke('pair:chat', sessionId, message),
|
|
52
|
+
end: (sessionId: string) => ipcRenderer.invoke('pair:end', sessionId),
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
// Smart code assistant
|
|
56
|
+
assistant: {
|
|
57
|
+
inlineCompletion: (filePath: string, content: string, position: any) => ipcRenderer.invoke('assistant:inlineCompletion', filePath, content, position),
|
|
58
|
+
suggestFixes: (filePath: string, content: string) => ipcRenderer.invoke('assistant:suggestFixes', filePath, content),
|
|
59
|
+
explain: (code: string) => ipcRenderer.invoke('assistant:explain', code),
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
// Metrics operations
|
|
63
|
+
metrics: {
|
|
64
|
+
get: () => ipcRenderer.invoke('metrics:get'),
|
|
65
|
+
export: () => ipcRenderer.invoke('metrics:export'),
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
// Worktree operations
|
|
69
|
+
worktree: {
|
|
70
|
+
create: (repoPath: string, name: string) => ipcRenderer.invoke('worktree:create', repoPath, name),
|
|
71
|
+
list: (repoPath: string) => ipcRenderer.invoke('worktree:list', repoPath),
|
|
72
|
+
remove: (repoPath: string, name: string) => ipcRenderer.invoke('worktree:remove', repoPath, name),
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
// Skills operations
|
|
76
|
+
skills: {
|
|
77
|
+
list: () => ipcRenderer.invoke('skills:list'),
|
|
78
|
+
get: (skillId: string) => ipcRenderer.invoke('skills:get', skillId),
|
|
79
|
+
create: (config: any) => ipcRenderer.invoke('skills:create', config),
|
|
80
|
+
update: (skillId: string, config: any) => ipcRenderer.invoke('skills:update', skillId, config),
|
|
81
|
+
delete: (skillId: string) => ipcRenderer.invoke('skills:delete', skillId),
|
|
82
|
+
applyToAgent: (agentId: string, skillIds: string[]) => ipcRenderer.invoke('skills:applyToAgent', agentId, skillIds),
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
// Automation operations
|
|
86
|
+
automation: {
|
|
87
|
+
list: () => ipcRenderer.invoke('automation:list'),
|
|
88
|
+
create: (config: any) => ipcRenderer.invoke('automation:create', config),
|
|
89
|
+
update: (automationId: string, config: any) => ipcRenderer.invoke('automation:update', automationId, config),
|
|
90
|
+
delete: (automationId: string) => ipcRenderer.invoke('automation:delete', automationId),
|
|
91
|
+
toggle: (automationId: string, enabled: boolean) => ipcRenderer.invoke('automation:toggle', automationId, enabled),
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
// Settings operations
|
|
95
|
+
settings: {
|
|
96
|
+
get: (key: string) => ipcRenderer.invoke('settings:get', key),
|
|
97
|
+
set: (key: string, value: any) => ipcRenderer.invoke('settings:set', key, value),
|
|
98
|
+
getAll: () => ipcRenderer.invoke('settings:getAll'),
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
// AI Provider operations
|
|
102
|
+
providers: {
|
|
103
|
+
list: () => ipcRenderer.invoke('providers:list'),
|
|
104
|
+
getActive: () => ipcRenderer.invoke('providers:getActive'),
|
|
105
|
+
setActive: (providerId: string) => ipcRenderer.invoke('providers:setActive', providerId),
|
|
106
|
+
configure: (providerId: string, config: any) => ipcRenderer.invoke('providers:configure', providerId, config),
|
|
107
|
+
test: (providerId: string) => ipcRenderer.invoke('providers:test', providerId),
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
// File system operations
|
|
111
|
+
fs: {
|
|
112
|
+
readdir: (path: string, options?: { withFileTypes?: boolean }) => ipcRenderer.invoke('fs:readdir', path, options),
|
|
113
|
+
readFile: (path: string, encoding?: BufferEncoding) => ipcRenderer.invoke('fs:readFile', path, encoding),
|
|
114
|
+
writeFile: (path: string, content: string) => ipcRenderer.invoke('fs:writeFile', path, content),
|
|
115
|
+
stat: (path: string) => ipcRenderer.invoke('fs:stat', path),
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
// Terminal operations
|
|
119
|
+
terminal: {
|
|
120
|
+
execute: ({ command, cwd }: { command: string; cwd: string }) => ipcRenderer.invoke('terminal:execute', { command, cwd }),
|
|
121
|
+
kill: () => ipcRenderer.invoke('terminal:kill'),
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
// Code changes operations
|
|
125
|
+
changes: {
|
|
126
|
+
list: (agentId?: string) => ipcRenderer.invoke('changes:list', agentId),
|
|
127
|
+
approve: (changeId: string) => ipcRenderer.invoke('changes:approve', changeId),
|
|
128
|
+
reject: (changeId: string, comment?: string) => ipcRenderer.invoke('changes:reject', changeId, comment),
|
|
129
|
+
apply: (changeId: string) => ipcRenderer.invoke('changes:apply', changeId),
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
// Checkpoints operations
|
|
133
|
+
checkpoints: {
|
|
134
|
+
list: (agentId?: string) => ipcRenderer.invoke('checkpoints:list', agentId),
|
|
135
|
+
restore: (checkpointId: string) => ipcRenderer.invoke('checkpoints:restore', checkpointId),
|
|
136
|
+
restoreLast: (agentId: string) => ipcRenderer.invoke('checkpoints:restoreLast', agentId),
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
// Agent queue operations
|
|
140
|
+
queue: {
|
|
141
|
+
list: (agentId: string) => ipcRenderer.invoke('queue:list', agentId),
|
|
142
|
+
enqueue: (agentId: string, type: 'message' | 'task', content: string) => ipcRenderer.invoke('queue:enqueue', agentId, type, content),
|
|
143
|
+
delete: (agentId: string, itemId: string) => ipcRenderer.invoke('queue:delete', agentId, itemId),
|
|
144
|
+
moveUp: (agentId: string, itemId: string) => ipcRenderer.invoke('queue:moveUp', agentId, itemId),
|
|
145
|
+
claimNext: (agentId: string) => ipcRenderer.invoke('queue:claimNext', agentId),
|
|
146
|
+
complete: (agentId: string, itemId: string, outcome: 'completed' | 'failed', error?: string) => ipcRenderer.invoke('queue:complete', agentId, itemId, outcome, error),
|
|
147
|
+
history: (agentId: string, limit?: number) => ipcRenderer.invoke('queue:history', agentId, limit),
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
// Audit log operations
|
|
151
|
+
audit: {
|
|
152
|
+
recent: (limit?: number) => ipcRenderer.invoke('audit:recent', limit),
|
|
153
|
+
byAction: (action: string, limit?: number) => ipcRenderer.invoke('audit:byAction', action, limit),
|
|
154
|
+
export: (exportPath: string) => ipcRenderer.invoke('audit:export', exportPath),
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
// Git operations
|
|
158
|
+
git: {
|
|
159
|
+
status: (repoPath: string) => ipcRenderer.invoke('git:status', repoPath),
|
|
160
|
+
commit: ({ repoPath, message, files }: { repoPath: string; message: string; files?: string[] }) => ipcRenderer.invoke('git:commit', { repoPath, message, files }),
|
|
161
|
+
diff: ({ repoPath, filePath }: { repoPath: string; filePath?: string }) => ipcRenderer.invoke('git:diff', { repoPath, filePath }),
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
// Search operations
|
|
165
|
+
search: {
|
|
166
|
+
files: ({ query, path, pattern }: { query: string; path: string; pattern?: string }) => ipcRenderer.invoke('search:files', { query, path, pattern }),
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
// Notifications
|
|
170
|
+
notification: {
|
|
171
|
+
show: ({ title, body }: { title: string; body: string }) => ipcRenderer.invoke('notification:show', { title, body }),
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
// Export/Import
|
|
175
|
+
data: {
|
|
176
|
+
export: (exportPath: string) => ipcRenderer.invoke('data:export', exportPath),
|
|
177
|
+
import: (importPath: string) => ipcRenderer.invoke('data:import', importPath),
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
// Event listeners
|
|
181
|
+
on: (channel: string, callback: (...args: any[]) => void) => {
|
|
182
|
+
const validChannels = [
|
|
183
|
+
'agent:message',
|
|
184
|
+
'agent:status',
|
|
185
|
+
'agent:progress',
|
|
186
|
+
'agent:error',
|
|
187
|
+
'agent:streamChunk',
|
|
188
|
+
'agent:streamEnd',
|
|
189
|
+
'agent:streamError',
|
|
190
|
+
'agent:taskStarted',
|
|
191
|
+
'agent:taskCompleted',
|
|
192
|
+
'agent:taskFailed',
|
|
193
|
+
'agent:paused',
|
|
194
|
+
'agent:resumed',
|
|
195
|
+
'agent:stopped',
|
|
196
|
+
'changes:created',
|
|
197
|
+
'automation:triggered',
|
|
198
|
+
'worktree:changed',
|
|
199
|
+
'skill:applied',
|
|
200
|
+
'terminal:data',
|
|
201
|
+
'notification:show'
|
|
202
|
+
];
|
|
203
|
+
if (validChannels.includes(channel)) {
|
|
204
|
+
ipcRenderer.on(channel, callback);
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
removeListener: (channel: string, callback: (...args: any[]) => void) => {
|
|
209
|
+
ipcRenderer.removeListener(channel, callback);
|
|
210
|
+
},
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
export type ElectronAPI = {
|
|
214
|
+
// Define the type without referencing window
|
|
215
|
+
};
|