@ken-jo/agent-connector 0.4.0 → 0.4.6

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 (185) hide show
  1. package/README.md +9 -9
  2. package/dist/{action-PLZW5BGX.js → action-EV63GAPY.js} +11 -10
  3. package/dist/{action-PLZW5BGX.js.map → action-EV63GAPY.js.map} +1 -1
  4. package/dist/amazon-q-COAL3764.js +276 -0
  5. package/dist/amazon-q-COAL3764.js.map +1 -0
  6. package/dist/amp-XJQ4TDAU.js +666 -0
  7. package/dist/amp-XJQ4TDAU.js.map +1 -0
  8. package/dist/{antigravity-ANDKF3K7.js → antigravity-AMKKKHS4.js} +4 -4
  9. package/dist/{antigravity-cli-LLRPDDOT.js → antigravity-cli-XERXEH5W.js} +4 -4
  10. package/dist/{chunk-MAH6QQTO.js → chunk-2X4EH2D7.js} +5 -4
  11. package/dist/chunk-2X4EH2D7.js.map +1 -0
  12. package/dist/{chunk-G3ER4SY5.js → chunk-5G4EPJ4Y.js} +9 -9
  13. package/dist/chunk-BMD7ANKF.js +237 -0
  14. package/dist/chunk-BMD7ANKF.js.map +1 -0
  15. package/dist/{chunk-IW77FFNX.js → chunk-CPLK7GTE.js} +41 -5
  16. package/dist/chunk-CPLK7GTE.js.map +1 -0
  17. package/dist/{chunk-ADTHT2FN.js → chunk-DCK5FADX.js} +10 -173
  18. package/dist/chunk-DCK5FADX.js.map +1 -0
  19. package/dist/{chunk-J3D5W5T2.js → chunk-EROJDXMW.js} +2 -2
  20. package/dist/{chunk-22Y24V7O.js → chunk-F5RX62T7.js} +2 -2
  21. package/dist/chunk-FAHIMJRU.js +177 -0
  22. package/dist/chunk-FAHIMJRU.js.map +1 -0
  23. package/dist/{chunk-BHUCB6LY.js → chunk-H67V7DEL.js} +8 -7
  24. package/dist/{chunk-BHUCB6LY.js.map → chunk-H67V7DEL.js.map} +1 -1
  25. package/dist/{chunk-BXGFUENQ.js → chunk-I5MLE6S7.js} +14 -1
  26. package/dist/{chunk-BXGFUENQ.js.map → chunk-I5MLE6S7.js.map} +1 -1
  27. package/dist/{chunk-LL4OBGRU.js → chunk-LQRAPXS4.js} +3 -3
  28. package/dist/{chunk-KGJWE6A2.js → chunk-MZF2YCXX.js} +2 -2
  29. package/dist/{chunk-KGXDYGNJ.js → chunk-QC5A3TFQ.js} +19 -19
  30. package/dist/{chunk-KGXDYGNJ.js.map → chunk-QC5A3TFQ.js.map} +1 -1
  31. package/dist/{chunk-CIRDOY2V.js → chunk-QOGMDOUX.js} +3 -3
  32. package/dist/{chunk-KGGBNKI4.js → chunk-RQPKL62M.js} +144 -21
  33. package/dist/chunk-RQPKL62M.js.map +1 -0
  34. package/dist/{chunk-6XHB6BE3.js → chunk-SCVBYSF7.js} +1 -1
  35. package/dist/{chunk-76FUSVIA.js → chunk-SRVAA2VN.js} +6 -5
  36. package/dist/chunk-SRVAA2VN.js.map +1 -0
  37. package/dist/chunk-WZA4CSGJ.js +28 -0
  38. package/dist/chunk-WZA4CSGJ.js.map +1 -0
  39. package/dist/{claude-code-MLWS7CW6.js → claude-code-T2LPFNC3.js} +20 -30
  40. package/dist/claude-code-T2LPFNC3.js.map +1 -0
  41. package/dist/cli/sdk.js +5 -4
  42. package/dist/cli/sdk.js.map +1 -1
  43. package/dist/cli.js +1 -1
  44. package/dist/cline-WRYMNS7Z.js +442 -0
  45. package/dist/cline-WRYMNS7Z.js.map +1 -0
  46. package/dist/{codebuff-SH2S3QAN.js → codebuff-PODYPOOP.js} +130 -5
  47. package/dist/codebuff-PODYPOOP.js.map +1 -0
  48. package/dist/{codex-BXA4FIF4.js → codex-O4G7D7KK.js} +61 -13
  49. package/dist/codex-O4G7D7KK.js.map +1 -0
  50. package/dist/continue-K43SUHLQ.js +790 -0
  51. package/dist/continue-K43SUHLQ.js.map +1 -0
  52. package/dist/{copilot-cli-ROIBTTDT.js → copilot-cli-Q3SSPT4V.js} +70 -12
  53. package/dist/copilot-cli-Q3SSPT4V.js.map +1 -0
  54. package/dist/{crush-QLEFLHUC.js → crush-MBEH2R3I.js} +130 -6
  55. package/dist/crush-MBEH2R3I.js.map +1 -0
  56. package/dist/{cursor-ASJPWZ4R.js → cursor-TMBXDYR4.js} +119 -19
  57. package/dist/cursor-TMBXDYR4.js.map +1 -0
  58. package/dist/{detect-ZIIS55LD.js → detect-AHJIUMBO.js} +5 -4
  59. package/dist/{detect-ZIIS55LD.js.map → detect-AHJIUMBO.js.map} +1 -1
  60. package/dist/{doctor-TJUGSQ5C.js → doctor-G5MLCPAB.js} +221 -95
  61. package/dist/doctor-G5MLCPAB.js.map +1 -0
  62. package/dist/{droid-NCSS3B5Y.js → droid-JC2NT6S4.js} +135 -13
  63. package/dist/droid-JC2NT6S4.js.map +1 -0
  64. package/dist/{gemini-cli-SLVWLXJW.js → gemini-cli-ILR7M5X3.js} +62 -10
  65. package/dist/gemini-cli-ILR7M5X3.js.map +1 -0
  66. package/dist/{goose-PBA7KTE5.js → goose-SFO5BBGW.js} +15 -8
  67. package/dist/goose-SFO5BBGW.js.map +1 -0
  68. package/dist/{hermes-ONDCECP2.js → hermes-3N7WN4WS.js} +329 -15
  69. package/dist/hermes-3N7WN4WS.js.map +1 -0
  70. package/dist/{hook-OU522ABV.js → hook-76JBKTUX.js} +14 -11
  71. package/dist/hook-76JBKTUX.js.map +1 -0
  72. package/dist/index.d.ts +2 -2
  73. package/dist/index.js +3 -2
  74. package/dist/{install-UDCBL7HP.js → install-R7252QFH.js} +11 -10
  75. package/dist/{install-UDCBL7HP.js.map → install-R7252QFH.js.map} +1 -1
  76. package/dist/{introspect-DuZSPSHB.d.ts → introspect-Cn3MSA4_.d.ts} +1 -1
  77. package/dist/{jetbrains-copilot-YABZ3HFA.js → jetbrains-copilot-NRZHI5PC.js} +85 -18
  78. package/dist/jetbrains-copilot-NRZHI5PC.js.map +1 -0
  79. package/dist/{kilo-F3ZDZKCT.js → kilo-IX4T3OHJ.js} +115 -19
  80. package/dist/kilo-IX4T3OHJ.js.map +1 -0
  81. package/dist/{kilo-cli-3HWPWBY4.js → kilo-cli-2AYCXBQD.js} +109 -13
  82. package/dist/kilo-cli-2AYCXBQD.js.map +1 -0
  83. package/dist/{kimi-NV72FVAO.js → kimi-2YFK2GBA.js} +87 -25
  84. package/dist/kimi-2YFK2GBA.js.map +1 -0
  85. package/dist/{kiro-C5W6AGDR.js → kiro-YL6AWUYG.js} +3 -3
  86. package/dist/{leaderboard-TIBVONVT.js → leaderboard-V6VWA5ZV.js} +3 -3
  87. package/dist/{mimo-code-IMM5YM3M.js → mimo-code-FTMGSKMQ.js} +41 -5
  88. package/dist/mimo-code-FTMGSKMQ.js.map +1 -0
  89. package/dist/{mux-DSSH4AFS.js → mux-5XZFB44C.js} +156 -6
  90. package/dist/mux-5XZFB44C.js.map +1 -0
  91. package/dist/{nemoclaw-3EVNKD3I.js → nemoclaw-CQYXZVQN.js} +4 -4
  92. package/dist/{omp-Z6FRNDPN.js → omp-2QMEY6HD.js} +138 -18
  93. package/dist/omp-2QMEY6HD.js.map +1 -0
  94. package/dist/{openclaw-7G437NT7.js → openclaw-UZC437RW.js} +4 -4
  95. package/dist/{opencode-Q6KBSAKW.js → opencode-L4BGFP25.js} +87 -27
  96. package/dist/opencode-L4BGFP25.js.map +1 -0
  97. package/dist/{package-RMPN57YZ.js → package-DNLQTPNN.js} +8 -7
  98. package/dist/{package-RMPN57YZ.js.map → package-DNLQTPNN.js.map} +1 -1
  99. package/dist/{pi-LZT6WWAZ.js → pi-PVVPVWKG.js} +3 -2
  100. package/dist/{pi-LZT6WWAZ.js.map → pi-PVVPVWKG.js.map} +1 -1
  101. package/dist/{qwen-code-WQBKRPWJ.js → qwen-code-G4CXKUHR.js} +426 -10
  102. package/dist/qwen-code-G4CXKUHR.js.map +1 -0
  103. package/dist/{roo-code-GWSNU3OW.js → roo-code-67TYJIQR.js} +3 -3
  104. package/dist/runtime/index.d.ts +1 -1
  105. package/dist/runtime/index.js +9 -8
  106. package/dist/sdk/index.d.ts +3 -3
  107. package/dist/sdk/index.js +4 -3
  108. package/dist/sdk/index.js.map +1 -1
  109. package/dist/sdk/test.d.ts +2 -2
  110. package/dist/sdk/test.js +6 -5
  111. package/dist/sdk/test.js.map +1 -1
  112. package/dist/{serve-D3GO36UT.js → serve-EOVWYBGZ.js} +11 -10
  113. package/dist/{serve-D3GO36UT.js.map → serve-EOVWYBGZ.js.map} +1 -1
  114. package/dist/{status-KOSKCETC.js → status-VTD6XXLW.js} +7 -6
  115. package/dist/{status-KOSKCETC.js.map → status-VTD6XXLW.js.map} +1 -1
  116. package/dist/{statusline-ZNTCL5YC.js → statusline-3ET5YPQ5.js} +10 -9
  117. package/dist/{statusline-ZNTCL5YC.js.map → statusline-3ET5YPQ5.js.map} +1 -1
  118. package/dist/{telemetry-XIKUUGTQ.js → telemetry-QCTMKDBQ.js} +6 -5
  119. package/dist/{telemetry-XIKUUGTQ.js.map → telemetry-QCTMKDBQ.js.map} +1 -1
  120. package/dist/{trae-NWT3TMSZ.js → trae-7CZZGOGI.js} +3 -3
  121. package/dist/{types-BEKsAium.d.ts → types-_6arHbX9.d.ts} +67 -24
  122. package/dist/{uninstall-2LBLQVFA.js → uninstall-FL3SH2DT.js} +11 -10
  123. package/dist/{uninstall-2LBLQVFA.js.map → uninstall-FL3SH2DT.js.map} +1 -1
  124. package/dist/{upgrade-ZC2S7VRN.js → upgrade-SLFG2FCT.js} +11 -10
  125. package/dist/{upgrade-ZC2S7VRN.js.map → upgrade-SLFG2FCT.js.map} +1 -1
  126. package/dist/{usage-E2A4O2CY.js → usage-IRBLVUZM.js} +3 -3
  127. package/dist/{usage-event-JKMC4QC4.js → usage-event-VFF77WYY.js} +10 -9
  128. package/dist/{usage-event-JKMC4QC4.js.map → usage-event-VFF77WYY.js.map} +1 -1
  129. package/dist/{vscode-copilot-ALV45XF6.js → vscode-copilot-MF2CDNMT.js} +23 -10
  130. package/dist/vscode-copilot-MF2CDNMT.js.map +1 -0
  131. package/dist/{warp-H6IX4U3J.js → warp-VKG55TAT.js} +55 -4
  132. package/dist/warp-VKG55TAT.js.map +1 -0
  133. package/dist/windsurf-FU5G4SHF.js +443 -0
  134. package/dist/windsurf-FU5G4SHF.js.map +1 -0
  135. package/dist/{zed-RH34TNSW.js → zed-SFUHL3GS.js} +3 -3
  136. package/package.json +2 -2
  137. package/dist/amp-B524U6LO.js +0 -300
  138. package/dist/amp-B524U6LO.js.map +0 -1
  139. package/dist/chunk-3PFFTFCU.js +0 -190
  140. package/dist/chunk-3PFFTFCU.js.map +0 -1
  141. package/dist/chunk-76FUSVIA.js.map +0 -1
  142. package/dist/chunk-ADTHT2FN.js.map +0 -1
  143. package/dist/chunk-IW77FFNX.js.map +0 -1
  144. package/dist/chunk-KGGBNKI4.js.map +0 -1
  145. package/dist/chunk-MAH6QQTO.js.map +0 -1
  146. package/dist/claude-code-MLWS7CW6.js.map +0 -1
  147. package/dist/codebuff-SH2S3QAN.js.map +0 -1
  148. package/dist/codex-BXA4FIF4.js.map +0 -1
  149. package/dist/copilot-cli-ROIBTTDT.js.map +0 -1
  150. package/dist/crush-QLEFLHUC.js.map +0 -1
  151. package/dist/cursor-ASJPWZ4R.js.map +0 -1
  152. package/dist/doctor-TJUGSQ5C.js.map +0 -1
  153. package/dist/droid-NCSS3B5Y.js.map +0 -1
  154. package/dist/gemini-cli-SLVWLXJW.js.map +0 -1
  155. package/dist/goose-PBA7KTE5.js.map +0 -1
  156. package/dist/hermes-ONDCECP2.js.map +0 -1
  157. package/dist/hook-OU522ABV.js.map +0 -1
  158. package/dist/jetbrains-copilot-YABZ3HFA.js.map +0 -1
  159. package/dist/kilo-F3ZDZKCT.js.map +0 -1
  160. package/dist/kilo-cli-3HWPWBY4.js.map +0 -1
  161. package/dist/kimi-NV72FVAO.js.map +0 -1
  162. package/dist/mimo-code-IMM5YM3M.js.map +0 -1
  163. package/dist/mux-DSSH4AFS.js.map +0 -1
  164. package/dist/omp-Z6FRNDPN.js.map +0 -1
  165. package/dist/opencode-Q6KBSAKW.js.map +0 -1
  166. package/dist/qwen-code-WQBKRPWJ.js.map +0 -1
  167. package/dist/vscode-copilot-ALV45XF6.js.map +0 -1
  168. package/dist/warp-H6IX4U3J.js.map +0 -1
  169. /package/dist/{antigravity-ANDKF3K7.js.map → antigravity-AMKKKHS4.js.map} +0 -0
  170. /package/dist/{antigravity-cli-LLRPDDOT.js.map → antigravity-cli-XERXEH5W.js.map} +0 -0
  171. /package/dist/{chunk-G3ER4SY5.js.map → chunk-5G4EPJ4Y.js.map} +0 -0
  172. /package/dist/{chunk-J3D5W5T2.js.map → chunk-EROJDXMW.js.map} +0 -0
  173. /package/dist/{chunk-22Y24V7O.js.map → chunk-F5RX62T7.js.map} +0 -0
  174. /package/dist/{chunk-LL4OBGRU.js.map → chunk-LQRAPXS4.js.map} +0 -0
  175. /package/dist/{chunk-KGJWE6A2.js.map → chunk-MZF2YCXX.js.map} +0 -0
  176. /package/dist/{chunk-CIRDOY2V.js.map → chunk-QOGMDOUX.js.map} +0 -0
  177. /package/dist/{chunk-6XHB6BE3.js.map → chunk-SCVBYSF7.js.map} +0 -0
  178. /package/dist/{kiro-C5W6AGDR.js.map → kiro-YL6AWUYG.js.map} +0 -0
  179. /package/dist/{leaderboard-TIBVONVT.js.map → leaderboard-V6VWA5ZV.js.map} +0 -0
  180. /package/dist/{nemoclaw-3EVNKD3I.js.map → nemoclaw-CQYXZVQN.js.map} +0 -0
  181. /package/dist/{openclaw-7G437NT7.js.map → openclaw-UZC437RW.js.map} +0 -0
  182. /package/dist/{roo-code-GWSNU3OW.js.map → roo-code-67TYJIQR.js.map} +0 -0
  183. /package/dist/{trae-NWT3TMSZ.js.map → trae-7CZZGOGI.js.map} +0 -0
  184. /package/dist/{usage-E2A4O2CY.js.map → usage-IRBLVUZM.js.map} +0 -0
  185. /package/dist/{zed-RH34TNSW.js.map → zed-SFUHL3GS.js.map} +0 -0
