agentix-cli 0.206.1 → 0.207.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-IEUOKINQ.js → App-64NXDO3Q.js} +2 -2
- package/dist/{ChatApp-CCDBG6YZ.js → ChatApp-LZSQ4233.js} +2 -2
- package/dist/{absorb-eval-IIF7CY3Q.js → absorb-eval-XG6QUTN6.js} +2 -2
- package/dist/{adapter-LTHULD3D.js → adapter-SDLSX2ZH.js} +2 -2
- package/dist/{agent-TZ3GGNS5.js → agent-TYURILCF.js} +2 -2
- package/dist/{board-dashboard-JS6OJDH6.js → board-dashboard-MLNL4EZ7.js} +21 -6
- package/dist/board-dashboard-MLNL4EZ7.js.map +1 -0
- package/dist/{chunk-E2MW5OCE.js → chunk-2GAMPUOB.js} +2 -2
- package/dist/{chunk-6U34GZ7U.js → chunk-2W23ZJCP.js} +2 -2
- package/dist/{chunk-Z6J3RTYJ.js → chunk-3ALELN73.js} +2 -2
- package/dist/{chunk-JDU4CXGC.js → chunk-3FUW6RXU.js} +2 -2
- package/dist/{chunk-KXMC7Z5X.js → chunk-3MUWPMC2.js} +2 -2
- package/dist/{chunk-I4753XPP.js → chunk-5YJ5GQCJ.js} +2 -2
- package/dist/{chunk-M37WJANA.js → chunk-6TZQZGRI.js} +65 -65
- package/dist/chunk-6TZQZGRI.js.map +1 -0
- package/dist/{chunk-K435U2FC.js → chunk-7MRDQLOS.js} +2 -2
- package/dist/{chunk-ZOK6VMEP.js → chunk-AECUZTRB.js} +2 -2
- package/dist/{chunk-U3OJO7B7.js → chunk-B34OLAAC.js} +36 -36
- package/dist/chunk-B34OLAAC.js.map +1 -0
- package/dist/{chunk-WI7J22NL.js → chunk-BBMGXNHU.js} +2 -2
- package/dist/{chunk-UN7D7HWU.js → chunk-CRSHJYZQ.js} +2 -2
- package/dist/{chunk-I74PTSUQ.js → chunk-DH7Z3HRC.js} +2 -2
- package/dist/{chunk-RRLQTU3X.js → chunk-EOQNFLFJ.js} +2 -2
- package/dist/{chunk-GCBFLU64.js → chunk-LTLH2CHG.js} +12 -6
- package/dist/chunk-LTLH2CHG.js.map +1 -0
- package/dist/{chunk-7JHB3X5N.js → chunk-NKSQNQ5V.js} +60 -60
- package/dist/chunk-NKSQNQ5V.js.map +1 -0
- package/dist/{chunk-WTCMJZW3.js → chunk-PSLSU6HC.js} +2 -2
- package/dist/{chunk-VALKXSXZ.js → chunk-RHXBLKBW.js} +2 -2
- package/dist/{chunk-R6XJWFMC.js → chunk-RWZGW2GQ.js} +2 -2
- package/dist/{chunk-7GD5GTWC.js → chunk-TYKEHZZA.js} +2 -2
- package/dist/{chunk-37EABHYL.js → chunk-UF3D5LFH.js} +2 -2
- package/dist/{chunk-XTIPWYW5.js → chunk-VIWN3CXS.js} +3 -3
- package/dist/chunk-VIWN3CXS.js.map +1 -0
- package/dist/{chunk-RPL2P7EP.js → chunk-VKEL4XNO.js} +2 -2
- package/dist/{chunk-FXA2WIIP.js → chunk-XEMW37IV.js} +2 -2
- package/dist/{chunk-6ZVVAGTR.js → chunk-XGCSWSVD.js} +2 -2
- package/dist/{chunk-CARVBJB7.js → chunk-YLKEUO6K.js} +2 -2
- package/dist/{chunk-CARVBJB7.js.map → chunk-YLKEUO6K.js.map} +1 -1
- package/dist/{chunk-TLRTJV2U.js → chunk-ZEJ2ZG6K.js} +290 -290
- package/dist/chunk-ZEJ2ZG6K.js.map +1 -0
- package/dist/{chunk-A2K6C6W3.js → chunk-ZJXJN6GM.js} +3 -3
- package/dist/{chunk-B35GIWMR.js → chunk-ZT32DUC7.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/{client-NPC2JAWL.js → client-HC5UIRHC.js} +2 -2
- package/dist/{config-TIMTRSFH.js → config-FUB5TUCM.js} +2 -2
- package/dist/{config-mutate-V3DRUCK4.js → config-mutate-5WSQJAJO.js} +2 -2
- package/dist/{config-mutator-HOYYIPNW.js → config-mutator-RALUVF77.js} +2 -2
- package/dist/{contributions-TYVRQG7F.js → contributions-SSQ2H2H6.js} +2 -2
- package/dist/{doctor-TNQ4Q2OS.js → doctor-FAC34AQ6.js} +2 -2
- package/dist/{follow-up-tool-3P2YCRBL.js → follow-up-tool-JCJSBAJF.js} +2 -2
- package/dist/{hub-GVTRKPAU.js → hub-YAEE5GFW.js} +2 -2
- package/dist/index.d.ts +79 -1
- package/dist/index.js +1 -1
- package/dist/{org-tool-EKO7GCPL.js → org-tool-YP256FUE.js} +2 -2
- package/dist/{program-Y55FFHIJ.js → program-3I7GFFDP.js} +23 -23
- package/dist/{promote-JYYV44FK.js → promote-NJWI2KUT.js} +2 -2
- package/dist/{query-PUWWCFET.js → query-O5EWN3YT.js} +2 -2
- package/dist/{query-settings-IJPG3N6D.js → query-settings-VKOJGJGC.js} +2 -2
- package/dist/{registry-QJGTPSK2.js → registry-W77Q7ZGZ.js} +2 -2
- package/dist/{request-planner-HHJXCWCG.js → request-planner-UY46HBKG.js} +2 -2
- package/dist/{review-candidates-XZUQELL5.js → review-candidates-A4BTJYML.js} +2 -2
- package/dist/{routing-HWZHJ4LZ.js → routing-THT4U4KK.js} +2 -2
- package/dist/schedule-tool-FVBUHIDC.js +2 -0
- package/dist/{scheduler-WG3KXJIH.js → scheduler-MHTDA3ZS.js} +2 -2
- package/dist/{seat-5BOBWKBX.js → seat-NW3JTDGK.js} +2 -2
- package/dist/{select-FIHHBFNR.js → select-4DILJ2XW.js} +2 -2
- package/dist/{set-enabled-K7OM7PSO.js → set-enabled-DKQTH2PC.js} +2 -2
- package/dist/{sprint-tool-O6TTSWJN.js → sprint-tool-43TSRPK4.js} +2 -2
- package/dist/{tool-HTUSCV22.js → tool-7MI3GK2K.js} +2 -2
- package/dist/{tool-BYU6EZKM.js → tool-JYSRWVNB.js} +2 -2
- package/dist/{tool-HVCLZGYE.js → tool-NA7ZOWD5.js} +2 -2
- package/dist/{tool-4KVS2JWC.js → tool-PQZ7NURW.js} +2 -2
- package/dist/{wiki-ZMEMGR7R.js → wiki-NR2KS3AT.js} +2 -2
- package/dist/wiki-enrich-EB2EOVDJ.js +2 -0
- package/package.json +1 -1
- package/dist/board-dashboard-JS6OJDH6.js.map +0 -1
- package/dist/chunk-7JHB3X5N.js.map +0 -1
- package/dist/chunk-GCBFLU64.js.map +0 -1
- package/dist/chunk-M37WJANA.js.map +0 -1
- package/dist/chunk-TLRTJV2U.js.map +0 -1
- package/dist/chunk-U3OJO7B7.js.map +0 -1
- package/dist/chunk-XTIPWYW5.js.map +0 -1
- package/dist/schedule-tool-7W5CRUN4.js +0 -2
- package/dist/wiki-enrich-QZHQV7VZ.js +0 -2
- /package/dist/{App-IEUOKINQ.js.map → App-64NXDO3Q.js.map} +0 -0
- /package/dist/{ChatApp-CCDBG6YZ.js.map → ChatApp-LZSQ4233.js.map} +0 -0
- /package/dist/{absorb-eval-IIF7CY3Q.js.map → absorb-eval-XG6QUTN6.js.map} +0 -0
- /package/dist/{adapter-LTHULD3D.js.map → adapter-SDLSX2ZH.js.map} +0 -0
- /package/dist/{agent-TZ3GGNS5.js.map → agent-TYURILCF.js.map} +0 -0
- /package/dist/{chunk-E2MW5OCE.js.map → chunk-2GAMPUOB.js.map} +0 -0
- /package/dist/{chunk-6U34GZ7U.js.map → chunk-2W23ZJCP.js.map} +0 -0
- /package/dist/{chunk-Z6J3RTYJ.js.map → chunk-3ALELN73.js.map} +0 -0
- /package/dist/{chunk-JDU4CXGC.js.map → chunk-3FUW6RXU.js.map} +0 -0
- /package/dist/{chunk-KXMC7Z5X.js.map → chunk-3MUWPMC2.js.map} +0 -0
- /package/dist/{chunk-I4753XPP.js.map → chunk-5YJ5GQCJ.js.map} +0 -0
- /package/dist/{chunk-K435U2FC.js.map → chunk-7MRDQLOS.js.map} +0 -0
- /package/dist/{chunk-ZOK6VMEP.js.map → chunk-AECUZTRB.js.map} +0 -0
- /package/dist/{chunk-WI7J22NL.js.map → chunk-BBMGXNHU.js.map} +0 -0
- /package/dist/{chunk-UN7D7HWU.js.map → chunk-CRSHJYZQ.js.map} +0 -0
- /package/dist/{chunk-I74PTSUQ.js.map → chunk-DH7Z3HRC.js.map} +0 -0
- /package/dist/{chunk-RRLQTU3X.js.map → chunk-EOQNFLFJ.js.map} +0 -0
- /package/dist/{chunk-WTCMJZW3.js.map → chunk-PSLSU6HC.js.map} +0 -0
- /package/dist/{chunk-VALKXSXZ.js.map → chunk-RHXBLKBW.js.map} +0 -0
- /package/dist/{chunk-R6XJWFMC.js.map → chunk-RWZGW2GQ.js.map} +0 -0
- /package/dist/{chunk-7GD5GTWC.js.map → chunk-TYKEHZZA.js.map} +0 -0
- /package/dist/{chunk-37EABHYL.js.map → chunk-UF3D5LFH.js.map} +0 -0
- /package/dist/{chunk-RPL2P7EP.js.map → chunk-VKEL4XNO.js.map} +0 -0
- /package/dist/{chunk-FXA2WIIP.js.map → chunk-XEMW37IV.js.map} +0 -0
- /package/dist/{chunk-6ZVVAGTR.js.map → chunk-XGCSWSVD.js.map} +0 -0
- /package/dist/{chunk-A2K6C6W3.js.map → chunk-ZJXJN6GM.js.map} +0 -0
- /package/dist/{chunk-B35GIWMR.js.map → chunk-ZT32DUC7.js.map} +0 -0
- /package/dist/{client-NPC2JAWL.js.map → client-HC5UIRHC.js.map} +0 -0
- /package/dist/{config-TIMTRSFH.js.map → config-FUB5TUCM.js.map} +0 -0
- /package/dist/{config-mutate-V3DRUCK4.js.map → config-mutate-5WSQJAJO.js.map} +0 -0
- /package/dist/{config-mutator-HOYYIPNW.js.map → config-mutator-RALUVF77.js.map} +0 -0
- /package/dist/{contributions-TYVRQG7F.js.map → contributions-SSQ2H2H6.js.map} +0 -0
- /package/dist/{doctor-TNQ4Q2OS.js.map → doctor-FAC34AQ6.js.map} +0 -0
- /package/dist/{follow-up-tool-3P2YCRBL.js.map → follow-up-tool-JCJSBAJF.js.map} +0 -0
- /package/dist/{hub-GVTRKPAU.js.map → hub-YAEE5GFW.js.map} +0 -0
- /package/dist/{org-tool-EKO7GCPL.js.map → org-tool-YP256FUE.js.map} +0 -0
- /package/dist/{program-Y55FFHIJ.js.map → program-3I7GFFDP.js.map} +0 -0
- /package/dist/{promote-JYYV44FK.js.map → promote-NJWI2KUT.js.map} +0 -0
- /package/dist/{query-PUWWCFET.js.map → query-O5EWN3YT.js.map} +0 -0
- /package/dist/{query-settings-IJPG3N6D.js.map → query-settings-VKOJGJGC.js.map} +0 -0
- /package/dist/{registry-QJGTPSK2.js.map → registry-W77Q7ZGZ.js.map} +0 -0
- /package/dist/{request-planner-HHJXCWCG.js.map → request-planner-UY46HBKG.js.map} +0 -0
- /package/dist/{review-candidates-XZUQELL5.js.map → review-candidates-A4BTJYML.js.map} +0 -0
- /package/dist/{routing-HWZHJ4LZ.js.map → routing-THT4U4KK.js.map} +0 -0
- /package/dist/{schedule-tool-7W5CRUN4.js.map → schedule-tool-FVBUHIDC.js.map} +0 -0
- /package/dist/{scheduler-WG3KXJIH.js.map → scheduler-MHTDA3ZS.js.map} +0 -0
- /package/dist/{seat-5BOBWKBX.js.map → seat-NW3JTDGK.js.map} +0 -0
- /package/dist/{select-FIHHBFNR.js.map → select-4DILJ2XW.js.map} +0 -0
- /package/dist/{set-enabled-K7OM7PSO.js.map → set-enabled-DKQTH2PC.js.map} +0 -0
- /package/dist/{sprint-tool-O6TTSWJN.js.map → sprint-tool-43TSRPK4.js.map} +0 -0
- /package/dist/{tool-HTUSCV22.js.map → tool-7MI3GK2K.js.map} +0 -0
- /package/dist/{tool-BYU6EZKM.js.map → tool-JYSRWVNB.js.map} +0 -0
- /package/dist/{tool-HVCLZGYE.js.map → tool-NA7ZOWD5.js.map} +0 -0
- /package/dist/{tool-4KVS2JWC.js.map → tool-PQZ7NURW.js.map} +0 -0
- /package/dist/{wiki-ZMEMGR7R.js.map → wiki-NR2KS3AT.js.map} +0 -0
- /package/dist/{wiki-enrich-QZHQV7VZ.js.map → wiki-enrich-EB2EOVDJ.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as p}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{s as p}from"./chunk-VIWN3CXS.js";import{b as i,c as u,d as l,e as c}from"./chunk-RHXBLKBW.js";import d from"cronstrue";var f=Intl.DateTimeFormat().resolvedOptions().timeZone,g=600,E='Try: "every morning at 9", "weekdays at 6pm", "every 15 minutes", "every monday at 10am", "1st of every month at noon", "daily at 9:30am", "every hour"',m=/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/;function x(e){return m.test(e)}function w(e){try{return new Intl.DateTimeFormat("en-US",{timeZone:e}),!0}catch{return!1}}function S(e){return e?e.split(",").map(r=>r.trim().toLowerCase()).filter(r=>r==="log"||r==="notify"||r==="disable"):["log"]}function $(e){let r=[...e.onError??["log"]];e.notify&&!r.includes("notify")&&r.push("notify");let t={enabled:e.enabled??!0,schedule:e.parsed.cron,timezone:e.timezone||f,agent:e.agent,prompt:e.prompt,timeout:e.timeout??g,onError:r};return e.model&&(t.model=e.model),e.notify&&(t.notify=e.notify),e.notify&&e.deliverResult===!1&&(t.deliverResult=!1),e.report==="exceptions"&&(t.report="exceptions"),e.createdBy&&(t.createdBy=e.createdBy),e.approval&&(t.approval=e.approval),t}function P(e){return e.deliverResult===!1?"(failures only)":e.report==="exceptions"?"(exceptions and failures)":"(results and failures)"}function T(e){try{return d.toString(e,{use24HourTimeFormat:!1})}catch{return e}}function A(e,r,t=new Date){try{return p(e,t,r)}catch{return null}}function D(e,r){if(!e)return"unknown (no match within a year)";try{return`${new Intl.DateTimeFormat("en-GB",{timeZone:r,weekday:"short",day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(e)} (${r})`}catch{return e.toISOString()}}function y(e){return e?.approval?.action==="create"}async function R(e,r={}){let t="",o=await i(n=>{let a=l(n,`crons.${e}`);if(!a)throw new Error(`cron "${e}" not found`);let s=a.approval;if(!s)throw new Error(`cron "${e}" has no pending request`);s.action==="create"?(delete a.approval,a.enabled=!0,t=`${e} approved and enabled (requested by ${s.requestedBy})`):(c(n,`crons.${e}`),t=`${e} deletion approved; job removed (requested by ${s.requestedBy})`)},{configPath:r.configPath,reload:r.reload});return o.success?{success:!0,message:t,result:o}:{success:!1,message:o.error||"failed",result:o}}async function I(e,r={}){let t="",o=await i(n=>{let a=l(n,`crons.${e}`);if(!a)throw new Error(`cron "${e}" not found`);let s=a.approval;if(!s)throw new Error(`cron "${e}" has no pending request`);s.action==="create"?(c(n,`crons.${e}`),t=`${e} rejected; pending job removed`):(delete a.approval,t=`${e} deletion rejected; job kept`)},{configPath:r.configPath,reload:r.reload});return o.success?{success:!0,message:t,result:o}:{success:!1,message:o.error||"failed",result:o}}async function O(e,r,t={}){return i(o=>{let n=l(o,`crons.${e}`);if(!n)throw new Error(`cron "${e}" not found`);if(r&&y(n))throw new Error(`cron "${e}" is awaiting approval; run \`agentx schedule approve ${e}\``);u(o,`crons.${e}.enabled`,r)},{configPath:t.configPath,reload:t.reload})}export{f as a,E as b,x as c,w as d,S as e,$ as f,P as g,T as h,A as i,D as j,y as k,R as l,I as m,O as n};
|
|
2
|
+
//# sourceMappingURL=chunk-2GAMPUOB.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Rb as $,ob as S}from"./chunk-
|
|
1
|
+
import{Rb as $,ob as S}from"./chunk-YLKEUO6K.js";import{randomBytes as x}from"crypto";import{existsSync as b,mkdirSync as k,readdirSync as M,readFileSync as j,renameSync as E,unlinkSync as y,writeFileSync as C}from"fs";import{resolve as c}from"path";function m(t){return c(t,".agentx","email")}function u(t,e){k(c(t,".."),{recursive:!0});let r=`${t}.${process.pid}.tmp`;C(r,JSON.stringify(e,null,2)+`
|
|
2
2
|
`,{mode:384}),E(r,t)}function g(t){try{return JSON.parse(j(t,"utf-8"))}catch{return null}}var D=t=>c(m(t),"threads.json");function w(t){return g(D(t))??{}}function I(t,e){return w(t)[e.toLowerCase()]}function L(t,e){let r=w(t);r[e.to.toLowerCase()]=e,u(D(t),r)}var h=(t,e)=>c(m(t),"cursors",`${e}.json`);function z(t,e){return g(h(t,e))}function B(t,e,r){u(h(t,e),r)}var T=2e4,_=t=>c(m(t),"drafts"),N=t=>/^[a-z0-9-]{8,64}$/.test(t),a=(t,e)=>c(_(t),`${e}.json`);function U(t,e,r=Date.now()){let n=e.text.trim().slice(0,T);if(!n)throw new Error("empty reply");let s={...e,text:n,id:`${r.toString(36)}-${x(4).toString("hex")}`,status:"pending",created_at:new Date(r).toISOString()};return u(a(t,s.id),s),s}function v(t,e){return N(e)?g(a(t,e)):null}function V(t,e){let r=_(t);return b(r)?M(r).filter(n=>n.endsWith(".json")).map(n=>v(t,n.slice(0,-5))).filter(n=>!!n&&(!e||n.status===e)).sort((n,s)=>n.created_at.localeCompare(s.created_at)):[]}async function W(t,e,r,n){let s=v(t,e);if(!s||s.status!=="pending")return{ok:!1,error:`no email reply "${e}" is waiting`};let i=`${a(t,e)}.${process.pid}.${x(3).toString("hex")}.claim`;try{E(a(t,e),i)}catch{return{ok:!1,error:`email reply "${e}" is already being decided`}}let d=n.text!==void 0&&n.text.trim()!==""&&n.text.trim()!==s.text,o={...s,...d?{text:n.text.trim().slice(0,T),edited:!0}:{},decided_by:n.by??"operator",decided_at:new Date(n.now??Date.now()).toISOString()};if(r==="no")o.status="rejected";else{let f=await n.send(o).catch(p=>({ok:!1,error:String(p?.message??p)}));if(!f.ok){u(a(t,e),{...s,error:f.error});try{y(i)}catch{}return{ok:!1,error:`not sent: ${f.error}`}}o.status="sent",delete o.error}u(a(t,e),o);try{y(i)}catch{}return{ok:!0,draft:o}}$();function l(t,e){return(t??"").replace(/\$\{(\w+)\}/g,(r,n)=>e[n]??"")}function P(t,e=process.env){let r={host:t.imap.host,port:t.imap.port,secure:t.imap.secure,user:l(t.imap.user,e)||t.address,password:l(t.imap.password,e)},n={host:t.smtp.host,port:t.smtp.port,secure:t.smtp.secure,user:l(t.smtp.user,e)||r.user,password:l(t.smtp.password,e)||r.password};return{imap:r,smtp:n}}async function R(t,e,r,n=process.env){let{smtp:s}=P(t,n);if(!s.password)throw new Error(`no SMTP password for ${t.address}: set it in .env`);return J(s,{name:e,address:t.address},r,{"Auto-Submitted":"auto-replied"})}async function J(t,e,r,n){let{default:s}=await import("nodemailer"),i=s.createTransport({host:t.host,port:t.port,secure:t.secure,auth:{user:t.user,pass:t.password},connectionTimeout:2e4,greetingTimeout:2e4,socketTimeout:6e4});try{return(await i.sendMail({from:e,to:r.toName?{name:r.toName,address:r.to}:r.to,subject:r.subject,text:r.text,...r.inReplyTo?{inReplyTo:r.inReplyTo}:{},...r.references?{references:r.references}:{},headers:n})).messageId}finally{i.close()}}function G(t,e){return async r=>{let n=t?.channels?.email?.accounts?.[r.account];if(!n)return{ok:!1,error:`no email account "${r.account}" in agentx.json`};let s=S.safeParse(n);if(!s.success)return{ok:!1,error:`email account "${r.account}": ${s.error.issues[0]?.message}`};let i=s.data,d=i.name||t?.agents?.[r.agent]?.name||r.agent;return await R(i,d,{to:r.to,toName:r.to_name,subject:r.subject,inReplyTo:r.in_reply_to,references:r.references,text:r.text},e),{ok:!0}}}export{I as a,L as b,z as c,B as d,U as e,v as f,V as g,W as h,P as i,R as j,J as k,G as l};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-2W23ZJCP.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as g}from"./chunk-
|
|
1
|
+
import{e as g}from"./chunk-ZJXJN6GM.js";async function $(e,i,r,n,o={}){let a=o.retrieve??g,c=o.perEntry??2,s=o.maxArticles??8,f=o.queryChars??1500,h=new Map;for(let t of e){let l=[];try{l=await a(t.content.slice(0,f),i,r,{pool:n,maxCandidates:c,maxHops:1,maxArticles:c*2,stage:"absorb-covering"})}catch{}for(let u of l){let p=h.get(u.path);p?(p.hop=Math.min(p.hop,u.hop),p.entries.includes(t.id)||p.entries.push(t.id)):h.set(u.path,{...u,entries:[t.id]})}}return[...h.values()].sort((t,l)=>t.hop-l.hop||l.entries.length-t.entries.length||t.path.localeCompare(l.path)).slice(0,s)}function x(e){if(e.length===0)return"";let i=e.map(r=>{let n=`### ${r.meta.title} \u2014 ${r.meta.type||"untyped"} (${r.path})`,o=`Found for entries: ${r.entries.join(", ")}${r.hop>0?" (linked from a match)":""}`,a=r.meta.related?.length?`Related: ${r.meta.related.join(", ")}`:"";return[n,o,a,"",r.content].filter(c=>c!=="").join(`
|
|
2
2
|
`)}).join(`
|
|
3
3
|
|
|
4
4
|
---
|
|
@@ -14,4 +14,4 @@ These ${e.length} articles were found by searching the wiki for each entry below
|
|
|
14
14
|
|
|
15
15
|
${i}
|
|
16
16
|
`}var d=/\bhttps?:\/\/[^\s<>"'`)\]]+/gi,y=/\[\[([^\]|]+)(?:\|[^\]]*)?\]\]/g,w=/(?<![\w-])(?=[0-9a-f]*[0-9])(?=[0-9a-f]*[a-f])[0-9a-f]{7,40}(?![\w-])/gi,k=/(?<![\w.,:/-])\d+(?:[.,:\-/]\d+)*(?![\w])/g,C=/^\s*\d+[.)]\s/gm;function A(e){let i=[...e.matchAll(d)].map(s=>s[0].replace(/[.,;:!?'"]+$/,"")),r=[...e.matchAll(y)].map(s=>s[1].trim()),n=e.replace(d," ").replace(y," ").replace(C," "),o=[...n.matchAll(w)].map(s=>s[0].toLowerCase()),c=[...n.replace(w," ").matchAll(k)].map(s=>v(s[0]));return{commits:m(o),urls:m(i),wikilinks:m(r),numbers:m(c)}}function R(e,i){let r=A(e),n=A(i),o=i.toLowerCase(),a=[];for(let t of r.commits)!o.includes(t)&&!n.commits.some(l=>l.startsWith(t)||t.startsWith(l))&&a.push(`commit ${t}`);let c=t=>t.toLowerCase().replace(/\/+$/,""),s=new Set(n.urls.map(c));for(let t of r.urls)s.has(c(t))||a.push(`link ${t}`);let f=new Set(n.wikilinks.map(t=>t.toLowerCase()));for(let t of r.wikilinks)f.has(t.toLowerCase())||a.push(`link [[${t}]]`);let h=new Set(n.numbers);for(let t of r.numbers)h.has(t)||a.push(`number ${t}`);return a}function v(e){return/^\d{1,3}(,\d{3})+$/.test(e)?e.replace(/,/g,""):e}function m(e){return[...new Set(e)]}function L(e,i){if(i.some(n=>n.path===e.path))return e.path;let r=b(e.title);return r?i.find(n=>b(n.title)===r)?.path??e.path:e.path}function b(e){return(e||"").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}export{$ as a,x as b,A as c,R as d,L as e};
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-3ALELN73.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{d as h}from"./chunk-
|
|
1
|
+
import{d as h}from"./chunk-3ALELN73.js";var d=["main contact","primary contact","point of contact","billing contact","technical contact","decision maker"],f=/[\w.+-]+@[\w-]+(?:\.[\w-]+)+/g,w=/\b(role|title|position|job)\s*\**\s*[::]\s*\**\s*([^\n;|]+)/gi;function L(t,c,e=[]){let l=[c,...e].join(`
|
|
2
2
|
`),a=l.toLowerCase(),i=h(t,l);for(let s of p(t.match(f)??[]))a.includes(s.toLowerCase())||i.push(`email ${s}`);let m=t.toLowerCase();for(let s of d)m.includes(s)&&!a.includes(s)&&i.push(`marker "${s}"`);for(let s of t.matchAll(w)){let n=s[2].replace(/\*+/g,"").trim();n&&!a.includes(n.toLowerCase())&&i.push(`${s[1].toLowerCase()} "${n}"`)}return p(i)}function p(t){return[...new Set(t)]}var $=.9,g=/^\s*(?:wait\b|here(?:'s| is) the (?:updated|modified|patched|revised)|i (?:must|need to|will|should) (?:output|return|write)|(?:okay|ok|sure)[,.!]\s|let me\b|as requested\b)/im;function k(t,c){let e=[],l=t.split(`
|
|
3
3
|
`).filter(o=>o.trim()).length,a=c.split(`
|
|
4
4
|
`).filter(o=>o.trim()).length;l>=5&&a<Math.floor(l*$)&&e.push(`the article shrinks from ${l} to ${a} lines`);let i=c.match(g);i&&!t.match(g)&&e.push(`it contains the model's own commentary ("${i[0].trim().slice(0,40)}")`);let m=o=>{let r=new Map;for(let u of o.split(`
|
|
5
5
|
`))/^#{1,6} /.test(u)&&r.set(u.trim(),(r.get(u.trim())??0)+1);return r},s=m(t);for(let[o,r]of m(c))r>1&&r>(s.get(o)??0)&&e.push(`the heading "${o}" appears ${r} times`);let n=L(t,c);return n.length&&e.push(`it drops ${n.length} fact(s): ${n.slice(0,6).join(", ")}${n.length>6?", \u2026":""}`),e}export{L as a,k as b};
|
|
6
|
-
//# sourceMappingURL=chunk-
|
|
6
|
+
//# sourceMappingURL=chunk-3FUW6RXU.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as _,b as q}from"./chunk-RKPAVWXF.js";import{a as R,b as O,c as B,d as b,f as k,g as z,h as v,i as w,j as S,k as m}from"./chunk-
|
|
1
|
+
import{a as _,b as q}from"./chunk-RKPAVWXF.js";import{a as R,b as O,c as B,d as b,f as k,g as z,h as v,i as w,j as S,k as m}from"./chunk-2GAMPUOB.js";import{a as x,b as C,c as E,d as P,e as D}from"./chunk-RHXBLKBW.js";import{existsSync as J,readFileSync as M}from"fs";var V=new Set(["cron","heartbeat","api","a2a","mesh"]),W=160;function s(n){return typeof n=="string"&&n.trim()?n.trim():void 0}function A(n,e=W){let t=n.replace(/\s+/g," ").trim();return t.length>e?`${t.slice(0,e-1)}\u2026`:t}function Y(n){let e=x(n);if(!J(e))throw new Error(`config not found at ${e}`);return JSON.parse(M(e,"utf-8"))}function Z(n,e){return n?.agents?.[e]?.admin===!0}function K(n,e,t){return Z(n,t.agentId)||e?.createdBy===t.agentId}function Q(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 j(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&&!V.has(e.channel))return{channel:e.channel,chatId:e.chatId,...e.accountId?{accountId:e.accountId}:{}}}}function ee(n,e,t){let r=e.timezone||"UTC",d=e.enabled&&!m(e)?S(w(e.schedule,r,t),r):"\u2014",p=e.approval?`pending ${e.approval.action} approval`:e.enabled?"active":"paused",h=[`- ${n} [${p}] ${e.schedule} \u2014 ${v(e.schedule)} (${r})`,` agent: ${e.agent}; created by: ${e.createdBy||"operator"}; next: ${d}`];return e.notify&&h.push(` notify: ${e.notify.channel} ${e.notify.chatId} ${z(e)}`),e.command?h.push(` command: ${A(String(e.command))}`):e.prompt&&h.push(` prompt: ${A(String(e.prompt))}`),h.join(`
|
|
2
2
|
`)}async function L(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 ae(n,e,t={}){let r=(s(n.action)||"list").toLowerCase(),d=t.now?t.now():new Date,p;try{p=Y(t.configPath)}catch(a){return`Error: ${a.message}`}let h=p.crons||{};if(r==="list"){let a=n.mine===!0,l=Object.entries(h).filter(([,i])=>!a||e&&i?.createdBy===e.agentId);return l.length?l.map(([i,f])=>ee(i,f,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(!p.agents?.[e.agentId])return`Error: caller "${e.agentId}" is not an agent on this node.`;let o=s(n.id),I=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=_(a);if(!i)return`Error: couldn't parse "${a}". ${O}.`;let f=s(n.agent)||e.agentId;if(!p.agents?.[f])return`Error: agent "${f}" not found on this node.`;let g=s(n.timezone)||R;if(!b(g))return`Error: unknown timezone "${g}".`;let u=o||q(i.matched,f);if(!B(u))return`Error: invalid id "${u}" (letters, digits, "-" and "_" only).`;if(h[u])return`Error: a schedule "${u}" already exists. Pick another \`id\`.`;let $=j(n,e);if($==="invalid")return'Error: `notify` must be "here", "none", or "channel:chatId".';let y=s(n.report);if(y&&y!=="always"&&y!=="exceptions")return'Error: `report` must be "always" or "exceptions".';let G={action:"create",requestedBy:e.agentId,requestedAt:d.toISOString()},H=k({parsed:i,agent:f,prompt:l,timezone:g,notify:$,report:y,enabled:!1,createdBy:e.agentId,approval:G}),N=await I(F=>E(F,`crons.${u}`,H));if(!N.success)return`Error: ${N.error}`;let T=S(w(i.cron,g,d),g),U=[`Schedule approval requested by ${e.agentId}`,`Create: ${u}`,`When: ${i.human} \u2014 cron \`${i.cron}\` (${g})`,`Next fire: ${T}`,`Agent: ${f}`,$?`${y==="exceptions"?"Exceptions":"Results"} and failures go to: ${$.channel} ${$.chatId}${$.channel==="voice"?" (as a push notification)":""}`:"Results go to: run log only (no chat)",`Prompt: ${A(l,400)}`,"",`Approve: agentx schedule approve ${u}`,`Reject: agentx schedule reject ${u}`].join(`
|
|
4
4
|
`),X=await L(p,t,U);return[`Requested schedule "${u}": ${i.human} (cron ${i.cron}, ${g}); next fire would be ${T}.`,"It is saved DISABLED and will not run until the operator approves it.",X].join(`
|
|
5
5
|
`)}if(!o)return`Error: ${r} needs \`id\`.`;let c=h[o];if(!c)return`Error: schedule "${o}" not found.`;if(!K(p,c,e))return Q(o,c);if(r==="pause"||r==="resume"){let a=r==="resume";if(a&&m(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 I(i=>E(i,`crons.${o}.enabled`,a));return l.success?`"${o}" ${a?"resumed":"paused"}.`:`Error: ${l.error}`}if(r==="delete"){if(m(c)&&c.approval.requestedBy===e.agentId){let u=await I($=>D($,`crons.${o}`));return u.success?`Withdrew the pending request "${o}".`:`Error: ${u.error}`}if(m(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 I(u=>{if(!P(u,`crons.${o}`))throw new Error(`schedule "${o}" not found`);E(u,`crons.${o}.approval`,a)});if(!l.success)return`Error: ${l.error}`;let i=c.timezone||"UTC",f=[`Schedule approval requested by ${e.agentId}`,`Delete: ${o}`,`When: ${v(c.schedule)} \u2014 cron \`${c.schedule}\` (${i})`,`Next fire: ${c.enabled?S(w(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 L(p,t,f);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 ie(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),p=s(r?e.AGENTX_CHAT_ID:n.chatId),h=s(n.accountId);return{agentId:t,channel:d,chatId:p,...h?{accountId:h}:{}}}export{ae as a,ie as b};
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
//# sourceMappingURL=chunk-3MUWPMC2.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
|
${l}`,is_error:!0}:{tool_use_id:e.id,content:l||"(no output)"}}async editFile(e){let t=String(e.input.path||""),o=e.input.edits,r=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:r,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 ne.readFile(r,"utf8"),l=[];for(let a of o)i.includes(a.old_text)?(i=i.replace(a.old_text,a.new_text),l.push(`Replaced: "${a.old_text.slice(0,40)}..."`)):l.push(`Not found: "${a.old_text.slice(0,40)}..."`);return this.options.dryRun||await ne.writeFile(r,i,"utf8"),f.has("post:file-write")&&await f.execute("post:file-write",{event:"post:file-write",file:r,fileContent:i,cwd:this.cwd}),{tool_use_id:e.id,content:`Edited ${t}:
|
|
50
50
|
${l.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||""),r=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||""),r=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-W77Q7ZGZ.js"),l=i();if(!l)return{tool_use_id:e.id,content:"Sub-agent spawning requires the daemon to be running.",is_error:!0};let p=await new s(l).spawn({targetAgentId:t,prompt:o,parentAgentId:"orchestrator",timeout:r*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,r=t;return o?.length&&(r+=`
|
|
54
54
|
Options: ${o.join(", ")}`),{tool_use_id:e.id,content:"Question sent to user.",followUp:r}}};async function Oe(n){let{provider:e,systemPrompt:t,messages:o,providerOptions:r,cwd:s,maxIterations:i=20,enabledTools:l,interactive:a=!0,overwrite:p=!1,dryRun:c=!1,onProgress:d,abortSignal:u}=n,m=u?{...r,abortSignal:u}:r;if(!e.generateRaw)return mt(n);let I=new se(s,{interactive:a,overwrite:p,dryRun:c,acmeContext:n.acmeContext,abortSignal:u}),D=be(l);if(n.acmeContext)for(let g of ct)D.push({name:g.name,description:g.description,input_schema:g.input_schema});let E=new Set;if(n.mcpTools?.length)for(let g of n.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,O=0,A="",j,_=0;for(;_<i;){if(_++,u?.aborted)throw new Error("cancelled");d?.({type:"iteration_start",iteration:_}),k.step(_,`Agentic loop iteration (${D.length} tools available)`);let g,M=!!e.generateRawStream&&!!d;try{if(M){let S=null,H=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"?S=x.result:x.type==="error"&&(H=x.error);if(H&&!S)throw new Error(H);if(!S)throw new Error("generateRawStream returned no raw_result event");g=S,g._streamedText=v}else g=await e.generateRaw(C,t,D,m)}catch(S){if(S.message?.includes("not available"))return mt(n);throw S}G+=g.usage.input_tokens+g.usage.output_tokens,F+=g.usage.input_tokens,O+=g.usage.output_tokens;let P=g._streamedText;for(let S of g.content)S.type==="text"&&(A+=S.text,P===void 0&&d?.({type:"text_delta",text:S.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 S=g.content.filter(v=>v.type==="tool_use");if(S.length===0)break;C.push({role:"assistant",content:g.content});let H=[];for(let v of S){d?.({type:"tool_call",name:v.name,id:v.id,input:v.input}),k.step(_,`Tool call: ${v.name}`);let x;if(E.has(v.name)&&n.mcpDispatch){let h=await n.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),H.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:H}),j)break;continue}break}return d?.({type:"complete",iterations:_,totalTokens:G}),{files:B,content:A,followUp:j,tokensUsed:G,inputTokens:F||void 0,outputTokens:O||void 0,iterations:_}}async function mt(n){let{provider:e,systemPrompt:t,messages:o,providerOptions:r,maxIterations:s=5}=n,l=[{role:"system",content:t+`
|
|
@@ -123,4 +123,4 @@ ${n.projectInstructions}`),n.memoryContext&&o.push(n.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{We as a,Xt as b,Qt as c,Je as d,Ke as e,Xe as f,Qe as g,Pe as h,ee as i,Re as j,ce as k,te as l,Pt as m,oe as n,Et as o,f as p,ot as q,rt as r,Me as s,de as t,W as u,re as v,lt as w,Ee as x,$e as y,se as z,gt as A,tn as B,on as C};
|
|
126
|
-
//# sourceMappingURL=chunk-
|
|
126
|
+
//# sourceMappingURL=chunk-5YJ5GQCJ.js.map
|