@sogni-ai/sogni-intelligence-client 2.2.1 → 2.2.2
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/dist/public-skill-runtime/index.d.ts.map +1 -1
- package/dist/public-skill-runtime/index.js +86 -4
- package/dist/public-skill-runtime/index.js.map +1 -1
- package/dist/tools/shared/seedancePolicyErrors.d.ts +1 -0
- package/dist/tools/shared/seedancePolicyErrors.d.ts.map +1 -1
- package/dist/tools/shared/seedancePolicyErrors.js +14 -1
- package/dist/tools/shared/seedancePolicyErrors.js.map +1 -1
- package/dist-esm/public-skill-runtime/index.js +86 -4
- package/dist-esm/public-skill-runtime/index.js.map +1 -1
- package/dist-esm/tools/shared/seedancePolicyErrors.js +13 -0
- package/dist-esm/tools/shared/seedancePolicyErrors.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ export declare const SEEDANCE_INPUT_IMAGE_PRIVACY_POLICY_CODE = "InputImageSensi
|
|
|
3
3
|
export declare const SEEDANCE_REAL_PERSON_PRIVACY_MESSAGE = "Seedance rejected the input image because it may contain a real person. Seedance Video currently doesn't allow photographic depictions of real people. Please use a non-real-person or more stylized reference image, or switch to another video model.";
|
|
4
4
|
export declare const SEEDANCE_PROVIDER_CONTENT_POLICY_MESSAGE = "Seedance blocked this video because it did not pass the provider's content policy. No video was returned.";
|
|
5
5
|
export declare const SEEDANCE_VENDOR_GENERATION_FAILED_MESSAGE = "Seedance couldn't complete this video after it started, so no media was generated. The provider did not return a specific reason. Please retry once; if it fails again, report the issue from this message.";
|
|
6
|
+
export declare const SEEDANCE_VENDOR_TIMEOUT_MESSAGE = "Seedance timed out while rendering this video, so no media was generated. Please retry once; if it times out again, report the issue from this message.";
|
|
6
7
|
export declare const SEEDANCE_REFERENCE_AUDIO_TOO_LONG_MESSAGE = "Seedance rejected the reference audio because it is longer than this video mode allows. Use an audio clip at or below the provider limit, or retry with the audio trimmed to that length.";
|
|
7
8
|
export interface SeedanceTerminalPolicyPayload {
|
|
8
9
|
error: 'seedance_input_image_privacy_policy' | 'seedance_content_policy';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seedancePolicyErrors.d.ts","sourceRoot":"","sources":["../../../src/tools/shared/seedancePolicyErrors.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,iCAAiC,EACvC,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,wCAAwC,0DACI,CAAC;AAE1D,eAAO,MAAM,oCAAoC,4PAC0M,CAAC;AAE5P,eAAO,MAAM,wCAAwC,8GACwD,CAAC;AAE9G,eAAO,MAAM,yCAAyC,gNACyJ,CAAC;
|
|
1
|
+
{"version":3,"file":"seedancePolicyErrors.d.ts","sourceRoot":"","sources":["../../../src/tools/shared/seedancePolicyErrors.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,iCAAiC,EACvC,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,wCAAwC,0DACI,CAAC;AAE1D,eAAO,MAAM,oCAAoC,4PAC0M,CAAC;AAE5P,eAAO,MAAM,wCAAwC,8GACwD,CAAC;AAE9G,eAAO,MAAM,yCAAyC,gNACyJ,CAAC;AAChN,eAAO,MAAM,+BAA+B,4JAC+G,CAAC;AAE5J,eAAO,MAAM,yCAAyC,8LACuI,CAAC;AAE9L,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,qCAAqC,GAAG,yBAAyB,CAAC;IACzE,OAAO,EAAE,OAAO,oCAAoC,GAAG,OAAO,wCAAwC,CAAC;IACvG,WAAW,EAAE,0BAA0B,CAAC;IACxC,UAAU,EAAE,eAAe,CAAC;IAC5B,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,eAAe,EAAE,OAAO,wCAAwC,GAAG,MAAM,CAAC;CAC3E;AAED,MAAM,WAAW,wCAAwC;IACvD,KAAK,EAAE,4BAA4B,GAAG,mCAAmC,CAAC;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,0BAA0B,CAAC;IACxC,UAAU,EAAE,eAAe,CAAC;IAC5B,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,qBAAa,2BAA4B,SAAQ,KAAK;IACpD,QAAQ,CAAC,OAAO,EAAE,6BAA6B,CAAC;gBAEpC,OAAO,EAAE,6BAA6B;CAKnD;AA0JD,wBAAgB,sCAAsC,CACpD,KAAK,EAAE,OAAO,GACb,6BAA6B,GAAG,IAAI,CAgCtC;AAED,wBAAgB,oCAAoC,CAClD,KAAK,EAAE,OAAO,GACb,2BAA2B,GAAG,IAAI,CAGpC;AAED,wBAAgB,iDAAiD,CAC/D,KAAK,EAAE,OAAO,GACb,wCAAwC,GAAG,iCAAiC,GAAG,IAAI,CAwFrF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SeedanceTerminalPolicyError = exports.SEEDANCE_REFERENCE_AUDIO_TOO_LONG_MESSAGE = exports.SEEDANCE_VENDOR_GENERATION_FAILED_MESSAGE = exports.SEEDANCE_PROVIDER_CONTENT_POLICY_MESSAGE = exports.SEEDANCE_REAL_PERSON_PRIVACY_MESSAGE = exports.SEEDANCE_INPUT_IMAGE_PRIVACY_POLICY_CODE = void 0;
|
|
3
|
+
exports.SeedanceTerminalPolicyError = exports.SEEDANCE_REFERENCE_AUDIO_TOO_LONG_MESSAGE = exports.SEEDANCE_VENDOR_TIMEOUT_MESSAGE = exports.SEEDANCE_VENDOR_GENERATION_FAILED_MESSAGE = exports.SEEDANCE_PROVIDER_CONTENT_POLICY_MESSAGE = exports.SEEDANCE_REAL_PERSON_PRIVACY_MESSAGE = exports.SEEDANCE_INPUT_IMAGE_PRIVACY_POLICY_CODE = void 0;
|
|
4
4
|
exports.seedanceTerminalPolicyPayloadFromError = seedanceTerminalPolicyPayloadFromError;
|
|
5
5
|
exports.seedanceTerminalPolicyErrorFromError = seedanceTerminalPolicyErrorFromError;
|
|
6
6
|
exports.seedanceTerminalGenerationFailurePayloadFromError = seedanceTerminalGenerationFailurePayloadFromError;
|
|
@@ -9,6 +9,7 @@ exports.SEEDANCE_INPUT_IMAGE_PRIVACY_POLICY_CODE = 'InputImageSensitiveContentDe
|
|
|
9
9
|
exports.SEEDANCE_REAL_PERSON_PRIVACY_MESSAGE = "Seedance rejected the input image because it may contain a real person. Seedance Video currently doesn't allow photographic depictions of real people. Please use a non-real-person or more stylized reference image, or switch to another video model.";
|
|
10
10
|
exports.SEEDANCE_PROVIDER_CONTENT_POLICY_MESSAGE = "Seedance blocked this video because it did not pass the provider's content policy. No video was returned.";
|
|
11
11
|
exports.SEEDANCE_VENDOR_GENERATION_FAILED_MESSAGE = "Seedance couldn't complete this video after it started, so no media was generated. The provider did not return a specific reason. Please retry once; if it fails again, report the issue from this message.";
|
|
12
|
+
exports.SEEDANCE_VENDOR_TIMEOUT_MESSAGE = "Seedance timed out while rendering this video, so no media was generated. Please retry once; if it times out again, report the issue from this message.";
|
|
12
13
|
exports.SEEDANCE_REFERENCE_AUDIO_TOO_LONG_MESSAGE = 'Seedance rejected the reference audio because it is longer than this video mode allows. Use an audio clip at or below the provider limit, or retry with the audio trimmed to that length.';
|
|
13
14
|
class SeedanceTerminalPolicyError extends Error {
|
|
14
15
|
constructor(payload) {
|
|
@@ -226,6 +227,18 @@ function seedanceTerminalGenerationFailurePayloadFromError(error) {
|
|
|
226
227
|
vendorError: shaped.vendorMessage.slice(0, 500),
|
|
227
228
|
};
|
|
228
229
|
}
|
|
230
|
+
if (/\b(?:timed?\s*out|timeout|deadline\s+exceeded)\b/i.test(text)) {
|
|
231
|
+
return {
|
|
232
|
+
error: 'seedance_generation_failed',
|
|
233
|
+
message: exports.SEEDANCE_VENDOR_TIMEOUT_MESSAGE,
|
|
234
|
+
retryPolicy: 'manual_user_confirmation',
|
|
235
|
+
nextAction: 'wait_for_user',
|
|
236
|
+
reportIssue: true,
|
|
237
|
+
reportIssueReason: 'Seedance provider job timed out after starting.',
|
|
238
|
+
vendorErrorCode: 'PROVIDER_TIMEOUT',
|
|
239
|
+
...(text ? { vendorError: text.slice(0, 500) } : {}),
|
|
240
|
+
};
|
|
241
|
+
}
|
|
229
242
|
return {
|
|
230
243
|
error: 'seedance_generation_failed',
|
|
231
244
|
message: exports.SEEDANCE_VENDOR_GENERATION_FAILED_MESSAGE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seedancePolicyErrors.js","sourceRoot":"","sources":["../../../src/tools/shared/seedancePolicyErrors.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"seedancePolicyErrors.js","sourceRoot":"","sources":["../../../src/tools/shared/seedancePolicyErrors.ts"],"names":[],"mappings":";;;AAmNA,wFAkCC;AAED,oFAKC;AAED,8GA0FC;AAlVD,mDAG8B;AAEjB,QAAA,wCAAwC,GACnD,uDAAuD,CAAC;AAE7C,QAAA,oCAAoC,GAC/C,yPAAyP,CAAC;AAE/O,QAAA,wCAAwC,GACnD,2GAA2G,CAAC;AAEjG,QAAA,yCAAyC,GACpD,6MAA6M,CAAC;AACnM,QAAA,+BAA+B,GAC1C,yJAAyJ,CAAC;AAE/I,QAAA,yCAAyC,GACpD,2LAA2L,CAAC;AAuB9L,MAAa,2BAA4B,SAAQ,KAAK;IAGpD,YAAY,OAAsC;QAChD,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC;QAC1C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AARD,kEAQC;AAED,SAAS,gBAAgB,CAAC,KAAc,EAAE,OAAO,IAAI,OAAO,EAAU;IACpE,IAAI,KAA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AW,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACrD,CAAC;IACJ,CAAC;IACD,OAAO;QACL,KAAK,EAAE,4BAA4B;QACnC,OAAO,EAAE,iDAAyC;QAClD,WAAW,EAAE,0BAA0B;QACvC,UAAU,EAAE,eAAe;QAC3B,WAAW,EAAE,IAAI;QACjB,iBAAiB,EAAE,iFAAiF;QACpG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACrD,CAAC;AACJ,CAAC"}
|
|
@@ -3487,6 +3487,7 @@ function extractStoryboardRequiredText(text) {
|
|
|
3487
3487
|
const inlineProductionLabelPattern = /\b(?:SFX|FX|Audio(?:\s*\/\s*SFX)?|Sound(?:s)?|Music|Foley|Camera(?:\s*\/\s*Motion)?|Motion|Lighting(?:\s*\/\s*Style)?|Style|Transition|Action(?:\s*\/\s*Motion)?|Performance|Beat)\s*:\s*[^a-z0-9]{0,4}$/i;
|
|
3488
3488
|
const visibleTextContextPattern = /\b(?:visible|on[-\s]?screen|in[-\s]?frame|text|copy|cta|tagline|headline|title\s+card|caption|subtitle|super|wordmark|spell(?:ed)?|read(?:s)?|slogan)\b/i;
|
|
3489
3489
|
const sceneHeadingPattern = /^\s*(?:[-*+]\s*)?(?:#{1,6}\s*)?(?:[*_]{1,3})?\s*(?:Scene|Shot|Beat|Panel|Frame)[\s_#-]*\d{1,2}\b/i;
|
|
3490
|
+
const visibleTextRestrictionPattern = /\b(?:only\s+(?:text|copy|words?)|no\s+(?:captions?|subtitles?|overlays?|watermarks?|added\s+logos?|extra\s+logos?|logos?|text|copy)|without\s+(?:captions?|subtitles?|overlays?|watermarks?|added\s+logos?|extra\s+logos?|logos?|text|copy)|do\s+not\s+(?:add|include|render|show|write)\s+(?:captions?|subtitles?|overlays?|watermarks?|logos?|text|copy|words?))\b/i;
|
|
3490
3491
|
const shouldIgnoreRequiredText = (value, matchIndex, precedingText) => {
|
|
3491
3492
|
const lineStart = text.lastIndexOf('\n', matchIndex) + 1;
|
|
3492
3493
|
const nextLineBreak = text.indexOf('\n', matchIndex);
|
|
@@ -3497,6 +3498,9 @@ function extractStoryboardRequiredText(text) {
|
|
|
3497
3498
|
const isProductionDirectionField = /\b(?:action|motion|camera|transition|audio|sfx|fx|foley|sound|music|lighting|style|performance|beat)\b/i.test(fieldLabel)
|
|
3498
3499
|
&& !visibleTextContextPattern.test(fieldLabel);
|
|
3499
3500
|
const hasExplicitVisibleTextContext = visibleTextContextPattern.test(line);
|
|
3501
|
+
const isRestrictionOnlyTextInstruction = visibleTextContextPattern.test(fieldLabel || line)
|
|
3502
|
+
&& visibleTextRestrictionPattern.test(value)
|
|
3503
|
+
&& !/["“”`]/.test(value);
|
|
3500
3504
|
const looksLikeActionOrSfxCallout = /^[a-z][a-z-]{1,24}[!?.]?$/i.test(value.trim())
|
|
3501
3505
|
&& /\b(?:action|motion|transition|audio|sfx|fx|foley|sound|music|camera|performance|beat|pop(?:s|ped|ping)?|snap(?:s|ped|ping)?|whoosh(?:es)?|thud(?:s|ded|ding)?|ding(?:s|ed|ing)?|boom(?:s|ed|ing)?|impact(?:s|ed|ing)?|hit(?:s|ting)?|slam(?:s|med|ming)?|wipe(?:s|d|ing)?|glitch(?:es|ed|ing)?|morph(?:s|ed|ing)?|bounce(?:s|d|ing)?|zoom(?:s|ed|ing)?)\b/i.test(line);
|
|
3502
3506
|
const precedingTail = (precedingText ?? '').slice(-80);
|
|
@@ -3516,6 +3520,9 @@ function extractStoryboardRequiredText(text) {
|
|
|
3516
3520
|
if (isNestedSceneHeadingField) {
|
|
3517
3521
|
return true;
|
|
3518
3522
|
}
|
|
3523
|
+
if (isRestrictionOnlyTextInstruction) {
|
|
3524
|
+
return true;
|
|
3525
|
+
}
|
|
3519
3526
|
if (hasInlineProductionLabel) {
|
|
3520
3527
|
return true;
|
|
3521
3528
|
}
|
|
@@ -3689,13 +3696,29 @@ function selectStoryboardSourceBrief(prompt, userIntentText) {
|
|
|
3689
3696
|
}
|
|
3690
3697
|
return promptCore || priorBrief || cleanUserIntentText.trim();
|
|
3691
3698
|
}
|
|
3699
|
+
function selectStoryboardSourceBriefForCompile(options, userIntentText) {
|
|
3700
|
+
const selectedBrief = selectStoryboardSourceBrief(options.prompt, userIntentText);
|
|
3701
|
+
if (options.promptAuthorship !== 'assistant')
|
|
3702
|
+
return selectedBrief;
|
|
3703
|
+
const cleanUserIntentText = cleanStoryboardNarrativeSourceText(userIntentText);
|
|
3704
|
+
const selectedSectionCount = splitStoryboardSections(selectedBrief).length;
|
|
3705
|
+
const userSectionCount = splitStoryboardSections(cleanUserIntentText).length;
|
|
3706
|
+
const userBriefHasRequestedSceneCount = options.frameCount
|
|
3707
|
+
? userSectionCount === options.frameCount
|
|
3708
|
+
: userSectionCount > 0;
|
|
3709
|
+
if (userBriefHasRequestedSceneCount
|
|
3710
|
+
&& userSectionCount > selectedSectionCount) {
|
|
3711
|
+
return cleanUserIntentText;
|
|
3712
|
+
}
|
|
3713
|
+
return selectedBrief;
|
|
3714
|
+
}
|
|
3692
3715
|
function storyboardBriefContains(haystack, needle) {
|
|
3693
3716
|
const haystackKey = normalizeStoryboardBriefKey(haystack);
|
|
3694
3717
|
const needleKey = normalizeStoryboardBriefKey(needle);
|
|
3695
3718
|
return !!needleKey && haystackKey.includes(needleKey);
|
|
3696
3719
|
}
|
|
3697
3720
|
function buildStoryboardSourceBriefForPrompt(prompt, userIntentText, approvedScriptContext, promptAuthorship) {
|
|
3698
|
-
const selectedBrief =
|
|
3721
|
+
const selectedBrief = selectStoryboardSourceBriefForCompile({ prompt, promptAuthorship, frameCount: undefined }, userIntentText);
|
|
3699
3722
|
const originalBrief = latestSubstantiveStoryboardUserBrief(userIntentText, selectedBrief);
|
|
3700
3723
|
const canonicalApprovedScriptContext = canonicalStoryboardScriptContext(approvedScriptContext);
|
|
3701
3724
|
const includeSelectedBrief = selectedBrief && !(promptAuthorship === 'assistant' && canonicalApprovedScriptContext);
|
|
@@ -4201,6 +4224,58 @@ function splitStoryboardSceneSections(text) {
|
|
|
4201
4224
|
};
|
|
4202
4225
|
}).filter(section => Number.isInteger(section.number) && section.number > 0);
|
|
4203
4226
|
}
|
|
4227
|
+
function splitStoryboardNumberedListSceneSections(text) {
|
|
4228
|
+
const headerPattern = /^[ \t]*(?:#{1,6}[ \t]*)?(?:[*_]{1,3})?(?:SCENES?|SHOTS?|BEATS?|PANELS?|FRAMES?|SHOT\s+LIST|SCENE\s+LIST)[ \t]*:[ \t]*(?:[*_]{1,3})?[ \t]*$/gim;
|
|
4229
|
+
const headerMatches = Array.from(text.matchAll(headerPattern));
|
|
4230
|
+
if (headerMatches.length === 0)
|
|
4231
|
+
return [];
|
|
4232
|
+
for (const headerMatch of headerMatches) {
|
|
4233
|
+
const blockStart = (headerMatch.index ?? 0) + headerMatch[0].length;
|
|
4234
|
+
const block = text.slice(blockStart);
|
|
4235
|
+
if (!block)
|
|
4236
|
+
continue;
|
|
4237
|
+
const allMatches = Array.from(block.matchAll(/^[ \t]*(\d{1,2})[ \t]*[.)][ \t]*([^\n]{0,220})/gim)).filter(match => {
|
|
4238
|
+
const value = Number(match[1]);
|
|
4239
|
+
return Number.isInteger(value) && value > 0;
|
|
4240
|
+
});
|
|
4241
|
+
const firstSceneIndex = allMatches.findIndex(match => Number(match[1]) === 1);
|
|
4242
|
+
const matches = [];
|
|
4243
|
+
for (let index = firstSceneIndex; index >= 0 && index < allMatches.length; index += 1) {
|
|
4244
|
+
const expected = matches.length + 1;
|
|
4245
|
+
if (Number(allMatches[index][1]) !== expected)
|
|
4246
|
+
break;
|
|
4247
|
+
matches.push(allMatches[index]);
|
|
4248
|
+
}
|
|
4249
|
+
if (matches.length < 2)
|
|
4250
|
+
continue;
|
|
4251
|
+
const sections = matches.map((match, index) => {
|
|
4252
|
+
const number = Number(match[1]);
|
|
4253
|
+
const lineStart = match.index ?? 0;
|
|
4254
|
+
const lineEnd = block.indexOf('\n', lineStart);
|
|
4255
|
+
const firstLineEnd = lineEnd >= 0 ? lineEnd : block.length;
|
|
4256
|
+
const firstLineRemainder = compactStoryboardLine(match[2]);
|
|
4257
|
+
const globalTailStart = firstLineEnd;
|
|
4258
|
+
const globalTailSection = block.slice(globalTailStart).search(/^\s{0,2}(?:CONSISTENCY|NEGATIVE(?:\s*\/\s*AVOID)?|AVOID|CRITICAL\s+REQUIREMENTS|REQUIREMENTS|NOTES|OUTPUT|REFERENCE\s+IMAGES|CANVAS\s*\/\s*LAYOUT)\s*:/im);
|
|
4259
|
+
const finalSceneEnd = globalTailSection >= 0
|
|
4260
|
+
? globalTailStart + globalTailSection
|
|
4261
|
+
: block.length;
|
|
4262
|
+
const nextStart = index + 1 < matches.length ? matches[index + 1].index ?? block.length : finalSceneEnd;
|
|
4263
|
+
const trailingBody = block.slice(firstLineEnd, nextStart).trim();
|
|
4264
|
+
const titleDescription = firstLineRemainder.match(/^(.{1,80}?)(?:\s+[–—-]\s+|\s*:\s+)([\s\S]{12,})$/);
|
|
4265
|
+
const title = compactStoryboardLine(titleDescription?.[1] || firstLineRemainder, `Scene ${String(number).padStart(2, '0')}`);
|
|
4266
|
+
const firstBodyLine = compactStoryboardLine(titleDescription?.[2] || firstLineRemainder);
|
|
4267
|
+
const body = [firstBodyLine, trailingBody].filter(Boolean).join('\n').trim();
|
|
4268
|
+
return {
|
|
4269
|
+
number,
|
|
4270
|
+
heading: `Scene ${number} - ${title}`,
|
|
4271
|
+
body,
|
|
4272
|
+
};
|
|
4273
|
+
}).filter(section => section.body.length >= 24);
|
|
4274
|
+
if (sections.length >= 2)
|
|
4275
|
+
return sections;
|
|
4276
|
+
}
|
|
4277
|
+
return [];
|
|
4278
|
+
}
|
|
4204
4279
|
function splitStoryboardInlineSceneSections(text) {
|
|
4205
4280
|
const markerPattern = /(^|[\s.;])((?:Scene|Shot|Beat|Panel|Frame)\s*(\d{1,2})(?:\s*,\s*(?:Scene|Shot|Beat|Panel|Frame)\s*\d{1,2})?\s*(?:\([^)]{0,120}\))?\s*(?:[:\-–—]\s*)?)/gi;
|
|
4206
4281
|
const matches = Array.from(text.matchAll(markerPattern))
|
|
@@ -4233,16 +4308,23 @@ function splitStoryboardInlineSceneSections(text) {
|
|
|
4233
4308
|
function splitStoryboardSections(text) {
|
|
4234
4309
|
const sectionHeadings = splitStoryboardSceneSections(text);
|
|
4235
4310
|
const tableSections = splitStoryboardTableSections(text);
|
|
4236
|
-
const
|
|
4311
|
+
const numberedListSections = splitStoryboardNumberedListSceneSections(text);
|
|
4312
|
+
const inlineSections = sectionHeadings.length === 0 && tableSections.length === 0 && numberedListSections.length === 0
|
|
4237
4313
|
? splitStoryboardInlineSceneSections(text)
|
|
4238
4314
|
: [];
|
|
4239
4315
|
const explicitFrameCount = inferExplicitStoryboardFrameCountFromText(text);
|
|
4240
4316
|
if (tableSections.length > 0 && explicitFrameCount !== null && tableSections.length === explicitFrameCount) {
|
|
4241
4317
|
return tableSections;
|
|
4242
4318
|
}
|
|
4319
|
+
if (numberedListSections.length > 0 && explicitFrameCount !== null && numberedListSections.length === explicitFrameCount) {
|
|
4320
|
+
return numberedListSections;
|
|
4321
|
+
}
|
|
4243
4322
|
if (tableSections.length > 0 && tableSections.length >= sectionHeadings.length) {
|
|
4244
4323
|
return tableSections;
|
|
4245
4324
|
}
|
|
4325
|
+
if (numberedListSections.length > 0 && numberedListSections.length >= sectionHeadings.length) {
|
|
4326
|
+
return numberedListSections;
|
|
4327
|
+
}
|
|
4246
4328
|
if (inlineSections.length > 0)
|
|
4247
4329
|
return inlineSections;
|
|
4248
4330
|
return sectionHeadings.length > 0 ? sectionHeadings : tableSections;
|
|
@@ -4978,7 +5060,7 @@ export function buildStoryboardProject(options) {
|
|
|
4978
5060
|
const userIntentText = canonicalStoryboardScriptContext(rawUserIntentText) || rawUserIntentText;
|
|
4979
5061
|
const narrativeUserIntentText = cleanStoryboardNarrativeSourceText(userIntentText);
|
|
4980
5062
|
const approvedScriptContext = cleanStoryboardNarrativeSourceText(canonicalStoryboardScriptContext(options.approvedScriptContext));
|
|
4981
|
-
const primarySourceBrief =
|
|
5063
|
+
const primarySourceBrief = selectStoryboardSourceBriefForCompile(options, userIntentText);
|
|
4982
5064
|
const sourceText = stripGenericStoryboardVisibleTextMetadata(sanitizeStoryboardExternalAudioReferences([
|
|
4983
5065
|
cleanStoryboardNarrativeSourceText(primarySourceBrief),
|
|
4984
5066
|
approvedScriptContext
|
|
@@ -5464,7 +5546,7 @@ export function compileVideoStoryboardImagePrompt(options) {
|
|
|
5464
5546
|
const project = buildStoryboardProject(options);
|
|
5465
5547
|
const compiledFrameCount = Math.max(1, options.frameCount || project.scenes.length);
|
|
5466
5548
|
const layout = storyboardLayoutSpecFromProject(project, compiledFrameCount);
|
|
5467
|
-
const selectedBrief =
|
|
5549
|
+
const selectedBrief = selectStoryboardSourceBriefForCompile(options, userIntentText);
|
|
5468
5550
|
const avoidSource = buildStoryboardUserConstraintSource(cleanStoryboardNarrativeSourceText(userIntentText), cleanStoryboardNarrativeSourceText(selectedBrief), options);
|
|
5469
5551
|
const boardSizeLine = layout.boardDimensions
|
|
5470
5552
|
? `Overall storyboard canvas: ${layout.boardDimensions} pixels (${layout.boardAspectRatio}).`
|