@visual-layer/grounding 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gate.d.ts +60 -0
- package/dist/gate.d.ts.map +1 -0
- package/dist/gate.js +131 -0
- package/dist/gate.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/score.d.ts +15 -0
- package/dist/score.d.ts.map +1 -1
- package/dist/score.js +155 -9
- package/dist/score.js.map +1 -1
- package/package.json +2 -2
package/dist/gate.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grounding gate + consensus — the decision layer that turns a ranked
|
|
3
|
+
* candidate list into a safe-to-act verdict.
|
|
4
|
+
*
|
|
5
|
+
* Gate = structure-first confidence + top-1/top-2 gap + warning disqualifiers.
|
|
6
|
+
* Pure deterministic, no model calls. The vision second-opinion is supplied
|
|
7
|
+
* out-of-band by the consuming agent (Claude/Codex have native vision) via
|
|
8
|
+
* confirm_grounding, or by a plugged VisionVerifier; this module only emits the
|
|
9
|
+
* "look now" signal (status === 'needs_visual_confirm').
|
|
10
|
+
*
|
|
11
|
+
* Why a gate at all: the scorer is a heuristic blend (text/role/bbox/source).
|
|
12
|
+
* Heuristics rank well but cannot prove the top candidate is what the user
|
|
13
|
+
* meant. The gate refuses to act when structure is ambiguous, and demands a
|
|
14
|
+
* vision second-opinion — so an action only fires when structure is confident
|
|
15
|
+
* OR vision confirms it. That is the route to ~100% accuracy on executed
|
|
16
|
+
* actions: never act on a guess.
|
|
17
|
+
*/
|
|
18
|
+
import { type ScreenGraph, type Warning } from '@visual-layer/core';
|
|
19
|
+
import type { GroundResult, GroundCandidate } from './score.js';
|
|
20
|
+
export type GroundingStatus = 'accepted' | 'needs_visual_confirm' | 'rejected';
|
|
21
|
+
export interface GateOptions {
|
|
22
|
+
/** Min top-1 confidence to accept without visual confirm. Default 0.85. */
|
|
23
|
+
acceptConfidence?: number;
|
|
24
|
+
/** Min gap (top1 - top2 confidence) to accept. Default 0.2 — guards ties. */
|
|
25
|
+
minGap?: number;
|
|
26
|
+
/** Min top-1 confidence below which the verdict is rejected outright. Default 0.3. */
|
|
27
|
+
rejectConfidence?: number;
|
|
28
|
+
/** Treat duplicate_label among instruction matches as disqualifying. Default true. */
|
|
29
|
+
duplicateLabelBlocks?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface GroundingVerdict {
|
|
32
|
+
status: GroundingStatus;
|
|
33
|
+
reason: string;
|
|
34
|
+
top?: GroundCandidate;
|
|
35
|
+
runnerUp?: GroundCandidate;
|
|
36
|
+
gap: number;
|
|
37
|
+
disqualifyingWarnings: Warning[];
|
|
38
|
+
}
|
|
39
|
+
export declare function gateGrounding(result: GroundResult, graph: ScreenGraph, opts?: GateOptions): GroundingVerdict;
|
|
40
|
+
export interface VisualVerdict {
|
|
41
|
+
/** Did vision confirm the proposed target is correct? */
|
|
42
|
+
confirmed: boolean;
|
|
43
|
+
/** The interactable id vision points at. Overrides gate top when set. */
|
|
44
|
+
interactableId?: string;
|
|
45
|
+
confidence?: number;
|
|
46
|
+
reason?: string;
|
|
47
|
+
}
|
|
48
|
+
export type ConsensusStatus = 'act' | 'blocked' | 'needs_visual_confirm';
|
|
49
|
+
export interface ConsensusResult {
|
|
50
|
+
status: ConsensusStatus;
|
|
51
|
+
interactableId?: string;
|
|
52
|
+
reason: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Combine a gate verdict with an optional vision second-opinion into the final
|
|
56
|
+
* action decision. accepted → act. rejected → blocked. needs_visual_confirm →
|
|
57
|
+
* act only if vision confirms (and points at a concrete target), else blocked.
|
|
58
|
+
*/
|
|
59
|
+
export declare function buildConsensus(verdict: GroundingVerdict, visual: VisualVerdict | null): ConsensusResult;
|
|
60
|
+
//# sourceMappingURL=gate.d.ts.map
|
|
@@ -0,0 +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eAAe,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,aAAa,GAAG,IAAI,GAC3B,eAAe,CAsBjB"}
|
package/dist/gate.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grounding gate + consensus — the decision layer that turns a ranked
|
|
3
|
+
* candidate list into a safe-to-act verdict.
|
|
4
|
+
*
|
|
5
|
+
* Gate = structure-first confidence + top-1/top-2 gap + warning disqualifiers.
|
|
6
|
+
* Pure deterministic, no model calls. The vision second-opinion is supplied
|
|
7
|
+
* out-of-band by the consuming agent (Claude/Codex have native vision) via
|
|
8
|
+
* confirm_grounding, or by a plugged VisionVerifier; this module only emits the
|
|
9
|
+
* "look now" signal (status === 'needs_visual_confirm').
|
|
10
|
+
*
|
|
11
|
+
* Why a gate at all: the scorer is a heuristic blend (text/role/bbox/source).
|
|
12
|
+
* Heuristics rank well but cannot prove the top candidate is what the user
|
|
13
|
+
* meant. The gate refuses to act when structure is ambiguous, and demands a
|
|
14
|
+
* vision second-opinion — so an action only fires when structure is confident
|
|
15
|
+
* OR vision confirms it. That is the route to ~100% accuracy on executed
|
|
16
|
+
* actions: never act on a guess.
|
|
17
|
+
*/
|
|
18
|
+
import {} from '@visual-layer/core';
|
|
19
|
+
const DEFAULTS = {
|
|
20
|
+
acceptConfidence: 0.85,
|
|
21
|
+
minGap: 0.2,
|
|
22
|
+
rejectConfidence: 0.3,
|
|
23
|
+
duplicateLabelBlocks: true,
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Structural warning codes (from the captured graph) that make the whole graph
|
|
27
|
+
* unsafe to act on: incomplete bbox enrichment or no interactables at all.
|
|
28
|
+
*/
|
|
29
|
+
const STRUCTURAL_DISQUALIFY = new Set(['interactive_nodes_missing_bbox', 'no_interactables']);
|
|
30
|
+
/**
|
|
31
|
+
* Instruction-scoped warning codes (from the grounding result) that flag
|
|
32
|
+
* ambiguity for THIS instruction specifically.
|
|
33
|
+
*/
|
|
34
|
+
const AMBIGUITY_DISQUALIFY = new Set(['duplicate_label', 'low_confidence']);
|
|
35
|
+
export function gateGrounding(result, graph, opts = {}) {
|
|
36
|
+
const o = { ...DEFAULTS, ...opts };
|
|
37
|
+
const candidates = result.candidates;
|
|
38
|
+
if (candidates.length === 0) {
|
|
39
|
+
return {
|
|
40
|
+
status: 'rejected',
|
|
41
|
+
reason: 'no candidates matched the instruction',
|
|
42
|
+
gap: 0,
|
|
43
|
+
disqualifyingWarnings: [],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const top = candidates[0];
|
|
47
|
+
const runnerUp = candidates[1];
|
|
48
|
+
const gap = runnerUp ? round3(top.confidence - runnerUp.confidence) : 1;
|
|
49
|
+
// Disqualifiers split by scope:
|
|
50
|
+
// - structural (graph.warnings): always disqualify — the data is incomplete.
|
|
51
|
+
// - ambiguity (result.warnings): only disqualify when duplicateLabelBlocks.
|
|
52
|
+
const structural = graph.warnings.filter((w) => STRUCTURAL_DISQUALIFY.has(w.code));
|
|
53
|
+
const ambiguity = result.warnings.filter((w) => {
|
|
54
|
+
if (!AMBIGUITY_DISQUALIFY.has(w.code))
|
|
55
|
+
return false;
|
|
56
|
+
if (w.code === 'duplicate_label')
|
|
57
|
+
return o.duplicateLabelBlocks;
|
|
58
|
+
return true;
|
|
59
|
+
});
|
|
60
|
+
const disqualifying = [...structural, ...ambiguity];
|
|
61
|
+
if (top.confidence < o.rejectConfidence) {
|
|
62
|
+
return {
|
|
63
|
+
status: 'rejected',
|
|
64
|
+
reason: `top confidence ${top.confidence.toFixed(2)} < reject floor ${o.rejectConfidence}`,
|
|
65
|
+
top,
|
|
66
|
+
runnerUp,
|
|
67
|
+
gap,
|
|
68
|
+
disqualifyingWarnings: disqualifying,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const confidenceOk = top.confidence >= o.acceptConfidence;
|
|
72
|
+
const gapOk = gap >= o.minGap;
|
|
73
|
+
const warningsOk = disqualifying.length === 0;
|
|
74
|
+
if (confidenceOk && gapOk && warningsOk) {
|
|
75
|
+
return {
|
|
76
|
+
status: 'accepted',
|
|
77
|
+
reason: 'structure confident and unambiguous',
|
|
78
|
+
top,
|
|
79
|
+
runnerUp,
|
|
80
|
+
gap,
|
|
81
|
+
disqualifyingWarnings: disqualifying,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const reasons = [];
|
|
85
|
+
if (!confidenceOk)
|
|
86
|
+
reasons.push(`confidence ${top.confidence.toFixed(2)} < ${o.acceptConfidence}`);
|
|
87
|
+
if (!gapOk)
|
|
88
|
+
reasons.push(`gap ${gap.toFixed(2)} < ${o.minGap} (tie)`);
|
|
89
|
+
if (!warningsOk)
|
|
90
|
+
reasons.push(`${disqualifying.length} disqualifier(s): ${disqualifying.map((w) => w.code).join(', ')}`);
|
|
91
|
+
return {
|
|
92
|
+
status: 'needs_visual_confirm',
|
|
93
|
+
reason: reasons.join('; '),
|
|
94
|
+
top,
|
|
95
|
+
runnerUp,
|
|
96
|
+
gap,
|
|
97
|
+
disqualifyingWarnings: disqualifying,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Combine a gate verdict with an optional vision second-opinion into the final
|
|
102
|
+
* action decision. accepted → act. rejected → blocked. needs_visual_confirm →
|
|
103
|
+
* act only if vision confirms (and points at a concrete target), else blocked.
|
|
104
|
+
*/
|
|
105
|
+
export function buildConsensus(verdict, visual) {
|
|
106
|
+
if (verdict.status === 'accepted') {
|
|
107
|
+
return { status: 'act', interactableId: verdict.top?.interactableId, reason: 'structure accepted' };
|
|
108
|
+
}
|
|
109
|
+
if (verdict.status === 'rejected') {
|
|
110
|
+
return { status: 'blocked', reason: verdict.reason };
|
|
111
|
+
}
|
|
112
|
+
// needs_visual_confirm — vision is mandatory before acting.
|
|
113
|
+
if (!visual) {
|
|
114
|
+
return { status: 'needs_visual_confirm', reason: verdict.reason };
|
|
115
|
+
}
|
|
116
|
+
if (!visual.confirmed) {
|
|
117
|
+
return { status: 'blocked', reason: `vision rejected: ${visual.reason ?? 'no reason given'}` };
|
|
118
|
+
}
|
|
119
|
+
// Gate was ambiguous, so vision MUST name the target — do not silently fall
|
|
120
|
+
// back to the (ambiguous) structural top. The agent always has the candidate
|
|
121
|
+
// list with bboxes, so requiring an explicit id is safe and prevents acting
|
|
122
|
+
// on the very tie the gate flagged.
|
|
123
|
+
if (!visual.interactableId) {
|
|
124
|
+
return { status: 'blocked', reason: 'vision confirmed but named no target id' };
|
|
125
|
+
}
|
|
126
|
+
return { status: 'act', interactableId: visual.interactableId, reason: 'vision confirmed structure' };
|
|
127
|
+
}
|
|
128
|
+
function round3(n) {
|
|
129
|
+
return Math.round(n * 1000) / 1000;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=gate.js.map
|
package/dist/gate.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gate.js","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAkC,MAAM,oBAAoB,CAAC;AAyBpE,MAAM,QAAQ,GAA0B;IACtC,gBAAgB,EAAE,IAAI;IACtB,MAAM,EAAE,GAAG;IACX,gBAAgB,EAAE,GAAG;IACrB,oBAAoB,EAAE,IAAI;CAC3B,CAAC;AAEF;;;GAGG;AACH,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC,CAAC,gCAAgC,EAAE,kBAAkB,CAAC,CAAC,CAAC;AAC9F;;;GAGG;AACH,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAE5E,MAAM,UAAU,aAAa,CAC3B,MAAoB,EACpB,KAAkB,EAClB,OAAoB,EAAE;IAEtB,M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IAAI,CAAC;AACrC,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAE1B,eAAO,MAAM,iBAAiB,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAE1B,eAAO,MAAM,iBAAiB,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAE1B,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAE1B,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC"}
|
package/dist/score.d.ts
CHANGED
|
@@ -19,6 +19,21 @@ export interface GroundOptions {
|
|
|
19
19
|
minScore?: number;
|
|
20
20
|
/** Weights for the composite blend. Need not sum to 1. */
|
|
21
21
|
weights?: Partial<Record<keyof ScoreBreakdown, number>>;
|
|
22
|
+
/**
|
|
23
|
+
* Additive confidence bonus applied when a candidate is the SOLE token match
|
|
24
|
+
* for the instruction (no sibling shares a content token). Breaks ties where
|
|
25
|
+
* one element matches and the rest don't; identical-label duplicates stay tied
|
|
26
|
+
* (both match → neither unique → bonus 0 → gate escalates, as it should).
|
|
27
|
+
* Default 0.2.
|
|
28
|
+
*/
|
|
29
|
+
uniqueBonus?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Symmetric boost/penalty for ordinal/spatial cues ("top/bottom/left/right/
|
|
32
|
+
* first/last/2nd <label>"). When the cue resolves an ambiguous token-match
|
|
33
|
+
* set, the picked candidate gets +spatialBonus and its token-matcher siblings
|
|
34
|
+
* get -spatialBonus — opens the gate gap. Default 0.15.
|
|
35
|
+
*/
|
|
36
|
+
spatialBonus?: number;
|
|
22
37
|
}
|
|
23
38
|
export interface GroundResult {
|
|
24
39
|
candidates: GroundCandidate[];
|
package/dist/score.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"score.d.ts","sourceRoot":"","sources":["../src/score.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,IAAI,EACT,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"score.d.ts","sourceRoot":"","sources":["../src/score.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,IAAI,EACT,KAAK,cAAc,EAQpB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,cAAc,CAAC;IAC/B,OAAO,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;IACxD;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAaD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,GAAE,aAAkB,GAAG,YAAY,CA+HjH"}
|
package/dist/score.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* instruction using structure-first signals: text similarity, role match, bbox
|
|
4
4
|
* visibility, source confidence. No model calls (§5 grounding responsibilities).
|
|
5
5
|
*/
|
|
6
|
-
import { compareText, contains as bboxContains, hasArea, blendConfidence, warn, } from '@visual-layer/core';
|
|
6
|
+
import { compareText, tokenizeText, contains as bboxContains, hasArea, blendConfidence, clampConfidence, warn, } from '@visual-layer/core';
|
|
7
7
|
const DEFAULT_WEIGHTS = { text: 0.6, role: 0.15, bbox: 0.1, source: 0.15 };
|
|
8
8
|
const ROLE_HINTS = [
|
|
9
9
|
{ re: /\b(click|press|tap|hit)\b/i, roles: ['button', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'tab', 'treeitem'] },
|
|
@@ -25,33 +25,86 @@ export function groundInstruction(graph, instruction, opts = {}) {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
const hintedRoles = roleHintsFor(instruction);
|
|
28
|
+
const uniqueBonus = opts.uniqueBonus ?? 0.2;
|
|
29
|
+
const instrContent = contentTokens(instruction);
|
|
30
|
+
// Token-match set: candidates whose label shares ≥1 content token with the
|
|
31
|
+
// instruction (verbs/articles excluded so "click Save" matches on "save", not
|
|
32
|
+
// "click"). When exactly one candidate matches, it is the unique target.
|
|
33
|
+
const matchedIds = new Set();
|
|
34
|
+
for (const i of graph.interactables) {
|
|
35
|
+
const labelContent = contentTokens(labelFor(i));
|
|
36
|
+
for (const t of labelContent) {
|
|
37
|
+
if (instrContent.has(t)) {
|
|
38
|
+
matchedIds.add(i.id);
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const isUniqueTokenMatch = matchedIds.size === 1;
|
|
44
|
+
// Ordinal/spatial cue — resolves identical-label ties that uniqueness cannot
|
|
45
|
+
// (e.g. two "Save changes" buttons + "click the top Save"). Only engaged when
|
|
46
|
+
// the token-match set is ambiguous (≥2 matchers); a unique match is already
|
|
47
|
+
// resolved by the uniqueness bonus.
|
|
48
|
+
const spatialBonus = opts.spatialBonus ?? 0.15;
|
|
49
|
+
const cue = parseSpatialCue(instruction);
|
|
50
|
+
const tokenMatchers = graph.interactables.filter((i) => matchedIds.has(i.id));
|
|
51
|
+
const spatialPickId = cue && tokenMatchers.length > 1 ? pickSpatialId(tokenMatchers, cue) : null;
|
|
28
52
|
const scored = graph.interactables.map((i) => {
|
|
29
53
|
const label = labelFor(i);
|
|
30
54
|
const text = compareText(instruction, label);
|
|
31
55
|
const role = roleScore(i, hintedRoles);
|
|
32
56
|
const bbox = bboxScore(i, graph.viewport);
|
|
33
57
|
const source = sourceScore(i);
|
|
34
|
-
const
|
|
58
|
+
const unique = isUniqueTokenMatch && matchedIds.has(i.id) ? 1 : 0;
|
|
59
|
+
let spatialDelta = 0;
|
|
60
|
+
let spatial = 0;
|
|
61
|
+
if (spatialPickId) {
|
|
62
|
+
if (i.id === spatialPickId) {
|
|
63
|
+
spatialDelta = spatialBonus;
|
|
64
|
+
spatial = 1;
|
|
65
|
+
}
|
|
66
|
+
else if (matchedIds.has(i.id)) {
|
|
67
|
+
// suppress the cue-losing siblings so the pick's lead clears minGap
|
|
68
|
+
spatialDelta = -spatialBonus;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const confidence = clampConfidence(blendConfidence([
|
|
35
72
|
{ value: text, weight: weights.text ?? 0 },
|
|
36
73
|
{ value: role, weight: weights.role ?? 0 },
|
|
37
74
|
{ value: bbox, weight: weights.bbox ?? 0 },
|
|
38
75
|
{ value: source, weight: weights.source ?? 0 },
|
|
39
|
-
])
|
|
40
|
-
|
|
76
|
+
]) +
|
|
77
|
+
unique * uniqueBonus +
|
|
78
|
+
spatialDelta);
|
|
79
|
+
return {
|
|
80
|
+
inter: i,
|
|
81
|
+
confidence,
|
|
82
|
+
unique,
|
|
83
|
+
spatial,
|
|
84
|
+
breakdown: { text, role, bbox, source, unique, spatial },
|
|
85
|
+
};
|
|
41
86
|
});
|
|
42
87
|
scored.sort((a, b) => b.confidence - a.confidence);
|
|
43
|
-
// duplicate-label detection
|
|
88
|
+
// duplicate-label detection — scoped to token matches. Two unrelated
|
|
89
|
+
// elements that merely share a label (e.g. two "Save changes" buttons on the
|
|
90
|
+
// page) only matter when the instruction actually targets that label; a
|
|
91
|
+
// duplicate that the instruction does not reference must not block a unique
|
|
92
|
+
// match elsewhere (e.g. "click Cancel" with two Saves present). A spatial cue
|
|
93
|
+
// that resolves the tie ("click the top Save") suppresses the warning — the
|
|
94
|
+
// ambiguity is no longer unresolved.
|
|
44
95
|
const labelCounts = new Map();
|
|
45
96
|
for (const s of scored) {
|
|
46
|
-
if (s.
|
|
97
|
+
if (matchedIds.has(s.inter.id)) {
|
|
47
98
|
const l = labelFor(s.inter);
|
|
48
99
|
if (l)
|
|
49
100
|
labelCounts.set(l, (labelCounts.get(l) ?? 0) + 1);
|
|
50
101
|
}
|
|
51
102
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
103
|
+
if (!spatialPickId) {
|
|
104
|
+
for (const [label, count] of labelCounts) {
|
|
105
|
+
if (count > 1)
|
|
106
|
+
warnings.push(warn('duplicate_label', `"${label}" matched ${count}x`, undefined));
|
|
107
|
+
}
|
|
55
108
|
}
|
|
56
109
|
const candidates = scored
|
|
57
110
|
.filter((s) => s.confidence >= minScore)
|
|
@@ -67,6 +120,8 @@ export function groundInstruction(graph, instruction, opts = {}) {
|
|
|
67
120
|
role: round3(s.breakdown.role),
|
|
68
121
|
bbox: round3(s.breakdown.bbox),
|
|
69
122
|
source: round3(s.breakdown.source),
|
|
123
|
+
unique: round3(s.unique),
|
|
124
|
+
spatial: round3(s.spatial),
|
|
70
125
|
},
|
|
71
126
|
sources: s.inter.source,
|
|
72
127
|
}));
|
|
@@ -111,6 +166,97 @@ function sourceScore(i) {
|
|
|
111
166
|
return 0.9;
|
|
112
167
|
return 0.8;
|
|
113
168
|
}
|
|
169
|
+
/* ---------- uniqueness signal ---------- */
|
|
170
|
+
// Instruction tokens that carry no target meaning (verbs/articles). Excluded
|
|
171
|
+
// from the uniqueness match so a verb like "click" cannot make a verb-named
|
|
172
|
+
// element ("Click counter") look like a target match.
|
|
173
|
+
const STOPWORD_TOKENS = new Set([
|
|
174
|
+
'click', 'press', 'tap', 'hit', 'type', 'enter', 'input', 'fill', 'write',
|
|
175
|
+
'open', 'follow', 'visit', 'go', 'select', 'choose', 'pick', 'check', 'uncheck', 'toggle',
|
|
176
|
+
'the', 'a', 'an', 'and', 'or', 'to', 'on', 'in', 'at', 'of', 'for', 'with',
|
|
177
|
+
'it', 'this', 'that', 'please', 'me',
|
|
178
|
+
]);
|
|
179
|
+
function contentTokens(text) {
|
|
180
|
+
const out = new Set();
|
|
181
|
+
for (const t of tokenizeText(text)) {
|
|
182
|
+
if (!STOPWORD_TOKENS.has(t))
|
|
183
|
+
out.add(t);
|
|
184
|
+
}
|
|
185
|
+
return out;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Parse an ordinal/spatial cue from a natural-language instruction. Returns the
|
|
189
|
+
* first cue found (an instruction rarely carries two). Lowercased, word-boundary
|
|
190
|
+
* matched so "bottom" does not fire inside "bottomless".
|
|
191
|
+
*/
|
|
192
|
+
function parseSpatialCue(instruction) {
|
|
193
|
+
const t = ` ${instruction.toLowerCase()} `;
|
|
194
|
+
const nth = t.match(/\b(\d+)(?:st|nd|rd|th)\b/);
|
|
195
|
+
if (nth)
|
|
196
|
+
return { type: 'nth', n: parseInt(nth[1], 10) };
|
|
197
|
+
if (/\b(first|1st)\b/.test(t))
|
|
198
|
+
return { type: 'first' };
|
|
199
|
+
if (/\b(second|2nd)\b/.test(t))
|
|
200
|
+
return { type: 'nth', n: 2 };
|
|
201
|
+
if (/\b(third|3rd)\b/.test(t))
|
|
202
|
+
return { type: 'nth', n: 3 };
|
|
203
|
+
if (/\b(last|final)\b/.test(t))
|
|
204
|
+
return { type: 'last' };
|
|
205
|
+
if (/\b(top|topmost|upper)/.test(t))
|
|
206
|
+
return { type: 'top' };
|
|
207
|
+
if (/\b(bottom|bottommost|lower)/.test(t))
|
|
208
|
+
return { type: 'bottom' };
|
|
209
|
+
if (/\b(left|leftmost)/.test(t))
|
|
210
|
+
return { type: 'left' };
|
|
211
|
+
if (/\b(right|rightmost)/.test(t))
|
|
212
|
+
return { type: 'right' };
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Pick the candidate id matching the spatial cue among the given matchers.
|
|
217
|
+
* Reading order = sort by top edge (y), then left edge (x). Returns null when
|
|
218
|
+
* an ordinal index exceeds the available count (cue unresolvable → stays tied).
|
|
219
|
+
*/
|
|
220
|
+
function pickSpatialId(matchers, cue) {
|
|
221
|
+
switch (cue.type) {
|
|
222
|
+
case 'top':
|
|
223
|
+
return extremaId(matchers, (i) => i.bbox[1], true);
|
|
224
|
+
case 'bottom':
|
|
225
|
+
return extremaId(matchers, (i) => i.bbox[1], false);
|
|
226
|
+
case 'left':
|
|
227
|
+
return extremaId(matchers, (i) => i.bbox[0], true);
|
|
228
|
+
case 'right':
|
|
229
|
+
return extremaId(matchers, (i) => i.bbox[0], false);
|
|
230
|
+
case 'first':
|
|
231
|
+
return readingOrder(matchers)[0]?.id ?? null;
|
|
232
|
+
case 'last': {
|
|
233
|
+
const order = readingOrder(matchers);
|
|
234
|
+
return order[order.length - 1]?.id ?? null;
|
|
235
|
+
}
|
|
236
|
+
case 'nth': {
|
|
237
|
+
const order = readingOrder(matchers);
|
|
238
|
+
return cue.n >= 1 && cue.n <= order.length ? order[cue.n - 1].id : null;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/** id of the element minimizing (min=true) or maximizing (min=false) `score`. */
|
|
243
|
+
function extremaId(items, score, min) {
|
|
244
|
+
if (items.length === 0)
|
|
245
|
+
return null;
|
|
246
|
+
let pick = items[0];
|
|
247
|
+
let best = score(pick);
|
|
248
|
+
for (const i of items.slice(1)) {
|
|
249
|
+
const v = score(i);
|
|
250
|
+
if ((min && v < best) || (!min && v > best)) {
|
|
251
|
+
best = v;
|
|
252
|
+
pick = i;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return pick.id;
|
|
256
|
+
}
|
|
257
|
+
function readingOrder(items) {
|
|
258
|
+
return [...items].sort((a, b) => a.bbox[1] - b.bbox[1] || a.bbox[0] - b.bbox[0]);
|
|
259
|
+
}
|
|
114
260
|
function round3(n) {
|
|
115
261
|
return Math.round(n * 1000) / 1000;
|
|
116
262
|
}
|
package/dist/score.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"score.js","sourceRoot":"","sources":["../src/score.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAML,WAAW,EACX,QAAQ,IAAI,YAAY,EACxB,OAAO,EACP,eAAe,EACf,IAAI,GACL,MAAM,oBAAoB,CAAC;AAyB5B,MAAM,eAAe,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE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orer, compare_graphs, eval_grounding",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dist"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@visual-layer/core": "1.0.
|
|
27
|
+
"@visual-layer/core": "1.0.1"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "tsc -b",
|