@easbot/codebase 0.3.32 → 0.3.37
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/README.en.md +1 -1
- package/README.md +1 -1
- package/dist/chunks/{cache-LSQZJEDR.cjs → cache-CSRIBDNY.cjs} +1 -1
- package/dist/chunks/{cache-D7NVUXB2.mjs → cache-EZ3VLUUC.mjs} +1 -1
- package/dist/chunks/{chunk-TBDAGLC4.cjs → chunk-3DAM6EZN.cjs} +6 -6
- package/dist/chunks/{chunk-OJK5EFPD.cjs → chunk-6NYX22KV.cjs} +19 -19
- package/dist/chunks/{chunk-OZYQQS63.cjs → chunk-AARBEAIB.cjs} +2 -2
- package/dist/chunks/{chunk-JEHVBEBS.cjs → chunk-D5NDNAKA.cjs} +1 -1
- package/dist/chunks/{chunk-TMQVJU4I.mjs → chunk-ECMVXJH2.mjs} +1 -1
- package/dist/chunks/{chunk-33DIOGLJ.mjs → chunk-EU2I2AMK.mjs} +1 -1
- package/dist/chunks/{chunk-PRPBK7D6.mjs → chunk-FZNMPXUO.mjs} +2 -2
- package/dist/chunks/{chunk-37KKG3UK.mjs → chunk-OUJNWRIY.mjs} +12 -12
- package/dist/chunks/{chunk-KR6BQNY6.mjs → chunk-QZMJ5EUF.mjs} +3 -3
- package/dist/chunks/{chunk-CLUGDJA5.cjs → chunk-VXLUR7M5.cjs} +2 -2
- package/dist/chunks/cli-handler-7HKSS3UW.mjs +1 -0
- package/dist/chunks/cli-handler-OU2TC2SB.cjs +1 -0
- package/dist/chunks/{code-base-M4EMTQTG.mjs → code-base-OBQSRCQ3.mjs} +1 -1
- package/dist/chunks/{code-base-5BXR4FUU.cjs → code-base-WZ3L5IE5.cjs} +1 -1
- package/dist/chunks/database-manager-T43UZZ45.cjs +1 -0
- package/dist/chunks/database-manager-ZC46AHSS.mjs +1 -0
- package/dist/chunks/file-watcher-GUS2OVZU.cjs +1 -0
- package/dist/chunks/file-watcher-RAO72GUL.mjs +1 -0
- package/dist/chunks/{interfaces-43SSCG3E.mjs → interfaces-UUDPRWI6.mjs} +1 -1
- package/dist/chunks/{interfaces-LUHDPZOT.cjs → interfaces-YGSG2MI4.cjs} +1 -1
- package/dist/chunks/{llm-WS3XKT46.mjs → llm-NWYEBR5K.mjs} +1 -1
- package/dist/chunks/{llm-S6D5ICOO.cjs → llm-UYBJKQ3S.cjs} +1 -1
- package/dist/chunks/{stdio-server-KA3JQB7C.cjs → stdio-server-37QG6AO2.cjs} +2 -2
- package/dist/chunks/{stdio-server-QP63TXGI.mjs → stdio-server-QAEXVFSI.mjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +10 -10
- package/dist/chunks/cli-handler-IQ6ZNLEJ.mjs +0 -1
- package/dist/chunks/cli-handler-WTEPKO4E.cjs +0 -1
- package/dist/chunks/database-manager-KM7BOISA.mjs +0 -1
- package/dist/chunks/database-manager-LTHK7MM6.cjs +0 -1
- package/dist/chunks/file-watcher-2MUX5MO5.cjs +0 -1
- package/dist/chunks/file-watcher-ABFT22GS.mjs +0 -1
- /package/dist/chunks/{chunk-T6KJWYTV.mjs → chunk-47LKNS74.mjs} +0 -0
- /package/dist/chunks/{chunk-KFESJR3T.cjs → chunk-R32346OA.cjs} +0 -0
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import {g,F,f,e as e$1,d as d$1,b as b$1}from'./chunk-PRPBK7D6.mjs';import {b}from'./chunk-ETCTXAXR.mjs';import {c,e,a as a$1,d}from'./chunk-TMQVJU4I.mjs';import {a,c as c$1,b as b$5,e as e$3,d as d$3}from'./chunk-KR6BQNY6.mjs';import {b as b$3,e as e$2,c as c$3,a as a$2,d as d$2,f as f$1}from'./chunk-33DIOGLJ.mjs';import {b as b$4}from'./chunk-KTSR5VPT.mjs';import {a as a$3}from'./chunk-ESA2CL57.mjs';import {b as b$2,c as c$2}from'./chunk-T6KJWYTV.mjs';import {existsSync,readFileSync,copyFileSync,rmSync,statSync,mkdirSync}from'fs';import {Log,errorMeta,resolveLocaleLang,NameErrors,ServiceError}from'@easbot/utils';import {syncMeta}from'@easbot/llm';import {createRequire}from'module';import {EMBEDDING_DIMS_CONSISTENCY_CHECK}from'@easbot/types';import {emitJsonError,emitJsonOk,printHuman,formatKnowledgeDoctor,formatKnowledgeStatus,formatKnowledgeInit,registerActiveProgressLine,clearActiveProgressLine,unregisterActiveProgressLine}from'@easbot/terminal';import {join,dirname}from'path';import {resolveSqlTextLimit}from'@easbot/database';import {fileURLToPath}from'url';import {ServerTransportType}from'@easbot/mcp';var te=Log.create({service:"codebase.init"});function _e(o){let e={},n=[];for(let t of o)t==="--force"||t==="-f"?e.force=true:t==="--help"||t==="-h"?e.help=true:t==="--json"?e.json=true:t.startsWith("-")||n.push(t);return e}async function I(o={}){let e=await b.getRootDir();try{let m=await e$3();m.source==="monorepo"?te.debug("better-sqlite3 resolved (monorepo)",{path:m.absolutePath}):te.debug("better-sqlite3 auto-installed to cache",{source:m.source,path:m.absolutePath});}catch(m){te.warn("better-sqlite3 resolve / install failed; index/sync/mcp may still fail later",{error:errorMeta(m),hint:"Run `npm i -g better-sqlite3` then retry, or set EASBOT_CACHE_PATH to a writable directory before running `easbot codebase init`."});}let n=a(e),t=await b.getConfigPath(),i=c$1(e);if(await b.exists()&&!o.force)return {configPath:t,dbPath:i,created:false,skipped:true,backend:"better-sqlite3",schemaVersion:a$2,migrationsApplied:0,tablesCreated:0,durationMs:0};if(existsSync(n)||mkdirSync(n,{recursive:true}),await b.writeCodebaseJson({version:1,schema_version:a$2,extraction_version:e$2,backend:"better-sqlite3",created_at:new Date().toISOString()}),o.force)for(let m of [i,`${i}-wal`,`${i}-shm`])try{rmSync(m,{force:!0});}catch{}d$3(e);let r=false,l=0,s=0,a$1=Date.now(),d=new f$1(i);try{let m=d.getMeta("index_state"),h=d.getMeta("createdAt"),p=d.getMeta("version"),w=d.getMeta("indexed_with_version");r=m!==null&&h!==null&&p!==null&&w!==null;try{l=d.countSqliteObjects();}catch{}let u=d.getMeta("schema_version");s=u?Number.parseInt(u,10)||a$2:a$2;}finally{d.close();}let c=Date.now()-a$1;return {configPath:t,dbPath:i,created:true,skipped:false,metaInitialized:r,backend:"better-sqlite3",schemaVersion:a$2,migrationsApplied:s,tablesCreated:l,durationMs:c}}async function V(o){let e=await b.getRootDir(),t=await b.getConfigPath(),i=c$1(e),r=await b.exists(),l=existsSync(i),s;if(l)try{s=statSync(i).size;}catch{}let a={initialized:false,capabilities:{embedding:false,evaluation:false}},d={},c,m,h,p=0,w=0,u,E,x,f=false,k,g=false,y;if(r)try{let v=await b.getCodebaseJson();v&&(c=v.index_state,E=v.schema_version,m=v.extraction_version,u=v.backend);}catch{}if(l&&i)try{let{DatabaseManager:v}=await import('./database-manager-KM7BOISA.mjs'),F=new v(i);try{let P=F.getStatus();c=P.indexState??c,m=P.extractionVersion??m,h=P.isStale,p=P.nodeCount,w=P.edgeCount;for(let[Z,co]of Object.entries(P.meta))d[Z]=co;k=P.meta.lastSyncAt,E=parseInt(P.meta.schema_version??"",10)||E,u=P.meta.backend??u,f=P.meta.vector_enabled==="true"||P.meta.vector_enabled==="1",x=parseInt(P.meta.embeddingDims??"",10)||void 0;try{let{stats:Z}=F.checkIntegrity();y={...Z};}catch{}g=F.isFtsAvailable();}finally{F.close();}}catch{}let S=a$3.isInitialized();if(S){a.initialized=true;let v=a$3.capabilities();a.capabilities={embedding:v.embedding===true,evaluation:v.evaluation===true},a.embeddingModel=a.capabilities.embedding?"configured":void 0,a.evaluationModel=a.capabilities.evaluation?"configured":void 0;}if(S&&a.capabilities.embedding&&i)try{let v=await a$3.probeEmbeddingDims({timeoutMs:5e3});if(typeof v=="number"){x=v;try{let{DatabaseManager:F}=await import('./database-manager-KM7BOISA.mjs'),P=new F(i);try{syncMeta(P,[["embeddingDims",String(v)]]);}finally{P.close();}}catch{}}}catch{}let j=l&&r&&!h&&c!=="failed"&&c!=="stale",C;return r?l?c==="failed"?C="Last sync failed \u2014 run `easbot codebase index` to retry.":h?C="Index is stale (extraction version mismatch) \u2014 run `easbot codebase recreate` to rebuild.":c==="uninitialized"?C="Config exists but index never built \u2014 run `easbot codebase index` to populate.":c==="partial"&&(C="Last sync partially succeeded \u2014 re-run `easbot codebase index` to fill missing files."):C="Run `easbot codebase index` to build the index.":C="Run `easbot codebase init` to initialize the configuration.",{package:"codebase",rootDir:e,dbPath:i,dbSize:s,configPath:t,configExists:r,schemaVersion:E,extractionVersion:m,lastSyncAt:k,indexState:c,vectorEnabled:f,embeddingDims:x,llm:a,backend:u,meta:d,recommendation:C,healthy:j,dbStats:y,dbExists:l,nodeCount:p,edgeCount:w,ftsAvailable:g}}var M=()=>Date.now();async function Ne(o){let e=M(),n=await V(),t=[],i,r=M(),l;if(n.dbExists?n.configExists?l=O("database","ok",`db readable at ${n.dbPath}`,Date.now()-r):l=O("database","warn","config not found \u2014 run `easbot codebase init` first",Date.now()-r):l=O("database","info","db not initialized \u2014 run `easbot codebase index` to build",Date.now()-r),t.push(l),n.dbExists){let u=M();t.push(O("fts","ok","fts sync checked in integrity pass",Date.now()-u));}if(n.dbExists){let u=M();t.push(O("vector",n.vectorEnabled?"ok":"info",n.vectorEnabled?`vector index enabled (dims=${n.embeddingDims??"unknown"})`:"vector index disabled (set config.vector.enabled to enable)",Date.now()-u));}if(n.dbExists){let u=M();t.push(O("schema",n.isStale===true?"warn":"ok",n.isStale===true?`extraction_version mismatch (current=${n.extractionVersion??0})`:`schema_version=${n.schemaVersion??"unknown"}`,Date.now()-u));}t.push(O("lock","ok","no lock contention observed",0)),t.push(O("disk_space","ok","no disk space check (v0.5.1 placeholder)",0));let s=M(),a={"better-sqlite3":false,"node:sqlite":false,"@tursodatabase/database":false},d=createRequire(import.meta.url);try{d.resolve("better-sqlite3"),a["better-sqlite3"]=!0;}catch{}a["node:sqlite"]=typeof process.versions.sqlite=="string";try{d.resolve("@tursodatabase/database"),a["@tursodatabase/database"]=!0;}catch{}let c="ok",m=`backend available: ${n.backend??"unknown"}`;!a["better-sqlite3"]&&!a["node:sqlite"]?(c="error",m="no SQLite backend available (install better-sqlite3 or use Node 22.5+)"):n.configExists&&n.backend&&!a[n.backend]&&(c="error",m=`configured backend "${n.backend}" not available in this environment`),t.push(O("backend",c,m,Date.now()-s));let h=M(),p;if(!n.llm.initialized||!n.llm.capabilities.embedding)p=O(EMBEDDING_DIMS_CONSISTENCY_CHECK,"info","llm not initialized; probe skipped",Date.now()-h);else if(!n.dbExists)p=O(EMBEDDING_DIMS_CONSISTENCY_CHECK,"info","db not initialized; probe skipped",Date.now()-h);else try{let u=await a$3.probeEmbeddingDims({timeoutMs:5e3});typeof u!="number"?p=O(EMBEDDING_DIMS_CONSISTENCY_CHECK,"info","probe failed (network / model error)",Date.now()-h):n.embeddingDims===void 0?p=O(EMBEDDING_DIMS_CONSISTENCY_CHECK,"info",`probe=${u}, meta missing \u2014 next status will sync`,Date.now()-h):u!==n.embeddingDims?p=O(EMBEDDING_DIMS_CONSISTENCY_CHECK,"warn",`probe=${u} but meta.embeddingDims=${n.embeddingDims} (drift detected)`,Date.now()-h,{probed:u,recorded:n.embeddingDims}):p=O(EMBEDDING_DIMS_CONSISTENCY_CHECK,"ok",`probe=${u} matches meta`,Date.now()-h,{probed:u});}catch(u){p=O(EMBEDDING_DIMS_CONSISTENCY_CHECK,"info",`probe threw: ${errorMeta(u).message}`,Date.now()-h);}if(t.push(p),n.dbExists){let u=M();try{let{DatabaseManager:E}=await import('./database-manager-KM7BOISA.mjs'),x=new E(n.dbPath);try{let{issues:f,stats:k}=x.checkIntegrity();i=k;for(let g of f)t.push(O("integrity_stats",g.severity,g.message,0,{source:"database.checkIntegrity"}));i.parse_errors===0&&t.push(O("parse_errors_zero","info","parse_errors: 0 (no parse errors recorded)",0)),i.unresolved_refs===0&&t.push(O("unresolved_refs_zero","info","unresolved_refs: 0 (resolution pipeline not active)",0)),i.name_segment_vocab===0&&t.push(O("name_segment_vocab_zero","info","name_segment_vocab: 0 (identifier-segments not active)",0)),i.project_metadata===0&&t.push(O("project_metadata_zero","info","project_metadata: 0 (CodeBase.initialize not run)",0));}finally{x.close();}}catch(E){t.push(O("integrity_stats","warn",`db integrity check failed: ${errorMeta(E).message}`,Date.now()-u));}}let w=M();if(!n.llm.initialized)t.push(O("llm","info","Llm namespace not initialized (calls `easbot codebase init` first)",Date.now()-w));else {let u=[];n.llm.capabilities.embedding||u.push("embedding"),n.llm.capabilities.evaluation||u.push("evaluation"),t.push(O("llm",u.length===0?"ok":"info",u.length===0?"embedding + evaluation configured":`missing capabilities: ${u.join(", ")}`,Date.now()-w,{capabilities:n.llm.capabilities}));}return {healthy:!t.some(u=>u.severity==="error"),checks:t,issues:t.map(u=>({severity:u.severity,message:u.message,name:u.name,code:u.code})),durationMs:Date.now()-e,status:n,backendAvailable:a,dbStats:i??void 0}}function O(o,e,n,t,i){return {code:o.toUpperCase().replace(/[^A-Z0-9]+/g,"_"),severity:e,name:o,message:n,details:i,durationMs:t}}var Co=Log.create({service:"codebase.cmd.index"});function ve(o){let e={};for(let n of o)if(n==="--no-embed")e.noEmbed=true;else if(n==="--embed")e.noEmbed=false;else if(n==="--json")e.json=true;else if(n==="--verbose"||n==="-v")e.verbose=true;else if(n==="--quiet"||n==="-q")e.quiet=true;else if(n==="--help"||n==="-h")e.help=true;else if(n.startsWith("--batch=")){let t=n.slice(8),i=Number.parseInt(t,10);Number.isFinite(i)&&i>0&&(e.batch=i);}return e}async function H(o){var E=[];try{let e=await b.getRootDir();let n=a(e);let t=b$5(e);await I();let{CodeBase:i}=await import('./code-base-M4EMTQTG.mjs');let{DEFAULT_EMBEDDING_CONFIG:r,DEFAULT_INDEXER_CONFIG:l,DEFAULT_PARSER_CONFIG:s}=await import('@easbot/types');let a$1=o.batch??l.batchSize??50;let d=new i({workspaceDir:e,database:{path:c$1(e),walMode:!0},embedding:o.noEmbed===!1?r:void 0,indexer:{...l,batchSize:a$1},parser:s,sync:{onBoot:!1,onSearch:!1,onSessionStart:!1,intervalMs:0}});let c=Date.now();let m=b$2(E,Co.time("codebaseIndex",{level:"DEBUG"}));let h=-1;let p=0;let w=!o.quiet;let u;try{await d.initialize(),registerActiveProgressLine(process.stderr);let g=await d.indexDirectory(e,w?y=>{let S=Math.max(y.total,1),j=Math.min(100,Math.floor(y.processed/S*100)),C=Date.now();if(j!==h||C-p>3e4){let F=String(j).padStart(3," ");clearActiveProgressLine(),process.stderr.write(` \u{1F4A1} [${F}%] ${y.stage}: ${y.processed}/${y.total} files`),h=j,p=C;}}:void 0);u={rootDir:e,success:g.success,filesProcessed:g.filesProcessed,nodesCreated:g.nodesCreated,edgesCreated:g.edgesCreated,errorCount:g.errors.length,errors:g.errors,durationMs:g.duration,embedded:!o.noEmbed,batchSize:a$1};}finally{clearActiveProgressLine(),unregisterActiveProgressLine(process.stderr),await d.close();}return u}catch(x){var f=x,k=true;}finally{c$2(E,f,k);}}function Ie(o){let e=[];if(e.push("Codebase index"),e.push(` rootDir: ${o.rootDir}`),e.push(` success: ${o.success?"\u2713":"\u2717"}`),e.push(` files processed: ${o.filesProcessed}`),e.push(` nodes created: ${o.nodesCreated}`),e.push(` edges created: ${o.edgesCreated}`),e.push(` embedded: ${o.embedded?"yes":"no (--no-embed)"}`),e.push(` batch size: ${o.batchSize}`),e.push(` duration: ${o.durationMs}ms`),o.errorCount>0){e.push(` errors (${o.errorCount}):`);for(let n of o.errors.slice(0,10))e.push(` - ${n.filePath}: ${n.error}`);o.errors.length>10&&e.push(` ... and ${o.errors.length-10} more`);}return e.join(`
|
|
2
|
-
`)}function je(o){let e={};for(let n of o)n==="--json"?e.json=true:n==="--quiet"||n==="-q"?e.quiet=true:n==="--help"||n==="-h"?e.help=true:n==="--no-embed"?e.noEmbed=true:n==="--embed"&&(e.noEmbed=false);return e}async function Te(o){let e=await b.getRootDir(),n=c$1(e),{CodeBase:t}=await import('./code-base-
|
|
1
|
+
import {g,F,f,e as e$1,d as d$1,b as b$1}from'./chunk-FZNMPXUO.mjs';import {b}from'./chunk-ETCTXAXR.mjs';import {c,e,a as a$1,d}from'./chunk-ECMVXJH2.mjs';import {a,c as c$1,b as b$5,e as e$3,d as d$3}from'./chunk-QZMJ5EUF.mjs';import {b as b$3,e as e$2,c as c$3,a as a$2,d as d$2,f as f$1}from'./chunk-EU2I2AMK.mjs';import {b as b$4}from'./chunk-KTSR5VPT.mjs';import {a as a$3}from'./chunk-ESA2CL57.mjs';import {b as b$2,c as c$2}from'./chunk-47LKNS74.mjs';import {existsSync,readFileSync,copyFileSync,rmSync,statSync,mkdirSync}from'fs';import {Log,errorMeta,resolveLocaleLang,NameErrors,ServiceError}from'@easbot/utils';import {syncMeta}from'@easbot/llm';import {createRequire}from'module';import {EMBEDDING_DIMS_CONSISTENCY_CHECK}from'@easbot/types';import {emitJsonError,emitJsonOk,printHuman,formatKnowledgeDoctor,formatKnowledgeStatus,formatKnowledgeInit,registerActiveProgressLine,clearActiveProgressLine,unregisterActiveProgressLine}from'@easbot/terminal';import {join,dirname}from'path';import {resolveSqlTextLimit}from'@easbot/database';import {fileURLToPath}from'url';import {ServerTransportType}from'@easbot/mcp';var te=Log.create({service:"codebase.init"});function _e(o){let e={},n=[];for(let t of o)t==="--force"||t==="-f"?e.force=true:t==="--help"||t==="-h"?e.help=true:t==="--json"?e.json=true:t.startsWith("-")||n.push(t);return e}async function I(o={}){let e=await b.getRootDir();try{let m=await e$3();m.source==="monorepo"?te.debug("better-sqlite3 resolved (monorepo)",{path:m.absolutePath}):te.debug("better-sqlite3 auto-installed to cache",{source:m.source,path:m.absolutePath});}catch(m){te.warn("better-sqlite3 resolve / install failed; index/sync/mcp may still fail later",{error:errorMeta(m),hint:"Run `npm i -g better-sqlite3` then retry, or set EASBOT_CACHE_PATH to a writable directory before running `easbot codebase init`."});}let n=a(e),t=await b.getConfigPath(),i=c$1(e);if(await b.exists()&&!o.force)return {configPath:t,dbPath:i,created:false,skipped:true,backend:"better-sqlite3",schemaVersion:a$2,migrationsApplied:0,tablesCreated:0,durationMs:0};if(existsSync(n)||mkdirSync(n,{recursive:true}),await b.writeCodebaseJson({version:1,schema_version:a$2,extraction_version:e$2,backend:"better-sqlite3",created_at:new Date().toISOString()}),o.force)for(let m of [i,`${i}-wal`,`${i}-shm`])try{rmSync(m,{force:!0});}catch{}d$3(e);let r=false,l=0,s=0,a$1=Date.now(),d=new f$1(i);try{let m=d.getMeta("index_state"),h=d.getMeta("createdAt"),p=d.getMeta("version"),w=d.getMeta("indexed_with_version");r=m!==null&&h!==null&&p!==null&&w!==null;try{l=d.countSqliteObjects();}catch{}let u=d.getMeta("schema_version");s=u?Number.parseInt(u,10)||a$2:a$2;}finally{d.close();}let c=Date.now()-a$1;return {configPath:t,dbPath:i,created:true,skipped:false,metaInitialized:r,backend:"better-sqlite3",schemaVersion:a$2,migrationsApplied:s,tablesCreated:l,durationMs:c}}async function V(o){let e=await b.getRootDir(),t=await b.getConfigPath(),i=c$1(e),r=await b.exists(),l=existsSync(i),s;if(l)try{s=statSync(i).size;}catch{}let a={initialized:false,capabilities:{embedding:false,evaluation:false}},d={},c,m,h,p=0,w=0,u,E,x,f=false,k,g=false,y;if(r)try{let v=await b.getCodebaseJson();v&&(c=v.index_state,E=v.schema_version,m=v.extraction_version,u=v.backend);}catch{}if(l&&i)try{let{DatabaseManager:v}=await import('./database-manager-ZC46AHSS.mjs'),F=new v(i);try{let P=F.getStatus();c=P.indexState??c,m=P.extractionVersion??m,h=P.isStale,p=P.nodeCount,w=P.edgeCount;for(let[Z,co]of Object.entries(P.meta))d[Z]=co;k=P.meta.lastSyncAt,E=parseInt(P.meta.schema_version??"",10)||E,u=P.meta.backend??u,f=P.meta.vector_enabled==="true"||P.meta.vector_enabled==="1",x=parseInt(P.meta.embeddingDims??"",10)||void 0;try{let{stats:Z}=F.checkIntegrity();y={...Z};}catch{}g=F.isFtsAvailable();}finally{F.close();}}catch{}let S=a$3.isInitialized();if(S){a.initialized=true;let v=a$3.capabilities();a.capabilities={embedding:v.embedding===true,evaluation:v.evaluation===true},a.embeddingModel=a.capabilities.embedding?"configured":void 0,a.evaluationModel=a.capabilities.evaluation?"configured":void 0;}if(S&&a.capabilities.embedding&&i)try{let v=await a$3.probeEmbeddingDims({timeoutMs:5e3});if(typeof v=="number"){x=v;try{let{DatabaseManager:F}=await import('./database-manager-ZC46AHSS.mjs'),P=new F(i);try{syncMeta(P,[["embeddingDims",String(v)]]);}finally{P.close();}}catch{}}}catch{}let j=l&&r&&!h&&c!=="failed"&&c!=="stale",C;return r?l?c==="failed"?C="Last sync failed \u2014 run `easbot codebase index` to retry.":h?C="Index is stale (extraction version mismatch) \u2014 run `easbot codebase recreate` to rebuild.":c==="uninitialized"?C="Config exists but index never built \u2014 run `easbot codebase index` to populate.":c==="partial"&&(C="Last sync partially succeeded \u2014 re-run `easbot codebase index` to fill missing files."):C="Run `easbot codebase index` to build the index.":C="Run `easbot codebase init` to initialize the configuration.",{package:"codebase",rootDir:e,dbPath:i,dbSize:s,configPath:t,configExists:r,schemaVersion:E,extractionVersion:m,lastSyncAt:k,indexState:c,vectorEnabled:f,embeddingDims:x,llm:a,backend:u,meta:d,recommendation:C,healthy:j,dbStats:y,dbExists:l,nodeCount:p,edgeCount:w,ftsAvailable:g}}var M=()=>Date.now();async function Ne(o){let e=M(),n=await V(),t=[],i,r=M(),l;if(n.dbExists?n.configExists?l=O("database","ok",`db readable at ${n.dbPath}`,Date.now()-r):l=O("database","warn","config not found \u2014 run `easbot codebase init` first",Date.now()-r):l=O("database","info","db not initialized \u2014 run `easbot codebase index` to build",Date.now()-r),t.push(l),n.dbExists){let u=M();t.push(O("fts","ok","fts sync checked in integrity pass",Date.now()-u));}if(n.dbExists){let u=M();t.push(O("vector",n.vectorEnabled?"ok":"info",n.vectorEnabled?`vector index enabled (dims=${n.embeddingDims??"unknown"})`:"vector index disabled (set config.vector.enabled to enable)",Date.now()-u));}if(n.dbExists){let u=M();t.push(O("schema",n.isStale===true?"warn":"ok",n.isStale===true?`extraction_version mismatch (current=${n.extractionVersion??0})`:`schema_version=${n.schemaVersion??"unknown"}`,Date.now()-u));}t.push(O("lock","ok","no lock contention observed",0)),t.push(O("disk_space","ok","no disk space check (v0.5.1 placeholder)",0));let s=M(),a={"better-sqlite3":false,"node:sqlite":false,"@tursodatabase/database":false},d=createRequire(import.meta.url);try{d.resolve("better-sqlite3"),a["better-sqlite3"]=!0;}catch{}a["node:sqlite"]=typeof process.versions.sqlite=="string";try{d.resolve("@tursodatabase/database"),a["@tursodatabase/database"]=!0;}catch{}let c="ok",m=`backend available: ${n.backend??"unknown"}`;!a["better-sqlite3"]&&!a["node:sqlite"]?(c="error",m="no SQLite backend available (install better-sqlite3 or use Node 22.5+)"):n.configExists&&n.backend&&!a[n.backend]&&(c="error",m=`configured backend "${n.backend}" not available in this environment`),t.push(O("backend",c,m,Date.now()-s));let h=M(),p;if(!n.llm.initialized||!n.llm.capabilities.embedding)p=O(EMBEDDING_DIMS_CONSISTENCY_CHECK,"info","llm not initialized; probe skipped",Date.now()-h);else if(!n.dbExists)p=O(EMBEDDING_DIMS_CONSISTENCY_CHECK,"info","db not initialized; probe skipped",Date.now()-h);else try{let u=await a$3.probeEmbeddingDims({timeoutMs:5e3});typeof u!="number"?p=O(EMBEDDING_DIMS_CONSISTENCY_CHECK,"info","probe failed (network / model error)",Date.now()-h):n.embeddingDims===void 0?p=O(EMBEDDING_DIMS_CONSISTENCY_CHECK,"info",`probe=${u}, meta missing \u2014 next status will sync`,Date.now()-h):u!==n.embeddingDims?p=O(EMBEDDING_DIMS_CONSISTENCY_CHECK,"warn",`probe=${u} but meta.embeddingDims=${n.embeddingDims} (drift detected)`,Date.now()-h,{probed:u,recorded:n.embeddingDims}):p=O(EMBEDDING_DIMS_CONSISTENCY_CHECK,"ok",`probe=${u} matches meta`,Date.now()-h,{probed:u});}catch(u){p=O(EMBEDDING_DIMS_CONSISTENCY_CHECK,"info",`probe threw: ${errorMeta(u).message}`,Date.now()-h);}if(t.push(p),n.dbExists){let u=M();try{let{DatabaseManager:E}=await import('./database-manager-ZC46AHSS.mjs'),x=new E(n.dbPath);try{let{issues:f,stats:k}=x.checkIntegrity();i=k;for(let g of f)t.push(O("integrity_stats",g.severity,g.message,0,{source:"database.checkIntegrity"}));i.parse_errors===0&&t.push(O("parse_errors_zero","info","parse_errors: 0 (no parse errors recorded)",0)),i.unresolved_refs===0&&t.push(O("unresolved_refs_zero","info","unresolved_refs: 0 (resolution pipeline not active)",0)),i.name_segment_vocab===0&&t.push(O("name_segment_vocab_zero","info","name_segment_vocab: 0 (identifier-segments not active)",0)),i.project_metadata===0&&t.push(O("project_metadata_zero","info","project_metadata: 0 (CodeBase.initialize not run)",0));}finally{x.close();}}catch(E){t.push(O("integrity_stats","warn",`db integrity check failed: ${errorMeta(E).message}`,Date.now()-u));}}let w=M();if(!n.llm.initialized)t.push(O("llm","info","Llm namespace not initialized (calls `easbot codebase init` first)",Date.now()-w));else {let u=[];n.llm.capabilities.embedding||u.push("embedding"),n.llm.capabilities.evaluation||u.push("evaluation"),t.push(O("llm",u.length===0?"ok":"info",u.length===0?"embedding + evaluation configured":`missing capabilities: ${u.join(", ")}`,Date.now()-w,{capabilities:n.llm.capabilities}));}return {healthy:!t.some(u=>u.severity==="error"),checks:t,issues:t.map(u=>({severity:u.severity,message:u.message,name:u.name,code:u.code})),durationMs:Date.now()-e,status:n,backendAvailable:a,dbStats:i??void 0}}function O(o,e,n,t,i){return {code:o.toUpperCase().replace(/[^A-Z0-9]+/g,"_"),severity:e,name:o,message:n,details:i,durationMs:t}}var Co=Log.create({service:"codebase.cmd.index"});function ve(o){let e={};for(let n of o)if(n==="--no-embed")e.noEmbed=true;else if(n==="--embed")e.noEmbed=false;else if(n==="--json")e.json=true;else if(n==="--verbose"||n==="-v")e.verbose=true;else if(n==="--quiet"||n==="-q")e.quiet=true;else if(n==="--help"||n==="-h")e.help=true;else if(n.startsWith("--batch=")){let t=n.slice(8),i=Number.parseInt(t,10);Number.isFinite(i)&&i>0&&(e.batch=i);}return e}async function H(o){var E=[];try{let e=await b.getRootDir();let n=a(e);let t=b$5(e);await I();let{CodeBase:i}=await import('./code-base-OBQSRCQ3.mjs');let{DEFAULT_EMBEDDING_CONFIG:r,DEFAULT_INDEXER_CONFIG:l,DEFAULT_PARSER_CONFIG:s}=await import('@easbot/types');let a$1=o.batch??l.batchSize??50;let d=new i({workspaceDir:e,database:{path:c$1(e),walMode:!0},embedding:o.noEmbed===!1?r:void 0,indexer:{...l,batchSize:a$1},parser:s,sync:{onBoot:!1,onSearch:!1,onSessionStart:!1,intervalMs:0}});let c=Date.now();let m=b$2(E,Co.time("codebaseIndex",{level:"DEBUG"}));let h=-1;let p=0;let w=!o.quiet;let u;try{await d.initialize(),registerActiveProgressLine(process.stderr);let g=await d.indexDirectory(e,w?y=>{let S=Math.max(y.total,1),j=Math.min(100,Math.floor(y.processed/S*100)),C=Date.now();if(j!==h||C-p>3e4){let F=String(j).padStart(3," ");clearActiveProgressLine(),process.stderr.write(` \u{1F4A1} [${F}%] ${y.stage}: ${y.processed}/${y.total} files`),h=j,p=C;}}:void 0);u={rootDir:e,success:g.success,filesProcessed:g.filesProcessed,nodesCreated:g.nodesCreated,edgesCreated:g.edgesCreated,errorCount:g.errors.length,errors:g.errors,durationMs:g.duration,embedded:!o.noEmbed,batchSize:a$1};}finally{clearActiveProgressLine(),unregisterActiveProgressLine(process.stderr),await d.close();}return u}catch(x){var f=x,k=true;}finally{c$2(E,f,k);}}function Ie(o){let e=[];if(e.push("Codebase index"),e.push(` rootDir: ${o.rootDir}`),e.push(` success: ${o.success?"\u2713":"\u2717"}`),e.push(` files processed: ${o.filesProcessed}`),e.push(` nodes created: ${o.nodesCreated}`),e.push(` edges created: ${o.edgesCreated}`),e.push(` embedded: ${o.embedded?"yes":"no (--no-embed)"}`),e.push(` batch size: ${o.batchSize}`),e.push(` duration: ${o.durationMs}ms`),o.errorCount>0){e.push(` errors (${o.errorCount}):`);for(let n of o.errors.slice(0,10))e.push(` - ${n.filePath}: ${n.error}`);o.errors.length>10&&e.push(` ... and ${o.errors.length-10} more`);}return e.join(`
|
|
2
|
+
`)}function je(o){let e={};for(let n of o)n==="--json"?e.json=true:n==="--quiet"||n==="-q"?e.quiet=true:n==="--help"||n==="-h"?e.help=true:n==="--no-embed"?e.noEmbed=true:n==="--embed"&&(e.noEmbed=false);return e}async function Te(o){let e=await b.getRootDir(),n=c$1(e),{CodeBase:t}=await import('./code-base-OBQSRCQ3.mjs'),{DEFAULT_EMBEDDING_CONFIG:i,DEFAULT_INDEXER_CONFIG:r,DEFAULT_PARSER_CONFIG:l}=await import('@easbot/types'),s=new t({workspaceDir:e,database:{path:n,walMode:true},embedding:o.noEmbed===false?i:void 0,indexer:r,parser:l,sync:{onBoot:false,onSearch:false,onSessionStart:false,intervalMs:0}}),a,d={_lastPct:-1,_lastProgressAt:0};try{await s.initialize(),registerActiveProgressLine(process.stderr);let c=await s.sync(o.quiet?void 0:h=>{let p=Math.max(h.total,1),w=Math.min(100,Math.floor(h.processed/p*100)),u=Date.now(),E=w!==d._lastPct,x=u-d._lastProgressAt>3e4;if(E||x){let f=String(w).padStart(3," ");clearActiveProgressLine(),process.stderr.write(` \u{1F4A1} [${f}%] ${h.stage}: ${h.processed}/${h.total} files`),d._lastPct=w,d._lastProgressAt=u;}}),m=s.getDatabase().getIndexState();a={rootDir:e,success:c.success,filesAdded:c.filesAdded,filesUpdated:c.filesUpdated,filesDeleted:c.filesDeleted,filesSkipped:c.filesSkipped,nodesCreated:c.nodesCreated,edgesCreated:c.edgesCreated,errorCount:c.errors.length,errors:c.errors,durationMs:c.duration,indexState:m};}finally{clearActiveProgressLine(),unregisterActiveProgressLine(process.stderr),await s.close();}return a}function $e(o){let e=[];if(e.push("Codebase sync"),e.push(` rootDir: ${o.rootDir}`),e.push(` success: ${o.success?"\u2713":"\u2717"}`),e.push(` indexState: ${o.indexState}`),e.push(""),e.push(" Files"),e.push(` \u2139 added: ${o.filesAdded}`),e.push(` \u2139 updated: ${o.filesUpdated}`),e.push(` \u2139 deleted: ${o.filesDeleted}`),e.push(` \u2139 skipped: ${o.filesSkipped} (no-change: hash matches; parser-rejected: 0 nodes)`),e.push(""),e.push(" Graph"),e.push(` \u2139 nodes created: ${o.nodesCreated}`),e.push(` \u2139 edges created: ${o.edgesCreated}`),e.push(` duration: ${o.durationMs}ms`),o.errorCount>0){e.push(` errors (${o.errorCount}):`);for(let n of o.errors.slice(0,10))e.push(` - ${n.filePath}: ${n.error}`);o.errors.length>10&&e.push(` ... and ${o.errors.length-10} more`);}return e.join(`
|
|
3
3
|
`)}function Me(o){let e={};for(let n of o)n==="--keep-config"?e.keepConfig=true:n==="--no-reindex"?e.noReindex=true:n==="--no-embed"?e.noEmbed=true:n==="--force"||n==="-f"?e.force=true:n==="--json"?e.json=true:(n==="--help"||n==="-h")&&(e.help=true);return e}async function Le(o){let e=await b.getRootDir();a(e);let t=c$1(e),i=b$5(e),r=false,l=false;for(let d of [t,`${t}-wal`,`${t}-shm`])if(existsSync(d))try{rmSync(d,{force:!0}),d===t&&(r=!0);}catch{}if(!o.keepConfig&&existsSync(i))try{rmSync(i,{force:!0}),l=!0;}catch{}await I({force:true});let s=false,a$1;if(!o.noReindex){let d=await H({noEmbed:o.noEmbed,quiet:true});s=true,a$1={filesProcessed:d.filesProcessed,nodesCreated:d.nodesCreated,edgesCreated:d.edgesCreated,durationMs:d.durationMs,embedded:d.embedded};}return {rootDir:e,removedDb:r,removedConfig:l,recreated:true,reindexed:s,configPath:i,indexSummary:a$1}}function Ae(o){let e=[];return e.push("Codebase recreate"),e.push(` rootDir: ${o.rootDir}`),e.push(` removed db: ${o.removedDb?"\u2713":"\u2717 (not found)"}`),e.push(` removed config:${o.removedConfig?"\u2713":"(preserved via --keep-config or absent)"}`),e.push(` \u2713 reinitialized at ${o.configPath}`),o.reindexed&&o.indexSummary?e.push(` \u2713 reindexed in ${o.indexSummary.durationMs}ms (files: ${o.indexSummary.filesProcessed}, nodes: ${o.indexSummary.nodesCreated}, edges: ${o.indexSummary.edgesCreated}, embed: ${o.indexSummary.embedded?"on":"off"})`):e.push(" \u2139 reindex skipped (--no-reindex). Next: run `easbot codebase index` to rebuild the index."),e.join(`
|
|
4
|
-
`)}function qe(o){let e={};for(let n of o)n==="--keep-embeddings"?e.keepEmbeddings=true:n==="--force"||n==="-f"?e.force=true:n==="--json"?e.json=true:(n==="--help"||n==="-h")&&(e.help=true);return e}async function Ue(o){let e=await b.getRootDir();a(e);let t=c$1(e),i=b$5(e);if(!existsSync(t))return await I(),{rootDir:e,cleared:false,nodesRemoved:0,edgesRemoved:0,filesRemoved:0,embeddingsPreserved:false,configPreserved:existsSync(i),nextIndexState:"uninitialized"};let{CodeBase:r}=await import('./code-base-
|
|
4
|
+
`)}function qe(o){let e={};for(let n of o)n==="--keep-embeddings"?e.keepEmbeddings=true:n==="--force"||n==="-f"?e.force=true:n==="--json"?e.json=true:(n==="--help"||n==="-h")&&(e.help=true);return e}async function Ue(o){let e=await b.getRootDir();a(e);let t=c$1(e),i=b$5(e);if(!existsSync(t))return await I(),{rootDir:e,cleared:false,nodesRemoved:0,edgesRemoved:0,filesRemoved:0,embeddingsPreserved:false,configPreserved:existsSync(i),nextIndexState:"uninitialized"};let{CodeBase:r}=await import('./code-base-OBQSRCQ3.mjs'),{DEFAULT_EMBEDDING_CONFIG:l,DEFAULT_INDEXER_CONFIG:s,DEFAULT_PARSER_CONFIG:a$1}=await import('@easbot/types'),d=new r({workspaceDir:e,database:{path:t,walMode:true},embedding:o.keepEmbeddings?l:void 0,indexer:s,parser:a$1,sync:{onBoot:false,onSearch:false,onSessionStart:false,intervalMs:0}}),c;try{await d.initialize();let m={nodes:d.getDatabase().getNodeCount(),edges:d.getDatabase().getEdgeCount(),files:d.getDatabase().getFileCount()};await d.clear({keepEmbeddings:!!o.keepEmbeddings}),d.getDatabase().setIndexState("uninitialized"),c={rootDir:e,cleared:!0,nodesRemoved:m.nodes,edgesRemoved:m.edges,filesRemoved:m.files,embeddingsPreserved:!!o.keepEmbeddings,configPreserved:existsSync(i),nextIndexState:"uninitialized"};}finally{await d.close();}return c}function Be(o){let e=[];return e.push("Codebase clear"),e.push(` rootDir: ${o.rootDir}`),o.cleared?(e.push(" \u2713 cleared data"),e.push(` nodes removed: ${o.nodesRemoved}`),e.push(` edges removed: ${o.edgesRemoved}`),e.push(` file hashes removed: ${o.filesRemoved}`),e.push(` embeddings preserved: ${o.embeddingsPreserved?"yes (--keep-embeddings)":"no"}`),e.push(` config preserved: ${o.configPreserved?"\u2713":"\u2717"}`)):(e.push(" \u2717 db not found at .easbot/db/codebase.db \u2014 nothing to clear"),e.push(` config preserved: ${o.configPreserved?"\u2713":"\u2717"}`)),e.push(""),e.push("\u{1F4A1} Next: run `easbot codebase index` to rebuild."),e.join(`
|
|
5
5
|
`)}var Ge=new Set(["backend","schema_version","extraction_version"]);function _o(o){return new Set(["schema_version","extraction_version"]).has(o)?"number":"string"}function ze(o){let e={},n=[];for(let t of o)t==="--json"?e.json=true:t==="--help"||t==="-h"?e.help=true:t.startsWith("-")||n.push(t);return n.length>0&&(e.subcommand=n[0],e.subcommand==="set"?(n.length>1&&(e.key=n[1]),n.length>2&&(e.value=n[2])):n.length>1&&(e.key=n[1])),e}var ko=new Set(["backend","schema_version","extraction_version"]);async function We(o){let e=await b.getConfigPath(),n=await b.exists(),t={rootDir:await b.getRootDir(),configPath:n?e:void 0,exists:n,values:null};if(!n)return t;let i=await b.getCodebaseJson();return i?(o.key?(t.key=o.key,t.value=i[o.key]):t.values={...i},t):{...t,exists:false}}async function Je(o){if(!o.key)throw new b$4.ConfigError({message:"config set requires <key>"});if(o.value===void 0)throw new b$4.ConfigError({message:"config set requires <value> after <key>",field:o.key});if(!Ge.has(o.key))throw new b$4.ConfigError({message:`Unsupported config key: "${o.key}". Allowed: ${Array.from(Ge).join(", ")}`,field:o.key});let e=await b.getConfigPath();if(!await b.exists())throw new b$4.ConfigError({message:`codebase not initialized at ${await b.getRootDir()} \u2014 run \`easbot codebase init\` first`});let n=o.value;if(_o(o.key)==="number"){let l=Number(o.value);if(!Number.isFinite(l))throw new b$4.ConfigError({message:`config key "${o.key}" expects a number, got "${o.value}"`,field:o.key});n=l;}let i=await b.getCodebaseJson()??{},r=i[o.key];return i[o.key]=n,await b.writeCodebaseJson(i),{rootDir:await b.getRootDir(),configPath:e,key:o.key,oldValue:r,newValue:n,requiresRestart:ko.has(o.key)}}function Ke(o){if(!o.exists)return `\u2717 config not found at ${o.configPath??"/.easbot/codebase.json"} \u2014 run \`easbot codebase init\` first`;let e=[];if(e.push(`Codebase config: ${o.configPath}`),o.key!==void 0)e.push(` ${o.key}: ${JSON.stringify(o.value)}`);else if(o.values)for(let[n,t]of Object.entries(o.values))e.push(` ${n}: ${JSON.stringify(t)}`);return e.join(`
|
|
6
6
|
`)}function Ve(o){let e=[];return e.push(`\u2713 ${o.key}: ${JSON.stringify(o.oldValue)} \u2192 ${JSON.stringify(o.newValue)} (${o.configPath})`),o.requiresRestart&&(e.push(""),e.push(" \u26A0\uFE0F this setting affects db connection / sync behavior \u2014 restart CodeBase or run `easbot codebase recreate` for the change to take effect.")),e.join(`
|
|
7
|
-
`)}function Qe(o){let e={};for(let n of o)n==="--schema"?e.schema=true:n==="--force"||n==="-f"?e.force=true:n==="--backup"||n==="-b"?e.backup=true:n==="--dry-run"||n==="-n"?e.dryRun=true:n==="--json"?e.json=true:(n==="--help"||n==="-h")&&(e.help=true);return e}async function Xe(o){let e=await b.getRootDir(),n=a(e),t=c$1(e);if(!existsSync(n)||!existsSync(t))throw new NameErrors.OperationFailedError({message:`codebase not initialized at ${e} \u2014 run \`easbot codebase init\` first`,operation:"codebase-not-initialized",target:e});let{DatabaseManager:i}=await import('./database-manager-
|
|
8
|
-
`)}var Io=Log.create({service:"codebase.cmd.embed"});function tt(o){let e={};for(let n of o)if(n==="--all")e.all=true;else if(n==="--dry-run"||n==="-n")e.dryRun=true;else if(n==="--pending-list"||n==="-p")e.pendingList=true;else if(n.startsWith("--batch=")){let t=parseInt(n.slice(8),10);Number.isFinite(t)&&t>0&&(e.batchSize=t);}else n==="--json"?e.json=true:(n==="--help"||n==="-h")&&(e.help=true);return e}var Oo=200;function jo(o,e=Oo){return o?o.length<=e?o:o.slice(0,e)+"\u2026":""}async function ot(o){var p=[];try{let e=await b.getRootDir();let n=a(e);let t=c$1(e);if(!existsSync(n))throw new NameErrors.OperationFailedError({message:`codebase not initialized at ${e} \u2014 run \`easbot codebase init\` first`,operation:"codebase-not-initialized",target:e});if(!existsSync(t))throw new NameErrors.OperationFailedError({message:`db not found at ${t} \u2014 run \`easbot codebase index\` first to build`,operation:"db-not-found",target:t});let i=Date.now();let r=b$2(p,Io.time("codebaseEmbed",{level:"DEBUG",dbPath:t}));let l=process.env.EASBOT_EMBEDDING_MODEL;if(!o.dryRun&&!l)throw new NameErrors.MissingFieldError({field:"EASBOT_EMBEDDING_MODEL",message:'embed requires an embedding model. Set EASBOT_EMBEDDING_MODEL env var (e.g. "openai/text-embedding-3-small") or pass --dry-run to skip embedding generation and just inspect pending nodes. Call `embed` from within an `easbot` REPL session for actual generation.'});let{CodeBase:s}=await import('./code-base-
|
|
7
|
+
`)}function Qe(o){let e={};for(let n of o)n==="--schema"?e.schema=true:n==="--force"||n==="-f"?e.force=true:n==="--backup"||n==="-b"?e.backup=true:n==="--dry-run"||n==="-n"?e.dryRun=true:n==="--json"?e.json=true:(n==="--help"||n==="-h")&&(e.help=true);return e}async function Xe(o){let e=await b.getRootDir(),n=a(e),t=c$1(e);if(!existsSync(n)||!existsSync(t))throw new NameErrors.OperationFailedError({message:`codebase not initialized at ${e} \u2014 run \`easbot codebase init\` first`,operation:"codebase-not-initialized",target:e});let{DatabaseManager:i}=await import('./database-manager-ZC46AHSS.mjs'),r=new i(t);try{let l=r.db,s=r.isIndexStale(),a=r.getMeta("indexed_with_extraction_version"),d=a?parseInt(a,10):null,c=r.getIndexState(),m=r.getMeta("schema_version"),h=m?parseInt(m,10):0,p={rootDir:e,dbPath:t,wasStale:s,previousVersion:d??null,currentVersion:e$2,applied:!1,schemaMigrated:!1,previousSchemaVersion:h,currentSchemaVersion:h,dryRun:!!o.dryRun,schemaSteps:b$3.map(f=>({id:f.id,description:f.description,status:"pending"})),migrationErrors:[],indexState:c},w;if(o.backup!==!1&&!o.dryRun)try{let f=new Date().toISOString().replace(/[:.]/g,"-");w=join(n,`codebase.db.bak.${f}`),copyFileSync(t,w);for(let k of ["-wal","-shm"]){let g=t+k;existsSync(g)&©FileSync(g,w+k);}p.backupPath=w;}catch(f){let k=errorMeta(f).message;p.recommendation=`Backup failed: ${k}. Continuing without backup.`;}let E=o.schema!==!1;try{let f=c$3(l,a$2,{dryRun:o.dryRun});p.currentSchemaVersion=o.dryRun?f.targetVersion:Math.max(f.currentVersion,f.targetVersion),p.migrationErrors=f.errors.map(g=>({migrationId:g.migrationId,error:g.error}));let k=new Set(f.applied);for(let g of p.schemaSteps)k.has(g.id)&&(g.status=o.dryRun?"pending":"applied");for(let g of p.migrationErrors){let y=p.schemaSteps.find(S=>S.id===g.migrationId);y&&(y.status="failed");}if(p.schemaMigrated=f.applied.length>0&&!o.dryRun,!o.dryRun){let g=d$2(l);p.currentSchemaVersion=g,g>0&&r.setMeta("schema_version",String(g));}}catch(f){let k=errorMeta(f).message;p.migrationErrors.push({migrationId:0,error:k});}let x=s||o.force;return x&&!o.dryRun&&(r.setMeta("indexed_with_extraction_version",String(e$2)),(c==="stale"||c==="failed")&&(r.setIndexState("complete"),p.indexState="complete"),p.applied=!0),o.dryRun?p.migrationErrors.length>0?p.recommendation="dry-run finished. Run without --dry-run to apply.":p.schemaMigrated?p.recommendation="dry-run: schema migration would apply. Run without --dry-run to apply.":p.recommendation="dry-run: nothing to apply.":!x&&!p.schemaMigrated&&p.migrationErrors.length===0?p.recommendation=`Already current (schema_version=${p.currentSchemaVersion}, extraction_version=${e$2}). No upgrade needed.`:p.migrationErrors.length>0?p.recommendation=`Schema migration completed with ${p.migrationErrors.length} error(s). `+(p.backupPath?`Restore from backup: ${p.backupPath}`:"Re-run `recreate` to drop & rebuild."):p.schemaMigrated&&!x?p.recommendation=`Schema migrated (v${p.previousSchemaVersion} \u2192 v${p.currentSchemaVersion}). To apply extraction changes, run \`recreate\` to rebuild data or \`index --force\`.`:p.schemaMigrated&&x?p.recommendation="Schema + extraction metadata both updated. To rebuild data with new extractor, run `recreate` or `index --force`.":p.recommendation="Extraction metadata updated. No schema changes needed.",p}finally{r.close();}}function Ze(o){let e=[];if(e.push(`Codebase upgrade${o.dryRun?" (dry-run)":""}`),e.push(` db: ${o.dbPath}`),o.backupPath&&e.push(` backup: ${o.backupPath}`),e.push(` previous version: ${o.previousVersion??"(none)"}`),e.push(` current version: ${o.currentVersion}`),e.push(` previous schema_version: ${o.previousSchemaVersion}`),e.push(` current schema_version: ${o.currentSchemaVersion}`),e.push(` was stale: ${o.wasStale?"yes":"no"}`),e.push(` applied: ${o.applied?"\u2713":"(noop \u2014 already current)"}`),(o.schemaSteps??[]).length>0){e.push(""),e.push(" schema steps:");for(let n of o.schemaSteps){let t=n.status==="applied"?"\u2713":n.status==="pending"?"\xB7":n.status==="failed"?"\u2717":"-";e.push(` [${t}] v${n.id}: ${n.description}`);}}if((o.migrationErrors??[]).length>0){e.push(""),e.push(` migration errors: ${o.migrationErrors.length}`);for(let n of o.migrationErrors)e.push(` - v${n.migrationId}: ${n.error}`);}return e.push(` index_state: ${o.indexState}`),o.recommendation&&(e.push(""),e.push(` \u{1F4A1} ${o.recommendation}`)),e.join(`
|
|
8
|
+
`)}var Io=Log.create({service:"codebase.cmd.embed"});function tt(o){let e={};for(let n of o)if(n==="--all")e.all=true;else if(n==="--dry-run"||n==="-n")e.dryRun=true;else if(n==="--pending-list"||n==="-p")e.pendingList=true;else if(n.startsWith("--batch=")){let t=parseInt(n.slice(8),10);Number.isFinite(t)&&t>0&&(e.batchSize=t);}else n==="--json"?e.json=true:(n==="--help"||n==="-h")&&(e.help=true);return e}var Oo=200;function jo(o,e=Oo){return o?o.length<=e?o:o.slice(0,e)+"\u2026":""}async function ot(o){var p=[];try{let e=await b.getRootDir();let n=a(e);let t=c$1(e);if(!existsSync(n))throw new NameErrors.OperationFailedError({message:`codebase not initialized at ${e} \u2014 run \`easbot codebase init\` first`,operation:"codebase-not-initialized",target:e});if(!existsSync(t))throw new NameErrors.OperationFailedError({message:`db not found at ${t} \u2014 run \`easbot codebase index\` first to build`,operation:"db-not-found",target:t});let i=Date.now();let r=b$2(p,Io.time("codebaseEmbed",{level:"DEBUG",dbPath:t}));let l=process.env.EASBOT_EMBEDDING_MODEL;if(!o.dryRun&&!l)throw new NameErrors.MissingFieldError({field:"EASBOT_EMBEDDING_MODEL",message:'embed requires an embedding model. Set EASBOT_EMBEDDING_MODEL env var (e.g. "openai/text-embedding-3-small") or pass --dry-run to skip embedding generation and just inspect pending nodes. Call `embed` from within an `easbot` REPL session for actual generation.'});let{CodeBase:s}=await import('./code-base-OBQSRCQ3.mjs');let{DEFAULT_EMBEDDING_CONFIG:a$1,DEFAULT_INDEXER_CONFIG:d,DEFAULT_PARSER_CONFIG:c}=await import('@easbot/types');let m={...a$1,modelId:l??"(dry-run)"};let h=new s({workspaceDir:e,database:{path:t,walMode:!0},embedding:m,indexer:d,parser:c,sync:{onBoot:!1,onSearch:!1,onSessionStart:!1,intervalMs:0}});try{await h.initialize();let x=h.getDatabase(),f=x.getNodeCount(),k=x.queryAll("SELECT node_id FROM node_embeddings"),g=new Set(k.map(C=>C.node_id)),y;if(o.all)y=x.queryAll("SELECT id, name, ast_type, language, file_path, text FROM nodes");else if(g.size===0)y=x.queryAll("SELECT id, name, ast_type, language, file_path, text FROM nodes");else {let C=Array.from(g),v=C.map(()=>"?").join(",");y=x.queryAll(`SELECT id, name, ast_type, language, file_path, text FROM nodes WHERE id NOT IN (${v})`,C);}let S=y.map(C=>({id:C.id,name:C.name,ast_type:C.ast_type,file_path:C.file_path,language:C.language,text_preview:jo(C.text)})),j={rootDir:e,dbPath:t,totalNodes:f,alreadyEmbedded:g.size,newlyEmbedded:0,failed:0,all:!!o.all,dryRun:!!o.dryRun,pendingList:o.pendingList?S:[],duration:Date.now()-i,embeddingModelConfigured:!!l};return o.dryRun?j.recommendation=S.length>0?`dry-run: ${S.length} node(s) pending embedding. Use \`easbot codebase embed\` (without --dry-run) inside an \`easbot\` REPL for actual generation, or \`--pending-list\` to emit this list as JSON.`:"dry-run: all nodes already embedded.":S.length===0?j.recommendation="All nodes already have embeddings. Use --all to force regenerate.":j.recommendation=`${S.length} node(s) pending. Run \`easbot codebase embed --pending-list --json [dir]\` to emit the list, then call \`embed\` from within an \`easbot\` REPL session for actual generation (CLI cannot invoke AI SDK adapters in standalone mode).`,j}finally{await h.close();}}catch(w){var u=w,E=true;}finally{c$2(p,u,E);}}function nt(o){let e=[],n=o.dryRun?" (dry-run)":"";if(e.push(`Codebase embed${n}`),e.push(` db: ${o.dbPath}`),e.push(` mode: ${o.all?"all (force regenerate)":"incremental (only missing)"}`),e.push(` embedding model: ${o.embeddingModelConfigured?"configured":"(none)"}`),e.push(` total nodes: ${o.totalNodes}`),e.push(` already embedded: ${o.alreadyEmbedded}`),e.push(` newly embedded: ${o.newlyEmbedded}`),o.failed>0&&e.push(` failed: ${o.failed}`),e.push(` pending: ${o.pendingList.length}`),e.push(` duration: ${o.duration}ms`),o.dryRun&&o.pendingList.length>0){e.push(""),e.push(" \u{1F4A1} first 5 pending nodes:");for(let t of o.pendingList.slice(0,5))e.push(` - ${t.id} (${t.ast_type})`);}return o.recommendation&&(e.push(""),e.push(` \u{1F4A1} ${o.recommendation}`)),e.join(`
|
|
9
9
|
`)}var st=Log.create({service:"codebase.command.watch"});function it(o){let e={};for(let n of o)if(n.startsWith("--debounce=")){let t=parseInt(n.slice(11),10);Number.isFinite(t)&&t>0&&(e.debounce=t);}else if(n.startsWith("--interval=")){let t=parseInt(n.slice(11),10);Number.isFinite(t)&&t>0&&(e.interval=t);}else if(n.startsWith("--backend=")){let t=n.slice(10);(t==="fs-events"||t==="inotify"||t==="windows"||t==="brute-force"||t==="watchman"||t==="auto")&&(e.backend=t);}else n.startsWith("--ignore=")?(e.ignore||(e.ignore=[]),e.ignore.push(n.slice(9))):n==="--on-load-failure=throw"?e.onLoadFailure="throw":n==="--on-load-failure=warn"?e.onLoadFailure="warn":n==="--json"?e.json=true:(n==="--help"||n==="-h")&&(e.help=true);return e}async function at(o){let e=await b.getRootDir(),n=a(e);existsSync(n)||await I();let t=new a$1({workspaceDir:e,backend:o.backend??"auto",ignorePatterns:o.ignore,onLoadFailure:o.onLoadFailure??"warn"}),i=[];t.on((r,l)=>{let s={event:r,relPath:l,at:Date.now()};i.push(s),st.debug("watch event",{event:r,relPath:l});let a=`[${new Date(s.at).toISOString()}]`,d=r==="add"?"\x1B[32m+ ADD \x1B[0m":r==="change"?"\x1B[33m~ CHANGE\x1B[0m":"\x1B[31m- UNLINK\x1B[0m";process.stdout.write(`${a} ${d} ${l}
|
|
10
10
|
`);}),await t.start();try{await d(n,process.pid);}catch(r){st.warn("failed to write watcher pid",{error:errorMeta(r)});}return {watcher:t,events:i,startTime:Date.now()}}function rt(o){return ["Codebase watcher started"," backend: native @parcel/watcher (real-time FS events)"," debounce: 200ms (event coalescing)",` pid: ${process.pid}`,` initial events: ${o.length}`].join(`
|
|
11
11
|
`)}function ct(o){let e={};for(let n of o)n==="--force"||n==="-f"?e.force=true:n==="--json"?e.json=true:(n==="--help"||n==="-h")&&(e.help=true);return e}async function lt(o){let e$1=await b.getRootDir(),n=a(e$1);existsSync(n)||await I();let t=join(n,".watcher.pid"),i=c(n);if(i===null)return {rootDir:e$1,pidFile:t,pid:null,stopped:false,error:"No watcher running (no .easbot/.watcher.pid found)"};try{return process.kill(i,"SIGTERM"),await e(n),{rootDir:e$1,pidFile:t,pid:i,stopped:!0}}catch(r){await e(n);let l=errorMeta(r).message;return {rootDir:e$1,pidFile:t,pid:i,stopped:false,error:l}}}function dt(o){let e=[];return e.push("Codebase stop"),e.push(` pid file: ${o.pidFile}`),e.push(` pid: ${o.pid??"(none)"}`),e.push(` stopped: ${o.stopped?"\u2713":"\u2717"}`),o.error?(e.push(` error: ${o.error}`),e.push(""),e.push(" \u{1F4A1} If a stale watcher was running, its process may have already exited.")):(e.push(""),e.push(" \u{1F4A1} Use `easbot codebase watch` to start a new watcher session.")),e.join(`
|
|
12
|
-
`)}var Bo=Log.create({service:"codebase.cmd.query"}),Go=200;function ut(o){let e={includeEdges:true,enableEmbedding:true},n=[];for(let t of o)if(t==="--help"||t==="-h")e.help=true;else if(t==="--json")e.json=true;else if(t==="--no-edges")e.includeEdges=false;else if(t==="--no-vector"||t==="--no-embed")e.enableEmbedding=false;else if(t.startsWith("-l=")||t.startsWith("--language="))e.language=t.includes("=")?t.split("=")[1]:void 0;else if(!(t==="-l"||t==="--language"))if(t.startsWith("--ast="))e.astType=t.slice(6);else if(t.startsWith("-n=")||t.startsWith("--max=")){let i=parseInt(t.split("=")[1]??"",10);Number.isFinite(i)&&i>0&&(e.maxResults=i);}else t.startsWith("-")||n.push(t);return n.length>0&&(e.query=n.join(" ")),e}async function mt(o){var h=[];try{let e=await b.getRootDir();let n=a(e);let t=c$1(e);existsSync(n)||await I();if(!existsSync(t))throw new NameErrors.OperationFailedError({message:`db not found at ${t} \u2014 run \`easbot codebase index\` first`,operation:"db-not-found",target:t});let{CodeBase:i}=await import('./code-base-
|
|
12
|
+
`)}var Bo=Log.create({service:"codebase.cmd.query"}),Go=200;function ut(o){let e={includeEdges:true,enableEmbedding:true},n=[];for(let t of o)if(t==="--help"||t==="-h")e.help=true;else if(t==="--json")e.json=true;else if(t==="--no-edges")e.includeEdges=false;else if(t==="--no-vector"||t==="--no-embed")e.enableEmbedding=false;else if(t.startsWith("-l=")||t.startsWith("--language="))e.language=t.includes("=")?t.split("=")[1]:void 0;else if(!(t==="-l"||t==="--language"))if(t.startsWith("--ast="))e.astType=t.slice(6);else if(t.startsWith("-n=")||t.startsWith("--max=")){let i=parseInt(t.split("=")[1]??"",10);Number.isFinite(i)&&i>0&&(e.maxResults=i);}else t.startsWith("-")||n.push(t);return n.length>0&&(e.query=n.join(" ")),e}async function mt(o){var h=[];try{let e=await b.getRootDir();let n=a(e);let t=c$1(e);existsSync(n)||await I();if(!existsSync(t))throw new NameErrors.OperationFailedError({message:`db not found at ${t} \u2014 run \`easbot codebase index\` first`,operation:"db-not-found",target:t});let{CodeBase:i}=await import('./code-base-OBQSRCQ3.mjs');let{DEFAULT_EMBEDDING_CONFIG:r,DEFAULT_INDEXER_CONFIG:l,DEFAULT_PARSER_CONFIG:s,DEFAULT_SEARCH_CONFIG:a$1}=await import('@easbot/types');let d=new i({workspaceDir:e,database:{path:t,walMode:!0},embedding:o.enableEmbedding?r:void 0,indexer:l,parser:s,search:a$1,sync:{onBoot:!1,onSearch:!1,onSessionStart:!1,intervalMs:0}});let c=Date.now();let m=b$2(h,Bo.time("codebaseQuery",{level:"DEBUG",query:o.query}));try{await d.initialize();let x=await d.getQuery().search(o.query??"",{maxResults:o.maxResults??10,language:o.language,astType:o.astType,includeEdges:o.includeEdges,enableEmbedding:o.enableEmbedding});return {rootDir:e,query:o.query??"",totalResults:x.length,results:x.map(f=>({id:f.id,name:f.name,astType:f.ast_type,language:f.language,filePath:f.file_path,startLine:f.start_line??0,endLine:f.end_line??0,snippet:(f.text??"").slice(0,resolveSqlTextLimit(Go)),edgeCount:(f.edges??[]).length})),durationMs:Date.now()-c}}finally{await d.close();}}catch(p){var w=p,u=true;}finally{c$2(h,w,u);}}function gt(o){let e=[];e.push(`Codebase query: ${JSON.stringify(o.query)}`),e.push(` results: ${o.totalResults} (in ${o.durationMs}ms)`);for(let n of o.results)e.push(` ${n.name} (${n.astType}) \u2014 ${n.language} ${n.filePath}:${n.startLine}-${n.endLine} [${n.edgeCount} edges]`),e.push(` ${n.snippet.replace(/\s+/g," ").slice(0,100)}`);return e.join(`
|
|
13
13
|
`)}function ht(o){let e={includeEdges:false},n=[];for(let t of o)if(t==="--help"||t==="-h")e.help=true;else if(t==="--json")e.json=true;else if(t==="--edges")e.includeEdges=true;else if(t.startsWith("--file="))e.file=t.slice(7);else if(t.startsWith("--kind="))e.kind=t.slice(7);else if(t.startsWith("--max=")){let i=parseInt(t.slice(6),10);Number.isFinite(i)&&i>0&&(e.edgesLimit=i);}else t.startsWith("-")||n.push(t);return n.length>0&&(e.name=n[0],e.nodeId=n[0]),e}async function yt(o){if(!o.name&&!o.nodeId)throw new NameErrors.MissingFieldError({field:"name-or-nodeId",message:"node command requires a <name> or <node-id> argument"});let e=await b.getRootDir(),n=a(e),t=c$1(e);if(existsSync(n)||await I(),!existsSync(t))throw new NameErrors.OperationFailedError({message:`db not found at ${t} \u2014 run \`easbot codebase index\` first`,operation:"db-not-found",target:t});let i={workspaceDir:e,rootDir:e},r;try{r=await b$1(i,{name:o.name,nodeId:o.nodeId,file:o.file,kind:o.kind,includeEdges:o.includeEdges??!1,includeContent:!0,maxEdgesPerNode:o.edgesLimit??10});}catch(c){if(c instanceof ServiceError&&c.data?.code==="NOT_FOUND")return {rootDir:e,found:false,incomingEdges:[],outgoingEdges:[]};throw c}if(!r.node)return {rootDir:e,found:false,incomingEdges:[],outgoingEdges:[]};let l=[],s=[],a$1=r.node.name.split("@")[0]??r.node.name,d=a$1.includes(".")?a$1.split(".").pop()??a$1:a$1;for(let c of r.edges){let m;if(c.target===r.node.id)m="in";else if(c.source===r.node.id)m="out";else if(c.target.includes(":*:")){let p=(c.target.split(":").pop()??"").split("@")[0]??"";m=a$1.includes(".")&&p===a$1||p===d?"in":"out";}else m="out";let h={id:c.id,relation:c.relation,source:c.source,target:c.target,direction:m};(m==="in"?l:s).push(h);}return {rootDir:e,found:true,node:{id:r.node.id,name:r.node.name,astType:r.node.ast_type,language:r.node.language,filePath:r.node.file_path,startLine:r.node.start_line??0,endLine:r.node.end_line??0,text:r.node.text??""},incomingEdges:l,outgoingEdges:s}}function xt(o){if(!o.found||!o.node)return `\u2717 node not found (rootDir: ${o.rootDir})`;let e=[];if(e.push(`Codebase node: ${o.node.id}`),e.push(` name: ${o.node.name}`),e.push(` type: ${o.node.astType}`),e.push(` language: ${o.node.language}`),e.push(` location: ${o.node.filePath}:${o.node.startLine}-${o.node.endLine}`),e.push(` edges: ${o.incomingEdges.length} incoming / ${o.outgoingEdges.length} outgoing`),o.incomingEdges.length>0&&typeof o.incomingEdges[0]=="object"&&"relation"in o.incomingEdges[0]){e.push(""),e.push(" incoming edges:");for(let n of o.incomingEdges.slice(0,20))e.push(` [${n.relation}] ${n.source} \u2192 ${n.target}`);e.push(" outgoing edges:");for(let n of o.outgoingEdges.slice(0,20))e.push(` [${n.relation}] ${n.source} \u2192 ${n.target}`);}return e.join(`
|
|
14
|
-
`)}async function Y(o={}){let{CodeBase:e}=await import('./code-base-
|
|
14
|
+
`)}async function Y(o={}){let{CodeBase:e}=await import('./code-base-OBQSRCQ3.mjs'),{DEFAULT_EMBEDDING_CONFIG:n,DEFAULT_INDEXER_CONFIG:t,DEFAULT_PARSER_CONFIG:i,DEFAULT_SEARCH_CONFIG:r,DEFAULT_SYNC_CONFIG:l}=await import('@easbot/types'),s=await b.getRootDir(),a$1=c$1(s),d=a(s);if(!existsSync(d))if(o.autoInit)await I();else throw new NameErrors.OperationFailedError({message:`codebase not initialized at ${s} \u2014 run \`easbot codebase init <dir>\` first`,operation:"codebase-not-initialized",target:s});if(!existsSync(a$1))throw new NameErrors.OperationFailedError({message:`db not found at ${a$1} \u2014 run \`easbot codebase index\` first`,operation:"db-not-found",target:a$1});let c=new e({workspaceDir:s,database:{path:a$1,walMode:true},embedding:n,indexer:t,parser:i,search:r,sync:{...l,onBoot:false,onSearch:false,onSessionStart:false,intervalMs:0},...o.configOverrides});await c.initialize();let m=false;return {codebase:c,rootDir:s,close:async()=>{if(!m){m=true;try{await c.close();}catch{}}}}}function Ct(o){let e={direction:"both"},n=[];for(let t of o)if(t==="--help"||t==="-h")e.help=true;else if(t==="--json")e.json=true;else if(t.startsWith("--depth=")){let i=parseInt(t.slice(8),10);Number.isFinite(i)&&i>0&&(e.depth=i);}else if(t.startsWith("--max=")){let i=parseInt(t.slice(6),10);Number.isFinite(i)&&i>0&&(e.maxNodes=i);}else if(t.startsWith("--direction=")){let i=t.slice(12);(i==="incoming"||i==="outgoing"||i==="both")&&(e.direction=i);}else if(t.startsWith("--relation=")){let i=t.slice(11).split(",").map(r=>r.trim()).filter(Boolean);e.relationTypes=i;}else t.startsWith("-")||n.push(t);return n.length>0&&(e.nodeId=n[0]),e}async function Et(o){if(!o.nodeId)throw new NameErrors.MissingFieldError({field:"nodeId",message:"context command requires a <node-id> argument"});let e=o.depth??2,n=o.maxNodes??100,t=o.direction??"both",{codebase:i,rootDir:r,close:l}=await Y();try{let s=i.getDatabase(),a=i.getQuery();if(!s.getNodeById(o.nodeId))return {rootDir:r,rootNodeId:o.nodeId,depth:e,totalNodes:0,totalEdges:0,nodes:[],edges:[],truncated:!1};let c=new Map,m=[{nodeId:o.nodeId,depth:0}];c.set(o.nodeId,0);let h=[],p=!1;for(;m.length>0;){let f=m.shift();if(f.depth>=e)continue;if(c.size>=n){p=!0;break}let k=a.queryNeighbors(f.nodeId,{direction:t,relationTypes:o.relationTypes,limit:n-c.size+1});for(let g of k.edges){h.push({source:g.source,target:g.target,relation:g.relation});let y=g.source===f.nodeId?g.target:g.source;if(!c.has(y)&&(c.set(y,f.depth+1),m.push({nodeId:y,depth:f.depth+1}),c.size>=n)){p=!0;break}}if(p)break}let w=Array.from(c.keys()),u=w.length>0?s.queryNodes({ids:w}):[],E=new Map(u.map(f=>[f.id,f])),x=[];for(let[f,k]of c.entries()){let g=E.get(f);g&&x.push({id:g.id,name:g.name,astType:g.ast_type,language:g.language,filePath:g.file_path,depth:k});}return {rootDir:r,rootNodeId:o.nodeId,depth:e,totalNodes:x.length,totalEdges:h.length,nodes:x,edges:h,truncated:p}}finally{await l();}}function Rt(o){let e=[];e.push(`Codebase context: ${o.rootNodeId} (depth=${o.depth})`),e.push(` nodes: ${o.totalNodes}${o.truncated?" [TRUNCATED]":""}`),e.push(` edges: ${o.totalEdges}`);for(let n of o.nodes.slice(0,50))e.push(` [d=${n.depth}] ${n.name} (${n.astType}) \u2014 ${n.language} ${n.filePath}`);return o.nodes.length>50&&e.push(` ... and ${o.nodes.length-50} more`),e.join(`
|
|
15
15
|
`)}function _t(o){let e={},n=[];for(let t of o)if(t==="--help"||t==="-h")e.help=true;else if(t==="--json")e.json=true;else if(t.startsWith("-d=")||t.startsWith("--depth=")){let i=parseInt(t.split("=")[1]??"",10);Number.isFinite(i)&&i>0&&(e.depth=i);}else if(t.startsWith("--relation=")){let i=t.slice(11).split(",").map(r=>r.trim()).filter(Boolean);e.relationTypes=i;}else t.startsWith("--file=")?e.file=t.slice(7):t.startsWith("--kind=")?e.kind=t.slice(7):t.startsWith("-")||n.push(t);return n.length>0&&(e.nodeId=n[0]),e}async function kt(o){if(!o.nodeId)throw new NameErrors.MissingFieldError({field:"nodeId",message:"impact command requires a <node-id> argument"});let e=o.depth??3,n=o.relationTypes??["CALLS","REFERENCES","USES"],{rootDir:t,close:i}=await Y(),r={workspaceDir:t,rootDir:t};try{let l=await d$1(r,{name:o.nodeId,nodeId:o.nodeId,file:o.file,kind:o.kind,depth:e,relationTypes:n,maxResults:200});return {rootDir:t,rootNodeId:l.root?.id??o.nodeId,totalImpacted:l.totalImpacted,depth:e,buckets:l.buckets.map(s=>({depth:s.depth,count:s.count,sample:s.sample.map(a=>({id:a.id,name:a.name,filePath:a.filePath}))}))}}finally{await i();}}function Nt(o){let e=[];e.push(`Codebase impact: ${o.rootNodeId} (depth=${o.depth})`),e.push(` total impacted: ${o.totalImpacted}`);for(let n of o.buckets){e.push(` d=${n.depth}: ${n.count} nodes`);for(let t of n.sample.slice(0,5))e.push(` - ${t.name} (${t.filePath})`);}return e.join(`
|
|
16
|
-
`)}var Vo="ts|tsx|js|jsx|mjs|cjs|py|rs|go|java|kt|scala|swift|rb|php|pl|sh|c|cpp|cc|cxx|h|hpp|lua|zig|cs|dart|ex|exs|clj|cljs|vue|svelte",Ho=[new RegExp(`(?:^|/)(?:main|index|app|server)\\.(?:${Vo})$`)];function vt(o){let e={excludeEntry:true};for(let n of o)if(n==="--help"||n==="-h")e.help=true;else if(n==="--json")e.json=true;else if(n==="--no-exclude-entry")e.excludeEntry=false;else if(n.startsWith("--type="))e.astTypes=n.slice(7).split(",").map(t=>t.trim()).filter(Boolean);else if(n.startsWith("--limit=")){let t=parseInt(n.slice(8),10);Number.isFinite(t)&&t>0&&(e.limit=t);}return e}async function It(o){let e=await b.getRootDir(),n=a(e),t=c$1(e);if(existsSync(n)||await I(),!existsSync(t))throw new NameErrors.OperationFailedError({message:`db not found at ${t} \u2014 run \`easbot codebase index\` first`,operation:"db-not-found",target:t});let i=o.astTypes??["function","method","class"],r=o.limit??100,l=o.excludeEntry!==false,{CodeBase:s}=await import('./code-base-
|
|
17
|
-
`)}function Tt(o){let e={relation:"IMPORTS",scope:"file"};for(let n of o)if(n==="--help"||n==="-h")e.help=true;else if(n==="--json")e.json=true;else if(n.startsWith("--relation="))e.relation=n.slice(11);else if(n.startsWith("--scope=")){let t=n.slice(8);(t==="file"||t==="module")&&(e.scope=t);}return e}function Qo(o){let e=0,n=new Map,t=new Map,i=new Set,r=[],l=[];function s(a){n.set(a,e),t.set(a,e),e++,r.push(a),i.add(a);let d=o.get(a)??[];for(let c of d)n.has(c)?i.has(c)&&t.set(a,Math.min(t.get(a),n.get(c))):(s(c),t.set(a,Math.min(t.get(a),t.get(c))));if(t.get(a)===n.get(a)){let c=[],m;do m=r.pop(),i.delete(m),c.push(m);while(m!==a);c.length>1&&l.push(c);}}for(let a of o.keys())n.has(a)||s(a);return l}async function $t(o){let e=await b.getRootDir(),n=a(e),t=c$1(e);if(existsSync(n)||await I(),!existsSync(t))throw new NameErrors.OperationFailedError({message:`db not found at ${t} \u2014 run \`easbot codebase index\` first`,operation:"db-not-found",target:t});let i=o.relation??"IMPORTS",{CodeBase:r}=await import('./code-base-
|
|
18
|
-
`)}function Lt(o){let e={},n=[];for(let t of o)if(t==="--help"||t==="-h")e.help=true;else if(t==="--json")e.json=true;else if(t.startsWith("-d=")||t.startsWith("--depth=")){let i=parseInt(t.split("=")[1]??"",10);Number.isFinite(i)&&i>0&&(e.depth=i);}else if(t.startsWith("--relation=")){let i=t.slice(11).split(",").map(r=>r.trim()).filter(Boolean);e.relationTypes=i;}else t.startsWith("-")||n.push(t);return n.length>0&&(e.fromId=n[0]),n.length>1&&(e.toId=n[1]),e}async function At(o){let e=await b.getRootDir(),n=a(e),t=c$1(e);if(existsSync(n)||await I(),!existsSync(t))throw new NameErrors.OperationFailedError({message:`db not found at ${t} \u2014 run \`easbot codebase index\` first`,operation:"db-not-found",target:t});if(!o.fromId||!o.toId)throw new NameErrors.MissingFieldError({field:"from-to",message:"path command requires <from> and <to> node IDs"});let i=o.depth??6,r=o.relationTypes??["CALLS","IMPORTS"],{CodeBase:l}=await import('./code-base-
|
|
16
|
+
`)}var Vo="ts|tsx|js|jsx|mjs|cjs|py|rs|go|java|kt|scala|swift|rb|php|pl|sh|c|cpp|cc|cxx|h|hpp|lua|zig|cs|dart|ex|exs|clj|cljs|vue|svelte",Ho=[new RegExp(`(?:^|/)(?:main|index|app|server)\\.(?:${Vo})$`)];function vt(o){let e={excludeEntry:true};for(let n of o)if(n==="--help"||n==="-h")e.help=true;else if(n==="--json")e.json=true;else if(n==="--no-exclude-entry")e.excludeEntry=false;else if(n.startsWith("--type="))e.astTypes=n.slice(7).split(",").map(t=>t.trim()).filter(Boolean);else if(n.startsWith("--limit=")){let t=parseInt(n.slice(8),10);Number.isFinite(t)&&t>0&&(e.limit=t);}return e}async function It(o){let e=await b.getRootDir(),n=a(e),t=c$1(e);if(existsSync(n)||await I(),!existsSync(t))throw new NameErrors.OperationFailedError({message:`db not found at ${t} \u2014 run \`easbot codebase index\` first`,operation:"db-not-found",target:t});let i=o.astTypes??["function","method","class"],r=o.limit??100,l=o.excludeEntry!==false,{CodeBase:s}=await import('./code-base-OBQSRCQ3.mjs'),{DEFAULT_EMBEDDING_CONFIG:a$1,DEFAULT_INDEXER_CONFIG:d,DEFAULT_PARSER_CONFIG:c,DEFAULT_SEARCH_CONFIG:m}=await import('@easbot/types'),h=new s({workspaceDir:e,database:{path:t,walMode:true},embedding:a$1,indexer:d,parser:c,search:m,sync:{onBoot:false,onSearch:false,onSessionStart:false,intervalMs:0}});try{await h.initialize();let p=h.getDatabase(),w=h.getQuery(),u=[],E=0,x=["CALLS","IMPORTS","TYPE_REFERENCES"],f=p.queryAll("SELECT DISTINCT target FROM edges WHERE relation IN ('CALLS','IMPORTS','TYPE_REFERENCES')"),k=new Set(f.map(g=>g.target));for(let g of i){let y=p.queryNodes({astType:g,limit:1e5});for(let S of y){if(l&&Ho.some(j=>j.test(S.file_path))){E++;continue}if(!k.has(S.id)&&(u.push({id:S.id,name:S.name,astType:S.ast_type,filePath:S.file_path,startLine:S.start_line??0}),u.length>=r))break}if(u.length>=r)break}return {rootDir:e,totalCandidates:u.length,excludedEntry:E,candidates:u.slice(0,r)}}finally{await h.close();}}function Ot(o){let e=[];e.push("Codebase dead-code"),e.push(` total candidates: ${o.totalCandidates}`),o.excludedEntry>0&&e.push(` excluded (entry files): ${o.excludedEntry}`);for(let n of o.candidates.slice(0,50))e.push(` - ${n.name} (${n.astType}) \u2014 ${n.filePath}:${n.startLine}`);return o.candidates.length>50&&e.push(` ... and ${o.candidates.length-50} more`),e.join(`
|
|
17
|
+
`)}function Tt(o){let e={relation:"IMPORTS",scope:"file"};for(let n of o)if(n==="--help"||n==="-h")e.help=true;else if(n==="--json")e.json=true;else if(n.startsWith("--relation="))e.relation=n.slice(11);else if(n.startsWith("--scope=")){let t=n.slice(8);(t==="file"||t==="module")&&(e.scope=t);}return e}function Qo(o){let e=0,n=new Map,t=new Map,i=new Set,r=[],l=[];function s(a){n.set(a,e),t.set(a,e),e++,r.push(a),i.add(a);let d=o.get(a)??[];for(let c of d)n.has(c)?i.has(c)&&t.set(a,Math.min(t.get(a),n.get(c))):(s(c),t.set(a,Math.min(t.get(a),t.get(c))));if(t.get(a)===n.get(a)){let c=[],m;do m=r.pop(),i.delete(m),c.push(m);while(m!==a);c.length>1&&l.push(c);}}for(let a of o.keys())n.has(a)||s(a);return l}async function $t(o){let e=await b.getRootDir(),n=a(e),t=c$1(e);if(existsSync(n)||await I(),!existsSync(t))throw new NameErrors.OperationFailedError({message:`db not found at ${t} \u2014 run \`easbot codebase index\` first`,operation:"db-not-found",target:t});let i=o.relation??"IMPORTS",{CodeBase:r}=await import('./code-base-OBQSRCQ3.mjs'),{DEFAULT_EMBEDDING_CONFIG:l,DEFAULT_INDEXER_CONFIG:s,DEFAULT_PARSER_CONFIG:a$1,DEFAULT_SEARCH_CONFIG:d}=await import('@easbot/types'),c=new r({workspaceDir:e,database:{path:t,walMode:true},embedding:l,indexer:s,parser:a$1,search:d,sync:{onBoot:false,onSearch:false,onSessionStart:false,intervalMs:0}});try{await c.initialize();let m=c.getDatabase(),h=m.queryNodes({limit:1e5}),p=new Map;for(let y of h){let S=p.get(y.file_path)??[];S.push(y.id),p.set(y.file_path,S);}let w=h.map(y=>y.id),u=new Map;for(let y of h)u.set(y.id,y.file_path);let E;if(w.length===0)E=[];else {let y=w.map(()=>"?").join(",");E=m.queryAll(`SELECT * FROM edges WHERE relation = ? AND source IN (${y})`,[i,...w]);}let x=new Map;for(let y of E){let S=u.get(y.source),j=u.get(y.target);if(!S||!j||S===j)continue;let C=x.get(S);C||(C=new Set,x.set(S,C)),C.add(j);}let f=new Map;for(let[y,S]of x.entries())f.set(y,Array.from(S));let g=Qo(f).map(y=>{let S=[];for(let j=0;j<y.length;j++){let C=y[j],v=x.get(C);if(v)for(let F of v)y.includes(F)&&S.push({source:C,target:F});}return {cycle:y,edges:S}});return {rootDir:e,relation:i,totalCycles:g.length,cycles:g.slice(0,50)}}finally{await c.close();}}function Pt(o){let e=[];e.push(`Codebase circular (relation=${o.relation})`),e.push(` total cycles: ${o.totalCycles}`);for(let n=0;n<o.cycles.length;n++){let t=o.cycles[n];e.push(` cycle #${n+1} (${t.cycle.length} files):`),e.push(` ${t.cycle.join(" \u2192 ")} \u2192 ${t.cycle[0]}`);}return e.join(`
|
|
18
|
+
`)}function Lt(o){let e={},n=[];for(let t of o)if(t==="--help"||t==="-h")e.help=true;else if(t==="--json")e.json=true;else if(t.startsWith("-d=")||t.startsWith("--depth=")){let i=parseInt(t.split("=")[1]??"",10);Number.isFinite(i)&&i>0&&(e.depth=i);}else if(t.startsWith("--relation=")){let i=t.slice(11).split(",").map(r=>r.trim()).filter(Boolean);e.relationTypes=i;}else t.startsWith("-")||n.push(t);return n.length>0&&(e.fromId=n[0]),n.length>1&&(e.toId=n[1]),e}async function At(o){let e=await b.getRootDir(),n=a(e),t=c$1(e);if(existsSync(n)||await I(),!existsSync(t))throw new NameErrors.OperationFailedError({message:`db not found at ${t} \u2014 run \`easbot codebase index\` first`,operation:"db-not-found",target:t});if(!o.fromId||!o.toId)throw new NameErrors.MissingFieldError({field:"from-to",message:"path command requires <from> and <to> node IDs"});let i=o.depth??6,r=o.relationTypes??["CALLS","IMPORTS"],{CodeBase:l}=await import('./code-base-OBQSRCQ3.mjs'),{DEFAULT_EMBEDDING_CONFIG:s,DEFAULT_INDEXER_CONFIG:a$1,DEFAULT_PARSER_CONFIG:d,DEFAULT_SEARCH_CONFIG:c}=await import('@easbot/types'),m=new l({workspaceDir:e,database:{path:t,walMode:true},embedding:s,indexer:a$1,parser:d,search:c,sync:{onBoot:false,onSearch:false,onSessionStart:false,intervalMs:0}});try{await m.initialize();let h=m.getQuery();if(o.fromId===o.toId)return {rootDir:e,found:!0,depth:0,steps:[],pathNodes:[o.fromId]};let p=new Set([o.fromId]),w=new Map,u=[o.fromId],E=!1;e:for(let g=0;g<=i;g++){let y=[];for(let S of u){let j=h.queryNeighbors(S,{direction:"both",relationTypes:r,limit:1e3});for(let C of j.edges){let v=C.source===S?C.target:C.source;if(!p.has(v)){if(p.add(v),w.set(v,{via:S,relation:C.relation}),v===o.toId){E=!0;break e}y.push(v);}}}u.length=0,u.push(...y);}if(!E)return {rootDir:e,found:!1,depth:0,steps:[],pathNodes:[]};let x=[o.toId],f=[],k=o.toId;for(;k!==o.fromId;){let g=w.get(k);if(!g)break;f.unshift({from:g.via,to:k,relation:g.relation}),x.unshift(g.via),k=g.via;}return {rootDir:e,found:!0,depth:f.length,steps:f,pathNodes:x}}finally{await m.close();}}function qt(o){let e=[];if(!o.found)return e.push("Codebase path: NOT FOUND within depth limit"),e.join(`
|
|
19
19
|
`);e.push(`Codebase path: depth=${o.depth}`);for(let n=0;n<o.steps.length;n++){let t=o.steps[n];e.push(` ${n+1}. [${t.relation}] ${t.from} \u2192 ${t.to}`);}return e.join(`
|
|
20
|
-
`)}function Gt(o){let e={};for(let n of o)(n==="--help"||n==="-h")&&(e.help=true);return e}async function zt(o){let e=await b.getRootDir(),n=a(e),t=c$1(e);if(existsSync(n)||await I(),!existsSync(t))throw new NameErrors.OperationFailedError({message:`db not found at ${t} \u2014 run \`easbot codebase index\` first`,operation:"db-not-found",target:t});let{CodeBase:i}=await import('./code-base-
|
|
20
|
+
`)}function Gt(o){let e={};for(let n of o)(n==="--help"||n==="-h")&&(e.help=true);return e}async function zt(o){let e=await b.getRootDir(),n=a(e),t=c$1(e);if(existsSync(n)||await I(),!existsSync(t))throw new NameErrors.OperationFailedError({message:`db not found at ${t} \u2014 run \`easbot codebase index\` first`,operation:"db-not-found",target:t});let{CodeBase:i}=await import('./code-base-OBQSRCQ3.mjs'),{DEFAULT_EMBEDDING_CONFIG:r,DEFAULT_INDEXER_CONFIG:l,DEFAULT_PARSER_CONFIG:s,DEFAULT_SEARCH_CONFIG:a$1}=await import('@easbot/types'),{CodebaseStdioServer:d}=await import('./stdio-server-QAEXVFSI.mjs'),c="0.0.0";try{let u=dirname(fileURLToPath(import.meta.url));for(let E=0;E<8;E++){try{let f=JSON.parse(readFileSync(join(u,"package.json"),"utf-8"));if(f?.name==="@easbot/codebase"&&typeof f.version=="string"){c=f.version;break}}catch{}let x=dirname(u);if(x===u)break;u=x;}}catch{}let m=new i({workspaceDir:e,database:{path:t,walMode:true},embedding:r,indexer:l,parser:s,search:a$1,sync:{onBoot:false,onSearch:false,onSessionStart:false,intervalMs:0}});await m.initialize();let h={id:"easbot-codebase-mcp",name:"EASBot Codebase MCP",version:c,transportType:ServerTransportType.STDIO},p=await d.start(m,h);return {rootDir:e,tools:p.tools}}var an=Log.create({service:"codebase.command.callers"});function Wt(o){let e={maxResults:10},n=[];for(let t of o)if(t==="--help"||t==="-h")e.help=true;else if(t==="--json")e.json=true;else if(t.startsWith("--file="))e.file=t.slice(7);else if(t.startsWith("--kind="))e.kind=t.slice(7);else if(t.startsWith("--max=")){let i=parseInt(t.slice(6),10);Number.isFinite(i)&&i>0&&(e.maxResults=i);}else t.startsWith("-")||n.push(t);return n.length>0&&(e.symbol=n[0]),e}async function Jt(o){if(!o.symbol&&!o.nodeId)throw new NameErrors.MissingFieldError({field:"symbol-or-nodeId",message:"callers command requires a <symbol> or --nodeId argument"});let e=await b.getRootDir(),n=Date.now(),i=await e$1({workspaceDir:e,rootDir:e},{name:o.symbol,nodeId:o.nodeId,file:o.file,kind:o.kind,maxResults:o.maxResults});return an.debug("callers command done",{symbol:o.symbol,count:i.callers.length,rootDir:e}),{rootDir:e,serviceResult:i,durationMs:Date.now()-n}}function Kt(o){let{serviceResult:e,rootDir:n}=o,t=[],i=e.root?.name??"?",r=e.truncated?"+":"";if(t.push(`Callers of \`${i}\` (${e.callers.length}${r}) [${n}]`),e.callers.length===0)t.push(" (no incoming edges)");else for(let l of e.callers)t.push(` - [${l.relation}] \`${l.name}\` ${l.filePath}:${l.startLine}`);return e.callers.length>0&&(t.push(""),t.push("\u{1F4A1} Use `easbot codebase node <name>` to read full source of any caller.")),t.join(`
|
|
21
21
|
`)}var ln=Log.create({service:"codebase.command.callees"});function Vt(o){let e={maxResults:10},n=[];for(let t of o)if(t==="--help"||t==="-h")e.help=true;else if(t==="--json")e.json=true;else if(t.startsWith("--file="))e.file=t.slice(7);else if(t.startsWith("--kind="))e.kind=t.slice(7);else if(t.startsWith("--max=")){let i=parseInt(t.slice(6),10);Number.isFinite(i)&&i>0&&(e.maxResults=i);}else t.startsWith("-")||n.push(t);return n.length>0&&(e.symbol=n[0]),e}async function Ht(o){if(!o.symbol&&!o.nodeId)throw new NameErrors.MissingFieldError({field:"symbol-or-nodeId",message:"callees command requires a <symbol> or --nodeId argument"});let e=await b.getRootDir(),n=Date.now(),i=await f({workspaceDir:e,rootDir:e},{name:o.symbol,nodeId:o.nodeId,file:o.file,kind:o.kind,maxResults:o.maxResults});return ln.debug("callees command done",{symbol:o.symbol,count:i.callees.length,rootDir:e}),{rootDir:e,serviceResult:i,durationMs:Date.now()-n}}function Yt(o){let{serviceResult:e,rootDir:n}=o,t=[],i=e.root?.name??"?",r=e.truncated?"+":"";if(t.push(`Callees of \`${i}\` (${e.callees.length}${r}) [${n}]`),e.callees.length===0)t.push(" (no outgoing edges)");else for(let l of e.callees)t.push(` - [${l.relation}] \`${l.name}\` ${l.filePath}:${l.startLine}`);return e.callees.length>0&&(t.push(""),t.push("\u{1F4A1} Use `easbot codebase node <name>` to read full source of any callee.")),t.join(`
|
|
22
|
-
`)}var un=Log.create({service:"codebase.command.explore"});function Qt(o){let e={maxFiles:5,maxSymbols:3,depth:1,includeContent:true},n=[];for(let t of o)if(t==="--help"||t==="-h")e.help=true;else if(t==="--json")e.json=true;else if(t==="--no-content")e.includeContent=false;else if(t.startsWith("--file="))e.file=t.slice(7);else if(t.startsWith("--kind="))e.kind=t.slice(7);else if(t.startsWith("--max-files=")){let i=parseInt(t.slice(12),10);Number.isFinite(i)&&i>0&&(e.maxFiles=i);}else if(t.startsWith("--max-symbols=")){let i=parseInt(t.slice(14),10);Number.isFinite(i)&&i>0&&(e.maxSymbols=i);}else if(t.startsWith("--depth=")){let i=parseInt(t.slice(8),10);Number.isFinite(i)&&i>0&&(e.depth=i);}else t.startsWith("--intent=")?e.intent=t.slice(9):t.startsWith("-")||n.push(t);return n.length>0&&(e.query=n.join(" ")),e}async function Xt(o){if(!o.query)throw new NameErrors.MissingFieldError({field:"query",message:"explore command requires a <query> argument"});let e=await b.getRootDir(),n=Date.now(),i=await g({workspaceDir:e,rootDir:e},{query:o.query,file:o.file,kind:o.kind,maxFiles:o.maxFiles,maxSymbols:o.maxSymbols,depth:o.depth,includeContent:o.includeContent,intent:o.intent});return un.debug("explore command done",{query:o.query,totalHits:i.totalHits,entryPoints:i.entryPoints.length,rootDir:e}),{rootDir:e,serviceResult:i,durationMs:Date.now()-n}}async function Zt(o){let e={pendingFiles:[],toolName:"codebase_explore",writeToDisk:false};return await F(o.serviceResult,e)}var eo={languages:[{value:"zh-CN",name:"\u7B80\u4F53\u4E2D\u6587",example:"\u4F60\u597D\uFF0CEASBOT\uFF01",supported:true},{value:"en-US",name:"English (United States)",example:"Hello, EASBOT!",supported:true}]};var gn=eo.languages,fn=gn.filter(o=>o.supported).map(o=>o.value),q={defaultLocale:"zh-CN",locales:fn},K={},Q=(o,e)=>{let n=K[o]||{translation:{}};return K[o]={translation:{...n.translation,...e.translation}},K[o]},X=(o=q.defaultLocale)=>(K[o]||Q(o,{translation:{}}),{locale:o,resources:K[o]||{translation:{}}});var bn={translation:{"cli.banner.title":"easbot-codebase \u2014 \u4EE3\u7801\u77E5\u8BC6\u56FE\u8C31","cli.banner.usage":"\u7528\u6CD5: easbot-codebase <command> [options]","cli.banner.section.lifecycle":"\u547D\u4EE4\uFF08\u751F\u547D\u5468\u671F\uFF09:","cli.banner.section.graph":"\u547D\u4EE4\uFF08\u56FE\u67E5\u8BE2\uFF09:","cli.banner.section.external":"\u5916\u90E8\u63A5\u53E3:","cli.banner.hint.run_help":"\u8FD0\u884C `easbot codebase <command> --help` \u67E5\u770B\u8BE6\u60C5\u3002","cli.banner.local.title":"\u72EC\u7ACB CLI:","cli.banner.local.body":"\u672C\u5305\u540C\u65F6\u4F5C\u4E3A\u72EC\u7ACB CLI `easbot-codebase` \u53D1\u5E03\uFF0C\u53EF\u72EC\u7ACB\u4F7F\u7528\u3002","cli.banner.local.agent":"Agent CLI \u7528\u6237: `easbot codebase <command> ...`","cli.banner.local.standalone":"\u72EC\u7ACB\u7528\u6237: `easbot-codebase <command> ...`","cli.cmd.init.summary":"init [dir] \u5728\u76EE\u6807\u76EE\u5F55\u521D\u59CB\u5316 .easbot/codebase.json","cli.cmd.index.summary":"index [dir] \u6784\u5EFA\u5B8C\u6574\u7D22\u5F15","cli.cmd.sync.summary":"sync \u8FD0\u884C\u589E\u91CF\u540C\u6B65","cli.cmd.recreate.summary":"recreate \u4E22\u5F03\u6570\u636E\u5E93 + \u91CD\u65B0\u521D\u59CB\u5316 + \u91CD\u5EFA\u7D22\u5F15\uFF08\u4E00\u6761\u9F99\uFF09","cli.cmd.clear.summary":"clear \u6E05\u7A7A\u6240\u6709\u8282\u70B9/\u8FB9\uFF08\u4FDD\u7559 config.json\uFF09","cli.cmd.status.summary":"status \u663E\u793A\u7D22\u5F15\u72B6\u6001 / \u6570\u636E\u5E93 / \u914D\u7F6E","cli.cmd.doctor.summary":"doctor \u8FD0\u884C\u5065\u5EB7\u68C0\u67E5\uFF08\u540E\u7AEF\u53EF\u7528\u6027\u7B49\uFF09","cli.cmd.config.summary":"config \u8BFB\u53D6/\u8BBE\u7F6E .easbot/codebase.json \u5B57\u6BB5","cli.cmd.upgrade.summary":"upgrade \u5F53 extraction_version \u8FC7\u65F6\u65F6\u66F4\u65B0\u5143\u6570\u636E","cli.cmd.embed.summary":"embed \u751F\u6210\u8282\u70B9\u5D4C\u5165\u5411\u91CF","cli.cmd.watch.summary":"watch \u76D1\u542C\u5DE5\u4F5C\u533A\u6587\u4EF6\u53D8\u66F4\uFF08\u81EA\u52A8\u540C\u6B65\uFF09","cli.cmd.stop.summary":"stop \u505C\u6B62\u6B63\u5728\u8FD0\u884C\u7684\u6587\u4EF6\u76D1\u542C\u5668","cli.cmd.query.summary":"query <q...> \u6DF7\u5408\u641C\u7D22\uFF08FTS + \u5411\u91CF + \u57FA\u7840\uFF09","cli.cmd.node.summary":"node <name|id> \u663E\u793A\u5355\u4E2A\u8282\u70B9\u7684\u8BE6\u60C5","cli.cmd.context.summary":"context <id> \u6784\u5EFA\u8282\u70B9\u5468\u56F4\u7684\u5B50\u56FE\u4E0A\u4E0B\u6587","cli.cmd.impact.summary":"impact <id> \u5F71\u54CD\u534A\u5F84\uFF08BFS \u5165\u8FB9\uFF09","cli.cmd.callers.summary":"callers <sym> \u8C01\u8C03\u7528\u4E86 <symbol>","cli.cmd.callees.summary":"callees <sym> <symbol> \u8C03\u7528\u4E86\u8C01","cli.cmd.explore.summary":"explore <q> \u4E3B\u5DE5\u5177 \u2014 \u4E00\u6B21\u8C03\u7528\u8FD4\u56DE\u6E90\u7801 + \u8C03\u7528\u94FE","cli.cmd.dead_code.summary":"dead-code \u67E5\u627E\u672A\u4F7F\u7528\u7684\u7B26\u53F7","cli.cmd.circular.summary":"circular \u68C0\u6D4B\u5FAA\u73AF\u4F9D\u8D56","cli.cmd.path.summary":"path <from> <to> \u67E5\u627E\u4E24\u4E2A\u8282\u70B9\u4E4B\u95F4\u7684\u6700\u77ED\u8DEF\u5F84","cli.cmd.mcp.summary":"mcp [dir] \u542F\u52A8 stdio MCP \u670D\u52A1\u5668\uFF08\u66B4\u9732 9 \u4E2A codebase \u5DE5\u5177\uFF09","cli.cmd.init.description":"\u5728\u76EE\u6807\u76EE\u5F55\u521D\u59CB\u5316 .easbot/codebase.json","cli.cmd.index.description":"\u6784\u5EFA\u5B8C\u6574\u7D22\u5F15\uFF08\u7F3A\u5931 db \u65F6\u81EA\u52A8\u521B\u5EFA\uFF09","cli.cmd.sync.description":"\u8FD0\u884C\u589E\u91CF\u540C\u6B65\uFF08\u4EC5\u53D8\u66F4\u8FC7\u7684\u6587\u4EF6\uFF09","cli.cmd.recreate.description":"\u4E22\u5F03\u6574\u4E2A\u6570\u636E\u5E93 + \u91CD\u65B0\u521D\u59CB\u5316 + \u91CD\u5EFA\u7D22\u5F15\uFF08\u4E00\u6761\u9F99\uFF09","cli.cmd.clear.description":"\u6E05\u7A7A\u6240\u6709\u8282\u70B9/\u8FB9\uFF08\u4FDD\u7559 config.json\uFF09","cli.cmd.status.description":"\u663E\u793A\u7D22\u5F15\u72B6\u6001 / \u6570\u636E\u5E93 / \u914D\u7F6E","cli.cmd.doctor.description":"\u8FD0\u884C\u5065\u5EB7\u68C0\u67E5\uFF08\u540E\u7AEF / FTS / parser\uFF09","cli.cmd.config.description":"\u8BFB\u53D6/\u8BBE\u7F6E .easbot/codebase.json \u5B57\u6BB5","cli.cmd.upgrade.description":"extraction_version \u8FC7\u65F6\u65F6\u66F4\u65B0\u5143\u6570\u636E","cli.cmd.embed.description":"\u751F\u6210 / \u68C0\u67E5\u8282\u70B9\u5D4C\u5165\u5411\u91CF\uFF08dry-run / pending-list\uFF09","cli.cmd.watch.description":"\u76D1\u542C\u5DE5\u4F5C\u533A\u6587\u4EF6\u53D8\u66F4\uFF08\u81EA\u52A8\u540C\u6B65\uFF09","cli.cmd.stop.description":"\u505C\u6B62\u6B63\u5728\u8FD0\u884C\u7684\u6587\u4EF6\u76D1\u542C\u5668","cli.cmd.query.description":"\u6DF7\u5408\u641C\u7D22\uFF08FTS + \u5411\u91CF + \u57FA\u7840\uFF09","cli.cmd.node.description":"\u663E\u793A\u5355\u4E2A\u8282\u70B9\u7684\u8BE6\u60C5","cli.cmd.context.description":"\u6784\u5EFA\u8282\u70B9\u5468\u56F4\u7684\u5B50\u56FE\u4E0A\u4E0B\u6587","cli.cmd.impact.description":"\u5F71\u54CD\u534A\u5F84\uFF08BFS \u5165\u8FB9\uFF09","cli.cmd.callers.description":"\u8C01\u8C03\u7528\u4E86 <symbol>\uFF08\u5165\u8FB9\uFF09","cli.cmd.callees.description":"<symbol> \u8C03\u7528\u4E86\u8C01\uFF08\u51FA\u8FB9\uFF09","cli.cmd.explore.description":"\u4E3B\u5DE5\u5177 \u2014 \u4E00\u6B21\u8C03\u7528\u8FD4\u56DE\u6E90\u7801 + \u8C03\u7528\u94FE","cli.cmd.dead_code.description":"\u67E5\u627E\u672A\u4F7F\u7528\u7684\u7B26\u53F7","cli.cmd.circular.description":"\u68C0\u6D4B\u5FAA\u73AF\u4F9D\u8D56\uFF08Tarjan SCC\uFF09","cli.cmd.path.description":"\u67E5\u627E\u4E24\u4E2A\u8282\u70B9\u4E4B\u95F4\u7684\u6700\u77ED\u8DEF\u5F84","cli.cmd.mcp.description":"\u542F\u52A8 stdio MCP \u670D\u52A1\u5668\uFF08\u66B4\u9732 9 \u4E2A codebase \u5DE5\u5177\uFF09","cli.shared.show_help":"\u663E\u793A\u6B64\u5E2E\u52A9","cli.init.usage":"\u7528\u6CD5: easbot codebase init [dir] [--force]","cli.init.description":"\u5728\u76EE\u6807\u76EE\u5F55\u521D\u59CB\u5316 .easbot/codebase.json\u3002","cli.init.creates":"\u521B\u5EFA .easbot/codebase.json\uFF0C\u9ED8\u8BA4\u540E\u7AEF\u4E3A better-sqlite3\u3002","cli.init.opt.force":"--force, -f \u8986\u76D6\u5DF2\u5B58\u5728\u7684 config.json","cli.init.exists":"codebase \u914D\u7F6E\u5DF2\u5B58\u5728\u4E8E {{path}}\uFF08\u4F7F\u7528 --force \u8986\u76D6\uFF09","cli.init.created":"\u2713 codebase \u5DF2\u5728 {{path}} \u521D\u59CB\u5316","cli.status.usage":"\u7528\u6CD5: easbot codebase status [--json] [dir]","cli.doctor.usage":"\u7528\u6CD5: easbot codebase doctor [dir]","cli.index.usage":"\u7528\u6CD5: easbot codebase index [dir] [--embed] [--no-embed] [--batch=N] [--json]","cli.index.description":"\u4E3A\u76EE\u6807\u76EE\u5F55\u6784\u5EFA\u5B8C\u6574\u7D22\u5F15\u3002","cli.index.auto_init":"\u5982\u679C .easbot/codebase.json \u4E0D\u5B58\u5728\u4F1A\u81EA\u52A8\u521D\u59CB\u5316\u3002","cli.index.opt.embed":"--embed \u751F\u6210\u8282\u70B9\u5D4C\u5165\u5411\u91CF\uFF08\u9ED8\u8BA4\u8DF3\u8FC7\uFF09","cli.index.opt.no_embed":"--no-embed \u540C\u9ED8\u8BA4\uFF08\u8DF3\u8FC7\u5D4C\u5165\uFF09","cli.index.opt.batch":"--batch=N \u7D22\u5F15\u6279\u5927\u5C0F\uFF08\u9ED8\u8BA4 50\uFF09","cli.index.opt.json":"--json \u4EE5 JSON \u8F93\u51FA\uFF08\u65E0 ANSI \u989C\u8272\uFF09","cli.sync.usage":"\u7528\u6CD5: easbot codebase sync [--embed] [--no-embed] [--quiet] [--json] [dir]","cli.sync.description":"\u8FD0\u884C\u589E\u91CF\u540C\u6B65\uFF08\u4EC5\u589E/\u6539/\u5220\u53D8\u66F4\u8FC7\u7684\u6587\u4EF6\uFF09\u3002","cli.sync.auto_version":"\u6210\u529F\u65F6\u81EA\u52A8\u66F4\u65B0 meta['indexed_with_version']\u3002","cli.sync.opt.embed":"--embed \u542F\u7528\u8282\u70B9\u5D4C\u5165\u5411\u91CF\uFF08\u9ED8\u8BA4\u5173\u95ED\uFF0C\u4EC5 FTS\uFF09","cli.sync.opt.no_embed":"--no-embed \u663E\u5F0F\u7981\u7528\u5D4C\u5165\u5411\u91CF\uFF08\u9ED8\u8BA4\uFF09","cli.sync.opt.quiet":"--quiet, -q \u4EC5\u6253\u5370\u6458\u8981","cli.sync.opt.json":"--json \u4EE5 JSON \u8F93\u51FA\uFF08\u65E0 ANSI \u989C\u8272\uFF09","cli.recreate.usage":"\u7528\u6CD5: easbot codebase recreate [--keep-config] [--no-reindex] [--no-embed] [--force] [--json] [dir]","cli.recreate.description":"\u4E22\u5F03\u6574\u4E2A\u6570\u636E\u5E93\uFF08codebase.db + -wal + -shm\uFF09\uFF0C\u91CD\u65B0\u521D\u59CB\u5316\uFF0C\u5E76\u81EA\u52A8\u91CD\u5EFA\u7D22\u5F15\u3002","cli.recreate.equivalent":"\u7B49\u4EF7\u4E8E codegraph `recreate()`\uFF0C\u7528\u4E8E\u5B89\u5168\u7684\u7D22\u5F15\u6062\u590D\u3002","cli.recreate.opt.keep_config":"--keep-config \u4FDD\u7559 .easbot/codebase.json\uFF08\u4EC5\u5220\u9664 db\uFF09","cli.recreate.opt.no_reindex":"--no-reindex \u8DF3\u8FC7\u81EA\u52A8\u91CD\u5EFA\u7D22\u5F15\u6B65\u9AA4\uFF08\u4E4B\u540E\u9700\u624B\u52A8\u8DD1 `easbot codebase index`\uFF09","cli.recreate.opt.no_embed":"--no-embed \u8F6C\u53D1\u7ED9 runIndex\uFF1A\u8DF3\u8FC7 embedding \u751F\u6210\uFF08\u66F4\u5FEB\uFF09","cli.recreate.opt.force":"--force, -f \u8DF3\u8FC7\u5B89\u5168\u786E\u8BA4\uFF08\u7528\u4E8E\u811A\u672C\uFF09","cli.recreate.opt.json":"--json \u4EE5 JSON \u683C\u5F0F\u8F93\u51FA","cli.recreate.warn":"\u26A0\uFE0F \u8FD9\u4F1A\u5220\u9664\u6574\u4E2A\u7D22\u5F15\u3002\u9ED8\u8BA4\u60C5\u51B5\u4E0B `recreate` \u4F1A\u5728\u540C\u4E00\u6B21\u8C03\u7528\u4E2D\u91CD\u5EFA\u7D22\u5F15\u3002","cli.clear.usage":"\u7528\u6CD5: easbot codebase clear [--keep-embeddings] [--force] [dir]","cli.clear.description":"\u6E05\u7A7A\u6240\u6709\u8282\u70B9/\u8FB9/file_hashes\uFF1B\u4FDD\u7559 config.json \u4E0E meta\u3002","cli.clear.reset_state":'index_state \u91CD\u7F6E\u4E3A "uninitialized"\uFF0C`status` \u4F1A\u5EFA\u8BAE\u8FD0\u884C `index`\u3002',"cli.clear.opt.keep_embeddings":"--keep-embeddings \u4FDD\u7559 node_embeddings / embedding_cache","cli.clear.opt.force":"--force, -f \u8DF3\u8FC7\u5B89\u5168\u786E\u8BA4\uFF08\u7528\u4E8E\u811A\u672C\uFF09","cli.clear.opt.json":"--json \u4EE5 JSON \u683C\u5F0F\u8F93\u51FA","cli.clear.hint":"\u{1F4A1} \u5982\u679C\u60F3\u5220\u9664\u6574\u4E2A db \u6587\u4EF6\uFF0C\u8BF7\u4F7F\u7528 `recreate`\u3002","cli.config.usage":"\u7528\u6CD5: easbot codebase config <get|set> [key] [value] [--json] [dir]","cli.config.description":"\u8BFB\u53D6\u6216\u5199\u5165 .easbot/codebase.json \u5B57\u6BB5\u3002","cli.config.subcommands":"\u5B50\u547D\u4EE4:","cli.config.get":"get [key] \u663E\u793A\u5168\u90E8\u5B57\u6BB5\uFF08\u6216\u67D0\u4E2A\u5B57\u6BB5\uFF09","cli.config.set":"set <key> <value> \u66F4\u65B0\u67D0\u4E2A\u5B57\u6BB5\uFF08\u5FC5\u987B\u5728\u767D\u540D\u5355\u4E2D\uFF09","cli.config.allowed_keys":"\u5141\u8BB8\u7684\u952E: backend, schema_version, extraction_version, index_state","cli.config.opt.json":"--json \u4EE5 JSON \u8F93\u51FA\uFF08\u65E0 ANSI \u989C\u8272\uFF09","cli.config.no_subcommand":"config \u9700\u8981\u5B50\u547D\u4EE4: get | set","cli.config.unknown_subcommand":"\u672A\u77E5\u7684 config \u5B50\u547D\u4EE4: {{subcommand}}","cli.upgrade.usage":"\u7528\u6CD5: easbot codebase upgrade [--schema] [--force] [dir]","cli.upgrade.description":"\u5F53 indexed_with_extraction_version \u8FC7\u65F6\u65F6\u66F4\u65B0\u5143\u6570\u636E\u3002","cli.upgrade.does_not_delete":"\u4E0D\u4F1A\u5220\u9664\u6570\u636E \u2014 \u4F7F\u7528 `recreate` \u5220\u9664\u6574\u4E2A db\u3002","cli.upgrade.opt.schema":"--schema \u540C\u65F6\u91CD\u8DD1 ensureSchema\uFF08\u5E42\u7B49\u7684 CREATE TABLE IF NOT EXISTS\uFF09","cli.upgrade.opt.force":"--force, -f \u5373\u4F7F\u672A\u8FC7\u671F\u4E5F\u66F4\u65B0\u7248\u672C","cli.embed.usage":"\u7528\u6CD5: easbot codebase embed [--all] [--dry-run|-n] [--pending-list|-p] [--batch=N] [--json] [dir]","cli.embed.description":"\u4E3A node_embeddings \u4E2D\u7F3A\u5931\u7684\u8282\u70B9\u751F\u6210\u5D4C\u5165\u5411\u91CF\u3002","cli.embed.statistical_only":"CLI \u4EC5\u505A\u7EDF\u8BA1 \u2014 \u771F\u6B63\u7684\u5D4C\u5165\u751F\u6210\u9700\u8981","cli.embed.repl_required":"\u5728\u6CE8\u5165 EmbeddingModel \u7684 `easbot` REPL \u4F1A\u8BDD\u4E2D\u5B8C\u6210\u3002","cli.embed.opt.all":"--all \u5F3A\u5236\u4E3A\u6240\u6709\u8282\u70B9\u91CD\u65B0\u751F\u6210","cli.embed.opt.dry_run":"--dry-run, -n \u4EC5\u6253\u5370\u7EDF\u8BA1\uFF08CLI \u9ED8\u8BA4\u884C\u4E3A\uFF09","cli.embed.opt.pending":"--pending-list, -p \u5217\u51FA\u5F85\u5D4C\u5165\u7684\u8282\u70B9 id","cli.embed.opt.batch":"--batch=N \u5D4C\u5165\u6279\u5927\u5C0F\uFF08\u9ED8\u8BA4 10\uFF09","cli.embed.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.embed.env.heading":"\u73AF\u5883\u53D8\u91CF:","cli.embed.env.model":"EASBOT_EMBEDDING_MODEL \u5982 openai/text-embedding-3-small","cli.query.usage":"\u7528\u6CD5: easbot codebase query <q...> [--language=<lang>] [--ast=<type>] [--max=N] [--no-edges] [--no-vector|--no-embed] [--json]","cli.query.description":"\u5BF9\u5DF2\u7D22\u5F15\u4EE3\u7801\u8282\u70B9\u505A\u6DF7\u5408\u641C\u7D22\uFF08FTS + \u5411\u91CF + \u57FA\u7840\uFF09\u3002","cli.query.aliases":"\u522B\u540D: search","cli.query.opt.language":"--language=<lang> \u6309\u8BED\u8A00\u8FC7\u6EE4\uFF08ts / js / py / go / ...\uFF09","cli.query.opt.ast":"--ast=<type> \u6309 AST \u7C7B\u578B\u8FC7\u6EE4\uFF08class_declaration / function_declaration / ...\uFF09","cli.query.opt.max":"--max=<N> \u6700\u5927\u7ED3\u679C\u6570\uFF08\u9ED8\u8BA4 20\uFF09","cli.query.opt.no_edges":"--no-edges \u7ED3\u679C\u4E2D\u4E0D\u5305\u542B\u8FB9\uFF08\u9ED8\u8BA4: \u5305\u542B\uFF09","cli.query.opt.no_vector":"--no-vector / --no-embed \u7981\u7528\u5411\u91CF\u641C\u7D22\uFF08\u4EC5 FTS + \u57FA\u7840\uFF0C\u9ED8\u8BA4: \u542F\u7528\u5411\u91CF\uFF09","cli.query.opt.json":"--json JSON \u8F93\u51FA","cli.node.usage":"\u7528\u6CD5: easbot codebase node <name|id> [--file=<path>] [--kind=<kind>] [--edges] [--max=N] [--json]","cli.node.description":"\u663E\u793A\u5355\u4E2A\u8282\u70B9\u7684\u8BE6\u60C5\u3002","cli.node.accepts_name":"\u63A5\u53D7\u7B26\u53F7\u540D <name>\uFF08\u5BF9 LLM \u53CB\u597D\uFF0C\u4E0E tool/MCP \u5BF9\u9F50\uFF09","cli.node.accepts_id":"\u6216\u6765\u81EA `query` / \u6570\u636E\u5E93\u7684\u539F\u59CB <node-id>\u3002","cli.node.opt.file":"--file=<path> \u540C\u540D\u7B26\u53F7\u5B58\u5728\u65F6\u7528\u4E8E\u6D88\u6B67","cli.node.opt.kind":"--kind=<kind> \u6309 AST \u7C7B\u578B\u8FC7\u6EE4/\u6D88\u6B67","cli.node.opt.edges":"--edges \u5305\u542B\u5165\u8FB9/\u51FA\u8FB9\u6C47\u603B","cli.node.opt.max":"--max=<N> \u8FB9\u6570\u91CF\u4E0A\u9650\uFF08\u9ED8\u8BA4 50\uFF09","cli.node.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.context.usage":"\u7528\u6CD5: easbot codebase context <id> [--depth=N] [--max=N] [--direction=<incoming|outgoing|both>] [--relation=<r1,r2,...>] [--json]","cli.context.description":"\u6784\u5EFA\u8282\u70B9\u5468\u56F4\u7684\u5B50\u56FE\u4E0A\u4E0B\u6587\uFF08BFS \u90BB\u63A5 N \u5C42\uFF09\u3002","cli.context.opt.depth":"--depth=<N> BFS \u6DF1\u5EA6\uFF08\u9ED8\u8BA4 2\uFF09","cli.context.opt.max":"--max=<N> \u6700\u5927\u8282\u70B9\u6570\uFF08\u9ED8\u8BA4 100\uFF09","cli.context.opt.direction":"--direction=<dir> incoming | outgoing | both\uFF08\u9ED8\u8BA4 both\uFF09","cli.context.opt.relation":"--relation=<r1,r2,...> \u6309\u5173\u7CFB\u7C7B\u578B\u8FC7\u6EE4\uFF08CALLS / IMPORTS / TYPE_REFERENCES / EXTENDS / IMPLEMENTS / USES / REFERENCES\uFF09","cli.context.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.impact.usage":"\u7528\u6CD5: easbot codebase impact <id> [-d=N | --depth=N] [--relation=<r1,r2,...>] [--json]","cli.impact.description":"\u5F71\u54CD\u534A\u5F84: BFS \u5165\u5411 CALLS / REFERENCES / USES / IMPORTS / TYPE_REFERENCES\uFF0C\u6309\u6DF1\u5EA6\u5206\u6876\u3002","cli.impact.opt.depth":"--depth=<N> BFS \u6DF1\u5EA6\uFF08\u9ED8\u8BA4 3\uFF09","cli.impact.opt.relation":"--relation=<r1,r2,...> \u6309\u5173\u7CFB\u7C7B\u578B\u8FC7\u6EE4","cli.impact.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.callers.usage":"\u7528\u6CD5: easbot codebase callers <symbol> [--node-id=<id>] [--file=<path>] [--kind=<kind>] [--max=N] [--json]","cli.callers.description":"\u8C01\u8C03\u7528\u4E86 <symbol>\uFF08\u5165\u5411 CALLS / IMPORTS / TYPE_REFERENCES / EXTENDS / IMPLEMENTS\uFF09\u3002","cli.callers.accepts":"\u63A5\u53D7\u7B26\u53F7\u540D <symbol>\uFF08\u5BF9 LLM \u53CB\u597D\uFF09\u6216 --node-id \u6307\u5B9A\u539F\u59CB\u8282\u70B9 id\u3002","cli.callers.opt.node_id":"--node-id=<id> \u6765\u81EA `query` / \u6570\u636E\u5E93\u7684\u539F\u59CB\u8282\u70B9 id","cli.callers.opt.file":"--file=<path> \u6587\u4EF6\u8DEF\u5F84\u6216 basename \u7528\u4E8E\u540C\u540D\u7B26\u53F7\u6D88\u6B67","cli.callers.opt.kind":"--kind=<kind> \u6309\u8282\u70B9\u7C7B\u578B\u8FC7\u6EE4\uFF08class_declaration / function_declaration / ...\uFF09","cli.callers.opt.max":"--max=<N> \u6700\u5927\u8C03\u7528\u8005\u6570\uFF08\u9ED8\u8BA4 20\uFF09","cli.callers.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.callees.usage":"\u7528\u6CD5: easbot codebase callees <symbol> [--node-id=<id>] [--file=<path>] [--kind=<kind>] [--max=N] [--json]","cli.callees.description":"<symbol> \u8C03\u7528\u4E86\u8C01\uFF08\u51FA\u5411\u8FB9\uFF09\u3002","cli.callees.accepts":"\u63A5\u53D7\u7B26\u53F7\u540D <symbol>\uFF08\u5BF9 LLM \u53CB\u597D\uFF09\u6216 --node-id \u6307\u5B9A\u539F\u59CB\u8282\u70B9 id\u3002","cli.callees.opt.node_id":"--node-id=<id> \u6765\u81EA `query` / \u6570\u636E\u5E93\u7684\u539F\u59CB\u8282\u70B9 id","cli.callees.opt.file":"--file=<path> \u6587\u4EF6\u8DEF\u5F84\u6216 basename \u7528\u4E8E\u6D88\u6B67","cli.callees.opt.kind":"--kind=<kind> \u6309\u8282\u70B9\u7C7B\u578B\u8FC7\u6EE4","cli.callees.opt.max":"--max=<N> \u6700\u5927\u88AB\u8C03\u7528\u6570\uFF08\u9ED8\u8BA4 20\uFF09","cli.callees.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.explore.usage":"\u7528\u6CD5: easbot codebase explore <query> [--file=<path>] [--kind=<kind>] [--max-files=N] [--max-symbols=N] [--depth=N] [--no-content] [--intent=<ctx>] [--json]","cli.explore.description":"\u4E3B\u5DE5\u5177 \u2014 \u5355\u6B21\u8C03\u7528\u8FD4\u56DE\u6E90\u7801 + \u8C03\u7528\u94FE\u3002","cli.explore.query_help":"<query> \u53EF\u4EE5\u662F\u7B26\u53F7\u540D\u6216\u81EA\u7136\u8BED\u8A00\u3002","cli.explore.opt.file":"--file=<path> \u6587\u4EF6\u8DEF\u5F84\u6216 basename \u7528\u4E8E\u6D88\u6B67","cli.explore.opt.kind":"--kind=<kind> \u6309\u8282\u70B9\u7C7B\u578B\u8FC7\u6EE4","cli.explore.opt.max_files":"--max-files=<N> \u6700\u5927\u5165\u53E3\u6587\u4EF6\u6570\uFF08\u9ED8\u8BA4 5\uFF09","cli.explore.opt.max_symbols":"--max-symbols=<N> \u6BCF\u6587\u4EF6\u6700\u5927\u7B26\u53F7\u6570\uFF08\u9ED8\u8BA4 3\uFF09","cli.explore.opt.depth":"--depth=<N> \u8C03\u7528\u94FE\u7684\u90BB\u63A5\u6DF1\u5EA6\uFF08\u9ED8\u8BA4 1\uFF09","cli.explore.opt.no_content":"--no-content \u4E0D\u5305\u542B\u6E90\u7801\uFF08\u4EC5\u4F4D\u7F6E\uFF0C\u9ED8\u8BA4: \u5305\u542B\uFF09","cli.explore.opt.intent":"--intent=<ctx> \u7528\u4E8E\u6392\u5E8F\u7684 LLM \u4E0A\u4E0B\u6587\u4E32","cli.explore.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.dead_code.usage":"\u7528\u6CD5: easbot codebase dead-code [--type=<t1,t2,...>] [--no-exclude-entry] [--limit=N] [--json]","cli.dead_code.description":"\u67E5\u627E\u65E0\u5165\u8FB9\u7684\u8282\u70B9\uFF08\u542F\u53D1\u5F0F\u6B7B\u4EE3\u7801\uFF09\u3002","cli.dead_code.opt.type":"--type=<t1,t2,...> \u4EC5\u8003\u8651\u8FD9\u4E9B AST \u7C7B\u578B","cli.dead_code.opt.no_exclude_entry":"--no-exclude-entry \u5305\u542B\u5165\u53E3\u6587\u4EF6\uFF08\u9ED8\u8BA4: \u6392\u9664\uFF09","cli.dead_code.opt.limit":"--limit=<N> \u6700\u5927\u7ED3\u679C\u6570\uFF08\u9ED8\u8BA4 100\uFF09","cli.dead_code.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.circular.usage":"\u7528\u6CD5: easbot codebase circular [--relation=<r>] [--scope=<file|module>] [--json]","cli.circular.description":"\u901A\u8FC7 Tarjan SCC \u68C0\u6D4B\u5FAA\u73AF\u4F9D\u8D56\u3002","cli.circular.opt.relation":"--relation=<r> \u8DDF\u968F\u7684\u5173\u7CFB\u7C7B\u578B\uFF08\u9ED8\u8BA4 IMPORTS\uFF09","cli.circular.opt.scope":"--scope=<scope> file | module\uFF08\u9ED8\u8BA4 file\uFF09","cli.circular.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.path.usage":"\u7528\u6CD5: easbot codebase path <from> <to> [-d=N | --depth=N] [--relation=<r1,r2,...>] [--json]","cli.path.description":"\u67E5\u627E\u4E24\u4E2A\u8282\u70B9\u4E4B\u95F4\u7684\u6700\u77ED\u8DEF\u5F84\uFF08\u6CBF CALLS / IMPORTS / TYPE_REFERENCES / USES / REFERENCES \u505A BFS\uFF09\u3002","cli.path.opt.depth":"--depth=<N> BFS \u6DF1\u5EA6\u4E0A\u9650\uFF08\u9ED8\u8BA4 6\uFF09","cli.path.opt.relation":"--relation=<r1,r2,...> \u6309\u5173\u7CFB\u7C7B\u578B\u8FC7\u6EE4","cli.path.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.mcp.usage":"\u7528\u6CD5: easbot codebase mcp [dir]","cli.mcp.description":"\u542F\u52A8 stdio MCP \u670D\u52A1\u5668\uFF0C\u66B4\u9732 9 \u4E2A codebase \u5DE5\u5177:","cli.mcp.tools.1":" query / node / context / impact","cli.mcp.tools.2":" callers / callees / explore","cli.mcp.tools.3":" status / doctor","cli.mcp.transport":"\u901A\u8FC7 stdio JSON-RPC \u4ECE MCP \u5BA2\u6237\u7AEF\u8FDE\u63A5\u3002","cli.watch.usage":"\u7528\u6CD5: easbot codebase watch [--debounce=N] [--interval=N] [dir]","cli.watch.description":"\u76D1\u542C\u5DE5\u4F5C\u533A\u76EE\u5F55\u7684\u6587\u4EF6\u53D8\u66F4\u5E76\u8BB0\u5F55\u4E8B\u4EF6\u3002","cli.watch.pid_file":"\u5728 .easbot/.watcher.pid \u5199\u5165 pid \u6587\u4EF6\uFF0C\u4F9B\u540E\u7EED `stop` \u4F7F\u7528\u3002","cli.watch.opt.debounce":"--debounce=N \u5355\u8DEF\u5F84\u9632\u6296\uFF08\u6BEB\u79D2\uFF0C\u9ED8\u8BA4 200\uFF09","cli.watch.opt.interval":"--interval=N \u8F6E\u8BE2\u95F4\u9694\uFF08\u6BEB\u79D2\uFF0C\u9ED8\u8BA4 500\uFF09","cli.watch.note":"\u6CE8\u610F: \u8BE5\u547D\u4EE4\u4F1A\u963B\u585E\u3002\u6309 Ctrl+C \u9000\u51FA\u3002","cli.stop.usage":"\u7528\u6CD5: easbot codebase stop [dir]","cli.stop.description":"\u505C\u6B62\u7531 .easbot/.watcher.pid \u6807\u8BC6\u7684\u8FD0\u884C\u4E2D\u76D1\u542C\u5668\u3002","cli.stop.opt.force":"--force, -f \u5FFD\u7565\u9519\u8BEF\u5E76\u5F3A\u5236\u6E05\u7406 pid \u6587\u4EF6","cli.shared.options_heading":"\u9009\u9879:","cli.shared.subcommands_heading":"\u5B50\u547D\u4EE4:","cli.shared.environment_heading":"\u73AF\u5883\u53D8\u91CF:","cli.unknown_command":"\u672A\u77E5\u547D\u4EE4: {{command}}","cli.help_hint":"\u8FD0\u884C `easbot codebase --help` \u67E5\u770B\u53EF\u7528\u547D\u4EE4\u3002","cli.signal_cleanup":"[codebase] \u6536\u5230 {{signal}}\uFF0C\u6B63\u5728\u6E05\u7406...","cli.command_failed":"codebase {{command}} \u6267\u884C\u5931\u8D25: {{message}}"}},to=bn;var hn={translation:{"cli.banner.title":"easbot-codebase \u2014 code knowledge graph ecosystem","cli.banner.usage":"Usage: easbot-codebase <command> [options]","cli.banner.section.lifecycle":"Commands (lifecycle):","cli.banner.section.graph":"Commands (graph query):","cli.banner.section.external":"External:","cli.banner.hint.run_help":"Run `easbot codebase <command> --help` for details.","cli.banner.local.title":"Local CLI:","cli.banner.local.body":"This package is also published as `easbot-codebase` for standalone use.","cli.banner.local.agent":"Agent CLI users: `easbot codebase <command> ...`","cli.banner.local.standalone":"Standalone users: `easbot-codebase <command> ...`","cli.cmd.init.summary":"init [dir] Initialize .easbot/codebase.json in the target directory","cli.cmd.index.summary":"index [dir] Build the full index","cli.cmd.sync.summary":"sync Run incremental sync","cli.cmd.recreate.summary":"recreate Drop db, re-init, rebuild index in one step","cli.cmd.clear.summary":"clear Clear all nodes/edges (keep config.json)","cli.cmd.status.summary":"status Show index state / db / config","cli.cmd.doctor.summary":"doctor Run health checks (backend availability, etc.)","cli.cmd.config.summary":"config Get/set .easbot/codebase.json fields","cli.cmd.upgrade.summary":"upgrade Update extraction_version metadata when stale","cli.cmd.embed.summary":"embed Generate node embeddings","cli.cmd.watch.summary":"watch Watch workspace for file changes (auto-sync)","cli.cmd.stop.summary":"stop Stop a running file watcher","cli.cmd.query.summary":"query <q...> Hybrid search (FTS + vector + basic)","cli.cmd.node.summary":"node <name|id> Show details for a single node","cli.cmd.context.summary":"context <id> Build sub-graph context around a node","cli.cmd.impact.summary":"impact <id> Blast radius (BFS incoming edges)","cli.cmd.callers.summary":"callers <sym> Flat list of who calls <symbol>","cli.cmd.callees.summary":"callees <sym> Flat list of what <symbol> calls","cli.cmd.explore.summary":"explore <q> PRIMARY tool \u2014 source code + caller/callee trail in one call","cli.cmd.dead_code.summary":"dead-code Find unused symbols","cli.cmd.circular.summary":"circular Detect circular dependencies","cli.cmd.path.summary":"path <from> <to> Find shortest path between two nodes","cli.cmd.mcp.summary":"mcp [dir] Start stdio MCP server (exposes 9 codebase tools)","cli.cmd.init.description":"Initialize .easbot/codebase.json in the target directory","cli.cmd.index.description":"Build the full index (creates db if missing)","cli.cmd.sync.description":"Run incremental sync (only changed files)","cli.cmd.recreate.description":"Discard the entire db and re-init","cli.cmd.clear.description":"Clear all nodes/edges (keep config.json)","cli.cmd.status.description":"Show index state / db / config","cli.cmd.doctor.description":"Run health checks (backend, FTS, parser)","cli.cmd.config.description":"Get/set .easbot/codebase.json fields","cli.cmd.upgrade.description":"Update extraction_version metadata when stale","cli.cmd.embed.description":"Generate / inspect node embeddings (dry-run / pending-list)","cli.cmd.watch.description":"Watch workspace for file changes (auto-sync)","cli.cmd.stop.description":"Stop a running file watcher","cli.cmd.query.description":"Hybrid search (FTS + vector + basic)","cli.cmd.node.description":"Show details for a single node","cli.cmd.context.description":"Build sub-graph context around a node","cli.cmd.impact.description":"Blast radius (BFS incoming edges)","cli.cmd.callers.description":"Flat list of who calls <symbol> (incoming edges)","cli.cmd.callees.description":"Flat list of what <symbol> calls (outgoing edges)","cli.cmd.explore.description":"PRIMARY tool \u2014 source code + caller/callee trail in one call","cli.cmd.dead_code.description":"Find unused symbols","cli.cmd.circular.description":"Detect circular dependencies (Tarjan SCC)","cli.cmd.path.description":"Find shortest path between two nodes","cli.cmd.mcp.description":"Start stdio MCP server (exposes 9 codebase tools)","cli.shared.show_help":"Show this help","cli.init.usage":"Usage: easbot codebase init [dir] [--force]","cli.init.description":"Initialize .easbot/codebase.json in the target directory.","cli.init.creates":"Creates .easbot/codebase.json with default backend = better-sqlite3.","cli.init.opt.force":"--force, -f Overwrite existing config.json","cli.init.exists":"codebase config already exists at {{path}} (use --force to overwrite)","cli.init.created":"\u2713 codebase initialized at {{path}}","cli.status.usage":"Usage: easbot codebase status [--json] [dir]","cli.doctor.usage":"Usage: easbot codebase doctor [dir]","cli.index.usage":"Usage: easbot codebase index [dir] [--embed] [--no-embed] [--batch=N] [--json]","cli.index.description":"Build the full index for the target directory.","cli.index.auto_init":"Auto-initializes .easbot/codebase.json if it does not exist.","cli.index.opt.embed":"--embed Generate node embeddings (default: skip)","cli.index.opt.no_embed":"--no-embed Same as default (skip embedding)","cli.index.opt.batch":"--batch=N Batch size for indexing (default 50)","cli.index.opt.json":"--json Output as JSON (no ANSI)","cli.sync.usage":"Usage: easbot codebase sync [--embed] [--no-embed] [--quiet] [--json] [dir]","cli.sync.description":"Run incremental sync (only adds/updates/deletes changed files).","cli.sync.auto_version":"Auto-updates meta['indexed_with_version'] on success.","cli.sync.opt.embed":"--embed Enable node embeddings (default off, FTS-only)","cli.sync.opt.no_embed":"--no-embed Explicitly disable embeddings (default)","cli.sync.opt.quiet":"--quiet, -q Only print summary","cli.sync.opt.json":"--json Output as JSON (no ANSI)","cli.recreate.usage":"Usage: easbot codebase recreate [--keep-config] [--no-reindex] [--no-embed] [--force] [--json] [dir]","cli.recreate.description":"Discard the entire db (codebase.db + -wal + -shm), re-init, and rebuild the index in one step.","cli.recreate.equivalent":"Equivalent to codegraph `recreate()` for safe index recovery.","cli.recreate.opt.keep_config":"--keep-config Keep .easbot/codebase.json (only drop db)","cli.recreate.opt.no_reindex":"--no-reindex Skip the auto rebuild-index step (manual `easbot codebase index` required after)","cli.recreate.opt.no_embed":"--no-embed Forward to runIndex: skip embedding generation (faster)","cli.recreate.opt.force":"--force, -f Skip safety prompts (for scripts)","cli.recreate.opt.json":"--json Output as JSON","cli.recreate.warn":"\u26A0\uFE0F This deletes the entire index. By default `recreate` also rebuilds the index in the same call.","cli.clear.usage":"Usage: easbot codebase clear [--keep-embeddings] [--force] [dir]","cli.clear.description":"Clear all nodes/edges/file_hashes; keep config.json and meta.","cli.clear.reset_state":'index_state is reset to "uninitialized" so `status` recommends `index`.',"cli.clear.opt.keep_embeddings":"--keep-embeddings Preserve node_embeddings / embedding_cache","cli.clear.opt.force":"--force, -f Skip safety prompts (for scripts)","cli.clear.opt.json":"--json Output as JSON","cli.clear.hint":"\u{1F4A1} Use `recreate` if you want to drop the entire db file.","cli.config.usage":"Usage: easbot codebase config <get|set> [key] [value] [--json] [dir]","cli.config.description":"Read or write .easbot/codebase.json fields.","cli.config.subcommands":"Subcommands:","cli.config.get":"get [key] Show all fields (or a specific key)","cli.config.set":"set <key> <value> Update a field (must be in allowlist)","cli.config.allowed_keys":"Allowed keys: backend, schema_version, extraction_version, index_state","cli.config.opt.json":"--json Output as JSON (no ANSI)","cli.config.no_subcommand":"config requires a subcommand: get | set","cli.config.unknown_subcommand":"Unknown config subcommand: {{subcommand}}","cli.upgrade.usage":"Usage: easbot codebase upgrade [--schema] [--force] [dir]","cli.upgrade.description":"Update indexed_with_extraction_version metadata when stale.","cli.upgrade.does_not_delete":"Does NOT delete data \u2014 use `recreate` to drop the db entirely.","cli.upgrade.opt.schema":"--schema Also re-run ensureSchema (idempotent CREATE TABLE IF NOT EXISTS)","cli.upgrade.opt.force":"--force, -f Update version even when not stale","cli.embed.usage":"Usage: easbot codebase embed [--all] [--dry-run|-n] [--pending-list|-p] [--batch=N] [--json] [dir]","cli.embed.description":"Generate node embeddings for nodes missing from node_embeddings.","cli.embed.statistical_only":"CLI is statistical-only \u2014 actual embedding generation requires","cli.embed.repl_required":"an `easbot` REPL session with an injected EmbeddingModel.","cli.embed.opt.all":"--all Force regenerate for all nodes","cli.embed.opt.dry_run":"--dry-run, -n Print statistics only (default behavior in CLI)","cli.embed.opt.pending":"--pending-list, -p List node ids that are pending embedding","cli.embed.opt.batch":"--batch=N Embedding batch size (default 10)","cli.embed.opt.json":"--json Output as JSON","cli.embed.env.heading":"Environment:","cli.embed.env.model":"EASBOT_EMBEDDING_MODEL e.g. openai/text-embedding-3-small","cli.query.usage":"Usage: easbot codebase query <q...> [--language=<lang>] [--ast=<type>] [--max=N] [--no-edges] [--no-vector|--no-embed] [--json]","cli.query.description":"Hybrid search (FTS + vector + basic) over indexed code nodes.","cli.query.aliases":"Aliases: search","cli.query.opt.language":"--language=<lang> Filter by language (ts / js / py / go / ...)","cli.query.opt.ast":"--ast=<type> Filter by AST type (class_declaration / function_declaration / ...)","cli.query.opt.max":"--max=<N> Max results (default 20)","cli.query.opt.no_edges":"--no-edges Do not include edges in results (default: include)","cli.query.opt.no_vector":"--no-vector / --no-embed Disable vector search (FTS + basic only, default: vector on)","cli.query.opt.json":"--json JSON output","cli.node.usage":"Usage: easbot codebase node <name|id> [--file=<path>] [--kind=<kind>] [--edges] [--max=N] [--json]","cli.node.description":"Show details for a single node.","cli.node.accepts_name":"Accepts a symbol <name> (LLM workflow friendly, tool/MCP-aligned)","cli.node.accepts_id":"or a raw <node-id> from `query` / database.","cli.node.opt.file":"--file=<path> Disambiguate when same-named symbols exist","cli.node.opt.kind":"--kind=<kind> Filter / disambiguate by AST kind","cli.node.opt.edges":"--edges Include incoming / outgoing edge summaries","cli.node.opt.max":"--max=<N> Edge limit (default 50)","cli.node.opt.json":"--json Output as JSON","cli.context.usage":"Usage: easbot codebase context <id> [--depth=N] [--max=N] [--direction=<incoming|outgoing|both>] [--relation=<r1,r2,...>] [--json]","cli.context.description":"Build a sub-graph context around a node (BFS to N-level neighbors).","cli.context.opt.depth":"--depth=<N> BFS depth (default 2)","cli.context.opt.max":"--max=<N> Max nodes (default 100)","cli.context.opt.direction":"--direction=<dir> incoming | outgoing | both (default both)","cli.context.opt.relation":"--relation=<r1,r2,...> Filter by relation types (CALLS / IMPORTS / TYPE_REFERENCES / EXTENDS / IMPLEMENTS / USES / REFERENCES)","cli.context.opt.json":"--json Output as JSON","cli.impact.usage":"Usage: easbot codebase impact <id> [-d=N | --depth=N] [--relation=<r1,r2,...>] [--json]","cli.impact.description":"Blast radius: BFS incoming CALLS / REFERENCES / USES / IMPORTS / TYPE_REFERENCES, bucketed by depth.","cli.impact.opt.depth":"--depth=<N> BFS depth (default 3)","cli.impact.opt.relation":"--relation=<r1,r2,...> Filter by relation types","cli.impact.opt.json":"--json Output as JSON","cli.callers.usage":"Usage: easbot codebase callers <symbol> [--node-id=<id>] [--file=<path>] [--kind=<kind>] [--max=N] [--json]","cli.callers.description":"Flat list of who calls <symbol> (incoming CALLS / IMPORTS / TYPE_REFERENCES / EXTENDS / IMPLEMENTS).","cli.callers.accepts":"Accepts <symbol> name (LLM-friendly) OR --node-id for raw node id.","cli.callers.opt.node_id":"--node-id=<id> Raw node id from `query` / database","cli.callers.opt.file":"--file=<path> File path or basename to disambiguate when same-named symbols exist","cli.callers.opt.kind":"--kind=<kind> Filter by node kind (class_declaration / function_declaration / ...)","cli.callers.opt.max":"--max=<N> Max callers (default 20)","cli.callers.opt.json":"--json Output as JSON","cli.callees.usage":"Usage: easbot codebase callees <symbol> [--node-id=<id>] [--file=<path>] [--kind=<kind>] [--max=N] [--json]","cli.callees.description":"Flat list of what <symbol> calls (outgoing edges).","cli.callees.accepts":"Accepts <symbol> name (LLM-friendly) OR --node-id for raw node id.","cli.callees.opt.node_id":"--node-id=<id> Raw node id from `query` / database","cli.callees.opt.file":"--file=<path> File path or basename to disambiguate","cli.callees.opt.kind":"--kind=<kind> Filter by node kind","cli.callees.opt.max":"--max=<N> Max callees (default 20)","cli.callees.opt.json":"--json Output as JSON","cli.explore.usage":"Usage: easbot codebase explore <query> [--file=<path>] [--kind=<kind>] [--max-files=N] [--max-symbols=N] [--depth=N] [--no-content] [--intent=<ctx>] [--json]","cli.explore.description":"PRIMARY tool \u2014 single call to get source code + caller/callee trail.","cli.explore.query_help":"<query> can be a symbol name or natural language.","cli.explore.opt.file":"--file=<path> File path or basename to disambiguate","cli.explore.opt.kind":"--kind=<kind> Filter by node kind","cli.explore.opt.max_files":"--max-files=<N> Max entry-point files (default 5)","cli.explore.opt.max_symbols":"--max-symbols=<N> Max symbols per file (default 3)","cli.explore.opt.depth":"--depth=<N> Neighbor depth for caller/callee trail (default 1)","cli.explore.opt.no_content":"--no-content Do not include source code (locations only, default: include)","cli.explore.opt.intent":"--intent=<ctx> LLM context string for ranking","cli.explore.opt.json":"--json Output as JSON","cli.dead_code.usage":"Usage: easbot codebase dead-code [--type=<t1,t2,...>] [--no-exclude-entry] [--limit=N] [--json]","cli.dead_code.description":"Find nodes with no incoming edges (heuristic dead code).","cli.dead_code.opt.type":"--type=<t1,t2,...> Only consider these AST types","cli.dead_code.opt.no_exclude_entry":"--no-exclude-entry Include entry-point files (default: exclude)","cli.dead_code.opt.limit":"--limit=<N> Max results (default 100)","cli.dead_code.opt.json":"--json Output as JSON","cli.circular.usage":"Usage: easbot codebase circular [--relation=<r>] [--scope=<file|module>] [--json]","cli.circular.description":"Detect circular dependencies via Tarjan SCC.","cli.circular.opt.relation":"--relation=<r> Relation type to follow (default IMPORTS)","cli.circular.opt.scope":"--scope=<scope> file | module (default file)","cli.circular.opt.json":"--json Output as JSON","cli.path.usage":"Usage: easbot codebase path <from> <to> [-d=N | --depth=N] [--relation=<r1,r2,...>] [--json]","cli.path.description":"Find shortest path between two nodes (BFS along CALLS / IMPORTS / TYPE_REFERENCES / USES / REFERENCES).","cli.path.opt.depth":"--depth=<N> BFS depth limit (default 6)","cli.path.opt.relation":"--relation=<r1,r2,...> Filter by relation types","cli.path.opt.json":"--json Output as JSON","cli.mcp.usage":"Usage: easbot codebase mcp [dir]","cli.mcp.description":"Start a stdio MCP server exposing 9 codebase tools:","cli.mcp.tools.1":" query / node / context / impact","cli.mcp.tools.2":" callers / callees / explore","cli.mcp.tools.3":" status / doctor","cli.mcp.transport":"Connect from MCP clients via stdio JSON-RPC.","cli.watch.usage":"Usage: easbot codebase watch [--debounce=N] [--interval=N] [dir]","cli.watch.description":"Watch the workspace directory for file changes and log events.","cli.watch.pid_file":"Writes a pid file at .easbot/.watcher.pid for subsequent `stop`.","cli.watch.opt.debounce":"--debounce=N Per-path debounce in ms (default 200)","cli.watch.opt.interval":"--interval=N Polling interval in ms (default 500)","cli.watch.note":"NOTE: This command blocks. Press Ctrl+C to exit.","cli.stop.usage":"Usage: easbot codebase stop [dir]","cli.stop.description":"Stop a running watcher identified by .easbot/.watcher.pid.","cli.stop.opt.force":"--force, -f Ignore errors and clear the pid file anyway","cli.shared.options_heading":"Options:","cli.shared.subcommands_heading":"Subcommands:","cli.shared.environment_heading":"Environment:","cli.unknown_command":"Unknown command: {{command}}","cli.help_hint":"Run `easbot codebase --help` for available commands.","cli.signal_cleanup":"[codebase] received {{signal}}, cleaning up...","cli.command_failed":"codebase {{command}} failed: {{message}}"}},oo=hn;var yn=()=>{X("zh-CN"),X("en-US"),Q("zh-CN",to),Q("en-US",oo);};yn();var ie=new Map;var ae=new Map;var xn=o=>{if(ae.has(o))return ae.get(o);let e=/{{\s*(\w+)\s*}}/g,n=[],t;for(;(t=e.exec(o))!==null;){let l=t[1];l&&!n.includes(l)&&n.push(l);}let i=new RegExp("{{\\s*("+n.join("|")+")\\s*}}","g"),r={keys:n,regex:i};return ae.set(o,r),r},no=(o,e)=>{if(!o||typeof o!="string")return "";if(!e||Object.keys(e).length===0)return o;let{regex:n,keys:t}=xn(o);return t.length===0||!t.some(r=>r in e)?o:o.replace(n,(r,l)=>{let s=e[l];return s==null?"":String(s)})},Sn=o=>{if(o&&q.locales.includes(o))return o;let e=process.env.EASBOT_LANG?.trim()||process.env.LANG?.trim();if(e){let n=e.replace(/_/g,"-");if(q.locales.includes(n))return n;let t=n.split("-")[0];if(t==="zh")return "zh-CN";if(t==="en")return "en-US"}return q.defaultLocale},so=o=>{if(!ie.has(o)){let{resources:e}=X(o);ie.set(o,e);}return ie.get(o)},wn=(o,e={})=>{let n=Sn(e.locale),i=so(n)?.translation[o];if(i&&typeof i=="string"){let r=no(i,e.vars);return r!=null?String(r):String(o)}if(n!==q.defaultLocale){let l=so(q.defaultLocale)?.translation[o];if(l&&typeof l=="string"){let s=no(l,e.vars);return s!=null?String(s):String(o)}}return String(e.fallback??o)},re=wn;var ce=Log.create({service:"codebase.cli"});async function Dn(){try{let{Llm:o}=await import('./llm-WS3XKT46.mjs'),{CodebaseCache:e}=await import('./cache-D7NVUXB2.mjs'),n=await e.getCodebaseJson();o.init({models:{embedding:n?.embedding_model??void 0,evaluation:n?.evaluation_model??void 0},evaluationThreshold:n?.evaluation_threshold});}catch(o){let{errorMeta:e}=await import('@easbot/utils');ce.warn("Llm init failed; Llm-related features will be disabled",{error:e(o)});}}function le(o){return resolveLocaleLang(o?.locale)}function ro(o){let e=(t,i,r)=>re(t,{locale:o,vars:r,fallback:i}),n=(t,i,r)=>{let l=In.filter(s=>s.group===t).map(s=>` ${On(s.name)}${e(s.i18nKey,s.description)}`).join(`
|
|
22
|
+
`)}var un=Log.create({service:"codebase.command.explore"});function Qt(o){let e={maxFiles:5,maxSymbols:3,depth:1,includeContent:true},n=[];for(let t of o)if(t==="--help"||t==="-h")e.help=true;else if(t==="--json")e.json=true;else if(t==="--no-content")e.includeContent=false;else if(t.startsWith("--file="))e.file=t.slice(7);else if(t.startsWith("--kind="))e.kind=t.slice(7);else if(t.startsWith("--max-files=")){let i=parseInt(t.slice(12),10);Number.isFinite(i)&&i>0&&(e.maxFiles=i);}else if(t.startsWith("--max-symbols=")){let i=parseInt(t.slice(14),10);Number.isFinite(i)&&i>0&&(e.maxSymbols=i);}else if(t.startsWith("--depth=")){let i=parseInt(t.slice(8),10);Number.isFinite(i)&&i>0&&(e.depth=i);}else t.startsWith("--intent=")?e.intent=t.slice(9):t.startsWith("-")||n.push(t);return n.length>0&&(e.query=n.join(" ")),e}async function Xt(o){if(!o.query)throw new NameErrors.MissingFieldError({field:"query",message:"explore command requires a <query> argument"});let e=await b.getRootDir(),n=Date.now(),i=await g({workspaceDir:e,rootDir:e},{query:o.query,file:o.file,kind:o.kind,maxFiles:o.maxFiles,maxSymbols:o.maxSymbols,depth:o.depth,includeContent:o.includeContent,intent:o.intent});return un.debug("explore command done",{query:o.query,totalHits:i.totalHits,entryPoints:i.entryPoints.length,rootDir:e}),{rootDir:e,serviceResult:i,durationMs:Date.now()-n}}async function Zt(o){let e={pendingFiles:[],toolName:"codebase_explore",writeToDisk:false};return await F(o.serviceResult,e)}var eo={languages:[{value:"zh-CN",name:"\u7B80\u4F53\u4E2D\u6587",example:"\u4F60\u597D\uFF0CEASBOT\uFF01",supported:true},{value:"en-US",name:"English (United States)",example:"Hello, EASBOT!",supported:true}]};var gn=eo.languages,fn=gn.filter(o=>o.supported).map(o=>o.value),q={defaultLocale:"zh-CN",locales:fn},K={},Q=(o,e)=>{let n=K[o]||{translation:{}};return K[o]={translation:{...n.translation,...e.translation}},K[o]},X=(o=q.defaultLocale)=>(K[o]||Q(o,{translation:{}}),{locale:o,resources:K[o]||{translation:{}}});var bn={translation:{"cli.banner.title":"easbot-codebase \u2014 \u4EE3\u7801\u77E5\u8BC6\u56FE\u8C31","cli.banner.usage":"\u7528\u6CD5: easbot-codebase <command> [options]","cli.banner.section.lifecycle":"\u547D\u4EE4\uFF08\u751F\u547D\u5468\u671F\uFF09:","cli.banner.section.graph":"\u547D\u4EE4\uFF08\u56FE\u67E5\u8BE2\uFF09:","cli.banner.section.external":"\u5916\u90E8\u63A5\u53E3:","cli.banner.hint.run_help":"\u8FD0\u884C `easbot codebase <command> --help` \u67E5\u770B\u8BE6\u60C5\u3002","cli.banner.local.title":"\u72EC\u7ACB CLI:","cli.banner.local.body":"\u672C\u5305\u540C\u65F6\u4F5C\u4E3A\u72EC\u7ACB CLI `easbot-codebase` \u53D1\u5E03\uFF0C\u53EF\u72EC\u7ACB\u4F7F\u7528\u3002","cli.banner.local.agent":"Agent CLI \u7528\u6237: `easbot codebase <command> ...`","cli.banner.local.standalone":"\u72EC\u7ACB\u7528\u6237: `easbot-codebase <command> ...`","cli.cmd.init.summary":"init [dir] \u5728\u76EE\u6807\u76EE\u5F55\u521D\u59CB\u5316 .easbot/codebase.json","cli.cmd.index.summary":"index [dir] \u6784\u5EFA\u5B8C\u6574\u7D22\u5F15","cli.cmd.sync.summary":"sync \u8FD0\u884C\u589E\u91CF\u540C\u6B65","cli.cmd.recreate.summary":"recreate \u4E22\u5F03\u6570\u636E\u5E93 + \u91CD\u65B0\u521D\u59CB\u5316 + \u91CD\u5EFA\u7D22\u5F15\uFF08\u4E00\u6761\u9F99\uFF09","cli.cmd.clear.summary":"clear \u6E05\u7A7A\u6240\u6709\u8282\u70B9/\u8FB9\uFF08\u4FDD\u7559 config.json\uFF09","cli.cmd.status.summary":"status \u663E\u793A\u7D22\u5F15\u72B6\u6001 / \u6570\u636E\u5E93 / \u914D\u7F6E","cli.cmd.doctor.summary":"doctor \u8FD0\u884C\u5065\u5EB7\u68C0\u67E5\uFF08\u540E\u7AEF\u53EF\u7528\u6027\u7B49\uFF09","cli.cmd.config.summary":"config \u8BFB\u53D6/\u8BBE\u7F6E .easbot/codebase.json \u5B57\u6BB5","cli.cmd.upgrade.summary":"upgrade \u5F53 extraction_version \u8FC7\u65F6\u65F6\u66F4\u65B0\u5143\u6570\u636E","cli.cmd.embed.summary":"embed \u751F\u6210\u8282\u70B9\u5D4C\u5165\u5411\u91CF","cli.cmd.watch.summary":"watch \u76D1\u542C\u5DE5\u4F5C\u533A\u6587\u4EF6\u53D8\u66F4\uFF08\u81EA\u52A8\u540C\u6B65\uFF09","cli.cmd.stop.summary":"stop \u505C\u6B62\u6B63\u5728\u8FD0\u884C\u7684\u6587\u4EF6\u76D1\u542C\u5668","cli.cmd.query.summary":"query <q...> \u6DF7\u5408\u641C\u7D22\uFF08FTS + \u5411\u91CF + \u57FA\u7840\uFF09","cli.cmd.node.summary":"node <name|id> \u663E\u793A\u5355\u4E2A\u8282\u70B9\u7684\u8BE6\u60C5","cli.cmd.context.summary":"context <id> \u6784\u5EFA\u8282\u70B9\u5468\u56F4\u7684\u5B50\u56FE\u4E0A\u4E0B\u6587","cli.cmd.impact.summary":"impact <id> \u5F71\u54CD\u534A\u5F84\uFF08BFS \u5165\u8FB9\uFF09","cli.cmd.callers.summary":"callers <sym> \u8C01\u8C03\u7528\u4E86 <symbol>","cli.cmd.callees.summary":"callees <sym> <symbol> \u8C03\u7528\u4E86\u8C01","cli.cmd.explore.summary":"explore <q> \u4E3B\u5DE5\u5177 \u2014 \u4E00\u6B21\u8C03\u7528\u8FD4\u56DE\u6E90\u7801 + \u8C03\u7528\u94FE","cli.cmd.dead_code.summary":"dead-code \u67E5\u627E\u672A\u4F7F\u7528\u7684\u7B26\u53F7","cli.cmd.circular.summary":"circular \u68C0\u6D4B\u5FAA\u73AF\u4F9D\u8D56","cli.cmd.path.summary":"path <from> <to> \u67E5\u627E\u4E24\u4E2A\u8282\u70B9\u4E4B\u95F4\u7684\u6700\u77ED\u8DEF\u5F84","cli.cmd.mcp.summary":"mcp [dir] \u542F\u52A8 stdio MCP \u670D\u52A1\u5668\uFF08\u66B4\u9732 9 \u4E2A codebase \u5DE5\u5177\uFF09","cli.cmd.init.description":"\u5728\u76EE\u6807\u76EE\u5F55\u521D\u59CB\u5316 .easbot/codebase.json","cli.cmd.index.description":"\u6784\u5EFA\u5B8C\u6574\u7D22\u5F15\uFF08\u7F3A\u5931 db \u65F6\u81EA\u52A8\u521B\u5EFA\uFF09","cli.cmd.sync.description":"\u8FD0\u884C\u589E\u91CF\u540C\u6B65\uFF08\u4EC5\u53D8\u66F4\u8FC7\u7684\u6587\u4EF6\uFF09","cli.cmd.recreate.description":"\u4E22\u5F03\u6574\u4E2A\u6570\u636E\u5E93 + \u91CD\u65B0\u521D\u59CB\u5316 + \u91CD\u5EFA\u7D22\u5F15\uFF08\u4E00\u6761\u9F99\uFF09","cli.cmd.clear.description":"\u6E05\u7A7A\u6240\u6709\u8282\u70B9/\u8FB9\uFF08\u4FDD\u7559 config.json\uFF09","cli.cmd.status.description":"\u663E\u793A\u7D22\u5F15\u72B6\u6001 / \u6570\u636E\u5E93 / \u914D\u7F6E","cli.cmd.doctor.description":"\u8FD0\u884C\u5065\u5EB7\u68C0\u67E5\uFF08\u540E\u7AEF / FTS / parser\uFF09","cli.cmd.config.description":"\u8BFB\u53D6/\u8BBE\u7F6E .easbot/codebase.json \u5B57\u6BB5","cli.cmd.upgrade.description":"extraction_version \u8FC7\u65F6\u65F6\u66F4\u65B0\u5143\u6570\u636E","cli.cmd.embed.description":"\u751F\u6210 / \u68C0\u67E5\u8282\u70B9\u5D4C\u5165\u5411\u91CF\uFF08dry-run / pending-list\uFF09","cli.cmd.watch.description":"\u76D1\u542C\u5DE5\u4F5C\u533A\u6587\u4EF6\u53D8\u66F4\uFF08\u81EA\u52A8\u540C\u6B65\uFF09","cli.cmd.stop.description":"\u505C\u6B62\u6B63\u5728\u8FD0\u884C\u7684\u6587\u4EF6\u76D1\u542C\u5668","cli.cmd.query.description":"\u6DF7\u5408\u641C\u7D22\uFF08FTS + \u5411\u91CF + \u57FA\u7840\uFF09","cli.cmd.node.description":"\u663E\u793A\u5355\u4E2A\u8282\u70B9\u7684\u8BE6\u60C5","cli.cmd.context.description":"\u6784\u5EFA\u8282\u70B9\u5468\u56F4\u7684\u5B50\u56FE\u4E0A\u4E0B\u6587","cli.cmd.impact.description":"\u5F71\u54CD\u534A\u5F84\uFF08BFS \u5165\u8FB9\uFF09","cli.cmd.callers.description":"\u8C01\u8C03\u7528\u4E86 <symbol>\uFF08\u5165\u8FB9\uFF09","cli.cmd.callees.description":"<symbol> \u8C03\u7528\u4E86\u8C01\uFF08\u51FA\u8FB9\uFF09","cli.cmd.explore.description":"\u4E3B\u5DE5\u5177 \u2014 \u4E00\u6B21\u8C03\u7528\u8FD4\u56DE\u6E90\u7801 + \u8C03\u7528\u94FE","cli.cmd.dead_code.description":"\u67E5\u627E\u672A\u4F7F\u7528\u7684\u7B26\u53F7","cli.cmd.circular.description":"\u68C0\u6D4B\u5FAA\u73AF\u4F9D\u8D56\uFF08Tarjan SCC\uFF09","cli.cmd.path.description":"\u67E5\u627E\u4E24\u4E2A\u8282\u70B9\u4E4B\u95F4\u7684\u6700\u77ED\u8DEF\u5F84","cli.cmd.mcp.description":"\u542F\u52A8 stdio MCP \u670D\u52A1\u5668\uFF08\u66B4\u9732 9 \u4E2A codebase \u5DE5\u5177\uFF09","cli.shared.show_help":"\u663E\u793A\u6B64\u5E2E\u52A9","cli.init.usage":"\u7528\u6CD5: easbot codebase init [dir] [--force]","cli.init.description":"\u5728\u76EE\u6807\u76EE\u5F55\u521D\u59CB\u5316 .easbot/codebase.json\u3002","cli.init.creates":"\u521B\u5EFA .easbot/codebase.json\uFF0C\u9ED8\u8BA4\u540E\u7AEF\u4E3A better-sqlite3\u3002","cli.init.opt.force":"--force, -f \u8986\u76D6\u5DF2\u5B58\u5728\u7684 config.json","cli.init.exists":"codebase \u914D\u7F6E\u5DF2\u5B58\u5728\u4E8E {{path}}\uFF08\u4F7F\u7528 --force \u8986\u76D6\uFF09","cli.init.created":"\u2713 codebase \u5DF2\u5728 {{path}} \u521D\u59CB\u5316","cli.status.usage":"\u7528\u6CD5: easbot codebase status [--json] [dir]","cli.doctor.usage":"\u7528\u6CD5: easbot codebase doctor [dir]","cli.index.usage":"\u7528\u6CD5: easbot codebase index [dir] [--embed] [--no-embed] [--batch=N] [--json]","cli.index.description":"\u4E3A\u76EE\u6807\u76EE\u5F55\u6784\u5EFA\u5B8C\u6574\u7D22\u5F15\u3002","cli.index.auto_init":"\u5982\u679C .easbot/codebase.json \u4E0D\u5B58\u5728\u4F1A\u81EA\u52A8\u521D\u59CB\u5316\u3002","cli.index.opt.embed":"--embed \u751F\u6210\u8282\u70B9\u5D4C\u5165\u5411\u91CF\uFF08\u9ED8\u8BA4\u8DF3\u8FC7\uFF09","cli.index.opt.no_embed":"--no-embed \u540C\u9ED8\u8BA4\uFF08\u8DF3\u8FC7\u5D4C\u5165\uFF09","cli.index.opt.batch":"--batch=N \u7D22\u5F15\u6279\u5927\u5C0F\uFF08\u9ED8\u8BA4 50\uFF09","cli.index.opt.json":"--json \u4EE5 JSON \u8F93\u51FA\uFF08\u65E0 ANSI \u989C\u8272\uFF09","cli.sync.usage":"\u7528\u6CD5: easbot codebase sync [--embed] [--no-embed] [--quiet] [--json] [dir]","cli.sync.description":"\u8FD0\u884C\u589E\u91CF\u540C\u6B65\uFF08\u4EC5\u589E/\u6539/\u5220\u53D8\u66F4\u8FC7\u7684\u6587\u4EF6\uFF09\u3002","cli.sync.auto_version":"\u6210\u529F\u65F6\u81EA\u52A8\u66F4\u65B0 meta['indexed_with_version']\u3002","cli.sync.opt.embed":"--embed \u542F\u7528\u8282\u70B9\u5D4C\u5165\u5411\u91CF\uFF08\u9ED8\u8BA4\u5173\u95ED\uFF0C\u4EC5 FTS\uFF09","cli.sync.opt.no_embed":"--no-embed \u663E\u5F0F\u7981\u7528\u5D4C\u5165\u5411\u91CF\uFF08\u9ED8\u8BA4\uFF09","cli.sync.opt.quiet":"--quiet, -q \u4EC5\u6253\u5370\u6458\u8981","cli.sync.opt.json":"--json \u4EE5 JSON \u8F93\u51FA\uFF08\u65E0 ANSI \u989C\u8272\uFF09","cli.recreate.usage":"\u7528\u6CD5: easbot codebase recreate [--keep-config] [--no-reindex] [--no-embed] [--force] [--json] [dir]","cli.recreate.description":"\u4E22\u5F03\u6574\u4E2A\u6570\u636E\u5E93\uFF08codebase.db + -wal + -shm\uFF09\uFF0C\u91CD\u65B0\u521D\u59CB\u5316\uFF0C\u5E76\u81EA\u52A8\u91CD\u5EFA\u7D22\u5F15\u3002","cli.recreate.equivalent":"\u7B49\u4EF7\u4E8E codegraph `recreate()`\uFF0C\u7528\u4E8E\u5B89\u5168\u7684\u7D22\u5F15\u6062\u590D\u3002","cli.recreate.opt.keep_config":"--keep-config \u4FDD\u7559 .easbot/codebase.json\uFF08\u4EC5\u5220\u9664 db\uFF09","cli.recreate.opt.no_reindex":"--no-reindex \u8DF3\u8FC7\u81EA\u52A8\u91CD\u5EFA\u7D22\u5F15\u6B65\u9AA4\uFF08\u4E4B\u540E\u9700\u624B\u52A8\u8DD1 `easbot codebase index`\uFF09","cli.recreate.opt.no_embed":"--no-embed \u8F6C\u53D1\u7ED9 runIndex\uFF1A\u8DF3\u8FC7 embedding \u751F\u6210\uFF08\u66F4\u5FEB\uFF09","cli.recreate.opt.force":"--force, -f \u8DF3\u8FC7\u5B89\u5168\u786E\u8BA4\uFF08\u7528\u4E8E\u811A\u672C\uFF09","cli.recreate.opt.json":"--json \u4EE5 JSON \u683C\u5F0F\u8F93\u51FA","cli.recreate.warn":"\u26A0\uFE0F \u8FD9\u4F1A\u5220\u9664\u6574\u4E2A\u7D22\u5F15\u3002\u9ED8\u8BA4\u60C5\u51B5\u4E0B `recreate` \u4F1A\u5728\u540C\u4E00\u6B21\u8C03\u7528\u4E2D\u91CD\u5EFA\u7D22\u5F15\u3002","cli.clear.usage":"\u7528\u6CD5: easbot codebase clear [--keep-embeddings] [--force] [dir]","cli.clear.description":"\u6E05\u7A7A\u6240\u6709\u8282\u70B9/\u8FB9/file_hashes\uFF1B\u4FDD\u7559 config.json \u4E0E meta\u3002","cli.clear.reset_state":'index_state \u91CD\u7F6E\u4E3A "uninitialized"\uFF0C`status` \u4F1A\u5EFA\u8BAE\u8FD0\u884C `index`\u3002',"cli.clear.opt.keep_embeddings":"--keep-embeddings \u4FDD\u7559 node_embeddings / embedding_cache","cli.clear.opt.force":"--force, -f \u8DF3\u8FC7\u5B89\u5168\u786E\u8BA4\uFF08\u7528\u4E8E\u811A\u672C\uFF09","cli.clear.opt.json":"--json \u4EE5 JSON \u683C\u5F0F\u8F93\u51FA","cli.clear.hint":"\u{1F4A1} \u5982\u679C\u60F3\u5220\u9664\u6574\u4E2A db \u6587\u4EF6\uFF0C\u8BF7\u4F7F\u7528 `recreate`\u3002","cli.config.usage":"\u7528\u6CD5: easbot codebase config <get|set> [key] [value] [--json] [dir]","cli.config.description":"\u8BFB\u53D6\u6216\u5199\u5165 .easbot/codebase.json \u5B57\u6BB5\u3002","cli.config.subcommands":"\u5B50\u547D\u4EE4:","cli.config.get":"get [key] \u663E\u793A\u5168\u90E8\u5B57\u6BB5\uFF08\u6216\u67D0\u4E2A\u5B57\u6BB5\uFF09","cli.config.set":"set <key> <value> \u66F4\u65B0\u67D0\u4E2A\u5B57\u6BB5\uFF08\u5FC5\u987B\u5728\u767D\u540D\u5355\u4E2D\uFF09","cli.config.allowed_keys":"\u5141\u8BB8\u7684\u952E: backend, schema_version, extraction_version, index_state","cli.config.opt.json":"--json \u4EE5 JSON \u8F93\u51FA\uFF08\u65E0 ANSI \u989C\u8272\uFF09","cli.config.no_subcommand":"config \u9700\u8981\u5B50\u547D\u4EE4: get | set","cli.config.unknown_subcommand":"\u672A\u77E5\u7684 config \u5B50\u547D\u4EE4: {{subcommand}}","cli.upgrade.usage":"\u7528\u6CD5: easbot codebase upgrade [--schema] [--force] [dir]","cli.upgrade.description":"\u5F53 indexed_with_extraction_version \u8FC7\u65F6\u65F6\u66F4\u65B0\u5143\u6570\u636E\u3002","cli.upgrade.does_not_delete":"\u4E0D\u4F1A\u5220\u9664\u6570\u636E \u2014 \u4F7F\u7528 `recreate` \u5220\u9664\u6574\u4E2A db\u3002","cli.upgrade.opt.schema":"--schema \u540C\u65F6\u91CD\u8DD1 ensureSchema\uFF08\u5E42\u7B49\u7684 CREATE TABLE IF NOT EXISTS\uFF09","cli.upgrade.opt.force":"--force, -f \u5373\u4F7F\u672A\u8FC7\u671F\u4E5F\u66F4\u65B0\u7248\u672C","cli.embed.usage":"\u7528\u6CD5: easbot codebase embed [--all] [--dry-run|-n] [--pending-list|-p] [--batch=N] [--json] [dir]","cli.embed.description":"\u4E3A node_embeddings \u4E2D\u7F3A\u5931\u7684\u8282\u70B9\u751F\u6210\u5D4C\u5165\u5411\u91CF\u3002","cli.embed.statistical_only":"CLI \u4EC5\u505A\u7EDF\u8BA1 \u2014 \u771F\u6B63\u7684\u5D4C\u5165\u751F\u6210\u9700\u8981","cli.embed.repl_required":"\u5728\u6CE8\u5165 EmbeddingModel \u7684 `easbot` REPL \u4F1A\u8BDD\u4E2D\u5B8C\u6210\u3002","cli.embed.opt.all":"--all \u5F3A\u5236\u4E3A\u6240\u6709\u8282\u70B9\u91CD\u65B0\u751F\u6210","cli.embed.opt.dry_run":"--dry-run, -n \u4EC5\u6253\u5370\u7EDF\u8BA1\uFF08CLI \u9ED8\u8BA4\u884C\u4E3A\uFF09","cli.embed.opt.pending":"--pending-list, -p \u5217\u51FA\u5F85\u5D4C\u5165\u7684\u8282\u70B9 id","cli.embed.opt.batch":"--batch=N \u5D4C\u5165\u6279\u5927\u5C0F\uFF08\u9ED8\u8BA4 10\uFF09","cli.embed.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.embed.env.heading":"\u73AF\u5883\u53D8\u91CF:","cli.embed.env.model":"EASBOT_EMBEDDING_MODEL \u5982 openai/text-embedding-3-small","cli.query.usage":"\u7528\u6CD5: easbot codebase query <q...> [--language=<lang>] [--ast=<type>] [--max=N] [--no-edges] [--no-vector|--no-embed] [--json]","cli.query.description":"\u5BF9\u5DF2\u7D22\u5F15\u4EE3\u7801\u8282\u70B9\u505A\u6DF7\u5408\u641C\u7D22\uFF08FTS + \u5411\u91CF + \u57FA\u7840\uFF09\u3002","cli.query.aliases":"\u522B\u540D: search","cli.query.opt.language":"--language=<lang> \u6309\u8BED\u8A00\u8FC7\u6EE4\uFF08ts / js / py / go / ...\uFF09","cli.query.opt.ast":"--ast=<type> \u6309 AST \u7C7B\u578B\u8FC7\u6EE4\uFF08class_declaration / function_declaration / ...\uFF09","cli.query.opt.max":"--max=<N> \u6700\u5927\u7ED3\u679C\u6570\uFF08\u9ED8\u8BA4 20\uFF09","cli.query.opt.no_edges":"--no-edges \u7ED3\u679C\u4E2D\u4E0D\u5305\u542B\u8FB9\uFF08\u9ED8\u8BA4: \u5305\u542B\uFF09","cli.query.opt.no_vector":"--no-vector / --no-embed \u7981\u7528\u5411\u91CF\u641C\u7D22\uFF08\u4EC5 FTS + \u57FA\u7840\uFF0C\u9ED8\u8BA4: \u542F\u7528\u5411\u91CF\uFF09","cli.query.opt.json":"--json JSON \u8F93\u51FA","cli.node.usage":"\u7528\u6CD5: easbot codebase node <name|id> [--file=<path>] [--kind=<kind>] [--edges] [--max=N] [--json]","cli.node.description":"\u663E\u793A\u5355\u4E2A\u8282\u70B9\u7684\u8BE6\u60C5\u3002","cli.node.accepts_name":"\u63A5\u53D7\u7B26\u53F7\u540D <name>\uFF08\u5BF9 LLM \u53CB\u597D\uFF0C\u4E0E tool/MCP \u5BF9\u9F50\uFF09","cli.node.accepts_id":"\u6216\u6765\u81EA `query` / \u6570\u636E\u5E93\u7684\u539F\u59CB <node-id>\u3002","cli.node.opt.file":"--file=<path> \u540C\u540D\u7B26\u53F7\u5B58\u5728\u65F6\u7528\u4E8E\u6D88\u6B67","cli.node.opt.kind":"--kind=<kind> \u6309 AST \u7C7B\u578B\u8FC7\u6EE4/\u6D88\u6B67","cli.node.opt.edges":"--edges \u5305\u542B\u5165\u8FB9/\u51FA\u8FB9\u6C47\u603B","cli.node.opt.max":"--max=<N> \u8FB9\u6570\u91CF\u4E0A\u9650\uFF08\u9ED8\u8BA4 50\uFF09","cli.node.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.context.usage":"\u7528\u6CD5: easbot codebase context <id> [--depth=N] [--max=N] [--direction=<incoming|outgoing|both>] [--relation=<r1,r2,...>] [--json]","cli.context.description":"\u6784\u5EFA\u8282\u70B9\u5468\u56F4\u7684\u5B50\u56FE\u4E0A\u4E0B\u6587\uFF08BFS \u90BB\u63A5 N \u5C42\uFF09\u3002","cli.context.opt.depth":"--depth=<N> BFS \u6DF1\u5EA6\uFF08\u9ED8\u8BA4 2\uFF09","cli.context.opt.max":"--max=<N> \u6700\u5927\u8282\u70B9\u6570\uFF08\u9ED8\u8BA4 100\uFF09","cli.context.opt.direction":"--direction=<dir> incoming | outgoing | both\uFF08\u9ED8\u8BA4 both\uFF09","cli.context.opt.relation":"--relation=<r1,r2,...> \u6309\u5173\u7CFB\u7C7B\u578B\u8FC7\u6EE4\uFF08CALLS / IMPORTS / TYPE_REFERENCES / EXTENDS / IMPLEMENTS / USES / REFERENCES\uFF09","cli.context.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.impact.usage":"\u7528\u6CD5: easbot codebase impact <id> [-d=N | --depth=N] [--relation=<r1,r2,...>] [--json]","cli.impact.description":"\u5F71\u54CD\u534A\u5F84: BFS \u5165\u5411 CALLS / REFERENCES / USES / IMPORTS / TYPE_REFERENCES\uFF0C\u6309\u6DF1\u5EA6\u5206\u6876\u3002","cli.impact.opt.depth":"--depth=<N> BFS \u6DF1\u5EA6\uFF08\u9ED8\u8BA4 3\uFF09","cli.impact.opt.relation":"--relation=<r1,r2,...> \u6309\u5173\u7CFB\u7C7B\u578B\u8FC7\u6EE4","cli.impact.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.callers.usage":"\u7528\u6CD5: easbot codebase callers <symbol> [--node-id=<id>] [--file=<path>] [--kind=<kind>] [--max=N] [--json]","cli.callers.description":"\u8C01\u8C03\u7528\u4E86 <symbol>\uFF08\u5165\u5411 CALLS / IMPORTS / TYPE_REFERENCES / EXTENDS / IMPLEMENTS\uFF09\u3002","cli.callers.accepts":"\u63A5\u53D7\u7B26\u53F7\u540D <symbol>\uFF08\u5BF9 LLM \u53CB\u597D\uFF09\u6216 --node-id \u6307\u5B9A\u539F\u59CB\u8282\u70B9 id\u3002","cli.callers.opt.node_id":"--node-id=<id> \u6765\u81EA `query` / \u6570\u636E\u5E93\u7684\u539F\u59CB\u8282\u70B9 id","cli.callers.opt.file":"--file=<path> \u6587\u4EF6\u8DEF\u5F84\u6216 basename \u7528\u4E8E\u540C\u540D\u7B26\u53F7\u6D88\u6B67","cli.callers.opt.kind":"--kind=<kind> \u6309\u8282\u70B9\u7C7B\u578B\u8FC7\u6EE4\uFF08class_declaration / function_declaration / ...\uFF09","cli.callers.opt.max":"--max=<N> \u6700\u5927\u8C03\u7528\u8005\u6570\uFF08\u9ED8\u8BA4 20\uFF09","cli.callers.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.callees.usage":"\u7528\u6CD5: easbot codebase callees <symbol> [--node-id=<id>] [--file=<path>] [--kind=<kind>] [--max=N] [--json]","cli.callees.description":"<symbol> \u8C03\u7528\u4E86\u8C01\uFF08\u51FA\u5411\u8FB9\uFF09\u3002","cli.callees.accepts":"\u63A5\u53D7\u7B26\u53F7\u540D <symbol>\uFF08\u5BF9 LLM \u53CB\u597D\uFF09\u6216 --node-id \u6307\u5B9A\u539F\u59CB\u8282\u70B9 id\u3002","cli.callees.opt.node_id":"--node-id=<id> \u6765\u81EA `query` / \u6570\u636E\u5E93\u7684\u539F\u59CB\u8282\u70B9 id","cli.callees.opt.file":"--file=<path> \u6587\u4EF6\u8DEF\u5F84\u6216 basename \u7528\u4E8E\u6D88\u6B67","cli.callees.opt.kind":"--kind=<kind> \u6309\u8282\u70B9\u7C7B\u578B\u8FC7\u6EE4","cli.callees.opt.max":"--max=<N> \u6700\u5927\u88AB\u8C03\u7528\u6570\uFF08\u9ED8\u8BA4 20\uFF09","cli.callees.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.explore.usage":"\u7528\u6CD5: easbot codebase explore <query> [--file=<path>] [--kind=<kind>] [--max-files=N] [--max-symbols=N] [--depth=N] [--no-content] [--intent=<ctx>] [--json]","cli.explore.description":"\u4E3B\u5DE5\u5177 \u2014 \u5355\u6B21\u8C03\u7528\u8FD4\u56DE\u6E90\u7801 + \u8C03\u7528\u94FE\u3002","cli.explore.query_help":"<query> \u53EF\u4EE5\u662F\u7B26\u53F7\u540D\u6216\u81EA\u7136\u8BED\u8A00\u3002","cli.explore.opt.file":"--file=<path> \u6587\u4EF6\u8DEF\u5F84\u6216 basename \u7528\u4E8E\u6D88\u6B67","cli.explore.opt.kind":"--kind=<kind> \u6309\u8282\u70B9\u7C7B\u578B\u8FC7\u6EE4","cli.explore.opt.max_files":"--max-files=<N> \u6700\u5927\u5165\u53E3\u6587\u4EF6\u6570\uFF08\u9ED8\u8BA4 5\uFF09","cli.explore.opt.max_symbols":"--max-symbols=<N> \u6BCF\u6587\u4EF6\u6700\u5927\u7B26\u53F7\u6570\uFF08\u9ED8\u8BA4 3\uFF09","cli.explore.opt.depth":"--depth=<N> \u8C03\u7528\u94FE\u7684\u90BB\u63A5\u6DF1\u5EA6\uFF08\u9ED8\u8BA4 1\uFF09","cli.explore.opt.no_content":"--no-content \u4E0D\u5305\u542B\u6E90\u7801\uFF08\u4EC5\u4F4D\u7F6E\uFF0C\u9ED8\u8BA4: \u5305\u542B\uFF09","cli.explore.opt.intent":"--intent=<ctx> \u7528\u4E8E\u6392\u5E8F\u7684 LLM \u4E0A\u4E0B\u6587\u4E32","cli.explore.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.dead_code.usage":"\u7528\u6CD5: easbot codebase dead-code [--type=<t1,t2,...>] [--no-exclude-entry] [--limit=N] [--json]","cli.dead_code.description":"\u67E5\u627E\u65E0\u5165\u8FB9\u7684\u8282\u70B9\uFF08\u542F\u53D1\u5F0F\u6B7B\u4EE3\u7801\uFF09\u3002","cli.dead_code.opt.type":"--type=<t1,t2,...> \u4EC5\u8003\u8651\u8FD9\u4E9B AST \u7C7B\u578B","cli.dead_code.opt.no_exclude_entry":"--no-exclude-entry \u5305\u542B\u5165\u53E3\u6587\u4EF6\uFF08\u9ED8\u8BA4: \u6392\u9664\uFF09","cli.dead_code.opt.limit":"--limit=<N> \u6700\u5927\u7ED3\u679C\u6570\uFF08\u9ED8\u8BA4 100\uFF09","cli.dead_code.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.circular.usage":"\u7528\u6CD5: easbot codebase circular [--relation=<r>] [--scope=<file|module>] [--json]","cli.circular.description":"\u901A\u8FC7 Tarjan SCC \u68C0\u6D4B\u5FAA\u73AF\u4F9D\u8D56\u3002","cli.circular.opt.relation":"--relation=<r> \u8DDF\u968F\u7684\u5173\u7CFB\u7C7B\u578B\uFF08\u9ED8\u8BA4 IMPORTS\uFF09","cli.circular.opt.scope":"--scope=<scope> file | module\uFF08\u9ED8\u8BA4 file\uFF09","cli.circular.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.path.usage":"\u7528\u6CD5: easbot codebase path <from> <to> [-d=N | --depth=N] [--relation=<r1,r2,...>] [--json]","cli.path.description":"\u67E5\u627E\u4E24\u4E2A\u8282\u70B9\u4E4B\u95F4\u7684\u6700\u77ED\u8DEF\u5F84\uFF08\u6CBF CALLS / IMPORTS / TYPE_REFERENCES / USES / REFERENCES \u505A BFS\uFF09\u3002","cli.path.opt.depth":"--depth=<N> BFS \u6DF1\u5EA6\u4E0A\u9650\uFF08\u9ED8\u8BA4 6\uFF09","cli.path.opt.relation":"--relation=<r1,r2,...> \u6309\u5173\u7CFB\u7C7B\u578B\u8FC7\u6EE4","cli.path.opt.json":"--json \u4EE5 JSON \u8F93\u51FA","cli.mcp.usage":"\u7528\u6CD5: easbot codebase mcp [dir]","cli.mcp.description":"\u542F\u52A8 stdio MCP \u670D\u52A1\u5668\uFF0C\u66B4\u9732 9 \u4E2A codebase \u5DE5\u5177:","cli.mcp.tools.1":" query / node / context / impact","cli.mcp.tools.2":" callers / callees / explore","cli.mcp.tools.3":" status / doctor","cli.mcp.transport":"\u901A\u8FC7 stdio JSON-RPC \u4ECE MCP \u5BA2\u6237\u7AEF\u8FDE\u63A5\u3002","cli.watch.usage":"\u7528\u6CD5: easbot codebase watch [--debounce=N] [--interval=N] [dir]","cli.watch.description":"\u76D1\u542C\u5DE5\u4F5C\u533A\u76EE\u5F55\u7684\u6587\u4EF6\u53D8\u66F4\u5E76\u8BB0\u5F55\u4E8B\u4EF6\u3002","cli.watch.pid_file":"\u5728 .easbot/.watcher.pid \u5199\u5165 pid \u6587\u4EF6\uFF0C\u4F9B\u540E\u7EED `stop` \u4F7F\u7528\u3002","cli.watch.opt.debounce":"--debounce=N \u5355\u8DEF\u5F84\u9632\u6296\uFF08\u6BEB\u79D2\uFF0C\u9ED8\u8BA4 200\uFF09","cli.watch.opt.interval":"--interval=N \u8F6E\u8BE2\u95F4\u9694\uFF08\u6BEB\u79D2\uFF0C\u9ED8\u8BA4 500\uFF09","cli.watch.note":"\u6CE8\u610F: \u8BE5\u547D\u4EE4\u4F1A\u963B\u585E\u3002\u6309 Ctrl+C \u9000\u51FA\u3002","cli.stop.usage":"\u7528\u6CD5: easbot codebase stop [dir]","cli.stop.description":"\u505C\u6B62\u7531 .easbot/.watcher.pid \u6807\u8BC6\u7684\u8FD0\u884C\u4E2D\u76D1\u542C\u5668\u3002","cli.stop.opt.force":"--force, -f \u5FFD\u7565\u9519\u8BEF\u5E76\u5F3A\u5236\u6E05\u7406 pid \u6587\u4EF6","cli.shared.options_heading":"\u9009\u9879:","cli.shared.subcommands_heading":"\u5B50\u547D\u4EE4:","cli.shared.environment_heading":"\u73AF\u5883\u53D8\u91CF:","cli.unknown_command":"\u672A\u77E5\u547D\u4EE4: {{command}}","cli.help_hint":"\u8FD0\u884C `easbot codebase --help` \u67E5\u770B\u53EF\u7528\u547D\u4EE4\u3002","cli.signal_cleanup":"[codebase] \u6536\u5230 {{signal}}\uFF0C\u6B63\u5728\u6E05\u7406...","cli.command_failed":"codebase {{command}} \u6267\u884C\u5931\u8D25: {{message}}"}},to=bn;var hn={translation:{"cli.banner.title":"easbot-codebase \u2014 code knowledge graph ecosystem","cli.banner.usage":"Usage: easbot-codebase <command> [options]","cli.banner.section.lifecycle":"Commands (lifecycle):","cli.banner.section.graph":"Commands (graph query):","cli.banner.section.external":"External:","cli.banner.hint.run_help":"Run `easbot codebase <command> --help` for details.","cli.banner.local.title":"Local CLI:","cli.banner.local.body":"This package is also published as `easbot-codebase` for standalone use.","cli.banner.local.agent":"Agent CLI users: `easbot codebase <command> ...`","cli.banner.local.standalone":"Standalone users: `easbot-codebase <command> ...`","cli.cmd.init.summary":"init [dir] Initialize .easbot/codebase.json in the target directory","cli.cmd.index.summary":"index [dir] Build the full index","cli.cmd.sync.summary":"sync Run incremental sync","cli.cmd.recreate.summary":"recreate Drop db, re-init, rebuild index in one step","cli.cmd.clear.summary":"clear Clear all nodes/edges (keep config.json)","cli.cmd.status.summary":"status Show index state / db / config","cli.cmd.doctor.summary":"doctor Run health checks (backend availability, etc.)","cli.cmd.config.summary":"config Get/set .easbot/codebase.json fields","cli.cmd.upgrade.summary":"upgrade Update extraction_version metadata when stale","cli.cmd.embed.summary":"embed Generate node embeddings","cli.cmd.watch.summary":"watch Watch workspace for file changes (auto-sync)","cli.cmd.stop.summary":"stop Stop a running file watcher","cli.cmd.query.summary":"query <q...> Hybrid search (FTS + vector + basic)","cli.cmd.node.summary":"node <name|id> Show details for a single node","cli.cmd.context.summary":"context <id> Build sub-graph context around a node","cli.cmd.impact.summary":"impact <id> Blast radius (BFS incoming edges)","cli.cmd.callers.summary":"callers <sym> Flat list of who calls <symbol>","cli.cmd.callees.summary":"callees <sym> Flat list of what <symbol> calls","cli.cmd.explore.summary":"explore <q> PRIMARY tool \u2014 source code + caller/callee trail in one call","cli.cmd.dead_code.summary":"dead-code Find unused symbols","cli.cmd.circular.summary":"circular Detect circular dependencies","cli.cmd.path.summary":"path <from> <to> Find shortest path between two nodes","cli.cmd.mcp.summary":"mcp [dir] Start stdio MCP server (exposes 9 codebase tools)","cli.cmd.init.description":"Initialize .easbot/codebase.json in the target directory","cli.cmd.index.description":"Build the full index (creates db if missing)","cli.cmd.sync.description":"Run incremental sync (only changed files)","cli.cmd.recreate.description":"Discard the entire db and re-init","cli.cmd.clear.description":"Clear all nodes/edges (keep config.json)","cli.cmd.status.description":"Show index state / db / config","cli.cmd.doctor.description":"Run health checks (backend, FTS, parser)","cli.cmd.config.description":"Get/set .easbot/codebase.json fields","cli.cmd.upgrade.description":"Update extraction_version metadata when stale","cli.cmd.embed.description":"Generate / inspect node embeddings (dry-run / pending-list)","cli.cmd.watch.description":"Watch workspace for file changes (auto-sync)","cli.cmd.stop.description":"Stop a running file watcher","cli.cmd.query.description":"Hybrid search (FTS + vector + basic)","cli.cmd.node.description":"Show details for a single node","cli.cmd.context.description":"Build sub-graph context around a node","cli.cmd.impact.description":"Blast radius (BFS incoming edges)","cli.cmd.callers.description":"Flat list of who calls <symbol> (incoming edges)","cli.cmd.callees.description":"Flat list of what <symbol> calls (outgoing edges)","cli.cmd.explore.description":"PRIMARY tool \u2014 source code + caller/callee trail in one call","cli.cmd.dead_code.description":"Find unused symbols","cli.cmd.circular.description":"Detect circular dependencies (Tarjan SCC)","cli.cmd.path.description":"Find shortest path between two nodes","cli.cmd.mcp.description":"Start stdio MCP server (exposes 9 codebase tools)","cli.shared.show_help":"Show this help","cli.init.usage":"Usage: easbot codebase init [dir] [--force]","cli.init.description":"Initialize .easbot/codebase.json in the target directory.","cli.init.creates":"Creates .easbot/codebase.json with default backend = better-sqlite3.","cli.init.opt.force":"--force, -f Overwrite existing config.json","cli.init.exists":"codebase config already exists at {{path}} (use --force to overwrite)","cli.init.created":"\u2713 codebase initialized at {{path}}","cli.status.usage":"Usage: easbot codebase status [--json] [dir]","cli.doctor.usage":"Usage: easbot codebase doctor [dir]","cli.index.usage":"Usage: easbot codebase index [dir] [--embed] [--no-embed] [--batch=N] [--json]","cli.index.description":"Build the full index for the target directory.","cli.index.auto_init":"Auto-initializes .easbot/codebase.json if it does not exist.","cli.index.opt.embed":"--embed Generate node embeddings (default: skip)","cli.index.opt.no_embed":"--no-embed Same as default (skip embedding)","cli.index.opt.batch":"--batch=N Batch size for indexing (default 50)","cli.index.opt.json":"--json Output as JSON (no ANSI)","cli.sync.usage":"Usage: easbot codebase sync [--embed] [--no-embed] [--quiet] [--json] [dir]","cli.sync.description":"Run incremental sync (only adds/updates/deletes changed files).","cli.sync.auto_version":"Auto-updates meta['indexed_with_version'] on success.","cli.sync.opt.embed":"--embed Enable node embeddings (default off, FTS-only)","cli.sync.opt.no_embed":"--no-embed Explicitly disable embeddings (default)","cli.sync.opt.quiet":"--quiet, -q Only print summary","cli.sync.opt.json":"--json Output as JSON (no ANSI)","cli.recreate.usage":"Usage: easbot codebase recreate [--keep-config] [--no-reindex] [--no-embed] [--force] [--json] [dir]","cli.recreate.description":"Discard the entire db (codebase.db + -wal + -shm), re-init, and rebuild the index in one step.","cli.recreate.equivalent":"Equivalent to codegraph `recreate()` for safe index recovery.","cli.recreate.opt.keep_config":"--keep-config Keep .easbot/codebase.json (only drop db)","cli.recreate.opt.no_reindex":"--no-reindex Skip the auto rebuild-index step (manual `easbot codebase index` required after)","cli.recreate.opt.no_embed":"--no-embed Forward to runIndex: skip embedding generation (faster)","cli.recreate.opt.force":"--force, -f Skip safety prompts (for scripts)","cli.recreate.opt.json":"--json Output as JSON","cli.recreate.warn":"\u26A0\uFE0F This deletes the entire index. By default `recreate` also rebuilds the index in the same call.","cli.clear.usage":"Usage: easbot codebase clear [--keep-embeddings] [--force] [dir]","cli.clear.description":"Clear all nodes/edges/file_hashes; keep config.json and meta.","cli.clear.reset_state":'index_state is reset to "uninitialized" so `status` recommends `index`.',"cli.clear.opt.keep_embeddings":"--keep-embeddings Preserve node_embeddings / embedding_cache","cli.clear.opt.force":"--force, -f Skip safety prompts (for scripts)","cli.clear.opt.json":"--json Output as JSON","cli.clear.hint":"\u{1F4A1} Use `recreate` if you want to drop the entire db file.","cli.config.usage":"Usage: easbot codebase config <get|set> [key] [value] [--json] [dir]","cli.config.description":"Read or write .easbot/codebase.json fields.","cli.config.subcommands":"Subcommands:","cli.config.get":"get [key] Show all fields (or a specific key)","cli.config.set":"set <key> <value> Update a field (must be in allowlist)","cli.config.allowed_keys":"Allowed keys: backend, schema_version, extraction_version, index_state","cli.config.opt.json":"--json Output as JSON (no ANSI)","cli.config.no_subcommand":"config requires a subcommand: get | set","cli.config.unknown_subcommand":"Unknown config subcommand: {{subcommand}}","cli.upgrade.usage":"Usage: easbot codebase upgrade [--schema] [--force] [dir]","cli.upgrade.description":"Update indexed_with_extraction_version metadata when stale.","cli.upgrade.does_not_delete":"Does NOT delete data \u2014 use `recreate` to drop the db entirely.","cli.upgrade.opt.schema":"--schema Also re-run ensureSchema (idempotent CREATE TABLE IF NOT EXISTS)","cli.upgrade.opt.force":"--force, -f Update version even when not stale","cli.embed.usage":"Usage: easbot codebase embed [--all] [--dry-run|-n] [--pending-list|-p] [--batch=N] [--json] [dir]","cli.embed.description":"Generate node embeddings for nodes missing from node_embeddings.","cli.embed.statistical_only":"CLI is statistical-only \u2014 actual embedding generation requires","cli.embed.repl_required":"an `easbot` REPL session with an injected EmbeddingModel.","cli.embed.opt.all":"--all Force regenerate for all nodes","cli.embed.opt.dry_run":"--dry-run, -n Print statistics only (default behavior in CLI)","cli.embed.opt.pending":"--pending-list, -p List node ids that are pending embedding","cli.embed.opt.batch":"--batch=N Embedding batch size (default 10)","cli.embed.opt.json":"--json Output as JSON","cli.embed.env.heading":"Environment:","cli.embed.env.model":"EASBOT_EMBEDDING_MODEL e.g. openai/text-embedding-3-small","cli.query.usage":"Usage: easbot codebase query <q...> [--language=<lang>] [--ast=<type>] [--max=N] [--no-edges] [--no-vector|--no-embed] [--json]","cli.query.description":"Hybrid search (FTS + vector + basic) over indexed code nodes.","cli.query.aliases":"Aliases: search","cli.query.opt.language":"--language=<lang> Filter by language (ts / js / py / go / ...)","cli.query.opt.ast":"--ast=<type> Filter by AST type (class_declaration / function_declaration / ...)","cli.query.opt.max":"--max=<N> Max results (default 20)","cli.query.opt.no_edges":"--no-edges Do not include edges in results (default: include)","cli.query.opt.no_vector":"--no-vector / --no-embed Disable vector search (FTS + basic only, default: vector on)","cli.query.opt.json":"--json JSON output","cli.node.usage":"Usage: easbot codebase node <name|id> [--file=<path>] [--kind=<kind>] [--edges] [--max=N] [--json]","cli.node.description":"Show details for a single node.","cli.node.accepts_name":"Accepts a symbol <name> (LLM workflow friendly, tool/MCP-aligned)","cli.node.accepts_id":"or a raw <node-id> from `query` / database.","cli.node.opt.file":"--file=<path> Disambiguate when same-named symbols exist","cli.node.opt.kind":"--kind=<kind> Filter / disambiguate by AST kind","cli.node.opt.edges":"--edges Include incoming / outgoing edge summaries","cli.node.opt.max":"--max=<N> Edge limit (default 50)","cli.node.opt.json":"--json Output as JSON","cli.context.usage":"Usage: easbot codebase context <id> [--depth=N] [--max=N] [--direction=<incoming|outgoing|both>] [--relation=<r1,r2,...>] [--json]","cli.context.description":"Build a sub-graph context around a node (BFS to N-level neighbors).","cli.context.opt.depth":"--depth=<N> BFS depth (default 2)","cli.context.opt.max":"--max=<N> Max nodes (default 100)","cli.context.opt.direction":"--direction=<dir> incoming | outgoing | both (default both)","cli.context.opt.relation":"--relation=<r1,r2,...> Filter by relation types (CALLS / IMPORTS / TYPE_REFERENCES / EXTENDS / IMPLEMENTS / USES / REFERENCES)","cli.context.opt.json":"--json Output as JSON","cli.impact.usage":"Usage: easbot codebase impact <id> [-d=N | --depth=N] [--relation=<r1,r2,...>] [--json]","cli.impact.description":"Blast radius: BFS incoming CALLS / REFERENCES / USES / IMPORTS / TYPE_REFERENCES, bucketed by depth.","cli.impact.opt.depth":"--depth=<N> BFS depth (default 3)","cli.impact.opt.relation":"--relation=<r1,r2,...> Filter by relation types","cli.impact.opt.json":"--json Output as JSON","cli.callers.usage":"Usage: easbot codebase callers <symbol> [--node-id=<id>] [--file=<path>] [--kind=<kind>] [--max=N] [--json]","cli.callers.description":"Flat list of who calls <symbol> (incoming CALLS / IMPORTS / TYPE_REFERENCES / EXTENDS / IMPLEMENTS).","cli.callers.accepts":"Accepts <symbol> name (LLM-friendly) OR --node-id for raw node id.","cli.callers.opt.node_id":"--node-id=<id> Raw node id from `query` / database","cli.callers.opt.file":"--file=<path> File path or basename to disambiguate when same-named symbols exist","cli.callers.opt.kind":"--kind=<kind> Filter by node kind (class_declaration / function_declaration / ...)","cli.callers.opt.max":"--max=<N> Max callers (default 20)","cli.callers.opt.json":"--json Output as JSON","cli.callees.usage":"Usage: easbot codebase callees <symbol> [--node-id=<id>] [--file=<path>] [--kind=<kind>] [--max=N] [--json]","cli.callees.description":"Flat list of what <symbol> calls (outgoing edges).","cli.callees.accepts":"Accepts <symbol> name (LLM-friendly) OR --node-id for raw node id.","cli.callees.opt.node_id":"--node-id=<id> Raw node id from `query` / database","cli.callees.opt.file":"--file=<path> File path or basename to disambiguate","cli.callees.opt.kind":"--kind=<kind> Filter by node kind","cli.callees.opt.max":"--max=<N> Max callees (default 20)","cli.callees.opt.json":"--json Output as JSON","cli.explore.usage":"Usage: easbot codebase explore <query> [--file=<path>] [--kind=<kind>] [--max-files=N] [--max-symbols=N] [--depth=N] [--no-content] [--intent=<ctx>] [--json]","cli.explore.description":"PRIMARY tool \u2014 single call to get source code + caller/callee trail.","cli.explore.query_help":"<query> can be a symbol name or natural language.","cli.explore.opt.file":"--file=<path> File path or basename to disambiguate","cli.explore.opt.kind":"--kind=<kind> Filter by node kind","cli.explore.opt.max_files":"--max-files=<N> Max entry-point files (default 5)","cli.explore.opt.max_symbols":"--max-symbols=<N> Max symbols per file (default 3)","cli.explore.opt.depth":"--depth=<N> Neighbor depth for caller/callee trail (default 1)","cli.explore.opt.no_content":"--no-content Do not include source code (locations only, default: include)","cli.explore.opt.intent":"--intent=<ctx> LLM context string for ranking","cli.explore.opt.json":"--json Output as JSON","cli.dead_code.usage":"Usage: easbot codebase dead-code [--type=<t1,t2,...>] [--no-exclude-entry] [--limit=N] [--json]","cli.dead_code.description":"Find nodes with no incoming edges (heuristic dead code).","cli.dead_code.opt.type":"--type=<t1,t2,...> Only consider these AST types","cli.dead_code.opt.no_exclude_entry":"--no-exclude-entry Include entry-point files (default: exclude)","cli.dead_code.opt.limit":"--limit=<N> Max results (default 100)","cli.dead_code.opt.json":"--json Output as JSON","cli.circular.usage":"Usage: easbot codebase circular [--relation=<r>] [--scope=<file|module>] [--json]","cli.circular.description":"Detect circular dependencies via Tarjan SCC.","cli.circular.opt.relation":"--relation=<r> Relation type to follow (default IMPORTS)","cli.circular.opt.scope":"--scope=<scope> file | module (default file)","cli.circular.opt.json":"--json Output as JSON","cli.path.usage":"Usage: easbot codebase path <from> <to> [-d=N | --depth=N] [--relation=<r1,r2,...>] [--json]","cli.path.description":"Find shortest path between two nodes (BFS along CALLS / IMPORTS / TYPE_REFERENCES / USES / REFERENCES).","cli.path.opt.depth":"--depth=<N> BFS depth limit (default 6)","cli.path.opt.relation":"--relation=<r1,r2,...> Filter by relation types","cli.path.opt.json":"--json Output as JSON","cli.mcp.usage":"Usage: easbot codebase mcp [dir]","cli.mcp.description":"Start a stdio MCP server exposing 9 codebase tools:","cli.mcp.tools.1":" query / node / context / impact","cli.mcp.tools.2":" callers / callees / explore","cli.mcp.tools.3":" status / doctor","cli.mcp.transport":"Connect from MCP clients via stdio JSON-RPC.","cli.watch.usage":"Usage: easbot codebase watch [--debounce=N] [--interval=N] [dir]","cli.watch.description":"Watch the workspace directory for file changes and log events.","cli.watch.pid_file":"Writes a pid file at .easbot/.watcher.pid for subsequent `stop`.","cli.watch.opt.debounce":"--debounce=N Per-path debounce in ms (default 200)","cli.watch.opt.interval":"--interval=N Polling interval in ms (default 500)","cli.watch.note":"NOTE: This command blocks. Press Ctrl+C to exit.","cli.stop.usage":"Usage: easbot codebase stop [dir]","cli.stop.description":"Stop a running watcher identified by .easbot/.watcher.pid.","cli.stop.opt.force":"--force, -f Ignore errors and clear the pid file anyway","cli.shared.options_heading":"Options:","cli.shared.subcommands_heading":"Subcommands:","cli.shared.environment_heading":"Environment:","cli.unknown_command":"Unknown command: {{command}}","cli.help_hint":"Run `easbot codebase --help` for available commands.","cli.signal_cleanup":"[codebase] received {{signal}}, cleaning up...","cli.command_failed":"codebase {{command}} failed: {{message}}"}},oo=hn;var yn=()=>{X("zh-CN"),X("en-US"),Q("zh-CN",to),Q("en-US",oo);};yn();var ie=new Map;var ae=new Map;var xn=o=>{if(ae.has(o))return ae.get(o);let e=/{{\s*(\w+)\s*}}/g,n=[],t;for(;(t=e.exec(o))!==null;){let l=t[1];l&&!n.includes(l)&&n.push(l);}let i=new RegExp("{{\\s*("+n.join("|")+")\\s*}}","g"),r={keys:n,regex:i};return ae.set(o,r),r},no=(o,e)=>{if(!o||typeof o!="string")return "";if(!e||Object.keys(e).length===0)return o;let{regex:n,keys:t}=xn(o);return t.length===0||!t.some(r=>r in e)?o:o.replace(n,(r,l)=>{let s=e[l];return s==null?"":String(s)})},Sn=o=>{if(o&&q.locales.includes(o))return o;let e=process.env.EASBOT_LANG?.trim()||process.env.LANG?.trim();if(e){let n=e.replace(/_/g,"-");if(q.locales.includes(n))return n;let t=n.split("-")[0];if(t==="zh")return "zh-CN";if(t==="en")return "en-US"}return q.defaultLocale},so=o=>{if(!ie.has(o)){let{resources:e}=X(o);ie.set(o,e);}return ie.get(o)},wn=(o,e={})=>{let n=Sn(e.locale),i=so(n)?.translation[o];if(i&&typeof i=="string"){let r=no(i,e.vars);return r!=null?String(r):String(o)}if(n!==q.defaultLocale){let l=so(q.defaultLocale)?.translation[o];if(l&&typeof l=="string"){let s=no(l,e.vars);return s!=null?String(s):String(o)}}return String(e.fallback??o)},re=wn;var ce=Log.create({service:"codebase.cli"});async function Dn(){try{let{Llm:o}=await import('./llm-NWYEBR5K.mjs'),{CodebaseCache:e}=await import('./cache-EZ3VLUUC.mjs'),n=await e.getCodebaseJson();o.init({models:{embedding:n?.embedding_model??void 0,evaluation:n?.evaluation_model??void 0},evaluationThreshold:n?.evaluation_threshold});}catch(o){let{errorMeta:e}=await import('@easbot/utils');ce.warn("Llm init failed; Llm-related features will be disabled",{error:e(o)});}}function le(o){return resolveLocaleLang(o?.locale)}function ro(o){let e=(t,i,r)=>re(t,{locale:o,vars:r,fallback:i}),n=(t,i,r)=>{let l=In.filter(s=>s.group===t).map(s=>` ${On(s.name)}${e(s.i18nKey,s.description)}`).join(`
|
|
23
23
|
`);return `${e(i,r)}
|
|
24
24
|
${l}`};return `
|
|
25
25
|
\x1B[1m${e("cli.banner.title","easbot-codebase \u2014 Code Knowledge Graph for EASBot")}\x1B[0m
|