pando-ai 0.9.3 → 0.9.4

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.
@@ -32186,7 +32186,7 @@ Additional information: BADCLIENT: Bad error code, ${N} not found in range ${d}.
32186
32186
  `,"utf8"),nz.default.renameSync(_,i)}function P4t(u){try{let i=nz.default.readFileSync(AJt(u),"utf8"),l=JSON.parse(i);if(l&&l.version===1&&(l.extraRoots===void 0||Array.isArray(l.extraRoots)))return{version:1,extraRoots:l.extraRoots,updatedAt:typeof l.updatedAt=="string"?l.updatedAt:void 0}}catch{}return{version:1,extraRoots:[]}}function IJt(u,i){let l=AJt(u),_=KT.default.dirname(l);nz.default.mkdirSync(_,{recursive:!0});let v=`${l}.${process.pid}.${Date.now()}.tmp`;nz.default.writeFileSync(v,`${JSON.stringify(i,null,2)}
32187
32187
  `,"utf8"),nz.default.renameSync(v,l)}function Chn(u,i){if(!i)return{canonicalRepoRoot:u,gitCommonDir:null,gitObjectDir:null,fingerprint:`non-git:path:${u}`};let l=DJt(i),_=l?ghn(l):null,v=_?yhn(_):null;return{canonicalRepoRoot:i,gitCommonDir:_,gitObjectDir:v,fingerprint:["git",`root:${i}`,`common:${_??""}`,`objects:${v??""}`].join("|")}}function Ahn(u){if(!(process.env.PANDO_SECURITY_HELPER_LAUNCHED==="1"||process.env.PANDO_PROCESS_ROLE==="core"))try{let i=Ehn();i.entries[u.storageRoot]={workspaceId:u.id,workspaceDirName:u.dirName,locationId:u.locationId,incarnationId:u.incarnationId,canonicalProjectRoot:u.canonicalProjectRoot,canonicalRepoRoot:u.canonicalRepoRoot,storageRoot:u.storageRoot,repoIdentity:u.repoIdentity??null,gitCommonDir:u.gitCommonDir??null,gitObjectDir:u.gitObjectDir??null,remote:u.remote??null,branch:u.branch??null,commit:u.commit??null,updatedAt:new Date().toISOString()},Thn(i)}catch{}}function Dhn(u){try{let i=Xue(u),_=P4t(i).extraRoots;if(!Array.isArray(_))return[];let v=i.canonicalProjectRoot,T=new Set,P=[];for(let O of _){if(typeof O!="string")continue;let V=w7(O);V===v||T.has(V)||D4t(V)||(T.add(V),P.push(V))}return P}catch{return[]}}function Ihn(u,i){let l=Xue(u),_=w7(i);if(_===l.canonicalProjectRoot||D4t(_))return!1;let v=P4t(l),P=(Array.isArray(v.extraRoots)?v.extraRoots:[]).map(O=>w7(O));return P.includes(_)?!1:(IJt(l,{version:1,extraRoots:[...P,_],updatedAt:new Date().toISOString()}),!0)}function Phn(u,i){let l=Xue(u),_=w7(i),v=P4t(l);if(!Array.isArray(v.extraRoots))return!1;let T=v.extraRoots.map(P=>w7(P)).filter((P,O,V)=>P!==_&&V.indexOf(P)===O);return T.length===v.extraRoots.length?!1:(IJt(l,{version:1,extraRoots:T,updatedAt:new Date().toISOString()}),!0)}function Xue(u){let i=w7(u),l=I4t(i),_=l??i,v=l,T=Dvt(_),P=Chn(_,v),O=Dvt(P.fingerprint),V=`ws-${Dvt(`${T}:${O}`)}`,K=hhn(_,V);if(!v)return{id:V,dirName:K,locationId:T,incarnationId:O,canonicalProjectRoot:i,canonicalRepoRoot:_,storageRoot:_,gitCommonDir:P.gitCommonDir,gitObjectDir:P.gitObjectDir,repoIdentity:null,remote:null,branch:null,commit:null};let te=DJt(v),oe=te?Shn(te):null,q=oe?_hn(oe):null,De=te?xhn(te):{branch:null,commit:null};return{id:V,dirName:K,locationId:T,incarnationId:O,canonicalProjectRoot:i,canonicalRepoRoot:v,storageRoot:_,gitCommonDir:P.gitCommonDir,gitObjectDir:P.gitObjectDir,repoIdentity:q??`local:${Dvt(_)}`,remote:oe,branch:De.branch,commit:De.commit}}function whn(u){return Xue(u).id}function Sy(u){let i=Xue(u);return Ahn(i),KT.default.join(T6e(),"workspaces",i.dirName)}function Nhn(u,i){let l=Xue(i);return KT.default.join(u,"workspaces",l.dirName)}function C6e(u){return KT.default.join(Sy(u),"meta.db")}function lXe(u){return KT.default.join(Sy(u),"history")}function bO(u,i){return KT.default.join(Sy(u),`.pando-index-chunk-${i}.db`)}function khn(u,i){return KT.default.join(Sy(u),`.pando-fts-chunk-${i}.db`)}function cXe(u){return KT.default.join(Sy(u),".pando-snapshots.db")}var KT,xJt,nz,EJt,oXe,FM=pc(()=>{"use strict";KT=rl(require("path")),xJt=rl(require("os")),nz=rl(require("fs")),EJt=rl(require("crypto"));SJt();oXe=".pando-data"});function NJt(){let u=process.env.PANDO_LOG_DIR||process.env.PANDO_WORKSPACE_DATA_DIR;if(u)return u;try{return T6e()}catch{let l=typeof w4t.default.homedir=="function"?w4t.default.homedir():process.env.HOME;if(l)return Ivt.default.join(l,oXe)}let i=process.env.HOME||process.cwd();return Ivt.default.join(i,oXe)}function Mhn(){return Ivt.default.join(NJt(),"pando.log")}function jhn(){try{N4t.default.mkdirSync(NJt(),{recursive:!0})}catch{}}function zhn(u){if(u!==void 0)try{return typeof u=="string"?u:(0,wJt.inspect)(u,{depth:null,breakLength:1/0,maxArrayLength:1/0})}catch{try{return JSON.stringify(u)}catch{return String(u)}}}function qT(){return wvt}function Uhn(u){return wvt?Whn.has(u)?Fhn:!(!Ohn&&Bhn.has(u)):!1}function vu(u,i,l){if(!Uhn(u))return;let _=new Date().toISOString(),v=zhn(l),T=v?`[${_}] [${u}] ${i} :: ${v}`:`[${_}] [${u}] ${i}`;if(!Ghn&&!process.env.PANDO_QUIET)try{process.stderr.write(T+`
