@mercuryo-ai/agentbrowse 0.2.61 → 0.2.63
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/CHANGELOG.md +33 -1
- package/README.md +102 -9
- package/dist/browser-session-state.d.ts +2 -11
- package/dist/browser-session-state.d.ts.map +1 -1
- package/dist/browser-session-state.js +0 -4
- package/dist/commands/act.d.ts.map +1 -1
- package/dist/commands/act.js +14 -5
- package/dist/commands/attach.d.ts +1 -3
- package/dist/commands/attach.d.ts.map +1 -1
- package/dist/commands/attach.js +0 -2
- package/dist/commands/browser-status.d.ts +0 -2
- package/dist/commands/browser-status.d.ts.map +1 -1
- package/dist/commands/browser-status.js +1 -7
- package/dist/commands/interaction-kernel.d.ts +1 -1
- package/dist/commands/interaction-kernel.d.ts.map +1 -1
- package/dist/commands/interaction-kernel.js +1 -1
- package/dist/commands/launch.d.ts +0 -1
- package/dist/commands/launch.d.ts.map +1 -1
- package/dist/commands/launch.js +0 -4
- package/dist/commands/observe-accessibility.d.ts.map +1 -1
- package/dist/commands/observe-accessibility.js +36 -2
- package/dist/commands/observe-inventory.d.ts +49 -7
- package/dist/commands/observe-inventory.d.ts.map +1 -1
- package/dist/commands/observe-inventory.js +807 -96
- package/dist/commands/observe-persistence.d.ts.map +1 -1
- package/dist/commands/observe-persistence.js +49 -6
- package/dist/commands/observe-projection.d.ts +6 -2
- package/dist/commands/observe-projection.d.ts.map +1 -1
- package/dist/commands/observe-projection.js +251 -27
- package/dist/commands/observe-semantics.d.ts +1 -0
- package/dist/commands/observe-semantics.d.ts.map +1 -1
- package/dist/commands/observe-semantics.js +541 -135
- package/dist/commands/observe-signals.d.ts +4 -4
- package/dist/commands/observe-signals.d.ts.map +1 -1
- package/dist/commands/observe-signals.js +2 -2
- package/dist/commands/observe-surfaces.d.ts +2 -1
- package/dist/commands/observe-surfaces.d.ts.map +1 -1
- package/dist/commands/observe-surfaces.js +143 -45
- package/dist/commands/observe.d.ts +5 -1
- package/dist/commands/observe.d.ts.map +1 -1
- package/dist/commands/observe.js +15 -11
- package/dist/commands/semantic-observe.d.ts.map +1 -1
- package/dist/commands/semantic-observe.js +43 -0
- package/dist/library.d.ts +2 -1
- package/dist/library.d.ts.map +1 -1
- package/dist/library.js +2 -1
- package/dist/match-resolve-fill.d.ts +196 -0
- package/dist/match-resolve-fill.d.ts.map +1 -0
- package/dist/match-resolve-fill.js +700 -0
- package/dist/match-resolve-fill.test-support.d.ts +34 -0
- package/dist/match-resolve-fill.test-support.d.ts.map +1 -0
- package/dist/match-resolve-fill.test-support.js +81 -0
- package/dist/runtime-protected-state.d.ts.map +1 -1
- package/dist/runtime-protected-state.js +12 -0
- package/dist/runtime-state.d.ts +6 -0
- package/dist/runtime-state.d.ts.map +1 -1
- package/dist/runtime-state.js +6 -0
- package/dist/secrets/form-matcher.d.ts.map +1 -1
- package/dist/secrets/form-matcher.js +76 -27
- package/dist/secrets/protected-exact-value-redaction.d.ts.map +1 -1
- package/dist/secrets/protected-exact-value-redaction.js +6 -0
- package/dist/secrets/protected-fill.js +3 -3
- package/dist/session.d.ts +3 -3
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +2 -2
- package/dist/solver/browser-launcher.d.ts.map +1 -1
- package/dist/solver/browser-launcher.js +2 -1
- package/dist/testing.d.ts +1 -0
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +1 -0
- package/docs/README.md +28 -11
- package/docs/api-reference.md +311 -19
- package/docs/assistive-runtime.md +41 -16
- package/docs/getting-started.md +45 -1
- package/docs/integration-checklist.md +32 -3
- package/docs/match-resolve-fill.md +699 -0
- package/docs/protected-fill.md +373 -91
- package/docs/testing.md +147 -15
- package/docs/troubleshooting.md +5 -0
- package/examples/README.md +7 -0
- package/examples/match-resolve-fill.ts +107 -0
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
-
-
|
|
5
|
+
- added `match`, `resolve`, and `fill` primitives for deciding which
|
|
6
|
+
caller-supplied value belongs in which observed field and applying it
|
|
7
|
+
through the existing browser runtime. Default match results expose
|
|
8
|
+
opaque value/artifact refs and never carry raw values through JSON
|
|
9
|
+
serialization
|
|
10
|
+
- two resolver shapes accepted at the `fill(...)` `{ resolver }` slot:
|
|
11
|
+
the main `AgentbrowseMatchResolver` (required `resolve`, optional
|
|
12
|
+
`resolveBatch`, optional `fill`) and the narrow
|
|
13
|
+
`AgentbrowseGroupFillHandler` (just `fill`) for callers that only
|
|
14
|
+
apply ready grouped artifacts. `resolve(plan, { with })` only
|
|
15
|
+
accepts the main interface so `.resolve` is compile-time guaranteed.
|
|
16
|
+
Runtime picks the right capability through type guards and raises
|
|
17
|
+
`match_resolver_required` when a passed object lacks a capability
|
|
18
|
+
the current plan needs
|
|
19
|
+
- `matchGroup` returns `ambiguous_group` when several candidates tie on
|
|
20
|
+
overlap and confidence, instead of silently picking the first by sort
|
|
21
|
+
order
|
|
22
|
+
- stable resolved value/artifact refs (`value:${candidateRef}:resolved`,
|
|
23
|
+
`artifact:${candidateRef}:resolved`) so repeated resolves produce the
|
|
24
|
+
same refs
|
|
25
|
+
- `ObserveTarget` now carries `pageRef` so observed targets flow
|
|
26
|
+
directly into `match(...)` without extra glue; `MatchableTarget` was
|
|
27
|
+
also relaxed to accept minimal target objects
|
|
28
|
+
- `/testing` subpath now also exports `createFixtureMatchStore`,
|
|
29
|
+
`createFixtureGroupStore`, `createFixtureResolver`,
|
|
30
|
+
`fixtureResolvedValue`, and `fixtureResolvedArtifact` for wrapper
|
|
31
|
+
packages that test against the new primitives
|
|
32
|
+
- added `docs/match-resolve-fill.md` and an `examples/match-resolve-fill.ts`
|
|
33
|
+
runnable example; repositioned the README as «browser runtime plus
|
|
34
|
+
deterministic field data-plane primitives»
|
|
35
|
+
- `tsconfig.examples.json` and a `check-types:examples` script keep
|
|
36
|
+
example files type-checked against the project's public surface,
|
|
37
|
+
mirroring the pattern in `@mercuryo-ai/magicpay-sdk`
|
|
6
38
|
|
|
7
39
|
## 0.2.52
|
|
8
40
|
|
package/README.md
CHANGED
|
@@ -2,18 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@mercuryo-ai/agentbrowse) [](LICENSE) [](https://nodejs.org)
|
|
4
4
|
|
|
5
|
-
Give your AI agent a real browser
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
Give your AI agent a real browser — and a deterministic way to fill fields
|
|
6
|
+
on it.
|
|
7
|
+
|
|
8
|
+
AgentBrowse is the browser runtime for agent systems that need to work with
|
|
9
|
+
real web pages, plus a small set of data-plane primitives for deciding which
|
|
10
|
+
value belongs in which observed field without routing the values through
|
|
11
|
+
the LLM prompt. Your app keeps full control of orchestration and business
|
|
12
|
+
logic; AgentBrowse handles the page and the deterministic apply step.
|
|
13
|
+
|
|
14
|
+
The package has two main parts:
|
|
15
|
+
|
|
16
|
+
- **Browser runtime** — launch or attach a browser, `observe(...)` the page,
|
|
17
|
+
`act(...)` on targets, `extract(...)` structured data, `close(...)` when
|
|
18
|
+
done.
|
|
19
|
+
- **Data-plane primitives** — `match(subject, { from })` picks a candidate
|
|
20
|
+
for an observed target or form, `resolve(plan, { with })` turns a plan
|
|
21
|
+
into a ready value or artifact through a caller-supplied adapter, and
|
|
22
|
+
`fill(session, subject, plan, { resolver? })` applies the result to the
|
|
23
|
+
browser deterministically. Default match results never expose raw values
|
|
24
|
+
to serializable output.
|
|
11
25
|
|
|
12
26
|
Typical workflow:
|
|
13
27
|
|
|
14
28
|
1. open a browser (or attach to an existing one) and get a `session`;
|
|
15
29
|
2. ask AgentBrowse what's on the page with `observe(...)`;
|
|
16
|
-
3. act
|
|
30
|
+
3. either `act(...)` directly, or `match(...) → fill(...)` when you want
|
|
31
|
+
a deterministic field-value decision;
|
|
17
32
|
4. use `extract(...)` when you need structured data instead of an action;
|
|
18
33
|
5. close the session when you are done.
|
|
19
34
|
|
|
@@ -123,6 +138,7 @@ Runnable examples live in [`examples/`](./examples/README.md):
|
|
|
123
138
|
- `npx tsx examples/basic.ts`
|
|
124
139
|
- `npx tsx examples/attach.ts`
|
|
125
140
|
- `npx tsx examples/extract.ts`
|
|
141
|
+
- `npx tsx examples/match-resolve-fill.ts`
|
|
126
142
|
|
|
127
143
|
The library entrypoint does not load `.env` files. Environment loading only
|
|
128
144
|
happens in the CLI entrypoint.
|
|
@@ -131,6 +147,77 @@ Both `launch(...)` and `attach(...)` bootstrap the same sticky-owner
|
|
|
131
147
|
lifecycle. That owner may live in-process or in an internal detached host,
|
|
132
148
|
but it is not a user-managed daemon contract.
|
|
133
149
|
|
|
150
|
+
## Match, Resolve, Fill
|
|
151
|
+
|
|
152
|
+
Once `observe(...)` has returned a target or a fillable form, three
|
|
153
|
+
primitives cover the end-to-end decision of putting a value into a field:
|
|
154
|
+
|
|
155
|
+
- **`match`** decides which candidate value fits the observed target or
|
|
156
|
+
fillable form. Pure and local.
|
|
157
|
+
- **`resolve`** turns a `needs_resolution` plan into a ready value by
|
|
158
|
+
calling a caller-supplied adapter. This is the only step that may reach
|
|
159
|
+
a network, a vault, or an approval UI.
|
|
160
|
+
- **`fill`** applies the matched value to the browser through the same
|
|
161
|
+
deterministic path as `act(...)`.
|
|
162
|
+
|
|
163
|
+
Simplest case — the value is already in memory:
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
import { match, resolve, fill } from '@mercuryo-ai/agentbrowse';
|
|
167
|
+
|
|
168
|
+
const matched = await match(emailTarget, {
|
|
169
|
+
from: { email: 'traveler@example.com' },
|
|
170
|
+
});
|
|
171
|
+
// matched.kind === 'ready'
|
|
172
|
+
await fill(session, emailTarget, matched);
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
When the value lives behind a lookup, the candidate carries a `resolve`
|
|
176
|
+
plan and your adapter handles the fetch:
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
const pending = await match(passwordTarget, {
|
|
180
|
+
from: [
|
|
181
|
+
{
|
|
182
|
+
fieldKey: 'password',
|
|
183
|
+
type: 'secret',
|
|
184
|
+
resolve: { kind: 'vault_lookup', key: 'login.password' },
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
});
|
|
188
|
+
// pending.kind === 'needs_resolution'
|
|
189
|
+
|
|
190
|
+
const ready = await resolve(pending, { with: vaultResolver });
|
|
191
|
+
await fill(session, passwordTarget, ready);
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Core rules:
|
|
195
|
+
|
|
196
|
+
- **No raw values in public results.** `match` returns plans and refs, not
|
|
197
|
+
secrets; dereferencing happens inside `fill(...)` through a non-enumerable
|
|
198
|
+
accessor. Serialising a `ready` result across a process boundary drops
|
|
199
|
+
the value — ship the `needs_resolution` plan instead and let the
|
|
200
|
+
downstream side run `resolve → fill`.
|
|
201
|
+
- **One resolver slot, two accepted shapes.** The main
|
|
202
|
+
`AgentbrowseMatchResolver` has a required `resolve` plus optional
|
|
203
|
+
`resolveBatch` and optional `fill`; the narrow
|
|
204
|
+
`AgentbrowseGroupFillHandler` has just `fill`. Both are accepted in
|
|
205
|
+
the same `{ resolver }` slot on `fill(...)`; `resolve(plan, { with })`
|
|
206
|
+
only accepts the main interface. Use the narrow handler when the
|
|
207
|
+
caller already has the grouped artifact in hand and only needs to
|
|
208
|
+
apply it.
|
|
209
|
+
- **Determinism first.** Resolved value/artifact refs are stable
|
|
210
|
+
(`value:${candidateRef}:resolved`), so the same plan produces the same
|
|
211
|
+
refs across calls — safe to use in snapshot tests and trace correlation.
|
|
212
|
+
|
|
213
|
+
See:
|
|
214
|
+
|
|
215
|
+
- [Match / Resolve / Fill Guide](./docs/match-resolve-fill.md) for the
|
|
216
|
+
full mental model, walk-throughs, and design rules.
|
|
217
|
+
- [Testing Guide](./docs/testing.md) for fixture builders
|
|
218
|
+
(`createFixtureMatchStore`, `createFixtureResolver`, …) used in unit
|
|
219
|
+
tests for wrappers around these primitives.
|
|
220
|
+
|
|
134
221
|
## Attach To An Existing Browser
|
|
135
222
|
|
|
136
223
|
If you already have a browser that exposes a CDP WebSocket URL, use
|
|
@@ -179,6 +266,9 @@ performing a fresh provider-level root attach on every healthy command.
|
|
|
179
266
|
| `attach(cdpUrl, options?)` | You already have a running browser that exposes CDP | `session`, current `url`, current `title` |
|
|
180
267
|
| `observe(session, goal?)` | You want to understand the page | targets, scopes, signals, fillable forms |
|
|
181
268
|
| `act(session, targetRef, action, value?)` | You want to click, type, select, fill, or press | action result and target metadata |
|
|
269
|
+
| `match(subject, { from })` | You want to pick a deterministic candidate for an observed target or fillable form | match result (plan or ready ref; no raw value) |
|
|
270
|
+
| `resolve(plan, { with })` | You want to turn one or many `needs_resolution` plans into ready refs through a caller-supplied adapter | match result(s) marked as `ready` |
|
|
271
|
+
| `fill(session, subject, plan, { resolver? })` | You want to apply a match result to the browser through the deterministic path | browser action result or structured failure |
|
|
182
272
|
| `navigate(session, url)` | You want to move to another page | page metadata after navigation |
|
|
183
273
|
| `extract(session, schema, scopeRef?)` | You want structured JSON from the page | `data` that matches your schema |
|
|
184
274
|
| `screenshot(session, path?)` | You want a screenshot artifact | saved path and page metadata |
|
|
@@ -188,8 +278,10 @@ performing a fresh provider-level root attach on every healthy command.
|
|
|
188
278
|
Two common questions:
|
|
189
279
|
|
|
190
280
|
- `observe(session)` gives you a general inventory of the page.
|
|
191
|
-
- `observe(session, goal)` focuses that inventory around a
|
|
192
|
-
`"find
|
|
281
|
+
- `observe(session, goal)` focuses that inventory around a single control
|
|
282
|
+
to find. Goals shaped as `"find <target> in <surface>"` (`"find the
|
|
283
|
+
email field"`, `"find May 5 in the open calendar"`) give the strongest
|
|
284
|
+
match. For multi-step work, run one goal per `observe` call.
|
|
193
285
|
|
|
194
286
|
All main APIs return the same broad result shape:
|
|
195
287
|
|
|
@@ -330,6 +422,7 @@ See:
|
|
|
330
422
|
|
|
331
423
|
- [Getting Started](./docs/getting-started.md)
|
|
332
424
|
- [API Reference](./docs/api-reference.md)
|
|
425
|
+
- [Match / Resolve / Fill Guide](./docs/match-resolve-fill.md)
|
|
333
426
|
- [Configuration Guide](./docs/configuration.md)
|
|
334
427
|
- [Assistive Runtime Guide](./docs/assistive-runtime.md)
|
|
335
428
|
- [Protected Fill Guide](./docs/protected-fill.md)
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { BrowseRuntimeState } from './runtime-state.js';
|
|
2
2
|
import type { ProxyConfig } from './solver/types.js';
|
|
3
|
-
/** Browser capabilities discovered or provisioned for the session. */
|
|
4
|
-
export interface BrowserSessionCapabilities {
|
|
5
|
-
captchaSolve?: boolean;
|
|
6
|
-
}
|
|
7
3
|
export declare const STICKY_OWNER_SCHEMA_VERSION: 1;
|
|
8
4
|
export type StickyOwnerState = 'bootstrapping' | 'active' | 'recovering' | 'dead';
|
|
9
5
|
export interface StickyOwnerPlaywrightBindTransport {
|
|
@@ -36,7 +32,6 @@ export interface BrowserSessionState {
|
|
|
36
32
|
profile?: string;
|
|
37
33
|
identity?: BrowseSessionIdentity;
|
|
38
34
|
transport?: BrowseSessionTransport;
|
|
39
|
-
capabilities?: BrowserSessionCapabilities;
|
|
40
35
|
runtime?: BrowseRuntimeState;
|
|
41
36
|
stickyOwner?: StickyOwnerMetadata;
|
|
42
37
|
}
|
|
@@ -68,12 +63,10 @@ export interface BrowserSessionStore {
|
|
|
68
63
|
load(): BrowserSessionState | null;
|
|
69
64
|
delete(): void;
|
|
70
65
|
}
|
|
71
|
-
type ManagedBrowserSessionInput = Omit<BrowserSessionState, 'port' | 'identity' | 'pid'
|
|
66
|
+
type ManagedBrowserSessionInput = Omit<BrowserSessionState, 'port' | 'identity' | 'pid'> & {
|
|
72
67
|
pid: number;
|
|
73
|
-
capabilities?: BrowserSessionCapabilities;
|
|
74
68
|
};
|
|
75
|
-
type AttachedBrowserSessionInput = Omit<BrowserSessionState, 'port' | 'identity' | 'pid' | 'profile'
|
|
76
|
-
capabilities?: BrowserSessionCapabilities;
|
|
69
|
+
type AttachedBrowserSessionInput = Omit<BrowserSessionState, 'port' | 'identity' | 'pid' | 'profile'> & {
|
|
77
70
|
browserInstanceRef?: string;
|
|
78
71
|
provider?: string;
|
|
79
72
|
};
|
|
@@ -118,8 +111,6 @@ export declare function buildOwnedSession(session: ManagedBrowserSessionInput):
|
|
|
118
111
|
export declare function buildAttachedSession(session: AttachedBrowserSessionInput): BrowserSessionState;
|
|
119
112
|
/** Returns the most likely DevTools port for the current session. */
|
|
120
113
|
export declare function getSessionPort(session: BrowserSessionState | null): number;
|
|
121
|
-
/** Returns `true` when the session advertises captcha-solving capability. */
|
|
122
|
-
export declare function supportsCaptchaSolve(session: BrowserSessionState | null): boolean;
|
|
123
114
|
/** Returns `true` when the session belongs to an AgentBrowse-managed browser. */
|
|
124
115
|
export declare function isOwnedSession(session: BrowserSessionState | null | undefined): session is BrowserSessionState & {
|
|
125
116
|
identity: BrowseSessionIdentity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-session-state.d.ts","sourceRoot":"","sources":["../src/browser-session-state.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,
|
|
1
|
+
{"version":3,"file":"browser-session-state.d.ts","sourceRoot":"","sources":["../src/browser-session-state.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,2BAA2B,EAAG,CAAU,CAAC;AAEtD,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC;AAElF,MAAM,WAAW,kCAAkC;IACjD,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,EAA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mBAAmB,CAM9F;AAED,qEAAqE;AACrE,wBAAgB,cAAc,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,GAAG,MAAM,CAW1E;AAED,iFAAiF;AACjF,wBAAgB,cAAc,CAC5B,OAAO,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS,GAC9C,OAAO,IAAI,mBAAmB,GAAG;IAAE,QAAQ,EAAE,qBAAqB,CAAA;CAAE,CAkBtE;AAED,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS,GAC9C,OAAO,IAAI,mBAAmB,GAAG;IAAE,QAAQ,EAAE,qBAAqB,CAAA;CAAE,CAWtE;AAED,4FAA4F;AAC5F,wBAAsB,cAAc,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,CAmBnF"}
|
|
@@ -283,10 +283,6 @@ export function getSessionPort(session) {
|
|
|
283
283
|
}
|
|
284
284
|
return 9222;
|
|
285
285
|
}
|
|
286
|
-
/** Returns `true` when the session advertises captcha-solving capability. */
|
|
287
|
-
export function supportsCaptchaSolve(session) {
|
|
288
|
-
return session?.capabilities?.captchaSolve === true;
|
|
289
|
-
}
|
|
290
286
|
/** Returns `true` when the session belongs to an AgentBrowse-managed browser. */
|
|
291
287
|
export function isOwnedSession(session) {
|
|
292
288
|
if (!session?.identity) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"act.d.ts","sourceRoot":"","sources":["../../src/commands/act.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAgBzE,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EAClB,MAAM,cAAc,CAAC;AA6BtB,OAAO,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAwCxF,2DAA2D;AAC3D,eAAO,MAA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M,yBAAyB,GAAG,YAAY,GAAG;IACrD,OAAO,EAAE,KAAK,CAAC;IACf,cAAc,EAAE,QAAQ,CAAC;IACzB,KAAK,EAAE,YAAY,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC,cAAc,EAAE,eAAe,GAAG,SAAS,CAAC,CAAC;IAClE,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,yBAAyB,GAAG,yBAAyB,CAAC;AAErF,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAmK5D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC;AAC1C,YAAY,EAAE,YAAY,EAAE,CAAC;AA+Q7B,wBAAsB,UAAU,CAC9B,OAAO,EAAE,qBAAqB,EAC9B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,EACpB,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,SAAS,CAAC,CA24BpB;AAED,wBAAsB,GAAG,CACvB,OAAO,EAAE,qBAAqB,EAC9B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,EACpB,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAaf"}
|
package/dist/commands/act.js
CHANGED
|
@@ -580,8 +580,11 @@ export async function actBrowser(session, targetRef, action, value) {
|
|
|
580
580
|
}
|
|
581
581
|
return false;
|
|
582
582
|
};
|
|
583
|
-
const assertResolvedTargetStillValid = async (resolvedLocator, stage) => {
|
|
584
|
-
|
|
583
|
+
const assertResolvedTargetStillValid = async (resolvedLocator, stage, options) => {
|
|
584
|
+
const bindingTarget = options?.skipDomSignature
|
|
585
|
+
? { pageSignature: liveTarget.pageSignature, domSignature: undefined }
|
|
586
|
+
: liveTarget;
|
|
587
|
+
await assertStoredBindingStillValid(page, resolvedLocator, bindingTarget, stage, {
|
|
585
588
|
onReason: async (reason, staleStage) => {
|
|
586
589
|
switch (reason) {
|
|
587
590
|
case 'page_signature_mismatch':
|
|
@@ -704,7 +707,9 @@ export async function actBrowser(session, targetRef, action, value) {
|
|
|
704
707
|
clickActivationStrategy: clickActivationStrategyForTarget(target, action),
|
|
705
708
|
guards: {
|
|
706
709
|
assertStillValid: async (stage) => {
|
|
707
|
-
await assertResolvedTargetStillValid(resolvedLocator, stage
|
|
710
|
+
await assertResolvedTargetStillValid(resolvedLocator, stage, {
|
|
711
|
+
skipDomSignature: options?.skipDomSignature,
|
|
712
|
+
});
|
|
708
713
|
},
|
|
709
714
|
},
|
|
710
715
|
});
|
|
@@ -732,7 +737,9 @@ export async function actBrowser(session, targetRef, action, value) {
|
|
|
732
737
|
throw lastError;
|
|
733
738
|
}
|
|
734
739
|
try {
|
|
735
|
-
await assertResolvedTargetStillValid(resolvedLocator, `after-error:${strategy}
|
|
740
|
+
await assertResolvedTargetStillValid(resolvedLocator, `after-error:${strategy}`, {
|
|
741
|
+
skipDomSignature: options?.skipDomSignature,
|
|
742
|
+
});
|
|
736
743
|
}
|
|
737
744
|
catch (validationError) {
|
|
738
745
|
if ((acceptanceProbe?.policy === 'navigation' ||
|
|
@@ -767,7 +774,9 @@ export async function actBrowser(session, targetRef, action, value) {
|
|
|
767
774
|
target.controlFamily === 'datepicker'),
|
|
768
775
|
isUserActionable: isLocatorUserActionable,
|
|
769
776
|
},
|
|
770
|
-
onPreparedLocator: async (resolvedLocator, strategy) => attemptResolvedLocator(resolvedLocator, strategy
|
|
777
|
+
onPreparedLocator: async (resolvedLocator, strategy) => attemptResolvedLocator(resolvedLocator, strategy.strategy, {
|
|
778
|
+
skipDomSignature: strategy.activationOwner === true,
|
|
779
|
+
}),
|
|
771
780
|
});
|
|
772
781
|
if (resolution.sawDisabledTarget) {
|
|
773
782
|
sawDisabledTarget = true;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* attach <cdp-url> — Attach AgentBrowse to an existing browser session.
|
|
3
3
|
*/
|
|
4
|
-
import { type BrowserSessionState
|
|
4
|
+
import { type BrowserSessionState } from '../browser-session-state.js';
|
|
5
5
|
import type { BrowseSessionTransport } from '../browser-session-state.js';
|
|
6
6
|
/** Stable top-level error codes returned by `attach(...)`. */
|
|
7
7
|
export declare const ATTACH_ERROR_CODES: readonly ["browser_attach_failed"];
|
|
@@ -13,7 +13,6 @@ export type AttachOutcomeType = (typeof ATTACH_OUTCOME_TYPES)[number];
|
|
|
13
13
|
export type AttachOptions = {
|
|
14
14
|
launchedAt?: string;
|
|
15
15
|
provider?: string;
|
|
16
|
-
capabilities?: BrowserSessionCapabilities;
|
|
17
16
|
transport?: BrowseSessionTransport;
|
|
18
17
|
};
|
|
19
18
|
/** Successful attach result for an existing CDP browser session. */
|
|
@@ -25,7 +24,6 @@ export type AttachSuccessResult = {
|
|
|
25
24
|
url: string;
|
|
26
25
|
title: string;
|
|
27
26
|
provider?: string;
|
|
28
|
-
captchaSolveCapable: boolean;
|
|
29
27
|
};
|
|
30
28
|
/** Failed attach result with a stable top-level error code. */
|
|
31
29
|
export type AttachFailureResult = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attach.d.ts","sourceRoot":"","sources":["../../src/commands/attach.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGL,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"attach.d.ts","sourceRoot":"","sources":["../../src/commands/attach.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAG1E,8DAA8D;AAC9D,eAAO,MAAM,kBAAkB,oCAAqC,CAAC;AAErE,0DAA0D;AAC1D,eAAO,MAAM,oBAAoB,sBAAuB,CAAC;AAEzD,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAClE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,kEAAkE;AAClE,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,sBAAsB,CAAC;CACpC,CAAC;AAEF,oEAAoE;AACpE,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,+DAA+D;AAC/D,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,eAAe,CAAC;IACvB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,OAAO,EAAE,wBAAwB,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,mBAAmB,CAAC;AAErE,wFAAwF;AACxF,wBAAsB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,YAAY,CAAC,CAoC/F"}
|
package/dist/commands/attach.js
CHANGED
|
@@ -16,7 +16,6 @@ export async function attach(cdpUrl, options = {}) {
|
|
|
16
16
|
cdpUrl: normalizedCdpUrl,
|
|
17
17
|
launchedAt: options.launchedAt ?? new Date().toISOString(),
|
|
18
18
|
...(options.provider ? { provider: options.provider } : {}),
|
|
19
|
-
...(options.capabilities ? { capabilities: options.capabilities } : {}),
|
|
20
19
|
...(options.transport ? { transport: options.transport } : {}),
|
|
21
20
|
});
|
|
22
21
|
await initializeBrowserSessionOwner(session);
|
|
@@ -32,7 +31,6 @@ export async function attach(cdpUrl, options = {}) {
|
|
|
32
31
|
url: syncedPage.url,
|
|
33
32
|
title: syncedPage.title,
|
|
34
33
|
...(options.provider ? { provider: options.provider } : {}),
|
|
35
|
-
captchaSolveCapable: options.capabilities?.captchaSolve === true,
|
|
36
34
|
};
|
|
37
35
|
}
|
|
38
36
|
catch (error) {
|
|
@@ -29,13 +29,11 @@ export type BrowserStatusProtectedExposureResult = {
|
|
|
29
29
|
exposureReason: string;
|
|
30
30
|
message: string;
|
|
31
31
|
reason: string;
|
|
32
|
-
captchaSolveCapable?: boolean;
|
|
33
32
|
};
|
|
34
33
|
/** Success result when the browser is alive and a current page could be resolved or approximated. */
|
|
35
34
|
export type BrowserStatusAliveResult = {
|
|
36
35
|
success: true;
|
|
37
36
|
alive: true;
|
|
38
|
-
captchaSolveCapable?: boolean;
|
|
39
37
|
pageRef?: string;
|
|
40
38
|
url?: string;
|
|
41
39
|
title?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-status.d.ts","sourceRoot":"","sources":["../../src/commands/browser-status.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"browser-status.d.ts","sourceRoot":"","sources":["../../src/commands/browser-status.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,6BAA6B,CAAC;AAiBrC,KAAK,mBAAmB,GAAG;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,QAAQ,GAAG,gBAAgB,CAAC;CAC5C,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,4BAA4B,gFAI/B,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AACrF,MAAM,MAAM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M,mBAAmB,GAC3B,oCAAoC,GACpC,wBAAwB,GACxB,6BAA6B,CAAC;AA+KlC,qFAAqF;AACrF,wBAAsB,aAAa,CACjC,OAAO,EAAE,mBAAmB,GAAG,IAAI,GAClC,OAAO,CAAC,mBAAmB,CAAC,CA6F9B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* browse browser-status — Check live browser/page/runtime state.
|
|
3
3
|
*/
|
|
4
|
-
import { buildCdpHttpEndpointUrl, getSessionPort,
|
|
4
|
+
import { buildCdpHttpEndpointUrl, getSessionPort, } from '../browser-session-state.js';
|
|
5
5
|
import { resolveCurrentPageContext } from '../playwright-runtime.js';
|
|
6
6
|
import { captureDiagnosticSnapshotBestEffort, finishDiagnosticStepBestEffort, recordCommandLifecycleEventBestEffort, startDiagnosticStep, } from '../diagnostics.js';
|
|
7
7
|
import { scrubProtectedExactValues } from '../secrets/protected-exact-value-redaction.js';
|
|
@@ -39,9 +39,6 @@ function buildProtectedStatusPayload(params) {
|
|
|
39
39
|
success: true,
|
|
40
40
|
alive: true,
|
|
41
41
|
outcomeType: 'protected_exposure_active',
|
|
42
|
-
...(params.captchaSolveCapable !== undefined
|
|
43
|
-
? { captchaSolveCapable: params.captchaSolveCapable }
|
|
44
|
-
: {}),
|
|
45
42
|
runtime: params.runtimeSummary,
|
|
46
43
|
...(params.currentPageMismatch ? { currentPageMismatch: params.currentPageMismatch } : {}),
|
|
47
44
|
protectedExposureActive: true,
|
|
@@ -175,7 +172,6 @@ export async function browserStatus(session) {
|
|
|
175
172
|
pageRef: canonical.pageRef,
|
|
176
173
|
pageUrl: canonical.url,
|
|
177
174
|
pageTitle: canonical.title,
|
|
178
|
-
captchaSolveCapable: supportsCaptchaSolve(session),
|
|
179
175
|
currentPageMismatch: canonical.currentPageMismatch,
|
|
180
176
|
protectedExposure,
|
|
181
177
|
});
|
|
@@ -186,7 +182,6 @@ export async function browserStatus(session) {
|
|
|
186
182
|
const result = {
|
|
187
183
|
success: true,
|
|
188
184
|
alive: true,
|
|
189
|
-
captchaSolveCapable: supportsCaptchaSolve(session),
|
|
190
185
|
pageRef: canonical.pageRef,
|
|
191
186
|
url: canonical.url,
|
|
192
187
|
title: canonical.title,
|
|
@@ -215,7 +210,6 @@ export async function browserStatus(session) {
|
|
|
215
210
|
const result = {
|
|
216
211
|
success: true,
|
|
217
212
|
alive: true,
|
|
218
|
-
...(session ? { captchaSolveCapable: supportsCaptchaSolve(session) } : {}),
|
|
219
213
|
url: page.url ?? 'unknown',
|
|
220
214
|
title: page.title ?? 'unknown',
|
|
221
215
|
...(session?.runtime ? { currentPageUnresolved: true } : {}),
|
|
@@ -41,6 +41,6 @@ export declare function resolvePreparedLocatorCandidates(params: {
|
|
|
41
41
|
allowDescendantPressFallback?: boolean;
|
|
42
42
|
isUserActionable?: (locator: Locator) => Promise<boolean>;
|
|
43
43
|
};
|
|
44
|
-
onPreparedLocator: (locator: Locator,
|
|
44
|
+
onPreparedLocator: (locator: Locator, candidate: LocatorCandidate) => Promise<boolean>;
|
|
45
45
|
}): Promise<PreparedLocatorCandidateResolution>;
|
|
46
46
|
//# sourceMappingURL=interaction-kernel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction-kernel.d.ts","sourceRoot":"","sources":["../../src/commands/interaction-kernel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGjG,OAAO,EAAoC,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAI3F,MAAM,MAAM,2BAA2B,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzF,MAAM,MAAM,wBAAwB,GAChC,yBAAyB,GACzB,wBAAwB,GACxB,2BAA2B,CAAC;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AAE;QACf,qBAAqB,CAAC,EAAE,OAAO,CAAC;QAChC,4BAA4B,CAAC,EAAE,OAAO,CAAC;QACvC,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;KAC3D,CAAC;IACF,iBAAiB,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACxF,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAqD9C"}
|
|
@@ -198,7 +198,7 @@ export async function resolvePreparedLocatorCandidates(params) {
|
|
|
198
198
|
if (!preparedLocator.locator) {
|
|
199
199
|
continue;
|
|
200
200
|
}
|
|
201
|
-
const resolved = await params.onPreparedLocator(preparedLocator.locator, candidate
|
|
201
|
+
const resolved = await params.onPreparedLocator(preparedLocator.locator, candidate);
|
|
202
202
|
if (resolved) {
|
|
203
203
|
return {
|
|
204
204
|
resolved: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../../src/commands/launch.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAqB,KAAK,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAW1F,8DAA8D;AAC9D,eAAO,MAAM,kBAAkB,oCAAqC,CAAC;AAErE,0DAA0D;AAC1D,eAAO,MAAM,oBAAoB,sBAAuB,CAAC;AAEzD,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAClE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,+DAA+D;AAC/D,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK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IAClC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,mBAAmB,CAAC;AAErE,4EAA4E;AAC5E,wBAAsB,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAOtF"}
|
package/dist/commands/launch.js
CHANGED
|
@@ -68,9 +68,6 @@ async function launchManaged(url, profileName, headless, useProxy = false, proxy
|
|
|
68
68
|
: {
|
|
69
69
|
proxyMode: 'direct',
|
|
70
70
|
},
|
|
71
|
-
capabilities: {
|
|
72
|
-
captchaSolve: true,
|
|
73
|
-
},
|
|
74
71
|
});
|
|
75
72
|
try {
|
|
76
73
|
await initializeBrowserSessionOwner(persistedSession);
|
|
@@ -99,7 +96,6 @@ async function launchManaged(url, profileName, headless, useProxy = false, proxy
|
|
|
99
96
|
return {
|
|
100
97
|
success: true,
|
|
101
98
|
runtime: 'managed',
|
|
102
|
-
captchaSolveCapable: true,
|
|
103
99
|
profile: profileName,
|
|
104
100
|
session: persistedSession,
|
|
105
101
|
cdpUrl: session.cdpUrl,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observe-accessibility.d.ts","sourceRoot":"","sources":["../../src/commands/observe-accessibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAa5C,OAAO,KAAK,EAEV,iBAAiB,EAElB,MAAM,wBAAwB,CAAC;AAEhC,KAAK,6BAA6B,GAAG;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;CACpD,CAAC;AAOF,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,E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tC,CAAC"}
|
|
@@ -225,12 +225,46 @@ function patchDisplayLabel(displayLabel, previousLabel, nextLabel) {
|
|
|
225
225
|
? nextLabel + displayLabel.slice(previousLabel.length)
|
|
226
226
|
: displayLabel;
|
|
227
227
|
}
|
|
228
|
+
const ACTION_STYLE_PLACEHOLDER_RE = /^(?:select|choose|pick|enter|set|search|find|click|tap|open)\b/i;
|
|
228
229
|
function shouldUseCurrentValueDisplayLabel(target) {
|
|
229
|
-
|
|
230
|
+
if ((target.inputType ?? '').trim().toLowerCase() === 'password') {
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
if (target.controlFamily === 'select' && target.kind !== 'select') {
|
|
234
|
+
return true;
|
|
235
|
+
}
|
|
236
|
+
return target.controlFamily === 'text-input' || target.controlFamily === 'datepicker';
|
|
237
|
+
}
|
|
238
|
+
function contextualDisplayLabelBase(target, nextLabel) {
|
|
239
|
+
const baseLabel = nextLabel ?? target.label;
|
|
240
|
+
const normalizedBaseLabel = normalizeText(baseLabel);
|
|
241
|
+
const normalizedPlaceholder = normalizeText(target.placeholder);
|
|
242
|
+
const shouldUseContextLabel = (target.controlFamily === 'datepicker' || target.acceptancePolicy === 'date-selection') &&
|
|
243
|
+
normalizedBaseLabel.length > 0 &&
|
|
244
|
+
normalizedPlaceholder.length > 0 &&
|
|
245
|
+
normalizedBaseLabel === normalizedPlaceholder &&
|
|
246
|
+
ACTION_STYLE_PLACEHOLDER_RE.test(normalizedBaseLabel);
|
|
247
|
+
if (!shouldUseContextLabel) {
|
|
248
|
+
return baseLabel;
|
|
249
|
+
}
|
|
250
|
+
for (const node of [
|
|
251
|
+
target.context?.item,
|
|
252
|
+
target.context?.group,
|
|
253
|
+
target.context?.container,
|
|
254
|
+
target.context?.landmark,
|
|
255
|
+
]) {
|
|
256
|
+
const contextLabel = normalizeText(node?.label ?? node?.text);
|
|
257
|
+
if (!contextLabel || contextLabel === normalizedBaseLabel) {
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
return contextLabel;
|
|
261
|
+
}
|
|
262
|
+
return baseLabel;
|
|
230
263
|
}
|
|
231
264
|
function chooseDisplayLabel(target, nextLabel) {
|
|
232
265
|
if (shouldUseCurrentValueDisplayLabel(target)) {
|
|
233
|
-
const
|
|
266
|
+
const baseLabel = contextualDisplayLabelBase(target, nextLabel);
|
|
267
|
+
const currentValueDisplayLabel = buildObserveDisplayLabel(baseLabel, target.currentValue);
|
|
234
268
|
if (currentValueDisplayLabel) {
|
|
235
269
|
return currentValueDisplayLabel;
|
|
236
270
|
}
|