typebulb 0.32.0 → 0.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/pi/matchu-patchu.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
|
@@ -2280,7 +2280,7 @@ var Patcher = class {
|
|
|
2280
2280
|
|
|
2281
2281
|
// cli/agents/pi/server/piPatcherExtension.ts
|
|
2282
2282
|
var DESCRIPTION = true ? "Apply unified diffs to files \u2014 tolerant of form, strict about intent. Repairs sloppy AI-generated diffs (mangled headers, whitespace drift, missing prefixes; line numbers can be wrong or absent \u2014 hunks anchor by fuzzy-matched context lines) and applies all hunks atomically when the intent is unambiguous; fails with a precise, typed error when it isn't. Use for multi-hunk edits in one step, or when exact string-replacement editing fails on whitespace or invisible characters." : "Apply unified diffs to files.";
|
|
2283
|
-
var BUILD_TAG = true ? "matchu-patchu-pi 0.3.1, built 2026-07-19 23:
|
|
2283
|
+
var BUILD_TAG = true ? "matchu-patchu-pi 0.3.1, built 2026-07-19 23:51:45" : "matchu-patchu-pi dev";
|
|
2284
2284
|
var errorBlocks = (errors) => {
|
|
2285
2285
|
const parts = [`Patch failed with ${errors.length} error(s):`];
|
|
2286
2286
|
for (const e of errors) parts.push("", e.toString());
|
package/dist/index.js
CHANGED
|
@@ -1920,7 +1920,7 @@ export function runInference(ctx) {
|
|
|
1920
1920
|
${f}`:"";return y.text(`Forbidden: this capability requires --trust.${M}`,403)}await k()},P=async(y,k)=>{let I=y.req.header("sec-fetch-site");if(I){if(I!=="same-origin")return y.text(`Forbidden: ${I} request`,403)}else{let _=y.req.header("origin");if(_&&!FP(_,y.req.header("host")))return y.text("Forbidden: cross-origin request",403)}await k()};for(let[y]of x)g.use(y,A),g.use(y,P);if(g.use("/__log",P),g.post("/__log",async y=>{try{let{args:k}=await y.req.json();console.log(...k||[])}catch{}return y.json({ok:!0})}),o){let y=0,k=new Map;g.use("/__send",P),g.post("/__send",async I=>{let _="";try{_=await I.req.text()}catch{}let M=Number(I.req.query("reply"))||0,W=o.listenerCount("message");if(M<=0||W===0)return o.emit("message",{payload:_}),I.json({clients:W});let K=++y,Fe=await new Promise(z=>{let V={expected:W,received:0,results:[],errors:[],finish:we=>{clearTimeout(qe),k.delete(K),z({results:V.results,errors:V.errors,timedOut:we})}},qe=setTimeout(()=>V.finish(!0),M);k.set(K,V),o.emit("message",{id:K,payload:_})});return I.json({clients:W,...Fe})}),g.use("/__send-reply",P),g.post("/__send-reply",async I=>{try{let{id:_,results:M,errors:W}=await I.req.json(),K=k.get(_);K&&(K.results.push(...M??[]),K.errors.push(...W??[]),++K.received>=K.expected&&K.finish(!1))}catch{}return I.json({ok:!0})})}g.get("/",y=>y.html(e())),g.post("/__fs/read",async y=>{try{let{path:k}=await y.req.json(),I=await jn(k,m,t);return new Response(new Uint8Array(I),{headers:{"Content-Type":"application/octet-stream"}})}catch(k){let I=Su(k);return y.json({error:I},400)}}),g.post("/__fs/write",async y=>{try{let k=y.req.query("path");return k?(await Bi(k,new Uint8Array(await y.req.arrayBuffer()),m,t),y.json({success:!0})):y.json({error:"Missing path"},400)}catch(k){let I=Su(k);return y.json({error:I},400)}}),g.post("/__api/:name",async y=>{try{let k=y.req.param("name"),I=Fo(a?.(),k);if(!I)return y.json({error:`API function '${k}' not found`},404);let{args:_}=await y.req.json();if(qo(I))return Bo(y,I(..._||[]));let M=await I(..._||[]);return y.json({result:M})}catch(k){let I=Su(k);return y.json({error:I},500)}}),g.post("/__ai",async y=>{try{let{messages:k,system:I,effort:_,provider:M,model:W,webSearch:K,stream:Fe}=await y.req.json();if(!k||!Array.isArray(k)||k.length===0)return y.json({message:"messages array is required",code:"unknown",retryable:!1},400);let z=Ve(M,W);if(typeof z=="string")return y.json({message:z,code:"unknown",retryable:!1},400);let V=await yt(z,{messages:k,system:I,effort:_,webSearch:K,signal:y.req.raw.signal});if(!V.ok){let we=await xr(V,z.protocol);return y.json(we,V.status)}if(Fe)return Bo(y,Ht(V,z.protocol));let qe=await Kt(V,z.protocol);return qe||console.warn("[tb.ai] Empty response from provider"),y.json({text:qe})}catch(k){return y.json(is(k),500)}}),g.post("/__infer",async y=>{try{let{data:k}=await y.req.json().catch(()=>({})),I=c?.();if(!I?.infer.trim())return y.json({message:"This bulb has no infer.md block.",code:"unknown",retryable:!1},400);let _=Ve();if(typeof _=="string")return y.json({message:_,code:"unknown",retryable:!1},400);let M=Array.isArray(k)?k.map(String):[],W=ll(I,M),K=await yt(_,{messages:[{role:"user",content:W}],signal:y.req.raw.signal});if(!K.ok){let z=await xr(K,_.protocol);return y.json(z,K.status)}let Fe=(async function*(){let z="";for await(let we of Ht(K,_.protocol))we.kind!=="text"||!we.text||(z+=we.text,yield{kind:"delta",text:we.text});let V=ul(z);if(V.parsed===null)throw console.warn(`[tb.infer] output not valid JSON after sanitize; raw output (last 4000 chars):
|
|
1921
1921
|
`+z.slice(-4e3)),new pe("LLM output is not valid JSON","parse_error",!0);V.fixesApplied.length&&console.warn("[tb.infer] sanitized output, fixes applied:",V.fixesApplied.join(", "));let qe={insight:V.parsed,insightJson:V.json,data:M};yield{kind:"complete",...qe,fixesApplied:V.fixesApplied,hash:fl(qe)}})();return Bo(y,Fe)}catch(k){return y.json(is(k),500)}});let R=async y=>{let{hash:k}=await y.req.json().catch(()=>({}));return typeof k=="string"?dl(k):null};g.post("/__infer-save",async y=>{try{if(!l)return y.json({message:"Save is not available for this server.",code:"unknown",retryable:!1},400);let k=await R(y);return k?(await l(k.data,k.insightJson),y.json({ok:!0})):y.json({message:"No decodable #tb= fragment to save.",code:"unknown",retryable:!1},400)}catch(k){return y.json(is(k),500)}}),g.get("/__infer-info",y=>{let k=c?.(),I=rt(k?.config??"").inference,_=ui(k?.data??""),M=Ve();return typeof M=="string"?y.json({error:M,inference:I,data:_}):y.json({provider:M.protocol,model:M.model,inference:I,data:_})}),g.use("/__infer-decode",P),g.post("/__infer-decode",async y=>y.json(await R(y)??{error:"invalid fragment"})),g.get("/__infer-ui.js",y=>y.body(Ny,200,{"Content-Type":"text/javascript; charset=utf-8"})),g.get("/__models",async y=>{try{let k=await Ye();return y.json(k)}catch{return y.json([],200)}}),g.get("/__has-own-keys",async y=>{try{return y.json(await Mi())}catch{return y.json(!1,200)}});let N=["esm.sh","unpkg.com","cdn.jsdelivr.net","cdnjs.cloudflare.com"],O=new Do;g.get("/proxy/*",async y=>{let k=new URL(y.req.url),_=(k.pathname+k.search).slice(7),M=_.lastIndexOf("https://");return M===-1?y.text("Invalid proxy URL",400):$(y,_.slice(M))}),d&&$y(g,`/local/${d.name}/`,d.serveDir),p&&$y(g,p.mount,p.dir),b&&g.get("/assets/*",async y=>{let{pathname:k}=new URL(y.req.url),I=k.slice(8);for(let M of b.dirs){let W;try{W=Bn(decodeURIComponent(I),M)}catch{return y.text("Not Found",404)}try{let K=await xu.readFile(W);return new Response(K,{headers:{"Content-Type":By(W),"Cache-Control":"no-cache"}})}catch{}}let _=b.getRemoteBase();return _?y.redirect(_+I,302):y.text("Not Found",404)});async function $(y,k){let I;try{I=new URL(k)}catch{return y.text("Invalid URL",400)}if(I.protocol!=="https:")return y.text("HTTPS only",400);if(!N.includes(I.hostname))return y.text("Host not allowed",403);let _=await O.get(k);if(_)return new Response(_.body,{status:200,headers:ku(_.contentType,_.cacheControl)});try{let M=await fetch(k,{headers:{Accept:y.req.header("Accept")||"*/*"},redirect:"follow"});if(!M.ok)return y.text(`Upstream ${M.status}`,M.status);let W=M.headers.get("Content-Type")||void 0,K=M.headers.get("Cache-Control")||void 0;if(M.body){let[Fe,z]=M.body.tee();return(async()=>{try{let V=await new Response(z).arrayBuffer();await O.set(k,{body:Buffer.from(V),contentType:W,cacheControl:K})}catch{}})(),new Response(Fe,{status:M.status,headers:ku(W,K)})}return new Response(null,{status:M.status,headers:ku(W,K)})}catch(M){return y.text(`Proxy fetch failed: ${M instanceof Error?M.message:M}`,502)}}(i||o)&&g.get("/__reload",y=>MP(y,async k=>{let I=()=>{k.writeSSE({event:"reload",data:""})},_=M=>{k.writeSSE({event:"message",data:JSON.stringify(M)})};for(i?.on("reload",I),o?.on("message",_),k.onAbort(()=>{i?.removeListener("reload",I),o?.removeListener("message",_)});!k.aborted;)await k.sleep(3e4)})),g.notFound(async y=>{if(y.req.method!=="GET")return y.text("Not Found",404);let k=new URL(y.req.url);return Iy(k.pathname,k.search)?$(y,"https://esm.sh"+k.pathname+k.search):y.text("Not Found",404)});let E=LP({fetch:g.fetch,port:s,hostname:My});return{port:s,close:()=>E.close()}}function ku(r,e){let t=new Headers;return r&&t.set("Content-Type",r),e&&t.set("Cache-Control",e),t.set("Access-Control-Allow-Origin","*"),t.set("Cross-Origin-Resource-Policy","cross-origin"),t}function $y(r,e,t){r.get(`${e}*`,async n=>{let{pathname:s}=new URL(n.req.url);if(!s.startsWith(e))return n.text("Not Found",404);let i=decodeURIComponent(s.slice(e.length));try{let o=Bn(i,t),a=await xu.readFile(o);return new Response(a,{headers:{"Content-Type":By(o)}})}catch{return n.text("Not Found",404)}})}function By(r){switch(Ly.extname(r).toLowerCase()){case".js":case".mjs":return"text/javascript";case".wasm":return"application/wasm";case".json":case".map":return"application/json";case".svg":return"image/svg+xml";case".png":return"image/png";case".jpg":case".jpeg":return"image/jpeg";case".gif":return"image/gif";case".webp":return"image/webp";case".avif":return"image/avif";case".ico":return"image/x-icon";case".mp3":return"audio/mpeg";case".wav":return"audio/wav";case".ogg":return"audio/ogg";case".m4a":return"audio/mp4";case".mp4":return"video/mp4";case".webm":return"video/webm";case".woff2":return"font/woff2";case".ttf":return"font/ttf";case".css":return"text/css";case".txt":return"text/plain; charset=utf-8";default:return"application/octet-stream"}}async function Eu(r){let e=await import("net");return new Promise(t=>{let n=e.createServer();n.listen(r,My,()=>{let s=n.address(),i=typeof s=="object"&&s?s.port:r;n.close(()=>t(i))}),n.on("error",()=>{t(Eu(r+1))})})}$e();async function Uo(r){let{portPreference:e,makeServerOptions:t,makeEntry:n,displayName:s,stopLog:i}=r,o=await Eu(e),a=await Dy(t(o)),c=`http://localhost:${o}`;await nh(n(o,c)),console.log(`
|
|
1922
1922
|
${s}`),console.log(` ${c}`),o!==e&&console.log(` (port ${e} was busy)`);let l=[],d=async()=>{console.log(`
|
|
1923
|
-
Shutting down...`),a.close();for(let u of l)try{await u()}catch{}i(),await Kn(process.pid),process.exit(0)};return process.on("SIGINT",d),process.on("SIGTERM",d),{port:o,url:c,onCleanup(u){l.push(u)}}}import qP from"chokidar";var UP={persistent:!0,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:100,pollInterval:50}};function Ct(r){let{target:e,onChange:t,events:n="change",debounceMs:s=150}=r,i,o=qP.watch(e,UP),a=()=>{i&&clearTimeout(i),i=setTimeout(t,s)};return n==="all"?o.on("all",a):o.on("change",a),()=>{i&&clearTimeout(i),o.close()}}$e();async function Fy(r,e,t,n){let s=process.cwd(),i=Vi(process.pid),o=e.watch?new jy:void 0,a=new jy;a.setMaxListeners(0);let c=ye(e.mode),l=await Ll(r);l.length&&console.log(`Replacing the running server for this bulb (pid ${l.map(O=>O.pid).join(", ")})`);let d=1;console.log(Nl(d)),console.log(`Loading ${os.basename(r)}...`);let{html:u,bulb:f,serverExports:p}=await yl(r,e.watch,e.trust,n,e.dir);kt(c,r,f.server);let b=[...e.dir?[os.join(wt(r,e.dir),"assets")]:[],os.join(wt(r),"assets")],m=rt(f.config);m.assets&&!Ur(f.config)&&console.warn(` config.json "assets" is not a valid http(s) URL \u2014 ignored: ${m.assets}`);let g=e.trust?void 0:Nr(f),{port:x,url:A,onCleanup:P}=await Uo({portPreference:e.port,displayName:f.name,stopLog:i,makeServerOptions:O=>({getHtml:()=>u,basePath:s,fsBase:wt(r,e.dir),port:O,reloadEmitter:o,messageEmitter:a,getServerExports:()=>p,getBulbBlocks:()=>({infer:f.infer,insight:f.insight,code:f.code,config:f.config,data:f.data}),saveInferenceResult:async($,E)=>{let y=await _t.readFile(r,"utf-8");y=Qo(y,"data",$.join(Qp)),y=Qo(y,"insight",E),await _t.writeFile(r,y)},localOverride:n?{name:n.name,serveDir:n.serveDir}:void 0,bulbAssets:{dirs:b,getRemoteBase:()=>Ur(f.config)},trusted:e.trust,trustHint:t}),makeEntry:(O,$)=>({pid:process.pid,port:O,url:$,file:r,cwd:process.cwd(),startedAt:Date.now(),trust:e.trust,dir:e.dir,mode:e.mode,predicted:g})});e.trust?console.log(" trust: granted (filesystem, AI, server.ts enabled)"):console.log(g?` trust: restricted \u2014 this bulb appears to use ${g}; re-run with --trust to enable it:
|
|
1923
|
+
Shutting down...`),a.close();for(let u of l)try{await u()}catch{}i(),await Kn(process.pid),process.exit(0)};return process.on("SIGINT",d),process.on("SIGTERM",d),{port:o,url:c,onCleanup(u){l.push(u)}}}import qP from"chokidar";var UP={persistent:!0,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:100,pollInterval:50}};function Ct(r){let{target:e,onChange:t,events:n="change",debounceMs:s=150}=r,i,o=qP.watch(e,UP);o.on("error",c=>console.warn(`watch: ${c instanceof Error?c.message:c} \u2014 continuing`));let a=()=>{i&&clearTimeout(i),i=setTimeout(t,s)};return n==="all"?o.on("all",a):o.on("change",a),()=>{i&&clearTimeout(i),o.close()}}$e();async function Fy(r,e,t,n){let s=process.cwd(),i=Vi(process.pid),o=e.watch?new jy:void 0,a=new jy;a.setMaxListeners(0);let c=ye(e.mode),l=await Ll(r);l.length&&console.log(`Replacing the running server for this bulb (pid ${l.map(O=>O.pid).join(", ")})`);let d=1;console.log(Nl(d)),console.log(`Loading ${os.basename(r)}...`);let{html:u,bulb:f,serverExports:p}=await yl(r,e.watch,e.trust,n,e.dir);kt(c,r,f.server);let b=[...e.dir?[os.join(wt(r,e.dir),"assets")]:[],os.join(wt(r),"assets")],m=rt(f.config);m.assets&&!Ur(f.config)&&console.warn(` config.json "assets" is not a valid http(s) URL \u2014 ignored: ${m.assets}`);let g=e.trust?void 0:Nr(f),{port:x,url:A,onCleanup:P}=await Uo({portPreference:e.port,displayName:f.name,stopLog:i,makeServerOptions:O=>({getHtml:()=>u,basePath:s,fsBase:wt(r,e.dir),port:O,reloadEmitter:o,messageEmitter:a,getServerExports:()=>p,getBulbBlocks:()=>({infer:f.infer,insight:f.insight,code:f.code,config:f.config,data:f.data}),saveInferenceResult:async($,E)=>{let y=await _t.readFile(r,"utf-8");y=Qo(y,"data",$.join(Qp)),y=Qo(y,"insight",E),await _t.writeFile(r,y)},localOverride:n?{name:n.name,serveDir:n.serveDir}:void 0,bulbAssets:{dirs:b,getRemoteBase:()=>Ur(f.config)},trusted:e.trust,trustHint:t}),makeEntry:(O,$)=>({pid:process.pid,port:O,url:$,file:r,cwd:process.cwd(),startedAt:Date.now(),trust:e.trust,dir:e.dir,mode:e.mode,predicted:g})});e.trust?console.log(" trust: granted (filesystem, AI, server.ts enabled)"):console.log(g?` trust: restricted \u2014 this bulb appears to use ${g}; re-run with --trust to enable it:
|
|
1924
1924
|
${t}
|
|
1925
1925
|
`:` trust: restricted \u2014 re-run with --trust to enable filesystem / AI / server.ts
|
|
1926
1926
|
`),e.watch&&console.log(` Watching for changes...
|
|
@@ -1994,5 +1994,5 @@ ${KP}
|
|
|
1994
1994
|
`);let c=0,l=Promise.resolve();Ct({target:r,onChange:()=>{let d=++c;l=l.then(async()=>{if(d===c)try{console.log("Re-running..."),await a()}catch(u){console.error("Error:",u)}})}})}}xt();vt();import{Console as GP}from"node:console";$e();async function Gy(r,e,t,n,s){eO();try{let p=Rr(await Q(),r)[0];p&&(Yi(p.pid,Ie(p.pid).offset),console.error(`note: 'call' boots a fresh server.ts instance; the running server (${p.url}) is not contacted \u2014 state shared with it must live on disk.`))}catch{}let i=ye(t),{bulb:o,config:a}=await Ae(r);o.server||as("This bulb has no **server.ts** block; nothing to call."),kt(i,r,o.server);let c;try{c=await Fn(o.server,r,n,a.dependencies,s)}catch(p){as(p instanceof Error?p.message:String(p))}let l=Fo(c,e.fn);if(!l){let p=[...Object.keys(c).filter(b=>typeof c[b]=="function"),...Object.keys(jo)];as(`Function '${e.fn}' not found. Available: ${p.length?p.join(", "):"(none)"}.`)}let d=await zP(e);if(qo(l)){try{for await(let p of l(...d))await Vy(JSON.stringify(p,zy)+`
|
|
1995
1995
|
`)}catch(p){as(p instanceof Error?p.stack??p.message:String(p))}return Yy(0)}let u;try{u=await l(...d)}catch(p){as(p instanceof Error?p.stack??p.message:String(p))}let f=ZP(u);f!==void 0&&await Vy(f+`
|
|
1996
1996
|
`),Yy(0)}function Yy(r){process.exitCode=r,setTimeout(()=>process.exit(r),2e3).unref?.()}async function zP(r){if(r.hasArgsFlag){let e=r.argsJson??"";return e==="-"&&(e=await tO()),QP(e)}return XP(r.positional)}function XP(r){return r.map(e=>{try{return JSON.parse(e)}catch{return e}})}function QP(r){let e;try{e=JSON.parse(r)}catch(t){throw new Error(`--args must be a JSON array: ${t instanceof Error?t.message:String(t)}`)}if(!Array.isArray(e))throw new Error(`--args must be a JSON array, got ${e===null?"null":typeof e}`);return e}function ZP(r){if(r!==void 0)return JSON.stringify(r,zy,2)}function zy(r,e){return typeof e=="bigint"?e.toString():e}function as(r){process.stderr.write(r+`
|
|
1997
|
-
`),process.exit(1)}function eO(){let r=new GP(process.stderr,process.stderr);console.log=r.log.bind(r),console.info=r.info.bind(r),console.debug=r.debug.bind(r),console.dir=r.dir.bind(r)}function Vy(r){return new Promise((e,t)=>{process.stdout.write(r,n=>n?t(n):e())})}async function tO(){let r=[];for await(let e of process.stdin)r.push(e);return Buffer.concat(r).toString("utf-8")}var Tu="0.32.
|
|
1997
|
+
`),process.exit(1)}function eO(){let r=new GP(process.stderr,process.stderr);console.log=r.log.bind(r),console.info=r.info.bind(r),console.debug=r.debug.bind(r),console.dir=r.dir.bind(r)}function Vy(r){return new Promise((e,t)=>{process.stdout.write(r,n=>n?t(n):e())})}async function tO(){let r=[];for await(let e of process.stdin)r.push(e);return Buffer.concat(r).toString("utf-8")}var Tu="0.32.1";function Xy(r,e){r||(console.error(`This bulb runs server-side Node code (server.ts), which --trust must authorize:
|
|
1998
1998
|
${e}`),process.exit(1))}async function rO(){let r=qu(process.argv.slice(2));if(r.version&&(console.log(`typebulb ${Tu}`),process.exit(0)),r.help&&(Uu(),process.exit(0)),gy(),r.subcommand==="logs"){await Ty(r.file||void 0,{follow:r.follow,clear:r.clear,run:r.run,lines:r.lines});return}if(r.subcommand==="wait"){await Py(r.file||void 0,{match:r.match,timeoutSec:r.timeoutSec});return}if(r.subcommand==="stop"){r.stopScope?await Cy(r.stopScope):await Oy(r.file||void 0);return}if(r.subcommand==="send"){await Ry(r.file,r.sendMessage,r.sendWaitMs??0);return}if(r.subcommand==="skill"){await xy(Tu);return}if(r.subcommand==="models"){await Sy(r.mode);return}if(r.subcommand==="pull"){await vh(r.file||void 0,{force:r.force,mode:r.mode});return}if(r.subcommand==="push"){await xh(r.file||void 0,{force:r.force,mode:r.mode});return}if(r.subcommand==="agent"){await(r.agentTarget?Ky(r):vy(Tu));return}if(r.subcommand==="trust"||r.subcommand==="untrust"){await hy(r.file||void 0,r.subcommand==="trust");return}let e;if(!r.file||r.file==="."){let c=await Um(process.cwd());c||(console.error("No .bulb.md file found in current directory"),process.exit(1)),e=c}else e=rr.resolve(r.file);await Qy.access(e).then(()=>!0,()=>!1)||(jr().includes(r.file)&&(console.error(`To open the ${r.file} agent mirror, run: npx typebulb agent:${r.file}`),process.exit(1)),console.error(`File not found: ${e}`),process.exit(1)),e.endsWith(".bulb.md")||(console.error("File must have .bulb.md extension"),process.exit(1));let n=r.file&&r.file!=="."?r.file:rr.relative(process.cwd(),e)||rr.basename(e),s=`npx typebulb --trust ${n.includes(" ")?`"${n}"`:n}`;if(r.subcommand==="predict"){await my(e,s);return}let i=!r.noTrust&&Yt(e);i&&!r.trust&&console.error("trust: granted from memory (run `typebulb untrust` to revoke)"),r.trust=r.noTrust?!1:r.trust||i;let o;try{o=await Ae(e)}catch{}let a;if(r.local){o&&!(r.local.name in(o.config.dependencies??{}))&&(console.error(`--replace: '${r.local.name}' is not a dependency in this bulb's config.json; nothing to replace.`),process.exit(1)),o&&r.subcommand!=="call"&&(!o.bulb.code||r.server)&&console.warn("warning: --replace has no effect in server mode (the override is client-only).");try{a=await Bu(r.local)}catch(c){console.error(c instanceof Error?c.message:String(c)),process.exit(1)}console.error(`replace: ${a.name} \u2192 ${rr.relative(process.cwd(),a.dir)||"."}`)}if(r.subcommand==="check"){await py(e,a);return}if(r.subcommand==="call"){Xy(r.trust,s),await Gy(e,{fn:r.fn,positional:r.callArgs,argsJson:r.argsJson,hasArgsFlag:r.hasArgsFlag},r.mode,a,r.dir);return}if(o&&o.bulb.server&&(fi(o.bulb)||r.server)){Xy(r.trust,s),await Wy(e,r.watch,r.mode,a,r.dir);return}await Fy(e,r,s,a)}rO().catch(r=>{console.error("Error:",r.message),process.exit(1)});
|
package/package.json
CHANGED