signetai 0.199.17 → 0.199.31
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/bin/launch.js +54 -1
- package/dist/mcp-stdio.js +33 -8
- package/native-manifest.json +14 -14
- package/package.json +6 -6
- package/scripts/install-native.js +26 -2
package/bin/launch.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { spawn } from "node:child_process";
|
|
4
|
-
import { existsSync } from "node:fs";
|
|
4
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import { dirname, join } from "node:path";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
@@ -12,6 +12,8 @@ const packageDir = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
|
12
12
|
const require = createRequire(import.meta.url);
|
|
13
13
|
const binaryName = process.platform === "win32" ? "signet.exe" : "signet";
|
|
14
14
|
const binaryPath = join(packageDir, "native", binaryName);
|
|
15
|
+
const connectorAssetsPath = join(packageDir, "runtime", "connectors");
|
|
16
|
+
const connectorMarkerPath = join(connectorAssetsPath, ".signet-connectors-version");
|
|
15
17
|
|
|
16
18
|
function resolveNativePackageBinaryPath() {
|
|
17
19
|
const platform = detectNativePlatform();
|
|
@@ -33,6 +35,55 @@ function resolveBinaryPath() {
|
|
|
33
35
|
return null;
|
|
34
36
|
}
|
|
35
37
|
|
|
38
|
+
function loadNativeManifest() {
|
|
39
|
+
try {
|
|
40
|
+
const manifest = JSON.parse(readFileSync(join(packageDir, "native-manifest.json"), "utf8"));
|
|
41
|
+
if (typeof manifest !== "object" || manifest === null) return null;
|
|
42
|
+
return manifest;
|
|
43
|
+
} catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function connectorComponent(manifest) {
|
|
49
|
+
if (typeof manifest.components !== "object" || manifest.components === null) return null;
|
|
50
|
+
const component = manifest.components.connectors;
|
|
51
|
+
if (typeof component !== "object" || component === null) return null;
|
|
52
|
+
if (typeof manifest.version !== "string" || typeof component.sha256 !== "string") return null;
|
|
53
|
+
return component;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function hasConnectorAssets(manifest) {
|
|
57
|
+
const component = connectorComponent(manifest);
|
|
58
|
+
if (!existsSync(connectorAssetsPath) || !existsSync(connectorMarkerPath)) return false;
|
|
59
|
+
|
|
60
|
+
try {
|
|
61
|
+
const marker = JSON.parse(readFileSync(connectorMarkerPath, "utf8"));
|
|
62
|
+
return marker.version === manifest.version && marker.sha256.toLowerCase() === component.sha256.toLowerCase();
|
|
63
|
+
} catch {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function warnIfInstallAssetsMissing(resolvedBinaryPath) {
|
|
69
|
+
const missing = [];
|
|
70
|
+
if (resolvedBinaryPath !== binaryPath) missing.push("native/");
|
|
71
|
+
const manifest = loadNativeManifest();
|
|
72
|
+
if (manifest !== null && connectorComponent(manifest) !== null && !hasConnectorAssets(manifest)) {
|
|
73
|
+
missing.push("runtime/connectors/");
|
|
74
|
+
}
|
|
75
|
+
if (missing.length === 0) return;
|
|
76
|
+
|
|
77
|
+
console.error(`Signet install assets are incomplete: missing ${missing.join(" and ")}.`);
|
|
78
|
+
if (resolvedBinaryPath !== binaryPath) {
|
|
79
|
+
console.error("The platform native package is installed, but Signet's postinstall did not finish linking the wrapper assets.");
|
|
80
|
+
} else {
|
|
81
|
+
console.error("Signet's postinstall did not finish installing all required wrapper assets.");
|
|
82
|
+
}
|
|
83
|
+
console.error("If Bun blocked the lifecycle script, run `bun pm -g untrusted`, trust Signet's postinstall, then reinstall with `bun add -g signetai`.");
|
|
84
|
+
console.error("If the postinstall failed, reinstall with npm or use the official installer from https://signetai.sh/install.sh.");
|
|
85
|
+
}
|
|
86
|
+
|
|
36
87
|
export function launchSignet() {
|
|
37
88
|
const resolvedBinaryPath = resolveBinaryPath();
|
|
38
89
|
if (!resolvedBinaryPath) {
|
|
@@ -42,6 +93,8 @@ export function launchSignet() {
|
|
|
42
93
|
process.exit(1);
|
|
43
94
|
}
|
|
44
95
|
|
|
96
|
+
warnIfInstallAssetsMissing(resolvedBinaryPath);
|
|
97
|
+
|
|
45
98
|
// Point the binary at the wrapper's installed runtime tree so the
|
|
46
99
|
// connector's `getPluginSourceDir()` `SIGNET_DIR/runtime/connectors/...`
|
|
47
100
|
// fallback can find per-harness plugin assets that the native binary
|
package/dist/mcp-stdio.js
CHANGED
|
@@ -43160,6 +43160,7 @@ if (isBun) {
|
|
|
43160
43160
|
} else {
|
|
43161
43161
|
Database = require2("better-sqlite3");
|
|
43162
43162
|
}
|
|
43163
|
+
var MAX_ZERO_FREE_SPACE_PROBE_BYTES = 1024 * 1024;
|
|
43163
43164
|
var migrationBackupDeps = {
|
|
43164
43165
|
copyFileSync,
|
|
43165
43166
|
readdirSync: readdirSync2,
|
|
@@ -50626,6 +50627,8 @@ var GRAPHIQ_COMPAT_ALIASES = new Map([
|
|
|
50626
50627
|
["code_briefing", "signet_code_briefing"]
|
|
50627
50628
|
]);
|
|
50628
50629
|
var MARKETPLACE_PROXY_REFRESH_TIMEOUT_MS = 5000;
|
|
50630
|
+
var MARKETPLACE_PROXY_REFRESH_TTL_MS = 30000;
|
|
50631
|
+
var marketplaceRefreshes = new Map;
|
|
50629
50632
|
function readDaemonAuthToken() {
|
|
50630
50633
|
const apiKey = process.env.SIGNET_API_KEY?.trim();
|
|
50631
50634
|
if (apiKey)
|
|
@@ -50880,6 +50883,32 @@ async function fetchMarketplacePolicy(baseUrl, authorizationHeader) {
|
|
|
50880
50883
|
}
|
|
50881
50884
|
return result.data.policy;
|
|
50882
50885
|
}
|
|
50886
|
+
function marketplaceRefreshKey(baseUrl, context, authorizationHeader) {
|
|
50887
|
+
return JSON.stringify({ baseUrl, context, authorizationHeader });
|
|
50888
|
+
}
|
|
50889
|
+
async function fetchMarketplaceRefreshSnapshot(state) {
|
|
50890
|
+
const key = marketplaceRefreshKey(state.baseUrl, state.context, state.authorizationHeader);
|
|
50891
|
+
const now2 = Date.now();
|
|
50892
|
+
const cached2 = marketplaceRefreshes.get(key);
|
|
50893
|
+
if (cached2 && cached2.expiresAt > now2)
|
|
50894
|
+
return cached2.promise;
|
|
50895
|
+
const promise3 = (async () => {
|
|
50896
|
+
const policy = await fetchMarketplacePolicy(state.baseUrl, state.authorizationHeader);
|
|
50897
|
+
const routed = await daemonFetch(state.baseUrl, appendMarketplaceContext("/api/marketplace/mcp/tools?refresh=1", state.context), {
|
|
50898
|
+
timeout: MARKETPLACE_PROXY_REFRESH_TIMEOUT_MS,
|
|
50899
|
+
authorizationHeader: state.authorizationHeader
|
|
50900
|
+
});
|
|
50901
|
+
return { policy, routed };
|
|
50902
|
+
})();
|
|
50903
|
+
marketplaceRefreshes.set(key, { expiresAt: now2 + MARKETPLACE_PROXY_REFRESH_TTL_MS, promise: promise3 });
|
|
50904
|
+
try {
|
|
50905
|
+
return await promise3;
|
|
50906
|
+
} catch (error51) {
|
|
50907
|
+
if (marketplaceRefreshes.get(key)?.promise === promise3)
|
|
50908
|
+
marketplaceRefreshes.delete(key);
|
|
50909
|
+
throw error51;
|
|
50910
|
+
}
|
|
50911
|
+
}
|
|
50883
50912
|
async function refreshMarketplaceProxyTools(server, options) {
|
|
50884
50913
|
const state = marketplaceProxyState.get(server);
|
|
50885
50914
|
if (!state || !state.enabled) {
|
|
@@ -50887,14 +50916,10 @@ async function refreshMarketplaceProxyTools(server, options) {
|
|
|
50887
50916
|
}
|
|
50888
50917
|
const notify = options?.notify ?? true;
|
|
50889
50918
|
const registeredTools = getRegisteredToolsMap(server);
|
|
50890
|
-
const
|
|
50891
|
-
if (policy)
|
|
50892
|
-
state.policy = policy;
|
|
50893
|
-
|
|
50894
|
-
const routed = await daemonFetch(state.baseUrl, appendMarketplaceContext("/api/marketplace/mcp/tools?refresh=1", state.context), {
|
|
50895
|
-
timeout: MARKETPLACE_PROXY_REFRESH_TIMEOUT_MS,
|
|
50896
|
-
authorizationHeader: state.authorizationHeader
|
|
50897
|
-
});
|
|
50919
|
+
const snapshot = await fetchMarketplaceRefreshSnapshot(state);
|
|
50920
|
+
if (snapshot.policy)
|
|
50921
|
+
state.policy = snapshot.policy;
|
|
50922
|
+
const routed = snapshot.routed;
|
|
50898
50923
|
if (!routed.ok) {
|
|
50899
50924
|
return { changed: false, count: state.names.size, error: routed.error };
|
|
50900
50925
|
}
|
package/native-manifest.json
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"version": "0.199.
|
|
3
|
+
"version": "0.199.31",
|
|
4
4
|
"assets": [
|
|
5
5
|
{
|
|
6
6
|
"name": "signet-darwin-arm64",
|
|
7
7
|
"platform": "darwin-arm64",
|
|
8
|
-
"sha256": "
|
|
9
|
-
"size":
|
|
8
|
+
"sha256": "ff18ad288914f8a95277b078053414b32360f4e6149d6816441e372ef5e89430",
|
|
9
|
+
"size": 125284384
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
"name": "signet-darwin-x64",
|
|
13
13
|
"platform": "darwin-x64",
|
|
14
|
-
"sha256": "
|
|
15
|
-
"size":
|
|
14
|
+
"sha256": "910739876ae3e89be79a658719203d52df25ccb1b8204d4e4ce6667ef11f5879",
|
|
15
|
+
"size": 130255424
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"name": "signet-linux-arm64",
|
|
19
19
|
"platform": "linux-arm64",
|
|
20
|
-
"sha256": "
|
|
21
|
-
"size":
|
|
20
|
+
"sha256": "081051489654bb2f4e2f605ced87be021844dfa0944e2083c479c6c59783b9e3",
|
|
21
|
+
"size": 169833270
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
"name": "signet-linux-x64",
|
|
25
25
|
"platform": "linux-x64",
|
|
26
|
-
"sha256": "
|
|
27
|
-
"size":
|
|
26
|
+
"sha256": "23a0257dc18f0b619388cf2a3dedd05ff333d2bfd4407cde8b127589c6987b67",
|
|
27
|
+
"size": 172207852
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
"name": "signet-win32-x64.exe",
|
|
31
31
|
"platform": "win32-x64",
|
|
32
|
-
"sha256": "
|
|
33
|
-
"size":
|
|
32
|
+
"sha256": "ba55f46ec3cea841bad95677840cae0d04edca8e1e10c449ba23b118aaf923eb",
|
|
33
|
+
"size": 180334080
|
|
34
34
|
}
|
|
35
35
|
],
|
|
36
36
|
"components": {
|
|
37
37
|
"connectors": {
|
|
38
|
-
"url": "signet-connectors-0.199.
|
|
39
|
-
"sha256": "
|
|
40
|
-
"size":
|
|
38
|
+
"url": "signet-connectors-0.199.31.tar.gz",
|
|
39
|
+
"sha256": "c737f4637be4330d95cb898e815ab9ba9cfc5e900ebb9d0e8a7ee41b645440e7",
|
|
40
|
+
"size": 21671
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "signetai",
|
|
3
|
-
"version": "0.199.
|
|
3
|
+
"version": "0.199.31",
|
|
4
4
|
"description": "Signet native CLI installer wrapper",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
67
|
"optionalDependencies": {
|
|
68
|
-
"signetai-darwin-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.199.
|
|
69
|
-
"signetai-darwin-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.199.
|
|
70
|
-
"signetai-linux-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.199.
|
|
71
|
-
"signetai-linux-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.199.
|
|
72
|
-
"signetai-win32-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.199.
|
|
68
|
+
"signetai-darwin-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.199.31/signetai-darwin-arm64-0.199.31.tgz",
|
|
69
|
+
"signetai-darwin-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.199.31/signetai-darwin-x64-0.199.31.tgz",
|
|
70
|
+
"signetai-linux-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.199.31/signetai-linux-arm64-0.199.31.tgz",
|
|
71
|
+
"signetai-linux-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.199.31/signetai-linux-x64-0.199.31.tgz",
|
|
72
|
+
"signetai-win32-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.199.31/signetai-win32-x64-0.199.31.tgz"
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -164,6 +164,9 @@ async function main() {
|
|
|
164
164
|
await chmod(destination, 0o755);
|
|
165
165
|
}
|
|
166
166
|
console.log(`Linked Signet native binary for ${platform}`);
|
|
167
|
+
if (process.platform === "darwin") {
|
|
168
|
+
console.log("macOS Gatekeeper tip: browser-downloaded unsigned binaries may require right-click Open or Open Anyway. Only bypass Gatekeeper for a trusted official Signet binary. See https://docs.signetai.sh/getting-started/install/");
|
|
169
|
+
}
|
|
167
170
|
} catch (err) {
|
|
168
171
|
rmSync(destination, { force: true });
|
|
169
172
|
throw err;
|
|
@@ -205,6 +208,16 @@ function verifySha256(path, expected) {
|
|
|
205
208
|
}
|
|
206
209
|
}
|
|
207
210
|
|
|
211
|
+
function isConnectorMarker(value) {
|
|
212
|
+
if (typeof value !== "object" || value === null) return false;
|
|
213
|
+
return (
|
|
214
|
+
typeof value.version === "string" &&
|
|
215
|
+
value.version.length > 0 &&
|
|
216
|
+
typeof value.sha256 === "string" &&
|
|
217
|
+
/^[a-f0-9]{64}$/i.test(value.sha256)
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
208
221
|
function nativePackageVersion() {
|
|
209
222
|
try {
|
|
210
223
|
return JSON.parse(readFileSync(join(packageDir, "package.json"), "utf8")).version;
|
|
@@ -235,9 +248,17 @@ async function installConnectorAssets() {
|
|
|
235
248
|
|
|
236
249
|
const targetDir = join(packageDir, "runtime", "connectors");
|
|
237
250
|
const targetMarker = join(targetDir, ".signet-connectors-version");
|
|
251
|
+
let installedMarker = null;
|
|
252
|
+
try {
|
|
253
|
+
installedMarker = JSON.parse(readFileSync(targetMarker, "utf8"));
|
|
254
|
+
} catch {
|
|
255
|
+
// Reinstall legacy or malformed markers instead of trusting stale assets.
|
|
256
|
+
}
|
|
238
257
|
if (
|
|
239
258
|
existsSync(targetMarker) &&
|
|
240
|
-
|
|
259
|
+
isConnectorMarker(installedMarker) &&
|
|
260
|
+
installedMarker.version === manifest.version &&
|
|
261
|
+
installedMarker.sha256.toLowerCase() === component.sha256.toLowerCase()
|
|
241
262
|
) {
|
|
242
263
|
// Already extracted for this version. Skip to keep postinstall fast
|
|
243
264
|
// and to avoid clobbering user-tweaked assets.
|
|
@@ -270,7 +291,10 @@ async function installConnectorAssets() {
|
|
|
270
291
|
if (result.status !== 0) {
|
|
271
292
|
throw new Error(`tar extraction failed with status ${result.status ?? "unknown"}`);
|
|
272
293
|
}
|
|
273
|
-
writeFileSync(
|
|
294
|
+
writeFileSync(
|
|
295
|
+
targetMarker,
|
|
296
|
+
`${JSON.stringify({ version: manifest.version, sha256: component.sha256 })}\n`,
|
|
297
|
+
);
|
|
274
298
|
console.log(`Installed connector assets to ${targetDir}`);
|
|
275
299
|
} finally {
|
|
276
300
|
rmSync(tempPath, { force: true });
|