@zanii/blackbox 0.15.1 → 0.16.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.
- package/dist/fleet/insights.d.ts +82 -0
- package/dist/fleet/insights.js +307 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { Summary } from "./index.ts";
|
|
2
|
+
declare const SEVERITIES: readonly ["warning", "caution", "advisory"];
|
|
3
|
+
type Severities = Record<(typeof SEVERITIES)[number], number>;
|
|
4
|
+
export declare const CONTEXT_MAX = 600;
|
|
5
|
+
export interface Counts {
|
|
6
|
+
sessions: number;
|
|
7
|
+
closed: number;
|
|
8
|
+
success: number;
|
|
9
|
+
failure: number;
|
|
10
|
+
abandoned: number;
|
|
11
|
+
spend_micro_usd: number;
|
|
12
|
+
findings: Severities;
|
|
13
|
+
blocked: number;
|
|
14
|
+
}
|
|
15
|
+
export interface Issue {
|
|
16
|
+
code: string;
|
|
17
|
+
severity: string | null;
|
|
18
|
+
sessions: number;
|
|
19
|
+
findings: number;
|
|
20
|
+
failed: number;
|
|
21
|
+
spend_micro_usd: number;
|
|
22
|
+
first_seen: string;
|
|
23
|
+
last_seen: string;
|
|
24
|
+
example: {
|
|
25
|
+
session_id: string;
|
|
26
|
+
seq: number;
|
|
27
|
+
} | null;
|
|
28
|
+
days: number[];
|
|
29
|
+
}
|
|
30
|
+
export interface Group {
|
|
31
|
+
key: string;
|
|
32
|
+
sessions: number;
|
|
33
|
+
success: number;
|
|
34
|
+
failure: number;
|
|
35
|
+
spend_micro_usd: number;
|
|
36
|
+
findings: number;
|
|
37
|
+
warnings: number;
|
|
38
|
+
}
|
|
39
|
+
export interface Insights {
|
|
40
|
+
from: string;
|
|
41
|
+
to: string;
|
|
42
|
+
days: Array<{
|
|
43
|
+
day: string;
|
|
44
|
+
cost_per_success_micro_usd: number | null;
|
|
45
|
+
} & Counts>;
|
|
46
|
+
issues: Issue[];
|
|
47
|
+
by: {
|
|
48
|
+
tenant: Group[];
|
|
49
|
+
environment: Group[];
|
|
50
|
+
agent: Group[];
|
|
51
|
+
tool: Group[];
|
|
52
|
+
};
|
|
53
|
+
totals: Counts & {
|
|
54
|
+
cost_per_success_micro_usd: number | null;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
type SummaryIn = Partial<Summary> & {
|
|
58
|
+
session_id: string;
|
|
59
|
+
started_at: string;
|
|
60
|
+
environment?: string;
|
|
61
|
+
};
|
|
62
|
+
/** spec/insights.md §1: days, issues, the fleet by group and the totals of a window's sessions. */
|
|
63
|
+
export declare function insights(summaries: readonly SummaryIn[], window: {
|
|
64
|
+
from: string;
|
|
65
|
+
to: string;
|
|
66
|
+
}): Insights;
|
|
67
|
+
/**
|
|
68
|
+
* spec/insights.md §3: the record as one line per event, metadata only, at most 600 events. With
|
|
69
|
+
* `body` (a body by its hash), a verify event also says `ok=true` or `ok=false`.
|
|
70
|
+
*/
|
|
71
|
+
export declare function copilotContext(lines: readonly string[], body?: (hash: string) => Uint8Array | null | undefined): string;
|
|
72
|
+
/** spec/insights.md §3: the system prompt and the user turn for the investigator's model. */
|
|
73
|
+
export declare function copilotPrompt(question: string, context: string, lang?: string): {
|
|
74
|
+
system: string;
|
|
75
|
+
user: string;
|
|
76
|
+
};
|
|
77
|
+
/** spec/insights.md §3: the answer, and the cited seqs that are events of the record. */
|
|
78
|
+
export declare function parseCopilotAnswer(text: string, count: number): {
|
|
79
|
+
answer: string;
|
|
80
|
+
cites: number[];
|
|
81
|
+
};
|
|
82
|
+
export {};
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
// Insights and the investigator (spec/insights.md): pure functions over what the gateway keeps.
|
|
2
|
+
// `insights` sums session summaries into trends, recurring issues and the fleet by group;
|
|
3
|
+
// `copilotContext`, `copilotPrompt` and `parseCopilotAnswer` are the investigator's record, request
|
|
4
|
+
// and answer. Mirrors sdks/python/src/zanii_blackbox/insights.py; pinned by spec/vectors/insights.json.
|
|
5
|
+
const SEVERITIES = ["warning", "caution", "advisory"];
|
|
6
|
+
const TRAILING_DATE = /\s+\d{4}-\d{2}-\d{2}$/;
|
|
7
|
+
const GROUP_MAX = 50;
|
|
8
|
+
export const CONTEXT_MAX = 600;
|
|
9
|
+
const HEAD = 50;
|
|
10
|
+
const TAIL = 100;
|
|
11
|
+
const VALUE_MAX = 120;
|
|
12
|
+
const divHalfUp = (a, b) => Math.floor((2 * a + b) / (2 * b));
|
|
13
|
+
const cmp = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
14
|
+
function daysOf(from, to) {
|
|
15
|
+
const out = [];
|
|
16
|
+
const d = new Date(`${from}T00:00:00Z`);
|
|
17
|
+
const stop = new Date(`${to}T00:00:00Z`);
|
|
18
|
+
while (d < stop) {
|
|
19
|
+
out.push(d.toISOString().slice(0, 10));
|
|
20
|
+
d.setUTCDate(d.getUTCDate() + 1);
|
|
21
|
+
}
|
|
22
|
+
return out;
|
|
23
|
+
}
|
|
24
|
+
const emptyCounts = () => ({
|
|
25
|
+
sessions: 0,
|
|
26
|
+
closed: 0,
|
|
27
|
+
success: 0,
|
|
28
|
+
failure: 0,
|
|
29
|
+
abandoned: 0,
|
|
30
|
+
spend_micro_usd: 0,
|
|
31
|
+
findings: { warning: 0, caution: 0, advisory: 0 },
|
|
32
|
+
blocked: 0,
|
|
33
|
+
});
|
|
34
|
+
function count(c, s) {
|
|
35
|
+
c.sessions += 1;
|
|
36
|
+
c.closed += s.closed ? 1 : 0;
|
|
37
|
+
if (s.outcome === "success" || s.outcome === "failure" || s.outcome === "abandoned")
|
|
38
|
+
c[s.outcome] += 1;
|
|
39
|
+
c.spend_micro_usd += Number(s.spend_micro_usd ?? 0);
|
|
40
|
+
for (const sev of SEVERITIES)
|
|
41
|
+
c.findings[sev] += Number(s.findings?.[sev] ?? 0);
|
|
42
|
+
c.blocked += s.blocked_by ? 1 : 0;
|
|
43
|
+
}
|
|
44
|
+
const perSuccess = (c) => (c.success ? divHalfUp(c.spend_micro_usd, c.success) : null);
|
|
45
|
+
const agentOf = (label) => (typeof label === "string" ? label.replace(TRAILING_DATE, "").trim() : "") || "(none)";
|
|
46
|
+
/** spec/insights.md §1: days, issues, the fleet by group and the totals of a window's sessions. */
|
|
47
|
+
export function insights(summaries, window) {
|
|
48
|
+
const days = daysOf(window.from, window.to);
|
|
49
|
+
const index = new Map(days.map((d, i) => [d, i]));
|
|
50
|
+
const picked = summaries
|
|
51
|
+
.filter((s) => index.has(String(s.started_at ?? "").slice(0, 10)))
|
|
52
|
+
.sort((a, b) => cmp(String(a.started_at), String(b.started_at)) ||
|
|
53
|
+
cmp(String(a.session_id), String(b.session_id)));
|
|
54
|
+
const perDay = days.map(emptyCounts);
|
|
55
|
+
const totals = emptyCounts();
|
|
56
|
+
const issues = new Map();
|
|
57
|
+
const groups = {
|
|
58
|
+
tenant: new Map(),
|
|
59
|
+
environment: new Map(),
|
|
60
|
+
agent: new Map(),
|
|
61
|
+
tool: new Map(),
|
|
62
|
+
};
|
|
63
|
+
for (const s of picked) {
|
|
64
|
+
const at = index.get(s.started_at.slice(0, 10));
|
|
65
|
+
count(perDay[at], s);
|
|
66
|
+
count(totals, s);
|
|
67
|
+
const spend = Number(s.spend_micro_usd ?? 0);
|
|
68
|
+
const last = s.last_event_at || s.started_at;
|
|
69
|
+
for (const [code, n] of Object.entries(s.finding_codes ?? {})) {
|
|
70
|
+
let i = issues.get(code);
|
|
71
|
+
if (!i) {
|
|
72
|
+
i = {
|
|
73
|
+
code,
|
|
74
|
+
severity: null,
|
|
75
|
+
sessions: 0,
|
|
76
|
+
findings: 0,
|
|
77
|
+
failed: 0,
|
|
78
|
+
spend_micro_usd: 0,
|
|
79
|
+
first_seen: s.started_at,
|
|
80
|
+
last_seen: last,
|
|
81
|
+
example: null,
|
|
82
|
+
days: days.map(() => 0),
|
|
83
|
+
};
|
|
84
|
+
issues.set(code, i);
|
|
85
|
+
}
|
|
86
|
+
i.sessions += 1;
|
|
87
|
+
i.findings += Number(n);
|
|
88
|
+
i.failed += s.outcome === "failure" ? 1 : 0;
|
|
89
|
+
i.spend_micro_usd += spend;
|
|
90
|
+
if (s.started_at < i.first_seen)
|
|
91
|
+
i.first_seen = s.started_at;
|
|
92
|
+
if (last > i.last_seen)
|
|
93
|
+
i.last_seen = last;
|
|
94
|
+
i.days[at] = i.days[at] + 1;
|
|
95
|
+
}
|
|
96
|
+
for (const f of s.latest_findings ?? []) {
|
|
97
|
+
const i = issues.get(String(f.code));
|
|
98
|
+
if (i) {
|
|
99
|
+
i.severity = f.severity ?? null;
|
|
100
|
+
i.example = { session_id: s.session_id, seq: f.seq };
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const found = s.findings ?? { warning: 0, caution: 0, advisory: 0 };
|
|
104
|
+
const nFound = SEVERITIES.reduce((a, sev) => a + Number(found[sev] ?? 0), 0);
|
|
105
|
+
const keys = {
|
|
106
|
+
tenant: [s.tenant || "default"],
|
|
107
|
+
environment: [s.environment || "(none)"],
|
|
108
|
+
agent: [agentOf(s.label)],
|
|
109
|
+
tool: Object.keys(s.tools ?? {}).sort(cmp),
|
|
110
|
+
};
|
|
111
|
+
for (const [name, values] of Object.entries(keys)) {
|
|
112
|
+
for (const key of values) {
|
|
113
|
+
let g = groups[name].get(key);
|
|
114
|
+
if (!g) {
|
|
115
|
+
g = {
|
|
116
|
+
key,
|
|
117
|
+
sessions: 0,
|
|
118
|
+
success: 0,
|
|
119
|
+
failure: 0,
|
|
120
|
+
spend_micro_usd: 0,
|
|
121
|
+
findings: 0,
|
|
122
|
+
warnings: 0,
|
|
123
|
+
};
|
|
124
|
+
groups[name].set(key, g);
|
|
125
|
+
}
|
|
126
|
+
g.sessions += 1;
|
|
127
|
+
g.success += s.outcome === "success" ? 1 : 0;
|
|
128
|
+
g.failure += s.outcome === "failure" ? 1 : 0;
|
|
129
|
+
g.spend_micro_usd += spend;
|
|
130
|
+
g.findings += nFound;
|
|
131
|
+
g.warnings += Number(found.warning ?? 0);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const ordered = (m) => [...m.values()]
|
|
136
|
+
.sort((a, b) => b.spend_micro_usd - a.spend_micro_usd || cmp(a.key, b.key))
|
|
137
|
+
.slice(0, GROUP_MAX);
|
|
138
|
+
return {
|
|
139
|
+
from: window.from,
|
|
140
|
+
to: window.to,
|
|
141
|
+
days: days.map((day, i) => {
|
|
142
|
+
const c = perDay[i];
|
|
143
|
+
return { day, ...c, cost_per_success_micro_usd: perSuccess(c) };
|
|
144
|
+
}),
|
|
145
|
+
issues: [...issues.values()].sort((a, b) => b.sessions - a.sessions || b.findings - a.findings || cmp(a.code, b.code)),
|
|
146
|
+
by: {
|
|
147
|
+
tenant: ordered(groups.tenant),
|
|
148
|
+
environment: ordered(groups.environment),
|
|
149
|
+
agent: ordered(groups.agent),
|
|
150
|
+
tool: ordered(groups.tool),
|
|
151
|
+
},
|
|
152
|
+
totals: { ...totals, cost_per_success_micro_usd: perSuccess(totals) },
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
// ------------------------------------------------------------------ the investigator
|
|
156
|
+
const DETAILS = {
|
|
157
|
+
"session.open": ["label", "mode", "environment"],
|
|
158
|
+
"llm.request": ["provider"],
|
|
159
|
+
"llm.response": ["model", "status", "stop_reason", "finish_reason", "response_status"],
|
|
160
|
+
"llm.incomplete": ["model", "status", "reason"],
|
|
161
|
+
"tool.call": ["tool", "method"],
|
|
162
|
+
"tool.result": ["tool", "method"],
|
|
163
|
+
"sdk.event": ["type", "name"],
|
|
164
|
+
finding: ["code", "severity"],
|
|
165
|
+
control: ["action", "code", "by"],
|
|
166
|
+
outcome: ["outcome", "by", "note"],
|
|
167
|
+
"session.lost_contact": ["silent_ms"],
|
|
168
|
+
"capture.gap": ["missed"],
|
|
169
|
+
};
|
|
170
|
+
function value(v) {
|
|
171
|
+
if (typeof v === "number")
|
|
172
|
+
return Number.isSafeInteger(v) ? String(v) : null;
|
|
173
|
+
if (typeof v !== "string")
|
|
174
|
+
return null;
|
|
175
|
+
// spaces, tabs and newlines only (Unicode whitespace differs by language); by code point
|
|
176
|
+
const short = Array.from(v.replace(/[ \t\n\r]+/g, " ").replace(/^ +| +$/g, ""))
|
|
177
|
+
.slice(0, VALUE_MAX)
|
|
178
|
+
.join("");
|
|
179
|
+
return JSON.stringify(short);
|
|
180
|
+
}
|
|
181
|
+
const isMoment = (e) => {
|
|
182
|
+
const status = e.meta?.status;
|
|
183
|
+
return (e.kind === "finding" ||
|
|
184
|
+
e.kind === "control" ||
|
|
185
|
+
e.kind === "outcome" ||
|
|
186
|
+
e.kind === "session.lost_contact" ||
|
|
187
|
+
e.kind === "capture.gap" ||
|
|
188
|
+
e.kind === "llm.incomplete" ||
|
|
189
|
+
(e.kind === "llm.response" && Number.isInteger(status) && status >= 400));
|
|
190
|
+
};
|
|
191
|
+
function evenly(items, n) {
|
|
192
|
+
if (n <= 0 || items.length === 0)
|
|
193
|
+
return [];
|
|
194
|
+
if (n >= items.length)
|
|
195
|
+
return [...items];
|
|
196
|
+
return Array.from({ length: n }, (_, i) => items[Math.floor((i * items.length) / n)]);
|
|
197
|
+
}
|
|
198
|
+
/** A verify event's pass or fail, from its body: the one value read from a body. Never `detail`. */
|
|
199
|
+
function verifyOk(e, body) {
|
|
200
|
+
const meta = (e.meta ?? {});
|
|
201
|
+
if (!body || e.kind !== "sdk.event" || meta.type !== "verify")
|
|
202
|
+
return null;
|
|
203
|
+
const raw = body(String(e.body_hash));
|
|
204
|
+
if (!raw || raw.length === 0)
|
|
205
|
+
return null; // erased, or never sent
|
|
206
|
+
try {
|
|
207
|
+
const doc = JSON.parse(new TextDecoder().decode(raw));
|
|
208
|
+
const ok = doc && typeof doc === "object" && !Array.isArray(doc) ? doc.ok : null;
|
|
209
|
+
return typeof ok === "boolean" ? ok : null;
|
|
210
|
+
}
|
|
211
|
+
catch {
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* spec/insights.md §3: the record as one line per event, metadata only, at most 600 events. With
|
|
217
|
+
* `body` (a body by its hash), a verify event also says `ok=true` or `ok=false`.
|
|
218
|
+
*/
|
|
219
|
+
export function copilotContext(lines, body) {
|
|
220
|
+
const events = lines.map((l) => JSON.parse(l));
|
|
221
|
+
const n = events.length;
|
|
222
|
+
let shown;
|
|
223
|
+
if (n > CONTEXT_MAX) {
|
|
224
|
+
const base = new Set();
|
|
225
|
+
for (let i = 0; i < Math.min(HEAD, n); i++)
|
|
226
|
+
base.add(i);
|
|
227
|
+
for (let i = Math.max(0, n - TAIL); i < n; i++)
|
|
228
|
+
base.add(i);
|
|
229
|
+
const moments = events
|
|
230
|
+
.map((e, i) => (isMoment(e) && !base.has(i) ? i : -1))
|
|
231
|
+
.filter((i) => i >= 0);
|
|
232
|
+
const room = CONTEXT_MAX - base.size;
|
|
233
|
+
const keep = new Set(base);
|
|
234
|
+
if (moments.length >= room)
|
|
235
|
+
for (const i of evenly(moments, room))
|
|
236
|
+
keep.add(i);
|
|
237
|
+
else {
|
|
238
|
+
const m = new Set(moments);
|
|
239
|
+
for (const i of moments)
|
|
240
|
+
keep.add(i);
|
|
241
|
+
const rest = [];
|
|
242
|
+
for (let i = 0; i < n; i++)
|
|
243
|
+
if (!base.has(i) && !m.has(i))
|
|
244
|
+
rest.push(i);
|
|
245
|
+
for (const i of evenly(rest, room - moments.length))
|
|
246
|
+
keep.add(i);
|
|
247
|
+
}
|
|
248
|
+
shown = [...keep].sort((a, b) => a - b);
|
|
249
|
+
}
|
|
250
|
+
else
|
|
251
|
+
shown = events.map((_, i) => i);
|
|
252
|
+
const first = events[0] ?? {};
|
|
253
|
+
const head = `Session ${first.session_id ?? ""}: ${n} events`;
|
|
254
|
+
const out = [head + (shown.length < n ? ` (${n - shown.length} not shown)` : "")];
|
|
255
|
+
for (const i of shown) {
|
|
256
|
+
const e = events[i];
|
|
257
|
+
const meta = (e.meta ?? {});
|
|
258
|
+
const parts = [`#${e.seq}`, String(e.ts), String(e.kind)];
|
|
259
|
+
for (const k of DETAILS[String(e.kind)] ?? []) {
|
|
260
|
+
const v = value(meta[k]);
|
|
261
|
+
if (v !== null)
|
|
262
|
+
parts.push(`${k}=${v}`);
|
|
263
|
+
}
|
|
264
|
+
const ok = verifyOk(e, body);
|
|
265
|
+
if (ok !== null)
|
|
266
|
+
parts.push(`ok=${ok}`);
|
|
267
|
+
out.push(parts.join(" "));
|
|
268
|
+
}
|
|
269
|
+
return out.join("\n");
|
|
270
|
+
}
|
|
271
|
+
const SYSTEM = "You are an investigator reading one AI agent's flight record from Zanii Blackbox. The record " +
|
|
272
|
+
"below is one line per event: #seq, time, kind, then its metadata; ok=true or ok=false on a " +
|
|
273
|
+
"verify event is the result of the agent's own check. Answer the question only " +
|
|
274
|
+
"from the record. Cite the event numbers your answer rests on. If the record doesn't say, say " +
|
|
275
|
+
"so. Be brief and concrete. Answer with JSON only: " +
|
|
276
|
+
'{"answer": "<your answer>", "cites": [<seq>, ...]}';
|
|
277
|
+
/** spec/insights.md §3: the system prompt and the user turn for the investigator's model. */
|
|
278
|
+
export function copilotPrompt(question, context, lang = "en") {
|
|
279
|
+
return {
|
|
280
|
+
system: SYSTEM + (lang === "ar" ? " Write the answer in Arabic." : ""),
|
|
281
|
+
user: `${context}\n\nQuestion: ${question}`,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
/** spec/insights.md §3: the answer, and the cited seqs that are events of the record. */
|
|
285
|
+
export function parseCopilotAnswer(text, count) {
|
|
286
|
+
const raw = text.trim();
|
|
287
|
+
const a = raw.indexOf("{");
|
|
288
|
+
const b = raw.lastIndexOf("}");
|
|
289
|
+
let got = null;
|
|
290
|
+
if (a >= 0 && b > a) {
|
|
291
|
+
try {
|
|
292
|
+
got = JSON.parse(raw.slice(a, b + 1));
|
|
293
|
+
}
|
|
294
|
+
catch {
|
|
295
|
+
got = null;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
const doc = got;
|
|
299
|
+
if (!doc || typeof doc !== "object" || Array.isArray(doc) || typeof doc.answer !== "string")
|
|
300
|
+
return { answer: raw, cites: [] };
|
|
301
|
+
const cites = Array.isArray(doc.cites)
|
|
302
|
+
? [
|
|
303
|
+
...new Set(doc.cites.filter((c) => Number.isInteger(c) && c >= 0 && c < count)),
|
|
304
|
+
].sort((x, y) => x - y)
|
|
305
|
+
: [];
|
|
306
|
+
return { answer: doc.answer.trim(), cites: cites.slice(0, 20) };
|
|
307
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export { type EvidencePack, type EvidencePackOptions, evidencePack, renderEviden
|
|
|
30
30
|
export { buildEquivocationProof, compareViews, cosignLedgerSth, verifyEquivocationProof, verifyLedgerCosignature, } from "./federation/index.ts";
|
|
31
31
|
export { buildOwnerAttestation, buildPayment, CURRENCIES, FTA_WALL_ID, financeFindings, formatMoney, ftaPayload, parseMoney, paymentsOf, screenCounterparty, screeningPayload, verifyOwnerAttestation, verifyOwnerBinding, } from "./finance/index.ts";
|
|
32
32
|
export { aggregateFindings, airworthiness, type Collision, collisions, didFromSeed, type FindingGroup, incidentReport, logbook, type Summary, sessionSummary, signatureOf, signatures, signCertificate, verifyCertificate, } from "./fleet/index.ts";
|
|
33
|
+
export { copilotContext, copilotPrompt, type Insights, insights, parseCopilotAnswer, } from "./fleet/insights.ts";
|
|
33
34
|
export { type AppealItem, type AppealPack, appealPack, decisionPayload, GOV_DECISION_KINDS, renderAppealPack, ruleConsistency, signSubjectClaim, subjectTag, verifyDecision, verifyFactors, verifySubjectClaim, } from "./gov/index.ts";
|
|
34
35
|
export { accessPayload, breakGlass, checkEpisodeTag, clinicianConfirmation, type EpisodeItem, episodeSeed, episodesPack, episodeTag, healthFindings, protocolTrail, recommendationHash, recommendationPayload, verifyCommitment, verifyHealthSignature, } from "./health/index.ts";
|
|
35
36
|
export { attachBlackbox, BlackboxAgentHooks, BlackboxCallbackHandler, type BlackboxCallbacks, blackboxAgentHooks, blackboxCallbacks, blackboxMiddleware, type EventSink, llmIds, llmIdsOf, trackMemory, wrapAnthropic, wrapBedrock, wrapGemini, wrapOpenAI, } from "./hooks/index.ts";
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,7 @@ export { evidencePack, renderEvidencePack, } from "./evidence/index.js";
|
|
|
32
32
|
export { buildEquivocationProof, compareViews, cosignLedgerSth, verifyEquivocationProof, verifyLedgerCosignature, } from "./federation/index.js";
|
|
33
33
|
export { buildOwnerAttestation, buildPayment, CURRENCIES, FTA_WALL_ID, financeFindings, formatMoney, ftaPayload, parseMoney, paymentsOf, screenCounterparty, screeningPayload, verifyOwnerAttestation, verifyOwnerBinding, } from "./finance/index.js";
|
|
34
34
|
export { aggregateFindings, airworthiness, collisions, didFromSeed, incidentReport, logbook, sessionSummary, signatureOf, signatures, signCertificate, verifyCertificate, } from "./fleet/index.js";
|
|
35
|
+
export { copilotContext, copilotPrompt, insights, parseCopilotAnswer, } from "./fleet/insights.js";
|
|
35
36
|
export { appealPack, decisionPayload, GOV_DECISION_KINDS, renderAppealPack, ruleConsistency, signSubjectClaim, subjectTag, verifyDecision, verifyFactors, verifySubjectClaim, } from "./gov/index.js";
|
|
36
37
|
export { accessPayload, breakGlass, checkEpisodeTag, clinicianConfirmation, episodeSeed, episodesPack, episodeTag, healthFindings, protocolTrail, recommendationHash, recommendationPayload, verifyCommitment, verifyHealthSignature, } from "./health/index.js";
|
|
37
38
|
export { attachBlackbox, BlackboxAgentHooks, BlackboxCallbackHandler, blackboxAgentHooks, blackboxCallbacks, blackboxMiddleware, llmIds, llmIdsOf, trackMemory, wrapAnthropic, wrapBedrock, wrapGemini, wrapOpenAI, } from "./hooks/index.js";
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.16.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.
|
|
2
|
+
export const VERSION = "0.16.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.
|
|
4
|
+
"version": "0.16.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",
|