clearcote 0.51.0 → 0.52.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/README.md +9 -5
- package/dist/attention.d.ts +26 -0
- package/dist/attention.d.ts.map +1 -0
- package/dist/attention.js +82 -0
- package/dist/attention.js.map +1 -0
- package/dist/cloud.d.ts +10 -3
- package/dist/cloud.d.ts.map +1 -1
- package/dist/cloud.js +9 -1
- package/dist/cloud.js.map +1 -1
- package/dist/docker.d.ts +8 -3
- package/dist/docker.d.ts.map +1 -1
- package/dist/docker.js +26 -10
- package/dist/docker.js.map +1 -1
- package/dist/download.d.ts +19 -1
- package/dist/download.d.ts.map +1 -1
- package/dist/download.js +137 -18
- package/dist/download.js.map +1 -1
- package/dist/forms.d.ts +8 -0
- package/dist/forms.d.ts.map +1 -1
- package/dist/forms.js +56 -0
- package/dist/forms.js.map +1 -1
- package/dist/frames.d.ts +33 -0
- package/dist/frames.d.ts.map +1 -0
- package/dist/frames.js +415 -0
- package/dist/frames.js.map +1 -0
- package/dist/hold.d.ts +14 -7
- package/dist/hold.d.ts.map +1 -1
- package/dist/hold.js +33 -6
- package/dist/hold.js.map +1 -1
- package/dist/humanize.d.ts +49 -20
- package/dist/humanize.d.ts.map +1 -1
- package/dist/humanize.js +2024 -261
- package/dist/humanize.js.map +1 -1
- package/dist/hzoptions.d.ts +78 -0
- package/dist/hzoptions.d.ts.map +1 -0
- package/dist/hzoptions.js +171 -0
- package/dist/hzoptions.js.map +1 -0
- package/dist/index.d.ts +16 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -14
- package/dist/index.js.map +1 -1
- package/dist/isolated.d.ts +6 -0
- package/dist/isolated.d.ts.map +1 -1
- package/dist/isolated.js +57 -1
- package/dist/isolated.js.map +1 -1
- package/dist/keys.d.ts +69 -0
- package/dist/keys.d.ts.map +1 -0
- package/dist/keys.js +201 -0
- package/dist/keys.js.map +1 -0
- package/dist/launchopts.d.ts +15 -2
- package/dist/launchopts.d.ts.map +1 -1
- package/dist/launchopts.js +50 -3
- package/dist/launchopts.js.map +1 -1
- package/dist/motion.d.ts +130 -12
- package/dist/motion.d.ts.map +1 -1
- package/dist/motion.js +258 -19
- package/dist/motion.js.map +1 -1
- package/dist/motionscore.d.ts +81 -0
- package/dist/motionscore.d.ts.map +1 -1
- package/dist/motionscore.js +279 -2
- package/dist/motionscore.js.map +1 -1
- package/dist/pacing.d.ts +5 -0
- package/dist/pacing.d.ts.map +1 -1
- package/dist/pacing.js +10 -0
- package/dist/pacing.js.map +1 -1
- package/dist/release.d.ts +22 -1
- package/dist/release.d.ts.map +1 -1
- package/dist/release.js +28 -0
- package/dist/release.js.map +1 -1
- package/dist/scroll.d.ts +143 -0
- package/dist/scroll.d.ts.map +1 -0
- package/dist/scroll.js +426 -0
- package/dist/scroll.js.map +1 -0
- package/dist/trace.d.ts +12 -0
- package/dist/trace.d.ts.map +1 -0
- package/dist/trace.js +60 -0
- package/dist/trace.js.map +1 -0
- package/dist/warnings.d.ts.map +1 -1
- package/dist/warnings.js +3 -1
- package/dist/warnings.js.map +1 -1
- package/package.json +1 -1
package/dist/humanize.d.ts
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
import type { Browser, BrowserContext, Page } from "playwright-core";
|
|
2
|
+
import { type Persona } from "./motion.js";
|
|
3
|
+
export { reportFallback, strictMode } from "./frames.js";
|
|
4
|
+
/** The error a strict-mode tap raises on a touch context (lane F, SC 232). */
|
|
5
|
+
export declare const TAP_NOT_HUMANIZED = "tap is not humanized for touch contexts yet";
|
|
6
|
+
export declare const LABEL_SHARE = 0.4;
|
|
7
|
+
/** The persona's trait: the share of visible-checkbox clicks that land on the label text. */
|
|
8
|
+
export declare function labelShare(persona: Persona): number;
|
|
9
|
+
/** This click: on the label? An unseeded draw against the persona's trait (`rng`: a test's own). */
|
|
10
|
+
export declare function labelDraw(persona: Persona, rng?: () => number): boolean;
|
|
2
11
|
import { type OptionInfo } from "./forms.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
12
|
+
import { type HumanizeSetting } from "./hzoptions.js";
|
|
13
|
+
export { ClearcoteStrictError } from "./hzoptions.js";
|
|
14
|
+
export type { HumanizeAmbient, HumanizeEngine, HumanizeFallbackEvent, HumanizeOptions, HumanizePreset, HumanizeSetting, } from "./hzoptions.js";
|
|
15
|
+
/** The humanize options of launch() / launchPersistentContext() (called HumanizeOptions up to 0.51.0; that
|
|
16
|
+
* name is now the options object itself). */
|
|
17
|
+
export interface HumanizeLaunchOptions {
|
|
18
|
+
/** Humanize all input (move/click/drag/scroll/type) as native trusted events: true, "strict" or a
|
|
19
|
+
* HumanizeOptions object ({ preset, strict, engine, ambient, typoRate, handedness, deviceHz, inputDevice,
|
|
20
|
+
* onFallback }). An unknown option throws. */
|
|
21
|
+
humanize?: HumanizeSetting;
|
|
6
22
|
/** Show a red cursor dot that tracks the motion (visualization). */
|
|
7
23
|
showCursor?: boolean;
|
|
8
24
|
/** @internal Fingerprint seed → a stable per-identity motor persona (cadence, tremor, overshoot,
|
|
@@ -23,6 +39,9 @@ export declare const POINTER_PATH_LEGACY = "Browser.humanizedClick";
|
|
|
23
39
|
export declare function sendEngineCommand(session: {
|
|
24
40
|
send(method: string, params?: any): Promise<any>;
|
|
25
41
|
}, cacheKey: object, method: string, legacy: string, params: Record<string, unknown>): Promise<any>;
|
|
42
|
+
/** CLEARCOTE_HUMANIZE_ENGINE_EXT=off (also 0/false/no) keeps the r43 engine extensions unused (r42 behaviour). */
|
|
43
|
+
export declare function engineExtMode(): boolean;
|
|
44
|
+
export declare const ENGINE_EXT_MISSING = "the engine has no r43 extensions (Browser.dispatchKeySequence): the SDK planner walks and types";
|
|
26
45
|
/** @internal exported for tests. Did this browser's engine already say it has no pointer-path command? */
|
|
27
46
|
export declare function engineHasNoPointerPath(cacheKey: object | null): boolean;
|
|
28
47
|
/** @internal exported for tests. The page's default action timeout (setDefaultTimeout, else the
|
|
@@ -35,10 +54,11 @@ export declare function trialTimeoutError(selector: string, ms: number, why: str
|
|
|
35
54
|
export declare const needsShift: (ch: string) => boolean;
|
|
36
55
|
/** @internal */
|
|
37
56
|
export declare const NEARBY: Readonly<Record<string, string>>;
|
|
38
|
-
/** @internal exported for tests. Per-character fat-finger rate.
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
|
|
57
|
+
/** @internal exported for tests. Per-character fat-finger rate: the persona's own (timingTraits, 0.5–4 %
|
|
58
|
+
* per identity; the global 2 % without a persona). CLEARCOTE_HUMANIZE_TYPO_RATE overrides it when set (0
|
|
59
|
+
* disables typos; the test suites raise it to exercise the correction paths). Read at call time, like
|
|
60
|
+
* Python's typo_rate(). */
|
|
61
|
+
export declare function typoRate(persona?: Persona | null): number;
|
|
42
62
|
/** @internal exported for tests. A Playwright timeout: the element never became actionable. Falling
|
|
43
63
|
* back to the native call after one would wait the FULL timeout again (a missing element took 2-3x
|
|
44
64
|
* `timeout` to fail), so timeouts propagate instead. */
|
|
@@ -59,17 +79,24 @@ export declare function sdkPlaywrightError(message: string): Error;
|
|
|
59
79
|
* one pointer and one keyboard focus. Internal steps call internal helpers, never a locked entry point,
|
|
60
80
|
* so nothing waits on itself. A failed call releases the lock like a successful one. */
|
|
61
81
|
export declare function createInputLock(): <T>(fn: () => Promise<T>) => Promise<T>;
|
|
62
|
-
/** Wrap a single page's input methods + (optionally) inject the cursor overlay. */
|
|
63
|
-
/** Which clicks the engine pointer path (Browser.dispatchPointerPath) may walk, from
|
|
64
|
-
* CLEARCOTE_HUMANIZE_ENGINE_CLICKS: "off" (also 0/false/no) never; "all" (also "selector") coordinate
|
|
65
|
-
* clicks AND targeted page.click(selector) / locator.click() clicks; anything else (the default)
|
|
66
|
-
* coordinate clicks only, as before.
|
|
67
|
-
*
|
|
68
|
-
* Targeted clicks stay on the SDK planner by default (SC 210 lane S, measured on r38): the engine
|
|
69
|
-
* presses 9 ms after its last move (the planner's press waits 40-130 ms), and it walks from its own last
|
|
70
|
-
* position, which an SDK glide does not update. Same values as Python `_engine_clicks_mode`. */
|
|
71
82
|
export declare function engineClicksMode(): "off" | "coords" | "all";
|
|
72
|
-
export declare function attachHumanize(browser: Browser | null, page: Page, opts:
|
|
83
|
+
export declare function attachHumanize(browser: Browser | null, page: Page, opts: HumanizeLaunchOptions): Promise<void>;
|
|
84
|
+
/** Options of `locator.dragBy(dx, dy, options)` / `page.dragBy(selector, dx, dy, options)`. */
|
|
85
|
+
export interface DragByOptions {
|
|
86
|
+
/** Press here (relative to the element's padding box, like click's `position`) instead of the persona's point. */
|
|
87
|
+
position?: {
|
|
88
|
+
x: number;
|
|
89
|
+
y: number;
|
|
90
|
+
};
|
|
91
|
+
/** Skip the hit test at the press point. */
|
|
92
|
+
force?: boolean;
|
|
93
|
+
/** For the element to become visible (ms). */
|
|
94
|
+
timeout?: number;
|
|
95
|
+
/** Close enough (px), default 2. */
|
|
96
|
+
tolerance?: number;
|
|
97
|
+
/** How far the dragged thing has moved so far: [dx, dy], {x, y} or the x delta; default: the element's own box. */
|
|
98
|
+
read?: () => unknown;
|
|
99
|
+
}
|
|
73
100
|
/** One wanted option. `value` matches value OR label (a bare string, like Playwright's
|
|
74
101
|
* valueOrLabel); `valueOnly` is a `{ value }` option object, which Playwright matches on the value
|
|
75
102
|
* alone; `index` / `label` are `{ index }` / `{ label }`. */
|
|
@@ -86,10 +113,13 @@ type SelectWant = {
|
|
|
86
113
|
export declare function selectWants(values: any): SelectWant[] | null;
|
|
87
114
|
/** @internal exported for tests. The option index a want resolves to, Playwright's way, or -1. */
|
|
88
115
|
export declare function wantIndex(opts: readonly OptionInfo[], w: SelectWant): number;
|
|
116
|
+
export declare function perCallOff(stock: (...a: any[]) => any, fn: (...a: any[]) => any, after?: (a: any[]) => void): (this: any, ...a: any[]) => any;
|
|
117
|
+
/** @internal exported for tests. Why selectOption went to Playwright when the humane route returned nothing. */
|
|
118
|
+
export declare function selectWhy(values: any, options: any): string;
|
|
89
119
|
/** @internal exported for tests: the subset of `kw` named in `names` (null/undefined dropped). */
|
|
90
120
|
export declare function pickOptions(kw: any, names: readonly string[]): Record<string, unknown>;
|
|
91
121
|
/** Install humanize/showCursor on a browser: wraps newPage/newContext so every page is covered. */
|
|
92
|
-
export declare function installHumanize(browser: Browser,
|
|
122
|
+
export declare function installHumanize(browser: Browser, opts0: HumanizeLaunchOptions): void;
|
|
93
123
|
/** Install humanize/showCursor on a single context (used for launchPersistentContext).
|
|
94
124
|
*
|
|
95
125
|
* Attaches whether or not the context has a Browser. A persistent context has none on older
|
|
@@ -98,6 +128,5 @@ export declare function installHumanize(browser: Browser, opts: HumanizeOptions)
|
|
|
98
128
|
* silently off. attachHumanize needs only the page; the engine route takes the browser from the
|
|
99
129
|
* page's context when there is one and uses the page's own CDP session when there is not (there the
|
|
100
130
|
* engine answers only to the pre-r34 name, POINTER_PATH_LEGACY: one miss per context, measured on r38). */
|
|
101
|
-
export declare function installHumanizeOnContext(context: BrowserContext,
|
|
102
|
-
export {};
|
|
131
|
+
export declare function installHumanizeOnContext(context: BrowserContext, opts0: HumanizeLaunchOptions, browser?: Browser | null): void;
|
|
103
132
|
//# sourceMappingURL=humanize.d.ts.map
|
package/dist/humanize.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"humanize.d.ts","sourceRoot":"","sources":["../src/humanize.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAW,IAAI,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"humanize.d.ts","sourceRoot":"","sources":["../src/humanize.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAW,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE9E,OAAO,EAG0D,KAAK,OAAO,EAC5E,MAAM,aAAa,CAAC;AAuBrB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzD,8EAA8E;AAC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