agentix-cli 0.139.2 → 0.141.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 (128) hide show
  1. package/README.md +15 -2
  2. package/dist/{App-VINKWTYN.js → App-A6YSBIEL.js} +2 -2
  3. package/dist/{ChatApp-RGHQCRBX.js → ChatApp-Q7UHDR5P.js} +2 -2
  4. package/dist/{absorb-eval-AERHBOQA.js → absorb-eval-WTKVCJXT.js} +2 -2
  5. package/dist/{agent-5CEDGNDW.js → agent-DHCLFYIQ.js} +2 -2
  6. package/dist/{board-dashboard-F5GP2X22.js → board-dashboard-6K34ZQB5.js} +4 -4
  7. package/dist/{chunk-IMUTN7PT.js → chunk-27UKZZTZ.js} +2 -2
  8. package/dist/{chunk-JS2LEURJ.js → chunk-6DZSDM35.js} +2 -2
  9. package/dist/{chunk-J7U3BASX.js → chunk-6MARQ33D.js} +2 -2
  10. package/dist/chunk-CELYB3UW.js +174 -0
  11. package/dist/chunk-CELYB3UW.js.map +1 -0
  12. package/dist/{chunk-STIZFWDJ.js → chunk-COWWOA7H.js} +2 -2
  13. package/dist/{chunk-WTMZW5X7.js → chunk-CV7ISZKU.js} +2 -2
  14. package/dist/{chunk-O6WW7ATO.js → chunk-HPGMY6YB.js} +2 -2
  15. package/dist/chunk-HW5FTKTU.js +54 -0
  16. package/dist/{chunk-MGM33GOW.js.map → chunk-HW5FTKTU.js.map} +1 -1
  17. package/dist/{chunk-4LNJR5PC.js → chunk-HYOXWAQP.js} +3 -3
  18. package/dist/chunk-HYOXWAQP.js.map +1 -0
  19. package/dist/{chunk-HWYU6XG2.js → chunk-I6P3BKWJ.js} +2 -2
  20. package/dist/{chunk-HGU5B7IY.js → chunk-JLM6CXIH.js} +2 -2
  21. package/dist/{chunk-65LN6GQP.js → chunk-L7OTWV5X.js} +320 -280
  22. package/dist/chunk-L7OTWV5X.js.map +1 -0
  23. package/dist/{chunk-JJZVFDG6.js → chunk-LYSCMFAM.js} +2 -2
  24. package/dist/{chunk-LMZCB7TT.js → chunk-MSRFTAWH.js} +2 -2
  25. package/dist/{chunk-NQGLKWDO.js → chunk-MT5QTEUL.js} +2 -2
  26. package/dist/{chunk-EJIY45FZ.js → chunk-MWB33O72.js} +2 -2
  27. package/dist/{chunk-B65EC44C.js → chunk-NJHNV4QP.js} +2 -2
  28. package/dist/{chunk-P4TSZDVO.js → chunk-OG44FK7T.js} +2 -2
  29. package/dist/{chunk-ANDEMOYE.js → chunk-OW2AND54.js} +2 -2
  30. package/dist/{chunk-BUKXFZEO.js → chunk-S5DS2V3X.js} +2 -2
  31. package/dist/{chunk-HXLB2XCT.js → chunk-T7LDVJMP.js} +3 -3
  32. package/dist/{chunk-7KAQHNLT.js → chunk-UJRJUSDY.js} +2 -2
  33. package/dist/{chunk-QN2OTBVC.js → chunk-UVJUURNO.js} +2 -2
  34. package/dist/{chunk-NMYPZR4W.js → chunk-VJC372D6.js} +2 -2
  35. package/dist/{chunk-AXHP6TMT.js → chunk-W4JLZJHU.js} +2 -2
  36. package/dist/{chunk-Z5IHT6RK.js → chunk-YDPXS6T4.js} +2 -2
  37. package/dist/cli.js +1 -1
  38. package/dist/{client-2KZWK6YT.js → client-T5BDAOBA.js} +2 -2
  39. package/dist/config-PCTNYBE3.js +2 -0
  40. package/dist/{config-mutate-HXWAXWHC.js → config-mutate-2WZOX6Y6.js} +2 -2
  41. package/dist/config-mutator-M65NF7SF.js +2 -0
  42. package/dist/{contributions-OSIKL25B.js → contributions-HVCHGNPO.js} +2 -2
  43. package/dist/{doctor-TOSA3RWP.js → doctor-NHEMFVQG.js} +2 -2
  44. package/dist/{follow-up-tool-M2KCLRQQ.js → follow-up-tool-7ENUC5TI.js} +2 -2
  45. package/dist/{hub-XGWCWKMT.js → hub-KTS6KFMG.js} +2 -2
  46. package/dist/index.d.ts +441 -0
  47. package/dist/index.js +1 -1
  48. package/dist/{program-SJT7PIFO.js → program-QQ6N3PVM.js} +241 -236
  49. package/dist/program-QQ6N3PVM.js.map +1 -0
  50. package/dist/{promote-YVWRKIAU.js → promote-CGF5G6PE.js} +2 -2
  51. package/dist/{query-X4AFOKZ7.js → query-AJVLRTTT.js} +2 -2
  52. package/dist/{query-settings-HV2RFQK7.js → query-settings-GF3CRGHA.js} +2 -2
  53. package/dist/registry-HYQ3N4B6.js +2 -0
  54. package/dist/{request-planner-MY6VKTVC.js → request-planner-4KQSVQHO.js} +2 -2
  55. package/dist/{review-candidates-BRTBB5XV.js → review-candidates-KC3AJDAL.js} +2 -2
  56. package/dist/{routing-CSVLOGNS.js → routing-5VGAZXNZ.js} +2 -2
  57. package/dist/schedule-tool-XETP3D45.js +2 -0
  58. package/dist/{scheduler-OUAVAU4O.js → scheduler-UZNAC46U.js} +2 -2
  59. package/dist/{seat-H2QR3CRX.js → seat-BTSSQDZX.js} +2 -2
  60. package/dist/{select-EEL5AZ2I.js → select-MYLQ3QGJ.js} +2 -2
  61. package/dist/{set-enabled-IBGEH6U6.js → set-enabled-QJ4GM624.js} +2 -2
  62. package/dist/{tool-GJ75MWV5.js → tool-HTPNTSCA.js} +2 -2
  63. package/dist/{tool-DFPOFXGA.js → tool-HZHMB5Q3.js} +2 -2
  64. package/dist/{wiki-ISKHNG3P.js → wiki-ZWFSQ5SL.js} +2 -2
  65. package/dist/wiki-enrich-HQCWHX6Z.js +2 -0
  66. package/package.json +3 -2
  67. package/dist/chunk-4LNJR5PC.js.map +0 -1
  68. package/dist/chunk-65LN6GQP.js.map +0 -1
  69. package/dist/chunk-LGB6ILTW.js +0 -160
  70. package/dist/chunk-LGB6ILTW.js.map +0 -1
  71. package/dist/chunk-MGM33GOW.js +0 -54
  72. package/dist/config-THFRJMZD.js +0 -2
  73. package/dist/config-mutator-JZOAWRBH.js +0 -2
  74. package/dist/program-SJT7PIFO.js.map +0 -1
  75. package/dist/registry-Q7VNRLZA.js +0 -2
  76. package/dist/schedule-tool-GUKYTQTY.js +0 -2
  77. package/dist/wiki-enrich-JNQ2RPWU.js +0 -2
  78. /package/dist/{App-VINKWTYN.js.map → App-A6YSBIEL.js.map} +0 -0
  79. /package/dist/{ChatApp-RGHQCRBX.js.map → ChatApp-Q7UHDR5P.js.map} +0 -0
  80. /package/dist/{absorb-eval-AERHBOQA.js.map → absorb-eval-WTKVCJXT.js.map} +0 -0
  81. /package/dist/{agent-5CEDGNDW.js.map → agent-DHCLFYIQ.js.map} +0 -0
  82. /package/dist/{board-dashboard-F5GP2X22.js.map → board-dashboard-6K34ZQB5.js.map} +0 -0
  83. /package/dist/{chunk-IMUTN7PT.js.map → chunk-27UKZZTZ.js.map} +0 -0
  84. /package/dist/{chunk-JS2LEURJ.js.map → chunk-6DZSDM35.js.map} +0 -0
  85. /package/dist/{chunk-J7U3BASX.js.map → chunk-6MARQ33D.js.map} +0 -0
  86. /package/dist/{chunk-STIZFWDJ.js.map → chunk-COWWOA7H.js.map} +0 -0
  87. /package/dist/{chunk-WTMZW5X7.js.map → chunk-CV7ISZKU.js.map} +0 -0
  88. /package/dist/{chunk-O6WW7ATO.js.map → chunk-HPGMY6YB.js.map} +0 -0
  89. /package/dist/{chunk-HWYU6XG2.js.map → chunk-I6P3BKWJ.js.map} +0 -0
  90. /package/dist/{chunk-HGU5B7IY.js.map → chunk-JLM6CXIH.js.map} +0 -0
  91. /package/dist/{chunk-JJZVFDG6.js.map → chunk-LYSCMFAM.js.map} +0 -0
  92. /package/dist/{chunk-LMZCB7TT.js.map → chunk-MSRFTAWH.js.map} +0 -0
  93. /package/dist/{chunk-NQGLKWDO.js.map → chunk-MT5QTEUL.js.map} +0 -0
  94. /package/dist/{chunk-EJIY45FZ.js.map → chunk-MWB33O72.js.map} +0 -0
  95. /package/dist/{chunk-B65EC44C.js.map → chunk-NJHNV4QP.js.map} +0 -0
  96. /package/dist/{chunk-P4TSZDVO.js.map → chunk-OG44FK7T.js.map} +0 -0
  97. /package/dist/{chunk-ANDEMOYE.js.map → chunk-OW2AND54.js.map} +0 -0
  98. /package/dist/{chunk-BUKXFZEO.js.map → chunk-S5DS2V3X.js.map} +0 -0
  99. /package/dist/{chunk-HXLB2XCT.js.map → chunk-T7LDVJMP.js.map} +0 -0
  100. /package/dist/{chunk-7KAQHNLT.js.map → chunk-UJRJUSDY.js.map} +0 -0
  101. /package/dist/{chunk-QN2OTBVC.js.map → chunk-UVJUURNO.js.map} +0 -0
  102. /package/dist/{chunk-NMYPZR4W.js.map → chunk-VJC372D6.js.map} +0 -0
  103. /package/dist/{chunk-AXHP6TMT.js.map → chunk-W4JLZJHU.js.map} +0 -0
  104. /package/dist/{chunk-Z5IHT6RK.js.map → chunk-YDPXS6T4.js.map} +0 -0
  105. /package/dist/{client-2KZWK6YT.js.map → client-T5BDAOBA.js.map} +0 -0
  106. /package/dist/{config-THFRJMZD.js.map → config-PCTNYBE3.js.map} +0 -0
  107. /package/dist/{config-mutate-HXWAXWHC.js.map → config-mutate-2WZOX6Y6.js.map} +0 -0
  108. /package/dist/{config-mutator-JZOAWRBH.js.map → config-mutator-M65NF7SF.js.map} +0 -0
  109. /package/dist/{contributions-OSIKL25B.js.map → contributions-HVCHGNPO.js.map} +0 -0
  110. /package/dist/{doctor-TOSA3RWP.js.map → doctor-NHEMFVQG.js.map} +0 -0
  111. /package/dist/{follow-up-tool-M2KCLRQQ.js.map → follow-up-tool-7ENUC5TI.js.map} +0 -0
  112. /package/dist/{hub-XGWCWKMT.js.map → hub-KTS6KFMG.js.map} +0 -0
  113. /package/dist/{promote-YVWRKIAU.js.map → promote-CGF5G6PE.js.map} +0 -0
  114. /package/dist/{query-X4AFOKZ7.js.map → query-AJVLRTTT.js.map} +0 -0
  115. /package/dist/{query-settings-HV2RFQK7.js.map → query-settings-GF3CRGHA.js.map} +0 -0
  116. /package/dist/{registry-Q7VNRLZA.js.map → registry-HYQ3N4B6.js.map} +0 -0
  117. /package/dist/{request-planner-MY6VKTVC.js.map → request-planner-4KQSVQHO.js.map} +0 -0
  118. /package/dist/{review-candidates-BRTBB5XV.js.map → review-candidates-KC3AJDAL.js.map} +0 -0
  119. /package/dist/{routing-CSVLOGNS.js.map → routing-5VGAZXNZ.js.map} +0 -0
  120. /package/dist/{schedule-tool-GUKYTQTY.js.map → schedule-tool-XETP3D45.js.map} +0 -0
  121. /package/dist/{scheduler-OUAVAU4O.js.map → scheduler-UZNAC46U.js.map} +0 -0
  122. /package/dist/{seat-H2QR3CRX.js.map → seat-BTSSQDZX.js.map} +0 -0
  123. /package/dist/{select-EEL5AZ2I.js.map → select-MYLQ3QGJ.js.map} +0 -0
  124. /package/dist/{set-enabled-IBGEH6U6.js.map → set-enabled-QJ4GM624.js.map} +0 -0
  125. /package/dist/{tool-GJ75MWV5.js.map → tool-HTPNTSCA.js.map} +0 -0
  126. /package/dist/{tool-DFPOFXGA.js.map → tool-HZHMB5Q3.js.map} +0 -0
  127. /package/dist/{wiki-ISKHNG3P.js.map → wiki-ZWFSQ5SL.js.map} +0 -0
  128. /package/dist/{wiki-enrich-JNQ2RPWU.js.map → wiki-enrich-HQCWHX6Z.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-AXHP6TMT.js";import"./chunk-STIZFWDJ.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-7KAQHNLT.js";import"./chunk-WPNRDEHW.js";import"./chunk-LMZCB7TT.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QOYAX2FT.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-MGM33GOW.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as WikiHub};
