agentix-cli 0.211.1 → 0.213.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 (147) hide show
  1. package/dist/{App-RIXKQIO7.js → App-5CLRBC3C.js} +2 -2
  2. package/dist/{ChatApp-2TKXDJGQ.js → ChatApp-LDNQVD2C.js} +2 -2
  3. package/dist/{absorb-eval-5YZOYFF4.js → absorb-eval-JWQPGUJS.js} +2 -2
  4. package/dist/{adapter-Q76GO2I7.js → adapter-AOKK2LFM.js} +2 -2
  5. package/dist/{agent-GW6Z6OFF.js → agent-TF6XQQGV.js} +2 -2
  6. package/dist/{board-dashboard-RPZJBHL3.js → board-dashboard-LDMIS7MM.js} +4 -4
  7. package/dist/{chunk-6BINQY52.js → chunk-36RIIHPS.js} +106 -105
  8. package/dist/chunk-36RIIHPS.js.map +1 -0
  9. package/dist/{chunk-Y65DB3PF.js → chunk-4W5KRZTT.js} +2 -2
  10. package/dist/chunk-7JWMLYOA.js +115 -0
  11. package/dist/chunk-7JWMLYOA.js.map +1 -0
  12. package/dist/{chunk-BQIZN5JU.js → chunk-BERSMN6Y.js} +2 -2
  13. package/dist/{chunk-FLNSBODK.js → chunk-BU6V75KD.js} +2 -2
  14. package/dist/{chunk-FLDMRYZD.js → chunk-CUCIMPFI.js} +2 -2
  15. package/dist/{chunk-YZD6EZMU.js → chunk-D3FIIEDR.js} +2 -2
  16. package/dist/{chunk-QQKPZKQT.js → chunk-D6H4DH32.js} +2 -2
  17. package/dist/{chunk-6VHORIGB.js → chunk-DGCYMSXU.js} +2 -2
  18. package/dist/{chunk-XWOXXVVX.js → chunk-DNPPPUDP.js} +2 -2
  19. package/dist/{chunk-323KMXT4.js → chunk-DPA3IOMU.js} +2 -2
  20. package/dist/{chunk-ZWO36TCN.js → chunk-DSUL5L3T.js} +2 -2
  21. package/dist/{chunk-W4K3DFAX.js → chunk-EE5RZDQE.js} +2 -2
  22. package/dist/{chunk-JJC2HBWC.js → chunk-ERKK22QV.js} +2 -2
  23. package/dist/{chunk-MHRVTFLZ.js → chunk-FCF47R4W.js} +3 -3
  24. package/dist/{chunk-Y4BNOZWQ.js → chunk-G3GFE3GK.js} +2 -2
  25. package/dist/{chunk-OAVJMZLF.js → chunk-I722PWJE.js} +2 -2
  26. package/dist/{chunk-LYY7G6LO.js → chunk-IXV3BPUZ.js} +2 -2
  27. package/dist/{chunk-XWMHNDED.js → chunk-KU3ZF3WO.js} +2 -2
  28. package/dist/{chunk-F3HVONL6.js → chunk-MOATCFT5.js} +2 -2
  29. package/dist/{chunk-MKQI5WL2.js → chunk-N7IX77SL.js} +2 -2
  30. package/dist/{chunk-UYG7UOVQ.js → chunk-NWE3B245.js} +8 -8
  31. package/dist/chunk-NWE3B245.js.map +1 -0
  32. package/dist/{chunk-2FXHWT5U.js → chunk-NZFWW2YG.js} +270 -270
  33. package/dist/chunk-NZFWW2YG.js.map +1 -0
  34. package/dist/{chunk-WNE4GRXY.js → chunk-O4WFPH6H.js} +2 -2
  35. package/dist/{chunk-GUID2ZA2.js → chunk-UWDDVDU6.js} +21 -21
  36. package/dist/{chunk-GUID2ZA2.js.map → chunk-UWDDVDU6.js.map} +1 -1
  37. package/dist/{chunk-ISRY3GAD.js → chunk-VKLTCUD7.js} +2 -2
  38. package/dist/{chunk-EPIKS3WL.js → chunk-WKBGQGVL.js} +2 -2
  39. package/dist/{chunk-CUX7BF7B.js → chunk-X7UEV4O2.js} +2 -2
  40. package/dist/{chunk-PYTNMX2D.js → chunk-XBFXSSHA.js} +2 -2
  41. package/dist/{chunk-YRBJ4KB7.js → chunk-Z6N7POAU.js} +2 -2
  42. package/dist/cli.js +1 -1
  43. package/dist/{client-AIQ7D7VU.js → client-2TFSAO3Y.js} +2 -2
  44. package/dist/config-LTXRWDRK.js +2 -0
  45. package/dist/{config-mutate-XUBGMDIU.js → config-mutate-UFVJUJQO.js} +2 -2
  46. package/dist/{config-mutator-G62RKREK.js → config-mutator-RRKU33OL.js} +2 -2
  47. package/dist/{contributions-RQZO4V36.js → contributions-5XUEOSLT.js} +2 -2
  48. package/dist/{doctor-DVMX6632.js → doctor-L675OBBF.js} +2 -2
  49. package/dist/{follow-up-tool-MS4FSM2J.js → follow-up-tool-2OEZMPPQ.js} +2 -2
  50. package/dist/{hub-RKX3L5LU.js → hub-VJZYQXKB.js} +2 -2
  51. package/dist/index.d.ts +307 -208
  52. package/dist/index.js +1 -1
  53. package/dist/{org-tool-NA6U3IJJ.js → org-tool-QBLKCMY3.js} +2 -2
  54. package/dist/program-4WR4ZYXQ.js +928 -0
  55. package/dist/program-4WR4ZYXQ.js.map +1 -0
  56. package/dist/{promote-OV2OD55V.js → promote-Z6KL6GOL.js} +2 -2
  57. package/dist/{query-6FK2A4K2.js → query-SZA6UMHA.js} +2 -2
  58. package/dist/{query-settings-RE2BTERX.js → query-settings-BALRO5J4.js} +2 -2
  59. package/dist/{registry-APVJFCDJ.js → registry-LD2IYY7L.js} +2 -2
  60. package/dist/{request-planner-23FPTJLW.js → request-planner-Y5HG5DQ4.js} +2 -2
  61. package/dist/{review-candidates-FCRNGU2S.js → review-candidates-BZJOFMFO.js} +2 -2
  62. package/dist/{routing-W7AOH7QM.js → routing-3JDN3Z6L.js} +2 -2
  63. package/dist/schedule-tool-VM5OJ7XB.js +2 -0
  64. package/dist/{scheduler-3CJD7UF4.js → scheduler-JJOO2ODF.js} +2 -2
  65. package/dist/{seat-BIVMGYMR.js → seat-5FTOWN5J.js} +2 -2
  66. package/dist/{select-LWTPLTCE.js → select-BRQQP7OP.js} +2 -2
  67. package/dist/{set-enabled-OKG7Q5WY.js → set-enabled-EZLQFASM.js} +2 -2
  68. package/dist/{sprint-tool-YLQADXQH.js → sprint-tool-YJ4WT3AD.js} +2 -2
  69. package/dist/{tool-YCCQX7BT.js → tool-BFKCGAD6.js} +2 -2
  70. package/dist/{tool-ZXIRHFRB.js → tool-CXJHLIHJ.js} +2 -2
  71. package/dist/{tool-XZU2IJUI.js → tool-MT5YQ7F3.js} +2 -2
  72. package/dist/{tool-5T5SSYMB.js → tool-RCEOKPES.js} +2 -2
  73. package/dist/{wiki-2BVHRZX5.js → wiki-F3LZSBN3.js} +2 -2
  74. package/dist/wiki-enrich-KIONW7SB.js +2 -0
  75. package/dist/workspace-setup-VLLF37SJ.js +2 -0
  76. package/package.json +1 -1
  77. package/dist/chunk-2FXHWT5U.js.map +0 -1
  78. package/dist/chunk-3AHYZLGE.js +0 -115
  79. package/dist/chunk-3AHYZLGE.js.map +0 -1
  80. package/dist/chunk-6BINQY52.js.map +0 -1
  81. package/dist/chunk-UYG7UOVQ.js.map +0 -1
  82. package/dist/config-TSSRDRCK.js +0 -2
  83. package/dist/program-YIX4NQZV.js +0 -901
  84. package/dist/program-YIX4NQZV.js.map +0 -1
  85. package/dist/schedule-tool-RXX26TI4.js +0 -2
  86. package/dist/wiki-enrich-BHPD4BOV.js +0 -2
  87. package/dist/workspace-setup-GTSXWYU4.js +0 -2
  88. /package/dist/{App-RIXKQIO7.js.map → App-5CLRBC3C.js.map} +0 -0
  89. /package/dist/{ChatApp-2TKXDJGQ.js.map → ChatApp-LDNQVD2C.js.map} +0 -0
  90. /package/dist/{absorb-eval-5YZOYFF4.js.map → absorb-eval-JWQPGUJS.js.map} +0 -0
  91. /package/dist/{adapter-Q76GO2I7.js.map → adapter-AOKK2LFM.js.map} +0 -0
  92. /package/dist/{agent-GW6Z6OFF.js.map → agent-TF6XQQGV.js.map} +0 -0
  93. /package/dist/{board-dashboard-RPZJBHL3.js.map → board-dashboard-LDMIS7MM.js.map} +0 -0
  94. /package/dist/{chunk-Y65DB3PF.js.map → chunk-4W5KRZTT.js.map} +0 -0
  95. /package/dist/{chunk-BQIZN5JU.js.map → chunk-BERSMN6Y.js.map} +0 -0
  96. /package/dist/{chunk-FLNSBODK.js.map → chunk-BU6V75KD.js.map} +0 -0
  97. /package/dist/{chunk-FLDMRYZD.js.map → chunk-CUCIMPFI.js.map} +0 -0
  98. /package/dist/{chunk-YZD6EZMU.js.map → chunk-D3FIIEDR.js.map} +0 -0
  99. /package/dist/{chunk-QQKPZKQT.js.map → chunk-D6H4DH32.js.map} +0 -0
  100. /package/dist/{chunk-6VHORIGB.js.map → chunk-DGCYMSXU.js.map} +0 -0
  101. /package/dist/{chunk-XWOXXVVX.js.map → chunk-DNPPPUDP.js.map} +0 -0
  102. /package/dist/{chunk-323KMXT4.js.map → chunk-DPA3IOMU.js.map} +0 -0
  103. /package/dist/{chunk-ZWO36TCN.js.map → chunk-DSUL5L3T.js.map} +0 -0
  104. /package/dist/{chunk-W4K3DFAX.js.map → chunk-EE5RZDQE.js.map} +0 -0
  105. /package/dist/{chunk-JJC2HBWC.js.map → chunk-ERKK22QV.js.map} +0 -0
  106. /package/dist/{chunk-MHRVTFLZ.js.map → chunk-FCF47R4W.js.map} +0 -0
  107. /package/dist/{chunk-Y4BNOZWQ.js.map → chunk-G3GFE3GK.js.map} +0 -0
  108. /package/dist/{chunk-OAVJMZLF.js.map → chunk-I722PWJE.js.map} +0 -0
  109. /package/dist/{chunk-LYY7G6LO.js.map → chunk-IXV3BPUZ.js.map} +0 -0
  110. /package/dist/{chunk-XWMHNDED.js.map → chunk-KU3ZF3WO.js.map} +0 -0
  111. /package/dist/{chunk-F3HVONL6.js.map → chunk-MOATCFT5.js.map} +0 -0
  112. /package/dist/{chunk-MKQI5WL2.js.map → chunk-N7IX77SL.js.map} +0 -0
  113. /package/dist/{chunk-WNE4GRXY.js.map → chunk-O4WFPH6H.js.map} +0 -0
  114. /package/dist/{chunk-ISRY3GAD.js.map → chunk-VKLTCUD7.js.map} +0 -0
  115. /package/dist/{chunk-EPIKS3WL.js.map → chunk-WKBGQGVL.js.map} +0 -0
  116. /package/dist/{chunk-CUX7BF7B.js.map → chunk-X7UEV4O2.js.map} +0 -0
  117. /package/dist/{chunk-PYTNMX2D.js.map → chunk-XBFXSSHA.js.map} +0 -0
  118. /package/dist/{chunk-YRBJ4KB7.js.map → chunk-Z6N7POAU.js.map} +0 -0
  119. /package/dist/{client-AIQ7D7VU.js.map → client-2TFSAO3Y.js.map} +0 -0
  120. /package/dist/{config-TSSRDRCK.js.map → config-LTXRWDRK.js.map} +0 -0
  121. /package/dist/{config-mutate-XUBGMDIU.js.map → config-mutate-UFVJUJQO.js.map} +0 -0
  122. /package/dist/{config-mutator-G62RKREK.js.map → config-mutator-RRKU33OL.js.map} +0 -0
  123. /package/dist/{contributions-RQZO4V36.js.map → contributions-5XUEOSLT.js.map} +0 -0
  124. /package/dist/{doctor-DVMX6632.js.map → doctor-L675OBBF.js.map} +0 -0
  125. /package/dist/{follow-up-tool-MS4FSM2J.js.map → follow-up-tool-2OEZMPPQ.js.map} +0 -0
  126. /package/dist/{hub-RKX3L5LU.js.map → hub-VJZYQXKB.js.map} +0 -0
  127. /package/dist/{org-tool-NA6U3IJJ.js.map → org-tool-QBLKCMY3.js.map} +0 -0
  128. /package/dist/{promote-OV2OD55V.js.map → promote-Z6KL6GOL.js.map} +0 -0
  129. /package/dist/{query-6FK2A4K2.js.map → query-SZA6UMHA.js.map} +0 -0
  130. /package/dist/{query-settings-RE2BTERX.js.map → query-settings-BALRO5J4.js.map} +0 -0
  131. /package/dist/{registry-APVJFCDJ.js.map → registry-LD2IYY7L.js.map} +0 -0
  132. /package/dist/{request-planner-23FPTJLW.js.map → request-planner-Y5HG5DQ4.js.map} +0 -0
  133. /package/dist/{review-candidates-FCRNGU2S.js.map → review-candidates-BZJOFMFO.js.map} +0 -0
  134. /package/dist/{routing-W7AOH7QM.js.map → routing-3JDN3Z6L.js.map} +0 -0
  135. /package/dist/{schedule-tool-RXX26TI4.js.map → schedule-tool-VM5OJ7XB.js.map} +0 -0
  136. /package/dist/{scheduler-3CJD7UF4.js.map → scheduler-JJOO2ODF.js.map} +0 -0
  137. /package/dist/{seat-BIVMGYMR.js.map → seat-5FTOWN5J.js.map} +0 -0
  138. /package/dist/{select-LWTPLTCE.js.map → select-BRQQP7OP.js.map} +0 -0
  139. /package/dist/{set-enabled-OKG7Q5WY.js.map → set-enabled-EZLQFASM.js.map} +0 -0
  140. /package/dist/{sprint-tool-YLQADXQH.js.map → sprint-tool-YJ4WT3AD.js.map} +0 -0
  141. /package/dist/{tool-YCCQX7BT.js.map → tool-BFKCGAD6.js.map} +0 -0
  142. /package/dist/{tool-ZXIRHFRB.js.map → tool-CXJHLIHJ.js.map} +0 -0
  143. /package/dist/{tool-XZU2IJUI.js.map → tool-MT5YQ7F3.js.map} +0 -0
  144. /package/dist/{tool-5T5SSYMB.js.map → tool-RCEOKPES.js.map} +0 -0
  145. /package/dist/{wiki-2BVHRZX5.js.map → wiki-F3LZSBN3.js.map} +0 -0
  146. /package/dist/{wiki-enrich-BHPD4BOV.js.map → wiki-enrich-KIONW7SB.js.map} +0 -0
  147. /package/dist/{workspace-setup-GTSXWYU4.js.map → workspace-setup-VLLF37SJ.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -8467,6 +8467,37 @@ declare const daemonConfigSchema: z.ZodObject<{
8467
8467
  until?: string | undefined;
8468
8468
  }[] | undefined;
8469
8469
  } | undefined>;
