@copilotkit/aimock 1.34.0 → 1.35.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 +16 -0
- package/README.md +2 -1
- package/dist/agui-types.d.cts.map +1 -1
- package/dist/agui-types.d.ts.map +1 -1
- package/dist/bedrock-converse.cjs +110 -8
- 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 +111 -9
- package/dist/bedrock-converse.js.map +1 -1
- package/dist/bedrock.cjs +141 -4
- 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 +142 -5
- package/dist/bedrock.js.map +1 -1
- package/dist/cohere.cjs +89 -7
- 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 +90 -8
- package/dist/cohere.js.map +1 -1
- package/dist/config-loader.d.cts.map +1 -1
- package/dist/fixture-loader.cjs +121 -20
- package/dist/fixture-loader.cjs.map +1 -1
- package/dist/fixture-loader.d.cts.map +1 -1
- package/dist/fixture-loader.d.ts.map +1 -1
- package/dist/fixture-loader.js +121 -20
- package/dist/fixture-loader.js.map +1 -1
- package/dist/gemini-interactions.cjs +97 -60
- 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 +98 -61
- package/dist/gemini-interactions.js.map +1 -1
- package/dist/gemini.cjs +71 -6
- 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 +72 -7
- package/dist/gemini.js.map +1 -1
- package/dist/grok-video.cjs +834 -0
- package/dist/grok-video.cjs.map +1 -0
- package/dist/grok-video.d.cts +74 -0
- package/dist/grok-video.d.cts.map +1 -0
- package/dist/grok-video.d.ts +74 -0
- package/dist/grok-video.d.ts.map +1 -0
- package/dist/grok-video.js +829 -0
- package/dist/grok-video.js.map +1 -0
- package/dist/helpers.cjs +181 -2
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.d.cts +33 -3
- package/dist/helpers.d.cts.map +1 -1
- package/dist/helpers.d.ts +33 -3
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +181 -3
- package/dist/helpers.js.map +1 -1
- package/dist/index.cjs +11 -0
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +4 -2
- package/dist/messages.cjs +99 -10
- 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 +100 -11
- package/dist/messages.js.map +1 -1
- package/dist/metrics.cjs +11 -1
- 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 +8 -1
- package/dist/metrics.js.map +1 -1
- package/dist/ollama.cjs +74 -4
- 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 +75 -5
- package/dist/ollama.js.map +1 -1
- package/dist/openrouter-video.cjs +19 -138
- package/dist/openrouter-video.cjs.map +1 -1
- package/dist/openrouter-video.d.cts.map +1 -1
- package/dist/openrouter-video.d.ts.map +1 -1
- package/dist/openrouter-video.js +1 -120
- package/dist/openrouter-video.js.map +1 -1
- package/dist/recorder.cjs +12 -9
- package/dist/recorder.cjs.map +1 -1
- package/dist/recorder.js +12 -9
- package/dist/recorder.js.map +1 -1
- package/dist/responses.cjs +136 -58
- package/dist/responses.cjs.map +1 -1
- package/dist/responses.d.cts +2 -2
- package/dist/responses.d.cts.map +1 -1
- package/dist/responses.d.ts +2 -2
- package/dist/responses.d.ts.map +1 -1
- package/dist/responses.js +137 -59
- package/dist/responses.js.map +1 -1
- package/dist/server.cjs +162 -20
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +4 -0
- package/dist/server.d.cts.map +1 -1
- package/dist/server.d.ts +4 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +164 -22
- package/dist/server.js.map +1 -1
- package/dist/stream-collapse.cjs +300 -74
- package/dist/stream-collapse.cjs.map +1 -1
- package/dist/stream-collapse.d.cts +17 -1
- package/dist/stream-collapse.d.cts.map +1 -1
- package/dist/stream-collapse.d.ts +17 -1
- package/dist/stream-collapse.d.ts.map +1 -1
- package/dist/stream-collapse.js +300 -74
- package/dist/stream-collapse.js.map +1 -1
- package/dist/types.d.cts +104 -7
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.ts +104 -7
- package/dist/types.d.ts.map +1 -1
- package/dist/veo-video.cjs +794 -0
- package/dist/veo-video.cjs.map +1 -0
- package/dist/veo-video.d.cts +50 -0
- package/dist/veo-video.d.cts.map +1 -0
- package/dist/veo-video.d.ts +50 -0
- package/dist/veo-video.d.ts.map +1 -0
- package/dist/veo-video.js +789 -0
- package/dist/veo-video.js.map +1 -0
- package/dist/video-proxy-shared.cjs +145 -0
- package/dist/video-proxy-shared.cjs.map +1 -0
- package/dist/video-proxy-shared.js +140 -0
- package/dist/video-proxy-shared.js.map +1 -0
- package/dist/ws-gemini-live.cjs +96 -3
- package/dist/ws-gemini-live.cjs.map +1 -1
- 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 +97 -4
- package/dist/ws-gemini-live.js.map +1 -1
- package/dist/ws-realtime.cjs +281 -4
- package/dist/ws-realtime.cjs.map +1 -1
- package/dist/ws-realtime.d.cts.map +1 -1
- package/dist/ws-realtime.d.ts.map +1 -1
- package/dist/ws-realtime.js +282 -5
- package/dist/ws-realtime.js.map +1 -1
- package/dist/ws-responses.cjs +1 -1
- package/dist/ws-responses.cjs.map +1 -1
- package/dist/ws-responses.js +1 -1
- package/dist/ws-responses.js.map +1 -1
- package/fixtures/examples/llm/blocks-tool-first.json +13 -0
- package/package.json +1 -1
- package/skills/write-fixtures/SKILL.md +19 -1
package/dist/server.cjs
CHANGED
|
@@ -23,6 +23,8 @@ const require_video = require('./video.cjs');
|
|
|
23
23
|
const require_fal_audio = require('./fal-audio.cjs');
|
|
24
24
|
const require_fal = require('./fal.cjs');
|
|
25
25
|
const require_openrouter_video = require('./openrouter-video.cjs');
|
|
26
|
+
const require_veo_video = require('./veo-video.cjs');
|
|
27
|
+
const require_grok_video = require('./grok-video.cjs');
|
|
26
28
|
const require_elevenlabs_audio = require('./elevenlabs-audio.cjs');
|
|
27
29
|
const require_ollama = require('./ollama.cjs');
|
|
28
30
|
const require_cohere = require('./cohere.cjs');
|
|
@@ -146,11 +148,13 @@ const CONTROL_PREFIX = "/__aimock";
|
|
|
146
148
|
* `aimock_fixtures_loaded` gauge. Shared by `/reset/fixtures` and the
|
|
147
149
|
* deprecated `/reset` alias.
|
|
148
150
|
*/
|
|
149
|
-
function performFixturesReset(fixtures, journal, videoStates, openRouterVideoJobs, defaults) {
|
|
151
|
+
function performFixturesReset(fixtures, journal, videoStates, openRouterVideoJobs, veoVideoJobs, grokVideoJobs, defaults) {
|
|
150
152
|
fixtures.length = 0;
|
|
151
153
|
journal.clear();
|
|
152
154
|
videoStates.clear();
|
|
153
155
|
openRouterVideoJobs.clear();
|
|
156
|
+
veoVideoJobs.clear();
|
|
157
|
+
grokVideoJobs.clear();
|
|
154
158
|
require_fal_audio.falJobs.clear();
|
|
155
159
|
require_fal.falQueueStates.clear();
|
|
156
160
|
require_gemini_interactions.resetInteractionCounter();
|
|
@@ -161,7 +165,7 @@ function performFixturesReset(fixtures, journal, videoStates, openRouterVideoJob
|
|
|
161
165
|
* Handle requests under `/__aimock/`. Returns `true` if the request was
|
|
162
166
|
* handled, `false` if the path doesn't match the control prefix.
|
|
163
167
|
*/
|
|
164
|
-
async function handleControlAPI(req, res, pathname, fixtures, journal, videoStates, openRouterVideoJobs, defaults) {
|
|
168
|
+
async function handleControlAPI(req, res, pathname, fixtures, journal, videoStates, openRouterVideoJobs, veoVideoJobs, grokVideoJobs, defaults) {
|
|
165
169
|
if (!pathname.startsWith(CONTROL_PREFIX)) return false;
|
|
166
170
|
const subPath = pathname.slice(9);
|
|
167
171
|
setCorsHeaders(res);
|
|
@@ -225,7 +229,7 @@ async function handleControlAPI(req, res, pathname, fixtures, journal, videoStat
|
|
|
225
229
|
return true;
|
|
226
230
|
}
|
|
227
231
|
if (subPath === "/reset/fixtures" && req.method === "POST") {
|
|
228
|
-
performFixturesReset(fixtures, journal, videoStates, openRouterVideoJobs, defaults);
|
|
232
|
+
performFixturesReset(fixtures, journal, videoStates, openRouterVideoJobs, veoVideoJobs, grokVideoJobs, defaults);
|
|
229
233
|
res.writeHead(200, { "Content-Type": "application/json" });
|
|
230
234
|
res.end(JSON.stringify({ reset: true }));
|
|
231
235
|
return true;
|
|
@@ -237,7 +241,7 @@ async function handleControlAPI(req, res, pathname, fixtures, journal, videoStat
|
|
|
237
241
|
return true;
|
|
238
242
|
}
|
|
239
243
|
if (subPath === "/reset" && req.method === "POST") {
|
|
240
|
-
performFixturesReset(fixtures, journal, videoStates, openRouterVideoJobs, defaults);
|
|
244
|
+
performFixturesReset(fixtures, journal, videoStates, openRouterVideoJobs, veoVideoJobs, grokVideoJobs, defaults);
|
|
241
245
|
const deprecation = "POST /__aimock/reset is deprecated; use POST /__aimock/reset/fixtures (full reset) or POST /__aimock/reset/journal (journal only)";
|
|
242
246
|
defaults.logger.warn("POST /__aimock/reset is deprecated; use /__aimock/reset/fixtures or /__aimock/reset/journal");
|
|
243
247
|
res.writeHead(200, {
|
|
@@ -530,12 +534,12 @@ async function handleCompletions(req, res, fixtures, journal, defaults, modelFal
|
|
|
530
534
|
}
|
|
531
535
|
});
|
|
532
536
|
if (body.stream !== true) {
|
|
533
|
-
const completion = require_helpers.buildContentWithToolCallsCompletion(response.content, response.toolCalls, body.model, effReasoning, overrides, body.messages);
|
|
537
|
+
const completion = require_helpers.buildContentWithToolCallsCompletion(response.content ?? "", response.toolCalls ?? [], body.model, effReasoning, overrides, body.messages);
|
|
534
538
|
res.writeHead(200, { "Content-Type": "application/json" });
|
|
535
539
|
res.end(JSON.stringify(completion));
|
|
536
540
|
} else {
|
|
537
|
-
const chunks = require_helpers.buildContentWithToolCallsChunks(response.content, response.toolCalls, body.model, chunkSize, effReasoning, overrides);
|
|
538
|
-
const completionText = response.content + response.toolCalls.map((tc) => tc.name + tc.arguments).join("");
|
|
541
|
+
const chunks = require_helpers.buildContentWithToolCallsChunks(response.content ?? "", response.toolCalls ?? [], body.model, chunkSize, effReasoning, overrides, response.blocks);
|
|
542
|
+
const completionText = (response.content ?? "") + (response.toolCalls ?? []).map((tc) => tc.name + tc.arguments).join("");
|
|
539
543
|
const usageChunk = includeUsage ? require_helpers.buildUsageChunk(chunks[0]?.id ?? "chatcmpl-unknown", overrides?.model ?? body.model, chunks[0]?.created ?? Math.floor(Date.now() / 1e3), overrides?.usage ? {
|
|
540
544
|
prompt_tokens: overrides.usage.prompt_tokens ?? 0,
|
|
541
545
|
completion_tokens: overrides.usage.completion_tokens ?? 0,
|
|
@@ -704,6 +708,12 @@ async function createServer(fixtures, options, mounts, serviceFixtures) {
|
|
|
704
708
|
},
|
|
705
709
|
get openRouterVideo() {
|
|
706
710
|
return serverOptions.openRouterVideo;
|
|
711
|
+
},
|
|
712
|
+
get veoVideo() {
|
|
713
|
+
return serverOptions.veoVideo;
|
|
714
|
+
},
|
|
715
|
+
get grokVideo() {
|
|
716
|
+
return serverOptions.grokVideo;
|
|
707
717
|
}
|
|
708
718
|
};
|
|
709
719
|
if (options?.chaos) {
|
|
@@ -723,13 +733,24 @@ async function createServer(fixtures, options, mounts, serviceFixtures) {
|
|
|
723
733
|
];
|
|
724
734
|
for (const { name, value } of chaosRates) if (value !== void 0 && (value < 0 || value > 1)) logger.warn(`Chaos ${name} (${value}) is outside 0-1 range — will be clamped at runtime`);
|
|
725
735
|
}
|
|
726
|
-
for (const { name, config } of [
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
736
|
+
for (const { name, config } of [
|
|
737
|
+
{
|
|
738
|
+
name: "falQueue",
|
|
739
|
+
config: options?.falQueue
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
name: "openRouterVideo",
|
|
743
|
+
config: options?.openRouterVideo
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
name: "veoVideo",
|
|
747
|
+
config: options?.veoVideo
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
name: "grokVideo",
|
|
751
|
+
config: options?.grokVideo
|
|
752
|
+
}
|
|
753
|
+
]) {
|
|
733
754
|
if (!config) continue;
|
|
734
755
|
for (const field of ["pollsBeforeInProgress", "pollsBeforeCompleted"]) {
|
|
735
756
|
const value = config[field];
|
|
@@ -748,6 +769,8 @@ async function createServer(fixtures, options, mounts, serviceFixtures) {
|
|
|
748
769
|
});
|
|
749
770
|
const videoStates = new require_video.VideoStateMap();
|
|
750
771
|
const openRouterVideoJobs = new require_openrouter_video.OpenRouterVideoJobMap();
|
|
772
|
+
const veoVideoJobs = new require_veo_video.VeoVideoJobMap();
|
|
773
|
+
const grokVideoJobs = new require_grok_video.GrokVideoJobMap();
|
|
751
774
|
if (mounts) for (const { handler } of mounts) {
|
|
752
775
|
if (handler.setJournal) handler.setJournal(journal);
|
|
753
776
|
if (registry && handler.setRegistry) handler.setRegistry(registry);
|
|
@@ -794,7 +817,7 @@ async function createServer(fixtures, options, mounts, serviceFixtures) {
|
|
|
794
817
|
}
|
|
795
818
|
});
|
|
796
819
|
if (pathname.startsWith(CONTROL_PREFIX)) {
|
|
797
|
-
await handleControlAPI(req, res, pathname, fixtures, journal, videoStates, openRouterVideoJobs, defaults);
|
|
820
|
+
await handleControlAPI(req, res, pathname, fixtures, journal, videoStates, openRouterVideoJobs, veoVideoJobs, grokVideoJobs, defaults);
|
|
798
821
|
return;
|
|
799
822
|
}
|
|
800
823
|
if (mounts) {
|
|
@@ -1239,6 +1262,36 @@ async function createServer(fixtures, options, mounts, serviceFixtures) {
|
|
|
1239
1262
|
}
|
|
1240
1263
|
return;
|
|
1241
1264
|
}
|
|
1265
|
+
if (pathname === require_metrics.GROK_VIDEO_SUBMIT_PATH && req.method === "POST") {
|
|
1266
|
+
setCorsHeaders(res);
|
|
1267
|
+
try {
|
|
1268
|
+
await require_grok_video.handleGrokVideoCreate(req, res, await require_helpers.readBody(req), fixtures, journal, defaults, setCorsHeaders, grokVideoJobs);
|
|
1269
|
+
} catch (err) {
|
|
1270
|
+
const msg = err instanceof Error ? err.message : "Internal error";
|
|
1271
|
+
defaults.logger.error(`grok-video submit: ${msg}`);
|
|
1272
|
+
if (!res.headersSent) {
|
|
1273
|
+
try {
|
|
1274
|
+
journal.add({
|
|
1275
|
+
method: req.method ?? "POST",
|
|
1276
|
+
path: req.url ?? pathname,
|
|
1277
|
+
headers: require_helpers.flattenHeaders(req.headers),
|
|
1278
|
+
body: null,
|
|
1279
|
+
response: {
|
|
1280
|
+
status: 500,
|
|
1281
|
+
fixture: null
|
|
1282
|
+
}
|
|
1283
|
+
});
|
|
1284
|
+
} catch (jErr) {
|
|
1285
|
+
defaults.logger.warn(`grok-video submit: journal write failed after handler error: ${jErr instanceof Error ? jErr.message : String(jErr)}`);
|
|
1286
|
+
}
|
|
1287
|
+
require_sse_writer.writeErrorResponse(res, 500, JSON.stringify({ error: {
|
|
1288
|
+
message: msg,
|
|
1289
|
+
type: "server_error"
|
|
1290
|
+
} }));
|
|
1291
|
+
} else if (!res.writableEnded) res.destroy();
|
|
1292
|
+
}
|
|
1293
|
+
return;
|
|
1294
|
+
}
|
|
1242
1295
|
if (pathname === VIDEOS_PATH && req.method === "POST") {
|
|
1243
1296
|
try {
|
|
1244
1297
|
await require_video.handleVideoCreate(req, res, await require_helpers.readBody(req), fixtures, journal, defaults, setCorsHeaders, videoStates);
|
|
@@ -1252,10 +1305,95 @@ async function createServer(fixtures, options, mounts, serviceFixtures) {
|
|
|
1252
1305
|
}
|
|
1253
1306
|
return;
|
|
1254
1307
|
}
|
|
1255
|
-
const
|
|
1256
|
-
if (
|
|
1257
|
-
|
|
1258
|
-
|
|
1308
|
+
const grokVideoStatusMatch = pathname.match(require_metrics.GROK_VIDEO_STATUS_RE);
|
|
1309
|
+
if (grokVideoStatusMatch && grokVideoStatusMatch[1] !== "generations" && req.method === "GET") {
|
|
1310
|
+
try {
|
|
1311
|
+
await require_grok_video.handleGrokVideoStatus(req, res, grokVideoStatusMatch[1], fixtures, journal, defaults, setCorsHeaders, grokVideoJobs, videoStates);
|
|
1312
|
+
} catch (err) {
|
|
1313
|
+
const msg = err instanceof Error ? err.message : "Internal error";
|
|
1314
|
+
defaults.logger.error(`grok-video status: ${msg}`);
|
|
1315
|
+
if (!res.headersSent) {
|
|
1316
|
+
try {
|
|
1317
|
+
journal.add({
|
|
1318
|
+
method: req.method ?? "GET",
|
|
1319
|
+
path: req.url ?? pathname,
|
|
1320
|
+
headers: require_helpers.flattenHeaders(req.headers),
|
|
1321
|
+
body: null,
|
|
1322
|
+
response: {
|
|
1323
|
+
status: 500,
|
|
1324
|
+
fixture: null
|
|
1325
|
+
}
|
|
1326
|
+
});
|
|
1327
|
+
} catch (jErr) {
|
|
1328
|
+
defaults.logger.warn(`grok-video status: journal write failed after handler error: ${jErr instanceof Error ? jErr.message : String(jErr)}`);
|
|
1329
|
+
}
|
|
1330
|
+
require_sse_writer.writeErrorResponse(res, 500, JSON.stringify({ error: {
|
|
1331
|
+
message: msg,
|
|
1332
|
+
type: "server_error"
|
|
1333
|
+
} }));
|
|
1334
|
+
} else if (!res.writableEnded) res.destroy();
|
|
1335
|
+
}
|
|
1336
|
+
return;
|
|
1337
|
+
}
|
|
1338
|
+
const veoPredictMatch = pathname.match(require_metrics.VEO_PREDICT_LRO_RE);
|
|
1339
|
+
if (veoPredictMatch && req.method === "POST") {
|
|
1340
|
+
setCorsHeaders(res);
|
|
1341
|
+
try {
|
|
1342
|
+
await require_veo_video.handleVeoVideoCreate(req, res, await require_helpers.readBody(req), veoPredictMatch[1], fixtures, journal, defaults, setCorsHeaders, veoVideoJobs);
|
|
1343
|
+
} catch (err) {
|
|
1344
|
+
const msg = err instanceof Error ? err.message : "Internal error";
|
|
1345
|
+
defaults.logger.error(`veo-video submit: ${msg}`);
|
|
1346
|
+
if (!res.headersSent) {
|
|
1347
|
+
try {
|
|
1348
|
+
journal.add({
|
|
1349
|
+
method: req.method ?? "POST",
|
|
1350
|
+
path: req.url ?? pathname,
|
|
1351
|
+
headers: require_helpers.flattenHeaders(req.headers),
|
|
1352
|
+
body: null,
|
|
1353
|
+
response: {
|
|
1354
|
+
status: 500,
|
|
1355
|
+
fixture: null
|
|
1356
|
+
}
|
|
1357
|
+
});
|
|
1358
|
+
} catch (jErr) {
|
|
1359
|
+
defaults.logger.warn(`veo-video submit: journal write failed after handler error: ${jErr instanceof Error ? jErr.message : String(jErr)}`);
|
|
1360
|
+
}
|
|
1361
|
+
require_sse_writer.writeErrorResponse(res, 500, JSON.stringify({ error: {
|
|
1362
|
+
message: msg,
|
|
1363
|
+
type: "server_error"
|
|
1364
|
+
} }));
|
|
1365
|
+
} else if (!res.writableEnded) res.destroy();
|
|
1366
|
+
}
|
|
1367
|
+
return;
|
|
1368
|
+
}
|
|
1369
|
+
const veoOperationMatch = pathname.match(require_metrics.VEO_OPERATION_RE);
|
|
1370
|
+
if (veoOperationMatch && req.method === "GET") {
|
|
1371
|
+
try {
|
|
1372
|
+
await require_veo_video.handleVeoVideoStatus(req, res, veoOperationMatch[1], fixtures, journal, defaults, setCorsHeaders, veoVideoJobs);
|
|
1373
|
+
} catch (err) {
|
|
1374
|
+
const msg = err instanceof Error ? err.message : "Internal error";
|
|
1375
|
+
defaults.logger.error(`veo-video status: ${msg}`);
|
|
1376
|
+
if (!res.headersSent) {
|
|
1377
|
+
try {
|
|
1378
|
+
journal.add({
|
|
1379
|
+
method: req.method ?? "GET",
|
|
1380
|
+
path: req.url ?? pathname,
|
|
1381
|
+
headers: require_helpers.flattenHeaders(req.headers),
|
|
1382
|
+
body: null,
|
|
1383
|
+
response: {
|
|
1384
|
+
status: 500,
|
|
1385
|
+
fixture: null
|
|
1386
|
+
}
|
|
1387
|
+
});
|
|
1388
|
+
} catch (jErr) {
|
|
1389
|
+
defaults.logger.warn(`veo-video status: journal write failed after handler error: ${jErr instanceof Error ? jErr.message : String(jErr)}`);
|
|
1390
|
+
}
|
|
1391
|
+
require_sse_writer.writeErrorResponse(res, 500, JSON.stringify({ error: {
|
|
1392
|
+
message: msg,
|
|
1393
|
+
type: "server_error"
|
|
1394
|
+
} }));
|
|
1395
|
+
} else if (!res.writableEnded) res.destroy();
|
|
1396
|
+
}
|
|
1259
1397
|
return;
|
|
1260
1398
|
}
|
|
1261
1399
|
const geminiPredictMatch = pathname.match(GEMINI_PREDICT_RE);
|
|
@@ -1676,6 +1814,8 @@ async function createServer(fixtures, options, mounts, serviceFixtures) {
|
|
|
1676
1814
|
activeConnections.clear();
|
|
1677
1815
|
videoStates.clear();
|
|
1678
1816
|
openRouterVideoJobs.clear();
|
|
1817
|
+
veoVideoJobs.clear();
|
|
1818
|
+
grokVideoJobs.clear();
|
|
1679
1819
|
originalClose(callback);
|
|
1680
1820
|
return this;
|
|
1681
1821
|
};
|
|
@@ -1697,7 +1837,9 @@ async function createServer(fixtures, options, mounts, serviceFixtures) {
|
|
|
1697
1837
|
url,
|
|
1698
1838
|
defaults,
|
|
1699
1839
|
videoStates,
|
|
1700
|
-
openRouterVideoJobs
|
|
1840
|
+
openRouterVideoJobs,
|
|
1841
|
+
veoVideoJobs,
|
|
1842
|
+
grokVideoJobs
|
|
1701
1843
|
});
|
|
1702
1844
|
});
|
|
1703
1845
|
});
|