agent-inspect 6.31.0 → 6.31.2
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 +4 -3
- package/docs/AI-SDK-ADOPTION.md +7 -2
- package/docs/CI-ARTIFACTS.md +2 -0
- package/docs/COMPARE.md +1 -1
- package/docs/FIRST-TRACE-IN-5-MINUTES.md +21 -17
- package/docs/GETTING-STARTED.md +1 -1
- package/package.json +4 -2
- package/packages/cli/dist/{chunk-Y5Z4BXUO.mjs → chunk-SJ6FRNOE.mjs} +37 -6
- package/packages/cli/dist/chunk-SJ6FRNOE.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +49 -7
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +16 -5
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-WTTH5G33.mjs → src-YNEJOPRA.mjs} +3 -3
- package/packages/cli/dist/{src-WTTH5G33.mjs.map → src-YNEJOPRA.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +27 -0
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.mjs +2 -2
- package/packages/core/dist/checks.cjs +35 -4
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.mjs +1 -1
- package/packages/core/dist/{chunk-VEQKLWGJ.mjs → chunk-CBPWLHNQ.mjs} +37 -6
- package/packages/core/dist/chunk-CBPWLHNQ.mjs.map +1 -0
- package/packages/cli/dist/chunk-Y5Z4BXUO.mjs.map +0 -1
- package/packages/core/dist/chunk-VEQKLWGJ.mjs.map +0 -1
|
@@ -8738,11 +8738,33 @@ function contractFailFinding(ruleId, message, evidence, expected, actual) {
|
|
|
8738
8738
|
evidence: [...evidence]
|
|
8739
8739
|
};
|
|
8740
8740
|
}
|
|
8741
|
+
function parseAllowedStatus(status) {
|
|
8742
|
+
return ALLOWED_STATUS_ALIASES[status];
|
|
8743
|
+
}
|
|
8741
8744
|
function normalizeStatus(status) {
|
|
8742
|
-
|
|
8743
|
-
if (
|
|
8744
|
-
|
|
8745
|
-
|
|
8745
|
+
const parsed = parseAllowedStatus(status);
|
|
8746
|
+
if (parsed === void 0) {
|
|
8747
|
+
throw new TypeError(
|
|
8748
|
+
`Unknown run status ${JSON.stringify(status)}. Allowed: ok, error, running (aliases: success, failed).`
|
|
8749
|
+
);
|
|
8750
|
+
}
|
|
8751
|
+
return parsed;
|
|
8752
|
+
}
|
|
8753
|
+
function validateAllowedStatusesShape(allowedStatuses, pathPrefix = "run.allowedStatuses") {
|
|
8754
|
+
if (!allowedStatuses?.length) return [];
|
|
8755
|
+
const out = [];
|
|
8756
|
+
for (let i = 0; i < allowedStatuses.length; i++) {
|
|
8757
|
+
const status = allowedStatuses[i];
|
|
8758
|
+
if (parseAllowedStatus(status) === void 0) {
|
|
8759
|
+
out.push({
|
|
8760
|
+
code: "contract.run.allowedStatuses.unknown",
|
|
8761
|
+
severity: "error",
|
|
8762
|
+
message: `${pathPrefix}[${i}] has unknown status ${JSON.stringify(status)}. Allowed: ok, error, running (aliases: success, failed).`,
|
|
8763
|
+
path: `${pathPrefix}[${i}]`
|
|
8764
|
+
});
|
|
8765
|
+
}
|
|
8766
|
+
}
|
|
8767
|
+
return out;
|
|
8746
8768
|
}
|
|
8747
8769
|
function cloneBody(body) {
|
|
8748
8770
|
return {
|
|
@@ -9407,6 +9429,7 @@ function evaluateBody(input3, body, options = {}) {
|
|
|
9407
9429
|
}
|
|
9408
9430
|
function defineTraceContract(input3) {
|
|
9409
9431
|
const shapeErrors = [
|
|
9432
|
+
...validateAllowedStatusesShape(input3.run?.allowedStatuses),
|
|
9410
9433
|
...validateAlternativesShape(input3.alternatives),
|
|
9411
9434
|
...validateScopeShape(input3.scope),
|
|
9412
9435
|
...validateProvenanceShape(input3.observations)
|
|
@@ -9437,6 +9460,7 @@ function defineTraceContract(input3) {
|
|
|
9437
9460
|
}
|
|
9438
9461
|
function evaluateTraceContract(input3, contract, options = {}) {
|
|
9439
9462
|
const shapeErrors = [
|
|
9463
|
+
...validateAllowedStatusesShape(contract.run?.allowedStatuses),
|
|
9440
9464
|
...validateAlternativesShape(contract.alternatives),
|
|
9441
9465
|
...validateScopeShape(contract.scope),
|
|
9442
9466
|
...validateProvenanceShape(contract.observations)
|
|
@@ -9572,7 +9596,7 @@ function evaluateTraceContract(input3, contract, options = {}) {
|
|
|
9572
9596
|
[...scopeFinding ? [scopeFinding] : [], noneFinding, ...prefixedBranchFindings]
|
|
9573
9597
|
);
|
|
9574
9598
|
}
|
|
9575
|
-
var MAX_EVIDENCE_EVENT_IDS, METHOD_VOCABULARY;
|
|
9599
|
+
var ALLOWED_STATUS_ALIASES, MAX_EVIDENCE_EVENT_IDS, METHOD_VOCABULARY;
|
|
9576
9600
|
var init_contract = __esm({
|
|
9577
9601
|
"packages/core/src/checks/contract.ts"() {
|
|
9578
9602
|
init_checks2();
|
|
@@ -9585,6 +9609,13 @@ var init_contract = __esm({
|
|
|
9585
9609
|
init_outcomes();
|
|
9586
9610
|
init_contract_scope();
|
|
9587
9611
|
init_tool_arguments();
|
|
9612
|
+
ALLOWED_STATUS_ALIASES = {
|
|
9613
|
+
ok: "ok",
|
|
9614
|
+
error: "error",
|
|
9615
|
+
running: "running",
|
|
9616
|
+
success: "ok",
|
|
9617
|
+
failed: "error"
|
|
9618
|
+
};
|
|
9588
9619
|
MAX_EVIDENCE_EVENT_IDS = 16;
|
|
9589
9620
|
METHOD_VOCABULARY = new Set(OBSERVED_OUTCOME_METHODS);
|
|
9590
9621
|
}
|
|
@@ -16122,7 +16153,7 @@ var init_src = __esm({
|
|
|
16122
16153
|
});
|
|
16123
16154
|
|
|
16124
16155
|
// package.json
|
|
16125
|
-
var version = "6.31.
|
|
16156
|
+
var version = "6.31.2";
|
|
16126
16157
|
|
|
16127
16158
|
// packages/cli/src/list.ts
|
|
16128
16159
|
init_advanced();
|
|
@@ -23494,10 +23525,21 @@ function parseContractRunSection(value, pathPrefix = "contract.run") {
|
|
|
23494
23525
|
);
|
|
23495
23526
|
}
|
|
23496
23527
|
if (record.allowedStatuses !== void 0) {
|
|
23497
|
-
|
|
23528
|
+
const statuses = requireBoundedStringArray(
|
|
23498
23529
|
record.allowedStatuses,
|
|
23499
23530
|
`${pathPrefix}.allowedStatuses`
|
|
23500
23531
|
);
|
|
23532
|
+
const allowed = /* @__PURE__ */ new Set(["ok", "error", "running", "success", "failed"]);
|
|
23533
|
+
for (let i = 0; i < statuses.length; i++) {
|
|
23534
|
+
const status = statuses[i];
|
|
23535
|
+
if (!allowed.has(status)) {
|
|
23536
|
+
throw new CheckConfigError(
|
|
23537
|
+
"AI_CHECK_CONFIG_INVALID_VALUE",
|
|
23538
|
+
`${pathPrefix}.allowedStatuses[${i}] must be one of: ok, error, running (aliases: success, failed); got ${JSON.stringify(status)}.`
|
|
23539
|
+
);
|
|
23540
|
+
}
|
|
23541
|
+
}
|
|
23542
|
+
out.allowedStatuses = statuses;
|
|
23501
23543
|
}
|
|
23502
23544
|
if (record.maxDurationMs !== void 0) {
|
|
23503
23545
|
out.maxDurationMs = requireNonNegativeNumber(
|