@ken-jo/agent-connector 0.4.7 → 0.4.8

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 (183) hide show
  1. package/dist/{action-YCU53FNE.js → action-RWPRIZIC.js} +10 -10
  2. package/dist/{amazon-q-W574ZX35.js → amazon-q-5LJOB5L3.js} +6 -18
  3. package/dist/amazon-q-5LJOB5L3.js.map +1 -0
  4. package/dist/{amp-JPBQJJVM.js → amp-PU4LFSY6.js} +16 -48
  5. package/dist/amp-PU4LFSY6.js.map +1 -0
  6. package/dist/{antigravity-VK2Y3FGV.js → antigravity-DWW35HZO.js} +6 -5
  7. package/dist/{antigravity-cli-D4PCCUG2.js → antigravity-cli-VTQ6DNWL.js} +6 -5
  8. package/dist/{antigravity-cli-D4PCCUG2.js.map → antigravity-cli-VTQ6DNWL.js.map} +1 -1
  9. package/dist/{chunk-F5RX62T7.js → chunk-7QRUZAUG.js} +2 -2
  10. package/dist/{chunk-G5CQHVQG.js → chunk-7TVBFRVI.js} +12 -15
  11. package/dist/chunk-7TVBFRVI.js.map +1 -0
  12. package/dist/{chunk-CYOAH23F.js → chunk-A2T4Q7RM.js} +18 -18
  13. package/dist/{chunk-7ECYDK5T.js → chunk-CDVOBKSG.js} +4 -4
  14. package/dist/{chunk-DT6Y7XBI.js → chunk-CENEXP7K.js} +9 -38
  15. package/dist/chunk-CENEXP7K.js.map +1 -0
  16. package/dist/chunk-FBJQGRET.js +38 -0
  17. package/dist/chunk-FBJQGRET.js.map +1 -0
  18. package/dist/{chunk-WZA4CSGJ.js → chunk-H53QZQJI.js} +15 -2
  19. package/dist/chunk-H53QZQJI.js.map +1 -0
  20. package/dist/{chunk-MDNX7HTN.js → chunk-HOE2MN36.js} +2 -2
  21. package/dist/{chunk-7L6ITC4T.js → chunk-IEGR4TP3.js} +22 -6
  22. package/dist/chunk-IEGR4TP3.js.map +1 -0
  23. package/dist/{chunk-PFDUGDOA.js → chunk-KG6T3YNJ.js} +3 -3
  24. package/dist/{chunk-YQLQJZ7S.js → chunk-MOW2RKHX.js} +2 -2
  25. package/dist/{chunk-SDPIT4HW.js → chunk-NYR55UT7.js} +2 -2
  26. package/dist/{chunk-WFXWJITA.js → chunk-OZ5EXXQV.js} +2 -2
  27. package/dist/{chunk-I5MLE6S7.js → chunk-TO57WYBB.js} +15 -1
  28. package/dist/chunk-TO57WYBB.js.map +1 -0
  29. package/dist/chunk-UM5S7DKK.js +33 -0
  30. package/dist/chunk-UM5S7DKK.js.map +1 -0
  31. package/dist/{chunk-6RYPUR6O.js → chunk-VRKTVCYJ.js} +7 -7
  32. package/dist/{chunk-HAIMYUEY.js → chunk-WI6YSXOC.js} +3 -3
  33. package/dist/{chunk-2F5QH3D4.js → chunk-XQUUNAGC.js} +36 -36
  34. package/dist/{chunk-TZQBASI7.js → chunk-YS2NYJ6R.js} +13 -49
  35. package/dist/chunk-YS2NYJ6R.js.map +1 -0
  36. package/dist/{chunk-SPWFUHHK.js → chunk-YYISBXOM.js} +7 -7
  37. package/dist/{claude-code-ROSIILTM.js → claude-code-64X6RR2S.js} +15 -38
  38. package/dist/claude-code-64X6RR2S.js.map +1 -0
  39. package/dist/cli/sdk.js +4 -4
  40. package/dist/cli.js +1 -1
  41. package/dist/{cline-JUTO4V27.js → cline-T7ZDJYZQ.js} +15 -47
  42. package/dist/cline-T7ZDJYZQ.js.map +1 -0
  43. package/dist/{codebuff-2QUHL6HO.js → codebuff-PPPY3SJV.js} +9 -40
  44. package/dist/codebuff-PPPY3SJV.js.map +1 -0
  45. package/dist/{codex-YBBTIDD4.js → codex-EEVN43C2.js} +26 -62
  46. package/dist/codex-EEVN43C2.js.map +1 -0
  47. package/dist/{continue-W4TU4JSB.js → continue-VLLZO4PM.js} +9 -32
  48. package/dist/continue-VLLZO4PM.js.map +1 -0
  49. package/dist/{copilot-cli-Y74SOP5G.js → copilot-cli-A7G5WB4N.js} +15 -64
  50. package/dist/copilot-cli-A7G5WB4N.js.map +1 -0
  51. package/dist/{crush-GMEWLXK5.js → crush-AH24GDDB.js} +15 -42
  52. package/dist/crush-AH24GDDB.js.map +1 -0
  53. package/dist/{cursor-JBS4B3Q4.js → cursor-GJBSMXI6.js} +13 -51
  54. package/dist/cursor-GJBSMXI6.js.map +1 -0
  55. package/dist/{detect-2NIXILMZ.js → detect-YDCZNV4W.js} +4 -4
  56. package/dist/{doctor-QWJBWALA.js → doctor-DGC7P3P7.js} +13 -12
  57. package/dist/{doctor-QWJBWALA.js.map → doctor-DGC7P3P7.js.map} +1 -1
  58. package/dist/{droid-TJMTNCQE.js → droid-RBWCFKL3.js} +17 -40
  59. package/dist/droid-RBWCFKL3.js.map +1 -0
  60. package/dist/{gemini-cli-RAONGZRG.js → gemini-cli-CFPFEJEA.js} +15 -63
  61. package/dist/gemini-cli-CFPFEJEA.js.map +1 -0
  62. package/dist/{goose-G4KKM6YU.js → goose-UBJVQFUE.js} +18 -54
  63. package/dist/goose-UBJVQFUE.js.map +1 -0
  64. package/dist/{hermes-PJDTJE6F.js → hermes-6FXGXLNL.js} +14 -52
  65. package/dist/hermes-6FXGXLNL.js.map +1 -0
  66. package/dist/{hook-FDGIQPRC.js → hook-CDGSCASQ.js} +10 -10
  67. package/dist/index.js +2 -2
  68. package/dist/{install-TLG3QVP3.js → install-2D3UKEME.js} +13 -12
  69. package/dist/{install-TLG3QVP3.js.map → install-2D3UKEME.js.map} +1 -1
  70. package/dist/{jetbrains-copilot-DNXSLQE5.js → jetbrains-copilot-K26KMA3U.js} +10 -37
  71. package/dist/jetbrains-copilot-K26KMA3U.js.map +1 -0
  72. package/dist/{kilo-FERJ3X46.js → kilo-BKZJ26RM.js} +26 -90
  73. package/dist/kilo-BKZJ26RM.js.map +1 -0
  74. package/dist/{kilo-cli-TDCONH5G.js → kilo-cli-6UVWCXQD.js} +17 -48
  75. package/dist/kilo-cli-6UVWCXQD.js.map +1 -0
  76. package/dist/{kimi-RIRD4J5J.js → kimi-QALYPSRR.js} +10 -31
  77. package/dist/kimi-QALYPSRR.js.map +1 -0
  78. package/dist/{kiro-X7JVLAN7.js → kiro-J5J42I5Z.js} +10 -31
  79. package/dist/kiro-J5J42I5Z.js.map +1 -0
  80. package/dist/{leaderboard-MXGENYXN.js → leaderboard-VZQXNWTX.js} +2 -2
  81. package/dist/{mimo-code-RFLQ727H.js → mimo-code-BEE622P2.js} +22 -87
  82. package/dist/mimo-code-BEE622P2.js.map +1 -0
  83. package/dist/{mux-D77HBSBU.js → mux-5HTNKK4K.js} +9 -39
  84. package/dist/mux-5HTNKK4K.js.map +1 -0
  85. package/dist/{nemoclaw-LXUTMR56.js → nemoclaw-DNFIZFDF.js} +5 -5
  86. package/dist/{omp-CO7IXURG.js → omp-I3UTRBNP.js} +16 -48
  87. package/dist/omp-I3UTRBNP.js.map +1 -0
  88. package/dist/{openclaw-XWJLEW35.js → openclaw-QE2LMWIF.js} +5 -5
  89. package/dist/{opencode-QKZ5EIYU.js → opencode-ZFSUYJXI.js} +22 -88
  90. package/dist/opencode-ZFSUYJXI.js.map +1 -0
  91. package/dist/{package-IA56LSC3.js → package-BSCCMW4E.js} +8 -8
  92. package/dist/{pi-YGBXYWY5.js → pi-H2KBBDDJ.js} +4 -4
  93. package/dist/{qwen-code-E2MSEZK6.js → qwen-code-5LE34FNE.js} +10 -31
  94. package/dist/qwen-code-5LE34FNE.js.map +1 -0
  95. package/dist/{roo-code-AGGJ473T.js → roo-code-XH4GCYIS.js} +15 -52
  96. package/dist/roo-code-XH4GCYIS.js.map +1 -0
  97. package/dist/runtime/index.js +8 -8
  98. package/dist/sdk/index.js +3 -3
  99. package/dist/sdk/test.js +5 -5
  100. package/dist/{serve-RNUCK5F7.js → serve-MQNGPY2H.js} +10 -10
  101. package/dist/{status-JOX6RLJU.js → status-MRHVRDFY.js} +8 -7
  102. package/dist/{status-JOX6RLJU.js.map → status-MRHVRDFY.js.map} +1 -1
  103. package/dist/{statusline-ZVFI5DRT.js → statusline-IYWA75TR.js} +9 -9
  104. package/dist/{telemetry-3FN6HDVU.js → telemetry-IONIOMLC.js} +5 -5
  105. package/dist/{trae-6L226ZDU.js → trae-RVNRSV7X.js} +10 -39
  106. package/dist/trae-RVNRSV7X.js.map +1 -0
  107. package/dist/{uninstall-SCKZYB4J.js → uninstall-ESLSVCLE.js} +13 -12
  108. package/dist/{uninstall-SCKZYB4J.js.map → uninstall-ESLSVCLE.js.map} +1 -1
  109. package/dist/{upgrade-WU3KZWR4.js → upgrade-VICY5T64.js} +13 -12
  110. package/dist/{upgrade-WU3KZWR4.js.map → upgrade-VICY5T64.js.map} +1 -1
  111. package/dist/{usage-G72SF7JG.js → usage-TCUWV2YZ.js} +2 -2
  112. package/dist/{usage-event-DHSEBO5T.js → usage-event-CBZZP37Q.js} +9 -9
  113. package/dist/{vscode-copilot-6EOZDLXC.js → vscode-copilot-B2QBBHJW.js} +15 -65
  114. package/dist/vscode-copilot-B2QBBHJW.js.map +1 -0
  115. package/dist/{warp-N5YYN5BF.js → warp-5R54ST3N.js} +7 -19
  116. package/dist/warp-5R54ST3N.js.map +1 -0
  117. package/dist/{windsurf-4TGSJIVV.js → windsurf-L32UEOLY.js} +6 -18
  118. package/dist/windsurf-L32UEOLY.js.map +1 -0
  119. package/dist/{zed-6P2UFWXU.js → zed-FDJHJZKD.js} +11 -21
  120. package/dist/zed-FDJHJZKD.js.map +1 -0
  121. package/package.json +1 -1
  122. package/dist/amazon-q-W574ZX35.js.map +0 -1
  123. package/dist/amp-JPBQJJVM.js.map +0 -1
  124. package/dist/chunk-7L6ITC4T.js.map +0 -1
  125. package/dist/chunk-DT6Y7XBI.js.map +0 -1
  126. package/dist/chunk-G5CQHVQG.js.map +0 -1
  127. package/dist/chunk-I5MLE6S7.js.map +0 -1
  128. package/dist/chunk-TZQBASI7.js.map +0 -1
  129. package/dist/chunk-WZA4CSGJ.js.map +0 -1
  130. package/dist/claude-code-ROSIILTM.js.map +0 -1
  131. package/dist/cline-JUTO4V27.js.map +0 -1
  132. package/dist/codebuff-2QUHL6HO.js.map +0 -1
  133. package/dist/codex-YBBTIDD4.js.map +0 -1
  134. package/dist/continue-W4TU4JSB.js.map +0 -1
  135. package/dist/copilot-cli-Y74SOP5G.js.map +0 -1
  136. package/dist/crush-GMEWLXK5.js.map +0 -1
  137. package/dist/cursor-JBS4B3Q4.js.map +0 -1
  138. package/dist/droid-TJMTNCQE.js.map +0 -1
  139. package/dist/gemini-cli-RAONGZRG.js.map +0 -1
  140. package/dist/goose-G4KKM6YU.js.map +0 -1
  141. package/dist/hermes-PJDTJE6F.js.map +0 -1
  142. package/dist/jetbrains-copilot-DNXSLQE5.js.map +0 -1
  143. package/dist/kilo-FERJ3X46.js.map +0 -1
  144. package/dist/kilo-cli-TDCONH5G.js.map +0 -1
  145. package/dist/kimi-RIRD4J5J.js.map +0 -1
  146. package/dist/kiro-X7JVLAN7.js.map +0 -1
  147. package/dist/mimo-code-RFLQ727H.js.map +0 -1
  148. package/dist/mux-D77HBSBU.js.map +0 -1
  149. package/dist/omp-CO7IXURG.js.map +0 -1
  150. package/dist/opencode-QKZ5EIYU.js.map +0 -1
  151. package/dist/qwen-code-E2MSEZK6.js.map +0 -1
  152. package/dist/roo-code-AGGJ473T.js.map +0 -1
  153. package/dist/trae-6L226ZDU.js.map +0 -1
  154. package/dist/vscode-copilot-6EOZDLXC.js.map +0 -1
  155. package/dist/warp-N5YYN5BF.js.map +0 -1
  156. package/dist/windsurf-4TGSJIVV.js.map +0 -1
  157. package/dist/zed-6P2UFWXU.js.map +0 -1
  158. /package/dist/{action-YCU53FNE.js.map → action-RWPRIZIC.js.map} +0 -0
  159. /package/dist/{antigravity-VK2Y3FGV.js.map → antigravity-DWW35HZO.js.map} +0 -0
  160. /package/dist/{chunk-F5RX62T7.js.map → chunk-7QRUZAUG.js.map} +0 -0
  161. /package/dist/{chunk-CYOAH23F.js.map → chunk-A2T4Q7RM.js.map} +0 -0
  162. /package/dist/{chunk-7ECYDK5T.js.map → chunk-CDVOBKSG.js.map} +0 -0
  163. /package/dist/{chunk-MDNX7HTN.js.map → chunk-HOE2MN36.js.map} +0 -0
  164. /package/dist/{chunk-PFDUGDOA.js.map → chunk-KG6T3YNJ.js.map} +0 -0
  165. /package/dist/{chunk-YQLQJZ7S.js.map → chunk-MOW2RKHX.js.map} +0 -0
  166. /package/dist/{chunk-SDPIT4HW.js.map → chunk-NYR55UT7.js.map} +0 -0
  167. /package/dist/{chunk-WFXWJITA.js.map → chunk-OZ5EXXQV.js.map} +0 -0
  168. /package/dist/{chunk-6RYPUR6O.js.map → chunk-VRKTVCYJ.js.map} +0 -0
  169. /package/dist/{chunk-HAIMYUEY.js.map → chunk-WI6YSXOC.js.map} +0 -0
  170. /package/dist/{chunk-2F5QH3D4.js.map → chunk-XQUUNAGC.js.map} +0 -0
  171. /package/dist/{chunk-SPWFUHHK.js.map → chunk-YYISBXOM.js.map} +0 -0
  172. /package/dist/{detect-2NIXILMZ.js.map → detect-YDCZNV4W.js.map} +0 -0
  173. /package/dist/{hook-FDGIQPRC.js.map → hook-CDGSCASQ.js.map} +0 -0
  174. /package/dist/{leaderboard-MXGENYXN.js.map → leaderboard-VZQXNWTX.js.map} +0 -0
  175. /package/dist/{nemoclaw-LXUTMR56.js.map → nemoclaw-DNFIZFDF.js.map} +0 -0
  176. /package/dist/{openclaw-XWJLEW35.js.map → openclaw-QE2LMWIF.js.map} +0 -0
  177. /package/dist/{package-IA56LSC3.js.map → package-BSCCMW4E.js.map} +0 -0
  178. /package/dist/{pi-YGBXYWY5.js.map → pi-H2KBBDDJ.js.map} +0 -0
  179. /package/dist/{serve-RNUCK5F7.js.map → serve-MQNGPY2H.js.map} +0 -0
  180. /package/dist/{statusline-ZVFI5DRT.js.map → statusline-IYWA75TR.js.map} +0 -0
  181. /package/dist/{telemetry-3FN6HDVU.js.map → telemetry-IONIOMLC.js.map} +0 -0
  182. /package/dist/{usage-G72SF7JG.js.map → usage-TCUWV2YZ.js.map} +0 -0
  183. /package/dist/{usage-event-DHSEBO5T.js.map → usage-event-CBZZP37Q.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/adapters/claude-code/wire.ts"],"sourcesContent":["/**\n * adapters/claude-code/wire — Claude Code hook wire protocol.\n *\n * Claude Code pipes a JSON object to a hook command on stdin and reads a JSON\n * object (or empty) from stdout, interpreting the exit code as well. This module\n * captures the exact stdin shape and the canonical reply shape so the adapter's\n * parse/format methods are a single source of truth.\n *\n * Stdin (documented Claude Code hook input):\n * {\n * session_id, transcript_path, cwd, hook_event_name,\n * tool_name, tool_input, tool_response, // tool events\n * permission_suggestions, // PermissionRequest\n * tool_use_id, error, is_interrupt, duration_ms, // PostToolUseFailure\n * agent_id, agent_type, // SubagentStart/Stop\n * agent_transcript_path, last_assistant_message, // SubagentStop\n * source, // SessionStart\n * reason, // SessionEnd\n * prompt, // UserPromptSubmit\n * trigger, // PreCompact\n * stop_hook_active, // Stop / SubagentStop\n * message // Notification\n * }\n *\n * Stdout (canonical reply): a `hookSpecificOutput` object keyed by\n * `hookEventName`, carrying `permissionDecision` (allow|deny|ask) +\n * `permissionDecisionReason`, `additionalContext`, and (PreToolUse)\n * `updatedInput`; PermissionRequest instead takes a nested\n * `decision: { behavior: \"allow\"|\"deny\", ... }`; Stop-class blocks\n * (Stop / SubagentStop / UserPromptSubmit / PostToolUse) take the TOP-LEVEL\n * `{\"decision\":\"block\",\"reason\"}`. Exit 0 = proceed; the JSON refines the\n * decision.\n */\n\nimport type { SessionStartEvent } from \"../../core/types.js\";\n\n/** Canonical Claude Code hook event names (the values of `hook_event_name`). */\nexport const CLAUDE_HOOK_EVENTS = [\n \"PreToolUse\",\n \"PostToolUse\",\n \"PreCompact\",\n \"SessionStart\",\n \"SessionEnd\",\n \"UserPromptSubmit\",\n \"Stop\",\n \"Notification\",\n \"PermissionRequest\",\n \"PostToolUseFailure\",\n \"SubagentStart\",\n \"SubagentStop\",\n] as const;\n\nexport type ClaudeHookEvent = (typeof CLAUDE_HOOK_EVENTS)[number];\n\n/**\n * Raw Claude Code hook stdin payload. Every field is optional — a given event\n * only populates the subset relevant to it. `connector` is NOT a Claude field;\n * it is threaded in by the universal entrypoint so parseEvent can recover the\n * connector id (the home binary passes `--connector <id>` and may inject it).\n */\nexport interface ClaudeWireInput {\n session_id?: string;\n transcript_path?: string;\n cwd?: string;\n hook_event_name?: string;\n\n // tool events\n tool_name?: string;\n tool_input?: Record<string, unknown>;\n /** PostToolUse result payload (string or structured). */\n tool_response?: unknown;\n\n // PermissionRequest — permission-update entries the dialog would offer.\n // NOTE: the docs explicitly state PermissionRequest has NO tool_use_id.\n permission_suggestions?: unknown[];\n\n // PostToolUseFailure\n tool_use_id?: string;\n error?: string;\n is_interrupt?: boolean;\n duration_ms?: number;\n\n // SubagentStart / SubagentStop — agent_type is unreliable on SubagentStop\n // (the SDK may not populate it); treat both as optional everywhere.\n agent_id?: string;\n agent_type?: string;\n // SubagentStop — the subagent's OWN transcript (transcript_path stays the\n // parent session's) + the text of its final response.\n agent_transcript_path?: string;\n last_assistant_message?: string;\n\n // SessionStart\n source?: string;\n // SessionEnd\n reason?: string;\n // UserPromptSubmit\n prompt?: string;\n // PreCompact\n trigger?: string;\n // Stop / SubagentStop\n stop_hook_active?: boolean;\n // Notification\n message?: string;\n\n /** Injected by the entrypoint so the runtime knows which connector to dispatch. */\n connector?: string;\n}\n\n/**\n * Extract a stable session id from a Claude wire payload.\n * Priority mirrors the proven adapter: transcript UUID > session_id > \"\".\n * (The framework's normalized event uses \"\" when no id is available, per\n * core/types BaseEvent.sessionId docstring — no ppid fabrication here.)\n */\nexport function extractSessionId(input: ClaudeWireInput): string {\n if (typeof input.transcript_path === \"string\") {\n const m = input.transcript_path.match(/([a-f0-9-]{36})\\.jsonl$/);\n if (m && m[1]) return m[1];\n }\n if (typeof input.session_id === \"string\" && input.session_id !== \"\") {\n return input.session_id;\n }\n return \"\";\n}\n\n/** Coerce a Claude PostToolUse `tool_response` into a string for the normalized event. */\nexport function toolResponseToString(value: unknown): string | undefined {\n if (value == null) return undefined;\n if (typeof value === \"string\") return value;\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}\n\n/** Map a host's raw session-start \"source\" to the canonical SessionStart source. */\nexport function normalizeSessionSource(source: string | undefined): SessionStartEvent[\"source\"] {\n switch (source) {\n case \"compact\":\n return \"compact\";\n case \"resume\":\n return \"resume\";\n case \"clear\":\n return \"clear\";\n default:\n return \"startup\";\n }\n}\n"],"mappings":";;;AAkHO,SAAS,iBAAiB,OAAgC;AAC/D,MAAI,OAAO,MAAM,oBAAoB,UAAU;AAC7C,UAAM,IAAI,MAAM,gBAAgB,MAAM,yBAAyB;AAC/D,QAAI,KAAK,EAAE,CAAC,EAAG,QAAO,EAAE,CAAC;AAAA,EAC3B;AACA,MAAI,OAAO,MAAM,eAAe,YAAY,MAAM,eAAe,IAAI;AACnE,WAAO,MAAM;AAAA,EACf;AACA,SAAO;AACT;AAGO,SAAS,qBAAqB,OAAoC;AACvE,MAAI,SAAS,KAAM,QAAO;AAC1B,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,MAAI;AACF,WAAO,KAAK,UAAU,KAAK;AAAA,EAC7B,QAAQ;AACN,WAAO,OAAO,KAAK;AAAA,EACrB;AACF;AAGO,SAAS,uBAAuB,QAAyD;AAC9F,UAAQ,QAAQ;AAAA,IACd,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;","names":[]}
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  REGISTERED_PLATFORM_IDS
4
- } from "./chunk-2F5QH3D4.js";
4
+ } from "./chunk-XQUUNAGC.js";
5
5
  import {
6
6
  CONFIG_PATCH_SEGMENT_RE,
7
7
  configPatchNamespaceViolation,
@@ -495,4 +495,4 @@ export {
495
495
  defineConfigPatch,
496
496
  defineNativeHook
497
497
  };
498
- //# sourceMappingURL=chunk-MDNX7HTN.js.map
498
+ //# sourceMappingURL=chunk-HOE2MN36.js.map
@@ -9,13 +9,16 @@ ${stringifyYaml(frontmatter)}---
9
9
  ${body}
10
10
  `;
11
11
  }
12
- function renderCommandMd(cmd) {
12
+ function renderCommandMd(cmd, opts = {}) {
13
+ const { includeToolsAndModel = true } = opts;
13
14
  const frontmatter = {};
14
15
  if (cmd.description !== void 0) frontmatter.description = cmd.description;
15
16
  if (cmd.argumentHint !== void 0) frontmatter["argument-hint"] = cmd.argumentHint;
16
- const allow = cmd.tools?.allow;
17
- if (allow && allow.length > 0) frontmatter["allowed-tools"] = allow.join(", ");
18
- if (cmd.model !== void 0) frontmatter.model = cmd.model;
17
+ if (includeToolsAndModel) {
18
+ const allow = cmd.tools?.allow;
19
+ if (allow && allow.length > 0) frontmatter["allowed-tools"] = allow.join(", ");
20
+ if (cmd.model !== void 0) frontmatter.model = cmd.model;
21
+ }
19
22
  if (cmd.extra) Object.assign(frontmatter, cmd.extra);
20
23
  return renderFrontmatterMd(frontmatter, cmd.prompt);
21
24
  }
@@ -44,11 +47,24 @@ function renderSubagentMd(agent) {
44
47
  if (agent.extra) Object.assign(frontmatter, agent.extra);
45
48
  return renderFrontmatterMd(frontmatter, agent.prompt);
46
49
  }
50
+ function renderOpenCodeSubagentMd(agent) {
51
+ const frontmatter = {
52
+ description: agent.description,
53
+ mode: "subagent"
54
+ };
55
+ if (agent.model !== void 0) frontmatter.model = agent.model;
56
+ if (agent.readonly === true) {
57
+ frontmatter.permission = { edit: "deny", bash: "deny" };
58
+ }
59
+ if (agent.extra) Object.assign(frontmatter, agent.extra);
60
+ return renderFrontmatterMd(frontmatter, agent.prompt);
61
+ }
47
62
 
48
63
  export {
49
64
  renderFrontmatterMd,
50
65
  renderCommandMd,
51
66
  renderSkillMd,
52
- renderSubagentMd
67
+ renderSubagentMd,
68
+ renderOpenCodeSubagentMd
53
69
  };
54
- //# sourceMappingURL=chunk-7L6ITC4T.js.map
70
+ //# sourceMappingURL=chunk-IEGR4TP3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/adapters/claude-code/render.ts"],"sourcesContent":["/**\n * adapters/claude-code/render — shared content-surface renderers.\n *\n * The single source of truth for how a connector's commands / skills / subagents\n * are serialized into Claude Code's native `md + YAML-frontmatter` documents.\n * BOTH the live claude-code adapter (which writes into ~/.claude or .claude when\n * installing) AND `core/package` (which emits a marketplace-installable plugin\n * bundle) import these so the two paths produce BYTE-IDENTICAL output — there is\n * no second, subtly-different copy to drift.\n *\n * The frontmatter serializer reuses the `yaml` package (the same serializer\n * core/yaml and BaseAdapter.renderFrontmatterMd use): a `---` fence, the YAML\n * block, a closing `---`, a blank line, then the markdown body and a trailing\n * newline.\n */\n\nimport { stringify as stringifyYaml } from \"yaml\";\n\nimport type { CommandDef, SkillDef, SubagentDef } from \"../../core/types.js\";\n\n/**\n * Render a YAML-frontmatter + markdown body document:\n * \"---\\n\" + <yaml> + \"---\\n\\n\" + <body> + \"\\n\".\n * Identical to BaseAdapter.renderFrontmatterMd (which now delegates here).\n */\nexport function renderFrontmatterMd(\n frontmatter: Record<string, unknown>,\n body: string,\n): string {\n return `---\\n${stringifyYaml(frontmatter)}---\\n\\n${body}\\n`;\n}\n\n/**\n * Render a command to md+frontmatter\n * (description, argument-hint, allowed-tools, model + verbatim extra).\n *\n * `opts.includeToolsAndModel` (default `true`) controls the allowed-tools and\n * model insertions. Hosts whose command frontmatter is only\n * (description, argument-hint + verbatim extra) — i.e. they have no native\n * allowed-tools/model keys — pass `{ includeToolsAndModel: false }` to suppress\n * both; the default reproduces the full shape byte-for-byte.\n */\nexport function renderCommandMd(\n cmd: CommandDef,\n opts: { includeToolsAndModel?: boolean } = {},\n): string {\n const { includeToolsAndModel = true } = opts;\n const frontmatter: Record<string, unknown> = {};\n if (cmd.description !== undefined) frontmatter.description = cmd.description;\n if (cmd.argumentHint !== undefined) frontmatter[\"argument-hint\"] = cmd.argumentHint;\n if (includeToolsAndModel) {\n const allow = cmd.tools?.allow;\n if (allow && allow.length > 0) frontmatter[\"allowed-tools\"] = allow.join(\", \");\n if (cmd.model !== undefined) frontmatter.model = cmd.model;\n }\n if (cmd.extra) Object.assign(frontmatter, cmd.extra);\n return renderFrontmatterMd(frontmatter, cmd.prompt);\n}\n\n/**\n * Render a skill's SKILL.md: frontmatter (name, description + optional model,\n * allowed-tools, disable-model-invocation, verbatim extra) + body.\n */\nexport function renderSkillMd(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 renderFrontmatterMd(frontmatter, skill.body);\n}\n\n/** Render a subagent to md+frontmatter (name, description, tools, model) + prompt body. */\nexport function renderSubagentMd(agent: SubagentDef): string {\n const frontmatter: Record<string, unknown> = {\n name: agent.name,\n description: agent.description,\n };\n const allow = agent.tools?.allow;\n if (allow && allow.length > 0) frontmatter.tools = allow.join(\", \");\n if (agent.model !== undefined) frontmatter.model = agent.model;\n if (agent.extra) Object.assign(frontmatter, agent.extra);\n return renderFrontmatterMd(frontmatter, agent.prompt);\n}\n\n/**\n * Render a subagent in OpenCode's shape (shared by opencode/kilo/mimo-code):\n * frontmatter (description, mode:\"subagent\", model?, permission? + verbatim\n * extra) with the system prompt as the body. `name` is NOT a frontmatter\n * field — it comes from the filename. `permission` is derived from the coarse\n * `readonly` knob: a readonly agent gets a per-tool deny map (edit/bash) so it\n * cannot mutate the workspace.\n */\nexport function renderOpenCodeSubagentMd(agent: SubagentDef): string {\n const frontmatter: Record<string, unknown> = {\n description: agent.description,\n mode: \"subagent\",\n };\n if (agent.model !== undefined) frontmatter.model = agent.model;\n if (agent.readonly === true) {\n // Per-tool permission map: deny mutating tools for a readonly subagent.\n frontmatter.permission = { edit: \"deny\", bash: \"deny\" };\n }\n if (agent.extra) Object.assign(frontmatter, agent.extra);\n return renderFrontmatterMd(frontmatter, agent.prompt);\n}\n"],"mappings":";;;AAgBA,SAAS,aAAa,qBAAqB;AASpC,SAAS,oBACd,aACA,MACQ;AACR,SAAO;AAAA,EAAQ,cAAc,WAAW,CAAC;AAAA;AAAA,EAAU,IAAI;AAAA;AACzD;AAYO,SAAS,gBACd,KACA,OAA2C,CAAC,GACpC;AACR,QAAM,EAAE,uBAAuB,KAAK,IAAI;AACxC,QAAM,cAAuC,CAAC;AAC9C,MAAI,IAAI,gBAAgB,OAAW,aAAY,cAAc,IAAI;AACjE,MAAI,IAAI,iBAAiB,OAAW,aAAY,eAAe,IAAI,IAAI;AACvE,MAAI,sBAAsB;AACxB,UAAM,QAAQ,IAAI,OAAO;AACzB,QAAI,SAAS,MAAM,SAAS,EAAG,aAAY,eAAe,IAAI,MAAM,KAAK,IAAI;AAC7E,QAAI,IAAI,UAAU,OAAW,aAAY,QAAQ,IAAI;AAAA,EACvD;AACA,MAAI,IAAI,MAAO,QAAO,OAAO,aAAa,IAAI,KAAK;AACnD,SAAO,oBAAoB,aAAa,IAAI,MAAM;AACpD;AAMO,SAAS,cAAc,OAAyB;AACrD,QAAM,cAAuC;AAAA,IAC3C,MAAM,MAAM;AAAA,IACZ,aAAa,MAAM;AAAA,EACrB;AACA,MAAI,MAAM,UAAU,OAAW,aAAY,QAAQ,MAAM;AACzD,QAAM,QAAQ,MAAM,OAAO;AAC3B,MAAI,SAAS,MAAM,SAAS,EAAG,aAAY,eAAe,IAAI,MAAM,KAAK,IAAI;AAC7E,MAAI,MAAM,2BAA2B,QAAW;AAC9C,gBAAY,0BAA0B,IAAI,MAAM;AAAA,EAClD;AACA,MAAI,MAAM,MAAO,QAAO,OAAO,aAAa,MAAM,KAAK;AACvD,SAAO,oBAAoB,aAAa,MAAM,IAAI;AACpD;AAGO,SAAS,iBAAiB,OAA4B;AAC3D,QAAM,cAAuC;AAAA,IAC3C,MAAM,MAAM;AAAA,IACZ,aAAa,MAAM;AAAA,EACrB;AACA,QAAM,QAAQ,MAAM,OAAO;AAC3B,MAAI,SAAS,MAAM,SAAS,EAAG,aAAY,QAAQ,MAAM,KAAK,IAAI;AAClE,MAAI,MAAM,UAAU,OAAW,aAAY,QAAQ,MAAM;AACzD,MAAI,MAAM,MAAO,QAAO,OAAO,aAAa,MAAM,KAAK;AACvD,SAAO,oBAAoB,aAAa,MAAM,MAAM;AACtD;AAUO,SAAS,yBAAyB,OAA4B;AACnE,QAAM,cAAuC;AAAA,IAC3C,aAAa,MAAM;AAAA,IACnB,MAAM;AAAA,EACR;AACA,MAAI,MAAM,UAAU,OAAW,aAAY,QAAQ,MAAM;AACzD,MAAI,MAAM,aAAa,MAAM;AAE3B,gBAAY,aAAa,EAAE,MAAM,QAAQ,MAAM,OAAO;AAAA,EACxD;AACA,MAAI,MAAM,MAAO,QAAO,OAAO,aAAa,MAAM,KAAK;AACvD,SAAO,oBAAoB,aAAa,MAAM,MAAM;AACtD;","names":[]}
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  renderFrontmatterMd
4
- } from "./chunk-7L6ITC4T.js";
4
+ } from "./chunk-IEGR4TP3.js";
5
5
  import {
6
6
  buildHomeBinActionCommand,
7
7
  buildHomeBinHookCommand
8
- } from "./chunk-I5MLE6S7.js";
8
+ } from "./chunk-TO57WYBB.js";
9
9
  import {
10
10
  MEMORY_CONTENT_SOFT_BUDGET_BYTES,
11
11
  listManagedBlocks,
@@ -1148,4 +1148,4 @@ export {
1148
1148
  removeFromObjectMap,
1149
1149
  BaseAdapter
1150
1150
  };
1151
- //# sourceMappingURL=chunk-PFDUGDOA.js.map
1151
+ //# sourceMappingURL=chunk-KG6T3YNJ.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  defineConnector
4
- } from "./chunk-MDNX7HTN.js";
4
+ } from "./chunk-HOE2MN36.js";
5
5
  import {
6
6
  connectorDir,
7
7
  connectorsDir,
@@ -174,4 +174,4 @@ export {
174
174
  connectorFromMeta,
175
175
  listRegisteredConnectors
176
176
  };
177
- //# sourceMappingURL=chunk-YQLQJZ7S.js.map
177
+ //# sourceMappingURL=chunk-MOW2RKHX.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ADAPTER_REGISTRY
4
- } from "./chunk-2F5QH3D4.js";
4
+ } from "./chunk-XQUUNAGC.js";
5
5
 
6
6
  // src/adapters/detect.ts
7
7
  async function detectInstalledPlatforms(projectDir) {
@@ -80,4 +80,4 @@ export {
80
80
  detectInstalledPlatforms,
81
81
  detectRuntimeHost
82
82
  };
83
- //# sourceMappingURL=chunk-SDPIT4HW.js.map
83
+ //# sourceMappingURL=chunk-NYR55UT7.js.map
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  allAdapters,
4
4
  loadAdapter
5
- } from "./chunk-2F5QH3D4.js";
5
+ } from "./chunk-XQUUNAGC.js";
6
6
 
7
7
  // src/sdk/introspect.ts
8
8
  var SURFACE_PREDICATES = {
@@ -41,4 +41,4 @@ export {
41
41
  hostsSupporting,
42
42
  surfaceSupport
43
43
  };
44
- //# sourceMappingURL=chunk-WFXWJITA.js.map
44
+ //# sourceMappingURL=chunk-OZ5EXXQV.js.map
@@ -79,6 +79,19 @@ function buildServeWrapperCommand(homeBinPath, connectorId, realCommand, realArg
79
79
  args: [...flags, "--", realCommand, ...realArgs]
80
80
  };
81
81
  }
82
+ function buildWrappedStdio(ctx, server, platformId, command, args) {
83
+ if (!shouldWrapForTelemetry(server, ctx.connector.telemetry)) {
84
+ return { command, args };
85
+ }
86
+ return buildServeWrapperCommand(
87
+ ctx.homeBinPath,
88
+ ctx.connector.id,
89
+ command,
90
+ args,
91
+ ctx.scope,
92
+ platformId
93
+ );
94
+ }
82
95
  function resolveSpawnCommand(command, deps = {}) {
83
96
  const platform = deps.platform ?? process.platform;
84
97
  if (platform !== "win32") return { file: command, needsShell: false };
@@ -135,7 +148,8 @@ export {
135
148
  isHostNativeUsageEnabled,
136
149
  shouldWrapForTelemetry,
137
150
  buildServeWrapperCommand,
151
+ buildWrappedStdio,
138
152
  resolveSpawnCommand,
139
153
  detectLaunchMethod
140
154
  };
141
- //# sourceMappingURL=chunk-I5MLE6S7.js.map
155
+ //# sourceMappingURL=chunk-TO57WYBB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/spawn.ts"],"sourcesContent":["/**\n * core/spawn — cross-platform command construction.\n *\n * Borrowed from context-mode (issues #369/#372/#548/#738): bare `node` is\n * unreliable on Windows Git Bash (MSYS) and MSYS rewrites absolute paths on\n * non-C: drives. Always use the resolved runtime path, forward slashes, and\n * double-quoting. No-ops on macOS/Linux.\n */\n\nimport { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nimport type { InstallScope, PlatformId, ServerDef } from \"./types.js\";\nimport type { InstallContext } from \"../adapters/spi.js\";\nimport type {\n LaunchMethod,\n TelemetryInstallScope,\n} from \"../telemetry/types.js\";\n\n/**\n * Narrow the framework's 5-value {@link InstallScope} down to the two telemetry\n * slicing buckets: only a `project`-local install is `project`; everything else\n * (system/user/profile/managed) is global and reads as `user`.\n */\nexport function narrowInstallScope(scope: InstallScope): TelemetryInstallScope {\n return scope === \"project\" ? \"project\" : \"user\";\n}\n\n/** Build `\"<nodePath>\" \"<scriptPath>\"`. */\nexport function buildNodeCommand(\n scriptPath: string,\n opts?: { nodePath?: string },\n): string {\n const nodePath = (opts?.nodePath ?? process.execPath).replace(/\\\\/g, \"/\");\n const safe = scriptPath.replace(/\\\\/g, \"/\");\n return `\"${nodePath}\" \"${safe}\"`;\n}\n\n/**\n * Strict inverse of buildNodeCommand. Returns the two quoted tokens, or null if\n * `cmd` was not produced by buildNodeCommand (no fragile last-whitespace tail\n * grabbing — that was the #548 doubled-path bug when paths contained spaces).\n */\nexport function parseNodeCommand(\n cmd: string,\n): { nodePath: string; scriptPath: string } | null {\n if (typeof cmd !== \"string\" || cmd.length === 0) return null;\n const m = cmd.match(/^\"([^\"]+)\"\\s+\"([^\"]+)\"\\s*$/);\n if (!m || !m[1] || !m[2]) return null;\n return { nodePath: m[1], scriptPath: m[2] };\n}\n\n/** Quote a single argument for inclusion in a host hook command string. */\nexport function quoteArg(arg: string): string {\n return `\"${arg.replace(/\\\\/g, \"/\")}\"`;\n}\n\n/**\n * True when `hay` (slash-normalized) has the quoted home-bin path IMMEDIATELY\n * followed by `verb` — i.e. the verb sits in its command SLOT (right after the\n * home binary), not merely somewhere in the argument list. This distinguishes\n * `\"<bin>\" statusline …` from `\"<bin>\" action … statusline …`: the action verb\n * takes a free-form `actionId` positional that can legitimately equal another\n * verb's name (`statusline` / `usage-event` / `hook`), and only the SLOT\n * position identifies the real verb. `homeBinNorm` is the slash-normalized\n * home-bin path the caller already derived.\n */\nfunction hasVerbSlot(hay: string, homeBinNorm: string, verb: string): boolean {\n return hay.includes(`\"${homeBinNorm}\" ${verb} `);\n}\n\n/**\n * Build the universal hook command a host config points at:\n * \"<homeBin>\" hook <platformId> <event> --connector <id>\n * Pointing every host at the one stable home binary is how a single update\n * propagates everywhere (docs/ARCHITECTURE.md §3 R1).\n */\nexport function buildHomeBinHookCommand(\n homeBinPath: string,\n platformId: string,\n event: string,\n connectorId: string,\n): string {\n return `${quoteArg(homeBinPath)} hook ${platformId} ${event} --connector ${connectorId}`;\n}\n\n/**\n * True when `command` is a home-bin hook command for exactly `connectorId`.\n *\n * Critical: the connector id is the LAST token of the hook command\n * (`... --connector <id>`), so a naive `command.includes(\"--connector \" + id)`\n * collides on shared-prefix ids — `--connector acme-db` contains\n * `--connector acme`, which would let uninstalling `acme` strip `acme-db`'s\n * hooks. We anchor the id token: the character after it must be end-of-string,\n * whitespace, or a closing double-quote (the JSON-embedded case). Connector ids\n * are kebab-case (ID_RE) so they never contain whitespace or quotes themselves.\n */\nexport function isHomeBinHookCommand(\n command: string | undefined,\n homeBinPath: string,\n connectorId: string,\n): boolean {\n if (!command) return false;\n // The stored command was forward-slashed by quoteArg(); homeBinPath() yields\n // NATIVE (back)slashes on Windows (node:path join). Normalize BOTH sides so the\n // ownership substring test holds on win32 (without this, detection always\n // returns false there → duplicate hooks on re-install + orphans on uninstall).\n // No-op on POSIX.\n const hay = command.replace(/\\\\/g, \"/\");\n if (!hay.includes(homeBinPath.replace(/\\\\/g, \"/\"))) return false;\n const token = `--connector ${connectorId}`;\n let from = 0;\n for (;;) {\n const idx = hay.indexOf(token, from);\n if (idx < 0) return false;\n const after = hay.charAt(idx + token.length);\n if (after === \"\" || after === '\"' || /\\s/.test(after)) return true;\n from = idx + token.length;\n }\n}\n\n/**\n * Build the OPT-IN host-native usage-event command an AfterModel / PostInvocation\n * hook points at:\n * \"<homeBin>\" usage-event <platformId> --connector <id>\n * Mirrors {@link buildHomeBinHookCommand} (same anchoring rules apply) but routes\n * to the hidden `usage-event` entrypoint, which records a DISTINCT `model_turn`\n * row instead of dispatching a connector handler.\n */\nexport function buildUsageEventCommand(\n homeBinPath: string,\n platformId: string,\n connectorId: string,\n): string {\n return `${quoteArg(homeBinPath)} usage-event ${platformId} --connector ${connectorId}`;\n}\n\n/**\n * True when `command` is OUR host-native usage-event command for exactly\n * `connectorId`. Same end-of-token anchoring as {@link isHomeBinHookCommand} so a\n * shared-prefix id can't collide; additionally requires the ` usage-event ` verb\n * so it is never confused with a plain `hook` command during uninstall.\n */\nexport function isUsageEventCommand(\n command: string | undefined,\n homeBinPath: string,\n connectorId: string,\n): boolean {\n if (!command) return false;\n // Normalize separators like isHomeBinHookCommand (win32 ownership detection).\n const hay = command.replace(/\\\\/g, \"/\");\n const homeBinNorm = homeBinPath.replace(/\\\\/g, \"/\");\n if (!hay.includes(homeBinNorm)) return false;\n if (!hasVerbSlot(hay, homeBinNorm, \"usage-event\")) return false;\n return isHomeBinHookCommand(command, homeBinPath, connectorId);\n}\n\n/**\n * Build the home-bin statusline command a host's status line config points at:\n * \"<homeBin>\" statusline <platformId> --connector <id>\n * Mirrors {@link buildHomeBinHookCommand} / {@link buildUsageEventCommand} (the\n * same single-home-binary indirection) but routes to the `statusline`\n * entrypoint, which renders the connector's HUD line for the host.\n */\nexport function buildHomeBinStatuslineCommand(\n homeBinPath: string,\n platformId: string,\n connectorId: string,\n): string {\n return `${quoteArg(homeBinPath)} statusline ${platformId} --connector ${connectorId}`;\n}\n\n/**\n * True when `command` is OUR home-bin statusline command for exactly\n * `connectorId`. Same end-of-token anchoring as {@link isHomeBinHookCommand} so a\n * shared-prefix id can't collide; additionally requires the ` statusline ` verb\n * so it is never confused with a plain `hook` / `usage-event` command.\n */\nexport function isHomeBinStatuslineCommand(\n command: string | undefined,\n homeBinPath: string,\n connectorId: string,\n): boolean {\n if (!command) return false;\n // Normalize separators like isHomeBinHookCommand (win32 ownership detection).\n const hay = command.replace(/\\\\/g, \"/\");\n const homeBinNorm = homeBinPath.replace(/\\\\/g, \"/\");\n if (!hay.includes(homeBinNorm)) return false;\n if (!hasVerbSlot(hay, homeBinNorm, \"statusline\")) return false;\n return isHomeBinHookCommand(command, homeBinPath, connectorId);\n}\n\n/**\n * Build the home-bin action command a future host affordance (slash command /\n * keybinding) points at:\n * \"<homeBin>\" action <platformId> <actionId> --connector <id>\n * Mirrors {@link buildHomeBinStatuslineCommand} (the same single-home-binary\n * indirection) but routes to the `action` entrypoint, which re-imports the\n * connector and runs the named action's run(ctx). v1 ships only this command\n * builder + the runtime verb; no adapter EMITS the affordance yet.\n */\nexport function buildHomeBinActionCommand(\n homeBinPath: string,\n platformId: string,\n actionId: string,\n connectorId: string,\n): string {\n return `${quoteArg(homeBinPath)} action ${platformId} ${actionId} --connector ${connectorId}`;\n}\n\n/**\n * True when `command` is OUR home-bin action command for exactly `connectorId`.\n * Same end-of-token anchoring as {@link isHomeBinHookCommand} so a shared-prefix\n * id can't collide; additionally requires the ` action ` verb so it is never\n * confused with a plain `hook` / `usage-event` / `statusline` command.\n */\nexport function isHomeBinActionCommand(\n command: string | undefined,\n homeBinPath: string,\n connectorId: string,\n): boolean {\n if (!command) return false;\n // Normalize separators like isHomeBinHookCommand (win32 ownership detection).\n const hay = command.replace(/\\\\/g, \"/\");\n const homeBinNorm = homeBinPath.replace(/\\\\/g, \"/\");\n if (!hay.includes(homeBinNorm)) return false;\n if (!hasVerbSlot(hay, homeBinNorm, \"action\")) return false;\n return isHomeBinHookCommand(command, homeBinPath, connectorId);\n}\n\n/**\n * Single source of truth for \"is OPT-IN host-native turn-usage capture enabled\n * for this connector?\" — read by the Gemini / Antigravity adapters at install\n * time to decide whether to ALSO write the AfterModel / PostInvocation usage hook.\n * Enabled when the connector opts in via telemetry.hostNativeUsage OR when the\n * install-time env switch AGENT_CONNECTOR_HOST_NATIVE=1 forces it on. Off by\n * default (privacy: host-native capture is never installed silently).\n */\nexport function isHostNativeUsageEnabled(\n telemetry: { enabled: boolean; hostNativeUsage?: boolean },\n env: NodeJS.ProcessEnv = process.env,\n): boolean {\n if (telemetry.enabled !== true) return false;\n if (env.AGENT_CONNECTOR_HOST_NATIVE === \"1\") return true;\n return telemetry.hostNativeUsage === true;\n}\n\n/**\n * Single source of truth for \"should this server be wrapped by `serve` for\n * telemetry?\" — so every adapter behaves identically even for a server that\n * skipped normalizeServer (e.g. a per-platform override). On by default for an\n * stdio server with a command, unless explicitly disabled or telemetry is off.\n */\nexport function shouldWrapForTelemetry(\n server: ServerDef,\n telemetry: { enabled: boolean },\n): boolean {\n return (\n server.wrapForTelemetry !== false &&\n telemetry.enabled === true &&\n server.transport === \"stdio\" &&\n typeof server.command === \"string\" &&\n server.command !== \"\"\n );\n}\n\n/**\n * Build the telemetry-wrapping server command:\n * \"<homeBin>\" serve --connector <id> --scope <scope> --host <platformId> -- <realCommand> <realArgs...>\n * Used when a stdio server opts into transparent telemetry capture.\n *\n * `scope` records the install dimension (global user vs project-local) on every\n * telemetry row so usage can be sliced by it later. It is OPTIONAL for backward\n * compatibility: when omitted, the `--scope` flag is not emitted and the runtime\n * treats the scope as \"unknown\".\n *\n * `platformId` bakes the install TARGET platform into the wrapper so the proxy\n * stamps `hostPlatform` correctly even under a headless spawn where runtime env\n * markers are absent (detectRuntimeHost only knows claude-code/cursor/codex and\n * otherwise mis-attributes). Emitted as `--host <platformId>` in the FLAG\n * section (before `--`). It is OPTIONAL + backward-compatible: when omitted the\n * `--host` flag is not emitted and the runtime falls back to env detection.\n */\nexport function buildServeWrapperCommand(\n homeBinPath: string,\n connectorId: string,\n realCommand: string,\n realArgs: string[],\n scope?: InstallScope,\n platformId?: PlatformId,\n): { command: string; args: string[] } {\n const flags = [\"serve\", \"--connector\", connectorId];\n if (scope !== undefined) flags.push(\"--scope\", narrowInstallScope(scope));\n if (platformId !== undefined) flags.push(\"--host\", platformId);\n return {\n command: homeBinPath,\n args: [...flags, \"--\", realCommand, ...realArgs],\n };\n}\n\n/**\n * Telemetry serve-wrap for a stdio command: when the connector opts in, route\n * `command`/`args` through `<homeBin> serve --connector <id> -- …`; otherwise\n * return them unchanged. Consolidates the per-host wrap snippet — the caller\n * keeps its own command/args seeding + downstream env-resolution + entry shaping.\n */\nexport function buildWrappedStdio(\n ctx: Pick<InstallContext, \"homeBinPath\" | \"connector\" | \"scope\">,\n server: ServerDef,\n platformId: PlatformId,\n command: string,\n args: string[],\n): { command: string; args: string[] } {\n if (!shouldWrapForTelemetry(server, ctx.connector.telemetry)) {\n return { command, args };\n }\n return buildServeWrapperCommand(\n ctx.homeBinPath,\n ctx.connector.id,\n command,\n args,\n ctx.scope,\n platformId,\n );\n}\n\n/** Injectable deps for {@link resolveSpawnCommand} (so the win32 branch is unit-testable on POSIX). */\nexport interface SpawnResolveDeps {\n platform?: NodeJS.Platform;\n /** PATH value (`;`-separated on Windows). */\n pathEnv?: string;\n /** PATHEXT value (`;`-separated). */\n pathExt?: string;\n /** File-existence probe (defaults to fs.existsSync). */\n exists?: (p: string) => boolean;\n}\n\n/** How a child command should be handed to spawn() on this platform. */\nexport interface SpawnResolution {\n /** The command to pass to spawn() (an absolute path on win32 when resolved). */\n file: string;\n /**\n * Whether spawn() MUST use `shell: true`. On native Windows a `.cmd`/`.bat`\n * shim (npx.cmd, pnpm.cmd, the agent-connector.cmd launcher) cannot be run by\n * raw CreateProcess — Node throws EINVAL since the 2024 security fix unless a\n * shell is used. `.exe` resolves directly with no shell.\n */\n needsShell: boolean;\n}\n\n/**\n * Resolve a child command for spawn() across platforms. NO-OP on macOS/Linux\n * (returns the command unchanged, no shell). On native Windows it fixes the two\n * spawn failure modes for bare package runners:\n * 1. raw CreateProcess ignores PATHEXT, so spawn(\"npx\") → ENOENT even though\n * `npx.cmd` is on PATH. We search PATH × PATHEXT and return the resolved\n * absolute path.\n * 2. a resolved `.cmd`/`.bat` still cannot be launched without a shell, so we\n * flag `needsShell` for those (and `.exe`/`.com` run directly).\n * A bare name that PATH search misses falls back to `{ file: command,\n * needsShell: true }` so cmd.exe's own PATHEXT lookup still finds it.\n */\nexport function resolveSpawnCommand(\n command: string,\n deps: SpawnResolveDeps = {},\n): SpawnResolution {\n const platform = deps.platform ?? process.platform;\n if (platform !== \"win32\") return { file: command, needsShell: false };\n\n const isBatch = (s: string): boolean => /\\.(cmd|bat)$/i.test(s);\n\n // Already a path or already has an extension → don't search; only decide shell.\n if (/[\\\\/]/.test(command) || /\\.[a-z0-9]+$/i.test(command)) {\n return { file: command, needsShell: isBatch(command) };\n }\n\n const exists = deps.exists ?? existsSync;\n const pathEnv = deps.pathEnv ?? process.env.PATH ?? process.env.Path ?? \"\";\n const pathExt = deps.pathExt ?? process.env.PATHEXT ?? \".COM;.EXE;.BAT;.CMD\";\n const dirs = pathEnv.split(\";\").filter((d) => d !== \"\");\n const exts = pathExt.split(\";\").filter((e) => e !== \"\");\n for (const dir of dirs) {\n for (const ext of exts) {\n const candidate = join(dir, command + ext);\n if (exists(candidate)) return { file: candidate, needsShell: isBatch(ext) };\n }\n }\n // Not found on PATH — let cmd.exe resolve it (handles shim dirs we may miss).\n return { file: command, needsShell: true };\n}\n\n/** Basenames (case-insensitive, sans common extensions) of the ephemeral package runners. */\nconst PACKAGE_RUNNERS: Record<string, Extract<LaunchMethod, \"npx\" | \"bunx\" | \"uvx\">> = {\n npx: \"npx\",\n bunx: \"bunx\",\n uvx: \"uvx\",\n};\n\n/** Basenames of language interpreters that launch a local script. */\nconst INTERPRETERS: ReadonlySet<string> = new Set([\"node\", \"bun\", \"deno\"]);\n\n/**\n * Strip a directory prefix and a trailing executable extension to get the bare\n * program name. Tolerates both POSIX and Windows separators (the wrapped command\n * may be an absolute Windows path) and lowercases for case-insensitive matching.\n */\nfunction commandBasename(realCommand: string): string {\n const noDir = realCommand.replace(/\\\\/g, \"/\").split(\"/\").pop() ?? realCommand;\n return noDir.replace(/\\.(exe|cmd|bat|com)$/i, \"\").toLowerCase();\n}\n\n/**\n * Classify how the real MCP server is launched, for the \"launch-method\" slicing\n * dimension. Package runners (npx/bunx/uvx) and interpreters (node/bun/deno) are\n * detected by the command basename. A remote (http) server is not launched\n * locally, so the caller — which alone knows the transport — passes\n * `isRemote: true` to force \"http\". Anything else resolves to \"binary\".\n */\nexport function detectLaunchMethod(\n realCommand: string,\n realArgs: string[],\n opts?: { isRemote?: boolean },\n): LaunchMethod {\n void realArgs; // reserved: args may later refine node-vs-script heuristics\n if (opts?.isRemote === true) return \"http\";\n if (typeof realCommand !== \"string\" || realCommand.trim() === \"\") {\n return \"unknown\";\n }\n const base = commandBasename(realCommand);\n if (base === \"\") return \"unknown\";\n const runner = PACKAGE_RUNNERS[base];\n if (runner !== undefined) return runner;\n if (INTERPRETERS.has(base)) return \"node\";\n return \"binary\";\n}\n"],"mappings":"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","names":[]}
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/core/host-paths.ts
4
+ import { homedir } from "os";
5
+ import { join, resolve } from "path";
6
+ function xdgConfigHome() {
7
+ const xdg = process.env.XDG_CONFIG_HOME;
8
+ return xdg && xdg.trim() !== "" ? resolve(xdg) : join(homedir(), ".config");
9
+ }
10
+ function roamingAppData() {
11
+ const appData = process.env.APPDATA;
12
+ return appData && appData.trim() !== "" ? resolve(appData) : join(homedir(), "AppData", "Roaming");
13
+ }
14
+ function localAppData() {
15
+ const local = process.env.LOCALAPPDATA;
16
+ return local && local.trim() !== "" ? resolve(local) : join(homedir(), "AppData", "Local");
17
+ }
18
+ function codexConfigHome() {
19
+ const env = process.env.CODEX_HOME;
20
+ if (env && env.trim() !== "") {
21
+ if (env.startsWith("~")) return join(homedir(), env.replace(/^~[/\\]?/, ""));
22
+ return resolve(env);
23
+ }
24
+ return join(homedir(), ".codex");
25
+ }
26
+
27
+ export {
28
+ xdgConfigHome,
29
+ roamingAppData,
30
+ localAppData,
31
+ codexConfigHome
32
+ };
33
+ //# sourceMappingURL=chunk-UM5S7DKK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/host-paths.ts"],"sourcesContent":["// ─────────────────────────────────────────────────────────────────────────\n// host-paths.ts — shared OS user-config-dir base resolvers\n//\n// Several adapters resolve the SAME per-OS \"user config base\" directory with\n// the same logic (XDG on posix; %APPDATA%/%LOCALAPPDATA% on Windows, each with\n// a ~/AppData fallback). These helpers consolidate that resolution so the\n// per-host adapters only carry their host-specific SUFFIX. The result is\n// byte-identical for absolute/clean config-dir inputs (the realistic case);\n// a non-canonical env value (relative, trailing slash, `..`) is normalized via\n// `resolve()` rather than passed through bare — a safe canonicalization.\n//\n// Scope note: these are the USER-CONFIG-DIR bases (where a host keeps its\n// settings/config files). The agent-connector *data-root* paths (our own\n// per-project state) live in core/paths.ts — do NOT conflate the two.\n//\n// Host-specific config-home resolvers that are SHARED across modules (e.g.\n// `codexConfigHome`, used by BOTH the codex adapter and marketplace detection)\n// DO live here, so the writer and the probe can never disagree on the dir.\n// Single-caller host envs (PI_CODING_AGENT_DIR, OPENCLAW_*) stay in their own\n// adapter.\n// ─────────────────────────────────────────────────────────────────────────\n\nimport { homedir } from \"node:os\";\nimport { join, resolve } from \"node:path\";\n\n/** $XDG_CONFIG_HOME when set & non-empty, else ~/.config. */\nexport function xdgConfigHome(): string {\n const xdg = process.env.XDG_CONFIG_HOME;\n return xdg && xdg.trim() !== \"\" ? resolve(xdg) : join(homedir(), \".config\");\n}\n\n/** %APPDATA% (Roaming) when set & non-empty, else ~/AppData/Roaming. */\nexport function roamingAppData(): string {\n const appData = process.env.APPDATA;\n return appData && appData.trim() !== \"\"\n ? resolve(appData)\n : join(homedir(), \"AppData\", \"Roaming\");\n}\n\n/** %LOCALAPPDATA% when set & non-empty, else ~/AppData/Local. */\nexport function localAppData(): string {\n const local = process.env.LOCALAPPDATA;\n return local && local.trim() !== \"\"\n ? resolve(local)\n : join(homedir(), \"AppData\", \"Local\");\n}\n\n/** Codex's config home: $CODEX_HOME (tilde-expanded, then resolved) when set\n * & non-empty, else ~/.codex. Shared by the codex adapter (writer) and the\n * marketplace detection probe so they never disagree on the config dir. */\nexport function codexConfigHome(): string {\n const env = process.env.CODEX_HOME;\n if (env && env.trim() !== \"\") {\n if (env.startsWith(\"~\")) return join(homedir(), env.replace(/^~[/\\\\]?/, \"\"));\n return resolve(env);\n }\n return join(homedir(), \".codex\");\n}\n"],"mappings":";;;AAsBA,SAAS,eAAe;AACxB,SAAS,MAAM,eAAe;AAGvB,SAAS,gBAAwB;AACtC,QAAM,MAAM,QAAQ,IAAI;AACxB,SAAO,OAAO,IAAI,KAAK,MAAM,KAAK,QAAQ,GAAG,IAAI,KAAK,QAAQ,GAAG,SAAS;AAC5E;AAGO,SAAS,iBAAyB;AACvC,QAAM,UAAU,QAAQ,IAAI;AAC5B,SAAO,WAAW,QAAQ,KAAK,MAAM,KACjC,QAAQ,OAAO,IACf,KAAK,QAAQ,GAAG,WAAW,SAAS;AAC1C;AAGO,SAAS,eAAuB;AACrC,QAAM,QAAQ,QAAQ,IAAI;AAC1B,SAAO,SAAS,MAAM,KAAK,MAAM,KAC7B,QAAQ,KAAK,IACb,KAAK,QAAQ,GAAG,WAAW,OAAO;AACxC;AAKO,SAAS,kBAA0B;AACxC,QAAM,MAAM,QAAQ,IAAI;AACxB,MAAI,OAAO,IAAI,KAAK,MAAM,IAAI;AAC5B,QAAI,IAAI,WAAW,GAAG,EAAG,QAAO,KAAK,QAAQ,GAAG,IAAI,QAAQ,YAAY,EAAE,CAAC;AAC3E,WAAO,QAAQ,GAAG;AAAA,EACpB;AACA,SAAO,KAAK,QAAQ,GAAG,QAAQ;AACjC;","names":[]}
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  installInstructions,
4
4
  packageConnector
