@edgegap/mcp 0.13.2 → 0.14.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/README.md +49 -20
- package/dist/client.js +50 -1
- package/dist/config.js +3 -0
- package/dist/matchmaker.js +7 -0
- package/dist/skills.generated.js +52 -52
- package/dist/skillsinstall.js +19 -4
- package/dist/skillsversion.js +2 -0
- package/dist/tools.js +538 -15
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/dist/skillsinstall.js
CHANGED
|
@@ -13,7 +13,7 @@ import { lstat, mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
|
13
13
|
import { homedir } from 'node:os';
|
|
14
14
|
import { dirname, join, resolve, sep } from 'node:path';
|
|
15
15
|
import { SKILLS_PACK } from './skills.js';
|
|
16
|
-
import { SKILL_NAME_RE, compareVersions, skillVersionOf } from './skillsversion.js';
|
|
16
|
+
import { SKILLS_CLI, SKILL_NAME_RE, compareVersions, skillVersionOf } from './skillsversion.js';
|
|
17
17
|
export function defaultSkillsEnv() {
|
|
18
18
|
return {
|
|
19
19
|
home: homedir(),
|
|
@@ -37,7 +37,7 @@ export function defaultSkillsEnv() {
|
|
|
37
37
|
const child = execFile(cmd, args, {
|
|
38
38
|
cwd,
|
|
39
39
|
shell: win,
|
|
40
|
-
env: { ...process.env, NO_COLOR: '1', FORCE_COLOR: '0', CI: '1' },
|
|
40
|
+
env: { ...updaterEnv(process.env), NO_COLOR: '1', FORCE_COLOR: '0', CI: '1' },
|
|
41
41
|
timeout: 120_000,
|
|
42
42
|
killSignal: 'SIGKILL',
|
|
43
43
|
maxBuffer: 4 * 1024 * 1024,
|
|
@@ -54,6 +54,21 @@ export function defaultSkillsEnv() {
|
|
|
54
54
|
}),
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
+
// What the updaters need to find node, npm and their config, and to get out
|
|
58
|
+
// through a proxy. Nothing else: the Edgegap token and any other secret in
|
|
59
|
+
// this server's environment must not reach a package manager it starts.
|
|
60
|
+
const UPDATER_ENV = /^(PATH|PATHEXT|SYSTEMROOT|SYSTEMDRIVE|WINDIR|COMSPEC|HOME|USERPROFILE|HOMEDRIVE|HOMEPATH|APPDATA|LOCALAPPDATA|PROGRAMDATA|PROGRAMFILES|PROGRAMFILES\(X86\)|TEMP|TMP|TMPDIR|USER|USERNAME|LOGNAME|SHELL|LANG|LANGUAGE|LC_[A-Z]+|TZ|XDG_[A-Z_]+|HTTPS?_PROXY|NO_PROXY|ALL_PROXY|NODE_EXTRA_CA_CERTS|SSL_CERT_FILE|SSL_CERT_DIR|NPM_CONFIG_[A-Z_]+|CLAUDE_CONFIG_DIR)$/i;
|
|
61
|
+
const SECRET_NAME = /token|secret|passw|key|auth|credential|cookie|session/i;
|
|
62
|
+
/** The allowlisted part of env, minus EDGEGAP_* and anything named like a secret. */
|
|
63
|
+
export function updaterEnv(env) {
|
|
64
|
+
const out = {};
|
|
65
|
+
for (const [k, v] of Object.entries(env)) {
|
|
66
|
+
if (v === undefined || !UPDATER_ENV.test(k) || /^EDGEGAP_/i.test(k) || SECRET_NAME.test(k))
|
|
67
|
+
continue;
|
|
68
|
+
out[k] = v;
|
|
69
|
+
}
|
|
70
|
+
return out;
|
|
71
|
+
}
|
|
57
72
|
const SOURCE_RE = /^(https:\/\/github\.com\/|git@github\.com:|github:)?edgegap\/(llm-agent-skills|edgegap-agent-skills)(\.git)?\/?$/i;
|
|
58
73
|
// The skills CLI keeps one copy in .agents/skills when it installs for several
|
|
59
74
|
// agents, and copies into the agent's own folder when it installs for one.
|
|
@@ -159,9 +174,9 @@ export function updateCommands(install, outdated) {
|
|
|
159
174
|
const names = outdated.filter((n) => SKILL_NAME_RE.test(n));
|
|
160
175
|
switch (install.kind) {
|
|
161
176
|
case 'skills-cli-global':
|
|
162
|
-
return [['npx', '-y',
|
|
177
|
+
return [['npx', '-y', SKILLS_CLI, 'update', ...names, '-g', '-y']];
|
|
163
178
|
case 'skills-cli-project':
|
|
164
|
-
return [['npx', '-y',
|
|
179
|
+
return [['npx', '-y', SKILLS_CLI, 'update', ...names, '-p', '-y']];
|
|
165
180
|
case 'claude-plugin':
|
|
166
181
|
return [
|
|
167
182
|
['claude', 'plugin', 'marketplace', 'update', 'edgegap'],
|
package/dist/skillsversion.js
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
* Worker can run it too.
|
|
10
10
|
*/
|
|
11
11
|
import { SKILLS_PACK } from './skills.js';
|
|
12
|
+
/** The skills CLI version the updater runs, not whatever is newest on npm. */
|
|
13
|
+
export const SKILLS_CLI = 'skills@1.7.4';
|
|
12
14
|
/** raw.githubusercontent.com root of the skills repo's main branch. */
|
|
13
15
|
export const DEFAULT_SKILLS_RAW = 'https://raw.githubusercontent.com/edgegap/llm-agent-skills/main';
|
|
14
16
|
/** Skill names as the pack writes them; anything else is not looked up. */
|