@@ -5,21 +5,23 @@ import {
5
5
  } from "./chunk-DBQMX75U.js";
6
6
  import {
7
7
  BaseAdapter
8
- } from "./chunk-IW77FFNX.js";
8
+ } from "./chunk-CPLK7GTE.js";
9
9
  import "./chunk-7L6ITC4T.js";
10
10
  import {
11
11
  buildServeWrapperCommand,
12
12
  shouldWrapForTelemetry
13
- } from "./chunk-BXGFUENQ.js";
13
+ } from "./chunk-I5MLE6S7.js";
14
14
  import "./chunk-N6HH7K6P.js";
15
15
  import "./chunk-TRQKHP7D.js";
16
16
 
17
17
  // src/adapters/mux/index.ts
18
- import { existsSync } from "fs";
18
+ import { existsSync, statSync } from "fs";
19
19
  import { homedir } from "os";
20
- import { join } from "path";
20
+ import { dirname, join } from "path";
21
21
  var HOST = "mux";
22
22
  var MCP_ROOT_KEY = "servers";
23
+ var MUX_SKILL_NAME_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
24
+ var MUX_SKILL_NAME_MAX = 64;
23
25
  function quoteToken(token) {
24
26
  return /\s/.test(token) ? `"${token}"` : token;
25
27
  }
