mirror of
https://github.com/Tencent/BrowserSkill.git
synced 2026-09-10 13:01:23 +08:00
27 lines
842 B
TypeScript
27 lines
842 B
TypeScript
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,
|
|
}),
|
|
),
|
|
);
|
|
}
|