@sogni-ai/sogni-intelligence-client 3.0.6 → 3.0.8

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.
Files changed (51) hide show
  1. package/dist/contracts/data/promptContracts.d.ts.map +1 -1
  2. package/dist/contracts/data/promptContracts.js +23 -0
  3. package/dist/contracts/data/promptContracts.js.map +1 -1
  4. package/dist/contracts/videoComposition.d.ts.map +1 -1
  5. package/dist/contracts/videoComposition.js +15 -1
  6. package/dist/contracts/videoComposition.js.map +1 -1
  7. package/dist/media/gptImage.d.ts +1 -1
  8. package/dist/media/gptImage.d.ts.map +1 -1
  9. package/dist/media/gptImage.js +0 -2
  10. package/dist/media/gptImage.js.map +1 -1
  11. package/dist/public-skill-runtime/index.d.ts +1 -1
  12. package/dist/public-skill-runtime/index.d.ts.map +1 -1
  13. package/dist/public-skill-runtime/index.js +62 -13
  14. package/dist/public-skill-runtime/index.js.map +1 -1
  15. package/dist/tools/definitions/animate-photo/definition.d.ts.map +1 -1
  16. package/dist/tools/definitions/animate-photo/definition.js +6 -4
  17. package/dist/tools/definitions/animate-photo/definition.js.map +1 -1
  18. package/dist/tools/definitions/edit-image/definition.js +2 -2
  19. package/dist/tools/definitions/edit-image/definition.js.map +1 -1
  20. package/dist/tools/definitions/generate-image/definition.js +2 -2
  21. package/dist/tools/definitions/generate-image/definition.js.map +1 -1
  22. package/dist/tools/definitions/generate-video/definition.d.ts.map +1 -1
  23. package/dist/tools/definitions/generate-video/definition.js +5 -3
  24. package/dist/tools/definitions/generate-video/definition.js.map +1 -1
  25. package/dist/tools/definitions/sound-to-video/definition.d.ts.map +1 -1
  26. package/dist/tools/definitions/sound-to-video/definition.js +3 -1
  27. package/dist/tools/definitions/sound-to-video/definition.js.map +1 -1
  28. package/dist/tools/definitions/video-to-video/definition.d.ts.map +1 -1
  29. package/dist/tools/definitions/video-to-video/definition.js +4 -2
  30. package/dist/tools/definitions/video-to-video/definition.js.map +1 -1
  31. package/dist-esm/contracts/data/promptContracts.js +23 -0
  32. package/dist-esm/contracts/data/promptContracts.js.map +1 -1
  33. package/dist-esm/contracts/videoComposition.js +15 -1
  34. package/dist-esm/contracts/videoComposition.js.map +1 -1
  35. package/dist-esm/media/gptImage.js +0 -2
  36. package/dist-esm/media/gptImage.js.map +1 -1
  37. package/dist-esm/public-skill-runtime/index.js +62 -13
  38. package/dist-esm/public-skill-runtime/index.js.map +1 -1
  39. package/dist-esm/tools/definitions/animate-photo/definition.js +6 -4
  40. package/dist-esm/tools/definitions/animate-photo/definition.js.map +1 -1
  41. package/dist-esm/tools/definitions/edit-image/definition.js +2 -2
  42. package/dist-esm/tools/definitions/edit-image/definition.js.map +1 -1
  43. package/dist-esm/tools/definitions/generate-image/definition.js +2 -2
  44. package/dist-esm/tools/definitions/generate-image/definition.js.map +1 -1
  45. package/dist-esm/tools/definitions/generate-video/definition.js +5 -3
  46. package/dist-esm/tools/definitions/generate-video/definition.js.map +1 -1
  47. package/dist-esm/tools/definitions/sound-to-video/definition.js +3 -1
  48. package/dist-esm/tools/definitions/sound-to-video/definition.js.map +1 -1
  49. package/dist-esm/tools/definitions/video-to-video/definition.js +4 -2
  50. package/dist-esm/tools/definitions/video-to-video/definition.js.map +1 -1
  51. package/package.json +1 -1
