@easbot/codebase 0.3.11 → 0.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/chunk-34CU2EU4.mjs +1 -0
- package/dist/chunks/chunk-7PW7HWOC.cjs +2 -0
- package/dist/chunks/{chunk-B4DATLCQ.cjs → chunk-DMRAZKIP.cjs} +20 -20
- package/dist/chunks/chunk-JVX6PHPN.cjs +1 -0
- package/dist/chunks/chunk-P566CDI2.mjs +2 -0
- package/dist/chunks/{chunk-X72UNXDO.mjs → chunk-PLRTEGLZ.mjs} +18 -18
- package/dist/chunks/cli-handler-47R23IC3.cjs +1 -0
- package/dist/chunks/cli-handler-KSSK773Z.mjs +1 -0
- package/dist/chunks/interfaces-4KLR5CPG.cjs +1 -0
- package/dist/chunks/interfaces-KGAFAHKZ.mjs +1 -0
- package/dist/chunks/sync-6VAWF5IL.mjs +1 -0
- package/dist/chunks/sync-OSAGPUO2.cjs +1 -0
- 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 +6 -6
- package/dist/chunks/chunk-BTEBUBZT.mjs +0 -2
- package/dist/chunks/chunk-XSOZHJMZ.cjs +0 -2
- package/dist/chunks/sync-HOK662LD.cjs +0 -1
- package/dist/chunks/sync-XBCHGJ2H.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {homedir}from'os';import {join}from'path';import {xdgState,xdgData,xdgCache,xdgConfig}from'xdg-basedir';var o=null,c=null;function m(t){o=t;}function b(){o=null;}function n(){if(o)return o;let t=homedir();return {Path:{home:t,data:process.env.EASBOT_DATA_PATH?.trim()||join(xdgData??join(t,".local","share"),"easbot"),config:process.env.EASBOT_CONFIG_PATH?.trim()||join(xdgConfig??join(t,".config"),"easbot"),state:process.env.EASBOT_STATE_PATH?.trim()||join(xdgState??join(xdgData??join(t,".local","share"),"easbot"),"state"),cache:process.env.EASBOT_CACHE_PATH?.trim()||join(xdgCache??join(t,".cache"),"easbot"),log:process.env.EASBOT_LOG_PATH?.trim()||join(xdgState??join(xdgData??join(t,".local","share"),"easbot"),"log"),bin:process.env.EASBOT_BIN_PATH?.trim()||join(t,".local","bin")}}}function x(t){c=t;}function T(){c=null;}function p(){if(c)return c;let t=process.cwd();return {directory:t,worktree:t}}function i(){return n().Path.home||homedir()}function g(){let t=n().Path.data;return t||(xdgData??join(i(),".local","share"))}function _(){let t=n().Path.config;return t||(xdgConfig??join(i(),".config"))}function P(){let t=n().Path.state;return t||(xdgState??join(g(),"state"))}function v(){let t=n().Path.cache;return t||(xdgCache??join(i(),".cache"))}function G(){return p().directory||process.cwd()}export{m as a,b,n as c,x as d,T as e,p as f,i as g,g as h,_ as i,P as j,v as k,G as l};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkJVX6PHPN_cjs=require('./chunk-JVX6PHPN.cjs'),chunk7XCIIOM6_cjs=require('./chunk-7XCIIOM6.cjs'),path=require('path');function E(t){let e={},n=[];for(let s of t)s==="--json"?e.json=true:s==="--quiet"||s==="-q"?e.quiet=true:s==="--help"||s==="-h"?e.help=true:s==="--no-embed"?e.noEmbed=true:s==="--embed"?e.noEmbed=false:s.startsWith("-")||n.push(s);return e.dir=n[0],e}async function w(t){let e=t.dir&&path.isAbsolute(t.dir)?t.dir:path.join(chunkJVX6PHPN_cjs.l(),t.dir??"."),n=chunk7XCIIOM6_cjs.c(e),{CodeBase:s}=await import('./code-base-HBPZXJQZ.cjs'),{DEFAULT_EMBEDDING_CONFIG:p,DEFAULT_INDEXER_CONFIG:m,DEFAULT_PARSER_CONFIG:h}=await import('@easbot/types'),i=new s({workspaceDir:e,database:{path:n,walMode:true},embedding:t.noEmbed===false?p:void 0,indexer:m,parser:h,sync:{onBoot:false,onSearch:false,onSessionStart:false,intervalMs:0}}),l,a={_lastPct:-1,_lastProgressAt:0};try{await i.initialize();let r=await i.sync(t.quiet?void 0:o=>{let b=Math.max(o.total,1),d=Math.min(100,Math.floor(o.processed/b*100)),c=Date.now(),g=d!==a._lastPct,y=c-a._lastProgressAt>3e4;if(g||y){let D=String(d).padStart(3," ");console.error(` \u{1F4A1} [${D}%] ${o.stage}: ${o.processed}/${o.total} files`),a._lastPct=d,a._lastProgressAt=c;}}),S=i.getDatabase().getIndexState();l={rootDir:e,success:r.success,filesAdded:r.filesAdded,filesUpdated:r.filesUpdated,filesDeleted:r.filesDeleted,filesSkipped:r.filesSkipped,nodesCreated:r.nodesCreated,edgesCreated:r.edgesCreated,errorCount:r.errors.length,errors:r.errors,durationMs:r.duration,indexState:S};}finally{await i.close();}return l}function M(t){let e=[];if(e.push("Codebase sync"),e.push(` rootDir: ${t.rootDir}`),e.push(` success: ${t.success?"\u2713":"\u2717"}`),e.push(` indexState: ${t.indexState}`),e.push(` files added: ${t.filesAdded}`),e.push(` files updated: ${t.filesUpdated}`),e.push(` files deleted: ${t.filesDeleted}`),e.push(` files skipped: ${t.filesSkipped}`),e.push(` nodes created: ${t.nodesCreated}`),e.push(` edges created: ${t.edgesCreated}`),e.push(` duration: ${t.durationMs}ms`),t.errorCount>0){e.push(` errors (${t.errorCount}):`);for(let n of t.errors.slice(0,10))e.push(` - ${n.filePath}: ${n.error}`);t.errors.length>10&&e.push(` ... and ${t.errors.length-10} more`);}return e.join(`
|
|
2
|
+
`)}exports.a=E;exports.b=w;exports.c=M;
|