agentix-cli 0.130.0 → 0.131.0
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/{App-DWSHIDN6.js → App-WZ3HAKES.js} +2 -2
- package/dist/{ChatApp-CROSI7JM.js → ChatApp-K4HDJL2S.js} +2 -2
- package/dist/absorb-eval-ER27DHHK.js +2 -0
- package/dist/{agent-4AQOFPRD.js → agent-AQSVISXX.js} +2 -2
- package/dist/article-sync-4NOPOQU7.js +2 -0
- package/dist/{board-dashboard-54A3XTV5.js → board-dashboard-3AI2Z2SP.js} +243 -210
- package/dist/board-dashboard-3AI2Z2SP.js.map +1 -0
- package/dist/chunk-2SXF66O6.js +55 -0
- package/dist/chunk-2SXF66O6.js.map +1 -0
- package/dist/{chunk-5VKFIBXY.js → chunk-2YB2G2BP.js} +2 -2
- package/dist/chunk-2ZDV3DCT.js +52 -0
- package/dist/chunk-2ZDV3DCT.js.map +1 -0
- package/dist/chunk-3UOTLMXD.js +4 -0
- package/dist/chunk-3UOTLMXD.js.map +1 -0
- package/dist/chunk-5BI2T3WD.js +3 -0
- package/dist/chunk-5BI2T3WD.js.map +1 -0
- package/dist/{chunk-242MPMJX.js → chunk-6O6NW3ZG.js} +2 -2
- package/dist/chunk-6TURWSMN.js +3 -0
- package/dist/{chunk-VD7IO653.js.map → chunk-6TURWSMN.js.map} +1 -1
- package/dist/{chunk-BGG3ZSMW.js → chunk-7LN4VKDU.js} +14 -16
- package/dist/chunk-7LN4VKDU.js.map +1 -0
- package/dist/chunk-7UPFZJIT.js +861 -0
- package/dist/chunk-7UPFZJIT.js.map +1 -0
- package/dist/chunk-7VLLZQ3N.js +2 -0
- package/dist/chunk-7VLLZQ3N.js.map +1 -0
- package/dist/{chunk-TJDNS5G6.js → chunk-AKOXTIJS.js} +2 -2
- package/dist/{chunk-U2EHJZAZ.js → chunk-APZIH3AY.js} +2 -2
- package/dist/{chunk-Q5FEWCS5.js → chunk-B2Q3PTPS.js} +2 -2
- package/dist/{chunk-SCJ5ZXEN.js → chunk-B2QYMUTD.js} +2 -2
- package/dist/{chunk-SCJ5ZXEN.js.map → chunk-B2QYMUTD.js.map} +1 -1
- package/dist/chunk-BIJHMWXK.js +21 -0
- package/dist/chunk-BIJHMWXK.js.map +1 -0
- package/dist/{chunk-4VDA4UM7.js → chunk-BKHIR2YJ.js} +2 -2
- package/dist/chunk-CBFBGN7J.js +54 -0
- package/dist/chunk-CBFBGN7J.js.map +1 -0
- package/dist/{chunk-QXZLYCEZ.js → chunk-CL33CRH5.js} +3 -3
- package/dist/chunk-CL33CRH5.js.map +1 -0
- package/dist/{chunk-N2YSVZML.js → chunk-CSWGYSC4.js} +2 -2
- package/dist/{chunk-5KKXJZZ4.js → chunk-E2VDBT3T.js} +2 -2
- package/dist/{chunk-WX67I2KN.js → chunk-ERNBJLIQ.js} +2 -2
- package/dist/{chunk-I4GT27UO.js → chunk-IA7INHXY.js} +2 -2
- package/dist/chunk-IMLAPB7G.js +4 -0
- package/dist/chunk-IMLAPB7G.js.map +1 -0
- package/dist/{chunk-3PGPN323.js → chunk-JP5OAMWQ.js} +1 -1
- package/dist/chunk-JP5OAMWQ.js.map +1 -0
- package/dist/chunk-KFIJDLQ5.js +3 -0
- package/dist/chunk-KFIJDLQ5.js.map +1 -0
- package/dist/{chunk-QPYN2UTV.js → chunk-KIYV4ZHG.js} +2 -2
- package/dist/{chunk-YHCPBMRH.js → chunk-KRK7OOTK.js} +2 -2
- package/dist/{chunk-MZJY26FW.js → chunk-L2WVQREN.js} +2 -2
- package/dist/{chunk-LJWEJ6UZ.js → chunk-L4ALHWII.js} +2 -2
- package/dist/{chunk-UBA2QJCY.js → chunk-L4ZS4HGJ.js} +268 -251
- package/dist/chunk-L4ZS4HGJ.js.map +1 -0
- package/dist/chunk-MCBTVNPX.js +152 -0
- package/dist/chunk-MCBTVNPX.js.map +1 -0
- package/dist/{chunk-RKB7FQJF.js → chunk-MFIM5Y3J.js} +2 -2
- package/dist/chunk-MRIVENBY.js +2 -0
- package/dist/{article-sync-TLZTHRZB.js.map → chunk-MRIVENBY.js.map} +1 -1
- package/dist/{chunk-W2HEJKJR.js → chunk-VSL2SSBH.js} +6 -6
- package/dist/{chunk-LLLBH2HH.js → chunk-WKQQIYOE.js} +2 -2
- package/dist/{chunk-TN5A7PLU.js → chunk-YA6E47BR.js} +2 -2
- package/dist/{chunk-HF4OXA5L.js → chunk-YPCZ5TNK.js} +2 -2
- package/dist/{chunk-J4I5ZJ2V.js → chunk-YQRWUF4Y.js} +2 -2
- package/dist/{chunk-NR7WLMNI.js → chunk-YVR6652A.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/{client-KGWYROLX.js → client-YIR3ELVN.js} +2 -2
- package/dist/config-4DOJYA2K.js +2 -0
- package/dist/{config-mutate-7BLOYRZF.js → config-mutate-KDRHKQE4.js} +2 -2
- package/dist/config-mutator-4PPBACWU.js +2 -0
- package/dist/{contributions-DLUQEAGL.js → contributions-MTKXXLIP.js} +2 -2
- package/dist/{contributions-DLUQEAGL.js.map → contributions-MTKXXLIP.js.map} +1 -1
- package/dist/{doctor-32YP26SJ.js → doctor-FJ5RCG4J.js} +2 -2
- package/dist/enrich-NH3WHKD6.js +16 -0
- package/dist/enrich-NH3WHKD6.js.map +1 -0
- package/dist/{follow-up-tool-AQ7NYZZR.js → follow-up-tool-SVZDSUIU.js} +2 -2
- package/dist/graph-EXDH7EPZ.js +2 -0
- package/dist/hub-CF4VFSRT.js +2 -0
- package/dist/index.d.ts +484 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/load-5DNMGHFW.js +2 -0
- package/dist/model-call-BGTDPWZD.js +2 -0
- package/dist/notes-WJJEJ4CJ.js +2 -0
- package/dist/processes-M3N3S7V5.js +2 -0
- package/dist/{program-FESSM5TY.js → program-ZPNEAACQ.js} +231 -229
- package/dist/program-ZPNEAACQ.js.map +1 -0
- package/dist/{promote-R7FKN5SY.js → promote-G6BOY7K5.js} +2 -2
- package/dist/query-H24BI3BI.js +2 -0
- package/dist/query-settings-IJB3QMDW.js +3 -0
- package/dist/query-settings-IJB3QMDW.js.map +1 -0
- package/dist/registry-TAUHYJCK.js +2 -0
- package/dist/{request-planner-LEUMSI2K.js → request-planner-V3R5J3V4.js} +2 -2
- package/dist/{review-candidates-MOSGA4IS.js → review-candidates-TC7RJB4W.js} +2 -2
- package/dist/roster-IRXP32XF.js +2 -0
- package/dist/{rotation-memo-7VLREGS6.js → rotation-memo-2G6N3VF3.js} +2 -2
- package/dist/{routing-FSJ42RZH.js → routing-XQD74ERK.js} +2 -2
- package/dist/schedule-tool-U6KLY5MT.js +2 -0
- package/dist/{scheduler-6AQDHQI4.js → scheduler-WOOXIOER.js} +2 -2
- package/dist/scheduler-WOOXIOER.js.map +1 -0
- package/dist/{seat-O37EQRHE.js → seat-B75JIAS3.js} +2 -2
- package/dist/seat-B75JIAS3.js.map +1 -0
- package/dist/{select-XO2STSQN.js → select-I6BSBQXP.js} +2 -2
- package/dist/{set-enabled-ZNEPEFGF.js → set-enabled-THNVITGU.js} +2 -2
- package/dist/summaries-BIRSNWGH.js +2 -0
- package/dist/summaries-BIRSNWGH.js.map +1 -0
- package/dist/{tool-6KMEAY4U.js → tool-CEBIS6GK.js} +2 -2
- package/dist/{tool-PH45YCO5.js → tool-LFWTZHB7.js} +2 -2
- package/dist/wiki-3ATPAHC2.js +2 -0
- package/dist/wiki-3ATPAHC2.js.map +1 -0
- package/dist/workspace-env-ROH45HXN.js +2 -0
- package/dist/workspace-env-ROH45HXN.js.map +1 -0
- package/package.json +1 -1
- package/dist/absorb-eval-MNGQ752C.js +0 -2
- package/dist/article-sync-TLZTHRZB.js +0 -2
- package/dist/board-dashboard-54A3XTV5.js.map +0 -1
- package/dist/chunk-3PGPN323.js.map +0 -1
- package/dist/chunk-AERIU4AH.js +0 -892
- package/dist/chunk-AERIU4AH.js.map +0 -1
- package/dist/chunk-BGG3ZSMW.js.map +0 -1
- package/dist/chunk-EO4DEEXL.js +0 -2
- package/dist/chunk-EO4DEEXL.js.map +0 -1
- package/dist/chunk-I4OQQRY2.js +0 -55
- package/dist/chunk-I4OQQRY2.js.map +0 -1
- package/dist/chunk-JE5EJGGD.js +0 -4
- package/dist/chunk-JE5EJGGD.js.map +0 -1
- package/dist/chunk-QX2B4TJU.js +0 -3
- package/dist/chunk-QX2B4TJU.js.map +0 -1
- package/dist/chunk-QXZLYCEZ.js.map +0 -1
- package/dist/chunk-UBA2QJCY.js.map +0 -1
- package/dist/chunk-UUFJQMHE.js +0 -54
- package/dist/chunk-UUFJQMHE.js.map +0 -1
- package/dist/chunk-VD7IO653.js +0 -3
- package/dist/config-FNTLKUGA.js +0 -2
- package/dist/config-mutator-NCLHYPJ3.js +0 -2
- package/dist/graph-5ZJ7YACP.js +0 -2
- package/dist/hub-Q3I4ALQ2.js +0 -2
- package/dist/load-NK3MIYXP.js +0 -2
- package/dist/notes-TMAGEDUS.js +0 -2
- package/dist/processes-5MP32QZT.js +0 -2
- package/dist/program-FESSM5TY.js.map +0 -1
- package/dist/query-YTKTNXCQ.js +0 -2
- package/dist/registry-7L4RUATA.js +0 -2
- package/dist/schedule-tool-4T2VZIDW.js +0 -2
- package/dist/wiki-4HD4FZ4W.js +0 -2
- /package/dist/{App-DWSHIDN6.js.map → App-WZ3HAKES.js.map} +0 -0
- /package/dist/{ChatApp-CROSI7JM.js.map → ChatApp-K4HDJL2S.js.map} +0 -0
- /package/dist/{absorb-eval-MNGQ752C.js.map → absorb-eval-ER27DHHK.js.map} +0 -0
- /package/dist/{agent-4AQOFPRD.js.map → agent-AQSVISXX.js.map} +0 -0
- /package/dist/{client-KGWYROLX.js.map → article-sync-4NOPOQU7.js.map} +0 -0
- /package/dist/{chunk-5VKFIBXY.js.map → chunk-2YB2G2BP.js.map} +0 -0
- /package/dist/{chunk-242MPMJX.js.map → chunk-6O6NW3ZG.js.map} +0 -0
- /package/dist/{chunk-TJDNS5G6.js.map → chunk-AKOXTIJS.js.map} +0 -0
- /package/dist/{chunk-U2EHJZAZ.js.map → chunk-APZIH3AY.js.map} +0 -0
- /package/dist/{chunk-Q5FEWCS5.js.map → chunk-B2Q3PTPS.js.map} +0 -0
- /package/dist/{chunk-4VDA4UM7.js.map → chunk-BKHIR2YJ.js.map} +0 -0
- /package/dist/{chunk-N2YSVZML.js.map → chunk-CSWGYSC4.js.map} +0 -0
- /package/dist/{chunk-5KKXJZZ4.js.map → chunk-E2VDBT3T.js.map} +0 -0
- /package/dist/{chunk-WX67I2KN.js.map → chunk-ERNBJLIQ.js.map} +0 -0
- /package/dist/{chunk-I4GT27UO.js.map → chunk-IA7INHXY.js.map} +0 -0
- /package/dist/{chunk-QPYN2UTV.js.map → chunk-KIYV4ZHG.js.map} +0 -0
- /package/dist/{chunk-YHCPBMRH.js.map → chunk-KRK7OOTK.js.map} +0 -0
- /package/dist/{chunk-MZJY26FW.js.map → chunk-L2WVQREN.js.map} +0 -0
- /package/dist/{chunk-LJWEJ6UZ.js.map → chunk-L4ALHWII.js.map} +0 -0
- /package/dist/{chunk-RKB7FQJF.js.map → chunk-MFIM5Y3J.js.map} +0 -0
- /package/dist/{chunk-W2HEJKJR.js.map → chunk-VSL2SSBH.js.map} +0 -0
- /package/dist/{chunk-LLLBH2HH.js.map → chunk-WKQQIYOE.js.map} +0 -0
- /package/dist/{chunk-TN5A7PLU.js.map → chunk-YA6E47BR.js.map} +0 -0
- /package/dist/{chunk-HF4OXA5L.js.map → chunk-YPCZ5TNK.js.map} +0 -0
- /package/dist/{chunk-J4I5ZJ2V.js.map → chunk-YQRWUF4Y.js.map} +0 -0
- /package/dist/{chunk-NR7WLMNI.js.map → chunk-YVR6652A.js.map} +0 -0
- /package/dist/{config-FNTLKUGA.js.map → client-YIR3ELVN.js.map} +0 -0
- /package/dist/{config-mutate-7BLOYRZF.js.map → config-4DOJYA2K.js.map} +0 -0
- /package/dist/{config-mutator-NCLHYPJ3.js.map → config-mutate-KDRHKQE4.js.map} +0 -0
- /package/dist/{doctor-32YP26SJ.js.map → config-mutator-4PPBACWU.js.map} +0 -0
- /package/dist/{graph-5ZJ7YACP.js.map → doctor-FJ5RCG4J.js.map} +0 -0
- /package/dist/{follow-up-tool-AQ7NYZZR.js.map → follow-up-tool-SVZDSUIU.js.map} +0 -0
- /package/dist/{hub-Q3I4ALQ2.js.map → graph-EXDH7EPZ.js.map} +0 -0
- /package/dist/{load-NK3MIYXP.js.map → hub-CF4VFSRT.js.map} +0 -0
- /package/dist/{notes-TMAGEDUS.js.map → load-5DNMGHFW.js.map} +0 -0
- /package/dist/{processes-5MP32QZT.js.map → model-call-BGTDPWZD.js.map} +0 -0
- /package/dist/{promote-R7FKN5SY.js.map → notes-WJJEJ4CJ.js.map} +0 -0
- /package/dist/{query-YTKTNXCQ.js.map → processes-M3N3S7V5.js.map} +0 -0
- /package/dist/{registry-7L4RUATA.js.map → promote-G6BOY7K5.js.map} +0 -0
- /package/dist/{routing-FSJ42RZH.js.map → query-H24BI3BI.js.map} +0 -0
- /package/dist/{schedule-tool-4T2VZIDW.js.map → registry-TAUHYJCK.js.map} +0 -0
- /package/dist/{request-planner-LEUMSI2K.js.map → request-planner-V3R5J3V4.js.map} +0 -0
- /package/dist/{review-candidates-MOSGA4IS.js.map → review-candidates-TC7RJB4W.js.map} +0 -0
- /package/dist/{scheduler-6AQDHQI4.js.map → roster-IRXP32XF.js.map} +0 -0
- /package/dist/{rotation-memo-7VLREGS6.js.map → rotation-memo-2G6N3VF3.js.map} +0 -0
- /package/dist/{seat-O37EQRHE.js.map → routing-XQD74ERK.js.map} +0 -0
- /package/dist/{wiki-4HD4FZ4W.js.map → schedule-tool-U6KLY5MT.js.map} +0 -0
- /package/dist/{select-XO2STSQN.js.map → select-I6BSBQXP.js.map} +0 -0
- /package/dist/{set-enabled-ZNEPEFGF.js.map → set-enabled-THNVITGU.js.map} +0 -0
- /package/dist/{tool-6KMEAY4U.js.map → tool-CEBIS6GK.js.map} +0 -0
- /package/dist/{tool-PH45YCO5.js.map → tool-LFWTZHB7.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
1
|
+
import{a as h}from"./chunk-YVR6652A.js";import{resolve as n}from"path";import{existsSync as c,readdirSync as u,mkdirSync as l,readFileSync as p,writeFileSync as f,renameSync as S}from"fs";var m=class{baseDir;agentsDir;mode;sharedStore;agentStores=new Map;log;constructor(e=n(process.cwd(),".agentx/wiki"),r=console.error.bind(console,"[wiki-hub]"),t="graph"){this.baseDir=e,this.agentsDir=n(e,"agents"),this.mode=t,this.log=r,l(this.agentsDir,{recursive:!0}),this.sharedStore=new h(e,r)}getMode(){return this.mode}getAgentWiki(e){let r=`${e}:${this.mode}`;if(this.agentStores.has(r))return this.agentStores.get(r);let t=n(this.agentsDir,e,this.mode),s=new h(t,this.log);return this.agentStores.set(r,s),s}getBaseDir(){return this.baseDir}getSharedStore(){return this.sharedStore}sharedScope(e){return[...this.listAgentDirs().filter(t=>t!==e).map(t=>({id:t,store:this.getAgentWiki(t)})),{id:"shared",store:this.sharedStore,skip:t=>t.startsWith("agents/")}]}listAgentDirs(){return c(this.agentsDir)?u(this.agentsDir).filter(e=>!e.startsWith("_")&&!e.startsWith(".")&&c(n(this.agentsDir,e,this.mode))).sort():[]}listAgents(e=this.sharedStore.listEntries()){let r=new Set;for(let t of e)r.add(t.agentId);if(c(this.agentsDir))for(let t of u(this.agentsDir))!t.startsWith("_")&&!t.startsWith(".")&&r.add(t);return[...r].sort()}getAgentEntries(e){return this.sharedStore.listEntries({agentId:e})}getUnabsorbedEntries(e){return this.classifyEntries(e).pending}markProcessed(e,r,t){let s=new Set(t),g=this.readLedger(e),d=new Date().toISOString();for(let i of r)g.entries[i]={at:d,cited:s.has(i)};let o=this.ledgerPath(e);l(n(o,".."),{recursive:!0});let a=`${o}.tmp`;f(a,`${JSON.stringify(g,null,2)}
|
|
2
2
|
`),S(a,o)}summary(){let e=this.sharedStore.listEntries(),r=new Map;for(let t of e){let s=r.get(t.agentId);s?s.push(t):r.set(t.agentId,[t])}return this.listAgents(e).map(t=>{let{all:s,cited:g,read:d,pending:o,articles:a}=this.classifyEntries(t,r.get(t)??[]);return{agentId:t,totalEntries:s.length,totalArticles:a.length,cited:g.length,readNotCited:d.length,unabsorbed:o.length,articles:a}})}classifyEntries(e,r=this.getAgentEntries(e)){let t=this.getAgentWiki(e).rebuildIndex().articles,s=new Set;for(let i of t)if(i.sources)for(let y of i.sources)s.add(y);let g=this.readLedger(e).entries,d=[],o=[],a=[];for(let i of r)s.has(i.id)?d.push(i):g[i.id]?o.push(i):a.push(i);return{all:r,cited:d,read:o,pending:a,articles:t}}syncedFrom(e){let r=n(this.agentsDir,e,"_synced.json");if(!c(r))return null;try{return JSON.parse(p(r,"utf-8"))}catch(t){return this.log(`synced marker ${r} is not valid JSON: ${t.message}`),{node:"unknown",peerUrl:"",at:""}}}markSynced(e,r){let t=n(this.agentsDir,e,"_synced.json");l(n(t,".."),{recursive:!0});let s=`${t}.tmp`;f(s,`${JSON.stringify(r,null,2)}
|
|
3
3
|
`),S(s,t)}ledgerPath(e){return n(this.agentsDir,e,"_absorbed.json")}readLedger(e){let r=this.ledgerPath(e);if(!c(r))return{entries:{}};try{return{entries:JSON.parse(p(r,"utf-8")).entries??{}}}catch(t){throw new Error(`absorb ledger ${r} is not valid JSON: ${t.message}`)}}};export{m as a};
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
4
|
+
//# sourceMappingURL=chunk-AKOXTIJS.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as D,b as _}from"./chunk-RKPAVWXF.js";import{a as R,b as q,c as O,d as B,f as k,g as v,h as E,i as w,j as y}from"./chunk-
|
|
1
|
+
import{a as D,b as _}from"./chunk-RKPAVWXF.js";import{a as R,b as q,c as O,d as B,f as k,g as v,h as E,i as w,j as y}from"./chunk-6O6NW3ZG.js";import{a as T,b as C,c as I,d as x,e as P}from"./chunk-YQRWUF4Y.js";import{existsSync as X,readFileSync as F}from"fs";var J=new Set(["cron","heartbeat","api","a2a","mesh"]),M=160;function s(n){return typeof n=="string"&&n.trim()?n.trim():void 0}function S(n,e=M){let t=n.replace(/\s+/g," ").trim();return t.length>e?`${t.slice(0,e-1)}\u2026`:t}function V(n){let e=T(n);if(!X(e))throw new Error(`config not found at ${e}`);return JSON.parse(F(e,"utf-8"))}function W(n,e){return n?.agents?.[e]?.admin===!0}function Y(n,e,t){return W(n,t.agentId)||e?.createdBy===t.agentId}function Z(n,e){let t=e?.createdBy?`agent "${e.createdBy}"`:"the operator";return`Not allowed: "${n}" was created by ${t}. Agents manage only schedules they created (unless configured admin).`}function K(n,e){let t=s(n.notify);if(t!=="none"){if(t&&t!=="here"){let r=t.split(":");return r.length<2||!r[0]||!r[1]?"invalid":{channel:r[0],chatId:r.slice(1).join(":")}}if(e.channel&&e.chatId&&!J.has(e.channel))return{channel:e.channel,chatId:e.chatId,...e.accountId?{accountId:e.accountId}:{}}}}function Q(n,e,t){let r=e.timezone||"UTC",d=e.enabled&&!y(e)?w(E(e.schedule,r,t),r):"\u2014",h=e.approval?`pending ${e.approval.action} approval`:e.enabled?"active":"paused",f=[`- ${n} [${h}] ${e.schedule} \u2014 ${v(e.schedule)} (${r})`,` agent: ${e.agent}; created by: ${e.createdBy||"operator"}; next: ${d}`];return e.notify&&f.push(` notify: ${e.notify.channel} ${e.notify.chatId}${e.deliverResult===!1?" (failures only)":" (results and failures)"}`),e.command?f.push(` command: ${S(String(e.command))}`):e.prompt&&f.push(` prompt: ${S(String(e.prompt))}`),f.join(`
|
|
2
2
|
`)}async function b(n,e,t){let r=n?.notifications?.destination;if(!r?.channel||!r?.chatId)return"No operator notification destination is configured (notifications.destination); the operator must check `agentx schedule list`.";if(!e.notifyOperator)return"Operator notification is unavailable in this context.";try{return await e.notifyOperator({channel:r.channel,chatId:r.chatId,accountId:r.accountId},t),"The operator has been notified."}catch(d){return`Could not notify the operator (${d?.message??d}); the request is still recorded.`}}async function re(n,e,t={}){let r=(s(n.action)||"list").toLowerCase(),d=t.now?t.now():new Date,h;try{h=V(t.configPath)}catch(a){return`Error: ${a.message}`}let f=h.crons||{};if(r==="list"){let a=n.mine===!0,l=Object.entries(f).filter(([,i])=>!a||e&&i?.createdBy===e.agentId);return l.length?l.map(([i,p])=>Q(i,p,d)).join(`
|
|
3
3
|
`):a?"You have no schedules.":"No schedules."}if(!e?.agentId)return"Error: caller agent is unknown (AGENTX_AGENT_ID not set). Pass callerAgentId.";if(!h.agents?.[e.agentId])return`Error: caller "${e.agentId}" is not an agent on this node.`;let o=s(n.id),m=a=>C(a,{configPath:t.configPath,reload:t.reload});if(r==="create"){let a=s(n.when),l=s(n.prompt);if(!a||!l)return"Error: create needs `when` (plain English) and `prompt`.";let i=D(a);if(!i)return`Error: couldn't parse "${a}". ${q}.`;let p=s(n.agent)||e.agentId;if(!h.agents?.[p])return`Error: agent "${p}" not found on this node.`;let g=s(n.timezone)||R;if(!B(g))return`Error: unknown timezone "${g}".`;let u=o||_(i.matched,p);if(!O(u))return`Error: invalid id "${u}" (letters, digits, "-" and "_" only).`;if(f[u])return`Error: a schedule "${u}" already exists. Pick another \`id\`.`;let $=K(n,e);if($==="invalid")return'Error: `notify` must be "here", "none", or "channel:chatId".';let z={action:"create",requestedBy:e.agentId,requestedAt:d.toISOString()},L=k({parsed:i,agent:p,prompt:l,timezone:g,notify:$,enabled:!1,createdBy:e.agentId,approval:z}),A=await m(U=>I(U,`crons.${u}`,L));if(!A.success)return`Error: ${A.error}`;let N=w(E(i.cron,g,d),g),G=[`Schedule approval requested by ${e.agentId}`,`Create: ${u}`,`When: ${i.human} \u2014 cron \`${i.cron}\` (${g})`,`Next fire: ${N}`,`Agent: ${p}`,$?`Results and failures go to: ${$.channel} ${$.chatId}${$.channel==="voice"?" (as a push notification)":""}`:"Results go to: run log only (no chat)",`Prompt: ${S(l,400)}`,"",`Approve: agentx schedule approve ${u}`,`Reject: agentx schedule reject ${u}`].join(`
|
|
4
4
|
`),H=await b(h,t,G);return[`Requested schedule "${u}": ${i.human} (cron ${i.cron}, ${g}); next fire would be ${N}.`,"It is saved DISABLED and will not run until the operator approves it.",H].join(`
|
|
5
5
|
`)}if(!o)return`Error: ${r} needs \`id\`.`;let c=f[o];if(!c)return`Error: schedule "${o}" not found.`;if(!Y(h,c,e))return Z(o,c);if(r==="pause"||r==="resume"){let a=r==="resume";if(a&&y(c))return`"${o}" is still awaiting operator approval; it can't be resumed until approved.`;if(c.enabled===a)return`"${o}" is already ${a?"active":"paused"}.`;let l=await m(i=>I(i,`crons.${o}.enabled`,a));return l.success?`"${o}" ${a?"resumed":"paused"}.`:`Error: ${l.error}`}if(r==="delete"){if(y(c)&&c.approval.requestedBy===e.agentId){let u=await m($=>P($,`crons.${o}`));return u.success?`Withdrew the pending request "${o}".`:`Error: ${u.error}`}if(y(c))return`"${o}" is a creation request still awaiting approval; only its requester or the operator (\`agentx schedule reject ${o}\`) can drop it.`;if(c.approval?.action==="delete")return`Deletion of "${o}" is already awaiting approval.`;let a={action:"delete",requestedBy:e.agentId,requestedAt:d.toISOString()},l=await m(u=>{if(!x(u,`crons.${o}`))throw new Error(`schedule "${o}" not found`);I(u,`crons.${o}.approval`,a)});if(!l.success)return`Error: ${l.error}`;let i=c.timezone||"UTC",p=[`Schedule approval requested by ${e.agentId}`,`Delete: ${o}`,`When: ${v(c.schedule)} \u2014 cron \`${c.schedule}\` (${i})`,`Next fire: ${c.enabled?w(E(c.schedule,i,d),i):"\u2014 (paused)"}`,`Agent: ${c.agent}`,"",`Approve: agentx schedule approve ${o}`,`Reject: agentx schedule reject ${o}`].join(`
|
|
6
6
|
`),g=await b(h,t,p);return[`Deletion of "${o}" requested. It keeps its current state until the operator approves.`,g].join(`
|
|
7
7
|
`)}return`Error: unknown action "${r}". Use list, create, pause, resume or delete.`}function oe(n,e=process.env){let t=s(e.AGENTX_AGENT_ID)||s(n.callerAgentId);if(!t)return null;let r=!!(s(e.AGENTX_CHANNEL)&&s(e.AGENTX_CHAT_ID)),d=s(r?e.AGENTX_CHANNEL:n.channel),h=s(r?e.AGENTX_CHAT_ID:n.chatId),f=s(n.accountId);return{agentId:t,channel:d,chatId:h,...f?{accountId:f}:{}}}export{re as a,oe as b};
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
//# sourceMappingURL=chunk-APZIH3AY.js.map
|
|
@@ -48,7 +48,7 @@ The "modified" field is optional and can contain updated values to pass forward.
|
|
|
48
48
|
... (output truncated)`:i;return s.exitCode!==0?{tool_use_id:e.id,content:`Command exited with code ${s.exitCode}:
|
|
49
49
|
${c}`,is_error:!0}:{tool_use_id:e.id,content:c||"(no output)"}}async editFile(e){let t=String(e.input.path||""),o=e.input.edits,n=ge.resolve(this.cwd,t);if(!o||o.length===0)return{tool_use_id:e.id,content:"No edits provided.",is_error:!0};let s=await W.checkFileWrite(t);if(s==="deny")return{tool_use_id:e.id,content:`File write blocked by permissions: ${t}`,is_error:!0};if(s==="skip")return{tool_use_id:e.id,content:`File write skipped (plan mode): ${t}`};if(f.has("pre:file-write")){let a=await f.execute("pre:file-write",{event:"pre:file-write",file:n,cwd:this.cwd});if(a.blocked)return{tool_use_id:e.id,content:a.message||`File edit blocked by pre:file-write hook: ${t}`,is_error:!0}}let i=await re.readFile(n,"utf8"),c=[];for(let a of o)i.includes(a.old_text)?(i=i.replace(a.old_text,a.new_text),c.push(`Replaced: "${a.old_text.slice(0,40)}..."`)):c.push(`Not found: "${a.old_text.slice(0,40)}..."`);return this.options.dryRun||await re.writeFile(n,i,"utf8"),f.has("post:file-write")&&await f.execute("post:file-write",{event:"post:file-write",file:n,fileContent:i,cwd:this.cwd}),{tool_use_id:e.id,content:`Edited ${t}:
|
|
50
50
|
${c.join(`
|
|
51
|
-
`)}`}}async createFiles(e){let t=e.input,o=t.files||[];return{tool_use_id:e.id,content:t.summary||`Queued ${o.length} file(s) for creation.`,files:o}}async spawnAgent(e){let t=String(e.input.agent_id||""),o=String(e.input.prompt||""),n=Number(e.input.timeout_seconds)||300;if(!t||!o)return{tool_use_id:e.id,content:"agent_id and prompt are required.",is_error:!0};try{let{SubAgentManager:s}=await import("./subagent-XY5N7TUU.js"),{getGlobalRegistry:i}=await import("./registry-
|
|
51
|
+
`)}`}}async createFiles(e){let t=e.input,o=t.files||[];return{tool_use_id:e.id,content:t.summary||`Queued ${o.length} file(s) for creation.`,files:o}}async spawnAgent(e){let t=String(e.input.agent_id||""),o=String(e.input.prompt||""),n=Number(e.input.timeout_seconds)||300;if(!t||!o)return{tool_use_id:e.id,content:"agent_id and prompt are required.",is_error:!0};try{let{SubAgentManager:s}=await import("./subagent-XY5N7TUU.js"),{getGlobalRegistry:i}=await import("./registry-TAUHYJCK.js"),c=i();if(!c)return{tool_use_id:e.id,content:"Sub-agent spawning requires the daemon to be running.",is_error:!0};let p=await new s(c).spawn({targetAgentId:t,prompt:o,parentAgentId:"orchestrator",timeout:n*1e3});return p.success?{tool_use_id:e.id,content:`Sub-agent "${t}" completed (${Math.round(p.duration/1e3)}s):
|
|
52
52
|
|
|
53
53
|
${p.content}`}:{tool_use_id:e.id,content:`Sub-agent "${t}" failed: ${p.error}`,is_error:!0}}catch(s){return{tool_use_id:e.id,content:`Failed to spawn sub-agent: ${s.message}`,is_error:!0}}}async askUser(e){let t=String(e.input.question||""),o=e.input.options,n=t;return o?.length&&(n+=`
|
|
54
54
|
Options: ${o.join(", ")}`),{tool_use_id:e.id,content:"Question sent to user.",followUp:n}}};async function Ae(r){let{provider:e,systemPrompt:t,messages:o,providerOptions:n,cwd:s,maxIterations:i=20,enabledTools:c,interactive:a=!0,overwrite:p=!1,dryRun:l=!1,onProgress:d,abortSignal:u}=r,m=u?{...n,abortSignal:u}:n;if(!e.generateRaw)return dt(r);let I=new se(s,{interactive:a,overwrite:p,dryRun:l,acmeContext:r.acmeContext,abortSignal:u}),D=be(c);if(r.acmeContext)for(let g of at)D.push({name:g.name,description:g.description,input_schema:g.input_schema});let E=new Set;if(r.mcpTools?.length)for(let g of r.mcpTools)D.push({name:g.name,description:g.description,input_schema:g.input_schema}),E.add(g.name);let C=o.filter(g=>g.role!=="system").map(g=>({role:g.role,content:g.content})),B=[],G=0,F=0,A=0,O="",j,_=0;for(;_<i;){if(_++,u?.aborted)throw new Error("cancelled");d?.({type:"iteration_start",iteration:_}),b.step(_,`Agentic loop iteration (${D.length} tools available)`);let g,M=!!e.generateRawStream&&!!d;try{if(M){let T=null,U=null,v="";for await(let x of e.generateRawStream(C,t,D,m))x.type==="text_delta"?(v+=x.text,d?.({type:"text_delta",text:x.text})):x.type==="thinking_delta"?d?.({type:"thinking_delta",text:x.text}):x.type==="raw_result"?T=x.result:x.type==="error"&&(U=x.error);if(U&&!T)throw new Error(U);if(!T)throw new Error("generateRawStream returned no raw_result event");g=T,g._streamedText=v}else g=await e.generateRaw(C,t,D,m)}catch(T){if(T.message?.includes("not available"))return dt(r);throw T}G+=g.usage.input_tokens+g.usage.output_tokens,F+=g.usage.input_tokens,A+=g.usage.output_tokens;let P=g._streamedText;for(let T of g.content)T.type==="text"&&(O+=T.text,P===void 0&&d?.({type:"text_delta",text:T.text}));if(P!==void 0&&delete g._streamedText,g.stop_reason==="end_turn"||g.stop_reason==="max_tokens")break;if(g.stop_reason==="tool_use"){let T=g.content.filter(v=>v.type==="tool_use");if(T.length===0)break;C.push({role:"assistant",content:g.content});let U=[];for(let v of T){d?.({type:"tool_call",name:v.name,id:v.id,input:v.input}),b.step(_,`Tool call: ${v.name}`);let x;if(E.has(v.name)&&r.mcpDispatch){let h=await r.mcpDispatch(v.name,v.input);x={tool_use_id:v.id,content:h.content,is_error:h.isError}}else x=await I.execute({name:v.name,id:v.id,input:v.input});d?.({type:"tool_result",name:v.name,id:v.id,content:x.content.slice(0,200),is_error:x.is_error}),x.files?.length&&(B.push(...x.files),d?.({type:"files_created",files:x.files})),x.followUp&&(j=x.followUp),U.push({type:"tool_result",tool_use_id:x.tool_use_id,content:x.content,is_error:x.is_error})}if(C.push({role:"user",content:U}),j)break;continue}break}return d?.({type:"complete",iterations:_,totalTokens:G}),{files:B,content:O,followUp:j,tokensUsed:G,inputTokens:F||void 0,outputTokens:A||void 0,iterations:_}}async function dt(r){let{provider:e,systemPrompt:t,messages:o,providerOptions:n,maxIterations:s=5}=r,c=[{role:"system",content:t+`
|
|
@@ -123,4 +123,4 @@ ${r.projectInstructions}`),r.memoryContext&&o.push(r.memoryContext),o.push(`# Ou
|
|
|
123
123
|
Generate output appropriate for: ${e}. Use the \`create_files\` tool to output all files.`),o.join(`
|
|
124
124
|
|
|
125
125
|
`)}export{qe as a,Vt as b,Yt as c,We as d,ze as e,Ve as f,Ye as g,Pe as h,ee as i,Re as j,le as k,te as l,Tt as m,oe as n,Mt as o,f as p,et as q,tt as r,Me as s,de as t,W as u,ne as v,it as w,Ee as x,$e as y,se as z,mt as A,Zn as B,er as C};
|
|
126
|
-
//# sourceMappingURL=chunk-
|
|
126
|
+
//# sourceMappingURL=chunk-B2Q3PTPS.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as r,d as l,e as c,f as p,h as g}from"./chunk-7LN4VKDU.js";import{a as d}from"./chunk-IMLAPB7G.js";var n=`:root {
|
|
2
2
|
/* --- Brand (agentina) --------------------------------------------- */
|
|
3
3
|
--ax-blue: #2979FF;
|
|
4
4
|
--ax-blue-d: #1B5FD9;
|
|
@@ -2019,4 +2019,4 @@ ${a.noAssistant?"":`<script>${u({markdownToHtml:d})}${v}</script>`}
|
|
|
2019
2019
|
const card = btn.closest('.ax-row-card');
|
|
2020
2020
|
if (card) card.classList.toggle('is-open');
|
|
2021
2021
|
};`;export{n as a,u as b,f as c,k as d,_ as e,y as f,z as g,$ as h,S as i,T as j,C as k,A as l,H as m,O as n,j as o};
|
|
2022
|
-
//# sourceMappingURL=chunk-
|
|
2022
|
+
//# sourceMappingURL=chunk-B2QYMUTD.js.map
|