cicy-desktop 2.1.235 → 2.1.237

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.
Files changed (139) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +4 -0
  3. package/README.md +68 -305
  4. package/assets/my_teams.png +0 -0
  5. package/assets/team.png +0 -0
  6. package/bin/cicy-desktop +2 -4
  7. package/generate-openapi.js +3 -0
  8. package/jest.config.js +3 -0
  9. package/jest.setup.global.js +3 -0
  10. package/jest.teardown.global.js +3 -0
  11. package/package.json +10 -13
  12. package/scripts/build-homepage.cjs +3 -0
  13. package/scripts/sync-runtime-deps.cjs +3 -0
  14. package/src/app-updater.js +3 -0
  15. package/src/backends/auth-email.js +3 -0
  16. package/src/backends/auth-loopback.js +3 -0
  17. package/src/backends/homepage-preload.js +3 -0
  18. package/src/backends/homepage-window.js +3 -0
  19. package/src/backends/ipc.js +3 -0
  20. package/src/backends/local-teams.js +3 -0
  21. package/src/backends/open-external.js +3 -0
  22. package/src/backends/poller.js +3 -0
  23. package/src/backends/registry.js +3 -0
  24. package/src/backends/sidecar-ipc.js +3 -0
  25. package/src/backends/updater.js +3 -0
  26. package/src/backends/webview-preload.js +3 -0
  27. package/src/backends/window-manager.js +3 -0
  28. package/src/backends/window-tracker.js +3 -0
  29. package/src/chrome/chrome-cdp-client.js +3 -0
  30. package/src/chrome/chrome-launcher.js +3 -0
  31. package/src/chrome/debugger-port-resolver.js +3 -0
  32. package/src/chrome/runtime-registry.js +3 -0
  33. package/src/cloud/cloud-client.js +3 -0
  34. package/src/cluster/local-agent-registry.js +3 -0
  35. package/src/cluster/remote-executor.js +3 -0
  36. package/src/cluster/types.js +3 -0
  37. package/src/cluster/worker-client.js +3 -0
  38. package/src/cluster/worker-identity.js +3 -0
  39. package/src/config.js +3 -0
  40. package/src/extension/inject.js +3 -0
  41. package/src/i18n/index.js +3 -0
  42. package/src/main-old.js +3 -0
  43. package/src/main.js +3 -0
  44. package/src/master/agent-index.js +3 -0
  45. package/src/master/chrome-config.js +3 -0
  46. package/src/master/master-admin-routes.js +3 -0
  47. package/src/master/master-main.js +3 -0
  48. package/src/master/master-metrics.js +3 -0
  49. package/src/master/master-routes.js +3 -0
  50. package/src/master/master-token-manager.js +3 -0
  51. package/src/master/session-affinity-store.js +3 -0
  52. package/src/master/task-scheduler.js +3 -0
  53. package/src/master/task-store.js +3 -0
  54. package/src/master/worker-inventory.js +3 -0
  55. package/src/master/worker-registry.js +3 -0
  56. package/src/preload-rpc.js +3 -0
  57. package/src/profiles/profile-store.js +3 -0
  58. package/src/profiles/trusted-origins-store.js +3 -0
  59. package/src/server/args-parser.js +3 -0
  60. package/src/server/chrome-management-routes.js +3 -0
  61. package/src/server/chrome-proxy-routes.js +3 -0
  62. package/src/server/electron-setup.js +3 -0
  63. package/src/server/express-app.js +8 -19
  64. package/src/server/logging.js +3 -0
  65. package/src/server/mcp-server.js +3 -0
  66. package/src/server/tool-catalog.js +3 -0
  67. package/src/server/tool-executor.js +3 -0
  68. package/src/server/tool-registry.js +3 -0
  69. package/src/server/ui-routes.js +3 -0
  70. package/src/server/worker-observability-routes.js +3 -0
  71. package/src/sidecar/cicy-code.js +3 -0
  72. package/src/sidecar/colima-docker.js +3 -0
  73. package/src/sidecar/docker.js +3 -0
  74. package/src/sidecar/host-mihomo.js +3 -0
  75. package/src/sidecar/localbin.js +3 -0
  76. package/src/sidecar/mirrors.js +3 -0
  77. package/src/sidecar/native.js +3 -0
  78. package/src/sidecar/net-detect.js +3 -0
  79. package/src/sidecar/runtime.js +3 -0
  80. package/src/sidecar/version.js +3 -0
  81. package/src/sidecar/wsl-docker.js +3 -0
  82. package/src/tabbrowser/newtab-protocol.js +3 -0
  83. package/src/tabbrowser/tab-shell-preload.js +3 -0
  84. package/src/tools/account-tools.js +3 -0
  85. package/src/tools/automation-tools.js +3 -0
  86. package/src/tools/cdp-tools.js +3 -0
  87. package/src/tools/chrome-tools.js +3 -0
  88. package/src/tools/clipboard-tools.js +3 -0
  89. package/src/tools/desktop-snapshot-tools.js +3 -0
  90. package/src/tools/device-tools.js +3 -0
  91. package/src/tools/download-tools.js +3 -0
  92. package/src/tools/exec-js.js +3 -0
  93. package/src/tools/exec-tools.js +3 -0
  94. package/src/tools/file-tools.js +3 -0
  95. package/src/tools/hook-chatgpt.js +3 -0
  96. package/src/tools/hook-gemini.js +3 -0
  97. package/src/tools/index.js +3 -0
  98. package/src/tools/ipc-bridge.js +3 -0
  99. package/src/tools/list-tools.js +3 -0
  100. package/src/tools/ping.js +3 -0
  101. package/src/tools/r-reset.js +3 -0
  102. package/src/tools/screenshot-tools.js +3 -0
  103. package/src/tools/system-tools.js +3 -0
  104. package/src/tools/tab-browser-tools.js +3 -0
  105. package/src/tools/window-tools.js +3 -0
  106. package/src/tray.js +3 -0
  107. package/src/utils/app-icon.js +3 -0
  108. package/src/utils/auth.js +3 -0
  109. package/src/utils/brand-host-electron.js +3 -0
  110. package/src/utils/cdp-utils.js +3 -0
  111. package/src/utils/context-menu-options.js +3 -0
  112. package/src/utils/cookie-logins.js +3 -0
  113. package/src/utils/desktop-snapshot.js +3 -0
  114. package/src/utils/download-manager.js +3 -0
  115. package/src/utils/global-json.js +3 -0
  116. package/src/utils/ip-probe.js +3 -0
  117. package/src/utils/process-utils.js +3 -0
  118. package/src/utils/rpc-audit.js +3 -0
  119. package/src/utils/rpc-guard.js +3 -0
  120. package/src/utils/snapshot-utils.js +3 -0
  121. package/src/utils/window-monitor.js +3 -0
  122. package/src/utils/window-registry.js +3 -0
  123. package/src/utils/window-state.js +3 -0
  124. package/src/utils/window-thumbnails.js +3 -0
  125. package/src/utils/window-utils.js +3 -0
  126. package/workers/render/package-lock.json +1 -0
  127. package/workers/render/package.json +2 -1
  128. package/workers/render/src/App.jsx +3 -0
  129. package/workers/render/src/main.jsx +3 -0
  130. package/workers/render/src/mdLite.js +3 -0
  131. package/workers/render/src/termsText.js +3 -0
  132. package/workers/render/vite.config.js +3 -0
  133. package/CLAUDE.md +0 -615
  134. package/bin/cicy-rpc +0 -13
  135. package/dev-app-update.yml +0 -3
  136. package/src/cli/rpc.js +0 -356
  137. package/src/ui-react-dist/assets/index-IWkApOSk.css +0 -1
  138. package/src/ui-react-dist/assets/index-jGZoL6K1.js +0 -154
  139. package/src/ui-react-dist/index.html +0 -13
