@vincemakes/kiso-evals 0.15.10 → 0.15.11

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/faux.d.ts CHANGED
@@ -24,7 +24,7 @@ import type { Adapter } from "@vincemakes/kiso-core";
24
24
  import type { EventInput } from "@vincemakes/kiso-core";
25
25
  /** One model turn: the events it emits. Tool results live in fixture tools. */
26
26
  export interface FauxTurn {
27
- readonly events: readonly (EventInput | FauxDelay)[];
27
+ readonly events: readonly (EventInput | FauxDelay | FauxFail)[];
28
28
  }
29
29
  /** W18: the harness's slow-adapter capability — a `delay` pseudo-event
30
30
  * awaits REAL milliseconds before the following events. The CLI e2e's
@@ -38,5 +38,17 @@ export interface FauxDelay {
38
38
  readonly type: "delay";
39
39
  readonly ms: number;
40
40
  }
41
+ /** F4: the harness's stream-cut capability — a `fail` pseudo-event THROWS a
42
+ * structured-error-shaped object after the events before it, the way a real
43
+ * provider dies mid-stream. Like `delay` (W18), it is a declared harness
44
+ * capability of the fake model, never a product branch: the mid-stream
45
+ * retry gates need a provider that cuts on cue. */
46
+ export interface FauxFail {
47
+ readonly type: "fail";
48
+ readonly code: string;
49
+ readonly status?: number;
50
+ readonly retryable: boolean;
51
+ readonly message?: string;
52
+ }
41
53
  export type FauxScript = readonly FauxTurn[];
42
54
  export declare function createFauxProvider(script: FauxScript): Adapter;
package/dist/faux.js CHANGED
@@ -49,6 +49,14 @@ export function createFauxProvider(script) {
49
49
  await new Promise((resolve) => setTimeout(resolve, ev.ms));
50
50
  continue;
51
51
  }
52
+ if (ev.type === "fail") {
53
+ throw {
54
+ code: ev.code,
55
+ ...(ev.status !== undefined ? { status: ev.status } : {}),
56
+ retryable: ev.retryable,
57
+ message: ev.message ?? ev.code,
58
+ };
59
+ }
52
60
  yield { ...ev, seq: seq++ };
53
61
  }
54
62
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vincemakes/kiso-evals",
3
- "version": "0.15.10",
3
+ "version": "0.15.11",
4
4
  "description": "kiso evals \u2014 the faux provider, the incident fixture library, and the cross-provider contract tests.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -21,12 +21,12 @@
21
21
  "test": "vitest run"
22
22
  },
23
23
  "dependencies": {
24
- "@vincemakes/kiso-core": "0.15.10"
24
+ "@vincemakes/kiso-core": "0.15.11"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@anthropic-ai/sdk": "^0.115.0",
28
- "@vincemakes/kiso-provider-anthropic": "0.15.10",
29
- "@vincemakes/kiso-provider-openai": "0.15.10",
28
+ "@vincemakes/kiso-provider-anthropic": "0.15.11",
29
+ "@vincemakes/kiso-provider-openai": "0.15.11",
30
30
  "@types/node": "^26.1.2",
31
31
  "openai": "^7.3.0",
32
32
  "typescript": "^5.7.2",