{"schemaVersion":1,"id":"recommended.sm-voiceover","version":"1.0.0","name":"Voiceover workflow","description":"An editable production workflow using Voiceover v2.1.1.","stages":[{"id":"main","blockId":"sm.voiceover","version":"2.1.1","label":"Voiceover"}],"connections":[],"packages":[{"manifest":{"schemaVersion":1,"sdkVersion":"0.1.0","id":"sm.voiceover","version":"2.1.1","name":"Voiceover","description":"Review a narration script and generate a stored WAV take through StillMade's approved speech capability in a portable Voiceover workspace.","kind":"workspace","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":{"input":{"type":"script","primary":true,"role":"narration_script","description":"The reviewed narration script to speak."}},"outputs":{"output":{"type":"audio","primary":true,"role":"narration_audio","description":"The stored canonical WAV narration take."}},"permissions":{"project":[],"capabilities":["audio.speech"],"network":[],"filesystem":[],"secrets":[]},"ui":[{"port":"input","control":"text"}]},"capability":{"schemaVersion":1,"operation":"audio.speech","text":{"$input":"input"},"output":"output"},"view":{"html":"<main class=\"voiceover\">\n  <header class=\"voiceover-heading\">\n    <div><small>PORTABLE WORKSPACE</small><h1>Voiceover</h1><p>Review the words, then create a narration take.</p></div>\n    <output id=\"length\">0 words · about 0:00</output>\n  </header>\n  <section class=\"voiceover-layout\">\n    <div class=\"script-panel\">\n      <label for=\"script\">Narration script</label>\n      <textarea id=\"script\" rows=\"16\" maxlength=\"3800\" placeholder=\"Paste or connect a finished narration script…\"></textarea>\n      <div class=\"script-meta\"><span id=\"characters\">0 / 3,800 characters</span><button id=\"restore\" type=\"button\" disabled>Restore connected script</button></div>\n      <button id=\"generate\" data-stillmade-action=\"run\" type=\"button\" class=\"primary\" disabled>Generate voiceover</button>\n      <p class=\"note\">StillMade shows the voice, provider, payment method, and maximum credits for approval before generating.</p>\n    </div>\n    <aside class=\"take-panel\" aria-label=\"Narration take\">\n      <small>LATEST TAKE</small>\n      <div class=\"take-empty\" id=\"take-empty\"><strong>No take yet</strong><p>Your generated audio will appear here and become this Block’s typed output.</p></div>\n      <div class=\"take-ready\" id=\"take-ready\" hidden>\n        <audio id=\"audio\" controls></audio>\n        <dl><div><dt>Duration</dt><dd id=\"duration\">—</dd></div><div><dt>Format</dt><dd id=\"format\">WAV · 24 kHz mono</dd></div></dl>\n        <p>Edit the script and generate again to create a replacement take. The previous saved media version remains available to the project.</p>\n      </div>\n      <p id=\"status\" role=\"status\" aria-live=\"polite\">Add or connect a script to begin.</p>\n    </aside>\n  </section>\n</main>\n","css":".voiceover { box-sizing: border-box; min-height: 100%; padding: 24px; color: var(--fg); background: var(--bg); font-family: var(--font-body); }\n.voiceover-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--border-tok); padding-bottom: 18px; }\n.voiceover h1 { margin: 3px 0 8px; font-family: var(--font-display); font-size: 38px; font-style: italic; font-weight: 200; }\n.voiceover h1 + p, .voiceover .note, .take-panel p { color: var(--fg-muted); line-height: 1.55; }\n.voiceover small { color: var(--fg-subtle); font-size: 10px; font-weight: 700; letter-spacing: .12em; }\n.voiceover output { color: var(--fg-subtle); font-size: 12px; }\n.voiceover-layout { display: grid; grid-template-columns: minmax(320px, 1.4fr) minmax(250px, .8fr); gap: 28px; }\n.voiceover label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 650; }\n.voiceover textarea { box-sizing: border-box; width: 100%; resize: vertical; padding: 14px; border: 1px solid var(--border-tok); border-radius: var(--r-3); color: var(--fg); background: var(--bg-elev-1); font: inherit; line-height: 1.65; }\n.voiceover button { min-height: 44px; padding: 10px 16px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--fg); background: var(--bg); font: inherit; cursor: pointer; }\n.voiceover button:disabled { opacity: .45; cursor: default; }\n.voiceover .primary { width: 100%; margin-top: 18px; color: var(--bg); background: var(--fg); }\n.voiceover button:focus-visible, .voiceover textarea:focus-visible, .voiceover audio:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }\n.script-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; color: var(--fg-subtle); font-size: 12px; }\n.script-meta button { min-height: 44px; padding: 6px 12px; }\n.voiceover .note { margin: 9px 0 0; font-size: 12px; }\n.take-panel { min-width: 0; padding: 18px; border: 1px solid var(--border-tok); border-radius: var(--r-3); background: var(--bg-elev-1); }\n.take-empty { margin-top: 28px; padding: 22px 0; text-align: center; }\n.take-empty p { max-width: 280px; margin: 9px auto; }\n.take-ready { margin-top: 20px; }\n.take-ready audio { width: 100%; }\n.take-ready dl { display: grid; gap: 8px; margin: 18px 0; }\n.take-ready dl div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--divider); padding-bottom: 8px; }\n.take-ready dt { color: var(--fg-muted); }\n.take-ready dd { margin: 0; text-align: right; }\n#status { min-height: 24px; margin: 20px 0 0; }\n@media (max-width: 720px) { .voiceover { padding: 16px; } .voiceover-heading { align-items: flex-start; flex-direction: column; } .voiceover-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; } }\n","javascript":"const script = document.getElementById('script');\nconst generate = document.getElementById('generate');\nconst restore = document.getElementById('restore');\nconst status = document.getElementById('status');\nconst length = document.getElementById('length');\nconst characters = document.getElementById('characters');\nconst takeEmpty = document.getElementById('take-empty');\nconst takeReady = document.getElementById('take-ready');\nconst audio = document.getElementById('audio');\nconst duration = document.getElementById('duration');\nlet connected = '';\nlet busy = false;\nlet revision = 0;\n\nconst scriptText = value => value && typeof value.text === 'string' ? value.text : '';\nconst clock = seconds => {\n  const total = Math.max(0, Math.round(seconds));\n  return String(Math.floor(total / 60)) + ':' + String(total % 60).padStart(2, '0');\n};\nconst update = () => {\n  const text = script.value;\n  const words = text.trim() ? text.trim().split(/\\s+/).length : 0;\n  const seconds = words ? words / 2.5 : 0;\n  characters.textContent = String(text.length) + ' / 3,800 characters';\n  length.textContent = String(words) + (words === 1 ? ' word' : ' words') + ' · about ' + clock(seconds);\n  generate.disabled = busy || !text.trim() || text.length > 3800;\n  restore.disabled = busy || text === connected;\n};\nStillMade.onInput(values => {\n  connected = scriptText(values.input);\n  revision += 1;\n  if (!script.value.trim()) script.value = connected;\n  status.textContent = script.value.trim() ? 'Ready to generate a narration take.' : 'Add or connect a script to begin.';\n  update();\n});\nscript.addEventListener('input', update);\nrestore.addEventListener('click', () => {\n  if (busy) return;\n  script.value = connected;\n  status.textContent = connected ? 'Connected script restored.' : 'No connected script is available.';\n  update();\n});\ngenerate.addEventListener('click', async () => {\n  if (busy) return;\n  const text = script.value.trim();\n  if (!text) { status.textContent = 'Add a narration script first.'; return; }\n  if (text.length > 3800) { status.textContent = 'Shorten the script to 3,800 characters before generating.'; return; }\n  const started = revision;\n  busy = true;\n  update();\n  status.textContent = 'Review the voice and maximum credit amount in StillMade to continue.';\n  try {\n    const result = await StillMade.run({input: {schemaVersion: 1, text}});\n    const take = result.output;\n    if (!take || take.kind !== 'audio' || typeof take.url !== 'string') throw Error('No saved narration take was returned.');\n    audio.src = take.url;\n    duration.textContent = clock(take.duration) + ' · ' + String(take.bytes) + ' bytes';\n    takeEmpty.hidden = true;\n    takeReady.hidden = false;\n    status.textContent = started === revision ? 'Narration ready. This saved WAV is the Block output.' : 'Narration ready for the script used when generation started.';\n  } catch (error) {\n    status.textContent = error.message || 'The narration take could not be generated.';\n  } finally {\n    busy = false;\n    update();\n  }\n});\nupdate();\n"},"tests":[{"name":"Short narration","input":{"input":{"schemaVersion":1,"text":"The lighthouse kept watch as the storm crossed the bay."}},"expectations":{"output":{"kind":"audio","format":"wav","minDuration":0.1,"maxDuration":30,"minBytes":46,"maxBytes":1500000}}},{"name":"Maximum practical narration","input":{"input":{"schemaVersion":1,"text":"Morning arrived quietly. By noon, the town square was full of music. The narration remains reviewed, bounded, and ready for a replacement take."}},"expectations":{"output":{"kind":"audio","format":"wav","minDuration":0.1,"maxDuration":45,"minBytes":46,"maxBytes":2200000}}}],"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\": \"audio.speech\",\n  \"text\": {\n    \"$input\": \"input\"\n  },\n  \"output\": \"output\"\n}","upstream/0/src/view.json":"{\n  \"html\": \"<main class=\\\"voiceover\\\">\\n  <header class=\\\"voiceover-heading\\\">\\n    <div><small>PORTABLE WORKSPACE</small><h1>Voiceover</h1><p>Review the words, then create a narration take.</p></div>\\n    <output id=\\\"length\\\">0 words · about 0:00</output>\\n  </header>\\n  <section class=\\\"voiceover-layout\\\">\\n    <div class=\\\"script-panel\\\">\\n      <label for=\\\"script\\\">Narration script</label>\\n      <textarea id=\\\"script\\\" rows=\\\"16\\\" maxlength=\\\"3800\\\" placeholder=\\\"Paste or connect a finished narration script…\\\"></textarea>\\n      <div class=\\\"script-meta\\\"><span id=\\\"characters\\\">0 / 3,800 characters</span><button id=\\\"restore\\\" type=\\\"button\\\" disabled>Restore connected script</button></div>\\n      <button id=\\\"generate\\\" data-stillmade-action=\\\"run\\\" type=\\\"button\\\" class=\\\"primary\\\" disabled>Generate voiceover</button>\\n      <p class=\\\"note\\\">StillMade shows the voice, provider, payment method, and maximum credits for approval before generating.</p>\\n    </div>\\n    <aside class=\\\"take-panel\\\" aria-label=\\\"Narration take\\\">\\n      <small>LATEST TAKE</small>\\n      <div class=\\\"take-empty\\\" id=\\\"take-empty\\\"><strong>No take yet</strong><p>Your generated audio will appear here and become this Block’s typed output.</p></div>\\n      <div class=\\\"take-ready\\\" id=\\\"take-ready\\\" hidden>\\n        <audio id=\\\"audio\\\" controls></audio>\\n        <dl><div><dt>Duration</dt><dd id=\\\"duration\\\">—</dd></div><div><dt>Format</dt><dd id=\\\"format\\\">WAV · 24 kHz mono</dd></div></dl>\\n        <p>Edit the script and generate again to create a replacement take. The previous saved media version remains available to the project.</p>\\n      </div>\\n      <p id=\\\"status\\\" role=\\\"status\\\" aria-live=\\\"polite\\\">Add or connect a script to begin.</p>\\n    </aside>\\n  </section>\\n</main>\\n\",\n  \"css\": \".voiceover { box-sizing: border-box; min-height: 100%; padding: 24px; color: var(--fg); background: var(--bg); font-family: var(--font-body); }\\n.voiceover-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--border-tok); padding-bottom: 18px; }\\n.voiceover h1 { margin: 3px 0 8px; font-family: var(--font-display); font-size: 38px; font-style: italic; font-weight: 200; }\\n.voiceover h1 + p, .voiceover .note, .take-panel p { color: var(--fg-muted); line-height: 1.55; }\\n.voiceover small { color: var(--fg-subtle); font-size: 10px; font-weight: 700; letter-spacing: .12em; }\\n.voiceover output { color: var(--fg-subtle); font-size: 12px; }\\n.voiceover-layout { display: grid; grid-template-columns: minmax(320px, 1.4fr) minmax(250px, .8fr); gap: 28px; }\\n.voiceover label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 650; }\\n.voiceover textarea { box-sizing: border-box; width: 100%; resize: vertical; padding: 14px; border: 1px solid var(--border-tok); border-radius: var(--r-3); color: var(--fg); background: var(--bg-elev-1); font: inherit; line-height: 1.65; }\\n.voiceover button { min-height: 44px; padding: 10px 16px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--fg); background: var(--bg); font: inherit; cursor: pointer; }\\n.voiceover button:disabled { opacity: .45; cursor: default; }\\n.voiceover .primary { width: 100%; margin-top: 18px; color: var(--bg); background: var(--fg); }\\n.voiceover button:focus-visible, .voiceover textarea:focus-visible, .voiceover audio:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }\\n.script-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; color: var(--fg-subtle); font-size: 12px; }\\n.script-meta button { min-height: 44px; padding: 6px 12px; }\\n.voiceover .note { margin: 9px 0 0; font-size: 12px; }\\n.take-panel { min-width: 0; padding: 18px; border: 1px solid var(--border-tok); border-radius: var(--r-3); background: var(--bg-elev-1); }\\n.take-empty { margin-top: 28px; padding: 22px 0; text-align: center; }\\n.take-empty p { max-width: 280px; margin: 9px auto; }\\n.take-ready { margin-top: 20px; }\\n.take-ready audio { width: 100%; }\\n.take-ready dl { display: grid; gap: 8px; margin: 18px 0; }\\n.take-ready dl div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--divider); padding-bottom: 8px; }\\n.take-ready dt { color: var(--fg-muted); }\\n.take-ready dd { margin: 0; text-align: right; }\\n#status { min-height: 24px; margin: 20px 0 0; }\\n@media (max-width: 720px) { .voiceover { padding: 16px; } .voiceover-heading { align-items: flex-start; flex-direction: column; } .voiceover-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; } }\\n\",\n  \"javascript\": \"const script = document.getElementById('script');\\nconst generate = document.getElementById('generate');\\nconst restore = document.getElementById('restore');\\nconst status = document.getElementById('status');\\nconst length = document.getElementById('length');\\nconst characters = document.getElementById('characters');\\nconst takeEmpty = document.getElementById('take-empty');\\nconst takeReady = document.getElementById('take-ready');\\nconst audio = document.getElementById('audio');\\nconst duration = document.getElementById('duration');\\nlet connected = '';\\nlet busy = false;\\nlet revision = 0;\\n\\nconst scriptText = value => value && typeof value.text === 'string' ? value.text : '';\\nconst clock = seconds => {\\n  const total = Math.max(0, Math.round(seconds));\\n  return String(Math.floor(total / 60)) + ':' + String(total % 60).padStart(2, '0');\\n};\\nconst update = () => {\\n  const text = script.value;\\n  const words = text.trim() ? text.trim().split(/\\\\s+/).length : 0;\\n  const seconds = words ? words / 2.5 : 0;\\n  characters.textContent = String(text.length) + ' / 3,800 characters';\\n  length.textContent = String(words) + (words === 1 ? ' word' : ' words') + ' · about ' + clock(seconds);\\n  generate.disabled = busy || !text.trim() || text.length > 3800;\\n  restore.disabled = busy || text === connected;\\n};\\nStillMade.onInput(values => {\\n  connected = scriptText(values.input);\\n  revision += 1;\\n  if (!script.value.trim()) script.value = connected;\\n  status.textContent = script.value.trim() ? 'Ready to generate a narration take.' : 'Add or connect a script to begin.';\\n  update();\\n});\\nscript.addEventListener('input', update);\\nrestore.addEventListener('click', () => {\\n  if (busy) return;\\n  script.value = connected;\\n  status.textContent = connected ? 'Connected script restored.' : 'No connected script is available.';\\n  update();\\n});\\ngenerate.addEventListener('click', async () => {\\n  if (busy) return;\\n  const text = script.value.trim();\\n  if (!text) { status.textContent = 'Add a narration script first.'; return; }\\n  if (text.length > 3800) { status.textContent = 'Shorten the script to 3,800 characters before generating.'; return; }\\n  const started = revision;\\n  busy = true;\\n  update();\\n  status.textContent = 'Review the voice and maximum credit amount in StillMade to continue.';\\n  try {\\n    const result = await StillMade.run({input: {schemaVersion: 1, text}});\\n    const take = result.output;\\n    if (!take || take.kind !== 'audio' || typeof take.url !== 'string') throw Error('No saved narration take was returned.');\\n    audio.src = take.url;\\n    duration.textContent = clock(take.duration) + ' · ' + String(take.bytes) + ' bytes';\\n    takeEmpty.hidden = true;\\n    takeReady.hidden = false;\\n    status.textContent = started === revision ? 'Narration ready. This saved WAV is the Block output.' : 'Narration ready for the script used when generation started.';\\n  } catch (error) {\\n    status.textContent = error.message || 'The narration take could not be generated.';\\n  } finally {\\n    busy = false;\\n    update();\\n  }\\n});\\nupdate();\\n\"\n}"},"lineage":{"parents":[],"changes":"Packaged original Block source for StillMade."}}}],"license":"MIT"}