@osqd/bothandlerjs 0.3.0 → 0.5.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/CHANGELOG.md +157 -1
- package/README.md +1 -1
- package/dist/challenge/index.d.ts +18 -0
- package/dist/challenge/interaction.d.ts +215 -0
- package/dist/challenge/page.d.ts +18 -0
- package/dist/cli.cjs +829 -71
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +829 -71
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +10 -0
- package/dist/core.d.ts +15 -0
- package/dist/corpus/index.cjs +20 -0
- package/dist/corpus/index.cjs.map +1 -1
- package/dist/corpus/index.js +20 -0
- package/dist/corpus/index.js.map +1 -1
- package/dist/dashboard/client/actions.d.ts +17 -0
- package/dist/dashboard/client/actor.d.ts +5 -0
- package/dist/dashboard/client/api.d.ts +15 -0
- package/dist/dashboard/client/app.d.ts +37 -0
- package/dist/dashboard/client/bars.d.ts +4 -0
- package/dist/dashboard/client/boot.d.ts +5 -0
- package/dist/dashboard/client/charts.d.ts +25 -0
- package/dist/dashboard/client/css.d.ts +11 -0
- package/dist/dashboard/client/dom.d.ts +55 -0
- package/dist/dashboard/client/draft.d.ts +46 -0
- package/dist/dashboard/client/feed.d.ts +22 -0
- package/dist/dashboard/client/format.d.ts +37 -0
- package/dist/dashboard/client/guard.d.ts +3 -0
- package/dist/dashboard/client/index.d.ts +1 -0
- package/dist/dashboard/client/outcome.d.ts +33 -0
- package/dist/dashboard/client/pager.d.ts +32 -0
- package/dist/dashboard/client/panels.d.ts +40 -0
- package/dist/dashboard/client/policy.d.ts +25 -0
- package/dist/dashboard/client/query.d.ts +42 -0
- package/dist/dashboard/client/ranges.d.ts +2 -0
- package/dist/dashboard/client/registry.d.ts +4 -0
- package/dist/dashboard/client/replay.d.ts +14 -0
- package/dist/dashboard/client/result.d.ts +10 -0
- package/dist/dashboard/client/store.d.ts +128 -0
- package/dist/dashboard/client/stream.d.ts +14 -0
- package/dist/dashboard/client/tester.d.ts +1 -0
- package/dist/dashboard/client/types.d.ts +69 -0
- package/dist/dashboard/client.generated.d.ts +1 -1
- package/dist/dashboard/page.d.ts +25 -0
- package/dist/dashboard/sections.d.ts +92 -0
- package/dist/dashboard/types.d.ts +2 -82
- package/dist/detectors/crawler-verification.d.ts +34 -1
- package/dist/detectors/index.d.ts +4 -1
- package/dist/detectors/known-bots.d.ts +49 -1
- package/dist/element/config.d.ts +135 -0
- package/dist/element/index.cjs +5150 -0
- package/dist/element/index.cjs.map +1 -0
- package/dist/element/index.d.ts +137 -0
- package/dist/element/index.js +5131 -0
- package/dist/element/index.js.map +1 -0
- package/dist/index.cjs +820 -71
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +811 -71
- package/dist/index.js.map +1 -1
- package/dist/metrics.d.ts +27 -0
- package/dist/policy/index.d.ts +1 -1
- package/dist/policy/presets.d.ts +47 -0
- package/dist/state.d.ts +1 -1
- package/docs/challenge/index.md +1 -0
- package/docs/challenge/interaction.md +325 -0
- package/docs/course/11-the-challenge.md +36 -1
- package/docs/course/13-operating-it.md +20 -2
- package/docs/detection/signatures.md +36 -0
- package/docs/index.md +2 -0
- package/docs/operations/dashboard.md +28 -0
- package/docs/operations/embedding.md +348 -0
- package/docs/operations/index.md +1 -0
- package/docs/policy/presets.md +53 -0
- package/docs/start/choosing-a-policy.md +1 -0
- package/package.json +8 -3
package/dist/config.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { PresetName } from "./policy/presets.js";
|
|
|
3
3
|
import type { Clock } from "./internal/clock.js";
|
|
4
4
|
import type { DnsResolver } from "./internal/dns.js";
|
|
5
5
|
import type { Detector } from "./detectors/types.js";
|
|
6
|
+
import type { CrawlerVerificationOptions } from "./detectors/crawler-verification.js";
|
|
6
7
|
import type { BotSignature } from "./detectors/known-bots.js";
|
|
7
8
|
import type { ActionParams, FalsePositivePolicy, Rule } from "./policy/types.js";
|
|
8
9
|
import type { CustomHandler } from "./actions/types.js";
|
|
@@ -60,6 +61,15 @@ export interface BotHandlerConfig {
|
|
|
60
61
|
detectors?: readonly Detector[];
|
|
61
62
|
/** Appended to the built-in set. Ignored when `detectors` is given. */
|
|
62
63
|
extraDetectors?: readonly Detector[];
|
|
64
|
+
/**
|
|
65
|
+
* How claimed crawler identities are confirmed or refuted.
|
|
66
|
+
*
|
|
67
|
+
* Chiefly `verifiers`: your own answer to "is this really Googlebot", for the many
|
|
68
|
+
* identities that publish no proof this library can check on its own. Also the two
|
|
69
|
+
* strictness flags, which were documented on the detector and reachable only by
|
|
70
|
+
* rebuilding the whole detector list.
|
|
71
|
+
*/
|
|
72
|
+
crawlerVerification?: CrawlerVerificationOptions;
|
|
63
73
|
/** A named starting policy. Combined with `rules`, which are evaluated first. */
|
|
64
74
|
preset?: PresetName;
|
|
65
75
|
/** Your own rules, evaluated before any preset's. */
|
package/dist/core.d.ts
CHANGED
|
@@ -50,9 +50,24 @@ export interface BotHandlerEvents extends Record<string, unknown> {
|
|
|
50
50
|
decision: Decision;
|
|
51
51
|
};
|
|
52
52
|
/** A challenge was issued, solved or rejected. */
|
|
53
|
+
/**
|
|
54
|
+
* A challenge was issued, solved or turned down.
|
|
55
|
+
*
|
|
56
|
+
* `level`, `score` and `reason` are present only when the interaction challenge is on,
|
|
57
|
+
* and they are the whole basis for tuning it: without the score distribution an
|
|
58
|
+
* operator moving `interactionAt` is guessing, and without the reason a rise in
|
|
59
|
+
* rejections says nothing about whether the cause is bots or a browser that cannot
|
|
60
|
+
* run a probe.
|
|
61
|
+
*/
|
|
53
62
|
challenge: {
|
|
54
63
|
phase: "issued" | "solved" | "rejected";
|
|
55
64
|
actorKey?: string | undefined;
|
|
65
|
+
/** Clearance granted, on a solve. */
|
|
66
|
+
level?: "pow" | "interaction" | "operator" | undefined;
|
|
67
|
+
/** Interaction score, 0–1, when one was computed. */
|
|
68
|
+
score?: number | undefined;
|
|
69
|
+
/** Why it was turned down. */
|
|
70
|
+
reason?: string | undefined;
|
|
56
71
|
};
|
|
57
72
|
/**
|
|
58
73
|
* A detector threw or timed out.
|
package/dist/corpus/index.cjs
CHANGED
|
@@ -3462,6 +3462,26 @@ var REPUTATION_CASES = [
|
|
|
3462
3462
|
requests: [browser("chromeWindows")],
|
|
3463
3463
|
expect: { verdict: "human", certain: true, detectors: ["clearance"], action: ["allow", "log", "tag"] }
|
|
3464
3464
|
}),
|
|
3465
|
+
human({
|
|
3466
|
+
id: "cleared-by-interaction",
|
|
3467
|
+
title: "A person who ticked the box on the interaction challenge",
|
|
3468
|
+
category: "clearance",
|
|
3469
|
+
provenance: "A signed clearance cookie granted after a trusted activation on a browser that passed the capability probes",
|
|
3470
|
+
notes: "`strong` human evidence rather than `certain`, and the gap is the whole point. A trusted gesture in a rendering browser is a real cost imposed and it is still not proof of a person: a browser driven through the DevTools protocol dispatches genuine input events and renders genuine CSS. It outranks a bare proof of work because it costs more, and it stops short of `operator` because that assertion comes from the application and this one comes from the client.",
|
|
3471
|
+
clearance: "interaction",
|
|
3472
|
+
requests: [browser("chromeWindows")],
|
|
3473
|
+
expect: { detectors: ["clearance"], neverAction: ["block", "drop", "redirect"] }
|
|
3474
|
+
}),
|
|
3475
|
+
human({
|
|
3476
|
+
id: "cleared-by-interaction-on-a-phone",
|
|
3477
|
+
title: "A person who tapped the box on a phone",
|
|
3478
|
+
category: "clearance",
|
|
3479
|
+
provenance: "A tap emits almost no pointermove, so the report carries no path at all",
|
|
3480
|
+
notes: "Kept because the absence of a pointer path used to be scored as a mark against the client, which graded every phone \u2014 and every screen reader, switch and voice-control user \u2014 down to the weaker clearance for the way they use a computer. A tap is reported as touch and graded on its capabilities.",
|
|
3481
|
+
clearance: "interaction",
|
|
3482
|
+
requests: [browser("safariIos")],
|
|
3483
|
+
expect: { detectors: ["clearance"], neverAction: ["block", "drop", "redirect"] }
|
|
3484
|
+
}),
|
|
3465
3485
|
bot({
|
|
3466
3486
|
id: "cleared-but-proven-bot",
|
|
3467
3487
|
title: "A proven bot presenting a valid clearance token",
|