feat: v0.3.8–v0.3.14 工作区汇总(依赖升级、整理来源、手动入库、原地入库等)
生产 v0.3.8~v0.3.13 均由 8013196 加工作区修改构建部署,此前未提交;本提交补齐源码,
并含未部署的 v0.3.14 原地入库。中间各版本源码状态未保存,无法逐版拆分,详见
docs/plan/17-full-upgrade.md 与 docs/plan/18-organize-release.md。
- v0.3.8 全面升级:Deno workspace 依赖、Router 8 / Vite 8、camofox 1.18.0 / Node 24、
PostgreSQL 18.6、备份客户端 18.6、演示 qB 5.2.4
- v0.3.9 媒体整理:分类规则、整理来源与目录快照(0059)、文件管理整理入口
- v0.3.10 手动下载与入库:独立手动下载、详情页资源下载、TMDB / Local 元数据兜底
(metadata.resolve_organize)、正常多版本 / 一次性洗版(0060)
- v0.3.11 搜索详情与桌面黑边修复
- v0.3.12 列表分页、搜索历史、首页概况
- v0.3.13 统一整理弹窗与队列
- v0.3.14 原地入库(0061,未部署)
同批审计修复:
- 刮削入队:确认原记录存在后才删重放产生的新记录;写回 run 关联失败时保持 queued,
由处理器补关联(对齐 MP 先登记、只在入队失败时记失败)
- 识别升级链只在结果更确定时采用,不再用 no_match 顶替原有歧义候选
- bluray_dir 资产以原盘目录本身为刮削根(MP 同做法)
- metadata.resolve_organize 登记到入库排障 Skill 与能力地图
- db/src/types.ts 按迁移重新生成;contracts 整理动作枚举顺序与数据库对齐
- 测试:原地入库用例改为直接查记录表;domain 测试模板补 version
- 前端:通知铃铛弹层与用户菜单统一样式;站点卡片共用卡头、底栏贴底、分页间距
依赖升级证据只提交摘要文件,registry-snapshot.json 移至 .local/(SHA-256 记于文档)。
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
8013196e3f
commit
ceb66f8c77
265 files changed
+17751
-2483
No files matched your search
@@ -114,12 +114,15 @@ describe("能力声明", () => {
|
||||
paths[p!] = { ...paths[p!], [m!]: {} };
|
||||
}
|
||||
const doc = (version: string) => ({ info: { version }, paths });
|
||||
const ok = camofoxCapabilitiesFromOpenApi(doc("1.17.0"));
|
||||
expect(Object.keys(CAMOFOX_VERIFIED_RELEASES)).toContain("1.17.0");
|
||||
for (const k of CAMOFOX_VERIFIED_RELEASES["1.17.0"]!.keys)
|
||||
expect(ok[k]).toMatchObject({ supported: true, verified: true });
|
||||
expect(camofoxCapabilitiesFromOpenApi(doc("1.17.0"), { takeover: false }).takeover.verified).toBe(false);
|
||||
const other = camofoxCapabilitiesFromOpenApi(doc("1.18.0"));
|
||||
for (const version of ["1.17.0", "1.18.0"]) {
|
||||
const ok = camofoxCapabilitiesFromOpenApi(doc(version));
|
||||
expect(Object.keys(CAMOFOX_VERIFIED_RELEASES)).toContain(version);
|
||||
expect(CAMOFOX_VERIFIED_RELEASES[version]!.keys).toHaveLength(10);
|
||||
for (const k of CAMOFOX_VERIFIED_RELEASES[version]!.keys)
|
||||
expect(ok[k]).toMatchObject({ supported: true, verified: true });
|
||||
expect(camofoxCapabilitiesFromOpenApi(doc(version), { takeover: false }).takeover.verified).toBe(false);
|
||||
}
|
||||
const other = camofoxCapabilitiesFromOpenApi(doc("1.19.0"));
|
||||
expect(other.snapshot.verified).toBe(false);
|
||||
// 静态声明不知道上游版本:一律未核验
|
||||
expect(camofoxStaticCapabilities().snapshot.verified).toBe(false);
|
||||
|
||||
@@ -84,6 +84,22 @@ export const CAMOFOX_VERIFIED_RELEASES: Readonly<
|
||||
"persistentProfile",
|
||||
],
|
||||
},
|
||||
"1.18.0": {
|
||||
verifiedAt: "2026-10-01",
|
||||
source: "jo-inc/camofox-browser v1.18.0 (f94c81b),docker/camofox/Dockerfile 构建",
|
||||
keys: [
|
||||
"sessions",
|
||||
"tabs",
|
||||
"navigate",
|
||||
"snapshot",
|
||||
"screenshot",
|
||||
"interact",
|
||||
"extract",
|
||||
"downloadCapture",
|
||||
"takeover",
|
||||
"persistentProfile",
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
/** 某上游版本的已核验能力 + 配置覆盖(配置里显式 false 可撤销) */
|
||||
|
||||
@@ -1134,10 +1134,66 @@ export class CamofoxBrowserProvider implements BrowserProvider {
|
||||
* 当前页面内容(CF-2):地址(已脱敏)、标题、outerHTML、正文样本、navigator.userAgent。只读,不要求自动化控制权;
|
||||
* 上游不支持 evaluate 时返回 null。HTML 只给服务端解析器用,不进模型与日志。
|
||||
*/
|
||||
async pageContent(ref: TabRef, opts: { maxHtmlBytes?: number } = {}): Promise<PageContent | null> {
|
||||
async pageContent(
|
||||
ref: TabRef,
|
||||
opts: { maxHtmlBytes?: number; currentVisible?: boolean } = {},
|
||||
): Promise<PageContent | null> {
|
||||
const s = this.state(ref.sessionId);
|
||||
const max = Math.max(1024, Math.min(opts.maxHtmlBytes ?? 8 * 1024 * 1024, 16 * 1024 * 1024));
|
||||
return this.withProfile(s, async () => {
|
||||
// The desktop can create popups outside this adapter. Resolve its visible tab only
|
||||
// for the explicit resource handoff; regular Agent actions keep their selected tab.
|
||||
if (opts.currentVisible && !ref.tabId) {
|
||||
const listed = await this.json(
|
||||
await this.request("GET", "/tabs", { query: { userId: s.session.profileKey } }),
|
||||
"/tabs",
|
||||
);
|
||||
const tabs = Array.isArray(listed.tabs) ? (listed.tabs as Json[]) : [];
|
||||
const visible: string[] = [];
|
||||
let uncertain = false;
|
||||
for (const upstream of tabs) {
|
||||
const id = str(upstream.tabId) ?? str(upstream.targetId);
|
||||
if (!id) continue;
|
||||
const at = this.now().toISOString();
|
||||
const url = str(upstream.url);
|
||||
if (!s.tabs.has(id))
|
||||
s.tabs.set(id, {
|
||||
id: this.newId(),
|
||||
sessionId: ref.sessionId,
|
||||
upstreamTabId: id,
|
||||
url: url ? redactBrowserUrl(url) : null,
|
||||
title: str(upstream.title) ?? null,
|
||||
status: "open",
|
||||
lastSnapshotAt: null,
|
||||
closedAt: null,
|
||||
createdAt: at,
|
||||
updatedAt: at,
|
||||
});
|
||||
try {
|
||||
const probePath = `/tabs/${encodeURIComponent(id)}/evaluate`;
|
||||
const probe = await this.json(
|
||||
await this.request("POST", probePath, {
|
||||
body: {
|
||||
userId: s.session.profileKey,
|
||||
expression: '/* umt-visible-tab */ (() => ({ visible: document.visibilityState === "visible" }))()',
|
||||
},
|
||||
timeoutMs: s.budget.timeoutMs,
|
||||
}),
|
||||
probePath,
|
||||
);
|
||||
const state = probe.result && typeof probe.result === "object" ? (probe.result as Json).visible : undefined;
|
||||
if (state === true) visible.push(id);
|
||||
else if (state !== false) uncertain = true;
|
||||
} catch {
|
||||
// Missing/unsupported visibility cannot prove that the old tab is current.
|
||||
uncertain = true;
|
||||
}
|
||||
}
|
||||
if (uncertain || visible.length !== 1)
|
||||
throw new BrowserError("bad_request", "无法唯一确定桌面当前标签页,请回到资源详情页后重试,或指定标签页");
|
||||
if (s.currentTabId !== visible[0]) s.refsValid = false;
|
||||
s.currentTabId = visible[0]!;
|
||||
}
|
||||
const tab = this.tabOf(s, ref);
|
||||
const path = `/tabs/${encodeURIComponent(tab.upstreamTabId)}/evaluate`;
|
||||
let out: Json;
|
||||
|
||||
@@ -71,8 +71,9 @@ export interface BrowserProvider {
|
||||
/**
|
||||
* 当前页面内容(CF-2 挑战识别与浏览器代抓):地址(已脱敏)、标题、outerHTML、正文样本、navigator.userAgent。
|
||||
* 只读,不要求自动化控制权;上游不支持时返回 null。HTML 只给服务端解析器,不进模型与日志。
|
||||
* currentVisible 仅用于用户从桌面详情页交接资源:未指定 tabId 时发现唯一可见标签,不能确定则拒绝。
|
||||
*/
|
||||
pageContent?(ref: TabRef, opts?: { maxHtmlBytes?: number }): Promise<PageContent | null>;
|
||||
pageContent?(ref: TabRef, opts?: { maxHtmlBytes?: number; currentVisible?: boolean }): Promise<PageContent | null>;
|
||||
|
||||
// ── BR-2 凭据统一 ──
|
||||
/**
|
||||
|
||||
@@ -206,6 +206,44 @@ describe("camofox 适配器:身份与出口", () => {
|
||||
expect(cookies.find((c) => c.name === "cf_clearance")?.value).toBe("clr-1");
|
||||
});
|
||||
|
||||
it("resource handoff discovers a visible desktop popup while ordinary pageContent keeps its old selection", async () => {
|
||||
mock = await createMockCamofox({ accessKey: "k", site: cfSite("auto") });
|
||||
const { p, ref } = await openCf(mock);
|
||||
const original = [...mock.tabs.values()][0]!;
|
||||
original.visible = false;
|
||||
mock.tabs.set("desktop-popup", {
|
||||
...original,
|
||||
tabId: "desktop-popup",
|
||||
url: "https://audiences.example/details.php?id=2",
|
||||
visible: true,
|
||||
});
|
||||
expect((await p.pageContent!(ref))?.url).toBe("https://audiences.example/torrents.php");
|
||||
expect((await p.pageContent!(ref, { currentVisible: true }))?.url).toBe(
|
||||
"https://audiences.example/details.php?id=2",
|
||||
);
|
||||
expect(p.sessionInfo(ref.sessionId)?.tabs.some((t) => t.upstreamTabId === "desktop-popup")).toBe(true);
|
||||
expect((await p.pageContent!({ ...ref, tabId: original.tabId }, { currentVisible: true }))?.url).toBe(original.url);
|
||||
});
|
||||
|
||||
it("resource handoff rejects ambiguous visibility and hidden old tabs", async () => {
|
||||
mock = await createMockCamofox({ accessKey: "k", site: cfSite("auto") });
|
||||
const { p, ref } = await openCf(mock);
|
||||
const original = [...mock.tabs.values()][0]!;
|
||||
original.visible = false;
|
||||
await expect(p.pageContent!(ref, { currentVisible: true })).rejects.toMatchObject({ kind: "bad_request" });
|
||||
original.visible = true;
|
||||
mock.tabs.set("other-window", {
|
||||
...original,
|
||||
tabId: "other-window",
|
||||
url: "https://audiences.example/details.php?id=3",
|
||||
visible: true,
|
||||
});
|
||||
await expect(p.pageContent!(ref, { currentVisible: true })).rejects.toMatchObject({ kind: "bad_request" });
|
||||
expect(p.sessionInfo(ref.sessionId)?.currentTabId).toBe(original.tabId);
|
||||
mock.tabs.get("other-window")!.visible = null;
|
||||
await expect(p.pageContent!(ref, { currentVisible: true })).rejects.toMatchObject({ kind: "bad_request" });
|
||||
});
|
||||
|
||||
it("CF-2 坐标点击走插件真实鼠标事件(跨域 iframe 的 Turnstile 也点得到),不再 elementFromPoint", async () => {
|
||||
mock = await createMockCamofox({ accessKey: "k", site: cfSite("interactive") });
|
||||
const { p, ref } = await openCf(mock);
|
||||
|
||||
Reference in new issue
Block a user