🤖 Open-source, local-first alternative to Grok Bot, OpenAI dots and Claude Duet. Your own AI bots on any model: GPT, Claude, Gemini, Grok, DeepSeek, Kimi, GLM and 70+ more through one Modelflare key. Reach them in the app, WeChat or Feishu; they remember you, work in the background, run commands and use your computer. Pay per use.
Python ai-agentai-assistantchatbotclaudecomputer-usedeepseekdesktop-appdshelectronfeishugeminigptgrokllmlocal-firstmodelflaremulti-modelopenai-compatiblepersonal-ai-agentwechat
anymodel bot P1: runtime, Feishu/WeChat channels, bundled magpie, UI, Electron desktop, Docker
Marla21a297d49eb9
diff --git a/.dockerignore b/.dockerignorenew file mode 100644index 0000000..9fc3ff4--- /dev/null+++ b/.dockerignore@@ -0,0 +1,10 @@+node_modules+dist+build+release+data+.env+*.log+.git+vendor/deepseek-harness+vendor/magpie/.gitdiff --git a/.env.example b/.env.examplenew file mode 100644index 0000000..b6f6165--- /dev/null+++ b/.env.example@@ -0,0 +1,32 @@+# anymodel bot 环境变量(全部可选;环境变量优先于 <数据目录>/config.json)+# 复制为 .env 后由你的进程管理器/`docker run --env-file` 加载(程序本身不自动读取 .env)++# 数据目录(SQLite、magpie 隔离配置、微信登录态)。默认 ./data;桌面版默认 <userData>/data+# AMB_DATA_DIR=./data++# 管理界面。非回环地址(如 0.0.0.0)会强制令牌访问,令牌见 <数据目录>/ui-token+# AMB_UI_HOST=127.0.0.1+# AMB_UI_PORT=3600+# AMB_UI_TOKEN=++# 内置 magpie 可执行文件(默认自动查找 build/bin 或桌面版 resources/magpie)+# AMB_MAGPIE_BIN=+# 改用外部 OpenAI 兼容端点(设置后不启动内置 magpie,“模型”页不可用)+# AMB_MAGPIE_BASE_URL=http://127.0.0.1:8080/v1+# AMB_MAGPIE_API_KEY=++# 对话+# AMB_DEFAULT_MODEL=deepseek/deepseek-chat+# AMB_CONTEXT_MESSAGES=40+# AMB_CONTEXT_CHARS=24000++# 飞书(仅首次创建默认机器人时读取;之后在界面「渠道」页修改)+# FEISHU_APP_ID=cli_xxx+# FEISHU_APP_SECRET=+# AMB_FEISHU_THROTTLE_MS=400++# 微信 iLink 接口地址(一般不用改)+# AMB_WEIXIN_API_BASE=https://ilinkai.weixin.qq.com++# 日志级别 debug|info|warn|error+# AMB_LOG_LEVEL=infodiff --git a/.gitignore b/.gitignorenew file mode 100644index 0000000..59875ca--- /dev/null+++ b/.gitignore@@ -0,0 +1,8 @@+node_modules/+dist/+build/+release/+data/+.env+*.log+test-results/diff --git a/.gitmodules b/.gitmodulesnew file mode 100644index 0000000..c0a74c7--- /dev/null+++ b/.gitmodules@@ -0,0 +1,8 @@+[submodule "vendor/magpie"]+ path = vendor/magpie+ url = https://github.com/yetone/magpie+ shallow = true+[submodule "vendor/deepseek-harness"]+ path = vendor/deepseek-harness+ url = https://github.com/deepseek-ai/deepseek-harness+ shallow = truediff --git a/Dockerfile b/Dockerfilenew file mode 100644index 0000000..03d9ac9--- /dev/null+++ b/Dockerfile@@ -0,0 +1,44 @@+# anymodel bot:一个镜像同时包含机器人运行时 + 内置 magpie 模型网关+# 构建前需检出子模块:git submodule update --init --depth 1 vendor/magpie+# docker build -t anymodel-bot .+# docker run -d --name amb -p 3600:3600 -v amb-data:/data anymodel-bot+# docker exec amb cat /data/ui-token # 首次打开 http://<主机>:3600/?token=<令牌>++# ---- magpie(纯 Go、无 GUI、CGO 关闭)----+FROM golang:1.27-bookworm AS magpie+WORKDIR /src+COPY vendor/magpie/ ./+ARG MAGPIE_VERSION=v0.1.1720+RUN CGO_ENABLED=0 go build -tags nogui -trimpath -ldflags "-s -w -X main.version=${MAGPIE_VERSION}" -o /out/magpie .++# ---- TypeScript 编译 ----+FROM node:22-bookworm-slim AS build+WORKDIR /app+ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1+COPY package.json package-lock.json ./+RUN npm ci --ignore-scripts+COPY tsconfig.json tsconfig.build.json ./+COPY src ./src+COPY electron ./electron+RUN npx tsc -p tsconfig.build.json++# ---- 运行时 ----+FROM node:22-bookworm-slim+WORKDIR /app+ENV NODE_ENV=production \+ AMB_DATA_DIR=/data \+ AMB_UI_HOST=0.0.0.0 \+ AMB_UI_PORT=3600 \+ AMB_MAGPIE_BIN=/app/bin/magpie+COPY package.json package-lock.json ./+RUN npm ci --omit=dev --ignore-scripts && npm cache clean --force+COPY --from=build /app/dist ./dist+COPY ui ./ui+COPY assets ./assets+COPY --from=magpie /out/magpie ./bin/magpie+COPY LICENSE THIRD_PARTY_NOTICES.md ./+RUN mkdir -p /data && chown node:node /data+USER node+VOLUME ["/data"]+EXPOSE 3600+CMD ["node", "dist/src/main.js"]diff --git a/LICENSE b/LICENSEnew file mode 100644index 0000000..be223df--- /dev/null+++ b/LICENSE@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2026 anymodel bot contributors++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.diff --git a/README.md b/README.mdnew file mode 100644index 0000000..a01c09e--- /dev/null+++ b/README.md@@ -0,0 +1,106 @@+# anymodel bot++任意模型的个人 AI 助手:一个机器人 = 人设 + 默认模型 + 渠道(飞书 / 微信)。+模型调用全部经过**内置的 [magpie](https://github.com/yetone/magpie) 模型网关**(OpenAI 兼容 `/v1`),在管理界面里加服务商、切模型、看用量。++- 飞书:官方机器人,长连接(WSClient)接收事件,CardKit 流式卡片回复+- 微信:官方 iLink 通道(移植自 Tencent/openclaw-weixin),扫码登录+- 三种运行方式,同一套代码:**桌面版(Electron)**、**命令行 `npm start`**、**Docker**++> 定位:自用、单用户。每个机器人对应一个飞书应用。++## 目录++```+src/+ core/ 统一消息类型、会话队列与去重、运行时(/model /reset、流式)+ llm/ OpenAI 兼容客户端(模型接入接口)+ magpie/ 内置 magpie 守护:隔离目录、空闲端口、自动生成密钥、健康检查、崩溃重启、干净退出+ channels/ feishu/(长连接 + CardKit) weixin/(iLink,MIT 声明见 LICENSE.openclaw-weixin)+ store/ SQLite(node:sqlite,无需原生编译)+ web/ 管理界面服务 + /magpie/ 反向代理+ cli/ init 首次设置向导、weixin-login+ main.ts 命令行入口+electron/ 桌面版主进程(启动器 + 托盘)+ui/ 管理界面(Preact + htm,无构建步骤)+scripts/ setup / build-magpie / electron-smoke+vendor/magpie magpie 源码(git 子模块,构建时编译)+```++## 快速开始(命令行)++需要 Node.js 22.13+、Go 1.26.8+(用于从源码编译 magpie)。++```bash+npm install+npm run setup # 拉取 vendor/magpie 子模块并编译到 build/bin/+npm run init # 可选:首次设置向导(模型服务商 Key、飞书凭据)+npm start # 启动全部:magpie + 机器人 + 管理界面 http://127.0.0.1:3600/+```++数据默认在 `./data`(`AMB_DATA_DIR` 可改)。其余环境变量见 `.env.example`。++## 桌面版(Electron)++```bash+npm run electron:dev # 开发运行+npm run electron:smoke # 冒烟测试(Linux 无显示器时自动用 xvfb-run)+npm run dist # 打包当前平台(magpie 随附在 resources/magpie/)+npm run dist:linux | dist:mac | dist:win+```++- 数据目录:`<userData>/data`(macOS `~/Library/Application Support/anymodel bot/data`,Windows `%APPDATA%\anymodel bot\data`,Linux `~/.config/anymodel bot/data`)+- 单实例;关闭窗口隐藏到托盘;托盘菜单:打开 / 在浏览器中打开 / 开机自启(macOS、Windows)/ 打开数据目录 / 退出+- 界面只监听 127.0.0.1,且每次启动生成随机访问令牌,其他本机程序无法直接调用管理接口+- 退出时先停渠道、再停 magpie;若上次被强杀残留 magpie 进程,下次启动会自动清理(Linux/macOS)++**签名与发布(需你本人完成)**:macOS 需 Apple Developer ID 证书 + 公证(`CSC_LINK`/`CSC_KEY_PASSWORD`、`APPLE_ID`/`APPLE_APP_SPECIFIC_PASSWORD`/`APPLE_TEAM_ID`),内置的 magpie 二进制也会被一并签名(hardened runtime);Windows 建议 Authenticode 证书,否则 SmartScreen 会拦截。自动更新(electron-updater)需要发布地址与签名,暂未启用。++## Docker++```bash+git submodule update --init --depth 1 vendor/magpie+docker build -t anymodel-bot .+docker run -d --name amb -p 3600:3600 -v amb-data:/data anymodel-bot+docker exec amb cat /data/ui-token # 打开 http://<主机>:3600/?token=<令牌>+```++容器内界面监听 0.0.0.0,因此强制令牌访问。微信扫码在界面「渠道」页完成。++## 模型(内置 magpie)++- 管理界面「概览」可快速添加预设服务商(DeepSeek、OpenAI、Anthropic、Kimi、通义等);「模型」页内嵌 magpie 完整界面(自定义端点、路由、用量)。+- 对话中发送 `/model` 查看可用模型,`/model <名称>` 为当前会话切换模型;`/reset` 清空上下文。+- 隔离与安全:magpie 使用本程序数据目录内独立的 HOME/配置目录;**不读取**你电脑上已有的 Claude/Codex 等订阅凭据,**不改写**任何 agent 配置,关闭自动更新与账户发现;界面代理还会拦截 magpie 的 agent 接入、账户、更新等接口。+- API Key 只保存在 magpie 的隔离配置中,不经过命令行参数、不写日志。++## 飞书应用配置++1. 打开 [飞书开放平台](https://open.feishu.cn/app) → 创建企业自建应用,添加「机器人」能力。+2. 权限管理开通:+ - `im:message.p2p_msg:readonly`(读取用户发给机器人的单聊消息)+ - `im:message:send_as_bot`(以应用身份发消息)+ - `cardkit:card:write`(创建与更新卡片,用于流式回复)+3. 先在本程序界面「渠道」页填入 App ID / App Secret 并启用(长连接需要程序在线才能保存下一步)。+4. 事件与回调 → 订阅方式选「**使用长连接接收事件**」,添加事件 `im.message.receive_v1`。+5. 发布版本并在可用范围内添加自己,然后在飞书里私聊机器人。++说明:当前只处理单聊(p2p),群聊消息会被忽略。++## 微信(iLink)++- 界面「渠道」页 → 微信 → 「扫码登录」,用微信扫描二维码并确认;或命令行 `npm run weixin:login`(终端显示二维码,同时保存 PNG 到数据目录)。+- 登录态、同步游标、context_token 保存在数据目录,重启后自动续用。+- 平台限制:用户每发来一条消息后 24 小时内最多可回复 10 条;回复在生成结束后一次发出,超过 4000 字自动分段;生成期间显示“正在输入”。+- 登录过期(错误码 -14)时自动暂停并在界面提示,重新扫码即可。++## 开发与测试++```bash+npm run typecheck+npm test # 单元测试 + 离线端到端(模拟飞书/iLink/OpenAI)+ magpie 集成测试(需已编译 magpie)+```++## 许可++MIT,见 `LICENSE`;第三方组件(magpie MIT、Tencent openclaw-weixin MIT 等)见 `THIRD_PARTY_NOTICES.md`。diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.mdnew file mode 100644index 0000000..3d15bd1--- /dev/null+++ b/THIRD_PARTY_NOTICES.md@@ -0,0 +1,77 @@+# 第三方声明 / Third-Party Notices++anymodel bot 自身以 MIT 许可发布(见 LICENSE)。以下组件随本程序分发或被移植,各自保留原许可。++未复制 Fei2411/DS-Bot 的任何代码(仅参考思路);如将来复制,须在此添加其 Apache-2.0 声明。++## magpie(内置模型网关,以二进制形式随附)++来源:https://github.com/yetone/magpie (vendor/magpie 子模块,v0.1.1720)++```+MIT License++Copyright (c) 2026 yetone++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.+```++## openclaw-weixin(微信 iLink 通道,src/channels/weixin 中的部分代码移植自此项目)++来源:https://github.com/Tencent/openclaw-weixin++```+Tencent is pleased to support the open source community by making openclaw-weixin available.++Copyright (C) 2026 Tencent. All rights reserved.++openclaw-weixin is licensed under the MIT.+++Terms of the MIT:+--------------------------------------------------------------------+Permission is hereby granted, free of charge, to any person obtaining+a copy of this software and associated documentation files (the+"Software"), to deal in the Software without restriction, including+without limitation the rights to use, copy, modify, merge, publish,+distribute, sublicense, and/or sell copies of the Software, and to+permit persons to whom the Software is furnished to do so, subject to+the following conditions:++The above copyright notice and this permission notice shall be+included in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.+```++## npm 依赖(运行时)++- @larksuiteoapi/node-sdk 1.76.0 — MIT+- preact 11.0.2 — MIT+- htm 3.1.1 — Apache-2.0+- qrcode 1.5.4 — MIT+- qrcode-terminal 0.12.0 — Apache-2.0(见包内 LICENSE)++传递依赖的许可证随各自包保存在 node_modules 中。桌面版另含 Electron(MIT)及 Chromium 等组件,其许可证位于安装目录的 LICENSE 与 LICENSES.chromium.html。diff --git a/assets/icon.png b/assets/icon.pngnew file mode 100644index 0000000..b5321c9Binary files /dev/null and b/assets/icon.png differdiff --git a/electron/main.ts b/electron/main.tsnew file mode 100644index 0000000..37eed2a--- /dev/null+++ b/electron/main.ts@@ -0,0 +1,172 @@+/**+ * Electron 桌面版主进程 = 启动器:+ * - 单实例锁;数据目录 = <userData>/data(可用 AMB_DATA_DIR 覆盖)+ * - 在进程内启动 App(机器人运行时 + 渠道 + 管理界面 + 受管 magpie 子进程)+ * - 窗口加载本机管理界面(每次启动生成随机令牌,其他本机程序/浏览器无法直接访问)+ * - 托盘:显示 / 开机自启 / 退出;关闭窗口=隐藏到托盘;退出时干净关闭 magpie+ * CLI(npm start)与 Docker 走同一套 src/ 代码,本文件只做桌面外壳。+ */+import { app, BrowserWindow, Menu, Tray, nativeImage, shell, dialog } from "electron";+import crypto from "node:crypto";+import fs from "node:fs";+import path from "node:path";+import { fileURLToPath } from "node:url";+import { loadConfig } from "../src/config.js";+import { App } from "../src/app.js";+import { findAppRoot } from "../src/magpie/supervisor.js";+import { logger } from "../src/log.js";++const log = logger("desktop");+const SMOKE = process.env.AMB_ELECTRON_SMOKE; // 冒烟测试:截图到该路径后退出++let core: App | undefined;+let win: BrowserWindow | undefined;+let tray: Tray | undefined;+let entryUrl = "";+let quitting = false;+let stopped = false;++function iconPath(): string {+ const root = findAppRoot(path.dirname(fileURLToPath(import.meta.url)));+ return path.join(root, "assets", "icon.png");+}++function showWindow(): void {+ if (!win) return createWindow();+ if (win.isMinimized()) win.restore();+ win.show();+ win.focus();+}++function createWindow(): void {+ win = new BrowserWindow({+ width: 1200,+ height: 820,+ minWidth: 760,+ minHeight: 520,+ title: "anymodel bot",+ icon: iconPath(),+ show: !SMOKE,+ autoHideMenuBar: true,+ webPreferences: { contextIsolation: true, nodeIntegration: false, sandbox: true },+ });+ const origin = new URL(entryUrl).origin;+ // 只允许停留在本机管理界面;外部链接交给系统浏览器+ win.webContents.setWindowOpenHandler(({ url }) => {+ if (/^https?:/i.test(url)) void shell.openExternal(url);+ return { action: "deny" };+ });+ win.webContents.on("will-navigate", (e, url) => {+ if (new URL(url).origin !== origin) {+ e.preventDefault();+ if (/^https?:/i.test(url)) void shell.openExternal(url);+ }+ });+ win.on("close", (e) => {+ if (!quitting && tray) {+ e.preventDefault();+ win?.hide();+ }+ });+ win.on("closed", () => (win = undefined));+ void win.loadURL(entryUrl);+}++function buildTray(): void {+ const img = nativeImage.createFromPath(iconPath()).resize({ width: 18, height: 18 });+ tray = new Tray(img);+ tray.setToolTip("anymodel bot");+ const canAutostart = process.platform === "darwin" || process.platform === "win32";+ const render = () =>+ tray!.setContextMenu(+ Menu.buildFromTemplate([+ { label: "打开 anymodel bot", click: showWindow },+ { label: "在浏览器中打开", click: () => void shell.openExternal(entryUrl) },+ { type: "separator" },+ {+ label: "开机自启",+ type: "checkbox",+ enabled: canAutostart,+ checked: canAutostart && app.getLoginItemSettings().openAtLogin,+ click: (item) => {+ app.setLoginItemSettings({ openAtLogin: item.checked, args: ["--hidden"] });+ render();+ },+ },+ { label: "打开数据目录", click: () => void shell.openPath(core!.config.dataDir) },+ { type: "separator" },+ { label: "退出", click: () => app.quit() },+ ]),+ );+ render();+ tray.on("click", showWindow);+}++async function boot(): Promise<void> {+ const dataDir = process.env.AMB_DATA_DIR ? path.resolve(process.env.AMB_DATA_DIR) : path.join(app.getPath("userData"), "data");+ fs.mkdirSync(dataDir, { recursive: true });+ const config = loadConfig({ dataDir });+ // 桌面版:仅回环 + 每次启动随机令牌;端口沿用配置(默认 3600,被占用时自动换随机端口)+ config.ui.host = "127.0.0.1";+ if (!config.ui.token) config.ui.token = crypto.randomBytes(24).toString("base64url");+ core = new App(config);+ await core.start();+ if (!core.web) throw new Error("管理界面未启动");+ entryUrl = `${core.web.url.replace(/\/$/, "")}/?token=${encodeURIComponent(config.ui.token)}`;+ log.info(`数据目录:${dataDir}`);+ log.info(`管理界面:${core.web.url}`);+ if (!SMOKE) buildTray();+ const atLogin = process.argv.includes("--hidden") || (process.platform === "darwin" && app.getLoginItemSettings().wasOpenedAtLogin);+ if (!atLogin || SMOKE) createWindow();+ if (SMOKE) await smoke(SMOKE);+}++async function smoke(out: string): Promise<void> {+ const wc = win!.webContents;+ await new Promise<void>((r) => (wc.isLoading() ? wc.once("did-finish-load", () => r()) : r()));+ let text = "";+ for (let i = 0; i < 50; i++) {+ text = String(await wc.executeJavaScript("document.body.innerText"));+ if (text.includes("概览") && text.length > 40) break;+ await new Promise((r) => setTimeout(r, 200));+ }+ const img = await wc.capturePage();+ fs.writeFileSync(out, img.toPNG());+ const status = await wc.executeJavaScript("fetch('/amb/api/status').then(r=>r.status)");+ const magpie = await wc.executeJavaScript("fetch('/magpie/').then(r=>r.status)");+ console.log(`SMOKE ${JSON.stringify({ hasUi: text.includes("概览"), status, magpie, magpieState: core?.magpie?.state, chars: text.length })}`);+ app.quit();+}++if (!app.requestSingleInstanceLock()) {+ app.quit();+} else {+ app.on("second-instance", () => showWindow());+ for (const sig of ["SIGINT", "SIGTERM"] as const) process.on(sig, () => app.quit());+ app.on("window-all-closed", () => {+ if (!tray) app.quit(); // 有托盘时常驻+ });+ app.on("activate", () => entryUrl && showWindow());+ app.on("before-quit", (e) => {+ quitting = true;+ if (stopped || !core) return;+ e.preventDefault();+ const force = setTimeout(() => app.exit(1), 10_000);+ core+ .stop()+ .catch((err) => log.error(`退出时出错:${(err as Error).message}`))+ .finally(() => {+ clearTimeout(force);+ stopped = true;+ app.quit();+ });+ });+ app+ .whenReady()+ .then(boot)+ .catch((e) => {+ log.error((e as Error).stack || String(e));+ dialog.showErrorBox("anymodel bot 启动失败", (e as Error).message);+ app.exit(1);+ });+}diff --git a/package-lock.json b/package-lock.jsonnew file mode 100644index 0000000..4367cc6--- /dev/null+++ b/package-lock.json@@ -0,0 +1,6098 @@+{+ "name": "anymodel-bot",+ "version": "0.1.0",+ "lockfileVersion": 3,+ "requires": true,+ "packages": {+ "": {+ "name": "anymodel-bot",+ "version": "0.1.0",+ "license": "MIT",+ "dependencies": {+ "@larksuiteoapi/node-sdk": "1.76.0",+ "htm": "^3.1.1",+ "preact": "^11.0.2",+ "qrcode": "^1.5.4",+ "qrcode-terminal": "^0.12.0"+ },+ "devDependencies": {+ "@types/node": "^22.20.5",+ "@types/qrcode": "^1.5.6",+ "@types/qrcode-terminal": "^0.12.2",+ "electron": "^45.0.0",+ "electron-builder": "^26.18.0",+ "tsx": "^4.23.15",+ "typescript": "^7.0.2",+ "vitest": "^5.0.5"+ },+ "engines": {+ "node": ">=22.13"+ }+ },+ "node_modules/@electron-internal/extract-zip": {+ "version": "1.0.6",+ "resolved": "https://registry.npmjs.org/@electron-internal/extract-zip/-/extract-zip-1.0.6.tgz",+ "integrity": "sha512-/aQLgFDdCSnwChfUwqekSmE1q2dCTzhUy5saIHBb5vyYn5LzWaKPaIz1wM0lDMCZYBoIG4svJNvAJb6vkI8BuA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=22.12.0"+ }+ },+ "node_modules/@electron/asar": {+ "version": "3.4.1",+ "resolved": "https://registry.npmjs.org/@electron/asar/-/asar-3.4.1.tgz",+ "integrity": "sha512-i4/rNPRS84t0vSRa2HorerGRXWyF4vThfHesw0dmcWHp+cspK743UanA0suA5Q5y8kzY2y6YKrvbIUn69BCAiA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "commander": "^5.0.0",+ "glob": "^7.1.6",+ "minimatch": "^3.0.4"+ },+ "bin": {+ "asar": "bin/asar.js"+ },+ "engines": {+ "node": ">=10.12.0"+ }+ },+ "node_modules/@electron/asar/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": "MIT"+ },+ "node_modules/@electron/asar/node_modules/brace-expansion": {+ "version": "1.1.21",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.21.tgz",+ "integrity": "sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==",+ "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.5",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",+ "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "brace-expansion": "^1.1.7"+ },+ "engines": {+ "node": "*"+ }+ },+ "node_modules/@electron/fuses": {+ "version": "1.8.0",+ "resolved": "https://registry.npmjs.org/@electron/fuses/-/fuses-1.8.0.tgz",+ "integrity": "sha512-zx0EIq78WlY/lBb1uXlziZmDZI4ubcCXIMJ4uGjXzZW0nS19TjSPeXPAjzzTmKQlJUZm0SbmZhPKP7tuQ1SsEw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "chalk": "^4.1.1",+ "fs-extra": "^9.0.1",+ "minimist": "^1.2.5"+ },+ "bin": {+ "electron-fuses": "dist/bin.js"+ }+ },+ "node_modules/@electron/fuses/node_modules/fs-extra": {+ "version": "9.1.0",+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",+ "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "at-least-node": "^1.0.0",+ "graceful-fs": "^4.2.0",+ "jsonfile": "^6.0.1",+ "universalify": "^2.0.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/@electron/get": {+ "version": "5.1.0",+ "resolved": "https://registry.npmjs.org/@electron/get/-/get-5.1.0.tgz",+ "integrity": "sha512-3kSBtG8ObcTVfXanm5vVJ6UnBLEVmVsRk1M+vGqCuMBV+XLCbJYuWQful+yIy0GQDsSlK0kHEriEHn7SPk4EnA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "debug": "^4.1.1",+ "env-paths": "^3.0.0",+ "graceful-fs": "^4.2.11",+ "progress": "^2.0.3",+ "semver": "^7.6.3",+ "sumchecker": "^3.0.1"+ },+ "engines": {+ "node": ">=22.12.0"+ },+ "optionalDependencies": {+ "undici": "^7.24.4"+ }+ },+ "node_modules/@electron/notarize": {+ "version": "2.5.0",+ "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-2.5.0.tgz",+ "integrity": "sha512-jNT8nwH1f9X5GEITXaQ8IF/KdskvIkOFfB2CvwumsveVidzpSc+mvhhTMdAGSYF3O+Nq49lJ7y+ssODRXu06+A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "debug": "^4.1.1",+ "fs-extra": "^9.0.1",+ "promise-retry": "^2.0.1"+ },+ "engines": {+ "node": ">= 10.0.0"+ }+ },+ "node_modules/@electron/notarize/node_modules/fs-extra": {+ "version": "9.1.0",+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",+ "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "at-least-node": "^1.0.0",+ "graceful-fs": "^4.2.0",+ "jsonfile": "^6.0.1",+ "universalify": "^2.0.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/@electron/osx-sign": {+ "version": "1.3.3",+ "resolved": "https://registry.npmjs.org/@electron/osx-sign/-/osx-sign-1.3.3.tgz",+ "integrity": "sha512-KZ8mhXvWv2rIEgMbWZ4y33bDHyUKMXnx4M0sTyPNK/vcB81ImdeY9Ggdqy0SWbMDgmbqyQ+phgejh6V3R2QuSg==",+ "dev": true,+ "license": "BSD-2-Clause",+ "dependencies": {+ "compare-version": "^0.1.2",+ "debug": "^4.3.4",+ "fs-extra": "^10.0.0",+ "isbinaryfile": "^4.0.8",+ "minimist": "^1.2.6",+ "plist": "^3.0.5"+ },+ "bin": {+ "electron-osx-flat": "bin/electron-osx-flat.js",+ "electron-osx-sign": "bin/electron-osx-sign.js"+ },+ "engines": {+ "node": ">=12.0.0"+ }+ },+ "node_modules/@electron/osx-sign/node_modules/isbinaryfile": {+ "version": "4.0.10",+ "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz",+ "integrity": "sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 8.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/gjtorikian/"+ }+ },+ "node_modules/@electron/rebuild": {+ "version": "4.2.1",+ "resolved": "https://registry.npmjs.org/@electron/rebuild/-/rebuild-4.2.1.tgz",+ "integrity": "sha512-IS4pG3BysRrCLJ8xTAfvg+IQDbiUoAzdJy2SfjcYKnLDy5DpCdjnPdhS5Zf5UMfrkB24xu0KC+TqcOxg+eG+6w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@malept/cross-spawn-promise": "^2.0.0",+ "debug": "^4.1.1",+ "node-abi": "^4.2.0",+ "node-api-version": "^0.2.1",+ "node-gyp": "^12.2.0",+ "read-binary-file-arch": "^1.0.6"+ },+ "bin": {+ "electron-rebuild": "lib/cli.js"+ },+ "engines": {+ "node": ">=22.12.0"+ }+ },+ "node_modules/@electron/universal": {+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/@electron/universal/-/universal-2.0.3.tgz",+ "integrity": "sha512-Wn9sPYIVFRFl5HmwMJkARCCf7rqK/EurkfQ/rJZ14mHP3iYTjZSIOSVonEAnhWeAXwtw7zOekGRlc6yTtZ0t+g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@electron/asar": "^3.3.1",+ "@malept/cross-spawn-promise": "^2.0.0",+ "debug": "^4.3.1",+ "dir-compare": "^4.2.0",+ "fs-extra": "^11.1.1",+ "minimatch": "^9.0.3",+ "plist": "^3.1.0"+ },+ "engines": {+ "node": ">=16.4"+ }+ },+ "node_modules/@electron/universal/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": "MIT"+ },+ "node_modules/@electron/universal/node_modules/brace-expansion": {+ "version": "2.1.7",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.7.tgz",+ "integrity": "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^1.0.0"+ }+ },+ "node_modules/@electron/universal/node_modules/fs-extra": {+ "version": "11.4.1",+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.4.1.tgz",+ "integrity": "sha512-KYAb4c9BJQI6QqGKthV68OHe0badztdXJWKo0WtBA9IuCFPTKvE5ZdUBglP833aMjhaSPNO4A5j/EkzZtGlKjA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "graceful-fs": "^4.2.0",+ "jsonfile": "^6.0.1",+ "universalify": "^2.0.0"+ },+ "engines": {+ "node": ">=14.14"+ }+ },+ "node_modules/@electron/universal/node_modules/minimatch": {+ "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.2"+ },+ "engines": {+ "node": ">=16 || 14 >=14.17"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/@electron/windows-sign": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/@electron/windows-sign/-/windows-sign-1.2.2.tgz",+ "integrity": "sha512-dfZeox66AvdPtb2lD8OsIIQh12Tp0GNCRUDfBHIKGpbmopZto2/A8nSpYYLoedPIHpqkeblZ/k8OV0Gy7PYuyQ==",+ "dev": true,+ "license": "BSD-2-Clause",+ "optional": true,+ "peer": true,+ "dependencies": {+ "cross-dirname": "^0.1.0",+ "debug": "^4.3.4",+ "fs-extra": "^11.1.1",+ "minimist": "^1.2.8",+ "postject": "^1.0.0-alpha.6"+ },+ "bin": {+ "electron-windows-sign": "bin/electron-windows-sign.js"+ },+ "engines": {+ "node": ">=14.14"+ }+ },+ "node_modules/@electron/windows-sign/node_modules/fs-extra": {+ "version": "11.4.1",+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.4.1.tgz",+ "integrity": "sha512-KYAb4c9BJQI6QqGKthV68OHe0badztdXJWKo0WtBA9IuCFPTKvE5ZdUBglP833aMjhaSPNO4A5j/EkzZtGlKjA==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "peer": true,+ "dependencies": {+ "graceful-fs": "^4.2.0",+ "jsonfile": "^6.0.1",+ "universalify": "^2.0.0"+ },+ "engines": {+ "node": ">=14.14"+ }+ },+ "node_modules/@esbuild/aix-ppc64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz",+ "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "aix"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-arm": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz",+ "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz",+ "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz",+ "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/darwin-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz",+ "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/darwin-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz",+ "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/freebsd-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz",+ "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/freebsd-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz",+ "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-arm": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz",+ "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz",+ "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-ia32": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz",+ "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-loong64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz",+ "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-mips64el": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz",+ "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==",+ "cpu": [+ "mips64el"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-ppc64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz",+ "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-riscv64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz",+ "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-s390x": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz",+ "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz",+ "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/netbsd-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz",+ "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/netbsd-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz",+ "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openbsd-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz",+ "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openbsd-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz",+ "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openharmony-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz",+ "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openharmony"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/sunos-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz",+ "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "sunos"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz",+ "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-ia32": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz",+ "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz",+ "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@isaacs/fs-minipass": {+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz",+ "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "minipass": "^7.0.4"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@jridgewell/resolve-uri": {+ "version": "3.1.2",+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.0.0"+ }+ },+ "node_modules/@jridgewell/sourcemap-codec": {+ "version": "1.6.0",+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz",+ "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@jridgewell/trace-mapping": {+ "version": "0.3.31",+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",+ "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/resolve-uri": "^3.1.0",+ "@jridgewell/sourcemap-codec": "^1.4.14"+ }+ },+ "node_modules/@larksuiteoapi/node-sdk": {+ "version": "1.76.0",+ "resolved": "https://registry.npmjs.org/@larksuiteoapi/node-sdk/-/node-sdk-1.76.0.tgz",+ "integrity": "sha512-v/bxQNCugwAmMPbZtBGJtSu8hdQLiB1/29Jr+GBIG18DyQ4LYyp7gxQ74pkhXVSuoUeH4v+/ZHAw/SW+KMrj2g==",+ "license": "MIT",+ "dependencies": {+ "axios": "^1.16.0",+ "lodash.identity": "^3.0.0",+ "lodash.merge": "^4.6.2",+ "lodash.pickby": "^4.6.0",+ "protobufjs": "^7.2.6",+ "qs": "^6.14.2",+ "ws": "^8.19.0"+ }+ },+ "node_modules/@malept/cross-spawn-promise": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/@malept/cross-spawn-promise/-/cross-spawn-promise-2.0.0.tgz",+ "integrity": "sha512-1DpKU0Z5ThltBwjNySMC14g0CkbyhCaz9FkhxqNsZI6uAPJXFS8cMXlBKo26FJ8ZuW6S9GCMcR9IO5k2X5/9Fg==",+ "dev": true,+ "funding": [+ {+ "type": "individual",+ "url": "https://github.com/sponsors/malept"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/subscription/pkg/npm-.malept-cross-spawn-promise?utm_medium=referral&utm_source=npm_fund"+ }+ ],+ "license": "Apache-2.0",+ "dependencies": {+ "cross-spawn": "^7.0.1"+ },+ "engines": {+ "node": ">= 12.13.0"+ }+ },+ "node_modules/@malept/flatpak-bundler": {+ "version": "0.4.0",+ "resolved": "https://registry.npmjs.org/@malept/flatpak-bundler/-/flatpak-bundler-0.4.0.tgz",+ "integrity": "sha512-9QOtNffcOF/c1seMCDnjckb3R9WHcG34tky+FHpNKKCW0wc/scYLwMtO+ptyGUfMW0/b/n4qRiALlaFHc9Oj7Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "debug": "^4.1.1",+ "fs-extra": "^9.0.0",+ "lodash": "^4.17.15",+ "tmp-promise": "^3.0.2"+ },+ "engines": {+ "node": ">= 10.0.0"+ }+ },+ "node_modules/@malept/flatpak-bundler/node_modules/fs-extra": {+ "version": "9.1.0",+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",+ "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "at-least-node": "^1.0.0",+ "graceful-fs": "^4.2.0",+ "jsonfile": "^6.0.1",+ "universalify": "^2.0.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/@noble/hashes": {+ "version": "1.8.0",+ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",+ "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "^14.21.3 || >=16"+ },+ "funding": {+ "url": "https://paulmillr.com/funding/"+ }+ },+ "node_modules/@oxc-project/types": {+ "version": "0.155.0",+ "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.155.0.tgz",+ "integrity": "sha512-SeE8JPwW1xs1tHeNycjUtUBdhorRa8o4jlvjwk49R7/Z291i+4DQa7JJIgOm/TaYQZx+QrPQbVJ/9c8dMIZN8Q==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "funding": {+ "url": "https://github.com/sponsors/oxc-project"+ }+ },+ "node_modules/@peculiar/asn1-schema": {+ "version": "2.11.1",+ "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-2.11.1.tgz",+ "integrity": "sha512-jaU9OaCcbZUdyXx9hMETZB9xoNmxTGjOGFqd3cOwKFkpKnyKd9WxF3uqj4PvX4cyOMP9bSdHg5YyML2qtx/d/g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@peculiar/utils": "^2.0.2",+ "asn1js": "^3.0.10",+ "tslib": "^2.8.1"+ },+ "engines": {+ "node": ">=14"+ }+ },+ "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": ">=8.0.0"+ }+ },+ "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": "MIT",+ "dependencies": {+ "tslib": "^2.8.1"+ }+ },+ "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": "MIT",+ "dependencies": {+ "@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": ">=14.18.0"+ }+ },+ "node_modules/@protobufjs/aspromise": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",+ "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/base64": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",+ "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/codegen": {+ "version": "2.0.5",+ "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.5.tgz",+ "integrity": "sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/eventemitter": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.1.tgz",+ "integrity": "sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/fetch": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.1.tgz",+ "integrity": "sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==",+ "license": "BSD-3-Clause",+ "dependencies": {+ "@protobufjs/aspromise": "^1.1.1"+ }+ },+ "node_modules/@protobufjs/float": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",+ "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/path": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",+ "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/pool": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",+ "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/utf8": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.2.tgz",+ "integrity": "sha512-b1UQwcEZ4yCnMCD8DAL1VlbvBJE9/IX4FTIp7BG1xYpf29SLazLSrqUkj4w7Y5y7cCVP6E5tcqqcI0xemPkHug==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@rolldown/binding-android-arm-eabi": {+ "version": "1.2.15",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.15.tgz",+ "integrity": "sha512-aLcgK9gIJ3YRvrrtfSBbRa27F5WrpiTaPulnFpsHPxpUHgFlSgnU4854MHwoRGEBhfRJDWCS2WQ7lIjskE9Olw==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "peer": true,+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-android-arm64": {+ "version": "1.2.15",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.15.tgz",+ "integrity": "sha512-xD7DdZCrbThKuxNg7ooQmvp07ys4J/pnSEMTG3/OdOWl6daC67m/Q4fL78sRHMxTH/N4fGUbYhcPM0MF5WFHkg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "peer": true,+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-darwin-arm64": {+ "version": "1.2.15",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.15.tgz",+ "integrity": "sha512-m2WuQ6r0B4OTYxyPpNLtXaMRbRDUbG8YQV2Q3KTdSSK8Th6KHCnC8jVCJt8bvYeSB5WivkkNbc85mKadaSdOxA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "peer": true,+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-darwin-x64": {+ "version": "1.2.15",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.15.tgz",+ "integrity": "sha512-5RtnsHM36nodM9WbMy+zip0LGS/G+y5wro5RHrpOlr4ac24+1zSi9kiV2MP1myZeZ/ifEHfulQcWjnAXzc2C2A==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "peer": true,+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-freebsd-x64": {+ "version": "1.2.15",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.15.tgz",+ "integrity": "sha512-g3l09pyFqhu+135JKkbkwiKGQmwU5hUMUPJ4VdBADvuqR8d33L6H578rh8m7rtxbdp+VmX/+nzI7nvhSZlzpUQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "peer": true,+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-arm-gnueabihf": {+ "version": "1.2.15",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.15.tgz",+ "integrity": "sha512-nIe3VugI97nGQtspPxDqA4sXMUpeiocKIP/CqpY/u/vgbT+alX+cVxu1C/oVBPKg4feNTmYovE91v4DgXvXNwQ==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "peer": true,+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-arm64-gnu": {+ "version": "1.2.15",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.15.tgz",+ "integrity": "sha512-iTBjXx+B5QSvgI89lJfmqh4wTh8NabR1YZIIN3hNx4zSG0EVfVqkOvLulNpG4251pbd6/IAmZ/LefVk1Y4rPhw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "peer": true,+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-arm64-musl": {+ "version": "1.2.15",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.15.tgz",+ "integrity": "sha512-uN26XOnVR7rqQupG3V9oAG2EGGatWjcJHOeDOHUFCh4TBWmP2tHTFoVN13aYbwfm0aHqJAEmcwhAu6sooIjfqQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "peer": true,+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-ppc64-gnu": {+ "version": "1.2.15",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.15.tgz",+ "integrity": "sha512-9nWkcdd+H+XhaA3fQIwpHnKIrfx/PQ6rO0pivr78Og07tXlUlctBBJoEYLPfhTmCR/QxEVdn6uPjHV5SymPhdw==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "peer": true,+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-s390x-gnu": {+ "version": "1.2.15",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.15.tgz",+ "integrity": "sha512-Ggh0ciFjLwIusLSLz7LZYEaGdxOAUJXI+Qu5JCbhPJJHEt8vP+IjRATTJheiJsdzzTYgUiHUiw3X1Ea3ZpMBdA==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "peer": true,+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-x64-gnu": {+ "version": "1.2.15",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.15.tgz",+ "integrity": "sha512-FHg60rS6DBePAYZ9X9F67x+JObFdmgn6tupA1C/a3B+CufFmTD4mX+e8M75tCiAO3foR/6xwVBI0KQiI7sn/rw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "peer": true,+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-x64-musl": {+ "version": "1.2.15",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.15.tgz",+ "integrity": "sha512-/cvV/7v5VGz/moiz0XKRj2dE8DzsKyhIu1KpOvJGPjRywg3yscON889UGvAe8zfiJLHup7VLjBduoGWi3HusWQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "peer": true,+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-openharmony-arm64": {+ "version": "1.2.15",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.15.tgz",+ "integrity": "sha512-MyzC5Hrv/sm+Z7TSGKP/j8001RO2xQm1zOpCNVL4j0cY/VhBZviludA2YFQ7i4lH6ZAXxQm0lcMdBzM+99mE7w==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openharmony"+ ],+ "peer": true,+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-win32-arm64-msvc": {+ "version": "1.2.15",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.15.tgz",+ "integrity": "sha512-+PgYiS+AH5omy6L45ZLxybasauJaj3M8buoT83D+nzPmCayXlxUV9hydhciCKVyIg0B/v0BtXPDE1uGqNwCPpg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "peer": true,+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-win32-x64-msvc": {+ "version": "1.2.15",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.15.tgz",+ "integrity": "sha512-HFZd2QNQYn1JbIi+Hpd7H+r/lkWxcfIu28nirZ6eCn2LafuvmExMlb/P96Sfx5tf7pPArw39IdhmCF8vmV+NhQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "peer": true,+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/pluginutils": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz",+ "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==",+ "dev": true,+ "license": "MIT",+ "peer": true+ },+ "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": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sindresorhus/is?sponsor=1"+ }+ },+ "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": {+ "defer-to-connect": "^2.0.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "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": {+ "@types/http-cache-semantics": "*",+ "@types/keyv": "^3.1.4",+ "@types/node": "*",+ "@types/responselike": "^1.0.0"+ }+ },+ "node_modules/@types/chai": {+ "version": "5.2.3",+ "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz",+ "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/deep-eql": "*",+ "assertion-error": "^2.0.1"+ }+ },+ "node_modules/@types/debug": {+ "version": "4.1.13",+ "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz",+ "integrity": "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/ms": "*"+ }+ },+ "node_modules/@types/deep-eql": {+ "version": "4.0.2",+ "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz",+ "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/estree": {+ "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"+ },+ "node_modules/@types/fs-extra": {+ "version": "9.0.13",+ "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.13.tgz",+ "integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/node": "*"+ }+ },+ "node_modules/@types/http-cache-semantics": {+ "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"+ },+ "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": {+ "@types/node": "*"+ }+ },+ "node_modules/@types/ms": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz",+ "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/node": {+ "version": "22.20.5",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.5.tgz",+ "integrity": "sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA==",+ "license": "MIT",+ "dependencies": {+ "undici-types": "~6.21.0"+ }+ },+ "node_modules/@types/qrcode": {+ "version": "1.5.6",+ "resolved": "https://registry.npmjs.org/@types/qrcode/-/qrcode-1.5.6.tgz",+ "integrity": "sha512-te7NQcV2BOvdj2b1hCAHzAoMNuj65kNBMz0KBaxM6c3VGBOhU0dURQKOtH8CFNI/dsKkwlv32p26qYQTWoB5bw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/node": "*"+ }+ },+ "node_modules/@types/qrcode-terminal": {+ "version": "0.12.2",+ "resolved": "https://registry.npmjs.org/@types/qrcode-terminal/-/qrcode-terminal-0.12.2.tgz",+ "integrity": "sha512-v+RcIEJ+Uhd6ygSQ0u5YYY7ZM+la7GgPbs0V/7l/kFs2uO4S8BcIUEMoP7za4DNIqNnUD5npf0A/7kBhrCKG5Q==",+ "dev": true,+ "license": "MIT"+ },+ "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": {+ "@types/node": "*"+ }+ },+ "node_modules/@typescript/typescript-aix-ppc64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz",+ "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "aix"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-darwin-arm64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz",+ "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-darwin-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-x64/-/typescript-darwin-x64-7.0.2.tgz",+ "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-freebsd-arm64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz",+ "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-freebsd-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz",+ "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-arm": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz",+ "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-arm64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz",+ "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-loong64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz",+ "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-mips64el": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz",+ "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==",+ "cpu": [+ "mips64el"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-ppc64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz",+ "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-riscv64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz",+ "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-s390x": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz",+ "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz",+ "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-netbsd-arm64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz",+ "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-netbsd-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz",+ "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-openbsd-arm64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz",+ "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-openbsd-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz",+ "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-sunos-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz",+ "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "sunos"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-win32-arm64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz",+ "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-win32-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz",+ "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@vitest/mocker": {+ "version": "5.0.5",+ "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.0.5.tgz",+ "integrity": "sha512-xLL3lkDegJZw+MGoGaCCsFayDZthGgpAtr3Vziyfc4p7xH89K7KRPcRBBh/kEYm0Aqkt5DtTmkYpBtRV/FrHZg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/trace-mapping": "0.3.31",+ "@vitest/spy": "5.0.5",+ "estree-walker": "^3.0.3",+ "magic-string": "^1.4.3"+ },+ "funding": {+ "url": "https://opencollective.com/vitest"+ },+ "peerDependencies": {+ "msw": "^2.4.9 || ^3.0.0",+ "vite": "^6.0.0 || ^7.0.0 || ^8.0.0"+ },+ "peerDependenciesMeta": {+ "msw": {+ "optional": true+ },+ "vite": {+ "optional": true+ }+ }+ },+ "node_modules/@vitest/spy": {+ "version": "5.0.5",+ "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.0.5.tgz",+ "integrity": "sha512-lwJRExuH417257Q5wv9QYugN9IMJkoxcrKrYxGPQkBzl7wlNpTUxD/5yNX4ESKVUIShKPgkGchYPFMWOOk0wzw==",+ "dev": true,+ "license": "MIT",+ "funding": {+ "url": "https://opencollective.com/vitest"+ }+ },+ "node_modules/@xmldom/xmldom": {+ "version": "0.8.15",+ "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.15.tgz",+ "integrity": "sha512-/5NV/vDALVFDXgLmfsy9TRCBlKwO2LNBFzpzvb9iIj+jR+eSc6DLYYvVOdivT/jm7MtU6TebYuRmzEOI7w40UA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=10.0.0"+ }+ },+ "node_modules/abbrev": {+ "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": "^20.17.0 || >=22.9.0"+ }+ },+ "node_modules/agent-base": {+ "version": "6.0.2",+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",+ "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",+ "license": "MIT",+ "dependencies": {+ "debug": "4"+ },+ "engines": {+ "node": ">= 6.0.0"+ }+ },+ "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/ansi-regex": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/ansi-styles": {+ "version": "4.3.0",+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",+ "license": "MIT",+ "dependencies": {+ "color-convert": "^2.0.1"+ },+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"+ }+ },+ "node_modules/app-builder-lib": {+ "version": "26.18.0",+ "resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-26.18.0.tgz",+ "integrity": "sha512-lx+KkuCSZHcbECf4R3IAcC9VOFk0+cMUwljO63s5y8yqS1Lw0sRGmjPaWsPwP3zv3ohZYbMhUvjXeiQXXZhJXA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@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.2.1",+ "@electron/universal": "2.0.3",+ "@malept/flatpak-bundler": "^0.4.0",+ "@noble/hashes": "^1.8.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.16.0",+ "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.18.0",+ "fs-extra": "^10.1.0",+ "hosted-git-info": "^4.1.0",+ "isbinaryfile": "^5.0.0",+ "jiti": "^2.4.2",+ "js-yaml": "^4.1.0",+ "json5": "^2.2.3",+ "lazy-val": "^1.0.5",+ "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.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.18.0",+ "electron-builder-squirrel-windows": "26.18.0"+ }+ },+ "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": "^4.0.0",+ "universalify": "^0.1.0"+ },+ "engines": {+ "node": ">=6 <7 || >=8"+ }+ },+ "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/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": ">=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/jsonfile": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",+ "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==",+ "dev": true,+ "license": "MIT",+ "optionalDependencies": {+ "graceful-fs": "^4.1.6"+ }+ },+ "node_modules/app-builder-lib/node_modules/semver": {+ "version": "7.7.4",+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz",+ "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==",+ "dev": true,+ "license": "ISC",+ "bin": {+ "semver": "bin/semver.js"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/app-builder-lib/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",+ "engines": {+ "node": ">= 4.0.0"+ }+ },+ "node_modules/argparse": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",+ "dev": true,+ "license": "Python-2.0"+ },+ "node_modules/asn1js": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/asn1js/-/asn1js-3.1.0.tgz",+ "integrity": "sha512-HWYi1THkOqguCiO+vwj09ZkQFD2kKEsejYHAYCtX0D80WVdoDnvRc9IukXX/jeb0T9NRWJnRtqwdbHltnFjwXA==",+ "dev": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "pvtsutils": "^1.3.6",+ "pvutils": "^1.2.0",+ "tslib": "^2.8.1"+ },+ "engines": {+ "node": ">=12.0.0"+ }+ },+ "node_modules/assertion-error": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz",+ "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/async": {+ "version": "3.2.6",+ "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz",+ "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/async-exit-hook": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/async-exit-hook/-/async-exit-hook-2.0.1.tgz",+ "integrity": "sha512-NW2cX8m1Q7KPA7a5M2ULQeZ2wR5qI5PAbw5L0UOMxdioVk9PMZ0h1TmyZEkPYrCvYjDlFICusOu1dlEKAAeXBw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.12.0"+ }+ },+ "node_modules/asynckit": {+ "version": "0.4.0",+ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",+ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",+ "license": "MIT"+ },+ "node_modules/at-least-node": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",+ "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==",+ "dev": true,+ "license": "ISC",+ "engines": {+ "node": ">= 4.0.0"+ }+ },+ "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.21.0",+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.21.0.tgz",+ "integrity": "sha512-YCzXMB53Q9PZBsh7yN7wtapit4WepwcHS2fP8QhGsBxSz5YtgYobV7GGlWlAJi+RxfU77GQTQi2DSLUma42EYA==",+ "license": "MIT",+ "dependencies": {+ "follow-redirects": "^1.16.0",+ "form-data": "^4.0.6",+ "https-proxy-agent": "^5.0.1",+ "proxy-from-env": "^2.1.0"+ }+ },+ "node_modules/balanced-match": {+ "version": "4.0.4",+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",+ "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "18 || 20 || >=22"+ }+ },+ "node_modules/base64-js": {+ "version": "1.5.1",+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",+ "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/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"+ },+ "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": "5.0.12",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz",+ "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^4.0.2"+ },+ "engines": {+ "node": "20 || >=22"+ }+ },+ "node_modules/buffer-from": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",+ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/builder-util": {+ "version": "26.16.0",+ "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-26.16.0.tgz",+ "integrity": "sha512-RLyJhB7Si3YkzKR9ubQslWuXW3Vhs3CGe1i+SeixBZ0qTd1mk3XBmssvY22TlB6CS5blyko8Gu1JzpYk8UkYAg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/debug": "^4.1.6",+ "builder-util-runtime": "9.7.0",+ "chalk": "^4.1.2",+ "cross-spawn": "^7.0.6",+ "debug": "^4.3.4",+ "fs-extra": "^10.1.0",+ "http-proxy-agent": "^7.0.0",+ "https-proxy-agent": "^7.0.0",+ "js-yaml": "^4.1.0",+ "sanitize-filename": "^1.6.3",+ "source-map-support": "^0.5.19",+ "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.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": {+ "debug": "^4.3.4",+ "sax": "^1.2.4"+ },+ "engines": {+ "node": ">=12.0.0"+ }+ },+ "node_modules/builder-util/node_modules/agent-base": {+ "version": "7.1.4",+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",+ "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/builder-util/node_modules/https-proxy-agent": {+ "version": "7.0.6",+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",+ "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "agent-base": "^7.1.2",+ "debug": "4"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/bytestreamjs": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/bytestreamjs/-/bytestreamjs-2.0.1.tgz",+ "integrity": "sha512-U1Z/ob71V/bXfVABvNr/Kumf5VyeQRBEm6Txb0PQ6S7V5GpBM3w4Cbqz/xPDicR5tN0uvDifng8C+5qECeGwyQ==",+ "dev": true,+ "license": "BSD-3-Clause",+ "engines": {+ "node": ">=6.0.0"+ }+ },+ "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": {+ "node": ">=10.6.0"+ }+ },+ "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": {+ "clone-response": "^1.0.2",+ "get-stream": "^5.1.0",+ "http-cache-semantics": "^4.0.0",+ "keyv": "^4.0.0",+ "lowercase-keys": "^2.0.0",+ "normalize-url": "^6.0.1",+ "responselike": "^2.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/call-bind-apply-helpers": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",+ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",+ "license": "MIT",+ "dependencies": {+ "es-errors": "^1.3.0",+ "function-bind": "^1.1.2"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/call-bound": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",+ "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",+ "license": "MIT",+ "dependencies": {+ "call-bind-apply-helpers": "^1.0.2",+ "get-intrinsic": "^1.3.0"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/camelcase": {+ "version": "5.3.1",+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",+ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/chai": {+ "version": "6.3.0",+ "resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz",+ "integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/chalk": {+ "version": "4.1.2",+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ansi-styles": "^4.1.0",+ "supports-color": "^7.1.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/chalk/chalk?sponsor=1"+ }+ },+ "node_modules/chownr": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz",+ "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==",+ "dev": true,+ "license": "BlueOak-1.0.0",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/chromium-pickle-js": {+ "version": "0.2.0",+ "resolved": "https://registry.npmjs.org/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz",+ "integrity": "sha512-1R5Fho+jBq0DDydt+/vHWj5KJNJCKdARKOCwZUen84I5BreWoLqRLANH1U87eJy1tiASPtMnGqJJq0ZsLoRPOw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/ci-info": {+ "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": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/sibiraj-s"+ }+ ],+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/cliui": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",+ "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",+ "license": "ISC",+ "dependencies": {+ "string-width": "^4.2.0",+ "strip-ansi": "^6.0.0",+ "wrap-ansi": "^6.2.0"+ }+ },+ "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": {+ "mimic-response": "^1.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/color-convert": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",+ "license": "MIT",+ "dependencies": {+ "color-name": "~1.1.4"+ },+ "engines": {+ "node": ">=7.0.0"+ }+ },+ "node_modules/color-name": {+ "version": "1.1.4",+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",+ "license": "MIT"+ },+ "node_modules/combined-stream": {+ "version": "1.0.8",+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",+ "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",+ "license": "MIT",+ "dependencies": {+ "delayed-stream": "~1.0.0"+ },+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/commander": {+ "version": "5.1.0",+ "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz",+ "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/compare-version": {+ "version": "0.1.2",+ "resolved": "https://registry.npmjs.org/compare-version/-/compare-version-0.1.2.tgz",+ "integrity": "sha512-pJDh5/4wrEnXX/VWRZvruAGHkzKdr46z11OlTPN+VrATlWWhSKewNCJ1futCO5C7eJB3nPMFZA1LeYtcFboZ2A==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/concat-map": {+ "version": "0.0.1",+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",+ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/core-util-is": {+ "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"+ },+ "node_modules/cross-dirname": {+ "version": "0.1.0",+ "resolved": "https://registry.npmjs.org/cross-dirname/-/cross-dirname-0.1.0.tgz",+ "integrity": "sha512-+R08/oI0nl3vfPcqftZRpytksBXDzOUveBq/NBVx0sUp1axwzPQrKinNx5yd5sxPu8j1wIy8AfnVQ+5eFdha6Q==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "peer": true+ },+ "node_modules/cross-spawn": {+ "version": "7.0.6",+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "path-key": "^3.1.0",+ "shebang-command": "^2.0.0",+ "which": "^2.0.1"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/cross-spawn/node_modules/isexe": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/cross-spawn/node_modules/which": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "isexe": "^2.0.0"+ },+ "bin": {+ "node-which": "bin/node-which"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/debug": {+ "version": "4.4.3",+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",+ "license": "MIT",+ "dependencies": {+ "ms": "^2.1.3"+ },+ "engines": {+ "node": ">=6.0"+ },+ "peerDependenciesMeta": {+ "supports-color": {+ "optional": true+ }+ }+ },+ "node_modules/decamelize": {+ "version": "1.2.0",+ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",+ "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "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": {+ "mimic-response": "^3.1.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "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": {+ "node": ">=10"+ },+ "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": {+ "node": ">=10"+ }+ },+ "node_modules/define-data-property": {+ "version": "1.1.4",+ "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz",+ "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "es-define-property": "^1.0.0",+ "es-errors": "^1.3.0",+ "gopd": "^1.0.1"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/define-properties": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz",+ "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "define-data-property": "^1.0.1",+ "has-property-descriptors": "^1.0.0",+ "object-keys": "^1.1.1"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/delayed-stream": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",+ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",+ "license": "MIT",+ "engines": {+ "node": ">=0.4.0"+ }+ },+ "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",+ "peer": true,+ "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+ },+ "node_modules/dijkstrajs": {+ "version": "1.0.3",+ "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz",+ "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==",+ "license": "MIT"+ },+ "node_modules/dir-compare": {+ "version": "4.2.0",+ "resolved": "https://registry.npmjs.org/dir-compare/-/dir-compare-4.2.0.tgz",+ "integrity": "sha512-2xMCmOoMrdQIPHdsTawECdNPwlVFB9zGcz3kuhmBO6U3oU+UQjsue0i8ayLKpgBcm+hcXPMVSGUN9d+pvJ6+VQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "minimatch": "^3.0.5",+ "p-limit": "^3.1.0 "+ }+ },+ "node_modules/dir-compare/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": "MIT"+ },+ "node_modules/dir-compare/node_modules/brace-expansion": {+ "version": "1.1.21",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.21.tgz",+ "integrity": "sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==",+ "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.5",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",+ "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "brace-expansion": "^1.1.7"+ },+ "engines": {+ "node": "*"+ }+ },+ "node_modules/dir-compare/node_modules/p-limit": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",+ "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "yocto-queue": "^0.1.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/dmg-builder": {+ "version": "26.18.0",+ "resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-26.18.0.tgz",+ "integrity": "sha512-ozCGC54wi2C1RkS2v69y9lQxvoQ1Coh+iT8CmWiyY8y1ZuOKVvuNson2Hd+HEOs9+EZNNsOBbzKgQZ4SNqWd0w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "app-builder-lib": "26.18.0",+ "builder-util": "26.16.0",+ "fs-extra": "^10.1.0",+ "js-yaml": "^4.1.0"+ }+ },+ "node_modules/dotenv": {+ "version": "16.6.1",+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz",+ "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==",+ "dev": true,+ "license": "BSD-2-Clause",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://dotenvx.com"+ }+ },+ "node_modules/dotenv-expand": {+ "version": "11.0.7",+ "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-11.0.7.tgz",+ "integrity": "sha512-zIHwmZPRshsCdpMDyVsqGmgyP0yT8GAgXUnkdAoJisxvf33k7yO6OuoKmcTGuXPWSsm8Oh88nZicRLA9Y0rUeA==",+ "dev": true,+ "license": "BSD-2-Clause",+ "dependencies": {+ "dotenv": "^16.4.5"+ },+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://dotenvx.com"+ }+ },+ "node_modules/dunder-proto": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",+ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",+ "license": "MIT",+ "dependencies": {+ "call-bind-apply-helpers": "^1.0.1",+ "es-errors": "^1.3.0",+ "gopd": "^1.2.0"+ },+ "engines": {+ "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/ejs": {+ "version": "3.1.10",+ "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz",+ "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "jake": "^10.8.5"+ },+ "bin": {+ "ejs": "bin/cli.js"+ },+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/electron": {+ "version": "45.0.0",+ "resolved": "https://registry.npmjs.org/electron/-/electron-45.0.0.tgz",+ "integrity": "sha512-yjz4uhMBcO6L5X7CWgRMobf2EMJPnb9j4zuf+nu/TU/6E4Sqfx7fn/a2eACo4qngjml/0JnsoZhxYroJLxLd2w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@electron-internal/extract-zip": "^1.0.1",+ "@electron/get": "^5.0.0",+ "@types/node": "^24.9.0"+ },+ "bin": {+ "electron": "cli.js",+ "install-electron": "install.js"+ },+ "engines": {+ "node": ">= 22.12.0"+ }+ },+ "node_modules/electron-builder": {+ "version": "26.18.0",+ "resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-26.18.0.tgz",+ "integrity": "sha512-ASgIuQnOq4RuD8jMhS9hI0LS3EMRT1I/M5R6utqifB/BHN80IcCjBdt+DED+NmNPvmBgEtrlExXZitNdA7kXOg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "app-builder-lib": "26.18.0",+ "builder-util": "26.16.0",+ "builder-util-runtime": "9.7.0",+ "chalk": "^4.1.2",+ "ci-info": "^4.2.0",+ "dmg-builder": "26.18.0",+ "fs-extra": "^10.1.0",+ "lazy-val": "^1.0.5",+ "simple-update-notifier": "2.0.0",+ "yargs": "^17.6.2"+ },+ "bin": {+ "electron-builder": "cli.js",+ "install-app-deps": "install-app-deps.js"+ },+ "engines": {+ "node": ">=14.0.0"+ }+ },+ "node_modules/electron-builder-squirrel-windows": {+ "version": "26.18.0",+ "resolved": "https://registry.npmjs.org/electron-builder-squirrel-windows/-/electron-builder-squirrel-windows-26.18.0.tgz",+ "integrity": "sha512-a2elgTipboXNIsxqS1HOmHMGp4Pd3LJgIZOdIFTOskBSawvxKyZWYWQ1d7KKA4CtINSchYCYEKzhxRqiKZev9Q==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "app-builder-lib": "26.18.0",+ "builder-util": "26.16.0",+ "electron-winstaller": "5.4.0"+ }+ },+ "node_modules/electron-builder/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": {+ "string-width": "^4.2.0",+ "strip-ansi": "^6.0.1",+ "wrap-ansi": "^7.0.0"+ },+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/electron-builder/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": {+ "ansi-styles": "^4.0.0",+ "string-width": "^4.1.0",+ "strip-ansi": "^6.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"+ }+ },+ "node_modules/electron-builder/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": {+ "node": ">=10"+ }+ },+ "node_modules/electron-builder/node_modules/yargs": {+ "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": {+ "cliui": "^8.0.1",+ "escalade": "^3.1.1",+ "get-caller-file": "^2.0.5",+ "require-directory": "^2.1.1",+ "string-width": "^4.2.3",+ "y18n": "^5.0.5",+ "yargs-parser": "^21.1.1"+ },+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/electron-builder/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/electron-publish": {+ "version": "26.18.0",+ "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-26.18.0.tgz",+ "integrity": "sha512-MagnqaZSALSWjcdKu5HEVhYUZD/2BDL3q7XzrqWwub6gf/UfD3ItMgmthVDv9w5y9E0gH1C3JWqKaXwf6f4ROg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/fs-extra": "^9.0.11",+ "aws4": "^1.13.2",+ "builder-util": "26.16.0",+ "builder-util-runtime": "9.7.0",+ "chalk": "^4.1.2",+ "form-data": "^4.0.5",+ "fs-extra": "^10.1.0",+ "lazy-val": "^1.0.5",+ "mime": "^2.5.2"+ }+ },+ "node_modules/electron-winstaller": {+ "version": "5.4.0",+ "resolved": "https://registry.npmjs.org/electron-winstaller/-/electron-winstaller-5.4.0.tgz",+ "integrity": "sha512-bO3y10YikuUwUuDUQRM4KfwNkKhnpVO7IPdbsrejwN9/AABJzzTQ4GeHwyzNSrVO+tEH3/Np255a3sVZpZDjvg==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@electron/asar": "^3.2.1",+ "debug": "^4.1.1",+ "fs-extra": "^7.0.1",+ "lodash": "^4.17.21",+ "temp": "^0.9.0"+ },+ "engines": {+ "node": ">=8.0.0"+ },+ "optionalDependencies": {+ "@electron/windows-sign": "^1.1.2"+ }+ },+ "node_modules/electron-winstaller/node_modules/fs-extra": {+ "version": "7.0.1",+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz",+ "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "graceful-fs": "^4.1.2",+ "jsonfile": "^4.0.0",+ "universalify": "^0.1.0"+ },+ "engines": {+ "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.19.2",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-24.19.2.tgz",+ "integrity": "sha512-93d49wCWJkCyN87MxLpNN6KXPCwFw7bVUg79mGUV1OS40JGWwVCr8n61DXCSqz7CV6/VfPkb7xec7uP2M+QHWQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "undici-types": ">=7.24.0 <7.24.7"+ }+ },+ "node_modules/electron/node_modules/undici-types": {+ "version": "7.24.6",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz",+ "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/emoji-regex": {+ "version": "8.0.0",+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",+ "license": "MIT"+ },+ "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": {+ "once": "^1.4.0"+ }+ },+ "node_modules/env-paths": {+ "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": "^12.20.0 || ^14.13.1 || >=16.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/err-code": {+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz",+ "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/es-define-property": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",+ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/es-errors": {+ "version": "1.3.0",+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/es-module-lexer": {+ "version": "2.3.2",+ "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.2.tgz",+ "integrity": "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/es-object-atoms": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz",+ "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==",+ "license": "MIT",+ "dependencies": {+ "es-errors": "^1.3.0"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/es-set-tostringtag": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",+ "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",+ "license": "MIT",+ "dependencies": {+ "es-errors": "^1.3.0",+ "get-intrinsic": "^1.2.6",+ "has-tostringtag": "^1.0.2",+ "hasown": "^2.0.2"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "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+ },+ "node_modules/esbuild": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz",+ "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "bin": {+ "esbuild": "bin/esbuild"+ },+ "engines": {+ "node": ">=18"+ },+ "optionalDependencies": {+ "@esbuild/aix-ppc64": "0.28.2",+ "@esbuild/android-arm": "0.28.2",+ "@esbuild/android-arm64": "0.28.2",+ "@esbuild/android-x64": "0.28.2",+ "@esbuild/darwin-arm64": "0.28.2",+ "@esbuild/darwin-x64": "0.28.2",+ "@esbuild/freebsd-arm64": "0.28.2",+ "@esbuild/freebsd-x64": "0.28.2",+ "@esbuild/linux-arm": "0.28.2",+ "@esbuild/linux-arm64": "0.28.2",+ "@esbuild/linux-ia32": "0.28.2",+ "@esbuild/linux-loong64": "0.28.2",+ "@esbuild/linux-mips64el": "0.28.2",+ "@esbuild/linux-ppc64": "0.28.2",+ "@esbuild/linux-riscv64": "0.28.2",+ "@esbuild/linux-s390x": "0.28.2",+ "@esbuild/linux-x64": "0.28.2",+ "@esbuild/netbsd-arm64": "0.28.2",+ "@esbuild/netbsd-x64": "0.28.2",+ "@esbuild/openbsd-arm64": "0.28.2",+ "@esbuild/openbsd-x64": "0.28.2",+ "@esbuild/openharmony-arm64": "0.28.2",+ "@esbuild/sunos-x64": "0.28.2",+ "@esbuild/win32-arm64": "0.28.2",+ "@esbuild/win32-ia32": "0.28.2",+ "@esbuild/win32-x64": "0.28.2"+ }+ },+ "node_modules/escalade": {+ "version": "3.2.0",+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",+ "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/escape-string-regexp": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",+ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/estree-walker": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",+ "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/estree": "^1.0.0"+ }+ },+ "node_modules/expect-type": {+ "version": "1.4.0",+ "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz",+ "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=12.0.0"+ }+ },+ "node_modules/exponential-backoff": {+ "version": "3.1.3",+ "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.3.tgz",+ "integrity": "sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA==",+ "dev": true,+ "license": "Apache-2.0"+ },+ "node_modules/fast-deep-equal": {+ "version": "3.1.3",+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/fast-uri": {+ "version": "3.1.9",+ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz",+ "integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/fastify"+ },+ {+ "type": "opencollective",+ "url": "https://opencollective.com/fastify"+ }+ ],+ "license": "BSD-3-Clause"+ },+ "node_modules/fdir": {+ "version": "6.5.0",+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12.0.0"+ },+ "peerDependencies": {+ "picomatch": "^3 || ^4"+ },+ "peerDependenciesMeta": {+ "picomatch": {+ "optional": true+ }+ }+ },+ "node_modules/filelist": {+ "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": {+ "minimatch": "^5.0.1"+ }+ },+ "node_modules/filelist/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": "MIT"+ },+ "node_modules/filelist/node_modules/brace-expansion": {+ "version": "2.1.7",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.7.tgz",+ "integrity": "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^1.0.0"+ }+ },+ "node_modules/filelist/node_modules/minimatch": {+ "version": "5.1.9",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz",+ "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "brace-expansion": "^2.0.1"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/find-up": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",+ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",+ "license": "MIT",+ "dependencies": {+ "locate-path": "^5.0.0",+ "path-exists": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/follow-redirects": {+ "version": "1.16.2",+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.2.tgz",+ "integrity": "sha512-/kVP2U8z596Ia0gwFrwyIeo74ta5aVmSeU1FfAUMAmcEP5EP7zydmag3SLiN64NaRKef3lxsq7i/g7ltJQDGow==",+ "funding": [+ {+ "type": "individual",+ "url": "https://github.com/sponsors/RubenVerborgh"+ }+ ],+ "license": "MIT",+ "engines": {+ "node": ">=4.0"+ },+ "peerDependenciesMeta": {+ "debug": {+ "optional": true+ }+ }+ },+ "node_modules/form-data": {+ "version": "4.0.6",+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz",+ "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==",+ "license": "MIT",+ "dependencies": {+ "asynckit": "^0.4.0",+ "combined-stream": "^1.0.8",+ "es-set-tostringtag": "^2.1.0",+ "hasown": "^2.0.4",+ "mime-types": "^2.1.35"+ },+ "engines": {+ "node": ">= 6"+ }+ },+ "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/fs.realpath": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",+ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/fsevents": {+ "version": "2.3.3",+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"+ }+ },+ "node_modules/function-bind": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "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==",+ "license": "ISC",+ "engines": {+ "node": "6.* || 8.* || >= 10.*"+ }+ },+ "node_modules/get-intrinsic": {+ "version": "1.3.0",+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",+ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",+ "license": "MIT",+ "dependencies": {+ "call-bind-apply-helpers": "^1.0.2",+ "es-define-property": "^1.0.1",+ "es-errors": "^1.3.0",+ "es-object-atoms": "^1.1.1",+ "function-bind": "^1.1.2",+ "get-proto": "^1.0.1",+ "gopd": "^1.2.0",+ "has-symbols": "^1.1.0",+ "hasown": "^2.0.2",+ "math-intrinsics": "^1.1.0"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/get-proto": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",+ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",+ "license": "MIT",+ "dependencies": {+ "dunder-proto": "^1.0.1",+ "es-object-atoms": "^1.0.0"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "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": {+ "pump": "^3.0.0"+ },+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/glob": {+ "version": "7.2.3",+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",+ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",+ "deprecated": "Old versions of glob 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 exorbitant rates) by contacting [email protected]",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "fs.realpath": "^1.0.0",+ "inflight": "^1.0.4",+ "inherits": "2",+ "minimatch": "^3.1.1",+ "once": "^1.3.0",+ "path-is-absolute": "^1.0.0"+ },+ "engines": {+ "node": "*"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/glob/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": "MIT"+ },+ "node_modules/glob/node_modules/brace-expansion": {+ "version": "1.1.21",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.21.tgz",+ "integrity": "sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^1.0.0",+ "concat-map": "0.0.1"+ }+ },+ "node_modules/glob/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": "ISC",+ "dependencies": {+ "brace-expansion": "^1.1.7"+ },+ "engines": {+ "node": "*"+ }+ },+ "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,+ "dependencies": {+ "boolean": "^3.0.1",+ "es6-error": "^4.1.1",+ "matcher": "^3.0.0",+ "roarr": "^2.15.3",+ "semver": "^7.3.2",+ "serialize-error": "^7.0.1"+ },+ "engines": {+ "node": ">=10.0"+ }+ },+ "node_modules/globalthis": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz",+ "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "define-properties": "^1.2.1",+ "gopd": "^1.0.1"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/gopd": {+ "version": "1.2.0",+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "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": {+ "@sindresorhus/is": "^4.0.0",+ "@szmarczak/http-timer": "^4.0.5",+ "@types/cacheable-request": "^6.0.1",+ "@types/responselike": "^1.0.0",+ "cacheable-lookup": "^5.0.3",+ "cacheable-request": "^7.0.2",+ "decompress-response": "^6.0.0",+ "http2-wrapper": "^1.0.0-beta.5.2",+ "lowercase-keys": "^2.0.0",+ "p-cancelable": "^2.0.0",+ "responselike": "^2.0.0"+ },+ "engines": {+ "node": ">=10.19.0"+ },+ "funding": {+ "url": "https://github.com/sindresorhus/got?sponsor=1"+ }+ },+ "node_modules/graceful-fs": {+ "version": "4.2.11",+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",+ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/has-flag": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/has-property-descriptors": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz",+ "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "es-define-property": "^1.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/has-symbols": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",+ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/has-tostringtag": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",+ "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",+ "license": "MIT",+ "dependencies": {+ "has-symbols": "^1.0.3"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/hasown": {+ "version": "2.0.4",+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz",+ "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==",+ "license": "MIT",+ "dependencies": {+ "function-bind": "^1.1.2"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/hosted-git-info": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz",+ "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "lru-cache": "^6.0.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/htm": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/htm/-/htm-3.1.1.tgz",+ "integrity": "sha512-983Vyg8NwUE7JkZ6NmOqpCZ+sh1bKv2iYTlUkzlWmA5JD2acKoxd4KVxbMmxX/85mtfdnDmTFoNKcg5DGAvxNQ==",+ "license": "Apache-2.0"+ },+ "node_modules/http-cache-semantics": {+ "version": "4.3.0",+ "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.3.0.tgz",+ "integrity": "sha512-M5t5LlJpS1UHMjvwRQVdFHvPISGeLAxNcrWuJkeGh0KxsqCHZ1O3NXZU/8x7cD0BDcGW8kapxMKTvwlqrNkHkA==",+ "dev": true,+ "license": "BSD-2-Clause"+ },+ "node_modules/http-proxy-agent": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",+ "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "agent-base": "^7.1.0",+ "debug": "^4.3.4"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/http-proxy-agent/node_modules/agent-base": {+ "version": "7.1.4",+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",+ "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 14"+ }+ },+ "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": {+ "quick-lru": "^5.1.1",+ "resolve-alpn": "^1.0.0"+ },+ "engines": {+ "node": ">=10.19.0"+ }+ },+ "node_modules/https-proxy-agent": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",+ "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",+ "license": "MIT",+ "dependencies": {+ "agent-base": "6",+ "debug": "4"+ },+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/inflight": {+ "version": "1.0.6",+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",+ "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",+ "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "once": "^1.3.0",+ "wrappy": "1"+ }+ },+ "node_modules/inherits": {+ "version": "2.0.4",+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/is-fullwidth-code-point": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "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/isbinaryfile": {+ "version": "5.0.7",+ "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-5.0.7.tgz",+ "integrity": "sha512-gnWD14Jh3FzS3CPhF0AxNOJ8CxqeblPTADzI38r0wt8ZyQl5edpy75myt08EG2oKvpyiqSqsx+Wkz9vtkbTqYQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 18.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/gjtorikian/"+ }+ },+ "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/jake": {+ "version": "10.9.4",+ "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.4.tgz",+ "integrity": "sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "async": "^3.2.6",+ "filelist": "^1.0.4",+ "picocolors": "^1.1.1"+ },+ "bin": {+ "jake": "bin/cli.js"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/jiti": {+ "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/js-yaml": {+ "version": "4.3.2",+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz",+ "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/puzrin"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/nodeca"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "argparse": "^2.0.1"+ },+ "bin": {+ "js-yaml": "bin/js-yaml.js"+ }+ },+ "node_modules/json-buffer": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",+ "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",+ "dev": true,+ "license": "MIT"+ },+ "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/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+ },+ "node_modules/json5": {+ "version": "2.2.3",+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",+ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "json5": "lib/cli.js"+ },+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/jsonfile": {+ "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"+ }+ },+ "node_modules/keyv": {+ "version": "4.5.4",+ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",+ "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "json-buffer": "3.0.1"+ }+ },+ "node_modules/lazy-val": {+ "version": "1.0.5",+ "resolved": "https://registry.npmjs.org/lazy-val/-/lazy-val-1.0.5.tgz",+ "integrity": "sha512-0/BnGCCfyUMkBpeDgWihanIAF9JmZhHBgUhEqzvf+adhNGLoP6TaiI5oF8oyb3I45P+PcnrqihSf01M0l0G5+Q==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/lightningcss": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz",+ "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==",+ "dev": true,+ "license": "MPL-2.0",+ "peer": true,+ "dependencies": {+ "detect-libc": "^2.0.3"+ },+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ },+ "optionalDependencies": {+ "lightningcss-android-arm64": "1.33.0",+ "lightningcss-darwin-arm64": "1.33.0",+ "lightningcss-darwin-x64": "1.33.0",+ "lightningcss-freebsd-x64": "1.33.0",+ "lightningcss-linux-arm-gnueabihf": "1.33.0",+ "lightningcss-linux-arm64-gnu": "1.33.0",+ "lightningcss-linux-arm64-musl": "1.33.0",+ "lightningcss-linux-x64-gnu": "1.33.0",+ "lightningcss-linux-x64-musl": "1.33.0",+ "lightningcss-win32-arm64-msvc": "1.33.0",+ "lightningcss-win32-x64-msvc": "1.33.0"+ }+ },+ "node_modules/lightningcss-android-arm64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz",+ "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "android"+ ],+ "peer": true,+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-darwin-arm64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz",+ "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "peer": true,+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-darwin-x64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz",+ "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "peer": true,+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-freebsd-x64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz",+ "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "peer": true,+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm-gnueabihf": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz",+ "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "peer": true,+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm64-gnu": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz",+ "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "peer": true,+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm64-musl": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz",+ "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "peer": true,+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-x64-gnu": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz",+ "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "peer": true,+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-x64-musl": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz",+ "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "peer": true,+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-win32-arm64-msvc": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz",+ "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "peer": true,+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-win32-x64-msvc": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz",+ "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "peer": true,+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/locate-path": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",+ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",+ "license": "MIT",+ "dependencies": {+ "p-locate": "^4.1.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/lodash": {+ "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"+ },+ "node_modules/lodash.identity": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/lodash.identity/-/lodash.identity-3.0.0.tgz",+ "integrity": "sha512-AupTIzdLQxJS5wIYUQlgGyk2XRTfGXA+MCghDHqZk0pzUNYvd3EESS6dkChNauNYVIutcb0dfHw1ri9Q1yPV8Q==",+ "license": "MIT"+ },+ "node_modules/lodash.merge": {+ "version": "4.6.2",+ "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",+ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",+ "license": "MIT"+ },+ "node_modules/lodash.pickby": {+ "version": "4.6.0",+ "resolved": "https://registry.npmjs.org/lodash.pickby/-/lodash.pickby-4.6.0.tgz",+ "integrity": "sha512-AZV+GsS/6ckvPOVQPXSiFFacKvKB4kOQu6ynt9wz0F3LO4R9Ij4K1ddYsIytDpSgLz88JHd9P+oaLeej5/Sl7Q==",+ "license": "MIT"+ },+ "node_modules/long": {+ "version": "5.3.2",+ "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz",+ "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==",+ "license": "Apache-2.0"+ },+ "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": {+ "node": ">=8"+ }+ },+ "node_modules/lru-cache": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "yallist": "^4.0.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/magic-string": {+ "version": "1.4.5",+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz",+ "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/sourcemap-codec": "^1.6.0"+ }+ },+ "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,+ "dependencies": {+ "escape-string-regexp": "^4.0.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/math-intrinsics": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",+ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/mime": {+ "version": "2.6.0",+ "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz",+ "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "mime": "cli.js"+ },+ "engines": {+ "node": ">=4.0.0"+ }+ },+ "node_modules/mime-db": {+ "version": "1.52.0",+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/mime-types": {+ "version": "2.1.35",+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",+ "license": "MIT",+ "dependencies": {+ "mime-db": "1.52.0"+ },+ "engines": {+ "node": ">= 0.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": {+ "node": ">=4"+ }+ },+ "node_modules/minimatch": {+ "version": "10.2.6",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",+ "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",+ "dev": true,+ "license": "BlueOak-1.0.0",+ "dependencies": {+ "brace-expansion": "^5.0.8"+ },+ "engines": {+ "node": "18 || 20 || >=22"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/minimist": {+ "version": "1.2.8",+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",+ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",+ "dev": true,+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/minipass": {+ "version": "7.1.3",+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz",+ "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==",+ "dev": true,+ "license": "BlueOak-1.0.0",+ "engines": {+ "node": ">=16 || 14 >=14.17"+ }+ },+ "node_modules/minizlib": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.1.0.tgz",+ "integrity": "sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "minipass": "^7.1.2"+ },+ "engines": {+ "node": ">= 18"+ }+ },+ "node_modules/mkdirp": {+ "version": "0.5.6",+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",+ "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "minimist": "^1.2.6"+ },+ "bin": {+ "mkdirp": "bin/cmd.js"+ }+ },+ "node_modules/ms": {+ "version": "2.1.3",+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",+ "license": "MIT"+ },+ "node_modules/nanoid": {+ "version": "3.3.20",+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",+ "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "peer": true,+ "bin": {+ "nanoid": "bin/nanoid.cjs"+ },+ "engines": {+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"+ }+ },+ "node_modules/node-abi": {+ "version": "4.40.0",+ "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-4.40.0.tgz",+ "integrity": "sha512-GuvqvtrOk+AC27RidBxBsMzVNkwNl7PjHgc4NXbmdvSVLgIUjpaqcG1FjNRYnt2Yn9Ytq+Ln37XsBaglUcte/w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "semver": "^7.6.3"+ },+ "engines": {+ "node": ">=22.12.0"+ }+ },+ "node_modules/node-api-version": {+ "version": "0.2.1",+ "resolved": "https://registry.npmjs.org/node-api-version/-/node-api-version-0.2.1.tgz",+ "integrity": "sha512-2xP/IGGMmmSQpI1+O/k72jF/ykvZ89JeuKX3TLJAYPDVLUalrshrLHkeVcCCZqG/eEa635cr8IBYzgnDvM2O8Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "semver": "^7.3.5"+ }+ },+ "node_modules/node-gyp": {+ "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",+ "nopt": "^9.0.0",+ "proc-log": "^6.0.0",+ "semver": "^7.3.5",+ "tar": "^7.5.4",+ "tinyglobby": "^0.2.12",+ "undici": "^6.25.0",+ "which": "^6.0.0"+ },+ "bin": {+ "node-gyp": "bin/node-gyp.js"+ },+ "engines": {+ "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": "4.0.0",+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-4.0.0.tgz",+ "integrity": "sha512-FFUtZMpoZ8RqHS3XeXEmHWLA4thH+ZxCv2lOiPIn1Xc7CxrqhWzNSDzD+/chS/zbYezmiwWLdQC09JdQKmthOw==",+ "dev": true,+ "license": "BlueOak-1.0.0",+ "engines": {+ "node": ">=20"+ }+ },+ "node_modules/node-gyp/node_modules/undici": {+ "version": "6.29.1",+ "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.1.tgz",+ "integrity": "sha512-EvRlUt/QqAEvXdQeRMYUfwOQsfzpDztykrG2owGEE/rBOBoYv9uF39ZzsNDh4lTFHhTr2XOZjKkYgueD12ZmGA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18.17"+ }+ },+ "node_modules/node-gyp/node_modules/which": {+ "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": "^4.0.0"+ },+ "bin": {+ "node-which": "bin/which.js"+ },+ "engines": {+ "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/nopt": {+ "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": "^4.0.0"+ },+ "bin": {+ "nopt": "bin/nopt.js"+ },+ "engines": {+ "node": "^20.17.0 || >=22.9.0"+ }+ },+ "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": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/object-inspect": {+ "version": "1.13.4",+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",+ "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/object-keys": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",+ "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/obug": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/obug/-/obug-3.0.0.tgz",+ "integrity": "sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==",+ "dev": true,+ "funding": [+ "https://github.com/sponsors/sxzz",+ "https://opencollective.com/debug"+ ],+ "license": "MIT",+ "engines": {+ "node": ">=12.20.0"+ }+ },+ "node_modules/once": {+ "version": "1.4.0",+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "wrappy": "1"+ }+ },+ "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": {+ "node": ">=8"+ }+ },+ "node_modules/p-limit": {+ "version": "2.3.0",+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",+ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",+ "license": "MIT",+ "dependencies": {+ "p-try": "^2.0.0"+ },+ "engines": {+ "node": ">=6"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/p-locate": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",+ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",+ "license": "MIT",+ "dependencies": {+ "p-limit": "^2.2.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/p-try": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",+ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/path-exists": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/path-is-absolute": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",+ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/path-key": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/pe-library": {+ "version": "0.4.1",+ "resolved": "https://registry.npmjs.org/pe-library/-/pe-library-0.4.1.tgz",+ "integrity": "sha512-eRWB5LBz7PpDu4PUlwT0PhnQfTQJlDDdPa35urV4Osrm0t0AqQFGn+UIkU3klZvwJ8KPO3VbBFsXquA6p6kqZw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12",+ "npm": ">=6"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/jet2jet"+ }+ },+ "node_modules/picocolors": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/picomatch": {+ "version": "4.0.7",+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz",+ "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/sponsors/jonschlinkert"+ }+ },+ "node_modules/pkijs": {+ "version": "3.4.3",+ "resolved": "https://registry.npmjs.org/pkijs/-/pkijs-3.4.3.tgz",+ "integrity": "sha512-V9kOzaItwDgqlryhXysQsAXUEKi5O7kqWUaP3dXI7MLvkPqWWMb4wVb1QAtmEDCKI+XIAINsZoNKMFF7sZb1eg==",+ "dev": true,+ "license": "BSD-3-Clause",+ "workspaces": [+ "website"+ ],+ "dependencies": {+ "@noble/hashes": "1.8.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/plist": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/plist/-/plist-3.1.0.tgz",+ "integrity": "sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@xmldom/xmldom": "^0.8.8",+ "base64-js": "^1.5.1",+ "xmlbuilder": "^15.1.1"+ },+ "engines": {+ "node": ">=10.4.0"+ }+ },+ "node_modules/pngjs": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz",+ "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==",+ "license": "MIT",+ "engines": {+ "node": ">=10.13.0"+ }+ },+ "node_modules/postcss": {+ "version": "8.5.32",+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.32.tgz",+ "integrity": "sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/postcss/"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/postcss"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "nanoid": "^3.3.20",+ "picocolors": "^1.1.1",+ "source-map-js": "^1.2.2"+ },+ "engines": {+ "node": "^10 || ^12 || >=14"+ }+ },+ "node_modules/postject": {+ "version": "1.0.0-alpha.6",+ "resolved": "https://registry.npmjs.org/postject/-/postject-1.0.0-alpha.6.tgz",+ "integrity": "sha512-b9Eb8h2eVqNE8edvKdwqkrY6O7kAwmI8kcnBv1NScolYJbo59XUF0noFq+lxbC1yN20bmC0WBEbDC5H/7ASb0A==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "peer": true,+ "dependencies": {+ "commander": "^9.4.0"+ },+ "bin": {+ "postject": "dist/cli.js"+ },+ "engines": {+ "node": ">=14.0.0"+ }+ },+ "node_modules/postject/node_modules/commander": {+ "version": "9.5.0",+ "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz",+ "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "peer": true,+ "engines": {+ "node": "^12.20.0 || >=14"+ }+ },+ "node_modules/preact": {+ "version": "11.0.2",+ "resolved": "https://registry.npmjs.org/preact/-/preact-11.0.2.tgz",+ "integrity": "sha512-ofG+Lqznbt13JKDjdWPLTo5ONBqcNgidqnLRzJBG6PZjzGXOLRd5y9r448+HUofTyDbgKWVrPhHP0IgcxEZslQ==",+ "license": "MIT",+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/preact"+ },+ "peerDependencies": {+ "preact-render-to-string": ">=6.7.0"+ },+ "peerDependenciesMeta": {+ "preact-render-to-string": {+ "optional": true+ }+ }+ },+ "node_modules/proc-log": {+ "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": "^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": {+ "node": ">=0.4.0"+ }+ },+ "node_modules/promise-retry": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz",+ "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "err-code": "^2.0.2",+ "retry": "^0.12.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "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/protobufjs": {+ "version": "7.6.6",+ "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.6.6.tgz",+ "integrity": "sha512-dYDWdjSl5RNb7SgPxGQcRU+GtvP7s2fpkrY0r432PcOIaZ0/rBcxEZnQN67iJhFuQiVw754JDoPruPCNdGsbjg==",+ "hasInstallScript": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "@protobufjs/aspromise": "^1.1.2",+ "@protobufjs/base64": "^1.1.2",+ "@protobufjs/codegen": "^2.0.5",+ "@protobufjs/eventemitter": "^1.1.1",+ "@protobufjs/fetch": "^1.1.1",+ "@protobufjs/float": "^1.0.2",+ "@protobufjs/path": "^1.1.2",+ "@protobufjs/pool": "^1.1.0",+ "@protobufjs/utf8": "^1.1.1",+ "@types/node": ">=13.7.0",+ "long": "^5.3.2"+ },+ "engines": {+ "node": ">=12.0.0"+ }+ },+ "node_modules/proxy-from-env": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz",+ "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==",+ "license": "MIT",+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/pump": {+ "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": {+ "end-of-stream": "^1.1.0",+ "once": "^1.3.1"+ }+ },+ "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.2.0",+ "resolved": "https://registry.npmjs.org/pvutils/-/pvutils-1.2.0.tgz",+ "integrity": "sha512-BbubeCEyTuQjVMakvJQ/Sxbc93F2pwmbsxONT/ZRrwU7Ua38d8unYTwXpTVLAKJ4BDuH9IGztCjQcd/N/39Dvg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=16.0.0"+ }+ },+ "node_modules/qrcode": {+ "version": "1.5.4",+ "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.4.tgz",+ "integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==",+ "license": "MIT",+ "dependencies": {+ "dijkstrajs": "^1.0.1",+ "pngjs": "^5.0.0",+ "yargs": "^15.3.1"+ },+ "bin": {+ "qrcode": "bin/qrcode"+ },+ "engines": {+ "node": ">=10.13.0"+ }+ },+ "node_modules/qrcode-terminal": {+ "version": "0.12.0",+ "resolved": "https://registry.npmjs.org/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz",+ "integrity": "sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ==",+ "bin": {+ "qrcode-terminal": "bin/qrcode-terminal.js"+ }+ },+ "node_modules/qs": {+ "version": "6.17.0",+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.17.0.tgz",+ "integrity": "sha512-5LK5BZ2XDHMvcUJaf0CQ5HL3aVgKbpklvByC7qLSxYkfE8COEEbJg5xCHWCTqzqi0Gs4Jn5Mv5v3R38W6edscA==",+ "license": "BSD-3-Clause",+ "dependencies": {+ "es-define-property": "^1.0.1",+ "side-channel": "^1.1.1"+ },+ "engines": {+ "node": ">=0.6"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "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": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/read-binary-file-arch": {+ "version": "1.0.6",+ "resolved": "https://registry.npmjs.org/read-binary-file-arch/-/read-binary-file-arch-1.0.6.tgz",+ "integrity": "sha512-BNg9EN3DD3GsDXX7Aa8O4p92sryjkmzYYgmgTAc6CA4uGLEDzFfxOxugu21akOxpcXHiEgsYkC6nPsQvLLLmEg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "debug": "^4.3.4"+ },+ "bin": {+ "read-binary-file-arch": "cli.js"+ }+ },+ "node_modules/readable-stream": {+ "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": {+ "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/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==",+ "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": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/require-main-filename": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",+ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",+ "license": "ISC"+ },+ "node_modules/resedit": {+ "version": "1.7.2",+ "resolved": "https://registry.npmjs.org/resedit/-/resedit-1.7.2.tgz",+ "integrity": "sha512-vHjcY2MlAITJhC0eRD/Vv8Vlgmu9Sd3LX9zZvtGzU5ZImdTN3+d6e/4mnTyV8vEbyf1sgNIrWxhWlrys52OkEA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "pe-library": "^0.4.1"+ },+ "engines": {+ "node": ">=12",+ "npm": ">=6"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/jet2jet"+ }+ },+ "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"+ },+ "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": {+ "lowercase-keys": "^2.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/retry": {+ "version": "0.12.0",+ "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz",+ "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 4"+ }+ },+ "node_modules/rimraf": {+ "version": "2.6.3",+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",+ "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",+ "deprecated": "Rimraf versions prior to v4 are no longer supported",+ "dev": true,+ "license": "ISC",+ "peer": true,+ "dependencies": {+ "glob": "^7.1.3"+ },+ "bin": {+ "rimraf": "bin.js"+ }+ },+ "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,+ "dependencies": {+ "boolean": "^3.0.1",+ "detect-node": "^2.0.4",+ "globalthis": "^1.0.1",+ "json-stringify-safe": "^5.0.1",+ "semver-compare": "^1.0.0",+ "sprintf-js": "^1.1.2"+ },+ "engines": {+ "node": ">=8.0"+ }+ },+ "node_modules/rolldown": {+ "version": "1.2.15",+ "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.15.tgz",+ "integrity": "sha512-6odND+fel5zVw3I4Yc2e69gvguDnX0CAAGiNDZSq4ik5WUcaLrkD2GLuog0XcODbor31hZ5ayEMgVDno+KPV5g==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@oxc-project/types": "=0.155.0",+ "@rolldown/pluginutils": "^1.0.0"+ },+ "bin": {+ "rolldown": "bin/cli.mjs"+ },+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ },+ "optionalDependencies": {+ "@rolldown/binding-android-arm-eabi": "1.2.15",+ "@rolldown/binding-android-arm64": "1.2.15",+ "@rolldown/binding-darwin-arm64": "1.2.15",+ "@rolldown/binding-darwin-x64": "1.2.15",+ "@rolldown/binding-freebsd-x64": "1.2.15",+ "@rolldown/binding-linux-arm-gnueabihf": "1.2.15",+ "@rolldown/binding-linux-arm64-gnu": "1.2.15",+ "@rolldown/binding-linux-arm64-musl": "1.2.15",+ "@rolldown/binding-linux-ppc64-gnu": "1.2.15",+ "@rolldown/binding-linux-s390x-gnu": "1.2.15",+ "@rolldown/binding-linux-x64-gnu": "1.2.15",+ "@rolldown/binding-linux-x64-musl": "1.2.15",+ "@rolldown/binding-openharmony-arm64": "1.2.15",+ "@rolldown/binding-win32-arm64-msvc": "1.2.15",+ "@rolldown/binding-win32-x64-msvc": "1.2.15"+ }+ },+ "node_modules/safe-buffer": {+ "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,+ "license": "MIT"+ },+ "node_modules/sanitize-filename": {+ "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": {+ "truncate-utf8-bytes": "^1.0.0"+ }+ },+ "node_modules/sax": {+ "version": "1.6.1",+ "resolved": "https://registry.npmjs.org/sax/-/sax-1.6.1.tgz",+ "integrity": "sha512-42tBVwLWnaQvW5zc4HbZrTuWccECCZfBi92FDuwtqxasH+JbPB3/FOKb1m222K42R4WxuxzzMsTswfzgtSu64Q==",+ "dev": true,+ "license": "BlueOak-1.0.0",+ "engines": {+ "node": ">=11.0.0"+ }+ },+ "node_modules/semver": {+ "version": "7.8.5",+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",+ "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",+ "dev": true,+ "license": "ISC",+ "bin": {+ "semver": "bin/semver.js"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "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+ },+ "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,+ "dependencies": {+ "type-fest": "^0.13.1"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/set-blocking": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",+ "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",+ "license": "ISC"+ },+ "node_modules/shebang-command": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "shebang-regex": "^3.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/shebang-regex": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/side-channel": {+ "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.4",+ "side-channel-list": "^1.0.1",+ "side-channel-map": "^1.0.1",+ "side-channel-weakmap": "^1.0.2"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/side-channel-list": {+ "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.4"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/side-channel-map": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",+ "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",+ "license": "MIT",+ "dependencies": {+ "call-bound": "^1.0.2",+ "es-errors": "^1.3.0",+ "get-intrinsic": "^1.2.5",+ "object-inspect": "^1.13.3"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/side-channel-weakmap": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",+ "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",+ "license": "MIT",+ "dependencies": {+ "call-bound": "^1.0.2",+ "es-errors": "^1.3.0",+ "get-intrinsic": "^1.2.5",+ "object-inspect": "^1.13.3",+ "side-channel-map": "^1.0.1"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "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/simple-update-notifier": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz",+ "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "semver": "^7.5.3"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/source-map": {+ "version": "0.6.1",+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",+ "dev": true,+ "license": "BSD-3-Clause",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/source-map-js": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz",+ "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==",+ "dev": true,+ "license": "BSD-3-Clause",+ "peer": true,+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/source-map-support": {+ "version": "0.5.21",+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",+ "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "buffer-from": "^1.0.0",+ "source-map": "^0.6.0"+ }+ },+ "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/stat-mode": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/stat-mode/-/stat-mode-1.0.0.tgz",+ "integrity": "sha512-jH9EhtKIjuXZ2cWxmXS8ZP80XyC3iasQxMDV8jzhNJpfDb7VbQLVW4Wvsxz9QZvzV+G4YoSfBUVKDOyxLzi/sg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/std-env": {+ "version": "4.3.0",+ "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz",+ "integrity": "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/string_decoder": {+ "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.1.0"+ }+ },+ "node_modules/string-width": {+ "version": "4.2.3",+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",+ "license": "MIT",+ "dependencies": {+ "emoji-regex": "^8.0.0",+ "is-fullwidth-code-point": "^3.0.0",+ "strip-ansi": "^6.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/strip-ansi": {+ "version": "6.0.1",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",+ "license": "MIT",+ "dependencies": {+ "ansi-regex": "^5.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "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": {+ "debug": "^4.1.0"+ },+ "engines": {+ "node": ">= 8.0"+ }+ },+ "node_modules/supports-color": {+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "has-flag": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/tar": {+ "version": "7.5.22",+ "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.22.tgz",+ "integrity": "sha512-MFO/QzvtAOmJbkhOaCTvbGcFN9L9b+JunIsDwaKljSOdcLMea3NJ1k9Usz/rjdfSXTq4dfzfeS7W4p4YOAAHeA==",+ "dev": true,+ "license": "BlueOak-1.0.0",+ "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"+ }+ },+ "node_modules/tar/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/temp": {+ "version": "0.9.4",+ "resolved": "https://registry.npmjs.org/temp/-/temp-0.9.4.tgz",+ "integrity": "sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "mkdirp": "^0.5.1",+ "rimraf": "~2.6.2"+ },+ "engines": {+ "node": ">=6.0.0"+ }+ },+ "node_modules/temp-file": {+ "version": "3.4.0",+ "resolved": "https://registry.npmjs.org/temp-file/-/temp-file-3.4.0.tgz",+ "integrity": "sha512-C5tjlC/HCtVUOi3KWVokd4vHVViOmGjtLwIh4MuzPo/nMYTV/p1urt3RnMz2IWXDdKEGJH3k5+KPxtqRsUYGtg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "async-exit-hook": "^2.0.1",+ "fs-extra": "^10.0.0"+ }+ },+ "node_modules/tiny-async-pool": {+ "version": "1.3.0",+ "resolved": "https://registry.npmjs.org/tiny-async-pool/-/tiny-async-pool-1.3.0.tgz",+ "integrity": "sha512-01EAw5EDrcVrdgyCLgoSPvqznC0sVxDSVeiOz09FUpjh71G79VCqneOr+xvt7T1r76CF6ZZfPjHorN2+d+3mqA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "semver": "^5.5.0"+ }+ },+ "node_modules/tiny-async-pool/node_modules/semver": {+ "version": "5.7.2",+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",+ "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",+ "dev": true,+ "license": "ISC",+ "bin": {+ "semver": "bin/semver"+ }+ },+ "node_modules/tinybench": {+ "version": "6.2.2",+ "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.2.tgz",+ "integrity": "sha512-nIZ2N2dFpjBsg2hgitKu7mA+FvsIJuGJOwysRngmVRRmWgR/UyPjwJj8c/fT/dhm8EkHnF5EOogRf+0Z2qrimA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/tinyexec": {+ "version": "1.3.1",+ "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz",+ "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/tinyglobby": {+ "version": "0.2.17",+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",+ "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fdir": "^6.5.0",+ "picomatch": "^4.0.4"+ },+ "engines": {+ "node": ">=12.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/SuperchupuDev"+ }+ },+ "node_modules/tmp": {+ "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": {+ "node": ">=14.14"+ }+ },+ "node_modules/tmp-promise": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-3.0.3.tgz",+ "integrity": "sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "tmp": "^0.2.0"+ }+ },+ "node_modules/truncate-utf8-bytes": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz",+ "integrity": "sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==",+ "dev": true,+ "license": "WTFPL",+ "dependencies": {+ "utf8-byte-length": "^1.0.1"+ }+ },+ "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/tsx": {+ "version": "4.23.15",+ "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.15.tgz",+ "integrity": "sha512-Yiex1Ovn8z2xPpOWckIiysV1SSyRMY9BkLF++q0yKiDxCqRhosKfMg3janKkiLBwZ5c/YryloKwGZcrEmtwxKw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "esbuild": "~0.28.0"+ },+ "bin": {+ "tsx": "dist/cli.mjs"+ },+ "engines": {+ "node": ">=18.0.0"+ },+ "optionalDependencies": {+ "fsevents": "~2.3.3"+ }+ },+ "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,+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/typescript": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz",+ "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==",+ "dev": true,+ "license": "Apache-2.0",+ "bin": {+ "tsc": "bin/tsc"+ },+ "engines": {+ "node": ">=16.20.0"+ },+ "optionalDependencies": {+ "@typescript/typescript-aix-ppc64": "7.0.2",+ "@typescript/typescript-darwin-arm64": "7.0.2",+ "@typescript/typescript-darwin-x64": "7.0.2",+ "@typescript/typescript-freebsd-arm64": "7.0.2",+ "@typescript/typescript-freebsd-x64": "7.0.2",+ "@typescript/typescript-linux-arm": "7.0.2",+ "@typescript/typescript-linux-arm64": "7.0.2",+ "@typescript/typescript-linux-loong64": "7.0.2",+ "@typescript/typescript-linux-mips64el": "7.0.2",+ "@typescript/typescript-linux-ppc64": "7.0.2",+ "@typescript/typescript-linux-riscv64": "7.0.2",+ "@typescript/typescript-linux-s390x": "7.0.2",+ "@typescript/typescript-linux-x64": "7.0.2",+ "@typescript/typescript-netbsd-arm64": "7.0.2",+ "@typescript/typescript-netbsd-x64": "7.0.2",+ "@typescript/typescript-openbsd-arm64": "7.0.2",+ "@typescript/typescript-openbsd-x64": "7.0.2",+ "@typescript/typescript-sunos-x64": "7.0.2",+ "@typescript/typescript-win32-arm64": "7.0.2",+ "@typescript/typescript-win32-x64": "7.0.2"+ }+ },+ "node_modules/undici": {+ "version": "7.30.1",+ "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.1.tgz",+ "integrity": "sha512-03KrMbjIFDWQR5RNPrSw3bd1r12JpyFQl9/yxjUbJtqkjmllqC5lFjZh6ujeuJCKr8EOQvRW872Oy/az+nLYxg==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "engines": {+ "node": ">=20.18.1"+ }+ },+ "node_modules/undici-types": {+ "version": "6.21.0",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",+ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",+ "license": "MIT"+ },+ "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/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/utf8-byte-length": {+ "version": "1.0.5",+ "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.5.tgz",+ "integrity": "sha512-Xn0w3MtiQ6zoz2vFyUVruaCL53O/DwUvkEeOvj+uulMm0BkUGYWmBYVyElqZaSLhY6ZD0ulfU3aBra2aVT4xfA==",+ "dev": true,+ "license": "(WTFPL OR MIT)"+ },+ "node_modules/util-deprecate": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",+ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/vite": {+ "version": "8.3.5",+ "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.5.tgz",+ "integrity": "sha512-z1YpjieJ9g0ebTmQpLBv/oq9E3F9EIlOe+7LahW8SrE3LTiG3udBRUXQOlYXP9b+IC2q2phHeVxj9xGlw34OEQ==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "lightningcss": "^1.33.0",+ "picomatch": "^4.0.7",+ "postcss": "^8.5.30",+ "rolldown": "~1.2.14",+ "tinyglobby": "^0.2.17"+ },+ "bin": {+ "vite": "bin/vite.js"+ },+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ },+ "funding": {+ "url": "https://github.com/vitejs/vite?sponsor=1"+ },+ "optionalDependencies": {+ "fsevents": "~2.3.3"+ },+ "peerDependencies": {+ "@types/node": "^20.19.0 || >=22.12.0",+ "@vitejs/devtools": "^0.7.1 || ^0.8.0",+ "esbuild": "^0.27.0 || ^0.28.0",+ "jiti": ">=1.21.0",+ "less": "^4.0.0",+ "sass": "^1.70.0",+ "sass-embedded": "^1.70.0",+ "stylus": ">=0.54.8",+ "sugarss": "^5.0.0",+ "terser": "^5.16.0",+ "tsx": "^4.8.1",+ "yaml": "^2.4.2"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ },+ "@vitejs/devtools": {+ "optional": true+ },+ "esbuild": {+ "optional": true+ },+ "jiti": {+ "optional": true+ },+ "less": {+ "optional": true+ },+ "sass": {+ "optional": true+ },+ "sass-embedded": {+ "optional": true+ },+ "stylus": {+ "optional": true+ },+ "sugarss": {+ "optional": true+ },+ "terser": {+ "optional": true+ },+ "tsx": {+ "optional": true+ },+ "yaml": {+ "optional": true+ }+ }+ },+ "node_modules/vitest": {+ "version": "5.0.5",+ "resolved": "https://registry.npmjs.org/vitest/-/vitest-5.0.5.tgz",+ "integrity": "sha512-cPODOMF8YnkiiYtDdHo6n4wWmBrOBBbOIYH2d33M4l3CdNn72h+qMmO6uXffUN6A5AZFXNND/d+krS9mgkXRfg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/chai": "^5.2.2",+ "@vitest/mocker": "5.0.5",+ "chai": "^6.3.0",+ "es-module-lexer": "^2.3.2",+ "expect-type": "^1.4.0",+ "magic-string": "^1.4.3",+ "obug": "^3.0.0",+ "picomatch": "^4.0.7",+ "std-env": "^4.3.0",+ "tinybench": "^6.2.2",+ "tinyexec": "^1.3.1",+ "tinyglobby": "^0.2.17",+ "why-is-node-running": "3.2.1"+ },+ "bin": {+ "vitest": "vitest.mjs"+ },+ "engines": {+ "node": "^22.12.0 || ^24.0.0 || >=26.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/vitest"+ },+ "peerDependencies": {+ "@edge-runtime/vm": "*",+ "@opentelemetry/api": "^1.9.0",+ "@types/node": "^22.0.0 || >=24.0.0",+ "@vitest/browser-playwright": "5.0.5",+ "@vitest/browser-preview": "5.0.5",+ "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0",+ "@vitest/coverage-istanbul": "5.0.5",+ "@vitest/coverage-v8": "5.0.5",+ "@vitest/ui": "5.0.5",+ "happy-dom": "*",+ "jsdom": "*",+ "vite": "^6.4.0 || ^7.0.0 || ^8.0.0"+ },+ "peerDependenciesMeta": {+ "@edge-runtime/vm": {+ "optional": true+ },+ "@opentelemetry/api": {+ "optional": true+ },+ "@types/node": {+ "optional": true+ },+ "@vitest/browser-playwright": {+ "optional": true+ },+ "@vitest/browser-preview": {+ "optional": true+ },+ "@vitest/browser-webdriverio": {+ "optional": true+ },+ "@vitest/coverage-istanbul": {+ "optional": true+ },+ "@vitest/coverage-v8": {+ "optional": true+ },+ "@vitest/ui": {+ "optional": true+ },+ "happy-dom": {+ "optional": true+ },+ "jsdom": {+ "optional": true+ },+ "vite": {+ "optional": false+ }+ }+ },+ "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": {+ "@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": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/which/-/which-5.0.0.tgz",+ "integrity": "sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "isexe": "^3.1.1"+ },+ "bin": {+ "node-which": "bin/which.js"+ },+ "engines": {+ "node": "^18.17.0 || >=20.5.0"+ }+ },+ "node_modules/which-module": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz",+ "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",+ "license": "ISC"+ },+ "node_modules/why-is-node-running": {+ "version": "3.2.1",+ "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-3.2.1.tgz",+ "integrity": "sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "why-is-node-running": "cli.js"+ },+ "engines": {+ "node": ">=20.11"+ }+ },+ "node_modules/wrap-ansi": {+ "version": "6.2.0",+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",+ "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",+ "license": "MIT",+ "dependencies": {+ "ansi-styles": "^4.0.0",+ "string-width": "^4.1.0",+ "strip-ansi": "^6.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/wrappy": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/ws": {+ "version": "8.22.0",+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.22.0.tgz",+ "integrity": "sha512-Ydggc987+RO0AnWtZ/7Wq9FtNvcrL1b/RO0ud9mWjUPgDrsAAwQSF51sm2hm1XofbU/4jkpGEsLFsZZxU+1DOg==",+ "license": "MIT",+ "engines": {+ "node": ">=10.0.0"+ },+ "peerDependencies": {+ "bufferutil": "^4.0.1",+ "utf-8-validate": ">=5.0.2"+ },+ "peerDependenciesMeta": {+ "bufferutil": {+ "optional": true+ },+ "utf-8-validate": {+ "optional": true+ }+ }+ },+ "node_modules/xmlbuilder": {+ "version": "15.1.1",+ "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz",+ "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8.0"+ }+ },+ "node_modules/y18n": {+ "version": "4.0.3",+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",+ "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",+ "license": "ISC"+ },+ "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/yargs": {+ "version": "15.4.1",+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",+ "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",+ "license": "MIT",+ "dependencies": {+ "cliui": "^6.0.0",+ "decamelize": "^1.2.0",+ "find-up": "^4.1.0",+ "get-caller-file": "^2.0.1",+ "require-directory": "^2.1.1",+ "require-main-filename": "^2.0.0",+ "set-blocking": "^2.0.0",+ "string-width": "^4.2.0",+ "which-module": "^2.0.0",+ "y18n": "^4.0.0",+ "yargs-parser": "^18.1.2"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/yargs-parser": {+ "version": "18.1.3",+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",+ "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",+ "license": "ISC",+ "dependencies": {+ "camelcase": "^5.0.0",+ "decamelize": "^1.2.0"+ },+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/yocto-queue": {+ "version": "0.1.0",+ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",+ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ }+ }+}diff --git a/package.json b/package.jsonnew file mode 100644index 0000000..d23e459--- /dev/null+++ b/package.json@@ -0,0 +1,147 @@+{+ "name": "anymodel-bot",+ "productName": "anymodel bot",+ "version": "0.1.0",+ "private": true,+ "description": "anymodel bot:任意模型的个人 AI 助手(飞书 + 微信 iLink),内置 magpie 模型网关",+ "license": "MIT",+ "type": "module",+ "main": "dist/electron/main.js",+ "engines": {+ "node": ">=22.13"+ },+ "scripts": {+ "setup": "node scripts/setup.mjs",+ "build:magpie": "node scripts/build-magpie.mjs",+ "build": "tsc -p tsconfig.build.json",+ "start": "tsx src/main.ts",+ "dev": "tsx watch src/main.ts",+ "init": "tsx src/cli/init.ts",+ "weixin:login": "tsx src/cli/weixin-login.ts",+ "typecheck": "tsc -p tsconfig.json --noEmit",+ "test": "vitest run",+ "electron:dev": "npm run build && electron .",+ "dist": "npm run build && node scripts/build-magpie.mjs --target current && electron-builder",+ "electron:smoke": "npm run build && node scripts/electron-smoke.mjs",+ "dist:linux": "npm run build && node scripts/build-magpie.mjs --target linux/amd64,linux/arm64 && electron-builder --linux",+ "dist:mac": "npm run build && node scripts/build-magpie.mjs --target darwin/amd64,darwin/arm64 && electron-builder --mac",+ "dist:win": "npm run build && node scripts/build-magpie.mjs --target windows/amd64,windows/arm64 && electron-builder --win"+ },+ "dependencies": {+ "@larksuiteoapi/node-sdk": "1.76.0",+ "htm": "^3.1.1",+ "preact": "^11.0.2",+ "qrcode": "^1.5.4",+ "qrcode-terminal": "^0.12.0"+ },+ "devDependencies": {+ "@types/node": "^22.20.5",+ "@types/qrcode": "^1.5.6",+ "@types/qrcode-terminal": "^0.12.2",+ "electron": "^45.0.0",+ "electron-builder": "^26.18.0",+ "tsx": "^4.23.15",+ "typescript": "^7.0.2",+ "vitest": "^5.0.5"+ },+ "author": {+ "name": "anymodel bot"+ },+ "build": {+ "appId": "dev.anymodel.bot",+ "productName": "anymodel bot",+ "artifactName": "anymodel-bot-${version}-${os}-${arch}.${ext}",+ "directories": {+ "output": "release",+ "buildResources": "assets"+ },+ "files": [+ "dist/**",+ "ui/**",+ "assets/**",+ "package.json",+ "!**/*.map",+ "LICENSE",+ "THIRD_PARTY_NOTICES.md"+ ],+ "asar": true,+ "mac": {+ "category": "public.app-category.productivity",+ "icon": "assets/icon.png",+ "target": [+ {+ "target": "dmg",+ "arch": [+ "x64",+ "arm64"+ ]+ },+ {+ "target": "zip",+ "arch": [+ "x64",+ "arm64"+ ]+ }+ ],+ "hardenedRuntime": true,+ "extraResources": [+ {+ "from": "build/bin/magpie-darwin-${arch}",+ "to": "magpie/magpie"+ }+ ]+ },+ "win": {+ "icon": "assets/icon.png",+ "target": [+ {+ "target": "nsis",+ "arch": [+ "x64",+ "arm64"+ ]+ }+ ],+ "extraResources": [+ {+ "from": "build/bin/magpie-win32-${arch}.exe",+ "to": "magpie/magpie.exe"+ }+ ]+ },+ "nsis": {+ "oneClick": false,+ "allowToChangeInstallationDirectory": true+ },+ "linux": {+ "icon": "assets/icon.png",+ "category": "Utility",+ "target": [+ {+ "target": "AppImage",+ "arch": [+ "x64"+ ]+ },+ {+ "target": "dir",+ "arch": [+ "x64"+ ]+ }+ ],+ "extraResources": [+ {+ "from": "build/bin/magpie-linux-${arch}",+ "to": "magpie/magpie"+ }+ ],+ "desktop": {+ "entry": {+ "StartupWMClass": "anymodel bot"+ }+ }+ }+ }+}diff --git a/scripts/build-magpie.mjs b/scripts/build-magpie.mjsnew file mode 100644index 0000000..0a85223--- /dev/null+++ b/scripts/build-magpie.mjs@@ -0,0 +1,65 @@+#!/usr/bin/env node+// 从 vendor/magpie 源码构建 magpie(无 GUI,纯 Go,CGO_ENABLED=0,可交叉编译)。+// 用法:node scripts/build-magpie.mjs [--target current|all|<goos>/<goarch>,...]+import { execFileSync } from "node:child_process";+import fs from "node:fs";+import path from "node:path";+import { fileURLToPath } from "node:url";++const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");+const src = path.join(root, "vendor", "magpie");+const out = path.join(root, "build", "bin");+const MIN_GO = [1, 26, 8];++const GOOS = { linux: "linux", darwin: "darwin", win32: "windows" };+const GOARCH = { x64: "amd64", arm64: "arm64" };+const NODE_OS = Object.fromEntries(Object.entries(GOOS).map(([k, v]) => [v, k]));+const NODE_ARCH = Object.fromEntries(Object.entries(GOARCH).map(([k, v]) => [v, k]));+const ALL = ["linux/amd64", "linux/arm64", "darwin/amd64", "darwin/arm64", "windows/amd64", "windows/arm64"];++function arg(name, d) {+ const i = process.argv.indexOf(name);+ return i >= 0 ? process.argv[i + 1] : d;+}++if (!fs.existsSync(path.join(src, "go.mod"))) {+ console.error("vendor/magpie 不存在:请先运行 git submodule update --init --depth 1 vendor/magpie");+ process.exit(1);+}+let gover;+try {+ gover = execFileSync("go", ["env", "GOVERSION"], { encoding: "utf8" }).trim();+} catch {+ console.error(`找不到 Go 工具链:请安装 Go ${MIN_GO.join(".")}+(https://go.dev/dl/)`);+ process.exit(1);+}+const v = gover.replace(/^go/, "").split(/[.-]/).map(Number);+const ok = v[0] > MIN_GO[0] || (v[0] === MIN_GO[0] && (v[1] > MIN_GO[1] || (v[1] === MIN_GO[1] && (v[2] || 0) >= MIN_GO[2])));+if (!ok) console.warn(`警告:${gover} 低于 magpie 要求的 go${MIN_GO.join(".")},Go 会尝试自动下载工具链(GOTOOLCHAIN=auto)`);++let version = "dev";+try {+ version = execFileSync("git", ["-C", src, "describe", "--tags", "--always"], { encoding: "utf8" }).trim();+} catch {}++const t = arg("--target", "current");+const current = `${GOOS[process.platform]}/${GOARCH[process.arch]}`;+const targets = t === "all" ? ALL : t === "current" ? [current] : t.split(",");+fs.mkdirSync(out, { recursive: true });+for (const target of targets) {+ const [goos, goarch] = target.split("/");+ const name = `magpie-${NODE_OS[goos]}-${NODE_ARCH[goarch]}${goos === "windows" ? ".exe" : ""}`;+ const dest = path.join(out, name);+ console.log(`构建 magpie ${version} → build/bin/${name}`);+ execFileSync("go", ["build", "-tags", "nogui", "-trimpath", "-ldflags", `-s -w -X main.version=${version}`, "-o", dest, "."], {+ cwd: src,+ stdio: "inherit",+ env: { ...process.env, CGO_ENABLED: "0", GOOS: goos, GOARCH: goarch },+ });+ if (target === current) {+ const generic = path.join(out, `magpie${goos === "windows" ? ".exe" : ""}`);+ fs.copyFileSync(dest, generic);+ fs.chmodSync(generic, 0o755);+ }+}+console.log("完成");diff --git a/scripts/electron-smoke.mjs b/scripts/electron-smoke.mjsnew file mode 100644index 0000000..93404cf--- /dev/null+++ b/scripts/electron-smoke.mjs@@ -0,0 +1,30 @@+// 桌面版冒烟测试:启动 Electron(Linux 无显示时自动用 xvfb-run),加载界面、截图、检查 /amb/api/status 与 /magpie/,然后干净退出。+// 用法:node scripts/electron-smoke.mjs [可执行文件路径,默认 node_modules 中的 electron + 当前目录]+import { spawnSync } from "node:child_process";+import fs from "node:fs";+import os from "node:os";+import path from "node:path";+import { createRequire } from "node:module";++const require = createRequire(import.meta.url);+const exe = process.argv[2];+const dataDir = fs.mkdtempSync(path.join(os.tmpdir(), "amb-electron-"));+const shot = path.join(dataDir, "smoke.png");+let cmd = exe ?? require("electron");+let args = exe ? [] : ["."];+if (process.platform === "linux") args.push("--no-sandbox");+if (process.platform === "linux" && !process.env.DISPLAY) {+ args = ["-a", "-s", "-screen 0 1400x900x24", cmd, ...args];+ cmd = "xvfb-run";+}+const r = spawnSync(cmd, args, { env: { ...process.env, AMB_DATA_DIR: dataDir, AMB_UI_PORT: "0", AMB_ELECTRON_SMOKE: shot }, encoding: "utf8", timeout: 120_000 });+const out = (r.stdout || "") + (r.stderr || "");+const line = out.split("\n").find((l) => l.startsWith("SMOKE "));+if (!line) {+ console.error(out.slice(-3000));+ process.exit(1);+}+const res = JSON.parse(line.slice(6));+console.log(res, "截图:", shot);+const ok = res.hasUi && res.status === 200 && res.magpie === 200 && res.magpieState === "running" && fs.existsSync(shot);+process.exit(ok ? 0 : 1);diff --git a/scripts/setup.mjs b/scripts/setup.mjsnew file mode 100644index 0000000..70ae493--- /dev/null+++ b/scripts/setup.mjs@@ -0,0 +1,16 @@+#!/usr/bin/env node+// 一次性安装:初始化子模块 → 构建 magpie → 提示首次设置+import { execFileSync } from "node:child_process";+import fs from "node:fs";+import path from "node:path";+import { fileURLToPath } from "node:url";++const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");+const run = (cmd, args) => execFileSync(cmd, args, { cwd: root, stdio: "inherit" });++if (!fs.existsSync(path.join(root, "vendor", "magpie", "go.mod"))) {+ console.log("初始化子模块 vendor/magpie …");+ run("git", ["submodule", "update", "--init", "--depth", "1", "vendor/magpie"]);+}+run(process.execPath, [path.join(root, "scripts", "build-magpie.mjs"), ...process.argv.slice(2)]);+console.log("\n下一步:npm run init(填写模型 API Key 与飞书凭据,可跳过改在界面中设置)→ npm start");diff --git a/src/app.ts b/src/app.tsnew file mode 100644index 0000000..3c620f4--- /dev/null+++ b/src/app.ts@@ -0,0 +1,209 @@+import path from "node:path";+import type { AppConfig } from "./config.js";+import { Store, type Bot } from "./store/db.js";+import { OpenAICompatClient, type ModelClient } from "./llm/client.js";+import { BotRuntime } from "./core/runtime.js";+import { KeyedQueue } from "./core/queue.js";+import type { ChannelStatus } from "./core/types.js";+import { MagpieSupervisor } from "./magpie/supervisor.js";+import { FeishuChannel } from "./channels/feishu/channel.js";+import { LarkTransport, type FeishuTransport } from "./channels/feishu/transport.js";+import { WeixinChannel } from "./channels/weixin/channel.js";+import { WeixinLogin } from "./channels/weixin/login.js";+import { startWebServer, type WebServer } from "./web/server.js";+import { logger, mask } from "./log.js";++const log = logger("app");++export interface AppOptions {+ /** 测试注入:替换飞书传输层 */+ feishuTransport?: (bot: Bot) => FeishuTransport;+ /** 测试注入:替换 iLink 的 fetch */+ weixinFetch?: typeof fetch;+ weixinPollTimeoutMs?: number;+ /** 测试注入:替换模型客户端 */+ models?: ModelClient;+ /** 不启动 web 服务(CLI 子命令用) */+ noWeb?: boolean;+ /** 登录二维码是否打印到终端 */+ printQrToTerminal?: boolean;+}++interface BotChannels {+ feishu?: FeishuChannel;+ feishuError?: string;+ weixin?: WeixinChannel;+ weixinLogin?: WeixinLogin;+}++export class App {+ readonly store: Store;+ readonly magpie: MagpieSupervisor | undefined;+ readonly models: ModelClient;+ readonly runtime: BotRuntime;+ readonly queue = new KeyedQueue();+ readonly channels = new Map<string, BotChannels>();+ web: WebServer | undefined;+ private notices: Array<{ at: number; level: "info" | "warn"; text: string }> = [];++ constructor(readonly config: AppConfig, readonly opts: AppOptions = {}) {+ this.store = new Store(path.join(config.dataDir, "anymodel.db"));+ if (config.magpie.mode === "managed") {+ this.magpie = new MagpieSupervisor({ dataDir: config.dataDir, binPath: config.magpie.binPath || undefined });+ }+ this.models =+ opts.models ??+ new OpenAICompatClient(() =>+ this.magpie+ ? { baseUrl: this.magpie.baseUrl, apiKey: this.magpie.gatewayKey }+ : { baseUrl: config.magpie.externalBaseUrl.replace(/\/+$/, ""), apiKey: config.magpie.externalApiKey },+ );+ this.runtime = new BotRuntime({+ store: this.store,+ models: this.models,+ defaultModel: () => this.config.llm.defaultModel,+ contextMessages: config.llm.contextMessages,+ contextChars: config.llm.contextChars,+ });+ }++ notice(level: "info" | "warn", text: string): void {+ this.notices.push({ at: Date.now(), level, text });+ if (this.notices.length > 50) this.notices.shift();+ log[level](text);+ }++ get recentNotices() {+ return this.notices.slice().reverse();+ }++ async start(): Promise<void> {+ if (this.magpie) {+ try {+ await this.magpie.start();+ } catch (e) {+ this.notice("warn", `magpie 启动失败:${(e as Error).message}`);+ }+ }+ this.seedDefaultBot();+ for (const bot of this.store.listBots()) await this.startBot(bot.id);+ if (!this.opts.noWeb) this.web = await startWebServer(this);+ }++ async stop(): Promise<void> {+ await this.web?.close();+ for (const id of [...this.channels.keys()]) await this.stopBot(id);+ await this.magpie?.stop();+ this.store.close();+ }++ private seedDefaultBot(): void {+ if (this.store.listBots().length) return;+ const bot = this.store.createBot({+ id: "default",+ name: "我的助手",+ systemPrompt: "你是一个乐于助人的中文助手,回答简洁准确。",+ feishuAppId: process.env.FEISHU_APP_ID ?? "",+ feishuAppSecret: process.env.FEISHU_APP_SECRET ?? "",+ weixinEnabled: true,+ });+ log.info(`created default bot ${bot.id}`, { feishuAppId: bot.feishuAppId || "(未配置)" });+ }++ async startBot(botId: string): Promise<void> {+ const bot = this.store.getBot(botId);+ if (!bot) return;+ const ch: BotChannels = this.channels.get(botId) ?? {};+ this.channels.set(botId, ch);+ if (bot.feishuAppId && bot.feishuAppSecret && !ch.feishu) {+ const transport = this.opts.feishuTransport?.(bot) ?? new LarkTransport(bot.feishuAppId, bot.feishuAppSecret);+ ch.feishu = new FeishuChannel(bot.id, transport, this.runtime, this.queue, this.config.feishu.throttleMs);+ ch.feishuError = undefined;+ ch.feishu.start().catch((e) => {+ ch.feishuError = (e as Error).message;+ this.notice("warn", `机器人「${bot.name}」飞书长连接启动失败:${ch.feishuError}`);+ });+ log.info(`bot ${bot.id}: feishu starting`, { appId: bot.feishuAppId, secret: mask(bot.feishuAppSecret) });+ }+ if (bot.weixinEnabled && !ch.weixin) {+ ch.weixin = new WeixinChannel(bot.id, this.store, this.runtime, this.queue, {+ fetchImpl: this.opts.weixinFetch,+ pollTimeoutMs: this.opts.weixinPollTimeoutMs,+ });+ ch.weixin.onExpired = () => this.notice("warn", `机器人「${bot.name}」微信登录已过期,请在「渠道」页重新扫码`);+ ch.weixin.start();+ }+ }++ async stopBot(botId: string): Promise<void> {+ const ch = this.channels.get(botId);+ if (!ch) return;+ ch.weixinLogin?.cancel();+ await ch.feishu?.stop().catch(() => {});+ await ch.weixin?.stop().catch(() => {});+ this.channels.delete(botId);+ }++ async restartBot(botId: string): Promise<void> {+ await this.stopBot(botId);+ await this.startBot(botId);+ }++ // ---------- 微信扫码 ----------+ startWeixinLogin(botId: string): WeixinLogin {+ const ch = this.channels.get(botId) ?? {};+ this.channels.set(botId, ch);+ ch.weixinLogin?.cancel();+ const login = new WeixinLogin({+ apiBaseUrl: this.config.weixin.apiBaseUrl,+ pngPath: path.join(this.config.dataDir, "weixin", `${botId}-login-qr.png`),+ fetchImpl: this.opts.weixinFetch,+ printTerminal: this.opts.printQrToTerminal ?? true,+ pollDelayMs: this.opts.weixinFetch ? 50 : 1000,+ });+ ch.weixinLogin = login;+ void login.run().then(async (res) => {+ if (!res) return;+ this.store.saveWeixinAccount({ botId, botToken: res.botToken, ilinkBotId: res.ilinkBotId, baseUrl: res.baseUrl, ownerUserId: res.userId });+ const bot = this.store.getBot(botId);+ if (bot && !bot.weixinEnabled) this.store.updateBot(botId, { weixinEnabled: true });+ await ch.weixin?.stop();+ ch.weixin = undefined;+ await this.startBot(botId);+ this.notice("info", `机器人「${bot?.name ?? botId}」微信已连接`);+ });+ return login;+ }++ async weixinLogout(botId: string): Promise<void> {+ const ch = this.channels.get(botId);+ await ch?.weixin?.stop();+ if (ch) ch.weixin = undefined;+ this.store.deleteWeixinAccount(botId);+ await this.startBot(botId);+ }++ channelStatus(botId: string): { feishu: ChannelStatus; weixin: ChannelStatus & { login?: unknown; quota?: unknown } } {+ const bot = this.store.getBot(botId);+ const ch = this.channels.get(botId);+ const feishu: ChannelStatus = !bot?.feishuAppId+ ? { state: "disabled", detail: "未配置凭据", since: 0 }+ : ch?.feishuError+ ? { state: "error", detail: ch.feishuError, since: Date.now() }+ : ch?.feishu?.status ?? { state: "disabled", since: 0 };+ const acct = this.store.getWeixinAccount(botId);+ const wx = ch?.weixin?.status ?? (acct ? { state: "disabled" as const, since: 0 } : { state: "login_required" as const, detail: "尚未扫码登录", since: 0 });+ const quota = ch?.weixin+ ? this.store.listWeixinPeers(botId).map((p) => ({ userId: p.userId, remaining: ch.weixin!.quota.remaining(p.userId), windowStartedAt: p.windowStartedAt }))+ : [];+ return {+ feishu,+ weixin: {+ ...wx,+ ...(acct ? { account: { ilinkBotId: acct.ilinkBotId, pausedUntil: acct.pausedUntil } } : {}),+ login: ch?.weixinLogin?.snapshot,+ quota,+ },+ };+ }+}diff --git a/src/channels/feishu/card.ts b/src/channels/feishu/card.tsnew file mode 100644index 0000000..c63cfb6--- /dev/null+++ b/src/channels/feishu/card.ts@@ -0,0 +1,103 @@+import type { OutboundOp, ReplySession } from "../../core/types.js";+import { splitText } from "../../core/types.js";+import { CARD_ELEMENT_ID, type FeishuTransport } from "./transport.js";+import { logger } from "../../log.js";++const log = logger("feishu.card");++/**+ * 飞书回复会话:CardKit 流式卡片(~400ms 节流,单卡 ≤10 次/秒),结束时关闭 streaming_mode。+ * 卡片创建/发送失败或中途失败 → 降级为纯文本回复。+ */+export class FeishuReply implements ReplySession {+ private cardId: string | undefined;+ private seq = 0;+ private latest = "";+ private flushed = "";+ private timer: NodeJS.Timeout | undefined;+ private inflight: Promise<void> = Promise.resolve();+ private fallback = false;+ private started = false;+ private closed = false;++ constructor(private transport: FeishuTransport, private replyTo: string, private throttleMs = 400) {}++ get usedCard(): boolean {+ return !!this.cardId && !this.fallback;+ }++ async apply(op: OutboundOp): Promise<void> {+ switch (op.type) {+ case "typing":+ return; // 飞书无 typing;卡片本身就是“正在生成”的反馈+ case "stream.start":+ return this.start();+ case "stream.update":+ this.latest = op.text;+ this.schedule();+ return;+ case "stream.finish":+ return this.finish(op.text);+ case "text":+ return this.sendText(op.text);+ case "interactive":+ return this.sendText(`${op.prompt}${op.options?.length ? "\n" + op.options.map((o, i) => `${i + 1}. ${o}`).join("\n") : ""}`);+ }+ }++ private async start(): Promise<void> {+ if (this.started) return;+ this.started = true;+ try {+ this.cardId = await this.transport.createStreamingCard("…");+ await this.transport.sendCardReply(this.replyTo, this.cardId);+ } catch (e) {+ log.warn("streaming card unavailable, falling back to text", { message: (e as Error).message });+ this.fallback = true;+ }+ }++ private schedule(): void {+ if (this.fallback || !this.cardId || this.closed || this.timer) return;+ this.timer = setTimeout(() => {+ this.timer = undefined;+ this.inflight = this.inflight.then(() => this.flush());+ }, this.throttleMs);+ }++ private async flush(): Promise<void> {+ if (this.fallback || !this.cardId || this.latest === this.flushed) return;+ const text = this.latest;+ try {+ await this.transport.updateCardText(this.cardId, CARD_ELEMENT_ID, text, ++this.seq);+ this.flushed = text;+ } catch (e) {+ log.warn("card update failed", { message: (e as Error).message });+ }+ }++ private async finish(text: string): Promise<void> {+ this.closed = true;+ if (this.timer) {+ clearTimeout(this.timer);+ this.timer = undefined;+ }+ await this.inflight;+ if (!this.started) await this.start();+ if (this.fallback || !this.cardId) return this.sendText(text);+ try {+ if (text !== this.flushed) {+ await this.transport.updateCardText(this.cardId, CARD_ELEMENT_ID, text, ++this.seq);+ this.flushed = text;+ }+ await this.transport.finishCard(this.cardId, ++this.seq, text.replace(/\s+/g, " ").slice(0, 60));+ } catch (e) {+ log.warn("card finish failed, sending text", { message: (e as Error).message });+ if (this.flushed !== text) await this.sendText(text);+ }+ }++ private async sendText(text: string): Promise<void> {+ for (const chunk of splitText(text, 4000)) await this.transport.replyText(this.replyTo, chunk);+ }+}diff --git a/src/channels/feishu/channel.ts b/src/channels/feishu/channel.tsnew file mode 100644index 0000000..adfc300--- /dev/null+++ b/src/channels/feishu/channel.ts@@ -0,0 +1,112 @@+import type { ChannelCapabilities, ChannelStatus, InboundEvent, Part } from "../../core/types.js";+import { Dedup, KeyedQueue } from "../../core/queue.js";+import type { BotRuntime } from "../../core/runtime.js";+import type { FeishuMessageEvent, FeishuTransport } from "./transport.js";+import { FeishuReply } from "./card.js";+import { logger } from "../../log.js";++export const FEISHU_CAPS: ChannelCapabilities = {+ streaming: true,+ cards: true,+ groups: true,+ mentions: true,+ typing: false,+ maxTextLength: 4000,+ proactiveQuota: false,+};++export function feishuParts(ev: FeishuMessageEvent): Part[] {+ let c: any = {};+ try {+ c = JSON.parse(ev.content || "{}");+ } catch {+ /* ignore */+ }+ switch (ev.messageType) {+ case "text": {+ let t = String(c.text ?? "");+ for (const m of ev.mentions) t = t.replaceAll(m.key, "");+ return [{ type: "text", text: t.trim() }];+ }+ case "post": {+ const blocks = (c.content ?? c.zh_cn?.content ?? []) as any[][];+ const text = blocks+ .map((line) => line.map((n) => (n.tag === "text" || n.tag === "a" ? n.text : "")).join(""))+ .join("\n");+ return [{ type: "text", text: `${c.title ? c.title + "\n" : ""}${text}`.trim() }];+ }+ case "image":+ return [{ type: "image", ref: c.image_key }];+ case "file":+ return [{ type: "file", ref: c.file_key, name: c.file_name }];+ case "audio":+ return [{ type: "voice", ref: c.file_key }];+ default:+ return [{ type: "text", text: `[暂不支持的消息类型:${ev.messageType}]` }];+ }+}++/** 一个机器人对应一个飞书应用(长连接,P1 仅处理单聊)。 */+export class FeishuChannel {+ readonly caps = FEISHU_CAPS;+ status: ChannelStatus = { state: "disabled", since: Date.now() };+ private dedup = new Dedup();+ private log = logger("feishu");+ /** 测试用:等待所有已入队任务 */+ readonly pending = new Set<Promise<void>>();++ constructor(+ private botId: string,+ private transport: FeishuTransport,+ private runtime: BotRuntime,+ private queue: KeyedQueue,+ private throttleMs = 400,+ ) {}++ async start(): Promise<void> {+ await this.transport.start(+ (ev) => this.onMessage(ev),+ (state, detail) => {+ this.status = { state, detail, since: Date.now() };+ this.log.info(`bot ${this.botId} ws ${state}`, detail ? { detail } : undefined);+ },+ );+ }++ async stop(): Promise<void> {+ await this.transport.stop();+ this.status = { state: "disabled", since: Date.now() };+ }++ /** 同步返回(ack),处理放入每会话串行队列。 */+ onMessage(ev: FeishuMessageEvent): void {+ if (!ev.messageId || !this.dedup.firstSeen(ev.messageId)) return;+ if (ev.chatType !== "p2p") return; // P1:仅单聊+ const inbound: InboundEvent = {+ id: ev.messageId,+ channel: "feishu",+ botId: this.botId,+ conversation: { kind: "dm", id: ev.chatId },+ sender: { id: ev.senderOpenId },+ parts: feishuParts(ev),+ mentions: ev.mentions.map((m) => m.openId ?? m.key),+ replyHandle: { messageId: ev.messageId, chatId: ev.chatId },+ receivedAt: Date.now(),+ };+ const p = this.queue.run(`feishu:${this.botId}:${ev.chatId}`, async () => {+ const reply = new FeishuReply(this.transport, ev.messageId, this.throttleMs);+ try {+ await this.runtime.handle(inbound, reply);+ } catch (e) {+ this.log.error("handle failed", { message: (e as Error).message });+ await reply.apply({ type: "text", text: `⚠️ 处理失败:${(e as Error).message}` }).catch(() => {});+ }+ });+ this.pending.add(p);+ void p.finally(() => this.pending.delete(p));+ }++ async idle(): Promise<void> {+ while (this.pending.size) await Promise.all([...this.pending]);+ }+}diff --git a/src/channels/feishu/transport.ts b/src/channels/feishu/transport.tsnew file mode 100644index 0000000..e58527d--- /dev/null+++ b/src/channels/feishu/transport.ts@@ -0,0 +1,158 @@+import * as Lark from "@larksuiteoapi/node-sdk";+import { randomUUID } from "node:crypto";+import { logger } from "../../log.js";++/** 归一化后的飞书 im.message.receive_v1 关键字段 */+export interface FeishuMessageEvent {+ eventId?: string;+ messageId: string;+ chatId: string;+ chatType: "p2p" | "group" | string;+ messageType: string;+ content: string; // 原始 JSON 字符串+ senderOpenId: string;+ mentions: Array<{ key: string; name?: string; openId?: string }>;+ createTime: number;+}++/**+ * 飞书传输层抽象(便于离线测试用 mock 替换)。+ * 真实实现:WSClient 长连接接收事件 + OpenAPI(CardKit 流式卡片 / 文本回复)。+ */+export interface FeishuTransport {+ start(onMessage: (ev: FeishuMessageEvent) => void, onState: (state: "connecting" | "connected" | "error", detail?: string) => void): Promise<void>;+ stop(): Promise<void>;+ createStreamingCard(initial: string): Promise<string>;+ sendCardReply(replyToMessageId: string, cardId: string): Promise<void>;+ updateCardText(cardId: string, elementId: string, text: string, sequence: number): Promise<void>;+ finishCard(cardId: string, sequence: number, summary: string): Promise<void>;+ replyText(replyToMessageId: string, text: string): Promise<void>;+}++export const CARD_ELEMENT_ID = "md";++export function streamingCardSpec(initial: string) {+ return {+ schema: "2.0",+ config: {+ streaming_mode: true,+ summary: { content: "[生成中…]" },+ streaming_config: {+ print_frequency_ms: { default: 50 },+ print_step: { default: 2 },+ print_strategy: "fast",+ },+ },+ body: { elements: [{ tag: "markdown", element_id: CARD_ELEMENT_ID, content: initial }] },+ };+}++function check(res: { code?: number; msg?: string } | undefined, what: string): void {+ if (res && typeof res.code === "number" && res.code !== 0) throw new Error(`${what} failed: code=${res.code} msg=${res.msg}`);+}++export class LarkTransport implements FeishuTransport {+ private client: Lark.Client;+ private ws: Lark.WSClient | undefined;+ private log = logger("feishu");++ constructor(private appId: string, private appSecret: string, private domain: "feishu" | "lark" = "feishu") {+ this.client = new Lark.Client({+ appId,+ appSecret,+ domain: domain === "lark" ? Lark.Domain.Lark : Lark.Domain.Feishu,+ loggerLevel: Lark.LoggerLevel.warn,+ });+ }++ async start(onMessage: (ev: FeishuMessageEvent) => void, onState: (s: "connecting" | "connected" | "error", d?: string) => void): Promise<void> {+ onState("connecting");+ const dispatcher = new Lark.EventDispatcher({}).register({+ "im.message.receive_v1": async (data: any) => {+ // 3 秒规则:立即返回,业务异步处理(onMessage 内只入队)+ try {+ const m = data.message ?? {};+ onMessage({+ eventId: data.event_id,+ messageId: m.message_id,+ chatId: m.chat_id,+ chatType: m.chat_type,+ messageType: m.message_type,+ content: m.content ?? "{}",+ senderOpenId: data.sender?.sender_id?.open_id ?? "",+ mentions: (m.mentions ?? []).map((x: any) => ({ key: x.key, name: x.name, openId: x.id?.open_id })),+ createTime: Number(m.create_time ?? Date.now()),+ });+ } catch (e) {+ this.log.warn("bad event", { message: (e as Error).message });+ }+ },+ });+ this.ws = new Lark.WSClient({+ appId: this.appId,+ appSecret: this.appSecret,+ domain: this.domain === "lark" ? Lark.Domain.Lark : Lark.Domain.Feishu,+ loggerLevel: Lark.LoggerLevel.warn,+ autoReconnect: true,+ onReady: () => onState("connected"),+ onError: (err: Error) => onState("error", err?.message),+ onReconnecting: () => onState("connecting", "reconnecting"),+ } as any);+ await this.ws.start({ eventDispatcher: dispatcher });+ }++ async stop(): Promise<void> {+ try {+ (this.ws as any)?.close?.({ force: true });+ } catch {+ /* ignore */+ }+ this.ws = undefined;+ }++ async createStreamingCard(initial: string): Promise<string> {+ const res: any = await this.client.cardkit.v1.card.create({+ data: { type: "card_json", data: JSON.stringify(streamingCardSpec(initial)) },+ });+ check(res, "cardkit.card.create");+ const id = res?.data?.card_id;+ if (!id) throw new Error("cardkit.card.create returned no card_id");+ return id;+ }++ async sendCardReply(replyToMessageId: string, cardId: string): Promise<void> {+ const res: any = await this.client.im.v1.message.reply({+ path: { message_id: replyToMessageId },+ data: { msg_type: "interactive", content: JSON.stringify({ type: "card", data: { card_id: cardId } }) },+ });+ check(res, "im.message.reply(card)");+ }++ async updateCardText(cardId: string, elementId: string, text: string, sequence: number): Promise<void> {+ const res: any = await this.client.cardkit.v1.cardElement.content({+ path: { card_id: cardId, element_id: elementId },+ data: { content: text, sequence, uuid: randomUUID() },+ });+ check(res, "cardkit.cardElement.content");+ }++ async finishCard(cardId: string, sequence: number, summary: string): Promise<void> {+ const res: any = await this.client.cardkit.v1.card.settings({+ path: { card_id: cardId },+ data: {+ settings: JSON.stringify({ config: { streaming_mode: false, summary: { content: summary } } }),+ sequence,+ uuid: randomUUID(),+ },+ });+ check(res, "cardkit.card.settings");+ }++ async replyText(replyToMessageId: string, text: string): Promise<void> {+ const res: any = await this.client.im.v1.message.reply({+ path: { message_id: replyToMessageId },+ data: { msg_type: "text", content: JSON.stringify({ text }) },+ });+ check(res, "im.message.reply(text)");+ }+}diff --git a/src/channels/weixin/LICENSE.openclaw-weixin b/src/channels/weixin/LICENSE.openclaw-weixinnew file mode 100644index 0000000..b963c3c--- /dev/null+++ b/src/channels/weixin/LICENSE.openclaw-weixin@@ -0,0 +1,27 @@+Tencent is pleased to support the open source community by making openclaw-weixin available.++Copyright (C) 2026 Tencent. All rights reserved.++openclaw-weixin is licensed under the MIT.+++Terms of the MIT:+--------------------------------------------------------------------+Permission is hereby granted, free of charge, to any person obtaining+a copy of this software and associated documentation files (the+"Software"), to deal in the Software without restriction, including+without limitation the rights to use, copy, modify, merge, publish,+distribute, sublicense, and/or sell copies of the Software, and to+permit persons to whom the Software is furnished to do so, subject to+the following conditions:++The above copyright notice and this permission notice shall be+included in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\ No newline at end of filediff --git a/src/channels/weixin/api.ts b/src/channels/weixin/api.tsnew file mode 100644index 0000000..26bf31b--- /dev/null+++ b/src/channels/weixin/api.ts@@ -0,0 +1,258 @@+/*+ * iLink Bot API 客户端(微信官方 ClawBot 通道)。+ * 协议细节移植自 Tencent/openclaw-weixin (src/api/api.ts, src/auth/login-qr.ts, v2.4.10),+ * 精简并改写为可注入 baseUrl/fetch 的类。+ * Portions Copyright (C) 2026 Tencent. All rights reserved. Licensed under the MIT, see ./LICENSE.openclaw-weixin.+ */+import crypto from "node:crypto";++export const ILINK_APP_ID = "bot";+export const DEFAULT_ILINK_BASE = "https://ilinkai.weixin.qq.com";+export const SESSION_EXPIRED_ERRCODE = -14;+const CHANNEL_VERSION = "0.1.0";+const BOT_AGENT = "AnymodelBot/0.1.0";++export function buildClientVersion(version: string): number {+ const parts = version.split(".").map((p) => parseInt(p, 10));+ const major = parts[0] || 0;+ const minor = parts[1] || 0;+ const patch = parts[2] || 0;+ return ((major & 0xff) << 16) | ((minor & 0xff) << 8) | (patch & 0xff);+}++export function randomWechatUin(): string {+ const uint32 = crypto.randomBytes(4).readUInt32BE(0);+ return Buffer.from(String(uint32), "utf-8").toString("base64");+}++const LOSSLESS_ID_FIELDS = new Set(["message_id", "msg_id", "svr_id"]);++/** 解析前把 uint64 消息 ID 加上引号,避免 JS number 精度丢失(移植自 openclaw-weixin)。 */+export function parseWeixinApiJson<T>(rawText: string): T {+ let output = "";+ let index = 0;+ while (index < rawText.length) {+ if (rawText[index] !== '"') {+ output += rawText[index++];+ continue;+ }+ const stringStart = index;+ index++;+ let escaped = false;+ while (index < rawText.length) {+ const char = rawText[index++];+ if (escaped) escaped = false;+ else if (char === "\\") escaped = true;+ else if (char === '"') break;+ }+ const stringToken = rawText.slice(stringStart, index);+ output += stringToken;+ let cursor = index;+ while (/\s/.test(rawText[cursor] ?? "")) cursor++;+ if (rawText[cursor] !== ":") continue;+ let key: unknown;+ try {+ key = JSON.parse(stringToken);+ } catch {+ continue;+ }+ if (typeof key !== "string" || !LOSSLESS_ID_FIELDS.has(key)) continue;+ output += rawText.slice(index, cursor + 1);+ cursor++;+ while (/\s/.test(rawText[cursor] ?? "")) output += rawText[cursor++];+ const numberStart = cursor;+ if (rawText[cursor] === "-") cursor++;+ while (/\d/.test(rawText[cursor] ?? "")) cursor++;+ if (cursor > numberStart && !(cursor === numberStart + 1 && rawText[numberStart] === "-")) {+ output += `"${rawText.slice(numberStart, cursor)}"`;+ index = cursor;+ } else {+ index = numberStart;+ }+ }+ return JSON.parse(output) as T;+}++// ---------- 协议类型(节选) ----------+export const MessageType = { USER: 1, BOT: 2 } as const;+export const MessageItemType = { TEXT: 1, IMAGE: 2, VOICE: 3, FILE: 4, VIDEO: 5 } as const;++export interface MessageItem {+ type?: number;+ text_item?: { text?: string };+ voice_item?: { text?: string };+ file_item?: { file_name?: string };+ ref_msg?: { title?: string; message_item?: MessageItem };+}++export interface WeixinMessage {+ seq?: number;+ message_id?: string;+ from_user_id?: string;+ to_user_id?: string;+ client_id?: string;+ create_time_ms?: number;+ session_id?: string;+ message_type?: number;+ message_state?: number;+ item_list?: MessageItem[];+ context_token?: string;+}++export interface GetUpdatesResp {+ ret?: number;+ errcode?: number;+ errmsg?: string;+ msgs?: WeixinMessage[];+ get_updates_buf?: string;+ longpolling_timeout_ms?: number;+}++export interface QrCodeResp {+ qrcode: string;+ qrcode_img_content: string;+}++export interface QrStatusResp {+ status: "wait" | "scaned" | "confirmed" | "expired" | "scaned_but_redirect" | "need_verifycode" | "verify_code_blocked" | "binded_redirect";+ bot_token?: string;+ ilink_bot_id?: string;+ baseurl?: string;+ ilink_user_id?: string;+ redirect_host?: string;+}++export class WeixinApiError extends Error {+ constructor(message: string, readonly ret?: number, readonly errcode?: number) {+ super(message);+ }+ get sessionExpired(): boolean {+ return this.ret === SESSION_EXPIRED_ERRCODE || this.errcode === SESSION_EXPIRED_ERRCODE;+ }+}++export interface IlinkClientOptions {+ baseUrl?: string;+ token?: string;+ routeTag?: string;+ fetchImpl?: typeof fetch;+}++export class IlinkClient {+ baseUrl: string;+ token: string;+ private fetchImpl: typeof fetch;+ constructor(private opts: IlinkClientOptions = {}) {+ this.baseUrl = (opts.baseUrl || DEFAULT_ILINK_BASE).replace(/\/+$/, "");+ this.token = opts.token || "";+ this.fetchImpl = opts.fetchImpl || fetch;+ }++ private headers(withBody: boolean): Record<string, string> {+ const h: Record<string, string> = {+ "iLink-App-Id": ILINK_APP_ID,+ "iLink-App-ClientVersion": String(buildClientVersion(CHANNEL_VERSION)),+ };+ if (this.opts.routeTag) h.SKRouteTag = this.opts.routeTag;+ if (withBody) {+ h["Content-Type"] = "application/json";+ h.AuthorizationType = "ilink_bot_token";+ h["X-WECHAT-UIN"] = randomWechatUin();+ if (this.token.trim()) h.Authorization = `Bearer ${this.token.trim()}`;+ }+ return h;+ }++ private baseInfo() {+ return { channel_version: CHANNEL_VERSION, bot_agent: BOT_AGENT };+ }++ private async request(method: "GET" | "POST", endpoint: string, body: unknown, timeoutMs: number, signal?: AbortSignal): Promise<string> {+ const ctrl = new AbortController();+ const t = setTimeout(() => ctrl.abort(new Error("timeout")), timeoutMs);+ const onAbort = () => ctrl.abort(signal?.reason);+ signal?.addEventListener("abort", onAbort);+ try {+ const res = await this.fetchImpl(`${this.baseUrl}/${endpoint}`, {+ method,+ headers: this.headers(method === "POST"),+ body: method === "POST" ? JSON.stringify({ ...(body as object), base_info: this.baseInfo() }) : undefined,+ signal: ctrl.signal,+ });+ const text = await res.text();+ if (!res.ok) throw new WeixinApiError(`${endpoint} HTTP ${res.status}`);+ return text;+ } finally {+ clearTimeout(t);+ signal?.removeEventListener("abort", onAbort);+ }+ }++ // ---------- 登录 ----------+ async getBotQrCode(localTokens: string[] = []): Promise<QrCodeResp> {+ const raw = await this.request("POST", "ilink/bot/get_bot_qrcode?bot_type=3", { local_token_list: localTokens }, 15_000);+ return JSON.parse(raw) as QrCodeResp;+ }++ /** 长轮询二维码状态;超时/网络错误视为 wait。 */+ async getQrCodeStatus(qrcode: string, verifyCode?: string, timeoutMs = 35_000, signal?: AbortSignal): Promise<QrStatusResp> {+ const q = `ilink/bot/get_qrcode_status?qrcode=${encodeURIComponent(qrcode)}${verifyCode ? `&verify_code=${encodeURIComponent(verifyCode)}` : ""}`;+ try {+ return JSON.parse(await this.request("GET", q, undefined, timeoutMs, signal)) as QrStatusResp;+ } catch (e) {+ if (signal?.aborted) throw e;+ return { status: "wait" };+ }+ }++ // ---------- 消息 ----------+ /** 长轮询拉取消息;客户端超时返回空结果(正常现象)。 */+ async getUpdates(cursor: string, timeoutMs = 35_000, signal?: AbortSignal): Promise<GetUpdatesResp> {+ let raw: string;+ try {+ raw = await this.request("POST", "ilink/bot/getupdates", { get_updates_buf: cursor }, timeoutMs, signal);+ } catch (e) {+ if (!signal?.aborted && (e as Error).name === "AbortError") return { ret: 0, msgs: [], get_updates_buf: cursor };+ if (!signal?.aborted && /timeout/i.test(String((e as Error).message))) return { ret: 0, msgs: [], get_updates_buf: cursor };+ throw e;+ }+ const resp = parseWeixinApiJson<GetUpdatesResp>(raw);+ if ((resp.ret !== undefined && resp.ret !== 0) || (resp.errcode !== undefined && resp.errcode !== 0)) {+ throw new WeixinApiError(`getupdates ret=${resp.ret} errcode=${resp.errcode} errmsg=${resp.errmsg ?? ""}`, resp.ret, resp.errcode);+ }+ return resp;+ }++ async sendText(toUserId: string, text: string, contextToken: string): Promise<void> {+ const raw = await this.request(+ "POST",+ "ilink/bot/sendmessage",+ {+ msg: {+ from_user_id: "",+ to_user_id: toUserId,+ client_id: `amb:${Date.now()}-${crypto.randomBytes(4).toString("hex")}`,+ message_type: MessageType.BOT,+ message_state: 2, // FINISH+ context_token: contextToken || undefined,+ item_list: [{ type: MessageItemType.TEXT, text_item: { text } }],+ },+ },+ 15_000,+ );+ const resp = parseWeixinApiJson<{ ret?: number; errcode?: number; errmsg?: string }>(raw || "{}");+ if ((resp.ret && resp.ret !== 0) || (resp.errcode && resp.errcode !== 0)) {+ throw new WeixinApiError(`sendmessage ret=${resp.ret} errmsg=${resp.errmsg ?? ""}`, resp.ret, resp.errcode);+ }+ }++ async getTypingTicket(userId: string, contextToken?: string): Promise<string> {+ const raw = await this.request("POST", "ilink/bot/getconfig", { ilink_user_id: userId, context_token: contextToken }, 10_000);+ const resp = JSON.parse(raw || "{}") as { ret?: number; typing_ticket?: string };+ return resp.typing_ticket || "";+ }++ async sendTyping(userId: string, ticket: string, typing: boolean): Promise<void> {+ await this.request("POST", "ilink/bot/sendtyping", { ilink_user_id: userId, typing_ticket: ticket, status: typing ? 1 : 2 }, 10_000);+ }+}diff --git a/src/channels/weixin/channel.ts b/src/channels/weixin/channel.tsnew file mode 100644index 0000000..6f5857a--- /dev/null+++ b/src/channels/weixin/channel.ts@@ -0,0 +1,252 @@+import type { ChannelCapabilities, ChannelStatus, InboundEvent, OutboundOp, Part, ReplySession } from "../../core/types.js";+import { splitText } from "../../core/types.js";+import { Dedup, KeyedQueue } from "../../core/queue.js";+import type { BotRuntime } from "../../core/runtime.js";+import type { Store } from "../../store/db.js";+import { IlinkClient, MessageItemType, MessageType, WeixinApiError, type MessageItem, type WeixinMessage } from "./api.js";+import { StreamingMarkdownFilter } from "./markdown-filter.js";+import { WeixinQuota } from "./quota.js";+import { logger } from "../../log.js";++export const WEIXIN_CAPS: ChannelCapabilities = {+ streaming: false,+ cards: false,+ groups: false,+ mentions: false,+ typing: true,+ maxTextLength: 4000,+ proactiveQuota: true,+};++export const SESSION_PAUSE_MS = 60 * 60_000;++export function filterMarkdown(text: string): string {+ const f = new StreamingMarkdownFilter();+ return (f.feed(text) + f.flush()).trim();+}++export function weixinParts(items: MessageItem[] | undefined): Part[] {+ const parts: Part[] = [];+ for (const it of items ?? []) {+ switch (it.type) {+ case MessageItemType.TEXT: {+ const t = it.text_item?.text ?? "";+ const ref = it.ref_msg?.message_item?.text_item?.text || it.ref_msg?.title;+ if (ref) parts.push({ type: "quote", text: ref });+ if (t) parts.push({ type: "text", text: t });+ break;+ }+ case MessageItemType.VOICE:+ parts.push({ type: "voice", transcript: it.voice_item?.text });+ break;+ case MessageItemType.IMAGE:+ parts.push({ type: "image" });+ break;+ case MessageItemType.FILE:+ parts.push({ type: "file", name: it.file_item?.file_name });+ break;+ case MessageItemType.VIDEO:+ parts.push({ type: "video" });+ break;+ }+ }+ return parts;+}++/** 微信回复会话:不流式;生成期间显示“正在输入”,结束时一次性发送(>4000 字切分),遵守配额。 */+export class WeixinReply implements ReplySession {+ private ticket: string | undefined;+ private typingTimer: NodeJS.Timeout | undefined;+ readonly sent: string[] = [];+ private log = logger("weixin.reply");++ constructor(private client: IlinkClient, private userId: string, private contextToken: string, private quota: WeixinQuota) {}++ async apply(op: OutboundOp): Promise<void> {+ switch (op.type) {+ case "typing":+ return this.typing(op.on);+ case "stream.start":+ case "stream.update":+ return;+ case "stream.finish":+ case "text":+ return this.send(op.text);+ case "interactive":+ return this.send(`${op.prompt}${op.options?.length ? "\n" + op.options.map((o, i) => `${i + 1}. ${o}`).join("\n") + "\n(回复编号选择)" : ""}`);+ }+ }++ private async typing(on: boolean): Promise<void> {+ try {+ if (on) {+ this.ticket ??= await this.client.getTypingTicket(this.userId, this.contextToken);+ if (!this.ticket) return;+ await this.client.sendTyping(this.userId, this.ticket, true);+ // 输入状态会过期,生成较久时每 5 秒续一次+ this.typingTimer ??= setInterval(() => {+ if (this.ticket) void this.client.sendTyping(this.userId, this.ticket, true).catch(() => {});+ }, 5000);+ } else {+ if (this.typingTimer) clearInterval(this.typingTimer);+ this.typingTimer = undefined;+ if (this.ticket) await this.client.sendTyping(this.userId, this.ticket, false);+ }+ } catch (e) {+ this.log.debug("typing failed", { message: (e as Error).message });+ }+ }++ private async send(text: string): Promise<void> {+ if (this.typingTimer) {+ clearInterval(this.typingTimer);+ this.typingTimer = undefined;+ }+ const chunks = splitText(filterMarkdown(text), WEIXIN_CAPS.maxTextLength);+ const budget = this.quota.remaining(this.userId);+ if (budget <= 0) {+ this.log.warn("weixin quota exhausted, reply dropped", { userId: this.userId });+ return;+ }+ let toSend = chunks;+ if (chunks.length > budget) {+ toSend = chunks.slice(0, budget);+ const note = "\n\n…(回复过长,已达到本轮可发送条数上限,请回复任意消息继续)";+ toSend[budget - 1] = toSend[budget - 1].slice(0, WEIXIN_CAPS.maxTextLength - note.length) + note;+ }+ for (const c of toSend) {+ if (!this.quota.tryConsume(this.userId)) break;+ await this.client.sendText(this.userId, c, this.contextToken);+ this.sent.push(c);+ }+ }+}++/** 微信 iLink 渠道:getupdates 长轮询 → 每用户串行队列 → 运行时。 */+export class WeixinChannel {+ readonly caps = WEIXIN_CAPS;+ status: ChannelStatus = { state: "disabled", since: Date.now() };+ private client: IlinkClient | undefined;+ private abort: AbortController | undefined;+ private loop: Promise<void> | undefined;+ private dedup = new Dedup();+ private log = logger("weixin");+ readonly quota: WeixinQuota;+ readonly pending = new Set<Promise<void>>();+ /** -14 会话过期时的通知回调(UI/日志) */+ onExpired: ((botId: string) => void) | undefined;++ constructor(+ private botId: string,+ private store: Store,+ private runtime: BotRuntime,+ private queue: KeyedQueue,+ private opts: { fetchImpl?: typeof fetch; pollTimeoutMs?: number; retryDelayMs?: number; backoffMs?: number } = {},+ ) {+ this.quota = new WeixinQuota(store, botId);+ }++ get running(): boolean {+ return !!this.loop;+ }++ start(): void {+ if (this.loop) return;+ const acct = this.store.getWeixinAccount(this.botId);+ if (!acct) {+ this.status = { state: "login_required", detail: "尚未扫码登录", since: Date.now() };+ return;+ }+ this.client = new IlinkClient({ baseUrl: acct.baseUrl, token: acct.botToken, fetchImpl: this.opts.fetchImpl });+ this.abort = new AbortController();+ this.loop = this.run(this.abort.signal).finally(() => (this.loop = undefined));+ }++ async stop(): Promise<void> {+ this.abort?.abort();+ await this.loop?.catch(() => {});+ this.loop = undefined;+ if (this.status.state !== "expired") this.status = { state: "disabled", since: Date.now() };+ }++ private sleep(ms: number, signal: AbortSignal): Promise<void> {+ return new Promise((r) => {+ const t = setTimeout(r, ms);+ signal.addEventListener("abort", () => {+ clearTimeout(t);+ r();+ }, { once: true });+ });+ }++ private async run(signal: AbortSignal): Promise<void> {+ let failures = 0;+ this.status = { state: "connecting", since: Date.now() };+ while (!signal.aborted) {+ const acct = this.store.getWeixinAccount(this.botId);+ if (!acct) {+ this.status = { state: "login_required", detail: "尚未扫码登录", since: Date.now() };+ return;+ }+ if (acct.pausedUntil > Date.now()) {+ this.status = { state: "expired", detail: "登录已过期(-14),请在界面重新扫码", since: Date.now() };+ await this.sleep(Math.min(acct.pausedUntil - Date.now(), 60_000), signal);+ continue;+ }+ try {+ const resp = await this.client!.getUpdates(acct.cursor, this.opts.pollTimeoutMs ?? 35_000, signal);+ failures = 0;+ if (this.status.state !== "connected") this.status = { state: "connected", since: Date.now() };+ if (resp.get_updates_buf) this.store.setWeixinCursor(this.botId, resp.get_updates_buf);+ for (const m of resp.msgs ?? []) this.onMessage(m);+ } catch (e) {+ if (signal.aborted) return;+ if (e instanceof WeixinApiError && e.sessionExpired) {+ this.log.warn(`bot ${this.botId}: iLink session expired (-14), pausing 1h; re-login required`);+ this.store.setWeixinPaused(this.botId, Date.now() + SESSION_PAUSE_MS);+ this.status = { state: "expired", detail: "登录已过期(-14),请在界面重新扫码", since: Date.now() };+ this.onExpired?.(this.botId);+ continue;+ }+ failures++;+ this.status = { state: "error", detail: (e as Error).message, since: Date.now() };+ this.log.warn("getupdates failed", { failures, message: (e as Error).message });+ await this.sleep(failures >= 3 ? this.opts.backoffMs ?? 30_000 : this.opts.retryDelayMs ?? 2000, signal);+ if (failures >= 3) failures = 0;+ }+ }+ }++ onMessage(m: WeixinMessage): void {+ if (m.message_type !== MessageType.USER || !m.from_user_id) return;+ const id = String(m.message_id ?? m.client_id ?? `${m.from_user_id}:${m.seq}:${m.create_time_ms}`);+ if (!this.dedup.firstSeen(id)) return;+ const userId = m.from_user_id;+ const peer = this.quota.onInbound(userId, m.context_token ?? "");+ const ev: InboundEvent = {+ id,+ channel: "weixin",+ botId: this.botId,+ conversation: { kind: "dm", id: userId },+ sender: { id: userId },+ parts: weixinParts(m.item_list),+ replyHandle: { contextToken: peer.contextToken },+ receivedAt: Date.now(),+ };+ const p = this.queue.run(`weixin:${this.botId}:${userId}`, async () => {+ const reply = new WeixinReply(this.client!, userId, this.store.getWeixinPeer(this.botId, userId)?.contextToken ?? peer.contextToken, this.quota);+ try {+ await this.runtime.handle(ev, reply);+ } catch (e) {+ this.log.error("handle failed", { message: (e as Error).message });+ await reply.apply({ type: "text", text: `⚠️ 处理失败:${(e as Error).message}` }).catch(() => {});+ }+ });+ this.pending.add(p);+ void p.finally(() => this.pending.delete(p));+ }++ async idle(): Promise<void> {+ while (this.pending.size) await Promise.all([...this.pending]);+ }+}diff --git a/src/channels/weixin/login.ts b/src/channels/weixin/login.tsnew file mode 100644index 0000000..5f9e68d--- /dev/null+++ b/src/channels/weixin/login.ts@@ -0,0 +1,162 @@+/*+ * 微信 iLink 扫码登录状态机(供 UI 与 CLI 共用)。+ * 流程移植自 Tencent/openclaw-weixin src/auth/login-qr.ts(MIT,见 ./LICENSE.openclaw-weixin)。+ */+import fs from "node:fs";+import path from "node:path";+import QRCode from "qrcode";+import { IlinkClient, type QrStatusResp } from "./api.js";+import { logger } from "../../log.js";++const log = logger("weixin.login");+const MAX_QR_REFRESH = 3;+const LOGIN_TIMEOUT_MS = 8 * 60_000;++export type LoginState =+ | "idle"+ | "fetching"+ | "wait"+ | "scaned"+ | "need_verifycode"+ | "confirmed"+ | "already_bound"+ | "failed"+ | "cancelled";++export interface LoginSnapshot {+ state: LoginState;+ message: string;+ /** 二维码内容(URL);UI 用 dataUrl 显示 */+ qrContent?: string;+ qrDataUrl?: string;+ qrPngPath?: string;+ refreshCount: number;+}++export interface LoginResult {+ botToken: string;+ ilinkBotId: string;+ baseUrl: string;+ userId: string;+}++export class WeixinLogin {+ snapshot: LoginSnapshot = { state: "idle", message: "", refreshCount: 0 };+ private abort = new AbortController();+ private verifyCode: string | undefined;+ private onUpdate: ((s: LoginSnapshot) => void) | undefined;++ constructor(+ private opts: {+ apiBaseUrl: string;+ pngPath?: string;+ fetchImpl?: typeof fetch;+ printTerminal?: boolean;+ localTokens?: string[];+ pollDelayMs?: number;+ },+ ) {}++ subscribe(fn: (s: LoginSnapshot) => void): void {+ this.onUpdate = fn;+ }++ private set(patch: Partial<LoginSnapshot>): void {+ this.snapshot = { ...this.snapshot, ...patch };+ this.onUpdate?.(this.snapshot);+ }++ submitVerifyCode(code: string): void {+ this.verifyCode = code.trim();+ }++ cancel(): void {+ this.abort.abort();+ if (!["confirmed", "failed", "already_bound"].includes(this.snapshot.state)) this.set({ state: "cancelled", message: "已取消" });+ }++ private async showQr(client: IlinkClient): Promise<string> {+ const qr = await client.getBotQrCode(this.opts.localTokens ?? []);+ const content = qr.qrcode_img_content;+ const qrDataUrl = await QRCode.toDataURL(content, { margin: 1, width: 320 });+ if (this.opts.pngPath) {+ fs.mkdirSync(path.dirname(this.opts.pngPath), { recursive: true });+ await QRCode.toFile(this.opts.pngPath, content, { margin: 1, width: 320 });+ }+ if (this.opts.printTerminal) {+ const qt = (await import("qrcode-terminal")).default;+ qt.generate(content, { small: true }, (s: string) => process.stdout.write(`\n用微信扫描二维码登录:\n${s}\n`));+ if (this.opts.pngPath) process.stdout.write(`二维码图片已保存:${this.opts.pngPath}\n`);+ }+ this.set({ state: "wait", message: "请用微信扫码", qrContent: content, qrDataUrl, qrPngPath: this.opts.pngPath });+ return qr.qrcode;+ }++ /** 运行完整登录流程,成功返回凭据,失败/取消返回 undefined。 */+ async run(): Promise<LoginResult | undefined> {+ const signal = this.abort.signal;+ let client = new IlinkClient({ baseUrl: this.opts.apiBaseUrl, fetchImpl: this.opts.fetchImpl });+ const deadline = Date.now() + LOGIN_TIMEOUT_MS;+ let refreshCount = 0;+ try {+ this.set({ state: "fetching", message: "正在获取二维码…", refreshCount });+ let qrcode = await this.showQr(client);+ while (!signal.aborted && Date.now() < deadline) {+ let st: QrStatusResp;+ const code = this.verifyCode;+ st = await client.getQrCodeStatus(qrcode, code, 35_000, signal);+ if (code && this.verifyCode === code) this.verifyCode = undefined;+ switch (st.status) {+ case "wait":+ break;+ case "scaned":+ if (this.snapshot.state !== "scaned") this.set({ state: "scaned", message: "已扫码,请在微信上确认" });+ break;+ case "need_verifycode":+ if (this.snapshot.state !== "need_verifycode") this.set({ state: "need_verifycode", message: "请输入微信上显示的验证码" });+ break;+ case "scaned_but_redirect":+ if (st.redirect_host) {+ client = new IlinkClient({ baseUrl: `https://${st.redirect_host}`, fetchImpl: this.opts.fetchImpl });+ log.info("IDC redirect", { host: st.redirect_host });+ }+ break;+ case "binded_redirect":+ this.set({ state: "already_bound", message: "该微信已绑定过此机器人,无需重复连接" });+ return undefined;+ case "expired":+ case "verify_code_blocked":+ refreshCount++;+ if (refreshCount > MAX_QR_REFRESH) {+ this.set({ state: "failed", message: "二维码多次过期,请重新开始登录" });+ return undefined;+ }+ this.set({ refreshCount, message: `二维码已过期,正在刷新(${refreshCount}/${MAX_QR_REFRESH})` });+ qrcode = await this.showQr(client);+ break;+ case "confirmed": {+ if (!st.ilink_bot_id || !st.bot_token) {+ this.set({ state: "failed", message: "登录失败:服务器未返回 ilink_bot_id/bot_token" });+ return undefined;+ }+ this.set({ state: "confirmed", message: "✅ 微信已连接", qrDataUrl: undefined, qrContent: undefined });+ log.info("weixin login confirmed", { ilinkBotId: st.ilink_bot_id });+ return {+ botToken: st.bot_token,+ ilinkBotId: st.ilink_bot_id,+ baseUrl: st.baseurl || this.opts.apiBaseUrl,+ userId: st.ilink_user_id || "",+ };+ }+ }+ await new Promise((r) => setTimeout(r, this.opts.pollDelayMs ?? 1000));+ }+ if (!signal.aborted) this.set({ state: "failed", message: "登录超时,请重试" });+ return undefined;+ } catch (e) {+ if (signal.aborted) return undefined;+ this.set({ state: "failed", message: `登录失败:${(e as Error).message}` });+ return undefined;+ }+ }+}diff --git a/src/channels/weixin/markdown-filter.ts b/src/channels/weixin/markdown-filter.tsnew file mode 100644index 0000000..b25e604--- /dev/null+++ b/src/channels/weixin/markdown-filter.ts@@ -0,0 +1,379 @@+/*+ * Ported verbatim from Tencent/openclaw-weixin (src/messaging/markdown-filter.ts, v2.4.10).+ * Tencent is pleased to support the open source community by making openclaw-weixin available.+ * Copyright (C) 2026 Tencent. All rights reserved.+ * openclaw-weixin is licensed under the MIT. See ./LICENSE.openclaw-weixin.+ */+/**+ * Streaming markdown filter — character-level state machine that strips+ * unsupported markdown syntax on-the-fly.+ *+ * Outputs as much filtered text as possible on each `feed()` call, only+ * holding back the minimum characters needed for pattern disambiguation+ * (e.g. a trailing `*` that might become `***`).+ *+ * Constructs passed through (not filtered):+ * - Code fences (```)+ * - Inline code (`)+ * - Tables (|...|)+ * - Horizontal rules (---, ***, ___)+ * - Bold (**)+ * - Italic/bold-italic wrapping non-CJK content+ *+ * Constructs filtered (markers stripped, content kept):+ * - Italic/bold-italic wrapping CJK content+ * - Headings H5/H6 (#####, ######)+ * - Images () — removed entirely+ *+ * States:+ * - **sol** (start-of-line): checks for line-start patterns (```, >, #####, indent)+ * - **body**: scans for inline patterns (![, ~~, ***) and outputs safe chars+ * - **fence**: inside a fenced code block, passes through until closing ```+ * - **inline**: accumulating content inside an inline marker pair+ */+export class StreamingMarkdownFilter {+ private buf = "";+ private fence = false;+ private sol = true;+ private inl: { type: "image" | "bold3" | "italic" | "ubold3" | "uitalic"; acc: string } | null =+ null;++ feed(delta: string): string {+ this.buf += delta;+ return this.pump(false);+ }++ flush(): string {+ return this.pump(true);+ }++ private pump(eof: boolean): string {+ let out = "";+ while (this.buf) {+ const sLen = this.buf.length;+ const sSol = this.sol;+ const sFence = this.fence;+ const sInl = this.inl;++ if (this.fence) out += this.pumpFence(eof);+ else if (this.inl) out += this.pumpInline(eof);+ else if (this.sol) out += this.pumpSOL(eof);+ else out += this.pumpBody(eof);++ if (+ this.buf.length === sLen &&+ this.sol === sSol &&+ this.fence === sFence &&+ this.inl === sInl+ )+ break;+ }++ if (eof && this.inl) {+ const markers: Record<string, string> = {+ image: "![",+ bold3: "***",+ italic: "*",+ ubold3: "___",+ uitalic: "_",+ };+ out += (markers[this.inl.type] ?? "") + this.inl.acc;+ this.inl = null;+ }+ return out;+ }++ /** Inside a code fence: pass content and markers through verbatim. */+ private pumpFence(eof: boolean): string {+ if (this.sol) {+ if (this.buf.length < 3 && !eof) return "";+ if (this.buf.startsWith("```")) {+ const nl = this.buf.indexOf("\n", 3);+ if (nl !== -1) {+ this.fence = false;+ const line = this.buf.slice(0, nl + 1);+ this.buf = this.buf.slice(nl + 1);+ this.sol = true;+ return line;+ }+ if (eof) {+ this.fence = false;+ const line = this.buf;+ this.buf = "";+ return line;+ }+ return "";+ }+ this.sol = false;+ }+ const nl = this.buf.indexOf("\n");+ if (nl !== -1) {+ const chunk = this.buf.slice(0, nl + 1);+ this.buf = this.buf.slice(nl + 1);+ this.sol = true;+ return chunk;+ }+ const chunk = this.buf;+ this.buf = "";+ return chunk;+ }++ /** At start of line: detect and consume line-start patterns, then transition to body. */+ private pumpSOL(eof: boolean): string {+ const b = this.buf;++ if (b[0] === "\n") {+ this.buf = b.slice(1);+ return "\n";+ }++ if (b[0] === "`") {+ if (b.length < 3 && !eof) return "";+ if (b.startsWith("```")) {+ const nl = b.indexOf("\n", 3);+ if (nl !== -1) {+ this.fence = true;+ const line = b.slice(0, nl + 1);+ this.buf = b.slice(nl + 1);+ this.sol = true;+ return line;+ }+ if (eof) {+ this.buf = "";+ return b;+ }+ return "";+ }+ this.sol = false;+ return "";+ }++ if (b[0] === ">") {+ this.sol = false;+ return "";+ }++ if (b[0] === "#") {+ let n = 0;+ while (n < b.length && b[n] === "#") n++;+ if (n === b.length && !eof) return "";+ if (n >= 5 && n <= 6 && n < b.length && b[n] === " ") {+ this.buf = b.slice(n + 1);+ this.sol = false;+ return "";+ }+ this.sol = false;+ return "";+ }++ if (b[0] === " " || b[0] === "\t") {+ if (b.search(/[^ \t]/) === -1 && !eof) return "";+ this.sol = false;+ return "";+ }++ if (b[0] === "-" || b[0] === "*" || b[0] === "_") {+ const ch = b[0];+ let j = 0;+ while (j < b.length && (b[j] === ch || b[j] === " ")) j++;+ if (j === b.length && !eof) return "";+ if (j === b.length || b[j] === "\n") {+ let count = 0;+ for (let k = 0; k < j; k++) if (b[k] === ch) count++;+ if (count >= 3) {+ if (j < b.length) {+ this.buf = b.slice(j + 1);+ this.sol = true;+ return b.slice(0, j + 1);+ }+ this.buf = "";+ return b;+ }+ }+ this.sol = false;+ return "";+ }++ this.sol = false;+ return "";+ }++ /** Scan line body for inline pattern triggers; output safe chars eagerly. */+ private pumpBody(eof: boolean): string {+ let out = "";+ let i = 0;+ while (i < this.buf.length) {+ const c = this.buf[i];+ if (c === "\n") {+ out += this.buf.slice(0, i + 1);+ this.buf = this.buf.slice(i + 1);+ this.sol = true;+ return out;+ }+ if (c === "!" && i + 1 < this.buf.length && this.buf[i + 1] === "[") {+ out += this.buf.slice(0, i);+ this.buf = this.buf.slice(i + 2);+ this.inl = { type: "image", acc: "" };+ return out;+ }+ if (c === "~") {+ i++;+ continue;+ }+ if (c === "*") {+ if (i + 2 < this.buf.length && this.buf[i + 1] === "*" && this.buf[i + 2] === "*") {+ out += this.buf.slice(0, i);+ this.buf = this.buf.slice(i + 3);+ this.inl = { type: "bold3", acc: "" };+ return out;+ }+ if (i + 1 < this.buf.length && this.buf[i + 1] === "*") {+ i += 2;+ continue;+ }+ if (i + 1 < this.buf.length && this.buf[i + 1] !== " " && this.buf[i + 1] !== "\n") {+ out += this.buf.slice(0, i);+ this.buf = this.buf.slice(i + 1);+ this.inl = { type: "italic", acc: "" };+ return out;+ }+ i++;+ continue;+ }+ if (c === "_") {+ if (i + 2 < this.buf.length && this.buf[i + 1] === "_" && this.buf[i + 2] === "_") {+ out += this.buf.slice(0, i);+ this.buf = this.buf.slice(i + 3);+ this.inl = { type: "ubold3", acc: "" };+ return out;+ }+ if (i + 1 < this.buf.length && this.buf[i + 1] === "_") {+ i += 2;+ continue;+ }+ if (i + 1 < this.buf.length && this.buf[i + 1] !== " " && this.buf[i + 1] !== "\n") {+ out += this.buf.slice(0, i);+ this.buf = this.buf.slice(i + 1);+ this.inl = { type: "uitalic", acc: "" };+ return out;+ }+ i++;+ continue;+ }+ i++;+ }++ let hold = 0;+ if (!eof) {+ if (this.buf.endsWith("**")) hold = 2;+ else if (this.buf.endsWith("__")) hold = 2;+ else if (this.buf.endsWith("*")) hold = 1;+ else if (this.buf.endsWith("_")) hold = 1;+ else if (this.buf.endsWith("!")) hold = 1;+ }+ out += this.buf.slice(0, this.buf.length - hold);+ this.buf = hold > 0 ? this.buf.slice(-hold) : "";+ return out;+ }++ /** Accumulate inline content until closing marker is found. */+ private pumpInline(_eof: boolean): string {+ if (!this.inl) return "";+ this.inl.acc += this.buf;+ this.buf = "";++ switch (this.inl.type) {+ case "bold3": {+ const idx = this.inl.acc.indexOf("***");+ if (idx !== -1) {+ const content = this.inl.acc.slice(0, idx);+ this.buf = this.inl.acc.slice(idx + 3);+ this.inl = null;+ if (StreamingMarkdownFilter.containsCJK(content)) return content;+ return `***${content}***`;+ }+ return "";+ }+ case "ubold3": {+ const idx = this.inl.acc.indexOf("___");+ if (idx !== -1) {+ const content = this.inl.acc.slice(0, idx);+ this.buf = this.inl.acc.slice(idx + 3);+ this.inl = null;+ if (StreamingMarkdownFilter.containsCJK(content)) return content;+ return `___${content}___`;+ }+ return "";+ }+ case "italic": {+ for (let j = 0; j < this.inl.acc.length; j++) {+ if (this.inl.acc[j] === "\n") {+ const r = "*" + this.inl.acc.slice(0, j + 1);+ this.buf = this.inl.acc.slice(j + 1);+ this.inl = null;+ this.sol = true;+ return r;+ }+ if (this.inl.acc[j] === "*") {+ if (j + 1 < this.inl.acc.length && this.inl.acc[j + 1] === "*") {+ j++;+ continue;+ }+ const content = this.inl.acc.slice(0, j);+ this.buf = this.inl.acc.slice(j + 1);+ this.inl = null;+ if (StreamingMarkdownFilter.containsCJK(content)) return content;+ return `*${content}*`;+ }+ }+ return "";+ }+ case "uitalic": {+ for (let j = 0; j < this.inl.acc.length; j++) {+ if (this.inl.acc[j] === "\n") {+ const r = "_" + this.inl.acc.slice(0, j + 1);+ this.buf = this.inl.acc.slice(j + 1);+ this.inl = null;+ this.sol = true;+ return r;+ }+ if (this.inl.acc[j] === "_") {+ if (j + 1 < this.inl.acc.length && this.inl.acc[j + 1] === "_") {+ j++;+ continue;+ }+ const content = this.inl.acc.slice(0, j);+ this.buf = this.inl.acc.slice(j + 1);+ this.inl = null;+ if (StreamingMarkdownFilter.containsCJK(content)) return content;+ return `_${content}_`;+ }+ }+ return "";+ }+ case "image": {+ const cb = this.inl.acc.indexOf("]");+ if (cb === -1) return "";+ if (cb + 1 >= this.inl.acc.length) return "";+ if (this.inl.acc[cb + 1] !== "(") {+ const r = "![" + this.inl.acc.slice(0, cb + 1);+ this.buf = this.inl.acc.slice(cb + 1);+ this.inl = null;+ return r;+ }+ const cp = this.inl.acc.indexOf(")", cb + 2);+ if (cp !== -1) {+ this.buf = this.inl.acc.slice(cp + 1);+ this.inl = null;+ return "";+ }+ return "";+ }+ }+ return "";+ }++ private static containsCJK(text: string): boolean {+ return /[\u2E80-\u9FFF\uAC00-\uD7AF\uF900-\uFAFF]/.test(text);+ }+}diff --git a/src/channels/weixin/quota.ts b/src/channels/weixin/quota.tsnew file mode 100644index 0000000..d290534--- /dev/null+++ b/src/channels/weixin/quota.ts@@ -0,0 +1,38 @@+import type { Store, WeixinPeer } from "../../store/db.js";++/**+ * iLink 出站配额:每收到用户一条消息后,24 小时内最多可向该用户发送 10 条。+ * 发送方在每条 sendmessage 前调用 tryConsume;超额的内容会被合并/丢弃并记录。+ */+export const QUOTA_PER_INBOUND = 10;+export const QUOTA_WINDOW_MS = 24 * 3600_000;++export class WeixinQuota {+ constructor(private store: Store, private botId: string, private now: () => number = Date.now) {}++ onInbound(userId: string, contextToken: string): WeixinPeer {+ const peer: WeixinPeer = {+ botId: this.botId,+ userId,+ contextToken: contextToken || this.store.getWeixinPeer(this.botId, userId)?.contextToken || "",+ quotaRemaining: QUOTA_PER_INBOUND,+ windowStartedAt: this.now(),+ };+ this.store.upsertWeixinPeer(peer);+ return peer;+ }++ remaining(userId: string): number {+ const p = this.store.getWeixinPeer(this.botId, userId);+ if (!p) return 0;+ if (this.now() - p.windowStartedAt > QUOTA_WINDOW_MS) return 0;+ return p.quotaRemaining;+ }++ tryConsume(userId: string): boolean {+ const p = this.store.getWeixinPeer(this.botId, userId);+ if (!p || this.remaining(userId) <= 0) return false;+ this.store.upsertWeixinPeer({ ...p, quotaRemaining: p.quotaRemaining - 1 });+ return true;+ }+}diff --git a/src/cli/init.ts b/src/cli/init.tsnew file mode 100644index 0000000..c053ad5--- /dev/null+++ b/src/cli/init.ts@@ -0,0 +1,88 @@+/**+ * 首次设置向导(终端版;界面里也能完成同样的设置):+ * 1. 模型服务商 + API Key → 写入内置 magpie 的隔离配置(key 经 stdin 传给 magpie CLI)+ * 2. 飞书 App ID / App Secret → 写入本程序数据库+ */+import readline from "node:readline";+import { stdin, stdout } from "node:process";+import { loadConfig } from "../config.js";+import { App } from "../app.js";++/** 行队列:兼容交互终端与管道输入(管道时所有行会一次性到达) */+function lineReader() {+ const tty = !!stdin.isTTY;+ const rl = readline.createInterface({ input: stdin, output: stdout, terminal: tty });+ const lines: string[] = [];+ const waiters: Array<(l: string | undefined) => void> = [];+ let closed = false;+ let muted = false;+ const r = rl as unknown as { _writeToOutput?: (s: string) => void };+ const orig = r._writeToOutput?.bind(rl);+ r._writeToOutput = (str: string) => {+ if (!muted) return orig?.(str);+ if (str.includes("\n") || str.includes("\r")) stdout.write("\n");+ else if (!str.startsWith("\x1b")) stdout.write("*".repeat([...str].length));+ };+ rl.on("line", (l) => (waiters.length ? waiters.shift()!(l) : lines.push(l)));+ rl.on("close", () => {+ closed = true;+ while (waiters.length) waiters.shift()!(undefined);+ });+ const next = () => (lines.length ? Promise.resolve(lines.shift()) : closed ? Promise.resolve(undefined) : new Promise<string | undefined>((res) => waiters.push(res)));+ return {+ async ask(q: string, secret = false): Promise<string> {+ stdout.write(q);+ muted = secret && tty;+ const l = await next();+ muted = false;+ if (!tty) stdout.write(secret ? "(已输入)\n" : `${l ?? ""}\n`);+ return (l ?? "").trim();+ },+ close: () => rl.close(),+ };+}++async function main(): Promise<void> {+ const config = loadConfig();+ const app = new App(config, { noWeb: true });+ const rl = lineReader();+ try {+ await setup(app, rl, config.dataDir);+ } finally {+ rl.close();+ await app.magpie?.stop();+ app.store.close();+ }+ console.log("\n完成。运行 npm start 启动;微信请在管理界面「渠道」页扫码,或运行 npm run weixin:login。");+}++async function setup(app: App, rl: ReturnType<typeof lineReader>, dataDir: string): Promise<void> {+ console.log(`anymodel bot 首次设置(数据目录:${dataDir})\n`);+ if (app.magpie) {+ if (!app.magpie.binPath) {+ throw new Error("找不到 magpie 可执行文件,请先运行:npm run setup");+ }+ await app.magpie.start();+ const preset = (await rl.ask("模型服务商预设(如 deepseek / openai / anthropic / moonshot-cn / qwen-cn,留空跳过;运行 build/bin/magpie presets 查看全部):")).trim();+ if (preset) {+ const key = await rl.ask(`${preset} API Key:`, true);+ if (key) {+ const id = await app.magpie.addPresetProvider(preset, key);+ console.log(`✓ 已添加服务商 ${id}`);+ }+ }+ }+ const appId = (await rl.ask("飞书 App ID(cli_xxx,留空跳过):")).trim();+ if (appId) {+ const secret = await rl.ask("飞书 App Secret:", true);+ let bot = app.store.listBots()[0];+ if (!bot) bot = app.store.createBot({ id: "default", name: "我的助手", weixinEnabled: true });+ app.store.updateBot(bot.id, { feishuAppId: appId, feishuAppSecret: secret });+ console.log(`✓ 已保存到机器人「${bot.name}」`);+ }+}++main().catch((e) => {+ console.error("设置失败:", (e as Error).message);+ process.exit(1);+});diff --git a/src/cli/weixin-login.ts b/src/cli/weixin-login.tsnew file mode 100644index 0000000..8be1d37--- /dev/null+++ b/src/cli/weixin-login.ts@@ -0,0 +1,29 @@+/** 终端扫码登录微信 iLink:二维码打印到终端并保存为 PNG。用法:npm run weixin:login [botId] */+import path from "node:path";+import { loadConfig } from "../config.js";+import { Store } from "../store/db.js";+import { WeixinLogin } from "../channels/weixin/login.js";++async function main(): Promise<void> {+ const config = loadConfig();+ const store = new Store(path.join(config.dataDir, "anymodel.db"));+ const botId = process.argv[2] || store.listBots()[0]?.id || "default";+ if (!store.getBot(botId)) store.createBot({ id: botId, name: "我的助手", weixinEnabled: true });+ const login = new WeixinLogin({+ apiBaseUrl: config.weixin.apiBaseUrl,+ pngPath: path.join(config.dataDir, "weixin", `${botId}-login-qr.png`),+ printTerminal: true,+ });+ login.subscribe((s) => s.message && console.log(`[${s.state}] ${s.message}`));+ const res = await login.run();+ if (!res) process.exit(1);+ store.saveWeixinAccount({ botId, botToken: res.botToken, ilinkBotId: res.ilinkBotId, baseUrl: res.baseUrl, ownerUserId: res.userId });+ store.updateBot(botId, { weixinEnabled: true });+ store.close();+ console.log("✓ 微信已连接,运行 npm start 开始收发消息(若已在运行,请重启或在界面中重新启用微信渠道)。");+}++main().catch((e) => {+ console.error((e as Error).message);+ process.exit(1);+});diff --git a/src/config.ts b/src/config.tsnew file mode 100644index 0000000..65a1f89--- /dev/null+++ b/src/config.ts@@ -0,0 +1,59 @@+import fs from "node:fs";+import path from "node:path";++/**+ * 配置:<dataDir>/config.json + 环境变量(环境变量优先)。+ * 机器人/渠道凭据存在 SQLite 中,由 UI 或 `npm run init` 写入。+ */+export interface AppConfig {+ dataDir: string;+ ui: { host: string; port: number; token: string };+ magpie: {+ /** managed:由本程序启动并守护内置 magpie;external:使用已有 OpenAI 兼容端点(测试/高级用法) */+ mode: "managed" | "external";+ binPath: string;+ externalBaseUrl: string;+ externalApiKey: string;+ };+ llm: { defaultModel: string; contextMessages: number; contextChars: number };+ feishu: { throttleMs: number };+ weixin: { apiBaseUrl: string };+}++export function defaultDataDir(): string {+ return process.env.AMB_DATA_DIR ? path.resolve(process.env.AMB_DATA_DIR) : path.resolve(process.cwd(), "data");+}++function num(v: string | undefined, d: number): number {+ const n = v === undefined || v === "" ? NaN : Number(v);+ return Number.isFinite(n) ? n : d;+}++export function loadConfig(overrides: { dataDir?: string; env?: NodeJS.ProcessEnv } = {}): AppConfig {+ const env = overrides.env ?? process.env;+ const dataDir = overrides.dataDir ?? (env.AMB_DATA_DIR ? path.resolve(env.AMB_DATA_DIR) : defaultDataDir());+ let file: Partial<AppConfig> & Record<string, any> = {};+ const p = path.join(dataDir, "config.json");+ if (fs.existsSync(p)) file = JSON.parse(fs.readFileSync(p, "utf8"));+ return {+ dataDir,+ ui: {+ host: env.AMB_UI_HOST || file.ui?.host || "127.0.0.1",+ port: num(env.AMB_UI_PORT, file.ui?.port ?? 3600),+ token: env.AMB_UI_TOKEN || file.ui?.token || "",+ },+ magpie: {+ mode: (env.AMB_MAGPIE_BASE_URL ? "external" : file.magpie?.mode) || "managed",+ binPath: env.AMB_MAGPIE_BIN || file.magpie?.binPath || "",+ externalBaseUrl: env.AMB_MAGPIE_BASE_URL || file.magpie?.externalBaseUrl || "",+ externalApiKey: env.AMB_MAGPIE_API_KEY || file.magpie?.externalApiKey || "",+ },+ llm: {+ defaultModel: env.AMB_DEFAULT_MODEL || file.llm?.defaultModel || "",+ contextMessages: num(env.AMB_CONTEXT_MESSAGES, file.llm?.contextMessages ?? 40),+ contextChars: num(env.AMB_CONTEXT_CHARS, file.llm?.contextChars ?? 24000),+ },+ feishu: { throttleMs: num(env.AMB_FEISHU_THROTTLE_MS, file.feishu?.throttleMs ?? 400) },+ weixin: { apiBaseUrl: env.AMB_WEIXIN_API_BASE || file.weixin?.apiBaseUrl || "https://ilinkai.weixin.qq.com" },+ };+}diff --git a/src/core/queue.ts b/src/core/queue.tsnew file mode 100644index 0000000..cb1523e--- /dev/null+++ b/src/core/queue.ts@@ -0,0 +1,40 @@+/** 按 key 串行执行(同一会话的消息按到达顺序处理),不同 key 并行。 */+export class KeyedQueue {+ private tails = new Map<string, Promise<void>>();++ run(key: string, task: () => Promise<void>): Promise<void> {+ const prev = this.tails.get(key) ?? Promise.resolve();+ const next = prev.then(task, task).catch(() => {});+ this.tails.set(key, next);+ void next.then(() => {+ if (this.tails.get(key) === next) this.tails.delete(key);+ });+ return next;+ }++ get size(): number {+ return this.tails.size;+ }+}++/** 带 TTL 的去重集合(飞书事件 3 秒未确认会重推)。 */+export class Dedup {+ private seen = new Map<string, number>();+ constructor(private ttlMs = 10 * 60_000, private max = 5000) {}++ /** 第一次见到返回 true,重复返回 false。 */+ firstSeen(id: string, now = Date.now()): boolean {+ this.gc(now);+ const t = this.seen.get(id);+ if (t !== undefined && now - t <= this.ttlMs) return false;+ this.seen.set(id, now);+ return true;+ }++ private gc(now: number): void {+ if (this.seen.size < this.max / 2) return;+ for (const [k, t] of this.seen) {+ if (now - t > this.ttlMs || this.seen.size > this.max) this.seen.delete(k);+ }+ }+}diff --git a/src/core/runtime.ts b/src/core/runtime.tsnew file mode 100644index 0000000..953af83--- /dev/null+++ b/src/core/runtime.ts@@ -0,0 +1,135 @@+import type { InboundEvent, ReplySession } from "./types.js";+import { eventText } from "./types.js";+import type { ModelClient, ChatMessage } from "../llm/client.js";+import type { Store } from "../store/db.js";+import { logger } from "../log.js";++const log = logger("runtime");++export interface RuntimeOptions {+ store: Store;+ models: ModelClient;+ defaultModel: () => string;+ contextMessages: number;+ contextChars: number;+}++const HELP = [+ "可用命令:",+ "/model — 列出可用模型(带编号)",+ "/model <编号或模型名> — 切换当前会话的模型",+ "/reset — 清空当前会话的上下文",+ "/status — 查看当前会话使用的模型",+ "/help — 显示本帮助",+].join("\n");++/** 渠道无关的对话运行时:命令处理、上下文拼装、流式调用模型、持久化。 */+export class BotRuntime {+ private modelCache: { at: number; list: string[] } | undefined;+ constructor(private opts: RuntimeOptions) {}++ async listModels(force = false): Promise<string[]> {+ if (!force && this.modelCache && Date.now() - this.modelCache.at < 30_000) return this.modelCache.list;+ const list = await this.opts.models.listModels();+ this.modelCache = { at: Date.now(), list };+ return list;+ }++ private async resolveModel(convModel: string, botModel: string): Promise<string> {+ const m = convModel || botModel || this.opts.defaultModel();+ if (m) return m;+ const list = await this.listModels();+ if (!list.length) throw new Error("没有可用模型:请先在「模型」页(magpie)添加服务商并配置 API Key");+ return list[0];+ }++ async handle(ev: InboundEvent, out: ReplySession): Promise<void> {+ const { store } = this.opts;+ const bot = store.getBot(ev.botId);+ if (!bot) throw new Error(`unknown bot ${ev.botId}`);+ const conv = store.ensureConversation(bot.id, ev.channel, ev.conversation.id, ev.sender.name || ev.sender.id);+ const text = eventText(ev);+ if (!text) return;++ if (text.startsWith("/")) {+ const reply = await this.command(text, conv.id, conv.model, bot.defaultModel);+ if (reply !== null) {+ await out.apply({ type: "text", text: reply });+ return;+ }+ }++ const model = await this.resolveModel(conv.model, bot.defaultModel).catch(async (e: Error) => {+ await out.apply({ type: "text", text: `⚠️ ${e.message}` });+ return "";+ });+ if (!model) return;++ store.addMessage(conv.id, "user", text);+ const history = store.contextWindow(conv.id, this.opts.contextMessages, this.opts.contextChars);+ const messages: ChatMessage[] = [];+ if (bot.systemPrompt.trim()) messages.push({ role: "system", content: bot.systemPrompt });+ for (const m of history) if (m.role !== "system") messages.push({ role: m.role, content: m.content });++ await out.apply({ type: "typing", on: true });+ await out.apply({ type: "stream.start" });+ let acc = "";+ try {+ const full = await this.opts.models.streamChat({ model, messages }, (delta) => {+ acc += delta;+ void out.apply({ type: "stream.update", text: acc });+ });+ const finalText = full || acc || "(模型没有返回内容)";+ store.addMessage(conv.id, "assistant", finalText);+ await out.apply({ type: "stream.finish", text: finalText });+ } catch (e) {+ const err = e as Error & { status?: number };+ log.warn("model call failed", { model, status: err.status, message: err.message });+ const msg = acc ? `${acc}\n\n⚠️ 生成中断:${err.message}` : `⚠️ 模型调用失败(${model}):${err.message}`;+ await out.apply({ type: "stream.finish", text: msg });+ } finally {+ await out.apply({ type: "typing", on: false });+ }+ }++ /** 返回 null 表示不是已知命令,按普通消息处理。 */+ private async command(text: string, convId: string, convModel: string, botModel: string): Promise<string | null> {+ const [cmd, ...rest] = text.trim().split(/\s+/);+ const arg = rest.join(" ");+ switch (cmd.toLowerCase()) {+ case "/help":+ return HELP;+ case "/reset":+ this.opts.store.clearMessages(convId);+ return "✅ 已清空本会话上下文";+ case "/status": {+ const m = convModel || botModel || this.opts.defaultModel() || "(自动:第一个可用模型)";+ return `当前模型:${m}${convModel ? "(会话设置)" : ""}`;+ }+ case "/model": {+ let list: string[];+ try {+ list = await this.listModels(true);+ } catch (e) {+ return `⚠️ 获取模型列表失败:${(e as Error).message}`;+ }+ if (!arg) {+ const cur = convModel || botModel || this.opts.defaultModel();+ if (!list.length) return "暂无可用模型,请先在「模型」页添加服务商。";+ return ["可用模型(回复 /model 编号 切换):", ...list.map((m, i) => `${i + 1}. ${m}${m === cur ? " ← 当前" : ""}`)].join("\n");+ }+ if (arg === "default" || arg === "reset") {+ this.opts.store.setConversationModel(convId, "");+ return "✅ 已恢复为机器人默认模型";+ }+ const idx = /^\d+$/.test(arg) ? Number(arg) - 1 : -1;+ const target = idx >= 0 ? list[idx] : list.find((m) => m === arg) ?? list.find((m) => m.endsWith("/" + arg) || m.includes(arg));+ if (!target) return `⚠️ 找不到模型「${arg}」,发送 /model 查看列表`;+ this.opts.store.setConversationModel(convId, target);+ return `✅ 本会话已切换到 ${target}`;+ }+ default:+ return null;+ }+ }+}diff --git a/src/core/types.ts b/src/core/types.tsnew file mode 100644index 0000000..bf86dad--- /dev/null+++ b/src/core/types.ts@@ -0,0 +1,95 @@+/**+ * 统一消息/事件模型:渠道把平台消息归一化成 InboundEvent,+ * 运行时只产出 OutboundOp,由渠道按自身能力(ChannelCapabilities)落地或降级。+ */+export type ChannelId = "feishu" | "weixin" | "web";++export type Part =+ | { type: "text"; text: string }+ | { type: "image" | "file" | "video"; ref?: string; name?: string }+ | { type: "voice"; ref?: string; transcript?: string }+ | { type: "quote"; text: string };++export interface InboundEvent {+ /** 平台消息 ID,用于去重 */+ id: string;+ channel: ChannelId;+ botId: string;+ conversation: { kind: "dm" | "group"; id: string };+ sender: { id: string; name?: string };+ parts: Part[];+ mentions?: string[];+ /** 回复所需的平台句柄:飞书 message_id / 微信 context_token 等 */+ replyHandle: Record<string, string>;+ receivedAt: number;+}++export type OutboundOp =+ | { type: "typing"; on: boolean }+ | { type: "stream.start" }+ | { type: "stream.update"; text: string }+ | { type: "stream.finish"; text: string }+ | { type: "text"; text: string }+ /** P2:ask_user / approval / secret_request 等交互,按能力映射到卡片或编号文本 */+ | { type: "interactive"; kind: "ask_user" | "approval" | "secret_request"; prompt: string; options?: string[] };++export interface ChannelCapabilities {+ streaming: boolean;+ cards: boolean;+ groups: boolean;+ mentions: boolean;+ typing: boolean;+ /** 单条消息建议的最大字符数 */+ maxTextLength: number;+ /** 是否存在主动发消息配额(微信 iLink:每次入站后 24h 内 10 条) */+ proactiveQuota: boolean;+}++/** 一次回复的出站会话:运行时依次 apply OutboundOp。 */+export interface ReplySession {+ apply(op: OutboundOp): Promise<void>;+}++export type ChannelStatus = {+ state: "disabled" | "connecting" | "connected" | "error" | "expired" | "paused" | "login_required";+ detail?: string;+ since: number;+};++export function eventText(ev: InboundEvent): string {+ return ev.parts+ .map((p) => {+ switch (p.type) {+ case "text":+ return p.text;+ case "quote":+ return `> ${p.text}`;+ case "voice":+ return p.transcript ? p.transcript : "[语音]";+ case "image":+ return "[图片]";+ case "file":+ return `[文件${p.name ? " " + p.name : ""}]`;+ case "video":+ return "[视频]";+ }+ })+ .join("\n")+ .trim();+}++/** 按段落/换行优先切分长文本。 */+export function splitText(text: string, limit: number): string[] {+ if (text.length <= limit) return text ? [text] : [];+ const out: string[] = [];+ let rest = text;+ while (rest.length > limit) {+ let cut = rest.lastIndexOf("\n\n", limit);+ if (cut < limit * 0.5) cut = rest.lastIndexOf("\n", limit);+ if (cut < limit * 0.5) cut = limit;+ out.push(rest.slice(0, cut).trimEnd());+ rest = rest.slice(cut).replace(/^\n+/, "");+ }+ if (rest) out.push(rest);+ return out;+}diff --git a/src/llm/client.ts b/src/llm/client.tsnew file mode 100644index 0000000..a3075e3--- /dev/null+++ b/src/llm/client.ts@@ -0,0 +1,119 @@+/**+ * 模型访问接口。默认实现指向受管 magpie 的 OpenAI 兼容 /v1(流式 SSE)。+ * 运行时只依赖 ModelClient,可替换为任意 OpenAI 兼容端点。+ */+export interface ChatMessage {+ role: "system" | "user" | "assistant";+ content: string;+}++export interface ChatRequest {+ model: string;+ messages: ChatMessage[];+ signal?: AbortSignal;+}++export interface ModelClient {+ listModels(): Promise<string[]>;+ /** 流式生成;onDelta 收到增量文本;返回完整文本 */+ streamChat(req: ChatRequest, onDelta: (delta: string) => void): Promise<string>;+}++export interface Endpoint {+ baseUrl: string; // 形如 http://127.0.0.1:1234/v1+ apiKey: string;+}++export class OpenAICompatClient implements ModelClient {+ constructor(private endpoint: () => Endpoint, private fetchImpl: typeof fetch = fetch) {}++ private headers(): Record<string, string> {+ const { apiKey } = this.endpoint();+ return { "Content-Type": "application/json", ...(apiKey ? { Authorization: `Bearer ${apiKey}` } : {}) };+ }++ async listModels(): Promise<string[]> {+ const res = await this.fetchImpl(`${this.endpoint().baseUrl}/models`, { headers: this.headers() });+ if (!res.ok) throw new Error(`GET /models -> HTTP ${res.status}`);+ const body = (await res.json()) as { data?: Array<{ id: string }> };+ return (body.data ?? []).map((m) => m.id).sort();+ }++ async streamChat(req: ChatRequest, onDelta: (delta: string) => void): Promise<string> {+ const res = await this.fetchImpl(`${this.endpoint().baseUrl}/chat/completions`, {+ method: "POST",+ headers: { ...this.headers(), Accept: "text/event-stream" },+ body: JSON.stringify({ model: req.model, messages: req.messages, stream: true }),+ signal: req.signal,+ });+ if (!res.ok || !res.body) {+ const detail = await res.text().catch(() => "");+ throw new ModelError(`HTTP ${res.status}`, res.status, detail.slice(0, 500));+ }+ let full = "";+ const parser = new SSEParser((data) => {+ if (data === "[DONE]") return;+ let chunk: { choices?: Array<{ delta?: { content?: string | null }; message?: { content?: string } }>; error?: { message?: string } };+ try {+ chunk = JSON.parse(data);+ } catch {+ return;+ }+ if (chunk.error) throw new ModelError(chunk.error.message || "upstream error", 502, "");+ const delta = chunk.choices?.[0]?.delta?.content ?? chunk.choices?.[0]?.message?.content ?? "";+ if (delta) {+ full += delta;+ onDelta(delta);+ }+ });+ const decoder = new TextDecoder();+ for await (const bytes of res.body as unknown as AsyncIterable<Uint8Array>) {+ parser.push(decoder.decode(bytes, { stream: true }));+ }+ parser.push(decoder.decode());+ parser.end();+ return full;+ }+}++export class ModelError extends Error {+ constructor(message: string, readonly status: number, readonly detail: string) {+ super(message);+ }+}++/** 最小 SSE 解析器:按空行切事件,拼接多行 data:。 */+export class SSEParser {+ private buf = "";+ private data: string[] = [];+ constructor(private onData: (data: string) => void) {}++ push(text: string): void {+ this.buf += text;+ let idx: number;+ while ((idx = this.buf.search(/\r?\n/)) >= 0) {+ const line = this.buf.slice(0, idx);+ this.buf = this.buf.slice(idx + (this.buf[idx] === "\r" ? 2 : 1));+ this.line(line);+ }+ }++ end(): void {+ if (this.buf) this.line(this.buf);+ this.buf = "";+ this.line("");+ }++ private line(line: string): void {+ if (line === "") {+ if (this.data.length) {+ const d = this.data.join("\n");+ this.data = [];+ this.onData(d);+ }+ return;+ }+ if (line.startsWith(":")) return;+ if (line.startsWith("data:")) this.data.push(line.slice(5).replace(/^ /, ""));+ }+}diff --git a/src/log.ts b/src/log.tsnew file mode 100644index 0000000..98a5816--- /dev/null+++ b/src/log.ts@@ -0,0 +1,55 @@+/** 极简日志:统一脱敏,任何密钥/令牌都不会原样写进日志。 */+type Level = "debug" | "info" | "warn" | "error";+const ORDER: Record<Level, number> = { debug: 10, info: 20, warn: 30, error: 40 };+let threshold: Level = (process.env.AMB_LOG_LEVEL as Level) || "info";++const SECRET_KEYS = /(secret|token|password|api[_-]?key|authorization|cookie|aeskey|bot_token|context_token|key)$/i;+const SECRET_VALUE = /\b(sk-[A-Za-z0-9_-]{6,}|Bearer\s+[A-Za-z0-9._~+/=-]{6,})/g;++export function setLogLevel(level: Level): void {+ threshold = level;+}++export function redactValue(value: unknown, depth = 0): unknown {+ if (depth > 6) return "[depth]";+ if (typeof value === "string") return value.replace(SECRET_VALUE, (m) => m.slice(0, 4) + "***");+ if (Array.isArray(value)) return value.map((v) => redactValue(v, depth + 1));+ if (value && typeof value === "object") {+ const out: Record<string, unknown> = {};+ for (const [k, v] of Object.entries(value as Record<string, unknown>)) {+ out[k] = SECRET_KEYS.test(k) && v ? "***" : redactValue(v, depth + 1);+ }+ return out;+ }+ return value;+}++/** 只显示末 4 位,用于界面展示。 */+export function mask(secret: string | undefined | null): string {+ if (!secret) return "";+ return secret.length <= 4 ? "****" : "****" + secret.slice(-4);+}++function emit(level: Level, scope: string, msg: string, extra?: unknown): void {+ if (ORDER[level] < ORDER[threshold]) return;+ const ts = new Date().toISOString();+ const line = `${ts} ${level.toUpperCase().padEnd(5)} [${scope}] ${redactValue(msg)}` ++ (extra === undefined ? "" : " " + JSON.stringify(redactValue(extra)));+ (level === "error" || level === "warn" ? process.stderr : process.stdout).write(line + "\n");+}++export interface Logger {+ debug(msg: string, extra?: unknown): void;+ info(msg: string, extra?: unknown): void;+ warn(msg: string, extra?: unknown): void;+ error(msg: string, extra?: unknown): void;+}++export function logger(scope: string): Logger {+ return {+ debug: (m, e) => emit("debug", scope, m, e),+ info: (m, e) => emit("info", scope, m, e),+ warn: (m, e) => emit("warn", scope, m, e),+ error: (m, e) => emit("error", scope, m, e),+ };+}diff --git a/src/magpie/supervisor.ts b/src/magpie/supervisor.tsnew file mode 100644index 0000000..54f48e3--- /dev/null+++ b/src/magpie/supervisor.ts@@ -0,0 +1,436 @@+import { execFileSync, spawn, type ChildProcess } from "node:child_process";+import crypto from "node:crypto";+import fs from "node:fs";+import net from "node:net";+import path from "node:path";+import { fileURLToPath } from "node:url";+import { logger } from "../log.js";++const log = logger("magpie");++/**+ * 内置 magpie 守护进程:+ * - 独立 HOME / XDG_CONFIG_HOME(在本程序数据目录内),不读取用户已有的 Claude/Codex 等订阅凭据,+ * 不改写任何 agent 配置(gateway 模式 + 隔离 HOME 下没有可检测的 agent);+ * - 关闭自动更新、账户发现、统计、handover;+ * - 空闲端口 + 自动生成的 web key / gateway key;+ * - 健康检查(/v1/models)、崩溃重启(指数退避)、优雅退出。+ */+export interface MagpieOptions {+ dataDir: string;+ binPath?: string;+ gatewayPort?: number;+ webPort?: number;+ healthTimeoutMs?: number;+}++export type MagpieState = "stopped" | "starting" | "running" | "restarting" | "failed";++interface Keys {+ webKey: string;+ gatewayKey: string;+ gatewayKeyRegistered?: boolean;+}++export function findAppRoot(start = path.dirname(fileURLToPath(import.meta.url))): string {+ let dir = start;+ for (let i = 0; i < 6; i++) {+ const pj = path.join(dir, "package.json");+ if (fs.existsSync(pj)) {+ try {+ if (JSON.parse(fs.readFileSync(pj, "utf8")).name === "anymodel-bot") return dir;+ } catch {+ /* ignore */+ }+ }+ dir = path.dirname(dir);+ }+ return process.cwd();+}++export function magpieBinaryName(platform = process.platform, arch = process.arch): string {+ return `magpie-${platform}-${arch}${platform === "win32" ? ".exe" : ""}`;+}++/** 查找 magpie 可执行文件:显式路径 → Electron resources → build/bin(按平台命名 / 通用名)。 */+export function resolveMagpieBinary(explicit?: string): string | undefined {+ const exe = process.platform === "win32" ? ".exe" : "";+ const candidates = [+ explicit,+ process.env.AMB_MAGPIE_BIN,+ (process as any).resourcesPath ? path.join((process as any).resourcesPath, "magpie", `magpie${exe}`) : undefined,+ path.join(findAppRoot(), "build", "bin", magpieBinaryName()),+ path.join(findAppRoot(), "build", "bin", `magpie${exe}`),+ ].filter(Boolean) as string[];+ return candidates.find((p) => fs.existsSync(p));+}++export function freePort(): Promise<number> {+ return new Promise((resolve, reject) => {+ const s = net.createServer();+ s.unref();+ s.on("error", reject);+ s.listen(0, "127.0.0.1", () => {+ const port = (s.address() as net.AddressInfo).port;+ s.close(() => resolve(port));+ });+ });+}++function genKey(): string {+ return crypto.randomBytes(24).toString("base64url"); // [A-Za-z0-9-_],满足 MAGPIE_WEB_KEY 要求+}++export class MagpieSupervisor {+ state: MagpieState = "stopped";+ lastError = "";+ restarts = 0;+ gatewayPort = 0;+ webPort = 0;+ readonly binPath: string | undefined;+ private child: ChildProcess | undefined;+ private stopping = false;+ private keys!: Keys;+ private readonly root: string;+ private restartTimer: NodeJS.Timeout | undefined;+ private logTail: string[] = [];++ constructor(private opts: MagpieOptions) {+ this.root = path.join(opts.dataDir, "magpie");+ this.binPath = resolveMagpieBinary(opts.binPath);+ }++ get baseUrl(): string {+ return `http://127.0.0.1:${this.gatewayPort}/v1`;+ }+ get gatewayKey(): string {+ return this.keys?.gatewayKey ?? "";+ }+ get webKey(): string {+ return this.keys?.webKey ?? "";+ }+ get webOrigin(): string {+ return `http://127.0.0.1:${this.webPort}`;+ }+ get cookieName(): string {+ return `magpie_web_${this.webPort}`;+ }+ get recentLog(): string[] {+ return this.logTail.slice(-50);+ }++ /** magpie 子进程环境:完全隔离,不继承用户 HOME。 */+ env(): NodeJS.ProcessEnv {+ const home = path.join(this.root, "home");+ const cfg = path.join(this.root, "config");+ const keep = ["PATH", "SystemRoot", "TEMP", "TMP", "TMPDIR", "LANG", "TZ", "HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY", "http_proxy", "https_proxy", "no_proxy", "SSL_CERT_FILE", "SSL_CERT_DIR"];+ const env: NodeJS.ProcessEnv = {};+ for (const k of keep) if (process.env[k]) env[k] = process.env[k];+ return {+ ...env,+ HOME: home,+ USERPROFILE: home,+ XDG_CONFIG_HOME: cfg,+ XDG_DATA_HOME: path.join(home, ".local", "share"),+ XDG_CACHE_HOME: path.join(home, ".cache"),+ APPDATA: path.join(home, "AppData", "Roaming"),+ LOCALAPPDATA: path.join(home, "AppData", "Local"),+ MAGPIE_NO_ACCOUNTS: "1",+ MAGPIE_NO_STATS: "1",+ MAGPIE_NO_HANDOVER: "1",+ DO_NOT_TRACK: "1",+ MAGPIE_UPDATE_FEED: "http://127.0.0.1:9/disabled",+ MAGPIE_WEB_KEY: this.keys.webKey,+ MAGPIE_ADDR: `127.0.0.1:${this.gatewayPort}`,+ };+ }++ private prepare(): void {+ const home = path.join(this.root, "home");+ const cfgDir = path.join(this.root, "config", "magpie");+ fs.mkdirSync(home, { recursive: true });+ fs.mkdirSync(cfgDir, { recursive: true, mode: 0o700 });+ // 预写设置:关闭自动更新与账户(订阅凭据)发现;保留 magpie 写入的其它字段+ const settingsPath = path.join(cfgDir, "settings.json");+ let settings: Record<string, unknown> = {};+ try {+ settings = JSON.parse(fs.readFileSync(settingsPath, "utf8"));+ } catch {+ /* new */+ }+ settings.noAutoUpdate = true;+ settings.noAccountDiscovery = true;+ fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2), { mode: 0o600 });++ const keysPath = path.join(this.root, "keys.json");+ try {+ this.keys = JSON.parse(fs.readFileSync(keysPath, "utf8"));+ } catch {+ this.keys = { webKey: genKey(), gatewayKey: "amb-" + genKey() };+ }+ this.saveKeys();+ }++ private saveKeys(): void {+ fs.writeFileSync(path.join(this.root, "keys.json"), JSON.stringify(this.keys), { mode: 0o600 });+ }++ /** 运行一次 magpie CLI(同一隔离环境)。secret 通过 stdin 传入,不出现在命令行参数里。 */+ runCli(args: string[], stdin?: string, timeoutMs = 20_000): Promise<{ code: number; stdout: string; stderr: string }> {+ if (!this.binPath) return Promise.reject(new Error("找不到 magpie 可执行文件,请先运行 npm run setup"));+ if (!this.keys) this.prepare();+ return new Promise((resolve, reject) => {+ const p = spawn(this.binPath!, args, { env: this.env(), stdio: ["pipe", "pipe", "pipe"] });+ let stdout = "";+ let stderr = "";+ const t = setTimeout(() => p.kill("SIGKILL"), timeoutMs);+ p.stdout.on("data", (d) => (stdout += d));+ p.stderr.on("data", (d) => (stderr += d));+ p.on("error", (e) => {+ clearTimeout(t);+ reject(e);+ });+ p.on("close", (code) => {+ clearTimeout(t);+ resolve({ code: code ?? -1, stdout, stderr });+ });+ p.stdin.end(stdin ?? "");+ });+ }++ async start(): Promise<void> {+ if (!this.binPath) {+ this.state = "failed";+ this.lastError = "找不到 magpie 可执行文件(运行 npm run setup 从 vendor/magpie 构建)";+ throw new Error(this.lastError);+ }+ this.stopping = false;+ this.prepare();+ this.reapStale();+ this.gatewayPort ||= this.opts.gatewayPort || (await freePort());+ this.webPort ||= this.opts.webPort || (await freePort());+ if (!this.keys.gatewayKeyRegistered) {+ // 注册专用 gateway key(loopback 本可免 key,这里仍使用独立 key,便于将来开放局域网/Docker)+ const r = await this.runCli(["gateway-key", "add", "anymodel-bot", "--key", "-"], this.keys.gatewayKey);+ if (r.code === 0) {+ this.keys.gatewayKeyRegistered = true;+ this.saveKeys();+ } else log.warn("gateway-key add failed (loopback still works)", { stderr: r.stderr.slice(0, 200) });+ }+ await this.spawnOnce();+ }++ private async spawnOnce(): Promise<void> {+ this.state = this.restarts ? "restarting" : "starting";+ const args = ["web", "--addr", `127.0.0.1:${this.webPort}`, "--no-open", "--gateway"];+ const child = spawn(this.binPath!, args, { env: this.env(), stdio: ["ignore", "pipe", "pipe"] });+ this.child = child;+ if (child.pid) fs.writeFileSync(this.pidFile, String(child.pid));+ const onLine = (d: Buffer) => {+ for (const line of d.toString().split(/\r?\n/)) {+ if (!line.trim()) continue;+ // magpie 打印的启动链接含 ?k=<web key>,记录前脱敏+ const safe = line.replaceAll(this.keys.webKey, "***").replaceAll(this.keys.gatewayKey, "***");+ this.logTail.push(safe);+ if (this.logTail.length > 200) this.logTail.shift();+ log.debug(safe);+ }+ };+ child.stdout?.on("data", onLine);+ child.stderr?.on("data", onLine);+ child.on("exit", (code, signal) => {+ if (this.child !== child) return;+ this.child = undefined;+ if (this.stopping) {+ this.state = "stopped";+ return;+ }+ this.lastError = `magpie exited (code=${code}, signal=${signal})`;+ log.warn(this.lastError);+ this.scheduleRestart();+ });+ try {+ await this.waitHealthy(this.opts.healthTimeoutMs ?? 20_000);+ this.state = "running";+ log.info(`magpie running: gateway 127.0.0.1:${this.gatewayPort}, web 127.0.0.1:${this.webPort}`);+ } catch (e) {+ this.lastError = (e as Error).message;+ if (this.child === child) child.kill("SIGKILL");+ throw e;+ }+ }++ private scheduleRestart(): void {+ this.restarts++;+ const delay = Math.min(30_000, 500 * 2 ** Math.min(this.restarts, 6));+ this.state = "restarting";+ this.restartTimer = setTimeout(() => {+ this.restartTimer = undefined;+ this.spawnOnce().catch((e) => {+ log.error("magpie restart failed", { message: (e as Error).message });+ if (!this.stopping) this.scheduleRestart();+ });+ }, delay);+ }++ async healthy(): Promise<boolean> {+ try {+ const res = await fetch(`${this.baseUrl}/models`, { headers: { Authorization: `Bearer ${this.gatewayKey}` }, signal: AbortSignal.timeout(2000) });+ return res.ok;+ } catch {+ return false;+ }+ }++ private async waitHealthy(timeoutMs: number): Promise<void> {+ const deadline = Date.now() + timeoutMs;+ while (Date.now() < deadline) {+ if (!this.child) throw new Error("magpie exited during startup: " + this.recentLog.slice(-3).join(" | "));+ if (await this.healthy()) {+ try {+ const r = await fetch(this.webOrigin + "/", { headers: { Cookie: `${this.cookieName}=${this.webKey}` }, signal: AbortSignal.timeout(2000) });+ if (r.ok) return;+ } catch {+ /* retry */+ }+ }+ await new Promise((r) => setTimeout(r, 200));+ }+ throw new Error("magpie health check timed out");+ }++ private get pidFile(): string {+ return path.join(this.root, "magpie.pid");+ }++ /** 上次本程序被强杀时可能残留 magpie 子进程:按 pid 文件确认是 magpie 后结束它(Linux/macOS) */+ private reapStale(): void {+ let pid = 0;+ try {+ pid = Number(fs.readFileSync(this.pidFile, "utf8").trim());+ } catch {+ return;+ }+ if (!pid || pid === this.child?.pid) return;+ try {+ process.kill(pid, 0);+ } catch {+ return; // 已不存在+ }+ let cmd = "";+ try {+ if (process.platform === "linux") cmd = fs.readFileSync(`/proc/${pid}/cmdline`, "utf8").replaceAll("\0", " ");+ else if (process.platform === "darwin") cmd = execFileSync("ps", ["-p", String(pid), "-o", "command="], { encoding: "utf8" });+ } catch {+ return;+ }+ if (this.binPath && cmd.includes(path.basename(this.binPath)) && cmd.includes(" web ")) {+ log.warn(`结束残留的 magpie 进程 ${pid}`);+ try {+ process.kill(pid, "SIGKILL");+ } catch {+ /* ignore */+ }+ }+ }++ /** 测试用:模拟崩溃 */+ killForTest(): void {+ this.child?.kill("SIGKILL");+ }++ async stop(): Promise<void> {+ this.stopping = true;+ if (this.restartTimer) clearTimeout(this.restartTimer);+ const child = this.child;+ if (!child) {+ this.state = "stopped";+ return;+ }+ await new Promise<void>((resolve) => {+ const t = setTimeout(() => child.kill("SIGKILL"), 5000);+ child.once("exit", () => {+ clearTimeout(t);+ resolve();+ });+ child.kill(process.platform === "win32" ? undefined : "SIGTERM");+ });+ this.child = undefined;+ this.state = "stopped";+ }++ // ---------- 服务商管理(首次设置 / UI) ----------+ async addPresetProvider(preset: string, apiKey: string): Promise<string> {+ if (!/^[a-z0-9-]+$/.test(preset)) throw new Error("invalid preset id");+ // 先用占位 key 创建,再通过 stdin 设置真实 key,避免密钥出现在进程参数里+ const add = await this.runCli(["provider", "add", preset, "placeholder-key"]);+ if (add.code !== 0) throw new Error(`provider add failed: ${(add.stderr || add.stdout).trim().slice(0, 300)}`);+ const id = await this.findProviderId(preset);+ await this.setProviderKey(id, apiKey);+ return id;+ }++ async addCustomProvider(name: string, url: string, apiKey: string, models: string[]): Promise<string> {+ const args = ["provider", "add", name, `url=${url}`, "key=placeholder-key"];+ if (models.length) args.push(`models=${models.join(",")}`);+ const add = await this.runCli(args);+ if (add.code !== 0) throw new Error(`provider add failed: ${(add.stderr || add.stdout).trim().slice(0, 300)}`);+ const id = await this.findProviderId(name);+ if (apiKey) await this.setProviderKey(id, apiKey);+ return id;+ }++ /**+ * 设置服务商 API Key。magpie CLI 只接受命令行参数形式的 key(会出现在进程列表里),+ * 所以改走 magpie 自己界面使用的 POST /api/provider/save(key 在请求体里,仅回环、带 web key)。+ */+ async setProviderKey(id: string, apiKey: string): Promise<void> {+ if (this.state !== "running") throw new Error("magpie 未运行,无法保存 API Key");+ const p = this.readProviderRaw(id);+ if (!p) throw new Error(`provider ${id} not found`);+ const res = await fetch(`${this.webOrigin}/api/provider/save`, {+ method: "POST",+ headers: { "content-type": "application/json", cookie: `${this.cookieName}=${this.webKey}`, origin: this.webOrigin },+ body: JSON.stringify({ ...p, key: apiKey, from: id }),+ signal: AbortSignal.timeout(15_000),+ });+ if (!res.ok) throw new Error(`保存 API Key 失败:HTTP ${res.status} ${(await res.text()).slice(0, 200)}`);+ if (this.readProviderRaw(id)?.key !== apiKey) throw new Error("保存 API Key 后校验失败");+ }++ private readProviderRaw(id: string): Record<string, unknown> | undefined {+ const f = path.join(this.root, "config", "magpie", "providers.json");+ if (!fs.existsSync(f)) return undefined;+ const j = JSON.parse(fs.readFileSync(f, "utf8"));+ const arr: any[] = Array.isArray(j) ? j : j.providers ?? [];+ return arr.find((x) => x.id === id);+ }++ /** 读取 magpie 的 providers.json(只取 id/name,不外传 key) */+ listProviders(): Array<{ id: string; name: string }> {+ for (const f of ["providers.json", "config.json"]) {+ const p = path.join(this.root, "config", "magpie", f);+ if (!fs.existsSync(p)) continue;+ try {+ const j = JSON.parse(fs.readFileSync(p, "utf8"));+ const arr = Array.isArray(j) ? j : Array.isArray(j.providers) ? j.providers : [];+ if (arr.length) return arr.map((x: any) => ({ id: String(x.id ?? ""), name: String(x.name ?? x.id ?? "") }));+ } catch {+ /* ignore */+ }+ }+ return [];+ }++ private async findProviderId(nameOrPreset: string): Promise<string> {+ const list = this.listProviders();+ const want = nameOrPreset.toLowerCase();+ const hit = [...list].reverse().find((p) => p.id.toLowerCase() === want || p.name.toLowerCase() === want || p.id.toLowerCase().startsWith(want));+ if (hit) return hit.id;+ const r = await this.runCli(["providers"]);+ const m = r.stdout.split("\n").map((l) => l.trim().split(/\s+/)[0]).filter(Boolean);+ const id = m.reverse().find((x) => x.toLowerCase().startsWith(want));+ if (!id) throw new Error(`could not determine provider id for ${nameOrPreset}`);+ return id;+ }+}diff --git a/src/main.ts b/src/main.tsnew file mode 100644index 0000000..d71c9d7--- /dev/null+++ b/src/main.ts@@ -0,0 +1,38 @@+/**+ * 一条命令启动全部:内置 magpie(受管)+ 机器人运行时 + 渠道 + 管理界面。+ * npm start (数据目录默认 ./data,可用 AMB_DATA_DIR 指定)+ */+import { loadConfig } from "./config.js";+import { App } from "./app.js";+import { logger } from "./log.js";++const log = logger("main");++export async function runCli(): Promise<App> {+ const config = loadConfig();+ const app = new App(config);+ await app.start();+ log.info(`数据目录:${config.dataDir}`);+ if (app.web) log.info(`管理界面:${app.web.url}`);+ let stopping = false;+ const shutdown = async (sig: string) => {+ if (stopping) return;+ stopping = true;+ log.info(`收到 ${sig},正在退出…`);+ const t = setTimeout(() => process.exit(1), 10_000);+ await app.stop().catch(() => {});+ clearTimeout(t);+ process.exit(0);+ };+ process.on("SIGINT", () => void shutdown("SIGINT"));+ process.on("SIGTERM", () => void shutdown("SIGTERM"));+ return app;+}++const isMain = process.argv[1] && import.meta.url.endsWith(process.argv[1].replace(/\\/g, "/").split("/").pop()!);+if (isMain) {+ runCli().catch((e) => {+ log.error((e as Error).stack || String(e));+ process.exit(1);+ });+}diff --git a/src/store/db.ts b/src/store/db.tsnew file mode 100644index 0000000..7ef7bd0--- /dev/null+++ b/src/store/db.ts@@ -0,0 +1,314 @@+import fs from "node:fs";+import path from "node:path";+import { randomUUID } from "node:crypto";+import { DatabaseSync } from "node:sqlite";++/**+ * SQLite 存储(node:sqlite,无原生模块,Electron 下也无需 rebuild)。+ * 敏感字段(飞书 app_secret、iLink bot_token、context_token)只存本地数据目录,文件权限 600。+ */+export interface Bot {+ id: string;+ name: string;+ systemPrompt: string;+ defaultModel: string;+ feishuAppId: string;+ feishuAppSecret: string;+ weixinEnabled: boolean;+ createdAt: number;+ updatedAt: number;+}++export interface Conversation {+ id: string;+ botId: string;+ channel: string;+ peerId: string;+ title: string;+ model: string;+ createdAt: number;+ updatedAt: number;+}++export interface Message {+ id: number;+ conversationId: string;+ role: "system" | "user" | "assistant";+ content: string;+ createdAt: number;+}++export interface WeixinAccount {+ botId: string;+ botToken: string;+ ilinkBotId: string;+ baseUrl: string;+ ownerUserId: string;+ cursor: string;+ pausedUntil: number;+ updatedAt: number;+}++export interface WeixinPeer {+ botId: string;+ userId: string;+ contextToken: string;+ quotaRemaining: number;+ windowStartedAt: number;+}++type Row = Record<string, unknown>;++const SCHEMA = `+CREATE TABLE IF NOT EXISTS bots (+ id TEXT PRIMARY KEY, name TEXT NOT NULL, system_prompt TEXT NOT NULL DEFAULT '',+ default_model TEXT NOT NULL DEFAULT '', feishu_app_id TEXT NOT NULL DEFAULT '',+ feishu_app_secret TEXT NOT NULL DEFAULT '', weixin_enabled INTEGER NOT NULL DEFAULT 0,+ created_at INTEGER NOT NULL, updated_at INTEGER NOT NULL);+CREATE TABLE IF NOT EXISTS conversations (+ id TEXT PRIMARY KEY, bot_id TEXT NOT NULL, channel TEXT NOT NULL, peer_id TEXT NOT NULL,+ title TEXT NOT NULL DEFAULT '', model TEXT NOT NULL DEFAULT '',+ created_at INTEGER NOT NULL, updated_at INTEGER NOT NULL);+CREATE UNIQUE INDEX IF NOT EXISTS conv_peer ON conversations(bot_id, channel, peer_id);+CREATE TABLE IF NOT EXISTS messages (+ id INTEGER PRIMARY KEY AUTOINCREMENT, conversation_id TEXT NOT NULL, role TEXT NOT NULL,+ content TEXT NOT NULL, created_at INTEGER NOT NULL);+CREATE INDEX IF NOT EXISTS msg_conv ON messages(conversation_id, id);+CREATE TABLE IF NOT EXISTS weixin_accounts (+ bot_id TEXT PRIMARY KEY, bot_token TEXT NOT NULL, ilink_bot_id TEXT NOT NULL, base_url TEXT NOT NULL,+ owner_user_id TEXT NOT NULL DEFAULT '', cursor TEXT NOT NULL DEFAULT '', paused_until INTEGER NOT NULL DEFAULT 0,+ updated_at INTEGER NOT NULL);+CREATE TABLE IF NOT EXISTS weixin_peers (+ bot_id TEXT NOT NULL, user_id TEXT NOT NULL, context_token TEXT NOT NULL DEFAULT '',+ quota_remaining INTEGER NOT NULL DEFAULT 0, window_started_at INTEGER NOT NULL DEFAULT 0,+ PRIMARY KEY (bot_id, user_id));+CREATE TABLE IF NOT EXISTS kv (key TEXT PRIMARY KEY, value TEXT NOT NULL);+`;++export class Store {+ readonly db: DatabaseSync;++ constructor(file: string) {+ if (file !== ":memory:") {+ fs.mkdirSync(path.dirname(file), { recursive: true });+ }+ this.db = new DatabaseSync(file);+ if (file !== ":memory:") {+ try {+ fs.chmodSync(file, 0o600);+ } catch {+ /* Windows 等平台忽略 */+ }+ }+ this.db.exec("PRAGMA journal_mode = WAL;");+ this.db.exec(SCHEMA);+ }++ close(): void {+ this.db.close();+ }++ // ---------- kv ----------+ getKV(key: string): string | undefined {+ const r = this.db.prepare("SELECT value FROM kv WHERE key = ?").get(key) as Row | undefined;+ return r ? String(r.value) : undefined;+ }+ setKV(key: string, value: string): void {+ this.db.prepare("INSERT INTO kv(key, value) VALUES(?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value").run(key, value);+ }++ // ---------- bots ----------+ private toBot(r: Row): Bot {+ return {+ id: String(r.id),+ name: String(r.name),+ systemPrompt: String(r.system_prompt),+ defaultModel: String(r.default_model),+ feishuAppId: String(r.feishu_app_id),+ feishuAppSecret: String(r.feishu_app_secret),+ weixinEnabled: Number(r.weixin_enabled) === 1,+ createdAt: Number(r.created_at),+ updatedAt: Number(r.updated_at),+ };+ }+ listBots(): Bot[] {+ return (this.db.prepare("SELECT * FROM bots ORDER BY created_at").all() as Row[]).map((r) => this.toBot(r));+ }+ getBot(id: string): Bot | undefined {+ const r = this.db.prepare("SELECT * FROM bots WHERE id = ?").get(id) as Row | undefined;+ return r ? this.toBot(r) : undefined;+ }+ createBot(input: Partial<Bot> & { name: string }): Bot {+ const now = Date.now();+ const id = input.id || randomUUID().slice(0, 8);+ this.db+ .prepare(+ `INSERT INTO bots(id, name, system_prompt, default_model, feishu_app_id, feishu_app_secret, weixin_enabled, created_at, updated_at)+ VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)`,+ )+ .run(id, input.name, input.systemPrompt ?? "", input.defaultModel ?? "", input.feishuAppId ?? "", input.feishuAppSecret ?? "", input.weixinEnabled ? 1 : 0, now, now);+ return this.getBot(id)!;+ }+ updateBot(id: string, patch: Partial<Omit<Bot, "id" | "createdAt" | "updatedAt">>): Bot | undefined {+ const cur = this.getBot(id);+ if (!cur) return undefined;+ const next = { ...cur, ...patch };+ this.db+ .prepare(+ `UPDATE bots SET name=?, system_prompt=?, default_model=?, feishu_app_id=?, feishu_app_secret=?, weixin_enabled=?, updated_at=? WHERE id=?`,+ )+ .run(next.name, next.systemPrompt, next.defaultModel, next.feishuAppId, next.feishuAppSecret, next.weixinEnabled ? 1 : 0, Date.now(), id);+ return this.getBot(id);+ }+ deleteBot(id: string): void {+ const convs = this.db.prepare("SELECT id FROM conversations WHERE bot_id = ?").all(id) as Row[];+ for (const c of convs) this.db.prepare("DELETE FROM messages WHERE conversation_id = ?").run(String(c.id));+ this.db.prepare("DELETE FROM conversations WHERE bot_id = ?").run(id);+ this.db.prepare("DELETE FROM weixin_accounts WHERE bot_id = ?").run(id);+ this.db.prepare("DELETE FROM weixin_peers WHERE bot_id = ?").run(id);+ this.db.prepare("DELETE FROM bots WHERE id = ?").run(id);+ }++ // ---------- conversations ----------+ private toConv(r: Row): Conversation {+ return {+ id: String(r.id),+ botId: String(r.bot_id),+ channel: String(r.channel),+ peerId: String(r.peer_id),+ title: String(r.title),+ model: String(r.model),+ createdAt: Number(r.created_at),+ updatedAt: Number(r.updated_at),+ };+ }+ ensureConversation(botId: string, channel: string, peerId: string, title = ""): Conversation {+ const r = this.db+ .prepare("SELECT * FROM conversations WHERE bot_id = ? AND channel = ? AND peer_id = ?")+ .get(botId, channel, peerId) as Row | undefined;+ if (r) return this.toConv(r);+ const now = Date.now();+ const id = `${botId}:${channel}:${peerId}`;+ this.db+ .prepare("INSERT INTO conversations(id, bot_id, channel, peer_id, title, model, created_at, updated_at) VALUES(?, ?, ?, ?, ?, '', ?, ?)")+ .run(id, botId, channel, peerId, title, now, now);+ return this.getConversation(id)!;+ }+ getConversation(id: string): Conversation | undefined {+ const r = this.db.prepare("SELECT * FROM conversations WHERE id = ?").get(id) as Row | undefined;+ return r ? this.toConv(r) : undefined;+ }+ listConversations(botId?: string): Array<Conversation & { messageCount: number; lastMessage: string }> {+ const sql = `SELECT c.*, (SELECT COUNT(*) FROM messages m WHERE m.conversation_id = c.id) AS n,+ (SELECT content FROM messages m WHERE m.conversation_id = c.id ORDER BY id DESC LIMIT 1) AS last+ FROM conversations c ${botId ? "WHERE c.bot_id = ?" : ""} ORDER BY c.updated_at DESC LIMIT 200`;+ const rows = (botId ? this.db.prepare(sql).all(botId) : this.db.prepare(sql).all()) as Row[];+ return rows.map((r) => ({ ...this.toConv(r), messageCount: Number(r.n), lastMessage: r.last == null ? "" : String(r.last).slice(0, 120) }));+ }+ setConversationModel(id: string, model: string): void {+ this.db.prepare("UPDATE conversations SET model = ?, updated_at = ? WHERE id = ?").run(model, Date.now(), id);+ }++ // ---------- messages ----------+ addMessage(conversationId: string, role: Message["role"], content: string): number {+ const now = Date.now();+ const res = this.db+ .prepare("INSERT INTO messages(conversation_id, role, content, created_at) VALUES(?, ?, ?, ?)")+ .run(conversationId, role, content, now);+ this.db.prepare("UPDATE conversations SET updated_at = ? WHERE id = ?").run(now, conversationId);+ return Number(res.lastInsertRowid);+ }+ listMessages(conversationId: string, limit = 500): Message[] {+ const rows = this.db+ .prepare("SELECT * FROM (SELECT * FROM messages WHERE conversation_id = ? ORDER BY id DESC LIMIT ?) ORDER BY id ASC")+ .all(conversationId, limit) as Row[];+ return rows.map((r) => ({+ id: Number(r.id),+ conversationId: String(r.conversation_id),+ role: String(r.role) as Message["role"],+ content: String(r.content),+ createdAt: Number(r.created_at),+ }));+ }+ clearMessages(conversationId: string): void {+ this.db.prepare("DELETE FROM messages WHERE conversation_id = ?").run(conversationId);+ }++ /**+ * 滑动窗口上下文:从最新往回取,直到条数或字符数超限;保证以 user 消息开头。+ */+ contextWindow(conversationId: string, maxMessages: number, maxChars: number): Array<Pick<Message, "role" | "content">> {+ const recent = this.listMessages(conversationId, maxMessages);+ const picked: Array<Pick<Message, "role" | "content">> = [];+ let chars = 0;+ for (let i = recent.length - 1; i >= 0; i--) {+ const m = recent[i];+ if (picked.length > 0 && chars + m.content.length > maxChars) break;+ chars += m.content.length;+ picked.unshift({ role: m.role, content: m.content });+ }+ while (picked.length > 1 && picked[0].role !== "user") picked.shift();+ return picked;+ }++ // ---------- weixin ----------+ getWeixinAccount(botId: string): WeixinAccount | undefined {+ const r = this.db.prepare("SELECT * FROM weixin_accounts WHERE bot_id = ?").get(botId) as Row | undefined;+ if (!r) return undefined;+ return {+ botId: String(r.bot_id),+ botToken: String(r.bot_token),+ ilinkBotId: String(r.ilink_bot_id),+ baseUrl: String(r.base_url),+ ownerUserId: String(r.owner_user_id),+ cursor: String(r.cursor),+ pausedUntil: Number(r.paused_until),+ updatedAt: Number(r.updated_at),+ };+ }+ saveWeixinAccount(a: Omit<WeixinAccount, "cursor" | "pausedUntil" | "updatedAt">): void {+ this.db+ .prepare(+ `INSERT INTO weixin_accounts(bot_id, bot_token, ilink_bot_id, base_url, owner_user_id, cursor, paused_until, updated_at)+ VALUES(?, ?, ?, ?, ?, '', 0, ?)+ ON CONFLICT(bot_id) DO UPDATE SET bot_token=excluded.bot_token, ilink_bot_id=excluded.ilink_bot_id,+ base_url=excluded.base_url, owner_user_id=excluded.owner_user_id, cursor='', paused_until=0, updated_at=excluded.updated_at`,+ )+ .run(a.botId, a.botToken, a.ilinkBotId, a.baseUrl, a.ownerUserId, Date.now());+ }+ setWeixinCursor(botId: string, cursor: string): void {+ this.db.prepare("UPDATE weixin_accounts SET cursor = ?, updated_at = ? WHERE bot_id = ?").run(cursor, Date.now(), botId);+ }+ setWeixinPaused(botId: string, until: number): void {+ this.db.prepare("UPDATE weixin_accounts SET paused_until = ?, updated_at = ? WHERE bot_id = ?").run(until, Date.now(), botId);+ }+ deleteWeixinAccount(botId: string): void {+ this.db.prepare("DELETE FROM weixin_accounts WHERE bot_id = ?").run(botId);+ this.db.prepare("DELETE FROM weixin_peers WHERE bot_id = ?").run(botId);+ }+ getWeixinPeer(botId: string, userId: string): WeixinPeer | undefined {+ const r = this.db.prepare("SELECT * FROM weixin_peers WHERE bot_id = ? AND user_id = ?").get(botId, userId) as Row | undefined;+ if (!r) return undefined;+ return {+ botId: String(r.bot_id),+ userId: String(r.user_id),+ contextToken: String(r.context_token),+ quotaRemaining: Number(r.quota_remaining),+ windowStartedAt: Number(r.window_started_at),+ };+ }+ listWeixinPeers(botId: string): WeixinPeer[] {+ return (this.db.prepare("SELECT user_id FROM weixin_peers WHERE bot_id = ?").all(botId) as Row[]).map(+ (r) => this.getWeixinPeer(botId, String(r.user_id))!,+ );+ }+ upsertWeixinPeer(p: WeixinPeer): void {+ this.db+ .prepare(+ `INSERT INTO weixin_peers(bot_id, user_id, context_token, quota_remaining, window_started_at) VALUES(?, ?, ?, ?, ?)+ ON CONFLICT(bot_id, user_id) DO UPDATE SET context_token=excluded.context_token,+ quota_remaining=excluded.quota_remaining, window_started_at=excluded.window_started_at`,+ )+ .run(p.botId, p.userId, p.contextToken, p.quotaRemaining, p.windowStartedAt);+ }+}diff --git a/src/web/proxy.ts b/src/web/proxy.tsnew file mode 100644index 0000000..0610562--- /dev/null+++ b/src/web/proxy.ts@@ -0,0 +1,117 @@+import http from "node:http";+import net from "node:net";+import path from "node:path";+import type { Duplex } from "node:stream";++/**+ * 同源反向代理到 magpie web:+ * - /magpie/* 去掉前缀转发(magpie 的 index.html 使用相对资源路径,可在子路径下工作);+ * - magpie 前端写死的绝对路径(/api/*、/_magpie/*、/icons/*、插件页等)由“兜底”路由转发;+ * - /v1* 转发到 gateway 端口(web 端口会把 /v1 当作“来自其他机器”而拒绝);+ * - 服务端注入 magpie_web_<port> cookie,用户无需二次登录;浏览器端拿不到 magpie key。+ */+export interface ProxyTarget {+ webOrigin: () => string; // http://127.0.0.1:<webPort>+ gatewayOrigin: () => string; // http://127.0.0.1:<gwPort>+ cookie: () => string; // magpie_web_<port>=<key>+ gatewayKey: () => string;+ ready: () => boolean;+}++const HOP = new Set(["connection", "keep-alive", "proxy-authenticate", "proxy-authorization", "te", "trailer", "transfer-encoding", "upgrade", "host"]);++function mapPath(url: string): { gateway: boolean; path: string } {+ let p = url;+ if (p === "/magpie") p = "/";+ else if (p.startsWith("/magpie/")) p = p.slice("/magpie".length);+ else if (p.startsWith("/magpie?")) p = "/" + p.slice("/magpie".length);+ const gateway = p === "/v1" || p.startsWith("/v1/") || p.startsWith("/v1?");+ return { gateway, path: p };+}++function outHeaders(req: http.IncomingMessage, t: ProxyTarget, gateway: boolean, targetHost: string): http.OutgoingHttpHeaders {+ const h: http.OutgoingHttpHeaders = {};+ for (const [k, v] of Object.entries(req.headers)) if (!HOP.has(k) && k !== "cookie" && k !== "authorization") h[k] = v;+ h.host = targetHost;+ // 不把我们自己的 cookie 转给 magpie,只注入 magpie 的+ h.cookie = t.cookie();+ if (gateway) h.authorization = `Bearer ${t.gatewayKey()}`;+ // magpie 用 Origin/Referer 判断同源;改写成目标源+ if (h.origin) h.origin = `http://${targetHost}`;+ if (h.referer) h.referer = `http://${targetHost}/`;+ return h;+}++/**+ * 纵深防御:即使 magpie 界面里有入口,也拒绝会改写本机 agent 配置、发现/复用订阅凭据、+ * 自更新或交接本机代理的接口(magpie 已以 --gateway 模式和隔离 HOME 运行,此处再兜一层)。+ */+const BLOCKED = [/^\/api\/agents(\/|$|\?)/, /^\/api\/agent-models(\/|$|\?)/, /^\/api\/accounts(\/|$|\?)/, /^\/api\/update(\/|$|\?)/, /^\/api\/handover(\/|$|\?)/];+export function isBlockedPath(url: string): boolean {+ let p = mapPath(url).path.split("?")[0]!;+ try {+ p = decodeURIComponent(p);+ } catch {+ return true;+ }+ p = path.posix.normalize(p.replace(/\\/g, "/").replace(/\/+/g, "/")).toLowerCase();+ return BLOCKED.some((r) => r.test(p));+}++export function proxyHttp(req: http.IncomingMessage, res: http.ServerResponse, t: ProxyTarget): void {+ if (isBlockedPath(req.url || "/")) {+ res.writeHead(403, { "content-type": "application/json; charset=utf-8" });+ res.end(JSON.stringify({ error: "anymodel bot 已禁用此 magpie 功能(agent 配置改写 / 订阅凭据复用 / 自更新)" }));+ return;+ }+ if (!t.ready()) {+ res.writeHead(503, { "content-type": "text/plain; charset=utf-8" });+ res.end("magpie 尚未启动");+ return;+ }+ const { gateway, path } = mapPath(req.url || "/");+ const origin = new URL(gateway ? t.gatewayOrigin() : t.webOrigin());+ const upstream = http.request(+ { hostname: origin.hostname, port: origin.port, method: req.method, path, headers: outHeaders(req, t, gateway, origin.host) },+ (up) => {+ const headers = { ...up.headers };+ // 防止 magpie 的 Set-Cookie 覆盖/泄露 key;我们在服务端统一注入+ delete headers["set-cookie"];+ // 重定向改写回 /magpie/ 子路径+ if (headers.location && headers.location.startsWith("/") && !headers.location.startsWith("/magpie")) {+ const loc = headers.location.replace(/([?&])k=[^&]*&?/, "$1").replace(/[?&]$/, "");+ headers.location = loc === "/" || loc.startsWith("/?") ? "/magpie" + loc : loc;+ }+ res.writeHead(up.statusCode || 502, headers);+ up.pipe(res);+ },+ );+ upstream.on("error", (e) => {+ if (!res.headersSent) res.writeHead(502, { "content-type": "text/plain; charset=utf-8" });+ res.end(`magpie proxy error: ${e.message}`);+ });+ req.pipe(upstream);+}++export function proxyUpgrade(req: http.IncomingMessage, socket: Duplex, head: Buffer, t: ProxyTarget): void {+ if (isBlockedPath(req.url || "/")) {+ socket.end("HTTP/1.1 403 Forbidden\r\nContent-Length: 0\r\n\r\n");+ return;+ }+ if (!t.ready()) return void socket.destroy();+ const { gateway, path } = mapPath(req.url || "/");+ const origin = new URL(gateway ? t.gatewayOrigin() : t.webOrigin());+ const up = net.connect(Number(origin.port), origin.hostname, () => {+ const h = outHeaders(req, t, gateway, origin.host);+ h.connection = "Upgrade";+ h.upgrade = req.headers.upgrade || "websocket";+ let raw = `${req.method} ${path} HTTP/1.1\r\n`;+ for (const [k, v] of Object.entries(h)) if (v !== undefined) raw += `${k}: ${Array.isArray(v) ? v.join(", ") : v}\r\n`;+ up.write(raw + "\r\n");+ if (head?.length) up.write(head);+ up.pipe(socket);+ socket.pipe(up);+ });+ up.on("error", () => socket.destroy());+ socket.on("error", () => up.destroy());+}diff --git a/src/web/server.ts b/src/web/server.tsnew file mode 100644index 0000000..f55ee40--- /dev/null+++ b/src/web/server.ts@@ -0,0 +1,360 @@+import http from "node:http";+import fs from "node:fs";+import path from "node:path";+import crypto from "node:crypto";+import { createRequire } from "node:module";+import type { App } from "../app.js";+import type { InboundEvent, OutboundOp, ReplySession } from "../core/types.js";+import { findAppRoot } from "../magpie/supervisor.js";+import { proxyHttp, proxyUpgrade, type ProxyTarget } from "./proxy.js";+import { logger, mask } from "../log.js";++const log = logger("web");+const require = createRequire(import.meta.url);++export interface WebServer {+ url: string;+ port: number;+ token: string;+ close(): Promise<void>;+}++const MIME: Record<string, string> = {+ ".html": "text/html; charset=utf-8",+ ".js": "text/javascript; charset=utf-8",+ ".mjs": "text/javascript; charset=utf-8",+ ".css": "text/css; charset=utf-8",+ ".svg": "image/svg+xml",+ ".png": "image/png",+ ".json": "application/json",+};++function vendorFiles(): Record<string, string> {+ const resolve = (spec: string) => {+ try {+ return require.resolve(spec);+ } catch {+ return "";+ }+ };+ const preact = resolve("preact");+ const preactDir = preact ? path.dirname(path.dirname(preact)) : "";+ return {+ "preact.mjs": preactDir ? path.join(preactDir, "dist", "preact.mjs") : "",+ "hooks.mjs": preactDir ? path.join(preactDir, "hooks", "dist", "hooks.mjs") : "",+ "htm.mjs": (() => {+ const h = resolve("htm");+ return h ? path.join(path.dirname(h), "htm.mjs") : "";+ })(),+ };+}++class HttpError extends Error {+ constructor(readonly status: number, message: string) {+ super(message);+ }+}++async function readJson(req: http.IncomingMessage): Promise<any> {+ const ct = String(req.headers["content-type"] || "");+ if (!ct.includes("application/json")) throw new HttpError(415, "需要 application/json");+ let body = "";+ for await (const c of req) {+ body += c;+ if (body.length > 1_000_000) throw new HttpError(413, "请求体过大");+ }+ return body ? JSON.parse(body) : {};+}++function send(res: http.ServerResponse, status: number, body: unknown): void {+ res.writeHead(status, { "content-type": "application/json; charset=utf-8", "cache-control": "no-store" });+ res.end(JSON.stringify(body));+}++function publicBot(b: NonNullable<ReturnType<App["store"]["getBot"]>>) {+ return {+ id: b.id,+ name: b.name,+ systemPrompt: b.systemPrompt,+ defaultModel: b.defaultModel,+ feishuAppId: b.feishuAppId,+ feishuAppSecretMasked: mask(b.feishuAppSecret),+ weixinEnabled: b.weixinEnabled,+ createdAt: b.createdAt,+ updatedAt: b.updatedAt,+ };+}++/** 网页“测试对话”渠道:收集输出 */+class CollectReply implements ReplySession {+ text = "";+ async apply(op: OutboundOp): Promise<void> {+ if (op.type === "stream.finish" || op.type === "text") this.text += (this.text ? "\n" : "") + op.text;+ }+}++function isLoopback(host: string): boolean {+ return host === "127.0.0.1" || host === "localhost" || host === "::1";+}++export async function startWebServer(app: App, opts: { port?: number; host?: string } = {}): Promise<WebServer> {+ const cfg = app.config;+ const host = opts.host ?? cfg.ui.host;+ const uiDir = path.join(findAppRoot(), "ui");+ const vendor = vendorFiles();+ // 非回环地址(如 Docker 0.0.0.0)必须带访问令牌;未配置则生成并写入数据目录(不打印到日志)+ let token = cfg.ui.token;+ if (!isLoopback(host) && !token) {+ const f = path.join(cfg.dataDir, "ui-token");+ token = fs.existsSync(f) ? fs.readFileSync(f, "utf8").trim() : crypto.randomBytes(18).toString("base64url");+ fs.writeFileSync(f, token, { mode: 0o600 });+ log.warn(`UI 监听在非回环地址 ${host},访问需带令牌:见 ${f}(打开 /?token=<令牌> 一次即可)`);+ }++ const target: ProxyTarget = {+ webOrigin: () => app.magpie?.webOrigin ?? "http://127.0.0.1:9",+ gatewayOrigin: () => (app.magpie ? `http://127.0.0.1:${app.magpie.gatewayPort}` : "http://127.0.0.1:9"),+ cookie: () => (app.magpie ? `${app.magpie.cookieName}=${app.magpie.webKey}` : ""),+ gatewayKey: () => app.magpie?.gatewayKey ?? "",+ ready: () => !!app.magpie && app.magpie.state === "running",+ };++ let boundPort = 0;+ const allowedHosts = () => new Set([`127.0.0.1:${boundPort}`, `localhost:${boundPort}`, `[::1]:${boundPort}`]);++ function authorized(req: http.IncomingMessage, url: URL, res: http.ServerResponse): boolean {+ // 防 DNS rebinding:回环模式只接受 127.0.0.1/localhost 的 Host+ if (isLoopback(host) && !allowedHosts().has(String(req.headers.host))) {+ res.writeHead(421).end("bad host");+ return false;+ }+ if (!token) return true;+ const cookie = String(req.headers.cookie || "");+ const ok = cookie.split(/;\s*/).includes(`amb_token=${token}`) || req.headers["x-amb-token"] === token;+ if (ok) return true;+ if (url.searchParams.get("token") === token) {+ url.searchParams.delete("token");+ res.writeHead(302, { "set-cookie": `amb_token=${token}; HttpOnly; SameSite=Lax; Path=/; Max-Age=34560000`, location: url.pathname + url.search });+ res.end();+ return false;+ }+ res.writeHead(401, { "content-type": "text/plain; charset=utf-8" }).end("需要访问令牌:打开 /?token=<令牌>");+ return false;+ }++ async function api(req: http.IncomingMessage, res: http.ServerResponse, url: URL): Promise<void> {+ const p = url.pathname.slice("/amb/api".length);+ const m = req.method || "GET";+ const seg = p.split("/").filter(Boolean);+ // 写操作要求 JSON(触发 CORS 预检,阻止跨站表单 CSRF)+ if ((m === "POST" || m === "PUT" || m === "PATCH") && !/^application\/json\s*(;|$)/i.test(String(req.headers["content-type"] || "").trim())) {+ throw new HttpError(415, "需要 application/json");+ }++ if (p === "/status" && m === "GET") {+ const mp = app.magpie;+ return send(res, 200, {+ version: "0.1.0",+ dataDir: cfg.dataDir,+ magpie: mp+ ? { mode: "managed", state: mp.state, lastError: mp.lastError, restarts: mp.restarts, gatewayPort: mp.gatewayPort, webPort: mp.webPort, binary: mp.binPath ?? null, providers: mp.listProviders().length }+ : { mode: "external", state: "external", baseUrl: cfg.magpie.externalBaseUrl },+ notices: app.recentNotices,+ });+ }+ if (p === "/models" && m === "GET") {+ try {+ return send(res, 200, { models: await app.runtime.listModels(true) });+ } catch (e) {+ return send(res, 200, { models: [], error: (e as Error).message });+ }+ }+ if (p === "/providers") {+ if (!app.magpie) throw new HttpError(400, "外部模型端点模式下不管理服务商");+ if (m === "GET") return send(res, 200, { providers: app.magpie.listProviders() });+ if (m === "POST") {+ const b = await readJson(req);+ if (!b.apiKey && !b.url) throw new HttpError(400, "缺少 apiKey");+ const id = b.url+ ? await app.magpie.addCustomProvider(String(b.name || "custom"), String(b.url), String(b.apiKey || ""), String(b.models || "").split(",").map((s: string) => s.trim()).filter(Boolean))+ : await app.magpie.addPresetProvider(String(b.preset), String(b.apiKey));+ return send(res, 200, { id });+ }+ }+ if (seg[0] === "conversations") {+ if (seg.length === 1 && m === "GET") return send(res, 200, { conversations: app.store.listConversations(url.searchParams.get("bot") || undefined) });+ if (seg.length === 3 && seg[2] === "messages" && m === "GET") {+ const conv = app.store.getConversation(decodeURIComponent(seg[1]));+ if (!conv) throw new HttpError(404, "会话不存在");+ return send(res, 200, { conversation: conv, messages: app.store.listMessages(conv.id) });+ }+ }+ if (seg[0] === "bots") {+ if (seg.length === 1) {+ if (m === "GET") return send(res, 200, { bots: app.store.listBots().map(publicBot) });+ if (m === "POST") {+ const b = await readJson(req);+ if (!String(b.name || "").trim()) throw new HttpError(400, "名称不能为空");+ const bot = app.store.createBot({ name: String(b.name).trim(), systemPrompt: String(b.systemPrompt ?? ""), defaultModel: String(b.defaultModel ?? "") });+ await app.startBot(bot.id);+ return send(res, 201, { bot: publicBot(bot) });+ }+ }+ const id = seg[1];+ const bot = id ? app.store.getBot(id) : undefined;+ if (!bot) throw new HttpError(404, "机器人不存在");+ if (seg.length === 2) {+ if (m === "GET") return send(res, 200, { bot: publicBot(bot), channels: app.channelStatus(id) });+ if (m === "PUT") {+ const b = await readJson(req);+ const next = app.store.updateBot(id, {+ ...(b.name !== undefined ? { name: String(b.name) } : {}),+ ...(b.systemPrompt !== undefined ? { systemPrompt: String(b.systemPrompt) } : {}),+ ...(b.defaultModel !== undefined ? { defaultModel: String(b.defaultModel) } : {}),+ })!;+ return send(res, 200, { bot: publicBot(next) });+ }+ if (m === "DELETE") {+ await app.stopBot(id);+ app.store.deleteBot(id);+ return send(res, 200, { ok: true });+ }+ }+ const sub = seg.slice(2).join("/");+ if (sub === "channels" && m === "GET") return send(res, 200, app.channelStatus(id));+ if (sub === "feishu" && m === "PUT") {+ const b = await readJson(req);+ const appId = String(b.appId ?? "").trim();+ const appSecret = String(b.appSecret ?? "").trim() || bot.feishuAppSecret;+ app.store.updateBot(id, { feishuAppId: appId, feishuAppSecret: appId ? appSecret : "" });+ await app.restartBot(id);+ return send(res, 200, app.channelStatus(id));+ }+ if (sub === "feishu" && m === "DELETE") {+ app.store.updateBot(id, { feishuAppId: "", feishuAppSecret: "" });+ await app.restartBot(id);+ return send(res, 200, app.channelStatus(id));+ }+ if (sub === "weixin" && m === "PUT") {+ const b = await readJson(req);+ app.store.updateBot(id, { weixinEnabled: !!b.enabled });+ await app.restartBot(id);+ return send(res, 200, app.channelStatus(id));+ }+ if (sub === "weixin/login" && m === "POST") {+ const login = app.startWeixinLogin(id);+ // 等待二维码就绪(最多 10 秒)+ const t0 = Date.now();+ while (login.snapshot.state === "idle" || login.snapshot.state === "fetching") {+ if (Date.now() - t0 > 10_000) break;+ await new Promise((r) => setTimeout(r, 50));+ }+ return send(res, 200, login.snapshot);+ }+ if (sub === "weixin/login" && m === "GET") return send(res, 200, app.channels.get(id)?.weixinLogin?.snapshot ?? { state: "idle" });+ if (sub === "weixin/verify" && m === "POST") {+ const b = await readJson(req);+ app.channels.get(id)?.weixinLogin?.submitVerifyCode(String(b.code ?? ""));+ return send(res, 200, { ok: true });+ }+ if (sub === "weixin/cancel" && m === "POST") {+ app.channels.get(id)?.weixinLogin?.cancel();+ return send(res, 200, { ok: true });+ }+ if (sub === "weixin/logout" && m === "POST") {+ await app.weixinLogout(id);+ return send(res, 200, app.channelStatus(id));+ }+ if (sub === "chat" && m === "POST") {+ const b = await readJson(req);+ const text = String(b.text ?? "").trim();+ if (!text) throw new HttpError(400, "内容为空");+ const ev: InboundEvent = {+ id: crypto.randomUUID(),+ channel: "web",+ botId: id,+ conversation: { kind: "dm", id: "console" },+ sender: { id: "owner", name: "控制台" },+ parts: [{ type: "text", text }],+ replyHandle: {},+ receivedAt: Date.now(),+ };+ const out = new CollectReply();+ await app.queue.run(`web:${id}:console`, () => app.runtime.handle(ev, out));+ return send(res, 200, { reply: out.text });+ }+ }+ throw new HttpError(404, "not found");+ }++ function serveFile(res: http.ServerResponse, file: string): void {+ fs.readFile(file, (err, data) => {+ if (err) return void res.writeHead(404).end("not found");+ res.writeHead(200, { "content-type": MIME[path.extname(file)] ?? "application/octet-stream", "cache-control": "no-cache" });+ res.end(data);+ });+ }++ const server = http.createServer((req, res) => {+ const url = new URL(req.url || "/", "http://localhost");+ if (!authorized(req, url, res)) return;+ if (url.pathname.startsWith("/amb/api/")) {+ api(req, res, url).catch((e) => {+ const status = e instanceof HttpError ? e.status : 500;+ if (status === 500) log.error("api error", { path: url.pathname, message: (e as Error).message });+ if (!res.headersSent) send(res, status, { error: (e as Error).message });+ });+ return;+ }+ if (url.pathname === "/" || url.pathname === "/index.html") return serveFile(res, path.join(uiDir, "index.html"));+ if (url.pathname.startsWith("/amb/static/")) {+ const rel = path.normalize(url.pathname.slice("/amb/static/".length)).replace(/^(\.\.[/\\])+/, "");+ return serveFile(res, path.join(uiDir, rel));+ }+ if (url.pathname.startsWith("/amb/vendor/")) {+ const f = vendor[url.pathname.slice("/amb/vendor/".length)];+ if (!f) return void res.writeHead(404).end();+ return serveFile(res, f);+ }+ if (url.pathname === "/amb/healthz") return send(res, 200, { ok: true });+ // 其余路径全部交给 magpie(/magpie/* 以及 magpie 前端用到的绝对路径)+ proxyHttp(req, res, target);+ });+ server.on("upgrade", (req, socket, head) => {+ const url = new URL(req.url || "/", "http://localhost");+ const fake = { writeHead: () => ({ end: () => socket.destroy() }), end: () => socket.destroy() } as unknown as http.ServerResponse;+ if (!authorized(req, url, fake)) return;+ proxyUpgrade(req, socket, head, target);+ });++ const port = opts.port ?? cfg.ui.port;+ const listen = (p: number) =>+ new Promise<void>((resolve, reject) => {+ server.once("error", reject);+ server.listen(p, host, () => {+ server.removeListener("error", reject);+ resolve();+ });+ });+ try {+ await listen(port);+ } catch (e) {+ if ((e as NodeJS.ErrnoException).code !== "EADDRINUSE" || port === 0) throw e;+ log.warn(`端口 ${port} 被占用,改用随机端口`);+ await listen(0);+ }+ boundPort = (server.address() as import("node:net").AddressInfo).port;+ const shownHost = host === "0.0.0.0" || host === "::" ? "127.0.0.1" : host;+ const url = `http://${shownHost}:${boundPort}/`;+ log.info(`UI: ${url}`);+ return {+ url,+ port: boundPort,+ token,+ close: () =>+ new Promise<void>((r) => {+ server.closeAllConnections?.();+ server.close(() => r());+ }),+ };+}diff --git a/test/e2e.test.ts b/test/e2e.test.tsnew file mode 100644index 0000000..808ee9d--- /dev/null+++ b/test/e2e.test.ts@@ -0,0 +1,191 @@+/**+ * 离线端到端:mock OpenAI(流式)+ mock iLink + 假飞书传输层 + 真实 App/Web 服务(外部模型端点模式)。+ */+import { describe, it, expect, beforeAll, afterAll } from "vitest";+import fs from "node:fs";+import os from "node:os";+import path from "node:path";+import { App } from "../src/app.js";+import { loadConfig } from "../src/config.js";+import { FakeFeishu, feishuEvent, mockIlink, mockOpenAI, until } from "./helpers.js";++let llm: Awaited<ReturnType<typeof mockOpenAI>>;+let ilink: Awaited<ReturnType<typeof mockIlink>>;+let app: App;+let base: string;+let dataDir: string;+const feishu = new FakeFeishu();++async function api(p: string, init: { method?: string; body?: unknown; headers?: Record<string, string> } = {}) {+ const res = await fetch(base + "/amb/api" + p, {+ method: init.method ?? "GET",+ headers: { ...(init.body !== undefined ? { "content-type": "application/json" } : {}), ...init.headers },+ body: init.body !== undefined ? JSON.stringify(init.body) : undefined,+ });+ return { status: res.status, json: (await res.json().catch(() => ({}))) as any };+}++beforeAll(async () => {+ llm = await mockOpenAI({ key: "gw-key" });+ ilink = await mockIlink();+ dataDir = fs.mkdtempSync(path.join(os.tmpdir(), "amb-e2e-"));+ const config = loadConfig({+ dataDir,+ env: { AMB_MAGPIE_BASE_URL: llm.url + "/v1", AMB_MAGPIE_API_KEY: "gw-key", AMB_UI_PORT: "0", AMB_WEIXIN_API_BASE: ilink.url, AMB_FEISHU_THROTTLE_MS: "30" },+ });+ process.env.FEISHU_APP_ID = "cli_test";+ process.env.FEISHU_APP_SECRET = "secret_test";+ app = new App(config, { feishuTransport: () => feishu, weixinPollTimeoutMs: 2000, printQrToTerminal: false });+ await app.start();+ base = app.web!.url.replace(/\/$/, "");+ delete process.env.FEISHU_APP_ID;+ delete process.env.FEISHU_APP_SECRET;+});++afterAll(async () => {+ await app?.stop();+ await llm?.close();+ await ilink?.close();+});++describe("飞书 E2E", () => {+ it("单聊:快速 ack + 流式卡片 + 历史持久化", async () => {+ const ev = feishuEvent("你好");+ const t0 = Date.now();+ feishu.onMessage!(ev);+ expect(Date.now() - t0).toBeLessThan(50); // 同步返回(3 秒规则)+ await app.channels.get("default")!.feishu!.idle();+ const cardId = [...feishu.cards.keys()].at(-1)!;+ expect(feishu.cards.get(cardId)).toBe("[mock-a] 你说:你好");+ expect(feishu.finished.has(cardId)).toBe(true);+ expect(feishu.calls.find((c) => c.op === "reply")?.args[0]).toBe(ev.messageId);+ expect(llm.calls.at(-1)!.auth).toBe("Bearer gw-key");+ expect(llm.calls.at(-1)!.messages[0].role).toBe("system");+ });+ it("重复 message_id 去重;群聊忽略", async () => {+ const before = llm.calls.length;+ const ev = feishuEvent("一次", { messageId: "om_dup" });+ feishu.onMessage!(ev);+ feishu.onMessage!(ev);+ feishu.onMessage!(feishuEvent("群里", { chatType: "group" }));+ await app.channels.get("default")!.feishu!.idle();+ expect(llm.calls.length - before).toBe(1);+ });+ it("多轮上下文 + /model 列表与切换(按会话)", async () => {+ const ch = app.channels.get("default")!.feishu!;+ feishu.onMessage!(feishuEvent("/model", { chatId: "oc_m" }));+ await ch.idle();+ expect(feishu.texts.at(-1)).toMatch(/1\. mock-a[\s\S]*2\. mock-b/);+ feishu.onMessage!(feishuEvent("/model 2", { chatId: "oc_m" }));+ await ch.idle();+ expect(feishu.texts.at(-1)).toContain("mock-b");+ feishu.onMessage!(feishuEvent("第一句", { chatId: "oc_m" }));+ feishu.onMessage!(feishuEvent("第二句", { chatId: "oc_m" }));+ await ch.idle();+ const last = llm.calls.at(-1)!;+ expect(last.model).toBe("mock-b");+ expect(last.messages.map((m: any) => m.content)).toEqual(expect.arrayContaining(["第一句", "[mock-b] 你说:第一句", "第二句"]));+ // 其他会话不受影响+ feishu.onMessage!(feishuEvent("别处", { chatId: "oc_other" }));+ await ch.idle();+ expect(llm.calls.at(-1)!.model).toBe("mock-a");+ feishu.onMessage!(feishuEvent("/reset", { chatId: "oc_m" }));+ await ch.idle();+ feishu.onMessage!(feishuEvent("新开始", { chatId: "oc_m" }));+ await ch.idle();+ expect(llm.calls.at(-1)!.messages.filter((m: any) => m.role !== "system")).toHaveLength(1);+ });+});++describe("微信 E2E", () => {+ it("界面扫码登录 → 长轮询收消息 → 输入状态 → 一次性回复", async () => {+ const st0 = await api("/bots/default/channels");+ expect(st0.json.weixin.state).toBe("login_required");+ const start = await api("/bots/default/weixin/login", { method: "POST", body: {} });+ expect(start.status).toBe(200);+ expect(start.json.qrDataUrl).toMatch(/^data:image\/png;base64,/);+ await until(async () => (await api("/bots/default/channels")).json.weixin.state === "connected", 8000);+ expect(fs.existsSync(path.join(dataDir, "weixin", "default-login-qr.png"))).toBe(true);+ const acct = app.store.getWeixinAccount("default")!;+ expect(acct.ilinkBotId).toBe("[email protected]");++ ilink.push("[email protected]", "**你好** 微信");+ await until(() => ilink.state.sent.length >= 1, 8000);+ expect(ilink.state.sent[0]).toMatchObject({ to: "[email protected]", contextToken: "ctx-1" });+ expect(ilink.state.sent[0].text).toContain("你好");+ expect(ilink.state.typing).toContain(1);+ await until(() => ilink.state.typing.includes(2));+ expect(ilink.state.authSeen).toContain("Bearer tok-secret-123");+ const st = await api("/bots/default/channels");+ expect(st.json.weixin.quota[0]).toMatchObject({ userId: "[email protected]", remaining: 9 });+ expect(app.store.getWeixinAccount("default")!.cursor).toMatch(/^cur-/);+ });+ it("超长回复按 4000 切分并受配额约束", async () => {+ const big = "段落".repeat(2600) + "\n\n" + "尾".repeat(3000); // ~8200 字+ const prev = ilink.state.sent.length;+ const orig = llm.calls.length;+ (globalThis as any).__bigReply = big;+ // 通过 /model 之外的方式定制回复:直接替换 runtime 的模型调用+ const models = (app.runtime as any).opts.models;+ const saved = models.streamChat.bind(models);+ models.streamChat = async (_req: unknown, onDelta: (d: string) => void) => { onDelta(big); return big; };+ ilink.push("[email protected]", "长文");+ await until(() => ilink.state.sent.length >= prev + 3, 8000);+ models.streamChat = saved;+ const chunks = ilink.state.sent.slice(prev).filter((s) => s.to === "[email protected]");+ expect(chunks.every((c) => c.text.length <= 4000)).toBe(true);+ expect(chunks.map((c) => c.text).join("").length).toBeGreaterThanOrEqual(big.length - 10);+ expect(llm.calls.length).toBe(orig);+ });+ it("会话过期 -14 → 暂停并提示重新扫码", async () => {+ ilink.state.expireNext = true;+ await until(async () => (await api("/bots/default/channels")).json.weixin.state === "expired", 8000);+ expect(app.store.getWeixinAccount("default")!.pausedUntil).toBeGreaterThan(Date.now());+ const s = await api("/status");+ expect(s.json.notices.some((n: any) => n.text.includes("重新扫码"))).toBe(true);+ });+});++describe("Web 界面 / API", () => {+ it("页面与前端依赖可加载", async () => {+ const html = await (await fetch(base + "/")).text();+ expect(html).toContain("importmap");+ for (const p of ["/amb/vendor/preact.mjs", "/amb/vendor/hooks.mjs", "/amb/vendor/htm.mjs", "/amb/static/app.js", "/amb/static/style.css"]) {+ expect((await fetch(base + p)).status, p).toBe(200);+ }+ });+ it("机器人 CRUD + 飞书凭据(secret 不回显)+ 测试对话", async () => {+ const c = await api("/bots", { method: "POST", body: { name: "测试机器人", systemPrompt: "你是测试", defaultModel: "mock-b" } });+ expect(c.status).toBe(201);+ const id = c.json.bot.id;+ const f = await api(`/bots/${id}/feishu`, { method: "PUT", body: { appId: "cli_x", appSecret: "very-secret-value" } });+ expect(f.status).toBe(200);+ const g = await api(`/bots/${id}`);+ expect(JSON.stringify(g.json)).not.toContain("very-secret-value");+ expect(g.json.bot.feishuAppSecretMasked).toBe("****alue");+ const chat = await api(`/bots/${id}/chat`, { method: "POST", body: { text: "hi" } });+ expect(chat.json.reply).toBe("[mock-b] 你说:hi");+ const convs = await api(`/conversations?bot=${id}`);+ expect(convs.json.conversations[0].channel).toBe("web");+ const msgs = await api(`/conversations/${encodeURIComponent(convs.json.conversations[0].id)}/messages`);+ expect(msgs.json.messages.map((m: any) => m.role)).toEqual(["user", "assistant"]);+ expect((await api(`/bots/${id}`, { method: "DELETE" })).status).toBe(200);+ expect((await api(`/bots/${id}`)).status).toBe(404);+ });+ it("安全:错误 Host 拒绝、非 JSON 写请求拒绝、外部模式下 /magpie 503", async () => {+ const http = await import("node:http");+ const port = new URL(base).port;+ const status = await new Promise<number>((r) => http.get({ host: "127.0.0.1", port, path: "/amb/api/status", headers: { host: "evil.example:80" } }, (res) => r(res.statusCode!)));+ expect(status).toBe(421);+ const form = await fetch(base + "/amb/api/bots", { method: "POST", headers: { "content-type": "text/plain" }, body: "{}" });+ expect(form.status).toBe(415);+ expect((await fetch(base + "/magpie/")).status).toBe(503);+ });+ it("日志与数据库外文件中不含明文密钥", () => {+ const files = fs.readdirSync(dataDir, { recursive: true }).map(String).filter((f) => !f.endsWith(".db") && !f.includes(".db-") && !f.endsWith(".png"));+ for (const f of files) {+ const p = path.join(dataDir, f);+ if (fs.statSync(p).isFile()) expect(fs.readFileSync(p, "utf8")).not.toContain("tok-secret-123");+ }+ });+});diff --git a/test/helpers.ts b/test/helpers.tsnew file mode 100644index 0000000..6a3628a--- /dev/null+++ b/test/helpers.ts@@ -0,0 +1,179 @@+import http from "node:http";+import type { AddressInfo } from "node:net";+import type { FeishuMessageEvent, FeishuTransport } from "../src/channels/feishu/transport.js";++export async function listen(handler: http.RequestListener): Promise<{ url: string; port: number; close: () => Promise<void>; server: http.Server }> {+ const server = http.createServer(handler);+ await new Promise<void>((r) => server.listen(0, "127.0.0.1", () => r()));+ const port = (server.address() as AddressInfo).port;+ return {+ url: `http://127.0.0.1:${port}`,+ port,+ server,+ close: () => new Promise((r) => { server.closeAllConnections(); server.close(() => r()); }),+ };+}++async function body(req: http.IncomingMessage): Promise<any> {+ const chunks: Buffer[] = [];+ for await (const c of req) chunks.push(c as Buffer);+ const s = Buffer.concat(chunks).toString("utf8");+ return s ? JSON.parse(s) : {};+}++/** 模拟 OpenAI 兼容端点:/v1/models + 流式 /v1/chat/completions(回声 + 模型名) */+export async function mockOpenAI(opts: { models?: string[]; key?: string; reply?: (msgs: any[], model: string) => string } = {}) {+ const models = opts.models ?? ["mock-a", "mock-b"];+ const calls: Array<{ model: string; messages: any[]; auth?: string }> = [];+ const srv = await listen(async (req, res) => {+ if (opts.key && req.headers.authorization !== `Bearer ${opts.key}`) {+ res.writeHead(401, { "content-type": "application/json" }).end(JSON.stringify({ error: { message: "bad key" } }));+ return;+ }+ if (req.url?.endsWith("/models") && req.method === "GET") {+ res.writeHead(200, { "content-type": "application/json" }).end(JSON.stringify({ object: "list", data: models.map((id) => ({ id, object: "model" })) }));+ return;+ }+ if (req.url?.endsWith("/chat/completions") && req.method === "POST") {+ const b = await body(req);+ calls.push({ model: b.model, messages: b.messages, auth: req.headers.authorization });+ const last = b.messages[b.messages.length - 1]?.content ?? "";+ const text = opts.reply ? opts.reply(b.messages, b.model) : `[${b.model}] 你说:${last}`;+ if (!b.stream) {+ res.writeHead(200, { "content-type": "application/json" }).end(JSON.stringify({ choices: [{ message: { role: "assistant", content: text } }] }));+ return;+ }+ res.writeHead(200, { "content-type": "text/event-stream" });+ const pieces = text.match(/.{1,4}/gsu) ?? [];+ for (const p of pieces) {+ res.write(`data: ${JSON.stringify({ choices: [{ delta: { content: p } }] })}\n\n`);+ await new Promise((r) => setTimeout(r, 2));+ }+ res.write("data: [DONE]\n\n");+ res.end();+ return;+ }+ res.writeHead(404).end();+ });+ return { ...srv, calls, models };+}++/** 模拟 iLink:登录(wait→scaned→confirmed)、getupdates(队列)、sendmessage、getconfig、sendtyping、-14 */+export async function mockIlink() {+ const state = {+ statusSeq: ["wait", "scaned", "confirmed"] as string[],+ inbox: [] as any[],+ sent: [] as Array<{ to: string; text: string; contextToken?: string }>,+ typing: [] as number[],+ expireNext: false,+ authSeen: [] as string[],+ cursor: 0,+ };+ let base = "";+ const srv = await listen(async (req, res) => {+ const u = new URL(req.url!, "http://x");+ const json = (o: unknown) => res.writeHead(200, { "content-type": "application/json" }).end(JSON.stringify(o));+ if (req.headers.authorization) state.authSeen.push(String(req.headers.authorization));+ switch (u.pathname) {+ case "/ilink/bot/get_bot_qrcode":+ return json({ qrcode: "qr-1", qrcode_img_content: "https://liteapp.weixin.qq.com/q/mock?qrcode=qr-1" });+ case "/ilink/bot/get_qrcode_status": {+ const s = state.statusSeq.shift() ?? "wait";+ if (s === "confirmed") return json({ status: s, bot_token: "tok-secret-123", ilink_bot_id: "[email protected]", baseurl: base, ilink_user_id: "[email protected]" });+ return json({ status: s });+ }+ case "/ilink/bot/getupdates": {+ await body(req);+ if (state.expireNext) {+ state.expireNext = false;+ return json({ ret: -14, errcode: -14, errmsg: "session timeout" });+ }+ const deadline = Date.now() + 300;+ while (!state.inbox.length && Date.now() < deadline) await new Promise((r) => setTimeout(r, 10));+ const msgs = state.inbox.splice(0);+ return json({ ret: 0, msgs, get_updates_buf: `cur-${++state.cursor}` });+ }+ case "/ilink/bot/sendmessage": {+ const b = await body(req);+ state.sent.push({ to: b.msg.to_user_id, text: b.msg.item_list[0].text_item.text, contextToken: b.msg.context_token });+ return json({ ret: 0 });+ }+ case "/ilink/bot/getconfig":+ await body(req);+ return json({ ret: 0, typing_ticket: "ticket-1" });+ case "/ilink/bot/sendtyping": {+ const b = await body(req);+ state.typing.push(b.status);+ return json({ ret: 0 });+ }+ }+ res.writeHead(404).end();+ });+ base = srv.url;+ let seq = 0;+ const push = (from: string, text: string, ctx = "ctx-1") =>+ state.inbox.push({ seq: ++seq, message_id: `m${seq}`, from_user_id: from, to_user_id: "[email protected]", create_time_ms: Date.now(), message_type: 1, message_state: 2, context_token: ctx, item_list: [{ type: 1, text_item: { text } }] });+ return { ...srv, state, push };+}++/** 假飞书传输层:记录全部调用 */+export class FakeFeishu implements FeishuTransport {+ calls: Array<{ op: string; args: unknown[] }> = [];+ cards = new Map<string, string>();+ finished = new Set<string>();+ texts: string[] = [];+ failCreate = false;+ failFinish = false;+ onMessage: ((ev: FeishuMessageEvent) => void) | undefined;+ private n = 0;+ async start(onMessage: (ev: FeishuMessageEvent) => void, onState: (s: "connecting" | "connected" | "error") => void) {+ this.onMessage = onMessage;+ onState("connected");+ }+ async stop() {}+ async createStreamingCard(initial: string) {+ this.calls.push({ op: "create", args: [initial] });+ if (this.failCreate) throw new Error("cardkit denied");+ const id = `card${++this.n}`;+ this.cards.set(id, initial);+ return id;+ }+ async sendCardReply(to: string, cardId: string) {+ this.calls.push({ op: "reply", args: [to, cardId] });+ }+ async updateCardText(cardId: string, el: string, text: string, seq: number) {+ this.calls.push({ op: "update", args: [cardId, el, text, seq] });+ this.cards.set(cardId, text);+ }+ async finishCard(cardId: string, seq: number) {+ this.calls.push({ op: "finish", args: [cardId, seq] });+ if (this.failFinish) throw new Error("finish failed");+ this.finished.add(cardId);+ }+ async replyText(to: string, text: string) {+ this.calls.push({ op: "text", args: [to, text] });+ this.texts.push(text);+ }+}++export function feishuEvent(text: string, opts: Partial<FeishuMessageEvent> = {}): FeishuMessageEvent {+ return {+ messageId: opts.messageId ?? `om_${Math.random().toString(36).slice(2)}`,+ chatId: opts.chatId ?? "oc_chat1",+ chatType: opts.chatType ?? "p2p",+ messageType: opts.messageType ?? "text",+ content: opts.content ?? JSON.stringify({ text }),+ senderOpenId: opts.senderOpenId ?? "ou_user1",+ mentions: opts.mentions ?? [],+ createTime: Date.now(),+ };+}++export async function until(fn: () => boolean | Promise<boolean>, ms = 5000, step = 20): Promise<void> {+ const end = Date.now() + ms;+ while (Date.now() < end) {+ if (await fn()) return;+ await new Promise((r) => setTimeout(r, step));+ }+ throw new Error("until: timeout");+}diff --git a/test/magpie.integration.test.ts b/test/magpie.integration.test.tsnew file mode 100644index 0000000..bc6626b--- /dev/null+++ b/test/magpie.integration.test.ts@@ -0,0 +1,101 @@+/**+ * 集成测试:真实内置 magpie(受管模式)+ mock 上游模型。需要先 npm run build:magpie;没有二进制时跳过。+ */+import { describe, it, expect, beforeAll, afterAll } from "vitest";+import fs from "node:fs";+import os from "node:os";+import path from "node:path";+import { App } from "../src/app.js";+import { loadConfig } from "../src/config.js";+import { resolveMagpieBinary } from "../src/magpie/supervisor.js";+import { FakeFeishu, mockOpenAI, until } from "./helpers.js";++const bin = resolveMagpieBinary();+const d = bin ? describe : describe.skip;++d("内置 magpie 集成", () => {+ let llm: Awaited<ReturnType<typeof mockOpenAI>>;+ let app: App;+ let base: string;+ let dataDir: string;++ beforeAll(async () => {+ llm = await mockOpenAI({ key: "upstream-key", models: ["up-model"] });+ dataDir = fs.mkdtempSync(path.join(os.tmpdir(), "amb-int-"));+ app = new App(loadConfig({ dataDir, env: { AMB_UI_PORT: "0", AMB_WEIXIN_API_BASE: "http://127.0.0.1:9" } }), {+ feishuTransport: () => new FakeFeishu(),+ printQrToTerminal: false,+ });+ await app.start();+ base = app.web!.url.replace(/\/$/, "");+ }, 60_000);++ afterAll(async () => {+ await app?.stop();+ await llm?.close();+ });++ it("magpie 已在隔离目录中以 gateway 模式运行", async () => {+ expect(app.magpie!.state).toBe("running");+ expect(fs.existsSync(path.join(dataDir, "magpie", "config", "magpie", "settings.json"))).toBe(true);+ const s = JSON.parse(fs.readFileSync(path.join(dataDir, "magpie", "config", "magpie", "settings.json"), "utf8"));+ expect(s.noAutoUpdate).toBe(true);+ expect(s.noAccountDiscovery).toBe(true);+ // 没有从真实 HOME 发现任何订阅账号+ expect(app.magpie!.listProviders()).toEqual([]);+ });++ it("通过界面 API 添加自定义服务商 → 模型可用 → 对话经 magpie 转发", async () => {+ const r = await fetch(base + "/amb/api/providers", {+ method: "POST",+ headers: { "content-type": "application/json" },+ body: JSON.stringify({ name: "mockup", url: llm.url + "/v1", apiKey: "upstream-key", models: "up-model" }),+ });+ expect(r.status).toBe(200);+ // 真实 key 没有出现在 magpie 进程参数/日志里,只在 magpie 的配置文件中+ expect(app.magpie!.recentLog.join("\n")).not.toContain("upstream-key");+ let models: string[] = [];+ await until(async () => {+ models = (await (await fetch(base + "/amb/api/models")).json()).models;+ return models.length > 0;+ }, 15_000, 300);+ expect(models.some((m) => m.includes("up-model"))).toBe(true);+ const chat = await fetch(base + "/amb/api/bots/default/chat", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ text: "经过网关" }) });+ const j = (await chat.json()) as { reply: string };+ expect(j.reply).toContain("你说:经过网关");+ expect(llm.calls.at(-1)!.auth).toBe("Bearer upstream-key");+ }, 30_000);++ it("预设服务商:key 不经命令行参数保存", async () => {+ const id = await app.magpie!.addPresetProvider("deepseek", "sk-fake-not-real-0000");+ expect(id).toMatch(/deepseek/);+ const raw = JSON.parse(fs.readFileSync(path.join(dataDir, "magpie", "config", "magpie", "providers.json"), "utf8"));+ expect(raw.providers.find((p: any) => p.id === id).key).toBe("sk-fake-not-real-0000");+ const listed = await (await fetch(base + "/amb/api/providers")).text();+ expect(listed).not.toContain("sk-fake");+ }, 30_000);++ it("/magpie/ 内嵌:免二次登录、绝对路径兜底、/v1 走 gateway、敏感接口被拦截", async () => {+ const idx = await fetch(base + "/magpie/");+ expect(idx.status).toBe(200);+ const html = await idx.text();+ expect(html).toContain("<title>magpie</title>");+ expect(idx.headers.get("set-cookie")).toBeNull();+ const icon = await fetch(base + "/icons/favicon.svg");+ expect(icon.status).toBe(200);+ const trace = await fetch(base + "/api/gateway/trace?after=0");+ expect(trace.status).toBe(200);+ const v1 = await fetch(base + "/v1/models");+ expect(v1.status).toBe(200);+ expect(((await v1.json()) as any).data.length).toBeGreaterThan(0);+ expect((await fetch(base + "/api/agents/connect/claude", { method: "POST" })).status).toBe(403);+ expect((await fetch(base + "/magpie/api/accounts/authorize")).status).toBe(403);+ });++ it("崩溃后自动重启", async () => {+ const before = app.magpie!.restarts;+ app.magpie!.killForTest();+ await until(() => app.magpie!.restarts > before && app.magpie!.state === "running", 20_000, 100);+ expect((await fetch(base + "/magpie/")).status).toBe(200);+ }, 30_000);+});diff --git a/test/unit.test.ts b/test/unit.test.tsnew file mode 100644index 0000000..7d355a5--- /dev/null+++ b/test/unit.test.ts@@ -0,0 +1,232 @@+import { describe, it, expect } from "vitest";+import fs from "node:fs";+import os from "node:os";+import path from "node:path";+import { splitText } from "../src/core/types.js";+import { KeyedQueue, Dedup } from "../src/core/queue.js";+import { Store } from "../src/store/db.js";+import { SSEParser, OpenAICompatClient } from "../src/llm/client.js";+import { StreamingMarkdownFilter } from "../src/channels/weixin/markdown-filter.js";+import { filterMarkdown, weixinParts } from "../src/channels/weixin/channel.js";+import { WeixinQuota, QUOTA_PER_INBOUND } from "../src/channels/weixin/quota.js";+import { parseWeixinApiJson, WeixinApiError } from "../src/channels/weixin/api.js";+import { FeishuReply } from "../src/channels/feishu/card.js";+import { feishuParts } from "../src/channels/feishu/channel.js";+import { redactValue, mask } from "../src/log.js";+import { loadConfig } from "../src/config.js";+import { isBlockedPath } from "../src/web/proxy.js";+import { FakeFeishu, feishuEvent, mockOpenAI } from "./helpers.js";++const tmp = () => fs.mkdtempSync(path.join(os.tmpdir(), "amb-unit-"));++describe("splitText", () => {+ it("短文本不切分", () => expect(splitText("abc", 10)).toEqual(["abc"]));+ it("按上限切分且无丢失,优先在换行处", () => {+ const text = Array.from({ length: 50 }, (_, i) => `第${i}段 ` + "字".repeat(150)).join("\n\n");+ const parts = splitText(text, 4000);+ expect(parts.length).toBeGreaterThan(1);+ for (const p of parts) expect(p.length).toBeLessThanOrEqual(4000);+ expect(parts.join("").replace(/\s/g, "")).toBe(text.replace(/\s/g, ""));+ expect(parts[1].startsWith("第")).toBe(true);+ });+ it("无换行的超长文本硬切", () => {+ const parts = splitText("x".repeat(9000), 4000);+ expect(parts.map((p) => p.length)).toEqual([4000, 4000, 1000]);+ });+});++describe("KeyedQueue / Dedup", () => {+ it("同 key 串行、不同 key 并行", async () => {+ const q = new KeyedQueue();+ const log: string[] = [];+ const task = (k: string, n: number, ms: number) => q.run(k, async () => { log.push(`${k}${n}+`); await new Promise((r) => setTimeout(r, ms)); log.push(`${k}${n}-`); });+ await Promise.all([task("a", 1, 30), task("a", 2, 1), task("b", 1, 5)]);+ expect(log.indexOf("a1-")).toBeLessThan(log.indexOf("a2+"));+ expect(log.indexOf("b1+")).toBeLessThan(log.indexOf("a1-"));+ });+ it("前一个任务失败不阻塞后续", async () => {+ const q = new KeyedQueue();+ const p1 = q.run("k", async () => { throw new Error("x"); }).catch(() => undefined);+ let ran = false;+ await q.run("k", async () => { ran = true; });+ await p1;+ expect(ran).toBe(true);+ });+ it("去重与过期", () => {+ const d = new Dedup(1000);+ expect(d.firstSeen("m1", 0)).toBe(true);+ expect(d.firstSeen("m1", 500)).toBe(false);+ expect(d.firstSeen("m1", 2000)).toBe(true);+ });+});++describe("Store", () => {+ it("机器人 CRUD、会话与滑动窗口", () => {+ const s = new Store(path.join(tmp(), "t.db"));+ const bot = s.createBot({ name: "b1" });+ expect(s.getBot(bot.id)?.name).toBe("b1");+ s.updateBot(bot.id, { defaultModel: "m" });+ expect(s.getBot(bot.id)?.defaultModel).toBe("m");+ const c = s.ensureConversation(bot.id, "feishu", "oc1");+ expect(s.ensureConversation(bot.id, "feishu", "oc1").id).toBe(c.id);+ for (let i = 0; i < 10; i++) {+ s.addMessage(c.id, "user", `u${i}`);+ s.addMessage(c.id, "assistant", `a${i}` + "x".repeat(100));+ }+ const w = s.contextWindow(c.id, 5, 100000);+ expect(w[0].role).toBe("user");+ expect(w.at(-1)?.content.startsWith("a9")).toBe(true);+ expect(w.length).toBeLessThanOrEqual(5);+ const w2 = s.contextWindow(c.id, 100, 350);+ expect(w2.reduce((n, m) => n + m.content.length, 0)).toBeLessThanOrEqual(350);+ expect(w2[0].role).toBe("user");+ expect(s.listConversations()[0].messageCount).toBe(20);+ s.clearMessages(c.id);+ expect(s.listMessages(c.id)).toHaveLength(0);+ s.deleteBot(bot.id);+ expect(s.getBot(bot.id)).toBeUndefined();+ s.close();+ });+ it("数据库文件权限 600", () => {+ if (process.platform === "win32") return;+ const f = path.join(tmp(), "p.db");+ new Store(f).close();+ expect(fs.statSync(f).mode & 0o777).toBe(0o600);+ });+});++describe("SSE / OpenAI 兼容客户端", () => {+ it("SSE 解析跨块拼接", () => {+ const got: string[] = [];+ const p = new SSEParser((d) => got.push(d));+ p.push("data: {\"a\":1}\n\nda");+ p.push("ta: {\"b\":2}\r\n\r\n: comment\n\ndata: [DONE]");+ p.end();+ expect(got).toEqual(['{"a":1}', '{"b":2}', "[DONE]"]);+ });+ it("流式调用与模型列表", async () => {+ const m = await mockOpenAI({ key: "k1" });+ const c = new OpenAICompatClient(() => ({ baseUrl: m.url + "/v1", apiKey: "k1" }));+ expect(await c.listModels()).toEqual(["mock-a", "mock-b"]);+ const deltas: string[] = [];+ const full = await c.streamChat({ model: "mock-b", messages: [{ role: "user", content: "你好世界" }] }, (d) => deltas.push(d));+ expect(full).toBe("[mock-b] 你说:你好世界");+ expect(deltas.length).toBeGreaterThan(1);+ const bad = new OpenAICompatClient(() => ({ baseUrl: m.url + "/v1", apiKey: "nope" }));+ await expect(bad.listModels()).rejects.toThrow();+ await m.close();+ });+});++describe("微信", () => {+ it("Markdown 过滤", () => {+ // 与上游行为一致:微信能渲染的(粗体/代码/表格)保留;H5/H6、图片、包裹中文的斜体去掉+ const out = filterMarkdown("##### 小标题\n**粗体** 和 *中文斜体*\n\n```js\nconst *a* = 1;\n```");+ expect(out).not.toContain("#####");+ expect(out).not.toContain("![");+ expect(out).toContain("**粗体**");+ expect(out).toContain("中文斜体");+ expect(out).not.toContain("*中文斜体*");+ expect(out).toContain("const *a* = 1;");+ const f = new StreamingMarkdownFilter();+ const streamed = ["*中", "文*", "结束"].map((d) => f.feed(d)).join("") + f.flush();+ expect(streamed).toBe(filterMarkdown("*中文*结束"));+ expect(streamed).toBe("中文结束");+ });+ it("消息项解析", () => {+ const parts = weixinParts([{ type: 1, text_item: { text: "hi" } }, { type: 3, voice_item: { text: "语音转写" } } as any, { type: 2 } as any]);+ expect(parts).toEqual([{ type: "text", text: "hi" }, { type: "voice", transcript: "语音转写" }, { type: "image" }]);+ });+ it("配额:每条入站后 24h 内 10 条", () => {+ const s = new Store(path.join(tmp(), "q.db"));+ let now = 1_000_000;+ const q = new WeixinQuota(s, "b", () => now);+ expect(q.remaining("u")).toBe(0);+ q.onInbound("u", "ctx");+ for (let i = 0; i < QUOTA_PER_INBOUND; i++) expect(q.tryConsume("u")).toBe(true);+ expect(q.tryConsume("u")).toBe(false);+ q.onInbound("u", "ctx2");+ expect(q.remaining("u")).toBe(10);+ now += 25 * 3600_000;+ expect(q.remaining("u")).toBe(0);+ s.close();+ });+ it("iLink JSON 大整数保持为字符串、-14 识别", () => {+ const r = parseWeixinApiJson<{ message_id: unknown }>('{"message_id": 12345678901234567890}');+ expect(String(r.message_id)).toBe("12345678901234567890");+ expect(new WeixinApiError("x", -14, undefined).sessionExpired).toBe(true);+ expect(new WeixinApiError("x", 0, -14).sessionExpired).toBe(true);+ });+});++describe("飞书", () => {+ it("消息解析:去掉 @ 占位符、富文本", () => {+ expect(feishuParts(feishuEvent("", { content: JSON.stringify({ text: "@_user_1 你好" }), mentions: [{ key: "@_user_1" }] }))).toEqual([{ type: "text", text: "你好" }]);+ const post = feishuEvent("", { messageType: "post", content: JSON.stringify({ title: "T", content: [[{ tag: "text", text: "a" }, { tag: "a", text: "b" }]] }) });+ expect(feishuParts(post)).toEqual([{ type: "text", text: "T\nab" }]);+ });+ it("流式卡片节流 + 收尾关闭 streaming", async () => {+ const t = new FakeFeishu();+ const r = new FeishuReply(t, "om_1", 50);+ await r.apply({ type: "stream.start" });+ let acc = "";+ for (let i = 0; i < 20; i++) {+ acc += "字";+ await r.apply({ type: "stream.update", text: acc });+ await new Promise((res) => setTimeout(res, 5));+ }+ await r.apply({ type: "stream.finish", text: acc + "完" });+ const updates = t.calls.filter((c) => c.op === "update");+ expect(updates.length).toBeGreaterThanOrEqual(2);+ expect(updates.length).toBeLessThan(10);+ const seqs = updates.map((u) => u.args[3] as number);+ expect([...seqs].sort((a, b) => a - b)).toEqual(seqs);+ expect(t.cards.get("card1")).toBe(acc + "完");+ expect(t.finished.has("card1")).toBe(true);+ expect(t.calls.at(-1)?.op).toBe("finish");+ });+ it("卡片创建失败 → 纯文本降级(超长切分)", async () => {+ const t = new FakeFeishu();+ t.failCreate = true;+ const r = new FeishuReply(t, "om_1", 10);+ await r.apply({ type: "stream.start" });+ await r.apply({ type: "stream.update", text: "abc" });+ await r.apply({ type: "stream.finish", text: "y".repeat(8500) });+ expect(t.texts.map((x) => x.length)).toEqual([4000, 4000, 500]);+ });+ it("收尾失败:卡片已含全文则不重复发;最终更新也失败则以文本补发", async () => {+ const t = new FakeFeishu();+ t.failFinish = true;+ const r = new FeishuReply(t, "om_1", 10);+ await r.apply({ type: "stream.start" });+ await r.apply({ type: "stream.finish", text: "最终答案" });+ expect(t.texts).toEqual([]);+ const t2 = new FakeFeishu();+ t2.updateCardText = async () => { throw new Error("rate limited"); };+ const r2 = new FeishuReply(t2, "om_2", 10);+ await r2.apply({ type: "stream.start" });+ await r2.apply({ type: "stream.finish", text: "最终答案2" });+ expect(t2.texts).toEqual(["最终答案2"]);+ });+});++describe("安全", () => {+ it("日志脱敏", () => {+ const out = JSON.stringify(redactValue({ appSecret: "abc", bot_token: "t", apiKey: "k", nested: { authorization: "Bearer xyz" }, msg: "key sk-abcdefghijklmnop and Bearer qqqqqqqqqqqq", name: "ok" }));+ expect(out).not.toMatch(/abc"|"t"|"k"|xyz|abcdefghijklmnop|qqqqqqqqqqqq/);+ expect(out).toContain('"name":"ok"');+ expect(mask("1234567890")).toBe("****7890");+ });+ it("代理拒绝 agent 改写 / 账号复用 / 自更新接口(含编码绕过)", () => {+ for (const p of ["/api/agents/connect/claude", "/magpie/api/agents/", "/api/accounts/authorize", "/api/%61gents/connect/codex", "//api//agents/x", "/api/agent-models/codex", "/api/update", "/API/Agents"]) expect(isBlockedPath(p), p).toBe(true);+ for (const p of ["/api/gateway/trace", "/magpie/", "/v1/models", "/api/state", "/icons/x.svg"]) expect(isBlockedPath(p), p).toBe(false);+ });+ it("配置:环境变量优先,AMB_UI_PORT=0 合法", () => {+ const dir = tmp();+ fs.writeFileSync(path.join(dir, "config.json"), JSON.stringify({ ui: { port: 4000 }, llm: { defaultModel: "f" } }));+ const c = loadConfig({ dataDir: dir, env: { AMB_UI_PORT: "0", AMB_MAGPIE_BASE_URL: "http://x/v1" } });+ expect(c.ui.port).toBe(0);+ expect(c.llm.defaultModel).toBe("f");+ expect(c.magpie.mode).toBe("external");+ });+});diff --git a/tsconfig.build.json b/tsconfig.build.jsonnew file mode 100644index 0000000..143300c--- /dev/null+++ b/tsconfig.build.json@@ -0,0 +1,5 @@+{+ "extends": "./tsconfig.json",+ "compilerOptions": { "noEmit": false },+ "include": ["src/**/*.ts", "electron/**/*.ts"]+}diff --git a/tsconfig.json b/tsconfig.jsonnew file mode 100644index 0000000..7484db0--- /dev/null+++ b/tsconfig.json@@ -0,0 +1,17 @@+{+ "compilerOptions": {+ "target": "ES2023",+ "module": "NodeNext",+ "moduleResolution": "NodeNext",+ "strict": true,+ "noUncheckedIndexedAccess": false,+ "esModuleInterop": true,+ "skipLibCheck": true,+ "resolveJsonModule": true,+ "outDir": "dist",+ "rootDir": ".",+ "types": ["node"],+ "sourceMap": false+ },+ "include": ["src/**/*.ts", "electron/**/*.ts", "test/**/*.ts"]+}diff --git a/ui/app.js b/ui/app.jsnew file mode 100644index 0000000..51852c5--- /dev/null+++ b/ui/app.js@@ -0,0 +1,218 @@+// anymodel bot 管理界面:Preact + htm(无构建步骤,原生 ES 模块)+import { h, render } from "preact";+import { useEffect, useState, useCallback } from "preact/hooks";+import htm from "htm";+const html = htm.bind(h);++async function api(path, opts = {}) {+ const res = await fetch("/amb/api" + path, {+ method: opts.method || "GET",+ headers: opts.body !== undefined ? { "content-type": "application/json" } : {},+ body: opts.body !== undefined ? JSON.stringify(opts.body) : undefined,+ });+ const data = await res.json().catch(() => ({}));+ if (!res.ok) throw new Error(data.error || `HTTP ${res.status}`);+ return data;+}++const STATE_TEXT = {+ disabled: "未启用", connecting: "连接中", connected: "已连接", error: "错误", expired: "已过期", paused: "已暂停",+ login_required: "未登录", running: "运行中", starting: "启动中", restarting: "重启中", failed: "失败", stopped: "已停止",+ wait: "等待扫码", scaned: "已扫码", need_verifycode: "需验证码", confirmed: "已确认", already_bound: "已绑定", cancelled: "已取消", idle: "空闲", fetching: "获取中",+};+const Badge = ({ s }) => html`<span class="badge ${s}">${STATE_TEXT[s] || s}</span>`;+const fmt = (t) => (t ? new Date(t).toLocaleString("zh-CN", { hour12: false }) : "");++function usePoll(fn, ms, deps = []) {+ const [data, setData] = useState(null);+ const [err, setErr] = useState("");+ const load = useCallback(() => fn().then((d) => { setData(d); setErr(""); }).catch((e) => setErr(e.message)), deps);+ useEffect(() => { load(); if (!ms) return; const t = setInterval(load, ms); return () => clearInterval(t); }, [load]);+ return [data, err, load];+}++// ---------------- 概览 ----------------+const PRESETS = ["deepseek", "openai", "anthropic", "google", "moonshot-cn", "qwen-cn", "zhipu", "volcengine", "xai", "minimax-cn", "groq", "mistral"];+function Overview({ go }) {+ const [st] = usePoll(() => api("/status"), 3000);+ const [models, , reloadModels] = usePoll(() => api("/models"), 0);+ const [preset, setPreset] = useState("deepseek");+ const [key, setKey] = useState("");+ const [msg, setMsg] = useState("");+ if (!st) return html`<p>加载中…</p>`;+ const mp = st.magpie;+ const add = async () => {+ setMsg("添加中…");+ try { const r = await api("/providers", { method: "POST", body: { preset, apiKey: key } }); setKey(""); setMsg(`✓ 已添加 ${r.id}`); setTimeout(reloadModels, 800); }+ catch (e) { setMsg("✗ " + e.message); }+ };+ return html`+ ${st.notices.slice(0, 3).map((n) => html`<div class="notice">${fmt(n.at)} ${n.text}</div>`)}+ <div class="card">+ <h3>模型网关(内置 magpie)</h3>+ <div class="row"><span>状态</span><${Badge} s=${mp.state} />+ ${mp.mode === "managed" && html`<span class="muted">gateway 127.0.0.1:${mp.gatewayPort} · 重启 ${mp.restarts} 次 · 服务商 ${mp.providers} 个</span>`}+ </div>+ ${mp.lastError && html`<p class="muted">最近错误:${mp.lastError}</p>`}+ <p class="muted">可用模型:${models ? (models.models.length ? models.models.join("、") : models.error || "暂无,请添加服务商") : "…"}</p>+ </div>+ ${mp.mode === "managed" && html`<div class="card">+ <h3>快速添加模型服务商</h3>+ <div class="row">+ <select style="width:180px" value=${preset} onChange=${(e) => setPreset(e.target.value)}>${PRESETS.map((p) => html`<option>${p}</option>`)}</select>+ <input class="grow" style="width:auto" type="password" placeholder="API Key(仅保存在本机的 magpie 隔离配置中)" value=${key} onInput=${(e) => setKey(e.target.value)} />+ <button class="pri" disabled=${!key} onClick=${add}>添加</button>+ </div>+ <p class="muted">${msg} 更多服务商、自定义端点、路由与用量请到 <a href="#" onClick=${(e) => { e.preventDefault(); go("models"); }}>「模型」</a> 页(magpie 完整界面)。</p>+ </div>`}+ <div class="card muted">数据目录:<code>${st.dataDir}</code> · 版本 ${st.version}</div>`;+}++// ---------------- 机器人 ----------------+function BotEditor({ bot, models, onSaved, onDeleted }) {+ const [f, setF] = useState(bot);+ const [msg, setMsg] = useState("");+ useEffect(() => setF(bot), [bot.id]);+ const set = (k) => (e) => setF({ ...f, [k]: e.target.value });+ const save = async () => {+ try { const r = await api(`/bots/${bot.id}`, { method: "PUT", body: { name: f.name, systemPrompt: f.systemPrompt, defaultModel: f.defaultModel } }); setMsg("✓ 已保存"); onSaved(r.bot); }+ catch (e) { setMsg("✗ " + e.message); }+ };+ const del = async () => { if (confirm(`删除机器人「${bot.name}」及其全部会话?`)) { await api(`/bots/${bot.id}`, { method: "DELETE" }); onDeleted(); } };+ return html`<div class="card">+ <label>名称</label><input value=${f.name} onInput=${set("name")} />+ <label>人设 / 系统提示词</label><textarea value=${f.systemPrompt} onInput=${set("systemPrompt")} />+ <label>默认模型(会话内可用 /model 覆盖)</label>+ <select value=${f.defaultModel} onChange=${set("defaultModel")}>+ <option value="">自动(第一个可用模型)</option>+ ${[...new Set([...(models || []), f.defaultModel].filter(Boolean))].map((m) => html`<option value=${m}>${m}</option>`)}+ </select>+ <div class="row" style="margin-top:12px"><button class="pri" onClick=${save}>保存</button><button class="danger" onClick=${del}>删除</button><span class="muted">${msg}</span></div>+ </div>`;+}++function TestChat({ botId }) {+ const [text, setText] = useState("");+ const [log, setLog] = useState([]);+ const [busy, setBusy] = useState(false);+ const sendMsg = async () => {+ const t = text.trim(); if (!t) return;+ setText(""); setBusy(true); setLog((l) => [...l, { role: "user", content: t }]);+ try { const r = await api(`/bots/${botId}/chat`, { method: "POST", body: { text: t } }); setLog((l) => [...l, { role: "assistant", content: r.reply }]); }+ catch (e) { setLog((l) => [...l, { role: "assistant", content: "✗ " + e.message }]); }+ setBusy(false);+ };+ return html`<div class="card"><h3>测试对话</h3>+ <div class="msgs">${log.map((m) => html`<div class="msg ${m.role}">${m.content}</div>`)}</div>+ <div class="row" style="margin-top:12px"><input class="grow" style="width:auto" placeholder="输入消息,支持 /model /reset /help" value=${text}+ onInput=${(e) => setText(e.target.value)} onKeyDown=${(e) => e.key === "Enter" && !busy && sendMsg()} />+ <button class="pri" disabled=${busy} onClick=${sendMsg}>${busy ? "生成中…" : "发送"}</button></div></div>`;+}++function Bots({ botId, setBotId }) {+ const [data, , reload] = usePoll(() => api("/bots"), 0);+ const [models] = usePoll(() => api("/models"), 0);+ const [name, setName] = useState("");+ if (!data) return html`<p>加载中…</p>`;+ const bot = data.bots.find((b) => b.id === botId) || data.bots[0];+ const create = async () => { const r = await api("/bots", { method: "POST", body: { name } }); setName(""); await reload(); setBotId(r.bot.id); };+ return html`<div class="cols">+ <div>+ <div class="card list" style="padding:0">${data.bots.map((b) => html`<div class="item ${bot && b.id === bot.id ? "sel" : ""}" onClick=${() => setBotId(b.id)}><b>${b.name}</b><div class="muted">${b.id} · ${b.defaultModel || "自动模型"}</div></div>`)}</div>+ <div class="card"><label>新建机器人</label><div class="row"><input class="grow" style="width:auto" value=${name} placeholder="名称" onInput=${(e) => setName(e.target.value)} /><button disabled=${!name.trim()} onClick=${create}>创建</button></div>+ <p class="muted">一个机器人对应一个飞书应用;微信每个机器人扫码绑定一次。</p></div>+ </div>+ <div>${bot && html`<${BotEditor} key=${bot.id} bot=${bot} models=${models && models.models} onSaved=${reload} onDeleted=${() => { setBotId(""); reload(); }} /><${TestChat} key=${"c" + bot.id} botId=${bot.id} />`}</div>+ </div>`;+}++// ---------------- 渠道 ----------------+function Feishu({ bot, st, reload }) {+ const [appId, setAppId] = useState(bot.feishuAppId);+ const [secret, setSecret] = useState("");+ const [msg, setMsg] = useState("");+ useEffect(() => setAppId(bot.feishuAppId), [bot.id]);+ const save = async () => { setMsg("保存并连接中…"); try { await api(`/bots/${bot.id}/feishu`, { method: "PUT", body: { appId, appSecret: secret } }); setSecret(""); setMsg("✓ 已保存"); reload(); } catch (e) { setMsg("✗ " + e.message); } };+ const clear = async () => { await api(`/bots/${bot.id}/feishu`, { method: "DELETE" }); setAppId(""); reload(); };+ return html`<div class="card"><h3>飞书 <${Badge} s=${st.state} /></h3>+ ${st.detail && html`<p class="muted">${st.detail}</p>`}+ <label>App ID</label><input value=${appId} placeholder="cli_xxxxxxxx" onInput=${(e) => setAppId(e.target.value)} />+ <label>App Secret ${bot.feishuAppSecretMasked && html`<span class="muted">(已保存 ${bot.feishuAppSecretMasked},留空则不修改)</span>`}</label>+ <input type="password" value=${secret} onInput=${(e) => setSecret(e.target.value)} />+ <div class="row" style="margin-top:12px"><button class="pri" disabled=${!appId} onClick=${save}>保存并连接</button>${bot.feishuAppId && html`<button class="danger" onClick=${clear}>断开</button>`}<span class="muted">${msg}</span></div>+ <p class="muted">需在飞书开放平台启用「机器人」能力,事件订阅选择「使用长连接接收事件」并订阅 <code>im.message.receive_v1</code>;权限:<code>im:message.p2p_msg:readonly</code>、<code>im:message:send_as_bot</code>、<code>cardkit:card:write</code>。详见 README。</p>+ </div>`;+}++function Weixin({ bot, st, reload }) {+ const [code, setCode] = useState("");+ const login = st.login;+ const active = login && ["fetching", "wait", "scaned", "need_verifycode"].includes(login.state);+ useEffect(() => { if (!active) return; const t = setInterval(reload, 1500); return () => clearInterval(t); }, [active]);+ const start = async () => { await api(`/bots/${bot.id}/weixin/login`, { method: "POST", body: {} }); reload(); };+ const cancel = async () => { await api(`/bots/${bot.id}/weixin/cancel`, { method: "POST", body: {} }); reload(); };+ const logout = async () => { if (confirm("解除微信绑定?")) { await api(`/bots/${bot.id}/weixin/logout`, { method: "POST", body: {} }); reload(); } };+ const verify = async () => { await api(`/bots/${bot.id}/weixin/verify`, { method: "POST", body: { code } }); setCode(""); };+ const toggle = async () => { await api(`/bots/${bot.id}/weixin`, { method: "PUT", body: { enabled: !bot.weixinEnabled } }); reload(); };+ return html`<div class="card"><h3>微信(iLink 官方通道) <${Badge} s=${st.state} /></h3>+ ${st.detail && html`<p class="muted">${st.detail}</p>`}+ ${st.account && html`<p class="muted">已绑定:${st.account.ilinkBotId}${st.account.pausedUntil > Date.now() ? ` · 暂停至 ${fmt(st.account.pausedUntil)}` : ""}</p>`}+ ${login && login.state !== "idle" && html`<div class="row"><${Badge} s=${login.state} /><span>${login.message}</span></div>`}+ ${active && login.qrDataUrl && html`<p><img class="qr" src=${login.qrDataUrl} alt="微信登录二维码" /></p><p class="muted">用微信扫一扫,然后在手机上确认。二维码同时保存在数据目录。</p>`}+ ${login && login.state === "need_verifycode" && html`<div class="row"><input style="width:160px" value=${code} placeholder="验证码" onInput=${(e) => setCode(e.target.value)} /><button onClick=${verify}>提交</button></div>`}+ <div class="row" style="margin-top:12px">+ ${active ? html`<button onClick=${cancel}>取消</button>` : html`<button class="pri" onClick=${start}>${st.account ? "重新扫码登录" : "扫码登录"}</button>`}+ ${st.account && html`<button class="danger" onClick=${logout}>解除绑定</button>`}+ <button onClick=${toggle}>${bot.weixinEnabled ? "停用微信渠道" : "启用微信渠道"}</button>+ </div>+ ${st.quota && st.quota.length > 0 && html`<h4>出站配额(每条入站消息后 24 小时内最多 10 条)</h4>+ <table style="width:100%">${st.quota.map((q) => html`<tr><td><code>${q.userId}</code></td><td>剩余 <b>${q.remaining}</b> 条</td><td class="muted">窗口开始 ${fmt(q.windowStartedAt)}</td></tr>`)}</table>`}+ </div>`;+}++function Channels({ botId, setBotId }) {+ const [bots] = usePoll(() => api("/bots"), 0);+ const bot = bots && (bots.bots.find((b) => b.id === botId) || bots.bots[0]);+ const [detail, , reload] = usePoll(() => (bot ? api(`/bots/${bot.id}`) : Promise.resolve(null)), 5000, [bot && bot.id]);+ if (!bots) return html`<p>加载中…</p>`;+ return html`<div>+ <div class="row" style="margin-bottom:12px"><span>机器人</span><select style="width:240px" value=${bot && bot.id} onChange=${(e) => setBotId(e.target.value)}>${bots.bots.map((b) => html`<option value=${b.id}>${b.name}</option>`)}</select></div>+ ${detail && detail.bot && html`<${Feishu} bot=${detail.bot} st=${detail.channels.feishu} reload=${reload} /><${Weixin} bot=${detail.bot} st=${detail.channels.weixin} reload=${reload} />`}+ </div>`;+}++// ---------------- 会话 ----------------+function Conversations() {+ const [data] = usePoll(() => api("/conversations"), 5000);+ const [sel, setSel] = useState("");+ const [msgs] = usePoll(() => (sel ? api(`/conversations/${encodeURIComponent(sel)}/messages`) : Promise.resolve(null)), 5000, [sel]);+ if (!data) return html`<p>加载中…</p>`;+ return html`<div class="cols">+ <div class="card list" style="padding:0">${data.conversations.length === 0 && html`<p class="muted" style="padding:12px">暂无会话</p>`}+ ${data.conversations.map((c) => html`<div class="item ${c.id === sel ? "sel" : ""}" onClick=${() => setSel(c.id)}>+ <b>${c.channel}</b> · ${c.title || c.peerId}<div class="muted">${c.botId} · ${c.messageCount} 条 · ${fmt(c.updatedAt)}${c.model ? " · " + c.model : ""}</div>+ <div class="muted">${c.lastMessage}</div></div>`)}</div>+ <div class="card">${msgs ? html`<div class="msgs">${msgs.messages.map((m) => html`<div class="msg ${m.role}" title=${fmt(m.createdAt)}>${m.content}</div>`)}</div>` : html`<p class="muted">选择左侧会话查看消息</p>`}</div>+ </div>`;+}++// ---------------- 模型(magpie) ----------------+const Models = () => html`<iframe class="magpie" src="/magpie/" title="magpie"></iframe>`;++// ---------------- 外壳 ----------------+const TABS = [["overview", "概览"], ["bots", "机器人"], ["channels", "渠道"], ["conversations", "会话"], ["models", "模型"]];+function App() {+ const [tab, setTab] = useState(location.hash.slice(1) || "overview");+ const [botId, setBotId] = useState("");+ const go = (t) => { setTab(t); location.hash = t; };+ return html`<div class="layout">+ <nav><h1>anymodel bot</h1>${TABS.map(([id, label]) => html`<a class=${tab === id ? "active" : ""} onClick=${() => go(id)}>${label}</a>`)}</nav>+ <main class=${tab === "models" ? "full" : ""}>+ ${tab === "overview" && html`<${Overview} go=${go} />`}+ ${tab === "bots" && html`<${Bots} botId=${botId} setBotId=${setBotId} />`}+ ${tab === "channels" && html`<${Channels} botId=${botId} setBotId=${setBotId} />`}+ ${tab === "conversations" && html`<${Conversations} />`}+ ${tab === "models" && html`<${Models} />`}+ </main></div>`;+}+render(html`<${App} />`, document.getElementById("app"));diff --git a/ui/index.html b/ui/index.htmlnew file mode 100644index 0000000..ac2a280--- /dev/null+++ b/ui/index.html@@ -0,0 +1,16 @@+<!doctype html>+<html lang="zh-CN">+<head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <title>anymodel bot</title>+ <link rel="stylesheet" href="/amb/static/style.css" />+ <script type="importmap">+ { "imports": { "preact": "/amb/vendor/preact.mjs", "preact/hooks": "/amb/vendor/hooks.mjs", "htm": "/amb/vendor/htm.mjs" } }+ </script>+</head>+<body>+ <div id="app">加载中…</div>+ <script type="module" src="/amb/static/app.js"></script>+</body>+</html>diff --git a/ui/style.css b/ui/style.cssnew file mode 100644index 0000000..c9b0ce9--- /dev/null+++ b/ui/style.css@@ -0,0 +1,37 @@+:root { --bg:#f6f7f9; --card:#fff; --fg:#1d2129; --muted:#86909c; --line:#e5e6eb; --pri:#3370ff; --ok:#00b42a; --warn:#ff7d00; --err:#f53f3f; }+@media (prefers-color-scheme: dark) { :root { --bg:#17171a; --card:#232324; --fg:#e5e6eb; --muted:#8a8f99; --line:#333335; } }+* { box-sizing: border-box; }+body { margin:0; font:14px/1.5 -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif; background:var(--bg); color:var(--fg); }+.layout { display:flex; height:100vh; }+nav { width:180px; background:var(--card); border-right:1px solid var(--line); padding:16px 8px; flex-shrink:0; }+nav h1 { font-size:16px; margin:0 8px 16px; }+nav a { display:block; padding:8px 12px; border-radius:6px; color:inherit; text-decoration:none; cursor:pointer; }+nav a.active { background:var(--pri); color:#fff; }+main { flex:1; overflow:auto; padding:20px 24px; }+main.full { padding:0; overflow:hidden; }+.card { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:16px; margin-bottom:16px; }+.row { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }+.grow { flex:1; }+label { display:block; margin:8px 0 4px; color:var(--muted); font-size:12px; }+input, textarea, select { width:100%; padding:7px 10px; border:1px solid var(--line); border-radius:6px; background:var(--bg); color:var(--fg); font:inherit; }+textarea { min-height:90px; resize:vertical; }+button { padding:6px 14px; border-radius:6px; border:1px solid var(--line); background:var(--card); color:var(--fg); cursor:pointer; font:inherit; }+button.pri { background:var(--pri); border-color:var(--pri); color:#fff; }+button.danger { color:var(--err); }+button:disabled { opacity:.5; cursor:default; }+.badge { display:inline-block; padding:1px 8px; border-radius:10px; font-size:12px; background:var(--line); }+.badge.connected,.badge.running,.badge.confirmed { background:#e8ffea; color:var(--ok); }+.badge.error,.badge.failed,.badge.expired { background:#ffece8; color:var(--err); }+.badge.connecting,.badge.starting,.badge.restarting,.badge.wait,.badge.scaned { background:#fff7e8; color:var(--warn); }+.muted { color:var(--muted); font-size:12px; }+.list .item { padding:10px 12px; border-bottom:1px solid var(--line); cursor:pointer; }+.list .item.sel, .list .item:hover { background:var(--bg); }+.msgs { display:flex; flex-direction:column; gap:8px; }+.msg { max-width:80%; padding:8px 12px; border-radius:8px; white-space:pre-wrap; word-break:break-word; }+.msg.user { align-self:flex-end; background:var(--pri); color:#fff; }+.msg.assistant { align-self:flex-start; background:var(--card); border:1px solid var(--line); }+.qr { width:240px; height:240px; image-rendering:pixelated; background:#fff; padding:8px; border-radius:8px; }+iframe.magpie { border:0; width:100%; height:100vh; display:block; }+.notice { padding:8px 12px; border-radius:6px; background:#fff7e8; color:#a35200; margin-bottom:8px; }+.cols { display:grid; grid-template-columns: 300px 1fr; gap:16px; }+code { background:var(--bg); padding:1px 4px; border-radius:4px; }diff --git a/vendor/deepseek-harness b/vendor/deepseek-harnessnew file mode 160000index 0000000..22ddee3--- /dev/null+++ b/vendor/deepseek-harness@@ -0,0 +1 @@+Subproject commit 22ddee3792402c3e70ec5f86a63c3e3e895a2f60diff --git a/vendor/magpie b/vendor/magpienew file mode 160000index 0000000..e4ca47b--- /dev/null+++ b/vendor/magpie@@ -0,0 +1 @@+Subproject commit e4ca47b0f246f76ecf16fef7eb9845026594c9acdiff --git a/vitest.config.ts b/vitest.config.tsnew file mode 100644index 0000000..f7a1465--- /dev/null+++ b/vitest.config.ts@@ -0,0 +1,4 @@+import { defineConfig } from "vitest/config";+export default defineConfig({+ test: { include: ["test/**/*.test.ts"], testTimeout: 30_000, hookTimeout: 60_000, pool: "forks", fileParallelism: false },+});