@zanii/blackbox 0.20.0 → 0.20.1

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.
@@ -127,7 +127,11 @@ export function tokensOf(usage) {
127
127
  cache_write: written,
128
128
  }, { input_audio: audioIn, output_audio: audioOut });
129
129
  }
130
- if (Object.keys(usage).some((k) => k.startsWith("input_tokens_details_") || k.startsWith("output_tokens_details_"))) {
130
+ // Anthropic's cache names are its own: they win over the Responses shape, since Anthropic also
131
+ // sends output_tokens_details (thinking_tokens) since Claude Sonnet 5
132
+ const anthropicCache = "cache_read_input_tokens" in usage || "cache_creation_input_tokens" in usage;
133
+ if (!anthropicCache &&
134
+ Object.keys(usage).some((k) => k.startsWith("input_tokens_details_") || k.startsWith("output_tokens_details_"))) {
131
135
  const cached = n("input_tokens_details_cached_tokens");
132
136
  const written = n("input_tokens_details_cache_write_tokens");
133
137
  const audioIn = n("input_tokens_details_audio_tokens");
@@ -179,7 +179,11 @@ function value(v) {
179
179
  return JSON.stringify(short);
180
180
  }
181
181
  const isMoment = (e) => {
182
- const status = e.meta?.status;
182
+ const meta = e.meta;
183
+ const status = meta?.status;
184
+ // an allowed policy check (one per local tool call) is routine, not a moment
185
+ if (e.kind === "control" && meta?.action === "policy_check" && meta.decision === "allow")
186
+ return false;
183
187
  return (e.kind === "finding" ||
184
188
  e.kind === "control" ||
185
189
  e.kind === "outcome" ||
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.20.0";
1
+ export declare const VERSION = "0.20.1";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // The SDK version, on its own so the CLI can print it without loading the whole SDK.
2
- export const VERSION = "0.20.0";
2
+ export const VERSION = "0.20.1";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zanii/blackbox",
3
3
  "license": "Apache-2.0",
4
- "version": "0.20.0",
4
+ "version": "0.20.1",
5
5
  "description": "The flight recorder for AI agents: sessions, a zero-loss spool, framework hooks, approvals, and offline verification of the gateway's hash-chained record.",
6
6
  "keywords": [
7
7
  "ai-agents",