@quiesco/protocol 0.8.1 → 0.10.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/config.d.ts +8 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -0
- package/dist/constants.js.map +1 -1
- package/dist/errors.d.ts +5 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/events.d.ts +8 -0
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +8 -1
- package/dist/events.js.map +1 -1
- package/dist/methods.d.ts +15 -0
- package/dist/methods.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/config.ts +8 -2
- package/src/constants.ts +2 -0
- package/src/errors.ts +5 -3
- package/src/events.ts +9 -0
- package/src/methods.ts +16 -0
package/dist/config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LogLevel } from './events.js';
|
|
2
2
|
import type { Matcher, TextMatch } from './matcher.js';
|
|
3
|
-
export declare const TRACKER_NAMES: readonly ["network", "timer", "react", "idle-callback", "frame-stable", "native"];
|
|
3
|
+
export declare const TRACKER_NAMES: readonly ["network", "timer", "react", "idle-callback", "frame-stable", "native", "native-module"];
|
|
4
4
|
export type TrackerName = (typeof TRACKER_NAMES)[number];
|
|
5
5
|
/**
|
|
6
6
|
* Agent-side settings derived from `quiesco.config.ts` (requirements.md §6.2, §6.13).
|
|
@@ -14,8 +14,14 @@ export interface AgentConfig {
|
|
|
14
14
|
stableFrames: number;
|
|
15
15
|
/** URL patterns ignored by the network tracker. Strings match as substrings. */
|
|
16
16
|
ignoreUrls: TextMatch[];
|
|
17
|
-
/** Per-tracker switch; omitted trackers are enabled. */
|
|
17
|
+
/** Per-tracker switch; omitted trackers are enabled, except `native-module` (off unless `true`). */
|
|
18
18
|
trackers: Partial<Record<TrackerName, boolean>>;
|
|
19
|
+
/**
|
|
20
|
+
* `native-module` tracker (issue #67): how long a pending native module call counts as busy, and the
|
|
21
|
+
* calls ("Module.method") that never count. Optional for older hosts.
|
|
22
|
+
*/
|
|
23
|
+
nativeCallThresholdMs?: number;
|
|
24
|
+
ignoreNativeCalls?: TextMatch[];
|
|
19
25
|
/**
|
|
20
26
|
* Elements (and their subtrees) left out of the frame-stable check, e.g. a decorative animation that
|
|
21
27
|
* runs for minutes. Optional for older hosts.
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,aAAa,oGAAqG,CAAC;AAChI,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM,CAAC;QAClB,gBAAgB,EAAE,MAAM,CAAC;QACzB,cAAc,EAAE,OAAO,CAAC;QACxB,YAAY,EAAE,MAAM,CAAC;QACrB,gFAAgF;QAChF,UAAU,EAAE,SAAS,EAAE,CAAC;QACxB,oGAAoG;QACpG,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;QAChD;;;WAGG;QACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAC/B,iBAAiB,CAAC,EAAE,SAAS,EAAE,CAAC;QAChC;;;WAGG;QACH,cAAc,CAAC,EAAE,OAAO,EAAE,CAAC;KAC5B,CAAC;IACF,kFAAkF;IAClF,QAAQ,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;;;;OAIG;IACH,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAC/B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAErD,MAAM,WAAW,WAAW;IAC1B,sFAAsF;IACtF,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
package/dist/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const TRACKER_NAMES = ['network', 'timer', 'react', 'idle-callback', 'frame-stable', 'native'];
|
|
1
|
+
export const TRACKER_NAMES = ['network', 'timer', 'react', 'idle-callback', 'frame-stable', 'native', 'native-module'];
|
|
2
2
|
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,QAAQ,CAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,QAAQ,EAAE,eAAe,CAAU,CAAC"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export declare const SyncDefaults: {
|
|
|
37
37
|
readonly timerThresholdMs: 1500;
|
|
38
38
|
readonly stableFrames: 2;
|
|
39
39
|
readonly countIntervals: false;
|
|
40
|
+
/** `native-module` tracker: a pending native module call counts as busy for at most this long. */
|
|
41
|
+
readonly nativeCallThresholdMs: 2000;
|
|
40
42
|
/** Interval between re-checks while an assertion fails or an action target is not ready yet. */
|
|
41
43
|
readonly retryIntervalMs: 50;
|
|
42
44
|
};
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAC/C,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AACrD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAC/C,gGAAgG;AAChG,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAE/C,kFAAkF;AAClF,eAAO,MAAM,YAAY,OAAO,CAAC;AAEjC,mFAAmF;AACnF,eAAO,MAAM,SAAS;IACpB,mCAAmC;;IAEnC,iFAAiF;;IAEjF,qCAAqC;;IAErC,6FAA6F;;CAErF,CAAC;AACX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAEnE,kDAAkD;AAClD,eAAO,MAAM,YAAY;;;;;IAKvB,gGAAgG;;CAExF,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAC/C,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AACrD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAC/C,gGAAgG;AAChG,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAE/C,kFAAkF;AAClF,eAAO,MAAM,YAAY,OAAO,CAAC;AAEjC,mFAAmF;AACnF,eAAO,MAAM,SAAS;IACpB,mCAAmC;;IAEnC,iFAAiF;;IAEjF,qCAAqC;;IAErC,6FAA6F;;CAErF,CAAC;AACX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAEnE,kDAAkD;AAClD,eAAO,MAAM,YAAY;;;;;IAKvB,kGAAkG;;IAElG,gGAAgG;;CAExF,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -36,6 +36,8 @@ export const SyncDefaults = {
|
|
|
36
36
|
timerThresholdMs: 1_500,
|
|
37
37
|
stableFrames: 2,
|
|
38
38
|
countIntervals: false,
|
|
39
|
+
/** `native-module` tracker: a pending native module call counts as busy for at most this long. */
|
|
40
|
+
nativeCallThresholdMs: 2_000,
|
|
39
41
|
/** Interval between re-checks while an assertion fails or an action target is not ready yet. */
|
|
40
42
|
retryIntervalMs: 50,
|
|
41
43
|
};
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAElC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAC/C,MAAM,CAAC,MAAM,oBAAoB,GAA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SAAS,GAAG;IACvB,mCAAmC;IACnC,MAAM,EAAE,IAAI;IACZ,iFAAiF;IACjF,gBAAgB,EAAE,IAAI;IACtB,qCAAqC;IACrC,iBAAiB,EAAE,IAAI;IACvB,6FAA6F;IAC7F,QAAQ,EAAE,IAAI;CACN,CAAC;AAGX,kDAAkD;AAClD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,SAAS,EAAE,MAAM;IACjB,gBAAgB,EAAE,KAAK;IACvB,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,KAAK;IACrB,kGAAkG;IAClG,qBAAqB,EAAE,KAAK;IAC5B,gGAAgG;IAChG,eAAe,EAAE,EAAE;CACX,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ActionType } from './actions.js';
|
|
|
2
2
|
import type { ElementSummary } from './element.js';
|
|
3
3
|
import type { JsonValue } from './json.js';
|
|
4
4
|
import type { Matcher } from './matcher.js';
|
|
5
|
-
import type { TrackerState } from './methods.js';
|
|
5
|
+
import type { StepTiming, TrackerState } from './methods.js';
|
|
6
6
|
/** Standard JSON-RPC 2.0 error codes. */
|
|
7
7
|
export declare const JsonRpcErrorCode: {
|
|
8
8
|
readonly PARSE_ERROR: -32700;
|
|
@@ -33,17 +33,21 @@ export type ErrorName = keyof typeof ErrorCode;
|
|
|
33
33
|
/** Structured `error.data` for each Quiesco error code. */
|
|
34
34
|
export interface ErrorDataMap {
|
|
35
35
|
/** `reason: 'not-in-window'`: React rendered it, but no window shows it (e.g. a system alert is over the app; Phase 6.12). */
|
|
36
|
+
/** `steps`: a multi-step action's steps before it gave up (issue #78). */
|
|
36
37
|
ELEMENT_NOT_FOUND: {
|
|
37
38
|
matcher: Matcher;
|
|
38
39
|
reason?: 'not-in-window';
|
|
40
|
+
steps?: StepTiming[];
|
|
39
41
|
};
|
|
40
42
|
MULTIPLE_MATCHES: {
|
|
41
43
|
matcher: Matcher;
|
|
42
44
|
matches: ElementSummary[];
|
|
43
45
|
};
|
|
46
|
+
/** `steps`: a multi-step action's steps, the last one the step that timed out (issue #78). */
|
|
44
47
|
SYNC_TIMEOUT: {
|
|
45
48
|
timeoutMs: number;
|
|
46
49
|
busy: TrackerState[];
|
|
50
|
+
steps?: StepTiming[];
|
|
47
51
|
};
|
|
48
52
|
ASSERTION_FAILED: {
|
|
49
53
|
expected: JsonValue;
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE7D,yCAAyC;AACzC,eAAO,MAAM,gBAAgB;;;;;;CAMnB,CAAC;AAEX,gDAAgD;AAChD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;CAeZ,CAAC;AACX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AACnE,MAAM,MAAM,SAAS,GA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,MAAM,EAAE,CAAC;QAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAClE,eAAe,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,SAAS,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,YAAY,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,2FAA2F;IAC3F,6GAA6G;IAC7G,gBAAgB,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,cAAc,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;CACvH;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IACjE,IAAI,EAAE,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;CACrC"}
|
package/dist/events.d.ts
CHANGED
|
@@ -16,4 +16,12 @@ export interface AgentEvents {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
export type AgentEventName = keyof AgentEvents;
|
|
19
|
+
/**
|
|
20
|
+
* Notification the host sends while a call to the agent is pending, every HOST_TICK_MS (issue #66). It
|
|
21
|
+
* carries nothing: any incoming message makes the agent check a pending wait for idle again. On Android
|
|
22
|
+
* React Native pauses JS timers while the app is in the background (a system dialog is up), so a wait
|
|
23
|
+
* sleeping on a timer would neither end nor time out. Agents that do not know it ignore it.
|
|
24
|
+
*/
|
|
25
|
+
export declare const HOST_TICK = "tick";
|
|
26
|
+
export declare const HOST_TICK_MS = 500;
|
|
19
27
|
//# sourceMappingURL=events.d.ts.map
|
package/dist/events.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D,MAAM,WAAW,WAAW;IAC1B,6EAA6E;IAC7E,GAAG,EAAE;QAAE,KAAK,EAAE,QAAQ,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7D,kGAAkG;IAClG,KAAK,EAAE;QAAE,IAAI,EAAE,UAAU,GAAG,oBAAoB,GAAG,QAAQ,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CACnH;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D,MAAM,WAAW,WAAW;IAC1B,6EAA6E;IAC7E,GAAG,EAAE;QAAE,KAAK,EAAE,QAAQ,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7D,kGAAkG;IAClG,KAAK,EAAE;QAAE,IAAI,EAAE,UAAU,GAAG,oBAAoB,GAAG,QAAQ,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CACnH;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,WAAW,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,SAAS,SAAS,CAAC;AAChC,eAAO,MAAM,YAAY,MAAM,CAAC"}
|
package/dist/events.js
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Notification the host sends while a call to the agent is pending, every HOST_TICK_MS (issue #66). It
|
|
3
|
+
* carries nothing: any incoming message makes the agent check a pending wait for idle again. On Android
|
|
4
|
+
* React Native pauses JS timers while the app is in the background (a system dialog is up), so a wait
|
|
5
|
+
* sleeping on a timer would neither end nor time out. Agents that do not know it ignore it.
|
|
6
|
+
*/
|
|
7
|
+
export const HOST_TICK = 'tick';
|
|
8
|
+
export const HOST_TICK_MS = 500;
|
|
2
9
|
//# sourceMappingURL=events.js.map
|
package/dist/events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC;AAChC,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC"}
|
package/dist/methods.d.ts
CHANGED
|
@@ -16,6 +16,19 @@ export interface TrackerState {
|
|
|
16
16
|
/** Results of query / action / assert / webview / scrollView carry the ms spent waiting for idle (Phase 6.9). */
|
|
17
17
|
export interface SyncTiming {
|
|
18
18
|
syncMs?: number;
|
|
19
|
+
/** The steps of a multi-step action (scrollTo, issue #78), for the timeline. */
|
|
20
|
+
steps?: StepTiming[];
|
|
21
|
+
}
|
|
22
|
+
/** One step of a multi-step action (issue #78). */
|
|
23
|
+
export interface StepTiming {
|
|
24
|
+
/** ms from the start of the call to the start of the step (agent clock). */
|
|
25
|
+
atMs: number;
|
|
26
|
+
/** How long the step took (drag and wait for idle). */
|
|
27
|
+
ms: number;
|
|
28
|
+
/** Of which waiting for idle. */
|
|
29
|
+
syncMs: number;
|
|
30
|
+
/** What the step did, e.g. `down`. */
|
|
31
|
+
label: string;
|
|
19
32
|
}
|
|
20
33
|
export interface SyncOption {
|
|
21
34
|
sync?: boolean;
|
|
@@ -274,6 +287,8 @@ export interface HostMethods {
|
|
|
274
287
|
nativeModule: boolean;
|
|
275
288
|
/** The JS bundle (issue #3); missing without `withQuiesco()` in the Metro config. */
|
|
276
289
|
bundle?: BundleInfo;
|
|
290
|
+
/** Whether the build wraps native modules for the `native-module` tracker (issue #74); missing from older agents. */
|
|
291
|
+
nativeModulesWrapped?: boolean;
|
|
277
292
|
};
|
|
278
293
|
result: {
|
|
279
294
|
accepted: true;
|
package/dist/methods.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["../src/methods.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,CAAC;AAEjD,sEAAsE;AACtE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,sFAAsF;IACtF,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,wGAAwG;AACxG,iHAAiH;AACjH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/B;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC;CAC1B;AAED,2CAA2C;AAC3C,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE;QACL,MAAM,EAAE;YACN,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;YACzB,QAAQ,EAAE,QAAQ,CAAC;YACnB,eAAe,EAAE,MAAM,CAAC;YACxB,YAAY,EAAE,MAAM,CAAC;YACrB,4EAA4E;YAC5E,YAAY,EAAE,OAAO,CAAC;YACtB,qFAAqF;YACrF,MAAM,CAAC,EAAE,UAAU,CAAC;YACpB,qHAAqH;YACrH,oBAAoB,CAAC,EAAE,OAAO,CAAC;SAChC,CAAC;QACF,MAAM,EAAE;YAAE,QAAQ,EAAE,IAAI,CAAC;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,WAAW,CAAA;SAAE,CAAC;KACpE,CAAC;CACH;AAED,MAAM,MAAM,eAAe,GAAG,MAAM,YAAY,CAAC;AACjD,MAAM,MAAM,cAAc,GAAG,MAAM,WAAW,CAAC;AAC/C,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC;AAClE,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LogLevel } from './events.js';
|
|
2
2
|
import type { Matcher, TextMatch } from './matcher.js';
|
|
3
3
|
|
|
4
|
-
export const TRACKER_NAMES = ['network', 'timer', 'react', 'idle-callback', 'frame-stable', 'native'] as const;
|
|
4
|
+
export const TRACKER_NAMES = ['network', 'timer', 'react', 'idle-callback', 'frame-stable', 'native', 'native-module'] as const;
|
|
5
5
|
export type TrackerName = (typeof TRACKER_NAMES)[number];
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -16,8 +16,14 @@ export interface AgentConfig {
|
|
|
16
16
|
stableFrames: number;
|
|
17
17
|
/** URL patterns ignored by the network tracker. Strings match as substrings. */
|
|
18
18
|
ignoreUrls: TextMatch[];
|
|
19
|
-
/** Per-tracker switch; omitted trackers are enabled. */
|
|
19
|
+
/** Per-tracker switch; omitted trackers are enabled, except `native-module` (off unless `true`). */
|
|
20
20
|
trackers: Partial<Record<TrackerName, boolean>>;
|
|
21
|
+
/**
|
|
22
|
+
* `native-module` tracker (issue #67): how long a pending native module call counts as busy, and the
|
|
23
|
+
* calls ("Module.method") that never count. Optional for older hosts.
|
|
24
|
+
*/
|
|
25
|
+
nativeCallThresholdMs?: number;
|
|
26
|
+
ignoreNativeCalls?: TextMatch[];
|
|
21
27
|
/**
|
|
22
28
|
* Elements (and their subtrees) left out of the frame-stable check, e.g. a decorative animation that
|
|
23
29
|
* runs for minutes. Optional for older hosts.
|
package/src/constants.ts
CHANGED
|
@@ -41,6 +41,8 @@ export const SyncDefaults = {
|
|
|
41
41
|
timerThresholdMs: 1_500,
|
|
42
42
|
stableFrames: 2,
|
|
43
43
|
countIntervals: false,
|
|
44
|
+
/** `native-module` tracker: a pending native module call counts as busy for at most this long. */
|
|
45
|
+
nativeCallThresholdMs: 2_000,
|
|
44
46
|
/** Interval between re-checks while an assertion fails or an action target is not ready yet. */
|
|
45
47
|
retryIntervalMs: 50,
|
|
46
48
|
} as const;
|
package/src/errors.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ActionType } from './actions.js';
|
|
|
2
2
|
import type { ElementSummary } from './element.js';
|
|
3
3
|
import type { JsonValue } from './json.js';
|
|
4
4
|
import type { Matcher } from './matcher.js';
|
|
5
|
-
import type { TrackerState } from './methods.js';
|
|
5
|
+
import type { StepTiming, TrackerState } from './methods.js';
|
|
6
6
|
|
|
7
7
|
/** Standard JSON-RPC 2.0 error codes. */
|
|
8
8
|
export const JsonRpcErrorCode = {
|
|
@@ -36,9 +36,11 @@ export type ErrorName = keyof typeof ErrorCode;
|
|
|
36
36
|
/** Structured `error.data` for each Quiesco error code. */
|
|
37
37
|
export interface ErrorDataMap {
|
|
38
38
|
/** `reason: 'not-in-window'`: React rendered it, but no window shows it (e.g. a system alert is over the app; Phase 6.12). */
|
|
39
|
-
|
|
39
|
+
/** `steps`: a multi-step action's steps before it gave up (issue #78). */
|
|
40
|
+
ELEMENT_NOT_FOUND: { matcher: Matcher; reason?: 'not-in-window'; steps?: StepTiming[] };
|
|
40
41
|
MULTIPLE_MATCHES: { matcher: Matcher; matches: ElementSummary[] };
|
|
41
|
-
|
|
42
|
+
/** `steps`: a multi-step action's steps, the last one the step that timed out (issue #78). */
|
|
43
|
+
SYNC_TIMEOUT: { timeoutMs: number; busy: TrackerState[]; steps?: StepTiming[] };
|
|
42
44
|
ASSERTION_FAILED: { expected: JsonValue; actual: JsonValue; elements: ElementSummary[] };
|
|
43
45
|
ACTION_NOT_SUPPORTED: { action: ActionType | 'webview'; platform: string; hint?: string };
|
|
44
46
|
BACKDOOR_NOT_REGISTERED: { name: string; registered: string[] };
|
package/src/events.ts
CHANGED
|
@@ -9,3 +9,12 @@ export interface AgentEvents {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export type AgentEventName = keyof AgentEvents;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Notification the host sends while a call to the agent is pending, every HOST_TICK_MS (issue #66). It
|
|
15
|
+
* carries nothing: any incoming message makes the agent check a pending wait for idle again. On Android
|
|
16
|
+
* React Native pauses JS timers while the app is in the background (a system dialog is up), so a wait
|
|
17
|
+
* sleeping on a timer would neither end nor time out. Agents that do not know it ignore it.
|
|
18
|
+
*/
|
|
19
|
+
export const HOST_TICK = 'tick';
|
|
20
|
+
export const HOST_TICK_MS = 500;
|
package/src/methods.ts
CHANGED
|
@@ -19,6 +19,20 @@ export interface TrackerState {
|
|
|
19
19
|
/** Results of query / action / assert / webview / scrollView carry the ms spent waiting for idle (Phase 6.9). */
|
|
20
20
|
export interface SyncTiming {
|
|
21
21
|
syncMs?: number;
|
|
22
|
+
/** The steps of a multi-step action (scrollTo, issue #78), for the timeline. */
|
|
23
|
+
steps?: StepTiming[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** One step of a multi-step action (issue #78). */
|
|
27
|
+
export interface StepTiming {
|
|
28
|
+
/** ms from the start of the call to the start of the step (agent clock). */
|
|
29
|
+
atMs: number;
|
|
30
|
+
/** How long the step took (drag and wait for idle). */
|
|
31
|
+
ms: number;
|
|
32
|
+
/** Of which waiting for idle. */
|
|
33
|
+
syncMs: number;
|
|
34
|
+
/** What the step did, e.g. `down`. */
|
|
35
|
+
label: string;
|
|
22
36
|
}
|
|
23
37
|
|
|
24
38
|
export interface SyncOption {
|
|
@@ -154,6 +168,8 @@ export interface HostMethods {
|
|
|
154
168
|
nativeModule: boolean;
|
|
155
169
|
/** The JS bundle (issue #3); missing without `withQuiesco()` in the Metro config. */
|
|
156
170
|
bundle?: BundleInfo;
|
|
171
|
+
/** Whether the build wraps native modules for the `native-module` tracker (issue #74); missing from older agents. */
|
|
172
|
+
nativeModulesWrapped?: boolean;
|
|
157
173
|
};
|
|
158
174
|
result: { accepted: true; sessionId: string; config: AgentConfig };
|
|
159
175
|
};
|