planx 19.85.0 → 19.86.0
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/control.main.mjs +292 -288
- package/log.main.mjs +2 -2
- package/main.js +293 -289
- package/package.json +6 -7
- package/session.main.mjs +292 -288
- package/transport.main.mjs +13 -13
- package/cli.tgz +0 -0
package/log.main.mjs
CHANGED
|
@@ -20,13 +20,13 @@ CREATE INDEX IF NOT EXISTS idx_logs_component ON logs(component, timestamp);
|
|
|
20
20
|
CREATE INDEX IF NOT EXISTS idx_logs_level ON logs(level, timestamp);
|
|
21
21
|
`,PC=`INSERT OR IGNORE INTO logs
|
|
22
22
|
(id, timestamp, peer_id, process_id, level, component, message, context, error)
|
|
23
|
-
VALUES (@id, @timestamp, @peer_id, @process_id, @level, @component, @message, @context, @error)`,OC=3e4,XC=64*1024*1024,og=class B{static async create(D,I={}){return new B(await dQ(),D,I)}constructor(D,I,R){this.sqlite3=D,this.dbPath=I,this.flushTimer=null,this.dirty=!1,this.subscribers=new Set,this.maxDbBytes=R.maxDbBytes??XC,this.db=this.open(),this.insertStmt=this.db.prepare(PC),I!==":memory:"&&(this.flushTimer=setInterval(()=>this.flush(),R.flushIntervalMs??OC),this.flushTimer.unref?.())}open(){let D=new this.sqlite3.oo1.DB,I=this.dbPath===":memory:"?null:fQ(this.dbPath);if(I==null)return D.exec(Hg),D;try{return this.restoreInto(D,I),D.exec(Hg),D}catch(R){console.error(`[log-store] snapshot restore failed, starting empty: ${R}`);try{D.close()}catch{}let h=new this.sqlite3.oo1.DB;return h.exec(Hg),h}}restoreInto(D,I){let R=D.pointer;if(R==null)throw new Error("db pointer unavailable");let h=this.sqlite3.wasm.allocFromTypedArray(I),a=this.sqlite3.capi.SQLITE_DESERIALIZE_FREEONCLOSE|this.sqlite3.capi.SQLITE_DESERIALIZE_RESIZEABLE,Y=this.sqlite3.capi.sqlite3_deserialize(R,"main",h,I.length,I.length,a);if(Y!==0)throw new Error(`sqlite3_deserialize rc=${Y}`)}append(D){if(this.db==null||this.insertStmt==null)return[];let I=[];this.db.exec("BEGIN");try{for(let R of D)this.insertStmt.bind(jC(R)).stepReset(),this.db.changes()===1&&I.push(R);this.db.exec("COMMIT")}catch(R){try{this.db.exec("ROLLBACK")}catch{}throw R}I.length>0&&(this.dirty=!0,this.enforceCap());for(let R of I)for(let h of this.subscribers)h(R);return I}query(D={}){if(this.db==null)return[];let I=[],R={};D.level!=null&&(I.push("level = @level"),R["@level"]=D.level),D.component!=null&&(I.push("component = @component"),R["@component"]=D.component),D.peerId!=null&&(I.push("peer_id = @peerId"),R["@peerId"]=D.peerId),D.since!=null&&(I.push("timestamp >= @since"),R["@since"]=D.since),D.until!=null&&(I.push("timestamp <= @until"),R["@until"]=D.until),D.cursor!=null&&(I.push("id > @cursor"),R["@cursor"]=D.cursor);let h=I.length?`WHERE ${I.join(" AND ")}`:"",a=Math.min(Math.max(D.limit??500,1),5e3),Y=`SELECT * FROM logs ${h} ORDER BY timestamp ASC, id ASC LIMIT ${a}`;return I.length?this.db.selectObjects(Y,R):this.db.selectObjects(Y)}subscribe(D){return this.subscribers.add(D),()=>this.subscribers.delete(D)}purgeOlderThan(D){this.db!=null&&(this.db.exec({sql:"DELETE FROM logs WHERE timestamp < ?",bind:[D]}),this.db.changes()>0&&(this.dirty=!0))}flush(){if(this.db==null||this.dbPath===":memory:"||!this.dirty)return;let D=this.sqlite3.capi.sqlite3_js_db_export(this.db);qQ(this.dbPath,D),this.dirty=!1}close(){this.flushTimer!=null&&(clearInterval(this.flushTimer),this.flushTimer=null);try{this.flush()}catch(D){console.error(`[log-store] final flush failed: ${D}`)}try{this.insertStmt?.finalize()}catch{}this.insertStmt=null;try{this.db?.close()}catch{}this.db=null,this.subscribers.clear()}enforceCap(){if(this.db==null)return;let D=Number(this.db.selectValue("PRAGMA page_size")),I=Number(this.db.selectValue("PRAGMA page_count")),R=Number(this.db.selectValue("PRAGMA freelist_count"));(I-R)*D<=this.maxDbBytes||(this.db.exec("DELETE FROM logs WHERE id IN (SELECT id FROM logs ORDER BY timestamp ASC, id ASC LIMIT (SELECT COUNT(*) / 4 + 1 FROM logs))"),this.db.exec("VACUUM"))}};function jC(B){return{"@id":B.id,"@timestamp":B.timestamp,"@peer_id":B.peer_id,"@process_id":B.process_id,"@level":B.level,"@component":B.component,"@message":B.message,"@context":B.context??null,"@error":B.error??null}}var xQ=B=>{let I={...{origin:"*",allowMethods:["GET","HEAD","PUT","POST","DELETE","PATCH"],allowHeaders:[],exposeHeaders:[]},...B},R=(a=>typeof a=="string"?a==="*"?()=>a:Y=>a===Y?Y:null:typeof a=="function"?a:Y=>a.includes(Y)?Y:null)(I.origin),h=(a=>typeof a=="function"?a:Array.isArray(a)?()=>a:()=>[])(I.allowMethods);return async function(Y,x){function u(EA,tA){Y.res.headers.set(EA,tA)}let j=await R(Y.req.header("origin")||"",Y);if(j&&u("Access-Control-Allow-Origin",j),I.credentials&&u("Access-Control-Allow-Credentials","true"),I.exposeHeaders?.length&&u("Access-Control-Expose-Headers",I.exposeHeaders.join(",")),Y.req.method==="OPTIONS"){I.origin!=="*"&&u("Vary","Origin"),I.maxAge!=null&&u("Access-Control-Max-Age",I.maxAge.toString());let EA=await h(Y.req.header("origin")||"",Y);EA.length&&u("Access-Control-Allow-Methods",EA.join(","));let tA=I.allowHeaders;if(!tA?.length){let SA=Y.req.header("Access-Control-Request-Headers");SA&&(tA=SA.split(/\s*,\s*/))}return tA?.length&&(u("Access-Control-Allow-Headers",tA.join(",")),Y.res.headers.append("Vary","Access-Control-Request-Headers")),Y.res.headers.delete("Content-Length"),Y.res.headers.delete("Content-Type"),new Response(null,{headers:Y.res.headers,status:204,statusText:"No Content"})}await x(),I.origin!=="*"&&Y.header("Vary","Origin",{append:!0})}};var dg=class{writer;encoder;writable;abortSubscribers=[];responseReadable;aborted=!1;closed=!1;constructor(B,D){this.writable=B,this.writer=B.getWriter(),this.encoder=new TextEncoder;let I=D.getReader();this.abortSubscribers.push(async()=>{await I.cancel()}),this.responseReadable=new ReadableStream({async pull(R){let{done:h,value:a}=await I.read();h?R.close():R.enqueue(a)},cancel:()=>{this.abort()}})}async write(B){try{typeof B=="string"&&(B=this.encoder.encode(B)),await this.writer.write(B)}catch{}return this}async writeln(B){return await this.write(B+`
|
|
23
|
+
VALUES (@id, @timestamp, @peer_id, @process_id, @level, @component, @message, @context, @error)`,OC=3e4,XC=64*1024*1024,og=class B{static async create(D,I={}){return new B(await dQ(),D,I)}constructor(D,I,R){this.sqlite3=D,this.dbPath=I,this.flushTimer=null,this.dirty=!1,this.subscribers=new Set,this.maxDbBytes=R.maxDbBytes??XC,this.db=this.open(),this.insertStmt=this.db.prepare(PC),I!==":memory:"&&(this.flushTimer=setInterval(()=>this.flush(),R.flushIntervalMs??OC),this.flushTimer.unref?.())}open(){let D=new this.sqlite3.oo1.DB,I=this.dbPath===":memory:"?null:fQ(this.dbPath);if(I==null)return D.exec(Hg),D;try{return this.restoreInto(D,I),D.exec(Hg),D}catch(R){console.error(`[log-store] snapshot restore failed, starting empty: ${R}`);try{D.close()}catch{}let h=new this.sqlite3.oo1.DB;return h.exec(Hg),h}}restoreInto(D,I){let R=D.pointer;if(R==null)throw new Error("db pointer unavailable");let h=this.sqlite3.wasm.allocFromTypedArray(I),a=this.sqlite3.capi.SQLITE_DESERIALIZE_FREEONCLOSE|this.sqlite3.capi.SQLITE_DESERIALIZE_RESIZEABLE,Y=this.sqlite3.capi.sqlite3_deserialize(R,"main",h,I.length,I.length,a);if(Y!==0)throw new Error(`sqlite3_deserialize rc=${Y}`)}append(D){if(this.db==null||this.insertStmt==null)return[];let I=[];this.db.exec("BEGIN");try{for(let R of D)this.insertStmt.bind(jC(R)).stepReset(),this.db.changes()===1&&I.push(R);this.db.exec("COMMIT")}catch(R){try{this.db.exec("ROLLBACK")}catch{}throw R}I.length>0&&(this.dirty=!0,this.enforceCap());for(let R of I)for(let h of this.subscribers)h(R);return I}query(D={}){if(this.db==null)return[];let I=[],R={};D.q!=null&&(I.push("message LIKE @q ESCAPE '\\'"),R["@q"]=`%${D.q.replace(/[\\%_]/g,u=>`\\${u}`)}%`),D.level!=null&&(I.push("level = @level"),R["@level"]=D.level),D.component!=null&&(I.push("component = @component"),R["@component"]=D.component),D.peerId!=null&&(I.push("peer_id = @peerId"),R["@peerId"]=D.peerId),D.since!=null&&(I.push("timestamp >= @since"),R["@since"]=D.since),D.until!=null&&(I.push("timestamp <= @until"),R["@until"]=D.until),D.cursor!=null&&(I.push("id > @cursor"),R["@cursor"]=D.cursor);let h=I.length?`WHERE ${I.join(" AND ")}`:"",a=Math.min(Math.max(D.limit??500,1),5e3),Y=`SELECT * FROM logs ${h} ORDER BY timestamp ASC, id ASC LIMIT ${a}`;return I.length?this.db.selectObjects(Y,R):this.db.selectObjects(Y)}subscribe(D){return this.subscribers.add(D),()=>this.subscribers.delete(D)}purgeOlderThan(D){this.db!=null&&(this.db.exec({sql:"DELETE FROM logs WHERE timestamp < ?",bind:[D]}),this.db.changes()>0&&(this.dirty=!0))}flush(){if(this.db==null||this.dbPath===":memory:"||!this.dirty)return;let D=this.sqlite3.capi.sqlite3_js_db_export(this.db);qQ(this.dbPath,D),this.dirty=!1}close(){this.flushTimer!=null&&(clearInterval(this.flushTimer),this.flushTimer=null);try{this.flush()}catch(D){console.error(`[log-store] final flush failed: ${D}`)}try{this.insertStmt?.finalize()}catch{}this.insertStmt=null;try{this.db?.close()}catch{}this.db=null,this.subscribers.clear()}enforceCap(){if(this.db==null)return;let D=Number(this.db.selectValue("PRAGMA page_size")),I=Number(this.db.selectValue("PRAGMA page_count")),R=Number(this.db.selectValue("PRAGMA freelist_count"));(I-R)*D<=this.maxDbBytes||(this.db.exec("DELETE FROM logs WHERE id IN (SELECT id FROM logs ORDER BY timestamp ASC, id ASC LIMIT (SELECT COUNT(*) / 4 + 1 FROM logs))"),this.db.exec("VACUUM"))}};function jC(B){return{"@id":B.id,"@timestamp":B.timestamp,"@peer_id":B.peer_id,"@process_id":B.process_id,"@level":B.level,"@component":B.component,"@message":B.message,"@context":B.context??null,"@error":B.error??null}}var xQ=B=>{let I={...{origin:"*",allowMethods:["GET","HEAD","PUT","POST","DELETE","PATCH"],allowHeaders:[],exposeHeaders:[]},...B},R=(a=>typeof a=="string"?a==="*"?()=>a:Y=>a===Y?Y:null:typeof a=="function"?a:Y=>a.includes(Y)?Y:null)(I.origin),h=(a=>typeof a=="function"?a:Array.isArray(a)?()=>a:()=>[])(I.allowMethods);return async function(Y,x){function u(EA,tA){Y.res.headers.set(EA,tA)}let j=await R(Y.req.header("origin")||"",Y);if(j&&u("Access-Control-Allow-Origin",j),I.credentials&&u("Access-Control-Allow-Credentials","true"),I.exposeHeaders?.length&&u("Access-Control-Expose-Headers",I.exposeHeaders.join(",")),Y.req.method==="OPTIONS"){I.origin!=="*"&&u("Vary","Origin"),I.maxAge!=null&&u("Access-Control-Max-Age",I.maxAge.toString());let EA=await h(Y.req.header("origin")||"",Y);EA.length&&u("Access-Control-Allow-Methods",EA.join(","));let tA=I.allowHeaders;if(!tA?.length){let SA=Y.req.header("Access-Control-Request-Headers");SA&&(tA=SA.split(/\s*,\s*/))}return tA?.length&&(u("Access-Control-Allow-Headers",tA.join(",")),Y.res.headers.append("Vary","Access-Control-Request-Headers")),Y.res.headers.delete("Content-Length"),Y.res.headers.delete("Content-Type"),new Response(null,{headers:Y.res.headers,status:204,statusText:"No Content"})}await x(),I.origin!=="*"&&Y.header("Vary","Origin",{append:!0})}};var dg=class{writer;encoder;writable;abortSubscribers=[];responseReadable;aborted=!1;closed=!1;constructor(B,D){this.writable=B,this.writer=B.getWriter(),this.encoder=new TextEncoder;let I=D.getReader();this.abortSubscribers.push(async()=>{await I.cancel()}),this.responseReadable=new ReadableStream({async pull(R){let{done:h,value:a}=await I.read();h?R.close():R.enqueue(a)},cancel:()=>{this.abort()}})}async write(B){try{typeof B=="string"&&(B=this.encoder.encode(B)),await this.writer.write(B)}catch{}return this}async writeln(B){return await this.write(B+`
|
|
24
24
|
`),this}sleep(B){return new Promise(D=>setTimeout(D,B))}async close(){try{await this.writer.close()}catch{}this.closed=!0}async pipe(B){this.writer.releaseLock(),await B.pipeTo(this.writable,{preventClose:!0}),this.writer=this.writable.getWriter()}onAbort(B){this.abortSubscribers.push(B)}abort(){this.aborted||(this.aborted=!0,this.abortSubscribers.forEach(B=>B()))}};var sg=()=>{let B=typeof Bun<"u"?Bun.version:void 0;if(B===void 0)return!1;let D=B.startsWith("1.1")||B.startsWith("1.0")||B.startsWith("0.");return sg=()=>D,D};var VQ=class extends dg{constructor(B,D){super(B,D)}async writeSSE(B){let I=(await uI(B.data,gg.Stringify,!1,{})).split(`
|
|
25
25
|
`).map(h=>`data: ${h}`).join(`
|
|
26
26
|
`),R=[B.event&&`event: ${B.event}`,I,B.id&&`id: ${B.id}`,B.retry&&`retry: ${B.retry}`].filter(Boolean).join(`
|
|
27
27
|
`)+`
|
|
28
28
|
|
|
29
|
-
`;await this.write(R)}},zC=async(B,D,I)=>{try{await D(B)}catch(R){R instanceof Error&&I?(await I(R,B),await B.writeSSE({event:"error",data:R.message})):console.error(R)}finally{B.close()}},_C=new WeakMap,fg=(B,D,I)=>{let{readable:R,writable:h}=new TransformStream,a=new VQ(h,R);return sg()&&B.req.raw.signal.addEventListener("abort",()=>{a.closed||a.abort()}),_C.set(a.responseReadable,B),B.header("Transfer-Encoding","chunked"),B.header("Content-Type","text/event-stream"),B.header("Cache-Control","no-cache"),B.header("Connection","keep-alive"),zC(a,D,I),B.newResponse(a.responseReadable)};var $C=/^(https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?|https:\/\/[\w.-]+\.machina\.at)$/;function AE(B){let D=B.searchParams,I=R=>{let h=D.get(R);if(h==null)return;let a=Number(h);return Number.isFinite(a)?a:void 0};return{level:D.get("level")??void 0,component:D.get("component")??void 0,peerId:D.get("peer")??void 0,since:I("since"),until:I("until"),limit:I("limit"),cursor:D.get("cursor")??void 0}}function IE(B,D){return!(D.level!=null&&B.level!==D.level||D.component!=null&&B.component!==D.component||D.peerId!=null&&B.peer_id!==D.peerId)}function uQ(B){let D=new WI;return D.use("*",xQ({origin:I=>$C.test(I)?I:"",allowMethods:["GET","POST","OPTIONS"],allowHeaders:["Content-Type"]})),D.use("*",async(I,R)=>{await R(),I.res.headers.set("Cross-Origin-Resource-Policy","cross-origin")}),D.get("/health",I=>I.json({status:"ok"})),D.post("/log",async I=>{let R=await I.req.json().catch(()=>null),h=Array.isArray(R)?R:[R];if(h.some(Y=>Y==null||typeof Y.id!="string"||typeof Y.timestamp!="number"))return I.json({error:"invalid log record(s)"},400);let a=B.append(h);return I.json({accepted:a.length})}),D.get("/log",I=>{let R=new URL(I.req.url),h=AE(R);return R.searchParams.get("stream")!=="true"?I.json(B.query(h)):fg(I,async a=>{let Y=!1,x=tA=>{a.writeSSE({data:JSON.stringify(tA),event:"log",id:tA.id})},u=[],j=h.cursor!=null,EA=B.subscribe(tA=>{if(IE(tA,h)){if(j){u.push(tA);return}x(tA)}});if(a.onAbort(()=>{Y=!0,EA()}),j){let tA=h.cursor??"";for(let SA of B.query(h))x(SA),tA=SA.id;for(let SA of u)SA.id>tA&&x(SA);u.length=0,j=!1}for(;!Y;)await a.sleep(3e4),Y||await a.writeSSE({data:"",event:"ping"})})}),D}var gE=0,QE=10080*60*1e3,BE=3600*1e3;async function TQ(B={}){let{port:D=gE,dbPath:I=":memory:",retentionMs:R=QE,retentionSweepIntervalMs:h=BE}=B,a=await og.create(I),Y=new WI;return Y.route("/",uQ(a)),a.purgeOlderThan(Date.now()-R),setInterval(()=>a.purgeOlderThan(Date.now()-R),h).unref?.(),new Promise(u=>{let j=FQ({fetch:Y.fetch,port:D,hostname:"127.0.0.1"},EA=>{console.log(`[log-server] REST server listening on http://127.0.0.1:${EA.port}`),u({server:j,store:a,port:EA.port})});"keepAliveTimeout"in j&&(j.keepAliveTimeout=1440*60*1e3),"requestTimeout"in j&&(j.requestTimeout=0),"headersTimeout"in j&&(j.headersTimeout=0),"timeout"in j&&(j.timeout=0)})}async function CE(){let B=Number(process.env.PORT??0),D=process.env.PLANX_LOG_DB??":memory:",I=process.env.PLANX_LOG_PORT_FILE,R=process.env.PLANX_LOG_PID_FILE,{server:h,store:a,port:Y}=await TQ({port:B,dbPath:D});I&&nI.writeFileSync(I,String(Y)),R&&nI.writeFileSync(R,String(process.pid)),process.stdout.write(JSON.stringify({service:"log",port:Y,pid:process.pid})+`
|
|
29
|
+
`;await this.write(R)}},zC=async(B,D,I)=>{try{await D(B)}catch(R){R instanceof Error&&I?(await I(R,B),await B.writeSSE({event:"error",data:R.message})):console.error(R)}finally{B.close()}},_C=new WeakMap,fg=(B,D,I)=>{let{readable:R,writable:h}=new TransformStream,a=new VQ(h,R);return sg()&&B.req.raw.signal.addEventListener("abort",()=>{a.closed||a.abort()}),_C.set(a.responseReadable,B),B.header("Transfer-Encoding","chunked"),B.header("Content-Type","text/event-stream"),B.header("Cache-Control","no-cache"),B.header("Connection","keep-alive"),zC(a,D,I),B.newResponse(a.responseReadable)};var $C=/^(https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?|https:\/\/[\w.-]+\.machina\.at)$/;function AE(B){let D=B.searchParams,I=R=>{let h=D.get(R);if(h==null)return;let a=Number(h);return Number.isFinite(a)?a:void 0};return{q:D.get("q")??void 0,level:D.get("level")??void 0,component:D.get("component")??void 0,peerId:D.get("peer")??void 0,since:I("since"),until:I("until"),limit:I("limit"),cursor:D.get("cursor")??void 0}}function IE(B,D){return!(D.q!=null&&!B.message.includes(D.q)||D.level!=null&&B.level!==D.level||D.component!=null&&B.component!==D.component||D.peerId!=null&&B.peer_id!==D.peerId)}function uQ(B){let D=new WI;return D.use("*",xQ({origin:I=>$C.test(I)?I:"",allowMethods:["GET","POST","OPTIONS"],allowHeaders:["Content-Type"]})),D.use("*",async(I,R)=>{await R(),I.res.headers.set("Cross-Origin-Resource-Policy","cross-origin")}),D.get("/health",I=>I.json({status:"ok"})),D.post("/log",async I=>{let R=await I.req.json().catch(()=>null),h=Array.isArray(R)?R:[R];if(h.some(Y=>Y==null||typeof Y.id!="string"||typeof Y.timestamp!="number"))return I.json({error:"invalid log record(s)"},400);let a=B.append(h);return I.json({accepted:a.length})}),D.get("/log",I=>{let R=new URL(I.req.url),h=AE(R);return R.searchParams.get("stream")!=="true"?I.json(B.query(h)):fg(I,async a=>{let Y=!1,x=tA=>{a.writeSSE({data:JSON.stringify(tA),event:"log",id:tA.id})},u=[],j=h.cursor!=null,EA=B.subscribe(tA=>{if(IE(tA,h)){if(j){u.push(tA);return}x(tA)}});if(a.onAbort(()=>{Y=!0,EA()}),j){let tA=h.cursor??"";for(let SA of B.query(h))x(SA),tA=SA.id;for(let SA of u)SA.id>tA&&x(SA);u.length=0,j=!1}for(;!Y;)await a.sleep(3e4),Y||await a.writeSSE({data:"",event:"ping"})})}),D}var gE=0,QE=10080*60*1e3,BE=3600*1e3;async function TQ(B={}){let{port:D=gE,dbPath:I=":memory:",retentionMs:R=QE,retentionSweepIntervalMs:h=BE}=B,a=await og.create(I),Y=new WI;return Y.route("/",uQ(a)),a.purgeOlderThan(Date.now()-R),setInterval(()=>a.purgeOlderThan(Date.now()-R),h).unref?.(),new Promise(u=>{let j=FQ({fetch:Y.fetch,port:D,hostname:"127.0.0.1"},EA=>{console.log(`[log-server] REST server listening on http://127.0.0.1:${EA.port}`),u({server:j,store:a,port:EA.port})});"keepAliveTimeout"in j&&(j.keepAliveTimeout=1440*60*1e3),"requestTimeout"in j&&(j.requestTimeout=0),"headersTimeout"in j&&(j.headersTimeout=0),"timeout"in j&&(j.timeout=0)})}async function CE(){let B=Number(process.env.PORT??0),D=process.env.PLANX_LOG_DB??":memory:",I=process.env.PLANX_LOG_PORT_FILE,R=process.env.PLANX_LOG_PID_FILE,{server:h,store:a,port:Y}=await TQ({port:B,dbPath:D});I&&nI.writeFileSync(I,String(Y)),R&&nI.writeFileSync(R,String(process.pid)),process.stdout.write(JSON.stringify({service:"log",port:Y,pid:process.pid})+`
|
|
30
30
|
`);let x=()=>{try{h.close?.()}catch{}try{a.close()}catch{}if(R)try{nI.unlinkSync(R)}catch{}if(I)try{nI.unlinkSync(I)}catch{}process.exit(0)};process.on("SIGTERM",x),process.on("SIGINT",x)}CE().catch(B=>{console.error("Failed to start log server:",B),process.exit(1)});
|
|
31
31
|
/*! Bundled license information:
|
|
32
32
|
|