@ken-jo/agent-connector 0.4.8 → 0.4.43

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 (240) hide show
  1. package/README.md +36 -24
  2. package/dist/{action-RWPRIZIC.js → action-ZUHMOGLV.js} +12 -12
  3. package/dist/amazon-q-UFLBUSHG.js +570 -0
  4. package/dist/amazon-q-UFLBUSHG.js.map +1 -0
  5. package/dist/{amp-PU4LFSY6.js → amp-5DJK7VAL.js} +5 -7
  6. package/dist/{amp-PU4LFSY6.js.map → amp-5DJK7VAL.js.map} +1 -1
  7. package/dist/{amp-TULUPXXL.js → amp-BQZOL5GR.js} +2 -2
  8. package/dist/{antigravity-STHZWMP3.js → antigravity-EA4L225L.js} +2 -2
  9. package/dist/{antigravity-DWW35HZO.js → antigravity-NWP2TUG6.js} +5 -6
  10. package/dist/{antigravity-cli-P6HADOAO.js → antigravity-cli-B2HXZFYQ.js} +2 -2
  11. package/dist/{antigravity-cli-VTQ6DNWL.js → antigravity-cli-KPNLE7X4.js} +5 -6
  12. package/dist/{antigravity-cli-VTQ6DNWL.js.map → antigravity-cli-KPNLE7X4.js.map} +1 -1
  13. package/dist/{chunk-NLFPH4S2.js → chunk-2RPHDVHW.js} +2 -2
  14. package/dist/{chunk-CENEXP7K.js → chunk-3Q6YEDCG.js} +11 -6
  15. package/dist/chunk-3Q6YEDCG.js.map +1 -0
  16. package/dist/{chunk-A2T4Q7RM.js → chunk-3ZZK4KXG.js} +18 -18
  17. package/dist/{chunk-YYISBXOM.js → chunk-4CBHYWUG.js} +9 -8
  18. package/dist/{chunk-YYISBXOM.js.map → chunk-4CBHYWUG.js.map} +1 -1
  19. package/dist/{chunk-HOE2MN36.js → chunk-54B5HAVT.js} +4 -4
  20. package/dist/{chunk-XQUUNAGC.js → chunk-5HSLICR3.js} +36 -36
  21. package/dist/{chunk-CDVOBKSG.js → chunk-5TMIJ7AY.js} +26 -5
  22. package/dist/chunk-5TMIJ7AY.js.map +1 -0
  23. package/dist/{chunk-KG6T3YNJ.js → chunk-A767JFHW.js} +87 -7
  24. package/dist/chunk-A767JFHW.js.map +1 -0
  25. package/dist/{chunk-MOW2RKHX.js → chunk-AQ53TOH4.js} +8 -4
  26. package/dist/chunk-AQ53TOH4.js.map +1 -0
  27. package/dist/{chunk-YS2NYJ6R.js → chunk-ERV4TKRV.js} +3 -5
  28. package/dist/{chunk-YS2NYJ6R.js.map → chunk-ERV4TKRV.js.map} +1 -1
  29. package/dist/{chunk-BCHWFTV4.js → chunk-F4DSMVZ7.js} +2 -2
  30. package/dist/{chunk-OZ5EXXQV.js → chunk-H3BATOBP.js} +2 -2
  31. package/dist/{chunk-SCVBYSF7.js → chunk-IRUYJD23.js} +28 -28
  32. package/dist/{chunk-FAHIMJRU.js → chunk-L7ESV37V.js} +2 -2
  33. package/dist/{chunk-JNM3TPLX.js → chunk-LETB5HCK.js} +2 -2
  34. package/dist/{chunk-7TVBFRVI.js → chunk-M3H7PQWT.js} +2 -2
  35. package/dist/{chunk-JWNT5KW7.js → chunk-O7SDRBVB.js} +3 -1
  36. package/dist/chunk-O7SDRBVB.js.map +1 -0
  37. package/dist/{chunk-TRQKHP7D.js → chunk-QY42WGBX.js} +23 -2
  38. package/dist/chunk-QY42WGBX.js.map +1 -0
  39. package/dist/{chunk-VRKTVCYJ.js → chunk-RAJBLK2V.js} +33 -43
  40. package/dist/chunk-RAJBLK2V.js.map +1 -0
  41. package/dist/{chunk-WI6YSXOC.js → chunk-VDSXVNEH.js} +51 -28
  42. package/dist/chunk-VDSXVNEH.js.map +1 -0
  43. package/dist/{cursor-GJBSMXI6.js → chunk-XW46WVR2.js} +11 -12
  44. package/dist/chunk-XW46WVR2.js.map +1 -0
  45. package/dist/{chunk-NYR55UT7.js → chunk-YG3KFOOQ.js} +2 -2
  46. package/dist/{chunk-N6HH7K6P.js → chunk-ZY25RG4Y.js} +2 -2
  47. package/dist/{claude-code-W74MNTAC.js → claude-code-NMRKTAP7.js} +2 -2
  48. package/dist/{claude-code-64X6RR2S.js → claude-code-YNNKQCCR.js} +9 -11
  49. package/dist/{claude-code-64X6RR2S.js.map → claude-code-YNNKQCCR.js.map} +1 -1
  50. package/dist/cli/sdk.js +7 -7
  51. package/dist/cli.js +1 -1
  52. package/dist/{cline-T7ZDJYZQ.js → cline-AGFJF4AC.js} +5 -7
  53. package/dist/{cline-T7ZDJYZQ.js.map → cline-AGFJF4AC.js.map} +1 -1
  54. package/dist/{codebuff-3PMZJJHP.js → codebuff-ETYT5UBL.js} +2 -2
  55. package/dist/{codebuff-PPPY3SJV.js → codebuff-YUQ4PN7G.js} +5 -7
  56. package/dist/{codebuff-PPPY3SJV.js.map → codebuff-YUQ4PN7G.js.map} +1 -1
  57. package/dist/{codex-EEVN43C2.js → codex-FLU37DV3.js} +28 -13
  58. package/dist/codex-FLU37DV3.js.map +1 -0
  59. package/dist/{codex-Q3ATRRX3.js → codex-YAORPCOD.js} +2 -2
  60. package/dist/{continue-VLLZO4PM.js → continue-ZMI4YN75.js} +5 -6
  61. package/dist/{continue-VLLZO4PM.js.map → continue-ZMI4YN75.js.map} +1 -1
  62. package/dist/{copilot-cli-SJGIXVSD.js → copilot-cli-MZTAWMPW.js} +2 -2
  63. package/dist/{copilot-cli-A7G5WB4N.js → copilot-cli-XPRJ5MQB.js} +31 -7
  64. package/dist/copilot-cli-XPRJ5MQB.js.map +1 -0
  65. package/dist/{crush-AH24GDDB.js → crush-3OB5ZTCC.js} +13 -12
  66. package/dist/crush-3OB5ZTCC.js.map +1 -0
  67. package/dist/{crush-LN5QFFR2.js → crush-QBXLNN7T.js} +2 -2
  68. package/dist/{cursor-QZ6MTO74.js → cursor-DIW43TRZ.js} +2 -2
  69. package/dist/cursor-F4HYO2FP.js +22 -0
  70. package/dist/{detect-YDCZNV4W.js → detect-FXGBSNQU.js} +4 -4
  71. package/dist/{doctor-DGC7P3P7.js → doctor-2O65SAPG.js} +17 -14
  72. package/dist/{doctor-DGC7P3P7.js.map → doctor-2O65SAPG.js.map} +1 -1
  73. package/dist/{droid-RBWCFKL3.js → droid-NZCKYKOV.js} +5 -7
  74. package/dist/{droid-RBWCFKL3.js.map → droid-NZCKYKOV.js.map} +1 -1
  75. package/dist/{droid-W5WF5XEX.js → droid-U3ZBLQFO.js} +2 -2
  76. package/dist/{gemini-cli-CFPFEJEA.js → gemini-cli-3ZGCXUDD.js} +5 -7
  77. package/dist/{gemini-cli-CFPFEJEA.js.map → gemini-cli-3ZGCXUDD.js.map} +1 -1
  78. package/dist/{gemini-cli-CIRW37TU.js → gemini-cli-NMVVBO3K.js} +2 -2
  79. package/dist/{goose-A3M5GODH.js → goose-64V46Y2W.js} +2 -2
  80. package/dist/{goose-UBJVQFUE.js → goose-MGGNVXJP.js} +59 -12
  81. package/dist/goose-MGGNVXJP.js.map +1 -0
  82. package/dist/{hermes-ZYLMOFLZ.js → hermes-F3EGTK6N.js} +2 -2
  83. package/dist/{hermes-6FXGXLNL.js → hermes-L3CBJ37L.js} +11 -9
  84. package/dist/hermes-L3CBJ37L.js.map +1 -0
  85. package/dist/{hook-CDGSCASQ.js → hook-D3PY6TDK.js} +12 -12
  86. package/dist/index.d.ts +2 -2
  87. package/dist/index.js +5 -5
  88. package/dist/{install-2D3UKEME.js → install-SVBIK4VJ.js} +17 -14
  89. package/dist/{install-2D3UKEME.js.map → install-SVBIK4VJ.js.map} +1 -1
  90. package/dist/{introspect-Cn3MSA4_.d.ts → introspect-B164-hj3.d.ts} +1 -1
  91. package/dist/{jetbrains-copilot-K26KMA3U.js → jetbrains-copilot-M2LHJBAW.js} +5 -7
  92. package/dist/{jetbrains-copilot-K26KMA3U.js.map → jetbrains-copilot-M2LHJBAW.js.map} +1 -1
  93. package/dist/{kilo-BKZJ26RM.js → kilo-RMRP2EL7.js} +5 -7
  94. package/dist/{kilo-BKZJ26RM.js.map → kilo-RMRP2EL7.js.map} +1 -1
  95. package/dist/{kilo-NSWAVP6P.js → kilo-SW7BH6EG.js} +2 -2
  96. package/dist/{kilo-cli-6UVWCXQD.js → kilo-cli-6ITBNHTH.js} +16 -12
  97. package/dist/kilo-cli-6ITBNHTH.js.map +1 -0
  98. package/dist/{kilo-cli-EVBKUODA.js → kilo-cli-ZF272ZHN.js} +2 -2
  99. package/dist/{kimi-EI3UM3ZV.js → kimi-5FHEXGZD.js} +72 -13
  100. package/dist/kimi-5FHEXGZD.js.map +1 -0
  101. package/dist/{kimi-QALYPSRR.js → kimi-I35VOOY4.js} +69 -32
  102. package/dist/kimi-I35VOOY4.js.map +1 -0
  103. package/dist/{kiro-J5J42I5Z.js → kiro-2K5UJVGC.js} +13 -18
  104. package/dist/kiro-2K5UJVGC.js.map +1 -0
  105. package/dist/{kiro-UCLSLBW2.js → kiro-WGOI5CGT.js} +2 -2
  106. package/dist/{leaderboard-VZQXNWTX.js → leaderboard-ZMZST52G.js} +6 -6
  107. package/dist/{mimo-code-BEE622P2.js → mimo-code-K7AMX2QW.js} +38 -9
  108. package/dist/mimo-code-K7AMX2QW.js.map +1 -0
  109. package/dist/{mux-5HTNKK4K.js → mux-GT7FWVLH.js} +5 -7
  110. package/dist/{mux-5HTNKK4K.js.map → mux-GT7FWVLH.js.map} +1 -1
  111. package/dist/{mux-ZMLVAXOO.js → mux-XM6AP35L.js} +2 -2
  112. package/dist/{nemoclaw-DNFIZFDF.js → nemoclaw-GQMS6CUM.js} +5 -6
  113. package/dist/{nemoclaw-DNFIZFDF.js.map → nemoclaw-GQMS6CUM.js.map} +1 -1
  114. package/dist/{omp-I3UTRBNP.js → omp-2RPYIZUF.js} +4 -5
  115. package/dist/{omp-I3UTRBNP.js.map → omp-2RPYIZUF.js.map} +1 -1
  116. package/dist/{openclaw-IYA7ASL6.js → openclaw-5EQFGOWL.js} +2 -2
  117. package/dist/{openclaw-QE2LMWIF.js → openclaw-P5GMEEGC.js} +5 -6
  118. package/dist/openclaw-P5GMEEGC.js.map +1 -0
  119. package/dist/{opencode-ZFSUYJXI.js → opencode-5D2SK3EX.js} +5 -7
  120. package/dist/{opencode-ZFSUYJXI.js.map → opencode-5D2SK3EX.js.map} +1 -1
  121. package/dist/{opencode-HWT3RSMN.js → opencode-QGP4ALQY.js} +2 -2
  122. package/dist/{package-BSCCMW4E.js → package-EDYQF6C6.js} +13 -10
  123. package/dist/{package-BSCCMW4E.js.map → package-EDYQF6C6.js.map} +1 -1
  124. package/dist/{pi-UFX2OYFV.js → pi-GGDQREVG.js} +2 -2
  125. package/dist/{pi-H2KBBDDJ.js → pi-ZMM4KJTO.js} +4 -5
  126. package/dist/{pi-H2KBBDDJ.js.map → pi-ZMM4KJTO.js.map} +1 -1
  127. package/dist/{qwen-code-5LE34FNE.js → qwen-code-4ZLVGN2C.js} +12 -14
  128. package/dist/qwen-code-4ZLVGN2C.js.map +1 -0
  129. package/dist/{qwen-code-W7NUCDEN.js → qwen-code-GQILBJ5B.js} +2 -2
  130. package/dist/{roo-code-XH4GCYIS.js → roo-code-67QGLQRM.js} +6 -7
  131. package/dist/roo-code-67QGLQRM.js.map +1 -0
  132. package/dist/{roo-code-ZLKH4A7N.js → roo-code-SUWI4BBN.js} +2 -2
  133. package/dist/runtime/index.d.ts +1 -1
  134. package/dist/runtime/index.js +10 -10
  135. package/dist/sdk/index.d.ts +3 -3
  136. package/dist/sdk/index.js +6 -6
  137. package/dist/sdk/test.d.ts +2 -2
  138. package/dist/sdk/test.js +9 -9
  139. package/dist/{serve-MQNGPY2H.js → serve-427CCEYA.js} +12 -12
  140. package/dist/{status-MRHVRDFY.js → status-6IHRW6PI.js} +10 -10
  141. package/dist/{statusline-IYWA75TR.js → statusline-2CKH5RHO.js} +11 -11
  142. package/dist/{synthetic-UKR6SMGS.js → synthetic-6FRA7P5Q.js} +2 -2
  143. package/dist/{telemetry-IONIOMLC.js → telemetry-WNVKL7HW.js} +10 -10
  144. package/dist/{trae-PA26DPBW.js → trae-CPPYASR2.js} +2 -2
  145. package/dist/{trae-RVNRSV7X.js → trae-TMJPHWZ5.js} +5 -7
  146. package/dist/{trae-RVNRSV7X.js.map → trae-TMJPHWZ5.js.map} +1 -1
  147. package/dist/{types-_6arHbX9.d.ts → types-COSBYpKs.d.ts} +7 -5
  148. package/dist/{uninstall-ESLSVCLE.js → uninstall-QFCDXGKR.js} +17 -14
  149. package/dist/{uninstall-ESLSVCLE.js.map → uninstall-QFCDXGKR.js.map} +1 -1
  150. package/dist/{upgrade-VICY5T64.js → upgrade-PP46DURC.js} +17 -14
  151. package/dist/{upgrade-VICY5T64.js.map → upgrade-PP46DURC.js.map} +1 -1
  152. package/dist/{usage-TCUWV2YZ.js → usage-VDORZJPT.js} +3 -3
  153. package/dist/{usage-event-CBZZP37Q.js → usage-event-4533OURF.js} +11 -11
  154. package/dist/{vscode-copilot-B2QBBHJW.js → vscode-copilot-H7JKUKLZ.js} +21 -10
  155. package/dist/vscode-copilot-H7JKUKLZ.js.map +1 -0
  156. package/dist/{warp-JNQA7PBU.js → warp-NRBBJQR2.js} +2 -2
  157. package/dist/{warp-5R54ST3N.js → warp-SVDVKQQI.js} +5 -7
  158. package/dist/{warp-5R54ST3N.js.map → warp-SVDVKQQI.js.map} +1 -1
  159. package/dist/{windsurf-L32UEOLY.js → windsurf-H36YKOMR.js} +5 -7
  160. package/dist/{windsurf-L32UEOLY.js.map → windsurf-H36YKOMR.js.map} +1 -1
  161. package/dist/{zed-FDJHJZKD.js → zed-LHWJALLZ.js} +5 -7
  162. package/dist/{zed-FDJHJZKD.js.map → zed-LHWJALLZ.js.map} +1 -1
  163. package/dist/{zed-NNNX5MNT.js → zed-XJFOOKCO.js} +2 -2
  164. package/package.json +7 -2
  165. package/dist/amazon-q-5LJOB5L3.js +0 -264
  166. package/dist/amazon-q-5LJOB5L3.js.map +0 -1
  167. package/dist/chunk-CDVOBKSG.js.map +0 -1
  168. package/dist/chunk-CENEXP7K.js.map +0 -1
  169. package/dist/chunk-IEGR4TP3.js +0 -70
  170. package/dist/chunk-IEGR4TP3.js.map +0 -1
  171. package/dist/chunk-JWNT5KW7.js.map +0 -1
  172. package/dist/chunk-KG6T3YNJ.js.map +0 -1
  173. package/dist/chunk-MOW2RKHX.js.map +0 -1
  174. package/dist/chunk-TRQKHP7D.js.map +0 -1
  175. package/dist/chunk-VRKTVCYJ.js.map +0 -1
  176. package/dist/chunk-WI6YSXOC.js.map +0 -1
  177. package/dist/codex-EEVN43C2.js.map +0 -1
  178. package/dist/copilot-cli-A7G5WB4N.js.map +0 -1
  179. package/dist/crush-AH24GDDB.js.map +0 -1
  180. package/dist/cursor-GJBSMXI6.js.map +0 -1
  181. package/dist/goose-UBJVQFUE.js.map +0 -1
  182. package/dist/hermes-6FXGXLNL.js.map +0 -1
  183. package/dist/kilo-cli-6UVWCXQD.js.map +0 -1
  184. package/dist/kimi-EI3UM3ZV.js.map +0 -1
  185. package/dist/kimi-QALYPSRR.js.map +0 -1
  186. package/dist/kiro-J5J42I5Z.js.map +0 -1
  187. package/dist/mimo-code-BEE622P2.js.map +0 -1
  188. package/dist/qwen-code-5LE34FNE.js.map +0 -1
  189. package/dist/roo-code-XH4GCYIS.js.map +0 -1
  190. package/dist/vscode-copilot-B2QBBHJW.js.map +0 -1
  191. /package/dist/{action-RWPRIZIC.js.map → action-ZUHMOGLV.js.map} +0 -0
  192. /package/dist/{amp-TULUPXXL.js.map → amp-BQZOL5GR.js.map} +0 -0
  193. /package/dist/{antigravity-STHZWMP3.js.map → antigravity-EA4L225L.js.map} +0 -0
  194. /package/dist/{antigravity-DWW35HZO.js.map → antigravity-NWP2TUG6.js.map} +0 -0
  195. /package/dist/{antigravity-cli-P6HADOAO.js.map → antigravity-cli-B2HXZFYQ.js.map} +0 -0
  196. /package/dist/{chunk-NLFPH4S2.js.map → chunk-2RPHDVHW.js.map} +0 -0
  197. /package/dist/{chunk-A2T4Q7RM.js.map → chunk-3ZZK4KXG.js.map} +0 -0
  198. /package/dist/{chunk-HOE2MN36.js.map → chunk-54B5HAVT.js.map} +0 -0
  199. /package/dist/{chunk-XQUUNAGC.js.map → chunk-5HSLICR3.js.map} +0 -0
  200. /package/dist/{chunk-BCHWFTV4.js.map → chunk-F4DSMVZ7.js.map} +0 -0
  201. /package/dist/{chunk-OZ5EXXQV.js.map → chunk-H3BATOBP.js.map} +0 -0
  202. /package/dist/{chunk-SCVBYSF7.js.map → chunk-IRUYJD23.js.map} +0 -0
  203. /package/dist/{chunk-FAHIMJRU.js.map → chunk-L7ESV37V.js.map} +0 -0
  204. /package/dist/{chunk-JNM3TPLX.js.map → chunk-LETB5HCK.js.map} +0 -0
  205. /package/dist/{chunk-7TVBFRVI.js.map → chunk-M3H7PQWT.js.map} +0 -0
  206. /package/dist/{chunk-NYR55UT7.js.map → chunk-YG3KFOOQ.js.map} +0 -0
  207. /package/dist/{chunk-N6HH7K6P.js.map → chunk-ZY25RG4Y.js.map} +0 -0
  208. /package/dist/{claude-code-W74MNTAC.js.map → claude-code-NMRKTAP7.js.map} +0 -0
  209. /package/dist/{codebuff-3PMZJJHP.js.map → codebuff-ETYT5UBL.js.map} +0 -0
  210. /package/dist/{codex-Q3ATRRX3.js.map → codex-YAORPCOD.js.map} +0 -0
  211. /package/dist/{copilot-cli-SJGIXVSD.js.map → copilot-cli-MZTAWMPW.js.map} +0 -0
  212. /package/dist/{crush-LN5QFFR2.js.map → crush-QBXLNN7T.js.map} +0 -0
  213. /package/dist/{cursor-QZ6MTO74.js.map → cursor-DIW43TRZ.js.map} +0 -0
  214. /package/dist/{openclaw-QE2LMWIF.js.map → cursor-F4HYO2FP.js.map} +0 -0
  215. /package/dist/{detect-YDCZNV4W.js.map → detect-FXGBSNQU.js.map} +0 -0
  216. /package/dist/{droid-W5WF5XEX.js.map → droid-U3ZBLQFO.js.map} +0 -0
  217. /package/dist/{gemini-cli-CIRW37TU.js.map → gemini-cli-NMVVBO3K.js.map} +0 -0
  218. /package/dist/{goose-A3M5GODH.js.map → goose-64V46Y2W.js.map} +0 -0
  219. /package/dist/{hermes-ZYLMOFLZ.js.map → hermes-F3EGTK6N.js.map} +0 -0
  220. /package/dist/{hook-CDGSCASQ.js.map → hook-D3PY6TDK.js.map} +0 -0
  221. /package/dist/{kilo-NSWAVP6P.js.map → kilo-SW7BH6EG.js.map} +0 -0
  222. /package/dist/{kilo-cli-EVBKUODA.js.map → kilo-cli-ZF272ZHN.js.map} +0 -0
  223. /package/dist/{kiro-UCLSLBW2.js.map → kiro-WGOI5CGT.js.map} +0 -0
  224. /package/dist/{leaderboard-VZQXNWTX.js.map → leaderboard-ZMZST52G.js.map} +0 -0
  225. /package/dist/{mux-ZMLVAXOO.js.map → mux-XM6AP35L.js.map} +0 -0
  226. /package/dist/{openclaw-IYA7ASL6.js.map → openclaw-5EQFGOWL.js.map} +0 -0
  227. /package/dist/{opencode-HWT3RSMN.js.map → opencode-QGP4ALQY.js.map} +0 -0
  228. /package/dist/{pi-UFX2OYFV.js.map → pi-GGDQREVG.js.map} +0 -0
  229. /package/dist/{qwen-code-W7NUCDEN.js.map → qwen-code-GQILBJ5B.js.map} +0 -0
  230. /package/dist/{roo-code-ZLKH4A7N.js.map → roo-code-SUWI4BBN.js.map} +0 -0
  231. /package/dist/{serve-MQNGPY2H.js.map → serve-427CCEYA.js.map} +0 -0
  232. /package/dist/{status-MRHVRDFY.js.map → status-6IHRW6PI.js.map} +0 -0
  233. /package/dist/{statusline-IYWA75TR.js.map → statusline-2CKH5RHO.js.map} +0 -0
  234. /package/dist/{synthetic-UKR6SMGS.js.map → synthetic-6FRA7P5Q.js.map} +0 -0
  235. /package/dist/{telemetry-IONIOMLC.js.map → telemetry-WNVKL7HW.js.map} +0 -0
  236. /package/dist/{trae-PA26DPBW.js.map → trae-CPPYASR2.js.map} +0 -0
  237. /package/dist/{usage-TCUWV2YZ.js.map → usage-VDORZJPT.js.map} +0 -0
  238. /package/dist/{usage-event-CBZZP37Q.js.map → usage-event-4533OURF.js.map} +0 -0
  239. /package/dist/{warp-JNQA7PBU.js.map → warp-NRBBJQR2.js.map} +0 -0
  240. /package/dist/{zed-NNNX5MNT.js.map → zed-XJFOOKCO.js.map} +0 -0
