@copilotkit/aimock 1.29.0 → 1.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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +34 -0
- package/README.md +1 -1
- package/dist/agui-types.d.ts.map +1 -1
- package/dist/bedrock-converse.cjs +63 -31
- package/dist/bedrock-converse.cjs.map +1 -1
- package/dist/bedrock-converse.d.cts.map +1 -1
- package/dist/bedrock-converse.d.ts.map +1 -1
- package/dist/bedrock-converse.js +65 -33
- package/dist/bedrock-converse.js.map +1 -1
- package/dist/bedrock.cjs +95 -33
- package/dist/bedrock.cjs.map +1 -1
- package/dist/bedrock.d.cts.map +1 -1
- package/dist/bedrock.d.ts.map +1 -1
- package/dist/bedrock.js +97 -35
- package/dist/bedrock.js.map +1 -1
- package/dist/cli.cjs +18 -1
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +18 -1
- package/dist/cli.js.map +1 -1
- package/dist/cohere.cjs +49 -15
- package/dist/cohere.cjs.map +1 -1
- package/dist/cohere.d.cts.map +1 -1
- package/dist/cohere.d.ts.map +1 -1
- package/dist/cohere.js +51 -17
- package/dist/cohere.js.map +1 -1
- package/dist/config-loader.d.ts.map +1 -1
- package/dist/elevenlabs-audio.cjs +8 -4
- package/dist/elevenlabs-audio.cjs.map +1 -1
- package/dist/elevenlabs-audio.d.cts.map +1 -1
- package/dist/elevenlabs-audio.d.ts.map +1 -1
- package/dist/elevenlabs-audio.js +10 -6
- package/dist/elevenlabs-audio.js.map +1 -1
- package/dist/embeddings.cjs +4 -3
- package/dist/embeddings.cjs.map +1 -1
- package/dist/embeddings.d.cts.map +1 -1
- package/dist/embeddings.d.ts.map +1 -1
- package/dist/embeddings.js +6 -5
- package/dist/embeddings.js.map +1 -1
- package/dist/fal-audio.cjs +18 -8
- package/dist/fal-audio.cjs.map +1 -1
- package/dist/fal-audio.d.cts.map +1 -1
- package/dist/fal-audio.d.ts.map +1 -1
- package/dist/fal-audio.js +22 -12
- package/dist/fal-audio.js.map +1 -1
- package/dist/fal.cjs +55 -46
- package/dist/fal.cjs.map +1 -1
- package/dist/fal.d.cts +8 -0
- package/dist/fal.d.cts.map +1 -1
- package/dist/fal.d.ts +8 -0
- package/dist/fal.d.ts.map +1 -1
- package/dist/fal.js +58 -49
- package/dist/fal.js.map +1 -1
- package/dist/gemini-embeddings.cjs +4 -3
- package/dist/gemini-embeddings.cjs.map +1 -1
- package/dist/gemini-embeddings.js +6 -5
- package/dist/gemini-embeddings.js.map +1 -1
- package/dist/gemini-interactions.cjs +3 -3
- package/dist/gemini-interactions.cjs.map +1 -1
- package/dist/gemini-interactions.d.cts.map +1 -1
- package/dist/gemini-interactions.d.ts.map +1 -1
- package/dist/gemini-interactions.js +5 -5
- package/dist/gemini-interactions.js.map +1 -1
- package/dist/gemini.cjs +55 -24
- package/dist/gemini.cjs.map +1 -1
- package/dist/gemini.d.cts.map +1 -1
- package/dist/gemini.d.ts.map +1 -1
- package/dist/gemini.js +57 -26
- package/dist/gemini.js.map +1 -1
- package/dist/helpers.cjs +120 -2
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.d.cts +43 -3
- package/dist/helpers.d.cts.map +1 -1
- package/dist/helpers.d.ts +43 -3
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +117 -3
- package/dist/helpers.js.map +1 -1
- package/dist/images.cjs +12 -6
- package/dist/images.cjs.map +1 -1
- package/dist/images.d.cts.map +1 -1
- package/dist/images.d.ts.map +1 -1
- package/dist/images.js +14 -8
- package/dist/images.js.map +1 -1
- package/dist/index.cjs +13 -2
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +6 -5
- package/dist/llmock.cjs +2 -1
- package/dist/llmock.cjs.map +1 -1
- package/dist/llmock.d.cts.map +1 -1
- package/dist/llmock.d.ts.map +1 -1
- package/dist/llmock.js +2 -1
- package/dist/llmock.js.map +1 -1
- package/dist/messages.cjs +325 -85
- 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 +327 -87
- package/dist/messages.js.map +1 -1
- package/dist/metrics.cjs +9 -0
- package/dist/metrics.cjs.map +1 -1
- package/dist/metrics.d.cts.map +1 -1
- package/dist/metrics.d.ts.map +1 -1
- package/dist/metrics.js +7 -1
- package/dist/metrics.js.map +1 -1
- package/dist/model-utils.cjs +68 -0
- package/dist/model-utils.cjs.map +1 -1
- package/dist/model-utils.js +68 -1
- package/dist/model-utils.js.map +1 -1
- package/dist/ollama.cjs +58 -21
- package/dist/ollama.cjs.map +1 -1
- package/dist/ollama.d.cts.map +1 -1
- package/dist/ollama.d.ts.map +1 -1
- package/dist/ollama.js +60 -23
- package/dist/ollama.js.map +1 -1
- package/dist/openrouter-video.cjs +1609 -0
- package/dist/openrouter-video.cjs.map +1 -0
- package/dist/openrouter-video.d.cts +154 -0
- package/dist/openrouter-video.d.cts.map +1 -0
- package/dist/openrouter-video.d.ts +154 -0
- package/dist/openrouter-video.d.ts.map +1 -0
- package/dist/openrouter-video.js +1601 -0
- package/dist/openrouter-video.js.map +1 -0
- package/dist/recorder.cjs +97 -15
- package/dist/recorder.cjs.map +1 -1
- package/dist/recorder.d.cts.map +1 -1
- package/dist/recorder.d.ts.map +1 -1
- package/dist/recorder.js +96 -17
- package/dist/recorder.js.map +1 -1
- package/dist/responses.cjs +26 -12
- package/dist/responses.cjs.map +1 -1
- package/dist/responses.d.cts +1 -1
- package/dist/responses.d.cts.map +1 -1
- package/dist/responses.d.ts +1 -1
- package/dist/responses.d.ts.map +1 -1
- package/dist/responses.js +28 -14
- package/dist/responses.js.map +1 -1
- package/dist/router.cjs +37 -8
- package/dist/router.cjs.map +1 -1
- package/dist/router.d.cts +30 -1
- package/dist/router.d.cts.map +1 -1
- package/dist/router.d.ts +30 -1
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +37 -9
- package/dist/router.js.map +1 -1
- package/dist/server.cjs +173 -19
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +2 -0
- package/dist/server.d.cts.map +1 -1
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +176 -22
- package/dist/server.js.map +1 -1
- package/dist/speech.cjs +4 -2
- package/dist/speech.cjs.map +1 -1
- package/dist/speech.d.cts.map +1 -1
- package/dist/speech.d.ts.map +1 -1
- package/dist/speech.js +6 -4
- package/dist/speech.js.map +1 -1
- package/dist/stream-collapse.cjs +44 -1
- package/dist/stream-collapse.cjs.map +1 -1
- package/dist/stream-collapse.d.cts +28 -0
- package/dist/stream-collapse.d.cts.map +1 -1
- package/dist/stream-collapse.d.ts +28 -0
- package/dist/stream-collapse.d.ts.map +1 -1
- package/dist/stream-collapse.js +44 -2
- package/dist/stream-collapse.js.map +1 -1
- package/dist/transcription.cjs +4 -2
- package/dist/transcription.cjs.map +1 -1
- package/dist/transcription.d.cts.map +1 -1
- package/dist/transcription.d.ts.map +1 -1
- package/dist/transcription.js +6 -4
- package/dist/transcription.js.map +1 -1
- package/dist/types.d.cts +123 -8
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.ts +123 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/vector-types.d.cts.map +1 -1
- package/dist/vector-types.d.ts.map +1 -1
- package/dist/video.cjs +4 -2
- package/dist/video.cjs.map +1 -1
- package/dist/video.d.cts.map +1 -1
- package/dist/video.d.ts.map +1 -1
- package/dist/video.js +6 -4
- package/dist/video.js.map +1 -1
- package/dist/ws-gemini-live.cjs +4 -3
- package/dist/ws-gemini-live.cjs.map +1 -1
- package/dist/ws-gemini-live.d.cts +2 -2
- package/dist/ws-gemini-live.d.cts.map +1 -1
- package/dist/ws-gemini-live.d.ts.map +1 -1
- package/dist/ws-gemini-live.js +6 -5
- package/dist/ws-gemini-live.js.map +1 -1
- package/dist/ws-realtime.cjs +4 -3
- package/dist/ws-realtime.cjs.map +1 -1
- package/dist/ws-realtime.d.cts +2 -2
- package/dist/ws-realtime.d.cts.map +1 -1
- package/dist/ws-realtime.d.ts.map +1 -1
- package/dist/ws-realtime.js +6 -5
- package/dist/ws-realtime.js.map +1 -1
- package/dist/ws-responses.cjs +8 -6
- package/dist/ws-responses.cjs.map +1 -1
- package/dist/ws-responses.d.cts.map +1 -1
- package/dist/ws-responses.d.ts.map +1 -1
- package/dist/ws-responses.js +10 -8
- package/dist/ws-responses.js.map +1 -1
- package/package.json +2 -2
package/dist/types.d.cts
CHANGED
|
@@ -134,6 +134,26 @@ interface ResponseOverrides {
|
|
|
134
134
|
interface TextResponse extends ResponseOverrides {
|
|
135
135
|
content: string;
|
|
136
136
|
reasoning?: string;
|
|
137
|
+
/**
|
|
138
|
+
* The real cryptographic `signature` captured from a recorded Anthropic
|
|
139
|
+
* thinking turn. When present it is emitted on the replayed thinking block;
|
|
140
|
+
* otherwise replay falls back to aimock's round-trip-safe placeholder.
|
|
141
|
+
* Persisted only alongside a non-empty `reasoning`: a signature captured
|
|
142
|
+
* without plaintext reasoning (e.g. whitespace-only thinking) is intentionally
|
|
143
|
+
* discarded at the persistence layer, since replay attaches signatures only to
|
|
144
|
+
* plaintext thinking blocks.
|
|
145
|
+
*/
|
|
146
|
+
reasoningSignature?: string;
|
|
147
|
+
/**
|
|
148
|
+
* Opaque `data` payload(s) of any Anthropic `redacted_thinking` blocks
|
|
149
|
+
* captured from a recorded thinking turn, in stream order. When present they
|
|
150
|
+
* are replayed as faithful `redacted_thinking` content blocks so the encrypted
|
|
151
|
+
* reasoning round-trips; absent for non-Anthropic providers and turns without
|
|
152
|
+
* redacted thinking. Recorded redacted blocks replay as a leading group: the
|
|
153
|
+
* original interleaving of `thinking` and `redacted_thinking` blocks is not
|
|
154
|
+
* preserved (see the CHANGELOG fidelity caveat).
|
|
155
|
+
*/
|
|
156
|
+
redactedThinking?: string[];
|
|
137
157
|
webSearches?: string[];
|
|
138
158
|
}
|
|
139
159
|
interface ToolCall {
|
|
@@ -143,12 +163,21 @@ interface ToolCall {
|
|
|
143
163
|
}
|
|
144
164
|
interface ToolCallResponse extends ResponseOverrides {
|
|
145
165
|
toolCalls: ToolCall[];
|
|
166
|
+
reasoning?: string;
|
|
167
|
+
/** Real Anthropic thinking-block signature; see {@link TextResponse.reasoningSignature}. */
|
|
168
|
+
reasoningSignature?: string;
|
|
169
|
+
/** Anthropic redacted_thinking block data; see {@link TextResponse.redactedThinking}. */
|
|
170
|
+
redactedThinking?: string[];
|
|
146
171
|
webSearches?: string[];
|
|
147
172
|
}
|
|
148
173
|
interface ContentWithToolCallsResponse extends ResponseOverrides {
|
|
149
174
|
content: string;
|
|
150
175
|
toolCalls: ToolCall[];
|
|
151
176
|
reasoning?: string;
|
|
177
|
+
/** Real Anthropic thinking-block signature; see {@link TextResponse.reasoningSignature}. */
|
|
178
|
+
reasoningSignature?: string;
|
|
179
|
+
/** Anthropic redacted_thinking block data; see {@link TextResponse.redactedThinking}. */
|
|
180
|
+
redactedThinking?: string[];
|
|
152
181
|
webSearches?: string[];
|
|
153
182
|
}
|
|
154
183
|
interface ErrorResponse {
|
|
@@ -213,6 +242,12 @@ interface VideoResponse {
|
|
|
213
242
|
id: string;
|
|
214
243
|
status: "processing" | "completed" | "failed";
|
|
215
244
|
url?: string;
|
|
245
|
+
/** Failure message surfaced by async video jobs (e.g. OpenRouter `error`). */
|
|
246
|
+
error?: string;
|
|
247
|
+
/** Base64-encoded video bytes served by content-download endpoints. */
|
|
248
|
+
b64?: string;
|
|
249
|
+
/** Generation cost surfaced in usage envelopes (e.g. OpenRouter `usage.cost`). */
|
|
250
|
+
cost?: number;
|
|
216
251
|
};
|
|
217
252
|
}
|
|
218
253
|
/**
|
|
@@ -282,12 +317,21 @@ interface FixtureFileToolCall {
|
|
|
282
317
|
}
|
|
283
318
|
interface FixtureFileToolCallResponse extends ResponseOverrides {
|
|
284
319
|
toolCalls: FixtureFileToolCall[];
|
|
320
|
+
reasoning?: string;
|
|
321
|
+
/** Real Anthropic thinking-block signature; see {@link TextResponse.reasoningSignature}. */
|
|
322
|
+
reasoningSignature?: string;
|
|
323
|
+
/** Anthropic redacted_thinking block data; see {@link TextResponse.redactedThinking}. */
|
|
324
|
+
redactedThinking?: string[];
|
|
285
325
|
webSearches?: string[];
|
|
286
326
|
}
|
|
287
327
|
interface FixtureFileTextResponse extends ResponseOverrides {
|
|
288
328
|
/** Accepts a JSON object or array (structured output) — the loader will JSON.stringify it. */
|
|
289
329
|
content: string | Record<string, unknown> | unknown[];
|
|
290
330
|
reasoning?: string;
|
|
331
|
+
/** Real Anthropic thinking-block signature; see {@link TextResponse.reasoningSignature}. */
|
|
332
|
+
reasoningSignature?: string;
|
|
333
|
+
/** Anthropic redacted_thinking block data; see {@link TextResponse.redactedThinking}. */
|
|
334
|
+
redactedThinking?: string[];
|
|
291
335
|
webSearches?: string[];
|
|
292
336
|
}
|
|
293
337
|
interface FixtureFileContentWithToolCallsResponse extends ResponseOverrides {
|
|
@@ -295,6 +339,10 @@ interface FixtureFileContentWithToolCallsResponse extends ResponseOverrides {
|
|
|
295
339
|
content: string | Record<string, unknown> | unknown[];
|
|
296
340
|
toolCalls: FixtureFileToolCall[];
|
|
297
341
|
reasoning?: string;
|
|
342
|
+
/** Real Anthropic thinking-block signature; see {@link TextResponse.reasoningSignature}. */
|
|
343
|
+
reasoningSignature?: string;
|
|
344
|
+
/** Anthropic redacted_thinking block data; see {@link TextResponse.redactedThinking}. */
|
|
345
|
+
redactedThinking?: string[];
|
|
298
346
|
webSearches?: string[];
|
|
299
347
|
}
|
|
300
348
|
type FixtureFileResponse = FixtureFileTextResponse | FixtureFileToolCallResponse | FixtureFileContentWithToolCallsResponse | ErrorResponse | EmbeddingResponse | ImageResponse | AudioResponse | TranscriptionResponse | VideoResponse | RawJSONResponse;
|
|
@@ -349,8 +397,14 @@ interface JournalEntry {
|
|
|
349
397
|
/**
|
|
350
398
|
* What was going to serve this request. "fixture" = a fixture matched (or
|
|
351
399
|
* would have, before chaos intervened). "proxy" = no fixture matched and
|
|
352
|
-
* proxy was configured.
|
|
353
|
-
*
|
|
400
|
+
* proxy was configured. "internal" = entries where the request was served
|
|
401
|
+
* by aimock's own synthetic logic — neither a matched fixture nor a
|
|
402
|
+
* configured proxy: chaos-path entries (e.g. chaos on the OpenRouter
|
|
403
|
+
* video lifecycle endpoints; in REPLAY mode their normal 200/400/401/404
|
|
404
|
+
* entries omit source, while record-mode 200s on those endpoints carry
|
|
405
|
+
* source:"proxy") AND the OpenRouter video models listing synthesized as
|
|
406
|
+
* the fallback after a FAILED proxy attempt. Absent when the distinction
|
|
407
|
+
* doesn't apply (e.g. 404/503 fallback where nothing was going to serve).
|
|
354
408
|
*/
|
|
355
409
|
source?: "fixture" | "proxy" | "internal";
|
|
356
410
|
interrupted?: boolean;
|
|
@@ -420,7 +474,7 @@ interface ChatCompletionMessage {
|
|
|
420
474
|
reasoning_content?: string;
|
|
421
475
|
tool_calls?: ToolCallMessage[];
|
|
422
476
|
}
|
|
423
|
-
type RecordProviderKey = "openai" | "anthropic" | "gemini" | "gemini-interactions" | "vertexai" | "bedrock" | "azure" | "ollama" | "cohere" | "elevenlabs" | "fal";
|
|
477
|
+
type RecordProviderKey = "openai" | "anthropic" | "gemini" | "gemini-interactions" | "vertexai" | "bedrock" | "azure" | "ollama" | "cohere" | "elevenlabs" | "fal" | "openrouter";
|
|
424
478
|
interface RecordConfig {
|
|
425
479
|
providers: Partial<Record<RecordProviderKey, string>>;
|
|
426
480
|
fixturePath?: string;
|
|
@@ -439,11 +493,30 @@ interface RecordConfig {
|
|
|
439
493
|
* the poll cadence and timeout here if upstream is unusually slow or fast.
|
|
440
494
|
*/
|
|
441
495
|
fal?: FalRecordConfig;
|
|
496
|
+
/**
|
|
497
|
+
* OpenRouter-video-specific recording knobs for the live lifecycle proxy on
|
|
498
|
+
* `/api/v1/videos` (submit/poll proxied 1:1; completed jobs are captured
|
|
499
|
+
* eagerly as fixtures).
|
|
500
|
+
*/
|
|
501
|
+
openRouterVideo?: OpenRouterVideoRecordConfig;
|
|
442
502
|
/**
|
|
443
503
|
* Connection idle timeout (ms) on the upstream request socket — fires if the
|
|
444
504
|
* socket is inactive for this duration at any point before the response body
|
|
445
505
|
* begins. Default: 30_000 (30s). Increase for upstreams with slow initial
|
|
446
506
|
* responses (reasoning models, queue-backed providers).
|
|
507
|
+
*
|
|
508
|
+
* Nuance on the OpenRouter video surface: the small-JSON lifecycle fetches
|
|
509
|
+
* (submit, status poll, models listing) apply this value as a TOTAL
|
|
510
|
+
* deadline on the whole fetch — indistinguishable from an idle timeout for
|
|
511
|
+
* envelope-sized bodies. The byte-bearing content fetches (eager capture,
|
|
512
|
+
* proxy-only content relay) gate only the response HEADERS on this value;
|
|
513
|
+
* their body progress is governed by `bodyTimeoutMs` idle semantics.
|
|
514
|
+
*
|
|
515
|
+
* Ceiling note: the fetch-based OpenRouter proxy paths run on Node's
|
|
516
|
+
* built-in undici dispatcher, which carries its own ~300s
|
|
517
|
+
* headers/body-timeout defaults — values above that ceiling do not take
|
|
518
|
+
* effect on those paths without installing a custom undici dispatcher
|
|
519
|
+
* (out of aimock's scope).
|
|
447
520
|
*/
|
|
448
521
|
upstreamTimeoutMs?: number;
|
|
449
522
|
/**
|
|
@@ -451,10 +524,28 @@ interface RecordConfig {
|
|
|
451
524
|
* goes silent (no bytes) for this long after the response has started.
|
|
452
525
|
* Default: 30_000 (30s). Reasoning models under concurrent load can leave
|
|
453
526
|
* 30s+ gaps between streaming chunks while the model is thinking; lift this
|
|
454
|
-
* to e.g. 180_000 in those setups.
|
|
527
|
+
* to e.g. 180_000 in those setups. The OpenRouter video content fetches use
|
|
528
|
+
* the same idle semantics: the timer re-arms on every chunk, so a steadily
|
|
529
|
+
* downloading multi-minute video never times out — only a silent stall does.
|
|
455
530
|
*/
|
|
456
531
|
bodyTimeoutMs?: number;
|
|
457
532
|
}
|
|
533
|
+
interface OpenRouterVideoRecordConfig {
|
|
534
|
+
/**
|
|
535
|
+
* Maximum decoded video size (bytes) embedded as `b64` in a recorded
|
|
536
|
+
* fixture. Captures larger than the cap are persisted WITHOUT `b64` (with a
|
|
537
|
+
* `_warning` in the fixture file) so a multi-hundred-MB video cannot bloat
|
|
538
|
+
* the fixture directory. The cap is also a memory guard: an upstream
|
|
539
|
+
* response that DECLARES an over-cap Content-Length is skipped without
|
|
540
|
+
* downloading, and a response with no declared length is streamed with the
|
|
541
|
+
* byte count enforced during the read — on exceed the download is aborted
|
|
542
|
+
* and nothing oversized is retained in memory. In both cases the
|
|
543
|
+
* same-session job serves the placeholder MP4. Default: 33554432 (32 MB
|
|
544
|
+
* decoded). Set 0 for unlimited. Negative or non-integer values are treated
|
|
545
|
+
* as the default (createServer warns at startup).
|
|
546
|
+
*/
|
|
547
|
+
maxContentBytes?: number;
|
|
548
|
+
}
|
|
458
549
|
interface FalRecordConfig {
|
|
459
550
|
/** Interval between status polls upstream during recording. Default: 1000ms. */
|
|
460
551
|
pollIntervalMs?: number;
|
|
@@ -521,12 +612,31 @@ interface MockServerOptions {
|
|
|
521
612
|
* legacy `/fal/queue/...` audio handler is unaffected.
|
|
522
613
|
*/
|
|
523
614
|
falQueue?: FalQueueConfig;
|
|
615
|
+
/**
|
|
616
|
+
* Configure OpenRouter async video job polling progression
|
|
617
|
+
* (`pending → in_progress → completed | failed` on `GET /api/v1/videos/{id}`).
|
|
618
|
+
* Same threshold semantics as `falQueue`. By default (0/0) the job is
|
|
619
|
+
* seeded terminal at submit — content is downloadable with zero polls, and
|
|
620
|
+
* the first status poll merely reports the already-terminal status.
|
|
621
|
+
*/
|
|
622
|
+
openRouterVideo?: FalQueueConfig;
|
|
524
623
|
}
|
|
624
|
+
/**
|
|
625
|
+
* Poll-progression thresholds, documented below in fal queue terms; when used
|
|
626
|
+
* as `openRouterVideo` the states map to `pending` / `in_progress` /
|
|
627
|
+
* `completed | failed`.
|
|
628
|
+
*/
|
|
525
629
|
interface FalQueueConfig {
|
|
526
630
|
/**
|
|
527
|
-
* Status polls before transitioning `IN_QUEUE → IN_PROGRESS`.
|
|
528
|
-
*
|
|
529
|
-
* on submit (no IN_QUEUE / IN_PROGRESS polls emitted)
|
|
631
|
+
* Status polls before transitioning `IN_QUEUE → IN_PROGRESS`. Unset and an
|
|
632
|
+
* explicit `0` differ: when BOTH fields are unset the job completes
|
|
633
|
+
* synchronously on submit (no IN_QUEUE / IN_PROGRESS polls emitted), but
|
|
634
|
+
* explicitly setting this field — even to `0` — enables progression when
|
|
635
|
+
* `pollsBeforeCompleted` is unset, with `pollsBeforeCompleted` defaulting
|
|
636
|
+
* to `pollsBeforeInProgress + 1` so the job passes through IN_PROGRESS
|
|
637
|
+
* (an explicit `pollsBeforeCompleted: 0` completes on submit only when
|
|
638
|
+
* `pollsBeforeInProgress` is `0` or unset — otherwise the clamp below
|
|
639
|
+
* lifts it to `pollsBeforeInProgress`).
|
|
530
640
|
*/
|
|
531
641
|
pollsBeforeInProgress?: number;
|
|
532
642
|
/**
|
|
@@ -534,7 +644,11 @@ interface FalQueueConfig {
|
|
|
534
644
|
* `pollsBeforeInProgress` is also unset (no progression), otherwise
|
|
535
645
|
* `pollsBeforeInProgress + 1` so the job spends one poll in IN_PROGRESS.
|
|
536
646
|
* An explicit value lower than `pollsBeforeInProgress` is clamped up so
|
|
537
|
-
* IN_PROGRESS is never skipped.
|
|
647
|
+
* IN_PROGRESS is never skipped. When equal to a nonzero
|
|
648
|
+
* `pollsBeforeInProgress` — or when `pollsBeforeInProgress` is unset or 0
|
|
649
|
+
* and this field is 1 (the IN_PROGRESS branch consumes the first poll) —
|
|
650
|
+
* the job still spends one poll in IN_PROGRESS, so the terminal status
|
|
651
|
+
* lands one poll later than configured.
|
|
538
652
|
*/
|
|
539
653
|
pollsBeforeCompleted?: number;
|
|
540
654
|
}
|
|
@@ -549,6 +663,7 @@ interface HandlerDefaults {
|
|
|
549
663
|
strict?: boolean;
|
|
550
664
|
requestTransform?: (req: ChatCompletionRequest) => ChatCompletionRequest;
|
|
551
665
|
falQueue?: FalQueueConfig;
|
|
666
|
+
openRouterVideo?: FalQueueConfig;
|
|
552
667
|
}
|
|
553
668
|
//# sourceMappingURL=types.d.ts.map
|
|
554
669
|
//#endregion
|
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,EAAA,MAAA;EAGvB,IAAA,CAAA,EAAA,MAAA;EAMA,CAAA,GAAA,EAAA,MAAA,CAAA,EAAW,OAAA;;AAER,UAFH,WAAA,CAEG;MAEL,EAAA,QAAA,GAAA,MAAA,GAAA,WAAA,GAAA,MAAA;EAAe,OAAA,EAAA,MAAA,GAFV,WAEU,EAAA,GAAA,IAAA;EAIb,IAAA,CAAA,EAAA,MAAA;EAMA,UAAA,CAAA,EAVF,eAUuB,EAAA;EAAA,YAAA,CAAA,EAAA,MAAA;;AAO5B,UAbO,eAAA,CAaP;EAAc,EAAA,EAAA,MAAA;EAYP,IAAA,EAAA,UAAA;EAOA,QAAA,EAAA;IAAY,IAAA,EAAA,MAAA;IACJ,SAAA,EAAA,MAAA;;;AAmBN,UA9CF,qBAAA,CA8CE;OAEC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UAGK,gBAAA;;;;;;;;;;;;;;;;;;;;YAmCL;;;;;qBAKS;oBACD;;UAEV;;;;;;UASO,YAAA;;;;;WAKN;QACH;;;;aAIK;;;;;;;;;;;;;;;;kBAgBK;;;;;UAQD,QAAA;;;;;WAKN;;;;;;;;UAKM,SAAA;;SAER;;;;UAKQ,QAAA;;;;eAIF;;UAGE,gBAAA;;;;;;;;;UASA,cAAA;;;;;WAKN;;;;;;;;UAKM,oBAAA;;WAEN;;;;UAKM,qBAAA;;;;;eAKF;;KAKH,iBAAA;UAcK,YAAA;aACJ,QAAQ,OAAO;;;;;;;;;;;;;;;;QAgBpB;;;;;;oBAMY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAiCH,2BAAA;;;;;;;;;;;;;;;;UAiBA,eAAA;;;;;;UAOA,iBAAA;;;;;;;;UAQP;;;;;;WAMC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAkCgB,0BAA0B;;;;;;;;;;;aAWxC;;;;;;;;oBAQO;;;;;;;UAQH,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;UA6BA,eAAA;;;;UAIP;UACA;aACG;WACF;;2BAEgB,0BAA0B;aACxC;oBACO"}
|
package/dist/types.d.ts
CHANGED
|
@@ -134,6 +134,26 @@ interface ResponseOverrides {
|
|
|
134
134
|
interface TextResponse extends ResponseOverrides {
|
|
135
135
|
content: string;
|
|
136
136
|
reasoning?: string;
|
|
137
|
+
/**
|
|
138
|
+
* The real cryptographic `signature` captured from a recorded Anthropic
|
|
139
|
+
* thinking turn. When present it is emitted on the replayed thinking block;
|
|
140
|
+
* otherwise replay falls back to aimock's round-trip-safe placeholder.
|
|
141
|
+
* Persisted only alongside a non-empty `reasoning`: a signature captured
|
|
142
|
+
* without plaintext reasoning (e.g. whitespace-only thinking) is intentionally
|
|
143
|
+
* discarded at the persistence layer, since replay attaches signatures only to
|
|
144
|
+
* plaintext thinking blocks.
|
|
145
|
+
*/
|
|
146
|
+
reasoningSignature?: string;
|
|
147
|
+
/**
|
|
148
|
+
* Opaque `data` payload(s) of any Anthropic `redacted_thinking` blocks
|
|
149
|
+
* captured from a recorded thinking turn, in stream order. When present they
|
|
150
|
+
* are replayed as faithful `redacted_thinking` content blocks so the encrypted
|
|
151
|
+
* reasoning round-trips; absent for non-Anthropic providers and turns without
|
|
152
|
+
* redacted thinking. Recorded redacted blocks replay as a leading group: the
|
|
153
|
+
* original interleaving of `thinking` and `redacted_thinking` blocks is not
|
|
154
|
+
* preserved (see the CHANGELOG fidelity caveat).
|
|
155
|
+
*/
|
|
156
|
+
redactedThinking?: string[];
|
|
137
157
|
webSearches?: string[];
|
|
138
158
|
}
|
|
139
159
|
interface ToolCall {
|
|
@@ -143,12 +163,21 @@ interface ToolCall {
|
|
|
143
163
|
}
|
|
144
164
|
interface ToolCallResponse extends ResponseOverrides {
|
|
145
165
|
toolCalls: ToolCall[];
|
|
166
|
+
reasoning?: string;
|
|
167
|
+
/** Real Anthropic thinking-block signature; see {@link TextResponse.reasoningSignature}. */
|
|
168
|
+
reasoningSignature?: string;
|
|
169
|
+
/** Anthropic redacted_thinking block data; see {@link TextResponse.redactedThinking}. */
|
|
170
|
+
redactedThinking?: string[];
|
|
146
171
|
webSearches?: string[];
|
|
147
172
|
}
|
|
148
173
|
interface ContentWithToolCallsResponse extends ResponseOverrides {
|
|
149
174
|
content: string;
|
|
150
175
|
toolCalls: ToolCall[];
|
|
151
176
|
reasoning?: string;
|
|
177
|
+
/** Real Anthropic thinking-block signature; see {@link TextResponse.reasoningSignature}. */
|
|
178
|
+
reasoningSignature?: string;
|
|
179
|
+
/** Anthropic redacted_thinking block data; see {@link TextResponse.redactedThinking}. */
|
|
180
|
+
redactedThinking?: string[];
|
|
152
181
|
webSearches?: string[];
|
|
153
182
|
}
|
|
154
183
|
interface ErrorResponse {
|
|
@@ -213,6 +242,12 @@ interface VideoResponse {
|
|
|
213
242
|
id: string;
|
|
214
243
|
status: "processing" | "completed" | "failed";
|
|
215
244
|
url?: string;
|
|
245
|
+
/** Failure message surfaced by async video jobs (e.g. OpenRouter `error`). */
|
|
246
|
+
error?: string;
|
|
247
|
+
/** Base64-encoded video bytes served by content-download endpoints. */
|
|
248
|
+
b64?: string;
|
|
249
|
+
/** Generation cost surfaced in usage envelopes (e.g. OpenRouter `usage.cost`). */
|
|
250
|
+
cost?: number;
|
|
216
251
|
};
|
|
217
252
|
}
|
|
218
253
|
/**
|
|
@@ -282,12 +317,21 @@ interface FixtureFileToolCall {
|
|
|
282
317
|
}
|
|
283
318
|
interface FixtureFileToolCallResponse extends ResponseOverrides {
|
|
284
319
|
toolCalls: FixtureFileToolCall[];
|
|
320
|
+
reasoning?: string;
|
|
321
|
+
/** Real Anthropic thinking-block signature; see {@link TextResponse.reasoningSignature}. */
|
|
322
|
+
reasoningSignature?: string;
|
|
323
|
+
/** Anthropic redacted_thinking block data; see {@link TextResponse.redactedThinking}. */
|
|
324
|
+
redactedThinking?: string[];
|
|
285
325
|
webSearches?: string[];
|
|
286
326
|
}
|
|
287
327
|
interface FixtureFileTextResponse extends ResponseOverrides {
|
|
288
328
|
/** Accepts a JSON object or array (structured output) — the loader will JSON.stringify it. */
|
|
289
329
|
content: string | Record<string, unknown> | unknown[];
|
|
290
330
|
reasoning?: string;
|
|
331
|
+
/** Real Anthropic thinking-block signature; see {@link TextResponse.reasoningSignature}. */
|
|
332
|
+
reasoningSignature?: string;
|
|
333
|
+
/** Anthropic redacted_thinking block data; see {@link TextResponse.redactedThinking}. */
|
|
334
|
+
redactedThinking?: string[];
|
|
291
335
|
webSearches?: string[];
|
|
292
336
|
}
|
|
293
337
|
interface FixtureFileContentWithToolCallsResponse extends ResponseOverrides {
|
|
@@ -295,6 +339,10 @@ interface FixtureFileContentWithToolCallsResponse extends ResponseOverrides {
|
|
|
295
339
|
content: string | Record<string, unknown> | unknown[];
|
|
296
340
|
toolCalls: FixtureFileToolCall[];
|
|
297
341
|
reasoning?: string;
|
|
342
|
+
/** Real Anthropic thinking-block signature; see {@link TextResponse.reasoningSignature}. */
|
|
343
|
+
reasoningSignature?: string;
|
|
344
|
+
/** Anthropic redacted_thinking block data; see {@link TextResponse.redactedThinking}. */
|
|
345
|
+
redactedThinking?: string[];
|
|
298
346
|
webSearches?: string[];
|
|
299
347
|
}
|
|
300
348
|
type FixtureFileResponse = FixtureFileTextResponse | FixtureFileToolCallResponse | FixtureFileContentWithToolCallsResponse | ErrorResponse | EmbeddingResponse | ImageResponse | AudioResponse | TranscriptionResponse | VideoResponse | RawJSONResponse;
|
|
@@ -349,8 +397,14 @@ interface JournalEntry {
|
|
|
349
397
|
/**
|
|
350
398
|
* What was going to serve this request. "fixture" = a fixture matched (or
|
|
351
399
|
* would have, before chaos intervened). "proxy" = no fixture matched and
|
|
352
|
-
* proxy was configured.
|
|
353
|
-
*
|
|
400
|
+
* proxy was configured. "internal" = entries where the request was served
|
|
401
|
+
* by aimock's own synthetic logic — neither a matched fixture nor a
|
|
402
|
+
* configured proxy: chaos-path entries (e.g. chaos on the OpenRouter
|
|
403
|
+
* video lifecycle endpoints; in REPLAY mode their normal 200/400/401/404
|
|
404
|
+
* entries omit source, while record-mode 200s on those endpoints carry
|
|
405
|
+
* source:"proxy") AND the OpenRouter video models listing synthesized as
|
|
406
|
+
* the fallback after a FAILED proxy attempt. Absent when the distinction
|
|
407
|
+
* doesn't apply (e.g. 404/503 fallback where nothing was going to serve).
|
|
354
408
|
*/
|
|
355
409
|
source?: "fixture" | "proxy" | "internal";
|
|
356
410
|
interrupted?: boolean;
|
|
@@ -420,7 +474,7 @@ interface ChatCompletionMessage {
|
|
|
420
474
|
reasoning_content?: string;
|
|
421
475
|
tool_calls?: ToolCallMessage[];
|
|
422
476
|
}
|
|
423
|
-
type RecordProviderKey = "openai" | "anthropic" | "gemini" | "gemini-interactions" | "vertexai" | "bedrock" | "azure" | "ollama" | "cohere" | "elevenlabs" | "fal";
|
|
477
|
+
type RecordProviderKey = "openai" | "anthropic" | "gemini" | "gemini-interactions" | "vertexai" | "bedrock" | "azure" | "ollama" | "cohere" | "elevenlabs" | "fal" | "openrouter";
|
|
424
478
|
interface RecordConfig {
|
|
425
479
|
providers: Partial<Record<RecordProviderKey, string>>;
|
|
426
480
|
fixturePath?: string;
|
|
@@ -439,11 +493,30 @@ interface RecordConfig {
|
|
|
439
493
|
* the poll cadence and timeout here if upstream is unusually slow or fast.
|
|
440
494
|
*/
|
|
441
495
|
fal?: FalRecordConfig;
|
|
496
|
+
/**
|
|
497
|
+
* OpenRouter-video-specific recording knobs for the live lifecycle proxy on
|
|
498
|
+
* `/api/v1/videos` (submit/poll proxied 1:1; completed jobs are captured
|
|
499
|
+
* eagerly as fixtures).
|
|
500
|
+
*/
|
|
501
|
+
openRouterVideo?: OpenRouterVideoRecordConfig;
|
|
442
502
|
/**
|
|
443
503
|
* Connection idle timeout (ms) on the upstream request socket — fires if the
|
|
444
504
|
* socket is inactive for this duration at any point before the response body
|
|
445
505
|
* begins. Default: 30_000 (30s). Increase for upstreams with slow initial
|
|
446
506
|
* responses (reasoning models, queue-backed providers).
|
|
507
|
+
*
|
|
508
|
+
* Nuance on the OpenRouter video surface: the small-JSON lifecycle fetches
|
|
509
|
+
* (submit, status poll, models listing) apply this value as a TOTAL
|
|
510
|
+
* deadline on the whole fetch — indistinguishable from an idle timeout for
|
|
511
|
+
* envelope-sized bodies. The byte-bearing content fetches (eager capture,
|
|
512
|
+
* proxy-only content relay) gate only the response HEADERS on this value;
|
|
513
|
+
* their body progress is governed by `bodyTimeoutMs` idle semantics.
|
|
514
|
+
*
|
|
515
|
+
* Ceiling note: the fetch-based OpenRouter proxy paths run on Node's
|
|
516
|
+
* built-in undici dispatcher, which carries its own ~300s
|
|
517
|
+
* headers/body-timeout defaults — values above that ceiling do not take
|
|
518
|
+
* effect on those paths without installing a custom undici dispatcher
|
|
519
|
+
* (out of aimock's scope).
|
|
447
520
|
*/
|
|
448
521
|
upstreamTimeoutMs?: number;
|
|
449
522
|
/**
|
|
@@ -451,10 +524,28 @@ interface RecordConfig {
|
|
|
451
524
|
* goes silent (no bytes) for this long after the response has started.
|
|
452
525
|
* Default: 30_000 (30s). Reasoning models under concurrent load can leave
|
|
453
526
|
* 30s+ gaps between streaming chunks while the model is thinking; lift this
|
|
454
|
-
* to e.g. 180_000 in those setups.
|
|
527
|
+
* to e.g. 180_000 in those setups. The OpenRouter video content fetches use
|
|
528
|
+
* the same idle semantics: the timer re-arms on every chunk, so a steadily
|
|
529
|
+
* downloading multi-minute video never times out — only a silent stall does.
|
|
455
530
|
*/
|
|
456
531
|
bodyTimeoutMs?: number;
|
|
457
532
|
}
|
|
533
|
+
interface OpenRouterVideoRecordConfig {
|
|
534
|
+
/**
|
|
535
|
+
* Maximum decoded video size (bytes) embedded as `b64` in a recorded
|
|
536
|
+
* fixture. Captures larger than the cap are persisted WITHOUT `b64` (with a
|
|
537
|
+
* `_warning` in the fixture file) so a multi-hundred-MB video cannot bloat
|
|
538
|
+
* the fixture directory. The cap is also a memory guard: an upstream
|
|
539
|
+
* response that DECLARES an over-cap Content-Length is skipped without
|
|
540
|
+
* downloading, and a response with no declared length is streamed with the
|
|
541
|
+
* byte count enforced during the read — on exceed the download is aborted
|
|
542
|
+
* and nothing oversized is retained in memory. In both cases the
|
|
543
|
+
* same-session job serves the placeholder MP4. Default: 33554432 (32 MB
|
|
544
|
+
* decoded). Set 0 for unlimited. Negative or non-integer values are treated
|
|
545
|
+
* as the default (createServer warns at startup).
|
|
546
|
+
*/
|
|
547
|
+
maxContentBytes?: number;
|
|
548
|
+
}
|
|
458
549
|
interface FalRecordConfig {
|
|
459
550
|
/** Interval between status polls upstream during recording. Default: 1000ms. */
|
|
460
551
|
pollIntervalMs?: number;
|
|
@@ -521,12 +612,31 @@ interface MockServerOptions {
|
|
|
521
612
|
* legacy `/fal/queue/...` audio handler is unaffected.
|
|
522
613
|
*/
|
|
523
614
|
falQueue?: FalQueueConfig;
|
|
615
|
+
/**
|
|
616
|
+
* Configure OpenRouter async video job polling progression
|
|
617
|
+
* (`pending → in_progress → completed | failed` on `GET /api/v1/videos/{id}`).
|
|
618
|
+
* Same threshold semantics as `falQueue`. By default (0/0) the job is
|
|
619
|
+
* seeded terminal at submit — content is downloadable with zero polls, and
|
|
620
|
+
* the first status poll merely reports the already-terminal status.
|
|
621
|
+
*/
|
|
622
|
+
openRouterVideo?: FalQueueConfig;
|
|
524
623
|
}
|
|
624
|
+
/**
|
|
625
|
+
* Poll-progression thresholds, documented below in fal queue terms; when used
|
|
626
|
+
* as `openRouterVideo` the states map to `pending` / `in_progress` /
|
|
627
|
+
* `completed | failed`.
|
|
628
|
+
*/
|
|
525
629
|
interface FalQueueConfig {
|
|
526
630
|
/**
|
|
527
|
-
* Status polls before transitioning `IN_QUEUE → IN_PROGRESS`.
|
|
528
|
-
*
|
|
529
|
-
* on submit (no IN_QUEUE / IN_PROGRESS polls emitted)
|
|
631
|
+
* Status polls before transitioning `IN_QUEUE → IN_PROGRESS`. Unset and an
|
|
632
|
+
* explicit `0` differ: when BOTH fields are unset the job completes
|
|
633
|
+
* synchronously on submit (no IN_QUEUE / IN_PROGRESS polls emitted), but
|
|
634
|
+
* explicitly setting this field — even to `0` — enables progression when
|
|
635
|
+
* `pollsBeforeCompleted` is unset, with `pollsBeforeCompleted` defaulting
|
|
636
|
+
* to `pollsBeforeInProgress + 1` so the job passes through IN_PROGRESS
|
|
637
|
+
* (an explicit `pollsBeforeCompleted: 0` completes on submit only when
|
|
638
|
+
* `pollsBeforeInProgress` is `0` or unset — otherwise the clamp below
|
|
639
|
+
* lifts it to `pollsBeforeInProgress`).
|
|
530
640
|
*/
|
|
531
641
|
pollsBeforeInProgress?: number;
|
|
532
642
|
/**
|
|
@@ -534,7 +644,11 @@ interface FalQueueConfig {
|
|
|
534
644
|
* `pollsBeforeInProgress` is also unset (no progression), otherwise
|
|
535
645
|
* `pollsBeforeInProgress + 1` so the job spends one poll in IN_PROGRESS.
|
|
536
646
|
* An explicit value lower than `pollsBeforeInProgress` is clamped up so
|
|
537
|
-
* IN_PROGRESS is never skipped.
|
|
647
|
+
* IN_PROGRESS is never skipped. When equal to a nonzero
|
|
648
|
+
* `pollsBeforeInProgress` — or when `pollsBeforeInProgress` is unset or 0
|
|
649
|
+
* and this field is 1 (the IN_PROGRESS branch consumes the first poll) —
|
|
650
|
+
* the job still spends one poll in IN_PROGRESS, so the terminal status
|
|
651
|
+
* lands one poll later than configured.
|
|
538
652
|
*/
|
|
539
653
|
pollsBeforeCompleted?: number;
|
|
540
654
|
}
|
|
@@ -549,6 +663,7 @@ interface HandlerDefaults {
|
|
|
549
663
|
strict?: boolean;
|
|
550
664
|
requestTransform?: (req: ChatCompletionRequest) => ChatCompletionRequest;
|
|
551
665
|
falQueue?: FalQueueConfig;
|
|
666
|
+
openRouterVideo?: FalQueueConfig;
|
|
552
667
|
}
|
|
553
668
|
//# sourceMappingURL=types.d.ts.map
|
|
554
669
|
//#endregion
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","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,EAAA,MAAA;EAGvB,IAAA,CAAA,EAAA,MAAA;EAMA,CAAA,GAAA,EAAA,MAAA,CA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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,WAMV,CAAM;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector-types.d.ts","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.ts","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/dist/video.cjs
CHANGED
|
@@ -135,7 +135,7 @@ async function handleVideoCreate(req, res, raw, fixtures, journal, defaults, set
|
|
|
135
135
|
_context: require_helpers.getContext(req)
|
|
136
136
|
};
|
|
137
137
|
const testId = require_helpers.getTestId(req);
|
|
138
|
-
const fixture = require_router.
|
|
138
|
+
const { fixture, skippedBySequenceOrTurn } = require_router.matchFixtureDiagnostic(fixtures, syntheticReq, journal.getFixtureMatchCountsForTest(testId), defaults.requestTransform);
|
|
139
139
|
if (fixture) {
|
|
140
140
|
journal.incrementFixtureMatchCount(fixture, fixtures, testId);
|
|
141
141
|
defaults.logger.debug(`Fixture matched: ${JSON.stringify(fixture.match).slice(0, 120)}`);
|
|
@@ -148,6 +148,8 @@ async function handleVideoCreate(req, res, raw, fixtures, journal, defaults, set
|
|
|
148
148
|
}, fixture ? "fixture" : "proxy", defaults.registry, defaults.logger)) return;
|
|
149
149
|
if (!fixture) {
|
|
150
150
|
if (require_helpers.resolveStrictMode(defaults.strict, req.headers)) {
|
|
151
|
+
const strictMessage = require_helpers.strictNoMatchMessage(skippedBySequenceOrTurn);
|
|
152
|
+
defaults.logger.error(require_helpers.strictNoMatchLogLine(method, path, skippedBySequenceOrTurn));
|
|
151
153
|
journal.add({
|
|
152
154
|
method,
|
|
153
155
|
path,
|
|
@@ -160,7 +162,7 @@ async function handleVideoCreate(req, res, raw, fixtures, journal, defaults, set
|
|
|
160
162
|
}
|
|
161
163
|
});
|
|
162
164
|
require_sse_writer.writeErrorResponse(res, 503, JSON.stringify({ error: {
|
|
163
|
-
message:
|
|
165
|
+
message: strictMessage,
|
|
164
166
|
type: "invalid_request_error",
|
|
165
167
|
code: "no_fixture_match"
|
|
166
168
|
} }));
|