@@ -47,7 +49,16 @@ var MuxAdapter = class extends BaseAdapter {
47
49
  canModifyOutput: false,
48
50
  canInjectSessionContext: false,
49
51
  // Mux's command-string server entry is stdio-only.
50
- transports: ["stdio"]
52
+ transports: ["stdio"],
53
+ // Content surface: Mux auto-discovers dir-per-skill SKILL.md from its
54
+ // workspace-local and global roots (mux.coder.com/agents/agent-skills,
55
+ // fetched 2026-06-16):
56
+ // project → <projectDir>/.mux/skills/<name>/SKILL.md (workspace-local)
57
+ // user → ~/.mux/skills/<name>/SKILL.md (global, Mux-specific)
58
+ // The skill directory name MUST match ^[a-z0-9]+(?:-[a-z0-9]+)*$ (1–64
59
+ // chars) and the SKILL.md `name` field must equal it — a name that cannot
60
+ // be represented is skip-warned (see installSkills).
61
+ supportsSkills: true
51
62
  };
52
63
  // ── Detection ────────────────────────────────────────────────────────────
53
64
  detectInstalled(projectDir) {
@@ -177,6 +188,145 @@ var MuxAdapter = class extends BaseAdapter {
177
188
  }
178
189
  ];
179
190
  }
