{"schemaVersion":1,"id":"recommended.sm-blueprint","version":"1.0.0","name":"Blueprint workflow","description":"An editable production workflow using Blueprint v2.0.0.","stages":[{"id":"main","blockId":"sm.blueprint","version":"2.0.0","label":"Blueprint"}],"connections":[],"packages":[{"manifest":{"schemaVersion":1,"sdkVersion":"0.1.0","id":"sm.blueprint","version":"2.0.0","name":"Blueprint","description":"Review and edit the complete production blueprint—overview, story arc, visual direction, voiceover, characters, locations, scenes, shots, and retained project fields—in one portable workspace.","kind":"workspace","runtime":"javascript","entry":"src/run.js","license":"MIT","provenance":{"notice":"Original source (authorship declared by the packager)\nLicense: MIT\nChanges: Original implementation declared by the packager; no reused repository or dependency code.\nFiles: LICENSE, src/run.js, src/view.json\n\nMIT License\n\nCopyright (c) 2026 StillMade contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","portableSources":[{"kind":"original","license":"MIT","paths":["LICENSE","src/run.js","src/view.json"],"evidence":["upstream/0/LICENSE","upstream/0/src/run.js","upstream/0/src/view.json"],"changes":"Original implementation declared by the packager; no reused repository or dependency code."}]},"inputs":{"blueprint":{"type":"bible","context":"blueprint","primary":true,"required":false,"default":{"schemaVersion":1},"description":"The complete current project blueprint. Unknown and future fields are retained unchanged."},"updatedBlueprint":{"type":"bible","required":false,"default":{"schemaVersion":1},"description":"The complete edited blueprint prepared by this Block's workspace."},"commit":{"type":"boolean","default":false,"description":"Prepare the edited document for StillMade review and Apply."}},"outputs":{"blueprint":{"type":"bible","primary":true,"role":"production_blueprint","description":"The complete edited blueprint for the next Step."},"edit":{"type":"workspace-edit","description":"An exact before/after Blueprint change reviewed before it updates the project."}},"permissions":{"project":["context.blueprint.read","workspace.blueprint.propose"],"network":[],"filesystem":[],"secrets":[]},"ui":[],"platforms":{"phone":{"supported":true},"browser":{"supported":true},"desktop":{"supported":true}}},"code":"const copy = value => JSON.parse(JSON.stringify(value));\nconst source = copy(input.blueprint || {schemaVersion: 1});\nconst candidate = input.commit ? copy(input.updatedBlueprint) : copy(source);\nif (!candidate || Array.isArray(candidate) || candidate.schemaVersion !== 1) {\n  throw new Error('Keep the complete version 1 Blueprint document.');\n}\nconst title = typeof candidate.title === 'string' && candidate.title.trim()\n  ? `Update Blueprint: ${candidate.title.trim().slice(0, 160)}`\n  : 'Update production Blueprint';\nreturn {\n  blueprint: candidate,\n  edit: {schemaVersion: 1, title, field: 'blueprint', before: source, after: candidate}\n};\n","view":{"html":"<main class=\"blueprint-workspace\">\n  <header>\n    <div><small>Production workspace</small><h1>Blueprint</h1></div>\n    <div class=\"actions\"><button id=\"reset\" type=\"button\" class=\"secondary\">Reset changes</button><button id=\"save\" type=\"button\">Review changes</button></div>\n  </header>\n  <output id=\"status\" role=\"status\" aria-live=\"polite\">Loading the project Blueprint…</output>\n\n  <section>\n    <h2>Project overview</h2>\n    <div class=\"grid two\">\n      <label>Title<input id=\"title\" type=\"text\"></label>\n      <label>Video type<input id=\"videoType\" type=\"text\"></label>\n      <label>Target length<input id=\"targetLength\" type=\"text\"></label>\n      <label>Tone<input id=\"tone\" type=\"text\"></label>\n      <label>Aspect ratio<input id=\"aspectRatio\" type=\"text\"></label>\n    </div>\n    <label>Description<textarea id=\"description\"></textarea></label>\n    <label>Extra information<textarea id=\"extraInfo\"></textarea></label>\n  </section>\n\n  <section>\n    <h2>Emotional arc</h2>\n    <div class=\"grid two\">\n      <label>Beginning<textarea id=\"arcBeginning\"></textarea></label>\n      <label>Escalation<textarea id=\"arcEscalation\"></textarea></label>\n      <label>Climax<textarea id=\"arcClimax\"></textarea></label>\n      <label>Resolution<textarea id=\"arcResolution\"></textarea></label>\n    </div>\n  </section>\n\n  <section>\n    <h2>Visual style guide</h2>\n    <div class=\"grid two\">\n      <label>Color palette<textarea id=\"styleColor\"></textarea></label>\n      <label>Lighting tone<textarea id=\"styleLighting\"></textarea></label>\n      <label>Camera language<textarea id=\"styleCamera\"></textarea></label>\n      <label>Overall aesthetic<textarea id=\"styleAesthetic\"></textarea></label>\n    </div>\n  </section>\n\n  <section><div class=\"section-title\"><h2>Voiceover</h2></div><div id=\"voiceover\" class=\"cards\"></div></section>\n  <section><div class=\"section-title\"><h2>Characters</h2><button id=\"addCharacter\" type=\"button\" class=\"secondary\">Add character</button></div><div id=\"characters\" class=\"cards\"></div></section>\n  <section><div class=\"section-title\"><h2>Locations</h2><button id=\"addLocation\" type=\"button\" class=\"secondary\">Add location</button></div><div id=\"locations\" class=\"cards\"></div></section>\n  <section><div class=\"section-title\"><h2>Scenes and shots</h2><button id=\"addScene\" type=\"button\" class=\"secondary\">Add scene</button></div><div id=\"scenes\" class=\"cards\"></div></section>\n\n  <details id=\"advanced\"><summary>Complete Blueprint data</summary><p>All fields are retained. Edit this JSON for fields a custom Blueprint adds beyond the standard workspace.</p><textarea id=\"raw\" class=\"raw\" spellcheck=\"false\"></textarea><button id=\"applyRaw\" type=\"button\" class=\"secondary\">Apply JSON to workspace</button></details>\n</main>\n","css":".blueprint-workspace{max-width:1100px;margin:0 auto;padding:8px;color:var(--fg)}\nheader,.section-title,.actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}header{justify-content:space-between;margin-bottom:14px}header h1{margin:2px 0}header small,output,p{color:var(--fg-muted)}\nsection,details{margin:14px 0;padding:16px;border:1px solid var(--border-tok);border-radius:var(--r-3);background:var(--bg-elev-1)}\nh2{margin:0 0 12px;font-size:22px}.section-title{justify-content:space-between}.section-title h2{margin:0}\n.grid{display:grid;gap:12px}.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}label{display:grid;gap:6px;margin:10px 0;font-size:13px;font-weight:600}textarea{min-height:88px;resize:vertical}input,textarea{width:100%;background:var(--bg)}\n.cards{display:grid;gap:12px}.card{padding:14px;border:1px solid var(--border-tok);border-radius:var(--r-3);background:var(--bg)}.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.card h3{margin:0;font-size:16px}.secondary{background:transparent;color:var(--fg)}.danger{background:transparent;color:var(--signal)}\n.raw{min-height:320px;font-family:var(--font-mono);font-size:12px}summary{font-weight:700}output{display:block;min-height:24px;margin:8px 2px}\n@media(max-width:680px){.blueprint-workspace{padding:0}.grid.two{grid-template-columns:1fr}section,details{padding:12px}.actions{width:100%}.actions button{flex:1}}\n","javascript":"const fields = {\n  title: document.getElementById('title'), description: document.getElementById('description'), videoType: document.getElementById('videoType'),\n  targetLength: document.getElementById('targetLength'), tone: document.getElementById('tone'), aspectRatio: document.getElementById('aspectRatio'), extraInfo: document.getElementById('extraInfo')\n};\nconst arc = {beginning:document.getElementById('arcBeginning'),escalation:document.getElementById('arcEscalation'),climax:document.getElementById('arcClimax'),resolution:document.getElementById('arcResolution')};\nconst visual = {colorPalette:document.getElementById('styleColor'),lightingTone:document.getElementById('styleLighting'),cameraLanguage:document.getElementById('styleCamera'),overallAesthetic:document.getElementById('styleAesthetic')};\nconst status = document.getElementById('status'), raw = document.getElementById('raw'), save = document.getElementById('save');\nlet source = {schemaVersion:1}, draft = {schemaVersion:1}, busy = false, revision = 0;\nconst clone = value => JSON.parse(JSON.stringify(value));\nconst text = value => Array.isArray(value) ? value.join(', ') : value === undefined || value === null ? '' : String(value);\nconst control = (label,action,value,multiline=true) => ({tag:'label',text:undefined,children:[{tag:'span',text:label},multiline?{tag:'textarea',action,value:text(value),disabled:busy,label}:{tag:'input',type:'text',action,value:text(value),disabled:busy,label}]});\nconst remove = (action,label) => ({tag:'button',action,text:label,className:'danger',disabled:busy});\nconst card = (title,children,action) => ({tag:'article',className:'card',children:[{tag:'div',className:'card-head',children:[{tag:'h3',text:title},remove(action,'Remove')]},...children]});\nconst ensure = () => {\n  if(!draft.emotionalArc || Array.isArray(draft.emotionalArc)) draft.emotionalArc={};\n  if(!draft.visualStyleGuide || Array.isArray(draft.visualStyleGuide)) draft.visualStyleGuide=clone(draft.visualStyle && !Array.isArray(draft.visualStyle) ? draft.visualStyle : {});\n  if(!Array.isArray(draft.voiceover)) draft.voiceover=[];\n  if(!Array.isArray(draft.characters)) draft.characters=[];\n  if(!Array.isArray(draft.locations)) draft.locations=[];\n  if(!Array.isArray(draft.scenes)) draft.scenes=[];\n};\nconst draw = () => {\n  ensure();\n  fields.title.value=text(draft.title);fields.description.value=text(draft.description);fields.videoType.value=text(draft.videoType);fields.targetLength.value=text(draft.targetLength);fields.tone.value=text(draft.tone);fields.aspectRatio.value=text(draft.aspectRatio);fields.extraInfo.value=text(draft.extraInfo);\n  arc.beginning.value=text(draft.emotionalArc.beginning);arc.escalation.value=text(draft.emotionalArc.escalation);arc.climax.value=text(draft.emotionalArc.climax);arc.resolution.value=text(draft.emotionalArc.resolution);\n  visual.colorPalette.value=text(draft.visualStyleGuide.colorPalette);visual.lightingTone.value=text(draft.visualStyleGuide.lightingTone);visual.cameraLanguage.value=text(draft.visualStyleGuide.cameraLanguage);visual.overallAesthetic.value=text(draft.visualStyleGuide.overallAesthetic || draft.visualStyleGuide.aesthetic);\n  StillMade.render('voiceover',draft.voiceover.map((line,index)=>card(text(line.sceneId)||'Voiceover '+String(index+1),[control('Narration','voiceover:'+String(index),line.text)],'remove-voiceover:'+String(index))));\n  StillMade.render('characters',draft.characters.map((item,index)=>card(text(item.name)||'Character '+String(index+1),[control('Name','character-name:'+String(index),item.name,false),control('Role','character-role:'+String(index),item.role,false),control('Physical description','character-physical:'+String(index),item.physicalDescription),control('Personality','character-personality:'+String(index),item.personality),control('Notes','character-notes:'+String(index),item.notes)],'remove-character:'+String(index))));\n  StillMade.render('locations',draft.locations.map((item,index)=>card(text(item.name)||'Location '+String(index+1),[control('Name','location-name:'+String(index),item.name,false),control('Time of day','location-time:'+String(index),item.timeOfDay,false),control('Visual description','location-visual:'+String(index),item.visualDescription),control('Atmosphere','location-atmosphere:'+String(index),item.atmosphere || item.emotionalAtmosphere)],'remove-location:'+String(index))));\n  StillMade.render('scenes',draft.scenes.map((item,index)=>card(text(item.title)||'Scene '+text(item.sceneNumber || index+1),[control('Scene number','scene-number:'+String(index),item.sceneNumber,false),control('Title','scene-title:'+String(index),item.title,false),control('Time of day','scene-time:'+String(index),item.timeOfDay,false),control('Emotional tone','scene-tone:'+String(index),item.emotionalTone,false),control('What happens','scene-action:'+String(index),item.whatHappens || item.action),control('Key visual moment','scene-visual:'+String(index),item.keyVisualMoment),control('Characters','scene-characters:'+String(index),item.charactersPresent),{tag:'p',text:Array.isArray(item.shotList)?String(item.shotList.length)+' shots retained. Use Complete Blueprint data to edit location and every shot field.':'No shots yet.'}], 'remove-scene:'+String(index))));\n  raw.value=JSON.stringify(draft,null,2);save.disabled=busy;document.getElementById('reset').disabled=busy;\n};\nconst changed = () => {revision+=1;status.textContent='Changes are local until you choose Review changes.';raw.value=JSON.stringify(draft,null,2)};\nfields.title.addEventListener('input',()=>{draft.title=fields.title.value;changed()});fields.description.addEventListener('input',()=>{draft.description=fields.description.value;changed()});fields.videoType.addEventListener('input',()=>{draft.videoType=fields.videoType.value;changed()});fields.targetLength.addEventListener('input',()=>{draft.targetLength=fields.targetLength.value;changed()});fields.tone.addEventListener('input',()=>{draft.tone=fields.tone.value;changed()});fields.aspectRatio.addEventListener('input',()=>{draft.aspectRatio=fields.aspectRatio.value;changed()});fields.extraInfo.addEventListener('input',()=>{draft.extraInfo=fields.extraInfo.value;changed()});\narc.beginning.addEventListener('input',()=>{ensure();draft.emotionalArc.beginning=arc.beginning.value;changed()});arc.escalation.addEventListener('input',()=>{ensure();draft.emotionalArc.escalation=arc.escalation.value;changed()});arc.climax.addEventListener('input',()=>{ensure();draft.emotionalArc.climax=arc.climax.value;changed()});arc.resolution.addEventListener('input',()=>{ensure();draft.emotionalArc.resolution=arc.resolution.value;changed()});\nvisual.colorPalette.addEventListener('input',()=>{ensure();draft.visualStyleGuide.colorPalette=visual.colorPalette.value;changed()});visual.lightingTone.addEventListener('input',()=>{ensure();draft.visualStyleGuide.lightingTone=visual.lightingTone.value;changed()});visual.cameraLanguage.addEventListener('input',()=>{ensure();draft.visualStyleGuide.cameraLanguage=visual.cameraLanguage.value;changed()});visual.overallAesthetic.addEventListener('input',()=>{ensure();draft.visualStyleGuide.overallAesthetic=visual.overallAesthetic.value;changed()});\nStillMade.onAction(event=>{\n  if(busy)return;const parts=event.action.split(':'),index=Number(parts[1]),kind=parts[0];ensure();\n  const character=draft.characters.find((item,position)=>position===index),place=draft.locations.find((item,position)=>position===index),scene=draft.scenes.find((item,position)=>position===index),voice=draft.voiceover.find((item,position)=>position===index);\n  if(kind==='voiceover'&&voice)voice.text=event.value;\n  if(kind==='character-name'&&character)character.name=event.value;if(kind==='character-role'&&character)character.role=event.value;if(kind==='character-physical'&&character)character.physicalDescription=event.value;if(kind==='character-personality'&&character)character.personality=event.value;if(kind==='character-notes'&&character)character.notes=event.value;\n  if(kind==='location-name'&&place)place.name=event.value;if(kind==='location-time'&&place)place.timeOfDay=event.value;if(kind==='location-visual'&&place)place.visualDescription=event.value;if(kind==='location-atmosphere'&&place)place.atmosphere=event.value;\n  if(kind==='scene-number'&&scene)scene.sceneNumber=event.value;if(kind==='scene-title'&&scene)scene.title=event.value;if(kind==='scene-time'&&scene)scene.timeOfDay=event.value;if(kind==='scene-tone'&&scene)scene.emotionalTone=event.value;if(kind==='scene-action'&&scene)scene.whatHappens=event.value;if(kind==='scene-visual'&&scene)scene.keyVisualMoment=event.value;if(kind==='scene-characters'&&scene)scene.charactersPresent=event.value.split(',').map(value=>value.trim()).filter(Boolean);\n  if(kind==='remove-voiceover')draft.voiceover=draft.voiceover.filter((item,position)=>position!==index);if(kind==='remove-character')draft.characters=draft.characters.filter((item,position)=>position!==index);if(kind==='remove-location')draft.locations=draft.locations.filter((item,position)=>position!==index);if(kind==='remove-scene')draft.scenes=draft.scenes.filter((item,position)=>position!==index);\n  changed();if(kind.startsWith('remove-'))draw();\n});\ndocument.getElementById('addCharacter').addEventListener('click',()=>{if(!busy){ensure();draft.characters=[...draft.characters,{name:'New character',role:'',physicalDescription:'',personality:'',notes:''}];changed();draw()}});\ndocument.getElementById('addLocation').addEventListener('click',()=>{if(!busy){ensure();draft.locations=[...draft.locations,{name:'New location',timeOfDay:'',visualDescription:'',atmosphere:''}];changed();draw()}});\ndocument.getElementById('addScene').addEventListener('click',()=>{if(!busy){ensure();draft.scenes=[...draft.scenes,{sceneNumber:draft.scenes.length+1,title:'New scene',timeOfDay:'',emotionalTone:'',whatHappens:'',keyVisualMoment:'',charactersPresent:[],shotList:[]}];changed();draw()}});\ndocument.getElementById('applyRaw').addEventListener('click',()=>{if(busy)return;try{const value=JSON.parse(raw.value);if(!value||Array.isArray(value)||value.schemaVersion!==1)throw Error('Blueprint JSON must be a version 1 object.');draft=clone(value);changed();draw();status.textContent='Complete Blueprint data applied to this workspace.'}catch(error){status.textContent=error.message}});\ndocument.getElementById('reset').addEventListener('click',()=>{if(!busy){draft=clone(source);revision+=1;draw();status.textContent='Changes reset to the current project Blueprint.'}});\nsave.addEventListener('click',async()=>{if(busy)return;const started=revision;busy=true;draw();status.textContent='Checking the complete Blueprint…';try{const result=await StillMade.run({blueprint:source,updatedBlueprint:draft,commit:true});if(started===revision)status.textContent='Blueprint is ready below. Review the before and after, then choose Apply.';draft=clone(result.blueprint)}catch(error){status.textContent=error.message||'The Blueprint could not be prepared.'}finally{busy=false;draw()}});\nStillMade.onInput(values=>{source=clone(values.blueprint||{schemaVersion:1});draft=clone(source);revision+=1;draw();status.textContent='Edit any section. Every unshown project field is retained.'});\n"},"tests":[{"name":"Retain the complete existing Blueprint without edits","input":{"blueprint":{"schemaVersion":1,"title":"Keep me","characters":[{"id":"hero","name":"Ari","portrait":{"assetId":"portrait-1","versionId":"v3"}}],"customWorkflow":{"keep":true}},"updatedBlueprint":{"schemaVersion":1},"commit":false},"expected":{"blueprint":{"schemaVersion":1,"title":"Keep me","characters":[{"id":"hero","name":"Ari","portrait":{"assetId":"portrait-1","versionId":"v3"}}],"customWorkflow":{"keep":true}},"edit":{"schemaVersion":1,"title":"Update Blueprint: Keep me","field":"blueprint","before":{"schemaVersion":1,"title":"Keep me","characters":[{"id":"hero","name":"Ari","portrait":{"assetId":"portrait-1","versionId":"v3"}}],"customWorkflow":{"keep":true}},"after":{"schemaVersion":1,"title":"Keep me","characters":[{"id":"hero","name":"Ari","portrait":{"assetId":"portrait-1","versionId":"v3"}}],"customWorkflow":{"keep":true}}}}},{"name":"Prepare one complete exact Blueprint update","input":{"blueprint":{"schemaVersion":1,"title":"Original","characters":[{"id":"hero","name":"Ari","portrait":{"assetId":"portrait-1","versionId":"v3"}}],"scenes":[{"id":"scene-1","title":"Opening","shotList":[{"id":"shot-1","prompt":"Keep this"}]}]},"updatedBlueprint":{"schemaVersion":1,"title":"Revised","characters":[{"id":"hero","name":"Ari","portrait":{"assetId":"portrait-1","versionId":"v3"}}],"scenes":[{"id":"scene-1","title":"New opening","shotList":[{"id":"shot-1","prompt":"Keep this"}]}]},"commit":true},"expected":{"blueprint":{"schemaVersion":1,"title":"Revised","characters":[{"id":"hero","name":"Ari","portrait":{"assetId":"portrait-1","versionId":"v3"}}],"scenes":[{"id":"scene-1","title":"New opening","shotList":[{"id":"shot-1","prompt":"Keep this"}]}]},"edit":{"schemaVersion":1,"title":"Update Blueprint: Revised","field":"blueprint","before":{"schemaVersion":1,"title":"Original","characters":[{"id":"hero","name":"Ari","portrait":{"assetId":"portrait-1","versionId":"v3"}}],"scenes":[{"id":"scene-1","title":"Opening","shotList":[{"id":"shot-1","prompt":"Keep this"}]}]},"after":{"schemaVersion":1,"title":"Revised","characters":[{"id":"hero","name":"Ari","portrait":{"assetId":"portrait-1","versionId":"v3"}}],"scenes":[{"id":"scene-1","title":"New opening","shotList":[{"id":"shot-1","prompt":"Keep this"}]}]}}}}],"portable":{"format":"stillmade-block/1","dependencies":[],"sources":[{"kind":"original","license":"MIT","paths":["LICENSE","src/run.js","src/view.json"],"evidence":["upstream/0/LICENSE","upstream/0/src/run.js","upstream/0/src/view.json"],"changes":"Original implementation declared by the packager; no reused repository or dependency code."}],"files":{"upstream/0/LICENSE":"MIT License\n\nCopyright (c) 2026 StillMade contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","upstream/0/src/run.js":"const copy = value => JSON.parse(JSON.stringify(value));\nconst source = copy(input.blueprint || {schemaVersion: 1});\nconst candidate = input.commit ? copy(input.updatedBlueprint) : copy(source);\nif (!candidate || Array.isArray(candidate) || candidate.schemaVersion !== 1) {\n  throw new Error('Keep the complete version 1 Blueprint document.');\n}\nconst title = typeof candidate.title === 'string' && candidate.title.trim()\n  ? `Update Blueprint: ${candidate.title.trim().slice(0, 160)}`\n  : 'Update production Blueprint';\nreturn {\n  blueprint: candidate,\n  edit: {schemaVersion: 1, title, field: 'blueprint', before: source, after: candidate}\n};\n","upstream/0/src/view.json":"{\n  \"html\": \"<main class=\\\"blueprint-workspace\\\">\\n  <header>\\n    <div><small>Production workspace</small><h1>Blueprint</h1></div>\\n    <div class=\\\"actions\\\"><button id=\\\"reset\\\" type=\\\"button\\\" class=\\\"secondary\\\">Reset changes</button><button id=\\\"save\\\" type=\\\"button\\\">Review changes</button></div>\\n  </header>\\n  <output id=\\\"status\\\" role=\\\"status\\\" aria-live=\\\"polite\\\">Loading the project Blueprint…</output>\\n\\n  <section>\\n    <h2>Project overview</h2>\\n    <div class=\\\"grid two\\\">\\n      <label>Title<input id=\\\"title\\\" type=\\\"text\\\"></label>\\n      <label>Video type<input id=\\\"videoType\\\" type=\\\"text\\\"></label>\\n      <label>Target length<input id=\\\"targetLength\\\" type=\\\"text\\\"></label>\\n      <label>Tone<input id=\\\"tone\\\" type=\\\"text\\\"></label>\\n      <label>Aspect ratio<input id=\\\"aspectRatio\\\" type=\\\"text\\\"></label>\\n    </div>\\n    <label>Description<textarea id=\\\"description\\\"></textarea></label>\\n    <label>Extra information<textarea id=\\\"extraInfo\\\"></textarea></label>\\n  </section>\\n\\n  <section>\\n    <h2>Emotional arc</h2>\\n    <div class=\\\"grid two\\\">\\n      <label>Beginning<textarea id=\\\"arcBeginning\\\"></textarea></label>\\n      <label>Escalation<textarea id=\\\"arcEscalation\\\"></textarea></label>\\n      <label>Climax<textarea id=\\\"arcClimax\\\"></textarea></label>\\n      <label>Resolution<textarea id=\\\"arcResolution\\\"></textarea></label>\\n    </div>\\n  </section>\\n\\n  <section>\\n    <h2>Visual style guide</h2>\\n    <div class=\\\"grid two\\\">\\n      <label>Color palette<textarea id=\\\"styleColor\\\"></textarea></label>\\n      <label>Lighting tone<textarea id=\\\"styleLighting\\\"></textarea></label>\\n      <label>Camera language<textarea id=\\\"styleCamera\\\"></textarea></label>\\n      <label>Overall aesthetic<textarea id=\\\"styleAesthetic\\\"></textarea></label>\\n    </div>\\n  </section>\\n\\n  <section><div class=\\\"section-title\\\"><h2>Voiceover</h2></div><div id=\\\"voiceover\\\" class=\\\"cards\\\"></div></section>\\n  <section><div class=\\\"section-title\\\"><h2>Characters</h2><button id=\\\"addCharacter\\\" type=\\\"button\\\" class=\\\"secondary\\\">Add character</button></div><div id=\\\"characters\\\" class=\\\"cards\\\"></div></section>\\n  <section><div class=\\\"section-title\\\"><h2>Locations</h2><button id=\\\"addLocation\\\" type=\\\"button\\\" class=\\\"secondary\\\">Add location</button></div><div id=\\\"locations\\\" class=\\\"cards\\\"></div></section>\\n  <section><div class=\\\"section-title\\\"><h2>Scenes and shots</h2><button id=\\\"addScene\\\" type=\\\"button\\\" class=\\\"secondary\\\">Add scene</button></div><div id=\\\"scenes\\\" class=\\\"cards\\\"></div></section>\\n\\n  <details id=\\\"advanced\\\"><summary>Complete Blueprint data</summary><p>All fields are retained. Edit this JSON for fields a custom Blueprint adds beyond the standard workspace.</p><textarea id=\\\"raw\\\" class=\\\"raw\\\" spellcheck=\\\"false\\\"></textarea><button id=\\\"applyRaw\\\" type=\\\"button\\\" class=\\\"secondary\\\">Apply JSON to workspace</button></details>\\n</main>\\n\",\n  \"css\": \".blueprint-workspace{max-width:1100px;margin:0 auto;padding:8px;color:var(--fg)}\\nheader,.section-title,.actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}header{justify-content:space-between;margin-bottom:14px}header h1{margin:2px 0}header small,output,p{color:var(--fg-muted)}\\nsection,details{margin:14px 0;padding:16px;border:1px solid var(--border-tok);border-radius:var(--r-3);background:var(--bg-elev-1)}\\nh2{margin:0 0 12px;font-size:22px}.section-title{justify-content:space-between}.section-title h2{margin:0}\\n.grid{display:grid;gap:12px}.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}label{display:grid;gap:6px;margin:10px 0;font-size:13px;font-weight:600}textarea{min-height:88px;resize:vertical}input,textarea{width:100%;background:var(--bg)}\\n.cards{display:grid;gap:12px}.card{padding:14px;border:1px solid var(--border-tok);border-radius:var(--r-3);background:var(--bg)}.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.card h3{margin:0;font-size:16px}.secondary{background:transparent;color:var(--fg)}.danger{background:transparent;color:var(--signal)}\\n.raw{min-height:320px;font-family:var(--font-mono);font-size:12px}summary{font-weight:700}output{display:block;min-height:24px;margin:8px 2px}\\n@media(max-width:680px){.blueprint-workspace{padding:0}.grid.two{grid-template-columns:1fr}section,details{padding:12px}.actions{width:100%}.actions button{flex:1}}\\n\",\n  \"javascript\": \"const fields = {\\n  title: document.getElementById('title'), description: document.getElementById('description'), videoType: document.getElementById('videoType'),\\n  targetLength: document.getElementById('targetLength'), tone: document.getElementById('tone'), aspectRatio: document.getElementById('aspectRatio'), extraInfo: document.getElementById('extraInfo')\\n};\\nconst arc = {beginning:document.getElementById('arcBeginning'),escalation:document.getElementById('arcEscalation'),climax:document.getElementById('arcClimax'),resolution:document.getElementById('arcResolution')};\\nconst visual = {colorPalette:document.getElementById('styleColor'),lightingTone:document.getElementById('styleLighting'),cameraLanguage:document.getElementById('styleCamera'),overallAesthetic:document.getElementById('styleAesthetic')};\\nconst status = document.getElementById('status'), raw = document.getElementById('raw'), save = document.getElementById('save');\\nlet source = {schemaVersion:1}, draft = {schemaVersion:1}, busy = false, revision = 0;\\nconst clone = value => JSON.parse(JSON.stringify(value));\\nconst text = value => Array.isArray(value) ? value.join(', ') : value === undefined || value === null ? '' : String(value);\\nconst control = (label,action,value,multiline=true) => ({tag:'label',text:undefined,children:[{tag:'span',text:label},multiline?{tag:'textarea',action,value:text(value),disabled:busy,label}:{tag:'input',type:'text',action,value:text(value),disabled:busy,label}]});\\nconst remove = (action,label) => ({tag:'button',action,text:label,className:'danger',disabled:busy});\\nconst card = (title,children,action) => ({tag:'article',className:'card',children:[{tag:'div',className:'card-head',children:[{tag:'h3',text:title},remove(action,'Remove')]},...children]});\\nconst ensure = () => {\\n  if(!draft.emotionalArc || Array.isArray(draft.emotionalArc)) draft.emotionalArc={};\\n  if(!draft.visualStyleGuide || Array.isArray(draft.visualStyleGuide)) draft.visualStyleGuide=clone(draft.visualStyle && !Array.isArray(draft.visualStyle) ? draft.visualStyle : {});\\n  if(!Array.isArray(draft.voiceover)) draft.voiceover=[];\\n  if(!Array.isArray(draft.characters)) draft.characters=[];\\n  if(!Array.isArray(draft.locations)) draft.locations=[];\\n  if(!Array.isArray(draft.scenes)) draft.scenes=[];\\n};\\nconst draw = () => {\\n  ensure();\\n  fields.title.value=text(draft.title);fields.description.value=text(draft.description);fields.videoType.value=text(draft.videoType);fields.targetLength.value=text(draft.targetLength);fields.tone.value=text(draft.tone);fields.aspectRatio.value=text(draft.aspectRatio);fields.extraInfo.value=text(draft.extraInfo);\\n  arc.beginning.value=text(draft.emotionalArc.beginning);arc.escalation.value=text(draft.emotionalArc.escalation);arc.climax.value=text(draft.emotionalArc.climax);arc.resolution.value=text(draft.emotionalArc.resolution);\\n  visual.colorPalette.value=text(draft.visualStyleGuide.colorPalette);visual.lightingTone.value=text(draft.visualStyleGuide.lightingTone);visual.cameraLanguage.value=text(draft.visualStyleGuide.cameraLanguage);visual.overallAesthetic.value=text(draft.visualStyleGuide.overallAesthetic || draft.visualStyleGuide.aesthetic);\\n  StillMade.render('voiceover',draft.voiceover.map((line,index)=>card(text(line.sceneId)||'Voiceover '+String(index+1),[control('Narration','voiceover:'+String(index),line.text)],'remove-voiceover:'+String(index))));\\n  StillMade.render('characters',draft.characters.map((item,index)=>card(text(item.name)||'Character '+String(index+1),[control('Name','character-name:'+String(index),item.name,false),control('Role','character-role:'+String(index),item.role,false),control('Physical description','character-physical:'+String(index),item.physicalDescription),control('Personality','character-personality:'+String(index),item.personality),control('Notes','character-notes:'+String(index),item.notes)],'remove-character:'+String(index))));\\n  StillMade.render('locations',draft.locations.map((item,index)=>card(text(item.name)||'Location '+String(index+1),[control('Name','location-name:'+String(index),item.name,false),control('Time of day','location-time:'+String(index),item.timeOfDay,false),control('Visual description','location-visual:'+String(index),item.visualDescription),control('Atmosphere','location-atmosphere:'+String(index),item.atmosphere || item.emotionalAtmosphere)],'remove-location:'+String(index))));\\n  StillMade.render('scenes',draft.scenes.map((item,index)=>card(text(item.title)||'Scene '+text(item.sceneNumber || index+1),[control('Scene number','scene-number:'+String(index),item.sceneNumber,false),control('Title','scene-title:'+String(index),item.title,false),control('Time of day','scene-time:'+String(index),item.timeOfDay,false),control('Emotional tone','scene-tone:'+String(index),item.emotionalTone,false),control('What happens','scene-action:'+String(index),item.whatHappens || item.action),control('Key visual moment','scene-visual:'+String(index),item.keyVisualMoment),control('Characters','scene-characters:'+String(index),item.charactersPresent),{tag:'p',text:Array.isArray(item.shotList)?String(item.shotList.length)+' shots retained. Use Complete Blueprint data to edit location and every shot field.':'No shots yet.'}], 'remove-scene:'+String(index))));\\n  raw.value=JSON.stringify(draft,null,2);save.disabled=busy;document.getElementById('reset').disabled=busy;\\n};\\nconst changed = () => {revision+=1;status.textContent='Changes are local until you choose Review changes.';raw.value=JSON.stringify(draft,null,2)};\\nfields.title.addEventListener('input',()=>{draft.title=fields.title.value;changed()});fields.description.addEventListener('input',()=>{draft.description=fields.description.value;changed()});fields.videoType.addEventListener('input',()=>{draft.videoType=fields.videoType.value;changed()});fields.targetLength.addEventListener('input',()=>{draft.targetLength=fields.targetLength.value;changed()});fields.tone.addEventListener('input',()=>{draft.tone=fields.tone.value;changed()});fields.aspectRatio.addEventListener('input',()=>{draft.aspectRatio=fields.aspectRatio.value;changed()});fields.extraInfo.addEventListener('input',()=>{draft.extraInfo=fields.extraInfo.value;changed()});\\narc.beginning.addEventListener('input',()=>{ensure();draft.emotionalArc.beginning=arc.beginning.value;changed()});arc.escalation.addEventListener('input',()=>{ensure();draft.emotionalArc.escalation=arc.escalation.value;changed()});arc.climax.addEventListener('input',()=>{ensure();draft.emotionalArc.climax=arc.climax.value;changed()});arc.resolution.addEventListener('input',()=>{ensure();draft.emotionalArc.resolution=arc.resolution.value;changed()});\\nvisual.colorPalette.addEventListener('input',()=>{ensure();draft.visualStyleGuide.colorPalette=visual.colorPalette.value;changed()});visual.lightingTone.addEventListener('input',()=>{ensure();draft.visualStyleGuide.lightingTone=visual.lightingTone.value;changed()});visual.cameraLanguage.addEventListener('input',()=>{ensure();draft.visualStyleGuide.cameraLanguage=visual.cameraLanguage.value;changed()});visual.overallAesthetic.addEventListener('input',()=>{ensure();draft.visualStyleGuide.overallAesthetic=visual.overallAesthetic.value;changed()});\\nStillMade.onAction(event=>{\\n  if(busy)return;const parts=event.action.split(':'),index=Number(parts[1]),kind=parts[0];ensure();\\n  const character=draft.characters.find((item,position)=>position===index),place=draft.locations.find((item,position)=>position===index),scene=draft.scenes.find((item,position)=>position===index),voice=draft.voiceover.find((item,position)=>position===index);\\n  if(kind==='voiceover'&&voice)voice.text=event.value;\\n  if(kind==='character-name'&&character)character.name=event.value;if(kind==='character-role'&&character)character.role=event.value;if(kind==='character-physical'&&character)character.physicalDescription=event.value;if(kind==='character-personality'&&character)character.personality=event.value;if(kind==='character-notes'&&character)character.notes=event.value;\\n  if(kind==='location-name'&&place)place.name=event.value;if(kind==='location-time'&&place)place.timeOfDay=event.value;if(kind==='location-visual'&&place)place.visualDescription=event.value;if(kind==='location-atmosphere'&&place)place.atmosphere=event.value;\\n  if(kind==='scene-number'&&scene)scene.sceneNumber=event.value;if(kind==='scene-title'&&scene)scene.title=event.value;if(kind==='scene-time'&&scene)scene.timeOfDay=event.value;if(kind==='scene-tone'&&scene)scene.emotionalTone=event.value;if(kind==='scene-action'&&scene)scene.whatHappens=event.value;if(kind==='scene-visual'&&scene)scene.keyVisualMoment=event.value;if(kind==='scene-characters'&&scene)scene.charactersPresent=event.value.split(',').map(value=>value.trim()).filter(Boolean);\\n  if(kind==='remove-voiceover')draft.voiceover=draft.voiceover.filter((item,position)=>position!==index);if(kind==='remove-character')draft.characters=draft.characters.filter((item,position)=>position!==index);if(kind==='remove-location')draft.locations=draft.locations.filter((item,position)=>position!==index);if(kind==='remove-scene')draft.scenes=draft.scenes.filter((item,position)=>position!==index);\\n  changed();if(kind.startsWith('remove-'))draw();\\n});\\ndocument.getElementById('addCharacter').addEventListener('click',()=>{if(!busy){ensure();draft.characters=[...draft.characters,{name:'New character',role:'',physicalDescription:'',personality:'',notes:''}];changed();draw()}});\\ndocument.getElementById('addLocation').addEventListener('click',()=>{if(!busy){ensure();draft.locations=[...draft.locations,{name:'New location',timeOfDay:'',visualDescription:'',atmosphere:''}];changed();draw()}});\\ndocument.getElementById('addScene').addEventListener('click',()=>{if(!busy){ensure();draft.scenes=[...draft.scenes,{sceneNumber:draft.scenes.length+1,title:'New scene',timeOfDay:'',emotionalTone:'',whatHappens:'',keyVisualMoment:'',charactersPresent:[],shotList:[]}];changed();draw()}});\\ndocument.getElementById('applyRaw').addEventListener('click',()=>{if(busy)return;try{const value=JSON.parse(raw.value);if(!value||Array.isArray(value)||value.schemaVersion!==1)throw Error('Blueprint JSON must be a version 1 object.');draft=clone(value);changed();draw();status.textContent='Complete Blueprint data applied to this workspace.'}catch(error){status.textContent=error.message}});\\ndocument.getElementById('reset').addEventListener('click',()=>{if(!busy){draft=clone(source);revision+=1;draw();status.textContent='Changes reset to the current project Blueprint.'}});\\nsave.addEventListener('click',async()=>{if(busy)return;const started=revision;busy=true;draw();status.textContent='Checking the complete Blueprint…';try{const result=await StillMade.run({blueprint:source,updatedBlueprint:draft,commit:true});if(started===revision)status.textContent='Blueprint is ready below. Review the before and after, then choose Apply.';draft=clone(result.blueprint)}catch(error){status.textContent=error.message||'The Blueprint could not be prepared.'}finally{busy=false;draw()}});\\nStillMade.onInput(values=>{source=clone(values.blueprint||{schemaVersion:1});draft=clone(source);revision+=1;draw();status.textContent='Edit any section. Every unshown project field is retained.'});\\n\"\n}"},"lineage":{"parents":[],"changes":"Packaged original Block source for StillMade."}}}],"license":"MIT"}