@ken-jo/agent-connector 0.5.0 → 0.6.1

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 (236) hide show
  1. package/README.md +9 -6
  2. package/dist/{action-LEYTHNIU.js → action-BCD2GOJA.js} +8 -8
  3. package/dist/{amazon-q-7DPVJXJN.js → amazon-q-KCNHU3BI.js} +2 -2
  4. package/dist/{amp-VYXZWHXW.js → amp-HI6CGN36.js} +2 -2
  5. package/dist/{amp-BQZOL5GR.js → amp-NDP2J4K3.js} +2 -2
  6. package/dist/{antigravity-EA4L225L.js → antigravity-FY5553OR.js} +2 -2
  7. package/dist/{antigravity-VXHL6ZPM.js → antigravity-I2L4WSJN.js} +3 -3
  8. package/dist/{antigravity-cli-B2HXZFYQ.js → antigravity-cli-IUAE3SEX.js} +2 -2
  9. package/dist/{antigravity-cli-JHQ7JGNX.js → antigravity-cli-T24Y54NG.js} +3 -3
  10. package/dist/{audit-HPKCUCES.js → audit-F47H2PLT.js} +5 -5
  11. package/dist/{chunk-O7SDRBVB.js → chunk-6ZZQXEL7.js} +2 -1
  12. package/dist/{chunk-O7SDRBVB.js.map → chunk-6ZZQXEL7.js.map} +1 -1
  13. package/dist/{chunk-IRUYJD23.js → chunk-AN7QCLT7.js} +27 -33
  14. package/dist/chunk-AN7QCLT7.js.map +1 -0
  15. package/dist/{chunk-BXPSDNIB.js → chunk-BD72ZF6D.js} +2 -2
  16. package/dist/{chunk-M6OS4OLU.js → chunk-BGPVMJOG.js} +2 -2
  17. package/dist/{chunk-2Y2MZRLP.js → chunk-CWUPIT72.js} +2 -2
  18. package/dist/{chunk-FKW5A6HE.js → chunk-HUL5CRF2.js} +4 -4
  19. package/dist/{chunk-SFY6YLVK.js → chunk-K67UJSJI.js} +5 -6
  20. package/dist/{chunk-SFY6YLVK.js.map → chunk-K67UJSJI.js.map} +1 -1
  21. package/dist/{chunk-UM5S7DKK.js → chunk-KOFCNA5T.js} +11 -2
  22. package/dist/{chunk-UM5S7DKK.js.map → chunk-KOFCNA5T.js.map} +1 -1
  23. package/dist/{chunk-WZMSSIDN.js → chunk-LO6NIZSL.js} +14 -6
  24. package/dist/chunk-LO6NIZSL.js.map +1 -0
  25. package/dist/{chunk-6WN37NVN.js → chunk-O7CFTOM5.js} +2 -2
  26. package/dist/{chunk-4KIXXJ7B.js → chunk-OXANBA4I.js} +2 -2
  27. package/dist/{chunk-JTN3AKZO.js → chunk-PMOFA5BT.js} +12 -5
  28. package/dist/chunk-PMOFA5BT.js.map +1 -0
  29. package/dist/{chunk-G5HAIYRM.js → chunk-QG26JEJF.js} +66 -58
  30. package/dist/chunk-QG26JEJF.js.map +1 -0
  31. package/dist/{chunk-U2XJWG7N.js → chunk-STR3CRH3.js} +4 -4
  32. package/dist/{chunk-6XMV2OOA.js → chunk-W4GVN3TJ.js} +3 -3
  33. package/dist/{chunk-PWCBWAM4.js → chunk-W67GINTF.js} +2 -2
  34. package/dist/{chunk-XY3N2U6L.js → chunk-WAALPWR4.js} +2 -2
  35. package/dist/{chunk-4QXCNZMD.js → chunk-X2XEE4DO.js} +2 -2
  36. package/dist/{chunk-T5AI3AW3.js → chunk-ZHG7Q424.js} +19 -19
  37. package/dist/{claude-code-LJ6DVXWQ.js → claude-code-EIC4Q7OT.js} +5 -5
  38. package/dist/{claude-code-NMRKTAP7.js → claude-code-L4VXCHKA.js} +2 -2
  39. package/dist/cli/sdk.js +4 -4
  40. package/dist/cli.js +1 -1
  41. package/dist/{cline-JAPJNOZQ.js → cline-AJZ67XEE.js} +3 -3
  42. package/dist/cline-AJZ67XEE.js.map +1 -0
  43. package/dist/{codebuddy-GC7VAE2Y.js → codebuddy-EZZFEP35.js} +2 -2
  44. package/dist/{codebuff-ETYT5UBL.js → codebuff-GUNT2KBT.js} +2 -2
  45. package/dist/{codebuff-3VODFPD4.js → codebuff-HFI3MHNO.js} +12 -12
  46. package/dist/codebuff-HFI3MHNO.js.map +1 -0
  47. package/dist/{codex-RXIS5BHM.js → codex-C7ERS3TW.js} +3 -3
  48. package/dist/{codex-YAORPCOD.js → codex-H4MY6747.js} +2 -2
  49. package/dist/{continue-MECVDV4Z.js → continue-K2CWUNX5.js} +2 -2
  50. package/dist/{copilot-cli-MZTAWMPW.js → copilot-cli-FIQNEHFC.js} +2 -2
  51. package/dist/{copilot-cli-WVWAWNSM.js → copilot-cli-GCRZCLTV.js} +2 -2
  52. package/dist/{crush-QBXLNN7T.js → crush-HLM2DFW2.js} +2 -2
  53. package/dist/{crush-YB3SK6NK.js → crush-KFWUUVZ3.js} +3 -3
  54. package/dist/{cursor-RSLHA2CY.js → cursor-CKSMXWKG.js} +3 -3
  55. package/dist/{cursor-DIW43TRZ.js → cursor-Y3X7YK3S.js} +2 -2
  56. package/dist/{define-connector-odRHEC4H.d.ts → define-connector-iosc34CA.d.ts} +1 -1
  57. package/dist/{detect-USP5JMWM.js → detect-IX6U2FBV.js} +4 -4
  58. package/dist/{devin-WPDN3MXE.js → devin-VD6VCB4Y.js} +2 -2
  59. package/dist/{doctor-VSW5KHBM.js → doctor-DEZPJXGY.js} +15 -15
  60. package/dist/{droid-HS6MX3IL.js → droid-BNWFLMZU.js} +2 -2
  61. package/dist/{droid-U3ZBLQFO.js → droid-SNF6TQK2.js} +2 -2
  62. package/dist/{gemini-cli-NMVVBO3K.js → gemini-cli-2B6TS7KU.js} +2 -2
  63. package/dist/{gemini-cli-VJ6X5DNF.js → gemini-cli-RH63NCVC.js} +2 -2
  64. package/dist/{goose-3X7ID7YW.js → goose-G4JBHXLJ.js} +3 -3
  65. package/dist/{goose-64V46Y2W.js → goose-KDHNJE7Z.js} +2 -2
  66. package/dist/grok-build-FSN4TNLQ.js +682 -0
  67. package/dist/grok-build-FSN4TNLQ.js.map +1 -0
  68. package/dist/{grok-cli-4VFVF2CQ.js → grok-cli-TAIK7VEP.js} +5 -4
  69. package/dist/grok-cli-TAIK7VEP.js.map +1 -0
  70. package/dist/{hermes-AIVUE7LX.js → hermes-BOTDXP3F.js} +2 -2
  71. package/dist/{hermes-F3EGTK6N.js → hermes-MVCJAPSI.js} +2 -2
  72. package/dist/{hook-QRW3ON6C.js → hook-Q3MDXE56.js} +8 -8
  73. package/dist/index.d.ts +3 -3
  74. package/dist/index.js +2 -2
  75. package/dist/{install-ASTAUZKB.js → install-FD7XL3YC.js} +12 -12
  76. package/dist/{introspect-gTx6GzpW.d.ts → introspect-z3eKVWHN.d.ts} +1 -1
  77. package/dist/{jetbrains-copilot-XBO2JZRO.js → jetbrains-copilot-TMU324FM.js} +2 -2
  78. package/dist/{junie-UCOS6Q37.js → junie-RU564IK7.js} +2 -2
  79. package/dist/{kilo-SW7BH6EG.js → kilo-CHH3XI7H.js} +2 -2
  80. package/dist/kilo-CHH3XI7H.js.map +1 -0
  81. package/dist/{kilo-T4OXNUYY.js → kilo-P32GL6JM.js} +3 -3
  82. package/dist/{kilo-cli-ZF272ZHN.js → kilo-cli-L57AGENB.js} +2 -2
  83. package/dist/{kilo-cli-I2S3W245.js → kilo-cli-WBVPQNVP.js} +3 -3
  84. package/dist/{kimi-5FHEXGZD.js → kimi-BDW32HPV.js} +2 -2
  85. package/dist/{kimi-VLSUFLYV.js → kimi-GY2XXIJB.js} +2 -2
  86. package/dist/{kiro-AQFXGOJX.js → kiro-D73LXTUV.js} +2 -2
  87. package/dist/{kiro-WGOI5CGT.js → kiro-HZF4BADZ.js} +2 -2
  88. package/dist/{leaderboard-3XSVSGAJ.js → leaderboard-44GN3NBH.js} +3 -3
  89. package/dist/{mimo-code-KETL7W7D.js → mimo-code-F3BZAQZK.js} +2 -2
  90. package/dist/{mistral-vibe-3AU7N2CA.js → mistral-vibe-ETTSQPK5.js} +2 -2
  91. package/dist/{mux-XM6AP35L.js → mux-H4PNZRKG.js} +2 -2
  92. package/dist/mux-H4PNZRKG.js.map +1 -0
  93. package/dist/{mux-BO2L5CTW.js → mux-WKBVW6DA.js} +28 -22
  94. package/dist/mux-WKBVW6DA.js.map +1 -0
  95. package/dist/{nemoclaw-WA7RSKF2.js → nemoclaw-SGRSTG6V.js} +3 -3
  96. package/dist/{omp-UDYJ2PYY.js → omp-DBW2I6HC.js} +2 -2
  97. package/dist/{open-interpreter-WMBNM4MQ.js → open-interpreter-CXUCCZI3.js} +2 -2
  98. package/dist/{openclaw-3DHVHX5P.js → openclaw-CVCZR63Q.js} +3 -3
  99. package/dist/{openclaw-5EQFGOWL.js → openclaw-QC6ROV5Z.js} +2 -2
  100. package/dist/{opencode-IKMI3RI7.js → opencode-MSAR4Y42.js} +2 -2
  101. package/dist/{opencode-QGP4ALQY.js → opencode-USR7ONCJ.js} +2 -2
  102. package/dist/{openhands-QGXMQR6I.js → openhands-IWT4DWJC.js} +2 -2
  103. package/dist/{package-VWBPHCLA.js → package-3J7LLRIP.js} +8 -8
  104. package/dist/{pi-GGDQREVG.js → pi-34CVX5WX.js} +2 -2
  105. package/dist/{pi-A2HCGRJG.js → pi-5EPSCZ2G.js} +2 -2
  106. package/dist/{qwen-code-GQILBJ5B.js → qwen-code-42TRBZ47.js} +2 -2
  107. package/dist/{qwen-code-DNQTGJOF.js → qwen-code-JW5F5B5M.js} +2 -2
  108. package/dist/runtime/index.d.ts +1 -1
  109. package/dist/runtime/index.js +6 -6
  110. package/dist/sdk/index.d.ts +4 -4
  111. package/dist/sdk/index.js +3 -3
  112. package/dist/sdk/test.d.ts +2 -2
  113. package/dist/sdk/test.js +6 -6
  114. package/dist/{serve-IQGHE4SJ.js → serve-WCKL53H7.js} +8 -8
  115. package/dist/{status-BVLY6XDL.js → status-PMVGLWXM.js} +8 -8
  116. package/dist/{statusline-PRODZV2J.js → statusline-OKW44KFR.js} +7 -7
  117. package/dist/{synthetic-6FRA7P5Q.js → synthetic-YZ4FO7YR.js} +2 -2
  118. package/dist/{telemetry-UU4SHJ23.js → telemetry-7H2DLNON.js} +5 -5
  119. package/dist/{trae-CPPYASR2.js → trae-7PXIXNQO.js} +2 -2
  120. package/dist/{trae-VOJXUYRN.js → trae-IAAKEBFD.js} +2 -2
  121. package/dist/{types-DWXnnx-N.d.ts → types-CAKApZpX.d.ts} +4 -4
  122. package/dist/{uninstall-WI5YLDCT.js → uninstall-KSMFBGOR.js} +12 -12
  123. package/dist/{upgrade-L45BTG6X.js → upgrade-AGC3ABMS.js} +12 -12
  124. package/dist/{usage-K3NQTAJP.js → usage-NTSSJ2O5.js} +3 -3
  125. package/dist/{usage-event-J5CQ6LNT.js → usage-event-FH3X232T.js} +7 -7
  126. package/dist/{vscode-copilot-ZBXRPKGG.js → vscode-copilot-WF2DX4AN.js} +2 -2
  127. package/dist/{warp-NRBBJQR2.js → warp-57BIWGD3.js} +2 -2
  128. package/dist/{warp-S444B2S3.js → warp-NCQPWGRZ.js} +2 -2
  129. package/dist/{windsurf-R6D2JUTN.js → windsurf-YQOBRY2Y.js} +2 -2
  130. package/dist/windsurf-YQOBRY2Y.js.map +1 -0
  131. package/dist/{zed-XJFOOKCO.js → zed-23T4G4CT.js} +2 -2
  132. package/dist/{zed-DQV3ZUCU.js → zed-U2T6VU6N.js} +3 -3
  133. package/package.json +1 -1
  134. package/dist/chunk-G5HAIYRM.js.map +0 -1
  135. package/dist/chunk-IRUYJD23.js.map +0 -1
  136. package/dist/chunk-JTN3AKZO.js.map +0 -1
  137. package/dist/chunk-WZMSSIDN.js.map +0 -1
  138. package/dist/cline-JAPJNOZQ.js.map +0 -1
  139. package/dist/codebuff-3VODFPD4.js.map +0 -1
  140. package/dist/grok-cli-4VFVF2CQ.js.map +0 -1
  141. package/dist/kilo-SW7BH6EG.js.map +0 -1
  142. package/dist/mux-BO2L5CTW.js.map +0 -1
  143. package/dist/mux-XM6AP35L.js.map +0 -1
  144. package/dist/roo-code-SUWI4BBN.js +0 -229
  145. package/dist/roo-code-SUWI4BBN.js.map +0 -1
  146. package/dist/roo-code-VI2ZKTZC.js +0 -361
  147. package/dist/roo-code-VI2ZKTZC.js.map +0 -1
  148. package/dist/windsurf-R6D2JUTN.js.map +0 -1
  149. /package/dist/{action-LEYTHNIU.js.map → action-BCD2GOJA.js.map} +0 -0
  150. /package/dist/{amazon-q-7DPVJXJN.js.map → amazon-q-KCNHU3BI.js.map} +0 -0
  151. /package/dist/{amp-VYXZWHXW.js.map → amp-HI6CGN36.js.map} +0 -0
  152. /package/dist/{amp-BQZOL5GR.js.map → amp-NDP2J4K3.js.map} +0 -0
  153. /package/dist/{antigravity-EA4L225L.js.map → antigravity-FY5553OR.js.map} +0 -0
  154. /package/dist/{antigravity-VXHL6ZPM.js.map → antigravity-I2L4WSJN.js.map} +0 -0
  155. /package/dist/{antigravity-cli-B2HXZFYQ.js.map → antigravity-cli-IUAE3SEX.js.map} +0 -0
  156. /package/dist/{antigravity-cli-JHQ7JGNX.js.map → antigravity-cli-T24Y54NG.js.map} +0 -0
  157. /package/dist/{audit-HPKCUCES.js.map → audit-F47H2PLT.js.map} +0 -0
  158. /package/dist/{chunk-BXPSDNIB.js.map → chunk-BD72ZF6D.js.map} +0 -0
  159. /package/dist/{chunk-M6OS4OLU.js.map → chunk-BGPVMJOG.js.map} +0 -0
  160. /package/dist/{chunk-2Y2MZRLP.js.map → chunk-CWUPIT72.js.map} +0 -0
  161. /package/dist/{chunk-FKW5A6HE.js.map → chunk-HUL5CRF2.js.map} +0 -0
  162. /package/dist/{chunk-6WN37NVN.js.map → chunk-O7CFTOM5.js.map} +0 -0
  163. /package/dist/{chunk-4KIXXJ7B.js.map → chunk-OXANBA4I.js.map} +0 -0
  164. /package/dist/{chunk-U2XJWG7N.js.map → chunk-STR3CRH3.js.map} +0 -0
  165. /package/dist/{chunk-6XMV2OOA.js.map → chunk-W4GVN3TJ.js.map} +0 -0
  166. /package/dist/{chunk-PWCBWAM4.js.map → chunk-W67GINTF.js.map} +0 -0
  167. /package/dist/{chunk-XY3N2U6L.js.map → chunk-WAALPWR4.js.map} +0 -0
  168. /package/dist/{chunk-4QXCNZMD.js.map → chunk-X2XEE4DO.js.map} +0 -0
  169. /package/dist/{chunk-T5AI3AW3.js.map → chunk-ZHG7Q424.js.map} +0 -0
  170. /package/dist/{claude-code-LJ6DVXWQ.js.map → claude-code-EIC4Q7OT.js.map} +0 -0
  171. /package/dist/{claude-code-NMRKTAP7.js.map → claude-code-L4VXCHKA.js.map} +0 -0
  172. /package/dist/{codebuddy-GC7VAE2Y.js.map → codebuddy-EZZFEP35.js.map} +0 -0
  173. /package/dist/{codebuff-ETYT5UBL.js.map → codebuff-GUNT2KBT.js.map} +0 -0
  174. /package/dist/{codex-RXIS5BHM.js.map → codex-C7ERS3TW.js.map} +0 -0
  175. /package/dist/{codex-YAORPCOD.js.map → codex-H4MY6747.js.map} +0 -0
  176. /package/dist/{continue-MECVDV4Z.js.map → continue-K2CWUNX5.js.map} +0 -0
  177. /package/dist/{copilot-cli-MZTAWMPW.js.map → copilot-cli-FIQNEHFC.js.map} +0 -0
  178. /package/dist/{copilot-cli-WVWAWNSM.js.map → copilot-cli-GCRZCLTV.js.map} +0 -0
  179. /package/dist/{crush-QBXLNN7T.js.map → crush-HLM2DFW2.js.map} +0 -0
  180. /package/dist/{crush-YB3SK6NK.js.map → crush-KFWUUVZ3.js.map} +0 -0
  181. /package/dist/{cursor-RSLHA2CY.js.map → cursor-CKSMXWKG.js.map} +0 -0
  182. /package/dist/{cursor-DIW43TRZ.js.map → cursor-Y3X7YK3S.js.map} +0 -0
  183. /package/dist/{detect-USP5JMWM.js.map → detect-IX6U2FBV.js.map} +0 -0
  184. /package/dist/{devin-WPDN3MXE.js.map → devin-VD6VCB4Y.js.map} +0 -0
  185. /package/dist/{doctor-VSW5KHBM.js.map → doctor-DEZPJXGY.js.map} +0 -0
  186. /package/dist/{droid-HS6MX3IL.js.map → droid-BNWFLMZU.js.map} +0 -0
  187. /package/dist/{droid-U3ZBLQFO.js.map → droid-SNF6TQK2.js.map} +0 -0
  188. /package/dist/{gemini-cli-NMVVBO3K.js.map → gemini-cli-2B6TS7KU.js.map} +0 -0
  189. /package/dist/{gemini-cli-VJ6X5DNF.js.map → gemini-cli-RH63NCVC.js.map} +0 -0
  190. /package/dist/{goose-3X7ID7YW.js.map → goose-G4JBHXLJ.js.map} +0 -0
  191. /package/dist/{goose-64V46Y2W.js.map → goose-KDHNJE7Z.js.map} +0 -0
  192. /package/dist/{hermes-AIVUE7LX.js.map → hermes-BOTDXP3F.js.map} +0 -0
  193. /package/dist/{hermes-F3EGTK6N.js.map → hermes-MVCJAPSI.js.map} +0 -0
  194. /package/dist/{hook-QRW3ON6C.js.map → hook-Q3MDXE56.js.map} +0 -0
  195. /package/dist/{install-ASTAUZKB.js.map → install-FD7XL3YC.js.map} +0 -0
  196. /package/dist/{jetbrains-copilot-XBO2JZRO.js.map → jetbrains-copilot-TMU324FM.js.map} +0 -0
  197. /package/dist/{junie-UCOS6Q37.js.map → junie-RU564IK7.js.map} +0 -0
  198. /package/dist/{kilo-T4OXNUYY.js.map → kilo-P32GL6JM.js.map} +0 -0
  199. /package/dist/{kilo-cli-ZF272ZHN.js.map → kilo-cli-L57AGENB.js.map} +0 -0
  200. /package/dist/{kilo-cli-I2S3W245.js.map → kilo-cli-WBVPQNVP.js.map} +0 -0
  201. /package/dist/{kimi-5FHEXGZD.js.map → kimi-BDW32HPV.js.map} +0 -0
  202. /package/dist/{kimi-VLSUFLYV.js.map → kimi-GY2XXIJB.js.map} +0 -0
  203. /package/dist/{kiro-AQFXGOJX.js.map → kiro-D73LXTUV.js.map} +0 -0
  204. /package/dist/{kiro-WGOI5CGT.js.map → kiro-HZF4BADZ.js.map} +0 -0
  205. /package/dist/{leaderboard-3XSVSGAJ.js.map → leaderboard-44GN3NBH.js.map} +0 -0
  206. /package/dist/{mimo-code-KETL7W7D.js.map → mimo-code-F3BZAQZK.js.map} +0 -0
  207. /package/dist/{mistral-vibe-3AU7N2CA.js.map → mistral-vibe-ETTSQPK5.js.map} +0 -0
  208. /package/dist/{nemoclaw-WA7RSKF2.js.map → nemoclaw-SGRSTG6V.js.map} +0 -0
  209. /package/dist/{omp-UDYJ2PYY.js.map → omp-DBW2I6HC.js.map} +0 -0
  210. /package/dist/{open-interpreter-WMBNM4MQ.js.map → open-interpreter-CXUCCZI3.js.map} +0 -0
  211. /package/dist/{openclaw-3DHVHX5P.js.map → openclaw-CVCZR63Q.js.map} +0 -0
  212. /package/dist/{openclaw-5EQFGOWL.js.map → openclaw-QC6ROV5Z.js.map} +0 -0
  213. /package/dist/{opencode-IKMI3RI7.js.map → opencode-MSAR4Y42.js.map} +0 -0
  214. /package/dist/{opencode-QGP4ALQY.js.map → opencode-USR7ONCJ.js.map} +0 -0
  215. /package/dist/{openhands-QGXMQR6I.js.map → openhands-IWT4DWJC.js.map} +0 -0
  216. /package/dist/{package-VWBPHCLA.js.map → package-3J7LLRIP.js.map} +0 -0
  217. /package/dist/{pi-GGDQREVG.js.map → pi-34CVX5WX.js.map} +0 -0
  218. /package/dist/{pi-A2HCGRJG.js.map → pi-5EPSCZ2G.js.map} +0 -0
  219. /package/dist/{qwen-code-GQILBJ5B.js.map → qwen-code-42TRBZ47.js.map} +0 -0
  220. /package/dist/{qwen-code-DNQTGJOF.js.map → qwen-code-JW5F5B5M.js.map} +0 -0
  221. /package/dist/{serve-IQGHE4SJ.js.map → serve-WCKL53H7.js.map} +0 -0
  222. /package/dist/{status-BVLY6XDL.js.map → status-PMVGLWXM.js.map} +0 -0
  223. /package/dist/{statusline-PRODZV2J.js.map → statusline-OKW44KFR.js.map} +0 -0
  224. /package/dist/{synthetic-6FRA7P5Q.js.map → synthetic-YZ4FO7YR.js.map} +0 -0
  225. /package/dist/{telemetry-UU4SHJ23.js.map → telemetry-7H2DLNON.js.map} +0 -0
  226. /package/dist/{trae-CPPYASR2.js.map → trae-7PXIXNQO.js.map} +0 -0
  227. /package/dist/{trae-VOJXUYRN.js.map → trae-IAAKEBFD.js.map} +0 -0
  228. /package/dist/{uninstall-WI5YLDCT.js.map → uninstall-KSMFBGOR.js.map} +0 -0
  229. /package/dist/{upgrade-L45BTG6X.js.map → upgrade-AGC3ABMS.js.map} +0 -0
  230. /package/dist/{usage-K3NQTAJP.js.map → usage-NTSSJ2O5.js.map} +0 -0
  231. /package/dist/{usage-event-J5CQ6LNT.js.map → usage-event-FH3X232T.js.map} +0 -0
  232. /package/dist/{vscode-copilot-ZBXRPKGG.js.map → vscode-copilot-WF2DX4AN.js.map} +0 -0
  233. /package/dist/{warp-NRBBJQR2.js.map → warp-57BIWGD3.js.map} +0 -0
  234. /package/dist/{warp-S444B2S3.js.map → warp-NCQPWGRZ.js.map} +0 -0
  235. /package/dist/{zed-XJFOOKCO.js.map → zed-23T4G4CT.js.map} +0 -0
  236. /package/dist/{zed-DQV3ZUCU.js.map → zed-U2T6VU6N.js.map} +0 -0
