cicy-desktop 2.1.235 → 2.1.236

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 (130) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +4 -0
  3. package/README.md +1 -1
  4. package/generate-openapi.js +3 -0
  5. package/jest.config.js +3 -0
  6. package/jest.setup.global.js +3 -0
  7. package/jest.teardown.global.js +3 -0
  8. package/package.json +4 -4
  9. package/scripts/build-homepage.cjs +3 -0
  10. package/scripts/sync-runtime-deps.cjs +3 -0
  11. package/src/app-updater.js +3 -0
  12. package/src/backends/auth-email.js +3 -0
  13. package/src/backends/auth-loopback.js +3 -0
  14. package/src/backends/homepage-preload.js +3 -0
  15. package/src/backends/homepage-window.js +3 -0
  16. package/src/backends/ipc.js +3 -0
  17. package/src/backends/local-teams.js +3 -0
  18. package/src/backends/open-external.js +3 -0
  19. package/src/backends/poller.js +3 -0
  20. package/src/backends/registry.js +3 -0
  21. package/src/backends/sidecar-ipc.js +3 -0
  22. package/src/backends/updater.js +3 -0
  23. package/src/backends/webview-preload.js +3 -0
  24. package/src/backends/window-manager.js +3 -0
  25. package/src/backends/window-tracker.js +3 -0
  26. package/src/chrome/chrome-cdp-client.js +3 -0
  27. package/src/chrome/chrome-launcher.js +3 -0
  28. package/src/chrome/debugger-port-resolver.js +3 -0
  29. package/src/chrome/runtime-registry.js +3 -0
  30. package/src/cli/rpc.js +3 -0
  31. package/src/cloud/cloud-client.js +3 -0
  32. package/src/cluster/local-agent-registry.js +3 -0
  33. package/src/cluster/remote-executor.js +3 -0
  34. package/src/cluster/types.js +3 -0
  35. package/src/cluster/worker-client.js +3 -0
  36. package/src/cluster/worker-identity.js +3 -0
  37. package/src/config.js +3 -0
  38. package/src/extension/inject.js +3 -0
  39. package/src/i18n/index.js +3 -0
  40. package/src/main-old.js +3 -0
  41. package/src/main.js +3 -0
  42. package/src/master/agent-index.js +3 -0
  43. package/src/master/chrome-config.js +3 -0
  44. package/src/master/master-admin-routes.js +3 -0
  45. package/src/master/master-main.js +3 -0
  46. package/src/master/master-metrics.js +3 -0
  47. package/src/master/master-routes.js +3 -0
  48. package/src/master/master-token-manager.js +3 -0
  49. package/src/master/session-affinity-store.js +3 -0
  50. package/src/master/task-scheduler.js +3 -0
  51. package/src/master/task-store.js +3 -0
  52. package/src/master/worker-inventory.js +3 -0
  53. package/src/master/worker-registry.js +3 -0
  54. package/src/preload-rpc.js +3 -0
  55. package/src/profiles/profile-store.js +3 -0
  56. package/src/profiles/trusted-origins-store.js +3 -0
  57. package/src/server/args-parser.js +3 -0
  58. package/src/server/chrome-management-routes.js +3 -0
  59. package/src/server/chrome-proxy-routes.js +3 -0
  60. package/src/server/electron-setup.js +3 -0
  61. package/src/server/express-app.js +3 -0
  62. package/src/server/logging.js +3 -0
  63. package/src/server/mcp-server.js +3 -0
  64. package/src/server/tool-catalog.js +3 -0
  65. package/src/server/tool-executor.js +3 -0
  66. package/src/server/tool-registry.js +3 -0
  67. package/src/server/ui-routes.js +3 -0
  68. package/src/server/worker-observability-routes.js +3 -0
  69. package/src/sidecar/cicy-code.js +3 -0
  70. package/src/sidecar/colima-docker.js +3 -0
  71. package/src/sidecar/docker.js +3 -0
  72. package/src/sidecar/host-mihomo.js +3 -0
  73. package/src/sidecar/localbin.js +3 -0
  74. package/src/sidecar/mirrors.js +3 -0
  75. package/src/sidecar/native.js +3 -0
  76. package/src/sidecar/net-detect.js +3 -0
  77. package/src/sidecar/runtime.js +3 -0
  78. package/src/sidecar/version.js +3 -0
  79. package/src/sidecar/wsl-docker.js +3 -0
  80. package/src/tabbrowser/newtab-protocol.js +3 -0
  81. package/src/tabbrowser/tab-shell-preload.js +3 -0
  82. package/src/tools/account-tools.js +3 -0
  83. package/src/tools/automation-tools.js +3 -0
  84. package/src/tools/cdp-tools.js +3 -0
  85. package/src/tools/chrome-tools.js +3 -0
  86. package/src/tools/clipboard-tools.js +3 -0
  87. package/src/tools/desktop-snapshot-tools.js +3 -0
  88. package/src/tools/device-tools.js +3 -0
  89. package/src/tools/download-tools.js +3 -0
  90. package/src/tools/exec-js.js +3 -0
  91. package/src/tools/exec-tools.js +3 -0
  92. package/src/tools/file-tools.js +3 -0
  93. package/src/tools/hook-chatgpt.js +3 -0
  94. package/src/tools/hook-gemini.js +3 -0
  95. package/src/tools/index.js +3 -0
  96. package/src/tools/ipc-bridge.js +3 -0
  97. package/src/tools/list-tools.js +3 -0
  98. package/src/tools/ping.js +3 -0
  99. package/src/tools/r-reset.js +3 -0
  100. package/src/tools/screenshot-tools.js +3 -0
  101. package/src/tools/system-tools.js +3 -0
  102. package/src/tools/tab-browser-tools.js +3 -0
  103. package/src/tools/window-tools.js +3 -0
  104. package/src/tray.js +3 -0
  105. package/src/utils/app-icon.js +3 -0
  106. package/src/utils/auth.js +3 -0
  107. package/src/utils/brand-host-electron.js +3 -0
  108. package/src/utils/cdp-utils.js +3 -0
  109. package/src/utils/context-menu-options.js +3 -0
  110. package/src/utils/cookie-logins.js +3 -0
  111. package/src/utils/desktop-snapshot.js +3 -0
  112. package/src/utils/download-manager.js +3 -0
  113. package/src/utils/global-json.js +3 -0
  114. package/src/utils/ip-probe.js +3 -0
  115. package/src/utils/process-utils.js +3 -0
  116. package/src/utils/rpc-audit.js +3 -0
  117. package/src/utils/rpc-guard.js +3 -0
  118. package/src/utils/snapshot-utils.js +3 -0
  119. package/src/utils/window-monitor.js +3 -0
  120. package/src/utils/window-registry.js +3 -0
  121. package/src/utils/window-state.js +3 -0
  122. package/src/utils/window-thumbnails.js +3 -0
  123. package/src/utils/window-utils.js +3 -0
  124. package/workers/render/package-lock.json +1 -0
  125. package/workers/render/package.json +2 -1
  126. package/workers/render/src/App.jsx +3 -0
  127. package/workers/render/src/main.jsx +3 -0
  128. package/workers/render/src/mdLite.js +3 -0
  129. package/workers/render/src/termsText.js +3 -0
  130. package/workers/render/vite.config.js +3 -0
