agentix-cli 0.126.2 → 0.128.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 (152) hide show
  1. package/dist/{App-BUYK4EGC.js → App-BOLQUKCN.js} +2 -2
  2. package/dist/{ChatApp-ZS6EPDDK.js → ChatApp-72HXQV24.js} +2 -2
  3. package/dist/absorb-eval-O3HA6XA5.js +2 -0
  4. package/dist/{agent-WJTYM5HR.js → agent-S2DXXALS.js} +2 -2
  5. package/dist/{board-dashboard-DQR2OSV7.js → board-dashboard-ZKXXK5CG.js} +303 -228
  6. package/dist/board-dashboard-ZKXXK5CG.js.map +1 -0
  7. package/dist/chunk-2SV4RKRW.js +128 -0
  8. package/dist/chunk-2SV4RKRW.js.map +1 -0
  9. package/dist/{chunk-WUDVBPQV.js → chunk-4V7SWL2S.js} +2 -2
  10. package/dist/chunk-52SIHG45.js +4 -0
  11. package/dist/chunk-52SIHG45.js.map +1 -0
  12. package/dist/chunk-5DAEJF5S.js +36 -0
  13. package/dist/chunk-5DAEJF5S.js.map +1 -0
  14. package/dist/{chunk-GUQDPA6R.js → chunk-6GGGXCOY.js} +2 -2
  15. package/dist/{chunk-JIXNSA67.js → chunk-6KIUVVKX.js} +2 -2
  16. package/dist/{chunk-O4XEQTEN.js → chunk-C5MTLW7O.js} +3 -3
  17. package/dist/chunk-C5MTLW7O.js.map +1 -0
  18. package/dist/{chunk-FHBPKMCF.js → chunk-D2WX3BET.js} +2 -2
  19. package/dist/chunk-DN3RLR5Z.js +17 -0
  20. package/dist/chunk-DN3RLR5Z.js.map +1 -0
  21. package/dist/{chunk-Z7XXUYBB.js → chunk-DQ2LNQ2D.js} +33 -35
  22. package/dist/chunk-DQ2LNQ2D.js.map +1 -0
  23. package/dist/{chunk-UUVFH7BO.js → chunk-EJT4MA3J.js} +102 -102
  24. package/dist/chunk-EJT4MA3J.js.map +1 -0
  25. package/dist/chunk-FSW4FUMW.js +55 -0
  26. package/dist/chunk-FSW4FUMW.js.map +1 -0
  27. package/dist/chunk-FXBMFGOV.js +6 -0
  28. package/dist/chunk-FXBMFGOV.js.map +1 -0
  29. package/dist/{chunk-WMTGAVPW.js → chunk-HKW56YZK.js} +2 -2
  30. package/dist/{chunk-VXKNB4AW.js → chunk-LDS4SZBU.js} +2 -2
  31. package/dist/chunk-MRYA4J5F.js +54 -0
  32. package/dist/chunk-MRYA4J5F.js.map +1 -0
  33. package/dist/{chunk-LVV7JBHM.js → chunk-O2BS6N3T.js} +2 -2
  34. package/dist/{chunk-ZQWWMAMJ.js → chunk-P4XGM7ZM.js} +2 -2
  35. package/dist/{chunk-D6SWAB5J.js → chunk-QACEFESP.js} +32 -32
  36. package/dist/chunk-QACEFESP.js.map +1 -0
  37. package/dist/{chunk-6GLJIA25.js → chunk-QFZU5CEO.js} +2 -2
  38. package/dist/{chunk-FVG2BADS.js → chunk-QQFURUMS.js} +2 -2
  39. package/dist/chunk-QUXMLLX5.js +2 -0
  40. package/dist/chunk-QUXMLLX5.js.map +1 -0
  41. package/dist/{chunk-CY6ABHF2.js → chunk-TG6CT54D.js} +2 -2
  42. package/dist/chunk-TPNTFCSQ.js +4 -0
  43. package/dist/chunk-TPNTFCSQ.js.map +1 -0
  44. package/dist/{chunk-56KNKUFF.js → chunk-VD7IO653.js} +3 -3
  45. package/dist/{chunk-56KNKUFF.js.map → chunk-VD7IO653.js.map} +1 -1
  46. package/dist/{chunk-JUIL2EW3.js → chunk-YWKLUQDC.js} +2 -2
  47. package/dist/chunk-Z3W7D5RR.js +4 -0
  48. package/dist/chunk-Z3W7D5RR.js.map +1 -0
  49. package/dist/{chunk-QQYXYJOG.js → chunk-ZLC4TSXF.js} +2 -2
  50. package/dist/cli.js +1 -1
  51. package/dist/{client-PO5LDFS4.js → client-VBV7Q43P.js} +2 -2
  52. package/dist/config-52C3DJD2.js +2 -0
  53. package/dist/config-mutate-DKQESY6F.js +2 -0
  54. package/dist/config-mutator-BF4D4QGN.js +2 -0
  55. package/dist/contributions-5OEZWYXI.js +57 -0
  56. package/dist/contributions-5OEZWYXI.js.map +1 -0
  57. package/dist/doctor-VLRC4HW2.js +2 -0
  58. package/dist/{follow-up-tool-AIOLNUF7.js → follow-up-tool-235LDEMP.js} +2 -2
  59. package/dist/{follow-up-tool-AIOLNUF7.js.map → follow-up-tool-235LDEMP.js.map} +1 -1
  60. package/dist/hub-5QK7KYTZ.js +2 -0
  61. package/dist/index.d.ts +339 -50
  62. package/dist/index.js +1 -1
  63. package/dist/index.js.map +1 -1
  64. package/dist/notes-YLTNRMB5.js +2 -0
  65. package/dist/notes-settings-X63D5HPM.js +2 -0
  66. package/dist/{program-LGCT7FFJ.js → program-MVD57PKP.js} +236 -232
  67. package/dist/program-MVD57PKP.js.map +1 -0
  68. package/dist/{promote-MQYJMGGZ.js → promote-UPPQ4BQE.js} +2 -2
  69. package/dist/query-XQS5JN6E.js +2 -0
  70. package/dist/registry-MOMTLJ6R.js +2 -0
  71. package/dist/{request-planner-XYHM26CO.js → request-planner-QGZJEAKY.js} +2 -2
  72. package/dist/{review-candidates-XRBAMRBH.js → review-candidates-PAKF2JQF.js} +2 -2
  73. package/dist/{rotation-memo-6UW6DTBQ.js → rotation-memo-7VLREGS6.js} +2 -2
  74. package/dist/routing-JG3EV4O4.js +2 -0
  75. package/dist/schedule-tool-O7ZZ2A7X.js +2 -0
  76. package/dist/scheduler-LMPBAA34.js +2 -0
  77. package/dist/scheduler-LMPBAA34.js.map +1 -0
  78. package/dist/score-KDNIUTNV.js +3 -0
  79. package/dist/score-KDNIUTNV.js.map +1 -0
  80. package/dist/{seat-LKBZ6SDS.js → seat-JN3IVZ3G.js} +2 -2
  81. package/dist/seat-JN3IVZ3G.js.map +1 -0
  82. package/dist/{select-BSC3TFMZ.js → select-ZMMRFMNO.js} +2 -2
  83. package/dist/{set-enabled-YWXWSKME.js → set-enabled-7Y3TW6Z4.js} +2 -2
  84. package/dist/{tool-FZEC5FQX.js → tool-OCYXCDOK.js} +2 -2
  85. package/dist/{tool-FZEC5FQX.js.map → tool-OCYXCDOK.js.map} +1 -1
  86. package/dist/{tool-5JTCSRTW.js → tool-S7QI6HRA.js} +2 -2
  87. package/dist/{tool-5JTCSRTW.js.map → tool-S7QI6HRA.js.map} +1 -1
  88. package/dist/wiki-OCLFFZG6.js +2 -0
  89. package/dist/wiki-OCLFFZG6.js.map +1 -0
  90. package/package.json +1 -1
  91. package/dist/absorb-eval-5Y5IZWW2.js +0 -2
  92. package/dist/board-dashboard-DQR2OSV7.js.map +0 -1
  93. package/dist/chunk-2C3X6DVD.js +0 -49
  94. package/dist/chunk-2C3X6DVD.js.map +0 -1
  95. package/dist/chunk-2W3X6H7Z.js +0 -51
  96. package/dist/chunk-2W3X6H7Z.js.map +0 -1
  97. package/dist/chunk-46JKX6CT.js +0 -54
  98. package/dist/chunk-46JKX6CT.js.map +0 -1
  99. package/dist/chunk-5DFUUYEA.js +0 -126
  100. package/dist/chunk-5DFUUYEA.js.map +0 -1
  101. package/dist/chunk-D6SWAB5J.js.map +0 -1
  102. package/dist/chunk-O4XEQTEN.js.map +0 -1
  103. package/dist/chunk-UUVFH7BO.js.map +0 -1
  104. package/dist/chunk-YNA5T43U.js +0 -4
  105. package/dist/chunk-YNA5T43U.js.map +0 -1
  106. package/dist/chunk-Z7XXUYBB.js.map +0 -1
  107. package/dist/config-L2RQ6EJX.js +0 -2
  108. package/dist/config-mutator-44OAOZXM.js +0 -2
  109. package/dist/doctor-AU5TCOSG.js +0 -2
  110. package/dist/hub-53YQQCVA.js +0 -2
  111. package/dist/program-LGCT7FFJ.js.map +0 -1
  112. package/dist/query-DNJONEKC.js +0 -2
  113. package/dist/registry-5A3SLBVJ.js +0 -2
  114. package/dist/routing-OMIWZKNC.js +0 -2
  115. package/dist/schedule-tool-YRANRFHO.js +0 -2
  116. package/dist/scheduler-L4P4Z55R.js +0 -2
  117. package/dist/wiki-BT3H2WCD.js +0 -2
  118. /package/dist/{App-BUYK4EGC.js.map → App-BOLQUKCN.js.map} +0 -0
  119. /package/dist/{ChatApp-ZS6EPDDK.js.map → ChatApp-72HXQV24.js.map} +0 -0
  120. /package/dist/{absorb-eval-5Y5IZWW2.js.map → absorb-eval-O3HA6XA5.js.map} +0 -0
  121. /package/dist/{agent-WJTYM5HR.js.map → agent-S2DXXALS.js.map} +0 -0
  122. /package/dist/{chunk-WUDVBPQV.js.map → chunk-4V7SWL2S.js.map} +0 -0
  123. /package/dist/{chunk-GUQDPA6R.js.map → chunk-6GGGXCOY.js.map} +0 -0
  124. /package/dist/{chunk-JIXNSA67.js.map → chunk-6KIUVVKX.js.map} +0 -0
  125. /package/dist/{chunk-FHBPKMCF.js.map → chunk-D2WX3BET.js.map} +0 -0
  126. /package/dist/{chunk-WMTGAVPW.js.map → chunk-HKW56YZK.js.map} +0 -0
  127. /package/dist/{chunk-VXKNB4AW.js.map → chunk-LDS4SZBU.js.map} +0 -0
  128. /package/dist/{chunk-LVV7JBHM.js.map → chunk-O2BS6N3T.js.map} +0 -0
  129. /package/dist/{chunk-ZQWWMAMJ.js.map → chunk-P4XGM7ZM.js.map} +0 -0
  130. /package/dist/{chunk-6GLJIA25.js.map → chunk-QFZU5CEO.js.map} +0 -0
  131. /package/dist/{chunk-FVG2BADS.js.map → chunk-QQFURUMS.js.map} +0 -0
  132. /package/dist/{chunk-CY6ABHF2.js.map → chunk-TG6CT54D.js.map} +0 -0
  133. /package/dist/{chunk-JUIL2EW3.js.map → chunk-YWKLUQDC.js.map} +0 -0
  134. /package/dist/{chunk-QQYXYJOG.js.map → chunk-ZLC4TSXF.js.map} +0 -0
  135. /package/dist/{client-PO5LDFS4.js.map → client-VBV7Q43P.js.map} +0 -0
  136. /package/dist/{config-L2RQ6EJX.js.map → config-52C3DJD2.js.map} +0 -0
  137. /package/dist/{config-mutator-44OAOZXM.js.map → config-mutate-DKQESY6F.js.map} +0 -0
  138. /package/dist/{doctor-AU5TCOSG.js.map → config-mutator-BF4D4QGN.js.map} +0 -0
  139. /package/dist/{hub-53YQQCVA.js.map → doctor-VLRC4HW2.js.map} +0 -0
  140. /package/dist/{promote-MQYJMGGZ.js.map → hub-5QK7KYTZ.js.map} +0 -0
  141. /package/dist/{query-DNJONEKC.js.map → notes-YLTNRMB5.js.map} +0 -0
  142. /package/dist/{registry-5A3SLBVJ.js.map → notes-settings-X63D5HPM.js.map} +0 -0
  143. /package/dist/{routing-OMIWZKNC.js.map → promote-UPPQ4BQE.js.map} +0 -0
  144. /package/dist/{schedule-tool-YRANRFHO.js.map → query-XQS5JN6E.js.map} +0 -0
  145. /package/dist/{scheduler-L4P4Z55R.js.map → registry-MOMTLJ6R.js.map} +0 -0
  146. /package/dist/{request-planner-XYHM26CO.js.map → request-planner-QGZJEAKY.js.map} +0 -0
  147. /package/dist/{review-candidates-XRBAMRBH.js.map → review-candidates-PAKF2JQF.js.map} +0 -0
  148. /package/dist/{rotation-memo-6UW6DTBQ.js.map → rotation-memo-7VLREGS6.js.map} +0 -0
  149. /package/dist/{seat-LKBZ6SDS.js.map → routing-JG3EV4O4.js.map} +0 -0
  150. /package/dist/{wiki-BT3H2WCD.js.map → schedule-tool-O7ZZ2A7X.js.map} +0 -0
  151. /package/dist/{select-BSC3TFMZ.js.map → select-ZMMRFMNO.js.map} +0 -0
  152. /package/dist/{set-enabled-YWXWSKME.js.map → set-enabled-7Y3TW6Z4.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -1585,6 +1585,43 @@ declare const agentConfigSchema: z.ZodObject<{
1585
1585
  * them off, when that is longer than shutdown.drainTimeoutSeconds. For
1586
1586
  * agents whose runs are long (renders, builds). */
1587
1587
  drainTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
1588
+ /** Wiki settings for this agent. `contribute` turns on its daily wiki
1589
+ * contribution (#824): `agentx wiki contribute --all` reviews the
1590
+ * agent's work since its last run and queues sourced patches for the
1591
+ * daily merge. Off by default. `maxPatches` and `maxCostUsd` cap one
1592
+ * run; `model` overrides the wiki-wide model. */
1593
+ wiki: z.ZodOptional<z.ZodObject<{
1594
+ contribute: z.ZodDefault<z.ZodObject<{
1595
+ enabled: z.ZodDefault<z.ZodBoolean>;
1596
+ maxPatches: z.ZodDefault<z.ZodNumber>;
1597
+ maxCostUsd: z.ZodOptional<z.ZodNumber>;
1598
+ model: z.ZodOptional<z.ZodString>;
1599
+ }, "strip", z.ZodTypeAny, {
1600
+ enabled: boolean;
1601
+ maxPatches: number;
1602
+ model?: string | undefined;
1603
+ maxCostUsd?: number | undefined;
1604
+ }, {
1605
+ model?: string | undefined;
1606
+ enabled?: boolean | undefined;
1607
+ maxPatches?: number | undefined;
1608
+ maxCostUsd?: number | undefined;
1609
+ }>>;
1610
+ }, "strip", z.ZodTypeAny, {
1611
+ contribute: {
1612
+ enabled: boolean;
1613
+ maxPatches: number;
1614
+ model?: string | undefined;
1615
+ maxCostUsd?: number | undefined;
1616
+ };
1617
+ }, {
1618
+ contribute?: {
1619
+ model?: string | undefined;
1620
+ enabled?: boolean | undefined;
1621
+ maxPatches?: number | undefined;
1622
+ maxCostUsd?: number | undefined;
1623
+ } | undefined;
1624
+ }>>;
1588
1625
  permissionMode: z.ZodDefault<z.ZodString>;
1589
1626
  /** How this agent's `claude` CLI is billed (claude-code tier). Default
1590
1627
  * "subscription": the shared OAuth login, ANTHROPIC_API_KEY stripped.
@@ -1936,6 +1973,14 @@ declare const agentConfigSchema: z.ZodObject<{
1936
1973
  }[];
1937
1974
  provider?: string | undefined;
1938
1975
  model?: string | undefined;
1976
+ wiki?: {
1977
+ contribute: {
1978
+ enabled: boolean;
1979
+ maxPatches: number;
1980
+ model?: string | undefined;
1981
+ maxCostUsd?: number | undefined;
1982
+ };
1983
+ } | undefined;
1939
1984
  voice?: {
1940
1985
  system?: string | Record<string, string> | undefined;
1941
1986
  provider?: "system" | "elevenlabs" | undefined;
@@ -1976,6 +2021,14 @@ declare const agentConfigSchema: z.ZodObject<{
1976
2021
  workspace: string;
1977
2022
  provider?: string | undefined;
1978
2023
  model?: string | undefined;
2024
+ wiki?: {
2025
+ contribute?: {
2026
+ model?: string | undefined;
2027
+ enabled?: boolean | undefined;
2028
+ maxPatches?: number | undefined;
2029
+ maxCostUsd?: number | undefined;
2030
+ } | undefined;
2031
+ } | undefined;
1979
2032
  voice?: {
1980
2033
  system?: string | Record<string, string> | undefined;
1981
2034
  provider?: "system" | "elevenlabs" | undefined;
@@ -2446,6 +2499,43 @@ declare const daemonConfigSchema: z.ZodObject<{
2446
2499
  * them off, when that is longer than shutdown.drainTimeoutSeconds. For
2447
2500
  * agents whose runs are long (renders, builds). */
2448
2501
  drainTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
2502
+ /** Wiki settings for this agent. `contribute` turns on its daily wiki
2503
+ * contribution (#824): `agentx wiki contribute --all` reviews the
2504
+ * agent's work since its last run and queues sourced patches for the
2505
+ * daily merge. Off by default. `maxPatches` and `maxCostUsd` cap one
2506
+ * run; `model` overrides the wiki-wide model. */
2507
+ wiki: z.ZodOptional<z.ZodObject<{
2508
+ contribute: z.ZodDefault<z.ZodObject<{
2509
+ enabled: z.ZodDefault<z.ZodBoolean>;
2510
+ maxPatches: z.ZodDefault<z.ZodNumber>;
2511
+ maxCostUsd: z.ZodOptional<z.ZodNumber>;
2512
+ model: z.ZodOptional<z.ZodString>;
2513
+ }, "strip", z.ZodTypeAny, {
2514
+ enabled: boolean;
2515
+ maxPatches: number;
2516
+ model?: string | undefined;
2517
+ maxCostUsd?: number | undefined;
2518
+ }, {
2519
+ model?: string | undefined;
2520
+ enabled?: boolean | undefined;
2521
+ maxPatches?: number | undefined;
2522
+ maxCostUsd?: number | undefined;
2523
+ }>>;
2524
+ }, "strip", z.ZodTypeAny, {
2525
+ contribute: {
2526
+ enabled: boolean;
2527
+ maxPatches: number;
2528
+ model?: string | undefined;
2529
+ maxCostUsd?: number | undefined;
2530
+ };
2531
+ }, {
2532
+ contribute?: {
2533
+ model?: string | undefined;
2534
+ enabled?: boolean | undefined;
2535
+ maxPatches?: number | undefined;
2536
+ maxCostUsd?: number | undefined;
2537
+ } | undefined;
2538
+ }>>;
2449
2539
  permissionMode: z.ZodDefault<z.ZodString>;
2450
2540
  /** How this agent's `claude` CLI is billed (claude-code tier). Default
2451
2541
  * "subscription": the shared OAuth login, ANTHROPIC_API_KEY stripped.
@@ -2797,6 +2887,14 @@ declare const daemonConfigSchema: z.ZodObject<{
2797
2887
  }[];
2798
2888
  provider?: string | undefined;
2799
2889
  model?: string | undefined;
2890
+ wiki?: {
2891
+ contribute: {
2892
+ enabled: boolean;
2893
+ maxPatches: number;
2894
+ model?: string | undefined;
2895
+ maxCostUsd?: number | undefined;
2896
+ };
2897
+ } | undefined;
2800
2898
  voice?: {
2801
2899
  system?: string | Record<string, string> | undefined;
2802
2900
  provider?: "system" | "elevenlabs" | undefined;
@@ -2837,6 +2935,14 @@ declare const daemonConfigSchema: z.ZodObject<{
2837
2935
  workspace: string;
2838
2936
  provider?: string | undefined;
2839
2937
  model?: string | undefined;
2938
+ wiki?: {
2939
+ contribute?: {
2940
+ model?: string | undefined;
2941
+ enabled?: boolean | undefined;
2942
+ maxPatches?: number | undefined;
2943
+ maxCostUsd?: number | undefined;
2944
+ } | undefined;
2945
+ } | undefined;
2840
2946
  voice?: {
2841
2947
  system?: string | Record<string, string> | undefined;
2842
2948
  provider?: "system" | "elevenlabs" | undefined;
@@ -2925,6 +3031,66 @@ declare const daemonConfigSchema: z.ZodObject<{
2925
3031
  allowActions?: boolean | undefined;
2926
3032
  } | undefined;
2927
3033
  }>>>;
3034
+ /** Wiki-wide settings (#824). */
3035
+ wiki: z.ZodDefault<z.ZodObject<{
3036
+ /** The daily per-agent contribution and the merge that applies it.
3037
+ * Both jobs are added to the schedule when at least one agent has
3038
+ * `wiki.contribute.enabled`; a cron with the same id overrides them. */
3039
+ contributions: z.ZodDefault<z.ZodObject<{
3040
+ /** When each enabled agent reviews its day (cron, 5 fields). */
3041
+ schedule: z.ZodDefault<z.ZodString>;
3042
+ /** When the queued patches are applied. */
3043
+ mergeSchedule: z.ZodDefault<z.ZodString>;
3044
+ timezone: z.ZodDefault<z.ZodString>;
3045
+ /** Default per-agent, per-run model spend cap in USD. */
3046
+ maxCostUsd: z.ZodDefault<z.ZodNumber>;
3047
+ /** Default model for the contribution call. */
3048
+ model: z.ZodDefault<z.ZodString>;
3049
+ }, "strip", z.ZodTypeAny, {
3050
+ model: string;
3051
+ schedule: string;
3052
+ timezone: string;
3053
+ maxCostUsd: number;
3054
+ mergeSchedule: string;
3055
+ }, {
3056
+ model?: string | undefined;
3057
+ schedule?: string | undefined;
3058
+ timezone?: string | undefined;
3059
+ maxCostUsd?: number | undefined;
3060
+ mergeSchedule?: string | undefined;
3061
+ }>>;
3062
+ query: z.ZodDefault<z.ZodObject<{
3063
+ /** `wiki query` also searches other agents' readable pages and the
3064
+ * root wiki's own pages. */
3065
+ shared: z.ZodDefault<z.ZodBoolean>;
3066
+ }, "strip", z.ZodTypeAny, {
3067
+ shared: boolean;
3068
+ }, {
3069
+ shared?: boolean | undefined;
3070
+ }>>;
3071
+ }, "strip", z.ZodTypeAny, {
3072
+ query: {
3073
+ shared: boolean;
3074
+ };
3075
+ contributions: {
3076
+ model: string;
3077
+ schedule: string;
3078
+ timezone: string;
3079
+ maxCostUsd: number;
3080
+ mergeSchedule: string;
3081
+ };
3082
+ }, {
3083
+ query?: {
3084
+ shared?: boolean | undefined;
3085
+ } | undefined;
3086
+ contributions?: {
3087
+ model?: string | undefined;
3088
+ schedule?: string | undefined;
3089
+ timezone?: string | undefined;
3090
+ maxCostUsd?: number | undefined;
3091
+ mergeSchedule?: string | undefined;
3092
+ } | undefined;
3093
+ }>>;
2928
3094
  channels: z.ZodDefault<z.ZodObject<{
2929
3095
  telegram: z.ZodDefault<z.ZodObject<{
2930
3096
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -4234,6 +4400,46 @@ declare const daemonConfigSchema: z.ZodObject<{
4234
4400
  fireToken?: string | undefined;
4235
4401
  createdBy?: string | undefined;
4236
4402
  }>>>;
4403
+ /** Notes agents leave for the wiki observe/sweep run (#825). */
4404
+ wikiNotes: z.ZodDefault<z.ZodEffects<z.ZodObject<{
4405
+ enabled: z.ZodDefault<z.ZodBoolean>;
4406
+ /** Agent that runs the wiki observe/sweep schedule. Notes are addressed
4407
+ * to it and kept on its node. */
4408
+ inbox: z.ZodOptional<z.ZodString>;
4409
+ /** Schedule ids (keys of `crons`) that read the inbox when they start.
4410
+ * Each must run as the inbox agent. Empty: notes are kept but no run
4411
+ * reads them. */
4412
+ crons: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
4413
+ /** Most notes one run is given. The rest wait for the next run. */
4414
+ maxNotesPerRun: z.ZodDefault<z.ZodNumber>;
4415
+ /** A note deferred this many times stops being offered (status
4416
+ * `expired`), so notes nobody can check do not crowd out new ones. */
4417
+ maxDeferrals: z.ZodDefault<z.ZodNumber>;
4418
+ }, "strip", z.ZodTypeAny, {
4419
+ enabled: boolean;
4420
+ crons: string[];
4421
+ maxNotesPerRun: number;
4422
+ maxDeferrals: number;
4423
+ inbox?: string | undefined;
4424
+ }, {
4425
+ enabled?: boolean | undefined;
4426
+ inbox?: string | undefined;
4427
+ crons?: string[] | undefined;
4428
+ maxNotesPerRun?: number | undefined;
4429
+ maxDeferrals?: number | undefined;
4430
+ }>, {
4431
+ enabled: boolean;
4432
+ crons: string[];
4433
+ maxNotesPerRun: number;
4434
+ maxDeferrals: number;
4435
+ inbox?: string | undefined;
4436
+ }, {
4437
+ enabled?: boolean | undefined;
4438
+ inbox?: string | undefined;
4439
+ crons?: string[] | undefined;
4440
+ maxNotesPerRun?: number | undefined;
4441
+ maxDeferrals?: number | undefined;
4442
+ }>>;
4237
4443
  services: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
4238
4444
  name: z.ZodString;
4239
4445
  triggers: z.ZodArray<z.ZodObject<{
@@ -7282,6 +7488,14 @@ declare const daemonConfigSchema: z.ZodObject<{
7282
7488
  }[];
7283
7489
  provider?: string | undefined;
7284
7490
  model?: string | undefined;
7491
+ wiki?: {
7492
+ contribute: {
7493
+ enabled: boolean;
7494
+ maxPatches: number;
7495
+ model?: string | undefined;
7496
+ maxCostUsd?: number | undefined;
7497
+ };
7498
+ } | undefined;
7285
7499
  voice?: {
7286
7500
  system?: string | Record<string, string> | undefined;
7287
7501
  provider?: "system" | "elevenlabs" | undefined;
@@ -7355,6 +7569,18 @@ declare const daemonConfigSchema: z.ZodObject<{
7355
7569
  skipTypes: string[];
7356
7570
  };
7357
7571
  };
7572
+ wiki: {
7573
+ query: {
7574
+ shared: boolean;
7575
+ };
7576
+ contributions: {
7577
+ model: string;
7578
+ schedule: string;
7579
+ timezone: string;
7580
+ maxCostUsd: number;
7581
+ mergeSchedule: string;
7582
+ };
7583
+ };
7358
7584
  app: {
7359
7585
  android: {
7360
7586
  packageName: string;
@@ -7600,6 +7826,32 @@ declare const daemonConfigSchema: z.ZodObject<{
7600
7826
  bind: string;
7601
7827
  defaultAgent?: string | undefined;
7602
7828
  };
7829
+ crons: Record<string, {
7830
+ enabled: boolean;
7831
+ agent: string;
7832
+ prompt: string;
7833
+ timeout: number;
7834
+ schedule: string;
7835
+ timezone: string;
7836
+ onError: ("notify" | "disable" | "log")[];
7837
+ model?: string | undefined;
7838
+ command?: string | undefined;
7839
+ notify?: {
7840
+ channel: string;
7841
+ chatId: string;
7842
+ accountId?: string | undefined;
7843
+ } | undefined;
7844
+ approval?: {
7845
+ action: "delete" | "create";
7846
+ requestedBy: string;
7847
+ requestedAt: string;
7848
+ } | undefined;
7849
+ maxOutputTokens?: number | undefined;
7850
+ autonomy?: "report" | "propose" | "act" | undefined;
7851
+ deliverResult?: boolean | undefined;
7852
+ fireToken?: string | undefined;
7853
+ createdBy?: string | undefined;
7854
+ }>;
7603
7855
  graph: {
7604
7856
  enabled: boolean;
7605
7857
  baseDir: string;
@@ -7639,32 +7891,13 @@ declare const daemonConfigSchema: z.ZodObject<{
7639
7891
  defaultModel?: string | undefined;
7640
7892
  baseUrl?: string | undefined;
7641
7893
  }>;
7642
- crons: Record<string, {
7894
+ wikiNotes: {
7643
7895
  enabled: boolean;
7644
- agent: string;
7645
- prompt: string;
7646
- timeout: number;
7647
- schedule: string;
7648
- timezone: string;
7649
- onError: ("notify" | "disable" | "log")[];
7650
- model?: string | undefined;
7651
- command?: string | undefined;
7652
- notify?: {
7653
- channel: string;
7654
- chatId: string;
7655
- accountId?: string | undefined;
7656
- } | undefined;
7657
- approval?: {
7658
- action: "delete" | "create";
7659
- requestedBy: string;
7660
- requestedAt: string;
7661
- } | undefined;
7662
- maxOutputTokens?: number | undefined;
7663
- autonomy?: "report" | "propose" | "act" | undefined;
7664
- deliverResult?: boolean | undefined;
7665
- fireToken?: string | undefined;
7666
- createdBy?: string | undefined;
7667
- }>;
7896
+ crons: string[];
7897
+ maxNotesPerRun: number;
7898
+ maxDeferrals: number;
7899
+ inbox?: string | undefined;
7900
+ };
7668
7901
  services: Record<string, {
7669
7902
  agent: string;
7670
7903
  name: string;
@@ -8093,6 +8326,14 @@ declare const daemonConfigSchema: z.ZodObject<{
8093
8326
  workspace: string;
8094
8327
  provider?: string | undefined;
8095
8328
  model?: string | undefined;
8329
+ wiki?: {
8330
+ contribute?: {
8331
+ model?: string | undefined;
8332
+ enabled?: boolean | undefined;
8333
+ maxPatches?: number | undefined;
8334
+ maxCostUsd?: number | undefined;
8335
+ } | undefined;
8336
+ } | undefined;
8096
8337
  voice?: {
8097
8338
  system?: string | Record<string, string> | undefined;
8098
8339
  provider?: "system" | "elevenlabs" | undefined;
@@ -8218,6 +8459,18 @@ declare const daemonConfigSchema: z.ZodObject<{
8218
8459
  skipTypes?: string[] | undefined;
8219
8460
  } | undefined;
8220
8461
  } | undefined;
8462
+ wiki?: {
8463
+ query?: {
8464
+ shared?: boolean | undefined;
8465
+ } | undefined;
8466
+ contributions?: {
8467
+ model?: string | undefined;
8468
+ schedule?: string | undefined;
8469
+ timezone?: string | undefined;
8470
+ maxCostUsd?: number | undefined;
8471
+ mergeSchedule?: string | undefined;
8472
+ } | undefined;
8473
+ } | undefined;
8221
8474
  app?: {
8222
8475
  android?: {
8223
8476
  packageName?: string | undefined;
@@ -8525,6 +8778,32 @@ declare const daemonConfigSchema: z.ZodObject<{
8525
8778
  defaultTitle?: string | undefined;
8526
8779
  } | undefined;
8527
8780
  } | undefined;
8781
+ crons?: Record<string, {
8782
+ agent: string;
8783
+ schedule: string;
8784
+ model?: string | undefined;
8785
+ enabled?: boolean | undefined;
8786
+ command?: string | undefined;
8787
+ prompt?: string | undefined;
8788
+ timeout?: number | undefined;
8789
+ timezone?: string | undefined;
8790
+ notify?: {
8791
+ channel: string;
8792
+ chatId: string;
8793
+ accountId?: string | undefined;
8794
+ } | undefined;
8795
+ approval?: {
8796
+ action: "delete" | "create";
8797
+ requestedBy: string;
8798
+ requestedAt: string;
8799
+ } | undefined;
8800
+ maxOutputTokens?: number | undefined;
8801
+ autonomy?: "report" | "propose" | "act" | undefined;
8802
+ onError?: "notify" | "disable" | "log" | ("notify" | "disable" | "log")[] | undefined;
8803
+ deliverResult?: boolean | undefined;
8804
+ fireToken?: string | undefined;
8805
+ createdBy?: string | undefined;
8806
+ }> | undefined;
8528
8807
  graph?: {
8529
8808
  enabled?: boolean | undefined;
8530
8809
  draftAgent?: string | undefined;
@@ -8564,32 +8843,13 @@ declare const daemonConfigSchema: z.ZodObject<{
8564
8843
  defaultModel?: string | undefined;
8565
8844
  baseUrl?: string | undefined;
8566
8845
  }> | undefined;
8567
- crons?: Record<string, {
8568
- agent: string;
8569
- schedule: string;
8570
- model?: string | undefined;
8846
+ wikiNotes?: {
8571
8847
  enabled?: boolean | undefined;
8572
- command?: string | undefined;
8573
- prompt?: string | undefined;
8574
- timeout?: number | undefined;
8575
- timezone?: string | undefined;
8576
- notify?: {
8577
- channel: string;
8578
- chatId: string;
8579
- accountId?: string | undefined;
8580
- } | undefined;
8581
- approval?: {
8582
- action: "delete" | "create";
8583
- requestedBy: string;
8584
- requestedAt: string;
8585
- } | undefined;
8586
- maxOutputTokens?: number | undefined;
8587
- autonomy?: "report" | "propose" | "act" | undefined;
8588
- onError?: "notify" | "disable" | "log" | ("notify" | "disable" | "log")[] | undefined;
8589
- deliverResult?: boolean | undefined;
8590
- fireToken?: string | undefined;
8591
- createdBy?: string | undefined;
8592
- }> | undefined;
8848
+ inbox?: string | undefined;
8849
+ crons?: string[] | undefined;
8850
+ maxNotesPerRun?: number | undefined;
8851
+ maxDeferrals?: number | undefined;
8852
+ } | undefined;
8593
8853
  services?: Record<string, {
8594
8854
  agent: string;
8595
8855
  name: string;
@@ -11446,6 +11706,15 @@ declare class WikiStore {
11446
11706
  private walkDir;
11447
11707
  }
11448
11708
 
11709
+ /** A wiki searched alongside the requester's own. */
11710
+ interface SharedWikiStore {
11711
+ /** Shown in citations as `@<id>/<path>`: an agent id, or "shared". */
11712
+ id: string;
11713
+ store: WikiStore;
11714
+ /** Paths to leave out, e.g. the agents/ tree under the root store. */
11715
+ skip?: (path: string) => boolean;
11716
+ }
11717
+
11449
11718
  type WikiMode = "flat" | "graph" | "unified";
11450
11719
  /**
11451
11720
  * WikiHub: manages per-agent wikis with a shared raw entry pool.
@@ -11475,6 +11744,15 @@ declare class WikiHub {
11475
11744
  /** The wiki root: shared sidecars (_facts.json, _questions.json) live here. */
11476
11745
  getBaseDir(): string;
11477
11746
  getSharedStore(): WikiStore;
11747
+ /**
11748
+ * The wikis a query by `agentId` reads besides its own: every other
11749
+ * agent's articles and the root store's own (promoted lessons). Which
11750
+ * articles of theirs it may read is still decided per article by access.
11751
+ * Without this an agent's query missed answers the shared wiki had (#824).
11752
+ */
11753
+ sharedScope(agentId: string): SharedWikiStore[];
11754
+ /** Agents with a wiki folder here, without reading the raw entries. */
11755
+ private listAgentDirs;
11478
11756
  listAgents(entries?: WikiEntry[]): string[];
11479
11757
  getAgentEntries(agentId: string): WikiEntry[];
11480
11758
  /**
@@ -14466,6 +14744,8 @@ interface CronRunResult {
14466
14744
  traceId?: string;
14467
14745
  /** Native provider session the run resumed or started, when reported. */
14468
14746
  sessionId?: string;
14747
+ /** Wiki notes (#825) the run was given as input, by note id. */
14748
+ wikiNotes?: string[];
14469
14749
  /** Autonomy level the run was held to (absent = act). */
14470
14750
  autonomy?: AutonomyLevel;
14471
14751
  /** Tool calls the autonomy guard blocked — what the routine would have
@@ -14498,6 +14778,7 @@ declare class CronScheduler {
14498
14778
  private running;
14499
14779
  private notifyCallback?;
14500
14780
  private deliverCallback?;
14781
+ private wikiNotes?;
14501
14782
  private log;
14502
14783
  constructor(config: DaemonConfig, registry: AgentRegistry, hooks?: HookRegistry, log?: (...args: unknown[]) => void);
14503
14784
  /** Whether a job with this id exists. */
@@ -14579,6 +14860,14 @@ declare class CronScheduler {
14579
14860
  private notifyDisabled;
14580
14861
  private saveLastRuns;
14581
14862
  private loadLastRuns;
14863
+ /**
14864
+ * The wiki notes inbox for a run of `job` (#825): open and deferred notes
14865
+ * agents left for the observe/sweep run, rendered as the block the run
14866
+ * reads first. Empty unless the job is listed under `wikiNotes.crons`
14867
+ * and runs as the inbox agent. Never throws: a broken inbox must not
14868
+ * stop the run.
14869
+ */
14870
+ private wikiNotesInbox;
14582
14871
  private logRun;
14583
14872
  /**
14584
14873
  * List all jobs and their status (including failure info).
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt,h as bt,la as Tt,ma as Mt}from"./chunk-UUVFH7BO.js";import"./chunk-O4XEQTEN.js";import"./chunk-JIXNSA67.js";import"./chunk-GTJIKXDB.js";import"./chunk-ZVP6GB4G.js";import"./chunk-S2GAEH2F.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-BGG3ZSMW.js";import"./chunk-XGOBZCYC.js";import"./chunk-WCXXXAHV.js";import"./chunk-JWDJMFU6.js";import"./chunk-GRMCAO3Q.js";import"./chunk-KZKDVIOE.js";import"./chunk-LQE73AZR.js";import"./chunk-2D3RYIDU.js";import"./chunk-WEPON4FP.js";import"./chunk-AKLZ4YO2.js";import"./chunk-PPUN7YHA.js";import"./chunk-Y4CYQV7G.js";import"./chunk-LLNPKE7H.js";import"./chunk-SHEUCITK.js";import"./chunk-QQYXYJOG.js";import"./chunk-GUQDPA6R.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-EMGB23H5.js";import{ca as yt,m as lt,n as ct,o as dt,p as mt,q as pt}from"./chunk-D6SWAB5J.js";import"./chunk-LVV7JBHM.js";import"./chunk-GLQLCBJS.js";import"./chunk-6W74CHNW.js";import{a as L}from"./chunk-UG2OF2EI.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-WUDVBPQV.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-X5C5W3E4.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import{s as ut}from"./chunk-5DFUUYEA.js";import"./chunk-WMTGAVPW.js";import"./chunk-VWTBHLMX.js";import"./chunk-YNA5T43U.js";import{a as ht}from"./chunk-ZQWWMAMJ.js";import"./chunk-3PGPN323.js";import"./chunk-2C3X6DVD.js";import"./chunk-56KNKUFF.js";import{f as gt,g as ft}from"./chunk-VXKNB4AW.js";import"./chunk-WPNRDEHW.js";import"./chunk-36AXN6ZB.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-FVG2BADS.js";import{j as it,k as rt,l as at}from"./chunk-JUIL2EW3.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-MYVHVJWZ.js";import"./chunk-AV7T3SYT.js";import"./chunk-Y5MFVVTM.js";import"./chunk-QD6IICK7.js";import"./chunk-QOYAX2FT.js";import"./chunk-4VVHGR7H.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-2PJKGZWP.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{ma as tt,oa as st,pa as ot,ra as nt}from"./chunk-46JKX6CT.js";import"./chunk-UIBUZ2N3.js";import"./chunk-BRK6M6LA.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{a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt,h as bt,la as Tt,ma as Mt}from"./chunk-EJT4MA3J.js";import"./chunk-C5MTLW7O.js";import"./chunk-GTJIKXDB.js";import"./chunk-6KIUVVKX.js";import"./chunk-BGG3ZSMW.js";import"./chunk-ZVP6GB4G.js";import"./chunk-S2GAEH2F.js";import"./chunk-PPUN7YHA.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-EMGB23H5.js";import"./chunk-XGOBZCYC.js";import"./chunk-WCXXXAHV.js";import"./chunk-JWDJMFU6.js";import"./chunk-GRMCAO3Q.js";import"./chunk-KZKDVIOE.js";import"./chunk-LQE73AZR.js";import"./chunk-2D3RYIDU.js";import"./chunk-WEPON4FP.js";import"./chunk-AKLZ4YO2.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-4V7SWL2S.js";import"./chunk-Y4CYQV7G.js";import"./chunk-LLNPKE7H.js";import"./chunk-SHEUCITK.js";import"./chunk-ZLC4TSXF.js";import"./chunk-6GGGXCOY.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import{ca as yt,m as lt,n as ct,o as dt,p as mt,q as pt}from"./chunk-QACEFESP.js";import"./chunk-O2BS6N3T.js";import"./chunk-GLQLCBJS.js";import"./chunk-6W74CHNW.js";import{s as ut}from"./chunk-2SV4RKRW.js";import{a as L}from"./chunk-UG2OF2EI.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-X5C5W3E4.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-HKW56YZK.js";import"./chunk-52SIHG45.js";import"./chunk-VWTBHLMX.js";import"./chunk-Z3W7D5RR.js";import{a as ht}from"./chunk-P4XGM7ZM.js";import"./chunk-3PGPN323.js";import"./chunk-FSW4FUMW.js";import"./chunk-VD7IO653.js";import{f as gt,g as ft}from"./chunk-LDS4SZBU.js";import"./chunk-WPNRDEHW.js";import"./chunk-36AXN6ZB.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-QQFURUMS.js";import{j as it,k as rt,l as at}from"./chunk-YWKLUQDC.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-MYVHVJWZ.js";import"./chunk-AV7T3SYT.js";import"./chunk-Y5MFVVTM.js";import"./chunk-QD6IICK7.js";import"./chunk-QOYAX2FT.js";import"./chunk-4VVHGR7H.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-2PJKGZWP.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{ma as tt,oa as st,pa as ot,ua as nt}from"./chunk-MRYA4J5F.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(`
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).