@easbot/agent 0.2.25 → 0.2.26
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/{acp-STZJ75XV.mjs → acp-MXBWTEWQ.mjs} +2 -2
- package/dist/chunks/adapter-loader-3EN56P7R.mjs +1 -0
- package/dist/chunks/{agent-4EMYYWV6.mjs → agent-OH7OBL37.mjs} +1 -1
- package/dist/chunks/{agent-FF52NW42.mjs → agent-OTRULLOV.mjs} +1 -1
- package/dist/chunks/app-4O5CFCEA.mjs +1 -0
- package/dist/chunks/{auth-2I7U24YF.mjs → auth-DHIUZUBT.mjs} +1 -1
- package/dist/chunks/bootstrap-2VLPO562.mjs +1 -0
- package/dist/chunks/{build-program-43NDEGM2.mjs → build-program-6IX5ZB7E.mjs} +1 -1
- package/dist/chunks/bus-4LDPSAHL.mjs +1 -0
- package/dist/chunks/{chunk-I7A5JGO5.mjs → chunk-3SWLJTIF.mjs} +1 -1
- package/dist/chunks/{chunk-GMEJX6PC.mjs → chunk-5Z4ZZTNB.mjs} +1 -1
- package/dist/chunks/{chunk-I6MBTO75.mjs → chunk-77AU67VS.mjs} +1 -1
- package/dist/chunks/{chunk-WN2HAJBB.mjs → chunk-JL7MUUWI.mjs} +7 -7
- package/dist/chunks/{chunk-IHHFG47N.mjs → chunk-KCJQKAMU.mjs} +1 -1
- package/dist/chunks/{chunk-KLJ7PPSA.mjs → chunk-KFKXAXPS.mjs} +1 -1
- package/dist/chunks/{chunk-EEWP2VV6.mjs → chunk-NQDXG75V.mjs} +4 -4
- package/dist/chunks/{chunk-LFNGHYRC.mjs → chunk-OWD2RLZG.mjs} +1 -1
- package/dist/chunks/{chunk-CVTJJBGW.mjs → chunk-PPTUNIYA.mjs} +1 -1
- package/dist/chunks/{chunk-KY3H2HGJ.mjs → chunk-RWJKYXLR.mjs} +226 -226
- package/dist/chunks/{chunk-ARCMKYQI.mjs → chunk-UHGU3KUN.mjs} +1 -1
- package/dist/chunks/{chunk-QJ6QTASU.mjs → chunk-Y63CDMY3.mjs} +1 -1
- package/dist/chunks/{command-H77IO5J2.mjs → command-SJGOCWCR.mjs} +1 -1
- package/dist/chunks/compaction-XRW2CSDJ.mjs +1 -0
- package/dist/chunks/config-UX7KSX2Y.mjs +1 -0
- package/dist/chunks/{confirm-dialog-AGHMTHWU.mjs → confirm-dialog-XBLCGOEC.mjs} +1 -1
- package/dist/chunks/{debug-55VJ74IW.mjs → debug-KPPALGWN.mjs} +3 -3
- package/dist/chunks/{export-BGH24SO2.mjs → export-I4GL3OUG.mjs} +1 -1
- package/dist/chunks/file-QLEZZKRK.mjs +1 -0
- package/dist/chunks/gateway-XPOSOE2L.mjs +16 -0
- package/dist/chunks/{generate-QMA5OAOD.mjs → generate-SXE5ACCV.mjs} +1 -1
- package/dist/chunks/{github-EJCNXJ6F.mjs → github-6I6QNGSD.mjs} +2 -2
- package/dist/chunks/global-E7NJBJBC.mjs +1 -0
- package/dist/chunks/{import-4TX5SVFQ.mjs → import-V5U5WAWX.mjs} +1 -1
- package/dist/chunks/installation-HXWUC3GX.mjs +1 -0
- package/dist/chunks/instance-SYMW2VFW.mjs +1 -0
- package/dist/chunks/loader-OIXMXUWE.mjs +1 -0
- package/dist/chunks/loader-ULZVW25Y.mjs +1 -0
- package/dist/chunks/lsp-TF3HQGNE.mjs +1 -0
- package/dist/chunks/{mcp-BGU4XS34.mjs → mcp-6G3LUTNY.mjs} +1 -1
- package/dist/chunks/mcp-7RT2JOII.mjs +1 -0
- package/dist/chunks/models-OCEOQAFH.mjs +1 -0
- package/dist/chunks/{pr-XD7C7PDJ.mjs → pr-6A5VSN2G.mjs} +1 -1
- package/dist/chunks/preferences-F7U2O3MO.mjs +1 -0
- package/dist/chunks/project-45YWGAQQ.mjs +1 -0
- package/dist/chunks/prompt-4DIHVG7F.mjs +1 -0
- package/dist/chunks/provider-ZPPQNKD4.mjs +1 -0
- package/dist/chunks/registry-RFQPWEYD.mjs +1 -0
- package/dist/chunks/revert-OM7I67AX.mjs +1 -0
- package/dist/chunks/ripgrep-IAHE6PUP.mjs +1 -0
- package/dist/chunks/{run-KL5CA5M6.mjs → run-HRFFN5E7.mjs} +2 -2
- package/dist/chunks/scheduler-44WS6TIN.mjs +1 -0
- package/dist/chunks/server-W2DYO5CI.mjs +1 -0
- package/dist/chunks/{session-REKMEA3V.mjs → session-2I5LMK3F.mjs} +1 -1
- package/dist/chunks/session-BVNXNVIE.mjs +1 -0
- package/dist/chunks/session-XS2QUVSO.mjs +1 -0
- package/dist/chunks/{settings-panel-BWCVKC4G.mjs → settings-panel-4GBMKF7S.mjs} +1 -1
- package/dist/chunks/share-WRGG4KM3.mjs +1 -0
- package/dist/chunks/snapshot-WLCB7V7M.mjs +1 -0
- package/dist/chunks/{stats-MILDLIZD.mjs → stats-KXJDFVQY.mjs} +1 -1
- package/dist/chunks/storage-DLKF23OL.mjs +1 -0
- package/dist/chunks/{tui-HU55FGHV.mjs → tui-2YD6S76J.mjs} +1 -1
- package/dist/chunks/tui-XJTR3NKP.mjs +1 -0
- package/dist/chunks/types-6TN4BPE3.mjs +1 -0
- package/dist/chunks/{update-IOQCRELU.mjs → update-KPY5MGY5.mjs} +1 -1
- package/dist/cli.mjs +3 -3
- package/package.json +13 -13
- package/dist/chunks/adapter-loader-BLTYHARQ.mjs +0 -1
- package/dist/chunks/app-CGZZFC54.mjs +0 -1
- package/dist/chunks/bootstrap-GVMMOFUK.mjs +0 -1
- package/dist/chunks/bus-PFFRRCH3.mjs +0 -1
- package/dist/chunks/compaction-LQXOGRP7.mjs +0 -1
- package/dist/chunks/config-J54DTNPX.mjs +0 -1
- package/dist/chunks/file-KEMX6XWX.mjs +0 -1
- package/dist/chunks/gateway-45LKZAQS.mjs +0 -16
- package/dist/chunks/global-KAF6JHVQ.mjs +0 -1
- package/dist/chunks/installation-CGMLIGLA.mjs +0 -1
- package/dist/chunks/instance-YUOFE3Q3.mjs +0 -1
- package/dist/chunks/loader-YOPK5OTL.mjs +0 -1
- package/dist/chunks/loader-ZTWTX2GS.mjs +0 -1
- package/dist/chunks/lsp-YNF5BCPV.mjs +0 -1
- package/dist/chunks/models-TN65RCBA.mjs +0 -1
- package/dist/chunks/preferences-3HCTNG2J.mjs +0 -1
- package/dist/chunks/project-HH3IL3QQ.mjs +0 -1
- package/dist/chunks/prompt-W7772MHB.mjs +0 -1
- package/dist/chunks/provider-ULN4YD2M.mjs +0 -1
- package/dist/chunks/registry-TL5F5F7C.mjs +0 -1
- package/dist/chunks/revert-TZSK52JS.mjs +0 -1
- package/dist/chunks/ripgrep-E3GWWA2V.mjs +0 -1
- package/dist/chunks/scheduler-SCM4SRS2.mjs +0 -1
- package/dist/chunks/server-Z6BORWAL.mjs +0 -1
- package/dist/chunks/session-BHXYW2JD.mjs +0 -1
- package/dist/chunks/session-PMZOQPFQ.mjs +0 -1
- package/dist/chunks/share-JFZ3O2BX.mjs +0 -1
- package/dist/chunks/snapshot-V23GRQBM.mjs +0 -1
- package/dist/chunks/storage-DKQ7S6QX.mjs +0 -1
- package/dist/chunks/tui-YGASP4NS.mjs +0 -1
- package/dist/chunks/types-WN4LZEB5.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {Ma}from'./chunk-RWJKYXLR.mjs';import {a}from'./chunk-LFYBZHOI.mjs';import {a as a$1}from'./chunk-77AU67VS.mjs';import {b as b$1}from'./chunk-X6ISXWBN.mjs';import d from'fs';import u from'path';var P=a.create({service:"cli-plugin"});function S(t,e,r){return {context:t,logger:a,config:r,registerCli(n,o){try{t._pluginCliRegistrations||(t._pluginCliRegistrations=[]),t._pluginCliRegistrations.push({pluginId:e,register:n,commands:o?.commands||[]}),P.debug("Plugin CLI registered",{pluginId:e,commands:o?.commands});}catch(a){throw P.error("Plugin CLI registration failed",{pluginId:e,error:a}),a}},registerCommand(n){try{if(t._pluginCommands||(t._pluginCommands=[]),!n.name||!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(n.name))throw new Error(`Invalid command name: ${n.name}`);let o=t._pluginCommands.find(s=>s.name.toLowerCase()===n.name.toLowerCase());if(o)throw new Error(`Command "${n.name}" is already registered by plugin "${o.pluginId}"`);let a=async s=>{try{return await n.handler(s)}catch(i){return P.error("Plugin command handler failed",{pluginId:e,commandName:n.name,error:i}),{text:`Command failed: ${i instanceof Error?i.message:String(i)}`}}};t._pluginCommands.push({...n,handler:a,pluginId:e}),P.debug("Plugin command registered",{pluginId:e,commandName:n.name});}catch(o){throw P.error("Plugin command registration failed",{pluginId:e,error:o}),o}}}}var g=a.create({service:"cli-plugin-discovery"});async function F(t){if(t.enabled===false)return g.debug("Plugin system is disabled"),[];let e=[],r=new Set;if(t.loadPaths)for(let s of t.loadPaths){let i=await I(s,"npm");for(let l of i)r.has(l.id)||(e.push(l),r.add(l.id));}let n=u.join(Ma.directory,".easbot","extensions");if(d.existsSync(n)){let s=await h(n,"workspace");for(let i of s)r.has(i.id)||(e.push(i),r.add(i.id));}let o=u.join(a$1.Path.config,"extensions");if(d.existsSync(o)){let s=await h(o,"global");for(let i of s)r.has(i.id)||(e.push(i),r.add(i.id));}let a=e.filter(s=>t.deny?.includes(s.id)?(g.debug("Plugin denied by blacklist",{pluginId:s.id}),false):t.allow&&t.allow.length>0&&!t.allow.includes(s.id)?(g.debug("Plugin not in whitelist",{pluginId:s.id}),false):true);return g.info("Discovered plugins",{count:a.length,plugins:a.map(s=>s.id)}),a}async function I(t,e){if(!d.existsSync(t))return g.debug("Plugin path does not exist",{pluginPath:t}),[];let r=d.statSync(t);return r.isFile()?A(t,e):r.isDirectory()?h(t,e):[]}async function A(t,e){let r=u.dirname(t),n=u.join(r,"easbot.plugin.json"),o;if(d.existsSync(n))try{o=JSON.parse(d.readFileSync(n,"utf-8"));}catch(s){return g.error("Failed to read plugin manifest",{manifestPath:n,error:s}),[]}let a=o?.id||u.basename(t,u.extname(t));return [{id:a,name:o?.name||a,version:o?.version||"0.0.0",description:o?.description,path:t,source:e,enabled:true,manifest:o}]}async function h(t,e){let r=[];try{let n=d.readdirSync(t,{withFileTypes:!0});for(let o of n){let a=u.join(t,o.name);if(o.isFile()&&(o.name.endsWith(".ts")||o.name.endsWith(".js"))){let s=await A(a,e);r.push(...s);}else if(o.isDirectory()){let s=u.join(a,"easbot.plugin.json");if(!d.existsSync(s)){g.debug("Plugin directory missing manifest",{entryPath:a});continue}let i;try{i=JSON.parse(d.readFileSync(s,"utf-8"));}catch(m){g.error("Failed to read plugin manifest",{manifestPath:s,error:m});continue}let l=i.main||"index.ts",f=u.join(a,l);if(d.existsSync(f))r.push({id:i.id,name:i.name||i.id,version:i.version||"0.0.0",description:i.description,path:f,source:e,enabled:!0,manifest:i});else {let m=["index.js","plugin.ts","plugin.js"],w=!1;for(let E of m){let C=u.join(a,E);if(d.existsSync(C)){r.push({id:i.id,name:i.name||i.id,version:i.version||"0.0.0",description:i.description,path:C,source:e,enabled:!0,manifest:i}),w=!0;break}}w||g.error("Plugin entry file not found",{entryPath:a,entryFile:l});}}}}catch(n){g.error("Failed to read plugin directory",{dirPath:t,error:n});}return r}var c=a.create({service:"cli-plugin-loader"}),b=class{constructor(e){b$1(this,"loadedPlugins",new Map);b$1(this,"context");this.context=e;}async loadAll(e){let r=await F(e),n=await Promise.allSettled(r.map(async i=>{let l=this.context.config.plugins,f=l&&typeof l=="object"&&"entries"in l&&l.entries&&typeof l.entries=="object"?l.entries[i.id]:void 0;if(f&&typeof f=="object"&&"enabled"in f&&f.enabled===false)return c.info("Plugin disabled in config",{pluginId:i.id}),{pluginId:i.id,status:"disabled"};try{return await this.loadPlugin(i),{pluginId:i.id,status:"loaded"}}catch(m){return c.error("Failed to load plugin",{pluginId:i.id,error:m}),{pluginId:i.id,status:"failed",error:m}}})),o=n.filter(i=>i.status==="fulfilled"&&i.value.status==="loaded").length,a=n.filter(i=>i.status==="fulfilled"&&i.value.status==="failed").length,s=n.filter(i=>i.status==="fulfilled"&&i.value.status==="disabled").length;c.info("All plugins processed",{total:r.length,loaded:o,failed:a,disabled:s});}async loadPlugin(e){if(this.loadedPlugins.has(e.id)){c.debug("Plugin already loaded",{pluginId:e.id});return}c.debug("Loading plugin",{pluginId:e.id,path:e.path});try{let r=await import(e.path),n=r.default||r.plugin;if(!n)throw new Error("Plugin module does not export a plugin definition");if(typeof n!="function"&&(typeof n!="object"||!n.register))throw new Error("Plugin must be a function or an object with a register method");this.loadedPlugins.set(e.id,n),await this.initializePlugin(e.id,n),c.info("Plugin loaded successfully",{pluginId:e.id,name:e.name});}catch(r){let n=r instanceof Error?r.message:String(r),o=r instanceof Error?r.stack:void 0;throw c.error("Failed to load plugin module",{pluginId:e.id,path:e.path,error:n,stack:o}),new Error(`Failed to load plugin "${e.id}" from ${e.path}: ${n}`)}}async initializePlugin(e,r){let n=this.context.config.plugins,o=n&&typeof n=="object"&&"entries"in n&&n.entries&&typeof n.entries=="object"?n.entries[e]:void 0,a=(o&&typeof o=="object"&&"config"in o?o.config:{})||{},s=S(this.context,e,a);try{if(typeof r=="function")await r(s);else {let i=r;i.id&&i.id!==e&&c.warn("Plugin ID mismatch",{expected:e,actual:i.id}),await i.register(s);}c.debug("Plugin initialized",{pluginId:e});}catch(i){throw c.error("Plugin initialization failed",{pluginId:e,error:i}),this.loadedPlugins.delete(e),new Error(`Plugin "${e}" initialization failed: ${i instanceof Error?i.message:String(i)}`)}}getPlugin(e){return this.loadedPlugins.get(e)}getLoadedPluginIds(){return Array.from(this.loadedPlugins.keys())}};function H(t){return new b(t)}export{b as a,H as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {formatLocalISOCompact}from'@easbot/utils';import {CommandMetadataSchema}from'@easbot/plugin';export{CommandMetadataSchema as a}from'@easbot/plugin';async function h(n){let{ConfigMarkdown:t}=await import('./markdown-Z6UXVBNP.mjs'),e=await t.parse(n);return {metadata:CommandMetadataSchema.parse(e.data),content:e.content}}function x(n,t,e="command"){return {name:n.name,description:n.description,agent:n.agent,model:n.model,source:e,scope:n.scope,commandType:n.commandType??"prompt",hints:n.hints??[],hidden:n.hidden??false,execute:async(o,i)=>{let m=w(t,o);return {title:n.name,metadata:{sessionID:i.sessionID},output:m,success:true,parts:[{type:"text",text:m}]}}}}async function D(n,t="command"){let{glob:e}=await import('glob'),{Filesystem:o}=await import('@easbot/utils');if(!await o.isDir(n))return [];let i=await e("*.md",{cwd:n,absolute:true,nodir:true,follow:false,dot:false}),m=[];for(let r of i){let{ConfigMarkdown:d}=await import('./markdown-Z6UXVBNP.mjs'),{Bus:u}=await import('./bus-
|
|
1
|
+
import {formatLocalISOCompact}from'@easbot/utils';import {CommandMetadataSchema}from'@easbot/plugin';export{CommandMetadataSchema as a}from'@easbot/plugin';async function h(n){let{ConfigMarkdown:t}=await import('./markdown-Z6UXVBNP.mjs'),e=await t.parse(n);return {metadata:CommandMetadataSchema.parse(e.data),content:e.content}}function x(n,t,e="command"){return {name:n.name,description:n.description,agent:n.agent,model:n.model,source:e,scope:n.scope,commandType:n.commandType??"prompt",hints:n.hints??[],hidden:n.hidden??false,execute:async(o,i)=>{let m=w(t,o);return {title:n.name,metadata:{sessionID:i.sessionID},output:m,success:true,parts:[{type:"text",text:m}]}}}}async function D(n,t="command"){let{glob:e}=await import('glob'),{Filesystem:o}=await import('@easbot/utils');if(!await o.isDir(n))return [];let i=await e("*.md",{cwd:n,absolute:true,nodir:true,follow:false,dot:false}),m=[];for(let r of i){let{ConfigMarkdown:d}=await import('./markdown-Z6UXVBNP.mjs'),{Bus:u}=await import('./bus-4LDPSAHL.mjs'),{Session:p}=await import('./session-XS2QUVSO.mjs'),{NamedError:C}=await import('@easbot/utils');await d.parse(r).then(a=>{let s=CommandMetadataSchema.parse(a.data),f=x(s,a.content,t);m.push(f);}).catch(a=>{let s=a instanceof Error?a.message:`Failed to load command ${r}`;u.publish(p.Event.Error,{error:new C.Unknown({message:s}).toObject()});});}return m}function g(n){return n instanceof Date?formatLocalISOCompact(n):Array.isArray(n)||n!==null&&typeof n=="object"&&n.constructor===Object?JSON.stringify(n,null,2):String(n)}function w(n,t){return typeof t=="string"?n.replace(/\{\{ARGUMENTS\}\}/gi,t):n.replace(/\{\{(\w+)\}\}/gi,(e,o)=>{let i=o.toUpperCase();if(i==="ARGUMENTS")return JSON.stringify(t);let m=t[o]??t[i];return m===void 0?`{{${o}}}`:g(m)})}function I(n,t){let{init:e,isEnabled:o,...i}=t;return {...i,name:n,isEnabled:o,init:e?async m=>({isEnabled:(await e(m)).isEnabled??(typeof o=="function"?await o():o)}):void 0}}export{h as b,x as c,D as d,w as e,I as f};
|