is https://user:pass@foo.com a webhook? yes is blah://foo/bar a webhook? no UNMASK RESULT This is a test ~FN:hangup()-; 1234 ~FN:hangup()-; STRIP UNMASK RESULT (null) Number [+1 213-555-1212] formatted to [(213) 555-1212] TOKENS EN 374 TOKENS FG 374 TOKENS FR 400 TTS NUMBER [Testing numbers + 1,. 4 1 4,. 5 5 5,. 1 2 1 2 and + 1,. 2 1 2,. 4 5 5,. 1 2 1 2 and + 1 2 1 2 1 2 3 1 2 3 4,. and + 1,. 3 3 2,. 3 4 5,. 1 2 3 4 and + 4 4,. 1 1 7,. 2 3 4,. 5 6 7 8 and + 1,. 9 0 8,. 4 3 4,. 9 5 7 8 ] TTS NUMBER [I heard your phone number as 2 6 2,. 2 5 2,. 3 2 6 2 —is that correct?] REPLACE TEST what is SWML? R: [bar] R: [{ "number": 55 }] R: [29] R: [55] NULL R: [12.500000] R: [ex1 LONGER stRing] R: [cval2] R: [phone national 2___foobar___6___foobar___2___foobar___3___foobar___3___foobar___4___foobar___5___foobar___4___foobar___0___foobar___0] R: [phone international +1 262-334-5400] R: [phone RFC3966 tel:+1-262-334-5400] R: [phone e164 +12623345400] R: [NESTED 'a' 'ex1 LONGER stRing'] R: [EMPTY 'a' ''] R: [function 'bar' 'ex1 LONGER stRing' and ] R: [expr function 2+2=4] R: [tz function 06/09/25 11:49:18] R: [the answer is 'bar' and '12.500000' and {ex1%20longer%20string} the end] R: [colon test ] R: [the undef vars answer is and and () the end] R: [no vars in this longer ${ string what will happen?] R: [end on half var ${] R: [end on null var ] R: [empty var in this longer string what will happen?] R: [empty var in this longer string what will happen?] R: [lots o' dots string what will happen?] R: [url encode the val of grr%3Dthis%20and%20that ok?] R: [array test url encode the val of Orlando ok?] R: [array test url encode the val of Milwaukee,%20WI ok?] R: [array test url encode the val of ok?] OLD { "name": "fred\"\\", "age": 25, "string": "${name} ${age}" } NEW { "name": "fred\"\\", "age": 25, "string": "fred\"\\ 25" } 0x6060024c46a0The string contains an emoji. stripped string [Hello, world! Olá] COUNT 1 DONE [OK, goodbye ~FN:assistant_hangup()-;][OK, goodbye **assistant_hangup**] PARSE FIRST [ln][English] ------ ORIG: [~LN(English)-; Greetings, I am Franklin, an expert at all things Star Wars. How can I assist you today? ~LN(English)-; Greetings, I am Franklin, an expert at all things Star Wars. How can I assist you today? ] STRIPPED 1, x: [ Greetings, I am Franklin, an expert at all things Star Wars. How can I assist you today? Greetings, I am Franklin, an expert at all things Star Wars. How can I assist you today? ] PREFIXES 0, x: [(null)] (nil) SKIP [Greetings, I am Franklin, an expert at all things Star Wars. How can I assist you today? ~LN(English)-; Greetings, I am Franklin, an expert at all things Star Wars. How can I assist you today? ] SPACE TEST [1][0][0][1][1] Orig [https://me:mine@cool.com/test.cgi?1234] Ret [1] Parsed [https://cool.com/test.cgi?1234] User [me] Pass [mine] Orig [https://user:pass@cool.com/test.cgi?1234] Ret [1] Parsed [https://cool.com/test.cgi?1234] User [user] Pass [pass] Orig [https://cool.com/test.cgi?1234] Ret [0] Parsed [(null)] User [(null)] Pass [(null)] Orig [https://user:pass@subdomain.cool.com/path] Ret [1] Parsed [https://subdomain.cool.com/path] User [user] Pass [pass] Orig [https://user@domain.com:1234@myhandler.com/myscript] Ret [1] Parsed [https://myhandler.com/myscript] User [user@domain.com] Pass [1234] Orig [https://user:#$%@@cool.com/test.cgi?1234] Ret [1] Parsed [https://cool.com/test.cgi?1234] User [user] Pass [#$%@] Orig [https://user:%23$%25%40@cool.com/test.cgi?1234] Ret [1] Parsed [https://cool.com/test.cgi?1234] User [user] Pass [#$%@] Orig [https://user::::@@@@cool.com/test.cgi?1234] Ret [1] Parsed [https://cool.com/test.cgi?1234] User [user] Pass [:::@@@] Orig [https://user:pass with space@cool.com/test.cgi] Ret [1] Parsed [https://cool.com/test.cgi] User [user] Pass [pass with space] Orig [https://::::@domain.com/foo.cgi] Ret [0] Parsed [(null)] User [(null)] Pass [(null)] Orig [user@@@@@@domain.com] Ret [0] Parsed [(null)] User [(null)] Pass [(null)] Orig [https://user@@@@@@domain.com/foo] Ret [1] Parsed [https://@@@@@domain.com/foo] User [user] Pass [] Orig [https://::::::::::::@domain.com/path] Ret [0] Parsed [(null)] User [(null)] Pass [(null)] Orig [https://@domain.com/path] Ret [0] Parsed [(null)] User [(null)] Pass [(null)] Orig [https://:@domain.com/path] Ret [0] Parsed [(null)] User [(null)] Pass [(null)] Orig [https://user:@domain.com/path] Ret [1] Parsed [https://domain.com/path] User [user] Pass [] Orig [https://user:pass@co%6Fl.com/test] Ret [1] Parsed [https://co%6Fl.com/test] User [user] Pass [pass] Orig [https://user%20name:pass@domain.com/path] Ret [1] Parsed [https://domain.com/path] User [user name] Pass [pass] Orig [https://user:pa%00ss@domain.com/path] Ret [1] Parsed [https://domain.com/path] User [user] Pass [] Orig [https://user@dom%41in.com/path] Ret [1] Parsed [https://dom%41in.com/path] User [user] Pass [] Orig [https://usernamewithaverylongnamethatexceedstypicallengthlimits:passwordwithaverylongnametotestlimits@cool.com/path] Ret [1] Parsed [https://cool.com/path] User [usernamewithaverylongnamethatexceedstypicallengthlimits] Pass [passwordwithaverylongnametotestlimits] Orig [https://user::::pass::::@domain.com/path] Ret [1] Parsed [https://domain.com/path] User [user] Pass [:::pass::::] Orig [https://user:user:user:user:pass@domain.com/path] Ret [1] Parsed [https://domain.com/path] User [user] Pass [user:user:user:pass] Orig [user:pass@domain.com] Ret [0] Parsed [(null)] User [(null)] Pass [(null)] Orig [https://user:pass@] Ret [0] Parsed [(null)] User [(null)] Pass [(null)] Orig [https:///path] Ret [0] Parsed [(null)] User [(null)] Pass [(null)] Orig [https://user:pass@:/path] Ret [0] Parsed [(null)] User [(null)] Pass [(null)] J: { "parsed": [{ "data": [{ "question": "What is your name?", "answer": "Tony" }, { "question": "What is your job?", "answer": "CEO" }, { "question": "Have you ever used SignalWire products before?", "answer": "Yes" }, { "question": "If yes, Do you have any feedback?", "answer": "Better documentation" }] }], "raw": "This is json. {\"data\": [{\"question\": \"What is your name?\", \"answer\": \"Tony\"}, {\"question\": \"What is your job?\", \"answer\": \"CEO\"}, {\"question\": \"Have you ever used SignalWire products before?\", \"answer\": \"Yes\"}, {\"question\": \"If yes, Do you have any feedback?\", \"answer\": \"Better documentation\"}]}", "substituted": "This is json. " } Input: '1h' => 1 seconds Input: '30m' => 30 seconds Input: '45s' => 45 seconds Input: '1:30' => 90 seconds Input: '00:30' => 30 seconds Input: '1:2:30' => 3750 seconds Input: '1234567890' => 1234567890 seconds Input: 'invalid' => Error: Invalid format Input: '-1h' => Error: Invalid characters in input Input: '1:::30' => Error: Consecutive colons detected Input: '999999999999999999999h' => Error: Numeric overflow Input: ' 1h ' => 1 seconds Input: '1h30m' => 130 seconds Input: '1m-30s' => Error: Invalid characters in input Input: '1:30:60' => Error: Invalid format Input: '1:2:3:4' => Error: Too many colons in input Input: '12345678901234567890h' => Error: Numeric overflow Input: '@#$%' => Error: Invalid characters in input Test case 0: Original: No markdown here. Stripped: No markdown here. Test case 1: Original: # Header Text Some content. Stripped: Header Text Some content. Test case 2: Original: #include Stripped: #include Test case 3: Original: A paragraph with *italic* and **bold** text. Stripped: A paragraph with italic and bold text. Test case 4: Original: > A blockquote line Stripped: A blockquote line Test case 5: Original: - A bullet list item Stripped: A bullet list item Test case 6: Original: 1. An ordered list item Stripped: 1. An ordered list item Test case 7: Original: ```c int main() { return 0; } ``` Stripped: int main() { return 0; } Test case 8: Original: Inline code: `printf("Hello, World!");` remains. Stripped: Inline code: printf("Hello, World!"); remains. Test case 9: Original: [Link text](http://example.com) Stripped: Link text Test case 10: Original: ![Image alt](http://example.com/image.png) Stripped: Image alt Test case 11: Original: Mixed [link](http://example.com) and `code` in one line. Stripped: Mixed link and code in one line. Test case 12: Original: #include int main() { printf("Hello, World!\n"); return 0; } ] Stripped: #include int main() { printf("Hello, World!\n"); return 0; } ] Test case 13: Original: **Sonic the Hedgehog 3** - This action-packed adventure is set to release on December nineteenth, Stripped: Sonic the Hedgehog 3 - This action-packed adventure is set to release on December nineteenth, Test case 14: Original: ## Subheader This is a multi-line paragraph. It should maintain its spacing and line breaks even after markdown is stripped. Stripped: Subheader This is a multi-line paragraph. It should maintain its spacing and line breaks even after markdown is stripped. Test case 15: Original: > Blockquote with multiple lines > that should be preserved in some form. And this is a normal paragraph. Stripped: Blockquote with multiple lines that should be preserved in some form. And this is a normal paragraph. Test case 16: Original: - List item one - List item two - Nested item - List item three Stripped: List item one List item two Nested item List item three Test case 17: Original: 1. First ordered item 2. Second ordered item 3. Third ordered item Stripped: 1. First ordered item 2. Second ordered item 3. Third ordered item Test case 18: Original: A paragraph with multiple inline code elements: `code1` and then `code2` followed by text. Stripped: A paragraph with multiple inline code elements: code1 and then code2 followed by text. Test case 19: Original: A paragraph with *emphasis*, **strong emphasis**, and ***both***. Also, underscores _and_ tildes ~are~ present. Stripped: A paragraph with emphasis, strong emphasis, and both. Also, underscores and tildes are present. Test case 20: Original: Fenced code block with language specified: ```python def hello_world(): print('Hello, world!') ``` Another paragraph after the code block. Stripped: Fenced code block with language specified: def hello_world(): print('Hello, world!') Another paragraph after the code block. Test case 21: Original: A complex nested example: # Header Some introductory text. > A blockquote with a list: > - Item one > - Item two More text after the blockquote. Stripped: A complex nested example: Header Some introductory text. A blockquote with a list: Item one Item two More text after the blockquote. Running XML escape tests ======================== Test 1: Input: Hello world Type: Plain text or text with special characters Output: (NULL) - No escaping needed or NULL input Test 2: Input: Simple text without any special characters Type: Plain text or text with special characters Output: (NULL) - No escaping needed or NULL input Test 3: Input: Text with numbers 123 and symbols !@#$%^*()_+ Type: Plain text or text with special characters Output: (NULL) - No escaping needed or NULL input Test 4: Input: This & that Type: Plain text or text with special characters Output: This & that Test 5: Input: This < that Type: Plain text or text with special characters Output: This < that Test 6: Input: This > that Type: Plain text or text with special characters Output: This > that Test 7: Input: This " double quote Type: Plain text or text with special characters Output: This " double quote Test 8: Input: This ' single quote Type: Plain text or text with special characters Output: This ' single quote Test 9: Input: Multiple & < > " ' characters in one string Type: Contains XML tags but no tags Output: Multiple & < > " ' characters in one string Test 10: Input: AT&T company name with ampersand Type: Plain text or text with special characters Output: AT&T company name with ampersand Test 11: Input: 5 < 10 > 3 mathematical expressions Type: Contains XML tags but no tags Output: 5 < 10 > 3 mathematical expressions Test 12: Input: Emphasized text Type: Contains XML tags but no tags Output: Emphasized text Test 13: Input: Slow speech Type: Contains XML tags but no tags Output: Slow speech Test 14: Input: Type: Contains XML tags but no tags Output: Test 15: Input: tomato Type: Contains XML tags but no tags Output: tomato Test 16: Input: This is a sentence. This is another. Type: Contains XML tags but no tags Output: This is a sentence. This is another. Test 17: Input:

This is a paragraph with bold text.

Type: Contains XML tags but no tags Output:

This is a paragraph with bold text.

Test 18: Input: SSML Type: Contains XML tags but no tags Output: SSML Test 19: Input: Hello world Type: Contains tags Output: Hello world Test 20: Input: Simple speak tag Type: Contains tags Output: Simple speak tag Test 21: Input: Say this word Type: Contains tags Output: Say word Test 22: Input: Count 123 now Type: Contains tags Output: Count now Test 23: Input: This & that now Type: Contains tags Output: This & that now Test 24: Input: This basket pronunciation Type: Contains tags Output: This pronunciation Test 25: Input: Multiple nested tags with special & characters Type: Contains tags Output: Multiple special & characters Test 26: Input: Text before emphasized and after Type: Contains XML tags but no tags Output: Text before emphasized and after Test 27: Input: Mix of text and pauses Type: Contains XML tags but no tags Output: Mix of text and pauses Test 28: Input: A sentence with higher pitch in the middle Type: Contains XML tags but no tags Output: A sentence with higher pitch in the middle Test 29: Input: Special characters & in SSML content Type: Contains XML tags but no tags Output: Special characters & in SSML content Test 30: Input: Text with phoenix pronunciation and & ampersand Type: Contains XML tags but no tags Output: Text with phoenix pronunciation and & ampersand Test 31: Input: Text before inside speak and after Type: Contains tags Output: Text before inside speak and after Test 32: Input: Outer inner tags and text after Type: Contains tags Output: Outer tags Test 33: Input: Text with & special character and tag Type: Contains tags Output: Text with & special character and tag Test 34: Input: Multiple speak tag 1 and speak tag 2 instances Type: Contains tags Output: Multiple speak tag 1 and speak tag 2 instances Test 35: Input: Normal ' " shouldn't be escaped]]> text Type: Contains tags Output: Normal This & that < > ' " shouldn't be escaped text Test 36: Input: ' "]]> Type: Contains XML tags but no tags Output: ' "]]> Test 37: Input: ' "]]> Type: Contains XML tags but no tags Output: <![CDATA[Just CDATA with no tags & < > ' "]]> Test 38: Input: Text more text Type: Contains tags Output: Text more text Test 39: Input: Text tag Type: Contains XML tags but no tags Output: Text tag Test 40: Input: Text with & character and after Type: Contains XML tags but no tags Output: Text with & character <!-- Comment with & < > ' " --> and after Test 41: Input: Text inside Type: Contains tags Output: Text inside Test 42: Input: No speak tags Type: Contains XML tags but no tags Output: No speak tags Test 43: Input: Text & processing instruction Type: Contains XML tags but no tags Output: Text &amp; <?custom-pi?> processing instruction Test 44: Input: Fast & clear Type: Contains tags Output: Fast &amp; clear Test 45: Input: Fast & clear without speak Type: Contains XML tags but no tags Output: Fast & clear without speak Test 46: Input: Invalid attribute Type: Contains XML tags but no tags Output: Invalid attribute Test 47: Input: Attribute with special chars text Type: Contains XML tags but no tags Output: Attribute with special chars <tag attr="value&another">text</tag> Test 48: Input: Unclosed tag will this work? Type: Contains tags Output: Unclosed tag Test 49: Input: Unclosed tag without speak Type: Contains XML tags but no tags Output: Unclosed tag without speak Test 50: Input: Overlapping tags Type: Contains XML tags but no tags Output: Overlapping <a><b>tags</a></b> Test 51: Input: Type: Contains XML tags but no tags Output: <a><b><c></b></a></c> Test 52: Input: Incorrectly & escaped Type: Plain text or text with special characters Output: Incorrectly & escaped Test 53: Input: Type: Plain text or text with special characters Output: (NULL) - No escaping needed or NULL input Test 54: Input: (NULL) Type: Plain text or text with special characters Output: (NULL) - No escaping needed or NULL input Test 55: Input: Type: Plain text or text with special characters Output: (NULL) - No escaping needed or NULL input Test 56: Input: ><&"' Type: Contains XML tags but no tags Output: ><&"' Test 57: Input: <> Type: Contains XML tags but no tags Output: <> Test 58: Input: Type: Contains tags Output: Test 59: Input: Type: Contains tags Output: Test 60: Input: Type: Contains XML tags but no tags Output: Test 61: Input: <<>>&&''"" Type: Contains tags Output: Test 62: Input: <<>>&&''"" Type: Contains XML tags but no tags Output: <<>>&&''"" Test 63: Input: Type: Contains tags Output: Test 64: Input: Very very very & long string with many tags Type: Contains tags Output: Very very very & long with tags Test 65: Input: Very very very & long string with many tags Type: Contains XML tags but no tags Output: Very very very & long string with many tags Test 66: Input:
SSML inside HTML
Type: Contains tags Output:
SSML inside HTML
Test 67: Input: Text SSML more text Type: Contains tags Output: Text SSML more text Test 68: Input: SSML
HTML inside SSML
more SSML
Type: Contains tags Output: SSML more SSML Test 69: Input: Ah, your name is J U S T I N M A S S E Y! Nice to meet you! Type: Contains XML tags but no tags Output: Ah, your name is J U S T I N M A S S E Y! Nice to meet you! Rendered Markdown: ## Rules High-level operational guidelines. - Always respond. - Keep tone consistent. ### Formatting Use markdown syntax where appropriate. - Use `**` for bold. - Prefer lists over long paragraphs. #### Advanced Markdown Support nested lists and code blocks. - Support triple-backtick blocks. - Handle indentation properly. Rendered XML:
Rules High-level operational guidelines. Always respond. Keep tone consistent.
Formatting Use markdown syntax where appropriate. Use `**` for bold. Prefer lists over long paragraphs.
Advanced Markdown Support nested lists and code blocks. Support triple-backtick blocks. Handle indentation properly.
======= JSON: [{ "title": "Assistant Description", "body": "You are a helpful AI Assistant named Franklin.", "numbered": true }, { "title": "Key Skills", "body": "You have the following skills", "numberedBullets": true, "bullets": ["You like starwars.", "You can look up the weather at any location (including starwars planets).", "You can dial digits when asked."], "subsections": [{ "numbered": false, "title": "Communication Skills", "body": "You can explain things clearly." }, { "title": "Utility Functions", "body": "You can interact with external services." }], "numbered": false }, { "title": "At Conversation Start", "body": "Introduce yourself and see if the user has any questions." }] Rendered Markdown: ## 1. Assistant Description You are a helpful AI Assistant named Franklin. ## 2. Key Skills You have the following skills 1. You like starwars. 2. You can look up the weather at any location (including starwars planets). 3. You can dial digits when asked. ### Communication Skills You can explain things clearly. ### Utility Functions You can interact with external services. ## 3. At Conversation Start Introduce yourself and see if the user has any questions. Rendered XML:
1. Assistant Description You are a helpful AI Assistant named Franklin.
2. Key Skills You have the following skills You like starwars. You can look up the weather at any location (including starwars planets). You can dial digits when asked.
Communication Skills You can explain things clearly.
Utility Functions You can interact with external services.
3. At Conversation Start Introduce yourself and see if the user has any questions.
======= JSON: [{ "title": "System Persona", "body": "Act as a security-focused backend engineer experienced with WebSockets and TLS." }, { "title": "Problem Context", "body": "A developer is trying to set up a secure WebSocket (wss://) server but is unsure about certificate handling and client validation." }, { "title": "Response Strategy", "bullets": ["Explain how WSS differs from WS.", "Show the server configuration using a real code snippet.", "Include a list of common certificate pitfalls."] }, { "title": "Desired Outcome", "body": "The developer should be able to confidently deploy a WSS server with correct cert configuration." }, { "title": "Constraints", "bullets": ["Limit to 300 words.", "Assume they use Node.js with the ws library.", "Avoid unrelated technologies like NGINX or Apache."] }] Rendered Markdown: ## System Persona Act as a security-focused backend engineer experienced with WebSockets and TLS. ## Problem Context A developer is trying to set up a secure WebSocket (wss://) server but is unsure about certificate handling and client validation. ## Response Strategy - Explain how WSS differs from WS. - Show the server configuration using a real code snippet. - Include a list of common certificate pitfalls. ## Desired Outcome The developer should be able to confidently deploy a WSS server with correct cert configuration. ## Constraints - Limit to 300 words. - Assume they use Node.js with the ws library. - Avoid unrelated technologies like NGINX or Apache. Rendered XML:
System Persona Act as a security-focused backend engineer experienced with WebSockets and TLS.
Problem Context A developer is trying to set up a secure WebSocket (wss://) server but is unsure about certificate handling and client validation.
Response Strategy Explain how WSS differs from WS. Show the server configuration using a real code snippet. Include a list of common certificate pitfalls.
Desired Outcome The developer should be able to confidently deploy a WSS server with correct cert configuration.
Constraints Limit to 300 words. Assume they use Node.js with the ws library. Avoid unrelated technologies like NGINX or Apache.