191
+ // ── Content surface: skills (dir-per-skill SKILL.md) ─────────────────────
192
+ // CONTENT-ONLY: pure native-file writers, mirroring goose/openclaw. No
193
+ // runtime dispatch, no home-bin pointer, no telemetry wrap. Idempotent
194
+ // (byte-identical → skip) via writeContentFile and reversible via
195
+ // removeContentFile + removeDirIfEmpty. Honors platforms["mux"].skills ===
196
+ // false. No mcp.jsonc entry — Mux auto-discovers the skills dirs.
197
+ //
198
+ // Native locations (mux.coder.com/agents/agent-skills):
199
+ // project → <projectDir>/.mux/skills/<name>/SKILL.md (workspace-local)
200
+ // user → ~/.mux/skills/<name>/SKILL.md (global, Mux-specific)
201
+ // The dir name MUST match MUX_SKILL_NAME_RE (1–64 chars) and the SKILL.md
202
+ // `name` field must equal it — a name that can't be represented is skip-warned.
203
+ /** The skills ROOT dir for ctx.scope (parent of every per-skill dir). */
204
+ skillsDir(ctx) {
205
+ return join(this.getConfigDir(ctx), "skills");
206
+ }
207
+ /** Per-skill directory: <skillsDir>/<name>. */
208
+ skillDir(ctx, name) {
209
+ return join(this.skillsDir(ctx), name);
210
+ }
211
+ installSkills(ctx) {
212
+ const { connector } = ctx;
213
+ if (connector.platforms[HOST]?.skills === false) {
214
+ return [{ platform: this.id, action: "skip", detail: "skills disabled for mux" }];
215
+ }
216
+ if (connector.skills.length === 0) {
217
+ return [{ platform: this.id, action: "skip", detail: "connector declares no skills" }];
218
+ }
219
+ const changes = [];
220
+ for (const skill of connector.skills) {
221
+ if (!this.isValidSkillName(skill.name)) {
222
+ changes.push({
223
+ platform: this.id,
224
+ action: "warn",
225
+ detail: `skill "${skill.name}" cannot be represented on mux (name must match ${MUX_SKILL_NAME_RE.source}, 1\u2013${MUX_SKILL_NAME_MAX} chars); skipped`
226
+ });
227
+ continue;
228
+ }
229
+ const dir = this.skillDir(ctx, skill.name);
230
+ const blockingFile = this.firstFileOnSkillPath(ctx, dir);
231
+ if (blockingFile !== null) {
232
+ changes.push({
233
+ platform: this.id,
234
+ action: "warn",
235
+ path: blockingFile,
236
+ detail: `${blockingFile} is a file, not a directory; skill "${skill.name}" skipped`
237
+ });
238
+ continue;
239
+ }
240
+ changes.push(
241
+ this.writeContentFile(join(dir, "SKILL.md"), this.renderSkill(skill), ctx.dryRun)
242
+ );
243
+ for (const [rel, contents] of Object.entries(skill.resources ?? {})) {
244
+ const target = this.resolveWithin(dir, rel);
245
+ if (target === null) {
246
+ changes.push({
247
+ platform: this.id,
248
+ action: "warn",
249
+ detail: `skill resource "${rel}" escapes the skill dir; skipped`
250
+ });
251
+ continue;
252
+ }
253
+ changes.push(this.writeContentFile(target, contents, ctx.dryRun));
254
+ }
255
+ }
256
+ return changes;
257
+ }
258
+ uninstallSkills(ctx) {
259
+ const { connector } = ctx;
260
+ if (connector.skills.length === 0) {
261
+ return [{ platform: this.id, action: "skip", detail: "connector declares no skills" }];
262
+ }
263
+ const changes = [];
264
+ for (const skill of connector.skills) {
265
+ if (!this.isValidSkillName(skill.name)) continue;
266
+ const dir = this.skillDir(ctx, skill.name);
267
+ changes.push(this.removeContentFile(join(dir, "SKILL.md"), ctx.dryRun));
268
+ for (const rel of Object.keys(skill.resources ?? {})) {
269
+ const target = this.resolveWithin(dir, rel);
270
+ if (target === null) continue;
271
+ changes.push(this.removeContentFile(target, ctx.dryRun));
272
+ }
273
+ changes.push(this.removeDirIfEmpty(dir, ctx.dryRun));
274
+ }
275
+ if (changes.length === 0) {
276
+ return [{ platform: this.id, action: "skip", detail: "no installable skills to remove" }];
277
+ }
278
+ return changes;
279
+ }
280
+ /** True when a skill name is representable as a Mux skill directory name. */
281
+ isValidSkillName(name) {
282
+ return name.length >= 1 && name.length <= MUX_SKILL_NAME_MAX && MUX_SKILL_NAME_RE.test(name);
283
+ }
284
+ /**
285
+ * Walk from the skills root down to `leaf` and return the FIRST segment that
286
+ * exists as a regular file (a mkdir there throws ENOTDIR), else null — so
287
+ * installSkills can skip-warn instead of crashing.
288
+ */
289
+ firstFileOnSkillPath(ctx, leaf) {
290
+ const root = this.skillsDir(ctx);
291
+ const segments = [];
292
+ let cur = leaf;
293
+ while (cur.length >= root.length) {
294
+ segments.unshift(cur);
295
+ if (cur === root) break;
296
+ const parent = dirname(cur);
297
+ if (parent === cur) break;
298
+ cur = parent;
299
+ }
300
+ for (const p of segments) {
301
+ if (!existsSync(p)) return null;
302
+ try {
303
+ if (statSync(p).isFile()) return p;
304
+ } catch {
305
+ return null;
306
+ }
307
+ }
308
+ return null;
309
+ }
310
+ /**
311
+ * Render a skill's SKILL.md: frontmatter (name, description + optional model,
312
+ * allowed-tools, disable-model-invocation) + body. UNIFORM with every other
313
+ * skill-supporting platform — only the parent dir differs. Mux requires the
314
+ * `name` field to equal the directory name, which installSkills guarantees.
315
+ */
316
+ renderSkill(skill) {
317
+ const frontmatter = {
318
+ name: skill.name,
319
+ description: skill.description
320
+ };
321
+ if (skill.model !== void 0) frontmatter.model = skill.model;
322
+ const allow = skill.tools?.allow;
323
+ if (allow && allow.length > 0) frontmatter["allowed-tools"] = allow.join(", ");
324
+ if (skill.disableModelInvocation !== void 0) {
325
+ frontmatter["disable-model-invocation"] = skill.disableModelInvocation;
326
+ }
327
+ if (skill.extra) Object.assign(frontmatter, skill.extra);
328
+ return this.renderFrontmatterMd(frontmatter, skill.body);
329
+ }
180
330
  // ── Diagnostics ──────────────────────────────────────────────────────────