@@ -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,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 cors = require("cors");
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 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
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Host-side mihomo for the Chrome per-profile proxy.
2
5
  //
3
6
  // docker-only put mihomo INSIDE the cicy-code container. But the system Chrome
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // ~/.local/bin install model for the binaries cicy-desktop OWNS.
2
5
  //
3
6
  // (2026-06): cicy-desktop OWNS its runtime binaries and distributes
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Shared GitHub mirror registry for CN-network downloads.
2
5
  //
3
6
  // Mirror strategies:
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Windows NATIVE sidecar backend: run cicy-code.exe directly — no Docker, no
2
5
  // WSL. (2026-06 方向变更: the Docker route in docker.js is transitional and
3
6
  // being retired; this module replaces it once stable.)
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Detect whether the host is on the China mainland network.
2
5
  // Strategy:
3
6
  // - Probe both google.com (typically blocked in CN) and baidu.com (typically reachable in CN).
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Runtime Bundle v1 — versioned component store for everything cicy-desktop
2
5
  // runs locally (cicy-code, mihomo).
3
6
  //
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // cicy-code 版本的唯一读法。三个概念一个模块,别处不准再自己解析 /api/health、
2
5
  // 也不准再直连 npm 拿版本("拿版本就一个方法")。
3
6
  // running(port) → 活着的 daemon 在 /api/health 报的版本(“正在跑什么”的唯一真相)
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Docker-版 cicy-code via WSL2 + Ubuntu + Docker Engine (选定方案 A).
2
5
  //