8470
+ /** Self-improvement from failure signals (src/improve, #1783). Model
8471
+ * calls off by default; daily dollar and card caps enforced in code. */
8472
+ improve: z.ZodDefault<z.ZodObject<{
8473
+ /** Let the nightly pass spend model calls: the merge of near-duplicate
8474
+ * groups and the retro on the worst group. Off: ranking only. */
8475
+ enabled: z.ZodDefault<z.ZodBoolean>;
8476
+ /** Dollars the self-improvement passes may spend in any 24 hours. A call
8477
+ * that would go past it is not started. */
8478
+ dailyUsd: z.ZodDefault<z.ZodNumber>;
8479
+ /** Retro cards the self-improvement pass may raise in any 24 hours. The
8480
+ * retro's own limit (3 a day, counting every retro card) holds too. */
8481
+ maxCardsPerDay: z.ZodDefault<z.ZodNumber>;
8482
+ /** The small model that merges near-duplicate groups, once a day. Empty:
8483
+ * no merge call. */
8484
+ mergeModel: z.ZodDefault<z.ZodString>;
8485
+ /** A group must come from at least this many separate requests,
8486
+ * hand-offs or runs to be ranked. */
8487
+ minRefs: z.ZodDefault<z.ZodNumber>;
8488
+ }, "strip", z.ZodTypeAny, {
8489
+ enabled: boolean;
8490
+ dailyUsd: number;
8491
+ maxCardsPerDay: number;
8492
+ mergeModel: string;
8493
+ minRefs: number;
8494
+ }, {
8495
+ enabled?: boolean | undefined;
8496
+ dailyUsd?: number | undefined;
8497
+ maxCardsPerDay?: number | undefined;
8498
+ mergeModel?: string | undefined;
8499
+ minRefs?: number | undefined;
8500
+ }>>;
8470
8501
  /** Hand due Apple Reminders back to the agent that created them
8471
8502
  * (src/reminders). macOS only; reads reminders whose notes end with the
8472
8503
  * mac-pim skill's `agentx: agent=<id>` trailer. */