@@ -0,0 +1,682 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ grokBuildConfigHome
4
+ } from "./chunk-KOFCNA5T.js";
5
+ import {
6
+ normalizeSessionSource
7
+ } from "./chunk-H53QZQJI.js";
8
+ import {
9
+ resolveEnvRefsDeep
10
+ } from "./chunk-BEFVJ2OE.js";
11
+ import {
12
+ BaseAdapter,
13
+ removeFromObjectMap,
14
+ renderCommandMd,
15
+ renderSkillMd,
16
+ renderSubagentMd,
17
+ upsertInObjectMap
18
+ } from "./chunk-PMOFA5BT.js";
19
+ import {
20
+ buildHomeBinHookCommand,
21
+ buildWrappedStdio
22
+ } from "./chunk-QSY74NAP.js";
23
+ import "./chunk-UMQ6NBQR.js";
24
+ import {
25
+ ensureDir
26
+ } from "./chunk-GZGLCCEE.js";
27
+
28
+ // src/adapters/grok-build/index.ts
29
+ import { existsSync, readFileSync, writeFileSync } from "fs";
30
+ import { dirname, join } from "path";
31
+ import TOML from "@iarna/toml";
32
+ var GROK_BUILD_HOOK_EVENTS = [
33
+ "SessionStart",
34
+ "SessionEnd",
35
+ "UserPromptSubmit",
36
+ "PreToolUse",
37
+ "PostToolUse",
38
+ "PostToolUseFailure",
39
+ "Stop",
40
+ "Notification",
41
+ "SubagentStart",
42
+ "SubagentStop",
43
+ "PreCompact",
44
+ "PostCompact"
45
+ ];
46
+ var PRE_TOOL_USE_MATCHER = "run_terminal_command|Bash|search_replace|Edit|Write|MultiEdit|apply_patch|spawn_subagent|Task";
47
+ var WARN_SKIP_EVENTS = /* @__PURE__ */ new Set(["PermissionRequest"]);
48
+ var HOOKS_FILENAME = "agent-connector.json";
49
+ function coerceToolResult(value) {
50
+ if (value === void 0 || value === null) return void 0;
51
+ if (typeof value === "string") return value;
52
+ try {
53
+ return JSON.stringify(value);
54
+ } catch {
55
+ return String(value);
56
+ }
57
+ }
58
+ var GrokBuildAdapter = class extends BaseAdapter {
59
+ id = "grok-build";
60
+ name = "Grok Build";
61
+ paradigm = "json-stdio";
62
+ capabilities = {
63
+ preToolUse: true,
64
+ postToolUse: true,
65
+ preCompact: true,
66
+ sessionStart: true,
67
+ sessionEnd: true,
68
+ userPromptSubmit: true,
69
+ stop: true,
70
+ notification: true,
71
+ // PostToolUseFailure is a first-class Grok event (a dispatch failure or an
72
+ // MCP error result fires it INSTEAD of PostToolUse); SubagentStart/Stop and
73
+ // PostCompact are all native. permissionRequest stays UNSET — see the header.
74
+ postToolUseFailure: true,
75
+ subagentStart: true,
76
+ subagentStop: true,
77
+ postCompact: true,
78
+ // PreToolUse `updatedInput` rewrites the call before it runs, and every
79
+ // downstream consumer (plan-mode gate, permission prompt, the tool, the later
80
+ // PostToolUse payload) sees the rewritten input.
81
+ canModifyArgs: true,
82
+ // PostToolUse `updatedToolOutput` replaces the model's copy of the result —
83
+ // "Universal key; works for every tool".
84
+ canModifyOutput: true,
85
+ // FALSE: Grok ignores stdout on SessionStart ("For events like SessionStart
86
+ // or Notification, stdout is ignored. Just exit 0.") and on an allowing
87
+ // UserPromptSubmit ("stdout of an allowing hook is discarded (no
88
+ // additionalContext)"). Context injection exists only on the tool events,
89
+ // which this flag does not describe.
90
+ canInjectSessionContext: false,
91
+ // `grok mcp add` documents stdio (default), --transport http and
92
+ // --transport sse; the TOML carries `url` for both remote forms.
93
+ transports: ["stdio", "http", "sse"],
94
+ // Content surfaces, all under <scope>/.grok:
95
+ // command → commands/<name>.md (flat md, stem = slash name)
96
+ // skill → skills/<name>/SKILL.md (Anthropic frontmatter)
97
+ // subagent → agents/<name>.md (name/description/tools/model)
98
+ supportsCommands: true,
99
+ supportsSkills: true,
100
+ supportsSubagents: true,
101
+ // Memory: AGENTS.md (project) / $GROK_HOME/rules (user).
102
+ supportsMemory: true
103
+ };
104
+ // ── Detection ──────────────────────────────────────────────────────────
105
+ /**
106
+ * Grok Build is installed when its OWN marker file exists, or when a config
107
+ * dir exists that is not merely the community Grok CLI's `~/.grok`. The
108
+ * sibling bow-out is what keeps the two products' shared default directory
109
+ * from cross-reporting (see the header).
110
+ */
111
+ detectInstalled(projectDir) {
112
+ const userDir = this.userConfigDir();
113
+ const projDir = join(projectDir, ".grok");
114
+ const userCfg = join(userDir, "config.toml");
115
+ const projCfg = join(projDir, "config.toml");
116
+ const siblingOnly = existsSync(join(userDir, "user-settings.json")) && !existsSync(userCfg);
117
+ const userInstalled = existsSync(userCfg) || existsSync(userDir) && !siblingOnly;
118
+ const projInstalled = existsSync(projCfg) || existsSync(projDir);
119
+ const installed = userInstalled || projInstalled;
120
+ const scope = projInstalled && !userInstalled ? "project" : "user";
121
+ const configPath = scope === "project" ? projCfg : userCfg;
122
+ return {
123
+ id: this.id,
124
+ name: this.name,
125
+ installed,
126
+ paradigm: this.paradigm,
127
+ capabilities: this.capabilities,
128
+ configPath,
129
+ scope,
130
+ reason: installed ? `found Grok Build config dir (${scope})` : siblingOnly ? `${userDir} holds only the community Grok CLI's user-settings.json` : `no .grok config dir at ${userDir} or ${projDir}`,
131
+ confidence: installed ? "high" : "low"
132
+ };
133
+ }
134
+ // ── Native paths ───────────────────────────────────────────────────────
135
+ getConfigDir(ctx) {
136
+ if (ctx.scope === "project") return join(ctx.projectDir, ".grok");
137
+ return this.userConfigDir();
138
+ }
139
+ getServerConfigPath(ctx) {
140
+ return join(this.getConfigDir(ctx), "config.toml");
141
+ }
142
+ /**
143
+ * Hooks live in their OWN directory, one JSON file per author —
144
+ * `$GROK_HOME/hooks/*.json` (user) or `<project>/.grok/hooks/*.json`. We own
145
+ * exactly one file there, so an install never rewrites a hand-authored config.
146
+ */
147
+ getHookConfigPath(ctx) {
148
+ return join(this.getConfigDir(ctx), "hooks", HOOKS_FILENAME);
149
+ }
150
+ /** `$GROK_HOME` (tilde-expanded, then resolved) || `~/.grok`. */
151
+ userConfigDir() {
152
+ return grokBuildConfigHome();
153
+ }
154
+ // ── Memory surface: AGENTS.md (project) / $GROK_HOME/rules (user) ────────
155
+ // 12-project-rules.md is titled "Project Rules (AGENTS.md)" and documents
156
+ // AGENTS.md discovery from the repo root down to the cwd. The USER tier has no
157
+ // AGENTS.md equivalent: home-level guidance is `*.md` under
158
+ // `$GROK_HOME/rules/` ("Always scanned; applies to all projects").
159
+ memoryTargets(ctx) {
160
+ if (this.memoryOverride(ctx)?.path) return super.memoryTargets(ctx);
161
+ if (ctx.scope === "project") {
162
+ return [
163
+ {
164
+ path: join(ctx.projectDir, "AGENTS.md"),
165
+ reason: "AGENTS.md standard (project root; Grok Build loads it root \u2192 cwd)"
166
+ }
167
+ ];
168
+ }
169
+ if (ctx.scope === "user") {
170
+ return [
171
+ {
172
+ path: join(this.userConfigDir(), "rules", "agent-connector.md"),
173
+ reason: "$GROK_HOME/rules/*.md global rules (always scanned, all projects)"
174
+ }
175
+ ];
176
+ }
177
+ return [];
178
+ }
179
+ // ── TOML config IO (config.toml is TOML, not JSON) ───────────────────────
180
+ readToml(path) {
181
+ if (!existsSync(path)) return {};
182
+ try {
183
+ return TOML.parse(readFileSync(path, "utf8"));
184
+ } catch {
185
+ return {};
186
+ }
187
+ }
188
+ writeToml(path, data, dryRun) {
189
+ if (dryRun) return;
190
+ ensureDir(dirname(path));
191
+ writeFileSync(path, TOML.stringify(data), "utf8");
192
+ }
193
+ /** ObjectMapCodec over config.toml, mirroring codex: readToml fail-softs to
194
+ * {} so a corrupt file coerces rather than warn-skipping. */
195
+ tomlObjectMapCodec() {
196
+ return {
197
+ parse: (path) => this.readToml(path),
198
+ serialize: (path, data, dryRun) => this.writeToml(path, data, dryRun),
199
+ isPresentButUnparseable: () => false
200
+ };
201
+ }
202
+ // ── Install server (config.toml → [mcp_servers.<id>]) ────────────────────
203
+ installServer(ctx) {
204
+ const { connector, dryRun } = ctx;
205
+ const server = this.effectiveServer(ctx);
206
+ const path = this.getServerConfigPath(ctx);
207
+ if (!server) {
208
+ return [{ platform: this.id, action: "skip", path, detail: "no server declared" }];
209
+ }
210
+ const isStdio = server.transport === "stdio" && !!server.command;
211
+ const isRemote = (server.transport === "http" || server.transport === "sse") && !!server.url;
212
+ if (!isStdio && !isRemote) {
213
+ return [
214
+ {
215
+ platform: this.id,
216
+ action: "skip",
217
+ path,
218
+ detail: `transport "${server.transport}" not registrable in config.toml (stdio + http/sse url only)`
219
+ }
220
+ ];
221
+ }
222
+ const symlink = this.symlinkPathWarning(path);
223
+ if (symlink) return [symlink];
224
+ return [
225
+ upsertInObjectMap({
226
+ codec: this.tomlObjectMapCodec(),
227
+ rootKey: "mcp_servers",
228
+ policy: "coerce",
229
+ platform: this.id,
230
+ configPath: path,
231
+ entryId: connector.id,
232
+ entry: this.renderMcpEntry(ctx, server),
233
+ dryRun
234
+ })
235
+ ];
236
+ }
237
+ uninstallServer(ctx) {
238
+ const { connector, dryRun } = ctx;
239
+ const path = this.getServerConfigPath(ctx);
240
+ const symlink = this.symlinkPathWarning(path);
241
+ if (symlink) return [symlink];
242
+ return [
243
+ removeFromObjectMap({
244
+ codec: this.tomlObjectMapCodec(),
245
+ rootKey: "mcp_servers",
246
+ policy: "coerce",
247
+ platform: this.id,
248
+ configPath: path,
249
+ entryId: connector.id,
250
+ dryRun
251
+ })
252
+ ];
253
+ }
254
+ // ── Install hooks (hooks/agent-connector.json) ───────────────────────────
255
+ installHooks(ctx) {
256
+ const path = this.getHookConfigPath(ctx);
257
+ const hooksOff = ctx.connector.platforms[this.id]?.hooks === false;
258
+ const declared = hooksOff ? [] : ctx.connector.hookEvents;
259
+ if (declared.length === 0) {
260
+ return [{ platform: this.id, action: "skip", path, detail: "no hooks declared" }];
261
+ }
262
+ const supported = (e) => GROK_BUILD_HOOK_EVENTS.includes(e);
263
+ const pending = [
264
+ ...declared.filter((e) => !supported(e)).map((event) => ({ event, matcher: "" })),
265
+ ...declared.filter(supported).map((event) => ({ event, matcher: "" }))
266
+ ];
267
+ return this.upsertHookEntries(ctx, path, pending, this.hookDescriptor(ctx));
268
+ }
269
+ uninstallHooks(ctx) {
270
+ return this.removeHookEntries(ctx, this.getHookConfigPath(ctx), this.hookDescriptor(ctx));
271
+ }
272
+ /** Hook-merge policy for the shared object-map engine (Claude-compatible file). */
273
+ hookDescriptor(_ctx) {
274
+ return {
275
+ malformedPolicy: "coerce",
276
+ mapEvent: (e) => GROK_BUILD_HOOK_EVENTS.includes(e) ? e : void 0,
277
+ unmappedWarnDetail: (e) => `${e} has no Grok Build hook equivalent \u2014 skipped`,
278
+ unmappedAction: (e) => WARN_SKIP_EVENTS.has(e) ? "warn" : "skip",
279
+ renderEntry: (event, _matcher, command) => {
280
+ const entry = { hooks: [{ type: "command", command }] };
281
+ entry.matcher = event === "PreToolUse" ? PRE_TOOL_USE_MATCHER : "";
282
+ return entry;
283
+ },
284
+ entryOwnsCommand: (entry, command) => Array.isArray(entry.hooks) && entry.hooks.some(
285
+ (h) => (h.command ?? "").replace(/\\/g, "/") === command.replace(/\\/g, "/")
286
+ ),
287
+ ownsEntryForRemove: (c, event) => (entry) => this.isOurEntry(c, event, entry),
288
+ skipDetail: (e) => `hooks.${e}`,
289
+ removeDetail: (e, _n) => `hooks.${e}`,
290
+ absentDetail: `no ${HOOKS_FILENAME}`,
291
+ noMatchDetail: "no agent-connector hooks present",
292
+ removeEventKeys: GROK_BUILD_HOOK_EVENTS
293
+ };
294
+ }
295
+ // ── Health checks ────────────────────────────────────────────────────────
296
+ getHealthChecks(ctx) {
297
+ const path = this.getServerConfigPath(ctx);
298
+ const id = ctx.connector.id;
299
+ const checks = [
300
+ {
301
+ name: `${this.name}: config.toml exists`,
302
+ check: () => existsSync(path) ? { status: "OK", detail: path } : { status: "FAIL", detail: `not found: ${path}` }
303
+ },
304
+ {
305
+ name: `${this.name}: mcp_servers.${id} registered`,
306
+ check: () => {
307
+ if (!ctx.connector.server) {
308
+ return { status: "OK", detail: "no MCP server declared" };
309
+ }
310
+ const bucket = this.readToml(path)["mcp_servers"];
311
+ const present = typeof bucket === "object" && bucket !== null && id in bucket;
312
+ return present ? { status: "OK", detail: `mcp_servers.${id}` } : { status: "FAIL", detail: `mcp_servers.${id} not found in ${path}` };
313
+ }
314
+ }
315
+ ];
316
+ for (const cmd of ctx.connector.commands) {
317
+ const p = this.commandPath(ctx, cmd.name);
318
+ checks.push({
319
+ name: `${this.name}: command ${cmd.name} present`,
320
+ check: () => existsSync(p) ? { status: "OK", detail: p } : { status: "FAIL", detail: `not found: ${p}` }
321
+ });
322
+ }
323
+ for (const skill of ctx.connector.skills) {
324
+ const p = join(this.skillDir(ctx, skill.name), "SKILL.md");
325
+ checks.push({
326
+ name: `${this.name}: skill ${skill.name} present`,
327
+ check: () => existsSync(p) ? { status: "OK", detail: p } : { status: "FAIL", detail: `not found: ${p}` }
328
+ });
329
+ }
330
+ for (const agent of ctx.connector.subagents) {
331
+ const p = this.subagentPath(ctx, agent.name);
332
+ checks.push({
333
+ name: `${this.name}: subagent ${agent.name} present`,
334
+ check: () => existsSync(p) ? { status: "OK", detail: p } : { status: "FAIL", detail: `not found: ${p}` }
335
+ });
336
+ }
337
+ return checks;
338
+ }
339
+ // ── Content surfaces: commands / skills / subagents ──────────────────────
340
+ // Pure native-file writers under <scope>/.grok — idempotent via
341
+ // writeContentFile, reversible via removeContentFile. All three roots are
342
+ // scope-symmetric (Grok scans the same layout at user, repo and cwd tiers).
343
+ commandPath(ctx, name) {
344
+ return join(this.getConfigDir(ctx), "commands", `${name}.md`);
345
+ }
346
+ skillDir(ctx, name) {
347
+ return join(this.getConfigDir(ctx), "skills", name);
348
+ }
349
+ subagentPath(ctx, name) {
350
+ return join(this.getConfigDir(ctx), "agents", `${name}.md`);
351
+ }
352
+ // ── Commands (flat markdown; filename stem = slash-command name) ──────────
353
+ installCommands(ctx) {
354
+ const { connector } = ctx;
355
+ if (connector.platforms[this.id]?.commands === false) {
356
+ return [{ platform: this.id, action: "skip", detail: "commands disabled for grok-build" }];
357
+ }
358
+ if (connector.commands.length === 0) {
359
+ return [{ platform: this.id, action: "skip", detail: "connector declares no commands" }];
360
+ }
361
+ return connector.commands.map(
362
+ (cmd) => this.writeContentFile(
363
+ this.commandPath(ctx, cmd.name),
364
+ // Grok's command markdown is the Claude legacy layout: description +
365
+ // argument-hint frontmatter. It has no allowed-tools/model keys on a
366
+ // COMMAND (those are skill/agent frontmatter fields), so both are dropped.
367
+ renderCommandMd(cmd, { includeToolsAndModel: false }),
368
+ ctx.dryRun
369
+ )
370
+ );
371
+ }
372
+ uninstallCommands(ctx) {
373
+ const { connector } = ctx;
374
+ if (connector.commands.length === 0) {
375
+ return [{ platform: this.id, action: "skip", detail: "connector declares no commands" }];
376
+ }
377
+ return connector.commands.map(
378
+ (cmd) => this.removeContentFile(this.commandPath(ctx, cmd.name), ctx.dryRun)
379
+ );
380
+ }
381
+ // ── Skills (Anthropic-format SKILL.md) ───────────────────────────────────
382
+ installSkills(ctx) {
383
+ const { connector } = ctx;
384
+ if (connector.platforms[this.id]?.skills === false) {
385
+ return [{ platform: this.id, action: "skip", detail: "skills disabled for grok-build" }];
386
+ }
387
+ if (connector.skills.length === 0) {
388
+ return [{ platform: this.id, action: "skip", detail: "connector declares no skills" }];
389
+ }
390
+ const changes = [];
391
+ for (const skill of connector.skills) {
392
+ const dir = this.skillDir(ctx, skill.name);
393
+ changes.push(this.writeContentFile(join(dir, "SKILL.md"), renderSkillMd(skill), ctx.dryRun));
394
+ for (const [rel, contents] of Object.entries(skill.resources ?? {})) {
395
+ const target = this.resolveWithin(dir, rel);
396
+ if (target === null) {
397
+ changes.push({
398
+ platform: this.id,
399
+ action: "warn",
400
+ detail: `skill resource "${rel}" escapes the skill dir; skipped`
401
+ });
402
+ continue;
403
+ }
404
+ changes.push(this.writeContentFile(target, contents, ctx.dryRun));
405
+ }
406
+ }
407
+ return changes;
408
+ }
409
+ uninstallSkills(ctx) {
410
+ const { connector } = ctx;
411
+ if (connector.skills.length === 0) {
412
+ return [{ platform: this.id, action: "skip", detail: "connector declares no skills" }];
413
+ }
414
+ const changes = [];
415
+ for (const skill of connector.skills) {
416
+ const dir = this.skillDir(ctx, skill.name);
417
+ changes.push(this.removeContentFile(join(dir, "SKILL.md"), ctx.dryRun));
418
+ for (const rel of Object.keys(skill.resources ?? {})) {
419
+ const target = this.resolveWithin(dir, rel);
420
+ if (target === null) continue;
421
+ changes.push(this.removeContentFile(target, ctx.dryRun));
422
+ }
423
+ changes.push(this.removeDirIfEmpty(dir, ctx.dryRun));
424
+ }
425
+ return changes;
426
+ }
427
+ // ── Subagents (md + frontmatter: name, description, tools, model) ─────────
428
+ installSubagents(ctx) {
429
+ const { connector } = ctx;
430
+ if (connector.platforms[this.id]?.subagents === false) {
431
+ return [{ platform: this.id, action: "skip", detail: "subagents disabled for grok-build" }];
432
+ }
433
+ if (connector.subagents.length === 0) {
434
+ return [{ platform: this.id, action: "skip", detail: "connector declares no subagents" }];
435
+ }
436
+ return connector.subagents.map(
437
+ (agent) => this.writeContentFile(
438
+ this.subagentPath(ctx, agent.name),
439
+ this.renderSubagent(agent),
440
+ ctx.dryRun
441
+ )
442
+ );
443
+ }
444
+ uninstallSubagents(ctx) {
445
+ const { connector } = ctx;
446
+ if (connector.subagents.length === 0) {
447
+ return [{ platform: this.id, action: "skip", detail: "connector declares no subagents" }];
448
+ }
449
+ return connector.subagents.map(
450
+ (agent) => this.removeContentFile(this.subagentPath(ctx, agent.name), ctx.dryRun)
451
+ );
452
+ }
453
+ /**
454
+ * Grok agent definitions are md + YAML frontmatter whose documented keys —
455
+ * name, description, tools, model — are exactly the shared renderer's shape
456
+ * (16-subagents.md shows `name`, `description`, `tools` in its frontmatter
457
+ * example). `extra` remains the escape hatch for Grok-only keys such as
458
+ * `mcpInheritance`.
459
+ */
460
+ renderSubagent(agent) {
461
+ return renderSubagentMd(agent);
462
+ }
463
+ // ── Runtime dispatch ─────────────────────────────────────────────────────
464
+ parseEvent(event, raw) {
465
+ const input = raw ?? {};
466
+ const toolName = input.toolName ?? input.tool_name ?? "";
467
+ const toolInput = input.toolInput ?? input.tool_input ?? {};
468
+ const base = {
469
+ hostPlatform: this.id,
470
+ connectorId: "",
471
+ sessionId: input.sessionId ?? input.session_id ?? `pid-${process.ppid}`,
472
+ // `cwd` is the session's working directory; `workspaceRoot` is the repo
473
+ // root. Prefer cwd (matches every other adapter's projectDir semantics).
474
+ projectDir: input.cwd ?? input.workspaceRoot ?? process.cwd(),
475
+ raw
476
+ };
477
+ switch (event) {
478
+ case "PreToolUse":
479
+ return { ...base, toolName, toolInput };
480
+ case "PostToolUse":
481
+ return {
482
+ ...base,
483
+ toolName,
484
+ toolInput,
485
+ // Upstream field is `toolResult` (aliased to `tool_response`).
486
+ toolOutput: coerceToolResult(input.toolResult ?? input.tool_response),
487
+ // Grok's PostToolUse payload has NO error flag: a dispatch failure or
488
+ // an MCP error result fires PostToolUseFailure instead. Never invent one.
489
+ isError: false
490
+ };
491
+ case "SessionStart":
492
+ return { ...base, source: normalizeSessionSource(input.source) };
493
+ case "SessionEnd":
494
+ return { ...base, reason: input.reason };
495
+ case "UserPromptSubmit":
496
+ return { ...base, prompt: input.prompt ?? "" };
497
+ case "PreCompact":
498
+ case "PostCompact":
499
+ return { ...base, trigger: input.source === "manual" ? "manual" : "auto" };
500
+ case "Stop":
501
+ return { ...base, stopHookActive: input.stopHookActive ?? false };
502
+ case "Notification":
503
+ return { ...base, message: input.message ?? input.notificationType ?? "" };
504
+ case "PostToolUseFailure":
505
+ return {
506
+ ...base,
507
+ toolName,
508
+ toolInput,
509
+ error: input.error ?? "",
510
+ ...typeof (input.toolUseId ?? input.tool_use_id) === "string" ? { toolUseId: input.toolUseId ?? input.tool_use_id } : {},
511
+ ...typeof (input.isInterrupt ?? input.is_interrupt) === "boolean" ? { isInterrupt: input.isInterrupt ?? input.is_interrupt } : {},
512
+ ...typeof (input.durationMs ?? input.duration_ms) === "number" ? { durationMs: input.durationMs ?? input.duration_ms } : {}
513
+ };
514
+ case "SubagentStart":
515
+ return {
516
+ ...base,
517
+ ...typeof input.subagentId === "string" ? { agentId: input.subagentId } : {},
518
+ ...typeof input.subagentType === "string" ? { agentType: input.subagentType } : {}
519
+ };
520
+ case "SubagentStop":
521
+ return {
522
+ ...base,
523
+ ...typeof input.subagentId === "string" ? { agentId: input.subagentId } : {},
524
+ ...typeof input.subagentType === "string" ? { agentType: input.subagentType } : {},
525
+ ...typeof input.lastAssistantMessage === "string" ? { lastAssistantMessage: input.lastAssistantMessage } : {},
526
+ ...typeof input.stopHookActive === "boolean" ? { stopHookActive: input.stopHookActive } : {}
527
+ };
528
+ case "PermissionRequest":
529
+ return { ...base, toolName, toolInput };
530
+ }
531
+ }
532
+ formatReply(event, response) {
533
+ if (response.decision === "deny") {
534
+ if (event === "PreToolUse") {
535
+ return {
536
+ exitCode: 0,
537
+ stdout: JSON.stringify({
538
+ hookSpecificOutput: {
539
+ hookEventName: "PreToolUse",
540
+ permissionDecision: "deny",
541
+ permissionDecisionReason: response.reason ?? "Blocked by hook"
542
+ }
543
+ })
544
+ };
545
+ }
546
+ if (event === "UserPromptSubmit" || event === "Stop" || event === "SubagentStop" || event === "PostToolUse") {
547
+ return {
548
+ exitCode: 0,
549
+ stdout: JSON.stringify({
550
+ decision: "block",
551
+ reason: response.reason ?? "Blocked by hook"
552
+ })
553
+ };
554
+ }
555
+ if (event === "PostToolUseFailure") {
556
+ return {
557
+ exitCode: 0,
558
+ stdout: JSON.stringify({
559
+ hookSpecificOutput: {
560
+ hookEventName: "PostToolUseFailure",
561
+ additionalContext: response.reason ?? "Blocked by hook"
562
+ }
563
+ })
564
+ };
565
+ }
566
+ return { exitCode: 0 };
567
+ }
568
+ if (response.decision === "ask" && event === "PreToolUse") {
569
+ return {
570
+ exitCode: 0,
571
+ stdout: JSON.stringify({
572
+ hookSpecificOutput: {
573
+ hookEventName: "PreToolUse",
574
+ permissionDecision: "ask",
575
+ permissionDecisionReason: response.reason ?? "Confirmation required by hook"
576
+ }
577
+ })
578
+ };
579
+ }
580
+ if (response.decision === "modify") {
581
+ if (event === "PreToolUse" && response.updatedInput) {
582
+ return {
583
+ exitCode: 0,
584
+ stdout: JSON.stringify({
585
+ hookSpecificOutput: {
586
+ hookEventName: "PreToolUse",
587
+ updatedInput: response.updatedInput
588
+ }
589
+ })
590
+ };
591
+ }
592
+ if (event === "PostToolUse" && response.updatedOutput !== void 0) {
593
+ return {
594
+ exitCode: 0,
595
+ stdout: JSON.stringify({
596
+ hookSpecificOutput: {
597
+ hookEventName: "PostToolUse",
598
+ updatedToolOutput: response.updatedOutput
599
+ }
600
+ })
601
+ };
602
+ }
603
+ return { exitCode: 0 };
604
+ }
605
+ if (response.additionalContext && (event === "PreToolUse" || event === "PostToolUse" || event === "PostToolUseFailure" || event === "Stop" || event === "SubagentStop")) {
606
+ return {
607
+ exitCode: 0,
608
+ stdout: JSON.stringify({
609
+ hookSpecificOutput: {
610
+ hookEventName: event,
611
+ additionalContext: response.additionalContext
612
+ }
613
+ })
614
+ };
615
+ }
616
+ return { exitCode: 0 };
617
+ }
618
+ // ── Internal helpers ─────────────────────────────────────────────────────
619
+ /** Resolve the per-platform server override into an effective ServerDef. */
620
+ effectiveServer(ctx) {
621
+ const override = ctx.connector.platforms[this.id]?.server;
622
+ if (override === false) return void 0;
623
+ const base = ctx.connector.server;
624
+ if (!base) return void 0;
625
+ return override ? { ...base, ...override } : base;
626
+ }
627
+ /**
628
+ * Render the `[mcp_servers.<id>]` table. TOML has NO interpolation, so every
629
+ * `${env:VAR}` resolves to a literal at install time. Honors the telemetry
630
+ * serve-wrapper (stdio only — a remote server cannot be intercepted).
631
+ */
632
+ renderMcpEntry(ctx, server) {
633
+ if (server.transport === "http" || server.transport === "sse") {
634
+ const remote = { url: resolveEnvRefsDeep(server.url ?? "") };
635
+ const headers = {};
636
+ if (server.auth?.type === "bearerEnv" && server.auth.bearerEnvVar) {
637
+ headers["Authorization"] = `Bearer \${${server.auth.bearerEnvVar}}`;
638
+ }
639
+ for (const [k, v] of Object.entries(resolveEnvRefsDeep(server.headers ?? {}))) {
640
+ headers[k] = String(v);
641
+ }
642
+ if (Object.keys(headers).length > 0) remote.headers = headers;
643
+ if (server.enabled === false) remote.enabled = false;
644
+ return remote;
645
+ }
646
+ let command = server.command;
647
+ let args = [...server.args ?? []];
648
+ ({ command, args } = buildWrappedStdio(ctx, server, this.id, command, args));
649
+ command = resolveEnvRefsDeep(command);
650
+ args = resolveEnvRefsDeep(args);
651
+ const entry = { command };
652
+ if (args.length > 0) entry.args = args;
653
+ if (server.env && Object.keys(server.env).length > 0) {
654
+ const env = {};
655
+ for (const [k, v] of Object.entries(resolveEnvRefsDeep(server.env))) {
656
+ env[k] = String(v);
657
+ }
658
+ entry.env = env;
659
+ }
660
+ if (server.enabled === false) entry.enabled = false;
661
+ return entry;
662
+ }
663
+ /**
664
+ * Does this hooks-file entry belong to this connector for `event`? EVENT-
665
+ * SPECIFIC + path-normalized exact-command match, so an entry under one event
666
+ * key is never matched while iterating another.
667
+ */
668
+ isOurEntry(ctx, event, entry) {
669
+ if (!entry || typeof entry !== "object" || !Array.isArray(entry.hooks)) return false;
670
+ const ours = buildHomeBinHookCommand(ctx.homeBinPath, "grok-build", event, ctx.connector.id);
671
+ const needle = ours.replace(/\\/g, "/");
672
+ return entry.hooks.some((h) => (h.command ?? "").replace(/\\/g, "/") === needle);
673
+ }
674
+ };
675
+ var adapter = new GrokBuildAdapter();
676
+ var grok_build_default = adapter;
677
+ export {
678
+ GrokBuildAdapter,
679
+ adapter,
680
+ grok_build_default as default
681
+ };
682
+ //# sourceMappingURL=grok-build-FSN4TNLQ.js.map