reguard 0.10.1 → 0.11.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.
@@ -6,7 +6,7 @@ import {
6
6
  checkOptions,
7
7
  makeLog,
8
8
  reguardApi
9
- } from "./chunk-4RD66ACT.js";
9
+ } from "./chunk-VZKXPEWQ.js";
10
10
  import {
11
11
  Allowance,
12
12
  BENIGN_TOOL_FAMILIES,
@@ -22,7 +22,7 @@ var ReguardConfigError = class extends TypeError {
22
22
  }
23
23
  };
24
24
  var BLOCK_REASONS = ["flagged", "flagged_server", "require", "pace"];
25
- var LABELS = ["rea", "automated_exploration", "unauthorized_extraction"];
25
+ var LABELS = ["reverse_engineering", "automated_exploration", "unauthorized_extraction"];
26
26
  var STAGES = ["candidate", "alert", "enforce"];
27
27
  var fail = (option, code, detail) => {
28
28
  throw new ReguardConfigError(option, code, detail);
@@ -14,7 +14,7 @@ import {
14
14
  checkNumber,
15
15
  makeLog,
16
16
  reguardApi
17
- } from "./chunk-4RD66ACT.js";
17
+ } from "./chunk-VZKXPEWQ.js";
18
18
  import {
19
19
  Allowance,
20
20
  BENIGN_TOOL_FAMILIES,
@@ -950,7 +950,7 @@ var ReguardConfigError = class extends TypeError {
950
950
  }
951
951
  };
952
952
  var BLOCK_REASONS = ["flagged", "flagged_server", "require", "pace"];
953
- var LABELS = ["rea", "automated_exploration", "unauthorized_extraction"];
953
+ var LABELS = ["reverse_engineering", "automated_exploration", "unauthorized_extraction"];
954
954
  var STAGES = ["candidate", "alert", "enforce"];
955
955
  var fail = (option, code, detail) => {
956
956
  throw new ReguardConfigError(option, code, detail);
@@ -973,7 +973,7 @@ var ReguardConfigError = class extends TypeError {
973
973
  }
974
974
  };
975
975
  var BLOCK_REASONS = ["flagged", "flagged_server", "require", "pace"];
976
- var LABELS = ["rea", "automated_exploration", "unauthorized_extraction"];
976
+ var LABELS = ["reverse_engineering", "automated_exploration", "unauthorized_extraction"];
977
977
  var STAGES = ["candidate", "alert", "enforce"];
978
978
  var fail = (option, code, detail) => {
979
979
  throw new ReguardConfigError(option, code, detail);
@@ -1014,7 +1014,7 @@ var ReguardConfigError = class extends TypeError {
1014
1014
  }
1015
1015
  };
1016
1016
  var BLOCK_REASONS = ["flagged", "flagged_server", "require", "pace"];
1017
- var LABELS = ["rea", "automated_exploration", "unauthorized_extraction"];
1017
+ var LABELS = ["reverse_engineering", "automated_exploration", "unauthorized_extraction"];
1018
1018
  var STAGES = ["candidate", "alert", "enforce"];
1019
1019
  var fail = (option, code, detail) => {
1020
1020
  throw new ReguardConfigError(option, code, detail);
package/dist/cjs/next.cjs CHANGED
@@ -975,7 +975,7 @@ var ReguardConfigError = class extends TypeError {
975
975
  }
976
976
  };
977
977
  var BLOCK_REASONS = ["flagged", "flagged_server", "require", "pace"];
978
- var LABELS = ["rea", "automated_exploration", "unauthorized_extraction"];
978
+ var LABELS = ["reverse_engineering", "automated_exploration", "unauthorized_extraction"];
979
979
  var STAGES = ["candidate", "alert", "enforce"];
980
980
  var fail = (option, code, detail) => {
981
981
  throw new ReguardConfigError(option, code, detail);
package/dist/fastify.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  reguard
3
- } from "./chunks/chunk-RTCPK4MF.js";
3
+ } from "./chunks/chunk-EV6D7UZF.js";
4
4
  import {
5
5
  ReguardConfigError
6
- } from "./chunks/chunk-4RD66ACT.js";
6
+ } from "./chunks/chunk-VZKXPEWQ.js";
7
7
  import "./chunks/chunk-2N762ZXU.js";
