@copilotkit/aimock 1.37.3 → 1.37.4
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 +13 -0
- package/dist/config-loader.d.ts.map +1 -1
- package/dist/messages.cjs +4 -4
- package/dist/messages.cjs.map +1 -1
- package/dist/messages.d.cts.map +1 -1
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +4 -4
- package/dist/messages.js.map +1 -1
- package/dist/recorder.cjs +1 -1
- package/dist/recorder.cjs.map +1 -1
- package/dist/recorder.js +2 -2
- package/dist/recorder.js.map +1 -1
- package/dist/router.cjs +41 -6
- package/dist/router.cjs.map +1 -1
- package/dist/router.d.cts.map +1 -1
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +41 -7
- package/dist/router.js.map +1 -1
- package/dist/types.d.cts +15 -0
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.ts +15 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/vector-types.d.cts.map +1 -1
- package/package.json +1 -1
- package/skills/write-fixtures/SKILL.md +28 -28
package/dist/types.d.cts
CHANGED
|
@@ -110,6 +110,14 @@ interface FixtureMatch {
|
|
|
110
110
|
/** Which occurrence of this match to respond to (0-indexed). Undefined means match any. */
|
|
111
111
|
sequenceIndex?: number;
|
|
112
112
|
turnIndex?: number;
|
|
113
|
+
/**
|
|
114
|
+
* Turn-scoped tool-result presence gate: matches on whether the CURRENT turn
|
|
115
|
+
* (the messages after the last `role: "user"` message) contains a `role: "tool"`
|
|
116
|
+
* message. Scoping to the current turn — rather than the whole conversation —
|
|
117
|
+
* lets a leg-1 (`false`) / leg-2 (`true`) fixture pair keep discriminating on
|
|
118
|
+
* later turns whose history still carries earlier turns' tool results. If the
|
|
119
|
+
* request has no user message, it falls back to scanning the whole conversation.
|
|
120
|
+
*/
|
|
113
121
|
hasToolResult?: boolean;
|
|
114
122
|
endpoint?: "chat" | "image" | "speech" | "transcription" | "translation" | "video" | "embedding" | "audio-gen" | "elevenlabs-tts" | "fal-audio" | "fal" | "realtime" | "realtime-transcription" | "realtime-translation";
|
|
115
123
|
context?: string;
|
|
@@ -476,6 +484,13 @@ interface FixtureFileEntry {
|
|
|
476
484
|
responseFormat?: string;
|
|
477
485
|
sequenceIndex?: number;
|
|
478
486
|
turnIndex?: number;
|
|
487
|
+
/**
|
|
488
|
+
* Turn-scoped tool-result presence gate: matches on whether the CURRENT turn
|
|
489
|
+
* (the messages after the last `role: "user"` message) contains a `role: "tool"`
|
|
490
|
+
* message, not the whole conversation. Falls back to scanning the whole
|
|
491
|
+
* conversation when the request has no user message. Mirrors the runtime
|
|
492
|
+
* `FixtureMatch.hasToolResult`.
|
|
493
|
+
*/
|
|
479
494
|
hasToolResult?: boolean;
|
|
480
495
|
endpoint?: "chat" | "image" | "speech" | "transcription" | "translation" | "video" | "embedding" | "audio-gen" | "elevenlabs-tts" | "fal-audio" | "fal" | "realtime" | "realtime-transcription" | "realtime-translation";
|
|
481
496
|
context?: string;
|
package/dist/types.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;;;;;UAQiB,SAAA;qBAER,MAAA,CAAK,sBACL,MAAA,CAAK,mCAET;EALY,aAAS,EAAA,MAAA,EAMD,GAAA,CAAI,MANH,EAAA,IAAA,EAMiB,MANjB,EAAA,QAAA,EAAA,MAAA,CAAA,EAM4C,OAN5C,CAAA,OAAA,CAAA;EAAA,MAAA,GAAA,EAAA;IAEjB,MAAK,EAAA,MAAA;IACL,CAAA,GAAA,EAAK,MAAA,CAAA,EAAA,OAAA;;YAGe,EAAA,OAAA,EAEN,OAFM,CAAA,EAAA,IAAA;YAAc,EAAA,GAAA,EAAA,MAAA,CAAA,EAAA,IAAA;aAA2B,EAAA,QAAA,EAI7C,eAJ6C,CAAA,EAAA,IAAA;;AAI7C,UAGR,WAAA,CAHQ;EAAe,IAAA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
110
|
/** Which occurrence of this match to respond to (0-indexed). Undefined means match any. */
|
|
111
111
|
sequenceIndex?: number;
|
|
112
112
|
turnIndex?: number;
|
|
113
|
+
/**
|
|
114
|
+
* Turn-scoped tool-result presence gate: matches on whether the CURRENT turn
|
|
115
|
+
* (the messages after the last `role: "user"` message) contains a `role: "tool"`
|
|
116
|
+
* message. Scoping to the current turn — rather than the whole conversation —
|
|
117
|
+
* lets a leg-1 (`false`) / leg-2 (`true`) fixture pair keep discriminating on
|
|
118
|
+
* later turns whose history still carries earlier turns' tool results. If the
|
|
119
|
+
* request has no user message, it falls back to scanning the whole conversation.
|
|
120
|
+
*/
|
|
113
121
|
hasToolResult?: boolean;
|
|
114
122
|
endpoint?: "chat" | "image" | "speech" | "transcription" | "translation" | "video" | "embedding" | "audio-gen" | "elevenlabs-tts" | "fal-audio" | "fal" | "realtime" | "realtime-transcription" | "realtime-translation";
|
|
115
123
|
context?: string;
|
|
@@ -476,6 +484,13 @@ interface FixtureFileEntry {
|
|
|
476
484
|
responseFormat?: string;
|
|
477
485
|
sequenceIndex?: number;
|
|
478
486
|
turnIndex?: number;
|
|
487
|
+
/**
|
|
488
|
+
* Turn-scoped tool-result presence gate: matches on whether the CURRENT turn
|
|
489
|
+
* (the messages after the last `role: "user"` message) contains a `role: "tool"`
|
|
490
|
+
* message, not the whole conversation. Falls back to scanning the whole
|
|
491
|
+
* conversation when the request has no user message. Mirrors the runtime
|
|
492
|
+
* `FixtureMatch.hasToolResult`.
|
|
493
|
+
*/
|
|
479
494
|
hasToolResult?: boolean;
|
|
480
495
|
endpoint?: "chat" | "image" | "speech" | "transcription" | "translation" | "video" | "embedding" | "audio-gen" | "elevenlabs-tts" | "fal-audio" | "fal" | "realtime" | "realtime-transcription" | "realtime-translation";
|
|
481
496
|
context?: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":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;;;oBAMY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAuDH,2BAAA;;;;;;;;;;;;;;;;UAiBA,eAAA;;;;;;UAOA,iBAAA;;;;;;;;UAQP;;;;;;WAMC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAkCgB,0BAA0B;;;;;;;;;;;aAWxC;;;;;;;;oBAQO;;;;;;;;aAQP;;;;;;;cAOC;;;;;;;UAQG,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;UA6BA,eAAA;;;;UAIP;UACA;aACG;WACF;;2BAEgB,0BAA0B;aACxC;oBACO;aACP;cACC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector-types.d.cts","names":[],"sources":["../src/vector-types.ts"],"sourcesContent":[],"mappings":";UAAiB,iBAAA;EAAA,IAAA,CAAA,EAAA,MAAA;EAKA,IAAA,CAAA,EAAA,MAAA;;AAGM,UAHN,gBAAA,CAGM;MAAZ,EAAA,MAAA;EAAG,SAAA,EAAA,MAAA;EAGG,OAAA,EAHN,GAGM,CAAA,MAAW,EAHL,
|
|
1
|
+
{"version":3,"file":"vector-types.d.cts","names":[],"sources":["../src/vector-types.ts"],"sourcesContent":[],"mappings":";UAAiB,iBAAA;EAAA,IAAA,CAAA,EAAA,MAAA;EAKA,IAAA,CAAA,EAAA,MAAA;;AAGM,UAHN,gBAAA,CAGM;MAAZ,EAAA,MAAA;EAAG,SAAA,EAAA,MAAA;EAGG,OAAA,EAHN,GAGM,CAAA,MAAW,EAHL,WAMJ,CAAA;AAGnB;AAOiB,UAbA,WAAA,CAaW;EAOhB,EAAA,EAAA,MAAA;EAAY,MAAA,EAAA,MAAA,EAAA;UAAG,CAAA,EAjBd,MAiBc,CAAA,MAAA,EAAA,OAAA,CAAA;;AAAyC,UAdnD,WAAA,CAcmD;EAAW,EAAA,EAAA,MAAA;;aAXlE;;;UAII,WAAA;;;;;;KAOL,YAAA,GAAe,yBAAyB,gBAAgB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@copilotkit/aimock",
|
|
3
|
-
"version": "1.37.
|
|
3
|
+
"version": "1.37.4",
|
|
4
4
|
"description": "Mock infrastructure for AI application testing — LLM APIs, image generation, image editing, text-to-speech, transcription, audio translation, audio generation, video generation, embeddings, MCP tools, A2A agents, AG-UI event streams, vector databases, search, rerank, and moderation. One package, one port, zero dependencies.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -19,26 +19,26 @@ aimock is a zero-dependency mock infrastructure for AI apps. Fixture-driven. Mul
|
|
|
19
19
|
|
|
20
20
|
## Match Field Reference
|
|
21
21
|
|
|
22
|
-
| Field | Type | Matches Against
|
|
23
|
-
| -------------------- | ----------------------------------------- |
|
|
24
|
-
| `userMessage` | `string` | Substring of last `role: "user"` message text
|
|
25
|
-
| `userMessage` | `RegExp` | Pattern test on last `role: "user"` message text
|
|
26
|
-
| `systemMessage` | `string` | Substring of the concatenated text of every `role: "system"` message in the request. Use to gate a fixture on host-supplied context (persona, agent-context entries) so changes to that context cause the fixture to fall through instead of returning a stale baked response
|
|
27
|
-
| `systemMessage` | `string[]` | Array of substrings — ALL must be present in the joined system text (AND semantics). Use when the gate must combine multiple non-adjacent tokens whose serialisation order isn't stable
|
|
28
|
-
| `systemMessage` | `RegExp` | Pattern test on the concatenated system-message text
|
|
29
|
-
| `inputText` | `string` | Substring of embedding input text (concatenated if multiple inputs)
|
|
30
|
-
| `inputText` | `RegExp` | Pattern test on embedding input text
|
|
31
|
-
| `toolName` | `string` | Exact match on any tool in request's `tools[]` array (by `function.name`)
|
|
32
|
-
| `toolCallId` | `string` | Exact match on `tool_call_id` of last `role: "tool"` message
|
|
33
|
-
| `toolResultContains` | `string` | Substring of the last tool message's text content, gated on that message being the request's LAST message (same rule as `toolCallId`). Discriminates resume paths that share a `tool_call_id` and differ only inside the tool-result payload (e.g. approve `{"chosen_time": …}` vs cancel `{"cancelled": true}`)
|
|
34
|
-
| `model` | `string` | Exact match on `req.model`
|
|
35
|
-
| `model` | `RegExp` | Pattern test on `req.model`
|
|
36
|
-
| `responseFormat` | `string` | Exact match on `req.response_format.type` (`"json_object"`, `"json_schema"`)
|
|
37
|
-
| `sequenceIndex` | `number` | Matches only when this fixture's match count equals the given index (0-based)
|
|
38
|
-
| `turnIndex` | `number` | Stateless conversation-depth matching. Counts `role: "assistant"` messages in the request; matches when that count equals the value. `turnIndex: 0` = first turn (no prior assistant messages). Use instead of `sequenceIndex` for shared/deployed instances where stateful counters break under concurrency
|
|
39
|
-
| `hasToolResult` | `boolean` | Stateless tool-message presence matching. `true` matches when
|
|
40
|
-
| `endpoint` | `string` | Restrict to endpoint type: `"chat"`, `"image"`, `"speech"`, `"transcription"`, `"video"`, `"embedding"`
|
|
41
|
-
| `predicate` | `(req: ChatCompletionRequest) => boolean` | Custom function — full access to request
|
|
22
|
+
| Field | Type | Matches Against |
|
|
23
|
+
| -------------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
24
|
+
| `userMessage` | `string` | Substring of last `role: "user"` message text |
|
|
25
|
+
| `userMessage` | `RegExp` | Pattern test on last `role: "user"` message text |
|
|
26
|
+
| `systemMessage` | `string` | Substring of the concatenated text of every `role: "system"` message in the request. Use to gate a fixture on host-supplied context (persona, agent-context entries) so changes to that context cause the fixture to fall through instead of returning a stale baked response |
|
|
27
|
+
| `systemMessage` | `string[]` | Array of substrings — ALL must be present in the joined system text (AND semantics). Use when the gate must combine multiple non-adjacent tokens whose serialisation order isn't stable |
|
|
28
|
+
| `systemMessage` | `RegExp` | Pattern test on the concatenated system-message text |
|
|
29
|
+
| `inputText` | `string` | Substring of embedding input text (concatenated if multiple inputs) |
|
|
30
|
+
| `inputText` | `RegExp` | Pattern test on embedding input text |
|
|
31
|
+
| `toolName` | `string` | Exact match on any tool in request's `tools[]` array (by `function.name`) |
|
|
32
|
+
| `toolCallId` | `string` | Exact match on `tool_call_id` of last `role: "tool"` message |
|
|
33
|
+
| `toolResultContains` | `string` | Substring of the last tool message's text content, gated on that message being the request's LAST message (same rule as `toolCallId`). Discriminates resume paths that share a `tool_call_id` and differ only inside the tool-result payload (e.g. approve `{"chosen_time": …}` vs cancel `{"cancelled": true}`) |
|
|
34
|
+
| `model` | `string` | Exact match on `req.model` |
|
|
35
|
+
| `model` | `RegExp` | Pattern test on `req.model` |
|
|
36
|
+
| `responseFormat` | `string` | Exact match on `req.response_format.type` (`"json_object"`, `"json_schema"`) |
|
|
37
|
+
| `sequenceIndex` | `number` | Matches only when this fixture's match count equals the given index (0-based) |
|
|
38
|
+
| `turnIndex` | `number` | Stateless conversation-depth matching. Counts `role: "assistant"` messages in the request; matches when that count equals the value. `turnIndex: 0` = first turn (no prior assistant messages). Use instead of `sequenceIndex` for shared/deployed instances where stateful counters break under concurrency |
|
|
39
|
+
| `hasToolResult` | `boolean` | Stateless tool-message presence matching, scoped to the CURRENT turn (messages after the last `role: "user"` message). `true` matches when a `role: "tool"` message appears after the last user message; `false` matches when none does. (If the request has no user message, the whole conversation is scanned.) Provider-consistent across all aimock handlers (OpenAI, Claude, Gemini, Bedrock, Ollama, Cohere) |
|
|
40
|
+
| `endpoint` | `string` | Restrict to endpoint type: `"chat"`, `"image"`, `"speech"`, `"transcription"`, `"video"`, `"embedding"` |
|
|
41
|
+
| `predicate` | `(req: ChatCompletionRequest) => boolean` | Custom function — full access to request |
|
|
42
42
|
|
|
43
43
|
**AND logic**: all specified fields must match. Empty match `{}` = catch-all.
|
|
44
44
|
|
|
@@ -46,13 +46,13 @@ Multi-part content (e.g., `[{type: "text", text: "hello"}]`) is automatically ex
|
|
|
46
46
|
|
|
47
47
|
### When to Use Each Multi-turn Matching Approach
|
|
48
48
|
|
|
49
|
-
| Approach | Stateless? | Best For
|
|
50
|
-
| -------------------- | ---------- |
|
|
51
|
-
| `turnIndex` | Yes | Shared/deployed instances; matches on conversation depth (count of assistant messages in request)
|
|
52
|
-
| `hasToolResult` | Yes | Simplest option for 2-step tool flows — boolean:
|
|
53
|
-
| `sequenceIndex` | No | Single-client unit tests with repeated identical requests (server-side counter, breaks under concurrency)
|
|
54
|
-
| `toolCallId` | Yes | Matching specific tool result IDs in the conversation history
|
|
55
|
-
| `toolResultContains` | Yes | Same tool call id, different outcomes — match on the tool-result payload (approve vs cancel legs)
|
|
49
|
+
| Approach | Stateless? | Best For |
|
|
50
|
+
| -------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
51
|
+
| `turnIndex` | Yes | Shared/deployed instances; matches on conversation depth (count of assistant messages in request) |
|
|
52
|
+
| `hasToolResult` | Yes | Simplest option for 2-step tool flows — boolean: does the current turn (after the last user message) carry a tool result? |
|
|
53
|
+
| `sequenceIndex` | No | Single-client unit tests with repeated identical requests (server-side counter, breaks under concurrency) |
|
|
54
|
+
| `toolCallId` | Yes | Matching specific tool result IDs in the conversation history |
|
|
55
|
+
| `toolResultContains` | Yes | Same tool call id, different outcomes — match on the tool-result payload (approve vs cancel legs) |
|
|
56
56
|
|
|
57
57
|
**Prefer stateless approaches** (`turnIndex`, `hasToolResult`, `toolResultContains`) for shared aimock instances (deployed via Docker, used by multiple test runners). Use `sequenceIndex` only in isolated single-client unit tests where the counter won't be corrupted by concurrent requests.
|
|
58
58
|
|
|
@@ -495,7 +495,7 @@ These fields map correctly across all provider formats — for example, `finishR
|
|
|
495
495
|
|
|
496
496
|
4. **`streamingProfile` takes precedence over `latency`** — when both are set on a fixture, `streamingProfile` controls timing. Use one or the other.
|
|
497
497
|
|
|
498
|
-
5. **Tool result messages don't change the user message** — after a tool call, the client sends the same conversation + tool result. Matching on `userMessage` will hit the SAME fixture again → infinite loop. Always use `predicate` checking `role === "tool"` for tool results.
|
|
498
|
+
5. **Tool result messages don't change the user message** — after a tool call, the client sends the same conversation + tool result. Matching on `userMessage` will hit the SAME fixture again → infinite loop. Always use `predicate` checking `role === "tool"` for tool results. Note: a whole-conversation `role === "tool"` check (e.g. `req.messages.some((m) => m.role === "tool")`) diverges from `hasToolResult`'s current-turn scoping in multi-turn flows — the built-in `hasToolResult` matcher only looks after the last user message, so a later turn whose history carries an earlier tool result still reads `false`.
|
|
499
499
|
|
|
500
500
|
6. **`clearFixtures()` preserves the array reference** — uses `.length = 0`, not reassignment. The running server reads the same array object.
|
|
501
501
|
|