@xiaohhhh1/canvas-agent 0.4.59 → 0.4.61
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-v3";
|
|
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-v3';
|
|
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 };
|
|
@@ -14,6 +14,7 @@ function candidateSchema() {
|
|
|
14
14
|
},
|
|
15
15
|
spectacleEscalation: text,
|
|
16
16
|
productProofAction: text,
|
|
17
|
+
purchaseReason: text,
|
|
17
18
|
truthBoundary: text,
|
|
18
19
|
riskFlags: { type: 'array', minItems: 0, maxItems: 8, items: text },
|
|
19
20
|
firstFrame: text,
|
package/dist/workflow/manager.js
CHANGED
|
@@ -644,12 +644,13 @@ export function scriptChunkPrompt(id, task, ordinals) {
|
|
|
644
644
|
${compactJson([...selected.values()], 16_000)}
|
|
645
645
|
${durationRules}
|
|
646
646
|
写作要求:
|
|
647
|
-
1. visualHook、conflict、escalation/turn、productIntervention、visibleProof、callbackMotivation 与所有 shots 必须执行选中卡的 visualPremise、firstFrame、spectacleEscalation、productProofAction、truthBoundary 以及七项视觉执行字段;不得扩大功效、稀释构图或换成普通模板。
|
|
647
|
+
1. visualHook、conflict、escalation/turn、productIntervention、visibleProof、purchaseReason、callbackMotivation 与所有 shots 必须执行选中卡的 visualPremise、firstFrame、spectacleEscalation、productProofAction、purchaseReason、truthBoundary 以及七项视觉执行字段;不得扩大功效、稀释构图或换成普通模板。productProofAction 必须同时写清一个真实动作及其镜头内可见结果;purchaseReason 只解释该结果为何值得目标用户购买,不能变成泛泛 CTA。
|
|
648
|
+
1a. executionBindings 必须逐项指出 opening、proof、purchaseReason 和七项 visualExecution 实际落在哪个 segment/shot;executedAs 必须同时忠实对应 selected candidate 原要求和该 shot 的真实内容。opening 必须包含 segment 1 shot 1。它是可审计索引,不是新增剧情,也不能把未执行的要求写成已执行。
|
|
648
649
|
2. 每条生成一份稳定 voiceProfile;每段只写简短 voiceCue。口播必须是目标市场 ${task.market} 的自然原生语言、偏快但清晰;导演说明统一用简洁制作英文。
|
|
649
650
|
3. 每段永远是独立 0–10 秒,含 1–8 个按剧情需要决定的 shots、准确 voiceover、onScreenText、evidence、soundBgm、emotionalNote 与 endingState;模型不要输出 continuity 或 continuityMode。
|
|
650
651
|
4. shot.visual 要直接写出主体位置、景别、光线、材质、动作峰值和当地自然环境,并保留真实皮肤、细发、布料/商品微纹理和实景混合光;禁止塑料蜡感、静态举产品、品牌广告片、电视购物或伪造工厂/销量/来源。
|
|
651
652
|
5. 20/30 秒的后一段剧情承接前段 endingState,但每段仍只使用自己的局部 0–10 秒执行内容。
|
|
652
|
-
6. creativePlan 只写 format、visualHook、conflict、escalation/turn、productIntervention、visibleProof、callbackMotivation 与 differentiationKey。Agent 会把选中卡的构图、材质、光线、文化、真实性边界和 fingerprint
|
|
653
|
+
6. creativePlan 只写 format、visualHook、conflict、escalation/turn、productIntervention、visibleProof、purchaseReason、callbackMotivation 与 differentiationKey。callbackMotivation 必须自然回扣开场与已经展示的 purchaseReason;禁止编造折扣、库存、销量、价格或未提供的量化功效。Agent 会把选中卡的构图、材质、光线、文化、真实性边界和 fingerprint 确定性并回,中心会程序化计算质量门;模型不要重复这些字段。若 selected candidate 的 selectionMode=user-framework,用户原框架的开头、事件顺序、核心剧情和结尾是最高权威;只补真实证明、局部时序和执行细节,不得改成另一个创意。
|
|
653
654
|
固定使用 GPT-5.6 Terra 高推理。storyboardLayoutVersion=${layoutVersion} 仅由中心管理。只返回当前结构化 jobs,不调用工具、不创建任何图片或视频任务。`;
|
|
654
655
|
}
|
|
655
656
|
export function creativeCandidatePrompt(id, task, ordinals) {
|
|
@@ -661,7 +662,7 @@ Market: ${task.market}. Product facts: ${compactJson(products, 12_000)}
|
|
|
661
662
|
Optional learned style abstractions: ${compactJson(styleCards, 5_000)}
|
|
662
663
|
Already accepted fingerprint ledger: ${compactJson(ledger, 8_000)}
|
|
663
664
|
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.
|
|
664
|
-
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.
|
|
665
|
+
Every card must be surprising but physically filmable and product-relevant. productProofAction must state one truthful intended-use action and the observable result that remains visible in the same scene. purchaseReason must state one concrete reason the supported result matters to a real target buyer; it is not a generic CTA and must not invent price, discount, scarcity, sales, inventory or unsupported quantified performance. productProofAction, purchaseReason 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.
|
|
665
666
|
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.
|
|
666
667
|
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.
|
|
667
668
|
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.`;
|
|
@@ -713,6 +714,7 @@ function selectedCandidatePlan(value) {
|
|
|
713
714
|
culturalAnchors: value.culturalAnchors,
|
|
714
715
|
spectacleEscalation: value.spectacleEscalation,
|
|
715
716
|
productProofAction: value.productProofAction,
|
|
717
|
+
purchaseReason: value.purchaseReason,
|
|
716
718
|
truthBoundary: value.truthBoundary,
|
|
717
719
|
riskFlags: value.riskFlags,
|
|
718
720
|
firstFrame: value.firstFrame,
|
|
@@ -31,11 +31,30 @@ function creativePlanSchema() {
|
|
|
31
31
|
turn: nullableText,
|
|
32
32
|
productIntervention: text,
|
|
33
33
|
visibleProof: text,
|
|
34
|
+
purchaseReason: text,
|
|
34
35
|
callbackMotivation: text,
|
|
35
36
|
differentiationKey: text,
|
|
36
37
|
};
|
|
37
38
|
return object(properties);
|
|
38
39
|
}
|
|
40
|
+
function executionBindingSchema() {
|
|
41
|
+
return object({
|
|
42
|
+
segmentIndex: { type: "integer", minimum: 1, maximum: 3 },
|
|
43
|
+
shotIndexes: { type: "array", minItems: 1, maxItems: 8, items: { type: "integer", minimum: 1, maximum: 8 } },
|
|
44
|
+
executedAs: text,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function executionBindingsSchema() {
|
|
48
|
+
return object({
|
|
49
|
+
opening: executionBindingSchema(),
|
|
50
|
+
proof: executionBindingSchema(),
|
|
51
|
+
purchaseReason: executionBindingSchema(),
|
|
52
|
+
visualExecution: object(Object.fromEntries([
|
|
53
|
+
"firstFrameFocus", "visualContrast", "sensoryTexture", "motionPeak",
|
|
54
|
+
"compositionLighting", "localNativeDetail", "antiFlatness",
|
|
55
|
+
].map((field) => [field, executionBindingSchema()]))),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
39
58
|
function segmentSchema() {
|
|
40
59
|
return object({
|
|
41
60
|
voiceCue: text,
|
|
@@ -64,6 +83,7 @@ export function flowCScriptOutputSchema(durationSeconds, count) {
|
|
|
64
83
|
productIndex: { type: "integer", minimum: 0 },
|
|
65
84
|
sellingFormId: text,
|
|
66
85
|
creativePlan: creativePlanSchema(),
|
|
86
|
+
executionBindings: executionBindingsSchema(),
|
|
67
87
|
voiceProfile: voiceProfileSchema(),
|
|
68
88
|
openingState: openingStateSchema(),
|
|
69
89
|
};
|