@ken-jo/agent-connector 0.4.44 → 0.4.61

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 (186) hide show
  1. package/README.md +17 -4
  2. package/dist/{action-72J2TCKQ.js → action-AIB2W4DU.js} +12 -12
  3. package/dist/{amazon-q-UFLBUSHG.js → amazon-q-PH7OFPJD.js} +7 -11
  4. package/dist/amazon-q-PH7OFPJD.js.map +1 -0
  5. package/dist/{amp-5DJK7VAL.js → amp-ZYRC2VCH.js} +38 -63
  6. package/dist/amp-ZYRC2VCH.js.map +1 -0
  7. package/dist/{antigravity-NWP2TUG6.js → antigravity-PM5NMS2J.js} +5 -5
  8. package/dist/{antigravity-cli-KPNLE7X4.js → antigravity-cli-LN25XGWX.js} +5 -5
  9. package/dist/{chunk-LETB5HCK.js → chunk-3QCDVSMX.js} +2 -2
  10. package/dist/{chunk-ERV4TKRV.js → chunk-4K5HEGVE.js} +2 -2
  11. package/dist/{chunk-ASHAMORS.js → chunk-AAOYOAQT.js} +2 -2
  12. package/dist/{chunk-2RPHDVHW.js → chunk-AEQRMVRB.js} +2 -2
  13. package/dist/{chunk-L7ESV37V.js → chunk-BZOOVTFG.js} +4 -2
  14. package/dist/chunk-BZOOVTFG.js.map +1 -0
  15. package/dist/{chunk-3Q6YEDCG.js → chunk-C3TFA4CJ.js} +17 -45
  16. package/dist/chunk-C3TFA4CJ.js.map +1 -0
  17. package/dist/{chunk-QY42WGBX.js → chunk-D65GIBCG.js} +34 -3
  18. package/dist/chunk-D65GIBCG.js.map +1 -0
  19. package/dist/{chunk-VPSHGDDQ.js → chunk-FVARNRCE.js} +26 -10
  20. package/dist/chunk-FVARNRCE.js.map +1 -0
  21. package/dist/{chunk-A767JFHW.js → chunk-GI4FDVWI.js} +65 -35
  22. package/dist/chunk-GI4FDVWI.js.map +1 -0
  23. package/dist/{chunk-SBV2QJ5C.js → chunk-IDKI42JW.js} +36 -36
  24. package/dist/{chunk-WZWK4ICE.js → chunk-JZIM33C2.js} +10 -7
  25. package/dist/chunk-JZIM33C2.js.map +1 -0
  26. package/dist/{chunk-IKEXNI2W.js → chunk-KAEYJGK7.js} +18 -18
  27. package/dist/{chunk-ZY25RG4Y.js → chunk-LBOGRZGY.js} +4 -2
  28. package/dist/chunk-LBOGRZGY.js.map +1 -0
  29. package/dist/{chunk-B47MDOV3.js → chunk-NFMHYIN2.js} +5 -5
  30. package/dist/{chunk-XW46WVR2.js → chunk-O3HIYTBK.js} +10 -5
  31. package/dist/chunk-O3HIYTBK.js.map +1 -0
  32. package/dist/{chunk-UXG64P6R.js → chunk-O4BKQSPP.js} +7 -4
  33. package/dist/chunk-O4BKQSPP.js.map +1 -0
  34. package/dist/{chunk-5M2SMDA4.js → chunk-QP35SRUZ.js} +2 -2
  35. package/dist/{chunk-CFM3JKIR.js → chunk-RFYQXT7C.js} +7 -7
  36. package/dist/{chunk-E3GWKJU5.js → chunk-RGQTN7K3.js} +5 -5
  37. package/dist/{chunk-M3H7PQWT.js → chunk-WOUGWPZQ.js} +4 -2
  38. package/dist/chunk-WOUGWPZQ.js.map +1 -0
  39. package/dist/{chunk-F4DSMVZ7.js → chunk-ZQCT63JU.js} +2 -2
  40. package/dist/{claude-code-HXIVRZCY.js → claude-code-GCXXEWUN.js} +15 -8
  41. package/dist/claude-code-GCXXEWUN.js.map +1 -0
  42. package/dist/cli/sdk.js +7 -7
  43. package/dist/cli.js +1 -1
  44. package/dist/{cline-AGFJF4AC.js → cline-KHZLG7CU.js} +4 -4
  45. package/dist/{codebuff-YUQ4PN7G.js → codebuff-EQGWZEP4.js} +4 -4
  46. package/dist/{codex-FLU37DV3.js → codex-7X7RC6JJ.js} +32 -6
  47. package/dist/codex-7X7RC6JJ.js.map +1 -0
  48. package/dist/{continue-ZMI4YN75.js → continue-V4MB3WQ3.js} +9 -5
  49. package/dist/continue-V4MB3WQ3.js.map +1 -0
  50. package/dist/{copilot-cli-XPRJ5MQB.js → copilot-cli-7EPIJHFM.js} +12 -32
  51. package/dist/copilot-cli-7EPIJHFM.js.map +1 -0
  52. package/dist/{crush-3OB5ZTCC.js → crush-3AAA75C5.js} +4 -4
  53. package/dist/{cursor-F4HYO2FP.js → cursor-DTYZROKS.js} +5 -5
  54. package/dist/{detect-L3NJTBO5.js → detect-LWZEM7SN.js} +4 -4
  55. package/dist/{doctor-PUE4HO3N.js → doctor-54P4JFA6.js} +14 -14
  56. package/dist/{droid-NZCKYKOV.js → droid-QMNO5WZ2.js} +6 -12
  57. package/dist/droid-QMNO5WZ2.js.map +1 -0
  58. package/dist/{gemini-cli-3ZGCXUDD.js → gemini-cli-7JU7ZWQL.js} +19 -6
  59. package/dist/gemini-cli-7JU7ZWQL.js.map +1 -0
  60. package/dist/{goose-MGGNVXJP.js → goose-36TJNDKD.js} +16 -22
  61. package/dist/goose-36TJNDKD.js.map +1 -0
  62. package/dist/{hermes-L3CBJ37L.js → hermes-S4JZ6H42.js} +44 -22
  63. package/dist/hermes-S4JZ6H42.js.map +1 -0
  64. package/dist/{hook-S3DNNGZX.js → hook-UT3Q43AB.js} +12 -12
  65. package/dist/index.d.ts +2 -2
  66. package/dist/index.js +5 -5
  67. package/dist/{install-7SUJFRYO.js → install-F4OIDYAK.js} +14 -14
  68. package/dist/{introspect-B164-hj3.d.ts → introspect-BFcXpfUp.d.ts} +1 -1
  69. package/dist/{jetbrains-copilot-M2LHJBAW.js → jetbrains-copilot-6QLKUCAY.js} +17 -12
  70. package/dist/jetbrains-copilot-6QLKUCAY.js.map +1 -0
  71. package/dist/{kilo-RMRP2EL7.js → kilo-WLZOYKZK.js} +18 -55
  72. package/dist/kilo-WLZOYKZK.js.map +1 -0
  73. package/dist/{kilo-cli-6ITBNHTH.js → kilo-cli-FBX4OFIZ.js} +18 -55
  74. package/dist/kilo-cli-FBX4OFIZ.js.map +1 -0
  75. package/dist/{kimi-QYHWAY54.js → kimi-7YXRAQ6Z.js} +8 -4
  76. package/dist/kimi-7YXRAQ6Z.js.map +1 -0
  77. package/dist/{kiro-2K5UJVGC.js → kiro-CSBQA6EX.js} +5 -5
  78. package/dist/kiro-CSBQA6EX.js.map +1 -0
  79. package/dist/{leaderboard-2VAAOK3D.js → leaderboard-ZIAXBUWD.js} +5 -5
  80. package/dist/{mimo-code-K7AMX2QW.js → mimo-code-GYJNEULG.js} +21 -56
  81. package/dist/mimo-code-GYJNEULG.js.map +1 -0
  82. package/dist/{mux-GT7FWVLH.js → mux-DAIC3VY7.js} +4 -4
  83. package/dist/{nemoclaw-GQMS6CUM.js → nemoclaw-GS3XA7V2.js} +5 -5
  84. package/dist/{omp-2RPYIZUF.js → omp-O6KNB4MM.js} +17 -46
  85. package/dist/omp-O6KNB4MM.js.map +1 -0
  86. package/dist/{openclaw-P5GMEEGC.js → openclaw-344VBMLY.js} +5 -5
  87. package/dist/{opencode-5D2SK3EX.js → opencode-JPHRZPDQ.js} +21 -56
  88. package/dist/opencode-JPHRZPDQ.js.map +1 -0
  89. package/dist/{package-VUX663ET.js → package-5FRMSWRT.js} +11 -11
  90. package/dist/{pi-ZMM4KJTO.js → pi-EFBTBI2B.js} +4 -4
  91. package/dist/{qwen-code-4ZLVGN2C.js → qwen-code-CLSMTMHX.js} +12 -5
  92. package/dist/qwen-code-CLSMTMHX.js.map +1 -0
  93. package/dist/{roo-code-67QGLQRM.js → roo-code-YIX3RPR2.js} +4 -4
  94. package/dist/runtime/index.d.ts +1 -1
  95. package/dist/runtime/index.js +10 -10
  96. package/dist/sdk/index.d.ts +3 -3
  97. package/dist/sdk/index.js +6 -6
  98. package/dist/sdk/test.d.ts +2 -2
  99. package/dist/sdk/test.js +9 -9
  100. package/dist/{serve-MOIIYFER.js → serve-NQBXN4FG.js} +12 -12
  101. package/dist/{status-SCBCWS7H.js → status-5ZM6LXHV.js} +10 -10
  102. package/dist/{statusline-NRPDOPGA.js → statusline-O76BCBUK.js} +11 -11
  103. package/dist/{telemetry-Q55B5NSZ.js → telemetry-NO7UUUSJ.js} +10 -10
  104. package/dist/{trae-TMJPHWZ5.js → trae-JESXQKAF.js} +4 -4
  105. package/dist/{types-COSBYpKs.d.ts → types-ChUrvw0j.d.ts} +8 -8
  106. package/dist/{uninstall-SNI7GPQD.js → uninstall-QCROBR6A.js} +14 -14
  107. package/dist/{upgrade-ZUNBJWJ7.js → upgrade-KJ4QRZDZ.js} +14 -14
  108. package/dist/{usage-UQDBIU42.js → usage-UY6DCND6.js} +2 -2
  109. package/dist/{usage-event-HPG2BIAY.js → usage-event-T4HWQDZF.js} +11 -11
  110. package/dist/{vscode-copilot-H7JKUKLZ.js → vscode-copilot-56USZ5X4.js} +26 -19
  111. package/dist/vscode-copilot-56USZ5X4.js.map +1 -0
  112. package/dist/{warp-SVDVKQQI.js → warp-Y6JNLLGR.js} +4 -4
  113. package/dist/{windsurf-H36YKOMR.js → windsurf-X7QCJ3XR.js} +4 -4
  114. package/dist/{zed-LHWJALLZ.js → zed-L3ML5MHF.js} +4 -4
  115. package/package.json +2 -1
  116. package/dist/amazon-q-UFLBUSHG.js.map +0 -1
  117. package/dist/amp-5DJK7VAL.js.map +0 -1
  118. package/dist/chunk-3Q6YEDCG.js.map +0 -1
  119. package/dist/chunk-A767JFHW.js.map +0 -1
  120. package/dist/chunk-L7ESV37V.js.map +0 -1
  121. package/dist/chunk-M3H7PQWT.js.map +0 -1
  122. package/dist/chunk-QY42WGBX.js.map +0 -1
  123. package/dist/chunk-UXG64P6R.js.map +0 -1
  124. package/dist/chunk-VPSHGDDQ.js.map +0 -1
  125. package/dist/chunk-WZWK4ICE.js.map +0 -1
  126. package/dist/chunk-XW46WVR2.js.map +0 -1
  127. package/dist/chunk-ZY25RG4Y.js.map +0 -1
  128. package/dist/claude-code-HXIVRZCY.js.map +0 -1
  129. package/dist/codex-FLU37DV3.js.map +0 -1
  130. package/dist/continue-ZMI4YN75.js.map +0 -1
  131. package/dist/copilot-cli-XPRJ5MQB.js.map +0 -1
  132. package/dist/droid-NZCKYKOV.js.map +0 -1
  133. package/dist/gemini-cli-3ZGCXUDD.js.map +0 -1
  134. package/dist/goose-MGGNVXJP.js.map +0 -1
  135. package/dist/hermes-L3CBJ37L.js.map +0 -1
  136. package/dist/jetbrains-copilot-M2LHJBAW.js.map +0 -1
  137. package/dist/kilo-RMRP2EL7.js.map +0 -1
  138. package/dist/kilo-cli-6ITBNHTH.js.map +0 -1
  139. package/dist/kimi-QYHWAY54.js.map +0 -1
  140. package/dist/kiro-2K5UJVGC.js.map +0 -1
  141. package/dist/mimo-code-K7AMX2QW.js.map +0 -1
  142. package/dist/omp-2RPYIZUF.js.map +0 -1
  143. package/dist/opencode-5D2SK3EX.js.map +0 -1
  144. package/dist/qwen-code-4ZLVGN2C.js.map +0 -1
  145. package/dist/vscode-copilot-H7JKUKLZ.js.map +0 -1
  146. /package/dist/{action-72J2TCKQ.js.map → action-AIB2W4DU.js.map} +0 -0
  147. /package/dist/{antigravity-NWP2TUG6.js.map → antigravity-PM5NMS2J.js.map} +0 -0
  148. /package/dist/{antigravity-cli-KPNLE7X4.js.map → antigravity-cli-LN25XGWX.js.map} +0 -0
  149. /package/dist/{chunk-LETB5HCK.js.map → chunk-3QCDVSMX.js.map} +0 -0
  150. /package/dist/{chunk-ERV4TKRV.js.map → chunk-4K5HEGVE.js.map} +0 -0
  151. /package/dist/{chunk-ASHAMORS.js.map → chunk-AAOYOAQT.js.map} +0 -0
  152. /package/dist/{chunk-2RPHDVHW.js.map → chunk-AEQRMVRB.js.map} +0 -0
  153. /package/dist/{chunk-SBV2QJ5C.js.map → chunk-IDKI42JW.js.map} +0 -0
  154. /package/dist/{chunk-IKEXNI2W.js.map → chunk-KAEYJGK7.js.map} +0 -0
  155. /package/dist/{chunk-B47MDOV3.js.map → chunk-NFMHYIN2.js.map} +0 -0
  156. /package/dist/{chunk-5M2SMDA4.js.map → chunk-QP35SRUZ.js.map} +0 -0
  157. /package/dist/{chunk-CFM3JKIR.js.map → chunk-RFYQXT7C.js.map} +0 -0
  158. /package/dist/{chunk-E3GWKJU5.js.map → chunk-RGQTN7K3.js.map} +0 -0
  159. /package/dist/{chunk-F4DSMVZ7.js.map → chunk-ZQCT63JU.js.map} +0 -0
  160. /package/dist/{cline-AGFJF4AC.js.map → cline-KHZLG7CU.js.map} +0 -0
  161. /package/dist/{codebuff-YUQ4PN7G.js.map → codebuff-EQGWZEP4.js.map} +0 -0
  162. /package/dist/{crush-3OB5ZTCC.js.map → crush-3AAA75C5.js.map} +0 -0
  163. /package/dist/{cursor-F4HYO2FP.js.map → cursor-DTYZROKS.js.map} +0 -0
  164. /package/dist/{detect-L3NJTBO5.js.map → detect-LWZEM7SN.js.map} +0 -0
  165. /package/dist/{doctor-PUE4HO3N.js.map → doctor-54P4JFA6.js.map} +0 -0
  166. /package/dist/{hook-S3DNNGZX.js.map → hook-UT3Q43AB.js.map} +0 -0
  167. /package/dist/{install-7SUJFRYO.js.map → install-F4OIDYAK.js.map} +0 -0
  168. /package/dist/{leaderboard-2VAAOK3D.js.map → leaderboard-ZIAXBUWD.js.map} +0 -0
  169. /package/dist/{mux-GT7FWVLH.js.map → mux-DAIC3VY7.js.map} +0 -0
  170. /package/dist/{nemoclaw-GQMS6CUM.js.map → nemoclaw-GS3XA7V2.js.map} +0 -0
  171. /package/dist/{openclaw-P5GMEEGC.js.map → openclaw-344VBMLY.js.map} +0 -0
  172. /package/dist/{package-VUX663ET.js.map → package-5FRMSWRT.js.map} +0 -0
  173. /package/dist/{pi-ZMM4KJTO.js.map → pi-EFBTBI2B.js.map} +0 -0
  174. /package/dist/{roo-code-67QGLQRM.js.map → roo-code-YIX3RPR2.js.map} +0 -0
  175. /package/dist/{serve-MOIIYFER.js.map → serve-NQBXN4FG.js.map} +0 -0
  176. /package/dist/{status-SCBCWS7H.js.map → status-5ZM6LXHV.js.map} +0 -0
  177. /package/dist/{statusline-NRPDOPGA.js.map → statusline-O76BCBUK.js.map} +0 -0
  178. /package/dist/{telemetry-Q55B5NSZ.js.map → telemetry-NO7UUUSJ.js.map} +0 -0
  179. /package/dist/{trae-TMJPHWZ5.js.map → trae-JESXQKAF.js.map} +0 -0
  180. /package/dist/{uninstall-SNI7GPQD.js.map → uninstall-QCROBR6A.js.map} +0 -0
  181. /package/dist/{upgrade-ZUNBJWJ7.js.map → upgrade-KJ4QRZDZ.js.map} +0 -0
  182. /package/dist/{usage-UQDBIU42.js.map → usage-UY6DCND6.js.map} +0 -0
  183. /package/dist/{usage-event-HPG2BIAY.js.map → usage-event-T4HWQDZF.js.map} +0 -0
  184. /package/dist/{warp-SVDVKQQI.js.map → warp-Y6JNLLGR.js.map} +0 -0
  185. /package/dist/{windsurf-H36YKOMR.js.map → windsurf-X7QCJ3XR.js.map} +0 -0
  186. /package/dist/{zed-LHWJALLZ.js.map → zed-L3ML5MHF.js.map} +0 -0