5
- } from "./chunk-7ECYDK5T.js";
5
+ } from "./chunk-CDVOBKSG.js";
6
6
  import {
7
7
  MARKETPLACE_NAME,
8
8
  agyPluginInstalled,
@@ -38,13 +38,13 @@ import {
38
38
  readMarketplaceInstalls,
39
39
  readNpmConfig,
40
40
  writeMarketplaceInstalls
41
- } from "./chunk-G5CQHVQG.js";
41
+ } from "./chunk-7TVBFRVI.js";
42
42
  import {
43
43
  spawnChild
44
- } from "./chunk-F5RX62T7.js";
44
+ } from "./chunk-7QRUZAUG.js";
45
45
  import {
46
46
  detectInstalledPlatforms
47
- } from "./chunk-SDPIT4HW.js";
47
+ } from "./chunk-NYR55UT7.js";
48
48
  import {
49
49
  log
50
50
  } from "./chunk-KHO5WNTP.js";
@@ -52,11 +52,11 @@ import {
52
52
  deregisterConnector,
53
53
  loadRegisteredConnector,
54
54
  registerConnector
55
- } from "./chunk-YQLQJZ7S.js";
55
+ } from "./chunk-MOW2RKHX.js";
56
56
  import {
57
57
  REGISTERED_PLATFORM_IDS,
58
58
  loadAdapter
59
- } from "./chunk-2F5QH3D4.js";
59
+ } from "./chunk-XQUUNAGC.js";
60
60
  import {
61
61
  configPatchManualEdit
62
62
  } from "./chunk-FAHIMJRU.js";
