(originalPath: string, content: string)
| 211 | // executable asset (a `.js`, or a script-kind asset) yields its decoded body. |
| 212 | // Pure/App-free — operates on the bundled payload only. |
| 213 | function bundledScriptCode(originalPath: string, content: string): string | null { |
| 214 | let decoded: string; |
| 215 | try { |
| 216 | decoded = decodeFromBase64(content); |
| 217 | } catch { |
| 218 | return null; |
| 219 | } |
| 220 | if (MARKDOWN_FILE_EXTENSION_REGEX.test(originalPath)) { |
| 221 | const { code } = extractScriptFromMarkdown(decoded); |
| 222 | return code !== null && code.length > 0 ? code : null; |
| 223 | } |
| 224 | return decoded; |
| 225 | } |
| 226 | |
| 227 | // #714: a bundled script that wires up QuickAdd's AI tool-calling lets an AI MODEL |
| 228 | // read and write the vault with model-chosen arguments — a distinct risk class from |
no test coverage detected