agentix-cli 0.127.0 → 0.129.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-FF66N2KH.js → App-G37JNRBW.js} +2 -2
  2. package/dist/{ChatApp-HMHQZVVD.js → ChatApp-NCKC7C3L.js} +2 -2
  3. package/dist/absorb-eval-ZCWHWKAD.js +2 -0
  4. package/dist/{agent-UAWDO3I2.js → agent-LJ4SUQCC.js} +2 -2
  5. package/dist/{board-dashboard-Y2OECKDG.js → board-dashboard-LZJT4YWV.js} +251 -235
  6. package/dist/board-dashboard-LZJT4YWV.js.map +1 -0
  7. package/dist/{chunk-NUSROFTJ.js → chunk-4FMZTM3W.js} +2 -2
  8. package/dist/chunk-4O4GZBKZ.js +4 -0
  9. package/dist/chunk-4O4GZBKZ.js.map +1 -0
  10. package/dist/{chunk-I4DGMFQG.js → chunk-4ZFLYY5P.js} +2 -2
  11. package/dist/chunk-A347YHEW.js +4 -0
  12. package/dist/chunk-A347YHEW.js.map +1 -0
  13. package/dist/chunk-AMW2R676.js +36 -0
  14. package/dist/chunk-AMW2R676.js.map +1 -0
  15. package/dist/{chunk-HNBW5Q47.js → chunk-AOFTTIZZ.js} +2 -2
  16. package/dist/{chunk-O6FP3LPC.js → chunk-ARSVKSC4.js} +2 -2
  17. package/dist/{chunk-EHLTZ6IB.js → chunk-BCUR2TJ7.js} +2 -2
  18. package/dist/{chunk-PH43FUU7.js → chunk-BWSB7NOX.js} +2 -2
  19. package/dist/{chunk-QWQOI4G4.js → chunk-CDLJOGVZ.js} +31 -31
  20. package/dist/chunk-CDLJOGVZ.js.map +1 -0
  21. package/dist/{chunk-COWAAE54.js → chunk-CPMQZ6Z7.js} +2 -2
  22. package/dist/{chunk-YV22EOGL.js → chunk-DVR6PFCJ.js} +2 -2
  23. package/dist/chunk-EOLEKSN6.js +54 -0
  24. package/dist/chunk-EOLEKSN6.js.map +1 -0
  25. package/dist/{chunk-VBJTGTF5.js → chunk-I3RAUJCD.js} +2 -2
  26. package/dist/chunk-M7IJVOJA.js +55 -0
  27. package/dist/chunk-M7IJVOJA.js.map +1 -0
  28. package/dist/{chunk-6W74CHNW.js → chunk-MEFPXHQJ.js} +13 -13
  29. package/dist/chunk-MEFPXHQJ.js.map +1 -0
  30. package/dist/chunk-PVUNDNT3.js +17 -0
  31. package/dist/chunk-PVUNDNT3.js.map +1 -0
  32. package/dist/{chunk-3KYZOC7N.js → chunk-R6UCPHUD.js} +2 -2
  33. package/dist/{chunk-CKYPQMUD.js → chunk-SCC7HBFZ.js} +2 -2
  34. package/dist/{chunk-56KNKUFF.js → chunk-VD7IO653.js} +3 -3
  35. package/dist/{chunk-56KNKUFF.js.map → chunk-VD7IO653.js.map} +1 -1
  36. package/dist/{chunk-XYT6XY7G.js → chunk-VJRITDSQ.js} +2 -2
  37. package/dist/chunk-X5JTG52Q.js +6 -0
  38. package/dist/chunk-X5JTG52Q.js.map +1 -0
  39. package/dist/{chunk-LTH3AYXC.js → chunk-XIA2ACKX.js} +2 -2
  40. package/dist/{chunk-73WQ42PO.js → chunk-XOQNDWVW.js} +2 -2
  41. package/dist/{chunk-XX5QKBX4.js → chunk-XZN7QBRH.js} +2 -2
  42. package/dist/{chunk-HYRBBH6T.js → chunk-YHD4PHFX.js} +240 -240
  43. package/dist/chunk-YHD4PHFX.js.map +1 -0
  44. package/dist/{chunk-4WZGZ2Z6.js → chunk-Z5CBUZIW.js} +2 -2
  45. package/dist/{chunk-EJT3F6QM.js → chunk-ZF5U5KPB.js} +13 -13
  46. package/dist/chunk-ZF5U5KPB.js.map +1 -0
  47. package/dist/cli.js +1 -1
  48. package/dist/{client-2VVRJ3UF.js → client-A5OK3IFO.js} +2 -2
  49. package/dist/config-DQ5SILHX.js +2 -0
  50. package/dist/{config-mutate-47WZDZBO.js → config-mutate-62FCJ3S6.js} +2 -2
  51. package/dist/config-mutator-3ZL5YQSO.js +2 -0
  52. package/dist/contributions-L2YS4AH2.js +57 -0
  53. package/dist/contributions-L2YS4AH2.js.map +1 -0
  54. package/dist/{doctor-Q3QNZVLC.js → doctor-7TPSMMFA.js} +2 -2
  55. package/dist/{follow-up-tool-GKZVG4L2.js → follow-up-tool-FKWIRFPW.js} +2 -2
  56. package/dist/{hub-DNPINTIF.js → hub-EU5ECAJB.js} +2 -2
  57. package/dist/index.d.ts +301 -0
  58. package/dist/index.js +1 -1
  59. package/dist/note-reader-LPPIYYLT.js +8 -0
  60. package/dist/note-reader-LPPIYYLT.js.map +1 -0
  61. package/dist/{notes-YLTNRMB5.js → notes-2VC47RCK.js} +2 -2
  62. package/dist/program-UTSXNAHM.js +743 -0
  63. package/dist/program-UTSXNAHM.js.map +1 -0
  64. package/dist/{promote-PETKX7KR.js → promote-XBDWCHLU.js} +2 -2
  65. package/dist/query-UI6GQEL7.js +2 -0
  66. package/dist/{registry-2XDO53AJ.js → registry-JW6ETTBA.js} +2 -2
  67. package/dist/{request-planner-A3WJNPXO.js → request-planner-SEXYQN7D.js} +2 -2
  68. package/dist/{review-candidates-A6ID2RDX.js → review-candidates-PIJWPPHQ.js} +2 -2
  69. package/dist/{rotation-memo-6UW6DTBQ.js → rotation-memo-7VLREGS6.js} +2 -2
  70. package/dist/{routing-NPP3MEUW.js → routing-2V3Y6ZR5.js} +2 -2
  71. package/dist/schedule-tool-KFZ27JTH.js +2 -0
  72. package/dist/{scheduler-T6VLBM3U.js → scheduler-SVZKDKJV.js} +2 -2
  73. package/dist/score-KDNIUTNV.js +3 -0
  74. package/dist/score-KDNIUTNV.js.map +1 -0
  75. package/dist/{seat-D3DBYTSC.js → seat-C6TMCJWI.js} +2 -2
  76. package/dist/{select-RFY64RY7.js → select-DP64KWO4.js} +2 -2
  77. package/dist/{set-enabled-AU66DR5C.js → set-enabled-WCH6FU4N.js} +2 -2
  78. package/dist/{tool-PCHIVR27.js → tool-TWQRBV4Y.js} +2 -2
  79. package/dist/{tool-F3YA2ZZQ.js → tool-WUK3ZOWG.js} +2 -2
  80. package/dist/wiki-4LAJ36XR.js +2 -0
  81. package/package.json +1 -1
  82. package/dist/absorb-eval-ERKVVTGG.js +0 -2
  83. package/dist/board-dashboard-Y2OECKDG.js.map +0 -1
  84. package/dist/chunk-52SIHG45.js +0 -4
  85. package/dist/chunk-52SIHG45.js.map +0 -1
  86. package/dist/chunk-6W74CHNW.js.map +0 -1
  87. package/dist/chunk-EJT3F6QM.js.map +0 -1
  88. package/dist/chunk-HYRBBH6T.js.map +0 -1
  89. package/dist/chunk-PLIT25TH.js +0 -51
  90. package/dist/chunk-PLIT25TH.js.map +0 -1
  91. package/dist/chunk-QWQOI4G4.js.map +0 -1
  92. package/dist/chunk-TJ4P4WW2.js +0 -4
  93. package/dist/chunk-TJ4P4WW2.js.map +0 -1
  94. package/dist/chunk-UJXS4MS3.js +0 -49
  95. package/dist/chunk-UJXS4MS3.js.map +0 -1
  96. package/dist/chunk-Y27RUOD2.js +0 -54
  97. package/dist/chunk-Y27RUOD2.js.map +0 -1
  98. package/dist/config-YSKHOV44.js +0 -2
  99. package/dist/config-mutator-7DIEQUB5.js +0 -2
  100. package/dist/program-4QWUOJE3.js +0 -739
  101. package/dist/program-4QWUOJE3.js.map +0 -1
  102. package/dist/query-D44BUTH3.js +0 -2
  103. package/dist/schedule-tool-ZECUQMQK.js +0 -2
  104. package/dist/wiki-NI3ZPUZS.js +0 -2
  105. /package/dist/{App-FF66N2KH.js.map → App-G37JNRBW.js.map} +0 -0
  106. /package/dist/{ChatApp-HMHQZVVD.js.map → ChatApp-NCKC7C3L.js.map} +0 -0
  107. /package/dist/{absorb-eval-ERKVVTGG.js.map → absorb-eval-ZCWHWKAD.js.map} +0 -0
  108. /package/dist/{agent-UAWDO3I2.js.map → agent-LJ4SUQCC.js.map} +0 -0
  109. /package/dist/{chunk-NUSROFTJ.js.map → chunk-4FMZTM3W.js.map} +0 -0
  110. /package/dist/{chunk-I4DGMFQG.js.map → chunk-4ZFLYY5P.js.map} +0 -0
  111. /package/dist/{chunk-HNBW5Q47.js.map → chunk-AOFTTIZZ.js.map} +0 -0
  112. /package/dist/{chunk-O6FP3LPC.js.map → chunk-ARSVKSC4.js.map} +0 -0
  113. /package/dist/{chunk-EHLTZ6IB.js.map → chunk-BCUR2TJ7.js.map} +0 -0
  114. /package/dist/{chunk-PH43FUU7.js.map → chunk-BWSB7NOX.js.map} +0 -0
  115. /package/dist/{chunk-COWAAE54.js.map → chunk-CPMQZ6Z7.js.map} +0 -0
  116. /package/dist/{chunk-YV22EOGL.js.map → chunk-DVR6PFCJ.js.map} +0 -0
  117. /package/dist/{chunk-VBJTGTF5.js.map → chunk-I3RAUJCD.js.map} +0 -0
  118. /package/dist/{chunk-3KYZOC7N.js.map → chunk-R6UCPHUD.js.map} +0 -0
  119. /package/dist/{chunk-CKYPQMUD.js.map → chunk-SCC7HBFZ.js.map} +0 -0
  120. /package/dist/{chunk-XYT6XY7G.js.map → chunk-VJRITDSQ.js.map} +0 -0
  121. /package/dist/{chunk-LTH3AYXC.js.map → chunk-XIA2ACKX.js.map} +0 -0
  122. /package/dist/{chunk-73WQ42PO.js.map → chunk-XOQNDWVW.js.map} +0 -0
  123. /package/dist/{chunk-XX5QKBX4.js.map → chunk-XZN7QBRH.js.map} +0 -0
  124. /package/dist/{chunk-4WZGZ2Z6.js.map → chunk-Z5CBUZIW.js.map} +0 -0
  125. /package/dist/{client-2VVRJ3UF.js.map → client-A5OK3IFO.js.map} +0 -0
  126. /package/dist/{config-YSKHOV44.js.map → config-DQ5SILHX.js.map} +0 -0
  127. /package/dist/{config-mutate-47WZDZBO.js.map → config-mutate-62FCJ3S6.js.map} +0 -0
  128. /package/dist/{config-mutator-7DIEQUB5.js.map → config-mutator-3ZL5YQSO.js.map} +0 -0
  129. /package/dist/{doctor-Q3QNZVLC.js.map → doctor-7TPSMMFA.js.map} +0 -0
  130. /package/dist/{follow-up-tool-GKZVG4L2.js.map → follow-up-tool-FKWIRFPW.js.map} +0 -0
  131. /package/dist/{hub-DNPINTIF.js.map → hub-EU5ECAJB.js.map} +0 -0
  132. /package/dist/{notes-YLTNRMB5.js.map → notes-2VC47RCK.js.map} +0 -0
  133. /package/dist/{promote-PETKX7KR.js.map → promote-XBDWCHLU.js.map} +0 -0
  134. /package/dist/{query-D44BUTH3.js.map → query-UI6GQEL7.js.map} +0 -0
  135. /package/dist/{registry-2XDO53AJ.js.map → registry-JW6ETTBA.js.map} +0 -0
  136. /package/dist/{request-planner-A3WJNPXO.js.map → request-planner-SEXYQN7D.js.map} +0 -0
  137. /package/dist/{review-candidates-A6ID2RDX.js.map → review-candidates-PIJWPPHQ.js.map} +0 -0
  138. /package/dist/{rotation-memo-6UW6DTBQ.js.map → rotation-memo-7VLREGS6.js.map} +0 -0
  139. /package/dist/{routing-NPP3MEUW.js.map → routing-2V3Y6ZR5.js.map} +0 -0
  140. /package/dist/{schedule-tool-ZECUQMQK.js.map → schedule-tool-KFZ27JTH.js.map} +0 -0
  141. /package/dist/{scheduler-T6VLBM3U.js.map → scheduler-SVZKDKJV.js.map} +0 -0
  142. /package/dist/{seat-D3DBYTSC.js.map → seat-C6TMCJWI.js.map} +0 -0
  143. /package/dist/{select-RFY64RY7.js.map → select-DP64KWO4.js.map} +0 -0
  144. /package/dist/{set-enabled-AU66DR5C.js.map → set-enabled-WCH6FU4N.js.map} +0 -0
  145. /package/dist/{tool-PCHIVR27.js.map → tool-TWQRBV4Y.js.map} +0 -0
  146. /package/dist/{tool-F3YA2ZZQ.js.map → tool-WUK3ZOWG.js.map} +0 -0
  147. /package/dist/{wiki-NI3ZPUZS.js.map → wiki-4LAJ36XR.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -1585,6 +1585,61 @@ declare const agentConfigSchema: z.ZodObject<{
1585
1585
  * them off, when that is longer than shutdown.drainTimeoutSeconds. For
1586
1586
  * agents whose runs are long (renders, builds). */
1587
1587
  drainTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
1588
+ /** Wiki settings for this agent. `contribute` turns on its daily wiki
1589
+ * contribution (#824): `agentx wiki contribute --all` reviews the
1590
+ * agent's work since its last run and queues sourced patches for the
1591
+ * daily merge. Off by default. `maxPatches` and `maxCostUsd` cap one
1592
+ * run; `model` overrides the wiki-wide model. `absorb` leaves the
1593
+ * agent out of the bulk absorb. */
1594
+ wiki: z.ZodOptional<z.ZodObject<{
1595
+ contribute: z.ZodDefault<z.ZodObject<{
1596
+ enabled: z.ZodDefault<z.ZodBoolean>;
1597
+ maxPatches: z.ZodDefault<z.ZodNumber>;
1598
+ maxCostUsd: z.ZodOptional<z.ZodNumber>;
1599
+ model: z.ZodOptional<z.ZodString>;
1600
+ }, "strip", z.ZodTypeAny, {
1601
+ enabled: boolean;
1602
+ maxPatches: number;
1603
+ model?: string | undefined;
1604
+ maxCostUsd?: number | undefined;
1605
+ }, {
1606
+ model?: string | undefined;
1607
+ enabled?: boolean | undefined;
1608
+ maxPatches?: number | undefined;
1609
+ maxCostUsd?: number | undefined;
1610
+ }>>;
1611
+ /** Whether `agentx wiki absorb` without `--agent` compiles this
1612
+ * agent's raw entries (#850). On by default. Off, the agent is skipped
1613
+ * and named; its raw entries are still captured, so absorb can resume
1614
+ * later with nothing lost. `--agent <id>` still runs it. */
1615
+ absorb: z.ZodDefault<z.ZodObject<{
1616
+ enabled: z.ZodDefault<z.ZodBoolean>;
1617
+ }, "strip", z.ZodTypeAny, {
1618
+ enabled: boolean;
1619
+ }, {
1620
+ enabled?: boolean | undefined;
1621
+ }>>;
1622
+ }, "strip", z.ZodTypeAny, {
1623
+ contribute: {
1624
+ enabled: boolean;
1625
+ maxPatches: number;
1626
+ model?: string | undefined;
1627
+ maxCostUsd?: number | undefined;
1628
+ };
1629
+ absorb: {
1630
+ enabled: boolean;
1631
+ };
1632
+ }, {
1633
+ contribute?: {
1634
+ model?: string | undefined;
1635
+ enabled?: boolean | undefined;
1636
+ maxPatches?: number | undefined;
1637
+ maxCostUsd?: number | undefined;
1638
+ } | undefined;
1639
+ absorb?: {
1640
+ enabled?: boolean | undefined;
1641
+ } | undefined;
1642
+ }>>;
1588
1643
  permissionMode: z.ZodDefault<z.ZodString>;
1589
1644
  /** How this agent's `claude` CLI is billed (claude-code tier). Default
1590
1645
  * "subscription": the shared OAuth login, ANTHROPIC_API_KEY stripped.
@@ -1936,6 +1991,17 @@ declare const agentConfigSchema: z.ZodObject<{
1936
1991
  }[];
1937
1992
  provider?: string | undefined;
1938
1993
  model?: string | undefined;
1994
+ wiki?: {
1995
+ contribute: {
1996
+ enabled: boolean;
1997
+ maxPatches: number;
1998
+ model?: string | undefined;
1999
+ maxCostUsd?: number | undefined;
2000
+ };
2001
+ absorb: {
2002
+ enabled: boolean;
2003
+ };
2004
+ } | undefined;
1939
2005
  voice?: {
1940
2006
  system?: string | Record<string, string> | undefined;
1941
2007
  provider?: "system" | "elevenlabs" | undefined;
@@ -1976,6 +2042,17 @@ declare const agentConfigSchema: z.ZodObject<{
1976
2042
  workspace: string;
1977
2043
  provider?: string | undefined;
1978
2044
  model?: string | undefined;
2045
+ wiki?: {
2046
+ contribute?: {
2047
+ model?: string | undefined;
2048
+ enabled?: boolean | undefined;
2049
+ maxPatches?: number | undefined;
2050
+ maxCostUsd?: number | undefined;
2051
+ } | undefined;
2052
+ absorb?: {
2053
+ enabled?: boolean | undefined;
2054
+ } | undefined;
2055
+ } | undefined;
1979
2056
  voice?: {
1980
2057
  system?: string | Record<string, string> | undefined;
1981
2058
  provider?: "system" | "elevenlabs" | undefined;
@@ -2446,6 +2523,61 @@ declare const daemonConfigSchema: z.ZodObject<{
2446
2523
  * them off, when that is longer than shutdown.drainTimeoutSeconds. For
2447
2524
  * agents whose runs are long (renders, builds). */
2448
2525
  drainTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
2526
+ /** Wiki settings for this agent. `contribute` turns on its daily wiki
2527
+ * contribution (#824): `agentx wiki contribute --all` reviews the
2528
+ * agent's work since its last run and queues sourced patches for the
2529
+ * daily merge. Off by default. `maxPatches` and `maxCostUsd` cap one
2530
+ * run; `model` overrides the wiki-wide model. `absorb` leaves the
2531
+ * agent out of the bulk absorb. */
2532
+ wiki: z.ZodOptional<z.ZodObject<{
2533
+ contribute: z.ZodDefault<z.ZodObject<{
2534
+ enabled: z.ZodDefault<z.ZodBoolean>;
2535
+ maxPatches: z.ZodDefault<z.ZodNumber>;
2536
+ maxCostUsd: z.ZodOptional<z.ZodNumber>;
2537
+ model: z.ZodOptional<z.ZodString>;
2538
+ }, "strip", z.ZodTypeAny, {
2539
+ enabled: boolean;
2540
+ maxPatches: number;
2541
+ model?: string | undefined;
2542
+ maxCostUsd?: number | undefined;
2543
+ }, {
2544
+ model?: string | undefined;
2545
+ enabled?: boolean | undefined;
2546
+ maxPatches?: number | undefined;
2547
+ maxCostUsd?: number | undefined;
2548
+ }>>;
2549
+ /** Whether `agentx wiki absorb` without `--agent` compiles this
2550
+ * agent's raw entries (#850). On by default. Off, the agent is skipped
2551
+ * and named; its raw entries are still captured, so absorb can resume
2552
+ * later with nothing lost. `--agent <id>` still runs it. */
2553
+ absorb: z.ZodDefault<z.ZodObject<{
2554
+ enabled: z.ZodDefault<z.ZodBoolean>;
2555
+ }, "strip", z.ZodTypeAny, {
2556
+ enabled: boolean;
2557
+ }, {
2558
+ enabled?: boolean | undefined;
2559
+ }>>;
2560
+ }, "strip", z.ZodTypeAny, {
2561
+ contribute: {
2562
+ enabled: boolean;
2563
+ maxPatches: number;
2564
+ model?: string | undefined;
2565
+ maxCostUsd?: number | undefined;
2566
+ };
2567
+ absorb: {
2568
+ enabled: boolean;
2569
+ };
2570
+ }, {
2571
+ contribute?: {
2572
+ model?: string | undefined;
2573
+ enabled?: boolean | undefined;
2574
+ maxPatches?: number | undefined;
2575
+ maxCostUsd?: number | undefined;
2576
+ } | undefined;
2577
+ absorb?: {
2578
+ enabled?: boolean | undefined;
2579
+ } | undefined;
2580
+ }>>;
2449
2581
  permissionMode: z.ZodDefault<z.ZodString>;
2450
2582
  /** How this agent's `claude` CLI is billed (claude-code tier). Default
2451
2583
  * "subscription": the shared OAuth login, ANTHROPIC_API_KEY stripped.
@@ -2797,6 +2929,17 @@ declare const daemonConfigSchema: z.ZodObject<{
2797
2929
  }[];
2798
2930
  provider?: string | undefined;
2799
2931
  model?: string | undefined;
2932
+ wiki?: {
2933
+ contribute: {
2934
+ enabled: boolean;
2935
+ maxPatches: number;
2936
+ model?: string | undefined;
2937
+ maxCostUsd?: number | undefined;
2938
+ };
2939
+ absorb: {
2940
+ enabled: boolean;
2941
+ };
2942
+ } | undefined;
2800
2943
  voice?: {
2801
2944
  system?: string | Record<string, string> | undefined;
2802
2945
  provider?: "system" | "elevenlabs" | undefined;
@@ -2837,6 +2980,17 @@ declare const daemonConfigSchema: z.ZodObject<{
2837
2980
  workspace: string;
2838
2981
  provider?: string | undefined;
2839
2982
  model?: string | undefined;
2983
+ wiki?: {
2984
+ contribute?: {
2985
+ model?: string | undefined;
2986
+ enabled?: boolean | undefined;
2987
+ maxPatches?: number | undefined;
2988
+ maxCostUsd?: number | undefined;
2989
+ } | undefined;
2990
+ absorb?: {
2991
+ enabled?: boolean | undefined;
2992
+ } | undefined;
2993
+ } | undefined;
2840
2994
  voice?: {
2841
2995
  system?: string | Record<string, string> | undefined;
2842
2996
  provider?: "system" | "elevenlabs" | undefined;
@@ -2925,6 +3079,66 @@ declare const daemonConfigSchema: z.ZodObject<{
2925
3079
  allowActions?: boolean | undefined;
2926
3080
  } | undefined;
2927
3081
  }>>>;
3082
+ /** Wiki-wide settings (#824). */
3083
+ wiki: z.ZodDefault<z.ZodObject<{
3084
+ /** The daily per-agent contribution and the merge that applies it.
3085
+ * Both jobs are added to the schedule when at least one agent has
3086
+ * `wiki.contribute.enabled`; a cron with the same id overrides them. */
3087
+ contributions: z.ZodDefault<z.ZodObject<{
3088
+ /** When each enabled agent reviews its day (cron, 5 fields). */
3089
+ schedule: z.ZodDefault<z.ZodString>;
3090
+ /** When the queued patches are applied. */
3091
+ mergeSchedule: z.ZodDefault<z.ZodString>;
3092
+ timezone: z.ZodDefault<z.ZodString>;
3093
+ /** Default per-agent, per-run model spend cap in USD. */
3094
+ maxCostUsd: z.ZodDefault<z.ZodNumber>;
3095
+ /** Default model for the contribution call. */
3096
+ model: z.ZodDefault<z.ZodString>;
3097
+ }, "strip", z.ZodTypeAny, {
3098
+ model: string;
3099
+ schedule: string;
3100
+ timezone: string;
3101
+ maxCostUsd: number;
3102
+ mergeSchedule: string;
3103
+ }, {
3104
+ model?: string | undefined;
3105
+ schedule?: string | undefined;
3106
+ timezone?: string | undefined;
3107
+ maxCostUsd?: number | undefined;
3108
+ mergeSchedule?: string | undefined;
3109
+ }>>;
3110
+ query: z.ZodDefault<z.ZodObject<{
3111
+ /** `wiki query` also searches other agents' readable pages and the
3112
+ * root wiki's own pages. */
3113
+ shared: z.ZodDefault<z.ZodBoolean>;
3114
+ }, "strip", z.ZodTypeAny, {
3115
+ shared: boolean;
3116
+ }, {
3117
+ shared?: boolean | undefined;
3118
+ }>>;
3119
+ }, "strip", z.ZodTypeAny, {
3120
+ query: {
3121
+ shared: boolean;
3122
+ };
3123
+ contributions: {
3124
+ model: string;
3125
+ schedule: string;
3126
+ timezone: string;
3127
+ maxCostUsd: number;
3128
+ mergeSchedule: string;
3129
+ };
3130
+ }, {
3131
+ query?: {
3132
+ shared?: boolean | undefined;
3133
+ } | undefined;
3134
+ contributions?: {
3135
+ model?: string | undefined;
3136
+ schedule?: string | undefined;
3137
+ timezone?: string | undefined;
3138
+ maxCostUsd?: number | undefined;
3139
+ mergeSchedule?: string | undefined;
3140
+ } | undefined;
3141
+ }>>;
2928
3142
  channels: z.ZodDefault<z.ZodObject<{
2929
3143
  telegram: z.ZodDefault<z.ZodObject<{
2930
3144
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -5380,18 +5594,25 @@ declare const daemonConfigSchema: z.ZodObject<{
5380
5594
  asyncWhenHuman: z.ZodDefault<z.ZodBoolean>;
5381
5595
  /** A delegation with no answer after this long is reported as timed out. */
5382
5596
  timeoutMinutes: z.ZodDefault<z.ZodNumber>;
5597
+ /** A restart that stops the turn passing a delegation's answer on to
5598
+ * the person (#846): run that turn once more after the next start,
5599
+ * and if it fails again, tell the person and note the open request. */
5600
+ requeueRelayOnRestart: z.ZodDefault<z.ZodBoolean>;
5383
5601
  }, "strip", z.ZodTypeAny, {
5384
5602
  asyncWhenHuman: boolean;
5385
5603
  timeoutMinutes: number;
5604
+ requeueRelayOnRestart: boolean;
5386
5605
  }, {
5387
5606
  asyncWhenHuman?: boolean | undefined;
5388
5607
  timeoutMinutes?: number | undefined;
5608
+ requeueRelayOnRestart?: boolean | undefined;
5389
5609
  }>>;
5390
5610
  }, "strip", z.ZodTypeAny, {
5391
5611
  enabled: boolean;
5392
5612
  delegation: {
5393
5613
  asyncWhenHuman: boolean;
5394
5614
  timeoutMinutes: number;
5615
+ requeueRelayOnRestart: boolean;
5395
5616
  };
5396
5617
  peers: {
5397
5618
  name: string;
@@ -5417,6 +5638,7 @@ declare const daemonConfigSchema: z.ZodObject<{
5417
5638
  delegation?: {
5418
5639
  asyncWhenHuman?: boolean | undefined;
5419
5640
  timeoutMinutes?: number | undefined;
5641
+ requeueRelayOnRestart?: boolean | undefined;
5420
5642
  } | undefined;
5421
5643
  peers?: {
5422
5644
  name: string;
@@ -7322,6 +7544,17 @@ declare const daemonConfigSchema: z.ZodObject<{
7322
7544
  }[];
7323
7545
  provider?: string | undefined;
7324
7546
  model?: string | undefined;
7547
+ wiki?: {
7548
+ contribute: {
7549
+ enabled: boolean;
7550
+ maxPatches: number;
7551
+ model?: string | undefined;
7552
+ maxCostUsd?: number | undefined;
7553
+ };
7554
+ absorb: {
7555
+ enabled: boolean;
7556
+ };
7557
+ } | undefined;
7325
7558
  voice?: {
7326
7559
  system?: string | Record<string, string> | undefined;
7327
7560
  provider?: "system" | "elevenlabs" | undefined;
@@ -7374,6 +7607,7 @@ declare const daemonConfigSchema: z.ZodObject<{
7374
7607
  delegation: {
7375
7608
  asyncWhenHuman: boolean;
7376
7609
  timeoutMinutes: number;
7610
+ requeueRelayOnRestart: boolean;
7377
7611
  };
7378
7612
  peers: {
7379
7613
  name: string;
@@ -7395,6 +7629,18 @@ declare const daemonConfigSchema: z.ZodObject<{
7395
7629
  skipTypes: string[];
7396
7630
  };
7397
7631
  };
7632
+ wiki: {
7633
+ query: {
7634
+ shared: boolean;
7635
+ };
7636
+ contributions: {
7637
+ model: string;
7638
+ schedule: string;
7639
+ timezone: string;
7640
+ maxCostUsd: number;
7641
+ mergeSchedule: string;
7642
+ };
7643
+ };
7398
7644
  app: {
7399
7645
  android: {
7400
7646
  packageName: string;
@@ -8140,6 +8386,17 @@ declare const daemonConfigSchema: z.ZodObject<{
8140
8386
  workspace: string;
8141
8387
  provider?: string | undefined;
8142
8388
  model?: string | undefined;
8389
+ wiki?: {
8390
+ contribute?: {
8391
+ model?: string | undefined;
8392
+ enabled?: boolean | undefined;
8393
+ maxPatches?: number | undefined;
8394
+ maxCostUsd?: number | undefined;
8395
+ } | undefined;
8396
+ absorb?: {
8397
+ enabled?: boolean | undefined;
8398
+ } | undefined;
8399
+ } | undefined;
8143
8400
  voice?: {
8144
8401
  system?: string | Record<string, string> | undefined;
8145
8402
  provider?: "system" | "elevenlabs" | undefined;
@@ -8244,6 +8501,7 @@ declare const daemonConfigSchema: z.ZodObject<{
8244
8501
  delegation?: {
8245
8502
  asyncWhenHuman?: boolean | undefined;
8246
8503
  timeoutMinutes?: number | undefined;
8504
+ requeueRelayOnRestart?: boolean | undefined;
8247
8505
  } | undefined;
8248
8506
  peers?: {
8249
8507
  name: string;
@@ -8265,6 +8523,18 @@ declare const daemonConfigSchema: z.ZodObject<{
8265
8523
  skipTypes?: string[] | undefined;
8266
8524
  } | undefined;
8267
8525
  } | undefined;
8526
+ wiki?: {
8527
+ query?: {
8528
+ shared?: boolean | undefined;
8529
+ } | undefined;
8530
+ contributions?: {
8531
+ model?: string | undefined;
8532
+ schedule?: string | undefined;
8533
+ timezone?: string | undefined;
8534
+ maxCostUsd?: number | undefined;
8535
+ mergeSchedule?: string | undefined;
8536
+ } | undefined;
8537
+ } | undefined;
8268
8538
  app?: {
8269
8539
  android?: {
8270
8540
  packageName?: string | undefined;
@@ -9665,6 +9935,8 @@ declare class AgentXDaemon {
9665
9935
  private delegations;
9666
9936
  /** Synchronous delegations in flight, to refuse cycles that could never finish. */
9667
9937
  private syncWaits;
9938
+ /** Recent /send/agent answers, so a retry gets the same task id (#847). */
9939
+ private sendAgentDedupe;
9668
9940
  /** Phone-app callback replies waiting for the dashboard to file them. */
9669
9941
  private callbackReplies;
9670
9942
  private hooks;
@@ -10514,6 +10786,12 @@ interface AgentTask {
10514
10786
  /** Called with `runningTaskId` as soon as the run starts. Never fires for
10515
10787
  * a message that was queued or dropped instead of run. */
10516
10788
  onStart?: (runningTaskId: string) => void;
10789
+ /** Aborted when the HTTP caller waiting on this run has gone (timeout,
10790
+ * disconnect). A run still waiting for a busy agent's slot is then
10791
+ * dropped instead of started: nobody is left to read its answer, and a
10792
+ * retrying caller would otherwise have every attempt run once the slot
10793
+ * frees (#822). A run that already started is not affected. */
10794
+ callerSignal?: AbortSignal;
10517
10795
  /** How to re-enter this run if a restart cuts it off (agents/resume).
10518
10796
  * Absent: recorded as a direct run with this task's context. */
10519
10797
  origin?: RunOrigin;
@@ -11500,6 +11778,15 @@ declare class WikiStore {
11500
11778
  private walkDir;
11501
11779
  }
11502
11780
 
11781
+ /** A wiki searched alongside the requester's own. */
11782
+ interface SharedWikiStore {
11783
+ /** Shown in citations as `@<id>/<path>`: an agent id, or "shared". */
11784
+ id: string;
11785
+ store: WikiStore;
11786
+ /** Paths to leave out, e.g. the agents/ tree under the root store. */
11787
+ skip?: (path: string) => boolean;
11788
+ }
11789
+
11503
11790
  type WikiMode = "flat" | "graph" | "unified";
11504
11791
  /**
11505
11792
  * WikiHub: manages per-agent wikis with a shared raw entry pool.
@@ -11529,6 +11816,15 @@ declare class WikiHub {
11529
11816
  /** The wiki root: shared sidecars (_facts.json, _questions.json) live here. */
11530
11817
  getBaseDir(): string;
11531
11818
  getSharedStore(): WikiStore;
11819
+ /**
11820
+ * The wikis a query by `agentId` reads besides its own: every other
11821
+ * agent's articles and the root store's own (promoted lessons). Which
11822
+ * articles of theirs it may read is still decided per article by access.
11823
+ * Without this an agent's query missed answers the shared wiki had (#824).
11824
+ */
11825
+ sharedScope(agentId: string): SharedWikiStore[];
11826
+ /** Agents with a wiki folder here, without reading the raw entries. */
11827
+ private listAgentDirs;
11532
11828
  listAgents(entries?: WikiEntry[]): string[];
11533
11829
  getAgentEntries(agentId: string): WikiEntry[];
11534
11830
  /**
@@ -12283,6 +12579,8 @@ interface AgentMemoryOptions {
12283
12579
  declare class AgentMemory {
12284
12580
  readonly baseDir: string;
12285
12581
  constructor(opts?: AgentMemoryOptions);
12582
+ /** The agent's note folder, without creating it. */
12583
+ dirOf(agentId: string): string;
12286
12584
  private dirFor;
12287
12585
  private fileFor;
12288
12586
  private indexPath;
@@ -12653,6 +12951,9 @@ declare class AgentRegistry {
12653
12951
  * it on the trace. Null means: run locally, the reason is logged and on
12654
12952
  * the trace. */
12655
12953
  private runCloudSession;
12954
+ /** The answer for a run whose HTTP caller left before it got a slot
12955
+ * (#822). Logged so the dropped request is visible on the node. */
12956
+ private callerGone;
12656
12957
  /**
12657
12958
  * Execute a task on an agent. Respects maxConcurrent limit.
12658
12959
  *
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-HYRBBH6T.js";import"./chunk-NUSROFTJ.js";import"./chunk-GTJIKXDB.js";import"./chunk-4WZGZ2Z6.js";import"./chunk-BGG3ZSMW.js";import"./chunk-ZVP6GB4G.js";import"./chunk-S2GAEH2F.js";import"./chunk-PPUN7YHA.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-EMGB23H5.js";import"./chunk-XGOBZCYC.js";import"./chunk-WCXXXAHV.js";import"./chunk-JWDJMFU6.js";import"./chunk-GRMCAO3Q.js";import"./chunk-KZKDVIOE.js";import"./chunk-LQE73AZR.js";import"./chunk-2D3RYIDU.js";import"./chunk-WEPON4FP.js";import"./chunk-AKLZ4YO2.js";import{A as D,B as z,C as V,a as ye,b as we,c as Se,d as Ae,e as Ie,f as Oe,g as Ne,h as He,i as je,j as Ue,k as _e,l as I,m as q,n as Be,o as qe,p as Ye,q as O,r as ze,s as Ve,t as Xe,u as x,v as Y,w as Qe,x as Ze,y as et,z as wt}from"./chunk-YV22EOGL.js";import"./chunk-Y4CYQV7G.js";import"./chunk-LLNPKE7H.js";import"./chunk-SHEUCITK.js";import"./chunk-XYT6XY7G.js";import"./chunk-VBJTGTF5.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-QWQOI4G4.js";import"./chunk-HNBW5Q47.js";import"./chunk-GLQLCBJS.js";import"./chunk-6W74CHNW.js";import{s as ut}from"./chunk-COWAAE54.js";import{a as L}from"./chunk-UG2OF2EI.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-X5C5W3E4.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-PH43FUU7.js";import"./chunk-52SIHG45.js";import"./chunk-VWTBHLMX.js";import"./chunk-TJ4P4WW2.js";import{a as ht}from"./chunk-EHLTZ6IB.js";import"./chunk-3PGPN323.js";import"./chunk-UJXS4MS3.js";import"./chunk-56KNKUFF.js";import{f as gt,g as ft}from"./chunk-LTH3AYXC.js";import"./chunk-WPNRDEHW.js";import"./chunk-36AXN6ZB.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-XX5QKBX4.js";import{j as it,k as rt,l as at}from"./chunk-3KYZOC7N.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-MYVHVJWZ.js";import"./chunk-AV7T3SYT.js";import"./chunk-Y5MFVVTM.js";import"./chunk-QD6IICK7.js";import"./chunk-QOYAX2FT.js";import"./chunk-4VVHGR7H.js";import{a as ke,b as ve,c as xe,d as $e,e as Ce,f as Pe,g as be,h as Te,i as Me,j as Re,l as Ee,m as Ge,o as T,p as W}from"./chunk-2PJKGZWP.js";import{a as m,b as G}from"./chunk-7I7IEX4S.js";import{b as Fe,c as Le,d as A,e as De}from"./chunk-JHCI6XCJ.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{ma as tt,oa as st,pa as ot,ra as nt}from"./chunk-Y27RUOD2.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-YHD4PHFX.js";import"./chunk-4FMZTM3W.js";import"./chunk-GTJIKXDB.js";import"./chunk-Z5CBUZIW.js";import"./chunk-BGG3ZSMW.js";import"./chunk-ZVP6GB4G.js";import"./chunk-S2GAEH2F.js";import"./chunk-PPUN7YHA.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-EMGB23H5.js";import"./chunk-XGOBZCYC.js";import"./chunk-WCXXXAHV.js";import"./chunk-JWDJMFU6.js";import"./chunk-GRMCAO3Q.js";import"./chunk-KZKDVIOE.js";import"./chunk-LQE73AZR.js";import"./chunk-2D3RYIDU.js";import"./chunk-WEPON4FP.js";import"./chunk-AKLZ4YO2.js";import{A as D,B as z,C as V,a as ye,b as we,c as Se,d as Ae,e as Ie,f as Oe,g as Ne,h as He,i as je,j as Ue,k as _e,l as I,m as q,n as Be,o as qe,p as Ye,q as O,r as ze,s as Ve,t as Xe,u as x,v as Y,w as Qe,x as Ze,y as et,z as wt}from"./chunk-DVR6PFCJ.js";import"./chunk-Y4CYQV7G.js";import"./chunk-LLNPKE7H.js";import"./chunk-SHEUCITK.js";import"./chunk-VJRITDSQ.js";import"./chunk-I3RAUJCD.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-CDLJOGVZ.js";import"./chunk-AOFTTIZZ.js";import"./chunk-GLQLCBJS.js";import"./chunk-MEFPXHQJ.js";import{s as ut}from"./chunk-CPMQZ6Z7.js";import{a as L}from"./chunk-UG2OF2EI.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-X5C5W3E4.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-BWSB7NOX.js";import"./chunk-A347YHEW.js";import"./chunk-VWTBHLMX.js";import"./chunk-4O4GZBKZ.js";import{a as ht}from"./chunk-BCUR2TJ7.js";import"./chunk-3PGPN323.js";import"./chunk-M7IJVOJA.js";import"./chunk-VD7IO653.js";import{f as gt,g as ft}from"./chunk-XIA2ACKX.js";import"./chunk-WPNRDEHW.js";import"./chunk-36AXN6ZB.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-XZN7QBRH.js";import{j as it,k as rt,l as at}from"./chunk-R6UCPHUD.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-MYVHVJWZ.js";import"./chunk-AV7T3SYT.js";import"./chunk-Y5MFVVTM.js";import"./chunk-QD6IICK7.js";import"./chunk-QOYAX2FT.js";import"./chunk-4VVHGR7H.js";import{a as ke,b as ve,c as xe,d as $e,e as Ce,f as Pe,g as be,h as Te,i as Me,j as Re,l as Ee,m as Ge,o as T,p as W}from"./chunk-2PJKGZWP.js";import{a as m,b as G}from"./chunk-7I7IEX4S.js";import{b as Fe,c as Le,d as A,e as De}from"./chunk-JHCI6XCJ.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{ma as tt,oa as st,pa as ot,ua as nt}from"./chunk-EOLEKSN6.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).
@@ -0,0 +1,8 @@
1
+ import"./chunk-QIJLFPWE.js";import{existsSync as y,readdirSync as k,readFileSync as b,statSync as N}from"fs";import{resolve as $}from"path";var R=new Set(["memory.md"]);function D(n){let e={dir:n,notes:[],skipped:[]};if(!y(n))return e;for(let t of k(n).sort()){if(!t.endsWith(".md")||t.startsWith(".")||R.has(t.toLowerCase()))continue;let s=$(n,t),d;try{if(!N(s).isFile())continue;d=b(s,"utf-8")}catch(i){e.skipped.push({file:t,reason:`unreadable: ${i.message}`});continue}let o=S(d,t);o?e.notes.push(o):e.skipped.push({file:t,reason:"empty"})}return e.notes.sort((t,s)=>t.name.localeCompare(s.name)||t.file.localeCompare(s.file)),e}function S(n,e){let t=n.replace(/^/,"").replace(/\r\n/g,`
2
+ `),{fields:s,metadata:d,body:o}=A(t);if(!o.trim()&&Object.keys(s).length===0)return null;let i=p=>{let f=s[p]??d[p];return f&&f.trim()?f.trim():void 0},a=o.split(`
3
+ `).map(p=>p.replace(/^#+\s*/,"").trim()).find(Boolean)??"",r={name:i("name")??e.replace(/\.md$/,""),file:e,description:i("description")??a,body:o.trim(),missing:[],problems:[]},c=i("type");c&&(r.type=c);let g=i("updated")??i("created");g&&(r.updated=g);let l=i("source");l?r.source=l:r.missing.push("source");let u=i("checked"),m=u?w(u):void 0;return m?r.checked=m:(r.missing.push("checked"),u&&r.problems.push(`checked "${u}" is not a date (use YYYY-MM-DD)`)),r}function w(n){let e=n.match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ][\d:.]+(?:Z|[+-]\d{2}:?\d{2})?)?$/);if(!e)return;let t=`${e[1]}-${e[2]}-${e[3]}`,s=Date.parse(`${t}T00:00:00Z`);return Number.isFinite(s)&&new Date(s).toISOString().slice(0,10)===t?t:void 0}function A(n){let e={},t={};if(!n.startsWith(`---
4
+ `))return{fields:e,metadata:t,body:n};let s=n.indexOf(`
5
+ ---`,4);if(s<0)return{fields:e,metadata:t,body:n};let d=n.indexOf(`
6
+ `,s+4),o=d<0?"":n.slice(d+1),i;for(let a of n.slice(4,s).split(`
7
+ `)){let r=a.match(/^\s+([A-Za-z_][\w-]*):\s*(.*)$/);if(r){i==="metadata"&&(t[r[1]]=h(r[2]));continue}let c=a.match(/^([A-Za-z_][\w-]*):\s*(.*)$/);if(c){if(c[2].trim()===""){i=c[1];continue}i=void 0,e[c[1]]=h(c[2])}}return{fields:e,metadata:t,body:o}}function h(n){let e=n.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1).replace(/\\"/g,'"'):e.length>=2&&e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1).replace(/''/g,"'"):e}export{S as parseNote,D as readNotes};
8
+ //# sourceMappingURL=note-reader-LPPIYYLT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/wiki/note-reader.ts"],"sourcesContent":["import { existsSync, readdirSync, readFileSync, statSync } from \"fs\"\nimport { resolve } from \"path\"\n\n// --- Reading an agent's notes (#850) ---\n//\n// An agent's notes are small markdown files with frontmatter, one fact or\n// one current state each. They live in one of two places:\n//\n// - the AgentX note store, `.agentx/agent-memory/<agent>/<type>_<name>.md`\n// (src/agents/agent-memory.ts), with `name`, `description`, `type`,\n// `created` and `updated`;\n// - a notes folder another tool keeps, such as the one a `claude-code`\n// agent writes outside AgentX: `<name>.md` with `name`, `description`\n// and `type`, sometimes with extra fields under a `metadata:` block.\n//\n// Both are read the same way. Two more fields say whether a note can be\n// trusted as written: `source` (where it was checked) and `checked` (the\n// date it was checked). They are read from the top level or from under\n// `metadata:`, never guessed from the prose. A note without them is still\n// returned, with `missing` naming what it lacks.\n//\n// Read only: nothing here writes a note.\n\nexport type NoteField = \"source\" | \"checked\"\n\nexport interface AgentNote {\n /** Frontmatter `name`, else the file name without `.md`. */\n name: string\n /** File name inside the notes folder. */\n file: string\n /** `user`, `feedback`, `project`, `reference`, or what the file says. */\n type?: string\n /** One line saying what the note holds. */\n description: string\n body: string\n /** Where the note's content was checked. */\n source?: string\n /** When it was checked, YYYY-MM-DD. */\n checked?: string\n /** When the note was last written, as the file says. */\n updated?: string\n /** `source` and `checked`, when absent or unreadable. */\n missing: NoteField[]\n /** Why a field present in the file could not be used. */\n problems: string[]\n}\n\nexport interface NotesRead {\n dir: string\n notes: AgentNote[]\n /** Files that are not notes, with the reason. */\n skipped: Array<{ file: string; reason: string }>\n}\n\n/** The index files tools keep next to the notes; not notes themselves. */\nconst INDEX_FILES = new Set([\"memory.md\"])\n\n/**\n * Every note in `dir`, sorted by name. Only `*.md` files directly in the\n * folder are read; sub-folders (such as `_versions/`) and the `MEMORY.md`\n * index are not notes. A folder that does not exist reads as empty.\n */\nexport function readNotes(dir: string): NotesRead {\n const out: NotesRead = { dir, notes: [], skipped: [] }\n if (!existsSync(dir)) return out\n for (const file of readdirSync(dir).sort()) {\n if (!file.endsWith(\".md\") || file.startsWith(\".\") || INDEX_FILES.has(file.toLowerCase())) continue\n const path = resolve(dir, file)\n let raw: string\n try {\n if (!statSync(path).isFile()) continue\n raw = readFileSync(path, \"utf-8\")\n } catch (err) {\n out.skipped.push({ file, reason: `unreadable: ${(err as Error).message}` })\n continue\n }\n const note = parseNote(raw, file)\n if (note) out.notes.push(note)\n else out.skipped.push({ file, reason: \"empty\" })\n }\n out.notes.sort((a, b) => a.name.localeCompare(b.name) || a.file.localeCompare(b.file))\n return out\n}\n\n/**\n * One note from its file content. A file without frontmatter is still a\n * note: its first line is its description, and it has no source or check\n * date. Returns null for an empty file.\n */\nexport function parseNote(raw: string, file: string): AgentNote | null {\n const text = raw.replace(/^/, \"\").replace(/\\r\\n/g, \"\\n\")\n const { fields, metadata, body } = splitFrontmatter(text)\n if (!body.trim() && Object.keys(fields).length === 0) return null\n\n const pick = (key: string): string | undefined => {\n const v = fields[key] ?? metadata[key]\n return v && v.trim() ? v.trim() : undefined\n }\n const firstLine = body.split(\"\\n\").map((l) => l.replace(/^#+\\s*/, \"\").trim()).find(Boolean) ?? \"\"\n const note: AgentNote = {\n name: pick(\"name\") ?? file.replace(/\\.md$/, \"\"),\n file,\n description: pick(\"description\") ?? firstLine,\n body: body.trim(),\n missing: [],\n problems: [],\n }\n const type = pick(\"type\")\n if (type) note.type = type\n const updated = pick(\"updated\") ?? pick(\"created\")\n if (updated) note.updated = updated\n\n const source = pick(\"source\")\n if (source) note.source = source\n else note.missing.push(\"source\")\n\n const checkedRaw = pick(\"checked\")\n const checked = checkedRaw ? checkDate(checkedRaw) : undefined\n if (checked) note.checked = checked\n else {\n note.missing.push(\"checked\")\n if (checkedRaw) note.problems.push(`checked \"${checkedRaw}\" is not a date (use YYYY-MM-DD)`)\n }\n return note\n}\n\n/** YYYY-MM-DD from a date or an ISO date and time; undefined otherwise. */\nfunction checkDate(v: string): string | undefined {\n const m = v.match(/^(\\d{4})-(\\d{2})-(\\d{2})(?:[T ][\\d:.]+(?:Z|[+-]\\d{2}:?\\d{2})?)?$/)\n if (!m) return undefined\n const day = `${m[1]}-${m[2]}-${m[3]}`\n const t = Date.parse(`${day}T00:00:00Z`)\n // Rejects 2026-02-30 and the like, which Date.parse rolls over.\n return Number.isFinite(t) && new Date(t).toISOString().slice(0, 10) === day ? day : undefined\n}\n\n/**\n * Top-level `key: value` lines, and the indented `key: value` lines of a\n * `metadata:` block. No other YAML: lists, nested blocks other than\n * `metadata:` and multi-line values are ignored, not misread.\n */\nfunction splitFrontmatter(text: string): { fields: Record<string, string>; metadata: Record<string, string>; body: string } {\n const fields: Record<string, string> = {}\n const metadata: Record<string, string> = {}\n if (!text.startsWith(\"---\\n\")) return { fields, metadata, body: text }\n const end = text.indexOf(\"\\n---\", 4)\n if (end < 0) return { fields, metadata, body: text }\n const after = text.indexOf(\"\\n\", end + 4)\n const body = after < 0 ? \"\" : text.slice(after + 1)\n\n let block: string | undefined\n for (const line of text.slice(4, end).split(\"\\n\")) {\n const nested = line.match(/^\\s+([A-Za-z_][\\w-]*):\\s*(.*)$/)\n if (nested) {\n if (block === \"metadata\") metadata[nested[1]] = unquote(nested[2])\n continue\n }\n const top = line.match(/^([A-Za-z_][\\w-]*):\\s*(.*)$/)\n if (!top) continue\n if (top[2].trim() === \"\") { block = top[1]; continue }\n block = undefined\n fields[top[1]] = unquote(top[2])\n }\n return { fields, metadata, body }\n}\n\nfunction unquote(v: string): string {\n const s = v.trim()\n if (s.length >= 2 && s.startsWith(\"\\\"\") && s.endsWith(\"\\\"\")) return s.slice(1, -1).replace(/\\\\\"/g, \"\\\"\")\n if (s.length >= 2 && s.startsWith(\"'\") && s.endsWith(\"'\")) return s.slice(1, -1).replace(/''/g, \"'\")\n return s\n}\n"],"mappings":"4BAAA,OAAS,cAAAA,EAAY,eAAAC,EAAa,gBAAAC,EAAc,YA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AAO,GAAG,EAC5FA,CACT","names":["existsSync","readdirSync","readFileSync","statSync","resolve","INDEX_FILES","readNotes","dir","out","file","path","raw","err","note","parseNote","a","b","text","fields","metadata","body","splitFrontmatter","pick","key","v","firstLine","l","type","updated","source","checkedRaw","checked","checkDate","m","day","t","end","after","block","line","nested","unquote","top","s"]}
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g,h,i}from"./chunk-52SIHG45.js";import"./chunk-QIJLFPWE.js";export{c as DEFAULT_MAX_DEFERRALS,b as NOTE_LIMITS,a as NOTE_OUTCOMES,g as NoteStore,h as isWaiting,d as noteId,i as renderNotesInbox,e as today,f as validateNote};
2
- //# sourceMappingURL=notes-YLTNRMB5.js.map
1
+ import{a,b,c,d,e,f,g,h,i}from"./chunk-A347YHEW.js";import"./chunk-QIJLFPWE.js";export{c as DEFAULT_MAX_DEFERRALS,b as NOTE_LIMITS,a as NOTE_OUTCOMES,g as NoteStore,h as isWaiting,d as noteId,i as renderNotesInbox,e as today,f as validateNote};
2
+ //# sourceMappingURL=notes-2VC47RCK.js.map