@@ -11071,6 +11102,10 @@ declare const daemonConfigSchema: z.ZodObject<{
11071
11102
  * per REQUEST — 180K leaves headroom. NOT the cumulative turn total:
11072
11103
  * that sums cache reads across every call and reads 10-20× too high. */
11073
11104
  session: z.ZodDefault<z.ZodObject<{
11105
+ /** A message that arrives for an agent while it works in the same chat
11106
+ * is read by that run after its next tool call, as in interactive
11107
+ * Claude Code (src/agents/mid-turn.ts). claude-code agents only. */
11108
+ midTurnMessages: z.ZodDefault<z.ZodBoolean>;
11074
11109
  staleMinutes: z.ZodDefault<z.ZodNumber>;
11075
11110
  maxTurnsPerSession: z.ZodDefault<z.ZodNumber>;
11076
11111
  tierTwoThresholdTokens: z.ZodDefault<z.ZodNumber>;
@@ -11293,6 +11328,7 @@ declare const daemonConfigSchema: z.ZodObject<{
11293
11328
  }>>;
11294
11329
  }, "strip", z.ZodTypeAny, {
11295
11330
  contextStrategy: "layered" | "planner";
11331
+ midTurnMessages: boolean;
11296
11332
  staleMinutes: number;
11297
11333
  maxTurnsPerSession: number;
11298
11334
  tierTwoThresholdTokens: number;
@@ -11335,6 +11371,7 @@ declare const daemonConfigSchema: z.ZodObject<{
11335
11371
  maxClaudeCodeDispatchesPer5h?: number | undefined;
11336
11372
  }, {
11337
11373
  contextStrategy?: "layered" | "planner" | undefined;
11374
+ midTurnMessages?: boolean | undefined;
11338
11375
  staleMinutes?: number | undefined;
11339
11376
  maxTurnsPerSession?: number | undefined;
11340
11377
  tierTwoThresholdTokens?: number | undefined;
@@ -11590,6 +11627,110 @@ declare const daemonConfigSchema: z.ZodObject<{
11590
11627
  skipTypes: string[];
11591
11628
  };
11592
11629
  };
11630
+ requests: {
11631
+ enabled: boolean;
11632
+ from: string[];
11633
+ ownerCheck: {
11634
+ provider: string;
11635
+ model: string;
11636
+ enabled: boolean;
11637
+ timeoutSeconds: number;
11638
+ perCheck: number;
11639
+ maxAgeHours: number;
11640
+ };
11641
+ plans: {
11642
+ enabled: boolean;
11643
+ stallMinutes: number;
11644
+ maxNudges: number;
11645
+ approveKinds: string[];
11646
+ disabledAgents: string[];
11647
+ requireForWork: string[];
11648
+ requireOverMinutes: number;
11649
+ continue: {
11650
+ enabled: boolean;
11651
+ only: string[];
11652
+ maxTurnsPerDay: number;
11653
+ maxCostUsdPerDay: number;
11654
+ };
11655
+ };
11656
+ channels: string[];
11657
+ staleAfterHours: number;
11658
+ retentionDays: number;
11659
+ checkers: {
11660
+ enabled: ("reply" | "url" | "issue" | "git-ancestor")[];
11661
+ repos: Record<string, string>;
11662
+ checkEveryMinutes: number;
11663
+ gitlab?: {
11664
+ token?: string | undefined;
11665
+ url?: string | undefined;
11666
+ } | undefined;
11667
+ github?: {
11668
+ apiUrl: string;
11669
+ token?: string | undefined;
11670
+ } | undefined;
11671
+ };
11672
+ headlines: {
11673
+ provider: string;
11674
+ model: string;
11675
+ enabled: boolean;
11676
+ timeoutSeconds: number;
11677
+ };
11678
+ settleHandedBack: boolean;
11679
+ homeCloses: boolean;
11680
+ releaseOnOwnerTurn: boolean;
11681
+ statusDrift: {
11682
+ enabled: boolean;
11683
+ projects: {
11684
+ provider: "gitlab" | "github";
11685
+ project: string;
11686
+ live: string[];
11687
+ repo?: string | undefined;
11688
+ }[];
11689
+ labels: {
11690
+ done: string[];
11691
+ todo: string[];
11692
+ doing: string[];
11693
+ review: string[];
11694
+ };
11695
+ write: boolean;
11696
+ checkEveryMinutes: number;
11697
+ lookbackDays: number;
11698
+ liveField: string;
11699
+ doneNotLiveAfterHours: number;
11700
+ writeProjects: string[];
11701
+ };
11702
+ promises: {
11703
+ facts: boolean;
11704
+ watchers: boolean;
11705
+ requireProof: boolean;
11706
+ factTtlDays: number;
11707
+ cards: boolean;
11708
+ };
11709
+ catchPromises: {
11710
+ provider: string;
11711
+ model: string;
11712
+ enabled: boolean;
11713
+ dailyCap: number;
11714
+ waitingOwner: boolean;
11715
+ timeoutSeconds: number;
11716
+ };
11717
+ autoResend: {
11718
+ enabled: boolean;
11719
+ afterMinutes: number;
11720
+ holdMaxHours: number;
11721
+ };
11722
+ flow: {
11723
+ days: number;
11724
+ timeZone: string;
11725
+ };
11726
+ sprints: {
11727
+ enabled: boolean;
11728
+ idleMinutes: number;
11729
+ };
11730
+ };
11731
+ events: {
11732
+ ringSize: number;
11733
+ };
11593
11734
  people: {
11594
11735
  agents: string[];
11595
11736
  id: string;
@@ -11798,9 +11939,6 @@ declare const daemonConfigSchema: z.ZodObject<{
11798
11939
  token?: string | undefined;
11799
11940
  draftAgent?: string | undefined;
11800
11941
  };
11801
- events: {
11802
- ringSize: number;
11803
- };
11804
11942
  node: {
11805
11943
  id: string;
11806
11944
  name: string;
@@ -11843,107 +11981,6 @@ declare const daemonConfigSchema: z.ZodObject<{
11843
11981
  yesAt: number;
11844
11982
  doneSignal: "result" | "explicit";
11845
11983
  };
11846
- requests: {
11847
- enabled: boolean;
11848
- from: string[];
11849
- ownerCheck: {
11850
- provider: string;
11851
- model: string;
11852
- enabled: boolean;
11853
- timeoutSeconds: number;
11854
- perCheck: number;
11855
- maxAgeHours: number;
11856
- };
11857
- plans: {
11858
- enabled: boolean;
11859
- stallMinutes: number;
11860
- maxNudges: number;
11861
- approveKinds: string[];
11862
- disabledAgents: string[];
11863
- requireForWork: string[];
11864
- requireOverMinutes: number;
11865
- continue: {
11866
- enabled: boolean;
11867
- only: string[];
11868
- maxTurnsPerDay: number;
11869
- maxCostUsdPerDay: number;
11870
- };
11871
- };
11872
- channels: string[];
11873
- staleAfterHours: number;
11874
- retentionDays: number;
11875
- checkers: {
11876
- enabled: ("reply" | "url" | "issue" | "git-ancestor")[];
11877
- repos: Record<string, string>;
11878
- checkEveryMinutes: number;
11879
- gitlab?: {
11880
- token?: string | undefined;
11881
- url?: string | undefined;
11882
- } | undefined;
11883
- github?: {
11884
- apiUrl: string;
11885
- token?: string | undefined;
11886
- } | undefined;
11887
- };
11888
- headlines: {
11889
- provider: string;
11890
- model: string;
11891
- enabled: boolean;
11892
- timeoutSeconds: number;
11893
- };
11894
- settleHandedBack: boolean;
11895
- homeCloses: boolean;
11896
- releaseOnOwnerTurn: boolean;
11897
- statusDrift: {
11898
- enabled: boolean;
11899
- projects: {
11900
- provider: "gitlab" | "github";
11901
- project: string;
11902
- live: string[];
11903
- repo?: string | undefined;
11904
- }[];
11905
- labels: {
11906
- done: string[];
11907
- todo: string[];
11908
- doing: string[];
11909
- review: string[];
11910
- };
11911
- write: boolean;
11912
- checkEveryMinutes: number;
11913
- lookbackDays: number;
11914
- liveField: string;
11915
- doneNotLiveAfterHours: number;
11916
- writeProjects: string[];
11917
- };
11918
- promises: {
11919
- facts: boolean;
11920
- watchers: boolean;
11921
- requireProof: boolean;
11922
- factTtlDays: number;
11923
- cards: boolean;
11924
- };
11925
- catchPromises: {
11926
- provider: string;
11927
- model: string;
11928
- enabled: boolean;
11929
- dailyCap: number;
11930
- waitingOwner: boolean;
11931
- timeoutSeconds: number;
11932
- };
11933
- autoResend: {
11934
- enabled: boolean;
11935
- afterMinutes: number;
11936
- holdMaxHours: number;
11937
- };
11938
- flow: {
11939
- days: number;
11940
- timeZone: string;
11941
- };
11942
- sprints: {
11943
- enabled: boolean;
11944
- idleMinutes: number;
11945
- };
11946
- };
11947
11984
  approvals: {
11948
11985
  popup: {
11949
11986
  enabled: boolean;
@@ -12526,6 +12563,13 @@ declare const daemonConfigSchema: z.ZodObject<{
12526
12563
  timezone?: string | undefined;
12527
12564
  issue?: number | undefined;
12528
12565
  };
12566
+ improve: {
12567
+ enabled: boolean;
12568
+ dailyUsd: number;
12569
+ maxCardsPerDay: number;
12570
+ mergeModel: string;
12571
+ minRefs: number;
12572
+ };
12529
12573
  reminders: {
12530
12574
  enabled: boolean;
12531
12575
  command: string;
@@ -12693,6 +12737,7 @@ declare const daemonConfigSchema: z.ZodObject<{
12693
12737
  }[];
12694
12738
  session: {
12695
12739
  contextStrategy: "layered" | "planner";
12740
+ midTurnMessages: boolean;
12696
12741
  staleMinutes: number;
12697
12742
  maxTurnsPerSession: number;
12698
12743
  tierTwoThresholdTokens: number;
@@ -13012,6 +13057,110 @@ declare const daemonConfigSchema: z.ZodObject<{
13012
13057
  skipTypes?: string[] | undefined;
13013
13058
  } | undefined;
13014
13059
  } | undefined;
13060
+ requests?: {
13061
+ enabled?: boolean | undefined;
13062
+ from?: string[] | undefined;
13063
+ ownerCheck?: {
13064
+ provider?: string | undefined;
13065
+ model?: string | undefined;
13066
+ enabled?: boolean | undefined;
13067
+ timeoutSeconds?: number | undefined;
13068
+ perCheck?: number | undefined;
13069
+ maxAgeHours?: number | undefined;
13070
+ } | undefined;
13071
+ plans?: {
13072
+ enabled?: boolean | undefined;
13073
+ stallMinutes?: number | undefined;
13074
+ maxNudges?: number | undefined;
13075
+ approveKinds?: string[] | undefined;
13076
+ disabledAgents?: string[] | undefined;
13077
+ requireForWork?: string[] | undefined;
13078
+ requireOverMinutes?: number | undefined;
13079
+ continue?: {
13080
+ enabled?: boolean | undefined;
13081
+ only?: string[] | undefined;
13082
+ maxTurnsPerDay?: number | undefined;
13083
+ maxCostUsdPerDay?: number | undefined;
13084
+ } | undefined;
13085
+ } | undefined;
13086
+ channels?: string[] | undefined;
13087
+ staleAfterHours?: number | undefined;
13088
+ retentionDays?: number | undefined;
13089
+ checkers?: {
13090
+ enabled?: ("reply" | "url" | "issue" | "git-ancestor")[] | undefined;
13091
+ gitlab?: {
13092
+ token?: string | undefined;
13093
+ url?: string | undefined;
13094
+ } | undefined;
13095
+ repos?: Record<string, string> | undefined;
13096
+ github?: {
13097
+ token?: string | undefined;
13098
+ apiUrl?: string | undefined;
13099
+ } | undefined;
13100
+ checkEveryMinutes?: number | undefined;
13101
+ } | undefined;
13102
+ headlines?: {
13103
+ provider?: string | undefined;
13104
+ model?: string | undefined;
13105
+ enabled?: boolean | undefined;
13106
+ timeoutSeconds?: number | undefined;
13107
+ } | undefined;
13108
+ settleHandedBack?: boolean | undefined;
13109
+ homeCloses?: boolean | undefined;
13110
+ releaseOnOwnerTurn?: boolean | undefined;
13111
+ statusDrift?: {
13112
+ enabled?: boolean | undefined;
13113
+ projects?: {
13114
+ provider: "gitlab" | "github";
13115
+ project: string;
13116
+ repo?: string | undefined;
13117
+ live?: string[] | undefined;
13118
+ }[] | undefined;
13119
+ labels?: {
13120
+ done?: string[] | undefined;
13121
+ todo?: string[] | undefined;
13122
+ doing?: string[] | undefined;
13123
+ review?: string[] | undefined;
13124
+ } | undefined;
13125
+ write?: boolean | undefined;
13126
+ checkEveryMinutes?: number | undefined;
13127
+ lookbackDays?: number | undefined;
13128
+ liveField?: string | undefined;
13129
+ doneNotLiveAfterHours?: number | undefined;
13130
+ writeProjects?: string[] | undefined;
13131
+ } | undefined;
13132
+ promises?: {
13133
+ facts?: boolean | undefined;
13134
+ watchers?: boolean | undefined;
13135
+ requireProof?: boolean | undefined;
13136
+ factTtlDays?: number | undefined;
13137
+ cards?: boolean | undefined;
13138
+ } | undefined;
13139
+ catchPromises?: {
13140
+ provider?: string | undefined;
13141
+ model?: string | undefined;
13142
+ enabled?: boolean | undefined;
13143
+ dailyCap?: number | undefined;
13144
+ waitingOwner?: boolean | undefined;
13145
+ timeoutSeconds?: number | undefined;
13146
+ } | undefined;
13147
+ autoResend?: {
13148
+ enabled?: boolean | undefined;
13149
+ afterMinutes?: number | undefined;
13150
+ holdMaxHours?: number | undefined;
13151
+ } | undefined;
13152
+ flow?: {
13153
+ days?: number | undefined;
13154
+ timeZone?: string | undefined;
13155
+ } | undefined;
13156
+ sprints?: {
13157
+ enabled?: boolean | undefined;
13158
+ idleMinutes?: number | undefined;
13159
+ } | undefined;
13160
+ } | undefined;
13161
+ events?: {
13162
+ ringSize?: number | undefined;
13163
+ } | undefined;
13015
13164
  business?: {
13016
13165
  enabled?: boolean | undefined;
13017
13166
  orgChart?: Record<string, {
@@ -13309,9 +13458,6 @@ declare const daemonConfigSchema: z.ZodObject<{
13309
13458
  } | undefined;
13310
13459
  } | undefined;
13311
13460
  } | undefined;
13312
- events?: {
13313
- ringSize?: number | undefined;
13314
- } | undefined;
13315
13461
  native?: {
13316
13462
  notes?: {
13317
13463
  enabled?: boolean | undefined;
@@ -13347,107 +13493,6 @@ declare const daemonConfigSchema: z.ZodObject<{
13347
13493
  yesAt?: number | undefined;
13348
13494
  doneSignal?: "result" | "explicit" | undefined;
13349
13495
  } | undefined;
13350
- requests?: {
13351
- enabled?: boolean | undefined;
13352
- from?: string[] | undefined;
13353
- ownerCheck?: {
13354
- provider?: string | undefined;
13355
- model?: string | undefined;
13356
- enabled?: boolean | undefined;
13357
- timeoutSeconds?: number | undefined;
13358
- perCheck?: number | undefined;
13359
- maxAgeHours?: number | undefined;
13360
- } | undefined;
13361
- plans?: {
13362
- enabled?: boolean | undefined;
13363
- stallMinutes?: number | undefined;
13364
- maxNudges?: number | undefined;
13365
- approveKinds?: string[] | undefined;
13366
- disabledAgents?: string[] | undefined;
13367
- requireForWork?: string[] | undefined;
13368
- requireOverMinutes?: number | undefined;
13369
- continue?: {
13370
- enabled?: boolean | undefined;
13371
- only?: string[] | undefined;
13372
- maxTurnsPerDay?: number | undefined;
13373
- maxCostUsdPerDay?: number | undefined;
13374
- } | undefined;
13375
- } | undefined;
13376
- channels?: string[] | undefined;
13377
- staleAfterHours?: number | undefined;
13378
- retentionDays?: number | undefined;
13379
- checkers?: {
13380
- enabled?: ("reply" | "url" | "issue" | "git-ancestor")[] | undefined;
13381
- gitlab?: {
13382
- token?: string | undefined;
13383
- url?: string | undefined;
13384
- } | undefined;
13385
- repos?: Record<string, string> | undefined;
13386
- github?: {
13387
- token?: string | undefined;
13388
- apiUrl?: string | undefined;
13389
- } | undefined;
13390
- checkEveryMinutes?: number | undefined;
13391
- } | undefined;
13392
- headlines?: {
13393
- provider?: string | undefined;
13394
- model?: string | undefined;
13395
- enabled?: boolean | undefined;
13396
- timeoutSeconds?: number | undefined;
13397
- } | undefined;
13398
- settleHandedBack?: boolean | undefined;
13399
- homeCloses?: boolean | undefined;
13400
- releaseOnOwnerTurn?: boolean | undefined;
13401
- statusDrift?: {
13402
- enabled?: boolean | undefined;
13403
- projects?: {
13404
- provider: "gitlab" | "github";
13405
- project: string;
13406
- repo?: string | undefined;
13407
- live?: string[] | undefined;
13408
- }[] | undefined;
13409
- labels?: {
13410
- done?: string[] | undefined;
13411
- todo?: string[] | undefined;
13412
- doing?: string[] | undefined;
13413
- review?: string[] | undefined;
13414
- } | undefined;
13415
- write?: boolean | undefined;
13416
- checkEveryMinutes?: number | undefined;
13417
- lookbackDays?: number | undefined;
13418
- liveField?: string | undefined;
13419
- doneNotLiveAfterHours?: number | undefined;
13420
- writeProjects?: string[] | undefined;
13421
- } | undefined;
13422
- promises?: {
13423
- facts?: boolean | undefined;
13424
- watchers?: boolean | undefined;
13425
- requireProof?: boolean | undefined;
13426
- factTtlDays?: number | undefined;
13427
- cards?: boolean | undefined;
13428
- } | undefined;
13429
- catchPromises?: {
13430
- provider?: string | undefined;
13431
- model?: string | undefined;
13432
- enabled?: boolean | undefined;
13433
- dailyCap?: number | undefined;
13434
- waitingOwner?: boolean | undefined;
13435
- timeoutSeconds?: number | undefined;
13436
- } | undefined;
13437
- autoResend?: {
13438
- enabled?: boolean | undefined;
13439
- afterMinutes?: number | undefined;
13440
- holdMaxHours?: number | undefined;
13441
- } | undefined;
13442
- flow?: {
13443
- days?: number | undefined;
13444
- timeZone?: string | undefined;
13445
- } | undefined;
13446
- sprints?: {
13447
- enabled?: boolean | undefined;
13448
- idleMinutes?: number | undefined;
13449
- } | undefined;
13450
- } | undefined;
13451
13496
  approvals?: {
13452
13497
  popup?: {
13453
13498
  enabled?: boolean | undefined;
@@ -14030,6 +14075,13 @@ declare const daemonConfigSchema: z.ZodObject<{
14030
14075
  until?: string | undefined;
14031
14076
  }[] | undefined;
14032
14077
  } | undefined;
14078
+ improve?: {
14079
+ enabled?: boolean | undefined;
14080
+ dailyUsd?: number | undefined;
14081
+ maxCardsPerDay?: number | undefined;
14082
+ mergeModel?: string | undefined;
14083
+ minRefs?: number | undefined;
14084
+ } | undefined;
14033
14085
  reminders?: {
14034
14086
  enabled?: boolean | undefined;
14035
14087
  command?: string | undefined;
@@ -14197,6 +14249,7 @@ declare const daemonConfigSchema: z.ZodObject<{
14197
14249
  }[] | undefined;
14198
14250
  session?: {
14199
14251
  contextStrategy?: "layered" | "planner" | undefined;
14252
+ midTurnMessages?: boolean | undefined;
14200
14253
  staleMinutes?: number | undefined;
14201
14254
  maxTurnsPerSession?: number | undefined;
14202
14255
  tierTwoThresholdTokens?: number | undefined;
@@ -15714,6 +15767,38 @@ declare class TokenTracker {
15714
15767
  private save;
15715
15768
  }
15716
15769
 
15770
+ interface MidTurnEntry {
15771
+ id: string;
15772
+ key: string;
15773
+ runId: string;
15774
+ text: string;
15775
+ from: string;
15776
+ at: number;
15777
+ }
15778
+ declare class MidTurnInbox {
15779
+ private readonly opts;
15780
+ private byKey;
15781
+ private taken;
15782
+ private seq;
15783
+ constructor(opts?: {
15784
+ now?: () => number;
15785
+ });
15786
+ private now;
15787
+ /** Offer a message to the run `runId` going in this chat. */
15788
+ offer(key: string, runId: string, text: string, from: string): MidTurnEntry;
15789
+ /** The hook's call: every message waiting for this chat, oldest first,
15790
+ * marked taken. */
15791
+ take(key: string): MidTurnEntry[];
15792
+ isTaken(id: string | undefined): boolean;
15793
+ /** The run ended: what it never took goes on its usual way. */
15794
+ endRun(runId: string): void;
15795
+ /** The run in this chat ended: what it never took goes on its usual way
15796
+ * (the queue or the waiting caller), never to a later run. */
15797
+ endChat(key: string): void;
15798
+ pending(key: string): number;
15799
+ private prune;
15800
+ }
15801
+
15717
15802
  type InitiatorKind = "human" | "agent";
15718
15803
  /** The root of a chain, carried in `context.initiator` on every hop after
15719
15804
  * the first. Only small identifying fields: it crosses the mesh. */
@@ -16093,6 +16178,8 @@ interface AgentTask {
16093
16178
  /** Set on the one automatic retry of a run whose preparation steps hit
16094
16179
  * the pre-spawn deadline (#340). A retry that hits it again is reported. */
16095
16180
  preSpawnRetry?: number;
16181
+ /** Offered to the run already going in this chat (mid-turn.ts). */
16182
+ midTurnId?: string;
16096
16183
  /** Set on a run that continues one stopped at its agent's time limit
16097
16184
  * (#1257): how many continuations this request has had, and when its
16098
16185
  * first run started (a caller's deadline counts from there). */
@@ -16209,6 +16296,9 @@ interface AgentTask {
16209
16296
  };
16210
16297
  }
16211
16298
  interface AgentResponse {
16299
+ /** The message was read by the run already going in its chat, which
16300
+ * answers it; no turn of its own ran (mid-turn.ts). */
16301
+ midTurnDelivered?: boolean;
16212
16302
  content: string;
16213
16303
  error?: string;
16214
16304
  /** Typed discriminator on `error`. Lets dispatchers and workflow nodes
@@ -19797,6 +19887,8 @@ declare class AgentRegistry {
19797
19887
  * free and run at once.
19798
19888
  */
19799
19889
  private voiceClaims;
19890
+ /** Messages for a run already going in their chat (mid-turn.ts). */
19891
+ readonly midTurn: MidTurnInbox;
19800
19892
  /** One run at a time per agent and owner's request (work-lane.ts). */
19801
19893
  private workLanes;
19802
19894
  /** Notices for an agent's next run (notices.ts, /send/agent notice:true). */
@@ -20208,6 +20300,13 @@ declare class AgentRegistry {
20208
20300
  * conversation leaves a turn the phone started there alone (#1455).
20209
20301
  * Returns how many it aborted. */
20210
20302
  cancelChatTasks(agentId: string, channel: string, chatId: string, reason?: string, sender?: string): number;
20303
+ /** Offer `task` to the run of its agent already going in its chat, when
20304
+ * that run can hear it (claude-code, whose workspace hook reads the
20305
+ * inbox) and the message is a person's or an agent's words. */
20306
+ private offerMidTurn;
20307
+ /** The hook's call after a tool call (GET /runs/inbox): messages for the
20308
+ * run going in this chat, marked taken. */
20309
+ takeMidTurn(agentId: string, channel: string, chatId: string): MidTurnEntry[];
20211
20310
  /**
20212
20311
  * Queue a follow-up correction/update for an in-flight task. The message
20213
20312
  * lands in the per-session MessageQueue and is dispatched after the
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{Oa as Tt,Pa 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-2FXHWT5U.js";import"./chunk-YRBJ4KB7.js";import"./chunk-GTJIKXDB.js";import"./chunk-UYG7UOVQ.js";import"./chunk-W4K3DFAX.js";import"./chunk-IMLAPB7G.js";import"./chunk-ZVP6GB4G.js";import"./chunk-PPUN7YHA.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-FLNSBODK.js";import"./chunk-3Q6MRG3P.js";import"./chunk-2VDO2HEK.js";import"./chunk-2P5NP4H6.js";import"./chunk-B4KQC3DG.js";import"./chunk-LQE73AZR.js";import"./chunk-2D3RYIDU.js";import"./chunk-EPIKS3WL.js";import"./chunk-MRIVENBY.js";import"./chunk-GJOKXP5D.js";import"./chunk-A5GYG56I.js";import"./chunk-ZWO36TCN.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-UKUH662W.js";import"./chunk-JWDJMFU6.js";import"./chunk-RX5O5637.js";import"./chunk-5ELIX7BQ.js";import"./chunk-X7UQY7CH.js";import"./chunk-323KMXT4.js";import"./chunk-QPABR72X.js";import"./chunk-IFUAP7UD.js";import"./chunk-KP7KDLZ2.js";import{Ha as yt,q as lt,r as ct,s as dt,t as mt,u as pt}from"./chunk-6BINQY52.js";import"./chunk-MKQI5WL2.js";import"./chunk-MEFPXHQJ.js";import"./chunk-7AB3QUGH.js";import{a as L}from"./chunk-BAXGL6TY.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-CUX7BF7B.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-6TTGRTDO.js";import"./chunk-FLDMRYZD.js";import"./chunk-VE3SSOQX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-IH65GDJR.js";import{u as ut}from"./chunk-JJC2HBWC.js";import"./chunk-Y4BNOZWQ.js";import"./chunk-3UOTLMXD.js";import"./chunk-XVV7ZZ77.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-KWWBDLE6.js";import"./chunk-LIY5CHUV.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-VWTBHLMX.js";import"./chunk-MHRVTFLZ.js";import"./chunk-JTFCU5LH.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-BE64IJWM.js";import"./chunk-5ONH4ITT.js";import"./chunk-JRAG37V5.js";import"./chunk-ILEC3IAV.js";import"./chunk-MYVHVJWZ.js";import"./chunk-3AHYZLGE.js";import"./chunk-XL7UWG36.js";import"./chunk-MNG2AMKZ.js";import"./chunk-LY4G7PCW.js";import"./chunk-DPG6VHPX.js";import"./chunk-BERWTVG2.js";import"./chunk-A7JSRDJL.js";import"./chunk-HPRLRD4P.js";import"./chunk-PYTNMX2D.js";import{a as ht}from"./chunk-6VHORIGB.js";import{f as gt,g as ft}from"./chunk-OAVJMZLF.js";import"./chunk-WPNRDEHW.js";import"./chunk-OWNQ2FD4.js";import"./chunk-AHWWJ7AF.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-YZD6EZMU.js";import{j as it,k as rt,l as at}from"./chunk-LYY7G6LO.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-7IW25T4K.js";import"./chunk-Q3A5P373.js";import"./chunk-JLBRNYKY.js";import"./chunk-BYEL7KKR.js";import"./chunk-QUFIUXMQ.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-DCIYOPJF.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{Nb as tt,Pb as st,Sb as ot,Zb as nt}from"./chunk-GUID2ZA2.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.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{Oa as Tt,Pa 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-NZFWW2YG.js";import"./chunk-Z6N7POAU.js";import"./chunk-GTJIKXDB.js";import"./chunk-NWE3B245.js";import"./chunk-EE5RZDQE.js";import"./chunk-IMLAPB7G.js";import"./chunk-ZVP6GB4G.js";import"./chunk-PPUN7YHA.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-BU6V75KD.js";import"./chunk-3Q6MRG3P.js";import"./chunk-2VDO2HEK.js";import"./chunk-2P5NP4H6.js";import"./chunk-B4KQC3DG.js";import"./chunk-LQE73AZR.js";import"./chunk-2D3RYIDU.js";import"./chunk-WKBGQGVL.js";import"./chunk-MRIVENBY.js";import"./chunk-GJOKXP5D.js";import"./chunk-A5GYG56I.js";import"./chunk-DSUL5L3T.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-UKUH662W.js";import"./chunk-JWDJMFU6.js";import"./chunk-RX5O5637.js";import"./chunk-5ELIX7BQ.js";import"./chunk-X7UQY7CH.js";import"./chunk-DPA3IOMU.js";import"./chunk-QPABR72X.js";import"./chunk-IFUAP7UD.js";import"./chunk-KP7KDLZ2.js";import{Ia as yt,r as lt,s as ct,t as dt,u as mt,v as pt}from"./chunk-36RIIHPS.js";import"./chunk-N7IX77SL.js";import"./chunk-MEFPXHQJ.js";import"./chunk-7AB3QUGH.js";import{a as L}from"./chunk-BAXGL6TY.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-X7UEV4O2.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-6TTGRTDO.js";import"./chunk-CUCIMPFI.js";import"./chunk-VE3SSOQX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-IH65GDJR.js";import{u as ut}from"./chunk-ERKK22QV.js";import"./chunk-G3GFE3GK.js";import"./chunk-3UOTLMXD.js";import"./chunk-XVV7ZZ77.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-KWWBDLE6.js";import"./chunk-LIY5CHUV.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-VWTBHLMX.js";import"./chunk-FCF47R4W.js";import"./chunk-JTFCU5LH.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-BE64IJWM.js";import"./chunk-5ONH4ITT.js";import"./chunk-JRAG37V5.js";import"./chunk-ILEC3IAV.js";import"./chunk-MYVHVJWZ.js";import"./chunk-7JWMLYOA.js";import"./chunk-XL7UWG36.js";import"./chunk-MNG2AMKZ.js";import"./chunk-LY4G7PCW.js";import"./chunk-DPG6VHPX.js";import"./chunk-BERWTVG2.js";import"./chunk-A7JSRDJL.js";import"./chunk-HPRLRD4P.js";import"./chunk-XBFXSSHA.js";import{a as ht}from"./chunk-DGCYMSXU.js";import{f as gt,g as ft}from"./chunk-I722PWJE.js";import"./chunk-WPNRDEHW.js";import"./chunk-OWNQ2FD4.js";import"./chunk-AHWWJ7AF.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-D3FIIEDR.js";import{j as it,k as rt,l as at}from"./chunk-IXV3BPUZ.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-7IW25T4K.js";import"./chunk-Q3A5P373.js";import"./chunk-JLBRNYKY.js";import"./chunk-BYEL7KKR.js";import"./chunk-QUFIUXMQ.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-DCIYOPJF.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{Ob as tt,Qb as st,Tb as ot,_b as nt}from"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.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).