agent-inspect 6.7.2 → 6.7.3
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 +6 -0
- package/README.md +1 -1
- package/docs/EXPORTS.md +9 -0
- package/docs/PERFORMANCE.md +18 -0
- package/docs/STANDARDS.md +4 -0
- package/package.json +2 -2
- package/packages/cli/dist/{chunk-M6PC5KUT.mjs → chunk-EMYDJREA.mjs} +26 -10
- package/packages/cli/dist/chunk-EMYDJREA.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +46 -21
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +23 -14
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-27LC2BB3.mjs → src-IPJNFV37.mjs} +3 -3
- package/packages/cli/dist/{src-27LC2BB3.mjs.map → src-IPJNFV37.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +24 -8
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.mjs +25 -9
- package/packages/core/dist/advanced.mjs.map +1 -1
- package/packages/core/dist/checks.cjs +56 -4
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.mjs +1 -1
- package/packages/core/dist/{chunk-EWHN6NA4.mjs → chunk-EQVXDGGU.mjs} +58 -6
- package/packages/core/dist/chunk-EQVXDGGU.mjs.map +1 -0
- package/packages/core/dist/diff.cjs +4 -0
- package/packages/core/dist/diff.cjs.map +1 -1
- package/packages/core/dist/diff.mjs +4 -0
- package/packages/core/dist/diff.mjs.map +1 -1
- package/packages/core/dist/exporters.cjs +9 -4
- package/packages/core/dist/exporters.cjs.map +1 -1
- package/packages/core/dist/exporters.d.cts +3 -2
- package/packages/core/dist/exporters.d.ts +3 -2
- package/packages/core/dist/exporters.mjs +9 -4
- package/packages/core/dist/exporters.mjs.map +1 -1
- package/packages/core/dist/logs.cjs +3 -2
- package/packages/core/dist/logs.cjs.map +1 -1
- package/packages/core/dist/logs.mjs +3 -2
- package/packages/core/dist/logs.mjs.map +1 -1
- package/packages/cli/dist/chunk-M6PC5KUT.mjs.map +0 -1
- package/packages/core/dist/chunk-EWHN6NA4.mjs.map +0 -1
|
@@ -824,6 +824,11 @@ function exportMarkdown(tree, options) {
|
|
|
824
824
|
function hexFrom(seed, byteLen) {
|
|
825
825
|
return crypto__default.default.createHash("sha256").update(seed, "utf8").digest("hex").slice(0, byteLen * 2);
|
|
826
826
|
}
|
|
827
|
+
function unixNano(ms) {
|
|
828
|
+
const whole = Math.trunc(ms);
|
|
829
|
+
const fractionNs = Math.round((ms - whole) * 1e6);
|
|
830
|
+
return BigInt(whole) * 1000000n + BigInt(fractionNs);
|
|
831
|
+
}
|
|
827
832
|
function mapInspectKindToOI(kind, warnings) {
|
|
828
833
|
switch (kind) {
|
|
829
834
|
case "LLM":
|
|
@@ -873,10 +878,10 @@ function exportOpenInference(tree, options) {
|
|
|
873
878
|
const ev = n.event;
|
|
874
879
|
const spanId = hexFrom(`${tree.runId}:${ev.eventId}`, 8);
|
|
875
880
|
const parentSpanHex = ev.parentId ? hexFrom(`${tree.runId}:${ev.parentId}`, 8) : void 0;
|
|
876
|
-
const startNs =
|
|
881
|
+
const startNs = unixNano(ev.timestamp);
|
|
877
882
|
let endNs;
|
|
878
883
|
if (ev.durationMs !== void 0 && Number.isFinite(ev.durationMs)) {
|
|
879
|
-
endNs = startNs +
|
|
884
|
+
endNs = startNs + unixNano(ev.durationMs);
|
|
880
885
|
}
|
|
881
886
|
const { openInferenceKind } = mapInspectKindToOI(ev.kind, warnings);
|
|
882
887
|
const attrs = {
|
|
@@ -924,8 +929,8 @@ function exportOpenInference(tree, options) {
|
|
|
924
929
|
span_id: spanId,
|
|
925
930
|
parent_span_id: parentSpanHex,
|
|
926
931
|
name: ev.name,
|
|
927
|
-
start_time_unix_nano: startNs,
|
|
928
|
-
end_time_unix_nano: endNs,
|
|
932
|
+
start_time_unix_nano: startNs.toString(),
|
|
933
|
+
end_time_unix_nano: endNs?.toString(),
|
|
929
934
|
attributes: attrs,
|
|
930
935
|
status
|
|
931
936
|
});
|