package/jest.config.js CHANGED
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  module.exports = {
2
5
  testEnvironment: "node",
3
6
  testMatch: ["<rootDir>/tests/**/*.test.js"],
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const { startTestServer } = require('./tests/mcp/setup-test-server');
2
5
 
3
6
  module.exports = async () => {
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const { stopTestServer } = require('./tests/mcp/setup-test-server');
2
5
 
3
6
  module.exports = async () => {
package/package.json CHANGED
@@ -1,12 +1,10 @@
1
1
  {
2
2
  "name": "cicy-desktop",
3
- "version": "2.1.235",
3
+ "version": "2.1.237",
4
4
  "description": "CiCy - AI-powered operating system browser",
5
5
  "main": "src/main.js",
6
6
  "bin": {
7
- "cicy-desktop": "./bin/cicy-desktop",
8
- "cicy": "./bin/cicy-desktop",
9
- "cicy-rpc": "./bin/cicy-rpc"
7
+ "cicy-desktop": "./bin/cicy-desktop"
10
8
  },
11
9
  "scripts": {
12
10
  "start": "node ./bin/cicy-desktop",
@@ -16,7 +14,6 @@
16
14
  "test": "jest",
17
15
  "test:ls": "node tests/test-ls.js",
18
16
  "build": "electron-builder --publish never",
19
- "build:ui": "cd packages/ui-react && npm install && npm run build",
20
17
  "build:homepage": "node scripts/build-homepage.cjs",
21
18
  "prebuild:win": "node scripts/build-homepage.cjs",
22
19
  "prebuild:mac": "node scripts/build-homepage.cjs",
@@ -124,13 +121,14 @@
124
121
  "name": "cicybot",
125
122
  "email": "support@cicy-ai.com"
126
123
  },
127
- "license": "MIT",
124
+ "license": "Apache-2.0",
128
125
  "dependencies": {
129
126
  "@modelcontextprotocol/sdk": "^1.25.3",
130
127
  "chrome-remote-interface": "^0.33.0",
131
128
  "cors": "^2.8.5",
132
129
  "electron-context-menu": "^4.0.4",
133
130
  "electron-log": "^5.2.4",
131
+ "electron-updater": "6.6.2",
134
132
  "express": "^4.18.2",
135
133
  "i18next": "^26.2.0",
136
134
  "js-beautify": "^1.15.4",
@@ -138,17 +136,16 @@
138
136
  "serve-index": "^1.9.2",
139
137
  "swagger-jsdoc": "^6.2.8",
140
138
  "swagger-ui-express": "^5.0.1",
141
- "zod": "3.25",
142
- "electron-updater": "6.6.2"
139
+ "zod": "3.25"
143
140
  },
144
141
  "//optionalDependencies": "(2026-06 回调): mac/linux 改回 native cicy-code(:8008,colima 在 16G mac 上压垮内存)→ 重新内置 cicy-code-<plat> / cicy-mihomo-<plat>,localbin.fromBundle 零网络 seed(npm 仅作更新通道,带 npmmirror→npmjs 回退)。这些由 scripts/sync-runtime-deps.cjs 在 tag-push 时同步到最新版。npm 的 os/cpu 字段保证每个平台只装自己那份。Windows 仍走 docker(WSL :8009),它那份 cicy-code-windows 用不到但 bundle 着无害。",
145
142
  "optionalDependencies": {
146
143
  "electron": "41.0.3",
147
- "cicy-code-darwin-x64": "2.3.190",
148
- "cicy-code-darwin-arm64": "2.3.190",
149
- "cicy-code-linux-x64": "2.3.190",
150
- "cicy-code-linux-arm64": "2.3.190",
151
- "cicy-code-windows-x64": "2.3.190",
144
+ "cicy-code-darwin-x64": "2.3.192",
145
+ "cicy-code-darwin-arm64": "2.3.192",
146
+ "cicy-code-linux-x64": "2.3.192",
147
+ "cicy-code-linux-arm64": "2.3.192",
148
+ "cicy-code-windows-x64": "2.3.192",
152
149
  "cicy-mihomo-darwin-x64": "1.10.4",
153
150
  "cicy-mihomo-darwin-arm64": "1.10.4",
154
151
  "cicy-mihomo-linux-x64": "1.10.4",
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ // Copyright 2026 CiCy AI
3
+ // SPDX-License-Identifier: Apache-2.0
4
+
2
5
  // Single source of truth for producing the SHIPPED homepage.
3
6
  //
4
7
  // The app loads src/backends/homepage-react/ (a prebuilt SPA snapshot). The
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ // Copyright 2026 CiCy AI
3
+ // SPDX-License-Identifier: Apache-2.0
4
+
2
5
  // Sync optionalDependencies to the LATEST published per-platform cicy-code and
3
6
  // cicy-mihomo subpackages, so every cicy-desktop build/publish bundles the
4
7
  // newest binaries. Run in CI before install/build (and before `npm publish`).
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // CiCy Desktop 自定义自更新(替掉 electron-updater 的全自动 quitAndInstall —— 它对
2
5
  // 未签名 mac / loose 源码版 / 多窗口 tab-shell 都不适配)。
3
6
  //
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Email magic-link DEVICE-POLL login — cross-device safe.
2
5
  //
3
6
  // The 127.0.0.1 loopback in auth-loopback.js only works when the magic link is
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Loopback browser-login listener.
2
5
  //
3
6
  // Flow (B-variant of OAuth-style desktop login — same pattern as `gcloud
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Homepage preload — last sweep. After this we should not need another
2
5
  // .app rebuild for routine UI work; everything new lands in the Vite
3
6
  // project at cicy-desktop/workers/render/src/ and HMRs in.
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Homepage window — primary CiCy Desktop window. Singleton; closing it
2
5
  // does NOT quit the app.
3
6
  //
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Main-side IPC for the homepage. Same backends:* / windows:* / updates:*
2
5
  // contract as before plus the "one rebuild for the year" additions below
3
6
  // (app, shell, tos, logs). Anything more specific should go through the
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Local-teams discovery — reads ~/cicy-ai/global.json and pings each
2
5
  // configured node's /api/health. Local-only by design: this module never
3
6
  // talks to the cloud, never runs `docker ps`, and never invents nodes
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Robust "open this URL in the system browser".
2
5
  //
3
6
  // electron's shell.openExternal silently fails on some Windows setups — a fresh
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Probes each backend's /api/health and returns the JSON payload. Used by
2
5
  // the homepage to populate per-backend status (uptime, mem, agents count).
3
6
  // Stateless — homepage caches results in renderer-side state.
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // File-backed BackendRegistry. Stores user's known cicy-code backends in
2
5
  // <userData>/backends.json. A pinned `local` entry is upserted on every load
3
6
  // so it cannot be accidentally deleted from the launcher UI.
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // IPC handlers for the cicy-code sidecar.
2
5
  //
3
6
  // cicy-code is no longer downloaded by an in-app installer — the sidecar runs
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Queries GitHub for the latest cicy-code release and compares against the
2
5
  // version currently reported by the bundled sidecar (via /api/health).
3
6
  // Phase 1 surface: { hasUpdate, currentVersion, latestVersion, releaseUrl }.
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Team Helper <webview> preload — runs inside the right-drawer webview that
2
5
  // loads the cloud helper SPA. Exposes a deliberately TINY surface compared
3
6
  // to homepage-preload.js: the helper agent is a remote third party, so it
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Opens BrowserWindow instances targeting a Backend. The local backend wraps
2
5
  // the bundled cicy-code daemon (started + supervised by src/sidecar/cicy-code.js)
3
6
  // and resolves its admin URL against ~/cicy-ai/global.json's api_token —
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Tracks BrowserWindows opened via openWindowForBackend, mapping each window
2
5
  // back to the backend that spawned it. Used by the homepage's "Recent
3
6
  // Windows" section. Cleans up on close.
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const CDP = require("chrome-remote-interface");
2
5
 
3
6
  async function fetchJson(url) {
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const fs = require("fs");
2
5
  const os = require("os");
3
6
  const path = require("path");
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const fs = require("fs");
2
5
  const os = require("os");
3
6
  const path = require("path");
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const { getWorkerIdentity } = require("../cluster/worker-identity");
2
5
  const { createRuntimeSessionId } = require("../cluster/types");
3
6
 
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Cloud ⇄ cicy-desktop client (device / team / teams).
2
5
  //
3
6
  // Implements the contract agreed with the cloud side (w-10032), documented at
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const { BrowserWindow } = require("electron");
2
5
  const { getWindowInfo } = require("../utils/window-utils");
3
6
  const { getWorkerIdentity } = require("./worker-identity");
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  async function forwardJsonRequest(baseUrl, token, requestPath, payload) {
2
5
  const response = await fetch(new URL(requestPath, baseUrl), {
3
6
  method: "POST",
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  function toIsoString(value) {
2
5
  return value ? new Date(value).toISOString() : null;
3
6
  }
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const DEFAULT_INTERVAL_MS = 5000;
2
5
 
3
6
  class WorkerClient {
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const os = require("os");
2
5
  const { config } = require("../config");
3
6
 
package/src/config.js CHANGED
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  module.exports = {
2
5
  config: {
3
6
  port: null,
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  console.log("hi cicy v4");
2
5
 
3
6
  window.__cicyInjected = true;
package/src/i18n/index.js CHANGED
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // CiCy Desktop i18n.
2
5
  // Single instance shared between main process and preload (loaded via require).
3
6
  // - locale comes from app.getLocale() (set in main.js init)
package/src/main-old.js CHANGED
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const { app: electronApp, BrowserWindow } = require("electron");
2
5
  const fs = require("fs");
3
6
  const path = require("path");
package/src/main.js CHANGED
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const { app: electronApp } = require("electron");
2
5
  const { default: contextMenu } = require("electron-context-menu");
3
6
  const fs = require("fs");
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  class AgentIndex {
2
5
  constructor() {
3
6
  this.agentsByWorker = new Map();
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const fs = require("fs");
2
5
  const os = require("os");
3
6
  const path = require("path");
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const express = require("express");
2
5
  const {
3
6
  getClusterSummary,
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const express = require("express");
2
5
  const path = require("path");
3
6
  const { WorkerRegistry } = require("./worker-registry");
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  function formatMemory(memory = {}) {
2
5
  return {
3
6
  rss: memory?.rss || 0,
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const express = require("express");
2
5
  const { randomUUID } = require("crypto");
3
6
  const remoteExecutor = require("../cluster/remote-executor");
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const fs = require("fs");
2
5
  const path = require("path");
3
6
  const crypto = require("crypto");
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  class SessionAffinityStore {
2
5
  constructor() {
3
6
  this.byControlSessionId = new Map();
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  function pickIdleAgent(agents = []) {
2
5
  return agents.find((agent) => agent.status === "idle") || agents[0] || null;
3
6
  }
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  class TaskStore {
2
5
  constructor() {
3
6
  this.tasks = new Map();
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const fs = require("fs");
2
5
  const os = require("os");
3
6
  const path = require("path");
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const STALE_AFTER_MS = 15000;
2
5
  const OFFLINE_AFTER_MS = 30000;
3
6
 
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const { contextBridge, ipcRenderer } = require("electron");
2
5
  contextBridge.exposeInMainWorld("electronRPC", {
3
6
  invoke: (toolName, args) => ipcRenderer.invoke("rpc:guarded", toolName, args),
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // profile-store.js — the shared "browser profile" standard across both backends.
2
5
  //
3
6
  // One profile = one backend (Chrome OR Electron); the two keep their own store
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Trusted-origins allowlist — the EXACT-hostname set of sites permitted to
2
5
  // receive the electronRPC bridge in profile 0 (i.e. allowed to run exec_shell &
3
6
  // friends on THIS machine). Persisted at ~/cicy-ai/db/trusted-origins.json as
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  function parseArgs() {
2
5
  const args = process.argv.slice(2);
3
6
 
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const express = require("express");
2
5
 
3
6
  function parseToolText(result) {
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const express = require("express");
2
5
 
3
6
  const { getVersion, getTargets, activateTarget, callCdp } = require("../chrome/chrome-cdp-client");
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const { app: electronApp } = require("electron");
2
5
  const log = require("electron-log");
3
6
 
@@ -1,6 +1,8 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const express = require("express");
2
5
  const cors = require("cors");
3
- const fs = require("fs");
4
6
  const path = require("path");
5
7
  const uiRoutes = require("./ui-routes");
6
8
 
@@ -153,31 +155,18 @@ function createExpressApp(authMiddleware, tools = {}) {
153
155
  }
154
156
  });
155
157
 
156
- const reactUiDir = path.join(__dirname, "../ui-react-dist");
157
-
158
- // Keep legacy UI for fallback/debugging
158
+ // Legacy debug UI. The React /console (packages/ui-react ui-react-dist) was
159
+ // removed — it was served but nothing in the app ever linked to it; the real
160
+ // desktop UI is the homepage + tab-shell. ui.html stays as a bare debug page.
159
161
  app.get("/ui-legacy", (req, res) => {
160
162
  res.sendFile(path.join(__dirname, "../ui.html"));
161
163
  });
162
164
 
163
- // UI (React) lives at /console; /ui is reserved for UI APIs (snapshot, windows, etc.)
164
- if (fs.existsSync(reactUiDir)) {
165
- app.use("/console", express.static(reactUiDir));
166
- app.get(["/console", "/console/*"], (req, res) => {
167
- res.sendFile(path.join(reactUiDir, "index.html"));
168
- });
169
- } else {
170
- // Fallback: serve legacy UI at /console too
171
- app.get(["/console", "/console/*"], (req, res) => {
172
- res.sendFile(path.join(__dirname, "../ui.html"));
173
- });
174
- }
175
-
176
165
  // Mount UI API routes under /ui
177
166
  app.use("/ui", uiRoutes);
178
167
 
179
- // Convenience redirect
180
- app.get("/", (req, res) => res.redirect("/console/chrome"));
168
+ // Root → the remaining legacy debug UI.
169
+ app.get("/", (req, res) => res.redirect("/ui-legacy"));
181
170
 
182
171
  return app;
183
172
  }
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const log = require("electron-log");
2
5
  const path = require("path");
3
6
  const fs = require("fs");
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const { McpServer } = require("@modelcontextprotocol/sdk/server/mcp.js");
2
5
  const { SSEServerTransport } = require("@modelcontextprotocol/sdk/server/sse.js");
3
6
  const log = require("electron-log");
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  function buildToolCatalog(toolModules) {
2
5
  const toolsByName = new Map();
3
6
  const toolsByTag = {};
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const { loadToolCatalog } = require("./tool-catalog");
2
5
 
3
6
  function getToolRecord(name) {
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const { z } = require("zod");
2
5
 
3
6
  function zodToJsonSchema(zodSchema) {
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const express = require("express");
2
5
  const { BrowserWindow } = require("electron");
3
6
  const router = express.Router();
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const express = require("express");
2
5
 
3
6
  function toPublicSnapshot(snapshot) {
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Discover / probe / spawn the cicy-code daemon for the Electron app.
2
5
  //
3
6
  // Principle (2026-06): the daemon is run via `npx cicy-code` — a single
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Docker-版 cicy-code on macOS via Colima (Lima 轻量 VM + Docker 引擎).
2
5
  //
3
6
  // macOS 没有 WSL。对应 Windows 端「不装 Docker Desktop GUI、用确定性命令驱动
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Windows sidecar backend: run cicy-code inside a Docker container.
2
5
  //
3
6
  // Platform split (2026-06): mac/linux start cicy-code locally via `npx