agent-sanitizer 2.34.13 → 2.34.14

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.
@@ -32,9 +32,9 @@ import {
32
32
  // (deny/ask for gates, suppression for the output sanitizer) instead.
33
33
  /** @type {typeof import("agent-control-plane-core/claude").claudeAdapter | undefined} */
34
34
  let claudeAdapter;
35
- /** @type {typeof import("agent-control-plane-core").Decision | undefined} */
35
+ /** @type {typeof import("agent-control-plane-core/contract").Decision | undefined} */
36
36
  let Decision;
37
- /** @type {typeof import("agent-control-plane-core").EventKind | undefined} */
37
+ /** @type {typeof import("agent-control-plane-core/contract").EventKind | undefined} */
38
38
  let EventKind;
39
39
 
40
40
  /* c8 ignore start -- module-load boundary: the real import resolves in every
@@ -52,9 +52,13 @@ const loaded = await awaitLazyDependency({
52
52
  /** @type {Partial<typeof import("agent-control-plane-core/claude")>} */ (
53
53
  await lazyImport("agent-control-plane-core/claude")
54
54
  );
55
+ // The /contract subpath, not the package root: the root barrel also pulls
56
+ // all four adapters, the registry and the conformance harness, which costs
57
+ // ~22 ms of import work per process for two enums. A guardrail hook is one
58
+ // process per tool call, so that cost lands on every gated call.
55
59
  const { Decision: decision, EventKind: eventKind } =
56
- /** @type {Partial<typeof import("agent-control-plane-core")>} */ (
57
- await lazyImport("agent-control-plane-core")
60
+ /** @type {Partial<typeof import("agent-control-plane-core/contract")>} */ (
61
+ await lazyImport("agent-control-plane-core/contract")
58
62
  );
59
63
  if (!adapter || !decision || !eventKind) return null;
60
64
  return { claudeAdapter: adapter, Decision: decision, EventKind: eventKind };
@@ -81,8 +85,8 @@ if (loaded) {
81
85
  * @param {{ claudeAdapter?: unknown, Decision?: unknown, EventKind?: unknown }} [overrides]
82
86
  * @returns {{
83
87
  * claudeAdapter: typeof import("agent-control-plane-core/claude").claudeAdapter,
84
- * Decision: typeof import("agent-control-plane-core").Decision,
85
- * EventKind: typeof import("agent-control-plane-core").EventKind,
88
+ * Decision: typeof import("agent-control-plane-core/contract").Decision,
89
+ * EventKind: typeof import("agent-control-plane-core/contract").EventKind,
86
90
  * }}
87
91
  */
88
92
  export function controlPlane(overrides = {}) {
@@ -64,9 +64,10 @@ registerFaultPolicy(HOOK_NAME, {
64
64
  // against a node_modules the plugin does not ship, and every registration would
65
65
  // fail at once.
66
66
  const LAZY_LOADERS = {
67
- "agent-control-plane-core": () => import("agent-control-plane-core"),
68
67
  "agent-control-plane-core/claude": () =>
69
68
  import("agent-control-plane-core/claude"),
69
+ "agent-control-plane-core/contract": () =>
70
+ import("agent-control-plane-core/contract"),
70
71
  "agent-sanitizer": () => import("agent-sanitizer"),
71
72
  "agent-sanitizer/confusables": () => import("agent-sanitizer/confusables"),
72
73
  "agent-sanitizer/instructions": () => import("agent-sanitizer/instructions"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-sanitizer",
3
- "version": "2.34.13",
3
+ "version": "2.34.14",
4
4
  "description": "Defend an agent against hidden-content injection: strip payload-capable invisible Unicode and ANSI, splice out human-invisible HTML, and flag data-exfil URLs in untrusted text before any model sees it.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -202,7 +202,7 @@
202
202
  "SECURITY.md"
203
203
  ],
204
204
  "dependencies": {
205
- "agent-control-plane-core": "0.2.13",
205
+ "agent-control-plane-core": "0.3.0",
206
206
  "css-tree": "^3.2.1",
207
207
  "namespace-guard": "0.20.0",
208
208
  "rehype-parse": "9.0.1",
@@ -5,8 +5,8 @@
5
5
  * @param {{ claudeAdapter?: unknown, Decision?: unknown, EventKind?: unknown }} [overrides]
6
6
  * @returns {{
7
7
  * claudeAdapter: typeof import("agent-control-plane-core/claude").claudeAdapter,
8
- * Decision: typeof import("agent-control-plane-core").Decision,
9
- * EventKind: typeof import("agent-control-plane-core").EventKind,
8
+ * Decision: typeof import("agent-control-plane-core/contract").Decision,
9
+ * EventKind: typeof import("agent-control-plane-core/contract").EventKind,
10
10
  * }}
11
11
  */
12
12
  export function controlPlane(overrides?: {
@@ -15,8 +15,8 @@ export function controlPlane(overrides?: {
15
15
  EventKind?: unknown;
16
16
  }): {
17
17
  claudeAdapter: typeof import("agent-control-plane-core/claude").claudeAdapter;
18
- Decision: typeof import("agent-control-plane-core").Decision;
19
- EventKind: typeof import("agent-control-plane-core").EventKind;
18
+ Decision: typeof import("agent-control-plane-core/contract").Decision;
19
+ EventKind: typeof import("agent-control-plane-core/contract").EventKind;
20
20
  };
21
21
  /**
22
22
  * Serialize a rendered NativeResponse for Claude Code's stdout, or null when