@@ -3032,4 +3032,4 @@ export {
3032
3032
  upgradeViaMarketplace,
3033
3033
  marketplaceDoctorChecks
3034
3034
  };
3035
- //# sourceMappingURL=chunk-6RYPUR6O.js.map
3035
+ //# sourceMappingURL=chunk-VRKTVCYJ.js.map
@@ -12,11 +12,11 @@ import {
12
12
  import {
13
13
  loadRegisteredConnector,
14
14
  readRegisteredMeta
15
- } from "./chunk-YQLQJZ7S.js";
15
+ } from "./chunk-MOW2RKHX.js";
16
16
  import {
17
17
  REGISTERED_PLATFORM_IDS,
18
18
  loadAdapter
19
- } from "./chunk-2F5QH3D4.js";
19
+ } from "./chunk-XQUUNAGC.js";
20
20
  import {
21
21
  projectIdentity
22
22
  } from "./chunk-TRQKHP7D.js";
@@ -348,4 +348,4 @@ export {
348
348
  isNativeHookDeclared,
349
349
  runNativeHook
350
350
  };
351
- //# sourceMappingURL=chunk-HAIMYUEY.js.map
351
+ //# sourceMappingURL=chunk-WI6YSXOC.js.map
@@ -4,39 +4,39 @@
4
4
  var ADAPTER_REGISTRY = [
5
5
  {
6
6
  id: "claude-code",
7
- load: () => import("./claude-code-ROSIILTM.js").then((m) => m.default)
7
+ load: () => import("./claude-code-64X6RR2S.js").then((m) => m.default)
8
8
  },
9
9
  {
10
10
  id: "codex",
11
- load: () => import("./codex-YBBTIDD4.js").then((m) => m.default)
11
+ load: () => import("./codex-EEVN43C2.js").then((m) => m.default)
12
12
  },
13
13
  {
14
14
  id: "cursor",
15
- load: () => import("./cursor-JBS4B3Q4.js").then((m) => m.default)
15
+ load: () => import("./cursor-GJBSMXI6.js").then((m) => m.default)
16
16
  },
17
17
  // vscode-copilot after cursor: cursor is a VS Code fork, so the fork's runtime
18
18
  // markers must be checked first during host detection.
19
19
  {
20
20
  id: "vscode-copilot",
21
- load: () => import("./vscode-copilot-6EOZDLXC.js").then((m) => m.default)
21
+ load: () => import("./vscode-copilot-B2QBBHJW.js").then((m) => m.default)
22
22
  },
23
23
  {
24
24
  id: "copilot-cli",
25
- load: () => import("./copilot-cli-Y74SOP5G.js").then((m) => m.default)
25
+ load: () => import("./copilot-cli-A7G5WB4N.js").then((m) => m.default)
26
26
  },
27
27
  {
28
28
  id: "gemini-cli",
29
- load: () => import("./gemini-cli-RAONGZRG.js").then((m) => m.default)
29
+ load: () => import("./gemini-cli-CFPFEJEA.js").then((m) => m.default)
30
30
  },
31
31
  {
32
32
  id: "warp",
33
- load: () => import("./warp-N5YYN5BF.js").then((m) => m.default)
33
+ load: () => import("./warp-5R54ST3N.js").then((m) => m.default)
34
34
  },
35
35
  // ts-plugin paradigm: OpenCode loads a generated plugin module that bridges
36
36
  // its in-process events to the universal hook entrypoint.
37
37
  {
38
38
  id: "opencode",
39
- load: () => import("./opencode-QKZ5EIYU.js").then((m) => m.default)
39
+ load: () => import("./opencode-ZFSUYJXI.js").then((m) => m.default)
40
40
  },
41
41
  // mimo-code is Xiaomi's MiMoCode (@mimo-ai/cli, bin `mimo`) — an OpenCode FORK
42
42
  // (ts-plugin, MCP root key "mcp", ~/.config/mimocode/mimocode.json). Grouped
@@ -45,7 +45,7 @@ var ADAPTER_REGISTRY = [
45
45
  // constraint vs opencode (no shared config file to disambiguate).
46
46
  {
47
47
  id: "mimo-code",
48
- load: () => import("./mimo-code-RFLQ727H.js").then((m) => m.default)
48
+ load: () => import("./mimo-code-BEE622P2.js").then((m) => m.default)
49
49
  },
50
50
  // kilo-cli is the SQLite-backed OpenCode FORK command-line product (ts-plugin,
51
51
  // loads @kilocode/plugin modules registered in kilo.jsonc's "plugin" array;
@@ -54,23 +54,23 @@ var ADAPTER_REGISTRY = [
54
54
  // the "kilo" extension so there is no fork-ordering constraint between them.
55
55
  {
56
56
  id: "kilo-cli",
57
- load: () => import("./kilo-cli-TDCONH5G.js").then((m) => m.default)
57
+ load: () => import("./kilo-cli-6UVWCXQD.js").then((m) => m.default)
58
58
  },
59
59
  // Wave 1 — mcp-only adapters (no lifecycle hooks; MCP registration only).
60
60
  {
61
61
  id: "droid",
62
- load: () => import("./droid-TJMTNCQE.js").then((m) => m.default)
62
+ load: () => import("./droid-RBWCFKL3.js").then((m) => m.default)
63
63
  },
64
64
  {
65
65
  id: "roo-code",
66
- load: () => import("./roo-code-AGGJ473T.js").then((m) => m.default)
66
+ load: () => import("./roo-code-XH4GCYIS.js").then((m) => m.default)
67
67
  },
68
68
  // kilo is the Kilo Code VS Code extension (kilocode.kilo-code) — a Roo/Cline
69
69
  // fork, so it sits beside roo-code (mcp-only, root key "mcpServers", VS Code
70
70
  // globalStorage / .kilocode project scope). Distinct host from "kilo-cli".
71
71
  {
72
72
  id: "kilo",
73
- load: () => import("./kilo-FERJ3X46.js").then((m) => m.default)
73
+ load: () => import("./kilo-BKZJ26RM.js").then((m) => m.default)
74
74
  },
75
75
  // cline is the Cline VS Code extension (saoudrizwan.claude-dev) — the most-
76
76
  // installed AI coding extension and the PARENT that roo-code and kilo forked.
@@ -81,11 +81,11 @@ var ADAPTER_REGISTRY = [
81
81
  // is NO fork-before-parent ordering constraint here; it simply sits beside them.
82
82
  {
83
83
  id: "cline",
84
- load: () => import("./cline-JUTO4V27.js").then((m) => m.default)
84
+ load: () => import("./cline-T7ZDJYZQ.js").then((m) => m.default)
85
85
  },
86
86
  {
87
87
  id: "trae",
88
- load: () => import("./trae-6L226ZDU.js").then((m) => m.default)
88
+ load: () => import("./trae-RVNRSV7X.js").then((m) => m.default)
89
89
  },
90
90
  // antigravity-cli BEFORE antigravity: the `agy` CLI is a fork of the IDE
91
91
  // adapter with its own runtime markers (the universal hook command tags the
@@ -93,69 +93,69 @@ var ADAPTER_REGISTRY = [
93
93
  // before the IDE/parent during host detection.
94
94
  {
95
95
  id: "antigravity-cli",
96
- load: () => import("./antigravity-cli-D4PCCUG2.js").then((m) => m.default)
96
+ load: () => import("./antigravity-cli-VTQ6DNWL.js").then((m) => m.default)
97
97
  },
98
98
  {
99
99
  id: "antigravity",
100
- load: () => import("./antigravity-VK2Y3FGV.js").then((m) => m.default)
100
+ load: () => import("./antigravity-DWW35HZO.js").then((m) => m.default)
101
101
  },
102
102
  {
103
103
  id: "zed",
104
- load: () => import("./zed-6P2UFWXU.js").then((m) => m.default)
104
+ load: () => import("./zed-FDJHJZKD.js").then((m) => m.default)
105
105
  },
106
106
  {
107
107
  id: "amp",
108
- load: () => import("./amp-JPBQJJVM.js").then((m) => m.default)
108
+ load: () => import("./amp-PU4LFSY6.js").then((m) => m.default)
109
109
  },
110
110
  {
111
111
  id: "codebuff",
112
- load: () => import("./codebuff-2QUHL6HO.js").then((m) => m.default)
112
+ load: () => import("./codebuff-PPPY3SJV.js").then((m) => m.default)
113
113
  },
114
114
  {
115
115
  id: "mux",
116
- load: () => import("./mux-D77HBSBU.js").then((m) => m.default)
116
+ load: () => import("./mux-5HTNKK4K.js").then((m) => m.default)
117
117
  },
118
118
  // Pi — mcp-only host with no writable MCP config; drives the Agent Skills
119
119
  // surface only (writes <piDir>/skills/<name>/SKILL.md).
120
120
  {
121
121
  id: "pi",
122
- load: () => import("./pi-YGBXYWY5.js").then((m) => m.default)
122
+ load: () => import("./pi-H2KBBDDJ.js").then((m) => m.default)
123
123
  },
124
124
  // Wave 2 — json-stdio adapters (full hook dispatch via the universal entrypoint).
125
125
  // jetbrains-copilot before vscode-copilot is unnecessary (distinct hosts); grouped here.
126
126
  {
127
127
  id: "jetbrains-copilot",
128
- load: () => import("./jetbrains-copilot-DNXSLQE5.js").then((m) => m.default)
128
+ load: () => import("./jetbrains-copilot-K26KMA3U.js").then((m) => m.default)
129
129
  },
130
130
  {
131
131
  id: "qwen-code",
132
- load: () => import("./qwen-code-E2MSEZK6.js").then((m) => m.default)
132
+ load: () => import("./qwen-code-5LE34FNE.js").then((m) => m.default)
133
133
  },
134
134
  {
135
135
  id: "kiro",
136
- load: () => import("./kiro-X7JVLAN7.js").then((m) => m.default)
136
+ load: () => import("./kiro-J5J42I5Z.js").then((m) => m.default)
137
137
  },
138
138
  {
139
139
  id: "kimi",
140
- load: () => import("./kimi-RIRD4J5J.js").then((m) => m.default)
140
+ load: () => import("./kimi-QALYPSRR.js").then((m) => m.default)
141
141
  },
142
142
  {
143
143
  id: "crush",
144
- load: () => import("./crush-GMEWLXK5.js").then((m) => m.default)
144
+ load: () => import("./crush-AH24GDDB.js").then((m) => m.default)
145
145
  },
146
146
  // Wave 3 — json-stdio adapters with YAML config (MCP in YAML; hooks per host).
147
147
  {
148
148
  id: "goose",
149
- load: () => import("./goose-G4KKM6YU.js").then((m) => m.default)
149
+ load: () => import("./goose-UBJVQFUE.js").then((m) => m.default)
150
150
  },
151
151
  {
152
152
  id: "hermes",
153
- load: () => import("./hermes-PJDTJE6F.js").then((m) => m.default)
153
+ load: () => import("./hermes-6FXGXLNL.js").then((m) => m.default)
154
154
  },
155
155
  // Wave 4 — ts-plugin adapters (generate a bridge module to the universal entrypoint).
156
156
  {
157
157
  id: "omp",
158
- load: () => import("./omp-CO7IXURG.js").then((m) => m.default)
158
+ load: () => import("./omp-I3UTRBNP.js").then((m) => m.default)
159
159
  },
160
160
  // nemoclaw BEFORE openclaw (fork-before-parent convention). NVIDIA NemoClaw
161
161
  // wraps OpenClaw and DRIVES the SAME ~/.openclaw/openclaw.json, so a NemoClaw
@@ -168,11 +168,11 @@ var ADAPTER_REGISTRY = [
168
168
  // lands in the wrapped openclaw.json.
169
169
  {
170
170
  id: "nemoclaw",
171
- load: () => import("./nemoclaw-LXUTMR56.js").then((m) => m.default)
171
+ load: () => import("./nemoclaw-DNFIZFDF.js").then((m) => m.default)
172
172
  },
173
173
  {
174
174
  id: "openclaw",
175
- load: () => import("./openclaw-XWJLEW35.js").then((m) => m.default)
175
+ load: () => import("./openclaw-QE2LMWIF.js").then((m) => m.default)
176
176
  },
177
177
  // Wave 5 — mcp-only: Amazon Q Developer CLI. JSON MCP config under ~/.aws/amazonq/
178
178
  // (user) and .amazonq/ (project); root key "mcpServers"; bare stdio entry
@@ -182,7 +182,7 @@ var ADAPTER_REGISTRY = [
182
182
  // adapter installs MCP entries + the .amazonq/rules memory surface.
183
183
  {
184
184
  id: "amazon-q",
185
- load: () => import("./amazon-q-W574ZX35.js").then((m) => m.default)
185
+ load: () => import("./amazon-q-5LJOB5L3.js").then((m) => m.default)
186
186
  },
187
187
  // Continue (the `cn` terminal agent / Continue.dev, npm @continuedev/cli) —
188
188
  // json-stdio (Claude-compatible hooks). MCP config is YAML at ~/.continue/config.yaml (user) and
@@ -194,7 +194,7 @@ var ADAPTER_REGISTRY = [
194
194
  // fork-ordering constraint vs any sibling.
195
195
  {
196
196
  id: "continue",
197
- load: () => import("./continue-W4TU4JSB.js").then((m) => m.default)
197
+ load: () => import("./continue-VLLZO4PM.js").then((m) => m.default)
198
198
  },
199
199
  // Windsurf (Codeium / Cognition's Cascade agent) — mcp-only. USER/GLOBAL scope
200
200
  // ONLY: MCP config is JSON at ~/.codeium/windsurf/mcp_config.json (the docs
@@ -208,7 +208,7 @@ var ADAPTER_REGISTRY = [
208
208
  // memory surface. Distinct ~/.codeium marker — no fork-ordering constraint.
209
209
  {
210
210
  id: "windsurf",
211
- load: () => import("./windsurf-4TGSJIVV.js").then((m) => m.default)
211
+ load: () => import("./windsurf-L32UEOLY.js").then((m) => m.default)
212
212
  }
213
213
  ];
214
214
  var REGISTRY_BY_ID = new Map(
@@ -234,4 +234,4 @@ export {
234
234
  loadAdapter,
235
235
  allAdapters
236
236
  };
237
- //# sourceMappingURL=chunk-2F5QH3D4.js.map
237
+ //# sourceMappingURL=chunk-XQUUNAGC.js.map