@@ -4,39 +4,39 @@
4
4
  var ADAPTER_REGISTRY = [
5
5
  {
6
6
  id: "claude-code",
7
- load: () => import("./claude-code-HXIVRZCY.js").then((m) => m.default)
7
+ load: () => import("./claude-code-GCXXEWUN.js").then((m) => m.default)
8
8
  },
9
9
  {
10
10
  id: "codex",
11
- load: () => import("./codex-FLU37DV3.js").then((m) => m.default)
11
+ load: () => import("./codex-7X7RC6JJ.js").then((m) => m.default)
12
12
  },
13
13
  {
14
14
  id: "cursor",
15
- load: () => import("./cursor-F4HYO2FP.js").then((m) => m.default)
15
+ load: () => import("./cursor-DTYZROKS.js").then((m) => m.default)
16
16
  },
17
17
  // vscode-copilot after cursor: cursor is a VS Code fork, so the fork's runtime
18
18
  // markers must be checked first during host detection.
19
19
  {
20
20
  id: "vscode-copilot",
21
- load: () => import("./vscode-copilot-H7JKUKLZ.js").then((m) => m.default)
21
+ load: () => import("./vscode-copilot-56USZ5X4.js").then((m) => m.default)
22
22
  },
23
23
  {
24
24
  id: "copilot-cli",
25
- load: () => import("./copilot-cli-XPRJ5MQB.js").then((m) => m.default)
25
+ load: () => import("./copilot-cli-7EPIJHFM.js").then((m) => m.default)
26
26
  },
27
27
  {
28
28
  id: "gemini-cli",
29
- load: () => import("./gemini-cli-3ZGCXUDD.js").then((m) => m.default)
29
+ load: () => import("./gemini-cli-7JU7ZWQL.js").then((m) => m.default)
30
30
  },
31
31
  {
32
32
  id: "warp",
33
- load: () => import("./warp-SVDVKQQI.js").then((m) => m.default)
33
+ load: () => import("./warp-Y6JNLLGR.js").then((m) => m.default)
34
34
  },
35
35
  // ts-plugin paradigm: OpenCode loads a generated plugin module that bridges
36
36
  // its in-process events to the universal hook entrypoint.
37
37
  {
38
38
  id: "opencode",
39
- load: () => import("./opencode-5D2SK3EX.js").then((m) => m.default)
39
+ load: () => import("./opencode-JPHRZPDQ.js").then((m) => m.default)
40
40
  },
41
41
  // mimo-code is Xiaomi's MiMoCode (@mimo-ai/cli, bin `mimo`) — an OpenCode FORK
42
42
  // (ts-plugin, MCP root key "mcp", ~/.config/mimocode/mimocode.json). Grouped
@@ -45,7 +45,7 @@ var ADAPTER_REGISTRY = [
45
45
  // constraint vs opencode (no shared config file to disambiguate).
46
46
  {
47
47
  id: "mimo-code",
48
- load: () => import("./mimo-code-K7AMX2QW.js").then((m) => m.default)
48
+ load: () => import("./mimo-code-GYJNEULG.js").then((m) => m.default)
49
49
  },
50
50
  // kilo-cli is the SQLite-backed OpenCode FORK command-line product (ts-plugin,
51
51
  // loads @kilocode/plugin modules registered in kilo.jsonc's "plugin" array;
@@ -54,23 +54,23 @@ var ADAPTER_REGISTRY = [
54
54
  // the "kilo" extension so there is no fork-ordering constraint between them.
55
55
  {
56
56
  id: "kilo-cli",
57
- load: () => import("./kilo-cli-6ITBNHTH.js").then((m) => m.default)
57
+ load: () => import("./kilo-cli-FBX4OFIZ.js").then((m) => m.default)
58
58
  },
59
59
  // Wave 1 — mcp-only adapters (no lifecycle hooks; MCP registration only).
60
60
  {
61
61
  id: "droid",
62
- load: () => import("./droid-NZCKYKOV.js").then((m) => m.default)
62
+ load: () => import("./droid-QMNO5WZ2.js").then((m) => m.default)
63
63
  },
64
64
  {
65
65
  id: "roo-code",
66
- load: () => import("./roo-code-67QGLQRM.js").then((m) => m.default)
66
+ load: () => import("./roo-code-YIX3RPR2.js").then((m) => m.default)
67
67
  },
68
68
  // kilo is the Kilo Code VS Code extension (kilocode.kilo-code) — a Roo/Cline
69
69
  // fork, so it sits beside roo-code (mcp-only, root key "mcpServers", VS Code
70
70
  // globalStorage / .kilocode project scope). Distinct host from "kilo-cli".
71
71
  {
72
72
  id: "kilo",
73
- load: () => import("./kilo-RMRP2EL7.js").then((m) => m.default)
73
+ load: () => import("./kilo-WLZOYKZK.js").then((m) => m.default)
74
74
  },
75
75
  // cline is the Cline VS Code extension (saoudrizwan.claude-dev) — the most-
76
76
  // installed AI coding extension and the PARENT that roo-code and kilo forked.
@@ -81,11 +81,11 @@ var ADAPTER_REGISTRY = [
81
81
  // is NO fork-before-parent ordering constraint here; it simply sits beside them.
82
82
  {
83
83
  id: "cline",
84
- load: () => import("./cline-AGFJF4AC.js").then((m) => m.default)
84
+ load: () => import("./cline-KHZLG7CU.js").then((m) => m.default)
85
85
  },
86
86
  {
87
87
  id: "trae",
88
- load: () => import("./trae-TMJPHWZ5.js").then((m) => m.default)
88
+ load: () => import("./trae-JESXQKAF.js").then((m) => m.default)
89
89
  },
90
90
  // antigravity-cli BEFORE antigravity: the `agy` CLI is a fork of the IDE
91
91
  // adapter with its own runtime markers (the universal hook command tags the
@@ -93,69 +93,69 @@ var ADAPTER_REGISTRY = [
93
93
  // before the IDE/parent during host detection.
94
94
  {
95
95
  id: "antigravity-cli",
96
- load: () => import("./antigravity-cli-KPNLE7X4.js").then((m) => m.default)
96
+ load: () => import("./antigravity-cli-LN25XGWX.js").then((m) => m.default)
97
97
  },
98
98
  {
99
99
  id: "antigravity",
100
- load: () => import("./antigravity-NWP2TUG6.js").then((m) => m.default)
100
+ load: () => import("./antigravity-PM5NMS2J.js").then((m) => m.default)
101
101
  },
102
102
  {
103
103
  id: "zed",
104
- load: () => import("./zed-LHWJALLZ.js").then((m) => m.default)
104
+ load: () => import("./zed-L3ML5MHF.js").then((m) => m.default)
105
105
  },
106
106
  {
107
107
  id: "amp",
108
- load: () => import("./amp-5DJK7VAL.js").then((m) => m.default)
108
+ load: () => import("./amp-ZYRC2VCH.js").then((m) => m.default)
109
109
  },
110
110
  {
111
111
  id: "codebuff",
112
- load: () => import("./codebuff-YUQ4PN7G.js").then((m) => m.default)
112
+ load: () => import("./codebuff-EQGWZEP4.js").then((m) => m.default)
113
113
  },
114
114
  {
115
115
  id: "mux",
116
- load: () => import("./mux-GT7FWVLH.js").then((m) => m.default)
116
+ load: () => import("./mux-DAIC3VY7.js").then((m) => m.default)
117
117
  },
118
118
  // Pi — mcp-only host with no writable MCP config; drives the Agent Skills
119
119
  // surface only (writes <piDir>/skills/<name>/SKILL.md).
120
120
  {
121
121
  id: "pi",
122
- load: () => import("./pi-ZMM4KJTO.js").then((m) => m.default)
122
+ load: () => import("./pi-EFBTBI2B.js").then((m) => m.default)
123
123
  },
124
124
  // Wave 2 — json-stdio adapters (full hook dispatch via the universal entrypoint).
125
125
  // jetbrains-copilot before vscode-copilot is unnecessary (distinct hosts); grouped here.
126
126
  {
127
127
  id: "jetbrains-copilot",
128
- load: () => import("./jetbrains-copilot-M2LHJBAW.js").then((m) => m.default)
128
+ load: () => import("./jetbrains-copilot-6QLKUCAY.js").then((m) => m.default)
129
129
  },
130
130
  {
131
131
  id: "qwen-code",
132
- load: () => import("./qwen-code-4ZLVGN2C.js").then((m) => m.default)
132
+ load: () => import("./qwen-code-CLSMTMHX.js").then((m) => m.default)
133
133
  },
134
134
  {
135
135
  id: "kiro",
136
- load: () => import("./kiro-2K5UJVGC.js").then((m) => m.default)
136
+ load: () => import("./kiro-CSBQA6EX.js").then((m) => m.default)
137
137
  },
138
138
  {
139
139
  id: "kimi",
140
- load: () => import("./kimi-QYHWAY54.js").then((m) => m.default)
140
+ load: () => import("./kimi-7YXRAQ6Z.js").then((m) => m.default)
141
141
  },
142
142
  {
143
143
  id: "crush",
144
- load: () => import("./crush-3OB5ZTCC.js").then((m) => m.default)
144
+ load: () => import("./crush-3AAA75C5.js").then((m) => m.default)
145
145
  },
146
146
  // Wave 3 — json-stdio adapters with YAML config (MCP in YAML; hooks per host).
147
147
  {
148
148
  id: "goose",
149
- load: () => import("./goose-MGGNVXJP.js").then((m) => m.default)
149
+ load: () => import("./goose-36TJNDKD.js").then((m) => m.default)
150
150
  },
151
151
  {
152
152
  id: "hermes",
153
- load: () => import("./hermes-L3CBJ37L.js").then((m) => m.default)
153
+ load: () => import("./hermes-S4JZ6H42.js").then((m) => m.default)
154
154
  },
155
155
  // Wave 4 — ts-plugin adapters (generate a bridge module to the universal entrypoint).
156
156
  {
157
157
  id: "omp",
158
- load: () => import("./omp-2RPYIZUF.js").then((m) => m.default)
158
+ load: () => import("./omp-O6KNB4MM.js").then((m) => m.default)
159
159
  },
160
160
  // nemoclaw BEFORE openclaw (fork-before-parent convention). NVIDIA NemoClaw
161
161
  // wraps OpenClaw and DRIVES the SAME ~/.openclaw/openclaw.json, so a NemoClaw
@@ -168,11 +168,11 @@ var ADAPTER_REGISTRY = [
168
168
  // lands in the wrapped openclaw.json.
169
169
  {
170
170
  id: "nemoclaw",
171
- load: () => import("./nemoclaw-GQMS6CUM.js").then((m) => m.default)
171
+ load: () => import("./nemoclaw-GS3XA7V2.js").then((m) => m.default)
172
172
  },
173
173
  {
174
174
  id: "openclaw",
175
- load: () => import("./openclaw-P5GMEEGC.js").then((m) => m.default)
175
+ load: () => import("./openclaw-344VBMLY.js").then((m) => m.default)
176
176
  },
177
177
  // Wave 5 — mcp-only: Amazon Q Developer CLI. JSON MCP config under ~/.aws/amazonq/
178
178
  // (user) and .amazonq/ (project); root key "mcpServers"; bare stdio entry
@@ -182,7 +182,7 @@ var ADAPTER_REGISTRY = [
182
182
  // adapter installs MCP entries + the .amazonq/rules memory surface.
183
183
  {
184
184
  id: "amazon-q",
185
- load: () => import("./amazon-q-UFLBUSHG.js").then((m) => m.default)
185
+ load: () => import("./amazon-q-PH7OFPJD.js").then((m) => m.default)
186
186
  },
187
187
  // Continue (the `cn` terminal agent / Continue.dev, npm @continuedev/cli) —
188
188
  // json-stdio (Claude-compatible hooks). MCP config is YAML at ~/.continue/config.yaml (user) and
@@ -194,7 +194,7 @@ var ADAPTER_REGISTRY = [
194
194
  // fork-ordering constraint vs any sibling.
195
195
  {
196
196
  id: "continue",
197
- load: () => import("./continue-ZMI4YN75.js").then((m) => m.default)
197
+ load: () => import("./continue-V4MB3WQ3.js").then((m) => m.default)
198
198
  },
199
199
  // Windsurf (Codeium / Cognition's Cascade agent) — mcp-only. USER/GLOBAL scope
200
200
  // ONLY: MCP config is JSON at ~/.codeium/windsurf/mcp_config.json (the docs
@@ -208,7 +208,7 @@ var ADAPTER_REGISTRY = [
208
208
  // memory surface. Distinct ~/.codeium marker — no fork-ordering constraint.
209
209
  {
210
210
  id: "windsurf",
211
- load: () => import("./windsurf-H36YKOMR.js").then((m) => m.default)
211
+ load: () => import("./windsurf-X7QCJ3XR.js").then((m) => m.default)
212
212
  }
213
213
  ];
214
214
  var REGISTRY_BY_ID = new Map(
@@ -234,4 +234,4 @@ export {
234
234
  loadAdapter,
235
235
  allAdapters
236
236
  };
237
- //# sourceMappingURL=chunk-SBV2QJ5C.js.map
237
+ //# sourceMappingURL=chunk-IDKI42JW.js.map
@@ -1,18 +1,22 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  REGISTERED_PLATFORM_IDS
4
- } from "./chunk-SBV2QJ5C.js";
4
+ } from "./chunk-IDKI42JW.js";
5
5
  import {
6
6
  CONFIG_PATCH_SEGMENT_RE,
7
7
  configPatchNamespaceViolation,
8
8
  isJsonValue,
9
9
  isValidConfigPatchKey
10
- } from "./chunk-L7ESV37V.js";
10
+ } from "./chunk-BZOOVTFG.js";
11
11
  import {
12
12
  MANAGED_BLOCK_BEGIN_TOKEN,
13
13
  MANAGED_BLOCK_END_TOKEN,
14
14
  MEMORY_CONTENT_HARD_CAP_BYTES
15
- } from "./chunk-ZY25RG4Y.js";
15
+ } from "./chunk-LBOGRZGY.js";
16
+ import {
17
+ CONNECTOR_ID_RE,
18
+ isValidConnectorId
19
+ } from "./chunk-D65GIBCG.js";
16
20
 
17
21
  // src/core/define-connector.ts
18
22
  import { isAbsolute, normalize } from "path";
@@ -44,7 +48,6 @@ var REGISTRY_NAMESPACE_RE = /^[a-zA-Z0-9.-]+$/;
44
48
  var REGISTRY_NAME_RE = /^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;
45
49
 
46
50
  // src/core/define-connector.ts
47
- var ID_RE = /^[a-z0-9][a-z0-9-]*$/;
48
51
  var SURFACE_NAME_RE = /^[a-z0-9][a-z0-9-]*$/;
49
52
  var SKILL_DESCRIPTION_MAX = 1024;
50
53
  var ALL_EVENTS = [
@@ -76,9 +79,9 @@ function defineConnector(config) {
76
79
  if (!config || typeof config !== "object") {
77
80
  throw new ConnectorConfigError("config must be an object");
78
81
  }
79
- if (typeof config.id !== "string" || !ID_RE.test(config.id)) {
82
+ if (!isValidConnectorId(config.id)) {
80
83
  throw new ConnectorConfigError(
81
- `id must be kebab-case matching ${ID_RE} (got ${JSON.stringify(config.id)})`
84
+ `id must be kebab-case matching ${CONNECTOR_ID_RE} (got ${JSON.stringify(config.id)})`
82
85
  );
83
86
  }
84
87
  const hasCommands = Array.isArray(config.commands) && config.commands.length > 0;
@@ -495,4 +498,4 @@ export {
495
498
  defineConfigPatch,
496
499
  defineNativeHook
497
500
  };
498
- //# sourceMappingURL=chunk-WZWK4ICE.js.map
501
+ //# sourceMappingURL=chunk-JZIM33C2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/define-connector.ts","../src/core/mcp-standard.ts"],"sourcesContent":["/**\n * core/define-connector — the public write-once entry point.\n *\n * Validates a ConnectorConfig and normalizes it into a ResolvedConnector with\n * every optional field resolved to a default. Validation is intentionally\n * dependency-free (no zod) to keep the single-binary install lean.\n */\n\nimport { isAbsolute, normalize } from \"node:path\";\n\nimport type {\n ActionDef,\n CommandDef,\n ConfigPatchDef,\n ConnectorConfig,\n HookDefinition,\n HookEventName,\n HooksConfig,\n MemoryDef,\n NativeHookDef,\n PlatformId,\n PublishConfig,\n ResolvedConnector,\n SkillDef,\n StatuslineDef,\n SubagentDef,\n} from \"./types.js\";\nimport { REGISTERED_PLATFORM_IDS } from \"../adapters/registry.js\";\nimport { REGISTRY_NAMESPACE_RE } from \"./mcp-standard.js\";\nimport { CONNECTOR_ID_RE, isValidConnectorId } from \"./ids.js\";\nimport {\n MANAGED_BLOCK_BEGIN_TOKEN,\n MANAGED_BLOCK_END_TOKEN,\n MEMORY_CONTENT_HARD_CAP_BYTES,\n} from \"./managed-block.js\";\nimport {\n CONFIG_PATCH_SEGMENT_RE,\n configPatchNamespaceViolation,\n isJsonValue,\n isValidConfigPatchKey,\n} from \"./config-patch-ledger.js\";\n\n/** kebab-case name regex shared by command/skill/subagent names. */\nconst SURFACE_NAME_RE = /^[a-z0-9][a-z0-9-]*$/;\n\n/** Max length of a skill description (Agent Skills open standard). */\nconst SKILL_DESCRIPTION_MAX = 1024;\n\n// NOTE: canonical ordering — append new events at the END (hookEvents ordering\n// is pinned by tests and feeds install-file ordering). Exported so the\n// hook-dispatch gate + Claude-bundle event sets can be drift-tested against it.\nexport const ALL_EVENTS: HookEventName[] = [\n \"SessionStart\",\n \"SessionEnd\",\n \"UserPromptSubmit\",\n \"PreToolUse\",\n \"PostToolUse\",\n \"PreCompact\",\n \"Stop\",\n \"Notification\",\n \"PermissionRequest\",\n \"PostToolUseFailure\",\n \"SubagentStart\",\n \"SubagentStop\",\n \"PostCompact\",\n];\n\n/** Thrown on an invalid connector configuration. */\nexport class ConnectorConfigError extends Error {\n constructor(message: string) {\n super(`Invalid connector config: ${message}`);\n this.name = \"ConnectorConfigError\";\n }\n}\n\nfunction declaredEvents(hooks: HooksConfig | undefined): HookEventName[] {\n if (!hooks) return [];\n return ALL_EVENTS.filter((e) => typeof hooks[e]?.handler === \"function\");\n}\n\n/**\n * Validate + normalize a connector definition.\n * Returns a ResolvedConnector that adapters and the CLI consume directly.\n */\nexport function defineConnector(config: ConnectorConfig): ResolvedConnector {\n if (!config || typeof config !== \"object\") {\n throw new ConnectorConfigError(\"config must be an object\");\n }\n if (!isValidConnectorId(config.id)) {\n throw new ConnectorConfigError(\n `id must be kebab-case matching ${CONNECTOR_ID_RE} (got ${JSON.stringify(config.id)})`,\n );\n }\n const hasCommands = Array.isArray(config.commands) && config.commands.length > 0;\n const hasSkills = Array.isArray(config.skills) && config.skills.length > 0;\n const hasSubagents = Array.isArray(config.subagents) && config.subagents.length > 0;\n const hasMemory = Array.isArray(config.memory) && config.memory.length > 0;\n // A statusline (a HUD) is a legitimate sole payload — a connector whose whole\n // job is rendering a status line. SINGULAR (one per connector), so a plain\n // presence check (object with a render handler — validated in normalizeStatusline).\n const hasStatusline = config.statusline != null;\n // Actions (each a user-invokable run handler) are a legitimate sole payload —\n // a connector whose whole job is shipping dispatchable actions.\n const hasActions = Array.isArray(config.actions) && config.actions.length > 0;\n // A platform-scoped nativeHooks declaration is a legitimate sole payload\n // (a hooks-only connector wired entirely through native passthrough events).\n const hasNativeHooks = Object.values(config.platforms ?? {}).some(\n (override) =>\n override?.nativeHooks != null && Object.keys(override.nativeHooks).length > 0,\n );\n // Likewise a platform-scoped configPatch declaration (a connector whose whole\n // job is asserting a host config key, e.g. an experimental feature flag).\n const hasConfigPatch = Object.values(config.platforms ?? {}).some(\n (override) => Array.isArray(override?.configPatch) && override.configPatch.length > 0,\n );\n if (\n !config.server &&\n !config.hooks &&\n !hasCommands &&\n !hasSkills &&\n !hasSubagents &&\n !hasMemory &&\n !hasStatusline &&\n !hasActions &&\n !hasNativeHooks &&\n !hasConfigPatch\n ) {\n throw new ConnectorConfigError(\n \"a connector must declare at least one of `server`, `hooks`, `commands`, `skills`, `subagents`, `memory`, `statusline`, `actions`, \" +\n \"or a per-platform `nativeHooks` / `configPatch` declaration\",\n );\n }\n\n if (config.server) {\n const s = config.server;\n if (s.transport === \"stdio\") {\n if (!s.command || typeof s.command !== \"string\") {\n throw new ConnectorConfigError(\n \"server.command is required for stdio transport\",\n );\n }\n } else {\n if (!s.url || typeof s.url !== \"string\") {\n throw new ConnectorConfigError(\n `server.url is required for ${s.transport} transport`,\n );\n }\n }\n }\n\n // Validate hook handlers are functions, plus any per-host override map.\n if (config.hooks) {\n for (const ev of ALL_EVENTS) {\n const def = config.hooks[ev];\n if (def != null && typeof def.handler !== \"function\") {\n throw new ConnectorConfigError(`hooks.${ev}.handler must be a function`);\n }\n // Per-host override map: every key must be a registered platform id and\n // every entry's handler a function (author-time hard error, not skip-warn).\n validateHostsMap(def?.hosts, `hooks.${ev}.hosts`, \"handler\");\n }\n }\n\n // Validate per-platform native passthrough hooks (handlers live in this same\n // config module, exactly like normalized hooks — the resolved connector keeps\n // `platforms` verbatim, so live handlers survive resolution and are recovered\n // at runtime by re-importing the module via the registry's modulePath).\n validateNativeHooks(config.platforms);\n\n // Validate per-platform declarative config patches (pure JSON — persisted\n // whole; semantics are FIXED set-if-absent/skip-warn, so only the shape is\n // validated here; the host adapter enforces its sensitive-key denylist).\n validateConfigPatches(config.platforms);\n\n const commands = normalizeCommands(config.commands);\n const skills = normalizeSkills(config.skills);\n const subagents = normalizeSubagents(config.subagents);\n const memory = normalizeMemory(config.memory);\n const statusline = normalizeStatusline(config.statusline);\n const actions = normalizeActions(config.actions);\n\n const t = config.telemetry ?? {};\n\n const resolved: ResolvedConnector = {\n id: config.id,\n displayName: config.displayName ?? config.id,\n version: config.version ?? \"0.0.0\",\n ...(config.server ? { server: normalizeServer(config.server) } : {}),\n hooks: config.hooks ?? {},\n hookEvents: declaredEvents(config.hooks),\n telemetry: {\n enabled: t.enabled ?? true,\n modelFamilyHint: t.modelFamilyHint ?? \"auto\",\n measureToolDefs: t.measureToolDefs ?? true,\n // OPT-IN: host-native turn-usage capture is OFF unless explicitly enabled\n // in config (or forced on at install via AGENT_CONNECTOR_HOST_NATIVE=1).\n hostNativeUsage: t.hostNativeUsage ?? false,\n store: t.store ?? \"ndjson\",\n calibration: {\n anthropicCountTokens: t.calibration?.anthropicCountTokens ?? false,\n },\n },\n commands,\n skills,\n subagents,\n memory,\n ...(statusline ? { statusline } : {}),\n actions,\n platforms: config.platforms ?? {},\n targets: config.targets ?? \"auto\",\n ...(config.publish ? { publish: normalizePublish(config.publish) } : {}),\n };\n\n return resolved;\n}\n\n/** The 13 normalized event names, for the nativeHooks collision check. */\nconst NORMALIZED_EVENT_SET: ReadonlySet<string> = new Set(ALL_EVENTS);\n\n/**\n * Validate a per-host override map (`hosts?:`) declared on a hook definition or\n * on the statusline. Shared by the hook-validation loop and normalizeStatusline:\n * - the value must be a plain object keyed by platform id;\n * - every key MUST be a REGISTERED platform id (REGISTERED_PLATFORM_IDS) —\n * an unknown id is an author-time ConnectorConfigError (NOT a skip-warn:\n * a typo'd host would otherwise silently never fire);\n * - every entry's implementation field (`handler` for hooks, `render` for\n * statusline, `run` for actions) MUST be a function (it is re-imported from\n * the connector module at runtime, like the top-level handler/render/run).\n * `undefined` (no map) is valid and skipped.\n */\nfunction validateHostsMap(\n map: unknown,\n surfaceLabel: string,\n implField: \"handler\" | \"render\" | \"run\",\n): void {\n if (map == null) return;\n if (typeof map !== \"object\" || Array.isArray(map)) {\n throw new ConnectorConfigError(\n `${surfaceLabel} must be an object keyed by platform id`,\n );\n }\n for (const [platformId, entry] of Object.entries(map as Record<string, unknown>)) {\n if (!REGISTERED_PLATFORM_IDS.has(platformId as PlatformId)) {\n const valid = [...REGISTERED_PLATFORM_IDS].sort().join(\", \");\n throw new ConnectorConfigError(\n `unknown platform id \"${platformId}\" in hosts map for ${surfaceLabel}; valid ids: ${valid}`,\n );\n }\n if (\n entry == null ||\n typeof entry !== \"object\" ||\n typeof (entry as Record<string, unknown>)[implField] !== \"function\"\n ) {\n throw new ConnectorConfigError(\n `${surfaceLabel}.${platformId}.${implField} must be a function`,\n );\n }\n }\n}\n\n/**\n * Validate every `platforms[<id>].nativeHooks` declaration:\n * - the value must be an object keyed by HOST-NATIVE event name;\n * - an event name must NOT collide with the normalized {@link HookEventName}\n * union (those belong in the cross-platform `hooks` API, which gets\n * normalization, matcher evaluation, and HookResponse mapping);\n * - each handler must be a function (it is re-imported from the config module\n * at runtime, like normalized hook handlers);\n * - `matcher`, when present, must be a string (written verbatim into the\n * host's hook config — the host evaluates it).\n */\nfunction validateNativeHooks(platforms: ConnectorConfig[\"platforms\"]): void {\n if (platforms == null) return;\n for (const [platformId, override] of Object.entries(platforms)) {\n const native = override?.nativeHooks;\n if (native == null) continue;\n const where = `platforms.${platformId}.nativeHooks`;\n if (typeof native !== \"object\" || Array.isArray(native)) {\n throw new ConnectorConfigError(\n `${where} must be an object keyed by host-native event name`,\n );\n }\n for (const [event, def] of Object.entries(native)) {\n if (NORMALIZED_EVENT_SET.has(event)) {\n throw new ConnectorConfigError(\n `${where}.${event} collides with the normalized hook event \"${event}\"; ` +\n `declare it under \\`hooks.${event}\\` (the normalized, cross-platform hooks API) instead`,\n );\n }\n if (def == null || typeof def !== \"object\" || typeof def.handler !== \"function\") {\n throw new ConnectorConfigError(`${where}.${event}.handler must be a function`);\n }\n if (def.matcher !== undefined && typeof def.matcher !== \"string\") {\n throw new ConnectorConfigError(`${where}.${event}.matcher must be a string`);\n }\n }\n }\n}\n\n/**\n * Validate every `platforms[<id>].configPatch` declaration:\n * - the value must be an array of patch objects;\n * - `key` must be a dotted LEAF path whose segments match\n * {@link CONFIG_PATCH_SEGMENT_RE} — no dots-in-key, no array indices;\n * - `key` must not collide with the agent-connector-modeled namespace\n * (`hooks*` → hooks/nativeHooks; `mcpServers*` & friends → server/extra);\n * - duplicate keys within one platform's list are rejected (a duplicate\n * would double-apply / fight itself on refcounts);\n * - `value` must be JSON-serializable data (it is persisted whole in the\n * connector record and in the ownership ledger);\n * - `reason` is REQUIRED (printed in the install diff and every skip-warn);\n * - `docsUrl`, when present, must be a string.\n * The HOST-side sensitive-key denylist is deliberately NOT validated here —\n * it lives in (and is documented by) each supporting adapter.\n */\nfunction validateConfigPatches(platforms: ConnectorConfig[\"platforms\"]): void {\n if (platforms == null) return;\n for (const [platformId, override] of Object.entries(platforms)) {\n const patches = override?.configPatch;\n if (patches == null) continue;\n const where = `platforms.${platformId}.configPatch`;\n if (!Array.isArray(patches)) {\n throw new ConnectorConfigError(`${where} must be an array of patch objects`);\n }\n const seen = new Set<string>();\n patches.forEach((patch, i) => {\n if (patch == null || typeof patch !== \"object\" || Array.isArray(patch)) {\n throw new ConnectorConfigError(`${where}[${i}] must be an object`);\n }\n if (!isValidConfigPatchKey(patch.key)) {\n throw new ConnectorConfigError(\n `${where}[${i}].key must be a dotted LEAF path whose segments match ` +\n `${CONFIG_PATCH_SEGMENT_RE} (no dots-in-key, no array indices); ` +\n `got ${JSON.stringify(patch.key)}`,\n );\n }\n const violation = configPatchNamespaceViolation(patch.key);\n if (violation) {\n throw new ConnectorConfigError(`${where}[${i}].key ${violation}`);\n }\n if (seen.has(patch.key)) {\n throw new ConnectorConfigError(\n `${where}[${i}] duplicate key \"${patch.key}\"`,\n );\n }\n seen.add(patch.key);\n if (!isJsonValue(patch.value)) {\n throw new ConnectorConfigError(\n `${where}[${i}].value must be JSON-serializable data ` +\n `(string/finite number/boolean/null/array/plain object)`,\n );\n }\n if (typeof patch.reason !== \"string\" || patch.reason.trim() === \"\") {\n throw new ConnectorConfigError(\n `${where}[${i}].reason is required (a human-readable why, printed in ` +\n `the install diff and every skip-warn)`,\n );\n }\n if (patch.docsUrl !== undefined && typeof patch.docsUrl !== \"string\") {\n throw new ConnectorConfigError(`${where}[${i}].docsUrl must be a string`);\n }\n });\n }\n}\n\n/**\n * Validate the optional `publish` block (registry server.json + MCPB bundle\n * distribution metadata). Light, dependency-free: we only reject shapes that\n * would emit a clearly INVALID standard artifact. The per-format required-field\n * checks (e.g. server.json needs registryNamespace, mcpb needs author.name)\n * live in the emitters so a connector that never publishes pays nothing.\n */\nfunction normalizePublish(publish: PublishConfig): PublishConfig {\n if (typeof publish !== \"object\" || Array.isArray(publish)) {\n throw new ConnectorConfigError(\"publish must be an object\");\n }\n if (publish.registryNamespace !== undefined) {\n const ns = publish.registryNamespace;\n if (typeof ns !== \"string\" || !REGISTRY_NAMESPACE_RE.test(ns)) {\n throw new ConnectorConfigError(\n `publish.registryNamespace must be a reverse-DNS namespace matching ${REGISTRY_NAMESPACE_RE} ` +\n `(e.g. \"io.github.acme\" or \"com.acme\"); got ${JSON.stringify(ns)}`,\n );\n }\n }\n if (publish.packageName !== undefined && typeof publish.packageName !== \"string\") {\n throw new ConnectorConfigError(\"publish.packageName must be a string\");\n }\n if (publish.author !== undefined) {\n const a = publish.author;\n if (typeof a !== \"object\" || a == null || typeof a.name !== \"string\" || a.name === \"\") {\n throw new ConnectorConfigError(\"publish.author.name must be a non-empty string\");\n }\n }\n return { ...publish };\n}\n\n/** Validate a surface name (kebab-case) or throw a ConnectorConfigError. */\nfunction assertSurfaceName(\n surface: string,\n name: unknown,\n index: number,\n field = \"name\",\n): string {\n if (typeof name !== \"string\" || !SURFACE_NAME_RE.test(name)) {\n throw new ConnectorConfigError(\n `${surface}[${index}].${field} must be kebab-case matching ${SURFACE_NAME_RE} (got ${JSON.stringify(name)})`,\n );\n }\n return name;\n}\n\n/** Require a non-empty string field on a surface entry. */\nfunction assertNonEmptyString(\n surface: string,\n index: number,\n field: string,\n value: unknown,\n): string {\n if (typeof value !== \"string\" || value.length === 0) {\n throw new ConnectorConfigError(`${surface}[${index}].${field} must be a non-empty string`);\n }\n return value;\n}\n\n/** Detect a duplicate surface name within one array, throwing on collision. */\nfunction assertNoDuplicate(\n surface: string,\n seen: Set<string>,\n name: string,\n index: number,\n field = \"name\",\n): void {\n if (seen.has(name)) {\n throw new ConnectorConfigError(`${surface}[${index}] duplicate ${field} \"${name}\"`);\n }\n seen.add(name);\n}\n\nfunction normalizeCommands(input: CommandDef[] | undefined): CommandDef[] {\n if (input == null) return [];\n if (!Array.isArray(input)) {\n throw new ConnectorConfigError(\"commands must be an array\");\n }\n const seen = new Set<string>();\n return input.map((cmd, i) => {\n if (!cmd || typeof cmd !== \"object\") {\n throw new ConnectorConfigError(`commands[${i}] must be an object`);\n }\n const name = assertSurfaceName(\"commands\", cmd.name, i);\n assertNoDuplicate(\"commands\", seen, name, i);\n assertNonEmptyString(\"commands\", i, \"prompt\", cmd.prompt);\n // Pass through verbatim (content); arrays are content, not handlers.\n return { ...cmd, name };\n });\n}\n\nfunction normalizeSkills(input: SkillDef[] | undefined): SkillDef[] {\n if (input == null) return [];\n if (!Array.isArray(input)) {\n throw new ConnectorConfigError(\"skills must be an array\");\n }\n const seen = new Set<string>();\n return input.map((skill, i) => {\n if (!skill || typeof skill !== \"object\") {\n throw new ConnectorConfigError(`skills[${i}] must be an object`);\n }\n const name = assertSurfaceName(\"skills\", skill.name, i);\n assertNoDuplicate(\"skills\", seen, name, i);\n const description = assertNonEmptyString(\"skills\", i, \"description\", skill.description);\n if (description.length > SKILL_DESCRIPTION_MAX) {\n throw new ConnectorConfigError(\n `skills[${i}].description exceeds ${SKILL_DESCRIPTION_MAX} chars (got ${description.length})`,\n );\n }\n assertNonEmptyString(\"skills\", i, \"body\", skill.body);\n assertSafeResourceKeys(\"skills\", i, skill.resources);\n return { ...skill, name };\n });\n}\n\n/**\n * Validate every `skill.resources` key as a SAFE relative path that stays inside\n * the skill dir. Each resource is later written/removed via join(skillDir, rel)\n * by every adapter, so an unvalidated key like \"../../settings.json\" would\n * escape the skill dir → arbitrary file write/delete. Reject (throw) when a key\n * is empty/\".\", absolute, or normalizes to a path that begins with \"..\" or\n * contains a \"/..\" (or platform-sep) traversal segment.\n */\nfunction assertSafeResourceKeys(\n surface: string,\n index: number,\n resources: Record<string, string> | undefined,\n): void {\n if (resources == null) return;\n if (typeof resources !== \"object\" || Array.isArray(resources)) {\n throw new ConnectorConfigError(`${surface}[${index}].resources must be an object`);\n }\n for (const rel of Object.keys(resources)) {\n if (rel === \"\" || rel === \".\" || rel.trim() === \"\") {\n throw new ConnectorConfigError(\n `${surface}[${index}].resources key must be a non-empty relative path (got ${JSON.stringify(rel)})`,\n );\n }\n if (isAbsolute(rel)) {\n throw new ConnectorConfigError(\n `${surface}[${index}].resources key must be a relative path inside the skill dir, not absolute (got ${JSON.stringify(rel)})`,\n );\n }\n // Normalize with BOTH posix and native separators flattened so a Windows\n // \"..\\\\x\" or a posix \"../x\" is caught regardless of the host OS.\n const norm = normalize(rel.replace(/\\\\/g, \"/\"));\n const segs = norm.split(/[/\\\\]/);\n if (norm === \"..\" || norm.startsWith(\"../\") || norm.startsWith(\"..\\\\\") || segs.includes(\"..\")) {\n throw new ConnectorConfigError(\n `${surface}[${index}].resources key must not escape the skill dir via \"..\" (got ${JSON.stringify(rel)})`,\n );\n }\n }\n}\n\n/** Default name for a single-entry memory declaration. */\nconst MEMORY_DEFAULT_NAME = \"memory\";\n\n/**\n * Validate + normalize `memory` entries (the managed-block content surface).\n * - `name` defaults to \"memory\", then must be kebab-case and unique — it is\n * half of the block marker id (`<connectorId>/<name>`) and must stay stable;\n * - `content` must be a non-empty string, ≤ 16 KiB (hard cap — memory files\n * are injected into every prompt of every session on the host), and must\n * NOT contain the literal marker tokens `agent-connector:begin` /\n * `agent-connector:end` (they would corrupt marker scanning in the shared\n * file — rephrase the guidance instead). The 4 KiB SOFT budget is reported\n * at install time as a `warn` ChangeRecord, not a config error\n * (defineConnector has no warning channel).\n */\nfunction normalizeMemory(input: MemoryDef[] | undefined): MemoryDef[] {\n if (input == null) return [];\n if (!Array.isArray(input)) {\n throw new ConnectorConfigError(\"memory must be an array\");\n }\n const seen = new Set<string>();\n return input.map((entry, i) => {\n if (!entry || typeof entry !== \"object\" || Array.isArray(entry)) {\n throw new ConnectorConfigError(`memory[${i}] must be an object`);\n }\n const name =\n entry.name === undefined\n ? MEMORY_DEFAULT_NAME\n : assertSurfaceName(\"memory\", entry.name, i);\n assertNoDuplicate(\"memory\", seen, name, i);\n const content = assertNonEmptyString(\"memory\", i, \"content\", entry.content);\n const bytes = Buffer.byteLength(content, \"utf8\");\n if (bytes > MEMORY_CONTENT_HARD_CAP_BYTES) {\n throw new ConnectorConfigError(\n `memory[${i}].content exceeds the ${MEMORY_CONTENT_HARD_CAP_BYTES}-byte hard cap ` +\n `(got ${bytes} bytes); memory is inlined into every prompt of every targeted host — keep it terse`,\n );\n }\n for (const token of [MANAGED_BLOCK_BEGIN_TOKEN, MANAGED_BLOCK_END_TOKEN]) {\n if (content.includes(token)) {\n throw new ConnectorConfigError(\n `memory[${i}].content must not contain the literal marker token \"${token}\" ` +\n `(it would corrupt managed-block scanning in the shared memory file); rephrase the guidance`,\n );\n }\n }\n if (entry.description !== undefined && typeof entry.description !== \"string\") {\n throw new ConnectorConfigError(`memory[${i}].description must be a string`);\n }\n return { ...entry, name };\n });\n}\n\n/** Default name for the (singular) statusline declaration. */\nconst STATUSLINE_DEFAULT_NAME = \"statusline\";\n\n/**\n * Validate + normalize the SINGULAR `statusline` (a HUD handler surface):\n * - `render` MUST be a function (it is the renderer, re-imported at runtime\n * like a hook handler);\n * - `name` defaults to \"statusline\", then must be kebab-case (the shared\n * surface-name validator);\n * - `description`, when present, must be a string.\n * Returns undefined when no statusline is declared (it is optional and singular,\n * unlike the memory[] array).\n */\nfunction normalizeStatusline(\n input: StatuslineDef | undefined,\n): StatuslineDef | undefined {\n if (input == null) return undefined;\n if (typeof input !== \"object\" || Array.isArray(input)) {\n throw new ConnectorConfigError(\"statusline must be an object\");\n }\n if (typeof input.render !== \"function\") {\n throw new ConnectorConfigError(\"statusline.render must be a function\");\n }\n const name =\n input.name === undefined\n ? STATUSLINE_DEFAULT_NAME\n : assertSurfaceName(\"statusline\", input.name, 0);\n if (input.description !== undefined && typeof input.description !== \"string\") {\n throw new ConnectorConfigError(\"statusline.description must be a string\");\n }\n // Per-host render override map: registered platform ids only, each render a\n // function (author-time hard error, mirroring the hook hosts-map validation).\n validateHostsMap(input.hosts, \"statusline.hosts\", \"render\");\n return { ...input, name };\n}\n\n/**\n * Validate + normalize `actions` (the user-invokable action handler surface):\n * - the value must be an array;\n * - each entry's `id` must be kebab-case (the shared surface-name validator)\n * and UNIQUE within the connector (ConnectorConfigError on dup — the id is\n * the verb's positional arg, so a duplicate would be ambiguous);\n * - `run` MUST be a function (it is the handler, re-imported at runtime like a\n * hook handler / statusline render);\n * - `description`, when present, must be a string;\n * - the per-host `hosts:` override map is validated via the shared\n * validateHostsMap (registered platform ids only, each `run` a function).\n * Returns [] when no actions are declared (defaults applied, like the other\n * array surfaces).\n */\nfunction normalizeActions(input: ActionDef[] | undefined): ActionDef[] {\n if (input == null) return [];\n if (!Array.isArray(input)) {\n throw new ConnectorConfigError(\"actions must be an array\");\n }\n const seen = new Set<string>();\n return input.map((action, i) => {\n if (!action || typeof action !== \"object\" || Array.isArray(action)) {\n throw new ConnectorConfigError(`actions[${i}] must be an object`);\n }\n const id = assertSurfaceName(\"actions\", action.id, i, \"id\");\n assertNoDuplicate(\"actions\", seen, id, i, \"id\");\n if (typeof action.run !== \"function\") {\n throw new ConnectorConfigError(`actions[${i}].run must be a function`);\n }\n if (action.description !== undefined && typeof action.description !== \"string\") {\n throw new ConnectorConfigError(`actions[${i}].description must be a string`);\n }\n // Per-host run override map: registered platform ids only, each run a\n // function (author-time hard error, mirroring the statusline/hook hosts-map).\n validateHostsMap(action.hosts, `actions.${id}.hosts`, \"run\");\n return { ...action, id };\n });\n}\n\n/**\n * Typed identity helper for authoring a status line in its own module:\n * export const myStatusline = defineStatusline({ render: (ctx) => \"…\" });\n * Mirrors the (informal) defineX helpers; gives the developer full type\n * inference on {@link StatuslineContext} without importing the type by hand.\n */\nexport const defineStatusline = (def: StatuslineDef): StatuslineDef => def;\n\n// ─────────────────────────────────────────────────────────────────────────\n// Typed identity helpers (the `define*` authoring family)\n//\n// Each is a one-line identity function: it returns its argument UNCHANGED and\n// does NOT validate or mutate (validation still happens centrally in\n// defineConnector). Their only job is ergonomics — authoring a surface in its\n// own module with full type inference + autocomplete on the *Def shape, and a\n// single import site — mirroring the existing {@link defineStatusline}.\n// ─────────────────────────────────────────────────────────────────────────\n\n/**\n * Typed identity helper for authoring ONE normalized lifecycle hook in its own\n * module, EVENT-PARAMETERIZED so the handler's payload narrows to that event:\n *\n * export const onPre = defineHook(\"PreToolUse\", {\n * handler(evt) { evt.toolName // ← typed as a PreToolUseEvent, not the union\n * return { decision: \"deny\", reason: \"no\" };\n * },\n * });\n *\n * The leading `event` argument exists ONLY to infer `E`; the def is returned\n * unchanged (identity — validation still happens in defineConnector). Passing\n * `HookDefinition` without an event would widen the handler param to the full\n * {@link HookEventName} union and lose per-event narrowing, so the event tag is\n * required.\n */\nexport const defineHook = <E extends HookEventName>(\n event: E,\n def: HookDefinition<E>,\n): HookDefinition<E> => {\n void event; // tag-only: used solely to infer E (the def carries no event field)\n return def;\n};\n\n/**\n * Typed identity helper for authoring a slash {@link CommandDef} in its own\n * module. Returns the def unchanged (kebab-case name + prompt are validated by\n * defineConnector when the connector is assembled).\n */\nexport const defineCommand = (def: CommandDef): CommandDef => def;\n\n/**\n * Typed identity helper for authoring an Agent {@link SkillDef} in its own\n * module. Returns the def unchanged (name/description/body + safe resource keys\n * are validated by defineConnector).\n */\nexport const defineSkill = (def: SkillDef): SkillDef => def;\n\n/**\n * Typed identity helper for authoring a {@link SubagentDef} in its own module.\n * Returns the def unchanged (name/description/prompt validated by defineConnector).\n */\nexport const defineSubagent = (def: SubagentDef): SubagentDef => def;\n\n/**\n * Typed identity helper for authoring a {@link MemoryDef} (standing-guidance\n * managed block) in its own module. Returns the def unchanged (name/content +\n * byte budget + marker-token guard validated by defineConnector).\n */\nexport const defineMemory = (def: MemoryDef): MemoryDef => def;\n\n/**\n * Typed identity helper for authoring a user-invokable {@link ActionDef} in its\n * own module. Returns the def unchanged (kebab-case unique id + run-is-function\n * + the per-host hosts map validated by defineConnector when the connector is\n * assembled).\n */\nexport const defineAction = (def: ActionDef): ActionDef => def;\n\n/**\n * Typed identity helper for authoring a declarative {@link ConfigPatchDef}\n * (set-if-absent host-config key patch) in its own module. Returns the def\n * unchanged (leaf-path grammar + namespace guard + required reason validated by\n * defineConnector when it appears under `platforms[<id>].configPatch`).\n */\nexport const defineConfigPatch = (def: ConfigPatchDef): ConfigPatchDef => def;\n\n/**\n * Typed identity helper for authoring a {@link NativeHookDef} (host-native\n * passthrough hook) in its own module. Returns the def unchanged (event-name\n * collision + handler-is-function validated by defineConnector when it appears\n * under `platforms[<id>].nativeHooks`).\n */\nexport const defineNativeHook = (def: NativeHookDef): NativeHookDef => def;\n\nfunction normalizeSubagents(input: SubagentDef[] | undefined): SubagentDef[] {\n if (input == null) return [];\n if (!Array.isArray(input)) {\n throw new ConnectorConfigError(\"subagents must be an array\");\n }\n const seen = new Set<string>();\n return input.map((agent, i) => {\n if (!agent || typeof agent !== \"object\") {\n throw new ConnectorConfigError(`subagents[${i}] must be an object`);\n }\n const name = assertSurfaceName(\"subagents\", agent.name, i);\n assertNoDuplicate(\"subagents\", seen, name, i);\n assertNonEmptyString(\"subagents\", i, \"description\", agent.description);\n assertNonEmptyString(\"subagents\", i, \"prompt\", agent.prompt);\n return { ...agent, name };\n });\n}\n\nfunction normalizeServer(server: ConnectorConfig[\"server\"]): ResolvedConnector[\"server\"] {\n if (!server) return undefined;\n const wrapDefault = server.transport === \"stdio\";\n return {\n ...server,\n enabled: server.enabled ?? true,\n tools: server.tools ?? { include: [\"*\"] },\n wrapForTelemetry: server.wrapForTelemetry ?? wrapDefault,\n };\n}\n","/**\n * core/mcp-standard — pinned literals + guards for the official MCP standards\n * agent-connector EMITS (registry server.json, MCPB bundle) or SPEAKS (the\n * connection-lifecycle wire used by `doctor --probe`).\n *\n * Each pinned constant is the CURRENT released value verified 2026-06-05 against\n * the upstream spec/schema. They are deliberately centralized + annotated\n * MUST-VERIFY-AT-IMPLEMENTATION: a newer spec revision can supersede any of them\n * without breaking us, so the bump is a one-line change here, never scattered.\n *\n * Sources:\n * • server.schema.json 2025-12-11 — https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json\n * • MCPB manifest 0.3 — github.com/anthropics/mcpb (MANIFEST.md)\n * • MCP protocol 2025-11-25 — modelcontextprotocol.io/specification/2025-11-25\n * (latest RELEASED revision. 2026-07-28 is a release-candidate only — do NOT\n * advance to it until it publishes as a stable dated revision. The probe\n * offers this version but ACCEPTS whatever a server negotiates, so the\n * offered literal being stale never breaks interop — only this constant.)\n */\n\nimport type { Transport } from \"./types.js\";\n\n/** Registry server.json JSON Schema URL (released 2025-12-11). MUST-VERIFY on bump. */\nexport const MCP_SERVER_SCHEMA_URL =\n \"https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json\";\n\n/** Current MCPB bundle manifest_version (anthropics/mcpb). MUST-VERIFY on bump. */\nexport const MCPB_MANIFEST_VERSION = \"0.3\";\n\n/**\n * Latest RELEASED MCP protocol revision `doctor --probe` offers in `initialize`.\n * Current = 2025-11-25. MUST-VERIFY on bump; stay on the latest *released*\n * revision (2026-07-28 is RC-only as of 2026-06). Negotiation accepts whatever\n * the server returns, so this is the offered value, not a hard requirement.\n */\nexport const MCP_PROTOCOL_VERSION = \"2025-11-25\";\n\n/** Default npm registry base URL stamped into server.json npm packages. */\nexport const NPM_REGISTRY_BASE_URL = \"https://registry.npmjs.org\";\n\n/**\n * server.json transport.type enum — the EXACT values the 2025-12-11 schema\n * accepts (packages[].transport.type and remotes[].type). Our `http` Transport\n * maps to the spec slug \"streamable-http\"; \"ws\" is non-spec (see below).\n */\nexport type RegistryTransportType = \"stdio\" | \"streamable-http\" | \"sse\";\n\n/**\n * Map our {@link Transport} union to the registry/server.json transport slug.\n * Returns null for \"ws\" — WebSocket is NOT a spec transport (it can only exist\n * as a vendor custom transport, e.g. Claude Code's non-spec type:\"ws\"), so a\n * conformant artifact must REJECT it rather than emit an invalid type. The spec\n * defines exactly stdio + streamable-http, with sse the deprecated HTTP+SSE.\n */\nexport function registryTransportType(transport: Transport): RegistryTransportType | null {\n switch (transport) {\n case \"stdio\":\n return \"stdio\";\n case \"http\":\n return \"streamable-http\";\n case \"sse\":\n return \"sse\";\n case \"ws\":\n return null;\n }\n}\n\n/**\n * Is `v` a CONCRETE version the MCP Registry accepts? The registry rejects\n * ranges (\"^1.2.3\", \"~1.2.3\", \">=1.2.3\", \"1.x\", \"1.*\"); only a pinned SemVer\n * (optionally with a -prerelease / +build suffix) is valid. \"0.0.0\" is concrete\n * (so it passes this guard) but is the unset placeholder — callers warn on it\n * separately via {@link isPlaceholderVersion}.\n */\nexport function isConcreteSemver(v: string): boolean {\n return /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/.test(v);\n}\n\n/** The unset default version a connector ships with until the dev sets a real one. */\nexport function isPlaceholderVersion(v: string): boolean {\n return v === \"0.0.0\";\n}\n\n/**\n * Reverse-DNS registry namespace pattern (the part BEFORE the \"/\" in a\n * server.json `name`). The full name regex is\n * `^[a-zA-Z0-9.-]+/[a-zA-Z0-9._-]+$`; the namespace side allows letters, digits,\n * dots and hyphens (NO underscore) — e.g. \"io.github.acme\" or \"com.acme\".\n */\nexport const REGISTRY_NAMESPACE_RE = /^[a-zA-Z0-9.-]+$/;\n\n/** The full server.json `name` regex (namespace \"/\" server-name), per the schema. */\nexport const REGISTRY_NAME_RE = /^[a-zA-Z0-9.-]+\\/[a-zA-Z0-9._-]+$/;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA,SAAS,YAAY,iBAAiB;;;ACe/B,IAAM,wBACX;AAGK,IAAM,wBAAwB;AAQ9B,IAAM,uBAAuB;AAG7B,IAAM,wBAAwB;AAgB9B,SAAS,sBAAsB,WAAoD;AACxF,UAAQ,WAAW;AAAA,IACjB,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,EACX;AACF;AASO,SAAS,iBAAiB,GAAoB;AACnD,SAAO,2DAA2D,KAAK,CAAC;AAC1E;AAGO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,IAAM,gBAAgB,CAAC,QAAgC;AAOvD,IAAM,cAAc,CAAC,QAA4B;AAMjD,IAAM,iBAAiB,CAAC,QAAkC;AAO1D,IAAM,eAAe,CAAC,QAA8B;AAQpD,IAAM,eAAe,CAAC,QAA8B;AAQpD,IAAM,oBAAoB,CAAC,QAAwC;AAQnE,IAAM,mBAAmB,CAAC,QAAsC;AAEvE,SAAS,mBAAmB,OAAiD;AAC3E,MAAI,SAAS,KAAM,QAAO,CAAC;AAC3B,MAAI,CAAC,MAAM,QAAQ,KAAK,GAAG;AACzB,UAAM,IAAI,qBAAqB,4BAA4B;AAAA,EAC7D;AACA,QAAM,OAAO,oBAAI,IAAY;AAC7B,SAAO,MAAM,IAAI,CAAC,OAAO,MAAM;AAC7B,QAAI,CAAC,SAAS,OAAO,UAAU,UAAU;AACvC,YAAM,IAAI,qBAAqB,aAAa,CAAC,qBAAqB;AAAA,IACpE;AACA,UAAM,OAAO,kBAAkB,aAAa,MAAM,MAAM,CAAC;AACzD,sBAAkB,aAAa,MAAM,MAAM,CAAC;AAC5C,yBAAqB,aAAa,GAAG,eAAe,MAAM,WAAW;AACrE,yBAAqB,aAAa,GAAG,UAAU,MAAM,MAAM;AAC3D,WAAO,EAAE,GAAG,OAAO,KAAK;AAAA,EAC1B,CAAC;AACH;AAEA,SAAS,gBAAgB,QAAgE;AACvF,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,cAAc,OAAO,cAAc;AACzC,SAAO;AAAA,IACL,GAAG;AAAA,IACH,SAAS,OAAO,WAAW;AAAA,IAC3B,OAAO,OAAO,SAAS,EAAE,SAAS,CAAC,GAAG,EAAE;AAAA,IACxC,kBAAkB,OAAO,oBAAoB;AAAA,EAC/C;AACF;","names":[]}
@@ -73,36 +73,36 @@ function renderInstallResult(result, verb) {
73
73
  return lines.join("\n");
74
74
  }
75
75
  var COMMANDS = {
76
- detect: () => import("./detect-L3NJTBO5.js"),
77
- install: () => import("./install-7SUJFRYO.js"),
78
- uninstall: () => import("./uninstall-SNI7GPQD.js"),
76
+ detect: () => import("./detect-LWZEM7SN.js"),
77
+ install: () => import("./install-F4OIDYAK.js"),
78
+ uninstall: () => import("./uninstall-QCROBR6A.js"),
79
79
  // `upgrade` is the single "bring everything current" verb (re-render host
80
80
  // config + refresh the home pointer + managed channel guidance). `sync` and
81
81
  // `update` are kept as back-compat aliases that route to the same module so
82
82
  // existing scripts/docs keep working without a second concept to learn.
83
- upgrade: () => import("./upgrade-ZUNBJWJ7.js"),
84
- sync: () => import("./upgrade-ZUNBJWJ7.js"),
85
- update: () => import("./upgrade-ZUNBJWJ7.js"),
86
- package: () => import("./package-VUX663ET.js"),
87
- doctor: () => import("./doctor-PUE4HO3N.js"),
88
- status: () => import("./status-SCBCWS7H.js"),
89
- telemetry: () => import("./telemetry-Q55B5NSZ.js"),
90
- usage: () => import("./usage-UQDBIU42.js"),
91
- leaderboard: () => import("./leaderboard-2VAAOK3D.js"),
92
- hook: () => import("./hook-S3DNNGZX.js"),
83
+ upgrade: () => import("./upgrade-KJ4QRZDZ.js"),
84
+ sync: () => import("./upgrade-KJ4QRZDZ.js"),
85
+ update: () => import("./upgrade-KJ4QRZDZ.js"),
86
+ package: () => import("./package-5FRMSWRT.js"),
87
+ doctor: () => import("./doctor-54P4JFA6.js"),
88
+ status: () => import("./status-5ZM6LXHV.js"),
89
+ telemetry: () => import("./telemetry-NO7UUUSJ.js"),
90
+ usage: () => import("./usage-UY6DCND6.js"),
91
+ leaderboard: () => import("./leaderboard-ZIAXBUWD.js"),
92
+ hook: () => import("./hook-UT3Q43AB.js"),
93
93
  // Internal (omitted from USAGE): the statusline (HUD) entrypoint a host's
94
94
  // status line config points at. Fail-safe: always exits 0 with at most a
95
95
  // rendered line. See cli/commands/statusline.ts.
96
- statusline: () => import("./statusline-NRPDOPGA.js"),
96
+ statusline: () => import("./statusline-O76BCBUK.js"),
97
97
  // Internal (omitted from USAGE): the user-invokable action entrypoint a future
98
98
  // host affordance points at. USER-TRIGGERED: surfaces errors (exit 1 + stderr),
99
99
  // unlike the fail-open hook / fail-safe statusline. See cli/commands/action.ts.
100
- action: () => import("./action-72J2TCKQ.js"),
101
- serve: () => import("./serve-MOIIYFER.js"),
100
+ action: () => import("./action-AIB2W4DU.js"),
101
+ serve: () => import("./serve-NQBXN4FG.js"),
102
102
  // Hidden (omitted from USAGE): the opt-in host-native turn-usage entrypoint an
103
103
  // AfterModel / PostInvocation hook points at. Always exits 0; records a
104
104
  // distinct `model_turn` row. See cli/commands/usage-event.ts.
105
- "usage-event": () => import("./usage-event-HPG2BIAY.js")
105
+ "usage-event": () => import("./usage-event-T4HWQDZF.js")
106
106
  };
107
107
  var DEFAULT_PROGRAM_NAME = "agent-connector";
108
108
  var COMMAND_USAGE = {
@@ -198,4 +198,4 @@ export {
198
198
  renderInstallResult,
199
199
  main
200
200
  };
201
- //# sourceMappingURL=chunk-IKEXNI2W.js.map
201
+ //# sourceMappingURL=chunk-KAEYJGK7.js.map
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
+ assertNoSymlinkInPath,
3
4
  backupsDir,
4
5
  connectorDir,
5
6
  ensureDir
6
- } from "./chunk-QY42WGBX.js";
7
+ } from "./chunk-D65GIBCG.js";
7
8
 
8
9
  // src/core/managed-block.ts
9
10
  import { createHash } from "crypto";
@@ -454,6 +455,7 @@ function loadMemoryLedger(connectorId) {
454
455
  }
455
456
  function saveMemoryLedger(connectorId, ledger) {
456
457
  const p = memoryLedgerPath(connectorId);
458
+ assertNoSymlinkInPath(p);
457
459
  if (ledger.targets.length === 0) {
458
460
  rmSync(p, { force: true });
459
461
  return;
@@ -491,4 +493,4 @@ export {
491
493
  hasMemoryLedger,
492
494
  recordMemoryTarget
493
495
  };
494
- //# sourceMappingURL=chunk-ZY25RG4Y.js.map
496
+ //# sourceMappingURL=chunk-LBOGRZGY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/managed-block.ts"],"sourcesContent":["/**\n * core/managed-block — the marker-fenced MANAGED BLOCK engine behind the\n * `memory` content surface.\n *\n * Memory/rules files (AGENTS.md, CLAUDE.md, GEMINI.md, …) are SHARED,\n * user-authored files — unlike commands/skills/subagents, agent-connector does\n * not own them. Every write therefore goes through this one module, which\n * implements idempotent, hash-stamped, uninstall-reversible blocks:\n *\n * <!-- agent-connector:begin <connectorId>/<name> hash=<sha256-12> -->\n * <!-- Managed by agent-connector for \"<connectorId>\". Do not edit … -->\n * …guidance…\n * <!-- agent-connector:end <connectorId>/<name> -->\n *\n * Design rules (each grounded in surveyed prior art — ansible blockinfile,\n * conda init, OMC mergeClaudeMd, Ruler, doctoc):\n * • UNIQUE marker per block: the blockId (`<connectorId>/<entryName>`) lives\n * ON the marker line, so multiple connectors coexist in one file and each\n * update path only ever touches its own pair (ansible's documented\n * multi-block rule). The shared `agent-connector` namespace token lets\n * doctor/uninstall enumerate every block with one scan.\n * • `hash=` is the first 12 hex chars of sha256 over the NORMALIZED inner\n * region (CRLF→LF + trim — stable under prettier/EOL converters): O(1)\n * idempotence (unchanged → skip, no mtime/git churn) and tamper detection\n * (actual inner hash ≠ recorded ⇒ the user edited inside the block ⇒ warn,\n * never clobber without an explicit force).\n * • IN-PLACE replacement (conda semantics): zero bytes outside the marker\n * pair ever change — no move-to-top, no user blank-line reflow.\n * • Line-anchored matching that explicitly tolerates `\\r` line ends and a\n * FENCE-AWARE scanner (markers quoted inside ``` / ~~~ code fences never\n * match) — fixes the CRLF duplicate-block and quoted-marker classes.\n * • First-begin / FIRST-end-after pairing (never last-end): a missing end\n * marker must not swallow a sibling connector's block.\n * • HTML-comment markers are CORRECT for CLAUDE.md: Claude Code strips HTML\n * comments from CLAUDE.md before context injection (verified against docs\n * and the 2.1.172 binary), so the markers and the do-not-edit notice are\n * INVISIBLE to the model there while remaining fully parseable by us for\n * sync/doctor/uninstall. On AGENTS.md hosts (which inline the whole file\n * into the prompt) the short notice doubles as an in-prompt \"do not edit\"\n * instruction to the host's own agent. A `commentStyle: \"hash\"` variant\n * exists for future non-markdown targets (`#`-prefixed marker lines).\n *\n * The module also owns the per-connector MEMORY OWNERSHIP LEDGER\n * (`connectorDir(id)/memory-state.json`): the markers in the file remain the\n * source of truth for uninstall (a teammate's machine with no ledger still\n * uninstalls via the prefix scan); the ledger only adds the created-vs-modified\n * distinction (file deletion rights) and doctor diagnostics.\n */\n\nimport { createHash } from \"node:crypto\";\nimport {\n chmodSync,\n copyFileSync,\n existsSync,\n readFileSync,\n renameSync,\n rmSync,\n statSync,\n writeFileSync,\n} from \"node:fs\";\nimport { basename, dirname, join } from \"node:path\";\n\nimport { assertNoSymlinkInPath, backupsDir, connectorDir, ensureDir } from \"./paths.js\";\n\n// ─────────────────────────────────────────────────────────────────────────\n// Grammar constants (shared with defineConnector's content validation)\n// ─────────────────────────────────────────────────────────────────────────\n\n/** Literal begin token. Connector memory content MUST NOT contain it. */\nexport const MANAGED_BLOCK_BEGIN_TOKEN = \"agent-connector:begin\";\n/** Literal end token. Connector memory content MUST NOT contain it. */\nexport const MANAGED_BLOCK_END_TOKEN = \"agent-connector:end\";\n\n/** Hard cap on one memory entry's content (ConnectorConfigError above this). */\nexport const MEMORY_CONTENT_HARD_CAP_BYTES = 16 * 1024;\n/**\n * Soft per-entry budget — exceeded → install-time `warn` ChangeRecord (memory\n * files are injected into EVERY prompt of EVERY session on the host; codex\n * additionally caps combined project docs at 32 KiB).\n */\nexport const MEMORY_CONTENT_SOFT_BUDGET_BYTES = 4 * 1024;\n\n/** Marker comment style: HTML comments (default, all v1 markdown targets) or `#` lines. */\nexport type BlockCommentStyle = \"html\" | \"hash\";\n\n// ─────────────────────────────────────────────────────────────────────────\n// Hashing / rendering\n// ─────────────────────────────────────────────────────────────────────────\n\n/** CRLF/CR → LF + trim: the normalization both hashing sides use. */\nfunction normalizeInner(s: string): string {\n return s.replace(/\\r\\n/g, \"\\n\").replace(/\\r/g, \"\\n\").trim();\n}\n\n/** First 12 hex chars of sha256 over the NORMALIZED inner region. */\nexport function hashBlockContent(inner: string): string {\n return createHash(\"sha256\").update(normalizeInner(inner), \"utf8\").digest(\"hex\").slice(0, 12);\n}\n\n/** The conda-style in-block warning, adapted for the LLM era (see header). */\nfunction defaultNotice(connectorId: string): string {\n return (\n `Managed by agent-connector for \"${connectorId}\". Do not edit between these markers: ` +\n `\\`agent-connector sync\\` rewrites this block; ` +\n `\\`agent-connector uninstall ${connectorId}\\` removes it.`\n );\n}\n\nfunction beginLine(blockId: string, hash: string, style: BlockCommentStyle): string {\n return style === \"hash\"\n ? `# ${MANAGED_BLOCK_BEGIN_TOKEN} ${blockId} hash=${hash}`\n : `<!-- ${MANAGED_BLOCK_BEGIN_TOKEN} ${blockId} hash=${hash} -->`;\n}\n\n/** END line is a fixed exact string (no hash) so a content change never strands it. */\nfunction endLine(blockId: string, style: BlockCommentStyle): string {\n return style === \"hash\"\n ? `# ${MANAGED_BLOCK_END_TOKEN} ${blockId}`\n : `<!-- ${MANAGED_BLOCK_END_TOKEN} ${blockId} -->`;\n}\n\nfunction noticeLine(notice: string, style: BlockCommentStyle): string {\n return style === \"hash\" ? `# ${notice}` : `<!-- ${notice} -->`;\n}\n\nexport interface RenderBlockOptions {\n /** `<connectorId>/<entryName>` (or the reserved `_shared/<name>` bridge prefix). */\n blockId: string;\n /** Connector id named in the default do-not-edit notice line. */\n connectorId: string;\n /** The guidance payload (plain markdown; normalized + trimmed on emit). */\n content: string;\n /** Marker comment style; default \"html\". */\n commentStyle?: BlockCommentStyle;\n /** Override the default notice line TEXT (without comment delimiters). */\n notice?: string;\n}\n\n/**\n * Render the block as LOGICAL lines (no EOL chars). The recorded `hash=`\n * covers the full inner region (notice line + content) so install and scan\n * compare like for like.\n */\nexport function renderBlockLines(opts: RenderBlockOptions): string[] {\n const style = opts.commentStyle ?? \"html\";\n const inner = [\n noticeLine(opts.notice ?? defaultNotice(opts.connectorId), style),\n ...normalizeInner(opts.content).split(\"\\n\"),\n ];\n const hash = hashBlockContent(inner.join(\"\\n\"));\n return [beginLine(opts.blockId, hash, style), ...inner, endLine(opts.blockId, style)];\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Scanning (fence-aware, line-anchored, CRLF-tolerant)\n// ─────────────────────────────────────────────────────────────────────────\n\n// Both comment styles are RECOGNIZED in one pass (a file may legitimately mix\n// styles only across rewrites; emission always uses the requested style).\nconst BEGIN_RE =\n /^(?:<!--\\s+agent-connector:begin\\s+(\\S+)\\s+hash=([0-9a-f]{12})\\s+-->|#\\s+agent-connector:begin\\s+(\\S+)\\s+hash=([0-9a-f]{12}))\\s*$/;\nconst END_RE = /^(?:<!--\\s+agent-connector:end\\s+(\\S+)\\s+-->|#\\s+agent-connector:end\\s+(\\S+))\\s*$/;\n\ninterface MarkerEvent {\n kind: \"begin\" | \"end\";\n blockId: string;\n /** Recorded hash (begin markers only). */\n hash?: string;\n /** Line index into the logical-lines array. */\n index: number;\n}\n\n/** Strip ONE trailing `\\r` — `raw.split(\"\\n\")` leaves it on CRLF files. */\nfunction stripCr(line: string): string {\n return line.endsWith(\"\\r\") ? line.slice(0, -1) : line;\n}\n\n/**\n * Scan logical lines for marker events, tracking ``` / ~~~ fence state so a\n * marker QUOTED inside a fenced code block never matches (the OMC class of\n * false positives, eliminated rather than just reduced).\n */\nfunction scanMarkers(logical: string[]): MarkerEvent[] {\n const events: MarkerEvent[] = [];\n let fence: { char: string; len: number } | null = null;\n for (let i = 0; i < logical.length; i++) {\n const line = logical[i]!;\n if (fence) {\n const close = line.match(/^ {0,3}(`{3,}|~{3,})\\s*$/);\n if (close && close[1]![0] === fence.char && close[1]!.length >= fence.len) fence = null;\n continue;\n }\n const open = line.match(/^ {0,3}(`{3,}|~{3,})/);\n if (open) {\n fence = { char: open[1]![0]!, len: open[1]!.length };\n continue;\n }\n const b = line.match(BEGIN_RE);\n if (b) {\n events.push({ kind: \"begin\", blockId: (b[1] ?? b[3])!, hash: (b[2] ?? b[4])!, index: i });\n continue;\n }\n const e = line.match(END_RE);\n if (e) events.push({ kind: \"end\", blockId: (e[1] ?? e[2])!, index: i });\n }\n return events;\n}\n\n/**\n * Logical lines of `raw` that sit OUTSIDE ``` / ~~~ code fences — for host\n * probes that must ignore quoted examples (e.g. the claude-code `@AGENTS.md`\n * import detection). Fence lines themselves are excluded.\n */\nexport function linesOutsideFences(raw: string): string[] {\n const body = raw.startsWith(\"\\uFEFF\") ? raw.slice(1) : raw;\n const logical = body.split(\"\\n\").map(stripCr);\n const out: string[] = [];\n let fence: { char: string; len: number } | null = null;\n for (const line of logical) {\n if (fence) {\n const close = line.match(/^ {0,3}(`{3,}|~{3,})\\s*$/);\n if (close && close[1]![0] === fence.char && close[1]!.length >= fence.len) fence = null;\n continue;\n }\n const open = line.match(/^ {0,3}(`{3,}|~{3,})/);\n if (open) {\n fence = { char: open[1]![0]!, len: open[1]!.length };\n continue;\n }\n out.push(line);\n }\n return out;\n}\n\ninterface BlockPair {\n blockId: string;\n begin: MarkerEvent;\n end: MarkerEvent;\n}\n\n/**\n * Pair markers per blockId: first begin, then the FIRST end at-or-after it.\n * A nested begin for the SAME id (inside an open pair) is treated as inner\n * content; unpaired markers are returned as strays. Per-id state means a\n * missing end for connector A can never swallow connector B's block.\n */\nfunction pairMarkers(events: MarkerEvent[]): { pairs: BlockPair[]; strays: MarkerEvent[] } {\n const open = new Map<string, MarkerEvent>();\n const pairs: BlockPair[] = [];\n const strays: MarkerEvent[] = [];\n for (const ev of events) {\n if (ev.kind === \"begin\") {\n if (!open.has(ev.blockId)) open.set(ev.blockId, ev);\n // else: a begin inside an open pair — inner content / abuse; the hash\n // check will flag the pair as drifted rather than guessing boundaries.\n } else {\n const b = open.get(ev.blockId);\n if (b) {\n pairs.push({ blockId: ev.blockId, begin: b, end: ev });\n open.delete(ev.blockId);\n } else {\n strays.push(ev);\n }\n }\n }\n for (const b of open.values()) strays.push(b);\n return { pairs, strays };\n}\n\n/** One discovered block (for doctor / refcount / uninstall enumeration). */\nexport interface ManagedBlockInfo {\n blockId: string;\n /** The hash recorded on the begin marker line. */\n recordedHash: string;\n /** Hash of the actual normalized inner region as found on disk. */\n actualHash: string;\n /** True when recordedHash ≠ actualHash — the user edited inside the block. */\n drifted: boolean;\n beginLine: number;\n endLine: number;\n}\n\n/** Enumerate every complete agent-connector block in `raw` (namespace scan). */\nexport function listManagedBlocks(raw: string): ManagedBlockInfo[] {\n const body = raw.startsWith(\"\\uFEFF\") ? raw.slice(1) : raw;\n const logical = body.split(\"\\n\").map(stripCr);\n const { pairs } = pairMarkers(scanMarkers(logical));\n return pairs.map((p) => {\n const inner = logical.slice(p.begin.index + 1, p.end.index).join(\"\\n\");\n const actualHash = hashBlockContent(inner);\n const recordedHash = p.begin.hash ?? \"\";\n return {\n blockId: p.blockId,\n recordedHash,\n actualHash,\n drifted: recordedHash !== actualHash,\n beginLine: p.begin.index,\n endLine: p.end.index,\n };\n });\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Pure text upsert / removal\n// ─────────────────────────────────────────────────────────────────────────\n\nexport interface UpsertBlockOptions extends RenderBlockOptions {\n /** Overwrite a USER-EDITED (drifted) block. Default false → warn + leave intact. */\n force?: boolean;\n}\n\nexport interface BlockTextResult {\n /** Resulting full text (=== input when nothing changed). */\n text: string;\n action: \"create\" | \"update\" | \"skip\" | \"warn\";\n detail: string;\n changed: boolean;\n /**\n * True when the rewrite was DESTRUCTIVE-ADJACENT (force-overwrote a drifted\n * block, collapsed duplicate pairs, or stripped stray markers) — the file\n * wrapper writes a timestamped backup before persisting such a change.\n */\n recovered: boolean;\n /** Hash of the (new) rendered inner region — recorded in the ledger. */\n hash: string;\n}\n\n/** Detect the file's dominant EOL; new/replaced lines are emitted with it. */\nfunction detectEol(body: string): \"\\n\" | \"\\r\\n\" {\n const crlf = (body.match(/\\r\\n/g) ?? []).length;\n const total = (body.match(/\\n/g) ?? []).length;\n return crlf > 0 && crlf >= total - crlf ? \"\\r\\n\" : \"\\n\";\n}\n\n/** Add `\\r` to logical lines when the file is CRLF (joined with \"\\n\" later). */\nfunction withEol(lines: string[], eol: \"\\n\" | \"\\r\\n\"): string[] {\n return eol === \"\\r\\n\" ? lines.map((l) => `${l}\\r`) : lines;\n}\n\n/**\n * Strip trailing newline(s) + whitespace-only line tails WITHOUT touching\n * trailing spaces on the last content line (bytes outside our block).\n */\nfunction trimTrailingBlank(body: string): string {\n let out = body;\n for (;;) {\n const m = out.match(/\\r?\\n[ \\t]*$/);\n if (!m) return out;\n out = out.slice(0, out.length - m[0].length);\n }\n}\n\n/** Append the rendered block at EOF with exactly ONE blank separator line. */\nfunction appendBlock(body: string, blockLines: string[], eol: \"\\n\" | \"\\r\\n\"): string {\n const blockText = blockLines.join(eol) + eol;\n if (body.trim() === \"\") return blockText;\n return trimTrailingBlank(body) + eol + eol + blockText;\n}\n\n/**\n * Idempotent upsert of one managed block into `raw` (pure; no I/O).\n * See the module header for the full algorithm contract.\n */\nexport function upsertBlockInText(raw: string, opts: UpsertBlockOptions): BlockTextResult {\n const bom = raw.startsWith(\"\\uFEFF\");\n const body = bom ? raw.slice(1) : raw;\n const eol = detectEol(body);\n const lines = body.split(\"\\n\"); // elements keep a trailing \"\\r\" on CRLF files\n const logical = lines.map(stripCr);\n\n const events = scanMarkers(logical).filter((e) => e.blockId === opts.blockId);\n const { pairs, strays } = pairMarkers(events);\n\n const newLines = renderBlockLines(opts);\n const newHash = hashBlockContent(newLines.slice(1, -1).join(\"\\n\"));\n const finish = (text: string, r: Omit<BlockTextResult, \"text\" | \"hash\">): BlockTextResult => ({\n text: bom ? `\\uFEFF${text}` : text,\n hash: newHash,\n ...r,\n });\n\n if (pairs.length > 0) {\n const { begin, end } = pairs[0]!;\n const recorded = begin.hash ?? \"\";\n const actualHash = hashBlockContent(logical.slice(begin.index + 1, end.index).join(\"\\n\"));\n const drifted = actualHash !== recorded;\n\n if (drifted && !opts.force) {\n return finish(body, {\n action: \"warn\",\n detail:\n `block ${opts.blockId} was edited inside the markers ` +\n `(recorded hash ${recorded}, found ${actualHash}); left untouched — ` +\n `re-run with --force to overwrite the in-block edits`,\n changed: false,\n recovered: false,\n });\n }\n\n const duplicates = pairs.slice(1);\n const needsWrite =\n drifted || recorded !== newHash || duplicates.length > 0 || strays.length > 0;\n if (!needsWrite) {\n return finish(body, {\n action: \"skip\",\n detail: `block ${opts.blockId} already up to date (hash ${newHash})`,\n changed: false,\n recovered: false,\n });\n }\n\n // Build the deletion set: the canonical pair region (replaced in place),\n // duplicate pairs (+ ONE adjacent blank line each), and stray marker LINES.\n const del = new Set<number>();\n for (let i = begin.index; i <= end.index; i++) del.add(i);\n for (const dup of duplicates) {\n for (let i = dup.begin.index; i <= dup.end.index; i++) del.add(i);\n reclaimBlankLine(logical, dup.begin.index, dup.end.index, del, lines.length);\n }\n for (const s of strays) del.add(s.index);\n\n const out: string[] = [];\n for (let i = 0; i < lines.length; i++) {\n if (i === begin.index) out.push(...withEol(newLines, eol));\n if (!del.has(i)) out.push(lines[i]!);\n }\n const notes: string[] = [];\n if (drifted) notes.push(\"in-block edits overwritten (--force; backup taken)\");\n if (duplicates.length > 0) notes.push(`${duplicates.length} duplicate pair(s) collapsed`);\n if (strays.length > 0) notes.push(`${strays.length} stray marker line(s) removed`);\n return finish(out.join(\"\\n\"), {\n action: \"update\",\n detail:\n `block ${opts.blockId} updated (hash ${recorded || \"?\"} → ${newHash})` +\n (notes.length > 0 ? `; ${notes.join(\"; \")}` : \"\"),\n changed: true,\n recovered: drifted || duplicates.length > 0 || strays.length > 0,\n });\n }\n\n if (strays.length > 0) {\n // Corruption recovery: strip ONLY the stray marker line(s) (never the text\n // between guessed boundaries), then proceed as not-found.\n const del = new Set(strays.map((s) => s.index));\n const cleaned = lines.filter((_, i) => !del.has(i)).join(\"\\n\");\n return finish(appendBlock(cleaned, newLines, eol), {\n action: \"create\",\n detail:\n `block ${opts.blockId} appended after recovery: ${strays.length} stray ` +\n `marker line(s) removed (backup taken)`,\n changed: true,\n recovered: true,\n });\n }\n\n // Not found → append at EOF (one blank separator; whole file when empty).\n return finish(appendBlock(body, newLines, eol), {\n action: \"create\",\n detail: `block ${opts.blockId} appended (hash ${newHash})`,\n changed: true,\n recovered: false,\n });\n}\n\n/**\n * Mark ONE blank line adjacent to a removed begin..end region for deletion\n * (prefer the line before; never the post-final-newline \"\" sentinel).\n */\nfunction reclaimBlankLine(\n logical: string[],\n beginIdx: number,\n endIdx: number,\n del: Set<number>,\n lineCount: number,\n): void {\n const before = beginIdx - 1;\n if (before >= 0 && !del.has(before) && logical[before]!.trim() === \"\") {\n del.add(before);\n return;\n }\n const after = endIdx + 1;\n // The final \"\" element of split(\"\\n\") on a newline-terminated file is the\n // trailing-newline sentinel, not a blank line — leave it alone.\n const isSentinel = after === lineCount - 1 && logical[after] === \"\";\n if (after < lineCount && !isSentinel && !del.has(after) && logical[after]!.trim() === \"\") {\n del.add(after);\n }\n}\n\nexport interface RemoveBlocksOptions {\n /** Remove the block with EXACTLY this id… */\n blockId?: string;\n /** …or every block whose id starts with this prefix (e.g. `<connectorId>/`). */\n blockIdPrefix?: string;\n}\n\nexport interface RemoveRecord {\n blockId: string;\n action: \"remove\" | \"warn\";\n detail: string;\n}\n\nexport interface RemoveBlocksResult {\n text: string;\n changed: boolean;\n records: RemoveRecord[];\n /** True when the remaining text is whitespace-only (file-deletion candidate). */\n fileNowEmpty: boolean;\n /** True when a drifted block was removed or stray markers were stripped. */\n recovered: boolean;\n}\n\n/**\n * Remove every matching managed block (begin..end inclusive + at most ONE\n * adjacent blank separator line — no blank-line accumulation across cycles).\n * Drifted blocks are removed WITH a warn (uninstall intent is explicit; the\n * file wrapper backs the file up first). Stray matching markers are stripped\n * line-only with a warn. Pure; no I/O.\n */\nexport function removeBlocksFromText(raw: string, match: RemoveBlocksOptions): RemoveBlocksResult {\n const bom = raw.startsWith(\"\\uFEFF\");\n const body = bom ? raw.slice(1) : raw;\n const lines = body.split(\"\\n\");\n const logical = lines.map(stripCr);\n\n const matches = (id: string): boolean =>\n (match.blockId !== undefined && id === match.blockId) ||\n (match.blockIdPrefix !== undefined && id.startsWith(match.blockIdPrefix));\n\n const { pairs, strays } = pairMarkers(scanMarkers(logical));\n const targetPairs = pairs.filter((p) => matches(p.blockId));\n const targetStrays = strays.filter((s) => matches(s.blockId));\n\n if (targetPairs.length === 0 && targetStrays.length === 0) {\n return { text: raw, changed: false, records: [], fileNowEmpty: false, recovered: false };\n }\n\n const del = new Set<number>();\n const records: RemoveRecord[] = [];\n let recovered = false;\n\n for (const p of targetPairs) {\n const recorded = p.begin.hash ?? \"\";\n const actualHash = hashBlockContent(\n logical.slice(p.begin.index + 1, p.end.index).join(\"\\n\"),\n );\n for (let i = p.begin.index; i <= p.end.index; i++) del.add(i);\n reclaimBlankLine(logical, p.begin.index, p.end.index, del, lines.length);\n if (actualHash !== recorded) {\n recovered = true;\n records.push({\n blockId: p.blockId,\n action: \"warn\",\n detail:\n `block ${p.blockId} had in-block edits (recorded hash ${recorded}, found ` +\n `${actualHash}); removed anyway (backup taken)`,\n });\n }\n records.push({ blockId: p.blockId, action: \"remove\", detail: `block ${p.blockId} removed` });\n }\n for (const s of targetStrays) {\n del.add(s.index);\n recovered = true;\n records.push({\n blockId: s.blockId,\n action: \"warn\",\n detail: `stray ${s.kind} marker for ${s.blockId} removed (marker line only)`,\n });\n }\n\n const text = lines.filter((_, i) => !del.has(i)).join(\"\\n\");\n return {\n text: bom ? `\\uFEFF${text}` : text,\n changed: true,\n records,\n fileNowEmpty: text.trim() === \"\",\n recovered,\n };\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// File-level wrappers (atomic write, backups, dry-run)\n// ─────────────────────────────────────────────────────────────────────────\n\nexport interface BlockFileChange {\n action: \"create\" | \"update\" | \"skip\" | \"warn\" | \"remove\";\n path: string;\n detail: string;\n /** True when the FILE did not exist and this upsert created it (ledger fact). */\n createdFile: boolean;\n /** Set when a pre-mutation backup was written (destructive/recovery paths only). */\n backupPath?: string;\n /** Hash of the rendered inner region (ledger / doctor). */\n hash: string;\n}\n\n/** Timestamped copy into backupsDir(); best-effort (null on failure). */\nfunction backupFile(path: string): string | null {\n try {\n ensureDir(backupsDir());\n const stamp = new Date().toISOString().replace(/[:.]/g, \"-\");\n const dest = join(backupsDir(), `memory-${stamp}-${basename(path)}`);\n copyFileSync(path, dest);\n return dest;\n } catch {\n return null;\n }\n}\n\n/**\n * Atomic write: temp file in the SAME directory + rename, preserving the\n * destination's mode. Shrinks (does not eliminate) the read-modify-write race\n * with hosts that append to memory files mid-session (Claude `#` quick-memory).\n */\nfunction atomicWriteFile(path: string, text: string): void {\n const dir = dirname(path);\n ensureDir(dir);\n const tmp = join(dir, `.${basename(path)}.ac-tmp-${process.pid}-${Date.now()}`);\n try {\n writeFileSync(tmp, text, \"utf8\");\n try {\n chmodSync(tmp, statSync(path).mode);\n } catch {\n /* destination absent — default mode is fine */\n }\n renameSync(tmp, path);\n } catch (err) {\n rmSync(tmp, { force: true });\n throw err;\n }\n}\n\n/**\n * Upsert one managed block into the file at `path` (created when absent).\n * Re-reads immediately before computing+writing; honors dryRun (the action is\n * computed and reported, nothing is written).\n */\nexport function upsertManagedBlockFile(\n path: string,\n opts: UpsertBlockOptions & { dryRun: boolean },\n): BlockFileChange {\n let raw: string | null = null;\n if (existsSync(path)) {\n try {\n raw = readFileSync(path, \"utf8\");\n } catch {\n return {\n action: \"warn\",\n path,\n detail: `cannot read ${path}; memory block ${opts.blockId} not written`,\n createdFile: false,\n hash: \"\",\n };\n }\n }\n\n if (raw === null) {\n const lines = renderBlockLines(opts);\n const hash = hashBlockContent(lines.slice(1, -1).join(\"\\n\"));\n if (!opts.dryRun) atomicWriteFile(path, `${lines.join(\"\\n\")}\\n`);\n return {\n action: \"create\",\n path,\n detail: `created ${basename(path)} with block ${opts.blockId} (hash ${hash})`,\n createdFile: true,\n hash,\n };\n }\n\n const res = upsertBlockInText(raw, opts);\n const change: BlockFileChange = {\n action: res.action,\n path,\n detail: res.detail,\n createdFile: false,\n hash: res.hash,\n };\n if (res.changed && !opts.dryRun) {\n if (res.recovered) {\n const backup = backupFile(path);\n if (backup) change.backupPath = backup;\n }\n atomicWriteFile(path, res.text);\n }\n return change;\n}\n\n/**\n * Remove every matching managed block from the file at `path`. Missing file or\n * no matching markers → a single idempotent \"skip\". When the remaining content\n * is whitespace-only AND `deleteFileIfCreated` is true (the ledger recorded\n * that agent-connector created this file), the file itself is deleted (Ruler\n * revert semantics: delete only what we created).\n */\nexport function removeManagedBlocksFile(\n path: string,\n match: RemoveBlocksOptions,\n opts: { dryRun: boolean; deleteFileIfCreated?: boolean },\n): BlockFileChange[] {\n if (!existsSync(path)) {\n return [\n {\n action: \"skip\",\n path,\n detail: `${basename(path)} absent; nothing to remove`,\n createdFile: false,\n hash: \"\",\n },\n ];\n }\n let raw: string;\n try {\n raw = readFileSync(path, \"utf8\");\n } catch {\n return [\n {\n action: \"warn\",\n path,\n detail: `cannot read ${path}; managed blocks left in place`,\n createdFile: false,\n hash: \"\",\n },\n ];\n }\n\n const res = removeBlocksFromText(raw, match);\n if (!res.changed) {\n return [\n {\n action: \"skip\",\n path,\n detail: `no agent-connector blocks matching ${match.blockId ?? match.blockIdPrefix ?? \"?\"} in ${basename(path)}`,\n createdFile: false,\n hash: \"\",\n },\n ];\n }\n\n const changes: BlockFileChange[] = [];\n let backupPath: string | undefined;\n if (!opts.dryRun) {\n if (res.recovered) backupPath = backupFile(path) ?? undefined;\n if (res.fileNowEmpty && opts.deleteFileIfCreated) {\n rmSync(path, { force: true });\n } else {\n atomicWriteFile(path, res.text);\n }\n }\n for (const r of res.records) {\n changes.push({\n action: r.action,\n path,\n detail: r.detail,\n createdFile: false,\n hash: \"\",\n ...(backupPath && r.action === \"warn\" ? { backupPath } : {}),\n });\n }\n if (res.fileNowEmpty && opts.deleteFileIfCreated) {\n changes.push({\n action: \"remove\",\n path,\n detail: `${basename(path)} deleted (agent-connector created it; only whitespace remained)`,\n createdFile: false,\n hash: \"\",\n });\n }\n return changes;\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Memory ownership ledger — connectorDir(id)/memory-state.json\n// ─────────────────────────────────────────────────────────────────────────\n\nexport interface MemoryLedgerTarget {\n platform: string;\n scope: string;\n path: string;\n blockId: string;\n /** True when agent-connector CREATED the file (grants deletion rights). */\n createdFile: boolean;\n /** Inner-region hash we last wrote (doctor drift detection). */\n hash: string;\n}\n\nexport interface MemoryLedger {\n version: 1;\n targets: MemoryLedgerTarget[];\n}\n\nexport function memoryLedgerPath(connectorId: string): string {\n return join(connectorDir(connectorId), \"memory-state.json\");\n}\n\nexport function loadMemoryLedger(connectorId: string): MemoryLedger {\n const p = memoryLedgerPath(connectorId);\n if (!existsSync(p)) return { version: 1, targets: [] };\n try {\n const parsed = JSON.parse(readFileSync(p, \"utf8\")) as MemoryLedger;\n if (parsed && Array.isArray(parsed.targets)) return { version: 1, targets: parsed.targets };\n } catch {\n /* corrupt → fresh ledger; the markers remain the source of truth */\n }\n return { version: 1, targets: [] };\n}\n\n/** Persist the ledger; an EMPTY ledger deletes the file (no orphan state). */\nexport function saveMemoryLedger(connectorId: string, ledger: MemoryLedger): void {\n const p = memoryLedgerPath(connectorId);\n assertNoSymlinkInPath(p);\n if (ledger.targets.length === 0) {\n rmSync(p, { force: true });\n return;\n }\n ensureDir(dirname(p));\n writeFileSync(p, `${JSON.stringify(ledger, null, 2)}\\n`, \"utf8\");\n}\n\n/** True when the connector has any recorded memory targets (uninstall guard). */\nexport function hasMemoryLedger(connectorId: string): boolean {\n return loadMemoryLedger(connectorId).targets.length > 0;\n}\n\n/**\n * Upsert one ledger row (keyed by platform+scope+path+blockId). The\n * `createdFile` fact is STICKY: once we created the file, deletion rights\n * survive later syncs that found it present.\n */\nexport function recordMemoryTarget(ledger: MemoryLedger, t: MemoryLedgerTarget): void {\n const i = ledger.targets.findIndex(\n (x) =>\n x.platform === t.platform &&\n x.scope === t.scope &&\n x.path === t.path &&\n x.blockId === t.blockId,\n );\n if (i >= 0) {\n ledger.targets[i] = { ...t, createdFile: ledger.targets[i]!.createdFile || t.createdFile };\n } else {\n ledger.targets.push(t);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