8
8
 
9
9
  // src/fastify.ts
package/dist/fetch.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  defaultBlockAnswer,
3
3
  reguardFetch
4
- } from "./chunks/chunk-GOT54CF4.js";
4
+ } from "./chunks/chunk-XCSVBLHF.js";
5
5
  import {
6
6
  ReguardApiError,
7
7
  ReguardConfigError,
8
8
  reguardApi,
9
9
  verifyWebhook
10
- } from "./chunks/chunk-4RD66ACT.js";
10
+ } from "./chunks/chunk-VZKXPEWQ.js";
11
11
  import {
12
12
  WebhookSignatureError
13
13
  } from "./chunks/chunk-2N762ZXU.js";
package/dist/index.js CHANGED
@@ -4,13 +4,13 @@ import {
4
4
  index_default,
5
5
  keyFingerprint,
6
6
  reguard
7
- } from "./chunks/chunk-RTCPK4MF.js";
7
+ } from "./chunks/chunk-EV6D7UZF.js";
8
8
  import {
9
9
  ReguardApiError,
10
10
  ReguardConfigError,
11
11
  reguardApi,
12
12
  verifyWebhook
13
- } from "./chunks/chunk-4RD66ACT.js";
13
+ } from "./chunks/chunk-VZKXPEWQ.js";
14
14
  import {
15
15
  WebhookSignatureError,
16
16
  formatSiteKey,
package/dist/next.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  reguardFetch
3
- } from "./chunks/chunk-GOT54CF4.js";
3
+ } from "./chunks/chunk-XCSVBLHF.js";
4
4
  import {
5
5
  ReguardApiError,
6
6
  ReguardConfigError,
@@ -9,7 +9,7 @@ import {
9
9
  checkCookieDomain,
10
10
  reguardApi,
11
11
  verifyWebhook
12
- } from "./chunks/chunk-4RD66ACT.js";
12
+ } from "./chunks/chunk-VZKXPEWQ.js";
13
13
  import {
14
14
  WebhookSignatureError,
15
15
  collectAttributes,
@@ -58,18 +58,25 @@ export interface InitResponse {
58
58
  config: SdkConfig;
59
59
  }
60
60
  export interface SdkConfig {
61
- debuggerTrap: "main" | "worker" | "off";
61
+ /**
62
+ * The debugger trap (SDK 0.9.5+: served under /node_modules/, which Chrome DevTools ignore-lists, so
63
+ * DevTools doesn't stop there while tools that turn the Debugger on without ignore lists do).
64
+ * "worker" is read as "main". "probe" (lab) runs only the attach probe (SDK 0.9.6), to measure it alone.
65
+ */
66
+ debuggerTrap: "main" | "worker" | "off" | "probe";
62
67
  /** Period of the debugger trap; shorter catches briefer debugger attachments. */
63
68
  trapIntervalMs: number;
69
+ /** Where the trap runs: "public" (default) skips localhost, private addresses and .local/.test hosts; "all" (lab) runs anywhere. */
70
+ trapScope?: "public" | "all";
64
71
  /** Hidden display:none nodes that make DOM snapshots expensive (E tarpit). 0 disables. */
65
72
  tarpitNodes: number;
66
73
  beaconIntervalMs: number;
67
74
  /** Opt-in experimental probes (research), e.g. "ax_mutation", "jit_ratio". */
68
75
  experiments: string[];
69
76
  /**
70
- * Quiet mode (SDK 0.7+): the browser signal and event ids some rule reads. With the debugger trap
71
- * off, the SDK reports only when one of these turns up (plus refreshes a site's server asks for)
72
- * instead of every `beaconIntervalMs`. Absent: the SDK keeps the periodic heartbeat.
77
+ * Quiet mode (SDK 0.7+): the browser signal and event ids some rule reads. The SDK reports only when
78
+ * one of these turns up (plus refreshes a site's server asks for) instead of every
79
+ * `beaconIntervalMs`; from SDK 0.9.5 also with the debugger trap on. Absent: the periodic heartbeat.
73
80
  */
74
81
  news?: string[];
75
82
  }
@@ -89,7 +96,7 @@ export interface BeaconRequest {
89
96
  * neither establishes extraction. Everything else (DevTools, QA automation, assistive technology,
90
97
  * curious customers) is negative unless it meets one of these definitions.
91
98
  */
92
- export type Label = "rea" | "automated_exploration" | "unauthorized_extraction";
99
+ export type Label = "reverse_engineering" | "automated_exploration" | "unauthorized_extraction";
93
100
  /**
94
101
  * Decision outcomes. Uncertainty never becomes an accusation: without a validated alert the
95
102
  * outcome is insufficient_evidence and the session keeps being observed.
@@ -58,18 +58,25 @@ export interface InitResponse {
58
58
  config: SdkConfig;
59
59
  }
60
60
  export interface SdkConfig {
61
- debuggerTrap: "main" | "worker" | "off";
61
+ /**
62
+ * The debugger trap (SDK 0.9.5+: served under /node_modules/, which Chrome DevTools ignore-lists, so
63
+ * DevTools doesn't stop there while tools that turn the Debugger on without ignore lists do).
64
+ * "worker" is read as "main". "probe" (lab) runs only the attach probe (SDK 0.9.6), to measure it alone.
65
+ */
66
+ debuggerTrap: "main" | "worker" | "off" | "probe";
62
67
  /** Period of the debugger trap; shorter catches briefer debugger attachments. */
63
68
  trapIntervalMs: number;
69
+ /** Where the trap runs: "public" (default) skips localhost, private addresses and .local/.test hosts; "all" (lab) runs anywhere. */
70
+ trapScope?: "public" | "all";
64
71
  /** Hidden display:none nodes that make DOM snapshots expensive (E tarpit). 0 disables. */
65
72
  tarpitNodes: number;
66
73
  beaconIntervalMs: number;
67
74
  /** Opt-in experimental probes (research), e.g. "ax_mutation", "jit_ratio". */
68
75
  experiments: string[];
69
76
  /**
70
- * Quiet mode (SDK 0.7+): the browser signal and event ids some rule reads. With the debugger trap
71
- * off, the SDK reports only when one of these turns up (plus refreshes a site's server asks for)
72
- * instead of every `beaconIntervalMs`. Absent: the SDK keeps the periodic heartbeat.
77
+ * Quiet mode (SDK 0.7+): the browser signal and event ids some rule reads. The SDK reports only when
78
+ * one of these turns up (plus refreshes a site's server asks for) instead of every
79
+ * `beaconIntervalMs`; from SDK 0.9.5 also with the debugger trap on. Absent: the periodic heartbeat.
73
80
  */
74
81
  news?: string[];
75
82
  }
@@ -89,7 +96,7 @@ export interface BeaconRequest {
89
96
  * neither establishes extraction. Everything else (DevTools, QA automation, assistive technology,
90
97
  * curious customers) is negative unless it meets one of these definitions.
91
98
  */
92
- export type Label = "rea" | "automated_exploration" | "unauthorized_extraction";
99
+ export type Label = "reverse_engineering" | "automated_exploration" | "unauthorized_extraction";
93
100
  /**
94
101
  * Decision outcomes. Uncertainty never becomes an accusation: without a validated alert the
95
102
  * outcome is insufficient_evidence and the session keeps being observed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reguard",
3
- "version": "0.10.1",
3
+ "version": "0.11.0",
4
4
  "description": "Reguard for your server: catch AI agents and tools reverse engineering your web app. app.use(reguard()) serves /_s/*, adds the script tag, verifies verdicts, blocks (or dry-runs) flagged visitors and sends request summaries (hashes and shapes only). Next.js helpers in reguard/next, fetch runtimes in reguard/fetch, Fastify in reguard/fastify, test helpers in reguard/testing.",
5
5
  "keywords": [
6
6
  "reguard",