@@ -4377,8 +4377,42 @@ function storyboardTableRowLooksLikeCountedBeat(cells, headers) {
4377
4377
  const candidate = compactStoryboardLine(cells[Math.max(0, headerIndex)] || cells[0] || '');
4378
4378
  return /^(?:beat|scene|shot|panel|frame)?\s*(?:#\s*)?0?\d{1,2}\b/i.test(candidate);
4379
4379
  }
4380
+ function storyboardTableCellLooksLikeCameraCue(cell) {
4381
+ const compact = compactStoryboardLine(cell);
4382
+ return /\b(?:camera|motion|shot|frame|framing|close[-\s]?up|medium|wide|macro|static|locked|hold|push(?:es)?\s+in|pull(?:s)?\s+back|pan|tilt|dolly|truck|tracking|handheld|orbit|zoom|focus|rack\s+focus|focus\s+pull|slow[-\s]?mo|timelapse)\b/i.test(compact);
4383
+ }
4384
+ function storyboardTableCellLooksLikeTransitionCue(cell) {
4385
+ const compact = compactStoryboardLine(cell);
4386
+ return /\b(?:transition|cut|hard\s+cut|smash\s+cut|match\s+cut|jump\s+cut|fade|cross[-\s]?fade|dissolve|wipe|morph|glitch|burst|snap|blend|strobe|whip[-\s]?pan)\b/i.test(compact);
4387
+ }
4380
4388
  function normalizeStoryboardTableCellsToHeaders(cells, headers) {
4381
- if (!headers || cells.length <= headers.length)
4389
+ if (!headers)
4390
+ return cells;
4391
+ if (cells.length === headers.length - 1) {
4392
+ const purposeHeaderIndex = storyboardTableHeaderIndex(headers, /\b(?:purpose|story\s*beat|story\s*purpose|beat\s*name|beat\s*title|narrative|name|title)\b/i);
4393
+ const visualHeaderIndex = storyboardTableHeaderIndex(headers, /\b(?:visual|frame|shot|image|action)\b/i);
4394
+ const transitionHeaderIndex = storyboardTableHeaderIndex(headers, /\b(?:transition|edit|cut|fade|dissolve|wipe)\b/i);
4395
+ const purposeCell = compactStoryboardLine(cells[purposeHeaderIndex] || '');
4396
+ const shiftedCameraCell = cells[visualHeaderIndex] || '';
4397
+ const shiftedTransitionCell = transitionHeaderIndex >= 0
4398
+ ? cells[transitionHeaderIndex - 1] || ''
4399
+ : '';
4400
+ const shiftedColumnsLookLikeFoldedPurposeVisual = transitionHeaderIndex >= 0
4401
+ ? storyboardTableCellLooksLikeTransitionCue(shiftedTransitionCell)
4402
+ : storyboardTableCellLooksLikeCameraCue(shiftedCameraCell);
4403
+ if (purposeHeaderIndex >= 0
4404
+ && visualHeaderIndex === purposeHeaderIndex + 1
4405
+ && visualHeaderIndex < cells.length
4406
+ && purposeCell.length >= 20
4407
+ && shiftedColumnsLookLikeFoldedPurposeVisual) {
4408
+ return [
4409
+ ...cells.slice(0, visualHeaderIndex),
4410
+ cells[purposeHeaderIndex],
4411
+ ...cells.slice(visualHeaderIndex),
4412
+ ];
4413
+ }
4414
+ }
4415
+ if (cells.length <= headers.length)
4382
4416
  return cells;
4383
4417
  const overflow = cells.length - headers.length;
4384
4418
  const combinedAudioDialogueIndex = headers.findIndex(header => /\baudio\b/i.test(header)
@@ -4472,10 +4506,11 @@ function splitStoryboardTableSections(text) {
4472
4506
  const cameraHeaderIndex = storyboardTableHeaderIndex(headers, /\b(?:camera|motion|fx|effect|lighting|style|look)\b/i);
4473
4507
  const dialogueHeaderIndex = storyboardTableHeaderIndex(headers, /\b(?:dialogue|vo|v\.o\.|voiceover|speech|narration)\b/i);
4474
4508
  const soundHeaderIndex = storyboardTableHeaderIndex(headers, /\b(?:audio|sfx|sound|foley|music)\b/i);
4509
+ const transitionHeaderIndex = storyboardTableHeaderIndex(headers, /\b(?:transition|edit|cut|fade|dissolve|wipe)\b/i);
4475
4510
  const visibleTextHeaderIndex = storyboardTableHeaderIndex(headers, /\b(?:visible\s+text|on[-\s]?screen\s+text|onscreen\s+text|text|copy|cta|tagline|headline|title\s+card|subtitle|caption)\b/i);
4476
4511
  const beatHeaderIndex = headers
4477
4512
  ? headers.findIndex(header => /\b(?:beat|scene|shot|panel|frame)\b/i.test(header)
4478
- && !/\b(?:visual|action|camera|audio|dialogue|vo|sfx)\b/i.test(header))
4513
+ && !/\b(?:visual|action|camera|audio|dialogue|vo|sfx|transition)\b/i.test(header))
4479
4514
  : -1;
4480
4515
  const purposeHeaderIndex = headers
4481
4516
  ? headers.findIndex(header => /\b(?:purpose|story\s*beat|story\s*purpose|beat\s*name|beat\s*title|narrative|name|title)\b/i.test(header)
@@ -4506,6 +4541,9 @@ function splitStoryboardTableSections(text) {
4506
4541
  const soundCell = soundHeaderIndex >= 0
4507
4542
  ? storyboardTableCellWithFieldBreaks(cells[soundHeaderIndex] || '')
4508
4543
  : '';
4544
+ const transitionCell = transitionHeaderIndex >= 0
4545
+ ? storyboardTableCellWithFieldBreaks(cells[transitionHeaderIndex] || '')
4546
+ : '';
4509
4547
  const visibleTextCell = visibleTextHeaderIndex >= 0
4510
4548
  ? storyboardTableCellWithFieldBreaks(cells[visibleTextHeaderIndex] || '')
4511
4549
  : '';
@@ -4547,6 +4585,8 @@ function splitStoryboardTableSections(text) {
4547
4585
  || (visibleTextHeaderIndex >= 0 ? compactStoryboardLine(visibleTextCell) : ''));
4548
4586
  const audio = extractStoryboardField(audioCell, ['Audio/SFX', 'Audio', 'SFX', 'FX', 'Foley', 'Sound', 'Sounds'])
4549
4587
  || storyboardTableCellWithoutDialogue(soundCell || audioCell, dialogue);
4588
+ const transition = extractStoryboardField(transitionCell, ['Transition', 'Transition out', 'Transition-out', 'Edit'])
4589
+ || (transitionHeaderIndex >= 0 ? compactStoryboardLine(transitionCell) : '');
4550
4590
  const number = sections.length + 1;
4551
4591
  const beatLabel = beatHeaderIndex >= 0 && beatHeaderIndex !== timingCellIndex
4552
4592
  ? compactStoryboardLine(cells[beatHeaderIndex])
@@ -4559,6 +4599,7 @@ function splitStoryboardTableSections(text) {
4559
4599
  && purposeHeaderIndex !== soundHeaderIndex
4560
4600
  && purposeHeaderIndex !== cameraHeaderIndex
4561
4601
  && purposeHeaderIndex !== visibleTextHeaderIndex
4602
+ && purposeHeaderIndex !== transitionHeaderIndex
4562
4603
  ? compactStoryboardLine(cells[purposeHeaderIndex])
4563
4604
  : '';
4564
4605
  const beatTitleSource = purposeLabel && !/^\d{1,2}$/.test(purposeLabel)
@@ -4578,6 +4619,7 @@ function splitStoryboardTableSections(text) {
4578
4619
  dialogue ? `Dialogue/VO: ${dialogue}` : '',
4579
4620
  visibleText ? `Visible text: ${visibleText}` : '',
4580
4621
  audio ? `Audio/SFX: ${audio}` : '',
4622
+ transition ? `Transition: ${transition}` : '',
4581
4623
  ].filter(Boolean).join('\n'),
4582
4624
  });
4583
4625
  }
@@ -4816,7 +4858,7 @@ function synthesizeStoryboardSectionsFromPlainNarration(sourceText, frameCount,
4816
4858
  }
4817
4859
  function storyboardSectionsHavePreservableExplicitTiming(sections) {
4818
4860
  return sections.length > 1
4819
- && sections.some(section => extractStoryboardTiming(`${section.heading}\n${section.body}`) !== null);
4861
+ && sections.every(section => extractStoryboardTiming(`${section.heading}\n${section.body}`) !== null);
4820
4862
  }
4821
4863
  function canonicalStoryboardScriptContext(text) {
4822
4864
  const trimmed = String(text || '').trim();
@@ -5333,11 +5375,16 @@ function minimumStoryboardSceneDurationForDialogue(scene, rules, wordsPerSecondM
5333
5375
  function retimeStoryboardScenesForDialogue(scenes, targetDurationSec, rules = DEFAULT_STORYBOARD_TIMING_RULES) {
5334
5376
  if (targetDurationSec === null || scenes.length === 0)
5335
5377
  return scenes;
5336
- if (!scenes.every(scene => scene.startSec !== null && scene.endSec !== null && scene.durationSec !== null && scene.durationSec > 0)) {
5337
- return scenes;
5338
- }
5378
+ const hasCompletePositiveTiming = scenes.every(scene => scene.startSec !== null
5379
+ && scene.endSec !== null
5380
+ && scene.durationSec !== null
5381
+ && scene.durationSec > 0);
5382
+ const sourceDurations = scenes.map(scene => (scene.durationSec !== null && scene.durationSec > 0
5383
+ ? scene.durationSec
5384
+ : targetDurationSec / scenes.length));
5339
5385
  const minimumDurations = scenes.map(scene => minimumStoryboardSceneDurationForDialogue(scene, rules));
5340
- const needsRetiming = scenes.some((scene, index) => (scene.durationSec ?? 0) + rules.toleranceSec < minimumDurations[index]);
5386
+ const needsRetiming = !hasCompletePositiveTiming
5387
+ || scenes.some((scene, index) => (scene.durationSec ?? 0) + rules.toleranceSec < minimumDurations[index]);
5341
5388
  if (!needsRetiming)
5342
5389
  return scenes;
5343
5390
  let requiredDurations = minimumDurations;
@@ -5353,9 +5400,8 @@ function retimeStoryboardScenesForDialogue(scenes, targetDurationSec, rules = DE
5353
5400
  if (minimumTotal > targetDurationSec + rules.toleranceSec)
5354
5401
  return scenes;
5355
5402
  const extraDuration = Math.max(0, targetDurationSec - minimumTotal);
5356
- const originalDurations = scenes.map(scene => scene.durationSec ?? 0);
5357
- const weightTotal = originalDurations.reduce((sum, duration) => sum + Math.max(0.01, duration), 0);
5358
- const unroundedDurations = requiredDurations.map((minimum, index) => (minimum + (extraDuration * Math.max(0.01, originalDurations[index]) / weightTotal)));
5403
+ const weightTotal = sourceDurations.reduce((sum, duration) => sum + Math.max(0.01, duration), 0);
5404
+ const unroundedDurations = requiredDurations.map((minimum, index) => (minimum + (extraDuration * Math.max(0.01, sourceDurations[index]) / weightTotal)));
5359
5405
  const timelineStartSec = scenes[0].startSec ?? 0;
5360
5406
  const timelineEndSec = Math.round((timelineStartSec + targetDurationSec) * 100) / 100;
5361
5407
  let cursor = timelineStartSec;
@@ -5456,7 +5502,9 @@ function inferStoryboardStorySpineFromHeading(text) {
5456
5502
  const collected = [];
5457
5503
  for (let cursor = index + 1; cursor < lines.length && collected.length < 4; cursor += 1) {
5458
5504
  const candidate = lines[cursor];
5459
- if (/^(?:storyboard|video|production|reference|timecoded|beat\s+\d|scene\s+\d|format|duration|aspect|does this|please confirm)\b/i.test(candidate)) {
5505
+ if (/^\|/.test(candidate)
5506
+ || storyboardMarkdownTableSeparatorLine(candidate)
5507
+ || /^(?:storyboard|video|production|reference|timecoded|beat\s+\d|scene\s+\d|format|duration|aspect|does this|please confirm)\b/i.test(candidate)) {
5460
5508
  break;
5461
5509
  }
5462
5510
  const cleaned = cleanStoryboardStorySpine(candidate);
@@ -6745,6 +6793,7 @@ function compileSeedanceStoryboardPromptFromProject(project, options = {}) {
6745
6793
  : 'All scene numbers, timecodes, labels, and production notes remain metadata only and must not appear in the video.';
6746
6794
  const toneProgression = project.creativeBrief.toneProgression.join(' -> ');
6747
6795
  const musicArc = project.scenes.map(scene => scene.music).filter(Boolean).join(' -> ');
6796
+ const visualStyle = project.creativeBrief.visualQualityBar.replace(/\bstoryboard\s+sheet\b/gi, 'cinematic video');
6748
6797
  return [
6749
6798
  'PROJECT:',
6750
6799
  `Title: ${project.title}`,
@@ -6753,14 +6802,14 @@ function compileSeedanceStoryboardPromptFromProject(project, options = {}) {
6753
6802
  `Story spine: ${storySpine}`,
6754
6803
  '',
6755
6804
  'INPUT ASSETS:',
6756
- `${storyboardImageTag}: approved GPT Image 2 storyboard board. Treat it as an ordered shot guide and timing reference only, not as a collage, split-screen, grid, or picture-in-picture layout to reproduce.`,
6805
+ `${storyboardImageTag}: approved storyboard reference image. Treat it as an ordered shot guide and timing reference only, not as a collage, split-screen, grid, or picture-in-picture layout to reproduce.`,
6757
6806
  '',
6758
6807
  'GLOBAL VIDEO INSTRUCTIONS:',
6759
6808
  `Render one continuous cinematic video in ${aspectRatio}. Follow the storyboard scene order, timing ranges, transitions, and audio plan.`,
6760
6809
  'Use the storyboard as the controlling source for shot order and intent while converting each panel into full-screen motion.',
6761
6810
  visibleTextInstruction,
6762
6811
  metadataLabels.length > 0 ? `Do not render these metadata labels as video text: ${metadataLabels.join('; ')}.` : '',
6763
- `Visual style: ${project.creativeBrief.visualQualityBar}`,
6812
+ `Visual style: ${visualStyle}`,
6764
6813
  toneProgression ? `Tone progression: ${toneProgression}` : '',
6765
6814
  musicArc ? `Music arc: ${musicArc}` : '',
6766
6815
  '',