2
- //# sourceMappingURL=hub-XGWCWKMT.js.map
1
+ import{a}from"./chunk-W4JLZJHU.js";import"./chunk-COWWOA7H.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-UJRJUSDY.js";import"./chunk-WPNRDEHW.js";import"./chunk-MSRFTAWH.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QOYAX2FT.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-HW5FTKTU.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as WikiHub};
2
+ //# sourceMappingURL=hub-KTS6KFMG.js.map
package/dist/index.d.ts CHANGED
@@ -5565,6 +5565,227 @@ declare const daemonConfigSchema: z.ZodObject<{
5565
5565
  composeTimeoutSeconds?: number | undefined;
5566
5566
  } | undefined;
5567
5567
  }>>;
5568
+ /** Quality gates for agent-written changes (#987). Each is off by default. */
5569
+ quality: z.ZodDefault<z.ZodObject<{
5570
+ /** Spec-first tests (#992): for an issue that names a pilot path and
5571
+ * goes to a Claude cloud session, a separate test agent writes tests
5572
+ * from the issue text only and pushes them to `spec-tests/issue-N` for
5573
+ * the coding session to merge. See src/agents/spec-tests.ts. */
5574
+ specTests: z.ZodDefault<z.ZodObject<{
5575
+ enabled: z.ZodDefault<z.ZodBoolean>;
5576
+ /** Path prefixes; an issue that names one of them is in the pilot. */
5577
+ paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
5578
+ /** The test agent's name: the spec-test commit's author. Must not be
5579
+ * the coding agent's id. */
5580
+ agent: z.ZodDefault<z.ZodString>;
5581
+ /** Model for the test agent. Unset: the `claude` CLI default. */
5582
+ model: z.ZodOptional<z.ZodString>;
5583
+ /** USD cap for one issue's test agent run; it stops when spent. */
5584
+ maxCostPerIssue: z.ZodDefault<z.ZodNumber>;
5585
+ /** Minutes cap for one issue's test agent run. */
5586
+ maxMinutes: z.ZodDefault<z.ZodNumber>;
5587
+ }, "strip", z.ZodTypeAny, {
5588
+ enabled: boolean;
5589
+ agent: string;
5590
+ paths: string[];
5591
+ maxMinutes: number;
5592
+ maxCostPerIssue: number;
5593
+ model?: string | undefined;
5594
+ }, {
5595
+ model?: string | undefined;
5596
+ enabled?: boolean | undefined;
5597
+ agent?: string | undefined;
5598
+ paths?: string[] | undefined;
5599
+ maxMinutes?: number | undefined;
5600
+ maxCostPerIssue?: number | undefined;
5601
+ }>>;
5602
+ /** Canary soak (#993): `agentx daemon deploy` only ships a commit that
5603
+ * has run on this (local) daemon for soakMinutes without new trouble.
5604
+ * Judged from the boot log and task history (src/daemon/canary-soak). */
5605
+ canary: z.ZodDefault<z.ZodObject<{
5606
+ /** Deploy reads only this key from the raw file (no .env, no
5607
+ * validation), so only a literal `true` turns the gate on. */
5608
+ enabled: z.ZodDefault<z.ZodBoolean>;
5609
+ soakMinutes: z.ZodDefault<z.ZodNumber>;
5610
+ thresholds: z.ZodDefault<z.ZodObject<{
5611
+ /** Clean restarts allowed during the soak (not counting the one
5612
+ * that started it). */
5613
+ maxRestarts: z.ZodDefault<z.ZodNumber>;
5614
+ /** Unclean stops (crash, kill) allowed during the soak. */
5615
+ maxCrashes: z.ZodDefault<z.ZodNumber>;
5616
+ /** Failed or timed-out tasks allowed during the soak (stopped ones
5617
+ * do not count). */
5618
+ maxFailedTasks: z.ZodDefault<z.ZodNumber>;
5619
+ /** Largest rise in the share of failed tasks vs the previous
5620
+ * release, as a fraction (0.1 = 10 percentage points). */
5621
+ maxErrorRateIncrease: z.ZodDefault<z.ZodNumber>;
5622
+ /** Fewer tasks than this during the soak skips the rate check. */
5623
+ minTasksForRate: z.ZodDefault<z.ZodNumber>;
5624
+ }, "strip", z.ZodTypeAny, {
5625
+ maxRestarts: number;
5626
+ maxCrashes: number;
5627
+ maxFailedTasks: number;
5628
+ maxErrorRateIncrease: number;
5629
+ minTasksForRate: number;
5630
+ }, {
5631
+ maxRestarts?: number | undefined;
5632
+ maxCrashes?: number | undefined;
5633
+ maxFailedTasks?: number | undefined;
5634
+ maxErrorRateIncrease?: number | undefined;
5635
+ minTasksForRate?: number | undefined;
5636
+ }>>;
5637
+ }, "strip", z.ZodTypeAny, {
5638
+ enabled: boolean;
5639
+ soakMinutes: number;
5640
+ thresholds: {
5641
+ maxRestarts: number;
5642
+ maxCrashes: number;
5643
+ maxFailedTasks: number;
5644
+ maxErrorRateIncrease: number;
5645
+ minTasksForRate: number;
5646
+ };
5647
+ }, {
5648
+ enabled?: boolean | undefined;
5649
+ soakMinutes?: number | undefined;
5650
+ thresholds?: {
5651
+ maxRestarts?: number | undefined;
5652
+ maxCrashes?: number | undefined;
5653
+ maxFailedTasks?: number | undefined;
5654
+ maxErrorRateIncrease?: number | undefined;
5655
+ minTasksForRate?: number | undefined;
5656
+ } | undefined;
5657
+ }>>;
5658
+ /** Pre-merge review gate (#990): a different agent, in a fresh
5659
+ * session, checks an agent's pull request against its linked issue
5660
+ * and posts the commit status `agentx/review` on the head commit. */
5661
+ reviewGate: z.ZodDefault<z.ZodObject<{
5662
+ enabled: z.ZodDefault<z.ZodBoolean>;
5663
+ mode: z.ZodDefault<z.ZodEnum<["advisory", "required"]>>;
5664
+ reviewer: z.ZodDefault<z.ZodObject<{
5665
+ /** The agent that reviews. Must not be the agent that wrote the PR. */
5666
+ agent: z.ZodOptional<z.ZodString>;
5667
+ /** Model for the review. Unset: the reviewer agent's own model. Pick
5668
+ * one that differs from the author agent's model when you can. */
5669
+ model: z.ZodOptional<z.ZodString>;
5670
+ }, "strip", z.ZodTypeAny, {
5671
+ model?: string | undefined;
5672
+ agent?: string | undefined;
5673
+ }, {
5674
+ model?: string | undefined;
5675
+ agent?: string | undefined;
5676
+ }>>;
5677
+ /** Only PRs that change a file matching one of these globs are
5678
+ * reviewed (`*` within a folder, `**` across folders). Empty: all. */
5679
+ paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
5680
+ /** Review cost above this many US dollars ends as `error`. 0: no limit. */
5681
+ maxCostPerReview: z.ZodDefault<z.ZodNumber>;
5682
+ /** Review time above this many minutes ends as `error`. */
5683
+ maxMinutes: z.ZodDefault<z.ZodNumber>;
5684
+ /** Most reviewer runs one PR gets in 24 hours. Each failure comment can
5685
+ * bring a fix push and each push a review; past the limit the status
5686
+ * is `error` and a person takes over. 0: no limit. */
5687
+ maxReviewsPerPrPerDay: z.ZodDefault<z.ZodNumber>;
5688
+ /** How long to wait for other CI checks to finish before reviewing. */
5689
+ ciWaitMinutes: z.ZodDefault<z.ZodNumber>;
5690
+ /** Diffs longer than this many kilobytes are cut, and the reviewer is
5691
+ * told the diff is incomplete. */
5692
+ maxDiffKb: z.ZodDefault<z.ZodNumber>;
5693
+ }, "strip", z.ZodTypeAny, {
5694
+ enabled: boolean;
5695
+ mode: "required" | "advisory";
5696
+ reviewer: {
5697
+ model?: string | undefined;
5698
+ agent?: string | undefined;
5699
+ };
5700
+ paths: string[];
5701
+ maxCostPerReview: number;
5702
+ maxMinutes: number;
5703
+ maxReviewsPerPrPerDay: number;
5704
+ ciWaitMinutes: number;
5705
+ maxDiffKb: number;
5706
+ }, {
5707
+ enabled?: boolean | undefined;
5708
+ mode?: "required" | "advisory" | undefined;
5709
+ reviewer?: {
5710
+ model?: string | undefined;
5711
+ agent?: string | undefined;
5712
+ } | undefined;
5713
+ paths?: string[] | undefined;
5714
+ maxCostPerReview?: number | undefined;
5715
+ maxMinutes?: number | undefined;
5716
+ maxReviewsPerPrPerDay?: number | undefined;
5717
+ ciWaitMinutes?: number | undefined;
5718
+ maxDiffKb?: number | undefined;
5719
+ }>>;
5720
+ }, "strip", z.ZodTypeAny, {
5721
+ specTests: {
5722
+ enabled: boolean;
5723
+ agent: string;
5724
+ paths: string[];
5725
+ maxMinutes: number;
5726
+ maxCostPerIssue: number;
5727
+ model?: string | undefined;
5728
+ };
5729
+ canary: {
5730
+ enabled: boolean;
5731
+ soakMinutes: number;
5732
+ thresholds: {
5733
+ maxRestarts: number;
5734
+ maxCrashes: number;
5735
+ maxFailedTasks: number;
5736
+ maxErrorRateIncrease: number;
5737
+ minTasksForRate: number;
5738
+ };
5739
+ };
5740
+ reviewGate: {
5741
+ enabled: boolean;
5742
+ mode: "required" | "advisory";
5743
+ reviewer: {
5744
+ model?: string | undefined;
5745
+ agent?: string | undefined;
5746
+ };
5747
+ paths: string[];
5748
+ maxCostPerReview: number;
5749
+ maxMinutes: number;
5750
+ maxReviewsPerPrPerDay: number;
5751
+ ciWaitMinutes: number;
5752
+ maxDiffKb: number;
5753
+ };
5754
+ }, {
5755
+ specTests?: {
5756
+ model?: string | undefined;
5757
+ enabled?: boolean | undefined;
5758
+ agent?: string | undefined;
5759
+ paths?: string[] | undefined;
5760
+ maxMinutes?: number | undefined;
5761
+ maxCostPerIssue?: number | undefined;
5762
+ } | undefined;
5763
+ canary?: {
5764
+ enabled?: boolean | undefined;
5765
+ soakMinutes?: number | undefined;
5766
+ thresholds?: {
5767
+ maxRestarts?: number | undefined;
5768
+ maxCrashes?: number | undefined;
5769
+ maxFailedTasks?: number | undefined;
5770
+ maxErrorRateIncrease?: number | undefined;
5771
+ minTasksForRate?: number | undefined;
5772
+ } | undefined;
5773
+ } | undefined;
5774
+ reviewGate?: {
5775
+ enabled?: boolean | undefined;
5776
+ mode?: "required" | "advisory" | undefined;
5777
+ reviewer?: {
5778
+ model?: string | undefined;
5779
+ agent?: string | undefined;
5780
+ } | undefined;
5781
+ paths?: string[] | undefined;
5782
+ maxCostPerReview?: number | undefined;
5783
+ maxMinutes?: number | undefined;
5784
+ maxReviewsPerPrPerDay?: number | undefined;
5785
+ ciWaitMinutes?: number | undefined;
5786
+ maxDiffKb?: number | undefined;
5787
+ } | undefined;
5788
+ }>>;
5568
5789
  /** How a daemon stop treats runs still in flight. */
