agentix-cli 0.165.1 → 0.167.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 (150) hide show
  1. package/README.md +1 -1
  2. package/dist/{App-NV2JJMHN.js → App-ZV3MJ73U.js} +2 -2
  3. package/dist/{ChatApp-CIGDPS3A.js → ChatApp-GPGF3SVJ.js} +2 -2
  4. package/dist/{absorb-eval-VPAASHZG.js → absorb-eval-IJLOYYIL.js} +2 -2
  5. package/dist/{agent-UFMIPTQZ.js → agent-4BNF462Q.js} +2 -2
  6. package/dist/{board-dashboard-NUEVGTM7.js → board-dashboard-ZF2FN2K5.js} +399 -305
  7. package/dist/board-dashboard-ZF2FN2K5.js.map +1 -0
  8. package/dist/{chunk-QT63Q6C5.js → chunk-236CUFAC.js} +2 -2
  9. package/dist/{chunk-KVSHZKAL.js → chunk-2HB6AH4T.js} +2 -2
  10. package/dist/{chunk-FK2TJZNJ.js → chunk-3H2P5XRF.js} +2 -2
  11. package/dist/{chunk-T5IGXFSW.js → chunk-4S7JQ7B3.js} +2 -2
  12. package/dist/{chunk-EXJGRK2N.js → chunk-56I4CDWP.js} +3 -3
  13. package/dist/chunk-56I4CDWP.js.map +1 -0
  14. package/dist/{chunk-CRUNUMVO.js → chunk-5GJMPB6Q.js} +2 -2
  15. package/dist/{chunk-V7R5AJVN.js → chunk-7PWM4GYY.js} +2 -2
  16. package/dist/chunk-BE64IJWM.js +11 -0
  17. package/dist/chunk-BE64IJWM.js.map +1 -0
  18. package/dist/{chunk-AYK2MO3B.js → chunk-CTN4KYE6.js} +2 -2
  19. package/dist/chunk-CZLUBWNU.js +92 -0
  20. package/dist/chunk-CZLUBWNU.js.map +1 -0
  21. package/dist/{chunk-BC7VOHNH.js → chunk-DPPYNUQW.js} +2 -2
  22. package/dist/{chunk-GJ4SQRAE.js → chunk-ECFANHQ5.js} +2 -2
  23. package/dist/{chunk-6Y53LLIX.js → chunk-FIL6QI6N.js} +2 -2
  24. package/dist/{chunk-A3GDFLFB.js → chunk-FSTWXYWA.js} +2 -2
  25. package/dist/{chunk-4SJ2VFVI.js → chunk-GGQZLFYH.js} +2 -2
  26. package/dist/{chunk-RUB4HZEG.js → chunk-GVU6YS3Y.js} +2 -2
  27. package/dist/{chunk-73SESASJ.js → chunk-IJT6KKST.js} +2 -2
  28. package/dist/chunk-KDDV3VFJ.js +41 -0
  29. package/dist/chunk-KDDV3VFJ.js.map +1 -0
  30. package/dist/{chunk-ON7Y3JSP.js → chunk-MQFHPGLC.js} +3 -3
  31. package/dist/{chunk-CGE5EAWC.js → chunk-N5JY7SSX.js} +2 -2
  32. package/dist/{chunk-YUGYKMY6.js → chunk-OPCGTZU4.js} +2 -2
  33. package/dist/{chunk-KTJ6234K.js → chunk-PHLILSAY.js} +258 -258
  34. package/dist/chunk-PHLILSAY.js.map +1 -0
  35. package/dist/{chunk-DAWJHJKD.js → chunk-RDT4NCBI.js} +2 -2
  36. package/dist/{chunk-PSTEWKR3.js → chunk-RGUQY65H.js} +2 -2
  37. package/dist/{chunk-CDPQQAK6.js → chunk-S3KWNMPJ.js} +2 -2
  38. package/dist/{chunk-NCEYJFF5.js → chunk-SAFOO6XY.js} +2 -2
  39. package/dist/{chunk-Y6JSB5II.js → chunk-SMPADAHT.js} +2 -2
  40. package/dist/{chunk-S6ZZKRDB.js → chunk-UGPCMA7S.js} +2 -2
  41. package/dist/{chunk-VL74KOR7.js → chunk-VJVXEVZ7.js} +18 -9
  42. package/dist/{chunk-VL74KOR7.js.map → chunk-VJVXEVZ7.js.map} +1 -1
  43. package/dist/{chunk-ILHTAVZZ.js → chunk-ZA7DX4A2.js} +85 -85
  44. package/dist/chunk-ZA7DX4A2.js.map +1 -0
  45. package/dist/cli.js +1 -1
  46. package/dist/{client-D3CYQPUD.js → client-SQOWAVPJ.js} +2 -2
  47. package/dist/{config-OTO56OCX.js → config-7JJZJFLZ.js} +2 -2
  48. package/dist/{config-mutate-5KKGQHC6.js → config-mutate-JERIV7AP.js} +2 -2
  49. package/dist/config-mutator-4IUU4ANZ.js +2 -0
  50. package/dist/{contributions-SMSYSHPU.js → contributions-XSHL4IU5.js} +2 -2
  51. package/dist/{doctor-5PFLKGNU.js → doctor-TBZE4NNW.js} +2 -2
  52. package/dist/{failure-candidates-HNENLQJC.js → failure-candidates-WGSFI7GR.js} +2 -2
  53. package/dist/{follow-up-tool-ME4DV7HT.js → follow-up-tool-QC4NXZJT.js} +2 -2
  54. package/dist/{hub-WGUNZ2D5.js → hub-VRESIG2H.js} +2 -2
  55. package/dist/index.d.ts +108 -39
  56. package/dist/index.js +1 -1
  57. package/dist/{program-GBPLSXFF.js → program-KFZOGLFE.js} +203 -203
  58. package/dist/{program-GBPLSXFF.js.map → program-KFZOGLFE.js.map} +1 -1
  59. package/dist/{promote-TQ3OZ7EC.js → promote-BFFD52TZ.js} +2 -2
  60. package/dist/{query-M4VWXBHF.js → query-MIODGHPL.js} +2 -2
  61. package/dist/{query-settings-Y4PWFLYK.js → query-settings-X4BTVQHH.js} +2 -2
  62. package/dist/{registry-GLNCV3KP.js → registry-TRWLGN2A.js} +2 -2
  63. package/dist/{request-planner-FE3C2QFQ.js → request-planner-2QGXWCOJ.js} +2 -2
  64. package/dist/{review-candidates-R7QKVGMQ.js → review-candidates-NJVISKTY.js} +2 -2
  65. package/dist/{routing-6J4OHUJS.js → routing-4AS2E5XG.js} +2 -2
  66. package/dist/schedule-tool-GGL5SGM6.js +2 -0
  67. package/dist/{scheduler-XDLJAWGC.js → scheduler-S7PRYZNI.js} +2 -2
  68. package/dist/{seat-35AZG54F.js → seat-MOPQDOX3.js} +2 -2
  69. package/dist/{select-6PC26YUI.js → select-RVIZALFB.js} +2 -2
  70. package/dist/{set-enabled-UJOLDPZV.js → set-enabled-AWWWMEYU.js} +2 -2
  71. package/dist/token-tracker-XTHSSPLB.js +2 -0
  72. package/dist/tool-7U4T5ZF7.js +8 -0
  73. package/dist/tool-7U4T5ZF7.js.map +1 -0
  74. package/dist/{tool-QLIJQQ7W.js → tool-HJQJWJAH.js} +2 -2
  75. package/dist/traces-O4TIZ4SM.js +2 -0
  76. package/dist/{wiki-W7L5EJTZ.js → wiki-BLCQBJG3.js} +2 -2
  77. package/dist/wiki-enrich-U5KPQ6P7.js +2 -0
  78. package/dist/{workflow-pilot-25NMZYUO.js → workflow-pilot-MKG6CJ6V.js} +2 -2
  79. package/package.json +1 -1
  80. package/dist/board-dashboard-NUEVGTM7.js.map +0 -1
  81. package/dist/chunk-AXDNFXYU.js +0 -41
  82. package/dist/chunk-AXDNFXYU.js.map +0 -1
  83. package/dist/chunk-EXJGRK2N.js.map +0 -1
  84. package/dist/chunk-ILHTAVZZ.js.map +0 -1
  85. package/dist/chunk-IVTO54EM.js +0 -90
  86. package/dist/chunk-IVTO54EM.js.map +0 -1
  87. package/dist/chunk-KTJ6234K.js.map +0 -1
  88. package/dist/chunk-XIRM45DH.js +0 -11
  89. package/dist/chunk-XIRM45DH.js.map +0 -1
  90. package/dist/config-mutator-XBUGJZER.js +0 -2
  91. package/dist/schedule-tool-FE3TWOGS.js +0 -2
  92. package/dist/token-tracker-B2UFOH46.js +0 -2
  93. package/dist/tool-LAMDUPTX.js +0 -6
  94. package/dist/tool-LAMDUPTX.js.map +0 -1
  95. package/dist/traces-G4HRLRA3.js +0 -2
  96. package/dist/wiki-enrich-3ZCL5TEC.js +0 -2
  97. /package/dist/{App-NV2JJMHN.js.map → App-ZV3MJ73U.js.map} +0 -0
  98. /package/dist/{ChatApp-CIGDPS3A.js.map → ChatApp-GPGF3SVJ.js.map} +0 -0
  99. /package/dist/{absorb-eval-VPAASHZG.js.map → absorb-eval-IJLOYYIL.js.map} +0 -0
  100. /package/dist/{agent-UFMIPTQZ.js.map → agent-4BNF462Q.js.map} +0 -0
  101. /package/dist/{chunk-QT63Q6C5.js.map → chunk-236CUFAC.js.map} +0 -0
  102. /package/dist/{chunk-KVSHZKAL.js.map → chunk-2HB6AH4T.js.map} +0 -0
  103. /package/dist/{chunk-FK2TJZNJ.js.map → chunk-3H2P5XRF.js.map} +0 -0
  104. /package/dist/{chunk-T5IGXFSW.js.map → chunk-4S7JQ7B3.js.map} +0 -0
  105. /package/dist/{chunk-CRUNUMVO.js.map → chunk-5GJMPB6Q.js.map} +0 -0
  106. /package/dist/{chunk-V7R5AJVN.js.map → chunk-7PWM4GYY.js.map} +0 -0
  107. /package/dist/{chunk-AYK2MO3B.js.map → chunk-CTN4KYE6.js.map} +0 -0
  108. /package/dist/{chunk-BC7VOHNH.js.map → chunk-DPPYNUQW.js.map} +0 -0
  109. /package/dist/{chunk-GJ4SQRAE.js.map → chunk-ECFANHQ5.js.map} +0 -0
  110. /package/dist/{chunk-6Y53LLIX.js.map → chunk-FIL6QI6N.js.map} +0 -0
  111. /package/dist/{chunk-A3GDFLFB.js.map → chunk-FSTWXYWA.js.map} +0 -0
  112. /package/dist/{chunk-4SJ2VFVI.js.map → chunk-GGQZLFYH.js.map} +0 -0
  113. /package/dist/{chunk-RUB4HZEG.js.map → chunk-GVU6YS3Y.js.map} +0 -0
  114. /package/dist/{chunk-73SESASJ.js.map → chunk-IJT6KKST.js.map} +0 -0
  115. /package/dist/{chunk-ON7Y3JSP.js.map → chunk-MQFHPGLC.js.map} +0 -0
  116. /package/dist/{chunk-CGE5EAWC.js.map → chunk-N5JY7SSX.js.map} +0 -0
  117. /package/dist/{chunk-YUGYKMY6.js.map → chunk-OPCGTZU4.js.map} +0 -0
  118. /package/dist/{chunk-DAWJHJKD.js.map → chunk-RDT4NCBI.js.map} +0 -0
  119. /package/dist/{chunk-PSTEWKR3.js.map → chunk-RGUQY65H.js.map} +0 -0
  120. /package/dist/{chunk-CDPQQAK6.js.map → chunk-S3KWNMPJ.js.map} +0 -0
  121. /package/dist/{chunk-NCEYJFF5.js.map → chunk-SAFOO6XY.js.map} +0 -0
  122. /package/dist/{chunk-Y6JSB5II.js.map → chunk-SMPADAHT.js.map} +0 -0
  123. /package/dist/{chunk-S6ZZKRDB.js.map → chunk-UGPCMA7S.js.map} +0 -0
  124. /package/dist/{client-D3CYQPUD.js.map → client-SQOWAVPJ.js.map} +0 -0
  125. /package/dist/{config-OTO56OCX.js.map → config-7JJZJFLZ.js.map} +0 -0
  126. /package/dist/{config-mutate-5KKGQHC6.js.map → config-mutate-JERIV7AP.js.map} +0 -0
  127. /package/dist/{config-mutator-XBUGJZER.js.map → config-mutator-4IUU4ANZ.js.map} +0 -0
  128. /package/dist/{contributions-SMSYSHPU.js.map → contributions-XSHL4IU5.js.map} +0 -0
  129. /package/dist/{doctor-5PFLKGNU.js.map → doctor-TBZE4NNW.js.map} +0 -0
  130. /package/dist/{failure-candidates-HNENLQJC.js.map → failure-candidates-WGSFI7GR.js.map} +0 -0
  131. /package/dist/{follow-up-tool-ME4DV7HT.js.map → follow-up-tool-QC4NXZJT.js.map} +0 -0
  132. /package/dist/{hub-WGUNZ2D5.js.map → hub-VRESIG2H.js.map} +0 -0
  133. /package/dist/{promote-TQ3OZ7EC.js.map → promote-BFFD52TZ.js.map} +0 -0
  134. /package/dist/{query-M4VWXBHF.js.map → query-MIODGHPL.js.map} +0 -0
  135. /package/dist/{query-settings-Y4PWFLYK.js.map → query-settings-X4BTVQHH.js.map} +0 -0
  136. /package/dist/{registry-GLNCV3KP.js.map → registry-TRWLGN2A.js.map} +0 -0
  137. /package/dist/{request-planner-FE3C2QFQ.js.map → request-planner-2QGXWCOJ.js.map} +0 -0
  138. /package/dist/{review-candidates-R7QKVGMQ.js.map → review-candidates-NJVISKTY.js.map} +0 -0
  139. /package/dist/{routing-6J4OHUJS.js.map → routing-4AS2E5XG.js.map} +0 -0
  140. /package/dist/{schedule-tool-FE3TWOGS.js.map → schedule-tool-GGL5SGM6.js.map} +0 -0
  141. /package/dist/{scheduler-XDLJAWGC.js.map → scheduler-S7PRYZNI.js.map} +0 -0
  142. /package/dist/{seat-35AZG54F.js.map → seat-MOPQDOX3.js.map} +0 -0
  143. /package/dist/{select-6PC26YUI.js.map → select-RVIZALFB.js.map} +0 -0
  144. /package/dist/{set-enabled-UJOLDPZV.js.map → set-enabled-AWWWMEYU.js.map} +0 -0
  145. /package/dist/{token-tracker-B2UFOH46.js.map → token-tracker-XTHSSPLB.js.map} +0 -0
  146. /package/dist/{tool-QLIJQQ7W.js.map → tool-HJQJWJAH.js.map} +0 -0
  147. /package/dist/{traces-G4HRLRA3.js.map → traces-O4TIZ4SM.js.map} +0 -0
  148. /package/dist/{wiki-W7L5EJTZ.js.map → wiki-BLCQBJG3.js.map} +0 -0
  149. /package/dist/{wiki-enrich-3ZCL5TEC.js.map → wiki-enrich-U5KPQ6P7.js.map} +0 -0
  150. /package/dist/{workflow-pilot-25NMZYUO.js.map → workflow-pilot-MKG6CJ6V.js.map} +0 -0
