agentix-cli 0.215.0 → 0.216.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-OUWMH6QG.js → App-YGVVIKZD.js} +2 -2
- package/dist/{ChatApp-EZ5A47FV.js → ChatApp-6TEK2WMU.js} +2 -2
- package/dist/{absorb-eval-WM6JQGYG.js → absorb-eval-MJ475CNV.js} +2 -2
- package/dist/{adapter-W26OC6ET.js → adapter-C6YORAE6.js} +2 -2
- package/dist/{agent-KOKQSRAH.js → agent-44SGRWX2.js} +2 -2
- package/dist/{board-dashboard-NVQUQSWI.js → board-dashboard-TZKV4DFV.js} +13 -13
- package/dist/{board-dashboard-NVQUQSWI.js.map → board-dashboard-TZKV4DFV.js.map} +1 -1
- package/dist/{chunk-GGAEFVXL.js → chunk-2KQECT4H.js} +2 -2
- package/dist/{chunk-ACPGDZOV.js → chunk-2ZNYIHRB.js} +2 -2
- package/dist/{chunk-CSC45PA7.js → chunk-3UATFGSB.js} +2 -2
- package/dist/chunk-4A6UVU2X.js +134 -0
- package/dist/chunk-4A6UVU2X.js.map +1 -0
- package/dist/{chunk-XHON5WB5.js → chunk-5SQRJUAK.js} +3 -3
- package/dist/{chunk-QR3P5RG7.js → chunk-7OJUZ3L5.js} +2 -2
- package/dist/{chunk-CAH6TNC6.js → chunk-AU7SN4G3.js} +2 -2
- package/dist/{chunk-MIUITI47.js → chunk-BLKXK27S.js} +2 -2
- package/dist/{chunk-QOGZD6Z3.js → chunk-F2XNWKIL.js} +443 -400
- package/dist/chunk-F2XNWKIL.js.map +1 -0
- package/dist/{chunk-H4DWZIU7.js → chunk-F32VADB7.js} +2 -2
- package/dist/{chunk-4DCQIHWU.js → chunk-GEKJQ7VV.js} +2 -2
- package/dist/chunk-I4E6BH27.js +20 -0
- package/dist/chunk-I4E6BH27.js.map +1 -0
- package/dist/{chunk-PSYHAO57.js → chunk-IKXDCPXS.js} +2 -2
- package/dist/{chunk-ZRBTLW2B.js → chunk-JMWPBZLU.js} +2 -2
- package/dist/{chunk-QMICGPM6.js → chunk-JNBUJKNG.js} +2 -2
- package/dist/{chunk-HY4PE6R3.js → chunk-JTS563OC.js} +2 -2
- package/dist/{chunk-N476XZD3.js → chunk-LDSBFDYB.js} +2 -2
- package/dist/{chunk-B7HDWFKR.js → chunk-LJUBWMPB.js} +2 -2
- package/dist/{chunk-Q7Y5VQGX.js → chunk-MH7KJQ4N.js} +2 -2
- package/dist/{chunk-UUOCCLIL.js → chunk-MOEXP6U3.js} +2 -2
- package/dist/{chunk-JKMFKNGS.js → chunk-PA7CP74O.js} +2 -2
- package/dist/{chunk-JEBU5JUM.js → chunk-SZXFWCKA.js} +2 -2
- package/dist/{chunk-J2R47R56.js → chunk-T3B7OUDC.js} +2 -2
- package/dist/{chunk-Z7632XS3.js → chunk-T7SD5EVH.js} +2 -2
- package/dist/{chunk-4BYJN2A3.js → chunk-TFHJT2AZ.js} +2 -2
- package/dist/{chunk-IHFOW4JF.js → chunk-TO6T6AQY.js} +2 -2
- package/dist/{chunk-OQNJIIR2.js → chunk-U5DSMDCJ.js} +2 -2
- package/dist/{chunk-JLH73NRM.js → chunk-WLDRIJQX.js} +5 -5
- package/dist/{chunk-JLH73NRM.js.map → chunk-WLDRIJQX.js.map} +1 -1
- package/dist/{chunk-7AFXLWWW.js → chunk-XXFVK5D7.js} +2 -2
- package/dist/{chunk-7AFXLWWW.js.map → chunk-XXFVK5D7.js.map} +1 -1
- package/dist/{chunk-4ZD2C76P.js → chunk-YTWRIIAT.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/client-SJLHZDIC.js +2 -0
- package/dist/config-Q3ENZQYL.js +2 -0
- package/dist/config-mutate-NNAUMQ2Y.js +2 -0
- package/dist/config-mutator-2F2BJNMA.js +2 -0
- package/dist/{contributions-FXUTKU6R.js → contributions-SOUGZCAH.js} +2 -2
- package/dist/{doctor-GP2KVKWE.js → doctor-H6I433KY.js} +2 -2
- package/dist/{follow-up-tool-C4PLLZIT.js → follow-up-tool-4FX455DL.js} +2 -2
- package/dist/hub-XFZFHLJK.js +2 -0
- package/dist/index.d.ts +345 -294
- package/dist/index.js +1 -1
- package/dist/{org-tool-6PPIGWH2.js → org-tool-OE5QP6W7.js} +2 -2
- package/dist/{program-WSGVQTFM.js → program-7QFRDJUY.js} +291 -291
- package/dist/program-7QFRDJUY.js.map +1 -0
- package/dist/{promote-CXXMZWWH.js → promote-FQY3HNL6.js} +2 -2
- package/dist/push-bridge-T5HZZRA2.js +1 -1
- package/dist/{query-RPZIRN3X.js → query-LIII4CGT.js} +2 -2
- package/dist/{query-settings-EBOBWOAL.js → query-settings-6LHW2NCF.js} +2 -2
- package/dist/{registry-KRU6AWVW.js → registry-WQNBXOUL.js} +2 -2
- package/dist/{request-planner-LNNKTY7K.js → request-planner-HYYT3W7X.js} +2 -2
- package/dist/{review-candidates-HQBKXAJA.js → review-candidates-JOCZEZ2L.js} +2 -2
- package/dist/routing-D7W4BDER.js +2 -0
- package/dist/schedule-tool-B4RDOKCN.js +2 -0
- package/dist/scheduler-JHY767T4.js +2 -0
- package/dist/{seat-BSWBTNCP.js → seat-44NEMWB5.js} +2 -2
- package/dist/{select-T4F42G6W.js → select-5FMPLCCG.js} +2 -2
- package/dist/{set-enabled-UK4TPVC7.js → set-enabled-GVQFNLOS.js} +2 -2
- package/dist/{sprint-tool-DN3BKLUY.js → sprint-tool-X3A5VPJP.js} +2 -2
- package/dist/{tool-ZCSGJ2ZF.js → tool-H7RMHTXM.js} +2 -2
- package/dist/{tool-JJGEGQF3.js → tool-ILYSRPZ5.js} +2 -2
- package/dist/{tool-L3CQUOAZ.js → tool-KCOCIAFM.js} +2 -2
- package/dist/{tool-ZVYUWVJQ.js → tool-QIS3CLU2.js} +2 -2
- package/dist/tool-Z7TIGVEW.js +7 -0
- package/dist/tool-Z7TIGVEW.js.map +1 -0
- package/dist/wiki-UMPPYYFR.js +2 -0
- package/dist/wiki-enrich-UVCZ7GTW.js +2 -0
- package/package.json +1 -1
- package/dist/chunk-35UGFFHA.js +0 -20
- package/dist/chunk-35UGFFHA.js.map +0 -1
- package/dist/chunk-KAM4ZWRE.js +0 -133
- package/dist/chunk-KAM4ZWRE.js.map +0 -1
- package/dist/chunk-QOGZD6Z3.js.map +0 -1
- package/dist/client-U3OFNJ5W.js +0 -2
- package/dist/config-S522VXLI.js +0 -2
- package/dist/config-mutate-KBZV2T4X.js +0 -2
- package/dist/config-mutator-YNNEGRV3.js +0 -2
- package/dist/hub-V2AGLA7T.js +0 -2
- package/dist/program-WSGVQTFM.js.map +0 -1
- package/dist/routing-XXA7GIBA.js +0 -2
- package/dist/schedule-tool-65TFOUWK.js +0 -2
- package/dist/scheduler-DIPOBJBF.js +0 -2
- package/dist/wiki-IDLRJ6WL.js +0 -2
- package/dist/wiki-enrich-XWLDJAZI.js +0 -2
- /package/dist/{App-OUWMH6QG.js.map → App-YGVVIKZD.js.map} +0 -0
- /package/dist/{ChatApp-EZ5A47FV.js.map → ChatApp-6TEK2WMU.js.map} +0 -0
- /package/dist/{absorb-eval-WM6JQGYG.js.map → absorb-eval-MJ475CNV.js.map} +0 -0
- /package/dist/{adapter-W26OC6ET.js.map → adapter-C6YORAE6.js.map} +0 -0
- /package/dist/{agent-KOKQSRAH.js.map → agent-44SGRWX2.js.map} +0 -0
- /package/dist/{chunk-GGAEFVXL.js.map → chunk-2KQECT4H.js.map} +0 -0
- /package/dist/{chunk-ACPGDZOV.js.map → chunk-2ZNYIHRB.js.map} +0 -0
- /package/dist/{chunk-CSC45PA7.js.map → chunk-3UATFGSB.js.map} +0 -0
- /package/dist/{chunk-XHON5WB5.js.map → chunk-5SQRJUAK.js.map} +0 -0
- /package/dist/{chunk-QR3P5RG7.js.map → chunk-7OJUZ3L5.js.map} +0 -0
- /package/dist/{chunk-CAH6TNC6.js.map → chunk-AU7SN4G3.js.map} +0 -0
- /package/dist/{chunk-MIUITI47.js.map → chunk-BLKXK27S.js.map} +0 -0
- /package/dist/{chunk-H4DWZIU7.js.map → chunk-F32VADB7.js.map} +0 -0
- /package/dist/{chunk-4DCQIHWU.js.map → chunk-GEKJQ7VV.js.map} +0 -0
- /package/dist/{chunk-PSYHAO57.js.map → chunk-IKXDCPXS.js.map} +0 -0
- /package/dist/{chunk-ZRBTLW2B.js.map → chunk-JMWPBZLU.js.map} +0 -0
- /package/dist/{chunk-QMICGPM6.js.map → chunk-JNBUJKNG.js.map} +0 -0
- /package/dist/{chunk-HY4PE6R3.js.map → chunk-JTS563OC.js.map} +0 -0
- /package/dist/{chunk-N476XZD3.js.map → chunk-LDSBFDYB.js.map} +0 -0
- /package/dist/{chunk-B7HDWFKR.js.map → chunk-LJUBWMPB.js.map} +0 -0
- /package/dist/{chunk-Q7Y5VQGX.js.map → chunk-MH7KJQ4N.js.map} +0 -0
- /package/dist/{chunk-UUOCCLIL.js.map → chunk-MOEXP6U3.js.map} +0 -0
- /package/dist/{chunk-JKMFKNGS.js.map → chunk-PA7CP74O.js.map} +0 -0
- /package/dist/{chunk-JEBU5JUM.js.map → chunk-SZXFWCKA.js.map} +0 -0
- /package/dist/{chunk-J2R47R56.js.map → chunk-T3B7OUDC.js.map} +0 -0
- /package/dist/{chunk-Z7632XS3.js.map → chunk-T7SD5EVH.js.map} +0 -0
- /package/dist/{chunk-4BYJN2A3.js.map → chunk-TFHJT2AZ.js.map} +0 -0
- /package/dist/{chunk-IHFOW4JF.js.map → chunk-TO6T6AQY.js.map} +0 -0
- /package/dist/{chunk-OQNJIIR2.js.map → chunk-U5DSMDCJ.js.map} +0 -0
- /package/dist/{chunk-4ZD2C76P.js.map → chunk-YTWRIIAT.js.map} +0 -0
- /package/dist/{client-U3OFNJ5W.js.map → client-SJLHZDIC.js.map} +0 -0
- /package/dist/{config-S522VXLI.js.map → config-Q3ENZQYL.js.map} +0 -0
- /package/dist/{config-mutate-KBZV2T4X.js.map → config-mutate-NNAUMQ2Y.js.map} +0 -0
- /package/dist/{config-mutator-YNNEGRV3.js.map → config-mutator-2F2BJNMA.js.map} +0 -0
- /package/dist/{contributions-FXUTKU6R.js.map → contributions-SOUGZCAH.js.map} +0 -0
- /package/dist/{doctor-GP2KVKWE.js.map → doctor-H6I433KY.js.map} +0 -0
- /package/dist/{follow-up-tool-C4PLLZIT.js.map → follow-up-tool-4FX455DL.js.map} +0 -0
- /package/dist/{hub-V2AGLA7T.js.map → hub-XFZFHLJK.js.map} +0 -0
- /package/dist/{org-tool-6PPIGWH2.js.map → org-tool-OE5QP6W7.js.map} +0 -0
- /package/dist/{promote-CXXMZWWH.js.map → promote-FQY3HNL6.js.map} +0 -0
- /package/dist/{query-RPZIRN3X.js.map → query-LIII4CGT.js.map} +0 -0
- /package/dist/{query-settings-EBOBWOAL.js.map → query-settings-6LHW2NCF.js.map} +0 -0
- /package/dist/{registry-KRU6AWVW.js.map → registry-WQNBXOUL.js.map} +0 -0
- /package/dist/{request-planner-LNNKTY7K.js.map → request-planner-HYYT3W7X.js.map} +0 -0
- /package/dist/{review-candidates-HQBKXAJA.js.map → review-candidates-JOCZEZ2L.js.map} +0 -0
- /package/dist/{routing-XXA7GIBA.js.map → routing-D7W4BDER.js.map} +0 -0
- /package/dist/{schedule-tool-65TFOUWK.js.map → schedule-tool-B4RDOKCN.js.map} +0 -0
- /package/dist/{scheduler-DIPOBJBF.js.map → scheduler-JHY767T4.js.map} +0 -0
- /package/dist/{seat-BSWBTNCP.js.map → seat-44NEMWB5.js.map} +0 -0
- /package/dist/{select-T4F42G6W.js.map → select-5FMPLCCG.js.map} +0 -0
- /package/dist/{set-enabled-UK4TPVC7.js.map → set-enabled-GVQFNLOS.js.map} +0 -0
- /package/dist/{sprint-tool-DN3BKLUY.js.map → sprint-tool-X3A5VPJP.js.map} +0 -0
- /package/dist/{tool-ZCSGJ2ZF.js.map → tool-H7RMHTXM.js.map} +0 -0
- /package/dist/{tool-JJGEGQF3.js.map → tool-ILYSRPZ5.js.map} +0 -0
- /package/dist/{tool-L3CQUOAZ.js.map → tool-KCOCIAFM.js.map} +0 -0
- /package/dist/{tool-ZVYUWVJQ.js.map → tool-QIS3CLU2.js.map} +0 -0
- /package/dist/{wiki-IDLRJ6WL.js.map → wiki-UMPPYYFR.js.map} +0 -0
- /package/dist/{wiki-enrich-XWLDJAZI.js.map → wiki-enrich-UVCZ7GTW.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-SZXFWCKA.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-MEFPXHQJ.js";import"./chunk-JMWPBZLU.js";import"./chunk-T7SD5EVH.js";import"./chunk-WPNRDEHW.js";import"./chunk-OWNQ2FD4.js";import"./chunk-AHWWJ7AF.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-BLKXK27S.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-FQY3HNL6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i}from"./chunk-3Q6MRG3P.js";import"./chunk-2VDO2HEK.js";import"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i}from"./chunk-3Q6MRG3P.js";import"./chunk-2VDO2HEK.js";import"./chunk-JWDJMFU6.js";import"./chunk-2P5NP4H6.js";import"./chunk-B4KQC3DG.js";import"./chunk-7AB3QUGH.js";import"./chunk-YSCT6DPR.js";import"./chunk-QIJLFPWE.js";export{i as PushRosterSync,a as ROSTER_CHECK_MS,b as ROSTER_RESEND_MS,h as handlePushBridge,g as peerOrigins,d as pushBridgeCaller,c as pushOrigin,f as relayTokenProblem,e as scopedPushTarget};
|
|
2
2
|
//# sourceMappingURL=push-bridge-T5HZZRA2.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-5SQRJUAK.js";import"./chunk-JTFCU5LH.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-BERWTVG2.js";import"./chunk-T7SD5EVH.js";import"./chunk-WPNRDEHW.js";import"./chunk-AHWWJ7AF.js";import"./chunk-BLKXK27S.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-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-LIII4CGT.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-Q3ENZQYL.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-6LHW2NCF.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Aa as e,Ba as f,Ca as g,Da as h,Ea as i,Fa as j,Ga as k,Ha as l,Ia as m,Ja as n,Ka as o,La as p,wa as a,xa as b,ya as c,za as d}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=registry-
|
|
1
|
+
import{Aa as e,Ba as f,Ca as g,Da as h,Ea as i,Fa as j,Ga as k,Ha as l,Ia as m,Ja as n,Ka as o,La as p,wa as a,xa as b,ya as c,za as d}from"./chunk-WLDRIJQX.js";import"./chunk-2KQECT4H.js";import"./chunk-MEFPXHQJ.js";import"./chunk-7AB3QUGH.js";import"./chunk-W4YR2RO2.js";import"./chunk-7YOLZGB5.js";import"./chunk-IH65GDJR.js";import"./chunk-AU7SN4G3.js";import"./chunk-LDSBFDYB.js";import"./chunk-3UOTLMXD.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-KWWBDLE6.js";import"./chunk-HVMUYEQP.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-VWTBHLMX.js";import"./chunk-5SQRJUAK.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-M4H2RYP4.js";import"./chunk-OQQTV3OF.js";import"./chunk-4NZ4T3TQ.js";import"./chunk-LY4G7PCW.js";import"./chunk-DPG6VHPX.js";import"./chunk-BERWTVG2.js";import"./chunk-A7JSRDJL.js";import"./chunk-Z5CMA4JN.js";import"./chunk-TFHJT2AZ.js";import"./chunk-JMWPBZLU.js";import"./chunk-T7SD5EVH.js";import"./chunk-WPNRDEHW.js";import"./chunk-OWNQ2FD4.js";import"./chunk-AHWWJ7AF.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-PA7CP74O.js";import"./chunk-BLKXK27S.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-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-WQNBXOUL.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-BLKXK27S.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-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-HYYT3W7X.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as I}from"./chunk-
|
|
1
|
+
import{b as I}from"./chunk-LJUBWMPB.js";import"./chunk-IH65GDJR.js";import"./chunk-BLKXK27S.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-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-JOCZEZ2L.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c,d,e,f}from"./chunk-PA7CP74O.js";import"./chunk-BLKXK27S.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-D7W4BDER.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b}from"./chunk-MOEXP6U3.js";import"./chunk-RKPAVWXF.js";import"./chunk-F32VADB7.js";import"./chunk-AU7SN4G3.js";import"./chunk-LDSBFDYB.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.js";import"./chunk-QIJLFPWE.js";export{b as resolveScheduleCaller,a as runScheduleTool};
|
|
2
|
+
//# sourceMappingURL=schedule-tool-B4RDOKCN.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as a,q as b,r as c,s as d,t as e,u as f}from"./chunk-AU7SN4G3.js";import"./chunk-LDSBFDYB.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-JHY767T4.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-BLKXK27S.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-44NEMWB5.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-BLKXK27S.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-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-5FMPLCCG.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=set-enabled-
|
|
1
|
+
import{b as a}from"./chunk-LDSBFDYB.js";import"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-GVQFNLOS.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{b as $}from"./chunk-
|
|
1
|
+
import{b as $}from"./chunk-MOEXP6U3.js";import"./chunk-RKPAVWXF.js";import{b as p}from"./chunk-IFUAP7UD.js";import"./chunk-KP7KDLZ2.js";import"./chunk-F32VADB7.js";import"./chunk-AU7SN4G3.js";import"./chunk-LDSBFDYB.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-X3A5VPJP.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as y}from"./chunk-
|
|
1
|
+
import{b as y}from"./chunk-MOEXP6U3.js";import"./chunk-RKPAVWXF.js";import{j as v,s as S}from"./chunk-I4E6BH27.js";import{b}from"./chunk-3UATFGSB.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-F32VADB7.js";import"./chunk-AU7SN4G3.js";import"./chunk-LDSBFDYB.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.js";import"./chunk-QIJLFPWE.js";var C=45e3,f=e=>typeof e=="string"?e.trim():"",I={in_progress:"in progress",waiting_owner:"waiting on the owner",waiting_other:"waiting on another agent",needs_attention:"needs attention"};function x(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} [${I[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 A(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 ${A(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 G(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 ${A(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 R(e){return(e??[]).map(t=>`${t.idx}. ${t.name} (${t.agentId}, ${t.kind}) [${t.state}]${t.needsApproval?` approval: ${t.approval}`:""}${b(t)}`)}async function D(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
|
${x(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,waitUntil:e.waitUntil,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"?C: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.`,...R(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}:`,...R(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{C as DONE_TIMEOUT_MS,k as describeGoalRecord,j as describeGoals,x as describeOpen,R as describeSteps,D as runRequestTool,A as usd};
|
|
10
|
-
//# sourceMappingURL=tool-
|
|
10
|
+
//# sourceMappingURL=tool-H7RMHTXM.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as w}from"./chunk-
|
|
1
|
+
import{b as w}from"./chunk-MOEXP6U3.js";import"./chunk-RKPAVWXF.js";import"./chunk-F32VADB7.js";import"./chunk-AU7SN4G3.js";import"./chunk-LDSBFDYB.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-ILYSRPZ5.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as y}from"./chunk-
|
|
1
|
+
import{b as y}from"./chunk-MOEXP6U3.js";import"./chunk-RKPAVWXF.js";import{b as u}from"./chunk-IFUAP7UD.js";import"./chunk-KP7KDLZ2.js";import"./chunk-F32VADB7.js";import"./chunk-AU7SN4G3.js";import"./chunk-LDSBFDYB.js";import"./chunk-3UOTLMXD.js";import{h as f}from"./chunk-4NZ4T3TQ.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-KCOCIAFM.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as $}from"./chunk-
|
|
1
|
+
import{b as $}from"./chunk-MOEXP6U3.js";import"./chunk-RKPAVWXF.js";import{h as m}from"./chunk-RX5O5637.js";import"./chunk-F32VADB7.js";import"./chunk-AU7SN4G3.js";import"./chunk-LDSBFDYB.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-QIS3CLU2.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{b as T}from"./chunk-MOEXP6U3.js";import"./chunk-RKPAVWXF.js";import{b as S}from"./chunk-IFUAP7UD.js";import"./chunk-KP7KDLZ2.js";import"./chunk-F32VADB7.js";import"./chunk-AU7SN4G3.js";import"./chunk-LDSBFDYB.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import{d as g,f as w,h,i as y,j as R,r as v,u as A}from"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.js";import"./chunk-QIJLFPWE.js";R();A();var p=e=>typeof e=="string"?e.trim():"";function m(e){let t=e.latest?`${h(e.latest.value,e.unit)} for ${g({start:e.latest.periodStart,end:e.latest.periodEnd})}${e.latest.value===null&&e.latest.error?` (${e.latest.error})`:""}`:"no reading yet",i=[e.ownerAgent?`owner ${e.ownerAgent}`:null,e.rhythm,e.target?`target ${y(e.target,e.unit)}`:null,e.tags.length?`tags ${e.tags.join(", ")}`:null,v(e.source)].filter(Boolean);return`- ${e.id} "${e.name}" [${w[e.status]}]: ${t}. ${i.join("; ")}.${e.archivedAt?" Archived.":""}`}function k(e){return(e.readings??[]).map(t=>` ${g({start:t.periodStart,end:t.periodEnd})}: ${h(t.value,e.unit)}${t.value===null&&t.error?` (${t.error})`:""}, by ${t.by}${t.note?` (${t.note})`:""}`)}async function V(e,t){let i=t.fetch??fetch,$=t.daemonUrl.replace(/\/$/,""),r=(p(e.action)||"list").toLowerCase();try{if(r==="list"){let n=Array.isArray(e.tags)?e.tags.join(","):p(e.tags),o=new URLSearchParams({...n?{tags:n}:{},...e.archived?{archived:"1"}:{}}),a=await i(`${$}/numbers${o.size?`?${o}`:""}`,{signal:AbortSignal.timeout(1e4)}),s=await a.json().catch(()=>({}));if(!a.ok)return`Error: ${s?.error||`HTTP ${a.status}`}`;let l=s.numbers??[];return l.length?`${l.length} number${l.length===1?"":"s"}:
|
|
2
|
+
${l.map(m).join(`
|
|
3
|
+
`)}`:"No numbers are tracked on this node."}if(r==="show"){let n=p(e.id);if(!n)return"Error: show needs id: the number's id (list shows them).";let o=await i(`${$}/numbers/${encodeURIComponent(n)}`,{signal:AbortSignal.timeout(1e4)}),a=await o.json().catch(()=>({}));if(!o.ok)return`Error: ${a?.error||`HTTP ${o.status}`}`;let s=a.number;return[m(s),...s.readings?.length?["Readings, newest first:",...k(s)]:[]].join(`
|
|
4
|
+
`)}if(!["create","record","archive"].includes(r))return`Error: unknown action "${r}": use list, show, create, record or archive.`;let c=t.env??process.env,b=T(e,c);if(!b)return"Error: couldn't tell which agent you are. Pass callerAgentId.";let{callerAgentId:E,...N}=e,d=await i(`${$}/numbers`,{method:"POST",headers:{"Content-Type":"application/json",...S(c)},body:JSON.stringify({...N,action:r,agentId:b.agentId}),signal:AbortSignal.timeout(1e4)}),f=await d.json().catch(()=>({}));if(!d.ok)return`Error: ${f?.error||`HTTP ${d.status}`}`;let u=f.number;if(r==="create"){let n=u.source.kind==="manual"?` Record each reading with {action:"record", id:"${u.id}", value:<n>, from:"YYYY-MM-DD", to:"YYYY-MM-DD"}.`:" The daemon reads it once per period.";return`Number ${d.status===201?"made":"updated"}:
|
|
5
|
+
${m(u)}${n}`}return r==="archive"?`Number ${u.id} is no longer tracked. Its readings stay.`:`Reading kept:
|
|
6
|
+
${m(u)}`}catch(c){return`Error: couldn't reach the daemon (${c?.message??c}).`}}export{m as describeNumber,k as describeReadings,V as runNumbersTool};
|
|
7
|
+
//# sourceMappingURL=tool-Z7TIGVEW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/numbers/tool.ts"],"sourcesContent":["import { resolveScheduleCaller } from \"@/crons/schedule-tool\"\nimport { callerHeaders } from \"@/calls/service\"\nimport { describePeriod, describeTarget, formatValue, STATUS_WORDS, type NumberStatus, type Reading } from \"./model\"\nimport { describeSource } from \"./sources\"\nimport type { NumberRecord } from \"./store\"\n\n// --- Agent-facing `agentx_numbers` tool (#1826) ---\n//\n// list tracked numbers with status and newest reading (tags narrows)\n// show one number and its readings\n// create make or change a number the agent owns\n// record a reading for a window (from, to), default the last whole\n// period of its rhythm\n// archive stop tracking a number (its readings stay)\n// It talks to the daemon's /numbers endpoints.\n\nexport interface NumbersToolDeps {\n daemonUrl: string\n fetch?: typeof fetch\n env?: NodeJS.ProcessEnv\n}\n\ntype View = NumberRecord & { status: NumberStatus; latest: Reading | null; readings?: Reading[] }\n\nconst str = (v: unknown) => (typeof v === \"string\" ? v.trim() : \"\")\n\n/** One line per number. */\nexport function describeNumber(n: View): string {\n const latest = n.latest\n ? `${formatValue(n.latest.value, n.unit)} for ${describePeriod({ start: n.latest.periodStart, end: n.latest.periodEnd })}${n.latest.value === null && n.latest.error ? ` (${n.latest.error})` : \"\"}`\n : \"no reading yet\"\n const parts = [\n n.ownerAgent ? `owner ${n.ownerAgent}` : null,\n n.rhythm,\n n.target ? `target ${describeTarget(n.target, n.unit)}` : null,\n n.tags.length ? `tags ${n.tags.join(\", \")}` : null,\n describeSource(n.source),\n ].filter(Boolean)\n return `- ${n.id} \"${n.name}\" [${STATUS_WORDS[n.status]}]: ${latest}. ${parts.join(\"; \")}.${n.archivedAt ? \" Archived.\" : \"\"}`\n}\n\nexport function describeReadings(n: View): string[] {\n return (n.readings ?? []).map((r) =>\n ` ${describePeriod({ start: r.periodStart, end: r.periodEnd })}: ${formatValue(r.value, n.unit)}${r.value === null && r.error ? ` (${r.error})` : \"\"}, by ${r.by}${r.note ? ` (${r.note})` : \"\"}`)\n}\n\n/** Returns the text the agent sees. Every refusal is text, never a throw. */\nexport async function runNumbersTool(args: Record<string, unknown>, deps: NumbersToolDeps): Promise<string> {\n const doFetch = deps.fetch ?? fetch\n const base = deps.daemonUrl.replace(/\\/$/, \"\")\n const action = (str(args.action) || \"list\").toLowerCase()\n try {\n if (action === \"list\") {\n const tags = Array.isArray(args.tags) ? args.tags.join(\",\") : str(args.tags)\n const q = new URLSearchParams({ ...(tags ? { tags } : {}), ...(args.archived ? { archived: \"1\" } : {}) })\n const res = await doFetch(`${base}/numbers${q.size ? `?${q}` : \"\"}`, { signal: AbortSignal.timeout(10_000) })\n const data = await res.json().catch(() => ({})) as any\n if (!res.ok) return `Error: ${data?.error || `HTTP ${res.status}`}`\n const list: View[] = data.numbers ?? []\n return list.length ? `${list.length} number${list.length === 1 ? \"\" : \"s\"}:\\n${list.map(describeNumber).join(\"\\n\")}` : \"No numbers are tracked on this node.\"\n }\n if (action === \"show\") {\n const id = str(args.id)\n if (!id) return \"Error: show needs id: the number's id (list shows them).\"\n const res = await doFetch(`${base}/numbers/${encodeURIComponent(id)}`, { signal: AbortSignal.timeout(10_000) })\n const data = await res.json().catch(() => ({})) as any\n if (!res.ok) return `Error: ${data?.error || `HTTP ${res.status}`}`\n const n = data.number as View\n return [describeNumber(n), ...(n.readings?.length ? [\"Readings, newest first:\", ...describeReadings(n)] : [])].join(\"\\n\")\n }\n if (![\"create\", \"record\", \"archive\"].includes(action)) return `Error: unknown action \"${action}\": use list, show, create, record or archive.`\n const env = deps.env ?? process.env\n const caller = resolveScheduleCaller(args, env)\n if (!caller) return \"Error: couldn't tell which agent you are. Pass callerAgentId.\"\n const { callerAgentId: _c, ...rest } = args\n const res = await doFetch(`${base}/numbers`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\", ...callerHeaders(env) },\n body: JSON.stringify({ ...rest, action, agentId: caller.agentId }),\n signal: AbortSignal.timeout(10_000),\n })\n const data = await res.json().catch(() => ({})) as any\n if (!res.ok) return `Error: ${data?.error || `HTTP ${res.status}`}`\n const n = data.number as View\n if (action === \"create\") {\n const reads = n.source.kind === \"manual\" ? ` Record each reading with {action:\"record\", id:\"${n.id}\", value:<n>, from:\"YYYY-MM-DD\", to:\"YYYY-MM-DD\"}.` : \" The daemon reads it once per period.\"\n return `Number ${res.status === 201 ? \"made\" : \"updated\"}:\\n${describeNumber(n)}${reads}`\n }\n if (action === \"archive\") return `Number ${n.id} is no longer tracked. Its readings stay.`\n return `Reading kept:\\n${describeNumber(n)}`\n } catch (e: any) {\n return `Error: couldn't reach the daemon (${e?.message ?? e}).`\n }\n}\n"],"mappings":"ygBAEAA,IACAC,IAqBA,IAAMC,EAAOC,GAAgB,OAAOA,GAAM,SAAWA,EAAE,KAAK,EAAI,GAGzD,SAASC,EAAeC,EAAiB,CAC9C,IAAMC,EAASD,EAAE,OACb,GAAGE,EAAYF,EAAE,OAAO,MAAOA,EAAE,IAAI,SAASG,EAAe,CAAE,MAAOH,EAAE,OAAO,YAAa,IAAKA,EAAE,OAAO,SAAU,CAAC,IAAIA,EAAE,OAAO,QAAU,MAAQA,EAAE,OAAO,MAAQ,KAAKA,E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ACrE,KAAM,KAAK,UAAU,CAAE,GAAGI,EAAM,OAAAX,EAAQ,QAASQ,EAAO,OAAQ,CAAC,EACjE,OAAQ,YAAY,QAAQ,GAAM,CACpC,CAAC,EACKJ,EAAO,MAAMD,EAAI,KAAK,EAAE,MAAM,KAAO,CAAC,EAAE,EAC9C,GAAI,CAACA,EAAI,GAAI,MAAO,UAAUC,GAAM,OAAS,QAAQD,EAAI,WACzD,IAAMlB,EAAImB,EAAK,OACf,GAAIJ,IAAW,SAAU,CACvB,IAAMa,EAAQ5B,EAAE,OAAO,OAAS,SAAW,mDAAmDA,EAAE,uDAAyD,wCACzJ,MAAO,UAAUkB,EAAI,SAAW,IAAM,OAAS;AAAA,EAAenB,EAAeC,CAAC,IAAI4B,IAEpF,OAAIb,IAAW,UAAkB,UAAUf,EAAE,8CACtC;AAAA,EAAkBD,EAAeC,CAAC,GAC3C,OAAS6B,EAAP,CACA,MAAO,qCAAqCA,GAAG,SAAWA,KAC5D,CACF","names":["init_model","init_sources","str","v","describeNumber","n","latest","formatValue","describePeriod","parts","describeTarget","describeSource","STATUS_WORDS","describeReadings","r","runNumbersTool","args","deps","doFetch","base","action","tags","q","res","data","list","id","env","caller","resolveScheduleCaller","_c","rest","callerHeaders","reads","e"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./chunk-VWTBHLMX.js";import{d as c}from"./chunk-5SQRJUAK.js";import"./chunk-JTFCU5LH.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-BERWTVG2.js";import{b}from"./chunk-TFHJT2AZ.js";import{a}from"./chunk-JMWPBZLU.js";import"./chunk-T7SD5EVH.js";import"./chunk-WPNRDEHW.js";import"./chunk-OWNQ2FD4.js";import"./chunk-AHWWJ7AF.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-BLKXK27S.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-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{b as WikiHub,a as WikiStore,c as agenticQuery};
|
|
2
|
+
//# sourceMappingURL=wiki-UMPPYYFR.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentix-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.216.0",
|
|
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-35UGFFHA.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{ia as y,ka as v,qa as w,ra as C,ta as E,ua as R,va as I}from"./chunk-KAM4ZWRE.js";I();v();var L=1e4,T=["issues","prs","all"],W=/^[\w.-]+(?:\/[\w.-]+)+$/,m=e=>typeof e=="string"?e.trim():"";function f(e){let t=m(e.provider).toLowerCase();if(t!=="github"&&t!=="gitlab")return"count.provider must be github or gitlab";let r=m(e.project),n=r.split("/");if(!W.test(r)||n.some(o=>o==="."||o==="..")||t==="github"&&n.length!==2)return t==="github"?'count.project must be "owner/repo"':'count.project must be "group/project"';let s=(m(e.what)||"issues").toLowerCase();if(!T.includes(s))return`count.what must be one of ${T.join(", ")}`;let i=e.max===void 0||e.max===null||e.max===""?0:Number(e.max);return!Number.isInteger(i)||i<0?"count.max must be a whole number, 0 or more":{provider:t,project:r,what:s,max:i}}function S(e){if(!e)return null;try{let t=JSON.parse(e);if(!t||typeof t!="object")return null;let r=f(t);return typeof r=="string"?null:r}catch{return null}}var _=e=>e==="issues"?"open issues":e==="prs"?"open pull requests":"open issues and pull requests";function $(e){return`${_(e.what)} in ${e.provider} ${e.project} \u2264 ${e.max}`}async function Y(e,t){if(!t)return{verdict:"unverifiable",detail:`no ${e.provider} connector on this node`};try{let r=e.what==="all"?["issues","prs"]:[e.what],n=0;for(let i of r){let o=await t(e.provider,e.project,i);if(typeof o!="number")return{verdict:"unverifiable",detail:`${e.project}: ${o.error}`};n+=o}let s=`${n} ${_(e.what)} in ${e.project}`;return{verdict:n<=e.max?"met":"not_met",detail:s,count:n}}catch(r){return{verdict:"unverifiable",detail:`the count check failed: ${String(r?.message??r).slice(0,200)}`}}}function B(e,t=fetch){return async(r,n,s)=>{let i;if(r==="github"){let a=e.github;if(!a)return{error:"no github connector on this node (channels.github or requests.checkers.github)"};let d=encodeURIComponent(`repo:${n} is:open is:${s==="prs"?"pr":"issue"}`);i=`${a.apiUrl.replace(/\/$/,"")}/search/issues?q=${d}&per_page=1`}else{let a=e.gitlab;if(!a)return{error:"no gitlab connector on this node (channels.gitlab or requests.checkers.gitlab)"};i=`${a.url.replace(/\/$/,"")}/api/v4/projects/${encodeURIComponent(n)}/${s==="prs"?"merge_requests":"issues"}?state=opened&per_page=1`}let o;try{o=await t(i,{headers:y(r,e),signal:AbortSignal.timeout(L)})}catch(a){return{error:`could not be reached: ${String(a?.message??a).slice(0,200)}`}}if(!o.ok)return{error:o.status===404?"not found (or not visible to the connector)":`HTTP ${o.status}`};if(r==="gitlab"){let a=Number(o.headers.get("x-total"));return Number.isInteger(a)&&a>=0?a:{error:"no X-Total in the answer"}}let c=await o.json().catch(()=>null),l=Number(c?.total_count);return Number.isInteger(l)&&l>=0?l:{error:"no total_count in the answer"}}}var F=["active","done","dropped"],Q=300,A=500;function ee(e,t=w,r=Date.now()){if(e&&typeof e=="object"&&!Array.isArray(e)&&String(e.kind).trim().toLowerCase()==="count"){let s=f(e);return typeof s=="string"?s:{kind:"count",...s}}let n=C(e,t,r);return typeof n!="string"?n:/^closeWhen(\.kind)? must be/.test(n)?"check must be an object with a kind: url, issue, git-ancestor, reply or count":n.replace(/^closeWhen/,"check")}function U(e){if(!e)return null;try{if(JSON.parse(e)?.kind==="count"){let t=S(e);return t?{kind:"count",...t}:null}}catch{return null}return R(e)}function j(e){return e.kind==="count"?$(e):E(e)}function k(e){return{id:e.id,title:e.title,ownerAgent:e.owner_agent??null,state:e.state,doneWhen:e.done_when??null,check:U(e.check_spec),evidence:e.evidence??null,lastCheck:e.last_check??null,lastCheckAt:e.last_check_at??null,createdAt:e.created_at,updatedAt:e.updated_at,closedAt:e.closed_at??null}}var N=class{constructor(t){this.db=t;t.exec(`
|
|
2
|
-
CREATE TABLE IF NOT EXISTS goals (
|
|
3
|
-
id TEXT PRIMARY KEY,
|
|
4
|
-
title TEXT NOT NULL,
|
|
5
|
-
owner_agent TEXT,
|
|
6
|
-
state TEXT NOT NULL DEFAULT 'active',
|
|
7
|
-
done_when TEXT,
|
|
8
|
-
check_spec TEXT,
|
|
9
|
-
evidence TEXT,
|
|
10
|
-
last_check TEXT,
|
|
11
|
-
last_check_at INTEGER,
|
|
12
|
-
created_at INTEGER NOT NULL,
|
|
13
|
-
updated_at INTEGER NOT NULL,
|
|
14
|
-
closed_at INTEGER
|
|
15
|
-
);
|
|
16
|
-
CREATE INDEX IF NOT EXISTS idx_goals_state ON goals(state);
|
|
17
|
-
`)}get(t){let r=this.db.prepare("SELECT * FROM goals WHERE id = ?").get(t);return r?k(r):null}list(t=F,r=200){let n=t.map(()=>"?").join(", ");return this.db.prepare(`SELECT * FROM goals WHERE state IN (${n}) ORDER BY updated_at DESC, rowid DESC LIMIT ?`).all(...t,r).map(k)}ensure(t,r,n){return this.db.prepare("INSERT INTO goals (id, title, owner_agent, state, created_at, updated_at) VALUES (?, ?, ?, 'active', ?, ?) ON CONFLICT(id) DO NOTHING").run(t.id,t.title,r,n,n),this.get(t.id)}upsert(t,r){let n=this.get(t.id);return n?this.db.prepare("UPDATE goals SET title = ?, owner_agent = ?, done_when = ?, check_spec = ?, updated_at = ? WHERE id = ?").run(t.title||n.title,t.ownerAgent!==void 0?t.ownerAgent:n.ownerAgent,t.doneWhen!==void 0?t.doneWhen:n.doneWhen,t.check!==void 0?t.check?JSON.stringify(t.check):null:n.check?JSON.stringify(n.check):null,r,t.id):this.db.prepare("INSERT INTO goals (id, title, owner_agent, state, done_when, check_spec, created_at, updated_at) VALUES (?, ?, ?, 'active', ?, ?, ?, ?)").run(t.id,t.title,t.ownerAgent??null,t.doneWhen??null,t.check?JSON.stringify(t.check):null,r,r),this.get(t.id)}close(t,r,n,s){return this.db.prepare("UPDATE goals SET state = ?, evidence = ?, closed_at = ?, updated_at = ? WHERE id = ? AND state = 'active'").run(r,n?n.slice(0,A):null,s,s,t).changes>0}markChecked(t,r,n){this.db.prepare("UPDATE goals SET last_check = ?, last_check_at = ? WHERE id = ?").run(r.slice(0,A),n,t)}dueChecks(t){return this.db.prepare("SELECT * FROM goals WHERE state = 'active' AND check_spec IS NOT NULL AND (last_check_at IS NULL OR last_check_at <= ?) ORDER BY last_check_at ASC LIMIT 50").all(t).map(k)}};async function te(e,t,r,n,s=()=>{}){let i=[];for(let o of e.dueChecks(n-r*6e4)){let c;try{c=await t(o.check)}catch(l){c={verdict:"unverifiable",detail:String(l?.message??l)}}e.markChecked(o.id,c.detail,n),c.verdict==="met"&&e.close(o.id,"done",`check: ${c.detail}`,n)?(i.push(o.id),s(`[goals] ${o.id} done: ${c.detail}`)):c.verdict==="unverifiable"&&s(`[goals] ${o.id}: check failed: ${c.detail}`)}return i}function ne(e,t){let r=[`[Goal] ${e.title} (${e.id}): ${e.state}${e.ownerAgent?`, owner ${e.ownerAgent}`:""}.`];return e.doneWhen&&r.push(`Done when: ${e.doneWhen}`),e.check&&r.push(`Check: ${j(e.check)}${e.lastCheck?`; last seen: ${e.lastCheck}${e.lastCheckAt?` (${new Date(e.lastCheckAt).toISOString().slice(0,16).replace("T"," ")} UTC)`:""}`:""}`),t&&r.push(`Requests under it: ${t.open} open, ${t.done} done.`),r.join(`
|
|
18
|
-
`)}var g="Africa/Tunis";function b(e,t=g){let r=Object.fromEntries(new Intl.DateTimeFormat("en-GB",{timeZone:t,hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}).formatToParts(new Date(e)).map(s=>[s.type,s.value])),n=(Number(r.hour)%24*3600+Number(r.minute)*60+Number(r.second))*1e3+e%1e3;return e-n}var M=(e,t)=>new Intl.DateTimeFormat("en-GB",{timeZone:t,hour12:!1,hour:"2-digit",minute:"2-digit"}).format(new Date(e));function q(e,t=10){let r=e.replace(/\s+/g," ").trim().split(" ");return r.slice(0,t).join(" ")+(r.length>t?" \u2026":"")}var H=new Set(["issue","idea","approval","erp","card"]);function oe(e,t={}){let r=e.map(n=>{let s=[],i=(o,c)=>{s.some(l=>l.kind===o&&l.ref===c)||s.push({kind:o,ref:c})};for(let o of n.links??[])H.has(o.kind)&&i(o.kind,o.ref);return n.home&&i(n.home.kind,n.home.link),t.hasPlan?.(n.id)&&i("plan",n.id),n.evidence&&i("evidence",n.evidence),{id:n.id,time:M(n.createdAt,t.zone??g),words:q(n.text),state:n.state,owner:n.agentId,landed:s,noHome:s.length===0&&n.state!=="declined"&&n.state!=="dropped"}});return[...r.filter(n=>n.noHome),...r.filter(n=>!n.noHome)]}var x={timeZone:g,days:7},X=90,D=5,G=120,P=(e,t)=>new Intl.DateTimeFormat("en-CA",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date(e));function Z(e,t){return{day:P(e,t),start:e,asked:0,done:0,dropped:0,moving:0,waiting:0,stuck:0,rate:null,dropReasons:[],moreReasons:0,resent:0,resentDone:0}}function ie(e,t={}){let r=t.zone??x.timeZone,n=Math.min(Math.max(Math.floor(t.days??x.days),1),X),s=t.now??Date.now(),i=[b(s,r)];for(;i.length<n;)i.unshift(b(i[0]-1,r));let o=i.map(a=>Z(a,r)),c=o.map(()=>new Map),l=0;for(let a of e.flowRows(i[0])){for(;l+1<o.length&&a.createdAt>=o[l+1].start;)l++;let d=o[l];if(d.asked++,a.state==="done")d.done++;else if(a.state==="declined"||a.state==="dropped"){d.dropped++;let p=(a.closeReason??"").replace(/\s+/g," ").trim(),u=p.length>G?`${p.slice(0,G-1)}\u2026`:p||"no reason given";c[l].set(u,(c[l].get(u)??0)+1)}else a.state==="in_progress"||a.state==="waiting_other"?d.moving++:a.state==="waiting_owner"?d.waiting++:a.state==="needs_attention"&&d.stuck++;a.resentAt!==null&&(d.resent++,a.state==="done"&&d.resentDone++)}return o.forEach((a,d)=>{a.rate=a.asked?(a.done+a.dropped)/a.asked:null;let p=[...c[d]].sort((u,h)=>h[1]-u[1]);a.dropReasons=p.slice(0,D).map(([u,h])=>({reason:u,count:h})),a.moreReasons=p.slice(D).reduce((u,[,h])=>u+h,0)}),{zone:r,days:o,today:o[o.length-1]}}var O=e=>e===null?"\u2013":`${Math.round(e*100)}%`;function ce(e){let t=e.today,r=[`Today (${t.day}, ${e.zone}): ${t.asked?`${t.done+t.dropped} of ${t.asked} closed, ${O(t.rate)}`:"nothing asked yet"}.`,` ${t.done} done, ${t.dropped} dropped, ${t.moving} moving, ${t.waiting} waiting on the owner, ${t.stuck} stuck.`+(t.resent?` ${t.resent} resent once on its own, ${t.resentDone} of them done.`:"")];if(t.dropReasons.length){r.push(" Dropped because:");for(let n of t.dropReasons)r.push(` ${n.count} \xD7 ${n.reason}`);t.moreReasons&&r.push(` ${t.moreReasons} more`)}if(e.days.length>1){r.push("","Day asked done dropped moving waiting stuck rate");for(let n of e.days){let s=[n.asked,n.done,n.dropped,n.moving,n.waiting,n.stuck].map(String);r.push(`${n.day} ${s[0].padStart(5)} ${s[1].padStart(4)} ${s[2].padStart(7)} ${s[3].padStart(6)} ${s[4].padStart(7)} ${s[5].padStart(5)} ${O(n.rate).padStart(4)}`)}}return r.join(`
|
|
19
|
-
`)}export{f as a,S as b,$ as c,Y as d,B as e,Q as f,A as g,ee as h,j as i,N as j,te as k,ne as l,b as m,oe as n,x as o,X as p,ie as q,ce as r};
|
|
20
|
-
//# sourceMappingURL=chunk-35UGFFHA.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/requests/goal-store.ts","../src/requests/checkers/count.ts","../src/requests/today.ts","../src/requests/flow.ts"],"sourcesContent":["import type Database from \"better-sqlite3\"\nimport { DEFAULT_CHECKER_SETTINGS, describeCloseWhen, parseCloseWhen, readCloseWhen, type CheckerSettings, type CheckResult, type CloseWhen } from \"./checkers\"\nimport { describeCount, parseCountSpec, readCountSpec, type CountSpec } from \"./checkers/count\"\nimport type { RequestGoal } from \"./goals\"\n\n// --- A goal as its own record (#1568 part 3) ---\n//\n// Until now a goal was a label on a request: it existed while a request\n// named it (#1168). Crons need something lasting to point at, so a goal is\n// now a row of its own: a title, an owner agent, a state (active, done or\n// dropped), what \"done\" means in words, and optionally a check the daemon\n// runs itself (any loop checker, or an open count). Requests keep their\n// goal_id; accepting a request with a goal makes the record when it is\n// new. A goal is done when its check is met, or when its owner closes it.\n// A closed goal stays closed: a new goal needs a new id.\n\nexport const GOAL_STATES = [\"active\", \"done\", \"dropped\"] as const\nexport type GoalState = (typeof GOAL_STATES)[number]\n\nexport const DONE_WHEN_MAX = 300\nexport const GOAL_EVIDENCE_MAX = 500\n\n/** What closes a goal: a loop checker, or an open count (#1568). */\nexport type GoalCheck = CloseWhen | ({ kind: \"count\" } & CountSpec)\n\nexport interface GoalRecord {\n id: string\n title: string\n /** The agent that keeps it moving and may close it. */\n ownerAgent: string | null\n state: GoalState\n doneWhen: string | null\n check: GoalCheck | null\n /** Why it closed: the check's evidence, or the owner's words. */\n evidence: string | null\n /** What the check saw last time, and when. */\n lastCheck: string | null\n lastCheckAt: number | null\n createdAt: number\n updatedAt: number\n closedAt: number | null\n}\n\n/** Check the `check` (or closeWhen) of a goal: a spec, or why it is refused. */\nexport function parseGoalCheck(v: unknown, settings: CheckerSettings = DEFAULT_CHECKER_SETTINGS, now = Date.now()): GoalCheck | string {\n if (v && typeof v === \"object\" && !Array.isArray(v) && String((v as any).kind).trim().toLowerCase() === \"count\") {\n const spec = parseCountSpec(v as Record<string, unknown>)\n return typeof spec === \"string\" ? spec : { kind: \"count\", ...spec }\n }\n const spec = parseCloseWhen(v, settings, now)\n if (typeof spec !== \"string\") return spec\n return /^closeWhen(\\.kind)? must be/.test(spec) ? \"check must be an object with a kind: url, issue, git-ancestor, reply or count\" : spec.replace(/^closeWhen/, \"check\")\n}\n\nfunction readGoalCheck(json: string | null): GoalCheck | null {\n if (!json) return null\n try {\n if (JSON.parse(json)?.kind === \"count\") {\n const spec = readCountSpec(json)\n return spec ? { kind: \"count\", ...spec } : null\n }\n } catch {\n return null\n }\n return readCloseWhen(json)\n}\n\nexport function describeGoalCheck(check: GoalCheck): string {\n return check.kind === \"count\" ? describeCount(check) : describeCloseWhen(check)\n}\n\nfunction toGoal(r: any): GoalRecord {\n return {\n id: r.id, title: r.title, ownerAgent: r.owner_agent ?? null, state: r.state, doneWhen: r.done_when ?? null,\n check: readGoalCheck(r.check_spec), evidence: r.evidence ?? null, lastCheck: r.last_check ?? null, lastCheckAt: r.last_check_at ?? null,\n createdAt: r.created_at, updatedAt: r.updated_at, closedAt: r.closed_at ?? null,\n }\n}\n\nexport interface GoalInput extends RequestGoal {\n ownerAgent?: string | null\n doneWhen?: string | null\n check?: GoalCheck | null\n}\n\nexport class GoalStore {\n constructor(private db: Database.Database) {\n db.exec(`\n CREATE TABLE IF NOT EXISTS goals (\n id TEXT PRIMARY KEY,\n title TEXT NOT NULL,\n owner_agent TEXT,\n state TEXT NOT NULL DEFAULT 'active',\n done_when TEXT,\n check_spec TEXT,\n evidence TEXT,\n last_check TEXT,\n last_check_at INTEGER,\n created_at INTEGER NOT NULL,\n updated_at INTEGER NOT NULL,\n closed_at INTEGER\n );\n CREATE INDEX IF NOT EXISTS idx_goals_state ON goals(state);\n `)\n }\n\n get(id: string): GoalRecord | null {\n const row = this.db.prepare(\"SELECT * FROM goals WHERE id = ?\").get(id)\n return row ? toGoal(row) : null\n }\n\n /** Most recently updated first. */\n list(states: readonly GoalState[] = GOAL_STATES, limit = 200): GoalRecord[] {\n const marks = states.map(() => \"?\").join(\", \")\n return (this.db.prepare(`SELECT * FROM goals WHERE state IN (${marks}) ORDER BY updated_at DESC, rowid DESC LIMIT ?`).all(...states, limit) as any[]).map(toGoal)\n }\n\n /** The record of a goal a request names on accept: made when it is new,\n * left as it is otherwise (its title and owner are the record's). */\n ensure(goal: RequestGoal, ownerAgent: string | null, now: number): GoalRecord {\n this.db.prepare(\n \"INSERT INTO goals (id, title, owner_agent, state, created_at, updated_at) VALUES (?, ?, ?, 'active', ?, ?) ON CONFLICT(id) DO NOTHING\",\n ).run(goal.id, goal.title, ownerAgent, now, now)\n return this.get(goal.id)!\n }\n\n /** Make a goal, or change an active one: only the fields given change. */\n upsert(input: GoalInput, now: number): GoalRecord {\n const had = this.get(input.id)\n if (!had) {\n this.db.prepare(\n \"INSERT INTO goals (id, title, owner_agent, state, done_when, check_spec, created_at, updated_at) VALUES (?, ?, ?, 'active', ?, ?, ?, ?)\",\n ).run(input.id, input.title, input.ownerAgent ?? null, input.doneWhen ?? null, input.check ? JSON.stringify(input.check) : null, now, now)\n } else {\n this.db.prepare(\n \"UPDATE goals SET title = ?, owner_agent = ?, done_when = ?, check_spec = ?, updated_at = ? WHERE id = ?\",\n ).run(\n input.title || had.title,\n input.ownerAgent !== undefined ? input.ownerAgent : had.ownerAgent,\n input.doneWhen !== undefined ? input.doneWhen : had.doneWhen,\n input.check !== undefined ? (input.check ? JSON.stringify(input.check) : null) : (had.check ? JSON.stringify(had.check) : null),\n now, input.id,\n )\n }\n return this.get(input.id)!\n }\n\n /** Close an active goal as done or dropped. False when it was not active. */\n close(id: string, state: Exclude<GoalState, \"active\">, evidence: string | null, now: number): boolean {\n const res = this.db.prepare(\n \"UPDATE goals SET state = ?, evidence = ?, closed_at = ?, updated_at = ? WHERE id = ? AND state = 'active'\",\n ).run(state, evidence ? evidence.slice(0, GOAL_EVIDENCE_MAX) : null, now, now, id)\n return res.changes > 0\n }\n\n /** What the check saw: not a change of the goal, so updated_at stays. */\n markChecked(id: string, detail: string, now: number): void {\n this.db.prepare(\"UPDATE goals SET last_check = ?, last_check_at = ? WHERE id = ?\").run(detail.slice(0, GOAL_EVIDENCE_MAX), now, id)\n }\n\n /** Active goals with a check last run at `before` or earlier (or never). */\n dueChecks(before: number): GoalRecord[] {\n return (this.db.prepare(\n \"SELECT * FROM goals WHERE state = 'active' AND check_spec IS NOT NULL AND (last_check_at IS NULL OR last_check_at <= ?) ORDER BY last_check_at ASC LIMIT 50\",\n ).all(before) as any[]).map(toGoal)\n }\n}\n\nexport type GoalChecker = (check: GoalCheck) => Promise<CheckResult>\n\n/** Run the check of every active goal not checked for `everyMinutes`.\n * Met closes the goal as done with the check's evidence. Returns the ids\n * closed. One goal's failure never stops the others. */\nexport async function checkGoals(store: GoalStore, check: GoalChecker, everyMinutes: number, now: number, log: (msg: string) => void = () => {}): Promise<string[]> {\n const closed: string[] = []\n for (const g of store.dueChecks(now - everyMinutes * 60_000)) {\n let res: CheckResult\n try {\n res = await check(g.check!)\n } catch (e: any) {\n res = { verdict: \"unverifiable\", detail: String(e?.message ?? e) }\n }\n store.markChecked(g.id, res.detail, now)\n if (res.verdict === \"met\" && store.close(g.id, \"done\", `check: ${res.detail}`, now)) {\n closed.push(g.id)\n log(`[goals] ${g.id} done: ${res.detail}`)\n } else if (res.verdict === \"unverifiable\") {\n log(`[goals] ${g.id}: check failed: ${res.detail}`)\n }\n }\n return closed\n}\n\n/** The goal's state for a cron prompt or a plan turn: a few lines. */\nexport function goalBrief(g: GoalRecord, counts?: { open: number; done: number } | null): string {\n const lines = [`[Goal] ${g.title} (${g.id}): ${g.state}${g.ownerAgent ? `, owner ${g.ownerAgent}` : \"\"}.`]\n if (g.doneWhen) lines.push(`Done when: ${g.doneWhen}`)\n if (g.check) lines.push(`Check: ${describeGoalCheck(g.check)}${g.lastCheck ? `; last seen: ${g.lastCheck}${g.lastCheckAt ? ` (${new Date(g.lastCheckAt).toISOString().slice(0, 16).replace(\"T\", \" \")} UTC)` : \"\"}` : \"\"}`)\n if (counts) lines.push(`Requests under it: ${counts.open} open, ${counts.done} done.`)\n return lines.join(\"\\n\")\n}\n","import type { CheckResult } from \"./index\"\nimport { forgeHeaders, type ForgeConnectors } from \"./issue\"\n\n// --- count: how many issues or pull requests a project has open (#1568) ---\n//\n// A plan step can carry a count check (\"open issues in owner/repo = 0\").\n// The plan check reads the count through the GitHub or GitLab connector,\n// marks the step done when it is at or under `max`, and keeps the last\n// count so a turn that brought it down counts as progress. One read per\n// kind: GitHub's search total, GitLab's X-Total header.\n\nexport type CountWhat = \"issues\" | \"prs\" | \"all\"\n\nexport interface CountSpec {\n provider: \"github\" | \"gitlab\"\n /** \"owner/repo\" on GitHub, \"group/project\" on GitLab. */\n project: string\n what: CountWhat\n /** Done at this count or under. */\n max: number\n}\n\n/** Reads one open count, or says why it could not. */\nexport type ForgeCounter = (provider: \"github\" | \"gitlab\", project: string, kind: \"issues\" | \"prs\") => Promise<number | { error: string }>\n\nconst TIMEOUT_MS = 10_000\nconst WHATS: readonly CountWhat[] = [\"issues\", \"prs\", \"all\"]\nconst PROJECT_RE = /^[\\w.-]+(?:\\/[\\w.-]+)+$/\n\nconst str = (v: unknown) => (typeof v === \"string\" ? v.trim() : \"\")\n\nexport function parseCountSpec(raw: Record<string, unknown>): CountSpec | string {\n const provider = str(raw.provider).toLowerCase()\n if (provider !== \"github\" && provider !== \"gitlab\") return \"count.provider must be github or gitlab\"\n const project = str(raw.project)\n const parts = project.split(\"/\")\n if (!PROJECT_RE.test(project) || parts.some((p) => p === \".\" || p === \"..\") || (provider === \"github\" && parts.length !== 2)) {\n return provider === \"github\" ? 'count.project must be \"owner/repo\"' : 'count.project must be \"group/project\"'\n }\n const what = (str(raw.what) || \"issues\").toLowerCase()\n if (!(WHATS as readonly string[]).includes(what)) return `count.what must be one of ${WHATS.join(\", \")}`\n const max = raw.max === undefined || raw.max === null || raw.max === \"\" ? 0 : Number(raw.max)\n if (!Number.isInteger(max) || max < 0) return \"count.max must be a whole number, 0 or more\"\n return { provider, project, what: what as CountWhat, max }\n}\n\n/** A stored spec read back. Null when it is not one. */\nexport function readCountSpec(json: string | null | undefined): CountSpec | null {\n if (!json) return null\n try {\n const v = JSON.parse(json)\n if (!v || typeof v !== \"object\") return null\n const spec = parseCountSpec(v)\n return typeof spec === \"string\" ? null : spec\n } catch {\n return null\n }\n}\n\nconst whatWords = (w: CountWhat) => (w === \"issues\" ? \"open issues\" : w === \"prs\" ? \"open pull requests\" : \"open issues and pull requests\")\n\nexport function describeCount(spec: CountSpec): string {\n return `${whatWords(spec.what)} in ${spec.provider} ${spec.project} ≤ ${spec.max}`\n}\n\n/** The count now, and whether it is at or under max. Never throws. */\nexport async function checkCount(spec: CountSpec, counter: ForgeCounter | undefined): Promise<CheckResult & { count?: number }> {\n if (!counter) return { verdict: \"unverifiable\", detail: `no ${spec.provider} connector on this node` }\n try {\n const kinds: Array<\"issues\" | \"prs\"> = spec.what === \"all\" ? [\"issues\", \"prs\"] : [spec.what]\n let count = 0\n for (const kind of kinds) {\n const n = await counter(spec.provider, spec.project, kind)\n if (typeof n !== \"number\") return { verdict: \"unverifiable\", detail: `${spec.project}: ${n.error}` }\n count += n\n }\n const detail = `${count} ${whatWords(spec.what)} in ${spec.project}`\n return { verdict: count <= spec.max ? \"met\" : \"not_met\", detail, count }\n } catch (e: any) {\n return { verdict: \"unverifiable\", detail: `the count check failed: ${String(e?.message ?? e).slice(0, 200)}` }\n }\n}\n\n/** The counter over the REST APIs of GitHub and GitLab. */\nexport function forgeCounter(connectors: ForgeConnectors, doFetch: typeof fetch = fetch): ForgeCounter {\n return async (provider, project, kind) => {\n let url: string\n if (provider === \"github\") {\n const c = connectors.github\n if (!c) return { error: \"no github connector on this node (channels.github or requests.checkers.github)\" }\n const q = encodeURIComponent(`repo:${project} is:open is:${kind === \"prs\" ? \"pr\" : \"issue\"}`)\n url = `${c.apiUrl.replace(/\\/$/, \"\")}/search/issues?q=${q}&per_page=1`\n } else {\n const c = connectors.gitlab\n if (!c) return { error: \"no gitlab connector on this node (channels.gitlab or requests.checkers.gitlab)\" }\n url = `${c.url.replace(/\\/$/, \"\")}/api/v4/projects/${encodeURIComponent(project)}/${kind === \"prs\" ? \"merge_requests\" : \"issues\"}?state=opened&per_page=1`\n }\n let res: Response\n try {\n res = await doFetch(url, { headers: forgeHeaders(provider, connectors), signal: AbortSignal.timeout(TIMEOUT_MS) })\n } catch (e: any) {\n return { error: `could not be reached: ${String(e?.message ?? e).slice(0, 200)}` }\n }\n if (!res.ok) return { error: res.status === 404 ? \"not found (or not visible to the connector)\" : `HTTP ${res.status}` }\n if (provider === \"gitlab\") {\n const total = Number(res.headers.get(\"x-total\"))\n return Number.isInteger(total) && total >= 0 ? total : { error: \"no X-Total in the answer\" }\n }\n const body: any = await res.json().catch(() => null)\n const total = Number(body?.total_count)\n return Number.isInteger(total) && total >= 0 ? total : { error: \"no total_count in the answer\" }\n }\n}\n","import type { RequestRecord } from \"./store\"\n\n// --- \"What did I ask today, and where did it land\" (#394, 1c C) ---\n//\n// One row per request made since 00:00 Tunis: time, first words, state,\n// owner, and where it landed. A request with nowhere it landed goes red, at\n// the top. No model: the Secretary reads it out, the Desk shows it.\n\nexport const TODAY_ZONE = \"Africa/Tunis\"\n\nexport interface Landed { kind: string; ref: string }\n\nexport interface TodayRow {\n id: string\n /** HH:MM, Tunis time. */\n time: string\n words: string\n state: string\n owner: string\n landed: Landed[]\n noHome: boolean\n}\n\n/** Epoch ms of the last 00:00 in `zone` at or before `now`. */\nexport function startOfDay(now: number, zone = TODAY_ZONE): number {\n const parts = Object.fromEntries(\n new Intl.DateTimeFormat(\"en-GB\", { timeZone: zone, hour12: false, hour: \"2-digit\", minute: \"2-digit\", second: \"2-digit\" })\n .formatToParts(new Date(now)).map((p) => [p.type, p.value]),\n )\n const elapsed = ((Number(parts.hour) % 24) * 3600 + Number(parts.minute) * 60 + Number(parts.second)) * 1000 + (now % 1000)\n return now - elapsed\n}\n\nconst clock = (ms: number, zone: string) =>\n new Intl.DateTimeFormat(\"en-GB\", { timeZone: zone, hour12: false, hour: \"2-digit\", minute: \"2-digit\" }).format(new Date(ms))\n\n/** The first `n` words of a request, on one line. */\nexport function firstWords(text: string, n = 10): string {\n const words = text.replace(/\\s+/g, \" \").trim().split(\" \")\n return words.slice(0, n).join(\" \") + (words.length > n ? \" …\" : \"\")\n}\n\n/** Link kinds that say where the work lives: a home (#394), or an\n * approval card put to the owner. Runs, delegations and workflows do not. */\nconst LANDING_LINKS = new Set([\"issue\", \"idea\", \"approval\", \"erp\", \"card\"])\n\nexport function todayRows(\n items: Array<RequestRecord & { links?: Array<{ kind: string; ref: string }> }>,\n opts: { hasPlan?: (id: string) => boolean; zone?: string } = {},\n): TodayRow[] {\n const rows = items.map((r): TodayRow => {\n const landed: Landed[] = []\n const add = (kind: string, ref: string) => { if (!landed.some((l) => l.kind === kind && l.ref === ref)) landed.push({ kind, ref }) }\n for (const l of r.links ?? []) if (LANDING_LINKS.has(l.kind)) add(l.kind, l.ref)\n if (r.home) add(r.home.kind, r.home.link)\n if (opts.hasPlan?.(r.id)) add(\"plan\", r.id)\n if (r.evidence) add(\"evidence\", r.evidence)\n return {\n id: r.id, time: clock(r.createdAt, opts.zone ?? TODAY_ZONE), words: firstWords(r.text), state: r.state, owner: r.agentId,\n // Declined or dropped: closed on purpose, nothing was to land.\n landed, noHome: landed.length === 0 && r.state !== \"declined\" && r.state !== \"dropped\",\n }\n })\n // Red first; each group in the order asked.\n return [...rows.filter((r) => r.noHome), ...rows.filter((r) => !r.noHome)]\n}\n","import { startOfDay, TODAY_ZONE } from \"./today\"\nimport type { RequestStore } from \"./store\"\n\n// --- The daily flow rate of requests (#1542) ---\n//\n// Every request asked in a day (the owner's day, `requests.flow.timeZone`),\n// and where each one stands now:\n// asked requests made that day (candidates left out)\n// done closed as done\n// dropped declined or dropped: each carries its reason, listed beside\n// the rate so a wrong drop can be seen\n// moving in progress, or waiting on another agent\n// waiting waiting on the owner\n// stuck needs attention\n// rate (done + dropped) / asked; null on a day nothing was asked\n// resent resent once by the requests check (resend.ts), and how many\n// of those are done now\n// Read only, recomputed on every call: a request closed later moves the\n// day it was asked. No model.\n\nexport interface FlowSettings {\n timeZone: string\n days: number\n}\n\nexport const DEFAULT_FLOW: FlowSettings = { timeZone: TODAY_ZONE, days: 7 }\n\n/** Days one report may cover: closed requests age out after retentionDays. */\nexport const FLOW_DAYS_MAX = 90\n\n/** Drop reasons listed per day. */\nconst REASONS_MAX = 5\nconst REASON_WORDS = 120\n\nexport interface FlowDay {\n /** YYYY-MM-DD in the zone. */\n day: string\n /** Epoch ms of the day's 00:00 in the zone. */\n start: number\n asked: number\n done: number\n dropped: number\n moving: number\n waiting: number\n stuck: number\n rate: number | null\n /** Most frequent reasons first; `more` counts the drops not listed. */\n dropReasons: Array<{ reason: string; count: number }>\n moreReasons: number\n resent: number\n resentDone: number\n}\n\nexport interface FlowReport {\n zone: string\n /** Oldest first; the last one is today. */\n days: FlowDay[]\n today: FlowDay\n}\n\nconst dayKey = (ms: number, zone: string) =>\n new Intl.DateTimeFormat(\"en-CA\", { timeZone: zone, year: \"numeric\", month: \"2-digit\", day: \"2-digit\" }).format(new Date(ms))\n\nfunction emptyDay(start: number, zone: string): FlowDay {\n return { day: dayKey(start, zone), start, asked: 0, done: 0, dropped: 0, moving: 0, waiting: 0, stuck: 0, rate: null, dropReasons: [], moreReasons: 0, resent: 0, resentDone: 0 }\n}\n\nexport function flowReport(store: RequestStore, opts: { days?: number; zone?: string; now?: number } = {}): FlowReport {\n const zone = opts.zone ?? DEFAULT_FLOW.timeZone\n const count = Math.min(Math.max(Math.floor(opts.days ?? DEFAULT_FLOW.days), 1), FLOW_DAYS_MAX)\n const now = opts.now ?? Date.now()\n // Walked back one 00:00 at a time: a day across a clock change is 23 or 25 h.\n const starts = [startOfDay(now, zone)]\n while (starts.length < count) starts.unshift(startOfDay(starts[0] - 1, zone))\n const days = starts.map((s) => emptyDay(s, zone))\n const reasons = days.map(() => new Map<string, number>())\n let i = 0\n for (const r of store.flowRows(starts[0])) {\n while (i + 1 < days.length && r.createdAt >= days[i + 1].start) i++\n const d = days[i]\n d.asked++\n if (r.state === \"done\") d.done++\n else if (r.state === \"declined\" || r.state === \"dropped\") {\n d.dropped++\n const why = (r.closeReason ?? \"\").replace(/\\s+/g, \" \").trim()\n const key = why.length > REASON_WORDS ? `${why.slice(0, REASON_WORDS - 1)}…` : why || \"no reason given\"\n reasons[i].set(key, (reasons[i].get(key) ?? 0) + 1)\n } else if (r.state === \"in_progress\" || r.state === \"waiting_other\") d.moving++\n else if (r.state === \"waiting_owner\") d.waiting++\n else if (r.state === \"needs_attention\") d.stuck++\n if (r.resentAt !== null) {\n d.resent++\n if (r.state === \"done\") d.resentDone++\n }\n }\n days.forEach((d, n) => {\n d.rate = d.asked ? (d.done + d.dropped) / d.asked : null\n const sorted = [...reasons[n]].sort((a, b) => b[1] - a[1])\n d.dropReasons = sorted.slice(0, REASONS_MAX).map(([reason, c]) => ({ reason, count: c }))\n d.moreReasons = sorted.slice(REASONS_MAX).reduce((sum, [, c]) => sum + c, 0)\n })\n return { zone, days, today: days[days.length - 1] }\n}\n\nconst pct = (rate: number | null) => (rate === null ? \"–\" : `${Math.round(rate * 100)}%`)\n\n/** Today's figure, then one line per day, oldest first: what the CLI\n * prints and the agentx_request tool answers. */\nexport function describeFlow(f: FlowReport): string {\n const t = f.today\n const lines = [\n `Today (${t.day}, ${f.zone}): ${t.asked ? `${t.done + t.dropped} of ${t.asked} closed, ${pct(t.rate)}` : \"nothing asked yet\"}.`,\n ` ${t.done} done, ${t.dropped} dropped, ${t.moving} moving, ${t.waiting} waiting on the owner, ${t.stuck} stuck.` +\n (t.resent ? ` ${t.resent} resent once on its own, ${t.resentDone} of them done.` : \"\"),\n ]\n if (t.dropReasons.length) {\n lines.push(\" Dropped because:\")\n for (const r of t.dropReasons) lines.push(` ${r.count} × ${r.reason}`)\n if (t.moreReasons) lines.push(` ${t.moreReasons} more`)\n }\n if (f.days.length > 1) {\n lines.push(\"\", \"Day asked done dropped moving waiting stuck rate\")\n for (const d of f.days) {\n const cells = [d.asked, d.done, d.dropped, d.moving, d.waiting, d.stuck].map(String)\n lines.push(`${d.day} ${cells[0].padStart(5)} ${cells[1].padStart(4)} ${cells[2].padStart(7)} ${cells[3].padStart(6)} ${cells[4].padStart(7)} ${cells[5].padStart(5)} ${pct(d.rate).padStart(4)}`)\n }\n }\n return lines.join(\"\\n\")\n}\n"],"mappings":"yFACAA,ICAAC,IAwBA,IAAMC,EAAa,IACbC,EAA8B,CAAC,SAAU,MAAO,KAAK,EACrDC,EAAa,0BAEbC,EAAOC,GAAgB,OAAOA,GAAM,SAAWA,EAAE,KAAK,EAAI,GAEzD,SAASC,EAAeC,EAAkD,CAC/E,IAAMC,EAAWJ,EAAIG,EAAI,QAAQ,EAAE,YAAY,EAC/C,GAAIC,IAAa,UAAYA,IAAa,SAAU,MAAO,0CAC3D,IAAMC,EAAUL,EAAIG,EAAI,OAAO,EACzBG,EAAQD,EAAQ,MAAM,GAAG,EAC/B,GAAI,CAACN,EAAW,KAAKM,CAAO,GAAKC,EAAM,KAAMC,GAAMA,IAAM,KAAOA,IAAM,IAAI,GAAMH,IAAa,UAAYE,EAAM,SAAW,EACxH,OAAOF,IAAa,SAAW,qCAAuC,wCAExE,IAAMI,GAAQR,EAAIG,EAAI,IAAI,GAAK,UAAU,YAAY,EACrD,GAAI,CAAEL,EAA4B,SAASU,CAAI,EAAG,MAAO,6BAA6BV,EAAM,KAAK,IAAI,IACrG,IAAMW,EAAMN,EAAI,MAAQ,QAAaA,EAAI,MAAQ,MAAQA,EAAI,MAAQ,GAAK,EAAI,OAAOA,EAAI,GAAG,EAC5F,MAAI,CAAC,O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AE,oBAAoB,EAAE,kBAAkB,EAAE,iCAAiC,EAAE,gBACjG,EAAE,OAAS,IAAI,EAAE,kCAAkC,EAAE,2BAA6B,GACvF,EACA,GAAI,EAAE,YAAY,OAAQ,CACxBI,EAAM,KAAK,oBAAoB,EAC/B,QAAWf,KAAK,EAAE,YAAae,EAAM,KAAK,OAAOf,EAAE,cAAWA,EAAE,QAAQ,EACpE,EAAE,aAAae,EAAM,KAAK,OAAO,EAAE,kBAAkB,EAE3D,GAAID,EAAE,KAAK,OAAS,EAAG,CACrBC,EAAM,KAAK,GAAI,gEAAgE,EAC/E,QAAWZ,KAAKW,EAAE,KAAM,CACtB,IAAME,EAAQ,CAACb,EAAE,MAAOA,EAAE,KAAMA,EAAE,QAASA,EAAE,OAAQA,EAAE,QAASA,EAAE,KAAK,EAAE,IAAI,MAAM,EACnFY,EAAM,KAAK,GAAGZ,EAAE,QAAQa,EAAM,CAAC,EAAE,SAAS,CAAC,MAAMA,EAAM,CAAC,EAAE,SAAS,CAAC,MAAMA,EAAM,CAAC,EAAE,SAAS,CAAC,MAAMA,EAAM,CAAC,EAAE,SAAS,CAAC,MAAMA,EAAM,CAAC,EAAE,SAAS,CAAC,MAAMA,EAAM,CAAC,EAAE,SAAS,CAAC,MAAML,EAAIR,EAAE,IAAI,EAAE,SAAS,CAAC,GAAG,GAG3M,OAAOY,EAAM,KAAK;AAAA,CAAI,CACxB","names":["init_checkers","init_issue","TIMEOUT_MS","WHATS","PROJECT_RE","str","v","parseCountSpec","raw","provider","project","parts","p","what","max","readCountSpec","json","spec","whatWords","w","describeCount","checkCount","counter","kinds","count","kind","n","detail","e","forgeCounter","connectors","doFetch","url","c","q","res","forgeHeaders","total","body","GOAL_STATES","DONE_WHEN_MAX","GOAL_EVIDENCE_MAX","parseGoalCheck","v","settings","DEFAULT_CHECKER_SETTINGS","now","spec","parseCountSpec","parseCloseWhen","readGoalCheck","json","readCountSpec","readCloseWhen","describeGoalCheck","check","describeCount","describeCloseWhen","toGoal","r","GoalStore","db","id","row","states","limit","marks","goal","ownerAgent","input","had","state","evidence","detail","before","checkGoals","store","everyMinutes","log","closed","g","res","e","goalBrief","counts","lines","TODAY_ZONE","startOfDay","now","zone","parts","p","elapsed","clock","ms","firstWords","text","n","words","LANDING_LINKS","todayRows","items","opts","rows","r","landed","add","kind","ref","l","DEFAULT_FLOW","TODAY_ZONE","FLOW_DAYS_MAX","REASONS_MAX","REASON_WORDS","dayKey","ms","zone","emptyDay","start","flowReport","store","opts","count","now","starts","startOfDay","days","s","reasons","i","r","why","key","d","n","sorted","a","b","reason","c","sum","pct","rate","describeFlow","f","lines","cells"]}
|