@warlock.js/ai-panoptic 5.29.0 → 5.31.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 (163) hide show
  1. package/CHANGELOG.md +21 -3
  2. package/README.md +2 -2
  3. package/cjs/index.cjs +53 -50
  4. package/cjs/index.cjs.map +1 -1
  5. package/esm/collector/collector.d.mts +1 -1
  6. package/esm/collector/collector.d.mts.map +1 -1
  7. package/esm/collector/collector.mjs +1 -1
  8. package/esm/collector/collector.mjs.map +1 -1
  9. package/esm/collector/content-capture.type.d.mts +1 -1
  10. package/esm/collector/content-capture.type.d.mts.map +1 -1
  11. package/esm/collector/extract-span-attributes.d.mts +1 -1
  12. package/esm/collector/extract-span-attributes.d.mts.map +1 -1
  13. package/esm/collector/extract-span-attributes.mjs +2 -1
  14. package/esm/collector/extract-span-attributes.mjs.map +1 -1
  15. package/esm/collector/normalize-error.d.mts +1 -1
  16. package/esm/collector/normalize-error.d.mts.map +1 -1
  17. package/esm/collector/normalize-error.mjs +1 -1
  18. package/esm/collector/normalize-error.mjs.map +1 -1
  19. package/esm/collector/report-to-span.d.mts +1 -1
  20. package/esm/collector/report-to-span.d.mts.map +1 -1
  21. package/esm/collector/report-to-span.mjs +1 -1
  22. package/esm/collector/report-to-span.mjs.map +1 -1
  23. package/esm/collector/report-to-trace.d.mts +1 -1
  24. package/esm/collector/report-to-trace.d.mts.map +1 -1
  25. package/esm/collector/report-to-trace.mjs +1 -1
  26. package/esm/collector/report-to-trace.mjs.map +1 -1
  27. package/esm/config/apply-panoptic-config.d.mts +1 -1
  28. package/esm/config/apply-panoptic-config.d.mts.map +1 -1
  29. package/esm/config/apply-panoptic-config.mjs +1 -1
  30. package/esm/config/apply-panoptic-config.mjs.map +1 -1
  31. package/esm/config/panoptic-config.type.d.mts +1 -1
  32. package/esm/config/panoptic-config.type.d.mts.map +1 -1
  33. package/esm/contracts/collector.contract.d.mts +1 -1
  34. package/esm/contracts/collector.contract.d.mts.map +1 -1
  35. package/esm/contracts/exporter.contract.d.mts +1 -1
  36. package/esm/contracts/exporter.contract.d.mts.map +1 -1
  37. package/esm/contracts/trace.type.d.mts +1 -1
  38. package/esm/contracts/trace.type.d.mts.map +1 -1
  39. package/esm/dashboard/dashboard.d.mts +1 -1
  40. package/esm/dashboard/dashboard.d.mts.map +1 -1
  41. package/esm/dashboard/dashboard.mjs +1 -1
  42. package/esm/dashboard/dashboard.mjs.map +1 -1
  43. package/esm/dashboard/dashboard.type.d.mts +1 -1
  44. package/esm/dashboard/dashboard.type.d.mts.map +1 -1
  45. package/esm/dashboard/parse-query.mjs +2 -1
  46. package/esm/dashboard/parse-query.mjs.map +1 -1
  47. package/esm/dashboard/serve.mjs +1 -1
  48. package/esm/dashboard/serve.mjs.map +1 -1
  49. package/esm/dashboard/trace-filter.d.mts +1 -1
  50. package/esm/dashboard/trace-filter.d.mts.map +1 -1
  51. package/esm/dashboard/trace-filter.mjs +2 -2
  52. package/esm/dashboard/trace-filter.mjs.map +1 -1
  53. package/esm/dashboard/ui.html.mjs +6 -5
  54. package/esm/dashboard/ui.html.mjs.map +1 -1
  55. package/esm/dashboard/warlock-logo.mjs +1 -1
  56. package/esm/dashboard/warlock-logo.mjs.map +1 -1
  57. package/esm/evaluate/evaluate-system-prompt.d.mts +1 -1
  58. package/esm/evaluate/evaluate-system-prompt.d.mts.map +1 -1
  59. package/esm/evaluate/evaluate-system-prompt.mjs +1 -1
  60. package/esm/evaluate/evaluate-system-prompt.mjs.map +1 -1
  61. package/esm/evaluate/evaluate.type.d.mts +1 -1
  62. package/esm/evaluate/evaluate.type.d.mts.map +1 -1
  63. package/esm/evaluate/extract-last-system-prompt.d.mts +1 -1
  64. package/esm/evaluate/extract-last-system-prompt.d.mts.map +1 -1
  65. package/esm/evaluate/extract-last-system-prompt.mjs +1 -1
  66. package/esm/evaluate/extract-last-system-prompt.mjs.map +1 -1
  67. package/esm/evaluate/find-span-by-id.d.mts +1 -1
  68. package/esm/evaluate/find-span-by-id.d.mts.map +1 -1
  69. package/esm/evaluate/find-span-by-id.mjs +1 -1
  70. package/esm/evaluate/find-span-by-id.mjs.map +1 -1
  71. package/esm/exporters/console/console-exporter.d.mts +1 -1
  72. package/esm/exporters/console/console-exporter.d.mts.map +1 -1
  73. package/esm/exporters/console/console-exporter.mjs +5 -4
  74. package/esm/exporters/console/console-exporter.mjs.map +1 -1
  75. package/esm/exporters/console/console-exporter.type.d.mts +1 -1
  76. package/esm/exporters/console/console-exporter.type.d.mts.map +1 -1
  77. package/esm/exporters/console/format-span-io.d.mts +1 -1
  78. package/esm/exporters/console/format-span-io.d.mts.map +1 -1
  79. package/esm/exporters/console/format-span-io.mjs +1 -1
  80. package/esm/exporters/console/format-span-io.mjs.map +1 -1
  81. package/esm/exporters/console/format-span-line.d.mts +1 -1
  82. package/esm/exporters/console/format-span-line.d.mts.map +1 -1
  83. package/esm/exporters/console/format-span-line.mjs +3 -1
  84. package/esm/exporters/console/format-span-line.mjs.map +1 -1
  85. package/esm/exporters/console/index.mjs +5 -0
  86. package/esm/exporters/file/file-exporter.d.mts +1 -1
  87. package/esm/exporters/file/file-exporter.d.mts.map +1 -1
  88. package/esm/exporters/file/file-exporter.mjs +1 -1
  89. package/esm/exporters/file/file-exporter.mjs.map +1 -1
  90. package/esm/exporters/file/file-exporter.type.d.mts +1 -1
  91. package/esm/exporters/file/file-exporter.type.d.mts.map +1 -1
  92. package/esm/exporters/index.mjs +2 -0
  93. package/esm/exporters/langfuse/langfuse-exporter.d.mts +1 -1
  94. package/esm/exporters/langfuse/langfuse-exporter.d.mts.map +1 -1
  95. package/esm/exporters/langfuse/langfuse-exporter.mjs +4 -3
  96. package/esm/exporters/langfuse/langfuse-exporter.mjs.map +1 -1
  97. package/esm/exporters/langfuse/langfuse-exporter.type.d.mts +1 -1
  98. package/esm/exporters/langfuse/langfuse-exporter.type.d.mts.map +1 -1
  99. package/esm/exporters/otel/otel-api.shim.type.d.mts +1 -1
  100. package/esm/exporters/otel/otel-api.shim.type.d.mts.map +1 -1
  101. package/esm/exporters/otel/otel-exporter.d.mts +1 -1
  102. package/esm/exporters/otel/otel-exporter.d.mts.map +1 -1
  103. package/esm/exporters/otel/otel-exporter.mjs +3 -2
  104. package/esm/exporters/otel/otel-exporter.mjs.map +1 -1
  105. package/esm/exporters/otel/otel-exporter.type.d.mts +1 -1
  106. package/esm/exporters/otel/otel-exporter.type.d.mts.map +1 -1
  107. package/esm/exporters/utils/gen-ai-attributes.d.mts +1 -1
  108. package/esm/exporters/utils/gen-ai-attributes.d.mts.map +1 -1
  109. package/esm/exporters/utils/gen-ai-attributes.mjs +1 -1
  110. package/esm/exporters/utils/gen-ai-attributes.mjs.map +1 -1
  111. package/esm/exporters/utils/index.mjs +5 -0
  112. package/esm/exporters/utils/total-cost.d.mts +3 -5
  113. package/esm/exporters/utils/total-cost.d.mts.map +1 -1
  114. package/esm/exporters/utils/total-cost.mjs +6 -8
  115. package/esm/exporters/utils/total-cost.mjs.map +1 -1
  116. package/esm/exporters/utils/walk-spans.d.mts +1 -1
  117. package/esm/exporters/utils/walk-spans.d.mts.map +1 -1
  118. package/esm/exporters/utils/walk-spans.mjs +1 -1
  119. package/esm/exporters/utils/walk-spans.mjs.map +1 -1
  120. package/esm/panoptic/panoptic-middleware.d.mts +1 -1
  121. package/esm/panoptic/panoptic-middleware.d.mts.map +1 -1
  122. package/esm/panoptic/panoptic-middleware.mjs +1 -1
  123. package/esm/panoptic/panoptic-middleware.mjs.map +1 -1
  124. package/esm/panoptic/panoptic-target.type.d.mts +1 -1
  125. package/esm/panoptic/panoptic-target.type.d.mts.map +1 -1
  126. package/esm/panoptic/panoptic.d.mts +1 -1
  127. package/esm/panoptic/panoptic.d.mts.map +1 -1
  128. package/esm/panoptic/panoptic.mjs +1 -1
  129. package/esm/panoptic/panoptic.mjs.map +1 -1
  130. package/esm/panoptic/panoptic.type.d.mts +1 -1
  131. package/esm/panoptic/panoptic.type.d.mts.map +1 -1
  132. package/esm/register.mjs +1 -1
  133. package/esm/register.mjs.map +1 -1
  134. package/esm/store/cache-trace-store.d.mts +1 -1
  135. package/esm/store/cache-trace-store.d.mts.map +1 -1
  136. package/esm/store/cache-trace-store.mjs +2 -1
  137. package/esm/store/cache-trace-store.mjs.map +1 -1
  138. package/esm/store/in-memory-trace-store.d.mts +1 -1
  139. package/esm/store/in-memory-trace-store.d.mts.map +1 -1
  140. package/esm/store/in-memory-trace-store.mjs +4 -2
  141. package/esm/store/in-memory-trace-store.mjs.map +1 -1
  142. package/esm/store/match-trace.d.mts +1 -1
  143. package/esm/store/match-trace.d.mts.map +1 -1
  144. package/esm/store/match-trace.mjs +1 -1
  145. package/esm/store/match-trace.mjs.map +1 -1
  146. package/esm/store/sum-usage.d.mts +1 -1
  147. package/esm/store/sum-usage.d.mts.map +1 -1
  148. package/esm/store/sum-usage.mjs +1 -1
  149. package/esm/store/sum-usage.mjs.map +1 -1
  150. package/esm/store/trace-aggregate.type.d.mts +3 -7
  151. package/esm/store/trace-aggregate.type.d.mts.map +1 -1
  152. package/esm/store/trace-query.type.d.mts +1 -1
  153. package/esm/store/trace-query.type.d.mts.map +1 -1
  154. package/esm/store/trace-store.contract.d.mts +1 -1
  155. package/esm/store/trace-store.contract.d.mts.map +1 -1
  156. package/llms-full.txt +134 -117
  157. package/package.json +6 -5
  158. package/skills/evaluate-system-prompt/SKILL.md +21 -17
  159. package/skills/export-traces/SKILL.md +32 -24
  160. package/skills/index.md +3 -0
  161. package/skills/observe-with-panoptic/SKILL.md +18 -18
  162. package/skills/query-traces/SKILL.md +31 -33
  163. package/skills/use-local-dashboard/SKILL.md +33 -26
