wind-agent-cli 1.37.2 → 1.38.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/LICENSE +718 -718
- package/README.md +17 -2
- package/dist/api-docs.html +901 -901
- package/dist/assets/{CodeEditor-B2Wf7Fg0.js → CodeEditor-FvgsnJ7J.js} +6 -6
- package/dist/assets/FileTree-NLULrBDi.js +1 -0
- package/dist/assets/GitPanel-51KUBbEW.js +4 -0
- package/dist/assets/{MarkdownPreview-C0tqYnVu.js → MarkdownPreview-PEEWVWeS.js} +17 -27
- package/dist/assets/Shell-BEx66cW_.js +76 -0
- package/dist/assets/Shell-DrlLKa8f.css +1 -0
- package/dist/assets/StandaloneShell-BkuUCPZP.js +1 -0
- package/dist/assets/TaskMasterPanel-DfQG80SF.js +2 -0
- package/dist/assets/abnfDiagram-N423BO3Z-Cc0ul87U.js +1 -0
- package/dist/assets/arc-BAuugHw_.js +1 -0
- package/dist/assets/architectureDiagram-T3A2C74G-DA3G7QZD.js +36 -0
- package/dist/assets/{blockDiagram-VBNYF7ZC-DpaEf3mv.js → blockDiagram-VBNYF7ZC-tJ12IJs3.js} +4 -4
- package/dist/assets/c4Diagram-5PPSVZJV-5BTMCXL4.js +10 -0
- package/dist/assets/channel-BGDgNNQz.js +1 -0
- package/dist/assets/{chunk-2GRJ4B5K-DoSdNo8u.js → chunk-2GRJ4B5K-BPaI06Ou.js} +1 -1
- package/dist/assets/{chunk-2Q5K7J3B-CE7I3uMn.js → chunk-2Q5K7J3B-HV4zmsEe.js} +1 -1
- package/dist/assets/chunk-5RXB4S5H-BAwutJoU.js +231 -0
- package/dist/assets/{chunk-5VM5RSS4-B55XgqHZ.js → chunk-5VM5RSS4-B9QAJPrv.js} +1 -1
- package/dist/assets/{chunk-6Q2QTUOP-BS1KpefW.js → chunk-6Q2QTUOP-BOIW8bzI.js} +1 -1
- package/dist/assets/chunk-GF5L2VYU-DD13o00-.js +206 -0
- package/dist/assets/{chunk-JWPE2WC7-DOtkNhMm.js → chunk-JWPE2WC7-CFBm23VK.js} +1 -1
- package/dist/assets/{chunk-KBJHAD2P-BXLjviqM.js → chunk-KBJHAD2P-C0i0v8Op.js} +1 -1
- package/dist/assets/{chunk-RYQCIY6F-C50fjNNz.js → chunk-RYQCIY6F-DfeK0taV.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-QBYqCkb7.js → chunk-XXDRQBXY-BKWvf-QE.js} +1 -1
- package/dist/assets/classDiagram-JCYQIIEL-C2SNM4oy.js +1 -0
- package/dist/assets/classDiagram-v2-OCEON4UE-C2SNM4oy.js +1 -0
- package/dist/assets/cose-bilkent-JH36ORCC-CBE8oM7L.js +1 -0
- package/dist/assets/{cynefin-VYW2F7L2-DnJa_OlQ.js → cynefin-VYW2F7L2-DziGp35A.js} +11 -23
- package/dist/assets/cynefinDiagram-MW4NZA55-CNvtHl39.js +62 -0
- package/dist/assets/cytoscape.esm-yzknjiTM.js +321 -0
- package/dist/assets/dagre-VZM6K2ZE-Bz9lsU7m.js +4 -0
- package/dist/assets/{diagram-7IWD3JNH-pFzs9HEu.js → diagram-7IWD3JNH-CV7D3VSd.js} +5 -5
- package/dist/assets/{diagram-B4RE2ZJO-CcehQC7x.js → diagram-B4RE2ZJO-Dj4EjDNC.js} +2 -2
- package/dist/assets/diagram-LBJQPF4R-wJ6FHvf-.js +24 -0
- package/dist/assets/diagram-Q27KOJAE-DMFYMhOB.js +24 -0
- package/dist/assets/diagram-UB23O5K3-DeBSbWAI.js +41 -0
- package/dist/assets/ebnfDiagram-BXEA7PRR-2NnJSGhT.js +1 -0
- package/dist/assets/erDiagram-JOGREHBK-DrSlg8hr.js +85 -0
- package/dist/assets/feature-chat-CvOCyaLe.js +88 -0
- package/dist/assets/feature-workspace-CAB6bgPy.js +39 -0
- package/dist/assets/{flowDiagram-UKHOOZJN-CJV8fQPR.js → flowDiagram-UKHOOZJN-C0pejU6W.js} +4 -4
- package/dist/assets/ganttDiagram-PKOTCBZU-BM0VCUUz.js +292 -0
- package/dist/assets/gitGraphDiagram-DS77QQ5N-SbLG0c5_.js +106 -0
- package/dist/assets/graph-DOmOIIwC.js +1 -0
- package/dist/assets/{index-GFhXZyl2.js → index-BflGfU1C.js} +3 -3
- package/dist/assets/index-Btkf0_rU.js +1 -0
- package/dist/assets/index-Cr5MbHuj.css +1 -0
- package/dist/assets/index-Gqazqfs3.js +1 -0
- package/dist/assets/index-nyrkoQK6.js +35 -0
- package/dist/assets/infoDiagram-6WML65LV-Cf5DSa66.js +2 -0
- package/dist/assets/ishikawaDiagram-WSZJBQD7-DwyFutKy.js +70 -0
- package/dist/assets/journeyDiagram-NVQOT4AX-Df0FRhLo.js +139 -0
- package/dist/assets/{kanban-definition-27J2QSJJ-B3iL0ztJ.js → kanban-definition-27J2QSJJ-HmpbjrZz.js} +6 -6
- package/dist/assets/{layout-D6BstSzF.js → layout-D-LzfAck.js} +1 -1
- package/dist/assets/{linear-Cwe9dEKA.js → linear-DOM01LBe.js} +1 -1
- package/dist/assets/map-DxJ2ADlA.js +1 -0
- package/dist/assets/mermaid.core-C2Ma-_S6.js +306 -0
- package/dist/assets/{mindmap-definition-FAOFIHXS-BgfBYMzr.js → mindmap-definition-FAOFIHXS-B4GOIn76.js} +4 -4
- package/dist/assets/pegDiagram-VL7TDLO6-BHur7aH2.js +1 -0
- package/dist/assets/{pieDiagram-7S7Q4E2Y-DeSrxc4I.js → pieDiagram-7S7Q4E2Y-Cw0UELLV.js} +2 -2
- package/dist/assets/quadrantDiagram-CIZ2JOQS-CB2BrX3g.js +7 -0
- package/dist/assets/railroadDiagram-AXF67PYL-DPYZYmLX.js +1 -0
- package/dist/assets/requirementDiagram-LRYGKXZP-DSX4IJ1n.js +84 -0
- package/dist/assets/sankeyDiagram-W5VNT64P-TenC3ZQo.js +40 -0
- package/dist/assets/sequenceDiagram-SI44F4Z6-DltGsf3F.js +162 -0
- package/dist/assets/sizeCapture-X5ZJPWSS-D7llwbJZ.js +1 -0
- package/dist/assets/stateDiagram-OKZ733FA-C-hAvbnY.js +1 -0
- package/dist/assets/stateDiagram-v2-UEYNNEHI-DaYSFcRQ.js +1 -0
- package/dist/assets/swimlanes-SLNWSIFB-DWD30fv6.js +2 -0
- package/dist/assets/swimlanesDiagram-ULZ7WXOC-LTkF2T6t.js +8 -0
- package/dist/assets/timeline-definition-Z64GVDOM-quWmimSE.js +120 -0
- package/dist/assets/vendor-data-DsEZeNPr.js +4 -0
- package/dist/assets/vendor-i18n-B6HjLCnN.js +1 -0
- package/dist/assets/vendor-markdown-DkITEES2.js +298 -0
- package/dist/assets/vendor-react-C2GTiUCy.js +10 -0
- package/dist/assets/vendor-ui-CAUHSABu.js +49 -0
- package/dist/assets/vennDiagram-T6HMQDX7-aUQcm8h5.js +34 -0
- package/dist/assets/{wardleyDiagram-T6FBY63Y-BNCpsFZV.js → wardleyDiagram-T6FBY63Y-BZ0bwsFQ.js} +2 -2
- package/dist/assets/workbox-window.prod.es5-BBnX5xw4.js +2 -0
- package/dist/assets/xychartDiagram-ELKLHX3M-DOVzAq63.js +7 -0
- package/dist/clear-cache.html +85 -85
- package/dist/convert-icons.md +52 -52
- package/dist/favicon.png +0 -0
- package/dist/favicon.svg +8 -8
- package/dist/generate-icons.js +48 -48
- package/dist/icons/codex-white.svg +3 -3
- package/dist/icons/codex.svg +3 -3
- package/dist/icons/cursor-white.svg +11 -11
- package/dist/icons/icon-128x128.png +0 -0
- package/dist/icons/icon-128x128.svg +11 -11
- package/dist/icons/icon-144x144.png +0 -0
- package/dist/icons/icon-144x144.svg +11 -11
- package/dist/icons/icon-152x152.png +0 -0
- package/dist/icons/icon-152x152.svg +11 -11
- package/dist/icons/icon-180x180.png +0 -0
- package/dist/icons/icon-192x192.png +0 -0
- package/dist/icons/icon-192x192.svg +11 -11
- package/dist/icons/icon-384x384.png +0 -0
- package/dist/icons/icon-384x384.svg +11 -11
- package/dist/icons/icon-512x512.png +0 -0
- package/dist/icons/icon-512x512.svg +11 -11
- package/dist/icons/icon-72x72.png +0 -0
- package/dist/icons/icon-72x72.svg +11 -11
- package/dist/icons/icon-96x96.png +0 -0
- package/dist/icons/icon-96x96.svg +11 -11
- package/dist/icons/icon-maskable-192x192.png +0 -0
- package/dist/icons/icon-maskable-512x512.png +0 -0
- package/dist/icons/icon-template.svg +11 -11
- package/dist/icons/new-icon.png +0 -0
- package/dist/index.html +48 -58
- package/dist/logo-128.png +0 -0
- package/dist/logo-256.png +0 -0
- package/dist/logo.svg +17 -17
- package/dist/manifest.webmanifest +1 -0
- package/dist/push-sw.js +48 -0
- package/dist/screenshots/setup-screen-mobile.png +0 -0
- package/dist/screenshots/setup-screen.png +0 -0
- package/dist/sw.js +1 -124
- package/dist/workbox-ae5c0bb2.js +1 -0
- package/dist-server/server/index.js +1 -1
- package/dist-server/server/index.js.map +1 -1
- package/dist-server/server/load-env.js +4 -2
- package/dist-server/server/load-env.js.map +1 -1
- package/dist-server/server/modules/agent/agent.routes.js +1 -1
- package/dist-server/server/modules/agent/agent.routes.js.map +1 -1
- package/dist-server/server/modules/browser-use/browser-use.service.js +1 -1
- package/dist-server/server/modules/browser-use/browser-use.service.js.map +1 -1
- package/dist-server/server/modules/cli/cli.service.js +37 -37
- package/dist-server/server/modules/cli/cli.service.js.map +1 -1
- package/dist-server/server/modules/cli/sandbox.service.js +43 -43
- package/dist-server/server/modules/cli/sandbox.service.js.map +1 -1
- package/dist-server/server/modules/cli/tests/cli-environment-bootstrap.test.js +74 -74
- package/dist-server/server/modules/commands/commands.routes.js +25 -25
- package/dist-server/server/modules/commands/commands.routes.js.map +1 -1
- package/dist-server/server/modules/commands/tests/commands.test.js +1 -1
- package/dist-server/server/modules/commands/tests/commands.test.js.map +1 -1
- package/dist-server/server/modules/database/connection.js +1 -1
- package/dist-server/server/modules/database/connection.js.map +1 -1
- package/dist-server/server/modules/database/migrations.js +190 -190
- package/dist-server/server/modules/database/repositories/api-keys.js +3 -3
- package/dist-server/server/modules/database/repositories/github-tokens.js +2 -2
- package/dist-server/server/modules/database/repositories/notification-channel-endpoints.js +28 -28
- package/dist-server/server/modules/database/repositories/notification-preferences.js +4 -4
- package/dist-server/server/modules/database/repositories/projects.db.js +61 -61
- package/dist-server/server/modules/database/repositories/provider-models.js +35 -35
- package/dist-server/server/modules/database/repositories/push-subscriptions.js +5 -5
- package/dist-server/server/modules/database/repositories/scan-state.db.js +5 -5
- package/dist-server/server/modules/database/repositories/sessions.db.js +93 -93
- package/dist-server/server/modules/database/schema.js +177 -177
- package/dist-server/server/modules/database/tests/projects.db.integration.test.js +3 -2
- package/dist-server/server/modules/database/tests/projects.db.integration.test.js.map +1 -1
- package/dist-server/server/modules/database/tests/provider-models.db.integration.test.js +6 -6
- package/dist-server/server/modules/database/tests/sessions-provider-mapping.test.js +4 -3
- package/dist-server/server/modules/database/tests/sessions-provider-mapping.test.js.map +1 -1
- package/dist-server/server/modules/database/tests/sessions.db.integration.test.js +2 -1
- package/dist-server/server/modules/database/tests/sessions.db.integration.test.js.map +1 -1
- package/dist-server/server/modules/git/git.routes.js +17 -17
- package/dist-server/server/modules/notifications/services/notification-orchestrator.service.js +1 -1
- package/dist-server/server/modules/notifications/services/notification-orchestrator.service.js.map +1 -1
- package/dist-server/server/modules/notifications/vapid-keys.service.js +1 -1
- package/dist-server/server/modules/notifications/vapid-keys.service.js.map +1 -1
- package/dist-server/server/modules/projects/tests/project-management.service.test.js +2 -1
- package/dist-server/server/modules/projects/tests/project-management.service.test.js.map +1 -1
- package/dist-server/server/modules/providers/list/codex/codex-app-server.client.js +2 -2
- package/dist-server/server/modules/providers/list/codex/codex-app-server.client.js.map +1 -1
- package/dist-server/server/modules/providers/list/codex/codex-models.provider.js +1 -1
- package/dist-server/server/modules/providers/list/codex/codex-models.provider.js.map +1 -1
- package/dist-server/server/modules/providers/list/cursor/cursor-models.provider.js +1 -1
- package/dist-server/server/modules/providers/list/cursor/cursor-models.provider.js.map +1 -1
- package/dist-server/server/modules/providers/list/cursor/cursor-session-synchronizer.provider.js.map +1 -1
- package/dist-server/server/modules/providers/list/opencode/opencode-models.provider.js +13 -13
- package/dist-server/server/modules/providers/list/opencode/opencode-runtime.provider.js +9 -9
- package/dist-server/server/modules/providers/list/opencode/opencode-runtime.provider.test.js +17 -17
- package/dist-server/server/modules/providers/list/opencode/opencode-session-synchronizer.provider.js +25 -25
- package/dist-server/server/modules/providers/list/opencode/opencode-sessions.provider.js +27 -27
- package/dist-server/server/modules/providers/services/provider-token-usage.service.js +9 -9
- package/dist-server/server/modules/providers/services/sessions.service.js +1 -1
- package/dist-server/server/modules/providers/tests/claude-auth.test.js +8 -0
- package/dist-server/server/modules/providers/tests/claude-auth.test.js.map +1 -1
- package/dist-server/server/modules/providers/tests/codex-sessions.test.js +1 -1
- package/dist-server/server/modules/providers/tests/codex-sessions.test.js.map +1 -1
- package/dist-server/server/modules/providers/tests/mcp.test.js +3 -3
- package/dist-server/server/modules/providers/tests/opencode-sessions.test.js +98 -98
- package/dist-server/server/modules/providers/tests/opencode-sessions.test.js.map +1 -1
- package/dist-server/server/modules/providers/tests/provider-token-usage.service.test.js +18 -18
- package/dist-server/server/modules/providers/tests/provider.routes.test.js +1 -1
- package/dist-server/server/modules/providers/tests/provider.routes.test.js.map +1 -1
- package/dist-server/server/modules/system/system.service.js +1 -1
- package/dist-server/server/modules/system/system.service.js.map +1 -1
- package/dist-server/server/modules/system/tests/system.service.test.js +1 -1
- package/dist-server/server/modules/system/tests/system.service.test.js.map +1 -1
- package/dist-server/server/modules/taskmaster/taskmaster.routes.js +423 -422
- package/dist-server/server/modules/taskmaster/taskmaster.routes.js.map +1 -1
- package/dist-server/server/modules/websocket/services/shell-websocket.service.js +1 -1
- package/dist-server/server/modules/websocket/services/shell-websocket.service.js.map +1 -1
- package/dist-server/server/modules/worktrees/services/worktree-list.service.js +1 -1
- package/dist-server/server/modules/worktrees/services/worktree-open.service.js +1 -1
- package/dist-server/server/modules/worktrees/services/worktree-remove.service.js +1 -1
- package/electron/cloud.js +260 -260
- package/electron/desktopNotifications.js +378 -378
- package/electron/desktopWindow.js +766 -766
- package/electron/launcher/index.html +14 -14
- package/electron/launcher/launcher.css +801 -801
- package/electron/launcher/launcher.js +687 -687
- package/electron/localServer.js +549 -549
- package/electron/main.js +944 -944
- package/electron/preload.cjs +60 -60
- package/electron/scripts/generate-macos-icon.js +62 -62
- package/electron/serverInstaller.js +277 -277
- package/electron/tabs.js +87 -87
- package/electron/viewHost.js +331 -331
- package/package.json +262 -247
- package/public/api-docs.html +901 -901
- package/scripts/build-client.mjs +30 -0
- package/scripts/fix-node-pty.js +67 -67
- package/scripts/generate-pwa-icons.ps1 +33 -0
- package/scripts/promote-dist-server.mjs +50 -50
- package/scripts/release/build-server-bundle.js +176 -176
- package/scripts/release/prepare-desktop-app.js +152 -152
- package/scripts/verify-pwa-build.mjs +37 -0
- package/server/index.ts +399 -399
- package/server/load-env.ts +49 -47
- package/server/modules/agent/agent.module.ts +52 -52
- package/server/modules/agent/agent.routes.ts +1287 -1287
- package/server/modules/agent/index.ts +2 -2
- package/server/modules/agent/tests/agent.routes.test.ts +205 -205
- package/server/modules/assets/assets.routes.ts +150 -150
- package/server/modules/assets/index.ts +3 -3
- package/server/modules/assets/services/image-assets.service.ts +127 -127
- package/server/modules/assets/tests/image-assets.service.test.ts +74 -74
- package/server/modules/auth/auth.middleware.ts +163 -163
- package/server/modules/auth/auth.module.ts +38 -38
- package/server/modules/auth/auth.routes.ts +57 -57
- package/server/modules/auth/auth.service.ts +155 -155
- package/server/modules/auth/index.ts +9 -9
- package/server/modules/auth/tests/auth.service.test.ts +95 -95
- package/server/modules/browser-use/browser-use-mcp.routes.ts +120 -120
- package/server/modules/browser-use/browser-use-mcp.ts +386 -386
- package/server/modules/browser-use/browser-use-runtime.ts +10 -10
- package/server/modules/browser-use/browser-use.routes.ts +96 -96
- package/server/modules/browser-use/browser-use.service.ts +836 -836
- package/server/modules/browser-use/index.ts +11 -11
- package/server/modules/browser-use/tests/browser-use.service.test.ts +10 -10
- package/server/modules/cli/cli.module.ts +93 -93
- package/server/modules/cli/cli.service.ts +248 -248
- package/server/modules/cli/cli.ts +19 -19
- package/server/modules/cli/index.ts +2 -2
- package/server/modules/cli/sandbox.service.ts +398 -398
- package/server/modules/cli/tests/cli-environment-bootstrap.test.ts +186 -186
- package/server/modules/cli/tests/cli.service.test.ts +86 -86
- package/server/modules/cli/tests/sandbox.service.test.ts +58 -58
- package/server/modules/commands/commands.module.ts +22 -22
- package/server/modules/commands/commands.routes.ts +587 -587
- package/server/modules/commands/index.ts +2 -2
- package/server/modules/commands/tests/commands.test.ts +110 -110
- package/server/modules/database/connection.ts +144 -143
- package/server/modules/database/index.ts +17 -17
- package/server/modules/database/init-db.ts +17 -17
- package/server/modules/database/migrations.ts +515 -515
- package/server/modules/database/repositories/api-keys.ts +119 -119
- package/server/modules/database/repositories/app-config.ts +53 -53
- package/server/modules/database/repositories/credentials.ts +106 -106
- package/server/modules/database/repositories/github-tokens.ts +100 -100
- package/server/modules/database/repositories/notification-channel-endpoints.ts +153 -153
- package/server/modules/database/repositories/notification-preferences.ts +117 -117
- package/server/modules/database/repositories/projects.db.ts +196 -196
- package/server/modules/database/repositories/provider-models.ts +168 -168
- package/server/modules/database/repositories/push-subscriptions.ts +80 -80
- package/server/modules/database/repositories/scan-state.db.ts +42 -42
- package/server/modules/database/repositories/sessions.db.ts +524 -524
- package/server/modules/database/repositories/users.ts +140 -140
- package/server/modules/database/repositories/vapid-keys.ts +57 -57
- package/server/modules/database/schema.ts +210 -210
- package/server/modules/database/tests/projects.db.integration.test.ts +73 -72
- package/server/modules/database/tests/provider-models.db.integration.test.ts +125 -125
- package/server/modules/database/tests/sessions-provider-mapping.test.ts +110 -109
- package/server/modules/database/tests/sessions.db.integration.test.ts +117 -116
- package/server/modules/file-tree/file-tree.module.ts +116 -116
- package/server/modules/file-tree/file-tree.routes.ts +258 -258
- package/server/modules/file-tree/file-tree.service.ts +675 -675
- package/server/modules/file-tree/index.ts +2 -2
- package/server/modules/file-tree/tests/file-tree.routes.test.ts +157 -157
- package/server/modules/file-tree/tests/file-tree.service.test.ts +371 -371
- package/server/modules/git/git-branch.service.ts +43 -43
- package/server/modules/git/git-parsing.service.ts +66 -66
- package/server/modules/git/git.module.ts +22 -22
- package/server/modules/git/git.routes.ts +1596 -1596
- package/server/modules/git/index.ts +2 -2
- package/server/modules/git/tests/git-branch.service.test.ts +60 -60
- package/server/modules/git/tests/git-init.routes.test.ts +132 -132
- package/server/modules/git/tests/git.test.ts +106 -106
- package/server/modules/notifications/index.ts +24 -24
- package/server/modules/notifications/notifications.routes.ts +127 -127
- package/server/modules/notifications/services/desktop-notification-clients.service.ts +124 -124
- package/server/modules/notifications/services/notification-orchestrator.service.js +310 -310
- package/server/modules/notifications/tests/notification-orchestrator.integration.test.ts +55 -55
- package/server/modules/notifications/vapid-keys.service.ts +38 -38
- package/server/modules/notifications/websocket/desktop-notifications-websocket.service.ts +109 -109
- package/server/modules/plugins/index.ts +9 -9
- package/server/modules/plugins/plugin-process.service.ts +217 -217
- package/server/modules/plugins/plugin-registry.service.ts +459 -459
- package/server/modules/plugins/plugins.module.ts +33 -33
- package/server/modules/plugins/plugins.routes.ts +66 -66
- package/server/modules/plugins/plugins.service.ts +147 -147
- package/server/modules/plugins/tests/plugins.service.test.ts +32 -32
- package/server/modules/projects/index.ts +11 -11
- package/server/modules/projects/projects.routes.ts +273 -273
- package/server/modules/projects/services/project-clone.service.ts +323 -323
- package/server/modules/projects/services/project-delete.service.ts +90 -90
- package/server/modules/projects/services/project-management.service.ts +144 -144
- package/server/modules/projects/services/project-star.service.ts +78 -78
- package/server/modules/projects/services/projects-has-taskmaster.service.ts +248 -248
- package/server/modules/projects/services/projects-with-sessions-fetch.service.ts +314 -314
- package/server/modules/projects/tests/project-clone.service.test.ts +183 -183
- package/server/modules/projects/tests/project-management.service.test.ts +118 -117
- package/server/modules/projects/tests/project-star.service.test.ts +123 -123
- package/server/modules/projects/tests/projects-has-taskmaster.service.test.ts +105 -105
- package/server/modules/providers/README.md +380 -380
- package/server/modules/providers/index.ts +10 -10
- package/server/modules/providers/list/claude/claude-auth.provider.ts +160 -160
- package/server/modules/providers/list/claude/claude-mcp.provider.ts +135 -135
- package/server/modules/providers/list/claude/claude-models.provider.ts +294 -294
- package/server/modules/providers/list/claude/claude-runtime.provider.js +1068 -1068
- package/server/modules/providers/list/claude/claude-session-synchronizer.provider.ts +203 -203
- package/server/modules/providers/list/claude/claude-sessions.provider.ts +684 -684
- package/server/modules/providers/list/claude/claude-skills.provider.ts +265 -265
- package/server/modules/providers/list/claude/claude.provider.ts +30 -30
- package/server/modules/providers/list/codex/codex-app-server.client.ts +2 -2
- package/server/modules/providers/list/codex/codex-auth.provider.ts +100 -100
- package/server/modules/providers/list/codex/codex-mcp.provider.ts +135 -135
- package/server/modules/providers/list/codex/codex-models.provider.ts +123 -123
- package/server/modules/providers/list/codex/codex-runtime.provider.js +533 -533
- package/server/modules/providers/list/codex/codex-session-synchronizer.provider.ts +203 -203
- package/server/modules/providers/list/codex/codex-sessions.provider.ts +938 -938
- package/server/modules/providers/list/codex/codex-skills.provider.ts +73 -73
- package/server/modules/providers/list/codex/codex.provider.ts +28 -28
- package/server/modules/providers/list/cursor/cursor-auth.provider.ts +143 -143
- package/server/modules/providers/list/cursor/cursor-mcp.provider.ts +108 -108
- package/server/modules/providers/list/cursor/cursor-models.provider.ts +119 -119
- package/server/modules/providers/list/cursor/cursor-runtime.provider.js +385 -385
- package/server/modules/providers/list/cursor/cursor-session-synchronizer.provider.ts +158 -159
- package/server/modules/providers/list/cursor/cursor-sessions.provider.ts +654 -654
- package/server/modules/providers/list/cursor/cursor-skills.provider.ts +39 -39
- package/server/modules/providers/list/cursor/cursor.provider.ts +30 -30
- package/server/modules/providers/list/opencode/opencode-auth.provider.ts +110 -110
- package/server/modules/providers/list/opencode/opencode-mcp.provider.ts +228 -228
- package/server/modules/providers/list/opencode/opencode-models.provider.ts +203 -203
- package/server/modules/providers/list/opencode/opencode-runtime.provider.js +434 -434
- package/server/modules/providers/list/opencode/opencode-runtime.provider.test.js +261 -261
- package/server/modules/providers/list/opencode/opencode-session-synchronizer.provider.ts +179 -179
- package/server/modules/providers/list/opencode/opencode-sessions.provider.ts +500 -500
- package/server/modules/providers/list/opencode/opencode-skills.provider.ts +78 -78
- package/server/modules/providers/list/opencode/opencode.provider.ts +30 -30
- package/server/modules/providers/provider.registry.ts +36 -36
- package/server/modules/providers/provider.routes.ts +877 -877
- package/server/modules/providers/services/mcp.service.ts +109 -109
- package/server/modules/providers/services/provider-auth.service.ts +26 -26
- package/server/modules/providers/services/provider-capabilities.service.ts +97 -97
- package/server/modules/providers/services/provider-models.service.ts +401 -401
- package/server/modules/providers/services/provider-runtime.service.ts +108 -108
- package/server/modules/providers/services/provider-token-usage.service.ts +357 -357
- package/server/modules/providers/services/session-conversations-search.service.ts +1321 -1321
- package/server/modules/providers/services/session-synchronizer.service.ts +74 -74
- package/server/modules/providers/services/sessions-watcher.service.ts +247 -247
- package/server/modules/providers/services/sessions.service.ts +471 -471
- package/server/modules/providers/services/skills.service.ts +39 -39
- package/server/modules/providers/shared/base/abstract.provider.ts +32 -32
- package/server/modules/providers/shared/mcp/mcp.provider.ts +151 -151
- package/server/modules/providers/shared/skills/skills.provider.ts +287 -287
- package/server/modules/providers/tests/claude-auth.test.ts +157 -150
- package/server/modules/providers/tests/claude-sessions.test.ts +61 -61
- package/server/modules/providers/tests/codex-sessions.test.ts +231 -231
- package/server/modules/providers/tests/mcp.test.ts +349 -349
- package/server/modules/providers/tests/opencode-models.test.ts +41 -41
- package/server/modules/providers/tests/opencode-sessions.test.ts +522 -522
- package/server/modules/providers/tests/provider-attachment-history.test.ts +247 -247
- package/server/modules/providers/tests/provider-models.service.test.ts +353 -353
- package/server/modules/providers/tests/provider-runtime.service.test.ts +138 -138
- package/server/modules/providers/tests/provider-token-usage.service.test.ts +186 -186
- package/server/modules/providers/tests/provider.routes.test.ts +244 -244
- package/server/modules/providers/tests/sessions-details.test.ts +73 -73
- package/server/modules/providers/tests/sessions.service.test.ts +127 -127
- package/server/modules/providers/tests/skills.test.ts +692 -692
- package/server/modules/settings/index.ts +2 -2
- package/server/modules/settings/settings.module.ts +50 -50
- package/server/modules/settings/settings.routes.ts +51 -51
- package/server/modules/settings/settings.service.ts +186 -186
- package/server/modules/settings/tests/settings.service.test.ts +54 -54
- package/server/modules/system/index.ts +2 -2
- package/server/modules/system/system.module.ts +62 -62
- package/server/modules/system/system.routes.ts +21 -21
- package/server/modules/system/system.service.ts +76 -76
- package/server/modules/system/tests/system.service.test.ts +118 -118
- package/server/modules/taskmaster/index.ts +2 -2
- package/server/modules/taskmaster/taskmaster.module.ts +24 -24
- package/server/modules/taskmaster/taskmaster.routes.ts +1483 -1482
- package/server/modules/taskmaster/taskmaster.service.ts +132 -132
- package/server/modules/taskmaster/tests/taskmaster.routes.test.ts +144 -144
- package/server/modules/taskmaster/tests/taskmaster.service.test.ts +97 -97
- package/server/modules/user/index.ts +2 -2
- package/server/modules/user/tests/user.service.test.ts +61 -61
- package/server/modules/user/user.module.ts +58 -58
- package/server/modules/user/user.routes.ts +50 -50
- package/server/modules/user/user.service.ts +85 -85
- package/server/modules/voice/index.ts +2 -2
- package/server/modules/voice/tests/voice.service.test.ts +98 -98
- package/server/modules/voice/voice.module.ts +47 -47
- package/server/modules/voice/voice.routes.ts +113 -113
- package/server/modules/voice/voice.service.ts +192 -192
- package/server/modules/websocket/README.md +273 -273
- package/server/modules/websocket/index.ts +3 -3
- package/server/modules/websocket/services/chat-run-registry.service.ts +343 -343
- package/server/modules/websocket/services/chat-session-writer.service.ts +145 -145
- package/server/modules/websocket/services/chat-websocket.service.ts +425 -425
- package/server/modules/websocket/services/plugin-websocket-proxy.service.ts +65 -65
- package/server/modules/websocket/services/shell-websocket.service.ts +503 -503
- package/server/modules/websocket/services/websocket-auth.service.ts +59 -59
- package/server/modules/websocket/services/websocket-server.service.ts +124 -124
- package/server/modules/websocket/services/websocket-state.service.ts +16 -16
- package/server/modules/websocket/services/websocket-writer.service.ts +38 -38
- package/server/modules/websocket/tests/chat-attachment-filter.test.ts +59 -59
- package/server/modules/websocket/tests/chat-run-registry.test.ts +282 -282
- package/server/modules/websocket/tests/shell-websocket.service.test.ts +100 -100
- package/server/modules/websocket/tests/websocket-heartbeat.service.test.ts +78 -78
- package/server/modules/worktrees/index.ts +2 -2
- package/server/modules/worktrees/services/worktree-create-and-open.service.ts +53 -53
- package/server/modules/worktrees/services/worktree-create.service.ts +104 -104
- package/server/modules/worktrees/services/worktree-git.service.ts +207 -207
- package/server/modules/worktrees/services/worktree-list.service.ts +143 -143
- package/server/modules/worktrees/services/worktree-merge.service.ts +157 -157
- package/server/modules/worktrees/services/worktree-open.service.ts +85 -85
- package/server/modules/worktrees/services/worktree-remove.service.ts +88 -88
- package/server/modules/worktrees/tests/worktree-create-and-open.service.test.ts +68 -68
- package/server/modules/worktrees/tests/worktree-create.service.test.ts +142 -142
- package/server/modules/worktrees/tests/worktree-git.service.test.ts +84 -84
- package/server/modules/worktrees/tests/worktree-list.service.test.ts +45 -45
- package/server/modules/worktrees/tests/worktree-merge.service.test.ts +213 -213
- package/server/modules/worktrees/tests/worktree-open.service.test.ts +122 -122
- package/server/modules/worktrees/tests/worktree-remove.service.test.ts +227 -227
- package/server/modules/worktrees/tests/worktrees.routes.test.ts +199 -199
- package/server/modules/worktrees/worktrees.module.ts +113 -113
- package/server/modules/worktrees/worktrees.routes.ts +116 -116
- package/server/shared/claude-cli-path.ts +139 -139
- package/server/shared/frontmatter.ts +18 -18
- package/server/shared/image-attachments.ts +435 -435
- package/server/shared/interfaces.ts +179 -179
- package/server/shared/tests/claude-cli-path.test.ts +61 -61
- package/server/shared/tests/image-attachments.test.ts +353 -353
- package/server/shared/tests/slice-tail-page.test.ts +42 -42
- package/server/shared/types.ts +1228 -1228
- package/server/shared/utils.ts +1161 -1161
- package/server/tsconfig.json +40 -40
- package/shared/networkHosts.js +22 -22
- package/dist/assets/FileTree-N2IkkHlv.js +0 -127
- package/dist/assets/GitPanel-DZCeuFZ2.js +0 -29
- package/dist/assets/PluginTabContent-Bnuf-fb8.js +0 -1
- package/dist/assets/Shell-BfFnMZ-f.js +0 -81
- package/dist/assets/Shell-qxJ8_QYu.css +0 -32
- package/dist/assets/StandaloneShell-QmyYwNAl.js +0 -1
- package/dist/assets/TaskMasterPanel-fMsmvN9L.js +0 -32
- package/dist/assets/abnfDiagram-N423BO3Z-DjPU7HLs.js +0 -1
- package/dist/assets/arc-Pdq6Tvr3.js +0 -1
- package/dist/assets/architectureDiagram-T3A2C74G-D0JnT0Vh.js +0 -36
- package/dist/assets/c4Diagram-5PPSVZJV-MpqlPGFi.js +0 -10
- package/dist/assets/channel-Bm0ZLE4z.js +0 -1
- package/dist/assets/chunk-5RXB4S5H-B4UQ8snD.js +0 -231
- package/dist/assets/chunk-GF5L2VYU-DkEPedJP.js +0 -206
- package/dist/assets/classDiagram-JCYQIIEL-DqEOcNxw.js +0 -1
- package/dist/assets/classDiagram-v2-OCEON4UE-DqEOcNxw.js +0 -1
- package/dist/assets/code-xml-VK1YfShP.js +0 -6
- package/dist/assets/cose-bilkent-JH36ORCC-DrVTo1Nh.js +0 -1
- package/dist/assets/cynefinDiagram-MW4NZA55-CCxBjw9E.js +0 -62
- package/dist/assets/cytoscape.esm-C10L9Icf.js +0 -331
- package/dist/assets/dagre-VZM6K2ZE-C_GvE4lu.js +0 -4
- package/dist/assets/diagram-LBJQPF4R-hfKcrrxe.js +0 -24
- package/dist/assets/diagram-Q27KOJAE-C1semJfK.js +0 -24
- package/dist/assets/diagram-UB23O5K3-57hvXQXO.js +0 -41
- package/dist/assets/ebnfDiagram-BXEA7PRR-9KIAlAVw.js +0 -1
- package/dist/assets/erDiagram-JOGREHBK-B7OzJ767.js +0 -85
- package/dist/assets/ganttDiagram-PKOTCBZU-CbMNWWQu.js +0 -292
- package/dist/assets/gitGraphDiagram-DS77QQ5N-I_vZ5waO.js +0 -106
- package/dist/assets/graph-Cx-EqisW.js +0 -1
- package/dist/assets/index-DFnVoqpx.js +0 -1174
- package/dist/assets/index-DlSeAkw_.js +0 -11
- package/dist/assets/index-ZHwIojzi.js +0 -1
- package/dist/assets/index-t1w8KNxn.css +0 -1
- package/dist/assets/infoDiagram-6WML65LV-Dh20Tsbq.js +0 -2
- package/dist/assets/ishikawaDiagram-WSZJBQD7-DH2Sm3ko.js +0 -70
- package/dist/assets/journeyDiagram-NVQOT4AX-BNFQqlVu.js +0 -139
- package/dist/assets/map-CV9uif0g.js +0 -1
- package/dist/assets/mermaid.core-BYRQSshi.js +0 -312
- package/dist/assets/pegDiagram-VL7TDLO6-CNYpECr8.js +0 -1
- package/dist/assets/quadrantDiagram-CIZ2JOQS-BXVVQsa6.js +0 -7
- package/dist/assets/railroadDiagram-AXF67PYL-JTroIW8F.js +0 -1
- package/dist/assets/requirementDiagram-LRYGKXZP-C1Z_inLz.js +0 -84
- package/dist/assets/sankeyDiagram-W5VNT64P-DCJgKFUk.js +0 -40
- package/dist/assets/sequenceDiagram-SI44F4Z6-D8Wrx5Vc.js +0 -162
- package/dist/assets/sizeCapture-X5ZJPWSS-CXqD68vD.js +0 -1
- package/dist/assets/stateDiagram-OKZ733FA-CF0Ekqjo.js +0 -1
- package/dist/assets/stateDiagram-v2-UEYNNEHI-DARLpEFJ.js +0 -1
- package/dist/assets/swimlanes-SLNWSIFB-DVIax_k4.js +0 -2
- package/dist/assets/swimlanesDiagram-ULZ7WXOC-CrgDgaY8.js +0 -8
- package/dist/assets/timeline-definition-Z64GVDOM-DSqk3ApG.js +0 -120
- package/dist/assets/vendor-react-whEHfigN.js +0 -59
- package/dist/assets/vennDiagram-T6HMQDX7-DNbTqyG5.js +0 -34
- package/dist/assets/xychartDiagram-ELKLHX3M-XsVZphHr.js +0 -7
- package/dist/manifest.json +0 -61
|
@@ -1,766 +1,766 @@
|
|
|
1
|
-
import { BrowserWindow, Menu, Tray, clipboard, nativeImage, nativeTheme, session, webContents as electronWebContents } from 'electron';
|
|
2
|
-
|
|
3
|
-
import { ViewHost } from './viewHost.js';
|
|
4
|
-
|
|
5
|
-
const TITLEBAR_HEIGHT = 44;
|
|
6
|
-
const AUTH_TOKEN_STORAGE_KEY = 'auth-token';
|
|
7
|
-
function isAllowedPermissionOrigin(sourceUrl, controlPlaneUrl) {
|
|
8
|
-
try {
|
|
9
|
-
const source = new URL(sourceUrl);
|
|
10
|
-
if ((source.hostname === '127.0.0.1' || source.hostname === 'localhost') && source.protocol === 'http:') {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
if (source.protocol !== 'https:') {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
const controlPlane = new URL(controlPlaneUrl);
|
|
17
|
-
return source.origin === controlPlane.origin || source.hostname.endsWith('.cloudcli.ai');
|
|
18
|
-
} catch {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function getWebContentsProcessId(contents) {
|
|
24
|
-
return {
|
|
25
|
-
osProcessId: typeof contents.getOSProcessId === 'function' ? contents.getOSProcessId() : null,
|
|
26
|
-
processId: typeof contents.getProcessId === 'function' ? contents.getProcessId() : null,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export class DesktopWindowManager {
|
|
31
|
-
constructor({
|
|
32
|
-
appName,
|
|
33
|
-
getWindowIconPath,
|
|
34
|
-
getLauncherPath,
|
|
35
|
-
getPreloadPath,
|
|
36
|
-
openExternalUrl,
|
|
37
|
-
getDesktopState,
|
|
38
|
-
getDisplayTargetName,
|
|
39
|
-
getRemoteEnvironmentMenuItems,
|
|
40
|
-
getCloudState,
|
|
41
|
-
getLocalState,
|
|
42
|
-
actions,
|
|
43
|
-
tabs,
|
|
44
|
-
}) {
|
|
45
|
-
this.appName = appName;
|
|
46
|
-
this.getWindowIconPath = getWindowIconPath;
|
|
47
|
-
this.getLauncherPath = getLauncherPath;
|
|
48
|
-
this.getPreloadPath = getPreloadPath;
|
|
49
|
-
this.openExternalUrl = openExternalUrl;
|
|
50
|
-
this.getDesktopState = getDesktopState;
|
|
51
|
-
this.getDisplayTargetName = getDisplayTargetName;
|
|
52
|
-
this.getRemoteEnvironmentMenuItems = getRemoteEnvironmentMenuItems;
|
|
53
|
-
this.getCloudState = getCloudState;
|
|
54
|
-
this.getLocalState = getLocalState;
|
|
55
|
-
this.actions = actions;
|
|
56
|
-
this.tabs = tabs;
|
|
57
|
-
|
|
58
|
-
this.mainWindow = null;
|
|
59
|
-
this.settingsWindow = null;
|
|
60
|
-
this.tray = null;
|
|
61
|
-
this.launcherLoaded = false;
|
|
62
|
-
this.viewHost = new ViewHost({
|
|
63
|
-
appName: this.appName,
|
|
64
|
-
getMainWindow: () => this.mainWindow,
|
|
65
|
-
getContentViewBounds: () => this.getContentViewBounds(),
|
|
66
|
-
getPreloadPath: this.getPreloadPath,
|
|
67
|
-
openExternalUrl: this.openExternalUrl,
|
|
68
|
-
showError: this.actions.showError,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
getMainWindow() {
|
|
73
|
-
return this.mainWindow;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
getTrayImage() {
|
|
77
|
-
const image = nativeImage.createFromPath(this.getWindowIconPath());
|
|
78
|
-
return image.resize({ width: 18, height: 18 });
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
getContentViewBounds() {
|
|
82
|
-
if (!this.mainWindow) return { x: 0, y: TITLEBAR_HEIGHT, width: 0, height: 0 };
|
|
83
|
-
const [width, height] = this.mainWindow.getContentSize();
|
|
84
|
-
return {
|
|
85
|
-
x: 0,
|
|
86
|
-
y: TITLEBAR_HEIGHT,
|
|
87
|
-
width,
|
|
88
|
-
height: Math.max(0, height - TITLEBAR_HEIGHT),
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
detachActiveContentView() {
|
|
93
|
-
this.viewHost.detachAll();
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
async showTabPlaceholder(target, message) {
|
|
97
|
-
const tabId = this.tabs.getTabIdForTarget(target);
|
|
98
|
-
await this.viewHost.showTabPlaceholder(tabId, target, message);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
async showLocalStartupTarget(target, logs) {
|
|
102
|
-
const tabId = this.tabs.getTabIdForTarget(target);
|
|
103
|
-
await this.viewHost.showLocalStartupTarget(tabId, target, logs);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
async showContentTarget(target) {
|
|
107
|
-
const tabId = this.tabs.getTabIdForTarget(target);
|
|
108
|
-
await this.viewHost.showContentTarget(tabId, target);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
destroyTabView(tabId) {
|
|
112
|
-
this.viewHost.destroyTabView(tabId);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
emitDesktopState() {
|
|
116
|
-
const state = this.getDesktopState();
|
|
117
|
-
if (this.mainWindow && !this.mainWindow.webContents.isDestroyed()) {
|
|
118
|
-
this.mainWindow.webContents.send('cloudcli-desktop:state-updated', state);
|
|
119
|
-
}
|
|
120
|
-
if (this.settingsWindow && !this.settingsWindow.webContents.isDestroyed()) {
|
|
121
|
-
this.settingsWindow.webContents.send('cloudcli-desktop:state-updated', state);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
emitLauncherCommand(command) {
|
|
126
|
-
if (!this.mainWindow || this.mainWindow.webContents.isDestroyed()) return;
|
|
127
|
-
this.mainWindow.webContents.send('cloudcli-desktop:launcher-command', command);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
emitSettingsCommand(command) {
|
|
131
|
-
if (!this.settingsWindow || this.settingsWindow.webContents.isDestroyed()) return;
|
|
132
|
-
this.settingsWindow.webContents.send('cloudcli-desktop:launcher-command', command);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
syncSettingsWindowBounds() {
|
|
136
|
-
if (!this.mainWindow || !this.settingsWindow || this.settingsWindow.isDestroyed()) return;
|
|
137
|
-
this.settingsWindow.setBounds(this.mainWindow.getBounds());
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
async ensureSettingsWindow(sheet = 'desktop-settings') {
|
|
141
|
-
if (!this.mainWindow) return null;
|
|
142
|
-
|
|
143
|
-
if (this.settingsWindow && !this.settingsWindow.isDestroyed()) {
|
|
144
|
-
this.syncSettingsWindowBounds();
|
|
145
|
-
this.emitSettingsCommand({ type: 'open-sheet', sheet });
|
|
146
|
-
this.settingsWindow.focus();
|
|
147
|
-
return this.settingsWindow;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
this.settingsWindow = new BrowserWindow({
|
|
151
|
-
parent: this.mainWindow,
|
|
152
|
-
show: false,
|
|
153
|
-
frame: false,
|
|
154
|
-
transparent: true,
|
|
155
|
-
hasShadow: false,
|
|
156
|
-
resizable: false,
|
|
157
|
-
minimizable: false,
|
|
158
|
-
maximizable: false,
|
|
159
|
-
fullscreenable: false,
|
|
160
|
-
movable: false,
|
|
161
|
-
skipTaskbar: true,
|
|
162
|
-
backgroundColor: '#00000000',
|
|
163
|
-
webPreferences: {
|
|
164
|
-
contextIsolation: true,
|
|
165
|
-
nodeIntegration: false,
|
|
166
|
-
sandbox: true,
|
|
167
|
-
preload: this.getPreloadPath(),
|
|
168
|
-
},
|
|
169
|
-
});
|
|
170
|
-
this.syncSettingsWindowBounds();
|
|
171
|
-
this.viewHost.configureChildWebContents(this.settingsWindow.webContents);
|
|
172
|
-
this.settingsWindow.once('ready-to-show', () => this.settingsWindow?.show());
|
|
173
|
-
this.settingsWindow.on('closed', () => {
|
|
174
|
-
this.settingsWindow = null;
|
|
175
|
-
});
|
|
176
|
-
await this.settingsWindow.loadFile(this.getLauncherPath(), {
|
|
177
|
-
query: { modal: '1', sheet },
|
|
178
|
-
});
|
|
179
|
-
return this.settingsWindow;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
closeSettingsWindow() {
|
|
183
|
-
if (!this.settingsWindow || this.settingsWindow.isDestroyed()) return;
|
|
184
|
-
this.settingsWindow.close();
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
async showTarget(target, { trackTab = true } = {}) {
|
|
188
|
-
if (!this.mainWindow) return;
|
|
189
|
-
if (trackTab) {
|
|
190
|
-
this.tabs.upsertTarget(target);
|
|
191
|
-
}
|
|
192
|
-
this.actions.setActiveTarget(target);
|
|
193
|
-
this.buildAppMenu();
|
|
194
|
-
this.mainWindow.setTitle(`${this.appName} - ${target.name}`);
|
|
195
|
-
const finalUrl = await this.showContentTarget(target);
|
|
196
|
-
this.emitDesktopState();
|
|
197
|
-
return finalUrl;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
async showLauncher() {
|
|
201
|
-
if (!this.mainWindow) return;
|
|
202
|
-
const target = { kind: 'launcher', name: this.appName, url: null };
|
|
203
|
-
this.tabs.upsertTarget(target);
|
|
204
|
-
this.actions.setActiveTarget(target);
|
|
205
|
-
this.detachActiveContentView();
|
|
206
|
-
this.buildAppMenu();
|
|
207
|
-
this.mainWindow.setTitle(this.appName);
|
|
208
|
-
this.mainWindow.webContents.focus();
|
|
209
|
-
if (!this.launcherLoaded) {
|
|
210
|
-
await this.mainWindow.loadFile(this.getLauncherPath());
|
|
211
|
-
this.launcherLoaded = true;
|
|
212
|
-
} else {
|
|
213
|
-
this.emitDesktopState();
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
async switchDesktopTab(tabId) {
|
|
218
|
-
const tab = this.tabs.activate(tabId);
|
|
219
|
-
if (!tab || !this.mainWindow) return this.getDesktopState();
|
|
220
|
-
|
|
221
|
-
if (tab.id === 'home' || tab.kind === 'launcher') {
|
|
222
|
-
await this.showLauncher();
|
|
223
|
-
return this.getDesktopState();
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
if (!tab.target?.url) {
|
|
227
|
-
throw new Error('This tab does not have a target URL.');
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
await this.showTarget(tab.target, { trackTab: false });
|
|
231
|
-
return this.getDesktopState();
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
async reloadActiveTab() {
|
|
235
|
-
const activeTab = this.tabs.getActiveTab();
|
|
236
|
-
if (!activeTab || activeTab.id === 'home' || activeTab.kind === 'launcher') {
|
|
237
|
-
this.emitDesktopState();
|
|
238
|
-
return this.getDesktopState();
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
const reloaded = this.viewHost.reloadTab(activeTab.id);
|
|
242
|
-
if (!reloaded && activeTab.target?.url) {
|
|
243
|
-
await this.showTarget(activeTab.target, { trackTab: false });
|
|
244
|
-
}
|
|
245
|
-
this.emitDesktopState();
|
|
246
|
-
return this.getDesktopState();
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
async navigateActiveView(url) {
|
|
250
|
-
const navigated = await this.viewHost.navigateActiveView(url);
|
|
251
|
-
this.emitDesktopState();
|
|
252
|
-
return navigated;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
async readAuthTokenForTarget(url) {
|
|
256
|
-
return this.viewHost.readLocalStorageValueForOrigin(url, AUTH_TOKEN_STORAGE_KEY);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
openActiveTabDevTools() {
|
|
260
|
-
if (this.viewHost.openActiveViewDevTools()) return;
|
|
261
|
-
void this.actions.showError('No active BrowserView', new Error('Switch to a non-launcher tab before opening active tab DevTools.'));
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
reloadActiveBrowserViewForDiagnostics() {
|
|
265
|
-
if (this.viewHost.reloadActiveView()) return;
|
|
266
|
-
void this.actions.showError('No active BrowserView', new Error('Switch to a non-launcher tab before reloading the active BrowserView.'));
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
detachActiveBrowserViewForDiagnostics() {
|
|
270
|
-
if (this.viewHost.detachActiveView()) return;
|
|
271
|
-
void this.actions.showError('No active BrowserView', new Error('Switch to a non-launcher tab before detaching the active BrowserView.'));
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
copyWebContentsDiagnostics() {
|
|
275
|
-
const tabViewDiagnostics = this.viewHost.getTabViewDiagnostics();
|
|
276
|
-
const tabViewByContentsId = new Map(
|
|
277
|
-
tabViewDiagnostics
|
|
278
|
-
.filter((item) => item.webContentsId != null)
|
|
279
|
-
.map((item) => [item.webContentsId, item])
|
|
280
|
-
);
|
|
281
|
-
|
|
282
|
-
const rows = electronWebContents.getAllWebContents().map((contents) => {
|
|
283
|
-
const destroyed = contents.isDestroyed();
|
|
284
|
-
const processIds = destroyed ? { osProcessId: null, processId: null } : getWebContentsProcessId(contents);
|
|
285
|
-
const tabView = tabViewByContentsId.get(contents.id);
|
|
286
|
-
let owner = 'unknown';
|
|
287
|
-
if (this.mainWindow?.webContents?.id === contents.id) {
|
|
288
|
-
owner = 'main-window';
|
|
289
|
-
} else if (this.settingsWindow?.webContents?.id === contents.id) {
|
|
290
|
-
owner = 'settings-window';
|
|
291
|
-
} else if (tabView) {
|
|
292
|
-
owner = `browser-view:${tabView.tabId}`;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
return {
|
|
296
|
-
id: contents.id,
|
|
297
|
-
owner,
|
|
298
|
-
osProcessId: processIds.osProcessId,
|
|
299
|
-
processId: processIds.processId,
|
|
300
|
-
url: destroyed ? null : contents.getURL(),
|
|
301
|
-
title: destroyed ? null : contents.getTitle(),
|
|
302
|
-
destroyed,
|
|
303
|
-
focused: destroyed || typeof contents.isFocused !== 'function' ? false : contents.isFocused(),
|
|
304
|
-
attached: tabView ? tabView.attached : null,
|
|
305
|
-
active: tabView ? tabView.active : null,
|
|
306
|
-
};
|
|
307
|
-
});
|
|
308
|
-
|
|
309
|
-
const activeTab = this.tabs.getActiveTab();
|
|
310
|
-
const diagnostics = {
|
|
311
|
-
generatedAt: new Date().toISOString(),
|
|
312
|
-
activeTabId: this.tabs.activeTabId,
|
|
313
|
-
activeTab: activeTab
|
|
314
|
-
? {
|
|
315
|
-
id: activeTab.id,
|
|
316
|
-
title: activeTab.title,
|
|
317
|
-
kind: activeTab.kind,
|
|
318
|
-
targetUrl: activeTab.target?.url || null,
|
|
319
|
-
}
|
|
320
|
-
: null,
|
|
321
|
-
tabViews: tabViewDiagnostics,
|
|
322
|
-
webContents: rows,
|
|
323
|
-
};
|
|
324
|
-
|
|
325
|
-
clipboard.writeText(JSON.stringify(diagnostics, null, 2));
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
async closeDesktopTab(tabId) {
|
|
329
|
-
const tab = this.tabs.remove(tabId);
|
|
330
|
-
if (!tab) return this.getDesktopState();
|
|
331
|
-
this.destroyTabView(tabId);
|
|
332
|
-
if (this.tabs.activeTabId === 'home') {
|
|
333
|
-
await this.showLauncher();
|
|
334
|
-
} else {
|
|
335
|
-
this.emitDesktopState();
|
|
336
|
-
}
|
|
337
|
-
return this.getDesktopState();
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
buildEnvironmentActionsSubmenu(environment) {
|
|
341
|
-
const items = [];
|
|
342
|
-
const statusSuffix = environment.status === 'running' ? '' : ` (${environment.status})`;
|
|
343
|
-
items.push({
|
|
344
|
-
label: 'Open Environment',
|
|
345
|
-
click: () => void this.actions.openEnvironmentInDesktop(environment)
|
|
346
|
-
.catch((error) => this.actions.showError(`Could not open ${environment.name || environment.subdomain}${statusSuffix}`, error)),
|
|
347
|
-
});
|
|
348
|
-
items.push({
|
|
349
|
-
label: 'Open in Browser',
|
|
350
|
-
click: () => void this.actions.openEnvironmentInBrowser(environment)
|
|
351
|
-
.catch((error) => this.actions.showError('Could not open environment in browser', error)),
|
|
352
|
-
});
|
|
353
|
-
items.push({
|
|
354
|
-
label: 'Open in VS Code',
|
|
355
|
-
click: () => void this.actions.openEnvironmentInIde(environment, 'vscode')
|
|
356
|
-
.catch((error) => this.actions.showError('Could not open environment in VS Code', error)),
|
|
357
|
-
});
|
|
358
|
-
items.push({
|
|
359
|
-
label: 'Open in Cursor',
|
|
360
|
-
click: () => void this.actions.openEnvironmentInIde(environment, 'cursor')
|
|
361
|
-
.catch((error) => this.actions.showError('Could not open environment in Cursor', error)),
|
|
362
|
-
});
|
|
363
|
-
items.push({
|
|
364
|
-
label: 'Open SSH Terminal',
|
|
365
|
-
click: () => void this.actions.openEnvironmentInSsh(environment)
|
|
366
|
-
.catch((error) => this.actions.showError('Could not open SSH terminal', error)),
|
|
367
|
-
});
|
|
368
|
-
items.push({
|
|
369
|
-
label: 'Copy Mobile/Web URL',
|
|
370
|
-
click: () => this.actions.copyText(this.actions.getEnvironmentUrl(environment)),
|
|
371
|
-
});
|
|
372
|
-
if (environment.status !== 'running') {
|
|
373
|
-
items.unshift({
|
|
374
|
-
label: environment.status === 'paused' ? 'Resume' : 'Start',
|
|
375
|
-
click: () => void this.actions.startEnvironment(environment)
|
|
376
|
-
.catch((error) => this.actions.showError('Could not start environment', error)),
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
if (environment.status === 'running') {
|
|
380
|
-
items.push({
|
|
381
|
-
label: 'Stop',
|
|
382
|
-
click: () => void this.actions.stopEnvironment(environment)
|
|
383
|
-
.catch((error) => this.actions.showError('Could not stop environment', error)),
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
return items;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
buildTrayEnvironmentSection() {
|
|
390
|
-
const cloudState = this.getCloudState();
|
|
391
|
-
if (!cloudState.account?.apiKey) {
|
|
392
|
-
return [
|
|
393
|
-
{
|
|
394
|
-
label: cloudState.account?.email ? `Reconnect ${cloudState.account.email}` : 'Login',
|
|
395
|
-
click: () => void this.actions.connectCloudAccount()
|
|
396
|
-
.catch((error) => this.actions.showError('Could not connect CloudCLI account', error)),
|
|
397
|
-
},
|
|
398
|
-
];
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
if (!cloudState.environments.length) {
|
|
402
|
-
return [{ label: 'No environments found', enabled: false }];
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
return cloudState.environments.map((environment) => ({
|
|
406
|
-
label: `${environment.name || environment.subdomain} - ${environment.status}`,
|
|
407
|
-
submenu: this.buildEnvironmentActionsSubmenu(environment),
|
|
408
|
-
}));
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
buildAppMenu() {
|
|
412
|
-
if (!this.mainWindow) return;
|
|
413
|
-
const cloudState = this.getCloudState();
|
|
414
|
-
const localState = this.getLocalState();
|
|
415
|
-
const remoteItems = this.getRemoteEnvironmentMenuItems();
|
|
416
|
-
const cloudAccountLabel = cloudState.account?.apiKey
|
|
417
|
-
? (cloudState.account?.email ? `Connected: ${cloudState.account.email}` : 'CloudCLI Connected')
|
|
418
|
-
: (cloudState.account?.email ? `Reconnect: ${cloudState.account.email}` : 'Connect CloudCLI Account...');
|
|
419
|
-
|
|
420
|
-
const template = [
|
|
421
|
-
{
|
|
422
|
-
label: this.appName,
|
|
423
|
-
submenu: [
|
|
424
|
-
{ label: `About ${this.appName}`, role: 'about' },
|
|
425
|
-
{ type: 'separator' },
|
|
426
|
-
{
|
|
427
|
-
label: 'Show Launcher',
|
|
428
|
-
accelerator: 'CmdOrCtrl+Shift+L',
|
|
429
|
-
click: () => void this.showLauncher().catch((error) => this.actions.showError('Could not show launcher', error)),
|
|
430
|
-
},
|
|
431
|
-
{
|
|
432
|
-
label: 'Switch Environment',
|
|
433
|
-
accelerator: 'CmdOrCtrl+Shift+E',
|
|
434
|
-
click: () => void this.actions.showEnvironmentPicker().catch((error) => this.actions.showError('Could not switch environment', error)),
|
|
435
|
-
},
|
|
436
|
-
{
|
|
437
|
-
label: 'Diagnostics',
|
|
438
|
-
submenu: [
|
|
439
|
-
{
|
|
440
|
-
label: 'Copy Diagnostics',
|
|
441
|
-
click: () => void this.actions.copyDiagnostics(),
|
|
442
|
-
},
|
|
443
|
-
],
|
|
444
|
-
},
|
|
445
|
-
{ type: 'separator' },
|
|
446
|
-
{
|
|
447
|
-
label: process.platform === 'darwin' ? `Hide ${this.appName}` : 'Hide',
|
|
448
|
-
role: 'hide',
|
|
449
|
-
visible: process.platform === 'darwin',
|
|
450
|
-
},
|
|
451
|
-
{ label: 'Hide Others', role: 'hideOthers', visible: process.platform === 'darwin' },
|
|
452
|
-
{ label: 'Show All', role: 'unhide', visible: process.platform === 'darwin' },
|
|
453
|
-
{ type: 'separator', visible: process.platform === 'darwin' },
|
|
454
|
-
{ label: `Quit ${this.appName}`, accelerator: 'CmdOrCtrl+Q', role: 'quit' },
|
|
455
|
-
],
|
|
456
|
-
},
|
|
457
|
-
{
|
|
458
|
-
label: 'Environment',
|
|
459
|
-
submenu: [
|
|
460
|
-
{
|
|
461
|
-
label: 'Show Launcher',
|
|
462
|
-
accelerator: 'CmdOrCtrl+Shift+L',
|
|
463
|
-
click: () => void this.showLauncher().catch((error) => this.actions.showError('Could not show launcher', error)),
|
|
464
|
-
},
|
|
465
|
-
{
|
|
466
|
-
label: 'Switch Environment',
|
|
467
|
-
accelerator: 'CmdOrCtrl+Shift+E',
|
|
468
|
-
click: () => void this.actions.showEnvironmentPicker().catch((error) => this.actions.showError('Could not switch environment', error)),
|
|
469
|
-
},
|
|
470
|
-
{ type: 'separator' },
|
|
471
|
-
{
|
|
472
|
-
label: 'Open Local
|
|
473
|
-
accelerator: 'CmdOrCtrl+L',
|
|
474
|
-
click: () => void this.actions.openLocalInDesktop().catch((error) => this.actions.showError('Could not open local
|
|
475
|
-
},
|
|
476
|
-
{
|
|
477
|
-
label: 'Open Local Web UI in Browser',
|
|
478
|
-
accelerator: 'CmdOrCtrl+Shift+W',
|
|
479
|
-
click: () => void this.actions.openLocalWebUi().catch((error) => this.actions.showError('Could not open local web UI', error)),
|
|
480
|
-
},
|
|
481
|
-
{
|
|
482
|
-
label: 'Copy Local Web URL',
|
|
483
|
-
accelerator: 'CmdOrCtrl+Shift+U',
|
|
484
|
-
click: () => void this.actions.copyLocalWebUrl().catch((error) => this.actions.showError('Could not copy local web URL', error)),
|
|
485
|
-
},
|
|
486
|
-
{ type: 'separator' },
|
|
487
|
-
{
|
|
488
|
-
label: 'Keep Local Server Running After Quit',
|
|
489
|
-
type: 'checkbox',
|
|
490
|
-
checked: localState.desktopSettings.keepLocalServerRunning,
|
|
491
|
-
click: (menuItem) => void this.actions.updateDesktopSetting('keepLocalServerRunning', menuItem.checked)
|
|
492
|
-
.catch((error) => this.actions.showError('Could not update desktop setting', error)),
|
|
493
|
-
},
|
|
494
|
-
{
|
|
495
|
-
label: 'Allow LAN Access to Local Server',
|
|
496
|
-
type: 'checkbox',
|
|
497
|
-
checked: localState.desktopSettings.exposeLocalServerOnNetwork,
|
|
498
|
-
click: (menuItem) => void this.actions.updateDesktopSetting('exposeLocalServerOnNetwork', menuItem.checked)
|
|
499
|
-
.catch((error) => this.actions.showError('Could not update desktop setting', error)),
|
|
500
|
-
},
|
|
501
|
-
],
|
|
502
|
-
},
|
|
503
|
-
{
|
|
504
|
-
label: 'Cloud',
|
|
505
|
-
submenu: [
|
|
506
|
-
{
|
|
507
|
-
label: cloudAccountLabel,
|
|
508
|
-
accelerator: 'CmdOrCtrl+Shift+C',
|
|
509
|
-
click: () => void this.actions.connectCloudAccount().catch((error) => this.actions.showError('Could not connect CloudCLI account', error)),
|
|
510
|
-
},
|
|
511
|
-
{
|
|
512
|
-
label: 'Refresh Cloud Environments',
|
|
513
|
-
click: () => void this.actions.refreshCloudEnvironments().catch((error) => this.actions.showError('Could not load CloudCLI environments', error)),
|
|
514
|
-
enabled: Boolean(cloudState.account?.apiKey),
|
|
515
|
-
},
|
|
516
|
-
{
|
|
517
|
-
label: 'Logout
|
|
518
|
-
click: () => void this.actions.clearCloudAccount().catch((error) => this.actions.showError('Could not logout', error)),
|
|
519
|
-
enabled: Boolean(cloudState.account?.apiKey),
|
|
520
|
-
},
|
|
521
|
-
{ type: 'separator' },
|
|
522
|
-
{
|
|
523
|
-
label: 'Remote Environments',
|
|
524
|
-
submenu: remoteItems,
|
|
525
|
-
},
|
|
526
|
-
],
|
|
527
|
-
},
|
|
528
|
-
{
|
|
529
|
-
label: 'Edit',
|
|
530
|
-
submenu: [
|
|
531
|
-
{ role: 'undo' },
|
|
532
|
-
{ role: 'redo' },
|
|
533
|
-
{ type: 'separator' },
|
|
534
|
-
{ role: 'cut' },
|
|
535
|
-
{ role: 'copy' },
|
|
536
|
-
{ role: 'paste' },
|
|
537
|
-
{ role: 'selectAll' },
|
|
538
|
-
],
|
|
539
|
-
},
|
|
540
|
-
{
|
|
541
|
-
label: 'View',
|
|
542
|
-
submenu: [
|
|
543
|
-
{ role: 'reload' },
|
|
544
|
-
{ role: 'forceReload' },
|
|
545
|
-
{ role: 'toggleDevTools' },
|
|
546
|
-
{
|
|
547
|
-
label: 'Open Active Tab DevTools',
|
|
548
|
-
click: () => this.openActiveTabDevTools(),
|
|
549
|
-
},
|
|
550
|
-
{
|
|
551
|
-
label: 'Copy WebContents Diagnostics',
|
|
552
|
-
click: () => this.copyWebContentsDiagnostics(),
|
|
553
|
-
},
|
|
554
|
-
{
|
|
555
|
-
label: 'Reload Active BrowserView',
|
|
556
|
-
click: () => this.reloadActiveBrowserViewForDiagnostics(),
|
|
557
|
-
},
|
|
558
|
-
{
|
|
559
|
-
label: 'Detach Active BrowserView',
|
|
560
|
-
click: () => this.detachActiveBrowserViewForDiagnostics(),
|
|
561
|
-
},
|
|
562
|
-
{ type: 'separator' },
|
|
563
|
-
{ role: 'resetZoom' },
|
|
564
|
-
{ role: 'zoomIn' },
|
|
565
|
-
{ role: 'zoomOut' },
|
|
566
|
-
{ type: 'separator' },
|
|
567
|
-
{ role: 'togglefullscreen' },
|
|
568
|
-
],
|
|
569
|
-
},
|
|
570
|
-
{
|
|
571
|
-
label: 'Window',
|
|
572
|
-
submenu: [
|
|
573
|
-
{ role: 'minimize' },
|
|
574
|
-
{ role: 'zoom' },
|
|
575
|
-
...(process.platform === 'darwin' ? [{ type: 'separator' }, { role: 'front' }] : []),
|
|
576
|
-
],
|
|
577
|
-
},
|
|
578
|
-
{
|
|
579
|
-
label: 'Help',
|
|
580
|
-
submenu: [
|
|
581
|
-
{
|
|
582
|
-
label: 'Open cloudcli.ai',
|
|
583
|
-
click: () => void this.actions.openCloudDashboard(),
|
|
584
|
-
},
|
|
585
|
-
{
|
|
586
|
-
label: 'Copy Diagnostics',
|
|
587
|
-
click: () => void this.actions.copyDiagnostics(),
|
|
588
|
-
},
|
|
589
|
-
],
|
|
590
|
-
},
|
|
591
|
-
];
|
|
592
|
-
|
|
593
|
-
Menu.setApplicationMenu(Menu.buildFromTemplate(template));
|
|
594
|
-
this.buildTrayMenu();
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
buildTrayMenu() {
|
|
598
|
-
if (!this.tray) return;
|
|
599
|
-
const cloudState = this.getCloudState();
|
|
600
|
-
const localState = this.getLocalState();
|
|
601
|
-
|
|
602
|
-
const template = [
|
|
603
|
-
{
|
|
604
|
-
label: 'Local',
|
|
605
|
-
submenu: [
|
|
606
|
-
{
|
|
607
|
-
label: localState.localServerRunning ? 'Open Local in
|
|
608
|
-
click: () => void this.actions.openLocalInDesktop().catch((error) => this.actions.showError('Could not open local
|
|
609
|
-
},
|
|
610
|
-
{
|
|
611
|
-
label: 'Open Local in Browser',
|
|
612
|
-
click: () => void this.actions.openLocalWebUi().catch((error) => this.actions.showError('Could not open local web UI', error)),
|
|
613
|
-
},
|
|
614
|
-
{
|
|
615
|
-
label: 'Copy Local URL',
|
|
616
|
-
click: () => void this.actions.copyLocalWebUrl().catch((error) => this.actions.showError('Could not copy local web URL', error)),
|
|
617
|
-
},
|
|
618
|
-
],
|
|
619
|
-
},
|
|
620
|
-
{
|
|
621
|
-
label: 'Cloud Environments',
|
|
622
|
-
submenu: this.buildTrayEnvironmentSection(),
|
|
623
|
-
},
|
|
624
|
-
{ type: 'separator' },
|
|
625
|
-
{
|
|
626
|
-
label: cloudState.account?.email ? `Connected: ${cloudState.account.email}` : 'Login',
|
|
627
|
-
click: () => void this.actions.connectCloudAccount().catch((error) => this.actions.showError('Could not connect CloudCLI account', error)),
|
|
628
|
-
},
|
|
629
|
-
{
|
|
630
|
-
label: 'Logout
|
|
631
|
-
click: () => void this.actions.clearCloudAccount().catch((error) => this.actions.showError('Could not logout', error)),
|
|
632
|
-
enabled: Boolean(cloudState.account?.apiKey),
|
|
633
|
-
},
|
|
634
|
-
{ type: 'separator' },
|
|
635
|
-
{
|
|
636
|
-
label: `Quit ${this.appName}`,
|
|
637
|
-
role: 'quit',
|
|
638
|
-
},
|
|
639
|
-
];
|
|
640
|
-
|
|
641
|
-
this.tray.setToolTip(`${this.appName}${this.actions.getActiveTarget()?.name ? ` - ${this.actions.getActiveTarget().name}` : ''}`);
|
|
642
|
-
this.tray.setContextMenu(Menu.buildFromTemplate(template));
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
async showDesktopSettings() {
|
|
646
|
-
if (!this.mainWindow) return this.getDesktopState();
|
|
647
|
-
await this.ensureSettingsWindow('desktop-settings');
|
|
648
|
-
return this.getDesktopState();
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
async showLocalSettings() {
|
|
652
|
-
if (!this.mainWindow) return this.getDesktopState();
|
|
653
|
-
await this.ensureSettingsWindow('local-settings');
|
|
654
|
-
return this.getDesktopState();
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
async showActiveEnvironmentActionsMenu() {
|
|
658
|
-
if (!this.mainWindow) return this.getDesktopState();
|
|
659
|
-
const activeTarget = this.actions.getActiveTarget();
|
|
660
|
-
if (activeTarget?.kind !== 'remote') return this.getDesktopState();
|
|
661
|
-
|
|
662
|
-
const environment = this.getCloudState().environments.find((item) => item.id === activeTarget.id);
|
|
663
|
-
if (!environment) return this.getDesktopState();
|
|
664
|
-
|
|
665
|
-
const menu = Menu.buildFromTemplate(this.buildEnvironmentActionsSubmenu(environment));
|
|
666
|
-
menu.popup({ window: this.mainWindow });
|
|
667
|
-
return this.getDesktopState();
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
async showEnvironmentActionsMenu(environmentId) {
|
|
671
|
-
if (!this.mainWindow) return this.getDesktopState();
|
|
672
|
-
const environment = this.getCloudState().environments.find((item) => item.id === environmentId);
|
|
673
|
-
if (!environment) return this.getDesktopState();
|
|
674
|
-
|
|
675
|
-
const menu = Menu.buildFromTemplate(this.buildEnvironmentActionsSubmenu(environment));
|
|
676
|
-
menu.popup({ window: this.mainWindow });
|
|
677
|
-
return this.getDesktopState();
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
configurePermissions() {
|
|
681
|
-
const isAllowedPermission = (webContents, permission) => {
|
|
682
|
-
const sourceUrl = webContents.getURL();
|
|
683
|
-
const allowedPermissions = new Set(['clipboard-read', 'media', 'notifications']);
|
|
684
|
-
return isAllowedPermissionOrigin(sourceUrl, this.getCloudState().controlPlaneUrl) && allowedPermissions.has(permission);
|
|
685
|
-
};
|
|
686
|
-
|
|
687
|
-
session.defaultSession.setPermissionRequestHandler((webContents, permission, callback) => {
|
|
688
|
-
callback(isAllowedPermission(webContents, permission));
|
|
689
|
-
});
|
|
690
|
-
session.defaultSession.setPermissionCheckHandler((webContents, permission) => {
|
|
691
|
-
if (!webContents) return false;
|
|
692
|
-
return isAllowedPermission(webContents, permission);
|
|
693
|
-
});
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
createTray() {
|
|
697
|
-
if (this.tray) return;
|
|
698
|
-
this.tray = new Tray(this.getTrayImage());
|
|
699
|
-
this.tray.on('click', () => {
|
|
700
|
-
if (!this.mainWindow) return;
|
|
701
|
-
if (this.mainWindow.isVisible()) {
|
|
702
|
-
this.mainWindow.focus();
|
|
703
|
-
} else {
|
|
704
|
-
this.mainWindow.show();
|
|
705
|
-
}
|
|
706
|
-
});
|
|
707
|
-
this.buildTrayMenu();
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
async createWindow() {
|
|
711
|
-
this.mainWindow = new BrowserWindow({
|
|
712
|
-
width: 1440,
|
|
713
|
-
height: 960,
|
|
714
|
-
minWidth: 1024,
|
|
715
|
-
minHeight: 720,
|
|
716
|
-
show: false,
|
|
717
|
-
backgroundColor: '#0f172a',
|
|
718
|
-
title: this.appName,
|
|
719
|
-
icon: this.getWindowIconPath(),
|
|
720
|
-
titleBarStyle: 'hidden',
|
|
721
|
-
...(process.platform === 'darwin'
|
|
722
|
-
? { trafficLightPosition: { x: 18, y: 14 } }
|
|
723
|
-
: {
|
|
724
|
-
titleBarOverlay: {
|
|
725
|
-
color: nativeTheme.shouldUseDarkColors ? '#111111' : '#f7f8fa',
|
|
726
|
-
symbolColor: nativeTheme.shouldUseDarkColors ? '#a1a1a1' : '#5b6470',
|
|
727
|
-
height: 44,
|
|
728
|
-
},
|
|
729
|
-
}),
|
|
730
|
-
webPreferences: {
|
|
731
|
-
contextIsolation: true,
|
|
732
|
-
nodeIntegration: false,
|
|
733
|
-
sandbox: true,
|
|
734
|
-
preload: this.getPreloadPath(),
|
|
735
|
-
},
|
|
736
|
-
});
|
|
737
|
-
|
|
738
|
-
this.mainWindow.once('ready-to-show', () => {
|
|
739
|
-
this.mainWindow?.show();
|
|
740
|
-
});
|
|
741
|
-
|
|
742
|
-
this.mainWindow.webContents.setWindowOpenHandler(({ url }) => {
|
|
743
|
-
void this.openExternalUrl(url).catch((error) => this.actions.showError('Could not open external link', error));
|
|
744
|
-
return { action: 'deny' };
|
|
745
|
-
});
|
|
746
|
-
|
|
747
|
-
this.mainWindow.on('resize', () => {
|
|
748
|
-
this.viewHost.resizeActiveView();
|
|
749
|
-
this.syncSettingsWindowBounds();
|
|
750
|
-
});
|
|
751
|
-
|
|
752
|
-
this.mainWindow.on('move', () => {
|
|
753
|
-
this.syncSettingsWindowBounds();
|
|
754
|
-
});
|
|
755
|
-
|
|
756
|
-
this.mainWindow.on('closed', () => {
|
|
757
|
-
this.viewHost.clear();
|
|
758
|
-
this.settingsWindow = null;
|
|
759
|
-
this.mainWindow = null;
|
|
760
|
-
this.launcherLoaded = false;
|
|
761
|
-
});
|
|
762
|
-
|
|
763
|
-
this.buildAppMenu();
|
|
764
|
-
await this.showLauncher();
|
|
765
|
-
}
|
|
766
|
-
}
|
|
1
|
+
import { BrowserWindow, Menu, Tray, clipboard, nativeImage, nativeTheme, session, webContents as electronWebContents } from 'electron';
|
|
2
|
+
|
|
3
|
+
import { ViewHost } from './viewHost.js';
|
|
4
|
+
|
|
5
|
+
const TITLEBAR_HEIGHT = 44;
|
|
6
|
+
const AUTH_TOKEN_STORAGE_KEY = 'auth-token';
|
|
7
|
+
function isAllowedPermissionOrigin(sourceUrl, controlPlaneUrl) {
|
|
8
|
+
try {
|
|
9
|
+
const source = new URL(sourceUrl);
|
|
10
|
+
if ((source.hostname === '127.0.0.1' || source.hostname === 'localhost') && source.protocol === 'http:') {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
if (source.protocol !== 'https:') {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
const controlPlane = new URL(controlPlaneUrl);
|
|
17
|
+
return source.origin === controlPlane.origin || source.hostname.endsWith('.cloudcli.ai');
|
|
18
|
+
} catch {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function getWebContentsProcessId(contents) {
|
|
24
|
+
return {
|
|
25
|
+
osProcessId: typeof contents.getOSProcessId === 'function' ? contents.getOSProcessId() : null,
|
|
26
|
+
processId: typeof contents.getProcessId === 'function' ? contents.getProcessId() : null,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export class DesktopWindowManager {
|
|
31
|
+
constructor({
|
|
32
|
+
appName,
|
|
33
|
+
getWindowIconPath,
|
|
34
|
+
getLauncherPath,
|
|
35
|
+
getPreloadPath,
|
|
36
|
+
openExternalUrl,
|
|
37
|
+
getDesktopState,
|
|
38
|
+
getDisplayTargetName,
|
|
39
|
+
getRemoteEnvironmentMenuItems,
|
|
40
|
+
getCloudState,
|
|
41
|
+
getLocalState,
|
|
42
|
+
actions,
|
|
43
|
+
tabs,
|
|
44
|
+
}) {
|
|
45
|
+
this.appName = appName;
|
|
46
|
+
this.getWindowIconPath = getWindowIconPath;
|
|
47
|
+
this.getLauncherPath = getLauncherPath;
|
|
48
|
+
this.getPreloadPath = getPreloadPath;
|
|
49
|
+
this.openExternalUrl = openExternalUrl;
|
|
50
|
+
this.getDesktopState = getDesktopState;
|
|
51
|
+
this.getDisplayTargetName = getDisplayTargetName;
|
|
52
|
+
this.getRemoteEnvironmentMenuItems = getRemoteEnvironmentMenuItems;
|
|
53
|
+
this.getCloudState = getCloudState;
|
|
54
|
+
this.getLocalState = getLocalState;
|
|
55
|
+
this.actions = actions;
|
|
56
|
+
this.tabs = tabs;
|
|
57
|
+
|
|
58
|
+
this.mainWindow = null;
|
|
59
|
+
this.settingsWindow = null;
|
|
60
|
+
this.tray = null;
|
|
61
|
+
this.launcherLoaded = false;
|
|
62
|
+
this.viewHost = new ViewHost({
|
|
63
|
+
appName: this.appName,
|
|
64
|
+
getMainWindow: () => this.mainWindow,
|
|
65
|
+
getContentViewBounds: () => this.getContentViewBounds(),
|
|
66
|
+
getPreloadPath: this.getPreloadPath,
|
|
67
|
+
openExternalUrl: this.openExternalUrl,
|
|
68
|
+
showError: this.actions.showError,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
getMainWindow() {
|
|
73
|
+
return this.mainWindow;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
getTrayImage() {
|
|
77
|
+
const image = nativeImage.createFromPath(this.getWindowIconPath());
|
|
78
|
+
return image.resize({ width: 18, height: 18 });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
getContentViewBounds() {
|
|
82
|
+
if (!this.mainWindow) return { x: 0, y: TITLEBAR_HEIGHT, width: 0, height: 0 };
|
|
83
|
+
const [width, height] = this.mainWindow.getContentSize();
|
|
84
|
+
return {
|
|
85
|
+
x: 0,
|
|
86
|
+
y: TITLEBAR_HEIGHT,
|
|
87
|
+
width,
|
|
88
|
+
height: Math.max(0, height - TITLEBAR_HEIGHT),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
detachActiveContentView() {
|
|
93
|
+
this.viewHost.detachAll();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async showTabPlaceholder(target, message) {
|
|
97
|
+
const tabId = this.tabs.getTabIdForTarget(target);
|
|
98
|
+
await this.viewHost.showTabPlaceholder(tabId, target, message);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
async showLocalStartupTarget(target, logs) {
|
|
102
|
+
const tabId = this.tabs.getTabIdForTarget(target);
|
|
103
|
+
await this.viewHost.showLocalStartupTarget(tabId, target, logs);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
async showContentTarget(target) {
|
|
107
|
+
const tabId = this.tabs.getTabIdForTarget(target);
|
|
108
|
+
await this.viewHost.showContentTarget(tabId, target);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
destroyTabView(tabId) {
|
|
112
|
+
this.viewHost.destroyTabView(tabId);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
emitDesktopState() {
|
|
116
|
+
const state = this.getDesktopState();
|
|
117
|
+
if (this.mainWindow && !this.mainWindow.webContents.isDestroyed()) {
|
|
118
|
+
this.mainWindow.webContents.send('cloudcli-desktop:state-updated', state);
|
|
119
|
+
}
|
|
120
|
+
if (this.settingsWindow && !this.settingsWindow.webContents.isDestroyed()) {
|
|
121
|
+
this.settingsWindow.webContents.send('cloudcli-desktop:state-updated', state);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
emitLauncherCommand(command) {
|
|
126
|
+
if (!this.mainWindow || this.mainWindow.webContents.isDestroyed()) return;
|
|
127
|
+
this.mainWindow.webContents.send('cloudcli-desktop:launcher-command', command);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
emitSettingsCommand(command) {
|
|
131
|
+
if (!this.settingsWindow || this.settingsWindow.webContents.isDestroyed()) return;
|
|
132
|
+
this.settingsWindow.webContents.send('cloudcli-desktop:launcher-command', command);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
syncSettingsWindowBounds() {
|
|
136
|
+
if (!this.mainWindow || !this.settingsWindow || this.settingsWindow.isDestroyed()) return;
|
|
137
|
+
this.settingsWindow.setBounds(this.mainWindow.getBounds());
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
async ensureSettingsWindow(sheet = 'desktop-settings') {
|
|
141
|
+
if (!this.mainWindow) return null;
|
|
142
|
+
|
|
143
|
+
if (this.settingsWindow && !this.settingsWindow.isDestroyed()) {
|
|
144
|
+
this.syncSettingsWindowBounds();
|
|
145
|
+
this.emitSettingsCommand({ type: 'open-sheet', sheet });
|
|
146
|
+
this.settingsWindow.focus();
|
|
147
|
+
return this.settingsWindow;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
this.settingsWindow = new BrowserWindow({
|
|
151
|
+
parent: this.mainWindow,
|
|
152
|
+
show: false,
|
|
153
|
+
frame: false,
|
|
154
|
+
transparent: true,
|
|
155
|
+
hasShadow: false,
|
|
156
|
+
resizable: false,
|
|
157
|
+
minimizable: false,
|
|
158
|
+
maximizable: false,
|
|
159
|
+
fullscreenable: false,
|
|
160
|
+
movable: false,
|
|
161
|
+
skipTaskbar: true,
|
|
162
|
+
backgroundColor: '#00000000',
|
|
163
|
+
webPreferences: {
|
|
164
|
+
contextIsolation: true,
|
|
165
|
+
nodeIntegration: false,
|
|
166
|
+
sandbox: true,
|
|
167
|
+
preload: this.getPreloadPath(),
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
this.syncSettingsWindowBounds();
|
|
171
|
+
this.viewHost.configureChildWebContents(this.settingsWindow.webContents);
|
|
172
|
+
this.settingsWindow.once('ready-to-show', () => this.settingsWindow?.show());
|
|
173
|
+
this.settingsWindow.on('closed', () => {
|
|
174
|
+
this.settingsWindow = null;
|
|
175
|
+
});
|
|
176
|
+
await this.settingsWindow.loadFile(this.getLauncherPath(), {
|
|
177
|
+
query: { modal: '1', sheet },
|
|
178
|
+
});
|
|
179
|
+
return this.settingsWindow;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
closeSettingsWindow() {
|
|
183
|
+
if (!this.settingsWindow || this.settingsWindow.isDestroyed()) return;
|
|
184
|
+
this.settingsWindow.close();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
async showTarget(target, { trackTab = true } = {}) {
|
|
188
|
+
if (!this.mainWindow) return;
|
|
189
|
+
if (trackTab) {
|
|
190
|
+
this.tabs.upsertTarget(target);
|
|
191
|
+
}
|
|
192
|
+
this.actions.setActiveTarget(target);
|
|
193
|
+
this.buildAppMenu();
|
|
194
|
+
this.mainWindow.setTitle(`${this.appName} - ${target.name}`);
|
|
195
|
+
const finalUrl = await this.showContentTarget(target);
|
|
196
|
+
this.emitDesktopState();
|
|
197
|
+
return finalUrl;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
async showLauncher() {
|
|
201
|
+
if (!this.mainWindow) return;
|
|
202
|
+
const target = { kind: 'launcher', name: this.appName, url: null };
|
|
203
|
+
this.tabs.upsertTarget(target);
|
|
204
|
+
this.actions.setActiveTarget(target);
|
|
205
|
+
this.detachActiveContentView();
|
|
206
|
+
this.buildAppMenu();
|
|
207
|
+
this.mainWindow.setTitle(this.appName);
|
|
208
|
+
this.mainWindow.webContents.focus();
|
|
209
|
+
if (!this.launcherLoaded) {
|
|
210
|
+
await this.mainWindow.loadFile(this.getLauncherPath());
|
|
211
|
+
this.launcherLoaded = true;
|
|
212
|
+
} else {
|
|
213
|
+
this.emitDesktopState();
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
async switchDesktopTab(tabId) {
|
|
218
|
+
const tab = this.tabs.activate(tabId);
|
|
219
|
+
if (!tab || !this.mainWindow) return this.getDesktopState();
|
|
220
|
+
|
|
221
|
+
if (tab.id === 'home' || tab.kind === 'launcher') {
|
|
222
|
+
await this.showLauncher();
|
|
223
|
+
return this.getDesktopState();
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (!tab.target?.url) {
|
|
227
|
+
throw new Error('This tab does not have a target URL.');
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
await this.showTarget(tab.target, { trackTab: false });
|
|
231
|
+
return this.getDesktopState();
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
async reloadActiveTab() {
|
|
235
|
+
const activeTab = this.tabs.getActiveTab();
|
|
236
|
+
if (!activeTab || activeTab.id === 'home' || activeTab.kind === 'launcher') {
|
|
237
|
+
this.emitDesktopState();
|
|
238
|
+
return this.getDesktopState();
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const reloaded = this.viewHost.reloadTab(activeTab.id);
|
|
242
|
+
if (!reloaded && activeTab.target?.url) {
|
|
243
|
+
await this.showTarget(activeTab.target, { trackTab: false });
|
|
244
|
+
}
|
|
245
|
+
this.emitDesktopState();
|
|
246
|
+
return this.getDesktopState();
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
async navigateActiveView(url) {
|
|
250
|
+
const navigated = await this.viewHost.navigateActiveView(url);
|
|
251
|
+
this.emitDesktopState();
|
|
252
|
+
return navigated;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
async readAuthTokenForTarget(url) {
|
|
256
|
+
return this.viewHost.readLocalStorageValueForOrigin(url, AUTH_TOKEN_STORAGE_KEY);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
openActiveTabDevTools() {
|
|
260
|
+
if (this.viewHost.openActiveViewDevTools()) return;
|
|
261
|
+
void this.actions.showError('No active BrowserView', new Error('Switch to a non-launcher tab before opening active tab DevTools.'));
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
reloadActiveBrowserViewForDiagnostics() {
|
|
265
|
+
if (this.viewHost.reloadActiveView()) return;
|
|
266
|
+
void this.actions.showError('No active BrowserView', new Error('Switch to a non-launcher tab before reloading the active BrowserView.'));
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
detachActiveBrowserViewForDiagnostics() {
|
|
270
|
+
if (this.viewHost.detachActiveView()) return;
|
|
271
|
+
void this.actions.showError('No active BrowserView', new Error('Switch to a non-launcher tab before detaching the active BrowserView.'));
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
copyWebContentsDiagnostics() {
|
|
275
|
+
const tabViewDiagnostics = this.viewHost.getTabViewDiagnostics();
|
|
276
|
+
const tabViewByContentsId = new Map(
|
|
277
|
+
tabViewDiagnostics
|
|
278
|
+
.filter((item) => item.webContentsId != null)
|
|
279
|
+
.map((item) => [item.webContentsId, item])
|
|
280
|
+
);
|
|
281
|
+
|
|
282
|
+
const rows = electronWebContents.getAllWebContents().map((contents) => {
|
|
283
|
+
const destroyed = contents.isDestroyed();
|
|
284
|
+
const processIds = destroyed ? { osProcessId: null, processId: null } : getWebContentsProcessId(contents);
|
|
285
|
+
const tabView = tabViewByContentsId.get(contents.id);
|
|
286
|
+
let owner = 'unknown';
|
|
287
|
+
if (this.mainWindow?.webContents?.id === contents.id) {
|
|
288
|
+
owner = 'main-window';
|
|
289
|
+
} else if (this.settingsWindow?.webContents?.id === contents.id) {
|
|
290
|
+
owner = 'settings-window';
|
|
291
|
+
} else if (tabView) {
|
|
292
|
+
owner = `browser-view:${tabView.tabId}`;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
return {
|
|
296
|
+
id: contents.id,
|
|
297
|
+
owner,
|
|
298
|
+
osProcessId: processIds.osProcessId,
|
|
299
|
+
processId: processIds.processId,
|
|
300
|
+
url: destroyed ? null : contents.getURL(),
|
|
301
|
+
title: destroyed ? null : contents.getTitle(),
|
|
302
|
+
destroyed,
|
|
303
|
+
focused: destroyed || typeof contents.isFocused !== 'function' ? false : contents.isFocused(),
|
|
304
|
+
attached: tabView ? tabView.attached : null,
|
|
305
|
+
active: tabView ? tabView.active : null,
|
|
306
|
+
};
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
const activeTab = this.tabs.getActiveTab();
|
|
310
|
+
const diagnostics = {
|
|
311
|
+
generatedAt: new Date().toISOString(),
|
|
312
|
+
activeTabId: this.tabs.activeTabId,
|
|
313
|
+
activeTab: activeTab
|
|
314
|
+
? {
|
|
315
|
+
id: activeTab.id,
|
|
316
|
+
title: activeTab.title,
|
|
317
|
+
kind: activeTab.kind,
|
|
318
|
+
targetUrl: activeTab.target?.url || null,
|
|
319
|
+
}
|
|
320
|
+
: null,
|
|
321
|
+
tabViews: tabViewDiagnostics,
|
|
322
|
+
webContents: rows,
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
clipboard.writeText(JSON.stringify(diagnostics, null, 2));
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
async closeDesktopTab(tabId) {
|
|
329
|
+
const tab = this.tabs.remove(tabId);
|
|
330
|
+
if (!tab) return this.getDesktopState();
|
|
331
|
+
this.destroyTabView(tabId);
|
|
332
|
+
if (this.tabs.activeTabId === 'home') {
|
|
333
|
+
await this.showLauncher();
|
|
334
|
+
} else {
|
|
335
|
+
this.emitDesktopState();
|
|
336
|
+
}
|
|
337
|
+
return this.getDesktopState();
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
buildEnvironmentActionsSubmenu(environment) {
|
|
341
|
+
const items = [];
|
|
342
|
+
const statusSuffix = environment.status === 'running' ? '' : ` (${environment.status})`;
|
|
343
|
+
items.push({
|
|
344
|
+
label: 'Open Environment',
|
|
345
|
+
click: () => void this.actions.openEnvironmentInDesktop(environment)
|
|
346
|
+
.catch((error) => this.actions.showError(`Could not open ${environment.name || environment.subdomain}${statusSuffix}`, error)),
|
|
347
|
+
});
|
|
348
|
+
items.push({
|
|
349
|
+
label: 'Open in Browser',
|
|
350
|
+
click: () => void this.actions.openEnvironmentInBrowser(environment)
|
|
351
|
+
.catch((error) => this.actions.showError('Could not open environment in browser', error)),
|
|
352
|
+
});
|
|
353
|
+
items.push({
|
|
354
|
+
label: 'Open in VS Code',
|
|
355
|
+
click: () => void this.actions.openEnvironmentInIde(environment, 'vscode')
|
|
356
|
+
.catch((error) => this.actions.showError('Could not open environment in VS Code', error)),
|
|
357
|
+
});
|
|
358
|
+
items.push({
|
|
359
|
+
label: 'Open in Cursor',
|
|
360
|
+
click: () => void this.actions.openEnvironmentInIde(environment, 'cursor')
|
|
361
|
+
.catch((error) => this.actions.showError('Could not open environment in Cursor', error)),
|
|
362
|
+
});
|
|
363
|
+
items.push({
|
|
364
|
+
label: 'Open SSH Terminal',
|
|
365
|
+
click: () => void this.actions.openEnvironmentInSsh(environment)
|
|
366
|
+
.catch((error) => this.actions.showError('Could not open SSH terminal', error)),
|
|
367
|
+
});
|
|
368
|
+
items.push({
|
|
369
|
+
label: 'Copy Mobile/Web URL',
|
|
370
|
+
click: () => this.actions.copyText(this.actions.getEnvironmentUrl(environment)),
|
|
371
|
+
});
|
|
372
|
+
if (environment.status !== 'running') {
|
|
373
|
+
items.unshift({
|
|
374
|
+
label: environment.status === 'paused' ? 'Resume' : 'Start',
|
|
375
|
+
click: () => void this.actions.startEnvironment(environment)
|
|
376
|
+
.catch((error) => this.actions.showError('Could not start environment', error)),
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
if (environment.status === 'running') {
|
|
380
|
+
items.push({
|
|
381
|
+
label: 'Stop',
|
|
382
|
+
click: () => void this.actions.stopEnvironment(environment)
|
|
383
|
+
.catch((error) => this.actions.showError('Could not stop environment', error)),
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
return items;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
buildTrayEnvironmentSection() {
|
|
390
|
+
const cloudState = this.getCloudState();
|
|
391
|
+
if (!cloudState.account?.apiKey) {
|
|
392
|
+
return [
|
|
393
|
+
{
|
|
394
|
+
label: cloudState.account?.email ? `Reconnect ${cloudState.account.email}` : 'Login',
|
|
395
|
+
click: () => void this.actions.connectCloudAccount()
|
|
396
|
+
.catch((error) => this.actions.showError('Could not connect CloudCLI Cloud account', error)),
|
|
397
|
+
},
|
|
398
|
+
];
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
if (!cloudState.environments.length) {
|
|
402
|
+
return [{ label: 'No environments found', enabled: false }];
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
return cloudState.environments.map((environment) => ({
|
|
406
|
+
label: `${environment.name || environment.subdomain} - ${environment.status}`,
|
|
407
|
+
submenu: this.buildEnvironmentActionsSubmenu(environment),
|
|
408
|
+
}));
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
buildAppMenu() {
|
|
412
|
+
if (!this.mainWindow) return;
|
|
413
|
+
const cloudState = this.getCloudState();
|
|
414
|
+
const localState = this.getLocalState();
|
|
415
|
+
const remoteItems = this.getRemoteEnvironmentMenuItems();
|
|
416
|
+
const cloudAccountLabel = cloudState.account?.apiKey
|
|
417
|
+
? (cloudState.account?.email ? `Connected: ${cloudState.account.email}` : 'CloudCLI Cloud Connected')
|
|
418
|
+
: (cloudState.account?.email ? `Reconnect: ${cloudState.account.email}` : 'Connect CloudCLI Cloud Account...');
|
|
419
|
+
|
|
420
|
+
const template = [
|
|
421
|
+
{
|
|
422
|
+
label: this.appName,
|
|
423
|
+
submenu: [
|
|
424
|
+
{ label: `About ${this.appName}`, role: 'about' },
|
|
425
|
+
{ type: 'separator' },
|
|
426
|
+
{
|
|
427
|
+
label: 'Show Launcher',
|
|
428
|
+
accelerator: 'CmdOrCtrl+Shift+L',
|
|
429
|
+
click: () => void this.showLauncher().catch((error) => this.actions.showError('Could not show launcher', error)),
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
label: 'Switch Environment',
|
|
433
|
+
accelerator: 'CmdOrCtrl+Shift+E',
|
|
434
|
+
click: () => void this.actions.showEnvironmentPicker().catch((error) => this.actions.showError('Could not switch environment', error)),
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
label: 'Diagnostics',
|
|
438
|
+
submenu: [
|
|
439
|
+
{
|
|
440
|
+
label: 'Copy Diagnostics',
|
|
441
|
+
click: () => void this.actions.copyDiagnostics(),
|
|
442
|
+
},
|
|
443
|
+
],
|
|
444
|
+
},
|
|
445
|
+
{ type: 'separator' },
|
|
446
|
+
{
|
|
447
|
+
label: process.platform === 'darwin' ? `Hide ${this.appName}` : 'Hide',
|
|
448
|
+
role: 'hide',
|
|
449
|
+
visible: process.platform === 'darwin',
|
|
450
|
+
},
|
|
451
|
+
{ label: 'Hide Others', role: 'hideOthers', visible: process.platform === 'darwin' },
|
|
452
|
+
{ label: 'Show All', role: 'unhide', visible: process.platform === 'darwin' },
|
|
453
|
+
{ type: 'separator', visible: process.platform === 'darwin' },
|
|
454
|
+
{ label: `Quit ${this.appName}`, accelerator: 'CmdOrCtrl+Q', role: 'quit' },
|
|
455
|
+
],
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
label: 'Environment',
|
|
459
|
+
submenu: [
|
|
460
|
+
{
|
|
461
|
+
label: 'Show Launcher',
|
|
462
|
+
accelerator: 'CmdOrCtrl+Shift+L',
|
|
463
|
+
click: () => void this.showLauncher().catch((error) => this.actions.showError('Could not show launcher', error)),
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
label: 'Switch Environment',
|
|
467
|
+
accelerator: 'CmdOrCtrl+Shift+E',
|
|
468
|
+
click: () => void this.actions.showEnvironmentPicker().catch((error) => this.actions.showError('Could not switch environment', error)),
|
|
469
|
+
},
|
|
470
|
+
{ type: 'separator' },
|
|
471
|
+
{
|
|
472
|
+
label: 'Open Local WindCli',
|
|
473
|
+
accelerator: 'CmdOrCtrl+L',
|
|
474
|
+
click: () => void this.actions.openLocalInDesktop().catch((error) => this.actions.showError('Could not open local WindCli', error)),
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
label: 'Open Local Web UI in Browser',
|
|
478
|
+
accelerator: 'CmdOrCtrl+Shift+W',
|
|
479
|
+
click: () => void this.actions.openLocalWebUi().catch((error) => this.actions.showError('Could not open local web UI', error)),
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
label: 'Copy Local Web URL',
|
|
483
|
+
accelerator: 'CmdOrCtrl+Shift+U',
|
|
484
|
+
click: () => void this.actions.copyLocalWebUrl().catch((error) => this.actions.showError('Could not copy local web URL', error)),
|
|
485
|
+
},
|
|
486
|
+
{ type: 'separator' },
|
|
487
|
+
{
|
|
488
|
+
label: 'Keep Local Server Running After Quit',
|
|
489
|
+
type: 'checkbox',
|
|
490
|
+
checked: localState.desktopSettings.keepLocalServerRunning,
|
|
491
|
+
click: (menuItem) => void this.actions.updateDesktopSetting('keepLocalServerRunning', menuItem.checked)
|
|
492
|
+
.catch((error) => this.actions.showError('Could not update desktop setting', error)),
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
label: 'Allow LAN Access to Local Server',
|
|
496
|
+
type: 'checkbox',
|
|
497
|
+
checked: localState.desktopSettings.exposeLocalServerOnNetwork,
|
|
498
|
+
click: (menuItem) => void this.actions.updateDesktopSetting('exposeLocalServerOnNetwork', menuItem.checked)
|
|
499
|
+
.catch((error) => this.actions.showError('Could not update desktop setting', error)),
|
|
500
|
+
},
|
|
501
|
+
],
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
label: 'Cloud',
|
|
505
|
+
submenu: [
|
|
506
|
+
{
|
|
507
|
+
label: cloudAccountLabel,
|
|
508
|
+
accelerator: 'CmdOrCtrl+Shift+C',
|
|
509
|
+
click: () => void this.actions.connectCloudAccount().catch((error) => this.actions.showError('Could not connect CloudCLI Cloud account', error)),
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
label: 'Refresh Cloud Environments',
|
|
513
|
+
click: () => void this.actions.refreshCloudEnvironments().catch((error) => this.actions.showError('Could not load CloudCLI Cloud environments', error)),
|
|
514
|
+
enabled: Boolean(cloudState.account?.apiKey),
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
label: 'Logout WindCli Account',
|
|
518
|
+
click: () => void this.actions.clearCloudAccount().catch((error) => this.actions.showError('Could not logout', error)),
|
|
519
|
+
enabled: Boolean(cloudState.account?.apiKey),
|
|
520
|
+
},
|
|
521
|
+
{ type: 'separator' },
|
|
522
|
+
{
|
|
523
|
+
label: 'Remote Environments',
|
|
524
|
+
submenu: remoteItems,
|
|
525
|
+
},
|
|
526
|
+
],
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
label: 'Edit',
|
|
530
|
+
submenu: [
|
|
531
|
+
{ role: 'undo' },
|
|
532
|
+
{ role: 'redo' },
|
|
533
|
+
{ type: 'separator' },
|
|
534
|
+
{ role: 'cut' },
|
|
535
|
+
{ role: 'copy' },
|
|
536
|
+
{ role: 'paste' },
|
|
537
|
+
{ role: 'selectAll' },
|
|
538
|
+
],
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
label: 'View',
|
|
542
|
+
submenu: [
|
|
543
|
+
{ role: 'reload' },
|
|
544
|
+
{ role: 'forceReload' },
|
|
545
|
+
{ role: 'toggleDevTools' },
|
|
546
|
+
{
|
|
547
|
+
label: 'Open Active Tab DevTools',
|
|
548
|
+
click: () => this.openActiveTabDevTools(),
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
label: 'Copy WebContents Diagnostics',
|
|
552
|
+
click: () => this.copyWebContentsDiagnostics(),
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
label: 'Reload Active BrowserView',
|
|
556
|
+
click: () => this.reloadActiveBrowserViewForDiagnostics(),
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
label: 'Detach Active BrowserView',
|
|
560
|
+
click: () => this.detachActiveBrowserViewForDiagnostics(),
|
|
561
|
+
},
|
|
562
|
+
{ type: 'separator' },
|
|
563
|
+
{ role: 'resetZoom' },
|
|
564
|
+
{ role: 'zoomIn' },
|
|
565
|
+
{ role: 'zoomOut' },
|
|
566
|
+
{ type: 'separator' },
|
|
567
|
+
{ role: 'togglefullscreen' },
|
|
568
|
+
],
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
label: 'Window',
|
|
572
|
+
submenu: [
|
|
573
|
+
{ role: 'minimize' },
|
|
574
|
+
{ role: 'zoom' },
|
|
575
|
+
...(process.platform === 'darwin' ? [{ type: 'separator' }, { role: 'front' }] : []),
|
|
576
|
+
],
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
label: 'Help',
|
|
580
|
+
submenu: [
|
|
581
|
+
{
|
|
582
|
+
label: 'Open cloudcli.ai',
|
|
583
|
+
click: () => void this.actions.openCloudDashboard(),
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
label: 'Copy Diagnostics',
|
|
587
|
+
click: () => void this.actions.copyDiagnostics(),
|
|
588
|
+
},
|
|
589
|
+
],
|
|
590
|
+
},
|
|
591
|
+
];
|
|
592
|
+
|
|
593
|
+
Menu.setApplicationMenu(Menu.buildFromTemplate(template));
|
|
594
|
+
this.buildTrayMenu();
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
buildTrayMenu() {
|
|
598
|
+
if (!this.tray) return;
|
|
599
|
+
const cloudState = this.getCloudState();
|
|
600
|
+
const localState = this.getLocalState();
|
|
601
|
+
|
|
602
|
+
const template = [
|
|
603
|
+
{
|
|
604
|
+
label: 'Local',
|
|
605
|
+
submenu: [
|
|
606
|
+
{
|
|
607
|
+
label: localState.localServerRunning ? 'Open Local in WindCli' : 'Start Local in WindCli',
|
|
608
|
+
click: () => void this.actions.openLocalInDesktop().catch((error) => this.actions.showError('Could not open local WindCli', error)),
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
label: 'Open Local in Browser',
|
|
612
|
+
click: () => void this.actions.openLocalWebUi().catch((error) => this.actions.showError('Could not open local web UI', error)),
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
label: 'Copy Local URL',
|
|
616
|
+
click: () => void this.actions.copyLocalWebUrl().catch((error) => this.actions.showError('Could not copy local web URL', error)),
|
|
617
|
+
},
|
|
618
|
+
],
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
label: 'Cloud Environments',
|
|
622
|
+
submenu: this.buildTrayEnvironmentSection(),
|
|
623
|
+
},
|
|
624
|
+
{ type: 'separator' },
|
|
625
|
+
{
|
|
626
|
+
label: cloudState.account?.email ? `Connected: ${cloudState.account.email}` : 'Login',
|
|
627
|
+
click: () => void this.actions.connectCloudAccount().catch((error) => this.actions.showError('Could not connect CloudCLI Cloud account', error)),
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
label: 'Logout WindCli Account',
|
|
631
|
+
click: () => void this.actions.clearCloudAccount().catch((error) => this.actions.showError('Could not logout', error)),
|
|
632
|
+
enabled: Boolean(cloudState.account?.apiKey),
|
|
633
|
+
},
|
|
634
|
+
{ type: 'separator' },
|
|
635
|
+
{
|
|
636
|
+
label: `Quit ${this.appName}`,
|
|
637
|
+
role: 'quit',
|
|
638
|
+
},
|
|
639
|
+
];
|
|
640
|
+
|
|
641
|
+
this.tray.setToolTip(`${this.appName}${this.actions.getActiveTarget()?.name ? ` - ${this.actions.getActiveTarget().name}` : ''}`);
|
|
642
|
+
this.tray.setContextMenu(Menu.buildFromTemplate(template));
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
async showDesktopSettings() {
|
|
646
|
+
if (!this.mainWindow) return this.getDesktopState();
|
|
647
|
+
await this.ensureSettingsWindow('desktop-settings');
|
|
648
|
+
return this.getDesktopState();
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
async showLocalSettings() {
|
|
652
|
+
if (!this.mainWindow) return this.getDesktopState();
|
|
653
|
+
await this.ensureSettingsWindow('local-settings');
|
|
654
|
+
return this.getDesktopState();
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
async showActiveEnvironmentActionsMenu() {
|
|
658
|
+
if (!this.mainWindow) return this.getDesktopState();
|
|
659
|
+
const activeTarget = this.actions.getActiveTarget();
|
|
660
|
+
if (activeTarget?.kind !== 'remote') return this.getDesktopState();
|
|
661
|
+
|
|
662
|
+
const environment = this.getCloudState().environments.find((item) => item.id === activeTarget.id);
|
|
663
|
+
if (!environment) return this.getDesktopState();
|
|
664
|
+
|
|
665
|
+
const menu = Menu.buildFromTemplate(this.buildEnvironmentActionsSubmenu(environment));
|
|
666
|
+
menu.popup({ window: this.mainWindow });
|
|
667
|
+
return this.getDesktopState();
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
async showEnvironmentActionsMenu(environmentId) {
|
|
671
|
+
if (!this.mainWindow) return this.getDesktopState();
|
|
672
|
+
const environment = this.getCloudState().environments.find((item) => item.id === environmentId);
|
|
673
|
+
if (!environment) return this.getDesktopState();
|
|
674
|
+
|
|
675
|
+
const menu = Menu.buildFromTemplate(this.buildEnvironmentActionsSubmenu(environment));
|
|
676
|
+
menu.popup({ window: this.mainWindow });
|
|
677
|
+
return this.getDesktopState();
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
configurePermissions() {
|
|
681
|
+
const isAllowedPermission = (webContents, permission) => {
|
|
682
|
+
const sourceUrl = webContents.getURL();
|
|
683
|
+
const allowedPermissions = new Set(['clipboard-read', 'media', 'notifications']);
|
|
684
|
+
return isAllowedPermissionOrigin(sourceUrl, this.getCloudState().controlPlaneUrl) && allowedPermissions.has(permission);
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
session.defaultSession.setPermissionRequestHandler((webContents, permission, callback) => {
|
|
688
|
+
callback(isAllowedPermission(webContents, permission));
|
|
689
|
+
});
|
|
690
|
+
session.defaultSession.setPermissionCheckHandler((webContents, permission) => {
|
|
691
|
+
if (!webContents) return false;
|
|
692
|
+
return isAllowedPermission(webContents, permission);
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
createTray() {
|
|
697
|
+
if (this.tray) return;
|
|
698
|
+
this.tray = new Tray(this.getTrayImage());
|
|
699
|
+
this.tray.on('click', () => {
|
|
700
|
+
if (!this.mainWindow) return;
|
|
701
|
+
if (this.mainWindow.isVisible()) {
|
|
702
|
+
this.mainWindow.focus();
|
|
703
|
+
} else {
|
|
704
|
+
this.mainWindow.show();
|
|
705
|
+
}
|
|
706
|
+
});
|
|
707
|
+
this.buildTrayMenu();
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
async createWindow() {
|
|
711
|
+
this.mainWindow = new BrowserWindow({
|
|
712
|
+
width: 1440,
|
|
713
|
+
height: 960,
|
|
714
|
+
minWidth: 1024,
|
|
715
|
+
minHeight: 720,
|
|
716
|
+
show: false,
|
|
717
|
+
backgroundColor: '#0f172a',
|
|
718
|
+
title: this.appName,
|
|
719
|
+
icon: this.getWindowIconPath(),
|
|
720
|
+
titleBarStyle: 'hidden',
|
|
721
|
+
...(process.platform === 'darwin'
|
|
722
|
+
? { trafficLightPosition: { x: 18, y: 14 } }
|
|
723
|
+
: {
|
|
724
|
+
titleBarOverlay: {
|
|
725
|
+
color: nativeTheme.shouldUseDarkColors ? '#111111' : '#f7f8fa',
|
|
726
|
+
symbolColor: nativeTheme.shouldUseDarkColors ? '#a1a1a1' : '#5b6470',
|
|
727
|
+
height: 44,
|
|
728
|
+
},
|
|
729
|
+
}),
|
|
730
|
+
webPreferences: {
|
|
731
|
+
contextIsolation: true,
|
|
732
|
+
nodeIntegration: false,
|
|
733
|
+
sandbox: true,
|
|
734
|
+
preload: this.getPreloadPath(),
|
|
735
|
+
},
|
|
736
|
+
});
|
|
737
|
+
|
|
738
|
+
this.mainWindow.once('ready-to-show', () => {
|
|
739
|
+
this.mainWindow?.show();
|
|
740
|
+
});
|
|
741
|
+
|
|
742
|
+
this.mainWindow.webContents.setWindowOpenHandler(({ url }) => {
|
|
743
|
+
void this.openExternalUrl(url).catch((error) => this.actions.showError('Could not open external link', error));
|
|
744
|
+
return { action: 'deny' };
|
|
745
|
+
});
|
|
746
|
+
|
|
747
|
+
this.mainWindow.on('resize', () => {
|
|
748
|
+
this.viewHost.resizeActiveView();
|
|
749
|
+
this.syncSettingsWindowBounds();
|
|
750
|
+
});
|
|
751
|
+
|
|
752
|
+
this.mainWindow.on('move', () => {
|
|
753
|
+
this.syncSettingsWindowBounds();
|
|
754
|
+
});
|
|
755
|
+
|
|
756
|
+
this.mainWindow.on('closed', () => {
|
|
757
|
+
this.viewHost.clear();
|
|
758
|
+
this.settingsWindow = null;
|
|
759
|
+
this.mainWindow = null;
|
|
760
|
+
this.launcherLoaded = false;
|
|
761
|
+
});
|
|
762
|
+
|
|
763
|
+
this.buildAppMenu();
|
|
764
|
+
await this.showLauncher();
|
|
765
|
+
}
|
|
766
|
+
}
|