@rulvar/testing 1.73.0 → 1.75.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.
@@ -98,11 +98,15 @@ var FakeAdapter = class {
98
98
  * was already aborted on arrival was never served and is not recorded.
99
99
  */
100
100
  calls = [];
101
+ /** Detachment-safe like the historical `caps(this: void)` method. */
102
+ caps;
101
103
  constructor(options) {
102
104
  this.agents = options.agents;
103
- }
104
- caps() {
105
- return FAKE_CAPS;
105
+ const declaredCaps = options.capsOverrides === void 0 ? FAKE_CAPS : {
106
+ ...FAKE_CAPS,
107
+ ...options.capsOverrides
108
+ };
109
+ this.caps = () => declaredCaps;
106
110
  }
107
111
  match(call) {
108
112
  let fallback;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as FAKE_MODEL, c as FakeAdapterOptions, d as FakeToolCallsValue, f as FakeWireErrorValue, i as createTestEngine, l as FakeCall, m as fakeWireError, n as TestEngine, o as FAKE_MODEL_REF, p as fakeToolCalls, r as TestRunHandle, s as FakeAdapter, t as CreateTestEngineOptions, u as FakeResponder } from "./test-engine-CVmHZlm-.js";
1
+ import { a as FAKE_MODEL, c as FakeAdapterOptions, d as FakeToolCallsValue, f as FakeWireErrorValue, i as createTestEngine, l as FakeCall, m as fakeWireError, n as TestEngine, o as FAKE_MODEL_REF, p as fakeToolCalls, r as TestRunHandle, s as FakeAdapter, t as CreateTestEngineOptions, u as FakeResponder } from "./test-engine-CmHv4p5A.js";
2
2
  import { AgentProfile, ChatEvent, ChatRequest, InvocationRole, JournalEntry, JournalStore, ModelCaps, ModelSpec, ProviderAdapter, ResumePreview, RunOutcome, WireError, Workflow, createEngine } from "@rulvar/core";
3
3
 
4
4
  //#region src/replay-strict.d.ts
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as fakeWireError, i as fakeToolCalls, n as FAKE_MODEL_REF, r as FakeAdapter, t as FAKE_MODEL } from "./fake-adapter-3T_w-IOY.js";
1
+ import { a as fakeWireError, i as fakeToolCalls, n as FAKE_MODEL_REF, r as FakeAdapter, t as FAKE_MODEL } from "./fake-adapter-A8l8rvx5.js";
2
2
  import { CURRENT_HASH_VERSION, ConfigError, InMemoryStore, JournalMissError, createEngine, hashWorkflowBody, usageViolations } from "@rulvar/core";
3
3
  import { createHash } from "node:crypto";
4
4
  import { appendFileSync, existsSync, readFileSync, writeFileSync } from "node:fs";
@@ -1,4 +1,4 @@
1
- import { a as fakeWireError, i as fakeToolCalls, n as FAKE_MODEL_REF, r as FakeAdapter } from "../fake-adapter-3T_w-IOY.js";
1
+ import { a as fakeWireError, i as fakeToolCalls, n as FAKE_MODEL_REF, r as FakeAdapter } from "../fake-adapter-A8l8rvx5.js";
2
2
  import { EMPTY_SCHEMA_HASH, EMPTY_TOOLSET_HASH, InMemoryStore, InMemoryTranscriptStore, Replayer, agentScope, buildDeriverRegistry, canonicalizeSchema, createEngine, defineWorkflow, deriveContentKey, makeOrchestratorWorkflow, normalizeEntry, projectToJsonSchema, registryKeyRing } from "@rulvar/core";
3
3
  import { existsSync, readFileSync } from "node:fs";
4
4
  import { fileURLToPath } from "node:url";
@@ -1,4 +1,4 @@
1
- import { r as TestRunHandle } from "./test-engine-CVmHZlm-.js";
1
+ import { r as TestRunHandle } from "./test-engine-CmHv4p5A.js";
2
2
 
3
3
  //#region src/matchers.d.ts
4
4
  interface MatcherResult {
@@ -41,6 +41,13 @@ interface FakeAdapterOptions {
41
41
  * is the fallback.
42
42
  */
43
43
  agents: Record<string, FakeResponder>;
44
+ /**
45
+ * Declared capability fields layered over the fake defaults (the
46
+ * v1.74 experiment review): lets an offline test drive caps-driven
47
+ * runtime behavior, e.g. minOutputTokensPerTurn for the provider
48
+ * output floor, without a live adapter.
49
+ */
50
+ capsOverrides?: Partial<ModelCaps>;
44
51
  }
45
52
  declare const FAKE_MODEL = "fake-model";
46
53
  declare const FAKE_MODEL_REF = "fake:fake-model";
@@ -53,8 +60,9 @@ declare class FakeAdapter implements ProviderAdapter {
53
60
  * was already aborted on arrival was never served and is not recorded.
54
61
  */
55
62
  readonly calls: FakeCall[];
63
+ /** Detachment-safe like the historical `caps(this: void)` method. */
64
+ readonly caps: () => ModelCaps;
56
65
  constructor(options: FakeAdapterOptions);
57
- caps(this: void): ModelCaps;
58
66
  private match;
59
67
  stream(req: ChatRequest, signal?: AbortSignal): AsyncIterable<ChatEvent>;
60
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/testing",
3
- "version": "1.73.0",
3
+ "version": "1.75.0",
4
4
  "description": "Rulvar test harness: createTestEngine, FakeAdapter, VCR cassettes, replay-strict runs, matchers.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -26,7 +26,7 @@
26
26
  "access": "public"
27
27
  },
28
28
  "dependencies": {
29
- "@rulvar/core": "1.73.0"
29
+ "@rulvar/core": "1.75.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "^22.20.0",