package/CHANGELOG.md CHANGED
@@ -4,6 +4,23 @@ All notable changes to `@warlock.js/ai-panoptic` are documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
6
6
 
7
+ ## 5.31.0 - 2026-10-18
8
+
9
+ ### Fixed
10
+
11
+ - Trace cost totals (exporters, the dashboard and trace filters) include the new cache-write cost channel.
12
+
13
+ ### Added
14
+
15
+ - Tool spans carry the provider's tool-call id as the `tool.callId` attribute.
16
+ - Agent runs with `status: "incomplete"` (their final answer was cut off) are exported as errors: OTel `ERROR` status, Langfuse level `ERROR`, the console exporter's error stream (marked `INCOMPLETE`), the dashboard's error filter, and the `failed` count of trace-store aggregates. `?status=incomplete` is accepted by the dashboard API.
17
+
18
+ ## 5.30.0 - 2026-10-16
19
+
20
+ ### Changed
21
+
22
+ - Lockstep release; package APIs are unchanged.
23
+
7
24
  ## 5.29.0 - 2026-10-01
8
25
 
9
26
  ### Changed
@@ -75,6 +92,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
75
92
  ### Changed
76
93
 
77
94
  - Lockstep release maintenance and dependency refresh.
95
+
78
96
  ## 5.20.0 - 2026-09-24
