@ken-jo/agent-connector 0.4.91 → 0.4.93

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 (196) hide show
  1. package/README.md +326 -563
  2. package/dist/{action-L44DXFHT.js → action-DOWHWEDZ.js} +14 -14
  3. package/dist/{amazon-q-B52EY2SV.js → amazon-q-ETMAGY3D.js} +5 -5
  4. package/dist/{amp-UXABVUKC.js → amp-67BZONGF.js} +5 -5
  5. package/dist/{antigravity-RZHN53VB.js → antigravity-VXLDLTO7.js} +6 -6
  6. package/dist/{antigravity-cli-JO6GUTV7.js → antigravity-cli-OM6SC3PE.js} +47 -16
  7. package/dist/antigravity-cli-OM6SC3PE.js.map +1 -0
  8. package/dist/{chunk-R6LML2YS.js → chunk-2RIFORQS.js} +2 -2
  9. package/dist/{chunk-QKLJU4JX.js → chunk-2Y2MZRLP.js} +56 -2
  10. package/dist/chunk-2Y2MZRLP.js.map +1 -0
  11. package/dist/{chunk-HORHRHNG.js → chunk-4NHXLXSD.js} +2 -2
  12. package/dist/{chunk-AY3RGRTT.js → chunk-6TF7MHG5.js} +2 -2
  13. package/dist/{chunk-NBUEL74R.js → chunk-6WZODR3Z.js} +3 -3
  14. package/dist/{chunk-LF76VPGQ.js → chunk-B5W3RHTI.js} +72 -22
  15. package/dist/chunk-B5W3RHTI.js.map +1 -0
  16. package/dist/{chunk-BLTVZACS.js → chunk-EHP7WISI.js} +9 -9
  17. package/dist/{chunk-4NSU3KWX.js → chunk-FJCUKXGX.js} +2 -2
  18. package/dist/{chunk-IXOQDZWC.js → chunk-GZGLCCEE.js} +5 -1
  19. package/dist/chunk-GZGLCCEE.js.map +1 -0
  20. package/dist/{chunk-LAIITCMW.js → chunk-I5TO42QC.js} +5 -5
  21. package/dist/{chunk-4FWETID5.js → chunk-IVAWP6HH.js} +2 -2
  22. package/dist/{chunk-UBB7T54N.js → chunk-JKKU2WKG.js} +3 -3
  23. package/dist/{chunk-G4CEELKO.js → chunk-KJLFGQQM.js} +180 -10
  24. package/dist/chunk-KJLFGQQM.js.map +1 -0
  25. package/dist/{chunk-NWLRJNXM.js → chunk-KSPMSRVU.js} +27 -15
  26. package/dist/chunk-KSPMSRVU.js.map +1 -0
  27. package/dist/{chunk-VVFDU4IX.js → chunk-MGTDQLJJ.js} +12 -5
  28. package/dist/{chunk-VVFDU4IX.js.map → chunk-MGTDQLJJ.js.map} +1 -1
  29. package/dist/{chunk-56R2ER7K.js → chunk-NBYKLUF6.js} +2 -2
  30. package/dist/chunk-OEADFFKO.js +590 -0
  31. package/dist/chunk-OEADFFKO.js.map +1 -0
  32. package/dist/{chunk-QARPXSIV.js → chunk-P23RVIUY.js} +4 -4
  33. package/dist/{chunk-25CPWJA7.js → chunk-SILKSP2Y.js} +43 -43
  34. package/dist/{chunk-KIRCPLM4.js → chunk-TTKSYJRY.js} +538 -226
  35. package/dist/chunk-TTKSYJRY.js.map +1 -0
  36. package/dist/{chunk-YYNXIUR2.js → chunk-UMQ6NBQR.js} +3 -3
  37. package/dist/chunk-UMQ6NBQR.js.map +1 -0
  38. package/dist/{chunk-4HVQ7IUM.js → chunk-XC5SJ35F.js} +17 -4
  39. package/dist/chunk-XC5SJ35F.js.map +1 -0
  40. package/dist/{chunk-LN76OGNR.js → chunk-Z2MRSS2I.js} +2 -2
  41. package/dist/{chunk-ZMLVR4J7.js → chunk-ZMAJ2XFD.js} +2 -2
  42. package/dist/{claude-code-WS4NAGZT.js → claude-code-DUZNOAS2.js} +9 -9
  43. package/dist/cli/sdk.js +7 -7
  44. package/dist/cli.js +1 -1
  45. package/dist/{cline-NNMVCECA.js → cline-25KW25IN.js} +5 -5
  46. package/dist/{codebuddy-RBEZGXBG.js → codebuddy-ZNYQACMF.js} +5 -5
  47. package/dist/{codebuff-RJIDSEU3.js → codebuff-VR6JUDIY.js} +5 -5
  48. package/dist/{codex-ZZ434GYR.js → codex-CPNKTXG3.js} +11 -5
  49. package/dist/{codex-ZZ434GYR.js.map → codex-CPNKTXG3.js.map} +1 -1
  50. package/dist/{continue-MNM7YVJY.js → continue-WU2IB5KS.js} +6 -6
  51. package/dist/{copilot-cli-SMTX5F65.js → copilot-cli-PAP377OM.js} +5 -5
  52. package/dist/{crush-NYDBHIJE.js → crush-3AVQA4YU.js} +5 -5
  53. package/dist/{cursor-AOELDNZU.js → cursor-GSLUET3V.js} +6 -6
  54. package/dist/define-connector-LQFJL_at.d.ts +89 -0
  55. package/dist/{detect-3S46RUMK.js → detect-DYQNUMXL.js} +4 -4
  56. package/dist/{devin-PRJY2TTD.js → devin-QMEM3OFA.js} +5 -5
  57. package/dist/{doctor-3CUBPQKU.js → doctor-H6XXAR63.js} +25 -21
  58. package/dist/doctor-H6XXAR63.js.map +1 -0
  59. package/dist/{droid-PTCH2K7Y.js → droid-MOKV53J4.js} +5 -5
  60. package/dist/{gemini-cli-QGLN2UMS.js → gemini-cli-47ZHCOZR.js} +5 -5
  61. package/dist/{goose-DQ6GSZ5O.js → goose-4EI5MYTI.js} +6 -6
  62. package/dist/{grok-cli-5QD235UB.js → grok-cli-QYQPDSVB.js} +5 -5
  63. package/dist/{hermes-E47IG63A.js → hermes-F75OSK3Y.js} +6 -6
  64. package/dist/{hook-P6EKDINW.js → hook-GIQTUDMN.js} +14 -14
  65. package/dist/index.d.ts +15 -88
  66. package/dist/index.js +15 -7
  67. package/dist/install-T27662FW.js +382 -0
  68. package/dist/install-T27662FW.js.map +1 -0
  69. package/dist/{introspect-DYOIX8Ov.d.ts → introspect-D4fEGuhN.d.ts} +1 -1
  70. package/dist/{jetbrains-copilot-T2EPKROP.js → jetbrains-copilot-ZGIWI6YV.js} +23 -7
  71. package/dist/jetbrains-copilot-ZGIWI6YV.js.map +1 -0
  72. package/dist/{junie-SQ4SDLGK.js → junie-DIFN2P22.js} +5 -5
  73. package/dist/{kilo-OU2ZLZKB.js → kilo-EMZJBEBB.js} +5 -5
  74. package/dist/{kilo-cli-NMWGYF4F.js → kilo-cli-S3GXBPAE.js} +5 -5
  75. package/dist/{kimi-Z7L2LEEI.js → kimi-IQJOIY6B.js} +5 -5
  76. package/dist/{kiro-4IN5IH46.js → kiro-BYX4HEAJ.js} +5 -5
  77. package/dist/{leaderboard-LF5SP6X2.js → leaderboard-CIMQBOUS.js} +5 -5
  78. package/dist/{mimo-code-G2CBZ4M6.js → mimo-code-7R53QDHB.js} +5 -5
  79. package/dist/{mistral-vibe-TRQDHAWV.js → mistral-vibe-LHJ55FSB.js} +5 -5
  80. package/dist/{mux-JNM3F2NW.js → mux-NYCNGL43.js} +5 -5
  81. package/dist/{nemoclaw-SHA4IUML.js → nemoclaw-WSIPSE7U.js} +6 -6
  82. package/dist/{omp-OOVUNXME.js → omp-562NK5BJ.js} +5 -5
  83. package/dist/{open-interpreter-4PKL56AA.js → open-interpreter-I2CNOEXY.js} +5 -5
  84. package/dist/openclaw-7EYBQS4R.js +17 -0
  85. package/dist/{opencode-W2RK4M7G.js → opencode-YS4WX2E2.js} +5 -5
  86. package/dist/{openhands-5LNH3BKB.js → openhands-QMYIKNOS.js} +5 -5
  87. package/dist/{package-2EAIYSJ4.js → package-LIPZKHAQ.js} +12 -12
  88. package/dist/{pi-BUADR5MJ.js → pi-644FIN3A.js} +5 -5
  89. package/dist/{qwen-code-TUJNHKNI.js → qwen-code-STDMX7EM.js} +6 -6
  90. package/dist/{roo-code-L5F7S6QH.js → roo-code-DLPIHHQ6.js} +5 -5
  91. package/dist/runtime/index.d.ts +1 -1
  92. package/dist/runtime/index.js +12 -12
  93. package/dist/sdk/index.d.ts +4 -4
  94. package/dist/sdk/index.js +6 -6
  95. package/dist/sdk/test.d.ts +2 -2
  96. package/dist/sdk/test.js +10 -10
  97. package/dist/{serve-K62FW3V7.js → serve-ABTO2NA2.js} +14 -14
  98. package/dist/{status-E5MCFZM6.js → status-J7SOUH7O.js} +10 -10
  99. package/dist/{statusline-LIPF2KVP.js → statusline-QF4G724E.js} +13 -13
  100. package/dist/{telemetry-4OC56NTM.js → telemetry-EICCFEIF.js} +10 -10
  101. package/dist/{trae-Z7CQ2A2Q.js → trae-UOYD6JZZ.js} +5 -5
  102. package/dist/{types-C4qMgbJn.d.ts → types-BhcUEIJJ.d.ts} +82 -3
  103. package/dist/{uninstall-2YYKN5DX.js → uninstall-NJNNZZZY.js} +35 -25
  104. package/dist/uninstall-NJNNZZZY.js.map +1 -0
  105. package/dist/{upgrade-55AFPJEF.js → upgrade-TIBUOQNM.js} +23 -17
  106. package/dist/upgrade-TIBUOQNM.js.map +1 -0
  107. package/dist/{usage-3PB3WZSL.js → usage-VEVBWPLS.js} +2 -2
  108. package/dist/{usage-event-KD5FW6W4.js → usage-event-GRQE7XWT.js} +13 -13
  109. package/dist/{vscode-copilot-LU5NC4ZS.js → vscode-copilot-NIMH2DGU.js} +20 -5
  110. package/dist/vscode-copilot-NIMH2DGU.js.map +1 -0
  111. package/dist/{warp-4PPG5LOM.js → warp-QYJGKURM.js} +5 -5
  112. package/dist/{windsurf-3T3RVXKM.js → windsurf-75LLZ37C.js} +5 -5
  113. package/dist/{zed-ZF2OQ75O.js → zed-HKAZXEJW.js} +5 -5
  114. package/package.json +1 -1
  115. package/dist/antigravity-cli-JO6GUTV7.js.map +0 -1
  116. package/dist/chunk-4HVQ7IUM.js.map +0 -1
  117. package/dist/chunk-7HUUINPB.js +0 -201
  118. package/dist/chunk-7HUUINPB.js.map +0 -1
  119. package/dist/chunk-G4CEELKO.js.map +0 -1
  120. package/dist/chunk-IXOQDZWC.js.map +0 -1
  121. package/dist/chunk-KIRCPLM4.js.map +0 -1
  122. package/dist/chunk-LF76VPGQ.js.map +0 -1
  123. package/dist/chunk-NWLRJNXM.js.map +0 -1
  124. package/dist/chunk-QKLJU4JX.js.map +0 -1
  125. package/dist/chunk-YYNXIUR2.js.map +0 -1
  126. package/dist/doctor-3CUBPQKU.js.map +0 -1
  127. package/dist/install-7DMK53SB.js +0 -96
  128. package/dist/install-7DMK53SB.js.map +0 -1
  129. package/dist/jetbrains-copilot-T2EPKROP.js.map +0 -1
  130. package/dist/openclaw-BD56E5MV.js +0 -17
  131. package/dist/uninstall-2YYKN5DX.js.map +0 -1
  132. package/dist/upgrade-55AFPJEF.js.map +0 -1
  133. package/dist/vscode-copilot-LU5NC4ZS.js.map +0 -1
  134. /package/dist/{action-L44DXFHT.js.map → action-DOWHWEDZ.js.map} +0 -0
  135. /package/dist/{amazon-q-B52EY2SV.js.map → amazon-q-ETMAGY3D.js.map} +0 -0
  136. /package/dist/{amp-UXABVUKC.js.map → amp-67BZONGF.js.map} +0 -0
  137. /package/dist/{antigravity-RZHN53VB.js.map → antigravity-VXLDLTO7.js.map} +0 -0
  138. /package/dist/{chunk-R6LML2YS.js.map → chunk-2RIFORQS.js.map} +0 -0
  139. /package/dist/{chunk-HORHRHNG.js.map → chunk-4NHXLXSD.js.map} +0 -0
  140. /package/dist/{chunk-AY3RGRTT.js.map → chunk-6TF7MHG5.js.map} +0 -0
  141. /package/dist/{chunk-NBUEL74R.js.map → chunk-6WZODR3Z.js.map} +0 -0
  142. /package/dist/{chunk-BLTVZACS.js.map → chunk-EHP7WISI.js.map} +0 -0
  143. /package/dist/{chunk-4NSU3KWX.js.map → chunk-FJCUKXGX.js.map} +0 -0
  144. /package/dist/{chunk-LAIITCMW.js.map → chunk-I5TO42QC.js.map} +0 -0
  145. /package/dist/{chunk-4FWETID5.js.map → chunk-IVAWP6HH.js.map} +0 -0
  146. /package/dist/{chunk-UBB7T54N.js.map → chunk-JKKU2WKG.js.map} +0 -0
  147. /package/dist/{chunk-56R2ER7K.js.map → chunk-NBYKLUF6.js.map} +0 -0
  148. /package/dist/{chunk-QARPXSIV.js.map → chunk-P23RVIUY.js.map} +0 -0
  149. /package/dist/{chunk-25CPWJA7.js.map → chunk-SILKSP2Y.js.map} +0 -0
  150. /package/dist/{chunk-LN76OGNR.js.map → chunk-Z2MRSS2I.js.map} +0 -0
  151. /package/dist/{chunk-ZMLVR4J7.js.map → chunk-ZMAJ2XFD.js.map} +0 -0
  152. /package/dist/{claude-code-WS4NAGZT.js.map → claude-code-DUZNOAS2.js.map} +0 -0
  153. /package/dist/{cline-NNMVCECA.js.map → cline-25KW25IN.js.map} +0 -0
  154. /package/dist/{codebuddy-RBEZGXBG.js.map → codebuddy-ZNYQACMF.js.map} +0 -0
  155. /package/dist/{codebuff-RJIDSEU3.js.map → codebuff-VR6JUDIY.js.map} +0 -0
  156. /package/dist/{continue-MNM7YVJY.js.map → continue-WU2IB5KS.js.map} +0 -0
  157. /package/dist/{copilot-cli-SMTX5F65.js.map → copilot-cli-PAP377OM.js.map} +0 -0
  158. /package/dist/{crush-NYDBHIJE.js.map → crush-3AVQA4YU.js.map} +0 -0
  159. /package/dist/{cursor-AOELDNZU.js.map → cursor-GSLUET3V.js.map} +0 -0
  160. /package/dist/{detect-3S46RUMK.js.map → detect-DYQNUMXL.js.map} +0 -0
  161. /package/dist/{devin-PRJY2TTD.js.map → devin-QMEM3OFA.js.map} +0 -0
  162. /package/dist/{droid-PTCH2K7Y.js.map → droid-MOKV53J4.js.map} +0 -0
  163. /package/dist/{gemini-cli-QGLN2UMS.js.map → gemini-cli-47ZHCOZR.js.map} +0 -0
  164. /package/dist/{goose-DQ6GSZ5O.js.map → goose-4EI5MYTI.js.map} +0 -0
  165. /package/dist/{grok-cli-5QD235UB.js.map → grok-cli-QYQPDSVB.js.map} +0 -0
  166. /package/dist/{hermes-E47IG63A.js.map → hermes-F75OSK3Y.js.map} +0 -0
  167. /package/dist/{hook-P6EKDINW.js.map → hook-GIQTUDMN.js.map} +0 -0
  168. /package/dist/{junie-SQ4SDLGK.js.map → junie-DIFN2P22.js.map} +0 -0
  169. /package/dist/{kilo-OU2ZLZKB.js.map → kilo-EMZJBEBB.js.map} +0 -0
  170. /package/dist/{kilo-cli-NMWGYF4F.js.map → kilo-cli-S3GXBPAE.js.map} +0 -0
  171. /package/dist/{kimi-Z7L2LEEI.js.map → kimi-IQJOIY6B.js.map} +0 -0
  172. /package/dist/{kiro-4IN5IH46.js.map → kiro-BYX4HEAJ.js.map} +0 -0
  173. /package/dist/{leaderboard-LF5SP6X2.js.map → leaderboard-CIMQBOUS.js.map} +0 -0
  174. /package/dist/{mimo-code-G2CBZ4M6.js.map → mimo-code-7R53QDHB.js.map} +0 -0
  175. /package/dist/{mistral-vibe-TRQDHAWV.js.map → mistral-vibe-LHJ55FSB.js.map} +0 -0
  176. /package/dist/{mux-JNM3F2NW.js.map → mux-NYCNGL43.js.map} +0 -0
  177. /package/dist/{nemoclaw-SHA4IUML.js.map → nemoclaw-WSIPSE7U.js.map} +0 -0
  178. /package/dist/{omp-OOVUNXME.js.map → omp-562NK5BJ.js.map} +0 -0
  179. /package/dist/{open-interpreter-4PKL56AA.js.map → open-interpreter-I2CNOEXY.js.map} +0 -0
  180. /package/dist/{openclaw-BD56E5MV.js.map → openclaw-7EYBQS4R.js.map} +0 -0
  181. /package/dist/{opencode-W2RK4M7G.js.map → opencode-YS4WX2E2.js.map} +0 -0
  182. /package/dist/{openhands-5LNH3BKB.js.map → openhands-QMYIKNOS.js.map} +0 -0
  183. /package/dist/{package-2EAIYSJ4.js.map → package-LIPZKHAQ.js.map} +0 -0
  184. /package/dist/{pi-BUADR5MJ.js.map → pi-644FIN3A.js.map} +0 -0
  185. /package/dist/{qwen-code-TUJNHKNI.js.map → qwen-code-STDMX7EM.js.map} +0 -0
  186. /package/dist/{roo-code-L5F7S6QH.js.map → roo-code-DLPIHHQ6.js.map} +0 -0
  187. /package/dist/{serve-K62FW3V7.js.map → serve-ABTO2NA2.js.map} +0 -0
  188. /package/dist/{status-E5MCFZM6.js.map → status-J7SOUH7O.js.map} +0 -0
  189. /package/dist/{statusline-LIPF2KVP.js.map → statusline-QF4G724E.js.map} +0 -0
  190. /package/dist/{telemetry-4OC56NTM.js.map → telemetry-EICCFEIF.js.map} +0 -0
  191. /package/dist/{trae-Z7CQ2A2Q.js.map → trae-UOYD6JZZ.js.map} +0 -0
  192. /package/dist/{usage-3PB3WZSL.js.map → usage-VEVBWPLS.js.map} +0 -0
  193. /package/dist/{usage-event-KD5FW6W4.js.map → usage-event-GRQE7XWT.js.map} +0 -0
  194. /package/dist/{warp-4PPG5LOM.js.map → warp-QYJGKURM.js.map} +0 -0
  195. /package/dist/{windsurf-3T3RVXKM.js.map → windsurf-75LLZ37C.js.map} +0 -0
  196. /package/dist/{zed-ZF2OQ75O.js.map → zed-HKAZXEJW.js.map} +0 -0
