@signetai/connector-gemini 0.231.0 → 0.231.2
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.d.ts.map +1 -1
- package/dist/index.js +35 -10
- package/package.json +3 -3
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EACN,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EACN,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,eAAe,EAOpB,MAAM,wBAAwB,CAAC;AAehC,qBAAa,eAAgB,SAAQ,aAAa;IACjD,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,SAAS,YAAY;IAE9B,YAAY,IAAI,MAAM;IAItB,OAAO,CAAC,aAAa;IAIrB,aAAa,IAAI,MAAM;IAIvB,OAAO,CAAC,eAAe;IAgBjB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAgEjD,SAAS,IAAI,OAAO,CAAC,eAAe,CAAC;IA2B3C,WAAW,IAAI,OAAO;IAOtB,MAAM,CAAC,kBAAkB,IAAI,OAAO;IAIpC,OAAO,CAAC,yBAAyB;IA4BjC,OAAO,CAAC,iBAAiB;IAgCzB,OAAO,CAAC,eAAe;IAqBvB,OAAO,CAAC,gBAAgB;CAqBxB;AAED,eAAO,MAAM,eAAe,iBAAwB,CAAC;AACrD,eAAe,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import { dirname as dirname4, join as join5, resolve as resolve4 } from "node:pa
|
|
|
17
17
|
import { randomBytes } from "node:crypto";
|
|
18
18
|
import { existsSync, readFileSync, realpathSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
19
19
|
import { homedir } from "node:os";
|
|
20
|
-
import { dirname as dirname2, isAbsolute, join as join3, relative, sep } from "node:path";
|
|
20
|
+
import { basename as basename2, dirname as dirname2, isAbsolute, join as join3, relative, sep } from "node:path";
|
|
21
21
|
import { createRequire } from "node:module";
|
|
22
22
|
import { dirname, join, resolve } from "node:path";
|
|
23
23
|
import { fileURLToPath } from "node:url";
|
|
@@ -17901,6 +17901,35 @@ function atomicWriteJson(path, data, indent = 2) {
|
|
|
17901
17901
|
atomicWriteText(path, `${JSON.stringify(data, null, indent)}
|
|
17902
17902
|
`);
|
|
17903
17903
|
}
|
|
17904
|
+
var SIGNET_MCP_STDIO_WORKER_ENV = "SIGNET_MCP_STDIO_WORKER";
|
|
17905
|
+
function resolveRunningNativeSignetBinary() {
|
|
17906
|
+
const executable = process.execPath;
|
|
17907
|
+
if (!/^signet(?:\.exe)?$/i.test(basename2(executable)))
|
|
17908
|
+
return null;
|
|
17909
|
+
try {
|
|
17910
|
+
return statSync(executable).isFile() ? executable : null;
|
|
17911
|
+
} catch {
|
|
17912
|
+
return null;
|
|
17913
|
+
}
|
|
17914
|
+
}
|
|
17915
|
+
function resolvePackagedSignetCommand(bareCommand, scriptDirectory, scriptName, warnOnFallback) {
|
|
17916
|
+
if (process.platform !== "win32")
|
|
17917
|
+
return { command: bareCommand, args: [] };
|
|
17918
|
+
const cliEntry = process.argv[1] ?? "";
|
|
17919
|
+
const scriptPath = join3(cliEntry, "..", "..", scriptDirectory, scriptName);
|
|
17920
|
+
if (cliEntry && existsSync(scriptPath))
|
|
17921
|
+
return { command: process.execPath, args: [scriptPath] };
|
|
17922
|
+
if (warnOnFallback) {
|
|
17923
|
+
console.warn(`[signet] Warning: could not resolve ${scriptName} from argv[1]="${cliEntry}". ` + `MCP server config will use "${bareCommand}" which may fail on Windows without shell:true.`);
|
|
17924
|
+
}
|
|
17925
|
+
return { command: bareCommand, args: [] };
|
|
17926
|
+
}
|
|
17927
|
+
function resolveSignetMcpCommand() {
|
|
17928
|
+
const nativeBinary = resolveRunningNativeSignetBinary();
|
|
17929
|
+
if (nativeBinary)
|
|
17930
|
+
return { command: nativeBinary, args: [], env: { [SIGNET_MCP_STDIO_WORKER_ENV]: "1" } };
|
|
17931
|
+
return resolvePackagedSignetCommand("signet-mcp", "dist", "mcp-stdio.js", true);
|
|
17932
|
+
}
|
|
17904
17933
|
function isJsonObject(value) {
|
|
17905
17934
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
17906
17935
|
}
|
|
@@ -17932,7 +17961,7 @@ import { createRequire as createRequire22 } from "node:module";
|
|
|
17932
17961
|
import { homedir as homedir52 } from "node:os";
|
|
17933
17962
|
import { dirname as dirname62, join as join142, resolve as resolve82 } from "node:path";
|
|
17934
17963
|
import { homedir as homedir62, platform as platform22 } from "node:os";
|
|
17935
|
-
import { basename as
|
|
17964
|
+
import { basename as basename3, dirname as dirname72, resolve as resolve92 } from "node:path";
|
|
17936
17965
|
import { existsSync as existsSync16, readFileSync as readFileSync13, realpathSync as realpathSync2, statSync as statSync8 } from "node:fs";
|
|
17937
17966
|
import { dirname as dirname8, join as join16 } from "node:path";
|
|
17938
17967
|
import { homedir as homedir82 } from "node:os";
|
|
@@ -35758,6 +35787,8 @@ class GeminiConnector extends BaseConnector {
|
|
|
35758
35787
|
}
|
|
35759
35788
|
registerMcpServer(geminiHome) {
|
|
35760
35789
|
const settingsPath = join5(geminiHome, "settings.json");
|
|
35790
|
+
const mcp = resolveSignetMcpCommand();
|
|
35791
|
+
const signet = { command: mcp.command, args: [...mcp.args], ...mcp.env ? { env: { ...mcp.env } } : {} };
|
|
35761
35792
|
if (existsSync2(settingsPath)) {
|
|
35762
35793
|
const settings = readGeminiSettings(settingsPath);
|
|
35763
35794
|
if (!settings) {
|
|
@@ -35766,20 +35797,14 @@ class GeminiConnector extends BaseConnector {
|
|
|
35766
35797
|
const existingMcp = isJsonObject(settings.mcpServers) ? settings.mcpServers : {};
|
|
35767
35798
|
settings.mcpServers = {
|
|
35768
35799
|
...existingMcp,
|
|
35769
|
-
signet
|
|
35770
|
-
command: "signet-mcp",
|
|
35771
|
-
args: []
|
|
35772
|
-
}
|
|
35800
|
+
signet
|
|
35773
35801
|
};
|
|
35774
35802
|
atomicWriteJson(settingsPath, settings);
|
|
35775
35803
|
return null;
|
|
35776
35804
|
}
|
|
35777
35805
|
const settings = {
|
|
35778
35806
|
mcpServers: {
|
|
35779
|
-
signet
|
|
35780
|
-
command: "signet-mcp",
|
|
35781
|
-
args: []
|
|
35782
|
-
}
|
|
35807
|
+
signet
|
|
35783
35808
|
}
|
|
35784
35809
|
};
|
|
35785
35810
|
mkdirSync(geminiHome, { recursive: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signetai/connector-gemini",
|
|
3
|
-
"version": "0.231.
|
|
3
|
+
"version": "0.231.2",
|
|
4
4
|
"description": "Signet connector for Gemini CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"typecheck": "tsc --noEmit"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@signetai/connector-base": "0.231.
|
|
28
|
-
"@signetai/core": "0.231.
|
|
27
|
+
"@signetai/connector-base": "0.231.2",
|
|
28
|
+
"@signetai/core": "0.231.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^22.0.0",
|