mirror of
https://github.com/Tencent/BrowserSkill.git
synced 2026-09-10 13:01:23 +08:00
feat(vom): two channels to deal with canvas
This commit is contained in:
@@ -73,10 +73,15 @@ CSS-only hover menu looks like from here. It hovers a bounded set of likely trig
|
||||
few seconds and touches the live page; once you know which element hides the menu, `bsk hover <ref>`
|
||||
is cheaper and more precise.
|
||||
|
||||
When `bsk observe` renders `@eN surface ... [visual-only; ...]`, the ref identifies a rendered
|
||||
canvas surface, not an interactable DOM control. Use
|
||||
`bsk screenshot --ref @eN --session <id>` to inspect its visible crop. Do not pass a visual surface
|
||||
ref to click, fill, hover, or select; those commands intentionally reject screenshot-only refs.
|
||||
When `bsk observe` renders
|
||||
`@eN surface ... [visual-only; requires=image-understanding; ...]`, the ref identifies rendered
|
||||
canvas content that is not represented by the text observation, not an interactable DOM control.
|
||||
Keep using any reliable DOM/AX text and controls that appear alongside it. If you can actually
|
||||
inspect image output, use `bsk screenshot --ref @eN --session <id>` to obtain the visible crop. If
|
||||
you lack multimodal or image-reading capability, do not take a screenshot and pretend to know its
|
||||
contents, and never guess coordinates; tell the user that they need to switch to a model with
|
||||
image-understanding capability. Do not pass a visual surface ref to click, fill, hover, or select;
|
||||
those commands intentionally reject screenshot-only refs.
|
||||
|
||||
Escalate page reading only as needed:
|
||||
|
||||
|
||||
@@ -303,7 +303,7 @@ pub fn info_for_error(code: ErrorCode, data: Option<&serde_json::Value>) -> Rend
|
||||
(ErrorCode::PermissionDenied, reason::REF_CAPABILITY_DENIED) => RenderInfo {
|
||||
summary: "snapshot ref does not support this operation",
|
||||
hint: Some(
|
||||
"visual surface refs are screenshot-only; run `bsk screenshot --ref <ref> --session <id>`",
|
||||
"visual surface refs are screenshot-only; inspect `bsk screenshot --ref <ref> --session <id>` with image-understanding capability",
|
||||
),
|
||||
exit_code: base.exit_code,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user