@@ -4,38 +4,40 @@ import {
4
4
  resolveCliEntry,
5
5
  syncConnector,
6
6
  upgradeViaMarketplace
7
- } from "./chunk-KIRCPLM4.js";
8
- import "./chunk-LF76VPGQ.js";
9
- import "./chunk-QKLJU4JX.js";
7
+ } from "./chunk-TTKSYJRY.js";
8
+ import "./chunk-B5W3RHTI.js";
9
+ import "./chunk-2Y2MZRLP.js";
10
10
  import "./chunk-UM5S7DKK.js";
11
- import "./chunk-NBUEL74R.js";
11
+ import "./chunk-6WZODR3Z.js";
12
12
  import "./chunk-OPXAP3AC.js";
13
13
  import {
14
+ buildConnectorSummary,
14
15
  fail,
16
+ maybePrintBanner,
15
17
  parseScope,
16
18
  parseTargets,
17
19
  print,
18
20
  renderInstallResult
19
- } from "./chunk-7HUUINPB.js";
20
- import "./chunk-LN76OGNR.js";
21
- import "./chunk-ZMLVR4J7.js";
21
+ } from "./chunk-OEADFFKO.js";
22
+ import "./chunk-Z2MRSS2I.js";
23
+ import "./chunk-ZMAJ2XFD.js";
22
24
  import "./chunk-KHO5WNTP.js";
23
25
  import {
24
26
  findConnectorConfig,
25
27
  loadConnectorFromPath
26
- } from "./chunk-NWLRJNXM.js";
27
- import "./chunk-G4CEELKO.js";
28
- import "./chunk-25CPWJA7.js";
29
- import "./chunk-56R2ER7K.js";
28
+ } from "./chunk-KSPMSRVU.js";
29
+ import "./chunk-KJLFGQQM.js";
30
+ import "./chunk-SILKSP2Y.js";
31
+ import "./chunk-NBYKLUF6.js";
30
32
  import "./chunk-H53QZQJI.js";
31
33
  import "./chunk-BEFVJ2OE.js";
32
- import "./chunk-VVFDU4IX.js";
33
- import "./chunk-HORHRHNG.js";
34
- import "./chunk-YYNXIUR2.js";
34
+ import "./chunk-MGTDQLJJ.js";
35
+ import "./chunk-4NHXLXSD.js";
36
+ import "./chunk-UMQ6NBQR.js";
35
37
  import {
36
38
  ensureHomeBin,
37
39
  homeBinPath
38
- } from "./chunk-IXOQDZWC.js";
40
+ } from "./chunk-GZGLCCEE.js";
39
41
 
40
42
  // src/cli/commands/upgrade.ts
41
43
  import { parseArgs } from "util";
@@ -53,10 +55,13 @@ async function run(argv) {
53
55
  targets: { type: "string" },
54
56
  connector: { type: "string" },
55
57
  project: { type: "string" },
56
- "dry-run": { type: "boolean", default: false }
58
+ "dry-run": { type: "boolean", default: false },
59
+ // Decorative-banner suppressor (no effect on command output bytes).
60
+ quiet: { type: "boolean", default: false }
57
61
  },
58
62
  allowPositionals: false
59
63
  });
64
+ maybePrintBanner({ quiet: values.quiet });
60
65
  const channel = values.channel;
61
66
  if (channel !== "stable" && channel !== "latest") {
62
67
  return fail(`invalid --channel "${channel}" (use stable|latest)`);
@@ -88,6 +93,7 @@ async function run(argv) {
88
93
  ...targets ? { targets } : {}
89
94
  };
90
95
  const result = method === "marketplace" ? await upgradeViaMarketplace(opts) : await syncConnector(opts);
96
+ result.connector = buildConnectorSummary(connector);
91
97
  print(renderInstallResult(result, "upgrade"));
92
98
  if (result.changes.some((c) => c.action === "warn")) hadWarn = true;
93
99
  print("");
@@ -127,4 +133,4 @@ Refreshed home binary pointer: ${binPath}`);
127
133
  export {
128
134
  run
129
135
  };
130
- //# sourceMappingURL=upgrade-55AFPJEF.js.map
136
+ //# sourceMappingURL=upgrade-TIBUOQNM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/commands/upgrade.ts"],"sourcesContent":["/**\n * cli/commands/upgrade — bring an agent-connector install current.\n *\n * `upgrade` (aliases: `update`, `sync`) consolidates the two former verbs into\n * ONE the way npm/brew pair `install` + `upgrade`, so there is a single verb to\n * learn for \"make everything current\". It:\n *\n * 1. re-renders the connector's config into every target host idempotently\n * (identical entries report \"skip\"), exactly like the old `sync` — this is\n * also the self-heal path: run `upgrade` to repair a drifted install; then\n * 2. refreshes the stable home-bin pointer and prints managed (never-silent)\n * update guidance for the chosen channel, exactly like the old `update`.\n *\n * When no connector config is resolvable it still does step 2, so `upgrade`\n * works as a pure tool-refresh from anywhere. By design agent-connector NEVER\n * silently auto-updates (docs/ARCHITECTURE.md §3 R1).\n */\n\nimport { parseArgs } from \"node:util\";\n\nimport { resolveCliEntry, syncConnector } from \"../../core/installer.js\";\nimport { parseInstallMethod, upgradeViaMarketplace } from \"../../core/marketplace.js\";\nimport { findConnectorConfig, loadConnectorFromPath } from \"../../core/load-connector.js\";\nimport { ensureHomeBin, homeBinPath } from \"../../core/paths.js\";\nimport {\n buildConnectorSummary,\n fail,\n maybePrintBanner,\n parseScope,\n parseTargets,\n print,\n renderInstallResult,\n} from \"../app.js\";\n\ntype Channel = \"stable\" | \"latest\";\n\n/** Heuristic: does the running CLI live under an npm-style node_modules tree? */\nfunction looksNpmManaged(): boolean {\n const entry = resolveCliEntry().replace(/\\\\/g, \"/\");\n return entry.includes(\"/node_modules/\");\n}\n\nexport async function run(argv: string[]): Promise<number> {\n const { values } = parseArgs({\n args: argv,\n options: {\n channel: { type: \"string\", default: \"stable\" },\n method: { type: \"string\", default: \"direct\" },\n scope: { type: \"string\", default: \"user\" },\n targets: { type: \"string\" },\n connector: { type: \"string\" },\n project: { type: \"string\" },\n \"dry-run\": { type: \"boolean\", default: false },\n // Decorative-banner suppressor (no effect on command output bytes).\n quiet: { type: \"boolean\", default: false },\n },\n allowPositionals: false,\n });\n\n maybePrintBanner({ quiet: values.quiet });\n\n const channel = values.channel;\n if (channel !== \"stable\" && channel !== \"latest\") {\n return fail(`invalid --channel \"${channel}\" (use stable|latest)`);\n }\n const ch: Channel = channel;\n\n const method = parseInstallMethod(values.method);\n if (method == null) {\n return fail(`invalid --method \"${values.method}\" (use direct|marketplace)`);\n }\n\n const scope = parseScope(values.scope);\n if (scope == null) return fail(`invalid --scope \"${values.scope}\" (use user|project)`);\n if (method === \"marketplace\" && scope !== \"user\") {\n return fail(\n \"--method marketplace supports --scope user only (project-scope plugin installs are deferred)\",\n );\n }\n\n let hadWarn = false;\n\n // ── Step 1: bring the connector's deploys current (former `sync`):\n // direct — idempotent re-render into every target host.\n // marketplace — re-stage the bundle + catalog in place, then drive the\n // host's update verb (claude `plugin update`, with a recorded\n // uninstall+install fallback); warns when connector.version is\n // unchanged since the recorded install (Claude caches a\n // versioned copy, so a same-version update silently no-ops).\n const projectDir = values.project ?? process.cwd();\n const configPath = values.connector ?? findConnectorConfig(projectDir);\n if (configPath) {\n const { connector, modulePath } = await loadConnectorFromPath(configPath);\n const targets = parseTargets(values.targets);\n const opts = {\n connector,\n modulePath,\n scope,\n projectDir,\n dryRun: values[\"dry-run\"],\n ...(targets ? { targets } : {}),\n };\n const result =\n method === \"marketplace\"\n ? await upgradeViaMarketplace(opts)\n : await syncConnector(opts);\n result.connector = buildConnectorSummary(connector);\n print(renderInstallResult(result, \"upgrade\"));\n if (result.changes.some((c) => c.action === \"warn\")) hadWarn = true;\n print(\"\");\n } else {\n print(\"upgrade: no connector config found — refreshing the tool only.\");\n print(\n \"(pass --connector <path> or run inside a project to also re-render host config.)\\n\",\n );\n }\n\n // ── Step 2: managed update guidance + home-bin pointer refresh (former `update`). ──\n print(\"agent-connector uses managed (explicit) updates — never silent\");\n print(\"auto-update — so one bad release can't break every project at once.\\n\");\n\n const dist = ch === \"stable\" ? \"latest\" : \"next\";\n if (looksNpmManaged()) {\n print(`To update the ${ch} channel, run:`);\n print(` npm i -g @ken-jo/agent-connector@${dist}`);\n } else {\n print(\n `This install does not look npm-managed. Update it the way you installed it,`,\n );\n print(`then re-run \\`agent-connector upgrade\\` to refresh the home pointer.`);\n print(`(npm installs would use: npm i -g @ken-jo/agent-connector@${dist})`);\n }\n\n // Refresh the stable home-bin pointer so hosts keep execing a working CLI.\n if (!values[\"dry-run\"]) {\n try {\n const binPath = ensureHomeBin(resolveCliEntry());\n print(`\\nRefreshed home binary pointer: ${binPath}`);\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n print(`\\n[warn] could not refresh home binary at ${homeBinPath()}: ${message}`);\n return 1;\n }\n }\n\n return hadWarn ? 1 : 0;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,SAAS,iBAAiB;AAmB1B,SAAS,kBAA2B;AAClC,QAAM,QAAQ,gBAAgB,EAAE,QAAQ,OAAO,GAAG;AAClD,SAAO,MAAM,SAAS,gBAAgB;AACxC;AAEA,eAAsB,IAAI,MAAiC;AACzD,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC3B,MAAM;AAAA,IACN,SAAS;AAAA,MACP,SAAS,EAAE,MAAM,UAAU,SAAS,SAAS;AAAA,MAC7C,QAAQ,EAAE,MAAM,UAAU,SAAS,SAAS;AAAA,MAC5C,OAAO,EAAE,MAAM,UAAU,SAAS,OAAO;AAAA,MACzC,SAAS,EAAE,MAAM,SAAS;AAAA,MAC1B,WAAW,EAAE,MAAM,SAAS;AAAA,MAC5B,SAAS,EAAE,MAAM,SAAS;AAAA,MAC1B,WAAW,EAAE,MAAM,WAAW,SAAS,MAAM;AAAA;AAAA,MAE7C,OAAO,EAAE,MAAM,WAAW,SAAS,MAAM;AAAA,IAC3C;AAAA,IACA,kBAAkB;AAAA,EACpB,CAAC;AAED,mBAAiB,EAAE,OAAO,OAAO,MAAM,CAAC;AAExC,QAAM,UAAU,OAAO;AACvB,MAAI,YAAY,YAAY,YAAY,UAAU;AAChD,WAAO,KAAK,sBAAsB,OAAO,uBAAuB;AAAA,EAClE;AACA,QAAM,KAAc;AAEpB,QAAM,SAAS,mBAAmB,OAAO,MAAM;AAC/C,MAAI,UAAU,MAAM;AAClB,WAAO,KAAK,qBAAqB,OAAO,MAAM,4BAA4B;AAAA,EAC5E;AAEA,QAAM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C/C,YAAM;AAAA,iCAAoC,OAAO,EAAE;AAAA,IACrD,SAAS,KAAK;AACZ,YAAM,UAAU,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AAC/D,YAAM;AAAA,0CAA6C,YAAY,CAAC,KAAK,OAAO,EAAE;AAC9E,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO,UAAU,IAAI;AACvB;","names":[]}
@@ -11,7 +11,7 @@ import {
11
11
  import {
12
12
  fail,
13
13
  print
14
- } from "./chunk-7HUUINPB.js";
14
+ } from "./chunk-OEADFFKO.js";
15
15
 
