@s-gw/s-gw 0.1.0
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/.codex-plugin/plugin.json +35 -0
- package/.mcp.json +16 -0
- package/LICENSE +201 -0
- package/NOTICE +7 -0
- package/README.md +197 -0
- package/TRADEMARKS.md +9 -0
- package/assets/icons/aws-ec2.png +0 -0
- package/assets/icons/lucide/bot.svg +8 -0
- package/assets/icons/lucide/monitor.svg +5 -0
- package/assets/icons/lucide/server.svg +6 -0
- package/assets/icons/lucide/terminal.svg +4 -0
- package/assets/icons/s-gw-128.png +0 -0
- package/assets/icons/s-gw-16.png +0 -0
- package/assets/icons/s-gw-180.png +0 -0
- package/assets/icons/s-gw-192.png +0 -0
- package/assets/icons/s-gw-32.png +0 -0
- package/assets/icons/s-gw-64.png +0 -0
- package/assets/icons/s-gw-menu-bar-template.png +0 -0
- package/dist/agent-context.d.ts +17 -0
- package/dist/agent-context.js +207 -0
- package/dist/agents.d.ts +64 -0
- package/dist/agents.js +763 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1385 -0
- package/dist/command-suggest.d.ts +3 -0
- package/dist/command-suggest.js +131 -0
- package/dist/console-server.d.ts +16 -0
- package/dist/console-server.js +978 -0
- package/dist/console-ui/assets/codex-DYTPdPxi.png +0 -0
- package/dist/console-ui/assets/cursor-CBrUTJD-.png +0 -0
- package/dist/console-ui/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/dist/console-ui/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/dist/console-ui/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/dist/console-ui/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/dist/console-ui/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/dist/console-ui/assets/hermes-B8hNbJPm.png +0 -0
- package/dist/console-ui/assets/index-BxUf0Sye.js +96 -0
- package/dist/console-ui/assets/index-CmTiBR_w.css +2 -0
- package/dist/console-ui/assets/omnigent-Cxa4p2Mq.png +0 -0
- package/dist/console-ui/assets/openclaw-C5wL4ZVW.png +0 -0
- package/dist/console-ui/assets/opencode-D_wFATSC.png +0 -0
- package/dist/console-ui/assets/openhands-DnrlGgev.svg +9 -0
- package/dist/console-ui/assets/s-gw-64-ByMUGQ3K.png +0 -0
- package/dist/console-ui/assets/vscode-Bdtr9eyf.png +0 -0
- package/dist/console-ui/assets/zeptoclaw-DztQW8Sw.png +0 -0
- package/dist/console-ui/index.html +13 -0
- package/dist/crypto.d.ts +6 -0
- package/dist/crypto.js +53 -0
- package/dist/executor.d.ts +7 -0
- package/dist/executor.js +297 -0
- package/dist/gateway.d.ts +31 -0
- package/dist/gateway.js +114 -0
- package/dist/guard.d.ts +61 -0
- package/dist/guard.js +247 -0
- package/dist/install.d.ts +146 -0
- package/dist/install.js +629 -0
- package/dist/mcp-server.d.ts +2 -0
- package/dist/mcp-server.js +119 -0
- package/dist/native/s-gw-core +0 -0
- package/dist/native/s-gw-keychain-helper +0 -0
- package/dist/onepassword.d.ts +48 -0
- package/dist/onepassword.js +412 -0
- package/dist/paths.d.ts +4 -0
- package/dist/paths.js +22 -0
- package/dist/s-gw Menu Bar.app/Contents/Info.plist +28 -0
- package/dist/s-gw Menu Bar.app/Contents/MacOS/s-gw-menu-bar-helper +0 -0
- package/dist/s-gw Menu Bar.app/Contents/Resources/AppIcon.icns +0 -0
- package/dist/s-gw Menu Bar.app/Contents/Resources/AwsEc2.png +0 -0
- package/dist/s-gw Menu Bar.app/Contents/Resources/Lucide-bot.svg +8 -0
- package/dist/s-gw Menu Bar.app/Contents/Resources/Lucide-monitor.svg +5 -0
- package/dist/s-gw Menu Bar.app/Contents/Resources/Lucide-server.svg +6 -0
- package/dist/s-gw Menu Bar.app/Contents/Resources/Lucide-terminal.svg +4 -0
- package/dist/s-gw Menu Bar.app/Contents/Resources/MenuBarTemplate.png +0 -0
- package/dist/s-gw Menu Bar.app/Contents/_CodeSignature/CodeResources +194 -0
- package/dist/s-gw.app/Contents/Info.plist +28 -0
- package/dist/s-gw.app/Contents/MacOS/s-gw +0 -0
- package/dist/s-gw.app/Contents/Resources/AppIcon.icns +0 -0
- package/dist/s-gw.app/Contents/Resources/MenuBarTemplate.png +0 -0
- package/dist/s-gw.app/Contents/_CodeSignature/CodeResources +139 -0
- package/dist/scanner.d.ts +9 -0
- package/dist/scanner.js +437 -0
- package/dist/ssh.d.ts +31 -0
- package/dist/ssh.js +286 -0
- package/dist/store.d.ts +131 -0
- package/dist/store.js +1611 -0
- package/dist/types.d.ts +196 -0
- package/dist/types.js +2 -0
- package/dist/unlock.d.ts +29 -0
- package/dist/unlock.js +274 -0
- package/dist/windows/VERSION.txt +1 -0
- package/dist/windows/s-gw-client.cmd +4 -0
- package/dist/windows/s-gw-client.ps1 +106 -0
- package/dist/windows/s-gw-credential.cmd +4 -0
- package/dist/windows/s-gw-credential.ps1 +167 -0
- package/dist/windows/s-gw-helper.cmd +4 -0
- package/dist/windows/s-gw-helper.ps1 +180 -0
- package/docs/README.md +23 -0
- package/docs/agents.md +160 -0
- package/docs/architecture.md +72 -0
- package/docs/deployment.md +447 -0
- package/docs/detection.md +44 -0
- package/docs/images/s-gw-overview.png +0 -0
- package/docs/integrations.md +195 -0
- package/docs/keychain.md +39 -0
- package/docs/onepassword.md +84 -0
- package/docs/quickstart.md +104 -0
- package/docs/threat-model.md +100 -0
- package/docs/ui/THIRD_PARTY_NOTICES.md +111 -0
- package/docs/ui/apple-touch-icon.png +0 -0
- package/docs/ui/favicon-32.png +0 -0
- package/docs/ui/local-console.html +4477 -0
- package/docs/ui/vendor/d3-sankey/d3-array.LICENSE.txt +27 -0
- package/docs/ui/vendor/d3-sankey/d3-array.min.js +2 -0
- package/docs/ui/vendor/d3-sankey/d3-path.LICENSE.txt +27 -0
- package/docs/ui/vendor/d3-sankey/d3-path.min.js +2 -0
- package/docs/ui/vendor/d3-sankey/d3-sankey.LICENSE.txt +27 -0
- package/docs/ui/vendor/d3-sankey/d3-sankey.min.js +2 -0
- package/docs/ui/vendor/d3-sankey/d3-shape.LICENSE.txt +27 -0
- package/docs/ui/vendor/d3-sankey/d3-shape.min.js +2 -0
- package/docs/ui/vendor/sankeymatic/LICENSE.txt +17 -0
- package/docs/ui/vendor/sankeymatic/sankey.js +897 -0
- package/package.json +117 -0
- package/skills/s-gw/SKILL.md +19 -0
package/dist/agents.js
ADDED
|
@@ -0,0 +1,763 @@
|
|
|
1
|
+
const home = "~";
|
|
2
|
+
const project = ".";
|
|
3
|
+
const codeGuardSourceRepo = "https://github.com/cosai-oasis/project-codeguard";
|
|
4
|
+
const codeGuardPlans = {
|
|
5
|
+
claudecode: {
|
|
6
|
+
supported: true,
|
|
7
|
+
route: "plugin-marketplace",
|
|
8
|
+
releaseArtifact: "codeguard-claude.zip",
|
|
9
|
+
installPaths: ["Claude Code plugin marketplace", `${project}/.claude/skills/codeguard`],
|
|
10
|
+
commands: [
|
|
11
|
+
"/plugin marketplace add cosai-oasis/project-codeguard",
|
|
12
|
+
"/plugin install codeguard-security@project-codeguard",
|
|
13
|
+
"/reload-plugins"
|
|
14
|
+
],
|
|
15
|
+
notes: [
|
|
16
|
+
"Preferred path is the Claude Code plugin marketplace; the release zip is the repo-scoped fallback.",
|
|
17
|
+
"CodeGuard guidance complements s-gw: CodeGuard steers generated code, while s-gw keeps credential redemption local."
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
codex: {
|
|
21
|
+
supported: true,
|
|
22
|
+
route: "agent-skill",
|
|
23
|
+
releaseArtifact: "codeguard-codex.zip",
|
|
24
|
+
installPaths: [`${project}/.agents/skills/codeguard`],
|
|
25
|
+
commands: [
|
|
26
|
+
"Download codeguard-codex.zip from the CodeGuard releases page.",
|
|
27
|
+
"Unzip it and copy the .agents/ directory into the project root.",
|
|
28
|
+
"Restart Codex so it discovers .agents/skills/codeguard/SKILL.md."
|
|
29
|
+
],
|
|
30
|
+
notes: [
|
|
31
|
+
"Use project-local .agents/skills/codeguard for the CodeGuard skill.",
|
|
32
|
+
"Do not use project-local .codex/skills for CodeGuard; current CodeGuard docs call that older path stale for project discovery."
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
cursor: {
|
|
36
|
+
supported: true,
|
|
37
|
+
route: "rule-files",
|
|
38
|
+
releaseArtifact: "codeguard-cursor.zip",
|
|
39
|
+
installPaths: [`${project}/.cursor/rules`],
|
|
40
|
+
commands: [
|
|
41
|
+
"Download codeguard-cursor.zip from the CodeGuard releases page.",
|
|
42
|
+
"Unzip it and copy the .cursor/ directory into the project root."
|
|
43
|
+
],
|
|
44
|
+
notes: [
|
|
45
|
+
"Cursor consumes the generated CodeGuard rule files from .cursor/rules.",
|
|
46
|
+
"CodeGuard also emits a Cursor reviewer subagent for explicit security scans."
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
windsurf: {
|
|
50
|
+
supported: true,
|
|
51
|
+
route: "rule-files",
|
|
52
|
+
releaseArtifact: "codeguard-windsurf.zip",
|
|
53
|
+
installPaths: [`${project}/.windsurf/rules`],
|
|
54
|
+
commands: [
|
|
55
|
+
"Download codeguard-windsurf.zip from the CodeGuard releases page.",
|
|
56
|
+
"Unzip it and copy the .windsurf/ directory into the project root."
|
|
57
|
+
],
|
|
58
|
+
notes: ["Windsurf's ready-to-use CodeGuard bundle is rule-file based, not an s-gw credential hook."]
|
|
59
|
+
},
|
|
60
|
+
copilot: {
|
|
61
|
+
supported: true,
|
|
62
|
+
route: "rule-files",
|
|
63
|
+
releaseArtifact: "codeguard-copilot.zip",
|
|
64
|
+
installPaths: [`${project}/.github/instructions`],
|
|
65
|
+
commands: [
|
|
66
|
+
"Download codeguard-copilot.zip from the CodeGuard releases page.",
|
|
67
|
+
"Unzip it and copy the .github/ directory into the project root."
|
|
68
|
+
],
|
|
69
|
+
notes: ["This is repository instruction content for GitHub Copilot, separate from the s-gw MCP server registration."]
|
|
70
|
+
},
|
|
71
|
+
vscode: {
|
|
72
|
+
supported: true,
|
|
73
|
+
route: "rule-files",
|
|
74
|
+
releaseArtifact: "codeguard-copilot.zip",
|
|
75
|
+
installPaths: [`${project}/.github/instructions`],
|
|
76
|
+
commands: [
|
|
77
|
+
"Download codeguard-copilot.zip from the CodeGuard releases page.",
|
|
78
|
+
"Unzip it and copy the .github/ directory into the project root."
|
|
79
|
+
],
|
|
80
|
+
notes: ["VS Code Copilot Agent Mode can share GitHub Copilot repository instructions."]
|
|
81
|
+
},
|
|
82
|
+
antigravity: {
|
|
83
|
+
supported: true,
|
|
84
|
+
route: "rule-files",
|
|
85
|
+
releaseArtifact: "codeguard-antigravity.zip",
|
|
86
|
+
installPaths: [`${project}/.agents/rules`],
|
|
87
|
+
commands: [
|
|
88
|
+
"Download codeguard-antigravity.zip from the CodeGuard releases page.",
|
|
89
|
+
"Unzip it and copy the .agents/rules/ directory into the project root."
|
|
90
|
+
],
|
|
91
|
+
notes: ["Antigravity uses .agents/rules for CodeGuard rules; Codex uses .agents/skills in the same top-level directory."]
|
|
92
|
+
},
|
|
93
|
+
opencode: {
|
|
94
|
+
supported: true,
|
|
95
|
+
route: "agent-skill",
|
|
96
|
+
releaseArtifact: "codeguard-opencode.zip",
|
|
97
|
+
installPaths: [`${project}/.opencode/skills/codeguard`],
|
|
98
|
+
commands: [
|
|
99
|
+
"Download codeguard-opencode.zip from the CodeGuard releases page.",
|
|
100
|
+
"Unzip it and copy the .opencode/ directory into the project root."
|
|
101
|
+
],
|
|
102
|
+
notes: [
|
|
103
|
+
"OpenCode can also load remote instruction URLs, but project-local skills are easier to audit and pin."
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
openclaw: {
|
|
107
|
+
supported: true,
|
|
108
|
+
route: "agent-skill",
|
|
109
|
+
releaseArtifact: "codeguard-openclaw.zip",
|
|
110
|
+
installPaths: [`${project}/.openclaw/skills/codeguard`],
|
|
111
|
+
commands: [
|
|
112
|
+
"Download codeguard-openclaw.zip from the CodeGuard releases page.",
|
|
113
|
+
"Unzip it and copy the .openclaw/ directory into the project root."
|
|
114
|
+
],
|
|
115
|
+
notes: ["OpenClaw uses the Agent Skills layout for CodeGuard."]
|
|
116
|
+
},
|
|
117
|
+
hermes: {
|
|
118
|
+
supported: true,
|
|
119
|
+
route: "agent-skill",
|
|
120
|
+
releaseArtifact: "codeguard-hermes.zip",
|
|
121
|
+
installPaths: [`${project}/.hermes/skills/codeguard`],
|
|
122
|
+
commands: [
|
|
123
|
+
"Download codeguard-hermes.zip from the CodeGuard releases page.",
|
|
124
|
+
"Unzip it and copy the .hermes/ directory into the project root."
|
|
125
|
+
],
|
|
126
|
+
notes: ["Hermes uses the Agent Skills layout for CodeGuard."]
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
export const agentProfiles = [
|
|
130
|
+
{
|
|
131
|
+
id: "openclaw",
|
|
132
|
+
displayName: "OpenClaw",
|
|
133
|
+
aliases: ["open-claw"],
|
|
134
|
+
defenseClawConnector: "openclaw",
|
|
135
|
+
mcp: {
|
|
136
|
+
supported: true,
|
|
137
|
+
status: "manual",
|
|
138
|
+
snippet: "json",
|
|
139
|
+
writeMode: "manual",
|
|
140
|
+
configPaths: [`${home}/.openclaw/openclaw.json`],
|
|
141
|
+
notes: ["Preferred write path is OpenClaw's own config command or UI; avoid hand-editing while OpenClaw is running."]
|
|
142
|
+
},
|
|
143
|
+
skills: {
|
|
144
|
+
supported: true,
|
|
145
|
+
configPaths: [`${project}/.openclaw/skills`, `${home}/.openclaw/workspace/skills`, `${home}/.openclaw/skills`],
|
|
146
|
+
notes: ["OpenClaw may add extra skill directories from openclaw.json."]
|
|
147
|
+
},
|
|
148
|
+
plugins: {
|
|
149
|
+
supported: true,
|
|
150
|
+
configPaths: [`${home}/.openclaw/extensions`],
|
|
151
|
+
notes: ["A future native extension can surface s-gw approval status inside OpenClaw."]
|
|
152
|
+
},
|
|
153
|
+
hooks: {
|
|
154
|
+
supported: false,
|
|
155
|
+
kind: "proxy",
|
|
156
|
+
configPaths: [],
|
|
157
|
+
events: [],
|
|
158
|
+
notes: ["DefenseClaw treats OpenClaw as a proxy connector, not a native hook connector."]
|
|
159
|
+
},
|
|
160
|
+
limitations: ["s-gw currently uses MCP tools with local approval, not an OpenClaw fetch interceptor."]
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
id: "zeptoclaw",
|
|
164
|
+
displayName: "ZeptoClaw",
|
|
165
|
+
aliases: ["zepto-claw"],
|
|
166
|
+
defenseClawConnector: "zeptoclaw",
|
|
167
|
+
mcp: {
|
|
168
|
+
supported: true,
|
|
169
|
+
status: "manual",
|
|
170
|
+
snippet: "json",
|
|
171
|
+
writeMode: "manual",
|
|
172
|
+
configPaths: [`${home}/.zeptoclaw/config.json`, `${project}/.mcp.json`],
|
|
173
|
+
notes: ["DefenseClaw treats ZeptoClaw MCP writes as manual because the ZeptoClaw app owns config autosave."]
|
|
174
|
+
},
|
|
175
|
+
skills: {
|
|
176
|
+
supported: true,
|
|
177
|
+
configPaths: [`${home}/.zeptoclaw/skills`, `${project}/.zeptoclaw/skills`],
|
|
178
|
+
notes: []
|
|
179
|
+
},
|
|
180
|
+
plugins: {
|
|
181
|
+
supported: true,
|
|
182
|
+
configPaths: [`${home}/.zeptoclaw/plugins`, `${home}/.zeptoclaw/plugins/cache`],
|
|
183
|
+
notes: []
|
|
184
|
+
},
|
|
185
|
+
hooks: {
|
|
186
|
+
supported: false,
|
|
187
|
+
kind: "proxy",
|
|
188
|
+
configPaths: [],
|
|
189
|
+
events: [],
|
|
190
|
+
notes: ["DefenseClaw treats ZeptoClaw as a proxy connector, not a native hook connector."]
|
|
191
|
+
},
|
|
192
|
+
limitations: ["No automatic ZeptoClaw config patching yet."]
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
id: "claudecode",
|
|
196
|
+
displayName: "Claude Code",
|
|
197
|
+
aliases: ["claude", "claude-code"],
|
|
198
|
+
defenseClawConnector: "claudecode",
|
|
199
|
+
mcp: {
|
|
200
|
+
supported: true,
|
|
201
|
+
status: "supported",
|
|
202
|
+
snippet: "json",
|
|
203
|
+
writeMode: "manual",
|
|
204
|
+
// Claude Code reads MCP servers from `.mcp.json` (project scope, the shape this
|
|
205
|
+
// snippet emits) or `~/.claude.json` via `claude mcp add` - NOT `settings.json`,
|
|
206
|
+
// which only holds hooks/permissions/env.
|
|
207
|
+
configPaths: [`${project}/.mcp.json`, `${home}/.claude.json`],
|
|
208
|
+
notes: [
|
|
209
|
+
"Recommended: `claude mcp add --transport stdio --scope user s-gw -- s-gw-mcp` (writes ~/.claude.json).",
|
|
210
|
+
"Or commit this snippet as project-scoped `.mcp.json`. Do not paste it into ~/.claude/settings.json; Claude Code does not read MCP servers from settings.json."
|
|
211
|
+
]
|
|
212
|
+
},
|
|
213
|
+
skills: {
|
|
214
|
+
supported: true,
|
|
215
|
+
configPaths: [`${home}/.claude/skills`, `${project}/.claude/skills`],
|
|
216
|
+
notes: []
|
|
217
|
+
},
|
|
218
|
+
plugins: {
|
|
219
|
+
supported: true,
|
|
220
|
+
configPaths: [`${home}/.claude/plugins`, `${project}/.claude/plugins`],
|
|
221
|
+
notes: []
|
|
222
|
+
},
|
|
223
|
+
hooks: {
|
|
224
|
+
supported: true,
|
|
225
|
+
kind: "hook",
|
|
226
|
+
configPaths: [`${home}/.claude/settings.json`, `${project}/.claude/settings.json`],
|
|
227
|
+
events: ["UserPromptSubmit", "PreToolUse", "PermissionRequest", "PostToolUse", "Stop"],
|
|
228
|
+
notes: ["DefenseClaw writes Claude Code hooks and telemetry env there; keep MCP config separate."]
|
|
229
|
+
},
|
|
230
|
+
limitations: []
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
id: "codex",
|
|
234
|
+
displayName: "Codex",
|
|
235
|
+
aliases: ["openai-codex"],
|
|
236
|
+
defenseClawConnector: "codex",
|
|
237
|
+
mcp: {
|
|
238
|
+
supported: true,
|
|
239
|
+
status: "supported",
|
|
240
|
+
snippet: "toml",
|
|
241
|
+
writeMode: "safe",
|
|
242
|
+
configPaths: [`${home}/.codex/config.toml`, `${project}/.mcp.json`],
|
|
243
|
+
notes: ["Codex can use a global config.toml MCP server or project-local .mcp.json."]
|
|
244
|
+
},
|
|
245
|
+
skills: {
|
|
246
|
+
supported: true,
|
|
247
|
+
configPaths: [`${home}/.codex/skills`, `${project}/.agents/skills`],
|
|
248
|
+
notes: [
|
|
249
|
+
"User-level Codex skills can live under CODEX_HOME (~/.codex/skills by default).",
|
|
250
|
+
"Project-local Codex skills should use .agents/skills; project-local .codex/skills is not a documented discovery path."
|
|
251
|
+
]
|
|
252
|
+
},
|
|
253
|
+
plugins: {
|
|
254
|
+
supported: true,
|
|
255
|
+
configPaths: [`${home}/.codex/plugins`, `${home}/.codex/plugins/cache`],
|
|
256
|
+
notes: ["s-gw already ships a Codex plugin manifest."]
|
|
257
|
+
},
|
|
258
|
+
hooks: {
|
|
259
|
+
supported: true,
|
|
260
|
+
kind: "hook",
|
|
261
|
+
configPaths: [`${home}/.codex/config.toml`],
|
|
262
|
+
events: ["SessionStart", "UserPromptSubmit", "PreToolUse", "PermissionRequest", "PostToolUse", "Stop", "Notify"],
|
|
263
|
+
notes: ["DefenseClaw wires Codex hooks, native OTel, and notify bridge in config.toml."]
|
|
264
|
+
},
|
|
265
|
+
limitations: ["s-gw does not rely on Codex hook tables; MCP tools carry the workflow."]
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
id: "hermes",
|
|
269
|
+
displayName: "Hermes Agent",
|
|
270
|
+
aliases: ["hermes-agent"],
|
|
271
|
+
defenseClawConnector: "hermes",
|
|
272
|
+
mcp: {
|
|
273
|
+
supported: true,
|
|
274
|
+
status: "manual",
|
|
275
|
+
snippet: "yaml",
|
|
276
|
+
writeMode: "manual",
|
|
277
|
+
configPaths: [`${home}/.hermes/config.yaml`],
|
|
278
|
+
notes: ["Hermes MCP configuration is YAML-shaped."]
|
|
279
|
+
},
|
|
280
|
+
skills: {
|
|
281
|
+
supported: true,
|
|
282
|
+
configPaths: [`${project}/.hermes/skills`, `${home}/.hermes/skills`],
|
|
283
|
+
notes: []
|
|
284
|
+
},
|
|
285
|
+
plugins: {
|
|
286
|
+
supported: true,
|
|
287
|
+
configPaths: [`${home}/.hermes/plugins`, `${project}/.hermes/plugins`],
|
|
288
|
+
notes: []
|
|
289
|
+
},
|
|
290
|
+
hooks: {
|
|
291
|
+
supported: true,
|
|
292
|
+
kind: "hook",
|
|
293
|
+
configPaths: [`${home}/.hermes/config.yaml`],
|
|
294
|
+
events: ["pre_llm_call", "pre_tool_call", "post_tool_call", "post_llm_call", "on_session_start", "on_session_end", "subagent_stop"],
|
|
295
|
+
notes: ["Hermes can block pre_tool_call; native ask is not available in DefenseClaw's current contract."]
|
|
296
|
+
},
|
|
297
|
+
limitations: ["No automatic YAML patcher yet."]
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
id: "cursor",
|
|
301
|
+
displayName: "Cursor",
|
|
302
|
+
aliases: [],
|
|
303
|
+
defenseClawConnector: "cursor",
|
|
304
|
+
mcp: {
|
|
305
|
+
supported: true,
|
|
306
|
+
status: "supported",
|
|
307
|
+
snippet: "json",
|
|
308
|
+
writeMode: "safe",
|
|
309
|
+
configPaths: [`${project}/.cursor/mcp.json`, `${home}/.cursor/mcp.json`],
|
|
310
|
+
notes: ["Project-local Cursor MCP config is preferred for team reproducibility."]
|
|
311
|
+
},
|
|
312
|
+
skills: {
|
|
313
|
+
supported: true,
|
|
314
|
+
configPaths: [`${project}/.cursor/skills`, `${project}/.agents/skills`, `${home}/.cursor/skills`, `${home}/.agents/skills`],
|
|
315
|
+
notes: []
|
|
316
|
+
},
|
|
317
|
+
plugins: {
|
|
318
|
+
supported: false,
|
|
319
|
+
configPaths: [],
|
|
320
|
+
notes: []
|
|
321
|
+
},
|
|
322
|
+
hooks: {
|
|
323
|
+
supported: true,
|
|
324
|
+
kind: "hook",
|
|
325
|
+
configPaths: [`${home}/.cursor/hooks.json`],
|
|
326
|
+
events: ["beforeShellExecution", "beforeMCPExecution", "beforeReadFile", "beforeTabFileRead", "beforeSubmitPrompt", "stop"],
|
|
327
|
+
notes: ["Cursor supports native ask only on beforeShellExecution and beforeMCPExecution."]
|
|
328
|
+
},
|
|
329
|
+
limitations: []
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
id: "windsurf",
|
|
333
|
+
displayName: "Windsurf",
|
|
334
|
+
aliases: ["codeium-windsurf"],
|
|
335
|
+
defenseClawConnector: "windsurf",
|
|
336
|
+
mcp: {
|
|
337
|
+
supported: true,
|
|
338
|
+
status: "manual",
|
|
339
|
+
snippet: "json",
|
|
340
|
+
writeMode: "manual",
|
|
341
|
+
configPaths: [`${home}/.codeium/windsurf/mcp_config.json`, `${home}/.codeium/windsurf/mcp.json`],
|
|
342
|
+
notes: ["DefenseClaw only writes Windsurf MCP config when an existing documented file is present."]
|
|
343
|
+
},
|
|
344
|
+
skills: {
|
|
345
|
+
supported: false,
|
|
346
|
+
configPaths: [],
|
|
347
|
+
notes: []
|
|
348
|
+
},
|
|
349
|
+
plugins: {
|
|
350
|
+
supported: false,
|
|
351
|
+
configPaths: [],
|
|
352
|
+
notes: []
|
|
353
|
+
},
|
|
354
|
+
hooks: {
|
|
355
|
+
supported: true,
|
|
356
|
+
kind: "hook",
|
|
357
|
+
configPaths: [`${home}/.codeium/windsurf/hooks.json`],
|
|
358
|
+
events: ["pre_user_prompt", "pre_read_code", "pre_write_code", "pre_run_command", "pre_mcp_tool_use"],
|
|
359
|
+
notes: ["Windsurf can block through Cascade hooks; native ask is not available in DefenseClaw's current contract."]
|
|
360
|
+
},
|
|
361
|
+
limitations: ["Do not guess new Windsurf config paths during install."]
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
id: "geminicli",
|
|
365
|
+
displayName: "Gemini CLI",
|
|
366
|
+
aliases: ["gemini", "gemini-cli"],
|
|
367
|
+
defenseClawConnector: "geminicli",
|
|
368
|
+
mcp: {
|
|
369
|
+
supported: true,
|
|
370
|
+
status: "supported",
|
|
371
|
+
snippet: "json",
|
|
372
|
+
writeMode: "safe",
|
|
373
|
+
configPaths: [`${home}/.gemini/settings.json`, `${project}/.gemini/settings.json`],
|
|
374
|
+
notes: ["Gemini CLI reads MCP servers from settings.json."]
|
|
375
|
+
},
|
|
376
|
+
skills: {
|
|
377
|
+
supported: true,
|
|
378
|
+
configPaths: [`${project}/.gemini/skills`, `${project}/.agents/skills`],
|
|
379
|
+
notes: []
|
|
380
|
+
},
|
|
381
|
+
plugins: {
|
|
382
|
+
supported: true,
|
|
383
|
+
configPaths: [`${project}/.gemini/extensions`, `${home}/.gemini/extensions`],
|
|
384
|
+
notes: []
|
|
385
|
+
},
|
|
386
|
+
hooks: {
|
|
387
|
+
supported: true,
|
|
388
|
+
kind: "hook",
|
|
389
|
+
configPaths: [`${home}/.gemini/settings.json`],
|
|
390
|
+
events: ["BeforeAgent", "BeforeModel", "BeforeTool", "AfterTool", "AfterAgent"],
|
|
391
|
+
notes: ["Gemini CLI has no native ask surface in DefenseClaw's current contract."]
|
|
392
|
+
},
|
|
393
|
+
limitations: []
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
id: "copilot",
|
|
397
|
+
displayName: "GitHub Copilot CLI",
|
|
398
|
+
aliases: ["copilot-cli", "github-copilot", "github-copilot-cli"],
|
|
399
|
+
defenseClawConnector: "copilot",
|
|
400
|
+
mcp: {
|
|
401
|
+
supported: true,
|
|
402
|
+
status: "supported",
|
|
403
|
+
snippet: "json",
|
|
404
|
+
writeMode: "safe",
|
|
405
|
+
configPaths: [`${home}/.copilot/mcp-config.json`, `${project}/.github/mcp.json`, `${project}/.mcp.json`],
|
|
406
|
+
notes: ["Workspace .github/mcp.json is the safest install target when present."]
|
|
407
|
+
},
|
|
408
|
+
skills: {
|
|
409
|
+
supported: true,
|
|
410
|
+
configPaths: [`${project}/.github/skills`, `${project}/.agents/skills`, `${home}/.copilot/skills`],
|
|
411
|
+
notes: []
|
|
412
|
+
},
|
|
413
|
+
plugins: {
|
|
414
|
+
supported: true,
|
|
415
|
+
configPaths: ["Copilot CLI marketplace/plugin flow"],
|
|
416
|
+
notes: []
|
|
417
|
+
},
|
|
418
|
+
hooks: {
|
|
419
|
+
supported: true,
|
|
420
|
+
kind: "hook",
|
|
421
|
+
configPaths: [`${home}/.copilot/hooks/defenseclaw.json`, `${project}/.github/hooks/defenseclaw.json`],
|
|
422
|
+
events: ["preToolUse", "permissionRequest", "agentStop", "subagentStop", "postToolUseFailure"],
|
|
423
|
+
notes: ["Copilot CLI supports native ask on preToolUse."]
|
|
424
|
+
},
|
|
425
|
+
limitations: []
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
id: "openhands",
|
|
429
|
+
displayName: "OpenHands",
|
|
430
|
+
aliases: ["open-hands"],
|
|
431
|
+
defenseClawConnector: "openhands",
|
|
432
|
+
mcp: {
|
|
433
|
+
supported: true,
|
|
434
|
+
status: "manual",
|
|
435
|
+
snippet: "json",
|
|
436
|
+
writeMode: "manual",
|
|
437
|
+
configPaths: [`${home}/.openhands/mcp.json`],
|
|
438
|
+
notes: ["DefenseClaw discovers OpenHands MCP servers from ~/.openhands/mcp.json; hooks are configured separately."]
|
|
439
|
+
},
|
|
440
|
+
skills: {
|
|
441
|
+
supported: true,
|
|
442
|
+
configPaths: [
|
|
443
|
+
`${project}/.agents/skills`,
|
|
444
|
+
`${project}/.openhands/skills`,
|
|
445
|
+
`${project}/.openhands/microagents`,
|
|
446
|
+
`${home}/.agents/skills`,
|
|
447
|
+
`${home}/.openhands/skills`,
|
|
448
|
+
`${home}/.openhands/microagents`,
|
|
449
|
+
`${home}/.openhands/skills/installed`,
|
|
450
|
+
`${home}/.openhands/cache/skills/public-skills/skills`
|
|
451
|
+
],
|
|
452
|
+
notes: ["OpenHands has no documented plugin install surface; skills and microagents are discovery surfaces."]
|
|
453
|
+
},
|
|
454
|
+
plugins: {
|
|
455
|
+
supported: false,
|
|
456
|
+
configPaths: [],
|
|
457
|
+
notes: []
|
|
458
|
+
},
|
|
459
|
+
hooks: {
|
|
460
|
+
supported: true,
|
|
461
|
+
kind: "hook",
|
|
462
|
+
configPaths: [`${home}/.openhands/hooks.json`, `${project}/.openhands/hooks.json`],
|
|
463
|
+
events: ["user_prompt_submit", "pre_tool_use", "post_tool_use", "stop"],
|
|
464
|
+
notes: ["OpenHands can deny supported hook events but has no native ask/approval surface."]
|
|
465
|
+
},
|
|
466
|
+
limitations: ["Profile borrowed from DefenseClaw 0.8.3; s-gw has not run a hands-on OpenHands smoke test yet."]
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
id: "antigravity",
|
|
470
|
+
displayName: "Antigravity",
|
|
471
|
+
aliases: ["agy", "google-antigravity"],
|
|
472
|
+
defenseClawConnector: "antigravity",
|
|
473
|
+
mcp: {
|
|
474
|
+
supported: true,
|
|
475
|
+
status: "manual",
|
|
476
|
+
snippet: "json",
|
|
477
|
+
writeMode: "manual",
|
|
478
|
+
configPaths: [`${home}/.gemini/config/mcp_config.json`, `${project}/.agents/mcp_config.json`],
|
|
479
|
+
notes: ["Antigravity uses mcp_config.json with a top-level mcpServers object; hooks live in a separate global hooks.json file."]
|
|
480
|
+
},
|
|
481
|
+
skills: {
|
|
482
|
+
supported: true,
|
|
483
|
+
configPaths: [
|
|
484
|
+
`${project}/.agents/skills`,
|
|
485
|
+
`${project}/_agents/skills`,
|
|
486
|
+
`${home}/.gemini/antigravity-cli/skills`,
|
|
487
|
+
`${home}/.gemini/skills`,
|
|
488
|
+
`${home}/.agents/skills`
|
|
489
|
+
],
|
|
490
|
+
notes: ["DefenseClaw also scans plugin-contained skills when plugin directories exist."]
|
|
491
|
+
},
|
|
492
|
+
plugins: {
|
|
493
|
+
supported: true,
|
|
494
|
+
configPaths: [
|
|
495
|
+
`${project}/.agents/plugins`,
|
|
496
|
+
`${project}/_agents/plugins`,
|
|
497
|
+
`${home}/.gemini/config/plugins`,
|
|
498
|
+
`${home}/.gemini/antigravity-cli/plugins`
|
|
499
|
+
],
|
|
500
|
+
notes: ["DefenseClaw treats plugin-contained agents as discovery surfaces until Google publishes stable install semantics."]
|
|
501
|
+
},
|
|
502
|
+
hooks: {
|
|
503
|
+
supported: true,
|
|
504
|
+
kind: "hook",
|
|
505
|
+
configPaths: [`${home}/.gemini/config/hooks.json`],
|
|
506
|
+
events: ["PreInvocation", "PreToolUse", "PostToolUse", "PostInvocation", "Stop"],
|
|
507
|
+
notes: ["DefenseClaw writes only the canonical global hook path to avoid duplicate hook firings; decision=ask can force Antigravity's native prompt."]
|
|
508
|
+
},
|
|
509
|
+
limitations: ["Profile borrowed from DefenseClaw 0.8.3; s-gw has not installed or verified Antigravity hooks yet."]
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
id: "opencode",
|
|
513
|
+
displayName: "OpenCode",
|
|
514
|
+
aliases: ["open-code"],
|
|
515
|
+
defenseClawConnector: "opencode",
|
|
516
|
+
mcp: {
|
|
517
|
+
supported: true,
|
|
518
|
+
status: "supported",
|
|
519
|
+
snippet: "jsonc",
|
|
520
|
+
writeMode: "manual",
|
|
521
|
+
configPaths: [`${home}/.config/opencode/opencode.json`, `${home}/.config/opencode/opencode.jsonc`, `${project}/opencode.json`, `${project}/opencode.jsonc`],
|
|
522
|
+
notes: ["OpenCode stores MCP servers under a top-level `mcp` map; local server commands are argv arrays."]
|
|
523
|
+
},
|
|
524
|
+
skills: {
|
|
525
|
+
supported: true,
|
|
526
|
+
configPaths: [
|
|
527
|
+
`${project}/.opencode/skills`,
|
|
528
|
+
`${project}/.claude/skills`,
|
|
529
|
+
`${project}/.agents/skills`,
|
|
530
|
+
`${home}/.config/opencode/skills`,
|
|
531
|
+
`${home}/.claude/skills`,
|
|
532
|
+
`${home}/.agents/skills`,
|
|
533
|
+
"$OPENCODE_CONFIG_DIR/skills"
|
|
534
|
+
],
|
|
535
|
+
notes: ["DefenseClaw profiles these as discovery surfaces; s-gw does not install OpenCode skills yet."]
|
|
536
|
+
},
|
|
537
|
+
plugins: {
|
|
538
|
+
supported: true,
|
|
539
|
+
configPaths: [`${project}/.opencode/plugins`, `${home}/.config/opencode/plugins`, "$OPENCODE_CONFIG_DIR/plugins"],
|
|
540
|
+
notes: ["OpenCode auto-loads local plugins from ~/.config/opencode/plugins."]
|
|
541
|
+
},
|
|
542
|
+
hooks: {
|
|
543
|
+
supported: true,
|
|
544
|
+
kind: "plugin",
|
|
545
|
+
configPaths: [`${home}/.config/opencode/plugins/defenseclaw.js`],
|
|
546
|
+
events: ["tool.execute.before", "tool.execute.after"],
|
|
547
|
+
notes: ["DefenseClaw blocks OpenCode by throwing from a JS bridge plugin; OpenCode has no hook-driven native ask surface."]
|
|
548
|
+
},
|
|
549
|
+
limitations: []
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
id: "omnigent",
|
|
553
|
+
displayName: "OmniGent",
|
|
554
|
+
aliases: ["omni-gent", "omniagent", "omni-agent"],
|
|
555
|
+
defenseClawConnector: "omnigent",
|
|
556
|
+
mcp: {
|
|
557
|
+
supported: false,
|
|
558
|
+
status: "planned",
|
|
559
|
+
snippet: "text",
|
|
560
|
+
writeMode: "unknown",
|
|
561
|
+
configPaths: ["$OMNIGENT_CONFIG_HOME/config.yaml", `${home}/.omnigent/config.yaml`],
|
|
562
|
+
notes: ["DefenseClaw integrates OmniGent through a custom Python policy bridge, not by writing a normal MCP server entry."]
|
|
563
|
+
},
|
|
564
|
+
skills: {
|
|
565
|
+
supported: false,
|
|
566
|
+
configPaths: [],
|
|
567
|
+
notes: ["DefenseClaw v1 does not modify OmniGent skill, rule, plugin, MCP, or agent-bundle configuration."]
|
|
568
|
+
},
|
|
569
|
+
plugins: {
|
|
570
|
+
supported: false,
|
|
571
|
+
configPaths: [],
|
|
572
|
+
notes: []
|
|
573
|
+
},
|
|
574
|
+
hooks: {
|
|
575
|
+
supported: true,
|
|
576
|
+
kind: "policy",
|
|
577
|
+
configPaths: ["$OMNIGENT_CONFIG_HOME/config.yaml", `${home}/.omnigent/config.yaml`],
|
|
578
|
+
events: ["request", "tool_call", "tool_result", "response", "llm_request", "llm_response"],
|
|
579
|
+
notes: ["OmniGent has native ASK on pre-action phases through its custom policy API; s-gw needs a policy bridge before public support."]
|
|
580
|
+
},
|
|
581
|
+
limitations: ["No s-gw MCP snippet yet; this profile is a roadmap marker for an OmniGent policy bridge."]
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
id: "vscode",
|
|
585
|
+
displayName: "VS Code / GitHub Copilot Agent Mode",
|
|
586
|
+
aliases: ["vs-code", "github-copilot-agent", "copilot-agent"],
|
|
587
|
+
mcp: {
|
|
588
|
+
supported: true,
|
|
589
|
+
status: "supported",
|
|
590
|
+
snippet: "json",
|
|
591
|
+
writeMode: "safe",
|
|
592
|
+
configPaths: [`${project}/.vscode/mcp.json`],
|
|
593
|
+
notes: ["VS Code is not a DefenseClaw built-in connector, but it supports workspace MCP server config."]
|
|
594
|
+
},
|
|
595
|
+
skills: {
|
|
596
|
+
supported: false,
|
|
597
|
+
configPaths: [],
|
|
598
|
+
notes: []
|
|
599
|
+
},
|
|
600
|
+
plugins: {
|
|
601
|
+
supported: false,
|
|
602
|
+
configPaths: [],
|
|
603
|
+
notes: []
|
|
604
|
+
},
|
|
605
|
+
hooks: {
|
|
606
|
+
supported: false,
|
|
607
|
+
kind: "none",
|
|
608
|
+
configPaths: [],
|
|
609
|
+
events: [],
|
|
610
|
+
notes: ["s-gw currently treats VS Code through MCP only."]
|
|
611
|
+
},
|
|
612
|
+
limitations: []
|
|
613
|
+
}
|
|
614
|
+
];
|
|
615
|
+
export function listAgentProfiles() {
|
|
616
|
+
return agentProfiles.map((profile) => ({
|
|
617
|
+
id: profile.id,
|
|
618
|
+
displayName: profile.displayName,
|
|
619
|
+
aliases: profile.aliases,
|
|
620
|
+
defenseClawConnector: profile.defenseClawConnector,
|
|
621
|
+
mcpStatus: profile.mcp.status,
|
|
622
|
+
mcpConfigPaths: profile.mcp.configPaths,
|
|
623
|
+
hookKind: profile.hooks?.kind,
|
|
624
|
+
hookConfigPaths: profile.hooks?.configPaths || [],
|
|
625
|
+
hookEvents: profile.hooks?.events || [],
|
|
626
|
+
codeGuardRoute: codeGuardPlans[profile.id]?.route || "not-available",
|
|
627
|
+
codeGuardInstallPaths: codeGuardPlans[profile.id]?.installPaths || []
|
|
628
|
+
}));
|
|
629
|
+
}
|
|
630
|
+
export function resolveAgentProfile(input) {
|
|
631
|
+
const wanted = normalizeAgentName(input);
|
|
632
|
+
const found = agentProfiles.find((profile) => {
|
|
633
|
+
if (profile.id === wanted) {
|
|
634
|
+
return true;
|
|
635
|
+
}
|
|
636
|
+
if (profile.defenseClawConnector === wanted) {
|
|
637
|
+
return true;
|
|
638
|
+
}
|
|
639
|
+
return profile.aliases.some((alias) => normalizeAgentName(alias) === wanted);
|
|
640
|
+
});
|
|
641
|
+
if (!found) {
|
|
642
|
+
throw new Error(`Unknown agent '${input}'. Run 's-gw agent list' to see known profiles.`);
|
|
643
|
+
}
|
|
644
|
+
return found;
|
|
645
|
+
}
|
|
646
|
+
export function renderAgentMcpSnippet(input, options = {}) {
|
|
647
|
+
const profile = resolveAgentProfile(input);
|
|
648
|
+
if (!profile.mcp.supported) {
|
|
649
|
+
throw new Error(`${profile.displayName} does not have a supported s-gw MCP snippet yet.`);
|
|
650
|
+
}
|
|
651
|
+
const server = buildServerEntry(options, profile.displayName);
|
|
652
|
+
const name = options.serverName || "s-gw";
|
|
653
|
+
if (profile.id === "codex") {
|
|
654
|
+
return renderCodexToml(name, server);
|
|
655
|
+
}
|
|
656
|
+
if (profile.id === "opencode") {
|
|
657
|
+
return renderOpenCodeJsonc(name, server);
|
|
658
|
+
}
|
|
659
|
+
if (profile.id === "vscode") {
|
|
660
|
+
return renderVSCodeJson(name, server);
|
|
661
|
+
}
|
|
662
|
+
if (profile.id === "hermes") {
|
|
663
|
+
return renderHermesYaml(name, server);
|
|
664
|
+
}
|
|
665
|
+
if (profile.id === "openclaw" || profile.id === "zeptoclaw") {
|
|
666
|
+
return JSON.stringify({ mcp: { servers: { [name]: server } } }, null, 2);
|
|
667
|
+
}
|
|
668
|
+
return JSON.stringify({ mcpServers: { [name]: server } }, null, 2);
|
|
669
|
+
}
|
|
670
|
+
export function getAgentCodeGuardPlan(input) {
|
|
671
|
+
const profile = resolveAgentProfile(input);
|
|
672
|
+
const plan = codeGuardPlans[profile.id];
|
|
673
|
+
if (!plan) {
|
|
674
|
+
return {
|
|
675
|
+
agentId: profile.id,
|
|
676
|
+
displayName: profile.displayName,
|
|
677
|
+
supported: false,
|
|
678
|
+
route: "not-available",
|
|
679
|
+
sourceRepo: codeGuardSourceRepo,
|
|
680
|
+
installPaths: [],
|
|
681
|
+
commands: [],
|
|
682
|
+
notes: [
|
|
683
|
+
"Project CodeGuard does not publish a ready-to-use bundle for this agent yet.",
|
|
684
|
+
"Keep using s-gw MCP/guard mode for local secret handling; add CodeGuard only through a documented rule or skill surface."
|
|
685
|
+
]
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
return {
|
|
689
|
+
agentId: profile.id,
|
|
690
|
+
displayName: profile.displayName,
|
|
691
|
+
sourceRepo: codeGuardSourceRepo,
|
|
692
|
+
...plan
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
function normalizeAgentName(input) {
|
|
696
|
+
return input.trim().toLowerCase().replace(/[\s_]+/g, "-").replace(/^-+|-+$/g, "");
|
|
697
|
+
}
|
|
698
|
+
function buildServerEntry(options, agentName) {
|
|
699
|
+
return {
|
|
700
|
+
command: options.command || "s-gw-mcp",
|
|
701
|
+
args: options.args || [],
|
|
702
|
+
env: {
|
|
703
|
+
SGW_HOME: "~/.s-gw",
|
|
704
|
+
SGW_AGENT_NAME: agentName,
|
|
705
|
+
...(options.env || {})
|
|
706
|
+
}
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
function renderCodexToml(name, server) {
|
|
710
|
+
const lines = [
|
|
711
|
+
`[mcp_servers.${name}]`,
|
|
712
|
+
`command = ${JSON.stringify(server.command)}`,
|
|
713
|
+
`args = ${JSON.stringify(server.args)}`
|
|
714
|
+
];
|
|
715
|
+
const envPairs = Object.entries(server.env).map(([key, value]) => `${key} = ${JSON.stringify(value)}`);
|
|
716
|
+
if (envPairs.length > 0) {
|
|
717
|
+
lines.push(`env = { ${envPairs.join(", ")} }`);
|
|
718
|
+
}
|
|
719
|
+
lines.push('startup_timeout_sec = 10', 'tool_timeout_sec = 60', 'default_tools_approval_mode = "prompt"');
|
|
720
|
+
return lines.join("\n");
|
|
721
|
+
}
|
|
722
|
+
function renderOpenCodeJsonc(name, server) {
|
|
723
|
+
return JSON.stringify({
|
|
724
|
+
$schema: "https://opencode.ai/config.json",
|
|
725
|
+
mcp: {
|
|
726
|
+
[name]: {
|
|
727
|
+
type: "local",
|
|
728
|
+
command: [server.command, ...server.args],
|
|
729
|
+
enabled: true,
|
|
730
|
+
environment: server.env
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
}, null, 2);
|
|
734
|
+
}
|
|
735
|
+
function renderVSCodeJson(name, server) {
|
|
736
|
+
return JSON.stringify({
|
|
737
|
+
servers: {
|
|
738
|
+
[name]: {
|
|
739
|
+
type: "stdio",
|
|
740
|
+
command: server.command,
|
|
741
|
+
args: server.args,
|
|
742
|
+
env: server.env
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
}, null, 2);
|
|
746
|
+
}
|
|
747
|
+
function renderHermesYaml(name, server) {
|
|
748
|
+
const lines = ["mcp:", " servers:", ` ${name}:`, ` command: ${server.command}`, " args:"];
|
|
749
|
+
if (server.args.length === 0) {
|
|
750
|
+
lines.push(" []");
|
|
751
|
+
}
|
|
752
|
+
else {
|
|
753
|
+
for (const arg of server.args) {
|
|
754
|
+
lines.push(` - ${JSON.stringify(arg)}`);
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
lines.push(" env:");
|
|
758
|
+
for (const [key, value] of Object.entries(server.env)) {
|
|
759
|
+
lines.push(` ${key}: ${JSON.stringify(value)}`);
|
|
760
|
+
}
|
|
761
|
+
return lines.join("\n");
|
|
762
|
+
}
|
|
763
|
+
//# sourceMappingURL=agents.js.map
|