{"id":"recommended.independent.recording-cue-cards","name":"Recording cue cards","stages":[{"id":"main","label":"Recording cue cards","blockId":"independent.recording-cue-cards","version":"1.0.0"}],"version":"1.0.0","packages":[{"code":"const words=input.text.trim()?input.text.trim().split(/\\s+/):[];\nif(words.length>20000)throw new Error('Use a script of at most 20,000 words.');\nconst cards=[];\nfor(let offset=0;offset<words.length;offset+=input.wordsPerCard){\n const chunk=words.slice(offset,offset+input.wordsPerCard);\n cards.push({number:cards.length+1,text:chunk.join(' '),wordCount:chunk.length,estimatedSeconds:Math.ceil(chunk.length*60/input.wordsPerMinute)});\n}\nreturn {text:cards.map(card=>'Card '+card.number+' ('+card.wordCount+' words, ~'+card.estimatedSeconds+'s)\\n'+card.text).join('\\n\\n'),cards,wordCount:words.length,estimatedSeconds:Math.ceil(words.length*60/input.wordsPerMinute)};\n","tests":[{"name":"Splits five words without losing order","input":{"text":"Hello world. Take a breath.","wordsPerCard":3,"wordsPerMinute":120},"expected":{"text":"Card 1 (3 words, ~2s)\nHello world. Take\n\nCard 2 (2 words, ~1s)\na breath.","cards":[{"text":"Hello world. Take","number":1,"wordCount":3,"estimatedSeconds":2},{"text":"a breath.","number":2,"wordCount":2,"estimatedSeconds":1}],"wordCount":5,"estimatedSeconds":3}},{"name":"Empty script has no cards or time","input":{"text":" \n\t "},"expected":{"text":"","cards":[],"wordCount":0,"estimatedSeconds":0}},{"name":"Retains Unicode punctuation and uses declared defaults","input":{"text":"“Ready?” café — go!"},"expected":{"text":"Card 1 (4 words, ~2s)\n“Ready?” café — go!","cards":[{"text":"“Ready?” café — go!","number":1,"wordCount":4,"estimatedSeconds":2}],"wordCount":4,"estimatedSeconds":2}},{"name":"Exact boundary adds no empty card","input":{"text":"One\ntwo\tthree","wordsPerCard":3,"wordsPerMinute":60},"expected":{"text":"Card 1 (3 words, ~3s)\nOne two three","cards":[{"text":"One two three","number":1,"wordCount":3,"estimatedSeconds":3}],"wordCount":3,"estimatedSeconds":3}}],"manifest":{"id":"independent.recording-cue-cards","ui":[{"port":"text","control":"text"},{"port":"wordsPerCard","control":"number"},{"port":"wordsPerMinute","control":"number"}],"kind":"task","name":"Recording cue cards","entry":"src/run.js","inputs":{"text":{"type":"text","primary":true,"required":true,"description":"Script to rehearse; whitespace is normalized between words."},"wordsPerCard":{"max":200,"min":3,"type":"integer","default":60,"description":"Maximum words on each card."},"wordsPerMinute":{"max":300,"min":60,"type":"integer","default":150,"description":"Estimated speaking rate; excludes pauses."}},"license":"MIT","outputs":{"text":{"type":"text","primary":true},"cards":{"type":"json"},"wordCount":{"type":"integer"},"estimatedSeconds":{"type":"integer"}},"runtime":"javascript","version":"1.0.0","provenance":{"notice":"MIT License\n\nCopyright (c) 2026 Recording Cue Cards contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and \nassociated documentation files (the \"Software\"), to deal in the Software without restriction, including \nwithout limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell \ncopies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the \nfollowing conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial \nportions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT \nLIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO \nEVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER \nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE \nUSE OR OTHER DEALINGS IN THE SOFTWARE.\n"},"sdkVersion":"0.1.0","description":"Split a script into numbered rehearsal cards and estimate speaking time without changing its words.","permissions":{"network":[],"project":[],"secrets":[],"filesystem":[]},"schemaVersion":1}}],"connections":[],"description":"A starting workflow for Recording cue cards.","schemaVersion":1}