agent-inspect 6.31.22 → 6.31.24
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 +12 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/packages/cli/dist/{chunk-EMWA5EKU.mjs → chunk-P27XTK5U.mjs} +62 -20
- package/packages/cli/dist/chunk-P27XTK5U.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +97 -49
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +38 -34
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-VZHGOLTO.mjs → src-EWZYLDST.mjs} +3 -3
- package/packages/cli/dist/{src-VZHGOLTO.mjs.map → src-EWZYLDST.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +38 -10
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.mjs +6 -6
- package/packages/core/dist/checks.cjs +36 -11
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.mjs +2 -2
- package/packages/core/dist/{chunk-RBXD7BNX.mjs → chunk-77PUPLPG.mjs} +14 -8
- package/packages/core/dist/chunk-77PUPLPG.mjs.map +1 -0
- package/packages/core/dist/{chunk-GCZUWY47.mjs → chunk-AN5MOADW.mjs} +31 -9
- package/packages/core/dist/chunk-AN5MOADW.mjs.map +1 -0
- package/packages/core/dist/{chunk-ZOF6ON65.mjs → chunk-IMCM42W6.mjs} +15 -9
- package/packages/core/dist/chunk-IMCM42W6.mjs.map +1 -0
- package/packages/core/dist/{chunk-S4NU55LU.mjs → chunk-J2ST4VCX.mjs} +3 -3
- package/packages/core/dist/{chunk-S4NU55LU.mjs.map → chunk-J2ST4VCX.mjs.map} +1 -1
- package/packages/core/dist/{chunk-UPGBMRL4.mjs → chunk-JJSL346L.mjs} +12 -3
- package/packages/core/dist/chunk-JJSL346L.mjs.map +1 -0
- package/packages/core/dist/exporters.cjs +38 -31
- package/packages/core/dist/exporters.cjs.map +1 -1
- package/packages/core/dist/exporters.mjs +35 -31
- package/packages/core/dist/exporters.mjs.map +1 -1
- package/packages/core/dist/logs.cjs +14 -5
- package/packages/core/dist/logs.cjs.map +1 -1
- package/packages/core/dist/logs.mjs +3 -3
- package/packages/core/dist/persisted.cjs +185 -163
- package/packages/core/dist/persisted.cjs.map +1 -1
- package/packages/core/dist/persisted.mjs +9 -6
- package/packages/core/dist/persisted.mjs.map +1 -1
- package/packages/core/dist/readers.cjs +189 -161
- package/packages/core/dist/readers.cjs.map +1 -1
- package/packages/core/dist/readers.mjs +4 -4
- package/packages/cli/dist/chunk-EMWA5EKU.mjs.map +0 -1
- package/packages/core/dist/chunk-GCZUWY47.mjs.map +0 -1
- package/packages/core/dist/chunk-RBXD7BNX.mjs.map +0 -1
- package/packages/core/dist/chunk-UPGBMRL4.mjs.map +0 -1
- package/packages/core/dist/chunk-ZOF6ON65.mjs.map +0 -1
|
@@ -8115,9 +8115,22 @@ var init_tool_arguments = __esm({
|
|
|
8115
8115
|
});
|
|
8116
8116
|
|
|
8117
8117
|
// packages/core/src/persisted/delivery-identity.ts
|
|
8118
|
-
function stripReaderDeliveryDiscriminator(eventId) {
|
|
8119
|
-
if (!
|
|
8120
|
-
|
|
8118
|
+
function stripReaderDeliveryDiscriminator(eventId, attributes) {
|
|
8119
|
+
if (!eventId) return eventId;
|
|
8120
|
+
const rawBase = attributes?.[DELIVERY_EVENT_BASE_ATTR];
|
|
8121
|
+
if (typeof rawBase !== "string" || rawBase.trim() === "") return eventId;
|
|
8122
|
+
const base = rawBase.trim().slice(0, MAX_DELIVERY_BASE_LEN);
|
|
8123
|
+
if (eventId === base) return base;
|
|
8124
|
+
const prefix = `${base}:`;
|
|
8125
|
+
if (!eventId.startsWith(prefix)) return eventId;
|
|
8126
|
+
const suffix = eventId.slice(prefix.length);
|
|
8127
|
+
if (/^\d+$/.test(suffix)) return base;
|
|
8128
|
+
return eventId;
|
|
8129
|
+
}
|
|
8130
|
+
function deliveryEventBaseFromIndexedId(eventId) {
|
|
8131
|
+
if (!/:\d+$/.test(eventId)) return void 0;
|
|
8132
|
+
const base = eventId.replace(/:\d+$/, "");
|
|
8133
|
+
return base.length > 0 ? base.slice(0, MAX_DELIVERY_BASE_LEN) : void 0;
|
|
8121
8134
|
}
|
|
8122
8135
|
function canonicalDigest(value) {
|
|
8123
8136
|
if (value === void 0) return null;
|
|
@@ -8151,7 +8164,7 @@ function timeKey(fields) {
|
|
|
8151
8164
|
function deliverySemanticFingerprint(fields) {
|
|
8152
8165
|
const content = capturedContentDigest(fields.attributes);
|
|
8153
8166
|
return JSON.stringify({
|
|
8154
|
-
stableEventId: stripReaderDeliveryDiscriminator(fields.eventId),
|
|
8167
|
+
stableEventId: stripReaderDeliveryDiscriminator(fields.eventId, fields.attributes),
|
|
8155
8168
|
runId: fields.runId,
|
|
8156
8169
|
kind: fields.kind,
|
|
8157
8170
|
name: fields.name,
|
|
@@ -8202,6 +8215,11 @@ function identityFieldsFromAttributes(attributes) {
|
|
|
8202
8215
|
attemptNumber: pickNumber2()
|
|
8203
8216
|
};
|
|
8204
8217
|
}
|
|
8218
|
+
function identityConflictFieldsFromAttributes(attributes) {
|
|
8219
|
+
const raw = attributes?.[IDENTITY_CONFLICT_ATTR.fields];
|
|
8220
|
+
if (typeof raw !== "string" || raw.trim() === "") return [];
|
|
8221
|
+
return raw.split(",").map((part) => part.trim()).filter((part) => part.length > 0).slice(0, MAX_CONFLICT_FIELDS);
|
|
8222
|
+
}
|
|
8205
8223
|
function hasDeliveryConflictMarker(attributes) {
|
|
8206
8224
|
return attributes?.[DELIVERY_CONFLICT_ATTR] === true;
|
|
8207
8225
|
}
|
|
@@ -8214,18 +8232,22 @@ function stampDeliveryConflict(event) {
|
|
|
8214
8232
|
}
|
|
8215
8233
|
};
|
|
8216
8234
|
}
|
|
8217
|
-
var DELIVERY_CONFLICT_ATTR, IDENTITY_CONFLICT_ATTR,
|
|
8235
|
+
var DELIVERY_CONFLICT_ATTR, DELIVERY_EVENT_BASE_ATTR, IDENTITY_CONFLICT_ATTR, MAX_CONFLICT_FIELDS, MAX_DELIVERY_BASE_LEN;
|
|
8218
8236
|
var init_delivery_identity = __esm({
|
|
8219
8237
|
"packages/core/src/persisted/delivery-identity.ts"() {
|
|
8220
8238
|
init_canonical_equality();
|
|
8221
8239
|
DELIVERY_CONFLICT_ATTR = "agent_inspect.delivery_conflict";
|
|
8240
|
+
DELIVERY_EVENT_BASE_ATTR = "agent_inspect.delivery_event_base";
|
|
8222
8241
|
IDENTITY_CONFLICT_ATTR = {
|
|
8223
8242
|
operationId: "agent_inspect.identity_conflict.operation_id",
|
|
8224
8243
|
attemptId: "agent_inspect.identity_conflict.attempt_id",
|
|
8225
8244
|
retryOf: "agent_inspect.identity_conflict.retry_of",
|
|
8226
|
-
attemptNumber: "agent_inspect.identity_conflict.attempt_number"
|
|
8245
|
+
attemptNumber: "agent_inspect.identity_conflict.attempt_number",
|
|
8246
|
+
/** Comma-separated field names when a conflict survives lossy bounding. */
|
|
8247
|
+
fields: "agent_inspect.identity_conflict.fields"
|
|
8227
8248
|
};
|
|
8228
|
-
|
|
8249
|
+
MAX_CONFLICT_FIELDS = 8;
|
|
8250
|
+
MAX_DELIVERY_BASE_LEN = 500;
|
|
8229
8251
|
}
|
|
8230
8252
|
});
|
|
8231
8253
|
|
|
@@ -8393,13 +8415,19 @@ function directNestedIdentityConflicts(event) {
|
|
|
8393
8415
|
const attrs = event.attributes;
|
|
8394
8416
|
if (!attrs || typeof attrs !== "object") return [];
|
|
8395
8417
|
const nested = attrs.metadata && typeof attrs.metadata === "object" && !Array.isArray(attrs.metadata) ? attrs.metadata : void 0;
|
|
8396
|
-
if (!nested) return [];
|
|
8397
8418
|
const conflicts = [];
|
|
8398
|
-
|
|
8399
|
-
const
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8419
|
+
if (nested) {
|
|
8420
|
+
for (const key of IDENTITY_KEYS) {
|
|
8421
|
+
const direct = attrs[key];
|
|
8422
|
+
const nestedValue = nested[key];
|
|
8423
|
+
if (direct === void 0 || nestedValue === void 0) continue;
|
|
8424
|
+
if (!identityValuesEqual(direct, nestedValue)) {
|
|
8425
|
+
conflicts.push(key);
|
|
8426
|
+
}
|
|
8427
|
+
}
|
|
8428
|
+
}
|
|
8429
|
+
for (const key of identityConflictFieldsFromAttributes(attrs)) {
|
|
8430
|
+
if (IDENTITY_KEYS.includes(key) && !conflicts.includes(key)) {
|
|
8403
8431
|
conflicts.push(key);
|
|
8404
8432
|
}
|
|
8405
8433
|
}
|
|
@@ -12756,6 +12784,11 @@ function compactAttributes2(entries) {
|
|
|
12756
12784
|
}
|
|
12757
12785
|
return Object.keys(out).length > 0 ? out : void 0;
|
|
12758
12786
|
}
|
|
12787
|
+
function stampDeliveryEventBase(eventId, attributes) {
|
|
12788
|
+
const base = deliveryEventBaseFromIndexedId(eventId);
|
|
12789
|
+
if (!base) return attributes;
|
|
12790
|
+
return { ...attributes ?? {}, [DELIVERY_EVENT_BASE_ATTR]: base };
|
|
12791
|
+
}
|
|
12759
12792
|
function traceEventToPersistedInspectEvent(event, options) {
|
|
12760
12793
|
const eventIndex = options?.eventIndex ?? 0;
|
|
12761
12794
|
const eventId = createPersistedEventId(event, eventIndex);
|
|
@@ -12785,7 +12818,7 @@ function traceEventToPersistedInspectEvent(event, options) {
|
|
|
12785
12818
|
startedAt: tsStart.iso,
|
|
12786
12819
|
confidence: "explicit",
|
|
12787
12820
|
source,
|
|
12788
|
-
attributes
|
|
12821
|
+
attributes: stampDeliveryEventBase(eventId, attributes)
|
|
12789
12822
|
};
|
|
12790
12823
|
}
|
|
12791
12824
|
case "run_completed": {
|
|
@@ -12808,7 +12841,7 @@ function traceEventToPersistedInspectEvent(event, options) {
|
|
|
12808
12841
|
durationMs: event.durationMs,
|
|
12809
12842
|
confidence: "explicit",
|
|
12810
12843
|
source,
|
|
12811
|
-
attributes,
|
|
12844
|
+
attributes: stampDeliveryEventBase(eventId, attributes),
|
|
12812
12845
|
error
|
|
12813
12846
|
};
|
|
12814
12847
|
}
|
|
@@ -12833,7 +12866,7 @@ function traceEventToPersistedInspectEvent(event, options) {
|
|
|
12833
12866
|
startedAt: tsStart.iso,
|
|
12834
12867
|
confidence: "explicit",
|
|
12835
12868
|
source,
|
|
12836
|
-
attributes
|
|
12869
|
+
attributes: stampDeliveryEventBase(eventId, attributes)
|
|
12837
12870
|
};
|
|
12838
12871
|
if (event.parentId !== void 0) {
|
|
12839
12872
|
out.parentId = event.parentId;
|
|
@@ -12864,7 +12897,7 @@ function traceEventToPersistedInspectEvent(event, options) {
|
|
|
12864
12897
|
durationMs: event.durationMs,
|
|
12865
12898
|
confidence: "explicit",
|
|
12866
12899
|
source,
|
|
12867
|
-
attributes,
|
|
12900
|
+
attributes: stampDeliveryEventBase(eventId, attributes),
|
|
12868
12901
|
error
|
|
12869
12902
|
};
|
|
12870
12903
|
}
|
|
@@ -12891,7 +12924,7 @@ function traceEventToPersistedInspectEvent(event, options) {
|
|
|
12891
12924
|
timestamp: tsMain.iso,
|
|
12892
12925
|
confidence: "explicit",
|
|
12893
12926
|
source,
|
|
12894
|
-
attributes
|
|
12927
|
+
attributes: stampDeliveryEventBase(eventId, attributes)
|
|
12895
12928
|
};
|
|
12896
12929
|
if (event.parentId !== void 0) {
|
|
12897
12930
|
out.parentId = event.parentId;
|
|
@@ -12915,6 +12948,7 @@ function traceEventsToPersistedInspectEvents(events, options) {
|
|
|
12915
12948
|
var init_from_trace_event = __esm({
|
|
12916
12949
|
"packages/core/src/persisted/from-trace-event.ts"() {
|
|
12917
12950
|
init_correlation_metadata();
|
|
12951
|
+
init_delivery_identity();
|
|
12918
12952
|
init_token_usage();
|
|
12919
12953
|
}
|
|
12920
12954
|
});
|
|
@@ -14519,6 +14553,15 @@ function promoteAgentInspectWorkflowIdentity(attributes, pathPrefix) {
|
|
|
14519
14553
|
metadata[camel] = alternate;
|
|
14520
14554
|
}
|
|
14521
14555
|
}
|
|
14556
|
+
const conflictFields = attributes["agent_inspect.identity_conflict.fields"];
|
|
14557
|
+
if (typeof conflictFields === "string" && conflictFields.trim() !== "") {
|
|
14558
|
+
warnings.push({
|
|
14559
|
+
code: "otlp_identity_conflict",
|
|
14560
|
+
message: `Identity representation conflict fields retained after OTLP bounding: ${conflictFields.trim().slice(0, 200)}.`,
|
|
14561
|
+
severity: "warning",
|
|
14562
|
+
field: `${pathPrefix}.agent_inspect.identity_conflict.fields`
|
|
14563
|
+
});
|
|
14564
|
+
}
|
|
14522
14565
|
if (Object.keys(metadata).length > 0) {
|
|
14523
14566
|
attributes.metadata = metadata;
|
|
14524
14567
|
}
|
|
@@ -17258,7 +17301,7 @@ var init_src = __esm({
|
|
|
17258
17301
|
});
|
|
17259
17302
|
|
|
17260
17303
|
// package.json
|
|
17261
|
-
var version = "6.31.
|
|
17304
|
+
var version = "6.31.24";
|
|
17262
17305
|
|
|
17263
17306
|
// packages/cli/src/list.ts
|
|
17264
17307
|
init_advanced();
|
|
@@ -17580,6 +17623,7 @@ init_persisted_inspect_event();
|
|
|
17580
17623
|
init_from_trace_event();
|
|
17581
17624
|
|
|
17582
17625
|
// packages/core/src/persisted/from-inspect-event.ts
|
|
17626
|
+
init_delivery_identity();
|
|
17583
17627
|
init_token_usage();
|
|
17584
17628
|
|
|
17585
17629
|
// packages/core/src/entries/persisted.ts
|
|
@@ -19927,10 +19971,16 @@ function pickBoundedIdentityString(bag, key, maxLen) {
|
|
|
19927
19971
|
if (!bag || typeof bag !== "object") return {};
|
|
19928
19972
|
const directRaw = bag[key];
|
|
19929
19973
|
const nestedRaw = nestedBag(bag)?.[key];
|
|
19930
|
-
const
|
|
19931
|
-
const
|
|
19932
|
-
|
|
19933
|
-
|
|
19974
|
+
const directFull = typeof directRaw === "string" && directRaw.trim() !== "" ? directRaw.trim() : void 0;
|
|
19975
|
+
const nestedFull = typeof nestedRaw === "string" && nestedRaw.trim() !== "" ? nestedRaw.trim() : void 0;
|
|
19976
|
+
const direct = directFull !== void 0 ? directFull.slice(0, maxLen) : void 0;
|
|
19977
|
+
const nested = nestedFull !== void 0 ? nestedFull.slice(0, maxLen) : void 0;
|
|
19978
|
+
if (directFull !== void 0 && nestedFull !== void 0 && directFull !== nestedFull) {
|
|
19979
|
+
return {
|
|
19980
|
+
value: direct,
|
|
19981
|
+
conflictAlternate: nested,
|
|
19982
|
+
truncatedCollision: direct === nested
|
|
19983
|
+
};
|
|
19934
19984
|
}
|
|
19935
19985
|
if (direct !== void 0) return { value: direct };
|
|
19936
19986
|
if (nested !== void 0) return { value: nested };
|
|
@@ -19951,32 +20001,21 @@ function pickBoundedIdentityNumber(bag, key) {
|
|
|
19951
20001
|
}
|
|
19952
20002
|
function appendStructuralIdentityAttrs(attrs, meta2, maxLen) {
|
|
19953
20003
|
const conflicts = [];
|
|
19954
|
-
const
|
|
19955
|
-
|
|
19956
|
-
|
|
19957
|
-
|
|
19958
|
-
|
|
19959
|
-
|
|
19960
|
-
|
|
19961
|
-
|
|
19962
|
-
|
|
19963
|
-
|
|
19964
|
-
|
|
19965
|
-
|
|
19966
|
-
|
|
19967
|
-
|
|
19968
|
-
|
|
19969
|
-
attrs.push(stringAttr2(IDENTITY_CONFLICT_ATTR.attemptId, attemptId.conflictAlternate));
|
|
19970
|
-
conflicts.push("attemptId");
|
|
19971
|
-
}
|
|
19972
|
-
const retryOf = pickBoundedIdentityString(meta2, "retryOf", maxLen);
|
|
19973
|
-
if (retryOf.value !== void 0) {
|
|
19974
|
-
attrs.push(stringAttr2("agent_inspect.retry_of", retryOf.value));
|
|
19975
|
-
}
|
|
19976
|
-
if (retryOf.conflictAlternate !== void 0) {
|
|
19977
|
-
attrs.push(stringAttr2(IDENTITY_CONFLICT_ATTR.retryOf, retryOf.conflictAlternate));
|
|
19978
|
-
conflicts.push("retryOf");
|
|
19979
|
-
}
|
|
20004
|
+
const emitString = (key, otlpKey, conflictKey) => {
|
|
20005
|
+
const picked = pickBoundedIdentityString(meta2, key, maxLen);
|
|
20006
|
+
if (picked.value !== void 0) {
|
|
20007
|
+
attrs.push(stringAttr2(otlpKey, picked.value));
|
|
20008
|
+
}
|
|
20009
|
+
if (picked.conflictAlternate !== void 0 || picked.truncatedCollision) {
|
|
20010
|
+
if (picked.conflictAlternate !== void 0) {
|
|
20011
|
+
attrs.push(stringAttr2(conflictKey, picked.conflictAlternate));
|
|
20012
|
+
}
|
|
20013
|
+
conflicts.push(key);
|
|
20014
|
+
}
|
|
20015
|
+
};
|
|
20016
|
+
emitString("operationId", "agent_inspect.operation_id", IDENTITY_CONFLICT_ATTR.operationId);
|
|
20017
|
+
emitString("attemptId", "agent_inspect.attempt_id", IDENTITY_CONFLICT_ATTR.attemptId);
|
|
20018
|
+
emitString("retryOf", "agent_inspect.retry_of", IDENTITY_CONFLICT_ATTR.retryOf);
|
|
19980
20019
|
const attemptNumberPrimary = pickBoundedIdentityNumber(meta2, "attemptNumber");
|
|
19981
20020
|
const attemptNumber2 = attemptNumberPrimary.value !== void 0 || attemptNumberPrimary.conflictAlternate !== void 0 ? attemptNumberPrimary : pickBoundedIdentityNumber(meta2, "attempt");
|
|
19982
20021
|
if (attemptNumber2.value !== void 0) {
|
|
@@ -19988,9 +20027,18 @@ function appendStructuralIdentityAttrs(attrs, meta2, maxLen) {
|
|
|
19988
20027
|
);
|
|
19989
20028
|
conflicts.push("attemptNumber");
|
|
19990
20029
|
}
|
|
20030
|
+
if (conflicts.length > 0) {
|
|
20031
|
+
attrs.push(
|
|
20032
|
+
stringAttr2(IDENTITY_CONFLICT_ATTR.fields, conflicts.join(",").slice(0, maxLen))
|
|
20033
|
+
);
|
|
20034
|
+
}
|
|
19991
20035
|
if (meta2?.[DELIVERY_CONFLICT_ATTR] === true) {
|
|
19992
20036
|
attrs.push(boolAttr(DELIVERY_CONFLICT_ATTR, true));
|
|
19993
20037
|
}
|
|
20038
|
+
const deliveryBase = meta2?.[DELIVERY_EVENT_BASE_ATTR];
|
|
20039
|
+
if (typeof deliveryBase === "string" && deliveryBase.trim() !== "") {
|
|
20040
|
+
attrs.push(stringAttr2(DELIVERY_EVENT_BASE_ATTR, deliveryBase.trim().slice(0, maxLen)));
|
|
20041
|
+
}
|
|
19994
20042
|
return conflicts;
|
|
19995
20043
|
}
|
|
19996
20044
|
function resolveSpanTimes(ev) {
|