@solongate/proxy 0.30.0 → 0.30.1
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/dist/index.js +16 -3
- package/dist/lib.js +16 -3
- package/hooks/audit.mjs +3 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6012,6 +6012,17 @@ var SolonGateProxy = class {
|
|
|
6012
6012
|
log2("WARNING:", w);
|
|
6013
6013
|
}
|
|
6014
6014
|
}
|
|
6015
|
+
/** Normalize well-known MCP client names to display-friendly agent identities */
|
|
6016
|
+
normalizeAgentName(raw) {
|
|
6017
|
+
const lower = raw.toLowerCase();
|
|
6018
|
+
if (lower.includes("cursor")) return { id: "cursor", name: "Cursor" };
|
|
6019
|
+
if (lower.includes("claude-code") || lower === "claude code") return { id: "claude-code", name: "Claude Code" };
|
|
6020
|
+
if (lower.includes("claude")) return { id: "claude-desktop", name: "Claude Desktop" };
|
|
6021
|
+
if (lower.includes("gemini")) return { id: "gemini-cli", name: "Gemini CLI" };
|
|
6022
|
+
if (lower.includes("antigravity")) return { id: "antigravity", name: "Antigravity" };
|
|
6023
|
+
if (lower.includes("perplexity")) return { id: "perplexity", name: "Perplexity" };
|
|
6024
|
+
return { id: raw.toLowerCase().replace(/\s+/g, "-"), name: raw };
|
|
6025
|
+
}
|
|
6015
6026
|
/** Extract sub-agent identity from MCP _meta field */
|
|
6016
6027
|
extractSubAgent(request) {
|
|
6017
6028
|
const meta = request?.params?._meta;
|
|
@@ -6208,10 +6219,12 @@ var SolonGateProxy = class {
|
|
|
6208
6219
|
this.server.oninitialized = () => {
|
|
6209
6220
|
if (this.server) {
|
|
6210
6221
|
const clientVersion = this.server.getClientVersion();
|
|
6222
|
+
log2(`MCP clientInfo raw: ${JSON.stringify(clientVersion)}`);
|
|
6211
6223
|
if (clientVersion?.name) {
|
|
6212
|
-
|
|
6213
|
-
this.
|
|
6214
|
-
|
|
6224
|
+
const normalized = this.normalizeAgentName(clientVersion.name);
|
|
6225
|
+
this.agentId = normalized.id;
|
|
6226
|
+
this.agentName = normalized.name;
|
|
6227
|
+
log2(`Agent identified from MCP clientInfo: ${this.agentName} (raw: ${clientVersion.name})`);
|
|
6215
6228
|
}
|
|
6216
6229
|
}
|
|
6217
6230
|
};
|
package/dist/lib.js
CHANGED
|
@@ -4252,6 +4252,17 @@ var SolonGateProxy = class {
|
|
|
4252
4252
|
log2("WARNING:", w);
|
|
4253
4253
|
}
|
|
4254
4254
|
}
|
|
4255
|
+
/** Normalize well-known MCP client names to display-friendly agent identities */
|
|
4256
|
+
normalizeAgentName(raw) {
|
|
4257
|
+
const lower = raw.toLowerCase();
|
|
4258
|
+
if (lower.includes("cursor")) return { id: "cursor", name: "Cursor" };
|
|
4259
|
+
if (lower.includes("claude-code") || lower === "claude code") return { id: "claude-code", name: "Claude Code" };
|
|
4260
|
+
if (lower.includes("claude")) return { id: "claude-desktop", name: "Claude Desktop" };
|
|
4261
|
+
if (lower.includes("gemini")) return { id: "gemini-cli", name: "Gemini CLI" };
|
|
4262
|
+
if (lower.includes("antigravity")) return { id: "antigravity", name: "Antigravity" };
|
|
4263
|
+
if (lower.includes("perplexity")) return { id: "perplexity", name: "Perplexity" };
|
|
4264
|
+
return { id: raw.toLowerCase().replace(/\s+/g, "-"), name: raw };
|
|
4265
|
+
}
|
|
4255
4266
|
/** Extract sub-agent identity from MCP _meta field */
|
|
4256
4267
|
extractSubAgent(request) {
|
|
4257
4268
|
const meta = request?.params?._meta;
|
|
@@ -4448,10 +4459,12 @@ var SolonGateProxy = class {
|
|
|
4448
4459
|
this.server.oninitialized = () => {
|
|
4449
4460
|
if (this.server) {
|
|
4450
4461
|
const clientVersion = this.server.getClientVersion();
|
|
4462
|
+
log2(`MCP clientInfo raw: ${JSON.stringify(clientVersion)}`);
|
|
4451
4463
|
if (clientVersion?.name) {
|
|
4452
|
-
|
|
4453
|
-
this.
|
|
4454
|
-
|
|
4464
|
+
const normalized = this.normalizeAgentName(clientVersion.name);
|
|
4465
|
+
this.agentId = normalized.id;
|
|
4466
|
+
this.agentName = normalized.name;
|
|
4467
|
+
log2(`Agent identified from MCP clientInfo: ${this.agentName} (raw: ${clientVersion.name})`);
|
|
4455
4468
|
}
|
|
4456
4469
|
}
|
|
4457
4470
|
};
|
package/hooks/audit.mjs
CHANGED
|
@@ -38,6 +38,9 @@ process.stdin.on('end', async () => {
|
|
|
38
38
|
try {
|
|
39
39
|
const data = JSON.parse(input);
|
|
40
40
|
|
|
41
|
+
// Debug: dump raw stdin to file for agent detection troubleshooting
|
|
42
|
+
try { writeFileSync(resolve('.solongate', '.debug-stdin'), JSON.stringify(data, null, 2)); } catch {}
|
|
43
|
+
|
|
41
44
|
// Auto-detect agent from stdin data (overrides CLI args if detected)
|
|
42
45
|
if (data.cursor_version) {
|
|
43
46
|
AGENT_ID = 'cursor';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solongate/proxy",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.1",
|
|
4
4
|
"description": "AI tool security proxy — protect any AI tool server with customizable policies, path/command constraints, rate limiting, and audit logging. Zero code changes required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|