32188
32188
  `)}catch{}try{jhn(),N4t.default.appendFileSync(Mhn(),T+`
32189
- `,"utf8")}catch{}}var N4t,w4t,Ivt,wJt,Rhn,Pvt,Lhn,wvt,Ohn,Fhn,Bhn,Whn,Ghn,$T=pc(()=>{"use strict";N4t=rl(require("fs")),w4t=rl(require("os")),Ivt=rl(require("path"));FM();wJt=require("util"),Rhn=require("crypto");Pvt=u=>{if(u==null)return!1;let i=u.trim().toLowerCase();return i!=="0"&&i!=="false"&&i!=="off"&&i!=="no"},Lhn=Pvt(process.env.PANDO_LOG_DISABLED),wvt=!Lhn&&(process.env.PANDO_DEBUG==null||Pvt(process.env.PANDO_DEBUG)),Ohn=wvt&&(process.env.PANDO_INDEX_HOT_LOG==null||Pvt(process.env.PANDO_INDEX_HOT_LOG)),Fhn=wvt&&(process.env.PANDO_INDEX_TIMING==null||Pvt(process.env.PANDO_INDEX_TIMING)),Bhn=new Set(["BatchAnalysisScheduler","ClojureIndex","ClojureIndexer","ThreadedIndexer"]),Whn=new Set(["IndexTiming"]);Ghn=!1});function k4t(u,i){qT()&&vu("ClojureTrace",u,i)}var Nvt,kJt=pc(()=>{"use strict";yJt();$T();Nvt=class{constructor(i,l){this.fileStates=new Map;this.operationMetadata=new WeakMap;this.project=i,this.projectRoot=l,this.ls={getForFile:_=>Avt(this.projectRoot,_),ensureInProgram:_=>hJt(this.projectRoot,_),bump:_=>gJt(this.projectRoot,_)}}setQueryLayer(i){this._queries=i}get queries(){return this._queries}getOperationMetadata(i,l){return this.operationMetadata.get(i)?.get(l)}setOperationMetadata(i,l,_){let v=this.operationMetadata.get(i);v||(v=new Map,this.operationMetadata.set(i,v)),v.set(l,_)}clearOperationMetadata(i,l){if(l==null){this.operationMetadata.delete(i);return}let _=this.operationMetadata.get(i);_&&(_.delete(l),_.size===0&&this.operationMetadata.delete(i))}setLspHost(i){this._lspHost=i}get lsp(){if(!this._lspHost)try{let{CodeEngineFactory:i}=(tDe(),Pp(A6e)),l=i.getEngineOptions(this.projectRoot);l?.lspHost&&(this._lspHost=l.lspHost,k4t("ExecutionContext.lsp recovered host from engine options",{projectRoot:this.projectRoot,hasHost:!0}))}catch{}return this._lspHost?k4t("ExecutionContext.lsp returning host",{projectRoot:this.projectRoot,lspType:this._lspHost?.constructor?.name??typeof this._lspHost,hasReferences:!!this._lspHost?.references,hasRename:!!this._lspHost?.rename,hasWorkspaceFilesChanged:!!this._lspHost?.workspaceFilesChanged}):k4t("ExecutionContext.lsp returning undefined host",{projectRoot:this.projectRoot}),this._lspHost}saveFileState(i){let l=this.project.getSourceFile(i);l&&this.fileStates.set(i,l.getFullText())}saveFileStates(i){for(let l of i)this.saveFileState(l)}getSavedFilePaths(){return Array.from(this.fileStates.keys())}restoreFileStates(){for(let[i,l]of this.fileStates){let _=this.project.getSourceFile(i);_&&_.replaceWithText(l)}this.fileStates.clear()}}});var OV={};SD(OV,{Database:()=>Rvt,Statement:()=>kvt,default:()=>C1});var RJt,kvt,Rvt,C1,CD=pc(()=>{"use strict";RJt=require("node:sqlite"),kvt=class{constructor(i){this.statement=i}run(...i){let l=this.statement.run(...i);return{changes:l.changes,lastInsertRowid:l.lastInsertRowid}}get(...i){let l=this.statement.get(...i);return l??void 0}all(...i){return this.statement.all(...i)}iterate(...i){return this.statement.iterate(...i)}setAllowBareNamedParameters(i){return this.statement.setAllowBareNamedParameters(i),this}setReadBigInts(i){return this.statement.setReadBigInts(i),this}},Rvt=class u{constructor(i,l){this.file=i;this.transactionDepth=0;let _=l??{},v=!!(_.readOnly??_.readonly);this.connectionId=u.nextId++,this.database=new RJt.DatabaseSync(i,{readOnly:v,fileMustExist:!!_.fileMustExist,timeout:typeof _.timeout=="number"?Math.max(0,Math.floor(_.timeout)):void 0})}static{this.nextId=1}prepare(i){return new kvt(this.database.prepare(i))}exec(i){this.database.exec(i)}close(){this.database.close()}getConnectionId(){return this.connectionId}pragma(i){return this.database.prepare(`PRAGMA ${i}`).all()}transaction(i){return(...l)=>{this.transactionDepth+=1;let _=this.transactionDepth;_===1&&this.database.exec("BEGIN");try{let v=i(...l);if(v instanceof Promise)throw new TypeError("SQLite transactions must be synchronous. Received a Promise.");return _===1&&this.database.exec("COMMIT"),v}catch(v){if(_===1)try{this.database.exec("ROLLBACK")}catch{}throw v}finally{this.transactionDepth=Math.max(0,this.transactionDepth-1)}}}loadExtension(){throw new Error("loadExtension is not supported by the embedded SQLite runtime")}},C1=Rvt});var nDe,MJt,Vhn,uXe,LJt=pc(()=>{"use strict";nDe=rl(require("fs")),MJt=rl(require("path"));CD();FM();Vhn=2,uXe=class{constructor(i=process.cwd()){this.projectRoot=i,this.chunkDbPaths=[],this.discoverChunkDatabases()}discoverChunkDatabases(){let i=Sy(this.projectRoot),l;try{l=nDe.readdirSync(i)}catch{this.chunkDbPaths=[];return}let _=/^\.pando-index-chunk-\d+\.db$/;this.chunkDbPaths=l.filter(v=>_.test(v)).sort().map(v=>MJt.join(i,v))}getChunkPaths(){return[...this.chunkDbPaths]}async queryAllChunks(i,l=[],_={}){let v=Date.now();if(this.chunkDbPaths.length===0)return console.log("\u26A0\uFE0F No chunk databases found. Run indexing first."),[];console.log(`\u{1F50D} Querying ${this.chunkDbPaths.length} chunks in parallel...`);let T=this.chunkDbPaths.map(async(oe,q)=>this.queryChunk(oe,q,i,l)),P=await Promise.all(T),O=[],V=0,K=[];for(let oe of P)oe.error?K.push(`Chunk ${oe.chunkIndex}: ${oe.error}`):(O.push(...oe.results),V+=oe.queryTime);if(_.deduplicateBy){let oe=new Set;O=O.filter(q=>{let De=q[_.deduplicateBy];return oe.has(De)?!1:(oe.add(De),!0)})}if(_.orderBy){let oe=_.orderDirection==="DESC"?-1:1;O.sort((q,De)=>{let be=q[_.orderBy],ve=De[_.orderBy];return be<ve?-1*oe:be>ve?1*oe:0})}_.offset&&(O=O.slice(_.offset)),_.limit&&(O=O.slice(0,_.limit));let te=Date.now()-v;return console.log(`\u2705 Distributed query complete: ${O.length} results in ${te}ms`),console.log(` \u{1F4CA} Avg chunk query time: ${(V/this.chunkDbPaths.length).toFixed(1)}ms`),K.length>0&&console.log(`\u26A0\uFE0F ${K.length} chunk errors:`,K),O}async queryChunk(i,l,_,v){let T=Date.now();try{if(!nDe.existsSync(i))return{chunkIndex:l,chunkPath:i,results:[],queryTime:0,error:`Database file not found: ${i}`};let P=new C1(i,{readonly:!0}),V=P.prepare(_).all(...v);P.close();let K=Date.now()-T;return{chunkIndex:l,chunkPath:i,results:V,queryTime:K}}catch(P){let O=Date.now()-T;return{chunkIndex:l,chunkPath:i,results:[],queryTime:O,error:`Query failed: ${P.message}`}}}async getStats(){console.log(`\u{1F4CA} Gathering statistics from ${this.chunkDbPaths.length} chunks...`);let i=`
32189
+ `,"utf8")}catch{}}var N4t,w4t,Ivt,wJt,Rhn,Pvt,Lhn,wvt,Ohn,Fhn,Bhn,Whn,Ghn,$T=pc(()=>{"use strict";N4t=rl(require("fs")),w4t=rl(require("os")),Ivt=rl(require("path"));FM();wJt=require("util"),Rhn=require("crypto");Pvt=u=>{if(u==null)return!1;let i=u.trim().toLowerCase();return i!=="0"&&i!=="false"&&i!=="off"&&i!=="no"},Lhn=Pvt(process.env.PANDO_LOG_DISABLED),wvt=!Lhn&&(process.env.PANDO_DEBUG==null||Pvt(process.env.PANDO_DEBUG)),Ohn=wvt&&(process.env.PANDO_INDEX_HOT_LOG==null||Pvt(process.env.PANDO_INDEX_HOT_LOG)),Fhn=wvt&&(process.env.PANDO_INDEX_TIMING==null||Pvt(process.env.PANDO_INDEX_TIMING)),Bhn=new Set(["BatchAnalysisScheduler","ClojureIndex","ClojureIndexer","ThreadedIndexer"]),Whn=new Set(["IndexTiming"]);Ghn=!1});function k4t(u,i){qT()&&vu("ClojureTrace",u,i)}var Nvt,kJt=pc(()=>{"use strict";yJt();$T();Nvt=class{constructor(i,l){this.fileStates=new Map;this.operationMetadata=new WeakMap;this.project=i,this.projectRoot=l,this.ls={getForFile:_=>Avt(this.projectRoot,_),ensureInProgram:_=>hJt(this.projectRoot,_),bump:_=>gJt(this.projectRoot,_)}}setQueryLayer(i){this._queries=i}get queries(){return this._queries}getOperationMetadata(i,l){return this.operationMetadata.get(i)?.get(l)}setOperationMetadata(i,l,_){let v=this.operationMetadata.get(i);v||(v=new Map,this.operationMetadata.set(i,v)),v.set(l,_)}clearOperationMetadata(i,l){if(l==null){this.operationMetadata.delete(i);return}let _=this.operationMetadata.get(i);_&&(_.delete(l),_.size===0&&this.operationMetadata.delete(i))}setLspHost(i){this._lspHost=i}get lsp(){if(!this._lspHost)try{let{CodeEngineFactory:i}=(tDe(),Pp(A6e)),l=i.getEngineOptions(this.projectRoot);l?.lspHost&&(this._lspHost=l.lspHost,k4t("ExecutionContext.lsp recovered host from engine options",{projectRoot:this.projectRoot,hasHost:!0}))}catch{}return this._lspHost?k4t("ExecutionContext.lsp returning host",{projectRoot:this.projectRoot,lspType:this._lspHost?.constructor?.name??typeof this._lspHost,hasReferences:!!this._lspHost?.references,hasRename:!!this._lspHost?.rename,hasWorkspaceFilesChanged:!!this._lspHost?.workspaceFilesChanged}):k4t("ExecutionContext.lsp returning undefined host",{projectRoot:this.projectRoot}),this._lspHost}saveFileState(i){let l=this.project.getSourceFile(i);l&&this.fileStates.set(i,l.getFullText())}saveFileStates(i){for(let l of i)this.saveFileState(l)}getSavedFilePaths(){return Array.from(this.fileStates.keys())}restoreFileStates(){for(let[i,l]of this.fileStates){let _=this.project.getSourceFile(i);_&&_.replaceWithText(l)}this.fileStates.clear()}}});var OV={};SD(OV,{Database:()=>Rvt,Statement:()=>kvt,default:()=>C1});var RJt,kvt,Rvt,C1,CD=pc(()=>{"use strict";RJt=require("node:sqlite"),kvt=class{constructor(i){this.statement=i}run(...i){let l=this.statement.run(...i);return{changes:l.changes,lastInsertRowid:l.lastInsertRowid}}get(...i){let l=this.statement.get(...i);return l??void 0}all(...i){return this.statement.all(...i)}iterate(...i){return this.statement.iterate(...i)}setAllowBareNamedParameters(i){return this.statement.setAllowBareNamedParameters(i),this}setReadBigInts(i){return this.statement.setReadBigInts(i),this}},Rvt=class u{constructor(i,l){this.file=i;this.transactionDepth=0;let _=l??{},v=!!(_.readOnly??_.readonly);this.connectionId=u.nextId++,this.database=new RJt.DatabaseSync(i,{readOnly:v,fileMustExist:!!_.fileMustExist,timeout:typeof _.timeout=="number"?Math.max(0,Math.floor(_.timeout)):void 0});try{this.database.exec("PRAGMA temp_store = MEMORY")}catch{}}static{this.nextId=1}prepare(i){return new kvt(this.database.prepare(i))}exec(i){this.database.exec(i)}close(){this.database.close()}getConnectionId(){return this.connectionId}pragma(i){return this.database.prepare(`PRAGMA ${i}`).all()}transaction(i){return(...l)=>{this.transactionDepth+=1;let _=this.transactionDepth;_===1&&this.database.exec("BEGIN");try{let v=i(...l);if(v instanceof Promise)throw new TypeError("SQLite transactions must be synchronous. Received a Promise.");return _===1&&this.database.exec("COMMIT"),v}catch(v){if(_===1)try{this.database.exec("ROLLBACK")}catch{}throw v}finally{this.transactionDepth=Math.max(0,this.transactionDepth-1)}}}loadExtension(){throw new Error("loadExtension is not supported by the embedded SQLite runtime")}},C1=Rvt});var nDe,MJt,Vhn,uXe,LJt=pc(()=>{"use strict";nDe=rl(require("fs")),MJt=rl(require("path"));CD();FM();Vhn=2,uXe=class{constructor(i=process.cwd()){this.projectRoot=i,this.chunkDbPaths=[],this.discoverChunkDatabases()}discoverChunkDatabases(){let i=Sy(this.projectRoot),l;try{l=nDe.readdirSync(i)}catch{this.chunkDbPaths=[];return}let _=/^\.pando-index-chunk-\d+\.db$/;this.chunkDbPaths=l.filter(v=>_.test(v)).sort().map(v=>MJt.join(i,v))}getChunkPaths(){return[...this.chunkDbPaths]}async queryAllChunks(i,l=[],_={}){let v=Date.now();if(this.chunkDbPaths.length===0)return console.log("\u26A0\uFE0F No chunk databases found. Run indexing first."),[];console.log(`\u{1F50D} Querying ${this.chunkDbPaths.length} chunks in parallel...`);let T=this.chunkDbPaths.map(async(oe,q)=>this.queryChunk(oe,q,i,l)),P=await Promise.all(T),O=[],V=0,K=[];for(let oe of P)oe.error?K.push(`Chunk ${oe.chunkIndex}: ${oe.error}`):(O.push(...oe.results),V+=oe.queryTime);if(_.deduplicateBy){let oe=new Set;O=O.filter(q=>{let De=q[_.deduplicateBy];return oe.has(De)?!1:(oe.add(De),!0)})}if(_.orderBy){let oe=_.orderDirection==="DESC"?-1:1;O.sort((q,De)=>{let be=q[_.orderBy],ve=De[_.orderBy];return be<ve?-1*oe:be>ve?1*oe:0})}_.offset&&(O=O.slice(_.offset)),_.limit&&(O=O.slice(0,_.limit));let te=Date.now()-v;return console.log(`\u2705 Distributed query complete: ${O.length} results in ${te}ms`),console.log(` \u{1F4CA} Avg chunk query time: ${(V/this.chunkDbPaths.length).toFixed(1)}ms`),K.length>0&&console.log(`\u26A0\uFE0F ${K.length} chunk errors:`,K),O}async queryChunk(i,l,_,v){let T=Date.now();try{if(!nDe.existsSync(i))return{chunkIndex:l,chunkPath:i,results:[],queryTime:0,error:`Database file not found: ${i}`};let P=new C1(i,{readonly:!0}),V=P.prepare(_).all(...v);P.close();let K=Date.now()-T;return{chunkIndex:l,chunkPath:i,results:V,queryTime:K}}catch(P){let O=Date.now()-T;return{chunkIndex:l,chunkPath:i,results:[],queryTime:O,error:`Query failed: ${P.message}`}}}async getStats(){console.log(`\u{1F4CA} Gathering statistics from ${this.chunkDbPaths.length} chunks...`);let i=`
32190
32190
  SELECT
