@xiaohhhh1/canvas-agent 0.4.53 → 0.4.54
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type JsonSchema = Record<string, unknown>;
|
|
2
|
-
export declare const FLOW_C_CREATIVE_CANDIDATE_CONTRACT_VERSION = "flow-c-creative-candidates-
|
|
2
|
+
export declare const FLOW_C_CREATIVE_CANDIDATE_CONTRACT_VERSION = "flow-c-creative-candidates-v2";
|
|
3
3
|
export declare function flowCCreativeCandidateOutputSchema(count: number): JsonSchema;
|
|
4
4
|
export declare function parseFlowCCreativeCandidateOutput(value: string, expectedOrdinals: number[]): Record<string, unknown>[];
|
|
5
5
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assertStrictResponseSchema } from './script-output.js';
|
|
2
|
-
export const FLOW_C_CREATIVE_CANDIDATE_CONTRACT_VERSION = 'flow-c-creative-candidates-
|
|
2
|
+
export const FLOW_C_CREATIVE_CANDIDATE_CONTRACT_VERSION = 'flow-c-creative-candidates-v2';
|
|
3
3
|
const text = { type: 'string', minLength: 1 };
|
|
4
4
|
function object(properties) {
|
|
5
5
|
return { type: 'object', properties, required: Object.keys(properties), additionalProperties: false };
|
|
@@ -17,6 +17,13 @@ function candidateSchema() {
|
|
|
17
17
|
truthBoundary: text,
|
|
18
18
|
riskFlags: { type: 'array', minItems: 0, maxItems: 8, items: text },
|
|
19
19
|
firstFrame: text,
|
|
20
|
+
firstFrameFocus: text,
|
|
21
|
+
visualContrast: text,
|
|
22
|
+
sensoryTexture: text,
|
|
23
|
+
motionPeak: text,
|
|
24
|
+
compositionLighting: text,
|
|
25
|
+
localNativeDetail: text,
|
|
26
|
+
antiFlatness: text,
|
|
20
27
|
creativeFingerprint: object({
|
|
21
28
|
characterRelation: text,
|
|
22
29
|
scene: text,
|
|
@@ -20,20 +20,19 @@ type ScriptRecord = {
|
|
|
20
20
|
updatedAt: string;
|
|
21
21
|
};
|
|
22
22
|
type ReferenceStyleCard = {
|
|
23
|
+
id?: unknown;
|
|
23
24
|
visualPremisePattern?: unknown;
|
|
24
25
|
mutationAxes?: unknown;
|
|
25
26
|
culturePattern?: unknown;
|
|
26
27
|
spectaclePattern?: unknown;
|
|
27
28
|
productIntegrationPattern?: unknown;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
rhythm?: unknown;
|
|
33
|
-
turn?: unknown;
|
|
34
|
-
proofMethod?: unknown;
|
|
29
|
+
openingPattern?: unknown;
|
|
30
|
+
proofPattern?: unknown;
|
|
31
|
+
rhythmPattern?: unknown;
|
|
32
|
+
capturePattern?: unknown;
|
|
35
33
|
voiceTone?: unknown;
|
|
36
|
-
|
|
34
|
+
sourceEvidenceTier?: unknown;
|
|
35
|
+
truthBoundaries?: unknown;
|
|
37
36
|
applicability?: {
|
|
38
37
|
markets?: unknown;
|
|
39
38
|
categories?: unknown;
|
|
@@ -60,6 +59,13 @@ type SelectedCandidate = {
|
|
|
60
59
|
truthBoundary: string;
|
|
61
60
|
riskFlags: string[];
|
|
62
61
|
firstFrame: string;
|
|
62
|
+
firstFrameFocus: string;
|
|
63
|
+
visualContrast: string;
|
|
64
|
+
sensoryTexture: string;
|
|
65
|
+
motionPeak: string;
|
|
66
|
+
compositionLighting: string;
|
|
67
|
+
localNativeDetail: string;
|
|
68
|
+
antiFlatness: string;
|
|
63
69
|
creativeFingerprint: Record<string, string>;
|
|
64
70
|
fingerprintKey?: string;
|
|
65
71
|
selectionScore?: number;
|
package/dist/workflow/manager.js
CHANGED
|
@@ -583,7 +583,7 @@ export function scriptChunkPrompt(id, task, ordinals) {
|
|
|
583
583
|
${compactJson([...selected.values()], 16_000)}
|
|
584
584
|
${durationRules}
|
|
585
585
|
写作要求:
|
|
586
|
-
1. visualHook、conflict、escalation/turn、productIntervention、visibleProof、callbackMotivation 与所有 shots 必须执行选中卡的 visualPremise、firstFrame、spectacleEscalation、productProofAction
|
|
586
|
+
1. visualHook、conflict、escalation/turn、productIntervention、visibleProof、callbackMotivation 与所有 shots 必须执行选中卡的 visualPremise、firstFrame、spectacleEscalation、productProofAction、truthBoundary 以及七项视觉执行字段;不得扩大功效、稀释构图或换成普通模板。
|
|
587
587
|
2. 每条生成一份稳定 voiceProfile;每段只写简短 voiceCue。口播必须是目标市场 ${task.market} 的自然原生语言、偏快但清晰;导演说明统一用简洁制作英文。
|
|
588
588
|
3. 每段永远是独立 0–10 秒,含 1–8 个按剧情需要决定的 shots、准确 voiceover、onScreenText、evidence、soundBgm、emotionalNote 与 endingState;模型不要输出 continuity 或 continuityMode。
|
|
589
589
|
4. shot.visual 要直接写出主体位置、景别、光线、材质、动作峰值和当地自然环境,并保留真实皮肤、细发、布料/商品微纹理和实景混合光;禁止塑料蜡感、静态举产品、品牌广告片、电视购物或伪造工厂/销量/来源。
|
|
@@ -601,13 +601,14 @@ Optional learned style abstractions: ${compactJson(styleCards, 5_000)}
|
|
|
601
601
|
Already accepted fingerprint ledger: ${compactJson(ledger, 8_000)}
|
|
602
602
|
For each ordinal return exactly 6 short, auditable candidate cards. These are visible structured alternatives, not hidden reasoning. Vary the overall creative skeleton through open dimensions such as relationship/identity, scene mismatch, scale/quantity, group reaction, viewpoint, sensory texture and proof action; do not rotate a fixed template list.
|
|
603
603
|
Every card must be surprising but physically filmable and product-relevant. productProofAction and truthBoundary must follow supplied facts. For food, baby, medical/efficacy and personal-hygiene products, reject unhygienic display, fear marketing, dangerous use and unsupported promises.
|
|
604
|
+
Every card must also contain a concrete visual execution card, not mood adjectives: firstFrameFocus names one dominant subject and its approximate 35%-85% frame share; visualContrast defines one readable scale/color/light/relationship contrast; sensoryTexture names truthful category-specific material evidence; motionPeak names the single peak physical instant; compositionLighting specifies foreground/midground/background, practical light direction and one plausible exposure/optical imperfection; localNativeDetail names observable local behavior/environment/aesthetic density with the same evidence discipline as culturalAnchors; antiFlatness names the exact generic catalogue treatment this concept must avoid. The firstFrame must pass a screenshot test: even without dialogue, a still image must show the unusual relationship, product relevance and depth hierarchy.
|
|
604
605
|
Cultural anchors are optional (0–3). source must be learned-style-card, product-market-evidence, or conservative-everyday-detail. A learned-style-card anchor must cite the supplied card id in evidence. A product-market-evidence anchor must cite a concrete supplied product/market fact; if none exists, use conservative-everyday-detail and explicitly say it is ordinary context, not a custom claim. Never use flags, national costumes, royalty/public figures, religion, stereotypes or cultural mockery as shortcut hooks. Locality belongs in consumption context, natural interaction, language rhythm and aesthetic density.
|
|
605
606
|
creativeFingerprint must use five concise semantic labels: characterRelation, scene, firstFrameComposition, spectacleMechanism and proofMethod. Do not hide duplicate ideas behind paraphrases. Do not copy people, clothing, sets, dialogue or shot sequences from references. Return only the candidate schema; do not write scripts or call tools.`;
|
|
606
607
|
}
|
|
607
608
|
function compactReferenceStyleCard(value) {
|
|
608
609
|
if (!value || typeof value !== "object")
|
|
609
610
|
return "";
|
|
610
|
-
const fields = ["visualPremisePattern", "mutationAxes", "culturePattern", "spectaclePattern", "productIntegrationPattern", "
|
|
611
|
+
const fields = ["id", "visualPremisePattern", "mutationAxes", "culturePattern", "spectaclePattern", "productIntegrationPattern", "openingPattern", "proofPattern", "rhythmPattern", "capturePattern", "voiceTone", "sourceEvidenceTier"];
|
|
611
612
|
const compact = Object.fromEntries(fields.flatMap((field) => {
|
|
612
613
|
const text = String(value[field] || "").trim().replace(/\s+/g, " ").slice(0, 400);
|
|
613
614
|
return text ? [[field, text]] : [];
|
|
@@ -616,7 +617,7 @@ function compactReferenceStyleCard(value) {
|
|
|
616
617
|
const markets = Array.isArray(value.applicability?.markets) ? value.applicability.markets.map((item) => String(item || "").trim()).filter(Boolean).slice(0, 8) : [];
|
|
617
618
|
if (categories.length || markets.length)
|
|
618
619
|
Object.assign(compact, { applicability: { categories, markets } });
|
|
619
|
-
return Object.keys(compact).length ?
|
|
620
|
+
return Object.keys(compact).length ? compact : null;
|
|
620
621
|
}
|
|
621
622
|
function relevantStyleCards(cards, products) {
|
|
622
623
|
const categories = new Set(products.map((product) => String(product.category || "").trim().toLowerCase()).filter(Boolean));
|
|
@@ -654,11 +655,19 @@ function selectedCandidatePlan(value) {
|
|
|
654
655
|
truthBoundary: value.truthBoundary,
|
|
655
656
|
riskFlags: value.riskFlags,
|
|
656
657
|
firstFrame: value.firstFrame,
|
|
658
|
+
firstFrameFocus: value.firstFrameFocus,
|
|
659
|
+
visualContrast: value.visualContrast,
|
|
660
|
+
sensoryTexture: value.sensoryTexture,
|
|
661
|
+
motionPeak: value.motionPeak,
|
|
662
|
+
compositionLighting: value.compositionLighting,
|
|
663
|
+
localNativeDetail: value.localNativeDetail,
|
|
664
|
+
antiFlatness: value.antiFlatness,
|
|
657
665
|
creativeFingerprint: value.creativeFingerprint,
|
|
658
666
|
fingerprintKey: value.fingerprintKey,
|
|
659
667
|
selectionScore: value.selectionScore,
|
|
660
668
|
selectionBreakdown: value.selectionBreakdown,
|
|
661
669
|
selectionMode: value.selectionMode,
|
|
670
|
+
visualExecutionVersion: "flow-c-visual-execution-v1",
|
|
662
671
|
};
|
|
663
672
|
}
|
|
664
673
|
function chunkNumbers(values, size) {
|