codebaseiq 0.3.0 → 0.3.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/CHANGELOG.md +15 -0
- package/dist/{chunk-BFBIMTCJ.js → chunk-2XBJRZEM.js} +2 -2
- package/dist/{chunk-GDHWOA57.js → chunk-2Z7K66D7.js} +2 -2
- package/dist/{chunk-HVFB3PME.js → chunk-3H2H5ODK.js} +2 -2
- package/dist/{chunk-LZSQ6X7E.js → chunk-3LQJRS4I.js} +2 -2
- package/dist/{chunk-GIDCP7KV.js → chunk-3ON3A2QV.js} +2 -2
- package/dist/{chunk-TPO7XC5Z.js → chunk-4GWN76B2.js} +2 -2
- package/dist/{chunk-GL6UTNUB.js → chunk-53ELMZRF.js} +2 -2
- package/dist/{chunk-6VREELBC.js → chunk-57OPIQFM.js} +2 -2
- package/dist/{chunk-JSNTHRLQ.js → chunk-5CR4U5X2.js} +2 -2
- package/dist/{chunk-GUFPEFBG.js → chunk-5MPBSFZH.js} +2 -2
- package/dist/{chunk-K7JLSGCJ.js → chunk-5TZNHP4T.js} +3 -3
- package/dist/{chunk-DVWO7RBC.js → chunk-5YBDBY5L.js} +2 -2
- package/dist/{chunk-T5X7DK6C.js → chunk-6EYESTJM.js} +2 -2
- package/dist/{chunk-AQI4N64O.js → chunk-6FXXYYQM.js} +2 -2
- package/dist/{chunk-VWYGCMV5.js → chunk-AGGR2BKS.js} +2 -2
- package/dist/{chunk-FEIZXBLH.js → chunk-ALOEHWJS.js} +2 -2
- package/dist/{chunk-D53LWANR.js → chunk-AXQCHG77.js} +2 -2
- package/dist/{chunk-7JELP5YE.js → chunk-BFANZRQ5.js} +2 -2
- package/dist/{chunk-5IZRKWTZ.js → chunk-BGYRF5YX.js} +2 -2
- package/dist/{chunk-5IC2WZAL.js → chunk-BIADXGC3.js} +2 -2
- package/dist/{chunk-HENP2O4A.js → chunk-BPKNP3KZ.js} +2 -2
- package/dist/{chunk-GP7C5VAE.js → chunk-CB5AVJMM.js} +2 -2
- package/dist/{chunk-HQA7EBSK.js → chunk-CJTKGAGH.js} +2 -2
- package/dist/{chunk-JLZLLLW5.js → chunk-CLPCFGRT.js} +2 -2
- package/dist/{chunk-EXZ7VLRY.js → chunk-CSPDQLLU.js} +2 -2
- package/dist/{chunk-AEXQYQD7.js → chunk-CYJS33YX.js} +2 -2
- package/dist/{chunk-AURCQHSG.js → chunk-DDRA3QKN.js} +2 -2
- package/dist/{chunk-3RSBGWGL.js → chunk-DECN422G.js} +2 -2
- package/dist/{chunk-3RR2K7EZ.js → chunk-DJKOXMNG.js} +2 -2
- package/dist/{chunk-PFC44E6D.js → chunk-DWBAESVW.js} +2 -2
- package/dist/{chunk-FQTIFWLR.js → chunk-EHPOTEQX.js} +2 -2
- package/dist/{chunk-NBCQZSGR.js → chunk-ELYMY5S2.js} +2 -2
- package/dist/{chunk-FTTV7IRX.js → chunk-EOKVZXNF.js} +42 -42
- package/dist/{chunk-HINZQKSY.js → chunk-F5CJO5JN.js} +2 -2
- package/dist/{chunk-SMDIEDM4.js → chunk-G7GVV2TV.js} +2 -2
- package/dist/{chunk-67VJAYVR.js → chunk-HJTM3C4Y.js} +2 -2
- package/dist/{chunk-I22IZYDI.js → chunk-HNXRVGMY.js} +2 -2
- package/dist/{chunk-NCJILOAK.js → chunk-I3OK27P7.js} +2 -2
- package/dist/{chunk-FWQGH2N2.js → chunk-ILGTMRMZ.js} +2 -2
- package/dist/{chunk-DDN2F6GB.js → chunk-JAFDMV5I.js} +2 -2
- package/dist/{chunk-LONKINMJ.js → chunk-JNXI6NQ7.js} +2 -2
- package/dist/{chunk-6BF3VYEF.js → chunk-JSB43EX6.js} +2 -2
- package/dist/chunk-JYRJYXUV.js +2 -0
- package/dist/chunk-K4S2VH42.js +82 -0
- package/dist/{chunk-75KJGYX7.js → chunk-K6FNTQQW.js} +2 -2
- package/dist/{chunk-XQPPURLQ.js → chunk-KEJ2HLRW.js} +2 -2
- package/dist/{chunk-D7AZAOZX.js → chunk-KFTHI2R6.js} +2 -2
- package/dist/{chunk-J3GLP7Q5.js → chunk-KLX6NSWT.js} +2 -2
- package/dist/{chunk-TJBOJUVN.js → chunk-KUKKLWJD.js} +2 -2
- package/dist/{chunk-2EDX3JT5.js → chunk-KUKWHP4R.js} +2 -2
- package/dist/{chunk-JFIA2JI3.js → chunk-KWRQVLPX.js} +2 -2
- package/dist/{chunk-5DSL3NT2.js → chunk-L37EQYAX.js} +2 -2
- package/dist/{chunk-ITSJMNUD.js → chunk-LCW3PSGL.js} +2 -2
- package/dist/{chunk-2PRONPAS.js → chunk-LSZYMN2A.js} +2 -2
- package/dist/{chunk-Q23IMHXS.js → chunk-MC46AL7B.js} +2 -2
- package/dist/{chunk-JYI7CV25.js → chunk-MDFT325O.js} +2 -2
- package/dist/{chunk-CVHOQONG.js → chunk-N2XDMNVI.js} +2 -2
- package/dist/chunk-NNG6M6XD.js +3 -0
- package/dist/{chunk-MVRGB4KJ.js → chunk-O2KWU34K.js} +2 -2
- package/dist/{chunk-USOAJHY7.js → chunk-OBC7HSSO.js} +2 -2
- package/dist/{chunk-RIYJ4L33.js → chunk-OKAF4OQS.js} +2 -2
- package/dist/{chunk-GQXXOS55.js → chunk-OP6BUIV6.js} +2 -2
- package/dist/{chunk-23C5AD3B.js → chunk-OQ3DK7FW.js} +2 -2
- package/dist/chunk-OT5ISJSR.js +2 -0
- package/dist/{chunk-C7QWUBR2.js → chunk-OWJWOEDU.js} +2 -2
- package/dist/{chunk-RJVAPMHF.js → chunk-PIFYOWS4.js} +2 -2
- package/dist/{chunk-CR3OG6SQ.js → chunk-PTR3EOXC.js} +2 -2
- package/dist/{chunk-NBZKSTXP.js → chunk-QY7QB7I6.js} +2 -2
- package/dist/{chunk-Q3ZCQY2Y.js → chunk-R4OJGTMP.js} +2 -2
- package/dist/{chunk-UQE4XFSA.js → chunk-RIO3JXHM.js} +2 -2
- package/dist/{chunk-CW6AXOLR.js → chunk-SA7G6GJX.js} +2 -2
- package/dist/{chunk-Q4XEU3UH.js → chunk-SB53KPWA.js} +2 -2
- package/dist/{chunk-36JC5BG2.js → chunk-SUE7SHZL.js} +2 -2
- package/dist/{chunk-ZAFGY22Q.js → chunk-SZ4P7MF7.js} +2 -2
- package/dist/{chunk-BBP7HVBJ.js → chunk-T2M5HWBQ.js} +2 -2
- package/dist/{chunk-MHWMEZDA.js → chunk-TEMM2FEL.js} +2 -2
- package/dist/{chunk-JX6ZWDOS.js → chunk-TLTSESB4.js} +2 -2
- package/dist/{chunk-FOZ74V56.js → chunk-UIAUPFBJ.js} +2 -2
- package/dist/{chunk-PHNCEUXX.js → chunk-UJIXCI3L.js} +2 -2
- package/dist/{chunk-XMJ53WG4.js → chunk-UMEPSVKT.js} +2 -2
- package/dist/{chunk-GWYZVVKY.js → chunk-V4NGDIEA.js} +2 -2
- package/dist/{chunk-E52K4L2W.js → chunk-VSGOIZMQ.js} +2 -2
- package/dist/{chunk-Z6RL7XOE.js → chunk-W7QDASTN.js} +2 -2
- package/dist/{chunk-PTQPPPG2.js → chunk-WO6OFKUC.js} +2 -2
- package/dist/{chunk-C7OUW52M.js → chunk-XJBK3QDV.js} +2 -2
- package/dist/{chunk-FH5WG4LE.js → chunk-XUPFA6GH.js} +2 -2
- package/dist/{chunk-DAKIGMIK.js → chunk-YPBKBYPS.js} +2 -2
- package/dist/{chunk-ZQ62NNKN.js → chunk-Z66XYVLZ.js} +2 -2
- package/dist/{chunk-OFGOOL6U.js → chunk-ZMA5HWXY.js} +2 -2
- package/dist/{cli-program-UO7PZD6V.js → cli-program-SCHOHOQE.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/{code-viewer-VHLBLIUM.js → code-viewer-AMRXV444.js} +2 -2
- package/dist/{code-viewer-KIXEYQNJ.js → code-viewer-EXI5SFFR.js} +2 -2
- package/dist/{command-descriptors-F5P2V3NW.js → command-descriptors-H6A4UY72.js} +3 -3
- package/dist/{command-descriptors-YCLATF5I.js → command-descriptors-ROIOTCCW.js} +3 -3
- package/dist/direct-navigation-3JOYP2MO.js +3 -0
- package/dist/direct-navigation-SJMJLBY7.js +2 -0
- package/dist/index.js +1 -1
- package/dist/invocation-command-descriptors-GMZX3UAD.js +2 -0
- package/dist/invocation-command-descriptors-HNMKDEF6.js +3 -0
- package/dist/{output-continuation-command-BTETTXEC.js → output-continuation-command-5NWVDQT7.js} +2 -2
- package/dist/output-continuation-command-RNEHNYPU.js +3 -0
- package/dist/project-reindex-MIW5CYEG.js +3 -0
- package/dist/{project-reindex-CRJU3IFG.js → project-reindex-VQ23LWDA.js} +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/anchors.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.js +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/dependence-slice.js +1 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/entry-map.js +1 -1
- package/dist/queries/evidence.js +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/reference-neighborhood.js +1 -1
- package/dist/queries/reference-reachability.js +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.js +1 -1
- package/dist/queries/source-inspection.js +1 -1
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/system-map.js +1 -1
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/value-flow.js +1 -1
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +1 -1
- package/dist/reindex.js +1 -1
- package/dist/runtime.js +1 -1
- package/dist/rust-semantic-session-server.js +1 -1
- package/dist/rust-semantic-session-worker.js +1 -1
- package/dist/rust-semantic-worker.js +1 -1
- package/dist/{sentinel-ensure-command-SPW7XQLB.js → sentinel-ensure-command-H66AZ3VE.js} +2 -2
- package/dist/sentinel-ensure-command-R4YAUCJB.js +3 -0
- package/dist/watch-server.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-6JMAVFL4.js +0 -3
- package/dist/chunk-6WAPPQ5F.js +0 -82
- package/dist/chunk-P4NVCOM7.js +0 -2
- package/dist/chunk-Z35GOVEH.js +0 -2
- package/dist/direct-navigation-4XJTXIDT.js +0 -2
- package/dist/direct-navigation-J5MVYYAD.js +0 -3
- package/dist/invocation-command-descriptors-RWV4VAI4.js +0 -2
- package/dist/invocation-command-descriptors-U76PN7IY.js +0 -3
- package/dist/output-continuation-command-BL25S26S.js +0 -3
- package/dist/project-reindex-TQFCOA2O.js +0 -3
- package/dist/sentinel-ensure-command-OSWGCFFL.js +0 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as t}from"./chunk-I3OK27P7.js";function i(r,s,e={}){let a=t(r,s,{families:["dataflow"],...e.maxDepth!==void 0?{maxDepth:e.maxDepth}:{},...e.maxEdges!==void 0?{maxEdges:e.maxEdges}:{}});return{kind:"value-flow",targets:a.targets,edges:a.edges,coverage:{status:a.coverage.status,basis:"proved-bounded-static-value-flow",analysisBasis:"partial-system-definition-use",providers:["bounded-static-value-flow","typescript-local-dependence"],supportedRelations:["compiler-identified local definitions reaching local reads through a TypeScript control-flow graph","right-hand-side local reads supplying assignments and declarations","candidate closure captures and bounded same-owner field flow with explicit evidence strength","direct argument-to-parameter forwarding at compiler-resolved calls","bounded mechanically derived static arguments","callee return value to a consumed compiler-resolved call result"],unsupportedRelations:["general heap alias and cross-instance field points-to flow","exceptional control and value flow","closure invocation order","downstream local definition-use after a call result","dynamic calls not resolved by the semantic provider"],graph:a.coverage}}}export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-LCW3PSGL.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as h}from"./chunk-
|
|
1
|
+
import{b as h}from"./chunk-JYRJYXUV.js";import{c as p}from"./chunk-6O3KXIDL.js";import{aa as m,ca as d,da as P,g as f}from"./chunk-UQYQBLJX.js";import{realpathSync as c}from"fs";import{basename as x,dirname as L,join as T,relative as I,sep as O}from"path";import{fileURLToPath as S,pathToFileURL as y}from"url";function F(n,e){return e==="."||e==="./"?y(c(n)).href:y(m(n,e).absolutePath).href}function b(n,e){let r=S(e);return I(c(n),v(r)).split(O).join("/")}function v(n){try{return c(n)}catch{try{return T(c(L(n)),x(n))}catch{return n}}}function H(n,e,r){return{textDocument:{uri:F(n,e.relativePath)},position:z(n,e),context:{includeDeclaration:r}}}function z(n,e){let r={line:e.startLine,character:e.startChar??0};try{return M(d(n,e.relativePath,{inputKind:"indexed Rust source file"}),e,r)}catch(t){if(!P(t))throw t;return r}}function M(n,e,r={line:e.startLine,character:e.startChar??0}){let t=n.split(/\r?\n/),o=t[e.startLine];if(o===void 0||e.leaf.length===0)return r;let i=Math.max(0,Math.min(r.character,o.length)),s=o.indexOf(e.leaf,i);if(s>=0)return{line:e.startLine,character:u(s,e.leaf)};let a=o.indexOf(e.leaf);if(a>=0)return{line:e.startLine,character:u(a,e.leaf)};let l=D(t,e.startLine,e.leaf);return l||r}function u(n,e){return n+Math.max(0,e.length-2)}function D(n,e,r){for(let t of[-1,1,-2,2]){let o=e+t;if(o<0||o>=n.length)continue;let i=n[o].indexOf(r);if(i>=0)return{line:o,character:u(i,r)}}return null}function K(n,e){return e.map(r=>({file:b(n,r.uri),line:r.range.start.line,column:r.range.start.character}))}function X(n){let e=new Map;for(let r of n)e.set(`${r.file}\0${r.line}\0${r.column}`,r);return[...e.values()].sort((r,t)=>{let o=r.file.localeCompare(t.file);return o!==0?o:r.line!==t.line?r.line-t.line:r.column-t.column})}import{randomUUID as E}from"crypto";import{readdirSync as $,rmSync as j,writeFileSync as A}from"fs";import{join as g}from"path";var R="rust-analyzer-owner-",w=".json",U=16*1024;function Z(n,e){if(!n||!e.rootIdentity)return null;let r=g(n,`${R}${e.rootPid}-${E()}${w}`),t={version:1,rootIdentity:e.rootIdentity,ownsProcessGroup:e.ownsProcessGroup};return A(r,`${JSON.stringify(t)}
|
|
2
2
|
`,{encoding:"utf8",mode:384,flag:"wx"}),r}function ee(n){n&&j(n,{force:!0})}async function re(n,e){if(!n)return[];let r;try{r=$(n)}catch{return[]}let t=r.filter(s=>s.startsWith(R)&&s.endsWith(w)).map(s=>g(n,s)),o=[],i=[];for(let s of t){let a=C(s);a?i.push(a):o.push({reaped:!1,reason:"identity-unavailable",detail:`Rust analyzer ownership record ${s} could not be validated.`})}return o.push(...await Promise.all(i.map(s=>h(s,e)))),o}function C(n){try{let e=f(n,{maxBytes:U,inputKind:"rust-analyzer process ownership record"}),r=JSON.parse(e),t=p(r.rootIdentity);return r.version!==1||!t||typeof r.ownsProcessGroup!="boolean"?null:{rootPid:t.pid,rootIdentity:t,ownsProcessGroup:r.ownsProcessGroup,knownMembers:new Map([[t.pid,t]])}}catch{return null}}export{Z as a,ee as b,re as c,F as d,b as e,H as f,K as g,X as h};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-LSZYMN2A.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as ir}from"./chunk-EN4AHLL3.js";import{Bb as Yn,Jb as Kn,Kb as Qn,Lb as Zn,Nb as er,Ob as tr,Pb as nr,Qb as rr,T as Vn,U as $n,ca as ke,cb as Bn,db as Un,fb as re,gb as Te,hb as pe,ib as Wn,jb as Gn,k as Ee,kb as qn,lb as Jn,mb as Hn,ob as we,pb as zn,ub as ft,zb as Xn}from"./chunk-
|
|
2
|
+
import{a as ir}from"./chunk-EN4AHLL3.js";import{Bb as Yn,Jb as Kn,Kb as Qn,Lb as Zn,Nb as er,Ob as tr,Pb as nr,Qb as rr,T as Vn,U as $n,ca as ke,cb as Bn,db as Un,fb as re,gb as Te,hb as pe,ib as Wn,jb as Gn,k as Ee,kb as qn,lb as Jn,mb as Hn,ob as we,pb as zn,ub as ft,zb as Xn}from"./chunk-EOKVZXNF.js";import{d as nn,e as tt}from"./chunk-D62CTZX6.js";import{$ as gn,$a as Ie,A as an,Aa as U,B as Se,Ba as W,C as E,Ca as G,D as le,E as ee,Ea as lt,F as it,Fa as Sn,G as sn,Ga as dt,H as ot,Ha as pt,I as at,Ia as Rn,J as R,Ja as xn,Ka as Pn,L as cn,La as vn,M as A,Ma as In,Na as En,O as Re,Oa as kn,P as st,Pa as Tn,Q as un,Qa as wn,Ra as _n,S as ln,Sa as Fn,Ta as Ln,U as te,Ua as An,Va as ve,Wa as Dn,X as dn,Y as pn,Ya as gt,Za as On,_ as O,_a as Nn,cb as Cn,db as jn,eb as Mn,ha as xe,ia as de,j as nt,ka as ne,ma as fn,pa as mn,s as rt,ta as Pe,u as F,ua as hn,v as rn,va as ct,wa as yn,xa as bn,ya as ut,z as on}from"./chunk-5T44HG5Y.js";import{C as tn,D as et,F as B,d as ye,i as Qt,j as K,k as Q,l as Ke,m as ce,n as be,o as Qe,p as D,q as _,r as L,s as Zt,w as en,x as ue,y as Z,z as Ze}from"./chunk-DUKHVPU5.js";import{createHash as Gu}from"crypto";import{existsSync as T,mkdirSync as He,readdirSync as Zi,renameSync as eo,rmSync as ae,statSync as qu}from"fs";import{basename as Je,dirname as y,extname as Ju,join as k,resolve as qi}from"path";import{execFileSync as mo}from"child_process";import{constants as ho,copyFileSync as or,statSync as yo}from"fs";import{platform as bo}from"os";var So=Object.freeze({size:e=>yo(e).size,clone:xo,copy:(e,t)=>or(e,t)}),Ro=new Set(["ENOSYS","ENOTSUP","EOPNOTSUPP","EINVAL","EXDEV","ENOTTY"]);function q(e,t,n=So){let r=n.size(e);try{return n.clone(e,t),{method:"reflink",bytes:r}}catch(i){if(!vo(i))throw i}return n.copy(e,t),{method:"copy",bytes:r}}function xo(e,t){if(bo()!=="darwin"){or(e,t,ho.COPYFILE_FICLONE_FORCE);return}try{mo("/bin/cp",["-c",e,t],{timeout:6e4,maxBuffer:64*1024,stdio:["ignore","ignore","pipe"],windowsHide:!0})}catch(n){throw Po(n)}}function Po(e){let t=e?.stderr,n=Buffer.isBuffer(t)?t.toString("utf8"):t??"";return/operation not supported|not supported/i.test(n)?Object.assign(e instanceof Error?e:new Error(String(e)),{code:"ENOTSUP"}):/cross-device link/i.test(n)?Object.assign(e instanceof Error?e:new Error(String(e)),{code:"EXDEV"}):e}function vo(e){let t=e?.code;return t!==void 0&&Ro.has(t)}function ar(){return{reflinkedBytes:0,fallbackCopiedBytes:0}}function J(e,t){t.method==="reflink"?e.reflinkedBytes+=t.bytes:e.fallbackCopiedBytes+=t.bytes}import Io from"better-sqlite3";import{execFileSync as Eo}from"child_process";import{existsSync as ko,readdirSync as To}from"fs";import{extname as _e,join as wo}from"path";function H(e={}){return{id:"auxiliary-documents",facts:["auxiliary-document"],run:t=>sr({projectRoot:t.projectRoot,dbPath:t.dbPath,extensions:e.extensions,onStatus:t.onStatus})}}function sr(e){let t=new Set((e.extensions??Vn).map(o=>o.toLowerCase()));if(t.size===0)return{scanned:0,inserted:0,existing:0};if(!ko(e.dbPath))throw new Error(`SCIP SQLite database not found at ${e.dbPath}`);let n=gn(e.projectRoot),r=_o(e.projectRoot,t).filter(o=>!n.isIgnored(o)),i=new Io(F(e.dbPath));try{let o=Lo(i,r),a=i.prepare(`INSERT OR IGNORE INTO documents (language, relative_path, position_encoding, text)
|
|
3
3
|
VALUES (?, ?, NULL, ?)`),c=i.transaction(l=>{let d=0;for(let p of l){if(o.has(p))continue;let g=mn(e.projectRoot,p,{inputKind:"auxiliary source file"}),f=a.run(Ao(p),p,g);d+=Number(f.changes)}return d})(r),u={scanned:r.length,inserted:c,existing:r.length-c};return e.onStatus?.(`Augmented SQLite documents with ${c} auxiliary source file${c===1?"":"s"} (${u.existing} already present).`),u}finally{i.close()}}function _o(e,t){let n=Fo(e,t);if(n)return n;let r=[],i=o=>{let a=o?wo(e,o):e,s;try{s=To(a,{withFileTypes:!0})}catch{return}for(let c of s){if($n.has(c.name))continue;let u=o?`${o}/${c.name}`:c.name;if(c.isDirectory()){i(u);continue}t.has(_e(c.name).toLowerCase())&&r.push(u)}};return i(""),r.sort()}function Fo(e,t){try{return Eo("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:3e4,killSignal:"SIGKILL"}).split(`
|
|
4
4
|
`).filter(r=>r&&t.has(_e(r).toLowerCase())).sort()}catch{return null}}function Lo(e,t){let n=new Set,r=500;for(let i=0;i<t.length;i+=r){let o=t.slice(i,i+r),a=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${o.map(()=>"?").join(",")})`).all(...o);for(let s of a)n.add(s.relative_path)}return n}function Ao(e){return _e(e).toLowerCase()===".vue"?"vue":_e(e).replace(/^\./,"").toLowerCase()||"source"}import{dirname as Do,join as Oo}from"path";function cr(e={}){return{id:"runtime-boundaries",facts:["runtime-boundary-observation","runtime-boundary-link"],run:({projectRoot:t,dbPath:n,onStatus:r})=>{let i=new O({projectRoot:t,dbPath:n,indexPath:e.indexPath??Oo(Do(n),"index.scip")}),o,a=!1,s=!1;try{let u=e.reuseExisting||e.affectedFiles?er(i):null;e.reuseExisting&&u?.extractorVersion===Kn?(o=u,a=!0):(o=Qn(i,{...u?{previousGraph:u}:{},...e.affectedFiles?{affectedFiles:e.affectedFiles}:{}}),s=(o.coverage.filesReused??0)>0)}finally{i.close()}a||Zn(n,o);let c={reused:a,incrementallyUpdated:s,observations:o.observations.length,links:o.links.length,frontiers:o.frontiers.length,filesScanned:o.coverage.filesScanned,errors:o.coverage.extractionErrors.length,phases:o.coverage.phases};return r?.(c.reused?`Reused ${c.observations} cached runtime-boundary observation(s) and ${c.links} link(s).`:c.incrementallyUpdated?`Incrementally refreshed runtime-boundary observations (${c.filesScanned-(o.coverage.filesReused??0)} file(s) extracted, ${o.coverage.filesReused??0} reused) and rebuilt ${c.links} link(s).`:`Extracted ${c.observations} runtime-boundary observation(s), ${c.links} link(s), and ${c.frontiers} unresolved frontier(s).`),!a&&o.coverage.phases&&r?.(`Runtime-boundary phases: ${o.coverage.phases.map(u=>`${u.id} ${u.durationMs.toFixed(0)}ms`).join(", ")}.`),c}}}import{createHash as Yo}from"crypto";import{existsSync as Ko}from"fs";import{dirname as Qo,join as fr}from"path";function mt(e){let t=new Set;for(let n of e.uncertainty)t.add(n);e.projectIdentityChanged&&t.add("project-identity-changed");for(let n of e.changes)n.kind==="added"&&t.add("file-added"),n.kind==="deleted"&&t.add("file-deleted"),n.inputKind==="config"&&t.add("configuration-changed"),n.inputKind==="ambient"&&t.add("ambient-declaration-changed"),n.inputKind==="other"&&t.add("unclassified-input");return{fullProject:t.size>0,reasons:[...t].sort()}}function Fe(e,t,n){let r=e.changes.map(s=>s.path).sort();if(r.length===0&&!e.projectIdentityChanged&&e.uncertainty.length===0)return{mode:"none",changedFiles:r,affectedFiles:[],reasons:[]};let i=new Set(n),o=mt(e),a=new Set(o.reasons);return r.some(s=>!i.has(s))&&a.add("changed-file-outside-project"),t===null?(a.add("dependency-graph-unavailable"),ur(r,i,a)):a.size>0?ur(r,i,a):{mode:"closure",changedFiles:r,affectedFiles:No(r,t,i),reasons:[]}}function ur(e,t,n){return{mode:"full-project",changedFiles:e,affectedFiles:[...t].sort(),reasons:[...n].sort()}}function No(e,t,n){let r=new Map;for(let[a,s]of t)if(n.has(a))for(let c of s){if(!n.has(c))continue;let u=r.get(c)??new Set;u.add(a),r.set(c,u)}let i=new Set(e),o=[...e];for(let a=0;a<o.length;a+=1){let s=o[a];if(s!==void 0)for(let c of r.get(s)??[])i.has(c)||(i.add(c),o.push(c))}return[...i].sort()}import{appendFileSync as Co,existsSync as jo,mkdirSync as Mo,renameSync as Vo,rmSync as $o,statSync as Bo,truncateSync as Uo}from"fs";import{basename as Wo,dirname as Go}from"path";var ie=".previous",qo=".rotation.lock",Jo=2e3,ht=class extends Error{constructor(n,r){super(`Timed out after ${r}ms waiting for rotating JSONL lock: ${n}`);this.lockPath=n;this.timeoutMs=r;this.name="RotatingJsonlLockTimeoutError"}lockPath;timeoutMs;code="ROTATING_JSONL_LOCK_TIMEOUT"},yt=class extends Error{constructor(n){super(`Rotating JSONL lock ownership changed before release: ${n}`);this.lockPath=n;this.name="RotatingJsonlLockReleaseError"}lockPath;code="ROTATING_JSONL_LOCK_RELEASE_FAILED"},lr=Object.freeze({monotonicNow:R,wait(e){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)},tryAcquireLock(e,t){let n=Re(e,{kind:"rotating-jsonl",detail:{target:Wo(t)}});return n.kind==="acquired"?{kind:"acquired",lock:n.lock}:{kind:"contended"}},makeDirectory(e){Mo(e,{recursive:!0})},exists:jo,readBytes(e){return D(e,{maxBytes:be,inputKind:"rotating JSONL segment"})},size(e){return Bo(e).size},truncate:Uo,remove(e){$o(e,{force:!0})},rename:Vo,append:Co});function Le(e,t,n){let r=n.runtime??lr,i=JSON.stringify(t);if(i===void 0)throw new TypeError("Rotating JSONL records must be JSON-serializable values.");let o=Buffer.from(`${i}
|
|
5
5
|
`),a=Math.max(1,Math.floor(n.maxSegmentBytes),o.length);return pr(e,n.lockTimeoutMs,r,()=>{r.makeDirectory(Go(e));let s=Ho(e,be,r);n.onPhase?.("tail-repaired");let c=`${e}${n.previousSuffix??ie}`,u=!1,l=!1;return r.exists(e)&&r.size(e)+o.length>a&&(r.exists(c)&&(r.remove(c),l=!0),n.onPhase?.("previous-pruned"),r.rename(e,c),u=!0,n.onPhase?.("current-rotated")),r.append(e,o),n.onPhase?.("record-appended"),{lineBytes:o.length,segmentLimitBytes:a,repairedTailBytes:s,rotated:u,prunedPrevious:l}})}function dr(e,t={}){let n=t.runtime??lr,r=zo(t.maxSegmentBytes);return pr(e,t.lockTimeoutMs,n,()=>{let i=[],o=0,a=`${e}${t.previousSuffix??ie}`;for(let s of[a,e]){if(!n.exists(s))continue;let c=Xo(gr(s,r,n));i.push(...c.lines),o+=c.partialTailBytes}return{lines:i,ignoredPartialTailBytes:o}})}function pr(e,t,n,r){let i=`${e}${qo}`,o=Math.max(0,t??Jo),a=n.monotonicNow()+o,s;for(;;){let p=n.tryAcquireLock(i,e);if(p.kind==="acquired"){s=p.lock;break}let g=a-n.monotonicNow();if(g<=0)throw new ht(i,o);n.wait(Math.min(5,g))}let c=!1,u,l;try{l=r()}catch(p){c=!0,u=p}let d=!1;try{d=s.release()}catch(p){if(!c)throw p}if(c)throw u;if(!d)throw new yt(i);return l}function Ho(e,t,n){if(!n.exists(e))return 0;let r=gr(e,t,n);if(r.length===0||r[r.length-1]===10)return 0;let i=r.lastIndexOf(10),o=i<0?0:i+1;return n.truncate(e,o),r.length-o}function zo(e){let t=e??be;if(!Number.isSafeInteger(t)||t<=0)throw new RangeError(`maxSegmentBytes must be a positive safe integer; received ${t}`);return t}function gr(e,t,n){let r=n.size(e);if(r>t)throw new Qe("rotating JSONL segment",e,"too-large",r,t);let i=n.readBytes(e),o=n.size(e);if(o!==r||i.byteLength!==r)throw new Qe("rotating JSONL segment",e,"changed-during-read",o,t);return i}function Xo(e){let t=e.lastIndexOf(10),n=t<0?0:t+1;return{lines:e.subarray(0,n).toString("utf8").split(`
|
|
@@ -340,4 +340,4 @@ ${d}`:""}`)}Sc(e.config,t,e.scipPath)}catch(u){if(r?.aborted)throw cn(r,"Reindex
|
|
|
340
340
|
`+o)}if(t.length!==0&&(i(`Indexed ${e.length} language output(s); skipped or incomplete: ${t.map(o=>o.language).join(", ")}.`),!r))throw new Error(`Failed to index all required languages; preserving the previous index. Pass --allow-partial to intentionally write an incomplete index.
|
|
341
341
|
`+t.map(o=>` - ${o.language}: ${o.reason}`).join(`
|
|
342
342
|
`))}function zi(e,t,n){if(e.length>1){n(`Merging ${e.length} language indexes...`);let r=performance.now(),i=An(e.map(o=>o.scipPath),t);return ao(i,n),n(`Merged and sanitized SCIP indexes in ${(performance.now()-r).toFixed(0)}ms.`),!0}else e[0].scipPath!==t&&eo(e[0].scipPath,t);return!1}async function bl(e){let t;if(Sl(e)){let i=k(e.run.tempPaths.runDir,"typescript-affected.db");try{e.run.onStatus(`Converting ${e.incrementalTypeScript.affectedFiles.length} affected TypeScript document(s) to SQLite...`);let o=performance.now();Xi(e.incrementalTypeScript.affectedScipPath,i,e.run.onStatus,!1,e.run.opts.signal),e.run.onStatus(`Converted affected SCIP documents in ${(performance.now()-o).toFixed(0)}ms.`);let a=Dr({previousDbPath:e.run.paths.outputDb,miniDbPath:i,candidateDbPath:e.run.tempPaths.tempOutputDb,affectedFiles:e.incrementalTypeScript.affectedFiles,writeTelemetry:e.run.writeTelemetry});return e.run.onStatus(`Patched ${a.affectedDocumentCount} SQLite document(s) in ${(a.durationMs/1e3).toFixed(3)}s.`),{mode:"incremental",changedDocumentPaths:a.changedDocumentPaths,patchDurationMs:a.durationMs,converterDurationMs:performance.now()-o,scipCompanion:e.incrementalTypeScript.completeScipUpdated?"current":"deferred"}}catch(o){A(e.run.opts.signal,"Reindex cancelled by its owner."),t=o instanceof Error?o.message:String(o),te(()=>ae(i,{force:!0})),te(()=>ae(e.run.tempPaths.tempOutputDb,{force:!0})),e.run.onStatus(`Incremental SQLite publication unavailable: ${t}. Falling back to complete conversion.`)}}let n=e.completeScipSanitized;e.completeScipAvailable||(n=await e.materializeFullFallback());let r=performance.now();return Xi(e.run.tempPaths.tempOutputScip,e.run.tempPaths.tempOutputDb,e.run.onStatus,n,e.run.opts.signal),{mode:"full",converterDurationMs:performance.now()-r,...t?{fallbackReason:t}:{}}}function Sl(e){if(!e.incrementalTypeScript||e.skippedLanguages.length>0||!T(e.run.paths.outputDb)||!T(e.run.paths.outputScip))return!1;let t=new Set(e.reusedLanguages);return e.indexedOutputs.length===e.run.languages.length&&e.run.languages.every(n=>n==="typescript"||t.has(n))}function Rl(e,t){let n=R(),r=[...t].sort(),i=new Set(r),o={addedFiles:[],modifiedFiles:r,deletedFiles:[],changedFiles:r,unchangedFiles:e.affectedFiles.filter(a=>!i.has(a)).sort()};return{version:1,status:"evaluated",refreshResult:"rebuilt",recordedAt:new Date().toISOString(),durationMs:R()-n,manifest:e.manifest,plan:e.plan,comparison:o,evaluation:St(e.plan,o,e.projectFileCount)}}function Xi(e,t,n,r,i){if(A(i,"Reindex cancelled by its owner."),n("Writing the SQLite index..."),!T(e))throw new Error(`SCIP index not found at ${e} after indexing`);try{ao(ri(e,t,{sanitize:!r}),n)}catch(o){let a=o instanceof Error?o.message:String(o);throw new Error(`Failed to write the SQLite index: ${a}`,{cause:o})}}function ao(e,t){e.removedDefinitionOccurrences!==0&&t(`Sanitized ${e.removedDefinitionOccurrences} invalid definition occurrences across ${e.touchedDocuments} documents before SQLite conversion.`)}function he(e,t,n){let r=Ju(e)||".scip",i=Je(e,r);return k(y(e),`${i}.${n+1}.${t}${r}`)}async function xl(e,t){for(let n=0;n<2;n++){let r=Pl(e,t);if(r)return r;let i=vl(e);if(i&&uo(t.trigger,i)){t.onStatus(`Manual reindex preempting watcher refresh started at ${i.startedAt}.`);let o;try{o=await El(i)}catch(s){throw new Error(`Could not verify the watcher's in-progress reindex owner (pid ${i.pid}); refusing to steal an active lock: ${$(s)}`,{cause:s})}if(!o)throw new Error(`Could not confirm the watcher's in-progress reindex (pid ${i.pid}) terminated for ${y(e)}; refusing to steal an active lock.`);let a=st(e,{parseLegacy:ze});if(!un(e,a,{parseLegacy:ze}))throw new Error(`Reindex lock ownership changed before preemption completed for ${y(e)}.`);continue}throw new Error(`Another codebaseiq reindex is already running for ${y(e)}.`)}throw new Error(`Could not acquire codebaseiq reindex lock for ${y(e)}.`)}function Pl(e,t){let n=Z(process.pid),r=Re(e,{kind:"reindex",processIdentity:n,detail:{projectRoot:t.projectRoot,...process.env.SCIP_REINDEX_PROCESS_GROUP_LEADER==="1"?{processGroupLeader:!0}:{},...t.trigger?{trigger:t.trigger}:{}},parseLegacy:ze});if(r.kind==="acquired"&&r.reclaimed){let i=so(r.reclaimed,e);i&&uo(t.trigger,i)?t.onStatus(`Manual reindex preempting watcher refresh started at ${i.startedAt}; its prior owner was already stale.`):t.onStatus(`Recovered an abandoned or incomplete reindex lock for ${y(e)}.`)}return r.kind==="acquired"?()=>{r.lock.release()}:null}function vl(e){return so(st(e,{parseLegacy:ze}),e)}var ze=e=>{let t=co(e,"");return t?{pid:t.pid,...t.processIdentity?{processIdentity:t.processIdentity}:{}}:null};function so(e,t){if(e.state==="valid"&&e.record?.kind==="reindex"){let n=e.record.detail??{};return{version:2,pid:e.record.pid,...e.record.processIdentity?{processIdentity:e.record.processIdentity}:{},...n.processGroupLeader===!0?{processGroupLeader:!0}:{},projectRoot:typeof n.projectRoot=="string"?n.projectRoot:y(t),startedAt:e.record.startedAt,trigger:n.trigger}}return co(e.parsed,t)}function co(e,t){try{let n=e;return typeof n.pid!="number"||!Number.isInteger(n.pid)||n.pid<=0?null:{version:n.version===2?2:1,pid:n.pid,...n.processIdentity===void 0?{}:(()=>{let r=en(n.processIdentity);return r?.pid===n.pid?{processIdentity:r}:{}})(),...n.processGroupLeader===!0?{processGroupLeader:!0}:{},projectRoot:typeof n.projectRoot=="string"?n.projectRoot:y(t),startedAt:typeof n.startedAt=="string"?n.startedAt:"unknown",trigger:n.trigger}}catch{return null}}function uo(e,t){return e?.kind==="manual-cli"&&Il(t?.trigger)}function Il(e){return e?.kind==="watch-source"||e?.kind==="watch-git-head"||e?.kind==="watch-git-index"||e?.kind==="watch-git-state"}async function El(e){return!K(e.pid)||(Jt(e),Yi(e,"SIGTERM"),await Ki(e,2e3))?!0:(Jt(e),Yi(e,"SIGKILL"),Ki(e,1e3))}function Yi(e,t){if(e.processGroupLeader)try{process.kill(-e.pid,t);return}catch{if(!K(e.pid))return;Jt(e)}try{process.kill(e.pid,t)}catch{}}async function Ki(e,t){let n=R()+t;for(;R()<n;){if(Qi(e))return!0;await kl(50)}return Qi(e)}function Jt(e){if(!e.processIdentity)throw new Error(`Refusing to signal reindex pid ${e.pid}: its ownership record has no process identity.`);let t=Z(e.pid);if(!t)throw new Error(`Refusing to signal reindex pid ${e.pid}: its process identity is unavailable.`);if(!ue(e.processIdentity,t))throw new Error(`Refusing to signal reindex pid ${e.pid}: its process identity does not match the ownership record.`)}function Qi(e){if(!K(e.pid))return!0;if(!e.processIdentity)return!1;let t=Z(e.pid);return t!==null&&!ue(e.processIdentity,t)}function kl(e){return new Promise(t=>setTimeout(t,e))}function lo(e,t,n){return Object.fromEntries(t.map(r=>{let i=r==="typescript"?fn(n.typescriptProjects):[],o=r==="clojure"?Tl(n.clojureConfigPath):void 0,a=[...xt(r).markerFiles,...i,...o?[o]:[]],s=r==="typescript"?{typescriptProjectMode:n.typescriptProjectMode??"single",typescriptProjects:i}:{typescriptProjectMode:"single",typescriptProjects:[]};return[r,{version:2,languages:[r],pnpmWorkspaces:r==="typescript"&&wl(n),...s,clojureConfigPath:o,files:Pe(e,{language:r,markerFiles:a})}]}))}function Tl(e){return e?.trim()||void 0}function wl(e){return e.typescriptProjectMode!=="workspace"&&e.pnpmWorkspaces===!0}function Xt(e,t){return k(y(e),"language-indexes",`${t}.scip`)}function po(e){return k(y(e),"language-indexes","typescript-projects")}function Xe(e,t){return k(po(e),`${Lt(t)}.scip`)}function se(e){try{return it(ee(L(e,"reindex metadata")))}catch{return null}}function go(e,t){try{let n=ee(L(e,"reindex metadata"));if(n.kind!=="legacy"&&n.kind!=="supported")return!1;let r=n.metadata;return n.capabilities.publishableGeneration&&at(r)&&j(r.fingerprint)===j(t)&&j([...r.indexedLanguages??[]].sort())===j(t.languages)}catch{return!1}}function Yt(e,t){pn(e,t,{spacing:2,trailingNewline:!0})}function fo(e,t){try{let n=it(ee(L(e,"reindex metadata")));if(!n)return;Yt(e,{...n,lastRefresh:t})}catch{}}function Ye(e){return{trigger:e.trigger??{kind:"unknown"},result:e.result,startedAt:new Date(e.start).toISOString(),completedAt:new Date().toISOString(),durationMs:R()-e.monotonicStart,indexedLanguages:e.languages?[...e.languages]:void 0,skipped:e.skipped?[...e.skipped]:void 0,error:e.error}}function j(e){return JSON.stringify(e)}function Uf(e,t,n,r){return to({projectRoot:e,languages:r.languages?.length?r.languages:t.languages,outputScip:n.indexPath,outputDb:n.dbPath,pnpmWorkspaces:t.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:t.indexer?.typescript?.projectMode,typescriptProjects:t.indexer?.typescript?.projects,clojureConfigPath:t.indexer?.clojure?.configPath,skipIfUnchanged:r.force!==!0,allowPartial:r.allowPartial===!0,skipAutoInstall:r.skipAutoInstall===!0,installMissing:r.installMissing===!0,trustProjectTools:r.trustProjectTools===!0,indexerConcurrency:r.indexerConcurrency??t.indexerConcurrency,trigger:r.trigger,...r.onStatus?{onStatus:r.onStatus}:{}})}export{sr as a,pd as b,gd as c,xt as d,Wa as e,$d as f,Bd as g,Si as h,Eu as i,to as j,Uf as k};
|
|
343
|
-
//# sourceMappingURL=chunk-
|
|
343
|
+
//# sourceMappingURL=chunk-MC46AL7B.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as U}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as U}from"./chunk-QY7QB7I6.js";import{c as T}from"./chunk-BPKNP3KZ.js";import{a as R}from"./chunk-SGMNWYTH.js";import{d as x}from"./chunk-GVAF222T.js";import{a as v}from"./chunk-ICUL7XRT.js";import{b}from"./chunk-UC2FD2PS.js";import{posix as p}from"path";var G=20,O=1,q=new Map([["app","app"],["apps","app"],["component","component"],["components","component"],["composable","composable"],["composables","composable"],["contract","contract"],["contracts","contract"],["domain","domain"],["domains","domain"],["feature","feature"],["features","feature"],["hook","hook"],["hooks","hook"],["lib","library"],["module","module"],["modules","module"],["package","package"],["packages","package"],["page","page"],["pages","page"],["route","route"],["routes","route"],["screen","screen"],["screens","screen"],["service","service"],["services","service"],["shared","shared"],["src","source-root"],["store","state"],["stores","state"],["test","test"],["tests","test"],["util","utility"],["utils","utility"],["view","view"],["views","view"]]),K=new Set(["components","contracts","hooks","lib","services","shared","stores","utils"]),Y=new Set(["access","api","auth","config","db","effect","errors","hooks","lib","middleware","permissions","routes","schemas","servicetasks","services","startup","store","stores","test-utils","repository","repositories","tests","types","ui","utils","workflow","workflows"]);function Ae(e,n={}){let t=D(n.limit,G),i=D(n.minConsumers,O),r=new T(e),s=r.fileDependencyGraph(n.scope),o=fe(v(e,{includeIgnored:!1})),a=ye(e.config.locality?.architecturalBoundarySegments,n.architecturalBoundarySegments);return(n.target?J(e,r,n.target):Q(e,n.scope,n.scanLimit)).map(l=>V(e,r,s,l,n,o,a)).filter(l=>l.consumerFiles.length>=i||n.target).sort(ge).slice(0,t)}function J(e,n,t){let i=ee(e,t);if(i)return[P(i)];let r=R(e,t);if(!r)return[];let s=n.definitionsForFile(r.relativePath).find(o=>o.symbolId===r.symbolId);return s?[ne(s)]:[{unit:{kind:"symbol",file:r.relativePath,shortName:x(r.symbol),symbol:r.symbol,startLine:r.startLine,endLine:r.endLine}}]}function Q(e,n,t){let i=v(e,{scope:n,includeIgnored:!1}),r=D(t,i.length);return i.slice(0,r).map(s=>P(s))}function V(e,n,t,i,r,s,o){let a=i.definition?X(e,n,i.definition,r.semantic):null,c=a?.files??Z(t,i.unit.file),u=i.definition?a.coverage==="complete"?c.length>0?"exact":"none":a.coverage:c.length>0?"file-level":"none",l=u==="incomplete"||u==="unavailable"||u==="incomplete-and-unavailable",y=i.unit.file,g=d(p.dirname(y)),f=ie(c),j=te(g),z=C([...F(g),...f?F(f):[]]),S=l?"repository-level-review":re(i.unit,g,f,c),h=l?{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:`Compiler-resolved consumer evidence is ${u}; no relocation destination is safe to score.`}:oe(S,i.unit,g,f,c,s,o),A=ue(i.unit,u,f,c,g,h.whyNoSuggestedHome),_=de(i.unit,g,f,c,h.suggestedHome,h.whyNoSuggestedHome);return{actionTier:"signal",sourceUnit:i.unit,candidatePath:y,currentDirectory:g,directoryAncestry:j,consumerFiles:c,consumerCoverage:u,nearestCommonOwner:f,boundaryMarkers:z,recommendedTier:S,suggestedHome:h.suggestedHome,destinationConfidence:h.confidence,whyNoSuggestedHome:h.whyNoSuggestedHome,counterevidence:l?[...A,"Known consumer files are retained, but missing compiler evidence can hide additional owners."]:A,reasons:_,recommendation:l?"Retain the current location until compiler-resolved consumer evidence is complete.":me(S,h.suggestedHome,u)}}function X(e,n,t,i){let r=U(e,n).forDefinitions([t],{semantic:i!==!1,sourceFallback:!0}).get(t.symbolId),s=r?.semanticIncomplete?r.semanticUnavailable?"incomplete-and-unavailable":"incomplete":r?.semanticUnavailable?"unavailable":"complete";return{files:W(r?.files.map(o=>o.file)??[]),coverage:s}}function Z(e,n){let t=[];for(let[i,r]of e.entries())i!==n&&r.has(n)&&t.push(i);return W(t)}function ee(e,n){let t=b(n),i=v(e,{includeIgnored:!1}),r=i.find(o=>o===t);if(r)return r;let s=i.find(o=>o.endsWith(`/${t}`));return s||(i.find(o=>o.includes(t))??null)}function ne(e){return{definition:e,unit:{kind:"symbol",file:e.relativePath,shortName:x(e.symbol),symbol:e.symbol,startLine:e.startLine,endLine:e.endLine}}}function P(e){return{unit:{kind:"file",file:e,shortName:p.basename(e)}}}function te(e){if(e===".")return[{path:".",depth:0,markers:[]}];let n=[],t=e.split("/").filter(Boolean);for(let i=0;i<t.length;i+=1){let r=t.slice(0,i+1).join("/");n.push({path:r,depth:i,markers:k(r)})}return n}function F(e){return e==="."?[]:H(e).map(({marker:n,prefix:t})=>`${n}: ${t}`)}function k(e){return C(H(e).map(({marker:n})=>n))}function H(e){let n=e.split("/").filter(Boolean),t=[];for(let i=0;i<n.length;i+=1){let r=q.get(n[i]);r&&t.push({marker:r,prefix:n.slice(0,i+1).join("/")})}return t}function ie(e){if(e.length===0)return null;let n=e.map(i=>d(p.dirname(i))),t=n[0].split("/").filter(Boolean);for(let i of n.slice(1)){let r=i.split("/").filter(Boolean),s=[],o=Math.min(t.length,r.length);for(let a=0;a<o&&t[a]===r[a];a+=1)s.push(t[a]);t=s}return t.length===0?".":t.join("/")}function re(e,n,t,i){return t?e.kind==="symbol"&&i.length===1?i[0]===e.file?"same-file":"sibling-folder":t==="."||t==="src"?"repository-level-review":I(t,"package")?"package-level-shared":I(t,"app")?"app-level-shared":$(t,["feature","domain","module"])||$(n,["feature","domain","module"])?"feature-local-shared":"sibling-folder":"no-exact-consumers"}function oe(e,n,t,i,r,s,o){let a=se(e,i);if(a)return m(a);let c=he(n.file),u=ae(e,t,c,r,o);if(u)return u;let l=i;if(d(t)===d(l))return m(`${t} is already the nearest common owner for its consumers.`);let y=ce(l,t,c,o);return y||le(l,t,c,s,o)}function se(e,n){return n?e==="no-exact-consumers"||e==="repository-level-review"?"The inferred owner is too broad or unsupported for an exact destination.":null:"No consumer owner could be inferred from the current index."}function ae(e,n,t,i,r){if(e==="same-file"){let s=i[0]??null;return s?L(s):m("No same-file consumer path was available.")}if(e==="sibling-folder"&&i.length===1){let s=d(p.dirname(i[0])),o=B(n,t,s,r);return o?m(o):L(s)}return null}function ce(e,n,t,i){return ve(e)?M(e,n,t,i,`Nearest shared owner ${e} is outside source root ${t}.`):null}function le(e,n,t,i,r){if(e===".")return m("The nearest common owner is the repository root.");let s=`${e}/shared`,o=M(s,n,t,r,`Proposed home ${s} is outside source root ${t}.`);return o.confidence==="withheld"||i.has(s)?o:m(`${s} does not exist in the indexed project.`)}function M(e,n,t,i,r){if(!E(e,t))return m(r);let s=B(n,t,e,i);return s?m(s):L(e)}function L(e){return{suggestedHome:e,confidence:"exact",whyNoSuggestedHome:null}}function m(e){return{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:e}}function ue(e,n,t,i,r,s){let o=["Report-only signal; review ownership before moving files."];return n==="none"&&o.push("No consumers were found in the current index."),n==="file-level"&&o.push("File-level import evidence can hide which exported unit is actually used."),(t==="."||t==="src")&&o.push("Nearest common owner is broad, so this is not enough evidence for automatic placement."),i.length===1&&o.push("Only one consumer was found; inlining or same-folder placement may be better than shared extraction."),e.kind==="file"&&o.push("File targets describe module locality, not symbol-level usage."),t&&r.startsWith(`${t}/`)&&o.push("Candidate already lives under the nearest common owner."),s&&o.push(`No exact suggested home: ${s}`),o}function de(e,n,t,i,r,s){let o=[];return o.push(`${e.shortName} currently lives in ${n}.`),t?o.push(`${i.length} consumer file(s) share ${t} as their nearest common owner.`):o.push("No consumer owner could be inferred from the current index."),r?o.push(`Suggested home is ${r}.`):s&&o.push(`No exact suggested home: ${s}`),o}function me(e,n,t){return e==="no-exact-consumers"?"Review references before moving; no consumers were found.":e==="repository-level-review"?"Keep this as a broad locality signal; the inferred owner is too general for automatic relocation.":n?`Review whether ${t==="exact"?"symbol usage":"module import"} supports moving or extracting toward ${n}.`:"Review ownership manually before changing structure."}function ge(e,n){return N(n)-N(e)||e.candidatePath.localeCompare(n.candidatePath)}function N(e){let n=e.consumerFiles.length*10;return e.consumerCoverage==="exact"&&(n+=5),e.suggestedHome&&(n+=3),e.recommendedTier==="repository-level-review"&&(n*=.1),e.recommendedTier==="no-exact-consumers"&&(n*=.05),n}function fe(e){let n=new Set(["."]);for(let t of e){let i=d(p.dirname(t));for(;!n.has(i)&&(n.add(i),i!==".");)i=d(p.dirname(i))}return n}function he(e){let n=w(e),t=n.indexOf("src");return t>=0?n.slice(0,t+1).join("/"):n.length<=1?".":n[0]}function E(e,n){let t=d(e),i=d(n);return i==="."||t===i||t.startsWith(`${i}/`)}function pe(e,n,t){let i=w(e),r=w(n);return(E(e,n)?i.slice(r.length):i).some(o=>t.has(o.toLowerCase()))}function B(e,n,t,i){return d(e)===d(t)||!pe(e,n,i)?null:`${e} is a named architectural boundary; an exact move to ${t} needs human design.`}function ye(...e){let n=new Set(Y);for(let t of e)for(let i of t??[]){let r=be(i);r&&n.add(r)}return n}function be(e){let n=e.trim().toLowerCase();return n===""?null:n}function I(e,n){return k(e).includes(n)}function $(e,n){let t=k(e);return n.some(i=>t.includes(i))}function ve(e){let n=e.split("/").filter(Boolean),t=n[n.length-1];return t?K.has(t):!1}function d(e){let n=b(e);return n===""?".":n}function w(e){let n=b(e);return n==="."?[]:n.split("/").filter(Boolean)}function D(e,n){return!Number.isFinite(e)||e===void 0||e<1?n:Math.floor(e)}function W(e){return C([...e]).sort((n,t)=>n.localeCompare(t))}function C(e){return[...new Set(e)]}export{Ae as a};
|
|
2
|
+
//# sourceMappingURL=chunk-MDFT325O.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{m as o}from"./chunk-
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{m as o}from"./chunk-6FXXYYQM.js";import{l as n}from"./chunk-5T44HG5Y.js";async function i(t){if(typeof t!="string"||t.length===0)throw new Error("Output continuation requires a cursor.");await o(t,n)}var u={id:"continue",command:"continue <cursor>",hidden:!0,description:"Continue an immutable output snapshot",renderShape:"custom",handler:i};export{u as a};
|
|
3
|
+
//# sourceMappingURL=chunk-N2XDMNVI.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{H as x,J as h,M as P,N as g,O as _,P as y,Q as f,R as p}from"./chunk-UC2FD2PS.js";var re=new Set(["aix","android","darwin","freebsd","haiku","linux","openbsd","sunos","win32","cygwin","netbsd"]);function S(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let r=e;return r.version!==1||typeof r.pid!="number"||!Number.isSafeInteger(r.pid)||r.pid<=0||typeof r.platform!="string"||!re.has(r.platform)||typeof r.startToken!="string"||r.startToken.trim()===""?null:{version:1,pid:r.pid,platform:r.platform,startToken:r.startToken}}function m(e,r){return e.version===r.version&&e.pid===r.pid&&e.platform===r.platform&&e.startToken===r.startToken}import{execFileSync as te}from"child_process";import{platform as ne}from"os";var N=new WeakMap,oe=1e3,A=16*1024;function k(e,r=ce){if(!Number.isSafeInteger(e)||e<=0)return null;if(e===process.pid){let t=N.get(r);if(t)return t}try{let t=ie(e,r);if(!t)return null;let n={version:1,pid:e,platform:r.platform,startToken:t};return e===process.pid&&N.set(r,n),n}catch{return null}}function ie(e,r){if(r.platform==="linux"||r.platform==="android")return se(r.readFile(`/proc/${e}/stat`));if(r.platform==="win32"){let t=`([DateTimeOffset](Get-Process -Id ${e} -ErrorAction Stop).StartTime).ToUnixTimeMilliseconds()`;return M(r.run("powershell.exe",["-NoProfile","-NonInteractive","-Command",t]))}return r.platform==="darwin"||r.platform==="freebsd"||r.platform==="openbsd"||r.platform==="netbsd"?M(r.run("ps",["-p",String(e),"-o","lstart="])):null}function se(e){let r=e.lastIndexOf(")");if(r<0)return null;let n=e.slice(r+1).trim().split(/\s+/)[19];return n&&/^\d+$/.test(n)?n:null}function M(e){let r=e.trim();return r===""?null:r}var ce={platform:ne(),readFile(e){return h(e,{maxBytes:A,inputKind:"process identity pseudo-file"})},run(e,r){return te(e,[...r],{encoding:"utf8",timeout:oe,maxBuffer:A,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"],windowsHide:!0})}};function C(e){try{return process.kill(e,0),!0}catch(r){return typeof r=="object"&&r!==null&&"code"in r&&r.code==="EPERM"}}function Ze(){return performance.now()}import{randomUUID as le}from"crypto";import{closeSync as ae,fsyncSync as de,linkSync as ue,mkdirSync as me,openSync as fe,statSync as ye,unlinkSync as pe,writeSync as be}from"fs";import{dirname as L}from"path";var R="codebaseiq-process-lock",T=1,w=Object.freeze({wallNow:()=>Date.now(),isProcessAlive:C,readProcessIdentity:k,randomToken:()=>le(),makeDirectory:e=>me(e,{recursive:!0}),openFile:(e,r,t)=>fe(e,r,t),writeFile:(e,r,t,n)=>be(e,r,t,n),syncFile:e=>de(e),closeFile:e=>ae(e),linkFile:(e,r)=>ue(e,r),readFile:e=>x(e,"process lock record"),statFile:e=>{let r=ye(e);return{dev:r.dev,ino:r.ino,size:r.size,mtimeMs:r.mtimeMs}},removeFile:e=>pe(e)});function lr(e,r){let t=r.runtime??w;t.makeDirectory(L(e));let n;for(let o=0;o<2;o+=1)try{return{kind:"acquired",lock:B(e,r,t),...n?{reclaimed:n}:{}}}catch(i){if(i.code!=="EEXIST")throw i;let s=b(e,{parseLegacy:r.parseLegacy,runtime:t});if(o===0&&Fe(e,s,{creationGraceMs:r.creationGraceMs,parseLegacy:r.parseLegacy,runtime:t})){n=s;continue}return{kind:"contended",observation:s}}return{kind:"contended",observation:b(e,{parseLegacy:r.parseLegacy,runtime:t})}}function b(e,r={}){let t=r.runtime??w,n,o;try{n=t.statFile(e),o=t.readFile(e)}catch(a){return a.code==="ENOENT"?{state:"missing"}:{state:"malformed"}}let i;try{i=JSON.parse(o)}catch{return{state:"malformed",raw:o,identity:n}}let s=Pe(i);if(s)return{state:"valid",raw:o,identity:n,record:s,owner:we(s),parsed:i};let c=r.parseLegacy?.(i)??null;return c?{state:"legacy",raw:o,identity:n,owner:c,parsed:i}:{state:"malformed",raw:o,identity:n,parsed:i}}function Pe(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let r=e;if(r.protocol!==R||r.version!==T||typeof r.kind!="string"||r.kind.trim()===""||typeof r.pid!="number"||!Number.isSafeInteger(r.pid)||r.pid<=0||typeof r.token!="string"||r.token.trim()===""||typeof r.startedAt!="string"||!Number.isFinite(Date.parse(r.startedAt))||r.detail!==void 0&&(typeof r.detail!="object"||r.detail===null||Array.isArray(r.detail)))return null;let t=r.processIdentity===void 0?null:S(r.processIdentity);return r.processIdentity!==void 0&&(!t||t.pid!==r.pid)?null:{protocol:R,version:T,kind:r.kind,pid:r.pid,token:r.token,...t?{processIdentity:t}:{},startedAt:r.startedAt,...r.detail?{detail:r.detail}:{}}}function Fe(e,r,t={}){let n=t.runtime??w;if(!E(r,n))return!1;let o=ke(`${e}.reclaim`,n);if(!o)return!1;try{let i=b(e,{parseLegacy:t.parseLegacy,runtime:n});return!W(r,i)||!E(i,n)?!1:O(e,n)}finally{o.release()}}function B(e,r,t){let n=r.pid??process.pid,o=t.randomToken(),i=r.processIdentity===void 0?t.readProcessIdentity(n):r.processIdentity,s={protocol:R,version:T,kind:r.kind,pid:n,token:o,...i?{processIdentity:i}:{},startedAt:new Date(t.wallNow()).toISOString(),...r.detail?{detail:r.detail}:{}},c=`${e}.${o}.candidate`,a=t.openFile(c,"wx",384),l;try{P(a,Buffer.from(`${JSON.stringify(s)}
|
|
2
|
+
`),t,"process lock"),t.syncFile(a)}catch(u){l=u}try{t.closeFile(a)}catch(u){l??=u}if(l!==void 0)throw I(c,t),l;try{t.linkFile(c,e)}catch(u){throw I(c,t),u}I(c,t);try{J(L(e),t)}catch(u){throw U(e,s,t),u}let d=!1;return{path:e,record:s,release:()=>d?!1:(d=!0,U(e,s,t))}}function U(e,r,t=w){let n=b(e,{runtime:t});return n.state!=="valid"||!n.record||n.record.pid!==r.pid||n.record.token!==r.token||r.processIdentity&&(!n.record.processIdentity||!m(r.processIdentity,n.record.processIdentity))?!1:O(e,t)}function ke(e,r){for(let t=0;t<2;t+=1)try{return B(e,{kind:"reclaim-guard",runtime:r},r)}catch(n){if(n.code!=="EEXIST")return null;let o=b(e,{runtime:r});if(t>0||!E(o,r))return null;let i=b(e,{runtime:r});if(!W(o,i)||!O(e,r))return null}return null}function E(e,r){if(e.state==="missing")return!1;if(e.owner){if(!r.isProcessAlive(e.owner.pid))return!0;if(!e.owner.processIdentity)return!1;let t=r.readProcessIdentity(e.owner.pid);return t!==null&&!m(e.owner.processIdentity,t)}return!1}function W(e,r){return e.state===r.state&&e.raw===r.raw&&e.identity!==void 0&&r.identity!==void 0&&e.identity.dev===r.identity.dev&&e.identity.ino===r.identity.ino&&e.identity.size===r.identity.size&&e.identity.mtimeMs===r.identity.mtimeMs}function we(e){return{pid:e.pid,...e.processIdentity?{processIdentity:e.processIdentity}:{}}}function J(e,r){let t;try{t=r.openFile(e,"r")}catch(n){if(g(n,process.platform))return;throw n}try{r.syncFile(t)}catch(n){if(!g(n,process.platform))throw n}finally{r.closeFile(t)}}function O(e,r){try{return r.removeFile(e),J(L(e),r),!0}catch{return!1}}function I(e,r){try{r.removeFile(e)}catch{}}var ge=Object.freeze(["EPERM","EACCES","EBUSY"]),Se=Object.freeze([10,20,40,80,160,320,640,1e3,1e3,1e3]);function Ie(e){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)}var D=Object.freeze({platform:process.platform,sleep:Ie});function Re(e,r){if(r!=="win32")return!1;let t=e?.code;return typeof t=="string"&&ge.includes(t)}function q(e,r={}){let t=r.runtime??D,n=r.delaysMs??Se;for(let o of n)try{return e()}catch(i){if(!Re(i,t.platform))throw i;t.sleep(o)}return e()}import{chmodSync as Te,constants as Ee,copyFileSync as Le}from"fs";import{dirname as Oe}from"path";var $=Object.freeze({..._,copyFile:(e,r)=>Le(e,r,Ee.COPYFILE_FICLONE),chmodFile:(e,r)=>Te(e,r)});function De(e,r,t={}){let n=t.runtime??$,o=Oe(r),i=y(o,n);if(n.copyFile(e,r),n.platform==="win32")ve(r,t.mode,n);else{t.mode!==void 0&&n.chmodFile(r,t.mode);let s=n.openFile(r,"r");try{n.syncFile(s)}finally{n.closeFile(s)}}return p(i,f(o,n))}function ve(e,r,t){let n=!1,o;try{o=t.openFile(e,"r+")}catch(i){let s=i.code;if(s!=="EACCES"&&s!=="EPERM")throw i;t.chmodFile(e,384),n=!0,o=t.openFile(e,"r+")}try{t.syncFile(o)}finally{t.closeFile(o)}r!==void 0?t.chmodFile(e,r):n&&t.chmodFile(e,292)}import{randomUUID as xe}from"crypto";import{closeSync as he,existsSync as _e,fsyncSync as Ne,linkSync as Ae,mkdirSync as Me,openSync as Ce,renameSync as Ue,unlinkSync as Be,writeSync as We}from"fs";import{dirname as G}from"path";var j=Object.freeze({platform:process.platform,randomToken:()=>xe(),pathExists:e=>_e(e),makeDirectory:e=>Me(e,{recursive:!0}),openFile:(e,r,t)=>Ce(e,r,t),writeFile:(e,r,t,n)=>We(e,r,t,n),syncFile:e=>Ne(e),closeFile:e=>he(e),renameFile:(e,r)=>Ue(e,r),linkFile:(e,r)=>Ae(e,r),removeFile:e=>Be(e)});function gr(e,r,t={}){let n=t.durability??"visibility",o=t.runtime??j,i=G(e),s=n==="durable"?y(i,o):(o.makeDirectory(i),"not-requested"),c=`${e}.tmp-${o.randomToken()}`,a=typeof r=="string"?Buffer.from(r):r,l,d=!1;try{l=o.openFile(c,"wx",t.mode??384),d=!0,P(l,a,o,"atomic file"),n==="durable"&&o.syncFile(l),o.closeFile(l),l=void 0,q(()=>o.renameFile(c,e),{runtime:{platform:o.platform,sleep:o.sleep??D.sleep}}),d=!1;let u=n==="durable"?p(s,f(i,o)):"not-requested";return Y(n,u)}finally{if(l!==void 0)try{o.closeFile(l)}catch{}if(d)try{o.removeFile(c)}catch{}}}function Sr(e,r,t={}){let n=t.durability??"visibility",o=t.runtime??j;if(!o.linkFile)throw new Error("Exclusive atomic file publication requires hard-link support.");let i=G(e),s=n==="durable"?y(i,o):(o.makeDirectory(i),"not-requested"),c=`${e}.tmp-${o.randomToken()}`,a=typeof r=="string"?Buffer.from(r):r,l,d=!1;try{l=o.openFile(c,"wx",t.mode??384),d=!0,P(l,a,o,"exclusive atomic file"),n==="durable"&&o.syncFile(l),o.closeFile(l),l=void 0,o.linkFile(c,e);let u=n==="durable"?f(i,o):"not-requested";o.removeFile(c),d=!1;let ee=n==="durable"?p(s,u,f(i,o)):"not-requested";return Y(n,ee)}finally{if(l!==void 0)try{o.closeFile(l)}catch{}if(d)try{o.removeFile(c)}catch{}}}function Y(e,r){return{requestedDurability:e,achievedDurability:e==="visibility"?"visibility":r==="synced"?"directory-durable":"file-flushed",directorySync:r}}import{execFileSync as H}from"child_process";import{platform as Je}from"os";var qe=1e3,X=2*1024*1024,$e=1e4,Ge=25;function Dr(e,r,t=Z){let n=t.readIdentity(e),o=new Map;return n&&o.set(e,n),{rootPid:e,rootIdentity:n,ownsProcessGroup:r,knownMembers:o}}async function vr(e,r,t=Z){if(!e.rootIdentity){let a=await F(e,r.gracefulMs+r.forceMs,t);return{reaped:a,reason:a?"terminated":"identity-unavailable",detail:a?void 0:`Could not establish the birth identity of process ${e.rootPid}.`}}let n=V(e,t);if(n==="mismatch")return{reaped:!1,reason:"identity-mismatch",detail:`Process ${e.rootPid} no longer has the identity owned by this runner.`};if(n==="exited"&&!Q(e,t))return{reaped:!0,reason:"terminated"};if(t.platform==="win32"){try{t.terminateWindowsTree(e.rootPid)}catch(l){let d=await F(e,r.forceMs,t);return{reaped:d,reason:d?"terminated":"signal-failed",detail:d?void 0:v(l)}}let a=await F(e,r.forceMs,t);return{reaped:a,reason:a?"terminated":"deadline"}}let o=z(e,"SIGTERM",t);if(await F(e,r.gracefulMs,t))return{reaped:!0,reason:"terminated"};let s=z(e,"SIGKILL",t);return await F(e,r.forceMs,t)?{reaped:!0,reason:"terminated"}:s?{reaped:!1,reason:s.reason,detail:s.detail}:o?{reaped:!1,reason:o.reason,detail:o.detail}:{reaped:!1,reason:"deadline",detail:`Process tree ${e.rootPid} did not exit before its termination deadline.`}}function V(e,r){let t=r.readIdentity(e.rootPid);if(!t)return"exited";if(!e.rootIdentity||!m(e.rootIdentity,t))return"mismatch";e.knownMembers.set(e.rootPid,t);for(let n of r.listDescendantPids(e.rootPid)){let o=r.readIdentity(n);o&&e.knownMembers.set(n,o)}return"owned"}function z(e,r,t){let n=V(e,t);if(n==="mismatch")return{reason:"identity-mismatch",detail:`Process ${e.rootPid} changed identity before ${r}.`};if(n==="owned"&&e.ownsProcessGroup)try{return t.signal(-e.rootPid,r),null}catch(i){if(!K(i))return{reason:"signal-failed",detail:v(i)}}let o=null;for(let i of e.knownMembers.values()){let s=t.readIdentity(i.pid);if(!(!s||!m(i,s)))try{t.signal(i.pid,r)}catch(c){!K(c)&&o===null&&(o=v(c))}}return o===null?null:{reason:"signal-failed",detail:o}}async function F(e,r,t){let n=t.now()+r;for(;Q(e,t);){if(t.now()>=n)return!1;await t.sleep(Math.min(Ge,Math.max(1,n-t.now())))}return!0}function Q(e,r){if(!e.rootIdentity&&r.isProcessAlive(e.rootPid))return!0;for(let t of e.knownMembers.values()){let n=r.readIdentity(t.pid);if(n&&m(t,n))return!0}return!!(e.ownsProcessGroup&&r.isProcessGroupAlive(e.rootPid))}function je(e){let r=H("ps",["-axo","pid=,ppid="],{encoding:"utf8",timeout:qe,maxBuffer:X,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"],windowsHide:!0}),t=new Map;for(let s of r.split(/\r?\n/)){let c=/^\s*(\d+)\s+(\d+)\s*$/.exec(s);if(!c)continue;let a=Number(c[1]),l=Number(c[2]),d=t.get(l)??[];d.push(a),t.set(l,d)}let n=[],o=[...t.get(e)??[]],i=new Set;for(;o.length>0;){let s=o.pop();i.has(s)||(i.add(s),n.push(s),o.push(...t.get(s)??[]))}return n}function K(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ESRCH"}function v(e){return e instanceof Error?e.message:String(e)}var Z={platform:Je(),now:Date.now,readIdentity:k,isProcessAlive(e){try{return process.kill(e,0),!0}catch(r){return typeof r=="object"&&r!==null&&"code"in r&&r.code==="EPERM"}},isProcessGroupAlive(e){if(this.platform==="win32")return!1;try{return process.kill(-e,0),!0}catch(r){return typeof r=="object"&&r!==null&&"code"in r&&r.code==="EPERM"}},listDescendantPids(e){if(this.platform==="win32")return[];try{return je(e)}catch{return[]}},signal(e,r){process.kill(e,r)},terminateWindowsTree(e){H("taskkill.exe",["/PID",String(e),"/T","/F"],{timeout:$e,maxBuffer:X,stdio:"ignore",windowsHide:!0})},async sleep(e){await new Promise(r=>setTimeout(r,e))}};export{S as a,m as b,k as c,C as d,Ze as e,lr as f,b as g,Fe as h,q as i,De as j,gr as k,Sr as l,Dr as m,vr as n};
|
|
3
|
+
//# sourceMappingURL=chunk-NNG6M6XD.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ne,c as re}from"./chunk-YTJHCGYB.js";import{a as jn}from"./chunk-ILMHV3KM.js";import{a as Qt,b as Kt,d as qe,e as nn}from"./chunk-O2M3VNDY.js";import{I as zt,J as Xt,K as Yt,M as Vt,Q as wn,R as Xe,T as Dn,U as Fn,V as kn,a as me,b as Ht,d as Jt}from"./chunk-
|
|
1
|
+
import{a as ne,c as re}from"./chunk-YTJHCGYB.js";import{a as jn}from"./chunk-ILMHV3KM.js";import{a as Qt,b as Kt,d as qe,e as nn}from"./chunk-O2M3VNDY.js";import{I as zt,J as Xt,K as Yt,M as Vt,Q as wn,R as Xe,T as Dn,U as Fn,V as kn,a as me,b as Ht,d as Jt}from"./chunk-K4S2VH42.js";import{b as Ot,c as Lt,e as X,f as ge,g as te,h as Ct,i as $t,j as Ut,k as Gt,l as Bt,r as he,s as rn}from"./chunk-EQNMD62X.js";import{a as ze,c as Se,d as _n,f as Tn}from"./chunk-4LK5OIPW.js";import{s as Be}from"./chunk-C6WKPKCF.js";import{A as ln,B as un,C as pn,D as gn,E as fn,F as mn,G as He,I as $,J as ye,K as hn,M as Je,N as yn,O as bn,P as be,S as Sn,T as Rn,U as xn,c as K,d as le,e as Ae,g as Me,h as Ce,i as Dt,j as D,l as jt,o as F,p as M,q as C,r as We,s as Zt,t as en,u as tn,v as an,w as on,x as sn,y as cn,z as dn}from"./chunk-T75DS2E6.js";import{e as fe}from"./chunk-YT4DVWUV.js";import{a as j,b as _t}from"./chunk-RCIGX23V.js";import{i as q,j as J,l as Ft,m as Ge,n as kt,r as Wt,s as qt,u as Pn,x as En,y as In,z as vn}from"./chunk-D7DOB27N.js";import{i as ue,j as Z}from"./chunk-R2NOK63J.js";import{a as S,c as Tt,d as ee,e as H}from"./chunk-6O3KXIDL.js";import{$ as Nt,E as $e,O as Ue,T as pe,Y as wt,Z as z,a as Pt,c as Q,f as A,g as se,ga as At,h as ce,ha as Mt,i as Et,n as It,o as vt,p as de,r as I}from"./chunk-UQYQBLJX.js";import{createHash as fo}from"crypto";import{existsSync as T,mkdirSync as je,readdirSync as Cr,renameSync as $r,rmSync as Y,statSync as mo}from"fs";import{basename as ke,dirname as h,extname as ho,join as v,resolve as Fr}from"path";import{execFileSync as Kr}from"child_process";import{constants as Zr,copyFileSync as On,statSync as ei}from"fs";import{platform as ti}from"os";var ni=Object.freeze({size:e=>ei(e).size,clone:ii,copy:(e,t)=>On(e,t)}),ri=new Set(["ENOSYS","ENOTSUP","EOPNOTSUPP","EINVAL","EXDEV","ENOTTY"]);function U(e,t,n=ni){let r=n.size(e);try{return n.clone(e,t),{method:"reflink",bytes:r}}catch(i){if(!oi(i))throw i}return n.copy(e,t),{method:"copy",bytes:r}}function ii(e,t){if(ti()!=="darwin"){On(e,t,Zr.COPYFILE_FICLONE_FORCE);return}try{Kr("/bin/cp",["-c",e,t],{timeout:6e4,maxBuffer:64*1024,stdio:["ignore","ignore","pipe"],windowsHide:!0})}catch(n){throw ai(n)}}function ai(e){let t=e?.stderr,n=Buffer.isBuffer(t)?t.toString("utf8"):t??"";return/operation not supported|not supported/i.test(n)?Object.assign(e instanceof Error?e:new Error(String(e)),{code:"ENOTSUP"}):/cross-device link/i.test(n)?Object.assign(e instanceof Error?e:new Error(String(e)),{code:"EXDEV"}):e}function oi(e){let t=e?.code;return t!==void 0&&ri.has(t)}function Ln(){return{reflinkedBytes:0,fallbackCopiedBytes:0}}function G(e,t){t.method==="reflink"?e.reflinkedBytes+=t.bytes:e.fallbackCopiedBytes+=t.bytes}import{dirname as si,join as ci}from"path";function Nn(e={}){return{id:"runtime-boundaries",facts:["runtime-boundary-observation","runtime-boundary-link"],run:({projectRoot:t,dbPath:n,onStatus:r})=>{let i=new F({projectRoot:t,dbPath:n,indexPath:e.indexPath??ci(si(n),"index.scip")}),a,o=!1,s=!1;try{let l=e.reuseExisting||e.affectedFiles?Vt(i):null;e.reuseExisting&&l?.extractorVersion===zt?(a=l,o=!0):(a=Xt(i,{...l?{previousGraph:l}:{},...e.affectedFiles?{affectedFiles:e.affectedFiles}:{}}),s=(a.coverage.filesReused??0)>0)}finally{i.close()}o||Yt(n,a);let c={reused:o,incrementallyUpdated:s,observations:a.observations.length,links:a.links.length,frontiers:a.frontiers.length,filesScanned:a.coverage.filesScanned,errors:a.coverage.extractionErrors.length,phases:a.coverage.phases};return r?.(c.reused?`Reused ${c.observations} cached runtime-boundary observation(s) and ${c.links} link(s).`:c.incrementallyUpdated?`Incrementally refreshed runtime-boundary observations (${c.filesScanned-(a.coverage.filesReused??0)} file(s) extracted, ${a.coverage.filesReused??0} reused) and rebuilt ${c.links} link(s).`:`Extracted ${c.observations} runtime-boundary observation(s), ${c.links} link(s), and ${c.frontiers} unresolved frontier(s).`),!o&&a.coverage.phases&&r?.(`Runtime-boundary phases: ${a.coverage.phases.map(l=>`${l.id} ${l.durationMs.toFixed(0)}ms`).join(", ")}.`),c}}}import{createHash as li}from"crypto";import{existsSync as ui}from"fs";import{dirname as pi,join as Mn}from"path";function Ye(e){let t=new Set;for(let n of e.uncertainty)t.add(n);e.projectIdentityChanged&&t.add("project-identity-changed");for(let n of e.changes)n.kind==="added"&&t.add("file-added"),n.kind==="deleted"&&t.add("file-deleted"),n.inputKind==="config"&&t.add("configuration-changed"),n.inputKind==="ambient"&&t.add("ambient-declaration-changed"),n.inputKind==="other"&&t.add("unclassified-input");return{fullProject:t.size>0,reasons:[...t].sort()}}function Re(e,t,n){let r=e.changes.map(s=>s.path).sort();if(r.length===0&&!e.projectIdentityChanged&&e.uncertainty.length===0)return{mode:"none",changedFiles:r,affectedFiles:[],reasons:[]};let i=new Set(n),a=Ye(e),o=new Set(a.reasons);return r.some(s=>!i.has(s))&&o.add("changed-file-outside-project"),t===null?(o.add("dependency-graph-unavailable"),An(r,i,o)):o.size>0?An(r,i,o):{mode:"closure",changedFiles:r,affectedFiles:di(r,t,i),reasons:[]}}function An(e,t,n){return{mode:"full-project",changedFiles:e,affectedFiles:[...t].sort(),reasons:[...n].sort()}}function di(e,t,n){let r=new Map;for(let[o,s]of t)if(n.has(o))for(let c of s){if(!n.has(c))continue;let l=r.get(c)??new Set;l.add(o),r.set(c,l)}let i=new Set(e),a=[...e];for(let o=0;o<a.length;o+=1){let s=a[o];if(s!==void 0)for(let c of r.get(s)??[])i.has(c)||(i.add(c),a.push(c))}return[...i].sort()}var gi="<global-symbols>";function fi(e){let t=[];for(let n of e.all(`
|
|
2
2
|
SELECT relative_path, language, position_encoding, text
|
|
3
3
|
FROM documents
|
|
4
4
|
`))t.push({relativePath:n.relative_path,kind:"document",values:[n.language,n.position_encoding,n.text]});for(let n of e.all(`
|
|
@@ -275,4 +275,4 @@ ${p}`:""}`)}io(e.config,t,e.scipPath)}catch(l){if(r?.aborted)throw Dt(r,"Reindex
|
|
|
275
275
|
`+a)}if(t.length!==0&&(i(`Indexed ${e.length} language output(s); skipped or incomplete: ${t.map(a=>a.language).join(", ")}.`),!r))throw new Error(`Failed to index all required languages; preserving the previous index. Pass --allow-partial to intentionally write an incomplete index.
|
|
276
276
|
`+t.map(a=>` - ${a.language}: ${a.reason}`).join(`
|
|
277
277
|
`))}function Or(e,t,n){if(e.length>1){n(`Merging ${e.length} language indexes...`);let r=performance.now(),i=tn(e.map(a=>a.scipPath),t);return qr(i,n),n(`Merged and sanitized SCIP indexes in ${(performance.now()-r).toFixed(0)}ms.`),!0}else e[0].scipPath!==t&&$r(e[0].scipPath,t);return!1}async function Bo(e){let t;if(Wo(e)){let i=v(e.run.tempPaths.runDir,"typescript-affected.db");try{e.run.onStatus(`Converting ${e.incrementalTypeScript.affectedFiles.length} affected TypeScript document(s) to SQLite...`);let a=performance.now();Lr(e.incrementalTypeScript.affectedScipPath,i,e.run.onStatus,!1,e.run.opts.signal),e.run.onStatus(`Converted affected SCIP documents in ${(performance.now()-a).toFixed(0)}ms.`);let o=nr({previousDbPath:e.run.paths.outputDb,miniDbPath:i,candidateDbPath:e.run.tempPaths.tempOutputDb,affectedFiles:e.incrementalTypeScript.affectedFiles,writeTelemetry:e.run.writeTelemetry});return e.run.onStatus(`Patched ${o.affectedDocumentCount} SQLite document(s) in ${(o.durationMs/1e3).toFixed(3)}s.`),{mode:"incremental",changedDocumentPaths:o.changedDocumentPaths,patchDurationMs:o.durationMs,converterDurationMs:performance.now()-a,scipCompanion:e.incrementalTypeScript.completeScipUpdated?"current":"deferred"}}catch(a){D(e.run.opts.signal,"Reindex cancelled by its owner."),t=a instanceof Error?a.message:String(a),q(()=>Y(i,{force:!0})),q(()=>Y(e.run.tempPaths.tempOutputDb,{force:!0})),e.run.onStatus(`Incremental SQLite publication unavailable: ${t}. Falling back to complete conversion.`)}}let n=e.completeScipSanitized;e.completeScipAvailable||(n=await e.materializeFullFallback());let r=performance.now();return Lr(e.run.tempPaths.tempOutputScip,e.run.tempPaths.tempOutputDb,e.run.onStatus,n,e.run.opts.signal),{mode:"full",converterDurationMs:performance.now()-r,...t?{fallbackReason:t}:{}}}function Wo(e){if(!e.incrementalTypeScript||e.skippedLanguages.length>0||!T(e.run.paths.outputDb)||!T(e.run.paths.outputScip))return!1;let t=new Set(e.reusedLanguages);return e.indexedOutputs.length===e.run.languages.length&&e.run.languages.every(n=>n==="typescript"||t.has(n))}function qo(e,t){let n=S(),r=[...t].sort(),i=new Set(r),a={addedFiles:[],modifiedFiles:r,deletedFiles:[],changedFiles:r,unchangedFiles:e.affectedFiles.filter(o=>!i.has(o)).sort()};return{version:1,status:"evaluated",refreshResult:"rebuilt",recordedAt:new Date().toISOString(),durationMs:S()-n,manifest:e.manifest,plan:e.plan,comparison:a,evaluation:Qe(e.plan,a,e.projectFileCount)}}function Lr(e,t,n,r,i){if(D(i,"Reindex cancelled by its owner."),n("Writing the SQLite index..."),!T(e))throw new Error(`SCIP index not found at ${e} after indexing`);try{qr(br(e,t,{sanitize:!r}),n)}catch(a){let o=a instanceof Error?a.message:String(a);throw new Error(`Failed to write the SQLite index: ${o}`,{cause:a})}}function qr(e,t){e.removedDefinitionOccurrences!==0&&t(`Sanitized ${e.removedDefinitionOccurrences} invalid definition occurrences across ${e.touchedDocuments} documents before SQLite conversion.`)}function oe(e,t,n){let r=ho(e)||".scip",i=ke(e,r);return v(h(e),`${i}.${n+1}.${t}${r}`)}async function Ho(e,t){for(let n=0;n<2;n++){let r=Jo(e,t);if(r)return r;let i=zo(e);if(i&&zr(t.trigger,i)){t.onStatus(`Manual reindex preempting watcher refresh started at ${i.startedAt}.`);let a;try{a=await Yo(i)}catch(s){throw new Error(`Could not verify the watcher's in-progress reindex owner (pid ${i.pid}); refusing to steal an active lock: ${N(s)}`,{cause:s})}if(!a)throw new Error(`Could not confirm the watcher's in-progress reindex (pid ${i.pid}) terminated for ${h(e)}; refusing to steal an active lock.`);let o=Ge(e,{parseLegacy:Oe});if(!kt(e,o,{parseLegacy:Oe}))throw new Error(`Reindex lock ownership changed before preemption completed for ${h(e)}.`);continue}throw new Error(`Another codebaseiq reindex is already running for ${h(e)}.`)}throw new Error(`Could not acquire codebaseiq reindex lock for ${h(e)}.`)}function Jo(e,t){let n=H(process.pid),r=Ft(e,{kind:"reindex",processIdentity:n,detail:{projectRoot:t.projectRoot,...process.env.SCIP_REINDEX_PROCESS_GROUP_LEADER==="1"?{processGroupLeader:!0}:{},...t.trigger?{trigger:t.trigger}:{}},parseLegacy:Oe});if(r.kind==="acquired"&&r.reclaimed){let i=Hr(r.reclaimed,e);i&&zr(t.trigger,i)?t.onStatus(`Manual reindex preempting watcher refresh started at ${i.startedAt}; its prior owner was already stale.`):t.onStatus(`Recovered an abandoned or incomplete reindex lock for ${h(e)}.`)}return r.kind==="acquired"?()=>{r.lock.release()}:null}function zo(e){return Hr(Ge(e,{parseLegacy:Oe}),e)}var Oe=e=>{let t=Jr(e,"");return t?{pid:t.pid,...t.processIdentity?{processIdentity:t.processIdentity}:{}}:null};function Hr(e,t){if(e.state==="valid"&&e.record?.kind==="reindex"){let n=e.record.detail??{};return{version:2,pid:e.record.pid,...e.record.processIdentity?{processIdentity:e.record.processIdentity}:{},...n.processGroupLeader===!0?{processGroupLeader:!0}:{},projectRoot:typeof n.projectRoot=="string"?n.projectRoot:h(t),startedAt:e.record.startedAt,trigger:n.trigger}}return Jr(e.parsed,t)}function Jr(e,t){try{let n=e;return typeof n.pid!="number"||!Number.isInteger(n.pid)||n.pid<=0?null:{version:n.version===2?2:1,pid:n.pid,...n.processIdentity===void 0?{}:(()=>{let r=Tt(n.processIdentity);return r?.pid===n.pid?{processIdentity:r}:{}})(),...n.processGroupLeader===!0?{processGroupLeader:!0}:{},projectRoot:typeof n.projectRoot=="string"?n.projectRoot:h(t),startedAt:typeof n.startedAt=="string"?n.startedAt:"unknown",trigger:n.trigger}}catch{return null}}function zr(e,t){return e?.kind==="manual-cli"&&Xo(t?.trigger)}function Xo(e){return e?.kind==="watch-source"||e?.kind==="watch-git-head"||e?.kind==="watch-git-index"||e?.kind==="watch-git-state"}async function Yo(e){return!J(e.pid)||(ht(e),Nr(e,"SIGTERM"),await Ar(e,2e3))?!0:(ht(e),Nr(e,"SIGKILL"),Ar(e,1e3))}function Nr(e,t){if(e.processGroupLeader)try{process.kill(-e.pid,t);return}catch{if(!J(e.pid))return;ht(e)}try{process.kill(e.pid,t)}catch{}}async function Ar(e,t){let n=S()+t;for(;S()<n;){if(Mr(e))return!0;await Vo(50)}return Mr(e)}function ht(e){if(!e.processIdentity)throw new Error(`Refusing to signal reindex pid ${e.pid}: its ownership record has no process identity.`);let t=H(e.pid);if(!t)throw new Error(`Refusing to signal reindex pid ${e.pid}: its process identity is unavailable.`);if(!ee(e.processIdentity,t))throw new Error(`Refusing to signal reindex pid ${e.pid}: its process identity does not match the ownership record.`)}function Mr(e){if(!J(e.pid))return!0;if(!e.processIdentity)return!1;let t=H(e.pid);return t!==null&&!ee(e.processIdentity,t)}function Vo(e){return new Promise(t=>setTimeout(t,e))}function Xr(e,t,n){return Object.fromEntries(t.map(r=>{let i=r==="typescript"?Nt(n.typescriptProjects):[],a=r==="clojure"?Qo(n.clojureConfigPath):void 0,o=[...Ze(r).markerFiles,...i,...a?[a]:[]],s=r==="typescript"?{typescriptProjectMode:n.typescriptProjectMode??"single",typescriptProjects:i}:{typescriptProjectMode:"single",typescriptProjects:[]};return[r,{version:2,languages:[r],pnpmWorkspaces:r==="typescript"&&Ko(n),...s,clojureConfigPath:a,files:At(e,{language:r,markerFiles:o})}]}))}function Qo(e){return e?.trim()||void 0}function Ko(e){return e.typescriptProjectMode!=="workspace"&&e.pnpmWorkspaces===!0}function St(e,t){return v(h(e),"language-indexes",`${t}.scip`)}function Yr(e){return v(h(e),"language-indexes","typescript-projects")}function Le(e,t){return v(Yr(e),`${ot(t)}.scip`)}function V(e){try{return Ae(le(ce(e,"reindex metadata")))}catch{return null}}function Vr(e,t){try{let n=le(ce(e,"reindex metadata"));if(n.kind!=="legacy"&&n.kind!=="supported")return!1;let r=n.metadata;return n.capabilities.publishableGeneration&&Ce(r)&&k(r.fingerprint)===k(t)&&k([...r.indexedLanguages??[]].sort())===k(t.languages)}catch{return!1}}function Rt(e,t){qt(e,t,{spacing:2,trailingNewline:!0})}function Qr(e,t){try{let n=Ae(le(ce(e,"reindex metadata")));if(!n)return;Rt(e,{...n,lastRefresh:t})}catch{}}function Ne(e){return{trigger:e.trigger??{kind:"unknown"},result:e.result,startedAt:new Date(e.start).toISOString(),completedAt:new Date().toISOString(),durationMs:S()-e.monotonicStart,indexedLanguages:e.languages?[...e.languages]:void 0,skipped:e.skipped?[...e.skipped]:void 0,error:e.error}}function k(e){return JSON.stringify(e)}export{xs as a,Ps as b,Ze as c,Dr as d,zd as e};
|
|
278
|
-
//# sourceMappingURL=chunk-
|
|
278
|
+
//# sourceMappingURL=chunk-O2KWU34K.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{A as G,D as P,a as y,b as ce,i as k,j as le,t as B,u as de,w as j,x as ue,y as b}from"./chunk-
|
|
2
|
+
import{A as G,D as P,a as y,b as ce,i as k,j as le,t as B,u as de,w as j,x as ue,y as b}from"./chunk-CLPCFGRT.js";import{c as Y,d as H,e as Z,g as X,i as ee,k as x}from"./chunk-6FXXYYQM.js";import{E,a as g,b as Q,c as C,e as S,v as se,x as ae}from"./chunk-OWJWOEDU.js";import{la as W}from"./chunk-7UCDGXRW.js";import{Ga as N,Ha as L,Ja as M,V as te,Wa as oe,Xa as re,Za as ie,ga as T,ka as ne}from"./chunk-EOKVZXNF.js";function ge(e,n,t){if(!Number.isSafeInteger(t.limit)||t.limit<=0)throw new Error("Reference page limit must be a positive safe integer.");let o=N(e,n);if(!o)return{rows:[],hasMore:!1,producer:t.producer??"source-keyset",semanticEnrichment:!1};if(t.producer==="complete-only"||t.semantic===!0||o.relativePath.endsWith(".rb"))return F(e,n,t);let i=oe(e,o);if(!i)return F(e,n,t);let s=fe(e,o),c=Te(e,s),a=[],l=t.producer==="source-keyset";for(let u of c){if(t.after&&u<t.after.relativePath)continue;t.instrumentation?.fileScanned?.(u);let f=re(e,i,u);f.length>0&&(l=!0);let d=new Set(f);s?.relativePath===u&&d.add(s.line);for(let m of[...d].sort((p,Ae)=>p-Ae)){let p={relativePath:u,line:m};if(!(t.after&&R(p,t.after)<=0)&&(a.push(p),t.instrumentation?.rowAccepted?.(p),l&&a.length>t.limit))return me(a,t.limit)}}return l?me(a,t.limit):F(e,n,t,s)}function R(e,n){return(e.relativePath<n.relativePath?-1:e.relativePath>n.relativePath?1:0)||e.line-n.line}function me(e,n){return{rows:e.slice(0,n),hasMore:e.length>n,producer:"source-keyset",semanticEnrichment:!1}}function F(e,n,t,o){let r=N(e,n),i=t.semantic===!0||r?.relativePath.endsWith(".rb")?E(e,n,{semantic:t.semantic}):De(e,n,o),s=Me(i).filter(c=>!t.after||R(c,t.after)>0);for(let c of s.slice(0,t.limit+1))t.instrumentation?.rowAccepted?.(c);return{rows:s.slice(0,t.limit),hasMore:s.length>t.limit,producer:"complete-only",semanticEnrichment:t.semantic===!0}}function De(e,n,t){let o=N(e,n);if(!o)return[];let r=t===void 0?fe(e,o):t,i=ie(e,o).map(s=>({relativePath:s.file,line:s.line}));return r?[r,...i]:i}function fe(e,n){return!ne(n.symbol)&&!e.isIgnored(n.relativePath)?{relativePath:n.relativePath,line:n.startLine}:null}function Te(e,n){let t=te(e);return!n||t.includes(n.relativePath)?t:[...t,n.relativePath].sort((o,r)=>o<r?-1:o>r?1:0)}function Me(e){let n=new Map;for(let t of e)n.set(`${t.relativePath}\0${t.line}`,t);return[...n.values()].sort(R)}import{InvalidArgumentError as v}from"commander";var St=W,Be=/^[+-]?\d+$/u,je=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/u,xt=(e=>V(e,"an integer")),pe=(e=>{let n=V(e,"a non-negative integer");if(n<0)throw new v(`Expected a non-negative integer, got "${e}".`);return n}),he=(e=>{let n=V(e,"a positive integer");if(n<1)throw new v(`Expected a positive integer, got "${e}".`);return n}),Et=(e=>{if(!je.test(e))throw new v(`Expected a number, got "${e}".`);let n=Number(e);if(!Number.isFinite(n))throw new v(`Expected a finite number, got "${e}".`);return n});function V(e,n){if(!Be.test(e))throw new v(`Expected ${n}, got "${e}".`);let t=Number(e);if(!Number.isSafeInteger(t))throw new v(`Expected ${n}, got "${e}".`);return t}function h(e,n,t,...o){return o.length>0?{flags:e,description:n,parser:t,defaultValue:o[0]}:{flags:e,description:n,parser:t}}function Ge(){return h("--json","Output as JSON for programmatic consumption")}function Fe(){return h("--compact","Emit minified one-line JSON (use with --json)")}function Ve(){return h("--result-only","Emit only the command-owned result (use with --json)")}function Ce(e=[]){return I(e)}function I(e=[]){let n=[Ge(),Ve(),Fe()],t=new Set(n.map(o=>o.flags));return[...e.filter(o=>!t.has(o.flags)),...n]}function $(e,n=[]){return{category:e,examples:n}}function Pt(e,n){return{origin:"mixed",observedSources:e,producerValidation:{status:"not-evaluated"},families:n}}function $t(e,n){return{origin:e,observedSources:n,producerValidation:{status:"not-evaluated"}}}function wt(e,n,t){return{id:e,selector:n,origin:{kind:"fixed",origin:t}}}function Ot(e,n,t,o){return{id:e,selector:n,origin:{kind:"result-field",field:t,values:o}}}function w(e,n,t,o,r,i,s){return{answers:typeof e=="string"?[e]:e,returns:typeof n=="string"?[n]:n,inputs:t,coverage:o,operation:i,semantic:s,...r?{scope:r}:{}}}function Nt(e,n,t,o,r,i=y){let s=typeof e=="string"?[e]:e,c=typeof n=="string"?[n]:n;return w(s,c,t,o,r,i,K(s.join(" "),c.join("; "),["This command establishes only its declared result units and evidence contract."],void 0,{outputCost:o==="complete"?"bounded":"variable"}))}function ye(e,n,t,o,r,i=y){let s=typeof e=="string"?[e]:e,c=typeof n=="string"?[n]:n;return w(s,c,t,o,r,i,Ke(c.join("; "),["This command does not establish repository graph relationships unless its result says so explicitly."]))}function be(e,n,t={ranking:"identity-only"}){return{kind:"locator",locates:e,nonClaims:n,outputCost:"small",frontierClosure:["evidence","inspect","code"],...t}}function Lt(e){return{kind:"graph-projection",outputCost:"bounded",frontierClosure:["inspect","code"],...e}}function Re(e,n,t,o={}){return{kind:"source-read",reads:e,nonClaims:n,outputCost:"potentially-large",frontierClosure:[],...t?{compatibility:t}:{},...o}}function K(e,n,t,o,r={}){return{kind:"analysis",analysis:e,resultMeaning:n,nonClaims:t,outputCost:"bounded",frontierClosure:["inspect","code"],...o?{compatibility:o}:{},...r}}function Ke(e,n,t,o={}){return{kind:"maintenance",effect:e,nonClaims:n,outputCost:"variable",frontierClosure:[],...t?{compatibility:t}:{},...o}}function J(e){return Buffer.from(JSON.stringify(e),"utf8").toString("base64url")}function A(e){return e.generation.identity}function U(e){return"after"in e?J({version:2,...e}):J({version:1,...e})}function ve(e,n){let t=_e(e);if(!Je(t)&&!Ue(t))throw new Error("Invalid result cursor. Run the command again without --cursor.");return ze(t,n),t}function Je(e){if(!e||typeof e!="object")return!1;let n=e;return n.version===1&&typeof n.command=="string"&&typeof n.target=="string"&&Number.isSafeInteger(n.offset)&&(n.offset??-1)>=0&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function Ue(e){if(!e||typeof e!="object")return!1;let n=e,t=n.after;return n.version===2&&typeof n.command=="string"&&typeof n.target=="string"&&!!t&&typeof t.relativePath=="string"&&t.relativePath.length>0&&Number.isSafeInteger(t.line)&&(t.line??-1)>=0&&(n.producer==="source-keyset"||n.producer==="complete-only")&&typeof n.semanticEnrichment=="boolean"&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function _e(e){try{return JSON.parse(Buffer.from(e,"base64url").toString("utf8"))}catch{throw new Error("Invalid result cursor. Run the command again without --cursor.")}}function ze(e,n){if(e.command!==n.command||e.target!==n.target)throw new Error("This cursor belongs to a different command or target. Run again without --cursor.");if(e.indexGeneration!==n.indexGeneration)throw new Error("The index changed after this cursor was issued. Run again without --cursor.")}function Se(e,n){let t=L(e,n),o=qe(t);for(let r of o)console.log(r)}function xe(e,n,t="No results found for resolved symbol."){return L(e,n).match?t:z(n,M(e,n,5))}function _(e,n,t,o){return{...D(e,n),[o]:t}}function D(e,n){let t=L(e,n);return t.match?{matched:!0,resolved:{symbol:t.match.symbol,shortName:T(t.match.symbol),relativePath:t.match.relativePath},otherMatches:t.candidates.map(o=>({shortName:o.shortName,relativePath:o.relativePath,startLine:o.startLine})),totalMatches:t.total}:{matched:!1,suggestions:M(e,n,5)}}function z(e,n){let t=`No definition matched '${e}'.`;return n.length>0?`${t} Suggestions: ${n.join(", ")}`:t}function qe(e){if(!e.match||e.total<=1)return[];let n=e.match,t=Math.max(0,e.total-1),o=[`Resolved: ${T(n.symbol)} (${n.relativePath}) -- ${t} other definition(s) share this name; qualify as <dir/leaf> to target another.`],r=e.candidates.slice(0,3);return r.length>0&&o.push(`Alternates: ${r.map(i=>`${i.shortName} (${i.relativePath}:${g(i.startLine)})`).join("; ")}`),o.push(""),o}var We=k(({db:e,args:n,opts:t})=>{let o=B(n,0),r=b(t,"signatures"),i=se(e,o);if(b(t,"json")){P("outline",n,t,i);return}if(console.log(`\u2550\u2550\u2550 REQUEST \u2550\u2550\u2550
|
|
3
3
|
file=${JSON.stringify(o)}; signatures=${r?"shown":"hidden"}`),i.length===0){console.log(`
|
|
4
4
|
\u2550\u2550\u2550 OBSERVED FACTS \u2550\u2550\u2550
|
|
5
5
|
No compiler-owned constructs were found for ${JSON.stringify(o)}.`),console.log(`
|
|
@@ -28,4 +28,4 @@ ${p}continue with --cursor ${d.cursor}`)}});function Ye(e,n,t){let o=E(e,n,{sema
|
|
|
28
28
|
`),o=0,r=0;for(let i=0;i<t.length;i++){let s=t[i].length+12;i>o&&r+s>Ee&&(n.push(`${e.relativePath}:${g(e.startLine+o)}-${g(e.startLine+i-1)}`),o=i,r=0),r+=s}return n.push(`${e.relativePath}:${g(e.startLine+o)}-${g(e.endLine)}`),n}function Pe(e,n){return{requested:n.length,matched:n.filter(t=>t.status==="matched").length,ambiguous:n.filter(t=>t.status==="ambiguous").length,missing:n.filter(t=>t.status==="missing").length,entries:[...n],bindingClosure:e.bindingClosure}}function $e(e,n){return["codebaseiq","code",...e.map(O),...n.members==="all"?["--members","all"]:[],...n.context>0?["--context",String(n.context)]:[]].join(" ")}function dt(e,n,t){if(!t)return D(e,n);let o={file:t.relativePath,symbol:t.shortName,language:t.language??"unknown",range:{startLine:g(t.startLine),endLine:g(t.endLine)},...t.freshness?{freshness:t.freshness}:{},lines:t.source.split(`
|
|
29
29
|
`).map((s,c)=>({line:g(t.startLine+c),text:s}))},r=D(e,n),i=r.totalMatches??0;return!r.matched||!r.resolved||i<=1?o:{...o,resolution:{selected:r.resolved,alternatives:r.otherMatches??[],totalMatches:i}}}function ut(e){return{requested:e.requested,matched:e.matched,ambiguous:e.ambiguous,missing:e.missing,entries:e.entries.map(n=>({selector:n.selector,status:n.status,kind:n.kind,totalCandidates:n.totalCandidates,sources:n.results.map(t=>({file:t.relativePath,symbol:t.shortName,language:t.language??"unknown",range:{startLine:g(t.startLine),endLine:g(t.endLine)},...t.freshness?{freshness:t.freshness}:{},lines:t.source.split(`
|
|
30
30
|
`).map((o,r)=>({line:g(t.startLine+r),text:o}))})),definitions:n.definitions,...n.fileCoverage?{fileCoverage:n.fileCoverage}:{},...n.rangeCoverage?{rangeCoverage:n.rangeCoverage}:{},candidates:n.candidates,omittedCandidates:n.omittedCandidates,suggestions:n.suggestions,...n.reason?{reason:n.reason}:{}})),literalValues:e.bindingClosure.inline}}function O(e){return`'${e.replaceAll("'","'\\''")}'`}var Zt=[{id:"session",command:"session",description:"Show evidence already delivered in this agent exploration session",options:[h("--reset","Clear this agent exploration-session ledger")],agent:ye("Which indexed source ranges and graph facts have already been delivered in this exploration session?","prior command ordinals, exact source ranges, and content-bound graph receipts",[],"complete","repository",ce("repository-observation",[{when:{kind:"option",name:"reset",equals:!0},role:"mutation"}])),renderShape:"custom",docs:$("Navigation"),handler:et},{id:"refs",command:"refs <symbol>",description:"Find all files referencing a symbol",options:Ce([h("--full","Run unbounded semantic analysis on large indexes"),h("-n, --limit <n>","Maximum reference sites to return",he),h("--cursor <cursor>","Continue a prior bounded result (implies --limit 50 when omitted)")]),budget:"semantic",agent:{operation:y,answers:["Which files reference this symbol?","Is this symbol used anywhere, or only defined?"],returns:["referencing file paths","reference line numbers grouped by file"],inputs:["symbol"],coverage:"bounded",semantic:K("Resolve the exact reference sites attributed to one compiler symbol identity.","Referencing file paths and reference line numbers grouped by file.",["Reference sites do not establish runtime execution, data flow, or task relevance."]),contrasts:[{command:"imported-by",distinction:"imported-by lists files importing the symbol; refs covers every reference site, imported or not."},{command:"affected",distinction:"refs is one hop out; affected is the transitive closure of what could break."}]},renderShape:"grouped-by-file",docs:$("Navigation",["codebaseiq refs login"]),handler:Qe},{id:"outline",command:"outline <file>",description:"Tree view of symbols in a file, with line ranges",agent:{...w("What symbols and nesting exist in this file?","symbol names, nesting, and line ranges",["file"],"complete",void 0,y,be(["file","symbol","construct"],["File ownership and nesting do not establish execution or task relevance."],{ranking:"identity-only",manualInput:"One exact current project file path.",evidenceCeiling:"Exact compiler-owned constructs and ranges when the file is indexed; no invented semantic overlay."})),contrasts:[{command:"search",distinction:"outline enumerates constructs in one known file; search locates exact text across current project text."},{command:"code",distinction:"outline returns identities and ranges; code materializes exact source for selected identities."}]},options:I([h("--signatures","Show trimmed symbol signatures")]),renderShape:"custom",docs:$("Navigation"),handler:We},{id:"code",command:"code <selectors...>",description:"Read exact definitions, ranges with local call closure, or file export surfaces",agent:{...w("What exact source defines these symbols, ranges, or file surfaces?","per-selector resolution, complete definition source, exact ranges with statically attributed same-file call closure, file export surfaces, omitted-local ledgers, and line ranges",[["symbol","file"]],"complete",void 0,y,Re(["construct","exact-source"],["Source materialization does not establish callers, runtime reachability, or task relevance by itself."],void 0,{manualInput:"One or more exact symbols, file:line ranges, or file paths.",evidenceCeiling:"Exact current source bytes for every resolved selector, with omitted file-local constructs disclosed."})),resultUnits:{kind:"field",field:"code"},contrasts:[{command:"inspect",distinction:"code materializes complete exact source; inspect batches bounded behavior or source gaps."},{command:"outline",distinction:"code reads selected implementations; outline enumerates file structure without reading every body."}]},options:I([h("-C, --context <n>","Extra lines of context above/below",pe,0),h("--members <exported|all>","For file selectors, return the exported surface or the complete file",void 0,"exported")]),renderShape:"custom",docs:$("Navigation",["codebaseiq code parseRequest handleRequest","codebaseiq code src/api.ts src/web.ts"]),handler:Xe}];export{St as a,xt as b,pe as c,he as d,Et as e,h as f,Fe as g,Ce as h,I as i,$ as j,Pt as k,$t as l,wt as m,Ot as n,w as o,Nt as p,ye as q,be as r,Lt as s,Re as t,K as u,Se as v,xe as w,_ as x,D as y,Zt as z};
|
|
31
|
-
//# sourceMappingURL=chunk-
|
|
31
|
+
//# sourceMappingURL=chunk-OBC7HSSO.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-DGXRDLV5.js";import{c as d}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-DGXRDLV5.js";import{c as d}from"./chunk-BPKNP3KZ.js";import{b as c}from"./chunk-J7AMBVWF.js";import{d as p}from"./chunk-GVAF222T.js";import{f as o}from"./chunk-F74LZWCE.js";import{z as u}from"./chunk-ICUL7XRT.js";function F(r,a={}){let{scope:l,limit:s=30,scanLimit:b}=a,f=new d(r);return g({candidates:()=>f.productionCallableDefinitions({scope:l,files:a.files,minLoc:2,excludeRootedSymbols:!0,requireFunctionLikeSymbol:!0}),filterCandidate:e=>y(e.relativePath),scanLimit:b,profile:{name:"unused-params"},evaluate:e=>{let n=o(r,e.relativePath)?.callables.find(t=>t.startLine===e.startLine&&t.endLine===e.endLine);if(!n||n.params.length===0||n.params.some(t=>!t.simple)||n.paramsEndLine>=n.endLine)return null;let L=c(r,e.relativePath),m=[];for(let t=n.params.length-1;t>=0;t--){let i=n.params[t];if(i.name===""||i.name.startsWith("_")||h(L.get(i.name),n.paramsEndLine,n.endLine))break;m.unshift(i.name)}return m.length===0?null:{symbol:e.symbol,shortName:p(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,paramCount:n.paramCount,unusedTrailing:m}},orderResults:(e,n)=>n.unusedTrailing.length-e.unusedTrailing.length||e.file.localeCompare(n.file)||e.startLine-n.startLine,limit:s})}function y(r){let a=u(r);return a==="typescript"||a==="tsx"||a==="javascript"}function h(r,a,l){return r?r.some(s=>s>a&&s<=l):!1}export{F as a};
|
|
2
|
+
//# sourceMappingURL=chunk-OKAF4OQS.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{m as g,n as h,z as S}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{m as g,n as h,z as S}from"./chunk-V4NGDIEA.js";import{c as u,d as m,h as p,k as f}from"./chunk-PUVNH4PO.js";import{B as d}from"./chunk-MEUHIDI3.js";import{G as c,N as a,Y as l}from"./chunk-UQYQBLJX.js";import{statSync as y}from"fs";import{join as R,resolve as C}from"path";var D=3e3,v=250,P={env:process.env,cliVersion:c,loadConfig:d,cacheDir:(e,r)=>a(e,r).cacheDir,registryRecord:e=>p(u(),m(e)),isProcessAlive:f,configChangedAtMs:e=>y(R(e,".codebaseiq.json")).mtimeMs,refreshHookBinary:e=>{S(e)},ensure:g,stop:h,sleep:e=>new Promise(r=>setTimeout(r,e))};async function _(e,r=P){let n=l(C(e)),t=r.loadConfig(n);if(t.sentinel?.enabled!==!0)return"sentinel-disabled";if(r.refreshHookBinary(r.cliVersion),t.watch?.enabled!==!0)return"watch-disabled";if(r.env.CODEBASEIQ_SKIP_WATCH_SERVICE==="1")return"environment";if(E(r,n))return"already-running";let i={projectRoot:n,cacheDir:r.cacheDir(n,t),cliVersion:r.cliVersion,spawnEnv:{CODEBASEIQ_SENTINEL_ENSURE:"1"}},o=r.ensure(i);if(o.disposition==="started")return"started";for(let s=0;s<D;s+=v)if(await r.sleep(v),E(r,n))return"reused";return Date.parse(o.state.startedAt)>=r.configChangedAtMs(n)?"reused-without-sentinel":(r.stop(i),r.ensure(i),"restarted")}function E(e,r){let n=e.registryRecord(r);return n!==void 0&&e.isProcessAlive(n.pid)&&n.serviceVersion===e.cliVersion}async function j(e){if(typeof e!="string"||e.length===0)throw new Error("A project root is required.");await _(e)}var k={id:"__sentinel-ensure-service",command:"__sentinel-ensure-service <projectRoot>",hidden:!0,description:"Internal: start the resident service that hosts the trailing sentinel",renderShape:"custom",handler:j};export{_ as a,k as b};
|
|
2
|
+
//# sourceMappingURL=chunk-OP6BUIV6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{e as n}from"./chunk-O2KWU34K.js";function s(o,r,t,e){return n({projectRoot:o,languages:e.languages?.length?e.languages:r.languages,outputScip:t.indexPath,outputDb:t.dbPath,pnpmWorkspaces:r.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:r.indexer?.typescript?.projectMode,typescriptProjects:r.indexer?.typescript?.projects,clojureConfigPath:r.indexer?.clojure?.configPath,skipIfUnchanged:e.force!==!0,allowPartial:e.allowPartial===!0,skipAutoInstall:e.skipAutoInstall===!0,installMissing:e.installMissing===!0,trustProjectTools:e.trustProjectTools===!0,indexerConcurrency:e.indexerConcurrency??r.indexerConcurrency,trigger:e.trigger,...e.onStatus?{onStatus:e.onStatus}:{}})}export{s as a};
|
|
2
|
+
//# sourceMappingURL=chunk-OQ3DK7FW.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{c as Qf,e as Zf,f as qt}from"./chunk-B2OB55RR.js";import{b as kt,c as Zl}from"./chunk-XZEE23VG.js";import{Q as Rs,R as df,_ as mf,aa as Is,ka as Ql,ma as ff,q as rf,r as yi,s as of,v as Ss}from"./chunk-7UCDGXRW.js";import{$ as $r,$a as Kn,A as xn,Aa as Ke,Ab as Ur,B as Or,Ba as ks,C as Sf,Ca as J,Cb as ic,D as vf,Da as Rn,Db as rc,E as ye,Ea as er,Eb as oc,F as Cf,Fa as Ff,Fb as Wn,Ga as pe,Gb as Jf,Ha as at,Hb as Yf,I as ae,Ia as Si,Ib as Xf,Ja as Ns,Ka as kf,La as Nf,Ma as Af,Mb as zr,N as te,Na as As,Nb as js,O as xf,Oa as nn,Ob as ep,P as Ms,Pa as qn,Pb as tp,Q as At,Qa as rn,Qb as np,R as tn,Ra as _f,S as Rf,Sa as Bf,Ta as Of,Ua as nc,V as Ji,Va as $f,W as Ps,X as _t,Y as Yi,Ya as jf,Z as If,Za as Hr,_a as Hf,a as Hn,aa as Ce,ab as Uf,b as Fe,ba as Ts,c as zt,ca as $e,d as Nt,da as Un,e as Cn,ea as zn,fa as Ef,fb as zf,g as pf,ga as A,h as gf,ha as Y,i as ec,ia as Bt,j as hf,ja as st,k as me,ka as _e,l as Es,la as De,ma as Xe,n as yf,na as Xi,nb as qf,o as bf,oa as wf,pa as Lf,q as tc,qa as Qi,qb as _s,r as Ct,ra as Zi,rb as Kf,s as Br,sa as Df,sb as Gf,t as Ye,ta as W,tb as Bs,u as se,ua as Ue,ub as Gn,v as re,va as Mf,vb as Os,w as ws,wa as Pf,wb as Wf,x as Ls,xa as jr,xb as $s,y as Ds,ya as Fs,yb as Vf,z as Oe,za as Tf}from"./chunk-
|
|
2
|
+
import{c as Qf,e as Zf,f as qt}from"./chunk-B2OB55RR.js";import{b as kt,c as Zl}from"./chunk-XZEE23VG.js";import{Q as Rs,R as df,_ as mf,aa as Is,ka as Ql,ma as ff,q as rf,r as yi,s as of,v as Ss}from"./chunk-7UCDGXRW.js";import{$ as $r,$a as Kn,A as xn,Aa as Ke,Ab as Ur,B as Or,Ba as ks,C as Sf,Ca as J,Cb as ic,D as vf,Da as Rn,Db as rc,E as ye,Ea as er,Eb as oc,F as Cf,Fa as Ff,Fb as Wn,Ga as pe,Gb as Jf,Ha as at,Hb as Yf,I as ae,Ia as Si,Ib as Xf,Ja as Ns,Ka as kf,La as Nf,Ma as Af,Mb as zr,N as te,Na as As,Nb as js,O as xf,Oa as nn,Ob as ep,P as Ms,Pa as qn,Pb as tp,Q as At,Qa as rn,Qb as np,R as tn,Ra as _f,S as Rf,Sa as Bf,Ta as Of,Ua as nc,V as Ji,Va as $f,W as Ps,X as _t,Y as Yi,Ya as jf,Z as If,Za as Hr,_a as Hf,a as Hn,aa as Ce,ab as Uf,b as Fe,ba as Ts,c as zt,ca as $e,d as Nt,da as Un,e as Cn,ea as zn,fa as Ef,fb as zf,g as pf,ga as A,h as gf,ha as Y,i as ec,ia as Bt,j as hf,ja as st,k as me,ka as _e,l as Es,la as De,ma as Xe,n as yf,na as Xi,nb as qf,o as bf,oa as wf,pa as Lf,q as tc,qa as Qi,qb as _s,r as Ct,ra as Zi,rb as Kf,s as Br,sa as Df,sb as Gf,t as Ye,ta as W,tb as Bs,u as se,ua as Ue,ub as Gn,v as re,va as Mf,vb as Os,w as ws,wa as Pf,wb as Wf,x as Ls,xa as jr,xb as $s,y as Ds,ya as Fs,yb as Vf,z as Oe,za as Tf}from"./chunk-EOKVZXNF.js";import{d as Xm,e as Wl}from"./chunk-D62CTZX6.js";import{A as tf,Ba as cf,Ca as Xl,Da as bi,E as bs,Ea as Vi,Fa as uf,Ga as Ar,Ha as _r,Ia as xs,J as en,Y as nf,aa as Ae,f as Qm,g as ys,ga as sf,h as ht,ha as B,i as Tt,ja as vs,k as vn,l as hi,la as Jl,na as Cs,oa as Yl,pa as rt,qa as ot,ra as Ft,sa as af,ta as lf,w as Zm,x as ef,y as Vl}from"./chunk-5T44HG5Y.js";import{B as jn,D as Pt,c as ql,d as Kl,i as Jm,j as Gi,k as Ym,l as pi,q as Zt,r as gi,v as Gl,w as gs,x as hs,y as Wi}from"./chunk-DUKHVPU5.js";function ip(e){return e+1}function hI(e,t){return`${ip(e)}-${ip(t)}`}function A2(e,t,n){return`${kt(e)}:${hI(t,n)}`}function _2(e,t=180){let n=kt(e).replace(/\s+/g," ").trim();return n.length>t?`${n.slice(0,t-3)}...`:n}var sc={empty(e){console.log(kt(e))},list(e,t){for(let n of e)console.log(kt(t(n)))},groupedByFile(e,t,n=i=>i.relativePath){let i="";for(let r of e){let o=n(r);o!==i&&(i&&console.log(""),console.log(kt(o)),i=o),console.log(kt(t(r)))}},sectionedReport(e){let t=!0;for(let n of e)if(!(n.skipIfEmpty&&n.rows.length===0)){t||console.log(""),t=!1,n.title!==void 0&&console.log(`\u2550\u2550\u2550 ${kt(n.title)} \u2550\u2550\u2550`),n.explanation!==void 0&&console.log(kt(n.explanation));for(let i of n.rows)console.log(kt(i))}},table(e,t,n){console.log(` ${e.map(kt).join(" ")}`);let i=n??e.map(r=>r.length);console.log(` ${i.map(r=>"\u2500".repeat(r)).join(" ")}`);for(let r of t)console.log(kt(r))}};import{SymbolInformation_Kind as Ie}from"@c4312/scip";var Hs=new Map(Object.entries(Ie).filter(([e,t])=>Number.isInteger(Number(e))&&typeof t=="string").map(([e,t])=>[Number(e),t])),rp=new Map([...Hs.entries()].map(([e,t])=>[t.toLowerCase(),e]));function qr(e){return Hs.get(e)??"Unknown"}function on(){return[Ie.Function,Ie.Method,Ie.Macro,Ie.Constructor,Ie.Getter,Ie.Setter,Ie.StaticMethod,Ie.SingletonMethod,Ie.AbstractMethod,Ie.ProtocolMethod,Ie.TraitMethod]}function op(){return[Ie.Class,Ie.Interface,Ie.Struct,Ie.Trait,Ie.Type,Ie.TypeAlias,Ie.Enum,Ie.Union,Ie.Protocol]}function $2(){return[Ie.Constant,Ie.Variable,Ie.Value,Ie.Field,Ie.Property,Ie.StaticDataMember,Ie.StaticField,Ie.StaticProperty,Ie.StaticVariable,Ie.EnumMember]}import{existsSync as yI}from"fs";import{isAbsolute as bI,join as SI}from"path";function dt(e,t){let n=ap(e,t,{allowMultiple:!1})[0]?.relativePath;return n||sp(e,t)}function In(e,t){return ap(e,t,{allowMultiple:!0}).map(n=>n.relativePath)}function sp(e,t){if(!t)return null;let n=t.replace(/\\/g,"/").replace(/^\.\//,""),i=bI(n)&&n.startsWith(e.config.projectRoot)?n.slice(e.config.projectRoot.length).replace(/^\/+/,""):n,r=SI(e.config.projectRoot,i);return yI(r)?i:null}function ap(e,t,n){let i=Es(e,t,n);if(i.length===0){if(sp(e,t))return[];let r=pe(e,t);return!r||e.isIgnored(r.relativePath)?[]:[{relativePath:r.relativePath,score:700}]}return i}function ac(e,t){let n=In(e,t),i=Fs(e,n,{sort:!0});if(i.length===0)return[];let r=i.map(a=>({symbol:a.symbol,shortName:a.shortName,startLine:a.startLine,endLine:a.endLine,signature:a.signature,children:[]})),o=new Map;for(let a of r)o.set(a.symbol,a);let s=[];for(let a=0;a<i.length;a++){let l=i[a],c=r[a];if(l.enclosingSymbol&&o.has(l.enclosingSymbol)){o.get(l.enclosingSymbol).children.push(c);continue}let u=null,d=1/0;for(let m of r)if(m!==c&&m.startLine<=c.startLine&&m.endLine>=c.endLine){if(m.startLine===c.startLine&&m.endLine===c.endLine&&!Lf(m.symbol,c.symbol))continue;let p=m.endLine-m.startLine;p<d&&(d=p,u=m)}u?u.children.push(c):s.push(c)}return s}import{basename as LE,extname as _p}from"path";function xt(e,t){let n=re(e,t.relativePath);if(n.length===0)return!1;let i=Y(t.symbol);if(!i)return!1;let r=n.slice(Math.max(0,t.startLine-2),t.startLine+1).join(`
|
|
3
3
|
`),o=Oe(i);return new RegExp(`^\\s*export\\s+(?:default\\s+)?(?:(?:async\\s+)?function\\s+${o}\\b|(?:abstract\\s+)?class\\s+${o}\\b|(?:interface|type|enum|namespace|module)\\s+${o}\\b|(?:const|let|var)\\s+${o}\\b)`,"m").test(r)?!0:vI(n,i)}function vI(e,t){if(!t)return!1;let n=new RegExp(`^\\s*export\\s*\\{[^}\\n]*\\b${Oe(t)}\\b`);return e.some(i=>n.test(i))}import{createHash as CI}from"crypto";import{TextDecoder as xI}from"util";var RI=new xI("utf-8",{fatal:!0});function lc(e){return af(e.config.projectRoot)}function Us(e,t){let n=vn(t),i;try{i=Yl(e.config.projectRoot,n,{inputKind:"repository text file"})}catch(o){if(ot(o)||o instanceof Jl)return null;throw o}let r=mp(i);return r===null?null:cp(n,i,r,dp(e),up(e))}function zs(e,t={}){let n=lc(e).filter(u=>!t.scope||u.includes(t.scope)),i=dp(e),r=up(e),o=[],s=[],a=[],l=[],c=0;for(let u of n){let d;try{d=Yl(e.config.projectRoot,u,{inputKind:"repository text file"})}catch(f){if(f instanceof Jl){l.push(u);continue}if(ot(f))continue;a.push(u);continue}let m=mp(d);if(m===null){s.push(u);continue}c+=d.byteLength,o.push(cp(u,d,m,i,r))}return{files:o,candidateFiles:n.length,scannedBytes:c,skippedBinaryPaths:s,skippedUnreadablePaths:a,skippedOversizedPaths:l}}function cp(e,t,n,i,r){let o=CI("sha256").update(t).digest("hex");return{relativePath:e,text:n,bytes:t.byteLength,freshness:{exactText:{state:"current",basis:"working-tree-read",sha256:o},semantic:II(e,o,i,r)}}}function II(e,t,n,i){if(!i.has(e))return{state:"unavailable",basis:"no-compiler-document"};let r=n.get(e);return r?{state:r===t?"aligned":"stale",basis:"indexed-input-fingerprint"}:{state:"unavailable",basis:"fingerprint-unavailable"}}function up(e){return new Set(e.all(`SELECT documents.relative_path FROM documents WHERE 1 = 1 ${e.pathExclusionsFor("documents")}`).map(t=>t.relative_path))}function dp(e){let t=new Map;if(!e.generation.metadataRaw)return t;let n=bs(e.generation.metadataRaw);if(n.kind!=="legacy"&&n.kind!=="supported")return t;let i=n.metadata.fingerprint;if(!lp(i)||!Array.isArray(i.files))return t;for(let r of i.files)!lp(r)||typeof r.path!="string"||typeof r.hash!="string"||t.set(r.path,r.hash);return t}function mp(e){if(e.includes(0))return null;try{return RI.decode(e)}catch{return null}}function lp(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function qs(e,t,n={}){return vi(e,t,n).rows}function vi(e,t,n={}){let i=Kr(e,[t],{additive:n.additive,semantic:n.semantic,semanticEvidence:n.semanticEvidence}),r=n.callableOnly?(i.rows.get(t.symbolId)??[]).filter(o=>st(o.symbol)||o.source==="ast-callsite"):i.rows.get(t.symbolId)??[];return{rows:typeof n.limit=="number"?r.slice(0,n.limit):r,semanticIncomplete:i.incompleteSymbolIds.has(t.symbolId),semanticUnavailable:i.unavailableSymbolIds.has(t.symbolId)}}function Ks(e,t,n){return uc(e,t,n).rows}function uc(e,t,n){let i=sn(e,[t],n);return{rows:i.rows.get(t.symbolId)??[],semanticIncomplete:i.incompleteSymbolIds.has(t.symbolId),semanticUnavailable:i.unavailableSymbolIds.has(t.symbolId)}}function pp(e,t,n){return sn(e,t,n).rows}function sn(e,t,n){let i=MI(e)?TI(e,t,{semantic:n.semantic!==!1,semanticEvidence:n.semanticEvidence}):PI(e,n.semanticEvidence,{semantic:n.semantic!==!1});return{rows:new Map(t.map(o=>[o.symbolId,typeof n.limit=="number"?(i.rows.get(o.symbolId)??[]).slice(0,n.limit):i.rows.get(o.symbolId)??[]])),incompleteSymbolIds:new Set(t.filter(o=>i.incompleteSymbolIds.has(o.symbolId)).map(o=>o.symbolId)),unavailableSymbolIds:new Set(t.filter(o=>i.unavailableSymbolIds.has(o.symbolId)).map(o=>o.symbolId))}}var EI=Fe("caller-rows",{clearGroups:["whole-project"]}),wI=Fe("caller-rows-non-semantic",{clearGroups:["whole-project"]}),LI=Fe("targeted-caller-strategy",{clearGroups:["whole-project"]}),DI=2e4;function MI(e){return LI.get(e,()=>(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>DI)}function PI(e,t,n={}){return(n.semantic===!1?wI:EI).get(e,()=>{let r=Ue(e),o=Kr(e,r,{semantic:n.semantic!==!1,semanticEvidence:t}),s=new Map;for(let c of r)s.set(c.symbol,c.symbolId);let a=new Map,l=new Map;for(let c of r){let u=o.rows.get(c.symbolId);if(!(!u||u.length===0))for(let d of u){let m=s.get(d.symbol);if(m===void 0||m===c.symbolId)continue;let f=a.get(m);f||(f=[],a.set(m,f),l.set(m,new Set));let p=`${c.symbol}|${c.relativePath}`;l.get(m).has(p)||(l.get(m).add(p),f.push({symbol:c.symbol,file:c.relativePath,source:"caller-map-inversion",callEvidence:d.source}))}}return{rows:a,incompleteSymbolIds:o.incompleteSymbolIds.size===0?new Set:new Set(r.map(c=>c.symbolId)),unavailableSymbolIds:o.unavailableSymbolIds.size===0?new Set:new Set(r.map(c=>c.symbolId))}})}function TI(e,t,n){let i=n.semantic&&n.semanticEvidence?t.flatMap(u=>{let d=FI(e,u);return d?[d]:[]}):[],r=new Map(i.map(u=>[u.symbolId,u])),o=n.semantic&&n.semanticEvidence?n.semanticEvidence.referenceEvidenceMap(e,i):{rows:new Map,incompleteSymbolIds:new Set,unavailableSymbolIds:new Set},s=Hf(e,t),a=new Map;for(let u of t){let d=[],m=new Set,f=g=>{if(g.symbol===u.symbol)return;let h=`${g.symbol}|${g.file}`;m.has(h)||(m.add(h),d.push(g))};for(let g of s.get(u.symbolId)??[])g.file!==u.relativePath&&f({symbol:g.enclosingSymbol??g.file,file:g.file,source:"resolved-reference"});let p=r.get(u.symbolId);if(p)for(let g of o.rows.get(p.symbolId)??[]){if(g.file===u.relativePath||e.isIgnored(g.file))continue;let h=Ke(W(e,g.file),g.line);f({symbol:h?.symbol??g.file,file:g.file,source:"semantic-reference"})}a.set(u.symbolId,d)}let l=new Set(o.incompleteSymbolIds),c=new Set(o.unavailableSymbolIds);if(n.semantic)for(let u of t)r.has(u.symbolId)||l.add(u.symbolId);return{rows:a,incompleteSymbolIds:l,unavailableSymbolIds:c}}function FI(e,t){let n=on().join(", "),i=op().join(", ");return e.get(`SELECT
|
|
4
4
|
d.id AS documentId,
|
|
5
5
|
gs.id AS symbolId,
|
|
@@ -542,4 +542,4 @@ ${r}`:""}`);return $W(i.stdout,e)})}function $W(e,t){let n;try{n=JSON.parse(e)}c
|
|
|
542
542
|
Maintenance Pressure:`);for(let t of e.pressure)console.log(` ${t.category}: ${t.count} / ${t.threshold} threshold (${t.ratio}x, -${t.extraPenalty} ${t.kind})`)}}function D2(e){let t=e.axes;if(console.log(`
|
|
543
543
|
Axes:`),console.log(` Zero-reference candidates: ${t.deletable.loc} LOC across ${t.deletable.symbols} symbols`),t.changeAmplification){let i=t.changeAmplification;console.log(` Change amplification: ${i.medianFilesPerCommit} files/commit median, ${i.p90FilesPerCommit} p90 (${i.commitsAnalyzed} commits)`)}if(t.hiddenCoupling&&t.hiddenCoupling.pairCount>0){console.log(` Hidden coupling: ${t.hiddenCoupling.pairCount} co-changing pair(s) without a dependency edge`);for(let i of t.hiddenCoupling.top.slice(0,3))console.log(` ${i.fileA} <-> ${i.fileB} (${i.together}x together, ${Math.round(i.confidence*100)}%)`)}if(t.churnWeightedComplexity&&t.churnWeightedComplexity.length>0){let i=t.churnWeightedComplexity[0];i.weighted>0&&console.log(` Churn x complexity: hottest is ${i.symbol} (${i.changes} changes, weighted ${i.weighted})`)}let n=t.evidenceQuality;if(console.log(` Evidence quality: ${n.graphFindings} graph-fact finding(s), ${n.heuristicFindings} heuristic finding(s), ${n.userSuppressed} user-suppressed`),e.validation&&e.validation.flaggedFiles>0){let i=e.validation,r=i.ratio===null?"n/a":`${i.ratio}x`;console.log(` Validation: flagged files fix-density ${i.flaggedFixDensity} vs baseline ${i.baselineFixDensity} (${r})`),console.log(` fix-commit signal: subject-keyword heuristic over ${i.validationBasis.commitsScanned} commits`)}}async function Xce(e){let t=Ol(o=>{let s=Pr(o,{base:e.base});return s.note?{kind:"complete",result:pl(o,{base:e.base})}:s.changedFiles.length===0?{kind:"complete",result:pl(o,{base:e.base})}:{kind:"batched",plan:s}}),n=t.value;if(n.kind==="complete")return{result:n.result,observationReceipt:jl([t.anchor],[],["index-generation","live-workspace"])};let i=UR(n.plan.changedFiles,t2),r=await Am(i,M2(i.length),(o,s)=>k2(o,e,s));return{result:gl(n.plan.changedFiles,r.map(o=>o.result)),observationReceipt:jl([t.anchor],r.map(o=>o.observationReceipt),["index-generation","live-workspace"])}}var M2=iI({envKey:"CODEBASEIQ_DIFF_IMPACT_CONCURRENCY",defaultMinimum:n2,defaultMaximum:i2});function iI(e){return(t,n=process.env,i=ZW)=>P2(t,n,i,e)}function P2(e,t,n,i){let r=t[i.envKey],o=F2(n,i),s=r?parseInt(r,10):o,a=!Number.isFinite(s)||s<1?Math.min(o,e):Math.min(s,e),l=T2(t);return l===null?a:Math.min(l,a)}function T2(e){let t=e.CODEBASEIQ_MAX_CONCURRENCY;if(!t)return null;let n=parseInt(t,10);return Number.isFinite(n)&&n>=1?n:null}function F2(e,t){let n=e(),i=Number.isFinite(n)?Math.max(t.defaultMinimum,n-1):0;return Math.min(t.defaultMaximum,Math.max(t.defaultMinimum,i))}function k2(e,t,n){let i=process.argv[1]??$m(import.meta.url),r=[];return t.base&&r.push("--base",t.base),_l({cliPath:i,command:e2,args:r,env:{...process.env,CODEBASEIQ_DIFF_IMPACT_FILES:JSON.stringify(e)},label:"Diff-impact batch",signal:n})}function Qce(e){console.log(`Changed files: ${e.summary.totalChangedFiles}`),console.log(`Changed symbols: ${e.summary.totalChangedSymbols}`),console.log(`Affected consumer files: ${e.summary.totalAffectedFiles}`),e.summary.note&&console.log(`Note: ${e.summary.note}`);for(let n of e.evidenceTiers.filter(i=>i.state==="failed"))console.log(`WARNING: ${n.tier} evidence failed for ${n.attemptedSymbols} candidate symbol(s): ${n.reason}`);let t=e.attributionNotes.filter(n=>n.method==="unattributed");if(t.length>0){let n=[...new Set(t.map(i=>i.file))];for(let i of n){let r=t.filter(o=>o.file===i).length;console.log(`note: ${r} changed line-range(s) in ${i} belong to no indexed symbol`)}}console.log(""),e.changedSymbols.length>0&&(console.log("Changed symbols:"),sc.list(e.changedSymbols,n=>` ${n.file} ${n.shortName} (fan-in: ${n.fanIn})`)),e.affectedConsumers.length>0&&(console.log(`
|
|
544
544
|
Affected consumer files:`),sc.list(e.affectedConsumers,n=>` ${n.file} (${n.consumedSymbols} symbol(s))`))}export{ip as a,hI as b,A2 as c,_2 as d,sc as e,qr as f,on as g,op as h,$2 as i,sa as j,EY as k,CL as l,Li as m,SD as n,pu as o,gu as p,yo as q,hu as r,Ia as s,BP as t,Eo as u,ac as v,Ec as w,DE as x,wo as y,Lo as z,_a as A,ib as B,XT as C,vF as D,qX as E,b0 as F,hN as G,jo as H,pd as I,$N as J,iv as K,ji as L,wA as M,MA as N,PA as O,TA as P,qA as Q,WA as R,VA as S,JA as T,XA as U,QA as V,ZA as W,Hi as X,yv as Y,zo as Z,Cd as _,x_ as $,qo as aa,w_ as ba,L_ as ca,N_ as da,$_ as ea,j_ as fa,H_ as ga,Wo as ha,Ld as ia,Vo as ja,GB as ka,Jo as la,Yo as ma,Md as na,Xo as oa,Qo as pa,Pd as qa,OO as ra,Zo as sa,q$ as ta,Od as ua,$d as va,D1 as wa,Pr as xa,NC as ya,lj as za,ts as Aa,$H as Ba,is as Ca,lU as Da,rs as Ea,ZU as Fa,ez as Ga,lz as Ha,xz as Ia,Mz as Ja,Gz as Ka,dm as La,Wx as Ma,fm as Na,Vx as Oa,Ll as Pa,xq as Qa,cs as Ra,us as Sa,ds as Ta,PK as Ua,TK as Va,FK as Wa,xm as Xa,kl as Ya,Im as Za,dG as _a,GG as $a,WG as ab,JG as bb,XG as cb,lW as db,gW as eb,zi as fb,uce as gb,Cce as hb,ZR as ib,e2 as jb,Wce as kb,Vce as lb,Jce as mb,b2 as nb,Yce as ob,Xce as pb,Qce as qb};
|
|
545
|
-
//# sourceMappingURL=chunk-
|
|
545
|
+
//# sourceMappingURL=chunk-OWJWOEDU.js.map
|