16
16
  // src/cli/commands/usage.ts
17
17
  import { writeFileSync } from "fs";
@@ -321,4 +321,4 @@ export {
321
321
  parseSince,
322
322
  run
323
323
  };
324
- //# sourceMappingURL=usage-3PB3WZSL.js.map
324
+ //# sourceMappingURL=usage-VEVBWPLS.js.map
@@ -1,20 +1,20 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runUsageEvent
4
- } from "./chunk-BLTVZACS.js";
4
+ } from "./chunk-EHP7WISI.js";
5
5
  import "./chunk-OP4KBXUO.js";
6
- import "./chunk-LN76OGNR.js";
7
- import "./chunk-ZMLVR4J7.js";
8
- import "./chunk-LAIITCMW.js";
6
+ import "./chunk-Z2MRSS2I.js";
7
+ import "./chunk-ZMAJ2XFD.js";
8
+ import "./chunk-I5TO42QC.js";
9
9
  import "./chunk-KHO5WNTP.js";
10
- import "./chunk-4FWETID5.js";
11
- import "./chunk-NWLRJNXM.js";
12
- import "./chunk-G4CEELKO.js";
13
- import "./chunk-25CPWJA7.js";
14
- import "./chunk-56R2ER7K.js";
15
- import "./chunk-HORHRHNG.js";
16
- import "./chunk-YYNXIUR2.js";
17
- import "./chunk-IXOQDZWC.js";
10
+ import "./chunk-IVAWP6HH.js";
11
+ import "./chunk-KSPMSRVU.js";
12
+ import "./chunk-KJLFGQQM.js";
13
+ import "./chunk-SILKSP2Y.js";
14
+ import "./chunk-NBYKLUF6.js";
15
+ import "./chunk-4NHXLXSD.js";
16
+ import "./chunk-UMQ6NBQR.js";
17
+ import "./chunk-GZGLCCEE.js";
18
18
 
19
19
  // src/cli/commands/usage-event.ts
20
20
  import { parseArgs } from "util";
@@ -50,4 +50,4 @@ async function run(argv) {
50
50
  export {
51
51
  run
52
52
  };
53
- //# sourceMappingURL=usage-event-KD5FW6W4.js.map
53
+ //# sourceMappingURL=usage-event-GRQE7XWT.js.map
@@ -9,14 +9,14 @@ import {
9
9
  BaseAdapter,
10
10
  renderSkillMd,
11
11
  renderSubagentMd
12
- } from "./chunk-VVFDU4IX.js";
12
+ } from "./chunk-MGTDQLJJ.js";
13
13
  import {
14
14
  buildHomeBinHookCommand,
15
15
  buildWrappedStdio,
16
16
  isHomeBinHookCommand
17
- } from "./chunk-HORHRHNG.js";
18
- import "./chunk-YYNXIUR2.js";
19
- import "./chunk-IXOQDZWC.js";
17
+ } from "./chunk-4NHXLXSD.js";
18
+ import "./chunk-UMQ6NBQR.js";
19
+ import "./chunk-GZGLCCEE.js";
20
20
 
21
21
  // src/adapters/vscode-copilot/index.ts
22
22
  import { existsSync } from "fs";