5569
5790
  shutdown: z.ZodDefault<z.ZodObject<{
5570
5791
  /** Wait this long for runs to finish before cutting them off (they are
@@ -5762,6 +5983,94 @@ declare const daemonConfigSchema: z.ZodObject<{
5762
5983
  disabledAgents?: string[] | undefined;
5763
5984
  } | undefined;
5764
5985
  }>>;
5986
+ /** Task watchers (src/watchers, #1030): every task start decides whether
5987
+ * the task needs a watcher and attaches one. Off by default. */
5988
+ watchers: z.ZodEffects<z.ZodDefault<z.ZodObject<{
5989
+ enabled: z.ZodDefault<z.ZodBoolean>;
5990
+ /** Channels whose runs are never checked (the watchers' own alert turns
5991
+ * never are). */
5992
+ skipChannels: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
5993
+ /** The due time of a task that gives none, from its start. */
5994
+ defaultDueMinutes: z.ZodDefault<z.ZodNumber>;
5995
+ /** A seat probability below this is a confident "no". Only an active
5996
+ * seat skips the watcher on it. */
5997
+ noBelow: z.ZodDefault<z.ZodNumber>;
5998
+ /** At or above: "yes". Between `noBelow` and this: "uncertain", which
5999
+ * attaches a watcher (fail-safe). */
6000
+ yesAt: z.ZodDefault<z.ZodNumber>;
6001
+ /** After the delegating agent is told, the owner is told this much later
6002
+ * if the task is still not done. */
6003
+ escalateAfterMinutes: z.ZodDefault<z.ZodNumber>;
6004
+ /** Where the owner is told. Unset: the default notification channel. */
6005
+ owner: z.ZodDefault<z.ZodObject<{
6006
+ channel: z.ZodOptional<z.ZodString>;
6007
+ chatId: z.ZodOptional<z.ZodString>;
6008
+ }, "strip", z.ZodTypeAny, {
6009
+ channel?: string | undefined;
6010
+ chatId?: string | undefined;
6011
+ }, {
6012
+ channel?: string | undefined;
6013
+ chatId?: string | undefined;
6014
+ }>>;
6015
+ /** Finished watchers are deleted after this many days. */
6016
+ retentionDays: z.ZodDefault<z.ZodNumber>;
6017
+ /** What closes a watcher. "result": the run ends with a reply, or the
6018
+ * delegation answers. "explicit": only POST /watchers/:id/done, so a
6019
+ * reply that only promises ("I'll publish at 18:00") keeps it open. */
6020
+ doneSignal: z.ZodDefault<z.ZodEnum<["result", "explicit"]>>;
6021
+ }, "strip", z.ZodTypeAny, {
6022
+ enabled: boolean;
6023
+ owner: {
6024
+ channel?: string | undefined;
6025
+ chatId?: string | undefined;
6026
+ };
6027
+ retentionDays: number;
6028
+ skipChannels: string[];
6029
+ defaultDueMinutes: number;
6030
+ noBelow: number;
6031
+ yesAt: number;
6032
+ escalateAfterMinutes: number;
6033
+ doneSignal: "result" | "explicit";
6034
+ }, {
6035
+ enabled?: boolean | undefined;
6036
+ owner?: {
6037
+ channel?: string | undefined;
6038
+ chatId?: string | undefined;
6039
+ } | undefined;
6040
+ retentionDays?: number | undefined;
6041
+ skipChannels?: string[] | undefined;
6042
+ defaultDueMinutes?: number | undefined;
6043
+ noBelow?: number | undefined;
6044
+ yesAt?: number | undefined;
6045
+ escalateAfterMinutes?: number | undefined;
6046
+ doneSignal?: "result" | "explicit" | undefined;
6047
+ }>>, {
6048
+ enabled: boolean;
6049
+ owner: {
6050
+ channel?: string | undefined;
6051
+ chatId?: string | undefined;
6052
+ };
6053
+ retentionDays: number;
6054
+ skipChannels: string[];
6055
+ defaultDueMinutes: number;
6056
+ noBelow: number;
6057
+ yesAt: number;
6058
+ escalateAfterMinutes: number;
6059
+ doneSignal: "result" | "explicit";
6060
+ }, {
6061
+ enabled?: boolean | undefined;
6062
+ owner?: {
6063
+ channel?: string | undefined;
6064
+ chatId?: string | undefined;
6065
+ } | undefined;
6066
+ retentionDays?: number | undefined;
6067
+ skipChannels?: string[] | undefined;
6068
+ defaultDueMinutes?: number | undefined;
6069
+ noBelow?: number | undefined;
6070
+ yesAt?: number | undefined;
6071
+ escalateAfterMinutes?: number | undefined;
6072
+ doneSignal?: "result" | "explicit" | undefined;
6073
+ } | undefined>;
5765
6074
  people: z.ZodEffects<z.ZodDefault<z.ZodArray<z.ZodObject<{
5766
6075
  id: z.ZodString;
5767
6076
  name: z.ZodString;
@@ -8760,6 +9069,41 @@ declare const daemonConfigSchema: z.ZodObject<{
8760
9069
  };
8761
9070
  forwardTo?: string | undefined;
8762
9071
  };
9072
+ quality: {
9073
+ specTests: {
9074
+ enabled: boolean;
9075
+ agent: string;
9076
+ paths: string[];
9077
+ maxMinutes: number;
9078
+ maxCostPerIssue: number;
9079
+ model?: string | undefined;
9080
+ };
9081
+ canary: {
9082
+ enabled: boolean;
9083
+ soakMinutes: number;
9084
+ thresholds: {
9085
+ maxRestarts: number;
9086
+ maxCrashes: number;
9087
+ maxFailedTasks: number;
9088
+ maxErrorRateIncrease: number;
9089
+ minTasksForRate: number;
9090
+ };
9091
+ };
9092
+ reviewGate: {
9093
+ enabled: boolean;
9094
+ mode: "required" | "advisory";
9095
+ reviewer: {
9096
+ model?: string | undefined;
9097
+ agent?: string | undefined;
9098
+ };
9099
+ paths: string[];
9100
+ maxCostPerReview: number;
9101
+ maxMinutes: number;
9102
+ maxReviewsPerPrPerDay: number;
9103
+ ciWaitMinutes: number;
9104
+ maxDiffKb: number;
9105
+ };
9106
+ };
8763
9107
  shutdown: {
8764
9108
  restart: {
8765
9109
  windowWaitMinutes: number;
@@ -8776,6 +9120,20 @@ declare const daemonConfigSchema: z.ZodObject<{
8776
9120
  allowPeers: string[];
8777
9121
  maxPerRoot: number;
8778
9122
  };
9123
+ watchers: {
9124
+ enabled: boolean;
9125
+ owner: {
9126
+ channel?: string | undefined;
9127
+ chatId?: string | undefined;
9128
+ };
9129
+ retentionDays: number;
9130
+ skipChannels: string[];
9131
+ defaultDueMinutes: number;
9132
+ noBelow: number;
9133
+ yesAt: number;
9134
+ escalateAfterMinutes: number;
9135
+ doneSignal: "result" | "explicit";
9136
+ };
8779
9137
  people: {
8780
9138
  agents: string[];
8781
9139
  id: string;
@@ -9800,6 +10158,41 @@ declare const daemonConfigSchema: z.ZodObject<{
9800
10158
  composeTimeoutSeconds?: number | undefined;
9801
10159
  } | undefined;
9802
10160
  } | undefined;
10161
+ quality?: {
10162
+ specTests?: {
10163
+ model?: string | undefined;
10164
+ enabled?: boolean | undefined;
10165
+ agent?: string | undefined;
10166
+ paths?: string[] | undefined;
10167
+ maxMinutes?: number | undefined;
10168
+ maxCostPerIssue?: number | undefined;
10169
+ } | undefined;
10170
+ canary?: {
10171
+ enabled?: boolean | undefined;
10172
+ soakMinutes?: number | undefined;
10173
+ thresholds?: {
10174
+ maxRestarts?: number | undefined;
10175
+ maxCrashes?: number | undefined;
10176
+ maxFailedTasks?: number | undefined;
10177
+ maxErrorRateIncrease?: number | undefined;
10178
+ minTasksForRate?: number | undefined;
10179
+ } | undefined;
10180
+ } | undefined;
10181
+ reviewGate?: {
10182
+ enabled?: boolean | undefined;
10183
+ mode?: "required" | "advisory" | undefined;
10184
+ reviewer?: {
10185
+ model?: string | undefined;
10186
+ agent?: string | undefined;
10187
+ } | undefined;
10188
+ paths?: string[] | undefined;
10189
+ maxCostPerReview?: number | undefined;
10190
+ maxMinutes?: number | undefined;
10191
+ maxReviewsPerPrPerDay?: number | undefined;
10192
+ ciWaitMinutes?: number | undefined;
10193
+ maxDiffKb?: number | undefined;
10194
+ } | undefined;
10195
+ } | undefined;
9803
10196
  shutdown?: {
9804
10197
  restart?: {
9805
10198
  allowBy?: string | undefined;
@@ -9816,6 +10209,20 @@ declare const daemonConfigSchema: z.ZodObject<{
9816
10209
  allowPeers?: string[] | undefined;
9817
10210
  maxPerRoot?: number | undefined;
9818
10211
  } | undefined;
10212
+ watchers?: {
10213
+ enabled?: boolean | undefined;
10214
+ owner?: {
10215
+ channel?: string | undefined;
10216
+ chatId?: string | undefined;
10217
+ } | undefined;
10218
+ retentionDays?: number | undefined;
10219
+ skipChannels?: string[] | undefined;
10220
+ defaultDueMinutes?: number | undefined;
10221
+ noBelow?: number | undefined;
10222
+ yesAt?: number | undefined;
10223
+ escalateAfterMinutes?: number | undefined;
10224
+ doneSignal?: "result" | "explicit" | undefined;
10225
+ } | undefined;
9819
10226
  people?: {
9820
10227
  id: string;
9821
10228
  name: string;
@@ -10449,6 +10856,9 @@ interface AgentXEvents {
10449
10856
  * node's own surfaces (requests/operator): it started the turn itself,
10450
10857
  * or the /task caller showed the operator key (#393). */
10451
10858
  operator?: boolean;
10859
+ /** When the task is due (ms), when the caller gave one in the run's
10860
+ * context as `dueAt` (watchers, #1030). */
10861
+ dueAt?: number;
10452
10862
  };
10453
10863
  /** A single step inside an in-flight task — typically a tool call or
10454
10864
  * tool result inside the Claude streaming response. Producer is the
@@ -10743,6 +11153,10 @@ declare class AgentXDaemon {
10743
11153
  private taskRunPrune?;
10744
11154
  private webhooks;
10745
11155
  private github?;
11156
+ /** Pre-merge review gate (#990). Built with the GitHub channel; does
11157
+ * nothing while quality.reviewGate.enabled is false. */
11158
+ private reviewGate?;
11159
+ private reviewLedger;
10746
11160
  private webrtc?;
10747
11161
  private botManager?;
10748
11162
  /** Agents watching the phone camera (#325); needs channels.webrtc. */
@@ -10801,6 +11215,10 @@ declare class AgentXDaemon {
10801
11215
  constructor(configPath?: string);
10802
11216
  start(): Promise<void>;
10803
11217
  stop(): Promise<void>;
11218
+ /** The review gate (#990): the reviewer runs as its own agent in a fresh
11219
+ * session keyed by the reviewed commit, so it never resumes the
11220
+ * author's conversation or an earlier review. */
11221
+ private buildReviewGate;
10804
11222
  /** Deliver a notice to the owner through the channel router: the
10805
11223
  * address it was given, else notifications.channel (push or ntfy). */
10806
11224
  private ownerSender;
@@ -10878,6 +11296,9 @@ declare class AgentXDaemon {
10878
11296
  * is the owner's (requests/operator, #393). */
10879
11297
  private operatorKey;
10880
11298
  private requestsSweeping;
11299
+ /** Task watchers (src/watchers, #1030). */
11300
+ private watchers;
11301
+ private watchersSweeping;
10881
11302
  private status;
10882
11303
  /** Send a status-comment edit to the peer that holds the agent's token. */
10883
11304
  private forwardCommentEdit;
@@ -10924,6 +11345,8 @@ declare class AgentXDaemon {
10924
11345
  * closed ones are deleted (src/requests/sweep.ts). Plans first: a
10925
11346
  * blocked step marks its request told, so the owner hears once. */
10926
11347
  private sweepRequests;
11348
+ /** The watcher checkpoint at every task start (src/watchers, #1030). */
11349
+ private attachTaskWatchers;
10927
11350
  /** Tell the owner through the notify path: a push to the default
10928
11351
  * channel, the Mac banner where there is one (#788). */
10929
11352
  private notifyOwner;
@@ -11632,6 +12055,13 @@ interface AgentTask {
11632
12055
  * that pattern without requiring callers to invent unique
11633
12056
  * chatIds. */
11634
12057
  freshSession?: boolean;
12058
+ /** A run that must see only its own message (the review gate, #990).
12059
+ * The registry pushes nothing from the agent's other chats, its memory,
12060
+ * wiki, patterns or landscape; a claude-code run starts with no MCP
12061
+ * server, no built-in tool and Claude Code's auto-memory off; and the
12062
+ * run is held at autonomy `report`, so a tier or peer that cannot
12063
+ * enforce that refuses it instead of running it with its usual tools. */
12064
+ isolated?: boolean;
11635
12065
  /** Transcript held by a client that owns the conversation (OpenCode).
11636
12066
  * Seeds an empty AgentX session the same way a channel adapter's
11637
12067
  * seedHistory does, so a new or rotated session starts with it. */
@@ -15012,6 +15442,8 @@ declare class AgentRegistry {
15012
15442
  /** Claude cloud sessions this node launched (#622), by issue. Created on
15013
15443
  * first use so a fleet with the setting off never touches the file. */
15014
15444
  private cloudSessions?;
15445
+ /** Spec-test runs (#992), one per issue. Created on first use. */
15446
+ private specTests?;
15015
15447
  /** The context each running task was started with, by RunningTask id.
15016
15448
  * Kept apart from RunningTask because /agents serialises that, and a
15017
15449
  * context can carry a whole conversation history. Read by A2A
@@ -15149,6 +15581,15 @@ declare class AgentRegistry {
15149
15581
  * it on the trace. Null means: run locally, the reason is logged and on
15150
15582
  * the trace. */
15151
15583
  private runCloudSession;
15584
+ private specTestSettings;
15585
+ private specTestStore;
15586
+ /** The spec-test input for a new cloud session on an issue (#992), or
15587
+ * null when the test agent does not run (the reason is logged unless the
15588
+ * setting is off). Reads the whole issue with `gh`: the channel's task
15589
+ * text carries only its first 500 characters. */
15590
+ private planSpecTests;
15591
+ /** Runs the test agent in the background, beside the coding session. */
15592
+ private startSpecTests;
15152
15593
  /** The answer for a run whose HTTP caller left before it got a slot
15153
15594
  * (#822). Logged so the dropped request is visible on the node. */
15154
15595
  private callerGone;
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-65LN6GQP.js";import"./chunk-4LNJR5PC.js";import"./chunk-GTJIKXDB.js";import"./chunk-J7U3BASX.js";import"./chunk-S2GAEH2F.js";import"./chunk-7LN4VKDU.js";import"./chunk-IMLAPB7G.js";import"./chunk-ZVP6GB4G.js";import"./chunk-MRIVENBY.js";import"./chunk-UNIXYV3U.js";import"./chunk-AKWBDCMU.js";import"./chunk-PPUN7YHA.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-Z5IHT6RK.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-2D3RYIDU.js";import"./chunk-Y4CYQV7G.js";import"./chunk-3W2BHUGM.js";import"./chunk-SHEUCITK.js";import"./chunk-A5GYG56I.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-LGB6ILTW.js";import"./chunk-HWYU6XG2.js";import"./chunk-QSKG754X.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-BUKXFZEO.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-6TTGRTDO.js";import"./chunk-ANDEMOYE.js";import"./chunk-SZDACK6O.js";import"./chunk-VE3SSOQX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import{s as ut}from"./chunk-JS2LEURJ.js";import"./chunk-NMYPZR4W.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-AXHP6TMT.js";import{a as ht}from"./chunk-STIZFWDJ.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-HXLB2XCT.js";import"./chunk-SKSYII3K.js";import{f as gt,g as ft}from"./chunk-7KAQHNLT.js";import"./chunk-WPNRDEHW.js";import"./chunk-MWNCS57L.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-JJZVFDG6.js";import{j as it,k as rt,l as at}from"./chunk-LMZCB7TT.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{Aa as nt,qa as tt,sa as st,ta as ot}from"./chunk-MGM33GOW.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{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-L7OTWV5X.js";import"./chunk-HYOXWAQP.js";import"./chunk-GTJIKXDB.js";import"./chunk-6MARQ33D.js";import"./chunk-S2GAEH2F.js";import"./chunk-7LN4VKDU.js";import"./chunk-IMLAPB7G.js";import"./chunk-ZVP6GB4G.js";import"./chunk-MRIVENBY.js";import"./chunk-UNIXYV3U.js";import"./chunk-AKWBDCMU.js";import"./chunk-PPUN7YHA.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-YDPXS6T4.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-2D3RYIDU.js";import"./chunk-Y4CYQV7G.js";import"./chunk-3W2BHUGM.js";import"./chunk-SHEUCITK.js";import"./chunk-A5GYG56I.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import{m as lt,n as ct,na as yt,o as dt,p as mt,q as pt}from"./chunk-CELYB3UW.js";import"./chunk-I6P3BKWJ.js";import"./chunk-QSKG754X.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-S5DS2V3X.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-6TTGRTDO.js";import"./chunk-OW2AND54.js";import"./chunk-SZDACK6O.js";import"./chunk-VE3SSOQX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import{s as ut}from"./chunk-6DZSDM35.js";import"./chunk-VJC372D6.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-W4JLZJHU.js";import{a as ht}from"./chunk-COWWOA7H.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-T7LDVJMP.js";import"./chunk-SKSYII3K.js";import{f as gt,g as ft}from"./chunk-UJRJUSDY.js";import"./chunk-WPNRDEHW.js";import"./chunk-MWNCS57L.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-LYSCMFAM.js";import{j as it,k as rt,l as at}from"./chunk-MSRFTAWH.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{Ca as nt,sa as tt,ua as st,va as ot}from"./chunk-HW5FTKTU.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).