{"schemaVersion":1,"id":"recommended.sm-final-edit","version":"1.0.0","name":"AI Final Edit workflow","description":"An editable production workflow using AI Final Edit v2.0.2.","stages":[{"id":"main","blockId":"sm.final-edit","version":"2.0.2","label":"AI Final Edit"}],"connections":[],"packages":[{"manifest":{"schemaVersion":1,"sdkVersion":"0.1.0","id":"sm.final-edit","version":"2.0.2","name":"AI Final Edit","description":"Turn a finished timeline and polish direction into a strictly validated edit proposal that remains reviewable before Apply.","kind":"task","runtime":"capability","entry":"src/capability.json","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/capability.json, 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/capability.json","src/view.json"],"evidence":["upstream/0/LICENSE","upstream/0/src/capability.json","upstream/0/src/view.json"],"changes":"Original implementation declared by the packager; no reused repository or dependency code."}]},"inputs":{"timeline":{"type":"timeline","context":"timeline","primary":true,"description":"Current timeline snapshot used for exact before-state checks.","semantic":"timeline","required":true},"direction":{"type":"text","default":"Polish pacing, transitions, color, and audio conservatively. Preserve the story, media choices, and locked items.","description":"What the final polish should improve.","semantic":"edit_direction","required":false}},"outputs":{"edit":{"type":"timeline-edit","primary":true,"description":"A validated proposal previewed before it can alter the timeline.","semantic":"timeline_edit_proposal"}},"permissions":{"project":["context.timeline.read","timeline.propose"],"capabilities":["timeline.propose"],"network":[],"filesystem":[],"secrets":[]},"ui":[{"port":"direction","control":"text"}]},"capability":{"schemaVersion":1,"operation":"timeline.propose","context":{"timeline":{"$input":"timeline"},"direction":{"$input":"direction"}},"instruction":"Act as a restrained final editor. Follow the user's direction using only supported StillMade timeline-edit commands. Preserve media URLs, asset identities, clip content, locked items, story order, and existing work unless the direction explicitly requires a supported change. Prefer a small set of material changes. Every command must copy the exact current target into before. Use the timeline activeTimelineId. Never invent clips, audio, captions, tracks, media, transitions, LUTs, or IDs. Return strict JSON only.","maxTokens":2600,"output":"edit"},"view":{"html":"<main class=\"final-edit\"><header><h1>AI Final Edit</h1><p>Ask for a focused polish pass, then review every proposed change.</p></header><label for=\"direction\">What should improve?</label><textarea id=\"direction\" rows=\"6\" maxlength=\"6000\"></textarea><button id=\"run\" type=\"button\">Prepare final edit</button><output id=\"status\" role=\"status\" aria-live=\"polite\">Waiting for a timeline.</output></main>\n","css":".final-edit { box-sizing: border-box; max-width: 760px; min-height: 100%; margin: 0 auto; padding: 24px; color: var(--fg); background: var(--bg); font-family: var(--font-body); }.final-edit h1 { margin: 0 0 8px; font-family: var(--font-display); font-size: 36px; font-style: italic; font-weight: 200; }.final-edit p,.final-edit output { color: var(--fg-muted); }.final-edit label { display: block; margin: 24px 0 8px; }.final-edit textarea { box-sizing: border-box; width: 100%; padding: 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg-elev-1); color: var(--fg); font: inherit; line-height: 1.6; resize: vertical; }.final-edit button { display: block; margin: 16px 0; padding: 11px 18px; border: 1px solid var(--fg); border-radius: 999px; background: var(--fg); color: var(--bg); font: inherit; cursor: pointer; }.final-edit button:disabled { opacity: .5; cursor: default; }.final-edit textarea:focus-visible,.final-edit button:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }\n","javascript":"const instruction=document.getElementById('direction'),run=document.getElementById('run'),status=document.getElementById('status');\n\nlet current={},busy=false,revision=0,canEdit=false;\nrun.disabled=true;\nStillMade.bindShared('direction','direction');\n\nconst refresh=shared=>{\n canEdit=shared.canEdit;run.disabled=busy||!canEdit||!current.timeline;\n if(!busy)status.textContent=shared.outputs.edit?'Saved proposal ready. Review every change, then Apply.':current.timeline?'Ready to prepare a reviewable polish pass.':'Waiting for a timeline.';\n};\nStillMade.onShared(refresh);\nStillMade.onInput(input=>{\n current=input;revision+=1;\n StillMade.setSharedDefaults({direction:input.direction||''});\n refresh(StillMade.getShared());\n});\nrun.addEventListener('click',async()=>{\n if(busy||!canEdit)return;\n const request=instruction.value.trim();\n if(!current.timeline){status.textContent='Connect a timeline first.';return;}\n if(!request){status.textContent='Describe the polish you want.';return;}\n \n const started=revision;busy=true;run.disabled=true;status.textContent='Review the AI call in StillMade to continue.';\n try{const result=await StillMade.run({timeline:current.timeline,direction:request});status.textContent=result.edit?'Proposal ready. Review every change, then Apply.':'No edit proposal was returned.';}\n catch(error){status.textContent=error.message||'The edit could not be prepared.';}\n finally{busy=false;run.disabled=!canEdit||!current.timeline;if(started!==revision)status.textContent='Timeline changed. Run again for the current cut.';}\n});\n"},"tests":[{"name":"Polish a short finished cut","input":{"timeline":{"schemaVersion":1,"activeTimelineId":"timeline-1","tracks":[{"id":"video"}],"clips":[{"id":"clip-1","trackId":"video","kind":"video","url":"https://media.example/clip.mp4","start":0,"duration":4}],"audioItems":[],"captions":[]},"direction":"Add a restrained finish while preserving the clip."},"expectations":{"edit":{"kind":"timeline-edit","minCommands":1,"maxCommands":20}}},{"name":"Balance an existing audio bed","input":{"timeline":{"schemaVersion":1,"activeTimelineId":"timeline-2","tracks":[{"id":"audio"}],"clips":[],"audioItems":[{"id":"music-1","trackId":"audio","kind":"audio","url":"https://media.example/music.wav","start":0,"duration":12,"volume":120}],"captions":[]},"direction":"Lower the music to a balanced level without replacing it."},"expectations":{"edit":{"kind":"timeline-edit","minCommands":1,"maxCommands":10}}}],"portable":{"format":"stillmade-block/1","dependencies":[],"sources":[{"kind":"original","license":"MIT","paths":["LICENSE","src/capability.json","src/view.json"],"evidence":["upstream/0/LICENSE","upstream/0/src/capability.json","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/capability.json":"{\n  \"schemaVersion\": 1,\n  \"operation\": \"timeline.propose\",\n  \"context\": {\n    \"timeline\": {\n      \"$input\": \"timeline\"\n    },\n    \"direction\": {\n      \"$input\": \"direction\"\n    }\n  },\n  \"instruction\": \"Act as a restrained final editor. Follow the user's direction using only supported StillMade timeline-edit commands. Preserve media URLs, asset identities, clip content, locked items, story order, and existing work unless the direction explicitly requires a supported change. Prefer a small set of material changes. Every command must copy the exact current target into before. Use the timeline activeTimelineId. Never invent clips, audio, captions, tracks, media, transitions, LUTs, or IDs. Return strict JSON only.\",\n  \"maxTokens\": 2600,\n  \"output\": \"edit\"\n}","upstream/0/src/view.json":"{\n  \"html\": \"<main class=\\\"final-edit\\\"><header><h1>AI Final Edit</h1><p>Ask for a focused polish pass, then review every proposed change.</p></header><label for=\\\"direction\\\">What should improve?</label><textarea id=\\\"direction\\\" rows=\\\"6\\\" maxlength=\\\"6000\\\"></textarea><button id=\\\"run\\\" type=\\\"button\\\">Prepare final edit</button><output id=\\\"status\\\" role=\\\"status\\\" aria-live=\\\"polite\\\">Waiting for a timeline.</output></main>\\n\",\n  \"css\": \".final-edit { box-sizing: border-box; max-width: 760px; min-height: 100%; margin: 0 auto; padding: 24px; color: var(--fg); background: var(--bg); font-family: var(--font-body); }.final-edit h1 { margin: 0 0 8px; font-family: var(--font-display); font-size: 36px; font-style: italic; font-weight: 200; }.final-edit p,.final-edit output { color: var(--fg-muted); }.final-edit label { display: block; margin: 24px 0 8px; }.final-edit textarea { box-sizing: border-box; width: 100%; padding: 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg-elev-1); color: var(--fg); font: inherit; line-height: 1.6; resize: vertical; }.final-edit button { display: block; margin: 16px 0; padding: 11px 18px; border: 1px solid var(--fg); border-radius: 999px; background: var(--fg); color: var(--bg); font: inherit; cursor: pointer; }.final-edit button:disabled { opacity: .5; cursor: default; }.final-edit textarea:focus-visible,.final-edit button:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }\\n\",\n  \"javascript\": \"const instruction=document.getElementById('direction'),run=document.getElementById('run'),status=document.getElementById('status');\\n\\nlet current={},busy=false,revision=0,canEdit=false;\\nrun.disabled=true;\\nStillMade.bindShared('direction','direction');\\n\\nconst refresh=shared=>{\\n canEdit=shared.canEdit;run.disabled=busy||!canEdit||!current.timeline;\\n if(!busy)status.textContent=shared.outputs.edit?'Saved proposal ready. Review every change, then Apply.':current.timeline?'Ready to prepare a reviewable polish pass.':'Waiting for a timeline.';\\n};\\nStillMade.onShared(refresh);\\nStillMade.onInput(input=>{\\n current=input;revision+=1;\\n StillMade.setSharedDefaults({direction:input.direction||''});\\n refresh(StillMade.getShared());\\n});\\nrun.addEventListener('click',async()=>{\\n if(busy||!canEdit)return;\\n const request=instruction.value.trim();\\n if(!current.timeline){status.textContent='Connect a timeline first.';return;}\\n if(!request){status.textContent='Describe the polish you want.';return;}\\n \\n const started=revision;busy=true;run.disabled=true;status.textContent='Review the AI call in StillMade to continue.';\\n try{const result=await StillMade.run({timeline:current.timeline,direction:request});status.textContent=result.edit?'Proposal ready. Review every change, then Apply.':'No edit proposal was returned.';}\\n catch(error){status.textContent=error.message||'The edit could not be prepared.';}\\n finally{busy=false;run.disabled=!canEdit||!current.timeline;if(started!==revision)status.textContent='Timeline changed. Run again for the current cut.';}\\n});\\n\"\n}"},"lineage":{"parents":[],"changes":"Packaged original Block source for StillMade."}}}],"license":"MIT"}