@zanii/blackbox 0.21.2 → 0.23.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.
Files changed (95) hide show
  1. package/README.md +1 -0
  2. package/dist/actions/index.d.ts +29 -0
  3. package/dist/actions/index.js +114 -0
  4. package/dist/admission/index.d.ts +30 -0
  5. package/dist/admission/index.js +106 -0
  6. package/dist/analysis/accepted.d.ts +26 -0
  7. package/dist/analysis/accepted.js +61 -0
  8. package/dist/analysis/detectors.js +12 -9
  9. package/dist/analysis/faults.js +71 -0
  10. package/dist/analysis/grounding.js +5 -9
  11. package/dist/analysis/guard.d.ts +72 -0
  12. package/dist/analysis/guard.js +240 -0
  13. package/dist/analysis/hallucination.js +2 -2
  14. package/dist/analysis/index.d.ts +21 -1
  15. package/dist/analysis/index.js +101 -19
  16. package/dist/analysis/injection.d.ts +2 -1
  17. package/dist/analysis/injection.js +16 -16
  18. package/dist/analysis/landing.js +60 -14
  19. package/dist/analysis/plan-checks.d.ts +55 -0
  20. package/dist/analysis/plan-checks.js +748 -0
  21. package/dist/analysis/taxonomy.js +1 -0
  22. package/dist/analysis/waste.js +2 -3
  23. package/dist/approvals/index.d.ts +12 -3
  24. package/dist/approvals/index.js +36 -10
  25. package/dist/authority/index.js +3 -3
  26. package/dist/aviation/index.d.ts +422 -0
  27. package/dist/aviation/index.js +1014 -0
  28. package/dist/aviation/qrh.d.ts +4 -0
  29. package/dist/aviation/qrh.js +171 -0
  30. package/dist/budgets/index.d.ts +63 -0
  31. package/dist/budgets/index.js +161 -0
  32. package/dist/cli.js +199 -24
  33. package/dist/compliance/index.d.ts +2 -0
  34. package/dist/compliance/index.js +26 -2
  35. package/dist/cost/batch.d.ts +26 -0
  36. package/dist/cost/batch.js +173 -0
  37. package/dist/cost/index.d.ts +21 -0
  38. package/dist/cost/index.js +115 -30
  39. package/dist/cv/index.js +1 -1
  40. package/dist/duty/index.js +2 -1
  41. package/dist/evals/index.d.ts +233 -0
  42. package/dist/evals/index.js +488 -0
  43. package/dist/evidence/index.d.ts +9 -0
  44. package/dist/evidence/index.js +50 -0
  45. package/dist/federation/index.d.ts +9 -0
  46. package/dist/federation/index.js +8 -1
  47. package/dist/finance/index.js +3 -4
  48. package/dist/fleet/index.d.ts +25 -0
  49. package/dist/fleet/index.js +57 -17
  50. package/dist/fleet/insights.js +4 -1
  51. package/dist/health/index.js +2 -2
  52. package/dist/hooks/ai-sdk.d.ts +17 -19
  53. package/dist/hooks/ai-sdk.js +13 -7
  54. package/dist/hooks/index.d.ts +1 -0
  55. package/dist/hooks/index.js +1 -0
  56. package/dist/hooks/mastra.d.ts +26 -0
  57. package/dist/hooks/mastra.js +63 -0
  58. package/dist/index.d.ts +24 -9
  59. package/dist/index.js +25 -9
  60. package/dist/mcp-requests/index.d.ts +26 -0
  61. package/dist/mcp-requests/index.js +154 -0
  62. package/dist/mcp-server/index.d.ts +12 -0
  63. package/dist/mcp-server/index.js +84 -2
  64. package/dist/mcp-wrap/index.js +8 -4
  65. package/dist/otlp/index.d.ts +155 -0
  66. package/dist/otlp/index.js +468 -0
  67. package/dist/otlp/protobuf.d.ts +7 -0
  68. package/dist/otlp/protobuf.js +314 -0
  69. package/dist/packs/index.d.ts +2 -0
  70. package/dist/packs/index.js +5 -1
  71. package/dist/pdf/arabic.d.ts +45 -0
  72. package/dist/pdf/arabic.js +373 -0
  73. package/dist/pdf/index.d.ts +77 -0
  74. package/dist/pdf/index.js +673 -0
  75. package/dist/policy/index.d.ts +0 -4
  76. package/dist/policy/index.js +13 -5
  77. package/dist/realtime/index.d.ts +33 -0
  78. package/dist/realtime/index.js +204 -0
  79. package/dist/reconcile/record.d.ts +14 -0
  80. package/dist/reconcile/record.js +161 -66
  81. package/dist/session/index.d.ts +43 -0
  82. package/dist/session/index.js +83 -0
  83. package/dist/undo/index.js +3 -3
  84. package/dist/verify/anchor.d.ts +5 -1
  85. package/dist/verify/anchor.js +13 -4
  86. package/dist/verify/chain.d.ts +4 -0
  87. package/dist/verify/chain.js +4 -3
  88. package/dist/verify/envelope.d.ts +1 -1
  89. package/dist/verify/envelope.js +5 -0
  90. package/dist/version.d.ts +1 -1
  91. package/dist/version.js +1 -1
  92. package/dist/walls/index.js +2 -2
  93. package/dist/warehouse/index.d.ts +62 -0
  94. package/dist/warehouse/index.js +142 -0
  95. package/package.json +6 -3
@@ -46,6 +46,17 @@ export interface Summary {
46
46
  self_changes?: SelfChangeEntry[];
47
47
  /** spec/fleet.md §9: approvals a person decided here, the first 50: id → approve | reject */
48
48
  approvals?: Record<string, "approve" | "reject">;
49
+ /** spec/evals.md §4: the prompt version the run declared (an experiment's arm, or the SDK) */
50
+ prompt_version?: {
51
+ name: string;
52
+ version: number;
53
+ via: "experiment" | "sdk";
54
+ };
55
+ /** spec/evals.md §5: the experiment and arm the session was assigned to */
56
+ experiment?: {
57
+ id: string;
58
+ arm: string;
59
+ };
49
60
  }
50
61
  export interface SelfChangeEntry {
51
62
  seq: number;
@@ -95,6 +106,12 @@ export interface Collision {
95
106
  seq: number;
96
107
  }>;
97
108
  }
109
+ /** A session's changes (spec/fleet.md §4): each changing tool call and its resource, by seq. */
110
+ export declare function resourceChanges(lines: readonly string[], bodies: Bodies): Array<{
111
+ seq: number;
112
+ tool: string;
113
+ resource: string;
114
+ }>;
98
115
  /** Changes to the same resource from two or more sessions (A7), by resource; each session's first change. */
