MCPcopy Create free account
hub / github.com/chhoumann/quickadd / bundledScriptCode

Function bundledScriptCode

src/services/packagePreview.ts:213–225  ·  view source on GitHub ↗
(originalPath: string, content: string)

Source from the content-addressed store, hash-verified

211// executable asset (a `.js`, or a script-kind asset) yields its decoded body.
212// Pure/App-free — operates on the bundled payload only.
213function 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

Callers 1

buildPackagePreviewFunction · 0.85

Calls 2

decodeFromBase64Function · 0.90

Tested by

no test coverage detected