3
6
  // Instead of the heavy/fragile Docker Desktop GUI install, we run Docker Engine
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // cicyui://newtab — the tab browser's start page, served via a custom scheme so a
2
5
  // new tab's URL is a clean "cicyui://newtab" instead of a giant inline data: URL
3
6
  // (url 不要那串 data: 天书). Chrome's chrome://newtab analog.
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Preload for the BrowserView tab-browser shell (tab strip + toolbar).
2
5
  // Exposes window.tabAPI so the chrome UI drives the main-process TabManager,
3
6
  // and receives tab state pushes. Tabs themselves are BrowserViews (managed in
@@ -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 os = require("os");
@@ -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 { z } = require("zod");
3
6
 
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const { BrowserWindow, clipboard } = require("electron");
2
5
  const { z } = require("zod");
3
6
  const { sendCDP } = require("../utils/cdp-utils");
@@ -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
  const fs = require("fs");
3
6
  const os = require("os");
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const { clipboard, BrowserWindow } = require("electron");
2
5
  const { z } = require("zod");
3
6
  const { sendCDP } = require("../utils/cdp-utils");
@@ -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
  const fs = require("fs");
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 { z } = require("zod");
2
5
 
3
6
  // get_device_info — return this machine's identity + detected network/locale
@@ -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
  const downloadManager = require("../utils/download-manager");
3
6
 
@@ -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 { z } = require("zod");
3
6
 
@@ -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
  const { exec } = require("child_process");
3
6
  const util = require("util");
@@ -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
  const fs = require("fs");
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 { BrowserWindow } = require("electron");
2
5
  const { z } = require("zod");
3
6
  const { sendCDP } = require("../utils/cdp-utils");
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const { BrowserWindow, clipboard, nativeImage } = require("electron");
2
5
  const { z } = require("zod");
3
6
  const { sendCDP } = require("../utils/cdp-utils");
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // 统一导出所有工具模块,支持热重载
2
5
 
