agentix-cli 0.106.0 → 0.108.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 (123) hide show
  1. package/dist/{App-PVMJEC3G.js → App-4VWAQOVA.js} +2 -2
  2. package/dist/{ChatApp-GWIOURQL.js → ChatApp-KOTGUDZH.js} +2 -2
  3. package/dist/{agent-IOHJGUZT.js → agent-7HO3IIRJ.js} +2 -2
  4. package/dist/{board-dashboard-OA4WFL3D.js → board-dashboard-2X4OKKOM.js} +4 -4
  5. package/dist/{chunk-ZD5ECP5D.js → chunk-2VGYRETU.js} +2 -2
  6. package/dist/chunk-36AXN6ZB.js +11 -0
  7. package/dist/chunk-36AXN6ZB.js.map +1 -0
  8. package/dist/{chunk-4MESMUND.js → chunk-5O6PIO7F.js} +2 -2
  9. package/dist/{chunk-5D5NKZSD.js → chunk-6F2E5NQA.js} +2 -2
  10. package/dist/chunk-6W74CHNW.js +26 -0
  11. package/dist/chunk-6W74CHNW.js.map +1 -0
  12. package/dist/{chunk-DJMK22SB.js → chunk-BFOB6ERR.js} +2 -2
  13. package/dist/{chunk-VYSFOONA.js → chunk-BG6SOGKT.js} +2 -2
  14. package/dist/{chunk-3IEFHOPH.js → chunk-BZKGQMU2.js} +2 -2
  15. package/dist/{chunk-QCKUXJJ3.js → chunk-CJL5OPNQ.js} +2 -2
  16. package/dist/{chunk-MTP2RH3P.js → chunk-CJR26JUI.js} +2 -2
  17. package/dist/{chunk-H5LQXHQQ.js → chunk-D7M4WQFU.js} +11 -11
  18. package/dist/chunk-D7M4WQFU.js.map +1 -0
  19. package/dist/{chunk-YZJCOWHU.js → chunk-FHI5WPFO.js} +2 -2
  20. package/dist/{chunk-UZ5Q6Q2X.js → chunk-GCE7T5QL.js} +187 -187
  21. package/dist/chunk-GCE7T5QL.js.map +1 -0
  22. package/dist/chunk-J32LSOBJ.js +2 -0
  23. package/dist/chunk-J32LSOBJ.js.map +1 -0
  24. package/dist/{chunk-ZROS7GX2.js → chunk-KBYZTCHO.js} +2 -2
  25. package/dist/chunk-LH54FH7J.js +153 -0
  26. package/dist/chunk-LH54FH7J.js.map +1 -0
  27. package/dist/{chunk-SGOXLRY4.js → chunk-MJWJ3JVA.js} +2 -2
  28. package/dist/{chunk-HRX7FIOO.js → chunk-NIW75USA.js} +2 -2
  29. package/dist/{chunk-W3LSDADF.js → chunk-QFP4YZII.js} +2 -2
  30. package/dist/{chunk-CZFGADZ2.js → chunk-QQAZ6EJP.js} +2 -2
  31. package/dist/{chunk-GGB5JMII.js → chunk-S4NZUPIN.js} +2 -2
  32. package/dist/{chunk-UW6RUGNV.js → chunk-SFPMS55Z.js} +2 -2
  33. package/dist/chunk-UDJAODAB.js +100 -0
  34. package/dist/chunk-UDJAODAB.js.map +1 -0
  35. package/dist/{chunk-CHQ5Q4QO.js → chunk-UTV4DRAW.js} +2 -2
  36. package/dist/cli.js +1 -1
  37. package/dist/{client-DLRQIQZU.js → client-VYMTUZKN.js} +2 -2
  38. package/dist/{config-32FKG36S.js → config-J6CNV23P.js} +2 -2
  39. package/dist/config-mutator-RGC72OEU.js +2 -0
  40. package/dist/{doctor-ALOXJM5G.js → doctor-GHUPUBET.js} +2 -2
  41. package/dist/index.d.ts +238 -3
  42. package/dist/index.js +1 -1
  43. package/dist/index.js.map +1 -1
  44. package/dist/{program-DSUZFBJZ.js → program-LSQMLS6W.js} +109 -109
  45. package/dist/program-LSQMLS6W.js.map +1 -0
  46. package/dist/{promote-SXH7DKMC.js → promote-KY3Y2PVU.js} +2 -2
  47. package/dist/{query-WKBSHVWZ.js → query-BYCRYDM3.js} +2 -2
  48. package/dist/registry-TR5ANP2Z.js +2 -0
  49. package/dist/{request-planner-GV5NAXQ5.js → request-planner-YOUVO3BR.js} +2 -2
  50. package/dist/{review-candidates-AWIUSB3O.js → review-candidates-56ZPJNXW.js} +2 -2
  51. package/dist/routing-WKS2CZYF.js +2 -0
  52. package/dist/schedule-tool-4L6QAILN.js +2 -0
  53. package/dist/scheduler-65SE3WJJ.js +2 -0
  54. package/dist/{seat-EQKPGMJE.js → seat-EO3EVBH3.js} +2 -2
  55. package/dist/{select-RJCBMM3O.js → select-73JC2YBN.js} +2 -2
  56. package/dist/{set-enabled-ADQH7VKE.js → set-enabled-WQAO4BFF.js} +2 -2
  57. package/dist/token-tracker-W7DFDEFN.js +2 -0
  58. package/dist/{tool-K4MU42KH.js → tool-GCPMPPUE.js} +2 -2
  59. package/dist/{tool-JPHWWTZI.js → tool-QDU6MY6B.js} +2 -2
  60. package/dist/usage-channels-KBLEC4NE.js +2 -0
  61. package/dist/usage-channels-KBLEC4NE.js.map +1 -0
  62. package/dist/wiki-CQZE5Z5C.js +2 -0
  63. package/dist/workspace-setup-EA3G42NY.js +2 -0
  64. package/dist/workspace-setup-EA3G42NY.js.map +1 -0
  65. package/package.json +1 -1
  66. package/dist/chunk-DP7RTNDM.js +0 -24
  67. package/dist/chunk-DP7RTNDM.js.map +0 -1
  68. package/dist/chunk-DWADWDMU.js +0 -96
  69. package/dist/chunk-DWADWDMU.js.map +0 -1
  70. package/dist/chunk-H5LQXHQQ.js.map +0 -1
  71. package/dist/chunk-PWTSY77F.js +0 -2
  72. package/dist/chunk-PWTSY77F.js.map +0 -1
  73. package/dist/chunk-UZ5Q6Q2X.js.map +0 -1
  74. package/dist/chunk-YSMPXFQR.js +0 -154
  75. package/dist/chunk-YSMPXFQR.js.map +0 -1
  76. package/dist/config-mutator-2VM2FWRF.js +0 -2
  77. package/dist/program-DSUZFBJZ.js.map +0 -1
  78. package/dist/registry-DAWQT4D4.js +0 -2
  79. package/dist/routing-35ETOM24.js +0 -2
  80. package/dist/schedule-tool-BXRRN3IE.js +0 -2
  81. package/dist/scheduler-PIZG2JA4.js +0 -2
  82. package/dist/wiki-RHHHYUTK.js +0 -2
  83. package/dist/workspace-setup-42ARC42I.js +0 -2
  84. /package/dist/{App-PVMJEC3G.js.map → App-4VWAQOVA.js.map} +0 -0
  85. /package/dist/{ChatApp-GWIOURQL.js.map → ChatApp-KOTGUDZH.js.map} +0 -0
  86. /package/dist/{agent-IOHJGUZT.js.map → agent-7HO3IIRJ.js.map} +0 -0
  87. /package/dist/{board-dashboard-OA4WFL3D.js.map → board-dashboard-2X4OKKOM.js.map} +0 -0
  88. /package/dist/{chunk-ZD5ECP5D.js.map → chunk-2VGYRETU.js.map} +0 -0
  89. /package/dist/{chunk-4MESMUND.js.map → chunk-5O6PIO7F.js.map} +0 -0
  90. /package/dist/{chunk-5D5NKZSD.js.map → chunk-6F2E5NQA.js.map} +0 -0
  91. /package/dist/{chunk-DJMK22SB.js.map → chunk-BFOB6ERR.js.map} +0 -0
  92. /package/dist/{chunk-VYSFOONA.js.map → chunk-BG6SOGKT.js.map} +0 -0
  93. /package/dist/{chunk-3IEFHOPH.js.map → chunk-BZKGQMU2.js.map} +0 -0
  94. /package/dist/{chunk-QCKUXJJ3.js.map → chunk-CJL5OPNQ.js.map} +0 -0
  95. /package/dist/{chunk-MTP2RH3P.js.map → chunk-CJR26JUI.js.map} +0 -0
  96. /package/dist/{chunk-YZJCOWHU.js.map → chunk-FHI5WPFO.js.map} +0 -0
  97. /package/dist/{chunk-ZROS7GX2.js.map → chunk-KBYZTCHO.js.map} +0 -0
  98. /package/dist/{chunk-SGOXLRY4.js.map → chunk-MJWJ3JVA.js.map} +0 -0
  99. /package/dist/{chunk-HRX7FIOO.js.map → chunk-NIW75USA.js.map} +0 -0
  100. /package/dist/{chunk-W3LSDADF.js.map → chunk-QFP4YZII.js.map} +0 -0
  101. /package/dist/{chunk-CZFGADZ2.js.map → chunk-QQAZ6EJP.js.map} +0 -0
  102. /package/dist/{chunk-GGB5JMII.js.map → chunk-S4NZUPIN.js.map} +0 -0
  103. /package/dist/{chunk-UW6RUGNV.js.map → chunk-SFPMS55Z.js.map} +0 -0
  104. /package/dist/{chunk-CHQ5Q4QO.js.map → chunk-UTV4DRAW.js.map} +0 -0
  105. /package/dist/{client-DLRQIQZU.js.map → client-VYMTUZKN.js.map} +0 -0
  106. /package/dist/{config-32FKG36S.js.map → config-J6CNV23P.js.map} +0 -0
  107. /package/dist/{config-mutator-2VM2FWRF.js.map → config-mutator-RGC72OEU.js.map} +0 -0
  108. /package/dist/{doctor-ALOXJM5G.js.map → doctor-GHUPUBET.js.map} +0 -0
  109. /package/dist/{promote-SXH7DKMC.js.map → promote-KY3Y2PVU.js.map} +0 -0
  110. /package/dist/{query-WKBSHVWZ.js.map → query-BYCRYDM3.js.map} +0 -0
  111. /package/dist/{registry-DAWQT4D4.js.map → registry-TR5ANP2Z.js.map} +0 -0
  112. /package/dist/{request-planner-GV5NAXQ5.js.map → request-planner-YOUVO3BR.js.map} +0 -0
  113. /package/dist/{review-candidates-AWIUSB3O.js.map → review-candidates-56ZPJNXW.js.map} +0 -0
  114. /package/dist/{routing-35ETOM24.js.map → routing-WKS2CZYF.js.map} +0 -0
  115. /package/dist/{schedule-tool-BXRRN3IE.js.map → schedule-tool-4L6QAILN.js.map} +0 -0
  116. /package/dist/{scheduler-PIZG2JA4.js.map → scheduler-65SE3WJJ.js.map} +0 -0
  117. /package/dist/{seat-EQKPGMJE.js.map → seat-EO3EVBH3.js.map} +0 -0
  118. /package/dist/{select-RJCBMM3O.js.map → select-73JC2YBN.js.map} +0 -0
  119. /package/dist/{set-enabled-ADQH7VKE.js.map → set-enabled-WQAO4BFF.js.map} +0 -0
  120. /package/dist/{wiki-RHHHYUTK.js.map → token-tracker-W7DFDEFN.js.map} +0 -0
  121. /package/dist/{tool-K4MU42KH.js.map → tool-GCPMPPUE.js.map} +0 -0
  122. /package/dist/{tool-JPHWWTZI.js.map → tool-QDU6MY6B.js.map} +0 -0
  123. /package/dist/{workspace-setup-42ARC42I.js.map → wiki-CQZE5Z5C.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -1585,6 +1585,35 @@ declare const agentConfigSchema: z.ZodObject<{
1585
1585
  * e.g. benchmark agents never draw on the fleet's subscription quota.
1586
1586
  * An "api" agent with no key fails its task rather than falling back. */
1587
1587
  billing: z.ZodDefault<z.ZodEnum<["subscription", "api"]>>;
1588
+ /** Run GitHub coding tasks as Claude cloud sessions (`claude --cloud`)
1589
+ * instead of local runs (#622). Off by default. Needs
1590
+ * `channels.github.cloudSessions: true` too. Only a task from the GitHub
1591
+ * channel for an issue or pull request of a repository this node has a
1592
+ * checkout of (the project rule's `runbook` path, or the agent's
1593
+ * workspace) goes to the cloud; everything else runs locally. The result
1594
+ * is a pull request, not a reply. A launch that fails falls back to a
1595
+ * local run. See src/agents/cloud-sessions.ts. */
1596
+ cloudSessions: z.ZodDefault<z.ZodObject<{
1597
+ enabled: z.ZodDefault<z.ZodBoolean>;
1598
+ /** Launches per calendar day for this agent; 0 = no cap. */
1599
+ maxPerDay: z.ZodDefault<z.ZodNumber>;
1600
+ /** Hours a launched session counts as open: no local run starts for
1601
+ * its issue, and comments on the issue are forwarded to it. */
1602
+ openHours: z.ZodDefault<z.ZodNumber>;
1603
+ /** Seconds `claude --cloud` may take to print the session id before
1604
+ * the launch is given up and the task runs locally. */
1605
+ launchTimeoutSeconds: z.ZodDefault<z.ZodNumber>;
1606
+ }, "strip", z.ZodTypeAny, {
1607
+ enabled: boolean;
1608
+ maxPerDay: number;
1609
+ openHours: number;
1610
+ launchTimeoutSeconds: number;
1611
+ }, {
1612
+ enabled?: boolean | undefined;
1613
+ maxPerDay?: number | undefined;
1614
+ openHours?: number | undefined;
1615
+ launchTimeoutSeconds?: number | undefined;
1616
+ }>>;
1588
1617
  /** Improvement plan #3 — tool-use-required preset. When set,
1589
1618
  * AgentX inspects the stream-json events from each task and
1590
1619
  * fails the response with `tool_required_not_called: <name>`
@@ -1864,6 +1893,12 @@ declare const agentConfigSchema: z.ZodObject<{
1864
1893
  preSpawnTimeoutSec: number;
1865
1894
  permissionMode: string;
1866
1895
  billing: "api" | "subscription";
1896
+ cloudSessions: {
1897
+ enabled: boolean;
1898
+ maxPerDay: number;
1899
+ openHours: number;
1900
+ launchTimeoutSeconds: number;
1901
+ };
1867
1902
  toolUseRequired: string[];
1868
1903
  persistentProcess: boolean;
1869
1904
  queueMode: "drop" | "collect" | "followup";
@@ -1978,6 +2013,12 @@ declare const agentConfigSchema: z.ZodObject<{
1978
2013
  drainTimeoutSeconds?: number | undefined;
1979
2014
  permissionMode?: string | undefined;
1980
2015
  billing?: "api" | "subscription" | undefined;
2016
+ cloudSessions?: {
2017
+ enabled?: boolean | undefined;
2018
+ maxPerDay?: number | undefined;
2019
+ openHours?: number | undefined;
2020
+ launchTimeoutSeconds?: number | undefined;
2021
+ } | undefined;
1981
2022
  toolUseRequired?: string[] | undefined;
1982
2023
  gitlabAutoReply?: boolean | undefined;
1983
2024
  persistentProcess?: boolean | undefined;
@@ -2394,6 +2435,35 @@ declare const daemonConfigSchema: z.ZodObject<{
2394
2435
  * e.g. benchmark agents never draw on the fleet's subscription quota.
2395
2436
  * An "api" agent with no key fails its task rather than falling back. */
2396
2437
  billing: z.ZodDefault<z.ZodEnum<["subscription", "api"]>>;
2438
+ /** Run GitHub coding tasks as Claude cloud sessions (`claude --cloud`)
2439
+ * instead of local runs (#622). Off by default. Needs
2440
+ * `channels.github.cloudSessions: true` too. Only a task from the GitHub
2441
+ * channel for an issue or pull request of a repository this node has a
2442
+ * checkout of (the project rule's `runbook` path, or the agent's
2443
+ * workspace) goes to the cloud; everything else runs locally. The result
2444
+ * is a pull request, not a reply. A launch that fails falls back to a
2445
+ * local run. See src/agents/cloud-sessions.ts. */
2446
+ cloudSessions: z.ZodDefault<z.ZodObject<{
2447
+ enabled: z.ZodDefault<z.ZodBoolean>;
2448
+ /** Launches per calendar day for this agent; 0 = no cap. */
2449
+ maxPerDay: z.ZodDefault<z.ZodNumber>;
2450
+ /** Hours a launched session counts as open: no local run starts for
2451
+ * its issue, and comments on the issue are forwarded to it. */
2452
+ openHours: z.ZodDefault<z.ZodNumber>;
2453
+ /** Seconds `claude --cloud` may take to print the session id before
2454
+ * the launch is given up and the task runs locally. */
2455
+ launchTimeoutSeconds: z.ZodDefault<z.ZodNumber>;
2456
+ }, "strip", z.ZodTypeAny, {
2457
+ enabled: boolean;
2458
+ maxPerDay: number;
2459
+ openHours: number;
2460
+ launchTimeoutSeconds: number;
2461
+ }, {
2462
+ enabled?: boolean | undefined;
2463
+ maxPerDay?: number | undefined;
2464
+ openHours?: number | undefined;
2465
+ launchTimeoutSeconds?: number | undefined;
2466
+ }>>;
2397
2467
  /** Improvement plan #3 — tool-use-required preset. When set,
2398
2468
  * AgentX inspects the stream-json events from each task and
2399
2469
  * fails the response with `tool_required_not_called: <name>`
@@ -2673,6 +2743,12 @@ declare const daemonConfigSchema: z.ZodObject<{
2673
2743
  preSpawnTimeoutSec: number;
2674
2744
  permissionMode: string;
2675
2745
  billing: "api" | "subscription";
2746
+ cloudSessions: {
2747
+ enabled: boolean;
2748
+ maxPerDay: number;
2749
+ openHours: number;
2750
+ launchTimeoutSeconds: number;
2751
+ };
2676
2752
  toolUseRequired: string[];
2677
2753
  persistentProcess: boolean;
2678
2754
  queueMode: "drop" | "collect" | "followup";
@@ -2787,6 +2863,12 @@ declare const daemonConfigSchema: z.ZodObject<{
2787
2863
  drainTimeoutSeconds?: number | undefined;
2788
2864
  permissionMode?: string | undefined;
2789
2865
  billing?: "api" | "subscription" | undefined;
2866
+ cloudSessions?: {
2867
+ enabled?: boolean | undefined;
2868
+ maxPerDay?: number | undefined;
2869
+ openHours?: number | undefined;
2870
+ launchTimeoutSeconds?: number | undefined;
2871
+ } | undefined;
2790
2872
  toolUseRequired?: string[] | undefined;
2791
2873
  gitlabAutoReply?: boolean | undefined;
2792
2874
  persistentProcess?: boolean | undefined;
@@ -3139,6 +3221,10 @@ declare const daemonConfigSchema: z.ZodObject<{
3139
3221
  /** Legacy auto-reply — same semantics as gitlab.autoReplyLegacy.
3140
3222
  * Defaults true; set false once agent skills use channel.reply. */
3141
3223
  autoReplyLegacy: z.ZodDefault<z.ZodBoolean>;
3224
+ /** Let agents whose `cloudSessions.enabled` is on send this channel's
3225
+ * issue and pull request tasks to Claude cloud sessions (#622). Off by
3226
+ * default: both this and the agent setting must be on. */
3227
+ cloudSessions: z.ZodDefault<z.ZodBoolean>;
3142
3228
  /** GitHub PAT or env var (${GITHUB_TOKEN}) for posting comments back. */
3143
3229
  token: z.ZodOptional<z.ZodString>;
3144
3230
  /** Path to file containing the token (first line read at startup). */
@@ -3199,6 +3285,7 @@ declare const daemonConfigSchema: z.ZodObject<{
3199
3285
  debounceSeconds: z.ZodDefault<z.ZodNumber>;
3200
3286
  }, "strip", z.ZodTypeAny, {
3201
3287
  enabled: boolean;
3288
+ cloudSessions: boolean;
3202
3289
  routes: {
3203
3290
  agent: string;
3204
3291
  repo: string;
@@ -3224,6 +3311,7 @@ declare const daemonConfigSchema: z.ZodObject<{
3224
3311
  }, {
3225
3312
  enabled?: boolean | undefined;
3226
3313
  token?: string | undefined;
3314
+ cloudSessions?: boolean | undefined;
3227
3315
  routes?: {
3228
3316
  agent: string;
3229
3317
  repo: string;
@@ -3632,6 +3720,7 @@ declare const daemonConfigSchema: z.ZodObject<{
3632
3720
  };
3633
3721
  github: {
3634
3722
  enabled: boolean;
3723
+ cloudSessions: boolean;
3635
3724
  routes: {
3636
3725
  agent: string;
3637
3726
  repo: string;
@@ -3780,6 +3869,7 @@ declare const daemonConfigSchema: z.ZodObject<{
3780
3869
  github?: {
3781
3870
  enabled?: boolean | undefined;
3782
3871
  token?: string | undefined;
3872
+ cloudSessions?: boolean | undefined;
3783
3873
  routes?: {
3784
3874
  agent: string;
3785
3875
  repo: string;
@@ -6534,14 +6624,76 @@ declare const daemonConfigSchema: z.ZodObject<{
6534
6624
  /** Replace the pushed landscape, chat history and cross-chat
6535
6625
  * context with one line naming the tools that fetch them. */
6536
6626
  contextOnDemand: z.ZodDefault<z.ZodBoolean>;
6627
+ /** Built-in Claude Code tools a lean session gets, passed as
6628
+ * `--tools` next to `--strict-mcp-config` (#615). Empty, the
6629
+ * default, keeps every built-in tool. The tool schemas are about
6630
+ * 14k tokens of a first turn, so a short list is what brings a lean
6631
+ * start under 20k; an agent that lacks a tool it needs fails
6632
+ * mid-task, so this stays opt-in. The agentx MCP tools are not
6633
+ * affected. claude-code agents only. */
6634
+ tools: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
6635
+ /** The same per channel; a channel's non-empty list wins over
6636
+ * `tools`. */
6637
+ toolsByChannel: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
6537
6638
  }, "strip", z.ZodTypeAny, {
6639
+ tools: string[];
6538
6640
  mcpServers: string[];
6539
6641
  settingSources: ("user" | "local" | "project")[];
6540
6642
  contextOnDemand: boolean;
6643
+ toolsByChannel: Record<string, string[]>;
6541
6644
  }, {
6645
+ tools?: string[] | undefined;
6542
6646
  mcpServers?: string[] | undefined;
6543
6647
  settingSources?: ("user" | "local" | "project")[] | undefined;
6544
6648
  contextOnDemand?: boolean | undefined;
6649
+ toolsByChannel?: Record<string, string[]> | undefined;
6650
+ }>>;
6651
+ /** Longest the agent-memory index (MEMORY.md) may be where it is
6652
+ * loaded on every session: merged into each workspace's CLAUDE.md
6653
+ * and inlined in the system prompt (#615). 0, the default, keeps the
6654
+ * whole index. Cut whole lines only; a closing line counts the
6655
+ * entries left out and points at `.agentx-memory.md`, which always
6656
+ * holds the full index, and at `agentx memory index`. Applies to the
6657
+ * prompt on save; the CLAUDE.md block follows at the next daemon
6658
+ * start or memory change. */
6659
+ memoryIndexMaxChars: z.ZodDefault<z.ZodNumber>;
6660
+ /** ObservationPack (#621). A large tool result stays in the context
6661
+ * and is re-read on every later request. With this on, a Claude Code
6662
+ * PostToolUse hook saves a text result over `limitBytes` to
6663
+ * `.agentx/observations/<agent id>/` and shows the model its first and last
6664
+ * bytes plus the path of the saved original, which it can Read or
6665
+ * grep. Off by default. claude-code agents only. Turning it on, or
6666
+ * changing `tools`, takes a daemon restart (the hook is written into
6667
+ * each workspace's .claude/settings.json at start); turning it off
6668
+ * applies on save. See src/agents/observation-pack.ts. */
6669
+ observationPack: z.ZodDefault<z.ZodObject<{
6670
+ enabled: z.ZodDefault<z.ZodBoolean>;
6671
+ /** A text result larger than this many bytes is packed. */
6672
+ limitBytes: z.ZodDefault<z.ZodNumber>;
6673
+ /** Bytes of the start and of the end of the original the model sees. */
6674
+ headBytes: z.ZodDefault<z.ZodNumber>;
6675
+ tailBytes: z.ZodDefault<z.ZodNumber>;
6676
+ /** Tools the pack applies to. Each entry must match the whole tool
6677
+ * name and may be a regular expression. `Read` is left out by
6678
+ * default: an agent that sees only the two ends of a file it is
6679
+ * about to edit has to read it again in pages. */
6680
+ tools: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
6681
+ /** Days a saved original is kept. 0 keeps every original. */
6682
+ retentionDays: z.ZodDefault<z.ZodNumber>;
6683
+ }, "strip", z.ZodTypeAny, {
6684
+ enabled: boolean;
6685
+ tools: string[];
6686
+ retentionDays: number;
6687
+ limitBytes: number;
6688
+ headBytes: number;
6689
+ tailBytes: number;
6690
+ }, {
6691
+ enabled?: boolean | undefined;
6692
+ tools?: string[] | undefined;
6693
+ retentionDays?: number | undefined;
6694
+ limitBytes?: number | undefined;
6695
+ headBytes?: number | undefined;
6696
+ tailBytes?: number | undefined;
6545
6697
  }>>;
6546
6698
  }, "strip", z.ZodTypeAny, {
6547
6699
  contextStrategy: "layered" | "planner";
@@ -6551,11 +6703,22 @@ declare const daemonConfigSchema: z.ZodObject<{
6551
6703
  tierTwoThresholdTokensByChannel: Record<string, number>;
6552
6704
  continuityStateTurns: number;
6553
6705
  lean: {
6706
+ tools: string[];
6554
6707
  mcpServers: string[];
6555
6708
  settingSources: ("user" | "local" | "project")[];
6556
6709
  contextOnDemand: boolean;
6710
+ toolsByChannel: Record<string, string[]>;
6557
6711
  };
6558
6712
  profileByChannel: Record<string, "full" | "lean">;
6713
+ memoryIndexMaxChars: number;
6714
+ observationPack: {
6715
+ enabled: boolean;
6716
+ tools: string[];
6717
+ retentionDays: number;
6718
+ limitBytes: number;
6719
+ headBytes: number;
6720
+ tailBytes: number;
6721
+ };
6559
6722
  maxClaudeCodeDispatchesPerHour?: number | undefined;
6560
6723
  maxClaudeCodeDispatchesPer5h?: number | undefined;
6561
6724
  }, {
@@ -6568,11 +6731,22 @@ declare const daemonConfigSchema: z.ZodObject<{
6568
6731
  maxClaudeCodeDispatchesPer5h?: number | undefined;
6569
6732
  continuityStateTurns?: number | undefined;
6570
6733
  lean?: {
6734
+ tools?: string[] | undefined;
6571
6735
  mcpServers?: string[] | undefined;
6572
6736
  settingSources?: ("user" | "local" | "project")[] | undefined;
6573
6737
  contextOnDemand?: boolean | undefined;
6738
+ toolsByChannel?: Record<string, string[]> | undefined;
6574
6739
  } | undefined;
6575
6740
  profileByChannel?: Record<string, "full" | "lean"> | undefined;
6741
+ memoryIndexMaxChars?: number | undefined;
6742
+ observationPack?: {
6743
+ enabled?: boolean | undefined;
6744
+ tools?: string[] | undefined;
6745
+ retentionDays?: number | undefined;
6746
+ limitBytes?: number | undefined;
6747
+ headBytes?: number | undefined;
6748
+ tailBytes?: number | undefined;
6749
+ } | undefined;
6576
6750
  }>>;
6577
6751
  /** Move B — JS/TS plugins. Each entry is an installed npm package name
6578
6752
  * (e.g. `agentx-plugin-mattermost` or `@acme/plugin-mattermost`); the
@@ -6635,6 +6809,12 @@ declare const daemonConfigSchema: z.ZodObject<{
6635
6809
  preSpawnTimeoutSec: number;
6636
6810
  permissionMode: string;
6637
6811
  billing: "api" | "subscription";
6812
+ cloudSessions: {
6813
+ enabled: boolean;
6814
+ maxPerDay: number;
6815
+ openHours: number;
6816
+ launchTimeoutSeconds: number;
6817
+ };
6638
6818
  toolUseRequired: string[];
6639
6819
  persistentProcess: boolean;
6640
6820
  queueMode: "drop" | "collect" | "followup";
@@ -6868,6 +7048,7 @@ declare const daemonConfigSchema: z.ZodObject<{
6868
7048
  };
6869
7049
  github: {
6870
7050
  enabled: boolean;
7051
+ cloudSessions: boolean;
6871
7052
  routes: {
6872
7053
  agent: string;
6873
7054
  repo: string;
@@ -7307,11 +7488,22 @@ declare const daemonConfigSchema: z.ZodObject<{
7307
7488
  tierTwoThresholdTokensByChannel: Record<string, number>;
7308
7489
  continuityStateTurns: number;
7309
7490
  lean: {
7491
+ tools: string[];
7310
7492
  mcpServers: string[];
7311
7493
  settingSources: ("user" | "local" | "project")[];
7312
7494
  contextOnDemand: boolean;
7495
+ toolsByChannel: Record<string, string[]>;
7313
7496
  };
7314
7497
  profileByChannel: Record<string, "full" | "lean">;
7498
+ memoryIndexMaxChars: number;
7499
+ observationPack: {
7500
+ enabled: boolean;
7501
+ tools: string[];
7502
+ retentionDays: number;
7503
+ limitBytes: number;
7504
+ headBytes: number;
7505
+ tailBytes: number;
7506
+ };
7315
7507
  maxClaudeCodeDispatchesPerHour?: number | undefined;
7316
7508
  maxClaudeCodeDispatchesPer5h?: number | undefined;
7317
7509
  };
@@ -7448,6 +7640,12 @@ declare const daemonConfigSchema: z.ZodObject<{
7448
7640
  drainTimeoutSeconds?: number | undefined;
7449
7641
  permissionMode?: string | undefined;
7450
7642
  billing?: "api" | "subscription" | undefined;
7643
+ cloudSessions?: {
7644
+ enabled?: boolean | undefined;
7645
+ maxPerDay?: number | undefined;
7646
+ openHours?: number | undefined;
7647
+ launchTimeoutSeconds?: number | undefined;
7648
+ } | undefined;
7451
7649
  toolUseRequired?: string[] | undefined;
7452
7650
  gitlabAutoReply?: boolean | undefined;
7453
7651
  persistentProcess?: boolean | undefined;
@@ -7722,6 +7920,7 @@ declare const daemonConfigSchema: z.ZodObject<{
7722
7920
  github?: {
7723
7921
  enabled?: boolean | undefined;
7724
7922
  token?: string | undefined;
7923
+ cloudSessions?: boolean | undefined;
7725
7924
  routes?: {
7726
7925
  agent: string;
7727
7926
  repo: string;
@@ -8156,11 +8355,22 @@ declare const daemonConfigSchema: z.ZodObject<{
8156
8355
  maxClaudeCodeDispatchesPer5h?: number | undefined;
8157
8356
  continuityStateTurns?: number | undefined;
8158
8357
  lean?: {
8358
+ tools?: string[] | undefined;
8159
8359
  mcpServers?: string[] | undefined;
8160
8360
  settingSources?: ("user" | "local" | "project")[] | undefined;
8161
8361
  contextOnDemand?: boolean | undefined;
8362
+ toolsByChannel?: Record<string, string[]> | undefined;
8162
8363
  } | undefined;
8163
8364
  profileByChannel?: Record<string, "full" | "lean"> | undefined;
8365
+ memoryIndexMaxChars?: number | undefined;
8366
+ observationPack?: {
8367
+ enabled?: boolean | undefined;
8368
+ tools?: string[] | undefined;
8369
+ retentionDays?: number | undefined;
8370
+ limitBytes?: number | undefined;
8371
+ headBytes?: number | undefined;
8372
+ tailBytes?: number | undefined;
8373
+ } | undefined;
8164
8374
  } | undefined;
8165
8375
  plugins?: string[] | undefined;
8166
8376
  processPool?: {
@@ -9756,6 +9966,16 @@ interface AgentResponse {
9756
9966
  * the task instead of a spawned provider (attach mode). Claude Code
9757
9967
  * session id of the terminal that wrote the reply. */
9758
9968
  viaAttachedSession?: string;
9969
+ /** Set when the task went to a Claude cloud session instead of a local
9970
+ * run (#622): the session's id and claude.ai/code URL. `followUp` marks
9971
+ * a comment forwarded to a session that was already open. The result of
9972
+ * the session is a pull request, so `content` is only the notice posted
9973
+ * on the issue. */
9974
+ cloudSession?: {
9975
+ id: string;
9976
+ url: string;
9977
+ followUp?: boolean;
9978
+ };
9759
9979
  /** Set on tasks that ran under a restricted autonomy level. */
9760
9980
  autonomy?: AutonomyLevel;
9761
9981
  /** Tool calls the autonomy guard blocked during this task — what the
@@ -11310,8 +11530,10 @@ declare class AgentMemory {
11310
11530
  restore(agentId: string, name: string, versionId: string, by?: MemoryProvenance): MemoryRecord | null;
11311
11531
  /** The content of MEMORY.md — used at prompt-build time to inline into
11312
11532
  * the agent's system prompt. Returns "" when the agent has no
11313
- * memories (so the prompt builder can no-op). */
11314
- indexMarkdown(agentId: string): string;
11533
+ * memories (so the prompt builder can no-op). With `maxChars` > 0 the
11534
+ * index is cut to that size (#615): whole lines only, and a closing line
11535
+ * says how many memories were left out and where the full index is. */
11536
+ indexMarkdown(agentId: string, maxChars?: number): string;
11315
11537
  /** Push the agent's memory into its workspace so Claude Code sessions
11316
11538
  * pick it up automatically. Does two things:
11317
11539
  *
@@ -11325,7 +11547,7 @@ declare class AgentMemory {
11325
11547
  * Never touches content outside the sentinel block — if the file
11326
11548
  * doesn't exist, creates it with just the sentinels. Safe to call
11327
11549
  * on any save / delete. */
11328
- syncToWorkspace(agentId: string, workspacePath: string): void;
11550
+ syncToWorkspace(agentId: string, workspacePath: string, maxChars?: number): void;
11329
11551
  /** Regenerate MEMORY.md from the on-disk files. Called automatically
11330
11552
  * after every save / remove; safe to call manually. */
11331
11553
  rewriteIndex(agentId: string): void;
@@ -11500,6 +11722,9 @@ declare class AgentRegistry {
11500
11722
  private taskAborts;
11501
11723
  /** Runs a daemon shutdown stopped, with the reason each one reports. */
11502
11724
  private interruptedRuns;
11725
+ /** Claude cloud sessions this node launched (#622), by issue. Created on
11726
+ * first use so a fleet with the setting off never touches the file. */
11727
+ private cloudSessions?;
11503
11728
  /** The context each running task was started with, by RunningTask id.
11504
11729
  * Kept apart from RunningTask because /agents serialises that, and a
11505
11730
  * context can carry a whole conversation history. Read by A2A
@@ -11623,6 +11848,16 @@ declare class AgentRegistry {
11623
11848
  * Get the primary channel handle for an agent (e.g. "@my_bot" on telegram).
11624
11849
  */
11625
11850
  private getChannelHandle;
11851
+ /** The store of cloud sessions this node launched (#622). */
11852
+ private cloudSessionStore;
11853
+ /** Where this task runs (#622): a Claude cloud session, a follow-up to one
11854
+ * already open for its issue, or locally. Decided before the dispatch
11855
+ * gates, which only guard a local spawn. Cheap when the setting is off. */
11856
+ private planCloudSession;
11857
+ /** Launches the cloud session (or forwards to the open one) and records
11858
+ * it on the trace. Null means: run locally, the reason is logged and on
11859
+ * the trace. */
11860
+ private runCloudSession;
11626
11861
  /**
11627
11862
  * Execute a task on an agent. Respects maxConcurrent limit.
11628
11863
  *
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,ia as Tt,ja as Mt}from"./chunk-UZ5Q6Q2X.js";import"./chunk-YZJCOWHU.js";import"./chunk-GTJIKXDB.js";import"./chunk-VYSFOONA.js";import"./chunk-DG5I6PPM.js";import"./chunk-ZVP6GB4G.js";import"./chunk-S2GAEH2F.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-4MESMUND.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-ACFQBLPX.js";import"./chunk-LQE73AZR.js";import"./chunk-2D3RYIDU.js";import"./chunk-3Z5P2CWS.js";import"./chunk-E5OV6RTG.js";import"./chunk-PPUN7YHA.js";import{aa as yt,m as lt,n as ct,o as dt,p as mt,q as pt}from"./chunk-YSMPXFQR.js";import"./chunk-ZD5ECP5D.js";import"./chunk-GLQLCBJS.js";import"./chunk-DP7RTNDM.js";import{a as L}from"./chunk-C245D4BZ.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-ZROS7GX2.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-Y4CYQV7G.js";import"./chunk-LLNPKE7H.js";import"./chunk-SHEUCITK.js";import"./chunk-GGB5JMII.js";import"./chunk-SZDACK6O.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import{s as ut}from"./chunk-CZFGADZ2.js";import"./chunk-5D5NKZSD.js";import"./chunk-VWTBHLMX.js";import"./chunk-DJMK22SB.js";import{a as ht}from"./chunk-QCKUXJJ3.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-PWTSY77F.js";import"./chunk-MYVHVJWZ.js";import"./chunk-DWADWDMU.js";import"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-CECHWYJ2.js";import"./chunk-3IEFHOPH.js";import{f as gt,g as ft}from"./chunk-W3LSDADF.js";import"./chunk-WPNRDEHW.js";import"./chunk-2GIDVZ4H.js";import{j as it,k as rt,l as at}from"./chunk-CHQ5Q4QO.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import{a as ke,b as ve,c as xe,d as $e,e as Ce,f as Pe,g as be,h as Te,i as Me,j as Re,l as Ee,m as Ge,o as T,p as W}from"./chunk-5MUJZODV.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{fa as tt,ha as st,ia as ot,ka as nt}from"./chunk-H5LQXHQQ.js";import"./chunk-RJ7DASOU.js";import"./chunk-BRK6M6LA.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";W();G();import{execa as Rt}from"execa";import{existsSync as se,promises as X}from"fs";import S from"path";import ie from"node-fetch";async function Et(o,e){let t=o.split("/");if(t.length<2)throw new Error(`Invalid skill package ID: ${o}. Expected format: owner/repo`);let s=t[0],i=t[1],n=t[2];try{let a=n?`${s}/${i}/${n}`:`${s}/${i}`;await Rt("npx",["-y","skills","add",a],{cwd:e,stdio:"pipe"}),m.success(`Installed skill package: ${o}`);let r=S.resolve(e,".skills",`${s}_${i}`);if(se(r))return await ne(r,o);let d=S.resolve(e,".skills");return se(d)?await ne(d,o):[]}catch{return m.info(`Fetching skills directly from GitHub: ${s}/${i}`),await Gt(s,i,n,e)}}async function Gt(o,e,t,s){let i=[];try{let n=`https://api.github.com/repos/${o}/${e}/git/trees/main?recursive=1`,a=await ie(n);if(!a.ok)throw new Error(`GitHub API error: ${a.status}`);let d=(await a.json()).tree.filter(p=>p.type==="blob"&&p.path.endsWith("SKILL.md"));if(t){let p=d.find(f=>f.path.includes(`/${t}/`)||f.path===`${t}/SKILL.md`);if(p){let f=await oe(o,e,p.path,s);f&&i.push(f)}}else for(let p of d){let f=await oe(o,e,p.path,s);f&&i.push(f)}}catch(n){m.error(`Failed to fetch skills from GitHub: ${n.message}`)}return i}async function oe(o,e,t,s){try{let i=`https://raw.githubusercontent.com/${o}/${e}/main/${t}`,n=await ie(i);if(!n.ok)return null;let a=await n.text(),r=A(a);if(r){r.source="remote",r.packageId=`${o}/${e}`;let d=S.dirname(t),p=S.resolve(s,".skills",`${o}_${e}`,d);await X.mkdir(p,{recursive:!0}),await X.writeFile(S.resolve(p,"SKILL.md"),a),r.path=S.resolve(p,"SKILL.md")}return r}catch{return null}}async function ne(o,e){let t=[],{default:s}=await import("fast-glob"),i=await s.glob("**/SKILL.md",{cwd:o,deep:5});for(let n of i)try{let a=S.resolve(o,n),r=await X.readFile(a,"utf8"),d=A(r);d&&(d.source="remote",d.path=a,d.packageId=e,t.push(d))}catch{}return t}async function At(o,e,t,s,i){let n=["---",`name: ${o}`,`description: ${e}`];if(s?.length){n.push("tags:");for(let a of s)n.push(` - ${a}`)}if(i?.length){n.push("globs:");for(let a of i)n.push(` - ${a}`)}return n.push("---"),`${n.join(`
1
+ import{a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt,h as bt,ia as Tt,ja as Mt}from"./chunk-GCE7T5QL.js";import"./chunk-FHI5WPFO.js";import"./chunk-BG6SOGKT.js";import"./chunk-S2GAEH2F.js";import"./chunk-GTJIKXDB.js";import"./chunk-DG5I6PPM.js";import"./chunk-ZVP6GB4G.js";import"./chunk-PPUN7YHA.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-5O6PIO7F.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-ACFQBLPX.js";import"./chunk-LQE73AZR.js";import"./chunk-2D3RYIDU.js";import"./chunk-3Z5P2CWS.js";import"./chunk-E5OV6RTG.js";import{aa as yt,m as lt,n as ct,o as dt,p as mt,q as pt}from"./chunk-LH54FH7J.js";import"./chunk-2VGYRETU.js";import"./chunk-GLQLCBJS.js";import"./chunk-6W74CHNW.js";import{a as L}from"./chunk-C245D4BZ.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-KBYZTCHO.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-LLNPKE7H.js";import"./chunk-SHEUCITK.js";import"./chunk-Y4CYQV7G.js";import"./chunk-S4NZUPIN.js";import"./chunk-GV7S5BAX.js";import"./chunk-SZDACK6O.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import{s as ut}from"./chunk-QQAZ6EJP.js";import"./chunk-6F2E5NQA.js";import"./chunk-VWTBHLMX.js";import"./chunk-BFOB6ERR.js";import{a as ht}from"./chunk-CJL5OPNQ.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-X5C5W3E4.js";import"./chunk-GSX4NK2N.js";import"./chunk-J32LSOBJ.js";import"./chunk-MYVHVJWZ.js";import"./chunk-UDJAODAB.js";import"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-CECHWYJ2.js";import"./chunk-BZKGQMU2.js";import{f as gt,g as ft}from"./chunk-QFP4YZII.js";import"./chunk-WPNRDEHW.js";import"./chunk-2GIDVZ4H.js";import{j as it,k as rt,l as at}from"./chunk-UTV4DRAW.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import{a as ke,b as ve,c as xe,d as $e,e as Ce,f as Pe,g as be,h as Te,i as Me,j as Re,l as Ee,m as Ge,o as T,p as W}from"./chunk-5MUJZODV.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{fa as tt,ha as st,ia as ot,ka as nt}from"./chunk-D7M4WQFU.js";import"./chunk-RJ7DASOU.js";import"./chunk-BRK6M6LA.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";W();G();import{execa as Rt}from"execa";import{existsSync as se,promises as X}from"fs";import S from"path";import ie from"node-fetch";async function Et(o,e){let t=o.split("/");if(t.length<2)throw new Error(`Invalid skill package ID: ${o}. Expected format: owner/repo`);let s=t[0],i=t[1],n=t[2];try{let a=n?`${s}/${i}/${n}`:`${s}/${i}`;await Rt("npx",["-y","skills","add",a],{cwd:e,stdio:"pipe"}),m.success(`Installed skill package: ${o}`);let r=S.resolve(e,".skills",`${s}_${i}`);if(se(r))return await ne(r,o);let d=S.resolve(e,".skills");return se(d)?await ne(d,o):[]}catch{return m.info(`Fetching skills directly from GitHub: ${s}/${i}`),await Gt(s,i,n,e)}}async function Gt(o,e,t,s){let i=[];try{let n=`https://api.github.com/repos/${o}/${e}/git/trees/main?recursive=1`,a=await ie(n);if(!a.ok)throw new Error(`GitHub API error: ${a.status}`);let d=(await a.json()).tree.filter(p=>p.type==="blob"&&p.path.endsWith("SKILL.md"));if(t){let p=d.find(f=>f.path.includes(`/${t}/`)||f.path===`${t}/SKILL.md`);if(p){let f=await oe(o,e,p.path,s);f&&i.push(f)}}else for(let p of d){let f=await oe(o,e,p.path,s);f&&i.push(f)}}catch(n){m.error(`Failed to fetch skills from GitHub: ${n.message}`)}return i}async function oe(o,e,t,s){try{let i=`https://raw.githubusercontent.com/${o}/${e}/main/${t}`,n=await ie(i);if(!n.ok)return null;let a=await n.text(),r=A(a);if(r){r.source="remote",r.packageId=`${o}/${e}`;let d=S.dirname(t),p=S.resolve(s,".skills",`${o}_${e}`,d);await X.mkdir(p,{recursive:!0}),await X.writeFile(S.resolve(p,"SKILL.md"),a),r.path=S.resolve(p,"SKILL.md")}return r}catch{return null}}async function ne(o,e){let t=[],{default:s}=await import("fast-glob"),i=await s.glob("**/SKILL.md",{cwd:o,deep:5});for(let n of i)try{let a=S.resolve(o,n),r=await X.readFile(a,"utf8"),d=A(r);d&&(d.source="remote",d.path=a,d.packageId=e,t.push(d))}catch{}return t}async function At(o,e,t,s,i){let n=["---",`name: ${o}`,`description: ${e}`];if(s?.length){n.push("tags:");for(let a of s)n.push(` - ${a}`)}if(i?.length){n.push("globs:");for(let a of i)n.push(` - ${a}`)}return n.push("---"),`${n.join(`
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).