@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,443 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
resolveEnvRefsDeep
|
|
4
|
+
} from "./chunk-DBQMX75U.js";
|
|
5
|
+
import {
|
|
6
|
+
BaseAdapter
|
|
7
|
+
} from "./chunk-CPLK7GTE.js";
|
|
8
|
+
import {
|
|
9
|
+
renderCommandMd,
|
|
10
|
+
renderSkillMd
|
|
11
|
+
} from "./chunk-7L6ITC4T.js";
|
|
12
|
+
import {
|
|
13
|
+
buildServeWrapperCommand,
|
|
14
|
+
shouldWrapForTelemetry
|
|
15
|
+
} from "./chunk-I5MLE6S7.js";
|
|
16
|
+
import "./chunk-N6HH7K6P.js";
|
|
17
|
+
import "./chunk-TRQKHP7D.js";
|
|
18
|
+
|
|
19
|
+
// src/adapters/windsurf/index.ts
|
|
20
|
+
import { existsSync, statSync } from "fs";
|
|
21
|
+
import { homedir } from "os";
|
|
22
|
+
import { basename, join } from "path";
|
|
23
|
+
var HOST = "windsurf";
|
|
24
|
+
var MCP_ROOT_KEY = "mcpServers";
|
|
25
|
+
var WORKFLOW_MAX_CHARS = 12e3;
|
|
26
|
+
var WindsurfAdapter = class extends BaseAdapter {
|
|
27
|
+
id = HOST;
|
|
28
|
+
name = "Windsurf";
|
|
29
|
+
paradigm = "mcp-only";
|
|
30
|
+
capabilities = {
|
|
31
|
+
// Memory surface: WIRED. Windsurf reads `.windsurf/rules/*.md` (NOT
|
|
32
|
+
// AGENTS.md), so the AGENTS.md-first BaseAdapter default does not apply — the
|
|
33
|
+
// installMemory/uninstallMemory overrides below write a DEDICATED
|
|
34
|
+
// agent-connector-owned file (<projectDir>/.windsurf/rules/agent-connector.md)
|
|
35
|
+
// that LEADS with `trigger: always_on` frontmatter (full content in the
|
|
36
|
+
// system prompt on every message). Workspace/project scope only; user scope
|
|
37
|
+
// skip-warns (global_rules.md is a shared global file, not an AC-owned dir).
|
|
38
|
+
supportsMemory: true,
|
|
39
|
+
//
|
|
40
|
+
// mcp-only: Windsurf is a GUI editor with no user-installable hook/plugin
|
|
41
|
+
// layer. Every hook flag is false.
|
|
42
|
+
preToolUse: false,
|
|
43
|
+
postToolUse: false,
|
|
44
|
+
preCompact: false,
|
|
45
|
+
sessionStart: false,
|
|
46
|
+
sessionEnd: false,
|
|
47
|
+
userPromptSubmit: false,
|
|
48
|
+
stop: false,
|
|
49
|
+
notification: false,
|
|
50
|
+
// No hook layer → no arg/output rewrite, no context injection.
|
|
51
|
+
canModifyArgs: false,
|
|
52
|
+
canModifyOutput: false,
|
|
53
|
+
canInjectSessionContext: false,
|
|
54
|
+
// Windsurf registers stdio + remote (http/sse) MCP servers; the remote
|
|
55
|
+
// entry is distinguished by `serverUrl` (vs stdio's `command`).
|
|
56
|
+
transports: ["stdio", "http", "sse"],
|
|
57
|
+
// Content surfaces: WIRED in BOTH scopes. Windsurf reads user-authored
|
|
58
|
+
// WORKFLOWS (each becomes a `/<name>` slash command) and Agent SKILLS (the
|
|
59
|
+
// same SKILL.md frontmatter convention cline/claude-code/qwen-code use):
|
|
60
|
+
// workflows → project .windsurf/workflows/<name>.md,
|
|
61
|
+
// user ~/.codeium/windsurf/global_workflows/<name>.md
|
|
62
|
+
// skills → project .windsurf/skills/<name>/SKILL.md,
|
|
63
|
+
// user ~/.codeium/windsurf/skills/<name>/SKILL.md
|
|
64
|
+
// The install overrides below branch the path on ctx.scope and write at both.
|
|
65
|
+
// Subagents stay UNSET (no documented user-authored dir): base skip-warns.
|
|
66
|
+
supportsCommands: true,
|
|
67
|
+
supportsSkills: true
|
|
68
|
+
};
|
|
69
|
+
// ── Detection ────────────────────────────────────────────────────────────
|
|
70
|
+
detectInstalled(_projectDir) {
|
|
71
|
+
const userDir = join(homedir(), ".codeium", "windsurf");
|
|
72
|
+
const userMcp = join(userDir, "mcp_config.json");
|
|
73
|
+
const installed = existsSync(userDir) || existsSync(userMcp);
|
|
74
|
+
return {
|
|
75
|
+
id: this.id,
|
|
76
|
+
name: this.name,
|
|
77
|
+
installed,
|
|
78
|
+
paradigm: this.paradigm,
|
|
79
|
+
capabilities: this.capabilities,
|
|
80
|
+
configPath: userMcp,
|
|
81
|
+
scope: "user",
|
|
82
|
+
reason: installed ? `found Windsurf config under ${userDir}` : `no Windsurf config at ${userDir}`,
|
|
83
|
+
confidence: installed ? "high" : "low"
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
// ── Native paths ─────────────────────────────────────────────────────────
|
|
87
|
+
/**
|
|
88
|
+
* Windsurf's MCP config is USER/GLOBAL scope only — the docs specify no
|
|
89
|
+
* project/workspace path. getConfigDir always resolves the user dir
|
|
90
|
+
* (homedir() covers USERPROFILE on Windows); a project-scope install is
|
|
91
|
+
* handled by installServer returning a skip, never a write under projectDir.
|
|
92
|
+
*/
|
|
93
|
+
getConfigDir(_ctx) {
|
|
94
|
+
return join(homedir(), ".codeium", "windsurf");
|
|
95
|
+
}
|
|
96
|
+
getServerConfigPath(ctx) {
|
|
97
|
+
return join(this.getConfigDir(ctx), "mcp_config.json");
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Windsurf has no separate hook file — hook config path aliases the MCP file
|
|
101
|
+
* so the generic doctor/backup helpers behave sensibly (amazon-q idiom).
|
|
102
|
+
*/
|
|
103
|
+
getHookConfigPath(ctx) {
|
|
104
|
+
return this.getServerConfigPath(ctx);
|
|
105
|
+
}
|
|
106
|
+
// ── Memory surface: the `.windsurf/rules` content tree ────────────────────
|
|
107
|
+
// A DEDICATED agent-connector-owned file that MUST LEAD with `trigger:
|
|
108
|
+
// always_on` frontmatter (full content in the system prompt on every message).
|
|
109
|
+
// Because of that leading frontmatter we do NOT use the base managed-block
|
|
110
|
+
// engine — we own the whole file via the content-file writers: install
|
|
111
|
+
// writes/updates it idempotently, uninstall deletes it. WORKSPACE/PROJECT scope
|
|
112
|
+
// only (global_rules.md is a shared global file, not an AC-owned dir).
|
|
113
|
+
/** <projectDir>/.windsurf/rules/agent-connector.md — the dedicated owned file. */
|
|
114
|
+
memoryFilePath(ctx) {
|
|
115
|
+
return join(ctx.projectDir, ".windsurf", "rules", "agent-connector.md");
|
|
116
|
+
}
|
|
117
|
+
/** True when `<projectDir>/.windsurf/rules` exists and is a regular FILE. */
|
|
118
|
+
rulesDirIsFile(ctx) {
|
|
119
|
+
const p = join(ctx.projectDir, ".windsurf", "rules");
|
|
120
|
+
if (!existsSync(p)) return false;
|
|
121
|
+
try {
|
|
122
|
+
return statSync(p).isFile();
|
|
123
|
+
} catch {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Compose the dedicated rule file: `trigger: always_on` frontmatter (the
|
|
129
|
+
* always-on activation directive) + every declared memory entry's content,
|
|
130
|
+
* joined with a blank line. The connector's content is host-agnostic markdown
|
|
131
|
+
* (MemoryDef forbids its own frontmatter), so the directive is ours to add.
|
|
132
|
+
*/
|
|
133
|
+
renderMemoryFile(ctx) {
|
|
134
|
+
const body = (ctx.connector.memory ?? []).map((m) => m.content.trim()).filter((c) => c.length > 0).join("\n\n");
|
|
135
|
+
return this.renderFrontmatterMd({ trigger: "always_on" }, body);
|
|
136
|
+
}
|
|
137
|
+
installMemory(ctx) {
|
|
138
|
+
const { connector } = ctx;
|
|
139
|
+
const entries = connector.memory ?? [];
|
|
140
|
+
if (connector.platforms[this.id]?.memory === false) {
|
|
141
|
+
return [{ platform: this.id, action: "skip", detail: `memory disabled for ${this.id}` }];
|
|
142
|
+
}
|
|
143
|
+
if (entries.length === 0) {
|
|
144
|
+
return [{ platform: this.id, action: "skip", detail: "connector declares no memory" }];
|
|
145
|
+
}
|
|
146
|
+
if (ctx.scope !== "project") {
|
|
147
|
+
return [
|
|
148
|
+
{
|
|
149
|
+
platform: this.id,
|
|
150
|
+
action: "warn",
|
|
151
|
+
detail: `no ${ctx.scope}-scope rules dir verified for windsurf (.windsurf/rules is workspace-scope; global_rules.md is a shared file); ${entries.length} skipped`
|
|
152
|
+
}
|
|
153
|
+
];
|
|
154
|
+
}
|
|
155
|
+
if (this.rulesDirIsFile(ctx)) {
|
|
156
|
+
return [
|
|
157
|
+
{
|
|
158
|
+
platform: this.id,
|
|
159
|
+
action: "warn",
|
|
160
|
+
path: join(ctx.projectDir, ".windsurf", "rules"),
|
|
161
|
+
detail: "existing .windsurf/rules is a file, not a directory; left untouched \u2014 convert it to a .windsurf/rules/ directory to receive agent-connector memory"
|
|
162
|
+
}
|
|
163
|
+
];
|
|
164
|
+
}
|
|
165
|
+
return [this.writeContentFile(this.memoryFilePath(ctx), this.renderMemoryFile(ctx), ctx.dryRun)];
|
|
166
|
+
}
|
|
167
|
+
uninstallMemory(ctx) {
|
|
168
|
+
if (ctx.scope !== "project" || this.rulesDirIsFile(ctx)) {
|
|
169
|
+
const path = this.memoryFilePath(ctx);
|
|
170
|
+
return [
|
|
171
|
+
{ platform: this.id, action: "skip", path, detail: `${basename(path)} absent` }
|
|
172
|
+
];
|
|
173
|
+
}
|
|
174
|
+
return [this.removeContentFile(this.memoryFilePath(ctx), ctx.dryRun)];
|
|
175
|
+
}
|
|
176
|
+
// ── Content surfaces: commands (workflows) + skills ───────────────────────
|
|
177
|
+
// CONTENT-ONLY native-file writers, structured like installMemory: dedicated-
|
|
178
|
+
// file ownership, dryRun honored via writeContentFile/removeContentFile. Both
|
|
179
|
+
// reuse the shared claude-code renderers (renderCommandMd / renderSkillMd) — no
|
|
180
|
+
// new markdown serializer. BOTH scopes write (the project dir AND the
|
|
181
|
+
// ~/.codeium/windsurf user/global dirs are documented surfaces):
|
|
182
|
+
//
|
|
183
|
+
// commands (workflows)
|
|
184
|
+
// - project → <projectDir>/.windsurf/workflows/<name>.md
|
|
185
|
+
// - user → ~/.codeium/windsurf/global_workflows/<name>.md
|
|
186
|
+
// (NOTE: the user dir is `global_workflows`, NOT `workflows`.)
|
|
187
|
+
// skills
|
|
188
|
+
// - project → <projectDir>/.windsurf/skills/<name>/SKILL.md
|
|
189
|
+
// - user → ~/.codeium/windsurf/skills/<name>/SKILL.md
|
|
190
|
+
// (the dir is `skills` in BOTH scopes; same SKILL.md convention
|
|
191
|
+
// cline/claude-code/qwen-code use.)
|
|
192
|
+
//
|
|
193
|
+
// renderCommandMd emits Claude-flavored frontmatter keys (argument-hint, model,
|
|
194
|
+
// allowed-tools); Windsurf ignores unknown frontmatter keys, so they are inert/
|
|
195
|
+
// tolerated — no Windsurf-specific renderer is needed.
|
|
196
|
+
/** Workflow file: project `.windsurf/workflows`, user `~/.codeium/windsurf/global_workflows`. */
|
|
197
|
+
commandPath(ctx, name) {
|
|
198
|
+
const dir = ctx.scope === "project" ? join(ctx.projectDir, ".windsurf", "workflows") : join(homedir(), ".codeium", "windsurf", "global_workflows");
|
|
199
|
+
return join(dir, `${name}.md`);
|
|
200
|
+
}
|
|
201
|
+
/** Skill dir: project `.windsurf/skills/<name>`, user `~/.codeium/windsurf/skills/<name>`. */
|
|
202
|
+
skillDir(ctx, name) {
|
|
203
|
+
const base = ctx.scope === "project" ? join(ctx.projectDir, ".windsurf", "skills") : join(homedir(), ".codeium", "windsurf", "skills");
|
|
204
|
+
return join(base, name);
|
|
205
|
+
}
|
|
206
|
+
// ── Commands (workflows) ──────────────────────────────────────────────────
|
|
207
|
+
installCommands(ctx) {
|
|
208
|
+
const { connector } = ctx;
|
|
209
|
+
if (connector.platforms[HOST]?.commands === false) {
|
|
210
|
+
return [{ platform: this.id, action: "skip", detail: "commands disabled for windsurf" }];
|
|
211
|
+
}
|
|
212
|
+
if (connector.commands.length === 0) {
|
|
213
|
+
return [{ platform: this.id, action: "skip", detail: "connector declares no commands" }];
|
|
214
|
+
}
|
|
215
|
+
const changes = [];
|
|
216
|
+
for (const cmd of connector.commands) {
|
|
217
|
+
const rendered = renderCommandMd(cmd);
|
|
218
|
+
changes.push(this.writeContentFile(this.commandPath(ctx, cmd.name), rendered, ctx.dryRun));
|
|
219
|
+
if (rendered.length > WORKFLOW_MAX_CHARS) {
|
|
220
|
+
changes.push({
|
|
221
|
+
platform: this.id,
|
|
222
|
+
action: "warn",
|
|
223
|
+
path: this.commandPath(ctx, cmd.name),
|
|
224
|
+
detail: `workflow "${cmd.name}" is ${rendered.length} chars (Windsurf caps each workflow at ${WORKFLOW_MAX_CHARS}); the host may reject or truncate it \u2014 trim the command`
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return changes;
|
|
229
|
+
}
|
|
230
|
+
uninstallCommands(ctx) {
|
|
231
|
+
const { connector } = ctx;
|
|
232
|
+
if (connector.commands.length === 0) {
|
|
233
|
+
return [{ platform: this.id, action: "skip", detail: "connector declares no commands" }];
|
|
234
|
+
}
|
|
235
|
+
return connector.commands.map(
|
|
236
|
+
(cmd) => this.removeContentFile(this.commandPath(ctx, cmd.name), ctx.dryRun)
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
// ── Skills ────────────────────────────────────────────────────────────────
|
|
240
|
+
installSkills(ctx) {
|
|
241
|
+
const { connector } = ctx;
|
|
242
|
+
if (connector.platforms[HOST]?.skills === false) {
|
|
243
|
+
return [{ platform: this.id, action: "skip", detail: "skills disabled for windsurf" }];
|
|
244
|
+
}
|
|
245
|
+
if (connector.skills.length === 0) {
|
|
246
|
+
return [{ platform: this.id, action: "skip", detail: "connector declares no skills" }];
|
|
247
|
+
}
|
|
248
|
+
const changes = [];
|
|
249
|
+
for (const skill of connector.skills) {
|
|
250
|
+
const dir = this.skillDir(ctx, skill.name);
|
|
251
|
+
changes.push(
|
|
252
|
+
this.writeContentFile(join(dir, "SKILL.md"), renderSkillMd(skill), ctx.dryRun)
|
|
253
|
+
);
|
|
254
|
+
for (const [rel, contents] of Object.entries(skill.resources ?? {})) {
|
|
255
|
+
const target = this.resolveWithin(dir, rel);
|
|
256
|
+
if (target === null) {
|
|
257
|
+
changes.push({
|
|
258
|
+
platform: this.id,
|
|
259
|
+
action: "warn",
|
|
260
|
+
detail: `skill resource "${rel}" escapes the skill dir; skipped`
|
|
261
|
+
});
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
changes.push(this.writeContentFile(target, contents, ctx.dryRun));
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return changes;
|
|
268
|
+
}
|
|
269
|
+
uninstallSkills(ctx) {
|
|
270
|
+
const { connector } = ctx;
|
|
271
|
+
if (connector.skills.length === 0) {
|
|
272
|
+
return [{ platform: this.id, action: "skip", detail: "connector declares no skills" }];
|
|
273
|
+
}
|
|
274
|
+
const changes = [];
|
|
275
|
+
for (const skill of connector.skills) {
|
|
276
|
+
const dir = this.skillDir(ctx, skill.name);
|
|
277
|
+
changes.push(this.removeContentFile(join(dir, "SKILL.md"), ctx.dryRun));
|
|
278
|
+
for (const rel of Object.keys(skill.resources ?? {})) {
|
|
279
|
+
const target = this.resolveWithin(dir, rel);
|
|
280
|
+
if (target === null) continue;
|
|
281
|
+
changes.push(this.removeContentFile(target, ctx.dryRun));
|
|
282
|
+
}
|
|
283
|
+
changes.push(this.removeDirIfEmpty(dir, ctx.dryRun));
|
|
284
|
+
}
|
|
285
|
+
return changes;
|
|
286
|
+
}
|
|
287
|
+
// ── MCP server install / uninstall ───────────────────────────────────────
|
|
288
|
+
installServer(ctx) {
|
|
289
|
+
const { connector } = ctx;
|
|
290
|
+
const override = connector.platforms[HOST]?.server;
|
|
291
|
+
if (!connector.server || override === false) {
|
|
292
|
+
return [
|
|
293
|
+
{
|
|
294
|
+
platform: this.id,
|
|
295
|
+
action: "skip",
|
|
296
|
+
detail: connector.server ? "server registration disabled for windsurf" : "connector declares no MCP server"
|
|
297
|
+
}
|
|
298
|
+
];
|
|
299
|
+
}
|
|
300
|
+
if (ctx.scope === "project") {
|
|
301
|
+
return [
|
|
302
|
+
{
|
|
303
|
+
platform: this.id,
|
|
304
|
+
action: "skip",
|
|
305
|
+
detail: "Windsurf has no project-level MCP config (user scope only); re-run with --scope user"
|
|
306
|
+
}
|
|
307
|
+
];
|
|
308
|
+
}
|
|
309
|
+
const server = override && typeof override === "object" ? { ...connector.server, ...override } : connector.server;
|
|
310
|
+
const serverPath = this.getServerConfigPath(ctx);
|
|
311
|
+
const malformed = this.malformedRootKey(serverPath);
|
|
312
|
+
if (malformed) return [malformed];
|
|
313
|
+
const entry = this.renderServerEntry(ctx, server);
|
|
314
|
+
return [
|
|
315
|
+
this.upsertServerInJson(serverPath, MCP_ROOT_KEY, connector.id, entry, ctx.dryRun)
|
|
316
|
+
];
|
|
317
|
+
}
|
|
318
|
+
uninstallServer(ctx) {
|
|
319
|
+
const serverPath = this.getServerConfigPath(ctx);
|
|
320
|
+
const malformed = this.malformedRootKey(serverPath);
|
|
321
|
+
if (malformed) return [malformed];
|
|
322
|
+
return [
|
|
323
|
+
this.removeServerFromJson(serverPath, MCP_ROOT_KEY, ctx.connector.id, ctx.dryRun)
|
|
324
|
+
];
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Guard for a PRESENT-but-non-object `mcpServers` root key: returns a
|
|
328
|
+
* skip-warn ChangeRecord when the existing config parses but its `mcpServers`
|
|
329
|
+
* value is not a plain object (an array / string / number / null). Returns
|
|
330
|
+
* undefined when the file is absent, unparseable (the base upsert's own
|
|
331
|
+
* overwrite guard handles that), or `mcpServers` is absent / a plain object.
|
|
332
|
+
*/
|
|
333
|
+
malformedRootKey(configPath) {
|
|
334
|
+
const cfg = this.readJson(configPath);
|
|
335
|
+
if (!cfg || !(MCP_ROOT_KEY in cfg)) return void 0;
|
|
336
|
+
const root = cfg[MCP_ROOT_KEY];
|
|
337
|
+
if (root !== null && typeof root === "object" && !Array.isArray(root)) {
|
|
338
|
+
return void 0;
|
|
339
|
+
}
|
|
340
|
+
return {
|
|
341
|
+
platform: this.id,
|
|
342
|
+
action: "warn",
|
|
343
|
+
path: configPath,
|
|
344
|
+
detail: `existing ${MCP_ROOT_KEY} in ${configPath} is not an object map; left untouched (back it up / fix it, then re-run)`
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
/** Render a normalized ServerDef into Windsurf's native mcpServers entry. */
|
|
348
|
+
renderServerEntry(ctx, server) {
|
|
349
|
+
const transport = server.transport;
|
|
350
|
+
if (transport === "stdio") {
|
|
351
|
+
let command = server.command ?? "";
|
|
352
|
+
let args = [...server.args ?? []];
|
|
353
|
+
if (shouldWrapForTelemetry(server, ctx.connector.telemetry)) {
|
|
354
|
+
const wrapped = buildServeWrapperCommand(
|
|
355
|
+
ctx.homeBinPath,
|
|
356
|
+
ctx.connector.id,
|
|
357
|
+
command,
|
|
358
|
+
args,
|
|
359
|
+
ctx.scope,
|
|
360
|
+
this.id
|
|
361
|
+
);
|
|
362
|
+
command = wrapped.command;
|
|
363
|
+
args = wrapped.args;
|
|
364
|
+
}
|
|
365
|
+
const entry2 = {
|
|
366
|
+
command: resolveEnvRefsDeep(command)
|
|
367
|
+
};
|
|
368
|
+
if (args.length > 0) entry2.args = resolveEnvRefsDeep(args);
|
|
369
|
+
const env = this.renderEnv(server.env);
|
|
370
|
+
if (env) entry2.env = env;
|
|
371
|
+
return entry2;
|
|
372
|
+
}
|
|
373
|
+
const entry = {
|
|
374
|
+
serverUrl: resolveEnvRefsDeep(server.url ?? "")
|
|
375
|
+
};
|
|
376
|
+
const headers = this.renderEnv(server.headers);
|
|
377
|
+
if (headers) entry.headers = headers;
|
|
378
|
+
return entry;
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Render env/header values. Windsurf has a native ${env:VAR} token, but AC
|
|
382
|
+
* resolves references to literals at install time (the safe path).
|
|
383
|
+
*/
|
|
384
|
+
renderEnv(env) {
|
|
385
|
+
if (!env || Object.keys(env).length === 0) return void 0;
|
|
386
|
+
return resolveEnvRefsDeep({ ...env });
|
|
387
|
+
}
|
|
388
|
+
// ── Hooks (unavailable — Windsurf is mcp-only) ────────────────────────────
|
|
389
|
+
installHooks(_ctx) {
|
|
390
|
+
return [
|
|
391
|
+
{
|
|
392
|
+
platform: this.id,
|
|
393
|
+
action: "skip",
|
|
394
|
+
detail: "hooks unavailable (Windsurf is mcp-only)"
|
|
395
|
+
}
|
|
396
|
+
];
|
|
397
|
+
}
|
|
398
|
+
uninstallHooks(_ctx) {
|
|
399
|
+
return [
|
|
400
|
+
{
|
|
401
|
+
platform: this.id,
|
|
402
|
+
action: "skip",
|
|
403
|
+
detail: "hooks unavailable (Windsurf is mcp-only)"
|
|
404
|
+
}
|
|
405
|
+
];
|
|
406
|
+
}
|
|
407
|
+
// ── Diagnostics ──────────────────────────────────────────────────────────
|
|
408
|
+
getHealthChecks(ctx) {
|
|
409
|
+
const mcpPath = this.getServerConfigPath(ctx);
|
|
410
|
+
const connectorId = ctx.connector.id;
|
|
411
|
+
return [
|
|
412
|
+
{
|
|
413
|
+
name: `${this.name}: mcp_config.json present`,
|
|
414
|
+
check: () => existsSync(mcpPath) ? { status: "OK", detail: mcpPath } : { status: "FAIL", detail: `not found: ${mcpPath}` }
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
name: `${this.name}: server entry registered`,
|
|
418
|
+
check: () => {
|
|
419
|
+
if (!ctx.connector.server) {
|
|
420
|
+
return { status: "OK", detail: "no MCP server declared" };
|
|
421
|
+
}
|
|
422
|
+
const cfg = this.readJson(mcpPath);
|
|
423
|
+
const bucket = cfg?.[MCP_ROOT_KEY];
|
|
424
|
+
if (!cfg || !bucket) {
|
|
425
|
+
return { status: "FAIL", detail: `no ${MCP_ROOT_KEY} in ${mcpPath}` };
|
|
426
|
+
}
|
|
427
|
+
return connectorId in bucket ? { status: "OK", detail: `${MCP_ROOT_KEY}.${connectorId} present` } : {
|
|
428
|
+
status: "FAIL",
|
|
429
|
+
detail: `no ${MCP_ROOT_KEY}.${connectorId} in ${mcpPath}`
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
];
|
|
434
|
+
}
|
|
435
|
+
};
|
|
436
|
+
var adapter = new WindsurfAdapter();
|
|
437
|
+
var windsurf_default = adapter;
|
|
438
|
+
export {
|
|
439
|
+
WindsurfAdapter,
|
|
440
|
+
adapter,
|
|
441
|
+
windsurf_default as default
|
|
442
|
+
};
|
|
443
|
+
//# sourceMappingURL=windsurf-FU5G4SHF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/adapters/windsurf/index.ts"],"sourcesContent":["/**\n * adapters/windsurf — Windsurf (Codeium / Cognition's Cascade agent) adapter.\n *\n * Windsurf is an mcp-only host from agent-connector's perspective: there is no\n * user-installable hook/plugin layer (it is a GUI editor). AC registers the MCP\n * server PLUS three content surfaces (memory, workflows, skills — see below). The\n * MCP config is a Claude-Desktop-style OBJECT map keyed by server name (exactly\n * like the cursor adapter's `mcpServers`), NOT an array.\n *\n * MCP config (primary-verified — docs.devin.ai/desktop/cascade/mcp, formerly\n * docs.windsurf.com):\n * - user/global scope ONLY → ~/.codeium/windsurf/mcp_config.json\n * (Windows %USERPROFILE%\\.codeium\\windsurf\\mcp_config.json — homedir()\n * covers it). The docs specify NO project/workspace config path, so a\n * project-scope install returns a skip ChangeRecord.\n * - root key \"mcpServers\" — a JSON object/map keyed by server name.\n *\n * Server entry shapes (primary-verified):\n * - stdio: { command, args?, env? }\n * - remote: { serverUrl, headers? } — the docs use `serverUrl` (an `url`\n * alias is mentioned but `serverUrl` is the documented primary). There is\n * NO `type` discriminator and NO `disabled` field — stdio vs remote is\n * distinguished by `command` vs `serverUrl`. `headers` is emitted only when\n * the connector's remote server provides them.\n *\n * Native interpolation: Windsurf supports `${env:VAR}` / `${file:/path}`\n * tokens, but AC does not need to emit those — values are resolved to literals\n * at install time (the safe path, same as droid/crush/amazon-q).\n *\n * Memory / rules (primary-verified — docs.windsurf.com/windsurf/cascade/rules,\n * llms-full.txt): a `.windsurf/rules/` workspace directory holds `.md` rule\n * files, each declaring an activation mode \"in its frontmatter via the `trigger`\n * field\". `trigger: always_on` means \"full rule content is included in the\n * system prompt on every message\" (the docs' literal Activation-Modes table).\n * AC owns a DEDICATED file there (`.windsurf/rules/agent-connector.md`) that MUST\n * LEAD with that always-on frontmatter, so — like the continue adapter and unlike\n * the cline/amazon-q managed-block targets — we write the WHOLE file\n * (frontmatter + body) via the content-file writers and own it end-to-end\n * (install creates, uninstall deletes). The connector's memory `content` is\n * host-agnostic (MemoryDef forbids its own frontmatter), so the always-on\n * directive is an adapter-level wrapper. WORKSPACE/PROJECT SCOPE: `global_rules.md`\n * is a single SHARED global file (not an AC-owned dir), so user scope skip-warns.\n *\n * Content surfaces — workflows (slash commands) + skills, BOTH project AND user\n * scope:\n * - workflows → project `<projectDir>/.windsurf/workflows/<name>.md`,\n * user `~/.codeium/windsurf/global_workflows/<name>.md` (the user dir is\n * `global_workflows`, NOT `workflows`). Each becomes a `/<name>` slash\n * command. Windsurf caps each workflow file at 12,000 chars — over-budget\n * files are still written but warned.\n * - skills → project `<projectDir>/.windsurf/skills/<name>/SKILL.md`,\n * user `~/.codeium/windsurf/skills/<name>/SKILL.md` (the dir is `skills` in\n * BOTH scopes). Same SKILL.md convention cline/claude-code/qwen-code use.\n * Both reuse the shared claude-code renderers (renderCommandMd/renderSkillMd).\n *\n * Hook \"config path\" is aliased to the MCP file (no separate hook file) so the\n * base doctor/backup helpers behave sensibly (the amazon-q / roo-code idiom).\n */\n\nimport { existsSync, statSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { basename, join } from \"node:path\";\n\nimport { BaseAdapter } from \"../base.js\";\nimport { renderCommandMd, renderSkillMd } from \"../claude-code/render.js\";\nimport type { Adapter, InstallContext } from \"../spi.js\";\nimport type {\n ChangeRecord,\n DetectedPlatform,\n HealthCheck,\n HookParadigm,\n PlatformCapabilities,\n PlatformId,\n ServerDef,\n Transport,\n} from \"../../core/types.js\";\nimport { resolveEnvRefsDeep } from \"../../core/interpolate.js\";\nimport {\n buildServeWrapperCommand,\n shouldWrapForTelemetry,\n} from \"../../core/spawn.js\";\n\nconst HOST: PlatformId = \"windsurf\";\nconst MCP_ROOT_KEY = \"mcpServers\";\n\n/**\n * Windsurf caps each workflow (slash-command) file at 12,000 characters\n * (docs.windsurf.com). We still write an over-budget file but emit a warn so the\n * author can trim it, mirroring base.ts's memory soft-budget warn. Skills have no\n * documented size cap, so they are not guarded.\n */\nconst WORKFLOW_MAX_CHARS = 12000;\n\n/**\n * Native MCP server entry shapes Windsurf accepts under `mcpServers` (an OBJECT\n * map keyed by server name, Claude-Desktop-style):\n * - stdio: { command, args?, env? } — transport inferred from `command`.\n * - remote: { serverUrl, headers? } — `serverUrl` (NOT `url`); NO `type`\n * discriminator and NO `disabled` flag. `headers` only when provided.\n */\ninterface WindsurfStdioServer {\n command: string;\n args?: string[];\n env?: Record<string, string>;\n}\ninterface WindsurfRemoteServer {\n serverUrl: string;\n headers?: Record<string, string>;\n}\n\nexport class WindsurfAdapter extends BaseAdapter implements Adapter {\n readonly id: PlatformId = HOST;\n readonly name = \"Windsurf\";\n readonly paradigm: HookParadigm = \"mcp-only\";\n\n readonly capabilities: PlatformCapabilities = {\n // Memory surface: WIRED. Windsurf reads `.windsurf/rules/*.md` (NOT\n // AGENTS.md), so the AGENTS.md-first BaseAdapter default does not apply — the\n // installMemory/uninstallMemory overrides below write a DEDICATED\n // agent-connector-owned file (<projectDir>/.windsurf/rules/agent-connector.md)\n // that LEADS with `trigger: always_on` frontmatter (full content in the\n // system prompt on every message). Workspace/project scope only; user scope\n // skip-warns (global_rules.md is a shared global file, not an AC-owned dir).\n supportsMemory: true,\n //\n // mcp-only: Windsurf is a GUI editor with no user-installable hook/plugin\n // layer. Every hook flag is false.\n preToolUse: false,\n postToolUse: false,\n preCompact: false,\n sessionStart: false,\n sessionEnd: false,\n userPromptSubmit: false,\n stop: false,\n notification: false,\n // No hook layer → no arg/output rewrite, no context injection.\n canModifyArgs: false,\n canModifyOutput: false,\n canInjectSessionContext: false,\n // Windsurf registers stdio + remote (http/sse) MCP servers; the remote\n // entry is distinguished by `serverUrl` (vs stdio's `command`).\n transports: [\"stdio\", \"http\", \"sse\"],\n // Content surfaces: WIRED in BOTH scopes. Windsurf reads user-authored\n // WORKFLOWS (each becomes a `/<name>` slash command) and Agent SKILLS (the\n // same SKILL.md frontmatter convention cline/claude-code/qwen-code use):\n // workflows → project .windsurf/workflows/<name>.md,\n // user ~/.codeium/windsurf/global_workflows/<name>.md\n // skills → project .windsurf/skills/<name>/SKILL.md,\n // user ~/.codeium/windsurf/skills/<name>/SKILL.md\n // The install overrides below branch the path on ctx.scope and write at both.\n // Subagents stay UNSET (no documented user-authored dir): base skip-warns.\n supportsCommands: true,\n supportsSkills: true,\n };\n\n // ── Detection ────────────────────────────────────────────────────────────\n\n detectInstalled(_projectDir: string): DetectedPlatform {\n const userDir = join(homedir(), \".codeium\", \"windsurf\");\n const userMcp = join(userDir, \"mcp_config.json\");\n const installed = existsSync(userDir) || existsSync(userMcp);\n return {\n id: this.id,\n name: this.name,\n installed,\n paradigm: this.paradigm,\n capabilities: this.capabilities,\n configPath: userMcp,\n scope: \"user\",\n reason: installed\n ? `found Windsurf config under ${userDir}`\n : `no Windsurf config at ${userDir}`,\n confidence: installed ? \"high\" : \"low\",\n };\n }\n\n // ── Native paths ─────────────────────────────────────────────────────────\n\n /**\n * Windsurf's MCP config is USER/GLOBAL scope only — the docs specify no\n * project/workspace path. getConfigDir always resolves the user dir\n * (homedir() covers USERPROFILE on Windows); a project-scope install is\n * handled by installServer returning a skip, never a write under projectDir.\n */\n getConfigDir(_ctx: InstallContext): string {\n return join(homedir(), \".codeium\", \"windsurf\");\n }\n\n getServerConfigPath(ctx: InstallContext): string {\n return join(this.getConfigDir(ctx), \"mcp_config.json\");\n }\n\n /**\n * Windsurf has no separate hook file — hook config path aliases the MCP file\n * so the generic doctor/backup helpers behave sensibly (amazon-q idiom).\n */\n getHookConfigPath(ctx: InstallContext): string {\n return this.getServerConfigPath(ctx);\n }\n\n // ── Memory surface: the `.windsurf/rules` content tree ────────────────────\n // A DEDICATED agent-connector-owned file that MUST LEAD with `trigger:\n // always_on` frontmatter (full content in the system prompt on every message).\n // Because of that leading frontmatter we do NOT use the base managed-block\n // engine — we own the whole file via the content-file writers: install\n // writes/updates it idempotently, uninstall deletes it. WORKSPACE/PROJECT scope\n // only (global_rules.md is a shared global file, not an AC-owned dir).\n\n /** <projectDir>/.windsurf/rules/agent-connector.md — the dedicated owned file. */\n private memoryFilePath(ctx: InstallContext): string {\n return join(ctx.projectDir, \".windsurf\", \"rules\", \"agent-connector.md\");\n }\n\n /** True when `<projectDir>/.windsurf/rules` exists and is a regular FILE. */\n private rulesDirIsFile(ctx: InstallContext): boolean {\n const p = join(ctx.projectDir, \".windsurf\", \"rules\");\n if (!existsSync(p)) return false;\n try {\n return statSync(p).isFile();\n } catch {\n return false;\n }\n }\n\n /**\n * Compose the dedicated rule file: `trigger: always_on` frontmatter (the\n * always-on activation directive) + every declared memory entry's content,\n * joined with a blank line. The connector's content is host-agnostic markdown\n * (MemoryDef forbids its own frontmatter), so the directive is ours to add.\n */\n private renderMemoryFile(ctx: InstallContext): string {\n const body = (ctx.connector.memory ?? [])\n .map((m) => m.content.trim())\n .filter((c) => c.length > 0)\n .join(\"\\n\\n\");\n return this.renderFrontmatterMd({ trigger: \"always_on\" }, body);\n }\n\n override installMemory(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\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 // Windsurf's verified per-rule `.windsurf/rules` dir is WORKSPACE scope only.\n if (ctx.scope !== \"project\") {\n return [\n {\n platform: this.id,\n action: \"warn\",\n detail:\n `no ${ctx.scope}-scope rules dir verified for windsurf ` +\n `(.windsurf/rules is workspace-scope; global_rules.md is a shared file); ` +\n `${entries.length} skipped`,\n },\n ];\n }\n // Rules-path collision: never write under a `.windsurf/rules` that is a FILE.\n if (this.rulesDirIsFile(ctx)) {\n return [\n {\n platform: this.id,\n action: \"warn\",\n path: join(ctx.projectDir, \".windsurf\", \"rules\"),\n detail:\n \"existing .windsurf/rules is a file, not a directory; left untouched — \" +\n \"convert it to a .windsurf/rules/ directory to receive agent-connector memory\",\n },\n ];\n }\n return [this.writeContentFile(this.memoryFilePath(ctx), this.renderMemoryFile(ctx), ctx.dryRun)];\n }\n\n override uninstallMemory(ctx: InstallContext): ChangeRecord[] {\n // Only the project-scope dedicated file was ever written; a `.windsurf/rules`\n // that is a FILE was never ours (installMemory warned), so leave it.\n if (ctx.scope !== \"project\" || this.rulesDirIsFile(ctx)) {\n const path = this.memoryFilePath(ctx);\n return [\n { platform: this.id, action: \"skip\", path, detail: `${basename(path)} absent` },\n ];\n }\n return [this.removeContentFile(this.memoryFilePath(ctx), ctx.dryRun)];\n }\n\n // ── Content surfaces: commands (workflows) + skills ───────────────────────\n // CONTENT-ONLY native-file writers, structured like installMemory: dedicated-\n // file ownership, dryRun honored via writeContentFile/removeContentFile. Both\n // reuse the shared claude-code renderers (renderCommandMd / renderSkillMd) — no\n // new markdown serializer. BOTH scopes write (the project dir AND the\n // ~/.codeium/windsurf user/global dirs are documented surfaces):\n //\n // commands (workflows)\n // - project → <projectDir>/.windsurf/workflows/<name>.md\n // - user → ~/.codeium/windsurf/global_workflows/<name>.md\n // (NOTE: the user dir is `global_workflows`, NOT `workflows`.)\n // skills\n // - project → <projectDir>/.windsurf/skills/<name>/SKILL.md\n // - user → ~/.codeium/windsurf/skills/<name>/SKILL.md\n // (the dir is `skills` in BOTH scopes; same SKILL.md convention\n // cline/claude-code/qwen-code use.)\n //\n // renderCommandMd emits Claude-flavored frontmatter keys (argument-hint, model,\n // allowed-tools); Windsurf ignores unknown frontmatter keys, so they are inert/\n // tolerated — no Windsurf-specific renderer is needed.\n\n /** Workflow file: project `.windsurf/workflows`, user `~/.codeium/windsurf/global_workflows`. */\n private commandPath(ctx: InstallContext, name: string): string {\n const dir =\n ctx.scope === \"project\"\n ? join(ctx.projectDir, \".windsurf\", \"workflows\")\n : join(homedir(), \".codeium\", \"windsurf\", \"global_workflows\");\n return join(dir, `${name}.md`);\n }\n\n /** Skill dir: project `.windsurf/skills/<name>`, user `~/.codeium/windsurf/skills/<name>`. */\n private skillDir(ctx: InstallContext, name: string): string {\n const base =\n ctx.scope === \"project\"\n ? join(ctx.projectDir, \".windsurf\", \"skills\")\n : join(homedir(), \".codeium\", \"windsurf\", \"skills\");\n return join(base, name);\n }\n\n // ── Commands (workflows) ──────────────────────────────────────────────────\n\n override installCommands(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.platforms[HOST]?.commands === false) {\n return [{ platform: this.id, action: \"skip\", detail: \"commands disabled for windsurf\" }];\n }\n if (connector.commands.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no commands\" }];\n }\n const changes: ChangeRecord[] = [];\n for (const cmd of connector.commands) {\n const rendered = renderCommandMd(cmd);\n changes.push(this.writeContentFile(this.commandPath(ctx, cmd.name), rendered, ctx.dryRun));\n // Windsurf caps each workflow file at 12,000 characters (docs.windsurf.com).\n // Still write the file — warn so the author can trim it (Windsurf may reject\n // or truncate the overflow), mirroring base.ts's memory soft-budget warn.\n if (rendered.length > WORKFLOW_MAX_CHARS) {\n changes.push({\n platform: this.id,\n action: \"warn\",\n path: this.commandPath(ctx, cmd.name),\n detail:\n `workflow \"${cmd.name}\" is ${rendered.length} chars ` +\n `(Windsurf caps each workflow at ${WORKFLOW_MAX_CHARS}); ` +\n `the host may reject or truncate it — trim the command`,\n });\n }\n }\n return changes;\n }\n\n override uninstallCommands(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.commands.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no commands\" }];\n }\n return connector.commands.map((cmd) =>\n this.removeContentFile(this.commandPath(ctx, cmd.name), ctx.dryRun),\n );\n }\n\n // ── Skills ────────────────────────────────────────────────────────────────\n\n override installSkills(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.platforms[HOST]?.skills === false) {\n return [{ platform: this.id, action: \"skip\", detail: \"skills disabled for windsurf\" }];\n }\n if (connector.skills.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no skills\" }];\n }\n const changes: ChangeRecord[] = [];\n for (const skill of connector.skills) {\n const dir = this.skillDir(ctx, skill.name);\n changes.push(\n this.writeContentFile(join(dir, \"SKILL.md\"), renderSkillMd(skill), ctx.dryRun),\n );\n for (const [rel, contents] of Object.entries(skill.resources ?? {})) {\n const target = this.resolveWithin(dir, rel);\n if (target === null) {\n changes.push({\n platform: this.id,\n action: \"warn\",\n detail: `skill resource \"${rel}\" escapes the skill dir; skipped`,\n });\n continue;\n }\n changes.push(this.writeContentFile(target, contents, ctx.dryRun));\n }\n }\n return changes;\n }\n\n override uninstallSkills(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.skills.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no skills\" }];\n }\n const changes: ChangeRecord[] = [];\n for (const skill of connector.skills) {\n const dir = this.skillDir(ctx, skill.name);\n changes.push(this.removeContentFile(join(dir, \"SKILL.md\"), ctx.dryRun));\n for (const rel of Object.keys(skill.resources ?? {})) {\n const target = this.resolveWithin(dir, rel);\n if (target === null) continue;\n changes.push(this.removeContentFile(target, ctx.dryRun));\n }\n changes.push(this.removeDirIfEmpty(dir, ctx.dryRun));\n }\n return changes;\n }\n\n // ── MCP server install / uninstall ───────────────────────────────────────\n\n installServer(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n const override = connector.platforms[HOST]?.server;\n if (!connector.server || override === false) {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail: connector.server\n ? \"server registration disabled for windsurf\"\n : \"connector declares no MCP server\",\n },\n ];\n }\n\n // Windsurf has no project-level MCP config (user scope only — the docs\n // document only ~/.codeium/windsurf/mcp_config.json). A project-scope\n // install is reported as a skip rather than written into the project tree.\n if (ctx.scope === \"project\") {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail:\n \"Windsurf has no project-level MCP config (user scope only); \" +\n \"re-run with --scope user\",\n },\n ];\n }\n\n // Shallow-merge any per-platform server override into the base ServerDef.\n const server: ServerDef =\n override && typeof override === \"object\"\n ? { ...connector.server, ...override }\n : connector.server;\n\n const serverPath = this.getServerConfigPath(ctx);\n\n // NEVER clobber a malformed `mcpServers`. The base upsert tolerates a\n // missing file / missing key (it creates the object), but a PRESENT-but-\n // non-object `mcpServers` (e.g. an array or string from a hand-edit) would\n // get a named property bolted on and silently corrupted — so skip-and-warn.\n const malformed = this.malformedRootKey(serverPath);\n if (malformed) return [malformed];\n\n const entry = this.renderServerEntry(ctx, server);\n\n return [\n this.upsertServerInJson(serverPath, MCP_ROOT_KEY, connector.id, entry, ctx.dryRun),\n ];\n }\n\n uninstallServer(ctx: InstallContext): ChangeRecord[] {\n const serverPath = this.getServerConfigPath(ctx);\n const malformed = this.malformedRootKey(serverPath);\n if (malformed) return [malformed];\n return [\n this.removeServerFromJson(serverPath, MCP_ROOT_KEY, ctx.connector.id, ctx.dryRun),\n ];\n }\n\n /**\n * Guard for a PRESENT-but-non-object `mcpServers` root key: returns a\n * skip-warn ChangeRecord when the existing config parses but its `mcpServers`\n * value is not a plain object (an array / string / number / null). Returns\n * undefined when the file is absent, unparseable (the base upsert's own\n * overwrite guard handles that), or `mcpServers` is absent / a plain object.\n */\n private malformedRootKey(configPath: string): ChangeRecord | undefined {\n const cfg = this.readJson<Record<string, unknown>>(configPath);\n if (!cfg || !(MCP_ROOT_KEY in cfg)) return undefined;\n const root = cfg[MCP_ROOT_KEY];\n if (root !== null && typeof root === \"object\" && !Array.isArray(root)) {\n return undefined;\n }\n return {\n platform: this.id,\n action: \"warn\",\n path: configPath,\n detail: `existing ${MCP_ROOT_KEY} in ${configPath} is not an object map; left untouched (back it up / fix it, then re-run)`,\n };\n }\n\n /** Render a normalized ServerDef into Windsurf's native mcpServers entry. */\n private renderServerEntry(\n ctx: InstallContext,\n server: ServerDef,\n ): WindsurfStdioServer | WindsurfRemoteServer {\n const transport: Transport = server.transport;\n\n if (transport === \"stdio\") {\n let command = server.command ?? \"\";\n let args = [...(server.args ?? [])];\n\n // Transparent telemetry wrapping: route the real command through\n // `<homeBin> serve --connector <id> -- <command> <args...>`.\n if (shouldWrapForTelemetry(server, ctx.connector.telemetry)) {\n const wrapped = buildServeWrapperCommand(\n ctx.homeBinPath,\n ctx.connector.id,\n command,\n args,\n ctx.scope,\n this.id,\n );\n command = wrapped.command;\n args = wrapped.args;\n }\n\n // Windsurf supports ${env:VAR} natively, but AC resolves references to\n // literals at install time (the safe path, same as amazon-q/droid/crush).\n const entry: WindsurfStdioServer = {\n command: resolveEnvRefsDeep(command),\n };\n if (args.length > 0) entry.args = resolveEnvRefsDeep(args);\n const env = this.renderEnv(server.env);\n if (env) entry.env = env;\n return entry;\n }\n\n // http / sse (and any other remote transport) — Windsurf registers a remote\n // URL under `serverUrl` (NOT `url`). NO `type` discriminator, NO `disabled`.\n // `headers` only when the connector's remote server provides them.\n const entry: WindsurfRemoteServer = {\n serverUrl: resolveEnvRefsDeep(server.url ?? \"\"),\n };\n const headers = this.renderEnv(server.headers);\n if (headers) entry.headers = headers;\n return entry;\n }\n\n /**\n * Render env/header values. Windsurf has a native ${env:VAR} token, but AC\n * resolves references to literals at install time (the safe path).\n */\n private renderEnv(\n env: Record<string, string> | undefined,\n ): Record<string, string> | undefined {\n if (!env || Object.keys(env).length === 0) return undefined;\n return resolveEnvRefsDeep({ ...env });\n }\n\n // ── Hooks (unavailable — Windsurf is mcp-only) ────────────────────────────\n\n installHooks(_ctx: InstallContext): ChangeRecord[] {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail: \"hooks unavailable (Windsurf is mcp-only)\",\n },\n ];\n }\n\n uninstallHooks(_ctx: InstallContext): ChangeRecord[] {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail: \"hooks unavailable (Windsurf is mcp-only)\",\n },\n ];\n }\n\n // ── Diagnostics ──────────────────────────────────────────────────────────\n\n override getHealthChecks(ctx: InstallContext): readonly HealthCheck[] {\n const mcpPath = this.getServerConfigPath(ctx);\n const connectorId = ctx.connector.id;\n return [\n {\n name: `${this.name}: mcp_config.json present`,\n check: () =>\n existsSync(mcpPath)\n ? { status: \"OK\", detail: mcpPath }\n : { status: \"FAIL\", detail: `not found: ${mcpPath}` },\n },\n {\n name: `${this.name}: server entry registered`,\n check: () => {\n if (!ctx.connector.server) {\n return { status: \"OK\", detail: \"no MCP server declared\" };\n }\n const cfg = this.readJson<{ [k: string]: Record<string, unknown> }>(mcpPath);\n const bucket = cfg?.[MCP_ROOT_KEY];\n if (!cfg || !bucket) {\n return { status: \"FAIL\", detail: `no ${MCP_ROOT_KEY} in ${mcpPath}` };\n }\n return connectorId in bucket\n ? { status: \"OK\", detail: `${MCP_ROOT_KEY}.${connectorId} present` }\n : {\n status: \"FAIL\",\n detail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3E,gBAAM,SAAS,MAAM,YAAY;AACjC,cAAI,CAAC,OAAO,CAAC,QAAQ;AACnB,mBAAO,EAAE,QAAQ,QAAQ,QAAQ,MAAM,YAAY,OAAO,OAAO,GAAG;AAAA,UACtE;AACA,iBAAO,eAAe,SAClB,EAAE,QAAQ,MAAM,QAAQ,GAAG,YAAY,IAAI,WAAW,WAAW,IACjE;AAAA,YACE,QAAQ;AAAA,YACR,QAAQ,MAAM,YAAY,IAAI,WAAW,OAAO,OAAO;AAAA,UACzD;AAAA,QACN;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,UAAU,IAAI,gBAAgB;AAC3C,IAAO,mBAAQ;","names":["entry"]}
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./chunk-DBQMX75U.js";
|
|
5
5
|
import {
|
|
6
6
|
BaseAdapter
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CPLK7GTE.js";
|
|
8
8
|
import {
|
|
9
9
|
renderSkillMd
|
|
10
10
|
} from "./chunk-7L6ITC4T.js";
|
|
11
11
|
import {
|
|
12
12
|
buildServeWrapperCommand,
|
|
13
13
|
shouldWrapForTelemetry
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-I5MLE6S7.js";
|
|
15
15
|
import "./chunk-N6HH7K6P.js";
|
|
16
16
|
import "./chunk-TRQKHP7D.js";
|
|
17
17
|
|
|
@@ -321,4 +321,4 @@ export {
|
|
|
321
321
|
adapter,
|
|
322
322
|
zed_default as default
|
|
323
323
|
};
|
|
324
|
-
//# sourceMappingURL=zed-
|
|
324
|
+
//# sourceMappingURL=zed-SFUHL3GS.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ken-jo/agent-connector",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Write your MCP server + hooks once; agent-connector installs and adapts them across every AI-agent platform (Claude Code, Codex, Cursor, OpenCode, Copilot, Gemini, Warp, …) and gives you default, platform-independent per-tool token telemetry.",
|
|
6
6
|
"keywords": [
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"url": "https://github.com/ken-jo/agent-connector/issues"
|
|
29
29
|
},
|
|
30
30
|
"bin": {
|
|
31
|
-
"agent-connector": "
|
|
31
|
+
"agent-connector": "dist/cli.js"
|
|
32
32
|
},
|
|
33
33
|
"exports": {
|
|
34
34
|
".": {
|