@mercuryo-ai/agentbrowse 0.2.50 → 0.2.52
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 +1 -1
- package/dist/browser-session-state.d.ts +8 -8
- package/dist/browser-session-state.d.ts.map +1 -1
- package/dist/browser-session-state.js +41 -47
- package/dist/commands/action-acceptance.d.ts.map +1 -1
- package/dist/commands/observe-projection.d.ts.map +1 -1
- package/dist/commands/observe.d.ts +8 -8
- package/dist/commands/observe.d.ts.map +1 -1
- package/dist/commands/observe.js +98 -114
- package/dist/commands/user-actionable.d.ts.map +1 -1
- package/dist/protected-fill.d.ts +12 -12
- package/dist/protected-fill.d.ts.map +1 -1
- package/dist/protected-fill.js +3 -3
- package/dist/runtime-state.d.ts +28 -28
- package/dist/runtime-state.d.ts.map +1 -1
- package/dist/runtime-state.js +50 -59
- package/dist/secrets/form-matcher.d.ts.map +1 -1
- package/dist/secrets/form-matcher.js +1 -3
- package/dist/secrets/protected-exact-value-redaction.d.ts.map +1 -1
- package/dist/secrets/protected-exact-value-redaction.js +3 -1
- package/package.json +4 -4
package/dist/runtime-state.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import type { BrowserSessionState } from
|
|
2
|
-
import type { PersistedFillableForm, SecretCatalogSnapshot } from
|
|
3
|
-
export type LocatorStrategy =
|
|
1
|
+
import type { BrowserSessionState } from './browser-session-state.js';
|
|
2
|
+
import type { PersistedFillableForm, SecretCatalogSnapshot } from './secrets/types.js';
|
|
3
|
+
export type LocatorStrategy = 'role' | 'label' | 'placeholder' | 'text' | 'title' | 'testId' | 'css' | 'xpath';
|
|
4
4
|
export interface LocatorCandidate {
|
|
5
5
|
strategy: LocatorStrategy;
|
|
6
6
|
value: string;
|
|
7
7
|
name?: string;
|
|
8
|
-
attribute?:
|
|
9
|
-
scope?:
|
|
8
|
+
attribute?: 'data-testid' | 'data-test-id';
|
|
9
|
+
scope?: 'root' | 'surface';
|
|
10
10
|
}
|
|
11
|
-
export declare function locatorCandidateKey(candidate: Pick<LocatorCandidate,
|
|
11
|
+
export declare function locatorCandidateKey(candidate: Pick<LocatorCandidate, 'strategy' | 'value' | 'name' | 'attribute' | 'scope'>): string;
|
|
12
12
|
export interface TargetSemantics {
|
|
13
13
|
role?: string;
|
|
14
14
|
name?: string;
|
|
15
15
|
states?: Record<string, string | boolean | number>;
|
|
16
|
-
source?:
|
|
17
|
-
}
|
|
18
|
-
export type TargetCapability =
|
|
19
|
-
export type TargetLifecycle =
|
|
20
|
-
export type TargetAvailability =
|
|
21
|
-
export type TargetAllowedAction =
|
|
22
|
-
export type TargetControlFamily =
|
|
23
|
-
export type TargetAcceptancePolicy =
|
|
16
|
+
source?: 'dom' | 'stagehand' | 'aria-snapshot' | 'cdp-ax';
|
|
17
|
+
}
|
|
18
|
+
export type TargetCapability = 'actionable' | 'scope' | 'informational';
|
|
19
|
+
export type TargetLifecycle = 'live' | 'stale' | 'invalidated';
|
|
20
|
+
export type TargetAvailability = 'available' | 'gated' | 'surface-inactive' | 'hidden';
|
|
21
|
+
export type TargetAllowedAction = 'click' | 'fill' | 'type' | 'select' | 'press';
|
|
22
|
+
export type TargetControlFamily = 'text-input' | 'select' | 'datepicker' | 'structured-grid' | 'trigger';
|
|
23
|
+
export type TargetAcceptancePolicy = 'value-change' | 'selection' | 'toggle' | 'disclosure' | 'date-selection' | 'submit' | 'navigation' | 'generic-click';
|
|
24
24
|
export interface TargetAvailabilityState {
|
|
25
25
|
state: TargetAvailability;
|
|
26
26
|
reason?: string;
|
|
@@ -32,13 +32,13 @@ export interface TargetContextNode {
|
|
|
32
32
|
selector?: string;
|
|
33
33
|
}
|
|
34
34
|
export interface TargetVisualContext {
|
|
35
|
-
emphasis?:
|
|
36
|
-
fill?:
|
|
35
|
+
emphasis?: 'muted' | 'normal' | 'strong';
|
|
36
|
+
fill?: 'none' | 'light' | 'mid' | 'dark';
|
|
37
37
|
outlined?: boolean;
|
|
38
38
|
}
|
|
39
39
|
export interface TargetStructure {
|
|
40
|
-
family?:
|
|
41
|
-
variant?:
|
|
40
|
+
family?: 'structured-grid';
|
|
41
|
+
variant?: 'date-cell' | 'seat-cell' | 'grid-cell';
|
|
42
42
|
row?: string;
|
|
43
43
|
column?: string;
|
|
44
44
|
zone?: string;
|
|
@@ -50,8 +50,8 @@ export interface TargetContext {
|
|
|
50
50
|
container?: TargetContextNode;
|
|
51
51
|
landmark?: TargetContextNode;
|
|
52
52
|
layout?: {
|
|
53
|
-
lane?:
|
|
54
|
-
band?:
|
|
53
|
+
lane?: 'left' | 'center' | 'right';
|
|
54
|
+
band?: 'top' | 'middle' | 'bottom';
|
|
55
55
|
};
|
|
56
56
|
hintText?: string;
|
|
57
57
|
visual?: TargetVisualContext;
|
|
@@ -96,7 +96,7 @@ export interface TargetDescriptor {
|
|
|
96
96
|
domSignature?: string;
|
|
97
97
|
lifecycleReason?: string;
|
|
98
98
|
}
|
|
99
|
-
type TargetDescriptorInput = Omit<TargetDescriptor,
|
|
99
|
+
type TargetDescriptorInput = Omit<TargetDescriptor, 'ref' | 'capability' | 'lifecycle' | 'availability' | 'allowedActions'> & {
|
|
100
100
|
ref?: string;
|
|
101
101
|
capability?: TargetCapability;
|
|
102
102
|
lifecycle?: TargetLifecycle;
|
|
@@ -113,7 +113,7 @@ export interface BrowsePageState {
|
|
|
113
113
|
openerPageRef?: string;
|
|
114
114
|
scopeEpoch: number;
|
|
115
115
|
}
|
|
116
|
-
export type ExtractScopeLifetime =
|
|
116
|
+
export type ExtractScopeLifetime = 'durable' | 'snapshot';
|
|
117
117
|
export interface SurfaceDescriptor {
|
|
118
118
|
ref: string;
|
|
119
119
|
surfaceId: string;
|
|
@@ -134,7 +134,7 @@ export interface SurfaceDescriptor {
|
|
|
134
134
|
extractScopeLifetime?: ExtractScopeLifetime;
|
|
135
135
|
scopeEpoch?: number;
|
|
136
136
|
}
|
|
137
|
-
type SurfaceDescriptorInput = Omit<SurfaceDescriptor,
|
|
137
|
+
type SurfaceDescriptorInput = Omit<SurfaceDescriptor, 'ref' | 'lifecycle' | 'availability'> & {
|
|
138
138
|
ref?: string;
|
|
139
139
|
lifecycle?: TargetLifecycle;
|
|
140
140
|
availability?: TargetAvailabilityState;
|
|
@@ -177,7 +177,7 @@ export interface BrowsePayloadBudgetMetrics {
|
|
|
177
177
|
protectedBindingsSeen: number;
|
|
178
178
|
protectedBindingsSent: number;
|
|
179
179
|
}
|
|
180
|
-
export type ProtectedExactValueMatcher =
|
|
180
|
+
export type ProtectedExactValueMatcher = 'text' | 'digits' | 'email' | 'expiry';
|
|
181
181
|
export interface ProtectedExactValueRule {
|
|
182
182
|
matcher: ProtectedExactValueMatcher;
|
|
183
183
|
digest: string;
|
|
@@ -194,7 +194,7 @@ export interface ProtectedExposureState {
|
|
|
194
194
|
requestId: string;
|
|
195
195
|
activatedAt: string;
|
|
196
196
|
exactValueProfile?: ProtectedExactValueProfile;
|
|
197
|
-
reason:
|
|
197
|
+
reason: 'protected_fill_success' | 'protected_fill_binding_stale' | 'protected_fill_validation_failed' | 'protected_fill_unexpected_error';
|
|
198
198
|
}
|
|
199
199
|
export interface BrowseRuntimeState {
|
|
200
200
|
version: 1;
|
|
@@ -216,7 +216,7 @@ export interface BrowseRuntimeState {
|
|
|
216
216
|
export declare function createPayloadBudgetMetrics(): BrowsePayloadBudgetMetrics;
|
|
217
217
|
export declare function createLlmUsageBucket(): BrowseLlmUsageBucket;
|
|
218
218
|
export declare function ensureMetricsExtensions(metrics: BrowseRuntimeMetrics): void;
|
|
219
|
-
export declare function createRuntimeState(initialPage?: Partial<Omit<BrowsePageState,
|
|
219
|
+
export declare function createRuntimeState(initialPage?: Partial<Omit<BrowsePageState, 'pageRef' | 'createdAt' | 'updatedAt'>> & {
|
|
220
220
|
pageRef?: string;
|
|
221
221
|
}): BrowseRuntimeState;
|
|
222
222
|
export declare function ensureRuntimeState(session: BrowserSessionState): BrowseRuntimeState;
|
|
@@ -237,11 +237,11 @@ export declare function getTarget(session: BrowserSessionState, targetRef: strin
|
|
|
237
237
|
export declare function getSurface(session: BrowserSessionState, surfaceRef: string): SurfaceDescriptor | null;
|
|
238
238
|
export declare function saveSecretCatalog(session: BrowserSessionState, snapshot: SecretCatalogSnapshot): SecretCatalogSnapshot;
|
|
239
239
|
export declare function getSecretCatalog(session: BrowserSessionState, host: string): SecretCatalogSnapshot | null;
|
|
240
|
-
export declare function updateSurface(session: BrowserSessionState, surfaceRef: string, patch: Partial<Omit<SurfaceDescriptor,
|
|
240
|
+
export declare function updateSurface(session: BrowserSessionState, surfaceRef: string, patch: Partial<Omit<SurfaceDescriptor, 'ref' | 'createdAt'>>): SurfaceDescriptor | null;
|
|
241
241
|
export declare function markSurfaceLifecycle(session: BrowserSessionState, surfaceRef: string, lifecycle: TargetLifecycle, reason?: string): SurfaceDescriptor | null;
|
|
242
242
|
export declare function setSurfaceAvailability(session: BrowserSessionState, surfaceRef: string, state: TargetAvailability, reason?: string): SurfaceDescriptor | null;
|
|
243
243
|
export declare function deleteTarget(session: BrowserSessionState, targetRef: string): void;
|
|
244
|
-
export declare function updateTarget(session: BrowserSessionState, targetRef: string, patch: Partial<Omit<TargetDescriptor,
|
|
244
|
+
export declare function updateTarget(session: BrowserSessionState, targetRef: string, patch: Partial<Omit<TargetDescriptor, 'ref' | 'createdAt'>>): TargetDescriptor | null;
|
|
245
245
|
export declare function markTargetLifecycle(session: BrowserSessionState, targetRef: string, lifecycle: TargetLifecycle, reason?: string): TargetDescriptor | null;
|
|
246
246
|
export declare function setTargetAvailability(session: BrowserSessionState, targetRef: string, state: TargetAvailability, reason?: string): TargetDescriptor | null;
|
|
247
247
|
export declare function listTargets(session: BrowserSessionState): TargetDescriptor[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-state.d.ts","sourceRoot":"","sources":["../src/runtime-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;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E5E;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,iBAAiB,EAAE,CAE9E;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAwBjF"}
|
package/dist/runtime-state.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { resolveCachedSecretCatalogForHost } from
|
|
2
|
-
import { inferAcceptancePolicyFromFacts, inferAllowedActionsFromFacts, inferAvailabilityFromFacts, inferControlFamilyFromFacts, } from
|
|
1
|
+
import { resolveCachedSecretCatalogForHost } from './secrets/catalog-applicability.js';
|
|
2
|
+
import { inferAcceptancePolicyFromFacts, inferAllowedActionsFromFacts, inferAvailabilityFromFacts, inferControlFamilyFromFacts, } from './control-semantics.js';
|
|
3
3
|
export function locatorCandidateKey(candidate) {
|
|
4
4
|
return [
|
|
5
5
|
candidate.strategy,
|
|
6
|
-
candidate.name ??
|
|
6
|
+
candidate.name ?? '',
|
|
7
7
|
candidate.value,
|
|
8
|
-
candidate.attribute ??
|
|
9
|
-
candidate.scope ??
|
|
10
|
-
].join(
|
|
8
|
+
candidate.attribute ?? '',
|
|
9
|
+
candidate.scope ?? '',
|
|
10
|
+
].join(':');
|
|
11
11
|
}
|
|
12
12
|
function inferLegacyActionMethod(descriptor) {
|
|
13
|
-
const kind = (descriptor.kind ??
|
|
14
|
-
if ([
|
|
13
|
+
const kind = (descriptor.kind ?? '').toLowerCase();
|
|
14
|
+
if (['click', 'fill', 'type', 'select', 'press'].includes(kind)) {
|
|
15
15
|
return kind;
|
|
16
16
|
}
|
|
17
17
|
const stagehandAction = descriptor.stagehandAction;
|
|
18
18
|
if (stagehandAction &&
|
|
19
|
-
typeof stagehandAction ===
|
|
19
|
+
typeof stagehandAction === 'object' &&
|
|
20
20
|
!Array.isArray(stagehandAction) &&
|
|
21
|
-
typeof stagehandAction.method ===
|
|
22
|
-
return (stagehandAction.method ??
|
|
21
|
+
typeof stagehandAction.method === 'string') {
|
|
22
|
+
return (stagehandAction.method ?? '').toLowerCase();
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return '';
|
|
25
25
|
}
|
|
26
26
|
function inferAllowedActions(descriptor) {
|
|
27
27
|
const legacyMethod = inferLegacyActionMethod(descriptor);
|
|
@@ -86,13 +86,12 @@ function inferAvailability(descriptor) {
|
|
|
86
86
|
? [...descriptor.allowedActions]
|
|
87
87
|
: inferAllowedActions(descriptor);
|
|
88
88
|
const controlFamily = descriptor.controlFamily ?? inferControlFamily(descriptor, allowedActions);
|
|
89
|
-
const acceptancePolicy = descriptor.acceptancePolicy ??
|
|
90
|
-
inferAcceptancePolicy(descriptor, allowedActions);
|
|
89
|
+
const acceptancePolicy = descriptor.acceptancePolicy ?? inferAcceptancePolicy(descriptor, allowedActions);
|
|
91
90
|
return inferAvailabilityFromFacts(descriptor.semantics?.states, descriptor.context?.hintText, {
|
|
92
|
-
readonlyInteractive: controlFamily ===
|
|
93
|
-
controlFamily ===
|
|
94
|
-
acceptancePolicy ===
|
|
95
|
-
acceptancePolicy ===
|
|
91
|
+
readonlyInteractive: controlFamily === 'select' ||
|
|
92
|
+
controlFamily === 'datepicker' ||
|
|
93
|
+
acceptancePolicy === 'selection' ||
|
|
94
|
+
acceptancePolicy === 'date-selection',
|
|
96
95
|
});
|
|
97
96
|
}
|
|
98
97
|
function normalizeTargetDescriptor(descriptor, ref) {
|
|
@@ -102,37 +101,33 @@ function normalizeTargetDescriptor(descriptor, ref) {
|
|
|
102
101
|
return {
|
|
103
102
|
...descriptor,
|
|
104
103
|
ref,
|
|
105
|
-
capability: descriptor.capability ??
|
|
106
|
-
lifecycle: descriptor.lifecycle ??
|
|
104
|
+
capability: descriptor.capability ?? 'actionable',
|
|
105
|
+
lifecycle: descriptor.lifecycle ?? 'live',
|
|
107
106
|
availability: inferAvailability(descriptor),
|
|
108
107
|
allowedActions,
|
|
109
|
-
controlFamily: descriptor.controlFamily ??
|
|
110
|
-
|
|
111
|
-
acceptancePolicy: descriptor.acceptancePolicy ??
|
|
112
|
-
inferAcceptancePolicy(descriptor, allowedActions),
|
|
108
|
+
controlFamily: descriptor.controlFamily ?? inferControlFamily(descriptor, allowedActions),
|
|
109
|
+
acceptancePolicy: descriptor.acceptancePolicy ?? inferAcceptancePolicy(descriptor, allowedActions),
|
|
113
110
|
};
|
|
114
111
|
}
|
|
115
112
|
function targetIdentity(descriptor, options = {}) {
|
|
116
|
-
const frameKey = descriptor.framePath?.join(
|
|
117
|
-
(descriptor.frameUrl?.trim() ? `url:${descriptor.frameUrl.trim()}` :
|
|
113
|
+
const frameKey = descriptor.framePath?.join('>') ??
|
|
114
|
+
(descriptor.frameUrl?.trim() ? `url:${descriptor.frameUrl.trim()}` : 'top');
|
|
118
115
|
const pageKey = descriptor.pageSignature ?? descriptor.pageRef;
|
|
119
|
-
const familyKey = descriptor.controlFamily ??
|
|
120
|
-
const surfaceKey = options.ignoreSurfaceRef
|
|
121
|
-
? ""
|
|
122
|
-
: (descriptor.surfaceRef ?? "");
|
|
116
|
+
const familyKey = descriptor.controlFamily ?? '';
|
|
117
|
+
const surfaceKey = options.ignoreSurfaceRef ? '' : (descriptor.surfaceRef ?? '');
|
|
123
118
|
const structureKey = descriptor.structure
|
|
124
119
|
? [
|
|
125
|
-
descriptor.structure.family ??
|
|
126
|
-
descriptor.structure.variant ??
|
|
127
|
-
descriptor.structure.row ??
|
|
128
|
-
descriptor.structure.column ??
|
|
129
|
-
descriptor.structure.zone ??
|
|
130
|
-
descriptor.structure.cellLabel ??
|
|
131
|
-
].join(
|
|
132
|
-
:
|
|
120
|
+
descriptor.structure.family ?? '',
|
|
121
|
+
descriptor.structure.variant ?? '',
|
|
122
|
+
descriptor.structure.row ?? '',
|
|
123
|
+
descriptor.structure.column ?? '',
|
|
124
|
+
descriptor.structure.zone ?? '',
|
|
125
|
+
descriptor.structure.cellLabel ?? '',
|
|
126
|
+
].join(':')
|
|
127
|
+
: '';
|
|
133
128
|
const locatorKey = descriptor.locatorCandidates
|
|
134
129
|
.map((candidate) => locatorCandidateKey(candidate))
|
|
135
|
-
.join(
|
|
130
|
+
.join('|');
|
|
136
131
|
const domKey = descriptor.domSignature?.trim();
|
|
137
132
|
if (domKey && locatorKey) {
|
|
138
133
|
return `${pageKey}|${frameKey}|family|${familyKey}|surface|${surfaceKey}|structure|${structureKey}|dom|${domKey}|locator|${locatorKey}`;
|
|
@@ -143,7 +138,7 @@ function targetIdentity(descriptor, options = {}) {
|
|
|
143
138
|
if (locatorKey) {
|
|
144
139
|
return `${pageKey}|${frameKey}|family|${familyKey}|surface|${surfaceKey}|structure|${structureKey}|locator|${locatorKey}`;
|
|
145
140
|
}
|
|
146
|
-
return `${pageKey}|${frameKey}|family|${familyKey}|surface|${surfaceKey}|structure|${structureKey}|fallback|${descriptor.kind ??
|
|
141
|
+
return `${pageKey}|${frameKey}|family|${familyKey}|surface|${surfaceKey}|structure|${structureKey}|fallback|${descriptor.kind ?? ''}|${descriptor.label ?? ''}`;
|
|
147
142
|
}
|
|
148
143
|
export function createPayloadBudgetMetrics() {
|
|
149
144
|
return {
|
|
@@ -177,19 +172,15 @@ export function ensureMetricsExtensions(metrics) {
|
|
|
177
172
|
metrics.payloadBudget ??= createPayloadBudgetMetrics();
|
|
178
173
|
}
|
|
179
174
|
function inferSurfaceAvailability(descriptor) {
|
|
180
|
-
return descriptor.availability?.state
|
|
181
|
-
? descriptor.availability
|
|
182
|
-
: { state: "available" };
|
|
175
|
+
return descriptor.availability?.state ? descriptor.availability : { state: 'available' };
|
|
183
176
|
}
|
|
184
177
|
function normalizeSurfaceDescriptor(descriptor, ref) {
|
|
185
178
|
return {
|
|
186
179
|
...descriptor,
|
|
187
180
|
ref,
|
|
188
|
-
childSurfaceRefs: descriptor.childSurfaceRefs
|
|
189
|
-
? [...descriptor.childSurfaceRefs]
|
|
190
|
-
: [],
|
|
181
|
+
childSurfaceRefs: descriptor.childSurfaceRefs ? [...descriptor.childSurfaceRefs] : [],
|
|
191
182
|
targetRefs: descriptor.targetRefs ? [...descriptor.targetRefs] : [],
|
|
192
|
-
lifecycle: descriptor.lifecycle ??
|
|
183
|
+
lifecycle: descriptor.lifecycle ?? 'live',
|
|
193
184
|
availability: inferSurfaceAvailability(descriptor),
|
|
194
185
|
};
|
|
195
186
|
}
|
|
@@ -197,16 +188,16 @@ function surfaceIdentity(descriptor) {
|
|
|
197
188
|
if (descriptor.surfaceId) {
|
|
198
189
|
return descriptor.surfaceId;
|
|
199
190
|
}
|
|
200
|
-
const frameKey = descriptor.framePath?.join(
|
|
201
|
-
(descriptor.frameUrl?.trim() ? `url:${descriptor.frameUrl.trim()}` :
|
|
191
|
+
const frameKey = descriptor.framePath?.join('>') ??
|
|
192
|
+
(descriptor.frameUrl?.trim() ? `url:${descriptor.frameUrl.trim()}` : 'top');
|
|
202
193
|
const pageKey = descriptor.pageSignature ?? descriptor.pageRef;
|
|
203
194
|
const locatorKey = descriptor.locatorCandidates
|
|
204
195
|
.map((candidate) => locatorCandidateKey(candidate))
|
|
205
|
-
.join(
|
|
196
|
+
.join('|');
|
|
206
197
|
if (locatorKey) {
|
|
207
198
|
return `${pageKey}|${frameKey}|surface-locator|${locatorKey}`;
|
|
208
199
|
}
|
|
209
|
-
return `${pageKey}|${frameKey}|surface-fallback|${descriptor.kind ??
|
|
200
|
+
return `${pageKey}|${frameKey}|surface-fallback|${descriptor.kind ?? ''}|${descriptor.label ?? ''}`;
|
|
210
201
|
}
|
|
211
202
|
function syncTargetCounter(runtime, ref) {
|
|
212
203
|
const match = /^t(\d+)$/.exec(ref);
|
|
@@ -236,7 +227,7 @@ function syncSurfaceCounter(runtime, ref) {
|
|
|
236
227
|
}
|
|
237
228
|
}
|
|
238
229
|
export function createRuntimeState(initialPage = {}) {
|
|
239
|
-
const pageRef = initialPage.pageRef ??
|
|
230
|
+
const pageRef = initialPage.pageRef ?? 'p0';
|
|
240
231
|
const now = new Date().toISOString();
|
|
241
232
|
return {
|
|
242
233
|
version: 1,
|
|
@@ -258,7 +249,7 @@ export function createRuntimeState(initialPage = {}) {
|
|
|
258
249
|
fillableForms: {},
|
|
259
250
|
protectedExposureByPage: {},
|
|
260
251
|
counters: {
|
|
261
|
-
nextPage: pageRef ===
|
|
252
|
+
nextPage: pageRef === 'p0' ? 1 : 0,
|
|
262
253
|
nextSurface: 1,
|
|
263
254
|
nextTarget: 1,
|
|
264
255
|
nextFill: 1,
|
|
@@ -366,7 +357,7 @@ export function replaceSurfacesForPage(session, pageRef, descriptors, options =
|
|
|
366
357
|
const normalizedDescriptor = normalizeSurfaceDescriptor({
|
|
367
358
|
...descriptor,
|
|
368
359
|
pageRef,
|
|
369
|
-
}, descriptor.ref ??
|
|
360
|
+
}, descriptor.ref ?? '__identity__');
|
|
370
361
|
const identity = surfaceIdentity(normalizedDescriptor);
|
|
371
362
|
const matchedRef = reusableRefs.get(identity)?.shift();
|
|
372
363
|
const ref = descriptor.ref ?? matchedRef ?? createSurfaceRef(session);
|
|
@@ -416,14 +407,14 @@ export function replaceTargetsForPage(session, pageRef, descriptors, options = {
|
|
|
416
407
|
}
|
|
417
408
|
function workflowContextKey(context) {
|
|
418
409
|
if (!context) {
|
|
419
|
-
return
|
|
410
|
+
return '';
|
|
420
411
|
}
|
|
421
|
-
return [
|
|
412
|
+
return ['item', 'group', 'container']
|
|
422
413
|
.map((key) => {
|
|
423
414
|
const node = context[key];
|
|
424
|
-
return node ? `${node.kind ??
|
|
415
|
+
return node ? `${node.kind ?? ''}:${node.label ?? ''}` : '';
|
|
425
416
|
})
|
|
426
|
-
.join(
|
|
417
|
+
.join('|');
|
|
427
418
|
}
|
|
428
419
|
function workflowContextBoundaryChanged(current, next) {
|
|
429
420
|
const currentContextKey = workflowContextKey(current.context);
|
|
@@ -467,7 +458,7 @@ export function replaceTargetsForPage(session, pageRef, descriptors, options = {
|
|
|
467
458
|
const normalizedDescriptor = normalizeTargetDescriptor({
|
|
468
459
|
...descriptor,
|
|
469
460
|
pageRef,
|
|
470
|
-
}, descriptor.ref ??
|
|
461
|
+
}, descriptor.ref ?? '__identity__');
|
|
471
462
|
const identity = targetIdentity(normalizedDescriptor);
|
|
472
463
|
const matchedRef = takeReusableTargetRef(reusableRefs, identity, reusedRefs, normalizedDescriptor) ??
|
|
473
464
|
(normalizedDescriptor.surfaceRef?.trim()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-matcher.d.ts","sourceRoot":"","sources":["../../src/secrets/form-matcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAA2B,MAAM,qBAAqB,CAAC;AACrF,OAAO,KAAK,EACV,wBAAwB,EAExB,qBAAqB,EACrB,qBAAqB,EAErB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AASpB,KAAK,iBAAiB,GAAG,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC;AAEhE,UAAU,cAAc;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B;AAED,UAAU,eAAe;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAiCD,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW3B,CAAC;AAsCH,iBAAS,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAS3D;AAsBD,iBAAS,cAAc,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAsC1D;AAgnBD,iBAAS,cAAc,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CA6BxD;AAED,iBAAS,kBAAkB,CAAC,OAAO,EAAE,aAAa,CAAC,gBAAgB,CAAC,GAAG,eAAe,EAAE,CAkBvF;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,kBAAkB,CAAC,OAAO,EAAE,aAAa,CAAC,gBAAgB,CAAC,GAAG,eAAe,EAAE,CAkBvF;AAyFD,iBAAS,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,eAAe,GAAG,MAAM,CAalF;AAED,iBAAS,gBAAgB,CACvB,IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,eAAe,EACtB,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,GACnF,wBAAwB,EAAE,CA6C5B;AAiPD,wBAAsB,mCAAmC,CACvD,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,aAAa,CAAC,gBAAgB,CAAC,EACxC,OAAO,EAAE,qBAAqB,GAAG,IAAI,EACrC,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAqD9B;AAED,eAAO,MAAM,iBAAiB;;;;;;;CAO7B,CAAC"}
|
|
@@ -742,9 +742,7 @@ function isCredibleKindMatch(kind, fieldBindings) {
|
|
|
742
742
|
case 'login':
|
|
743
743
|
return fieldKeys.has('username') && fieldKeys.has('password');
|
|
744
744
|
case 'payment_card':
|
|
745
|
-
return
|
|
746
|
-
fieldKeys.has('exp_month') &&
|
|
747
|
-
fieldKeys.has('exp_year'));
|
|
745
|
+
return fieldKeys.has('pan') && fieldKeys.has('exp_month') && fieldKeys.has('exp_year');
|
|
748
746
|
case 'identity': {
|
|
749
747
|
const anchorKeys = new Set([
|
|
750
748
|
'document_number',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protected-exact-value-redaction.d.ts","sourceRoot":"","sources":["../../src/secrets/protected-exact-value-redaction.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,EAAE,0BAA0B,EAA2B,MAAM,qBAAqB,CAAC;AAC/F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"protected-exact-value-redaction.d.ts","sourceRoot":"","sources":["../../src/secrets/protected-exact-value-redaction.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,EAAE,0BAA0B,EAA2B,MAAM,qBAAqB,CAAC;AAC/F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAsDvD,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAa9E;AA+GD,wBAAgB,+BAA+B,CAC7C,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC,GAC7D,0BAA0B,CA8B5B;AAuND,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAOxF;AAED,eAAO,MAAM,kCAAkC;;CAE9C,CAAC"}
|
|
@@ -16,7 +16,9 @@ function getDefaultRedactionKeyPath() {
|
|
|
16
16
|
}
|
|
17
17
|
function resolvePersistedRedactionKeyPath() {
|
|
18
18
|
const configuredPath = process.env[REDACTION_KEY_PATH_ENV]?.trim();
|
|
19
|
-
return configuredPath && configuredPath.length > 0
|
|
19
|
+
return configuredPath && configuredPath.length > 0
|
|
20
|
+
? configuredPath
|
|
21
|
+
: getDefaultRedactionKeyPath();
|
|
20
22
|
}
|
|
21
23
|
function loadOrCreatePersistedRedactionKey() {
|
|
22
24
|
if (cachedPersistedRedactionKey) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mercuryo-ai/agentbrowse",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.52",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Browser automation primitives library for AI agents",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
],
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/
|
|
18
|
+
"url": "git+https://github.com/MercuryoAI/agentbrowse.git"
|
|
19
19
|
},
|
|
20
20
|
"bugs": {
|
|
21
|
-
"url": "https://github.com/
|
|
21
|
+
"url": "https://github.com/MercuryoAI/agentbrowse/issues"
|
|
22
22
|
},
|
|
23
|
-
"homepage": "https://github.com/
|
|
23
|
+
"homepage": "https://github.com/MercuryoAI/agentbrowse#readme",
|
|
24
24
|
"main": "./dist/library.js",
|
|
25
25
|
"types": "./dist/library.d.ts",
|
|
26
26
|
"exports": {
|