From 42dff6d8b7fe5d1db6d94594de9a3ddc28cbc438 Mon Sep 17 00:00:00 2001 From: NianLog Date: Sun, 12 Jul 2026 22:05:50 +0800 Subject: [PATCH 01/13] chore: establish v1.5.0 development baseline --- .github/workflows/release.yml | 18 +- .gitignore | 6 + README.md | 110 +- README_CN.md | 112 +- SECURITY_AUDIT_REPORT.md | 79 + package-lock.json | 3293 ++++++----------- package.json | 12 +- requirements-security.txt | 2 + .../services/project-management-service.ts | 1 + .../services/terminal-management-service.ts | 1 + src/main/task-scheduler.ts | 7 +- src/main/utils/command-executor.ts | 1 + src/main/utils/privilege-manager.ts | 169 +- src/proxy-server/package-lock.json | 38 - src/proxy-server/package.json | 2 - src/proxy-server/src/server.ts | 2 - src/renderer/src/styles/components/Config.css | 15 - src/renderer/src/styles/components/Header.css | 10 - src/renderer/src/styles/globals.css | 12 +- tests/unit/main/privilege-manager.spec.ts | 71 + tests/unit/main/task-scheduler.spec.ts | 84 + 21 files changed, 1739 insertions(+), 2306 deletions(-) create mode 100644 SECURITY_AUDIT_REPORT.md create mode 100644 requirements-security.txt create mode 100644 tests/unit/main/privilege-manager.spec.ts create mode 100644 tests/unit/main/task-scheduler.spec.ts diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4dd5bfc..a9ef0a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,10 +28,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 22 cache: npm @@ -40,7 +40,7 @@ jobs: src/proxy-server/package-lock.json - name: Cache Electron binaries - uses: actions/cache@v4 + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: path: | ~\AppData\Local\electron\Cache @@ -73,7 +73,7 @@ jobs: - name: Upload coverage report if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: name: coverage-report-${{ github.ref_name }} path: coverage/ @@ -93,10 +93,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 22 cache: npm @@ -105,7 +105,7 @@ jobs: src/proxy-server/package-lock.json - name: Cache Electron binaries - uses: actions/cache@v4 + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: path: | ~\AppData\Local\electron\Cache @@ -130,7 +130,7 @@ jobs: run: npx electron-builder --win portable zip nsis --publish=never - name: Upload artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: name: windows-release-${{ github.ref_name }} path: | @@ -139,7 +139,7 @@ jobs: if-no-files-found: error - name: Create GitHub Release - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2 with: files: | release/*.exe diff --git a/.gitignore b/.gitignore index e16eca3..5d322d9 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,12 @@ build/Release node_modules/ jspm_packages/ +# Local Python tooling environments +.venv/ + +# Local Semgrep audit artifacts (the reviewed report remains tracked) +.semgrep/ + # Snowpack dependency directory (https://snowpack.dev/) web_modules/ diff --git a/README.md b/README.md index 1a74e1f..3f1d80a 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ English | [简体中文](./README_CN.md) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -[![Electron](https://img.shields.io/badge/Electron-40.0.0-47848F?logo=electron)](https://www.electronjs.org/) -[![React](https://img.shields.io/badge/React-18.2.0-61DAFB?logo=react)](https://react.dev/) -[![TypeScript](https://img.shields.io/badge/TypeScript-5.3.0-3178C6?logo=typescript)](https://www.typescriptlang.org/) +[![Electron](https://img.shields.io/badge/Electron-40.10.6-47848F?logo=electron)](https://www.electronjs.org/) +[![React](https://img.shields.io/badge/React-18.3.1-61DAFB?logo=react)](https://react.dev/) +[![TypeScript](https://img.shields.io/badge/TypeScript-5.9.3-3178C6?logo=typescript)](https://www.typescriptlang.org/) @@ -19,6 +19,15 @@ English | [简体中文](./README_CN.md) CCB (Claude Code Butler) is a local-first desktop application built with Electron, React, and TypeScript for managing Claude Code related assets. It centralizes config files, MCP servers, project bindings, automation rules, environment diagnostics, and managed-mode tooling into a single interface so users can edit, validate, preview, switch, and audit their setup without manually chasing files across directories. +### Project Status + +- **Current release baseline**: `1.4.0` +- **Next milestone**: `1.5.0` planning and development preparation +- **Security baseline (2026-07-12)**: Semgrep `0 findings / 0 scan errors`, root and proxy-server npm audits `0 vulnerabilities` +- **Verification baseline**: 65 tests across 10 test files, TypeScript checks, root production build, and proxy-server build passing + +The package version remains `1.4.0` until the `1.5.0` scope, acceptance criteria, and release plan are finalized. See [SECURITY_AUDIT_REPORT.md](./SECURITY_AUDIT_REPORT.md) for the latest audit evidence and accepted trust boundaries. + ### ✨ Key Features - 🎯 **Config Lifecycle Management** @@ -89,8 +98,9 @@ CCB (Claude Code Butler) is a local-first desktop application built with Electro ### Requirements -- Node.js >= 20.0.9 -- npm >= 9.0.0 +- Node.js >= 20.19.0 (Node.js 22 LTS recommended) +- npm >= 10.0.0 +- Python >= 3.10 only when running the local Semgrep audit ### Installation @@ -101,8 +111,11 @@ git clone https://github.com/NianLog/ClaudeCodeButler.git # Navigate to project directory cd ClaudeCodeButler -# Install dependencies -npm install +# Install locked application dependencies +npm ci + +# Install the standalone proxy-server dependencies +npm ci --prefix src/proxy-server ``` ### Development Mode @@ -124,8 +137,12 @@ npm run build # Type-check npm run type-check -# Run tests -npm test +# Run tests once (non-watch mode) +npm run test -- --run + +# Audit root and proxy-server dependencies +npm audit --audit-level=low +npm audit --audit-level=low --prefix src/proxy-server # Launch the built app npm start @@ -186,18 +203,18 @@ npm run dist:all ### Application runtime -- **Electron**: 40.0.0 +- **Electron**: 40.10.6 - **electron-vite**: 5.0.0 -- **Vite**: 7.3.1 -- **TypeScript**: 5.3 +- **Vite**: 7.3.6 +- **TypeScript**: 5.9.3 ### Renderer -- **React**: 18.2 -- **Ant Design**: 5.12 -- **Zustand**: 4.4 +- **React**: 18.3.1 +- **Ant Design**: 5.27.6 +- **Zustand**: 4.5.7 - **Monaco Editor**: 0.55.1 via `@monaco-editor/react` 4.7 -- **Recharts**: 2.8 +- **Recharts**: 2.15.4 - **react-markdown**: 9.1 - **react-syntax-highlighter**: 16.1 - **remark-gfm**: 4.0.1 @@ -205,18 +222,19 @@ npm run dist:all ### Main process & services - **Express**: 5.1.0 -- **Axios**: 1.12.2 -- **Chokidar**: 3.5.3 -- **node-cron**: 3.0.3 -- **js-yaml**: 4.1.1 -- **uuid**: 9.0.0 +- **Axios**: 1.18.0 +- **Chokidar**: 3.6.0 +- **node-cron**: 4.6.0 +- **js-yaml**: 4.3.0 +- **uuid**: 14.0.1 ### Tooling & quality gates -- **Vitest**: 4.0.17 -- **ESLint**: 8.57 -- **electron-builder**: 26.5.0 -- **patch-package**: 8.0.0 +- **Vitest**: 4.1.10 +- **ESLint**: 8.57.1 +- **electron-builder**: 26.15.3 +- **patch-package**: 8.0.1 +- **Semgrep CLI**: 1.169.0 (isolated in the root `.venv`) --- @@ -282,7 +300,9 @@ npm run preview # Quality gates npm run type-check npm run lint -npm test +npm run test -- --run +npm audit --audit-level=low +npm audit --audit-level=low --prefix src/proxy-server # Packaging npm run pack @@ -297,6 +317,32 @@ npm run pack:dir - `@/` → `src/renderer/src/` - `@shared/*` → `src/shared/*` +### Local Security Audit (Windows Git Bash) + +Semgrep is isolated from the Node.js toolchain in the root `.venv`. Recreate and run the audited rulesets with: + +```bash +python -m venv .venv +source .venv/Scripts/activate +python -m pip install --upgrade pip +python -m pip install -r requirements-security.txt + +semgrep scan \ + --config p/security-audit \ + --config p/owasp-top-ten \ + --config p/javascript \ + --exclude-rule javascript.crypto-js.cryptojs-weak-algorithm.cryptojs-weak-algorithm \ + --exclude-rule javascript.koa.web.cors-default-config-koa.cors-default-config-koa \ + --exclude-rule javascript.express.web.cors-default-config-express.cors-default-config-express \ + --timeout 60 \ + --timeout-threshold 3 \ + --json-output .semgrep/security-audit.json \ + --sarif-output .semgrep/security-audit.sarif \ + . +``` + +The three excluded registry rules require the Semgrep Pro engine. Their corresponding CryptoJS, Koa, and Express CORS cases were manually reviewed; details and the exact rationale are retained in [SECURITY_AUDIT_REPORT.md](./SECURITY_AUDIT_REPORT.md). + ### Notes for contributors - Renderer-only dependencies are intentionally kept out of runtime `dependencies` where possible to reduce packaged size. @@ -307,6 +353,18 @@ npm run pack:dir ## 🆕 Recent Product Updates +### 2026-07-12 Security and quality baseline + +- Parameterized privilege elevation with `execFile`, executable allowlists, and platform-specific escaping; elevation confirmation now fails closed. +- GitHub Actions are pinned to full commit SHAs to reduce mutable-tag supply-chain risk. +- Removed default-open CORS from the local proxy server and removed the unused CORS dependencies. +- Updated security-sensitive dependencies; root and proxy-server npm audits now report 0 vulnerabilities. +- Migrated scheduling to node-cron 4 `createTask` semantics and added regression coverage for enabled/disabled rules. +- Restored component CSS imports to the production bundle and removed invalid orphaned style fragments exposed by PostCSS validation. +- Added a reproducible Semgrep environment, raw JSON/SARIF output workflow, and a maintained security audit report. + +### Product experience updates + - Added a customizable default template for new configs in `Settings -> Editor Settings`. - Reworked template preview so it opens in a modal and reuses the same editor capabilities for validation and formatting. - Fixed config copy behavior to open an editor with a localized copy suffix and defer file creation until explicit save. diff --git a/README_CN.md b/README_CN.md index d22efe8..e964cf5 100644 --- a/README_CN.md +++ b/README_CN.md @@ -7,9 +7,11 @@ [English](./README.md) | 简体中文 [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -[![Electron](https://img.shields.io/badge/Electron-40.0.0-47848F?logo=electron)](https://www.electronjs.org/) -[![React](https://img.shields.io/badge/React-18.2.0-61DAFB?logo=react)](https://react.dev/) -[![TypeScript](https://img.shields.io/badge/TypeScript-5.3.0-3178C6?logo=typescript)](https://www.typescriptlang.org/) +[![Electron](https://img.shields.io/badge/Electron-40.10.6-47848F?logo=electron)](https://www.electronjs.org/) +[![React](https://img.shields.io/badge/React-18.3.1-61DAFB?logo=react)](https://react.dev/) +[![TypeScript](https://img.shields.io/badge/TypeScript-5.9.3-3178C6?logo=typescript)](https://www.typescriptlang.org/) + + --- @@ -17,6 +19,15 @@ CCB (Claude Code Butler) 是一个基于 Electron、React 和 TypeScript 构建的本地优先桌面应用,用于统一管理 Claude Code 相关配置资产。它把配置文件、MCP 服务器、项目绑定、自动化规则、环境诊断以及托管模式工具集中到同一个界面中,方便用户在图形界面内完成编辑、校验、预览、切换与审计,而不需要手工在多个目录里来回处理文件。 +### 项目状态 + +- **当前发布基线**:`1.4.0` +- **下一里程碑**:`1.5.0` 规划与开发准备阶段 +- **安全基线(2026-07-12)**:Semgrep `0 findings / 0 scan errors`,root 与 proxy-server npm audit 均为 `0 vulnerabilities` +- **验证基线**:10 个测试文件共 65 项测试、TypeScript 检查、root production build 与 proxy-server build 全部通过 + +在 `1.5.0` 的范围、验收标准与发布计划确认前,package version 继续保持 `1.4.0`,避免把开发目标误标为已发布版本。最新审计证据与已接受的信任边界见 [SECURITY_AUDIT_REPORT.md](./SECURITY_AUDIT_REPORT.md)。 + ### ✨ 核心功能 - 🎯 **配置全生命周期管理** @@ -87,8 +98,9 @@ CCB (Claude Code Butler) 是一个基于 Electron、React 和 TypeScript 构建 ### 环境要求 -- Node.js >= 20.0.9 -- npm >= 9.0.0 +- Node.js >= 20.19.0(推荐 Node.js 22 LTS) +- npm >= 10.0.0 +- 仅在执行本地 Semgrep 审计时需要 Python >= 3.10 ### 安装 @@ -99,8 +111,11 @@ git clone https://github.com/NianLog/ClaudeCodeButler.git # 进入项目目录 cd ClaudeCodeButler -# 安装依赖 -npm install +# 按 lockfile 安装应用依赖 +npm ci + +# 安装独立 proxy-server 依赖 +npm ci --prefix src/proxy-server ``` ### 开发模式 @@ -122,8 +137,12 @@ npm run build # 类型检查 npm run type-check -# 运行测试 -npm test +# 单次运行测试(非 watch 模式) +npm run test -- --run + +# 审计 root 与 proxy-server 依赖 +npm audit --audit-level=low +npm audit --audit-level=low --prefix src/proxy-server # 启动构建后的应用 npm start @@ -184,18 +203,18 @@ npm run dist:all ### 应用运行时 -- **Electron**: 40.0.0 +- **Electron**: 40.10.6 - **electron-vite**: 5.0.0 -- **Vite**: 7.3.1 -- **TypeScript**: 5.3 +- **Vite**: 7.3.6 +- **TypeScript**: 5.9.3 ### 渲染层 -- **React**: 18.2 -- **Ant Design**: 5.12 -- **Zustand**: 4.4 +- **React**: 18.3.1 +- **Ant Design**: 5.27.6 +- **Zustand**: 4.5.7 - **Monaco Editor**: 0.55.1,搭配 `@monaco-editor/react` 4.7 -- **Recharts**: 2.8 +- **Recharts**: 2.15.4 - **react-markdown**: 9.1 - **react-syntax-highlighter**: 16.1 - **remark-gfm**: 4.0.1 @@ -203,18 +222,19 @@ npm run dist:all ### 主进程与服务层 - **Express**: 5.1.0 -- **Axios**: 1.12.2 -- **Chokidar**: 3.5.3 -- **node-cron**: 3.0.3 -- **js-yaml**: 4.1.1 -- **uuid**: 9.0.0 +- **Axios**: 1.18.0 +- **Chokidar**: 3.6.0 +- **node-cron**: 4.6.0 +- **js-yaml**: 4.3.0 +- **uuid**: 14.0.1 ### 工具链与质量保障 -- **Vitest**: 4.0.17 -- **ESLint**: 8.57 -- **electron-builder**: 26.5.0 -- **patch-package**: 8.0.0 +- **Vitest**: 4.1.10 +- **ESLint**: 8.57.1 +- **electron-builder**: 26.15.3 +- **patch-package**: 8.0.1 +- **Semgrep CLI**: 1.169.0(隔离安装在 root `.venv`) --- @@ -280,7 +300,9 @@ npm run preview # 质量检查 npm run type-check npm run lint -npm test +npm run test -- --run +npm audit --audit-level=low +npm audit --audit-level=low --prefix src/proxy-server # 打包 npm run pack @@ -295,6 +317,32 @@ npm run pack:dir - `@/` → `src/renderer/src/` - `@shared/*` → `src/shared/*` +### 本地安全审计(Windows Git Bash) + +Semgrep 与 Node.js 工具链隔离,安装在 root `.venv`。可通过以下命令重建环境并运行本次审计使用的 rulesets: + +```bash +python -m venv .venv +source .venv/Scripts/activate +python -m pip install --upgrade pip +python -m pip install -r requirements-security.txt + +semgrep scan \ + --config p/security-audit \ + --config p/owasp-top-ten \ + --config p/javascript \ + --exclude-rule javascript.crypto-js.cryptojs-weak-algorithm.cryptojs-weak-algorithm \ + --exclude-rule javascript.koa.web.cors-default-config-koa.cors-default-config-koa \ + --exclude-rule javascript.express.web.cors-default-config-express.cors-default-config-express \ + --timeout 60 \ + --timeout-threshold 3 \ + --json-output .semgrep/security-audit.json \ + --sarif-output .semgrep/security-audit.sarif \ + . +``` + +上述 3 条被排除的 registry rules 依赖 Semgrep Pro engine;对应的 CryptoJS、Koa 与 Express CORS 场景已执行人工补偿检查。完整原因与审计记录保存在 [SECURITY_AUDIT_REPORT.md](./SECURITY_AUDIT_REPORT.md)。 + ### 开发注意事项 - 仅用于渲染层打包的依赖会尽量保留在非运行时依赖范围,减少最终包体积。 @@ -305,6 +353,18 @@ npm run pack:dir ## 🆕 最近更新 +### 2026-07-12 安全与质量基线 + +- 权限提升改为 `execFile` 参数化执行,增加 executable allowlist 与平台级 escaping;权限确认异常时默认拒绝。 +- GitHub Actions 固定为完整 commit SHA,降低 mutable tag 带来的供应链风险。 +- 移除本地 proxy server 默认全开放的 CORS,并清理不再使用的 CORS dependencies。 +- 更新安全相关 dependencies,root 与 proxy-server npm audit 均降至 0 vulnerabilities。 +- 迁移至 node-cron 4 的 `createTask` 语义,并补充 enabled/disabled rule 回归测试。 +- 恢复 production bundle 中的组件 CSS imports,并清理 PostCSS 检查发现的残缺无效样式片段。 +- 增加可复现的 Semgrep 虚拟环境、JSON/SARIF 原始结果流程与持续维护的安全审计报告。 + +### 产品体验更新 + - 新增“新建配置默认模板”,可在 `设置 -> 编辑器设置` 中编辑、保存和弹窗预览。 - 模板预览改为弹窗方式,并复用同一套编辑器能力进行格式化与校验。 - 修复了复制配置逻辑,现在会先打开预填编辑器并添加国际化副本后缀,仅在显式保存后才创建新文件。 diff --git a/SECURITY_AUDIT_REPORT.md b/SECURITY_AUDIT_REPORT.md new file mode 100644 index 0000000..68e173f --- /dev/null +++ b/SECURITY_AUDIT_REPORT.md @@ -0,0 +1,79 @@ +# Semgrep 安全审计与改进报告 + +## 审计记录 + +### 2026-07-12:首次基线审计与整改 + +#### 范围与工具 + +- 仓库:`ClaudeCodeButler`,分支 `main` +- 工具:根目录 `.venv` 中的 Semgrep CLI `1.169.0` +- 规则:`p/security-audit`、`p/owasp-top-ten`、`p/javascript` +- 范围:Git tracked application source、scripts、tests 与 GitHub Actions;基线 162 files,加入报告与版本锁定文件后终态 164 files +- 排除:`.venv`、`node_modules`、`out`、`release`、`coverage`、`backup`、`.git` +- 原始结果:本地 `.semgrep/security-audit.json` 与 `.semgrep/security-audit.sarif`,已通过 `.gitignore` 排除 + +#### 基线结果 + +首次扫描运行 372 条适用规则,得到 16 个 findings: + +| 类别 | 数量 | 研判 | 处置 | +| --- | ---: | --- | --- | +| GitHub Actions mutable action tag | 9 | 真实供应链风险 | 已固定为官方 tag 在审计日对应的 40-character commit SHA | +| `privilege-manager` 动态 `exec` | 3 | 真实 command injection 风险,来自 2 个调用点 | 已改为 `execFile` argument array,并增加 executable allowlist 与跨平台 escaping | +| 受控 `child_process` 边界 | 4 | 规则无法识别既有控制措施 | 逐点复核后使用 rule-specific suppression,并在源码记录信任边界 | +| Express default CORS | 1 | 对应 registry rule 依赖 Pro engine;人工补偿检查确认真实 localhost cross-origin 风险 | 已移除 CORS middleware 与冗余 dependencies | + +首次扫描曾有 1 条规则在大型 locale 文件上 timeout。复扫将单规则 timeout 提高到 60 秒后,162 个 targets 均完成解析,未再发生 timeout。 + +#### 已实施改进 + +1. GitHub Actions 中的 `checkout`、`setup-node`、`cache`、`upload-artifact`、`action-gh-release` 全部固定 commit SHA,并保留版本注释供 Dependabot 或人工更新。 +2. 权限提升执行从 shell string 拼接改为 `execFile(command, args)`;允许的 executable 限制为 `powershell.exe`、`osascript`、`pkexec`、`sudo`。 +3. Windows 使用 PowerShell single-quoted literal escaping;macOS 同时应用 POSIX argument quoting 与 AppleScript string escaping;Linux 保持 argument array,不构造 shell command string。 +4. 同文件的静态权限探测命令一并从 `exec` 改为 `execFile`,防止后续维护重新引入字符串拼接。 +5. 权限确认对话框异常时由默认允许改为默认拒绝,消除 fail-open 行为。 +6. 新增跨平台提权规格回归测试,覆盖 quotes、spaces、command substitution 与 command separator 输入。 +7. 新增 `requirements-security.txt` 锁定 Semgrep 版本;`.venv/` 与 `.semgrep/` 已加入 `.gitignore`。 +8. 移除本地 proxy server 的 default-open CORS。合法调用方均为 Claude CLI 或 Electron IPC,不需要浏览器跨源访问;同时移除 root 与 proxy-server 的 `cors` dependencies。 +9. 补充执行 npm dependency audit:将 Electron/Vite/Vitest 等 transitive packages 更新到现有 semver range 内的修复版本;升级 `node-cron` 4.6.0 与 `uuid` 14.0.1;覆盖 Monaco 固定的旧 DOMPurify 至 3.4.12,并覆盖 brace-expansion 至 2.0.3。 +10. node-cron 4 不再支持 v3 的 `scheduled:false` 语义,`TaskScheduler` 已改用 `createTask`,保持 disabled rule 注册后不自动启动。 +11. dependency 更新后 root audit 从 31 vulnerabilities(2 critical、17 high、10 moderate、2 low)降至 0;proxy-server audit 同样为 0。 +12. production build 暴露出旧 CSS `@import` 顺序错误及两个此前未解析到的残缺 style fragments;已移动 imports、删除无 selector 的无效 declarations,build 不再产生 PostCSS warning。 + +#### 已接受的边界与依据 + +- `command-executor`:`parseCommand` 拒绝 shell metacharacters,执行固定为 `shell:false`,binary 与 args 保持独立。 +- `project-management-service`:launch spec 仅由 class 内私有平台构造器产生,使用 argument array 且不启用 shell。 +- `terminal-management-service`:MCP stdio server 启动探测需要加载用户本地 shell 环境。该能力仅消费用户明确保存的本地 MCP 配置;renderer IPC 使用独立 command allowlist,不提供任意 shell passthrough。 + +以上位置只抑制 `javascript.lang.security.detect-child-process.detect-child-process` 单条规则,没有全局关闭规则。若未来扩大调用来源或移除现有 allowlist/validation,必须删除 suppression 并重新建模该边界。 + +#### 验证结果 + +- Full Vitest:65 tests passed(10 test files) +- TypeScript:`npm run type-check` passed +- Targeted ESLint:passed +- Root production build:passed +- Proxy-server TypeScript build:passed +- Root `npm audit --audit-level=low`:0 vulnerabilities +- Proxy-server `npm audit --audit-level=low`:0 vulnerabilities +- 整改后 Semgrep:相同 rulesets 与 164 targets 完成扫描;3 条 Pro-only rules 由 OSS CLI 明确排除并人工补偿检查,最终 0 unsuppressed findings、0 scan errors、0 timeout + +#### 后续建议 + +1. 在 CI 中使用锁定版本的 Semgrep,并将 SARIF 上传到 GitHub Code Scanning;PR 应只扫描 diff,定时任务执行 full scan。 +2. 启用 Dependabot 更新 pinned action SHA,避免固定 SHA 后长期错过 action security patches。 +3. Semgrep 是 pattern-based SAST,不能替代 dependency、secret 与 runtime audit;应并行保留 `npm audit`、secret scanning 和 Electron security checklist。 +4. MCP 本地配置属于显式信任边界。若未来支持远程同步或共享配置,必须改为 executable allowlist 或用户逐次确认,不能沿用当前 suppression。 +5. Browserslist build metadata 当前提示 `caniuse-lite` 已陈旧 9 个月;应在独立 dependency maintenance PR 中更新并执行 UI/browser compatibility regression,避免把兼容基线变化混入安全修复。 + +#### OSS CLI 规则兼容说明 + +Registry 中以下规则使用 `metavariable-name:module`,Semgrep OSS CLI `1.169.0` 无法执行,未登录 Pro engine 时会对每个 JS/TS target 重复产生 internal matching warning: + +- `javascript.crypto-js.cryptojs-weak-algorithm.cryptojs-weak-algorithm` +- `javascript.koa.web.cors-default-config-koa.cors-default-config-koa` +- `javascript.express.web.cors-default-config-express.cors-default-config-express` + +最终扫描通过 `--exclude-rule` 明确排除这 3 条规则。人工补偿检查确认项目未使用 CryptoJS 或 Koa;Express default CORS 问题已发现并移除。若 CI 后续启用 Semgrep Pro,应移除这些 exclusions 并恢复对应规则。 diff --git a/package-lock.json b/package-lock.json index fed78e0..e547826 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,24 +12,20 @@ "dependencies": { "axios": "^1.13.0", "chokidar": "^3.5.3", - "cors": "^2.8.5", "express": "^5.1.0", "js-yaml": "^4.1.1", - "node-cron": "^3.0.3", - "uuid": "^9.0.0" + "node-cron": "^4.6.0", + "uuid": "^14.0.1" }, "devDependencies": { "@monaco-editor/react": "^4.7.0", - "@types/cors": "^2.8.19", "@types/express": "^5.0.6", "@types/js-yaml": "^4.0.9", "@types/node": "^20.10.0", - "@types/node-cron": "^3.0.11", "@types/react": "^18.2.0", "@types/react-dom": "^18.2.0", "@types/react-syntax-highlighter": "^15.5.13", "@types/react-window": "^1.8.8", - "@types/uuid": "^9.0.0", "@typescript-eslint/eslint-plugin": "^7.7.0", "@typescript-eslint/parser": "^7.7.0", "@vitejs/plugin-react": "^4.2.0", @@ -164,11 +160,13 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.27.1", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.27.1", + "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" }, @@ -177,7 +175,9 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.28.4", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", "dev": true, "license": "MIT", "engines": { @@ -185,19 +185,21 @@ } }, "node_modules/@babel/core": { - "version": "7.28.4", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.27.1", - "@babel/generator": "^7.28.3", - "@babel/helper-compilation-targets": "^7.27.2", - "@babel/helper-module-transforms": "^7.28.3", - "@babel/helpers": "^7.28.4", - "@babel/parser": "^7.28.4", - "@babel/template": "^7.27.2", - "@babel/traverse": "^7.28.4", - "@babel/types": "^7.28.4", + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", @@ -222,12 +224,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.28.3", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz", + "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^7.28.3", - "@babel/types": "^7.28.2", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" @@ -237,12 +241,14 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.27.2", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", "dev": true, "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.27.2", - "@babel/helper-validator-option": "^7.27.1", + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" @@ -253,6 +259,8 @@ }, "node_modules/@babel/helper-compilation-targets/node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { @@ -260,7 +268,9 @@ } }, "node_modules/@babel/helper-globals": { - "version": "7.28.0", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", "dev": true, "license": "MIT", "engines": { @@ -268,25 +278,29 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.27.1", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", "dev": true, "license": "MIT", "dependencies": { - "@babel/traverse": "^7.27.1", - "@babel/types": "^7.27.1" + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.28.3", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.27.1", - "@babel/helper-validator-identifier": "^7.27.1", - "@babel/traverse": "^7.28.3" + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -324,7 +338,9 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.27.1", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", "dev": true, "license": "MIT", "engines": { @@ -332,12 +348,14 @@ } }, "node_modules/@babel/helpers": { - "version": "7.28.4", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz", + "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/template": "^7.27.2", - "@babel/types": "^7.28.4" + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -410,29 +428,33 @@ } }, "node_modules/@babel/template": { - "version": "7.27.2", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.27.1", - "@babel/parser": "^7.27.2", - "@babel/types": "^7.27.1" + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.28.4", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz", + "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.27.1", - "@babel/generator": "^7.28.3", - "@babel/helper-globals": "^7.28.0", - "@babel/parser": "^7.28.4", - "@babel/template": "^7.27.2", - "@babel/types": "^7.28.4", + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7", "debug": "^4.3.1" }, "engines": { @@ -463,22 +485,14 @@ "node": ">=18" } }, - "node_modules/@develar/schema-utils": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/@develar/schema-utils/-/schema-utils-2.6.5.tgz", - "integrity": "sha512-0cp4PsWQ/9avqTVMCtZ+GirikIA36ikvjtHweU4/j8yLtgObI0+JUPhYFScgwlteveGB1rt3Cm8UhN04XayDig==", + "node_modules/@electron-internal/extract-zip": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@electron-internal/extract-zip/-/extract-zip-1.0.4.tgz", + "integrity": "sha512-Zr1Vs7E9tpCNhZHDAbFVXc2gEVCG9RqPDjrno5+bdgB6LRAuvgyMHJut4NCVyYwtAieapMzc3fiQ3CSTi75ARg==", "dev": true, - "license": "MIT", - "dependencies": { - "ajv": "^6.12.0", - "ajv-keywords": "^3.4.1" - }, + "license": "BSD-2-Clause", "engines": { - "node": ">= 8.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" + "node": ">=22.12.0" } }, "node_modules/@electron/asar": { @@ -499,21 +513,10 @@ "node": ">=10.12.0" } }, - "node_modules/@electron/asar/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/@electron/asar/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -554,55 +557,25 @@ "node": ">=10" } }, - "node_modules/@electron/fuses/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/@electron/fuses/node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/@electron/get": { - "version": "2.0.3", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@electron/get/-/get-5.0.0.tgz", + "integrity": "sha512-pjoBpru1KdEtcExBnuHAP1cAc/5faoedw0hzJkL3o4/IJp7HNF1+fbrdxT3gMYRX2oJfvnA/WXeCTVQpYYxyJA==", "dev": true, "license": "MIT", "dependencies": { "debug": "^4.1.1", - "env-paths": "^2.2.0", - "fs-extra": "^8.1.0", - "got": "^11.8.5", + "env-paths": "^3.0.0", + "graceful-fs": "^4.2.11", "progress": "^2.0.3", - "semver": "^6.2.0", + "semver": "^7.6.3", "sumchecker": "^3.0.1" }, "engines": { - "node": ">=12" + "node": ">=22.12.0" }, "optionalDependencies": { - "global-agent": "^3.0.0" - } - }, - "node_modules/@electron/get/node_modules/semver": { - "version": "6.3.1", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" + "undici": "^7.24.4" } }, "node_modules/@electron/notarize": { @@ -636,29 +609,6 @@ "node": ">=10" } }, - "node_modules/@electron/notarize/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/@electron/notarize/node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/@electron/osx-sign": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/@electron/osx-sign/-/osx-sign-1.3.3.tgz", @@ -681,21 +631,6 @@ "node": ">=12.0.0" } }, - "node_modules/@electron/osx-sign/node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/@electron/osx-sign/node_modules/isbinaryfile": { "version": "4.0.10", "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz", @@ -709,49 +644,19 @@ "url": "https://github.com/sponsors/gjtorikian/" } }, - "node_modules/@electron/osx-sign/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/@electron/osx-sign/node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/@electron/rebuild": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@electron/rebuild/-/rebuild-4.0.2.tgz", - "integrity": "sha512-8iZWVPvOpCdIc5Pj5udQV3PeO7liJVC7BBUSizl1HCfP7ZxYc9Kqz0c3PDNj2HQ5cQfJ5JaBeJIYKPjAvLn2Rg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@electron/rebuild/-/rebuild-4.2.0.tgz", + "integrity": "sha512-RKL/O+jGoXJMxrx/5771y1n0xTKmFuOYGO3gMmwypBM6rsH0kou0mswwdXA2JrhIkE4xyC7v9vGk0n6NPzgOxQ==", "dev": true, "license": "MIT", "dependencies": { "@malept/cross-spawn-promise": "^2.0.0", "debug": "^4.1.1", - "detect-libc": "^2.0.1", - "got": "^11.7.0", - "graceful-fs": "^4.2.11", "node-abi": "^4.2.0", "node-api-version": "^0.2.1", - "node-gyp": "^11.2.0", - "ora": "^5.1.0", - "read-binary-file-arch": "^1.0.6", - "semver": "^7.3.5", - "tar": "^6.0.5", - "yargs": "^17.0.1" + "node-gyp": "^12.2.0", + "read-binary-file-arch": "^1.0.6" }, "bin": { "electron-rebuild": "lib/cli.js" @@ -760,108 +665,6 @@ "node": ">=22.12.0" } }, - "node_modules/@electron/rebuild/node_modules/chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/@electron/rebuild/node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "dev": true, - "license": "ISC", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@electron/rebuild/node_modules/fs-minipass/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@electron/rebuild/node_modules/minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "dev": true, - "license": "MIT", - "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@electron/rebuild/node_modules/minizlib/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@electron/rebuild/node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true, - "license": "MIT", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@electron/rebuild/node_modules/tar": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", - "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", - "deprecated": "Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exhorbitant rates) by contacting i@izs.me", - "dev": true, - "license": "ISC", - "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^5.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@electron/rebuild/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true, - "license": "ISC" - }, "node_modules/@electron/universal": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@electron/universal/-/universal-2.0.3.tgz", @@ -882,9 +685,9 @@ } }, "node_modules/@electron/universal/node_modules/fs-extra": { - "version": "11.3.3", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.3.tgz", - "integrity": "sha512-VWSRii4t0AFm6ixFFmLLx1t7wS1gh+ckoa84aOeapGum0h+EZd1EhEumSB+ZdDLnEPuucsVB9oB7cxJHap6Afg==", + "version": "11.3.6", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.6.tgz", + "integrity": "sha512-w8ZNZr2mKIc7qeNaQ9AVPT1+iFaI+Avd4xudVOvdDJ8VytREi1Ft5Ih7hd9jjehod8vAM5GMsfQ/TpPf4EyoEA==", "dev": true, "license": "MIT", "dependencies": { @@ -896,29 +699,6 @@ "node": ">=14.14" } }, - "node_modules/@electron/universal/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/@electron/universal/node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/@electron/windows-sign": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@electron/windows-sign/-/windows-sign-1.2.2.tgz", @@ -942,9 +722,9 @@ } }, "node_modules/@electron/windows-sign/node_modules/fs-extra": { - "version": "11.3.3", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.3.tgz", - "integrity": "sha512-VWSRii4t0AFm6ixFFmLLx1t7wS1gh+ckoa84aOeapGum0h+EZd1EhEumSB+ZdDLnEPuucsVB9oB7cxJHap6Afg==", + "version": "11.3.6", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.6.tgz", + "integrity": "sha512-w8ZNZr2mKIc7qeNaQ9AVPT1+iFaI+Avd4xudVOvdDJ8VytREi1Ft5Ih7hd9jjehod8vAM5GMsfQ/TpPf4EyoEA==", "dev": true, "license": "MIT", "optional": true, @@ -958,33 +738,6 @@ "node": ">=14.14" } }, - "node_modules/@electron/windows-sign/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/@electron/windows-sign/node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/@emotion/hash": { "version": "0.8.0", "dev": true, @@ -1484,17 +1237,10 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { - "version": "1.1.12", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "3.1.2", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -1525,19 +1271,12 @@ "node": ">=10.10.0" } }, - "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { - "version": "1.1.12", + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { - "version": "3.1.2", - "dev": true, - "license": "ISC", + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1562,29 +1301,6 @@ "dev": true, "license": "BSD-3-Clause" }, - "node_modules/@isaacs/balanced-match": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", - "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/@isaacs/brace-expansion": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz", - "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@isaacs/balanced-match": "^4.0.1" - }, - "engines": { - "node": "20 || >=22" - } - }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "dev": true, @@ -1687,16 +1403,6 @@ "node": ">=18.0.0" } }, - "node_modules/@isaacs/fs-minipass/node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.13", "dev": true, @@ -1792,29 +1498,6 @@ "node": ">=10" } }, - "node_modules/@malept/flatpak-bundler/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/@malept/flatpak-bundler/node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/@monaco-editor/loader": { "version": "1.6.1", "dev": true, @@ -1836,6 +1519,19 @@ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, + "node_modules/@noble/hashes": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.2.0.tgz", + "integrity": "sha512-IYqDGiTXab6FniAgnSdZwgWbomxpy9FtYvLKs7wCUs2a8RkITG+DFGO1DM9cr+E3/RgADRpFjrKVaJ1z6sjtEg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "dev": true, @@ -1868,41 +1564,56 @@ "node": ">= 8" } }, - "node_modules/@npmcli/agent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-3.0.0.tgz", - "integrity": "sha512-S79NdEgDQd/NGCay6TCoVzXSj74skRZIKJcpJjC5lOq34SZzyI6MqtiiWoiVWoVrTcGjNeC4ipbh1VIHlpfF5Q==", + "node_modules/@peculiar/asn1-schema": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-2.8.0.tgz", + "integrity": "sha512-7YT0U/ze0tF2QOBbE15gKZwy5tvgGyLRiRHLzhlbOpf7BT032oBSd0haZqXn5W6l26WLlu3dyxzjM+2638/z2Q==", "dev": true, - "license": "ISC", + "license": "MIT", "dependencies": { - "agent-base": "^7.1.0", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.1", - "lru-cache": "^10.0.1", - "socks-proxy-agent": "^8.0.3" + "@peculiar/utils": "^2.0.2", + "asn1js": "^3.0.10", + "tslib": "^2.8.1" + } + }, + "node_modules/@peculiar/json-schema": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/@peculiar/json-schema/-/json-schema-1.1.12.tgz", + "integrity": "sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^2.0.0" }, "engines": { - "node": "^18.17.0 || >=20.5.0" + "node": ">=8.0.0" } }, - "node_modules/@npmcli/agent/node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "node_modules/@peculiar/utils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@peculiar/utils/-/utils-2.0.3.tgz", + "integrity": "sha512-+oL3HPFRIZ1St2K50lWCXiioIgSoxzz7R1J3uF6neO2yl1sgmpgY6XXJH4BdpoDkMWznQTeYF6oWNDZLCdQ4eQ==", "dev": true, - "license": "ISC" + "license": "MIT", + "dependencies": { + "tslib": "^2.8.1" + } }, - "node_modules/@npmcli/fs": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-4.0.0.tgz", - "integrity": "sha512-/xGlezI6xfGO9NwuJlnwz/K14qD1kCSAGtacBHnGzeAIuJGazcp45KP5NuyARXoKb7cwulAGWVsbeSxdG/cb0Q==", + "node_modules/@peculiar/webcrypto": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@peculiar/webcrypto/-/webcrypto-1.7.1.tgz", + "integrity": "sha512-ODOov0sGMJMf3jPonOkgGqPknTsu+DdQ7kD++gz8aI+aFMOMHFbWAA2taqXXVTdP+OTOQR/znGvSpmkeI0WTYQ==", "dev": true, - "license": "ISC", + "license": "MIT", "dependencies": { - "semver": "^7.3.5" + "@peculiar/asn1-schema": "^2.7.0", + "@peculiar/json-schema": "^1.1.12", + "@peculiar/utils": "^2.0.2", + "tslib": "^2.8.1", + "webcrypto-core": "^1.9.2" }, "engines": { - "node": "^18.17.0 || >=20.5.0" + "node": ">=14.18.0" } }, "node_modules/@pkgjs/parseargs": { @@ -2059,9 +1770,9 @@ "license": "MIT" }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.52.5.tgz", - "integrity": "sha512-8c1vW4ocv3UOMp9K+gToY5zL2XiiVw3k7f1ksf4yO1FlDFQ1C2u72iACFnSOceJFsWskc2WZNqeRhFRPzv+wtQ==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.2.tgz", + "integrity": "sha512-6o7ZLZK+BeenkZCFNDXqpbjw9bD6nuWonvS/lwQJp7NoVVxm6p3qE7qQ5jGuBjiFsgvqjD8mZAU5oWxTmbOeOg==", "cpu": [ "arm" ], @@ -2073,9 +1784,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.52.5.tgz", - "integrity": "sha512-mQGfsIEFcu21mvqkEKKu2dYmtuSZOBMmAl5CFlPGLY94Vlcm+zWApK7F/eocsNzp8tKmbeBP8yXyAbx0XHsFNA==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.2.tgz", + "integrity": "sha512-BaH7BllCACHoH1LguOU56UItGfUWjujlO65kS9LAodViaN4bwIKd7oeW/ZHJ/4ljr/7MIiENnNy3HJ0zXv8Zkw==", "cpu": [ "arm64" ], @@ -2087,9 +1798,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.52.5.tgz", - "integrity": "sha512-takF3CR71mCAGA+v794QUZ0b6ZSrgJkArC+gUiG6LB6TQty9T0Mqh3m2ImRBOxS2IeYBo4lKWIieSvnEk2OQWA==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.2.tgz", + "integrity": "sha512-v39RCCvj4He82I9sFmk+M1VZ0PLM9sfsLVikjfx2hYBNALhrrOR2D3JjQA6AhlaSOgcR+RzrKY7e1+bT6SUO/A==", "cpu": [ "arm64" ], @@ -2101,9 +1812,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.52.5.tgz", - "integrity": "sha512-W901Pla8Ya95WpxDn//VF9K9u2JbocwV/v75TE0YIHNTbhqUTv9w4VuQ9MaWlNOkkEfFwkdNhXgcLqPSmHy0fA==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.2.tgz", + "integrity": "sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==", "cpu": [ "x64" ], @@ -2115,9 +1826,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.52.5.tgz", - "integrity": "sha512-QofO7i7JycsYOWxe0GFqhLmF6l1TqBswJMvICnRUjqCx8b47MTo46W8AoeQwiokAx3zVryVnxtBMcGcnX12LvA==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.2.tgz", + "integrity": "sha512-tT4pvt4qXD+vEoezupCWi+a1F0vvDiksiHc+PxRlYTOH1I6/X4id9jPxTP+Fg+545euaFT1jJVs4CEdHZAU1vw==", "cpu": [ "arm64" ], @@ -2129,9 +1840,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.52.5.tgz", - "integrity": "sha512-jr21b/99ew8ujZubPo9skbrItHEIE50WdV86cdSoRkKtmWa+DDr6fu2c/xyRT0F/WazZpam6kk7IHBerSL7LDQ==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.2.tgz", + "integrity": "sha512-6nU5F2wCW+qvCBhTn1pdIU3bzsIoF7EUwsCDRxilWGprQR6yd508YnH9+OKFCwpfS8pjZqDUmnCAr7exax0XCg==", "cpu": [ "x64" ], @@ -2143,13 +1854,16 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.52.5.tgz", - "integrity": "sha512-PsNAbcyv9CcecAUagQefwX8fQn9LQ4nZkpDboBOttmyffnInRy8R8dSg6hxxl2Re5QhHBf6FYIDhIj5v982ATQ==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.2.tgz", + "integrity": "sha512-n1GJHPOvpIfhi3TmrCeh6S6URt9BFCt0KQE3qvexyGCTAKpR4Lg+eWvNZEqu7epxwus/8ElT3hacYEucm49SZg==", "cpu": [ "arm" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2157,13 +1871,16 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.52.5.tgz", - "integrity": "sha512-Fw4tysRutyQc/wwkmcyoqFtJhh0u31K+Q6jYjeicsGJJ7bbEq8LwPWV/w0cnzOqR2m694/Af6hpFayLJZkG2VQ==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.2.tgz", + "integrity": "sha512-JqgflS8wEB+UXV/vS1RpRbifGBeN4D5lz8D8oOFbFZw4vedvdOgCFAjfBmIMdW3yL10XpQQ0Ambepw6MXrhOnA==", "cpu": [ "arm" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -2171,13 +1888,16 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.52.5.tgz", - "integrity": "sha512-a+3wVnAYdQClOTlyapKmyI6BLPAFYs0JM8HRpgYZQO02rMR09ZcV9LbQB+NL6sljzG38869YqThrRnfPMCDtZg==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.2.tgz", + "integrity": "sha512-wnFJkogWvN4jm/hQRF2UBaeUmk20j5+DmHvoyWii2b8HJDyvz1MF2OU/6ynXt2KR63rbZLWkFpoytpdc/yBuSA==", "cpu": [ "arm64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2185,13 +1905,16 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.52.5.tgz", - "integrity": "sha512-AvttBOMwO9Pcuuf7m9PkC1PUIKsfaAJ4AYhy944qeTJgQOqJYJ9oVl2nYgY7Rk0mkbsuOpCAYSs6wLYB2Xiw0Q==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.2.tgz", + "integrity": "sha512-HVu2bp0zhvJ8xHEV9+UUs7S90VadmBSY3LcIMvozbPo4AuMGDWlz3ymHLHZPX4hR67TKTt8Qp5PJ5RBg/i+RMQ==", "cpu": [ "arm64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -2199,13 +1922,33 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.52.5.tgz", - "integrity": "sha512-DkDk8pmXQV2wVrF6oq5tONK6UHLz/XcEVow4JTTerdeV1uqPeHxwcg7aFsfnSm9L+OO8WJsWotKM2JJPMWrQtA==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.2.tgz", + "integrity": "sha512-mQqqAV8QaoSgr9I2fKDLY2BAVvmKjWoGiu/cSYQonsLvtqwEn1E4QYfnCOcp5zoEqNhsDYin1s6jx/VJmrxlZg==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.2.tgz", + "integrity": "sha512-IxKLoxCQ2IWi6bT2akyDUBGsOImDKB+sPp4EsTmwFQ/fMwpCKm8uLSSgP/Kx/QYUgKis6SEZ5/Nlhup0DIA0PQ==", "cpu": [ "loong64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -2213,13 +1956,33 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.52.5.tgz", - "integrity": "sha512-W/b9ZN/U9+hPQVvlGwjzi+Wy4xdoH2I8EjaCkMvzpI7wJUs8sWJ03Rq96jRnHkSrcHTpQe8h5Tg3ZzUPGauvAw==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.2.tgz", + "integrity": "sha512-Mk5ha2RQSgyFfmYYLkBpPnUk8D8FriBxesO1u9O75X0mHgXL1UQcH5Itl2lurWL2tj0RxV9b9tJgipac0hRY9A==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.2.tgz", + "integrity": "sha512-CjvEnqJL/0/TQ3TXX3OPIJ/kmBellrWd4heXUmHeJlTnmwjKpSJzoehLaL6Xk0ZnMHBu9dZuFADNOrtjF4v+2w==", "cpu": [ "ppc64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -2227,13 +1990,16 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.52.5.tgz", - "integrity": "sha512-sjQLr9BW7R/ZiXnQiWPkErNfLMkkWIoCz7YMn27HldKsADEKa5WYdobaa1hmN6slu9oWQbB6/jFpJ+P2IkVrmw==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.2.tgz", + "integrity": "sha512-1SiZbzwdkaDURsew/tSOrooKiYy7EQGT6m8ufavAi9NEyQb/6VuIxFXAL1fqa4iZe3g4NbNk4P7J32z2tw5Mgg==", "cpu": [ "riscv64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2241,13 +2007,16 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.52.5.tgz", - "integrity": "sha512-hq3jU/kGyjXWTvAh2awn8oHroCbrPm8JqM7RUpKjalIRWWXE01CQOf/tUNWNHjmbMHg/hmNCwc/Pz3k1T/j/Lg==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.2.tgz", + "integrity": "sha512-nQts12zJ3NQRoE6uYljOH89v7szzLDvG2JD/vsX+vGXU8w/At1GowTZ5/7qeFQ8m7L55rpR8Okugnuo5bgjy2Q==", "cpu": [ "riscv64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -2255,13 +2024,16 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.52.5.tgz", - "integrity": "sha512-gn8kHOrku8D4NGHMK1Y7NA7INQTRdVOntt1OCYypZPRt6skGbddska44K8iocdpxHTMMNui5oH4elPH4QOLrFQ==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.2.tgz", + "integrity": "sha512-E9/ll019jhPIJgpzfZoIkBGhcz+kKNgVWYRY0zr9srBdPPFVpvOKW8VaJKUbeK+eZXyQF9ltME+Kk6affeaPgg==", "cpu": [ "s390x" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2269,13 +2041,16 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.52.5.tgz", - "integrity": "sha512-hXGLYpdhiNElzN770+H2nlx+jRog8TyynpTVzdlc6bndktjKWyZyiCsuDAlpd+j+W+WNqfcyAWz9HxxIGfZm1Q==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.2.tgz", + "integrity": "sha512-5BqxR/pshjey51iliyzTD5Xi3EN0aLmQ2lZ3lvefVV9c82BvrLo2/6OT55iifpWBufs6kdwWbuOKS841DrmK9A==", "cpu": [ "x64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2283,23 +2058,40 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.52.5.tgz", - "integrity": "sha512-arCGIcuNKjBoKAXD+y7XomR9gY6Mw7HnFBv5Rw7wQRvwYLR7gBAgV7Mb2QTyjXfTveBNFAtPt46/36vV9STLNg==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.2.tgz", + "integrity": "sha512-uNN83XxQrRAh/w0/pmAfibcwyb6YWt4gP+dpnQKPVJshAloQ785ii8CT8ZCIxkGg9opVsvAlGhFitSm6D1Jjpg==", "cpu": [ "x64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ "linux" ] }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.2.tgz", + "integrity": "sha512-srjEIxSH3LRnJN6THczDHWQplqEMFiAJrTab0msUryh9kwNpkICf3Ea6q6MN/2cZwRFUNx5w+h6Hpi4QuHS6Zg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.52.5.tgz", - "integrity": "sha512-QoFqB6+/9Rly/RiPjaomPLmR/13cgkIGfA40LHly9zcH1S0bN2HVFYk3a1eAyHQyjs3ZJYlXvIGtcCs5tko9Cw==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.2.tgz", + "integrity": "sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==", "cpu": [ "arm64" ], @@ -2311,9 +2103,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.52.5.tgz", - "integrity": "sha512-w0cDWVR6MlTstla1cIfOGyl8+qb93FlAVutcor14Gf5Md5ap5ySfQ7R9S/NjNaMLSFdUnKGEasmVnu3lCMqB7w==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.2.tgz", + "integrity": "sha512-mmF4AY1i0hG/bLWUctUq59gtmgaSIRa3cu/A3JFRp/sCNEme2bgDEiDS22P9FbnJB8NJNF4jPJiSP5RHQpUTDg==", "cpu": [ "arm64" ], @@ -2325,9 +2117,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.52.5.tgz", - "integrity": "sha512-Aufdpzp7DpOTULJCuvzqcItSGDH73pF3ko/f+ckJhxQyHtp67rHw3HMNxoIdDMUITJESNE6a8uh4Lo4SLouOUg==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.2.tgz", + "integrity": "sha512-DZgkknc6jhHrk46V25vbAM0zZkyP0nSDkJB8/dRkLTxv470dOmWDqGoEJl/9A0dFfS7yE3REOwNDxpHwSLSt0Q==", "cpu": [ "ia32" ], @@ -2339,7 +2131,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.52.5", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.2.tgz", + "integrity": "sha512-T6xr6ucWSFto+VGajA8YH26LdpHRuP4YLHEKAtCWvJDOlnmWcDZVCI2Jmjr+IFHDlt2zRaTAKE4tfjTaWLgJBg==", "cpu": [ "x64" ], @@ -2351,7 +2145,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.52.5", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.2.tgz", + "integrity": "sha512-BfzEnDJOt9T8M989/lA37EcJgat01wLRnoi5dQf3QzOH7jzpqTAzdDbVfRljVr5r+jzKqpbHeyOfAaXxAd0PAA==", "cpu": [ "x64" ], @@ -2369,6 +2165,8 @@ }, "node_modules/@sindresorhus/is": { "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", "dev": true, "license": "MIT", "engines": { @@ -2387,6 +2185,8 @@ }, "node_modules/@szmarczak/http-timer": { "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", + "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", "dev": true, "license": "MIT", "dependencies": { @@ -2446,6 +2246,8 @@ }, "node_modules/@types/cacheable-request": { "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz", + "integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==", "dev": true, "license": "MIT", "dependencies": { @@ -2476,16 +2278,6 @@ "@types/node": "*" } }, - "node_modules/@types/cors": { - "version": "2.8.19", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.19.tgz", - "integrity": "sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/d3-array": { "version": "3.2.2", "dev": true, @@ -2556,7 +2348,9 @@ "license": "MIT" }, "node_modules/@types/estree": { - "version": "1.0.8", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", "dev": true, "license": "MIT" }, @@ -2612,7 +2406,9 @@ } }, "node_modules/@types/http-cache-semantics": { - "version": "4.0.4", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz", + "integrity": "sha512-L3LgimLHXtGkWikKnsPg0/VFx9OGZaC+eN1u4r+OB1XRqH3meBIAVC2zr1WdMH+RHmnRkqliQAOHNJ/E0j/e0Q==", "dev": true, "license": "MIT" }, @@ -2637,6 +2433,8 @@ }, "node_modules/@types/keyv": { "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", + "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", "dev": true, "license": "MIT", "dependencies": { @@ -2664,23 +2462,6 @@ "undici-types": "~6.21.0" } }, - "node_modules/@types/node-cron": { - "version": "3.0.11", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/plist": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@types/plist/-/plist-3.0.5.tgz", - "integrity": "sha512-E6OCaRmAe4WDmWNsL/9RMqdkkzDCY1etutkflWk4c+AcjDU07Pcz1fQwTX0TQz+Pxqn9i4L1TU3UFpjnrcDgxA==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@types/node": "*", - "xmlbuilder": ">=11.0.1" - } - }, "node_modules/@types/prismjs": { "version": "1.26.5", "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.5.tgz", @@ -2742,6 +2523,8 @@ }, "node_modules/@types/responselike": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", + "integrity": "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==", "dev": true, "license": "MIT", "dependencies": { @@ -2782,28 +2565,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/uuid": { - "version": "9.0.8", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/verror": { - "version": "1.10.11", - "resolved": "https://registry.npmjs.org/@types/verror/-/verror-1.10.11.tgz", - "integrity": "sha512-RlDm9K7+o5stv0Co8i8ZRGxDbrTxhJtgjqjFyVh/tXQyl/rYtTKlnTvZ88oSTeYREWurwx20Js4kTuKCsFkUtg==", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/@types/yauzl": { - "version": "2.10.3", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "7.18.0", "dev": true, @@ -3006,29 +2767,29 @@ } }, "node_modules/@vitest/coverage-v8": { - "version": "4.0.17", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.0.17.tgz", - "integrity": "sha512-/6zU2FLGg0jsd+ePZcwHRy3+WpNTBBhDY56P4JTRqUN/Dp6CvOEa9HrikcQ4KfV2b2kAHUFB4dl1SuocWXSFEw==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.1.10.tgz", + "integrity": "sha512-IM49HmthevbgAO4anp1hwtoT9wYe59w0LR00gr+eagHE+ZJ5lK4sLPeO0ubgoJcwLk6dehU3R24N+FbEEKDc8g==", "dev": true, "license": "MIT", "dependencies": { "@bcoe/v8-coverage": "^1.0.2", - "@vitest/utils": "4.0.17", - "ast-v8-to-istanbul": "^0.3.10", + "@vitest/utils": "4.1.10", + "ast-v8-to-istanbul": "^1.0.0", "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.2.0", - "magicast": "^0.5.1", + "magicast": "^0.5.2", "obug": "^2.1.1", - "std-env": "^3.10.0", - "tinyrainbow": "^3.0.3" + "std-env": "^4.0.0-rc.1", + "tinyrainbow": "^3.1.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "@vitest/browser": "4.0.17", - "vitest": "4.0.17" + "@vitest/browser": "4.1.10", + "vitest": "4.1.10" }, "peerDependenciesMeta": { "@vitest/browser": { @@ -3037,31 +2798,31 @@ } }, "node_modules/@vitest/expect": { - "version": "4.0.17", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.0.17.tgz", - "integrity": "sha512-mEoqP3RqhKlbmUmntNDDCJeTDavDR+fVYkSOw8qRwJFaW/0/5zA9zFeTrHqNtcmwh6j26yMmwx2PqUDPzt5ZAQ==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.10.tgz", + "integrity": "sha512-YsCn+qAk1GWjQOWFEsEcL2gNQ0zmVmQu3T03qP6UyjhtmdtwtbuI+DASn/7iQB3HGTXkdBwGddzxPlmiql5vlA==", "dev": true, "license": "MIT", "dependencies": { - "@standard-schema/spec": "^1.0.0", + "@standard-schema/spec": "^1.1.0", "@types/chai": "^5.2.2", - "@vitest/spy": "4.0.17", - "@vitest/utils": "4.0.17", - "chai": "^6.2.1", - "tinyrainbow": "^3.0.3" + "@vitest/spy": "4.1.10", + "@vitest/utils": "4.1.10", + "chai": "^6.2.2", + "tinyrainbow": "^3.1.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/mocker": { - "version": "4.0.17", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.0.17.tgz", - "integrity": "sha512-+ZtQhLA3lDh1tI2wxe3yMsGzbp7uuJSWBM1iTIKCbppWTSBN09PUC+L+fyNlQApQoR+Ps8twt2pbSSXg2fQVEQ==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.10.tgz", + "integrity": "sha512-v0xaezt+DKEmKfaxg133ldzADrwLGd7Ze1MfQQTYfvs8OqZIwbxyxaYURivwV7sWy5fqn3rH5uOrSp07bp44Ow==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "4.0.17", + "@vitest/spy": "4.1.10", "estree-walker": "^3.0.3", "magic-string": "^0.30.21" }, @@ -3070,7 +2831,7 @@ }, "peerDependencies": { "msw": "^2.4.9", - "vite": "^6.0.0 || ^7.0.0-0" + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "msw": { @@ -3082,26 +2843,26 @@ } }, "node_modules/@vitest/pretty-format": { - "version": "4.0.17", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.0.17.tgz", - "integrity": "sha512-Ah3VAYmjcEdHg6+MwFE17qyLqBHZ+ni2ScKCiW2XrlSBV4H3Z7vYfPfz7CWQ33gyu76oc0Ai36+kgLU3rfF4nw==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.10.tgz", + "integrity": "sha512-W1HsjSH4MXQ9YfmmhLAoIYf1HRfekQCGngeIgcei6MP5QQGWUe0gkopdZQaVCFO+JDJMrAJGwa5pRpNpvy4P8Q==", "dev": true, "license": "MIT", "dependencies": { - "tinyrainbow": "^3.0.3" + "tinyrainbow": "^3.1.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/runner": { - "version": "4.0.17", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.0.17.tgz", - "integrity": "sha512-JmuQyf8aMWoo/LmNFppdpkfRVHJcsgzkbCA+/Bk7VfNH7RE6Ut2qxegeyx2j3ojtJtKIbIGy3h+KxGfYfk28YQ==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.10.tgz", + "integrity": "sha512-IKI6kpIH+LmpROplyLwBBaCfMgOZOMsygVa6BARD6ahA04VRuJSa6OaVG7kRvSEMD870Vd91rSSw0eegtWyLGg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "4.0.17", + "@vitest/utils": "4.1.10", "pathe": "^2.0.3" }, "funding": { @@ -3109,13 +2870,14 @@ } }, "node_modules/@vitest/snapshot": { - "version": "4.0.17", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.0.17.tgz", - "integrity": "sha512-npPelD7oyL+YQM2gbIYvlavlMVWUfNNGZPcu0aEUQXt7FXTuqhmgiYupPnAanhKvyP6Srs2pIbWo30K0RbDtRQ==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.10.tgz", + "integrity": "sha512-xRkfOT1qpTAi/Ti4Y1LtfRc3kEuqxGw59eN2jN9pRWMtS/XDevekhcFSqvQqjUNGksfjMJu3Y+oJ+4Ypn2OaJw==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "4.0.17", + "@vitest/pretty-format": "4.1.10", + "@vitest/utils": "4.1.10", "magic-string": "^0.30.21", "pathe": "^2.0.3" }, @@ -3124,9 +2886,9 @@ } }, "node_modules/@vitest/spy": { - "version": "4.0.17", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.0.17.tgz", - "integrity": "sha512-I1bQo8QaP6tZlTomQNWKJE6ym4SHf3oLS7ceNjozxxgzavRAgZDc06T7kD8gb9bXKEgcLNt00Z+kZO6KaJ62Ew==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.10.tgz", + "integrity": "sha512-PLf/Ugvoq5wO/b4rwYCR1h2PSIdXz7wnkQFMiUpLdtM7l6pqVFcQIBEHyT1+l+cj7mNwAfZHzqXqDyjvOuwbDw==", "dev": true, "license": "MIT", "funding": { @@ -3134,23 +2896,24 @@ } }, "node_modules/@vitest/utils": { - "version": "4.0.17", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.0.17.tgz", - "integrity": "sha512-RG6iy+IzQpa9SB8HAFHJ9Y+pTzI+h8553MrciN9eC6TFBErqrQaTas4vG+MVj8S4uKk8uTT2p0vgZPnTdxd96w==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.10.tgz", + "integrity": "sha512-fy9am/HWxbaGt/Sawrp90vt6Y6jQwf1RX77cz3uwoJwJVMli/e1IEwRPnMNJ7vKfPTwo0diXifkpPvwH9v7nGA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "4.0.17", - "tinyrainbow": "^3.0.3" + "@vitest/pretty-format": "4.1.10", + "convert-source-map": "^2.0.0", + "tinyrainbow": "^3.1.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@xmldom/xmldom": { - "version": "0.8.11", - "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.11.tgz", - "integrity": "sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw==", + "version": "0.8.13", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.13.tgz", + "integrity": "sha512-KRYzxepc14G/CEpEGc3Yn+JKaAeT63smlDr+vjB8jRfgTBBI9wRj/nkQEO+ucV8p8I9bfKLWp37uHgFrbntPvw==", "dev": true, "license": "MIT", "engines": { @@ -3164,21 +2927,14 @@ "dev": true, "license": "BSD-2-Clause" }, - "node_modules/7zip-bin": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/7zip-bin/-/7zip-bin-5.2.0.tgz", - "integrity": "sha512-ukTPVhqG4jNzMro2qA9HSCSSVJN3aN7tlb+hfqYCt3ER0yWroeA2VR38MNrOHLQ/cVj+DaIMad0kFCtWWowh/A==", - "dev": true, - "license": "MIT" - }, "node_modules/abbrev": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-3.0.1.tgz", - "integrity": "sha512-AO2ac6pjRB3SJmGJo+v5/aK6Omggp6fsLrs6wN9bd35ulu4cCwaAU9+7ZhXjeqHVkaHThLuzH0nZr0YpCDhygg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-4.0.0.tgz", + "integrity": "sha512-a1wflyaL0tHtJSmLSOVybYhy22vRih4eduhhrkcjgrWGnRfrZtovJ2FRjxuTtkkj47O/baf0R86QU5OuYpz8fA==", "dev": true, "license": "ISC", "engines": { - "node": "^18.17.0 || >=20.5.0" + "node": "^20.17.0 || >=22.9.0" } }, "node_modules/accepts": { @@ -3243,7 +2999,9 @@ } }, "node_modules/ajv": { - "version": "6.12.6", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", "dev": true, "license": "MIT", "dependencies": { @@ -3257,16 +3015,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "ajv": "^6.9.1" - } - }, "node_modules/ansi-regex": { "version": "5.0.1", "dev": true, @@ -3369,39 +3117,36 @@ "node": ">= 8" } }, - "node_modules/app-builder-bin": { - "version": "5.0.0-alpha.12", - "resolved": "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-5.0.0-alpha.12.tgz", - "integrity": "sha512-j87o0j6LqPL3QRr8yid6c+Tt5gC7xNfYo6uQIQkorAC6MpeayVMZrEDzKmJJ/Hlv7EnOQpaRm53k6ktDYZyB6w==", - "dev": true, - "license": "MIT" - }, "node_modules/app-builder-lib": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-26.5.0.tgz", - "integrity": "sha512-iRRiJhM0uFMauDeIuv8ESHZSn+LESbdDEuHi7rKdeETjrvBObecXnWJx1f3vs3KtoGcd3hCk1zURKypyvZOtFQ==", + "version": "26.15.3", + "resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-26.15.3.tgz", + "integrity": "sha512-2VnyWkqsP5v5XbBhL3tD5Syx8iNPBYsoU7kY4S2fz7wg8Rj/nztWKCUzGKaFRTv0Xwf3/H058CR1Kvtd/3lRow==", "dev": true, "license": "MIT", "dependencies": { - "@develar/schema-utils": "~2.6.5", "@electron/asar": "3.4.1", "@electron/fuses": "^1.8.0", + "@electron/get": "^3.0.0", "@electron/notarize": "2.5.0", "@electron/osx-sign": "1.3.3", - "@electron/rebuild": "4.0.1", + "@electron/rebuild": "^4.0.4", "@electron/universal": "2.0.3", "@malept/flatpak-bundler": "^0.4.0", + "@noble/hashes": "^2.2.0", + "@peculiar/webcrypto": "^1.7.1", "@types/fs-extra": "9.0.13", + "ajv": "^8.18.0", + "asn1js": "^3.0.10", "async-exit-hook": "^2.0.1", - "builder-util": "26.4.1", - "builder-util-runtime": "9.5.1", + "builder-util": "26.15.3", + "builder-util-runtime": "9.7.0", "chromium-pickle-js": "^0.2.0", "ci-info": "4.3.1", "debug": "^4.3.4", "dotenv": "^16.4.5", "dotenv-expand": "^11.0.6", "ejs": "^3.1.8", - "electron-publish": "26.4.1", + "electron-publish": "26.15.3", "fs-extra": "^10.1.0", "hosted-git-info": "^4.1.0", "isbinaryfile": "^5.0.0", @@ -3409,123 +3154,194 @@ "js-yaml": "^4.1.0", "json5": "^2.2.3", "lazy-val": "^1.0.5", - "minimatch": "^10.0.3", + "minimatch": "^10.2.5", + "pkijs": "^3.4.0", "plist": "3.1.0", + "proper-lockfile": "^4.1.2", "resedit": "^1.7.0", "semver": "~7.7.3", - "tar": "7.5.3", + "tar": "^7.5.7", "temp-file": "^3.4.0", "tiny-async-pool": "1.3.0", + "unzipper": "^0.12.3", "which": "^5.0.0" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { - "dmg-builder": "26.5.0", - "electron-builder-squirrel-windows": "26.5.0" + "dmg-builder": "26.15.3", + "electron-builder-squirrel-windows": "26.15.3" } }, - "node_modules/app-builder-lib/node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "node_modules/app-builder-lib/node_modules/@electron/get": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@electron/get/-/get-3.1.0.tgz", + "integrity": "sha512-F+nKc0xW+kVbBRhFzaMgPy3KwmuNTYX1fx6+FxxoSnNgwYX6LD7AKBTWkU0MQ6IBoe7dz069CNkR673sPAgkCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.1.1", + "env-paths": "^2.2.0", + "fs-extra": "^8.1.0", + "got": "^11.8.5", + "progress": "^2.0.3", + "semver": "^6.2.0", + "sumchecker": "^3.0.1" + }, + "engines": { + "node": ">=14" + }, + "optionalDependencies": { + "global-agent": "^3.0.0" + } + }, + "node_modules/app-builder-lib/node_modules/@electron/get/node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "dev": true, "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" }, "engines": { - "node": ">=12" + "node": ">=6 <7 || >=8" } }, - "node_modules/app-builder-lib/node_modules/isexe": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", - "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "node_modules/app-builder-lib/node_modules/@electron/get/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/app-builder-lib/node_modules/ajv": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/app-builder-lib/node_modules/ci-info": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.1.tgz", + "integrity": "sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", "engines": { - "node": ">=16" + "node": ">=8" + } + }, + "node_modules/app-builder-lib/node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/app-builder-lib/node_modules/isexe": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.5.tgz", + "integrity": "sha512-6B3tLtFqtQS4ekarvLVMZ+X+VlvQekbe4taUkf/rhVO3d/h0M2rfARm/pXLcPEsjjMsFgrFgSrhQIxcSVrBz8w==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" } }, "node_modules/app-builder-lib/node_modules/jiti": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", - "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", + "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", "dev": true, "license": "MIT", "bin": { "jiti": "lib/jiti-cli.mjs" } }, + "node_modules/app-builder-lib/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT" + }, "node_modules/app-builder-lib/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", "dev": true, "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "node_modules/app-builder-lib/node_modules/minimatch": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz", - "integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==", + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { - "@isaacs/brace-expansion": "^5.0.0" + "brace-expansion": "^5.0.5" }, "engines": { - "node": "20 || >=22" + "node": "18 || 20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/app-builder-lib/node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "node_modules/app-builder-lib/node_modules/minimatch/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true, - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } + "license": "MIT" }, - "node_modules/app-builder-lib/node_modules/tar": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.3.tgz", - "integrity": "sha512-ENg5JUHUm2rDD7IvKNFGzyElLXNjachNLp6RaGf4+JOgxXHkqA+gq81ZAMCUmtMtqBsoU62lcp6S27g1LCYGGQ==", - "deprecated": "Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exhorbitant rates) by contacting i@izs.me", + "node_modules/app-builder-lib/node_modules/minimatch/node_modules/brace-expansion": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.3.tgz", + "integrity": "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==", "dev": true, - "license": "BlueOak-1.0.0", + "license": "MIT", "dependencies": { - "@isaacs/fs-minipass": "^4.0.0", - "chownr": "^3.0.0", - "minipass": "^7.1.2", - "minizlib": "^3.1.0", - "yallist": "^5.0.0" - }, - "engines": { - "node": ">=18" + "balanced-match": "^1.0.0" } }, "node_modules/app-builder-lib/node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true, "license": "MIT", "engines": { - "node": ">= 10.0.0" + "node": ">= 4.0.0" } }, "node_modules/app-builder-lib/node_modules/which": { @@ -3544,16 +3360,6 @@ "node": "^18.17.0 || >=20.5.0" } }, - "node_modules/app-builder-lib/node_modules/yallist": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", - "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=18" - } - }, "node_modules/arg": { "version": "5.0.2", "dev": true, @@ -3681,15 +3487,19 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "node_modules/asn1js": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/asn1js/-/asn1js-3.0.10.tgz", + "integrity": "sha512-S2s3aOytiKdFRdulw2qPE51MzjzVOisppcVv7jVFR+Kw0kxwvFrDcYA0h7Ndqbmj0HkMIXYWaoj7fli8kgx1eg==", "dev": true, - "license": "MIT", - "optional": true, + "license": "BSD-3-Clause", + "dependencies": { + "pvtsutils": "^1.3.6", + "pvutils": "^1.1.5", + "tslib": "^2.8.1" + }, "engines": { - "node": ">=0.8" + "node": ">=12.0.0" } }, "node_modules/assertion-error": { @@ -3703,9 +3513,9 @@ } }, "node_modules/ast-v8-to-istanbul": { - "version": "0.3.12", - "resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-0.3.12.tgz", - "integrity": "sha512-BRRC8VRZY2R4Z4lFIL35MwNXmwVqBityvOIwETtsCSwvjl0IdgFsy9NhdaA6j74nUdtJJlIypeRhpDam19Wq3g==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-1.0.4.tgz", + "integrity": "sha512-0bC0/4bTSrnwdhU3IsZDwEdojvuPrSg59OYZfKsLRtJZ0u8VBx9DebfqqG8bRdCC0I7vjgxmPi41P0lpkhJHtA==", "dev": true, "license": "MIT", "dependencies": { @@ -3721,17 +3531,6 @@ "dev": true, "license": "MIT" }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=8" - } - }, "node_modules/async": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", @@ -3821,6 +3620,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/aws4": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz", + "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", + "dev": true, + "license": "MIT" + }, "node_modules/axios": { "version": "1.18.0", "resolved": "https://registry.npmjs.org/axios/-/axios-1.18.0.tgz", @@ -3913,17 +3719,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "dev": true, - "license": "MIT", - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } + "license": "MIT" }, "node_modules/body-parser": { "version": "2.2.1", @@ -3963,12 +3764,17 @@ }, "node_modules/boolean": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz", + "integrity": "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", "dev": true, "license": "MIT", "optional": true }, "node_modules/brace-expansion": { - "version": "2.0.2", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.3.tgz", + "integrity": "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==", "dev": true, "license": "MIT", "dependencies": { @@ -4017,39 +3823,6 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/buffer-crc32": { - "version": "0.2.13", - "dev": true, - "license": "MIT", - "engines": { - "node": "*" - } - }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -4058,16 +3831,14 @@ "license": "MIT" }, "node_modules/builder-util": { - "version": "26.4.1", - "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-26.4.1.tgz", - "integrity": "sha512-FlgH43XZ50w3UtS1RVGDWOz8v9qMXPC7upMtKMtBEnYdt1OVoS61NYhKm/4x+cIaWqJTXua0+VVPI+fSPGXNIw==", + "version": "26.15.3", + "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-26.15.3.tgz", + "integrity": "sha512-q2hn7Mbo2nFNkVekPiHFx6Nfo3hURmES3tfBn+k5Pqxl2RkmP3QGqZUhH/q9Pch/4G05NRhPjDlVj1O8q4Txvw==", "dev": true, "license": "MIT", "dependencies": { "@types/debug": "^4.1.6", - "7zip-bin": "~5.2.0", - "app-builder-bin": "5.0.0-alpha.12", - "builder-util-runtime": "9.5.1", + "builder-util-runtime": "9.7.0", "chalk": "^4.1.2", "cross-spawn": "^7.0.6", "debug": "^4.3.4", @@ -4080,12 +3851,15 @@ "stat-mode": "^1.0.0", "temp-file": "^3.4.0", "tiny-async-pool": "1.3.0" + }, + "engines": { + "node": ">=14.0.0" } }, "node_modules/builder-util-runtime": { - "version": "9.5.1", - "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.5.1.tgz", - "integrity": "sha512-qt41tMfgHTllhResqM5DcnHyDIWNgzHvuY2jDcYP9iaGpkWxTUzV6GQjDeLnlR1/DtdlcsWQbA7sByMpmJFTLQ==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.7.0.tgz", + "integrity": "sha512-g/kR520giAFYkSXTzcmF3kqQq7wi8F6N6SzeDgZrqTBN+VHdmgWOyTdD1yD7AATDId/yXLvuP34CxW46/BwCdw==", "dev": true, "license": "MIT", "dependencies": { @@ -4096,49 +3870,21 @@ "node": ">=12.0.0" } }, - "node_modules/builder-util/node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "dev": true, + "node_modules/bytes": { + "version": "3.1.2", "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, "engines": { - "node": ">=12" - } - }, - "node_modules/builder-util/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" + "node": ">= 0.8" } }, - "node_modules/builder-util/node_modules/universalify": { + "node_modules/bytestreamjs": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "resolved": "https://registry.npmjs.org/bytestreamjs/-/bytestreamjs-2.0.1.tgz", + "integrity": "sha512-U1Z/ob71V/bXfVABvNr/Kumf5VyeQRBEm6Txb0PQ6S7V5GpBM3w4Cbqz/xPDicR5tN0uvDifng8C+5qECeGwyQ==", "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/bytes": { - "version": "3.1.2", - "license": "MIT", + "license": "BSD-3-Clause", "engines": { - "node": ">= 0.8" + "node": ">=6.0.0" } }, "node_modules/cac": { @@ -4149,70 +3895,10 @@ "node": ">=8" } }, - "node_modules/cacache": { - "version": "19.0.1", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-19.0.1.tgz", - "integrity": "sha512-hdsUxulXCi5STId78vRVYEtDAjq99ICAUktLTeTYsLoTE6Z8dS0c8pWNCxwdrk9YfJeobDZc2Y186hD/5ZQgFQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "@npmcli/fs": "^4.0.0", - "fs-minipass": "^3.0.0", - "glob": "^10.2.2", - "lru-cache": "^10.0.1", - "minipass": "^7.0.3", - "minipass-collect": "^2.0.1", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "p-map": "^7.0.2", - "ssri": "^12.0.0", - "tar": "^7.4.3", - "unique-filename": "^4.0.0" - }, - "engines": { - "node": "^18.17.0 || >=20.5.0" - } - }, - "node_modules/cacache/node_modules/glob": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", - "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", - "dev": true, - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/cacache/node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/cacache/node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, "node_modules/cacheable-lookup": { "version": "5.0.4", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", + "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", "dev": true, "license": "MIT", "engines": { @@ -4221,6 +3907,8 @@ }, "node_modules/cacheable-request": { "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", + "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", "dev": true, "license": "MIT", "dependencies": { @@ -4423,9 +4111,9 @@ "license": "MIT" }, "node_modules/ci-info": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.1.tgz", - "integrity": "sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.4.0.tgz", + "integrity": "sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==", "dev": true, "funding": [ { @@ -4443,52 +4131,10 @@ "dev": true, "license": "MIT" }, - "node_modules/cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dev": true, - "license": "MIT", - "dependencies": { - "restore-cursor": "^3.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cli-spinners": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", - "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-truncate": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", - "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "slice-ansi": "^3.0.0", - "string-width": "^4.2.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/cliui": { "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "license": "ISC", "dependencies": { @@ -4500,18 +4146,10 @@ "node": ">=12" } }, - "node_modules/clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8" - } - }, "node_modules/clone-response": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", + "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", "dev": true, "license": "MIT", "dependencies": { @@ -4589,11 +4227,6 @@ "dev": true, "license": "MIT" }, - "node_modules/concat-map": { - "version": "0.0.1", - "dev": true, - "license": "MIT" - }, "node_modules/content-disposition": { "version": "1.0.1", "license": "MIT", @@ -4640,34 +4273,11 @@ } }, "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/cors": { - "version": "2.8.5", - "license": "MIT", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/crc": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/crc/-/crc-3.8.0.tgz", - "integrity": "sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "buffer": "^5.1.0" - } + "license": "MIT" }, "node_modules/cross-dirname": { "version": "0.1.0", @@ -4923,6 +4533,8 @@ }, "node_modules/decompress-response": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", "dev": true, "license": "MIT", "dependencies": { @@ -4937,6 +4549,8 @@ }, "node_modules/decompress-response/node_modules/mimic-response": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", "dev": true, "license": "MIT", "engines": { @@ -4951,21 +4565,10 @@ "dev": true, "license": "MIT" }, - "node_modules/defaults": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", - "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", - "dev": true, - "license": "MIT", - "dependencies": { - "clone": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/defer-to-connect": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", "dev": true, "license": "MIT", "engines": { @@ -5026,18 +4629,10 @@ "node": ">=6" } }, - "node_modules/detect-libc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", - "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=8" - } - }, "node_modules/detect-node": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", + "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", "dev": true, "license": "MIT", "optional": true @@ -5070,21 +4665,10 @@ "p-limit": "^3.1.0 " } }, - "node_modules/dir-compare/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/dir-compare/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -5111,89 +4695,20 @@ "license": "MIT" }, "node_modules/dmg-builder": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-26.5.0.tgz", - "integrity": "sha512-AyOCzpS1TCxDkSWxAzpfw5l7jBX4C8jKCucmT/6y6/24H5VKSHpjcVJD0W8o5BrFi+skC7Z7+F4aNyHmvn4AAw==", + "version": "26.15.3", + "resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-26.15.3.tgz", + "integrity": "sha512-O3zJUFUYHJKgzPqioHxfxzBzlSC1eXCSr79gMSBKBP5AgjjpmrydMsMLotEg9fAJF36vdUncb+4ndRNxoPdlSQ==", "dev": true, "license": "MIT", "dependencies": { - "app-builder-lib": "26.5.0", - "builder-util": "26.4.1", + "app-builder-lib": "26.15.3", + "builder-util": "26.15.3", "fs-extra": "^10.1.0", - "iconv-lite": "^0.6.2", "js-yaml": "^4.1.0" - }, - "optionalDependencies": { - "dmg-license": "^1.0.11" } }, - "node_modules/dmg-builder/node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/dmg-builder/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/dmg-builder/node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/dmg-license": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/dmg-license/-/dmg-license-1.0.11.tgz", - "integrity": "sha512-ZdzmqwKmECOWJpqefloC5OJy1+WZBBse5+MR88z9g9Zn4VY+WYUkAyojmhzJckH5YbbZGcYIuGAkY5/Ys5OM2Q==", - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "dependencies": { - "@types/plist": "^3.0.1", - "@types/verror": "^1.10.3", - "ajv": "^6.10.0", - "crc": "^3.8.0", - "iconv-corefoundation": "^1.1.7", - "plist": "^3.0.4", - "smart-buffer": "^4.0.2", - "verror": "^1.10.0" - }, - "bin": { - "dmg-license": "bin/dmg-license.js" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", + "node_modules/doctrine": { + "version": "3.0.0", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -5213,9 +4728,9 @@ } }, "node_modules/dompurify": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.7.tgz", - "integrity": "sha512-WhL/YuveyGXJaerVlMYGWhvQswa7myDG17P7Vu65EWC05o8vfeNbvNf4d/BOvH99+ZW+LlQsc1GDKMa1vNK6dw==", + "version": "3.4.12", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.12.tgz", + "integrity": "sha512-zQvGet8Z2sWbQhCmfFz/T5QWH2oBmjnqK3qvOjaqaNLrLEF912WamU+ohnTp0TCep/MFVHpdJuCZEdFOdTnEFg==", "dev": true, "license": "(MPL-2.0 OR Apache-2.0)", "optionalDependencies": { @@ -5263,6 +4778,16 @@ "node": ">= 0.4" } }, + "node_modules/duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "readable-stream": "^2.0.2" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "dev": true, @@ -5289,37 +4814,37 @@ } }, "node_modules/electron": { - "version": "40.0.0", - "resolved": "https://registry.npmjs.org/electron/-/electron-40.0.0.tgz", - "integrity": "sha512-UyBy5yJ0/wm4gNugCtNPjvddjAknMTuXR2aCHioXicH7aKRKGDBPp4xqTEi/doVcB3R+MN3wfU9o8d/9pwgK2A==", + "version": "40.10.6", + "resolved": "https://registry.npmjs.org/electron/-/electron-40.10.6.tgz", + "integrity": "sha512-TGjlkOU9Lg6K4KjDbsErywCWCIDaNgLh0q+xj0nlpRoQhevI7VBIxBTtJI/V30lypyLAaXMpnP9O9jui1/qRFw==", "dev": true, "hasInstallScript": true, "license": "MIT", "dependencies": { - "@electron/get": "^2.0.0", - "@types/node": "^24.9.0", - "extract-zip": "^2.0.1" + "@electron-internal/extract-zip": "^1.0.1", + "@electron/get": "^5.0.0", + "@types/node": "^24.9.0" }, "bin": { "electron": "cli.js" }, "engines": { - "node": ">= 12.20.55" + "node": ">= 22.12.0" } }, "node_modules/electron-builder": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-26.5.0.tgz", - "integrity": "sha512-DHvMBUmDscyvI/JvcJ1ZjrPqikzANbnX83MxUX5Daaeu2I8c2SxFM8LyKEepEZr1uomV1sw7yrLtKhKAT82OdA==", + "version": "26.15.3", + "resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-26.15.3.tgz", + "integrity": "sha512-a1KM5heqS3gQCZzizXEI8RjJy3QVogULPdeSknt76uLDpBIW/HDGsMg/XgP0riP6PI9COsRvFITKKGDqA8fJxA==", "dev": true, "license": "MIT", "dependencies": { - "app-builder-lib": "26.5.0", - "builder-util": "26.4.1", - "builder-util-runtime": "9.5.1", + "app-builder-lib": "26.15.3", + "builder-util": "26.15.3", + "builder-util-runtime": "9.7.0", "chalk": "^4.1.2", "ci-info": "^4.2.0", - "dmg-builder": "26.5.0", + "dmg-builder": "26.15.3", "fs-extra": "^10.1.0", "lazy-val": "^1.0.5", "simple-update-notifier": "2.0.0", @@ -5334,105 +4859,36 @@ } }, "node_modules/electron-builder-squirrel-windows": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/electron-builder-squirrel-windows/-/electron-builder-squirrel-windows-26.5.0.tgz", - "integrity": "sha512-pMXUzwHFIz3S6/jtzg4tB6LBqOM4buEChYCz73JGuV/cWoWhB4xTVVfFuXwrsu0uqhZw8zyhbpyWIEPTE76Dcg==", + "version": "26.15.3", + "resolved": "https://registry.npmjs.org/electron-builder-squirrel-windows/-/electron-builder-squirrel-windows-26.15.3.tgz", + "integrity": "sha512-Jc19XPV9y9+2bAdZPkXuVNGNIEFBq9poHC61l8Kv6FdK7DRG3+Ic0rerC0DXOaeHNz8yW0fg/JnF8GQROOF5MA==", "dev": true, "license": "MIT", "peer": true, "dependencies": { - "app-builder-lib": "26.5.0", - "builder-util": "26.4.1", + "app-builder-lib": "26.15.3", + "builder-util": "26.15.3", "electron-winstaller": "5.4.0" } }, - "node_modules/electron-builder/node_modules/fs-extra": { - "version": "10.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/electron-builder/node_modules/jsonfile": { - "version": "6.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/electron-builder/node_modules/universalify": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/electron-publish": { - "version": "26.4.1", - "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-26.4.1.tgz", - "integrity": "sha512-nByal9K5Ar3BNJUfCSglXltpKUhJqpwivNpKVHnkwxTET9LKl+NxoojpGF1dSXVFcoBKVm+OhsVa28ZsoshEPA==", + "version": "26.15.3", + "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-26.15.3.tgz", + "integrity": "sha512-g/2bn8YTavY4cuS5F+jOS7zmZbXXBV8KZ8yHKfJjFPoKtzBqrpCdNPxBd3tqdBwP7BVd0lGzf7Bk2s0KesWZ4Q==", "dev": true, "license": "MIT", "dependencies": { "@types/fs-extra": "^9.0.11", - "builder-util": "26.4.1", - "builder-util-runtime": "9.5.1", + "aws4": "^1.13.2", + "builder-util": "26.15.3", + "builder-util-runtime": "9.7.0", "chalk": "^4.1.2", - "form-data": "^4.0.0", + "form-data": "^4.0.5", "fs-extra": "^10.1.0", "lazy-val": "^1.0.5", "mime": "^2.5.2" } }, - "node_modules/electron-publish/node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/electron-publish/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/electron-publish/node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/electron-to-chromium": { "version": "1.5.239", "dev": true, @@ -5506,6 +4962,28 @@ "node": ">=6 <7 || >=8" } }, + "node_modules/electron-winstaller/node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "license": "MIT", + "peer": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/electron-winstaller/node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/electron/node_modules/@types/node": { "version": "24.10.9", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.9.tgz", @@ -5535,19 +5013,10 @@ "node": ">= 0.8" } }, - "node_modules/encoding": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "iconv-lite": "^0.6.2" - } - }, "node_modules/end-of-stream": { "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", "dev": true, "license": "MIT", "dependencies": { @@ -5555,11 +5024,16 @@ } }, "node_modules/env-paths": { - "version": "2.2.1", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", + "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==", "dev": true, "license": "MIT", "engines": { - "node": ">=6" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/err-code": { @@ -5651,9 +5125,9 @@ } }, "node_modules/es-module-lexer": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", - "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.1.tgz", + "integrity": "sha512-shc1dbU90Yl/xq1QrC7QRtfcwURZuVRfPhZbDoldJ1cn1gzDvBaBWlv0eFolj5+0znnPJz5TXLxsN77X/12KTA==", "dev": true, "license": "MIT" }, @@ -5709,6 +5183,8 @@ }, "node_modules/es6-error": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true, "license": "MIT", "optional": true @@ -5906,15 +5382,6 @@ "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" } }, - "node_modules/eslint-plugin-import/node_modules/brace-expansion": { - "version": "1.1.12", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/eslint-plugin-import/node_modules/debug": { "version": "3.2.7", "dev": true, @@ -5935,7 +5402,9 @@ } }, "node_modules/eslint-plugin-import/node_modules/minimatch": { - "version": "3.1.2", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -5979,15 +5448,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/brace-expansion": { - "version": "1.1.12", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/eslint/node_modules/glob-parent": { "version": "6.0.2", "dev": true, @@ -6000,7 +5460,9 @@ } }, "node_modules/eslint/node_modules/minimatch": { - "version": "3.1.2", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -6178,36 +5640,6 @@ "dev": true, "license": "MIT" }, - "node_modules/extract-zip": { - "version": "2.0.1", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "debug": "^4.1.1", - "get-stream": "^5.1.0", - "yauzl": "^2.10.0" - }, - "bin": { - "extract-zip": "cli.js" - }, - "engines": { - "node": ">= 10.17.0" - }, - "optionalDependencies": { - "@types/yauzl": "^2.9.1" - } - }, - "node_modules/extsprintf": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.1.tgz", - "integrity": "sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA==", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "license": "MIT", - "optional": true - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "dev": true, @@ -6246,6 +5678,23 @@ "dev": true, "license": "MIT" }, + "node_modules/fast-uri": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.3.tgz", + "integrity": "sha512-i70LwGWUduXqzicKXWshooq+sWL1K3WUU5rKZNG/0i3a1OSoX3HqhH5WbWwTmqWfor4urUakGPiRQcleRZTwOg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/fastq": { "version": "1.19.1", "dev": true, @@ -6266,14 +5715,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/fd-slicer": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "pend": "~1.2.0" - } - }, "node_modules/file-entry-cache": { "version": "6.0.1", "dev": true, @@ -6286,9 +5727,9 @@ } }, "node_modules/filelist": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", - "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.6.tgz", + "integrity": "sha512-5giy2PkLYY1cP39p17Ech+2xlpTRL9HLspOfEgm0L6CwBXBTgsK5ou0JtzYuepxkaQ/tvhCFIJ5uXo0OrM2DxA==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -6296,9 +5737,9 @@ } }, "node_modules/filelist/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", "dev": true, "license": "ISC", "dependencies": { @@ -6372,7 +5813,9 @@ } }, "node_modules/flatted": { - "version": "3.3.3", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", "dev": true, "license": "ISC" }, @@ -6475,39 +5918,18 @@ } }, "node_modules/fs-extra": { - "version": "8.1.0", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/fs-minipass": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", - "integrity": "sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==", - "dev": true, - "license": "ISC", - "dependencies": { - "minipass": "^7.0.3" + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/fs-minipass/node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=12" } }, "node_modules/fs.realpath": { @@ -6581,6 +6003,8 @@ }, "node_modules/get-caller-file": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, "license": "ISC", "engines": { @@ -6622,6 +6046,8 @@ }, "node_modules/get-stream": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", "dev": true, "license": "MIT", "dependencies": { @@ -6679,17 +6105,10 @@ "node": ">= 6" } }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "1.1.12", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -6701,6 +6120,8 @@ }, "node_modules/global-agent": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz", + "integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==", "dev": true, "license": "BSD-3-Clause", "optional": true, @@ -6776,6 +6197,8 @@ }, "node_modules/got": { "version": "11.8.6", + "resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz", + "integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==", "dev": true, "license": "MIT", "dependencies": { @@ -7021,6 +6444,8 @@ }, "node_modules/http-cache-semantics": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz", + "integrity": "sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==", "dev": true, "license": "BSD-2-Clause" }, @@ -7058,6 +6483,8 @@ }, "node_modules/http2-wrapper": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", + "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", "dev": true, "license": "MIT", "dependencies": { @@ -7082,83 +6509,31 @@ "node": ">= 14" } }, - "node_modules/iconv-corefoundation": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/iconv-corefoundation/-/iconv-corefoundation-1.1.7.tgz", - "integrity": "sha512-T10qvkw0zz4wnm560lOEg0PovVqUXuOFhhHAkixw8/sycy7TJt7v/RrkEKEQnAw2viPSJu6iAkErxnzR0g8PpQ==", + "node_modules/ignore": { + "version": "5.3.2", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "dependencies": { - "cli-truncate": "^2.1.0", - "node-addon-api": "^1.6.3" - }, "engines": { - "node": "^8.11.2 || >=10" + "node": ">= 4" } }, - "node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "node_modules/import-fresh": { + "version": "3.3.1", "dev": true, "license": "MIT", "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "BSD-3-Clause" - }, - "node_modules/ignore": { - "version": "5.3.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.1", - "dev": true, - "license": "MIT", - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", + "node_modules/imurmurhash": { + "version": "0.1.4", "dev": true, "license": "MIT", "engines": { @@ -7204,16 +6579,6 @@ "node": ">=12" } }, - "node_modules/ip-address": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.1.0.tgz", - "integrity": "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 12" - } - }, "node_modules/ipaddr.js": { "version": "1.9.1", "license": "MIT", @@ -7463,16 +6828,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/is-interactive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", - "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/is-map": { "version": "2.0.3", "dev": true, @@ -7627,19 +6982,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-weakmap": { "version": "2.0.2", "dev": true, @@ -7803,9 +7145,19 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", - "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", + "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -7816,6 +7168,8 @@ }, "node_modules/jsesc": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "dev": true, "license": "MIT", "bin": { @@ -7862,6 +7216,8 @@ }, "node_modules/json-stringify-safe": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", "dev": true, "license": "ISC", "optional": true @@ -7886,9 +7242,14 @@ } }, "node_modules/jsonfile": { - "version": "4.0.0", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", "dev": true, "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -7971,9 +7332,9 @@ } }, "node_modules/lodash": { - "version": "4.17.23", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", - "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", "dev": true, "license": "MIT" }, @@ -7982,23 +7343,6 @@ "dev": true, "license": "MIT" }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/longest-streak": { "version": "3.1.0", "dev": true, @@ -8021,6 +7365,8 @@ }, "node_modules/lowercase-keys": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", "dev": true, "license": "MIT", "engines": { @@ -8042,6 +7388,8 @@ }, "node_modules/lru-cache": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, "license": "ISC", "dependencies": { @@ -8086,39 +7434,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/make-fetch-happen": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-14.0.3.tgz", - "integrity": "sha512-QMjGbFTP0blj97EeidG5hk/QhKQ3T4ICckQGLgz38QF7Vgbk6e6FTARN8KhKxyBbWn8R0HU+bnw8aSoFPD4qtQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "@npmcli/agent": "^3.0.0", - "cacache": "^19.0.1", - "http-cache-semantics": "^4.1.1", - "minipass": "^7.0.2", - "minipass-fetch": "^4.0.0", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "negotiator": "^1.0.0", - "proc-log": "^5.0.0", - "promise-retry": "^2.0.1", - "ssri": "^12.0.0" - }, - "engines": { - "node": "^18.17.0 || >=20.5.0" - } - }, - "node_modules/make-fetch-happen/node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, "node_modules/markdown-table": { "version": "3.0.4", "dev": true, @@ -8141,6 +7456,8 @@ }, "node_modules/matcher": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", + "integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==", "dev": true, "license": "MIT", "optional": true, @@ -9033,18 +8350,10 @@ "node": ">= 0.6" } }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/mimic-response": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", "dev": true, "license": "MIT", "engines": { @@ -9052,11 +8361,13 @@ } }, "node_modules/minimatch": { - "version": "9.0.5", + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", "dev": true, "license": "ISC", "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^2.0.2" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -9074,163 +8385,15 @@ } }, "node_modules/minipass": { - "version": "5.0.0", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", "dev": true, - "license": "ISC", - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-collect": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-2.0.1.tgz", - "integrity": "sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw==", - "dev": true, - "license": "ISC", - "dependencies": { - "minipass": "^7.0.3" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/minipass-collect/node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/minipass-fetch": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-4.0.1.tgz", - "integrity": "sha512-j7U11C5HXigVuutxebFadoYBbd7VSdZWggSe64NVdvWNBqGAiXPL2QVCehjmw7lY1oF9gOllYbORh+hiNgfPgQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "minipass": "^7.0.3", - "minipass-sized": "^1.0.3", - "minizlib": "^3.0.1" - }, - "engines": { - "node": "^18.17.0 || >=20.5.0" - }, - "optionalDependencies": { - "encoding": "^0.1.13" - } - }, - "node_modules/minipass-fetch/node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "license": "ISC", + "license": "BlueOak-1.0.0", "engines": { "node": ">=16 || 14 >=14.17" } }, - "node_modules/minipass-flush": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", - "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", - "dev": true, - "license": "ISC", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/minipass-flush/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-flush/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true, - "license": "ISC" - }, - "node_modules/minipass-pipeline": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", - "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", - "dev": true, - "license": "ISC", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-pipeline/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-pipeline/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true, - "license": "ISC" - }, - "node_modules/minipass-sized": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", - "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", - "dev": true, - "license": "ISC", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-sized/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-sized/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true, - "license": "ISC" - }, "node_modules/minizlib": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.1.0.tgz", @@ -9244,16 +8407,6 @@ "node": ">= 18" } }, - "node_modules/minizlib/node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, "node_modules/mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", @@ -9294,7 +8447,9 @@ } }, "node_modules/nanoid": { - "version": "3.3.11", + "version": "3.3.16", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.16.tgz", + "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==", "dev": true, "funding": [ { @@ -9323,9 +8478,9 @@ } }, "node_modules/node-abi": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-4.26.0.tgz", - "integrity": "sha512-8QwIZqikRvDIkXS2S93LjzhsSPJuIbfaMETWH+Bx8oOT9Sa9UsUtBFQlc3gBNd1+QINjaTloitXr1W3dQLi9Iw==", + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-4.33.0.tgz", + "integrity": "sha512-vLBWCKb+7LWsX+TbfzWOkw0W81m377tyx3hOweBTjO43CXZnRGS1/JPWs20fr0PgZyDXk6ROYrylsEycK8raDA==", "dev": true, "license": "MIT", "dependencies": { @@ -9335,14 +8490,6 @@ "node": ">=22.12.0" } }, - "node_modules/node-addon-api": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.7.2.tgz", - "integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==", - "dev": true, - "license": "MIT", - "optional": true - }, "node_modules/node-api-version": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/node-api-version/-/node-api-version-0.2.1.tgz", @@ -9354,92 +8501,111 @@ } }, "node_modules/node-cron": { - "version": "3.0.3", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/node-cron/-/node-cron-4.6.0.tgz", + "integrity": "sha512-Si/bzYiKRHOB8/a99T2+SDGN582ONDMSTlJr5oCkT6GtnqPjZ2s10eoQRYkW9ZHwjVxONL+W8Fb+qR0AHMQsdg==", "license": "ISC", - "dependencies": { - "uuid": "8.3.2" - }, "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/node-cron/node_modules/uuid": { - "version": "8.3.2", - "license": "MIT", - "bin": { - "uuid": "dist/bin/uuid" + "node": ">=20" } }, "node_modules/node-gyp": { - "version": "11.5.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-11.5.0.tgz", - "integrity": "sha512-ra7Kvlhxn5V9Slyus0ygMa2h+UqExPqUIkfk7Pc8QTLT956JLSy51uWFwHtIYy0vI8cB4BDhc/S03+880My/LQ==", + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-12.4.0.tgz", + "integrity": "sha512-OMcPNvqTCFUnNaBlmdgq+lfNqY7gTiSmNRDjY3uAXRyudeKZEZxu3CLtjMQrx4zZxCX2b/mpNqTtwuCJgXhHkw==", "dev": true, "license": "MIT", "dependencies": { "env-paths": "^2.2.0", "exponential-backoff": "^3.1.1", "graceful-fs": "^4.2.6", - "make-fetch-happen": "^14.0.3", - "nopt": "^8.0.0", - "proc-log": "^5.0.0", + "nopt": "^9.0.0", + "proc-log": "^6.0.0", "semver": "^7.3.5", - "tar": "^7.4.3", + "tar": "^7.5.4", "tinyglobby": "^0.2.12", - "which": "^5.0.0" + "undici": "^6.25.0", + "which": "^6.0.0" }, "bin": { "node-gyp": "bin/node-gyp.js" }, "engines": { - "node": "^18.17.0 || >=20.5.0" + "node": "^20.17.0 || >=22.9.0" + } + }, + "node_modules/node-gyp/node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" } }, "node_modules/node-gyp/node_modules/isexe": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", - "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-4.0.0.tgz", + "integrity": "sha512-FFUtZMpoZ8RqHS3XeXEmHWLA4thH+ZxCv2lOiPIn1Xc7CxrqhWzNSDzD+/chS/zbYezmiwWLdQC09JdQKmthOw==", "dev": true, - "license": "ISC", + "license": "BlueOak-1.0.0", "engines": { - "node": ">=16" + "node": ">=20" + } + }, + "node_modules/node-gyp/node_modules/undici": { + "version": "6.27.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.27.0.tgz", + "integrity": "sha512-YmfV3YnEDzXRC5lZ2jWtWWHKGUm1zIt8AhesR1tens+HTNv+YZlN/dp6G727LOvMJ8xjP9Be7Y2Sdr96LDm+pg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.17" } }, "node_modules/node-gyp/node_modules/which": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/which/-/which-5.0.0.tgz", - "integrity": "sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/which/-/which-6.0.1.tgz", + "integrity": "sha512-oGLe46MIrCRqX7ytPUf66EAYvdeMIZYn3WaocqqKZAxrBpkqHfL/qvTyJ/bTk5+AqHCjXmrv3CEWgy368zhRUg==", "dev": true, "license": "ISC", "dependencies": { - "isexe": "^3.1.1" + "isexe": "^4.0.0" }, "bin": { "node-which": "bin/which.js" }, "engines": { - "node": "^18.17.0 || >=20.5.0" + "node": "^20.17.0 || >=22.9.0" } }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true, + "license": "MIT" + }, "node_modules/node-releases": { "version": "2.0.26", "dev": true, "license": "MIT" }, "node_modules/nopt": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-8.1.0.tgz", - "integrity": "sha512-ieGu42u/Qsa4TFktmaKEwM6MQH0pOWnaB3htzh0JRtx84+Mebc0cbZYN5bC+6WTZ4+77xrL9Pn5m7CV6VIkV7A==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-9.0.0.tgz", + "integrity": "sha512-Zhq3a+yFKrYwSBluL4H9XP3m3y5uvQkB/09CwDruCiRmR/UJYnn9W4R48ry0uGC70aeTPKLynBtscP9efFFcPw==", "dev": true, "license": "ISC", "dependencies": { - "abbrev": "^3.0.0" + "abbrev": "^4.0.0" }, "bin": { "nopt": "bin/nopt.js" }, "engines": { - "node": "^18.17.0 || >=20.5.0" + "node": "^20.17.0 || >=22.9.0" } }, "node_modules/normalize-path": { @@ -9459,6 +8625,8 @@ }, "node_modules/normalize-url": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", + "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", "dev": true, "license": "MIT", "engines": { @@ -9470,6 +8638,7 @@ }, "node_modules/object-assign": { "version": "4.1.1", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -9595,22 +8764,6 @@ "wrappy": "1" } }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/open": { "version": "7.4.2", "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", @@ -9644,30 +8797,6 @@ "node": ">= 0.8.0" } }, - "node_modules/ora": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", - "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "bl": "^4.1.0", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-spinners": "^2.5.0", - "is-interactive": "^1.0.0", - "is-unicode-supported": "^0.1.0", - "log-symbols": "^4.1.0", - "strip-ansi": "^6.0.0", - "wcwidth": "^1.0.1" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/own-keys": { "version": "1.0.1", "dev": true, @@ -9686,6 +8815,8 @@ }, "node_modules/p-cancelable": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", + "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", "dev": true, "license": "MIT", "engines": { @@ -9720,19 +8851,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-map": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.4.tgz", - "integrity": "sha512-tkAQEw8ysMzmkhgw8k+1U/iPhWNhykKnSk4Rd5zLoPJCuJaGRPo6YposrZgaxHKzDHdDWWZvE/Sk7hsL2X/CpQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/package-json-from-dist": { "version": "1.0.1", "dev": true, @@ -9825,34 +8943,6 @@ "node": ">=8" } }, - "node_modules/patch-package/node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/patch-package/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, "node_modules/patch-package/node_modules/slash": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", @@ -9863,16 +8953,6 @@ "node": ">=6" } }, - "node_modules/patch-package/node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/path-exists": { "version": "4.0.0", "dev": true, @@ -9923,7 +9003,9 @@ "license": "ISC" }, "node_modules/path-to-regexp": { - "version": "8.3.0", + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz", + "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", "license": "MIT", "funding": { "type": "opencollective", @@ -9960,18 +9042,15 @@ "url": "https://github.com/sponsors/jet2jet" } }, - "node_modules/pend": { - "version": "1.2.0", - "dev": true, - "license": "MIT" - }, "node_modules/picocolors": { "version": "1.1.1", "dev": true, "license": "ISC" }, "node_modules/picomatch": { - "version": "2.3.1", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "license": "MIT", "engines": { "node": ">=8.6" @@ -9996,6 +9075,37 @@ "node": ">= 6" } }, + "node_modules/pkijs": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/pkijs/-/pkijs-3.4.0.tgz", + "integrity": "sha512-emEcLuomt2j03vxD54giVB4SxTjnsqkU692xZOZXHDVoYyypEm+b3jpiTcc+Cf+myooc+/Ly0z01jqeNHVgJGw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@noble/hashes": "1.4.0", + "asn1js": "^3.0.6", + "bytestreamjs": "^2.0.1", + "pvtsutils": "^1.3.6", + "pvutils": "^1.1.3", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/pkijs/node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/plist": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/plist/-/plist-3.1.0.tgz", @@ -10020,7 +9130,9 @@ } }, "node_modules/postcss": { - "version": "8.5.6", + "version": "8.5.17", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.17.tgz", + "integrity": "sha512-J7EF+8X+CzRPaJPOv9Ck2wNWJvGnnl3PcNPAdGg6GTLjyVpyQ0yATMSXRFRV01BviT/9Gwuc3rjEyJbDJG9a4w==", "dev": true, "funding": [ { @@ -10038,7 +9150,7 @@ ], "license": "MIT", "dependencies": { - "nanoid": "^3.3.11", + "nanoid": "^3.3.12", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, @@ -10215,17 +9327,26 @@ } }, "node_modules/proc-log": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-5.0.0.tgz", - "integrity": "sha512-Azwzvl90HaF0aCz1JrDdXQykFakSSNPaPoiZ9fm5qJIMHioDZEi7OAdRwSm6rSoPtY3Qutnm3L7ogmg3dc+wbQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-6.1.0.tgz", + "integrity": "sha512-iG+GYldRf2BQ0UDUAd6JQ/RwzaQy6mXmsk/IzlYyal4A4SNFw54MeH4/tLkF4I5WoWG9SQwuqWzS99jaFQHBuQ==", "dev": true, "license": "ISC", "engines": { - "node": "^18.17.0 || >=20.5.0" + "node": "^20.17.0 || >=22.9.0" } }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true, + "license": "MIT" + }, "node_modules/progress": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true, "license": "MIT", "engines": { @@ -10261,6 +9382,25 @@ "dev": true, "license": "MIT" }, + "node_modules/proper-lockfile": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz", + "integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "retry": "^0.12.0", + "signal-exit": "^3.0.2" + } + }, + "node_modules/proper-lockfile/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, "node_modules/property-information": { "version": "7.1.0", "dev": true, @@ -10291,7 +9431,9 @@ } }, "node_modules/pump": { - "version": "3.0.3", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.4.tgz", + "integrity": "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==", "dev": true, "license": "MIT", "dependencies": { @@ -10307,13 +9449,34 @@ "node": ">=6" } }, + "node_modules/pvtsutils": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/pvtsutils/-/pvtsutils-1.3.6.tgz", + "integrity": "sha512-PLgQXQ6H2FWCaeRak8vvk1GW462lMxB5s3Jm673N82zI4vqtVUPuZdffdZbPDFRoU8kAhItWFtPCWiPpp4/EDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^2.8.1" + } + }, + "node_modules/pvutils": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/pvutils/-/pvutils-1.1.5.tgz", + "integrity": "sha512-KTqnxsgGiQ6ZAzZCVlJH5eOjSnvlyEgx1m8bkRJfOhmGRqfo5KLvmAlACQkrjEtOQ4B7wF9TdSLIs9O90MX9xA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/qs": { - "version": "6.14.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz", - "integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==", + "version": "6.15.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz", + "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==", "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.1.0" + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" }, "engines": { "node": ">=0.6" @@ -10343,6 +9506,8 @@ }, "node_modules/quick-lru": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", "dev": true, "license": "MIT", "engines": { @@ -11108,20 +10273,28 @@ } }, "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, "license": "MIT", "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, + "node_modules/readable-stream/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true, + "license": "MIT" + }, "node_modules/readdirp": { "version": "3.6.0", "license": "MIT", @@ -11283,6 +10456,18 @@ }, "node_modules/require-directory": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true, "license": "MIT", "engines": { @@ -11333,6 +10518,8 @@ }, "node_modules/resolve-alpn": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", "dev": true, "license": "MIT" }, @@ -11346,6 +10533,8 @@ }, "node_modules/responselike": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", + "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", "dev": true, "license": "MIT", "dependencies": { @@ -11355,27 +10544,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dev": true, - "license": "MIT", - "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/restore-cursor/node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true, - "license": "ISC" - }, "node_modules/retry": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", @@ -11411,6 +10579,8 @@ }, "node_modules/roarr": { "version": "2.15.4", + "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz", + "integrity": "sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==", "dev": true, "license": "BSD-3-Clause", "optional": true, @@ -11427,11 +10597,13 @@ } }, "node_modules/rollup": { - "version": "4.52.5", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.2.tgz", + "integrity": "sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==", "dev": true, "license": "MIT", "dependencies": { - "@types/estree": "1.0.8" + "@types/estree": "1.0.9" }, "bin": { "rollup": "dist/bin/rollup" @@ -11441,28 +10613,31 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.52.5", - "@rollup/rollup-android-arm64": "4.52.5", - "@rollup/rollup-darwin-arm64": "4.52.5", - "@rollup/rollup-darwin-x64": "4.52.5", - "@rollup/rollup-freebsd-arm64": "4.52.5", - "@rollup/rollup-freebsd-x64": "4.52.5", - "@rollup/rollup-linux-arm-gnueabihf": "4.52.5", - "@rollup/rollup-linux-arm-musleabihf": "4.52.5", - "@rollup/rollup-linux-arm64-gnu": "4.52.5", - "@rollup/rollup-linux-arm64-musl": "4.52.5", - "@rollup/rollup-linux-loong64-gnu": "4.52.5", - "@rollup/rollup-linux-ppc64-gnu": "4.52.5", - "@rollup/rollup-linux-riscv64-gnu": "4.52.5", - "@rollup/rollup-linux-riscv64-musl": "4.52.5", - "@rollup/rollup-linux-s390x-gnu": "4.52.5", - "@rollup/rollup-linux-x64-gnu": "4.52.5", - "@rollup/rollup-linux-x64-musl": "4.52.5", - "@rollup/rollup-openharmony-arm64": "4.52.5", - "@rollup/rollup-win32-arm64-msvc": "4.52.5", - "@rollup/rollup-win32-ia32-msvc": "4.52.5", - "@rollup/rollup-win32-x64-gnu": "4.52.5", - "@rollup/rollup-win32-x64-msvc": "4.52.5", + "@rollup/rollup-android-arm-eabi": "4.62.2", + "@rollup/rollup-android-arm64": "4.62.2", + "@rollup/rollup-darwin-arm64": "4.62.2", + "@rollup/rollup-darwin-x64": "4.62.2", + "@rollup/rollup-freebsd-arm64": "4.62.2", + "@rollup/rollup-freebsd-x64": "4.62.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.62.2", + "@rollup/rollup-linux-arm-musleabihf": "4.62.2", + "@rollup/rollup-linux-arm64-gnu": "4.62.2", + "@rollup/rollup-linux-arm64-musl": "4.62.2", + "@rollup/rollup-linux-loong64-gnu": "4.62.2", + "@rollup/rollup-linux-loong64-musl": "4.62.2", + "@rollup/rollup-linux-ppc64-gnu": "4.62.2", + "@rollup/rollup-linux-ppc64-musl": "4.62.2", + "@rollup/rollup-linux-riscv64-gnu": "4.62.2", + "@rollup/rollup-linux-riscv64-musl": "4.62.2", + "@rollup/rollup-linux-s390x-gnu": "4.62.2", + "@rollup/rollup-linux-x64-gnu": "4.62.2", + "@rollup/rollup-linux-x64-musl": "4.62.2", + "@rollup/rollup-openbsd-x64": "4.62.2", + "@rollup/rollup-openharmony-arm64": "4.62.2", + "@rollup/rollup-win32-arm64-msvc": "4.62.2", + "@rollup/rollup-win32-ia32-msvc": "4.62.2", + "@rollup/rollup-win32-x64-gnu": "4.62.2", + "@rollup/rollup-win32-x64-msvc": "4.62.2", "fsevents": "~2.3.2" } }, @@ -11521,24 +10696,10 @@ } }, "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], "license": "MIT" }, "node_modules/safe-push-apply": { @@ -11577,9 +10738,9 @@ "license": "MIT" }, "node_modules/sanitize-filename": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.3.tgz", - "integrity": "sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==", + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.4.tgz", + "integrity": "sha512-9ZyI08PsvdQl2r/bBIGubpVdR3RR9sY6RDiWFPreA21C/EFlQhmgo20UZlNjZMMZNubusLhAQozkA0Od5J21Eg==", "dev": true, "license": "WTFPL OR ISC", "dependencies": { @@ -11587,9 +10748,9 @@ } }, "node_modules/sax": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.4.tgz", - "integrity": "sha512-1n3r/tGXO6b6VXMdFT54SHzT9ytu9yr7TaELowdYpMqY/Ao7EnlQGmAQ1+RatX7Tkkdm6hONI2owqNx2aZj5Sw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.6.0.tgz", + "integrity": "sha512-6R3J5M4AcbtLUdZmRv2SygeVaM7IhrLXu9BmnOGmmACak8fiUtOsYNWUS4uK7upbmHIBbLBeFeI//477BKLBzA==", "dev": true, "license": "BlueOak-1.0.0", "engines": { @@ -11625,6 +10786,8 @@ }, "node_modules/semver-compare": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", "dev": true, "license": "MIT", "optional": true @@ -11672,6 +10835,8 @@ }, "node_modules/serialize-error": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz", + "integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==", "dev": true, "license": "MIT", "optional": true, @@ -11687,6 +10852,8 @@ }, "node_modules/serialize-error/node_modules/type-fest": { "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", "dev": true, "license": "(MIT OR CC0-1.0)", "optional": true, @@ -11777,12 +10944,14 @@ } }, "node_modules/side-channel": { - "version": "1.1.0", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", "license": "MIT", "dependencies": { "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" }, @@ -11794,11 +10963,13 @@ } }, "node_modules/side-channel-list": { - "version": "1.0.0", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", "license": "MIT", "dependencies": { "es-errors": "^1.3.0", - "object-inspect": "^1.13.3" + "object-inspect": "^1.13.4" }, "engines": { "node": ">= 0.4" @@ -11875,63 +11046,6 @@ "node": ">=8" } }, - "node_modules/slice-ansi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", - "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/smart-buffer": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6.0.0", - "npm": ">= 3.0.0" - } - }, - "node_modules/socks": { - "version": "2.8.7", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.7.tgz", - "integrity": "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ip-address": "^10.0.1", - "smart-buffer": "^4.2.0" - }, - "engines": { - "node": ">= 10.0.0", - "npm": ">= 3.0.0" - } - }, - "node_modules/socks-proxy-agent": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", - "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.2", - "debug": "^4.3.4", - "socks": "^2.8.3" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -11972,33 +11086,12 @@ }, "node_modules/sprintf-js": { "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", "dev": true, "license": "BSD-3-Clause", "optional": true }, - "node_modules/ssri": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-12.0.0.tgz", - "integrity": "sha512-S7iGNosepx9RadX82oimUkvr0Ct7IjJbEbs4mJcTxst8um95J3sDYU1RBEOvdu6oL1Wek2ODI5i4MAw+dZ6cAQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "minipass": "^7.0.3" - }, - "engines": { - "node": "^18.17.0 || >=20.5.0" - } - }, - "node_modules/ssri/node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, "node_modules/stackback": { "version": "0.0.2", "dev": true, @@ -12027,7 +11120,9 @@ } }, "node_modules/std-env": { - "version": "3.10.0", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.2.0.tgz", + "integrity": "sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==", "dev": true, "license": "MIT" }, @@ -12044,13 +11139,13 @@ } }, "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "license": "MIT", "dependencies": { - "safe-buffer": "~5.2.0" + "safe-buffer": "~5.1.0" } }, "node_modules/string-convert": { @@ -12264,16 +11359,10 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/sucrase/node_modules/minipass": { - "version": "7.1.2", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, "node_modules/sumchecker": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-3.0.1.tgz", + "integrity": "sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -12353,9 +11442,9 @@ } }, "node_modules/tar": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.6.tgz", - "integrity": "sha512-xqUeu2JAIJpXyvskvU3uvQW8PAmHrtXp2KDuMJwQqW8Sqq0CaZBAQ+dKS3RBXVhU4wC5NjAdKrmh84241gO9cA==", + "version": "7.5.20", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.20.tgz", + "integrity": "sha512-9FcyK4PA6+WbzlTM9WhQm6vB5W7cP7dUiPsv1g7YDwEQnQ1CGpK3MGlKk/ITVWMk05kHZuBhmVhiv8LZoy/PFQ==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -12369,16 +11458,6 @@ "node": ">=18" } }, - "node_modules/tar/node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, "node_modules/tar/node_modules/yallist": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", @@ -12415,44 +11494,6 @@ "fs-extra": "^10.0.0" } }, - "node_modules/temp-file/node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/temp-file/node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/temp-file/node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/temp/node_modules/rimraf": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", @@ -12576,9 +11617,9 @@ } }, "node_modules/tinyglobby/node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true, "license": "MIT", "engines": { @@ -12589,9 +11630,9 @@ } }, "node_modules/tinyrainbow": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.0.3.tgz", - "integrity": "sha512-PSkbLUoxOFRzJYjjxHJt9xro7D+iilgMX/C9lawzVuYiIdcihh9DXmVibBe8lmcFrRi/VzlPjBxbN7rH24q8/Q==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.1.0.tgz", + "integrity": "sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==", "dev": true, "license": "MIT", "engines": { @@ -12599,9 +11640,9 @@ } }, "node_modules/tmp": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz", - "integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==", + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.7.tgz", + "integrity": "sha512-e0votIpp4Uo2AJYSzVHV6xCcawuiez3DzqDAbrTc3YxBkplN6e+dM13ZeIcZnDg/QpSuU2zfZ3rzwY8ukEnaXw==", "dev": true, "license": "MIT", "engines": { @@ -12706,6 +11747,13 @@ "json5": "lib/cli.js" } }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" + }, "node_modules/type-check": { "version": "0.4.0", "dev": true, @@ -12860,6 +11908,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.28.0.tgz", + "integrity": "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=20.18.1" + } + }, "node_modules/undici-types": { "version": "6.21.0", "dev": true, @@ -12883,32 +11942,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/unique-filename": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-4.0.0.tgz", - "integrity": "sha512-XSnEewXmQ+veP7xX2dS5Q4yZAvO40cBN2MWkJ7D/6sW4Dg6wYBNwM1Vrnz1FhH5AdeLIlUXRI9e28z1YZi71NQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "unique-slug": "^5.0.0" - }, - "engines": { - "node": "^18.17.0 || >=20.5.0" - } - }, - "node_modules/unique-slug": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-5.0.0.tgz", - "integrity": "sha512-9OdaqO5kwqR+1kVgHAhsp5vPNU0hnxRa26rBFNfNgM7M6pNtgzeBn3s/xbyCQL3dcjzOatcef6UUHpB/6MaETg==", - "dev": true, - "license": "ISC", - "dependencies": { - "imurmurhash": "^0.1.4" - }, - "engines": { - "node": "^18.17.0 || >=20.5.0" - } - }, "node_modules/unist-util-is": { "version": "6.0.1", "dev": true, @@ -12973,11 +12006,13 @@ } }, "node_modules/universalify": { - "version": "0.1.2", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, "license": "MIT", "engines": { - "node": ">= 4.0.0" + "node": ">= 10.0.0" } }, "node_modules/unpipe": { @@ -12987,6 +12022,35 @@ "node": ">= 0.8" } }, + "node_modules/unzipper": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.12.5.tgz", + "integrity": "sha512-tXYOi9R57Uj/2Z25SOs5RRSzq886MBQj2gY8dPL+xl/kv6s6SvByoKfAtvfVeEuhntWDgjd2o9p2lb4TVPAz0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "bluebird": "~3.7.2", + "duplexer2": "~0.1.4", + "fs-extra": "11.3.1", + "graceful-fs": "^4.2.2", + "node-int64": "^0.4.0" + } + }, + "node_modules/unzipper/node_modules/fs-extra": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.1.tgz", + "integrity": "sha512-eXvGGwZ5CL17ZSwHWd3bbgk7UUpF6IFHtP57NYYakPvHOs8GDgDe5KJI36jIJzDkJ6eJjuzRA8eBQb6SkKue0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, "node_modules/update-browserslist-db": { "version": "1.1.4", "dev": true, @@ -13045,14 +12109,16 @@ "license": "MIT" }, "node_modules/uuid": { - "version": "9.0.1", + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.1.tgz", + "integrity": "sha512-6ZxzVpzDXDa3bJWaHilVayA+BH/1zmxCJoVgvmqJnid/gPoKHxUrS/aC/T6LGQtNHT+XHG9fXPJB4d+IrU30Ew==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" ], "license": "MIT", "bin": { - "uuid": "dist/bin/uuid" + "uuid": "dist-node/bin/uuid" } }, "node_modules/vary": { @@ -13062,22 +12128,6 @@ "node": ">= 0.8" } }, - "node_modules/verror": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.1.tgz", - "integrity": "sha512-veufcmxri4e3XSrT0xwfUR7kguIkaxBeosDg00yDWhk49wdwkSUrvvsm7nc75e1PUyvIeZj6nS8VQRYz2/S4Xg==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - }, - "engines": { - "node": ">=0.6.0" - } - }, "node_modules/vfile": { "version": "6.0.3", "dev": true, @@ -13126,13 +12176,13 @@ } }, "node_modules/vite": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz", - "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==", + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.6.tgz", + "integrity": "sha512-4XP60spRGjSZFf1qYH+dJIkK2znL3zQfl9KkOV9MkkRR/3Dls0dxaBsQPTloEc5BLXWPL9vsOxopxyKoMmDueg==", "dev": true, "license": "MIT", "dependencies": { - "esbuild": "^0.27.0", + "esbuild": "^0.27.0 || ^0.28.0", "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", @@ -13711,9 +12761,9 @@ } }, "node_modules/vite/node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true, "license": "MIT", "engines": { @@ -13724,31 +12774,31 @@ } }, "node_modules/vitest": { - "version": "4.0.17", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.0.17.tgz", - "integrity": "sha512-FQMeF0DJdWY0iOnbv466n/0BudNdKj1l5jYgl5JVTwjSsZSlqyXFt/9+1sEyhR6CLowbZpV7O1sCHrzBhucKKg==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.10.tgz", + "integrity": "sha512-R9jUTe5S4Qb0HCd4TNqpC7oGcrMssMRGXLW80ubjWsW9VH5GF8y1Y0SFLY9AbqSk6nt0PnOx4H4WNJYZ13GUPw==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/expect": "4.0.17", - "@vitest/mocker": "4.0.17", - "@vitest/pretty-format": "4.0.17", - "@vitest/runner": "4.0.17", - "@vitest/snapshot": "4.0.17", - "@vitest/spy": "4.0.17", - "@vitest/utils": "4.0.17", - "es-module-lexer": "^1.7.0", - "expect-type": "^1.2.2", + "@vitest/expect": "4.1.10", + "@vitest/mocker": "4.1.10", + "@vitest/pretty-format": "4.1.10", + "@vitest/runner": "4.1.10", + "@vitest/snapshot": "4.1.10", + "@vitest/spy": "4.1.10", + "@vitest/utils": "4.1.10", + "es-module-lexer": "^2.0.0", + "expect-type": "^1.3.0", "magic-string": "^0.30.21", "obug": "^2.1.1", "pathe": "^2.0.3", "picomatch": "^4.0.3", - "std-env": "^3.10.0", + "std-env": "^4.0.0-rc.1", "tinybench": "^2.9.0", "tinyexec": "^1.0.2", "tinyglobby": "^0.2.15", - "tinyrainbow": "^3.0.3", - "vite": "^6.0.0 || ^7.0.0", + "tinyrainbow": "^3.1.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", "why-is-node-running": "^2.3.0" }, "bin": { @@ -13764,12 +12814,15 @@ "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", - "@vitest/browser-playwright": "4.0.17", - "@vitest/browser-preview": "4.0.17", - "@vitest/browser-webdriverio": "4.0.17", - "@vitest/ui": "4.0.17", + "@vitest/browser-playwright": "4.1.10", + "@vitest/browser-preview": "4.1.10", + "@vitest/browser-webdriverio": "4.1.10", + "@vitest/coverage-istanbul": "4.1.10", + "@vitest/coverage-v8": "4.1.10", + "@vitest/ui": "4.1.10", "happy-dom": "*", - "jsdom": "*" + "jsdom": "*", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "@edge-runtime/vm": { @@ -13790,6 +12843,12 @@ "@vitest/browser-webdriverio": { "optional": true }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, "@vitest/ui": { "optional": true }, @@ -13798,13 +12857,16 @@ }, "jsdom": { "optional": true + }, + "vite": { + "optional": false } } }, "node_modules/vitest/node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true, "license": "MIT", "engines": { @@ -13814,14 +12876,18 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "node_modules/webcrypto-core": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/webcrypto-core/-/webcrypto-core-1.9.2.tgz", + "integrity": "sha512-gsXecm82UQNlTBURJGuqOWy1Ww08S3kZUcr3aOJS02Pk0xLtkfeUAVC0u0xhgdonFme80edSJUIJyuvL/7250Q==", "dev": true, "license": "MIT", "dependencies": { - "defaults": "^1.0.3" + "@peculiar/asn1-schema": "^2.7.0", + "@peculiar/json-schema": "^1.1.12", + "@peculiar/utils": "^2.0.2", + "asn1js": "^3.0.10", + "tslib": "^2.8.1" } }, "node_modules/which": { @@ -13944,6 +13010,8 @@ }, "node_modules/wrap-ansi": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "license": "MIT", "dependencies": { @@ -13991,6 +13059,8 @@ }, "node_modules/y18n": { "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, "license": "ISC", "engines": { @@ -13999,13 +13069,15 @@ }, "node_modules/yallist": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true, "license": "ISC" }, "node_modules/yaml": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz", - "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", + "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", "dev": true, "license": "ISC", "bin": { @@ -14019,7 +13091,9 @@ } }, "node_modules/yargs": { - "version": "17.7.2", + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", "dev": true, "license": "MIT", "dependencies": { @@ -14037,21 +13111,14 @@ }, "node_modules/yargs-parser": { "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, "license": "ISC", "engines": { "node": ">=12" } }, - "node_modules/yauzl": { - "version": "2.10.0", - "dev": true, - "license": "MIT", - "dependencies": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } - }, "node_modules/yocto-queue": { "version": "0.1.0", "dev": true, diff --git a/package.json b/package.json index d963957..1185d07 100644 --- a/package.json +++ b/package.json @@ -52,24 +52,20 @@ "dependencies": { "axios": "^1.13.0", "chokidar": "^3.5.3", - "cors": "^2.8.5", "express": "^5.1.0", "js-yaml": "^4.1.1", - "node-cron": "^3.0.3", - "uuid": "^9.0.0" + "node-cron": "^4.6.0", + "uuid": "^14.0.1" }, "devDependencies": { "@monaco-editor/react": "^4.7.0", - "@types/cors": "^2.8.19", "@types/express": "^5.0.6", "@types/js-yaml": "^4.0.9", "@types/node": "^20.10.0", - "@types/node-cron": "^3.0.11", "@types/react": "^18.2.0", "@types/react-dom": "^18.2.0", "@types/react-syntax-highlighter": "^15.5.13", "@types/react-window": "^1.8.8", - "@types/uuid": "^9.0.0", "@typescript-eslint/eslint-plugin": "^7.7.0", "@typescript-eslint/parser": "^7.7.0", "@vitejs/plugin-react": "^4.2.0", @@ -102,7 +98,9 @@ "zustand": "^4.4.0" }, "overrides": { - "@electron/rebuild": "^4.0.2" + "@electron/rebuild": "^4.0.2", + "brace-expansion": "2.0.3", + "dompurify": "3.4.12" }, "build": { "appId": "com.claudecode.butler", diff --git a/requirements-security.txt b/requirements-security.txt new file mode 100644 index 0000000..949d363 --- /dev/null +++ b/requirements-security.txt @@ -0,0 +1,2 @@ +# Semgrep CLI used for reproducible local security audits. +semgrep==1.169.0 diff --git a/src/main/services/project-management-service.ts b/src/main/services/project-management-service.ts index 6f2b0f8..5fc3fcb 100644 --- a/src/main/services/project-management-service.ts +++ b/src/main/services/project-management-service.ts @@ -916,6 +916,7 @@ class ProjectManagementService { */ private async launchTerminalProcess(spec: TerminalLaunchSpec): Promise { await new Promise((resolve, reject) => { + // nosemgrep: javascript.lang.security.detect-child-process.detect-child-process - spec 仅由私有平台构造器生成,参数数组不会经过 shell。 const child = spawn(spec.filePath, spec.args, { cwd: spec.workingDirectory, detached: true, diff --git a/src/main/services/terminal-management-service.ts b/src/main/services/terminal-management-service.ts index 085f3f0..ba6c85d 100644 --- a/src/main/services/terminal-management-service.ts +++ b/src/main/services/terminal-management-service.ts @@ -377,6 +377,7 @@ class TerminalManagementService { logger.info(`探测命令启动 [${terminalType}]: ${command}`) return await new Promise((resolve) => { + // nosemgrep: javascript.lang.security.detect-child-process.detect-child-process - 本地 MCP 配置需要 shell 初始化;renderer IPC 另由 allowlist 隔离。 const child = spawn(execCommand, { cwd: execOptions.cwd, shell: true, diff --git a/src/main/task-scheduler.ts b/src/main/task-scheduler.ts index 4e3241b..c8a6da9 100644 --- a/src/main/task-scheduler.ts +++ b/src/main/task-scheduler.ts @@ -67,11 +67,10 @@ export class TaskScheduler extends EventEmitter { return } - // 创建定时任务 - const task = cron.schedule(cronExpression, async () => { + // createTask 不会自动启动,确保 disabled rule 不会在注册瞬间执行 + const task = cron.createTask(cronExpression, async () => { await this.executeRule(rule) }, { - scheduled: false, // 先不启动 timezone: 'Asia/Shanghai' }) @@ -441,4 +440,4 @@ export class TaskScheduler extends EventEmitter { lastExecution: this.executionLog[0]?.timestamp || null } } -} \ No newline at end of file +} diff --git a/src/main/utils/command-executor.ts b/src/main/utils/command-executor.ts index b045285..5fcc9f3 100644 --- a/src/main/utils/command-executor.ts +++ b/src/main/utils/command-executor.ts @@ -88,6 +88,7 @@ export async function executeCommand( return new Promise((resolve) => { let child: ReturnType try { + // nosemgrep: javascript.lang.security.detect-child-process.detect-child-process - parseCommand 拒绝 shell 元字符,且 shell:false 保持参数边界。 child = spawn(binary, args, { cwd: options.cwd, env: options.env, diff --git a/src/main/utils/privilege-manager.ts b/src/main/utils/privilege-manager.ts index 174b647..7c9a76f 100644 --- a/src/main/utils/privilege-manager.ts +++ b/src/main/utils/privilege-manager.ts @@ -4,7 +4,7 @@ */ import { app, dialog } from 'electron' -import { exec } from 'child_process' +import { execFile } from 'child_process' import { promises as fs } from 'fs' import * as fsSync from 'fs' import { join } from 'path' @@ -41,6 +41,94 @@ export interface ElevationOptions { retryOnFailure?: boolean } +/** 参数化权限提升进程规格 */ +export interface ElevationLaunchSpec { + /** 允许执行的系统提权程序 */ + command: string + /** 直接传给提权程序的参数数组 */ + args: string[] +} + +const ELEVATION_COMMANDS = new Set(['powershell.exe', 'osascript', 'pkexec', 'sudo']) + +/** + * 将文本编码为 PowerShell 单引号字面量内容 + * @param value 原始参数 + * @returns 可安全放入 PowerShell 单引号字符串的内容 + */ +function escapePowerShellLiteral(value: string): string { + return value.replace(/'/g, "''") +} + +/** + * 将参数编码为 POSIX shell 单引号参数 + * @param value 原始参数 + * @returns 不会被 shell 解释为额外语法的参数文本 + */ +function quotePosixShellArgument(value: string): string { + return `'${value.replace(/'/g, `'\\''`)}'` +} + +/** + * 转义 AppleScript 双引号字符串内容 + * @param value 原始脚本文本 + * @returns 可安全嵌入 AppleScript 字符串的内容 + */ +function escapeAppleScriptString(value: string): string { + return value.replace(/\\/g, '\\\\').replace(/"/g, '\\"') +} + +/** + * 构造跨平台权限提升进程规格 + * @description 所有动态值均先按目标解释器转义,返回值必须通过 execFile 参数化执行。 + * @param platform 目标操作系统 + * @param currentExecutable 当前应用可执行文件 + * @param currentArgs 当前应用参数 + * @param linuxCommand Linux 上已探测可用的提权程序 + * @returns 受控 executable 与 argument array + */ +export function buildElevationLaunchSpec( + platform: NodeJS.Platform, + currentExecutable: string, + currentArgs: string[], + linuxCommand: 'pkexec' | 'sudo' = 'sudo' +): ElevationLaunchSpec { + if (platform === 'win32') { + const executableLiteral = escapePowerShellLiteral(currentExecutable) + const argumentListLiteral = currentArgs.length > 0 + ? `@(${currentArgs.map((arg) => `'${escapePowerShellLiteral(arg)}'`).join(', ')})` + : '@()' + + return { + command: 'powershell.exe', + args: [ + '-NoProfile', + '-Command', + `Start-Process -FilePath '${executableLiteral}' -ArgumentList ${argumentListLiteral} -Verb RunAs` + ] + } + } + + if (platform === 'darwin') { + const shellCommand = [currentExecutable, ...currentArgs] + .map(quotePosixShellArgument) + .join(' ') + + return { + command: 'osascript', + args: [ + '-e', + `do shell script "exec ${escapeAppleScriptString(shellCommand)}" with administrator privileges` + ] + } + } + + return { + command: linuxCommand, + args: [currentExecutable, ...currentArgs] + } +} + /** * 权限管理器类 */ @@ -299,45 +387,17 @@ export class PrivilegeManager { */ public async relaunchAsAdmin(): Promise { try { - const isWindows = process.platform === 'win32' - const isMacOS = process.platform === 'darwin' - const currentExecutable = process.execPath const currentArgs = process.argv.slice(1) - - let command: string - let args: string[] - - if (isWindows) { - // Windows: 使用 PowerShell 以管理员权限运行 - command = 'powershell.exe' - args = [ - '-Command', - 'Start-Process', - `"${currentExecutable}"`, - '-ArgumentList', - `"${currentArgs.join('" "').replace(/"/g, '""')}"`, - '-Verb', - 'RunAs' - ] - } else if (isMacOS) { - // macOS: 使用 osascript 提升权限 - command = 'osascript' - args = [ - '-e', - `do shell script "exec '${currentExecutable}' ${currentArgs.join(' ')}" with administrator privileges` - ] - } else { - // Linux: 使用 pkexec 或 sudo - const hasPkexec = await this.checkCommandExists('pkexec') - if (hasPkexec) { - command = 'pkexec' - args = [currentExecutable, ...currentArgs] - } else { - command = 'sudo' - args = [currentExecutable, ...currentArgs] - } - } + const linuxCommand = process.platform === 'linux' && await this.checkCommandExists('pkexec') + ? 'pkexec' + : 'sudo' + const { command, args } = buildElevationLaunchSpec( + process.platform, + currentExecutable, + currentArgs, + linuxCommand + ) logger.info(`准备以管理员权限重启应用: ${command} ${args.join(' ')}`) @@ -395,7 +455,7 @@ export class PrivilegeManager { } // 方法2: 使用 whoami /priv 检查权限 - exec('whoami /priv', (error: unknown, stdout: string, _stderr: string) => { + execFile('whoami', ['/priv'], (error: unknown, stdout: string, _stderr: string) => { if (!error) { // 检查是否包含 SeShutdownPrivilege 等管理员权限 const adminPrivileges = [ @@ -415,7 +475,7 @@ export class PrivilegeManager { } // 方法3: 检查管理员组SID - exec('whoami /groups', (error: unknown, stdout: string, _stderr: string) => { + execFile('whoami', ['/groups'], (error: unknown, stdout: string, _stderr: string) => { if (!error) { const adminIndicators = [ 'S-1-5-32-544', // Administrators group SID @@ -436,7 +496,7 @@ export class PrivilegeManager { } // 方法4: 尝试 net session 命令 - exec('net session', (netError: unknown, _netStdout: string, _netStderr: string) => { + execFile('net', ['session'], (netError: unknown, _netStdout: string, _netStderr: string) => { if (!netError) { logger.debug('方法4成功: net session 命令执行成功') resolve(true) @@ -444,7 +504,11 @@ export class PrivilegeManager { } // 方法5: 检查进程完整性级别 - exec('powershell -Command "([System.Security.Principal.WindowsPrincipal][System.Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)"', (psError: unknown, psStdout: string) => { + execFile('powershell.exe', [ + '-NoProfile', + '-Command', + '([System.Security.Principal.WindowsPrincipal][System.Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)' + ], (psError: unknown, psStdout: string) => { if (!psError && psStdout.includes('True')) { logger.debug('方法5成功: PowerShell 管理员角色检查') resolve(true) @@ -465,7 +529,7 @@ export class PrivilegeManager { */ private async checkMacOSAdminPrivileges(): Promise { return new Promise((resolve) => { - exec('id -un', (error: unknown, stdout: string) => { + execFile('id', ['-un'], (error: unknown, stdout: string) => { // 检查是否是 root 用户 resolve(!error && stdout.trim() === 'root') }) @@ -477,7 +541,7 @@ export class PrivilegeManager { */ private async checkLinuxAdminPrivileges(): Promise { return new Promise((resolve) => { - exec('id -u', (error: unknown, stdout: string) => { + execFile('id', ['-u'], (error: unknown, stdout: string) => { // 检查用户 ID 是否为 0 (root) resolve(!error && stdout.trim() === '0') }) @@ -513,7 +577,7 @@ export class PrivilegeManager { return result.response === 0 } catch (error) { logger.error('显示权限提升警告失败:', error) - return true // 默认允许 + return false } } @@ -556,8 +620,13 @@ export class PrivilegeManager { * 检查命令是否存在 */ private async checkCommandExists(command: string): Promise { + if (!/^[A-Za-z0-9._+-]+$/.test(command)) { + logger.warn(`拒绝检查非法命令名称: ${command}`) + return false + } + return new Promise((resolve) => { - exec(`which ${command}`, (error: unknown) => { + execFile('which', [command], (error: unknown) => { resolve(!error) }) }) @@ -567,8 +636,12 @@ export class PrivilegeManager { * 执行提升权限的命令 */ private async executeElevatedCommand(command: string, args: string[]): Promise { + if (!ELEVATION_COMMANDS.has(command)) { + throw new Error(`不允许执行未注册的提权命令: ${command}`) + } + return new Promise((resolve, reject) => { - exec(`${command} ${args.join(' ')}`, (_error: unknown, _stdout: string, stderr: string) => { + execFile(command, args, (_error: unknown, _stdout: string, stderr: string) => { if (_error) { reject(new Error(`执行命令失败: ${stderr}`)) } else { @@ -580,4 +653,4 @@ export class PrivilegeManager { } // 导出单例实例 -export const privilegeManager = PrivilegeManager.getInstance() \ No newline at end of file +export const privilegeManager = PrivilegeManager.getInstance() diff --git a/src/proxy-server/package-lock.json b/src/proxy-server/package-lock.json index 1181a43..4d3e83c 100644 --- a/src/proxy-server/package-lock.json +++ b/src/proxy-server/package-lock.json @@ -10,14 +10,12 @@ "license": "MIT", "dependencies": { "axios": "^1.13.0", - "cors": "^2.8.5", "dotenv": "^16.3.1", "express": "^5.1.0", "http-proxy-middleware": "^3.0.0", "winston": "^3.11.0" }, "devDependencies": { - "@types/cors": "^2.8.17", "@types/express": "^5.0.6", "@types/node": "^20.10.0", "tsx": "^4.7.0", @@ -517,16 +515,6 @@ "@types/node": "*" } }, - "node_modules/@types/cors": { - "version": "2.8.19", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.19.tgz", - "integrity": "sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/express": { "version": "5.0.6", "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.6.tgz", @@ -852,23 +840,6 @@ "node": ">=6.6.0" } }, - "node_modules/cors": { - "version": "2.8.6", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz", - "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==", - "license": "MIT", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", @@ -1592,15 +1563,6 @@ "node": ">= 0.6" } }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/object-inspect": { "version": "1.13.4", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", diff --git a/src/proxy-server/package.json b/src/proxy-server/package.json index 71b1386..6eb74fb 100644 --- a/src/proxy-server/package.json +++ b/src/proxy-server/package.json @@ -21,12 +21,10 @@ "axios": "^1.13.0", "winston": "^3.11.0", "dotenv": "^16.3.1", - "cors": "^2.8.5", "http-proxy-middleware": "^3.0.0" }, "devDependencies": { "@types/express": "^5.0.6", - "@types/cors": "^2.8.17", "@types/node": "^20.10.0", "tsx": "^4.7.0", "typescript": "^5.3.0" diff --git a/src/proxy-server/src/server.ts b/src/proxy-server/src/server.ts index abdfd6f..895ddfb 100644 --- a/src/proxy-server/src/server.ts +++ b/src/proxy-server/src/server.ts @@ -4,7 +4,6 @@ */ import express from 'express' -import cors from 'cors' import axios, { type AxiosRequestConfig } from 'axios' import { readFileSync } from 'fs' import { fileURLToPath } from 'url' @@ -29,7 +28,6 @@ export function createProxyServer(config: ProxyServerConfig): express.Applicatio const logger = getLogger() // 中间件配置 - app.use(cors()) app.use(express.json({ limit: '50mb' })) // 请求日志中间件 diff --git a/src/renderer/src/styles/components/Config.css b/src/renderer/src/styles/components/Config.css index 75d1339..0d1cded 100644 --- a/src/renderer/src/styles/components/Config.css +++ b/src/renderer/src/styles/components/Config.css @@ -232,18 +232,3 @@ font-size: 14px; } } - -/* 暗色主题 */ - background: var(--bg-elevated); - border-color: var(--border-light); -} - - - - - - - - - - diff --git a/src/renderer/src/styles/components/Header.css b/src/renderer/src/styles/components/Header.css index 8bb70cb..2a9ec15 100644 --- a/src/renderer/src/styles/components/Header.css +++ b/src/renderer/src/styles/components/Header.css @@ -140,13 +140,3 @@ padding: 4px 8px; } } - -/* 暗色主题 */ - - - - color: var(--border); -} - - background: var(--border-light); -} \ No newline at end of file diff --git a/src/renderer/src/styles/globals.css b/src/renderer/src/styles/globals.css index 50bafa3..eecb40f 100644 --- a/src/renderer/src/styles/globals.css +++ b/src/renderer/src/styles/globals.css @@ -4,6 +4,11 @@ * 主题定义见 src/renderer/src/themes/index.ts,切换时 :root 变量自动更新。 */ +/* 组件样式引入:CSS 规范要求 @import 位于所有 style rules 之前 */ +@import './components/Header.css'; +@import './components/Sidebar.css'; +@import './components/Config.css'; + /* 兜底变量(主题 JS 加载前的默认值,与 CCB Dark Pro 一致) */ :root { --bg-base: #1e1e1e; @@ -45,11 +50,6 @@ --toolbar-height: 28px; } -/* 组件样式引入 */ -@import './components/Header.css'; -@import './components/Sidebar.css'; -@import './components/Config.css'; - /* 重置样式 */ * { margin: 0; @@ -947,4 +947,4 @@ textarea.ant-input::placeholder, .ant-btn { display: none !important; } -} \ No newline at end of file +} diff --git a/tests/unit/main/privilege-manager.spec.ts b/tests/unit/main/privilege-manager.spec.ts new file mode 100644 index 0000000..8d214db --- /dev/null +++ b/tests/unit/main/privilege-manager.spec.ts @@ -0,0 +1,71 @@ +/** + * privilege-manager 单元测试 + * @description 验证跨平台提权命令保持参数边界,并正确转义解释器字符串。 + */ + +import { describe, expect, it, vi } from 'vitest' + +vi.mock('electron', () => ({ + app: { + getPath: vi.fn(() => 'C:\\test-user-data'), + quit: vi.fn() + }, + dialog: { + showMessageBox: vi.fn() + } +})) + +vi.mock('../../../src/main/utils/logger', () => ({ + logger: { + info: vi.fn(), + warn: vi.fn(), + error: vi.fn(), + debug: vi.fn() + } +})) + +import { buildElevationLaunchSpec } from '../../../src/main/utils/privilege-manager' + +describe('buildElevationLaunchSpec(提权命令参数化)', () => { + it('Windows 应将单引号作为 PowerShell 字面量转义', () => { + const spec = buildElevationLaunchSpec( + 'win32', + "C:\\Apps\\O'Brien\\ccb.exe", + ["--profile=owner's", '; Remove-Item C:\\'] + ) + + expect(spec.command).toBe('powershell.exe') + expect(spec.args).toHaveLength(3) + expect(spec.args[2]).toContain("O''Brien") + expect(spec.args[2]).toContain("owner''s") + expect(spec.args[2]).toContain("'; Remove-Item C:\\'") + }) + + it('macOS 应同时保护 POSIX shell 与 AppleScript 字符串边界', () => { + const spec = buildElevationLaunchSpec( + 'darwin', + "/Applications/CCB's App/ccb", + ['$(touch /tmp/injected)', 'argument with spaces'] + ) + + expect(spec.command).toBe('osascript') + expect(spec.args).toHaveLength(2) + expect(spec.args[1]).toContain("'$(touch /tmp/injected)'") + expect(spec.args[1]).toContain("'argument with spaces'") + expect(spec.args[1]).toContain("CCB'\\\\''s App") + }) + + it('Linux 应直接传递 executable 与 args,不生成 shell command string', () => { + const spec = buildElevationLaunchSpec( + 'linux', + '/opt/ccb/ccb', + ['--config', '/tmp/a;touch injected'], + 'pkexec' + ) + + expect(spec).toEqual({ + command: 'pkexec', + args: ['/opt/ccb/ccb', '--config', '/tmp/a;touch injected'] + }) + }) +}) diff --git a/tests/unit/main/task-scheduler.spec.ts b/tests/unit/main/task-scheduler.spec.ts new file mode 100644 index 0000000..6c40e0a --- /dev/null +++ b/tests/unit/main/task-scheduler.spec.ts @@ -0,0 +1,84 @@ +/** + * TaskScheduler 单元测试 + * @description 验证 node-cron 4 升级后,规则注册与启用状态保持原有语义。 + */ + +import { beforeEach, describe, expect, it, vi } from 'vitest' +import type { Rule } from '../../../src/shared/types/rule' + +const { cronTask, createTask } = vi.hoisted(() => { + const task = { + start: vi.fn(), + stop: vi.fn() + } + + return { + cronTask: task, + createTask: vi.fn(() => task) + } +}) + +vi.mock('node-cron', () => ({ + createTask +})) + +vi.mock('../../../src/main/utils/logger', () => ({ + logger: { + info: vi.fn(), + warn: vi.fn(), + error: vi.fn(), + debug: vi.fn() + } +})) + +import { TaskScheduler } from '../../../src/main/task-scheduler' + +/** + * 创建调度测试所需的最小规则 + * @param enabled 是否启用规则 + * @returns 可生成有效 cron expression 的规则 + */ +function createRule(enabled: boolean): Rule { + return { + id: enabled ? 'enabled-rule' : 'disabled-rule', + name: enabled ? 'Enabled rule' : 'Disabled rule', + enabled, + priority: 1, + condition: { + type: 'time', + operator: 'between', + value: ['09:00', '10:00'] + }, + action: { + type: 'notification', + params: {} + }, + createdAt: new Date('2026-07-12T00:00:00.000Z'), + updatedAt: new Date('2026-07-12T00:00:00.000Z'), + executionCount: 0 + } +} + +describe('TaskScheduler(node-cron 4 调度语义)', () => { + beforeEach(() => { + vi.clearAllMocks() + }) + + it('disabled rule 应创建 task 但不启动', () => { + const scheduler = new TaskScheduler() + scheduler.start() + scheduler.addRule(createRule(false)) + + expect(createTask).toHaveBeenCalledOnce() + expect(cronTask.start).not.toHaveBeenCalled() + }) + + it('enabled rule 应在创建后显式启动', () => { + const scheduler = new TaskScheduler() + scheduler.start() + scheduler.addRule(createRule(true)) + + expect(createTask).toHaveBeenCalledOnce() + expect(cronTask.start).toHaveBeenCalledOnce() + }) +}) From 71309abb0d298e13e753f47e9e2033ee92752c2d Mon Sep 17 00:00:00 2001 From: NianLog Date: Sun, 12 Jul 2026 22:37:35 +0800 Subject: [PATCH 02/13] feat: add rule-driven tool registry foundation --- CHANGELOG.md | 30 + README.md | 13 +- README_CN.md | 13 +- ...46\261\202\346\226\207\346\241\243-PRD.md" | 109 ++++ ...66\346\236\204\350\256\276\350\256\241.md" | 126 ++++ ...11\345\205\250\346\250\241\345\236\213.md" | 124 ++++ ...75\350\267\257\347\272\277\345\233\276.md" | 114 ++++ ...347\211\214\350\257\255\344\271\211ADR.md" | 52 ++ docs/1.5.0/README.md | 39 ++ src/main/ipc-handlers.ts | 21 + .../services/performance-snapshot-service.ts | 61 ++ src/main/services/registry-update-service.ts | 239 +++++++ src/main/services/tool-registry-service.ts | 243 ++++++++ src/main/services/update-service.ts | 13 + src/main/utils/path-manager.ts | 4 + src/preload/index.ts | 55 +- .../src/components/Settings/SettingsPanel.tsx | 154 ++++- src/renderer/src/locales/index.ts | 42 ++ src/shared/builtin-tool-registry.json | 78 +++ src/shared/performance.ts | 42 ++ src/shared/tool-registry-validator.ts | 586 ++++++++++++++++++ src/shared/tool-registry.ts | 196 ++++++ .../main/performance-snapshot-service.spec.ts | 55 ++ .../unit/main/registry-update-service.spec.ts | 148 +++++ tests/unit/main/tool-registry-service.spec.ts | 160 +++++ .../shared/tool-registry-validator.spec.ts | 114 ++++ 26 files changed, 2825 insertions(+), 6 deletions(-) create mode 100644 "docs/1.5.0/01-\344\272\247\345\223\201\351\234\200\346\261\202\346\226\207\346\241\243-PRD.md" create mode 100644 "docs/1.5.0/02-\350\247\204\345\210\231\351\251\261\345\212\250\346\236\266\346\236\204\350\256\276\350\256\241.md" create mode 100644 "docs/1.5.0/03-\350\247\204\345\210\231\345\272\223\345\215\217\350\256\256\344\270\216\345\256\211\345\205\250\346\250\241\345\236\213.md" create mode 100644 "docs/1.5.0/04-\346\200\247\350\203\275\345\267\245\347\250\213\344\270\216\345\256\236\346\226\275\350\267\257\347\272\277\345\233\276.md" create mode 100644 "docs/1.5.0/05-\345\223\201\347\211\214\350\257\255\344\271\211ADR.md" create mode 100644 docs/1.5.0/README.md create mode 100644 src/main/services/performance-snapshot-service.ts create mode 100644 src/main/services/registry-update-service.ts create mode 100644 src/main/services/tool-registry-service.ts create mode 100644 src/shared/builtin-tool-registry.json create mode 100644 src/shared/performance.ts create mode 100644 src/shared/tool-registry-validator.ts create mode 100644 src/shared/tool-registry.ts create mode 100644 tests/unit/main/performance-snapshot-service.spec.ts create mode 100644 tests/unit/main/registry-update-service.spec.ts create mode 100644 tests/unit/main/tool-registry-service.spec.ts create mode 100644 tests/unit/shared/tool-registry-validator.spec.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 00d60bc..f924366 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,36 @@ --- +## [Unreleased] - 1.5.0 开发中 + +### Added + +- 建立规则驱动多 AI 工具配置平台基础:`ToolDefinition -> ConfigArtifactDefinition -> Capability` 共享 domain contract。 +- 新增 bounded JSON registry validator,限制 bundle/manifest 大小、JSON 深度/节点数、路径变量、detector、handler 与 capability allowlist。 +- 新增内置 Claude Code registry adapter,声明用户 settings、MCP registry 与全局 instructions 三类配置资产。 +- 新增 installed/last-known-good registry 原子存储、SHA-256 integrity、app compatibility、downgrade protection、merge 与显式 rollback。 +- 新增 main-process registry manifest 检查;启动时只检查小型 manifest,不自动下载完整 bundle。 +- Settings/About 新增规则库版本、检查、用户确认安装与 rollback 控件。 +- 新增按需 performance snapshot/export API,记录 Electron per-process CPU/working set,不自动采样或上传。 +- 新增 v1.5.0 PRD、架构、安全协议、性能路线与品牌语义 ADR。 + +### Changed + +- 应用版本检查与 registry manifest 检查并发执行,避免两个网络 timeout 串行叠加。 +- CCB 品牌全称建议升级为 `Cognitive Configuration Bridge`;当前为 provisional decision,等待产品所有者确认后再更新 UI/installer identity。 +- package version 暂时保持 `1.4.0`,直到 v1.5.0 范围与发布验收完成。 + +### Security + +- 远程 registry 禁止携带 JS、shell、动态 module、任意 executable arguments 或未知 capability。 +- Manifest/bundle URL 固定为 main-process pinned HTTPS origin;renderer 无法注入下载 URL 或 hash。 +- Registry 更新需 SHA-256、size、schema、SemVer、minimum app version 全部通过后原子安装。 + +### Tests + +- 新增 registry validator、registry storage/rollback、manifest-only update、explicit install 与 performance snapshot 单元测试。 +- Full Vitest 当前为 14 个测试文件、84 项测试全部通过。 + ## [1.4.0] - 2026-06-15 基于 v1.3.2 全量审计(4 维度:安全/架构/性能/功能)的系统性重做。规划详见 [`docs/1.4.0/`](./docs/1.4.0/)。 diff --git a/README.md b/README.md index 3f1d80a..d025da7 100644 --- a/README.md +++ b/README.md @@ -22,12 +22,14 @@ CCB (Claude Code Butler) is a local-first desktop application built with Electro ### Project Status - **Current release baseline**: `1.4.0` -- **Next milestone**: `1.5.0` planning and development preparation +- **Next milestone**: `1.5.0` foundation development in progress - **Security baseline (2026-07-12)**: Semgrep `0 findings / 0 scan errors`, root and proxy-server npm audits `0 vulnerabilities` -- **Verification baseline**: 65 tests across 10 test files, TypeScript checks, root production build, and proxy-server build passing +- **Verification baseline**: 84 tests across 14 test files, TypeScript checks, root production build, and proxy-server build passing The package version remains `1.4.0` until the `1.5.0` scope, acceptance criteria, and release plan are finalized. See [SECURITY_AUDIT_REPORT.md](./SECURITY_AUDIT_REPORT.md) for the latest audit evidence and accepted trust boundaries. +The proposed new meaning of CCB is **Cognitive Configuration Bridge**, reflecting the transition from a Claude Code-only manager to a rule-driven multi-AI-tool configuration platform. This name is provisional until the product naming decision is confirmed. + ### ✨ Key Features - 🎯 **Config Lifecycle Management** @@ -363,6 +365,13 @@ The three excluded registry rules require the Semgrep Pro engine. Their correspo - Restored component CSS imports to the production bundle and removed invalid orphaned style fragments exposed by PostCSS validation. - Added a reproducible Semgrep environment, raw JSON/SARIF output workflow, and a maintained security audit report. +### v1.5.0 foundation in progress + +- Added a declarative JSON tool registry model with bounded validation and an embedded Claude Code compatibility adapter. +- Added explicit, integrity-checked registry installation and last-known-good rollback; automatic checks fetch only the small manifest. +- Added registry controls under Settings/About and a main-process-only on-demand performance snapshot exporter. +- Architecture, security protocol, performance budgets, migration phases, and provisional brand naming are documented in [`docs/1.5.0`](./docs/1.5.0/README.md). + ### Product experience updates - Added a customizable default template for new configs in `Settings -> Editor Settings`. diff --git a/README_CN.md b/README_CN.md index e964cf5..faee797 100644 --- a/README_CN.md +++ b/README_CN.md @@ -22,12 +22,14 @@ CCB (Claude Code Butler) 是一个基于 Electron、React 和 TypeScript 构建 ### 项目状态 - **当前发布基线**:`1.4.0` -- **下一里程碑**:`1.5.0` 规划与开发准备阶段 +- **下一里程碑**:`1.5.0` 基础设施开发中 - **安全基线(2026-07-12)**:Semgrep `0 findings / 0 scan errors`,root 与 proxy-server npm audit 均为 `0 vulnerabilities` -- **验证基线**:10 个测试文件共 65 项测试、TypeScript 检查、root production build 与 proxy-server build 全部通过 +- **验证基线**:14 个测试文件共 84 项测试、TypeScript 检查、root production build 与 proxy-server build 全部通过 在 `1.5.0` 的范围、验收标准与发布计划确认前,package version 继续保持 `1.4.0`,避免把开发目标误标为已发布版本。最新审计证据与已接受的信任边界见 [SECURITY_AUDIT_REPORT.md](./SECURITY_AUDIT_REPORT.md)。 +CCB 的新全称建议为 **Cognitive Configuration Bridge(智能配置桥)**,用于表达从 Claude Code 专用管理器向规则驱动的多 AI 工具配置平台演进。该名称在产品命名决策确认前保持 provisional 状态。 + ### ✨ 核心功能 - 🎯 **配置全生命周期管理** @@ -363,6 +365,13 @@ semgrep scan \ - 恢复 production bundle 中的组件 CSS imports,并清理 PostCSS 检查发现的残缺无效样式片段。 - 增加可复现的 Semgrep 虚拟环境、JSON/SARIF 原始结果流程与持续维护的安全审计报告。 +### v1.5.0 基础设施开发中 + +- 新增声明式 JSON 工具规则库模型、bounded validation 与内置 Claude Code 兼容 adapter。 +- 新增需用户明确确认、具备 integrity 校验的规则库安装和 last-known-good rollback;自动检查只获取小型 manifest。 +- Settings/About 已加入规则库操作入口,main process 新增完全按需的 performance snapshot exporter。 +- 架构、安全协议、性能预算、迁移阶段与 provisional 品牌方案见 [`docs/1.5.0`](./docs/1.5.0/README.md)。 + ### 产品体验更新 - 新增“新建配置默认模板”,可在 `设置 -> 编辑器设置` 中编辑、保存和弹窗预览。 diff --git "a/docs/1.5.0/01-\344\272\247\345\223\201\351\234\200\346\261\202\346\226\207\346\241\243-PRD.md" "b/docs/1.5.0/01-\344\272\247\345\223\201\351\234\200\346\261\202\346\226\207\346\241\243-PRD.md" new file mode 100644 index 0000000..71129c1 --- /dev/null +++ "b/docs/1.5.0/01-\344\272\247\345\223\201\351\234\200\346\261\202\346\226\207\346\241\243-PRD.md" @@ -0,0 +1,109 @@ +# CCB v1.5.0 产品需求文档(PRD) + +## 1. 背景 + +v1.4.0 已完成 Claude Code 场景的安全、性能与架构治理,但 domain model 仍把 `.claude`、`CLAUDE.md`、`settings.json`、MCP、Agent、Skill 和 analytics 直接写入 service、IPC 与 renderer。继续为 Cursor、Codex CLI、Gemini CLI 或未来工具添加 enum 与分支,会形成 `N tools × N features` 的维护矩阵。 + +v1.5.0 将 CCB 转向“规则驱动的配置控制平面”:应用提供稳定、安全的通用能力,规则库描述工具、配置资产、路径、格式、检测方式和能力映射。工具规则变化时优先更新规则库,而不是重发应用。 + +## 2. 产品愿景 + +让用户在一个本地优先的桌面应用中发现、理解、备份、验证和管理多个 AI 工具的配置;让维护者通过受约束的 JSON 规则演进适配,而不是不断复制业务代码。 + +品牌建议使用 `CCB — Cognitive Configuration Bridge`,中文语义建议为“智能配置桥”。它强调跨工具、跨配置形态的连接与治理,不再绑定 Claude Code。最终命名需用户确认。 + +## 3. v1.5.0 目标 + +### 3.1 规则驱动平台 + +- 建立 versioned registry manifest 与 rule bundle JSON protocol。 +- 内置 Claude Code adapter,确保现有用户无感迁移。 +- 支持工具 detection、config artifact discovery、format、validation profile、backup/restore 与 capability 声明。 +- 支持内置规则与已安装远程规则合并;同 `toolId` 只允许显式、可回滚的版本覆盖。 +- 应用更新检查流程可同时检查 registry manifest,但不自动下载 rule bundle。 +- 用户可查看规则库当前版本、可用版本、来源、hash、兼容性和更新说明,并明确触发更新。 + +### 3.2 性能增强 + +- 建立 cold start、renderer ready、idle working set、tray-hidden working set、main/renderer process CPU、watcher count、initial bundle 与 lazy chunk 基线。 +- 降低启动期不必要 service initialization、目录扫描和大型 module loading。 +- 将工具扫描按 adapter/capability 懒加载;未启用工具不得启动 watcher 或解析其配置。 +- 规则库解析一次后按 `registryVersion + appVersion` 缓存,不在 renderer 重复持有完整规则对象。 +- 保持 v1.4.0 安全门禁与 0 dependency vulnerabilities 基线。 + +### 3.3 业务与模板更新 + +- 默认模板从全局单例升级为 artifact-specific template。 +- Claude Code 内置规则和模板作为兼容基线,后续可通过 registry 更新声明式字段。 +- 规则不能覆盖用户本地模板;更新时保留 user override,并提供差异预览。 + +## 4. 非目标 + +以下能力不纳入 v1.5.0,避免首版平台化失控: + +- 不开放远程 JavaScript、shell、PowerShell、AppleScript、WASM 或 native plugin。 +- 不建立公开社区 marketplace、评分、账号或云同步。 +- 不承诺 v1.5.0 首发适配所有 AI 工具;首发以 Claude Code 完整兼容和一个只读示例 adapter 验证通用性。 +- 不在规则中表达任意网络请求、任意正则或复杂迁移脚本。 +- 不一次性重写 Config/MCP/Agent/Skill/Managed Mode 全部 UI。 + +## 5. 核心用户故事 + +1. 作为现有 Claude Code 用户,升级后仍能看到并管理原配置,且无需手工迁移 `.ccb` 数据。 +2. 作为多工具用户,我能看到本机检测到的 AI tools,并选择启用管理范围。 +3. 作为谨慎用户,我能自动获知规则库有更新,但只有点击确认后才下载和安装。 +4. 作为维护者,我能通过 JSON 增加一个使用已支持 format/capability 的工具,而不修改 renderer/main code。 +5. 作为维护者,我不能通过规则库下发可执行代码或越过批准的路径变量。 +6. 作为性能敏感用户,禁用的工具不会启动 watcher、扫描目录或增加长期驻留对象。 + +## 6. 功能需求 + +### FR-1 Registry lifecycle + +- 内置 registry 永远可用,远程更新失败不影响应用启动。 +- Installed registry 使用原子写入;安装成功前保留 last-known-good。 +- Manifest check 与 bundle download 分离。 +- 所有 version 使用 strict SemVer;schema 与 minimum app version 必须兼容。 + +### FR-2 Tool and artifact discovery + +- `toolId`、`artifactId` 为 lowercase kebab-case stable identifiers。 +- path 使用受限 variables(如 `${HOME}`、`${APPDATA}`、`${XDG_CONFIG_HOME}`)和 platform variants。 +- discovery 只支持 `FILE`、`DIRECTORY`、`COMMAND_EXISTS` 等内置 detector types。 +- artifact format 首版支持 `JSON`、`JSONC`、`YAML`、`TOML`、`MARKDOWN`、`TEXT`;只有应用已实现 parser 的 format 才可写入/验证。 + +### FR-3 Capability model + +- 首版 capability:`DISCOVER`、`READ`、`VALIDATE`、`EDIT`、`BACKUP`、`RESTORE`、`ACTIVATE`、`WATCH`。 +- capability 必须由应用内置 handler registry 实现;规则仅声明使用,不提供 handler body。 +- 高风险 capability(`ACTIVATE`、`WATCH`)必须有额外 compatibility 和 path policy 检查。 + +### FR-4 Compatibility + +- Claude-specific service 在迁移期可保留 facade,但新增代码必须依赖通用 `ToolRegistryService` 与 `ConfigArtifactService` contract。 +- 原 `ConfigType` 不继续增加 tool-specific enum;逐步替换为 `toolId + artifactId + format`。 +- `.ccb/claude-configs` 数据目录 v1.5.0 只读兼容并迁移到 `.ccb/workspaces/claude-code`,迁移需幂等、可回滚;在迁移实现完成前不得删除旧目录。 + +## 7. 性能与质量指标 + +性能数字必须由相同机器、相同数据集、production build、三次运行的 median 生成。首次人工验收前只建立采集工具,不填写虚假结果。 + +| 指标 | v1.5.0 目标 | +| --- | --- | +| Cold start to renderer ready | 相对 v1.4.0 baseline 降低至少 20% | +| Idle total working set | 相对 baseline 降低至少 15% | +| Tray-hidden total working set | 相对 baseline 降低至少 20% | +| Disabled adapter background watchers | 0 | +| Initial renderer JS | 不高于 v1.4.0;新增 registry UI 必须 lazy chunk | +| Registry manifest check | <= 50 KB response,15 s timeout,失败不阻塞启动 | +| Rule bundle default limit | <= 2 MB,超过拒绝 | +| Automated tests | 新 domain >= 80% statements;full suite 不回退 | +| Security | Semgrep 0 unsuppressed findings;npm audit 0 vulnerabilities | + +## 8. 发布验收 + +- Claude Code 的配置扫描、编辑、备份、激活、MCP、Agent、Skill 和 managed mode 关键路径无回归。 +- 至少一个第二工具的只读 adapter 仅通过 JSON rule 加载并完成 detection/artifact discovery。 +- 远程 bundle 的 hash mismatch、schema mismatch、downgrade、oversize、unknown capability 均被拒绝。 +- manifest 检查不会自动安装 bundle;离线启动使用 last-known-good。 +- 性能报告包含原始样本、环境和 median,不只给百分比结论。 diff --git "a/docs/1.5.0/02-\350\247\204\345\210\231\351\251\261\345\212\250\346\236\266\346\236\204\350\256\276\350\256\241.md" "b/docs/1.5.0/02-\350\247\204\345\210\231\351\251\261\345\212\250\346\236\266\346\236\204\350\256\276\350\256\241.md" new file mode 100644 index 0000000..d1cfb60 --- /dev/null +++ "b/docs/1.5.0/02-\350\247\204\345\210\231\351\251\261\345\212\250\346\236\266\346\236\204\350\256\276\350\256\241.md" @@ -0,0 +1,126 @@ +# CCB v1.5.0 规则驱动架构设计 + +## 1. 现状诊断 + +### 1.1 Claude-specific 耦合 + +- `ConfigType` 在 `src/shared/types.ts` 与 `src/shared/types/config.ts` 重复定义,且直接包含 `claude-*` variants。 +- `path-manager` 暴露 `claudeDir`、`claudeJsonPath`、`claudeMdPath`、`claudeProjectsDir`。 +- `config-service` 同时负责路径安全、扫描、格式判断、metadata、模板、backup、activate 和 migration,约 1376 行。 +- `managed-mode-service` 约 1811 行并直接操作 `~/.claude/settings.json`。 +- MCP、Agent、Skill、Project、Analytics、Version services 各自持有 `.claude` 路径假设。 +- UI/locales/IPC/preload 都暴露 Claude-specific vocabulary。 + +### 1.2 性能结构风险 + +- main startup 同时初始化多个 domain service 和 file watcher。 +- `ipc-handlers.ts`、`preload/index.ts`、locales 与大型 panels 持续增长,增加解析与维护成本。 +- 未启用工具没有 adapter-level lifecycle,因此未来多工具会线性增加 watcher、scan 和 resident state。 +- app update 在 main 和 renderer 各有一套 version parsing/network flow,适合在 v1.5.0 合并。 + +## 2. Target architecture + +```text +Renderer (lazy feature modules) + | +Typed IPC facade + | +Application services + ToolRegistryService RegistryUpdateService + ConfigArtifactService PerformanceTelemetryService + | +Domain contracts + ToolDefinition -> ArtifactDefinition -> Capability + | +Infrastructure adapters + PathResolver FormatCodec Detector AtomicStore HTTP client + | +Built-in registry + Installed registry + Last-known-good +``` + +## 3. Domain model + +### ToolDefinition + +描述一个 AI tool 的稳定身份、显示信息、platform support、detectors 和 artifacts。`toolId` 不包含版本号,也不作为文件路径直接使用,必须经过 safe segment validation。 + +### ConfigArtifactDefinition + +描述一个可管理配置资产:format、platform paths、scope、capabilities、template、validation profile 和 sensitivity。一个 tool 可以有多个 artifact,例如 settings、instructions、MCP registry。 + +### Capability + +使用 UPPERCASE enum,前后端与持久化保持一致: + +- `DISCOVER` +- `READ` +- `VALIDATE` +- `EDIT` +- `BACKUP` +- `RESTORE` +- `ACTIVATE` +- `WATCH` + +规则只能引用 capability;handler 由应用代码注册,例如 `JSON_FILE_V1`、`MARKDOWN_FILE_V1`、`CLAUDE_SETTINGS_ACTIVATION_V1`。unknown handler/capability 必须 fail closed。 + +## 4. Registry composition + +```text +embedded registry (trusted, bundled) + + +installed registry (verified, user-approved) + = +effective registry (immutable snapshot) +``` + +合并规则: + +1. embedded registry 提供最小可用 Claude adapter。 +2. installed bundle 只有在 schema、compatibility、hash 和 policy 全部通过后参与合并。 +3. 同 `toolId` 的 override 必须声明 `replacesVersion`,且 bundle version 不得低于 installed version,除非用户执行显式 rollback。 +4. effective registry 生成 immutable snapshot;renderer 只获取 summary,需要详情时按 `toolId` 查询。 + +## 5. Path model + +允许的 path variables: + +- `${HOME}` +- `${APPDATA}` +- `${LOCALAPPDATA}` +- `${XDG_CONFIG_HOME}` +- `${CCB_DATA}` + +禁止:environment variable arbitrary lookup、`..` traversal、UNC remote path、URL、glob recursive traversal。路径解析后必须匹配 artifact 声明的 allowed roots;写操作还需精确 capability authorization。 + +## 6. Format model + +`format` 使用 UPPERCASE:`JSON`、`JSONC`、`YAML`、`TOML`、`MARKDOWN`、`TEXT`。每个 format 对应内置 codec。规则可以引用 validation profile,但 v1.5.0 不允许下载 arbitrary JSON Schema `$ref`;schema 必须内联、限制深度/节点数并禁止 remote refs,或引用 bundled profile。 + +## 7. Migration strategy + +### Phase A: Strangler foundation + +- 新增 shared registry types、validator、embedded Claude registry 和 atomic store。 +- 现有 services 不改行为,先通过 facade 查询 Claude definition。 + +### Phase B: Generic read path + +- 新增 generic tool/artifact list、detect 和 read IPC。 +- renderer 新建 lazy-loaded “Tools” panel;现有 Claude panels 保留。 + +### Phase C: Generic write path + +- 接入 validation、backup、edit;高风险 activate 仍走内置 Claude handler。 +- `ConfigType` consumers 逐步迁到 `toolId/artifactId/format`。 + +### Phase D: Feature extraction + +- MCP/Agent/Skill 从“Claude-only navigation”迁为 tool capabilities。 +- Analytics 和 managed mode 保留 specialized feature module,不强行塞入通用 config CRUD。 + +## 8. 关键取舍 + +- 不采用 JSON Logic 或脚本语言:它们会把 registry 变为未审计执行环境。 +- 不允许任意 regex:ReDoS 与跨 engine 行为不稳定;detector 使用 bounded literal/extension/magic-field predicates。 +- 不一次性删除 Claude-specific facade:strangler migration 比 big-bang rewrite 更可验证。 +- 不让 renderer 直接下载/安装:网络、hash、filesystem 和 rollback 都属于 main process authority。 diff --git "a/docs/1.5.0/03-\350\247\204\345\210\231\345\272\223\345\215\217\350\256\256\344\270\216\345\256\211\345\205\250\346\250\241\345\236\213.md" "b/docs/1.5.0/03-\350\247\204\345\210\231\345\272\223\345\215\217\350\256\256\344\270\216\345\256\211\345\205\250\346\250\241\345\236\213.md" new file mode 100644 index 0000000..c4f675d --- /dev/null +++ "b/docs/1.5.0/03-\350\247\204\345\210\231\345\272\223\345\215\217\350\256\256\344\270\216\345\256\211\345\205\250\346\250\241\345\236\213.md" @@ -0,0 +1,124 @@ +# CCB v1.5.0 规则库协议与安全模型 + +## 1. 文件组成 + +### Manifest + +```json +{ + "schemaVersion": 1, + "registryVersion": "1.0.0", + "minimumAppVersion": "1.5.0", + "publishedAt": "2026-07-12T00:00:00.000Z", + "bundleUrl": "https://dev.niansir.com/software/ccb/registry/1.0.0.json", + "bundleSha256": "<64 lowercase hex characters>", + "bundleSize": 12345, + "releaseNotes": { + "zh-CN": "更新工具适配规则", + "en-US": "Update tool adapter rules" + } +} +``` + +Manifest 只用于版本提示,不能包含 tool rules。应用启动检查只获取 manifest,不获取 `bundleUrl` 内容。 + +### Bundle + +```json +{ + "schemaVersion": 1, + "registryVersion": "1.0.0", + "minimumAppVersion": "1.5.0", + "tools": [] +} +``` + +## 2. Tool schema 摘要 + +```json +{ + "toolId": "claude-code", + "definitionVersion": "1.0.0", + "displayName": { "zh-CN": "Claude Code", "en-US": "Claude Code" }, + "platforms": ["WINDOWS", "MACOS", "LINUX"], + "detectors": [ + { "type": "COMMAND_EXISTS", "command": "claude" }, + { "type": "PATH_EXISTS", "path": "${HOME}/.claude" } + ], + "artifacts": [ + { + "artifactId": "user-settings", + "format": "JSON", + "scope": "USER", + "paths": { + "WINDOWS": ["${HOME}/.claude/settings.json"], + "MACOS": ["${HOME}/.claude/settings.json"], + "LINUX": ["${HOME}/.claude/settings.json"] + }, + "capabilities": ["DISCOVER", "READ", "VALIDATE", "EDIT", "BACKUP", "RESTORE"], + "handler": "JSON_FILE_V1" + } + ] +} +``` + +## 3. Validation limits + +- Manifest max 50 KB;bundle max 2 MB。 +- tools max 100;每 tool artifacts max 50;detectors max 10。 +- string max 4096 chars;localized text max 2048 chars。 +- JSON nesting max 20;总节点数 max 50,000。 +- identifiers 必须匹配 `^[a-z0-9]+(?:-[a-z0-9]+)*$`。 +- SemVer 必须 strict,无 leading zero 或 arbitrary suffix。 +- bundle URL 必须 HTTPS 且 origin 命中 application-pinned allowlist。 +- SHA-256 必须在 parse 前基于 raw bytes 验证。 +- 禁止 unknown top-level security-sensitive fields;schema 默认 `additionalProperties: false` 语义。 + +## 4. Update state machine + +```text +IDLE + -> CHECKING_MANIFEST + -> UPDATE_AVAILABLE | UP_TO_DATE | CHECK_FAILED + +UPDATE_AVAILABLE --user confirms--> DOWNLOADING + -> VERIFYING_HASH + -> VALIDATING_SCHEMA + -> CHECKING_COMPATIBILITY + -> STAGING + -> INSTALLED + -> ROLLED_BACK (only explicit user action or load failure) +``` + +应用不得在 `UPDATE_AVAILABLE` 自动跨到 `DOWNLOADING`。 + +## 5. Storage layout + +```text +~/.ccb/registry/ +├── manifest-state.json +├── installed.json +├── installed.meta.json +├── last-known-good.json +└── staging/ +``` + +所有 JSON 使用 UTF-8、atomic temp+rename。成功 load 新 installed bundle 后才替换 last-known-good。启动加载失败则回退 last-known-good 并记录 notification,不删除故障文件以便诊断。 + +## 6. Threat model + +| Threat | Control | +| --- | --- | +| Registry server compromised | SHA-256 integrity + future signature slot;无 executable payload;capability allowlist | +| MITM / redirect | HTTPS + pinned origins + redirect origin revalidation | +| Path traversal | restricted variables + canonical path boundary checks | +| Remote code execution | no scripts/commands in artifacts;detector command limited to command name | +| Schema bomb / memory exhaustion | byte, depth, node, array and string limits | +| Downgrade attack | reject lower version except explicit local rollback | +| Partial write / power loss | staging + atomic rename + last-known-good | +| Malicious remote `$ref` | remote refs forbidden | +| UI spoofing | display registry source, version, hash and update notes | + +## 7. Signature evolution + +SHA-256 只能证明下载内容与 manifest 一致,不能在 manifest server 被攻陷时证明 publisher identity。v1.5.0 protocol 预留 `signatureAlgorithm`、`keyId`、`signature` 字段,但 production remote registry 上线前建议加入 Ed25519 detached signature,并将 public key 固定在 application binary。未实现签名时,remote registry 应标记为 preview/beta,默认只启用 embedded registry。 diff --git "a/docs/1.5.0/04-\346\200\247\350\203\275\345\267\245\347\250\213\344\270\216\345\256\236\346\226\275\350\267\257\347\272\277\345\233\276.md" "b/docs/1.5.0/04-\346\200\247\350\203\275\345\267\245\347\250\213\344\270\216\345\256\236\346\226\275\350\267\257\347\272\277\345\233\276.md" new file mode 100644 index 0000000..35c5833 --- /dev/null +++ "b/docs/1.5.0/04-\346\200\247\350\203\275\345\267\245\347\250\213\344\270\216\345\256\236\346\226\275\350\267\257\347\272\277\345\233\276.md" @@ -0,0 +1,114 @@ +# CCB v1.5.0 性能工程与实施路线图 + +## 1. 原则 + +性能优化必须先有可复现 baseline。开发期间只报告测得的数据;没有启动应用或用户尚未人工验收时,不填写估算值代替测量。 + +## 2. 测量环境 contract + +- production build,关闭 DevTools。 +- 相同 Windows 版本、Node/Electron 版本、CPU power mode。 +- 固定 fixture:配置文件数量、Claude project logs 大小、MCP/Agent/Skill 数量。 +- cold start 每轮清理 app process,但不清空用户数据;运行 3 次取 median。 +- memory 使用 main + renderer + utility processes 的 working set 总和,同时保留 per-process 数据。 +- 记录 baseline commit、test commit、timestamp 和 raw JSON。 + +## 3. 指标 + +| ID | Metric | Collection point | +| --- | --- | --- | +| PERF-01 | process start -> renderer `did-finish-load` | main process timestamps | +| PERF-02 | renderer `navigationStart` -> app interactive | `performance.mark` | +| PERF-03 | idle working set after 60 s | Electron process metrics | +| PERF-04 | tray-hidden working set after 60 s | Electron process metrics | +| PERF-05 | idle CPU median over 60 s | process metrics sampling | +| PERF-06 | active watcher count | watcher registry instrumentation | +| PERF-07 | config scan duration and files visited | service telemetry | +| PERF-08 | main/preload/renderer bundle sizes | build artifact script | + +性能数据只写入本地 `.ccb/performance/` 或 ignored artifacts,不采集 telemetry,不上传。 + +## 4. 优化顺序 + +### P0 — 测量与生命周期 + +1. 建立 performance marks 与本地 snapshot exporter。 +2. service initialization 分为 `BOOT_CRITICAL`、`AFTER_RENDERER_READY`、`ON_DEMAND`。 +3. adapter lifecycle:只有 enabled/detected tool 才能初始化 scan/watcher。 + +### P1 — Main process + +1. 合并 app update/registry manifest check 的 HTTP、SemVer 和 cache infrastructure。 +2. Config scan 改为 artifact paths 定向扫描,避免递归扫描无关目录。 +3. watcher 按 artifact 去重,统一 debounce 和 dispose。 +4. 大型 analytics/project JSONL 保持 streaming,并增加 cancellation/budget。 + +### P1 — Renderer + +1. Tools/Registry/Analytics/Managed Mode 使用 route-level lazy chunks。 +2. locales 拆分 feature namespace,避免 140 KB 单文件随首屏全部解析。 +3. renderer 只保存 registry summaries;definition 详情按需查询。 +4. 长列表统一 virtualization,避免重复 component trees。 + +### P2 — Storage + +1. registry immutable snapshot cache。 +2. config metadata index 使用 content hash/mtime 增量更新。 +3. backup retention 和 log cleanup 在 idle task 执行。 + +## 5. 分阶段实施 + +### Phase 0:开发基线(已完成) + +- Git baseline commit `42dff6d`。 +- Semgrep 0 findings/errors;npm audit 0;65 tests;build/type-check passed。 + +### Foundation 静态构建记录(2026-07-12) + +规则库 foundation 加入后的 production build 与 baseline build 对比: + +| Artifact | Baseline | Foundation | 变化 | +| --- | ---: | ---: | ---: | +| Main bundle | 239.66 KB | 259.00 KB | +19.34 KB | +| Preload bundle | 11.29 KB | 11.86 KB | +0.57 KB | +| Settings lazy chunk | 28.01 KB | 30.95 KB | +2.94 KB | + +这是 registry validator、storage、update service、IPC 与 Settings UI 的静态成本,不代表 runtime memory 或 startup performance。v1.5.0 后续必须通过 service lazy initialization、effective registry summary cache、feature locale split 等优化抵消新增成本,并以实机 snapshot 为准。Foundation 完成后 full suite 为 84 tests / 14 files。 + +### Phase 1:Registry core + +- shared types、validator、embedded registry、atomic installed store、last-known-good。 +- unit tests 覆盖 valid/invalid schema、limits、merge、rollback。 + +### Phase 2:Manifest/update integration + +- main-only HTTP fetch、version check、explicit download/install。 +- IPC 只暴露 status/check/install/rollback。 +- UI 先接 Settings 内的 registry status,不建立 marketplace。 + +### Phase 3:Generic read-only tools + +- tool list、detect、artifact discover/read。 +- Claude adapter 与第二个 read-only adapter 验证 schema 通用性。 + +### Phase 4:Generic edit/backup + +- format codecs、validation、atomic edit、backup/restore。 +- Claude-specific activation 继续使用 bundled handler。 + +### Phase 5:Performance implementation + +- 根据 baseline 优先修复 top contributors。 +- 每项优化单独对比 raw samples,不把多项变化混成无法归因的结论。 + +### Phase 6:Migration and release + +- 幂等数据 migration、compat facade、rollback rehearsal。 +- 更新 README/CHANGELOG/运维与用户指南。 + +## 6. 每阶段门禁 + +- 上一阶段 tests/type-check/build/targeted lint 通过后才能进入下一阶段。 +- 发现 bug 按 Cockroach Principle 搜索同类模式并一起修复。 +- remote registry 在 Ed25519 signature 未落地前不得默认启用自动提示之外的网络能力。 +- 任何性能优化不得通过关闭 validation、backup、安全检查或错误处理换取数字。 diff --git "a/docs/1.5.0/05-\345\223\201\347\211\214\350\257\255\344\271\211ADR.md" "b/docs/1.5.0/05-\345\223\201\347\211\214\350\257\255\344\271\211ADR.md" new file mode 100644 index 0000000..38d91a0 --- /dev/null +++ "b/docs/1.5.0/05-\345\223\201\347\211\214\350\257\255\344\271\211ADR.md" @@ -0,0 +1,52 @@ +# ADR:CCB 品牌语义升级 + +## 状态 + +Provisional — 等待产品所有者最终确认。 + +## 背景 + +`Claude Code Butler` 准确描述了项目早期目标,但 v1.5.0 将管理范围扩展到多 AI 工具和动态规则库。继续使用旧全称会产生三个问题: + +1. 用户会误以为非 Claude Code 配置属于附加或非官方能力。 +2. domain/API 命名容易继续围绕 Claude 扩展,阻碍通用架构。 +3. 品牌愿景仍是“单工具助手”,无法表达配置桥接与控制平面价值。 + +同时,`CCB`、仓库名、`.ccb` 数据目录、GitHub links、appId 和用户认知已有稳定价值,直接更换缩写会引入迁移和发现成本。 + +## 候选 + +### A. Cognitive Configuration Bridge(建议) + +- 中文建议:智能配置桥。 +- `Cognitive` 表达 AI/cognitive tools 范围,不绑定某个 vendor。 +- `Configuration Bridge` 表达跨工具、跨格式连接与治理。 +- 保留 `CCB` acronym 和现有技术 identity。 + +### B. Config Control Base + +- 中文建议:配置控制基座。 +- 技术语义清晰,但品牌辨识度和 AI 属性较弱。 + +### C. Cross-tool Configuration Butler + +- 中文建议:跨工具配置管家。 +- 传承 Butler 语义,但仍偏桌面助手,不足以表达规则平台。 + +## 建议决策 + +采用 `CCB — Cognitive Configuration Bridge` 作为 v1.5.0 产品全称,保留: + +- package name `ccb` +- user data directory `.ccb` +- appId `com.claudecode.butler`(v1.5.0 暂不改,避免 Windows identity/shortcut/update 迁移) +- repository path `ClaudeCodeButler`(先保留 redirect compatibility,再单独规划 rename) + +逐步更新 display name、README、About、window title、installer productName 和文案。domain identifiers 使用 `tool/registry/artifact`,不得使用品牌名作为业务概念。 + +## 需要产品所有者确认 + +1. 是否确认英文全称 `Cognitive Configuration Bridge`? +2. 中文展示使用“智能配置桥”还是保留英文 CCB 不翻译? +3. v1.5.0 installer 是否显示 `CCB`,还是 `CCB - Cognitive Configuration Bridge`? +4. 仓库 rename 是否推迟到 v1.5.0 发布后,以降低代码迁移和链接失效风险? diff --git a/docs/1.5.0/README.md b/docs/1.5.0/README.md new file mode 100644 index 0000000..568fe08 --- /dev/null +++ b/docs/1.5.0/README.md @@ -0,0 +1,39 @@ +# CCB v1.5.0 规划索引 + +> 状态:Phase 1 registry core、manifest update 与 performance snapshot foundation 已实施 +> 基线提交:`42dff6d` +> 当前发布版本:`1.4.0`(在 v1.5.0 验收完成前不提前修改 package version) + +## 文档 + +- [01-产品需求文档-PRD.md](./01-产品需求文档-PRD.md):目标、范围、用户故事、验收指标 +- [02-规则驱动架构设计.md](./02-规则驱动架构设计.md):domain model、边界、迁移架构 +- [03-规则库协议与安全模型.md](./03-规则库协议与安全模型.md):JSON protocol、更新、校验、回滚与 threat model +- [04-性能工程与实施路线图.md](./04-性能工程与实施路线图.md):性能预算、测量方法、阶段计划与发布门禁 +- [05-品牌语义ADR.md](./05-品牌语义ADR.md):CCB 新全称与兼容策略 + +## 决策摘要 + +1. CCB 从 Claude Code 专用管理器演进为规则驱动的多 AI 工具配置控制平面。 +2. 远程规则只允许引用应用内置、审计过的 declarative capabilities,不允许携带 JS、shell 或动态 module。 +3. 应用可以自动检查规则 manifest 版本,但完整规则包必须由用户明确确认后下载。 +4. Claude Code 在 v1.5.0 中作为第一个内置 adapter,现有配置和功能必须保持兼容。 +5. 品牌建议将 CCB 解释为 `Cognitive Configuration Bridge`;在用户确认前保持 provisional,不全仓替换。 +6. 性能优化以数据基线和预算为门禁,不接受无法测量的“感觉更快”。 + +## 当前实现进度 + +- [x] Shared registry domain contract 与 UPPERCASE enums +- [x] Bounded bundle/manifest validator +- [x] Embedded Claude Code compatibility adapter +- [x] Atomic installed/last-known-good storage、merge、integrity 与 rollback +- [x] Manifest-only automatic check、explicit bundle install +- [x] Main/preload IPC 与 Settings/About 最小 UI +- [x] On-demand performance snapshot/export foundation +- [ ] Generic detector/path resolver 与 read-only artifact discovery +- [ ] 第二个真实 AI tool read-only adapter +- [ ] Generic format codecs、edit/backup/restore +- [ ] 实机 performance baseline 与首批优化 +- [ ] 品牌全称最终确认与 UI/installer 迁移 + +> 开发期兼容提示:package version 当前仍为 `1.4.0`,因此 `minimumAppVersion: 1.5.0` 的远程 manifest 会被按设计拒绝。Release phase 正式 bump 到 `1.5.0` 后才启用 production registry update;内置 registry 不受影响。 diff --git a/src/main/ipc-handlers.ts b/src/main/ipc-handlers.ts index e428549..2b81ce2 100644 --- a/src/main/ipc-handlers.ts +++ b/src/main/ipc-handlers.ts @@ -24,6 +24,9 @@ import { agentsManagementService } from './services/agents-management-service' import { skillsManagementService } from './services/skills-management-service' import { environmentCheckService } from './services/environment-check-service' import { terminalManagementService } from './services/terminal-management-service' +import { toolRegistryService } from './services/tool-registry-service' +import { registryUpdateService } from './services/registry-update-service' +import { performanceSnapshotService } from './services/performance-snapshot-service' import { ensureAllowedUrl, ensurePathWithinBase, @@ -98,10 +101,28 @@ export function setupIpcHandlers(): void { setupSkillsHandlers() setupEnvironmentHandlers() setupTerminalHandlers() + setupToolRegistryHandlers() logger.info('IPC 处理器设置完成') } +/** + * 工具规则库 IPC handlers + * @description renderer 不能提供 URL/hash;install 只消费 main 缓存的 verified manifest。 + */ +function setupToolRegistryHandlers(): void { + ipcMain.handle('toolRegistry:getSnapshot', createSimpleHandler(() => toolRegistryService.getSnapshot())) + ipcMain.handle('toolRegistry:getTool', createSimpleHandler((toolId: string) => toolRegistryService.getTool(toolId))) + ipcMain.handle('toolRegistry:getUpdateStatus', createSimpleHandler(() => registryUpdateService.getStatus())) + ipcMain.handle('toolRegistry:checkForUpdates', createSimpleHandler(() => registryUpdateService.checkForUpdates(app.getVersion()))) + ipcMain.handle('toolRegistry:installAvailableUpdate', createSimpleHandler(() => + registryUpdateService.installAvailableUpdate(app.getVersion()) + )) + ipcMain.handle('toolRegistry:rollback', createSimpleHandler(() => registryUpdateService.rollback())) + ipcMain.handle('performance:capture', createSimpleHandler(() => performanceSnapshotService.capture())) + ipcMain.handle('performance:exportSnapshot', createSimpleHandler(() => performanceSnapshotService.exportSnapshot())) +} + /** * 配置管理相关的 IPC 处理器 */ diff --git a/src/main/services/performance-snapshot-service.ts b/src/main/services/performance-snapshot-service.ts new file mode 100644 index 0000000..7fd80f6 --- /dev/null +++ b/src/main/services/performance-snapshot-service.ts @@ -0,0 +1,61 @@ +/** + * @file src/main/services/performance-snapshot-service.ts + * @description 按用户请求采集 Electron 进程性能 snapshot,并以 UTF-8 JSON 导出到本地。 + */ + +import { app } from 'electron' +import { promises as fs } from 'fs' +import path from 'path' +import { writeJsonAtomic } from '../utils/atomic-json-writer' +import { pathManager } from '../utils/path-manager' +import type { PerformanceSnapshot } from '@shared/performance' + +/** + * Performance snapshot service + * @description 不定时采样、不上传;只有 IPC 明确调用时才采集或导出。 + */ +export class PerformanceSnapshotService { + /** + * 采集当前 Electron process snapshot + * @returns 可序列化性能数据 + */ + public capture(): PerformanceSnapshot { + const processes = app.getAppMetrics().map((metric) => ({ + type: metric.type, + pid: metric.pid, + cpuPercent: metric.cpu.percentCPUUsage, + workingSetKb: metric.memory.workingSetSize, + peakWorkingSetKb: metric.memory.peakWorkingSetSize, + privateBytesKb: metric.memory.privateBytes + })) + + return { + schemaVersion: 1, + capturedAt: new Date().toISOString(), + appVersion: app.getVersion(), + platform: process.platform, + arch: process.arch, + uptimeSeconds: process.uptime(), + mainMemoryUsage: process.memoryUsage(), + processes, + totalWorkingSetKb: processes.reduce((total, metric) => total + metric.workingSetKb, 0) + } + } + + /** + * 导出当前 snapshot 到 .ccb/performance + * @returns 导出文件绝对路径 + */ + public async exportSnapshot(): Promise { + const snapshot = this.capture() + const safeTimestamp = snapshot.capturedAt.replace(/[:.]/g, '-') + const outputDirectory = path.join(pathManager.appDataDir, 'performance') + const outputPath = path.join(outputDirectory, `performance-${safeTimestamp}.json`) + await fs.mkdir(outputDirectory, { recursive: true }) + await writeJsonAtomic(outputPath, snapshot) + return outputPath + } +} + +/** 默认性能 snapshot service */ +export const performanceSnapshotService = new PerformanceSnapshotService() diff --git a/src/main/services/registry-update-service.ts b/src/main/services/registry-update-service.ts new file mode 100644 index 0000000..a941014 --- /dev/null +++ b/src/main/services/registry-update-service.ts @@ -0,0 +1,239 @@ +/** + * @file src/main/services/registry-update-service.ts + * @description 负责规则库 manifest 检查与用户明确批准后的 bundle 下载、校验和安装。 + */ + +import axios from 'axios' +import type { + ToolRegistryManifest, + ToolRegistryUpdateStatus +} from '@shared/tool-registry' +import { + compareStrictSemVer, + REGISTRY_BUNDLE_MAX_BYTES, + REGISTRY_MANIFEST_MAX_BYTES, + validateToolRegistryManifest +} from '@shared/tool-registry-validator' +import { toolRegistryService, type ToolRegistryService } from './tool-registry-service' + +/** 默认 registry manifest URL */ +export const REGISTRY_MANIFEST_URL = 'https://dev.niansir.com/software/ccb/registry/manifest.json' +/** Registry 固定允许的 origin */ +export const REGISTRY_ALLOWED_ORIGINS = ['https://dev.niansir.com'] as const + +/** 受限文本 HTTP client contract */ +export interface RegistryHttpClient { + /** + * 获取 UTF-8 文本,调用方提供最大响应大小 + * @param url 固定或已验证 URL + * @param maxBytes 最大响应 bytes + * @returns 响应文本 + */ + getText(url: string, maxBytes: number): Promise +} + +/** + * Axios registry HTTP client + * @description 禁止 redirect,限制 timeout/content length,避免重定向绕过 pinned origin。 + */ +export class AxiosRegistryHttpClient implements RegistryHttpClient { + /** + * 获取受大小限制的文本 + * @param url 已验证 HTTPS URL + * @param maxBytes 最大响应 bytes + * @returns UTF-8 文本 + */ + public async getText(url: string, maxBytes: number): Promise { + const response = await axios.get(url, { + responseType: 'text', + timeout: 15_000, + maxRedirects: 0, + maxContentLength: maxBytes, + maxBodyLength: maxBytes, + transformResponse: [(data) => data], + validateStatus: (status) => status === 200 + }) + if (typeof response.data !== 'string') { + throw new Error('Registry 响应不是 UTF-8 文本') + } + if (Buffer.byteLength(response.data, 'utf8') > maxBytes) { + throw new Error(`Registry 响应超过 ${maxBytes} bytes`) + } + return response.data + } +} + +/** + * Registry 更新服务 + * @description check 只缓存 verified manifest;install 不接受 renderer 提供 URL/hash。 + */ +export class RegistryUpdateService { + private readonly registryService: ToolRegistryService + private readonly httpClient: RegistryHttpClient + private readonly manifestUrl: string + private readonly allowedOrigins: string[] + private verifiedManifest?: ToolRegistryManifest + private checkPromise?: Promise + private status: ToolRegistryUpdateStatus = { + state: 'IDLE', + embeddedVersion: '0.0.0' + } + + constructor(options?: { + registryService?: ToolRegistryService + httpClient?: RegistryHttpClient + manifestUrl?: string + allowedOrigins?: string[] + }) { + this.registryService = options?.registryService ?? toolRegistryService + this.httpClient = options?.httpClient ?? new AxiosRegistryHttpClient() + this.manifestUrl = options?.manifestUrl ?? REGISTRY_MANIFEST_URL + this.allowedOrigins = options?.allowedOrigins ?? [...REGISTRY_ALLOWED_ORIGINS] + } + + /** + * 获取当前更新状态,不触发网络请求 + * @returns 可序列化状态 snapshot + */ + public getStatus(): ToolRegistryUpdateStatus { + return { ...this.status } + } + + /** + * 检查远程 manifest + * @description 只下载小型 manifest,不自动下载或安装 bundle。 + * @returns 更新状态 + */ + public checkForUpdates(currentAppVersion: string): Promise { + if (!this.checkPromise) { + this.checkPromise = this.performUpdateCheck(currentAppVersion).finally(() => { + this.checkPromise = undefined + }) + } + return this.checkPromise + } + + /** + * 执行一次 manifest 检查 + * @param currentAppVersion 当前应用版本 + * @returns update 状态 + */ + private async performUpdateCheck(currentAppVersion: string): Promise { + const snapshot = await this.registryService.getSnapshot() + this.status = { + state: 'CHECKING_MANIFEST', + embeddedVersion: snapshot.embeddedVersion, + installedVersion: snapshot.installedVersion + } + try { + this.validatePinnedUrl(this.manifestUrl, 'Registry manifest URL') + const rawManifest = await this.httpClient.getText(this.manifestUrl, REGISTRY_MANIFEST_MAX_BYTES) + const validation = validateToolRegistryManifest(rawManifest, this.allowedOrigins) + if (!validation.success || !validation.data) { + throw new Error(`Registry manifest 无效: ${validation.errors.join('; ')}`) + } + if (compareStrictSemVer(validation.data.minimumAppVersion, currentAppVersion) > 0) { + throw new Error(`Registry manifest 要求 CCB >= ${validation.data.minimumAppVersion}`) + } + this.verifiedManifest = validation.data + const currentVersion = snapshot.installedVersion ?? snapshot.embeddedVersion + const updateAvailable = compareStrictSemVer(validation.data.registryVersion, currentVersion) > 0 + this.status = { + state: updateAvailable ? 'UPDATE_AVAILABLE' : 'UP_TO_DATE', + embeddedVersion: snapshot.embeddedVersion, + installedVersion: snapshot.installedVersion, + availableVersion: validation.data.registryVersion, + publishedAt: validation.data.publishedAt, + releaseNotes: validation.data.releaseNotes, + lastCheckedAt: new Date().toISOString() + } + return this.getStatus() + } catch (error) { + this.verifiedManifest = undefined + this.status = { + state: 'CHECK_FAILED', + embeddedVersion: snapshot.embeddedVersion, + installedVersion: snapshot.installedVersion, + lastCheckedAt: new Date().toISOString(), + error: error instanceof Error ? error.message : String(error) + } + return this.getStatus() + } + } + + /** + * 安装最近一次检查到的可用更新 + * @description 必须由用户操作调用;没有 verified manifest 时拒绝。 + * @param currentAppVersion 当前应用版本 + * @returns 安装后的更新状态 + */ + public async installAvailableUpdate(currentAppVersion: string): Promise { + const manifest = this.verifiedManifest + if (!manifest || this.status.state !== 'UPDATE_AVAILABLE') { + throw new Error('没有经过验证且等待用户确认的规则库更新') + } + this.status = { ...this.status, state: 'DOWNLOADING', error: undefined } + try { + this.validatePinnedUrl(manifest.bundleUrl, 'Registry bundle URL') + const rawBundle = await this.httpClient.getText(manifest.bundleUrl, REGISTRY_BUNDLE_MAX_BYTES) + this.status = { ...this.status, state: 'VERIFYING_HASH' } + await this.registryService.installBundle({ + rawJson: rawBundle, + expectedSha256: manifest.bundleSha256, + expectedSize: manifest.bundleSize, + currentAppVersion + }) + const snapshot = await this.registryService.getSnapshot() + this.status = { + state: 'INSTALLED', + embeddedVersion: snapshot.embeddedVersion, + installedVersion: snapshot.installedVersion, + availableVersion: manifest.registryVersion, + publishedAt: manifest.publishedAt, + releaseNotes: manifest.releaseNotes, + lastCheckedAt: new Date().toISOString() + } + this.verifiedManifest = undefined + return this.getStatus() + } catch (error) { + this.status = { + ...this.status, + state: 'CHECK_FAILED', + error: error instanceof Error ? error.message : String(error) + } + throw error + } + } + + /** + * 显式回滚规则库 + * @returns 回滚后的状态 + */ + public async rollback(): Promise { + const registryVersion = await this.registryService.rollback() + const snapshot = await this.registryService.getSnapshot() + this.verifiedManifest = undefined + this.status = { + state: 'ROLLED_BACK', + embeddedVersion: snapshot.embeddedVersion, + installedVersion: registryVersion, + lastCheckedAt: new Date().toISOString() + } + return this.getStatus() + } + + /** + * 校验 URL 使用 HTTPS 且命中 pinned origin + * @param value URL 文本 + * @param label 错误标签 + */ + private validatePinnedUrl(value: string, label: string): void { + const parsedUrl = new URL(value) + if (parsedUrl.protocol !== 'https:' || !this.allowedOrigins.includes(parsedUrl.origin)) { + throw new Error(`${label} 不在 pinned HTTPS origin 中`) + } + } +} + +/** 默认 registry 更新服务单例 */ +export const registryUpdateService = new RegistryUpdateService() diff --git a/src/main/services/tool-registry-service.ts b/src/main/services/tool-registry-service.ts new file mode 100644 index 0000000..e3deb2f --- /dev/null +++ b/src/main/services/tool-registry-service.ts @@ -0,0 +1,243 @@ +/** + * @file src/main/services/tool-registry-service.ts + * @description 管理内置、已安装与 last-known-good 工具规则库,提供安全安装、合并与回滚。 + */ + +import { createHash } from 'crypto' +import { promises as fs } from 'fs' +import builtinRegistryJson from '@shared/builtin-tool-registry.json' +import type { ToolDefinition, ToolRegistryBundle, ToolRegistrySnapshot } from '@shared/tool-registry' +import { + compareStrictSemVer, + REGISTRY_BUNDLE_MAX_BYTES, + validateToolRegistryBundle +} from '@shared/tool-registry-validator' +import { writeJsonAtomic } from '../utils/atomic-json-writer' +import { pathManager } from '../utils/path-manager' +import { logger } from '../utils/logger' + +/** Registry storage 所需路径 */ +export interface ToolRegistryPaths { + /** 当前已安装规则库 */ + installed: string + /** 当前规则库 metadata */ + metadata: string + /** 最近一次可用的旧规则库 */ + lastKnownGood: string +} + +/** 已安装规则库 metadata */ +export interface InstalledRegistryMetadata { + /** 安装的 registry version */ + registryVersion: string + /** 原始 bundle SHA-256 */ + sha256: string + /** 原始 bundle bytes */ + size: number + /** ISO-8601 安装时间 */ + installedAt: string + /** 规则来源 */ + source: 'REMOTE' | 'ROLLBACK' +} + +/** 安装 bundle 输入 */ +export interface InstallRegistryBundleInput { + /** 下载到的原始 JSON */ + rawJson: string + /** manifest 声明的 SHA-256 */ + expectedSha256: string + /** manifest 声明的 bytes */ + expectedSize: number + /** 当前应用版本 */ + currentAppVersion: string + /** 仅显式 rollback/debug 流程允许降级 */ + allowDowngrade?: boolean +} + +/** + * 计算 raw registry bundle 的 SHA-256 + * @param rawJson 原始 JSON 文本 + * @returns lowercase hex digest + */ +export function calculateRegistrySha256(rawJson: string): string { + return createHash('sha256').update(rawJson, 'utf8').digest('hex') +} + +/** + * 合并 embedded 与 installed bundle + * @description installed 中同 toolId 定义覆盖 embedded,其余 embedded tools 保留。 + * @param embedded 内置 bundle + * @param installed 已安装 bundle + * @returns 按 toolId 排序的 immutable-friendly tools 数组 + */ +export function mergeToolRegistryBundles( + embedded: ToolRegistryBundle, + installed?: ToolRegistryBundle +): ToolDefinition[] { + const definitions = new Map(embedded.tools.map((tool) => [tool.toolId, tool])) + for (const tool of installed?.tools ?? []) { + definitions.set(tool.toolId, tool) + } + return [...definitions.values()].sort((left, right) => left.toolId.localeCompare(right.toolId)) +} + +/** + * 工具规则库服务 + * @description 所有远程 bundle 必须先经过 hash、size、schema 与 app compatibility 校验。 + */ +export class ToolRegistryService { + private readonly paths: ToolRegistryPaths + private readonly embedded: ToolRegistryBundle + + constructor(paths?: Partial) { + this.paths = { + installed: paths?.installed ?? pathManager.installedRegistryFile, + metadata: paths?.metadata ?? pathManager.installedRegistryMetadataFile, + lastKnownGood: paths?.lastKnownGood ?? pathManager.lastKnownGoodRegistryFile + } + const embeddedValidation = validateToolRegistryBundle(JSON.stringify(builtinRegistryJson)) + if (!embeddedValidation.success || !embeddedValidation.data) { + throw new Error(`内置工具规则库无效: ${embeddedValidation.errors.join('; ')}`) + } + this.embedded = embeddedValidation.data + } + + /** + * 获取当前 effective registry snapshot + * @returns embedded 与 installed/last-known-good 合并结果 + */ + public async getSnapshot(): Promise { + const installedResult = await this.readBundle(this.paths.installed) + if (installedResult.bundle) { + return { + embeddedVersion: this.embedded.registryVersion, + installedVersion: installedResult.bundle.registryVersion, + tools: mergeToolRegistryBundles(this.embedded, installedResult.bundle), + recoveredFromLastKnownGood: false + } + } + + const fallbackResult = await this.readBundle(this.paths.lastKnownGood) + if (fallbackResult.bundle) { + logger.warn(`installed registry 无法加载,使用 last-known-good: ${installedResult.error || '文件不存在'}`) + return { + embeddedVersion: this.embedded.registryVersion, + installedVersion: fallbackResult.bundle.registryVersion, + tools: mergeToolRegistryBundles(this.embedded, fallbackResult.bundle), + recoveredFromLastKnownGood: true + } + } + + return { + embeddedVersion: this.embedded.registryVersion, + tools: mergeToolRegistryBundles(this.embedded), + recoveredFromLastKnownGood: false + } + } + + /** + * 获取指定工具定义 + * @param toolId 稳定 tool identifier + * @returns 工具定义,不存在时返回 undefined + */ + public async getTool(toolId: string): Promise { + const snapshot = await this.getSnapshot() + return snapshot.tools.find((tool) => tool.toolId === toolId) + } + + /** + * 安装用户明确批准下载的规则 bundle + * @param input 原始 bundle 与 manifest integrity 信息 + * @returns 新安装的 registry version + */ + public async installBundle(input: InstallRegistryBundleInput): Promise { + const actualSize = Buffer.byteLength(input.rawJson, 'utf8') + if (actualSize !== input.expectedSize) { + throw new Error(`规则库大小不匹配: expected=${input.expectedSize}, actual=${actualSize}`) + } + if (actualSize > REGISTRY_BUNDLE_MAX_BYTES) { + throw new Error(`规则库超过最大限制: ${REGISTRY_BUNDLE_MAX_BYTES}`) + } + const actualSha256 = calculateRegistrySha256(input.rawJson) + if (actualSha256 !== input.expectedSha256) { + throw new Error('规则库 SHA-256 校验失败') + } + const validation = validateToolRegistryBundle(input.rawJson) + if (!validation.success || !validation.data) { + throw new Error(`规则库结构无效: ${validation.errors.join('; ')}`) + } + const bundle = validation.data + if (compareStrictSemVer(bundle.minimumAppVersion, input.currentAppVersion) > 0) { + throw new Error(`规则库要求 CCB >= ${bundle.minimumAppVersion}`) + } + const currentInstalled = await this.readBundle(this.paths.installed) + if ( + currentInstalled.bundle && + compareStrictSemVer(bundle.registryVersion, currentInstalled.bundle.registryVersion) < 0 && + !input.allowDowngrade + ) { + throw new Error(`拒绝规则库降级: ${currentInstalled.bundle.registryVersion} -> ${bundle.registryVersion}`) + } + + if (currentInstalled.bundle) { + await writeJsonAtomic(this.paths.lastKnownGood, currentInstalled.bundle) + } + await writeJsonAtomic(this.paths.installed, bundle) + const metadata: InstalledRegistryMetadata = { + registryVersion: bundle.registryVersion, + sha256: actualSha256, + size: actualSize, + installedAt: new Date().toISOString(), + source: 'REMOTE' + } + await writeJsonAtomic(this.paths.metadata, metadata) + return bundle.registryVersion + } + + /** + * 显式回滚到 last-known-good + * @returns 回滚后的 registry version + */ + public async rollback(): Promise { + const fallbackResult = await this.readBundle(this.paths.lastKnownGood) + if (!fallbackResult.bundle) { + throw new Error(`没有可用的 last-known-good 规则库: ${fallbackResult.error || '文件不存在'}`) + } + const fallbackRaw = JSON.stringify(fallbackResult.bundle, null, 2) + await writeJsonAtomic(this.paths.installed, fallbackResult.bundle) + const metadata: InstalledRegistryMetadata = { + registryVersion: fallbackResult.bundle.registryVersion, + sha256: calculateRegistrySha256(fallbackRaw), + size: Buffer.byteLength(fallbackRaw, 'utf8'), + installedAt: new Date().toISOString(), + source: 'ROLLBACK' + } + await writeJsonAtomic(this.paths.metadata, metadata) + return fallbackResult.bundle.registryVersion + } + + /** + * 读取并验证本地 bundle + * @param filePath bundle 路径 + * @returns bundle 或诊断错误 + */ + private async readBundle(filePath: string): Promise<{ bundle?: ToolRegistryBundle; error?: string }> { + try { + const rawJson = await fs.readFile(filePath, 'utf8') + const validation = validateToolRegistryBundle(rawJson) + if (!validation.success || !validation.data) { + return { error: validation.errors.join('; ') } + } + return { bundle: validation.data } + } catch (error) { + const nodeError = error as NodeJS.ErrnoException + if (nodeError.code === 'ENOENT') { + return {} + } + return { error: error instanceof Error ? error.message : String(error) } + } + } +} + +/** 默认工具规则库服务单例 */ +export const toolRegistryService = new ToolRegistryService() diff --git a/src/main/services/update-service.ts b/src/main/services/update-service.ts index 5fe2304..c4ac602 100644 --- a/src/main/services/update-service.ts +++ b/src/main/services/update-service.ts @@ -9,11 +9,17 @@ import { join } from 'path'; import fs from 'fs'; import { logger } from '../utils/logger'; import { APP_INFO } from '@shared/constants'; +import { registryUpdateService } from './registry-update-service'; const VERSION_URL = 'https://dev.niansir.com/software/ccb/version.txt'; class UpdateService { public async checkForUpdates(): Promise { + const registryCheck = registryUpdateService.checkForUpdates(app.getVersion()).catch((error) => ({ + state: 'CHECK_FAILED' as const, + embeddedVersion: '0.0.0', + error: error instanceof Error ? error.message : String(error) + })); logger.info('正在检查更新...'); try { const response = await axios.get(VERSION_URL, { timeout: 15000 }); @@ -36,6 +42,13 @@ class UpdateService { } catch (error) { logger.error('检查更新失败:', error); } + + const registryStatus = await registryCheck; + if (registryStatus.state === 'UPDATE_AVAILABLE') { + logger.info(`发现规则库更新: ${registryStatus.availableVersion}`); + } else if (registryStatus.state === 'CHECK_FAILED') { + logger.warn(`规则库版本检查失败: ${registryStatus.error}`); + } } private parseVersionInfo(data: string): { version: string | null; text: string | null } { diff --git a/src/main/utils/path-manager.ts b/src/main/utils/path-manager.ts index c09db0e..eace2bd 100644 --- a/src/main/utils/path-manager.ts +++ b/src/main/utils/path-manager.ts @@ -34,6 +34,7 @@ export const pathManager = { logDir: path.join(APP_DATA_BASE_DIR, PATH_CONSTANTS.LOG_DIR), cacheDir: path.join(APP_DATA_BASE_DIR, PATH_CONSTANTS.CACHE_DIR), configDir: path.join(APP_DATA_BASE_DIR, PATH_CONSTANTS.CONFIG_DIR), + registryDir: path.join(APP_DATA_BASE_DIR, 'registry'), // Claude 配置目录 (用户目录/.ccb/claude-configs) claudeConfigsDir: CLAUDE_CONFIGS_DIR, @@ -42,6 +43,9 @@ export const pathManager = { rulesFile: path.join(APP_DATA_BASE_DIR, PATH_CONSTANTS.DATA_DIR, CONFIG_FILES.RULES_FILE), ruleExecutionsLogFile: path.join(APP_DATA_BASE_DIR, PATH_CONSTANTS.DATA_DIR, 'rule-executions.json'), settingsFile: path.join(APP_DATA_BASE_DIR, PATH_CONSTANTS.CONFIG_DIR, CONFIG_FILES.SETTINGS), + installedRegistryFile: path.join(APP_DATA_BASE_DIR, 'registry', 'installed.json'), + installedRegistryMetadataFile: path.join(APP_DATA_BASE_DIR, 'registry', 'installed.meta.json'), + lastKnownGoodRegistryFile: path.join(APP_DATA_BASE_DIR, 'registry', 'last-known-good.json'), // Claude 用户目录相关路径(~/.claude)—— v1.4.0 新增,消除全代码库 os.homedir()+'.claude' 散落拼接 claudeDir: path.join(HOME_DIR, '.claude'), diff --git a/src/preload/index.ts b/src/preload/index.ts index 32da00c..30e70ea 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -45,6 +45,12 @@ import type { TerminalExecutionConfig, TerminalType } from '@shared/types/terminal' +import type { + ToolDefinition, + ToolRegistrySnapshot, + ToolRegistryUpdateStatus +} from '@shared/tool-registry' +import type { PerformanceSnapshot } from '@shared/performance' /** * 配置管理 API @@ -204,6 +210,33 @@ interface SystemAPI { getPlatform: () => Promise } +/** + * 工具规则库 API + * @description 规则下载地址与 hash 只在 main process 内部流转。 + */ +interface ToolRegistryAPI { + /** 获取 effective registry 摘要 */ + getSnapshot: () => Promise<{ success: boolean; data?: ToolRegistrySnapshot; error?: string }> + /** 按 toolId 获取 definition */ + getTool: (toolId: string) => Promise<{ success: boolean; data?: ToolDefinition; error?: string }> + /** 获取当前 update 状态 */ + getUpdateStatus: () => Promise<{ success: boolean; data?: ToolRegistryUpdateStatus; error?: string }> + /** 只检查 manifest,不下载 bundle */ + checkForUpdates: () => Promise<{ success: boolean; data?: ToolRegistryUpdateStatus; error?: string }> + /** 安装 main process 最近验证的 manifest 对应 bundle */ + installAvailableUpdate: () => Promise<{ success: boolean; data?: ToolRegistryUpdateStatus; error?: string }> + /** 显式回滚 last-known-good */ + rollback: () => Promise<{ success: boolean; data?: ToolRegistryUpdateStatus; error?: string }> +} + +/** 按需性能采集 API */ +interface PerformanceAPI { + /** 采集内存、CPU 与 process metrics,不写文件 */ + capture: () => Promise<{ success: boolean; data?: PerformanceSnapshot; error?: string }> + /** 导出 snapshot 到本地 .ccb/performance */ + exportSnapshot: () => Promise<{ success: boolean; data?: string; error?: string }> +} + /** * 窗口管理 API */ @@ -677,6 +710,8 @@ export interface ElectronAPI { skills: SkillsAPI environment: EnvironmentAPI terminal: TerminalAPI + toolRegistry: ToolRegistryAPI + performance: PerformanceAPI // 移除安全API } @@ -763,6 +798,22 @@ const systemAPI: SystemAPI = { getPlatform: () => ipcRenderer.invoke('system:getPlatform') } +/** 工具规则库 IPC facade */ +const toolRegistryAPI: ToolRegistryAPI = { + getSnapshot: () => ipcRenderer.invoke('toolRegistry:getSnapshot'), + getTool: (toolId: string) => ipcRenderer.invoke('toolRegistry:getTool', toolId), + getUpdateStatus: () => ipcRenderer.invoke('toolRegistry:getUpdateStatus'), + checkForUpdates: () => ipcRenderer.invoke('toolRegistry:checkForUpdates'), + installAvailableUpdate: () => ipcRenderer.invoke('toolRegistry:installAvailableUpdate'), + rollback: () => ipcRenderer.invoke('toolRegistry:rollback') +} + +/** 按需性能采集 IPC facade */ +const performanceAPI: PerformanceAPI = { + capture: () => ipcRenderer.invoke('performance:capture'), + exportSnapshot: () => ipcRenderer.invoke('performance:exportSnapshot') +} + // 创建窗口 API 对象 const windowAPI: WindowAPI = { minimize: () => ipcRenderer.invoke('window:minimize'), @@ -1023,7 +1074,9 @@ const electronAPI: ElectronAPI = { agents: agentsAPI, skills: skillsAPI, environment: environmentAPI, - terminal: terminalAPI + terminal: terminalAPI, + toolRegistry: toolRegistryAPI, + performance: performanceAPI // 移除安全API } diff --git a/src/renderer/src/components/Settings/SettingsPanel.tsx b/src/renderer/src/components/Settings/SettingsPanel.tsx index 4562ef9..8d19abd 100644 --- a/src/renderer/src/components/Settings/SettingsPanel.tsx +++ b/src/renderer/src/components/Settings/SettingsPanel.tsx @@ -4,7 +4,7 @@ */ import React, { Suspense, useEffect, useState, useRef } from 'react' -import { Card, Form, Switch, Input, InputNumber, Select, Button, Space, Typography, Tabs, Row, Col, Alert, Descriptions, Tag, Divider, Modal } from 'antd' +import { Card, Form, Switch, Input, InputNumber, Select, Button, Space, Typography, Tabs, Row, Col, Alert, Descriptions, Tag, Divider, Modal, Popconfirm } from 'antd' import { SaveOutlined, ReloadOutlined, @@ -30,6 +30,7 @@ import UpdateModal from '../Common/UpdateModal' import TerminalManagement from './TerminalManagement' import type { VersionInfo } from '../../services/version-service' import type { SettingsTab } from '@shared/types/settings' +import type { ToolRegistryUpdateStatus } from '@shared/tool-registry' import { normalizeNewConfigTemplate, validateNewConfigTemplate @@ -186,6 +187,10 @@ const SettingsPanel: React.FC = () => { const [changelogStatus, setChangelogStatus] = useState<'idle' | 'loading' | 'ready' | 'offline'>('idle') const [changelogLines, setChangelogLines] = useState([]) const [templatePreviewVisible, setTemplatePreviewVisible] = useState(false) + const [registryStatus, setRegistryStatus] = useState(null) + const [checkingRegistryUpdate, setCheckingRegistryUpdate] = useState(false) + const [installingRegistryUpdate, setInstallingRegistryUpdate] = useState(false) + const [rollingBackRegistry, setRollingBackRegistry] = useState(false) const [updateInfo, setUpdateInfo] = useState<{ currentVersion: string latestVersion: string @@ -211,6 +216,18 @@ const SettingsPanel: React.FC = () => { initialize() }, [initialize]) + useEffect(() => { + if (activeTab !== 'about') { + return + } + + void window.electronAPI.toolRegistry.getUpdateStatus().then((result) => { + if (result.success && result.data) { + setRegistryStatus(result.data) + } + }) + }, [activeTab]) + const hydratedSettingsSnapshotRef = useRef(null) useEffect(() => { @@ -544,6 +561,69 @@ const SettingsPanel: React.FC = () => { } } + /** + * 只检查 registry manifest,不下载完整规则包 + */ + const handleCheckRegistryUpdate = async () => { + setCheckingRegistryUpdate(true) + try { + const result = await window.electronAPI.toolRegistry.checkForUpdates() + if (!result.success || !result.data) { + throw new Error(result.error || t('registry.messages.checkFailed')) + } + setRegistryStatus(result.data) + if (result.data.state === 'UPDATE_AVAILABLE') { + message.success(t('registry.messages.updateAvailable')) + } else if (result.data.state === 'UP_TO_DATE') { + message.success(t('registry.messages.upToDate')) + } else if (result.data.state === 'CHECK_FAILED') { + message.warning(result.data.error || t('registry.messages.checkFailed')) + } + } catch (error) { + message.error(error instanceof Error ? error.message : t('registry.messages.checkFailed')) + } finally { + setCheckingRegistryUpdate(false) + } + } + + /** + * 安装 main process 最近验证的 registry update + */ + const handleInstallRegistryUpdate = async () => { + setInstallingRegistryUpdate(true) + try { + const result = await window.electronAPI.toolRegistry.installAvailableUpdate() + if (!result.success || !result.data) { + throw new Error(result.error || t('registry.messages.installFailed')) + } + setRegistryStatus(result.data) + message.success(t('registry.messages.installed')) + } catch (error) { + message.error(error instanceof Error ? error.message : t('registry.messages.installFailed')) + } finally { + setInstallingRegistryUpdate(false) + } + } + + /** + * 显式回滚到 last-known-good registry + */ + const handleRollbackRegistry = async () => { + setRollingBackRegistry(true) + try { + const result = await window.electronAPI.toolRegistry.rollback() + if (!result.success || !result.data) { + throw new Error(result.error || t('registry.messages.rollbackFailed')) + } + setRegistryStatus(result.data) + message.success(t('registry.messages.rolledBack')) + } catch (error) { + message.error(error instanceof Error ? error.message : t('registry.messages.rollbackFailed')) + } finally { + setRollingBackRegistry(false) + } + } + // 访问官网 const handleVisitWebsite = async () => { try { @@ -995,6 +1075,78 @@ const SettingsPanel: React.FC = () => { + + + + + {registryStatus?.embeddedVersion || '-'} + + + {registryStatus?.installedVersion || t('registry.embeddedOnly')} + + + + {registryStatus?.availableVersion || '-'} + + + + {registryStatus?.state || 'IDLE'} + + + {registryStatus?.error && ( + + )} + + + {registryStatus?.state === 'UPDATE_AVAILABLE' && ( + + + + )} + {registryStatus?.installedVersion && ( + + + + )} + + + {changelogStatus === 'loading' && ( |"`]/ + +/** + * 获取 UTF-8 字节长度 + * @param value 文本内容 + * @returns UTF-8 编码后的字节数 + */ +function getUtf8ByteLength(value: string): number { + return new TextEncoder().encode(value).byteLength +} + +/** + * 判断输入是否为非数组 plain object + * @param value 待判断输入 + * @returns 是否可按 JSON object 读取 + */ +function isRecord(value: unknown): value is Record { + return typeof value === 'object' && value !== null && !Array.isArray(value) +} + +/** + * 检查 object 是否只包含允许字段 + * @param value JSON object + * @param allowedKeys 允许字段集合 + * @param path JSON path + * @param errors 错误收集器 + */ +function validateAllowedKeys( + value: Record, + allowedKeys: string[], + path: string, + errors: string[] +): void { + const allowedKeySet = new Set(allowedKeys) + for (const key of Object.keys(value)) { + if (!allowedKeySet.has(key)) { + errors.push(`${path}.${key}: 不支持的字段`) + } + } +} + +/** + * 读取受长度限制的必填字符串 + * @param value 原始值 + * @param path JSON path + * @param errors 错误收集器 + * @param maxLength 最大长度 + * @returns 合法字符串或空字符串 + */ +function readString( + value: unknown, + path: string, + errors: string[], + maxLength: number = MAX_STRING_LENGTH +): string { + if (typeof value !== 'string' || value.length === 0) { + errors.push(`${path}: 必须为非空字符串`) + return '' + } + if (value.length > maxLength) { + errors.push(`${path}: 长度不能超过 ${maxLength}`) + } + return value +} + +/** + * 校验 strict SemVer + * @param value 原始版本值 + * @param path JSON path + * @param errors 错误收集器 + * @returns 版本字符串 + */ +function readSemVer(value: unknown, path: string, errors: string[]): string { + const version = readString(value, path, errors, 128) + if (version && !STRICT_SEMVER_PATTERN.test(version)) { + errors.push(`${path}: 必须为 strict SemVer`) + } + return version +} + +/** + * 校验稳定 identifier + * @param value 原始 identifier + * @param path JSON path + * @param errors 错误收集器 + * @returns identifier + */ +function readIdentifier(value: unknown, path: string, errors: string[]): string { + const identifier = readString(value, path, errors, 128) + if (identifier && !IDENTIFIER_PATTERN.test(identifier)) { + errors.push(`${path}: 必须为 lowercase kebab-case identifier`) + } + return identifier +} + +/** + * 校验本地化文本 + * @param value 原始值 + * @param path JSON path + * @param errors 错误收集器 + * @returns 本地化文本 + */ +function readLocalizedText(value: unknown, path: string, errors: string[]): LocalizedText { + if (!isRecord(value)) { + errors.push(`${path}: 必须为本地化文本对象`) + return { 'zh-CN': '', 'en-US': '' } + } + validateAllowedKeys(value, ['zh-CN', 'en-US'], path, errors) + return { + 'zh-CN': readString(value['zh-CN'], `${path}.zh-CN`, errors, MAX_LOCALIZED_TEXT_LENGTH), + 'en-US': readString(value['en-US'], `${path}.en-US`, errors, MAX_LOCALIZED_TEXT_LENGTH) + } +} + +/** + * 读取受 allowlist 限制的字符串数组 + * @param value 原始数组 + * @param allowedValues 允许值 + * @param path JSON path + * @param errors 错误收集器 + * @returns 去重后的允许值数组 + */ +function readAllowedArray( + value: unknown, + allowedValues: readonly T[], + path: string, + errors: string[] +): T[] { + if (!Array.isArray(value) || value.length === 0) { + errors.push(`${path}: 必须为非空数组`) + return [] + } + const allowedSet = new Set(allowedValues) + const result: T[] = [] + for (const [index, item] of value.entries()) { + if (typeof item !== 'string' || !allowedSet.has(item)) { + errors.push(`${path}[${index}]: 不支持的枚举值`) + continue + } + if (!result.includes(item as T)) { + result.push(item as T) + } + } + return result +} + +/** + * 校验声明式路径,禁止 traversal、URL、UNC 与未知变量 + * @param value 原始路径 + * @param path JSON path + * @param errors 错误收集器 + * @returns 合法路径模板 + */ +function readPathTemplate(value: unknown, path: string, errors: string[]): string { + const pathTemplate = readString(value, path, errors) + if (!pathTemplate) { + return pathTemplate + } + const rootVariableMatch = pathTemplate.match(/^\$\{([A-Z0-9_]+)\}(?:[/\\]|$)/) + if (!rootVariableMatch || !ALLOWED_PATH_VARIABLES.has(rootVariableMatch[1])) { + errors.push(`${path}: 必须从允许的根路径变量开始`) + } + if (FORBIDDEN_PATH_CHARACTERS.test(pathTemplate)) { + errors.push(`${path}: 包含不允许的路径字符`) + } + for (const forbiddenPattern of FORBIDDEN_PATH_PATTERNS) { + if (forbiddenPattern.test(pathTemplate)) { + errors.push(`${path}: 包含不允许的路径结构`) + break + } + } + const variablePattern = /\$\{([A-Z0-9_]+)\}/g + for (const match of pathTemplate.matchAll(variablePattern)) { + if (!ALLOWED_PATH_VARIABLES.has(match[1])) { + errors.push(`${path}: 包含不允许的路径变量 ${match[0]}`) + } + } + const variableTokens = pathTemplate.match(/\$\{[^}]*\}/g) ?? [] + const validVariableTokens = pathTemplate.match(/\$\{[A-Z0-9_]+\}/g) ?? [] + if (pathTemplate.includes('${') && variableTokens.length !== validVariableTokens.length) { + errors.push(`${path}: 路径变量格式无效`) + } + return pathTemplate +} + +/** + * 校验 detector 定义 + * @param value 原始 detector + * @param path JSON path + * @param errors 错误收集器 + * @returns detector definition + */ +function readDetector(value: unknown, path: string, errors: string[]): ToolDetectorDefinition { + if (!isRecord(value)) { + errors.push(`${path}: 必须为 detector object`) + return { type: 'PATH_EXISTS', path: '' } + } + validateAllowedKeys(value, ['type', 'command', 'path'], path, errors) + const detectorType = readString(value.type, `${path}.type`, errors, 64) as ToolDetectorType + if (!TOOL_DETECTOR_TYPES.includes(detectorType)) { + errors.push(`${path}.type: 不支持的 detector type`) + } + if (detectorType === 'COMMAND_EXISTS') { + const command = readString(value.command, `${path}.command`, errors, 128) + if (command && !COMMAND_NAME_PATTERN.test(command)) { + errors.push(`${path}.command: 只能为 executable name,不能包含参数或 shell 字符`) + } + if (value.path !== undefined) { + errors.push(`${path}.path: COMMAND_EXISTS 不允许 path`) + } + return { type: 'COMMAND_EXISTS', command } + } + const detectorPath = readPathTemplate(value.path, `${path}.path`, errors) + if (value.command !== undefined) { + errors.push(`${path}.command: PATH_EXISTS 不允许 command`) + } + return { type: 'PATH_EXISTS', path: detectorPath } +} + +/** + * 校验单个配置资产 + * @param value 原始配置资产 + * @param path JSON path + * @param errors 错误收集器 + * @returns 配置资产定义 + */ +function readArtifact(value: unknown, path: string, errors: string[]): ConfigArtifactDefinition { + if (!isRecord(value)) { + errors.push(`${path}: 必须为 artifact object`) + return { + artifactId: '', + displayName: { 'zh-CN': '', 'en-US': '' }, + format: 'TEXT', + scope: 'USER', + paths: {}, + capabilities: [], + handler: 'TEXT_FILE_V1' + } + } + validateAllowedKeys( + value, + ['artifactId', 'displayName', 'format', 'scope', 'paths', 'capabilities', 'handler', 'defaultTemplate'], + path, + errors + ) + const format = readString(value.format, `${path}.format`, errors, 32) as ArtifactFormat + if (!ARTIFACT_FORMATS.includes(format)) { + errors.push(`${path}.format: 不支持的 format`) + } + const scope = readString(value.scope, `${path}.scope`, errors, 32) as ArtifactScope + if (!ARTIFACT_SCOPES.includes(scope)) { + errors.push(`${path}.scope: 不支持的 scope`) + } + const handler = readString(value.handler, `${path}.handler`, errors, 64) as ArtifactHandler + if (!ARTIFACT_HANDLERS.includes(handler)) { + errors.push(`${path}.handler: 未注册的内置 handler`) + } + if (!isRecord(value.paths)) { + errors.push(`${path}.paths: 必须为 platform path object`) + } + const platformPaths: Partial> = {} + if (isRecord(value.paths)) { + validateAllowedKeys(value.paths, [...TOOL_PLATFORMS], `${path}.paths`, errors) + for (const platform of TOOL_PLATFORMS) { + const rawPaths = value.paths[platform] + if (rawPaths === undefined) { + continue + } + if (!Array.isArray(rawPaths) || rawPaths.length === 0 || rawPaths.length > 10) { + errors.push(`${path}.paths.${platform}: 必须包含 1-10 个路径`) + continue + } + platformPaths[platform] = rawPaths.map((item, index) => + readPathTemplate(item, `${path}.paths.${platform}[${index}]`, errors) + ) + } + } + const defaultTemplate = value.defaultTemplate === undefined + ? undefined + : readString(value.defaultTemplate, `${path}.defaultTemplate`, errors, 64 * 1024) + + return { + artifactId: readIdentifier(value.artifactId, `${path}.artifactId`, errors), + displayName: readLocalizedText(value.displayName, `${path}.displayName`, errors), + format, + scope, + paths: platformPaths, + capabilities: readAllowedArray( + value.capabilities, + TOOL_CAPABILITIES, + `${path}.capabilities`, + errors + ), + handler, + ...(defaultTemplate === undefined ? {} : { defaultTemplate }) + } +} + +/** + * 校验单个工具定义 + * @param value 原始工具定义 + * @param path JSON path + * @param errors 错误收集器 + * @returns 工具定义 + */ +function readTool(value: unknown, path: string, errors: string[]): ToolDefinition { + if (!isRecord(value)) { + errors.push(`${path}: 必须为 tool object`) + return { + toolId: '', + definitionVersion: '', + displayName: { 'zh-CN': '', 'en-US': '' }, + platforms: [], + detectors: [], + artifacts: [] + } + } + validateAllowedKeys( + value, + ['toolId', 'definitionVersion', 'displayName', 'platforms', 'detectors', 'artifacts'], + path, + errors + ) + const detectors = Array.isArray(value.detectors) ? value.detectors : [] + if (!Array.isArray(value.detectors) || detectors.length > MAX_DETECTORS_PER_TOOL) { + errors.push(`${path}.detectors: 必须为不超过 ${MAX_DETECTORS_PER_TOOL} 项的数组`) + } + const artifacts = Array.isArray(value.artifacts) ? value.artifacts : [] + if (!Array.isArray(value.artifacts) || artifacts.length === 0 || artifacts.length > MAX_ARTIFACTS_PER_TOOL) { + errors.push(`${path}.artifacts: 必须包含 1-${MAX_ARTIFACTS_PER_TOOL} 项`) + } + const parsedArtifacts = artifacts.slice(0, MAX_ARTIFACTS_PER_TOOL).map((artifact, index) => + readArtifact(artifact, `${path}.artifacts[${index}]`, errors) + ) + const artifactIds = new Set() + for (const artifact of parsedArtifacts) { + if (artifactIds.has(artifact.artifactId)) { + errors.push(`${path}.artifacts: artifactId ${artifact.artifactId} 重复`) + } + artifactIds.add(artifact.artifactId) + } + + return { + toolId: readIdentifier(value.toolId, `${path}.toolId`, errors), + definitionVersion: readSemVer(value.definitionVersion, `${path}.definitionVersion`, errors), + displayName: readLocalizedText(value.displayName, `${path}.displayName`, errors), + platforms: readAllowedArray(value.platforms, TOOL_PLATFORMS, `${path}.platforms`, errors), + detectors: detectors.slice(0, MAX_DETECTORS_PER_TOOL).map((detector, index) => + readDetector(detector, `${path}.detectors[${index}]`, errors) + ), + artifacts: parsedArtifacts + } +} + +/** + * 统计 JSON 节点与深度,阻止 schema bomb + * @param value JSON value + * @param depth 当前深度 + * @param state 统计状态 + */ +function inspectJsonComplexity( + value: unknown, + depth: number, + state: { nodes: number; tooDeep: boolean; tooMany: boolean } +): void { + state.nodes += 1 + if (state.nodes > MAX_JSON_NODES) { + state.tooMany = true + return + } + if (depth > MAX_JSON_DEPTH) { + state.tooDeep = true + return + } + if (Array.isArray(value)) { + for (const item of value) { + inspectJsonComplexity(item, depth + 1, state) + if (state.tooMany || state.tooDeep) return + } + } else if (isRecord(value)) { + for (const item of Object.values(value)) { + inspectJsonComplexity(item, depth + 1, state) + if (state.tooMany || state.tooDeep) return + } + } +} + +/** + * 解析并校验 registry bundle JSON 文本 + * @param rawJson UTF-8 JSON 文本 + * @returns 强类型 bundle 或错误列表 + */ +export function validateToolRegistryBundle(rawJson: string): RegistryValidationResult { + const errors: string[] = [] + if (getUtf8ByteLength(rawJson) > REGISTRY_BUNDLE_MAX_BYTES) { + return { success: false, errors: [`$: bundle 超过 ${REGISTRY_BUNDLE_MAX_BYTES} bytes`] } + } + let parsed: unknown + try { + parsed = JSON.parse(rawJson) + } catch (error) { + return { success: false, errors: [`$: JSON 解析失败: ${error instanceof Error ? error.message : String(error)}`] } + } + const complexity = { nodes: 0, tooDeep: false, tooMany: false } + inspectJsonComplexity(parsed, 0, complexity) + if (complexity.tooDeep) errors.push(`$: JSON 嵌套深度超过 ${MAX_JSON_DEPTH}`) + if (complexity.tooMany) errors.push(`$: JSON 节点数超过 ${MAX_JSON_NODES}`) + if (!isRecord(parsed)) { + return { success: false, errors: [...errors, '$: bundle 必须为 object'] } + } + validateAllowedKeys(parsed, ['schemaVersion', 'registryVersion', 'minimumAppVersion', 'tools'], '$', errors) + if (parsed.schemaVersion !== 1) { + errors.push('$.schemaVersion: 当前只支持 1') + } + const tools = Array.isArray(parsed.tools) ? parsed.tools : [] + if (!Array.isArray(parsed.tools) || tools.length === 0 || tools.length > MAX_TOOLS) { + errors.push(`$.tools: 必须包含 1-${MAX_TOOLS} 项`) + } + const parsedTools = tools.slice(0, MAX_TOOLS).map((tool, index) => readTool(tool, `$.tools[${index}]`, errors)) + const toolIds = new Set() + for (const tool of parsedTools) { + if (toolIds.has(tool.toolId)) { + errors.push(`$.tools: toolId ${tool.toolId} 重复`) + } + toolIds.add(tool.toolId) + } + const bundle: ToolRegistryBundle = { + schemaVersion: 1, + registryVersion: readSemVer(parsed.registryVersion, '$.registryVersion', errors), + minimumAppVersion: readSemVer(parsed.minimumAppVersion, '$.minimumAppVersion', errors), + tools: parsedTools + } + return errors.length === 0 + ? { success: true, data: bundle, errors: [] } + : { success: false, errors } +} + +/** + * 解析并校验 registry manifest JSON 文本 + * @param rawJson UTF-8 manifest JSON + * @param allowedOrigins 应用固定允许的 registry origins + * @returns 强类型 manifest 或错误列表 + */ +export function validateToolRegistryManifest( + rawJson: string, + allowedOrigins: string[] +): RegistryValidationResult { + if (getUtf8ByteLength(rawJson) > REGISTRY_MANIFEST_MAX_BYTES) { + return { success: false, errors: [`$: manifest 超过 ${REGISTRY_MANIFEST_MAX_BYTES} bytes`] } + } + let parsed: unknown + try { + parsed = JSON.parse(rawJson) + } catch (error) { + return { success: false, errors: [`$: JSON 解析失败: ${error instanceof Error ? error.message : String(error)}`] } + } + const errors: string[] = [] + if (!isRecord(parsed)) { + return { success: false, errors: ['$: manifest 必须为 object'] } + } + validateAllowedKeys( + parsed, + ['schemaVersion', 'registryVersion', 'minimumAppVersion', 'publishedAt', 'bundleUrl', 'bundleSha256', 'bundleSize', 'releaseNotes'], + '$', + errors + ) + if (parsed.schemaVersion !== 1) errors.push('$.schemaVersion: 当前只支持 1') + const bundleUrl = readString(parsed.bundleUrl, '$.bundleUrl', errors) + try { + const url = new URL(bundleUrl) + if (url.protocol !== 'https:') errors.push('$.bundleUrl: 必须使用 HTTPS') + if (!allowedOrigins.includes(url.origin)) errors.push('$.bundleUrl: origin 不在应用 allowlist') + } catch { + errors.push('$.bundleUrl: URL 格式无效') + } + const bundleSha256 = readString(parsed.bundleSha256, '$.bundleSha256', errors, 64) + if (bundleSha256 && !SHA256_PATTERN.test(bundleSha256)) errors.push('$.bundleSha256: 必须为 lowercase SHA-256') + const bundleSize = parsed.bundleSize + if (!Number.isInteger(bundleSize) || Number(bundleSize) <= 0 || Number(bundleSize) > REGISTRY_BUNDLE_MAX_BYTES) { + errors.push(`$.bundleSize: 必须为 1-${REGISTRY_BUNDLE_MAX_BYTES} 的整数`) + } + const publishedAt = readString(parsed.publishedAt, '$.publishedAt', errors, 64) + if (publishedAt && Number.isNaN(Date.parse(publishedAt))) errors.push('$.publishedAt: 必须为 ISO-8601 时间') + const manifest: ToolRegistryManifest = { + schemaVersion: 1, + registryVersion: readSemVer(parsed.registryVersion, '$.registryVersion', errors), + minimumAppVersion: readSemVer(parsed.minimumAppVersion, '$.minimumAppVersion', errors), + publishedAt, + bundleUrl, + bundleSha256, + bundleSize: Number(bundleSize), + releaseNotes: readLocalizedText(parsed.releaseNotes, '$.releaseNotes', errors) + } + return errors.length === 0 + ? { success: true, data: manifest, errors: [] } + : { success: false, errors } +} + +/** + * 比较 strict SemVer(忽略 build metadata,遵循 prerelease precedence) + * @param left 左侧版本 + * @param right 右侧版本 + * @returns left 小于、等于或大于 right + */ +export function compareStrictSemVer(left: string, right: string): -1 | 0 | 1 { + const parse = (value: string): { core: number[]; prerelease: string[] } => { + if (!STRICT_SEMVER_PATTERN.test(value)) throw new Error(`无效 SemVer: ${value}`) + const [withoutBuild] = value.split('+') + const [core, prerelease = ''] = withoutBuild.split('-') + return { core: core.split('.').map(Number), prerelease: prerelease ? prerelease.split('.') : [] } + } + const leftVersion = parse(left) + const rightVersion = parse(right) + for (let index = 0; index < 3; index += 1) { + if (leftVersion.core[index] < rightVersion.core[index]) return -1 + if (leftVersion.core[index] > rightVersion.core[index]) return 1 + } + if (leftVersion.prerelease.length === 0 && rightVersion.prerelease.length > 0) return 1 + if (leftVersion.prerelease.length > 0 && rightVersion.prerelease.length === 0) return -1 + const length = Math.max(leftVersion.prerelease.length, rightVersion.prerelease.length) + for (let index = 0; index < length; index += 1) { + const leftPart = leftVersion.prerelease[index] + const rightPart = rightVersion.prerelease[index] + if (leftPart === undefined) return -1 + if (rightPart === undefined) return 1 + if (leftPart === rightPart) continue + const leftNumeric = /^\d+$/.test(leftPart) + const rightNumeric = /^\d+$/.test(rightPart) + if (leftNumeric && rightNumeric) return Number(leftPart) < Number(rightPart) ? -1 : 1 + if (leftNumeric !== rightNumeric) return leftNumeric ? -1 : 1 + return leftPart < rightPart ? -1 : 1 + } + return 0 +} diff --git a/src/shared/tool-registry.ts b/src/shared/tool-registry.ts new file mode 100644 index 0000000..5bb8dbe --- /dev/null +++ b/src/shared/tool-registry.ts @@ -0,0 +1,196 @@ +/** + * @file src/shared/tool-registry.ts + * @description 定义 CCB 规则驱动工具注册表的共享 domain contract。 + */ + +/** 规则库支持的平台枚举值 */ +export const TOOL_PLATFORMS = ['WINDOWS', 'MACOS', 'LINUX'] as const + +/** 规则库支持的平台 */ +export type ToolPlatform = typeof TOOL_PLATFORMS[number] + +/** 配置资产支持的格式枚举值 */ +export const ARTIFACT_FORMATS = ['JSON', 'JSONC', 'YAML', 'TOML', 'MARKDOWN', 'TEXT'] as const + +/** 配置资产格式 */ +export type ArtifactFormat = typeof ARTIFACT_FORMATS[number] + +/** 配置资产作用域枚举值 */ +export const ARTIFACT_SCOPES = ['USER', 'PROJECT', 'WORKSPACE'] as const + +/** 配置资产作用域 */ +export type ArtifactScope = typeof ARTIFACT_SCOPES[number] + +/** 应用内置并允许被远程规则引用的能力枚举值 */ +export const TOOL_CAPABILITIES = [ + 'DISCOVER', + 'READ', + 'VALIDATE', + 'EDIT', + 'BACKUP', + 'RESTORE', + 'ACTIVATE', + 'WATCH' +] as const + +/** 工具配置能力 */ +export type ToolCapability = typeof TOOL_CAPABILITIES[number] + +/** 声明式检测器类型枚举值 */ +export const TOOL_DETECTOR_TYPES = ['COMMAND_EXISTS', 'PATH_EXISTS'] as const + +/** 声明式检测器类型 */ +export type ToolDetectorType = typeof TOOL_DETECTOR_TYPES[number] + +/** 首版允许的内置 handler 标识 */ +export const ARTIFACT_HANDLERS = ['JSON_FILE_V1', 'MARKDOWN_FILE_V1', 'TEXT_FILE_V1'] as const + +/** 配置资产 handler 标识 */ +export type ArtifactHandler = typeof ARTIFACT_HANDLERS[number] + +/** 本地化文本 */ +export interface LocalizedText { + /** 简体中文文本 */ + 'zh-CN': string + /** 英文文本 */ + 'en-US': string +} + +/** 工具安装检测规则 */ +export interface ToolDetectorDefinition { + /** 检测器类型 */ + type: ToolDetectorType + /** COMMAND_EXISTS 使用的可执行文件名 */ + command?: string + /** PATH_EXISTS 使用的受限变量路径 */ + path?: string +} + +/** 配置资产定义 */ +export interface ConfigArtifactDefinition { + /** 工具内稳定的配置资产标识 */ + artifactId: string + /** 显示名称 */ + displayName: LocalizedText + /** 文件内容格式 */ + format: ArtifactFormat + /** 配置作用域 */ + scope: ArtifactScope + /** 各平台候选路径 */ + paths: Partial> + /** 允许的管理能力 */ + capabilities: ToolCapability[] + /** 应用内置 handler */ + handler: ArtifactHandler + /** 新建配置时使用的声明式默认模板 */ + defaultTemplate?: string +} + +/** AI 工具规则定义 */ +export interface ToolDefinition { + /** 跨版本稳定的工具标识 */ + toolId: string + /** 单工具定义版本 */ + definitionVersion: string + /** 显示名称 */ + displayName: LocalizedText + /** 支持的平台 */ + platforms: ToolPlatform[] + /** 工具检测规则 */ + detectors: ToolDetectorDefinition[] + /** 工具配置资产 */ + artifacts: ConfigArtifactDefinition[] +} + +/** 完整工具规则库 bundle */ +export interface ToolRegistryBundle { + /** JSON protocol schema 版本 */ + schemaVersion: number + /** 整体规则库 SemVer */ + registryVersion: string + /** 可加载该规则库的最低应用版本 */ + minimumAppVersion: string + /** 工具定义列表 */ + tools: ToolDefinition[] +} + +/** 远程规则库 manifest */ +export interface ToolRegistryManifest { + /** JSON protocol schema 版本 */ + schemaVersion: number + /** 远程规则库 SemVer */ + registryVersion: string + /** 最低应用版本 */ + minimumAppVersion: string + /** ISO-8601 发布时间 */ + publishedAt: string + /** 规则 bundle HTTPS URL */ + bundleUrl: string + /** bundle raw bytes 的 SHA-256 */ + bundleSha256: string + /** bundle 预期字节数 */ + bundleSize: number + /** 更新说明 */ + releaseNotes: LocalizedText +} + +/** Registry 校验结果 */ +export interface RegistryValidationResult { + /** 是否通过全部安全与结构校验 */ + success: boolean + /** 校验成功后的强类型数据 */ + data?: T + /** 带 JSON path 的错误列表 */ + errors: string[] +} + +/** Registry 更新状态枚举值 */ +export const REGISTRY_UPDATE_STATES = [ + 'IDLE', + 'CHECKING_MANIFEST', + 'UP_TO_DATE', + 'UPDATE_AVAILABLE', + 'CHECK_FAILED', + 'DOWNLOADING', + 'VERIFYING_HASH', + 'VALIDATING_SCHEMA', + 'CHECKING_COMPATIBILITY', + 'STAGING', + 'INSTALLED', + 'ROLLED_BACK' +] as const + +/** Registry 更新状态 */ +export type RegistryUpdateState = typeof REGISTRY_UPDATE_STATES[number] + +/** Renderer 可安全读取的 registry update 状态 */ +export interface ToolRegistryUpdateStatus { + /** 当前状态机状态 */ + state: RegistryUpdateState + /** embedded registry version */ + embeddedVersion: string + /** 当前 installed/last-known-good version */ + installedVersion?: string + /** manifest 中的最新版本 */ + availableVersion?: string + /** manifest 发布时间 */ + publishedAt?: string + /** 更新说明 */ + releaseNotes?: LocalizedText + /** 最近检查时间 */ + lastCheckedAt?: string + /** 最近失败原因 */ + error?: string +} + +/** Effective registry snapshot */ +export interface ToolRegistrySnapshot { + /** 内置 registry version */ + embeddedVersion: string + /** 已加载 installed/last-known-good version */ + installedVersion?: string + /** 合并后的工具定义 */ + tools: ToolDefinition[] + /** 是否因 installed 损坏回退到 last-known-good */ + recoveredFromLastKnownGood: boolean +} diff --git a/tests/unit/main/performance-snapshot-service.spec.ts b/tests/unit/main/performance-snapshot-service.spec.ts new file mode 100644 index 0000000..c7fd889 --- /dev/null +++ b/tests/unit/main/performance-snapshot-service.spec.ts @@ -0,0 +1,55 @@ +/** + * @file tests/unit/main/performance-snapshot-service.spec.ts + * @description 验证性能 snapshot 只在调用时采集并正确汇总 Electron process metrics。 + */ + +import { describe, expect, it, vi } from 'vitest' + +const { getAppMetrics } = vi.hoisted(() => ({ + getAppMetrics: vi.fn(() => [ + { + type: 'Browser', + pid: 100, + cpu: { percentCPUUsage: 1.25 }, + memory: { workingSetSize: 1000, peakWorkingSetSize: 1500, privateBytes: 800 } + }, + { + type: 'Tab', + pid: 101, + cpu: { percentCPUUsage: 2.5 }, + memory: { workingSetSize: 2000, peakWorkingSetSize: 2500 } + } + ]) +})) + +vi.mock('electron', () => ({ + app: { + getAppMetrics, + getVersion: vi.fn(() => '1.5.0') + } +})) + +vi.mock('../../../src/main/utils/path-manager', () => ({ + pathManager: { appDataDir: 'C:\\test\\.ccb' } +})) + +import { PerformanceSnapshotService } from '../../../src/main/services/performance-snapshot-service' + +describe('PerformanceSnapshotService', () => { + it('构造时不应自动采样', () => { + new PerformanceSnapshotService() + + expect(getAppMetrics).not.toHaveBeenCalled() + }) + + it('capture 应汇总所有 Electron process working set', () => { + const service = new PerformanceSnapshotService() + const snapshot = service.capture() + + expect(getAppMetrics).toHaveBeenCalledOnce() + expect(snapshot.appVersion).toBe('1.5.0') + expect(snapshot.processes).toHaveLength(2) + expect(snapshot.totalWorkingSetKb).toBe(3000) + expect(snapshot.processes[1].privateBytesKb).toBeUndefined() + }) +}) diff --git a/tests/unit/main/registry-update-service.spec.ts b/tests/unit/main/registry-update-service.spec.ts new file mode 100644 index 0000000..33bc8fd --- /dev/null +++ b/tests/unit/main/registry-update-service.spec.ts @@ -0,0 +1,148 @@ +/** + * @file tests/unit/main/registry-update-service.spec.ts + * @description 验证 manifest-only check、explicit install 与 pinned origin 安全边界。 + */ + +import { describe, expect, it, vi } from 'vitest' +import type { ToolRegistrySnapshot } from '../../../src/main/services/tool-registry-service' +import { + RegistryUpdateService, + type RegistryHttpClient +} from '../../../src/main/services/registry-update-service' + +/** + * 创建最小 registry service fake + * @returns 带 mock methods 的 registry service + */ +function createRegistryServiceFake(): { + getSnapshot: ReturnType + installBundle: ReturnType + rollback: ReturnType +} { + const snapshot: ToolRegistrySnapshot = { + embeddedVersion: '1.0.0', + tools: [], + recoveredFromLastKnownGood: false + } + return { + getSnapshot: vi.fn(async () => snapshot), + installBundle: vi.fn(async () => '1.1.0'), + rollback: vi.fn(async () => '1.0.0') + } +} + +/** + * 创建 manifest 文本 + * @param overrides 可覆盖字段 + * @returns manifest JSON + */ +function createManifest(overrides: Record = {}): string { + return JSON.stringify({ + schemaVersion: 1, + registryVersion: '1.1.0', + minimumAppVersion: '1.5.0', + publishedAt: '2026-07-12T00:00:00.000Z', + bundleUrl: 'https://registry.example/bundle.json', + bundleSha256: 'a'.repeat(64), + bundleSize: 2, + releaseNotes: { 'zh-CN': '更新', 'en-US': 'Update' }, + ...overrides + }) +} + +describe('RegistryUpdateService', () => { + it('check 只获取 manifest,不下载 bundle', async () => { + const registryService = createRegistryServiceFake() + const httpClient: RegistryHttpClient = { + getText: vi.fn(async () => createManifest()) + } + const service = new RegistryUpdateService({ + registryService: registryService as never, + httpClient, + manifestUrl: 'https://registry.example/manifest.json', + allowedOrigins: ['https://registry.example'] + }) + + const status = await service.checkForUpdates('1.5.0') + + expect(status.state).toBe('UPDATE_AVAILABLE') + expect(httpClient.getText).toHaveBeenCalledOnce() + expect(httpClient.getText).toHaveBeenCalledWith('https://registry.example/manifest.json', expect.any(Number)) + expect(registryService.installBundle).not.toHaveBeenCalled() + }) + + it('未 check 或无 update 时应拒绝 install', async () => { + const service = new RegistryUpdateService({ + registryService: createRegistryServiceFake() as never, + httpClient: { getText: vi.fn() }, + manifestUrl: 'https://registry.example/manifest.json', + allowedOrigins: ['https://registry.example'] + }) + + await expect(service.installAvailableUpdate('1.5.0')).rejects.toThrow('没有经过验证') + }) + + it('用户明确 install 后才下载 bundle,并使用 manifest integrity 数据', async () => { + const registryService = createRegistryServiceFake() + const getText = vi.fn(async (url: string) => + url.endsWith('manifest.json') ? createManifest() : '{}' + ) + const service = new RegistryUpdateService({ + registryService: registryService as never, + httpClient: { getText }, + manifestUrl: 'https://registry.example/manifest.json', + allowedOrigins: ['https://registry.example'] + }) + + await service.checkForUpdates('1.5.0') + const status = await service.installAvailableUpdate('1.5.0') + + expect(getText).toHaveBeenCalledTimes(2) + expect(registryService.installBundle).toHaveBeenCalledWith({ + rawJson: '{}', + expectedSha256: 'a'.repeat(64), + expectedSize: 2, + currentAppVersion: '1.5.0' + }) + expect(status.state).toBe('INSTALLED') + }) + + it('应拒绝非 pinned manifest URL 与跨 origin bundle', async () => { + const badManifestService = new RegistryUpdateService({ + registryService: createRegistryServiceFake() as never, + httpClient: { getText: vi.fn() }, + manifestUrl: 'https://evil.example/manifest.json', + allowedOrigins: ['https://registry.example'] + }) + expect((await badManifestService.checkForUpdates('1.5.0')).state).toBe('CHECK_FAILED') + + const crossOriginService = new RegistryUpdateService({ + registryService: createRegistryServiceFake() as never, + httpClient: { getText: vi.fn(async () => createManifest({ bundleUrl: 'https://evil.example/bundle.json' })) }, + manifestUrl: 'https://registry.example/manifest.json', + allowedOrigins: ['https://registry.example'] + }) + expect((await crossOriginService.checkForUpdates('1.5.0')).state).toBe('CHECK_FAILED') + }) + + it('应合并并发 check,并在 manifest 要求更高 app version 时拒绝', async () => { + const registryService = createRegistryServiceFake() + const getText = vi.fn(async () => createManifest({ minimumAppVersion: '2.0.0' })) + const service = new RegistryUpdateService({ + registryService: registryService as never, + httpClient: { getText }, + manifestUrl: 'https://registry.example/manifest.json', + allowedOrigins: ['https://registry.example'] + }) + + const [first, second] = await Promise.all([ + service.checkForUpdates('1.5.0'), + service.checkForUpdates('1.5.0') + ]) + + expect(getText).toHaveBeenCalledOnce() + expect(first.state).toBe('CHECK_FAILED') + expect(second.state).toBe('CHECK_FAILED') + expect(first.error).toContain('要求 CCB >= 2.0.0') + }) +}) diff --git a/tests/unit/main/tool-registry-service.spec.ts b/tests/unit/main/tool-registry-service.spec.ts new file mode 100644 index 0000000..ca7fe00 --- /dev/null +++ b/tests/unit/main/tool-registry-service.spec.ts @@ -0,0 +1,160 @@ +/** + * @file tests/unit/main/tool-registry-service.spec.ts + * @description 验证 registry install、integrity、merge、fallback 与 rollback。 + */ + +import { mkdtemp, readFile, rm, writeFile } from 'fs/promises' +import os from 'os' +import path from 'path' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import builtinRegistryJson from '../../../src/shared/builtin-tool-registry.json' + +vi.mock('../../../src/main/utils/logger', () => ({ + logger: { + info: vi.fn(), + warn: vi.fn(), + error: vi.fn(), + debug: vi.fn() + } +})) + +import { + calculateRegistrySha256, + ToolRegistryService, + type ToolRegistryPaths +} from '../../../src/main/services/tool-registry-service' + +let tempDirectory: string +let registryPaths: ToolRegistryPaths + +/** + * 创建指定版本的有效 registry bundle + * @param registryVersion registry SemVer + * @param toolId tool identifier + * @returns raw JSON + */ +function createBundle(registryVersion: string, toolId: string = 'example-tool'): string { + return JSON.stringify({ + schemaVersion: 1, + registryVersion, + minimumAppVersion: '1.4.0', + tools: [{ + toolId, + definitionVersion: registryVersion, + displayName: { 'zh-CN': '示例工具', 'en-US': 'Example Tool' }, + platforms: ['WINDOWS'], + detectors: [{ type: 'PATH_EXISTS', path: '${HOME}/.example' }], + artifacts: [{ + artifactId: 'settings', + displayName: { 'zh-CN': '设置', 'en-US': 'Settings' }, + format: 'JSON', + scope: 'USER', + paths: { WINDOWS: ['${HOME}/.example/settings.json'] }, + capabilities: ['DISCOVER', 'READ'], + handler: 'JSON_FILE_V1' + }] + }] + }) +} + +beforeEach(async () => { + tempDirectory = await mkdtemp(path.join(os.tmpdir(), 'ccb-registry-')) + registryPaths = { + installed: path.join(tempDirectory, 'installed.json'), + metadata: path.join(tempDirectory, 'installed.meta.json'), + lastKnownGood: path.join(tempDirectory, 'last-known-good.json') + } +}) +afterEach(async () => { + await rm(tempDirectory, { recursive: true, force: true }) +}) + +describe('ToolRegistryService', () => { + it('无 installed bundle 时应返回内置 Claude adapter', async () => { + const service = new ToolRegistryService(registryPaths) + const snapshot = await service.getSnapshot() + + expect(snapshot.tools.map((tool) => tool.toolId)).toContain('claude-code') + expect(snapshot.installedVersion).toBeUndefined() + }) + + it('应校验 integrity 并合并 installed tool', async () => { + const service = new ToolRegistryService(registryPaths) + const rawJson = createBundle('1.1.0') + + await expect(service.installBundle({ + rawJson, + expectedSha256: '0'.repeat(64), + expectedSize: Buffer.byteLength(rawJson), + currentAppVersion: '1.5.0' + })).rejects.toThrow('SHA-256') + + await service.installBundle({ + rawJson, + expectedSha256: calculateRegistrySha256(rawJson), + expectedSize: Buffer.byteLength(rawJson), + currentAppVersion: '1.5.0' + }) + const snapshot = await service.getSnapshot() + + expect(snapshot.installedVersion).toBe('1.1.0') + expect(snapshot.tools.map((tool) => tool.toolId)).toEqual(['claude-code', 'example-tool']) + }) + + it('应拒绝不兼容 app version 与隐式 downgrade', async () => { + const service = new ToolRegistryService(registryPaths) + const futureBundle = JSON.parse(createBundle('2.0.0')) as Record + futureBundle.minimumAppVersion = '2.0.0' + const futureRaw = JSON.stringify(futureBundle) + + await expect(service.installBundle({ + rawJson: futureRaw, + expectedSha256: calculateRegistrySha256(futureRaw), + expectedSize: Buffer.byteLength(futureRaw), + currentAppVersion: '1.5.0' + })).rejects.toThrow('要求 CCB') + + const newerRaw = createBundle('2.0.0') + await service.installBundle({ + rawJson: newerRaw, + expectedSha256: calculateRegistrySha256(newerRaw), + expectedSize: Buffer.byteLength(newerRaw), + currentAppVersion: '2.0.0' + }) + const olderRaw = createBundle('1.9.0') + await expect(service.installBundle({ + rawJson: olderRaw, + expectedSha256: calculateRegistrySha256(olderRaw), + expectedSize: Buffer.byteLength(olderRaw), + currentAppVersion: '2.0.0' + })).rejects.toThrow('拒绝规则库降级') + }) + + it('installed 损坏时应回退 last-known-good,并支持显式 rollback', async () => { + const service = new ToolRegistryService(registryPaths) + const firstRaw = createBundle('1.1.0', 'first-tool') + await service.installBundle({ + rawJson: firstRaw, + expectedSha256: calculateRegistrySha256(firstRaw), + expectedSize: Buffer.byteLength(firstRaw), + currentAppVersion: '1.5.0' + }) + const secondRaw = createBundle('1.2.0', 'second-tool') + await service.installBundle({ + rawJson: secondRaw, + expectedSha256: calculateRegistrySha256(secondRaw), + expectedSize: Buffer.byteLength(secondRaw), + currentAppVersion: '1.5.0' + }) + + await writeFile(registryPaths.installed, '{broken', 'utf8') + const recovered = await service.getSnapshot() + expect(recovered.recoveredFromLastKnownGood).toBe(true) + expect(recovered.tools.map((tool) => tool.toolId)).toContain('first-tool') + + const rolledBackVersion = await service.rollback() + expect(rolledBackVersion).toBe('1.1.0') + const installed = JSON.parse(await readFile(registryPaths.installed, 'utf8')) as typeof builtinRegistryJson + expect(installed.registryVersion).toBe('1.1.0') + }) +}) diff --git a/tests/unit/shared/tool-registry-validator.spec.ts b/tests/unit/shared/tool-registry-validator.spec.ts new file mode 100644 index 0000000..f28e438 --- /dev/null +++ b/tests/unit/shared/tool-registry-validator.spec.ts @@ -0,0 +1,114 @@ +/** + * @file tests/unit/shared/tool-registry-validator.spec.ts + * @description 验证 registry schema、边界限制与 fail-closed 安全策略。 + */ + +import { describe, expect, it } from 'vitest' +import builtinRegistryJson from '../../../src/shared/builtin-tool-registry.json' +import { + compareStrictSemVer, + REGISTRY_BUNDLE_MAX_BYTES, + validateToolRegistryBundle, + validateToolRegistryManifest +} from '../../../src/shared/tool-registry-validator' + +describe('validateToolRegistryBundle', () => { + it('应接受内置 Claude Code registry', () => { + const result = validateToolRegistryBundle(JSON.stringify(builtinRegistryJson)) + + expect(result.success).toBe(true) + expect(result.data?.tools[0].toolId).toBe('claude-code') + expect(result.data?.tools[0].artifacts).toHaveLength(3) + }) + + it('应拒绝 command detector 参数与未知 capability', () => { + const invalid = structuredClone(builtinRegistryJson) as unknown as Record + const tools = invalid.tools as Array> + tools[0].detectors = [{ type: 'COMMAND_EXISTS', command: 'claude --version; whoami' }] + const artifacts = tools[0].artifacts as Array> + artifacts[0].capabilities = ['READ', 'EXECUTE_REMOTE_SCRIPT'] + + const result = validateToolRegistryBundle(JSON.stringify(invalid)) + + expect(result.success).toBe(false) + expect(result.errors.join('\n')).toContain('shell 字符') + expect(result.errors.join('\n')).toContain('不支持的枚举值') + }) + + it('应拒绝 traversal、未知路径变量与额外字段', () => { + const invalid = structuredClone(builtinRegistryJson) as unknown as Record + const tools = invalid.tools as Array> + tools[0].unexpectedScript = 'require("child_process")' + const artifacts = tools[0].artifacts as Array> + artifacts[0].paths = { WINDOWS: ['${UNKNOWN}/../secrets.json'] } + + const result = validateToolRegistryBundle(JSON.stringify(invalid)) + + expect(result.success).toBe(false) + expect(result.errors.join('\n')).toContain('不支持的字段') + expect(result.errors.join('\n')).toContain('不允许的路径结构') + expect(result.errors.join('\n')).toContain('不允许的路径变量') + }) + + it('应拒绝未使用受控根变量的绝对路径和 glob', () => { + const invalid = structuredClone(builtinRegistryJson) as unknown as Record + const tools = invalid.tools as Array> + const artifacts = tools[0].artifacts as Array> + artifacts[0].paths = { WINDOWS: ['C:\\Users\\Public\\*.json'] } + + const result = validateToolRegistryBundle(JSON.stringify(invalid)) + + expect(result.success).toBe(false) + expect(result.errors.join('\n')).toContain('必须从允许的根路径变量开始') + expect(result.errors.join('\n')).toContain('不允许的路径字符') + }) + + it('应在解析前拒绝超大 bundle', () => { + const result = validateToolRegistryBundle(' '.repeat(REGISTRY_BUNDLE_MAX_BYTES + 1)) + + expect(result.success).toBe(false) + expect(result.errors[0]).toContain('bundle 超过') + }) +}) + +describe('validateToolRegistryManifest', () => { + it('应接受 pinned origin 的 HTTPS manifest', () => { + const result = validateToolRegistryManifest(JSON.stringify({ + schemaVersion: 1, + registryVersion: '1.1.0', + minimumAppVersion: '1.5.0', + publishedAt: '2026-07-12T00:00:00.000Z', + bundleUrl: 'https://dev.niansir.com/software/ccb/registry/1.1.0.json', + bundleSha256: 'a'.repeat(64), + bundleSize: 1024, + releaseNotes: { 'zh-CN': '更新', 'en-US': 'Update' } + }), ['https://dev.niansir.com']) + + expect(result.success).toBe(true) + }) + + it('应拒绝 HTTP 与非 allowlist origin', () => { + const result = validateToolRegistryManifest(JSON.stringify({ + schemaVersion: 1, + registryVersion: '1.1.0', + minimumAppVersion: '1.5.0', + publishedAt: '2026-07-12T00:00:00.000Z', + bundleUrl: 'http://evil.example/registry.json', + bundleSha256: 'a'.repeat(64), + bundleSize: 1024, + releaseNotes: { 'zh-CN': '更新', 'en-US': 'Update' } + }), ['https://dev.niansir.com']) + + expect(result.success).toBe(false) + expect(result.errors.join('\n')).toContain('必须使用 HTTPS') + expect(result.errors.join('\n')).toContain('origin 不在应用 allowlist') + }) +}) + +describe('compareStrictSemVer', () => { + it('应正确处理 core 与 prerelease precedence', () => { + expect(compareStrictSemVer('1.5.0', '1.4.9')).toBe(1) + expect(compareStrictSemVer('1.5.0-beta.1', '1.5.0')).toBe(-1) + expect(compareStrictSemVer('1.5.0+build.2', '1.5.0+build.1')).toBe(0) + }) +}) From 8651c1e16c7cd941430c2820cbe055e48ee806a8 Mon Sep 17 00:00:00 2001 From: NianLog Date: Sun, 12 Jul 2026 23:19:31 +0800 Subject: [PATCH 03/13] feat: add generic tool discovery and Codex adapter --- CHANGELOG.md | 10 +- README.md | 15 +- README_CN.md | 15 +- SECURITY_AUDIT_REPORT.md | 23 ++ ...46\261\202\346\226\207\346\241\243-PRD.md" | 2 +- ...75\350\267\257\347\272\277\345\233\276.md" | 4 +- ...347\211\214\350\257\255\344\271\211ADR.md" | 39 +- docs/1.5.0/README.md | 19 +- src/main/ipc-handlers.ts | 10 + .../tool-artifact-discovery-service.ts | 235 ++++++++++++ src/main/services/tool-detection-service.ts | 336 ++++++++++++++++++ src/preload/index.ts | 21 ++ src/shared/builtin-tool-registry.json | 37 ++ src/shared/tool-registry.ts | 34 ++ .../tool-artifact-discovery-service.spec.ts | 159 +++++++++ .../unit/main/tool-detection-service.spec.ts | 148 ++++++++ tests/unit/main/tool-registry-service.spec.ts | 2 +- .../shared/tool-registry-validator.spec.ts | 2 + 18 files changed, 1067 insertions(+), 44 deletions(-) create mode 100644 src/main/services/tool-artifact-discovery-service.ts create mode 100644 src/main/services/tool-detection-service.ts create mode 100644 tests/unit/main/tool-artifact-discovery-service.spec.ts create mode 100644 tests/unit/main/tool-detection-service.spec.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index f924366..7122afe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -本文件记录 CCB (Claude Code Butler) 的所有显著变更。 +本文件记录 CCB(Coding Configuration Bridge,原 Claude Code Butler)的所有显著变更。 格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/), 版本号遵循 [语义化版本 Semantic Versioning](https://semver.org/lang/zh-CN/)。 @@ -16,6 +16,9 @@ - 建立规则驱动多 AI 工具配置平台基础:`ToolDefinition -> ConfigArtifactDefinition -> Capability` 共享 domain contract。 - 新增 bounded JSON registry validator,限制 bundle/manifest 大小、JSON 深度/节点数、路径变量、detector、handler 与 capability allowlist。 - 新增内置 Claude Code registry adapter,声明用户 settings、MCP registry 与全局 instructions 三类配置资产。 +- 新增 Codex CLI read-only adapter,声明 `${HOME}/.codex/config.toml` 的 detection、discovery 与 raw TOML read capability。 +- 新增受控 path template resolver 与无 shell 的 `PATH_EXISTS` / `COMMAND_EXISTS` detector executor。 +- 新增 registry-allowlisted artifact discovery/read service 与 IPC facade,拒绝 traversal、UNC、glob、symbolic link、任意 renderer 路径和超过 1 MiB 的配置文件。 - 新增 installed/last-known-good registry 原子存储、SHA-256 integrity、app compatibility、downgrade protection、merge 与显式 rollback。 - 新增 main-process registry manifest 检查;启动时只检查小型 manifest,不自动下载完整 bundle。 - Settings/About 新增规则库版本、检查、用户确认安装与 rollback 控件。 @@ -25,7 +28,7 @@ ### Changed - 应用版本检查与 registry manifest 检查并发执行,避免两个网络 timeout 串行叠加。 -- CCB 品牌全称建议升级为 `Cognitive Configuration Bridge`;当前为 provisional decision,等待产品所有者确认后再更新 UI/installer identity。 +- CCB 品牌全称确定为 `Coding Configuration Bridge(编程配置桥)`,保留 coding-first 产品语义;v1.5.0 继续兼容 `CCB`、`.ccb`、现有 appId 与 repository identity。 - package version 暂时保持 `1.4.0`,直到 v1.5.0 范围与发布验收完成。 ### Security @@ -37,7 +40,8 @@ ### Tests - 新增 registry validator、registry storage/rollback、manifest-only update、explicit install 与 performance snapshot 单元测试。 -- Full Vitest 当前为 14 个测试文件、84 项测试全部通过。 +- 新增 detector/path resolver 与 artifact discovery/read 安全边界单元测试。 +- Full Vitest 当前为 16 个测试文件、104 项测试全部通过。 ## [1.4.0] - 2026-06-15 diff --git a/README.md b/README.md index d025da7..266bd14 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@
-# ⚡ CCB (Claude Code Butler) +# ⚡ CCB (Coding Configuration Bridge) -**A desktop configuration workbench for Claude Code power users** +**A local-first configuration bridge for AI coding tools** English | [简体中文](./README_CN.md) @@ -17,18 +17,20 @@ English | [简体中文](./README_CN.md) ## 📖 Introduction -CCB (Claude Code Butler) is a local-first desktop application built with Electron, React, and TypeScript for managing Claude Code related assets. It centralizes config files, MCP servers, project bindings, automation rules, environment diagnostics, and managed-mode tooling into a single interface so users can edit, validate, preview, switch, and audit their setup without manually chasing files across directories. +CCB (Coding Configuration Bridge) is a local-first desktop application built with Electron, React, and TypeScript. The current `1.4.0` release manages Claude Code assets; the in-development `1.5.0` foundation adds a bounded JSON registry, generic tool detection, and read-only configuration discovery so additional AI coding tools can be adapted without embedding tool-specific branches throughout the application. ### Project Status - **Current release baseline**: `1.4.0` - **Next milestone**: `1.5.0` foundation development in progress +- **v1.5.0 implemented scope**: Claude Code and Codex CLI registry adapters, generic detection, and registry-allowlisted read-only artifact discovery +- **v1.5.0 remaining scope**: generic validation/edit/backup/restore, UI migration, and measured runtime performance optimization - **Security baseline (2026-07-12)**: Semgrep `0 findings / 0 scan errors`, root and proxy-server npm audits `0 vulnerabilities` -- **Verification baseline**: 84 tests across 14 test files, TypeScript checks, root production build, and proxy-server build passing +- **Verification baseline**: 104 tests across 16 test files, TypeScript and ESLint checks, root production build, and proxy-server build passing The package version remains `1.4.0` until the `1.5.0` scope, acceptance criteria, and release plan are finalized. See [SECURITY_AUDIT_REPORT.md](./SECURITY_AUDIT_REPORT.md) for the latest audit evidence and accepted trust boundaries. -The proposed new meaning of CCB is **Cognitive Configuration Bridge**, reflecting the transition from a Claude Code-only manager to a rule-driven multi-AI-tool configuration platform. This name is provisional until the product naming decision is confirmed. +The accepted new meaning of CCB is **Coding Configuration Bridge**, preserving the project's coding-first origin while reflecting its transition from a Claude Code-only manager to a rule-driven configuration platform for multiple AI coding tools. The `CCB` acronym and existing `.ccb`, app identity, and repository identifiers remain compatible during the v1.5.0 transition. ### ✨ Key Features @@ -368,9 +370,10 @@ The three excluded registry rules require the Semgrep Pro engine. Their correspo ### v1.5.0 foundation in progress - Added a declarative JSON tool registry model with bounded validation and an embedded Claude Code compatibility adapter. +- Added a read-only Codex CLI adapter plus generic `PATH_EXISTS` / `COMMAND_EXISTS` detection and registry-allowlisted artifact discovery. - Added explicit, integrity-checked registry installation and last-known-good rollback; automatic checks fetch only the small manifest. - Added registry controls under Settings/About and a main-process-only on-demand performance snapshot exporter. -- Architecture, security protocol, performance budgets, migration phases, and provisional brand naming are documented in [`docs/1.5.0`](./docs/1.5.0/README.md). +- Architecture, security protocol, performance budgets, migration phases, and the accepted brand decision are documented in [`docs/1.5.0`](./docs/1.5.0/README.md). ### Product experience updates diff --git a/README_CN.md b/README_CN.md index faee797..77a3b49 100644 --- a/README_CN.md +++ b/README_CN.md @@ -1,8 +1,8 @@
-# ⚡ CCB (Claude Code Butler) +# ⚡ CCB (Coding Configuration Bridge / 编程配置桥) -**面向 Claude Code 深度用户的桌面配置工作台** +**面向 AI Coding 工具的本地优先配置桥** [English](./README.md) | 简体中文 @@ -17,18 +17,20 @@ ## 📖 简介 -CCB (Claude Code Butler) 是一个基于 Electron、React 和 TypeScript 构建的本地优先桌面应用,用于统一管理 Claude Code 相关配置资产。它把配置文件、MCP 服务器、项目绑定、自动化规则、环境诊断以及托管模式工具集中到同一个界面中,方便用户在图形界面内完成编辑、校验、预览、切换与审计,而不需要手工在多个目录里来回处理文件。 +CCB(Coding Configuration Bridge / 编程配置桥)是一个基于 Electron、React 和 TypeScript 构建的本地优先桌面应用。当前 `1.4.0` 发布版聚焦 Claude Code 配置资产;开发中的 `1.5.0` foundation 已加入受约束 JSON registry、通用工具检测与只读配置发现,使新增 AI Coding 工具优先通过规则适配,而不是在应用中持续堆叠工具专用分支。 ### 项目状态 - **当前发布基线**:`1.4.0` - **下一里程碑**:`1.5.0` 基础设施开发中 +- **v1.5.0 已实施范围**:Claude Code 与 Codex CLI registry adapter、通用检测、registry allowlist 约束的只读 artifact discovery +- **v1.5.0 待实施范围**:通用 validation/edit/backup/restore、UI 迁移与基于实测的 runtime performance 优化 - **安全基线(2026-07-12)**:Semgrep `0 findings / 0 scan errors`,root 与 proxy-server npm audit 均为 `0 vulnerabilities` -- **验证基线**:14 个测试文件共 84 项测试、TypeScript 检查、root production build 与 proxy-server build 全部通过 +- **验证基线**:16 个测试文件共 104 项测试、TypeScript 与 ESLint 检查、root production build 与 proxy-server build 全部通过 在 `1.5.0` 的范围、验收标准与发布计划确认前,package version 继续保持 `1.4.0`,避免把开发目标误标为已发布版本。最新审计证据与已接受的信任边界见 [SECURITY_AUDIT_REPORT.md](./SECURITY_AUDIT_REPORT.md)。 -CCB 的新全称建议为 **Cognitive Configuration Bridge(智能配置桥)**,用于表达从 Claude Code 专用管理器向规则驱动的多 AI 工具配置平台演进。该名称在产品命名决策确认前保持 provisional 状态。 +CCB 的新全称已确定为 **Coding Configuration Bridge(编程配置桥)**:`Coding` 保留项目因编程而生的核心语义,`Configuration Bridge` 表达从 Claude Code 专用管理器向规则驱动的多 AI 编程工具配置平台演进。v1.5.0 过渡期间继续兼容 `CCB` 缩写以及现有 `.ccb`、应用 identity 和仓库标识。 ### ✨ 核心功能 @@ -368,9 +370,10 @@ semgrep scan \ ### v1.5.0 基础设施开发中 - 新增声明式 JSON 工具规则库模型、bounded validation 与内置 Claude Code 兼容 adapter。 +- 新增只读 Codex CLI adapter、通用 `PATH_EXISTS` / `COMMAND_EXISTS` 检测与 registry allowlist 约束的 artifact discovery。 - 新增需用户明确确认、具备 integrity 校验的规则库安装和 last-known-good rollback;自动检查只获取小型 manifest。 - Settings/About 已加入规则库操作入口,main process 新增完全按需的 performance snapshot exporter。 -- 架构、安全协议、性能预算、迁移阶段与 provisional 品牌方案见 [`docs/1.5.0`](./docs/1.5.0/README.md)。 +- 架构、安全协议、性能预算、迁移阶段与已接受的品牌决策见 [`docs/1.5.0`](./docs/1.5.0/README.md)。 ### 产品体验更新 diff --git a/SECURITY_AUDIT_REPORT.md b/SECURITY_AUDIT_REPORT.md index 68e173f..51ed490 100644 --- a/SECURITY_AUDIT_REPORT.md +++ b/SECURITY_AUDIT_REPORT.md @@ -77,3 +77,26 @@ Registry 中以下规则使用 `metavariable-name:module`,Semgrep OSS CLI `1.1 - `javascript.express.web.cors-default-config-express.cors-default-config-express` 最终扫描通过 `--exclude-rule` 明确排除这 3 条规则。人工补偿检查确认项目未使用 CryptoJS 或 Koa;Express default CORS 问题已发现并移除。若 CI 后续启用 Semgrep Pro,应移除这些 exclusions 并恢复对应规则。 + +### 2026-07-12:v1.5.0 generic discovery 增量复审 + +#### 审计范围与结果 + +- 使用根目录 `.venv` 中锁定的 Semgrep CLI `1.169.0`,复用 `p/security-audit`、`p/owasp-top-ten`、`p/javascript` 与既有 3 条 OSS Pro-only exclusions。 +- 扫描 179 个 Git tracked targets、执行 369 条规则,约 100% lines parsed;JSON 原始结果为 `0 findings / 0 errors`。 +- Root 与 `src/proxy-server` 的 `npm audit --audit-level=low` 均为 `0 vulnerabilities`。 +- Full Vitest 为 16 files / 104 tests,TypeScript、ESLint、root production build 与 proxy-server build 全部通过。 + +#### 本阶段安全改进 + +1. Registry path template 只允许 `HOME`、`APPDATA`、`LOCALAPPDATA`、`XDG_CONFIG_HOME`、`CCB_DATA` 根变量,并拒绝 traversal、UNC、glob、未知变量和嵌套变量。 +2. `COMMAND_EXISTS` 使用 `execFile(locator, [command])`、`shell: false`、5 秒 timeout 与 executable-name allowlist,不接受参数或 shell metacharacters。 +3. Artifact discovery/read 每次从 effective registry 重新推导路径 allowlist;renderer 提供的 path 只作为候选选择器,不能扩展 main process 文件权限。 +4. Read-only artifact 限制为当前平台 registry 声明、具有 `READ` capability、最大 1 MiB 的普通文件,并拒绝最终文件及中间目录中的 symbolic link/junction。 +5. Codex CLI adapter 首版只声明 `DISCOVER` / `READ`,TOML 以 raw UTF-8 text 返回;未验证的 edit semantics 不会伪装为通用能力。 + +#### 保留建议 + +- Semgrep 属于 pattern-based SAST,`0 findings` 不能替代 runtime authorization review、secret scanning 或手工 threat modeling。 +- 当前路径校验适合本地可信用户模型;若未来引入多用户服务或不可信本地进程对抗,应进一步采用 OS-level file handles、identity checks 与更严格的 TOCTOU 防护。 +- Remote registry 在 Ed25519 publisher signature 未实施前应维持 preview/beta,不能仅凭 HTTPS 与 SHA-256 宣称 publisher authenticity。 diff --git "a/docs/1.5.0/01-\344\272\247\345\223\201\351\234\200\346\261\202\346\226\207\346\241\243-PRD.md" "b/docs/1.5.0/01-\344\272\247\345\223\201\351\234\200\346\261\202\346\226\207\346\241\243-PRD.md" index 71129c1..9c0bc8c 100644 --- "a/docs/1.5.0/01-\344\272\247\345\223\201\351\234\200\346\261\202\346\226\207\346\241\243-PRD.md" +++ "b/docs/1.5.0/01-\344\272\247\345\223\201\351\234\200\346\261\202\346\226\207\346\241\243-PRD.md" @@ -10,7 +10,7 @@ v1.5.0 将 CCB 转向“规则驱动的配置控制平面”:应用提供稳 让用户在一个本地优先的桌面应用中发现、理解、备份、验证和管理多个 AI 工具的配置;让维护者通过受约束的 JSON 规则演进适配,而不是不断复制业务代码。 -品牌建议使用 `CCB — Cognitive Configuration Bridge`,中文语义建议为“智能配置桥”。它强调跨工具、跨配置形态的连接与治理,不再绑定 Claude Code。最终命名需用户确认。 +品牌确定使用 `CCB — Coding Configuration Bridge`,中文名称为“编程配置桥”。`Coding` 保留项目因编程而生的核心语义,`Configuration Bridge` 强调跨 AI 编程工具、跨配置形态的连接与治理,不再绑定 Claude Code。 ## 3. v1.5.0 目标 diff --git "a/docs/1.5.0/04-\346\200\247\350\203\275\345\267\245\347\250\213\344\270\216\345\256\236\346\226\275\350\267\257\347\272\277\345\233\276.md" "b/docs/1.5.0/04-\346\200\247\350\203\275\345\267\245\347\250\213\344\270\216\345\256\236\346\226\275\350\267\257\347\272\277\345\233\276.md" index 35c5833..a047ea6 100644 --- "a/docs/1.5.0/04-\346\200\247\350\203\275\345\267\245\347\250\213\344\270\216\345\256\236\346\226\275\350\267\257\347\272\277\345\233\276.md" +++ "b/docs/1.5.0/04-\346\200\247\350\203\275\345\267\245\347\250\213\344\270\216\345\256\236\346\226\275\350\267\257\347\272\277\345\233\276.md" @@ -73,7 +73,9 @@ | Preload bundle | 11.29 KB | 11.86 KB | +0.57 KB | | Settings lazy chunk | 28.01 KB | 30.95 KB | +2.94 KB | -这是 registry validator、storage、update service、IPC 与 Settings UI 的静态成本,不代表 runtime memory 或 startup performance。v1.5.0 后续必须通过 service lazy initialization、effective registry summary cache、feature locale split 等优化抵消新增成本,并以实机 snapshot 为准。Foundation 完成后 full suite 为 84 tests / 14 files。 +这是 registry validator、storage、update service、IPC 与 Settings UI 的静态成本,不代表 runtime memory 或 startup performance。v1.5.0 后续必须通过 service lazy initialization、effective registry summary cache、feature locale split 等优化抵消新增成本,并以实机 snapshot 为准。 + +Generic detection/read-only discovery 完成后的 production build:main bundle `265.93 KB`、preload bundle `12.08 KB`、Settings lazy chunk `30.95 KB`;full suite 为 104 tests / 16 files。相对 foundation,main 增加 `6.93 KB`、preload 增加 `0.22 KB`,renderer Settings chunk 未增加。该数据仍仅代表静态 bundle size,不能宣称 runtime memory、CPU 或 startup time 已下降;实机性能验收继续留在 Phase 5。 ### Phase 1:Registry core diff --git "a/docs/1.5.0/05-\345\223\201\347\211\214\350\257\255\344\271\211ADR.md" "b/docs/1.5.0/05-\345\223\201\347\211\214\350\257\255\344\271\211ADR.md" index 38d91a0..50beb4b 100644 --- "a/docs/1.5.0/05-\345\223\201\347\211\214\350\257\255\344\271\211ADR.md" +++ "b/docs/1.5.0/05-\345\223\201\347\211\214\350\257\255\344\271\211ADR.md" @@ -2,7 +2,7 @@ ## 状态 -Provisional — 等待产品所有者最终确认。 +Accepted — 产品所有者已确认至少一个 `C` 必须代表 `Coding`,并接受本 ADR 的品牌语义与兼容策略。 ## 背景 @@ -14,28 +14,24 @@ Provisional — 等待产品所有者最终确认。 同时,`CCB`、仓库名、`.ccb` 数据目录、GitHub links、appId 和用户认知已有稳定价值,直接更换缩写会引入迁移和发现成本。 -## 候选 +## 已接受方案 -### A. Cognitive Configuration Bridge(建议) +### Coding Configuration Bridge -- 中文建议:智能配置桥。 -- `Cognitive` 表达 AI/cognitive tools 范围,不绑定某个 vendor。 -- `Configuration Bridge` 表达跨工具、跨格式连接与治理。 +- 中文名称:编程配置桥。 +- `Coding` 保留项目因 coding 而生的核心定位,并覆盖 Claude Code、Cursor、Codex CLI、Gemini CLI 等 AI coding tools。 +- `Configuration Bridge` 表达跨工具、跨格式的连接与治理。 - 保留 `CCB` acronym 和现有技术 identity。 -### B. Config Control Base +## 未采用方案 -- 中文建议:配置控制基座。 -- 技术语义清晰,但品牌辨识度和 AI 属性较弱。 +- `Config Control Base`:技术语义清晰,但品牌辨识度较弱,也没有保留 coding-first 的产品根基。 +- `Cross-tool Configuration Butler`:传承 Butler 语义,但仍偏桌面助手,不足以表达规则平台。 +- 使用泛化的 AI/cognitive 语义:覆盖范围较宽,但弱化了项目服务 AI coding workflows 的核心定位。 -### C. Cross-tool Configuration Butler +## 决策 -- 中文建议:跨工具配置管家。 -- 传承 Butler 语义,但仍偏桌面助手,不足以表达规则平台。 - -## 建议决策 - -采用 `CCB — Cognitive Configuration Bridge` 作为 v1.5.0 产品全称,保留: +采用 `CCB — Coding Configuration Bridge(编程配置桥)` 作为 v1.5.0 产品全称,保留: - package name `ccb` - user data directory `.ccb` @@ -44,9 +40,10 @@ Provisional — 等待产品所有者最终确认。 逐步更新 display name、README、About、window title、installer productName 和文案。domain identifiers 使用 `tool/registry/artifact`,不得使用品牌名作为业务概念。 -## 需要产品所有者确认 +## 后续展示决策 + +以下事项不影响本 ADR 的 `Accepted` 状态,可在对应 UI/installer 实施阶段决定: -1. 是否确认英文全称 `Cognitive Configuration Bridge`? -2. 中文展示使用“智能配置桥”还是保留英文 CCB 不翻译? -3. v1.5.0 installer 是否显示 `CCB`,还是 `CCB - Cognitive Configuration Bridge`? -4. 仓库 rename 是否推迟到 v1.5.0 发布后,以降低代码迁移和链接失效风险? +1. 中文界面展示“CCB”“编程配置桥”或组合名称的具体层级。 +2. v1.5.0 installer 显示 `CCB`,还是 `CCB - Coding Configuration Bridge`。 +3. repository rename 是否推迟到 v1.5.0 发布后,以降低代码迁移和链接失效风险。 diff --git a/docs/1.5.0/README.md b/docs/1.5.0/README.md index 568fe08..6c5e60d 100644 --- a/docs/1.5.0/README.md +++ b/docs/1.5.0/README.md @@ -1,6 +1,6 @@ # CCB v1.5.0 规划索引 -> 状态:Phase 1 registry core、manifest update 与 performance snapshot foundation 已实施 +> 状态:Phase 1 registry core、manifest update、generic detection/read-only discovery 与 performance snapshot foundation 已实施 > 基线提交:`42dff6d` > 当前发布版本:`1.4.0`(在 v1.5.0 验收完成前不提前修改 package version) @@ -18,7 +18,7 @@ 2. 远程规则只允许引用应用内置、审计过的 declarative capabilities,不允许携带 JS、shell 或动态 module。 3. 应用可以自动检查规则 manifest 版本,但完整规则包必须由用户明确确认后下载。 4. Claude Code 在 v1.5.0 中作为第一个内置 adapter,现有配置和功能必须保持兼容。 -5. 品牌建议将 CCB 解释为 `Cognitive Configuration Bridge`;在用户确认前保持 provisional,不全仓替换。 +5. 品牌正式解释为 `Coding Configuration Bridge(编程配置桥)`;保留 `CCB`、`.ccb`、appId 与 repository identity 的兼容策略。 6. 性能优化以数据基线和预算为门禁,不接受无法测量的“感觉更快”。 ## 当前实现进度 @@ -26,14 +26,23 @@ - [x] Shared registry domain contract 与 UPPERCASE enums - [x] Bounded bundle/manifest validator - [x] Embedded Claude Code compatibility adapter +- [x] Embedded Codex CLI read-only adapter - [x] Atomic installed/last-known-good storage、merge、integrity 与 rollback - [x] Manifest-only automatic check、explicit bundle install - [x] Main/preload IPC 与 Settings/About 最小 UI - [x] On-demand performance snapshot/export foundation -- [ ] Generic detector/path resolver 与 read-only artifact discovery -- [ ] 第二个真实 AI tool read-only adapter +- [x] Generic detector/path resolver 与 read-only artifact discovery +- [x] 第二个真实 AI tool read-only adapter - [ ] Generic format codecs、edit/backup/restore - [ ] 实机 performance baseline 与首批优化 -- [ ] 品牌全称最终确认与 UI/installer 迁移 +- [x] 品牌全称确认为 Coding Configuration Bridge +- [ ] UI/installer 品牌迁移 + +### 当前安全边界 + +- Artifact read 每次重新从 effective registry 推导 allowlist,不信任 renderer 回传路径。 +- Path template 仅允许 `HOME`、`APPDATA`、`LOCALAPPDATA`、`XDG_CONFIG_HOME`、`CCB_DATA` 根变量,并拒绝 traversal、UNC 与 glob。 +- `COMMAND_EXISTS` 通过 `execFile` 参数数组和 `shell: false` 执行;首版 artifact read 拒绝 symbolic link 与超过 1 MiB 的文件。 +- Codex CLI adapter 当前仅支持 `DISCOVER` / `READ`,TOML 保持 raw UTF-8 text;未验证的 write semantics 不进入 1.5.0 foundation。 > 开发期兼容提示:package version 当前仍为 `1.4.0`,因此 `minimumAppVersion: 1.5.0` 的远程 manifest 会被按设计拒绝。Release phase 正式 bump 到 `1.5.0` 后才启用 production registry update;内置 registry 不受影响。 diff --git a/src/main/ipc-handlers.ts b/src/main/ipc-handlers.ts index 2b81ce2..72b4381 100644 --- a/src/main/ipc-handlers.ts +++ b/src/main/ipc-handlers.ts @@ -27,6 +27,7 @@ import { terminalManagementService } from './services/terminal-management-servic import { toolRegistryService } from './services/tool-registry-service' import { registryUpdateService } from './services/registry-update-service' import { performanceSnapshotService } from './services/performance-snapshot-service' +import { toolArtifactDiscoveryService } from './services/tool-artifact-discovery-service' import { ensureAllowedUrl, ensurePathWithinBase, @@ -113,6 +114,15 @@ export function setupIpcHandlers(): void { function setupToolRegistryHandlers(): void { ipcMain.handle('toolRegistry:getSnapshot', createSimpleHandler(() => toolRegistryService.getSnapshot())) ipcMain.handle('toolRegistry:getTool', createSimpleHandler((toolId: string) => toolRegistryService.getTool(toolId))) + ipcMain.handle('toolRegistry:detectTools', createSimpleHandler(() => toolArtifactDiscoveryService.detectTools())) + ipcMain.handle('toolRegistry:discoverArtifacts', createSimpleHandler((toolId: string) => + toolArtifactDiscoveryService.discoverArtifacts(toolId) + )) + ipcMain.handle('toolRegistry:readArtifact', createSimpleHandler(( + toolId: string, + artifactId: string, + requestedPath: string + ) => toolArtifactDiscoveryService.readArtifact(toolId, artifactId, requestedPath))) ipcMain.handle('toolRegistry:getUpdateStatus', createSimpleHandler(() => registryUpdateService.getStatus())) ipcMain.handle('toolRegistry:checkForUpdates', createSimpleHandler(() => registryUpdateService.checkForUpdates(app.getVersion()))) ipcMain.handle('toolRegistry:installAvailableUpdate', createSimpleHandler(() => diff --git a/src/main/services/tool-artifact-discovery-service.ts b/src/main/services/tool-artifact-discovery-service.ts new file mode 100644 index 0000000..72ce15f --- /dev/null +++ b/src/main/services/tool-artifact-discovery-service.ts @@ -0,0 +1,235 @@ +/** + * @file src/main/services/tool-artifact-discovery-service.ts + * @description 按 effective registry 安全发现并只读加载 AI Coding 工具配置资产。 + */ + +import { lstat, open } from 'fs/promises' +import path from 'path' +import type { + ConfigArtifactContent, + ConfigArtifactDefinition, + DiscoveredConfigArtifact, + ToolDefinition, + ToolDetectionResult +} from '@shared/tool-registry' +import { toolRegistryService, type ToolRegistryService } from './tool-registry-service' +import { ToolDetectionService } from './tool-detection-service' + +/** 单个配置资产允许读取的最大 UTF-8 bytes */ +export const CONFIG_ARTIFACT_MAX_BYTES = 1024 * 1024 + +/** Artifact discovery service 可替换依赖 */ +export interface ToolArtifactDiscoveryServiceOptions { + /** Effective registry provider */ + registryService?: ToolRegistryService + /** 安全 detector 与路径解析器 */ + detectionService?: ToolDetectionService +} + +/** + * 提供规则驱动的工具检测、资产发现和只读加载。 + * @description 每次读取都会重新从 effective registry 推导 allowlist,不信任 renderer 提供的路径。 + */ +export class ToolArtifactDiscoveryService { + private readonly registryService: ToolRegistryService + private readonly detectionService: ToolDetectionService + + /** + * 创建 artifact discovery service。 + * @param options registry 与 detector 可替换依赖 + */ + constructor(options: ToolArtifactDiscoveryServiceOptions = {}) { + this.registryService = options.registryService ?? toolRegistryService + this.detectionService = options.detectionService ?? new ToolDetectionService() + } + + /** + * 检测 effective registry 中当前平台支持的全部工具。 + * @returns 工具检测结果 + */ + public async detectTools(): Promise { + const snapshot = await this.registryService.getSnapshot() + return this.detectionService.detectTools(snapshot.tools) + } + + /** + * 发现工具在当前平台存在的普通配置文件。 + * @param toolId stable tool identifier + * @returns 已发现的配置资产 + */ + public async discoverArtifacts(toolId: string): Promise { + const tool = await this.requireTool(toolId) + if (!tool.platforms.includes(this.detectionService.getPlatform())) return [] + + const discovered = await Promise.all(tool.artifacts.map((artifact) => this.discoverArtifact(tool, artifact))) + return discovered.flat() + } + + /** + * 读取 registry 明确声明且具有 READ capability 的配置文件。 + * @param toolId stable tool identifier + * @param artifactId stable artifact identifier + * @param requestedPath renderer 从 discovery 结果中选择的绝对路径 + * @returns 原始 UTF-8 配置文本及 metadata + */ + public async readArtifact( + toolId: string, + artifactId: string, + requestedPath: string + ): Promise { + const tool = await this.requireTool(toolId) + const artifact = tool.artifacts.find((candidate) => candidate.artifactId === artifactId) + if (!artifact) throw new Error(`配置资产不存在: ${artifactId}`) + if (!artifact.capabilities.includes('READ')) { + throw new Error(`配置资产未声明 READ capability: ${artifactId}`) + } + + const allowedPaths = this.resolveArtifactPaths(artifact) + const resolvedPath = allowedPaths.find((candidate) => this.pathsEqual(candidate, requestedPath)) + if (!resolvedPath) throw new Error('拒绝读取 registry 未声明的配置路径') + + await this.assertNoSymbolicLinks(resolvedPath) + const fileHandle = await open(resolvedPath, 'r') + try { + const fileMetadata = await fileHandle.stat() + if (!fileMetadata.isFile()) throw new Error(`配置资产不是普通文件: ${resolvedPath}`) + if (fileMetadata.size > CONFIG_ARTIFACT_MAX_BYTES) { + throw new Error(`配置资产超过读取限制: ${CONFIG_ARTIFACT_MAX_BYTES} bytes`) + } + const buffer = Buffer.alloc(Math.min(fileMetadata.size + 1, CONFIG_ARTIFACT_MAX_BYTES + 1)) + const { bytesRead } = await fileHandle.read(buffer, 0, buffer.length, 0) + if (bytesRead > CONFIG_ARTIFACT_MAX_BYTES) { + throw new Error(`配置资产超过读取限制: ${CONFIG_ARTIFACT_MAX_BYTES} bytes`) + } + let content: string + try { + content = new TextDecoder('utf-8', { fatal: true }).decode(buffer.subarray(0, bytesRead)) + } catch { + throw new Error('配置资产不是有效的 UTF-8 文本') + } + return { + toolId, + artifactId: artifact.artifactId, + format: artifact.format, + path: resolvedPath, + size: fileMetadata.size, + lastModifiedAt: fileMetadata.mtime.toISOString(), + content + } + } finally { + await fileHandle.close() + } + } + + /** + * 获取 registry 中的工具定义。 + * @param toolId stable tool identifier + * @returns 工具定义 + */ + private async requireTool(toolId: string): Promise { + const tool = await this.registryService.getTool(toolId) + if (!tool) throw new Error(`工具定义不存在: ${toolId}`) + return tool + } + + /** + * 发现单个 artifact 的全部现有候选路径。 + * @param tool 所属工具 + * @param artifact 配置资产定义 + * @returns 当前存在的普通文件 + */ + private async discoverArtifact( + tool: ToolDefinition, + artifact: ConfigArtifactDefinition + ): Promise { + if (!artifact.capabilities.includes('DISCOVER')) return [] + const results = await Promise.all(this.resolveArtifactPaths(artifact).map(async (resolvedPath) => { + try { + return await this.readFileMetadata(tool.toolId, artifact, resolvedPath) + } catch (error) { + const nodeError = error as NodeJS.ErrnoException + if (nodeError.code === 'ENOENT' || nodeError.code === 'ENOTDIR') return undefined + throw error + } + })) + return results.filter((result): result is DiscoveredConfigArtifact => result !== undefined) + } + + /** + * 解析 artifact 在当前平台声明的候选路径。 + * @param artifact 配置资产定义 + * @returns 去重后的规范化绝对路径 + */ + private resolveArtifactPaths(artifact: ConfigArtifactDefinition): string[] { + const templates = artifact.paths[this.detectionService.getPlatform()] ?? [] + return [...new Set(templates.map((template) => this.detectionService.resolvePath(template)))] + } + + /** + * 读取并验证配置文件 metadata。 + * @param toolId stable tool identifier + * @param artifact 配置资产定义 + * @param resolvedPath 已通过 registry allowlist 的绝对路径 + * @returns discovery metadata + */ + private async readFileMetadata( + toolId: string, + artifact: ConfigArtifactDefinition, + resolvedPath: string + ): Promise { + await this.assertNoSymbolicLinks(resolvedPath) + const metadata = await lstat(resolvedPath) + if (metadata.isSymbolicLink() || !metadata.isFile()) { + throw new Error(`配置资产不是普通文件: ${resolvedPath}`) + } + if (metadata.size > CONFIG_ARTIFACT_MAX_BYTES) { + throw new Error(`配置资产超过读取限制: ${CONFIG_ARTIFACT_MAX_BYTES} bytes`) + } + return { + toolId, + artifactId: artifact.artifactId, + format: artifact.format, + path: resolvedPath, + size: metadata.size, + lastModifiedAt: metadata.mtime.toISOString() + } + } + + /** + * 拒绝最终文件及其任一中间目录中的 symbolic link/junction。 + * @param resolvedPath 已通过 registry allowlist 的绝对路径 + */ + private async assertNoSymbolicLinks(resolvedPath: string): Promise { + const platform = this.detectionService.getPlatform() + const pathImplementation = platform === 'WINDOWS' ? path.win32 : path.posix + const parsedPath = pathImplementation.parse(resolvedPath) + const segments = resolvedPath.slice(parsedPath.root.length).split(pathImplementation.sep).filter(Boolean) + let currentPath = parsedPath.root + for (const segment of segments) { + currentPath = pathImplementation.join(currentPath, segment) + const metadata = await lstat(currentPath) + if (metadata.isSymbolicLink()) { + throw new Error(`配置资产路径包含 symbolic link: ${currentPath}`) + } + } + } + + /** + * 比较 renderer 路径与 registry 规范路径。 + * @param allowedPath registry 推导路径 + * @param requestedPath renderer 请求路径 + * @returns 是否为同一规范字符串路径 + */ + private pathsEqual(allowedPath: string, requestedPath: string): boolean { + const platform = this.detectionService.getPlatform() + const pathImplementation = platform === 'WINDOWS' ? path.win32 : path.posix + if (typeof requestedPath !== 'string' || !pathImplementation.isAbsolute(requestedPath)) return false + const normalizedRequestedPath = pathImplementation.resolve(requestedPath) + return platform === 'WINDOWS' + ? allowedPath.toLocaleLowerCase('en-US') === normalizedRequestedPath.toLocaleLowerCase('en-US') + : allowedPath === normalizedRequestedPath + } +} + +/** 默认配置资产发现服务单例 */ +export const toolArtifactDiscoveryService = new ToolArtifactDiscoveryService() diff --git a/src/main/services/tool-detection-service.ts b/src/main/services/tool-detection-service.ts new file mode 100644 index 0000000..2ca8255 --- /dev/null +++ b/src/main/services/tool-detection-service.ts @@ -0,0 +1,336 @@ +/** + * @file src/main/services/tool-detection-service.ts + * @description 安全解析规则库路径,并以无 shell 的方式执行 AI 工具安装检测器。 + */ + +import { execFile } from 'child_process' +import { access } from 'fs/promises' +import os from 'os' +import path from 'path' +import type { + ToolDefinition, + ToolDetectorDefinition, + ToolDetectionResult, + ToolPlatform +} from '@shared/tool-registry' +import { pathManager } from '../utils/path-manager' + +/** 规则路径允许引用的根变量 */ +export const TOOL_PATH_VARIABLES = [ + 'HOME', + 'APPDATA', + 'LOCALAPPDATA', + 'XDG_CONFIG_HOME', + 'CCB_DATA' +] as const + +/** 规则路径根变量名称 */ +export type ToolPathVariable = typeof TOOL_PATH_VARIABLES[number] + +/** 单项 detector 的可审计执行结果 */ +export interface ToolDetectorExecutionResult { + /** detector 在工具定义中的位置 */ + index: number + /** detector 类型 */ + type: ToolDetectorDefinition['type'] + /** 当前 detector 是否命中 */ + matched: boolean + /** PATH_EXISTS 安全解析后的路径 */ + resolvedPath?: string + /** COMMAND_EXISTS 校验后的命令名 */ + command?: string + /** 非预期输入或执行失败的安全错误摘要 */ + error?: string +} + +/** 包含逐项详情的工具检测结果 */ +export interface DetailedToolDetectionResult extends ToolDetectionResult { + /** 每个 detector 的独立执行结果 */ + detectorResults: ToolDetectorExecutionResult[] +} + +/** detector service 可替换依赖,主要用于隔离测试和平台模拟 */ +export interface ToolDetectionServiceOptions { + /** 目标运行平台,默认使用当前 Node.js 平台 */ + platform?: NodeJS.Platform + /** 路径根变量覆盖值 */ + pathVariables?: Partial> + /** 文件存在性检查器 */ + pathExists?: (targetPath: string) => Promise + /** command lookup 执行器 */ + commandExists?: (command: string, platform: ToolPlatform) => Promise +} + +const COMMAND_NAME_PATTERN = /^[A-Za-z0-9._+-]+$/ +const PATH_VARIABLE_PATTERN = /^\$\{([A-Z0-9_]+)\}(?:[/\\](.*))?$/ +const FORBIDDEN_PATH_CHARACTER_PATTERN = /[\0*?<>|"`]/ +const TOOL_PATH_VARIABLE_SET = new Set(TOOL_PATH_VARIABLES) + +/** + * 将 Node.js 平台映射为规则库平台枚举。 + * @param platform Node.js 平台标识 + * @returns 对应规则库平台 + * @throws 不支持的平台不会被静默归入 LINUX + */ +export function mapNodePlatform(platform: NodeJS.Platform): ToolPlatform { + if (platform === 'win32') return 'WINDOWS' + if (platform === 'darwin') return 'MACOS' + if (platform === 'linux') return 'LINUX' + throw new Error(`不支持的工具检测平台: ${platform}`) +} + +/** + * 按目标平台选择路径实现,确保跨平台规则测试不依赖宿主机。 + * @param platform 规则库平台 + * @returns Windows 或 POSIX path implementation + */ +function getPathImplementation(platform: ToolPlatform): path.PlatformPath { + return platform === 'WINDOWS' ? path.win32 : path.posix +} + +/** + * 判断路径是否为 UNC 路径。 + * @param targetPath 待判断路径 + * @returns 是否使用 UNC 形式 + */ +function isUncPath(targetPath: string): boolean { + return /^[\\/]{2}/.test(targetPath) +} + +/** + * 创建默认路径变量映射。 + * @param platform 当前规则平台 + * @returns 仅包含可用绝对根路径的映射 + */ +function createDefaultPathVariables(platform: ToolPlatform): Partial> { + const home = os.homedir() + const xdgConfigHome = process.env.XDG_CONFIG_HOME + || (platform === 'WINDOWS' ? undefined : path.posix.join(home.replace(/\\/g, '/'), '.config')) + + return { + HOME: home, + APPDATA: process.env.APPDATA, + LOCALAPPDATA: process.env.LOCALAPPDATA, + XDG_CONFIG_HOME: xdgConfigHome, + CCB_DATA: pathManager.appDataDir + } +} + +/** + * 解析受控规则路径,并证明结果仍位于声明变量的根目录内。 + * @param template 以 allowlist 根变量开头的路径模板 + * @param platform 目标规则平台 + * @param pathVariables 根变量实际绝对路径 + * @returns 安全规范化后的绝对路径 + * @throws 模板越界、包含未知变量、UNC、glob 或缺少根变量时拒绝解析 + */ +export function resolveToolPath( + template: string, + platform: ToolPlatform, + pathVariables: Partial> +): string { + if (!template || FORBIDDEN_PATH_CHARACTER_PATTERN.test(template) || isUncPath(template)) { + throw new Error('路径模板包含不允许的字符或路径结构') + } + + const match = template.match(PATH_VARIABLE_PATTERN) + if (!match || !TOOL_PATH_VARIABLE_SET.has(match[1])) { + throw new Error('路径模板必须从允许的根变量开始') + } + + const variable = match[1] as ToolPathVariable + const relativePath = match[2] ?? '' + if (relativePath.includes('${') || /(^|[/\\])\.\.?(?:[/\\]|$)/.test(relativePath)) { + throw new Error('路径模板包含变量注入或 traversal') + } + + const pathImplementation = getPathImplementation(platform) + const rawRoot = pathVariables[variable] + if (!rawRoot || !pathImplementation.isAbsolute(rawRoot) || isUncPath(rawRoot)) { + throw new Error(`路径根变量 ${variable} 不可用或不是受支持的绝对路径`) + } + + const normalizedRoot = pathImplementation.resolve(rawRoot) + const normalizedRelativePath = relativePath.replace(/[\\/]+/g, pathImplementation.sep) + const resolvedPath = pathImplementation.resolve(normalizedRoot, normalizedRelativePath) + const relativeToRoot = pathImplementation.relative(normalizedRoot, resolvedPath) + const escapedRoot = relativeToRoot === '..' + || relativeToRoot.startsWith(`..${pathImplementation.sep}`) + || pathImplementation.isAbsolute(relativeToRoot) + + if (escapedRoot || isUncPath(resolvedPath)) { + throw new Error('解析后的路径超出允许根目录') + } + + return resolvedPath +} + +/** + * 使用操作系统 locator 和参数数组检查 command,绝不经过 shell。 + * @param command 已通过 executable name 校验的命令 + * @param platform 目标规则平台 + * @returns locator 是否成功找到命令 + */ +async function lookupCommand(command: string, platform: ToolPlatform): Promise { + const locator = platform === 'WINDOWS' ? 'where.exe' : 'which' + + return new Promise((resolve) => { + execFile( + locator, + [command], + { timeout: 5_000, windowsHide: true, shell: false }, + (error) => resolve(error === null) + ) + }) +} + +/** + * 默认文件存在性检查器。 + * @param targetPath 已通过边界校验的绝对路径 + * @returns 文件或目录是否可访问 + */ +async function defaultPathExists(targetPath: string): Promise { + try { + await access(targetPath) + return true + } catch { + return false + } +} + +/** + * 安全执行规则库声明的工具 detectors。 + * @description detectors 使用 any-match;单项错误会记录但不会中止其余检测。 + */ +export class ToolDetectionService { + private readonly platform: ToolPlatform + private readonly pathVariables: Partial> + private readonly pathExists: (targetPath: string) => Promise + private readonly commandExists: (command: string, platform: ToolPlatform) => Promise + + /** + * 创建工具检测服务。 + * @param options 平台、变量与测试替身 + */ + constructor(options: ToolDetectionServiceOptions = {}) { + this.platform = mapNodePlatform(options.platform ?? process.platform) + this.pathVariables = { + ...createDefaultPathVariables(this.platform), + ...options.pathVariables + } + this.pathExists = options.pathExists ?? defaultPathExists + this.commandExists = options.commandExists ?? lookupCommand + } + + /** + * 获取当前 detector 使用的规则平台。 + * @returns 当前规则平台 + */ + public getPlatform(): ToolPlatform { + return this.platform + } + + /** + * 使用 detector 相同的安全边界解析规则路径。 + * @param template registry 中经过校验的路径模板 + * @returns 安全规范化后的绝对路径 + */ + public resolvePath(template: string): string { + return resolveToolPath(template, this.platform, this.pathVariables) + } + + /** + * 并行检测 registry 中的工具。 + * @param tools 经过 registry validator 的工具定义列表 + * @returns 与输入顺序一致的检测结果 + */ + public async detectTools(tools: ToolDefinition[]): Promise { + return Promise.all(tools.map((tool) => this.detectTool(tool))) + } + + /** + * 对单个工具执行全部 detector 并汇总 any-match 结果。 + * @param tool 经过 registry validator 的工具定义 + * @returns 工具级汇总与逐项结果 + */ + public async detectTool(tool: ToolDefinition): Promise { + if (!tool.platforms.includes(this.platform)) { + const detectorResults = tool.detectors.map((detector, index) => ({ + index, + type: detector.type, + matched: false, + error: `工具不支持当前平台 ${this.platform}` + })) + return this.summarize(tool, detectorResults) + } + + const detectorResults = await Promise.all( + tool.detectors.map((detector, index) => this.executeDetector(detector, index)) + ) + return this.summarize(tool, detectorResults) + } + + /** + * 执行单个 detector。 + * @param detector detector definition + * @param index detector 在定义中的位置 + * @returns 单项可审计结果 + */ + private async executeDetector( + detector: ToolDetectorDefinition, + index: number + ): Promise { + try { + if (detector.type === 'COMMAND_EXISTS') { + const command = detector.command ?? '' + if (!COMMAND_NAME_PATTERN.test(command)) { + throw new Error('command 必须是无参数的安全 executable name') + } + return { + index, + type: detector.type, + command, + matched: await this.commandExists(command, this.platform) + } + } + + if (detector.type !== 'PATH_EXISTS') { + throw new Error(`不支持的 detector type: ${String(detector.type)}`) + } + const resolvedPath = this.resolvePath(detector.path ?? '') + return { + index, + type: detector.type, + resolvedPath, + matched: await this.pathExists(resolvedPath) + } + } catch (error) { + return { + index, + type: detector.type, + matched: false, + error: error instanceof Error ? error.message : String(error) + } + } + } + + /** + * 汇总 detector 结果。 + * @param tool 工具定义 + * @param detectorResults 逐项执行结果 + * @returns any-match 工具检测结果 + */ + private summarize( + tool: ToolDefinition, + detectorResults: ToolDetectorExecutionResult[] + ): DetailedToolDetectionResult { + const matchedDetectors = detectorResults.filter((result) => result.matched).length + return { + toolId: tool.toolId, + detected: matchedDetectors > 0, + matchedDetectors, + totalDetectors: detectorResults.length, + detectorResults + } + } +} diff --git a/src/preload/index.ts b/src/preload/index.ts index 30e70ea..33a1b22 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -46,7 +46,10 @@ import type { TerminalType } from '@shared/types/terminal' import type { + ConfigArtifactContent, + DiscoveredConfigArtifact, ToolDefinition, + ToolDetectionResult, ToolRegistrySnapshot, ToolRegistryUpdateStatus } from '@shared/tool-registry' @@ -219,6 +222,20 @@ interface ToolRegistryAPI { getSnapshot: () => Promise<{ success: boolean; data?: ToolRegistrySnapshot; error?: string }> /** 按 toolId 获取 definition */ getTool: (toolId: string) => Promise<{ success: boolean; data?: ToolDefinition; error?: string }> + /** 检测 effective registry 中的工具 */ + detectTools: () => Promise<{ success: boolean; data?: ToolDetectionResult[]; error?: string }> + /** 发现指定工具在当前平台存在的配置资产 */ + discoverArtifacts: (toolId: string) => Promise<{ + success: boolean + data?: DiscoveredConfigArtifact[] + error?: string + }> + /** 读取 discovery 返回且 registry 允许的配置资产 */ + readArtifact: (toolId: string, artifactId: string, path: string) => Promise<{ + success: boolean + data?: ConfigArtifactContent + error?: string + }> /** 获取当前 update 状态 */ getUpdateStatus: () => Promise<{ success: boolean; data?: ToolRegistryUpdateStatus; error?: string }> /** 只检查 manifest,不下载 bundle */ @@ -802,6 +819,10 @@ const systemAPI: SystemAPI = { const toolRegistryAPI: ToolRegistryAPI = { getSnapshot: () => ipcRenderer.invoke('toolRegistry:getSnapshot'), getTool: (toolId: string) => ipcRenderer.invoke('toolRegistry:getTool', toolId), + detectTools: () => ipcRenderer.invoke('toolRegistry:detectTools'), + discoverArtifacts: (toolId: string) => ipcRenderer.invoke('toolRegistry:discoverArtifacts', toolId), + readArtifact: (toolId: string, artifactId: string, path: string) => + ipcRenderer.invoke('toolRegistry:readArtifact', toolId, artifactId, path), getUpdateStatus: () => ipcRenderer.invoke('toolRegistry:getUpdateStatus'), checkForUpdates: () => ipcRenderer.invoke('toolRegistry:checkForUpdates'), installAvailableUpdate: () => ipcRenderer.invoke('toolRegistry:installAvailableUpdate'), diff --git a/src/shared/builtin-tool-registry.json b/src/shared/builtin-tool-registry.json index 706bcb2..c2553e9 100644 --- a/src/shared/builtin-tool-registry.json +++ b/src/shared/builtin-tool-registry.json @@ -73,6 +73,43 @@ "defaultTemplate": "# Global Instructions\n" } ] + }, + { + "toolId": "codex-cli", + "definitionVersion": "1.0.0", + "displayName": { + "zh-CN": "Codex CLI", + "en-US": "Codex CLI" + }, + "platforms": ["WINDOWS", "MACOS", "LINUX"], + "detectors": [ + { + "type": "COMMAND_EXISTS", + "command": "codex" + }, + { + "type": "PATH_EXISTS", + "path": "${HOME}/.codex/config.toml" + } + ], + "artifacts": [ + { + "artifactId": "user-config", + "displayName": { + "zh-CN": "用户配置", + "en-US": "User Configuration" + }, + "format": "TOML", + "scope": "USER", + "paths": { + "WINDOWS": ["${HOME}/.codex/config.toml"], + "MACOS": ["${HOME}/.codex/config.toml"], + "LINUX": ["${HOME}/.codex/config.toml"] + }, + "capabilities": ["DISCOVER", "READ"], + "handler": "TEXT_FILE_V1" + } + ] } ] } diff --git a/src/shared/tool-registry.ts b/src/shared/tool-registry.ts index 5bb8dbe..8412871 100644 --- a/src/shared/tool-registry.ts +++ b/src/shared/tool-registry.ts @@ -194,3 +194,37 @@ export interface ToolRegistrySnapshot { /** 是否因 installed 损坏回退到 last-known-good */ recoveredFromLastKnownGood: boolean } + +/** 工具检测结果 */ +export interface ToolDetectionResult { + /** 工具 identifier */ + toolId: string + /** 是否命中至少一个 detector */ + detected: boolean + /** 命中的 detector 数量 */ + matchedDetectors: number + /** detector 总数 */ + totalDetectors: number +} + +/** 只读配置资产发现结果 */ +export interface DiscoveredConfigArtifact { + /** 所属工具 identifier */ + toolId: string + /** 配置资产 identifier */ + artifactId: string + /** 文件内容格式 */ + format: ArtifactFormat + /** 解析后的绝对路径 */ + path: string + /** 文件大小 bytes */ + size: number + /** ISO-8601 修改时间 */ + lastModifiedAt: string +} + +/** 只读配置资产内容 */ +export interface ConfigArtifactContent extends DiscoveredConfigArtifact { + /** 原始 UTF-8 文本;首版不对 TOML 等未实现 codec 的格式伪造 parse 结果 */ + content: string +} diff --git a/tests/unit/main/tool-artifact-discovery-service.spec.ts b/tests/unit/main/tool-artifact-discovery-service.spec.ts new file mode 100644 index 0000000..a49751e --- /dev/null +++ b/tests/unit/main/tool-artifact-discovery-service.spec.ts @@ -0,0 +1,159 @@ +/** + * @file tests/unit/main/tool-artifact-discovery-service.spec.ts + * @description 验证规则驱动 artifact discovery 的 capability、路径与文件安全边界。 + */ + +import { mkdir, mkdtemp, rm, symlink, writeFile } from 'fs/promises' +import os from 'os' +import path from 'path' +import { afterEach, beforeEach, describe, expect, it } from 'vitest' +import type { ToolDefinition, ToolRegistrySnapshot } from '../../../src/shared/tool-registry' +import { ToolDetectionService } from '../../../src/main/services/tool-detection-service' +import { + CONFIG_ARTIFACT_MAX_BYTES, + ToolArtifactDiscoveryService +} from '../../../src/main/services/tool-artifact-discovery-service' +import type { ToolRegistryService } from '../../../src/main/services/tool-registry-service' + +let tempDirectory: string + +/** + * 创建可控制 capability 的测试工具定义。 + * @param capabilities artifact capabilities + * @returns 测试工具定义 + */ +function createTool(capabilities: ToolDefinition['artifacts'][number]['capabilities']): ToolDefinition { + return { + toolId: 'codex-cli', + definitionVersion: '1.0.0', + displayName: { 'zh-CN': 'Codex CLI', 'en-US': 'Codex CLI' }, + platforms: ['WINDOWS'], + detectors: [{ type: 'PATH_EXISTS', path: '${HOME}/.codex/config.toml' }], + artifacts: [{ + artifactId: 'user-config', + displayName: { 'zh-CN': '用户配置', 'en-US': 'User Configuration' }, + format: 'TOML', + scope: 'USER', + paths: { WINDOWS: ['${HOME}/.codex/config.toml'] }, + capabilities, + handler: 'TEXT_FILE_V1' + }] + } +} + +/** + * 创建只提供指定工具的 registry stub。 + * @param tool 测试工具定义 + * @returns registry service stub + */ +function createRegistryService(tool: ToolDefinition): ToolRegistryService { + const snapshot: ToolRegistrySnapshot = { + embeddedVersion: '1.0.0', + tools: [tool], + recoveredFromLastKnownGood: false + } + return { + getSnapshot: async () => snapshot, + getTool: async (toolId: string) => toolId === tool.toolId ? tool : undefined + } as ToolRegistryService +} + +/** + * 创建使用 Windows 路径语义和临时 HOME 的 discovery service。 + * @param tool 测试工具定义 + * @returns 可隔离测试的 discovery service + */ +function createService(tool: ToolDefinition): ToolArtifactDiscoveryService { + return new ToolArtifactDiscoveryService({ + registryService: createRegistryService(tool), + detectionService: new ToolDetectionService({ + platform: 'win32', + pathVariables: { HOME: tempDirectory }, + commandExists: async () => false + }) + }) +} + +beforeEach(async () => { + tempDirectory = await mkdtemp(path.join(os.tmpdir(), 'ccb-artifact-')) +}) + +afterEach(async () => { + await rm(tempDirectory, { recursive: true, force: true }) +}) + +describe('ToolArtifactDiscoveryService', () => { + it('应发现并读取 Codex TOML 原始文本', async () => { + const configDirectory = path.join(tempDirectory, '.codex') + await mkdir(configDirectory) + const configPath = path.join(configDirectory, 'config.toml') + const content = 'model = "gpt-5"\n' + await writeFile(configPath, content, 'utf8') + const service = createService(createTool(['DISCOVER', 'READ'])) + + const detected = await service.detectTools() + const artifacts = await service.discoverArtifacts('codex-cli') + const loaded = await service.readArtifact('codex-cli', 'user-config', artifacts[0].path) + + expect(detected[0].detected).toBe(true) + expect(artifacts).toHaveLength(1) + expect(loaded.content).toBe(content) + expect(loaded.format).toBe('TOML') + }) + + it('应忽略缺失文件并拒绝 registry 外部路径', async () => { + const service = createService(createTool(['DISCOVER', 'READ'])) + + await expect(service.discoverArtifacts('codex-cli')).resolves.toEqual([]) + await expect(service.readArtifact( + 'codex-cli', + 'user-config', + path.join(tempDirectory, 'secrets.txt') + )).rejects.toThrow('未声明') + }) + + it('应拒绝未声明 READ capability 的资产', async () => { + const service = createService(createTool(['DISCOVER'])) + await expect(service.readArtifact( + 'codex-cli', + 'user-config', + path.join(tempDirectory, '.codex', 'config.toml') + )).rejects.toThrow('READ capability') + }) + + it('应拒绝无效 UTF-8 配置文本', async () => { + const configDirectory = path.join(tempDirectory, '.codex') + await mkdir(configDirectory) + const configPath = path.join(configDirectory, 'config.toml') + await writeFile(configPath, Buffer.from([0xc3, 0x28])) + const service = createService(createTool(['DISCOVER', 'READ'])) + + await expect(service.readArtifact('codex-cli', 'user-config', configPath)).rejects.toThrow('UTF-8') + }) + + it('应拒绝超限文件和 symbolic link', async () => { + const configDirectory = path.join(tempDirectory, '.codex') + await mkdir(configDirectory) + const configPath = path.join(configDirectory, 'config.toml') + const service = createService(createTool(['DISCOVER', 'READ'])) + await writeFile(configPath, Buffer.alloc(CONFIG_ARTIFACT_MAX_BYTES + 1)) + + await expect(service.discoverArtifacts('codex-cli')).rejects.toThrow('超过读取限制') + + await rm(configPath) + const externalDirectory = path.join(tempDirectory, 'external') + await mkdir(externalDirectory) + await symlink(externalDirectory, configPath, 'junction') + await expect(service.discoverArtifacts('codex-cli')).rejects.toThrow('symbolic link') + }) + + it('应拒绝中间目录 junction 重定向', async () => { + const externalDirectory = path.join(tempDirectory, 'external-codex') + await mkdir(externalDirectory) + await writeFile(path.join(externalDirectory, 'config.toml'), 'secret = true\n', 'utf8') + await symlink(externalDirectory, path.join(tempDirectory, '.codex'), 'junction') + const service = createService(createTool(['DISCOVER', 'READ'])) + + await expect(service.discoverArtifacts('codex-cli')).rejects.toThrow('symbolic link') + }) +}) diff --git a/tests/unit/main/tool-detection-service.spec.ts b/tests/unit/main/tool-detection-service.spec.ts new file mode 100644 index 0000000..a13b0d6 --- /dev/null +++ b/tests/unit/main/tool-detection-service.spec.ts @@ -0,0 +1,148 @@ +/** + * @file tests/unit/main/tool-detection-service.spec.ts + * @description 验证工具 detector 的跨平台映射、受控路径边界与 any-match 汇总语义。 + */ + +import { describe, expect, it, vi } from 'vitest' +import type { ToolDefinition } from '../../../src/shared/tool-registry' +import { + mapNodePlatform, + resolveToolPath, + ToolDetectionService +} from '../../../src/main/services/tool-detection-service' + +/** + * 创建 detector 测试所需的最小工具定义。 + * @param detectors detector definitions + * @param platforms 支持的平台 + * @returns 完整工具定义 + */ +function createTool( + detectors: ToolDefinition['detectors'], + platforms: ToolDefinition['platforms'] = ['WINDOWS'] +): ToolDefinition { + return { + toolId: 'example-tool', + definitionVersion: '1.0.0', + displayName: { 'zh-CN': '示例', 'en-US': 'Example' }, + platforms, + detectors, + artifacts: [] + } +} + +describe('mapNodePlatform', () => { + it('应映射 Windows、macOS 与 Linux', () => { + expect(mapNodePlatform('win32')).toBe('WINDOWS') + expect(mapNodePlatform('darwin')).toBe('MACOS') + expect(mapNodePlatform('linux')).toBe('LINUX') + }) + + it('应拒绝未支持平台而不是错误归入 Linux', () => { + expect(() => mapNodePlatform('freebsd')).toThrow('不支持的工具检测平台') + }) +}) + +describe('resolveToolPath', () => { + it('应按 Windows 规则解析并保持在变量根内', () => { + expect(resolveToolPath('${APPDATA}/ccb/config.json', 'WINDOWS', { + APPDATA: 'C:\\Users\\alice\\AppData\\Roaming' + })).toBe('C:\\Users\\alice\\AppData\\Roaming\\ccb\\config.json') + }) + + it('应按 POSIX 规则解析 macOS 和 Linux 路径', () => { + expect(resolveToolPath('${HOME}/.config/tool', 'MACOS', { HOME: '/Users/alice' })) + .toBe('/Users/alice/.config/tool') + expect(resolveToolPath('${XDG_CONFIG_HOME}/tool', 'LINUX', { XDG_CONFIG_HOME: '/home/alice/.config' })) + .toBe('/home/alice/.config/tool') + }) + + it.each([ + ['${HOME}/../secret', 'traversal'], + ['${UNKNOWN}/tool', '允许的根变量'], + ['${HOME}/tool/*.json', '不允许的字符'], + ['${HOME}/${APPDATA}/tool', '变量注入'], + ['\\\\server\\share', '不允许的字符或路径结构'] + ])('应拒绝危险路径 %s', (template, expectedMessage) => { + expect(() => resolveToolPath(template, 'WINDOWS', { HOME: 'C:\\Users\\alice' })) + .toThrow(expectedMessage) + }) + + it('应拒绝 UNC 变量根和未配置变量', () => { + expect(() => resolveToolPath('${HOME}/tool', 'WINDOWS', { HOME: '\\\\server\\users\\alice' })) + .toThrow('不是受支持的绝对路径') + expect(() => resolveToolPath('${APPDATA}/tool', 'WINDOWS', {})) + .toThrow('路径根变量 APPDATA 不可用') + }) +}) + +describe('ToolDetectionService', () => { + it('应执行全部 detector 并使用 any-match 汇总', async () => { + const pathExists = vi.fn(async () => false) + const commandExists = vi.fn(async () => true) + const service = new ToolDetectionService({ + platform: 'win32', + pathVariables: { HOME: 'C:\\Users\\alice' }, + pathExists, + commandExists + }) + + const result = await service.detectTool(createTool([ + { type: 'PATH_EXISTS', path: '${HOME}/.example' }, + { type: 'COMMAND_EXISTS', command: 'example-cli' } + ])) + + expect(result.detected).toBe(true) + expect(result.matchedDetectors).toBe(1) + expect(result.detectorResults).toEqual([ + expect.objectContaining({ index: 0, type: 'PATH_EXISTS', matched: false }), + expect.objectContaining({ index: 1, type: 'COMMAND_EXISTS', command: 'example-cli', matched: true }) + ]) + expect(pathExists).toHaveBeenCalledWith('C:\\Users\\alice\\.example') + expect(commandExists).toHaveBeenCalledWith('example-cli', 'WINDOWS') + }) + + it('应在运行期再次拒绝带参数或 shell 字符的 command', async () => { + const commandExists = vi.fn(async () => true) + const service = new ToolDetectionService({ platform: 'win32', commandExists }) + + const result = await service.detectTool(createTool([ + { type: 'COMMAND_EXISTS', command: 'example --version; whoami' } + ])) + + expect(result.detected).toBe(false) + expect(result.detectorResults[0].error).toContain('executable name') + expect(commandExists).not.toHaveBeenCalled() + }) + + it('单项失败时应继续执行其他 detector 并保留错误', async () => { + const service = new ToolDetectionService({ + platform: 'linux', + pathVariables: { HOME: '/home/alice' }, + commandExists: async () => true + }) + const result = await service.detectTool(createTool([ + { type: 'PATH_EXISTS', path: '${HOME}/../secret' }, + { type: 'COMMAND_EXISTS', command: 'example' } + ], ['LINUX'])) + + expect(result.detected).toBe(true) + expect(result.detectorResults[0].error).toContain('traversal') + expect(result.detectorResults[1].matched).toBe(true) + }) + + it('工具不支持当前平台时不应调用外部检查器', async () => { + const pathExists = vi.fn(async () => true) + const commandExists = vi.fn(async () => true) + const service = new ToolDetectionService({ platform: 'win32', pathExists, commandExists }) + + const result = await service.detectTool(createTool([ + { type: 'COMMAND_EXISTS', command: 'example' } + ], ['MACOS'])) + + expect(result.detected).toBe(false) + expect(result.detectorResults[0].error).toContain('不支持当前平台 WINDOWS') + expect(pathExists).not.toHaveBeenCalled() + expect(commandExists).not.toHaveBeenCalled() + }) +}) diff --git a/tests/unit/main/tool-registry-service.spec.ts b/tests/unit/main/tool-registry-service.spec.ts index ca7fe00..c733f3a 100644 --- a/tests/unit/main/tool-registry-service.spec.ts +++ b/tests/unit/main/tool-registry-service.spec.ts @@ -98,7 +98,7 @@ describe('ToolRegistryService', () => { const snapshot = await service.getSnapshot() expect(snapshot.installedVersion).toBe('1.1.0') - expect(snapshot.tools.map((tool) => tool.toolId)).toEqual(['claude-code', 'example-tool']) + expect(snapshot.tools.map((tool) => tool.toolId)).toEqual(['claude-code', 'codex-cli', 'example-tool']) }) it('应拒绝不兼容 app version 与隐式 downgrade', async () => { diff --git a/tests/unit/shared/tool-registry-validator.spec.ts b/tests/unit/shared/tool-registry-validator.spec.ts index f28e438..80dfc85 100644 --- a/tests/unit/shared/tool-registry-validator.spec.ts +++ b/tests/unit/shared/tool-registry-validator.spec.ts @@ -19,6 +19,8 @@ describe('validateToolRegistryBundle', () => { expect(result.success).toBe(true) expect(result.data?.tools[0].toolId).toBe('claude-code') expect(result.data?.tools[0].artifacts).toHaveLength(3) + expect(result.data?.tools[1].toolId).toBe('codex-cli') + expect(result.data?.tools[1].artifacts[0].capabilities).toEqual(['DISCOVER', 'READ']) }) it('应拒绝 command detector 参数与未知 capability', () => { From 756c5a9d917c7d6e1c218091f1df6ef8f8229d72 Mon Sep 17 00:00:00 2001 From: NianLog Date: Sun, 12 Jul 2026 23:44:02 +0800 Subject: [PATCH 04/13] feat: add generic artifact management foundation --- CHANGELOG.md | 10 +- README.md | 19 +- README_CN.md | 19 +- SECURITY_AUDIT_REPORT.md | 17 ++ ...46\261\202\346\226\207\346\241\243-PRD.md" | 2 +- ...75\350\267\257\347\272\277\345\233\276.md" | 2 + ...347\211\214\350\257\255\344\271\211ADR.md" | 16 +- docs/1.5.0/README.md | 13 +- package-lock.json | 4 +- package.json | 4 +- src/main/ipc-handlers.ts | 21 ++ .../services/tool-artifact-codec-service.ts | 174 +++++++++++ .../tool-artifact-discovery-service.ts | 59 +++- .../tool-artifact-management-service.ts | 272 ++++++++++++++++++ src/main/utils/path-manager.ts | 1 + src/preload/index.ts | 34 +++ src/renderer/index.html | 4 +- src/renderer/src/components/Common/Logo.tsx | 4 +- .../src/components/Layout/ModernLayout.tsx | 2 +- .../src/components/Settings/SettingsPanel.tsx | 2 +- src/renderer/src/locales/index.ts | 8 +- src/shared/builtin-tool-registry.json | 2 +- src/shared/constants.ts | 8 +- src/shared/constants/index.ts | 9 +- src/shared/tool-registry.ts | 26 ++ .../main/tool-artifact-codec-service.spec.ts | 38 +++ .../tool-artifact-management-service.spec.ts | 126 ++++++++ 27 files changed, 826 insertions(+), 70 deletions(-) create mode 100644 src/main/services/tool-artifact-codec-service.ts create mode 100644 src/main/services/tool-artifact-management-service.ts create mode 100644 tests/unit/main/tool-artifact-codec-service.spec.ts create mode 100644 tests/unit/main/tool-artifact-management-service.spec.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 7122afe..15f585a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -本文件记录 CCB(Coding Configuration Bridge,原 Claude Code Butler)的所有显著变更。 +本文件记录 CCB(Coding Context Butler,原 Claude Code Butler)的所有显著变更。 格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/), 版本号遵循 [语义化版本 Semantic Versioning](https://semver.org/lang/zh-CN/)。 @@ -19,6 +19,7 @@ - 新增 Codex CLI read-only adapter,声明 `${HOME}/.codex/config.toml` 的 detection、discovery 与 raw TOML read capability。 - 新增受控 path template resolver 与无 shell 的 `PATH_EXISTS` / `COMMAND_EXISTS` detector executor。 - 新增 registry-allowlisted artifact discovery/read service 与 IPC facade,拒绝 traversal、UNC、glob、symbolic link、任意 renderer 路径和超过 1 MiB 的配置文件。 +- 新增内置 JSON/JSONC/YAML/MARKDOWN/TEXT codec、bounded validation、atomic edit 与 capability-driven backup/restore。 - 新增 installed/last-known-good registry 原子存储、SHA-256 integrity、app compatibility、downgrade protection、merge 与显式 rollback。 - 新增 main-process registry manifest 检查;启动时只检查小型 manifest,不自动下载完整 bundle。 - Settings/About 新增规则库版本、检查、用户确认安装与 rollback 控件。 @@ -28,8 +29,8 @@ ### Changed - 应用版本检查与 registry manifest 检查并发执行,避免两个网络 timeout 串行叠加。 -- CCB 品牌全称确定为 `Coding Configuration Bridge(编程配置桥)`,保留 coding-first 产品语义;v1.5.0 继续兼容 `CCB`、`.ccb`、现有 appId 与 repository identity。 -- package version 暂时保持 `1.4.0`,直到 v1.5.0 范围与发布验收完成。 +- `Coding Configuration Bridge(编程配置桥)` 候选因过于基础设施化且缺少产品性格被否决;正式采用 `Coding Context Butler(代码上下文管家)`。 +- 主应用 package version 升级为 `1.5.0`;独立 proxy package、appId、`.ccb` 与 repository identity 保持兼容。 ### Security @@ -41,7 +42,8 @@ - 新增 registry validator、registry storage/rollback、manifest-only update、explicit install 与 performance snapshot 单元测试。 - 新增 detector/path resolver 与 artifact discovery/read 安全边界单元测试。 -- Full Vitest 当前为 16 个测试文件、104 项测试全部通过。 +- 新增 codec 与 capability-driven edit/backup/restore 回归测试。 +- Full Vitest 当前为 18 个测试文件、113 项测试全部通过。 ## [1.4.0] - 2026-06-15 diff --git a/README.md b/README.md index 266bd14..6d375cf 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@
-# ⚡ CCB (Coding Configuration Bridge) +# ⚡ CCB (Coding Context Butler) -**A local-first configuration bridge for AI coding tools** +**Your local-first butler for AI coding context** English | [简体中文](./README_CN.md) @@ -17,20 +17,21 @@ English | [简体中文](./README_CN.md) ## 📖 Introduction -CCB (Coding Configuration Bridge) is a local-first desktop application built with Electron, React, and TypeScript. The current `1.4.0` release manages Claude Code assets; the in-development `1.5.0` foundation adds a bounded JSON registry, generic tool detection, and read-only configuration discovery so additional AI coding tools can be adapted without embedding tool-specific branches throughout the application. +CCB (Coding Context Butler) is a local-first desktop application built with Electron, React, and TypeScript. Version `1.5.0` evolves the original Claude Code Butler into a rule-driven manager for the configuration, instructions, MCP servers, agents, skills, and other context used by AI coding tools. ### Project Status -- **Current release baseline**: `1.4.0` -- **Next milestone**: `1.5.0` foundation development in progress +- **Current development version**: `1.5.0` +- **Release baseline**: `1.4.0` - **v1.5.0 implemented scope**: Claude Code and Codex CLI registry adapters, generic detection, and registry-allowlisted read-only artifact discovery -- **v1.5.0 remaining scope**: generic validation/edit/backup/restore, UI migration, and measured runtime performance optimization +- **v1.5.0 implemented scope**: generic codecs, validation, atomic edit, backup/restore, and secure IPC foundation +- **v1.5.0 remaining scope**: management UI migration and measured runtime performance optimization - **Security baseline (2026-07-12)**: Semgrep `0 findings / 0 scan errors`, root and proxy-server npm audits `0 vulnerabilities` -- **Verification baseline**: 104 tests across 16 test files, TypeScript and ESLint checks, root production build, and proxy-server build passing +- **Verification baseline**: 113 tests across 18 test files, TypeScript and ESLint checks, root production build, and proxy-server build passing -The package version remains `1.4.0` until the `1.5.0` scope, acceptance criteria, and release plan are finalized. See [SECURITY_AUDIT_REPORT.md](./SECURITY_AUDIT_REPORT.md) for the latest audit evidence and accepted trust boundaries. +The package version is now `1.5.0`; this marks an active development version rather than a completed public release. See [SECURITY_AUDIT_REPORT.md](./SECURITY_AUDIT_REPORT.md) for the latest audit evidence and accepted trust boundaries. -The accepted new meaning of CCB is **Coding Configuration Bridge**, preserving the project's coding-first origin while reflecting its transition from a Claude Code-only manager to a rule-driven configuration platform for multiple AI coding tools. The `CCB` acronym and existing `.ccb`, app identity, and repository identifiers remain compatible during the v1.5.0 transition. +The accepted new meaning of CCB is **Coding Context Butler**. `Coding` preserves why the project exists, `Context` covers the complete working context around AI coding tools, and `Butler` keeps the approachable personality and continuity of the original product. Existing `.ccb`, app identity, and repository identifiers remain compatible. ### ✨ Key Features diff --git a/README_CN.md b/README_CN.md index 77a3b49..1e6e59c 100644 --- a/README_CN.md +++ b/README_CN.md @@ -1,8 +1,8 @@
-# ⚡ CCB (Coding Configuration Bridge / 编程配置桥) +# ⚡ CCB (Coding Context Butler / 代码上下文管家) -**面向 AI Coding 工具的本地优先配置桥** +**你的本地优先 AI Coding 上下文管家** [English](./README.md) | 简体中文 @@ -17,20 +17,21 @@ ## 📖 简介 -CCB(Coding Configuration Bridge / 编程配置桥)是一个基于 Electron、React 和 TypeScript 构建的本地优先桌面应用。当前 `1.4.0` 发布版聚焦 Claude Code 配置资产;开发中的 `1.5.0` foundation 已加入受约束 JSON registry、通用工具检测与只读配置发现,使新增 AI Coding 工具优先通过规则适配,而不是在应用中持续堆叠工具专用分支。 +CCB(Coding Context Butler / 代码上下文管家)是一个基于 Electron、React 和 TypeScript 构建的本地优先桌面应用。`1.5.0` 将原 Claude Code Butler 演进为规则驱动的多 AI Coding 工具管理平台,统一治理配置、instructions、MCP servers、Agents、Skills 及其他工作上下文。 ### 项目状态 -- **当前发布基线**:`1.4.0` -- **下一里程碑**:`1.5.0` 基础设施开发中 +- **当前开发版本**:`1.5.0` +- **发布基线**:`1.4.0` - **v1.5.0 已实施范围**:Claude Code 与 Codex CLI registry adapter、通用检测、registry allowlist 约束的只读 artifact discovery -- **v1.5.0 待实施范围**:通用 validation/edit/backup/restore、UI 迁移与基于实测的 runtime performance 优化 +- **v1.5.0 已实施范围**:通用 codecs、validation、atomic edit、backup/restore 与安全 IPC foundation +- **v1.5.0 待实施范围**:管理 UI 迁移与基于实测的 runtime performance 优化 - **安全基线(2026-07-12)**:Semgrep `0 findings / 0 scan errors`,root 与 proxy-server npm audit 均为 `0 vulnerabilities` -- **验证基线**:16 个测试文件共 104 项测试、TypeScript 与 ESLint 检查、root production build 与 proxy-server build 全部通过 +- **验证基线**:18 个测试文件共 113 项测试、TypeScript 与 ESLint 检查、root production build 与 proxy-server build 全部通过 -在 `1.5.0` 的范围、验收标准与发布计划确认前,package version 继续保持 `1.4.0`,避免把开发目标误标为已发布版本。最新审计证据与已接受的信任边界见 [SECURITY_AUDIT_REPORT.md](./SECURITY_AUDIT_REPORT.md)。 +package version 已升级为 `1.5.0`,它表示当前开发版本,不代表公共 release 已完成。最新审计证据与已接受的信任边界见 [SECURITY_AUDIT_REPORT.md](./SECURITY_AUDIT_REPORT.md)。 -CCB 的新全称已确定为 **Coding Configuration Bridge(编程配置桥)**:`Coding` 保留项目因编程而生的核心语义,`Configuration Bridge` 表达从 Claude Code 专用管理器向规则驱动的多 AI 编程工具配置平台演进。v1.5.0 过渡期间继续兼容 `CCB` 缩写以及现有 `.ccb`、应用 identity 和仓库标识。 +CCB 的新全称确定为 **Coding Context Butler(代码上下文管家)**:`Coding` 保留项目因编程而生的核心语义,`Context` 覆盖 AI Coding 工具运行所需的完整上下文,`Butler` 延续原产品更有趣、亲切的管家性格。现有 `.ccb`、应用 identity 和仓库标识继续兼容。 ### ✨ 核心功能 diff --git a/SECURITY_AUDIT_REPORT.md b/SECURITY_AUDIT_REPORT.md index 51ed490..564db19 100644 --- a/SECURITY_AUDIT_REPORT.md +++ b/SECURITY_AUDIT_REPORT.md @@ -100,3 +100,20 @@ Registry 中以下规则使用 `metavariable-name:module`,Semgrep OSS CLI `1.1 - Semgrep 属于 pattern-based SAST,`0 findings` 不能替代 runtime authorization review、secret scanning 或手工 threat modeling。 - 当前路径校验适合本地可信用户模型;若未来引入多用户服务或不可信本地进程对抗,应进一步采用 OS-level file handles、identity checks 与更严格的 TOCTOU 防护。 - Remote registry 在 Ed25519 publisher signature 未实施前应维持 preview/beta,不能仅凭 HTTPS 与 SHA-256 宣称 publisher authenticity。 + +### 2026-07-12:v1.5.0 generic management 增量复审 + +#### 审计范围与结果 + +- Semgrep CLI `1.169.0` full scan 覆盖 181 个既有 Git tracked targets、执行 369 条规则,约 100% lines parsed,结果为 `0 findings / 0 errors`。 +- Semgrep 默认 tracked-file 枚举不包含 staged-but-uncommitted new files,因此对 2 个新 services 与 2 个新 specs 额外执行显式路径扫描;4 targets、332 applicable rules 同样为 `0 findings / 0 errors`。 +- Full Vitest 为 18 files / 113 tests;TypeScript、ESLint、root production build、proxy-server build 全部通过。 +- Root 与独立 proxy package 的 `npm audit --audit-level=low` 均为 `0 vulnerabilities`。 + +#### 本阶段安全改进 + +1. Generic edit、validate、backup、restore 各自要求 effective registry 中对应 UPPERCASE capability,不能由 format 或 renderer 自行推导权限。 +2. JSON/JSONC/YAML codecs 限制为内置实现,并加入 64-level / 50,000-node 结构预算;remote registry 不能下载 parser code。TOML 在可信 parser 接入前明确拒绝 validation/edit,不伪造支持。 +3. Edit 使用目标目录内随机 exclusive temp file、flush 与 atomic rename;带 `BACKUP` capability 的 artifact 在更新前自动备份,invalid content 不修改原文件。 +4. Backup 使用 UUID、exclusive copy、受控目录和 bounded metadata;restore 根据 metadata 重新校验 registry path 与 `RESTORE` capability,拒绝 symbolic link、超限内容、无效 UTF-8 和目标路径篡改。 +5. Codex CLI adapter 继续仅声明 `DISCOVER` / `READ`,因此新管理 IPC 不会扩大其写权限。 diff --git "a/docs/1.5.0/01-\344\272\247\345\223\201\351\234\200\346\261\202\346\226\207\346\241\243-PRD.md" "b/docs/1.5.0/01-\344\272\247\345\223\201\351\234\200\346\261\202\346\226\207\346\241\243-PRD.md" index 9c0bc8c..d2d0b4c 100644 --- "a/docs/1.5.0/01-\344\272\247\345\223\201\351\234\200\346\261\202\346\226\207\346\241\243-PRD.md" +++ "b/docs/1.5.0/01-\344\272\247\345\223\201\351\234\200\346\261\202\346\226\207\346\241\243-PRD.md" @@ -10,7 +10,7 @@ v1.5.0 将 CCB 转向“规则驱动的配置控制平面”:应用提供稳 让用户在一个本地优先的桌面应用中发现、理解、备份、验证和管理多个 AI 工具的配置;让维护者通过受约束的 JSON 规则演进适配,而不是不断复制业务代码。 -品牌确定使用 `CCB — Coding Configuration Bridge`,中文名称为“编程配置桥”。`Coding` 保留项目因编程而生的核心语义,`Configuration Bridge` 强调跨 AI 编程工具、跨配置形态的连接与治理,不再绑定 Claude Code。 +品牌确定使用 `CCB — Coding Context Butler`,中文描述为“代码上下文管家”。`Coding` 保留项目因编程而生的核心语义,`Context` 覆盖配置、instructions、MCP、Agents、Skills 与 rules,`Butler` 延续原产品有趣、亲切的管家人格,同时不再绑定 Claude Code。 ## 3. v1.5.0 目标 diff --git "a/docs/1.5.0/04-\346\200\247\350\203\275\345\267\245\347\250\213\344\270\216\345\256\236\346\226\275\350\267\257\347\272\277\345\233\276.md" "b/docs/1.5.0/04-\346\200\247\350\203\275\345\267\245\347\250\213\344\270\216\345\256\236\346\226\275\350\267\257\347\272\277\345\233\276.md" index a047ea6..e027a9c 100644 --- "a/docs/1.5.0/04-\346\200\247\350\203\275\345\267\245\347\250\213\344\270\216\345\256\236\346\226\275\350\267\257\347\272\277\345\233\276.md" +++ "b/docs/1.5.0/04-\346\200\247\350\203\275\345\267\245\347\250\213\344\270\216\345\256\236\346\226\275\350\267\257\347\272\277\345\233\276.md" @@ -77,6 +77,8 @@ Generic detection/read-only discovery 完成后的 production build:main bundle `265.93 KB`、preload bundle `12.08 KB`、Settings lazy chunk `30.95 KB`;full suite 为 104 tests / 16 files。相对 foundation,main 增加 `6.93 KB`、preload 增加 `0.22 KB`,renderer Settings chunk 未增加。该数据仍仅代表静态 bundle size,不能宣称 runtime memory、CPU 或 startup time 已下降;实机性能验收继续留在 Phase 5。 +Generic codec/edit/backup/restore foundation 完成后的 production build:main bundle `271.75 KB`、preload bundle `12.44 KB`、Settings lazy chunk `30.95 KB`、renderer entry `194.96 KB`;full suite 为 113 tests / 18 files。相对 read-only discovery 阶段,main 增加 `5.82 KB`、preload 增加 `0.36 KB`,Settings chunk 不变。新增成本位于 main/preload 权限边界,没有把 codec 或文件管理逻辑推入 renderer;它仍不是 runtime 资源下降证据。 + ### Phase 1:Registry core - shared types、validator、embedded registry、atomic installed store、last-known-good。 diff --git "a/docs/1.5.0/05-\345\223\201\347\211\214\350\257\255\344\271\211ADR.md" "b/docs/1.5.0/05-\345\223\201\347\211\214\350\257\255\344\271\211ADR.md" index 50beb4b..63cfb9b 100644 --- "a/docs/1.5.0/05-\345\223\201\347\211\214\350\257\255\344\271\211ADR.md" +++ "b/docs/1.5.0/05-\345\223\201\347\211\214\350\257\255\344\271\211ADR.md" @@ -2,7 +2,7 @@ ## 状态 -Accepted — 产品所有者已确认至少一个 `C` 必须代表 `Coding`,并接受本 ADR 的品牌语义与兼容策略。 +Accepted(修订 2)— 产品所有者确认至少一个 `C` 必须代表 `Coding`,并否决上一版 `Coding Configuration Bridge` 候选。 ## 背景 @@ -16,22 +16,24 @@ Accepted — 产品所有者已确认至少一个 `C` 必须代表 `Coding`, ## 已接受方案 -### Coding Configuration Bridge +### Coding Context Butler -- 中文名称:编程配置桥。 +- 中文描述:代码上下文管家。 - `Coding` 保留项目因 coding 而生的核心定位,并覆盖 Claude Code、Cursor、Codex CLI、Gemini CLI 等 AI coding tools。 -- `Configuration Bridge` 表达跨工具、跨格式的连接与治理。 +- `Context` 覆盖配置、instructions、MCP、Agents、Skills、rules 等完整 coding context。 +- `Butler` 延续原产品的趣味、亲切感与用户认知,不把产品降格为抽象基础设施。 - 保留 `CCB` acronym 和现有技术 identity。 ## 未采用方案 - `Config Control Base`:技术语义清晰,但品牌辨识度较弱,也没有保留 coding-first 的产品根基。 - `Cross-tool Configuration Butler`:传承 Butler 语义,但仍偏桌面助手,不足以表达规则平台。 +- `Coding Configuration Bridge(编程配置桥)`:曾在修订 1 中采用,后因语义过于基础设施化、中文表达生硬且缺少产品性格被产品所有者否决。 - 使用泛化的 AI/cognitive 语义:覆盖范围较宽,但弱化了项目服务 AI coding workflows 的核心定位。 ## 决策 -采用 `CCB — Coding Configuration Bridge(编程配置桥)` 作为 v1.5.0 产品全称,保留: +采用 `CCB — Coding Context Butler(代码上下文管家)` 作为 v1.5.0 产品全称,保留: - package name `ccb` - user data directory `.ccb` @@ -44,6 +46,6 @@ Accepted — 产品所有者已确认至少一个 `C` 必须代表 `Coding`, 以下事项不影响本 ADR 的 `Accepted` 状态,可在对应 UI/installer 实施阶段决定: -1. 中文界面展示“CCB”“编程配置桥”或组合名称的具体层级。 -2. v1.5.0 installer 显示 `CCB`,还是 `CCB - Coding Configuration Bridge`。 +1. 中文界面展示“CCB”“代码上下文管家”或组合名称的具体层级。 +2. v1.5.0 installer 显示 `CCB`,还是 `CCB - Coding Context Butler`。 3. repository rename 是否推迟到 v1.5.0 发布后,以降低代码迁移和链接失效风险。 diff --git a/docs/1.5.0/README.md b/docs/1.5.0/README.md index 6c5e60d..da18ea6 100644 --- a/docs/1.5.0/README.md +++ b/docs/1.5.0/README.md @@ -2,7 +2,7 @@ > 状态:Phase 1 registry core、manifest update、generic detection/read-only discovery 与 performance snapshot foundation 已实施 > 基线提交:`42dff6d` -> 当前发布版本:`1.4.0`(在 v1.5.0 验收完成前不提前修改 package version) +> 当前开发版本:`1.5.0`(公共 release 仍需完成 UI 与性能验收) ## 文档 @@ -18,7 +18,7 @@ 2. 远程规则只允许引用应用内置、审计过的 declarative capabilities,不允许携带 JS、shell 或动态 module。 3. 应用可以自动检查规则 manifest 版本,但完整规则包必须由用户明确确认后下载。 4. Claude Code 在 v1.5.0 中作为第一个内置 adapter,现有配置和功能必须保持兼容。 -5. 品牌正式解释为 `Coding Configuration Bridge(编程配置桥)`;保留 `CCB`、`.ccb`、appId 与 repository identity 的兼容策略。 +5. 品牌正式解释为 `Coding Context Butler(代码上下文管家)`;保留 `CCB`、`.ccb`、appId 与 repository identity 的兼容策略。 6. 性能优化以数据基线和预算为门禁,不接受无法测量的“感觉更快”。 ## 当前实现进度 @@ -33,10 +33,11 @@ - [x] On-demand performance snapshot/export foundation - [x] Generic detector/path resolver 与 read-only artifact discovery - [x] 第二个真实 AI tool read-only adapter -- [ ] Generic format codecs、edit/backup/restore +- [x] Generic format codecs、validation、edit/backup/restore foundation - [ ] 实机 performance baseline 与首批优化 -- [x] 品牌全称确认为 Coding Configuration Bridge -- [ ] UI/installer 品牌迁移 +- [x] 品牌全称确认为 Coding Context Butler +- [x] Runtime display branding 迁移 +- [ ] Generic management UI 与 installer 长文案迁移 ### 当前安全边界 @@ -45,4 +46,4 @@ - `COMMAND_EXISTS` 通过 `execFile` 参数数组和 `shell: false` 执行;首版 artifact read 拒绝 symbolic link 与超过 1 MiB 的文件。 - Codex CLI adapter 当前仅支持 `DISCOVER` / `READ`,TOML 保持 raw UTF-8 text;未验证的 write semantics 不进入 1.5.0 foundation。 -> 开发期兼容提示:package version 当前仍为 `1.4.0`,因此 `minimumAppVersion: 1.5.0` 的远程 manifest 会被按设计拒绝。Release phase 正式 bump 到 `1.5.0` 后才启用 production registry update;内置 registry 不受影响。 +> 开发期兼容提示:package version 已为 `1.5.0`,满足同版本 remote manifest 的 compatibility check;remote registry 在 publisher signature 未实施前仍保持 preview/beta,不因版本升级自动扩大信任。 diff --git a/package-lock.json b/package-lock.json index e547826..28ba81b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ccb", - "version": "1.4.0", + "version": "1.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ccb", - "version": "1.4.0", + "version": "1.5.0", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 1185d07..f2aa940 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ccb", - "version": "1.4.0", - "description": "Claude Code Butler - 配置管理工具", + "version": "1.5.0", + "description": "Coding Context Butler - AI Coding 工具上下文管理平台", "main": "out/main/index.js", "scripts": { "dev": "node scripts/dev-runner.cjs dev", diff --git a/src/main/ipc-handlers.ts b/src/main/ipc-handlers.ts index 72b4381..30c314c 100644 --- a/src/main/ipc-handlers.ts +++ b/src/main/ipc-handlers.ts @@ -28,6 +28,7 @@ import { toolRegistryService } from './services/tool-registry-service' import { registryUpdateService } from './services/registry-update-service' import { performanceSnapshotService } from './services/performance-snapshot-service' import { toolArtifactDiscoveryService } from './services/tool-artifact-discovery-service' +import { toolArtifactManagementService } from './services/tool-artifact-management-service' import { ensureAllowedUrl, ensurePathWithinBase, @@ -123,6 +124,26 @@ function setupToolRegistryHandlers(): void { artifactId: string, requestedPath: string ) => toolArtifactDiscoveryService.readArtifact(toolId, artifactId, requestedPath))) + ipcMain.handle('toolRegistry:validateArtifact', createSimpleHandler(( + toolId: string, + artifactId: string, + requestedPath: string, + content: string + ) => toolArtifactManagementService.validateArtifact(toolId, artifactId, requestedPath, content))) + ipcMain.handle('toolRegistry:editArtifact', createSimpleHandler(( + toolId: string, + artifactId: string, + requestedPath: string, + content: string + ) => toolArtifactManagementService.editArtifact(toolId, artifactId, requestedPath, content))) + ipcMain.handle('toolRegistry:createArtifactBackup', createSimpleHandler(( + toolId: string, + artifactId: string, + requestedPath: string + ) => toolArtifactManagementService.createBackup(toolId, artifactId, requestedPath))) + ipcMain.handle('toolRegistry:restoreArtifactBackup', createSimpleHandler((backupId: string) => + toolArtifactManagementService.restoreBackup(backupId) + )) ipcMain.handle('toolRegistry:getUpdateStatus', createSimpleHandler(() => registryUpdateService.getStatus())) ipcMain.handle('toolRegistry:checkForUpdates', createSimpleHandler(() => registryUpdateService.checkForUpdates(app.getVersion()))) ipcMain.handle('toolRegistry:installAvailableUpdate', createSimpleHandler(() => diff --git a/src/main/services/tool-artifact-codec-service.ts b/src/main/services/tool-artifact-codec-service.ts new file mode 100644 index 0000000..ab3f2e3 --- /dev/null +++ b/src/main/services/tool-artifact-codec-service.ts @@ -0,0 +1,174 @@ +/** + * @file src/main/services/tool-artifact-codec-service.ts + * @description 提供规则驱动配置资产的内置、不可下载 format codecs。 + */ + +import yaml from 'js-yaml' +import type { + ArtifactFormat, + ConfigArtifactValidationResult +} from '@shared/tool-registry' + +const CODEC_MAX_DEPTH = 64 +const CODEC_MAX_NODES = 50_000 + +/** + * 限制 parsed configuration 的深度和节点数,避免 YAML/JSON 结构耗尽资源。 + * @param root parsed configuration value + */ +function assertBoundedStructure(root: unknown): void { + const stack: Array<{ value: unknown; depth: number }> = [{ value: root, depth: 0 }] + const visited = new WeakSet() + let nodes = 0 + while (stack.length > 0) { + const current = stack.pop() + if (!current) break + nodes += 1 + if (nodes > CODEC_MAX_NODES) throw new Error(`配置结构超过 ${CODEC_MAX_NODES} nodes`) + if (current.depth > CODEC_MAX_DEPTH) throw new Error(`配置结构超过 ${CODEC_MAX_DEPTH} levels`) + if (typeof current.value !== 'object' || current.value === null) continue + if (visited.has(current.value)) continue + visited.add(current.value) + for (const value of Object.values(current.value as Record)) { + stack.push({ value, depth: current.depth + 1 }) + } + } +} + +/** + * 移除 JSONC comments,同时保留 string literal 内容与换行位置。 + * @param content JSONC 原始文本 + * @returns 不包含 comments 的 JSON-compatible 文本 + */ +function stripJsonComments(content: string): string { + let output = '' + let inString = false + let escaped = false + let lineComment = false + let blockComment = false + + for (let index = 0; index < content.length; index += 1) { + const character = content[index] + const nextCharacter = content[index + 1] + if (lineComment) { + if (character === '\n' || character === '\r') { + lineComment = false + output += character + } else { + output += ' ' + } + continue + } + if (blockComment) { + if (character === '*' && nextCharacter === '/') { + output += ' ' + blockComment = false + index += 1 + } else { + output += character === '\n' || character === '\r' ? character : ' ' + } + continue + } + if (inString) { + output += character + if (escaped) escaped = false + else if (character === '\\') escaped = true + else if (character === '"') inString = false + continue + } + if (character === '"') { + inString = true + output += character + } else if (character === '/' && nextCharacter === '/') { + lineComment = true + output += ' ' + index += 1 + } else if (character === '/' && nextCharacter === '*') { + blockComment = true + output += ' ' + index += 1 + } else { + output += character + } + } + if (blockComment) throw new Error('JSONC block comment 未闭合') + return output +} + +/** + * 移除 JSONC object/array 尾逗号,不修改 string literal。 + * @param content 已移除 comments 的文本 + * @returns strict JSON 文本 + */ +function stripTrailingCommas(content: string): string { + let output = '' + let inString = false + let escaped = false + for (let index = 0; index < content.length; index += 1) { + const character = content[index] + if (inString) { + output += character + if (escaped) escaped = false + else if (character === '\\') escaped = true + else if (character === '"') inString = false + continue + } + if (character === '"') { + inString = true + output += character + continue + } + if (character === ',') { + let lookahead = index + 1 + while (/\s/.test(content[lookahead] ?? '')) lookahead += 1 + if (content[lookahead] === '}' || content[lookahead] === ']') { + output += ' ' + continue + } + } + output += character + } + return output +} + +/** + * 校验文本不包含 NUL,避免配置编辑链处理 binary data。 + * @param content UTF-8 文本 + */ +function validateText(content: string): void { + if (content.includes('\0')) throw new Error('配置文本不能包含 NUL character') +} + +/** + * 内置配置资产 codec service。 + * @description 远程 registry 只能声明 format,不能注入 parser 或 executable code。 + */ +export class ToolArtifactCodecService { + /** + * 按 format 校验原始配置文本。 + * @param format registry 声明的 UPPERCASE format + * @param content 原始 UTF-8 文本 + * @returns 可序列化 validation 结果 + */ + public validate(format: ArtifactFormat, content: string): ConfigArtifactValidationResult { + try { + validateText(content) + let parsedValue: unknown + if (format === 'JSON') parsedValue = JSON.parse(content) + else if (format === 'JSONC') parsedValue = JSON.parse(stripTrailingCommas(stripJsonComments(content))) + else if (format === 'YAML') parsedValue = yaml.load(content, { schema: yaml.JSON_SCHEMA }) + else if (format === 'TOML') throw new Error('当前版本尚未注册可信 TOML validation codec') + if (parsedValue !== undefined) assertBoundedStructure(parsedValue) + return { valid: true, format, errors: [] } + } catch (error) { + return { + valid: false, + format, + errors: [error instanceof Error ? error.message : String(error)] + } + } + } +} + +/** 默认内置配置资产 codec service */ +export const toolArtifactCodecService = new ToolArtifactCodecService() diff --git a/src/main/services/tool-artifact-discovery-service.ts b/src/main/services/tool-artifact-discovery-service.ts index 72ce15f..1cc2335 100644 --- a/src/main/services/tool-artifact-discovery-service.ts +++ b/src/main/services/tool-artifact-discovery-service.ts @@ -10,7 +10,8 @@ import type { ConfigArtifactDefinition, DiscoveredConfigArtifact, ToolDefinition, - ToolDetectionResult + ToolDetectionResult, + ToolCapability } from '@shared/tool-registry' import { toolRegistryService, type ToolRegistryService } from './tool-registry-service' import { ToolDetectionService } from './tool-detection-service' @@ -26,6 +27,16 @@ export interface ToolArtifactDiscoveryServiceOptions { detectionService?: ToolDetectionService } +/** Registry capability 校验后的 artifact 与绝对路径 */ +export interface AuthorizedToolArtifact { + /** 当前 effective registry 中的工具定义 */ + tool: ToolDefinition + /** 当前 effective registry 中的资产定义 */ + artifact: ConfigArtifactDefinition + /** 与 registry candidate 完全匹配的规范路径 */ + resolvedPath: string +} + /** * 提供规则驱动的工具检测、资产发现和只读加载。 * @description 每次读取都会重新从 effective registry 推导 allowlist,不信任 renderer 提供的路径。 @@ -77,16 +88,12 @@ export class ToolArtifactDiscoveryService { artifactId: string, requestedPath: string ): Promise { - const tool = await this.requireTool(toolId) - const artifact = tool.artifacts.find((candidate) => candidate.artifactId === artifactId) - if (!artifact) throw new Error(`配置资产不存在: ${artifactId}`) - if (!artifact.capabilities.includes('READ')) { - throw new Error(`配置资产未声明 READ capability: ${artifactId}`) - } - - const allowedPaths = this.resolveArtifactPaths(artifact) - const resolvedPath = allowedPaths.find((candidate) => this.pathsEqual(candidate, requestedPath)) - if (!resolvedPath) throw new Error('拒绝读取 registry 未声明的配置路径') + const { artifact, resolvedPath } = await this.authorizeArtifact( + toolId, + artifactId, + requestedPath, + 'READ' + ) await this.assertNoSymbolicLinks(resolvedPath) const fileHandle = await open(resolvedPath, 'r') @@ -121,6 +128,36 @@ export class ToolArtifactDiscoveryService { } } + /** + * 重新从 effective registry 解析并授权 artifact capability。 + * @param toolId stable tool identifier + * @param artifactId stable artifact identifier + * @param requestedPath 调用方选择的绝对路径 + * @param capability 本次操作要求的 capability + * @returns registry 授权后的 artifact 与规范路径 + */ + public async authorizeArtifact( + toolId: string, + artifactId: string, + requestedPath: string, + capability: ToolCapability + ): Promise { + const tool = await this.requireTool(toolId) + if (!tool.platforms.includes(this.detectionService.getPlatform())) { + throw new Error(`工具不支持当前平台: ${toolId}`) + } + const artifact = tool.artifacts.find((candidate) => candidate.artifactId === artifactId) + if (!artifact) throw new Error(`配置资产不存在: ${artifactId}`) + if (!artifact.capabilities.includes(capability)) { + throw new Error(`配置资产未声明 ${capability} capability: ${artifactId}`) + } + const resolvedPath = this.resolveArtifactPaths(artifact) + .find((candidate) => this.pathsEqual(candidate, requestedPath)) + if (!resolvedPath) throw new Error('拒绝访问 registry 未声明的配置路径') + await this.assertNoSymbolicLinks(resolvedPath) + return { tool, artifact, resolvedPath } + } + /** * 获取 registry 中的工具定义。 * @param toolId stable tool identifier diff --git a/src/main/services/tool-artifact-management-service.ts b/src/main/services/tool-artifact-management-service.ts new file mode 100644 index 0000000..1e4abcd --- /dev/null +++ b/src/main/services/tool-artifact-management-service.ts @@ -0,0 +1,272 @@ +/** + * @file src/main/services/tool-artifact-management-service.ts + * @description 以 registry capabilities 驱动配置资产 validation、atomic edit、backup 与 restore。 + */ + +import { randomUUID } from 'crypto' +import { constants as fsConstants } from 'fs' +import { copyFile, lstat, mkdir, open, readFile, rename, rm, stat } from 'fs/promises' +import path from 'path' +import type { + ConfigArtifactBackup, + ConfigArtifactContent, + ConfigArtifactValidationResult +} from '@shared/tool-registry' +import { + CONFIG_ARTIFACT_MAX_BYTES, + toolArtifactDiscoveryService, + type ToolArtifactDiscoveryService +} from './tool-artifact-discovery-service' +import { + toolArtifactCodecService, + type ToolArtifactCodecService +} from './tool-artifact-codec-service' +import { pathManager } from '../utils/path-manager' + +/** 持久化 backup metadata */ +interface StoredArtifactBackup extends ConfigArtifactBackup { + /** 受控 backup directory 内的内容文件名 */ + contentFileName: string +} + +const BACKUP_METADATA_MAX_BYTES = 16 * 1024 + +/** Artifact management service 可替换依赖 */ +export interface ToolArtifactManagementServiceOptions { + /** Registry authorization 与 read service */ + discoveryService?: ToolArtifactDiscoveryService + /** 内置 format codec service */ + codecService?: ToolArtifactCodecService + /** 受控 backup directory */ + backupDirectory?: string +} + +/** + * 通用配置资产管理 service。 + * @description 所有写操作都要求 registry capability,并在目标旁使用随机 temp file 原子替换。 + */ +export class ToolArtifactManagementService { + private readonly discoveryService: ToolArtifactDiscoveryService + private readonly codecService: ToolArtifactCodecService + private readonly backupDirectory: string + + /** + * 创建通用 artifact management service。 + * @param options 可替换依赖与 backup directory + */ + constructor(options: ToolArtifactManagementServiceOptions = {}) { + this.discoveryService = options.discoveryService ?? toolArtifactDiscoveryService + this.codecService = options.codecService ?? toolArtifactCodecService + this.backupDirectory = options.backupDirectory ?? pathManager.toolArtifactBackupDir + } + + /** + * 按 registry format 验证配置文本。 + * @param toolId stable tool identifier + * @param artifactId stable artifact identifier + * @param requestedPath registry candidate path + * @param content 待验证文本 + * @returns codec validation 结果 + */ + public async validateArtifact( + toolId: string, + artifactId: string, + requestedPath: string, + content: string + ): Promise { + this.assertContentSize(content) + const { artifact } = await this.discoveryService.authorizeArtifact( + toolId, + artifactId, + requestedPath, + 'VALIDATE' + ) + return this.codecService.validate(artifact.format, content) + } + + /** + * 校验并原子更新 registry 授权的配置文件。 + * @param toolId stable tool identifier + * @param artifactId stable artifact identifier + * @param requestedPath registry candidate path + * @param content 新 UTF-8 文本 + * @returns 更新后的只读 artifact snapshot + */ + public async editArtifact( + toolId: string, + artifactId: string, + requestedPath: string, + content: string + ): Promise { + this.assertContentSize(content) + const authorization = await this.discoveryService.authorizeArtifact( + toolId, + artifactId, + requestedPath, + 'EDIT' + ) + if (authorization.artifact.capabilities.includes('VALIDATE')) { + const validation = this.codecService.validate(authorization.artifact.format, content) + if (!validation.valid) throw new Error(`配置校验失败: ${validation.errors.join('; ')}`) + } + if (authorization.artifact.capabilities.includes('BACKUP')) { + await this.createBackup(toolId, artifactId, authorization.resolvedPath) + } + await this.writeTextAtomic(authorization.resolvedPath, content) + return this.discoveryService.readArtifact(toolId, artifactId, authorization.resolvedPath) + } + + /** + * 创建 registry 授权的配置资产备份。 + * @param toolId stable tool identifier + * @param artifactId stable artifact identifier + * @param requestedPath registry candidate path + * @returns backup metadata + */ + public async createBackup( + toolId: string, + artifactId: string, + requestedPath: string + ): Promise { + const { resolvedPath } = await this.discoveryService.authorizeArtifact( + toolId, + artifactId, + requestedPath, + 'BACKUP' + ) + const sourceMetadata = await stat(resolvedPath) + if (!sourceMetadata.isFile() || sourceMetadata.size > CONFIG_ARTIFACT_MAX_BYTES) { + throw new Error('备份源不是允许大小的普通文件') + } + await mkdir(this.backupDirectory, { recursive: true }) + const backupId = randomUUID() + const contentFileName = `${backupId}.backup` + const contentPath = path.join(this.backupDirectory, contentFileName) + const metadataPath = path.join(this.backupDirectory, `${backupId}.json`) + const backup: StoredArtifactBackup = { + backupId, + toolId, + artifactId, + originalPath: resolvedPath, + size: sourceMetadata.size, + createdAt: new Date().toISOString(), + contentFileName + } + await copyFile(resolvedPath, contentPath, fsConstants.COPYFILE_EXCL) + try { + await this.writeTextAtomic(metadataPath, JSON.stringify(backup, null, 2)) + } catch (error) { + await rm(contentPath, { force: true }) + throw error + } + return this.toPublicBackup(backup) + } + + /** + * 从受控 metadata 恢复 registry 仍授权的备份。 + * @param backupId UUID backup identifier + * @returns 恢复后的 artifact snapshot + */ + public async restoreBackup(backupId: string): Promise { + if (!/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(backupId)) { + throw new Error('backupId 格式无效') + } + const metadataPath = path.join(this.backupDirectory, `${backupId}.json`) + const metadataFile = await lstat(metadataPath) + if (metadataFile.isSymbolicLink() || !metadataFile.isFile() || metadataFile.size > BACKUP_METADATA_MAX_BYTES) { + throw new Error('备份 metadata 不是允许大小的普通文件') + } + const backup = JSON.parse(await readFile(metadataPath, 'utf8')) as StoredArtifactBackup + if ( + backup.backupId !== backupId + || backup.contentFileName !== `${backupId}.backup` + || typeof backup.originalPath !== 'string' + ) { + throw new Error('备份 metadata 无效') + } + const authorization = await this.discoveryService.authorizeArtifact( + backup.toolId, + backup.artifactId, + backup.originalPath, + 'RESTORE' + ) + const contentPath = path.join(this.backupDirectory, backup.contentFileName) + const backupMetadata = await lstat(contentPath) + if ( + backupMetadata.isSymbolicLink() + || !backupMetadata.isFile() + || backupMetadata.size > CONFIG_ARTIFACT_MAX_BYTES + ) { + throw new Error('备份内容不是允许大小的普通文件') + } + const contentBuffer = await readFile(contentPath) + let content: string + try { + content = new TextDecoder('utf-8', { fatal: true }).decode(contentBuffer) + } catch { + throw new Error('备份内容不是有效的 UTF-8 文本') + } + if (authorization.artifact.capabilities.includes('VALIDATE')) { + const validation = this.codecService.validate(authorization.artifact.format, content) + if (!validation.valid) throw new Error(`备份配置校验失败: ${validation.errors.join('; ')}`) + } + await this.writeTextAtomic(authorization.resolvedPath, content) + return this.discoveryService.readArtifact( + backup.toolId, + backup.artifactId, + authorization.resolvedPath + ) + } + + /** + * 限制 renderer 提交的 UTF-8 内容大小。 + * @param content 配置文本 + */ + private assertContentSize(content: string): void { + if (typeof content !== 'string') throw new Error('配置内容必须是 string') + if (Buffer.byteLength(content, 'utf8') > CONFIG_ARTIFACT_MAX_BYTES) { + throw new Error(`配置内容超过限制: ${CONFIG_ARTIFACT_MAX_BYTES} bytes`) + } + } + + /** + * 在目标目录内写入随机 temp file 并原子替换。 + * @param targetPath 目标绝对路径 + * @param content UTF-8 文本 + */ + private async writeTextAtomic(targetPath: string, content: string): Promise { + const tempPath = path.join(path.dirname(targetPath), `.${path.basename(targetPath)}.${randomUUID()}.tmp`) + const fileHandle = await open(tempPath, 'wx') + try { + await fileHandle.writeFile(content, 'utf8') + await fileHandle.sync() + } finally { + await fileHandle.close() + } + try { + await rename(tempPath, targetPath) + } catch (error) { + await rm(tempPath, { force: true }) + throw error + } + } + + /** + * 移除内部 backup content filename。 + * @param backup 持久化 metadata + * @returns renderer-safe backup metadata + */ + private toPublicBackup(backup: StoredArtifactBackup): ConfigArtifactBackup { + return { + backupId: backup.backupId, + toolId: backup.toolId, + artifactId: backup.artifactId, + originalPath: backup.originalPath, + size: backup.size, + createdAt: backup.createdAt + } + } +} + +/** 默认通用 artifact management service */ +export const toolArtifactManagementService = new ToolArtifactManagementService() diff --git a/src/main/utils/path-manager.ts b/src/main/utils/path-manager.ts index eace2bd..7bc3751 100644 --- a/src/main/utils/path-manager.ts +++ b/src/main/utils/path-manager.ts @@ -35,6 +35,7 @@ export const pathManager = { cacheDir: path.join(APP_DATA_BASE_DIR, PATH_CONSTANTS.CACHE_DIR), configDir: path.join(APP_DATA_BASE_DIR, PATH_CONSTANTS.CONFIG_DIR), registryDir: path.join(APP_DATA_BASE_DIR, 'registry'), + toolArtifactBackupDir: path.join(APP_DATA_BASE_DIR, 'backups', 'tool-artifacts'), // Claude 配置目录 (用户目录/.ccb/claude-configs) claudeConfigsDir: CLAUDE_CONFIGS_DIR, diff --git a/src/preload/index.ts b/src/preload/index.ts index 33a1b22..f66643b 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -47,6 +47,8 @@ import type { } from '@shared/types/terminal' import type { ConfigArtifactContent, + ConfigArtifactBackup, + ConfigArtifactValidationResult, DiscoveredConfigArtifact, ToolDefinition, ToolDetectionResult, @@ -236,6 +238,30 @@ interface ToolRegistryAPI { data?: ConfigArtifactContent error?: string }> + /** 使用 registry format codec 校验配置 */ + validateArtifact: (toolId: string, artifactId: string, path: string, content: string) => Promise<{ + success: boolean + data?: ConfigArtifactValidationResult + error?: string + }> + /** 校验并原子更新 registry 授权配置 */ + editArtifact: (toolId: string, artifactId: string, path: string, content: string) => Promise<{ + success: boolean + data?: ConfigArtifactContent + error?: string + }> + /** 创建 registry 授权配置备份 */ + createArtifactBackup: (toolId: string, artifactId: string, path: string) => Promise<{ + success: boolean + data?: ConfigArtifactBackup + error?: string + }> + /** 恢复受控 backup identifier */ + restoreArtifactBackup: (backupId: string) => Promise<{ + success: boolean + data?: ConfigArtifactContent + error?: string + }> /** 获取当前 update 状态 */ getUpdateStatus: () => Promise<{ success: boolean; data?: ToolRegistryUpdateStatus; error?: string }> /** 只检查 manifest,不下载 bundle */ @@ -823,6 +849,14 @@ const toolRegistryAPI: ToolRegistryAPI = { discoverArtifacts: (toolId: string) => ipcRenderer.invoke('toolRegistry:discoverArtifacts', toolId), readArtifact: (toolId: string, artifactId: string, path: string) => ipcRenderer.invoke('toolRegistry:readArtifact', toolId, artifactId, path), + validateArtifact: (toolId: string, artifactId: string, path: string, content: string) => + ipcRenderer.invoke('toolRegistry:validateArtifact', toolId, artifactId, path, content), + editArtifact: (toolId: string, artifactId: string, path: string, content: string) => + ipcRenderer.invoke('toolRegistry:editArtifact', toolId, artifactId, path, content), + createArtifactBackup: (toolId: string, artifactId: string, path: string) => + ipcRenderer.invoke('toolRegistry:createArtifactBackup', toolId, artifactId, path), + restoreArtifactBackup: (backupId: string) => + ipcRenderer.invoke('toolRegistry:restoreArtifactBackup', backupId), getUpdateStatus: () => ipcRenderer.invoke('toolRegistry:getUpdateStatus'), checkForUpdates: () => ipcRenderer.invoke('toolRegistry:checkForUpdates'), installAvailableUpdate: () => ipcRenderer.invoke('toolRegistry:installAvailableUpdate'), diff --git a/src/renderer/index.html b/src/renderer/index.html index a3de109..6270553 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -4,7 +4,7 @@ - CCB - Claude Code Butler + CCB - Coding Context Butler