181
331
  getHealthChecks(ctx) {
182
332
  const mcpPath = this.getServerConfigPath(ctx);
@@ -215,4 +365,4 @@ export {
215
365
  adapter,
216
366
  mux_default as default
217
367
  };
218
- //# sourceMappingURL=mux-DSSH4AFS.js.map
368
+ //# sourceMappingURL=mux-5XZFB44C.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/adapters/mux/index.ts"],"sourcesContent":["/**\n * adapters/mux — Mux (Coder) platform adapter for agent-connector.\n *\n * Mux is an **mcp-only** host: it exposes no lifecycle hook system, and MCP is\n * its extensibility mechanism. This adapter therefore installs only the MCP\n * server and reports hooks as unavailable — the same shape as the Warp\n * reference adapter.\n *\n * MCP config:\n * - user scope → ~/.mux/mcp.jsonc\n * - project scope → <projectDir>/.mux/mcp.jsonc\n * Both are JSONC (comments allowed) but we write strict JSON. The root key is\n * \"servers\", and this file doubles as the (non-existent) hook config — there\n * is no separate hook file here.\n *\n * QUIRK: Mux models each server entry as a single shell-command STRING, not an\n * object. So `servers[id]` is `\"<exe> <arg1> <arg2> ...\"` — space-joined, with\n * any token containing whitespace double-quoted. We therefore build that string\n * ourselves and upsert it idempotently (the generic object upsert helper would\n * write the wrong shape). When telemetry-wrapping, the string is the home-bin\n * `serve` wrapper command followed by its args.\n *\n * Mux documents no native `${env:VAR}` interpolation token, so env-refs in the\n * command/args are resolved to literals at install time. The string form has no\n * place for an env map, so server.env is dropped with no native equivalent.\n */\n\nimport { existsSync, statSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\n\nimport { BaseAdapter } from \"../base.js\";\nimport type { Adapter, InstallContext } from \"../spi.js\";\nimport type {\n ChangeRecord,\n DetectedPlatform,\n HealthCheck,\n HookParadigm,\n PlatformCapabilities,\n PlatformId,\n ServerDef,\n SkillDef,\n} from \"../../core/types.js\";\nimport { resolveEnvRefs, resolveEnvRefsDeep } from \"../../core/interpolate.js\";\nimport {\n buildServeWrapperCommand,\n shouldWrapForTelemetry,\n} from \"../../core/spawn.js\";\n\nconst HOST: PlatformId = \"mux\";\nconst MCP_ROOT_KEY = \"servers\";\n\n/**\n * Mux enforces this exact pattern (1–64 chars) on a SKILL directory name, and\n * the SKILL.md `name` field MUST equal the directory name\n * (mux.coder.com/agents/agent-skills). A skill name that does not match is\n * skip-warned rather than written to a dir Mux would reject.\n */\nconst MUX_SKILL_NAME_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;\nconst MUX_SKILL_NAME_MAX = 64;\n\n/** Quote a token only when it contains whitespace (Mux command-string form). */\nfunction quoteToken(token: string): string {\n return /\\s/.test(token) ? `\"${token}\"` : token;\n}\n\n/** Join an executable + args into Mux's single shell-command string. */\nfunction buildCommandString(command: string, args: readonly string[]): string {\n return [command, ...args].map(quoteToken).join(\" \");\n}\n\nexport class MuxAdapter extends BaseAdapter implements Adapter {\n readonly id: PlatformId = HOST;\n readonly name = \"Mux\";\n readonly paradigm: HookParadigm = \"mcp-only\";\n\n readonly capabilities: PlatformCapabilities = {\n // Memory surface: AGENTS.md-first managed block via the BaseAdapter default\n // (memoryTargets: project <projectDir>/AGENTS.md; user scope where documented).\n supportsMemory: true,\n // Mux has no lifecycle hook system — every hook capability is false.\n preToolUse: false,\n postToolUse: false,\n preCompact: false,\n sessionStart: false,\n sessionEnd: false,\n userPromptSubmit: false,\n stop: false,\n notification: false,\n canModifyArgs: false,\n canModifyOutput: false,\n canInjectSessionContext: false,\n // Mux's command-string server entry is stdio-only.\n transports: [\"stdio\"],\n // Content surface: Mux auto-discovers dir-per-skill SKILL.md from its\n // workspace-local and global roots (mux.coder.com/agents/agent-skills,\n // fetched 2026-06-16):\n // project → <projectDir>/.mux/skills/<name>/SKILL.md (workspace-local)\n // user → ~/.mux/skills/<name>/SKILL.md (global, Mux-specific)\n // The skill directory name MUST match ^[a-z0-9]+(?:-[a-z0-9]+)*$ (1–64\n // chars) and the SKILL.md `name` field must equal it — a name that cannot\n // be represented is skip-warned (see installSkills).\n supportsSkills: true,\n };\n\n // ── Detection ────────────────────────────────────────────────────────────\n\n detectInstalled(projectDir: string): DetectedPlatform {\n const userDir = join(homedir(), \".mux\");\n const userMcp = join(userDir, \"mcp.jsonc\");\n const projDir = join(projectDir, \".mux\");\n const projMcp = join(projDir, \"mcp.jsonc\");\n\n const userInstalled = existsSync(userDir) || existsSync(userMcp);\n const projInstalled = existsSync(projDir) || existsSync(projMcp);\n const installed = userInstalled || projInstalled;\n const scope = projInstalled && !userInstalled ? \"project\" : \"user\";\n const configPath = scope === \"project\" ? projMcp : userMcp;\n\n return {\n id: this.id,\n name: this.name,\n installed,\n paradigm: this.paradigm,\n capabilities: this.capabilities,\n configPath,\n scope,\n reason: installed\n ? `found Mux config (${scope})`\n : `no Mux config at ${userDir} or ${projDir}`,\n confidence: installed ? \"high\" : \"low\",\n };\n }\n\n // ── Native paths ─────────────────────────────────────────────────────────\n\n getConfigDir(ctx: InstallContext): string {\n return ctx.scope === \"project\"\n ? join(ctx.projectDir, \".mux\")\n : join(homedir(), \".mux\");\n }\n\n getServerConfigPath(ctx: InstallContext): string {\n return join(this.getConfigDir(ctx), \"mcp.jsonc\");\n }\n\n /**\n * Mux has no hook file — hooks are not a thing here. The hook \"config path\"\n * is the same mcp.jsonc so the generic doctor/backup behave sensibly.\n */\n getHookConfigPath(ctx: InstallContext): string {\n return this.getServerConfigPath(ctx);\n }\n\n // ── MCP server install / uninstall ───────────────────────────────────────\n\n installServer(ctx: InstallContext): ChangeRecord[] {\n const { connector, dryRun } = ctx;\n const override = connector.platforms[HOST]?.server;\n if (!connector.server || override === false) {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail: connector.server\n ? \"server registration disabled for mux\"\n : \"connector declares no MCP server\",\n },\n ];\n }\n\n // Shallow-merge any per-platform server override into the base ServerDef.\n const server: ServerDef =\n override && typeof override === \"object\"\n ? { ...connector.server, ...override }\n : connector.server;\n\n const path = this.getServerConfigPath(ctx);\n\n if (server.transport !== \"stdio\" || !server.command) {\n // Mux's command-string entry is stdio-only; remote transports skip.\n return [\n {\n platform: this.id,\n action: \"skip\",\n path,\n detail: `transport \"${server.transport}\" not registrable (mux expects a stdio command string)`,\n },\n ];\n }\n\n const entry = this.renderCommandString(ctx, server);\n\n // QUIRK: each server value is a STRING, not an object — so we cannot use the\n // generic object upsert helper. Build the string and upsert idempotently.\n const cfg =\n this.readJson<Record<string, Record<string, unknown>>>(path) ?? {};\n const bucket = (cfg[MCP_ROOT_KEY] ??= {});\n const before = JSON.stringify(bucket[connector.id]);\n const after = JSON.stringify(entry);\n\n let action: ChangeRecord[\"action\"];\n if (before === undefined) action = \"create\";\n else if (before === after) action = \"skip\";\n else action = \"update\";\n\n if (action !== \"skip\") {\n bucket[connector.id] = entry;\n this.writeJson(path, cfg, dryRun);\n }\n return [\n { platform: this.id, action, path, detail: `${MCP_ROOT_KEY}.${connector.id}` },\n ];\n }\n\n uninstallServer(ctx: InstallContext): ChangeRecord[] {\n const path = this.getServerConfigPath(ctx);\n return [\n this.removeServerFromJson(path, MCP_ROOT_KEY, ctx.connector.id, ctx.dryRun),\n ];\n }\n\n /**\n * Render a stdio ServerDef into Mux's single shell-command string. Honors the\n * telemetry serve-wrapper and resolves every `${env:VAR}` to a literal (Mux\n * documents no native interpolation token).\n */\n private renderCommandString(ctx: InstallContext, server: ServerDef): string {\n let command = server.command ?? \"\";\n let args = [...(server.args ?? [])];\n\n // Transparent telemetry wrapping: route the real command through\n // `<homeBin> serve --connector <id> -- <command> <args...>`.\n if (shouldWrapForTelemetry(server, ctx.connector.telemetry)) {\n const wrapped = buildServeWrapperCommand(\n ctx.homeBinPath,\n ctx.connector.id,\n command,\n args,\n ctx.scope,\n this.id,\n );\n command = wrapped.command;\n args = wrapped.args;\n }\n\n // Resolve env-refs to literals (Mux has no native interpolation token).\n command = resolveEnvRefs(command);\n args = resolveEnvRefsDeep(args);\n\n return buildCommandString(command, args);\n }\n\n // ── Hooks (unavailable — Mux is mcp-only) ─────────────────────────────────\n\n installHooks(_ctx: InstallContext): ChangeRecord[] {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail: \"hooks unavailable (Mux is mcp-only)\",\n },\n ];\n }\n\n uninstallHooks(_ctx: InstallContext): ChangeRecord[] {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail: \"hooks unavailable (Mux is mcp-only)\",\n },\n ];\n }\n\n // ── Content surface: skills (dir-per-skill SKILL.md) ─────────────────────\n // CONTENT-ONLY: pure native-file writers, mirroring goose/openclaw. No\n // runtime dispatch, no home-bin pointer, no telemetry wrap. Idempotent\n // (byte-identical → skip) via writeContentFile and reversible via\n // removeContentFile + removeDirIfEmpty. Honors platforms[\"mux\"].skills ===\n // false. No mcp.jsonc entry — Mux auto-discovers the skills dirs.\n //\n // Native locations (mux.coder.com/agents/agent-skills):\n // project → <projectDir>/.mux/skills/<name>/SKILL.md (workspace-local)\n // user → ~/.mux/skills/<name>/SKILL.md (global, Mux-specific)\n // The dir name MUST match MUX_SKILL_NAME_RE (1–64 chars) and the SKILL.md\n // `name` field must equal it — a name that can't be represented is skip-warned.\n\n /** The skills ROOT dir for ctx.scope (parent of every per-skill dir). */\n private skillsDir(ctx: InstallContext): string {\n return join(this.getConfigDir(ctx), \"skills\");\n }\n\n /** Per-skill directory: <skillsDir>/<name>. */\n private skillDir(ctx: InstallContext, name: string): string {\n return join(this.skillsDir(ctx), name);\n }\n\n override installSkills(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.platforms[HOST]?.skills === false) {\n return [{ platform: this.id, action: \"skip\", detail: \"skills disabled for mux\" }];\n }\n if (connector.skills.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no skills\" }];\n }\n const changes: ChangeRecord[] = [];\n for (const skill of connector.skills) {\n // Mux REQUIRES the dir name (and SKILL.md `name`) to match its pattern;\n // a name we cannot represent is skip-warned rather than written to a dir\n // Mux would reject (the honesty bar — never write an unreadable path).\n if (!this.isValidSkillName(skill.name)) {\n changes.push({\n platform: this.id,\n action: \"warn\",\n detail:\n `skill \"${skill.name}\" cannot be represented on mux ` +\n `(name must match ${MUX_SKILL_NAME_RE.source}, 1–${MUX_SKILL_NAME_MAX} chars); skipped`,\n });\n continue;\n }\n const dir = this.skillDir(ctx, skill.name);\n // Guard a skills path occupied by a regular FILE (mkdir would throw\n // ENOTDIR): skip-warn rather than crash (cline `.clinerules`-is-a-file\n // precedent).\n const blockingFile = this.firstFileOnSkillPath(ctx, dir);\n if (blockingFile !== null) {\n changes.push({\n platform: this.id,\n action: \"warn\",\n path: blockingFile,\n detail: `${blockingFile} is a file, not a directory; skill \"${skill.name}\" skipped`,\n });\n continue;\n }\n changes.push(\n this.writeContentFile(join(dir, \"SKILL.md\"), this.renderSkill(skill), ctx.dryRun),\n );\n // Bundle any resource files beside SKILL.md (relative path → contents).\n // Defense-in-depth: skip+warn on any key that escapes the skill dir.\n for (const [rel, contents] of Object.entries(skill.resources ?? {})) {\n const target = this.resolveWithin(dir, rel);\n if (target === null) {\n changes.push({\n platform: this.id,\n action: \"warn\",\n detail: `skill resource \"${rel}\" escapes the skill dir; skipped`,\n });\n continue;\n }\n changes.push(this.writeContentFile(target, contents, ctx.dryRun));\n }\n }\n return changes;\n }\n\n override uninstallSkills(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.skills.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no skills\" }];\n }\n const changes: ChangeRecord[] = [];\n for (const skill of connector.skills) {\n // Skip names install never wrote (invalid → never on disk under our dir).\n if (!this.isValidSkillName(skill.name)) continue;\n const dir = this.skillDir(ctx, skill.name);\n // Remove only the files we wrote (SKILL.md + declared resources), then the\n // skill dir itself when we own its full contents.\n changes.push(this.removeContentFile(join(dir, \"SKILL.md\"), ctx.dryRun));\n for (const rel of Object.keys(skill.resources ?? {})) {\n const target = this.resolveWithin(dir, rel);\n if (target === null) continue; // never delete outside the skill dir\n changes.push(this.removeContentFile(target, ctx.dryRun));\n }\n // Only remove the skill dir when WE own its full contents — never rm -rf a\n // dir that still holds user-added / sibling-tool / shared files.\n changes.push(this.removeDirIfEmpty(dir, ctx.dryRun));\n }\n if (changes.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"no installable skills to remove\" }];\n }\n return changes;\n }\n\n /** True when a skill name is representable as a Mux skill directory name. */\n private isValidSkillName(name: string): boolean {\n return name.length >= 1 && name.length <= MUX_SKILL_NAME_MAX && MUX_SKILL_NAME_RE.test(name);\n }\n\n /**\n * Walk from the skills root down to `leaf` and return the FIRST segment that\n * exists as a regular file (a mkdir there throws ENOTDIR), else null — so\n * installSkills can skip-warn instead of crashing.\n */\n private firstFileOnSkillPath(ctx: InstallContext, leaf: string): string | null {\n const root = this.skillsDir(ctx);\n const segments: string[] = [];\n let cur = leaf;\n while (cur.length >= root.length) {\n segments.unshift(cur);\n if (cur === root) break;\n const parent = dirname(cur);\n if (parent === cur) break;\n cur = parent;\n }\n for (const p of segments) {\n if (!existsSync(p)) return null;\n try {\n if (statSync(p).isFile()) return p;\n } catch {\n return null;\n }\n }\n return null;\n }\n\n /**\n * Render a skill's SKILL.md: frontmatter (name, description + optional model,\n * allowed-tools, disable-model-invocation) + body. UNIFORM with every other\n * skill-supporting platform — only the parent dir differs. Mux requires the\n * `name` field to equal the directory name, which installSkills guarantees.\n */\n private renderSkill(skill: SkillDef): string {\n const frontmatter: Record<string, unknown> = {\n name: skill.name,\n description: skill.description,\n };\n if (skill.model !== undefined) frontmatter.model = skill.model;\n const allow = skill.tools?.allow;\n if (allow && allow.length > 0) frontmatter[\"allowed-tools\"] = allow.join(\", \");\n if (skill.disableModelInvocation !== undefined) {\n frontmatter[\"disable-model-invocation\"] = skill.disableModelInvocation;\n }\n if (skill.extra) Object.assign(frontmatter, skill.extra);\n return this.renderFrontmatterMd(frontmatter, skill.body);\n }\n\n // ── Diagnostics ──────────────────────────────────────────────────────────\n\n override getHealthChecks(ctx: InstallContext): readonly HealthCheck[] {\n const mcpPath = this.getServerConfigPath(ctx);\n const connectorId = ctx.connector.id;\n return [\n {\n name: `${this.name}: mcp.jsonc present`,\n check: () =>\n existsSync(mcpPath)\n ? { status: \"OK\", detail: mcpPath }\n : { status: \"FAIL\", detail: `not found: ${mcpPath}` },\n },\n {\n name: `${this.name}: server entry registered`,\n check: () => {\n // Only assert what the connector declares: a server-less connector\n // never writes an mcpServers entry, so its absence is healthy.\n if (!ctx.connector.server) {\n return { status: \"OK\", detail: \"no MCP server declared\" };\n }\n const cfg = this.readJson<{ [k: string]: Record<string, unknown> }>(\n mcpPath,\n );\n const bucket = cfg?.[MCP_ROOT_KEY];\n if (!cfg || !bucket) {\n return { status: \"FAIL\", detail: `no ${MCP_ROOT_KEY} in ${mcpPath}` };\n }\n return connectorId in bucket\n ? { status: \"OK\", detail: `${MCP_ROOT_KEY}.${connectorId} present` }\n : {\n status: \"FAIL\",\n detail: `no ${MCP_ROOT_KEY}.${connectorId} in ${mcpPath}`,\n };\n },\n },\n ];\n }\n}\n\nexport const adapter = new MuxAdapter();\nexport default adapter;\n"],"mappings":";;;;;;;;;;;;;;;;;AA2BA,SAAS,YAAY,gBAAgB;AACrC,SAAS,eAAe;AACxB,SAAS,SAAS,YAAY;AAoB9B,IAAM,OAAmB;AACzB,IAAM,eAAe;AAQrB,IAAM,oBAAoB;AAC1B,IAAM,qBAAqB;AAG3B,SAAS,WAAW,OAAuB;AACzC,SAAO,KAAK,KAAK,KAAK,IAAI,IAAI,KAAK,MAAM;AAC3C;AAGA,SAAS,mBAAmB,SAAiB,MAAiC;AAC5E,SAAO,CAAC,SAAS,GAAG,IAAI,EAAE,IAAI,UAAU,EAAE,KAAK,GAAG;AACpD;AAEO,IAAM,aAAN,cAAyB,YAA+B;AAAA,EACpD,KAAiB;AAAA,EACjB,OAAO;AAAA,EACP,WAAyB;AAAA,EAEzB,eAAqC;AAAA;AAAA;AAAA,IAG5C,gBAAgB;AAAA;AAAA,IAEhB,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,kBAAkB;AAAA,IAClB,MAAM;AAAA,IACN,cAAc;AAAA,IACd,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,yBAAyB;AAAA;AAAA,IAEzB,YAAY,CAAC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASpB,gBAAgB;AAAA,EAClB;AAAA;AAAA,EAIA,gBAAgB,YAAsC;AACpD,UAAM,UAAU,KAAK,QAAQ,GAAG,MAAM;AACtC,UAAM,UAAU,KAAK,SAAS,WAAW;AACzC,UAAM,UAAU,KAAK,YAAY,MAAM;AACvC,UAAM,UAAU,KAAK,SAAS,WAAW;AAEzC,UAAM,gBAA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IAAO,cAAQ;","names":[]}
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  OpenClawAdapter
4
- } from "./chunk-KGGBNKI4.js";
4
+ } from "./chunk-RQPKL62M.js";
5
5
  import "./chunk-DBQMX75U.js";