32191
32191
  (SELECT COUNT(*) FROM nodes) as nodes,
32192
32192
  0 as calls,
@@ -0,0 +1 @@
1
+ import{b as i}from"./chunk-RRIZV7YJ.mjs";import{DatabaseSync as u}from"node:sqlite";var r,s,p,l=i(()=>{"use strict";r=class{constructor(t){this.statement=t}run(...t){let e=this.statement.run(...t);return{changes:e.changes,lastInsertRowid:e.lastInsertRowid}}get(...t){let e=this.statement.get(...t);return e??void 0}all(...t){return this.statement.all(...t)}iterate(...t){return this.statement.iterate(...t)}setAllowBareNamedParameters(t){return this.statement.setAllowBareNamedParameters(t),this}setReadBigInts(t){return this.statement.setReadBigInts(t),this}},s=class o{constructor(t,e){this.file=t;this.transactionDepth=0;let n=e??{},a=!!(n.readOnly??n.readonly);this.connectionId=o.nextId++,this.database=new u(t,{readOnly:a,fileMustExist:!!n.fileMustExist,timeout:typeof n.timeout=="number"?Math.max(0,Math.floor(n.timeout)):void 0});try{this.database.exec("PRAGMA temp_store = MEMORY")}catch{}}static{this.nextId=1}prepare(t){return new r(this.database.prepare(t))}exec(t){this.database.exec(t)}close(){this.database.close()}getConnectionId(){return this.connectionId}pragma(t){return this.database.prepare(`PRAGMA ${t}`).all()}transaction(t){return(...e)=>{this.transactionDepth+=1;let n=this.transactionDepth;n===1&&this.database.exec("BEGIN");try{let a=t(...e);if(a instanceof Promise)throw new TypeError("SQLite transactions must be synchronous. Received a Promise.");return n===1&&this.database.exec("COMMIT"),a}catch(a){if(n===1)try{this.database.exec("ROLLBACK")}catch{}throw a}finally{this.transactionDepth=Math.max(0,this.transactionDepth-1)}}}loadExtension(){throw new Error("loadExtension is not supported by the embedded SQLite runtime")}},p=s});export{p as a,l as b};
@@ -1 +1 @@
1
- import{a as o,b as n}from"./chunk-MKW3R262.mjs";import{c as s}from"./chunk-RRIZV7YJ.mjs";n();import{parentPort as e,workerData as c}from"worker_threads";if(!e)throw new Error("query-db worker must be spawned as a worker thread");s();var{dbPath:i,sql:y}=c;try{let r=new o(i,{readonly:!0});try{let a=r.prepare(y).setReadBigInts(!0).all();e.postMessage({type:"success",rows:a})}finally{r.close()}}catch(r){let t=r instanceof Error?r.message:String(r);e.postMessage({type:"error",message:t})}
1
+ import{a as o,b as n}from"./chunk-7AHKQTIK.mjs";import{c as s}from"./chunk-RRIZV7YJ.mjs";n();import{parentPort as e,workerData as c}from"worker_threads";if(!e)throw new Error("query-db worker must be spawned as a worker thread");s();var{dbPath:i,sql:y}=c;try{let r=new o(i,{readonly:!0});try{let a=r.prepare(y).setReadBigInts(!0).all();e.postMessage({type:"success",rows:a})}finally{r.close()}}catch(r){let t=r instanceof Error?r.message:String(r);e.postMessage({type:"error",message:t})}
@@ -1,4 +1,4 @@
1
- import{g as I,h as Q,j as ct}from"./chunk-WYR734MG.mjs";import{a as V,b as at,c as J,e as R}from"./chunk-MGQRPDUI.mjs";import{a as Z,b as Pt}from"./chunk-MKW3R262.mjs";import{a as kt,c as lt}from"./chunk-RRIZV7YJ.mjs";import{parentPort as j}from"worker_threads";import st from"path";import*as o from"fs";import*as M from"path";import*as u from"isomorphic-git";function xt(){return new Date().toISOString()}function X(r,t,e){let n=`[${xt()}] [${r.toUpperCase()}] ${t}`;if(!e)return n;try{return n+" "+JSON.stringify(e)}catch{return n}}var B={debug:(r,t)=>{try{process.stderr.write(X("debug",r,t)+`
1
+ import{g as I,h as Q,j as ct}from"./chunk-WYR734MG.mjs";import{a as V,b as at,c as J,e as R}from"./chunk-MGQRPDUI.mjs";import{a as Z,b as Pt}from"./chunk-7AHKQTIK.mjs";import{a as kt,c as lt}from"./chunk-RRIZV7YJ.mjs";import{parentPort as j}from"worker_threads";import st from"path";import*as o from"fs";import*as M from"path";import*as u from"isomorphic-git";function xt(){return new Date().toISOString()}function X(r,t,e){let n=`[${xt()}] [${r.toUpperCase()}] ${t}`;if(!e)return n;try{return n+" "+JSON.stringify(e)}catch{return n}}var B={debug:(r,t)=>{try{process.stderr.write(X("debug",r,t)+`
2
2
  `)}catch{}},info:(r,t)=>{try{process.stderr.write(X("info",r,t)+`
3
3
  `)}catch{}},warn:(r,t)=>{try{process.stderr.write(X("warn",r,t)+`
4
4
  `)}catch{}},error:(r,t)=>{try{process.stderr.write(X("error",r,t)+`
@@ -1,4 +1,4 @@
1
- import{d as pe,e as ie,f as F}from"./chunk-MGQRPDUI.mjs";import{a as se,b as Ue}from"./chunk-MKW3R262.mjs";import{c as Re}from"./chunk-RRIZV7YJ.mjs";Ue();import{parentPort as S,threadId as Ae}from"worker_threads";import K from"path";import ce from"fs";import{inspect as Be}from"util";import Pe from"os";function Ge(e){e.exec(`
1
+ import{d as pe,e as ie,f as F}from"./chunk-MGQRPDUI.mjs";import{a as se,b as Ue}from"./chunk-7AHKQTIK.mjs";import{c as Re}from"./chunk-RRIZV7YJ.mjs";Ue();import{parentPort as S,threadId as Ae}from"worker_threads";import K from"path";import ce from"fs";import{inspect as Be}from"util";import Pe from"os";function Ge(e){e.exec(`
2
2
  PRAGMA journal_mode=WAL;
3
3
  PRAGMA synchronous=OFF;
4
4
  PRAGMA temp_store=MEMORY;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pando-ai",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "AI coding firewall for Codex and Claude Code",
5
5
  "bin": {
6
6
  "pando-ai": "bin/pando-ai.js"
@@ -1 +0,0 @@
1
- import{b as i}from"./chunk-RRIZV7YJ.mjs";import{DatabaseSync as u}from"node:sqlite";var r,s,p,l=i(()=>{"use strict";r=class{constructor(t){this.statement=t}run(...t){let e=this.statement.run(...t);return{changes:e.changes,lastInsertRowid:e.lastInsertRowid}}get(...t){let e=this.statement.get(...t);return e??void 0}all(...t){return this.statement.all(...t)}iterate(...t){return this.statement.iterate(...t)}setAllowBareNamedParameters(t){return this.statement.setAllowBareNamedParameters(t),this}setReadBigInts(t){return this.statement.setReadBigInts(t),this}},s=class o{constructor(t,e){this.file=t;this.transactionDepth=0;let n=e??{},a=!!(n.readOnly??n.readonly);this.connectionId=o.nextId++,this.database=new u(t,{readOnly:a,fileMustExist:!!n.fileMustExist,timeout:typeof n.timeout=="number"?Math.max(0,Math.floor(n.timeout)):void 0})}static{this.nextId=1}prepare(t){return new r(this.database.prepare(t))}exec(t){this.database.exec(t)}close(){this.database.close()}getConnectionId(){return this.connectionId}pragma(t){return this.database.prepare(`PRAGMA ${t}`).all()}transaction(t){return(...e)=>{this.transactionDepth+=1;let n=this.transactionDepth;n===1&&this.database.exec("BEGIN");try{let a=t(...e);if(a instanceof Promise)throw new TypeError("SQLite transactions must be synchronous. Received a Promise.");return n===1&&this.database.exec("COMMIT"),a}catch(a){if(n===1)try{this.database.exec("ROLLBACK")}catch{}throw a}finally{this.transactionDepth=Math.max(0,this.transactionDepth-1)}}}loadExtension(){throw new Error("loadExtension is not supported by the embedded SQLite runtime")}},p=s});export{p as a,l as b};