agentix-cli 0.144.0 → 0.146.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 (136) hide show
  1. package/dist/{App-N2U77ED7.js → App-EU2AJWW5.js} +2 -2
  2. package/dist/{ChatApp-GYVTECF6.js → ChatApp-ORR3U3AN.js} +2 -2
  3. package/dist/{absorb-eval-WSAVWCZV.js → absorb-eval-3VGPDRWS.js} +2 -2
  4. package/dist/{agent-SLRGXBMK.js → agent-NVJNOK5L.js} +2 -2
  5. package/dist/{board-dashboard-B3T7VCRQ.js → board-dashboard-JV2JNRWD.js} +31 -18
  6. package/dist/board-dashboard-JV2JNRWD.js.map +1 -0
  7. package/dist/{chunk-CZWEXRIE.js → chunk-3BMIZY6X.js} +2 -2
  8. package/dist/{chunk-2GJFLPS7.js → chunk-5TFXFLMN.js} +3 -3
  9. package/dist/{chunk-LVQHNTXV.js → chunk-5YAUENDI.js} +2 -2
  10. package/dist/{chunk-DFWPTNZ5.js → chunk-7O7VDA3J.js} +2 -2
  11. package/dist/{chunk-SVNYI6GR.js → chunk-DTWBB7B7.js} +2 -2
  12. package/dist/{chunk-VYLMC5DO.js → chunk-GECGRCYC.js} +2 -2
  13. package/dist/chunk-IBK7AG4S.js +62 -0
  14. package/dist/chunk-IBK7AG4S.js.map +1 -0
  15. package/dist/{chunk-UNZRZOED.js → chunk-J723FL3J.js} +2 -2
  16. package/dist/{chunk-SFUNL7RV.js → chunk-K3QDK4BX.js} +2 -2
  17. package/dist/{chunk-M7527M7D.js → chunk-MMBFAVBR.js} +2 -2
  18. package/dist/{chunk-GWBBWYGM.js → chunk-MO7DH5L6.js} +3 -3
  19. package/dist/chunk-MO7DH5L6.js.map +1 -0
  20. package/dist/chunk-MOCKFVYE.js +128 -0
  21. package/dist/chunk-MOCKFVYE.js.map +1 -0
  22. package/dist/{chunk-PJGLIAEP.js → chunk-NBDYBTI6.js} +296 -295
  23. package/dist/chunk-NBDYBTI6.js.map +1 -0
  24. package/dist/{chunk-45TKVOJX.js → chunk-O7ZJS33Z.js} +2 -2
  25. package/dist/{chunk-MXWAREAQ.js → chunk-OEB6RTRA.js} +2 -2
  26. package/dist/{chunk-4JHMV3D3.js → chunk-OT5KLHUT.js} +2 -2
  27. package/dist/{chunk-QI4FYJGJ.js → chunk-QNS3WHGU.js} +2 -2
  28. package/dist/{chunk-EX4AREN5.js → chunk-SK24JFEK.js} +2 -2
  29. package/dist/{chunk-TTBCXVPJ.js → chunk-SNCRLEH3.js} +78 -78
  30. package/dist/chunk-SNCRLEH3.js.map +1 -0
  31. package/dist/{chunk-KV4ZA7FS.js → chunk-TJZGAKIB.js} +4 -4
  32. package/dist/{chunk-KV4ZA7FS.js.map → chunk-TJZGAKIB.js.map} +1 -1
  33. package/dist/{chunk-BAO77R4L.js → chunk-TYONASHA.js} +2 -2
  34. package/dist/{chunk-R5VGRKUW.js → chunk-TZVJP4H3.js} +2 -2
  35. package/dist/{chunk-Q73QQPDB.js → chunk-UFX6INNI.js} +2 -2
  36. package/dist/{chunk-JGX5IWNX.js → chunk-USTNT7P7.js} +2 -2
  37. package/dist/{chunk-UII54DAP.js → chunk-UTYNYG7M.js} +2 -2
  38. package/dist/{chunk-RV4WJZW5.js → chunk-UVJLIHLL.js} +2 -2
  39. package/dist/{chunk-RGBQULXX.js → chunk-UYLVSS6I.js} +2 -2
  40. package/dist/{chunk-GOAMSJ2D.js → chunk-WCOT35YG.js} +2 -2
  41. package/dist/cli.js +1 -1
  42. package/dist/{client-B7FXDTYK.js → client-6KZZKCN2.js} +2 -2
  43. package/dist/config-W6JNVPBY.js +2 -0
  44. package/dist/{config-mutate-XQRUAVEH.js → config-mutate-57YT7BNB.js} +2 -2
  45. package/dist/config-mutator-6NWQPE7K.js +2 -0
  46. package/dist/{contributions-ESUSYUQG.js → contributions-Y6B6LG7X.js} +2 -2
  47. package/dist/{doctor-DIYZGSIS.js → doctor-ZP4KADAD.js} +2 -2
  48. package/dist/{follow-up-tool-QXEYEWX7.js → follow-up-tool-5AMZKVI4.js} +2 -2
  49. package/dist/{grants-MM7U6GCK.js → grants-O7SJ2J4B.js} +2 -2
  50. package/dist/{hub-OC7PH2AR.js → hub-BZF3ZYQ5.js} +2 -2
  51. package/dist/index.d.ts +188 -0
  52. package/dist/index.js +1 -1
  53. package/dist/{program-LZPM6I2Q.js → program-MO7HLAP5.js} +190 -190
  54. package/dist/program-MO7HLAP5.js.map +1 -0
  55. package/dist/{promote-SIC6RWCX.js → promote-IJANZNQK.js} +2 -2
  56. package/dist/{query-OP2MSR2G.js → query-DC74NB3R.js} +2 -2
  57. package/dist/{query-settings-67332F5V.js → query-settings-RXFOATOZ.js} +2 -2
  58. package/dist/{registry-G2ZG5TIN.js → registry-24IXRDWX.js} +2 -2
  59. package/dist/{request-planner-THTPE3FP.js → request-planner-33CWWCJU.js} +2 -2
  60. package/dist/{review-candidates-7PS7CHXF.js → review-candidates-ENWB6LHD.js} +2 -2
  61. package/dist/{routing-PE7DB7WA.js → routing-AUFJ4MNP.js} +2 -2
  62. package/dist/schedule-tool-NAMOBMZE.js +2 -0
  63. package/dist/{scheduler-YTXCIQTZ.js → scheduler-KWSBBZKW.js} +2 -2
  64. package/dist/{seat-6DMK4274.js → seat-YGMLJ6KS.js} +2 -2
  65. package/dist/{select-CLDYPAOS.js → select-JJGBM6ZT.js} +2 -2
  66. package/dist/{set-enabled-ZH2DH4GU.js → set-enabled-THE7QIGQ.js} +2 -2
  67. package/dist/{tool-MKDTKBJ4.js → tool-4ACTSFKC.js} +2 -2
  68. package/dist/{tool-4AO3ZMAY.js → tool-6LR6VORJ.js} +4 -4
  69. package/dist/tool-6LR6VORJ.js.map +1 -0
  70. package/dist/{wiki-CH2HYJVI.js → wiki-YAW7UEOQ.js} +2 -2
  71. package/dist/wiki-enrich-6ANFA2VB.js +2 -0
  72. package/package.json +1 -1
  73. package/dist/board-dashboard-B3T7VCRQ.js.map +0 -1
  74. package/dist/chunk-3LAQ74H7.js +0 -128
  75. package/dist/chunk-3LAQ74H7.js.map +0 -1
  76. package/dist/chunk-DPIQCHXB.js +0 -62
  77. package/dist/chunk-DPIQCHXB.js.map +0 -1
  78. package/dist/chunk-GWBBWYGM.js.map +0 -1
  79. package/dist/chunk-PJGLIAEP.js.map +0 -1
  80. package/dist/chunk-TTBCXVPJ.js.map +0 -1
  81. package/dist/config-MLP33NWR.js +0 -2
  82. package/dist/config-mutator-5JFTMQ43.js +0 -2
  83. package/dist/program-LZPM6I2Q.js.map +0 -1
  84. package/dist/schedule-tool-3FXRKJGN.js +0 -2
  85. package/dist/tool-4AO3ZMAY.js.map +0 -1
  86. package/dist/wiki-enrich-VEAYFVR2.js +0 -2
  87. /package/dist/{App-N2U77ED7.js.map → App-EU2AJWW5.js.map} +0 -0
  88. /package/dist/{ChatApp-GYVTECF6.js.map → ChatApp-ORR3U3AN.js.map} +0 -0
  89. /package/dist/{absorb-eval-WSAVWCZV.js.map → absorb-eval-3VGPDRWS.js.map} +0 -0
  90. /package/dist/{agent-SLRGXBMK.js.map → agent-NVJNOK5L.js.map} +0 -0
  91. /package/dist/{chunk-CZWEXRIE.js.map → chunk-3BMIZY6X.js.map} +0 -0
  92. /package/dist/{chunk-2GJFLPS7.js.map → chunk-5TFXFLMN.js.map} +0 -0
  93. /package/dist/{chunk-LVQHNTXV.js.map → chunk-5YAUENDI.js.map} +0 -0
  94. /package/dist/{chunk-DFWPTNZ5.js.map → chunk-7O7VDA3J.js.map} +0 -0
  95. /package/dist/{chunk-SVNYI6GR.js.map → chunk-DTWBB7B7.js.map} +0 -0
  96. /package/dist/{chunk-VYLMC5DO.js.map → chunk-GECGRCYC.js.map} +0 -0
  97. /package/dist/{chunk-UNZRZOED.js.map → chunk-J723FL3J.js.map} +0 -0
  98. /package/dist/{chunk-SFUNL7RV.js.map → chunk-K3QDK4BX.js.map} +0 -0
  99. /package/dist/{chunk-M7527M7D.js.map → chunk-MMBFAVBR.js.map} +0 -0
  100. /package/dist/{chunk-45TKVOJX.js.map → chunk-O7ZJS33Z.js.map} +0 -0
  101. /package/dist/{chunk-MXWAREAQ.js.map → chunk-OEB6RTRA.js.map} +0 -0
  102. /package/dist/{chunk-4JHMV3D3.js.map → chunk-OT5KLHUT.js.map} +0 -0
  103. /package/dist/{chunk-QI4FYJGJ.js.map → chunk-QNS3WHGU.js.map} +0 -0
  104. /package/dist/{chunk-EX4AREN5.js.map → chunk-SK24JFEK.js.map} +0 -0
  105. /package/dist/{chunk-BAO77R4L.js.map → chunk-TYONASHA.js.map} +0 -0
  106. /package/dist/{chunk-R5VGRKUW.js.map → chunk-TZVJP4H3.js.map} +0 -0
  107. /package/dist/{chunk-Q73QQPDB.js.map → chunk-UFX6INNI.js.map} +0 -0
  108. /package/dist/{chunk-JGX5IWNX.js.map → chunk-USTNT7P7.js.map} +0 -0
  109. /package/dist/{chunk-UII54DAP.js.map → chunk-UTYNYG7M.js.map} +0 -0
  110. /package/dist/{chunk-RV4WJZW5.js.map → chunk-UVJLIHLL.js.map} +0 -0
  111. /package/dist/{chunk-RGBQULXX.js.map → chunk-UYLVSS6I.js.map} +0 -0
  112. /package/dist/{chunk-GOAMSJ2D.js.map → chunk-WCOT35YG.js.map} +0 -0
  113. /package/dist/{client-B7FXDTYK.js.map → client-6KZZKCN2.js.map} +0 -0
  114. /package/dist/{config-MLP33NWR.js.map → config-W6JNVPBY.js.map} +0 -0
  115. /package/dist/{config-mutate-XQRUAVEH.js.map → config-mutate-57YT7BNB.js.map} +0 -0
  116. /package/dist/{config-mutator-5JFTMQ43.js.map → config-mutator-6NWQPE7K.js.map} +0 -0
  117. /package/dist/{contributions-ESUSYUQG.js.map → contributions-Y6B6LG7X.js.map} +0 -0
  118. /package/dist/{doctor-DIYZGSIS.js.map → doctor-ZP4KADAD.js.map} +0 -0
  119. /package/dist/{follow-up-tool-QXEYEWX7.js.map → follow-up-tool-5AMZKVI4.js.map} +0 -0
  120. /package/dist/{grants-MM7U6GCK.js.map → grants-O7SJ2J4B.js.map} +0 -0
  121. /package/dist/{hub-OC7PH2AR.js.map → hub-BZF3ZYQ5.js.map} +0 -0
  122. /package/dist/{promote-SIC6RWCX.js.map → promote-IJANZNQK.js.map} +0 -0
  123. /package/dist/{query-OP2MSR2G.js.map → query-DC74NB3R.js.map} +0 -0
  124. /package/dist/{query-settings-67332F5V.js.map → query-settings-RXFOATOZ.js.map} +0 -0
  125. /package/dist/{registry-G2ZG5TIN.js.map → registry-24IXRDWX.js.map} +0 -0
  126. /package/dist/{request-planner-THTPE3FP.js.map → request-planner-33CWWCJU.js.map} +0 -0
  127. /package/dist/{review-candidates-7PS7CHXF.js.map → review-candidates-ENWB6LHD.js.map} +0 -0
  128. /package/dist/{routing-PE7DB7WA.js.map → routing-AUFJ4MNP.js.map} +0 -0
  129. /package/dist/{schedule-tool-3FXRKJGN.js.map → schedule-tool-NAMOBMZE.js.map} +0 -0
  130. /package/dist/{scheduler-YTXCIQTZ.js.map → scheduler-KWSBBZKW.js.map} +0 -0
  131. /package/dist/{seat-6DMK4274.js.map → seat-YGMLJ6KS.js.map} +0 -0
  132. /package/dist/{select-CLDYPAOS.js.map → select-JJGBM6ZT.js.map} +0 -0
  133. /package/dist/{set-enabled-ZH2DH4GU.js.map → set-enabled-THE7QIGQ.js.map} +0 -0
  134. /package/dist/{tool-MKDTKBJ4.js.map → tool-4ACTSFKC.js.map} +0 -0
  135. /package/dist/{wiki-CH2HYJVI.js.map → wiki-YAW7UEOQ.js.map} +0 -0
  136. /package/dist/{wiki-enrich-VEAYFVR2.js.map → wiki-enrich-6ANFA2VB.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -2195,6 +2195,10 @@ declare const cronJobSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
2195
2195
  * but appending an instruction to the prompt is reliably honored. Use
2196
2196
  * 1500 for briefs, 500 for status pings, 300 for pure classifiers. */
2197
2197
  maxOutputTokens: z.ZodOptional<z.ZodNumber>;
2198
+ /** The task type of each run (`context.taskType`): picks the evidence a
2199
+ * watcher's done needs (`watchers.evidence.<type>`, #1049). Unset: the
2200
+ * `cron` rule, if there is one. */
2201
+ taskType: z.ZodOptional<z.ZodString>;
2198
2202
  /** How much this routine may do: `report` (read-only), `propose` (branch,
2199
2203
  * commit, MR/draft; never merge/deploy/delete) or `act` (the agent's full
2200
2204
  * permissions — the default). Enforced per run by the guard, not by the
@@ -2265,6 +2269,7 @@ declare const cronJobSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
2265
2269
  requestedAt: string;
2266
2270
  } | undefined;
2267
2271
  maxOutputTokens?: number | undefined;
2272
+ taskType?: string | undefined;
2268
2273
  autonomy?: "report" | "propose" | "act" | undefined;
2269
2274
  deliverResult?: boolean | undefined;
2270
2275
  fireToken?: string | undefined;
@@ -2289,6 +2294,7 @@ declare const cronJobSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
2289
2294
  requestedAt: string;
2290
2295
  } | undefined;
2291
2296
  maxOutputTokens?: number | undefined;
2297
+ taskType?: string | undefined;
2292
2298
  autonomy?: "report" | "propose" | "act" | undefined;
2293
2299
  onError?: "notify" | "disable" | "log" | ("notify" | "disable" | "log")[] | undefined;
2294
2300
  deliverResult?: boolean | undefined;
@@ -2315,6 +2321,7 @@ declare const cronJobSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
2315
2321
  requestedAt: string;
2316
2322
  } | undefined;
2317
2323
  maxOutputTokens?: number | undefined;
2324
+ taskType?: string | undefined;
2318
2325
  autonomy?: "report" | "propose" | "act" | undefined;
2319
2326
  deliverResult?: boolean | undefined;
2320
2327
  fireToken?: string | undefined;
@@ -2339,6 +2346,7 @@ declare const cronJobSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
2339
2346
  requestedAt: string;
2340
2347
  } | undefined;
2341
2348
  maxOutputTokens?: number | undefined;
2349
+ taskType?: string | undefined;
2342
2350
  autonomy?: "report" | "propose" | "act" | undefined;
2343
2351
  onError?: "notify" | "disable" | "log" | ("notify" | "disable" | "log")[] | undefined;
2344
2352
  deliverResult?: boolean | undefined;
@@ -2365,6 +2373,7 @@ declare const cronJobSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
2365
2373
  requestedAt: string;
2366
2374
  } | undefined;
2367
2375
  maxOutputTokens?: number | undefined;
2376
+ taskType?: string | undefined;
2368
2377
  autonomy?: "report" | "propose" | "act" | undefined;
2369
2378
  deliverResult?: boolean | undefined;
2370
2379
  fireToken?: string | undefined;
@@ -2389,6 +2398,7 @@ declare const cronJobSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
2389
2398
  requestedAt: string;
2390
2399
  } | undefined;
2391
2400
  maxOutputTokens?: number | undefined;
2401
+ taskType?: string | undefined;
2392
2402
  autonomy?: "report" | "propose" | "act" | undefined;
2393
2403
  onError?: "notify" | "disable" | "log" | ("notify" | "disable" | "log")[] | undefined;
2394
2404
  deliverResult?: boolean | undefined;
@@ -4739,6 +4749,10 @@ declare const daemonConfigSchema: z.ZodObject<{
4739
4749
  * but appending an instruction to the prompt is reliably honored. Use
4740
4750
  * 1500 for briefs, 500 for status pings, 300 for pure classifiers. */
4741
4751
  maxOutputTokens: z.ZodOptional<z.ZodNumber>;
4752
+ /** The task type of each run (`context.taskType`): picks the evidence a
4753
+ * watcher's done needs (`watchers.evidence.<type>`, #1049). Unset: the
4754
+ * `cron` rule, if there is one. */
4755
+ taskType: z.ZodOptional<z.ZodString>;
4742
4756
  /** How much this routine may do: `report` (read-only), `propose` (branch,
4743
4757
  * commit, MR/draft; never merge/deploy/delete) or `act` (the agent's full
4744
4758
  * permissions — the default). Enforced per run by the guard, not by the
@@ -4809,6 +4823,7 @@ declare const daemonConfigSchema: z.ZodObject<{
4809
4823
  requestedAt: string;
4810
4824
  } | undefined;
4811
4825
  maxOutputTokens?: number | undefined;
4826
+ taskType?: string | undefined;
4812
4827
  autonomy?: "report" | "propose" | "act" | undefined;
4813
4828
  deliverResult?: boolean | undefined;
4814
4829
  fireToken?: string | undefined;
@@ -4833,6 +4848,7 @@ declare const daemonConfigSchema: z.ZodObject<{
4833
4848
  requestedAt: string;
4834
4849
  } | undefined;
4835
4850
  maxOutputTokens?: number | undefined;
4851
+ taskType?: string | undefined;
4836
4852
  autonomy?: "report" | "propose" | "act" | undefined;
4837
4853
  onError?: "notify" | "disable" | "log" | ("notify" | "disable" | "log")[] | undefined;
4838
4854
  deliverResult?: boolean | undefined;
@@ -4859,6 +4875,7 @@ declare const daemonConfigSchema: z.ZodObject<{
4859
4875
  requestedAt: string;
4860
4876
  } | undefined;
4861
4877
  maxOutputTokens?: number | undefined;
4878
+ taskType?: string | undefined;
4862
4879
  autonomy?: "report" | "propose" | "act" | undefined;
4863
4880
  deliverResult?: boolean | undefined;
4864
4881
  fireToken?: string | undefined;
@@ -4883,6 +4900,7 @@ declare const daemonConfigSchema: z.ZodObject<{
4883
4900
  requestedAt: string;
4884
4901
  } | undefined;
4885
4902
  maxOutputTokens?: number | undefined;
4903
+ taskType?: string | undefined;
4886
4904
  autonomy?: "report" | "propose" | "act" | undefined;
4887
4905
  onError?: "notify" | "disable" | "log" | ("notify" | "disable" | "log")[] | undefined;
4888
4906
  deliverResult?: boolean | undefined;
@@ -4909,6 +4927,7 @@ declare const daemonConfigSchema: z.ZodObject<{
4909
4927
  requestedAt: string;
4910
4928
  } | undefined;
4911
4929
  maxOutputTokens?: number | undefined;
4930
+ taskType?: string | undefined;
4912
4931
  autonomy?: "report" | "propose" | "act" | undefined;
4913
4932
  deliverResult?: boolean | undefined;
4914
4933
  fireToken?: string | undefined;
@@ -4933,6 +4952,7 @@ declare const daemonConfigSchema: z.ZodObject<{
4933
4952
  requestedAt: string;
4934
4953
  } | undefined;
4935
4954
  maxOutputTokens?: number | undefined;
4955
+ taskType?: string | undefined;
4936
4956
  autonomy?: "report" | "propose" | "act" | undefined;
4937
4957
  onError?: "notify" | "disable" | "log" | ("notify" | "disable" | "log")[] | undefined;
4938
4958
  deliverResult?: boolean | undefined;
@@ -5717,6 +5737,45 @@ declare const daemonConfigSchema: z.ZodObject<{
5717
5737
  ciWaitMinutes?: number | undefined;
5718
5738
  maxDiffKb?: number | undefined;
5719
5739
  }>>;
5740
+ /** Merge policy (#1047): core paths need a person's approval; the
5741
+ * commit status `agentx/merge-policy` says which a PR is. */
5742
+ mergePolicy: z.ZodDefault<z.ZodObject<{
5743
+ enabled: z.ZodDefault<z.ZodBoolean>;
5744
+ /** Advisory posts success marked "[advisory]" on an unapproved core PR;
5745
+ * required posts pending until a person approves. */
5746
+ mode: z.ZodDefault<z.ZodEnum<["advisory", "required"]>>;
5747
+ /** Core files, as globs (`*` within a folder, `**` across folders, a
5748
+ * folder name covers everything under it). */
5749
+ corePaths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
5750
+ /** Exceptions carved out of corePaths: a file matching one is edge. */
5751
+ edgePaths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
5752
+ /** Label put on a PR that changes a core path, and taken off when it no
5753
+ * longer does. */
5754
+ label: z.ZodDefault<z.ZodString>;
5755
+ /** GitHub logins whose reviews count. Empty: the repository's owners,
5756
+ * members and collaborators, other than the PR's author and the
5757
+ * accounts AgentX posts with. */
5758
+ approvers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
5759
+ /** In required mode, raise an approvals card for the owner on each
5760
+ * unapproved core commit; YES approves that commit. */
5761
+ ownerCard: z.ZodDefault<z.ZodBoolean>;
5762
+ }, "strip", z.ZodTypeAny, {
5763
+ enabled: boolean;
5764
+ mode: "required" | "advisory";
5765
+ label: string;
5766
+ corePaths: string[];
5767
+ edgePaths: string[];
5768
+ approvers: string[];
5769
+ ownerCard: boolean;
5770
+ }, {
5771
+ enabled?: boolean | undefined;
5772
+ mode?: "required" | "advisory" | undefined;
5773
+ label?: string | undefined;
5774
+ corePaths?: string[] | undefined;
5775
+ edgePaths?: string[] | undefined;
5776
+ approvers?: string[] | undefined;
5777
+ ownerCard?: boolean | undefined;
5778
+ }>>;
5720
5779
  }, "strip", z.ZodTypeAny, {
5721
5780
  specTests: {
5722
5781
  enabled: boolean;
@@ -5751,6 +5810,15 @@ declare const daemonConfigSchema: z.ZodObject<{
5751
5810
  ciWaitMinutes: number;
5752
5811
  maxDiffKb: number;
5753
5812
  };
5813
+ mergePolicy: {
5814
+ enabled: boolean;
5815
+ mode: "required" | "advisory";
5816
+ label: string;
5817
+ corePaths: string[];
5818
+ edgePaths: string[];
5819
+ approvers: string[];
5820
+ ownerCard: boolean;
5821
+ };
5754
5822
  }, {
5755
5823
  specTests?: {
5756
5824
  model?: string | undefined;
@@ -5785,6 +5853,15 @@ declare const daemonConfigSchema: z.ZodObject<{
5785
5853
  ciWaitMinutes?: number | undefined;
5786
5854
  maxDiffKb?: number | undefined;
5787
5855
  } | undefined;
5856
+ mergePolicy?: {
5857
+ enabled?: boolean | undefined;
5858
+ mode?: "required" | "advisory" | undefined;
5859
+ label?: string | undefined;
5860
+ corePaths?: string[] | undefined;
5861
+ edgePaths?: string[] | undefined;
5862
+ approvers?: string[] | undefined;
5863
+ ownerCard?: boolean | undefined;
5864
+ } | undefined;
5788
5865
  }>>;
5789
5866
  /** How a daemon stop treats runs still in flight. */
5790
5867
  shutdown: z.ZodDefault<z.ZodObject<{
@@ -5943,18 +6020,29 @@ declare const daemonConfigSchema: z.ZodObject<{
5943
6020
  approveKinds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
5944
6021
  /** Agents that may not open a plan. */
5945
6022
  disabledAgents: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
6023
+ /** The plan gate (#1048): kinds of work an agent must plan before it
6024
+ * starts. An accept that names one of these as its `work` is refused
6025
+ * without steps. Empty: no kind needs a plan. */
6026
+ requireForWork: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
6027
+ /** An accept whose `estimateMinutes` is over this needs a plan too.
6028
+ * 0: no estimate needs one. */
6029
+ requireOverMinutes: z.ZodDefault<z.ZodNumber>;
5946
6030
  }, "strip", z.ZodTypeAny, {
5947
6031
  enabled: boolean;
5948
6032
  stallMinutes: number;
5949
6033
  maxNudges: number;
5950
6034
  approveKinds: string[];
5951
6035
  disabledAgents: string[];
6036
+ requireForWork: string[];
6037
+ requireOverMinutes: number;
5952
6038
  }, {
5953
6039
  enabled?: boolean | undefined;
5954
6040
  stallMinutes?: number | undefined;
5955
6041
  maxNudges?: number | undefined;
5956
6042
  approveKinds?: string[] | undefined;
5957
6043
  disabledAgents?: string[] | undefined;
6044
+ requireForWork?: string[] | undefined;
6045
+ requireOverMinutes?: number | undefined;
5958
6046
  }>>;
5959
6047
  /** Checkers that close an open loop on evidence (src/requests/checkers,
5960
6048
  * #1039). A loop with a `closeWhen` closes when its check is met; an
@@ -6025,6 +6113,8 @@ declare const daemonConfigSchema: z.ZodObject<{
6025
6113
  maxNudges: number;
6026
6114
  approveKinds: string[];
6027
6115
  disabledAgents: string[];
6116
+ requireForWork: string[];
6117
+ requireOverMinutes: number;
6028
6118
  };
6029
6119
  checkers: {
6030
6120
  enabled: ("reply" | "url" | "issue" | "git-ancestor")[];
@@ -6051,6 +6141,8 @@ declare const daemonConfigSchema: z.ZodObject<{
6051
6141
  maxNudges?: number | undefined;
6052
6142
  approveKinds?: string[] | undefined;
6053
6143
  disabledAgents?: string[] | undefined;
6144
+ requireForWork?: string[] | undefined;
6145
+ requireOverMinutes?: number | undefined;
6054
6146
  } | undefined;
6055
6147
  checkers?: {
6056
6148
  enabled?: ("reply" | "url" | "issue" | "git-ancestor")[] | undefined;
@@ -6101,12 +6193,38 @@ declare const daemonConfigSchema: z.ZodObject<{
6101
6193
  * delegation answers. "explicit": only POST /watchers/:id/done, so a
6102
6194
  * reply that only promises ("I'll publish at 18:00") keeps it open. */
6103
6195
  doneSignal: z.ZodDefault<z.ZodEnum<["result", "explicit"]>>;
6196
+ /** Evidence a done needs, by task type (#1049): the caller's
6197
+ * `context.taskType`, else the watcher's kind (dispatch, delegation,
6198
+ * cron). A task of a type with a rule closes only on a done whose
6199
+ * evidence the rule accepts; its reply never closes it. Types with no
6200
+ * rule close as `doneSignal` says. */
6201
+ evidence: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
6202
+ /** The kinds of proof that count: any one of them closes the task. */
6203
+ accept: z.ZodArray<z.ZodEnum<["test", "output", "link"]>, "many">;
6204
+ /** The shortest output text accepted. */
6205
+ minOutputChars: z.ZodDefault<z.ZodNumber>;
6206
+ /** Hosts a link must be on (or a subdomain of). Empty: any host. */
6207
+ linkHosts: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
6208
+ }, "strip", z.ZodTypeAny, {
6209
+ accept: ("output" | "test" | "link")[];
6210
+ minOutputChars: number;
6211
+ linkHosts: string[];
6212
+ }, {
6213
+ accept: ("output" | "test" | "link")[];
6214
+ minOutputChars?: number | undefined;
6215
+ linkHosts?: string[] | undefined;
6216
+ }>>>;
6104
6217
  }, "strip", z.ZodTypeAny, {
6105
6218
  enabled: boolean;
6106
6219
  owner: {
6107
6220
  channel?: string | undefined;
6108
6221
  chatId?: string | undefined;
6109
6222
  };
6223
+ evidence: Record<string, {
6224
+ accept: ("output" | "test" | "link")[];
6225
+ minOutputChars: number;
6226
+ linkHosts: string[];
6227
+ }>;
6110
6228
  retentionDays: number;
6111
6229
  skipChannels: string[];
6112
6230
  defaultDueMinutes: number;
@@ -6120,6 +6238,11 @@ declare const daemonConfigSchema: z.ZodObject<{
6120
6238
  channel?: string | undefined;
6121
6239
  chatId?: string | undefined;
6122
6240
  } | undefined;
6241
+ evidence?: Record<string, {
6242
+ accept: ("output" | "test" | "link")[];
6243
+ minOutputChars?: number | undefined;
6244
+ linkHosts?: string[] | undefined;
6245
+ }> | undefined;
6123
6246
  retentionDays?: number | undefined;
6124
6247
  skipChannels?: string[] | undefined;
6125
6248
  defaultDueMinutes?: number | undefined;
@@ -6133,6 +6256,11 @@ declare const daemonConfigSchema: z.ZodObject<{
6133
6256
  channel?: string | undefined;
6134
6257
  chatId?: string | undefined;
6135
6258
  };
6259
+ evidence: Record<string, {
6260
+ accept: ("output" | "test" | "link")[];
6261
+ minOutputChars: number;
6262
+ linkHosts: string[];
6263
+ }>;
6136
6264
  retentionDays: number;
6137
6265
  skipChannels: string[];
6138
6266
  defaultDueMinutes: number;
@@ -6146,6 +6274,11 @@ declare const daemonConfigSchema: z.ZodObject<{
6146
6274
  channel?: string | undefined;
6147
6275
  chatId?: string | undefined;
6148
6276
  } | undefined;
6277
+ evidence?: Record<string, {
6278
+ accept: ("output" | "test" | "link")[];
6279
+ minOutputChars?: number | undefined;
6280
+ linkHosts?: string[] | undefined;
6281
+ }> | undefined;
6149
6282
  retentionDays?: number | undefined;
6150
6283
  skipChannels?: string[] | undefined;
6151
6284
  defaultDueMinutes?: number | undefined;
@@ -8900,6 +9033,8 @@ declare const daemonConfigSchema: z.ZodObject<{
8900
9033
  maxNudges: number;
8901
9034
  approveKinds: string[];
8902
9035
  disabledAgents: string[];
9036
+ requireForWork: string[];
9037
+ requireOverMinutes: number;
8903
9038
  };
8904
9039
  checkers: {
8905
9040
  enabled: ("reply" | "url" | "issue" | "git-ancestor")[];
@@ -9096,6 +9231,7 @@ declare const daemonConfigSchema: z.ZodObject<{
9096
9231
  requestedAt: string;
9097
9232
  } | undefined;
9098
9233
  maxOutputTokens?: number | undefined;
9234
+ taskType?: string | undefined;
9099
9235
  autonomy?: "report" | "propose" | "act" | undefined;
9100
9236
  deliverResult?: boolean | undefined;
9101
9237
  fireToken?: string | undefined;
@@ -9168,6 +9304,15 @@ declare const daemonConfigSchema: z.ZodObject<{
9168
9304
  ciWaitMinutes: number;
9169
9305
  maxDiffKb: number;
9170
9306
  };
9307
+ mergePolicy: {
9308
+ enabled: boolean;
9309
+ mode: "required" | "advisory";
9310
+ label: string;
9311
+ corePaths: string[];
9312
+ edgePaths: string[];
9313
+ approvers: string[];
9314
+ ownerCard: boolean;
9315
+ };
9171
9316
  };
9172
9317
  providers: Record<string, {
9173
9318
  apiKey?: string | undefined;
@@ -9321,6 +9466,11 @@ declare const daemonConfigSchema: z.ZodObject<{
9321
9466
  channel?: string | undefined;
9322
9467
  chatId?: string | undefined;
9323
9468
  };
9469
+ evidence: Record<string, {
9470
+ accept: ("output" | "test" | "link")[];
9471
+ minOutputChars: number;
9472
+ linkHosts: string[];
9473
+ }>;
9324
9474
  retentionDays: number;
9325
9475
  skipChannels: string[];
9326
9476
  defaultDueMinutes: number;
@@ -10025,6 +10175,8 @@ declare const daemonConfigSchema: z.ZodObject<{
10025
10175
  maxNudges?: number | undefined;
10026
10176
  approveKinds?: string[] | undefined;
10027
10177
  disabledAgents?: string[] | undefined;
10178
+ requireForWork?: string[] | undefined;
10179
+ requireOverMinutes?: number | undefined;
10028
10180
  } | undefined;
10029
10181
  checkers?: {
10030
10182
  enabled?: ("reply" | "url" | "issue" | "git-ancestor")[] | undefined;
@@ -10213,6 +10365,7 @@ declare const daemonConfigSchema: z.ZodObject<{
10213
10365
  requestedAt: string;
10214
10366
  } | undefined;
10215
10367
  maxOutputTokens?: number | undefined;
10368
+ taskType?: string | undefined;
10216
10369
  autonomy?: "report" | "propose" | "act" | undefined;
10217
10370
  onError?: "notify" | "disable" | "log" | ("notify" | "disable" | "log")[] | undefined;
10218
10371
  deliverResult?: boolean | undefined;
@@ -10286,6 +10439,15 @@ declare const daemonConfigSchema: z.ZodObject<{
10286
10439
  ciWaitMinutes?: number | undefined;
10287
10440
  maxDiffKb?: number | undefined;
10288
10441
  } | undefined;
10442
+ mergePolicy?: {
10443
+ enabled?: boolean | undefined;
10444
+ mode?: "required" | "advisory" | undefined;
10445
+ label?: string | undefined;
10446
+ corePaths?: string[] | undefined;
10447
+ edgePaths?: string[] | undefined;
10448
+ approvers?: string[] | undefined;
10449
+ ownerCard?: boolean | undefined;
10450
+ } | undefined;
10289
10451
  } | undefined;
10290
10452
  providers?: Record<string, {
10291
10453
  apiKey?: string | undefined;
@@ -10439,6 +10601,11 @@ declare const daemonConfigSchema: z.ZodObject<{
10439
10601
  channel?: string | undefined;
10440
10602
  chatId?: string | undefined;
10441
10603
  } | undefined;
10604
+ evidence?: Record<string, {
10605
+ accept: ("output" | "test" | "link")[];
10606
+ minOutputChars?: number | undefined;
10607
+ linkHosts?: string[] | undefined;
10608
+ }> | undefined;
10442
10609
  retentionDays?: number | undefined;
10443
10610
  skipChannels?: string[] | undefined;
10444
10611
  defaultDueMinutes?: number | undefined;
@@ -10866,6 +11033,9 @@ declare class A2AMesh {
10866
11033
  /** This node checked its own operator key on the forward: tell the
10867
11034
  * peer the turn is the owner's (requests/operator, #407). */
10868
11035
  vouchOwner?: boolean;
11036
+ /** The task's type (#1049): picks the evidence the peer's watcher
11037
+ * asks for before the task counts as done. */
11038
+ taskType?: string;
10869
11039
  }): Promise<string>;
10870
11040
  /**
10871
11041
  * Streaming variant of `sendTask`. POSTs to the peer's `/task` with
@@ -11099,6 +11269,9 @@ interface AgentXEvents {
11099
11269
  /** When the task is due (ms), when the caller gave one in the run's
11100
11270
  * context as `dueAt` (watchers, #1030). */
11101
11271
  dueAt?: number;
11272
+ /** The task's type, when the caller gave one in the run's context as
11273
+ * `taskType`: it picks the evidence a done needs (watchers, #1049). */
11274
+ taskType?: string;
11102
11275
  };
11103
11276
  /** A single step inside an in-flight task — typically a tool call or
11104
11277
  * tool result inside the Claude streaming response. Producer is the
@@ -11396,6 +11569,9 @@ declare class AgentXDaemon {
11396
11569
  /** Pre-merge review gate (#990). Built with the GitHub channel; does
11397
11570
  * nothing while quality.reviewGate.enabled is false. */
11398
11571
  private reviewGate?;
11572
+ /** Core vs edge paths (#1047); does nothing while
11573
+ * quality.mergePolicy.enabled is false. */
11574
+ private mergePolicy?;
11399
11575
  private reviewLedger;
11400
11576
  private webrtc?;
11401
11577
  private botManager?;
@@ -11455,6 +11631,10 @@ declare class AgentXDaemon {
11455
11631
  constructor(configPath?: string);
11456
11632
  start(): Promise<void>;
11457
11633
  stop(): Promise<void>;
11634
+ /** The merge policy (#1047). The owner's approval is an approvals card
11635
+ * whose origin names the commit; the card store is the record, so an
11636
+ * approval survives a restart. */
11637
+ private buildMergePolicy;
11458
11638
  /** The review gate (#990): the reviewer runs as its own agent in a fresh
11459
11639
  * session keyed by the reviewed commit, so it never resumes the
11460
11640
  * author's conversation or an earlier review. */
@@ -15648,6 +15828,8 @@ declare class AgentRegistry {
15648
15828
  * the requested agent before returning "Unknown agent". Duck-typed so
15649
15829
  * we don't create a circular import with src/a2a/mesh.ts. */
15650
15830
  private meshFallback?;
15831
+ /** See setRunNote. */
15832
+ private runNote?;
15651
15833
  /** Workflow auto-runner — invoked when workflow matching is in `mode: "auto"`
15652
15834
  * and a candidate workflow's confidence ≥ autoRunThreshold. Wired by the
15653
15835
  * daemon after the workflow dispatcher is constructed. Returns the runId of
@@ -15726,6 +15908,10 @@ declare class AgentRegistry {
15726
15908
  * after WorkflowDispatcher boot. Pass undefined to detach (e.g. during
15727
15909
  * reload). */
15728
15910
  setWorkflowRunStore(runs: RunStore | undefined): void;
15911
+ /** Wire the watcher's note for a run's prompt (#1049): how to close the
15912
+ * watcher only that run can close. The daemon calls this once watchers
15913
+ * attach; unset, no note is added. */
15914
+ setRunNote(note: ((started: AgentXEvents["task:started"]) => string | undefined) | undefined): void;
15729
15915
  setWorkflowAutoRunner(runner: NonNullable<AgentRegistry["workflowAutoRunner"]> | undefined): void;
15730
15916
  /** Hot-swap the provider map. Daemon reload calls this after agentx.json
15731
15917
  * changes — the next task that executes will resolve credentials through
@@ -17711,6 +17897,8 @@ interface CronJobState {
17711
17897
  * via the prompt tail; reliably honored and keeps cache-hit intact
17712
17898
  * (hint text is per-job, not per-run). */
17713
17899
  maxOutputTokens?: number;
17900
+ /** The run's `context.taskType` (watchers' evidence rules, #1049). */
17901
+ taskType?: string;
17714
17902
  /** Routine autonomy level; unset = act (full agent permissions). */
17715
17903
  autonomy?: AutonomyLevel;
17716
17904
  onError: Array<"log" | "notify" | "disable">;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{Aa as Tt,Ba 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-PJGLIAEP.js";import"./chunk-GWBBWYGM.js";import"./chunk-GTJIKXDB.js";import"./chunk-GOAMSJ2D.js";import"./chunk-S2GAEH2F.js";import"./chunk-7LN4VKDU.js";import"./chunk-IMLAPB7G.js";import"./chunk-ZVP6GB4G.js";import"./chunk-2D3RYIDU.js";import"./chunk-MRIVENBY.js";import"./chunk-M7527M7D.js";import"./chunk-KV4ZA7FS.js";import"./chunk-PPUN7YHA.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-RGBQULXX.js";import"./chunk-AQASR6KR.js";import"./chunk-EMGB23H5.js";import"./chunk-JAML6222.js";import"./chunk-YMX3QCV7.js";import"./chunk-JWDJMFU6.js";import"./chunk-5HLD66CW.js";import"./chunk-IS2IWRP7.js";import"./chunk-LQE73AZR.js";import"./chunk-VY7TBMJU.js";import"./chunk-DG2DC43E.js";import"./chunk-WBG6NA7R.js";import"./chunk-JGX5IWNX.js";import"./chunk-A5GYG56I.js";import"./chunk-2AXFYDWF.js";import{m as lt,n as ct,na as yt,o as dt,p as mt,q as pt}from"./chunk-TTBCXVPJ.js";import"./chunk-45TKVOJX.js";import"./chunk-MEFPXHQJ.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-QI4FYJGJ.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-3LAQ74H7.js";import"./chunk-SFUNL7RV.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-Q73QQPDB.js";import{a as ht}from"./chunk-RV4WJZW5.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-2GJFLPS7.js";import"./chunk-SKSYII3K.js";import{f as gt,g as ft}from"./chunk-UII54DAP.js";import"./chunk-WPNRDEHW.js";import"./chunk-MWNCS57L.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-4JHMV3D3.js";import{j as it,k as rt,l as at}from"./chunk-R5VGRKUW.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-Y5MFVVTM.js";import"./chunk-QD6IICK7.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-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{Ia as tt,Ka as st,La as ot,Sa as nt}from"./chunk-DPIQCHXB.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{Aa as Tt,Ba 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-NBDYBTI6.js";import"./chunk-MO7DH5L6.js";import"./chunk-GTJIKXDB.js";import"./chunk-WCOT35YG.js";import"./chunk-S2GAEH2F.js";import"./chunk-7LN4VKDU.js";import"./chunk-IMLAPB7G.js";import"./chunk-ZVP6GB4G.js";import"./chunk-2D3RYIDU.js";import"./chunk-MRIVENBY.js";import"./chunk-MMBFAVBR.js";import"./chunk-TJZGAKIB.js";import"./chunk-PPUN7YHA.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-UYLVSS6I.js";import"./chunk-AQASR6KR.js";import"./chunk-EMGB23H5.js";import"./chunk-JAML6222.js";import"./chunk-YMX3QCV7.js";import"./chunk-JWDJMFU6.js";import"./chunk-5HLD66CW.js";import"./chunk-IS2IWRP7.js";import"./chunk-LQE73AZR.js";import"./chunk-VY7TBMJU.js";import"./chunk-DG2DC43E.js";import"./chunk-WBG6NA7R.js";import"./chunk-USTNT7P7.js";import"./chunk-A5GYG56I.js";import"./chunk-2AXFYDWF.js";import{m as lt,n as ct,o as dt,p as mt,pa as yt,q as pt}from"./chunk-SNCRLEH3.js";import"./chunk-O7ZJS33Z.js";import"./chunk-MEFPXHQJ.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-QNS3WHGU.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-MOCKFVYE.js";import"./chunk-K3QDK4BX.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-UFX6INNI.js";import{a as ht}from"./chunk-UVJLIHLL.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-5TFXFLMN.js";import"./chunk-SKSYII3K.js";import{f as gt,g as ft}from"./chunk-UTYNYG7M.js";import"./chunk-WPNRDEHW.js";import"./chunk-MWNCS57L.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-OT5KLHUT.js";import{j as it,k as rt,l as at}from"./chunk-TZVJP4H3.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-Y5MFVVTM.js";import"./chunk-QD6IICK7.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-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{Ja as tt,La as st,Ma as ot,Ta as nt}from"./chunk-IBK7AG4S.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).