agentix-cli 0.158.0 → 0.160.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 (186) hide show
  1. package/README.md +25 -20
  2. package/dist/{App-AFRBV666.js → App-ENNAIXFU.js} +2 -2
  3. package/dist/{ChatApp-EBTSY27Z.js → ChatApp-UNYTCNPZ.js} +2 -2
  4. package/dist/{absorb-eval-OCR3G5TE.js → absorb-eval-UVOIKIBZ.js} +2 -2
  5. package/dist/{agent-QZ4QTZKW.js → agent-JFDIUUCZ.js} +2 -2
  6. package/dist/{board-dashboard-QJ2CWJKI.js → board-dashboard-BOQSP6XB.js} +950 -435
  7. package/dist/board-dashboard-BOQSP6XB.js.map +1 -0
  8. package/dist/{chunk-SRUIUZOC.js → chunk-3MSNOHKU.js} +59 -58
  9. package/dist/chunk-3MSNOHKU.js.map +1 -0
  10. package/dist/{chunk-BY2AAMOO.js → chunk-4QVGHA4B.js} +2 -2
  11. package/dist/chunk-6LVCXEQE.js +181 -0
  12. package/dist/chunk-6LVCXEQE.js.map +1 -0
  13. package/dist/{chunk-TRGNLW43.js → chunk-7NRBMQE6.js} +2 -2
  14. package/dist/{chunk-LLJZMS23.js → chunk-AYK2MO3B.js} +2 -2
  15. package/dist/{chunk-KPNAXVET.js → chunk-CI5OJ2JN.js} +2 -2
  16. package/dist/{chunk-E4O32ZYZ.js → chunk-CXBTGXFO.js} +2 -2
  17. package/dist/{chunk-3ZMVYNFH.js → chunk-DEXEPOHH.js} +2 -2
  18. package/dist/{chunk-B3I4EBLE.js → chunk-H2KVHGAP.js} +2 -2
  19. package/dist/{chunk-DNPL3YOH.js → chunk-HYNP5WYF.js} +3 -3
  20. package/dist/{chunk-EWBUH2IU.js → chunk-IMNN5RBR.js} +2 -2
  21. package/dist/{chunk-5XPXYOWB.js → chunk-IMSIYVBM.js} +2 -2
  22. package/dist/{chunk-DPNCWHJW.js → chunk-ITIW4UUJ.js} +2 -2
  23. package/dist/{chunk-ZSVCHDYT.js → chunk-LRP2LTLC.js} +2 -2
  24. package/dist/chunk-M4AQRADJ.js +41 -0
  25. package/dist/chunk-M4AQRADJ.js.map +1 -0
  26. package/dist/{chunk-OYPKAYCH.js → chunk-M5L3SOS2.js} +2 -2
  27. package/dist/{chunk-MKLRCNOX.js → chunk-N3VQ5NSV.js} +268 -269
  28. package/dist/chunk-N3VQ5NSV.js.map +1 -0
  29. package/dist/chunk-NHD6DUBL.js +36 -0
  30. package/dist/{chunk-QH3RKKD3.js.map → chunk-NHD6DUBL.js.map} +1 -1
  31. package/dist/{chunk-VHHKS7S4.js → chunk-NURZPCUE.js} +2 -2
  32. package/dist/{chunk-2NLPGLLL.js → chunk-ORAZ3WHL.js} +16 -7
  33. package/dist/chunk-ORAZ3WHL.js.map +1 -0
  34. package/dist/{chunk-5NTWGUSJ.js → chunk-PFNGZ27Y.js} +2 -2
  35. package/dist/{chunk-4UMMAI3Z.js → chunk-QEJD3KFG.js} +2 -2
  36. package/dist/{chunk-NY5ZY2WV.js → chunk-QJDYXEEB.js} +2 -2
  37. package/dist/chunk-QPABR72X.js +2 -0
  38. package/dist/chunk-QPABR72X.js.map +1 -0
  39. package/dist/{chunk-FM6RZI52.js → chunk-RJWFVKBK.js} +2 -2
  40. package/dist/{chunk-GVMV3TWS.js → chunk-RW3MTYHG.js} +2 -2
  41. package/dist/{chunk-P5RTEJUB.js → chunk-SCEQJFQO.js} +2 -2
  42. package/dist/chunk-TFN6A3KI.js +90 -0
  43. package/dist/chunk-TFN6A3KI.js.map +1 -0
  44. package/dist/{chunk-FEF432WU.js → chunk-TZHVLA3D.js} +2 -2
  45. package/dist/{chunk-EMGB23H5.js → chunk-UKUH662W.js} +2 -2
  46. package/dist/chunk-UKUH662W.js.map +1 -0
  47. package/dist/{chunk-JJV7O7YK.js → chunk-VDXHZAMX.js} +2 -2
  48. package/dist/{chunk-5TTHN7DP.js → chunk-VL74KOR7.js} +18 -13
  49. package/dist/chunk-VL74KOR7.js.map +1 -0
  50. package/dist/{chunk-JYSJDHNS.js → chunk-VUEQ4SL5.js} +18 -9
  51. package/dist/{chunk-JYSJDHNS.js.map → chunk-VUEQ4SL5.js.map} +1 -1
  52. package/dist/{chunk-UIBUZ2N3.js → chunk-XHAPSFAB.js} +18 -7
  53. package/dist/chunk-XHAPSFAB.js.map +1 -0
  54. package/dist/chunk-XIRM45DH.js +11 -0
  55. package/dist/chunk-XIRM45DH.js.map +1 -0
  56. package/dist/{chunk-PA3KFAXH.js → chunk-Y4KVFLQZ.js} +2 -2
  57. package/dist/{chunk-MBPYC6QF.js → chunk-ZFMG4GFE.js} +2 -2
  58. package/dist/cli.js +1 -1
  59. package/dist/{client-7ZJZT5H7.js → client-LUZU6O45.js} +2 -2
  60. package/dist/{config-NFDEJ3NB.js → config-54LNSYJF.js} +2 -2
  61. package/dist/config-mutate-DPI3LUG5.js +2 -0
  62. package/dist/config-mutator-W5QTLGCY.js +2 -0
  63. package/dist/{contributions-ECGVSETO.js → contributions-FCKXPCOL.js} +2 -2
  64. package/dist/doctor-ZGL3U4XJ.js +2 -0
  65. package/dist/{failure-candidates-NQX2JMMS.js → failure-candidates-HNENLQJC.js} +2 -2
  66. package/dist/{follow-up-tool-FNO2IG72.js → follow-up-tool-ARGSSE7Q.js} +2 -2
  67. package/dist/hub-NK7Q4F2X.js +2 -0
  68. package/dist/index.d.ts +124 -1
  69. package/dist/index.js +1 -1
  70. package/dist/index.js.map +1 -1
  71. package/dist/processes-GRS7BSIU.js +2 -0
  72. package/dist/{program-7UMVHRD3.js → program-DJJBDNID.js} +284 -267
  73. package/dist/program-DJJBDNID.js.map +1 -0
  74. package/dist/{promote-AAEZYPBP.js → promote-BKHGOZB2.js} +2 -2
  75. package/dist/{query-WWZEARB4.js → query-SPGPGSHG.js} +2 -2
  76. package/dist/{query-settings-3FE555NP.js → query-settings-L6FOADK7.js} +2 -2
  77. package/dist/{registry-JPZLE5XX.js → registry-2JIZ3LOU.js} +2 -2
  78. package/dist/{request-planner-2AU3VK4P.js → request-planner-JCRREXJX.js} +2 -2
  79. package/dist/{review-candidates-CIEGXF7K.js → review-candidates-OKHRZROS.js} +2 -2
  80. package/dist/routing-B3B3ANA5.js +2 -0
  81. package/dist/schedule-tool-GUEADWVH.js +2 -0
  82. package/dist/scheduler-OKSJXZBX.js +2 -0
  83. package/dist/{seat-JWRCBUKR.js → seat-FQ53NWXV.js} +2 -2
  84. package/dist/{select-KIDX6WWF.js → select-YE4C3DZS.js} +2 -2
  85. package/dist/{set-enabled-F4D3VWKI.js → set-enabled-66ZBGZ2O.js} +2 -2
  86. package/dist/{surface-usage-WSY4SHHL.js → surface-usage-JOOZOGOH.js} +2 -2
  87. package/dist/token-store-F2PHHO5A.js +2 -0
  88. package/dist/token-tracker-B2UFOH46.js +2 -0
  89. package/dist/tool-QNIODAFO.js +6 -0
  90. package/dist/tool-QNIODAFO.js.map +1 -0
  91. package/dist/{tool-YSS2C2UX.js → tool-U2HRYX3V.js} +2 -2
  92. package/dist/traces-G4HRLRA3.js +2 -0
  93. package/dist/wiki-3HUDGN6J.js +2 -0
  94. package/dist/wiki-enrich-XQ3ZQBWZ.js +2 -0
  95. package/dist/{workflow-pilot-HCPSMGIC.js → workflow-pilot-25NMZYUO.js} +2 -2
  96. package/package.json +1 -1
  97. package/dist/board-dashboard-QJ2CWJKI.js.map +0 -1
  98. package/dist/chunk-2NLPGLLL.js.map +0 -1
  99. package/dist/chunk-36AXN6ZB.js +0 -11
  100. package/dist/chunk-36AXN6ZB.js.map +0 -1
  101. package/dist/chunk-5TTHN7DP.js.map +0 -1
  102. package/dist/chunk-EMGB23H5.js.map +0 -1
  103. package/dist/chunk-LSDUL7EW.js +0 -181
  104. package/dist/chunk-LSDUL7EW.js.map +0 -1
  105. package/dist/chunk-MKLRCNOX.js.map +0 -1
  106. package/dist/chunk-O5H6BCUN.js +0 -77
  107. package/dist/chunk-O5H6BCUN.js.map +0 -1
  108. package/dist/chunk-PVWHEPF3.js +0 -41
  109. package/dist/chunk-PVWHEPF3.js.map +0 -1
  110. package/dist/chunk-QH3RKKD3.js +0 -36
  111. package/dist/chunk-SRUIUZOC.js.map +0 -1
  112. package/dist/chunk-UIBUZ2N3.js.map +0 -1
  113. package/dist/config-mutate-JYW5G7T6.js +0 -2
  114. package/dist/config-mutator-OMWL5XHO.js +0 -2
  115. package/dist/doctor-D6OVZAFB.js +0 -2
  116. package/dist/hub-MOAG5BEQ.js +0 -2
  117. package/dist/processes-XM77XGOO.js +0 -2
  118. package/dist/program-7UMVHRD3.js.map +0 -1
  119. package/dist/routing-XJ25QONX.js +0 -2
  120. package/dist/schedule-tool-5T4CH4CM.js +0 -2
  121. package/dist/scheduler-UKJWO2TR.js +0 -2
  122. package/dist/token-store-AY6OBDVI.js +0 -2
  123. package/dist/token-tracker-W7DFDEFN.js +0 -2
  124. package/dist/tool-7FFJSFTS.js +0 -6
  125. package/dist/tool-7FFJSFTS.js.map +0 -1
  126. package/dist/traces-GVEQZX24.js +0 -2
  127. package/dist/wiki-5Y4GSCYL.js +0 -2
  128. package/dist/wiki-enrich-TJIL4B3V.js +0 -2
  129. /package/dist/{App-AFRBV666.js.map → App-ENNAIXFU.js.map} +0 -0
  130. /package/dist/{ChatApp-EBTSY27Z.js.map → ChatApp-UNYTCNPZ.js.map} +0 -0
  131. /package/dist/{absorb-eval-OCR3G5TE.js.map → absorb-eval-UVOIKIBZ.js.map} +0 -0
  132. /package/dist/{agent-QZ4QTZKW.js.map → agent-JFDIUUCZ.js.map} +0 -0
  133. /package/dist/{chunk-BY2AAMOO.js.map → chunk-4QVGHA4B.js.map} +0 -0
  134. /package/dist/{chunk-TRGNLW43.js.map → chunk-7NRBMQE6.js.map} +0 -0
  135. /package/dist/{chunk-LLJZMS23.js.map → chunk-AYK2MO3B.js.map} +0 -0
  136. /package/dist/{chunk-KPNAXVET.js.map → chunk-CI5OJ2JN.js.map} +0 -0
  137. /package/dist/{chunk-E4O32ZYZ.js.map → chunk-CXBTGXFO.js.map} +0 -0
  138. /package/dist/{chunk-3ZMVYNFH.js.map → chunk-DEXEPOHH.js.map} +0 -0
  139. /package/dist/{chunk-B3I4EBLE.js.map → chunk-H2KVHGAP.js.map} +0 -0
  140. /package/dist/{chunk-DNPL3YOH.js.map → chunk-HYNP5WYF.js.map} +0 -0
  141. /package/dist/{chunk-EWBUH2IU.js.map → chunk-IMNN5RBR.js.map} +0 -0
  142. /package/dist/{chunk-5XPXYOWB.js.map → chunk-IMSIYVBM.js.map} +0 -0
  143. /package/dist/{chunk-DPNCWHJW.js.map → chunk-ITIW4UUJ.js.map} +0 -0
  144. /package/dist/{chunk-ZSVCHDYT.js.map → chunk-LRP2LTLC.js.map} +0 -0
  145. /package/dist/{chunk-OYPKAYCH.js.map → chunk-M5L3SOS2.js.map} +0 -0
  146. /package/dist/{chunk-VHHKS7S4.js.map → chunk-NURZPCUE.js.map} +0 -0
  147. /package/dist/{chunk-5NTWGUSJ.js.map → chunk-PFNGZ27Y.js.map} +0 -0
  148. /package/dist/{chunk-4UMMAI3Z.js.map → chunk-QEJD3KFG.js.map} +0 -0
  149. /package/dist/{chunk-NY5ZY2WV.js.map → chunk-QJDYXEEB.js.map} +0 -0
  150. /package/dist/{chunk-FM6RZI52.js.map → chunk-RJWFVKBK.js.map} +0 -0
  151. /package/dist/{chunk-GVMV3TWS.js.map → chunk-RW3MTYHG.js.map} +0 -0
  152. /package/dist/{chunk-P5RTEJUB.js.map → chunk-SCEQJFQO.js.map} +0 -0
  153. /package/dist/{chunk-FEF432WU.js.map → chunk-TZHVLA3D.js.map} +0 -0
  154. /package/dist/{chunk-JJV7O7YK.js.map → chunk-VDXHZAMX.js.map} +0 -0
  155. /package/dist/{chunk-PA3KFAXH.js.map → chunk-Y4KVFLQZ.js.map} +0 -0
  156. /package/dist/{chunk-MBPYC6QF.js.map → chunk-ZFMG4GFE.js.map} +0 -0
  157. /package/dist/{client-7ZJZT5H7.js.map → client-LUZU6O45.js.map} +0 -0
  158. /package/dist/{config-NFDEJ3NB.js.map → config-54LNSYJF.js.map} +0 -0
  159. /package/dist/{config-mutate-JYW5G7T6.js.map → config-mutate-DPI3LUG5.js.map} +0 -0
  160. /package/dist/{config-mutator-OMWL5XHO.js.map → config-mutator-W5QTLGCY.js.map} +0 -0
  161. /package/dist/{contributions-ECGVSETO.js.map → contributions-FCKXPCOL.js.map} +0 -0
  162. /package/dist/{doctor-D6OVZAFB.js.map → doctor-ZGL3U4XJ.js.map} +0 -0
  163. /package/dist/{failure-candidates-NQX2JMMS.js.map → failure-candidates-HNENLQJC.js.map} +0 -0
  164. /package/dist/{follow-up-tool-FNO2IG72.js.map → follow-up-tool-ARGSSE7Q.js.map} +0 -0
  165. /package/dist/{hub-MOAG5BEQ.js.map → hub-NK7Q4F2X.js.map} +0 -0
  166. /package/dist/{processes-XM77XGOO.js.map → processes-GRS7BSIU.js.map} +0 -0
  167. /package/dist/{promote-AAEZYPBP.js.map → promote-BKHGOZB2.js.map} +0 -0
  168. /package/dist/{query-WWZEARB4.js.map → query-SPGPGSHG.js.map} +0 -0
  169. /package/dist/{query-settings-3FE555NP.js.map → query-settings-L6FOADK7.js.map} +0 -0
  170. /package/dist/{registry-JPZLE5XX.js.map → registry-2JIZ3LOU.js.map} +0 -0
  171. /package/dist/{request-planner-2AU3VK4P.js.map → request-planner-JCRREXJX.js.map} +0 -0
  172. /package/dist/{review-candidates-CIEGXF7K.js.map → review-candidates-OKHRZROS.js.map} +0 -0
  173. /package/dist/{routing-XJ25QONX.js.map → routing-B3B3ANA5.js.map} +0 -0
  174. /package/dist/{schedule-tool-5T4CH4CM.js.map → schedule-tool-GUEADWVH.js.map} +0 -0
  175. /package/dist/{scheduler-UKJWO2TR.js.map → scheduler-OKSJXZBX.js.map} +0 -0
  176. /package/dist/{seat-JWRCBUKR.js.map → seat-FQ53NWXV.js.map} +0 -0
  177. /package/dist/{select-KIDX6WWF.js.map → select-YE4C3DZS.js.map} +0 -0
  178. /package/dist/{set-enabled-F4D3VWKI.js.map → set-enabled-66ZBGZ2O.js.map} +0 -0
  179. /package/dist/{surface-usage-WSY4SHHL.js.map → surface-usage-JOOZOGOH.js.map} +0 -0
  180. /package/dist/{token-store-AY6OBDVI.js.map → token-store-F2PHHO5A.js.map} +0 -0
  181. /package/dist/{token-tracker-W7DFDEFN.js.map → token-tracker-B2UFOH46.js.map} +0 -0
  182. /package/dist/{tool-YSS2C2UX.js.map → tool-U2HRYX3V.js.map} +0 -0
  183. /package/dist/{traces-GVEQZX24.js.map → traces-G4HRLRA3.js.map} +0 -0
  184. /package/dist/{wiki-5Y4GSCYL.js.map → wiki-3HUDGN6J.js.map} +0 -0
  185. /package/dist/{wiki-enrich-TJIL4B3V.js.map → wiki-enrich-XQ3ZQBWZ.js.map} +0 -0
  186. /package/dist/{workflow-pilot-HCPSMGIC.js.map → workflow-pilot-25NMZYUO.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -1500,6 +1500,10 @@ declare const agentConfigSchema: z.ZodObject<{
1500
1500
  model: z.ZodOptional<z.ZodString>;
1501
1501
  systemPrompt: z.ZodOptional<z.ZodString>;
1502
1502
  mentions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1503
+ /** The team this agent was installed with (`agentx team add`, #1164).
1504
+ * `agentx team list` groups agents by it and `agentx team export <name>`
1505
+ * packs the agents that carry it. No effect on how the agent runs. */
1506
+ team: z.ZodOptional<z.ZodString>;
1503
1507
  /** Phase 5 — typed capabilities (drop-condition fallback). Free-form
1504
1508
  * list of intent strings this agent is allowed to handle. When set,
1505
1509
  * the org-chart `canHandle(agentId, project, intent)` check rejects
@@ -1713,6 +1717,19 @@ declare const agentConfigSchema: z.ZodObject<{
1713
1717
  * without a schema bump. Empty/unset means no enforcement
1714
1718
  * (default — backward compatible). */
1715
1719
  toolUseRequired: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1720
+ /** Monthly money budget for this agent (#1162). See monthlyBudgetSchema. */
1721
+ budget: z.ZodOptional<z.ZodObject<{
1722
+ /** USD per calendar month. 0 or unset = no cap. */
1723
+ monthlyUsd: z.ZodOptional<z.ZodNumber>;
1724
+ /** Share of the cap at which the owner is warned (default 0.8). */
1725
+ warnRatio: z.ZodDefault<z.ZodNumber>;
1726
+ }, "strip", z.ZodTypeAny, {
1727
+ warnRatio: number;
1728
+ monthlyUsd?: number | undefined;
1729
+ }, {
1730
+ monthlyUsd?: number | undefined;
1731
+ warnRatio?: number | undefined;
1732
+ }>>;
1716
1733
  /** Per-agent override for the channel-level `autoReplyLegacy` on
1717
1734
  * gitlab/github. When set, it wins over `channels.<name>.autoReplyLegacy`
1718
1735
  * for this agent's replies: `true` makes the daemon auto-post the agent's
@@ -2052,8 +2069,13 @@ declare const agentConfigSchema: z.ZodObject<{
2052
2069
  }> | undefined;
2053
2070
  admin?: boolean | undefined;
2054
2071
  systemPrompt?: string | undefined;
2072
+ team?: string | undefined;
2055
2073
  contextStrategy?: "layered" | "planner" | undefined;
2056
2074
  drainTimeoutSeconds?: number | undefined;
2075
+ budget?: {
2076
+ warnRatio: number;
2077
+ monthlyUsd?: number | undefined;
2078
+ } | undefined;
2057
2079
  gitlabAutoReply?: boolean | undefined;
2058
2080
  presence?: {
2059
2081
  initial?: string | undefined;
@@ -2116,6 +2138,7 @@ declare const agentConfigSchema: z.ZodObject<{
2116
2138
  tier?: "claude-code" | "codex-cli" | "opencode" | "sdk" | "orchestrator" | undefined;
2117
2139
  systemPrompt?: string | undefined;
2118
2140
  mentions?: string[] | undefined;
2141
+ team?: string | undefined;
2119
2142
  intents?: string[] | undefined;
2120
2143
  maxDelegationDepth?: number | undefined;
2121
2144
  codegraph?: boolean | undefined;
@@ -2134,6 +2157,10 @@ declare const agentConfigSchema: z.ZodObject<{
2134
2157
  launchTimeoutSeconds?: number | undefined;
2135
2158
  } | undefined;
2136
2159
  toolUseRequired?: string[] | undefined;
2160
+ budget?: {
2161
+ monthlyUsd?: number | undefined;
2162
+ warnRatio?: number | undefined;
2163
+ } | undefined;
2137
2164
  gitlabAutoReply?: boolean | undefined;
2138
2165
  persistentProcess?: boolean | undefined;
2139
2166
  queueMode?: "drop" | "followup" | "collect" | undefined;
@@ -2477,6 +2504,10 @@ declare const daemonConfigSchema: z.ZodObject<{
2477
2504
  model: z.ZodOptional<z.ZodString>;
2478
2505
  systemPrompt: z.ZodOptional<z.ZodString>;
2479
2506
  mentions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2507
+ /** The team this agent was installed with (`agentx team add`, #1164).
2508
+ * `agentx team list` groups agents by it and `agentx team export <name>`
2509
+ * packs the agents that carry it. No effect on how the agent runs. */
2510
+ team: z.ZodOptional<z.ZodString>;
2480
2511
  /** Phase 5 — typed capabilities (drop-condition fallback). Free-form
2481
2512
  * list of intent strings this agent is allowed to handle. When set,
2482
2513
  * the org-chart `canHandle(agentId, project, intent)` check rejects
@@ -2690,6 +2721,19 @@ declare const daemonConfigSchema: z.ZodObject<{
2690
2721
  * without a schema bump. Empty/unset means no enforcement
2691
2722
  * (default — backward compatible). */
2692
2723
  toolUseRequired: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2724
+ /** Monthly money budget for this agent (#1162). See monthlyBudgetSchema. */
2725
+ budget: z.ZodOptional<z.ZodObject<{
2726
+ /** USD per calendar month. 0 or unset = no cap. */
2727
+ monthlyUsd: z.ZodOptional<z.ZodNumber>;
2728
+ /** Share of the cap at which the owner is warned (default 0.8). */
2729
+ warnRatio: z.ZodDefault<z.ZodNumber>;
2730
+ }, "strip", z.ZodTypeAny, {
2731
+ warnRatio: number;
2732
+ monthlyUsd?: number | undefined;
2733
+ }, {
2734
+ monthlyUsd?: number | undefined;
2735
+ warnRatio?: number | undefined;
2736
+ }>>;
2693
2737
  /** Per-agent override for the channel-level `autoReplyLegacy` on
2694
2738
  * gitlab/github. When set, it wins over `channels.<name>.autoReplyLegacy`
2695
2739
  * for this agent's replies: `true` makes the daemon auto-post the agent's
@@ -3029,8 +3073,13 @@ declare const daemonConfigSchema: z.ZodObject<{
3029
3073
  }> | undefined;
3030
3074
  admin?: boolean | undefined;
3031
3075
  systemPrompt?: string | undefined;
3076
+ team?: string | undefined;
3032
3077
  contextStrategy?: "layered" | "planner" | undefined;
3033
3078
  drainTimeoutSeconds?: number | undefined;
3079
+ budget?: {
3080
+ warnRatio: number;
3081
+ monthlyUsd?: number | undefined;
3082
+ } | undefined;
3034
3083
  gitlabAutoReply?: boolean | undefined;
3035
3084
  presence?: {
3036
3085
  initial?: string | undefined;
@@ -3093,6 +3142,7 @@ declare const daemonConfigSchema: z.ZodObject<{
3093
3142
  tier?: "claude-code" | "codex-cli" | "opencode" | "sdk" | "orchestrator" | undefined;
3094
3143
  systemPrompt?: string | undefined;
3095
3144
  mentions?: string[] | undefined;
3145
+ team?: string | undefined;
3096
3146
  intents?: string[] | undefined;
3097
3147
  maxDelegationDepth?: number | undefined;
3098
3148
  codegraph?: boolean | undefined;
@@ -3111,6 +3161,10 @@ declare const daemonConfigSchema: z.ZodObject<{
3111
3161
  launchTimeoutSeconds?: number | undefined;
3112
3162
  } | undefined;
3113
3163
  toolUseRequired?: string[] | undefined;
3164
+ budget?: {
3165
+ monthlyUsd?: number | undefined;
3166
+ warnRatio?: number | undefined;
3167
+ } | undefined;
3114
3168
  gitlabAutoReply?: boolean | undefined;
3115
3169
  persistentProcess?: boolean | undefined;
3116
3170
  queueMode?: "drop" | "followup" | "collect" | undefined;
@@ -3146,6 +3200,20 @@ declare const daemonConfigSchema: z.ZodObject<{
3146
3200
  allowActions?: boolean | undefined;
3147
3201
  } | undefined;
3148
3202
  }>>>;
3203
+ /** Monthly money budget for the whole fleet (#1162). Reaching it pauses
3204
+ * every agent until the month ends or the cap is raised. */
3205
+ budget: z.ZodOptional<z.ZodObject<{
3206
+ /** USD per calendar month. 0 or unset = no cap. */
3207
+ monthlyUsd: z.ZodOptional<z.ZodNumber>;
3208
+ /** Share of the cap at which the owner is warned (default 0.8). */
3209
+ warnRatio: z.ZodDefault<z.ZodNumber>;
3210
+ }, "strip", z.ZodTypeAny, {
3211
+ warnRatio: number;
3212
+ monthlyUsd?: number | undefined;
3213
+ }, {
3214
+ monthlyUsd?: number | undefined;
3215
+ warnRatio?: number | undefined;
3216
+ }>>;
3149
3217
  /** Wiki-wide settings (#824). */
3150
3218
  wiki: z.ZodDefault<z.ZodObject<{
3151
3219
  /** The daily per-agent contribution and the merge that applies it.
@@ -9377,8 +9445,13 @@ declare const daemonConfigSchema: z.ZodObject<{
9377
9445
  }> | undefined;
9378
9446
  admin?: boolean | undefined;
9379
9447
  systemPrompt?: string | undefined;
9448
+ team?: string | undefined;
9380
9449
  contextStrategy?: "layered" | "planner" | undefined;
9381
9450
  drainTimeoutSeconds?: number | undefined;
9451
+ budget?: {
9452
+ warnRatio: number;
9453
+ monthlyUsd?: number | undefined;
9454
+ } | undefined;
9382
9455
  gitlabAutoReply?: boolean | undefined;
9383
9456
  presence?: {
9384
9457
  initial?: string | undefined;
@@ -10429,6 +10502,10 @@ declare const daemonConfigSchema: z.ZodObject<{
10429
10502
  dryRun: boolean;
10430
10503
  };
10431
10504
  } | undefined;
10505
+ budget?: {
10506
+ warnRatio: number;
10507
+ monthlyUsd?: number | undefined;
10508
+ } | undefined;
10432
10509
  }, {
10433
10510
  node: {
10434
10511
  id: string;
@@ -10494,6 +10571,7 @@ declare const daemonConfigSchema: z.ZodObject<{
10494
10571
  tier?: "claude-code" | "codex-cli" | "opencode" | "sdk" | "orchestrator" | undefined;
10495
10572
  systemPrompt?: string | undefined;
10496
10573
  mentions?: string[] | undefined;
10574
+ team?: string | undefined;
10497
10575
  intents?: string[] | undefined;
10498
10576
  maxDelegationDepth?: number | undefined;
10499
10577
  codegraph?: boolean | undefined;
@@ -10512,6 +10590,10 @@ declare const daemonConfigSchema: z.ZodObject<{
10512
10590
  launchTimeoutSeconds?: number | undefined;
10513
10591
  } | undefined;
10514
10592
  toolUseRequired?: string[] | undefined;
10593
+ budget?: {
10594
+ monthlyUsd?: number | undefined;
10595
+ warnRatio?: number | undefined;
10596
+ } | undefined;
10515
10597
  gitlabAutoReply?: boolean | undefined;
10516
10598
  persistentProcess?: boolean | undefined;
10517
10599
  queueMode?: "drop" | "followup" | "collect" | undefined;
@@ -11104,6 +11186,10 @@ declare const daemonConfigSchema: z.ZodObject<{
11104
11186
  defaultTitle?: string | undefined;
11105
11187
  } | undefined;
11106
11188
  } | undefined;
11189
+ budget?: {
11190
+ monthlyUsd?: number | undefined;
11191
+ warnRatio?: number | undefined;
11192
+ } | undefined;
11107
11193
  crons?: Record<string, {
11108
11194
  agent: string;
11109
11195
  schedule: string;
@@ -11890,6 +11976,15 @@ interface AgentXEvents {
11890
11976
  reason: string;
11891
11977
  at: string;
11892
11978
  };
11979
+ /** An agent's comment landed on a GitHub or GitLab issue, pull request
11980
+ * or merge request, with the id the forge gave it (#1184). */
11981
+ "forge:commented": {
11982
+ channel: string;
11983
+ chatId: string;
11984
+ commentId: string;
11985
+ agentId?: string;
11986
+ at: string;
11987
+ };
11893
11988
  /** A message waits behind a turn the agent is already running in the
11894
11989
  * same chat. It runs later as its own turn (request status, #383). */
11895
11990
  "task:queued": {
@@ -12063,6 +12158,10 @@ interface AgentXEvents {
12063
12158
  jevArm?: "treatment" | "holdout";
12064
12159
  /** Runtime-reported turn count, when the runtime reports one. */
12065
12160
  numTurns?: number;
12161
+ /** What the run cost in USD: the runtime's own figure when reported,
12162
+ * else its tokens at the billed model's rate. Feeds the monthly
12163
+ * budget (#1162) and task_traces.cost_usd. */
12164
+ costUsd?: number;
12066
12165
  /** Lessons injected into this turn's prompt (memory, procedures, wiki). */
12067
12166
  injectedContext?: {
12068
12167
  memory: string[];
@@ -12548,6 +12647,11 @@ declare class AgentXDaemon {
12548
12647
  /** Reach (#1138 step B): presence, seen/answered marks, the urgent
12549
12648
  * ladder and channel health, checked once a minute. */
12550
12649
  private attachReach;
12650
+ /** Monthly money budgets (#1162). The month's spend so far comes from the
12651
+ * traces, so a restart neither forgets it nor repeats a notice; each run's
12652
+ * cost is added as it completes, and a line it crosses tells the owner
12653
+ * once. The registry refuses runs past a cap (preflightBudgetGate). */
12654
+ private startBudgets;
12551
12655
  /** Tell the owner through the notify path: a push to the default
12552
12656
  * channel, the Mac banner where there is one (#788). */
12553
12657
  private notifyOwner;
@@ -12976,7 +13080,9 @@ interface FriendlyError {
12976
13080
  /** Optional next step the user can take. */
12977
13081
  fix?: string;
12978
13082
  /** Machine-readable error category for routing / retries. */
12979
- kind: "out_of_credits" | "overage_disabled" | "usage_cap" | "auth" | "permission" | "rate_limit" | "overloaded" | "context_too_large" | "invalid_request" | "upstream_api" | "timeout" | "cancelled" | "interrupted"
13083
+ kind: "out_of_credits" | "overage_disabled" | "usage_cap"
13084
+ /** An agent or the fleet reached its AgentX monthly budget (#1162). */
13085
+ | "budget_cap" | "auth" | "permission" | "rate_limit" | "overloaded" | "context_too_large" | "invalid_request" | "upstream_api" | "timeout" | "cancelled" | "interrupted"
12980
13086
  /** Ended by a stop signal; its resume plan is saved (#857). */
12981
13087
  | "stopped" | "unknown";
12982
13088
  /** Whether this error is transient — a retry has a reasonable chance of succeeding. */
@@ -16666,6 +16772,9 @@ declare class AgentRegistry {
16666
16772
  * free and run at once.
16667
16773
  */
16668
16774
  private voiceClaims;
16775
+ /** Chat messages waiting for an agent paused by its monthly budget (#1162). */
16776
+ private budgetHolds;
16777
+ private budgetReleaseTimer;
16669
16778
  /** Intent Knowledge Graph classifier. Null when graph.enabled=false. */
16670
16779
  private classifier?;
16671
16780
  private graphStore?;
@@ -16928,6 +17037,17 @@ declare class AgentRegistry {
16928
17037
  */
16929
17038
  getTaskRecord(agentId: string, taskId: string): TaskRecord | null;
16930
17039
  private safe;
17040
+ /** Check every minute whether held work may run: the month may have
17041
+ * turned. A raised cap releases it at once (releaseBudgetHolds). */
17042
+ private armBudgetRelease;
17043
+ /**
17044
+ * Run the messages held for agents whose budget gate passes again, each
17045
+ * as a queued turn with its reply posted to its chat. Called on a timer
17046
+ * and when the budgets change. Returns how many were released.
17047
+ */
17048
+ releaseBudgetHolds(): number;
17049
+ /** Messages waiting for `agentId` to come back under its budget. */
17050
+ heldForBudget(agentId: string): number;
16931
17051
  /**
16932
17052
  * Post a queued message's response back to its originating channel.
16933
17053
  * Used by the flush block in `execute()` — channel messages that arrive
@@ -18331,6 +18451,9 @@ declare class MessageRouter {
18331
18451
  private sendDedupeKey;
18332
18452
  private sendDedupeGet;
18333
18453
  private sendDedupeStore;
18454
+ /** An agent's comment on GitHub or GitLab keeps the id the forge gave
18455
+ * it, so the Wall can link to that exact comment (#1184). */
18456
+ private noteForgeComment;
18334
18457
  private adapterSend;
18335
18458
  /** Whether an agent may emit rich `agentx:ui` messages on this channel.
18336
18459
  * Gated by per-agent `richMessages` (default true) and restricted to the
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{Ga as Tt,Ha 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-MKLRCNOX.js";import"./chunk-SRUIUZOC.js";import"./chunk-GTJIKXDB.js";import"./chunk-2NLPGLLL.js";import"./chunk-QH3RKKD3.js";import"./chunk-JYSJDHNS.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-KPNAXVET.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-EMGB23H5.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-E4O32ZYZ.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-LSDUL7EW.js";import"./chunk-PVWHEPF3.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-FM6RZI52.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-5TTHN7DP.js";import{s as ut}from"./chunk-OYPKAYCH.js";import"./chunk-EWBUH2IU.js";import"./chunk-3UOTLMXD.js";import"./chunk-36AXN6ZB.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-BY2AAMOO.js";import{a as ht}from"./chunk-3ZMVYNFH.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-DNPL3YOH.js";import"./chunk-6QZKQUAT.js";import{f as gt,g as ft}from"./chunk-B3I4EBLE.js";import"./chunk-WPNRDEHW.js";import"./chunk-MWNCS57L.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-4UMMAI3Z.js";import{j as it,k as rt,l as at}from"./chunk-FEF432WU.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-MYVHVJWZ.js";import"./chunk-6TURWSMN.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{db as tt,fb as st,hb as ot,ob as nt}from"./chunk-O5H6BCUN.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.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-N3VQ5NSV.js";import"./chunk-3MSNOHKU.js";import"./chunk-GTJIKXDB.js";import"./chunk-ORAZ3WHL.js";import"./chunk-NHD6DUBL.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-CI5OJ2JN.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-CXBTGXFO.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-6LVCXEQE.js";import"./chunk-M4AQRADJ.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-RJWFVKBK.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-M5L3SOS2.js";import"./chunk-IMNN5RBR.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-4QVGHA4B.js";import{a as ht}from"./chunk-DEXEPOHH.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-HYNP5WYF.js";import"./chunk-6QZKQUAT.js";import{f as gt,g as ft}from"./chunk-H2KVHGAP.js";import"./chunk-WPNRDEHW.js";import"./chunk-MWNCS57L.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-QEJD3KFG.js";import{j as it,k as rt,l as at}from"./chunk-TZHVLA3D.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-MYVHVJWZ.js";import"./chunk-6TURWSMN.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{eb as tt,gb as st,ib as ot,pb as nt}from"./chunk-TFN6A3KI.js";import"./chunk-BRK6M6LA.js";import"./chunk-XHAPSFAB.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).