79
97
 
80
98
  ### Changed
@@ -140,9 +158,9 @@ changelogs.
140
158
 
141
159
  - **Dashboard stored XSS via `javascript:` markdown links — fixed.** The dashboard's markdown link renderer (`mdInline` in `ui.html.ts`) rewrote `[text](url)` into a live `<a href>` without validating the URL scheme, so a `javascript:` URL embedded in captured trace content (`span.input` / `span.output` under `captureContent` — i.e. prompt-injected model output or attacker-controlled tool results) became a stored XSS that fired when an operator clicked the link; the page's CSP (`script-src 'unsafe-inline'`) permits `javascript:` URI execution and does not restrict top-level navigation, putting the in-page bearer token in reach. Link URLs are now checked against a scheme allowlist (`http:`, `https:`, `mailto:`, plus relative/anchor URLs) after normalizing the URL the way a browser will — attribute-entity decode, strip of ignored control chars/whitespace (`java\tscript:`), lowercase — and scheme-relative `//host` links are rejected too; a rejected URL renders its label as plain text with no `href` at all. Regression-tested by executing the actual inlined client renderer against `javascript:`/`data:`/`vbscript:` payloads and their case/whitespace/entity obfuscations (`ui.html.md-links.spec.ts`)
142
160
  - **Dashboard token-handling hardening (3 residual findings from the same audit as the XSS above).** None of these are exploitable on their own today, but each widened the blast radius of a future bug:
143
- - *Bearer token no longer a page-global.* `ui.html.ts`'s client script kept `TOKEN` as a `var` shared across its whole ~1000-line closure. It's now sealed inside its own inner IIFE that exposes only the `fetchAuthed` helper — code elsewhere in that closure (present or future) can no longer read the raw token by name.
144
- - *Constant-time token comparison.* `serve.ts`'s `isAuthorized` compared the header/query token with plain `===`, which short-circuits on the first differing byte and is a textbook timing side-channel — the one scenario the package's own docs call out as realistic (`authToken` is required specifically when bound off-loopback, i.e. reachable over a network). Both the header and query-string checks now go through `crypto.timingSafeEqual` on length-checked, equal-length buffers.
145
- - *Token-in-URL narrowed to the one route that needs it.* `?token=` is no longer accepted on the JSON API routes, only on the HTML page route. The page's own polling already re-sends the token as an `Authorization` header (fixed in 4.8.2), so the only request that structurally *can't* carry a header is the initial browser navigation that loads the HTML shell — that's the sole remaining query-string exposure, narrowing the token's footprint in access/proxy logs and browser history from every poll to one request.
161
+ - _Bearer token no longer a page-global._ `ui.html.ts`'s client script kept `TOKEN` as a `var` shared across its whole ~1000-line closure. It's now sealed inside its own inner IIFE that exposes only the `fetchAuthed` helper — code elsewhere in that closure (present or future) can no longer read the raw token by name.
162
+ - _Constant-time token comparison._ `serve.ts`'s `isAuthorized` compared the header/query token with plain `===`, which short-circuits on the first differing byte and is a textbook timing side-channel — the one scenario the package's own docs call out as realistic (`authToken` is required specifically when bound off-loopback, i.e. reachable over a network). Both the header and query-string checks now go through `crypto.timingSafeEqual` on length-checked, equal-length buffers.
163
+ - _Token-in-URL narrowed to the one route that needs it._ `?token=` is no longer accepted on the JSON API routes, only on the HTML page route. The page's own polling already re-sends the token as an `Authorization` header (fixed in 4.8.2), so the only request that structurally _can't_ carry a header is the initial browser navigation that loads the HTML shell — that's the sole remaining query-string exposure, narrowing the token's footprint in access/proxy logs and browser history from every poll to one request.
146
164
 