@@ -0,0 +1,570 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ normalizeSessionSource
4
+ } from "./chunk-H53QZQJI.js";
5
+ import {
6
+ resolveEnvRefsDeep
7
+ } from "./chunk-DBQMX75U.js";
8
+ import {
9
+ BaseAdapter
10
+ } from "./chunk-A767JFHW.js";
11
+ import {
12
+ buildWrappedStdio,
13
+ isHomeBinHookCommand
14
+ } from "./chunk-TO57WYBB.js";
15
+ import "./chunk-ZY25RG4Y.js";
16
+ import "./chunk-QY42WGBX.js";
17
+
18
+ // src/adapters/amazon-q/index.ts
19
+ import { existsSync, statSync } from "fs";
20
+ import { homedir } from "os";
21
+ import { join } from "path";
22
+ var HOST = "amazon-q";
23
+ var MCP_ROOT_KEY = "mcpServers";
24
+ var DEFAULT_AGENT_FILE = "q_cli_default.json";
25
+ var RESERVED_AGENT_NAME = "q_cli_default";
26
+ var Q_TRIGGER = {
27
+ preToolUse: "preToolUse",
28
+ postToolUse: "postToolUse",
29
+ agentSpawn: "agentSpawn",
30
+ userPromptSubmit: "userPromptSubmit",
31
+ stop: "stop"
32
+ };
33
+ var EVENT_MAP = {
34
+ SessionStart: Q_TRIGGER.agentSpawn,
35
+ UserPromptSubmit: Q_TRIGGER.userPromptSubmit,
36
+ PreToolUse: Q_TRIGGER.preToolUse,
37
+ PostToolUse: Q_TRIGGER.postToolUse,
38
+ Stop: Q_TRIGGER.stop
39
+ };
40
+ var MATCHER_TRIGGERS = /* @__PURE__ */ new Set([
41
+ Q_TRIGGER.preToolUse,
42
+ Q_TRIGGER.postToolUse
43
+ ]);
44
+ var CONTEXT_TRIGGERS = /* @__PURE__ */ new Set([
45
+ Q_TRIGGER.agentSpawn,
46
+ Q_TRIGGER.userPromptSubmit
47
+ ]);
48
+ var AmazonQAdapter = class extends BaseAdapter {
49
+ id = HOST;
50
+ name = "Amazon Q Developer CLI";
51
+ paradigm = "json-stdio";
52
+ capabilities = {
53
+ // Memory surface: WIRED. Amazon Q reads `.amazonq/rules` (NOT AGENTS.md), so
54
+ // the AGENTS.md-first BaseAdapter default does not apply — memoryTargets()
55
+ // below overrides it to write a DEDICATED agent-connector-owned file
56
+ // (<projectDir>/.amazonq/rules/agent-connector.md, plain Markdown, no
57
+ // frontmatter — auto-applied as context per the AWS docs). Project scope
58
+ // only; user scope skip-warns (no verified user/global rules dir).
59
+ supportsMemory: true,
60
+ //
61
+ // Hooks: Amazon Q fires agentSpawn / userPromptSubmit / preToolUse /
62
+ // postToolUse / stop (mapped from SessionStart / UserPromptSubmit /
63
+ // PreToolUse / PostToolUse / Stop). It has no PreCompact / SessionEnd /
64
+ // Notification equivalent, nor the E1 extension events (PermissionRequest /
65
+ // PostToolUseFailure / SubagentStart / SubagentStop) — those warn-skip.
66
+ preToolUse: true,
67
+ postToolUse: true,
68
+ preCompact: false,
69
+ sessionStart: true,
70
+ sessionEnd: false,
71
+ userPromptSubmit: true,
72
+ stop: true,
73
+ notification: false,
74
+ // Exit-code protocol only — a hook can allow (0) or block (2), but it CANNOT
75
+ // rewrite tool args or output.
76
+ canModifyArgs: false,
77
+ canModifyOutput: false,
78
+ // agentSpawn / userPromptSubmit add a hook's plain STDOUT to the agent's
79
+ // context (no JSON envelope) — primary-verified via docs/hooks.md.
80
+ canInjectSessionContext: true,
81
+ // Amazon Q registers stdio + Streamable HTTP MCP servers (primary-verified).
82
+ transports: ["stdio", "http"],
83
+ // Content surfaces:
84
+ // subagents: WIRED. Amazon Q's "agents" are per-agent JSON files where the
85
+ // FILENAME (minus .json) IS the agent name (primary-verified via the CLI
86
+ // repo docs/agent-file-locations.md + docs/agent-format.md). AC maps each
87
+ // connector SubagentDef → cli-agents/<name>.json = { name, description,
88
+ // prompt } (+ model when non-"inherit"; + tools/allowedTools when the
89
+ // SubagentDef carries a tool policy — see renderSubagent). Both scopes:
90
+ // user → ~/.aws/amazonq/cli-agents/<name>.json
91
+ // project → <projectDir>/.amazonq/cli-agents/<name>.json
92
+ // A subagent named `q_cli_default` would resolve to the hooks/default-agent
93
+ // file — the SDK already rejects it (non-kebab name), and installSubagents
94
+ // refuses it as defense-in-depth so a subagent write can never clobber it.
95
+ supportsSubagents: true
96
+ // commands (prompt library): DEFERRED — format unverified. The only primary
97
+ // doc for the ~/.aws/amazonq/prompts/*.md prompt library is the IDE prompt-
98
+ // library page (q-in-IDE-chat → ide-chat-context: prompts saved in
99
+ // ~/.aws/amazonq/prompts, invoked via @<name> inside the IDE chat). The Q
100
+ // CLI repo (aws/amazon-q-developer-cli/docs) ships NO prompts/saved-prompts
101
+ // doc, so whether the `q`/`qchat` CLI reads that folder — and whether a
102
+ // project-scoped prompts dir exists — is NOT primary-verified for the CLI
103
+ // host this adapter targets. supportsCommands stays UNSET (base skip-warns)
104
+ // rather than render an unverified surface (the continue per-server-YAML /
105
+ // other deferred-unverified precedent).
106
+ };
107
+ // ── Detection ────────────────────────────────────────────────────────────
108
+ detectInstalled(projectDir) {
109
+ const userDir = join(homedir(), ".aws", "amazonq");
110
+ const userMcp = join(userDir, "mcp.json");
111
+ const projDir = join(projectDir, ".amazonq");
112
+ const projMcp = join(projDir, "mcp.json");
113
+ const userInstalled = existsSync(userDir) || existsSync(userMcp);
114
+ const projInstalled = existsSync(projDir) || existsSync(projMcp);
115
+ const installed = userInstalled || projInstalled;
116
+ const scope = projInstalled && !userInstalled ? "project" : "user";
117
+ const configPath = scope === "project" ? projMcp : userMcp;
118
+ return {
119
+ id: this.id,
120
+ name: this.name,
121
+ installed,
122
+ paradigm: this.paradigm,
123
+ capabilities: this.capabilities,
124
+ configPath,
125
+ scope,
126
+ reason: installed ? `found Amazon Q config (${scope}) at ${configPath}` : `no Amazon Q mcp.json at ${userDir} or ${projDir}`,
127
+ confidence: installed ? "high" : "low"
128
+ };
129
+ }
130
+ // ── Native paths ─────────────────────────────────────────────────────────
131
+ /**
132
+ * Config directory per scope. Amazon Q uses DIFFERENT basenames:
133
+ * user: ~/.aws/amazonq (two segments — NOT a single dotDir)
134
+ * project: <projectDir>/.amazonq
135
+ * This is the ONE deviation from droid/cursor's single-basename getConfigDir.
136
+ */
137
+ getConfigDir(ctx) {
138
+ return ctx.scope === "project" ? join(ctx.projectDir, ".amazonq") : join(homedir(), ".aws", "amazonq");
139
+ }
140
+ getServerConfigPath(ctx) {
141
+ return join(this.getConfigDir(ctx), "mcp.json");
142
+ }
143
+ /**
144
+ * Hooks live in a per-agent file, NOT the mcp.json. Amazon Q hooks have no
145
+ * global file, so AC targets the built-in `q_cli_default` agent file at the
146
+ * install scope (mirroring kiro's default-agent selection):
147
+ * user → ~/.aws/amazonq/cli-agents/q_cli_default.json
148
+ * project → <projectDir>/.amazonq/cli-agents/q_cli_default.json
149
+ * A project install writes a project-scoped `q_cli_default` that SHADOWS the
150
+ * user-global one (a local `q_cli_default` takes precedence and auto-loads).
151
+ */
152
+ getHookConfigPath(ctx) {
153
+ return join(this.getConfigDir(ctx), "cli-agents", DEFAULT_AGENT_FILE);
154
+ }
155
+ // ── Memory surface: the `.amazonq/rules` content tree ─────────────────────
156
+ // Amazon Q uses `.amazonq/rules` (NOT AGENTS.md) for its OWN project rules, so
157
+ // this override replaces the AGENTS.md base default entirely:
158
+ // project → <projectDir>/.amazonq/rules/agent-connector.md (DEDICATED file
159
+ // AC owns; plain Markdown, auto-applied — no frontmatter needed)
160
+ // user → [] (no verified user/global rules dir → base installMemory
161
+ // skip-warns rather than guessing a path the CLI may not read)
162
+ // When `.amazonq/rules` exists as a single FILE (not a directory) we must NOT
163
+ // create `.amazonq/rules/agent-connector.md` underneath it (that would throw
164
+ // ENOTDIR), so memoryTargets() returns [] and installMemory() emits a precise
165
+ // skip-warn rather than crashing (the cline `.clinerules`-is-a-file precedent).
166
+ memoryTargets(ctx) {
167
+ if (this.memoryOverride(ctx)?.path) return super.memoryTargets(ctx);
168
+ if (ctx.scope === "project") {
169
+ if (this.rulesDirIsFile(ctx.projectDir)) return [];
170
+ return [
171
+ {
172
+ path: join(ctx.projectDir, ".amazonq", "rules", "agent-connector.md"),
173
+ reason: "amazon-q project rules dir (.amazonq/rules; agent-connector-owned file)"
174
+ }
175
+ ];
176
+ }
177
+ return [];
178
+ }
179
+ /**
180
+ * Override installMemory ONLY to surface a precise warn when `.amazonq/rules`
181
+ * exists as a single FILE at project scope (so memoryTargets() returned []):
182
+ * we never write under it. All other behavior delegates to the base
183
+ * implementation (the cline `.clinerules`-is-a-file precedent).
184
+ */
185
+ installMemory(ctx) {
186
+ if (ctx.scope === "project" && !this.memoryOverride(ctx)?.path && (ctx.connector.memory ?? []).length > 0 && ctx.connector.platforms[this.id]?.memory !== false && this.rulesDirIsFile(ctx.projectDir)) {
187
+ return [
188
+ {
189
+ platform: this.id,
190
+ action: "warn",
191
+ path: join(ctx.projectDir, ".amazonq", "rules"),
192
+ 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"
193
+ }
194
+ ];
195
+ }
196
+ return super.installMemory(ctx);
197
+ }
198
+ /** True when `<dir>/.amazonq/rules` exists and is a regular FILE (not a dir). */
199
+ rulesDirIsFile(dir) {
200
+ const p = join(dir, ".amazonq", "rules");
201
+ if (!existsSync(p)) return false;
202
+ try {
203
+ return statSync(p).isFile();
204
+ } catch {
205
+ return false;
206
+ }
207
+ }
208
+ // ── MCP server install / uninstall ───────────────────────────────────────
209
+ installServer(ctx) {
210
+ const { connector } = ctx;
211
+ const override = connector.platforms[HOST]?.server;
212
+ if (!connector.server || override === false) {
213
+ return [
214
+ {
215
+ platform: this.id,
216
+ action: "skip",
217
+ detail: connector.server ? "server registration disabled for amazon-q" : "connector declares no MCP server"
218
+ }
219
+ ];
220
+ }
221
+ const server = override && typeof override === "object" ? { ...connector.server, ...override } : connector.server;
222
+ const serverPath = this.getServerConfigPath(ctx);
223
+ const entry = this.renderServerEntry(ctx, server);
224
+ return [
225
+ this.upsertServerInJson(serverPath, MCP_ROOT_KEY, connector.id, entry, ctx.dryRun)
226
+ ];
227
+ }
228
+ uninstallServer(ctx) {
229
+ const serverPath = this.getServerConfigPath(ctx);
230
+ return [
231
+ this.removeServerFromJson(serverPath, MCP_ROOT_KEY, ctx.connector.id, ctx.dryRun)
232
+ ];
233
+ }
234
+ /** Render a normalized ServerDef into Amazon Q's native mcpServers entry. */
235
+ renderServerEntry(ctx, server) {
236
+ const transport = server.transport;
237
+ if (transport === "stdio") {
238
+ let command = server.command ?? "";
239
+ let args = [...server.args ?? []];
240
+ ({ command, args } = buildWrappedStdio(ctx, server, this.id, command, args));
241
+ const entry = {
242
+ command: resolveEnvRefsDeep(command)
243
+ };
244
+ if (args.length > 0) entry.args = resolveEnvRefsDeep(args);
245
+ const env = this.renderEnv(server.env);
246
+ if (env) entry.env = env;
247
+ if (server.timeoutMs !== void 0) entry.timeout = server.timeoutMs;
248
+ return entry;
249
+ }
250
+ return {
251
+ type: "http",
252
+ url: resolveEnvRefsDeep(server.url ?? "")
253
+ };
254
+ }
255
+ /**
256
+ * Render stdio env values. Amazon Q has no documented native interpolation
257
+ * token, so resolve `${env:VAR}` references to literals at install time.
258
+ */
259
+ renderEnv(env) {
260
+ if (!env || Object.keys(env).length === 0) return void 0;
261
+ return resolveEnvRefsDeep({ ...env });
262
+ }
263
+ // ── Hook install / uninstall (merge into the default agent file) ──────────
264
+ installHooks(ctx) {
265
+ const { connector } = ctx;
266
+ if (connector.platforms[HOST]?.hooks === false) {
267
+ return [{ platform: this.id, action: "skip", detail: "hooks disabled for amazon-q" }];
268
+ }
269
+ if (connector.hookEvents.length === 0) {
270
+ return [{ platform: this.id, action: "skip", detail: "connector declares no hooks" }];
271
+ }
272
+ const pending = connector.hookEvents.map((event) => ({
273
+ event,
274
+ matcher: connector.hooks[event]?.matcher ?? ""
275
+ }));
276
+ return this.upsertHookEntries(
277
+ ctx,
278
+ this.getHookConfigPath(ctx),
279
+ pending,
280
+ this.hookDescriptor()
281
+ );
282
+ }
283
+ uninstallHooks(ctx) {
284
+ return this.removeHookEntries(ctx, this.getHookConfigPath(ctx), this.hookDescriptor());
285
+ }
286
+ /**
287
+ * Amazon Q's hook-merge descriptor (FLAT object-of-arrays shape — each entry is
288
+ * `{ command, matcher? }`, NO `type` field, unlike kiro's nested
289
+ * `{ matcher, hooks:[...] }`).
290
+ * - mapEvent = EVENT_MAP (canonical → Amazon Q trigger); unmapped events
291
+ * (PreCompact / SessionEnd / Notification + the E1 set) warn-skip.
292
+ * - renderEntry emits `{ command }`, adding `matcher` ONLY for the
293
+ * matcher-meaningful triggers (preToolUse/postToolUse) when one is declared;
294
+ * an empty matcher = all tools, so it is OMITTED (no `matcher: ""` noise).
295
+ * - entryOwnsCommand / ownsEntryForRemove match the home-bin command string
296
+ * (idempotency on re-install; whole-entry removal on uninstall). FLAT host →
297
+ * no stripInner; an emptied trigger key is dropped by the engine.
298
+ */
299
+ hookDescriptor() {
300
+ return {
301
+ mapEvent: (e) => EVENT_MAP[e],
302
+ unmappedWarnDetail: (e) => `${e} has no Amazon Q hook equivalent \u2014 skipped`,
303
+ renderEntry: (trigger, matcher, command) => {
304
+ const entry = { command };
305
+ if (matcher && MATCHER_TRIGGERS.has(trigger)) entry.matcher = matcher;
306
+ return entry;
307
+ },
308
+ entryOwnsCommand: (entry, command) => entry.command === command,
309
+ ownsEntryForRemove: (c) => (entry) => this.isOurCommand(entry.command, c),
310
+ skipDetail: (trigger) => `hooks.${trigger} already registered`,
311
+ removeDetail: (trigger, removed) => `hooks.${trigger} (${removed})`,
312
+ absentDetail: "no hooks section present",
313
+ noMatchDetail: "no matching hook entries"
314
+ };
315
+ }
316
+ /** True when a hook command references our home binary AND this connector id
317
+ * (anchored so a shared-prefix id can't collide — see isHomeBinHookCommand). */
318
+ isOurCommand(command, ctx) {
319
+ return isHomeBinHookCommand(command, ctx.homeBinPath, ctx.connector.id);
320
+ }
321
+ // ── Content surface: subagents → cli-agents/<name>.json ───────────────────
322
+ // CONTENT-ONLY: a pure native-file writer — no runtime dispatch, no home-bin
323
+ // pointer, no telemetry wrap. Amazon Q "agents" are per-agent JSON files where
324
+ // the FILENAME (minus .json) IS the agent name (agent-file-locations.md). Each
325
+ // file is a STANDALONE agent definition: we write only { name, description,
326
+ // prompt } (+ model / tools / allowedTools when the SubagentDef carries them)
327
+ // and NEVER inject hooks (those live in q_cli_default.json) or mcpServers (those
328
+ // live in mcp.json). The whole file is AC-owned, so idempotency + reversibility
329
+ // come from writeContentFile/removeContentFile (byte-identical → skip; uninstall
330
+ // removes the file → NO_RESIDUE).
331
+ // user → ~/.aws/amazonq/cli-agents/<name>.json
332
+ // project → <projectDir>/.amazonq/cli-agents/<name>.json
333
+ /** Native subagent file path: <configDir>/cli-agents/<name>.json. */
334
+ subagentPath(ctx, name) {
335
+ return join(this.getConfigDir(ctx), "cli-agents", `${name}.json`);
336
+ }
337
+ installSubagents(ctx) {
338
+ const { connector } = ctx;
339
+ if (connector.platforms[HOST]?.subagents === false) {
340
+ return [{ platform: this.id, action: "skip", detail: "subagents disabled for amazon-q" }];
341
+ }
342
+ if (connector.subagents.length === 0) {
343
+ return [{ platform: this.id, action: "skip", detail: "connector declares no subagents" }];
344
+ }
345
+ return connector.subagents.map((agent) => {
346
+ if (agent.name === RESERVED_AGENT_NAME) {
347
+ return {
348
+ platform: this.id,
349
+ action: "warn",
350
+ detail: `subagent "${agent.name}" collides with the built-in default agent file (cli-agents/${DEFAULT_AGENT_FILE}); skipped \u2014 rename the subagent`
351
+ };
352
+ }
353
+ return this.writeContentFile(
354
+ this.subagentPath(ctx, agent.name),
355
+ this.renderSubagent(agent),
356
+ ctx.dryRun
357
+ );
358
+ });
359
+ }
360
+ uninstallSubagents(ctx) {
361
+ const { connector } = ctx;
362
+ if (connector.subagents.length === 0) {
363
+ return [{ platform: this.id, action: "skip", detail: "connector declares no subagents" }];
364
+ }
365
+ return connector.subagents.map((agent) => {
366
+ if (agent.name === RESERVED_AGENT_NAME) {
367
+ return {
368
+ platform: this.id,
369
+ action: "warn",
370
+ detail: `subagent "${agent.name}" was never installed (collides with cli-agents/${DEFAULT_AGENT_FILE}); left untouched`
371
+ };
372
+ }
373
+ return this.removeContentFile(this.subagentPath(ctx, agent.name), ctx.dryRun);
374
+ });
375
+ }
376
+ /**
377
+ * Render a connector subagent into an Amazon Q agent JSON file
378
+ * (agent-format.md):
379
+ * { name, description, prompt } — prompt is the INLINE system-prompt string
380
+ * (Amazon Q's `prompt` field is "high-level context … similar to a system
381
+ * prompt"; we use the inline-text form, NOT a file:// ref).
382
+ * Plus, when the SubagentDef carries them:
383
+ * - model: only when set and not the platform-agnostic "inherit"
384
+ * sentinel (Amazon Q has no "inherit" — omitting it applies the default).
385
+ * - tools: SurfaceToolPolicy.allow → the `tools` array (the tools the
386
+ * agent can use). Amazon Q's `tools` accepts plain tool-name strings and
387
+ * `*`, the same vocabulary the portable allow-list carries.
388
+ * - allowedTools: SurfaceToolPolicy.allow → the `allowedTools` array (tools
389
+ * usable WITHOUT a permission prompt) — BUT only when the allow-list holds
390
+ * no `*` (Amazon Q's allowedTools does NOT accept the `"*"` wildcard;
391
+ * agent-format.md "AllowedTools Field"). When allow is exactly ["*"] we set
392
+ * `tools` but omit `allowedTools` (every tool available, none auto-allowed).
393
+ * `deny` has no clean Amazon Q analog (there is no disallowedTools field —
394
+ * access is an allow-list), so a deny-only policy maps to no tool keys.
395
+ * `readonly` is likewise dropped — Amazon Q has no read-only-agent field; the
396
+ * permission model IS the allowedTools allow-list (no separate analog).
397
+ * `extra` is shallow-merged last (per-platform escape hatch).
398
+ */
399
+ renderSubagent(agent) {
400
+ const obj = {
401
+ name: agent.name,
402
+ description: agent.description,
403
+ prompt: agent.prompt
404
+ };
405
+ if (agent.model !== void 0 && agent.model !== "inherit") obj.model = agent.model;
406
+ const allow = agent.tools?.allow;
407
+ if (allow && allow.length > 0) {
408
+ obj.tools = [...allow];
409
+ const allowed = allow.filter((t) => t !== "*");
410
+ if (allowed.length > 0) obj.allowedTools = allowed;
411
+ }
412
+ if (agent.extra) Object.assign(obj, agent.extra);
413
+ return `${JSON.stringify(obj, null, 2)}
414
+ `;
415
+ }
416
+ // ── Diagnostics ──────────────────────────────────────────────────────────
417
+ getHealthChecks(ctx) {
418
+ const mcpPath = this.getServerConfigPath(ctx);
419
+ const agentPath = this.getHookConfigPath(ctx);
420
+ const connectorId = ctx.connector.id;
421
+ const homeBin = ctx.homeBinPath;
422
+ const hookEvents = ctx.connector.hookEvents;
423
+ const checks = [
424
+ {
425
+ name: `${this.name}: mcp.json present`,
426
+ check: () => existsSync(mcpPath) ? { status: "OK", detail: mcpPath } : { status: "FAIL", detail: `not found: ${mcpPath}` }
427
+ },
428
+ {
429
+ name: `${this.name}: server entry registered`,
430
+ check: () => {
431
+ if (!ctx.connector.server) {
432
+ return { status: "OK", detail: "no MCP server declared" };
433
+ }
434
+ const cfg = this.readJson(mcpPath);
435
+ const bucket = cfg?.[MCP_ROOT_KEY];
436
+ if (!cfg || !bucket) {
437
+ return { status: "FAIL", detail: `no ${MCP_ROOT_KEY} in ${mcpPath}` };
438
+ }
439
+ return connectorId in bucket ? { status: "OK", detail: `${MCP_ROOT_KEY}.${connectorId} present` } : {
440
+ status: "FAIL",
441
+ detail: `no ${MCP_ROOT_KEY}.${connectorId} in ${mcpPath}`
442
+ };
443
+ }
444
+ },
445
+ {
446
+ name: `${this.name}: hook command registered`,
447
+ check: () => {
448
+ if (hookEvents.length === 0) {
449
+ return { status: "OK", detail: "no hooks declared" };
450
+ }
451
+ const agent = this.readJson(agentPath);
452
+ if (!agent) return { status: "FAIL", detail: `cannot read ${agentPath}` };
453
+ const hooks = agent.hooks ?? {};
454
+ const registered = Object.values(hooks).some(
455
+ (entries) => (entries ?? []).some((e) => isHomeBinHookCommand(e.command, homeBin, connectorId))
456
+ );
457
+ return registered ? { status: "OK", detail: "hook command present" } : { status: "FAIL", detail: `no hook for ${connectorId} in ${agentPath}` };
458
+ }
459
+ }
460
+ ];
461
+ for (const agent of ctx.connector.subagents) {
462
+ if (agent.name === RESERVED_AGENT_NAME) continue;
463
+ const p = this.subagentPath(ctx, agent.name);
464
+ checks.push({
465
+ name: `${this.name}: subagent ${agent.name} present`,
466
+ check: () => existsSync(p) ? { status: "OK", detail: p } : { status: "FAIL", detail: `not found: ${p}` }
467
+ });
468
+ }
469
+ return checks;
470
+ }
471
+ // ── Runtime: parse Amazon Q stdin JSON → normalized event ─────────────────
472
+ // Amazon Q's stdin payload shape and exit-code contract are IDENTICAL to kiro's
473
+ // (both AWS hosts in the same hook family); this parse + the formatReply context
474
+ // channel below follow Amazon Q's own primary-verified schema (docs/hooks.md):
475
+ // exit-code reply + PLAIN STDOUT context, gated to agentSpawn / userPromptSubmit.
476
+ parseEvent(event, raw) {
477
+ const input = raw ?? {};
478
+ const connectorId = typeof input.connector === "string" ? input.connector : "";
479
+ const sessionId = typeof input.session_id === "string" ? input.session_id : "";
480
+ const projectDir = typeof input.cwd === "string" ? input.cwd : void 0;
481
+ const base = {
482
+ hostPlatform: HOST,
483
+ connectorId,
484
+ sessionId,
485
+ raw,
486
+ ...projectDir !== void 0 ? { projectDir } : {}
487
+ };
488
+ switch (event) {
489
+ case "PreToolUse": {
490
+ const ev = {
491
+ ...base,
492
+ toolName: input.tool_name ?? "",
493
+ toolInput: input.tool_input ?? {}
494
+ };
495
+ return ev;
496
+ }
497
+ case "PostToolUse": {
498
+ const ev = {
499
+ ...base,
500
+ toolName: input.tool_name ?? "",
501
+ toolInput: input.tool_input ?? {},
502
+ ...toolResponseToString(input.tool_response) !== void 0 ? { toolOutput: toolResponseToString(input.tool_response) } : {}
503
+ };
504
+ return ev;
505
+ }
506
+ case "SessionStart": {
507
+ const ev = {
508
+ ...base,
509
+ source: normalizeSessionSource(input.source)
510
+ };
511
+ return ev;
512
+ }
513
+ case "UserPromptSubmit": {
514
+ const ev = {
515
+ ...base,
516
+ prompt: typeof input.prompt === "string" ? input.prompt : ""
517
+ };
518
+ return ev;
519
+ }
520
+ case "Stop": {
521
+ const ev = {
522
+ ...base,
523
+ ...typeof input.stop_hook_active === "boolean" ? { stopHookActive: input.stop_hook_active } : {}
524
+ };
525
+ return ev;
526
+ }
527
+ default: {
528
+ throw new Error(`unsupported amazon-q hook event: ${String(event)}`);
529
+ }
530
+ }
531
+ }
532
+ // ── Runtime: normalized response → Amazon Q native (exit-code) hook reply ──
533
+ formatReply(event, response) {
534
+ const decision = response.decision ?? "allow";
535
+ if (decision === "deny") {
536
+ return { exitCode: 2, stderr: response.reason ?? "Blocked by hook" };
537
+ }
538
+ if (decision === "ask") {
539
+ return {
540
+ exitCode: 2,
541
+ stderr: response.reason ?? "Action requires user confirmation (security policy)"
542
+ };
543
+ }
544
+ if (event === "Stop") {
545
+ return { exitCode: 0 };
546
+ }
547
+ const trigger = EVENT_MAP[event];
548
+ if (decision === "context" && response.additionalContext && trigger !== void 0 && CONTEXT_TRIGGERS.has(trigger)) {
549
+ return { exitCode: 0, stdout: response.additionalContext };
550
+ }
551
+ return { exitCode: 0 };
552
+ }
553
+ };
554
+ function toolResponseToString(value) {
555
+ if (value == null) return void 0;
556
+ if (typeof value === "string") return value;
557
+ try {
558
+ return JSON.stringify(value);
559
+ } catch {
560
+ return String(value);
561
+ }
562
+ }
563
+ var adapter = new AmazonQAdapter();
564
+ var amazon_q_default = adapter;
565
+ export {
566
+ AmazonQAdapter,
567
+ adapter,
568
+ amazon_q_default as default
569
+ };
570
+ //# sourceMappingURL=amazon-q-UFLBUSHG.js.map