agent-inspect 6.31.5 → 6.31.7
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/CHANGELOG.md +13 -0
- package/README.md +1 -1
- package/docs/AI-SDK-ADOPTION.md +62 -34
- package/docs/SAFE-TRACE-SHARING.md +1 -1
- package/package.json +1 -1
- package/packages/cli/dist/{chunk-LKEPABND.mjs → chunk-QV73NM25.mjs} +100 -31
- package/packages/cli/dist/chunk-QV73NM25.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +474 -92
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +379 -67
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-4WYF5RFI.mjs → src-KFOBXFPN.mjs} +3 -3
- package/packages/cli/dist/{src-4WYF5RFI.mjs.map → src-KFOBXFPN.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +95 -23
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.mjs +11 -11
- package/packages/core/dist/checks.cjs +2 -5
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.mjs +3 -3
- package/packages/core/dist/{chunk-OSGNGRHF.mjs → chunk-3RV3JILQ.mjs} +34 -16
- package/packages/core/dist/chunk-3RV3JILQ.mjs.map +1 -0
- package/packages/core/dist/{chunk-NY4ILMXK.mjs → chunk-7YYS742B.mjs} +50 -13
- package/packages/core/dist/chunk-7YYS742B.mjs.map +1 -0
- package/packages/core/dist/{chunk-2KJR6X4V.mjs → chunk-DK3OW6UI.mjs} +3 -3
- package/packages/core/dist/chunk-DK3OW6UI.mjs.map +1 -0
- package/packages/core/dist/{chunk-PKDBFBJ7.mjs → chunk-LXYPM2ZO.mjs} +5 -8
- package/packages/core/dist/{chunk-PKDBFBJ7.mjs.map → chunk-LXYPM2ZO.mjs.map} +1 -1
- package/packages/core/dist/{chunk-INE5IWLN.mjs → chunk-N5PZAI6Q.mjs} +3 -3
- package/packages/core/dist/{chunk-INE5IWLN.mjs.map → chunk-N5PZAI6Q.mjs.map} +1 -1
- package/packages/core/dist/{chunk-Q5SLKV2Y.mjs → chunk-QLYUWKK7.mjs} +19 -2
- package/packages/core/dist/chunk-QLYUWKK7.mjs.map +1 -0
- package/packages/core/dist/{chunk-MTMTXTJL.mjs → chunk-VQUB3WRI.mjs} +4 -4
- package/packages/core/dist/{chunk-MTMTXTJL.mjs.map → chunk-VQUB3WRI.mjs.map} +1 -1
- package/packages/core/dist/exporters.cjs +253 -50
- package/packages/core/dist/exporters.cjs.map +1 -1
- package/packages/core/dist/exporters.mjs +208 -42
- package/packages/core/dist/exporters.mjs.map +1 -1
- package/packages/core/dist/index.cjs +1 -1
- package/packages/core/dist/index.cjs.map +1 -1
- package/packages/core/dist/index.mjs +4 -4
- package/packages/core/dist/persisted.cjs +17 -0
- package/packages/core/dist/persisted.cjs.map +1 -1
- package/packages/core/dist/persisted.mjs +2 -2
- package/packages/core/dist/readers.cjs +48 -13
- package/packages/core/dist/readers.cjs.map +1 -1
- package/packages/core/dist/readers.mjs +2 -2
- package/packages/core/dist/writers.cjs +1 -1
- package/packages/core/dist/writers.cjs.map +1 -1
- package/packages/core/dist/writers.mjs +1 -1
- package/packages/cli/dist/chunk-LKEPABND.mjs.map +0 -1
- package/packages/core/dist/chunk-2KJR6X4V.mjs.map +0 -1
- package/packages/core/dist/chunk-NY4ILMXK.mjs.map +0 -1
- package/packages/core/dist/chunk-OSGNGRHF.mjs.map +0 -1
- package/packages/core/dist/chunk-Q5SLKV2Y.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 6.31.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3f7abb5: Make timeline depth resolution cycle-safe and stack-safe for cyclic or very deep parent chains (GitHub #453 / #454).
|
|
8
|
+
- 3f7abb5: Preserve framework source attribution on CLI export via the persisted tree bridge, emit numeric OTLP StatusCode/SpanKind enums, map numeric status 0/1/2 on import, and harden OTLP nested validation with field-path diagnostics.
|
|
9
|
+
|
|
10
|
+
## 6.31.6
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 416869f: Close two false-SAFE share residuals: treat incomplete placeholders like `token=[REDACTED]/…` as secrets in free text, and strip or withhold connection-string userinfo when multihost authorities fail WHATWG URL parsing.
|
|
15
|
+
|
|
3
16
|
## 6.31.5
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -213,7 +213,7 @@ The root package is enough for custom capture, the CLI, checks, and Evidence wor
|
|
|
213
213
|
|
|
214
214
|
## Status and documentation
|
|
215
215
|
|
|
216
|
-
**Current published baseline:** **6.31.
|
|
216
|
+
**Current published baseline:** **6.31.7** · persisted schema `1.0` · Node.js `>=20` · MIT.
|
|
217
217
|
|
|
218
218
|
Legacy v0.1 and v0.2 traces remain readable. Check the npm badge and [changelog](CHANGELOG.md) for the current published version.
|
|
219
219
|
|
package/docs/AI-SDK-ADOPTION.md
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Blessed path for **Vercel AI SDK** + AgentInspect — local traces only, metadata-first by default.
|
|
4
4
|
|
|
5
|
+
**Peer:** `ai@^6.0.0` — tested with **`ai@6.0.210`**. This guide does not claim AI SDK 7 support.
|
|
6
|
+
|
|
5
7
|
## Install
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
|
-
npm install agent-inspect @agent-inspect/ai-sdk ai
|
|
10
|
+
npm install agent-inspect @agent-inspect/ai-sdk ai@6.0.210
|
|
9
11
|
```
|
|
10
12
|
|
|
11
13
|
Or bootstrap a project:
|
|
@@ -20,54 +22,79 @@ npx agent-inspect init --framework ai-sdk
|
|
|
20
22
|
import { generateText } from "ai";
|
|
21
23
|
import { agentInspect } from "@agent-inspect/ai-sdk";
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
isEnabled: true,
|
|
28
|
-
recordInputs: false,
|
|
29
|
-
recordOutputs: false,
|
|
30
|
-
integrations: [
|
|
31
|
-
agentInspect({
|
|
32
|
-
traceDir: ".agent-inspect",
|
|
33
|
-
runName: "support-agent",
|
|
34
|
-
capture: "metadata-only",
|
|
35
|
-
}),
|
|
36
|
-
],
|
|
37
|
-
},
|
|
25
|
+
const integration = agentInspect({
|
|
26
|
+
traceDir: ".agent-inspect",
|
|
27
|
+
runName: "support-agent",
|
|
28
|
+
capture: "metadata-only",
|
|
38
29
|
});
|
|
30
|
+
|
|
31
|
+
try {
|
|
32
|
+
await generateText({
|
|
33
|
+
model: yourModel,
|
|
34
|
+
prompt: "Hello",
|
|
35
|
+
experimental_telemetry: {
|
|
36
|
+
isEnabled: true,
|
|
37
|
+
recordInputs: false,
|
|
38
|
+
recordOutputs: false,
|
|
39
|
+
integrations: [integration],
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
} finally {
|
|
43
|
+
await integration.flush();
|
|
44
|
+
await integration.close();
|
|
45
|
+
}
|
|
39
46
|
```
|
|
40
47
|
|
|
48
|
+
Pass the integration only through `experimental_telemetry.integrations`. AgentInspect does **not** expose `getTelemetryMetadata()` or `getTelemetryHandlers()`.
|
|
49
|
+
|
|
41
50
|
## `streamText` (metadata-only)
|
|
42
51
|
|
|
43
52
|
```ts
|
|
44
53
|
import { streamText } from "ai";
|
|
45
54
|
import { agentInspect } from "@agent-inspect/ai-sdk";
|
|
46
55
|
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
isEnabled: true,
|
|
52
|
-
recordInputs: false,
|
|
53
|
-
recordOutputs: false,
|
|
54
|
-
integrations: [
|
|
55
|
-
agentInspect({
|
|
56
|
-
traceDir: ".agent-inspect",
|
|
57
|
-
runName: "stream-demo",
|
|
58
|
-
capture: "metadata-only",
|
|
59
|
-
}),
|
|
60
|
-
],
|
|
61
|
-
},
|
|
56
|
+
const integration = agentInspect({
|
|
57
|
+
traceDir: ".agent-inspect",
|
|
58
|
+
runName: "stream-demo",
|
|
59
|
+
capture: "metadata-only",
|
|
62
60
|
});
|
|
63
61
|
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
try {
|
|
63
|
+
const result = streamText({
|
|
64
|
+
model: yourModel,
|
|
65
|
+
prompt: "Hello",
|
|
66
|
+
experimental_telemetry: {
|
|
67
|
+
isEnabled: true,
|
|
68
|
+
recordInputs: false,
|
|
69
|
+
recordOutputs: false,
|
|
70
|
+
integrations: [integration],
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
for await (const _chunk of result.textStream) {
|
|
75
|
+
// consume stream
|
|
76
|
+
}
|
|
77
|
+
} finally {
|
|
78
|
+
await integration.flush();
|
|
79
|
+
await integration.close();
|
|
66
80
|
}
|
|
67
81
|
```
|
|
68
82
|
|
|
69
83
|
Streaming lifecycle metadata is captured; raw token streams are not persisted by default.
|
|
70
84
|
|
|
85
|
+
## Concurrent generations
|
|
86
|
+
|
|
87
|
+
Create a **new** `agentInspect()` instance for each concurrent generation. Do not share one integration across overlapping `generateText` / `streamText` calls.
|
|
88
|
+
|
|
89
|
+
## Diagnostics
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
const d = integration.getDiagnostics();
|
|
93
|
+
console.log(d.writeFailures, d.lifecycleWarnings, d.lastWarning, d.capture);
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Use `onDiagnostic` in options for live callbacks. Failures degrade locally; they do not throw into your agent return path.
|
|
97
|
+
|
|
71
98
|
## Tool calls
|
|
72
99
|
|
|
73
100
|
Tool spans appear when the model invokes tools. Keep `recordInputs` / `recordOutputs` false unless you explicitly accept content capture risk.
|
|
@@ -110,10 +137,11 @@ Use `--fail-on-observation` only when the run records explicit OUTCOME events.
|
|
|
110
137
|
|
|
111
138
|
| Symptom | Fix |
|
|
112
139
|
| ------- | --- |
|
|
113
|
-
| No trace file | Ensure `experimental_telemetry.isEnabled: true` and integrations
|
|
140
|
+
| No trace file | Ensure `experimental_telemetry.isEnabled: true` and `integrations: [integration]` |
|
|
114
141
|
| Empty trace | Confirm `AGENT_INSPECT` is not `0` |
|
|
115
142
|
| Prompts in trace | Set `recordInputs: false` and `recordOutputs: false` on the AI SDK call |
|
|
116
143
|
| Wrong directory | Pass `traceDir` to `agentInspect()` or set `AGENT_INSPECT_TRACE_DIR` |
|
|
144
|
+
| Mixed concurrent runs | Use a separate `agentInspect()` instance per overlapping generation |
|
|
117
145
|
|
|
118
146
|
## Recipes (no network)
|
|
119
147
|
|
|
@@ -43,7 +43,7 @@ For reviewer-reproducible trajectory checks (6.28+), prefer Evidence that includ
|
|
|
43
43
|
- Inspect log-derived fields from `logs` / `tail` ingest configs, including custom `run-id`, `event`, `parent`, timestamp, and attribute mappings.
|
|
44
44
|
- Avoid posting raw prompts, completions, tool inputs, or tool outputs in public threads unless the content is approved for public disclosure.
|
|
45
45
|
- For cross-system correlation, retain a bounded identifier instead of copying the external record or payload. Follow [External reference metadata](./EXTERNAL-REFERENCES.md), and expect `share` / `strict` profiles to redact the named correlation fields.
|
|
46
|
-
- `share` and `strict` rewrite http(s) URLs rather than dropping them: userinfo and credential-looking query or fragment params are replaced, identifier-like path segments become `[id]`, and scheme, host and path stay, so a retry on the same page is still recognizable. The same profiles also strip userinfo from common connection URIs (`postgres` / `postgresql`, `mysql` / `mariadb`, `mongodb` / `mongodb+srv`, `redis` / `rediss`, `amqp` / `amqps`) while keeping scheme, host, port, and database/queue path: `postgres://user:secret@db.example.com:5432/app_db` becomes `postgres://db.example.com:5432/app_db`. Other schemes still need a manual check.
|
|
46
|
+
- `share` and `strict` rewrite http(s) URLs rather than dropping them: userinfo and credential-looking query or fragment params are replaced, identifier-like path segments become `[id]`, and scheme, host and path stay, so a retry on the same page is still recognizable. The same profiles also strip userinfo from common connection URIs (`postgres` / `postgresql`, `mysql` / `mariadb`, `mongodb` / `mongodb+srv`, `redis` / `rediss`, `amqp` / `amqps`) while keeping scheme, host, port, and database/queue path: `postgres://user:secret@db.example.com:5432/app_db` becomes `postgres://db.example.com:5432/app_db`. When a connection authority cannot be parsed as a standard URL (for example multihost MongoDB lists), userinfo is still stripped or the whole value is withheld so credentials never remain in a SAFE share. Incomplete placeholders such as `token=[REDACTED]/…` are treated as residual secrets in free text. Other schemes still need a manual check.
|
|
47
47
|
- Prefer Markdown export for issue or PR sharing when a summarized tree is enough.
|
|
48
48
|
|
|
49
49
|
## Remove or replace sensitive values
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-inspect",
|
|
3
|
-
"version": "6.31.
|
|
3
|
+
"version": "6.31.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Local evidence debugger and trajectory-test toolkit for TypeScript AI agents — execution trees, TraceContract checks, Evidence v2, and read-only MCP",
|
|
@@ -930,7 +930,7 @@ var Redactor = class {
|
|
|
930
930
|
};
|
|
931
931
|
|
|
932
932
|
// packages/core/src/safety/credential-value-patterns.ts
|
|
933
|
-
var KEY_VALUE_SECRET_PATTERN = /\b(?:api[_-]?key|internal[_-]?token|access[_-]?token|auth[_-]?token|password|secret|token)=(?!\[(?:REDACTED(?::[^\]]*)?|HASH:[0-9a-f]{8})\](?![^\s"'
|
|
933
|
+
var KEY_VALUE_SECRET_PATTERN = /\b(?:api[_-]?key|internal[_-]?token|access[_-]?token|auth[_-]?token|password|secret|token)=(?!\[(?:REDACTED(?::[^\]]*)?|HASH:[0-9a-f]{8})\](?![^\s"'\\&#?]))([^\s"'\\]{8,})/i;
|
|
934
934
|
var HIGH_CONFIDENCE_CREDENTIAL_PATTERNS = [
|
|
935
935
|
/^(?:basic|bearer|digest|apikey)\s+[a-z0-9._~+/=-]+$/i,
|
|
936
936
|
/\bbearer\s+[a-z0-9._~+/=-]{12,}\b/i,
|
|
@@ -2243,6 +2243,8 @@ function renderTraceStats(stats) {
|
|
|
2243
2243
|
}
|
|
2244
2244
|
|
|
2245
2245
|
// packages/core/src/timeline.ts
|
|
2246
|
+
var ROOT_TIMELINE_DEPTH = 0;
|
|
2247
|
+
var MAX_TIMELINE_DEPTH = 1e3;
|
|
2246
2248
|
function finite(n) {
|
|
2247
2249
|
return typeof n === "number" && Number.isFinite(n);
|
|
2248
2250
|
}
|
|
@@ -2313,16 +2315,51 @@ function buildRunTimeline(events, options = {}) {
|
|
|
2313
2315
|
const computeDepth = (stepId) => {
|
|
2314
2316
|
const cached = depthCache.get(stepId);
|
|
2315
2317
|
if (cached !== void 0) return cached;
|
|
2316
|
-
const
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2318
|
+
const ancestry = [];
|
|
2319
|
+
const ancestryIndexes = /* @__PURE__ */ new Map();
|
|
2320
|
+
let currentStepId = stepId;
|
|
2321
|
+
let resolvedDepth;
|
|
2322
|
+
while (resolvedDepth === void 0) {
|
|
2323
|
+
const cachedDepth = depthCache.get(currentStepId);
|
|
2324
|
+
if (cachedDepth !== void 0) {
|
|
2325
|
+
resolvedDepth = cachedDepth;
|
|
2326
|
+
continue;
|
|
2327
|
+
}
|
|
2328
|
+
const cycleStart = ancestryIndexes.get(currentStepId);
|
|
2329
|
+
if (cycleStart !== void 0) {
|
|
2330
|
+
const cycleStepIds = ancestry.splice(cycleStart);
|
|
2331
|
+
for (const cycleStepId of cycleStepIds) {
|
|
2332
|
+
depthCache.set(cycleStepId, ROOT_TIMELINE_DEPTH);
|
|
2333
|
+
}
|
|
2334
|
+
resolvedDepth = ROOT_TIMELINE_DEPTH;
|
|
2335
|
+
continue;
|
|
2336
|
+
}
|
|
2337
|
+
const currentStep = steps.get(currentStepId);
|
|
2338
|
+
if (!currentStep) {
|
|
2339
|
+
resolvedDepth = ROOT_TIMELINE_DEPTH;
|
|
2340
|
+
continue;
|
|
2341
|
+
}
|
|
2342
|
+
ancestryIndexes.set(currentStepId, ancestry.length);
|
|
2343
|
+
ancestry.push(currentStepId);
|
|
2344
|
+
const parentId = currentStep.parentId;
|
|
2345
|
+
if (typeof parentId !== "string" || parentId.trim() === "" || !steps.has(parentId)) {
|
|
2346
|
+
ancestry.pop();
|
|
2347
|
+
depthCache.set(currentStepId, ROOT_TIMELINE_DEPTH);
|
|
2348
|
+
resolvedDepth = ROOT_TIMELINE_DEPTH;
|
|
2349
|
+
continue;
|
|
2350
|
+
}
|
|
2351
|
+
currentStepId = parentId;
|
|
2352
|
+
}
|
|
2353
|
+
ancestry.reverse();
|
|
2354
|
+
for (const ancestorStepId of ancestry) {
|
|
2355
|
+
resolvedDepth = Math.min(MAX_TIMELINE_DEPTH, resolvedDepth + 1);
|
|
2356
|
+
depthCache.set(ancestorStepId, resolvedDepth);
|
|
2322
2357
|
}
|
|
2323
|
-
const
|
|
2324
|
-
|
|
2325
|
-
|
|
2358
|
+
const resolvedStepDepth = depthCache.get(stepId);
|
|
2359
|
+
if (resolvedStepDepth === void 0) {
|
|
2360
|
+
throw new Error(`Failed to resolve timeline depth for step "${stepId}"`);
|
|
2361
|
+
}
|
|
2362
|
+
return resolvedStepDepth;
|
|
2326
2363
|
};
|
|
2327
2364
|
const entries = [];
|
|
2328
2365
|
for (const [stepId, s] of steps.entries()) {
|
|
@@ -7307,7 +7344,7 @@ var DEFAULT_SECRET_PATTERNS = [
|
|
|
7307
7344
|
// Keep in sync with packages/redact/src/key-value-secret.ts (KEY_VALUE_SECRET_PATTERN_SOURCE).
|
|
7308
7345
|
{
|
|
7309
7346
|
id: "key-value-secret",
|
|
7310
|
-
pattern: /\b(?:api[_-]?key|internal[_-]?token|access[_-]?token|auth[_-]?token|password|secret|token)=(?!\[(?:REDACTED(?::[^\]]*)?|HASH:[0-9a-f]{8})\](?![^\s"'
|
|
7347
|
+
pattern: /\b(?:api[_-]?key|internal[_-]?token|access[_-]?token|auth[_-]?token|password|secret|token)=(?!\[(?:REDACTED(?::[^\]]*)?|HASH:[0-9a-f]{8})\](?![^\s"'\\&#?]))([^\s"'\\]{8,})/i
|
|
7311
7348
|
}
|
|
7312
7349
|
];
|
|
7313
7350
|
function compareStrings(a, b) {
|
|
@@ -7732,9 +7769,6 @@ function limitFindings(findings, maxFindings) {
|
|
|
7732
7769
|
if (maxFindings === void 0 || findings.length <= maxFindings) return findings;
|
|
7733
7770
|
return findings.slice(0, Math.max(0, maxFindings));
|
|
7734
7771
|
}
|
|
7735
|
-
function hasRedactionMarker(value, markers) {
|
|
7736
|
-
return markers.some((marker) => value.includes(marker)) || /^\[HASH:[A-Za-z0-9_-]+\]$/.test(value);
|
|
7737
|
-
}
|
|
7738
7772
|
function isFullyRedactedValue(value, markers = ["[REDACTED]", "[REDACTED:"]) {
|
|
7739
7773
|
if (typeof value !== "string") return false;
|
|
7740
7774
|
const trimmed = value.trim();
|
|
@@ -8721,7 +8755,7 @@ function createSafetyRedactionRule(options = {}) {
|
|
|
8721
8755
|
for (const event of context.events) {
|
|
8722
8756
|
for (const entry of eventValueEntries(event, { includeSummaries: true, includeError: true })) {
|
|
8723
8757
|
if (!isSensitiveKey(entry.key ?? lastPathSegment(entry.path), sensitiveKeys)) continue;
|
|
8724
|
-
if (
|
|
8758
|
+
if (isFullyRedactedValue(entry.value, markers)) continue;
|
|
8725
8759
|
findings.push(
|
|
8726
8760
|
failFinding(
|
|
8727
8761
|
"safety.redaction",
|
|
@@ -11885,6 +11919,23 @@ function persistedInspectEventToInspectEvent(event) {
|
|
|
11885
11919
|
if (event.durationMs !== void 0 && Number.isFinite(event.durationMs) && event.durationMs >= 0) {
|
|
11886
11920
|
out.durationMs = event.durationMs;
|
|
11887
11921
|
}
|
|
11922
|
+
if (event.startedAt !== void 0) {
|
|
11923
|
+
const started = parseIsoToMs3(event.startedAt);
|
|
11924
|
+
if (!started.invalidTimestamp) {
|
|
11925
|
+
attrs.startedAtMs = started.ms;
|
|
11926
|
+
out.timestamp = started.ms;
|
|
11927
|
+
}
|
|
11928
|
+
}
|
|
11929
|
+
if (event.endedAt !== void 0) {
|
|
11930
|
+
const ended = parseIsoToMs3(event.endedAt);
|
|
11931
|
+
if (!ended.invalidTimestamp) {
|
|
11932
|
+
attrs.endedAtMs = ended.ms;
|
|
11933
|
+
if (out.durationMs === void 0 && typeof attrs.startedAtMs === "number" && ended.ms >= attrs.startedAtMs) {
|
|
11934
|
+
out.durationMs = ended.ms - attrs.startedAtMs;
|
|
11935
|
+
}
|
|
11936
|
+
}
|
|
11937
|
+
}
|
|
11938
|
+
out.attributes = compactAttributes3(attrs);
|
|
11888
11939
|
return out;
|
|
11889
11940
|
}
|
|
11890
11941
|
function persistedInspectEventsToInspectEvents(events, options) {
|
|
@@ -12946,20 +12997,38 @@ function extractOtlpDocument(root) {
|
|
|
12946
12997
|
function mapOtlpStatus(status) {
|
|
12947
12998
|
if (!isRecord11(status)) return void 0;
|
|
12948
12999
|
const rawCode = status.code;
|
|
12949
|
-
if (typeof rawCode
|
|
12950
|
-
|
|
12951
|
-
|
|
12952
|
-
|
|
12953
|
-
|
|
12954
|
-
|
|
12955
|
-
|
|
12956
|
-
|
|
12957
|
-
|
|
12958
|
-
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
|
|
13000
|
+
if (typeof rawCode === "number" && Number.isFinite(rawCode)) {
|
|
13001
|
+
switch (rawCode) {
|
|
13002
|
+
case 0:
|
|
13003
|
+
return "unknown";
|
|
13004
|
+
case 1:
|
|
13005
|
+
return "ok";
|
|
13006
|
+
case 2:
|
|
13007
|
+
return "error";
|
|
13008
|
+
default:
|
|
13009
|
+
return "unknown";
|
|
13010
|
+
}
|
|
13011
|
+
}
|
|
13012
|
+
if (typeof rawCode === "string") {
|
|
13013
|
+
const trimmed = rawCode.trim();
|
|
13014
|
+
if (/^\d+$/.test(trimmed)) {
|
|
13015
|
+
return mapOtlpStatus({ code: Number(trimmed) });
|
|
13016
|
+
}
|
|
13017
|
+
switch (trimmed.toUpperCase()) {
|
|
13018
|
+
case "STATUS_CODE_OK":
|
|
13019
|
+
case "OK":
|
|
13020
|
+
return "ok";
|
|
13021
|
+
case "STATUS_CODE_ERROR":
|
|
13022
|
+
case "ERROR":
|
|
13023
|
+
return "error";
|
|
13024
|
+
case "STATUS_CODE_UNSET":
|
|
13025
|
+
case "UNSET":
|
|
13026
|
+
return "unknown";
|
|
13027
|
+
default:
|
|
13028
|
+
return "unknown";
|
|
13029
|
+
}
|
|
12962
13030
|
}
|
|
13031
|
+
return void 0;
|
|
12963
13032
|
}
|
|
12964
13033
|
function readOtlpKind(attributes, pathPrefix) {
|
|
12965
13034
|
const warnings = [];
|
|
@@ -14890,6 +14959,6 @@ function renderGateReport(result, options = {}) {
|
|
|
14890
14959
|
return renderGateSummaryMarkdown(result);
|
|
14891
14960
|
}
|
|
14892
14961
|
|
|
14893
|
-
export { ATTRIBUTION_CONFIDENCES, COHORT_METRIC_IDS, DEFAULT_REDACT_KEYS, DEFAULT_SUITE_ARTIFACTS_DIR, EVIDENCE_FORMAT_VERSION, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, Redactor, TraceDirectory, TraceReadError, TreeBuilder, aggregateBundleSafeStatus, aggregateSessionCheckResults, analyzeCohort, applyProfileMetadataCaps, assertBundlePathContained, assertEvidenceRelativePath, buildActivitySummary, buildBundleMetadata, buildBundleSummaryMarkdown, buildEvidenceCausalFailureViewHtml, buildEvidenceCiPackage, buildEvidenceCircuitViewHtml, buildEvidenceContractsViewHtml, buildEvidenceDiffViewHtml, buildEvidenceHtmlShell, buildEvidenceManifest, buildEvidenceOutcomesViewHtml, buildEvidenceProvenanceViewHtml, buildEvidenceSafetyViewHtml, buildEvidenceTimelineViewHtml, buildEvidenceToolsLlmViewHtml, buildEvidenceTreeViewHtml, buildLocalExplanation, buildPlaceholderArtifact, buildRunSummary, buildRunTimeline, buildRunWhatSummary, buildSessionIndex, buildTraceStats, buildZipArchive, bundleFailsOnSafety, bundleRunAssetRelativePath, collectTraceSchemaVersions, compactAttributes, createBaselineRegressionRule, createLlmUsageRule, createMaxStepDurationRule, createObservedOutcomeRule, createRequireCompletedRule, createRunDepthRule, createRunDurationRule, createRunStatusRule, createSafetyOversizedAttributeRule, createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createStallDetectionRule, createStructureCycleRule, createStructureOrphanRule, createStructureParallelWidthRule, createStructureRelationshipRule, createToolUsageRule, defaultBundleOutputPath, defaultSuiteConfigTemplate, defineTraceContract, diffRuns, diffTraceEvents, enrichSessionRunRecord, escapeHtml, escapeMarkdown, evaluateTraceContract, extractMetadata, extractOutcomesFromTraceEvents, filterMetasBySessionScope, filterTraces, flattenTree, formatDuration2 as formatDuration, formatStepLabel, formatTimestamp, gateHasThresholds, getIndent, getTraceFilePath, inferEvidenceFileRole, isAgentInspectTrace, isAttributionConfidence, isCredentialSensitiveKey, isPersistedInspectEvent, loadSessionRunRecords, loadSuiteConfig, loadTraceMetadataList, manualTraceEventsToComparableRun, nanoid, normalizeBundleOutputPath, openTrace, parseCohortMetricList, parseDuration, parseDurationFilter, parseGateList, parseTraceJsonl, persistedInspectEventsToTraceEvents, projectLogicalEvents, renderActivitySummaryHuman, renderCohortReport, renderErrorLine, renderGateReport, renderObservedOutcomesHtml, renderObservedOutcomesMarkdown, renderRunDiff, renderRunWhat, renderStepLine, renderSuiteReport, renderTimeline, renderTraceStats, resolveBundleRunIds, resolveRedactionProfile, resolveSuiteTemplate, resolveTraceDir, runGate, runSuite, runTraceChecks, safeString, sanitizeBundleRunId, searchTraces, serializeEvidenceManifest, sha256Hex, stableJson, stringContainsHighConfidenceCredential, summarizeObservedOutcomes, summarizeSemanticParity, traceEventToPersistedInspectEvent, truncateName, truncateStringForProfile, validateEvent, validateSuiteConfig, verifyEvidenceDirectory, zeroKinds };
|
|
14894
|
-
//# sourceMappingURL=chunk-
|
|
14895
|
-
//# sourceMappingURL=chunk-
|
|
14962
|
+
export { ATTRIBUTION_CONFIDENCES, COHORT_METRIC_IDS, DEFAULT_REDACT_KEYS, DEFAULT_SUITE_ARTIFACTS_DIR, EVIDENCE_FORMAT_VERSION, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, Redactor, TraceDirectory, TraceReadError, TreeBuilder, aggregateBundleSafeStatus, aggregateSessionCheckResults, analyzeCohort, applyProfileMetadataCaps, assertBundlePathContained, assertEvidenceRelativePath, buildActivitySummary, buildBundleMetadata, buildBundleSummaryMarkdown, buildEvidenceCausalFailureViewHtml, buildEvidenceCiPackage, buildEvidenceCircuitViewHtml, buildEvidenceContractsViewHtml, buildEvidenceDiffViewHtml, buildEvidenceHtmlShell, buildEvidenceManifest, buildEvidenceOutcomesViewHtml, buildEvidenceProvenanceViewHtml, buildEvidenceSafetyViewHtml, buildEvidenceTimelineViewHtml, buildEvidenceToolsLlmViewHtml, buildEvidenceTreeViewHtml, buildLocalExplanation, buildPlaceholderArtifact, buildRunSummary, buildRunTimeline, buildRunWhatSummary, buildSessionIndex, buildTraceStats, buildZipArchive, bundleFailsOnSafety, bundleRunAssetRelativePath, collectTraceSchemaVersions, compactAttributes, createBaselineRegressionRule, createLlmUsageRule, createMaxStepDurationRule, createObservedOutcomeRule, createRequireCompletedRule, createRunDepthRule, createRunDurationRule, createRunStatusRule, createSafetyOversizedAttributeRule, createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createStallDetectionRule, createStructureCycleRule, createStructureOrphanRule, createStructureParallelWidthRule, createStructureRelationshipRule, createToolUsageRule, defaultBundleOutputPath, defaultSuiteConfigTemplate, defineTraceContract, diffRuns, diffTraceEvents, enrichSessionRunRecord, escapeHtml, escapeMarkdown, evaluateTraceContract, extractMetadata, extractOutcomesFromTraceEvents, filterMetasBySessionScope, filterTraces, flattenTree, formatDuration2 as formatDuration, formatStepLabel, formatTimestamp, gateHasThresholds, getIndent, getTraceFilePath, inferEvidenceFileRole, isAgentInspectTrace, isAttributionConfidence, isCredentialSensitiveKey, isPersistedInspectEvent, loadSessionRunRecords, loadSuiteConfig, loadTraceMetadataList, manualTraceEventsToComparableRun, nanoid, normalizeBundleOutputPath, openTrace, parseCohortMetricList, parseDuration, parseDurationFilter, parseGateList, parseTraceJsonl, persistedInspectEventsToRunTrees, persistedInspectEventsToTraceEvents, projectLogicalEvents, renderActivitySummaryHuman, renderCohortReport, renderErrorLine, renderGateReport, renderObservedOutcomesHtml, renderObservedOutcomesMarkdown, renderRunDiff, renderRunWhat, renderStepLine, renderSuiteReport, renderTimeline, renderTraceStats, resolveBundleRunIds, resolveRedactionProfile, resolveSuiteTemplate, resolveTraceDir, runGate, runSuite, runTraceChecks, safeString, sanitizeBundleRunId, searchTraces, serializeEvidenceManifest, sha256Hex, stableJson, stringContainsHighConfidenceCredential, summarizeObservedOutcomes, summarizeSemanticParity, traceEventToPersistedInspectEvent, truncateName, truncateStringForProfile, validateEvent, validateSuiteConfig, verifyEvidenceDirectory, zeroKinds };
|
|
14963
|
+
//# sourceMappingURL=chunk-QV73NM25.mjs.map
|
|
14964
|
+
//# sourceMappingURL=chunk-QV73NM25.mjs.map
|