147
165
  ## 4.12.0
148
166
 
package/README.md CHANGED
@@ -81,8 +81,8 @@ Four exporters ship today, each a factory returning an `ExporterContract`:
81
81
  ```ts
82
82
  import {
83
83
  consoleExporter, // zero-dep — print trace summary or full span tree
84
- fileExporter, // zero-dep — append traces as JSON Lines, buffered
85
- otelExporter, // OpenTelemetry — gen_ai.* semantic conventions (lazy @opentelemetry/api)
84
+ fileExporter, // zero-dep — append traces as JSON Lines, buffered
85
+ otelExporter, // OpenTelemetry — gen_ai.* semantic conventions (lazy @opentelemetry/api)
86
86
  langfuseExporter, // Langfuse — traces + generations (lazy langfuse)
87
87
  } from "@warlock.js/ai-panoptic";
88
88
 
package/cjs/index.cjs CHANGED
@@ -6,7 +6,7 @@ let node_http = require("node:http");
6
6
  let node_crypto = require("node:crypto");
7
7
  let _warlock_js_logger = require("@warlock.js/logger");
8
8
 
9
- //#region ../ai-panoptic/src/exporters/utils/walk-spans.ts
9
+ //#region ../../packages/ai-panoptic/src/exporters/utils/walk-spans.ts
10
10
  /**
11
11
  * Depth-first pre-order traversal of a {@link TraceSpan} tree, yielding
12
12
  * the root first and then each descendant in `children` (invocation)
@@ -25,7 +25,7 @@ function* walkSpans(root) {
25
25
  }
26
26
 
27
27
  //#endregion
28
- //#region ../ai-panoptic/src/collector/normalize-error.ts
28
+ //#region ../../packages/ai-panoptic/src/collector/normalize-error.ts
29
29
  /**
30
30
  * Project a captured execution error onto the structural
31
31
  * {@link TraceSpanError} shape used on a failed / cancelled span.
@@ -73,7 +73,7 @@ function pickString(value) {
73
73
  }
74
74
 
75
75
  //#endregion
76
- //#region ../ai-panoptic/src/collector/extract-span-attributes.ts
76
+ //#region ../../packages/ai-panoptic/src/collector/extract-span-attributes.ts
77
77
  /**
78
78
  * Build the free-form `TraceSpan.attributes` bag for one report node.
79
79
  *
@@ -146,11 +146,12 @@ function addOrchestratorAttributes(attributes, extensions) {
146
146
  }
147
147
  function addToolAttributes(attributes, extensions) {
148
148
  if (extensions.tripIndex !== void 0) attributes["tool.tripIndex"] = extensions.tripIndex;
149
+ if (extensions.callId !== void 0) attributes["tool.callId"] = extensions.callId;
149
150
  if (extensions.recoveredFrom !== void 0) attributes["tool.recoveredFrom"] = extensions.recoveredFrom;
150
151
  }
151
152
 
152
153
  //#endregion
153
- //#region ../ai-panoptic/src/collector/report-to-span.ts
154
+ //#region ../../packages/ai-panoptic/src/collector/report-to-span.ts
154
155
  /**
155
156
  * Project one {@link BaseReport} node — and its entire subtree — into a
156
157
  * {@link TraceSpan}. Pure and recursive: identity, timing, status, and
@@ -283,7 +284,7 @@ function lastNonEmptyOutput(trips) {
283
284
  }
284
285
 
285
286
  //#endregion
286
- //#region ../ai-panoptic/src/collector/report-to-trace.ts
287
+ //#region ../../packages/ai-panoptic/src/collector/report-to-trace.ts
287
288
  /**
288
289
  * Project an outermost {@link BaseReport} (one whole `.execute()` /
289
290
  * `.invoke()` run) into a {@link Trace} — the root {@link
@@ -334,7 +335,7 @@ function reportToTrace(report, rootError, options) {
334
335
  }
335
336
 
336
337
  //#endregion
337
- //#region ../ai-panoptic/src/collector/collector.ts
338
+ //#region ../../packages/ai-panoptic/src/collector/collector.ts
338
339
  /**
339
340
  * Drive the source end of the Panoptic pipeline: ingest core
340
341
  * `@warlock.js/ai` {@link BaseReport} trees, project them into {@link
@@ -458,7 +459,7 @@ function createCollector(options = {}) {
458
459
  }
459
460
 
460
461
  //#endregion
461
- //#region ../ai-panoptic/src/store/match-trace.ts
462
+ //#region ../../packages/ai-panoptic/src/store/match-trace.ts
462
463
  /**
463
464
  * Test whether one trace satisfies a {@link TraceQuery}. Every declared
464
465
  * filter field must match (logical AND); absent fields are ignored, so
@@ -500,7 +501,7 @@ function toEpoch(bound) {
500
501
  }
501
502
 
502
503
  //#endregion
503
- //#region ../ai-panoptic/src/store/sum-usage.ts
504
+ //#region ../../packages/ai-panoptic/src/store/sum-usage.ts
504
505
  /**
505
506
  * Fold a child {@link Usage} into a running accumulator. Token channels
506
507
  * (`input` / `output` / `total`) always sum; the optional cache /
@@ -561,7 +562,7 @@ function sumOptional(accumulator, next) {
561
562
  }
562
563
 
563
564
  //#endregion
564
- //#region ../ai-panoptic/src/store/cache-trace-store.ts
565
+ //#region ../../packages/ai-panoptic/src/store/cache-trace-store.ts
565
566
  const DEFAULT_PREFIX = "panoptic";
566
567
  /**
567
568
  * Cache-backed {@link TraceStoreContract} with a **write-through** design
@@ -781,6 +782,7 @@ var CacheTraceStore = class {
781
782
  aggregate.completed += 1;
782
783
  break;
783
784
  case "failed":
785
+ case "incomplete":
784
786
  aggregate.failed += 1;
785
787
  break;
786
788
  case "cancelled":
@@ -846,7 +848,7 @@ function createCacheTraceStore(cache, options = {}) {
846
848
  }
847
849
 
848
850
  //#endregion
849
- //#region ../ai-panoptic/src/store/in-memory-trace-store.ts
851
+ //#region ../../packages/ai-panoptic/src/store/in-memory-trace-store.ts
850
852
  /**
851
853
  * In-memory {@link TraceStoreContract} that doubles as an
852
854
  * {@link ExporterContract} — register it on a collector
@@ -927,7 +929,8 @@ var InMemoryTraceStore = class {
927
929
  * Non-terminal statuses (`awaiting-input`, `max-iterations`) are
928
930
  * counted in `traces` but tracked by none of the three headline
929
931
  * counters — intentional, those three answer the common
930
- * "succeeded / errored / aborted" question.
932
+ * "succeeded / errored / aborted" question. An `incomplete` agent run
933
+ * (its answer was cut off) errored, so it counts as `failed`.
931
934
  */
932
935
  countStatus(aggregate, trace) {
933
936
  switch (trace.root.status) {
@@ -935,6 +938,7 @@ var InMemoryTraceStore = class {
935
938
  aggregate.completed += 1;
936
939
  break;
937
940
  case "failed":
941
+ case "incomplete":
938
942
  aggregate.failed += 1;
939
943
  break;
940
944
  case "cancelled":
@@ -982,13 +986,11 @@ function createInMemoryTraceStore(options) {
982
986
  }
983
987
 
984
988
  //#endregion
985
- //#region ../ai-panoptic/src/exporters/utils/total-cost.ts
989
+ //#region ../../packages/ai-panoptic/src/exporters/utils/total-cost.ts
986
990
  /**
987
991
  * Collapse a {@link Usage.cost} breakdown into a single USD scalar by
988
- * summing every populated field. Mirrors the formula documented on
989
- * `Usage.cost` (input + output + cachedInput + cachedOutput), and also
990
- * folds in `reasoning` for forward-safety when a provider prices
991
- * reasoning tokens as a separate channel. Returns `undefined` when no
992
+ * summing every populated channel (input, output, cache reads, cache
993
+ * writes, reasoning) via `totalCost` from `@warlock.js/ai`. Returns `undefined` when no
992
994
  * pricing was attached, so exporters can omit the cost attribute
993
995
  * entirely rather than reporting a misleading `0`.
994
996
  *
@@ -997,13 +999,11 @@ function createInMemoryTraceStore(options) {
997
999
  * // => 0.05
998
1000
  */
999
1001
  function totalCostUsd(usage) {
1000
- const cost = usage.cost;
1001
- if (!cost) return;
1002
- return (cost.input ?? 0) + (cost.output ?? 0) + (cost.cachedInput ?? 0) + (cost.cachedOutput ?? 0) + (cost.reasoning ?? 0);
1002
+ return (0, _warlock_js_ai.totalCost)(usage.cost);
1003
1003
  }
1004
1004
 
1005
1005
  //#endregion
1006
- //#region ../ai-panoptic/src/exporters/utils/gen-ai-attributes.ts
1006
+ //#region ../../packages/ai-panoptic/src/exporters/utils/gen-ai-attributes.ts
1007
1007
  /**
1008
1008
  * Subset of the OpenTelemetry GenAI semantic-convention attribute keys
1009
1009
  * Panoptic emits. Kept as a named constant map (not inline string
@@ -1091,7 +1091,7 @@ function mergeScalarAttributes(target, source) {
1091
1091
  }
1092
1092
 
1093
1093
  //#endregion
1094
- //#region ../ai-panoptic/src/exporters/console/format-span-io.ts
1094
+ //#region ../../packages/ai-panoptic/src/exporters/console/format-span-io.ts
1095
1095
  /** Default cap on how many characters of captured content a console line shows. */
1096
1096
  const DEFAULT_IO_MAX_CHARS = 500;
1097
1097
  /**
@@ -1141,7 +1141,7 @@ function stringify(value) {
1141
1141
  }
1142
1142
 
1143
1143
  //#endregion
1144
- //#region ../ai-panoptic/src/exporters/console/format-span-line.ts
1144
+ //#region ../../packages/ai-panoptic/src/exporters/console/format-span-line.ts
1145
1145
  /**
1146
1146
  * Render a single {@link TraceSpan} as one scannable console line:
1147
1147
  * `<status> <type> "<name>" — <duration>ms, <tokens> tok[, $<cost>]`.
@@ -1171,6 +1171,7 @@ function statusMarker(status) {
1171
1171
  case "completed": return "ok";
1172
1172
  case "failed": return "ERR";
1173
1173
  case "cancelled": return "cancel";
1174
+ case "incomplete": return "INCOMPLETE";
1174
1175
  case "max-iterations": return "max-iter";
1175
1176
  case "awaiting-input": return "await";
1176
1177
  default: return status;
@@ -1178,7 +1179,7 @@ function statusMarker(status) {
1178
1179
  }
1179
1180
 
1180
1181
  //#endregion
1181
- //#region ../ai-panoptic/src/exporters/console/console-exporter.ts
1182
+ //#region ../../packages/ai-panoptic/src/exporters/console/console-exporter.ts
1182
1183
  const EXPORTER_NAME$3 = "console";
1183
1184
  /**
1184
1185
  * Zero-dependency {@link ExporterContract} that prints traces to a
@@ -1245,11 +1246,11 @@ function writeSpan(sink, span, depth, io, ioMaxChars) {
1245
1246
  if (io) for (const line of formatSpanIO(span, depth, ioMaxChars)) writeAtSeverity(sink, span.status, line);
1246
1247
  }
1247
1248
  /**
1248
- * Route a line to `error` when the span failed/cancelled, otherwise to
1249
- * `log`. Keeps healthy traces out of the error stream.
1249
+ * Route a line to `error` when the span failed/cancelled/incomplete,
1250
+ * otherwise to `log`. Keeps healthy traces out of the error stream.
1250
1251
  */
1251
1252
  function writeAtSeverity(sink, status, line) {
1252
- if (status === "failed" || status === "cancelled") {
1253
+ if (status === "failed" || status === "cancelled" || status === "incomplete") {
1253
1254
  sink.error(line);
1254
1255
  return;
1255
1256
  }
@@ -1269,7 +1270,7 @@ function spanDepth(root, targetSpanId, depth = 0) {
1269
1270
  }
1270
1271
 
1271
1272
  //#endregion
1272
- //#region ../ai-panoptic/src/exporters/file/file-exporter.ts
1273
+ //#region ../../packages/ai-panoptic/src/exporters/file/file-exporter.ts
1273
1274
  const EXPORTER_NAME$2 = "file";
1274
1275
  /**
1275
1276
  * Zero-dependency {@link ExporterContract} that appends completed traces
@@ -1360,7 +1361,7 @@ var FileTraceWriter = class {
1360
1361
  };
1361
1362
 
1362
1363
  //#endregion
1363
- //#region ../ai-panoptic/src/exporters/langfuse/langfuse-exporter.ts
1364
+ //#region ../../packages/ai-panoptic/src/exporters/langfuse/langfuse-exporter.ts
1364
1365
  const EXPORTER_NAME$1 = "langfuse";
1365
1366
  let LangfuseSdk;
1366
1367
  let isModuleExists$1 = null;
@@ -1556,15 +1557,15 @@ function langfuseMetadata(span) {
1556
1557
  }
1557
1558
  /**
1558
1559
  * Map the Panoptic span status onto a Langfuse observation level —
1559
- * failed/cancelled spans surface as `ERROR`, everything else `DEFAULT`.
1560
+ * failed/cancelled/incomplete spans surface as `ERROR`, everything else `DEFAULT`.
1560
1561
  */
1561
1562
  function toLevel(span) {
1562
- if (span.status === "failed" || span.status === "cancelled") return "ERROR";
1563
+ if (span.status === "failed" || span.status === "cancelled" || span.status === "incomplete") return "ERROR";
1563
1564
  return "DEFAULT";
1564
1565
  }
1565
1566
 
1566
1567
  //#endregion
1567
- //#region ../ai-panoptic/src/exporters/otel/otel-exporter.ts
1568
+ //#region ../../packages/ai-panoptic/src/exporters/otel/otel-exporter.ts
1568
1569
  const EXPORTER_NAME = "otel";
1569
1570
  const DEFAULT_TRACER_NAME = "@warlock.js/ai-panoptic";
1570
1571
  let OtelApi;
@@ -1692,7 +1693,7 @@ function applyStatus(otelSpan, span) {
1692
1693
  message: span.error.message,
1693
1694
  stack: span.error.stack
1694
1695
  });
1695
- if (span.status === "failed" || span.status === "cancelled") {
1696
+ if (span.status === "failed" || span.status === "cancelled" || span.status === "incomplete") {
1696
1697
  otelSpan.setStatus({
1697
1698
  code: codes.ERROR,
1698
1699
  message: span.error?.message
@@ -1717,7 +1718,7 @@ function toEpochMillis(isoTimestamp) {
1717
1718
  }
1718
1719
 
1719
1720
  //#endregion
1720
- //#region ../ai-panoptic/src/panoptic/panoptic-middleware.ts
1721
+ //#region ../../packages/ai-panoptic/src/panoptic/panoptic-middleware.ts
1721
1722
  /**
1722
1723
  * Build an {@link AgentMiddleware} that feeds a collector from the
1723
1724
  * `execute`- and `supervisor`-level hooks. An alternative wiring to event
@@ -1783,7 +1784,7 @@ function isReport(value) {
1783
1784
  }
1784
1785
 
1785
1786
  //#endregion
1786
- //#region ../ai-panoptic/src/panoptic/panoptic.ts
1787
+ //#region ../../packages/ai-panoptic/src/panoptic/panoptic.ts
1787
1788
  /**
1788
1789
  * Terminal `*.completed` events of every core primitive that carries the
1789
1790
  * finalized `result` (and therefore the `report` tree). These fire once
@@ -1920,7 +1921,7 @@ function panoptic(options = {}) {
1920
1921
  }
1921
1922
 
1922
1923
  //#endregion
1923
- //#region ../ai-panoptic/src/evaluate/evaluate-system-prompt.ts
1924
+ //#region ../../packages/ai-panoptic/src/evaluate/evaluate-system-prompt.ts
1924
1925
  /**
1925
1926
  * Grade `systemPrompt` with the configured judge model, reusing
1926
1927
  * `ai.prompts().validate()`'s own `judgePromptBody` — never a second
@@ -1938,7 +1939,7 @@ async function evaluateSystemPrompt(systemPrompt, config, instructionsOverride)
1938
1939
  }
1939
1940
 
1940
1941
  //#endregion
1941
- //#region ../ai-panoptic/src/evaluate/extract-last-system-prompt.ts
1942
+ //#region ../../packages/ai-panoptic/src/evaluate/extract-last-system-prompt.ts
1942
1943
  /**
1943
1944
  * Pull the LAST `{role: "system"}` message off a span's captured `input`.
1944
1945
  *
@@ -1960,7 +1961,7 @@ function extractLastSystemPrompt(span) {
1960
1961
  }
1961
1962
 
1962
1963
  //#endregion
1963
- //#region ../ai-panoptic/src/evaluate/find-span-by-id.ts
1964
+ //#region ../../packages/ai-panoptic/src/evaluate/find-span-by-id.ts
1964
1965
  /** Depth-first search for the span with `spanId` inside a trace's span tree. */
1965
1966
  function findSpanById(root, spanId) {
1966
1967
  if (root.spanId === spanId) return root;
@@ -1971,7 +1972,7 @@ function findSpanById(root, spanId) {
1971
1972
  }
1972
1973
 
1973
1974
  //#endregion
1974
- //#region ../ai-panoptic/src/dashboard/parse-query.ts
1975
+ //#region ../../packages/ai-panoptic/src/dashboard/parse-query.ts
1975
1976
  /**
1976
1977
  * The set of terminal statuses a stored trace can carry. Used to keep
1977
1978
  * `parseQuery` from forwarding arbitrary `?status=` junk into the store.
@@ -1980,6 +1981,7 @@ const KNOWN_STATUSES = [
1980
1981
  "completed",
1981
1982
  "failed",
1982
1983
  "cancelled",
1984
+ "incomplete",
1983
1985
  "max-iterations",
1984
1986
  "awaiting-input",
1985
1987
  "awaiting-approval"
@@ -2023,7 +2025,7 @@ function parseQuery(params) {
2023
2025
  }
2024
2026
 
2025
2027
  //#endregion
2026
- //#region ../ai-panoptic/src/dashboard/warlock-logo.ts
2028
+ //#region ../../packages/ai-panoptic/src/dashboard/warlock-logo.ts
2027
2029
  /**
2028
2030
  * The Warlock logo as an inlined base64 PNG data URI (64x64, ~9KB).
2029
2031
  * Inlined so the dashboard stays a single self-contained, offline-capable
@@ -2034,7 +2036,7 @@ function parseQuery(params) {
2034
2036
  const WARLOCK_LOGO_DATA_URI = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAkvklEQVR42nV7Z5hb1bX2u9Y+RRpNn7E9425s02wMxgZMNc1AqIkJLTcxgQChpBEC94bwpVwSCCQBEkghECD0DiZwIRBaAhhiMGCDccEejz3F0zQzGrVT9l7fj6MjaQzR8+iRdHTO3nutvcq7yiYikAgAAESASPQJRN8BgLnyO/6fCDCmfC+JoHQ3QEQQkfg+MqbqPwDE0f3xfACiGySayxiMe1XPt+ureoz4d7zW6DvFo4OZSAQipQdEAFW6o/xgPBlz5drnvZiJiBC/owkZYKKqiSMGACDmykKVGj+ySOlGqsy/K5HVa6v+nyNmUnnC0pd4/fG7mkkxc5hLDIh27PNviHe9tLFlYkq7DiKCEZLKRESAxJPSODoIUIpJpLwJ5XuoakwRUPyKmUiVbaLKWNF/1RJcuoMqdBGqSPsMU8dJQCzqpe9kTGXw6oeqGC3VkwMAKy7vSCwJVEVBdD99ZjyOLxHATON2Lh4nVquYuOjaeKkoTSVVdFH8VB2A2397sNO1Y8T09PsVEaVoYi49zK5LzDyO20wEVqpyPf6tFDGVOR7xrrR3pBSYuTxu6U2sFLPt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8uQ6vHGZ+L/8xjxzsVCGif4d13L5611PHM+O+fnrRMA/j9u09405ZezXQAAAABJRU5ErkJggg==";
2035
2037
 
2036
2038
  //#endregion
2037
- //#region ../ai-panoptic/src/dashboard/ui.html.ts
2039
+ //#region ../../packages/ai-panoptic/src/dashboard/ui.html.ts
2038
2040
  /**
2039
2041
  * Build the single self-contained dashboard HTML page. No external
2040
2042
  * assets, no bundler, no framework — one inlined string that polls the
@@ -2370,13 +2372,14 @@ function dashboardHtml(basePath, title, evaluateEnabled = false, evaluateDefault
2370
2372
 
2371
2373
  var STATUS_FILTERS = ["completed", "failed", "cancelled"];
2372
2374
  var TYPE_FILTERS = ["agent", "tool", "model", "supervisor", "team", "workflow", "orchestrator", "planner", "batch", "callback"];
2373
- var ERROR_STATUSES = { failed: 1, cancelled: 1 };
2375
+ var ERROR_STATUSES = { failed: 1, cancelled: 1, incomplete: 1 };
2374
2376
  var NO_SESSION_KEY = "(no session)";
2375
2377
  var NO_PROMPT_KEY = "(no prompt)";
2376
2378
  var NO_TYPE_KEY = "(no type)";
2377
2379
 
2378
2380
  var statusClass = function (s) {
2379
2381
  if (s === "completed" || s === "failed" || s === "cancelled") return s;
2382
+ if (s === "incomplete") return "failed";
2380
2383
  return "other";
2381
2384
  };
2382
2385
  var esc = function (v) {
@@ -2464,7 +2467,7 @@ function dashboardHtml(basePath, title, evaluateEnabled = false, evaluateDefault
2464
2467
  // Sum every priced lane of a cost object into one USD number.
2465
2468
  function costSumObj(c) {
2466
2469
  if (!c) return 0;
2467
- return (c.input || 0) + (c.output || 0) + (c.cachedInput || 0) + (c.cachedOutput || 0) + (c.reasoning || 0);
2470
+ return (c.input || 0) + (c.output || 0) + (c.cachedInput || 0) + (c.cacheWrite || 0) + (c.cachedOutput || 0) + (c.reasoning || 0);
2468
2471
  }
2469
2472
  // The cost a single span directly carries (on its rolled-up usage).
2470
2473
  function usageCost(usage) { return usage ? costSumObj(usage.cost) : 0; }
@@ -2798,7 +2801,7 @@ function dashboardHtml(basePath, title, evaluateEnabled = false, evaluateDefault
2798
2801
  }
2799
2802
 
2800
2803
  function renderStats(a) {
2801
- var cost = a.cost ? (((a.cost.input || 0) + (a.cost.output || 0) + (a.cost.cachedInput || 0) + (a.cost.cachedOutput || 0)).toFixed(4)) : "—";
2804
+ var cost = a.cost ? (((a.cost.input || 0) + (a.cost.output || 0) + (a.cost.cachedInput || 0) + (a.cost.cacheWrite || 0) + (a.cost.cachedOutput || 0) + (a.cost.reasoning || 0)).toFixed(4)) : "—";
2802
2805
  var u = a.usage || {};
2803
2806
  var cells = [
2804
2807
  ["traces", num(a.traces), null],
@@ -3055,7 +3058,7 @@ function dashboardHtml(basePath, title, evaluateEnabled = false, evaluateDefault
3055
3058
  // "Supervisor Terminated By", "span id" → "Span ID", "agent.trips" →
3056
3059
  // "Agent Trips". Underlying attribute keys are untouched.
3057
3060
  // NB: this whole script is a template literal — regex backslash classes
3058
- // MUST be double-escaped (\\s, not \s) or "\\s" collapses to a literal "s".
3061
+ // MUST be double-escaped (\\s) so the rendered script retains its backslash.
3059
3062
  function humanizeKey(key) {
3060
3063
  return String(key).split(/[.\\s]+/).map(function (seg) {
3061
3064
  return seg.replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/\\s+/).map(function (w) {
@@ -3519,7 +3522,7 @@ function encodeForInlineScript(value) {
3519
3522
  }
3520
3523
 
3521
3524
  //#endregion
3522
- //#region ../ai-panoptic/src/dashboard/serve.ts
3525
+ //#region ../../packages/ai-panoptic/src/dashboard/serve.ts
3523
3526
  /** Hard cap on the evaluate route's request body — well beyond a real instructions string. */
3524
3527
  const MAX_EVALUATE_BODY_BYTES = 64 * 1024;
3525
3528
  /**
@@ -3768,7 +3771,7 @@ async function handleEvaluate(store, evaluate, traceId, spanId, req, res) {
3768
3771
  }
3769
3772
 
3770
3773
  //#endregion
3771
- //#region ../ai-panoptic/src/dashboard/dashboard.ts
3774
+ //#region ../../packages/ai-panoptic/src/dashboard/dashboard.ts
3772
3775
  const DEFAULT_PORT = 4319;
3773
3776
  const DEFAULT_HOST = "127.0.0.1";
3774
3777
  const DEFAULT_TITLE = "Panoptic";
@@ -3896,7 +3899,7 @@ function openBrowser(url) {
3896
3899
  }
3897
3900
 
3898
3901
  //#endregion
3899
- //#region ../ai-panoptic/src/dashboard/trace-filter.ts
3902
+ //#region ../../packages/ai-panoptic/src/dashboard/trace-filter.ts
3900
3903
  /** Statuses the errors-only toggle keeps. */
3901
3904
  const ERROR_STATUSES = ["failed", "cancelled"];
3902
3905
  /**
@@ -4124,7 +4127,7 @@ function aggregateByType(traces) {
4124
4127
  */
4125
4128
  function costSumObj(cost) {
4126
4129
  if (cost === void 0) return 0;
4127
- return (cost.input ?? 0) + (cost.output ?? 0) + (cost.cachedInput ?? 0) + (cost.cachedOutput ?? 0) + (cost.reasoning ?? 0);
4130
+ return (cost.input ?? 0) + (cost.output ?? 0) + (cost.cachedInput ?? 0) + (cost.cacheWrite ?? 0) + (cost.cachedOutput ?? 0) + (cost.reasoning ?? 0);
4128
4131
  }
4129
4132
  /**
4130
4133
  * Rollup-aware subtree cost: a node's own cost when it carries one
@@ -4164,7 +4167,7 @@ function maxNodeCost(root) {
4164
4167
  }
4165
4168
 
4166
4169
  //#endregion
4167
- //#region ../ai-panoptic/src/config/apply-panoptic-config.ts
4170
+ //#region ../../packages/ai-panoptic/src/config/apply-panoptic-config.ts
4168
4171
  let applied;
4169
4172
  /**
4170
4173
  * Read a {@link PanopticConfig} and wire panoptic onto the core observe
@@ -4246,7 +4249,7 @@ function startDashboard(store, dashboardConfig) {
4246
4249
  }
4247
4250
 
4248
4251
  //#endregion
4249
- //#region ../ai-panoptic/src/register.ts
4252
+ //#region ../../packages/ai-panoptic/src/register.ts
4250
4253
  (0, _warlock_js_ai.onConfigApplied)((config) => {
4251
4254
  applyPanopticConfig(config.panoptic);
4252
4255
  });