6
- import "./chunk-IW77FFNX.js";
6
+ import "./chunk-CPLK7GTE.js";
7
7
  import "./chunk-7L6ITC4T.js";
8
- import "./chunk-BXGFUENQ.js";
8
+ import "./chunk-I5MLE6S7.js";
9
9
  import "./chunk-N6HH7K6P.js";
10
10
  import "./chunk-TRQKHP7D.js";
11
11
 
@@ -55,4 +55,4 @@ export {
55
55
  adapter,
56
56
  nemoclaw_default as default
57
57
  };
58
- //# sourceMappingURL=nemoclaw-3EVNKD3I.js.map
58
+ //# sourceMappingURL=nemoclaw-CQYXZVQN.js.map
@@ -4,12 +4,12 @@ import {
4
4
  } from "./chunk-DBQMX75U.js";
5
5
  import {
6
6
  BaseAdapter
7
- } from "./chunk-IW77FFNX.js";
7
+ } from "./chunk-CPLK7GTE.js";
8
8
  import "./chunk-7L6ITC4T.js";
9
9
  import {
10
10
  buildServeWrapperCommand,
11
11
  shouldWrapForTelemetry
12
- } from "./chunk-BXGFUENQ.js";
12
+ } from "./chunk-I5MLE6S7.js";
13
13
  import "./chunk-N6HH7K6P.js";
