feat(vom): function refactor

This commit is contained in:
Ljy-0827
2026-08-24 14:06:42 +08:00
parent 4b6cdde168
commit b7e62d8cf1
13 changed files with 1529 additions and 801 deletions
@@ -0,0 +1,26 @@
import type { Viewport, VomScene } from "@browser-skill/vom";
import type { FrameDocument } from "../frame-document";
import { buildSemanticGraph } from "./build";
import { projectSemanticGraph } from "./project";
import { resolveSemanticGraph } from "./resolve";
import type { SemanticAxNode } from "./types";
export type { SemanticAxNode } from "./types";
export function buildSemanticVomScene(input: {
documents: FrameDocument<SemanticAxNode>[];
viewport: Viewport;
rootFrameId?: string;
excludedBackendNodeIds?: ReadonlySet<number>;
}): VomScene {
return projectSemanticGraph(
resolveSemanticGraph(
buildSemanticGraph({
documents: input.documents,
viewport: input.viewport,
rootFrameId: input.rootFrameId,
excludedBackendNodeIds: input.excludedBackendNodeIds,
}),
),
);
}