@edgegap/mcp 0.7.2 → 0.9.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 +9 -2
- package/dist/config.js +3 -0
- package/dist/index.js +7 -1
- package/dist/matchmaker.js +7 -2
- package/dist/skillsinstall.js +194 -0
- package/dist/skillsversion.js +110 -0
- package/dist/tools.js +177 -20
- package/dist/version.js +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -141,6 +141,10 @@ Install remote Edgegap MCP server in your agent's virtualized environment (never
|
|
|
141
141
|
}
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
+
### One-Click Install (Claude Desktop)
|
|
145
|
+
|
|
146
|
+
Download [edgegap-mcp.mcpb](https://github.com/edgegap/llm-mcp-server/releases/latest/download/edgegap-mcp.mcpb) and open it: Claude Desktop installs the local server as an extension and asks for your API token, which it keeps in the operating system's secure storage. The extension's settings also hold read-only mode, the application allowlist, the max duration ceiling and the deployment cap (the variables below). Each [release](https://github.com/edgegap/llm-mcp-server/releases) attaches the bundle, built from that release's code. Any other app that installs MCPB bundles works the same way.
|
|
147
|
+
|
|
144
148
|
### Local Server
|
|
145
149
|
|
|
146
150
|
To keep your API token on your own machine, run the server locally instead. Leave the token out and your agent asks you for it on first use, holding it in memory only for that session:
|
|
@@ -157,7 +161,7 @@ To keep your API token on your own machine, run the server locally instead. Leav
|
|
|
157
161
|
}
|
|
158
162
|
```
|
|
159
163
|
|
|
160
|
-
Needs Node 18+. Pin a version in production (`@edgegap/mcp@0.
|
|
164
|
+
Needs Node 18+. Pin a version in production (`@edgegap/mcp@0.9.0`) rather than floating on latest. Registered in the official MCP registry as `dev.edgegap/mcp`.
|
|
161
165
|
|
|
162
166
|
The local server can also limit what an agent can do. These variables have no effect on the hosted endpoint at `mcp.edgegap.dev`:
|
|
163
167
|
|
|
@@ -169,6 +173,7 @@ The local server can also limit what an agent can do. These variables have no ef
|
|
|
169
173
|
| `EDGEGAP_MAX_DURATION_MINUTES` | `60` | Ceiling on `max_duration` the agent may set on a version. |
|
|
170
174
|
| `EDGEGAP_MAX_AGENT_DEPLOYMENTS` | `5` | `edgegap_deploy` refuses while this many deployments tagged `edgegap-mcp` are running. `0` turns the cap off. |
|
|
171
175
|
| `EDGEGAP_TIMEOUT_MS` | `30000` | Per-request HTTP timeout. |
|
|
176
|
+
| `EDGEGAP_SKILLS_CHECK` | `on` | Set to `off` and the skill tools never read the latest skills version from GitHub. |
|
|
172
177
|
|
|
173
178
|
## 📚 Skills
|
|
174
179
|
|
|
@@ -198,7 +203,9 @@ They're served three ways, so every MCP client can reach them:
|
|
|
198
203
|
- **Prompts:** one per skill, named after it. In Claude Code they show up as slash commands, e.g. `/mcp__edgegap__edgegap-unity`.
|
|
199
204
|
- **Resources:** one per file, at `edgegap-skill://<skill>/<path>`, e.g. `edgegap-skill://edgegap-unity/references/deploy.md`.
|
|
200
205
|
|
|
201
|
-
Each release bundles the skills at the commit pinned in `scripts/skills-pin.txt`; `edgegap_context` reports which pack is loaded.
|
|
206
|
+
Each release bundles the skills at the commit pinned in `scripts/skills-pin.txt`; `edgegap_context` reports which pack is loaded. `edgegap_list_skills` also reads the latest pack version from GitHub (one version number, cached for an hour; `EDGEGAP_SKILLS_CHECK=off` turns it off) and says when a newer one is out, and `edgegap_get_skill` adds the same note under a skill's header.
|
|
207
|
+
|
|
208
|
+
**Keeping installed skills current.** If you also installed the skills in your agent (the Claude Code plugin `edgegap@edgegap`, `npx skills add edgegap/llm-agent-skills`, or folders copied into `~/.claude/skills`), `edgegap_update_skills` compares each one with the latest on GitHub. On the local server it finds those installs itself; with `apply: true` it runs `npx skills update` (Edgegap skills only) or `claude plugin update`, and rewrites hand-copied skills from the files bundled in this release, keeping files you added and leaving symlinks and git checkouts alone. It never downloads skill text. The hosted server cannot see your disk: pass the versions you have loaded in `installed_versions` and it says which are behind and how to update them.
|
|
202
209
|
|
|
203
210
|
## 🧰 Tools
|
|
204
211
|
|
package/dist/config.js
CHANGED
|
@@ -57,6 +57,9 @@ function parseIntEnv(raw, fallback) {
|
|
|
57
57
|
return Number.isFinite(n) ? n : fallback;
|
|
58
58
|
}
|
|
59
59
|
export function loadConfig(env = process.env) {
|
|
60
|
+
// The one-click install (manifest.json) fills these from its settings; a
|
|
61
|
+
// value left as an unexpanded "${user_config.x}" placeholder means not set.
|
|
62
|
+
env = Object.fromEntries(Object.entries(env).filter(([, v]) => !/^\$\{user_config\.[a-z_]+\}$/.test(v ?? '')));
|
|
60
63
|
// A token in the environment is optional. When it is absent the server asks
|
|
61
64
|
// the developer for one at first use, which removes the "configure before
|
|
62
65
|
// anything works" step that loses people during onboarding.
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,8 @@ import { EdgegapClient } from './client.js';
|
|
|
17
17
|
import { registerTools, serverInstructions } from './tools.js';
|
|
18
18
|
import { VERSION } from './version.js';
|
|
19
19
|
import { TokenProvider, warnIfTokenInArgv } from './auth.js';
|
|
20
|
+
import { skillsCheckFromEnv } from './skillsversion.js';
|
|
21
|
+
import { defaultSkillsEnv, findSkillsInstalls, replaceFromBundle, updateCommands } from './skillsinstall.js';
|
|
20
22
|
async function main() {
|
|
21
23
|
let config;
|
|
22
24
|
try {
|
|
@@ -38,7 +40,11 @@ async function main() {
|
|
|
38
40
|
const client = new EdgegapClient(config, auth, {
|
|
39
41
|
clientName: () => server.server.getClientVersion()?.name,
|
|
40
42
|
});
|
|
41
|
-
registerTools(server, client, config, auth
|
|
43
|
+
registerTools(server, client, config, auth, {
|
|
44
|
+
skillsCheck: skillsCheckFromEnv(process.env),
|
|
45
|
+
// Only this local server looks at the developer's installed skills.
|
|
46
|
+
localSkills: { env: defaultSkillsEnv(), findSkillsInstalls, updateCommands, replaceFromBundle },
|
|
47
|
+
});
|
|
42
48
|
if (!config.envToken) {
|
|
43
49
|
process.stderr.write('[edgegap-mcp] no token configured: you will be asked for one at first ' +
|
|
44
50
|
'use. It stays in memory on this machine and is never written to disk ' +
|
package/dist/matchmaker.js
CHANGED
|
@@ -28,13 +28,15 @@ export function buildMatchmakerConfig(input) {
|
|
|
28
28
|
if (!/^[a-z0-9][a-z0-9-_]*$/i.test(input.profile_name)) {
|
|
29
29
|
problems.push(`profile_name "${input.profile_name}" should be letters, digits, "-" or "_". Game clients send it on every ticket.`);
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
// 30s by default: a lone or partial ticket may only be matched when it nears
|
|
32
|
+
// expiry, so with minutes a developer testing alone gives up before a server comes.
|
|
33
|
+
const expiration = input.ticket_expiration ?? '30s';
|
|
32
34
|
const removal = input.ticket_removal ?? '1m';
|
|
33
35
|
for (const [field, value] of [['ticket_expiration', expiration], ['ticket_removal', removal]]) {
|
|
34
36
|
if (!DURATION.test(value))
|
|
35
37
|
problems.push(`${field} "${value}" is not a duration like "30s", "5m" or "1h".`);
|
|
36
38
|
}
|
|
37
|
-
if (seconds(expiration) <
|
|
39
|
+
if (seconds(expiration) < 20) {
|
|
38
40
|
cautions.push(`ticket_expiration ${expiration} is short. Tickets must outlive the queue wait plus server start-up, or players are dropped before the match is ready.`);
|
|
39
41
|
}
|
|
40
42
|
const rules = {
|
|
@@ -75,6 +77,9 @@ export function buildMatchmakerConfig(input) {
|
|
|
75
77
|
}
|
|
76
78
|
if (Object.keys(step).length === 0)
|
|
77
79
|
continue;
|
|
80
|
+
if (e.after_seconds >= seconds(expiration)) {
|
|
81
|
+
cautions.push(`expansion at ${e.after_seconds}s never applies: tickets expire after ${expiration}. Use an after_seconds below it (e.g. 15 or 20).`);
|
|
82
|
+
}
|
|
78
83
|
if (e.after_seconds === lastAfter)
|
|
79
84
|
problems.push(`two expansions share after_seconds ${e.after_seconds}.`);
|
|
80
85
|
lastAfter = e.after_seconds;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finds the copies of the Edgegap skills installed on this machine and updates
|
|
3
|
+
* them. Local (stdio) server only: it reads the developer's home and project
|
|
4
|
+
* folders and can run their package managers, which neither the hosted Worker
|
|
5
|
+
* nor a self-hosted container can or should do.
|
|
6
|
+
*
|
|
7
|
+
* Updates come from two places only: the developer's own package manager (the
|
|
8
|
+
* skills CLI, `claude plugin update`), or the files bundled in this release of
|
|
9
|
+
* @edgegap/mcp. Skill text is never downloaded here.
|
|
10
|
+
*/
|
|
11
|
+
import { execFile } from 'node:child_process';
|
|
12
|
+
import { lstat, mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
13
|
+
import { homedir } from 'node:os';
|
|
14
|
+
import { dirname, join, resolve, sep } from 'node:path';
|
|
15
|
+
import { SKILLS_PACK } from './skills.js';
|
|
16
|
+
import { SKILL_NAME_RE, compareVersions, skillVersionOf } from './skillsversion.js';
|
|
17
|
+
export function defaultSkillsEnv() {
|
|
18
|
+
return {
|
|
19
|
+
home: homedir(),
|
|
20
|
+
cwd: process.cwd(),
|
|
21
|
+
platform: process.platform,
|
|
22
|
+
readText: (path) => readFile(path, 'utf8').catch(() => undefined),
|
|
23
|
+
writeText: async (path, text) => {
|
|
24
|
+
await mkdir(dirname(path), { recursive: true });
|
|
25
|
+
await writeFile(path, text, 'utf8');
|
|
26
|
+
},
|
|
27
|
+
isManaged: async (dir) => {
|
|
28
|
+
const link = await lstat(dir).then((s) => s.isSymbolicLink()).catch(() => false);
|
|
29
|
+
const git = await lstat(join(dir, '.git')).then(() => true).catch(() => false);
|
|
30
|
+
return link || git;
|
|
31
|
+
},
|
|
32
|
+
run: (cmd, args, cwd) => new Promise((resolvePromise, reject) => {
|
|
33
|
+
// npx and claude are .cmd shims on Windows, which only start through a
|
|
34
|
+
// shell. Every argument here is a fixed flag or a name matching
|
|
35
|
+
// SKILL_NAME_RE, so nothing reaches the shell that could be parsed.
|
|
36
|
+
const win = process.platform === 'win32';
|
|
37
|
+
const child = execFile(cmd, args, {
|
|
38
|
+
cwd,
|
|
39
|
+
shell: win,
|
|
40
|
+
env: { ...process.env, NO_COLOR: '1', FORCE_COLOR: '0', CI: '1' },
|
|
41
|
+
timeout: 120_000,
|
|
42
|
+
killSignal: 'SIGKILL',
|
|
43
|
+
maxBuffer: 4 * 1024 * 1024,
|
|
44
|
+
windowsHide: true,
|
|
45
|
+
}, (err, stdout, stderr) => {
|
|
46
|
+
const out = `${stdout}${stderr}`.replace(/\x1b\[[0-9;?]*[A-Za-z]|\r/g, '').trim();
|
|
47
|
+
if (err)
|
|
48
|
+
reject(new Error(`${cmd} ${args.join(' ')} failed: ${err.message}\n${out}`));
|
|
49
|
+
else
|
|
50
|
+
resolvePromise(out);
|
|
51
|
+
});
|
|
52
|
+
// A prompting CLI fails at once on a closed stdin instead of hanging until the timeout.
|
|
53
|
+
child.stdin?.end();
|
|
54
|
+
}),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const SOURCE_RE = /^(https:\/\/github\.com\/|git@github\.com:|github:)?edgegap\/(llm-agent-skills|edgegap-agent-skills)(\.git)?\/?$/i;
|
|
58
|
+
// The skills CLI keeps one copy in .agents/skills when it installs for several
|
|
59
|
+
// agents, and copies into the agent's own folder when it installs for one.
|
|
60
|
+
const SKILL_DIRS = ['.agents/skills', '.claude/skills', '.codex/skills', '.cursor/skills', '.config/opencode/skills'];
|
|
61
|
+
const PLUGIN_ID = 'edgegap@edgegap';
|
|
62
|
+
function parseJson(text) {
|
|
63
|
+
if (!text)
|
|
64
|
+
return undefined;
|
|
65
|
+
try {
|
|
66
|
+
return JSON.parse(text);
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/** Skill names a skills CLI lock file records as coming from the Edgegap skills repo. */
|
|
73
|
+
function namesInLock(text) {
|
|
74
|
+
const lock = parseJson(text);
|
|
75
|
+
return Object.entries(lock?.skills ?? {})
|
|
76
|
+
.filter(([name, s]) => SKILL_NAME_RE.test(name) && (SOURCE_RE.test(s?.source ?? '') || SOURCE_RE.test(s?.sourceUrl ?? '')))
|
|
77
|
+
.map(([name]) => name)
|
|
78
|
+
.sort();
|
|
79
|
+
}
|
|
80
|
+
/** The oldest copy of a skill under root's skill folders, so one stale copy still counts. */
|
|
81
|
+
async function readCopies(env, root, name) {
|
|
82
|
+
let oldest;
|
|
83
|
+
for (const d of SKILL_DIRS) {
|
|
84
|
+
const dir = join(root, d, name);
|
|
85
|
+
const text = await env.readText(join(dir, 'SKILL.md'));
|
|
86
|
+
if (text === undefined)
|
|
87
|
+
continue;
|
|
88
|
+
const version = skillVersionOf(text);
|
|
89
|
+
if (!oldest || (version && (!oldest.version || compareVersions(version, oldest.version) < 0)))
|
|
90
|
+
oldest = { name, version, dir };
|
|
91
|
+
}
|
|
92
|
+
return oldest;
|
|
93
|
+
}
|
|
94
|
+
async function cliInstall(env, kind, where, lockPath, root) {
|
|
95
|
+
const names = namesInLock(await env.readText(lockPath));
|
|
96
|
+
if (names.length === 0)
|
|
97
|
+
return undefined;
|
|
98
|
+
const skills = await Promise.all(names.map(async (n) => (await readCopies(env, root, n)) ?? { name: n, dir: join(root, SKILL_DIRS[0], n) }));
|
|
99
|
+
return { kind, where, skills };
|
|
100
|
+
}
|
|
101
|
+
async function pluginInstall(env) {
|
|
102
|
+
const registry = parseJson(await env.readText(join(env.home, '.claude', 'plugins', 'installed_plugins.json')));
|
|
103
|
+
const installPath = registry?.plugins?.[PLUGIN_ID]?.[0]?.installPath;
|
|
104
|
+
if (!installPath)
|
|
105
|
+
return undefined;
|
|
106
|
+
const skills = [];
|
|
107
|
+
for (const s of SKILLS_PACK.skills) {
|
|
108
|
+
const dir = join(installPath, 'skills', s.name);
|
|
109
|
+
const text = await env.readText(join(dir, 'SKILL.md'));
|
|
110
|
+
if (text !== undefined)
|
|
111
|
+
skills.push({ name: s.name, version: skillVersionOf(text), dir });
|
|
112
|
+
}
|
|
113
|
+
return { kind: 'claude-plugin', where: `Claude Code plugin ${PLUGIN_ID}`, skills };
|
|
114
|
+
}
|
|
115
|
+
/** Skills copied by hand into an agent's skills folder: no lock file, no plugin. */
|
|
116
|
+
async function copiedSkills(env, root, where, claimed) {
|
|
117
|
+
const found = [];
|
|
118
|
+
for (const d of SKILL_DIRS) {
|
|
119
|
+
const skills = [];
|
|
120
|
+
for (const s of SKILLS_PACK.skills) {
|
|
121
|
+
const dir = join(root, d, s.name);
|
|
122
|
+
if (claimed.has(dir))
|
|
123
|
+
continue;
|
|
124
|
+
const text = await env.readText(join(dir, 'SKILL.md'));
|
|
125
|
+
// Only the Edgegap skill of that name, not someone's own skill that reuses it.
|
|
126
|
+
if (text === undefined || !text.includes(`name: ${s.name}`))
|
|
127
|
+
continue;
|
|
128
|
+
skills.push({ name: s.name, version: skillVersionOf(text), dir });
|
|
129
|
+
}
|
|
130
|
+
if (skills.length)
|
|
131
|
+
found.push({ kind: 'copy', where: `${where} ${join(root, d)}`, skills });
|
|
132
|
+
}
|
|
133
|
+
return found;
|
|
134
|
+
}
|
|
135
|
+
/** Every install of the Edgegap skills this server can see: user-wide, this project, and the Claude Code plugin. */
|
|
136
|
+
export async function findSkillsInstalls(env) {
|
|
137
|
+
const managed = (await Promise.all([
|
|
138
|
+
cliInstall(env, 'skills-cli-global', 'skills CLI, user-wide', join(env.home, '.agents', '.skill-lock.json'), env.home),
|
|
139
|
+
cliInstall(env, 'skills-cli-project', 'skills CLI, this project', join(env.cwd, 'skills-lock.json'), env.cwd),
|
|
140
|
+
pluginInstall(env),
|
|
141
|
+
])).filter((i) => i !== undefined);
|
|
142
|
+
// A skills CLI install writes into the same folders as a hand copy; count it once.
|
|
143
|
+
const claimed = new Set();
|
|
144
|
+
for (const i of managed) {
|
|
145
|
+
for (const s of i.skills) {
|
|
146
|
+
for (const root of [env.home, env.cwd])
|
|
147
|
+
for (const d of SKILL_DIRS)
|
|
148
|
+
claimed.add(join(root, d, s.name));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
const copies = [
|
|
152
|
+
...(await copiedSkills(env, env.home, 'copied user-wide into', claimed)),
|
|
153
|
+
...(resolve(env.cwd) !== resolve(env.home) ? await copiedSkills(env, env.cwd, 'copied into this project,', claimed) : []),
|
|
154
|
+
];
|
|
155
|
+
return [...managed, ...copies];
|
|
156
|
+
}
|
|
157
|
+
/** The commands that update a managed install, as argv lists. Copies have none. */
|
|
158
|
+
export function updateCommands(install, outdated) {
|
|
159
|
+
const names = outdated.filter((n) => SKILL_NAME_RE.test(n));
|
|
160
|
+
switch (install.kind) {
|
|
161
|
+
case 'skills-cli-global':
|
|
162
|
+
return [['npx', '-y', 'skills', 'update', ...names, '-g', '-y']];
|
|
163
|
+
case 'skills-cli-project':
|
|
164
|
+
return [['npx', '-y', 'skills', 'update', ...names, '-p', '-y']];
|
|
165
|
+
case 'claude-plugin':
|
|
166
|
+
return [
|
|
167
|
+
['claude', 'plugin', 'marketplace', 'update', 'edgegap'],
|
|
168
|
+
['claude', 'plugin', 'update', PLUGIN_ID],
|
|
169
|
+
];
|
|
170
|
+
case 'copy':
|
|
171
|
+
return [];
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Rewrites a hand-copied skill from the files bundled in this release. Files
|
|
176
|
+
* the developer added are left alone. Refused for symlinks and git checkouts:
|
|
177
|
+
* those are someone's working copy, not an install.
|
|
178
|
+
*/
|
|
179
|
+
export async function replaceFromBundle(env, skill) {
|
|
180
|
+
const bundled = SKILLS_PACK.skills.find((s) => s.name === skill.name);
|
|
181
|
+
if (!bundled)
|
|
182
|
+
throw new Error(`${skill.name} is not in the bundled pack`);
|
|
183
|
+
if (await env.isManaged(skill.dir)) {
|
|
184
|
+
throw new Error(`${skill.dir} is a symlink or a git checkout, so it was left alone; update it with git`);
|
|
185
|
+
}
|
|
186
|
+
const root = resolve(skill.dir);
|
|
187
|
+
for (const f of bundled.files) {
|
|
188
|
+
const target = resolve(root, ...f.path.split('/'));
|
|
189
|
+
if (!target.startsWith(root + sep))
|
|
190
|
+
throw new Error(`refused to write outside ${root}: ${f.path}`);
|
|
191
|
+
await env.writeText(target, f.content);
|
|
192
|
+
}
|
|
193
|
+
return `${skill.name} ${skill.version ?? '?'} → ${bundled.version} (${bundled.files.length} files from @edgegap/mcp's bundle)`;
|
|
194
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which Edgegap skills pack is the latest, so the skill tools can say when
|
|
3
|
+
* this server, or a copy of the skills on the developer's machine, is behind.
|
|
4
|
+
*
|
|
5
|
+
* Reads only version numbers from github.com/edgegap/llm-agent-skills, never
|
|
6
|
+
* skill text: updated skills reach agents through this server's own release
|
|
7
|
+
* (the bundle in src/skills.generated.ts) or the developer's package manager,
|
|
8
|
+
* not through anything fetched at run time. Uses only fetch, so the hosted
|
|
9
|
+
* Worker can run it too.
|
|
10
|
+
*/
|
|
11
|
+
import { SKILLS_PACK } from './skills.js';
|
|
12
|
+
/** raw.githubusercontent.com root of the skills repo's main branch. */
|
|
13
|
+
export const DEFAULT_SKILLS_RAW = 'https://raw.githubusercontent.com/edgegap/llm-agent-skills/main';
|
|
14
|
+
/** Skill names as the pack writes them; anything else is not looked up. */
|
|
15
|
+
export const SKILL_NAME_RE = /^edgegap(?:-[a-z0-9]+)*$/;
|
|
16
|
+
/** Turns EDGEGAP_SKILLS_CHECK and EDGEGAP_SKILLS_RAW_URL into options. */
|
|
17
|
+
export function skillsCheckFromEnv(env) {
|
|
18
|
+
const off = /^(0|off|false|no)$/i.test(env.EDGEGAP_SKILLS_CHECK?.trim() ?? '');
|
|
19
|
+
const raw = env.EDGEGAP_SKILLS_RAW_URL?.trim();
|
|
20
|
+
// Only https, or plain http to this machine for tests.
|
|
21
|
+
const usable = raw && (/^https:\/\/[^/]+/.test(raw) || /^http:\/\/(127\.0\.0\.1|localhost)(:\d+)?(\/|$)/.test(raw));
|
|
22
|
+
return { enabled: !off, rawBase: (usable ? raw : DEFAULT_SKILLS_RAW).replace(/\/+$/, '') };
|
|
23
|
+
}
|
|
24
|
+
/** -1, 0 or 1 for two X.Y.Z versions; anything unparseable sorts first. */
|
|
25
|
+
export function compareVersions(a, b) {
|
|
26
|
+
const parse = (v) => (/^\d+\.\d+\.\d+$/.test(v) ? v.split('.').map(Number) : [-1, -1, -1]);
|
|
27
|
+
const pa = parse(a);
|
|
28
|
+
const pb = parse(b);
|
|
29
|
+
for (let i = 0; i < 3; i++) {
|
|
30
|
+
if (pa[i] !== pb[i])
|
|
31
|
+
return pa[i] < pb[i] ? -1 : 1;
|
|
32
|
+
}
|
|
33
|
+
return 0;
|
|
34
|
+
}
|
|
35
|
+
/** metadata.version from a SKILL.md's frontmatter, e.g. ` version: "0.1.14"`. */
|
|
36
|
+
export function skillVersionOf(skillMd) {
|
|
37
|
+
const fm = skillMd?.replace(/\r\n/g, '\n').match(/^---\n([\s\S]*?)\n---/)?.[1];
|
|
38
|
+
const m = fm?.match(/^metadata:\s*\n(?:[ \t]+.*\n)*?[ \t]+version:\s*["']?(\d+\.\d+\.\d+)["']?\s*$/m);
|
|
39
|
+
return m?.[1];
|
|
40
|
+
}
|
|
41
|
+
async function getText(url, timeoutMs) {
|
|
42
|
+
const res = await fetch(url, { signal: AbortSignal.timeout(timeoutMs) });
|
|
43
|
+
if (!res.ok)
|
|
44
|
+
throw new Error(`GET ${url} returned ${res.status}`);
|
|
45
|
+
return res.text();
|
|
46
|
+
}
|
|
47
|
+
const CACHE_MS = 60 * 60 * 1000;
|
|
48
|
+
let packCache;
|
|
49
|
+
/** The pack version on GitHub main (.claude-plugin/plugin.json), cached for an hour. */
|
|
50
|
+
export async function latestPack(opts) {
|
|
51
|
+
if (!opts.enabled)
|
|
52
|
+
return { error: 'the check is off (EDGEGAP_SKILLS_CHECK=off)' };
|
|
53
|
+
if (packCache && packCache.key === opts.rawBase && Date.now() - packCache.at < CACHE_MS)
|
|
54
|
+
return packCache.value;
|
|
55
|
+
let value;
|
|
56
|
+
try {
|
|
57
|
+
const plugin = JSON.parse(await getText(`${opts.rawBase}/.claude-plugin/plugin.json`, opts.timeoutMs ?? 3_000));
|
|
58
|
+
const v = typeof plugin.version === 'string' && /^\d+\.\d+\.\d+$/.test(plugin.version) ? plugin.version : undefined;
|
|
59
|
+
value = v ? { version: v } : { error: 'plugin.json on GitHub has no X.Y.Z version' };
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
value = { error: `GitHub could not be reached (${err.message})` };
|
|
63
|
+
}
|
|
64
|
+
// Failures are cached too, so an offline machine pays the timeout once an hour, not per call.
|
|
65
|
+
packCache = { at: Date.now(), key: opts.rawBase, value };
|
|
66
|
+
return value;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Latest version of each named skill: GitHub main where it answers, otherwise
|
|
70
|
+
* the version bundled in this server. `source` says which.
|
|
71
|
+
*/
|
|
72
|
+
export async function latestSkillVersions(names, opts) {
|
|
73
|
+
const out = {};
|
|
74
|
+
await Promise.all([...new Set(names)].filter((n) => SKILL_NAME_RE.test(n)).map(async (name) => {
|
|
75
|
+
const bundled = SKILLS_PACK.skills.find((s) => s.name === name)?.version;
|
|
76
|
+
let remote;
|
|
77
|
+
if (opts.enabled) {
|
|
78
|
+
try {
|
|
79
|
+
remote = skillVersionOf(await getText(`${opts.rawBase}/skills/${name}/SKILL.md`, opts.timeoutMs ?? 5_000));
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
remote = undefined;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (remote && (!bundled || compareVersions(remote, bundled) >= 0))
|
|
86
|
+
out[name] = { version: remote, source: 'github' };
|
|
87
|
+
else if (bundled)
|
|
88
|
+
out[name] = { version: bundled, source: 'bundled' };
|
|
89
|
+
else
|
|
90
|
+
out[name] = { source: 'unknown' };
|
|
91
|
+
}));
|
|
92
|
+
return out;
|
|
93
|
+
}
|
|
94
|
+
/** What edgegap_list_skills and edgegap_get_skill say about the pack this server serves. */
|
|
95
|
+
export function servedPackStatus(latest, hosted) {
|
|
96
|
+
if (!latest.version)
|
|
97
|
+
return { latest_pack: `unknown: ${latest.error}` };
|
|
98
|
+
const behind = compareVersions(SKILLS_PACK.version, latest.version) < 0;
|
|
99
|
+
return {
|
|
100
|
+
latest_pack: latest.version,
|
|
101
|
+
served_is_latest: !behind,
|
|
102
|
+
...(behind
|
|
103
|
+
? {
|
|
104
|
+
update: hosted
|
|
105
|
+
? `Pack ${latest.version} is on GitHub; this hosted server still serves ${SKILLS_PACK.version} until its next release. The skills served here are still correct to follow.`
|
|
106
|
+
: `Pack ${latest.version} is on GitHub; this server bundles ${SKILLS_PACK.version}. A newer @edgegap/mcp may carry it: restart the server through npx -y @edgegap/mcp@latest, or update the Edgegap extension. The bundled skills are still correct to follow.`,
|
|
107
|
+
}
|
|
108
|
+
: {}),
|
|
109
|
+
};
|
|
110
|
+
}
|
package/dist/tools.js
CHANGED
|
@@ -17,6 +17,7 @@ import { generateDockerfile, DockerfileInputError } from './dockerfile.js';
|
|
|
17
17
|
import { buildMatchmakerConfig, DASHBOARD_URL } from './matchmaker.js';
|
|
18
18
|
import { badImage, badTag, looksSecret, TAG_FIX } from './image.js';
|
|
19
19
|
import { SKILLS_PACK, findSkill, findSkillFile, fileIndex, mimeType, skillUri } from './skills.js';
|
|
20
|
+
import { SKILL_NAME_RE, compareVersions, latestPack, latestSkillVersions, servedPackStatus, skillsCheckFromEnv, } from './skillsversion.js';
|
|
20
21
|
/**
|
|
21
22
|
* The one definition of "dedicated server vs relay" this server gives agents.
|
|
22
23
|
* Used in the server instructions, the relay tool description, and every relay
|
|
@@ -433,7 +434,7 @@ function autoStop(maxDuration) {
|
|
|
433
434
|
function withHost(result, label) {
|
|
434
435
|
return { ...result, content: [{ type: 'text', text: `[${label}]` }, ...result.content] };
|
|
435
436
|
}
|
|
436
|
-
export function registerTools(server, client, config, auth) {
|
|
437
|
+
export function registerTools(server, client, config, auth, options = {}) {
|
|
437
438
|
const mutating = !config.readOnly;
|
|
438
439
|
// Every result names the API host it came from, first, so a session pointed
|
|
439
440
|
// at a custom EDGEGAP_BASE_URL can never be mistaken for production.
|
|
@@ -1847,8 +1848,8 @@ export function registerTools(server, client, config, auth) {
|
|
|
1847
1848
|
max_latency_ms: z.number().int().min(1).optional(),
|
|
1848
1849
|
}))
|
|
1849
1850
|
.optional()
|
|
1850
|
-
.describe('Rule relaxations after a player has waited this long, e.g. [{after_seconds:
|
|
1851
|
-
ticket_expiration: z.string().optional().describe('Default "
|
|
1851
|
+
.describe('Rule relaxations after a player has waited this long, e.g. [{after_seconds: 20, min_team_size: 1}]. Keep each below ticket_expiration.'),
|
|
1852
|
+
ticket_expiration: z.string().optional().describe('Default "30s", so a developer testing alone is matched or told to retry within 30 s instead of waiting minutes. Raise it only for production queues.'),
|
|
1852
1853
|
inspect: z.boolean().optional().describe('Expose the inspection API for debugging. Default true; turn off for production.'),
|
|
1853
1854
|
verify_version: z.boolean().optional().describe('Look up the application version first. Default true.'),
|
|
1854
1855
|
allowed_cors_origins: z
|
|
@@ -1910,7 +1911,7 @@ export function registerTools(server, client, config, auth) {
|
|
|
1910
1911
|
],
|
|
1911
1912
|
});
|
|
1912
1913
|
}));
|
|
1913
|
-
registerSkills(server, tool);
|
|
1914
|
+
registerSkills(server, tool, config, options);
|
|
1914
1915
|
}
|
|
1915
1916
|
// ==================================================================== skills ====
|
|
1916
1917
|
/**
|
|
@@ -1921,7 +1922,10 @@ export function registerTools(server, client, config, auth) {
|
|
|
1921
1922
|
* - resources, one per file: for clients that browse or @-mention resources.
|
|
1922
1923
|
* All three read the same bundle (src/skills.generated.ts). No token, no network.
|
|
1923
1924
|
*/
|
|
1924
|
-
function registerSkills(server, tool) {
|
|
1925
|
+
function registerSkills(server, tool, config, options) {
|
|
1926
|
+
const hosted = config.transport === 'hosted';
|
|
1927
|
+
const check = options.skillsCheck ?? skillsCheckFromEnv(typeof process === 'undefined' ? {} : process.env);
|
|
1928
|
+
const local = hosted ? undefined : options.localSkills;
|
|
1925
1929
|
const names = SKILLS_PACK.skills.map((s) => s.name);
|
|
1926
1930
|
const pack = `${SKILLS_PACK.version} (${SKILLS_PACK.commit.slice(0, 7)})`;
|
|
1927
1931
|
const howToFetch = (skill) => `Fetch any of these with edgegap_get_skill {skill: "${skill}", file: "<path>"}, or read the ` +
|
|
@@ -1937,21 +1941,27 @@ function registerSkills(server, tool) {
|
|
|
1937
1941
|
'(edgegap-eos-voice to add voice chat to it), edgegap-fusion-simplefps for the Photon Simple FPS sample, edgegap-godot for Godot 4 with a Godot server, ' +
|
|
1938
1942
|
'edgegap-colyseus for a Colyseus server, edgegap-nakama for a game with a Nakama backend, edgegap-playfab for a game that keeps PlayFab Matchmaking, ' +
|
|
1939
1943
|
'edgegap-threejs for a Three.js or other browser game with its own Node.js server, ' +
|
|
1940
|
-
'edgegap-manus for a browser game built with Manus, edgegap for any other engine or platform questions; it routes to the rest.
|
|
1941
|
-
'API call.',
|
|
1944
|
+
'edgegap-manus for a browser game built with Manus, edgegap for any other engine or platform questions; it routes to the rest. ' +
|
|
1945
|
+
'Also says whether a newer skills pack is on GitHub (reads one version number, no Edgegap API call).',
|
|
1942
1946
|
inputSchema: {},
|
|
1943
|
-
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint:
|
|
1944
|
-
}, async () =>
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1947
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
1948
|
+
}, async () => {
|
|
1949
|
+
const status = servedPackStatus(await latestPack(check), hosted);
|
|
1950
|
+
return ok({
|
|
1951
|
+
pack,
|
|
1952
|
+
...status,
|
|
1953
|
+
source: SKILLS_PACK.source,
|
|
1954
|
+
skills: SKILLS_PACK.skills.map((s) => ({
|
|
1955
|
+
name: s.name,
|
|
1956
|
+
version: s.version,
|
|
1957
|
+
description: s.description,
|
|
1958
|
+
files: s.files.length,
|
|
1959
|
+
})),
|
|
1960
|
+
next_step: 'Load the skill that matches the project with edgegap_get_skill, then follow it. ' +
|
|
1961
|
+
'If the developer also has Edgegap skills installed in their agent (a skills folder or the Claude Code plugin), ' +
|
|
1962
|
+
'edgegap_update_skills checks whether those copies are current.',
|
|
1963
|
+
});
|
|
1964
|
+
});
|
|
1955
1965
|
tool('edgegap_get_skill', {
|
|
1956
1966
|
title: 'Load an Edgegap agent skill',
|
|
1957
1967
|
description: 'Load one Edgegap agent skill: its SKILL.md (the workflow to follow) by default, or one of ' +
|
|
@@ -1983,13 +1993,160 @@ function registerSkills(server, tool) {
|
|
|
1983
1993
|
return fail(`"${file}" is not a file in the ${skill.name} skill. Its files are:\n` +
|
|
1984
1994
|
skill.files.map((f) => `- ${f.path}`).join('\n'));
|
|
1985
1995
|
}
|
|
1986
|
-
const
|
|
1996
|
+
const status = found.path === 'SKILL.md' ? servedPackStatus(await latestPack(check), hosted) : undefined;
|
|
1997
|
+
const header = `${skill.name} ${skill.version} · ${found.path} · pack ${pack}` +
|
|
1998
|
+
(status?.update ? `\nNote: ${status.update}` : '');
|
|
1987
1999
|
const others = found.path === 'SKILL.md' ? fileIndex(skill) : [];
|
|
1988
2000
|
const footer = others.length
|
|
1989
2001
|
? `\n\n---\nOther files in this skill:\n${others.map((p) => `- ${p}`).join('\n')}\n\n${howToFetch(skill.name)}`
|
|
1990
2002
|
: '';
|
|
1991
2003
|
return { content: [{ type: 'text', text: `${header}\n\n${found.content}${footer}` }] };
|
|
1992
2004
|
});
|
|
2005
|
+
tool('edgegap_update_skills', {
|
|
2006
|
+
title: 'Check and update the installed Edgegap skills',
|
|
2007
|
+
description: 'Check whether the Edgegap agent skills installed in the developer\'s agent are the latest, and update them. ' +
|
|
2008
|
+
(hosted
|
|
2009
|
+
? 'This hosted server cannot see the developer\'s disk: pass installed_versions (each loaded skill\'s ' +
|
|
2010
|
+
'metadata.version from its SKILL.md frontmatter) and it compares them with the latest on GitHub and says how to update. '
|
|
2011
|
+
: 'Finds installs made with the skills CLI (user-wide or this project), the Claude Code plugin edgegap@edgegap, and skills ' +
|
|
2012
|
+
'copied by hand into an agent\'s skills folder, and compares each skill with the latest on GitHub. Without apply it only ' +
|
|
2013
|
+
'checks and changes nothing. With apply=true it runs each outdated install\'s own updater (npx skills update for the Edgegap ' +
|
|
2014
|
+
'skills only, or claude plugin update) and rewrites hand-copied skills from the files bundled in this server; ask the ' +
|
|
2015
|
+
'developer before applying. ') +
|
|
2016
|
+
'Skill text is never downloaded by this tool. The skills served by edgegap_get_skill need no update here.',
|
|
2017
|
+
inputSchema: {
|
|
2018
|
+
...(local
|
|
2019
|
+
? {
|
|
2020
|
+
apply: z
|
|
2021
|
+
.boolean()
|
|
2022
|
+
.optional()
|
|
2023
|
+
.describe('Run the updates for outdated installs. Omit or false to only check.'),
|
|
2024
|
+
}
|
|
2025
|
+
: {}),
|
|
2026
|
+
installed_versions: z
|
|
2027
|
+
.record(z.string(), z.string())
|
|
2028
|
+
.optional()
|
|
2029
|
+
.describe('Skill name → version of skills you have loaded from somewhere this server cannot see, e.g. ' +
|
|
2030
|
+
'{"edgegap-unity": "0.1.8"}. The version is metadata.version in the SKILL.md frontmatter.'),
|
|
2031
|
+
},
|
|
2032
|
+
annotations: { readOnlyHint: !local, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
2033
|
+
}, async (args) => {
|
|
2034
|
+
const apply = args.apply === true;
|
|
2035
|
+
const given = Object.entries(args.installed_versions ?? {}).filter(([n]) => SKILL_NAME_RE.test(n));
|
|
2036
|
+
const installs = local ? await local.findSkillsInstalls(local.env) : [];
|
|
2037
|
+
const wanted = [...installs.flatMap((i) => i.skills.map((s) => s.name)), ...given.map(([n]) => n)];
|
|
2038
|
+
const [packLatest, latest] = await Promise.all([latestPack(check), latestSkillVersions(wanted, check)]);
|
|
2039
|
+
const row = (name, installed) => {
|
|
2040
|
+
const l = latest[name];
|
|
2041
|
+
const status = !l?.version || !installed ? 'unknown' : compareVersions(installed, l.version) < 0 ? 'update available' : 'up to date';
|
|
2042
|
+
return {
|
|
2043
|
+
name,
|
|
2044
|
+
installed: installed ?? 'no version in its SKILL.md',
|
|
2045
|
+
latest: l?.version ?? 'unknown (not in the pack)',
|
|
2046
|
+
latest_from: l?.source === 'github' ? 'GitHub main' : l?.source === 'bundled' ? 'this server\'s bundle (GitHub not reachable)' : 'unknown',
|
|
2047
|
+
status,
|
|
2048
|
+
};
|
|
2049
|
+
};
|
|
2050
|
+
const report = installs.map((i) => ({ install: i, rows: i.skills.map((s) => row(s.name, s.version)) }));
|
|
2051
|
+
const outdatedOf = (rows) => rows.filter((r) => r.status !== 'up to date').map((r) => r.name);
|
|
2052
|
+
const result = {
|
|
2053
|
+
latest_pack: packLatest.version ?? `unknown: ${packLatest.error}`,
|
|
2054
|
+
installs: report.map(({ install, rows }) => ({ where: install.where, kind: install.kind, skills: rows })),
|
|
2055
|
+
};
|
|
2056
|
+
if (given.length)
|
|
2057
|
+
result.loaded_skills = given.map(([n, v]) => row(n, v));
|
|
2058
|
+
const anyOutdated = report.some(({ rows }) => outdatedOf(rows).length) || given.some(([n, v]) => row(n, v).status === 'update available');
|
|
2059
|
+
const howToUpdate = 'Reinstall the way they were installed: npx skills add edgegap/llm-agent-skills --skill "*" (add -g for user-wide); ' +
|
|
2060
|
+
'in Claude Code, /plugin marketplace update edgegap then /plugin update edgegap@edgegap; or copy the skills folders from ' +
|
|
2061
|
+
'github.com/edgegap/llm-agent-skills again.';
|
|
2062
|
+
if (given.some(([n, v]) => row(n, v).status === 'update available'))
|
|
2063
|
+
result.how_to_update = howToUpdate;
|
|
2064
|
+
if (!local) {
|
|
2065
|
+
result.note = hosted
|
|
2066
|
+
? 'This hosted server cannot see the developer\'s installed skills; only installed_versions was checked.'
|
|
2067
|
+
: 'This server does not look for installed skills; only installed_versions was checked.';
|
|
2068
|
+
if (anyOutdated)
|
|
2069
|
+
result.how_to_update = howToUpdate;
|
|
2070
|
+
return ok(result);
|
|
2071
|
+
}
|
|
2072
|
+
if (installs.length === 0) {
|
|
2073
|
+
result.found = 'No Edgegap skills installed in this machine\'s agent folders, project or Claude Code plugins.';
|
|
2074
|
+
if (anyOutdated)
|
|
2075
|
+
result.how_to_update = howToUpdate;
|
|
2076
|
+
return ok(result);
|
|
2077
|
+
}
|
|
2078
|
+
if (!anyOutdated) {
|
|
2079
|
+
result.status = 'Every installed Edgegap skill is current.';
|
|
2080
|
+
return ok(result);
|
|
2081
|
+
}
|
|
2082
|
+
const plan = report.flatMap(({ install, rows }) => {
|
|
2083
|
+
const names = outdatedOf(rows);
|
|
2084
|
+
if (!names.length)
|
|
2085
|
+
return [];
|
|
2086
|
+
if (install.kind === 'copy') {
|
|
2087
|
+
return names.map((n) => {
|
|
2088
|
+
const bundled = SKILLS_PACK.skills.find((s) => s.name === n)?.version;
|
|
2089
|
+
const r = rows.find((x) => x.name === n);
|
|
2090
|
+
const canCopy = bundled && (r.installed === 'no version in its SKILL.md' || compareVersions(r.installed, bundled) < 0);
|
|
2091
|
+
return {
|
|
2092
|
+
skill: install.skills.find((s) => s.name === n),
|
|
2093
|
+
action: canCopy
|
|
2094
|
+
? `rewrite ${n} in ${install.skills.find((s) => s.name === n).dir} from this server's bundle (${bundled})`
|
|
2095
|
+
: `${n}: GitHub has ${r.latest} but this server bundles ${bundled ?? 'nothing newer'}; recopy it from github.com/edgegap/llm-agent-skills`,
|
|
2096
|
+
canCopy: Boolean(canCopy),
|
|
2097
|
+
};
|
|
2098
|
+
});
|
|
2099
|
+
}
|
|
2100
|
+
const commands = local.updateCommands(install, names);
|
|
2101
|
+
return [{ commands, action: commands.map((c) => c.join(' ')).join(' && ') }];
|
|
2102
|
+
});
|
|
2103
|
+
if (!apply) {
|
|
2104
|
+
result.would_run = plan.map((p) => p.action);
|
|
2105
|
+
result.next_step = config.readOnly
|
|
2106
|
+
? 'Read-only mode (EDGEGAP_READ_ONLY): this server will not apply updates. Run the commands above yourself.'
|
|
2107
|
+
: 'Ask the developer, then call edgegap_update_skills again with apply=true to run these.';
|
|
2108
|
+
return ok(result);
|
|
2109
|
+
}
|
|
2110
|
+
if (config.readOnly) {
|
|
2111
|
+
return fail('Read-only mode (EDGEGAP_READ_ONLY) is on, so skills are not updated from here. Call without apply to see the commands to run yourself.');
|
|
2112
|
+
}
|
|
2113
|
+
const applied = [];
|
|
2114
|
+
let failed = false;
|
|
2115
|
+
for (const p of plan) {
|
|
2116
|
+
if (p.commands) {
|
|
2117
|
+
for (const cmd of p.commands) {
|
|
2118
|
+
try {
|
|
2119
|
+
const out = await local.env.run(cmd[0], cmd.slice(1), local.env.cwd);
|
|
2120
|
+
applied.push(`ran: ${cmd.join(' ')}${out ? `\n${out.split('\n').slice(-10).join('\n')}` : ''}`);
|
|
2121
|
+
}
|
|
2122
|
+
catch (err) {
|
|
2123
|
+
failed = true;
|
|
2124
|
+
applied.push(`failed: ${err.message.split('\n').slice(0, 12).join('\n')}`);
|
|
2125
|
+
break;
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
else if (p.canCopy && p.skill) {
|
|
2130
|
+
try {
|
|
2131
|
+
applied.push(`updated: ${await local.replaceFromBundle(local.env, p.skill)}`);
|
|
2132
|
+
}
|
|
2133
|
+
catch (err) {
|
|
2134
|
+
failed = true;
|
|
2135
|
+
applied.push(`skipped: ${err.message}`);
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
else {
|
|
2139
|
+
applied.push(`not updated: ${p.action}`);
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2142
|
+
const after = await local.findSkillsInstalls(local.env);
|
|
2143
|
+
result.applied = applied;
|
|
2144
|
+
result.after = after.map((i) => ({ where: i.where, skills: i.skills.map((s) => row(s.name, s.version)) }));
|
|
2145
|
+
result.reload =
|
|
2146
|
+
'The running agent session keeps the skills it already loaded. Start a new session ' +
|
|
2147
|
+
'(in Claude Code, /reload-plugins also works for the plugin) to use the update.';
|
|
2148
|
+
return failed ? { ...ok(result), isError: true } : ok(result);
|
|
2149
|
+
});
|
|
1993
2150
|
for (const skill of SKILLS_PACK.skills) {
|
|
1994
2151
|
// A prompt per skill: in Claude Code these show up as slash commands.
|
|
1995
2152
|
server.registerPrompt(skill.name, {
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edgegap/mcp",
|
|
3
3
|
"mcpName": "dev.edgegap/mcp",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.9.0",
|
|
5
5
|
"description": "Check, push, and deploy game servers on Edgegap from your coding agent, with relays for P2P games. Runs locally; your API token never leaves your machine.",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prebuild": "rm -rf dist",
|
|
8
8
|
"build": "tsc && chmod +x dist/index.js dist/http.js",
|
|
9
9
|
"typecheck": "tsc --noEmit",
|
|
10
10
|
"typecheck:worker": "tsc -p worker/tsconfig.json --noEmit",
|
|
11
|
-
"test": "node --test test/unit.test.mjs && node test/package.mjs && node test/skills.mjs && node test/smoke.mjs && node test/guards.mjs && node test/elicit.mjs && node test/newtools.mjs && node test/http.mjs && node test/spec.mjs && node test/snapshot.mjs",
|
|
11
|
+
"test": "node --test test/unit.test.mjs && node test/package.mjs && node test/skills.mjs && node test/updateskills.mjs && node test/smoke.mjs && node test/guards.mjs && node test/elicit.mjs && node test/newtools.mjs && node test/http.mjs && node test/spec.mjs && node test/snapshot.mjs",
|
|
12
12
|
"test:unit": "node --test test/unit.test.mjs",
|
|
13
13
|
"snapshot:update": "node test/snapshot.mjs --update",
|
|
14
14
|
"scan": "node scripts/scan-repo.mjs",
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"prepublishOnly": "npm run build",
|
|
20
20
|
"sync-skills": "node scripts/sync-skills.mjs",
|
|
21
21
|
"check-skills": "node scripts/sync-skills.mjs --check",
|
|
22
|
-
"test:worker": "node test/worker-telemetry.mjs"
|
|
22
|
+
"test:worker": "node test/worker-telemetry.mjs",
|
|
23
|
+
"bundle": "node scripts/build-mcpb.mjs"
|
|
23
24
|
},
|
|
24
25
|
"keywords": [
|
|
25
26
|
"mcp",
|