@kolbo/mcp 1.88.2 → 1.88.3
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/package.json
CHANGED
|
@@ -1330,6 +1330,64 @@ function openPromptRow(placeholder, onSend) {
|
|
|
1330
1330
|
The host mounts this iframe as soon as the tool is CALLED; the result can
|
|
1331
1331
|
take many seconds (model resolution, file upload, submit). Show a live
|
|
1332
1332
|
shell immediately instead of a blank card. */
|
|
1333
|
+
// Which tool args carry a reference the browser can actually load. The kind
|
|
1334
|
+
// here is only a FALLBACK: refKind() still lets the file extension win, exactly
|
|
1335
|
+
// like the result path, so a .mp4 handed to the files arg renders as video.
|
|
1336
|
+
var PRE_IMAGE_KEYS = ['source_images', 'reference_images', 'image_url', 'mask_image_url',
|
|
1337
|
+
'additional_images', 'first_frame', 'last_frame', 'seed_reference_image_url',
|
|
1338
|
+
'elements', 'files', 'keyframes', 'source'];
|
|
1339
|
+
var PRE_VIDEO_KEYS = ['source_video', 'reference_videos'];
|
|
1340
|
+
var PRE_AUDIO_KEYS = ['audio', 'audio_url', 'reference_audio_urls', 'seed_reference_audio_urls'];
|
|
1341
|
+
|
|
1342
|
+
// The card mounts the moment the tool is CALLED, so the only thing it knows is
|
|
1343
|
+
// the raw tool input - and for an edit/elements call the submit that follows is
|
|
1344
|
+
// the LONGEST wait on the card (local files are re-hosted first). Map the input
|
|
1345
|
+
// onto the same shape renderChips already reads for a server payload so the
|
|
1346
|
+
// references, DNA count and settings are on screen immediately instead of after
|
|
1347
|
+
// a minute of blank skeleton.
|
|
1348
|
+
// Deliberately NOT shown here: model, voice, DNA and moodboard NAMES. Those are
|
|
1349
|
+
// resolved server-side and arrive with the result (which overwrites all of
|
|
1350
|
+
// this) - rendering the raw identifier the caller passed would put an id on the
|
|
1351
|
+
// card, which is never allowed.
|
|
1352
|
+
function preRefSc(toolName, a) {
|
|
1353
|
+
var img = [], vid = [], aud = [];
|
|
1354
|
+
var take = function (v, bucket) {
|
|
1355
|
+
if (typeof v === 'string') {
|
|
1356
|
+
// http(s) only - an absolute local path is not loadable from the iframe.
|
|
1357
|
+
if (/^https?:/i.test(v) && bucket.indexOf(v) < 0) bucket.push(v);
|
|
1358
|
+
return;
|
|
1359
|
+
}
|
|
1360
|
+
if (Array.isArray(v)) {
|
|
1361
|
+
v.forEach(function (item) {
|
|
1362
|
+
take(typeof item === 'string' ? item : (item && (item.image_url || item.url)), bucket);
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1365
|
+
};
|
|
1366
|
+
PRE_IMAGE_KEYS.forEach(function (k) { take(a[k], img); });
|
|
1367
|
+
PRE_VIDEO_KEYS.forEach(function (k) { take(a[k], vid); });
|
|
1368
|
+
PRE_AUDIO_KEYS.forEach(function (k) { take(a[k], aud); });
|
|
1369
|
+
return {
|
|
1370
|
+
tool: toolName,
|
|
1371
|
+
kind: kindFromTool(toolName, null),
|
|
1372
|
+
count: a.num_images || (Array.isArray(a.prompts) ? a.prompts.length : 1),
|
|
1373
|
+
reference_images: img,
|
|
1374
|
+
reference_videos: vid,
|
|
1375
|
+
reference_audio: aud,
|
|
1376
|
+
settings: {
|
|
1377
|
+
duration: a.duration,
|
|
1378
|
+
resolution: a.resolution,
|
|
1379
|
+
aspect_ratio: a.aspect_ratio,
|
|
1380
|
+
quality: a.quality,
|
|
1381
|
+
mode: a.mode,
|
|
1382
|
+
cinematic: a.cinematic,
|
|
1383
|
+
visual_dna_ids: a.visual_dna_ids,
|
|
1384
|
+
moodboard_ids: a.moodboard_ids,
|
|
1385
|
+
moodboard_id: a.moodboard_id,
|
|
1386
|
+
preset_id: a.preset_id
|
|
1387
|
+
}
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1333
1391
|
function bootPre(toolName, args) {
|
|
1334
1392
|
if (toolName) originTool = toolName;
|
|
1335
1393
|
if (args) originArgs = args;
|
|
@@ -1347,6 +1405,7 @@ function bootPre(toolName, args) {
|
|
|
1347
1405
|
setPrompt(promptHTML(raw), raw);
|
|
1348
1406
|
}
|
|
1349
1407
|
setPhaseChip('Preparing', true);
|
|
1408
|
+
renderChips(preRefSc(toolName, args || {}));
|
|
1350
1409
|
if (!el('stage').innerHTML) {
|
|
1351
1410
|
el('stage').innerHTML = '<div class="k-gen-grid n1"><div class="k-skel video" style="min-height:100px;max-height:140px"></div></div>';
|
|
1352
1411
|
}
|