14
14
  import "./chunk-TRQKHP7D.js";
15
15
 
@@ -63,8 +63,21 @@ var OMPAdapter = class extends BaseAdapter {
63
63
  canModifyOutput: false,
64
64
  // No session_start context-injection surface upstream.
65
65
  canInjectSessionContext: false,
66
- // OMP registers stdio and remote (http) MCP servers.
67
- transports: ["stdio", "http"]
66
+ // OMP registers stdio and remote (streamable http + sse) MCP servers.
67
+ transports: ["stdio", "sse", "http"],
68
+ // Action surface: each declared action becomes a user-invokable slash
69
+ // command registered INSIDE the generated plugin module (pi.registerCommand),
70
+ // shelling out to the home-bin `action` verb. supportsActions → the
71
+ // installActions/uninstallActions overrides below.
72
+ supportsActions: true,
73
+ // Native passthrough hooks: OMP's main-loop lifecycle events —
74
+ // agent_start, agent_end, turn_start, turn_end — have NO canonical
75
+ // HookEventName analog (verified in oh-my-pi shared-events.ts). A connector
76
+ // reaches them by declaring platforms["omp"].nativeHooks; the generated
77
+ // plugin registers + bridges each declared native event verbatim
78
+ // (buildPluginSource native loop), and the home-bin runtime dispatches it
79
+ // host-generically via runNativeHook.
80
+ supportsNativeHooks: true
68
81
  };
69
82
  // ── Native paths ───────────────────────────────────────────────────────
70
83
  /**
@@ -132,8 +145,17 @@ var OMPAdapter = class extends BaseAdapter {
132
145
  }
133
146
  ];
134
147
  }
148
+ const changes = [];
149
+ if (!this.capabilities.transports.includes(server.transport)) {
150
+ changes.push({
151
+ platform: this.id,
152
+ action: "warn",
153
+ path: serverPath,
154
+ detail: `transport "${server.transport}" is not an OMP MCP transport (stdio/sse/http); registered best-effort as type:"http"`
155
+ });
156
+ }
135
157
  const entry = this.renderServerEntry(ctx, server);
136
- return [
158
+ changes.push(
137
159
  this.upsertServerInJson(
138
160
  serverPath,
139
161
  MCP_ROOT_KEY,
@@ -141,7 +163,8 @@ var OMPAdapter = class extends BaseAdapter {
141
163
  entry,
142
164
  ctx.dryRun
143
165
  )
144
- ];
166
+ );
167
+ return changes;
145
168
  }
146
169
  uninstallServer(ctx) {
147
170
  const serverPath = this.getServerConfigPath(ctx);
@@ -165,8 +188,10 @@ var OMPAdapter = class extends BaseAdapter {
165
188
  /**
166
189
  * Render a normalized ServerDef into OMP's native "mcpServers" entry.
167
190
  *
168
- * stdio → { command, args, env } (portable field names)
169
- * remote { url, headers? }
191
+ * stdio → { command, args, env } (portable field names; `type` omitted —
192
+ * OMP defaults an entry with no `type` to stdio)
193
+ * remote → { type: "http"|"sse", url, headers? } (`type` is REQUIRED for a
194
+ * URL server — without it OMP would mis-parse the entry as stdio)
170
195
  *
171
196
  * Telemetry wrapping routes the real command through
172
197
  * `<homeBin> serve --connector <id> -- <command> <args...>`. OMP has no native
@@ -199,6 +224,7 @@ var OMPAdapter = class extends BaseAdapter {
199
224
  return entry2;
200
225
  }
201
226
  const entry = {
227
+ type: server.transport === "sse" ? "sse" : "http",
202
228
  url: resolveEnvRefsDeep(server.url ?? "")
203
229
  };
204
230
  const headers = this.renderEnv(server.headers);
@@ -213,7 +239,10 @@ var OMPAdapter = class extends BaseAdapter {
213
239
  // ── Hook install / uninstall (ts-plugin extension package) ──────────────
214
240
  installHooks(ctx) {
215
241
  const entryPath = this.getHookConfigPath(ctx);
216
- if (ctx.connector.platforms[HOST]?.hooks === false) {
242
+ const nativeEvents = Object.keys(
243
+ ctx.connector.platforms[HOST]?.nativeHooks ?? {}
244
+ );
245
+ if (ctx.connector.platforms[HOST]?.hooks === false && nativeEvents.length === 0) {
217
246
  return [
218
247
  {
219
248
  platform: this.id,
@@ -223,16 +252,70 @@ var OMPAdapter = class extends BaseAdapter {
223
252
  }
224
253
  ];
225
254
  }
226
- if (ctx.connector.hookEvents.length === 0) {
255
+ if (ctx.connector.hookEvents.length === 0 && nativeEvents.length === 0) {
227
256
  return [
228
257
  {
229
258
  platform: this.id,
230
259
  action: "skip",
231
260
  path: entryPath,
232
- detail: "connector declares no hooks"
261
+ detail: this.actionTriggers(ctx).length > 0 ? "no hooks (plugin written for actions)" : "connector declares no hooks"
233
262
  }
234
263
  ];
235
264
  }
265
+ return this.ensurePlugin(
266
+ ctx,
267
+ (file) => file.path.endsWith("package.json") ? "omp extension manifest" : `omp plugin module (${this.hookDetail(ctx)})`
268
+ );
269
+ }
270
+ // ── Action install / uninstall (slash commands in the shared plugin) ────
271
+ /**
272
+ * Each declared action becomes a `pi.registerCommand(...)` inside the SAME
273
+ * generated extension module (see buildPluginSource). So installActions just
274
+ * ensures that shared module is on disk: when hooks already wrote the identical
275
+ * bytes the content-compare yields "skip" (no double material write), and an
276
+ * actions-only connector gets the plugin written here. Honors
277
+ * platforms.omp.actions === false and the empty-actions skip.
278
+ */
279
+ installActions(ctx) {
280
+ const entryPath = this.getHookConfigPath(ctx);
281
+ if (ctx.connector.platforms[HOST]?.actions === false) {
282
+ return [
283
+ { platform: this.id, action: "skip", path: entryPath, detail: "actions disabled for omp" }
284
+ ];
285
+ }
286
+ if (this.actionTriggers(ctx).length === 0) {
287
+ return [
288
+ { platform: this.id, action: "skip", path: entryPath, detail: "connector declares no actions" }
289
+ ];
290
+ }
291
+ return this.ensurePlugin(
292
+ ctx,
293
+ (file) => file.path.endsWith("package.json") ? "omp extension manifest" : "omp plugin module (action commands)"
294
+ );
295
+ }
296
+ /**
297
+ * Actions live INSIDE the shared plugin module, which uninstallHooks removes
298
+ * unconditionally (it runs last in the teardown pass). Removing it here too
299
+ * would race uninstallHooks, so this is a single informational skip.
300
+ */
301
+ uninstallActions(ctx) {
302
+ return [
303
+ {
304
+ platform: this.id,
305
+ action: "skip",
306
+ path: this.getHookConfigPath(ctx),
307
+ detail: "action commands are embedded in the plugin module; removed by uninstallHooks"
308
+ }
309
+ ];
310
+ }
311
+ /**
312
+ * Synthesize + content-compare-write the extension package (package.json +
313
+ * index.js). Shared by installHooks and installActions: the generator is a pure
314
+ * function of ctx, so whichever surface runs second sees byte-identical files
315
+ * and reports "skip" — no double material write. `detailFor` flavors the
316
+ * ChangeRecord detail per surface.
317
+ */
318
+ ensurePlugin(ctx, detailFor) {
236
319
  const files = this.synthesizePlugin(ctx);
237
320
  const changes = [];
238
321
  for (const file of files) {
@@ -250,7 +333,7 @@ var OMPAdapter = class extends BaseAdapter {
250
333
  platform: this.id,
251
334
  action,
252
335
  path: file.path,
253
- detail: file.path.endsWith("package.json") ? "omp extension manifest" : `omp plugin module (${this.hookDetail(ctx)})`
336
+ detail: detailFor(file)
254
337
  });
255
338
  }
