agentix-cli 0.17.0 → 0.18.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/agent-RDVGL2TW.js +2 -0
- package/dist/audit-Z47AQFFD.js +3 -0
- package/dist/audit-Z47AQFFD.js.map +1 -0
- package/dist/{board-dashboard-CXIVJKDP.js → board-dashboard-KX2CNOSY.js} +44 -44
- package/dist/board-dashboard-KX2CNOSY.js.map +1 -0
- package/dist/{chunk-EKTPCSN4.js → chunk-4ITQP3XL.js} +2 -2
- package/dist/chunk-53NRX2NA.js +2 -0
- package/dist/chunk-53NRX2NA.js.map +1 -0
- package/dist/{chunk-5WNGHDFC.js → chunk-ASSJ4Z6Z.js} +11 -11
- package/dist/{chunk-5WNGHDFC.js.map → chunk-ASSJ4Z6Z.js.map} +1 -1
- package/dist/chunk-BLUXL6HR.js +854 -0
- package/dist/chunk-BLUXL6HR.js.map +1 -0
- package/dist/chunk-BTAEYL3P.js +72 -0
- package/dist/chunk-BTAEYL3P.js.map +1 -0
- package/dist/chunk-DJEZ2HVU.js +5 -0
- package/dist/chunk-DJEZ2HVU.js.map +1 -0
- package/dist/{chunk-SRHLXZRF.js → chunk-DSCMCVTV.js} +3 -3
- package/dist/chunk-DSCMCVTV.js.map +1 -0
- package/dist/chunk-HPDHNIA3.js +2 -0
- package/dist/chunk-IM376SD6.js +13 -0
- package/dist/chunk-IM376SD6.js.map +1 -0
- package/dist/chunk-J4WKMKTP.js +5 -0
- package/dist/{chunk-MBEQASP3.js.map → chunk-J4WKMKTP.js.map} +1 -1
- package/dist/chunk-JGXE2YNV.js +46 -0
- package/dist/chunk-JGXE2YNV.js.map +1 -0
- package/dist/{chunk-TT2Q7YMZ.js → chunk-JXEPJ3YD.js} +6 -6
- package/dist/{chunk-TT2Q7YMZ.js.map → chunk-JXEPJ3YD.js.map} +1 -1
- package/dist/chunk-LY7JGDV7.js +6 -0
- package/dist/chunk-LY7JGDV7.js.map +1 -0
- package/dist/chunk-SR3X25TN.js +3 -0
- package/dist/chunk-SR3X25TN.js.map +1 -0
- package/dist/{chunk-63UYRJIC.js → chunk-TRQSP67X.js} +2 -2
- package/dist/chunk-U364GNQX.js +719 -0
- package/dist/chunk-U364GNQX.js.map +1 -0
- package/dist/chunk-VJUTQAPJ.js +2 -0
- package/dist/chunk-VJUTQAPJ.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/{compaction-X46EQEPS.js → compaction-S5H6DTOR.js} +4 -4
- package/dist/config-UOHEG4BW.js +2 -0
- package/dist/config-mutator-KSEBWKJH.js +2 -0
- package/dist/{context-planner-G2J7FNNU.js → context-planner-2RGHJHSO.js} +3 -3
- package/dist/debug-TGAP7E7W.js +2 -0
- package/dist/discover-OATU7SHI.js +4 -0
- package/dist/discover-OATU7SHI.js.map +1 -0
- package/dist/{editor-chat-R54E65W5.js → editor-chat-FUBQLMAQ.js} +2 -2
- package/dist/heal-YP7QI7D3.js +2 -0
- package/dist/{inbox-L5ZZ623Y.js → inbox-O5UB3YQN.js} +2 -2
- package/dist/index.d.ts +462 -22
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/{ingest-whatsapp-NS4OWDOU.js → ingest-whatsapp-C3O5UPBX.js} +2 -2
- package/dist/loader-BGWA7IRY.js +2 -0
- package/dist/loader-LBHKSXBK.js +2 -0
- package/dist/memory-extract-KKPKAOPH.js +2 -0
- package/dist/{processes-XF5CV4LK.js → processes-7W27G3J3.js} +2 -2
- package/dist/program-2MDELQLX.js +2 -0
- package/dist/providers-WCQSKTNP.js +2 -0
- package/dist/query-FZAL7AQD.js +2 -0
- package/dist/recipes-LZ56TA3X.js +2 -0
- package/dist/registry-ONJSILH4.js +2 -0
- package/dist/scheduler-XRM2RJIV.js +2 -0
- package/dist/{slack-PSQLVTGB.js → slack-D27BE37Q.js} +2 -2
- package/dist/store-4UCO56K2.js +2 -0
- package/dist/{subagent-2SJHSSJS.js → subagent-EPOT3QDM.js} +2 -2
- package/dist/{task-store-NM7VKNLE.js → task-store-3NUWLYRY.js} +2 -2
- package/dist/{telegram-W4SLFMNY.js → telegram-UWV67KWG.js} +2 -2
- package/dist/timers-QB4KYNAE.js +2 -0
- package/dist/types-ECMEC5BZ.js +2 -0
- package/dist/types-TTB6DJUE.js +2 -0
- package/dist/{usage-dashboard-AXPXB2KP.js → usage-dashboard-FQGPPABD.js} +2 -2
- package/dist/web/workflow-editor.global.js +35 -12
- package/dist/web/workflow-editor.global.js.map +1 -1
- package/dist/{whatsapp-DCHRBRVV.js → whatsapp-KJ2NRKKQ.js} +2 -2
- package/dist/{whatsapp-state-6D6FHHD2.js → whatsapp-state-3ZVQ6MQD.js} +2 -2
- package/dist/{wiki-UDPYFJBL.js → wiki-OUYKM7MB.js} +2 -2
- package/dist/wiki-OUYKM7MB.js.map +1 -0
- package/dist/workspace-setup-6GDBEORT.js +2 -0
- package/dist/workspace-setup-6GDBEORT.js.map +1 -0
- package/package.json +11 -1
- package/dist/agent-4AOMVXRJ.js +0 -2
- package/dist/board-dashboard-CXIVJKDP.js.map +0 -1
- package/dist/chunk-4HP6UC2X.js +0 -13
- package/dist/chunk-4HP6UC2X.js.map +0 -1
- package/dist/chunk-ABCHHNG6.js +0 -625
- package/dist/chunk-ABCHHNG6.js.map +0 -1
- package/dist/chunk-FIOB3MEX.js +0 -2
- package/dist/chunk-HCFSHGK4.js +0 -46
- package/dist/chunk-HCFSHGK4.js.map +0 -1
- package/dist/chunk-HHJGKD5B.js +0 -71
- package/dist/chunk-HHJGKD5B.js.map +0 -1
- package/dist/chunk-MBEQASP3.js +0 -5
- package/dist/chunk-MCJUAE6V.js +0 -6
- package/dist/chunk-MCJUAE6V.js.map +0 -1
- package/dist/chunk-SRHLXZRF.js.map +0 -1
- package/dist/chunk-XDJSYQST.js +0 -6
- package/dist/chunk-XDJSYQST.js.map +0 -1
- package/dist/chunk-YPOELN6Z.js +0 -798
- package/dist/chunk-YPOELN6Z.js.map +0 -1
- package/dist/config-KCYHMKCT.js +0 -2
- package/dist/config-mutator-QP4GLBOE.js +0 -2
- package/dist/debug-3MEUO2P2.js +0 -2
- package/dist/heal-JDXUPRET.js +0 -2
- package/dist/loader-PTCXLJEX.js +0 -2
- package/dist/memory-extract-WH4FZ456.js +0 -2
- package/dist/program-FFWEILAS.js +0 -2
- package/dist/providers-AKQ4HTB4.js +0 -2
- package/dist/query-PKGYE5HR.js +0 -2
- package/dist/registry-IFMDJWQ7.js +0 -2
- package/dist/scheduler-63D5KFO7.js +0 -2
- package/dist/store-5MJOO74U.js +0 -2
- package/dist/timers-PCB4ZIBD.js +0 -2
- package/dist/types-C7IFH42Z.js +0 -2
- package/dist/types-OIFU3KSQ.js +0 -2
- package/dist/workspace-setup-C4VB3QZV.js +0 -2
- /package/dist/{agent-4AOMVXRJ.js.map → agent-RDVGL2TW.js.map} +0 -0
- /package/dist/{chunk-EKTPCSN4.js.map → chunk-4ITQP3XL.js.map} +0 -0
- /package/dist/{chunk-FIOB3MEX.js.map → chunk-HPDHNIA3.js.map} +0 -0
- /package/dist/{chunk-63UYRJIC.js.map → chunk-TRQSP67X.js.map} +0 -0
- /package/dist/{compaction-X46EQEPS.js.map → compaction-S5H6DTOR.js.map} +0 -0
- /package/dist/{config-KCYHMKCT.js.map → config-UOHEG4BW.js.map} +0 -0
- /package/dist/{config-mutator-QP4GLBOE.js.map → config-mutator-KSEBWKJH.js.map} +0 -0
- /package/dist/{context-planner-G2J7FNNU.js.map → context-planner-2RGHJHSO.js.map} +0 -0
- /package/dist/{debug-3MEUO2P2.js.map → debug-TGAP7E7W.js.map} +0 -0
- /package/dist/{editor-chat-R54E65W5.js.map → editor-chat-FUBQLMAQ.js.map} +0 -0
- /package/dist/{heal-JDXUPRET.js.map → heal-YP7QI7D3.js.map} +0 -0
- /package/dist/{inbox-L5ZZ623Y.js.map → inbox-O5UB3YQN.js.map} +0 -0
- /package/dist/{ingest-whatsapp-NS4OWDOU.js.map → ingest-whatsapp-C3O5UPBX.js.map} +0 -0
- /package/dist/{loader-PTCXLJEX.js.map → loader-BGWA7IRY.js.map} +0 -0
- /package/dist/{memory-extract-WH4FZ456.js.map → loader-LBHKSXBK.js.map} +0 -0
- /package/dist/{program-FFWEILAS.js.map → memory-extract-KKPKAOPH.js.map} +0 -0
- /package/dist/{processes-XF5CV4LK.js.map → processes-7W27G3J3.js.map} +0 -0
- /package/dist/{providers-AKQ4HTB4.js.map → program-2MDELQLX.js.map} +0 -0
- /package/dist/{query-PKGYE5HR.js.map → providers-WCQSKTNP.js.map} +0 -0
- /package/dist/{registry-IFMDJWQ7.js.map → query-FZAL7AQD.js.map} +0 -0
- /package/dist/{scheduler-63D5KFO7.js.map → recipes-LZ56TA3X.js.map} +0 -0
- /package/dist/{store-5MJOO74U.js.map → registry-ONJSILH4.js.map} +0 -0
- /package/dist/{task-store-NM7VKNLE.js.map → scheduler-XRM2RJIV.js.map} +0 -0
- /package/dist/{slack-PSQLVTGB.js.map → slack-D27BE37Q.js.map} +0 -0
- /package/dist/{timers-PCB4ZIBD.js.map → store-4UCO56K2.js.map} +0 -0
- /package/dist/{subagent-2SJHSSJS.js.map → subagent-EPOT3QDM.js.map} +0 -0
- /package/dist/{types-C7IFH42Z.js.map → task-store-3NUWLYRY.js.map} +0 -0
- /package/dist/{telegram-W4SLFMNY.js.map → telegram-UWV67KWG.js.map} +0 -0
- /package/dist/{types-OIFU3KSQ.js.map → timers-QB4KYNAE.js.map} +0 -0
- /package/dist/{wiki-UDPYFJBL.js.map → types-ECMEC5BZ.js.map} +0 -0
- /package/dist/{workspace-setup-C4VB3QZV.js.map → types-TTB6DJUE.js.map} +0 -0
- /package/dist/{usage-dashboard-AXPXB2KP.js.map → usage-dashboard-FQGPPABD.js.map} +0 -0
- /package/dist/{whatsapp-DCHRBRVV.js.map → whatsapp-KJ2NRKKQ.js.map} +0 -0
- /package/dist/{whatsapp-state-6D6FHHD2.js.map → whatsapp-state-3ZVQ6MQD.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-HPDHNIA3.js";import{createHash as C}from"crypto";function $(e,n){if(!e.enabled)return[];let t=n.listContacts(),d=n.listChats(),i=[],a=r=>r.replace(/^\+/,"").toLowerCase(),s=e.allowContacts.map(a),o=e.allowGroups.map(a),c=e.denyContacts.map(a),u=e.denyGroups.map(a),m=(r,g)=>{if(g.length===0)return!1;let f=a(r);return g.some(p=>f.includes(p)||p.includes(f))};for(let r of t){let g=`${r.phone}|${r.jid}`;if(m(g,c)||!m(g,s))continue;let f=d.find(p=>!p.isGroup&&p.jid===r.jid);i.push({kind:"contact",jid:r.jid,contact:r,chat:f})}for(let r of d)r.isGroup&&(m(r.jid,u)||m(r.jid,o)&&i.push({kind:"group",jid:r.jid,chat:r}));return i}var h=(e=new Date)=>e.toISOString().slice(0,10),l=(e=new Date)=>h(e).replace(/-/g,"");function w(e){return C("sha1").update(e).digest("hex").slice(0,10)}function R(e,n,t=new Date){let d=h(t),i=`wa-contact-${w(e.jid)}-${l(t)}`,s=[`# Contact: ${e.savedName||e.pushName||e.phone||e.jid}`,""];return s.push(`- **JID**: ${e.jid}`),e.phone&&s.push(`- **Phone**: +${e.phone}`),e.savedName&&s.push(`- **Saved name**: ${e.savedName}`),e.pushName&&e.pushName!==e.savedName&&s.push(`- **Push name**: ${e.pushName}`),e.status&&s.push(`- **Status**: ${e.status}`),e.updatedAt&&s.push(`- **Last observed**: ${e.updatedAt}`),{id:i,date:d,agentId:n,source:"whatsapp:contact",sourceContext:e.jid,content:s.join(`
|
|
2
2
|
`),meta:{jid:e.jid,phone:e.phone,kind:"contact",profileHash:x(e)}}}function k(e,n,t=new Date){let d=h(t),i=`wa-group-meta-${w(e.jid)}-${l(t)}`,a=[`# Group: ${e.subject||"(unnamed)"}`,""];a.push(`- **JID**: ${e.jid}`),e.description&&a.push(`- **Description**: ${e.description}`),e.owner&&a.push(`- **Owner**: ${e.owner}`),a.push(`- **Members (${e.memberCount})**:`);let s=e.members.slice(0,50);for(let o of s){let c=o.admin?` (${o.admin})`:"";a.push(` - ${o.jid}${c}`)}return e.members.length>s.length&&a.push(` - \u2026and ${e.members.length-s.length} more`),{id:i,date:d,agentId:n,source:"whatsapp:group-meta",sourceContext:e.jid,content:a.join(`
|
|
3
3
|
`),meta:{jid:e.jid,subject:e.subject,memberCount:e.memberCount,kind:"group-meta"}}}function D(e,n,t,d,i=new Date){if(t.length===0)return null;let a=t[t.length-1].id,s=h(i),o=`wa-dm-${w(e.jid)}-${l(i)}-${b(a)}`,c=n?.savedName||n?.pushName||e.name||e.jid,u=[`# Chat with ${c}`,""];u.push(`- **JID**: ${e.jid}`),n?.phone&&u.push(`- **Phone**: +${n.phone}`),u.push(`- **Messages**: ${t.length}`),u.push("");for(let m of t)u.push(y(m,c));return{id:o,date:s,agentId:d,source:"whatsapp:dm",sourceContext:e.jid,content:u.join(`
|
|
4
4
|
`),meta:{jid:e.jid,kind:"dm",messageCount:t.length,oldestMsgTs:t[0]?.timestamp,newestMsgTs:t[t.length-1]?.timestamp,lastMsgId:a}}}function M(e,n,t,d,i=new Date){if(t.length===0)return null;let a=t[t.length-1].id,s=h(i),o=`wa-group-${w(e.jid)}-${l(i)}-${b(a)}`,c=[`# Group chat: ${n.subject||e.name}`,""];c.push(`- **JID**: ${e.jid}`),c.push(`- **Members**: ${n.memberCount}`),c.push(`- **Messages**: ${t.length}`),c.push("");for(let u of t)c.push(y(u,u.fromJid));return{id:o,date:s,agentId:d,source:"whatsapp:group",sourceContext:e.jid,content:c.join(`
|
|
5
5
|
`),meta:{jid:e.jid,kind:"group",messageCount:t.length,lastMsgId:a}}}function y(e,n){let t=e.timestamp?G(e.timestamp):"",d=e.fromMe?"me":n,i=e.text;return!i&&e.media&&(e.media.kind==="image"?i=`[image${e.media.caption?`: ${e.media.caption}`:""}]`:e.media.kind==="audio"?i="[voice message]":e.media.kind==="video"?i=`[video${e.media.caption?`: ${e.media.caption}`:""}]`:e.media.kind==="document"?i=`[document: ${e.media.filename??"unnamed"}]`:e.media.kind==="sticker"&&(i="[sticker]")),`[${t}] ${d}: ${i}`}function G(e){try{return new Date(e*1e3).toISOString().replace("T"," ").slice(0,16)}catch{return String(e)}}function b(e){return e.replace(/[^A-Za-z0-9]/g,"").slice(-10)}function x(e){let n=C("sha1");return n.update(e.jid),n.update("|"),n.update(e.savedName||""),n.update("|"),n.update(e.pushName||""),n.update("|"),n.update(e.status||""),n.digest("hex").slice(0,10)}async function I(e){let n=e.now??new Date,t={scannedContacts:0,scannedGroups:0,wroteContacts:0,wroteGroups:0,wroteDmWindows:0,wroteGroupWindows:0,skippedUnchanged:0,errors:[]},d=[],i=s=>{if(e.dryRun){d.push(s);return}e.store.addEntry(s)};if(!e.source.isConnected()&&!e.dryRun)return t.errors.push({jid:"-",kind:"source",message:"WhatsApp socket not connected"}),{...t,dryRunEntries:e.dryRun?d:void 0};let a=$(e.config,e.source);a.length>e.config.throttle.maxChatsPerSweep&&(a=a.slice(0,e.config.throttle.maxChatsPerSweep));for(let s of a)try{if(s.kind==="contact"){t.scannedContacts++;let o=s.contact??await e.source.getContactProfile(s.jid);if(!o)continue;let c=R(o,e.agentId,n);if(i(c),t.wroteContacts++,e.config.mode==="messages"){let u=await e.source.getHistory(s.jid,{limit:e.config.messageCap}),m=j(u,e.config.historyDays,n);if(m.length>0&&s.chat){let r=D(s.chat,o,m,e.agentId,n);r&&(i(r),t.wroteDmWindows++)}}}else{t.scannedGroups++;let o=await e.source.getGroupMetadata(s.jid);if(!o)continue;let c=k(o,e.agentId,n);if(i(c),t.wroteGroups++,e.config.mode==="messages"&&s.chat){let u=await e.source.getHistory(s.jid,{limit:e.config.messageCap}),m=j(u,e.config.historyDays,n);if(m.length>0){let r=M(s.chat,o,m,e.agentId,n);r&&(i(r),t.wroteGroupWindows++)}}}}catch(o){t.errors.push({jid:s.jid,kind:s.kind,message:o?.message??String(o)})}return{...t,dryRunEntries:e.dryRun?d:void 0}}function j(e,n,t){let d=Math.floor((t.getTime()-n*864e5)/1e3);return e.filter(i=>!i.timestamp||i.timestamp>=d)}export{x as hashProfile,$ as resolveScope,I as runSweep,R as transformContact,D as transformDm,M as transformGroupMessages,k as transformGroupMeta};
|
|
6
|
-
//# sourceMappingURL=ingest-whatsapp-
|
|
6
|
+
//# sourceMappingURL=ingest-whatsapp-C3O5UPBX.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e}from"./chunk-6PPIFDOQ.js";import"./chunk-
|
|
1
|
+
import{a as e}from"./chunk-6PPIFDOQ.js";import"./chunk-HPDHNIA3.js";function i(t={}){let r=`<div class="ax-proc__kpis" id="proc-kpis" hidden></div>
|
|
2
2
|
<div class="ax-proc__root">
|
|
3
3
|
<aside class="ax-proc__list">
|
|
4
4
|
<header>
|
|
@@ -253,4 +253,4 @@ import{a as e}from"./chunk-6PPIFDOQ.js";import"./chunk-FIOB3MEX.js";function i(t
|
|
|
253
253
|
setInterval(refresh, 5000);
|
|
254
254
|
})();
|
|
255
255
|
`;export{i as renderProcessesPage};
|
|
256
|
-
//# sourceMappingURL=processes-
|
|
256
|
+
//# sourceMappingURL=processes-7W27G3J3.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-BLUXL6HR.js";import"./chunk-ASSJ4Z6Z.js";import"./chunk-6PPIFDOQ.js";import"./chunk-U364GNQX.js";import"./chunk-IM376SD6.js";import"./chunk-ZE2YFX4K.js";import"./chunk-JXEPJ3YD.js";import"./chunk-DSCMCVTV.js";import"./chunk-J4WKMKTP.js";import"./chunk-LY7JGDV7.js";import"./chunk-N67JZAXU.js";import"./chunk-CDNWCYF7.js";import"./chunk-AFRHKA7B.js";import"./chunk-EW27SCCC.js";import"./chunk-BTAEYL3P.js";import"./chunk-34NG7UDX.js";import"./chunk-5F3J55LG.js";import"./chunk-WJXU5F4Z.js";import"./chunk-LEIYC3BF.js";import"./chunk-WZEYII2S.js";import"./chunk-64P4QHSZ.js";import"./chunk-BFZUG66X.js";import"./chunk-SR3X25TN.js";import"./chunk-53NRX2NA.js";import"./chunk-SFQUP3BP.js";import"./chunk-JGXE2YNV.js";import"./chunk-VJUTQAPJ.js";import"./chunk-DJEZ2HVU.js";import"./chunk-DSYKYZMT.js";import"./chunk-TRQSP67X.js";import"./chunk-QOYAX2FT.js";import"./chunk-HPDHNIA3.js";export{a as buildProgram};
|
|
2
|
+
//# sourceMappingURL=program-2MDELQLX.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{f as a,g as b,h as c}from"./chunk-BTAEYL3P.js";import"./chunk-34NG7UDX.js";import"./chunk-5F3J55LG.js";import"./chunk-WJXU5F4Z.js";import"./chunk-LEIYC3BF.js";import"./chunk-WZEYII2S.js";import"./chunk-64P4QHSZ.js";import"./chunk-BFZUG66X.js";import"./chunk-SR3X25TN.js";import"./chunk-53NRX2NA.js";import"./chunk-VJUTQAPJ.js";import"./chunk-TRQSP67X.js";import"./chunk-QOYAX2FT.js";import"./chunk-HPDHNIA3.js";export{c as AgentRegistry,b as getGlobalRegistry,a as setGlobalRegistry};
|
|
2
|
+
//# sourceMappingURL=registry-ONJSILH4.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-HPDHNIA3.js";function m(e){let r=e.log??(()=>{});return async function(o){let n=e.inboxBaseUrl??"",s=f(o);for(let d of o.assignedTo){let c=e.actors.channelFor(d,"slack");if(!c)continue;let a=u(o,d,n,s);try{let t=await e.adapter.send({channel:"slack",chatId:c,text:a,parseMode:"markdown"}),l=[...o.delivered??[],{channel:"slack",handle:c,messageId:typeof t=="string"?t:void 0,at:new Date().toISOString()}];e.tasks.save({...o,delivered:l})}catch(t){r(`[task:${o.id}] slack delivery to ${d}@${c} failed: ${t?.message??t}`)}}}}function f(e){if(!e.form.secondaryAction)return!1;for(let r of e.form.fields??[])if(r.required&&r.defaultValue===void 0)return!1;return!0}function u(e,r,i,o){let n=[];if(n.push(`*${e.title}*`),e.description&&n.push("",e.description),!o&&e.form.fields?.length){n.push("","*Fields*:");for(let s of e.form.fields)n.push(`\u2022 ${s.label}${s.required?" (required)":""}`)}return e.dueAt&&n.push("",`:clock3: Due: ${new Date(e.dueAt).toLocaleString()}`),o?(n.push("",`:white_check_mark: <${i}/t/${encodeURIComponent(e.id)}/primary?actor=${encodeURIComponent(r)}|${e.form.submitLabel||"Approve"}>`),e.form.secondaryAction&&n.push(`:x: <${i}/t/${encodeURIComponent(e.id)}/secondary?actor=${encodeURIComponent(r)}|${e.form.secondaryAction.label}>`)):n.push("",`<${i}/inbox?actor=${encodeURIComponent(r)}|Open form>`),n.join(`
|
|
2
2
|
`)}export{m as createSlackTaskRenderer};
|
|
3
|
-
//# sourceMappingURL=slack-
|
|
3
|
+
//# sourceMappingURL=slack-D27BE37Q.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-HPDHNIA3.js";var g=class{registry;activeRuns=new Map;runCounter=0;log;depthMap=new Map;constructor(t,e=console.error.bind(console,"[subagent]")){this.registry=t,this.log=e}async spawn(t){let e=this.depthMap.get(t.parentAgentId)||0;if(e>=3)return{runId:"",targetAgentId:t.targetAgentId,success:!1,content:"",error:`Sub-agent spawn depth exceeded (max: 3). Cannot spawn "${t.targetAgentId}" from "${t.parentAgentId}".`,duration:0};let n=`sub-${++this.runCounter}-${Date.now().toString(36)}`,r={request:t,runId:n,startedAt:Date.now()};this.activeRuns.set(n,r),this.depthMap.set(t.targetAgentId,e+1),this.log(`Spawning sub-agent: ${t.targetAgentId} (parent: ${t.parentAgentId}, depth: ${e+1}, blocking: ${t.blocking??!1})`);let o={message:this.buildSubAgentPrompt(t),agentId:t.targetAgentId,context:{channel:"subagent",sender:`agent:${t.parentAgentId}`,chatId:`subagent:${n}`}},i=t.timeout??3e5;try{let a=await Promise.race([this.registry.execute(o),this.timeoutPromise(i,t.targetAgentId)]),s={runId:n,targetAgentId:t.targetAgentId,success:!a.error,content:a.content,error:a.error,duration:Date.now()-r.startedAt};return this.log(`Sub-agent ${t.targetAgentId} completed in ${s.duration}ms (${s.success?"success":"error"})`),s}catch(a){return{runId:n,targetAgentId:t.targetAgentId,success:!1,content:"",error:a.message,duration:Date.now()-r.startedAt}}finally{this.activeRuns.delete(n),this.depthMap.delete(t.targetAgentId)}}async spawnParallel(t){return Promise.all(t.map(e=>this.spawn(e)))}listActive(){return Array.from(this.activeRuns.values()).map(t=>({runId:t.runId,targetAgentId:t.request.targetAgentId,parentAgentId:t.request.parentAgentId,duration:Date.now()-t.startedAt}))}buildSubAgentPrompt(t){return[`[Sub-agent task from ${t.parentAgentId}]`,"You have been spawned as a background sub-agent to handle a specific task.","Focus on completing the task below and provide a clear, actionable response.","",t.prompt].join(`
|
|
2
2
|
`)}timeoutPromise(t,e){return new Promise((n,r)=>{setTimeout(()=>{r(new Error(`Sub-agent "${e}" timed out after ${Math.round(t/1e3)}s`))},t)})}};export{g as SubAgentManager};
|
|
3
|
-
//# sourceMappingURL=subagent-
|
|
3
|
+
//# sourceMappingURL=subagent-EPOT3QDM.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d}from"./chunk-N67JZAXU.js";import"./chunk-CDNWCYF7.js";import"./chunk-
|
|
2
|
-
//# sourceMappingURL=task-store-
|
|
1
|
+
import{a,b,c,d}from"./chunk-N67JZAXU.js";import"./chunk-CDNWCYF7.js";import"./chunk-HPDHNIA3.js";export{c as TaskStore,d as computeKpis,a as taskStatusSchema,b as userTaskRecordSchema};
|
|
2
|
+
//# sourceMappingURL=task-store-3NUWLYRY.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-HPDHNIA3.js";function p(e){let i=e.log??(()=>{});return async function(n){let d=e.inboxBaseUrl??"",r=g(n.form);for(let t of n.assignedTo){let o=e.actors.channelFor(t,"telegram");if(!o)continue;let l=m(n,t,d,r);try{let s;if(r&&e.adapter.sendWithInlineButtons){let a=[{label:n.form.submitLabel||"Approve",url:`${d}/t/${encodeURIComponent(n.id)}/primary?actor=${encodeURIComponent(t)}`},...n.form.secondaryAction?[{label:n.form.secondaryAction.label,url:`${d}/t/${encodeURIComponent(n.id)}/secondary?actor=${encodeURIComponent(t)}`}]:[]],f=await e.adapter.sendWithInlineButtons({chatId:o,text:l,parseMode:"markdown",buttons:a});s=typeof f=="string"?f:void 0}else{let a=await e.adapter.sendMessage({chatId:o,text:l,parseMode:"markdown"});s=typeof a=="string"?a:void 0}let u=[...n.delivered??[],{channel:"telegram",handle:o,messageId:s,at:new Date().toISOString()}];e.tasks.save({...n,delivered:u})}catch(s){i(`[task:${n.id}] telegram delivery to ${t}@${o} failed: ${s?.message??s}`)}}}}function g(e){if(!e.secondaryAction)return!1;for(let i of e.fields??[])if(i.required&&i.defaultValue===void 0)return!1;return!0}function m(e,i,c,n){let d=`${c}/inbox?actor=${encodeURIComponent(i)}`,r=[];if(r.push(`\u{1F4CB} **${e.title}**`),e.description&&r.push("",e.description),!n&&e.form.fields?.length){r.push("","_Fields_:");for(let t of e.form.fields){let o=t.required?" *(required)*":"";r.push(`\u2022 ${t.label}${o}`)}}return e.dueAt&&r.push("",`\u23F0 Due: ${new Date(e.dueAt).toLocaleString()}`),n||r.push("",`[Open form \u2192](${d})`),r.join(`
|
|
2
2
|
`)}export{p as createTelegramTaskRenderer};
|
|
3
|
-
//# sourceMappingURL=telegram-
|
|
3
|
+
//# sourceMappingURL=telegram-UWV67KWG.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as v}from"./chunk-34NG7UDX.js";import"./chunk-
|
|
1
|
+
import{a as v}from"./chunk-34NG7UDX.js";import"./chunk-HPDHNIA3.js";import{createServer as C}from"http";import{readdirSync as T}from"fs";function R(i=4201){let c=new v;C(async(u,a)=>{let t=new URL(u.url||"/",`http://localhost:${i}`),s=t.pathname;if(a.setHeader("Access-Control-Allow-Origin","*"),s==="/api/usage"){let r=t.searchParams.get("from")||"",n=t.searchParams.get("to")||"",d=w(c,r,n);a.writeHead(200,{"Content-Type":"application/json"}),a.end(JSON.stringify(d));return}if(s==="/api/usage.csv"){let r=t.searchParams.get("from")||"",n=t.searchParams.get("to")||"",d=w(c,r,n),p="date,tasks,input,output,cache_read,cache_create,cost_usd,top_agent",h=d.map(o=>{let l=Object.entries(o.agents).sort(([,x],[,e])=>e.cost-x.cost)[0];return[o.date,o.tasks,o.input,o.output,o.cacheRead,o.cacheCreate,o.cost.toFixed(6),l?l[0]:""].join(",")}).join(`
|
|
2
2
|
`);a.writeHead(200,{"Content-Type":"text/csv; charset=utf-8","Content-Disposition":`attachment; filename="agentx-usage-${Date.now()}.csv"`}),a.end(p+`
|
|
3
3
|
`+h+`
|
|
4
4
|
`);return}a.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),a.end(M())}).listen(i,()=>{console.log(`
|
|
@@ -800,4 +800,4 @@ window.addEventListener('resize', () => { renderHero(); });
|
|
|
800
800
|
/* initial */
|
|
801
801
|
load();
|
|
802
802
|
`,z=R;export{z as default,R as startUsageDashboard};
|
|
803
|
-
//# sourceMappingURL=usage-dashboard-
|
|
803
|
+
//# sourceMappingURL=usage-dashboard-FQGPPABD.js.map
|