t=t.replace("export async function venice(path, body, { raw = false } = {}) {","async function veniceFetch(path, body, { raw = false } = {}) {",1)
t=t.replace("async function venice(path, body, { raw = false } = {}) {","async function veniceFetch(path, body, { raw = false } = {}) {",1)
j=t.index("\n}\n",t.index("async function veniceFetch"))+3
t=t[:j]+"/* the fetcher is injectable: the harness fragments stub it (render.setFetcher); every call goes through venice() */\nlet fetcher = veniceFetch;\nexport const setFetcher = (fn) => { fetcher = fn || veniceFetch; };\nexport const venice = (...a) => fetcher(...a);\n"+t[j:]
t=t.replace("\nasync function makeTone(","\nexport async function makeTone(").replace("\nasync function makeNoise(","\nexport async function makeNoise(")