agentix-cli 0.190.0 → 0.191.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-6AHOJ2PO.js → App-Z4OZ4VAI.js} +2 -2
- package/dist/{ChatApp-MVSQX44C.js → ChatApp-7VLNOH2N.js} +2 -2
- package/dist/{absorb-eval-PHA44MPA.js → absorb-eval-QR3EEHDE.js} +2 -2
- package/dist/{adapter-RXZGBGFY.js → adapter-VWMQAALK.js} +2 -2
- package/dist/{agent-4CGWR2XJ.js → agent-RS4W545P.js} +2 -2
- package/dist/{board-dashboard-3CNZ3R6T.js → board-dashboard-RXOSENTD.js} +318 -317
- package/dist/{board-dashboard-3CNZ3R6T.js.map → board-dashboard-RXOSENTD.js.map} +1 -1
- package/dist/chunk-2HBEZV7L.js +24 -0
- package/dist/chunk-2HBEZV7L.js.map +1 -0
- package/dist/{chunk-YHRQQ4DB.js → chunk-34O2GH4J.js} +2 -2
- package/dist/{chunk-SOVWD6TL.js → chunk-3NMBTBNW.js} +2 -2
- package/dist/{chunk-EGKOB3ZM.js → chunk-54J6PXBG.js} +2 -2
- package/dist/{chunk-PE5V2LI7.js → chunk-5ONH4ITT.js} +2 -2
- package/dist/{chunk-ZJNEJRUU.js → chunk-6MU3OEII.js} +2 -2
- package/dist/chunk-A7JSRDJL.js +3 -0
- package/dist/chunk-A7JSRDJL.js.map +1 -0
- package/dist/{chunk-OBVLO6FV.js → chunk-AS4NDKUJ.js} +2 -2
- package/dist/{chunk-URWRA3EO.js → chunk-BWBTNBPS.js} +2 -2
- package/dist/{chunk-U2OGZDAN.js → chunk-CKHLBNMN.js} +2 -2
- package/dist/{chunk-ZYZ4VQUD.js → chunk-FRTU3ICQ.js} +2 -2
- package/dist/{chunk-FKT34MQ7.js → chunk-IGLJXEXX.js} +2 -2
- package/dist/chunk-JRAG37V5.js +3 -0
- package/dist/chunk-JRAG37V5.js.map +1 -0
- package/dist/{chunk-H7VI7OTS.js → chunk-KTGTKOLV.js} +2 -2
- package/dist/{chunk-A5KZSTYI.js → chunk-L3CWRXKQ.js} +2 -2
- package/dist/{chunk-POK4IPY3.js → chunk-MW75GECE.js} +94 -92
- package/dist/chunk-MW75GECE.js.map +1 -0
- package/dist/{chunk-WXJ25XH2.js → chunk-OTCMYGQR.js} +2 -2
- package/dist/{chunk-7BA4KCRW.js → chunk-RA4WCDGV.js} +2 -2
- package/dist/{chunk-QBR6TGRW.js → chunk-RQKLUGMS.js} +3 -3
- package/dist/{chunk-YLCMN4OA.js → chunk-RRGC6Y4L.js} +2 -2
- package/dist/{chunk-JE5KSD6Z.js → chunk-S3XUIVC2.js} +2 -2
- package/dist/{chunk-WILRVP4X.js → chunk-T2NPSEPJ.js} +2 -2
- package/dist/chunk-U5B275AU.js +143 -0
- package/dist/chunk-U5B275AU.js.map +1 -0
- package/dist/{chunk-UU77SLIS.js → chunk-WXSS7VIW.js} +302 -297
- package/dist/chunk-WXSS7VIW.js.map +1 -0
- package/dist/{chunk-J522P3Z3.js → chunk-XJEBJZLX.js} +2 -2
- package/dist/{chunk-Z55PWDYH.js → chunk-XJUBFPOM.js} +2 -2
- package/dist/chunk-XVV7ZZ77.js +6 -0
- package/dist/{chunk-4ZWZ42YE.js.map → chunk-XVV7ZZ77.js.map} +1 -1
- package/dist/{chunk-2MFBCDWL.js → chunk-YFJVQOWI.js} +2 -2
- package/dist/{chunk-FM5VBO3D.js → chunk-YMDGKFIG.js} +2 -2
- package/dist/{chunk-V2O4OQZC.js → chunk-YOMLHG33.js} +2 -2
- package/dist/{chunk-XIGFRLU5.js → chunk-ZCBTTYQN.js} +20 -20
- package/dist/chunk-ZCBTTYQN.js.map +1 -0
- package/dist/{chunk-YJDQK22T.js → chunk-ZJ74H5SV.js} +2 -2
- package/dist/{chunk-BSQIPD6F.js → chunk-ZU6W3CXO.js} +36 -36
- package/dist/chunk-ZU6W3CXO.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/{client-YDESLBEL.js → client-N5YTG2K6.js} +2 -2
- package/dist/{compaction-R7VWQB6X.js → compaction-ZE2WYXHQ.js} +2 -2
- package/dist/{config-J7LIYG6O.js → config-WUB5SJPH.js} +2 -2
- package/dist/{config-mutate-WNWJL2BY.js → config-mutate-ZLPUEIVN.js} +2 -2
- package/dist/config-mutator-S5X4DOJK.js +2 -0
- package/dist/{contributions-VVKFLXVL.js → contributions-C4DKQJY6.js} +2 -2
- package/dist/{contributions-VVKFLXVL.js.map → contributions-C4DKQJY6.js.map} +1 -1
- package/dist/{doctor-IPU5KA2L.js → doctor-ND3OS575.js} +2 -2
- package/dist/fact-proposals-Z7HJG7QJ.js +2 -0
- package/dist/{follow-up-tool-NUXHITTB.js → follow-up-tool-TWOEAWOL.js} +2 -2
- package/dist/{hub-4SPXWMRT.js → hub-FUM7UY5S.js} +2 -2
- package/dist/index.d.ts +216 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/ledger-5GMBLR7W.js +2 -0
- package/dist/memory-extract-QYSXPK22.js +2 -0
- package/dist/memory-migrate-SO7RC5OU.js +2 -0
- package/dist/{memory-migrate-ED37IBEL.js.map → memory-migrate-SO7RC5OU.js.map} +1 -1
- package/dist/{program-5LBTVRBW.js → program-JLUZINRR.js} +201 -201
- package/dist/program-JLUZINRR.js.map +1 -0
- package/dist/{promote-A7VZBQUZ.js → promote-M5AJSWHZ.js} +2 -2
- package/dist/{query-5I6RBPPK.js → query-NPDKXBTN.js} +2 -2
- package/dist/{query-settings-QLLC46BO.js → query-settings-HXKZYIEV.js} +2 -2
- package/dist/registry-A2FFL4EA.js +2 -0
- package/dist/{request-planner-SF4GYBQE.js → request-planner-ANGZP4JL.js} +2 -2
- package/dist/{review-candidates-KPAZ3FYG.js → review-candidates-B7T2QA3R.js} +2 -2
- package/dist/{rotation-memo-6RP4Z3S5.js → rotation-memo-26CFE4JN.js} +4 -3
- package/dist/rotation-memo-26CFE4JN.js.map +1 -0
- package/dist/rotation-memo-store-WMDI7NND.js +2 -0
- package/dist/{rotation-memo-store-Z4D5KRA6.js.map → rotation-memo-store-WMDI7NND.js.map} +1 -1
- package/dist/{routing-RUJNJHM6.js → routing-2KWP5TAT.js} +2 -2
- package/dist/schedule-tool-2UNMXEBQ.js +2 -0
- package/dist/{scheduler-C44WJX4C.js → scheduler-VN7WDAKE.js} +2 -2
- package/dist/{seat-QY2GW3FI.js → seat-MAC3QGGD.js} +2 -2
- package/dist/{select-XJMJ2XVP.js → select-UYKEN4N4.js} +2 -2
- package/dist/{set-enabled-JC3TJ6VZ.js → set-enabled-JEUIINT3.js} +2 -2
- package/dist/{sprint-tool-NP4WN7KL.js → sprint-tool-MB2MPR4K.js} +2 -2
- package/dist/{tool-23ODBVYF.js → tool-L4CQCPRF.js} +2 -2
- package/dist/{tool-LZR4EOQJ.js → tool-SZ6C6EBP.js} +2 -2
- package/dist/{tool-KHD45TSF.js → tool-TLXKW55S.js} +2 -2
- package/dist/web/workflow-editor.global.js +12 -12
- package/dist/web/workflow-editor.global.js.map +1 -1
- package/dist/{wiki-N3JOY2NN.js → wiki-ZAHFGDKE.js} +2 -2
- package/dist/wiki-enrich-QLCQHV6B.js +2 -0
- package/package.json +1 -1
- package/dist/chunk-4ZWZ42YE.js +0 -5
- package/dist/chunk-BSQIPD6F.js.map +0 -1
- package/dist/chunk-C5OCJCDC.js +0 -137
- package/dist/chunk-C5OCJCDC.js.map +0 -1
- package/dist/chunk-GQ76J72O.js +0 -3
- package/dist/chunk-GQ76J72O.js.map +0 -1
- package/dist/chunk-LE3BXIUF.js +0 -23
- package/dist/chunk-LE3BXIUF.js.map +0 -1
- package/dist/chunk-POK4IPY3.js.map +0 -1
- package/dist/chunk-UU77SLIS.js.map +0 -1
- package/dist/chunk-XIGFRLU5.js.map +0 -1
- package/dist/config-mutator-V3PSCM6Q.js +0 -2
- package/dist/fact-proposals-X2O4W7VN.js +0 -2
- package/dist/ledger-P62U3FHT.js +0 -2
- package/dist/memory-extract-NLVLQE7V.js +0 -2
- package/dist/memory-migrate-ED37IBEL.js +0 -2
- package/dist/program-5LBTVRBW.js.map +0 -1
- package/dist/registry-J724YF5H.js +0 -2
- package/dist/rotation-memo-6RP4Z3S5.js.map +0 -1
- package/dist/rotation-memo-store-Z4D5KRA6.js +0 -2
- package/dist/schedule-tool-PX5YULLG.js +0 -2
- package/dist/wiki-enrich-ZNFEO7BX.js +0 -2
- /package/dist/{App-6AHOJ2PO.js.map → App-Z4OZ4VAI.js.map} +0 -0
- /package/dist/{ChatApp-MVSQX44C.js.map → ChatApp-7VLNOH2N.js.map} +0 -0
- /package/dist/{absorb-eval-PHA44MPA.js.map → absorb-eval-QR3EEHDE.js.map} +0 -0
- /package/dist/{adapter-RXZGBGFY.js.map → adapter-VWMQAALK.js.map} +0 -0
- /package/dist/{agent-4CGWR2XJ.js.map → agent-RS4W545P.js.map} +0 -0
- /package/dist/{chunk-YHRQQ4DB.js.map → chunk-34O2GH4J.js.map} +0 -0
- /package/dist/{chunk-SOVWD6TL.js.map → chunk-3NMBTBNW.js.map} +0 -0
- /package/dist/{chunk-EGKOB3ZM.js.map → chunk-54J6PXBG.js.map} +0 -0
- /package/dist/{chunk-PE5V2LI7.js.map → chunk-5ONH4ITT.js.map} +0 -0
- /package/dist/{chunk-ZJNEJRUU.js.map → chunk-6MU3OEII.js.map} +0 -0
- /package/dist/{chunk-OBVLO6FV.js.map → chunk-AS4NDKUJ.js.map} +0 -0
- /package/dist/{chunk-URWRA3EO.js.map → chunk-BWBTNBPS.js.map} +0 -0
- /package/dist/{chunk-U2OGZDAN.js.map → chunk-CKHLBNMN.js.map} +0 -0
- /package/dist/{chunk-ZYZ4VQUD.js.map → chunk-FRTU3ICQ.js.map} +0 -0
- /package/dist/{chunk-FKT34MQ7.js.map → chunk-IGLJXEXX.js.map} +0 -0
- /package/dist/{chunk-H7VI7OTS.js.map → chunk-KTGTKOLV.js.map} +0 -0
- /package/dist/{chunk-A5KZSTYI.js.map → chunk-L3CWRXKQ.js.map} +0 -0
- /package/dist/{chunk-WXJ25XH2.js.map → chunk-OTCMYGQR.js.map} +0 -0
- /package/dist/{chunk-7BA4KCRW.js.map → chunk-RA4WCDGV.js.map} +0 -0
- /package/dist/{chunk-QBR6TGRW.js.map → chunk-RQKLUGMS.js.map} +0 -0
- /package/dist/{chunk-YLCMN4OA.js.map → chunk-RRGC6Y4L.js.map} +0 -0
- /package/dist/{chunk-JE5KSD6Z.js.map → chunk-S3XUIVC2.js.map} +0 -0
- /package/dist/{chunk-WILRVP4X.js.map → chunk-T2NPSEPJ.js.map} +0 -0
- /package/dist/{chunk-J522P3Z3.js.map → chunk-XJEBJZLX.js.map} +0 -0
- /package/dist/{chunk-Z55PWDYH.js.map → chunk-XJUBFPOM.js.map} +0 -0
- /package/dist/{chunk-2MFBCDWL.js.map → chunk-YFJVQOWI.js.map} +0 -0
- /package/dist/{chunk-FM5VBO3D.js.map → chunk-YMDGKFIG.js.map} +0 -0
- /package/dist/{chunk-V2O4OQZC.js.map → chunk-YOMLHG33.js.map} +0 -0
- /package/dist/{chunk-YJDQK22T.js.map → chunk-ZJ74H5SV.js.map} +0 -0
- /package/dist/{client-YDESLBEL.js.map → client-N5YTG2K6.js.map} +0 -0
- /package/dist/{compaction-R7VWQB6X.js.map → compaction-ZE2WYXHQ.js.map} +0 -0
- /package/dist/{config-J7LIYG6O.js.map → config-WUB5SJPH.js.map} +0 -0
- /package/dist/{config-mutate-WNWJL2BY.js.map → config-mutate-ZLPUEIVN.js.map} +0 -0
- /package/dist/{config-mutator-V3PSCM6Q.js.map → config-mutator-S5X4DOJK.js.map} +0 -0
- /package/dist/{doctor-IPU5KA2L.js.map → doctor-ND3OS575.js.map} +0 -0
- /package/dist/{fact-proposals-X2O4W7VN.js.map → fact-proposals-Z7HJG7QJ.js.map} +0 -0
- /package/dist/{follow-up-tool-NUXHITTB.js.map → follow-up-tool-TWOEAWOL.js.map} +0 -0
- /package/dist/{hub-4SPXWMRT.js.map → hub-FUM7UY5S.js.map} +0 -0
- /package/dist/{ledger-P62U3FHT.js.map → ledger-5GMBLR7W.js.map} +0 -0
- /package/dist/{memory-extract-NLVLQE7V.js.map → memory-extract-QYSXPK22.js.map} +0 -0
- /package/dist/{promote-A7VZBQUZ.js.map → promote-M5AJSWHZ.js.map} +0 -0
- /package/dist/{query-5I6RBPPK.js.map → query-NPDKXBTN.js.map} +0 -0
- /package/dist/{query-settings-QLLC46BO.js.map → query-settings-HXKZYIEV.js.map} +0 -0
- /package/dist/{registry-J724YF5H.js.map → registry-A2FFL4EA.js.map} +0 -0
- /package/dist/{request-planner-SF4GYBQE.js.map → request-planner-ANGZP4JL.js.map} +0 -0
- /package/dist/{review-candidates-KPAZ3FYG.js.map → review-candidates-B7T2QA3R.js.map} +0 -0
- /package/dist/{routing-RUJNJHM6.js.map → routing-2KWP5TAT.js.map} +0 -0
- /package/dist/{schedule-tool-PX5YULLG.js.map → schedule-tool-2UNMXEBQ.js.map} +0 -0
- /package/dist/{scheduler-C44WJX4C.js.map → scheduler-VN7WDAKE.js.map} +0 -0
- /package/dist/{seat-QY2GW3FI.js.map → seat-MAC3QGGD.js.map} +0 -0
- /package/dist/{select-XJMJ2XVP.js.map → select-UYKEN4N4.js.map} +0 -0
- /package/dist/{set-enabled-JC3TJ6VZ.js.map → set-enabled-JEUIINT3.js.map} +0 -0
- /package/dist/{sprint-tool-NP4WN7KL.js.map → sprint-tool-MB2MPR4K.js.map} +0 -0
- /package/dist/{tool-23ODBVYF.js.map → tool-L4CQCPRF.js.map} +0 -0
- /package/dist/{tool-LZR4EOQJ.js.map → tool-SZ6C6EBP.js.map} +0 -0
- /package/dist/{tool-KHD45TSF.js.map → tool-TLXKW55S.js.map} +0 -0
- /package/dist/{wiki-N3JOY2NN.js.map → wiki-ZAHFGDKE.js.map} +0 -0
- /package/dist/{wiki-enrich-ZNFEO7BX.js.map → wiki-enrich-QLCQHV6B.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-54J6PXBG.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-MEFPXHQJ.js";import"./chunk-FRTU3ICQ.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-BWBTNBPS.js";import"./chunk-WPNRDEHW.js";import"./chunk-3NMBTBNW.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-AHWWJ7AF.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-ZCBTTYQN.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.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-M5AJSWHZ.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-RQKLUGMS.js";import"./chunk-JTFCU5LH.js";import"./chunk-BWBTNBPS.js";import"./chunk-WPNRDEHW.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-3NMBTBNW.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QUFIUXMQ.js";import"./chunk-BERWTVG2.js";import"./chunk-AHWWJ7AF.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-ZCBTTYQN.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.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-NPDKXBTN.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-QUFIUXMQ.js";import"./chunk-BERWTVG2.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-WUB5SJPH.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-HXKZYIEV.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Aa as o,Ba as p,ma as a,na as b,oa as c,pa as d,qa as e,ra as f,sa as g,ta as h,ua as i,va as j,wa as k,xa as l,ya as m,za as n}from"./chunk-MW75GECE.js";import"./chunk-ZU6W3CXO.js";import"./chunk-MEFPXHQJ.js";import"./chunk-SZDACK6O.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-VJVXEVZ7.js";import"./chunk-U5B275AU.js";import"./chunk-YFJVQOWI.js";import"./chunk-3UOTLMXD.js";import"./chunk-BE64IJWM.js";import"./chunk-5ONH4ITT.js";import"./chunk-JRAG37V5.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-VWTBHLMX.js";import"./chunk-6MU3OEII.js";import"./chunk-FRTU3ICQ.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-RQKLUGMS.js";import"./chunk-JTFCU5LH.js";import"./chunk-BWBTNBPS.js";import"./chunk-WPNRDEHW.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-34O2GH4J.js";import"./chunk-3NMBTBNW.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-MYVHVJWZ.js";import"./chunk-QUFIUXMQ.js";import"./chunk-AV7T3SYT.js";import"./chunk-2HBEZV7L.js";import"./chunk-A7JSRDJL.js";import"./chunk-BERWTVG2.js";import"./chunk-AHWWJ7AF.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-DSYKYZMT.js";import"./chunk-ZCBTTYQN.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.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-A2FFL4EA.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-3NMBTBNW.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-ZCBTTYQN.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.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-ANGZP4JL.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as I}from"./chunk-
|
|
1
|
+
import{b as I}from"./chunk-S3XUIVC2.js";import"./chunk-VJVXEVZ7.js";import"./chunk-3NMBTBNW.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-ZCBTTYQN.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.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-B7T2QA3R.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as u,i as
|
|
1
|
+
import{e as u,i as m}from"./chunk-QUFIUXMQ.js";import"./chunk-QIJLFPWE.js";import{execFile as f}from"child_process";var g=3e4,w="haiku",y=`You are about to lose this working session due to context-size rotation. Before that happens, write a compact memo of what you should carry forward to your next session on the same conversation.
|
|
2
2
|
|
|
3
3
|
Include only durable facts a future turn would otherwise have to rediscover:
|
|
4
4
|
- Names, handles, agent ids, telegram/whatsapp/gitlab usernames
|
|
@@ -8,8 +8,9 @@ Include only durable facts a future turn would otherwise have to rediscover:
|
|
|
8
8
|
- Identifiers (issue numbers, PR numbers, ticket ids) the user referred to
|
|
9
9
|
|
|
10
10
|
Do not restate the state of an outside system (billing, account, plan, outage, deploy) unless you checked it in this session; then say how and when you checked (e.g. "active per GET /v1/user, 2026-09-28").
|
|
11
|
+
Never note usage limits, plan windows, reset times or holds: the node reports them live (agentx_node).
|
|
11
12
|
|
|
12
13
|
Format: 3-12 short bullet points. Each \u2264120 chars. No prose, no preamble, no header. If the session was uninformative or just casual chat, reply with exactly the literal text "(no memo)".
|
|
13
14
|
|
|
14
|
-
Begin the memo now.`;async function
|
|
15
|
-
//# sourceMappingURL=rotation-memo-
|
|
15
|
+
Begin the memo now.`;async function v(n,r){let c=Date.now();if(!r)return{memo:null,reason:"no-resume",durationMs:0};let i=["-p",y,"--output-format","json","--resume",r,"--model",w];n.permissionMode==="bypassPermissions"&&i.push("--dangerously-skip-permissions");let d=m(u(n.workspace),n.billing);return new Promise(p=>{let a=!1,e=(t,s)=>{a||(a=!0,p({memo:t,reason:s,durationMs:Date.now()-c}))};f("claude",i,{cwd:n.workspace,env:d,timeout:g,maxBuffer:1024*1024},(t,s,b)=>{if(t)return t.killed?e(null,"timeout"):e(null,`error:${t.message.slice(0,80)}`);try{let l=JSON.parse(s||"{}"),o=typeof l.result=="string"?l.result.trim():"";if(!o||o==="(no memo)")return e(null,"empty");let h=o.length>4096?o.slice(0,4096)+"\u2026":o;return e(h,"ok")}catch{return e(null,"parse-error")}}).on("error",()=>e(null,"spawn-error"))})}export{v as extractRotationMemo};
|
|
16
|
+
//# sourceMappingURL=rotation-memo-26CFE4JN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/agents/rotation-memo.ts"],"sourcesContent":["import { execFile } from \"child_process\"\nimport type { AgentDef } from \"@/daemon/config\"\nimport { buildAgentEnv, claudeBillingEnv } from \"@/utils/workspace-env\"\n\n// --- Pre-rotation memo extraction ---\n//\n// Just before agentx clears `claudeSessionId` (tier-2 / max-turns / stale\n// rotation), we ask the dying Claude session to dump the facts and\n// decisions it should carry forward. The agent has full working-memory\n// of its tool-use history at this moment — the only chance to capture\n// it before --resume is dropped and the next turn starts with a blank\n// session.\n//\n// The memo persists into MemoryStore, where the existing findRelevant\n// path injects it into future turns naturally. No new wiring on the\n// read side; one-shot LLM call on the write side.\n//\n// Hard rule: never block rotation. Timeout, errors, empty memos all\n// mean \"skip this round of memo capture\". Memory continuity is a\n// best-effort enhancement, not a correctness requirement.\n\nconst MEMO_TIMEOUT_MS = 30_000\nconst MEMO_MODEL = \"haiku\" // cheapest fast model — memo is summarisation, not reasoning\n\nconst MEMO_PROMPT =\n \"You are about to lose this working session due to context-size rotation. \" +\n \"Before that happens, write a compact memo of what you should carry forward \" +\n \"to your next session on the same conversation.\\n\\n\" +\n \"Include only durable facts a future turn would otherwise have to rediscover:\\n\" +\n \"- Names, handles, agent ids, telegram/whatsapp/gitlab usernames\\n\" +\n \"- File paths, URLs, project namespaces, ssh hosts, ports\\n\" +\n \"- Decisions made and their reasoning\\n\" +\n \"- Open tasks or commitments to follow up on\\n\" +\n \"- Identifiers (issue numbers, PR numbers, ticket ids) the user referred to\\n\\n\" +\n \"Do not restate the state of an outside system (billing, account, plan, outage, \" +\n \"deploy) unless you checked it in this session; then say how and when you checked \" +\n \"(e.g. \\\"active per GET /v1/user, 2026-09-28\\\").\\n\" +\n \"Never note usage limits, plan windows, reset times or holds: the node reports them live (agentx_node).\\n\\n\" +\n \"Format: 3-12 short bullet points. Each ≤120 chars. No prose, no preamble, \" +\n \"no header. If the session was uninformative or just casual chat, reply with \" +\n \"exactly the literal text \\\"(no memo)\\\".\\n\\n\" +\n \"Begin the memo now.\"\n\nexport interface RotationMemoResult {\n /** The extracted memo text, or null when extraction failed/skipped. */\n memo: string | null\n /** Why we skipped or what happened — \"ok\", \"timeout\", \"error\", \"empty\", \"no-resume\". */\n reason: string\n /** Wall-clock time spent in the extractor. */\n durationMs: number\n}\n\n/** Ask the dying Claude session for a carry-forward memo. Spawns one\n * short claude CLI call with --resume on the about-to-be-dropped\n * session id, asks for a compact memo, returns the text. Never throws\n * — every failure mode resolves with `memo=null` so the caller can\n * proceed with the rotation regardless. */\nexport async function extractRotationMemo(\n agent: AgentDef,\n resumeSessionId: string | undefined,\n): Promise<RotationMemoResult> {\n const start = Date.now()\n if (!resumeSessionId) {\n return { memo: null, reason: \"no-resume\", durationMs: 0 }\n }\n\n const args: string[] = [\n \"-p\", MEMO_PROMPT,\n \"--output-format\", \"json\",\n \"--resume\", resumeSessionId,\n \"--model\", MEMO_MODEL,\n ]\n if (agent.permissionMode === \"bypassPermissions\") {\n args.push(\"--dangerously-skip-permissions\")\n }\n\n const env = claudeBillingEnv(buildAgentEnv(agent.workspace), agent.billing)\n\n return new Promise<RotationMemoResult>((resolve) => {\n let settled = false\n const finish = (memo: string | null, reason: string) => {\n if (settled) return\n settled = true\n resolve({ memo, reason, durationMs: Date.now() - start })\n }\n\n const child = execFile(\n \"claude\",\n args,\n {\n cwd: agent.workspace,\n env,\n timeout: MEMO_TIMEOUT_MS,\n maxBuffer: 1024 * 1024, // 1 MB; the memo itself is tiny\n },\n (err, stdout, _stderr) => {\n if (err) {\n // execFile signals timeout via signal SIGTERM + err.killed\n if ((err as NodeJS.ErrnoException & { killed?: boolean }).killed) {\n return finish(null, \"timeout\")\n }\n return finish(null, `error:${err.message.slice(0, 80)}`)\n }\n try {\n const data = JSON.parse(stdout || \"{}\")\n // claude -p --output-format json yields { result, ... }\n const text = typeof data.result === \"string\" ? data.result.trim() : \"\"\n if (!text || text === \"(no memo)\") return finish(null, \"empty\")\n // Defensive cap: memos > 4 KB are almost certainly the LLM\n // ignoring instructions and dumping prose. Truncate.\n const capped = text.length > 4096 ? text.slice(0, 4096) + \"…\" : text\n return finish(capped, \"ok\")\n } catch {\n return finish(null, \"parse-error\")\n }\n },\n )\n child.on(\"error\", () => finish(null, \"spawn-error\"))\n })\n}\n"],"mappings":"2EAAA,OAAS,YAAAA,MAAgB,gBAqBzB,IAAMC,EAAkB,IAClBC,EAAa,QAEbC,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAgCF,eAAsBC,EACpBC,EACAC,EAC6B,CAC7B,IAAMC,EAAQ,KAAK,IAAI,EACvB,GAAI,CAACD,EACH,MAAO,CAAE,KAAM,KAAM,OAAQ,YAAa,WAAY,CAAE,EAG1D,IAAME,EAAiB,CACrB,KAAML,EACN,kBAAmB,OACnB,WAAYG,EACZ,UAAWJ,CACb,EACIG,EAAM,iBAAmB,qBAC3BG,EAAK,KAAK,gCAAgC,EAG5C,IAAMC,EAAMC,EAAiBC,EAAcN,EAAM,SAAS,EAAGA,EAAM,OAAO,EAE1E,OAAO,IAAI,QAA6BO,GAAY,CAClD,IAAIC,EAAU,GACRC,EAAS,CAACC,EAAqBC,IAAmB,CAClDH,IACJA,EAAU,GACVD,EAAQ,CAAE,KAAAG,EAAM,OAAAC,EAAQ,WAAY,KAAK,IAAI,EAAIT,CAAM,CAAC,EAC1D,EAEcU,EACZ,SACAT,EACA,CACE,IAAKH,EAAM,UACX,IAAAI,EACA,QAASR,EACT,UAAW,KAAO,IACpB,EACA,CAACiB,EAAKC,EAAQC,IAAY,CACxB,GAAIF,EAEF,OAAKA,EAAqD,OACjDJ,EAAO,KAAM,SAAS,EAExBA,EAAO,KAAM,SAASI,EAAI,QAAQ,MAAM,EAAG,EAAE,GAAG,EAEzD,GAAI,CACF,IAAMG,EAAO,KAAK,MAAMF,GAAU,IAAI,EAEhCG,EAAO,OAAOD,EAAK,QAAW,SAAWA,EAAK,OAAO,KAAK,EAAI,GACpE,GAAI,CAACC,GAAQA,IAAS,YAAa,OAAOR,EAAO,KAAM,OAAO,EAG9D,IAAMS,EAASD,EAAK,OAAS,KAAOA,EAAK,MAAM,EAAG,IAAI,EAAI,SAAMA,EAChE,OAAOR,EAAOS,EAAQ,IAAI,CAC5B,MAAE,CACA,OAAOT,EAAO,KAAM,aAAa,CACnC,CACF,CACF,EACM,GAAG,QAAS,IAAMA,EAAO,KAAM,aAAa,CAAC,CACrD,CAAC,CACH","names":["execFile","MEMO_TIMEOUT_MS","MEMO_MODEL","MEMO_PROMPT","extractRotationMemo","agent","resumeSessionId","start","args","env","claudeBillingEnv","buildAgentEnv","resolve","settled","finish","memo","reason","execFile","err","stdout","_stderr","data","text","capped"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{f as o}from"./chunk-XVV7ZZ77.js";import"./chunk-5ONH4ITT.js";import"./chunk-JRAG37V5.js";import"./chunk-ILEC3IAV.js";import"./chunk-OWNQ2FD4.js";import"./chunk-A7JSRDJL.js";import"./chunk-QIJLFPWE.js";function s(r,n,t){let e=o(t.wikiDir,t.memo,{agentId:t.agentId,origin:t.reason==="continuity"?"continuity-memo":`rotation-memo:${t.reason}`,chat:`${t.channel}:${t.chatId}`});if(e.workState.trim()){let a=t.chatId.split(/[:@.]/).filter(Boolean).slice(0,4);r.addMemory(t.agentId,{agentId:t.agentId,category:"task-state",content:`[Rotation memo \xB7 ${t.reason}] ${e.workState}`,keywords:["rotation-memo",t.channel,...a],source:{channel:t.channel,chatId:t.chatId,sender:"system:rotation",date:new Date().toISOString().slice(0,10)}})}return n.setRotationMemo(t.agentId,t.channel,t.chatId,e.pinned,t.reason),{proposals:e.proposals.length,...e.error?{error:e.error}:{}}}export{s as storeRotationMemo};
|
|
2
|
+
//# sourceMappingURL=rotation-memo-store-WMDI7NND.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/agents/rotation-memo-store.ts"],"sourcesContent":["import { routeMemo } from \"@/wiki/facts/fact-proposals\"\nimport type { MemoryStore } from \"./memory-store\"\n\n// --- Where a session memo goes once it is written (#273) ---\n//\n// A summary may carry work state, never new facts. Claims about outside\n// systems (billing, account, outage, deploy) become wiki fact proposals\n// with their provenance; only work state is kept as memory, where it\n// expires like other task state. The per-chat pinned copy, read by the\n// next fresh session, keeps the claims but marks each one UNVERIFIED.\n\nexport interface StoreMemoInput {\n wikiDir: string\n agentId: string\n channel: string\n chatId: string\n reason: string\n memo: string\n}\n\nexport function storeRotationMemo(\n memory: Pick<MemoryStore, \"addMemory\">,\n sessions: { setRotationMemo(agentId: string, channel: string, chatId: string, memo: string, reason: string): void },\n m: StoreMemoInput,\n): { proposals: number; error?: string } {\n const routed = routeMemo(m.wikiDir, m.memo, {\n agentId: m.agentId,\n origin: m.reason === \"continuity\" ? \"continuity-memo\" : `rotation-memo:${m.reason}`,\n chat: `${m.channel}:${m.chatId}`,\n })\n if (routed.workState.trim()) {\n // Keywords from the chat id let BM25 surface the memo when the same\n // chat continues; without them it only floats up as a recent fact.\n const chatKeyword = m.chatId.split(/[:@.]/).filter(Boolean).slice(0, 4)\n memory.addMemory(m.agentId, {\n agentId: m.agentId,\n category: \"task-state\",\n content: `[Rotation memo · ${m.reason}] ${routed.workState}`,\n keywords: [\"rotation-memo\", m.channel, ...chatKeyword],\n source: { channel: m.channel, chatId: m.chatId, sender: \"system:rotation\", date: new Date().toISOString().slice(0, 10) },\n })\n }\n // Pinned per chat for deterministic injection into the next fresh\n // session: BM25 rarely surfaces the memo on the turn right after a\n // rotation, which is exactly when it matters.\n sessions.setRotationMemo(m.agentId, m.channel, m.chatId, routed.pinned, m.reason)\n return { proposals: routed.proposals.length, ...(routed.error ? { error: routed.error } : {}) }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/agents/rotation-memo-store.ts"],"sourcesContent":["import { routeMemo } from \"@/wiki/facts/fact-proposals\"\nimport type { MemoryStore } from \"./memory-store\"\n\n// --- Where a session memo goes once it is written (#273) ---\n//\n// A summary may carry work state, never new facts. Claims about outside\n// systems (billing, account, outage, deploy) become wiki fact proposals\n// with their provenance; only work state is kept as memory, where it\n// expires like other task state. The per-chat pinned copy, read by the\n// next fresh session, keeps the claims but marks each one UNVERIFIED.\n\nexport interface StoreMemoInput {\n wikiDir: string\n agentId: string\n channel: string\n chatId: string\n reason: string\n memo: string\n}\n\nexport function storeRotationMemo(\n memory: Pick<MemoryStore, \"addMemory\">,\n sessions: { setRotationMemo(agentId: string, channel: string, chatId: string, memo: string, reason: string): void },\n m: StoreMemoInput,\n): { proposals: number; error?: string } {\n const routed = routeMemo(m.wikiDir, m.memo, {\n agentId: m.agentId,\n origin: m.reason === \"continuity\" ? \"continuity-memo\" : `rotation-memo:${m.reason}`,\n chat: `${m.channel}:${m.chatId}`,\n })\n if (routed.workState.trim()) {\n // Keywords from the chat id let BM25 surface the memo when the same\n // chat continues; without them it only floats up as a recent fact.\n const chatKeyword = m.chatId.split(/[:@.]/).filter(Boolean).slice(0, 4)\n memory.addMemory(m.agentId, {\n agentId: m.agentId,\n category: \"task-state\",\n content: `[Rotation memo · ${m.reason}] ${routed.workState}`,\n keywords: [\"rotation-memo\", m.channel, ...chatKeyword],\n source: { channel: m.channel, chatId: m.chatId, sender: \"system:rotation\", date: new Date().toISOString().slice(0, 10) },\n })\n }\n // Pinned per chat for deterministic injection into the next fresh\n // session: BM25 rarely surfaces the memo on the turn right after a\n // rotation, which is exactly when it matters.\n sessions.setRotationMemo(m.agentId, m.channel, m.chatId, routed.pinned, m.reason)\n return { proposals: routed.proposals.length, ...(routed.error ? { error: routed.error } : {}) }\n}\n"],"mappings":"gNAoBO,SAASA,EACdC,EACAC,EACAC,EACuC,CACvC,IAAMC,EAASC,EAAUF,EAAE,QAASA,EAAE,KAAM,CAC1C,QAASA,EAAE,QACX,OAAQA,EAAE,SAAW,aAAe,kBAAoB,iBAAiBA,EAAE,SAC3E,KAAM,GAAGA,EAAE,WAAWA,EAAE,QAC1B,CAAC,EACD,GAAIC,EAAO,UAAU,KAAK,EAAG,CAG3B,IAAME,EAAcH,EAAE,OAAO,MAAM,OAAO,EAAE,OAAO,OAAO,EAAE,MAAM,EAAG,CAAC,EACtEF,EAAO,UAAUE,EAAE,QAAS,CAC1B,QAASA,EAAE,QACX,SAAU,aACV,QAAS,uBAAoBA,EAAE,WAAWC,EAAO,YACjD,SAAU,CAAC,gBAAiBD,EAAE,QAAS,GAAGG,CAAW,EACrD,OAAQ,CAAE,QAASH,EAAE,QAAS,OAAQA,EAAE,OAAQ,OAAQ,kBAAmB,KAAM,IAAI,KAAK,EAAE,YAAY,EAAE,MAAM,EAAG,EAAE,CAAE,CACzH,CAAC,EAKH,OAAAD,EAAS,gBAAgBC,EAAE,QAASA,EAAE,QAASA,EAAE,OAAQC,EAAO,OAAQD,EAAE,MAAM,EACzE,CAAE,UAAWC,EAAO,UAAU,OAAQ,GAAIA,EAAO,MAAQ,CAAE,MAAOA,EAAO,KAAM,EAAI,CAAC,CAAG,CAChG","names":["storeRotationMemo","memory","sessions","m","routed","routeMemo","chatKeyword"]}
|
|
@@ -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-34O2GH4J.js";import"./chunk-3NMBTBNW.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-ZCBTTYQN.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.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-2KWP5TAT.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b}from"./chunk-YOMLHG33.js";import"./chunk-RKPAVWXF.js";import"./chunk-OTCMYGQR.js";import"./chunk-U5B275AU.js";import"./chunk-YFJVQOWI.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-ZCBTTYQN.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";export{b as resolveScheduleCaller,a as runScheduleTool};
|
|
2
|
+
//# sourceMappingURL=schedule-tool-2UNMXEBQ.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}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=scheduler-
|
|
1
|
+
import{o as a,p as b,q as c,r as d,s as e,t as f}from"./chunk-U5B275AU.js";import"./chunk-YFJVQOWI.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-ZCBTTYQN.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.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-VN7WDAKE.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-3NMBTBNW.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-ZCBTTYQN.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.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-MAC3QGGD.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-3NMBTBNW.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-ZCBTTYQN.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.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-UYKEN4N4.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=set-enabled-
|
|
1
|
+
import{b as a}from"./chunk-YFJVQOWI.js";import"./chunk-ZCBTTYQN.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.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-JEUIINT3.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{b as $}from"./chunk-
|
|
1
|
+
import{b as $}from"./chunk-YOMLHG33.js";import"./chunk-RKPAVWXF.js";import"./chunk-OTCMYGQR.js";import{b as p}from"./chunk-AJ5HMDRW.js";import"./chunk-KP7KDLZ2.js";import"./chunk-U5B275AU.js";import"./chunk-YFJVQOWI.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-ZCBTTYQN.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.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-MB2MPR4K.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as $}from"./chunk-
|
|
1
|
+
import{b as $}from"./chunk-YOMLHG33.js";import"./chunk-RKPAVWXF.js";import{h as m}from"./chunk-RX5O5637.js";import"./chunk-OTCMYGQR.js";import"./chunk-U5B275AU.js";import"./chunk-YFJVQOWI.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-ZCBTTYQN.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.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-L4CQCPRF.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as f}from"./chunk-
|
|
1
|
+
import{b as f}from"./chunk-YOMLHG33.js";import"./chunk-RKPAVWXF.js";import{g as y}from"./chunk-MNG2AMKZ.js";import"./chunk-OTCMYGQR.js";import{b as u}from"./chunk-AJ5HMDRW.js";import"./chunk-KP7KDLZ2.js";import"./chunk-U5B275AU.js";import"./chunk-YFJVQOWI.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-ZCBTTYQN.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.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=f(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"?y(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-SZ6C6EBP.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{b as w}from"./chunk-
|
|
1
|
+
import{b as w}from"./chunk-YOMLHG33.js";import"./chunk-RKPAVWXF.js";import{d as h,e as u}from"./chunk-QPABR72X.js";import"./chunk-OTCMYGQR.js";import{b as f}from"./chunk-AJ5HMDRW.js";import"./chunk-KP7KDLZ2.js";import"./chunk-U5B275AU.js";import"./chunk-YFJVQOWI.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-ZCBTTYQN.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";var g=45e3,q=t=>typeof t=="string"?t.trim():"",y={in_progress:"in progress",waiting_owner:"waiting on the owner",waiting_other:"waiting on another agent",needs_attention:"needs attention"};function v(t){return t.length?t.map(e=>{let a=new Date(e.createdAt).toISOString().slice(0,16).replace("T"," "),d=e.state==="waiting_owner"&&e.question?` Question: ${e.question}`:e.state==="needs_attention"&&e.attentionReason?` ${e.attentionReason}`:"",o=String(e.text).replace(/\s+/g," ").trim(),c=[e.promise&&e.owedTo?` Promised to ${e.owedTo}.`:"",e.dueAt?` Due ${new Date(e.dueAt).toISOString().slice(0,16).replace("T"," ")} UTC.`:"",e.closeWhen?` Closes on its check (${e.closeWhen.kind})${e.verifyState?`: ${e.verifyState}`:""}.`:"",h(e)?" Awaiting QA.":e.qa?` QA: ${u(e.qa)}.`:"",e.goal?` Goal: ${e.goal.title} (${e.goal.id}).`:""].join("");return`- ${e.id} [${y[e.state]??e.state}] ${a} UTC, ${e.channel}, ${e.agentId}: ${o.length>160?`${o.slice(0,159)}\u2026`:o}.${d}${c}`}).join(`
|
|
2
2
|
`):"No open requests."}function T(t){return`$${t>0&&t<.01?t.toFixed(3):t.toFixed(2)}`}function k(t){return t.length?t.map(e=>{let a=e.progress===null?"nothing open or done":`${Math.round(e.progress*100)}% done`,d=e.unpriced?`, ${e.unpriced} of ${e.runs} runs without a cost`:"";return`- ${e.id} "${e.title}": ${e.open} open, ${e.done} done${e.dropped?`, ${e.dropped} declined or dropped`:""} (${a}). Cost ${T(e.costUsd)}${d}.`}).join(`
|
|
3
3
|
`):"No request names a goal."}function m(t){return(t??[]).map(e=>`${e.idx}. ${e.name} (${e.agentId}, ${e.kind}) [${e.state}]${e.needsApproval?` approval: ${e.approval}`:""}`)}async function I(t,e){let a=e.fetch??fetch,d=e.daemonUrl.replace(/\/$/,""),o=(q(t.action)||"list").toLowerCase();try{if(o==="goals"){let r=await a(`${d}/requests/goals`,{signal:AbortSignal.timeout(1e4)}),s=await r.json().catch(()=>({}));return r.ok?`${s.count} goal${s.count===1?"":"s"}, most recently active first.
|
|
4
4
|
${k(s.goals??[])}`:`Error: ${s?.error||`HTTP ${r.status}`}`}if(o==="list"){let r=await a(`${d}/requests`,{signal:AbortSignal.timeout(1e4)}),s=await r.json().catch(()=>({}));return r.ok?s.enabled?`${s.count} open request${s.count===1?"":"s"}, oldest first.
|
|
5
5
|
${v(s.items??[])}`:"Requests are turned off on this node (requests.enabled), so nothing is recorded.":`Error: ${s?.error||`HTTP ${r.status}`}`}let c=e.env??process.env,p=w(t,c);if(!p)return"Error: couldn't tell which agent you are. Pass callerAgentId.";let l=await a(`${d}/requests`,{method:"POST",headers:{"Content-Type":"application/json",...f(c)},body:JSON.stringify({action:o,agentId:p.agentId,id:t.id,question:t.question,evidence:t.evidence,proof:t.proof,reason:t.reason,steps:t.steps,work:t.work,estimateMinutes:t.estimateMinutes,step:t.step,status:t.status,note:t.note,home:t.home,owedTo:t.owedTo,text:t.text,due:t.due,closeWhen:t.closeWhen,headline:t.headline,need:t.need,needsQa:t.needsQa,verdict:t.verdict,goal:t.goal}),signal:AbortSignal.timeout(o==="done"?g:1e4)}),i=await l.json().catch(()=>({}));if(!l.ok)return`Error: ${i?.error||`HTTP ${l.status}`}`;let n=i.request,$=n.goal?` It serves the goal "${n.goal.title}" (${n.goal.id}).`:"";if(o==="accept"&&i.plan)return[`Request ${n.id} is open with a plan of ${i.steps.length} steps.${$} 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.`,...m(i.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:"${n.id}", step:<n>, status:"progress"|"done"|"blocked"}.`].join(`
|
|
6
6
|
`);if(o==="step")return[`Step reported. Plan of ${n.id}:`,...m(i.steps)].join(`
|
|
7
7
|
`);if(o==="qa")return`Verdict recorded on ${n.id}: ${u(n.qa)}. It shows on the request's card; nobody is told.`;if(o==="describe")return`Request ${n.id} now reads "${n.headline??"(no headline)"}" on the owner's cards. Needed from them: ${n.need??"what follows from where it stands"}.`;if(o==="accept")return`Request ${n.id} is open and in progress.${$} 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(o==="wait")return`Request ${n.id} is waiting on the owner with your question. Ask them the question now, once.`;if(o==="promise")return`Promise ${n.id} is open, owed to ${n.owedTo}${n.dueAt?`, due ${new Date(n.dueAt).toISOString().slice(0,16).replace("T"," ")} UTC`:""}. `+(n.closeWhen?"The daemon checks its evidence and closes it once the check is met.":`Close it with {action:"done", id:"${n.id}", evidence:"<link>"} when it is kept.`);if(o==="done"&&i.verify==="unverified")return`Request ${n.id} stays open: its check could not say whether it is finished (${i.detail}). It is marked unverified; the daemon checks again, and the owner can close it by hand.`;if(o==="done"){let r=n.factId?` It left fact ${n.factId} in the wiki (agentx wiki facts show ${n.factId}).`:"";return`Request ${n.id} is closed as done${i.verified?" (its check was met)":""}. Evidence: ${n.evidence}${r}`}return`Request ${n.id} is closed as declined. Reason: ${n.closeReason}`}catch(c){return`Error: couldn't reach the daemon (${c?.message??c}).`}}export{g as DONE_TIMEOUT_MS,k as describeGoals,v as describeOpen,m as describeSteps,I as runRequestTool,T as usd};
|
|
8
|
-
//# sourceMappingURL=tool-
|
|
8
|
+
//# sourceMappingURL=tool-TLXKW55S.js.map
|