@@ -202,6 +202,15 @@ var VSCodeCopilotAdapter = class extends BaseAdapter {
202
202
  if (connector.hookEvents.length === 0) {
203
203
  return [{ platform: this.id, action: "skip", detail: "connector declares no hooks" }];
204
204
  }
205
+ if (ctx.scope === "user") {
206
+ return [
207
+ {
208
+ platform: this.id,
209
+ action: "warn",
210
+ detail: "VS Code Copilot hooks are workspace-scoped (.github/hooks); rerun with --scope project to install hooks."
211
+ }
212
+ ];
213
+ }
205
214
  const hooksPath = this.getHookConfigPath(ctx);
206
215
  const symlink = this.symlinkPathWarning(hooksPath);
207
216
  if (symlink) return [symlink];
@@ -507,6 +516,12 @@ var VSCodeCopilotAdapter = class extends BaseAdapter {
507
516
  if (hookEvents.length === 0) {
508
517
  return { status: "OK", detail: "no hooks declared" };
509
518
  }
519
+ if (ctx.scope === "user") {
520
+ return {
521
+ status: "OK",
522
+ detail: "hooks are workspace-scoped; install them with --scope project"
523
+ };
524
+ }
510
525
  const file = this.readJson(hooksPath);
511
526
  if (!file) return { status: "FAIL", detail: `not found: ${hooksPath}` };
512
527
  if (file.version !== VSCODE_HOOKS_VERSION) {
@@ -748,4 +763,4 @@ export {
748
763
  adapter,
749
764
  vscode_copilot_default as default
750
765
  };
751
- //# sourceMappingURL=vscode-copilot-LU5NC4ZS.js.map
766
+ //# sourceMappingURL=vscode-copilot-NIMH2DGU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/adapters/vscode-copilot/index.ts"],"sourcesContent":["/**\n * adapters/vscode-copilot — VS Code Copilot platform adapter for agent-connector.\n *\n * Generalized from context-mode's proven VS Code Copilot adapter: the served\n * identity is now `ctx.connector` (not a hardcoded \"context-mode\"), and every\n * hook command points at the single stable home binary\n * (`buildHomeBinHookCommand`) so one framework update propagates everywhere.\n *\n * VS Code Copilot is a json-stdio host (report §2 \"Platform Integration Matrix\"):\n * - MCP servers: workspace (project) scope → <projectDir>/.vscode/mcp.json;\n * user-profile scope → ~/.vscode/mcp.json. The ROOT KEY is \"servers\" (NOT\n * \"mcpServers\" — a Cursor footgun VS Code deliberately diverges on), with an\n * optional sibling \"inputs\" array. The file is officially JSONC, but a plain\n * JSON write is valid JSONC, so we write strict JSON.\n * - Hooks (Preview, ~v1.110): discovered from .github/hooks/*.json (and from\n * Claude-compatible .claude/settings.json). We write a per-connector file at\n * <projectDir>/.github/hooks/<connector-id>.json shaped like the Copilot\n * hooks schema: `{ version: 1, hooks: { <PascalCaseEvent>: [ { type:\n * \"command\", command } ] } }`. The top-level `version: 1` is REQUIRED — the\n * Copilot runtime rejects a version-less file and no hooks fire. Unlike\n * Claude, each entry is a FLAT `{ type, command }` object (no `{ matcher,\n * hooks:[...] }` wrapper). Matchers are parsed but IGNORED (all hooks fire\n * on all tools) — we still persist a connector-declared matcher for parity.\n * - Reply: Claude-compatible JSON on stdout (exit 0). A `hookSpecificOutput`\n * object keyed by PascalCase `hookEventName` carries permissionDecision\n * (deny|ask) + permissionDecisionReason, additionalContext, and (PreToolUse)\n * updatedInput. This mirrors the claude-code adapter exactly.\n *\n * Env interpolation: VS Code supports its own `${env:VAR}` (and `${input:VAR}`)\n * native interpolation, so env/header/url values are rewritten to the native\n * `${env:VAR}` token rather than baked into the file. The token is documented at\n * vscodeEnvToken below.\n */\n\nimport { existsSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\n\nimport { BaseAdapter } from \"../base.js\";\nimport type { Adapter, HookReply, InstallContext, NormalizedEvent } from \"../spi.js\";\nimport type {\n ChangeRecord,\n CommandDef,\n DetectedPlatform,\n HealthCheck,\n HookEventName,\n HookParadigm,\n HookResponse,\n NotificationEvent,\n PlatformCapabilities,\n PlatformId,\n PostToolUseEvent,\n PostCompactEvent,\n PreCompactEvent,\n PreToolUseEvent,\n ServerDef,\n SessionEndEvent,\n SessionStartEvent,\n StopEvent,\n SubagentStartEvent,\n SubagentStopEvent,\n Transport,\n UserPromptSubmitEvent,\n} from \"../../core/types.js\";\nimport { rewriteEnvRefs } from \"../../core/interpolate.js\";\nimport {\n buildHomeBinHookCommand,\n buildWrappedStdio,\n isHomeBinHookCommand,\n} from \"../../core/spawn.js\";\nimport { renderSkillMd, renderSubagentMd } from \"../claude-code/render.js\";\nimport { normalizeSessionSource } from \"../claude-code/wire.js\";\n\nconst HOST: PlatformId = \"vscode-copilot\";\n\n/**\n * VS Code's MCP root key is \"servers\" — NOT \"mcpServers\". This is the single\n * most common VS Code Copilot integration bug (report §1): a config written\n * under \"mcpServers\" is silently ignored.\n */\nconst MCP_ROOT_KEY = \"servers\";\n\n/** Top-level version the Copilot hooks runtime requires; a version-less file is rejected. */\nconst VSCODE_HOOKS_VERSION = 1;\n\n/**\n * VS Code Copilot reads PascalCase hook event names from its hooks file —\n * identical to Claude Code. Only the events VS Code actually delivers are\n * registered; everything else has no Copilot equivalent and is reported as a\n * warn/skip at install time.\n *\n * VS Code's official Hook Events table (microsoft/vscode-copilot-chat:\n * assets/prompts/skills/agent-customization/references/hooks.md) is, verbatim\n * (PascalCase): SessionStart, UserPromptSubmit, PreToolUse, PostToolUse,\n * PreCompact, SubagentStart, SubagentStop, Stop — all eight now wired 1:1.\n * SessionEnd, Notification, PermissionRequest and PostToolUseFailure are NOT in\n * the list — they have no VS Code analog and skip-warn.\n */\nconst EVENT_MAP: Partial<Record<HookEventName, string>> = {\n PreToolUse: \"PreToolUse\",\n PostToolUse: \"PostToolUse\",\n PreCompact: \"PreCompact\",\n SessionStart: \"SessionStart\",\n UserPromptSubmit: \"UserPromptSubmit\",\n Stop: \"Stop\",\n SubagentStart: \"SubagentStart\",\n SubagentStop: \"SubagentStop\",\n};\n\n/** A single VS Code Copilot native hook entry — a flat command object. */\ninterface VSCodeHookEntry {\n type: \"command\";\n command: string;\n}\n\n/** The shape of a VS Code Copilot .github/hooks/<connector>.json file. */\ninterface VSCodeHooksFile {\n version?: number;\n hooks?: Record<string, VSCodeHookEntry[]>;\n}\n\n/** Native MCP server entry shapes VS Code accepts under `servers`. */\ninterface VSCodeStdioServer {\n type: \"stdio\";\n command: string;\n args?: string[];\n env?: Record<string, string>;\n cwd?: string;\n}\ninterface VSCodeHttpServer {\n type: \"http\" | \"sse\";\n url: string;\n headers?: Record<string, string>;\n}\n\n/**\n * Raw VS Code Copilot hook stdin payload. Field names are PRIMARY-SOURCE\n * VERIFIED against the official docs (https://code.visualstudio.com/docs/copilot/\n * customization/hooks — \"Hook input and output\"). Only fields the host actually\n * serializes are declared here; the snake_case shape happens to align with the\n * Claude dialect but the field SET is VS Code's own.\n *\n * Common input fields (every event): timestamp, cwd, session_id,\n * hook_event_name, transcript_path. There is NO `workspace_roots` field — the\n * old `workspace_roots[0]` projectDir fallback read a host-nonexistent field\n * (removed; getProjectDir now relies on `cwd` only).\n */\ninterface VSCodeWireInput {\n session_id?: string;\n transcript_path?: string;\n cwd?: string;\n hook_event_name?: string;\n\n // tool events. PostToolUse fires ONLY after a tool completes SUCCESSFULLY and\n // sends { tool_name, tool_input, tool_use_id, tool_response } — there is NO\n // `tool_output` and NO `error_message` field, so the old isError/tool_output/\n // error_message reads were dead (removed). Primary source: docs \"PostToolUse\n // input\" — `tool_response` is the only result field.\n tool_name?: string;\n tool_input?: Record<string, unknown>;\n tool_response?: unknown;\n tool_use_id?: string;\n\n // SessionStart\n source?: string;\n // SessionEnd\n reason?: string;\n // UserPromptSubmit\n prompt?: string;\n // PreCompact\n trigger?: string;\n // Stop / SubagentStop\n stop_hook_active?: boolean;\n // Notification\n message?: string;\n\n // SubagentStart / SubagentStop. Per docs \"SubagentStart input\" /\n // \"SubagentStop input\" the payload is EXACTLY { agent_id, agent_type } (+\n // stop_hook_active on Stop). There is NO `agent_transcript_path` and NO\n // `last_assistant_message` on this host — those reads were dead (removed).\n agent_id?: string;\n agent_type?: string;\n\n /** Injected by the entrypoint so the runtime knows which connector to dispatch. */\n connector?: string;\n}\n\nexport class VSCodeCopilotAdapter extends BaseAdapter implements Adapter {\n readonly id: PlatformId = HOST;\n readonly name = \"VS Code Copilot\";\n readonly paradigm: HookParadigm = \"json-stdio\";\n\n readonly capabilities: PlatformCapabilities = {\n // Memory surface: AGENTS.md-first managed block via the BaseAdapter default\n // (memoryTargets: project <projectDir>/AGENTS.md; user scope where documented).\n supportsMemory: true,\n // VS Code Copilot's Preview hooks runtime delivers all eight events in its\n // official Hook Events table: Pre/PostToolUse, PreCompact, SessionStart,\n // UserPromptSubmit, Stop, and Subagent Start/Stop. PostToolUse, UserPromptSubmit,\n // Stop and SubagentStop are BLOCKABLE via the top-level {decision:\"block\"} shape;\n // PreToolUse permission flows through hookSpecificOutput.permissionDecision (per\n // the Output Contract — see formatReply).\n preToolUse: true,\n postToolUse: true,\n preCompact: true,\n sessionStart: true,\n sessionEnd: false,\n userPromptSubmit: true,\n stop: true,\n notification: false,\n // Newer events: VS Code's Preview hooks runtime delivers SubagentStart /\n // SubagentStop (Claude-compatible). permissionRequest / postToolUseFailure\n // stay unset — no VS Code analog exists; install reports the skip-warn.\n subagentStart: true,\n subagentStop: true,\n // PreToolUse can rewrite tool input (updatedInput) but a PostToolUse hook\n // cannot rewrite already-emitted tool output — same as Claude/Cursor.\n canModifyArgs: true,\n canModifyOutput: false,\n canInjectSessionContext: true,\n transports: [\"stdio\", \"http\", \"sse\"],\n // Server env/url use VS Code's NATIVE ${env:VAR} interpolation\n // (rewriteEnvRefs) — the token survives into mcp.json, never a baked\n // literal — so the installer's unset-env-ref bake warn does not apply here.\n nativeServerEnvInterpolation: true,\n // Content surfaces: VS Code Copilot authors prompt files, Agent Skills, and\n // chat-mode agent files under the workspace .github/ tree (see content-file\n // path helpers below). All three are supported.\n supportsCommands: true,\n supportsSkills: true,\n supportsSubagents: true,\n };\n\n // ── Detection ────────────────────────────────────────────────────────────\n\n detectInstalled(projectDir: string): DetectedPlatform {\n const userDir = join(homedir(), \".vscode\");\n const userMcp = join(userDir, \"mcp.json\");\n const userInsidersDir = join(homedir(), \".vscode-insiders\");\n const projectVscode = join(projectDir, \".vscode\");\n const projectMcp = join(projectVscode, \"mcp.json\");\n\n const projInstalled = existsSync(projectMcp) || existsSync(projectVscode);\n const userInstalled =\n existsSync(userMcp) || existsSync(userDir) || existsSync(userInsidersDir);\n const installed = projInstalled || userInstalled;\n\n // Report the scope/path/reason for the marker that actually matched, so a\n // project-only install isn't misreported as a (non-existent) user install.\n const scope = projInstalled && !userInstalled ? \"project\" : \"user\";\n const configPath = scope === \"project\" ? projectMcp : userMcp;\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 ? scope === \"project\"\n ? `found project VS Code config at ${projectVscode}`\n : `found VS Code config under ${userDir}`\n : `no VS Code config at ${userDir}`,\n confidence: installed ? \"high\" : \"low\",\n };\n }\n\n // ── Native paths ─────────────────────────────────────────────────────────\n\n /**\n * Config dir choice (documented per task brief): project (workspace) scope →\n * <projectDir>/.vscode; user-profile scope → ~/.vscode. The real VS Code user\n * profile dir is OS-specific and not reliably discoverable without launching\n * VS Code, so ~/.vscode is the reasonable, cross-OS, no-launch choice — it is\n * also where \"MCP: Open User Configuration\" writes on a default profile.\n */\n getConfigDir(ctx: InstallContext): string {\n return ctx.scope === \"project\"\n ? join(ctx.projectDir, \".vscode\")\n : join(homedir(), \".vscode\");\n }\n\n /** MCP server registration lives in <configDir>/mcp.json under root \"servers\". */\n getServerConfigPath(ctx: InstallContext): string {\n return join(this.getConfigDir(ctx), \"mcp.json\");\n }\n\n /**\n * Hook registration lives in the workspace-discovered .github/hooks tree,\n * which VS Code Copilot scans for *.json hook files. We write one file per\n * connector so installs/uninstalls never clobber another connector's hooks.\n * Anchored on projectDir for both scopes — .github/hooks is a workspace\n * concept (there is no user-profile equivalent in the Copilot hooks schema).\n */\n getHookConfigPath(ctx: InstallContext): string {\n return join(ctx.projectDir, \".github\", \"hooks\", `${ctx.connector.id}.json`);\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 vscode-copilot\"\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 VS Code's native `servers` entry. */\n private renderServerEntry(\n ctx: InstallContext,\n server: ServerDef,\n ): VSCodeStdioServer | VSCodeHttpServer {\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 ({ command, args } = buildWrappedStdio(ctx, server, this.id, command, args));\n\n const entry: VSCodeStdioServer = { type: \"stdio\", command: this.rewrite(command) };\n if (args.length > 0) entry.args = args.map((a) => this.rewrite(a));\n const env = this.renderEnv(server.env);\n if (env) entry.env = env;\n if (server.cwd) entry.cwd = this.rewrite(server.cwd);\n return entry;\n }\n\n // Remote transports — VS Code registers a URL. An explicit `sse` forces an\n // SSE-only connection; `http` (Streamable HTTP) auto-falls-back to SSE when a\n // server doesn't support it (code.visualstudio.com/docs/agents/reference/mcp-configuration).\n const entry: VSCodeHttpServer = {\n type: transport === \"sse\" ? \"sse\" : \"http\",\n url: this.rewrite(server.url ?? \"\"),\n };\n const headers = this.renderEnv(server.headers);\n if (headers) entry.headers = headers;\n return entry;\n }\n\n /**\n * Render env/header values. VS Code supports its own `${env:VAR}` native\n * interpolation, so translate `${env:VAR}` refs to that native token rather\n * than baking secrets into the file. Literals pass through unchanged.\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 const out: Record<string, string> = {};\n for (const [k, v] of Object.entries(env)) out[k] = this.rewrite(v);\n return out;\n }\n\n /** Translate `${env:VAR(:-default)}` to VS Code's native `${env:VAR}` token. */\n private rewrite(value: string): string {\n return rewriteEnvRefs(value, vscodeEnvToken);\n }\n\n // ── Hook install / uninstall ─────────────────────────────────────────────\n\n installHooks(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.platforms[HOST]?.hooks === false) {\n return [\n { platform: this.id, action: \"skip\", detail: \"hooks disabled for vscode-copilot\" },\n ];\n }\n if (connector.hookEvents.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no hooks\" }];\n }\n if (ctx.scope === \"user\") {\n return [\n {\n platform: this.id,\n action: \"warn\",\n detail:\n \"VS Code Copilot hooks are workspace-scoped (.github/hooks); rerun with --scope project to install hooks.\",\n },\n ];\n }\n\n const hooksPath = this.getHookConfigPath(ctx);\n const symlink = this.symlinkPathWarning(hooksPath);\n if (symlink) return [symlink];\n\n const file = this.readJson<VSCodeHooksFile>(hooksPath) ?? {};\n const __skip = this.malformedHookRootSkip(hooksPath, (file as Record<string, unknown>).hooks);\n if (__skip) return [__skip];\n const hooks = (file.hooks ??= {});\n\n const changes: ChangeRecord[] = [];\n let mutated = false;\n\n for (const event of connector.hookEvents) {\n const vscodeEvent = EVENT_MAP[event];\n if (!vscodeEvent) {\n // No VS Code Copilot equivalent for this normalized event — report+skip.\n changes.push({\n platform: this.id,\n action: \"warn\",\n path: hooksPath,\n detail: `${event} has no VS Code Copilot hook equivalent — skipped`,\n });\n continue;\n }\n\n const command = buildHomeBinHookCommand(ctx.homeBinPath, HOST, event, connector.id);\n const entry: VSCodeHookEntry = { type: \"command\", command };\n\n const bucket = (hooks[vscodeEvent] ??= []);\n const existingIdx = bucket.findIndex((e) => this.isOurCommand(e.command, ctx));\n\n if (existingIdx >= 0) {\n if (JSON.stringify(bucket[existingIdx]) === JSON.stringify(entry)) {\n changes.push({\n platform: this.id,\n action: \"skip\",\n path: hooksPath,\n detail: `hooks.${vscodeEvent} already registered`,\n });\n continue;\n }\n bucket[existingIdx] = entry;\n changes.push({\n platform: this.id,\n action: \"update\",\n path: hooksPath,\n detail: `hooks.${vscodeEvent}`,\n });\n } else {\n bucket.push(entry);\n changes.push({\n platform: this.id,\n action: \"create\",\n path: hooksPath,\n detail: `hooks.${vscodeEvent}`,\n });\n }\n mutated = true;\n }\n\n if (mutated) {\n // The top-level version is REQUIRED — a version-less file is rejected and\n // no hooks fire. Always (re)assert it when we write.\n file.version = VSCODE_HOOKS_VERSION;\n this.writeJson(hooksPath, file, ctx.dryRun);\n }\n return changes;\n }\n\n uninstallHooks(ctx: InstallContext): ChangeRecord[] {\n const hooksPath = this.getHookConfigPath(ctx);\n const symlink = this.symlinkPathWarning(hooksPath);\n if (symlink) return [symlink];\n\n const file = this.readJson<VSCodeHooksFile>(hooksPath);\n const hooks = file?.hooks;\n if (!file || !hooks) {\n return [\n {\n platform: this.id,\n action: \"skip\",\n path: hooksPath,\n detail: \"no hooks section present\",\n },\n ];\n }\n\n const changes: ChangeRecord[] = [];\n let mutated = false;\n\n for (const vscodeEvent of Object.keys(hooks)) {\n const bucket = hooks[vscodeEvent];\n if (!Array.isArray(bucket)) continue;\n\n const before = bucket.length;\n // Only strip OUR connector's home-bin commands — never another\n // connector's (isHomeBinHookCommand is id-anchored).\n const next = bucket.filter((e) => !this.isOurCommand(e.command, ctx));\n const removed = before - next.length;\n if (removed > 0) {\n if (next.length > 0) hooks[vscodeEvent] = next;\n else delete hooks[vscodeEvent];\n changes.push({\n platform: this.id,\n action: \"remove\",\n path: hooksPath,\n detail: `hooks.${vscodeEvent} (${removed})`,\n });\n mutated = true;\n }\n }\n\n if (mutated) {\n // The hooks file is connector-OWNED (<connector-id>.json), so when our\n // strip leaves it with NO hooks we must DELETE the whole file rather than\n // rewrite a `{ \"version\": 1, \"hooks\": {} }` shell — an empty shell is an\n // orphan per-connector file that lingers after uninstall. A non-empty\n // result still belongs to us, so we rewrite it as before. dryRun reports\n // the would-be remove without mutating the filesystem.\n if (Object.keys(hooks).length === 0) {\n changes.push(\n this.removeManagedFile(\n hooksPath,\n ctx.dryRun,\n \"removed empty connector hooks file\",\n \"no hooks file present\",\n ),\n );\n // Clean up the parent .github/hooks dir only when it is now empty (it is\n // a per-connector tree; leave it in place if other connectors' files\n // remain).\n changes.push(this.removeDirIfEmpty(dirname(hooksPath), ctx.dryRun));\n } else {\n this.writeJson(hooksPath, file, ctx.dryRun);\n }\n }\n if (changes.length === 0) {\n changes.push({\n platform: this.id,\n action: \"skip\",\n path: hooksPath,\n detail: \"no matching hook entries\",\n });\n }\n return changes;\n }\n\n /** True when a hook command references our home binary AND this connector id\n * (anchored so a shared-prefix id can't collide — see isHomeBinHookCommand). */\n private isOurCommand(command: string | undefined, ctx: InstallContext): boolean {\n return isHomeBinHookCommand(command, ctx.homeBinPath, ctx.connector.id);\n }\n\n // ── Content surfaces: commands / skills / subagents ──────────────────────\n // CONTENT-ONLY: pure native-file writers under the workspace .github/ tree\n // ({prompts,skills,agents}). No runtime dispatch, no home-bin pointer, no\n // telemetry wrap. Each method is idempotent (byte-identical → skip) via\n // BaseAdapter.writeContentFile and reversible via removeContentFile. Honors\n // platforms[\"vscode-copilot\"] per-surface false to skip.\n //\n // SHARED .github TREE: vscode-copilot, copilot-cli, and jetbrains-copilot all\n // write under the SAME project <projectDir>/.github tree. The rendered content\n // is identical and idempotent across those connectors, and uninstall here only\n // removes the files THIS connector declared — never another writer's files.\n //\n // SCOPE NOTE: .github is a workspace concept; the Copilot prompt/skill/agent\n // discovery is workspace-rooted and there is no documented per-user .github\n // authoring location. VS Code's reliable per-user authoring root is the user\n // profile prompts dir under the OS app-data path, which is not discoverable\n // without launching VS Code. So for user scope we anchor on\n // <homedir>/.config/github-copilot (the documented cross-OS Copilot user dir;\n // see contentRootDir) rather than fabricating a profile path. Project scope is\n // the primary, fully-supported path.\n\n /**\n * Root of the content tree. Project (workspace) scope → <projectDir>/.github,\n * which VS Code Copilot scans for prompt/skill/agent files (and which\n * copilot-cli + jetbrains-copilot share). User scope has no documented\n * workspace-independent .github equivalent, so we anchor on the documented\n * cross-OS Copilot user dir ~/.config/github-copilot to keep user-scope writes\n * deterministic and removable.\n */\n private contentRootDir(ctx: InstallContext): string {\n return ctx.scope === \"project\"\n ? join(ctx.projectDir, \".github\")\n : join(homedir(), \".config\", \"github-copilot\");\n }\n\n private promptsDir(ctx: InstallContext): string {\n return join(this.contentRootDir(ctx), \"prompts\");\n }\n private skillsDir(ctx: InstallContext): string {\n // Project scope: .github/skills (a VS Code-documented project location).\n // User scope: ~/.agents/skills — the vendor-neutral Agent Skills location\n // VS Code reads for personal skills. Deliberately NOT ~/.copilot/skills\n // (also read): copilot-cli's adapter owns that dir, and two adapters\n // writing the same SKILL.md would fight over ownership at uninstall.\n // (~/.config/github-copilot/skills, the 0.1.0 target, is read by nothing.)\n return ctx.scope === \"project\"\n ? join(this.contentRootDir(ctx), \"skills\")\n : join(homedir(), \".agents\", \"skills\");\n }\n private agentsDir(ctx: InstallContext): string {\n return join(this.contentRootDir(ctx), \"agents\");\n }\n\n /** Native command file path: <ghDir>/prompts/<name>.prompt.md. */\n private commandPath(ctx: InstallContext, name: string): string {\n return join(this.promptsDir(ctx), `${name}.prompt.md`);\n }\n /** Native skill dir: <ghDir>/skills/<name>. */\n private skillDir(ctx: InstallContext, name: string): string {\n return join(this.skillsDir(ctx), name);\n }\n /** Native subagent file path: <ghDir>/agents/<name>.agent.md. */\n private subagentPath(ctx: InstallContext, name: string): string {\n return join(this.agentsDir(ctx), `${name}.agent.md`);\n }\n\n // ── Commands ──────────────────────────────────────────────────────────────\n\n override installCommands(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.platforms[HOST]?.commands === false) {\n return [{ platform: this.id, action: \"skip\", detail: \"commands disabled for vscode-copilot\" }];\n }\n if (connector.commands.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no commands\" }];\n }\n return connector.commands.map((cmd) =>\n this.writeContentFile(\n this.commandPath(ctx, cmd.name),\n this.renderCommand(cmd),\n ctx.dryRun,\n ),\n );\n }\n\n override uninstallCommands(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.commands.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no commands\" }];\n }\n return connector.commands.map((cmd) =>\n this.removeContentFile(this.commandPath(ctx, cmd.name), ctx.dryRun),\n );\n }\n\n /** Render a VS Code Copilot prompt file: md+frontmatter(description, tools, model, argument-hint). */\n private renderCommand(cmd: CommandDef): string {\n const frontmatter: Record<string, unknown> = {};\n if (cmd.description !== undefined) frontmatter.description = cmd.description;\n // VS Code prompt files express tool access as a `tools` array, sourced from\n // the portable tools.allow policy.\n const allow = cmd.tools?.allow;\n if (allow && allow.length > 0) frontmatter.tools = [...allow];\n if (cmd.model !== undefined) frontmatter.model = cmd.model;\n if (cmd.argumentHint !== undefined) frontmatter[\"argument-hint\"] = cmd.argumentHint;\n if (cmd.extra) Object.assign(frontmatter, cmd.extra);\n return this.renderFrontmatterMd(frontmatter, cmd.prompt);\n }\n\n // ── Skills ────────────────────────────────────────────────────────────────\n\n override installSkills(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.platforms[HOST]?.skills === false) {\n return [{ platform: this.id, action: \"skip\", detail: \"skills disabled for vscode-copilot\" }];\n }\n if (connector.skills.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no skills\" }];\n }\n const changes: ChangeRecord[] = [];\n for (const skill of connector.skills) {\n const dir = this.skillDir(ctx, skill.name);\n changes.push(\n this.writeContentFile(join(dir, \"SKILL.md\"), renderSkillMd(skill), ctx.dryRun),\n );\n // Bundle any resource files beside SKILL.md (relative path → contents).\n // Defense-in-depth: skip+warn on any key that escapes the skill dir\n // (config-time validation already rejects these, but never trust input).\n for (const [rel, contents] of Object.entries(skill.resources ?? {})) {\n const target = this.resolveWithin(dir, rel);\n if (target === null) {\n changes.push({\n platform: this.id,\n action: \"warn\",\n detail: `skill resource \"${rel}\" escapes the skill dir; skipped`,\n });\n continue;\n }\n changes.push(this.writeContentFile(target, contents, ctx.dryRun));\n }\n }\n return changes;\n }\n\n override uninstallSkills(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.skills.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no skills\" }];\n }\n const changes: ChangeRecord[] = [];\n for (const skill of connector.skills) {\n const dir = this.skillDir(ctx, skill.name);\n // Remove only the files we wrote (SKILL.md + declared resources), then the\n // skill dir itself when we own its full contents.\n changes.push(this.removeContentFile(join(dir, \"SKILL.md\"), ctx.dryRun));\n for (const rel of Object.keys(skill.resources ?? {})) {\n const target = this.resolveWithin(dir, rel);\n if (target === null) continue; // never delete outside the skill dir\n changes.push(this.removeContentFile(target, ctx.dryRun));\n }\n // Only remove the skill dir when WE own its full contents — never rm -rf a\n // dir that still holds user-added / sibling-tool / shared files.\n changes.push(this.removeDirIfEmpty(dir, ctx.dryRun));\n }\n return changes;\n }\n\n // ── Subagents ───────────────────────────────────────────────────────────────\n\n override installSubagents(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.platforms[HOST]?.subagents === false) {\n return [{ platform: this.id, action: \"skip\", detail: \"subagents disabled for vscode-copilot\" }];\n }\n if (connector.subagents.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no subagents\" }];\n }\n return connector.subagents.map((agent) =>\n this.writeContentFile(\n this.subagentPath(ctx, agent.name),\n renderSubagentMd(agent),\n ctx.dryRun,\n ),\n );\n }\n\n override uninstallSubagents(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.subagents.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no subagents\" }];\n }\n return connector.subagents.map((agent) =>\n this.removeContentFile(this.subagentPath(ctx, agent.name), ctx.dryRun),\n );\n }\n\n // ── Diagnostics ──────────────────────────────────────────────────────────\n\n override getHealthChecks(ctx: InstallContext): readonly HealthCheck[] {\n const mcpPath = this.getServerConfigPath(ctx);\n const hooksPath = this.getHookConfigPath(ctx);\n const connectorId = ctx.connector.id;\n const homeBin = ctx.homeBinPath;\n const hookEvents = ctx.connector.hookEvents;\n const checks: HealthCheck[] = [\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}: hook command registered`,\n check: () => {\n if (hookEvents.length === 0) {\n return { status: \"OK\", detail: \"no hooks declared\" };\n }\n if (ctx.scope === \"user\") {\n return {\n status: \"OK\",\n detail: \"hooks are workspace-scoped; install them with --scope project\",\n };\n }\n const file = this.readJson<VSCodeHooksFile>(hooksPath);\n if (!file) return { status: \"FAIL\", detail: `not found: ${hooksPath}` };\n if (file.version !== VSCODE_HOOKS_VERSION) {\n return {\n status: \"FAIL\",\n detail: `${hooksPath} missing required \"version\": ${VSCODE_HOOKS_VERSION} — Copilot rejects it`,\n };\n }\n const registered = Object.values(file.hooks ?? {}).some((entries) =>\n (entries ?? []).some((e) =>\n isHomeBinHookCommand(e.command, homeBin, connectorId),\n ),\n );\n return registered\n ? { status: \"OK\", detail: \"hook command present\" }\n : { status: \"FAIL\", detail: `no hook for ${connectorId} in ${hooksPath}` };\n },\n },\n ];\n\n // Content-surface checks: only assert presence of the files this connector\n // declares (skip silently for surfaces it never asked for).\n for (const cmd of ctx.connector.commands) {\n const p = this.commandPath(ctx, cmd.name);\n checks.push({\n name: `${this.name}: command ${cmd.name} present`,\n check: () =>\n existsSync(p) ? { status: \"OK\", detail: p } : { status: \"FAIL\", detail: `not found: ${p}` },\n });\n }\n for (const skill of ctx.connector.skills) {\n const p = join(this.skillDir(ctx, skill.name), \"SKILL.md\");\n checks.push({\n name: `${this.name}: skill ${skill.name} present`,\n check: () =>\n existsSync(p) ? { status: \"OK\", detail: p } : { status: \"FAIL\", detail: `not found: ${p}` },\n });\n }\n for (const agent of ctx.connector.subagents) {\n const p = this.subagentPath(ctx, agent.name);\n checks.push({\n name: `${this.name}: subagent ${agent.name} present`,\n check: () =>\n existsSync(p) ? { status: \"OK\", detail: p } : { status: \"FAIL\", detail: `not found: ${p}` },\n });\n }\n return checks;\n }\n\n // ── Runtime: parse VS Code Copilot stdin JSON → normalized event ──────────\n\n parseEvent(event: HookEventName, raw: unknown): NormalizedEvent {\n const input = (raw ?? {}) as VSCodeWireInput;\n const connectorId = typeof input.connector === \"string\" ? input.connector : \"\";\n const sessionId = extractSessionId(input);\n const projectDir = this.getProjectDir(input);\n\n const base = {\n hostPlatform: HOST,\n connectorId,\n sessionId,\n raw,\n ...(projectDir !== undefined ? { projectDir } : {}),\n } as const;\n\n switch (event) {\n case \"PreToolUse\": {\n const ev: PreToolUseEvent = {\n ...base,\n toolName: input.tool_name ?? \"\",\n toolInput: input.tool_input ?? {},\n };\n return ev;\n }\n case \"PostToolUse\": {\n // PRIMARY SOURCE (docs \"PostToolUse input\"): VS Code PostToolUse fires\n // ONLY after a tool completes SUCCESSFULLY and serializes a single\n // result field, `tool_response`. There is NO `tool_output` and NO\n // `error_message` field in this dialect, so the old `?? input.tool_output\n // ?? input.error_message` fallback legs read host-nonexistent fields and\n // the `error_message`-driven `isError` could never become true. Read only\n // `tool_response`; a tool-failure event (PostToolUseFailure, field\n // `error`) is not part of VS Code's eight-event table and is not wired.\n const toolOutput = toolResponseToString(input.tool_response);\n const ev: PostToolUseEvent = {\n ...base,\n toolName: input.tool_name ?? \"\",\n toolInput: input.tool_input ?? {},\n ...(toolOutput !== undefined ? { toolOutput } : {}),\n };\n return ev;\n }\n case \"PreCompact\": {\n const ev: PreCompactEvent = {\n ...base,\n ...(input.trigger === \"auto\" || input.trigger === \"manual\"\n ? { trigger: input.trigger }\n : {}),\n };\n return ev;\n }\n case \"PostCompact\": {\n // VS Code Copilot does not fire PostCompact natively (postCompact unset\n // → warn-skip at install). Parsed defensively, mirroring PreCompact, so\n // a manual/mis-routed dispatch normalizes instead of hitting the guard.\n const ev: PostCompactEvent = {\n ...base,\n ...(input.trigger === \"auto\" || input.trigger === \"manual\"\n ? { trigger: input.trigger }\n : {}),\n };\n return ev;\n }\n case \"SessionStart\": {\n const ev: SessionStartEvent = {\n ...base,\n source: normalizeSessionSource(input.source ?? input.trigger),\n };\n return ev;\n }\n case \"SessionEnd\": {\n const ev: SessionEndEvent = {\n ...base,\n ...(typeof input.reason === \"string\" ? { reason: input.reason } : {}),\n };\n return ev;\n }\n case \"UserPromptSubmit\": {\n const ev: UserPromptSubmitEvent = {\n ...base,\n prompt: typeof input.prompt === \"string\" ? input.prompt : \"\",\n };\n return ev;\n }\n case \"Stop\": {\n const ev: StopEvent = {\n ...base,\n ...(typeof input.stop_hook_active === \"boolean\"\n ? { stopHookActive: input.stop_hook_active }\n : {}),\n };\n return ev;\n }\n case \"Notification\": {\n const ev: NotificationEvent = {\n ...base,\n message: typeof input.message === \"string\" ? input.message : \"\",\n };\n return ev;\n }\n case \"SubagentStart\": {\n const ev: SubagentStartEvent = {\n ...base,\n ...(typeof input.agent_id === \"string\" ? { agentId: input.agent_id } : {}),\n ...(typeof input.agent_type === \"string\"\n ? { agentType: input.agent_type }\n : {}),\n };\n return ev;\n }\n case \"SubagentStop\": {\n // PRIMARY SOURCE (docs \"SubagentStop input\"): the payload is EXACTLY\n // { agent_id, agent_type, stop_hook_active }. There is NO\n // `agent_transcript_path` and NO `last_assistant_message` field on this\n // host, so agentTranscriptPath / lastAssistantMessage were always\n // undefined — those reads are removed. (agent_id/agent_type stay optional\n // defensively; a path consumer should fall back to the common\n // `transcript_path`, which is the only transcript VS Code provides.)\n const ev: SubagentStopEvent = {\n ...base,\n ...(typeof input.agent_id === \"string\" ? { agentId: input.agent_id } : {}),\n ...(typeof input.agent_type === \"string\"\n ? { agentType: input.agent_type }\n : {}),\n ...(typeof input.stop_hook_active === \"boolean\"\n ? { stopHookActive: input.stop_hook_active }\n : {}),\n };\n return ev;\n }\n case \"PermissionRequest\":\n case \"PostToolUseFailure\": {\n // No VS Code Copilot analog (its Preview event list has neither a\n // permission-dialog event nor a tool-failure event). Install already\n // skip-warns these; a runtime dispatch is a mis-route — fail loudly.\n throw new Error(`unsupported vscode-copilot hook event: ${String(event)}`);\n }\n default: {\n // Exhaustive guard — every HookEventName is handled above. (VS Code only\n // delivers the events in EVENT_MAP; the rest are handled defensively so\n // a mis-dispatch stays inert rather than crashing.)\n const _never: never = event;\n throw new Error(`unsupported vscode-copilot hook event: ${String(_never)}`);\n }\n }\n }\n\n /**\n * Resolve the project dir from the wire payload. PRIMARY SOURCE (docs \"Common\n * input fields\"): the only working-directory field VS Code sends is `cwd`.\n * There is no `workspace_roots` field, so the old `?? workspace_roots[0]`\n * fallback read a host-nonexistent field and is removed.\n */\n private getProjectDir(input: VSCodeWireInput): string | undefined {\n return typeof input.cwd === \"string\" ? input.cwd : undefined;\n }\n\n // ── Runtime: normalized response → VS Code Copilot native hook reply ──────\n\n formatReply(event: HookEventName, response: HookResponse): HookReply {\n const hookEventName = event;\n const decision = response.decision ?? \"allow\";\n\n // SubagentStart is observe/context-only (the spawn is not blockable):\n // \"context\" injects additionalContext at the start of the SUBAGENT's\n // conversation, and a \"deny\" DEGRADES to the same shape carrying the\n // reason. Everything else passes through.\n if (event === \"SubagentStart\") {\n const context =\n decision === \"context\"\n ? response.additionalContext\n : decision === \"deny\"\n ? response.reason ?? response.additionalContext\n : undefined;\n if (context) {\n return this.stdout({\n hookSpecificOutput: { hookEventName, additionalContext: context },\n });\n }\n return { exitCode: 0 };\n }\n\n // deny → block the action with a reason (exit 0; JSON carries the decision).\n // Per VS Code's Output Contract, `hookSpecificOutput.permissionDecision` is\n // read ONLY for the pre-execution TOOL-permission event (PreToolUse). The\n // post-execution / turn-control events — PostToolUse, Stop, UserPromptSubmit\n // and SubagentStop — block via the TOP-LEVEL {\"decision\":\"block\",\"reason\"}\n // instead: PostToolUse blocks further processing (hooks.md: \"PostToolUse\n // output can block further processing with decision: block\") with `reason` as\n // feedback; Stop/SubagentStop keep the (sub)agent running with `reason` as the\n // next instruction; UserPromptSubmit blocks the prompt with `reason`. The tool\n // already ran by PostToolUse, so there is no permission left to grant — a\n // permissionDecision there is silently ignored (the old behaviour dropped the\n // deny).\n if (decision === \"deny\") {\n if (\n event === \"PostToolUse\" ||\n event === \"SubagentStop\" ||\n event === \"Stop\" ||\n event === \"UserPromptSubmit\"\n ) {\n return this.stdout({\n decision: \"block\",\n reason: response.reason ?? \"Blocked by hook\",\n });\n }\n return this.stdout({\n hookSpecificOutput: {\n hookEventName,\n permissionDecision: \"deny\",\n permissionDecisionReason: response.reason ?? \"Blocked by hook\",\n },\n });\n }\n\n // ask → prompt the user to confirm.\n if (decision === \"ask\") {\n return this.stdout({\n hookSpecificOutput: {\n hookEventName,\n permissionDecision: \"ask\",\n permissionDecisionReason:\n response.reason ?? \"Confirmation required by hook\",\n },\n });\n }\n\n // modify → rewrite PreToolUse input (only where VS Code supports it).\n if (decision === \"modify\") {\n if (event === \"PreToolUse\" && response.updatedInput) {\n return this.stdout({\n hookSpecificOutput: { hookEventName, updatedInput: response.updatedInput },\n });\n }\n // Output rewrite is unsupported on VS Code; fall through to allow.\n }\n\n // context → inject soft guidance (also the SessionStart context path).\n if (decision === \"context\" && response.additionalContext) {\n return this.stdout({\n hookSpecificOutput: { hookEventName, additionalContext: response.additionalContext },\n });\n }\n\n // allow / void / unsupported-degradation → pass through with exit 0.\n return { exitCode: 0 };\n }\n\n private stdout(payload: unknown): HookReply {\n return { exitCode: 0, stdout: JSON.stringify(payload) };\n }\n}\n\n/**\n * VS Code native interpolation token: `${env:VAR}` → `${env:VAR}` (passthrough).\n * VS Code also supports `${input:VAR}` (prompted/secret inputs declared in the\n * sibling `inputs` array); we keep portable `${env:VAR}` refs as the native env\n * token so secrets are never baked into the committed config.\n */\nfunction vscodeEnvToken(name: string): string {\n return `\\${env:${name}}`;\n}\n\n/**\n * Extract a stable session id from a VS Code Copilot wire payload. Priority\n * mirrors the Claude-compatible wire: transcript UUID > session_id > \"\" (the\n * framework uses \"\" when no id is available — no ppid fabrication here).\n */\nfunction extractSessionId(input: VSCodeWireInput): string {\n if (typeof input.transcript_path === \"string\") {\n const m = input.transcript_path.match(/([a-f0-9-]{36})\\.jsonl$/);\n if (m && m[1]) return m[1];\n }\n if (typeof input.session_id === \"string\" && input.session_id !== \"\") {\n return input.session_id;\n }\n return \"\";\n}\n\n/** Coerce a Claude-compatible PostToolUse `tool_response` into a string. */\nfunction toolResponseToString(value: unknown): string | undefined {\n if (value == null) return undefined;\n if (typeof value === \"string\") return value;\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}\n\nexport const adapter = new VSCodeCopilotAdapter();\nexport default adapter;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkCA,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,SAAS,YAAY;AAqC9B,IAAM,OAAmB;AAOzB,IAAM,eAAe;AAGrB,IAAM,uBAAuB;AAe7B,IAAM,YAAoD;AAAA,EACxD,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,MAAM;AAAA,EACN,eAAe;AAAA,EACf,cAAc;AAChB;AAgFO,IAAM,uBAAN,cAAmC,YAA+B;AAAA,EAC9D,KAAiB;AAAA,EACjB,OAAO;AAAA,EACP,WAAyB;AAAA,EAEzB,eAAqC;AAAA;AAAA;AAAA,IAG5C,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOhB,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,kBAAkB;AAAA,IAClB,MAAM;AAAA,IACN,cAAc;AAAA;AAAA;AAAA;AAAA,IAId,eAAe;AAAA,IACf,cAAc;AAAA;AAAA;AAAA,IAGd,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,yBAAyB;AAAA,IACzB,YAAY,CAAC,SAAS,QAAQ,KAAK;AAAA;AAAA;AAAA;AAAA,IAInC,8BAA8B;AAAA;AAAA;AAAA;AAAA,IAI9B,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,EACrB;AAAA;AAAA,EAIA,gBAAgB,YAAsC;AACpD,UAAM,UAAU,KAAK,QAAQ,GAAG,SAAS;AACzC,UAAM,UAAU,KAAK,SAAS,UAAU;AACxC,UAAM,kBAAkB,KAAK,QAAQ,GAAG,kBAAkB;AA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K,OAAO;AAAA,QACjB,oBAAoB,EAAE,eAAe,mBAAmB,SAAS,kBAAkB;AAAA,MACrF,CAAC;AAAA,IACH;AAGA,WAAO,EAAE,UAAU,EAAE;AAAA,EACvB;AAAA,EAEQ,OAAO,SAA6B;AAC1C,WAAO,EAAE,UAAU,GAAG,QAAQ,KAAK,UAAU,OAAO,EAAE;AAAA,EACxD;AACF;AAQA,SAAS,eAAe,MAAsB;AAC5C,SAAO,UAAU,IAAI;AACvB;AAOA,SAAS,iBAAiB,OAAgC;AACxD,MAAI,OAAO,MAAM,oBAAoB,UAAU;AAC7C,UAAM,IAAI,MAAM,gBAAgB,MAAM,yBAAyB;AAC/D,QAAI,KAAK,EAAE,CAAC,EAAG,QAAO,EAAE,CAAC;AAAA,EAC3B;AACA,MAAI,OAAO,MAAM,eAAe,YAAY,MAAM,eAAe,IAAI;AACnE,WAAO,MAAM;AAAA,EACf;AACA,SAAO;AACT;AAGA,SAAS,qBAAqB,OAAoC;AAChE,MAAI,SAAS,KAAM,QAAO;AAC1B,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,MAAI;AACF,WAAO,KAAK,UAAU,KAAK;AAAA,EAC7B,QAAQ;AACN,WAAO,OAAO,KAAK;AAAA,EACrB;AACF;AAEO,IAAM,UAAU,IAAI,qBAAqB;AAChD,IAAO,yBAAQ;","names":["entry"]}
@@ -5,13 +5,13 @@ import {
5
5
  import {
6
6
  BaseAdapter,
7
7
  renderSkillMd
8
- } from "./chunk-VVFDU4IX.js";
8
+ } from "./chunk-MGTDQLJJ.js";
9
9
  import {
10
10
  buildWrappedStdio,
11
11
  isHomeBinHookCommand
12
- } from "./chunk-HORHRHNG.js";
13
- import "./chunk-YYNXIUR2.js";
14
- import "./chunk-IXOQDZWC.js";
12
+ } from "./chunk-4NHXLXSD.js";
13
+ import "./chunk-UMQ6NBQR.js";
14
+ import "./chunk-GZGLCCEE.js";
15
15
 
16
16
  // src/adapters/warp/index.ts
17
17
  import { existsSync } from "fs";
@@ -339,4 +339,4 @@ export {
339
339
  adapter,
340
340
  warp_default as default
341
341
  };
342
- //# sourceMappingURL=warp-4PPG5LOM.js.map
342
+ //# sourceMappingURL=warp-QYJGKURM.js.map
@@ -6,12 +6,12 @@ import {
6
6
  BaseAdapter,
7
7
  renderCommandMd,
8
8
  renderSkillMd
9
- } from "./chunk-VVFDU4IX.js";
9
+ } from "./chunk-MGTDQLJJ.js";
10
10
  import {
11
11
  buildWrappedStdio
12
- } from "./chunk-HORHRHNG.js";
13
- import "./chunk-YYNXIUR2.js";
14
- import "./chunk-IXOQDZWC.js";
12
+ } from "./chunk-4NHXLXSD.js";
13
+ import "./chunk-UMQ6NBQR.js";
14
+ import "./chunk-GZGLCCEE.js";
15
15
 
