@ken-jo/agent-connector 0.4.0 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/dist/{action-PLZW5BGX.js → action-EV63GAPY.js} +11 -10
- package/dist/{action-PLZW5BGX.js.map → action-EV63GAPY.js.map} +1 -1
- package/dist/amazon-q-COAL3764.js +276 -0
- package/dist/amazon-q-COAL3764.js.map +1 -0
- package/dist/amp-XJQ4TDAU.js +666 -0
- package/dist/amp-XJQ4TDAU.js.map +1 -0
- package/dist/{antigravity-ANDKF3K7.js → antigravity-AMKKKHS4.js} +4 -4
- package/dist/{antigravity-cli-LLRPDDOT.js → antigravity-cli-XERXEH5W.js} +4 -4
- package/dist/{chunk-MAH6QQTO.js → chunk-2X4EH2D7.js} +5 -4
- package/dist/chunk-2X4EH2D7.js.map +1 -0
- package/dist/{chunk-G3ER4SY5.js → chunk-5G4EPJ4Y.js} +9 -9
- package/dist/chunk-BMD7ANKF.js +237 -0
- package/dist/chunk-BMD7ANKF.js.map +1 -0
- package/dist/{chunk-IW77FFNX.js → chunk-CPLK7GTE.js} +41 -5
- package/dist/chunk-CPLK7GTE.js.map +1 -0
- package/dist/{chunk-ADTHT2FN.js → chunk-DCK5FADX.js} +10 -173
- package/dist/chunk-DCK5FADX.js.map +1 -0
- package/dist/{chunk-J3D5W5T2.js → chunk-EROJDXMW.js} +2 -2
- package/dist/{chunk-22Y24V7O.js → chunk-F5RX62T7.js} +2 -2
- package/dist/chunk-FAHIMJRU.js +177 -0
- package/dist/chunk-FAHIMJRU.js.map +1 -0
- package/dist/{chunk-BHUCB6LY.js → chunk-H67V7DEL.js} +8 -7
- package/dist/{chunk-BHUCB6LY.js.map → chunk-H67V7DEL.js.map} +1 -1
- package/dist/{chunk-BXGFUENQ.js → chunk-I5MLE6S7.js} +14 -1
- package/dist/{chunk-BXGFUENQ.js.map → chunk-I5MLE6S7.js.map} +1 -1
- package/dist/{chunk-LL4OBGRU.js → chunk-LQRAPXS4.js} +3 -3
- package/dist/{chunk-KGJWE6A2.js → chunk-MZF2YCXX.js} +2 -2
- package/dist/{chunk-KGXDYGNJ.js → chunk-QC5A3TFQ.js} +19 -19
- package/dist/{chunk-KGXDYGNJ.js.map → chunk-QC5A3TFQ.js.map} +1 -1
- package/dist/{chunk-CIRDOY2V.js → chunk-QOGMDOUX.js} +3 -3
- package/dist/{chunk-KGGBNKI4.js → chunk-RQPKL62M.js} +144 -21
- package/dist/chunk-RQPKL62M.js.map +1 -0
- package/dist/{chunk-6XHB6BE3.js → chunk-SCVBYSF7.js} +1 -1
- package/dist/{chunk-76FUSVIA.js → chunk-SRVAA2VN.js} +6 -5
- package/dist/chunk-SRVAA2VN.js.map +1 -0
- package/dist/chunk-WZA4CSGJ.js +28 -0
- package/dist/chunk-WZA4CSGJ.js.map +1 -0
- package/dist/{claude-code-MLWS7CW6.js → claude-code-T2LPFNC3.js} +20 -30
- package/dist/claude-code-T2LPFNC3.js.map +1 -0
- package/dist/cli/sdk.js +5 -4
- package/dist/cli/sdk.js.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cline-WRYMNS7Z.js +442 -0
- package/dist/cline-WRYMNS7Z.js.map +1 -0
- package/dist/{codebuff-SH2S3QAN.js → codebuff-PODYPOOP.js} +130 -5
- package/dist/codebuff-PODYPOOP.js.map +1 -0
- package/dist/{codex-BXA4FIF4.js → codex-O4G7D7KK.js} +61 -13
- package/dist/codex-O4G7D7KK.js.map +1 -0
- package/dist/continue-K43SUHLQ.js +790 -0
- package/dist/continue-K43SUHLQ.js.map +1 -0
- package/dist/{copilot-cli-ROIBTTDT.js → copilot-cli-Q3SSPT4V.js} +70 -12
- package/dist/copilot-cli-Q3SSPT4V.js.map +1 -0
- package/dist/{crush-QLEFLHUC.js → crush-MBEH2R3I.js} +130 -6
- package/dist/crush-MBEH2R3I.js.map +1 -0
- package/dist/{cursor-ASJPWZ4R.js → cursor-TMBXDYR4.js} +119 -19
- package/dist/cursor-TMBXDYR4.js.map +1 -0
- package/dist/{detect-ZIIS55LD.js → detect-AHJIUMBO.js} +5 -4
- package/dist/{detect-ZIIS55LD.js.map → detect-AHJIUMBO.js.map} +1 -1
- package/dist/{doctor-TJUGSQ5C.js → doctor-G5MLCPAB.js} +221 -95
- package/dist/doctor-G5MLCPAB.js.map +1 -0
- package/dist/{droid-NCSS3B5Y.js → droid-JC2NT6S4.js} +135 -13
- package/dist/droid-JC2NT6S4.js.map +1 -0
- package/dist/{gemini-cli-SLVWLXJW.js → gemini-cli-ILR7M5X3.js} +62 -10
- package/dist/gemini-cli-ILR7M5X3.js.map +1 -0
- package/dist/{goose-PBA7KTE5.js → goose-SFO5BBGW.js} +15 -8
- package/dist/goose-SFO5BBGW.js.map +1 -0
- package/dist/{hermes-ONDCECP2.js → hermes-3N7WN4WS.js} +329 -15
- package/dist/hermes-3N7WN4WS.js.map +1 -0
- package/dist/{hook-OU522ABV.js → hook-76JBKTUX.js} +14 -11
- package/dist/hook-76JBKTUX.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -2
- package/dist/{install-UDCBL7HP.js → install-R7252QFH.js} +11 -10
- package/dist/{install-UDCBL7HP.js.map → install-R7252QFH.js.map} +1 -1
- package/dist/{introspect-DuZSPSHB.d.ts → introspect-Cn3MSA4_.d.ts} +1 -1
- package/dist/{jetbrains-copilot-YABZ3HFA.js → jetbrains-copilot-NRZHI5PC.js} +85 -18
- package/dist/jetbrains-copilot-NRZHI5PC.js.map +1 -0
- package/dist/{kilo-F3ZDZKCT.js → kilo-IX4T3OHJ.js} +115 -19
- package/dist/kilo-IX4T3OHJ.js.map +1 -0
- package/dist/{kilo-cli-3HWPWBY4.js → kilo-cli-2AYCXBQD.js} +109 -13
- package/dist/kilo-cli-2AYCXBQD.js.map +1 -0
- package/dist/{kimi-NV72FVAO.js → kimi-2YFK2GBA.js} +87 -25
- package/dist/kimi-2YFK2GBA.js.map +1 -0
- package/dist/{kiro-C5W6AGDR.js → kiro-YL6AWUYG.js} +3 -3
- package/dist/{leaderboard-TIBVONVT.js → leaderboard-V6VWA5ZV.js} +3 -3
- package/dist/{mimo-code-IMM5YM3M.js → mimo-code-FTMGSKMQ.js} +41 -5
- package/dist/mimo-code-FTMGSKMQ.js.map +1 -0
- package/dist/{mux-DSSH4AFS.js → mux-5XZFB44C.js} +156 -6
- package/dist/mux-5XZFB44C.js.map +1 -0
- package/dist/{nemoclaw-3EVNKD3I.js → nemoclaw-CQYXZVQN.js} +4 -4
- package/dist/{omp-Z6FRNDPN.js → omp-2QMEY6HD.js} +138 -18
- package/dist/omp-2QMEY6HD.js.map +1 -0
- package/dist/{openclaw-7G437NT7.js → openclaw-UZC437RW.js} +4 -4
- package/dist/{opencode-Q6KBSAKW.js → opencode-L4BGFP25.js} +87 -27
- package/dist/opencode-L4BGFP25.js.map +1 -0
- package/dist/{package-RMPN57YZ.js → package-DNLQTPNN.js} +8 -7
- package/dist/{package-RMPN57YZ.js.map → package-DNLQTPNN.js.map} +1 -1
- package/dist/{pi-LZT6WWAZ.js → pi-PVVPVWKG.js} +3 -2
- package/dist/{pi-LZT6WWAZ.js.map → pi-PVVPVWKG.js.map} +1 -1
- package/dist/{qwen-code-WQBKRPWJ.js → qwen-code-G4CXKUHR.js} +426 -10
- package/dist/qwen-code-G4CXKUHR.js.map +1 -0
- package/dist/{roo-code-GWSNU3OW.js → roo-code-67TYJIQR.js} +3 -3
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +9 -8
- package/dist/sdk/index.d.ts +3 -3
- package/dist/sdk/index.js +4 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/test.d.ts +2 -2
- package/dist/sdk/test.js +6 -5
- package/dist/sdk/test.js.map +1 -1
- package/dist/{serve-D3GO36UT.js → serve-EOVWYBGZ.js} +11 -10
- package/dist/{serve-D3GO36UT.js.map → serve-EOVWYBGZ.js.map} +1 -1
- package/dist/{status-KOSKCETC.js → status-VTD6XXLW.js} +7 -6
- package/dist/{status-KOSKCETC.js.map → status-VTD6XXLW.js.map} +1 -1
- package/dist/{statusline-ZNTCL5YC.js → statusline-3ET5YPQ5.js} +10 -9
- package/dist/{statusline-ZNTCL5YC.js.map → statusline-3ET5YPQ5.js.map} +1 -1
- package/dist/{telemetry-XIKUUGTQ.js → telemetry-QCTMKDBQ.js} +6 -5
- package/dist/{telemetry-XIKUUGTQ.js.map → telemetry-QCTMKDBQ.js.map} +1 -1
- package/dist/{trae-NWT3TMSZ.js → trae-7CZZGOGI.js} +3 -3
- package/dist/{types-BEKsAium.d.ts → types-_6arHbX9.d.ts} +67 -24
- package/dist/{uninstall-2LBLQVFA.js → uninstall-FL3SH2DT.js} +11 -10
- package/dist/{uninstall-2LBLQVFA.js.map → uninstall-FL3SH2DT.js.map} +1 -1
- package/dist/{upgrade-ZC2S7VRN.js → upgrade-SLFG2FCT.js} +11 -10
- package/dist/{upgrade-ZC2S7VRN.js.map → upgrade-SLFG2FCT.js.map} +1 -1
- package/dist/{usage-E2A4O2CY.js → usage-IRBLVUZM.js} +3 -3
- package/dist/{usage-event-JKMC4QC4.js → usage-event-VFF77WYY.js} +10 -9
- package/dist/{usage-event-JKMC4QC4.js.map → usage-event-VFF77WYY.js.map} +1 -1
- package/dist/{vscode-copilot-ALV45XF6.js → vscode-copilot-MF2CDNMT.js} +23 -10
- package/dist/vscode-copilot-MF2CDNMT.js.map +1 -0
- package/dist/{warp-H6IX4U3J.js → warp-VKG55TAT.js} +55 -4
- package/dist/warp-VKG55TAT.js.map +1 -0
- package/dist/windsurf-FU5G4SHF.js +443 -0
- package/dist/windsurf-FU5G4SHF.js.map +1 -0
- package/dist/{zed-RH34TNSW.js → zed-SFUHL3GS.js} +3 -3
- package/package.json +2 -2
- package/dist/amp-B524U6LO.js +0 -300
- package/dist/amp-B524U6LO.js.map +0 -1
- package/dist/chunk-3PFFTFCU.js +0 -190
- package/dist/chunk-3PFFTFCU.js.map +0 -1
- package/dist/chunk-76FUSVIA.js.map +0 -1
- package/dist/chunk-ADTHT2FN.js.map +0 -1
- package/dist/chunk-IW77FFNX.js.map +0 -1
- package/dist/chunk-KGGBNKI4.js.map +0 -1
- package/dist/chunk-MAH6QQTO.js.map +0 -1
- package/dist/claude-code-MLWS7CW6.js.map +0 -1
- package/dist/codebuff-SH2S3QAN.js.map +0 -1
- package/dist/codex-BXA4FIF4.js.map +0 -1
- package/dist/copilot-cli-ROIBTTDT.js.map +0 -1
- package/dist/crush-QLEFLHUC.js.map +0 -1
- package/dist/cursor-ASJPWZ4R.js.map +0 -1
- package/dist/doctor-TJUGSQ5C.js.map +0 -1
- package/dist/droid-NCSS3B5Y.js.map +0 -1
- package/dist/gemini-cli-SLVWLXJW.js.map +0 -1
- package/dist/goose-PBA7KTE5.js.map +0 -1
- package/dist/hermes-ONDCECP2.js.map +0 -1
- package/dist/hook-OU522ABV.js.map +0 -1
- package/dist/jetbrains-copilot-YABZ3HFA.js.map +0 -1
- package/dist/kilo-F3ZDZKCT.js.map +0 -1
- package/dist/kilo-cli-3HWPWBY4.js.map +0 -1
- package/dist/kimi-NV72FVAO.js.map +0 -1
- package/dist/mimo-code-IMM5YM3M.js.map +0 -1
- package/dist/mux-DSSH4AFS.js.map +0 -1
- package/dist/omp-Z6FRNDPN.js.map +0 -1
- package/dist/opencode-Q6KBSAKW.js.map +0 -1
- package/dist/qwen-code-WQBKRPWJ.js.map +0 -1
- package/dist/vscode-copilot-ALV45XF6.js.map +0 -1
- package/dist/warp-H6IX4U3J.js.map +0 -1
- /package/dist/{antigravity-ANDKF3K7.js.map → antigravity-AMKKKHS4.js.map} +0 -0
- /package/dist/{antigravity-cli-LLRPDDOT.js.map → antigravity-cli-XERXEH5W.js.map} +0 -0
- /package/dist/{chunk-G3ER4SY5.js.map → chunk-5G4EPJ4Y.js.map} +0 -0
- /package/dist/{chunk-J3D5W5T2.js.map → chunk-EROJDXMW.js.map} +0 -0
- /package/dist/{chunk-22Y24V7O.js.map → chunk-F5RX62T7.js.map} +0 -0
- /package/dist/{chunk-LL4OBGRU.js.map → chunk-LQRAPXS4.js.map} +0 -0
- /package/dist/{chunk-KGJWE6A2.js.map → chunk-MZF2YCXX.js.map} +0 -0
- /package/dist/{chunk-CIRDOY2V.js.map → chunk-QOGMDOUX.js.map} +0 -0
- /package/dist/{chunk-6XHB6BE3.js.map → chunk-SCVBYSF7.js.map} +0 -0
- /package/dist/{kiro-C5W6AGDR.js.map → kiro-YL6AWUYG.js.map} +0 -0
- /package/dist/{leaderboard-TIBVONVT.js.map → leaderboard-V6VWA5ZV.js.map} +0 -0
- /package/dist/{nemoclaw-3EVNKD3I.js.map → nemoclaw-CQYXZVQN.js.map} +0 -0
- /package/dist/{openclaw-7G437NT7.js.map → openclaw-UZC437RW.js.map} +0 -0
- /package/dist/{roo-code-GWSNU3OW.js.map → roo-code-67TYJIQR.js.map} +0 -0
- /package/dist/{trae-NWT3TMSZ.js.map → trae-7CZZGOGI.js.map} +0 -0
- /package/dist/{usage-E2A4O2CY.js.map → usage-IRBLVUZM.js.map} +0 -0
- /package/dist/{zed-RH34TNSW.js.map → zed-SFUHL3GS.js.map} +0 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/adapters/registry.ts
|
|
4
|
+
var ADAPTER_REGISTRY = [
|
|
5
|
+
{
|
|
6
|
+
id: "claude-code",
|
|
7
|
+
load: () => import("./claude-code-T2LPFNC3.js").then((m) => m.default)
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
id: "codex",
|
|
11
|
+
load: () => import("./codex-O4G7D7KK.js").then((m) => m.default)
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: "cursor",
|
|
15
|
+
load: () => import("./cursor-TMBXDYR4.js").then((m) => m.default)
|
|
16
|
+
},
|
|
17
|
+
// vscode-copilot after cursor: cursor is a VS Code fork, so the fork's runtime
|
|
18
|
+
// markers must be checked first during host detection.
|
|
19
|
+
{
|
|
20
|
+
id: "vscode-copilot",
|
|
21
|
+
load: () => import("./vscode-copilot-MF2CDNMT.js").then((m) => m.default)
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "copilot-cli",
|
|
25
|
+
load: () => import("./copilot-cli-Q3SSPT4V.js").then((m) => m.default)
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "gemini-cli",
|
|
29
|
+
load: () => import("./gemini-cli-ILR7M5X3.js").then((m) => m.default)
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "warp",
|
|
33
|
+
load: () => import("./warp-VKG55TAT.js").then((m) => m.default)
|
|
34
|
+
},
|
|
35
|
+
// ts-plugin paradigm: OpenCode loads a generated plugin module that bridges
|
|
36
|
+
// its in-process events to the universal hook entrypoint.
|
|
37
|
+
{
|
|
38
|
+
id: "opencode",
|
|
39
|
+
load: () => import("./opencode-L4BGFP25.js").then((m) => m.default)
|
|
40
|
+
},
|
|
41
|
+
// mimo-code is Xiaomi's MiMoCode (@mimo-ai/cli, bin `mimo`) — an OpenCode FORK
|
|
42
|
+
// (ts-plugin, MCP root key "mcp", ~/.config/mimocode/mimocode.json). Grouped
|
|
43
|
+
// beside the OpenCode family whose config dialect + plugin contract it shares;
|
|
44
|
+
// detected via the DISTINCT ~/.config/mimocode dir, so there is no fork-ordering
|
|
45
|
+
// constraint vs opencode (no shared config file to disambiguate).
|
|
46
|
+
{
|
|
47
|
+
id: "mimo-code",
|
|
48
|
+
load: () => import("./mimo-code-FTMGSKMQ.js").then((m) => m.default)
|
|
49
|
+
},
|
|
50
|
+
// kilo-cli is the SQLite-backed OpenCode FORK command-line product (ts-plugin,
|
|
51
|
+
// loads @kilocode/plugin modules registered in kilo.jsonc's "plugin" array;
|
|
52
|
+
// MCP root key "mcp", ~/.config/kilo/kilo.jsonc). Grouped beside the OpenCode
|
|
53
|
+
// family whose plugin contract + config dialect it shares; distinct host from
|
|
54
|
+
// the "kilo" extension so there is no fork-ordering constraint between them.
|
|
55
|
+
{
|
|
56
|
+
id: "kilo-cli",
|
|
57
|
+
load: () => import("./kilo-cli-2AYCXBQD.js").then((m) => m.default)
|
|
58
|
+
},
|
|
59
|
+
// Wave 1 — mcp-only adapters (no lifecycle hooks; MCP registration only).
|
|
60
|
+
{
|
|
61
|
+
id: "droid",
|
|
62
|
+
load: () => import("./droid-JC2NT6S4.js").then((m) => m.default)
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "roo-code",
|
|
66
|
+
load: () => import("./roo-code-67TYJIQR.js").then((m) => m.default)
|
|
67
|
+
},
|
|
68
|
+
// kilo is the Kilo Code VS Code extension (kilocode.kilo-code) — a Roo/Cline
|
|
69
|
+
// fork, so it sits beside roo-code (mcp-only, root key "mcpServers", VS Code
|
|
70
|
+
// globalStorage / .kilocode project scope). Distinct host from "kilo-cli".
|
|
71
|
+
{
|
|
72
|
+
id: "kilo",
|
|
73
|
+
load: () => import("./kilo-IX4T3OHJ.js").then((m) => m.default)
|
|
74
|
+
},
|
|
75
|
+
// cline is the Cline VS Code extension (saoudrizwan.claude-dev) — the most-
|
|
76
|
+
// installed AI coding extension and the PARENT that roo-code and kilo forked.
|
|
77
|
+
// mcp-only (no hook layer); MCP at the globalStorage cline_mcp_settings.json
|
|
78
|
+
// ("mcpServers"); content lives in the .clinerules tree + ~/Documents/Cline.
|
|
79
|
+
// NO runtime-marker collision with roo-code (rooveterinaryinc.roo-cline / .roo)
|
|
80
|
+
// or kilo (kilocode.kilo-code / .kilo) — distinct ext ids + dotdirs — so there
|
|
81
|
+
// is NO fork-before-parent ordering constraint here; it simply sits beside them.
|
|
82
|
+
{
|
|
83
|
+
id: "cline",
|
|
84
|
+
load: () => import("./cline-WRYMNS7Z.js").then((m) => m.default)
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: "trae",
|
|
88
|
+
load: () => import("./trae-7CZZGOGI.js").then((m) => m.default)
|
|
89
|
+
},
|
|
90
|
+
// antigravity-cli BEFORE antigravity: the `agy` CLI is a fork of the IDE
|
|
91
|
+
// adapter with its own runtime markers (the universal hook command tags the
|
|
92
|
+
// host as "antigravity-cli"), so the more-specific CLI marker must be checked
|
|
93
|
+
// before the IDE/parent during host detection.
|
|
94
|
+
{
|
|
95
|
+
id: "antigravity-cli",
|
|
96
|
+
load: () => import("./antigravity-cli-XERXEH5W.js").then((m) => m.default)
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: "antigravity",
|
|
100
|
+
load: () => import("./antigravity-AMKKKHS4.js").then((m) => m.default)
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: "zed",
|
|
104
|
+
load: () => import("./zed-SFUHL3GS.js").then((m) => m.default)
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: "amp",
|
|
108
|
+
load: () => import("./amp-XJQ4TDAU.js").then((m) => m.default)
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: "codebuff",
|
|
112
|
+
load: () => import("./codebuff-PODYPOOP.js").then((m) => m.default)
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: "mux",
|
|
116
|
+
load: () => import("./mux-5XZFB44C.js").then((m) => m.default)
|
|
117
|
+
},
|
|
118
|
+
// Pi — mcp-only host with no writable MCP config; drives the Agent Skills
|
|
119
|
+
// surface only (writes <piDir>/skills/<name>/SKILL.md).
|
|
120
|
+
{
|
|
121
|
+
id: "pi",
|
|
122
|
+
load: () => import("./pi-PVVPVWKG.js").then((m) => m.default)
|
|
123
|
+
},
|
|
124
|
+
// Wave 2 — json-stdio adapters (full hook dispatch via the universal entrypoint).
|
|
125
|
+
// jetbrains-copilot before vscode-copilot is unnecessary (distinct hosts); grouped here.
|
|
126
|
+
{
|
|
127
|
+
id: "jetbrains-copilot",
|
|
128
|
+
load: () => import("./jetbrains-copilot-NRZHI5PC.js").then((m) => m.default)
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: "qwen-code",
|
|
132
|
+
load: () => import("./qwen-code-G4CXKUHR.js").then((m) => m.default)
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
id: "kiro",
|
|
136
|
+
load: () => import("./kiro-YL6AWUYG.js").then((m) => m.default)
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: "kimi",
|
|
140
|
+
load: () => import("./kimi-2YFK2GBA.js").then((m) => m.default)
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: "crush",
|
|
144
|
+
load: () => import("./crush-MBEH2R3I.js").then((m) => m.default)
|
|
145
|
+
},
|
|
146
|
+
// Wave 3 — json-stdio adapters with YAML config (MCP in YAML; hooks per host).
|
|
147
|
+
{
|
|
148
|
+
id: "goose",
|
|
149
|
+
load: () => import("./goose-SFO5BBGW.js").then((m) => m.default)
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: "hermes",
|
|
153
|
+
load: () => import("./hermes-3N7WN4WS.js").then((m) => m.default)
|
|
154
|
+
},
|
|
155
|
+
// Wave 4 — ts-plugin adapters (generate a bridge module to the universal entrypoint).
|
|
156
|
+
{
|
|
157
|
+
id: "omp",
|
|
158
|
+
load: () => import("./omp-2QMEY6HD.js").then((m) => m.default)
|
|
159
|
+
},
|
|
160
|
+
// nemoclaw BEFORE openclaw (fork-before-parent convention). NVIDIA NemoClaw
|
|
161
|
+
// wraps OpenClaw and DRIVES the SAME ~/.openclaw/openclaw.json, so a NemoClaw
|
|
162
|
+
// box carries BOTH the ~/.nemoclaw/ and ~/.openclaw/ markers. Exclusivity is
|
|
163
|
+
// enforced at the SOURCE: OpenClawAdapter.detectInstalled BOWS OUT when
|
|
164
|
+
// ~/.nemoclaw/ is present, so the shared config is never double-targeted as two
|
|
165
|
+
// platforms. This ordering is the deterministic tie-break (matching the
|
|
166
|
+
// antigravity-cli/antigravity precedent). nemoclaw extends OpenClawAdapter
|
|
167
|
+
// (id/name/detection overridden), so inherited server/hook registration still
|
|
168
|
+
// lands in the wrapped openclaw.json.
|
|
169
|
+
{
|
|
170
|
+
id: "nemoclaw",
|
|
171
|
+
load: () => import("./nemoclaw-CQYXZVQN.js").then((m) => m.default)
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
id: "openclaw",
|
|
175
|
+
load: () => import("./openclaw-UZC437RW.js").then((m) => m.default)
|
|
176
|
+
},
|
|
177
|
+
// Wave 5 — mcp-only: Amazon Q Developer CLI. JSON MCP config under ~/.aws/amazonq/
|
|
178
|
+
// (user) and .amazonq/ (project); root key "mcpServers"; bare stdio entry
|
|
179
|
+
// { command, args, env, timeout? } or remote entry { type: "http", url } (no
|
|
180
|
+
// headers) for http. The agent-format hooks layer (cli-agents/*.json) +
|
|
181
|
+
// agents/prompts content surfaces are separate, not-yet-wired surfaces; this
|
|
182
|
+
// adapter installs MCP entries + the .amazonq/rules memory surface.
|
|
183
|
+
{
|
|
184
|
+
id: "amazon-q",
|
|
185
|
+
load: () => import("./amazon-q-COAL3764.js").then((m) => m.default)
|
|
186
|
+
},
|
|
187
|
+
// Continue (the `cn` terminal agent / Continue.dev, npm @continuedev/cli) —
|
|
188
|
+
// json-stdio (Claude-compatible hooks). MCP config is YAML at ~/.continue/config.yaml (user) and
|
|
189
|
+
// <projectDir>/.continue/config.yaml (project); root key "mcpServers" is a
|
|
190
|
+
// YAML ARRAY of { name, command, type?, args?, env?, cwd?, url } entries (NOT a
|
|
191
|
+
// keyed map). Hooks: a Claude-compatible json-stdio layer in settings.json
|
|
192
|
+
// (~/.continue/settings.json — separate from the MCP config.yaml; PR #11029) +
|
|
193
|
+
// nativeHooks for the host-specific events. Distinct ~/.continue marker — no
|
|
194
|
+
// fork-ordering constraint vs any sibling.
|
|
195
|
+
{
|
|
196
|
+
id: "continue",
|
|
197
|
+
load: () => import("./continue-K43SUHLQ.js").then((m) => m.default)
|
|
198
|
+
},
|
|
199
|
+
// Windsurf (Codeium / Cognition's Cascade agent) — mcp-only. USER/GLOBAL scope
|
|
200
|
+
// ONLY: MCP config is JSON at ~/.codeium/windsurf/mcp_config.json (the docs
|
|
201
|
+
// document no project/workspace path), root key "mcpServers" is a Claude-
|
|
202
|
+
// Desktop-style OBJECT map keyed by server name (like cursor). stdio entry
|
|
203
|
+
// { command, args?, env? }; remote entry { serverUrl, headers? } (NOT `url`;
|
|
204
|
+
// no type/disabled). No user-installable hook/plugin layer (GUI editor), so it
|
|
205
|
+
// stays mcp-only paradigm — but content surfaces ARE wired: workflows
|
|
206
|
+
// (.windsurf/workflows + ~/.codeium/windsurf/global_workflows), skills
|
|
207
|
+
// (.windsurf/skills + ~/.codeium/windsurf/skills), and the .windsurf/rules
|
|
208
|
+
// memory surface. Distinct ~/.codeium marker — no fork-ordering constraint.
|
|
209
|
+
{
|
|
210
|
+
id: "windsurf",
|
|
211
|
+
load: () => import("./windsurf-FU5G4SHF.js").then((m) => m.default)
|
|
212
|
+
}
|
|
213
|
+
];
|
|
214
|
+
var REGISTRY_BY_ID = new Map(
|
|
215
|
+
ADAPTER_REGISTRY.map((factory) => [factory.id, factory])
|
|
216
|
+
);
|
|
217
|
+
var REGISTERED_PLATFORM_IDS = new Set(
|
|
218
|
+
ADAPTER_REGISTRY.map((factory) => factory.id)
|
|
219
|
+
);
|
|
220
|
+
function getFactory(id) {
|
|
221
|
+
return REGISTRY_BY_ID.get(id);
|
|
222
|
+
}
|
|
223
|
+
async function loadAdapter(id) {
|
|
224
|
+
const factory = getFactory(id);
|
|
225
|
+
return factory ? factory.load() : void 0;
|
|
226
|
+
}
|
|
227
|
+
async function allAdapters() {
|
|
228
|
+
return Promise.all(ADAPTER_REGISTRY.map((factory) => factory.load()));
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export {
|
|
232
|
+
ADAPTER_REGISTRY,
|
|
233
|
+
REGISTERED_PLATFORM_IDS,
|
|
234
|
+
loadAdapter,
|
|
235
|
+
allAdapters
|
|
236
|
+
};
|
|
237
|
+
//# sourceMappingURL=chunk-BMD7ANKF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/adapters/registry.ts"],"sourcesContent":["/**\n * adapters/registry — single source of truth for the platforms agent-connector\n * targets. Generalized from context-mode's `ADAPTER_REGISTRY` pattern, adapted\n * to our `Adapter` / `AdapterFactory` contract (adapters/spi.ts).\n *\n * In context-mode the same platform set was redeclared in four places (env-var\n * detection, session-dir lookup, the lazy adapter loader, and per-adapter base\n * constructors); adding a platform meant editing all of them and missing one\n * was silent. Here the list lives ONCE below: each platform is one entry with a\n * lazy `load()` thunk that resolves the adapter singleton. Adding a platform is\n * a single new entry — `getFactory` / `loadAdapter` / `allAdapters` and the\n * detection cascade in detect.ts all derive from this list.\n *\n * `load()` returns the module's default export, which every adapter file is\n * required to provide as its singleton (`export default adapter;`). It is a\n * function (not an eager import) so module loading stays lazy: an adapter is\n * only imported when it is actually needed, keeping startup cheap.\n *\n * Order is load-bearing for runtime host detection (detect.ts iterates env\n * markers in registry order): forks MUST precede their parent so a session\n * running inside a derived shell is not misclassified as the parent. For the\n * three Phase-1 adapters this is moot, but the ordering convention is fixed now\n * so later additions (cursor is a VS Code fork, etc.) slot in correctly.\n */\n\nimport type { PlatformId } from \"../core/types.js\";\nimport type { Adapter, AdapterFactory } from \"./spi.js\";\n\n/**\n * Authoritative list of installable platforms. One entry per platform; the\n * `load` thunk lazily imports the adapter module and returns its default-export\n * singleton. To add a platform: drop its `src/adapters/<id>/index.ts` in place\n * (default-exporting an `Adapter`) and add one entry here.\n */\nexport const ADAPTER_REGISTRY: readonly AdapterFactory[] = [\n {\n id: \"claude-code\",\n load: () => import(\"./claude-code/index.js\").then((m) => m.default),\n },\n {\n id: \"codex\",\n load: () => import(\"./codex/index.js\").then((m) => m.default),\n },\n {\n id: \"cursor\",\n load: () => import(\"./cursor/index.js\").then((m) => m.default),\n },\n // vscode-copilot after cursor: cursor is a VS Code fork, so the fork's runtime\n // markers must be checked first during host detection.\n {\n id: \"vscode-copilot\",\n load: () => import(\"./vscode-copilot/index.js\").then((m) => m.default),\n },\n {\n id: \"copilot-cli\",\n load: () => import(\"./copilot-cli/index.js\").then((m) => m.default),\n },\n {\n id: \"gemini-cli\",\n load: () => import(\"./gemini-cli/index.js\").then((m) => m.default),\n },\n {\n id: \"warp\",\n load: () => import(\"./warp/index.js\").then((m) => m.default),\n },\n // ts-plugin paradigm: OpenCode loads a generated plugin module that bridges\n // its in-process events to the universal hook entrypoint.\n {\n id: \"opencode\",\n load: () => import(\"./opencode/index.js\").then((m) => m.default),\n },\n // mimo-code is Xiaomi's MiMoCode (@mimo-ai/cli, bin `mimo`) — an OpenCode FORK\n // (ts-plugin, MCP root key \"mcp\", ~/.config/mimocode/mimocode.json). Grouped\n // beside the OpenCode family whose config dialect + plugin contract it shares;\n // detected via the DISTINCT ~/.config/mimocode dir, so there is no fork-ordering\n // constraint vs opencode (no shared config file to disambiguate).\n {\n id: \"mimo-code\",\n load: () => import(\"./mimo-code/index.js\").then((m) => m.default),\n },\n // kilo-cli is the SQLite-backed OpenCode FORK command-line product (ts-plugin,\n // loads @kilocode/plugin modules registered in kilo.jsonc's \"plugin\" array;\n // MCP root key \"mcp\", ~/.config/kilo/kilo.jsonc). Grouped beside the OpenCode\n // family whose plugin contract + config dialect it shares; distinct host from\n // the \"kilo\" extension so there is no fork-ordering constraint between them.\n {\n id: \"kilo-cli\",\n load: () => import(\"./kilo-cli/index.js\").then((m) => m.default),\n },\n // Wave 1 — mcp-only adapters (no lifecycle hooks; MCP registration only).\n {\n id: \"droid\",\n load: () => import(\"./droid/index.js\").then((m) => m.default),\n },\n {\n id: \"roo-code\",\n load: () => import(\"./roo-code/index.js\").then((m) => m.default),\n },\n // kilo is the Kilo Code VS Code extension (kilocode.kilo-code) — a Roo/Cline\n // fork, so it sits beside roo-code (mcp-only, root key \"mcpServers\", VS Code\n // globalStorage / .kilocode project scope). Distinct host from \"kilo-cli\".\n {\n id: \"kilo\",\n load: () => import(\"./kilo/index.js\").then((m) => m.default),\n },\n // cline is the Cline VS Code extension (saoudrizwan.claude-dev) — the most-\n // installed AI coding extension and the PARENT that roo-code and kilo forked.\n // mcp-only (no hook layer); MCP at the globalStorage cline_mcp_settings.json\n // (\"mcpServers\"); content lives in the .clinerules tree + ~/Documents/Cline.\n // NO runtime-marker collision with roo-code (rooveterinaryinc.roo-cline / .roo)\n // or kilo (kilocode.kilo-code / .kilo) — distinct ext ids + dotdirs — so there\n // is NO fork-before-parent ordering constraint here; it simply sits beside them.\n {\n id: \"cline\",\n load: () => import(\"./cline/index.js\").then((m) => m.default),\n },\n {\n id: \"trae\",\n load: () => import(\"./trae/index.js\").then((m) => m.default),\n },\n // antigravity-cli BEFORE antigravity: the `agy` CLI is a fork of the IDE\n // adapter with its own runtime markers (the universal hook command tags the\n // host as \"antigravity-cli\"), so the more-specific CLI marker must be checked\n // before the IDE/parent during host detection.\n {\n id: \"antigravity-cli\",\n load: () => import(\"./antigravity-cli/index.js\").then((m) => m.default),\n },\n {\n id: \"antigravity\",\n load: () => import(\"./antigravity/index.js\").then((m) => m.default),\n },\n {\n id: \"zed\",\n load: () => import(\"./zed/index.js\").then((m) => m.default),\n },\n {\n id: \"amp\",\n load: () => import(\"./amp/index.js\").then((m) => m.default),\n },\n {\n id: \"codebuff\",\n load: () => import(\"./codebuff/index.js\").then((m) => m.default),\n },\n {\n id: \"mux\",\n load: () => import(\"./mux/index.js\").then((m) => m.default),\n },\n // Pi — mcp-only host with no writable MCP config; drives the Agent Skills\n // surface only (writes <piDir>/skills/<name>/SKILL.md).\n {\n id: \"pi\",\n load: () => import(\"./pi/index.js\").then((m) => m.default),\n },\n // Wave 2 — json-stdio adapters (full hook dispatch via the universal entrypoint).\n // jetbrains-copilot before vscode-copilot is unnecessary (distinct hosts); grouped here.\n {\n id: \"jetbrains-copilot\",\n load: () => import(\"./jetbrains-copilot/index.js\").then((m) => m.default),\n },\n {\n id: \"qwen-code\",\n load: () => import(\"./qwen-code/index.js\").then((m) => m.default),\n },\n {\n id: \"kiro\",\n load: () => import(\"./kiro/index.js\").then((m) => m.default),\n },\n {\n id: \"kimi\",\n load: () => import(\"./kimi/index.js\").then((m) => m.default),\n },\n {\n id: \"crush\",\n load: () => import(\"./crush/index.js\").then((m) => m.default),\n },\n // Wave 3 — json-stdio adapters with YAML config (MCP in YAML; hooks per host).\n {\n id: \"goose\",\n load: () => import(\"./goose/index.js\").then((m) => m.default),\n },\n {\n id: \"hermes\",\n load: () => import(\"./hermes/index.js\").then((m) => m.default),\n },\n // Wave 4 — ts-plugin adapters (generate a bridge module to the universal entrypoint).\n {\n id: \"omp\",\n load: () => import(\"./omp/index.js\").then((m) => m.default),\n },\n // nemoclaw BEFORE openclaw (fork-before-parent convention). NVIDIA NemoClaw\n // wraps OpenClaw and DRIVES the SAME ~/.openclaw/openclaw.json, so a NemoClaw\n // box carries BOTH the ~/.nemoclaw/ and ~/.openclaw/ markers. Exclusivity is\n // enforced at the SOURCE: OpenClawAdapter.detectInstalled BOWS OUT when\n // ~/.nemoclaw/ is present, so the shared config is never double-targeted as two\n // platforms. This ordering is the deterministic tie-break (matching the\n // antigravity-cli/antigravity precedent). nemoclaw extends OpenClawAdapter\n // (id/name/detection overridden), so inherited server/hook registration still\n // lands in the wrapped openclaw.json.\n {\n id: \"nemoclaw\",\n load: () => import(\"./nemoclaw/index.js\").then((m) => m.default),\n },\n {\n id: \"openclaw\",\n load: () => import(\"./openclaw/index.js\").then((m) => m.default),\n },\n // Wave 5 — mcp-only: Amazon Q Developer CLI. JSON MCP config under ~/.aws/amazonq/\n // (user) and .amazonq/ (project); root key \"mcpServers\"; bare stdio entry\n // { command, args, env, timeout? } or remote entry { type: \"http\", url } (no\n // headers) for http. The agent-format hooks layer (cli-agents/*.json) +\n // agents/prompts content surfaces are separate, not-yet-wired surfaces; this\n // adapter installs MCP entries + the .amazonq/rules memory surface.\n {\n id: \"amazon-q\",\n load: () => import(\"./amazon-q/index.js\").then((m) => m.default),\n },\n // Continue (the `cn` terminal agent / Continue.dev, npm @continuedev/cli) —\n // json-stdio (Claude-compatible hooks). MCP config is YAML at ~/.continue/config.yaml (user) and\n // <projectDir>/.continue/config.yaml (project); root key \"mcpServers\" is a\n // YAML ARRAY of { name, command, type?, args?, env?, cwd?, url } entries (NOT a\n // keyed map). Hooks: a Claude-compatible json-stdio layer in settings.json\n // (~/.continue/settings.json — separate from the MCP config.yaml; PR #11029) +\n // nativeHooks for the host-specific events. Distinct ~/.continue marker — no\n // fork-ordering constraint vs any sibling.\n {\n id: \"continue\",\n load: () => import(\"./continue/index.js\").then((m) => m.default),\n },\n // Windsurf (Codeium / Cognition's Cascade agent) — mcp-only. USER/GLOBAL scope\n // ONLY: MCP config is JSON at ~/.codeium/windsurf/mcp_config.json (the docs\n // document no project/workspace path), root key \"mcpServers\" is a Claude-\n // Desktop-style OBJECT map keyed by server name (like cursor). stdio entry\n // { command, args?, env? }; remote entry { serverUrl, headers? } (NOT `url`;\n // no type/disabled). No user-installable hook/plugin layer (GUI editor), so it\n // stays mcp-only paradigm — but content surfaces ARE wired: workflows\n // (.windsurf/workflows + ~/.codeium/windsurf/global_workflows), skills\n // (.windsurf/skills + ~/.codeium/windsurf/skills), and the .windsurf/rules\n // memory surface. Distinct ~/.codeium marker — no fork-ordering constraint.\n {\n id: \"windsurf\",\n load: () => import(\"./windsurf/index.js\").then((m) => m.default),\n },\n];\n\n/** O(1) lookup index, built once at module-load time. */\nconst REGISTRY_BY_ID: ReadonlyMap<PlatformId, AdapterFactory> = new Map(\n ADAPTER_REGISTRY.map((factory) => [factory.id, factory] as const),\n);\n\n/** Every platform id present in the registry (useful for matrix tests). */\nexport const REGISTERED_PLATFORM_IDS: ReadonlySet<PlatformId> = new Set(\n ADAPTER_REGISTRY.map((factory) => factory.id),\n);\n\n/**\n * Look up the lazy factory for a platform id. Returns `undefined` for ids that\n * are not registered (including `\"unknown\"` and typos) so callers can fall back\n * deliberately rather than crash.\n */\nexport function getFactory(id: PlatformId | string): AdapterFactory | undefined {\n return REGISTRY_BY_ID.get(id as PlatformId);\n}\n\n/**\n * Resolve a platform id to its adapter singleton. Returns `undefined` when the\n * id is not registered — callers decide whether to skip or fall back.\n */\nexport async function loadAdapter(id: PlatformId | string): Promise<Adapter | undefined> {\n const factory = getFactory(id);\n return factory ? factory.load() : undefined;\n}\n\n/**\n * Load every registered adapter. Imports run in parallel; the result preserves\n * registry order so downstream detection/install logic sees forks before\n * parents.\n */\nexport async function allAdapters(): Promise<Adapter[]> {\n return Promise.all(ADAPTER_REGISTRY.map((factory) => factory.load()));\n}\n"],"mappings":";;;AAkCO,IAAM,mBAA8C;AAAA,EACzD;AAAA,IACE,IAAI;AAAA,IACJ,MAAM,MAAM,OAAO,2BAAwB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,EACpE;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM,MAAM,OAAO,qBAAkB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,EAC9D;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM,MAAM,OAAO,sBAAmB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,EAC/D;AAAA;AAAA;AAAA,EAGA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM,MAAM,OAAO,8BAA2B,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,EACvE;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM,MAAM,OAAO,2BAAwB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,EACpE;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM,MAAM,OAAO,0BAAuB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,EACnE;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM,MAAM,OAAO,oBAAiB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,EAC7D;AAAA;AAAA;AAAA,EAGA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM,MAAM,OAAO,wBAAqB,EAAE,KAAK,CAAC,MA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,YAAY,QAAQ,EAAE;AAC9C;AAOO,SAAS,WAAW,IAAqD;AAC9E,SAAO,eAAe,IAAI,EAAgB;AAC5C;AAMA,eAAsB,YAAY,IAAuD;AACvF,QAAM,UAAU,WAAW,EAAE;AAC7B,SAAO,UAAU,QAAQ,KAAK,IAAI;AACpC;AAOA,eAAsB,cAAkC;AACtD,SAAO,QAAQ,IAAI,iBAAiB,IAAI,CAAC,YAAY,QAAQ,KAAK,CAAC,CAAC;AACtE;","names":[]}
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
renderFrontmatterMd
|
|
4
4
|
} from "./chunk-7L6ITC4T.js";
|
|
5
|
+
import {
|
|
6
|
+
buildHomeBinActionCommand
|
|
7
|
+
} from "./chunk-I5MLE6S7.js";
|
|
5
8
|
import {
|
|
6
9
|
MEMORY_CONTENT_SOFT_BUDGET_BYTES,
|
|
7
10
|
listManagedBlocks,
|
|
@@ -400,7 +403,8 @@ var BaseAdapter = class {
|
|
|
400
403
|
check,
|
|
401
404
|
status: "warn",
|
|
402
405
|
message: `memory file missing: ${row.path}`,
|
|
403
|
-
fix: "agent-connector install (sync) will re-create the block"
|
|
406
|
+
fix: "agent-connector install (sync) will re-create the block",
|
|
407
|
+
fixable: true
|
|
404
408
|
});
|
|
405
409
|
continue;
|
|
406
410
|
}
|
|
@@ -417,7 +421,8 @@ var BaseAdapter = class {
|
|
|
417
421
|
check,
|
|
418
422
|
status: "warn",
|
|
419
423
|
message: `managed block not found in ${row.path}`,
|
|
420
|
-
fix: "agent-connector install (sync) will re-append it"
|
|
424
|
+
fix: "agent-connector install (sync) will re-append it",
|
|
425
|
+
fixable: true
|
|
421
426
|
});
|
|
422
427
|
} else if (block.drifted) {
|
|
423
428
|
results.push({
|
|
@@ -435,7 +440,8 @@ var BaseAdapter = class {
|
|
|
435
440
|
check,
|
|
436
441
|
status: "warn",
|
|
437
442
|
message: `${this.id} now resolves its ${row.scope}-scope memory file to ${current[0].path} (${current[0].reason}) \u2014 the block in ${row.path} may no longer be read`,
|
|
438
|
-
fix: "agent-connector install (sync) re-probes and writes the file the host reads now"
|
|
443
|
+
fix: "agent-connector install (sync) re-probes and writes the file the host reads now",
|
|
444
|
+
fixable: true
|
|
439
445
|
});
|
|
440
446
|
}
|
|
441
447
|
}
|
|
@@ -503,6 +509,31 @@ var BaseAdapter = class {
|
|
|
503
509
|
uninstallActions(ctx) {
|
|
504
510
|
return this.unsupportedSurface(ctx, "actions", (ctx.connector.actions ?? []).length);
|
|
505
511
|
}
|
|
512
|
+
/**
|
|
513
|
+
* Shared, surface-agnostic helper for the action EMITTERS: yield one
|
|
514
|
+
* {@link ActionTrigger} per declared action, each carrying the home-bin verb
|
|
515
|
+
* command the host trigger must run
|
|
516
|
+
* (`<homeBin> action <host> <actionId> --connector <id>`, via
|
|
517
|
+
* {@link buildHomeBinActionCommand}) plus a `label`/`description` that fall
|
|
518
|
+
* back to the action id. Each supporting adapter iterates this and writes its
|
|
519
|
+
* host-native trigger (hermes quick_commands / warp workflow / droid exec
|
|
520
|
+
* file) — the per-host file shape is NOT this helper's concern, only the
|
|
521
|
+
* common (id, label, description, command) tuple. Callers own the standard
|
|
522
|
+
* guards (platforms[id].actions === false / empty actions).
|
|
523
|
+
*/
|
|
524
|
+
actionTriggers(ctx) {
|
|
525
|
+
return (ctx.connector.actions ?? []).map((action) => ({
|
|
526
|
+
id: action.id,
|
|
527
|
+
label: action.description ?? action.id,
|
|
528
|
+
description: action.description ?? action.id,
|
|
529
|
+
command: buildHomeBinActionCommand(
|
|
530
|
+
ctx.homeBinPath,
|
|
531
|
+
this.id,
|
|
532
|
+
action.id,
|
|
533
|
+
ctx.connector.id
|
|
534
|
+
)
|
|
535
|
+
}));
|
|
536
|
+
}
|
|
506
537
|
/**
|
|
507
538
|
* Default response for a content surface this platform cannot honor: a single
|
|
508
539
|
* skip when the connector declares none of that surface, else a single "warn"
|
|
@@ -775,7 +806,12 @@ var BaseAdapter = class {
|
|
|
775
806
|
check: `${this.name}: config present`,
|
|
776
807
|
status: "warn",
|
|
777
808
|
message: `not found: ${cfg}`,
|
|
778
|
-
fix: `agent-connector install --targets ${this.id}
|
|
809
|
+
fix: `agent-connector install --targets ${this.id}`,
|
|
810
|
+
// Only sync-recoverable when the connector actually declares a
|
|
811
|
+
// server — a re-sync writes the config file only then. For a
|
|
812
|
+
// serverless (memory/configPatch-only) connector the file is never
|
|
813
|
+
// created, so marking it fixable would loop it into "still failing".
|
|
814
|
+
fixable: !!ctx.connector.server
|
|
779
815
|
}
|
|
780
816
|
);
|
|
781
817
|
for (const hc of this.getHealthChecks?.(ctx) ?? []) {
|
|
@@ -795,4 +831,4 @@ export {
|
|
|
795
831
|
parseJsonc,
|
|
796
832
|
BaseAdapter
|
|
797
833
|
};
|
|
798
|
-
//# sourceMappingURL=chunk-
|
|
834
|
+
//# sourceMappingURL=chunk-CPLK7GTE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/jsonc.ts","../src/adapters/base.ts"],"sourcesContent":["/**\n * core/jsonc — tolerant JSONC / JSON5-lite parsing.\n *\n * Many hosts document their config file as JSONC (or JSON5): // line comments,\n * /* *\\/ block comments, and trailing commas are all legal. A strict JSON.parse\n * false-fails such a perfectly valid file → null → and a careless `?? {}` then\n * OVERWRITES the user's entire config with just our entry (data loss). To avoid\n * that, every JSON/JSONC adapter parses through `parseJsonc`, which strips\n * comments + trailing commas in ONE string-aware pass before JSON.parse.\n *\n * The single pass is deliberately string-literal aware: a // or /* inside a\n * quoted value (e.g. \"http://x//y\") is NOT a comment, and a comma inside a\n * string (e.g. \"a,]\") is NOT a trailing comma — both must survive verbatim.\n */\n\n/**\n * Strip // line comments, /* *\\/ block comments, and trailing commas from JSONC\n * text in a SINGLE string-aware pass.\n *\n * Rules:\n * - While inside a string literal, every character (including //, /*, and ,)\n * is copied verbatim; backslash escapes the next character.\n * - Outside a string, // … runs to end-of-line and /* … *\\/ to its close.\n * - A comma is dropped ONLY when the next non-whitespace, non-comment token is\n * a closing `}` or `]` (a trailing comma). A comma followed by another value\n * or by end-of-input is preserved (the latter lets JSON.parse report the\n * real syntax error instead of us masking it).\n */\nexport function stripJsonc(text: string): string {\n const n = text.length;\n let out = \"\";\n let i = 0;\n let inString = false;\n let quote = \"\";\n\n while (i < n) {\n const ch = text[i] as string;\n\n if (inString) {\n out += ch;\n if (ch === \"\\\\\") {\n // Copy the escaped character verbatim (covers \\\" \\\\ \\/ etc.).\n if (i + 1 < n) {\n out += text[i + 1] as string;\n i += 2;\n continue;\n }\n } else if (ch === quote) {\n inString = false;\n }\n i += 1;\n continue;\n }\n\n const next = i + 1 < n ? (text[i + 1] as string) : \"\";\n\n // Enter a string literal.\n if (ch === '\"' || ch === \"'\") {\n inString = true;\n quote = ch;\n out += ch;\n i += 1;\n continue;\n }\n\n // Line comment — skip to end of line (keep the newline for line tracking).\n if (ch === \"/\" && next === \"/\") {\n i += 2;\n while (i < n && text[i] !== \"\\n\") i += 1;\n continue;\n }\n\n // Block comment — skip to the closing */.\n if (ch === \"/\" && next === \"*\") {\n i += 2;\n while (i < n && !(text[i] === \"*\" && text[i + 1] === \"/\")) i += 1;\n i += 2; // consume the closing */\n continue;\n }\n\n // Trailing comma — drop it only when the next significant token (skipping\n // whitespace AND comments) is a closing } or ]. This stays string-aware\n // because we only reach here outside a string.\n if (ch === \",\") {\n const closer = nextSignificant(text, i + 1);\n if (closer === \"}\" || closer === \"]\") {\n i += 1; // drop the trailing comma\n continue;\n }\n }\n\n out += ch;\n i += 1;\n }\n\n return out;\n}\n\n/**\n * Peek the next significant (non-whitespace, non-comment) character at/after\n * `from`, returning \"\" at end-of-input. Used only outside string literals.\n */\nfunction nextSignificant(text: string, from: number): string {\n const n = text.length;\n let i = from;\n while (i < n) {\n const ch = text[i] as string;\n if (ch === \" \" || ch === \"\\t\" || ch === \"\\r\" || ch === \"\\n\") {\n i += 1;\n continue;\n }\n const next = i + 1 < n ? (text[i + 1] as string) : \"\";\n if (ch === \"/\" && next === \"/\") {\n i += 2;\n while (i < n && text[i] !== \"\\n\") i += 1;\n continue;\n }\n if (ch === \"/\" && next === \"*\") {\n i += 2;\n while (i < n && !(text[i] === \"*\" && text[i + 1] === \"/\")) i += 1;\n i += 2;\n continue;\n }\n return ch;\n }\n return \"\";\n}\n\n/**\n * Parse JSONC text tolerantly: strip comments + trailing commas, then JSON.parse.\n * Throws (like JSON.parse) on genuinely malformed input — callers that want a\n * fail-soft null should wrap in try/catch (BaseAdapter.readJson does).\n */\nexport function parseJsonc<T = unknown>(text: string): T {\n return JSON.parse(stripJsonc(text)) as T;\n}\n","/**\n * adapters/base — shared adapter foundation.\n *\n * Provides JSON config IO, settings backup, and a default doctor. Per-platform\n * specifics (paths, capabilities, native render format, runtime parse/format)\n * are abstract and implemented by each adapter. TOML/YAML adapters override the\n * JSON helpers entirely.\n */\n\nimport {\n copyFileSync,\n existsSync,\n readdirSync,\n readFileSync,\n rmSync,\n statSync,\n writeFileSync,\n} from \"node:fs\";\nimport type { Dirent } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { basename, dirname, isAbsolute, join, relative, resolve, sep } from \"node:path\";\n\nimport type {\n ChangeRecord,\n DetectedPlatform,\n DiagnosticResult,\n HealthCheck,\n HookParadigm,\n PlatformCapabilities,\n PlatformId,\n PlatformMemoryOverride,\n} from \"../core/types.js\";\nimport { backupsDir, ensureDir } from \"../core/paths.js\";\nimport { parseJsonc } from \"../core/jsonc.js\";\nimport { buildHomeBinActionCommand } from \"../core/spawn.js\";\nimport {\n MEMORY_CONTENT_SOFT_BUDGET_BYTES,\n listManagedBlocks,\n loadMemoryLedger,\n recordMemoryTarget,\n removeManagedBlocksFile,\n saveMemoryLedger,\n upsertManagedBlockFile,\n} from \"../core/managed-block.js\";\nimport { renderFrontmatterMd } from \"./claude-code/render.js\";\nimport type { Adapter, InstallContext, MemoryTarget } from \"./spi.js\";\n\n/** Content-surface kinds with BaseAdapter default install/uninstall handling. */\ntype ContentSurface =\n | \"commands\"\n | \"skills\"\n | \"subagents\"\n | \"memory\"\n | \"statusline\"\n | \"actions\";\n\n/**\n * One resolved action trigger for an EMITTER adapter: the host-native trigger\n * the adapter writes runs `command`, which re-enters the home binary at the\n * `action` verb. `label`/`description` fall back to the action id when the\n * connector declared none. Produced by {@link BaseAdapter.actionTriggers}.\n */\nexport interface ActionTrigger {\n /** The action id — also the per-action file/key name on most hosts. */\n id: string;\n /** Display label (action.description ?? action.id). */\n label: string;\n /** One-line description (action.description ?? action.id). */\n description: string;\n /** `<homeBin> action <host> <id> --connector <connectorId>` (the verb the host runs). */\n command: string;\n}\n\n/**\n * Documented USER-scope AGENTS.md locations, per host (the AGENTS.md-first\n * research matrix). Only hosts with a REAL user/global AGENTS.md file are\n * listed. Hosts whose documented user-scope memory lives in a DIFFERENT file\n * (qwen-code ~/.qwen/QWEN.md, goose .goosehints, kilo/roo/kiro rules dirs,\n * copilot-cli copilot-instructions.md) override memoryTargets in-adapter;\n * hosts whose user rules are app/UI/cloud-managed (warp Drive, trae,\n * jetbrains/cursor settings UI) deliberately have no row — user-scope memory\n * there reports the standard skip-warn (the JetBrains-MCP precedent), never a\n * write into a file the host ignores.\n */\nconst AGENTS_MD_USER_PATHS: Partial<Record<PlatformId, () => MemoryTarget>> = {\n // codex resolves its own user path in-adapter ($CODEX_HOME with ~ expansion\n // + the AGENTS.override.md shadow probe) — deliberately no row here.\n zed: () => ({\n path:\n process.platform === \"win32\" && process.env.APPDATA\n ? join(process.env.APPDATA, \"Zed\", \"AGENTS.md\")\n : join(homedir(), \".config\", \"zed\", \"AGENTS.md\"),\n reason: \"zed personal instructions file\",\n }),\n amp: () => ({\n path: join(homedir(), \".config\", \"amp\", \"AGENTS.md\"),\n reason: \"amp user-scope AGENTS.md\",\n }),\n mux: () => ({\n path: join(homedir(), \".mux\", \"AGENTS.md\"),\n reason: \"mux global AGENTS.md\",\n }),\n pi: () => ({\n path: join(homedir(), \".pi\", \"agent\", \"AGENTS.md\"),\n reason: \"pi global AGENTS.md\",\n }),\n droid: () => ({\n path: join(homedir(), \".factory\", \"AGENTS.md\"),\n reason: \"droid (Factory) personal AGENTS.md\",\n }),\n opencode: () => ({\n path: join(homedir(), \".config\", \"opencode\", \"AGENTS.md\"),\n reason: \"opencode global AGENTS.md\",\n }),\n antigravity: () => ({\n path: join(homedir(), \".gemini\", \"AGENTS.md\"),\n reason: \"antigravity global rules (~/.gemini/AGENTS.md, shared tree)\",\n }),\n \"antigravity-cli\": () => ({\n path: join(homedir(), \".gemini\", \"AGENTS.md\"),\n reason: \"agy shares the IDE's ~/.gemini tree (idempotent upsert dedupes)\",\n }),\n omp: () => ({\n path: join(homedir(), \".omp\", \"agent\", \"AGENTS.md\"),\n reason: \"omp global AGENTS.md (pi-parity; verify for your version)\",\n }),\n};\n\nexport abstract class BaseAdapter implements Adapter {\n abstract readonly id: PlatformId;\n abstract readonly name: string;\n abstract readonly paradigm: HookParadigm;\n abstract readonly capabilities: PlatformCapabilities;\n\n abstract detectInstalled(projectDir: string): DetectedPlatform;\n abstract getConfigDir(ctx: InstallContext): string;\n abstract getServerConfigPath(ctx: InstallContext): string;\n abstract getHookConfigPath(ctx: InstallContext): string;\n abstract installServer(ctx: InstallContext): ChangeRecord[];\n abstract uninstallServer(ctx: InstallContext): ChangeRecord[];\n abstract installHooks(ctx: InstallContext): ChangeRecord[];\n abstract uninstallHooks(ctx: InstallContext): ChangeRecord[];\n\n // ── Content surfaces (commands / skills / subagents) ─────────────────────\n // CONCRETE (overridable) defaults so every adapter inherits all six methods\n // and the installer can call them without optional-chaining. Each returns a\n // single skip when the connector declares no entries of that surface, else a\n // single \"warn\" — mirroring the mcp-only hook handling. Supporting adapters\n // override only the surfaces they honor.\n\n installCommands(ctx: InstallContext): ChangeRecord[] {\n return this.unsupportedSurface(ctx, \"commands\", ctx.connector.commands.length);\n }\n uninstallCommands(ctx: InstallContext): ChangeRecord[] {\n return this.unsupportedSurface(ctx, \"commands\", ctx.connector.commands.length);\n }\n installSkills(ctx: InstallContext): ChangeRecord[] {\n return this.unsupportedSurface(ctx, \"skills\", ctx.connector.skills.length);\n }\n uninstallSkills(ctx: InstallContext): ChangeRecord[] {\n return this.unsupportedSurface(ctx, \"skills\", ctx.connector.skills.length);\n }\n installSubagents(ctx: InstallContext): ChangeRecord[] {\n return this.unsupportedSurface(ctx, \"subagents\", ctx.connector.subagents.length);\n }\n uninstallSubagents(ctx: InstallContext): ChangeRecord[] {\n return this.unsupportedSurface(ctx, \"subagents\", ctx.connector.subagents.length);\n }\n\n // ── Memory surface (managed marker blocks; AGENTS.md-first) ───────────────\n // ONE generic implementation for every supporting host: the per-adapter\n // `memoryTargets()` hook resolves WHERE to write (AGENTS.md defaults below;\n // claude-code → CLAUDE.md and gemini-cli → GEMINI.md override it), and the\n // core/managed-block engine performs the surgical, hash-stamped block edit.\n // Unlike commands/skills/subagents these files are SHARED and user-authored —\n // bytes outside this connector's own marker pair are never touched.\n\n /**\n * Resolve the memory/rules file(s) this host actually reads at ctx.scope.\n * Base default (AGENTS.md-first, owner mandate):\n * - an explicit `platforms[<id>].memory.path` override wins;\n * - project scope → `<projectDir>/AGENTS.md` (the agents.md standard);\n * - user scope → the host's documented user-scope AGENTS.md, when one\n * exists ({@link AGENTS_MD_USER_PATHS}); otherwise [] → skip-warn.\n * Exception hosts (claude-code, gemini-cli) override this hook.\n */\n protected memoryTargets(ctx: InstallContext): MemoryTarget[] {\n const override = this.memoryOverride(ctx);\n if (override?.path) {\n const base = ctx.scope === \"project\" ? ctx.projectDir : homedir();\n return [\n {\n path: isAbsolute(override.path) ? override.path : join(base, override.path),\n reason: `platforms.${this.id}.memory.path override`,\n },\n ];\n }\n if (ctx.scope === \"project\") {\n return [\n { path: join(ctx.projectDir, \"AGENTS.md\"), reason: \"AGENTS.md standard (project root)\" },\n ];\n }\n if (ctx.scope === \"user\") {\n const user = AGENTS_MD_USER_PATHS[this.id]?.();\n return user ? [user] : [];\n }\n return [];\n }\n\n /** The per-platform memory override object, when one is declared. */\n protected memoryOverride(ctx: InstallContext): PlatformMemoryOverride | undefined {\n const o = ctx.connector.platforms[this.id]?.memory;\n return o && typeof o === \"object\" ? o : undefined;\n }\n\n installMemory(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n // `?? []` tolerates pre-resolved connectors from versions before the\n // memory surface existed (the installer applies the same guard).\n const entries = connector.memory ?? [];\n if (connector.platforms[this.id]?.memory === false) {\n return [{ platform: this.id, action: \"skip\", detail: `memory disabled for ${this.id}` }];\n }\n if (entries.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no memory\" }];\n }\n if (!(this.capabilities.supportsMemory ?? false)) {\n return this.unsupportedSurface(ctx, \"memory\", entries.length);\n }\n\n const changes: ChangeRecord[] = [];\n const override = this.memoryOverride(ctx);\n if (override?.mode && this.id !== \"claude-code\") {\n changes.push({\n platform: this.id,\n action: \"warn\",\n detail: `memory.mode is claude-code-only; ignored on ${this.id}`,\n });\n }\n if (ctx.scope !== \"project\" && ctx.scope !== \"user\") {\n // system/profile/managed memory files are admin-owned — out of scope (v1).\n changes.push({\n platform: this.id,\n action: \"warn\",\n detail:\n `memory not supported at ${ctx.scope} scope on ${this.id} ` +\n `(managed/admin memory files are out of scope); ${entries.length} skipped`,\n });\n return changes;\n }\n const targets = this.memoryTargets(ctx);\n if (targets.length === 0) {\n changes.push({\n platform: this.id,\n action: \"warn\",\n detail:\n `no ${ctx.scope}-scope memory file on ${this.id} ` +\n `(user rules are app/UI-managed or undocumented); ${entries.length} skipped`,\n });\n return changes;\n }\n changes.push(...this.writeMemoryBlocks(ctx, targets));\n return changes;\n }\n\n /**\n * Upsert every declared memory entry's block into every resolved target and\n * record the ownership ledger rows (`connectorDir(id)/memory-state.json`).\n * Shared by the base implementation and the exception-host overrides.\n */\n protected writeMemoryBlocks(ctx: InstallContext, targets: MemoryTarget[]): ChangeRecord[] {\n const changes: ChangeRecord[] = [];\n const ledger = loadMemoryLedger(ctx.connector.id);\n let ledgerMutated = false;\n\n for (const target of targets) {\n for (const entry of ctx.connector.memory ?? []) {\n const blockId = `${ctx.connector.id}/${entry.name ?? \"memory\"}`;\n const res = upsertManagedBlockFile(target.path, {\n blockId,\n connectorId: ctx.connector.id,\n content: entry.content,\n ...(target.commentStyle ? { commentStyle: target.commentStyle } : {}),\n force: ctx.force ?? false,\n dryRun: ctx.dryRun,\n });\n changes.push({\n platform: this.id,\n action: res.action,\n path: target.path,\n detail: `memory: ${res.detail} — ${target.reason}`,\n });\n if (res.backupPath) {\n changes.push({\n platform: this.id,\n action: \"create\",\n path: res.backupPath,\n detail: \"backed up memory file before destructive change\",\n });\n }\n const bytes = Buffer.byteLength(entry.content, \"utf8\");\n if (bytes > MEMORY_CONTENT_SOFT_BUDGET_BYTES) {\n changes.push({\n platform: this.id,\n action: \"warn\",\n path: target.path,\n detail:\n `memory entry \"${entry.name ?? \"memory\"}\" is ${bytes} bytes ` +\n `(soft budget ${MEMORY_CONTENT_SOFT_BUDGET_BYTES}); this file is injected into ` +\n `every prompt — keep guidance terse`,\n });\n }\n if (res.action !== \"warn\") {\n recordMemoryTarget(ledger, {\n platform: this.id,\n scope: ctx.scope,\n path: target.path,\n blockId,\n createdFile: res.createdFile,\n hash: res.hash,\n });\n ledgerMutated = true;\n }\n }\n // Per-FILE budget (e.g. codex caps combined project docs at 32 KiB —\n // budgetBytes ≈ 28 KiB leaves headroom): warn when the whole target file\n // (user content + every block) outgrows what the host will actually load.\n if (target.budgetBytes !== undefined && !ctx.dryRun && existsSync(target.path)) {\n const fileBytes = statSync(target.path).size;\n if (fileBytes > target.budgetBytes) {\n changes.push({\n platform: this.id,\n action: \"warn\",\n path: target.path,\n detail:\n `memory file is ${fileBytes} bytes — over this host's ~${target.budgetBytes}-byte ` +\n `budget; the host may truncate or drop it`,\n });\n }\n }\n }\n\n if (ledgerMutated && !ctx.dryRun) saveMemoryLedger(ctx.connector.id, ledger);\n return changes;\n }\n\n uninstallMemory(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (!(this.capabilities.supportsMemory ?? false)) {\n // Nothing could ever have been written by a non-supporting adapter.\n return this.unsupportedSurface(ctx, \"memory\", (connector.memory ?? []).length);\n }\n\n // Candidate files = union of (a) memoryTargets recomputed NOW (probe re-run\n // — catches teammate machines with no ledger; the markers in the committed\n // file are the source of truth) and (b) ledger rows for this platform from\n // EVERY scope (catches a scope flag that differs from install time).\n const ledger = loadMemoryLedger(connector.id);\n const mine = ledger.targets.filter((t) => t.platform === this.id);\n const candidates = new Map<string, { createdFile: boolean }>();\n if (ctx.scope === \"project\" || ctx.scope === \"user\") {\n for (const t of this.memoryTargets(ctx)) {\n candidates.set(t.path, { createdFile: false });\n }\n }\n for (const row of mine) {\n const existing = candidates.get(row.path);\n candidates.set(row.path, { createdFile: (existing?.createdFile ?? false) || row.createdFile });\n }\n if (candidates.size === 0) {\n return [\n { platform: this.id, action: \"skip\", detail: `no memory targets to clean on ${this.id}` },\n ];\n }\n\n // Prefix scan (`<connectorId>/`), NOT the declared entry list: renamed or\n // removed entries and stale blocks from older versions are reclaimed too.\n const changes: ChangeRecord[] = [];\n for (const [path, { createdFile }] of candidates) {\n const results = removeManagedBlocksFile(\n path,\n { blockIdPrefix: `${connector.id}/` },\n { dryRun: ctx.dryRun, deleteFileIfCreated: createdFile },\n );\n for (const r of results) {\n changes.push({\n platform: this.id,\n action: r.action,\n path: r.path,\n detail: `memory: ${r.detail}`,\n });\n if (r.backupPath) {\n changes.push({\n platform: this.id,\n action: \"create\",\n path: r.backupPath,\n detail: \"backed up memory file before block removal\",\n });\n }\n }\n }\n\n // Prune this connector's ledger rows for this platform (the file itself is\n // deleted when no rows remain). Markers stay the uninstall source of truth.\n if (!ctx.dryRun && mine.length > 0) {\n ledger.targets = ledger.targets.filter((t) => t.platform !== this.id);\n saveMemoryLedger(connector.id, ledger);\n }\n return changes;\n }\n\n /**\n * Doctor: per-ledger-row memory state for this platform — file present,\n * block present, and recorded-vs-actual inner hash (drift → warn, the\n * user edited inside our block; sync reports the same drift and never\n * clobbers it without --force).\n */\n protected memoryDiagnostics(ctx: InstallContext): DiagnosticResult[] {\n const results: DiagnosticResult[] = [];\n const rows = loadMemoryLedger(ctx.connector.id).targets.filter(\n (t) => t.platform === this.id,\n );\n for (const row of rows) {\n const check = `${this.name}: memory block ${row.blockId}`;\n if (!existsSync(row.path)) {\n results.push({\n check,\n status: \"warn\",\n message: `memory file missing: ${row.path}`,\n fix: \"agent-connector install (sync) will re-create the block\",\n fixable: true,\n });\n continue;\n }\n let raw: string;\n try {\n raw = readFileSync(row.path, \"utf8\");\n } catch {\n results.push({ check, status: \"warn\", message: `cannot read ${row.path}` });\n continue;\n }\n const block = listManagedBlocks(raw).find((b) => b.blockId === row.blockId);\n if (!block) {\n results.push({\n check,\n status: \"warn\",\n message: `managed block not found in ${row.path}`,\n fix: \"agent-connector install (sync) will re-append it\",\n fixable: true,\n });\n } else if (block.drifted) {\n results.push({\n check,\n status: \"warn\",\n message:\n `user-edited: inner content hash ${block.actualHash} differs from recorded ` +\n `${block.recordedHash} in ${row.path}; sync leaves it intact (use --force to overwrite)`,\n });\n } else {\n results.push({ check, status: \"pass\", message: `intact in ${row.path}` });\n }\n // Shadow-flip probe: re-run memoryTargets NOW for the row's scope — if\n // the host's resolution moved (a WARP.md / AGENTS.override.md / .rules /\n // .hermes.md appeared, gemini context.fileName changed), the written\n // block sits in a file the host no longer reads. The #1 wrong-file\n // risk; doctor is the detection layer.\n // (`_shared/` bridge rows deliberately live OUTSIDE memoryTargets —\n // e.g. claude-code's @AGENTS.md import in CLAUDE.md — skip those.)\n if (\n !row.blockId.startsWith(\"_shared/\") &&\n row.scope === ctx.scope &&\n (ctx.scope === \"project\" || ctx.scope === \"user\")\n ) {\n const current = this.memoryTargets(ctx);\n if (current.length > 0 && !current.some((t) => t.path === row.path)) {\n results.push({\n check,\n status: \"warn\",\n message:\n `${this.id} now resolves its ${row.scope}-scope memory file to ` +\n `${current[0]!.path} (${current[0]!.reason}) — the block in ${row.path} ` +\n `may no longer be read`,\n fix: \"agent-connector install (sync) re-probes and writes the file the host reads now\",\n fixable: true,\n });\n }\n }\n }\n return results;\n }\n\n // ── Declarative host-config key patches (configPatch) ─────────────────────\n // CONCRETE (overridable) defaults, mirroring the content surfaces above: the\n // installer additionally guards these behind capabilities.supportsConfigPatch\n // (the nativeHooks precedent), so these defaults only fire if a capability-\n // flagged adapter forgot to override them — still skip-warn, never silent.\n\n installConfigPatches(ctx: InstallContext): ChangeRecord[] {\n const count = (ctx.connector.platforms[this.id]?.configPatch ?? []).length;\n if (count === 0) {\n return [\n { platform: this.id, action: \"skip\", detail: \"connector declares no configPatch entries\" },\n ];\n }\n return [\n {\n platform: this.id,\n action: \"warn\",\n detail: `configPatch not supported on ${this.id}; ${count} skipped`,\n },\n ];\n }\n\n uninstallConfigPatches(_ctx: InstallContext): ChangeRecord[] {\n // Nothing was ever applied by a non-supporting adapter → nothing to release.\n return [];\n }\n\n // ── Statusline surface (a HUD/status line) ────────────────────────────────\n // CONCRETE (overridable) defaults, mirroring the content surfaces: the\n // installer calls these unconditionally (BaseAdapter defines them), and they\n // self-skip when the connector declares no statusline, else skip-warn on a\n // non-supporting host. Only claude-code overrides them today.\n\n installStatusline(ctx: InstallContext): ChangeRecord[] {\n if (ctx.connector.statusline == null) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no statusline\" }];\n }\n if (ctx.connector.platforms[this.id]?.statusline === false) {\n return [{ platform: this.id, action: \"skip\", detail: `statusline disabled for ${this.id}` }];\n }\n if (!(this.capabilities.supportsStatusline ?? false)) {\n return this.unsupportedSurface(ctx, \"statusline\", 1);\n }\n // A supporting adapter must override this; the default is the same skip-warn\n // safety net the configPatch defaults provide (never silent).\n return this.unsupportedSurface(ctx, \"statusline\", 1);\n }\n\n uninstallStatusline(ctx: InstallContext): ChangeRecord[] {\n if (ctx.connector.statusline == null) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no statusline\" }];\n }\n if (!(this.capabilities.supportsStatusline ?? false)) {\n // Nothing could ever have been written by a non-supporting adapter.\n return this.unsupportedSurface(ctx, \"statusline\", 1);\n }\n return this.unsupportedSurface(ctx, \"statusline\", 1);\n }\n\n // ── Action surface (a user-invokable action) ──────────────────────────────\n // CONCRETE (overridable) defaults, mirroring the statusline pair. v1 ships\n // ONLY the dispatch backbone: there is no verifiable host affordance to emit,\n // so EVERY host honestly skip-warns and NO adapter overrides these. (`?? []`\n // tolerates pre-resolved connectors from versions before the action surface\n // existed, exactly like installMemory.)\n\n installActions(ctx: InstallContext): ChangeRecord[] {\n return this.unsupportedSurface(ctx, \"actions\", (ctx.connector.actions ?? []).length);\n }\n uninstallActions(ctx: InstallContext): ChangeRecord[] {\n return this.unsupportedSurface(ctx, \"actions\", (ctx.connector.actions ?? []).length);\n }\n\n /**\n * Shared, surface-agnostic helper for the action EMITTERS: yield one\n * {@link ActionTrigger} per declared action, each carrying the home-bin verb\n * command the host trigger must run\n * (`<homeBin> action <host> <actionId> --connector <id>`, via\n * {@link buildHomeBinActionCommand}) plus a `label`/`description` that fall\n * back to the action id. Each supporting adapter iterates this and writes its\n * host-native trigger (hermes quick_commands / warp workflow / droid exec\n * file) — the per-host file shape is NOT this helper's concern, only the\n * common (id, label, description, command) tuple. Callers own the standard\n * guards (platforms[id].actions === false / empty actions).\n */\n protected actionTriggers(ctx: InstallContext): ActionTrigger[] {\n return (ctx.connector.actions ?? []).map((action) => ({\n id: action.id,\n label: action.description ?? action.id,\n description: action.description ?? action.id,\n command: buildHomeBinActionCommand(\n ctx.homeBinPath,\n this.id,\n action.id,\n ctx.connector.id,\n ),\n }));\n }\n\n /**\n * Default response for a content surface this platform cannot honor: a single\n * skip when the connector declares none of that surface, else a single \"warn\"\n * ChangeRecord noting how many were skipped. Mirrors mcp-only hook handling.\n */\n protected unsupportedSurface(\n _ctx: InstallContext,\n surface: ContentSurface,\n count: number,\n ): ChangeRecord[] {\n if (count === 0) {\n return [{ platform: this.id, action: \"skip\", detail: `connector declares no ${surface}` }];\n }\n return [\n {\n platform: this.id,\n action: \"warn\",\n detail: `${surface} not supported on ${this.id}; ${count} skipped`,\n },\n ];\n }\n\n // ── Content-file helpers (used by surface-supporting adapters) ────────────\n\n /**\n * Write a content file idempotently: \"skip\" when the existing bytes are\n * already identical, else \"create\"/\"update\". Creates parent dirs (mkdir -p).\n * Honors dryRun (computes the action but writes nothing).\n */\n protected writeContentFile(path: string, contents: string, dryRun: boolean): ChangeRecord {\n let action: ChangeRecord[\"action\"];\n if (!existsSync(path)) {\n action = \"create\";\n } else {\n let current: string | null = null;\n try {\n current = readFileSync(path, \"utf8\");\n } catch {\n current = null;\n }\n action = current === contents ? \"skip\" : \"update\";\n }\n if (action !== \"skip\" && !dryRun) {\n ensureDir(dirname(path));\n writeFileSync(path, contents, \"utf8\");\n }\n return { platform: this.id, action, path, detail: basename(path) };\n }\n\n /**\n * Remove a content file we wrote; \"skip\" when already absent. Honors dryRun.\n * Uses rmSync with `force` to also tolerate a path that is a directory tree\n * (e.g. a skill folder removed by the supporting adapter).\n */\n protected removeContentFile(path: string, dryRun: boolean): ChangeRecord {\n if (!existsSync(path)) {\n return { platform: this.id, action: \"skip\", path, detail: `${basename(path)} absent` };\n }\n if (!dryRun) {\n rmSync(path, { recursive: true, force: true });\n }\n return { platform: this.id, action: \"remove\", path, detail: basename(path) };\n }\n\n /**\n * Defense-in-depth path containment: resolve `rel` against `baseDir` and\n * return the absolute path ONLY when it stays inside `baseDir`. Returns null\n * when `rel` escapes (absolute path, `..` traversal, etc.) so a caller can\n * skip-and-warn rather than write/delete outside the surface dir. This is the\n * runtime backstop behind the config-time validation in normalizeSkills.\n */\n protected resolveWithin(baseDir: string, rel: string): string | null {\n const base = resolve(baseDir);\n const target = resolve(base, rel);\n if (target === base) return null; // rel resolved to the dir itself (e.g. \"\" / \".\")\n const rind = relative(base, target);\n // Outside when the relative path climbs out (`..`) or is itself absolute.\n if (rind === \"\" || rind.startsWith(\"..\") || resolve(base, rind) !== target) {\n return null;\n }\n if (rind === \"..\" || rind.startsWith(`..${sep}`)) return null;\n return target;\n }\n\n /**\n * Recursively report whether a directory tree contains any regular FILE (vs\n * only empty/nested-empty subdirectories). Symlinks count as files (we never\n * recurse through them). Used by removeDirIfEmpty to decide if a tree is safe\n * to drop. An unreadable entry is treated as \"a file is present\" (conservative).\n */\n private dirTreeHasFile(dir: string): boolean {\n let entries: Dirent[];\n try {\n entries = readdirSync(dir, { withFileTypes: true });\n } catch {\n return true; // unreadable → assume it holds data; do not remove\n }\n for (const e of entries) {\n if (e.isDirectory()) {\n if (this.dirTreeHasFile(join(dir, e.name))) return true;\n } else {\n return true; // a file / symlink / special → the tree is not \"empty\"\n }\n }\n return false;\n }\n\n /**\n * Remove a directory ONLY when its tree holds NO regular files — i.e. it is\n * empty or contains only (nested) empty directories, such as the intermediate\n * dirs our own nested skill resources created. Replaces the unconditional\n * `rm -rf <dir>` that uninstallSkills used to call, which destroyed user-added\n * files / sibling-tool files / shared skill dirs the connector never wrote.\n * When ANY file remains (at any depth) the whole tree is left in place and the\n * skip is noted. Honors dryRun (computes the action but removes nothing). A\n * missing dir is a no-op \"skip\".\n */\n protected removeDirIfEmpty(dir: string, dryRun: boolean): ChangeRecord {\n if (!existsSync(dir)) {\n return { platform: this.id, action: \"skip\", path: dir, detail: `${basename(dir)} absent` };\n }\n let stat: ReturnType<typeof statSync>;\n try {\n stat = statSync(dir);\n } catch {\n return {\n platform: this.id,\n action: \"skip\",\n path: dir,\n detail: `${basename(dir)} unreadable; left in place`,\n };\n }\n if (!stat.isDirectory()) {\n return {\n platform: this.id,\n action: \"skip\",\n path: dir,\n detail: `${basename(dir)} not a directory; left in place`,\n };\n }\n if (this.dirTreeHasFile(dir)) {\n return {\n platform: this.id,\n action: \"skip\",\n path: dir,\n detail: `${basename(dir)} still holds files we did not write; left in place`,\n };\n }\n if (!dryRun) {\n try {\n // The tree is files-free: only (possibly nested) empty dirs remain, which\n // are ours / inert. A recursive remove drops them without touching data.\n rmSync(dir, { recursive: true, force: true });\n } catch {\n // Lost a race or perms — non-fatal; report as a skip.\n return {\n platform: this.id,\n action: \"skip\",\n path: dir,\n detail: `${basename(dir)} could not be removed; left in place`,\n };\n }\n }\n return { platform: this.id, action: \"remove\", path: dir, detail: basename(dir) };\n }\n\n /**\n * Render a YAML-frontmatter + markdown body document:\n * \"---\\n\" + <yaml> + \"---\\n\\n\" + <body> + \"\\n\".\n * Delegates to the shared renderer (adapters/claude-code/render) so every\n * content-file path — adapters AND the plugin packager — emits identical bytes.\n */\n protected renderFrontmatterMd(\n frontmatter: Record<string, unknown>,\n body: string,\n ): string {\n return renderFrontmatterMd(frontmatter, body);\n }\n\n // ── JSON config helpers (used by JSON-format adapters) ───────────────────\n\n /**\n * Read + parse a JSON/JSONC config file, returning null when it is absent OR\n * unparseable. Parses TOLERANTLY via parseJsonc (strips // and /* *\\/ comments\n * and trailing commas) so a perfectly valid JSONC file never false-fails to\n * null — that null is what `?? {}` would otherwise turn into a clobbering\n * overwrite of the user's whole config.\n */\n protected readJson<T = Record<string, unknown>>(path: string): T | null {\n if (!existsSync(path)) return null;\n try {\n return parseJsonc<T>(readFileSync(path, \"utf8\"));\n } catch {\n return null;\n }\n }\n\n /**\n * True when `path` exists and holds non-whitespace content but readJson cannot\n * parse it (even after JSONC stripping). The overwrite guard: writing a\n * `{}`-based config over a present-but-broken settings file would silently\n * destroy the user's data, so callers warn-and-skip instead.\n */\n protected isPresentButUnparseable(path: string): boolean {\n if (!existsSync(path)) return false;\n let raw: string;\n try {\n if (statSync(path).size === 0) return false;\n raw = readFileSync(path, \"utf8\");\n } catch {\n return false;\n }\n if (raw.trim() === \"\") return false;\n return this.readJson(path) === null;\n }\n\n protected writeJson(path: string, data: unknown, dryRun = false): void {\n if (dryRun) return;\n ensureDir(dirname(path));\n writeFileSync(path, `${JSON.stringify(data, null, 2)}\\n`, \"utf8\");\n }\n\n /**\n * Upsert `entry` at `config[rootKey][serverId]` in a JSON file, creating the\n * file/object as needed. Returns a ChangeRecord describing create/update/skip.\n * Idempotent: an identical entry yields \"skip\".\n */\n protected upsertServerInJson(\n configPath: string,\n rootKey: string,\n serverId: string,\n entry: unknown,\n dryRun = false,\n ): ChangeRecord {\n // OVERWRITE GUARD: never replace a present, non-empty, unparseable settings\n // file with a `{}`-based config — that would silently destroy the user's\n // data. Warn and skip so they can back it up / fix it and re-run.\n if (this.isPresentButUnparseable(configPath)) {\n return {\n platform: this.id,\n action: \"warn\",\n path: configPath,\n detail: `existing ${configPath} is not parseable; left untouched (back it up / fix it, then re-run)`,\n };\n }\n const cfg = this.readJson<Record<string, Record<string, unknown>>>(configPath) ?? {};\n const bucket = (cfg[rootKey] ??= {});\n const before = JSON.stringify(bucket[serverId]);\n const after = JSON.stringify(entry);\n let action: ChangeRecord[\"action\"];\n if (before === undefined) action = \"create\";\n else if (before === after) action = \"skip\";\n else action = \"update\";\n if (action !== \"skip\") {\n bucket[serverId] = entry;\n this.writeJson(configPath, cfg, dryRun);\n }\n return { platform: this.id, action, path: configPath, detail: `${rootKey}.${serverId}` };\n }\n\n /** Remove `config[rootKey][serverId]` from a JSON file. */\n protected removeServerFromJson(\n configPath: string,\n rootKey: string,\n serverId: string,\n dryRun = false,\n ): ChangeRecord {\n // OVERWRITE GUARD (see upsertServerInJson): a present-but-unparseable file\n // would round-trip to `{}` and erase the user's config, so warn and skip.\n if (this.isPresentButUnparseable(configPath)) {\n return {\n platform: this.id,\n action: \"warn\",\n path: configPath,\n detail: `existing ${configPath} is not parseable; left untouched (back it up / fix it, then re-run)`,\n };\n }\n const cfg = this.readJson<Record<string, Record<string, unknown>>>(configPath);\n const bucket = cfg?.[rootKey];\n if (!cfg || !bucket || !(serverId in bucket)) {\n return { platform: this.id, action: \"skip\", path: configPath, detail: `${rootKey}.${serverId} absent` };\n }\n delete bucket[serverId];\n this.writeJson(configPath, cfg, dryRun);\n return { platform: this.id, action: \"remove\", path: configPath, detail: `${rootKey}.${serverId}` };\n }\n\n // ── Backup ───────────────────────────────────────────────────────────────\n\n backupSettings(ctx: InstallContext): string | null {\n const files = [...new Set([this.getServerConfigPath(ctx), this.getHookConfigPath(ctx)])].filter(\n (f) => existsSync(f),\n );\n if (files.length === 0) return null;\n if (ctx.dryRun) return null;\n ensureDir(backupsDir());\n const stamp = new Date().toISOString().replace(/[:.]/g, \"-\");\n let last: string | null = null;\n for (const f of files) {\n const dest = join(backupsDir(), `${this.id}-${stamp}-${basename(f)}`);\n copyFileSync(f, dest);\n last = dest;\n }\n return last;\n }\n\n // ── Diagnostics ─────────────────────────────────────────────────────────\n\n getHealthChecks?(ctx: InstallContext): readonly HealthCheck[];\n\n doctor(ctx: InstallContext): DiagnosticResult[] {\n const results: DiagnosticResult[] = [];\n const cfg = this.getServerConfigPath(ctx);\n results.push(\n existsSync(cfg)\n ? { check: `${this.name}: config present`, status: \"pass\", message: cfg }\n : {\n check: `${this.name}: config present`,\n status: \"warn\",\n message: `not found: ${cfg}`,\n fix: `agent-connector install --targets ${this.id}`,\n // Only sync-recoverable when the connector actually declares a\n // server — a re-sync writes the config file only then. For a\n // serverless (memory/configPatch-only) connector the file is never\n // created, so marking it fixable would loop it into \"still failing\".\n fixable: !!ctx.connector.server,\n },\n );\n for (const hc of this.getHealthChecks?.(ctx) ?? []) {\n const r = hc.check();\n results.push({\n check: hc.name,\n status: r.status === \"OK\" ? \"pass\" : \"fail\",\n message: r.detail ?? r.status,\n });\n }\n // Memory-surface checks are ledger-driven: no installed memory → no rows →\n // no noise. Shared by every adapter (the overrides call super.doctor()).\n results.push(...this.memoryDiagnostics(ctx));\n return results;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4BO,SAAS,WAAW,MAAsB;AAC/C,QAAM,IAAI,KAAK;AACf,MAAI,MAAM;AACV,MAAI,IAAI;AACR,MAAI,WAAW;AACf,MAAI,QAAQ;AAEZ,SAAO,IAAI,GAAG;AACZ,UAAM,KAAK,KAAK,CAAC;AAEjB,QAAI,UAAU;AACZ,aAAO;AACP,UAA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