@nodetool-ai/project-services 0.8.9-beta.2 → 0.8.9-beta.5
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/.nodetool-build-stamp +1 -1
- package/dist/asset-autosave.d.ts +80 -0
- package/dist/asset-autosave.d.ts.map +1 -0
- package/dist/asset-autosave.js +456 -0
- package/dist/asset-autosave.js.map +1 -0
- package/dist/example-catalog.d.ts +11 -0
- package/dist/example-catalog.d.ts.map +1 -0
- package/dist/example-catalog.js +154 -0
- package/dist/example-catalog.js.map +1 -0
- package/dist/example-thumbnail.d.ts +21 -0
- package/dist/example-thumbnail.d.ts.map +1 -0
- package/dist/example-thumbnail.js +50 -0
- package/dist/example-thumbnail.js.map +1 -0
- package/dist/example-workflows.d.ts +22 -0
- package/dist/example-workflows.d.ts.map +1 -0
- package/dist/example-workflows.js +141 -0
- package/dist/example-workflows.js.map +1 -0
- package/dist/examples/nodetool-base/50 Ad Variants Overnight.json +270 -0
- package/dist/examples/nodetool-base/A Campaign Concept from a Brief.json +135 -0
- package/dist/examples/nodetool-base/A Gradient Card as PNG.json +128 -0
- package/dist/examples/nodetool-base/A Poster in Portrait.json +129 -0
- package/dist/examples/nodetool-base/A Repeating Texture Tile.json +129 -0
- package/dist/examples/nodetool-base/A Run Button for Any Job.json +152 -0
- package/dist/examples/nodetool-base/A Webhook That Answers.json +170 -0
- package/dist/examples/nodetool-base/AI Spokesperson.json +328 -0
- package/dist/examples/nodetool-base/Action Items from a Meeting Recording.json +198 -0
- package/dist/examples/nodetool-base/Ad Copy in Three Registers.json +135 -0
- package/dist/examples/nodetool-base/Ad Loop from a Product Photo.json +277 -0
- package/dist/examples/nodetool-base/Add Reverb to a Voice.json +125 -0
- package/dist/examples/nodetool-base/Album Art from a Mood.json +129 -0
- package/dist/examples/nodetool-base/Assemble a UGC Product Video.json +158 -0
- package/dist/examples/nodetool-base/Audio To Image.json +184 -0
- package/dist/examples/nodetool-base/B-Roll Reel from a Brief.json +339 -0
- package/dist/examples/nodetool-base/Batch a List.json +171 -0
- package/dist/examples/nodetool-base/Black and White, Hard.json +147 -0
- package/dist/examples/nodetool-base/Blog Post to Social Thread.json +135 -0
- package/dist/examples/nodetool-base/Blur a Channel.json +205 -0
- package/dist/examples/nodetool-base/Blur an Image.json +179 -0
- package/dist/examples/nodetool-base/Boost Saturation.json +178 -0
- package/dist/examples/nodetool-base/Brand Asset Generator.json +585 -0
- package/dist/examples/nodetool-base/Brand a UGC Product Video.json +402 -0
- package/dist/examples/nodetool-base/Bring a Still to Life.json +250 -0
- package/dist/examples/nodetool-base/Bullet Points to Press Release.json +135 -0
- package/dist/examples/nodetool-base/Camera Move Contact Sheet.json +210 -0
- package/dist/examples/nodetool-base/Camera Move.json +257 -0
- package/dist/examples/nodetool-base/Chapter Markers for a Long Recording.json +198 -0
- package/dist/examples/nodetool-base/Character in Any Scene.json +276 -0
- package/dist/examples/nodetool-base/Chat With Your Documents.json +569 -0
- package/dist/examples/nodetool-base/Chunk a Transcript for Indexing.json +202 -0
- package/dist/examples/nodetool-base/Circles and Lines.json +126 -0
- package/dist/examples/nodetool-base/Clean Up a Rough Voice Recording.json +208 -0
- package/dist/examples/nodetool-base/Clip on Kie.json +173 -0
- package/dist/examples/nodetool-base/Cold Outreach Co-Pilot.json +423 -0
- package/dist/examples/nodetool-base/Color Boost Video.json +250 -0
- package/dist/examples/nodetool-base/Compose Directed Campaign Formats.json +764 -0
- package/dist/examples/nodetool-base/Concept Art Iteration Board.json +439 -0
- package/dist/examples/nodetool-base/Concept Art, Then a Moving Version.json +173 -0
- package/dist/examples/nodetool-base/Conditional Logic Engine.json +535 -0
- package/dist/examples/nodetool-base/Consistent Cast Storyboard.json +330 -0
- package/dist/examples/nodetool-base/Count a List.json +168 -0
- package/dist/examples/nodetool-base/Count to Three with a Loop.json +157 -0
- package/dist/examples/nodetool-base/Crop an Image.json +181 -0
- package/dist/examples/nodetool-base/Crop then Fit.json +208 -0
- package/dist/examples/nodetool-base/Crush It to 8 Bits.json +123 -0
- package/dist/examples/nodetool-base/Cut Out the Subject.json +184 -0
- package/dist/examples/nodetool-base/Cut a Landscape Clip for Vertical.json +123 -0
- package/dist/examples/nodetool-base/Cut a Product Out of Its Background.json +238 -0
- package/dist/examples/nodetool-base/Data Generator.json +216 -0
- package/dist/examples/nodetool-base/Denoise Footage.json +178 -0
- package/dist/examples/nodetool-base/Direct a Short Film.json +305 -0
- package/dist/examples/nodetool-base/Directed Film to Timeline.json +385 -0
- package/dist/examples/nodetool-base/Does This Text Mention the Deadline.json +130 -0
- package/dist/examples/nodetool-base/Draft Answers for an FAQ.json +135 -0
- package/dist/examples/nodetool-base/Draw a Badge in SVG.json +126 -0
- package/dist/examples/nodetool-base/Drop Duplicates.json +170 -0
- package/dist/examples/nodetool-base/Drop the First Few.json +148 -0
- package/dist/examples/nodetool-base/Dub a Video into 5 Languages.json +285 -0
- package/dist/examples/nodetool-base/Dungeon and Ruins Starter Pack.json +786 -0
- package/dist/examples/nodetool-base/Edit a Still with Words.json +284 -0
- package/dist/examples/nodetool-base/Editorial Still from a Line.json +197 -0
- package/dist/examples/nodetool-base/Effects Gallery.json +189 -0
- package/dist/examples/nodetool-base/Emboss a Still.json +120 -0
- package/dist/examples/nodetool-base/Every Combination.json +225 -0
- package/dist/examples/nodetool-base/Every Hour, On the Hour.json +162 -0
- package/dist/examples/nodetool-base/Executive Summary of a Long Document.json +135 -0
- package/dist/examples/nodetool-base/Explainer Clip from a Paragraph.json +244 -0
- package/dist/examples/nodetool-base/Extract the Claims Worth Checking.json +135 -0
- package/dist/examples/nodetool-base/Fade Audio In and Out.json +203 -0
- package/dist/examples/nodetool-base/Fade Audio Out.json +202 -0
- package/dist/examples/nodetool-base/Fill a Template.json +149 -0
- package/dist/examples/nodetool-base/Find Every Number in a Sentence.json +127 -0
- package/dist/examples/nodetool-base/Find and Replace.json +224 -0
- package/dist/examples/nodetool-base/Find the Edges.json +123 -0
- package/dist/examples/nodetool-base/Fit an Image.json +179 -0
- package/dist/examples/nodetool-base/Five Headlines for a Landing Page.json +135 -0
- package/dist/examples/nodetool-base/Flashcard Generator.json +297 -0
- package/dist/examples/nodetool-base/Gate Out the Room Noise.json +124 -0
- package/dist/examples/nodetool-base/Generate a Native-Audio UGC Testimonial.json +276 -0
- package/dist/examples/nodetool-base/Generate a Silent Bed.json +126 -0
- package/dist/examples/nodetool-base/Generate then Upscale a Poster.json +164 -0
- package/dist/examples/nodetool-base/Hacker News Agent.json +183 -0
- package/dist/examples/nodetool-base/Hook & Thumbnail Factory.json +498 -0
- package/dist/examples/nodetool-base/How Long Is This Transcript.json +185 -0
- package/dist/examples/nodetool-base/Image Enhance.json +272 -0
- package/dist/examples/nodetool-base/Image To Audio Story.json +180 -0
- package/dist/examples/nodetool-base/Image to Video Animation.json +346 -0
- package/dist/examples/nodetool-base/Inspect a Clip's Audio.json +187 -0
- package/dist/examples/nodetool-base/Inspect a Clip.json +163 -0
- package/dist/examples/nodetool-base/Invert a Still.json +120 -0
- package/dist/examples/nodetool-base/Keep Only the Long Lines.json +220 -0
- package/dist/examples/nodetool-base/Keep Only the Matches.json +148 -0
- package/dist/examples/nodetool-base/Key Out a Green Screen.json +124 -0
- package/dist/examples/nodetool-base/Last One Wins.json +144 -0
- package/dist/examples/nodetool-base/Lens and Look.json +327 -0
- package/dist/examples/nodetool-base/Lip-sync a Clip to a Voice Track.json +313 -0
- package/dist/examples/nodetool-base/Localise a Product Listing.json +135 -0
- package/dist/examples/nodetool-base/Localise a Script and Revoice It.json +242 -0
- package/dist/examples/nodetool-base/Localized Explainer.json +430 -0
- package/dist/examples/nodetool-base/Low-poly Adventure Starter Pack.json +786 -0
- package/dist/examples/nodetool-base/Low-poly Seaside Starter Pack.json +786 -0
- package/dist/examples/nodetool-base/Master a Voice Track.json +180 -0
- package/dist/examples/nodetool-base/Meeting Transcript Summarizer.json +524 -0
- package/dist/examples/nodetool-base/Model Arena.json +550 -0
- package/dist/examples/nodetool-base/Moodboard Frame from a Theme.json +129 -0
- package/dist/examples/nodetool-base/Movie Posters.json +660 -0
- package/dist/examples/nodetool-base/Movie Trailer Generator.json +418 -0
- package/dist/examples/nodetool-base/Music Video Visualizer.json +720 -0
- package/dist/examples/nodetool-base/Name a File from Its Narration.json +231 -0
- package/dist/examples/nodetool-base/Narrate a Script.json +169 -0
- package/dist/examples/nodetool-base/Narration with a Music Bed.json +360 -0
- package/dist/examples/nodetool-base/Normalize a Clip's Audio.json +201 -0
- package/dist/examples/nodetool-base/One Tagline, Six Markets.json +135 -0
- package/dist/examples/nodetool-base/Pad a Canvas.json +188 -0
- package/dist/examples/nodetool-base/Per-SKU Ad Factory.json +511 -0
- package/dist/examples/nodetool-base/Photo Enhancement Suite.json +417 -0
- package/dist/examples/nodetool-base/Picture in Picture.json +231 -0
- package/dist/examples/nodetool-base/Pitch a Voice Up.json +122 -0
- package/dist/examples/nodetool-base/Pixelate a Still.json +122 -0
- package/dist/examples/nodetool-base/Platformer Playground Starter Pack.json +786 -0
- package/dist/examples/nodetool-base/Podcast Episode to Show Notes.json +198 -0
- package/dist/examples/nodetool-base/Podcast Repurposing Studio.json +745 -0
- package/dist/examples/nodetool-base/Pokemon Maker.json +282 -0
- package/dist/examples/nodetool-base/Poster on Kie.json +172 -0
- package/dist/examples/nodetool-base/Posterize to Four Bits.json +122 -0
- package/dist/examples/nodetool-base/Private Assistant.json +236 -0
- package/dist/examples/nodetool-base/Product Mockup Generator.json +608 -0
- package/dist/examples/nodetool-base/Product Spot from Text.json +330 -0
- package/dist/examples/nodetool-base/Product URL to CGI Commercial.json +289 -0
- package/dist/examples/nodetool-base/Product URL to UGC Ad.json +298 -0
- package/dist/examples/nodetool-base/Product Video Generator.json +344 -0
- package/dist/examples/nodetool-base/Prompt Template.json +221 -0
- package/dist/examples/nodetool-base/Propose Three Campaign Directions.json +614 -0
- package/dist/examples/nodetool-base/Pull a Field out of JSON Text.json +128 -0
- package/dist/examples/nodetool-base/Pull a Still from a Clip.json +179 -0
- package/dist/examples/nodetool-base/Pull the Quotable Lines Out of an Interview.json +198 -0
- package/dist/examples/nodetool-base/Put a Product on a Studio Backdrop.json +252 -0
- package/dist/examples/nodetool-base/Put a Voice Over a Music Bed.json +358 -0
- package/dist/examples/nodetool-base/README_EXAMPLES.md +59 -0
- package/dist/examples/nodetool-base/Re-delimit a List.json +199 -0
- package/dist/examples/nodetool-base/Read a Clip's Frame Rate.json +120 -0
- package/dist/examples/nodetool-base/Redact Email Addresses.json +129 -0
- package/dist/examples/nodetool-base/Redact and Tidy a Log Line.json +266 -0
- package/dist/examples/nodetool-base/Relight a Product for a Seasonal Campaign.json +131 -0
- package/dist/examples/nodetool-base/Render a Directed Campaign Hero.json +338 -0
- package/dist/examples/nodetool-base/Reopen a Directed Campaign.json +1748 -0
- package/dist/examples/nodetool-base/Research Agent.json +231 -0
- package/dist/examples/nodetool-base/Research a Brand from Its Website.json +445 -0
- package/dist/examples/nodetool-base/Restyle a Photo as an Illustration.json +136 -0
- package/dist/examples/nodetool-base/Reverse Audio.json +201 -0
- package/dist/examples/nodetool-base/Reverse a Clip.json +176 -0
- package/dist/examples/nodetool-base/Revise an Accepted Campaign Hero.json +486 -0
- package/dist/examples/nodetool-base/Rewrite This So a Customer Understands It.json +135 -0
- package/dist/examples/nodetool-base/Rotate Footage.json +178 -0
- package/dist/examples/nodetool-base/SEO Content Engine.json +708 -0
- package/dist/examples/nodetool-base/SEO Title and Meta Description.json +135 -0
- package/dist/examples/nodetool-base/Sci-fi Game Model Starter Pack.json +693 -0
- package/dist/examples/nodetool-base/Sci-fi Outpost Expansion.json +601 -0
- package/dist/examples/nodetool-base/Score a Clip from Its Own Mood.json +229 -0
- package/dist/examples/nodetool-base/Score a Silent Clip.json +382 -0
- package/dist/examples/nodetool-base/Script to Narrated Clip.json +224 -0
- package/dist/examples/nodetool-base/Script to Screen.json +940 -0
- package/dist/examples/nodetool-base/Sharpen Footage.json +179 -0
- package/dist/examples/nodetool-base/Shot List from a Synopsis.json +136 -0
- package/dist/examples/nodetool-base/Single Shot from a Line.json +199 -0
- package/dist/examples/nodetool-base/Slice Text.json +159 -0
- package/dist/examples/nodetool-base/Slow a Clip Without Dropping Pitch.json +122 -0
- package/dist/examples/nodetool-base/Soften a Plate.json +178 -0
- package/dist/examples/nodetool-base/Solarize a Still.json +122 -0
- package/dist/examples/nodetool-base/Speak a Line, Then Trim the Silence.json +157 -0
- package/dist/examples/nodetool-base/Spin a Packshot into a Turntable Clip.json +137 -0
- package/dist/examples/nodetool-base/Split a Channel.json +178 -0
- package/dist/examples/nodetool-base/Split a Log into Records.json +128 -0
- package/dist/examples/nodetool-base/Stabilize Handheld.json +179 -0
- package/dist/examples/nodetool-base/Still on Replicate.json +172 -0
- package/dist/examples/nodetool-base/Subject Lines Worth Testing.json +135 -0
- package/dist/examples/nodetool-base/Subtitle Lines from a Script.json +170 -0
- package/dist/examples/nodetool-base/Subtitle Text from a Recording.json +198 -0
- package/dist/examples/nodetool-base/Summarise a Recorded Call.json +198 -0
- package/dist/examples/nodetool-base/Swirl and Echo.json +154 -0
- package/dist/examples/nodetool-base/Take While the Numbers Are Small.json +148 -0
- package/dist/examples/nodetool-base/Take a Product Shot to Print Resolution.json +209 -0
- package/dist/examples/nodetool-base/Take the First Few Seconds of a Bed.json +127 -0
- package/dist/examples/nodetool-base/Take the First Few.json +170 -0
- package/dist/examples/nodetool-base/Talking Avatar from a Photo and a Script.json +252 -0
- package/dist/examples/nodetool-base/Telephone Voice.json +174 -0
- package/dist/examples/nodetool-base/Themes Across Customer Feedback.json +135 -0
- package/dist/examples/nodetool-base/Three Ratios.json +315 -0
- package/dist/examples/nodetool-base/Tidy Up Messy Text.json +199 -0
- package/dist/examples/nodetool-base/Top-down Native Asset Pack.json +955 -0
- package/dist/examples/nodetool-base/Trailer Beats from a Premise.json +136 -0
- package/dist/examples/nodetool-base/Train a Character.json +243 -0
- package/dist/examples/nodetool-base/Transcribe Audio.json +138 -0
- package/dist/examples/nodetool-base/Transcribe a Clip.json +198 -0
- package/dist/examples/nodetool-base/Translate Marketing Copy to German.json +135 -0
- package/dist/examples/nodetool-base/Translate a Script for Dubbing.json +224 -0
- package/dist/examples/nodetool-base/Trim Audio to a Range.json +203 -0
- package/dist/examples/nodetool-base/Trim a Blurb to Length.json +128 -0
- package/dist/examples/nodetool-base/Trim a Clip.json +180 -0
- package/dist/examples/nodetool-base/Turn Research Notes into a Comparison Table.json +136 -0
- package/dist/examples/nodetool-base/Turn Specs into Product Copy.json +135 -0
- package/dist/examples/nodetool-base/Turn a Changelog into Release Notes.json +135 -0
- package/dist/examples/nodetool-base/Turn a Logo into Print-Ready Vector.json +126 -0
- package/dist/examples/nodetool-base/Turn a Support Thread into a Bug Report.json +135 -0
- package/dist/examples/nodetool-base/Turn a Talk into a Blog Post.json +198 -0
- package/dist/examples/nodetool-base/Upscale a Still.json +186 -0
- package/dist/examples/nodetool-base/Vectorize a Generated Logo.json +162 -0
- package/dist/examples/nodetool-base/Video Restyle Studio.json +281 -0
- package/dist/examples/nodetool-base/Vignette a Portrait.json +124 -0
- package/dist/examples/nodetool-base/Voice a Script in Two Voices.json +217 -0
- package/dist/examples/nodetool-base/Warm Up a Cold Clip.json +124 -0
- package/dist/examples/nodetool-base/Watch a Folder, Act on What Lands.json +177 -0
- package/dist/examples/nodetool-base/Widen a Mono Voice.json +151 -0
- package/dist/examples/nodetool-base/Workflow As A Tool.json +257 -0
- package/dist/examples/nodetool-base/Write a Listing from the Product Photo.json +139 -0
- package/dist/examples/nodetool-base/Write the Prompt, Then Make the Image.json +200 -0
- package/dist/examples/nodetool-base/gallery_thumbnail_generator.ts +384 -0
- package/dist/mcp-tool-host-deps.d.ts +29 -0
- package/dist/mcp-tool-host-deps.d.ts.map +1 -0
- package/dist/mcp-tool-host-deps.js +69 -0
- package/dist/mcp-tool-host-deps.js.map +1 -0
- package/dist/package-assets.d.ts +41 -0
- package/dist/package-assets.d.ts.map +1 -0
- package/dist/package-assets.js +155 -0
- package/dist/package-assets.js.map +1 -0
- package/dist/project-delete.d.ts +14 -0
- package/dist/project-delete.d.ts.map +1 -0
- package/dist/project-delete.js +66 -0
- package/dist/project-delete.js.map +1 -0
- package/dist/worker-settings-env.d.ts +23 -0
- package/dist/worker-settings-env.d.ts.map +1 -0
- package/dist/worker-settings-env.js +47 -0
- package/dist/worker-settings-env.js.map +1 -0
- package/dist/workflow-runtime-environment.d.ts +20 -0
- package/dist/workflow-runtime-environment.d.ts.map +1 -0
- package/dist/workflow-runtime-environment.js +137 -0
- package/dist/workflow-runtime-environment.js.map +1 -0
- package/package.json +12 -8
|
@@ -0,0 +1,764 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "directed-campaign-layouts",
|
|
3
|
+
"access": "private",
|
|
4
|
+
"created_at": "2026-09-12T00:00:00.000Z",
|
|
5
|
+
"updated_at": "2026-09-12T00:00:00.000Z",
|
|
6
|
+
"name": "Compose Directed Campaign Formats",
|
|
7
|
+
"tool_name": null,
|
|
8
|
+
"description": "Lay one accepted hero out as finished 4:5 and 9:16 ads, as PNGs and editable SVGs, then export a portable campaign record. Ships with a sample hero and contract.",
|
|
9
|
+
"tags": [
|
|
10
|
+
"campaign",
|
|
11
|
+
"image",
|
|
12
|
+
"svg",
|
|
13
|
+
"example"
|
|
14
|
+
],
|
|
15
|
+
"thumbnail": null,
|
|
16
|
+
"thumbnail_url": null,
|
|
17
|
+
"graph": {
|
|
18
|
+
"nodes": [
|
|
19
|
+
{
|
|
20
|
+
"id": "intro",
|
|
21
|
+
"type": "nodetool.workflows.base_node.Comment",
|
|
22
|
+
"data": {
|
|
23
|
+
"comment": "# Compose Directed Campaign Formats\n\nBuilds 4:5 (1080x1350) and 9:16 (1080x1920) artboards from one accepted hero image, as PNGs and self-contained SVGs, and exports a portable campaign record. Use it as the final layout step of a directed campaign.\n\n**How it works:** \"Normalize app image\" checks \"Accepted hero\". \"Validate copy and build elements\" parses the JSON in \"Creative contract\", checks \"Version\" (original or revision), wraps the product name, headline and CTA to fit, and builds one SVG element tree per format: the hero fills the top and fades into a dark panel that carries a product tag, the headline and a CTA button. \"4:5 editable SVG\", \"4:5 PNG\", \"9:16 editable SVG\" and \"9:16 PNG\" render those trees. \"Wait, snapshot, and export\" waits for all four, places the hero photograph under each overlay with a cover crop, checks the PNG sizes, keeps \"Original record file\" unchanged when adding a revision, and writes directed-campaign.json. Its outputs feed the nine result nodes. It runs locally with no model. It ships with the coffee photo and a sample contract so Run works at once. In the Directed Campaign Kit app, the hero and contract come from the earlier steps.\n\n**Try this:** Run once with a hero and contract, then lengthen the headline in \"Creative contract\" and see the layout step stop with a message to shorten the copy."
|
|
24
|
+
},
|
|
25
|
+
"ui_properties": {
|
|
26
|
+
"position": {
|
|
27
|
+
"x": 0,
|
|
28
|
+
"y": 0
|
|
29
|
+
},
|
|
30
|
+
"width": 560,
|
|
31
|
+
"height": 403,
|
|
32
|
+
"selectable": true
|
|
33
|
+
},
|
|
34
|
+
"dynamic_properties": {}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "in-hero",
|
|
38
|
+
"type": "nodetool.input.ImageInput",
|
|
39
|
+
"data": {
|
|
40
|
+
"name": "hero",
|
|
41
|
+
"value": {
|
|
42
|
+
"type": "image",
|
|
43
|
+
"uri": "package://nodetool-base/recipe-inputs/coffee.jpg"
|
|
44
|
+
},
|
|
45
|
+
"description": "Accepted original or accepted revision hero."
|
|
46
|
+
},
|
|
47
|
+
"ui_properties": {
|
|
48
|
+
"position": {
|
|
49
|
+
"x": 0,
|
|
50
|
+
"y": 899
|
|
51
|
+
},
|
|
52
|
+
"width": 280,
|
|
53
|
+
"title": "Accepted hero"
|
|
54
|
+
},
|
|
55
|
+
"dynamic_properties": {},
|
|
56
|
+
"dynamic_outputs": {}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "in-contract",
|
|
60
|
+
"type": "nodetool.input.StringInput",
|
|
61
|
+
"data": {
|
|
62
|
+
"name": "contract",
|
|
63
|
+
"value": "{\"schemaVersion\": 1, \"kind\": \"hero\", \"brief\": {\"productName\": \"House Blend Coffee\", \"campaignMessage\": \"A small-batch house blend, roasted every week and shipped within two days of roasting.\", \"audience\": \"Home coffee drinkers who grind their own beans.\", \"headline\": \"Roasted this week, brewed this morning\", \"cta\": \"Order a bag\", \"referenceRole\": \"none\", \"referenceUse\": \"\", \"referenceIgnore\": \"\"}, \"selectedDirection\": {\"id\": \"B\", \"title\": \"First light at the counter\", \"setting\": \"A pale stone kitchen counter beside a tall window, with a burr grinder and a scattering of fresh beans just out of focus.\", \"composition\": \"The mug sits on the right third at eye level. Beans lead the eye from the lower left. The upper left stays open for the headline.\", \"lighting\": \"Low golden sunrise light from the left, with soft steam backlit above the cup and long, warm shadows.\", \"palette\": \"Cream ceramic, roasted brown, warm amber and a deep green shadow tone.\", \"preservationInstructions\": \"Keep the white espresso cup, its crema, the moka pot of ground coffee and the bean shapes exactly as in the product photo.\"}, \"copy\": {\"productName\": \"House Blend Coffee\", \"headline\": \"Roasted this week, brewed this morning\", \"cta\": \"Order a bag\"}, \"sourceOrder\": [\"product identity\"], \"render\": {\"aspectRatio\": \"16:9\", \"resolution\": \"1K\", \"prompt\": \"Sample contract shipped with the example. Run Render a Directed Campaign Hero to capture your own.\"}}",
|
|
64
|
+
"description": "Creative contract for this accepted hero.",
|
|
65
|
+
"line_mode": "multi_line"
|
|
66
|
+
},
|
|
67
|
+
"ui_properties": {
|
|
68
|
+
"position": {
|
|
69
|
+
"x": 0,
|
|
70
|
+
"y": 1115
|
|
71
|
+
},
|
|
72
|
+
"width": 280,
|
|
73
|
+
"title": "Creative contract"
|
|
74
|
+
},
|
|
75
|
+
"dynamic_properties": {},
|
|
76
|
+
"dynamic_outputs": {}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"id": "in-version",
|
|
80
|
+
"type": "nodetool.input.StringInput",
|
|
81
|
+
"data": {
|
|
82
|
+
"name": "version",
|
|
83
|
+
"value": "original",
|
|
84
|
+
"description": "original or revision."
|
|
85
|
+
},
|
|
86
|
+
"ui_properties": {
|
|
87
|
+
"position": {
|
|
88
|
+
"x": 0,
|
|
89
|
+
"y": 1340
|
|
90
|
+
},
|
|
91
|
+
"width": 280,
|
|
92
|
+
"title": "Version"
|
|
93
|
+
},
|
|
94
|
+
"dynamic_properties": {},
|
|
95
|
+
"dynamic_outputs": {}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "in-original_record",
|
|
99
|
+
"type": "nodetool.input.DocumentInput",
|
|
100
|
+
"data": {
|
|
101
|
+
"name": "original_record",
|
|
102
|
+
"value": {
|
|
103
|
+
"type": "document",
|
|
104
|
+
"uri": ""
|
|
105
|
+
},
|
|
106
|
+
"description": "Required unchanged portable original record when composing an accepted revision."
|
|
107
|
+
},
|
|
108
|
+
"ui_properties": {
|
|
109
|
+
"position": {
|
|
110
|
+
"x": 0,
|
|
111
|
+
"y": 1565
|
|
112
|
+
},
|
|
113
|
+
"width": 280,
|
|
114
|
+
"title": "Original record file"
|
|
115
|
+
},
|
|
116
|
+
"dynamic_properties": {},
|
|
117
|
+
"dynamic_outputs": {}
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"id": "layout-elements",
|
|
121
|
+
"type": "nodetool.code.Code",
|
|
122
|
+
"data": {
|
|
123
|
+
"code": "let contract;\ntry { contract = JSON.parse(String(inputs.contract ?? \"\")); } catch { throw new Error(\"The accepted creative contract is invalid.\"); }\nif (!contract || contract.schemaVersion !== 1 || !contract.copy || !contract.brief || !contract.selectedDirection) throw new Error(\"The accepted creative contract is incomplete.\");\nconst version = String(inputs.version ?? \"\").trim();\nif (![\"original\", \"revision\"].includes(version)) throw new Error(\"Version must be original or revision.\");\nif (version === \"original\" && contract.kind !== \"hero\") throw new Error(\"Original layouts require an accepted hero contract.\");\nif (version === \"revision\" && contract.kind !== \"revision\") throw new Error(\"Revision layouts require an accepted revision contract.\");\nconst heroBytes = await media.bytes(inputs.hero);\nconst heroInfo = await media.info(inputs.hero);\nconst allowedImageMimes = [\"image/png\", \"image/jpeg\", \"image/webp\", \"image/avif\"];\nif (!allowedImageMimes.includes(heroInfo.mimeType)) throw new Error(`Hero MIME type ${heroInfo.mimeType || \"unknown\"} is not supported.`);\nif (heroBytes.length === 0) throw new Error(\"The accepted hero is empty.\");\nconst exact = (name, value, max) => {\n if (typeof value !== \"string\" || value.length === 0) throw new Error(`${name} is required in the creative contract.`);\n if (value.length > max) throw new Error(`${name} must be ${max} characters or fewer before composing formats.`);\n return value;\n};\nconst productName = exact(\"Product name\", contract.copy.productName, 120);\nconst headline = exact(\"Headline\", contract.copy.headline, 120);\nconst cta = exact(\"CTA\", contract.copy.cta, 80);\nconst wrapExact = (value, maxColumns, maxLines, label) => {\n const lines = [];\n let remaining = value;\n while (remaining.length > 0) {\n const newline = remaining.indexOf(\"\\n\");\n if (newline >= 0 && newline < maxColumns) {\n lines.push(remaining.slice(0, newline + 1));\n remaining = remaining.slice(newline + 1);\n continue;\n }\n if (remaining.length <= maxColumns) { lines.push(remaining); remaining = \"\"; continue; }\n let cut = maxColumns;\n while (cut > 0 && !/\\s/.test(remaining[cut])) cut -= 1;\n if (cut === 0) throw new Error(`${label} contains a word longer than ${maxColumns} characters. Add a word break before composing formats.`);\n lines.push(remaining.slice(0, cut + 1));\n remaining = remaining.slice(cut + 1);\n }\n if (lines.length > maxLines) throw new Error(`${label} needs ${lines.length} lines but the layout supports ${maxLines}. Shorten the copy before composing formats.`);\n return lines;\n};\nconst font = \"Arial, Helvetica, sans-serif\";\nconst lines = (value, maxColumns, maxLines, label) => wrapExact(value, maxColumns, maxLines, label);\nconst textBlock = (x, y, size, lineHeight, rows, fill, extra = {}) => ({ name: \"text\", attributes: { x, y, fill, \"font-family\": font, \"font-size\": size, \"font-weight\": 600, \"xml:space\": \"preserve\", ...extra }, children: rows.map((line, index) => ({ name: \"tspan\", attributes: { x, dy: index === 0 ? 0 : lineHeight }, content: line })) });\nconst stop = (offset, color, opacity) => ({ name: \"stop\", attributes: { offset, \"stop-color\": color, \"stop-opacity\": opacity } });\n// The hero fills the top of the artboard and fades into a solid panel that\n// carries the copy, so the headline stays legible on any photograph. These\n// elements are the transparent overlay only: \"Wait, snapshot, and export\"\n// places the photograph in the hero slot, so the hero bytes never pass\n// through this node's outputs.\nconst artboard = (height, imageHeight, headlineColumns, headlineSize, id) => {\n const nameRows = lines(productName, 44, 2, \"Product name\");\n const headlineRows = lines(headline, headlineColumns, 4, \"Headline\");\n const ctaRows = lines(cta, 50, 2, \"CTA\");\n const ctaSize = 34, ctaLine = 42, ctaPad = 34;\n const ctaWidth = Math.min(920, Math.max(...ctaRows.map((row) => row.trimEnd().length)) * ctaSize * 0.58 + ctaPad * 2 + 52);\n const ctaHeight = ctaRows.length * ctaLine + 40;\n const ctaTop = height - 96 - ctaHeight;\n const headlineLine = Math.round(headlineSize * 1.16);\n const headlineBaseline = ctaTop - 72 - (headlineRows.length - 1) * headlineLine;\n const nameWidth = Math.min(920, Math.max(...nameRows.map((row) => row.trimEnd().length)) * 26 * 0.62 + 56);\n return [\n { name: \"metadata\", content: \"Directed Campaign Kit. System font fallback: Arial, Helvetica, sans-serif. The embedded photograph uses the accepted hero bytes.\" },\n { name: \"defs\", children: [\n { name: \"linearGradient\", attributes: { id: `${id}-fade`, x1: \"0\", y1: \"0\", x2: \"0\", y2: \"1\" }, children: [stop(\"0%\", \"#0f1512\", 0), stop(\"55%\", \"#0f1512\", 0.55), stop(\"100%\", \"#0f1512\", 1)] },\n { name: \"linearGradient\", attributes: { id: `${id}-top`, x1: \"0\", y1: \"0\", x2: \"0\", y2: \"1\" }, children: [stop(\"0%\", \"#0f1512\", 0.55), stop(\"100%\", \"#0f1512\", 0)] }\n ] },\n { name: \"g\", attributes: { id: \"hero-slot\", \"data-height\": imageHeight } },\n { name: \"rect\", attributes: { x: 0, y: 0, width: 1080, height: 260, fill: `url(#${id}-top)` } },\n { name: \"rect\", attributes: { x: 0, y: imageHeight * 0.45, width: 1080, height: imageHeight * 0.55 + 2, fill: `url(#${id}-fade)` } },\n { name: \"rect\", attributes: { x: 72, y: 64, width: nameWidth, height: nameRows.length * 34 + 30, rx: 24, fill: \"#0f1512\", \"fill-opacity\": 0.55, stroke: \"#f5efe2\", \"stroke-opacity\": 0.35 } },\n textBlock(100, 106, 26, 34, nameRows, \"#f5efe2\", { \"letter-spacing\": 1 }),\n { name: \"rect\", attributes: { x: 80, y: headlineBaseline - headlineSize - 40, width: 96, height: 6, rx: 3, fill: \"#d9a441\" } },\n textBlock(80, headlineBaseline, headlineSize, headlineLine, headlineRows, \"#ffffff\", { \"font-weight\": 700, \"letter-spacing\": -1 }),\n { name: \"rect\", attributes: { x: 80, y: ctaTop, width: ctaWidth, height: ctaHeight, rx: ctaHeight / 2 > 48 ? 32 : ctaHeight / 2, fill: \"#d9a441\" } },\n textBlock(80 + ctaPad, ctaTop + 20 + ctaSize - 4, ctaSize, ctaLine, ctaRows, \"#14110a\", { \"font-weight\": 700 }),\n { name: \"path\", attributes: { d: `M ${80 + ctaWidth - 66} ${ctaTop + ctaHeight / 2} h 30 m -12 -12 l 12 12 l -12 12`, fill: \"none\", stroke: \"#14110a\", \"stroke-width\": 4, \"stroke-linecap\": \"round\", \"stroke-linejoin\": \"round\" } }\n ];\n};\nawait output(\"portrait_elements\", artboard(1350, 1000, 30, 58, \"portrait\"));\nawait output(\"story_elements\", artboard(1920, 1380, 28, 64, \"story\"));\n"
|
|
124
|
+
},
|
|
125
|
+
"ui_properties": {
|
|
126
|
+
"position": {
|
|
127
|
+
"x": 800,
|
|
128
|
+
"y": 1111
|
|
129
|
+
},
|
|
130
|
+
"width": 500,
|
|
131
|
+
"title": "Validate copy and build elements"
|
|
132
|
+
},
|
|
133
|
+
"dynamic_properties": {
|
|
134
|
+
"hero": {
|
|
135
|
+
"type": "image",
|
|
136
|
+
"uri": ""
|
|
137
|
+
},
|
|
138
|
+
"contract": "",
|
|
139
|
+
"version": "original"
|
|
140
|
+
},
|
|
141
|
+
"dynamic_inputs": {
|
|
142
|
+
"hero": {
|
|
143
|
+
"type": {
|
|
144
|
+
"type": "any"
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"contract": {
|
|
148
|
+
"type": {
|
|
149
|
+
"type": "str"
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"version": {
|
|
153
|
+
"type": {
|
|
154
|
+
"type": "str"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"dynamic_outputs": {
|
|
159
|
+
"portrait_elements": {
|
|
160
|
+
"type": "list",
|
|
161
|
+
"type_args": [
|
|
162
|
+
{
|
|
163
|
+
"type": "svg_element",
|
|
164
|
+
"type_args": [],
|
|
165
|
+
"optional": false
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
"optional": false
|
|
169
|
+
},
|
|
170
|
+
"story_elements": {
|
|
171
|
+
"type": "list",
|
|
172
|
+
"type_args": [
|
|
173
|
+
{
|
|
174
|
+
"type": "svg_element",
|
|
175
|
+
"type_args": [],
|
|
176
|
+
"optional": false
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"optional": false
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"sync_mode": "on_all"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"id": "portrait-svg",
|
|
186
|
+
"type": "lib.svg.Document",
|
|
187
|
+
"data": {
|
|
188
|
+
"elements": [],
|
|
189
|
+
"width": 1080,
|
|
190
|
+
"height": 1350,
|
|
191
|
+
"viewBox": "0 0 1080 1350"
|
|
192
|
+
},
|
|
193
|
+
"ui_properties": {
|
|
194
|
+
"position": {
|
|
195
|
+
"x": 1400,
|
|
196
|
+
"y": 1394
|
|
197
|
+
},
|
|
198
|
+
"width": 280,
|
|
199
|
+
"title": "4:5 editable SVG"
|
|
200
|
+
},
|
|
201
|
+
"dynamic_properties": {},
|
|
202
|
+
"dynamic_outputs": {}
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"id": "portrait-png",
|
|
206
|
+
"type": "lib.svg.SVGToImage",
|
|
207
|
+
"data": {
|
|
208
|
+
"elements": [],
|
|
209
|
+
"width": 1080,
|
|
210
|
+
"height": 1350,
|
|
211
|
+
"viewBox": "0 0 1080 1350",
|
|
212
|
+
"scale": 1
|
|
213
|
+
},
|
|
214
|
+
"ui_properties": {
|
|
215
|
+
"position": {
|
|
216
|
+
"x": 1400,
|
|
217
|
+
"y": 942
|
|
218
|
+
},
|
|
219
|
+
"width": 280,
|
|
220
|
+
"title": "4:5 PNG"
|
|
221
|
+
},
|
|
222
|
+
"dynamic_properties": {},
|
|
223
|
+
"dynamic_outputs": {}
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"id": "story-svg",
|
|
227
|
+
"type": "lib.svg.Document",
|
|
228
|
+
"data": {
|
|
229
|
+
"elements": [],
|
|
230
|
+
"width": 1080,
|
|
231
|
+
"height": 1920,
|
|
232
|
+
"viewBox": "0 0 1080 1920"
|
|
233
|
+
},
|
|
234
|
+
"ui_properties": {
|
|
235
|
+
"position": {
|
|
236
|
+
"x": 1400,
|
|
237
|
+
"y": 1562
|
|
238
|
+
},
|
|
239
|
+
"width": 280,
|
|
240
|
+
"title": "9:16 editable SVG"
|
|
241
|
+
},
|
|
242
|
+
"dynamic_properties": {},
|
|
243
|
+
"dynamic_outputs": {}
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"id": "story-png",
|
|
247
|
+
"type": "lib.svg.SVGToImage",
|
|
248
|
+
"data": {
|
|
249
|
+
"elements": [],
|
|
250
|
+
"width": 1080,
|
|
251
|
+
"height": 1920,
|
|
252
|
+
"viewBox": "0 0 1080 1920",
|
|
253
|
+
"scale": 1
|
|
254
|
+
},
|
|
255
|
+
"ui_properties": {
|
|
256
|
+
"position": {
|
|
257
|
+
"x": 1400,
|
|
258
|
+
"y": 1168
|
|
259
|
+
},
|
|
260
|
+
"width": 280,
|
|
261
|
+
"title": "9:16 PNG"
|
|
262
|
+
},
|
|
263
|
+
"dynamic_properties": {},
|
|
264
|
+
"dynamic_outputs": {}
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"id": "layout-finalize",
|
|
268
|
+
"type": "nodetool.code.Code",
|
|
269
|
+
"data": {
|
|
270
|
+
"code": "const MAX_RECORD_BYTES = 16 * 1024 * 1024;\nconst allowedImageMimes = [\"image/png\", \"image/jpeg\", \"image/webp\", \"image/avif\"];\nconst readImage = async (ref, label) => {\n const bytes = await media.bytes(ref);\n const info = await media.info(ref);\n if (!allowedImageMimes.includes(info.mimeType)) throw new Error(`${label} has unsupported MIME type ${info.mimeType || \"unknown\"}.`);\n if (bytes.length === 0) throw new Error(`${label} is empty.`);\n return { bytes, mimeType: info.mimeType, width: Number(ref && ref.width) || 0, height: Number(ref && ref.height) || 0 };\n};\nconst rawSvg = (value, label) => {\n if (!value || typeof value.data !== \"string\" || value.data.length === 0) throw new Error(`${label} is empty.`);\n const bytes = fromBase64(value.data);\n if (bytes.length === 0) throw new Error(`${label} is empty.`);\n return bytes;\n};\nlet contract;\ntry { contract = JSON.parse(String(inputs.contract ?? \"\")); } catch { throw new Error(\"The accepted creative contract is invalid.\"); }\nconst version = String(inputs.version ?? \"\").trim();\nif (![\"original\", \"revision\"].includes(version)) throw new Error(\"Version must be original or revision.\");\nconst source = await readImage(inputs.hero, \"Accepted hero\");\n// A hero stored by reference carries no dimensions, and the record needs them.\nif (!source.width || !source.height) {\n const size = await image.info(source.bytes);\n source.width = size.width;\n source.height = size.height;\n}\nconst portrait = await readImage(inputs.portrait, \"4:5 PNG\");\nconst story = await readImage(inputs.story, \"9:16 PNG\");\nif (portrait.mimeType !== \"image/png\" || portrait.width !== 1080 || portrait.height !== 1350) throw new Error(\"The 4:5 PNG must be exactly 1080×1350.\");\nif (story.mimeType !== \"image/png\" || story.width !== 1080 || story.height !== 1920) throw new Error(\"The 9:16 PNG must be exactly 1080×1920.\");\n// The layout step sends a transparent overlay and an empty hero slot. Put the\n// photograph under the overlay here: a cover crop on a dark panel for the\n// PNG, and an embedded image in place of the slot for the editable SVG.\nconst PANEL = \"#0f1512\";\nconst slotPattern = /<g id=\"hero-slot\" data-height=\"(\\d+)\"><\\/g>/;\nconst heroDataUri = `data:${source.mimeType};base64,${toBase64(source.bytes)}`;\nconst placeHero = async (overlay, svgValue, height, label) => {\n const svg = new TextDecoder().decode(rawSvg(svgValue, label));\n const slot = svg.match(slotPattern);\n if (!slot) throw new Error(`${label} has no hero slot.`);\n const imageHeight = Number(slot[1]);\n const photo = await image.resize(source.bytes, { width: 1080, height: imageHeight, fit: \"cover\" });\n const base = await image.blank(1080, height, { color: PANEL });\n const png = await image.bytes(await image.composite(base, [{ image: photo, x: 0, y: 0 }, { image: overlay.bytes, x: 0, y: 0 }], { format: \"png\" }));\n const embedded = svg.replace(slotPattern, `<rect x=\"0\" y=\"0\" width=\"1080\" height=\"${height}\" fill=\"${PANEL}\"></rect><image x=\"0\" y=\"0\" width=\"1080\" height=\"${imageHeight}\" href=\"${heroDataUri}\" preserveAspectRatio=\"xMidYMid slice\"></image>`);\n return { png: { ...overlay, bytes: png }, svg: new TextEncoder().encode(embedded) };\n};\nconst portraitLayout = await placeHero(portrait, inputs.portrait_svg_raw, 1350, \"4:5 SVG\");\nconst storyLayout = await placeHero(story, inputs.story_svg_raw, 1920, \"9:16 SVG\");\nconst portraitSvgBytes = portraitLayout.svg;\nconst storySvgBytes = storyLayout.svg;\nconst payload = (item) => ({ mimeType: item.mimeType, width: item.width, height: item.height, data: toBase64(item.bytes) });\nconst svgPayload = (bytes, width, height) => ({ mimeType: \"image/svg+xml\", width, height, data: toBase64(bytes) });\nconst artifacts = { source: payload(source), portrait: payload(portraitLayout.png), story: payload(storyLayout.png), portraitSvg: svgPayload(portraitSvgBytes, 1080, 1350), storySvg: svgPayload(storySvgBytes, 1080, 1920), contract };\nlet record;\nif (version === \"original\") {\n if (!contract || contract.schemaVersion !== 1 || contract.kind !== \"hero\" || !contract.brief || !contract.selectedDirection || !contract.copy) throw new Error(\"Original layouts require a complete accepted hero contract.\");\n record = { schemaVersion: 1, brief: contract.brief, references: { role: contract.brief.referenceRole, use: contract.brief.referenceUse, ignore: contract.brief.referenceIgnore }, selectedDirection: contract.selectedDirection, approvedCopy: contract.copy, acceptedVersion: \"original\", original: artifacts };\n} else {\n let original;\n try { original = JSON.parse(await media.text(inputs.original_record)); } catch { throw new Error(\"The original campaign record file is invalid. Retry the original layout or reopen a valid record.\"); }\n if (!original || original.schemaVersion !== 1 || original.acceptedVersion !== \"original\" || !original.original || original.revision) throw new Error(\"Revision layouts require the unchanged original-only campaign record.\");\n if (!contract || contract.schemaVersion !== 1 || contract.kind !== \"revision\" || !contract.parentContract || !contract.revisionRequest) throw new Error(\"Revision layouts require a complete child contract.\");\n record = { ...original, acceptedVersion: \"revision\", revision: { ...artifacts, request: contract.revisionRequest } };\n}\nconst recordText = JSON.stringify(record);\nconst recordBytes = new TextEncoder().encode(recordText);\nif (recordBytes.length > MAX_RECORD_BYTES) throw new Error(`The campaign record is ${recordBytes.length} bytes and exceeds the 16 MiB portable record limit. Reduce source file sizes and retry; no artifact was dropped.`);\nconst [heroRef, portraitRef, storyRef, portraitSvgRef, storySvgRef, recordFile] = await Promise.all([\n media.toImage(source.bytes, { mimeType: source.mimeType }),\n media.toImage(portraitLayout.png.bytes, { mimeType: \"image/png\" }),\n media.toImage(storyLayout.png.bytes, { mimeType: \"image/png\" }),\n media.toDocument(portraitSvgBytes, { mimeType: \"image/svg+xml\", filename: `${version}-portrait.svg` }),\n media.toDocument(storySvgBytes, { mimeType: \"image/svg+xml\", filename: `${version}-story.svg` }),\n media.toDocument(recordBytes, { mimeType: \"application/json\", filename: \"directed-campaign.json\" })\n]);\nawait output(\"hero\", heroRef);\nawait output(\"portrait\", portraitRef);\nawait output(\"story\", storyRef);\nawait output(\"portrait_svg\", portraitSvgRef);\nawait output(\"story_svg\", storySvgRef);\nawait output(\"contract\", JSON.stringify(contract));\nawait output(\"record\", JSON.stringify({ schemaVersion: 1, acceptedVersion: record.acceptedVersion, productName: record.brief.productName, headline: record.approvedCopy.headline, cta: record.approvedCopy.cta, hasRevision: record.acceptedVersion === \"revision\", portableRecord: \"record_file\" }));\nawait output(\"record_file\", recordFile);\nawait output(\"phase\", version === \"original\" ? \"campaign_ready\" : \"complete\");"
|
|
271
|
+
},
|
|
272
|
+
"ui_properties": {
|
|
273
|
+
"position": {
|
|
274
|
+
"x": 1780,
|
|
275
|
+
"y": 1036
|
|
276
|
+
},
|
|
277
|
+
"width": 520,
|
|
278
|
+
"title": "Wait, snapshot, and export"
|
|
279
|
+
},
|
|
280
|
+
"dynamic_properties": {
|
|
281
|
+
"hero": {
|
|
282
|
+
"type": "image",
|
|
283
|
+
"uri": ""
|
|
284
|
+
},
|
|
285
|
+
"contract": "",
|
|
286
|
+
"version": "original",
|
|
287
|
+
"original_record": {
|
|
288
|
+
"type": "document",
|
|
289
|
+
"uri": ""
|
|
290
|
+
},
|
|
291
|
+
"portrait": {
|
|
292
|
+
"type": "image",
|
|
293
|
+
"uri": ""
|
|
294
|
+
},
|
|
295
|
+
"story": {
|
|
296
|
+
"type": "image",
|
|
297
|
+
"uri": ""
|
|
298
|
+
},
|
|
299
|
+
"portrait_svg_raw": {},
|
|
300
|
+
"story_svg_raw": {}
|
|
301
|
+
},
|
|
302
|
+
"dynamic_inputs": {
|
|
303
|
+
"hero": {
|
|
304
|
+
"type": {
|
|
305
|
+
"type": "any"
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
"contract": {
|
|
309
|
+
"type": {
|
|
310
|
+
"type": "str"
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
"version": {
|
|
314
|
+
"type": {
|
|
315
|
+
"type": "str"
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
"original_record": {
|
|
319
|
+
"type": {
|
|
320
|
+
"type": "document"
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
"portrait": {
|
|
324
|
+
"type": {
|
|
325
|
+
"type": "image"
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
"story": {
|
|
329
|
+
"type": {
|
|
330
|
+
"type": "image"
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
"portrait_svg_raw": {
|
|
334
|
+
"type": {
|
|
335
|
+
"type": "any"
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
"story_svg_raw": {
|
|
339
|
+
"type": {
|
|
340
|
+
"type": "any"
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
"dynamic_outputs": {
|
|
345
|
+
"hero": {
|
|
346
|
+
"type": "image",
|
|
347
|
+
"type_args": [],
|
|
348
|
+
"optional": false
|
|
349
|
+
},
|
|
350
|
+
"portrait": {
|
|
351
|
+
"type": "image",
|
|
352
|
+
"type_args": [],
|
|
353
|
+
"optional": false
|
|
354
|
+
},
|
|
355
|
+
"story": {
|
|
356
|
+
"type": "image",
|
|
357
|
+
"type_args": [],
|
|
358
|
+
"optional": false
|
|
359
|
+
},
|
|
360
|
+
"portrait_svg": {
|
|
361
|
+
"type": "document",
|
|
362
|
+
"type_args": [],
|
|
363
|
+
"optional": false
|
|
364
|
+
},
|
|
365
|
+
"story_svg": {
|
|
366
|
+
"type": "document",
|
|
367
|
+
"type_args": [],
|
|
368
|
+
"optional": false
|
|
369
|
+
},
|
|
370
|
+
"contract": {
|
|
371
|
+
"type": "str",
|
|
372
|
+
"type_args": [],
|
|
373
|
+
"optional": false
|
|
374
|
+
},
|
|
375
|
+
"record": {
|
|
376
|
+
"type": "str",
|
|
377
|
+
"type_args": [],
|
|
378
|
+
"optional": false
|
|
379
|
+
},
|
|
380
|
+
"record_file": {
|
|
381
|
+
"type": "document",
|
|
382
|
+
"type_args": [],
|
|
383
|
+
"optional": false
|
|
384
|
+
},
|
|
385
|
+
"phase": {
|
|
386
|
+
"type": "str",
|
|
387
|
+
"type_args": [],
|
|
388
|
+
"optional": false
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
"sync_mode": "on_all"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"id": "out-hero",
|
|
395
|
+
"type": "nodetool.output.Output",
|
|
396
|
+
"data": {
|
|
397
|
+
"name": "hero"
|
|
398
|
+
},
|
|
399
|
+
"ui_properties": {
|
|
400
|
+
"position": {
|
|
401
|
+
"x": 2400,
|
|
402
|
+
"y": 483
|
|
403
|
+
},
|
|
404
|
+
"width": 240,
|
|
405
|
+
"title": "Accepted hero"
|
|
406
|
+
},
|
|
407
|
+
"dynamic_properties": {},
|
|
408
|
+
"dynamic_outputs": {}
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"id": "out-portrait",
|
|
412
|
+
"type": "nodetool.output.Output",
|
|
413
|
+
"data": {
|
|
414
|
+
"name": "portrait"
|
|
415
|
+
},
|
|
416
|
+
"ui_properties": {
|
|
417
|
+
"position": {
|
|
418
|
+
"x": 2400,
|
|
419
|
+
"y": 883
|
|
420
|
+
},
|
|
421
|
+
"width": 240,
|
|
422
|
+
"title": "4:5 PNG"
|
|
423
|
+
},
|
|
424
|
+
"dynamic_properties": {},
|
|
425
|
+
"dynamic_outputs": {}
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"id": "out-story",
|
|
429
|
+
"type": "nodetool.output.Output",
|
|
430
|
+
"data": {
|
|
431
|
+
"name": "story"
|
|
432
|
+
},
|
|
433
|
+
"ui_properties": {
|
|
434
|
+
"position": {
|
|
435
|
+
"x": 2400,
|
|
436
|
+
"y": 1283
|
|
437
|
+
},
|
|
438
|
+
"width": 240,
|
|
439
|
+
"title": "9:16 PNG"
|
|
440
|
+
},
|
|
441
|
+
"dynamic_properties": {},
|
|
442
|
+
"dynamic_outputs": {}
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"id": "out-portrait_svg",
|
|
446
|
+
"type": "nodetool.output.Output",
|
|
447
|
+
"data": {
|
|
448
|
+
"name": "portrait_svg"
|
|
449
|
+
},
|
|
450
|
+
"ui_properties": {
|
|
451
|
+
"position": {
|
|
452
|
+
"x": 2400,
|
|
453
|
+
"y": 1683
|
|
454
|
+
},
|
|
455
|
+
"width": 240,
|
|
456
|
+
"title": "4:5 SVG"
|
|
457
|
+
},
|
|
458
|
+
"dynamic_properties": {},
|
|
459
|
+
"dynamic_outputs": {}
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"id": "out-story_svg",
|
|
463
|
+
"type": "nodetool.output.Output",
|
|
464
|
+
"data": {
|
|
465
|
+
"name": "story_svg"
|
|
466
|
+
},
|
|
467
|
+
"ui_properties": {
|
|
468
|
+
"position": {
|
|
469
|
+
"x": 2400,
|
|
470
|
+
"y": 2083
|
|
471
|
+
},
|
|
472
|
+
"width": 240,
|
|
473
|
+
"title": "9:16 SVG"
|
|
474
|
+
},
|
|
475
|
+
"dynamic_properties": {},
|
|
476
|
+
"dynamic_outputs": {}
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
"id": "out-contract",
|
|
480
|
+
"type": "nodetool.output.Output",
|
|
481
|
+
"data": {
|
|
482
|
+
"name": "contract"
|
|
483
|
+
},
|
|
484
|
+
"ui_properties": {
|
|
485
|
+
"position": {
|
|
486
|
+
"x": 2400,
|
|
487
|
+
"y": 683
|
|
488
|
+
},
|
|
489
|
+
"width": 240,
|
|
490
|
+
"title": "Accepted contract"
|
|
491
|
+
},
|
|
492
|
+
"dynamic_properties": {},
|
|
493
|
+
"dynamic_outputs": {}
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
"id": "out-record",
|
|
497
|
+
"type": "nodetool.output.Output",
|
|
498
|
+
"data": {
|
|
499
|
+
"name": "record"
|
|
500
|
+
},
|
|
501
|
+
"ui_properties": {
|
|
502
|
+
"position": {
|
|
503
|
+
"x": 2400,
|
|
504
|
+
"y": 1083
|
|
505
|
+
},
|
|
506
|
+
"width": 240,
|
|
507
|
+
"title": "Campaign snapshot"
|
|
508
|
+
},
|
|
509
|
+
"dynamic_properties": {},
|
|
510
|
+
"dynamic_outputs": {}
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
"id": "out-record_file",
|
|
514
|
+
"type": "nodetool.output.Output",
|
|
515
|
+
"data": {
|
|
516
|
+
"name": "record_file"
|
|
517
|
+
},
|
|
518
|
+
"ui_properties": {
|
|
519
|
+
"position": {
|
|
520
|
+
"x": 2400,
|
|
521
|
+
"y": 1483
|
|
522
|
+
},
|
|
523
|
+
"width": 240,
|
|
524
|
+
"title": "Campaign record file"
|
|
525
|
+
},
|
|
526
|
+
"dynamic_properties": {},
|
|
527
|
+
"dynamic_outputs": {}
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"id": "normalize-hero",
|
|
531
|
+
"type": "nodetool.code.Code",
|
|
532
|
+
"data": {
|
|
533
|
+
"code": "let value = inputs.value;\nif (typeof value === \"string\") {\n const trimmed = value.trim();\n if (trimmed.startsWith(\"{\")) {\n try { value = JSON.parse(trimmed); } catch { value = { type: \"image\", uri: trimmed }; }\n } else {\n value = { type: \"image\", uri: trimmed };\n }\n}\nif (!value || value.type !== \"image\" || (typeof value.uri !== \"string\" && typeof value.data !== \"string\" && typeof value.asset_id !== \"string\")) throw new Error(\"The accepted hero is not a valid image reference.\");\n// Inline bytes would cross the node boundary as one large value, so store\n// them once and pass the small reference on.\nif (typeof value.data === \"string\" && value.data.length > 0) {\n const bytes = await media.bytes(value);\n const info = await media.info(value);\n value = await media.toImage(bytes, { mimeType: info.mimeType || undefined });\n}\nawait output(\"image\", value);"
|
|
534
|
+
},
|
|
535
|
+
"ui_properties": {
|
|
536
|
+
"position": {
|
|
537
|
+
"x": 380,
|
|
538
|
+
"y": 1038
|
|
539
|
+
},
|
|
540
|
+
"width": 320,
|
|
541
|
+
"title": "Normalize app image"
|
|
542
|
+
},
|
|
543
|
+
"dynamic_properties": {
|
|
544
|
+
"value": null
|
|
545
|
+
},
|
|
546
|
+
"dynamic_inputs": {
|
|
547
|
+
"value": {
|
|
548
|
+
"type": {
|
|
549
|
+
"type": "any"
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
},
|
|
553
|
+
"dynamic_outputs": {
|
|
554
|
+
"image": {
|
|
555
|
+
"type": "image",
|
|
556
|
+
"type_args": [],
|
|
557
|
+
"optional": false
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
"sync_mode": "on_all"
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
"id": "out-phase",
|
|
564
|
+
"type": "nodetool.output.Output",
|
|
565
|
+
"data": {
|
|
566
|
+
"name": "phase"
|
|
567
|
+
},
|
|
568
|
+
"ui_properties": {
|
|
569
|
+
"position": {
|
|
570
|
+
"x": 2400,
|
|
571
|
+
"y": 1883
|
|
572
|
+
},
|
|
573
|
+
"width": 240,
|
|
574
|
+
"title": "Accepted phase"
|
|
575
|
+
},
|
|
576
|
+
"dynamic_properties": {},
|
|
577
|
+
"dynamic_outputs": {}
|
|
578
|
+
}
|
|
579
|
+
],
|
|
580
|
+
"edges": [
|
|
581
|
+
{
|
|
582
|
+
"id": "hero-to-normalizer",
|
|
583
|
+
"source": "in-hero",
|
|
584
|
+
"sourceHandle": "output",
|
|
585
|
+
"target": "normalize-hero",
|
|
586
|
+
"targetHandle": "value"
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
"id": "hero-to-elements",
|
|
590
|
+
"source": "normalize-hero",
|
|
591
|
+
"sourceHandle": "image",
|
|
592
|
+
"target": "layout-elements",
|
|
593
|
+
"targetHandle": "hero"
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
"id": "contract-to-elements",
|
|
597
|
+
"source": "in-contract",
|
|
598
|
+
"sourceHandle": "output",
|
|
599
|
+
"target": "layout-elements",
|
|
600
|
+
"targetHandle": "contract"
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
"id": "version-to-elements",
|
|
604
|
+
"source": "in-version",
|
|
605
|
+
"sourceHandle": "output",
|
|
606
|
+
"target": "layout-elements",
|
|
607
|
+
"targetHandle": "version"
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"id": "portrait-elements-to-svg",
|
|
611
|
+
"source": "layout-elements",
|
|
612
|
+
"sourceHandle": "portrait_elements",
|
|
613
|
+
"target": "portrait-svg",
|
|
614
|
+
"targetHandle": "elements"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"id": "portrait-elements-to-png",
|
|
618
|
+
"source": "layout-elements",
|
|
619
|
+
"sourceHandle": "portrait_elements",
|
|
620
|
+
"target": "portrait-png",
|
|
621
|
+
"targetHandle": "elements"
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
"id": "story-elements-to-svg",
|
|
625
|
+
"source": "layout-elements",
|
|
626
|
+
"sourceHandle": "story_elements",
|
|
627
|
+
"target": "story-svg",
|
|
628
|
+
"targetHandle": "elements"
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
"id": "story-elements-to-png",
|
|
632
|
+
"source": "layout-elements",
|
|
633
|
+
"sourceHandle": "story_elements",
|
|
634
|
+
"target": "story-png",
|
|
635
|
+
"targetHandle": "elements"
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"id": "hero-to-finalize",
|
|
639
|
+
"source": "normalize-hero",
|
|
640
|
+
"sourceHandle": "image",
|
|
641
|
+
"target": "layout-finalize",
|
|
642
|
+
"targetHandle": "hero"
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
"id": "contract-to-finalize",
|
|
646
|
+
"source": "in-contract",
|
|
647
|
+
"sourceHandle": "output",
|
|
648
|
+
"target": "layout-finalize",
|
|
649
|
+
"targetHandle": "contract"
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
"id": "version-to-finalize",
|
|
653
|
+
"source": "in-version",
|
|
654
|
+
"sourceHandle": "output",
|
|
655
|
+
"target": "layout-finalize",
|
|
656
|
+
"targetHandle": "version"
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
"id": "original-record-to-finalize",
|
|
660
|
+
"source": "in-original_record",
|
|
661
|
+
"sourceHandle": "output",
|
|
662
|
+
"target": "layout-finalize",
|
|
663
|
+
"targetHandle": "original_record"
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
"id": "portrait-png-to-finalize",
|
|
667
|
+
"source": "portrait-png",
|
|
668
|
+
"sourceHandle": "output",
|
|
669
|
+
"target": "layout-finalize",
|
|
670
|
+
"targetHandle": "portrait"
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
"id": "story-png-to-finalize",
|
|
674
|
+
"source": "story-png",
|
|
675
|
+
"sourceHandle": "output",
|
|
676
|
+
"target": "layout-finalize",
|
|
677
|
+
"targetHandle": "story"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"id": "portrait-svg-to-finalize",
|
|
681
|
+
"source": "portrait-svg",
|
|
682
|
+
"sourceHandle": "output",
|
|
683
|
+
"target": "layout-finalize",
|
|
684
|
+
"targetHandle": "portrait_svg_raw"
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
"id": "story-svg-to-finalize",
|
|
688
|
+
"source": "story-svg",
|
|
689
|
+
"sourceHandle": "output",
|
|
690
|
+
"target": "layout-finalize",
|
|
691
|
+
"targetHandle": "story_svg_raw"
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
"id": "final-hero",
|
|
695
|
+
"source": "layout-finalize",
|
|
696
|
+
"sourceHandle": "hero",
|
|
697
|
+
"target": "out-hero",
|
|
698
|
+
"targetHandle": "value"
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
"id": "final-portrait",
|
|
702
|
+
"source": "layout-finalize",
|
|
703
|
+
"sourceHandle": "portrait",
|
|
704
|
+
"target": "out-portrait",
|
|
705
|
+
"targetHandle": "value"
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
"id": "final-story",
|
|
709
|
+
"source": "layout-finalize",
|
|
710
|
+
"sourceHandle": "story",
|
|
711
|
+
"target": "out-story",
|
|
712
|
+
"targetHandle": "value"
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
"id": "final-portrait-svg",
|
|
716
|
+
"source": "layout-finalize",
|
|
717
|
+
"sourceHandle": "portrait_svg",
|
|
718
|
+
"target": "out-portrait_svg",
|
|
719
|
+
"targetHandle": "value"
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
"id": "final-story-svg",
|
|
723
|
+
"source": "layout-finalize",
|
|
724
|
+
"sourceHandle": "story_svg",
|
|
725
|
+
"target": "out-story_svg",
|
|
726
|
+
"targetHandle": "value"
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
"id": "final-contract",
|
|
730
|
+
"source": "layout-finalize",
|
|
731
|
+
"sourceHandle": "contract",
|
|
732
|
+
"target": "out-contract",
|
|
733
|
+
"targetHandle": "value"
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
"id": "final-record",
|
|
737
|
+
"source": "layout-finalize",
|
|
738
|
+
"sourceHandle": "record",
|
|
739
|
+
"target": "out-record",
|
|
740
|
+
"targetHandle": "value"
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"id": "final-record-file",
|
|
744
|
+
"source": "layout-finalize",
|
|
745
|
+
"sourceHandle": "record_file",
|
|
746
|
+
"target": "out-record_file",
|
|
747
|
+
"targetHandle": "value"
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
"id": "final-phase",
|
|
751
|
+
"source": "layout-finalize",
|
|
752
|
+
"sourceHandle": "phase",
|
|
753
|
+
"target": "out-phase",
|
|
754
|
+
"targetHandle": "value"
|
|
755
|
+
}
|
|
756
|
+
]
|
|
757
|
+
},
|
|
758
|
+
"input_schema": null,
|
|
759
|
+
"output_schema": null,
|
|
760
|
+
"settings": null,
|
|
761
|
+
"package_name": "nodetool-base",
|
|
762
|
+
"path": null,
|
|
763
|
+
"run_mode": null
|
|
764
|
+
}
|