agentix-cli 0.136.1 → 0.137.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/apps/mac-voice/Sources/AgentXVoice/AgentClient.swift +11 -1
  2. package/apps/mac-voice/Sources/AgentXVoice/Character.swift +18 -5
  3. package/apps/mac-voice/Sources/AgentXVoice/Floor.swift +46 -0
  4. package/apps/mac-voice/Sources/AgentXVoice/FloorWatcher.swift +78 -0
  5. package/apps/mac-voice/Sources/AgentXVoice/Panel.swift +12 -1
  6. package/apps/mac-voice/Sources/AgentXVoice/StatusMenu.swift +8 -0
  7. package/apps/mac-voice/Sources/AgentXVoice/main.swift +89 -10
  8. package/dist/{App-D6W6IV2L.js → App-TOAWET76.js} +2 -2
  9. package/dist/{ChatApp-X7TNCFGW.js → ChatApp-4DRCRKFS.js} +2 -2
  10. package/dist/{absorb-eval-COPVH2M2.js → absorb-eval-OXNL5QGQ.js} +2 -2
  11. package/dist/{agent-TMTYLAOV.js → agent-GALMGMNJ.js} +2 -2
  12. package/dist/{board-dashboard-OSI4X5ZJ.js → board-dashboard-VXQYQY22.js} +4 -4
  13. package/dist/{board-dashboard-OSI4X5ZJ.js.map → board-dashboard-VXQYQY22.js.map} +1 -1
  14. package/dist/{chunk-AK3XOA5N.js → chunk-23LWLYOK.js} +2 -2
  15. package/dist/{chunk-IPMXIPTS.js → chunk-2JKKGS77.js} +2 -2
  16. package/dist/{chunk-QW3L5IIC.js → chunk-36HFRKIH.js} +2 -2
  17. package/dist/{chunk-HZZW35FY.js → chunk-3K3LRLZX.js} +2 -2
  18. package/dist/{chunk-NVZ66ITP.js → chunk-5ADXRVYT.js} +5 -5
  19. package/dist/{chunk-NVZ66ITP.js.map → chunk-5ADXRVYT.js.map} +1 -1
  20. package/dist/{chunk-GL3H7XMI.js → chunk-5RHCM3L7.js} +2 -2
  21. package/dist/{chunk-63LV77EG.js → chunk-635B6SXI.js} +2 -2
  22. package/dist/{chunk-FQLSV2C4.js → chunk-7JUISIE7.js} +2 -2
  23. package/dist/{chunk-XXIZGNLT.js → chunk-ADQUFEPJ.js} +233 -233
  24. package/dist/chunk-ADQUFEPJ.js.map +1 -0
  25. package/dist/{chunk-5J5USW2O.js → chunk-B6PMIUVV.js} +2 -2
  26. package/dist/{chunk-GRMCAO3Q.js → chunk-BWXRAPTX.js} +2 -2
  27. package/dist/{chunk-WRJFKA43.js → chunk-BXXP6DTB.js} +2 -2
  28. package/dist/{chunk-OW5EXDVY.js → chunk-E3AEOQMK.js} +2 -2
  29. package/dist/{chunk-VA24JS2S.js → chunk-GIQKQD2B.js} +2 -2
  30. package/dist/{chunk-5X37CXJF.js → chunk-IIFHX625.js} +2 -2
  31. package/dist/{chunk-EVTTAM7S.js → chunk-JC5KLH2K.js} +2 -2
  32. package/dist/{chunk-EGDY762K.js → chunk-K6UV4A2T.js} +2 -2
  33. package/dist/{chunk-EGDY762K.js.map → chunk-K6UV4A2T.js.map} +1 -1
  34. package/dist/chunk-KHYF6KTY.js +54 -0
  35. package/dist/chunk-KHYF6KTY.js.map +1 -0
  36. package/dist/chunk-KQ7KWFZY.js +4 -0
  37. package/dist/chunk-KQ7KWFZY.js.map +1 -0
  38. package/dist/{chunk-QHZFMO6M.js → chunk-LK4YO2FE.js} +2 -2
  39. package/dist/{chunk-QHZFMO6M.js.map → chunk-LK4YO2FE.js.map} +1 -1
  40. package/dist/{chunk-G26UHWS4.js → chunk-MXDWLBIA.js} +2 -2
  41. package/dist/{chunk-M5AHI2PZ.js → chunk-PLPDG6GE.js} +2 -2
  42. package/dist/{chunk-PV623BLN.js → chunk-PNYBZPPB.js} +3 -3
  43. package/dist/{chunk-4AFA6LQZ.js → chunk-RWMDDMYX.js} +2 -2
  44. package/dist/{chunk-66DPMVUC.js → chunk-SQ37I2MD.js} +2 -2
  45. package/dist/{chunk-KZXQD6ZK.js → chunk-XZIKAHFU.js} +2 -2
  46. package/dist/{chunk-HEJTE7OC.js → chunk-Z2QOQBUS.js} +2 -2
  47. package/dist/{chunk-XGOBZCYC.js → chunk-Z5OD225A.js} +2 -2
  48. package/dist/{chunk-FRTELYZ4.js → chunk-ZYUVKFX2.js} +2 -2
  49. package/dist/cli.js +1 -1
  50. package/dist/{client-SMOWSRJY.js → client-PWE4BJH4.js} +2 -2
  51. package/dist/{config-OGUDWYAA.js → config-E53FBZ47.js} +2 -2
  52. package/dist/{config-mutate-BH27TMWK.js → config-mutate-ZEHN6JMZ.js} +2 -2
  53. package/dist/config-mutator-AK775RTM.js +2 -0
  54. package/dist/{contributions-H6T65TCY.js → contributions-CLLCLS3O.js} +2 -2
  55. package/dist/{doctor-ZOXHT7ZQ.js → doctor-XKT5FWPO.js} +2 -2
  56. package/dist/{follow-up-tool-GUBBXNEZ.js → follow-up-tool-ZFRZUZLI.js} +2 -2
  57. package/dist/{hub-7AMS6ADP.js → hub-N5ADP3LO.js} +2 -2
  58. package/dist/index.d.ts +74 -35
  59. package/dist/index.js +1 -1
  60. package/dist/ntfy-ZDNBUEIX.js +2 -0
  61. package/dist/{program-IUUHETTV.js → program-MJ6S6X6T.js} +208 -208
  62. package/dist/program-MJ6S6X6T.js.map +1 -0
  63. package/dist/{promote-VCNVE5JD.js → promote-M4UBD2R6.js} +2 -2
  64. package/dist/push-HVGOC4VN.js +2 -0
  65. package/dist/push-bridge-NAQ7WQJX.js +2 -0
  66. package/dist/{query-6G27CBZQ.js → query-KMQHF5HW.js} +2 -2
  67. package/dist/{query-settings-G4M75LVQ.js → query-settings-PENAE4UG.js} +2 -2
  68. package/dist/{registry-MMNG5VZ6.js → registry-GYKSYSDD.js} +2 -2
  69. package/dist/{request-planner-T3VCZVVQ.js → request-planner-GBX6DHRQ.js} +2 -2
  70. package/dist/{review-candidates-C3O3CENL.js → review-candidates-SYMRJGI2.js} +2 -2
  71. package/dist/{routing-LD35TJM5.js → routing-S3L44JLL.js} +2 -2
  72. package/dist/schedule-tool-FXUFRZHR.js +2 -0
  73. package/dist/{scheduler-I3QB4GI3.js → scheduler-AW4F5ZKS.js} +2 -2
  74. package/dist/{seat-4Y3EW3KU.js → seat-QBBNCOFO.js} +2 -2
  75. package/dist/{select-LZKN3FER.js → select-ZCFIMYWS.js} +2 -2
  76. package/dist/{set-enabled-WSTOHJDE.js → set-enabled-4F27A3U2.js} +2 -2
  77. package/dist/{tool-NLMIUOHR.js → tool-G6XTO24J.js} +2 -2
  78. package/dist/{tool-AKXO2EJU.js → tool-M462KSMF.js} +2 -2
  79. package/dist/{wiki-ZQMDUXTE.js → wiki-JXVHIEZI.js} +2 -2
  80. package/dist/wiki-enrich-6CSUPULH.js +2 -0
  81. package/package.json +1 -1
  82. package/dist/chunk-54OORW5I.js +0 -54
  83. package/dist/chunk-54OORW5I.js.map +0 -1
  84. package/dist/chunk-KZKDVIOE.js +0 -4
  85. package/dist/chunk-KZKDVIOE.js.map +0 -1
  86. package/dist/chunk-XXIZGNLT.js.map +0 -1
  87. package/dist/config-mutator-Q62AS2TR.js +0 -2
  88. package/dist/ntfy-52EXHVMD.js +0 -2
  89. package/dist/program-IUUHETTV.js.map +0 -1
  90. package/dist/push-DID6RZYI.js +0 -2
  91. package/dist/push-bridge-325SXDGN.js +0 -2
  92. package/dist/schedule-tool-46TVGEYU.js +0 -2
  93. package/dist/wiki-enrich-NPNOSTRM.js +0 -2
  94. /package/dist/{App-D6W6IV2L.js.map → App-TOAWET76.js.map} +0 -0
  95. /package/dist/{ChatApp-X7TNCFGW.js.map → ChatApp-4DRCRKFS.js.map} +0 -0
  96. /package/dist/{absorb-eval-COPVH2M2.js.map → absorb-eval-OXNL5QGQ.js.map} +0 -0
  97. /package/dist/{agent-TMTYLAOV.js.map → agent-GALMGMNJ.js.map} +0 -0
  98. /package/dist/{chunk-AK3XOA5N.js.map → chunk-23LWLYOK.js.map} +0 -0
  99. /package/dist/{chunk-IPMXIPTS.js.map → chunk-2JKKGS77.js.map} +0 -0
  100. /package/dist/{chunk-QW3L5IIC.js.map → chunk-36HFRKIH.js.map} +0 -0
  101. /package/dist/{chunk-HZZW35FY.js.map → chunk-3K3LRLZX.js.map} +0 -0
  102. /package/dist/{chunk-GL3H7XMI.js.map → chunk-5RHCM3L7.js.map} +0 -0
  103. /package/dist/{chunk-63LV77EG.js.map → chunk-635B6SXI.js.map} +0 -0
  104. /package/dist/{chunk-FQLSV2C4.js.map → chunk-7JUISIE7.js.map} +0 -0
  105. /package/dist/{chunk-5J5USW2O.js.map → chunk-B6PMIUVV.js.map} +0 -0
  106. /package/dist/{chunk-GRMCAO3Q.js.map → chunk-BWXRAPTX.js.map} +0 -0
  107. /package/dist/{chunk-WRJFKA43.js.map → chunk-BXXP6DTB.js.map} +0 -0
  108. /package/dist/{chunk-OW5EXDVY.js.map → chunk-E3AEOQMK.js.map} +0 -0
  109. /package/dist/{chunk-VA24JS2S.js.map → chunk-GIQKQD2B.js.map} +0 -0
  110. /package/dist/{chunk-5X37CXJF.js.map → chunk-IIFHX625.js.map} +0 -0
  111. /package/dist/{chunk-EVTTAM7S.js.map → chunk-JC5KLH2K.js.map} +0 -0
  112. /package/dist/{chunk-G26UHWS4.js.map → chunk-MXDWLBIA.js.map} +0 -0
  113. /package/dist/{chunk-M5AHI2PZ.js.map → chunk-PLPDG6GE.js.map} +0 -0
  114. /package/dist/{chunk-PV623BLN.js.map → chunk-PNYBZPPB.js.map} +0 -0
  115. /package/dist/{chunk-4AFA6LQZ.js.map → chunk-RWMDDMYX.js.map} +0 -0
  116. /package/dist/{chunk-66DPMVUC.js.map → chunk-SQ37I2MD.js.map} +0 -0
  117. /package/dist/{chunk-KZXQD6ZK.js.map → chunk-XZIKAHFU.js.map} +0 -0
  118. /package/dist/{chunk-HEJTE7OC.js.map → chunk-Z2QOQBUS.js.map} +0 -0
  119. /package/dist/{chunk-XGOBZCYC.js.map → chunk-Z5OD225A.js.map} +0 -0
  120. /package/dist/{chunk-FRTELYZ4.js.map → chunk-ZYUVKFX2.js.map} +0 -0
  121. /package/dist/{client-SMOWSRJY.js.map → client-PWE4BJH4.js.map} +0 -0
  122. /package/dist/{config-OGUDWYAA.js.map → config-E53FBZ47.js.map} +0 -0
  123. /package/dist/{config-mutate-BH27TMWK.js.map → config-mutate-ZEHN6JMZ.js.map} +0 -0
  124. /package/dist/{config-mutator-Q62AS2TR.js.map → config-mutator-AK775RTM.js.map} +0 -0
  125. /package/dist/{contributions-H6T65TCY.js.map → contributions-CLLCLS3O.js.map} +0 -0
  126. /package/dist/{doctor-ZOXHT7ZQ.js.map → doctor-XKT5FWPO.js.map} +0 -0
  127. /package/dist/{follow-up-tool-GUBBXNEZ.js.map → follow-up-tool-ZFRZUZLI.js.map} +0 -0
  128. /package/dist/{hub-7AMS6ADP.js.map → hub-N5ADP3LO.js.map} +0 -0
  129. /package/dist/{ntfy-52EXHVMD.js.map → ntfy-ZDNBUEIX.js.map} +0 -0
  130. /package/dist/{promote-VCNVE5JD.js.map → promote-M4UBD2R6.js.map} +0 -0
  131. /package/dist/{push-DID6RZYI.js.map → push-HVGOC4VN.js.map} +0 -0
  132. /package/dist/{push-bridge-325SXDGN.js.map → push-bridge-NAQ7WQJX.js.map} +0 -0
  133. /package/dist/{query-6G27CBZQ.js.map → query-KMQHF5HW.js.map} +0 -0
  134. /package/dist/{query-settings-G4M75LVQ.js.map → query-settings-PENAE4UG.js.map} +0 -0
  135. /package/dist/{registry-MMNG5VZ6.js.map → registry-GYKSYSDD.js.map} +0 -0
  136. /package/dist/{request-planner-T3VCZVVQ.js.map → request-planner-GBX6DHRQ.js.map} +0 -0
  137. /package/dist/{review-candidates-C3O3CENL.js.map → review-candidates-SYMRJGI2.js.map} +0 -0
  138. /package/dist/{routing-LD35TJM5.js.map → routing-S3L44JLL.js.map} +0 -0
  139. /package/dist/{schedule-tool-46TVGEYU.js.map → schedule-tool-FXUFRZHR.js.map} +0 -0
  140. /package/dist/{scheduler-I3QB4GI3.js.map → scheduler-AW4F5ZKS.js.map} +0 -0
  141. /package/dist/{seat-4Y3EW3KU.js.map → seat-QBBNCOFO.js.map} +0 -0
  142. /package/dist/{select-LZKN3FER.js.map → select-ZCFIMYWS.js.map} +0 -0
  143. /package/dist/{set-enabled-WSTOHJDE.js.map → set-enabled-4F27A3U2.js.map} +0 -0
  144. /package/dist/{tool-NLMIUOHR.js.map → tool-G6XTO24J.js.map} +0 -0
  145. /package/dist/{tool-AKXO2EJU.js.map → tool-M462KSMF.js.map} +0 -0
  146. /package/dist/{wiki-ZQMDUXTE.js.map → wiki-JXVHIEZI.js.map} +0 -0
  147. /package/dist/{wiki-enrich-NPNOSTRM.js.map → wiki-enrich-6CSUPULH.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{q as d}from"./chunk-AK3XOA5N.js";import{b as i,c as u,d as l,e as c}from"./chunk-WRJFKA43.js";import f from"cronstrue";var p=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||p,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.notify&&e.deliverResult===!1&&(t.deliverResult=!1),e.createdBy&&(t.createdBy=e.createdBy),e.approval&&(t.approval=e.approval),t}function P(e){try{return f.toString(e,{use24HourTimeFormat:!1})}catch{return e}}function T(e,r,t=new Date){try{return d(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{p 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-GL3H7XMI.js.map
1
+ import{q as d}from"./chunk-23LWLYOK.js";import{b as i,c as u,d as l,e as c}from"./chunk-BXXP6DTB.js";import f from"cronstrue";var p=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||p,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.notify&&e.deliverResult===!1&&(t.deliverResult=!1),e.createdBy&&(t.createdBy=e.createdBy),e.approval&&(t.approval=e.approval),t}function P(e){try{return f.toString(e,{use24HourTimeFormat:!1})}catch{return e}}function T(e,r,t=new Date){try{return d(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{p 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-5RHCM3L7.js.map
@@ -1,4 +1,4 @@
1
- import{q as _,r as W}from"./chunk-2AXFYDWF.js";import{b as Y,c as I,d as O}from"./chunk-AQASR6KR.js";import{b as F}from"./chunk-MEFPXHQJ.js";import{a as E}from"./chunk-G26UHWS4.js";import{b as L}from"./chunk-KEXBEUSU.js";import{createHash as ee}from"crypto";import{existsSync as H,readdirSync as te,readFileSync as re,writeFileSync as ne}from"fs";import{resolve as P}from"path";function be(n,r,s,t,o,i,c="",p="",m=""){return Z(r,s,t,o,i,c,p,m)}function Z(n,r,s,t,o,i="",c="",p=""){let m=r?`
1
+ import{q as _,r as W}from"./chunk-2AXFYDWF.js";import{b as Y,c as I,d as O}from"./chunk-AQASR6KR.js";import{b as F}from"./chunk-MEFPXHQJ.js";import{a as E}from"./chunk-MXDWLBIA.js";import{b as L}from"./chunk-KEXBEUSU.js";import{createHash as ee}from"crypto";import{existsSync as H,readdirSync as te,readFileSync as re,writeFileSync as ne}from"fs";import{resolve as P}from"path";function be(n,r,s,t,o,i,c="",p="",m=""){return Z(r,s,t,o,i,c,p,m)}function Z(n,r,s,t,o,i="",c="",p=""){let m=r?`
2
2
  ## Worldview
3
3
 
4
4
  ${r}
@@ -249,4 +249,4 @@ ${u}`}var x="memory-promoter",oe=["project","reference","feedback"],K="_memory-p
249
249
  Re-emit the FULL corrected JSON object \u2014 same structure, fixed issues, valid JSON only.`:n,y=await t(`${a}/task`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agent:r.viaAgent,message:h,freshSession:s===null,context:{channel:"api",chatId:r.chatId??"memory-promote"}}),signal:i.signal});if(!y.ok){let f=await y.text().catch(()=>"");throw new Error(`agent /task ${y.status}: ${f.slice(0,500)}`)}let w=await y.json();if(w.error)throw new Error(`agent reported error: ${w.error}`);let b=String(w.content??"").trim();if(!b)throw new Error("agent returned empty content");return b}if(!r.model)throw new Error("callPromotionLlm: viaAgent or model is required");let p=process.env.ANTHROPIC_API_KEY;if(!p)throw new Error("ANTHROPIC_API_KEY not set; use --via <agentId> instead");let m=[{role:"user",content:n}];s&&(m.push({role:"assistant",content:"(previous attempt; will retry with corrections)"}),m.push({role:"user",content:`Your previous response failed validation: ${s}
250
250
  Re-emit the FULL corrected JSON object.`}));let u=await t(me,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":p,"anthropic-version":ge},body:JSON.stringify({model:r.model,max_tokens:8e3,messages:m}),signal:i.signal});if(!u.ok){let a=await u.text().catch(()=>"");throw new Error(`anthropic API ${u.status}: ${a.slice(0,500)}`)}let d=await u.json(),e=(Array.isArray(d.content)?d.content:[]).filter(a=>a?.type==="text").map(a=>a.text).join(`
251
251
  `).trim();if(!e)throw new Error("anthropic API returned no text content");return e}finally{clearTimeout(c)}}async function Se(n={}){let r=n.wikiDir??P(process.cwd(),".agentx","wiki"),s=n.memoryRoot??P(process.cwd(),".agentx"),t=n.log??(()=>{}),o=n.now??Date.now(),i={candidates:[],clusters:[],proposed:[],skipped:[],gaps:[],warnings:[],errors:[],dryRun:!n.commit},c=new E(r,(...l)=>t(l.map(String).join(" "))),p=c.rebuildIndex(),m=z(r),u=[...ce(s),...n.extraCandidates??[]];if(i.candidates=de(u,p,m,{types:n.types,sinceMs:n.sinceMs,agentFilter:n.agentFilter,now:o,max:n.max}),i.candidates.length===0)return t("no unpromoted memories in window"),i;if(i.clusters=le(i.candidates),i.dryRun)return i;let d=p.articles.map(l=>({title:l.title,path:l.path,type:l.type})),g=c.getWorldview()??"",e=n.budgetTokens??ue,a=i.clusters,h=D(x,a,d,g);for(;R(h)>e&&a.length>1;)a=a.slice(0,-1),h=D(x,a,d,g);if(R(h)>e)return i.errors.push(`judge prompt (~${R(h)} tokens) exceeds the ${e}-token budget even with one cluster`),i;a.length<i.clusters.length&&i.warnings.push(`token budget: judged ${a.length} of ${i.clusters.length} clusters; the rest wait for the next run`);let y=a.flatMap(l=>l.candidates),w=new Set(y.map(l=>l.stamp)),b=n.chatId??`memory-promote-${new Date(o).toISOString().slice(0,10)}`,f=B(await G(h,{...n,chatId:b}),w);if("error"in f&&(t(`parse failed (${f.error}) \u2014 retrying with feedback`),f=B(await G(h,{...n,chatId:b},f.error),w)),"error"in f)return i.errors.push(`LLM response unusable after retry: ${f.error}`),i;i.warnings.push(...f.warnings),i.gaps=f.gaps;let v=new Date(o).toISOString(),k=[],T=new Map(y.map(l=>[l.stamp,l]));for(let l of f.articles){let A=c.readArticle(l.path);if(A&&!c.canWrite(A.meta,x)){i.errors.push(`write denied for "${l.path}" (owned by ${A.meta.owner??"?"})`);continue}let M=fe(l.promotedFrom,T),S={id:Y(o,l.path),createdAt:v,status:"pending",article:l,evidence:M,...A?{replaces:{lastUpdated:A.meta.lastUpdated,contentHash:V(A.content)}}:{}};I(r,S),i.proposed.push({id:S.id,path:l.path,title:l.title,type:l.type,stamps:l.promotedFrom,agents:M.agents,occurrences:M.occurrences});for(let X of l.promotedFrom)k.push({stamp:X,decision:"proposed",article:l.path,proposal:S.id,at:v})}for(let l of f.skipped)k.push({stamp:l.stamp,decision:"skipped",reason:l.reason,at:v}),i.skipped.push(l);return k.length&&C(r,k),i}var ue=6e4;function R(n){return Math.ceil(n.length/4)}function V(n){return ee("sha256").update(n).digest("hex").slice(0,16)}var he=600;function ye(n){return n.startsWith("review:")?"review":n.startsWith(j)?"failure":"memory"}function fe(n,r){let s=[];for(let t of n){let o=r.get(t);o&&s.push({stamp:t,kind:ye(t),agentId:o.agentId,type:o.memory.type,name:o.memory.name,description:o.memory.description,...o.occurrences?{occurrences:o.occurrences}:{},...o.sessions?.length?{sessions:o.sessions}:{},...o.tasks?.length?{tasks:o.tasks}:{},...o.failure?{failure:o.failure}:{},...o.memory.author?{author:o.memory.author}:{},...o.memory.taskId?{taskId:o.memory.taskId}:{},updatedAt:o.memory.updatedAt,excerpt:o.memory.body.slice(0,he)})}return{agents:[...new Set(s.map(t=>t.agentId))].sort(),occurrences:Math.max(1,...s.map(t=>t.occurrences??1)),sources:s}}function Ee(n,r,s={}){let t=O(n,r);if(!t)return{ok:!1,error:`no proposal "${r}"`};if(t.status!=="pending")return{ok:!1,error:`proposal "${r}" is already ${t.status}`};let o=s.log??(()=>{}),i=new E(n,(...a)=>o(a.map(String).join(" "))),{article:c}=t,p=i.readArticle(c.path);if(!s.force){if(p&&!t.replaces)return{ok:!1,error:`"${c.path}" was created after this proposal; review it, then approve with --force`};if(p&&t.replaces&&V(p.content)!==t.replaces.contentHash)return{ok:!1,error:`"${c.path}" changed since this proposal; review it, then approve with --force`}}let m=s.now??Date.now(),u=new Date(m).toISOString().slice(0,10);if(!i.writeArticle(c.path,{title:c.title,type:L(c.type)?c.type:void 0,related:c.related,tags:c.tags,owner:x,access:"public",created:p?.meta.created??u,lastUpdated:u,sources:ae(p?.meta.sources,c.promotedFrom)},c.content,x))return{ok:!1,error:`write denied for "${c.path}" (owned by ${p?.meta.owner??"?"})`};let g=new Date(m).toISOString();C(n,c.promotedFrom.map(a=>({stamp:a,decision:"promoted",article:c.path,proposal:r,at:g}))),i.rebuildIndex();let e={...t,status:"approved",decidedBy:s.by??"operator",decidedAt:g};return I(n,e),{ok:!0,proposal:e}}function Oe(n,r,s={}){let t=O(n,r);if(!t)return{ok:!1,error:`no proposal "${r}"`};if(t.status!=="pending")return{ok:!1,error:`proposal "${r}" is already ${t.status}`};let o=new Date(s.now??Date.now()).toISOString();C(n,t.article.promotedFrom.map(c=>({stamp:c,decision:"rejected",article:t.article.path,proposal:r,reason:s.reason,at:o})));let i={...t,status:"rejected",decidedBy:s.by??"operator",decidedAt:o,...s.reason?{reason:s.reason}:{}};return I(n,i),{ok:!0,proposal:i}}export{be as a,x as b,oe as c,K as d,q as e,ie as f,$ as g,ae as h,ce as i,z as j,C as k,le as l,B as m,de as n,G as o,Se as p,R as q,ye as r,fe as s,Ee as t,Oe as u};
252
- //# sourceMappingURL=chunk-63LV77EG.js.map
252
+ //# sourceMappingURL=chunk-635B6SXI.js.map
@@ -1,2 +1,2 @@
1
- import{y as l,z as T}from"./chunk-66DPMVUC.js";import{a,f as w}from"./chunk-72SZI2UW.js";T();w();var d="task-tier";function u(e){return{task:b(e.message,2e3),agent:e.agent,channel:e.channel??null,continuesExistingSession:e.isFollowUp??!1,...e.toolsAvailable?{toolsAvailable:e.toolsAvailable}:{}}}var c={needsFlagship:a("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 b(e,n){return e.length>n?`${e.slice(0,n)}\u2026`:e}var h=.2;function p(e){return e==="voice"||e==="desktop"||e==="opencode"}var f=60*60*1e3;function M(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 v(e){let n=(s,r=null)=>({downgraded:!1,needsFlagship:r,reason:s});if(p(e.channel))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??f;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 i=e.threshold??h;return o>=i?n(`needs the flagship (${o.toFixed(2)})`,o):{model:e.cheapModel,downgraded:!0,needsFlagship:o,reason:`mechanical task (${o.toFixed(2)} below ${i}) \u2192 ${e.cheapModel}`}}var A=["labeled","unlabeled","closed"];function y(e){let n=r=>({downgraded:!1,needsFlagship:null,reason:r});if(p(e.channel))return n(`${e.channel} requests retain the configured model`);let t=e.eventActions??[];if(!t.length)return n("not started by a platform event");let o=e.triage?.actions??A,i=t.find(r=>!o.includes(r));if(i)return n(`"${i}" is not a triage action`);let s=M(e.tier,{cheapModels:e.triage?.models});if(!s)return n(`no triage model set for ${e.tier}`);if(e.isFollowUp){let r=e.sessionIdleMs??0,m=e.cacheTtlMs??f;if(r<m)return n(`follow-up on a warm cache (idle ${Math.round(r/1e3)}s) \u2014 keeping the session's model`)}return{model:s,downgraded:!0,needsFlagship:null,reason:`triage event (${t.join(", ")}) \u2192 ${s}`}}export{h as a,p as b,M as c,v as d,A as e,y as f};
2
- //# sourceMappingURL=chunk-FQLSV2C4.js.map
1
+ import{y as l,z as T}from"./chunk-SQ37I2MD.js";import{a,f as w}from"./chunk-72SZI2UW.js";T();w();var d="task-tier";function u(e){return{task:b(e.message,2e3),agent:e.agent,channel:e.channel??null,continuesExistingSession:e.isFollowUp??!1,...e.toolsAvailable?{toolsAvailable:e.toolsAvailable}:{}}}var c={needsFlagship:a("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 b(e,n){return e.length>n?`${e.slice(0,n)}\u2026`:e}var h=.2;function p(e){return e==="voice"||e==="desktop"||e==="opencode"}var f=60*60*1e3;function M(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 v(e){let n=(s,r=null)=>({downgraded:!1,needsFlagship:r,reason:s});if(p(e.channel))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??f;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 i=e.threshold??h;return o>=i?n(`needs the flagship (${o.toFixed(2)})`,o):{model:e.cheapModel,downgraded:!0,needsFlagship:o,reason:`mechanical task (${o.toFixed(2)} below ${i}) \u2192 ${e.cheapModel}`}}var A=["labeled","unlabeled","closed"];function y(e){let n=r=>({downgraded:!1,needsFlagship:null,reason:r});if(p(e.channel))return n(`${e.channel} requests retain the configured model`);let t=e.eventActions??[];if(!t.length)return n("not started by a platform event");let o=e.triage?.actions??A,i=t.find(r=>!o.includes(r));if(i)return n(`"${i}" is not a triage action`);let s=M(e.tier,{cheapModels:e.triage?.models});if(!s)return n(`no triage model set for ${e.tier}`);if(e.isFollowUp){let r=e.sessionIdleMs??0,m=e.cacheTtlMs??f;if(r<m)return n(`follow-up on a warm cache (idle ${Math.round(r/1e3)}s) \u2014 keeping the session's model`)}return{model:s,downgraded:!0,needsFlagship:null,reason:`triage event (${t.join(", ")}) \u2192 ${s}`}}export{h as a,p as b,M as c,v as d,A as e,y as f};
2
+ //# sourceMappingURL=chunk-7JUISIE7.js.map