3
6
  module.exports = [
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const { ipcMain, BrowserWindow } = require("electron");
2
5
  const { createWindow } = require("../utils/window-utils");
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
  const { z } = require("zod");
2
5
  const { loadToolCatalog } = require("../server/tool-catalog");
3
6
  const { zodToJsonSchema } = require("../server/tool-registry");
package/src/tools/ping.js CHANGED
@@ -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
  const { updateGlobalConfig } = require("../utils/global-json");
3
6
 
@@ -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
  module.exports = (registerTool) => {
@@ -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 { z } = require("zod");
3
6
  const { captureSnapshot } = require("../snapshot-utils");
@@ -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
  const { execSync } = require("child_process");
3
6
 
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // tab-browser-tools.js — Chrome-like tabbed browser, one window per profile,
2
5
  // built on BrowserView tabs (NOT <webview>), so each tab is a full webContents
3
6
  // that can itself host <webview> (the cicy-code team app's artifact frame, the
@@ -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 log = require("electron-log");
3
6
  const { z } = require("zod");
package/src/tray.js CHANGED
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Tray icon (macOS menu bar / Windows + Linux system tray) and macOS dock icon.
2
5
  // Loaded once after app.whenReady(). Resources live in build/ alongside the
3
6
  // platform installer icons; we ship them via electron-builder's `extraResources`
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Resolve the bundled app icon for BrowserWindow({ icon }).
2
5
  //
3
6
  // When cicy-desktop runs UNPACKAGED (npx / npm i -g — the mac/win/linux default,
package/src/utils/auth.js CHANGED
@@ -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
  // Rebrand the HOST (unpackaged) Electron bundle so cicy-desktop presents as
2
5
  // "CiCy Desktop" at the OS level — menu-bar app name, Cmd-Tab app switcher,
3
6
  // Finder, and dock — instead of the stock "Electron".
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  async function sendCDP(webContents, method, params = {}) {
2
5
  if (!webContents.debugger.isAttached()) {
3
6
  webContents.debugger.attach("1.3");
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Shared electron-context-menu (ecm) config + a universal attach helper so the
2
5
  // SAME i18n'd right-click menu — 重新加载 / 复制 / 粘贴 / 检查元素(DevTools)— applies to
3
6
  // EVERY surface: the tab-browser SHELL window (host/"BaseWindow"), BrowserView
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Shared "which sites is this session logged into?" summarizer for BOTH backends.
2
5
  //
3
6
  // Input: an array of cookies, each with at least { name, domain }. Both
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // desktop-snapshot.js
2
5
  // Periodically captures the WHOLE desktop (not a window) to disk so the cloud
3
6
  // (cicy-code) can fetch a recent screen preview by just reading a file — no live
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // 全局下载管理器
2
5
  const downloads = new Map();
3
6
  let downloadIdCounter = 0;
@@ -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
 
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Per-profile egress IP + geo probe. Fetches an IP-info API THROUGH a given
2
5
  // Electron session (so the result reflects that profile's proxy egress), in the
3
6
  // main process via net.request (no browser launch needed). Returns
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const { exec } = require("child_process");
2
5
  const net = require("net");
3
6
  const { promisify } = require("util");
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // RPC audit log — an append-only record of (a) every electronRPC tool call and
2
5
  // (b) every authorization decision (including the TEMPORARY ones — "本次允许" /
3
6
  // "允许一次" / "本页面内允许" — which otherwise live only in memory and leave no
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // RPC capability gate (security hole #3 — "trusted source XSS ≠ RCE").
2
5
  //
3
6
  // The renderer electronRPC bridge can invoke ANY registered tool, including host
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // snapshot-utils.js
2
5
  // Snapshot utilities for CiCy Desktop server
3
6
  // Provides page snapshot capture with screenshots and element references
@@ -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 os = require("os");
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Persistent window registry.
2
5
  //
3
6
  // Background: every window list in the app (get_windows tool, /ui/windows,
@@ -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 os = require("os");
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // window-thumbnails.js
2
5
  // Periodically writes a small JPEG thumbnail of every open BrowserWindow to a
3
6
  // folder — like Chrome's tab thumbnails. On-disk so the homepage / agents can
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  const { app, BrowserWindow, Menu, shell } = require("electron");
2
5
  const { default: contextMenu } = require("electron-context-menu");
3
6
  const contextMenuOptions = require("./context-menu-options");
@@ -7,6 +7,7 @@
7
7
  "": {
8
8
  "name": "cicy-desktop-render",
9
9
  "version": "0.0.1",
10
+ "license": "Apache-2.0",
10
11
  "dependencies": {
11
12
  "react": "^19.0.0",
12
13
  "react-dom": "^19.0.0"
@@ -16,5 +16,6 @@
16
16
  "@vitejs/plugin-react": "^4.3.4",
17
17
  "vite": "^6.0.0",
18
18
  "wrangler": "^3.99.0"
19
- }
19
+ },
20
+ "license": "Apache-2.0"
20
21
  }
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  import { useEffect, useState, useCallback, useMemo, useRef } from "react";
2
5
  import { createPortal } from "react-dom";
3
6
  import "./App.css";
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  import { createRoot } from "react-dom/client";
2
5
  import App from "./App.jsx";
3
6
 
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // Tiny, dependency-free Markdown → HTML renderer for static, TRUSTED content
2
5
  // (the terms-of-use string only). Not a general-purpose/safe renderer — do not
3
6
  // feed user input. Supports: # / ## / ### headings, --- rules, > blockquotes,
@@ -1,3 +1,6 @@
1
+ // Copyright 2026 CiCy AI
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
1
4
  // AUTO-GENERATED from w-10065 terms docs (草案 v0.2). Full terms body for the
2
5
  // first-run gate's '查看完整条款' / 'View full terms'. Both locales now have
3
6
  // the complete counsel-reviewed text.