256
339
  return changes;
@@ -262,10 +345,18 @@ var OMPAdapter = class extends BaseAdapter {
262
345
  * "unsupported here" so the detail never overstates coverage.
263
346
  */
264
347
  hookDetail(ctx) {
265
- const declared = ctx.connector.hookEvents;
348
+ const canonicalOff = ctx.connector.platforms[HOST]?.hooks === false;
349
+ const declared = canonicalOff ? [] : ctx.connector.hookEvents;
266
350
  const mapped = declared.filter((e) => EVENT_TO_OMP[e] !== void 0);
267
351
  const unsupported = declared.filter((e) => EVENT_TO_OMP[e] === void 0);
268
- const base = mapped.join(",");
352
+ const nativeEvents = Object.keys(
353
+ ctx.connector.platforms[HOST]?.nativeHooks ?? {}
354
+ );
355
+ const parts = [mapped.join(",")].filter((p) => p !== "");
356
+ if (nativeEvents.length > 0) {
357
+ parts.push(`native: ${nativeEvents.join(",")}`);
358
+ }
359
+ const base = parts.join("; ");
269
360
  return unsupported.length > 0 ? `${base}; unsupported here: ${unsupported.join(",")}` : base;
270
361
  }
271
362
  uninstallHooks(ctx) {
@@ -342,7 +433,8 @@ var OMPAdapter = class extends BaseAdapter {
342
433
  buildPluginSource(ctx) {
343
434
  const homeBin = JSON.stringify(ctx.homeBinPath);
344
435
  const connectorId = JSON.stringify(ctx.connector.id);
345
- const events = ctx.connector.hookEvents.filter(
436
+ const canonicalOff = ctx.connector.platforms[HOST]?.hooks === false;
437
+ const events = canonicalOff ? [] : ctx.connector.hookEvents.filter(
346
438
  (e) => EVENT_TO_OMP[e] !== void 0
347
439
  );
348
440
  const has = (e) => events.includes(e);
@@ -461,11 +553,39 @@ function deriveSessionId(ctx) {
461
553
  pi.on("session_before_compact", () => {
462
554
  bridge("PreCompact", { sessionId: SESSION_ID, projectDir: PROJECT_DIR });
463
555
  return undefined;
556
+ });`);
557
+ }
558
+ const nativeEvents = Object.keys(
559
+ ctx.connector.platforms[HOST]?.nativeHooks ?? {}
560
+ );
561
+ for (const ev of nativeEvents) {
562
+ handlers.push(` // nativeHooks passthrough \u2192 ${ev}
563
+ pi.on(${JSON.stringify(ev)}, (event) => {
564
+ bridge(${JSON.stringify(ev)}, { sessionId: SESSION_ID, projectDir: PROJECT_DIR, raw: event });
565
+ return undefined;
566
+ });`);
567
+ }
568
+ const actionHandlers = [];
569
+ for (const action of this.actionTriggers(ctx)) {
570
+ const id = JSON.stringify(action.id);
571
+ const description = JSON.stringify(action.description);
572
+ actionHandlers.push(` // Action /${action.id} \u2192 run the home-bin action verb directly.
573
+ pi.registerCommand(${id}, {
574
+ description: ${description},
575
+ handler: async (_args, _ctx) => {
576
+ try {
577
+ const args = ["action", "omp", ${id}, "--connector", CONNECTOR_ID];
578
+ process.platform === "win32"
579
+ ? execSync([HOME_BIN, ...args].map((a) => '"' + a + '"').join(" "), { stdio: "inherit" })
580
+ : execFileSync(HOME_BIN, args, { stdio: "inherit" });
581
+ } catch { /* fail-open */ }
582
+ return undefined;
583
+ },
464
584
  });`);
465
585
  }
466
586
  const factory = `
467
587
  export default function plugin(pi) {
468
- ${handlers.join("\n\n")}
588
+ ${[...handlers, ...actionHandlers].join("\n\n")}
469
589
  }
470
590
  `;
471
591
  return header + factory;
@@ -535,7 +655,7 @@ ${handlers.join("\n\n")}
535
655
  const entryPath = this.getHookConfigPath(ctx);
536
656
  const manifestPath = join(this.extensionDir(ctx), "package.json");
537
657
  const connectorId = ctx.connector.id;
538
- const hasHooks = ctx.connector.hookEvents.length > 0;
658
+ const hasHooks = ctx.connector.hookEvents.length > 0 || this.actionTriggers(ctx).length > 0;
539
659
  return [
540
660
  {
541
661
  name: `${this.name}: mcp.json present`,
@@ -594,4 +714,4 @@ export {
594
714
  adapter,
595
715
  omp_default as default
596
716
  };
597
- //# sourceMappingURL=omp-Z6FRNDPN.js.map
717
+ //# sourceMappingURL=omp-2QMEY6HD.js.map