@agent-inspect/vitest 6.30.0 → 6.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.
package/dist/index.d.cts CHANGED
@@ -447,6 +447,55 @@ interface TraceContractLlmRules {
447
447
  maxTotalTokens?: number;
448
448
  allowedModels?: string[];
449
449
  }
450
+ /**
451
+ * Explicit TOOL or LLM step endpoint for typed cross-kind ordering.
452
+ *
453
+ * @experimental Additive in 6.31.
454
+ */
455
+ type TraceContractStepKind = "TOOL" | "LLM";
456
+ /**
457
+ * Named step endpoint with an explicit event kind.
458
+ *
459
+ * @experimental Additive in 6.31.
460
+ */
461
+ interface TraceContractStepRef {
462
+ kind: TraceContractStepKind;
463
+ name: string;
464
+ }
465
+ /**
466
+ * One typed before/after ordering relation across TOOL and/or LLM steps.
467
+ *
468
+ * Unlike `tools.requiredOrder` / `orderRules`, endpoints are kind-qualified so
469
+ * an LLM named `generate_answer` does not satisfy a TOOL endpoint (and vice versa).
470
+ *
471
+ * @experimental Additive in 6.31.
472
+ */
473
+ interface TraceContractStepOrderRelation {
474
+ before: TraceContractStepRef;
475
+ after: TraceContractStepRef;
476
+ /**
477
+ * Ordering semantics for this pair.
478
+ *
479
+ * @defaultValue `"first-occurrence"`
480
+ */
481
+ mode?: "first-occurrence" | "happens-before" | "all-occurrences";
482
+ /**
483
+ * When true (default), missing endpoints of the declared kind fail.
484
+ * Wrong-kind same-name events do not satisfy the endpoint.
485
+ *
486
+ * @defaultValue `true`
487
+ */
488
+ requireEndpoints?: boolean;
489
+ }
490
+ /**
491
+ * Cross-kind step ordering (TOOL ↔ LLM). Does not change TOOL-only
492
+ * `tools.requiredOrder` / `orderRules` semantics.
493
+ *
494
+ * @experimental Additive in 6.31.
495
+ */
496
+ interface TraceContractStepRules {
497
+ orderRelations?: TraceContractStepOrderRelation[];
498
+ }
450
499
  /**
451
500
  * Structural provenance requirements for named observed outcomes (#321).
452
501
  *
@@ -507,6 +556,12 @@ type TraceContractBody = {
507
556
  run?: TraceContractRunRules;
508
557
  tools?: TraceContractToolRules;
509
558
  llm?: TraceContractLlmRules;
559
+ /**
560
+ * Typed cross-kind step ordering (TOOL / LLM endpoints).
561
+ *
562
+ * @experimental Additive in 6.31.
563
+ */
564
+ steps?: TraceContractStepRules;
510
565
  observations?: TraceContractObservationRules;
511
566
  /**
512
567
  * Declared-versus-enforced control invariants.
package/dist/index.d.ts CHANGED
@@ -447,6 +447,55 @@ interface TraceContractLlmRules {
447
447
  maxTotalTokens?: number;
448
448
  allowedModels?: string[];
449
449
  }
450
+ /**
451
+ * Explicit TOOL or LLM step endpoint for typed cross-kind ordering.
452
+ *
453
+ * @experimental Additive in 6.31.
454
+ */
455
+ type TraceContractStepKind = "TOOL" | "LLM";
456
+ /**
457
+ * Named step endpoint with an explicit event kind.
458
+ *
459
+ * @experimental Additive in 6.31.
460
+ */
461
+ interface TraceContractStepRef {
462
+ kind: TraceContractStepKind;
463
+ name: string;
464
+ }
465
+ /**
466
+ * One typed before/after ordering relation across TOOL and/or LLM steps.
467
+ *
468
+ * Unlike `tools.requiredOrder` / `orderRules`, endpoints are kind-qualified so
469
+ * an LLM named `generate_answer` does not satisfy a TOOL endpoint (and vice versa).
470
+ *
471
+ * @experimental Additive in 6.31.
472
+ */
473
+ interface TraceContractStepOrderRelation {
474
+ before: TraceContractStepRef;
475
+ after: TraceContractStepRef;
476
+ /**
477
+ * Ordering semantics for this pair.
478
+ *
479
+ * @defaultValue `"first-occurrence"`
480
+ */
481
+ mode?: "first-occurrence" | "happens-before" | "all-occurrences";
482
+ /**
483
+ * When true (default), missing endpoints of the declared kind fail.
484
+ * Wrong-kind same-name events do not satisfy the endpoint.
485
+ *
486
+ * @defaultValue `true`
487
+ */
488
+ requireEndpoints?: boolean;
489
+ }
490
+ /**
491
+ * Cross-kind step ordering (TOOL ↔ LLM). Does not change TOOL-only
492
+ * `tools.requiredOrder` / `orderRules` semantics.
493
+ *
494
+ * @experimental Additive in 6.31.
495
+ */
496
+ interface TraceContractStepRules {
497
+ orderRelations?: TraceContractStepOrderRelation[];
498
+ }
450
499
  /**
451
500
  * Structural provenance requirements for named observed outcomes (#321).
452
501
  *
@@ -507,6 +556,12 @@ type TraceContractBody = {
507
556
  run?: TraceContractRunRules;
508
557
  tools?: TraceContractToolRules;
509
558
  llm?: TraceContractLlmRules;
559
+ /**
560
+ * Typed cross-kind step ordering (TOOL / LLM endpoints).
561
+ *
562
+ * @experimental Additive in 6.31.
563
+ */
564
+ steps?: TraceContractStepRules;
510
565
  observations?: TraceContractObservationRules;
511
566
  /**
512
567
  * Declared-versus-enforced control invariants.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-inspect/vitest",
3
- "version": "6.30.0",
3
+ "version": "6.31.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Vitest reporter and experimental TraceContract matchers for AgentInspect local evidence",
@@ -38,7 +38,7 @@
38
38
  "vitest": "^2.1.0 || ^3.2.6"
39
39
  },
40
40
  "dependencies": {
41
- "agent-inspect": "6.30.0"
41
+ "agent-inspect": "6.31.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "vitest": "^3.2.7"