package/dist/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{b as o}from"./chunk-OSH2PEBH.js";import"./chunk-QIJLFPWE.js";var e=o(process.versions.node);e&&(console.error(e),process.exit(1));var{buildProgram:s}=await import("./program-GBPLSXFF.js"),{installCliSignalExit:r}=await import("./signal-exit-WL7G3EEZ.js"),{applyConnectAttemptTimeout:i,configPathFromArgv:a,readConnectAttemptTimeout:n}=await import("./net-family-X2P3OVDP.js");r();i(n(process.cwd(),a(process.argv.slice(2))));var t=await s();process.argv.slice(2).length===0?t.outputHelp():t.parse();
2
+ import{b as o}from"./chunk-OSH2PEBH.js";import"./chunk-QIJLFPWE.js";var e=o(process.versions.node);e&&(console.error(e),process.exit(1));var{buildProgram:s}=await import("./program-KFZOGLFE.js"),{installCliSignalExit:r}=await import("./signal-exit-WL7G3EEZ.js"),{applyConnectAttemptTimeout:i,configPathFromArgv:a,readConnectAttemptTimeout:n}=await import("./net-family-X2P3OVDP.js");r();i(n(process.cwd(),a(process.argv.slice(2))));var t=await s();process.argv.slice(2).length===0?t.outputHelp():t.parse();
3
3
  //# sourceMappingURL=cli.js.map
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g}from"./chunk-CGE5EAWC.js";import"./chunk-IVTO54EM.js";import"./chunk-BRK6M6LA.js";import"./chunk-UEEB3UTU.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{b as fetchAgents,d as fetchCrons,c as fetchProcesses,e as killProcess,a as resolveConn,f as sendTask,g as streamTask};
2
- //# sourceMappingURL=client-D3CYQPUD.js.map
1
+ import{a,b,c,d,e,f,g}from"./chunk-N5JY7SSX.js";import"./chunk-CZLUBWNU.js";import"./chunk-BRK6M6LA.js";import"./chunk-UEEB3UTU.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{b as fetchAgents,d as fetchCrons,c as fetchProcesses,e as killProcess,a as resolveConn,f as sendTask,g as streamTask};
2
+ //# sourceMappingURL=client-SQOWAVPJ.js.map
@@ -1,2 +1,2 @@
1
- import{$a as h,Ua as a,Va as b,Wa as c,Xa as d,Ya as e,Za as f,_a as g,ab as i,bb as j,cb as k,db as l,eb as m,fb as n,gb as o,hb as p,ib as q,jb as r,kb as s,lb as t,mb as u,nb as v,ob as w,pb as x,qb as y,rb as z,tb as A}from"./chunk-IVTO54EM.js";import"./chunk-BRK6M6LA.js";import"./chunk-UEEB3UTU.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";A();export{a as INTEGRATION_KINDS,v as WIKI_CONTRIBUTE_JOB,w as WIKI_CONTRIBUTE_MERGE_JOB,y as WIKI_SUMMARIZE_JOB,o as approvalsConfigSchema,e as callsSchema,c as cameraBotSchema,t as crossFieldProblems,q as daemonConfigSchema,b as eventSubscriptionSchema,r as expandEnvVars,d as isCronExpression,s as loadDaemonConfig,l as membersConfigSchema,g as mergePolicyConfigSchema,k as peopleConfigSchema,j as personSchema,n as qualityReportConfigSchema,m as requestStatusConfigSchema,i as requestsConfigSchema,f as reviewGateConfigSchema,u as validateWorkspaces,p as wallConfigSchema,h as watchersConfigSchema,x as withContributionJobs,z as withSummariesJob};
2
- //# sourceMappingURL=config-OTO56OCX.js.map
1
+ import{$a as h,Ua as a,Va as b,Wa as c,Xa as d,Ya as e,Za as f,_a as g,ab as i,bb as j,cb as k,db as l,eb as m,fb as n,gb as o,hb as p,ib as q,jb as r,kb as s,lb as t,mb as u,nb as v,ob as w,pb as x,qb as y,rb as z,tb as A}from"./chunk-CZLUBWNU.js";import"./chunk-BRK6M6LA.js";import"./chunk-UEEB3UTU.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";A();export{a as INTEGRATION_KINDS,v as WIKI_CONTRIBUTE_JOB,w as WIKI_CONTRIBUTE_MERGE_JOB,y as WIKI_SUMMARIZE_JOB,o as approvalsConfigSchema,e as callsSchema,c as cameraBotSchema,t as crossFieldProblems,q as daemonConfigSchema,b as eventSubscriptionSchema,r as expandEnvVars,d as isCronExpression,s as loadDaemonConfig,l as membersConfigSchema,g as mergePolicyConfigSchema,k as peopleConfigSchema,j as personSchema,n as qualityReportConfigSchema,m as requestStatusConfigSchema,i as requestsConfigSchema,f as reviewGateConfigSchema,u as validateWorkspaces,p as wallConfigSchema,h as watchersConfigSchema,x as withContributionJobs,z as withSummariesJob};
2
+ //# sourceMappingURL=config-7JJZJFLZ.js.map
@@ -1,2 +1,2 @@
1
- import{a,b}from"./chunk-KVSHZKAL.js";import"./chunk-IVTO54EM.js";import"./chunk-BRK6M6LA.js";import"./chunk-UEEB3UTU.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{a as mutateAgentxConfig,b as writeAgentxConfig};
2
- //# sourceMappingURL=config-mutate-5KKGQHC6.js.map
1
+ import{a,b}from"./chunk-2HB6AH4T.js";import"./chunk-CZLUBWNU.js";import"./chunk-BRK6M6LA.js";import"./chunk-UEEB3UTU.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{a as mutateAgentxConfig,b as writeAgentxConfig};
2
+ //# sourceMappingURL=config-mutate-JERIV7AP.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e}from"./chunk-5GJMPB6Q.js";import"./chunk-CZLUBWNU.js";import"./chunk-BRK6M6LA.js";import"./chunk-UEEB3UTU.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{b as applyConfigMutation,a as findConfigPath,d as getAtPath,c as setAtPath,e as unsetAtPath};
2
+ //# sourceMappingURL=config-mutator-4IUU4ANZ.js.map
@@ -1,4 +1,4 @@
1
- import{a as ee}from"./chunk-FK2TJZNJ.js";import"./chunk-GJ4SQRAE.js";import{f as Q,k as V}from"./chunk-VL74KOR7.js";import{b as O}from"./chunk-PE5V2LI7.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-OWNQ2FD4.js";import{b as X}from"./chunk-KEXBEUSU.js";import"./chunk-ON7Y3JSP.js";import"./chunk-JTFCU5LH.js";import"./chunk-BC7VOHNH.js";import"./chunk-WPNRDEHW.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-QT63Q6C5.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QUFIUXMQ.js";import"./chunk-BERWTVG2.js";import{b as N,c as H}from"./chunk-QOYAX2FT.js";import"./chunk-6QLRRSKU.js";import"./chunk-7I7IEX4S.js";import"./chunk-IVTO54EM.js";import"./chunk-BRK6M6LA.js";import"./chunk-UEEB3UTU.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";import{createHash as le}from"crypto";import{existsSync as z,mkdirSync as ne,readdirSync as re,readFileSync as ge,renameSync as se,writeFileSync as pe}from"fs";import{resolve as w}from"path";var _={maxPatches:30,maxCostUsd:.5,maxItems:60},he=12,fe=2e3,me=1500,M=8,U=300,be=12,B="## Checked facts";function S(n){return w(n,"_contributions")}function E(n,r){if(!z(n))return r;try{return JSON.parse(ge(n,"utf-8"))}catch(t){throw new Error(`${n} is not valid JSON: ${t.message}`)}}function L(n,r){ne(w(n,".."),{recursive:!0});let t=`${n}.${process.pid}.tmp`;pe(t,`${JSON.stringify(r,null,2)}
1
+ import{a as ee}from"./chunk-3H2P5XRF.js";import"./chunk-ECFANHQ5.js";import{f as Q,k as V}from"./chunk-VJVXEVZ7.js";import{b as O}from"./chunk-PE5V2LI7.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-OWNQ2FD4.js";import{b as X}from"./chunk-KEXBEUSU.js";import"./chunk-MQFHPGLC.js";import"./chunk-JTFCU5LH.js";import"./chunk-DPPYNUQW.js";import"./chunk-WPNRDEHW.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-236CUFAC.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QUFIUXMQ.js";import"./chunk-BERWTVG2.js";import{b as N,c as H}from"./chunk-QOYAX2FT.js";import"./chunk-6QLRRSKU.js";import"./chunk-7I7IEX4S.js";import"./chunk-CZLUBWNU.js";import"./chunk-BRK6M6LA.js";import"./chunk-UEEB3UTU.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";import{createHash as le}from"crypto";import{existsSync as z,mkdirSync as ne,readdirSync as re,readFileSync as ge,renameSync as se,writeFileSync as pe}from"fs";import{resolve as w}from"path";var _={maxPatches:30,maxCostUsd:.5,maxItems:60},he=12,fe=2e3,me=1500,M=8,U=300,be=12,B="## Checked facts";function S(n){return w(n,"_contributions")}function E(n,r){if(!z(n))return r;try{return JSON.parse(ge(n,"utf-8"))}catch(t){throw new Error(`${n} is not valid JSON: ${t.message}`)}}function L(n,r){ne(w(n,".."),{recursive:!0});let t=`${n}.${process.pid}.tmp`;pe(t,`${JSON.stringify(r,null,2)}
2
2
  `),se(t,n)}function ie(n){return{agents:E(w(S(n),"state.json"),{agents:{}}).agents??{}}}function ye(n){let r=w(S(n),"pending");return z(r)?re(r).filter(t=>t.endsWith(".json")).sort().map(t=>E(w(r,t),null)).filter(t=>!!t):[]}function G(n){return w(S(n),"held.json")}function K(n,r={}){let t=E(G(n),[]);return r.all?t:t.filter(a=>a.status==="held")}function _e(n){let r=w(S(n),"reports");if(!z(r))return null;let t=re(r).filter(a=>a.endsWith(".json")).sort().pop();return t?E(w(r,t),null):null}function ke(n,r,t,a={}){let o=ie(r).agents[t],c=a.now??Date.now(),e=a.since??o?.lastRunAt??new Date(c-864e5).toISOString(),d=e.slice(0,10),u=new Set(o?.processed??[]),s=[];for(let g of n.getAgentEntries(t))g.date<d||u.has(g.id)||s.push({id:g.id,at:g.date,kind:"chat",title:[g.source,g.sourceContext].filter(Boolean).join(" \xB7 "),text:g.content});if(a.db){let g=Date.parse(e);for(let l of V(a.db,{agentId:t,since:Number.isFinite(g)?g:void 0,limit:500})){if(l.status==="in-flight"||u.has(l.taskId))continue;let k=(Q(a.db,l.taskId)?.steps??[]).filter(b=>b.name==="tool_use"||b.action).slice(0,be).map(b=>`- ${b.action??b.name}${b.inputSummary?` ${x(b.inputSummary,160)}`:""}${b.outputSummary?` \u2192 ${x(b.outputSummary,240)}`:""}${b.error?` \u2717 ${x(b.error,120)}`:""}`),y=[`Request: ${x(l.originalMessage??l.messagePreview??"",600)}`,k.length?`Tool calls:
3
3
  ${k.join(`
4
4
  `)}`:"",l.finalResponse?`Reply: ${x(l.finalResponse,800)}`:""].filter(Boolean).join(`
@@ -54,4 +54,4 @@ _Sources: ${t.sources.join("; ")}._`,a);return n.writeArticle(r,{title:t.title,.
54
54
  `).replace(/\n{3,}/g,`
55
55
 
56
56
  `).trim(),superseded:d}}function Ce(n){let r=n.previous?` (previously: ${n.previous})`:"";return`- **${n.attribute}:** ${n.value} \u2014 ${n.source}; checked ${n.checkedAt.slice(0,10)} by ${n.by}${r}`}function Re(n){let r=n.match(/^- \*\*.+?:\*\* (.*?) — .*?; checked (\S+) by \S+(?: \(previously: (.*)\))?$/);return r?{value:r[1],checkedAt:r[2],...r[3]?{previous:r[3]}:{}}:void 0}function J(n,r){return`contribution:${n}@${r.slice(0,10)}`}var Te={person:"people",project:"projects",place:"places",concept:"concepts",event:"events",decision:"decisions",pattern:"patterns"};function de(n,r,t){let a=r.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").slice(0,60)||"page",o=t?Te[t]:"contributions",c=`${o}/${a}.md`;for(let e=2;n.readArticle(c);e++)c=`${o}/${a}-${e}.md`;return c}export{_ as DEFAULT_CONTRIBUTION_LIMITS,B as FACTS_HEADING,ue as applyFactLines,De as approveHeld,xe as buildContributionPrompt,S as contributionsDir,_e as latestReport,K as listHeld,ye as listPendingBatches,Be as mergeContributions,W as pageKey,Ae as parseContributionPatches,ke as pendingWork,Se as possibleDuplicate,Fe as rejectHeld,ce as replaceOnce,Me as runContribution};
57
- //# sourceMappingURL=contributions-SMSYSHPU.js.map
57
+ //# sourceMappingURL=contributions-XSHL4IU5.js.map
@@ -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}from"./chunk-S6ZZKRDB.js";import"./chunk-T5IGXFSW.js";import"./chunk-IMLAPB7G.js";import"./chunk-LQS27HSV.js";import"./chunk-MNG2AMKZ.js";import"./chunk-QPABR72X.js";import"./chunk-KP7KDLZ2.js";import"./chunk-OSH2PEBH.js";import"./chunk-IVTO54EM.js";import"./chunk-BRK6M6LA.js";import"./chunk-UEEB3UTU.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{i as daemonVoiceCheck,b as doctor,g as meshPeerTokenChecks,h as meshTokenChecksFromConfig,a as runDoctorChecks,e as runMirrorChecks,d as runNativeChecks,c as runNotificationChecks,f as runReminderChecks};
2
- //# sourceMappingURL=doctor-5PFLKGNU.js.map
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}from"./chunk-UGPCMA7S.js";import"./chunk-4S7JQ7B3.js";import"./chunk-IMLAPB7G.js";import"./chunk-LQS27HSV.js";import"./chunk-MNG2AMKZ.js";import"./chunk-QPABR72X.js";import"./chunk-KP7KDLZ2.js";import"./chunk-OSH2PEBH.js";import"./chunk-CZLUBWNU.js";import"./chunk-BRK6M6LA.js";import"./chunk-UEEB3UTU.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{i as daemonVoiceCheck,b as doctor,g as meshPeerTokenChecks,h as meshTokenChecksFromConfig,a as runDoctorChecks,e as runMirrorChecks,d as runNativeChecks,c as runNotificationChecks,f as runReminderChecks};
2
+ //# sourceMappingURL=doctor-TBZE4NNW.js.map
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g,h,i,j}from"./chunk-AYK2MO3B.js";import"./chunk-VL74KOR7.js";import"./chunk-FCPTN6NF.js";import"./chunk-QIJLFPWE.js";export{b as DEFAULT_MIN_SESSIONS,a as FAILURE_STAMP_PREFIX,c as MAX_FAILURE_EXAMPLES,d as errorClass,i as failingTool,e as failureSignature,f as failureStamp,j as failuresToCandidates,h as loadFailedTraces,g as sessionOf};
2
- //# sourceMappingURL=failure-candidates-HNENLQJC.js.map
1
+ import{a,b,c,d,e,f,g,h,i,j}from"./chunk-CTN4KYE6.js";import"./chunk-VJVXEVZ7.js";import"./chunk-FCPTN6NF.js";import"./chunk-QIJLFPWE.js";export{b as DEFAULT_MIN_SESSIONS,a as FAILURE_STAMP_PREFIX,c as MAX_FAILURE_EXAMPLES,d as errorClass,i as failingTool,e as failureSignature,f as failureStamp,j as failuresToCandidates,h as loadFailedTraces,g as sessionOf};
2
+ //# sourceMappingURL=failure-candidates-WGSFI7GR.js.map
@@ -1,7 +1,7 @@
1
- import{b as h}from"./chunk-RUB4HZEG.js";import"./chunk-RKPAVWXF.js";import"./chunk-CDPQQAK6.js";import{b as I}from"./chunk-PYHR4HXO.js";import"./chunk-KP7KDLZ2.js";import"./chunk-PSTEWKR3.js";import"./chunk-CRUNUMVO.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-IVTO54EM.js";import"./chunk-BRK6M6LA.js";import"./chunk-UEEB3UTU.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";var p=t=>typeof t=="string"?t.trim():"";function $(t){return[`Run ${t.runId} "${t.title}" [${t.status}] on step ${t.step}: waiting on ${t.waitingOn}.`,t.tags?.length?`Tags: ${t.tags.join(", ")}`:"",...(t.steps??[]).slice(-8).map(s=>`- ${String(s.at).slice(0,16).replace("T"," ")} ${s.step} ${s.status}${s.note?`: ${s.note}`:""}`)].filter(Boolean).join(`
1
+ import{b as h}from"./chunk-GVU6YS3Y.js";import"./chunk-RKPAVWXF.js";import"./chunk-S3KWNMPJ.js";import{b as I}from"./chunk-PYHR4HXO.js";import"./chunk-KP7KDLZ2.js";import"./chunk-RGUQY65H.js";import"./chunk-5GJMPB6Q.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-CZLUBWNU.js";import"./chunk-BRK6M6LA.js";import"./chunk-UEEB3UTU.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";var p=t=>typeof t=="string"?t.trim():"";function $(t){return[`Run ${t.runId} "${t.title}" [${t.status}] on step ${t.step}: waiting on ${t.waitingOn}.`,t.tags?.length?`Tags: ${t.tags.join(", ")}`:"",...(t.steps??[]).slice(-8).map(s=>`- ${String(s.at).slice(0,16).replace("T"," ")} ${s.step} ${s.status}${s.note?`: ${s.note}`:""}`)].filter(Boolean).join(`
2
2
  `)}async function T(t,c){let s=c.fetch??fetch,m=c.daemonUrl.replace(/\/$/,""),r=(p(t.action)||"list").toLowerCase(),f=c.env??process.env,w=async i=>{let l=await s(`${m}${i}`,{signal:AbortSignal.timeout(1e4)}),n=await l.json().catch(()=>({}));return{ok:l.ok,status:l.status,data:n}};try{if(r==="list"){let e=await w("/follow-up");if(!e.ok)return`Error: ${e.data?.error||`HTTP ${e.status}`}`;let o=e.data.groups??[];return o.length?o.map(d=>[`${d.tag}:`,...d.rows.map(a=>`- ${a.runId} "${a.title}" on ${a.step}: waiting on ${a.waitingOn} (since ${String(a.since).slice(0,16).replace("T"," ")} UTC)`)].join(`
3
3
  `)).join(`
4
4
  `):"No follow-up workflows are running."}if(r==="match"){let e=p(t.request)||p(t.title);if(!e)return"Error: match needs `request`: the owner's request in their words.";let o=h(t,f),d=await w(`/follow-up/match?q=${encodeURIComponent(e)}${o?`&agentId=${encodeURIComponent(o.agentId)}`:""}`);if(!d.ok)return`Error: ${d.data?.error||`HTTP ${d.status}`}`;let a=d.data.matches??[];return a.length?["Saved workflows, best fit first (confidence 0-1):",...a.map(u=>`- ${u.workflowId} "${u.title}" (${u.confidence}${u.autoStart?", starts without asking":""}): ${u.steps.map(k=>k.id).join(" \u2192 ")}`),'Start one with {action:"start", workflowId:"<id>", title:"\u2026", tags:["client:<name>"]}. Run its steps through the workflow, not by hand.'].join(`
5
5
  `):"No saved workflow fits. If the request has several steps, build one: start with title and steps."}if(r==="status"){let e=p(t.runId);if(!e)return"Error: status needs runId.";let o=await w(`/follow-up/${encodeURIComponent(e)}`);return o.ok?$(o.data.run):`Error: ${o.data?.error||`HTTP ${o.status}`}`}let i=h(t,f);if(!i)return"Error: couldn't tell which agent you are. Pass callerAgentId.";let l=await s(`${m}/follow-up`,{method:"POST",headers:{"Content-Type":"application/json",...I(f)},body:JSON.stringify({action:r,agentId:i.agentId,workflowId:t.workflowId,title:t.title,description:t.description,tags:t.tags,inputs:t.inputs,steps:t.steps,edges:t.edges,approval:t.approval,autoStart:t.autoStart,requestId:t.requestId,runId:t.runId,step:t.step,evidence:t.evidence,note:t.note,reason:t.reason,fromRun:t.fromRun,status:t.status}),signal:AbortSignal.timeout(2e4)}),n=await l.json().catch(()=>({}));if(!l.ok)return`Error: ${n?.error||`HTTP ${l.status}`}`;if(r==="start"){let e=n.run;return[`Started run ${e.runId} "${e.title}"${n.built?" (built from the steps you gave; propose it with fromRun to keep it)":""}.`,n.awaitingApproval?"It waits for the owner's approval before the first step.":`It is on step ${e.step}: ${e.waitingOn}.`,"AgentX follows it from here: it starts each step, reminds whoever is slow, and tells the owner when it ends. Do not run its steps by hand.",...n.warning?[`Note: ${n.warning}`]:[]].join(" ")}return r==="plan"?[`Plan recorded on run ${n.run?.runId??t.runId}:`,...(n.plan??[]).map(e=>`- ${e.id} ${e.title}`),'Report each step with {action:"step", runId, step:"<id>", status:"started"|"done"|"failed"}.'].join(`
6
6
  `):r==="step"?`Step recorded. ${n.run?$(n.run):""}`.trim():r==="done"?`Step recorded as done. ${n.run?$(n.run):""}`.trim():r==="blocked"?"The step is marked blocked and the owner is told. Nothing more happens on it until it is sorted.":`Saved ${n.workflowId} switched off, and asked the owner (card ${n.cardId}) whether to keep it as a reusable workflow.`}catch(i){return`Error: couldn't reach the daemon (${i?.message??i}).`}}export{T as runWorkflowTool};
7
- //# sourceMappingURL=follow-up-tool-ME4DV7HT.js.map
7
+ //# sourceMappingURL=follow-up-tool-QC4NXZJT.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-NCEYJFF5.js";import"./chunk-YUGYKMY6.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-BC7VOHNH.js";import"./chunk-WPNRDEHW.js";import"./chunk-QT63Q6C5.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QOYAX2FT.js";import"./chunk-6QLRRSKU.js";import"./chunk-7I7IEX4S.js";import"./chunk-IVTO54EM.js";import"./chunk-BRK6M6LA.js";import"./chunk-UEEB3UTU.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as WikiHub};
2
- //# sourceMappingURL=hub-WGUNZ2D5.js.map
1
+ import{a}from"./chunk-SAFOO6XY.js";import"./chunk-OPCGTZU4.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-DPPYNUQW.js";import"./chunk-WPNRDEHW.js";import"./chunk-236CUFAC.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QOYAX2FT.js";import"./chunk-6QLRRSKU.js";import"./chunk-7I7IEX4S.js";import"./chunk-CZLUBWNU.js";import"./chunk-BRK6M6LA.js";import"./chunk-UEEB3UTU.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as WikiHub};
2
+ //# sourceMappingURL=hub-VRESIG2H.js.map
package/dist/index.d.ts CHANGED
@@ -1719,9 +1719,7 @@ declare const agentConfigSchema: z.ZodObject<{
1719
1719
  toolUseRequired: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1720
1720
  /** Monthly money budget for this agent (#1162). See monthlyBudgetSchema. */
1721
1721
  budget: z.ZodOptional<z.ZodObject<{
1722
- /** USD per calendar month. 0 or unset = no cap. */
1723
1722
  monthlyUsd: z.ZodOptional<z.ZodNumber>;
1724
- /** Share of the cap at which the owner is warned (default 0.8). */
1725
1723
  warnRatio: z.ZodDefault<z.ZodNumber>;
1726
1724
  }, "strip", z.ZodTypeAny, {
1727
1725
  warnRatio: number;
@@ -1790,17 +1788,22 @@ declare const agentConfigSchema: z.ZodObject<{
1790
1788
  /** wake only: no wake when the agent was already woken this many times
1791
1789
  * in the past hour. */
1792
1790
  maxPerHour: z.ZodDefault<z.ZodNumber>;
1791
+ /** wake only: what to do next when this event arrives. Added to the
1792
+ * woken turn's message after the event itself (#1284). */
1793
+ prompt: z.ZodOptional<z.ZodString>;
1793
1794
  }, "strip", z.ZodTypeAny, {
1794
1795
  kinds: string[];
1795
1796
  delivery: "pull" | "digest" | "wake";
1796
1797
  maxPerHour: number;
1797
1798
  match?: string | undefined;
1798
1799
  agents?: string[] | undefined;
1800
+ prompt?: string | undefined;
1799
1801
  nodes?: string[] | undefined;
1800
1802
  }, {
1801
1803
  kinds: string[];
1802
1804
  match?: string | undefined;
1803
1805
  agents?: string[] | undefined;
1806
+ prompt?: string | undefined;
1804
1807
  nodes?: string[] | undefined;
1805
1808
  delivery?: "pull" | "digest" | "wake" | undefined;
1806
1809
  maxPerHour?: number | undefined;
@@ -2010,6 +2013,7 @@ declare const agentConfigSchema: z.ZodObject<{
2010
2013
  maxPerHour: number;
2011
2014
  match?: string | undefined;
2012
2015
  agents?: string[] | undefined;
2016
+ prompt?: string | undefined;
2013
2017
  nodes?: string[] | undefined;
2014
2018
  }[];
2015
2019
  integrations: {
@@ -2044,6 +2048,10 @@ declare const agentConfigSchema: z.ZodObject<{
2044
2048
  enabled: boolean;
2045
2049
  };
2046
2050
  } | undefined;
2051
+ budget?: {
2052
+ warnRatio: number;
2053
+ monthlyUsd?: number | undefined;
2054
+ } | undefined;
2047
2055
  voice?: {
2048
2056
  system?: string | Record<string, string> | undefined;
2049
2057
  provider?: "system" | "elevenlabs" | undefined;
@@ -2072,10 +2080,6 @@ declare const agentConfigSchema: z.ZodObject<{
2072
2080
  team?: string | undefined;
2073
2081
  contextStrategy?: "layered" | "planner" | undefined;
2074
2082
  drainTimeoutSeconds?: number | undefined;
2075
- budget?: {
2076
- warnRatio: number;
2077
- monthlyUsd?: number | undefined;
2078
- } | undefined;
2079
2083
  gitlabAutoReply?: boolean | undefined;
2080
2084
  presence?: {
2081
2085
  initial?: string | undefined;
@@ -2103,6 +2107,10 @@ declare const agentConfigSchema: z.ZodObject<{
2103
2107
  enabled?: boolean | undefined;
2104
2108
  } | undefined;
2105
2109
  } | undefined;
2110
+ budget?: {
2111
+ monthlyUsd?: number | undefined;
2112
+ warnRatio?: number | undefined;
2113
+ } | undefined;
2106
2114
  voice?: {
2107
2115
  system?: string | Record<string, string> | undefined;
2108
2116
  provider?: "system" | "elevenlabs" | undefined;
@@ -2157,10 +2165,6 @@ declare const agentConfigSchema: z.ZodObject<{
2157
2165
  launchTimeoutSeconds?: number | undefined;
2158
2166
  } | undefined;
2159
2167
  toolUseRequired?: string[] | undefined;
2160
- budget?: {
2161
- monthlyUsd?: number | undefined;
2162
- warnRatio?: number | undefined;
2163
- } | undefined;
2164
2168
  gitlabAutoReply?: boolean | undefined;
2165
2169
  persistentProcess?: boolean | undefined;
2166
2170
  queueMode?: "drop" | "followup" | "collect" | undefined;
@@ -2168,6 +2172,7 @@ declare const agentConfigSchema: z.ZodObject<{
2168
2172
  kinds: string[];
2169
2173
  match?: string | undefined;
2170
2174
  agents?: string[] | undefined;
2175
+ prompt?: string | undefined;
2171
2176
  nodes?: string[] | undefined;
2172
2177
  delivery?: "pull" | "digest" | "wake" | undefined;
2173
2178
  maxPerHour?: number | undefined;
@@ -2759,9 +2764,7 @@ declare const daemonConfigSchema: z.ZodObject<{
2759
2764
  toolUseRequired: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2760
2765
  /** Monthly money budget for this agent (#1162). See monthlyBudgetSchema. */
2761
2766
  budget: z.ZodOptional<z.ZodObject<{
2762
- /** USD per calendar month. 0 or unset = no cap. */
2763
2767
  monthlyUsd: z.ZodOptional<z.ZodNumber>;
2764
- /** Share of the cap at which the owner is warned (default 0.8). */
2765
2768
  warnRatio: z.ZodDefault<z.ZodNumber>;
2766
2769
  }, "strip", z.ZodTypeAny, {
2767
2770
  warnRatio: number;
@@ -2830,17 +2833,22 @@ declare const daemonConfigSchema: z.ZodObject<{
2830
2833
  /** wake only: no wake when the agent was already woken this many times
2831
2834
  * in the past hour. */
2832
2835
  maxPerHour: z.ZodDefault<z.ZodNumber>;
2836
+ /** wake only: what to do next when this event arrives. Added to the
2837
+ * woken turn's message after the event itself (#1284). */
2838
+ prompt: z.ZodOptional<z.ZodString>;
2833
2839
  }, "strip", z.ZodTypeAny, {
2834
2840
  kinds: string[];
2835
2841
  delivery: "pull" | "digest" | "wake";
2836
2842
  maxPerHour: number;
2837
2843
  match?: string | undefined;
2838
2844
  agents?: string[] | undefined;
2845
+ prompt?: string | undefined;
2839
2846
  nodes?: string[] | undefined;
2840
2847
  }, {
2841
2848
  kinds: string[];
2842
2849
  match?: string | undefined;
2843
2850
  agents?: string[] | undefined;
2851
+ prompt?: string | undefined;
2844
2852
  nodes?: string[] | undefined;
2845
2853
  delivery?: "pull" | "digest" | "wake" | undefined;
2846
2854
  maxPerHour?: number | undefined;
@@ -3050,6 +3058,7 @@ declare const daemonConfigSchema: z.ZodObject<{
3050
3058
  maxPerHour: number;
3051
3059
  match?: string | undefined;
3052
3060
  agents?: string[] | undefined;
3061
+ prompt?: string | undefined;
3053
3062
  nodes?: string[] | undefined;
3054
3063
  }[];
3055
3064
  integrations: {
@@ -3084,6 +3093,10 @@ declare const daemonConfigSchema: z.ZodObject<{
3084
3093
  enabled: boolean;
3085
3094
  };
3086
3095
  } | undefined;
3096
+ budget?: {
3097
+ warnRatio: number;
3098
+ monthlyUsd?: number | undefined;
3099
+ } | undefined;
3087
3100
  voice?: {
3088
3101
  system?: string | Record<string, string> | undefined;
3089
3102
  provider?: "system" | "elevenlabs" | undefined;
@@ -3112,10 +3125,6 @@ declare const daemonConfigSchema: z.ZodObject<{
3112
3125
  team?: string | undefined;
3113
3126
  contextStrategy?: "layered" | "planner" | undefined;
3114
3127
  drainTimeoutSeconds?: number | undefined;
3115
- budget?: {
3116
- warnRatio: number;
3117
- monthlyUsd?: number | undefined;
3118
- } | undefined;
3119
3128
  gitlabAutoReply?: boolean | undefined;
3120
3129
  presence?: {
3121
3130
  initial?: string | undefined;
@@ -3143,6 +3152,10 @@ declare const daemonConfigSchema: z.ZodObject<{
3143
3152
  enabled?: boolean | undefined;
3144
3153
  } | undefined;
3145
3154
  } | undefined;
3155
+ budget?: {
3156
+ monthlyUsd?: number | undefined;
3157
+ warnRatio?: number | undefined;
3158
+ } | undefined;
3146
3159
  voice?: {
3147
3160
  system?: string | Record<string, string> | undefined;
3148
3161
  provider?: "system" | "elevenlabs" | undefined;
@@ -3197,10 +3210,6 @@ declare const daemonConfigSchema: z.ZodObject<{
3197
3210
  launchTimeoutSeconds?: number | undefined;
3198
3211
  } | undefined;
3199
3212
  toolUseRequired?: string[] | undefined;
3200
- budget?: {
3201
- monthlyUsd?: number | undefined;
3202
- warnRatio?: number | undefined;
3203
- } | undefined;
3204
3213
  gitlabAutoReply?: boolean | undefined;
3205
3214
  persistentProcess?: boolean | undefined;
3206
3215
  queueMode?: "drop" | "followup" | "collect" | undefined;
@@ -3208,6 +3217,7 @@ declare const daemonConfigSchema: z.ZodObject<{
3208
3217
  kinds: string[];
3209
3218
  match?: string | undefined;
3210
3219
  agents?: string[] | undefined;
3220
+ prompt?: string | undefined;
3211
3221
  nodes?: string[] | undefined;
3212
3222
  delivery?: "pull" | "digest" | "wake" | undefined;
3213
3223
  maxPerHour?: number | undefined;
@@ -3239,9 +3249,7 @@ declare const daemonConfigSchema: z.ZodObject<{
3239
3249
  /** Monthly money budget for the whole fleet (#1162). Reaching it pauses
3240
3250
  * every agent until the month ends or the cap is raised. */
3241
3251
  budget: z.ZodOptional<z.ZodObject<{
3242
- /** USD per calendar month. 0 or unset = no cap. */
3243
3252
  monthlyUsd: z.ZodOptional<z.ZodNumber>;
3244
- /** Share of the cap at which the owner is warned (default 0.8). */
3245
3253
  warnRatio: z.ZodDefault<z.ZodNumber>;
3246
3254
  }, "strip", z.ZodTypeAny, {
3247
3255
  warnRatio: number;
@@ -7835,6 +7843,9 @@ declare const daemonConfigSchema: z.ZodObject<{
7835
7843
  path?: string | undefined;
7836
7844
  }>, z.ZodObject<{
7837
7845
  type: z.ZodLiteral<"gitlab">;
7846
+ /** A list of agentx MCP tool names (session.lean.agentxTools). An unknown
7847
+ * name is an error, not ignored: a misspelt `agentx_channel_reply` would
7848
+ * otherwise leave a lean GitHub session with no way to reply. */
7838
7849
  projects: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
7839
7850
  }, "strip", z.ZodTypeAny, {
7840
7851
  type: "gitlab";
@@ -8310,18 +8321,36 @@ declare const daemonConfigSchema: z.ZodObject<{
8310
8321
  agents: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
8311
8322
  workspaces: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
8312
8323
  rhythmHours: z.ZodOptional<z.ZodNumber>;
8324
+ budget: z.ZodOptional<z.ZodObject<{
8325
+ monthlyUsd: z.ZodOptional<z.ZodNumber>;
8326
+ warnRatio: z.ZodDefault<z.ZodNumber>;
8327
+ }, "strip", z.ZodTypeAny, {
8328
+ warnRatio: number;
8329
+ monthlyUsd?: number | undefined;
8330
+ }, {
8331
+ monthlyUsd?: number | undefined;
8332
+ warnRatio?: number | undefined;
8333
+ }>>;
8313
8334
  }, "strip", z.ZodTypeAny, {
8314
8335
  agents: string[];
8315
8336
  name: string;
8316
8337
  repos: string[];
8317
8338
  workspaces: string[];
8318
8339
  rhythmHours?: number | undefined;
8340
+ budget?: {
8341
+ warnRatio: number;
8342
+ monthlyUsd?: number | undefined;
8343
+ } | undefined;
8319
8344
  }, {
8320
8345
  name: string;
8321
8346
  agents?: string[] | undefined;
8322
8347
  rhythmHours?: number | undefined;
8323
8348
  repos?: string[] | undefined;
8324
8349
  workspaces?: string[] | undefined;
8350
+ budget?: {
8351
+ monthlyUsd?: number | undefined;
8352
+ warnRatio?: number | undefined;
8353
+ } | undefined;
8325
8354
  }>, "many">>;
8326
8355
  capacity: z.ZodOptional<z.ZodObject<{
8327
8356
  threshold: z.ZodOptional<z.ZodNumber>;
@@ -8337,6 +8366,10 @@ declare const daemonConfigSchema: z.ZodObject<{
8337
8366
  repos: string[];
8338
8367
  workspaces: string[];
8339
8368
  rhythmHours?: number | undefined;
8369
+ budget?: {
8370
+ warnRatio: number;
8371
+ monthlyUsd?: number | undefined;
8372
+ } | undefined;
8340
8373
  }[];
8341
8374
  rhythmHours?: number | undefined;
8342
8375
  capacity?: {
@@ -8349,6 +8382,10 @@ declare const daemonConfigSchema: z.ZodObject<{
8349
8382
  rhythmHours?: number | undefined;
8350
8383
  repos?: string[] | undefined;
8351
8384
  workspaces?: string[] | undefined;
8385
+ budget?: {
8386
+ monthlyUsd?: number | undefined;
8387
+ warnRatio?: number | undefined;
8388
+ } | undefined;
8352
8389
  }[] | undefined;
8353
8390
  rhythmHours?: number | undefined;
8354
8391
  capacity?: {
@@ -8374,6 +8411,10 @@ declare const daemonConfigSchema: z.ZodObject<{
8374
8411
  repos: string[];
8375
8412
  workspaces: string[];
8376
8413
  rhythmHours?: number | undefined;
8414
+ budget?: {
8415
+ warnRatio: number;
8416
+ monthlyUsd?: number | undefined;
8417
+ } | undefined;
8377
8418
  }[];
8378
8419
  rhythmHours?: number | undefined;
8379
8420
  capacity?: {
@@ -8403,6 +8444,10 @@ declare const daemonConfigSchema: z.ZodObject<{
8403
8444
  rhythmHours?: number | undefined;
8404
8445
  repos?: string[] | undefined;
8405
8446
  workspaces?: string[] | undefined;
8447
+ budget?: {
8448
+ monthlyUsd?: number | undefined;
8449
+ warnRatio?: number | undefined;
8450
+ } | undefined;
8406
8451
  }[] | undefined;
8407
8452
  rhythmHours?: number | undefined;
8408
8453
  capacity?: {
@@ -9588,6 +9633,7 @@ declare const daemonConfigSchema: z.ZodObject<{
9588
9633
  maxPerHour: number;
9589
9634
  match?: string | undefined;
9590
9635
  agents?: string[] | undefined;
9636
+ prompt?: string | undefined;
9591
9637
  nodes?: string[] | undefined;
9592
9638
  }[];
9593
9639
  integrations: {
@@ -9622,6 +9668,10 @@ declare const daemonConfigSchema: z.ZodObject<{
9622
9668
  enabled: boolean;
9623
9669
  };
9624
9670
  } | undefined;
9671
+ budget?: {
9672
+ warnRatio: number;
9673
+ monthlyUsd?: number | undefined;
9674
+ } | undefined;
9625
9675
  voice?: {
9626
9676
  system?: string | Record<string, string> | undefined;
9627
9677
  provider?: "system" | "elevenlabs" | undefined;
@@ -9650,10 +9700,6 @@ declare const daemonConfigSchema: z.ZodObject<{
9650
9700
  team?: string | undefined;
9651
9701
  contextStrategy?: "layered" | "planner" | undefined;
9652
9702
  drainTimeoutSeconds?: number | undefined;
9653
- budget?: {
9654
- warnRatio: number;
9655
- monthlyUsd?: number | undefined;
9656
- } | undefined;
9657
9703
  gitlabAutoReply?: boolean | undefined;
9658
9704
  presence?: {
9659
9705
  initial?: string | undefined;
@@ -9865,6 +9911,10 @@ declare const daemonConfigSchema: z.ZodObject<{
9865
9911
  repos: string[];
9866
9912
  workspaces: string[];
9867
9913
  rhythmHours?: number | undefined;
9914
+ budget?: {
9915
+ warnRatio: number;
9916
+ monthlyUsd?: number | undefined;
9917
+ } | undefined;
9868
9918
  }[];
9869
9919
  rhythmHours?: number | undefined;
9870
9920
  capacity?: {
@@ -10663,6 +10713,10 @@ declare const daemonConfigSchema: z.ZodObject<{
10663
10713
  maxAgeSeconds: number;
10664
10714
  sweepIntervalSeconds: number;
10665
10715
  };
10716
+ budget?: {
10717
+ warnRatio: number;
10718
+ monthlyUsd?: number | undefined;
10719
+ } | undefined;
10666
10720
  business?: {
10667
10721
  enabled: boolean;
10668
10722
  projects: {
@@ -10731,10 +10785,6 @@ declare const daemonConfigSchema: z.ZodObject<{
10731
10785
  dryRun: boolean;
10732
10786
  };
10733
10787
  } | undefined;
10734
- budget?: {
10735
- warnRatio: number;
10736
- monthlyUsd?: number | undefined;
10737
- } | undefined;
10738
10788
  }, {
10739
10789
  node: {
10740
10790
  id: string;
@@ -10765,6 +10815,10 @@ declare const daemonConfigSchema: z.ZodObject<{
10765
10815
  enabled?: boolean | undefined;
10766
10816
  } | undefined;
10767
10817
  } | undefined;
10818
+ budget?: {
10819
+ monthlyUsd?: number | undefined;
10820
+ warnRatio?: number | undefined;
10821
+ } | undefined;
10768
10822
  voice?: {
10769
10823
  system?: string | Record<string, string> | undefined;
10770
10824
  provider?: "system" | "elevenlabs" | undefined;
@@ -10819,10 +10873,6 @@ declare const daemonConfigSchema: z.ZodObject<{
10819
10873
  launchTimeoutSeconds?: number | undefined;
10820
10874
  } | undefined;
10821
10875
  toolUseRequired?: string[] | undefined;
10822
- budget?: {
10823
- monthlyUsd?: number | undefined;
10824
- warnRatio?: number | undefined;
10825
- } | undefined;
10826
10876
  gitlabAutoReply?: boolean | undefined;
10827
10877
  persistentProcess?: boolean | undefined;
10828
10878
  queueMode?: "drop" | "followup" | "collect" | undefined;
@@ -10830,6 +10880,7 @@ declare const daemonConfigSchema: z.ZodObject<{
10830
10880
  kinds: string[];
10831
10881
  match?: string | undefined;
10832
10882
  agents?: string[] | undefined;
10883
+ prompt?: string | undefined;
10833
10884
  nodes?: string[] | undefined;
10834
10885
  delivery?: "pull" | "digest" | "wake" | undefined;
10835
10886
  maxPerHour?: number | undefined;
@@ -10964,6 +11015,10 @@ declare const daemonConfigSchema: z.ZodObject<{
10964
11015
  agent?: string | undefined;
10965
11016
  } | undefined;
10966
11017
  } | undefined;
11018
+ budget?: {
11019
+ monthlyUsd?: number | undefined;
11020
+ warnRatio?: number | undefined;
11021
+ } | undefined;
10967
11022
  wall?: {
10968
11023
  reportedIssues?: {
10969
11024
  label: string;
@@ -11062,6 +11117,10 @@ declare const daemonConfigSchema: z.ZodObject<{
11062
11117
  rhythmHours?: number | undefined;
11063
11118
  repos?: string[] | undefined;
11064
11119
  workspaces?: string[] | undefined;
11120
+ budget?: {
11121
+ monthlyUsd?: number | undefined;
11122
+ warnRatio?: number | undefined;
11123
+ } | undefined;
11065
11124
  }[] | undefined;
11066
11125
  rhythmHours?: number | undefined;
11067
11126
  capacity?: {
@@ -11438,10 +11497,6 @@ declare const daemonConfigSchema: z.ZodObject<{
11438
11497
  defaultTitle?: string | undefined;
11439
11498
  } | undefined;
11440
11499
  } | undefined;
11441
- budget?: {
11442
- monthlyUsd?: number | undefined;
11443
- warnRatio?: number | undefined;
11444
- } | undefined;
11445
11500
  crons?: Record<string, {
11446
11501
  agent: string;
11447
11502
  schedule: string;
@@ -12908,6 +12963,8 @@ declare class AgentXDaemon {
12908
12963
  * cost is added as it completes, and a line it crosses tells the owner
12909
12964
  * once. The registry refuses runs past a cap (preflightBudgetGate). */
12910
12965
  private startBudgets;
12966
+ /** The month's spend per agent and per project (#1290), from the traces. */
12967
+ private seedBudgets;
12911
12968
  /** Tell the owner through the notify path: a push to the default
12912
12969
  * channel, the Mac banner where there is one (#788). */
12913
12970
  private notifyOwner;
@@ -13219,6 +13276,12 @@ declare class TokenTracker {
13219
13276
  * static variant when available.
13220
13277
  */
13221
13278
  cost(usage: AgentUsage | ChannelUsage, model?: string): number;
13279
+ /**
13280
+ * What one run cost at list price, for budgets (#1162, #1290): Claude
13281
+ * models through cost(), other providers' API models at their flat rate
13282
+ * (no long-prompt surcharge), undefined for a model with no price.
13283
+ */
13284
+ runCost(usage: TaskUsage, model: string | undefined, tier?: string): number | undefined;
13222
13285
  /**
13223
13286
  * Record a task execution with real or estimated token counts.
13224
13287
  *
@@ -13355,7 +13418,10 @@ interface FriendlyError {
13355
13418
  /** Machine-readable error category for routing / retries. */
13356
13419
  kind: "out_of_credits" | "overage_disabled" | "usage_cap"
13357
13420
  /** An agent or the fleet reached its AgentX monthly budget (#1162). */
13358
- | "budget_cap" | "auth" | "permission" | "rate_limit" | "overloaded" | "context_too_large" | "invalid_request" | "upstream_api" | "timeout" | "cancelled" | "interrupted"
13421
+ | "budget_cap"
13422
+ /** A cold dispatch held by the plan window, overage gate or local
13423
+ * dispatch cap; it goes through once the window frees up (#1284). */
13424
+ | "dispatch_hold" | "auth" | "permission" | "rate_limit" | "overloaded" | "context_too_large" | "invalid_request" | "upstream_api" | "timeout" | "cancelled" | "interrupted"
13359
13425
  /** Ended by a stop signal; its resume plan is saved (#857). */
13360
13426
  | "stopped" | "unknown";
13361
13427
  /** Whether this error is transient — a retry has a reasonable chance of succeeding. */
@@ -17330,6 +17396,9 @@ declare class AgentRegistry {
17330
17396
  * `a2a`, `cron`, `workflow`, …) where no adapter is registered.
17331
17397
  */
17332
17398
  private postQueuedResponseToChannel;
17399
+ /** The root a running task works under, when it has one (#1284: an
17400
+ * event the turn emits carries it, so the loop guard holds). */
17401
+ runningTaskRoot(taskId: string): string | undefined;
17333
17402
  /** The agent running `taskId` right now, or null once it has finished.
17334
17403
  * Lets an HTTP caller that names its task prove which agent it is. */
17335
17404
  runningTaskOwner(taskId: string): {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{Fa as Tt,Ga as Mt,a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt,h as bt}from"./chunk-KTJ6234K.js";import"./chunk-EXJGRK2N.js";import"./chunk-GTJIKXDB.js";import"./chunk-6Y53LLIX.js";import"./chunk-T5IGXFSW.js";import"./chunk-VUEQ4SL5.js";import"./chunk-IMLAPB7G.js";import"./chunk-ZVP6GB4G.js";import"./chunk-LQE73AZR.js";import"./chunk-2D3RYIDU.js";import"./chunk-MRIVENBY.js";import"./chunk-BNOGNRAM.js";import"./chunk-LQS27HSV.js";import"./chunk-PPUN7YHA.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-73SESASJ.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-UKUH662W.js";import"./chunk-6V5JBHUN.js";import"./chunk-2VDO2HEK.js";import"./chunk-JWDJMFU6.js";import"./chunk-5HLD66CW.js";import"./chunk-IS2IWRP7.js";import"./chunk-MNG2AMKZ.js";import"./chunk-X7UQY7CH.js";import"./chunk-QPABR72X.js";import"./chunk-CDPQQAK6.js";import"./chunk-PYHR4HXO.js";import"./chunk-KP7KDLZ2.js";import"./chunk-A5GYG56I.js";import{m as lt,n as ct,o as dt,p as mt,q as pt,ra as yt}from"./chunk-ILHTAVZZ.js";import"./chunk-AXDNFXYU.js";import"./chunk-MEFPXHQJ.js";import{a as L}from"./chunk-TCC56PYX.js";import{A as D,B as z,C as V,a as ye,b as we,c as Se,d as Ae,e as Ie,f as Oe,g as Ne,h as He,i as je,j as Ue,k as _e,l as I,m as q,n as Be,o as qe,p as Ye,q as O,r as ze,s as Ve,t as Xe,u as x,v as Y,w as Qe,x as Ze,y as et,z as wt}from"./chunk-Y6JSB5II.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-6TTGRTDO.js";import"./chunk-SZDACK6O.js";import"./chunk-VE3SSOQX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-VL74KOR7.js";import{s as ut}from"./chunk-PSTEWKR3.js";import"./chunk-CRUNUMVO.js";import"./chunk-3UOTLMXD.js";import"./chunk-XIRM45DH.js";import"./chunk-PE5V2LI7.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-VWTBHLMX.js";import"./chunk-NCEYJFF5.js";import{a as ht}from"./chunk-YUGYKMY6.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-ON7Y3JSP.js";import"./chunk-JTFCU5LH.js";import{f as gt,g as ft}from"./chunk-BC7VOHNH.js";import"./chunk-WPNRDEHW.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-V7R5AJVN.js";import{j as it,k as rt,l as at}from"./chunk-QT63Q6C5.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-MYVHVJWZ.js";import"./chunk-QUFIUXMQ.js";import"./chunk-AV7T3SYT.js";import"./chunk-TM2TPQKH.js";import"./chunk-BERWTVG2.js";import"./chunk-QOYAX2FT.js";import{a as ke,b as ve,c as xe,d as $e,e as Ce,f as Pe,g as be,h as Te,i as Me,j as Re,l as Ee,m as Ge,o as T,p as W}from"./chunk-6QLRRSKU.js";import{a as m,b as G}from"./chunk-7I7IEX4S.js";import{b as Fe,c as Le,d as A,e as De}from"./chunk-JHCI6XCJ.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{ib as tt,kb as st,mb as ot,tb as nt}from"./chunk-IVTO54EM.js";import"./chunk-BRK6M6LA.js";import"./chunk-UEEB3UTU.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";W();G();import{execa as Rt}from"execa";import{existsSync as se,promises as X}from"fs";import S from"path";import ie from"node-fetch";async function Et(o,e){let t=o.split("/");if(t.length<2)throw new Error(`Invalid skill package ID: ${o}. Expected format: owner/repo`);let s=t[0],i=t[1],n=t[2];try{let a=n?`${s}/${i}/${n}`:`${s}/${i}`;await Rt("npx",["-y","skills","add",a],{cwd:e,stdio:"pipe"}),m.success(`Installed skill package: ${o}`);let r=S.resolve(e,".skills",`${s}_${i}`);if(se(r))return await ne(r,o);let d=S.resolve(e,".skills");return se(d)?await ne(d,o):[]}catch{return m.info(`Fetching skills directly from GitHub: ${s}/${i}`),await Gt(s,i,n,e)}}async function Gt(o,e,t,s){let i=[];try{let n=`https://api.github.com/repos/${o}/${e}/git/trees/main?recursive=1`,a=await ie(n);if(!a.ok)throw new Error(`GitHub API error: ${a.status}`);let d=(await a.json()).tree.filter(p=>p.type==="blob"&&p.path.endsWith("SKILL.md"));if(t){let p=d.find(f=>f.path.includes(`/${t}/`)||f.path===`${t}/SKILL.md`);if(p){let f=await oe(o,e,p.path,s);f&&i.push(f)}}else for(let p of d){let f=await oe(o,e,p.path,s);f&&i.push(f)}}catch(n){m.error(`Failed to fetch skills from GitHub: ${n.message}`)}return i}async function oe(o,e,t,s){try{let i=`https://raw.githubusercontent.com/${o}/${e}/main/${t}`,n=await ie(i);if(!n.ok)return null;let a=await n.text(),r=A(a);if(r){r.source="remote",r.packageId=`${o}/${e}`;let d=S.dirname(t),p=S.resolve(s,".skills",`${o}_${e}`,d);await X.mkdir(p,{recursive:!0}),await X.writeFile(S.resolve(p,"SKILL.md"),a),r.path=S.resolve(p,"SKILL.md")}return r}catch{return null}}async function ne(o,e){let t=[],{default:s}=await import("fast-glob"),i=await s.glob("**/SKILL.md",{cwd:o,deep:5});for(let n of i)try{let a=S.resolve(o,n),r=await X.readFile(a,"utf8"),d=A(r);d&&(d.source="remote",d.path=a,d.packageId=e,t.push(d))}catch{}return t}async function At(o,e,t,s,i){let n=["---",`name: ${o}`,`description: ${e}`];if(s?.length){n.push("tags:");for(let a of s)n.push(` - ${a}`)}if(i?.length){n.push("globs:");for(let a of i)n.push(` - ${a}`)}return n.push("---"),`${n.join(`
1
+ import{Fa as Tt,Ga as Mt,a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt,h as bt}from"./chunk-PHLILSAY.js";import"./chunk-56I4CDWP.js";import"./chunk-GTJIKXDB.js";import"./chunk-FIL6QI6N.js";import"./chunk-4S7JQ7B3.js";import"./chunk-VUEQ4SL5.js";import"./chunk-IMLAPB7G.js";import"./chunk-ZVP6GB4G.js";import"./chunk-LQE73AZR.js";import"./chunk-2D3RYIDU.js";import"./chunk-MRIVENBY.js";import"./chunk-BNOGNRAM.js";import"./chunk-LQS27HSV.js";import"./chunk-PPUN7YHA.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-IJT6KKST.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-UKUH662W.js";import"./chunk-6V5JBHUN.js";import"./chunk-2VDO2HEK.js";import"./chunk-JWDJMFU6.js";import"./chunk-5HLD66CW.js";import"./chunk-IS2IWRP7.js";import"./chunk-MNG2AMKZ.js";import"./chunk-X7UQY7CH.js";import"./chunk-QPABR72X.js";import"./chunk-S3KWNMPJ.js";import"./chunk-PYHR4HXO.js";import"./chunk-KP7KDLZ2.js";import"./chunk-A5GYG56I.js";import{m as lt,n as ct,o as dt,p as mt,q as pt,ra as yt}from"./chunk-ZA7DX4A2.js";import"./chunk-KDDV3VFJ.js";import"./chunk-MEFPXHQJ.js";import{a as L}from"./chunk-TCC56PYX.js";import{A as D,B as z,C as V,a as ye,b as we,c as Se,d as Ae,e as Ie,f as Oe,g as Ne,h as He,i as je,j as Ue,k as _e,l as I,m as q,n as Be,o as qe,p as Ye,q as O,r as ze,s as Ve,t as Xe,u as x,v as Y,w as Qe,x as Ze,y as et,z as wt}from"./chunk-SMPADAHT.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-6TTGRTDO.js";import"./chunk-SZDACK6O.js";import"./chunk-VE3SSOQX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-VJVXEVZ7.js";import{s as ut}from"./chunk-RGUQY65H.js";import"./chunk-5GJMPB6Q.js";import"./chunk-3UOTLMXD.js";import"./chunk-BE64IJWM.js";import"./chunk-PE5V2LI7.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-VWTBHLMX.js";import"./chunk-SAFOO6XY.js";import{a as ht}from"./chunk-OPCGTZU4.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-MQFHPGLC.js";import"./chunk-JTFCU5LH.js";import{f as gt,g as ft}from"./chunk-DPPYNUQW.js";import"./chunk-WPNRDEHW.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-7PWM4GYY.js";import{j as it,k as rt,l as at}from"./chunk-236CUFAC.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-MYVHVJWZ.js";import"./chunk-QUFIUXMQ.js";import"./chunk-AV7T3SYT.js";import"./chunk-TM2TPQKH.js";import"./chunk-BERWTVG2.js";import"./chunk-QOYAX2FT.js";import{a as ke,b as ve,c as xe,d as $e,e as Ce,f as Pe,g as be,h as Te,i as Me,j as Re,l as Ee,m as Ge,o as T,p as W}from"./chunk-6QLRRSKU.js";import{a as m,b as G}from"./chunk-7I7IEX4S.js";import{b as Fe,c as Le,d as A,e as De}from"./chunk-JHCI6XCJ.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{ib as tt,kb as st,mb as ot,tb as nt}from"./chunk-CZLUBWNU.js";import"./chunk-BRK6M6LA.js";import"./chunk-UEEB3UTU.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";W();G();import{execa as Rt}from"execa";import{existsSync as se,promises as X}from"fs";import S from"path";import ie from"node-fetch";async function Et(o,e){let t=o.split("/");if(t.length<2)throw new Error(`Invalid skill package ID: ${o}. Expected format: owner/repo`);let s=t[0],i=t[1],n=t[2];try{let a=n?`${s}/${i}/${n}`:`${s}/${i}`;await Rt("npx",["-y","skills","add",a],{cwd:e,stdio:"pipe"}),m.success(`Installed skill package: ${o}`);let r=S.resolve(e,".skills",`${s}_${i}`);if(se(r))return await ne(r,o);let d=S.resolve(e,".skills");return se(d)?await ne(d,o):[]}catch{return m.info(`Fetching skills directly from GitHub: ${s}/${i}`),await Gt(s,i,n,e)}}async function Gt(o,e,t,s){let i=[];try{let n=`https://api.github.com/repos/${o}/${e}/git/trees/main?recursive=1`,a=await ie(n);if(!a.ok)throw new Error(`GitHub API error: ${a.status}`);let d=(await a.json()).tree.filter(p=>p.type==="blob"&&p.path.endsWith("SKILL.md"));if(t){let p=d.find(f=>f.path.includes(`/${t}/`)||f.path===`${t}/SKILL.md`);if(p){let f=await oe(o,e,p.path,s);f&&i.push(f)}}else for(let p of d){let f=await oe(o,e,p.path,s);f&&i.push(f)}}catch(n){m.error(`Failed to fetch skills from GitHub: ${n.message}`)}return i}async function oe(o,e,t,s){try{let i=`https://raw.githubusercontent.com/${o}/${e}/main/${t}`,n=await ie(i);if(!n.ok)return null;let a=await n.text(),r=A(a);if(r){r.source="remote",r.packageId=`${o}/${e}`;let d=S.dirname(t),p=S.resolve(s,".skills",`${o}_${e}`,d);await X.mkdir(p,{recursive:!0}),await X.writeFile(S.resolve(p,"SKILL.md"),a),r.path=S.resolve(p,"SKILL.md")}return r}catch{return null}}async function ne(o,e){let t=[],{default:s}=await import("fast-glob"),i=await s.glob("**/SKILL.md",{cwd:o,deep:5});for(let n of i)try{let a=S.resolve(o,n),r=await X.readFile(a,"utf8"),d=A(r);d&&(d.source="remote",d.path=a,d.packageId=e,t.push(d))}catch{}return t}async function At(o,e,t,s,i){let n=["---",`name: ${o}`,`description: ${e}`];if(s?.length){n.push("tags:");for(let a of s)n.push(` - ${a}`)}if(i?.length){n.push("globs:");for(let a of i)n.push(` - ${a}`)}return n.push("---"),`${n.join(`
2
2
  `)}
3
3
 
4
4
  ${t}`}async function It(o){let{loadLocalSkills:e}=await import("./loader-YFVSSYSL.js");return e(o)}async function Ot(o,e,t,s,i){let a=[{role:"system",content:`You are a skill author for the Agent Skills ecosystem (skills.sh).