16
16
  // src/adapters/windsurf/index.ts
17
17
  import { existsSync, statSync } from "fs";
@@ -426,4 +426,4 @@ export {
426
426
  adapter,
427
427
  windsurf_default as default
428
428
  };
429
- //# sourceMappingURL=windsurf-3T3RVXKM.js.map
429
+ //# sourceMappingURL=windsurf-75LLZ37C.js.map
@@ -8,13 +8,13 @@ import {
8
8
  import {
9
9
  BaseAdapter,
10
10
  renderSkillMd
11
- } from "./chunk-VVFDU4IX.js";
11
+ } from "./chunk-MGTDQLJJ.js";
12
12
  import {
13
13
  buildWrappedStdio,
14
14
  isHomeBinActionCommand
15
- } from "./chunk-HORHRHNG.js";
16
- import "./chunk-YYNXIUR2.js";
17
- import "./chunk-IXOQDZWC.js";
15
+ } from "./chunk-4NHXLXSD.js";
16
+ import "./chunk-UMQ6NBQR.js";
17
+ import "./chunk-GZGLCCEE.js";
18
18
 
19
19
  // src/adapters/zed/index.ts
20
20
  import { existsSync } from "fs";
@@ -425,4 +425,4 @@ export {
425
425
  adapter,
426
426
  zed_default as default
427
427
  };
