agentix-cli 0.212.0 → 0.213.1
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-WS5BTNNP.js → App-5CLRBC3C.js} +2 -2
- package/dist/{ChatApp-DRMZZ3RJ.js → ChatApp-LDNQVD2C.js} +2 -2
- package/dist/{absorb-eval-IZOPUQE7.js → absorb-eval-JWQPGUJS.js} +2 -2
- package/dist/{adapter-3JMPFQ25.js → adapter-AOKK2LFM.js} +2 -2
- package/dist/{agent-YA2EBSW4.js → agent-6VEMBVRN.js} +2 -2
- package/dist/{board-dashboard-KFEVHD3Z.js → board-dashboard-LDMIS7MM.js} +4 -4
- package/dist/{chunk-4FL6B3B7.js → chunk-2V43GUET.js} +106 -105
- package/dist/chunk-2V43GUET.js.map +1 -0
- package/dist/{chunk-EJXHHFZJ.js → chunk-4W5KRZTT.js} +2 -2
- package/dist/{chunk-MVDB76JV.js → chunk-6PBYRK7J.js} +2 -2
- package/dist/{chunk-ZD2DD7I2.js → chunk-BERSMN6Y.js} +2 -2
- package/dist/{chunk-5E6JVFHV.js → chunk-BU6V75KD.js} +2 -2
- package/dist/{chunk-UZEH2A2F.js → chunk-CUCIMPFI.js} +2 -2
- package/dist/{chunk-DD4YKQGF.js → chunk-D3FIIEDR.js} +2 -2
- package/dist/{chunk-XUOFCIAE.js → chunk-D6H4DH32.js} +2 -2
- package/dist/{chunk-6LOXNAZD.js → chunk-DGCYMSXU.js} +2 -2
- package/dist/{chunk-BITJXYHB.js → chunk-DNPPPUDP.js} +2 -2
- package/dist/{chunk-27DVJFFR.js → chunk-DPA3IOMU.js} +2 -2
- package/dist/{chunk-EGKAE6VD.js → chunk-DSUL5L3T.js} +2 -2
- package/dist/{chunk-PJHJFZJ4.js → chunk-DYH6KS3X.js} +270 -270
- package/dist/chunk-DYH6KS3X.js.map +1 -0
- package/dist/{chunk-SYEC2RCV.js → chunk-EE5RZDQE.js} +2 -2
- package/dist/{chunk-KUB5F67E.js → chunk-ERKK22QV.js} +2 -2
- package/dist/{chunk-ETDYJ52Z.js → chunk-FCF47R4W.js} +3 -3
- package/dist/{chunk-RFMBLJN3.js → chunk-G3GFE3GK.js} +2 -2
- package/dist/{chunk-W7D2N55Y.js → chunk-I722PWJE.js} +2 -2
- package/dist/{chunk-QDZWSALI.js → chunk-IXV3BPUZ.js} +2 -2
- package/dist/{chunk-2PYRRBLW.js → chunk-KU3ZF3WO.js} +2 -2
- package/dist/{chunk-6UVU47FA.js → chunk-MOATCFT5.js} +2 -2
- package/dist/{chunk-6KAP6IHP.js → chunk-N7IX77SL.js} +2 -2
- package/dist/chunk-NERO7F3J.js +115 -0
- package/dist/chunk-NERO7F3J.js.map +1 -0
- package/dist/{chunk-YXGYLWD5.js → chunk-NWE3B245.js} +2 -2
- package/dist/{chunk-VZFFEGVQ.js → chunk-O4WFPH6H.js} +2 -2
- package/dist/{chunk-X5UWEMFI.js → chunk-UWDDVDU6.js} +2 -2
- package/dist/{chunk-X5UWEMFI.js.map → chunk-UWDDVDU6.js.map} +1 -1
- package/dist/{chunk-DZ3Z3ZAK.js → chunk-VKLTCUD7.js} +2 -2
- package/dist/{chunk-OHZ2ETAY.js → chunk-WKBGQGVL.js} +2 -2
- package/dist/{chunk-UODNQNDK.js → chunk-XBFXSSHA.js} +2 -2
- package/dist/{chunk-PAOXBAYJ.js → chunk-Z6N7POAU.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/{client-NSZL7HQZ.js → client-2TFSAO3Y.js} +2 -2
- package/dist/{config-LE57YRFQ.js → config-LTXRWDRK.js} +2 -2
- package/dist/{config-mutate-XWOE7TCY.js → config-mutate-UFVJUJQO.js} +2 -2
- package/dist/{config-mutator-RZB5O7ES.js → config-mutator-RRKU33OL.js} +2 -2
- package/dist/{contributions-REWGLEPA.js → contributions-5XUEOSLT.js} +2 -2
- package/dist/{doctor-JNQHNUSO.js → doctor-L675OBBF.js} +2 -2
- package/dist/{follow-up-tool-WJ5MHV3O.js → follow-up-tool-2OEZMPPQ.js} +2 -2
- package/dist/{hub-LWUTWLBA.js → hub-VJZYQXKB.js} +2 -2
- package/dist/index.d.ts +262 -208
- package/dist/index.js +1 -1
- package/dist/{org-tool-R6U5LUUB.js → org-tool-QBLKCMY3.js} +2 -2
- package/dist/{program-OT7WYMVD.js → program-3QOBRNT4.js} +27 -27
- package/dist/{promote-DYDETYJ4.js → promote-Z6KL6GOL.js} +2 -2
- package/dist/{query-JF3BQNUR.js → query-SZA6UMHA.js} +2 -2
- package/dist/{query-settings-2FPH2NQ7.js → query-settings-BALRO5J4.js} +2 -2
- package/dist/{registry-FX4C6RHG.js → registry-J3Y3DDFT.js} +2 -2
- package/dist/{request-planner-NKP7YFUN.js → request-planner-Y5HG5DQ4.js} +2 -2
- package/dist/{review-candidates-YL7QGFP2.js → review-candidates-BZJOFMFO.js} +2 -2
- package/dist/{routing-KW42OGIW.js → routing-3JDN3Z6L.js} +2 -2
- package/dist/schedule-tool-VM5OJ7XB.js +2 -0
- package/dist/{scheduler-LYSUXKAB.js → scheduler-JJOO2ODF.js} +2 -2
- package/dist/{seat-HCXOUS5H.js → seat-5FTOWN5J.js} +2 -2
- package/dist/{select-KTQNUTOG.js → select-BRQQP7OP.js} +2 -2
- package/dist/{set-enabled-PAQ7ZXFL.js → set-enabled-EZLQFASM.js} +2 -2
- package/dist/{sprint-tool-YGOAJSZQ.js → sprint-tool-YJ4WT3AD.js} +2 -2
- package/dist/{tool-7FFPIOO5.js → tool-BFKCGAD6.js} +2 -2
- package/dist/{tool-IJIYPMOA.js → tool-CXJHLIHJ.js} +2 -2
- package/dist/{tool-OWGDFDVG.js → tool-MT5YQ7F3.js} +2 -2
- package/dist/{tool-UNSJJ4MO.js → tool-RCEOKPES.js} +2 -2
- package/dist/{wiki-PYWKCJ2Y.js → wiki-F3LZSBN3.js} +2 -2
- package/dist/wiki-enrich-KIONW7SB.js +2 -0
- package/dist/workspace-setup-PIPGUMLG.js +2 -0
- package/package.json +1 -1
- package/dist/chunk-3AHYZLGE.js +0 -115
- package/dist/chunk-3AHYZLGE.js.map +0 -1
- package/dist/chunk-4FL6B3B7.js.map +0 -1
- package/dist/chunk-PJHJFZJ4.js.map +0 -1
- package/dist/schedule-tool-B3PPRW6J.js +0 -2
- package/dist/wiki-enrich-JFVS7NYY.js +0 -2
- package/dist/workspace-setup-GTSXWYU4.js +0 -2
- /package/dist/{App-WS5BTNNP.js.map → App-5CLRBC3C.js.map} +0 -0
- /package/dist/{ChatApp-DRMZZ3RJ.js.map → ChatApp-LDNQVD2C.js.map} +0 -0
- /package/dist/{absorb-eval-IZOPUQE7.js.map → absorb-eval-JWQPGUJS.js.map} +0 -0
- /package/dist/{adapter-3JMPFQ25.js.map → adapter-AOKK2LFM.js.map} +0 -0
- /package/dist/{agent-YA2EBSW4.js.map → agent-6VEMBVRN.js.map} +0 -0
- /package/dist/{board-dashboard-KFEVHD3Z.js.map → board-dashboard-LDMIS7MM.js.map} +0 -0
- /package/dist/{chunk-EJXHHFZJ.js.map → chunk-4W5KRZTT.js.map} +0 -0
- /package/dist/{chunk-MVDB76JV.js.map → chunk-6PBYRK7J.js.map} +0 -0
- /package/dist/{chunk-ZD2DD7I2.js.map → chunk-BERSMN6Y.js.map} +0 -0
- /package/dist/{chunk-5E6JVFHV.js.map → chunk-BU6V75KD.js.map} +0 -0
- /package/dist/{chunk-UZEH2A2F.js.map → chunk-CUCIMPFI.js.map} +0 -0
- /package/dist/{chunk-DD4YKQGF.js.map → chunk-D3FIIEDR.js.map} +0 -0
- /package/dist/{chunk-XUOFCIAE.js.map → chunk-D6H4DH32.js.map} +0 -0
- /package/dist/{chunk-6LOXNAZD.js.map → chunk-DGCYMSXU.js.map} +0 -0
- /package/dist/{chunk-BITJXYHB.js.map → chunk-DNPPPUDP.js.map} +0 -0
- /package/dist/{chunk-27DVJFFR.js.map → chunk-DPA3IOMU.js.map} +0 -0
- /package/dist/{chunk-EGKAE6VD.js.map → chunk-DSUL5L3T.js.map} +0 -0
- /package/dist/{chunk-SYEC2RCV.js.map → chunk-EE5RZDQE.js.map} +0 -0
- /package/dist/{chunk-KUB5F67E.js.map → chunk-ERKK22QV.js.map} +0 -0
- /package/dist/{chunk-ETDYJ52Z.js.map → chunk-FCF47R4W.js.map} +0 -0
- /package/dist/{chunk-RFMBLJN3.js.map → chunk-G3GFE3GK.js.map} +0 -0
- /package/dist/{chunk-W7D2N55Y.js.map → chunk-I722PWJE.js.map} +0 -0
- /package/dist/{chunk-QDZWSALI.js.map → chunk-IXV3BPUZ.js.map} +0 -0
- /package/dist/{chunk-2PYRRBLW.js.map → chunk-KU3ZF3WO.js.map} +0 -0
- /package/dist/{chunk-6UVU47FA.js.map → chunk-MOATCFT5.js.map} +0 -0
- /package/dist/{chunk-6KAP6IHP.js.map → chunk-N7IX77SL.js.map} +0 -0
- /package/dist/{chunk-YXGYLWD5.js.map → chunk-NWE3B245.js.map} +0 -0
- /package/dist/{chunk-VZFFEGVQ.js.map → chunk-O4WFPH6H.js.map} +0 -0
- /package/dist/{chunk-DZ3Z3ZAK.js.map → chunk-VKLTCUD7.js.map} +0 -0
- /package/dist/{chunk-OHZ2ETAY.js.map → chunk-WKBGQGVL.js.map} +0 -0
- /package/dist/{chunk-UODNQNDK.js.map → chunk-XBFXSSHA.js.map} +0 -0
- /package/dist/{chunk-PAOXBAYJ.js.map → chunk-Z6N7POAU.js.map} +0 -0
- /package/dist/{client-NSZL7HQZ.js.map → client-2TFSAO3Y.js.map} +0 -0
- /package/dist/{config-LE57YRFQ.js.map → config-LTXRWDRK.js.map} +0 -0
- /package/dist/{config-mutate-XWOE7TCY.js.map → config-mutate-UFVJUJQO.js.map} +0 -0
- /package/dist/{config-mutator-RZB5O7ES.js.map → config-mutator-RRKU33OL.js.map} +0 -0
- /package/dist/{contributions-REWGLEPA.js.map → contributions-5XUEOSLT.js.map} +0 -0
- /package/dist/{doctor-JNQHNUSO.js.map → doctor-L675OBBF.js.map} +0 -0
- /package/dist/{follow-up-tool-WJ5MHV3O.js.map → follow-up-tool-2OEZMPPQ.js.map} +0 -0
- /package/dist/{hub-LWUTWLBA.js.map → hub-VJZYQXKB.js.map} +0 -0
- /package/dist/{org-tool-R6U5LUUB.js.map → org-tool-QBLKCMY3.js.map} +0 -0
- /package/dist/{program-OT7WYMVD.js.map → program-3QOBRNT4.js.map} +0 -0
- /package/dist/{promote-DYDETYJ4.js.map → promote-Z6KL6GOL.js.map} +0 -0
- /package/dist/{query-JF3BQNUR.js.map → query-SZA6UMHA.js.map} +0 -0
- /package/dist/{query-settings-2FPH2NQ7.js.map → query-settings-BALRO5J4.js.map} +0 -0
- /package/dist/{registry-FX4C6RHG.js.map → registry-J3Y3DDFT.js.map} +0 -0
- /package/dist/{request-planner-NKP7YFUN.js.map → request-planner-Y5HG5DQ4.js.map} +0 -0
- /package/dist/{review-candidates-YL7QGFP2.js.map → review-candidates-BZJOFMFO.js.map} +0 -0
- /package/dist/{routing-KW42OGIW.js.map → routing-3JDN3Z6L.js.map} +0 -0
- /package/dist/{schedule-tool-B3PPRW6J.js.map → schedule-tool-VM5OJ7XB.js.map} +0 -0
- /package/dist/{scheduler-LYSUXKAB.js.map → scheduler-JJOO2ODF.js.map} +0 -0
- /package/dist/{seat-HCXOUS5H.js.map → seat-5FTOWN5J.js.map} +0 -0
- /package/dist/{select-KTQNUTOG.js.map → select-BRQQP7OP.js.map} +0 -0
- /package/dist/{set-enabled-PAQ7ZXFL.js.map → set-enabled-EZLQFASM.js.map} +0 -0
- /package/dist/{sprint-tool-YGOAJSZQ.js.map → sprint-tool-YJ4WT3AD.js.map} +0 -0
- /package/dist/{tool-7FFPIOO5.js.map → tool-BFKCGAD6.js.map} +0 -0
- /package/dist/{tool-IJIYPMOA.js.map → tool-CXJHLIHJ.js.map} +0 -0
- /package/dist/{tool-OWGDFDVG.js.map → tool-MT5YQ7F3.js.map} +0 -0
- /package/dist/{tool-UNSJJ4MO.js.map → tool-RCEOKPES.js.map} +0 -0
- /package/dist/{wiki-PYWKCJ2Y.js.map → wiki-F3LZSBN3.js.map} +0 -0
- /package/dist/{wiki-enrich-JFVS7NYY.js.map → wiki-enrich-KIONW7SB.js.map} +0 -0
- /package/dist/{workspace-setup-GTSXWYU4.js.map → workspace-setup-PIPGUMLG.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=promote-
|
|
1
|
+
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t}from"./chunk-DSUL5L3T.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-MEFPXHQJ.js";import"./chunk-DGCYMSXU.js";import"./chunk-I722PWJE.js";import"./chunk-WPNRDEHW.js";import"./chunk-OWNQ2FD4.js";import"./chunk-AHWWJ7AF.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-IXV3BPUZ.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{b as DEFAULT_PROMOTE_TYPES,a as PROMOTER_OWNER,c as PROMOTION_LEDGER_FILE,j as appendPromotionLedger,s as approveProposal,n as callPromotionLlm,p as estimateTokens,r as evidenceFor,m as getUnpromotedMemories,k as groupCandidates,h as listAllAgentMemories,d as memoryKey,e as memoryStamp,g as mergeSources,f as parseMemoryStamp,l as parsePromotionResponse,i as readPromotionLedger,t as rejectProposal,o as runPromotion,q as sourceKind};
|
|
2
|
+
//# sourceMappingURL=promote-Z6KL6GOL.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=query-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j}from"./chunk-FCF47R4W.js";import"./chunk-JTFCU5LH.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-BERWTVG2.js";import"./chunk-I722PWJE.js";import"./chunk-WPNRDEHW.js";import"./chunk-AHWWJ7AF.js";import"./chunk-IXV3BPUZ.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QUFIUXMQ.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{c as AUTO_SUMMARY_COVERAGE,a as CATALOG_SELECTOR_MODEL,b as CATALOG_SYNTH_MODEL,h as DEFAULT_GRAPH_WEIGHT,g as SHARED_CATALOG_LINES,d as agenticQuery,f as catalogPool,i as rankCatalogPool,e as retrieveArticles,j as sharedQueryEnabled};
|
|
2
|
+
//# sourceMappingURL=query-SZA6UMHA.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import{b as u}from"./chunk-MEFPXHQJ.js";import{c as a}from"./chunk-JTFCU5LH.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-BERWTVG2.js";import"./chunk-QUFIUXMQ.js";import"./chunk-QIJLFPWE.js";import{readFileSync as f}from"fs";import{resolve as d}from"path";var g={shared:!0,method:"auto",summaries:a,notes:{enabled:!1,types:["project","reference"],dirs:{}}};function y(n,t,e=process.cwd()){if(!n.notes.enabled||!t)return;let r=n.notes.dirs[t];return{owner:t,dir:r?d(e,r):new u({baseDir:d(e,".agentx")}).dirOf(t),types:n.notes.types}}function E(n,t,e=process.env,r=process.cwd()){let i=e.AGENTX_AGENT_ID;if(!(!i||i!==t))return y(n,t,r)}function p(n){if(n)try{return f(n,"utf-8").trim().split(`
|
|
2
|
-
`)[0].trim()||void 0}catch{return}}function c(n,t){try{let e=new URL(n);return e.protocol==="https:"&&e.origin===new URL(t).origin}catch{return!1}}var l=n=>n.map(t=>typeof t=="string"?{repo:t}:{repo:t.repo,about:t.about});function h(n,t=process.env){let e=[];for(let r of n.wiki.query.live.sources){if(r.type==="agentx"){let o=n.node.bind.replace(/^0\.0\.0\.0:/,"127.0.0.1:");e.push({type:"agentx",url:r.url??`http://${o}`,peers:r.peers});continue}let i=(r.tokenEnv?t[r.tokenEnv]:void 0)||p(r.tokenFile);if(r.type==="github"){let o=n.channels.github,s=c(r.apiUrl,"https://api.github.com")?o?.token||p(o?.tokenFile):void 0;e.push({type:"github",apiUrl:r.apiUrl,token:i||s||void 0,repos:l(r.repos)})}else{let o=n.channels.gitlab,s=r.url??o?.host;if(!s)continue;let m=o?.host&&(!r.url||c(s,o.host))?o.token:void 0;e.push({type:"gitlab",url:s,token:i||m||void 0,repos:l(r.repos)})}}return e}function v(n,t=process.env){let e=n.wiki.query;return{shared:e.shared,method:e.method,summaries:{candidates:e.candidates,sharedCandidates:e.sharedCandidates,noteCandidates:e.notes.candidates,maxPages:e.maxPages,pageChars:e.pageChars,linkedPages:e.linkedPages,linkedChars:e.linkedChars,navigatorModel:e.navigatorModel,answerModel:e.answerModel,live:{enabled:e.live.enabled,maxReads:e.live.maxReads,timeoutMs:e.live.timeoutMs,plannerModel:e.live.plannerModel,sources:h(n,t)}},notes:{enabled:e.notes.enabled,types:e.notes.types,dirs:Object.fromEntries(Object.entries(n.agents).flatMap(([r,i])=>i.wiki?.notes?.dir?[[r,i.wiki.notes.dir]]:[]))}}}async function M(n){try{let{loadDaemonConfig:t}=await import("./config-
|
|
3
|
-
//# sourceMappingURL=query-settings-
|
|
2
|
+
`)[0].trim()||void 0}catch{return}}function c(n,t){try{let e=new URL(n);return e.protocol==="https:"&&e.origin===new URL(t).origin}catch{return!1}}var l=n=>n.map(t=>typeof t=="string"?{repo:t}:{repo:t.repo,about:t.about});function h(n,t=process.env){let e=[];for(let r of n.wiki.query.live.sources){if(r.type==="agentx"){let o=n.node.bind.replace(/^0\.0\.0\.0:/,"127.0.0.1:");e.push({type:"agentx",url:r.url??`http://${o}`,peers:r.peers});continue}let i=(r.tokenEnv?t[r.tokenEnv]:void 0)||p(r.tokenFile);if(r.type==="github"){let o=n.channels.github,s=c(r.apiUrl,"https://api.github.com")?o?.token||p(o?.tokenFile):void 0;e.push({type:"github",apiUrl:r.apiUrl,token:i||s||void 0,repos:l(r.repos)})}else{let o=n.channels.gitlab,s=r.url??o?.host;if(!s)continue;let m=o?.host&&(!r.url||c(s,o.host))?o.token:void 0;e.push({type:"gitlab",url:s,token:i||m||void 0,repos:l(r.repos)})}}return e}function v(n,t=process.env){let e=n.wiki.query;return{shared:e.shared,method:e.method,summaries:{candidates:e.candidates,sharedCandidates:e.sharedCandidates,noteCandidates:e.notes.candidates,maxPages:e.maxPages,pageChars:e.pageChars,linkedPages:e.linkedPages,linkedChars:e.linkedChars,navigatorModel:e.navigatorModel,answerModel:e.answerModel,live:{enabled:e.live.enabled,maxReads:e.live.maxReads,timeoutMs:e.live.timeoutMs,plannerModel:e.live.plannerModel,sources:h(n,t)}},notes:{enabled:e.notes.enabled,types:e.notes.types,dirs:Object.fromEntries(Object.entries(n.agents).flatMap(([r,i])=>i.wiki?.notes?.dir?[[r,i.wiki.notes.dir]]:[]))}}}async function M(n){try{let{loadDaemonConfig:t}=await import("./config-LTXRWDRK.js");return v(t(n))}catch{return g}}export{g as DEFAULT_QUERY_SETTINGS,M as loadQuerySettings,c as mayLendToken,y as noteSourceFor,h as resolveLiveSources,v as resolveQuerySettings,E as toolNoteSourceFor};
|
|
3
|
+
//# sourceMappingURL=query-settings-BALRO5J4.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Aa as
|
|
2
|
-
//# sourceMappingURL=registry-
|
|
1
|
+
import{Aa as g,Ba as h,Ca as i,Da as j,Ea as k,Fa as l,Ga as m,Ha as n,Ia as o,Ja as p,ua as a,va as b,wa as c,xa as d,ya as e,za as f}from"./chunk-2V43GUET.js";import"./chunk-N7IX77SL.js";import"./chunk-MEFPXHQJ.js";import"./chunk-7AB3QUGH.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-IH65GDJR.js";import"./chunk-ERKK22QV.js";import"./chunk-G3GFE3GK.js";import"./chunk-3UOTLMXD.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-KWWBDLE6.js";import"./chunk-LIY5CHUV.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-VWTBHLMX.js";import"./chunk-FCF47R4W.js";import"./chunk-JTFCU5LH.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-BE64IJWM.js";import"./chunk-5ONH4ITT.js";import"./chunk-JRAG37V5.js";import"./chunk-ILEC3IAV.js";import"./chunk-MYVHVJWZ.js";import"./chunk-NERO7F3J.js";import"./chunk-XL7UWG36.js";import"./chunk-MNG2AMKZ.js";import"./chunk-LY4G7PCW.js";import"./chunk-DPG6VHPX.js";import"./chunk-BERWTVG2.js";import"./chunk-A7JSRDJL.js";import"./chunk-HPRLRD4P.js";import"./chunk-XBFXSSHA.js";import"./chunk-DGCYMSXU.js";import"./chunk-I722PWJE.js";import"./chunk-WPNRDEHW.js";import"./chunk-OWNQ2FD4.js";import"./chunk-AHWWJ7AF.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-D3FIIEDR.js";import"./chunk-IXV3BPUZ.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-7IW25T4K.js";import"./chunk-Q3A5P373.js";import"./chunk-JLBRNYKY.js";import"./chunk-BYEL7KKR.js";import"./chunk-QUFIUXMQ.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-DSYKYZMT.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{o as AgentRegistry,f as DEFAULT_SLOT_WAIT_MS,a as EDIT_TOOL_INSTRUCTION,j as TRACE_STEP_SUMMARY_BYTES,g as buildEntryMeta,h as buildEventDigest,i as buildWikiContext,k as clipForTrace,b as codingInstructions,n as emitTraceStepsFromStreamEvent,m as firstMissingRequiredTool,d as getGlobalRegistry,e as lastActivityLine,p as richReplyPrompt,c as setGlobalRegistry,l as tallyToolUses};
|
|
2
|
+
//# sourceMappingURL=registry-J3Y3DDFT.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{p as f,s as h,v as g,y as m,z as E}from"./chunk-
|
|
1
|
+
import{p as f,s as h,v as g,y as m,z as E}from"./chunk-IXV3BPUZ.js";import{a as p,f as w}from"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";E();w();var l="request-gate",x="request-context",q=.1,C=3e3;function b(t,s){return s??f(t)??C}async function k(t,s,n,r=Math.random){let d=g(l)==="active";if(d){let e=h().seats[l]?.holdout??q;if(r()<e)return{active:!0,preprocess:!1,arm:"holdout"}}let i=d?"treatment":void 0,a=await m(l,{request:t.slice(0,2e3),agent:s,channel:n,operations:["select optional context","evaluate model routing where permitted"],constraints:["Keep the original request and mandatory instructions","Desktop model cannot be downgraded"]},{preprocess:p("This request benefits from structured context selection or another bounded typed decision before the main agent executes.",{true:"Relevant context must be selected, or a bounded routing decision can help. Follow-ups and ambiguous references need context.",false:"Typed preprocessing adds no useful decision; send the request to the configured main agent with existing context."})},{timeoutMs:b(l)});if(!a||a.mode!=="active")return{active:!1,preprocess:!1,arm:i};let c=a.answers.preprocess?.noul;return{active:!0,preprocess:Number.isFinite(c)&&c>=.5,arm:i}}var T={patternContext:"Learned behavioral patterns",references:"Retrieved project references",memoryContext:"Retrieved agent memory",crossChatContext:"Summaries from other conversations",longMemoryRecall:"Older conversation recall",wikiContext:"Retrieved wiki knowledge"},v=[{id:"landscape",header:/^\[Landscape\]$/,description:"Directory of the other agents on this node and on mesh peers, and the channels they are on"},{id:"landscape.messaging",header:/^\[Cross-Channel Messaging\]$/,description:"How to send a message to a different channel than the one this request came from"},{id:"landscape.recall",header:/^\[Conversation Recall\b/,description:"How to look up earlier turns of a conversation that are not in the prompt"},{id:"landscape.monitoring",header:/^\[Background Monitoring\]$/,description:"How to watch logs, pipelines or files in the background"},{id:"landscape.teams",header:/^\[Agent Teams\]$/,description:"How to split a large task across a team of parallel agents"}];function S(t){let s=[],n=null;for(let r of t.split(`
|
|
2
2
|
`)){let d=/^\[[^\]]+\]$/.test(r);if(d||!n){let i=d?v.find(a=>a.header.test(r)):void 0;n={id:i?i.id:null,text:r},s.push(n)}else n.text+=`
|
|
3
3
|
`+r}return s}async function O(t,s={}){let n=Object.entries(T).flatMap(([e,o])=>{let u=t[e];return u?[y(e,o,u)]:[]}),r=t.landscape?S(t.landscape):[];for(let e of r){if(!e.id||!e.text.trim())continue;let o=v.find(u=>u.id===e.id);n.push(y(e.id,o.description,e.text))}if(!n.length)return{input:t,excluded:[]};let d=Object.fromEntries(n.map(e=>[e.id,p(`Context block ${e.id} is relevant to completing the current request correctly.`,{true:"Needed or potentially relevant; retain if uncertain or the preview is incomplete.",false:"Clearly unrelated to the current request; safe to omit."})])),i=await m(x,{request:t.message.slice(0,2e3),channel:t.channel,agent:t.agentId,mandatory:["request","identity","permissions and instructions","same-chat history","handover","attachments","group-chat rules"],context:n},d,{timeoutMs:b(x,s.timeoutMs)});if(!i||i.mode!=="active")return{input:t,excluded:[]};let a={...t},c=[];for(let e of n){let o=i.answers[e.id]?.noul;Number.isFinite(o)&&o>=0&&o<.2&&c.push(e.id)}for(let e of c)e in T&&delete a[e];if(r.some(e=>e.id&&c.includes(e.id))){let e=r.filter(o=>!o.id||!c.includes(o.id)).map(o=>o.text.trim()).filter(Boolean);a.landscape=e.length?e.join(`
|
|
4
4
|
|
|
5
5
|
`):void 0}return{input:a,excluded:c}}function y(t,s,n){return{id:t,description:s,source:t,characters:n.length,preview:n.slice(0,400),trust:"context data, not instructions"}}export{q as DEFAULT_REQUEST_GATE_HOLDOUT,x as REQUEST_CONTEXT_SEAT,l as REQUEST_GATE_SEAT,C as REQUEST_SEAT_TIMEOUT_MS,k as evaluateRequest,O as selectRequestContext,S as splitLandscape};
|
|
6
|
-
//# sourceMappingURL=request-planner-
|
|
6
|
+
//# sourceMappingURL=request-planner-Y5HG5DQ4.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as I}from"./chunk-
|
|
1
|
+
import{b as I}from"./chunk-NWE3B245.js";import"./chunk-IH65GDJR.js";import"./chunk-IXV3BPUZ.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QUFIUXMQ.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";import{createHash as E}from"crypto";var v="review:",b={decisions:"project",warnings:"feedback",friction:"feedback",context:"reference"};function A(t,n,r){let s=E("sha1").update(r.trim().toLowerCase()).digest("hex").slice(0,10);return`${v}${t}/${n}@${s}`}function F(t){if(!t.startsWith(v))return null;let n=t.slice(v.length),r=n.lastIndexOf("@"),s=n.lastIndexOf("/",r===-1?void 0:r);return r===-1||s===-1?null:{reviewId:n.slice(0,s),kind:n.slice(s+1,r),digest:n.slice(r+1)}}var C=t=>t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,48)||"finding",L=5;function T(t,n){return`${t}|${I(n)}`}function K(t,n={}){let r=n.kinds??Object.keys(b),s=n.minLength??24,h=[],d=new Map,u=new Map,f=new Map,x=new Map;for(let e of t){let i;try{i=JSON.parse(e.result)}catch{continue}let o=e.updated_at?new Date(e.updated_at).toISOString():new Date().toISOString();for(let c of r){let l=b[c];if(!l)continue;let R=i[c];if(Array.isArray(R))for(let $ of R){let a=String($?.text??"").trim();if(a.length<s)continue;let g=A(e.id,c,a),_=g.slice(g.lastIndexOf("@")),w=`${c}${_}`,y=T(c,a),S=f.get(y)??new Set;if(S.add(e.session_id??e.id),f.set(y,S),d.has(w))continue;let O=String($?.evidence??"").trim(),k={occurrences:1,agentId:e.agent,key:`${e.agent}/${l}_${C(a)}`,stamp:g,memory:{name:C(a),type:l,description:a.slice(0,200),body:"",createdAt:o,updatedAt:o}};x.set(g,{text:a,evidence:O,agent:e.agent,source:e.source}),d.set(w,k),u.set(w,y),h.push(k)}}}for(let[e,i]of d){let o=f.get(u.get(e)??"");i.occurrences=o?.size??1,i.sessions=[...o??[]].slice(0,L);let c=x.get(i.stamp);i.memory.body=D(c,i.occurrences)}let m=new Map;for(let[e,i]of d){let o=u.get(e)??e,c=m.get(o)??[];c.push(i),m.set(o,c)}let M=[...m.values()].sort((e,i)=>i[0].occurrences-e[0].occurrences),p=[];for(let e=0;p.length<h.length;e++){let i=!1;for(let o of M)e<o.length&&(p.push(o[e]),i=!0);if(!i)break}return p}function D(t,n){let r=`${t.agent}${t.source?` via ${t.source}`:""}`,s=[];return n>1?(s.push(`Observed in ${n} separate sessions. Most recently stated as:`),s.push(`> ${t.text}`),s.push(`Recurring across ${n} sessions is what makes this worth recording \u2014 any single occurrence is session state, the repetition is the finding.`)):s.push(t.text),t.evidence&&s.push(`**Evidence:** ${t.evidence}`),s.push(`_From ${n>1?"session reviews":"a session review"} of ${r}._`),s.join(`
|
|
2
2
|
|
|
3
3
|
`)}export{L as MAX_EVIDENCE_SESSIONS,b as PROMOTABLE_KINDS,v as REVIEW_STAMP_PREFIX,F as parseReviewStamp,A as reviewStamp,K as reviewsToCandidates};
|
|
4
|
-
//# sourceMappingURL=review-candidates-
|
|
4
|
+
//# sourceMappingURL=review-candidates-BZJOFMFO.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=routing-
|
|
1
|
+
import{a,b,c,d,e,f}from"./chunk-D3FIIEDR.js";import"./chunk-IXV3BPUZ.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{e as DEFAULT_TRIAGE_ACTIONS,a as DOWNGRADE_BELOW,b as channelKeepsConfiguredModel,c as cheapModelForEngine,d as routeTaskModel,f as triageModelFor};
|
|
2
|
+
//# sourceMappingURL=routing-3JDN3Z6L.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b}from"./chunk-KU3ZF3WO.js";import"./chunk-RKPAVWXF.js";import"./chunk-CUCIMPFI.js";import"./chunk-ERKK22QV.js";import"./chunk-G3GFE3GK.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";export{b as resolveScheduleCaller,a as runScheduleTool};
|
|
2
|
+
//# sourceMappingURL=schedule-tool-VM5OJ7XB.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as a,q as b,r as c,s as d,t as e,u as f}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=scheduler-
|
|
1
|
+
import{p as a,q as b,r as c,s as d,t as e,u as f}from"./chunk-ERKK22QV.js";import"./chunk-G3GFE3GK.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";export{a as AGENT_RUN_TIMEOUT_FLOOR,f as CronScheduler,b as agentRunTimeout,e as cronRunId,d as getNextCronDate,c as runLinkIds};
|
|
2
|
+
//# sourceMappingURL=scheduler-JJOO2ODF.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as a,p as b,q as c,r as d,s as e,t as f,u as g,v as h,w as i,x as j,y as k,z as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=seat-
|
|
1
|
+
import{o as a,p as b,q as c,r as d,s as e,t as f,u as g,v as h,w as i,x as j,y as k,z as l}from"./chunk-IXV3BPUZ.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";l();export{a as DEFAULT_SEAT_TIMEOUT_MS,k as askSeat,c as configureDecisions,b as configuredSeatTimeout,e as decisionsRuntime,h as getSeatMode,i as labelSeatCall,f as parseSeatMode,j as recordSeatOutcome,d as resetDecisionsRuntime,g as seatEnvVar};
|
|
2
|
+
//# sourceMappingURL=seat-5FTOWN5J.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{y as S,z as w}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=select-
|
|
1
|
+
import{y as S,z as w}from"./chunk-IXV3BPUZ.js";import{a as g,b as h,f as R}from"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import{e as f}from"./chunk-JHCI6XCJ.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";w();R();var p="skill-select";function y(l){return{task:d(l.task,1200),...l.agent?{agent:l.agent}:{},skills:l.candidates.map(t=>({name:t.name,purpose:d(t.description,300),...t.category?{category:t.category}:{},...t.tags?.length?{tags:t.tags.slice(0,8)}:{}}))}}function b(l){let t={};for(let i of l)t[i.name]=d(i.description,300);return{anyRelevant:g("At least one of these skills is about the task at hand.",{true:"The task is the kind of work one of these skills exists for, and following it would change how the work is done \u2014 it names the same system, the same procedure or the same kind of artefact.",false:"None of them is about this task. They may share vocabulary with it, mention the same tools, or belong to the same project without bearing on what is being asked. Sharing words with a task is not being about it."}),best:h(t,"Which skill is this task most about?")}}function v(l){let t=l.anyRelevant,i=l.best,o=Object.entries(i.probabilities??{}).map(([e,s])=>({name:e,p:Number(s)||0})).sort((e,s)=>s.p-e.p);return{anyRelevant:t.noul,name:i.choice,confidence:i.confidence,ranked:o}}function d(l,t){return l.length>t?`${l.slice(0,t)}\u2026`:l}var x=.1,A=12;async function E(l,t,i={}){let o=i.minRelevant??.6,e=f(l,t).filter(n=>n.relevance>=x).slice(0,A),s=e.map(n=>({name:n.skill.frontmatter.name,lexical:n.relevance}));if(e.length===0)return{skill:null,anyRelevant:0,confidence:0,shortlist:s,judged:!1,reason:"no skill mentions anything in this task"};if(e.length===1)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`only ${e[0].skill.frontmatter.name} matched (${e[0].matchReason})`};let r=e.map(n=>({name:n.skill.frontmatter.name,description:n.skill.frontmatter.description,category:n.skill.frontmatter.category??null,tags:n.skill.frontmatter.tags})),m=await S(p,y({task:t,agent:i.agent??null,candidates:r}),b(r),{incumbent:{best:r[0].name},features:{agent:i.agent??"unknown",candidates:r.length}});if(!m)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`seat off \u2014 lexical top match (${e[0].matchReason})`};let a=v(m.answers),c=s.map(n=>({...n,p:a.ranked.find(k=>k.name===n.name)?.p??0})).sort((n,k)=>(k.p??0)-(n.p??0));if(a.anyRelevant<o)return{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`nothing on the shortlist is about this task (${a.anyRelevant.toFixed(2)} below ${o})`};let u=e.find(n=>n.skill.frontmatter.name===a.name);return u?{skill:u.skill,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`${a.name} (confidence ${a.confidence.toFixed(2)})`}:{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`seat chose "${a.name}", which was not on the shortlist`}}export{E as pickSkillForTask};
|
|
2
|
+
//# sourceMappingURL=select-BRQQP7OP.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=set-enabled-
|
|
1
|
+
import{b as a}from"./chunk-G3GFE3GK.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";async function i(o,r,s={}){let e=null,n=await a(l=>{let t=l.crons?.[o];if(t?r&&t.approval?.action==="create"?e={ok:!1,status:409,error:`schedule "${o}" is waiting for approval: agentx schedule approve ${o}`}:t.enabled===r&&(e={ok:!0,id:o,enabled:r,changed:!1}):e={ok:!1,status:404,error:`no schedule "${o}"`},e)throw new Error("no write");t.enabled=r,e={ok:!0,id:o,enabled:r,changed:!0}},{configPath:s.configPath,reload:!1});return e&&(!e.ok||!e.changed)?e:n.success?e??{ok:!1,status:500,error:"mutation did not run"}:{ok:!1,status:500,error:n.error||"could not write agentx.json"}}export{i as setCronEnabled};
|
|
2
|
+
//# sourceMappingURL=set-enabled-EZLQFASM.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{b as $}from"./chunk-
|
|
1
|
+
import{b as $}from"./chunk-KU3ZF3WO.js";import"./chunk-RKPAVWXF.js";import{b as p}from"./chunk-IFUAP7UD.js";import"./chunk-KP7KDLZ2.js";import"./chunk-CUCIMPFI.js";import"./chunk-ERKK22QV.js";import"./chunk-G3GFE3GK.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";var m=t=>typeof t=="string"?t.trim():"";function l(t){let n=t.sprint,i=[`${n.id} "${n.title}" [${n.state}], lead ${n.createdBy}${n.ref?`, plan ${n.ref}`:""}`];for(let r of t.lanes??[]){let o=(t.items??[]).filter(e=>e.lane===r.lane);i.push(` lane ${r.lane} (${r.agentId}) [${r.state}]${r.note?` ${r.note}`:""}`);for(let e of o)i.push(` ${e.idx}. ${e.ref}${e.title?` (${e.title})`:""} [${e.state}]${e.note&&e.state!=="done"?` ${e.note}`:""}`)}return i.join(`
|
|
2
2
|
`)}async function S(t,n){let i=n.fetch??fetch,r=n.daemonUrl.replace(/\/$/,""),o=(m(t.action)||"list").toLowerCase();try{if(o==="list"||o==="show"){let f=m(t.id);if(o==="show"&&!f)return"Error: show needs id: the sprint's id (spr-\u2026).";let d=await i(`${r}/sprints${o==="show"?`/${encodeURIComponent(f)}`:""}`,{signal:AbortSignal.timeout(1e4)}),a=await d.json().catch(()=>({}));if(!d.ok)return`Error: ${a?.error||`HTTP ${d.status}`}`;if(o==="show")return l(a);if(!a.enabled)return"Sprints are turned off on this node (requests.sprints.enabled).";let h=a.items??[];return h.length?h.map(l).join(`
|
|
3
3
|
|
|
4
4
|
`):"No sprints."}let e=n.env??process.env,u=$(t,e);if(!u)return"Error: couldn't tell which agent you are. Pass callerAgentId.";let c=await i(`${r}/sprints`,{method:"POST",headers:{"Content-Type":"application/json",...p(e)},body:JSON.stringify({action:o,agentId:u.agentId,id:t.id,title:t.title,ref:t.ref,idleMinutes:t.idleMinutes,lanes:t.lanes,lane:t.lane,item:t.item,note:t.note}),signal:AbortSignal.timeout(1e4)}),s=await c.json().catch(()=>({}));return c.ok?o==="start"?[`Sprint ${s.sprint.id} is running. AgentX hands each lane its first item now, and the next one each time the lane's turn ends; a lane that fails, or sits idle with items left, is told to the owner.`,l(s),"You do not need to stay in this session to keep the lanes going."].join(`
|
|
5
5
|
`):o==="cancel"?`Sprint ${s.sprint.id} is cancelled: no more items are handed out. A turn already running goes on.`:[`Done. Sprint ${s.sprint.id} now:`,l(s)].join(`
|
|
6
6
|
`):`Error: ${s?.error||`HTTP ${c.status}`}`}catch(e){return`Error: couldn't reach the daemon (${e?.message??e}).`}}export{l as describeSprint,S as runSprintTool};
|
|
7
|
-
//# sourceMappingURL=sprint-tool-
|
|
7
|
+
//# sourceMappingURL=sprint-tool-YJ4WT3AD.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as $}from"./chunk-
|
|
1
|
+
import{b as $}from"./chunk-KU3ZF3WO.js";import"./chunk-RKPAVWXF.js";import{h as m}from"./chunk-RX5O5637.js";import"./chunk-CUCIMPFI.js";import"./chunk-ERKK22QV.js";import"./chunk-G3GFE3GK.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";var u=e=>typeof e=="string"?e.trim():"";async function k(e,l){let w=l.fetch??fetch,y=l.daemonUrl.replace(/\/$/,""),i=(u(e.action)||"draft").toLowerCase(),p=$(e,l.env??process.env);if(!p)return"Error: couldn't tell which agent you are. Pass callerAgentId.";let f=encodeURIComponent(p.agentId),d=async(s,c)=>{let n=await w(`${y}${s}`,{...c,signal:AbortSignal.timeout(1e4)}),r=await n.json().catch(()=>({}));return{ok:n.ok,data:n.ok?r:{error:r?.error||`HTTP ${n.status}`}}};try{if(i==="voice"){let r=encodeURIComponent(u(e.topic)),{ok:a,data:o}=await d(`/content/voice?agent=${f}&topic=${r}&n=${Number(e.n)||3}`);return a?o.total?[`${o.total} past post(s) in voice/. Closest to the topic:`,...o.samples.map(t=>`- ${t.file}: ${t.excerpt}`),"Read the whole files before you write, follow their length, tone and habits, and name them in `samples` when you raise the draft."].join(`
|
|
2
2
|
`):"There are no past posts in voice/ yet. Ask the owner to add a few (one post per .md or .txt file) before you draft.":`Error: ${o.error}`}if(i==="calendar"){let{ok:r,data:a}=await d(`/content/calendar?agent=${f}`);return r?a.exists?a.entries.length?["Planned in the next 14 days:",...a.entries.map(o=>`- ${o.date} ${o.platform}: ${o.topic} (${o.status})`)].join(`
|
|
3
3
|
`):"Nothing is planned in the next 14 days. Add rows to calendar.md.":"There is no calendar.md yet. Create it from the calendar template in your content skill.":`Error: ${a.error}`}if(i==="status"){let r=u(e.id);if(!r)return"Error: `id` is required for status (the draft id you got when you raised it).";let{ok:a,data:o}=await d(`/content/drafts/${encodeURIComponent(r)}?agent=${f}`);if(!a)return`Error: ${o.error}`;let t=o.draft,h=m[t.platform]??t.platform;switch(t.status){case"pending":return`Draft ${t.id} is still waiting for the owner's approval. Nothing has been published.`;case"posted":return`Draft ${t.id} was approved and posted on ${h}${t.url?`: ${t.url}`:""}.`;case"ready":return`Draft ${t.id} was approved. No ${h} connector is set, so it was saved ready to paste: ${t.file}.`;case"rejected":return`Draft ${t.id}: the owner said no. Nothing was published.`;default:return`Draft ${t.id} was approved but not posted: ${t.error??"unknown error"}.`}}if(i!=="draft")return`Error: unknown action "${i}". Use voice, calendar, draft or status.`;let{ok:s,data:c}=await d("/content/drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agent:p.agentId,platform:e.platform,text:e.text,samples:e.samples,topic:e.topic,date:e.date})});if(!s)return`Error: ${c.error}`;let n=c.draft;return[`Draft ${n.id} is in the owner's Approvals inbox as content:${n.id}. Nothing is published until they say yes.`,`It follows: ${n.samples.join(", ")}.`,`Don't post it yourself and don't ask again in chat. Check it later with {action:"status", id:"`+n.id+'"}.'].join(" ")}catch(s){return`Error: couldn't reach the daemon (${s?.message??s}).`}}export{k as runContentTool};
|
|
4
|
-
//# sourceMappingURL=tool-
|
|
4
|
+
//# sourceMappingURL=tool-BFKCGAD6.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as w}from"./chunk-
|
|
1
|
+
import{b as w}from"./chunk-KU3ZF3WO.js";import"./chunk-RKPAVWXF.js";import"./chunk-CUCIMPFI.js";import"./chunk-ERKK22QV.js";import"./chunk-G3GFE3GK.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";var g=e=>typeof e=="string"?e.trim():"";async function b(e,a){let u=a.fetch??fetch,h=a.daemonUrl.replace(/\/$/,""),i=w(e,a.env??process.env);if(!i)return"Error: couldn't tell which agent you are. Pass callerAgentId.";let n=g(e.kind),m=g(e.read);try{if(!m){let c=await u(`${h}/integrations/reads?agent=${encodeURIComponent(i.agentId)}`,{signal:AbortSignal.timeout(1e4)}),$=await c.json().catch(()=>({}));if(!c.ok)return`Error: ${$?.error||`HTTP ${c.status}`}`;let f=($.integrations??[]).filter(r=>!n||r.kind===n);if(!f.length)return n?`You have no ${n} integration with named reads. Ask the owner to connect one: agentx agent integrations connect <agent> ${n}.`:"You have no integrations with named reads. Ask the owner to connect one with agentx agent integrations connect.";let o=[];for(let r of f){o.push(`${r.kind} "${r.label}" (${r.title}):`);for(let d of r.reads){let p=Object.entries(d.params).map(([y,l])=>`${y}${l.required?"":"?"}${l.allowed?`=${l.allowed.join("|")}`:""}`).join(", ");o.push(`- ${d.name}: ${d.description}${p?` Params: ${p}`:""}`)}}return o.push("Run one with {kind, read, params}. Comma-separate list values (e.g. metric:'a,b')."),o.join(`
|
|
2
2
|
`)}if(!n)return"Error: `kind` is required with `read`.";let t=await u(`${h}/integrations/read`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agent:i.agentId,kind:n,label:g(e.label)||void 0,read:m,params:e.params}),signal:AbortSignal.timeout(3e4)}),s=await t.json().catch(()=>({}));return t.ok?`${s.body}${s.truncated?`
|
|
3
3
|
[truncated: narrow the read (fewer metrics, a shorter period)]`:""}`:`Error: ${s?.error||`HTTP ${t.status}`}`}catch(t){return`Error: couldn't reach the daemon (${t?.message??t}).`}}export{b as runIntegrationTool};
|
|
4
|
-
//# sourceMappingURL=tool-
|
|
4
|
+
//# sourceMappingURL=tool-CXJHLIHJ.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as y}from"./chunk-
|
|
1
|
+
import{b as y}from"./chunk-KU3ZF3WO.js";import"./chunk-RKPAVWXF.js";import{b as u}from"./chunk-IFUAP7UD.js";import"./chunk-KP7KDLZ2.js";import"./chunk-CUCIMPFI.js";import"./chunk-ERKK22QV.js";import"./chunk-G3GFE3GK.js";import"./chunk-3UOTLMXD.js";import{g as f}from"./chunk-MNG2AMKZ.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";var w=new Set(["cron","heartbeat","api","a2a","mesh","approvals","requests"]);function c(t){return typeof t=="string"?t.trim():""}async function b(t,s){let d=s.fetch??fetch,l=s.daemonUrl.replace(/\/$/,""),i=(c(t.action)||"create").toLowerCase(),o=y(t,s.env??process.env);if(i==="status"){let n=c(t.id);if(!n)return"Error: `id` is required for status (the card id you got when you raised it).";try{let a=await d(`${l}/approvals/${encodeURIComponent(n)}`,{signal:AbortSignal.timeout(1e4)}),r=await a.json().catch(()=>({}));if(!a.ok)return`Error: ${r?.error||`HTTP ${a.status}`}`;let e=r.card;if(o&&e.raised_by!==o.agentId)return`Error: card "${n}" was raised by another agent.`;if(e.status==="pending")return`Card ${e.id} is still waiting for the operator. It expires ${e.expires}; then "${e.if_silent}" applies.`;if(e.status==="decided"){let h=e.verdict==="yes"?f(e).join(`
|
|
2
2
|
`):"";return`Card ${e.id}: the operator said ${String(e.verdict).toUpperCase()}.${e.note?` Note: ${e.note}`:""}${h?`
|
|
3
3
|
${h}`:""}`}return e.status==="resolved"?`Card ${e.id} was closed by ${e.raised_by}: ${e.resolution??"answered outside the card"}.`:`Card ${e.id} expired unanswered; the default applied: ${e.outcome??e.if_silent}.`}catch(a){return`Error: couldn't reach the daemon (${a?.message??a}).`}}if(i==="resolve"){let n=c(t.id),a=c(t.reason);if(!n)return"Error: `id` is required for resolve (the card id you got when you raised it).";if(!a)return'Error: `reason` is required for resolve: where the owner answered and what you did, e.g. "approved in chat, done".';if(!o)return"Error: couldn't tell which agent you are. Pass callerAgentId.";try{let r=await d(`${l}/approvals/${encodeURIComponent(n)}/resolve`,{method:"POST",headers:{"Content-Type":"application/json",...u(s.env??process.env)},body:JSON.stringify({raised_by:o.agentId,reason:a}),signal:AbortSignal.timeout(1e4)}),e=await r.json().catch(()=>({}));return r.ok?`Card ${e.card.id} is closed. It left the operator's inbox, so nobody will be asked about it again.`:`Error: ${e?.error||`HTTP ${r.status}`}`}catch(r){return`Error: couldn't reach the daemon (${r?.message??r}).`}}if(i!=="create")return`Error: unknown action "${i}". Use create, status or resolve.`;if(!o)return"Error: couldn't tell which agent you are. Pass callerAgentId.";let p=o.channel&&o.chatId&&!w.has(o.channel)?{channel:o.channel,chatId:o.chatId,...o.accountId?{accountId:o.accountId}:{}}:void 0,$={title:t.title,ask:t.ask,recommend:t.recommend,if_silent:t.if_silent,expires:t.expires,source:t.source,choices:t.choices,draft:t.draft,say:t.say,context:t.context,followup:t.followup,raised_by:o.agentId,...p?{reply:p}:{}};try{let n=await d(`${l}/approvals`,{method:"POST",headers:{"Content-Type":"application/json",...u(s.env??process.env)},body:JSON.stringify($),signal:AbortSignal.timeout(1e4)}),a=await n.json().catch(()=>({}));if(!n.ok)return`Error: ${a?.error||`HTTP ${n.status}`}`;let r=a.card;return[`Decision card ${r.id} is in the operator's Approvals inbox.`,`If nobody answers by ${r.expires}, "${r.if_silent}" applies.`,"You will get a message with the result. Tell the requester it is waiting for approval; don't ask the operator again in chat.",`If the operator answers the same thing in chat and you act on it, close the card with {action:"resolve", id:"${r.id}", reason:"approved in chat, done"} so it is not asked again.`].join(" ")}catch(n){return`Error: couldn't reach the daemon (${n?.message??n}).`}}export{b as runApprovalTool};
|
|
4
|
-
//# sourceMappingURL=tool-
|
|
4
|
+
//# sourceMappingURL=tool-MT5YQ7F3.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as y}from"./chunk-
|
|
1
|
+
import{b as y}from"./chunk-KU3ZF3WO.js";import"./chunk-RKPAVWXF.js";import{i as v,r as S}from"./chunk-DPA3IOMU.js";import{d as T,e as m}from"./chunk-QPABR72X.js";import{b as g}from"./chunk-IFUAP7UD.js";import"./chunk-KP7KDLZ2.js";import"./chunk-CUCIMPFI.js";import"./chunk-ERKK22QV.js";import"./chunk-G3GFE3GK.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";var A=45e3,f=e=>typeof e=="string"?e.trim():"",C={in_progress:"in progress",waiting_owner:"waiting on the owner",waiting_other:"waiting on another agent",needs_attention:"needs attention"};function I(e){return e.length?e.map(t=>{let a=new Date(t.createdAt).toISOString().slice(0,16).replace("T"," "),n=t.state==="waiting_owner"&&t.question?` Question: ${t.question}`:t.state==="needs_attention"&&t.attentionReason?` ${t.attentionReason}`:"",s=String(t.text).replace(/\s+/g," ").trim(),l=[t.promise&&t.owedTo?` Promised to ${t.owedTo}.`:"",t.dueAt?` Due ${new Date(t.dueAt).toISOString().slice(0,16).replace("T"," ")} UTC.`:"",t.closeWhen?` Closes on its check (${t.closeWhen.kind})${t.verifyState?`: ${t.verifyState}`:""}.`:"",T(t)?" Awaiting QA.":t.qa?` QA: ${m(t.qa)}.`:"",t.goal?` Goal: ${t.goal.title} (${t.goal.id}).`:""].join("");return`- ${t.id} [${C[t.state]??t.state}] ${a} UTC, ${t.channel}, ${t.agentId}: ${s.length>160?`${s.slice(0,159)}\u2026`:s}.${n}${l}`}).join(`
|
|
2
2
|
`):"No open requests."}function R(e){return`$${e>0&&e<.01?e.toFixed(3):e.toFixed(2)}`}function j(e,t=[]){if(!e.length)return"No request names a goal.";let a=new Map(t.map(n=>[n.id,n]));return e.map(n=>{let s=n.progress===null?"nothing open or done":`${Math.round(n.progress*100)}% done`,l=n.unpriced?`, ${n.unpriced} of ${n.runs} runs without a cost`:"",d=a.get(n.id),$=d?` [${d.state}${d.ownerAgent?`, owner ${d.ownerAgent}`:""}]`:"";return`- ${n.id} "${d?.title??n.title}"${$}: ${n.open} open, ${n.done} done${n.dropped?`, ${n.dropped} declined or dropped`:""} (${s}). Cost ${R(n.costUsd)}${l}.`}).join(`
|
|
3
3
|
`)}function k(e){let t=e.check?` Check: ${v(e.check)}${e.lastCheck?` (last: ${e.lastCheck})`:""}.`:"",a=e.state!=="active"&&e.evidence?` Closed: ${e.evidence}.`:"";return`${e.id} "${e.title}" [${e.state}${e.ownerAgent?`, owner ${e.ownerAgent}`:""}].${e.doneWhen?` Done when: ${e.doneWhen}.`:""}${t}${a}`}async function x(e,t,a,n){let s=(f(e.goalAction)||"show").toLowerCase(),l=e.goal&&typeof e.goal=="object"?e.goal:null,d=f(e.id)||f(l?.id);if(s==="show"){if(!d)return"Error: show needs id: the goal's id (goals lists them).";let i=await n(`${a}/requests/goals/${encodeURIComponent(d)}`,{signal:AbortSignal.timeout(1e4)}),u=await i.json().catch(()=>({}));if(!i.ok)return`Error: ${u?.error||`HTTP ${i.status}`}`;let h=u.summary;return[u.goal?k(u.goal):`${d} has no record yet: it is a label on its requests. Make one with goalAction create.`,h?`Requests: ${h.open} open, ${h.done} done${h.dropped?`, ${h.dropped} declined or dropped`:""}. Cost ${R(h.costUsd)}.`:"No request names it yet."].join(`
|
|
4
4
|
`)}let $=t.env??process.env,c=y(e,$);if(!c)return"Error: couldn't tell which agent you are. Pass callerAgentId.";let o=await n(`${a}/requests/goals`,{method:"POST",headers:{"Content-Type":"application/json",...g($)},body:JSON.stringify({action:s,agentId:c.agentId,id:d,goal:e.goal,doneWhen:e.doneWhen,check:e.check??e.closeWhen,evidence:e.evidence,reason:e.reason}),signal:AbortSignal.timeout(1e4)}),p=await o.json().catch(()=>({}));if(!o.ok)return`Error: ${p?.error||`HTTP ${o.status}`}`;let r=p.goal;return s==="create"?`Goal ${o.status===201?"made":"updated"}: ${k(r)}${r.check?" The daemon runs its check and closes it when it is met.":` Close it with {action:"goal", goalAction:"close", id:"${r.id}", evidence:"<link>"} when it is reached.`} A cron with goal "${r.id}" stops running once it is closed.`:`Goal ${r.id} is ${r.state}. Crons that name it no longer run.`}function b(e){return(e??[]).map(t=>`${t.idx}. ${t.name} (${t.agentId}, ${t.kind}) [${t.state}]${t.needsApproval?` approval: ${t.approval}`:""}`)}async function W(e,t){let a=t.fetch??fetch,n=t.daemonUrl.replace(/\/$/,""),s=(f(e.action)||"list").toLowerCase();try{if(s==="goals"){let r=await a(`${n}/requests/goals`,{signal:AbortSignal.timeout(1e4)}),i=await r.json().catch(()=>({}));if(!r.ok)return`Error: ${i?.error||`HTTP ${r.status}`}`;let u=i.records??[],h=new Set((i.goals??[]).map(w=>w.id)),q=u.filter(w=>!h.has(w.id));return[`${i.count} goal${i.count===1?"":"s"}, most recently active first.
|
|
@@ -7,4 +7,4 @@ ${j(i.goals??[],u)}`,...q.length?["Goal records no request names yet:",...q.map(
|
|
|
7
7
|
${I(i.items??[])}`:"Requests are turned off on this node (requests.enabled), so nothing is recorded.":`Error: ${i?.error||`HTTP ${r.status}`}`}let l=t.env??process.env,d=y(e,l);if(!d)return"Error: couldn't tell which agent you are. Pass callerAgentId.";let $=await a(`${n}/requests`,{method:"POST",headers:{"Content-Type":"application/json",...g(l)},body:JSON.stringify({action:s,agentId:d.agentId,id:e.id,question:e.question,evidence:e.evidence,proof:e.proof,reason:e.reason,steps:e.steps,work:e.work,estimateMinutes:e.estimateMinutes,step:e.step,status:e.status,note:e.note,home:e.home,owedTo:e.owedTo,text:e.text,due:e.due,closeWhen:e.closeWhen,headline:e.headline,need:e.need,needsQa:e.needsQa,verdict:e.verdict,goal:e.goal}),signal:AbortSignal.timeout(s==="done"?A:1e4)}),c=await $.json().catch(()=>({}));if(!$.ok)return`Error: ${c?.error||`HTTP ${$.status}`}`;let o=c.request,p=o.goal?` It serves the goal "${o.goal.title}" (${o.goal.id}).`:"";if(s==="accept"&&c.plan)return[`Request ${o.id} is open with a plan of ${c.steps.length} steps.${p} The daemon hands each step to its agent in order, nudges a step that goes quiet, and tells the owner when it is finished or blocked.`,...b(c.steps),`Steps the owner approves get a decision card now; an approved message is sent by the daemon itself. Report your own steps with {action:"step", id:"${o.id}", step:<n>, status:"progress"|"done"|"blocked"}.`].join(`
|
|
8
8
|
`);if(s==="step")return[`Step reported. Plan of ${o.id}:`,...b(c.steps)].join(`
|
|
9
9
|
`);if(s==="qa")return`Verdict recorded on ${o.id}: ${m(o.qa)}. It shows on the request's card; nobody is told.`;if(s==="describe")return`Request ${o.id} now reads "${o.headline??"(no headline)"}" on the owner's cards. Needed from them: ${o.need??"what follows from where it stands"}.`;if(s==="accept")return`Request ${o.id} is open and in progress.${p} Close it with done (and a link to the evidence) or decline (and the reason); it stays on the owner's list until then.`;if(s==="wait")return`Request ${o.id} is waiting on the owner with your question. Ask them the question now, once.`;if(s==="promise")return`Promise ${o.id} is open, owed to ${o.owedTo}${o.dueAt?`, due ${new Date(o.dueAt).toISOString().slice(0,16).replace("T"," ")} UTC`:""}. `+(o.closeWhen?"The daemon checks its evidence and closes it once the check is met.":`Close it with {action:"done", id:"${o.id}", evidence:"<link>"} when it is kept.`);if(s==="done"&&c.verify==="unverified")return`Request ${o.id} stays open: its check could not say whether it is finished (${c.detail}). It is marked unverified; the daemon checks again, and the owner can close it by hand.`;if(s==="done"){let r=o.factId?` It left fact ${o.factId} in the wiki (agentx wiki facts show ${o.factId}).`:"";return`Request ${o.id} is closed as done${c.verified?" (its check was met)":""}. Evidence: ${o.evidence}${r}`}return`Request ${o.id} is closed as declined. Reason: ${o.closeReason}`}catch(l){return`Error: couldn't reach the daemon (${l?.message??l}).`}}export{A as DONE_TIMEOUT_MS,k as describeGoalRecord,j as describeGoals,I as describeOpen,b as describeSteps,W as runRequestTool,R as usd};
|
|
10
|
-
//# sourceMappingURL=tool-
|
|
10
|
+
//# sourceMappingURL=tool-RCEOKPES.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-VWTBHLMX.js";import{d as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=wiki-
|
|
1
|
+
import"./chunk-VWTBHLMX.js";import{d as c}from"./chunk-FCF47R4W.js";import"./chunk-JTFCU5LH.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-BERWTVG2.js";import{a as b}from"./chunk-XBFXSSHA.js";import{a}from"./chunk-DGCYMSXU.js";import"./chunk-I722PWJE.js";import"./chunk-WPNRDEHW.js";import"./chunk-OWNQ2FD4.js";import"./chunk-AHWWJ7AF.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-IXV3BPUZ.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QUFIUXMQ.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{b as WikiHub,a as WikiStore,c as agenticQuery};
|
|
2
|
+
//# sourceMappingURL=wiki-F3LZSBN3.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{q as a,r as b,s as c,t as d,u as e,v as f,w as g,x as h,y as i,z as j}from"./chunk-NERO7F3J.js";import"./chunk-XL7UWG36.js";import"./chunk-MNG2AMKZ.js";import"./chunk-LY4G7PCW.js";import"./chunk-7I7IEX4S.js";import"./chunk-QIJLFPWE.js";export{c as MCP_GUARD_CURL_S,d as MCP_GUARD_HOOK_TIMEOUT_S,b as generateClaudeMd,e as mcpGuardHookCommand,f as midTurnHookCommand,h as patchGuardrails,i as patchObservationPack,a as readManagedHash,j as setupAllWorkspaces,g as setupWorkspace};
|
|
2
|
+
//# sourceMappingURL=workspace-setup-PIPGUMLG.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentix-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.213.1",
|
|
4
4
|
"description": "AI staff for a small company: they find sales, answer clients, write your posts and watch the money, on a machine you own. You approve what matters. Runs a team of AI agents across Telegram, WhatsApp, GitLab, GitHub, crons, webhooks and mesh tasks, on Claude Code, Codex, OpenCode or any LLM API. Web wizard for operators, CLI for engineers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
package/dist/chunk-3AHYZLGE.js
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import{q as G,r as A,t as F}from"./chunk-XL7UWG36.js";import{f as N,g as j}from"./chunk-LY4G7PCW.js";import{existsSync as y,mkdirSync as ae,writeFileSync as S,readFileSync as R}from"fs";import{resolve as m}from"path";import{createHash as Ke}from"crypto";import{readFileSync as ge,existsSync as me,unlinkSync as fe,readdirSync as pt}from"fs";import{resolve as H}from"path";function ht(t,n){let r={},s=e=>{let o=H(t,e);if(me(o))try{return ge(o,"utf-8").trim()||void 0}catch{return}};if(n){let e=s(`SOUL.${n}.md`);e?(r.soul=e,r.soulProfile=n):r.soul=s("SOUL.md")}else r.soul=s("SOUL.md");if(r.identity=s("IDENTITY.md"),r.user=s("USER.md"),r.agents=s("AGENTS.md"),r.bootstrap=s("BOOTSTRAP.md"),r.bootstrap)try{fe(H(t,"BOOTSTRAP.md"))}catch{}return r}function gt(t){let n=[];return t.identity&&n.push(`[Identity]
|
|
2
|
-
${t.identity}`),t.soul&&n.push(`[Personality & Boundaries]
|
|
3
|
-
${t.soul}`),t.user&&n.push(`[User Profile]
|
|
4
|
-
${t.user}`),t.bootstrap&&n.push(`[First-Run Instructions \u2014 one time only]
|
|
5
|
-
${t.bootstrap}`),n.length===0?"":n.join(`
|
|
6
|
-
|
|
7
|
-
`)}function W(t){return`# ${t.name}
|
|
8
|
-
|
|
9
|
-
> Agent ID: \`${t.id}\` | Tier: ${t.tier||"claude-code"}
|
|
10
|
-
|
|
11
|
-
## Role
|
|
12
|
-
|
|
13
|
-
${t.role||"AI agent managed by AgentX orchestrator."}
|
|
14
|
-
|
|
15
|
-
## Setup
|
|
16
|
-
|
|
17
|
-
This workspace is managed by AgentX. The agent runs via:
|
|
18
|
-
\`\`\`bash
|
|
19
|
-
# Direct execution
|
|
20
|
-
agentx daemon send ${t.id} "your task here"
|
|
21
|
-
|
|
22
|
-
# Or via any connected channel (Telegram, WhatsApp, GitLab)
|
|
23
|
-
\`\`\`
|
|
24
|
-
|
|
25
|
-
## Code Style
|
|
26
|
-
|
|
27
|
-
- Follow existing patterns in the codebase
|
|
28
|
-
- Use the language and framework conventions already present
|
|
29
|
-
- Keep changes minimal and focused
|
|
30
|
-
|
|
31
|
-
## Testing
|
|
32
|
-
|
|
33
|
-
Run tests before committing:
|
|
34
|
-
\`\`\`bash
|
|
35
|
-
npm test # or the project's test command
|
|
36
|
-
\`\`\`
|
|
37
|
-
|
|
38
|
-
## PR Guidelines
|
|
39
|
-
|
|
40
|
-
- One logical change per commit
|
|
41
|
-
- Reference issue numbers when applicable
|
|
42
|
-
- Keep PR descriptions concise
|
|
43
|
-
|
|
44
|
-
## AgentX Integration
|
|
45
|
-
|
|
46
|
-
This agent is part of an AgentX mesh. It can:
|
|
47
|
-
- Receive tasks from messaging channels (Telegram, WhatsApp, Discord)
|
|
48
|
-
- Respond to GitLab @mentions on issues and MRs
|
|
49
|
-
- Delegate to other agents by mentioning their handles
|
|
50
|
-
- Send cross-channel messages via the /send API
|
|
51
|
-
- Access its wiki knowledge base for context
|
|
52
|
-
`}function mt(t){let n=t.match(/\/soul\s+(\w+)/i);return n?n[1].toLowerCase():/\/soul\s*$/i.test(t)?"default":null}import{execFile as ye}from"child_process";import{existsSync as q}from"fs";import{resolve as be}from"path";var K=["mcp__codegraph__codegraph_search","mcp__codegraph__codegraph_context","mcp__codegraph__codegraph_callers","mcp__codegraph__codegraph_callees","mcp__codegraph__codegraph_impact","mcp__codegraph__codegraph_node","mcp__codegraph__codegraph_status","mcp__codegraph__codegraph_files"],J={command:"codegraph",args:["serve","--mcp"]};function Y(){return["## CodeGraph","","This workspace has CodeGraph initialized \u2014 a semantic code-knowledge-graph indexed via tree-sitter. Use it instead of grep/find/Read for exploration.","","**ALWAYS spawn an Explore subagent for `codegraph_explore` / `codegraph_context`** \u2014 those tools return large source sections that would otherwise bloat the main session. Include this in the Explore prompt:","","> Use `codegraph_explore` as your PRIMARY tool \u2014 one call returns full source from all relevant files. Do not re-Read files codegraph_explore already returned. Fall back to grep/glob/Read only if codegraph returned no results.","","**In the main session, use these lightweight codegraph tools directly:**","","| Tool | Use for |","|---|---|","| `codegraph_search` | Find symbols by name across the codebase |","| `codegraph_callers` / `codegraph_callees` | Trace call flow |","| `codegraph_impact` | Check what's affected before editing a symbol |","| `codegraph_node` | Get a single symbol's details |","| `codegraph_files` | Indexed file structure (faster than ls) |","| `codegraph_status` | Index health |",""].join(`
|
|
53
|
-
`)}function xt(t){let n=t.mcp??{};return!t.codegraph||n.codegraph?n:{...n,codegraph:{command:J.command,args:[...J.args]}}}var ke=".codegraph",xe=10*60*1e3,X=2;function we(t){let n=Date.now();return new Promise((r,s)=>{ye("codegraph",["init","--index","--quiet",t],{timeout:xe,maxBuffer:4*1024*1024},e=>{e?s(e):r(Date.now()-n)})})}async function wt(t,n=console.error){let r=[];for(let[o,i]of Object.entries(t))i.codegraph&&(i.tier!=="claude-code"&&i.tier!=="codex-cli"||q(i.workspace)&&(q(be(i.workspace,ke))||r.push({agentId:o,workspace:i.workspace})));if(r.length===0)return;n(`codegraph: indexing ${r.length} workspace(s) in background (max ${X} parallel)`);let s=0,e=[];for(let o=0;o<Math.min(X,r.length);o++)e.push((async()=>{for(;;){let i=s++;if(i>=r.length)return;let{agentId:a,workspace:u}=r[i];try{let l=await we(u);n(` codegraph: indexed ${a} in ${(l/1e3).toFixed(1)}s`)}catch(l){let d=l?.code==="ENOENT"?" (codegraph CLI not on PATH; install with `npm i -g @colbymchenry/codegraph`)":"";n(` codegraph: ${a} index failed: ${l?.message??l}${d}`)}}})());await Promise.allSettled(e)}import{appendFileSync as $e,existsSync as Q,mkdirSync as Z,readdirSync as V,realpathSync as _e,statSync as Se,unlinkSync as Re,utimesSync as Oe,writeFileSync as Ae}from"fs";import{createHash as ee}from"crypto";import{resolve as $,sep as Pe}from"path";var D="/observation/pack";function Ot(t=process.cwd()){return $(t,".agentx/observations")}function te(t,n){return $(t,encodeURIComponent(n).replace(/\./g,"%2E"))}function ne(t){return t==="bypassPermissions"}function z(t){try{return _e(t)}catch{return $(t)}}function Te(t,n){return n.some(r=>{try{return new RegExp(`^(?:${r})$`).test(t)}catch{return r===t}})}var ve=2e3;function P(t,n,r){return t.subarray(n,r).toString("utf-8").replace(/^�+|�+$/g,"")}function Ee(t,n,r){let s=Buffer.from(t,"utf-8"),e=P(s,0,r.headBytes),o=r.tailBytes>0?P(s,s.length-r.tailBytes,s.length):"",i=s.length-r.headBytes-r.tailBytes,a=t.split(`
|
|
54
|
-
`).length,l=s.length/a>ve?"Its lines are very long, so read it by byte range (for example head -c or tail -c, or jq for JSON) for the part you need.":"Read that file with offset and limit (line numbers), or grep it, for the part you need. Do not cat it whole: that is packed again.";return[`[ObservationPack: this result is ${s.length} bytes (${a} lines). Only its first ${r.headBytes} and last ${r.tailBytes} bytes are shown.`,`The exact original is saved at ${n}`,`${l} Do not guess at what is not shown.]`,e,`[... ${i} bytes not shown ...]`,o].join(`
|
|
55
|
-
`)}function De(t){let n=t;return!!n&&typeof n=="object"&&n.type==="text"&&typeof n.file?.content=="string"}function E(t){if(t==="")return 0;let n=1;for(let r=t.indexOf(`
|
|
56
|
-
`);r!==-1;r=t.indexOf(`
|
|
57
|
-
`,r+1))n++;return t.endsWith(`
|
|
58
|
-
`)&&n--,n}function Ce(t,n,r){let s=Buffer.from(t,"utf-8"),e=E(t),o=P(s,0,r.headBytes),i=o.lastIndexOf(`
|
|
59
|
-
`);o=i===-1?o:o.slice(0,i+1);let a=r.tailBytes>0?P(s,s.length-r.tailBytes,s.length):"",u=a.indexOf(`
|
|
60
|
-
`);a=u===-1?a:a.slice(u+1);let l=i===-1?0:E(o),d=u===-1?0:E(a),c=n.startLine,p=c+e-1,h=c+l,g=p-d,f=s.length-Buffer.byteLength(o,"utf-8")-Buffer.byteLength(a,"utf-8"),x=typeof n.totalLines=="number"&&n.totalLines>e?` (${n.totalLines} lines in all)`:"",O=h===g?`Line ${h} (${f} bytes) is`:`Lines ${h} to ${g} (${f} bytes) are`,w=[l===0&&o!==""?c:null,d===0&&a!==""?p:null].filter(v=>v!==null),de=w.length===0?"":w.length===1||w[0]===w[1]?` (line ${w[0]} only in part)`:` (lines ${w[0]} and ${w[1]} only in part)`,he=d>0?` Lines ${g+1} to ${p} follow; the numbers beside them are not the file's.`:"";return[o,`[ObservationPack: this read is ${s.length} bytes, lines ${c} to ${p} of ${n.path}${x}.`,`${O} not shown${de}.${he}`,"Read the file again with offset and limit for the lines you need, or Grep it. Do not guess at what is not shown.]",a].filter(v=>v!=="").join(`
|
|
61
|
-
`)}function Be(t,n){let r=ee("sha256").update(n).digest("hex"),s=$(t,`${r}.txt`);if(Q(s)){let e=new Date;Oe(s,e,e)}else Z(t,{recursive:!0,mode:448}),Ae(s,n,{mode:384});return{sha:r,path:s}}function Me(t,n,r){if(!n.enabled)return null;let s=t.tool_name;if(!s||!Te(s,n.tools))return null;let e=t.tool_input?.file_path;if(typeof e=="string"&&z(e).startsWith(z(r)+Pe)||n.limitBytes<=n.headBytes+n.tailBytes)return null;if(s==="Read"){let a=t.tool_response;if(!De(a))return null;let u=a.file.content,l=Buffer.byteLength(u,"utf-8");if(l<=n.limitBytes)return null;let d=typeof e=="string"?e:a.file.filePath??"the file you read",c=t.tool_input?.offset,p=typeof a.file.startLine=="number"&&a.file.startLine>=1?a.file.startLine:typeof c=="number"&&c>=1?c:1,h=Ce(u,{path:d,startLine:p,totalLines:a.file.totalLines},n),g=ee("sha256").update(u).digest("hex");return{updated:{...a,file:{...a.file,content:h}},packs:[{sha:g,path:d,bytes:l,keptBytes:Buffer.byteLength(h,"utf-8")}]}}let o=[],i=a=>{if(typeof a=="string"){let u=Buffer.byteLength(a,"utf-8");if(u<=n.limitBytes)return a;let{sha:l,path:d}=Be(r,a),c=Ee(a,d,n);return o.push({sha:l,path:d,bytes:u,keptBytes:Buffer.byteLength(c,"utf-8")}),c}if(Array.isArray(a))return a.map(i);if(a&&typeof a=="object"){let u=a;return u.type==="image"||u.type==="audio"||u.isImage===!0||typeof u.persistedOutputPath=="string"?a:Object.fromEntries(Object.entries(u).map(([l,d])=>[l,l==="blob"?d:i(d)]))}return a};try{let a=i(t.tool_response);return o.length>0?{updated:a,packs:o}:null}catch{return null}}function At(t,n,r){let s=t&&typeof t=="object"?Me(t,n,r.dir):null;if(!s)return"";try{let e=new Date().toISOString(),o=s.packs.map(i=>JSON.stringify({at:e,agent:r.agentId,session:t.session_id,tool:t.tool_name,sha:i.sha,bytes:i.bytes,keptBytes:i.keptBytes}));Z(r.dir,{recursive:!0,mode:448}),$e($(r.dir,"index.jsonl"),o.join(`
|
|
62
|
-
`)+`
|
|
63
|
-
`,{mode:384})}catch{}return JSON.stringify({hookSpecificOutput:{hookEventName:"PostToolUse",updatedToolOutput:s.updated}})}function Pt(t,n,r=Date.now()){if(n<=0||!Q(t))return 0;let s=r-n*864e5,e=0;for(let o of V(t,{withFileTypes:!0})){if(!o.isDirectory())continue;let i=$(t,o.name);for(let a of V(i)){if(!a.endsWith(".txt"))continue;let u=$(i,a);try{Se(u).mtimeMs<s&&(Re(u),e++)}catch{}}}return e}var B=180,Ie=600;function Le(t){let n;try{n=JSON.stringify(t??{})}catch{n=String(t)}n=n.replace(/\s+/g," ").trim();let r="Input: ",s=Ie-r.length;return r+(n.length>s?n.slice(0,s-1)+"\u2026":n)}function se(t,n){return t.length>n?t.slice(0,n-1)+"\u2026":t}function b(t,n,r){return`[agentx-mcp] "${n}" on MCP server "${t}" writes data and was not run: ${r}. Do not retry it or work around it. Say what you were trying to do and wait for instructions.`}function C(t,n,r){return t.verdict==="yes"?null:b(n,r,`the owner said no on card ${t.id}`)}async function Dt(t,n,r,s){let e=j(t,r);if(!e)return null;let{server:o,tool:i}=e,a=s.now??Date.now,u=s.sleep??(p=>new Promise(h=>setTimeout(h,p))),l=s.waitMs??B*1e3,d=s.pollMs??1e3,c=Math.max(1,Math.round(l/6e4));try{let p=a(),h=F(s.root,{title:se(`${s.agentId} wants to write with ${o}: ${i}`,120),ask:se(`Let ${s.agentId} run the "${i}" tool on ${o}? It changes data in that service.`,300),recommend:`Yes only if you asked for this. No, or no answer within ${c} min, and it does not run.`,context:Le(n),if_silent:"discard",expires:new Date(p+l).toISOString(),raised_by:s.agentId},{now:p,settings:s.settings,origin:{kind:"mcp-write",server:o,tool:i}});if(!h.ok)return b(o,i,`the confirmation card could not be raised (${h.error})`);let g=h.card.id;try{s.onCard?.(h.card)}catch{}for(;;){let f=A(s.root,g);if(!f)return b(o,i,"the confirmation card is gone");if(f.status==="decided")return C(f,o,i);if(f.status!=="pending")return b(o,i,`card ${g} was not answered in time`);if(a()-p>=l){let x=A(s.root,g);if(!x)return b(o,i,"the confirmation card is gone");if(x.status==="decided")return C(x,o,i);if(x.status!=="pending")return b(o,i,`card ${g} was not answered in time`);G(s.root,{...x,status:"expired",outcome:"discard",decided_by:"expiry",decided_at:new Date(a()).toISOString()});let O=A(s.root,g);return O?.status==="decided"?C(O,o,i):b(o,i,`card ${g} was not answered within ${c} min`)}await u(d)}}catch(p){return b(o,i,`the confirmation step failed (${p?.message??p})`)}}import{mkdirSync as Ue,renameSync as Ne,writeFileSync as je}from"fs";import{dirname as Ge,resolve as Fe}from"path";var He="AGENTX_GUARD_ERROR",I=75,We={connectS:1,maxTimeS:55,deadlineMs:3e3};function oe(t){return Fe(t,".agentx/bin/agentx-guard")}function It(t,n,r){let s=oe(t);Ue(Ge(s),{recursive:!0});let e=`#!/bin/sh
|
|
64
|
-
[ -f ${k(r)} ] || exit 127
|
|
65
|
-
exec ${k(n)} ${k(r)} "$@"
|
|
66
|
-
`,o=`${s}.${process.pid}.tmp`;return je(o,e,{mode:493}),Ne(o,s),s}function k(t){return`'${t.replace(/'/g,"'\\''")}'`}var _="[A-Za-z0-9_./~@:=-]+",M=`(start|restart|status)( +(-d|--detach|--when-idle|(-c|--config|--port)( +|=)${_}))*`,re="([0-9]+|\\$\\(id -u\\)|\\$UID)",qe=[`agentx +daemon +${M}`,`(node +)?(${_}/)?cli\\.js +daemon +${M}`,`npx +tsx +(${_}/)?cli\\.ts +daemon +${M}`,`launchctl +kickstart( +-k)? +gui/${re}/${_}`,`launchctl +(bootstrap|bootout) +gui/${re} +${_}`,`systemctl +--user +(start|restart|status) +${_}`,`sudo +systemctl +(start|restart|status) +${_}`].map(t=>`(${t})`).join("|");function Je(t){return JSON.stringify({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:t}})}var Xe="[agentx-guard] Refused: the AgentX guard could not check this call (the daemon is not answering and the local check failed). Only `agentx daemon start|restart|status` and the launchctl/systemctl forms that start the daemon run until it answers.";function ie(t){let n=t.budget??We,r=t.agentId?`?agent=${encodeURIComponent(t.agentId)}`:"",s=`http://127.0.0.1:${t.port}/guard/check${r}`,e=`guard check --rules-only --deadline-ms ${n.deadlineMs} --root ${k(t.root)}${t.agentId?` --agent ${k(t.agentId)}`:""}`,o=["p=$(cat)",`out=$(printf '%s' "$p" | curl -sf --connect-timeout ${n.connectS} --max-time ${n.maxTimeS} -H 'Content-Type: application/json' --data-binary @- '${s}' 2>/dev/null) && { printf '%s' "$out"; exit 0; }`,`out=$(printf '%s' "$p" | ${k(t.cliPath??oe(t.root))} ${e} 2>/dev/null) || out=$(printf '%s' "$p" | agentx ${e} 2>/dev/null)`,`[ $? -eq 0 ] && [ "$out" != ${He} ] && { printf '%s' "$out"; exit 0; }`];return t.required&&o.push('[ "$AGENTX_GUARD" = required ] || exit 0',`c=$(printf '%s' "$p" | grep -o '"command" *: *"[^"\\\\]*"')`,`if printf '%s' "$p" | grep -q '"tool_name" *: *"Bash"' && [ "$(printf '%s\\n' "$c" | grep -c .)" = 1 ] && printf '%s\\n' "$c" | sed 's/^"command" *: *"//; s/"$//; s/^ *//; s/ *$//' | grep -Eqx ${k(qe)}; then exit 0; fi`,`printf '%s' ${k(Je(Xe))}`),o.push("exit 0"),o.join(`
|
|
67
|
-
`)}var L="<!-- agentx-managed: hash=",U=" -->";function ce(t){return Ke("sha256").update(t.systemPrompt??"").update("\0").update(t.codegraph?"cg:1":"cg:0").digest("hex").slice(0,16)}function Ye(t){return`${L}${ce(t)}${U}`}function Ve(t){let n=t.split(`
|
|
68
|
-
`,1)[0]??"";return!n.startsWith(L)||!n.endsWith(U)?null:n.slice(L.length,n.length-U.length)}function ue(t,n){let r=`${t} ${n.systemPrompt||""} ${n.name}`.toLowerCase();return/cod(e|ing|er)|develop|engineer|program/.test(r)?"coding":/pm|project.?manag|product|scrum/.test(r)?"pm":/devops|deploy|infra|ops|sre|ci.?cd/.test(r)?"devops":/qa|test|quality|forensic/.test(r)?"qa":"general"}function ze(t,n,r){let s=ue(t,n),e=[];switch(e.push(Ye(n)),e.push(`# ${n.name}`),e.push(""),e.push("@AGENTS.md"),e.push(""),n.systemPrompt&&n.systemPrompt.trim().length>0&&(e.push("## Role"),e.push(""),e.push(n.systemPrompt.trimEnd()),e.push("")),e.push("## Commands"),e.push(""),y(m(n.workspace,"package.json"))?(e.push("```bash"),e.push("npm install # install dependencies"),e.push("npm test # run tests"),e.push("npm run build # build project"),e.push("```")):y(m(n.workspace,"requirements.txt"))&&(e.push("```bash"),e.push("pip install -r requirements.txt"),e.push("pytest"),e.push("```")),e.push(""),e.push("## Conventions"),e.push(""),s){case"coding":e.push("- Write tests for new code before committing"),e.push("- Keep functions small and focused"),e.push("- Follow existing patterns in the codebase"),e.push("- Run tests before pushing");break;case"pm":e.push("- Keep responses concise (3-5 lines main message)"),e.push("- Reference issues with #IID and MRs with !IID"),e.push("- Update issue labels and milestones when relevant"),e.push("- Summarize decisions, don't narrate process");break;case"devops":e.push("- Always check service status before making changes"),e.push("- Never run destructive commands without confirmation"),e.push("- Log all deployment actions"),e.push("- Verify changes in staging before production");break;case"qa":e.push("- Document reproduction steps for every bug"),e.push("- Include expected vs actual behavior"),e.push("- Check both happy path and edge cases"),e.push("- Attach screenshots when reporting UI issues");break;default:e.push("- Be concise \u2014 lead with the answer, skip preamble"),e.push("- Follow existing patterns in the codebase")}return e.push(""),e.push("## Cross-Channel Messaging"),e.push(""),e.push("You can send messages to any channel proactively:"),e.push("```bash"),e.push(`curl -X POST http://localhost:${r}/send \\`),e.push(' -H "Content-Type: application/json" \\'),e.push(` -d '{"channel":"telegram","chatId":"<id>","text":"<message>","agentId":"${t}"}'`),e.push("```"),e.push("Channels: telegram, whatsapp, gitlab, discord"),e.push(""),e.push("## Typed actions \u2014 prefer these over free-form Bash"),e.push(""),e.push("Daemon-shipped typed actions cover the common needs. Each call appears in `/traces` as a structured step (input + output schema), unlike opaque `Bash`/`curl`/`Read` calls."),e.push(""),e.push("```bash"),e.push("# List available actions + their schemas"),e.push("agentx actions builtin # \u2192 catalog"),e.push("agentx actions builtin <name> --schema # \u2192 input/output schema"),e.push(""),e.push("# Invoke an action with typed JSON input"),e.push(`agentx actions builtin http.fetch --input '{"url":"https://example.com/data"}'`),e.push(`agentx actions builtin http.post --input '{"url":"https://x.tld/hook","body":{"k":"v"}}'`),e.push(`agentx actions builtin file.read_lines --input '{"path":"data/prices.json"}'`),e.push(`agentx actions builtin file.write_jsonl --input '{"path":"leads.jsonl","record":{"name":"\u2026","email":"\u2026"}}'`),e.push(`agentx actions builtin extract.structured --input '{"prompt":"<text>","schema":{"type":"object",\u2026}}'`),e.push(`agentx actions builtin rag.lexical --input '{"agentId":"${t}","query":"\u2026","limit":5}'`),e.push(`agentx actions builtin agent.call --input '{"agentId":"<local-agent>","message":"\u2026"}'`),e.push(`agentx actions builtin mesh.delegate --input '{"peer":"<peer-name>","agent":"<peer-agent>","message":"\u2026"}'`),e.push("```"),e.push(""),e.push("Rule of thumb:"),e.push("- HTTP fetch/POST \u2192 `http.fetch` / `http.post` (not `Bash curl`)"),e.push("- Reading a file you'll parse \u2192 `file.read_lines` (not `Bash cat`)"),e.push("- Appending a structured record \u2192 `file.write_jsonl` (not `Bash echo >>` or `Write` with model-formatted JSON)"),e.push("- Extracting fields from text into a typed object \u2192 `extract.structured` (not asking the model to format JSON in its reply)"),e.push("- Searching a doc corpus \u2192 `rag.lexical` (not `Read` over every file)"),e.push("- Calling another agent on this daemon \u2192 `agent.call` (fresh session by default; not composing `Bash curl` to /task)"),e.push("- Calling an agent on a peer mesh node \u2192 `mesh.delegate` (cross-machine; same fresh-session default)"),e.push(""),n.codegraph&&e.push(Y()),e.join(`
|
|
69
|
-
`)}var T=["Bash(npx prisma migrate reset*)","Bash(prisma migrate reset*)","Bash(npx prisma db push*)","Bash(prisma db push*)","Bash(dropdb*)"];function Qe(t,n,r=process.cwd()){return ie({port:n,root:r,agentId:t,required:!0})}var le=B+15,Ze=le+15;function et(t,n){let r=`http://127.0.0.1:${n}/guard/check?agent=${encodeURIComponent(t)}`,s=JSON.stringify({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:"AgentX guard did not answer; tools of an MCP server with an allow list are refused until it does."}});return`out=$(curl -sf --max-time ${le} -H 'Content-Type: application/json' --data-binary @- '${r}' 2>/dev/null) && printf '%s' "$out" || printf '%s' '${s}'`}function pe(t,n,r){let s=Qe(t,n),e=[{matcher:"Bash",hooks:[{type:"command",command:s,timeout:I}]},{matcher:"Write|Edit",hooks:[{type:"command",command:s,timeout:I}]}],o=N(r);return o&&e.push({matcher:o,hooks:[{type:"command",command:et(t,n),timeout:Ze}]}),e}function tt(t){return Array.isArray(t?.hooks)&&t.hooks.some(n=>typeof n?.command=="string"&&(n.command.includes("/guard/check")||n.command.includes("guard check")))}function nt(t,n,r="19900"){let s={autoMemoryEnabled:!0,env:{CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:"1"}};if(n.permissionMode==="bypassPermissions"?s.permissions={deny:[...T]}:n.permissionMode==="plan"?s.permissions={deny:[...T,"Bash(rm -rf *)","Bash(drop *)","Bash(DELETE *)"]}:s.permissions={deny:[...T,"Bash(rm -rf /)","Bash(> /dev/sda*)","Bash(mkfs*)"]},n.codegraph){let o=s.permissions||{},i=Array.isArray(o.allow)?o.allow:[];o.allow=[...new Set([...i,...K])],s.permissions=o}let e={};return e.PreToolUse=pe(t,r,n.mcp),e.Notification=[{matcher:"",hooks:[{type:"command",command:`echo "[${t}] notification: $(jq -r '.type // "unknown"')" >> /tmp/agentx-${t}.log`}]}],e.PostToolUse=[{matcher:"Bash",hooks:[{type:"command",command:`jq -r '.tool_input.command // empty' >> /tmp/agentx-${t}-commands.log`}]}],e.SessionStart=[{matcher:"compact",hooks:[{type:"command",command:`echo "Reminder: You are ${n.name} (${t}). Follow the conventions in CLAUDE.md."`}]}],s.hooks=e,s}var st=`# Code Quality
|
|
70
|
-
|
|
71
|
-
- No console.log in production code (use a logger)
|
|
72
|
-
- Handle errors explicitly \u2014 no empty catch blocks
|
|
73
|
-
- Keep files under 300 lines
|
|
74
|
-
- Extract repeated logic into shared utilities
|
|
75
|
-
`;function rt(t,n){let r=ue(t,n),s=[];switch(r){case"coding":s.push({name:"testing.md",content:`---
|
|
76
|
-
paths:
|
|
77
|
-
- "**/*.test.{ts,tsx,js,jsx}"
|
|
78
|
-
- "**/*.spec.{ts,tsx,js,jsx}"
|
|
79
|
-
- "test/**/*"
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
# Testing Rules
|
|
83
|
-
|
|
84
|
-
- Every new function should have a corresponding test
|
|
85
|
-
- Test both happy path and error cases
|
|
86
|
-
- Use descriptive test names that explain what's being tested
|
|
87
|
-
- Mock external dependencies, not internal modules
|
|
88
|
-
`}),s.push({name:"code-quality.md",content:`# Code Quality
|
|
89
|
-
|
|
90
|
-
- No console.log in production code (use a logger)
|
|
91
|
-
- Handle errors explicitly \u2014 no empty catch blocks
|
|
92
|
-
- Extract repeated logic into shared utilities
|
|
93
|
-
`,replaces:[st]});break;case"devops":s.push({name:"deployment-safety.md",content:`# Deployment Safety
|
|
94
|
-
|
|
95
|
-
- Always verify staging before production
|
|
96
|
-
- Check disk space and memory before deploying
|
|
97
|
-
- Never expose secrets in logs or commits
|
|
98
|
-
- Use rollback-safe deployment strategies
|
|
99
|
-
`});break;case"pm":s.push({name:"communication.md",content:`# Communication Rules
|
|
100
|
-
|
|
101
|
-
- Keep GitLab comments under 5 lines for the main message
|
|
102
|
-
- Use <details> for verbose output (logs, commands, steps)
|
|
103
|
-
- Reference issues with #IID, merge requests with !IID
|
|
104
|
-
- Never mention Telegram handles on GitLab
|
|
105
|
-
`});break;case"qa":s.push({name:"bug-reports.md",content:`# Bug Report Format
|
|
106
|
-
|
|
107
|
-
Always include:
|
|
108
|
-
1. Steps to reproduce
|
|
109
|
-
2. Expected behavior
|
|
110
|
-
3. Actual behavior
|
|
111
|
-
4. Environment (browser, OS, version)
|
|
112
|
-
5. Screenshots if applicable
|
|
113
|
-
`});break}return s}function ot(t,n,r="19900",s=console.error){let e=[],o=[],i=n.workspace;if(!y(i))return s(`Workspace not found: ${i}`),{created:e,skipped:o};if(n.tier!=="claude-code"&&n.tier!=="codex-cli")return{created:e,skipped:o};let a=(c,p)=>{y(c)?o.push(c):(ae(m(c,".."),{recursive:!0}),S(c,p),e.push(c))},u=(c,p,h)=>{if(!y(c)){ae(m(c,".."),{recursive:!0}),S(c,p),e.push(c);return}let g;try{g=R(c,"utf8")}catch{o.push(c);return}let f=Ve(g);if(f===null){o.push(c);return}if(f===h){o.push(c);return}S(c,p),e.push(`${c} (refreshed)`)};if(a(m(i,"AGENTS.md"),W({name:n.name,id:t,role:n.systemPrompt?.split(`
|
|
114
|
-
`)[0],workspace:i,tier:n.tier})),n.tier==="codex-cli")return e.length>0&&s(`[${t}] workspace setup: created ${e.length} file(s)`),{created:e,skipped:o};u(m(i,"CLAUDE.md"),ze(t,n,r),ce(n));let l=m(i,".claude/settings.json");a(l,JSON.stringify(nt(t,n,r),null,2));let d=rt(t,n);for(let c of d){let p=m(i,".claude/rules",c.name);c.replaces&&y(p)&&c.replaces.includes(R(p,"utf8"))?(S(p,c.content),e.push(p)):a(p,c.content)}return e.length>0&&s(`[${t}] workspace setup: created ${e.length} file(s)`),{created:e,skipped:o}}function it(t,n){let r=m(t,".claude/settings.json");if(!y(r))return!1;try{let s=JSON.parse(R(r,"utf-8")),e=!1;for(let[o,i]of Object.entries(n))if(typeof i=="object"&&i!==null&&!Array.isArray(i)){s[o]||(s[o]={});for(let[a,u]of Object.entries(i))s[o][a]===void 0&&(s[o][a]=u,e=!0)}else s[o]===void 0&&(s[o]=i,e=!0);return e&&S(r,JSON.stringify(s,null,2)),e}catch{return!1}}function at(t,n,r="19900",s){let e=m(t,".claude/settings.json");if(!y(e))return!1;try{let o=JSON.parse(R(e,"utf-8")),i=!1,a=o.permissions??={},u=Array.isArray(a.deny)?a.deny:a.deny=[];for(let p of T)u.includes(p)||(u.push(p),i=!0);let l=o.hooks??={},c=[...Array.isArray(l.PreToolUse)?l.PreToolUse.filter(p=>!tt(p)):[],...pe(n,r,s)];return JSON.stringify(l.PreToolUse??null)!==JSON.stringify(c)&&(l.PreToolUse=c,i=!0),i&&S(e,JSON.stringify(o,null,2)),i}catch{return!1}}function ct(t){return Array.isArray(t?.hooks)&&t.hooks.some(n=>typeof n?.command=="string"&&n.command.includes(D))}function ut(t,n,r,s){let e=m(t,".claude/settings.json");if(!y(e))return!1;try{let o=JSON.parse(R(e,"utf-8")),i=JSON.stringify(o),a=s.enabled&&s.tools.length>0,u=`Read(/${te(s.dir,n)}/**)`,l=Array.isArray(o.hooks?.PostToolUse)?o.hooks.PostToolUse:[],d=l.filter(h=>!ct(h)),c=Array.isArray(o.permissions?.allow)?o.permissions.allow:[],p=c.filter(h=>h!==u);if(a){let g=`curl -s --max-time 5 -H 'Content-Type: application/json' --data-binary @- '${`http://127.0.0.1:${r}${D}?agent=${encodeURIComponent(n)}`}' 2>/dev/null || true`;d.push({matcher:s.tools.join("|"),hooks:[{type:"command",command:g,timeout:10}]}),p.push(u)}return(a||l.length>0)&&((o.hooks??={}).PostToolUse=d),(a||c.length>0)&&((o.permissions??={}).allow=p),JSON.stringify(o)===i?!1:(S(e,JSON.stringify(o,null,2)),!0)}catch{return!1}}function Xt(t,n="19900",r=console.error,s){let e=0,o=0,i=0,a=0,u=0,l=0;for(let[d,c]of Object.entries(t)){if(c.tier!=="claude-code"&&c.tier!=="codex-cli")continue;let p=ot(d,c,n,r);if(e+=p.created.length,c.tier==="claude-code"&&it(c.workspace,{env:{CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:"1"}})&&o++,c.tier==="claude-code"&&at(c.workspace,d,n,c.mcp)&&i++,c.tier==="claude-code"&&s){let h=ne(c.permissionMode);s.enabled&&!h&&l++;let g=s.enabled&&h;ut(c.workspace,d,n,{...s,enabled:g})&&(g?a++:u++)}}e>0&&r(`Workspace setup: ${e} file(s) created across agent workspaces`),o>0&&r(`Workspace patch: ${o} workspace(s) updated with agent teams support`),i>0&&r(`Guardrails: ${i} workspace(s) backfilled with deny list + PreToolUse guard hook`),a>0&&r(`ObservationPack: PostToolUse hook written to ${a} workspace(s)`),u>0&&r(`ObservationPack: PostToolUse hook removed from ${u} workspace(s)`),l>0&&r(`ObservationPack: ${l} agent(s) not packed: permissionMode is not "bypassPermissions", so they could not read a saved original back`)}export{ht as a,gt as b,mt as c,xt as d,wt as e,D as f,Ot as g,te as h,ne as i,At as j,Pt as k,Dt as l,He as m,I as n,It as o,ie as p,Ve as q,ze as r,le as s,Ze as t,et as u,ot as v,at as w,ut as x,Xt as y};
|
|
115
|
-
//# sourceMappingURL=chunk-3AHYZLGE.js.map
|