@edgegap/mcp 0.18.0 → 0.19.1
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 +21 -8
- package/dist/hosted.js +27 -0
- package/dist/http.js +8 -3
- package/dist/ops.js +142 -0
- package/dist/outputs.js +1 -1
- package/dist/skills.generated.js +52 -25
- package/dist/tools.js +443 -24
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/dist/tools.js
CHANGED
|
@@ -18,6 +18,7 @@ import { generateDockerfile, DockerfileInputError } from './dockerfile.js';
|
|
|
18
18
|
import { buildMatchmakerConfig, DASHBOARD_URL } from './matchmaker.js';
|
|
19
19
|
import { badImage, badTag, ENCRYPTED_PLACEHOLDER, isEncryptedPlaceholder, looksSecret, TAG_FIX } from './image.js';
|
|
20
20
|
import { OUTPUT } from './outputs.js';
|
|
21
|
+
import { analyzeSeries, finiteValues, percentile, mapLimit, groupLogMatches, lineMatcher, ERROR_PATTERN } from './ops.js';
|
|
21
22
|
import { finishReport, codeForStatus } from './callreport.js';
|
|
22
23
|
import { SKILLS_PACK, findSkill, findSkillFile, fileIndex, mimeType, skillUri } from './skills.js';
|
|
23
24
|
import { SKILLS_CLI, SKILL_NAME_RE, compareVersions, latestPack, latestSkillVersions, servedPackStatus, skillsCheckFromEnv, } from './skillsversion.js';
|
|
@@ -111,6 +112,7 @@ export function serverInstructions(mode) {
|
|
|
111
112
|
`Supabase backend: ${skillUri('edgegap-supabase', 'SKILL.md')}, ` +
|
|
112
113
|
`Three.js or web game with a Node server: ${skillUri('edgegap-threejs', 'SKILL.md')}, ` +
|
|
113
114
|
`vibe-coded single-player web game going online: ${skillUri('edgegap-vibe-coded', 'SKILL.md')}, ` +
|
|
115
|
+
`fal.ai game: ${skillUri('edgegap-fal', 'SKILL.md')}, ` +
|
|
114
116
|
`Manus game: ${skillUri('edgegap-manus', 'SKILL.md')}, ` +
|
|
115
117
|
`matchmaking, parties, regions or backfill design: ${skillUri('edgegap-matchmaking', 'SKILL.md')}, ` +
|
|
116
118
|
`host/client games on Edgegap relays: ${skillUri('edgegap-relays', 'SKILL.md')}, ` +
|
|
@@ -554,6 +556,27 @@ const dryRunParam = z
|
|
|
554
556
|
.optional()
|
|
555
557
|
.describe('Show the exact request (method, host, path, body) with secrets masked, and send nothing. ' +
|
|
556
558
|
'Local checks still run. Use it to confirm a billable or destructive call before making it.');
|
|
559
|
+
/**
|
|
560
|
+
* The confirm parameter of the destructive tools. Without it they send nothing
|
|
561
|
+
* and return a preview, so an agent has to show the developer what it is about
|
|
562
|
+
* to stop or delete before doing it. Stopping a deployment this server started
|
|
563
|
+
* (tagged edgegap-mcp) needs no confirm: that is the cleanup every task ends with.
|
|
564
|
+
*/
|
|
565
|
+
const confirmParam = z
|
|
566
|
+
.boolean()
|
|
567
|
+
.optional()
|
|
568
|
+
.describe('Set true only after the developer approved this exact call. Without it nothing is sent: the result ' +
|
|
569
|
+
'previews what would be stopped or deleted (status "confirmation_required").');
|
|
570
|
+
function confirmationRequired(action, preview) {
|
|
571
|
+
return withMeta(ok({
|
|
572
|
+
status: 'confirmation_required',
|
|
573
|
+
sent: false,
|
|
574
|
+
action,
|
|
575
|
+
...preview,
|
|
576
|
+
next_step: 'Nothing was changed. Show this to the developer and ask; if they approve, call again with the same ' +
|
|
577
|
+
'arguments plus confirm: true.',
|
|
578
|
+
}), { props: { result_state: 'confirmation_required' } });
|
|
579
|
+
}
|
|
557
580
|
function dryRunResult(requests, notes = []) {
|
|
558
581
|
return ok({
|
|
559
582
|
dry_run: true,
|
|
@@ -829,7 +852,11 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
829
852
|
secret_env: 'env vars named like secrets (TOKEN, SECRET, PASSWORD, API_KEY...) are sent hidden',
|
|
830
853
|
stop: config.stopOwnOnly
|
|
831
854
|
? `one exact request_id per call; no bulk stop; only deployments tagged "${AGENT_TAG}" (EDGEGAP_STOP_OWN_ONLY)`
|
|
832
|
-
:
|
|
855
|
+
: `one exact request_id per call; no bulk stop; a running deployment without the "${AGENT_TAG}" tag needs confirm: true`,
|
|
856
|
+
confirm: 'stop (of a deployment this server did not start), delete_app, delete_app_version and delete_registry_tag send nothing without confirm: true and return a preview instead',
|
|
857
|
+
...(config.appAllowlist.length
|
|
858
|
+
? { allowlist: 'create, change, delete and deploy in listed applications only; stop, tag and report only deployments of listed applications; reads are not limited' }
|
|
859
|
+
: {}),
|
|
833
860
|
auto_stop: 'each deploy reports its version\'s max_duration; Edgegap has no per-deployment time limit',
|
|
834
861
|
long_running: `deploying a version whose max_duration is unlimited or above ${config.maxDurationCeiling} minutes needs allow_long_running: true`,
|
|
835
862
|
deletes: 'one exact app or version per call; refused while its deployments run; an app with versions needs max_versions',
|
|
@@ -1881,25 +1908,54 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
1881
1908
|
description: 'Gracefully stop one deployment by request_id, sending SIGTERM to the container. ' +
|
|
1882
1909
|
'Stop every deployment you started for testing before ending your task. This tool ' +
|
|
1883
1910
|
'stops exactly one deployment, named by its exact request_id: empty IDs, wildcards ' +
|
|
1884
|
-
'and lists are refused, and bulk stop is deliberately not exposed.'
|
|
1911
|
+
'and lists are refused, and bulk stop is deliberately not exposed. A deployment this server ' +
|
|
1912
|
+
`started (tagged "${AGENT_TAG}") stops right away; any other running deployment may be serving ` +
|
|
1913
|
+
'players, so without confirm: true the result only previews it and nothing is sent.',
|
|
1885
1914
|
inputSchema: {
|
|
1886
1915
|
request_id: z.string().describe('The exact request_id of the one deployment to stop, e.g. "61b1be8f54d9".'),
|
|
1916
|
+
confirm: confirmParam,
|
|
1887
1917
|
dry_run: dryRunParam,
|
|
1888
1918
|
},
|
|
1889
1919
|
annotations: { destructiveHint: true, idempotentHint: true, openWorldHint: true },
|
|
1890
|
-
}, async ({ request_id, dry_run }) => guarded(auth, NOT_FOUND.deployment, async () => {
|
|
1920
|
+
}, async ({ request_id, confirm, dry_run }) => guarded(auth, NOT_FOUND.deployment, async () => {
|
|
1891
1921
|
const bad = checkRequestId(request_id);
|
|
1892
1922
|
if (bad)
|
|
1893
1923
|
return bad;
|
|
1924
|
+
if (!dry_run) {
|
|
1925
|
+
const blocked = await deploymentOutsideAllowlist(request_id);
|
|
1926
|
+
if (blocked)
|
|
1927
|
+
return blocked;
|
|
1928
|
+
}
|
|
1929
|
+
const isOwn = () => client
|
|
1930
|
+
.listDeploymentTags(request_id)
|
|
1931
|
+
.then((r) => (r.tags ?? []).some((t) => t.name === AGENT_TAG || t.name === 'mcp'));
|
|
1894
1932
|
if (config.stopOwnOnly && !dry_run) {
|
|
1895
|
-
|
|
1896
|
-
.listDeploymentTags(request_id)
|
|
1897
|
-
.then((r) => (r.tags ?? []).some((t) => t.name === AGENT_TAG || t.name === 'mcp'));
|
|
1898
|
-
if (!own) {
|
|
1933
|
+
if (!(await isOwn())) {
|
|
1899
1934
|
return fail(`Refused: deployment ${request_id} has no "${AGENT_TAG}" tag, so this server did not start it, and ` +
|
|
1900
1935
|
'EDGEGAP_STOP_OWN_ONLY is on. Nothing was sent. Ask the developer to stop it from the dashboard.');
|
|
1901
1936
|
}
|
|
1902
1937
|
}
|
|
1938
|
+
else if (!dry_run && confirm !== true && !(await isOwn().catch(() => false))) {
|
|
1939
|
+
// Not started by an agent: preview it if it is still running. One
|
|
1940
|
+
// that is gone or already stopping goes on to the idempotent path.
|
|
1941
|
+
const s = await client.getDeployment(request_id).catch(() => undefined);
|
|
1942
|
+
if (s && s.running && !(s.current_status ?? '').toUpperCase().includes('TERMINAT')) {
|
|
1943
|
+
const c = compactDeployment(s);
|
|
1944
|
+
return confirmationRequired('stop deployment', {
|
|
1945
|
+
deployment: {
|
|
1946
|
+
request_id,
|
|
1947
|
+
status: c.status,
|
|
1948
|
+
application: c.application,
|
|
1949
|
+
version: c.version,
|
|
1950
|
+
location: c.location,
|
|
1951
|
+
fqdn: c.fqdn,
|
|
1952
|
+
running_for_seconds: c.elapsed_seconds,
|
|
1953
|
+
tags: s.tags,
|
|
1954
|
+
},
|
|
1955
|
+
warning: `Not started through this server (no "${AGENT_TAG}" tag): it may be serving players, and stopping it ends their match.`,
|
|
1956
|
+
});
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1903
1959
|
if (dry_run) {
|
|
1904
1960
|
const dry = client.dryRun();
|
|
1905
1961
|
await dry.client.stopDeployment(request_id);
|
|
@@ -1969,9 +2025,11 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
1969
2025
|
tool('edgegap_get_deployment_metrics', {
|
|
1970
2026
|
title: 'Get CPU, memory and network use of a deployment',
|
|
1971
2027
|
description: 'Summarise a deployment\'s resource use over time: CPU, CPU throttling, memory and network, ' +
|
|
1972
|
-
'each as latest, average and peak, with the API\'s own labels
|
|
1973
|
-
'(
|
|
1974
|
-
'
|
|
2028
|
+
'each as latest, average, p95 and peak, with the API\'s own labels, plus anomaly flags ' +
|
|
2029
|
+
'(spikes above mean + 3 sd, a rising trend such as a memory leak, any CPU throttling) collected ' +
|
|
2030
|
+
'in `anomalies`. Use it to size a version (cpu_units, memory_mb) from a real match, or to check ' +
|
|
2031
|
+
'whether a crash was memory or CPU starvation before redeploying. Defaults to the whole life of ' +
|
|
2032
|
+
'the deployment. To compare two versions, use edgegap_compare_versions.',
|
|
1975
2033
|
inputSchema: {
|
|
1976
2034
|
request_id: z.string().describe('The request_id of the deployment.'),
|
|
1977
2035
|
start_time: z.string().optional().describe('ISO 8601. Default: when the deployment started.'),
|
|
@@ -1985,13 +2043,18 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
1985
2043
|
if (bad)
|
|
1986
2044
|
return bad;
|
|
1987
2045
|
const m = await client.getDeploymentMetrics(request_id, { start_time, end_time, steps: step });
|
|
1988
|
-
|
|
2046
|
+
const series = {
|
|
2047
|
+
cpu: analyzeSeries(m.cpu),
|
|
2048
|
+
cpu_throttle_rate: analyzeSeries(m.cpu_throttle_rate, { nonzero: true }),
|
|
2049
|
+
memory: analyzeSeries(m.mem),
|
|
2050
|
+
network_receive: analyzeSeries(m.network?.receive),
|
|
2051
|
+
network_transmit: analyzeSeries(m.network?.transmit),
|
|
2052
|
+
};
|
|
2053
|
+
const anomalies = Object.entries(series).flatMap(([name, s]) => (s?.anomalies ?? []).map((a) => `${name}: ${a}`));
|
|
2054
|
+
return withMeta(ok({
|
|
1989
2055
|
request_id,
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
memory: summarizeSeries(m.mem),
|
|
1993
|
-
network_receive: summarizeSeries(m.network?.receive),
|
|
1994
|
-
network_transmit: summarizeSeries(m.network?.transmit),
|
|
2056
|
+
...series,
|
|
2057
|
+
anomalies: anomalies.length ? anomalies : 'none found',
|
|
1995
2058
|
totals: m.total
|
|
1996
2059
|
? {
|
|
1997
2060
|
received: summarizeSeries(m.total.receive_total)?.latest,
|
|
@@ -2000,8 +2063,310 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
2000
2063
|
disk_written: summarizeSeries(m.total.disk_write_total)?.latest,
|
|
2001
2064
|
}
|
|
2002
2065
|
: undefined,
|
|
2003
|
-
note: 'Units are as the API labels them; values are averaged per step.',
|
|
2066
|
+
note: 'Units are as the API labels them; values are averaged per step. p95 is over the steps.',
|
|
2067
|
+
}), { props: { anomaly_count: anomalies.length } });
|
|
2068
|
+
}));
|
|
2069
|
+
// ================================================== operating live games ====
|
|
2070
|
+
// Read-only views across many deployments. The hosted Worker makes one API
|
|
2071
|
+
// call per deployment read, inside a per-request subrequest budget, so it
|
|
2072
|
+
// inspects fewer deployments per call than the local server.
|
|
2073
|
+
const hosted = config.transport === 'hosted';
|
|
2074
|
+
const OPS_CAP = hosted ? 20 : 100;
|
|
2075
|
+
const COMPARE_CAP = hosted ? 6 : 20;
|
|
2076
|
+
/** Running deployments of an application (and version), newest first, at most `limit`. */
|
|
2077
|
+
async function runningDeployments(application, version, limit, startedAfter) {
|
|
2078
|
+
const filters = [];
|
|
2079
|
+
if (application)
|
|
2080
|
+
filters.push({ field: 'application', operator: 'eq', value: application });
|
|
2081
|
+
if (version)
|
|
2082
|
+
filters.push({ field: 'version', operator: 'eq', value: version });
|
|
2083
|
+
if (startedAfter)
|
|
2084
|
+
filters.push({ field: 'created_at', operator: 'gte', value: startedAfter });
|
|
2085
|
+
const query = JSON.stringify({ filters, order_by: [{ field: 'created_at', order: 'desc' }] });
|
|
2086
|
+
const res = await client.listDeployments({ query, limit });
|
|
2087
|
+
const rows = (res.data ?? []).filter((d) => d.request_id);
|
|
2088
|
+
return { rows, total: res.total_count ?? rows.length };
|
|
2089
|
+
}
|
|
2090
|
+
/** Crash facts of one deployment from its logs endpoint; never throws. */
|
|
2091
|
+
async function crashFacts(requestId) {
|
|
2092
|
+
try {
|
|
2093
|
+
const l = await client.getDeploymentLogs(requestId);
|
|
2094
|
+
return {
|
|
2095
|
+
restarts: l.crash_data?.restart_count ?? 0,
|
|
2096
|
+
exit_code: l.crash_data?.exit_code,
|
|
2097
|
+
crash_message: l.crash_data?.message || undefined,
|
|
2098
|
+
logs: [l.logs, l.crash_logs].filter(Boolean).join('\n'),
|
|
2099
|
+
};
|
|
2100
|
+
}
|
|
2101
|
+
catch {
|
|
2102
|
+
return undefined;
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
function healthOf(s) {
|
|
2106
|
+
if (!s)
|
|
2107
|
+
return 'unknown';
|
|
2108
|
+
const st = (s.current_status ?? '').toUpperCase();
|
|
2109
|
+
if (s.error || st.includes('ERROR'))
|
|
2110
|
+
return 'error';
|
|
2111
|
+
if (st.includes('TERMINAT'))
|
|
2112
|
+
return 'terminating';
|
|
2113
|
+
if (st.includes('READY'))
|
|
2114
|
+
return 'ready';
|
|
2115
|
+
return 'pending';
|
|
2116
|
+
}
|
|
2117
|
+
const where = (s) => s?.location ? [s.location.city, s.location.country].filter(Boolean).join(', ') || 'unknown' : 'unknown';
|
|
2118
|
+
const scopeOf = (application, version) => application ? `${application}${version ? ` / ${version}` : ''}` : 'all applications';
|
|
2119
|
+
tool('edgegap_fleet_health', {
|
|
2120
|
+
title: 'Summarise the health of running deployments',
|
|
2121
|
+
description: 'One call for "is anything wrong right now?" across running deployments, instead of checking them one ' +
|
|
2122
|
+
'by one: counts by status, the deployments in error with their error detail, ones stuck starting for ' +
|
|
2123
|
+
'over 10 minutes, and totals per location and per version with unhealthy ones flagged. ' +
|
|
2124
|
+
'check_crashes: true also reads each deployment\'s crash data (restarts, exit codes). Covers what ' +
|
|
2125
|
+
'Edgegap still lists: stopped deployments are gone, so this is current state, not history. ' +
|
|
2126
|
+
`Inspects up to ${OPS_CAP} deployments per call, newest first. Read-only. Next: ` +
|
|
2127
|
+
'edgegap_search_deployment_logs for what the errors say, edgegap_compare_versions for a rollback decision.',
|
|
2128
|
+
inputSchema: {
|
|
2129
|
+
application: z.string().optional().describe('Only this application. Default: all.'),
|
|
2130
|
+
version: z.string().optional().describe('Only this version (needs application).'),
|
|
2131
|
+
max_deployments: z.number().int().optional().describe(`How many to inspect, 1-${OPS_CAP}. Default ${Math.min(50, OPS_CAP)}.`),
|
|
2132
|
+
check_crashes: z.boolean().optional().describe('Also read crash data (restart count, exit code) per deployment. Default false.'),
|
|
2133
|
+
},
|
|
2134
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
2135
|
+
}, async ({ application, version, max_deployments, check_crashes }) => guarded(auth, NOT_FOUND.app, async () => {
|
|
2136
|
+
if (version && !application)
|
|
2137
|
+
return fail('version needs application too.');
|
|
2138
|
+
const cap = clamp(max_deployments, 1, OPS_CAP, Math.min(50, OPS_CAP));
|
|
2139
|
+
const { rows, total } = await runningDeployments(application, version, cap);
|
|
2140
|
+
if (rows.length === 0) {
|
|
2141
|
+
return emptyState('empty', { scope: scopeOf(application, version), total: 0 }, 'No deployments are running here, so there is nothing to be unhealthy. Start one with edgegap_deploy.');
|
|
2142
|
+
}
|
|
2143
|
+
const inspected = await mapLimit(rows, 8, async (r) => {
|
|
2144
|
+
const status = await client.getDeployment(r.request_id).catch(() => undefined);
|
|
2145
|
+
const crash = check_crashes ? await crashFacts(r.request_id) : undefined;
|
|
2146
|
+
return { id: r.request_id, status, crash, health: healthOf(status) };
|
|
2004
2147
|
});
|
|
2148
|
+
const byStatus = {};
|
|
2149
|
+
const errors = [];
|
|
2150
|
+
const stuck = [];
|
|
2151
|
+
const crashes = [];
|
|
2152
|
+
const locs = new Map();
|
|
2153
|
+
const vers = new Map();
|
|
2154
|
+
const bump = (m, k) => {
|
|
2155
|
+
const b = m.get(k) ?? { total: 0, ready: 0, error: 0, pending: 0, restarts: 0 };
|
|
2156
|
+
m.set(k, b);
|
|
2157
|
+
return b;
|
|
2158
|
+
};
|
|
2159
|
+
for (const d of inspected) {
|
|
2160
|
+
byStatus[d.health] = (byStatus[d.health] ?? 0) + 1;
|
|
2161
|
+
const s = d.status;
|
|
2162
|
+
const ver = s ? `${s.app_name} / ${s.app_version}` : 'unknown';
|
|
2163
|
+
for (const b of [bump(locs, where(s)), bump(vers, ver)]) {
|
|
2164
|
+
b.total++;
|
|
2165
|
+
if (d.health === 'ready')
|
|
2166
|
+
b.ready++;
|
|
2167
|
+
if (d.health === 'error')
|
|
2168
|
+
b.error++;
|
|
2169
|
+
if (d.health === 'pending')
|
|
2170
|
+
b.pending++;
|
|
2171
|
+
b.restarts += d.crash?.restarts ?? 0;
|
|
2172
|
+
}
|
|
2173
|
+
if (d.health === 'error') {
|
|
2174
|
+
errors.push({ request_id: d.id, version: ver, location: where(s), detail: s?.error_detail || s?.current_status });
|
|
2175
|
+
}
|
|
2176
|
+
if (d.health === 'pending' && (s?.elapsed_time ?? 0) > 600) {
|
|
2177
|
+
stuck.push({ request_id: d.id, version: ver, location: where(s), status: s?.current_status, elapsed_seconds: s?.elapsed_time });
|
|
2178
|
+
}
|
|
2179
|
+
if (d.crash && (d.crash.restarts > 0 || d.crash.exit_code !== undefined)) {
|
|
2180
|
+
crashes.push({ request_id: d.id, version: ver, restarts: d.crash.restarts, exit_code: d.crash.exit_code, message: d.crash.crash_message });
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2183
|
+
const table = (m, key) => [...m.entries()]
|
|
2184
|
+
.map(([k, b]) => ({
|
|
2185
|
+
[key]: k,
|
|
2186
|
+
...b,
|
|
2187
|
+
error_rate: Math.round((b.error / b.total) * 100) / 100,
|
|
2188
|
+
...(b.error > 0 || b.restarts > 0 ? { unhealthy: true } : {}),
|
|
2189
|
+
}))
|
|
2190
|
+
.sort((a, b) => b.error - a.error || b.restarts - a.restarts || b.total - a.total);
|
|
2191
|
+
const byLocation = table(locs, 'location');
|
|
2192
|
+
const byVersion = table(vers, 'version');
|
|
2193
|
+
const unhealthyLocations = byLocation.filter((l) => l.unhealthy).map((l) => l.location);
|
|
2194
|
+
const problems = errors.length + stuck.length + crashes.length;
|
|
2195
|
+
return withMeta(ok({
|
|
2196
|
+
scope: scopeOf(application, version),
|
|
2197
|
+
verdict: problems === 0
|
|
2198
|
+
? `healthy: ${inspected.length} deployment${inspected.length === 1 ? '' : 's'} inspected, none in error${check_crashes ? ' or restarting' : ''}`
|
|
2199
|
+
: `${errors.length} in error, ${stuck.length} stuck starting${check_crashes ? `, ${crashes.length} restarted or crashed` : ''}, out of ${inspected.length} inspected`,
|
|
2200
|
+
running: total,
|
|
2201
|
+
inspected: inspected.length,
|
|
2202
|
+
...(total > inspected.length ? { not_inspected: total - inspected.length, note: `Only the ${inspected.length} newest were inspected. Narrow by application or version, or raise max_deployments (max ${OPS_CAP}).` } : {}),
|
|
2203
|
+
by_status: byStatus,
|
|
2204
|
+
errors: errors.length ? errors : undefined,
|
|
2205
|
+
stuck_starting: stuck.length ? stuck : undefined,
|
|
2206
|
+
crashes: check_crashes ? (crashes.length ? crashes : 'none') : undefined,
|
|
2207
|
+
unhealthy_locations: unhealthyLocations.length ? unhealthyLocations : undefined,
|
|
2208
|
+
by_location: byLocation,
|
|
2209
|
+
by_version: byVersion,
|
|
2210
|
+
next_step: problems
|
|
2211
|
+
? 'Read what failed with edgegap_search_deployment_logs (same application/version) or edgegap_get_deployment_logs for one request_id.'
|
|
2212
|
+
: check_crashes ? undefined : 'Pass check_crashes: true to also catch servers that restarted after a crash.',
|
|
2213
|
+
}), { props: { item_count: inspected.length, error_count: errors.length, check_crashes: check_crashes === true } });
|
|
2214
|
+
}));
|
|
2215
|
+
tool('edgegap_search_deployment_logs', {
|
|
2216
|
+
title: 'Search the logs of many deployments at once',
|
|
2217
|
+
description: 'Search the container and crash logs of running deployments of an application (and version) for a ' +
|
|
2218
|
+
'pattern, and group the matching lines by error, with counts and which deployments printed them: ' +
|
|
2219
|
+
'"every crash in version 1.4.2 since yesterday, grouped by error". Without a pattern it looks for ' +
|
|
2220
|
+
'errors, exceptions, fatal signals and out-of-memory kills. Also counts crash exit codes. Logs only ' +
|
|
2221
|
+
'exist while a deployment runs (or in Endpoint Storage), so stopped deployments are not searched. ' +
|
|
2222
|
+
`Searches up to ${OPS_CAP} deployments per call, newest first. Read-only.`,
|
|
2223
|
+
inputSchema: {
|
|
2224
|
+
application: z.string().optional().describe('Only this application. Default: all.'),
|
|
2225
|
+
version: z.string().optional().describe('Only this version (needs application).'),
|
|
2226
|
+
pattern: z.string().optional().describe('Text to find, case-insensitive. Default: common error and crash words.'),
|
|
2227
|
+
regex: z.boolean().optional().describe('Treat pattern as a regular expression. Default false.'),
|
|
2228
|
+
started_after: z.string().optional().describe('Only deployments started after this ISO 8601 time, e.g. "2026-11-12T00:00:00Z" for the last day.'),
|
|
2229
|
+
max_deployments: z.number().int().optional().describe(`How many to search, 1-${OPS_CAP}. Default ${Math.min(30, OPS_CAP)}.`),
|
|
2230
|
+
max_groups: z.number().int().optional().describe('Most error groups to return, 1-50. Default 15.'),
|
|
2231
|
+
},
|
|
2232
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
2233
|
+
}, async ({ application, version, pattern, regex, started_after, max_deployments, max_groups }) => guarded(auth, NOT_FOUND.app, async () => {
|
|
2234
|
+
if (version && !application)
|
|
2235
|
+
return fail('version needs application too.');
|
|
2236
|
+
if (started_after && Number.isNaN(Date.parse(started_after))) {
|
|
2237
|
+
return fail(`started_after "${started_after.slice(0, 40)}" is not an ISO 8601 time, e.g. "2026-11-12T00:00:00Z".`);
|
|
2238
|
+
}
|
|
2239
|
+
const matcher = pattern ? lineMatcher(pattern, regex === true) : lineMatcher(ERROR_PATTERN, true);
|
|
2240
|
+
if ('error' in matcher)
|
|
2241
|
+
return fail(matcher.error);
|
|
2242
|
+
const cap = clamp(max_deployments, 1, OPS_CAP, Math.min(30, OPS_CAP));
|
|
2243
|
+
const { rows, total } = await runningDeployments(application, version, cap, started_after);
|
|
2244
|
+
if (rows.length === 0) {
|
|
2245
|
+
return emptyState('empty', { scope: scopeOf(application, version), searched: 0 }, 'No running deployment matches, so there are no logs to search. Logs of stopped deployments only exist in Endpoint Storage, if it was set on the version.');
|
|
2246
|
+
}
|
|
2247
|
+
const read = await mapLimit(rows, 8, async (r) => ({ id: r.request_id, crash: await crashFacts(r.request_id) }));
|
|
2248
|
+
const matches = [];
|
|
2249
|
+
const exitCodes = {};
|
|
2250
|
+
const noLogs = [];
|
|
2251
|
+
let matchedDeployments = 0;
|
|
2252
|
+
for (const d of read) {
|
|
2253
|
+
if (!d.crash) {
|
|
2254
|
+
noLogs.push(d.id);
|
|
2255
|
+
continue;
|
|
2256
|
+
}
|
|
2257
|
+
if (d.crash.exit_code !== undefined)
|
|
2258
|
+
exitCodes[String(d.crash.exit_code)] = (exitCodes[String(d.crash.exit_code)] ?? 0) + 1;
|
|
2259
|
+
// The tail is enough: a crash is at the end, and a 1 MB log must not
|
|
2260
|
+
// stall the request.
|
|
2261
|
+
const lines = d.crash.logs.slice(-200_000).split('\n');
|
|
2262
|
+
let hit = false;
|
|
2263
|
+
for (const line of lines) {
|
|
2264
|
+
if (line.trim() && matcher.test(line)) {
|
|
2265
|
+
matches.push({ request_id: d.id, line: line.trim() });
|
|
2266
|
+
hit = true;
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
if (hit)
|
|
2270
|
+
matchedDeployments++;
|
|
2271
|
+
}
|
|
2272
|
+
const groups = groupLogMatches(matches, clamp(max_groups, 1, 50, 15));
|
|
2273
|
+
return withMeta(ok({
|
|
2274
|
+
scope: scopeOf(application, version),
|
|
2275
|
+
pattern: pattern ?? 'default: errors, exceptions, fatal signals, out of memory',
|
|
2276
|
+
running: total,
|
|
2277
|
+
searched: read.length - noLogs.length,
|
|
2278
|
+
...(total > rows.length ? { not_searched: total - rows.length, note: `Only the ${rows.length} newest were searched. Narrow with version or started_after, or raise max_deployments (max ${OPS_CAP}).` } : {}),
|
|
2279
|
+
deployments_with_matches: matchedDeployments,
|
|
2280
|
+
matching_lines: matches.length,
|
|
2281
|
+
groups: groups.length ? groups : undefined,
|
|
2282
|
+
exit_codes: Object.keys(exitCodes).length ? exitCodes : undefined,
|
|
2283
|
+
no_logs: noLogs.length ? noLogs : undefined,
|
|
2284
|
+
next_step: groups.length
|
|
2285
|
+
? 'Read the full log of one deployment in the top group with edgegap_get_deployment_logs before changing code.'
|
|
2286
|
+
: 'Nothing matched. Try another pattern, or check edgegap_fleet_health for deployments in error.',
|
|
2287
|
+
}), { props: { item_count: read.length, group_count: groups.length, regex: regex === true } });
|
|
2288
|
+
}));
|
|
2289
|
+
tool('edgegap_compare_versions', {
|
|
2290
|
+
title: 'Compare two versions of an application',
|
|
2291
|
+
description: 'Compare two versions of one application from their running deployments, to back a rollback or ' +
|
|
2292
|
+
'promote decision: deployments in error, crash restarts and exit codes, and CPU and memory (average, ' +
|
|
2293
|
+
'p95, peak) against each version\'s requested cpu_units and memory_mb, with the differences spelled ' +
|
|
2294
|
+
`out. Reads up to ${COMPARE_CAP} running deployments per version, newest first, so both versions need ` +
|
|
2295
|
+
'deployments running now (stopped ones keep no logs or status). Read-only.',
|
|
2296
|
+
inputSchema: {
|
|
2297
|
+
application: z.string().describe('Application name.'),
|
|
2298
|
+
version_a: z.string().describe('The baseline version, e.g. the one in production.'),
|
|
2299
|
+
version_b: z.string().describe('The version to compare against it, e.g. the new build.'),
|
|
2300
|
+
max_deployments_per_version: z.number().int().optional().describe(`1-${COMPARE_CAP}. Default ${Math.min(5, COMPARE_CAP)}.`),
|
|
2301
|
+
},
|
|
2302
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
2303
|
+
}, async ({ application, version_a, version_b, max_deployments_per_version }) => guarded(auth, NOT_FOUND.app, async () => {
|
|
2304
|
+
if (version_a === version_b)
|
|
2305
|
+
return fail('version_a and version_b are the same. Pass two different versions.');
|
|
2306
|
+
const cap = clamp(max_deployments_per_version, 1, COMPARE_CAP, Math.min(5, COMPARE_CAP));
|
|
2307
|
+
const one = async (version) => {
|
|
2308
|
+
const settings = await client.getAppVersion(application, version);
|
|
2309
|
+
const { rows, total } = await runningDeployments(application, version, cap);
|
|
2310
|
+
const deps = await mapLimit(rows, 6, async (r) => {
|
|
2311
|
+
const [status, crash, metrics] = await Promise.all([
|
|
2312
|
+
client.getDeployment(r.request_id).catch(() => undefined),
|
|
2313
|
+
crashFacts(r.request_id),
|
|
2314
|
+
client.getDeploymentMetrics(r.request_id).catch(() => undefined),
|
|
2315
|
+
]);
|
|
2316
|
+
return { status, crash, metrics };
|
|
2317
|
+
});
|
|
2318
|
+
const pool = (pick) => {
|
|
2319
|
+
const all = deps.flatMap((d) => (d.metrics ? finiteValues(pick(d.metrics)) : []));
|
|
2320
|
+
if (!all.length)
|
|
2321
|
+
return undefined;
|
|
2322
|
+
const r2 = (x) => Math.round(x * 100) / 100;
|
|
2323
|
+
return { average: r2(all.reduce((a, b) => a + b, 0) / all.length), p95: r2(percentile(all, 95)), peak: r2(Math.max(...all)), samples: all.length };
|
|
2324
|
+
};
|
|
2325
|
+
const errors = deps.filter((d) => healthOf(d.status) === 'error').length;
|
|
2326
|
+
const exitCodes = [...new Set(deps.map((d) => d.crash?.exit_code).filter((x) => x !== undefined))];
|
|
2327
|
+
return {
|
|
2328
|
+
version,
|
|
2329
|
+
requested: { cpu_units: settings.req_cpu, memory_mb: settings.req_memory },
|
|
2330
|
+
running: total,
|
|
2331
|
+
inspected: deps.length,
|
|
2332
|
+
in_error: errors,
|
|
2333
|
+
error_rate: deps.length ? Math.round((errors / deps.length) * 100) / 100 : undefined,
|
|
2334
|
+
restarts: deps.reduce((a, d) => a + (d.crash?.restarts ?? 0), 0),
|
|
2335
|
+
deployments_restarted: deps.filter((d) => (d.crash?.restarts ?? 0) > 0).length,
|
|
2336
|
+
exit_codes: exitCodes.length ? exitCodes : undefined,
|
|
2337
|
+
cpu: pool((m) => m.cpu),
|
|
2338
|
+
cpu_throttle_rate: pool((m) => m.cpu_throttle_rate),
|
|
2339
|
+
memory: pool((m) => m.mem),
|
|
2340
|
+
labels: deps.find((d) => d.metrics?.mem?.labels?.length)?.metrics?.mem?.labels?.slice(0, 3),
|
|
2341
|
+
};
|
|
2342
|
+
};
|
|
2343
|
+
const [a, b] = await Promise.all([one(version_a), one(version_b)]);
|
|
2344
|
+
const diff = [];
|
|
2345
|
+
const pct = (x, y) => (y === 0 ? undefined : Math.round(((x - y) / y) * 100));
|
|
2346
|
+
for (const k of ['cpu', 'memory']) {
|
|
2347
|
+
const pa = a[k]?.p95, pb = b[k]?.p95;
|
|
2348
|
+
if (pa !== undefined && pb !== undefined) {
|
|
2349
|
+
const d = pct(pb, pa);
|
|
2350
|
+
if (d !== undefined && Math.abs(d) >= 10)
|
|
2351
|
+
diff.push(`${k} p95 is ${Math.abs(d)} % ${d > 0 ? 'higher' : 'lower'} in ${version_b} (${pb} vs ${pa})`);
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2354
|
+
if ((a.error_rate ?? 0) !== (b.error_rate ?? 0))
|
|
2355
|
+
diff.push(`error rate ${b.error_rate ?? 0} in ${version_b} vs ${a.error_rate ?? 0} in ${version_a}`);
|
|
2356
|
+
if (a.restarts !== b.restarts)
|
|
2357
|
+
diff.push(`${b.restarts} crash restarts in ${version_b} vs ${a.restarts} in ${version_a}`);
|
|
2358
|
+
if ((b.cpu_throttle_rate?.peak ?? 0) > 0 && (a.cpu_throttle_rate?.peak ?? 0) === 0)
|
|
2359
|
+
diff.push(`${version_b} is CPU-throttled, ${version_a} is not`);
|
|
2360
|
+
const missing = [a, b].filter((v) => v.inspected === 0).map((v) => v.version);
|
|
2361
|
+
return withMeta(ok({
|
|
2362
|
+
application,
|
|
2363
|
+
a,
|
|
2364
|
+
b,
|
|
2365
|
+
differences: diff.length ? diff : missing.length ? undefined : ['no difference of 10 % or more, and the same error and restart counts'],
|
|
2366
|
+
...(missing.length
|
|
2367
|
+
? { note: `No running deployment of ${missing.join(' and ')}: nothing to compare for ${missing.length === 2 ? 'either' : 'it'}. Deploy one (edgegap_deploy) and let it serve a match first.` }
|
|
2368
|
+
: { caveat: `Based on ${a.inspected} and ${b.inspected} running deployments; a handful of servers under different load is a signal, not proof.` }),
|
|
2369
|
+
}), { props: { item_count: a.inspected + b.inspected } });
|
|
2005
2370
|
}));
|
|
2006
2371
|
// ============================================= before the first deploy ====
|
|
2007
2372
|
// -------------------------------------------------------------- 11a ----
|
|
@@ -2350,14 +2715,15 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
2350
2715
|
'registry, to clean up old builds. Takes exactly one image name and one exact tag; ' +
|
|
2351
2716
|
'wildcards, lists and "latest" are refused, and there is no bulk delete. A version that ' +
|
|
2352
2717
|
'still uses the tag can no longer start deployments, so check edgegap_list_app_versions ' +
|
|
2353
|
-
'first. Cannot be undone.',
|
|
2718
|
+
'first. Cannot be undone, so without confirm: true the result only previews it and nothing is sent.',
|
|
2354
2719
|
inputSchema: {
|
|
2355
2720
|
image_name: z.string().min(1).describe('The image name only, e.g. "my-game-server", as for edgegap_list_registry_tags.'),
|
|
2356
2721
|
tag: z.string().describe('The exact tag to delete, e.g. "build-41".'),
|
|
2722
|
+
confirm: confirmParam,
|
|
2357
2723
|
dry_run: dryRunParam,
|
|
2358
2724
|
},
|
|
2359
2725
|
annotations: { destructiveHint: true, idempotentHint: true, openWorldHint: true },
|
|
2360
|
-
}, async ({ image_name, tag, dry_run }) => guard(auth, async () => {
|
|
2726
|
+
}, async ({ image_name, tag, confirm, dry_run }) => guard(auth, async () => {
|
|
2361
2727
|
let name = imageNameOnly(image_name);
|
|
2362
2728
|
if (!/^[a-z0-9][a-z0-9._\/-]{0,254}$/.test(name)) {
|
|
2363
2729
|
return fail(`"${image_name.slice(0, 80)}" is not a single image name. Pass one, e.g. "my-game-server".`);
|
|
@@ -2370,6 +2736,14 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
2370
2736
|
await dry.client.deleteRegistryTag(name, tag);
|
|
2371
2737
|
return dryRunResult(dry.requests, name !== image_name ? [`Looked up "${name}".`] : []);
|
|
2372
2738
|
}
|
|
2739
|
+
if (confirm !== true) {
|
|
2740
|
+
return confirmationRequired('delete registry tag', {
|
|
2741
|
+
image_name: name,
|
|
2742
|
+
tag,
|
|
2743
|
+
warning: 'Deletes the tag and, if no other tag points to it, the image. Any version still using this tag ' +
|
|
2744
|
+
'can no longer start deployments (check edgegap_list_app_versions). Cannot be undone.',
|
|
2745
|
+
});
|
|
2746
|
+
}
|
|
2373
2747
|
const notFound = (err) => err instanceof EdgegapApiError && err.status === 404;
|
|
2374
2748
|
try {
|
|
2375
2749
|
let res;
|
|
@@ -2433,6 +2807,11 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
2433
2807
|
const leak = await tokenLeak(auth, dry_run, toAdd.map((t) => [`tag "${t.slice(0, 8)}…"`, t]));
|
|
2434
2808
|
if (leak)
|
|
2435
2809
|
return leak;
|
|
2810
|
+
if (!dry_run) {
|
|
2811
|
+
const blocked = await deploymentOutsideAllowlist(request_id);
|
|
2812
|
+
if (blocked)
|
|
2813
|
+
return blocked;
|
|
2814
|
+
}
|
|
2436
2815
|
if (dry_run) {
|
|
2437
2816
|
const dry = client.dryRun();
|
|
2438
2817
|
for (const t of toAdd)
|
|
@@ -2481,6 +2860,11 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
2481
2860
|
]);
|
|
2482
2861
|
if (leak)
|
|
2483
2862
|
return leak;
|
|
2863
|
+
if (!dry_run) {
|
|
2864
|
+
const blocked = await deploymentOutsideAllowlist(request_id);
|
|
2865
|
+
if (blocked)
|
|
2866
|
+
return blocked;
|
|
2867
|
+
}
|
|
2484
2868
|
const body = { reason, ...(metadata ? { metadata } : {}) };
|
|
2485
2869
|
if (dry_run) {
|
|
2486
2870
|
const dry = client.dryRun();
|
|
@@ -2496,15 +2880,16 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
2496
2880
|
title: 'Delete one application version',
|
|
2497
2881
|
description: 'Delete one version of an application, to clean up test versions. Exactly one exact version name; ' +
|
|
2498
2882
|
'refused while any deployment of that version is running. The container image stays in the registry ' +
|
|
2499
|
-
'(edgegap_delete_registry_tag removes it). Cannot be undone, so confirm
|
|
2500
|
-
'
|
|
2883
|
+
'(edgegap_delete_registry_tag removes it). Cannot be undone, so without confirm: true the result only ' +
|
|
2884
|
+
'previews it and nothing is sent.',
|
|
2501
2885
|
inputSchema: {
|
|
2502
2886
|
application: z.string().describe('Application name.'),
|
|
2503
2887
|
version: z.string().min(1).describe('The exact version name to delete.'),
|
|
2888
|
+
confirm: confirmParam,
|
|
2504
2889
|
dry_run: dryRunParam,
|
|
2505
2890
|
},
|
|
2506
2891
|
annotations: { destructiveHint: true, idempotentHint: true, openWorldHint: true },
|
|
2507
|
-
}, async ({ application, version, dry_run }) => guarded(auth, NOT_FOUND.app, async () => {
|
|
2892
|
+
}, async ({ application, version, confirm, dry_run }) => guarded(auth, NOT_FOUND.app, async () => {
|
|
2508
2893
|
assertAppAllowed(config, application);
|
|
2509
2894
|
const badName = exactName(version, 'version');
|
|
2510
2895
|
if (badName)
|
|
@@ -2517,6 +2902,14 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
2517
2902
|
const running = await runningOf(application, version);
|
|
2518
2903
|
if (running.length)
|
|
2519
2904
|
return refusedRunning(`version "${version}"`, running);
|
|
2905
|
+
if (confirm !== true) {
|
|
2906
|
+
const v = await client.getAppVersion(application, version);
|
|
2907
|
+
return confirmationRequired('delete application version', {
|
|
2908
|
+
application,
|
|
2909
|
+
version: compactVersion(v),
|
|
2910
|
+
warning: 'Matchmakers or scripts that deploy this version will fail afterwards. The registry image is kept. Cannot be undone.',
|
|
2911
|
+
});
|
|
2912
|
+
}
|
|
2520
2913
|
await client.deleteAppVersion(application, version);
|
|
2521
2914
|
return ok({ application, deleted_version: version, image_kept: 'The registry image was not touched.' });
|
|
2522
2915
|
}));
|
|
@@ -2525,9 +2918,11 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
2525
2918
|
description: 'Delete one application and every version under it, to clean up a test application. Exactly one ' +
|
|
2526
2919
|
'exact name; refused while any of its deployments is running, and refused when it has more versions ' +
|
|
2527
2920
|
'than max_versions (default 0: delete its versions first with edgegap_delete_app_version, or raise ' +
|
|
2528
|
-
'max_versions after the developer agreed). Registry images are not touched. Cannot be undone
|
|
2921
|
+
'max_versions after the developer agreed). Registry images are not touched. Cannot be undone, so ' +
|
|
2922
|
+
'without confirm: true the result only previews it and nothing is sent.',
|
|
2529
2923
|
inputSchema: {
|
|
2530
2924
|
application: z.string().min(1).describe('The exact application name to delete.'),
|
|
2925
|
+
confirm: confirmParam,
|
|
2531
2926
|
max_versions: z
|
|
2532
2927
|
.number()
|
|
2533
2928
|
.int()
|
|
@@ -2537,7 +2932,7 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
2537
2932
|
dry_run: dryRunParam,
|
|
2538
2933
|
},
|
|
2539
2934
|
annotations: { destructiveHint: true, idempotentHint: true, openWorldHint: true },
|
|
2540
|
-
}, async ({ application, max_versions, dry_run }) => guarded(auth, NOT_FOUND.app, async () => {
|
|
2935
|
+
}, async ({ application, max_versions, confirm, dry_run }) => guarded(auth, NOT_FOUND.app, async () => {
|
|
2541
2936
|
assertAppAllowed(config, application);
|
|
2542
2937
|
const badName = exactName(application, 'application');
|
|
2543
2938
|
if (badName)
|
|
@@ -2558,10 +2953,34 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
2558
2953
|
const running = await runningOf(application);
|
|
2559
2954
|
if (running.length)
|
|
2560
2955
|
return refusedRunning(`application "${application}"`, running);
|
|
2956
|
+
if (confirm !== true) {
|
|
2957
|
+
return confirmationRequired('delete application', {
|
|
2958
|
+
application,
|
|
2959
|
+
versions_deleted_with_it: versions,
|
|
2960
|
+
warning: 'Deletes the application and every version listed. Registry images are kept. Cannot be undone.',
|
|
2961
|
+
});
|
|
2962
|
+
}
|
|
2561
2963
|
await client.deleteApp(application);
|
|
2562
2964
|
return ok({ deleted_application: application, deleted_versions: versions });
|
|
2563
2965
|
}));
|
|
2564
2966
|
}
|
|
2967
|
+
/**
|
|
2968
|
+
* With EDGEGAP_APP_ALLOWLIST set, the write tools keyed on request_id (stop,
|
|
2969
|
+
* tag, report) refuse a deployment of an application outside the list. Reads
|
|
2970
|
+
* stay open, as for applications. No allowlist: no extra API call.
|
|
2971
|
+
*/
|
|
2972
|
+
async function deploymentOutsideAllowlist(requestId) {
|
|
2973
|
+
if (config.appAllowlist.length === 0)
|
|
2974
|
+
return undefined;
|
|
2975
|
+
const s = await client.getDeployment(requestId);
|
|
2976
|
+
try {
|
|
2977
|
+
assertAppAllowed(config, s.app_name);
|
|
2978
|
+
return undefined;
|
|
2979
|
+
}
|
|
2980
|
+
catch (err) {
|
|
2981
|
+
return fail(`Refused: deployment ${requestId} belongs to "${s.app_name}". ${err.message} Nothing was sent.`);
|
|
2982
|
+
}
|
|
2983
|
+
}
|
|
2565
2984
|
/** Request IDs of running deployments of an application (and version). */
|
|
2566
2985
|
async function runningOf(application, version) {
|
|
2567
2986
|
const filters = [{ field: 'application', operator: 'eq', value: application }];
|
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.19.1",
|
|
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 && node scripts/chmod-bin.mjs",
|
|
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/updateskills.mjs && node test/smoke.mjs && node test/guards.mjs && node test/elicit.mjs && node test/newtools.mjs && node test/emptystates.mjs && node test/reports.mjs && node test/http.mjs && node test/retries.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/ops.mjs && node test/emptystates.mjs && node test/reports.mjs && node test/http.mjs && node test/retries.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",
|