@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
package/README.md CHANGED
@@ -8,13 +8,13 @@
8
8
 
9
9
  [![npm](https://img.shields.io/npm/v/@ken-jo/agent-connector?color=cb3837&logo=npm)](https://www.npmjs.com/package/@ken-jo/agent-connector)
10
10
  [![license](https://img.shields.io/npm/l/@ken-jo/agent-connector?color=22c55e)](LICENSE)
11
- ![platforms](https://img.shields.io/badge/platforms-31-2563eb)
11
+ ![platforms](https://img.shields.io/badge/platforms-35-2563eb)
12
12
  ![surfaces](https://img.shields.io/badge/surfaces-MCP%20%7C%20hooks%20%7C%20commands%20%7C%20tools%20%7C%20memory%20%7C%20status%20line-2563eb)
13
13
  ![hook paradigms](https://img.shields.io/badge/hook%20paradigms-3-2563eb)
14
14
  ![install verified](https://img.shields.io/badge/install%20verified-29%2F29-22c55e)
15
15
  ![headless runtime](https://img.shields.io/badge/headless%20runtime-10%20CLIs%20activated-22c55e)
16
16
  ![marketplace](https://img.shields.io/badge/package-9%20marketplace%20formats-2563eb)
17
- ![tests](https://img.shields.io/badge/tests-1727%20passing-22c55e)
17
+ ![tests](https://img.shields.io/badge/tests-1916%20passing-22c55e)
18
18
 
19
19
  ## Who this is for
20
20
 
@@ -57,14 +57,14 @@ agent-connector is the middleware that does it for you:
57
57
  registered but **not wrapped** (the proxy cannot intercept remote transports),
58
58
  so they yield no per-tool telemetry.
59
59
 
60
- > Status: **31 platforms, all 3 hook paradigms** (exceeds the
60
+ > Status: **35 platforms, all 3 hook paradigms** (exceeds the
61
61
  > [tokscale](https://github.com/junhoyeo/tokscale) token-leaderboard coverage).
62
62
  >
63
63
  > | Paradigm | Platforms |
64
64
  > |---|---|
65
- > | `json-stdio` (full hook dispatch) | Claude Code · Codex CLI · Cursor · VS Code Copilot · JetBrains Copilot · GitHub Copilot CLI · Gemini CLI · Qwen CLI · Kiro · Kimi CLI · Crush · Goose · Hermes · Droid (Factory) · Antigravity · Antigravity CLI |
66
- > | `mcp-only` (MCP registration only) | Warp · Kilo · Roo Code · Trae · Zed · Amp · Codebuff · Mux · Pi |
67
- > | `ts-plugin` (generated bridge module) | OpenCode · MiMoCode · Kilo CLI · Kilo · OMP · NemoClaw · OpenClaw |
65
+ > | `json-stdio` (full hook dispatch) | Claude Code · Codex CLI · Cursor · VS Code Copilot · JetBrains Copilot · GitHub Copilot CLI · Gemini CLI · Qwen CLI · Kiro · Kimi CLI · Crush · Goose · Hermes · Droid (Factory) · Antigravity · Antigravity CLI · Continue |
66
+ > | `mcp-only` (MCP registration only) | Warp · Roo Code · Cline · Trae · Zed · Codebuff · Mux · Pi · Amazon Q · Windsurf |
67
+ > | `ts-plugin` (generated bridge module) | OpenCode · MiMoCode · Kilo CLI · Kilo · OMP · NemoClaw · OpenClaw · Amp |
68
68
  >
69
69
  > …plus the telemetry core. Adding a platform = **one registry entry + one
70
70
  > adapter**. (Google Antigravity is now fully supported, including the `agy` CLI,
@@ -105,7 +105,7 @@ server in the right file + root key):
105
105
  - **Clean uninstall + `--purge`.** Every installed surface reverses; `--purge`
106
106
  deregisters the connector record and tears down the home binary when no
107
107
  connectors remain (29 / 29).
108
- - **1727 tests passing** · `tsc` clean · build green.
108
+ - **1874 tests passing** · `tsc` clean · build green.
109
109
 
110
110
  The 0.2.0 additions — the `memory` surface, the `nativeHooks` passthrough, and
111
111
  `configPatch` — went through the same bar: dogfooded against real connector
@@ -195,7 +195,7 @@ npx @ken-jo/agent-connector install
195
195
 
196
196
  > `install` targets only the hosts actually **detected** on this machine (or an
197
197
  > explicit `--targets` / `connector.targets` list), intersected with the
198
- > 31-adapter registry — there is no "install to all 31 unconditionally" path.
198
+ > 35-adapter registry — there is no "install to all 35 unconditionally" path.
199
199
 
200
200
  > **Optional convenience.** A global `npm i -g @ken-jo/agent-connector` is **not**
201
201
  > required for the flow above — `npx @ken-jo/agent-connector …` runs it straight from
@@ -437,7 +437,7 @@ memory: [
437
437
  ```
438
438
 
439
439
  **Write the guidance once — it lands in the standard
440
- [AGENTS.md](https://agents.md) on 29 of the 31 hosts** (the open, Linux
440
+ [AGENTS.md](https://agents.md) on 29 of the 35 hosts** (the open, Linux
441
441
  Foundation-stewarded "README for agents" format): project scope targets
442
442
  `<projectDir>/AGENTS.md` — and where a host resolves its rules file
443
443
  exclusively, the target is *probed* so the block lands in the file the host
@@ -1,20 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  fail
4
- } from "./chunk-KGXDYGNJ.js";
4
+ } from "./chunk-QC5A3TFQ.js";
5
5
  import {
6
6
  runAction
7
- } from "./chunk-BHUCB6LY.js";
7
+ } from "./chunk-H67V7DEL.js";
8
8
  import "./chunk-OP4KBXUO.js";
9
- import "./chunk-22Y24V7O.js";
10
- import "./chunk-J3D5W5T2.js";
11
- import "./chunk-CIRDOY2V.js";
9
+ import "./chunk-F5RX62T7.js";
10
+ import "./chunk-EROJDXMW.js";
11
+ import "./chunk-QOGMDOUX.js";
12
12
  import "./chunk-BCHWFTV4.js";
13
13
  import "./chunk-KHO5WNTP.js";
14
- import "./chunk-KGJWE6A2.js";
15
- import "./chunk-ADTHT2FN.js";
16
- import "./chunk-3PFFTFCU.js";
17
- import "./chunk-BXGFUENQ.js";
14
+ import "./chunk-MZF2YCXX.js";
15
+ import "./chunk-DCK5FADX.js";
16
+ import "./chunk-BMD7ANKF.js";
17
+ import "./chunk-FAHIMJRU.js";
18
+ import "./chunk-I5MLE6S7.js";
18
19
  import "./chunk-N6HH7K6P.js";
19
20
  import "./chunk-TRQKHP7D.js";
20
21
 
@@ -51,4 +52,4 @@ async function run(argv) {
51
52
  export {
52
53
  run
53
54
  };
54
- //# sourceMappingURL=action-PLZW5BGX.js.map
55
+ //# sourceMappingURL=action-EV63GAPY.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/cli/commands/action.ts"],"sourcesContent":["/**\n * cli/commands/action — the universal user-invokable action entrypoint.\n *\n * agent-connector action <platform> <actionId> --connector <id>\n *\n * A future host affordance (slash command / keybinding) points at the single\n * stable home binary (via core/spawn.buildHomeBinActionCommand). This command\n * parses the positionals + --connector, dispatches through runAction, writes any\n * stdout/stderr the action produced, and exits with its code. It reads NO stdin\n * (an action takes no host payload, unlike a hook or status line).\n *\n * USER-TRIGGERED is the runtime's contract: unlike the fail-open hook command,\n * an unknown action id or a throwing run surfaces as exit 1 + a stderr message —\n * the user invoked it deliberately, so the failure is shown, never swallowed.\n */\n\nimport { parseArgs } from \"node:util\";\n\nimport { runAction } from \"../../runtime/index.js\";\nimport { fail } from \"../app.js\";\n\nexport async function run(argv: string[]): Promise<number> {\n const { values, positionals } = parseArgs({\n args: argv,\n options: {\n connector: { type: \"string\" },\n },\n allowPositionals: true,\n });\n\n const platformId = positionals[0];\n const actionId = positionals[1];\n if (!platformId || !actionId) {\n return fail(\"usage: agent-connector action <platform> <actionId> --connector <id>\");\n }\n const connectorId = values.connector;\n if (!connectorId || connectorId.trim() === \"\") {\n return fail(\"action requires --connector <id>\");\n }\n\n const reply = await runAction({ platformId, actionId, connectorId });\n if (reply.stdout !== undefined && reply.stdout !== \"\") {\n process.stdout.write(reply.stdout.endsWith(\"\\n\") ? reply.stdout : `${reply.stdout}\\n`);\n }\n if (reply.stderr !== undefined && reply.stderr !== \"\") {\n process.stderr.write(reply.stderr.endsWith(\"\\n\") ? reply.stderr : `${reply.stderr}\\n`);\n }\n process.exit(reply.exitCode);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgBA,SAAS,iBAAiB;AAK1B,eAAsB,IAAI,MAAiC;AACzD,QAAM,EAAE,QAAQ,YAAY,IAAI,UAAU;AAAA,IACxC,MAAM;AAAA,IACN,SAAS;AAAA,MACP,WAAW,EAAE,MAAM,SAAS;AAAA,IAC9B;AAAA,IACA,kBAAkB;AAAA,EACpB,CAAC;AAED,QAAM,aAAa,YAAY,CAAC;AAChC,QAAM,WAAW,YAAY,CAAC;AAC9B,MAAI,CAAC,cAAc,CAAC,UAAU;AAC5B,WAAO,KAAK,sEAAsE;AAAA,EACpF;AACA,QAAM,cAAc,OAAO;AAC3B,MAAI,CAAC,eAAe,YAAY,KAAK,MAAM,IAAI;AAC7C,WAAO,KAAK,kCAAkC;AAAA,EAChD;AAEA,QAAM,QAAQ,MAAM,UAAU,EAAE,YAAY,UAAU,YAAY,CAAC;AACnE,MAAI,MAAM,WAAW,UAAa,MAAM,WAAW,IAAI;AACrD,YAAQ,OAAO,MAAM,MAAM,OAAO,SAAS,IAAI,IAAI,MAAM,SAAS,GAAG,MAAM,MAAM;AAAA,CAAI;AAAA,EACvF;AACA,MAAI,MAAM,WAAW,UAAa,MAAM,WAAW,IAAI;AACrD,YAAQ,OAAO,MAAM,MAAM,OAAO,SAAS,IAAI,IAAI,MAAM,SAAS,GAAG,MAAM,MAAM;AAAA,CAAI;AAAA,EACvF;AACA,UAAQ,KAAK,MAAM,QAAQ;AAC7B;","names":[]}
1
+ {"version":3,"sources":["../src/cli/commands/action.ts"],"sourcesContent":["/**\n * cli/commands/action — the universal user-invokable action entrypoint.\n *\n * agent-connector action <platform> <actionId> --connector <id>\n *\n * A future host affordance (slash command / keybinding) points at the single\n * stable home binary (via core/spawn.buildHomeBinActionCommand). This command\n * parses the positionals + --connector, dispatches through runAction, writes any\n * stdout/stderr the action produced, and exits with its code. It reads NO stdin\n * (an action takes no host payload, unlike a hook or status line).\n *\n * USER-TRIGGERED is the runtime's contract: unlike the fail-open hook command,\n * an unknown action id or a throwing run surfaces as exit 1 + a stderr message —\n * the user invoked it deliberately, so the failure is shown, never swallowed.\n */\n\nimport { parseArgs } from \"node:util\";\n\nimport { runAction } from \"../../runtime/index.js\";\nimport { fail } from \"../app.js\";\n\nexport async function run(argv: string[]): Promise<number> {\n const { values, positionals } = parseArgs({\n args: argv,\n options: {\n connector: { type: \"string\" },\n },\n allowPositionals: true,\n });\n\n const platformId = positionals[0];\n const actionId = positionals[1];\n if (!platformId || !actionId) {\n return fail(\"usage: agent-connector action <platform> <actionId> --connector <id>\");\n }\n const connectorId = values.connector;\n if (!connectorId || connectorId.trim() === \"\") {\n return fail(\"action requires --connector <id>\");\n }\n\n const reply = await runAction({ platformId, actionId, connectorId });\n if (reply.stdout !== undefined && reply.stdout !== \"\") {\n process.stdout.write(reply.stdout.endsWith(\"\\n\") ? reply.stdout : `${reply.stdout}\\n`);\n }\n if (reply.stderr !== undefined && reply.stderr !== \"\") {\n process.stderr.write(reply.stderr.endsWith(\"\\n\") ? reply.stderr : `${reply.stderr}\\n`);\n }\n process.exit(reply.exitCode);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAgBA,SAAS,iBAAiB;AAK1B,eAAsB,IAAI,MAAiC;AACzD,QAAM,EAAE,QAAQ,YAAY,IAAI,UAAU;AAAA,IACxC,MAAM;AAAA,IACN,SAAS;AAAA,MACP,WAAW,EAAE,MAAM,SAAS;AAAA,IAC9B;AAAA,IACA,kBAAkB;AAAA,EACpB,CAAC;AAED,QAAM,aAAa,YAAY,CAAC;AAChC,QAAM,WAAW,YAAY,CAAC;AAC9B,MAAI,CAAC,cAAc,CAAC,UAAU;AAC5B,WAAO,KAAK,sEAAsE;AAAA,EACpF;AACA,QAAM,cAAc,OAAO;AAC3B,MAAI,CAAC,eAAe,YAAY,KAAK,MAAM,IAAI;AAC7C,WAAO,KAAK,kCAAkC;AAAA,EAChD;AAEA,QAAM,QAAQ,MAAM,UAAU,EAAE,YAAY,UAAU,YAAY,CAAC;AACnE,MAAI,MAAM,WAAW,UAAa,MAAM,WAAW,IAAI;AACrD,YAAQ,OAAO,MAAM,MAAM,OAAO,SAAS,IAAI,IAAI,MAAM,SAAS,GAAG,MAAM,MAAM;AAAA,CAAI;AAAA,EACvF;AACA,MAAI,MAAM,WAAW,UAAa,MAAM,WAAW,IAAI;AACrD,YAAQ,OAAO,MAAM,MAAM,OAAO,SAAS,IAAI,IAAI,MAAM,SAAS,GAAG,MAAM,MAAM;AAAA,CAAI;AAAA,EACvF;AACA,UAAQ,KAAK,MAAM,QAAQ;AAC7B;","names":[]}
@@ -0,0 +1,276 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ resolveEnvRefsDeep
4
+ } from "./chunk-DBQMX75U.js";
5
+ import {
6
+ BaseAdapter
7
+ } from "./chunk-CPLK7GTE.js";
8
+ import "./chunk-7L6ITC4T.js";
9
+ import {
10
+ buildServeWrapperCommand,
11
+ shouldWrapForTelemetry
12
+ } from "./chunk-I5MLE6S7.js";
13
+ import "./chunk-N6HH7K6P.js";
14
+ import "./chunk-TRQKHP7D.js";
15
+
16
+ // src/adapters/amazon-q/index.ts
17
+ import { existsSync, statSync } from "fs";
18
+ import { homedir } from "os";
19
+ import { join } from "path";
20
+ var HOST = "amazon-q";
21
+ var MCP_ROOT_KEY = "mcpServers";
22
+ var AmazonQAdapter = class extends BaseAdapter {
23
+ id = HOST;
24
+ name = "Amazon Q Developer CLI";
25
+ paradigm = "mcp-only";
26
+ capabilities = {
27
+ // Memory surface: WIRED. Amazon Q reads `.amazonq/rules` (NOT AGENTS.md), so
28
+ // the AGENTS.md-first BaseAdapter default does not apply — memoryTargets()
29
+ // below overrides it to write a DEDICATED agent-connector-owned file
30
+ // (<projectDir>/.amazonq/rules/agent-connector.md, plain Markdown, no
31
+ // frontmatter — auto-applied as context per the AWS docs). Project scope
32
+ // only; user scope skip-warns (no verified user/global rules dir).
33
+ supportsMemory: true,
34
+ //
35
+ // Amazon Q CLI: the hooks layer lives inside per-agent JSON files, not in
36
+ // the global/workspace mcp.json that AC targets. Every hook flag is false
37
+ // for this mcp-only adapter (hooks not wired into AC install yet).
38
+ preToolUse: false,
39
+ postToolUse: false,
40
+ preCompact: false,
41
+ sessionStart: false,
42
+ sessionEnd: false,
43
+ userPromptSubmit: false,
44
+ stop: false,
45
+ notification: false,
46
+ // No hook layer wired → no arg/output rewrite, no context injection.
47
+ canModifyArgs: false,
48
+ canModifyOutput: false,
49
+ canInjectSessionContext: false,
50
+ // Amazon Q registers stdio + Streamable HTTP MCP servers (primary-verified).
51
+ transports: ["stdio", "http"]
52
+ // Content surfaces: Amazon Q DOES have user-authored surfaces — agents
53
+ // (per-agent JSON in ~/.aws/amazonq/cli-agents/*.json or project
54
+ // .amazonq/cli-agents/*.json: name/description/prompt/tools/hooks/resources;
55
+ // agent-format.md) and a prompt library (~/.aws/amazonq/prompts/*.md). AC does
56
+ // not render either yet, so the supports* flags stay UNSET (base skip-warns) —
57
+ // a deferred wiring opportunity, NOT an absent surface.
58
+ };
59
+ // ── Detection ────────────────────────────────────────────────────────────
60
+ detectInstalled(projectDir) {
61
+ const userDir = join(homedir(), ".aws", "amazonq");
62
+ const userMcp = join(userDir, "mcp.json");
63
+ const projDir = join(projectDir, ".amazonq");
64
+ const projMcp = join(projDir, "mcp.json");
65
+ const userInstalled = existsSync(userDir) || existsSync(userMcp);
66
+ const projInstalled = existsSync(projDir) || existsSync(projMcp);
67
+ const installed = userInstalled || projInstalled;
68
+ const scope = projInstalled && !userInstalled ? "project" : "user";
69
+ const configPath = scope === "project" ? projMcp : userMcp;
70
+ return {
71
+ id: this.id,
72
+ name: this.name,
73
+ installed,
74
+ paradigm: this.paradigm,
75
+ capabilities: this.capabilities,
76
+ configPath,
77
+ scope,
78
+ reason: installed ? `found Amazon Q config (${scope}) at ${configPath}` : `no Amazon Q mcp.json at ${userDir} or ${projDir}`,
79
+ confidence: installed ? "high" : "low"
80
+ };
81
+ }
82
+ // ── Native paths ─────────────────────────────────────────────────────────
83
+ /**
84
+ * Config directory per scope. Amazon Q uses DIFFERENT basenames:
85
+ * user: ~/.aws/amazonq (two segments — NOT a single dotDir)
86
+ * project: <projectDir>/.amazonq
87
+ * This is the ONE deviation from droid/cursor's single-basename getConfigDir.
88
+ */
89
+ getConfigDir(ctx) {
90
+ return ctx.scope === "project" ? join(ctx.projectDir, ".amazonq") : join(homedir(), ".aws", "amazonq");
91
+ }
92
+ getServerConfigPath(ctx) {
93
+ return join(this.getConfigDir(ctx), "mcp.json");
94
+ }
95
+ /**
96
+ * Amazon Q has no separate hook file — hook config path aliases the MCP file
97
+ * so the generic doctor/backup helpers behave sensibly (roo-code idiom).
98
+ */
99
+ getHookConfigPath(ctx) {
100
+ return this.getServerConfigPath(ctx);
101
+ }
102
+ // ── Memory surface: the `.amazonq/rules` content tree ─────────────────────
103
+ // Amazon Q uses `.amazonq/rules` (NOT AGENTS.md) for its OWN project rules, so
104
+ // this override replaces the AGENTS.md base default entirely:
105
+ // project → <projectDir>/.amazonq/rules/agent-connector.md (DEDICATED file
106
+ // AC owns; plain Markdown, auto-applied — no frontmatter needed)
107
+ // user → [] (no verified user/global rules dir → base installMemory
108
+ // skip-warns rather than guessing a path the CLI may not read)
109
+ // When `.amazonq/rules` exists as a single FILE (not a directory) we must NOT
110
+ // create `.amazonq/rules/agent-connector.md` underneath it (that would throw
111
+ // ENOTDIR), so memoryTargets() returns [] and installMemory() emits a precise
112
+ // skip-warn rather than crashing (the cline `.clinerules`-is-a-file precedent).
113
+ memoryTargets(ctx) {
114
+ if (this.memoryOverride(ctx)?.path) return super.memoryTargets(ctx);
115
+ if (ctx.scope === "project") {
116
+ if (this.rulesDirIsFile(ctx.projectDir)) return [];
117
+ return [
118
+ {
119
+ path: join(ctx.projectDir, ".amazonq", "rules", "agent-connector.md"),
120
+ reason: "amazon-q project rules dir (.amazonq/rules; agent-connector-owned file)"
121
+ }
122
+ ];
123
+ }
124
+ return [];
125
+ }
126
+ /**
127
+ * Override installMemory ONLY to surface a precise warn when `.amazonq/rules`
128
+ * exists as a single FILE at project scope (so memoryTargets() returned []):
129
+ * we never write under it. All other behavior delegates to the base
130
+ * implementation (the cline `.clinerules`-is-a-file precedent).
131
+ */
132
+ installMemory(ctx) {
133
+ if (ctx.scope === "project" && !this.memoryOverride(ctx)?.path && (ctx.connector.memory ?? []).length > 0 && ctx.connector.platforms[this.id]?.memory !== false && this.rulesDirIsFile(ctx.projectDir)) {
134
+ return [
135
+ {
136
+ platform: this.id,
137
+ action: "warn",
138
+ path: join(ctx.projectDir, ".amazonq", "rules"),
139
+ detail: "existing .amazonq/rules is a file, not a directory; left untouched \u2014 convert it to a .amazonq/rules/ directory to receive agent-connector memory"
140
+ }
141
+ ];
142
+ }
143
+ return super.installMemory(ctx);
144
+ }
145
+ /** True when `<dir>/.amazonq/rules` exists and is a regular FILE (not a dir). */
146
+ rulesDirIsFile(dir) {
147
+ const p = join(dir, ".amazonq", "rules");
148
+ if (!existsSync(p)) return false;
149
+ try {
150
+ return statSync(p).isFile();
151
+ } catch {
152
+ return false;
153
+ }
154
+ }
155
+ // ── MCP server install / uninstall ───────────────────────────────────────
156
+ installServer(ctx) {
157
+ const { connector } = ctx;
158
+ const override = connector.platforms[HOST]?.server;
159
+ if (!connector.server || override === false) {
160
+ return [
161
+ {
162
+ platform: this.id,
163
+ action: "skip",
164
+ detail: connector.server ? "server registration disabled for amazon-q" : "connector declares no MCP server"
165
+ }
166
+ ];
167
+ }
168
+ const server = override && typeof override === "object" ? { ...connector.server, ...override } : connector.server;
169
+ const serverPath = this.getServerConfigPath(ctx);
170
+ const entry = this.renderServerEntry(ctx, server);
171
+ return [
172
+ this.upsertServerInJson(serverPath, MCP_ROOT_KEY, connector.id, entry, ctx.dryRun)
173
+ ];
174
+ }
175
+ uninstallServer(ctx) {
176
+ const serverPath = this.getServerConfigPath(ctx);
177
+ return [
178
+ this.removeServerFromJson(serverPath, MCP_ROOT_KEY, ctx.connector.id, ctx.dryRun)
179
+ ];
180
+ }
181
+ /** Render a normalized ServerDef into Amazon Q's native mcpServers entry. */
182
+ renderServerEntry(ctx, server) {
183
+ const transport = server.transport;
184
+ if (transport === "stdio") {
185
+ let command = server.command ?? "";
186
+ let args = [...server.args ?? []];
187
+ if (shouldWrapForTelemetry(server, ctx.connector.telemetry)) {
188
+ const wrapped = buildServeWrapperCommand(
189
+ ctx.homeBinPath,
190
+ ctx.connector.id,
191
+ command,
192
+ args,
193
+ ctx.scope,
194
+ this.id
195
+ );
196
+ command = wrapped.command;
197
+ args = wrapped.args;
198
+ }
199
+ const entry = {
200
+ command: resolveEnvRefsDeep(command)
201
+ };
202
+ if (args.length > 0) entry.args = resolveEnvRefsDeep(args);
203
+ const env = this.renderEnv(server.env);
204
+ if (env) entry.env = env;
205
+ if (server.timeoutMs !== void 0) entry.timeout = server.timeoutMs;
206
+ return entry;
207
+ }
208
+ return {
209
+ type: "http",
210
+ url: resolveEnvRefsDeep(server.url ?? "")
211
+ };
212
+ }
213
+ /**
214
+ * Render stdio env values. Amazon Q has no documented native interpolation
215
+ * token, so resolve `${env:VAR}` references to literals at install time.
216
+ */
217
+ renderEnv(env) {
218
+ if (!env || Object.keys(env).length === 0) return void 0;
219
+ return resolveEnvRefsDeep({ ...env });
220
+ }
221
+ // ── Hooks (unavailable — Amazon Q CLI is mcp-only in this adapter) ────────
222
+ installHooks(_ctx) {
223
+ return [
224
+ {
225
+ platform: this.id,
226
+ action: "skip",
227
+ detail: "hooks unavailable (Amazon Q CLI is mcp-only)"
228
+ }
229
+ ];
230
+ }
231
+ uninstallHooks(_ctx) {
232
+ return [
233
+ {
234
+ platform: this.id,
235
+ action: "skip",
236
+ detail: "hooks unavailable (Amazon Q CLI is mcp-only)"
237
+ }
238
+ ];
239
+ }
240
+ // ── Diagnostics ──────────────────────────────────────────────────────────
241
+ getHealthChecks(ctx) {
242
+ const mcpPath = this.getServerConfigPath(ctx);
243
+ const connectorId = ctx.connector.id;
244
+ return [
245
+ {
246
+ name: `${this.name}: mcp.json present`,
247
+ check: () => existsSync(mcpPath) ? { status: "OK", detail: mcpPath } : { status: "FAIL", detail: `not found: ${mcpPath}` }
248
+ },
249
+ {
250
+ name: `${this.name}: server entry registered`,
251
+ check: () => {
252
+ if (!ctx.connector.server) {
253
+ return { status: "OK", detail: "no MCP server declared" };
254
+ }
255
+ const cfg = this.readJson(mcpPath);
256
+ const bucket = cfg?.[MCP_ROOT_KEY];
257
+ if (!cfg || !bucket) {
258
+ return { status: "FAIL", detail: `no ${MCP_ROOT_KEY} in ${mcpPath}` };
259
+ }
260
+ return connectorId in bucket ? { status: "OK", detail: `${MCP_ROOT_KEY}.${connectorId} present` } : {
261
+ status: "FAIL",
262
+ detail: `no ${MCP_ROOT_KEY}.${connectorId} in ${mcpPath}`
263
+ };
264
+ }
265
+ }
266
+ ];
267
+ }
268
+ };
269
+ var adapter = new AmazonQAdapter();
270
+ var amazon_q_default = adapter;
271
+ export {
272
+ AmazonQAdapter,
273
+ adapter,
274
+ amazon_q_default as default
275
+ };
276
+ //# sourceMappingURL=amazon-q-COAL3764.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/adapters/amazon-q/index.ts"],"sourcesContent":["/**\n * adapters/amazon-q — Amazon Q Developer CLI platform adapter.\n *\n * Amazon Q Developer CLI (`q` / `qchat`) is an **mcp-only** host from\n * agent-connector's perspective. Although the agent JSON format exposes a\n * real hooks layer (agentSpawn / userPromptSubmit / preToolUse / postToolUse,\n * JSON-over-STDIN, exit-code 0/2 contract — primary-verified via\n * aws.github.io/amazon-q-developer-cli agent-format + hooks.md), the VERIFIED\n * CONTRACT classifies this adapter as mcp-only because the hook layer lives\n * inside per-agent JSON files (cli-agents/*.json), not in the global/workspace\n * mcp.json that AC targets for MCP registration. We install MCP entries only;\n * hook registration into agent files is a separate, unimplemented surface.\n *\n * MCP config (legacy files, primary-verified via AWS docs):\n * - user scope → ~/.aws/amazonq/mcp.json (global; applies to all workspaces)\n * - project scope → <projectDir>/.amazonq/mcp.json (local workspace)\n * Both are JSON, root key \"mcpServers\". Amazon Q reads BOTH when both exist\n * and merges them (union); workspace wins on same-name conflict with a warning.\n *\n * Server entry shape (primary-verified):\n * - stdio: { command: string; args?: string[]; env?: { [k: string]: string };\n * timeout?: number } (timeout in MILLISECONDS, e.g. 60000;\n * transport inferred from presence of `command` — no `type` key)\n * - http: { type: \"http\"; url: string }\n * (the remote/HTTP shape is written with an explicit `type: \"http\"`\n * discriminator + `url`, per command-line-mcp-config-CLI.html. No\n * `headers` field — Amazon Q remote auth is OAuth, not static\n * headers — and no `disabled` flag.)\n *\n * Path resolution — NOTE the nested user scope:\n * - user: join(homedir(), \".aws\", \"amazonq\") (two path segments)\n * - project: join(projectDir, \".amazonq\") (single dotDir, no .aws)\n * homedir() handles USERPROFILE on Windows automatically; no manual branch.\n *\n * Env interpolation: Amazon Q has no documented native ${env:VAR} token;\n * resolve all references to literals at install time (the safe path, same as\n * droid/crush).\n *\n * Memory / rules (primary-verified — docs.aws.amazon.com context-project-rules):\n * Project rules are plain Markdown files in <projectDir>/.amazonq/rules; Amazon\n * Q \"will automatically use them as context whenever a developer chats with\n * Amazon Q within your project\". NO frontmatter required. We write a DEDICATED\n * agent-connector-owned file there (`.amazonq/rules/agent-connector.md`),\n * mirroring the cline `.clinerules/agent-connector.md` approach: memoryTargets()\n * points at the dedicated file and the base managed-block engine performs the\n * surgical, hash-stamped, uninstall-reversible write. PROJECT SCOPE ONLY — the\n * AWS docs do not cleanly document a user/global rules directory for the CLI\n * (a `~/.aws/amazonq/.../rules` path is unverified), so user scope returns [] →\n * the base installMemory skip-warns rather than writing into an unread path.\n *\n * Hook \"config path\" is aliased to the MCP file (no separate hook file) so the\n * base doctor/backup helpers behave sensibly.\n */\n\nimport { existsSync, statSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n\nimport { BaseAdapter } from \"../base.js\";\nimport type { Adapter, InstallContext, MemoryTarget } from \"../spi.js\";\nimport type {\n ChangeRecord,\n DetectedPlatform,\n HealthCheck,\n HookParadigm,\n PlatformCapabilities,\n PlatformId,\n ServerDef,\n Transport,\n} from \"../../core/types.js\";\nimport { resolveEnvRefsDeep } from \"../../core/interpolate.js\";\nimport {\n buildServeWrapperCommand,\n shouldWrapForTelemetry,\n} from \"../../core/spawn.js\";\n\nconst HOST: PlatformId = \"amazon-q\";\nconst MCP_ROOT_KEY = \"mcpServers\";\n\n/**\n * Native MCP server entry shapes Amazon Q accepts under `mcpServers`.\n * - stdio: BARE shape — NO `type` discriminator and NO `disabled` flag; the\n * transport is inferred from the presence of `command`. timeout is in\n * MILLISECONDS (pass timeoutMs through unchanged, do NOT divide).\n * - http: REMOTE shape — explicit `type: \"http\"` + `url`\n * (command-line-mcp-config-CLI.html). NO `headers` (remote auth is OAuth,\n * not static headers) and NO `disabled` flag.\n */\ninterface AmazonQStdioServer {\n command: string;\n args?: string[];\n env?: Record<string, string>;\n timeout?: number;\n}\ninterface AmazonQHttpServer {\n type: \"http\";\n url: string;\n}\n\nexport class AmazonQAdapter extends BaseAdapter implements Adapter {\n readonly id: PlatformId = HOST;\n readonly name = \"Amazon Q Developer CLI\";\n readonly paradigm: HookParadigm = \"mcp-only\";\n\n readonly capabilities: PlatformCapabilities = {\n // Memory surface: WIRED. Amazon Q reads `.amazonq/rules` (NOT AGENTS.md), so\n // the AGENTS.md-first BaseAdapter default does not apply — memoryTargets()\n // below overrides it to write a DEDICATED agent-connector-owned file\n // (<projectDir>/.amazonq/rules/agent-connector.md, plain Markdown, no\n // frontmatter — auto-applied as context per the AWS docs). Project scope\n // only; user scope skip-warns (no verified user/global rules dir).\n supportsMemory: true,\n //\n // Amazon Q CLI: the hooks layer lives inside per-agent JSON files, not in\n // the global/workspace mcp.json that AC targets. Every hook flag is false\n // for this mcp-only adapter (hooks not wired into AC install yet).\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 // No hook layer wired → no arg/output rewrite, no context injection.\n canModifyArgs: false,\n canModifyOutput: false,\n canInjectSessionContext: false,\n // Amazon Q registers stdio + Streamable HTTP MCP servers (primary-verified).\n transports: [\"stdio\", \"http\"],\n // Content surfaces: Amazon Q DOES have user-authored surfaces — agents\n // (per-agent JSON in ~/.aws/amazonq/cli-agents/*.json or project\n // .amazonq/cli-agents/*.json: name/description/prompt/tools/hooks/resources;\n // agent-format.md) and a prompt library (~/.aws/amazonq/prompts/*.md). AC does\n // not render either yet, so the supports* flags stay UNSET (base skip-warns) —\n // a deferred wiring opportunity, NOT an absent surface.\n };\n\n // ── Detection ────────────────────────────────────────────────────────────\n\n detectInstalled(projectDir: string): DetectedPlatform {\n const userDir = join(homedir(), \".aws\", \"amazonq\");\n const userMcp = join(userDir, \"mcp.json\");\n const projDir = join(projectDir, \".amazonq\");\n const projMcp = join(projDir, \"mcp.json\");\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 Amazon Q config (${scope}) at ${configPath}`\n : `no Amazon Q mcp.json at ${userDir} or ${projDir}`,\n confidence: installed ? \"high\" : \"low\",\n };\n }\n\n // ── Native paths ─────────────────────────────────────────────────────────\n\n /**\n * Config directory per scope. Amazon Q uses DIFFERENT basenames:\n * user: ~/.aws/amazonq (two segments — NOT a single dotDir)\n * project: <projectDir>/.amazonq\n * This is the ONE deviation from droid/cursor's single-basename getConfigDir.\n */\n getConfigDir(ctx: InstallContext): string {\n return ctx.scope === \"project\"\n ? join(ctx.projectDir, \".amazonq\")\n : join(homedir(), \".aws\", \"amazonq\");\n }\n\n getServerConfigPath(ctx: InstallContext): string {\n return join(this.getConfigDir(ctx), \"mcp.json\");\n }\n\n /**\n * Amazon Q has no separate hook file — hook config path aliases the MCP file\n * so the generic doctor/backup helpers behave sensibly (roo-code idiom).\n */\n getHookConfigPath(ctx: InstallContext): string {\n return this.getServerConfigPath(ctx);\n }\n\n // ── Memory surface: the `.amazonq/rules` content tree ─────────────────────\n // Amazon Q uses `.amazonq/rules` (NOT AGENTS.md) for its OWN project rules, so\n // this override replaces the AGENTS.md base default entirely:\n // project → <projectDir>/.amazonq/rules/agent-connector.md (DEDICATED file\n // AC owns; plain Markdown, auto-applied — no frontmatter needed)\n // user → [] (no verified user/global rules dir → base installMemory\n // skip-warns rather than guessing a path the CLI may not read)\n // When `.amazonq/rules` exists as a single FILE (not a directory) we must NOT\n // create `.amazonq/rules/agent-connector.md` underneath it (that would throw\n // ENOTDIR), so memoryTargets() returns [] and installMemory() emits a precise\n // skip-warn rather than crashing (the cline `.clinerules`-is-a-file precedent).\n protected override memoryTargets(ctx: InstallContext): MemoryTarget[] {\n // An explicit platforms[amazon-q].memory.path override wins (escape hatch).\n if (this.memoryOverride(ctx)?.path) return super.memoryTargets(ctx);\n if (ctx.scope === \"project\") {\n if (this.rulesDirIsFile(ctx.projectDir)) return [];\n return [\n {\n path: join(ctx.projectDir, \".amazonq\", \"rules\", \"agent-connector.md\"),\n reason: \"amazon-q project rules dir (.amazonq/rules; agent-connector-owned file)\",\n },\n ];\n }\n // user scope: no primary-verified user/global rules dir → [] → skip-warn.\n return [];\n }\n\n /**\n * Override installMemory ONLY to surface a precise warn when `.amazonq/rules`\n * exists as a single FILE at project scope (so memoryTargets() returned []):\n * we never write under it. All other behavior delegates to the base\n * implementation (the cline `.clinerules`-is-a-file precedent).\n */\n override installMemory(ctx: InstallContext): ChangeRecord[] {\n if (\n ctx.scope === \"project\" &&\n !this.memoryOverride(ctx)?.path &&\n (ctx.connector.memory ?? []).length > 0 &&\n ctx.connector.platforms[this.id]?.memory !== false &&\n this.rulesDirIsFile(ctx.projectDir)\n ) {\n return [\n {\n platform: this.id,\n action: \"warn\",\n path: join(ctx.projectDir, \".amazonq\", \"rules\"),\n detail:\n \"existing .amazonq/rules is a file, not a directory; left untouched — \" +\n \"convert it to a .amazonq/rules/ directory to receive agent-connector memory\",\n },\n ];\n }\n return super.installMemory(ctx);\n }\n\n /** True when `<dir>/.amazonq/rules` exists and is a regular FILE (not a dir). */\n private rulesDirIsFile(dir: string): boolean {\n const p = join(dir, \".amazonq\", \"rules\");\n if (!existsSync(p)) return false;\n try {\n return statSync(p).isFile();\n } catch {\n return false;\n }\n }\n\n // ── MCP server install / uninstall ───────────────────────────────────────\n\n installServer(ctx: InstallContext): ChangeRecord[] {\n const { connector } = 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 amazon-q\"\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 serverPath = this.getServerConfigPath(ctx);\n const entry = this.renderServerEntry(ctx, server);\n\n return [\n this.upsertServerInJson(serverPath, MCP_ROOT_KEY, connector.id, entry, ctx.dryRun),\n ];\n }\n\n uninstallServer(ctx: InstallContext): ChangeRecord[] {\n const serverPath = this.getServerConfigPath(ctx);\n return [\n this.removeServerFromJson(serverPath, MCP_ROOT_KEY, ctx.connector.id, ctx.dryRun),\n ];\n }\n\n /** Render a normalized ServerDef into Amazon Q's native mcpServers entry. */\n private renderServerEntry(\n ctx: InstallContext,\n server: ServerDef,\n ): AmazonQStdioServer | AmazonQHttpServer {\n const transport: Transport = server.transport;\n\n if (transport === \"stdio\") {\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 // Amazon Q has no documented native interpolation token — resolve every\n // ${env:VAR} to a literal at install time (safe path, matches droid/crush).\n const entry: AmazonQStdioServer = {\n command: resolveEnvRefsDeep(command),\n };\n if (args.length > 0) entry.args = resolveEnvRefsDeep(args);\n const env = this.renderEnv(server.env);\n if (env) entry.env = env;\n // timeout: Amazon Q uses MILLISECONDS — pass timeoutMs through unchanged.\n // Only emit when the connector explicitly sets one (do NOT invent a default).\n if (server.timeoutMs !== undefined) entry.timeout = server.timeoutMs;\n return entry;\n }\n\n // http (and any other remote transport) — Amazon Q registers a remote URL.\n // REMOTE shape: { type: \"http\", url } — explicit `type` discriminator, NO\n // `headers` (OAuth auth, not static headers), NO `disabled`.\n return {\n type: \"http\",\n url: resolveEnvRefsDeep(server.url ?? \"\"),\n };\n }\n\n /**\n * Render stdio env values. Amazon Q has no documented native interpolation\n * token, so resolve `${env:VAR}` references to literals at install time.\n */\n private renderEnv(\n env: Record<string, string> | undefined,\n ): Record<string, string> | undefined {\n if (!env || Object.keys(env).length === 0) return undefined;\n return resolveEnvRefsDeep({ ...env });\n }\n\n // ── Hooks (unavailable — Amazon Q CLI is mcp-only in this adapter) ────────\n\n installHooks(_ctx: InstallContext): ChangeRecord[] {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail: \"hooks unavailable (Amazon Q CLI 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 (Amazon Q CLI is mcp-only)\",\n },\n ];\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.json 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 if (!ctx.connector.server) {\n return { status: \"OK\", detail: \"no MCP server declared\" };\n }\n const cfg = this.readJson<{ [k: string]: Record<string, unknown> }>(mcpPath);\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 AmazonQAdapter();\nexport default adapter;\n"],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