99
116
  export declare function collisions(records: ReadonlyArray<{
100
117
  lines: readonly string[];
@@ -150,6 +167,14 @@ export declare function signCertificate<T extends Record<string, unknown>>(cert:
150
167
  sig: string;
151
168
  };
152
169
  };
170
+ /** spec/anchoring.md §15: `signCertificate` with a key held outside the process (`sign` returns
171
+ * the raw 64-byte Ed25519 signature). Same bytes as `signCertificate` with the same key. */
172
+ export declare function signCertificateWith<T extends Record<string, unknown>>(cert: T, did: string, sign: (message: Uint8Array) => Promise<Uint8Array>): Promise<T & {
173
+ signed: {
174
+ by: string;
175
+ sig: string;
176
+ };
177
+ }>;
153
178
  /** Checks a signed certificate offline, from the signer's did:key alone. */
154
179
  export declare function verifyCertificate(cert: Record<string, unknown>, expectedDid?: string): {
155
180
  ok: boolean;
@@ -10,6 +10,37 @@ import { authorityTimeline } from "../authority/index.js";
10
10
  import { formatAed, sessionCost, toAedFils } from "../cost/index.js";
11
11
  import { callsOf } from "../reconcile/record.js";
12
12
  import { canonical } from "../reconcile/shared.js";
13
+ const PROMPT_NAME = /^[A-Za-z0-9._-]{1,128}$/;
14
+ /** spec/evals.md §4-§5: the first prompt version a run declared, and its experiment's arm. */
15
+ function promptOf(evs) {
16
+ const named = (name, version) => typeof name === "string" &&
17
+ PROMPT_NAME.test(name) &&
18
+ typeof version === "number" &&
19
+ Number.isSafeInteger(version) &&
20
+ version >= 1;
21
+ for (const e of evs) {
22
+ const m = e.meta;
23
+ if (e.kind === "control" &&
24
+ m.action === "experiment" &&
25
+ typeof m.experiment === "string" &&
26
+ typeof m.arm === "string" &&
27
+ named(m.prompt, m.version))
28
+ return {
29
+ prompt_version: {
30
+ name: m.prompt,
31
+ version: m.version,
32
+ via: "experiment",
33
+ },
34
+ experiment: { id: m.experiment, arm: m.arm },
35
+ };
36
+ const d = e.data ?? {};
37
+ if (e.kind === "sdk.event" && m.type === "prompt_version" && named(d.name, d.version))
38
+ return {
39
+ prompt_version: { name: d.name, version: d.version, via: "sdk" },
40
+ };
41
+ }
42
+ return {};
43
+ }
13
44
  /** An approval id: what a lesson may point at, and nothing else (spec/fleet.md §9). */
14
45
  export const APPROVAL_ID = /^apr_[0-9a-f]{18}$/;
15
46
  /** spec/fleet.md §9: a Zanii Evolve certificate's digest (`sha256:` + 64 hex, or the 64 hex its
@@ -173,6 +204,7 @@ export function sessionSummary(lines, bodies, prices) {
173
204
  ...(humanSteps ? { human_steps: humanSteps } : {}),
174
205
  ...(selfChanges.length ? { self_changes: selfChanges } : {}),
175
206
  ...(decided ? { approvals } : {}),
207
+ ...promptOf(evs),
176
208
  };
177
209
  }
178
210
  const T = {
@@ -350,6 +382,24 @@ function resourceOf(tool, args) {
350
382
  }
351
383
  return undefined;
352
384
  }
385
+ /** A session's changes (spec/fleet.md §4): each changing tool call and its resource, by seq. */
386
+ export function resourceChanges(lines, bodies) {
387
+ const touches = [];
388
+ for (const t of toolCallsOf(callsOf(lines, bodies))) {
389
+ const res = resourceOf(t.tool, t.args);
390
+ if (res !== undefined)
391
+ touches.push({ seq: t.seq, tool: t.tool, resource: res });
392
+ }
393
+ for (const line of lines) {
394
+ const e = JSON.parse(line);
395
+ if (e.kind !== "tool.call" || e.meta.method !== "tools/call" || typeof e.meta.tool !== "string")
396
+ continue;
397
+ const res = resourceOf(e.meta.tool, mcpArgs(bodies(e.body_hash)));
398
+ if (res !== undefined)
399
+ touches.push({ seq: e.seq, tool: e.meta.tool, resource: res });
400
+ }
401
+ return touches.sort((a, b) => a.seq - b.seq);
402
+ }
353
403
  /** Changes to the same resource from two or more sessions (A7), by resource; each session's first change. */
354
404
  export function collisions(records) {
355
405
  const by = new Map();
@@ -363,23 +413,7 @@ export function collisions(records) {
363
413
  if (r.lines.length === 0)
364
414
  continue;
365
415
  const sid = JSON.parse(r.lines[0]).session_id;
366
- const touches = [];
367
- for (const t of toolCallsOf(callsOf(r.lines, r.bodies))) {
368
- const res = resourceOf(t.tool, t.args);
369
- if (res !== undefined)
370
- touches.push({ seq: t.seq, tool: t.tool, resource: res });
371
- }
372
- for (const line of r.lines) {
373
- const e = JSON.parse(line);
374
- if (e.kind !== "tool.call" ||
375
- e.meta.method !== "tools/call" ||
376
- typeof e.meta.tool !== "string")
377
- continue;
378
- const res = resourceOf(e.meta.tool, mcpArgs(r.bodies(e.body_hash)));
379
- if (res !== undefined)
380
- touches.push({ seq: e.seq, tool: e.meta.tool, resource: res });
381
- }
382
- for (const t of touches.sort((a, b) => a.seq - b.seq))
416
+ for (const t of resourceChanges(r.lines, r.bodies))
383
417
  touch(t.resource, sid, t.tool, t.seq);
384
418
  }
385
419
  return [...by.keys()]
@@ -498,6 +532,12 @@ export function signCertificate(cert, did, seed) {
498
532
  const sig = signBytes(null, unsigned(cert), key).toString("hex");
499
533
  return { ...cert, signed: { by: did, sig: `ed25519:${sig}` } };
500
534
  }
535
+ /** spec/anchoring.md §15: `signCertificate` with a key held outside the process (`sign` returns
536
+ * the raw 64-byte Ed25519 signature). Same bytes as `signCertificate` with the same key. */
537
+ export async function signCertificateWith(cert, did, sign) {
538
+ const sig = Buffer.from(await sign(unsigned(cert))).toString("hex");
539
+ return { ...cert, signed: { by: did, sig: `ed25519:${sig}` } };
540
+ }
501
541
  /** Checks a signed certificate offline, from the signer's did:key alone. */
502
542
  export function verifyCertificate(cert, expectedDid) {
503
543
  const s = cert.signed;
@@ -181,9 +181,12 @@ function value(v) {
181
181
  const isMoment = (e) => {
182
182
  const meta = e.meta;
183
183
  const status = meta?.status;
184
- // an allowed policy check (one per local tool call) is routine, not a moment
184
+ // an allowed policy check (one per local tool call) is routine, not a moment; so is an
185
+ // allowed guard decision (spec/guard.md §8)
185
186
  if (e.kind === "control" && meta?.action === "policy_check" && meta.decision === "allow")
186
187
  return false;
188
+ if (e.kind === "control" && meta?.action === "guard" && meta.verdict === "allow")
189
+ return false;
187
190
  return (e.kind === "finding" ||
188
191
  e.kind === "control" ||
189
192
  e.kind === "outcome" ||
@@ -5,6 +5,7 @@
5
5
  import { createHash, randomBytes } from "node:crypto";
6
6
  import { createConfirmation, jcsHash } from "@zanii/core";
7
7
  import { verifyConfirmation } from "../approvals/index.js";
8
+ import { envelopesOf } from "../reconcile/record.js";
8
9
  import { canonical } from "../reconcile/shared.js";
9
10
  const TAG = /^sha256:[0-9a-f]{64}$/;
10
11
  const HEX64 = /^[0-9a-f]{64}$/;
@@ -180,8 +181,7 @@ export function healthFindings(lines, bodies, closing = false) {
180
181
  const recommendations = [];
181
182
  const confirmed = new Set();
182
183
  let closed = closing;
183
- for (const l of lines) {
184
- const e = JSON.parse(l);
184
+ for (const e of envelopesOf(lines)) {
185
185
  if (e.kind === "session.close")
186
186
  closed = true;
187
187
  if (e.kind !== "sdk.event" || !String(e.meta.type).startsWith("health."))
@@ -12,31 +12,29 @@ type Part = {
12
12
  input?: unknown;
13
13
  };
14
14
  /** For `wrapLanguageModel({ model, middleware })`: every generate and stream is observed; what the
15
- * model returns reaches the app unchanged. */
16
- export declare function blackboxMiddleware(sink: EventSink): {
17
- wrapGenerate({ doGenerate, model, }: {
18
- doGenerate: () => Promise<{
19
- content?: Part[];
20
- response?: {
21
- id?: string;
22
- modelId?: string;
23
- };
24
- }>;
25
- model?: ModelInfo;
26
- }): Promise<{
15
+ * model returns reaches the app unchanged. `toolCalls: false` leaves the tool calls the model asks
16
+ * for to a hook that sees them run (Mastra's exporter, G21). */
17
+ export declare function blackboxMiddleware(sink: EventSink, options?: {
18
+ toolCalls?: boolean;
19
+ }): {
20
+ specificationVersion: "v3";
21
+ wrapGenerate<R extends {
27
22
  content?: Part[];
28
23
  response?: {
29
24
  id?: string;
30
25
  modelId?: string;
31
26
  };
32
- }>;
33
- wrapStream({ doStream, model, }: {
34
- doStream: () => Promise<{
35
- stream: ReadableStream<Part>;
36
- }>;
27
+ }>({ doGenerate, model }: {
28
+ doGenerate: () => PromiseLike<R>;
37
29
  model?: ModelInfo;
38
- }): Promise<{
30
+ }): Promise<R>;
31
+ wrapStream<S extends {
39
32
  stream: ReadableStream<Part>;
40
- }>;
33
+ }, P extends Part>({ doStream, model, }: {
34
+ doStream: () => PromiseLike<S & {
35
+ stream: ReadableStream<P>;
36
+ }>;
37
+ model?: ModelInfo;
38
+ }): Promise<S>;
41
39
  };
42
40
  export {};
@@ -29,15 +29,20 @@ function reportTool(sink, p) {
29
29
  });
30
30
  }
31
31
  /** For `wrapLanguageModel({ model, middleware })`: every generate and stream is observed; what the
32
- * model returns reaches the app unchanged. */
33
- export function blackboxMiddleware(sink) {
32
+ * model returns reaches the app unchanged. `toolCalls: false` leaves the tool calls the model asks
33
+ * for to a hook that sees them run (Mastra's exporter, G21). */
34
+ export function blackboxMiddleware(sink, options = {}) {
35
+ const tools = options.toolCalls ?? true;
34
36
  return {
35
- async wrapGenerate({ doGenerate, model, }) {
37
+ // AI SDK 6 types its middleware by the model spec it wraps; AI SDK 5 ignores the field (G21)
38
+ specificationVersion: "v3",
39
+ async wrapGenerate({ doGenerate, model }) {
36
40
  const result = await doGenerate();
37
41
  neverThrow(() => {
38
42
  reportCall(sink, model, result.response?.id, result.response?.modelId);
39
- for (const p of result.content ?? [])
40
- reportTool(sink, p);
43
+ if (tools)
44
+ for (const p of result.content ?? [])
45
+ reportTool(sink, p);
41
46
  });
42
47
  return result;
43
48
  },
@@ -51,12 +56,13 @@ export function blackboxMiddleware(sink) {
51
56
  reported = true;
52
57
  reportCall(sink, model, chunk.id, chunk.modelId);
53
58
  }
54
- reportTool(sink, chunk);
59
+ if (tools)
60
+ reportTool(sink, chunk);
55
61
  });
56
62
  controller.enqueue(chunk);
57
63
  },
58
64
  }));
59
- return { stream: observed, ...rest };
65
+ return { ...rest, stream: observed };
60
66
  },
61
67
  };
62
68
  }
@@ -1,6 +1,7 @@
1
1
  export { blackboxMiddleware } from "./ai-sdk.ts";
2
2
  export { BlackboxAgentHooks, blackboxAgentHooks } from "./claude-agent-sdk.ts";
3
3
  export { BlackboxCallbackHandler, type BlackboxCallbacks, blackboxCallbacks } from "./langchain.ts";
4
+ export { blackboxMastraExporter } from "./mastra.ts";
4
5
  export { type MemorySink, type TrackMemoryOptions, trackMemory } from "./memory.ts";
5
6
  export { attachBlackbox } from "./openai-agents.ts";
6
7
  export { llmIdsOf, wrapAnthropic, wrapBedrock, wrapGemini, wrapOpenAI } from "./providers.ts";
@@ -4,6 +4,7 @@
4
4
  export { blackboxMiddleware } from "./ai-sdk.js";
5
5
  export { BlackboxAgentHooks, blackboxAgentHooks } from "./claude-agent-sdk.js";
6
6
  export { BlackboxCallbackHandler, blackboxCallbacks } from "./langchain.js";
7
+ export { blackboxMastraExporter } from "./mastra.js";
7
8
  export { trackMemory } from "./memory.js";
8
9
  export { attachBlackbox } from "./openai-agents.js";
9
10
  export { llmIdsOf, wrapAnthropic, wrapBedrock, wrapGemini, wrapOpenAI } from "./providers.js";
@@ -0,0 +1,26 @@
1
+ import { type EventSink } from "./shared.ts";
2
+ interface Span {
3
+ type?: string;
4
+ name?: string;
5
+ entityName?: string;
6
+ entityId?: string;
7
+ input?: unknown;
8
+ attributes?: object;
9
+ errorInfo?: {
10
+ message?: string;
11
+ name?: string;
12
+ };
13
+ isEvent?: boolean;
14
+ }
15
+ interface TracingEvent {
16
+ type?: string;
17
+ exportedSpan?: Span;
18
+ }
19
+ /** For `exporters: [...]` in a Mastra observability config. Records only; never throws. */
20
+ export declare function blackboxMastraExporter(sink: EventSink): {
21
+ name: string;
22
+ exportTracingEvent(event: TracingEvent): Promise<void>;
23
+ flush(): Promise<void>;
24
+ shutdown(): Promise<void>;
25
+ };
26
+ export {};
@@ -0,0 +1,63 @@
1
+ // Mastra (G21, spec/sdk.md §5): an observability exporter that turns Mastra's tracing spans into
2
+ // session events: agent runs, tool calls and their results, model-call failures. Typed structurally
3
+ // on Mastra's `ObservabilityExporter`: no dependency on `@mastra/core`.
4
+ //
5
+ // import { Observability } from "@mastra/observability";
6
+ // new Mastra({ agents, observability: new Observability({ configs: { blackbox: {
7
+ // serviceName: "payments", exporters: [blackboxMastraExporter(session)] } } }) });
8
+ //
9
+ // Mastra's spans carry the provider's response id of a generation's last model call only, so the
10
+ // model-call ids come from the AI SDK middleware on the agent's model (ai-sdk.ts), with its own
11
+ // tool-call reports off (this exporter records the tool calls as they run):
12
+ // model: wrapLanguageModel({ model, middleware: blackboxMiddleware(session, { toolCalls: false }) })
13
+ import { neverThrow } from "./shared.js";
14
+ const MAX_ERROR = 500;
15
+ const str = (v) => (typeof v === "string" && v ? v : undefined);
16
+ /** For `exporters: [...]` in a Mastra observability config. Records only; never throws. */
17
+ export function blackboxMastraExporter(sink) {
18
+ const record = ({ type, exportedSpan: span }) => {
19
+ if (!span)
20
+ return;
21
+ const a = (span.attributes ?? {});
22
+ const name = (span.entityName ?? span.entityId ?? span.name ?? "").slice(0, 256);
23
+ const callId = str(a.toolCallId);
24
+ const ids = callId ? { call_id: callId } : {};
25
+ const tool = span.type === "tool_call" || span.type === "mcp_tool_call";
26
+ if (type === "span_started") {
27
+ if (span.type === "agent_run")
28
+ sink.event("step", name || "agent", {});
29
+ else if (tool)
30
+ sink.event("tool.call", name || "tool", {
31
+ ...ids,
32
+ ...(span.input === undefined ? {} : { args: span.input }),
33
+ });
34
+ return;
35
+ }
36
+ if (type !== "span_ended")
37
+ return;
38
+ if (tool) {
39
+ const failed = span.errorInfo !== undefined || a.success === false;
40
+ sink.event("tool.result", name || "tool", {
41
+ ok: !failed,
42
+ ...ids,
43
+ ...(span.errorInfo
44
+ ? { error: String(span.errorInfo.message ?? "").slice(0, MAX_ERROR) }
45
+ : {}),
46
+ });
47
+ }
48
+ else if (span.type === "model_generation" && span.errorInfo) {
49
+ sink.event("llm.error", undefined, {
50
+ error: String(span.errorInfo.message ?? "").slice(0, MAX_ERROR),
51
+ type: span.errorInfo.name ?? "Error",
52
+ });
53
+ }
54
+ };
55
+ return {
56
+ name: "zanii-blackbox",
57
+ async exportTracingEvent(event) {
58
+ neverThrow(() => record(event));
59
+ },
60
+ async flush() { },
61
+ async shutdown() { },
62
+ };
63
+ }
package/dist/index.d.ts CHANGED
@@ -1,25 +1,34 @@
1
+ export { publicKeyFromDid } from "@zanii/core";
1
2
  export { A2A_STREAMING, type AgentCardReport, a2aMethod, a2aRequestMeta, a2aResponseMeta, a2aRestMethod, a2aRestRequestMeta, a2aRestResponseMeta, agentCardDigest, agentCardPayload, gatewayCardKey, rewriteAgentCard, verifyAgentCard, } from "./a2a/index.ts";
3
+ export { type Action, actionsFromCalls, actionsOf, actionsPage, type Reasoning, } from "./actions/index.ts";
4
+ export { ACCREDITATION_TYPE, type AccreditationRefusal, checkAccreditation, checkRegister, docHash, REGISTER_TYPE, SERVICE_ID, type ServiceRow, serviceTier, } from "./admission/index.ts";
2
5
  export { causality, memoryXray } from "./agents/index.ts";
6
+ export { type AcceptedEntry, acceptedHash, acceptedMatch, checkAcceptedFindings, } from "./analysis/accepted.ts";
3
7
  export { type DetectorOptions, detectors, fingerprint } from "./analysis/detectors.ts";
4
8
  export { FAULTS, type Fault, faultOf } from "./analysis/faults.ts";
5
- export { type Accuracy, type AnalyzeOptions, type AnswerClaims, analyze, answerClaims, answerCredential, answerRisk, answersOf, answerText, type ClaimEntry, type ClaimVerdict, type CriterionResult, canonicalNumber, checkAgainstPacks, checkFlightPlan, checkpointReplay, detectorAccuracy, dualWitness, Evidence, eventsOf, type Fact, type Finding as AnalysisFinding, factsIn, findingKey, type GroundedClaim, groundingFindings, groundingRequest, growth, HOLD_TRIGGERS, identifiersIn, isoWeek, judgeFindings, judgeRequest, type Label as AccuracyLabel, type Landing, landing, lessons, loadReferencePacks, modelGroundingFindings, normaliseValue, OUTCOMES, type Outcome, type OutcomeRollup, packsFor, parseGroundingAnswer, parseJudgeAnswer, promptChanged, type ReferenceFact, type ReferencePack, type ReferenceVerdict, referenceContext, rollup, type Severity, schemaProblem, secretSent, selfChanges, successRange, systemPromptHash, toolDrifted, toolHallucinations, toolsHash, userDownvotes, verifyAnswerCredential, type WasteReason, type WasteReport, waste, wilsonLow, } from "./analysis/index.ts";
9
+ export { type GuardCall, type GuardConfig, type GuardFinding, type GuardMode, type GuardState, type GuardToolResult, type GuardVerdict, guardCheck, guardMode, guardObserve, guardPin, guardState, guardToolResults, loadGuardConfig, } from "./analysis/guard.ts";
10
+ export { type Accuracy, type AnalyzeOptions, Analyzer, type AnswerClaims, analyze, answerClaims, answerCredential, answerRisk, answersOf, answerText, type ClaimEntry, type ClaimVerdict, type CriterionResult, canonicalNumber, checkAgainstPacks, checkFlightPlan, checkpointReplay, detectorAccuracy, dualWitness, Evidence, elicitationSecret, eventsOf, type Fact, type Finding as AnalysisFinding, factsIn, findingKey, type GroundedClaim, groundingFindings, groundingRequest, growth, HOLD_TRIGGERS, identifiersIn, isoWeek, judgeFindings, judgeRequest, type Label as AccuracyLabel, type Landing, landing, lessons, loadReferencePacks, modelGroundingFindings, normaliseValue, OUTCOMES, type Outcome, type OutcomeRollup, packsFor, parseGroundingAnswer, parseJudgeAnswer, promptChanged, type ReferenceFact, type ReferencePack, type ReferenceVerdict, referenceContext, rollup, type Severity, schemaProblem, secretSent, selfChanges, successRange, systemPromptHash, toolDrifted, toolHallucinations, toolsHash, userDownvotes, verifyAnswerCredential, type WasteReason, type WasteReport, waste, wilsonLow, } from "./analysis/index.ts";
6
11
  export { injectionFindings, injectionRule } from "./analysis/injection.ts";
12
+ export { checkPredicate, checkSchema, compilePattern, milliOf, patternMatches, schemaError, } from "./analysis/plan-checks.ts";
7
13
  export { MITRE_ATLAS, OWASP_ASI, TAXONOMY, type Taxonomy, taxonomyOf, } from "./analysis/taxonomy.ts";
8
- export { type ApprovalFinding, approvalConfirmation, approvalFindings, argsHash, verifyConfirmation, } from "./approvals/index.ts";
14
+ export { type ApprovalFinding, approvalConfirmation, approvalConfirmationWith, approvalFindings, argsHash, verifyConfirmation, } from "./approvals/index.ts";
9
15
  export { textWarnings } from "./approvals/warnings.ts";
10
16
  export { type ArchiveFile, type ArchiveManifest, type ArchiveReport, archiveDigest, archiveEntry, archiveManifest, verifyArchive, } from "./archive/index.ts";
11
17
  export { archiveParquet } from "./archive/parquet.ts";
12
18
  export { type Attestation, attest, isReadOnly, normalise, parseCommand } from "./attest/index.ts";
13
19
  export { type AuthorityFinding, authorityAt, authorityTimeline, automationSurprise, type Mode as AuthorityMode, type Span as AuthoritySpan, } from "./authority/index.ts";
20
+ export { type ActiveClearance, type ApproverStat, agentReportFindings, approverFatigueFindings, approverStats, type Check, type CheckStatus, type ClearanceAnswer, type ClearanceDecision, type ClearanceMode, type Currency, checkChecks, checkEnvelope, checkFindings, checkHazardRegister, checkNotam, checkOperatorCertificate, checkOpspecs, checkSafetyReport, checkStatus, clearance, clearanceFindings, commitPointSeq, configurationId, type EnvelopeChange, type EnvelopeLimits, envelopeFindings, globMatch, type Hazard, type HazardRegister, hazardStatus, isLevel, LEVELS, type Level, type LoadSheet, type Locator, loadSheet, locator, locatorFindings, type Notam, notamFindings, notamsInForce, type OperatorFacts, type OpSpecs, operatorCertificate, opspecsCheck, type Procedure, pastCommitPoint, procedureFor, protectReasoning, QRH, type ReasoningRequest, ratingCurrency, ratingLapsed, reasoningStatus, SAFETY_CATEGORIES, safetyReportSummary, samePerson, shapeRequest, type TypeCertificate, typeCertificate, unapprovedModifications, } from "./aviation/index.ts";
14
21
  export { badgeSvg, RECORD_STATES, type RecordState, recordBadge, recordState, } from "./badge/index.ts";
15
22
  export { type Invoice, type InvoiceLine, invoice, loadPlans, type Plan, type Plans, renderTaxCreditNote, renderTaxInvoice, stripeSignatureOk, type TaxCreditNote, type TaxCreditNoteInput, type TaxInvoice, type TaxInvoiceInput, taxCreditNote, taxInvoice, } from "./billing/index.ts";
16
23
  export { type AgentIdentity, checkAgent, sessionBom } from "./bom/index.ts";
24
+ export { type AgentBudget, type AgentBudgets, agentBudgetFindings, budgetFor, mad, median, type Period as BudgetPeriod, parseAgentBudgets, peerFindings, periodOf, type UsageRow, } from "./budgets/index.ts";
17
25
  export { BlackboxApiError, type Client, type ClientOptions, client, type SessionQuery, } from "./client/index.ts";
18
26
  export { ART12_MIN_RETENTION_DAYS, type Art12Check, type Art12Report, art12Check, } from "./compliance/art12.ts";
19
27
  export { accuracyFact, complianceFacts, complianceReport, controlsFact, type Facts, type Framework, hallucinationFacts, type Report as ComplianceReport, renderReport, } from "./compliance/index.ts";
20
28
  export { renderZaniiCompliance, type ZaniiComplianceReport, zaniiCompliance, } from "./compliance/zanii.ts";
21
29
  export { type Constitution, type ConstitutionRule, constitutionHash, createConstitution, evaluateConstitution, governanceOf, verifyConstitution, } from "./constitution/index.ts";
22
- export { type CallCost, type CostReport, callMicroUsd, effectivePrice, formatAed, type LoadedPrices, loadPrices, type ModelPrice, type PriceTable, priceCall, priceFor, promptTokens, requestsOf, sessionCost, type Tokens, toAedFils, tokensOf, } from "./cost/index.ts";
30
+ export { type BatchEntry, type BatchItem, type BatchReport, batchReport, } from "./cost/batch.ts";
31
+ export { batchModels, type CallCost, type CostReport, callMicroUsd, effectivePrice, formatAed, type LoadedPrices, loadPrices, type ModelPrice, type PriceTable, priceCall, priceFor, promptTokens, requestsOf, sessionCost, type Tokens, toAedFils, tokensOf, } from "./cost/index.ts";
23
32
  export { agentCv, buildCv, cvHash, verifyCv } from "./cv/index.ts";
24
33
  export { type AuditRow, CORE_EVIDENCE, CORE_IDENTIFIERS, type Connector as AuditConnector, canaryIdentifier, checkAuditConnector, type DataFinding, type DataRules, dataClasses, dataFindings, dataFingerprint, dataMeta, dataScan, dataTopology, hasEvidence, type Identifier, type Lineage, lineage, luhn, normalizeValue, parseAuditLog, parseCsv, reconcileSystem, type SystemReport, type Topology, toolWitness, unevidenced, verifyToolWitness, witnessOf, } from "./data/index.ts";
25
34
  export { type Directive, type DirectiveItem, type DirectiveOptions, directives, fleetDirectives, } from "./directives/index.ts";
@@ -27,26 +36,30 @@ export { argumentLeaves, type Disclosure, type DisclosureEnvelope, discloseField
27
36
  export { checkDrill, drillReport, type Fault as DrillFault } from "./drills/index.ts";
28
37
  export { checkDuty, type DutyFinding, type DutyLimits, dutyFindings } from "./duty/index.ts";
29
38
  export { openSegments, type SealedSegment } from "./encryption/index.ts";
39
+ export { type Arm, armStats, assignArm, type CaseScore, casesFromScenarios, casesFromSessions, checkDataset, checkExperiment, checkScorer, compareRuns, datasetHash, type EvalCase, experimentResults, type Observation, parseCasesJsonl, promptResults, promptSha256, type RunSummary, runSummary, SCORERS, type Scorer, scoreCase, toMilli, } from "./evals/index.ts";
30
40
  export { type EvidencePack, type EvidencePackOptions, evidencePack, renderEvidencePack, } from "./evidence/index.ts";
31
- export { buildEquivocationProof, compareViews, cosignLedgerSth, verifyEquivocationProof, verifyLedgerCosignature, } from "./federation/index.ts";
41
+ export { buildEquivocationProof, compareViews, cosignLedgerSth, cosignLedgerSthWith, verifyEquivocationProof, verifyLedgerCosignature, } from "./federation/index.ts";
32
42
  export { buildOwnerAttestation, buildPayment, CURRENCIES, FTA_WALL_ID, financeFindings, formatMoney, ftaPayload, parseMoney, paymentsOf, screenCounterparty, screeningPayload, verifyOwnerAttestation, verifyOwnerBinding, } from "./finance/index.ts";
33
- export { APPROVAL_ID, aggregateFindings, airworthiness, type Collision, certificateOf, collisions, didFromSeed, type FindingGroup, incidentReport, logbook, type Summary, sessionSummary, signatureOf, signatures, signCertificate, taughtBy, verifyCertificate, } from "./fleet/index.ts";
43
+ export { APPROVAL_ID, aggregateFindings, airworthiness, type Collision, certificateOf, collisions, didFromSeed, type FindingGroup, incidentReport, logbook, type Summary, sessionSummary, signatureOf, signatures, signCertificate, signCertificateWith, taughtBy, verifyCertificate, } from "./fleet/index.ts";
34
44
  export { copilotContext, copilotPrompt, type Insights, insights, parseCopilotAnswer, } from "./fleet/insights.ts";
35
45
  export { type AppealItem, type AppealPack, appealPack, decisionPayload, GOV_DECISION_KINDS, renderAppealPack, ruleConsistency, signSubjectClaim, subjectTag, verifyDecision, verifyFactors, verifySubjectClaim, } from "./gov/index.ts";
36
46
  export { accessPayload, breakGlass, checkEpisodeTag, clinicianConfirmation, type EpisodeItem, episodeSeed, episodesPack, episodeTag, healthFindings, protocolTrail, recommendationHash, recommendationPayload, verifyCommitment, verifyHealthSignature, } from "./health/index.ts";
37
- export { attachBlackbox, BlackboxAgentHooks, BlackboxCallbackHandler, type BlackboxCallbacks, blackboxAgentHooks, blackboxCallbacks, blackboxMiddleware, type EventSink, llmIds, llmIdsOf, trackMemory, wrapAnthropic, wrapBedrock, wrapGemini, wrapOpenAI, } from "./hooks/index.ts";
47
+ export { attachBlackbox, BlackboxAgentHooks, BlackboxCallbackHandler, type BlackboxCallbacks, blackboxAgentHooks, blackboxCallbacks, blackboxMastraExporter, blackboxMiddleware, type EventSink, llmIds, llmIdsOf, trackMemory, wrapAnthropic, wrapBedrock, wrapGemini, wrapOpenAI, } from "./hooks/index.ts";
38
48
  export { type AgentSink, BlackboxStoppedError, blackboxAgentMiddleware, blackboxHitl, type HitlRequest, } from "./hooks/langchain-agent.ts";
39
49
  export { blackboxCheckpointer } from "./hooks/langgraph-checkpoint.ts";
40
50
  export { MANAGED_END, MANAGED_START, managedBlock, protectedEdit } from "./hooks/protect.ts";
41
51
  export { type Investigation, investigation, renderInvestigation, } from "./investigate/index.ts";
52
+ export { isRpcResponse, rpcIdOf, SERVER_REQUESTS, type ServerRequestKind, secretFields, serverReplyMeta, serverRequestMeta, } from "./mcp-requests/index.ts";
42
53
  export { type McpWrapOptions, mcpWrap } from "./mcp-wrap/index.ts";
43
54
  export { commitContent, memoryChain, memoryEntry, verifyMemoryContent, verifyMemoryEntry, } from "./memory/index.ts";
44
55
  export { type AmountUnit, anthropicStatement, type Baseline, baselines, type Connector, checkConnector, checkStatement, csvStatement, customStatement, decimalToMicroUsd, fuel, fxRate, fxUnit, modelSpend, openaiStatement, pageParams, parseXml, reconcileBilling, requestFor, resolvePath, type Statement, } from "./money/index.ts";
45
56
  export { deadlinesDue, filingPack, type OccurrenceFacts, type OccurrenceFramework, type OccurrenceReport, occurrenceFacts, occurrenceReport, renderOccurrence, } from "./occurrence/index.ts";
46
57
  export { ingestOcsf, type OcsfEvent, type OcsfVersion, ocsfLine, toOcsf } from "./ocsf/index.ts";
47
- export { fromOtlp, type OtlpEvent, toOtlp } from "./otlp/index.ts";
48
- export { otlpFromProtobuf } from "./otlp/protobuf.ts";
58
+ export { fromOtlp, fromOtlpLogs, fromOtlpMetrics, type GatewayCall, gatewayTrace, microOf, type OtlpEvent, toOtlp, toOtlpLogs, toOtlpMetrics, } from "./otlp/index.ts";
59
+ export { otlpDecode, otlpEncode, otlpFromProtobuf, type Signal as OtlpSignal, } from "./otlp/protobuf.ts";
49
60
  export { checkIdentifier, checkPack, corePack, type PackEntry, packData, packFrameworks, } from "./packs/index.ts";
61
+ export { shapeArabic, type UnicodeTables, visualLine, } from "./pdf/arabic.ts";
62
+ export { type ArabicAssets, type ArabicMetrics, type FontMetrics, type PdfAssets, type PdfAttachment, type PdfInput, type PdfVerification, pdfCertificate, reportPdf, verifyPdf, } from "./pdf/index.ts";
50
63
  export { type PolicyChange, type PolicyDelta, policyDelta } from "./policy/delta.ts";
51
64
  export { type Draft, type DraftGroup, policyDrafts } from "./policy/drafts.ts";
52
65
  export { audited, type CompiledPolicy, compilePolicy, type Decision, decide, ENVIRONMENT, environmentOf, loadPolicy, mcpToolHints, type Policy, policyFindings, type Rule, type ToolHints, toolDefinitionHash, } from "./policy/index.ts";
@@ -57,6 +70,7 @@ export { type InterventionEvidence, interventionEvidence, interventionGain, } fr
57
70
  export { activities, buildNormal, type NormalModel, type NormalScore, normalScore, normalThreshold, } from "./precog/normal.ts";
58
71
  export { type PreflightFinding, preflightFindings } from "./preflight/index.ts";
59
72
  export { type Rating, type TypeUnratedFinding, typeRatings, typeUnrated, } from "./ratings/index.ts";
73
+ export { type RealtimeFormat, type RealtimeFrame, realtimeFrame, realtimeModelFromPath, } from "./realtime/index.ts";
60
74
  export { type Finding, type FindingCode, type Harness, loadLocal, type ReconcileOptions, RecordNotVerified, type Report, reconcile, } from "./reconcile/index.ts";
61
75
  /** Canonical JSON (keys sorted, no whitespace, JavaScript number formatting), as hashed. */
62
76
  export { canonical } from "./reconcile/shared.ts";
@@ -70,10 +84,11 @@ export { assembleSla, assessCompliance, buildSlaBody, signSla, slaHash, verifySl
70
84
  export { assembleSuccession, buildSuccessionBody, type Succession, type SuccessionBody, type SuccessionReason, signSuccession, successionHash, verifyLineage, verifySuccession, } from "./succession/index.ts";
71
85
  export { type TimestampReport, timestampRequest, verifyTimestamp, } from "./timestamp/index.ts";
72
86
  export { resolveToken, resolveTokens, tokenFor } from "./tokens/index.ts";
73
- export { addCheckpointBody, type Cbor, cborDecode, cborEncode, checkpointText, consistencyProof, cosign, cosignMldsa, ed25519PublicKey, inclusionProof, keyRotationNote, leafHash, logKid, makeReceipt, merkleRoot, mldsaAvailable, mldsaPublicKey, noteVkey, parseAddCheckpoint, parseCheckpoint, parseVkey, RECEIPT_SUB, SESSION_CONTENT_TYPE, sessionStatement, signNote, signStatement, splitNote, statementEntry, subtreeMessage, transparentStatement, verifyConsistency, verifyCoseSign1, verifyCosignature, verifyInclusion, verifyKeyRotation, verifyNote, verifyReceipt, verifyTransparency, } from "./transparency/index.ts";
87
+ export { addCheckpointBody, type Cbor, cborDecode, cborEncode, checkpointText, consistencyProof, cosign, cosignMldsa, ed25519PublicKey, ed25519Sign, ed25519Verify, inclusionProof, keyRotationNote, leafHash, logKid, makeReceipt, merkleRoot, mldsaAvailable, mldsaPublicKey, noteVkey, parseAddCheckpoint, parseCheckpoint, parseVkey, RECEIPT_SUB, SESSION_CONTENT_TYPE, sessionStatement, signNote, signStatement, splitNote, statementEntry, subtreeMessage, transparentStatement, verifyConsistency, verifyCoseSign1, verifyCosignature, verifyInclusion, verifyKeyRotation, verifyNote, verifyReceipt, verifyTransparency, } from "./transparency/index.ts";
74
88
  export { type Compensation, checkCompensations, runUndo, type UndoFinding, type UndoStatus, type UndoStep, undoFindings, undoPlan, } from "./undo/index.ts";
75
89
  export * from "./verify/index.ts";
76
90
  export { VERSION } from "./version.ts";
77
91
  export { checkOutput, WALLS, type Wall, wallFindings, wallManifestHash, } from "./walls/index.ts";
92
+ export { WAREHOUSE_TABLES, type WarehouseCost, type WarehouseDestination, type WarehouseRequest, type WarehouseRow, type WarehouseSession, type WarehouseTable, warehouseBatches, warehouseRequest, warehouseRequestId, warehouseRows, } from "./warehouse/index.ts";
78
93
  export { type Conditions, type Sample, weather } from "./weather/index.ts";
79
94
  export { postReceipt, receiptFor, type Tree, workspaceTree } from "./workspace-receipt/index.ts";
package/dist/index.js CHANGED
@@ -1,27 +1,37 @@
1
1
  // Public API of @zanii/blackbox. Everything customers can import is re-exported here.
2
2
  // Keep this file in step with sdks/python/src/zanii_blackbox/__init__.py (the SDKs mirror each other).
3
+ // spec/anchoring.md §15: the servers check an outside signer against the identity's did:key
4
+ export { publicKeyFromDid } from "@zanii/core";
3
5
  export { A2A_STREAMING, a2aMethod, a2aRequestMeta, a2aResponseMeta, a2aRestMethod, a2aRestRequestMeta, a2aRestResponseMeta, agentCardDigest, agentCardPayload, gatewayCardKey, rewriteAgentCard, verifyAgentCard, } from "./a2a/index.js";
6
+ export { actionsFromCalls, actionsOf, actionsPage, } from "./actions/index.js";
7
+ export { ACCREDITATION_TYPE, checkAccreditation, checkRegister, docHash, REGISTER_TYPE, SERVICE_ID, serviceTier, } from "./admission/index.js";
4
8
  export { causality, memoryXray } from "./agents/index.js";
9
+ export { acceptedHash, acceptedMatch, checkAcceptedFindings, } from "./analysis/accepted.js";
5
10
  export { detectors, fingerprint } from "./analysis/detectors.js";
6
11
  export { FAULTS, faultOf } from "./analysis/faults.js";
7
- export { analyze, answerClaims, answerCredential, answerRisk, answersOf, answerText, canonicalNumber, checkAgainstPacks, checkFlightPlan, checkpointReplay, detectorAccuracy, dualWitness, Evidence, eventsOf, factsIn, findingKey, groundingFindings, groundingRequest, growth, HOLD_TRIGGERS, identifiersIn, isoWeek, judgeFindings, judgeRequest, landing, lessons, loadReferencePacks, modelGroundingFindings, normaliseValue, OUTCOMES, packsFor, parseGroundingAnswer, parseJudgeAnswer, promptChanged, referenceContext, rollup, schemaProblem, secretSent, selfChanges, successRange, systemPromptHash, toolDrifted, toolHallucinations, toolsHash, userDownvotes, verifyAnswerCredential, waste, wilsonLow, } from "./analysis/index.js";
12
+ export { guardCheck, guardMode, guardObserve, guardPin, guardState, guardToolResults, loadGuardConfig, } from "./analysis/guard.js";
13
+ export { Analyzer, analyze, answerClaims, answerCredential, answerRisk, answersOf, answerText, canonicalNumber, checkAgainstPacks, checkFlightPlan, checkpointReplay, detectorAccuracy, dualWitness, Evidence, elicitationSecret, eventsOf, factsIn, findingKey, groundingFindings, groundingRequest, growth, HOLD_TRIGGERS, identifiersIn, isoWeek, judgeFindings, judgeRequest, landing, lessons, loadReferencePacks, modelGroundingFindings, normaliseValue, OUTCOMES, packsFor, parseGroundingAnswer, parseJudgeAnswer, promptChanged, referenceContext, rollup, schemaProblem, secretSent, selfChanges, successRange, systemPromptHash, toolDrifted, toolHallucinations, toolsHash, userDownvotes, verifyAnswerCredential, waste, wilsonLow, } from "./analysis/index.js";
8
14
  export { injectionFindings, injectionRule } from "./analysis/injection.js";
15
+ export { checkPredicate, checkSchema, compilePattern, milliOf, patternMatches, schemaError, } from "./analysis/plan-checks.js";
9
16
  export { MITRE_ATLAS, OWASP_ASI, TAXONOMY, taxonomyOf, } from "./analysis/taxonomy.js";
10
- export { approvalConfirmation, approvalFindings, argsHash, verifyConfirmation, } from "./approvals/index.js";
17
+ export { approvalConfirmation, approvalConfirmationWith, approvalFindings, argsHash, verifyConfirmation, } from "./approvals/index.js";
11
18
  export { textWarnings } from "./approvals/warnings.js";
12
19
  export { archiveDigest, archiveEntry, archiveManifest, verifyArchive, } from "./archive/index.js";
13
20
  export { archiveParquet } from "./archive/parquet.js";
14
21
  export { attest, isReadOnly, normalise, parseCommand } from "./attest/index.js";
15
22
  export { authorityAt, authorityTimeline, automationSurprise, } from "./authority/index.js";
23
+ export { agentReportFindings, approverFatigueFindings, approverStats, checkChecks, checkEnvelope, checkFindings, checkHazardRegister, checkNotam, checkOperatorCertificate, checkOpspecs, checkSafetyReport, checkStatus, clearance, clearanceFindings, commitPointSeq, configurationId, envelopeFindings, globMatch, hazardStatus, isLevel, LEVELS, loadSheet, locator, locatorFindings, notamFindings, notamsInForce, operatorCertificate, opspecsCheck, pastCommitPoint, procedureFor, protectReasoning, QRH, ratingCurrency, ratingLapsed, reasoningStatus, SAFETY_CATEGORIES, safetyReportSummary, samePerson, shapeRequest, typeCertificate, unapprovedModifications, } from "./aviation/index.js";
16
24
  export { badgeSvg, RECORD_STATES, recordBadge, recordState, } from "./badge/index.js";
17
25
  export { invoice, loadPlans, renderTaxCreditNote, renderTaxInvoice, stripeSignatureOk, taxCreditNote, taxInvoice, } from "./billing/index.js";
18
26
  export { checkAgent, sessionBom } from "./bom/index.js";
27
+ export { agentBudgetFindings, budgetFor, mad, median, parseAgentBudgets, peerFindings, periodOf, } from "./budgets/index.js";
19
28
  export { BlackboxApiError, client, } from "./client/index.js";
20
29
  export { ART12_MIN_RETENTION_DAYS, art12Check, } from "./compliance/art12.js";
21
30
  export { accuracyFact, complianceFacts, complianceReport, controlsFact, hallucinationFacts, renderReport, } from "./compliance/index.js";
22
31
  export { renderZaniiCompliance, zaniiCompliance, } from "./compliance/zanii.js";
23
32
  export { constitutionHash, createConstitution, evaluateConstitution, governanceOf, verifyConstitution, } from "./constitution/index.js";
24
- export { callMicroUsd, effectivePrice, formatAed, loadPrices, priceCall, priceFor, promptTokens, requestsOf, sessionCost, toAedFils, tokensOf, } from "./cost/index.js";
33
+ export { batchReport, } from "./cost/batch.js";
34
+ export { batchModels, callMicroUsd, effectivePrice, formatAed, loadPrices, priceCall, priceFor, promptTokens, requestsOf, sessionCost, toAedFils, tokensOf, } from "./cost/index.js";
25
35
  export { agentCv, buildCv, cvHash, verifyCv } from "./cv/index.js";
26
36
  export { CORE_EVIDENCE, CORE_IDENTIFIERS, canaryIdentifier, checkAuditConnector, dataClasses, dataFindings, dataFingerprint, dataMeta, dataScan, dataTopology, hasEvidence, lineage, luhn, normalizeValue, parseAuditLog, parseCsv, reconcileSystem, toolWitness, unevidenced, verifyToolWitness, witnessOf, } from "./data/index.js";
27
37
  export { directives, fleetDirectives, } from "./directives/index.js";
@@ -29,26 +39,30 @@ export { argumentLeaves, discloseFields, disclosureEnvelope, verifyDisclosure, v
29
39
  export { checkDrill, drillReport } from "./drills/index.js";
30
40
  export { checkDuty, dutyFindings } from "./duty/index.js";
31
41
  export { openSegments } from "./encryption/index.js";
42
+ export { armStats, assignArm, casesFromScenarios, casesFromSessions, checkDataset, checkExperiment, checkScorer, compareRuns, datasetHash, experimentResults, parseCasesJsonl, promptResults, promptSha256, runSummary, SCORERS, scoreCase, toMilli, } from "./evals/index.js";
32
43
  export { evidencePack, renderEvidencePack, } from "./evidence/index.js";
33
- export { buildEquivocationProof, compareViews, cosignLedgerSth, verifyEquivocationProof, verifyLedgerCosignature, } from "./federation/index.js";
44
+ export { buildEquivocationProof, compareViews, cosignLedgerSth, cosignLedgerSthWith, verifyEquivocationProof, verifyLedgerCosignature, } from "./federation/index.js";
34
45
  export { buildOwnerAttestation, buildPayment, CURRENCIES, FTA_WALL_ID, financeFindings, formatMoney, ftaPayload, parseMoney, paymentsOf, screenCounterparty, screeningPayload, verifyOwnerAttestation, verifyOwnerBinding, } from "./finance/index.js";
35
- export { APPROVAL_ID, aggregateFindings, airworthiness, certificateOf, collisions, didFromSeed, incidentReport, logbook, sessionSummary, signatureOf, signatures, signCertificate, taughtBy, verifyCertificate, } from "./fleet/index.js";
46
+ export { APPROVAL_ID, aggregateFindings, airworthiness, certificateOf, collisions, didFromSeed, incidentReport, logbook, sessionSummary, signatureOf, signatures, signCertificate, signCertificateWith, taughtBy, verifyCertificate, } from "./fleet/index.js";
36
47
  export { copilotContext, copilotPrompt, insights, parseCopilotAnswer, } from "./fleet/insights.js";
37
48
  export { appealPack, decisionPayload, GOV_DECISION_KINDS, renderAppealPack, ruleConsistency, signSubjectClaim, subjectTag, verifyDecision, verifyFactors, verifySubjectClaim, } from "./gov/index.js";
38
49
  export { accessPayload, breakGlass, checkEpisodeTag, clinicianConfirmation, episodeSeed, episodesPack, episodeTag, healthFindings, protocolTrail, recommendationHash, recommendationPayload, verifyCommitment, verifyHealthSignature, } from "./health/index.js";
39
- export { attachBlackbox, BlackboxAgentHooks, BlackboxCallbackHandler, blackboxAgentHooks, blackboxCallbacks, blackboxMiddleware, llmIds, llmIdsOf, trackMemory, wrapAnthropic, wrapBedrock, wrapGemini, wrapOpenAI, } from "./hooks/index.js";
50
+ export { attachBlackbox, BlackboxAgentHooks, BlackboxCallbackHandler, blackboxAgentHooks, blackboxCallbacks, blackboxMastraExporter, blackboxMiddleware, llmIds, llmIdsOf, trackMemory, wrapAnthropic, wrapBedrock, wrapGemini, wrapOpenAI, } from "./hooks/index.js";
40
51
  export { BlackboxStoppedError, blackboxAgentMiddleware, blackboxHitl, } from "./hooks/langchain-agent.js";
41
52
  export { blackboxCheckpointer } from "./hooks/langgraph-checkpoint.js";
42
53
  export { MANAGED_END, MANAGED_START, managedBlock, protectedEdit } from "./hooks/protect.js";
43
54
  export { investigation, renderInvestigation, } from "./investigate/index.js";
55
+ export { isRpcResponse, rpcIdOf, SERVER_REQUESTS, secretFields, serverReplyMeta, serverRequestMeta, } from "./mcp-requests/index.js";
44
56
  export { mcpWrap } from "./mcp-wrap/index.js";
45
57
  export { commitContent, memoryChain, memoryEntry, verifyMemoryContent, verifyMemoryEntry, } from "./memory/index.js";
46
58
  export { anthropicStatement, baselines, checkConnector, checkStatement, csvStatement, customStatement, decimalToMicroUsd, fuel, fxRate, fxUnit, modelSpend, openaiStatement, pageParams, parseXml, reconcileBilling, requestFor, resolvePath, } from "./money/index.js";
47
59
  export { deadlinesDue, filingPack, occurrenceFacts, occurrenceReport, renderOccurrence, } from "./occurrence/index.js";
48
60
  export { ingestOcsf, ocsfLine, toOcsf } from "./ocsf/index.js";
49
- export { fromOtlp, toOtlp } from "./otlp/index.js";
50
- export { otlpFromProtobuf } from "./otlp/protobuf.js";
61
+ export { fromOtlp, fromOtlpLogs, fromOtlpMetrics, gatewayTrace, microOf, toOtlp, toOtlpLogs, toOtlpMetrics, } from "./otlp/index.js";
62
+ export { otlpDecode, otlpEncode, otlpFromProtobuf, } from "./otlp/protobuf.js";
51
63
  export { checkIdentifier, checkPack, corePack, packData, packFrameworks, } from "./packs/index.js";
64
+ export { shapeArabic, visualLine, } from "./pdf/arabic.js";
65
+ export { pdfCertificate, reportPdf, verifyPdf, } from "./pdf/index.js";
52
66
  export { policyDelta } from "./policy/delta.js";
53
67
  export { policyDrafts } from "./policy/drafts.js";
54
68
  export { audited, compilePolicy, decide, ENVIRONMENT, environmentOf, loadPolicy, mcpToolHints, policyFindings, toolDefinitionHash, } from "./policy/index.js";
@@ -59,6 +73,7 @@ export { interventionEvidence, interventionGain, } from "./precog/intervention.j
59
73
  export { activities, buildNormal, normalScore, normalThreshold, } from "./precog/normal.js";
60
74
  export { preflightFindings } from "./preflight/index.js";
61
75
  export { typeRatings, typeUnrated, } from "./ratings/index.js";
76
+ export { realtimeFrame, realtimeModelFromPath, } from "./realtime/index.js";
62
77
  export { loadLocal, RecordNotVerified, reconcile, } from "./reconcile/index.js";
63
78
  /** Canonical JSON (keys sorted, no whitespace, JavaScript number formatting), as hashed. */
64
79
  export { canonical } from "./reconcile/shared.js";
@@ -72,10 +87,11 @@ export { assembleSla, assessCompliance, buildSlaBody, signSla, slaHash, verifySl
72
87
  export { assembleSuccession, buildSuccessionBody, signSuccession, successionHash, verifyLineage, verifySuccession, } from "./succession/index.js";
73
88
  export { timestampRequest, verifyTimestamp, } from "./timestamp/index.js";
74
89
  export { resolveToken, resolveTokens, tokenFor } from "./tokens/index.js";
75
- export { addCheckpointBody, cborDecode, cborEncode, checkpointText, consistencyProof, cosign, cosignMldsa, ed25519PublicKey, inclusionProof, keyRotationNote, leafHash, logKid, makeReceipt, merkleRoot, mldsaAvailable, mldsaPublicKey, noteVkey, parseAddCheckpoint, parseCheckpoint, parseVkey, RECEIPT_SUB, SESSION_CONTENT_TYPE, sessionStatement, signNote, signStatement, splitNote, statementEntry, subtreeMessage, transparentStatement, verifyConsistency, verifyCoseSign1, verifyCosignature, verifyInclusion, verifyKeyRotation, verifyNote, verifyReceipt, verifyTransparency, } from "./transparency/index.js";
90
+ export { addCheckpointBody, cborDecode, cborEncode, checkpointText, consistencyProof, cosign, cosignMldsa, ed25519PublicKey, ed25519Sign, ed25519Verify, inclusionProof, keyRotationNote, leafHash, logKid, makeReceipt, merkleRoot, mldsaAvailable, mldsaPublicKey, noteVkey, parseAddCheckpoint, parseCheckpoint, parseVkey, RECEIPT_SUB, SESSION_CONTENT_TYPE, sessionStatement, signNote, signStatement, splitNote, statementEntry, subtreeMessage, transparentStatement, verifyConsistency, verifyCoseSign1, verifyCosignature, verifyInclusion, verifyKeyRotation, verifyNote, verifyReceipt, verifyTransparency, } from "./transparency/index.js";
76
91
  export { checkCompensations, runUndo, undoFindings, undoPlan, } from "./undo/index.js";
77
92
  export * from "./verify/index.js";
78
93
  export { VERSION } from "./version.js";
79
94
  export { checkOutput, WALLS, wallFindings, wallManifestHash, } from "./walls/index.js";
95
+ export { WAREHOUSE_TABLES, warehouseBatches, warehouseRequest, warehouseRequestId, warehouseRows, } from "./warehouse/index.js";
80
96
  export { weather } from "./weather/index.js";
81
97
  export { postReceipt, receiptFor, workspaceTree } from "./workspace-receipt/index.js";