agentix-cli 0.80.1 → 0.81.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.
Files changed (148) hide show
  1. package/dist/{App-KVH5POXZ.js → App-HF6W6CV2.js} +2 -2
  2. package/dist/{App-KVH5POXZ.js.map → App-HF6W6CV2.js.map} +1 -1
  3. package/dist/ChatApp-74VBWP7R.js +7 -0
  4. package/dist/{ChatApp-LD4TXJWP.js.map → ChatApp-74VBWP7R.js.map} +1 -1
  5. package/dist/{agent-FUMJM6OW.js → agent-BDEPUFBQ.js} +2 -2
  6. package/dist/{board-dashboard-OS5J3F73.js → board-dashboard-TWEF5XVE.js} +186 -169
  7. package/dist/board-dashboard-TWEF5XVE.js.map +1 -0
  8. package/dist/{chunk-R42S57G6.js → chunk-4KJ3PCAI.js} +2 -2
  9. package/dist/{chunk-PE55MMLK.js → chunk-5GXCOHDM.js} +2 -2
  10. package/dist/{chunk-PE55MMLK.js.map → chunk-5GXCOHDM.js.map} +1 -1
  11. package/dist/{chunk-BJPIRNP6.js → chunk-74FSHUB3.js} +2 -2
  12. package/dist/{chunk-H7253EHW.js → chunk-ATXE3EMV.js} +2 -2
  13. package/dist/{chunk-TEFMZY6B.js → chunk-BB3ESU74.js} +2 -2
  14. package/dist/{chunk-XESESMKN.js → chunk-BDM4VTBR.js} +39 -39
  15. package/dist/{chunk-XESESMKN.js.map → chunk-BDM4VTBR.js.map} +1 -1
  16. package/dist/chunk-BYD5B3P3.js +9 -0
  17. package/dist/{chunk-Z3IP66SL.js.map → chunk-BYD5B3P3.js.map} +1 -1
  18. package/dist/chunk-EFV7U5LD.js +152 -0
  19. package/dist/chunk-EFV7U5LD.js.map +1 -0
  20. package/dist/chunk-ES7Z64Z5.js +22 -0
  21. package/dist/chunk-ES7Z64Z5.js.map +1 -0
  22. package/dist/{chunk-WP6KLXTP.js → chunk-GLQLCBJS.js} +4 -4
  23. package/dist/chunk-GLQLCBJS.js.map +1 -0
  24. package/dist/{chunk-UB63NQQL.js → chunk-GUAJNZIX.js} +2 -2
  25. package/dist/{chunk-UXSYVMPK.js → chunk-HUQRPEDP.js} +2 -2
  26. package/dist/{chunk-BEHC3X42.js → chunk-HYE2UUQ4.js} +242 -211
  27. package/dist/chunk-HYE2UUQ4.js.map +1 -0
  28. package/dist/chunk-JG3O5GL6.js +5 -0
  29. package/dist/{chunk-MOQNLS5Z.js.map → chunk-JG3O5GL6.js.map} +1 -1
  30. package/dist/chunk-JXF54PT7.js +2 -0
  31. package/dist/chunk-JXF54PT7.js.map +1 -0
  32. package/dist/chunk-LTHQXWZN.js +51 -0
  33. package/dist/chunk-LTHQXWZN.js.map +1 -0
  34. package/dist/{chunk-ZR3NZLJL.js → chunk-LUL4ILAQ.js} +2 -2
  35. package/dist/{chunk-N6EWZGIX.js → chunk-PN6XHTG5.js} +6 -6
  36. package/dist/{chunk-N6EWZGIX.js.map → chunk-PN6XHTG5.js.map} +1 -1
  37. package/dist/{chunk-7IGSJGXI.js → chunk-TW4L6RP2.js} +2 -2
  38. package/dist/chunk-UCKKAWLZ.js +2 -0
  39. package/dist/chunk-UCKKAWLZ.js.map +1 -0
  40. package/dist/{chunk-3UN6CXRL.js → chunk-VVW4JYV6.js} +24 -24
  41. package/dist/chunk-VVW4JYV6.js.map +1 -0
  42. package/dist/{chunk-BVZFYBBP.js → chunk-WWU2D65N.js} +2 -2
  43. package/dist/chunk-XF65CDNS.js +5 -0
  44. package/dist/{chunk-UR3ZIDMA.js.map → chunk-XF65CDNS.js.map} +1 -1
  45. package/dist/{chunk-YCI3KUYF.js → chunk-XQ7MVPWP.js} +7 -7
  46. package/dist/chunk-XQ7MVPWP.js.map +1 -0
  47. package/dist/{chunk-MYRSNJJ4.js → chunk-ZDDJNKU5.js} +2 -2
  48. package/dist/{chunk-Z3XUGXPD.js → chunk-ZUAV3PTL.js} +2 -2
  49. package/dist/cli.js +1 -1
  50. package/dist/cli.js.map +1 -1
  51. package/dist/client-JDY2FZUF.js +2 -0
  52. package/dist/config-JCETBKWT.js +2 -0
  53. package/dist/config-mutator-YQWTY47O.js +2 -0
  54. package/dist/doctor-6EWW7NC2.js +2 -0
  55. package/dist/{facts-U7BUYRXN.js → facts-5T5GRUTG.js} +6 -6
  56. package/dist/{facts-U7BUYRXN.js.map → facts-5T5GRUTG.js.map} +1 -1
  57. package/dist/{failure-candidates-RIXA3Y6D.js → failure-candidates-PBPF45GN.js} +2 -2
  58. package/dist/index.d.ts +619 -499
  59. package/dist/index.js +1 -1
  60. package/dist/index.js.map +1 -1
  61. package/dist/{chunk-AF46YOLU.js → program-FUYHN2F7.js} +194 -184
  62. package/dist/program-FUYHN2F7.js.map +1 -0
  63. package/dist/promote-ZZWMGVO2.js +2 -0
  64. package/dist/query-OQBB7EFS.js +2 -0
  65. package/dist/registry-PLSOZ3CL.js +2 -0
  66. package/dist/request-planner-HX44G2SX.js +2 -0
  67. package/dist/{request-planner-H74KHFGJ.js.map → request-planner-HX44G2SX.js.map} +1 -1
  68. package/dist/review-candidates-FBDLPU6H.js +4 -0
  69. package/dist/{review-candidates-IPJWEXR2.js.map → review-candidates-FBDLPU6H.js.map} +1 -1
  70. package/dist/routing-3SZHWHUA.js +2 -0
  71. package/dist/schedule-tool-5FULSHWJ.js +2 -0
  72. package/dist/scheduler-ITOKSMYT.js +2 -0
  73. package/dist/seat-2HJG3UNW.js +2 -0
  74. package/dist/select-UKAOL7QB.js +2 -0
  75. package/dist/{select-BUWOD47K.js.map → select-UKAOL7QB.js.map} +1 -1
  76. package/dist/set-enabled-ADFSNG5A.js +2 -0
  77. package/dist/{set-enabled-XWSFTICB.js.map → set-enabled-ADFSNG5A.js.map} +1 -1
  78. package/dist/signal-exit-WL7G3EEZ.js +2 -0
  79. package/dist/signal-exit-WL7G3EEZ.js.map +1 -0
  80. package/dist/{surface-usage-HVVP22SA.js → surface-usage-O5L4KLGS.js} +2 -2
  81. package/dist/{tool-VOA4HSVP.js → tool-MSXWU44P.js} +2 -2
  82. package/dist/{tool-VOA4HSVP.js.map → tool-MSXWU44P.js.map} +1 -1
  83. package/dist/{tool-GUINJ2BQ.js → tool-X7YEIJVZ.js} +2 -2
  84. package/dist/{tool-GUINJ2BQ.js.map → tool-X7YEIJVZ.js.map} +1 -1
  85. package/dist/wiki-QUVWB4IN.js +2 -0
  86. package/package.json +1 -1
  87. package/dist/ChatApp-LD4TXJWP.js +0 -7
  88. package/dist/board-dashboard-OS5J3F73.js.map +0 -1
  89. package/dist/chunk-3UN6CXRL.js.map +0 -1
  90. package/dist/chunk-42Y3BXXS.js +0 -15
  91. package/dist/chunk-42Y3BXXS.js.map +0 -1
  92. package/dist/chunk-6JJ3GODZ.js +0 -57
  93. package/dist/chunk-6JJ3GODZ.js.map +0 -1
  94. package/dist/chunk-AF46YOLU.js.map +0 -1
  95. package/dist/chunk-API4IZZG.js +0 -2
  96. package/dist/chunk-API4IZZG.js.map +0 -1
  97. package/dist/chunk-BEHC3X42.js.map +0 -1
  98. package/dist/chunk-MOQNLS5Z.js +0 -5
  99. package/dist/chunk-NOAAK2XI.js +0 -152
  100. package/dist/chunk-NOAAK2XI.js.map +0 -1
  101. package/dist/chunk-UR3ZIDMA.js +0 -5
  102. package/dist/chunk-WP6KLXTP.js.map +0 -1
  103. package/dist/chunk-YCI3KUYF.js.map +0 -1
  104. package/dist/chunk-Z3IP66SL.js +0 -9
  105. package/dist/client-TJ5YZOEE.js +0 -2
  106. package/dist/config-4WZ7Y34V.js +0 -2
  107. package/dist/config-mutator-5Z7EEB5N.js +0 -2
  108. package/dist/doctor-7K3NRBNN.js +0 -2
  109. package/dist/program-KMQNX6YK.js +0 -2
  110. package/dist/promote-NDC3X54P.js +0 -2
  111. package/dist/query-F7BD3JPE.js +0 -2
  112. package/dist/registry-5NBHBVY3.js +0 -2
  113. package/dist/request-planner-H74KHFGJ.js +0 -2
  114. package/dist/review-candidates-IPJWEXR2.js +0 -4
  115. package/dist/routing-3RSG7SKW.js +0 -2
  116. package/dist/schedule-tool-7NYAK43U.js +0 -2
  117. package/dist/scheduler-24O7PADJ.js +0 -2
  118. package/dist/seat-TOM2WHQR.js +0 -2
  119. package/dist/select-BUWOD47K.js +0 -2
  120. package/dist/set-enabled-XWSFTICB.js +0 -2
  121. package/dist/wiki-VFME4T2H.js +0 -2
  122. package/dist/wiki-VFME4T2H.js.map +0 -1
  123. /package/dist/{agent-FUMJM6OW.js.map → agent-BDEPUFBQ.js.map} +0 -0
  124. /package/dist/{chunk-R42S57G6.js.map → chunk-4KJ3PCAI.js.map} +0 -0
  125. /package/dist/{chunk-BJPIRNP6.js.map → chunk-74FSHUB3.js.map} +0 -0
  126. /package/dist/{chunk-H7253EHW.js.map → chunk-ATXE3EMV.js.map} +0 -0
  127. /package/dist/{chunk-TEFMZY6B.js.map → chunk-BB3ESU74.js.map} +0 -0
  128. /package/dist/{chunk-UB63NQQL.js.map → chunk-GUAJNZIX.js.map} +0 -0
  129. /package/dist/{chunk-UXSYVMPK.js.map → chunk-HUQRPEDP.js.map} +0 -0
  130. /package/dist/{chunk-ZR3NZLJL.js.map → chunk-LUL4ILAQ.js.map} +0 -0
  131. /package/dist/{chunk-7IGSJGXI.js.map → chunk-TW4L6RP2.js.map} +0 -0
  132. /package/dist/{chunk-BVZFYBBP.js.map → chunk-WWU2D65N.js.map} +0 -0
  133. /package/dist/{chunk-MYRSNJJ4.js.map → chunk-ZDDJNKU5.js.map} +0 -0
  134. /package/dist/{chunk-Z3XUGXPD.js.map → chunk-ZUAV3PTL.js.map} +0 -0
  135. /package/dist/{client-TJ5YZOEE.js.map → client-JDY2FZUF.js.map} +0 -0
  136. /package/dist/{config-4WZ7Y34V.js.map → config-JCETBKWT.js.map} +0 -0
  137. /package/dist/{config-mutator-5Z7EEB5N.js.map → config-mutator-YQWTY47O.js.map} +0 -0
  138. /package/dist/{doctor-7K3NRBNN.js.map → doctor-6EWW7NC2.js.map} +0 -0
  139. /package/dist/{failure-candidates-RIXA3Y6D.js.map → failure-candidates-PBPF45GN.js.map} +0 -0
  140. /package/dist/{program-KMQNX6YK.js.map → promote-ZZWMGVO2.js.map} +0 -0
  141. /package/dist/{promote-NDC3X54P.js.map → query-OQBB7EFS.js.map} +0 -0
  142. /package/dist/{query-F7BD3JPE.js.map → registry-PLSOZ3CL.js.map} +0 -0
  143. /package/dist/{registry-5NBHBVY3.js.map → routing-3SZHWHUA.js.map} +0 -0
  144. /package/dist/{routing-3RSG7SKW.js.map → schedule-tool-5FULSHWJ.js.map} +0 -0
  145. /package/dist/{schedule-tool-7NYAK43U.js.map → scheduler-ITOKSMYT.js.map} +0 -0
  146. /package/dist/{scheduler-24O7PADJ.js.map → seat-2HJG3UNW.js.map} +0 -0
  147. /package/dist/{seat-TOM2WHQR.js.map → surface-usage-O5L4KLGS.js.map} +0 -0
  148. /package/dist/{surface-usage-HVVP22SA.js.map → wiki-QUVWB4IN.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{v as l,w}from"./chunk-PE55MMLK.js";import{a as i,f as p}from"./chunk-72SZI2UW.js";w();p();var d="task-tier";function u(e){return{task:m(e.message,2e3),agent:e.agent,channel:e.channel??null,continuesExistingSession:e.isFollowUp??!1,...e.toolsAvailable?{toolsAvailable:e.toolsAvailable}:{}}}var c={needsFlagship:i("This task needs the strongest available model to be done correctly.",{true:"Doing it well takes real reasoning: writing or reviewing code, diagnosing a failure, planning work across several steps, weighing a judgement, handling money, touching production or anything irreversible, following a long or ambiguous instruction, or work where being subtly wrong would not be noticed. Anything where a weaker model would produce something that LOOKS right belongs here.",false:"It is mechanical and its result is obvious on sight: acknowledging or confirming a message, restating or formatting something already written, a greeting, a status echo, reading one file and reporting what it says, a lookup with one right answer, a scheduled heartbeat with nothing to decide."})};function g(e){return e.needsFlagship.noul}function m(e,n){return e.length>n?`${e.slice(0,n)}\u2026`:e}var h=.2,T=60*60*1e3;function F(e,n){if(e==="claude-code"){let t=n?.cheapModels?.[e]??n?.cheapModel;return t&&/^(claude-|haiku$|sonnet$|opus$)/.test(t)?t:void 0}if(e==="codex-cli"){let t=n?.cheapModels?.[e];return t&&/^(gpt-|o\d)/.test(t)?t:void 0}}async function _(e){let n=(s,r=null)=>({downgraded:!1,needsFlagship:r,reason:s});if(e.channel==="voice"||e.channel==="desktop"||e.channel==="opencode")return n(`${e.channel} requests retain the configured model`);if(!e.cheapModel)return n("no cheaper model configured");if(e.isFollowUp){let s=e.sessionIdleMs??0,r=e.cacheTtlMs??T;if(s<r)return n(`follow-up on a warm cache (idle ${Math.round(s/1e3)}s) \u2014 swapping would cost more than it saves`)}let t;try{t=await l(d,u(e),c,{incumbent:{needsFlagship:1},features:{agent:e.agent,channel:e.channel??"unknown"},timeoutMs:1500})}catch{return n("routing seat threw \u2014 keeping the flagship")}if(!t)return n("routing seat unavailable \u2014 keeping the flagship");let o=g(t.answers);if(t.mode!=="active")return n(`shadow \u2014 would ${o<(e.threshold??h)?"downgrade":"keep"} (${o.toFixed(2)})`,o);let a=e.threshold??h;return o>=a?n(`needs the flagship (${o.toFixed(2)})`,o):{model:e.cheapModel,downgraded:!0,needsFlagship:o,reason:`mechanical task (${o.toFixed(2)} below ${a}) \u2192 ${e.cheapModel}`}}export{F as a,_ as b};
2
- //# sourceMappingURL=chunk-BJPIRNP6.js.map
1
+ import{v as l,w}from"./chunk-5GXCOHDM.js";import{a as i,f as p}from"./chunk-72SZI2UW.js";w();p();var d="task-tier";function u(e){return{task:m(e.message,2e3),agent:e.agent,channel:e.channel??null,continuesExistingSession:e.isFollowUp??!1,...e.toolsAvailable?{toolsAvailable:e.toolsAvailable}:{}}}var c={needsFlagship:i("This task needs the strongest available model to be done correctly.",{true:"Doing it well takes real reasoning: writing or reviewing code, diagnosing a failure, planning work across several steps, weighing a judgement, handling money, touching production or anything irreversible, following a long or ambiguous instruction, or work where being subtly wrong would not be noticed. Anything where a weaker model would produce something that LOOKS right belongs here.",false:"It is mechanical and its result is obvious on sight: acknowledging or confirming a message, restating or formatting something already written, a greeting, a status echo, reading one file and reporting what it says, a lookup with one right answer, a scheduled heartbeat with nothing to decide."})};function g(e){return e.needsFlagship.noul}function m(e,n){return e.length>n?`${e.slice(0,n)}\u2026`:e}var h=.2,T=60*60*1e3;function F(e,n){if(e==="claude-code"){let t=n?.cheapModels?.[e]??n?.cheapModel;return t&&/^(claude-|haiku$|sonnet$|opus$)/.test(t)?t:void 0}if(e==="codex-cli"){let t=n?.cheapModels?.[e];return t&&/^(gpt-|o\d)/.test(t)?t:void 0}}async function _(e){let n=(s,r=null)=>({downgraded:!1,needsFlagship:r,reason:s});if(e.channel==="voice"||e.channel==="desktop"||e.channel==="opencode")return n(`${e.channel} requests retain the configured model`);if(!e.cheapModel)return n("no cheaper model configured");if(e.isFollowUp){let s=e.sessionIdleMs??0,r=e.cacheTtlMs??T;if(s<r)return n(`follow-up on a warm cache (idle ${Math.round(s/1e3)}s) \u2014 swapping would cost more than it saves`)}let t;try{t=await l(d,u(e),c,{incumbent:{needsFlagship:1},features:{agent:e.agent,channel:e.channel??"unknown"},timeoutMs:1500})}catch{return n("routing seat threw \u2014 keeping the flagship")}if(!t)return n("routing seat unavailable \u2014 keeping the flagship");let o=g(t.answers);if(t.mode!=="active")return n(`shadow \u2014 would ${o<(e.threshold??h)?"downgrade":"keep"} (${o.toFixed(2)})`,o);let a=e.threshold??h;return o>=a?n(`needs the flagship (${o.toFixed(2)})`,o):{model:e.cheapModel,downgraded:!0,needsFlagship:o,reason:`mechanical task (${o.toFixed(2)} below ${a}) \u2192 ${e.cheapModel}`}}export{F as a,_ as b};
2
+ //# sourceMappingURL=chunk-74FSHUB3.js.map
@@ -1,2 +1,2 @@
1
- import{a as o}from"./chunk-ZR3NZLJL.js";import{resolve as a}from"path";import{existsSync as d,readdirSync as c,mkdirSync as l}from"fs";var g=class{baseDir;agentsDir;mode;sharedStore;agentStores=new Map;log;constructor(t=a(process.cwd(),".agentx/wiki"),e=console.error.bind(console,"[wiki-hub]"),r="graph"){this.baseDir=t,this.agentsDir=a(t,"agents"),this.mode=r,this.log=e,l(this.agentsDir,{recursive:!0}),this.sharedStore=new o(t,e)}getMode(){return this.mode}getAgentWiki(t){let e=`${t}:${this.mode}`;if(this.agentStores.has(e))return this.agentStores.get(e);let r=a(this.agentsDir,t,this.mode),i=new o(r,this.log);return this.agentStores.set(e,i),i}getBaseDir(){return this.baseDir}getSharedStore(){return this.sharedStore}listAgents(){let t=new Set,e=this.sharedStore.listEntries();for(let r of e)t.add(r.agentId);if(d(this.agentsDir))for(let r of c(this.agentsDir))!r.startsWith("_")&&!r.startsWith(".")&&t.add(r);return[...t].sort()}getAgentEntries(t){return this.sharedStore.listEntries({agentId:t})}getUnabsorbedEntries(t){let e=this.getAgentWiki(t),r=this.getAgentEntries(t),i=new Set,n=e.rebuildIndex();for(let s of n.articles)if(s.sources)for(let h of s.sources)i.add(h);return r.filter(s=>!i.has(s.id))}summary(){return this.listAgents().map(e=>{let r=this.getAgentEntries(e),n=this.getAgentWiki(e).rebuildIndex(),s=this.getUnabsorbedEntries(e);return{agentId:e,totalEntries:r.length,totalArticles:n.articles.length,unabsorbed:s.length,articles:n.articles}})}};export{g as a};
2
- //# sourceMappingURL=chunk-H7253EHW.js.map
1
+ import{a as o}from"./chunk-LUL4ILAQ.js";import{resolve as a}from"path";import{existsSync as d,readdirSync as c,mkdirSync as l}from"fs";var g=class{baseDir;agentsDir;mode;sharedStore;agentStores=new Map;log;constructor(t=a(process.cwd(),".agentx/wiki"),e=console.error.bind(console,"[wiki-hub]"),r="graph"){this.baseDir=t,this.agentsDir=a(t,"agents"),this.mode=r,this.log=e,l(this.agentsDir,{recursive:!0}),this.sharedStore=new o(t,e)}getMode(){return this.mode}getAgentWiki(t){let e=`${t}:${this.mode}`;if(this.agentStores.has(e))return this.agentStores.get(e);let r=a(this.agentsDir,t,this.mode),i=new o(r,this.log);return this.agentStores.set(e,i),i}getBaseDir(){return this.baseDir}getSharedStore(){return this.sharedStore}listAgents(){let t=new Set,e=this.sharedStore.listEntries();for(let r of e)t.add(r.agentId);if(d(this.agentsDir))for(let r of c(this.agentsDir))!r.startsWith("_")&&!r.startsWith(".")&&t.add(r);return[...t].sort()}getAgentEntries(t){return this.sharedStore.listEntries({agentId:t})}getUnabsorbedEntries(t){let e=this.getAgentWiki(t),r=this.getAgentEntries(t),i=new Set,n=e.rebuildIndex();for(let s of n.articles)if(s.sources)for(let h of s.sources)i.add(h);return r.filter(s=>!i.has(s.id))}summary(){return this.listAgents().map(e=>{let r=this.getAgentEntries(e),n=this.getAgentWiki(e).rebuildIndex(),s=this.getUnabsorbedEntries(e);return{agentId:e,totalEntries:r.length,totalArticles:n.articles.length,unabsorbed:s.length,articles:n.articles}})}};export{g as a};
2
+ //# sourceMappingURL=chunk-ATXE3EMV.js.map
@@ -1,2 +1,2 @@
1
- import{q as p}from"./chunk-R42S57G6.js";import{b as i,c as u,d as l,e as c}from"./chunk-UR3ZIDMA.js";import d from"cronstrue";var f=Intl.DateTimeFormat().resolvedOptions().timeZone,m=600,E='Try: "every morning at 9", "weekdays at 6pm", "every 15 minutes", "every monday at 10am", "1st of every month at noon", "daily at 9:30am", "every hour"',g=/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/;function w(e){return g.test(e)}function x(e){try{return new Intl.DateTimeFormat("en-US",{timeZone:e}),!0}catch{return!1}}function $(e){return e?e.split(",").map(r=>r.trim().toLowerCase()).filter(r=>r==="log"||r==="notify"||r==="disable"):["log"]}function S(e){let r=[...e.onError??["log"]];e.notify&&!r.includes("notify")&&r.push("notify");let t={enabled:e.enabled??!0,schedule:e.parsed.cron,timezone:e.timezone||f,agent:e.agent,prompt:e.prompt,timeout:e.timeout??m,onError:r};return e.model&&(t.model=e.model),e.notify&&(t.notify=e.notify),e.createdBy&&(t.createdBy=e.createdBy),e.approval&&(t.approval=e.approval),t}function P(e){try{return d.toString(e,{use24HourTimeFormat:!1})}catch{return e}}function T(e,r,t=new Date){try{return p(e,t,r)}catch{return null}}function A(e,r){if(!e)return"unknown (no match within a year)";try{return`${new Intl.DateTimeFormat("en-GB",{timeZone:r,weekday:"short",day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(e)} (${r})`}catch{return e.toISOString()}}function h(e){return e?.approval?.action==="create"}async function D(e,r={}){let t="",o=await i(n=>{let a=l(n,`crons.${e}`);if(!a)throw new Error(`cron "${e}" not found`);let s=a.approval;if(!s)throw new Error(`cron "${e}" has no pending request`);s.action==="create"?(delete a.approval,a.enabled=!0,t=`${e} approved and enabled (requested by ${s.requestedBy})`):(c(n,`crons.${e}`),t=`${e} deletion approved; job removed (requested by ${s.requestedBy})`)},{configPath:r.configPath,reload:r.reload});return o.success?{success:!0,message:t,result:o}:{success:!1,message:o.error||"failed",result:o}}async function I(e,r={}){let t="",o=await i(n=>{let a=l(n,`crons.${e}`);if(!a)throw new Error(`cron "${e}" not found`);let s=a.approval;if(!s)throw new Error(`cron "${e}" has no pending request`);s.action==="create"?(c(n,`crons.${e}`),t=`${e} rejected; pending job removed`):(delete a.approval,t=`${e} deletion rejected; job kept`)},{configPath:r.configPath,reload:r.reload});return o.success?{success:!0,message:t,result:o}:{success:!1,message:o.error||"failed",result:o}}async function O(e,r,t={}){return i(o=>{let n=l(o,`crons.${e}`);if(!n)throw new Error(`cron "${e}" not found`);if(r&&h(n))throw new Error(`cron "${e}" is awaiting approval; run \`agentx schedule approve ${e}\``);u(o,`crons.${e}.enabled`,r)},{configPath:t.configPath,reload:t.reload})}export{f as a,E as b,w as c,x as d,$ as e,S as f,P as g,T as h,A as i,h as j,D as k,I as l,O as m};
2
- //# sourceMappingURL=chunk-TEFMZY6B.js.map
1
+ import{q as p}from"./chunk-4KJ3PCAI.js";import{b as i,c as u,d as l,e as c}from"./chunk-XF65CDNS.js";import d from"cronstrue";var f=Intl.DateTimeFormat().resolvedOptions().timeZone,m=600,E='Try: "every morning at 9", "weekdays at 6pm", "every 15 minutes", "every monday at 10am", "1st of every month at noon", "daily at 9:30am", "every hour"',g=/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/;function w(e){return g.test(e)}function x(e){try{return new Intl.DateTimeFormat("en-US",{timeZone:e}),!0}catch{return!1}}function $(e){return e?e.split(",").map(r=>r.trim().toLowerCase()).filter(r=>r==="log"||r==="notify"||r==="disable"):["log"]}function S(e){let r=[...e.onError??["log"]];e.notify&&!r.includes("notify")&&r.push("notify");let t={enabled:e.enabled??!0,schedule:e.parsed.cron,timezone:e.timezone||f,agent:e.agent,prompt:e.prompt,timeout:e.timeout??m,onError:r};return e.model&&(t.model=e.model),e.notify&&(t.notify=e.notify),e.createdBy&&(t.createdBy=e.createdBy),e.approval&&(t.approval=e.approval),t}function P(e){try{return d.toString(e,{use24HourTimeFormat:!1})}catch{return e}}function T(e,r,t=new Date){try{return p(e,t,r)}catch{return null}}function A(e,r){if(!e)return"unknown (no match within a year)";try{return`${new Intl.DateTimeFormat("en-GB",{timeZone:r,weekday:"short",day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(e)} (${r})`}catch{return e.toISOString()}}function h(e){return e?.approval?.action==="create"}async function D(e,r={}){let t="",o=await i(n=>{let a=l(n,`crons.${e}`);if(!a)throw new Error(`cron "${e}" not found`);let s=a.approval;if(!s)throw new Error(`cron "${e}" has no pending request`);s.action==="create"?(delete a.approval,a.enabled=!0,t=`${e} approved and enabled (requested by ${s.requestedBy})`):(c(n,`crons.${e}`),t=`${e} deletion approved; job removed (requested by ${s.requestedBy})`)},{configPath:r.configPath,reload:r.reload});return o.success?{success:!0,message:t,result:o}:{success:!1,message:o.error||"failed",result:o}}async function I(e,r={}){let t="",o=await i(n=>{let a=l(n,`crons.${e}`);if(!a)throw new Error(`cron "${e}" not found`);let s=a.approval;if(!s)throw new Error(`cron "${e}" has no pending request`);s.action==="create"?(c(n,`crons.${e}`),t=`${e} rejected; pending job removed`):(delete a.approval,t=`${e} deletion rejected; job kept`)},{configPath:r.configPath,reload:r.reload});return o.success?{success:!0,message:t,result:o}:{success:!1,message:o.error||"failed",result:o}}async function O(e,r,t={}){return i(o=>{let n=l(o,`crons.${e}`);if(!n)throw new Error(`cron "${e}" not found`);if(r&&h(n))throw new Error(`cron "${e}" is awaiting approval; run \`agentx schedule approve ${e}\``);u(o,`crons.${e}.enabled`,r)},{configPath:t.configPath,reload:t.reload})}export{f as a,E as b,w as c,x as d,$ as e,S as f,P as g,T as h,A as i,h as j,D as k,I as l,O as m};
2
+ //# sourceMappingURL=chunk-BB3ESU74.js.map