refactor(core): migrate to Bun and converge acquisition policies and Agent boundaries

This commit is contained in:
root committed 2026-10-13 14:37:03 +08:00
1 parent 3f1c6d02f6
commit 27c0f27434
268 files changed
+7468 -7852

No files matched your search

+5 -5
View File
@@ -2,7 +2,7 @@
* VIS-1 真机核验:对真实 camofox 打开 https://example.com/,截图 → 缩放成交给模型的图 → 在图上取链接坐标 →
* 按服务端同一套换算(coordinateSpace / screenToPage)点回页面 → 核对跳转。记录视口 / DPR / 截图尺寸。
* 用法(只读用现有容器,不改部署):
* CAMOFOX_URL=http://<camofox 容器 IP>:9377 CAMOFOX_ACCESS_KEY=... deno run -A scripts/browser-verify/vision-real.ts [out-dir]
* CAMOFOX_URL=http://<camofox 容器 IP>:9377 CAMOFOX_ACCESS_KEY=... bun scripts/browser-verify/vision-real.ts [out-dir]
* 访问密钥只从环境变量读,不写进文件。
*/
import { mkdir, writeFile } from "node:fs/promises";
@@ -11,9 +11,9 @@ import { createCamofoxBrowserProvider, imageDimensions, prepareImage, staticBrow
import type { NavigationBudget } from "@umt/contracts";
import { coordinateSpace, screenToPage } from "../../apps/server/src/modules/browser/service.ts";
const baseUrl = Deno.env.get("CAMOFOX_URL") ?? "http://camofox:9377";
const key = Deno.env.get("CAMOFOX_ACCESS_KEY") ?? "";
const out = Deno.args[0] ?? ".browser-verify-out/vision";
const baseUrl = process.env.CAMOFOX_URL ?? "http://camofox:9377";
const key = process.env.CAMOFOX_ACCESS_KEY ?? "";
const out = process.argv.slice(2)[0] ?? ".browser-verify-out/vision";
const PROVIDER = "00000000-0000-4000-8000-00000000f15a";
const budget: NavigationBudget = {
domainAllowlist: ["example.com", "iana.org"],
@@ -77,4 +77,4 @@ try {
await p.closeSession(opened.session.id).catch(() => {});
}
console.log(JSON.stringify(report, null, 2));
if (!report.pass) Deno.exit(1);
if (!report.pass) process.exit(1);