428
- //# sourceMappingURL=zed-ZF2OQ75O.js.map
428
+ //# sourceMappingURL=zed-HKAZXEJW.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ken-jo/agent-connector",
3
- "version": "0.4.91",
3
+ "version": "0.4.93",
4
4
  "type": "module",
5
5
  "description": "Write your MCP server + hooks once; agent-connector installs and adapts them across every AI-agent platform (Claude Code, Codex, Cursor, OpenCode, Copilot, Gemini, Warp, …) and gives you default, platform-independent per-tool token telemetry.",
6
6
  "keywords": [
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/adapters/antigravity-cli/index.ts"],"sourcesContent":["/**\n * adapters/antigravity-cli — Google Antigravity CLI (`agy`) platform adapter.\n *\n * Antigravity ships in two distinct runtimes that share the Gemini-family\n * `~/.gemini` tree and ALL of the same native formats (the JSON `mcp_config.json`\n * shape, the `hooks.json` lifecycle-hook shape, markdown Workflows, and Agent\n * Skills `SKILL.md`): the IDE/desktop app (the parent `AntigravityAdapter`,\n * id \"antigravity\") and this standalone CLI binary `agy` (id \"antigravity-cli\").\n *\n * This adapter is a thin fork of the IDE adapter. It REUSES every render / hook /\n * parse / surface path from {@link AntigravityAdapter} unchanged — the only\n * differences are identity and detection:\n *\n * - id = \"antigravity-cli\", name = \"Antigravity CLI\". Identity flows into the\n * universal hook command (`<homeBin> hook antigravity-cli <event> …`) and the\n * `hostPlatform` stamp, so a CLI-installed hook dispatches back to THIS\n * adapter at runtime — the reason the parent's install/parse logic was made\n * to read `this.id` rather than a fixed host constant.\n * - Detection probes the `agy` binary at ~/.local/bin/agy and/or the SHARED\n * ~/.gemini/antigravity/ presence (distinct runtime markers from the IDE).\n *\n * CONFIRMED-BY-INSTALL (2026-06-03, docs/research/antigravity-paths-confirmed.md):\n * the `agy` CLI v1.0.0 has NO separate config dir — `~/.gemini/antigravity-cli/`,\n * `~/.config/antigravity*`, and `~/.agy` are ALL ABSENT. `agy` SHARES the IDE's\n * `~/.gemini/antigravity/` tree (mcp_config.json, hooks.json, workflows, skills).\n * So the user-scope config resolution here is IDENTICAL to the IDE adapter (the\n * inherited USER_CONFIG_CANDIDATES) — installing both the IDE and CLI connectors\n * therefore writes the SAME files and is idempotent (observed as skip), which is\n * expected and correct. `agy`'s own extension surface is the `agy plugin` system\n * (install/uninstall/list/enable/disable) — future work would deploy as an agy\n * plugin; for now the MCP/workflows/skills surfaces ride the shared IDE files.\n *\n * LIVE-TEST RESOLUTION (2026-06-04, real `agy` v1.0.5 login + spawn): the prior\n * \"shares the IDE's ~/.gemini/antigravity/ file\" claim was WRONG for the CLI. The\n * standalone `agy` reads user MCP from **~/.gemini/config/mcp_config.json**\n * (root key `mcpServers`; project scope <proj>/.agents/mcp_config.json) — PROVEN:\n * a live `agy -p` session spawned an MCP server placed in `config/` and completed\n * a real initialize+tools/list+tools/call handshake; a negative control in\n * `antigravity/` was ignored. The binary carries \"failed to read mcp_config.json\"\n * + a literal \"/.gemini/config\" path; there is NO `--mcp-config` flag and `agy\n * mcp` is TUI-only. So this adapter now OVERRIDES userConfigCandidates to prefer\n * `~/.gemini/config/mcp_config.json` (canonical) over the inherited IDE\n * `antigravity/` default (kept as a prefer-existing fallback). Telemetry-wrap is\n * compatible: agy spawns command+args verbatim, so the home-bin serve wrapper is\n * spawned as written — i.e. a real agy session now emits a per-MCP telemetry row.\n * (agy also keeps its own home ~/.gemini/antigravity-cli/ for auth/state, but MCP\n * config lives in the shared ~/.gemini/config/.)\n *\n * Project scope is IDENTICAL to the IDE adapter (`<proj>/.agents/…`), as is every\n * hook/command/skill render and the runtime parse/format — all inherited.\n *\n * The user-scope config paths shared with the IDE (hooks.json + the global skills\n * dir) remain MEDIUM-CONFIDENCE / PATH-PROBED in the parent (not present on the\n * observed install) and surfaced by the doctor; user-scope mcp_config + workflows\n * are CONFIRMED at ~/.gemini/antigravity/.\n *\n * STATUSLINE SURFACE (LIVE-VERIFIED 2026-06-21, agy v1.0.10): the `agy` CLI ships\n * a first-party custom status line — `/statusline <command>` configures a shell\n * command that agy execs on each refresh, piping a JSON status payload on stdin.\n * The config is persisted in the GLOBAL `~/.gemini/antigravity-cli/settings.json`\n * under the top-level `statusLine` key, value shape `{ enabled: true, command }`\n * — NOT claude-code's `{ type:\"command\", command }` and NOT qwen-code's nested\n * `ui.statusLine`. This was confirmed by a real headless `agy -p` turn with the\n * statusLine command pointed at a stdin-logging script: the captured payload is\n * { cwd, session_id, conversation_id, transcript_path,\n * model:{ id, display_name },\n * workspace:{ current_dir, project_dir },\n * version,\n * context_window:{ total_input_tokens, total_output_tokens,\n * context_window_size, used_percentage,\n * remaining_percentage,\n * current_usage:{ input_tokens, output_tokens, … } },\n * exceeds_200k_tokens, product, quota, agent_state, vcs, sandbox,\n * plan_tier, email, terminal_width }\n * Only the antigravity-cli FORK wires this (the IDE app's payload is not verified),\n * so the CLI adapter overrides `capabilities` to add `supportsStatusline: true`\n * and the statusline parse/format/install/uninstall here — every other path stays\n * inherited from {@link AntigravityAdapter}.\n */\n\nimport { existsSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n\nimport { AntigravityAdapter, adapter as antigravityIdeAdapter } from \"../antigravity/index.js\";\nimport type { Adapter, HookReply, InstallContext } from \"../spi.js\";\nimport type {\n ChangeRecord,\n DetectedPlatform,\n HealthCheck,\n JsonValue,\n PlatformCapabilities,\n PlatformId,\n StatuslineContext,\n} from \"../../core/types.js\";\nimport {\n buildHomeBinStatuslineCommand,\n isHomeBinStatuslineCommand,\n} from \"../../core/spawn.js\";\nimport {\n type ConfigPatchLedgerEntry,\n addLedgerOwner,\n createLedgerEntry,\n describeJsonValue,\n dropLedgerEntry,\n findLedgerEntry,\n hashJsonValue,\n jsonDeepEquals,\n ledgerEntriesOwnedBy,\n loadConfigPatchLedger,\n removeLedgerOwner,\n saveConfigPatchLedger,\n} from \"../../core/config-patch-ledger.js\";\n\nconst HOST: PlatformId = \"antigravity-cli\";\n\n/**\n * settings.json key the statusline surface owns on `agy`. The agy CLI stores its\n * custom status line under the TOP-LEVEL `statusLine` key (a single segment —\n * unlike qwen-code's nested `ui.statusLine`). LIVE-VERIFIED against agy v1.0.10\n * (binary StatusLineConfig JSON tags `statusLine`/`command`/`enabled`; a real turn\n * accepted and fired this shape). We own the `statusLine` leaf via the SAME\n * refcounted ownership ledger as configPatch — never clobbering a `statusLine` a\n * user (or another tool) already set.\n */\nconst STATUSLINE_KEY = \"statusLine\";\n\n/**\n * The `agy` statusLine custom-command stdin payload (the documented status-line\n * input agy pipes on stdin, read once). Every field optional — a refresh only\n * carries what the host knows. LIVE-CAPTURED (agy v1.0.10, 2026-06-21). Unmodeled\n * fields (version, agent_state, vcs, plan_tier, quota, product, email,\n * terminal_width) stay in StatuslineContext.raw.\n *\n * NOTE the divergence from qwen-code: agy's `context_window.current_usage` is an\n * OBJECT (`{ input_tokens, output_tokens, … }`), NOT a number — so used tokens are\n * derived from the top-level `total_input_tokens + total_output_tokens`, and the\n * percent from `used_percentage`.\n */\ninterface AgyStatuslineInput {\n cwd?: string;\n session_id?: string;\n conversation_id?: string;\n transcript_path?: string;\n version?: string;\n model?: { id?: string; display_name?: string };\n workspace?: { current_dir?: string; project_dir?: string };\n context_window?: {\n total_input_tokens?: number;\n total_output_tokens?: number;\n context_window_size?: number;\n used_percentage?: number;\n remaining_percentage?: number;\n current_usage?: {\n input_tokens?: number;\n output_tokens?: number;\n cache_creation_input_tokens?: number;\n cache_read_input_tokens?: number;\n };\n };\n}\n\nexport class AntigravityCliAdapter extends AntigravityAdapter implements Adapter {\n override readonly id: PlatformId = HOST;\n override readonly name = \"Antigravity CLI\";\n\n /**\n * Capabilities = the inherited IDE surface PLUS the CLI-only statusline (the\n * `agy` custom status line, live-verified above). The IDE app does NOT advertise\n * statusline (its payload is unverified), so this is the ONE capability that\n * differs from the parent — everything else is spread from the IDE adapter's own\n * capabilities so the two surfaces stay in lock-step (a parent field added later\n * flows in automatically). `super.capabilities` is unusable here: the parent's\n * `capabilities` is an instance FIELD (not on the prototype), so it resolves to\n * undefined in a subclass field initializer — spread the IDE singleton instead.\n */\n override readonly capabilities: PlatformCapabilities = {\n ...antigravityIdeAdapter.capabilities,\n supportsStatusline: true,\n };\n\n // ── Detection ────────────────────────────────────────────────────────────\n\n /**\n * Probe the CLI's runtime markers, DISTINCT from the IDE app even though the\n * two share `~/.gemini/antigravity/`: the `agy` binary at ~/.local/bin/agy\n * (the definitive CLI marker, CONFIRMED present) and the shared\n * ~/.gemini/antigravity/ tree (or a user-scope mcp_config candidate / the\n * project config). Reported before the IDE adapter in the registry so the\n * more-specific CLI marker (the `agy` binary) wins host detection. Note: a\n * machine with ONLY the IDE (no `agy` binary) will not match here, while one\n * with the CLI matches on the binary regardless of the shared config dir.\n */\n override detectInstalled(projectDir: string): DetectedPlatform {\n const home = homedir();\n const userConfig = this.resolveUserConfigPath();\n const agyBin = join(home, \".local\", \"bin\", \"agy\");\n const sharedDir = join(home, \".gemini\", \"antigravity\");\n const projectConfig = join(projectDir, \".agents\", \"mcp_config.json\");\n\n // The `agy` binary is the definitive CLI marker. The shared antigravity dir\n // and the user-scope mcp_config candidates are secondary signals (they also\n // match a pure-IDE install, so the binary is what truly distinguishes the CLI).\n const cliMarker = existsSync(agyBin);\n const userInstalled =\n cliMarker ||\n existsSync(sharedDir) ||\n this.userConfigCandidates().some((parts) => existsSync(join(home, ...parts)));\n const projInstalled = existsSync(projectConfig);\n const installed = userInstalled || projInstalled;\n\n // Report the scope/path that actually matched, so a project-only install\n // isn't misreported as a (non-existent) user install.\n const scope = projInstalled && !userInstalled ? \"project\" : \"user\";\n const configPath = scope === \"project\" ? projectConfig : userConfig;\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 ? scope === \"project\"\n ? `found project Antigravity CLI config at ${projectConfig}`\n : `found Antigravity CLI (agy) at ${agyBin} / shared ${sharedDir}`\n : `no Antigravity CLI install at ${agyBin}, ${sharedDir}, or ${projectConfig}`,\n // The `agy` binary is a high-confidence CLI marker; matching only the shared\n // config dir is weaker (it could be a pure-IDE install).\n confidence: cliMarker ? \"high\" : installed ? \"medium\" : \"low\",\n };\n }\n\n /**\n * MCP user-config path — LIVE-PROVEN for `agy` v1.0.5 (2026-06-04). The\n * standalone CLI reads user MCP servers from `~/.gemini/config/mcp_config.json`\n * (root key `mcpServers`), NOT the IDE's `~/.gemini/antigravity/mcp_config.json`:\n * a real `agy -p` session spawned an MCP server ONLY when it was placed in\n * `config/` (negative control: a server in `antigravity/` was ignored), and the\n * binary carries the error string \"failed to read mcp_config.json\" + a literal\n * \"/.gemini/config\" path. `agy mcp` is TUI-only (no headless add) and there is\n * no `--mcp-config` flag. So the CLI must PREFER `config/` over the inherited\n * `antigravity/` default; the IDE path stays as a prefer-existing fallback.\n * (Skills/workflows/hooks dirs remain inherited; project scope\n * `<proj>/.agents/mcp_config.json` is already correct and live-proven.)\n */\n private static readonly CLI_USER_CONFIG_CANDIDATES = [\n [\".gemini\", \"config\", \"mcp_config.json\"], // CONFIRMED canonical for agy v1.0.5\n [\".gemini\", \"antigravity\", \"mcp_config.json\"], // legacy IDE layout (prefer-existing)\n ] as const;\n\n protected override userConfigCandidates(): ReadonlyArray<readonly string[]> {\n return AntigravityCliAdapter.CLI_USER_CONFIG_CANDIDATES;\n }\n\n // ── Statusline surface (the `agy` custom status line) ─────────────────────\n // Wires settings.json `statusLine` = { enabled:true, command:<home-bin\n // statusline cmd> } through the SAME refcounted ownership ledger as configPatch\n // (the ledger primitives are surface-agnostic). antigravity-cli does NOT\n // advertise supportsConfigPatch, so — like qwen-code — this adapter performs the\n // set-if-absent write directly with the exported ledger primitives. Semantics\n // are identical to claude-code/qwen-code: never clobber a `statusLine`\n // agent-connector does not own (skip-warn), record prior state + owner\n // (refcounted across connectors), reversible by uninstallStatusline\n // (last-owner-verified delete).\n //\n // The home-bin command makes agy exec\n // `<homeBin> statusline antigravity-cli --connector <id>` on every refresh,\n // which re-imports the connector module and renders the line (runtime/\n // statusline-entrypoint). The status line lives in the GLOBAL\n // ~/.gemini/antigravity-cli/settings.json (agy has no project-scope statusLine),\n // so this surface is user-scope regardless of the install scope. No telemetry\n // in v1.\n\n /**\n * The `agy` settings.json that holds the statusLine config. LIVE-VERIFIED at\n * ~/.gemini/antigravity-cli/settings.json (the CLI's own global home — distinct\n * from the shared ~/.gemini/config/mcp_config.json the MCP surface writes). agy\n * stores statusLine as a GLOBAL UI setting with no project-scope variant, so the\n * path is scope-independent.\n */\n private statuslineSettingsPath(): string {\n return join(homedir(), \".gemini\", \"antigravity-cli\", \"settings.json\");\n }\n\n /** The statusLine config value agent-connector writes at `statusLine`. */\n private statuslineValue(ctx: InstallContext): JsonValue {\n const command = buildHomeBinStatuslineCommand(ctx.homeBinPath, HOST, ctx.connector.id);\n return { enabled: true, command };\n }\n\n override installStatusline(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.statusline == null) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no statusline\" }];\n }\n if (connector.platforms[HOST]?.statusline === false) {\n return [{ platform: this.id, action: \"skip\", detail: `statusline disabled for ${HOST}` }];\n }\n\n const filePath = this.statuslineSettingsPath();\n const symlink = this.symlinkPathWarning(filePath);\n if (symlink) return [symlink];\n\n // OVERWRITE GUARD (upsertServerInJson precedent): never round-trip a\n // present-but-unparseable settings file into `{}`.\n if (this.isPresentButUnparseable(filePath)) {\n return [\n {\n platform: this.id,\n action: \"warn\",\n path: filePath,\n detail: `existing ${filePath} is not parseable; statusline left unapplied (back it up / fix it, then re-run)`,\n },\n ];\n }\n const settings = this.readJson<Record<string, unknown>>(filePath) ?? {};\n if (typeof settings !== \"object\" || Array.isArray(settings)) {\n return [\n {\n platform: this.id,\n action: \"warn\",\n path: filePath,\n detail: `existing ${filePath} is not a JSON object; statusline left unapplied`,\n },\n ];\n }\n\n const ledger = loadConfigPatchLedger(ctx.dataRoot);\n const desired = this.statuslineValue(ctx);\n const leaf = settings[STATUSLINE_KEY];\n const entry = findLedgerEntry(ledger, HOST, filePath, STATUSLINE_KEY);\n const changes: ChangeRecord[] = [];\n\n if (leaf === undefined) {\n // SET-IF-ABSENT: the one write path.\n settings[STATUSLINE_KEY] = desired;\n this.writeJson(filePath, settings, ctx.dryRun);\n if (entry) {\n // Stale ledger row (key deleted out from under us): re-assert the value,\n // keep existing owners (they still rely on the key), record what we wrote.\n entry.writtenValue = desired;\n entry.writtenValueHash = hashJsonValue(desired);\n addLedgerOwner(entry, connector.id, connector.version);\n } else {\n createLedgerEntry(ledger, {\n platform: HOST,\n file: filePath,\n key: STATUSLINE_KEY,\n value: desired,\n connectorId: connector.id,\n connectorVersion: connector.version,\n });\n }\n if (!ctx.dryRun) saveConfigPatchLedger(ctx.dataRoot, ledger);\n changes.push({\n platform: this.id,\n action: \"create\",\n path: filePath,\n detail: `statusline ${STATUSLINE_KEY}: <absent> → ${describeJsonValue(desired)}`,\n });\n return changes;\n }\n\n // Key PRESENT — never overwrite; the only question is ownership/refcount.\n const leafValue = leaf as JsonValue;\n if (!entry) {\n // User- (or other-tool-) owned. No ownership is taken even when the values\n // happen to match — uninstall must never delete a key we did not create.\n return [\n {\n platform: this.id,\n action: \"warn\",\n path: filePath,\n detail:\n `statusline ${STATUSLINE_KEY} skipped: already set to ${describeJsonValue(leafValue)} ` +\n `(not created by agent-connector) — left untouched`,\n },\n ];\n }\n\n if (!jsonDeepEquals(leafValue, entry.writtenValue)) {\n // DRIFT: the user edited the value after we wrote it. Never revert.\n return [\n {\n platform: this.id,\n action: \"warn\",\n path: filePath,\n detail:\n `statusline ${STATUSLINE_KEY}: value changed since install ` +\n `(current ${describeJsonValue(leafValue)}, wrote ${describeJsonValue(entry.writtenValue)}); ` +\n `leaving in place`,\n },\n ];\n }\n\n if (jsonDeepEquals(desired, leafValue)) {\n // Same value we own: register as co-owner (refcount++) or idempotent skip.\n const owners = entry.owners.map((o) => o.connectorId);\n if (addLedgerOwner(entry, connector.id, connector.version)) {\n if (!ctx.dryRun) saveConfigPatchLedger(ctx.dataRoot, ledger);\n return [\n {\n platform: this.id,\n action: \"skip\",\n path: filePath,\n detail: `statusline ${STATUSLINE_KEY} already installed; registered as co-owner (co-owned with ${owners.join(\", \")})`,\n },\n ];\n }\n return [\n {\n platform: this.id,\n action: \"skip\",\n path: filePath,\n detail: `statusline ${STATUSLINE_KEY} already installed`,\n },\n ];\n }\n\n // FIRST-WRITER-WINS: another connector owns the key with a different value.\n return [\n {\n platform: this.id,\n action: \"warn\",\n path: filePath,\n detail:\n `statusline ${STATUSLINE_KEY} skipped: already owned by ${entry.owners\n .map((o) => o.connectorId)\n .join(\", \")} with a different value — left untouched`,\n },\n ];\n }\n\n override uninstallStatusline(ctx: InstallContext): ChangeRecord[] {\n const ledger = loadConfigPatchLedger(ctx.dataRoot);\n // Release ONLY the statusLine ledger row this connector owns (keyed off the\n // ledger, not the declaration, so an id-only synthetic uninstall still reclaims\n // it). Last-owner-verified delete: remove the key ONLY when last-owner ∧\n // value-unchanged ∧ prior-absent (else skip-warn + leave the key).\n const owned = ledgerEntriesOwnedBy(ledger, HOST, ctx.connector.id).filter(\n (e) => e.key === STATUSLINE_KEY,\n );\n if (owned.length === 0) {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail: \"statusline: no ownership recorded; left untouched\",\n },\n ];\n }\n\n const changes: ChangeRecord[] = [];\n let ledgerMutated = false;\n\n // Group by file (one global settings.json in practice, but stay robust to a\n // scope drift between install and uninstall).\n const byFile = new Map<string, ConfigPatchLedgerEntry[]>();\n for (const entry of owned) {\n const bucket = byFile.get(entry.file) ?? [];\n bucket.push(entry);\n byFile.set(entry.file, bucket);\n }\n\n for (const [filePath, entries] of byFile) {\n const symlink = this.symlinkPathWarning(filePath);\n if (symlink) {\n changes.push(symlink);\n continue;\n }\n\n const unparseable = this.isPresentButUnparseable(filePath);\n const settings = unparseable ? null : this.readJson<Record<string, unknown>>(filePath);\n let fileMutated = false;\n\n for (const entry of entries) {\n const { lastOwner } = removeLedgerOwner(entry, ctx.connector.id);\n ledgerMutated = true;\n\n if (!lastOwner) {\n // Shared-flag case: A uninstalls, B still relies on the key.\n changes.push({\n platform: this.id,\n action: \"skip\",\n path: filePath,\n detail: `statusline ${entry.key} retained: still owned by ${entry.owners\n .map((o) => o.connectorId)\n .join(\", \")}`,\n });\n continue;\n }\n\n // Last owner out → the ledger row is dropped on every branch below; the\n // KEY is removed only on the fully-verified branch.\n dropLedgerEntry(ledger, entry);\n\n if (unparseable) {\n changes.push({\n platform: this.id,\n action: \"warn\",\n path: filePath,\n detail: `statusline ${entry.key}: ${filePath} is not parseable; key left in place (ownership released)`,\n });\n continue;\n }\n if (!settings || typeof settings !== \"object\" || Array.isArray(settings)) {\n changes.push({\n platform: this.id,\n action: \"skip\",\n path: filePath,\n detail: `statusline ${entry.key} already absent (no settings file); ownership record dropped`,\n });\n continue;\n }\n const leaf = settings[entry.key];\n if (leaf === undefined) {\n changes.push({\n platform: this.id,\n action: \"skip\",\n path: filePath,\n detail: `statusline ${entry.key} already absent; ownership record dropped`,\n });\n continue;\n }\n if (entry.prior?.present !== false || !jsonDeepEquals(leaf as JsonValue, entry.writtenValue)) {\n // User edited the value after install (or the row predates the\n // set-if-absent guarantee): deleting would clobber them. Leave it.\n changes.push({\n platform: this.id,\n action: \"warn\",\n path: filePath,\n detail:\n `statusline ${entry.key}: value changed since install ` +\n `(current ${describeJsonValue(leaf as JsonValue)}, wrote ${describeJsonValue(entry.writtenValue)}); ` +\n `left in place`,\n });\n continue;\n }\n\n // VERIFIED: last owner + current === writtenValue + prior absent.\n delete settings[entry.key];\n fileMutated = true;\n changes.push({\n platform: this.id,\n action: \"remove\",\n path: filePath,\n detail: `statusline ${entry.key} removed (was ${describeJsonValue(entry.writtenValue)})`,\n });\n }\n\n if (fileMutated && settings) this.writeJson(filePath, settings, ctx.dryRun);\n }\n\n if (ledgerMutated && !ctx.dryRun) saveConfigPatchLedger(ctx.dataRoot, ledger);\n return changes;\n }\n\n /**\n * Parse the `agy` statusLine stdin JSON into the normalized\n * {@link StatuslineContext}. agy pipes a JSON object on stdin\n * (model/context_window/workspace/…); fields the payload omits stay undefined.\n * `raw` keeps the verbatim payload (incl. version/agent_state/vcs/plan_tier/\n * quota/email/terminal_width). agy has no cost analog, so `ctx.cost` is left\n * undefined. LIVE-CAPTURED against agy v1.0.10 (see header / AgyStatuslineInput).\n */\n parseStatusInput(raw: unknown): StatuslineContext {\n const input = (raw ?? {}) as AgyStatuslineInput;\n\n const ctx: StatuslineContext = {\n host: HOST,\n capabilities: this.capabilities,\n raw,\n };\n // Stable session id: prefer conversation_id (the active agent conversation),\n // fall back to session_id (the capture showed them equal).\n const sessionId =\n typeof input.conversation_id === \"string\" && input.conversation_id !== \"\"\n ? input.conversation_id\n : typeof input.session_id === \"string\" && input.session_id !== \"\"\n ? input.session_id\n : undefined;\n if (sessionId !== undefined) ctx.sessionId = sessionId;\n // cwd: prefer the top-level cwd, else the workspace.current_dir.\n const cwd =\n typeof input.cwd === \"string\"\n ? input.cwd\n : typeof input.workspace?.current_dir === \"string\"\n ? input.workspace.current_dir\n : undefined;\n if (cwd !== undefined) ctx.cwd = cwd;\n if (typeof input.transcript_path === \"string\") ctx.transcriptPath = input.transcript_path;\n\n const model: { id?: string; displayName?: string } = {};\n if (typeof input.model?.id === \"string\") model.id = input.model.id;\n if (typeof input.model?.display_name === \"string\") model.displayName = input.model.display_name;\n if (model.id !== undefined || model.displayName !== undefined) ctx.model = model;\n\n const cw = input.context_window;\n if (cw) {\n const context: { usedTokens?: number; maxTokens?: number; percent?: number } = {};\n if (typeof cw.context_window_size === \"number\") context.maxTokens = cw.context_window_size;\n // agy's current_usage is an OBJECT (not a number like qwen) — used tokens are\n // the documented top-level total_input_tokens + total_output_tokens sum.\n if (\n typeof cw.total_input_tokens === \"number\" ||\n typeof cw.total_output_tokens === \"number\"\n ) {\n context.usedTokens = (cw.total_input_tokens ?? 0) + (cw.total_output_tokens ?? 0);\n }\n if (typeof cw.used_percentage === \"number\") context.percent = cw.used_percentage;\n if (\n context.usedTokens !== undefined ||\n context.maxTokens !== undefined ||\n context.percent !== undefined\n ) {\n ctx.context = context;\n }\n }\n // ctx.cost stays undefined: agy's status payload has no cost analog.\n return ctx;\n }\n\n /** Format the rendered status line into agy's native reply: stdout = line, exit 0. */\n formatStatusOutput(rendered: string): HookReply {\n return { exitCode: 0, stdout: rendered };\n }\n\n // ── Diagnostics: add the statusline check on top of the inherited IDE checks ─\n\n override getHealthChecks(ctx: InstallContext): readonly HealthCheck[] {\n const checks = [...super.getHealthChecks(ctx)];\n\n // Statusline check: assert it when the connector declares a statusline AND it\n // is not disabled for this host, OR when the ownership ledger holds a\n // statusLine row this connector owns (the REGISTERED-connector path:\n // connectorFromMeta can't re-expose the render fn, so statusline comes back\n // undefined — but the ledger row proves the surface was wired). Mirrors\n // claude-code/qwen-code's \"statusline wired\" check.\n const settingsPath = this.statuslineSettingsPath();\n const connectorId = ctx.connector.id;\n const homeBin = ctx.homeBinPath;\n const statuslineLedgerOwned = ledgerEntriesOwnedBy(\n loadConfigPatchLedger(ctx.dataRoot),\n HOST,\n connectorId,\n ).some((e) => e.key === STATUSLINE_KEY);\n if (\n (ctx.connector.statusline != null || statuslineLedgerOwned) &&\n ctx.connector.platforms[HOST]?.statusline !== false\n ) {\n checks.push({\n name: `${this.name}: statusline wired`,\n check: () => {\n const settings = this.readJson<{ statusLine?: { command?: unknown } }>(settingsPath);\n const command = settings?.statusLine?.command;\n if (command === undefined) {\n return { status: \"FAIL\", detail: `statusLine not set in ${settingsPath}` };\n }\n if (\n typeof command === \"string\" &&\n isHomeBinStatuslineCommand(command, homeBin, connectorId)\n ) {\n return { status: \"OK\", detail: \"statusLine command present\" };\n }\n // Present but not ours — a non-AC statusLine we must never clobber.\n return {\n status: \"FAIL\",\n detail: `statusLine in ${settingsPath} is not agent-connector's (left untouched)`,\n };\n },\n });\n }\n return checks;\n }\n}\n\nexport const adapter = new AntigravityCliAdapter();\nexport default adapter;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFA,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,YAAY;AAgCrB,IAAM,OAAmB;AAWzB,IAAM,iBAAiB;A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