{"manifest":{"schemaVersion":1,"sdkVersion":"0.1.0","id":"creator.block.26f5ff61-150b-4598-a49f-874cd1732b23","version":"1.0.0","name":"Count words and characters","description":"Count the words and characters in text you paste.","kind":"task","runtime":"javascript","license":"MIT","provenance":{"notice":"MIT License\n\nCopyright (c) 2026 StillMade SDK 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"},"inputs":{"text":{"type":"text","primary":true,"semantic":"pasted_text","required":true,"description":"Text pasted or typed by the user to count words and characters."}},"outputs":{"word_count":{"type":"integer","primary":true,"semantic":"word_count","description":"Number of words in the text. Words are separated by spaces, tabs or line breaks."},"character_count":{"type":"integer","semantic":"character_count","description":"Number of characters in the text, including spaces, line breaks and punctuation."}},"permissions":{"project":[],"network":[],"filesystem":[],"secrets":[]},"ui":[{"control":"text","port":"text"}],"summary":{"origin":"llm","status":"ready","generatedAt":"2026-10-09T01:41:32.220Z","sourceDigest":"a31a59ad45a86b4c7bd07358cfb642bc767d5c33f3fe7fd5a6acb5489b3e2bcd"}},"code":"const text = input.text;\nif (typeof text !== 'string') throw new Error('Input text must be plain text. Paste or type text into the input and run again.');\nconst trimmed = text.trim();\nconst words = trimmed.length === 0 ? 0 : trimmed.split(/\\s+/).length;\nreturn { word_count: words, character_count: Array.from(text).length };","tests":[{"name":"Two plain words","input":{"text":"Hello world"},"expected":{"word_count":2,"character_count":11}},{"name":"Extra spaces, punctuation and blank lines","input":{"text":"  Hello,   world!\n\nAgain  "},"expected":{"word_count":3,"character_count":26}},{"name":"Only spaces has no words","input":{"text":"   "},"expected":{"word_count":0,"character_count":3}},{"name":"Emoji counts as one character","input":{"text":"Hi 😀"},"expected":{"word_count":2,"character_count":4}}]}