glitchless-mcp 0.15.0 → 0.17.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 +1 -1
- package/package.json +1 -1
- package/src/context.js +7 -3
- package/src/pictures.js +66 -25
- package/src/tools/analytics.js +1 -1
- package/src/tools/core.js +3 -2
- package/src/tools/dashboard.js +14 -9
package/README.md
CHANGED
|
@@ -103,7 +103,7 @@ above go in its environment.
|
|
|
103
103
|
| `glitchless_player_funnel` | Per level: starts, completions, deaths and their causes, disconnects, rage quits; split by what describes the attempt (tier, party size, class), runs per level, and retention; with `hotspots`, where players die on a level, in a zone or anywhere in the game (a hub with no levels), clustered in world coordinates |
|
|
104
104
|
| `glitchless_events` | The game's own events (whatever it sends with `track`, and the streams it counts with `count`): counts, attribute breakdowns, rates, distributions and funnels, and the session properties it sets |
|
|
105
105
|
| `glitchless_dashboard` | The game's dashboard: its pages, and one board's panels with their numbers |
|
|
106
|
-
| `glitchless_set_dashboard` | Save the game's pages: boards of panels in its own words, and the built-in views it keeps; and, each alone if you like, the boards' accent, logo and banner (the header behind each board's title) and a level's, zone's or the whole game's heatmap background (a picture from a file or base64 and its world bounds). Needs a key with the dashboard scope |
|
|
106
|
+
| `glitchless_set_dashboard` | Save the game's pages: boards of panels in its own words, and the built-in views it keeps; and, each alone if you like, the boards' accent, logo and banner (the header behind each board's title) and a level's, zone's or the whole game's heatmap background (a picture from a file or base64 and its world bounds; over the hosted server a file is answered with a 10-minute, single-use upload link to send it to with one curl). Needs a key with the dashboard scope |
|
|
107
107
|
| `glitchless_compare_versions` | Two or more versions side by side, in the game's own stats first, to confirm a fix with real players |
|
|
108
108
|
| `glitchless_session` | One play session in detail, with its whole event timeline |
|
|
109
109
|
| `glitchless_bug_reports` | Bug reports players sent from inside the game: their notes, levels, positions and sessions, and one report's screenshot when asked |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glitchless-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"mcpName": "io.github.glitchless-gg/glitchless",
|
|
5
5
|
"description": "Coding agents can build a game. They can't see anyone play it. Glitchless lets them. The MCP server for Glitchless, game observability for coding agents: Claude Code, Codex, Cursor and others read real players' stutters, crashes, custom metrics and ranked findings in Unity, Godot, Unreal, Three.js, Roblox, Phaser and GameMaker games, build the game's own dashboard, and run playtest bots.",
|
|
6
6
|
"keywords": [
|
package/src/context.js
CHANGED
|
@@ -9,7 +9,7 @@ import path from 'node:path';
|
|
|
9
9
|
import { McpServer } from '@modelcontextprotocol/server';
|
|
10
10
|
import { z } from 'zod';
|
|
11
11
|
|
|
12
|
-
export const VERSION = '0.
|
|
12
|
+
export const VERSION = '0.17.0';
|
|
13
13
|
|
|
14
14
|
// Where `glitchless-mcp login` keeps its workspace key: { url, token, workspace: { id, name }, scopes }.
|
|
15
15
|
export const CREDENTIALS_FILE = path.join(process.env.XDG_CONFIG_HOME || path.join(os.homedir(), '.config'), 'glitchless', 'credentials.json');
|
|
@@ -107,9 +107,13 @@ export async function projectFor(game) {
|
|
|
107
107
|
return hit.id;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
// A workspace key names the game in x-glitchless-project. A key for one game sends the game a call names (or
|
|
111
|
+
// GLITCHLESS_GAME) as x-glitchless-game, so Glitchless Cloud refuses it when it isn't the key's game instead of
|
|
112
|
+
// answering, or writing, for the key's own game.
|
|
110
113
|
async function headers(extra = {}) {
|
|
111
114
|
const client = conn().client || calls.getStore()?.server?.server.getClientVersion?.()?.name || 'mcp';
|
|
112
|
-
|
|
115
|
+
const named = !isWorkspace() && (calls.getStore()?.game || conn().game);
|
|
116
|
+
return { 'x-glitchless-client': client, ...(apiKey() ? { 'x-glitchless-api-key': apiKey() } : {}), ...(isWorkspace() ? { 'x-glitchless-project': await projectFor(calls.getStore()?.game) } : {}), ...(named ? { 'x-glitchless-game': encodeURIComponent(named) } : {}), ...extra };
|
|
113
117
|
}
|
|
114
118
|
|
|
115
119
|
// A workspace key's own routes (/v1/agent/…, Glitchless Cloud).
|
|
@@ -262,7 +266,7 @@ export function toolList({ remote = false, scopes = null } = {}) {
|
|
|
262
266
|
const titleOf = (t) => t.config.title ?? `${t.name.replace(/^glitchless_/, '').replace(/_/g, ' ').replace(/^./, (c) => c.toUpperCase())}`;
|
|
263
267
|
|
|
264
268
|
// Every tool takes `game` (by name or id): with a workspace key it picks the game, with a game key it's ignored.
|
|
265
|
-
const gameField = z.string().optional().describe('The game, by name or id, when signed in to a workspace (glitchless_list_games lists them); later calls keep it.
|
|
269
|
+
const gameField = z.string().optional().describe('The game, by name or id, when signed in to a workspace (glitchless_list_games lists them); later calls keep it. With a key for one game (gl_sk_…), a call that names another game is refused: sign in to the workspace to reach every game.');
|
|
266
270
|
|
|
267
271
|
// A server with the tools. remote: the HTTP server's set (no local tools, and instructions to match); scopes: show
|
|
268
272
|
// only the tools these scopes allow; connection: what every call runs with (default: this process's own).
|
package/src/pictures.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
// picture of a level, a zone or the whole game with the world bounds its edges stand for, so the paths and deaths on
|
|
3
3
|
// a positions panel and the Heatmaps view read as the place they happened in: the server's PUT /v1/maps, SPEC §3b
|
|
4
4
|
// Backgrounds) and the brand's logo and banner (`logo`, `banner`: PUT /v1/brand/logo and /v1/brand/banner, §3b
|
|
5
|
-
// Branding). The local server reads a picture from a file on this computer;
|
|
5
|
+
// Branding). The local server reads a picture from a file on this computer; the hosted one, which can't, answers a
|
|
6
|
+
// file with an upload link (POST /v1/uploads, §3b Upload links) the agent sends it to with one curl, as either does
|
|
7
|
+
// with upload: true; any server takes a picture as base64.
|
|
6
8
|
import fs from 'node:fs/promises';
|
|
7
9
|
import path from 'node:path';
|
|
8
10
|
import { z } from 'zod';
|
|
@@ -10,19 +12,46 @@ import { write, upload, base, isRemote } from './context.js';
|
|
|
10
12
|
|
|
11
13
|
const TYPES = { '.png': 'image/png', '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.webp': 'image/webp' };
|
|
12
14
|
|
|
13
|
-
// A picture
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
// A picture for one slot (logo, banner, or a background with its place, axis and bounds as `params`): its bytes and
|
|
16
|
+
// type from { file } (only a local server reads files) or { image } (base64 or a data: URL), or { link }, the line
|
|
17
|
+
// to show, when it goes by an upload link: asked for (upload: true), or a file the hosted server can't read. `what`
|
|
18
|
+
// names it in that line; `route` is the slot's own address, for a server too old to make links.
|
|
19
|
+
async function readPicture(svc, slot, params, { file, image, upload: asked }, what, route) {
|
|
20
|
+
if (asked && image) throw new Error('give image (the picture as base64) or upload: true (a link to send it to), not both');
|
|
21
|
+
if (asked || (file && isRemote())) {
|
|
22
|
+
const link = await uploadLink(svc, slot, params, file, what);
|
|
23
|
+
if (link) return { link };
|
|
24
|
+
if (isRemote() || !file) throw new Error(`this server makes no upload links${isRemote() ? " and can't read files on your computer" : ''}: pass the picture as image (base64), or upload it yourself with a secret key that has the dashboard scope: curl -X PUT '${route}' -H 'x-glitchless-api-key: <key>' --data-binary @${file ? shellArg(file) : '<file>'}`);
|
|
19
25
|
}
|
|
26
|
+
if (file) return { bytes: await fs.readFile(path.resolve(file)), type: TYPES[path.extname(file).toLowerCase()] || 'application/octet-stream' };
|
|
20
27
|
return { bytes: Buffer.from(image.replace(/^data:[^,]*,/, ''), 'base64'), type: 'application/octet-stream' };
|
|
21
28
|
}
|
|
22
29
|
|
|
30
|
+
// A short-lived, single-use link for one picture (POST /v1/uploads), as the line that tells the agent to run its curl;
|
|
31
|
+
// null from a server without upload links. The link is shown here once: the server keeps only its hash.
|
|
32
|
+
async function uploadLink(svc, slot, params, file, what) {
|
|
33
|
+
let made;
|
|
34
|
+
try {
|
|
35
|
+
made = (await write('POST', `/v1/uploads?${new URLSearchParams({ service: svc, slot, ...params })}`)).upload;
|
|
36
|
+
} catch (err) {
|
|
37
|
+
if (/→ HTTP (404|405|501)\b/.test(err.message)) return null;
|
|
38
|
+
throw err;
|
|
39
|
+
}
|
|
40
|
+
const url = `${base()}${made.path}`;
|
|
41
|
+
const minutes = Math.max(1, Math.round(made.expires_in_s / 60));
|
|
42
|
+
const command = `curl -X PUT --data-binary @${file ? shellArg(file) : '<file>'} '${url}'`;
|
|
43
|
+
return `To send ${what}, run this within ${minutes} minutes: \`${command}\`. The link takes one picture (PNG, JPEG or WebP, at most ${Math.round(made.max_bytes / 1024)} KB and ${made.max_width} × ${made.max_height} pixels) and then stops working; it needs no key. curl's answer says what was saved, or what to fix: a picture refused for its size or type can be fixed and sent to the same link until it expires.`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// A path as one shell word.
|
|
47
|
+
function shellArg(f) {
|
|
48
|
+
return /^[\w@%+=:,./-]+$/.test(f) ? f : `'${f.replace(/'/g, "'\\''")}'`;
|
|
49
|
+
}
|
|
50
|
+
|
|
23
51
|
// One place's background for set_dashboard's `background`: save a picture (a file here, or base64) with its world
|
|
24
|
-
// bounds, or
|
|
25
|
-
|
|
52
|
+
// bounds, or make a link to send it to (upload: true, or a file over HTTP), or remove: true to remove the upload.
|
|
53
|
+
// Returns { text, map? }, and link: true when the picture is still to be sent.
|
|
54
|
+
export async function saveBackground(svc, { level, zone, file, image, upload: asked, axis, bounds, remove }) {
|
|
26
55
|
if (level && zone) throw new Error('give level or zone, not both (neither: the whole game)');
|
|
27
56
|
const place = level ? { level } : zone ? { zone } : {};
|
|
28
57
|
const name = level ? `level ${level}` : zone ? `zone ${zone}` : 'the whole game';
|
|
@@ -31,12 +60,13 @@ export async function saveBackground(svc, { level, zone, file, image, axis, boun
|
|
|
31
60
|
await write('DELETE', `/v1/maps?${where}`);
|
|
32
61
|
return { text: `Removed the uploaded background of ${name}.` };
|
|
33
62
|
}
|
|
34
|
-
if (!file && !image) throw new Error('give background.file or background.image (the picture), or background.remove: true');
|
|
63
|
+
if (!file && !image && !asked) throw new Error('give background.file or background.image (the picture), background.upload: true (a link to send it to), or background.remove: true');
|
|
35
64
|
if (!bounds) throw new Error('give bounds: the world coordinates the picture covers, { "min": [a, b], "max": [a, b] }');
|
|
36
65
|
where.set('axis', axis || 'xz');
|
|
37
66
|
where.set('min', bounds.min.join(','));
|
|
38
67
|
where.set('max', bounds.max.join(','));
|
|
39
|
-
const { bytes, type } = await readPicture({ file, image }, `${base()}/v1/maps?${where}`);
|
|
68
|
+
const { bytes, type, link } = await readPicture(svc, 'background', Object.fromEntries([...where].filter(([k]) => k !== 'service')), { file, image, upload: asked }, `the background of ${name}`, `${base()}/v1/maps?${where}`);
|
|
69
|
+
if (link) return { text: link, link: true };
|
|
40
70
|
const { map } = await upload('PUT', `/v1/maps?${where}`, bytes, type);
|
|
41
71
|
// A picture shaped unlike its bounds is stretched to fit them: often bounds that don't match its edges.
|
|
42
72
|
const [w, h] = map.size;
|
|
@@ -55,8 +85,9 @@ export const backgroundSchema = z
|
|
|
55
85
|
.object({
|
|
56
86
|
level: z.string().optional().describe('The level, as the game passes it to levelStart'),
|
|
57
87
|
zone: z.string().optional().describe('Or the zone, as the game passes it to setZone (leave out level and zone for the whole game)'),
|
|
58
|
-
file: z.string().optional().describe('The picture: a PNG, JPEG or WebP file on this computer.
|
|
59
|
-
image: z.string().optional().describe(
|
|
88
|
+
file: z.string().optional().describe('The picture: a PNG, JPEG or WebP file on this computer. The local server (npx glitchless-mcp) reads it; the hosted one answers with an upload link to send it to with one curl'),
|
|
89
|
+
image: z.string().optional().describe('Or the picture as base64 (or a data: URL); a big one is long in a call, so prefer file'),
|
|
90
|
+
upload: z.boolean().optional().describe('Answer with an upload link instead of saving now: send the picture to it with one curl (curl -X PUT --data-binary @file \'<link>\') within 10 minutes; it takes one picture and needs no key. The hosted server does this for file by itself'),
|
|
60
91
|
axis: z.enum(['xz', 'xy']).optional().describe('xz: seen from above, x across and z down the picture (default); xy: a side view, x across and y up'),
|
|
61
92
|
bounds: z
|
|
62
93
|
.object({ min: z.tuple([z.number(), z.number()]), max: z.tuple([z.number(), z.number()]) })
|
|
@@ -70,32 +101,42 @@ function round(v) {
|
|
|
70
101
|
return Math.round(v * 100) / 100;
|
|
71
102
|
}
|
|
72
103
|
|
|
73
|
-
// The brand's logo or banner (kind) for set_dashboard: an image ({ file } or { image }
|
|
74
|
-
// banner a focus (top, center or bottom: what stays in view when it is cropped
|
|
75
|
-
|
|
104
|
+
// The brand's logo or banner (kind) for set_dashboard: an image ({ file } or { image }, or upload: true for a link to
|
|
105
|
+
// send it to), remove: true, and for the banner a focus (top, center or bottom: what stays in view when it is cropped
|
|
106
|
+
// to a strip). Returns { text, saved }: the line to show, and whether anything changed now (a link changes nothing
|
|
107
|
+
// until the picture comes).
|
|
108
|
+
export async function saveBrandImage(svc, kind, { file, image, upload: asked, remove, focus }) {
|
|
76
109
|
const q = `service=${encodeURIComponent(svc)}`;
|
|
77
110
|
const said = [];
|
|
111
|
+
let saved = false;
|
|
78
112
|
if (remove) {
|
|
79
113
|
await write('DELETE', `/v1/brand/${kind}?${q}`);
|
|
80
114
|
said.push(`Removed the ${kind}.`);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const {
|
|
84
|
-
|
|
85
|
-
|
|
115
|
+
saved = true;
|
|
116
|
+
} else if (file || image || asked) {
|
|
117
|
+
const { bytes, type, link } = await readPicture(svc, kind, {}, { file, image, upload: asked }, `the ${kind}`, `${base()}/v1/brand/${kind}?${q}`);
|
|
118
|
+
if (link) said.push(link);
|
|
119
|
+
else {
|
|
120
|
+
const { brand } = await upload('PUT', `/v1/brand/${kind}?${q}`, bytes, type);
|
|
121
|
+
const b = brand?.[kind];
|
|
122
|
+
said.push(`Saved the ${kind}${b ? `: ${b.width} × ${b.height} pixels` : ''}.`);
|
|
123
|
+
saved = true;
|
|
124
|
+
}
|
|
86
125
|
}
|
|
87
126
|
if (focus) {
|
|
88
127
|
await write('PUT', `/v1/brand?${q}`, { banner_focus: focus });
|
|
89
128
|
said.push(`The banner keeps its ${focus} in view.`);
|
|
129
|
+
saved = true;
|
|
90
130
|
}
|
|
91
|
-
if (!said.length) throw new Error(`give ${kind}.file or ${kind}.image (the picture), ${kind}.remove: true${kind === 'banner' ? ', or banner.focus' : ''}`);
|
|
92
|
-
return said.join(' ');
|
|
131
|
+
if (!said.length) throw new Error(`give ${kind}.file or ${kind}.image (the picture), ${kind}.upload: true (a link to send it to), ${kind}.remove: true${kind === 'banner' ? ', or banner.focus' : ''}`);
|
|
132
|
+
return { text: said.join(' '), saved };
|
|
93
133
|
}
|
|
94
134
|
|
|
95
135
|
// The schema of set_dashboard's `logo` and `banner`.
|
|
96
136
|
const picture = {
|
|
97
|
-
file: z.string().optional().describe('A PNG, JPEG or WebP file on this computer.
|
|
98
|
-
image: z.string().optional().describe(
|
|
137
|
+
file: z.string().optional().describe('A PNG, JPEG or WebP file on this computer. The local server (npx glitchless-mcp) reads it; the hosted one answers with an upload link to send it to with one curl'),
|
|
138
|
+
image: z.string().optional().describe('Or the picture as base64 (or a data: URL); a banner is long in a call, so prefer file'),
|
|
139
|
+
upload: z.boolean().optional().describe("Answer with an upload link instead of saving now: send the picture to it with one curl (curl -X PUT --data-binary @file '<link>') within 10 minutes; it takes one picture and needs no key. The hosted server does this for file by itself"),
|
|
99
140
|
remove: z.boolean().optional().describe('Remove it'),
|
|
100
141
|
};
|
|
101
142
|
export const logoSchema = z
|
package/src/tools/analytics.js
CHANGED
|
@@ -13,7 +13,7 @@ tool(
|
|
|
13
13
|
rate: z.string().optional().describe('The share of the event\'s events where a flag holds ("won": true or false, or 1 or 0) or a word outcome holds ("result=win")'),
|
|
14
14
|
avg: z.string().optional().describe('A numeric attribute\'s mean per event, e.g. "duration_s"'),
|
|
15
15
|
of: z.string().optional().describe('A numeric attribute whose distribution to give, e.g. "duration_s" (match length) or "placement"'),
|
|
16
|
-
by: z.string().optional().describe('With rate, avg or of: split by an attribute (a list splits by element), $version, $level, $zone, $platform, $browser, $device_tier, $link (the kind of connection), or a session property ("$rank")'),
|
|
16
|
+
by: z.string().optional().describe('With rate, avg or of: split by an attribute (a list splits by element), $version, $level, $zone, $platform, $browser, $device_tier, $link (the kind of connection), $graphics (the graphics setting), or a session property ("$rank")'),
|
|
17
17
|
min: z.number().int().optional().describe('With rate or avg and by: the fewest events a row needs (default 30 for a rate, 10 for an average); smaller rows are counted in small'),
|
|
18
18
|
first: z.boolean().optional().describe('With name: the seconds from each session\'s start to its first such event (median_s, p90_s, over the sessions that sent it) and the ended sessions that never sent it (never, ended, never_pct). For a lobby: how long players stay before first leaving, and how many never leave. Works for events a Roblox server sends for a player'),
|
|
19
19
|
detail: z.boolean().optional().describe("Every value of every attribute and property, with its sessions (default: the top 5 of each)"),
|
package/src/tools/core.js
CHANGED
|
@@ -47,7 +47,7 @@ tool(
|
|
|
47
47
|
|
|
48
48
|
tool(
|
|
49
49
|
'glitchless_performance',
|
|
50
|
-
"Frame-time breakdown for a game: global percentiles, per-level p50/p95/p99 with draw calls / triangles / geometry counts / game-context gauges, hitch causes (script, shader compile, PSO compile in Unreal, GC, asset or map load), what is on screen during hitches, which events precede hitches, per GPU tier / browser / platform / version, per screen (by_display: each refresh rate's sessions, its budget_ms and share of play, so 120 Hz and 60 Hz phones read apart), per zone for an open-world game or hub that sets them (by_zone: each zone's frame time and hitches_per_min, and its time: seconds and share_pct of play time, sessions that went there and median_s, their median time in it; zone keeps one), memory growth per level load and the slowest recent hitches with script attribution. Every frame is judged against its own screen's budget: pct_over_budget is the share of frames slower than 1.15x their own window's budget_ms (under 5% means the p95 is on time on players' own screens; a 60 Hz phone's 16.7 ms frames are on time next to 120 Hz ones), so read it, not p95 against frame_budget_ms (the median screen's). With by_prop, frame time, hitches and crash-free sessions per value of a session property (a graphics preset, a class). A multiplayer game also gets `network` (ping, loss and disconnects; glitchless_network has more).",
|
|
50
|
+
"Frame-time breakdown for a game: global percentiles, per-level p50/p95/p99 with draw calls / triangles / geometry counts / game-context gauges, hitch causes (script, shader compile, PSO compile in Unreal, GC, asset or map load), what is on screen during hitches, which events precede hitches, per GPU tier / browser / platform / version, per graphics setting (by_graphics: a `graphics` property the game sets, else what the SDK read itself, Roblox's Graphics Quality Automatic or 1 to 10; lowest to highest, only sessions that have one), per screen (by_display: each refresh rate's sessions, its budget_ms and share of play, so 120 Hz and 60 Hz phones read apart), per zone for an open-world game or hub that sets them (by_zone: each zone's frame time and hitches_per_min, and its time: seconds and share_pct of play time, sessions that went there and median_s, their median time in it; zone keeps one), memory growth per level load and the slowest recent hitches with script attribution. Every frame is judged against its own screen's budget: pct_over_budget is the share of frames slower than 1.15x their own window's budget_ms (under 5% means the p95 is on time on players' own screens; a 60 Hz phone's 16.7 ms frames are on time next to 120 Hz ones), so read it, not p95 against frame_budget_ms (the median screen's). With by_prop, frame time, hitches and crash-free sessions per value of a session property (a graphics preset, a class). A multiplayer game also gets `network` (ping, loss and disconnects; glitchless_network has more).",
|
|
51
51
|
{
|
|
52
52
|
...common,
|
|
53
53
|
level: z.string().optional().describe('Focus on one level id, e.g. "level-2"'),
|
|
@@ -68,6 +68,7 @@ tool(
|
|
|
68
68
|
by_browser: d.by_browser.map(slimGroup),
|
|
69
69
|
by_version: d.by_version.map(slimGroup),
|
|
70
70
|
by_platform: (d.by_platform || []).map(slimGroup),
|
|
71
|
+
...(d.by_graphics?.length ? { by_graphics: d.by_graphics.map(slimGroup) } : {}),
|
|
71
72
|
by_display: (d.by_display || []).map((g) => ({ ...slimGroup(g), hz: g.hz, budget_ms: g.budget_ms, windows_pct: g.windows_pct })),
|
|
72
73
|
// Each zone's frame time and hitches, and its time: share of play time, the sessions that went there, their median.
|
|
73
74
|
...(zones ? { by_zone: zones.map((z) => ({ ...slimGroup(z), hitches: z.hitches, seconds: z.seconds, share_pct: z.share_pct, median_s: z.median_s })) } : {}),
|
|
@@ -108,7 +109,7 @@ tool(
|
|
|
108
109
|
'Player experience per level: sessions that started vs completed each level, attempts, deaths per session and their causes, fails, abandons and the attempts a disconnect ended (never counted as fails), median and slowest clear times, rage quits (quit ≤20s after dying), session length distribution, recent rage quits with positions, and recent rage inputs (one key mashed: the SDKs count them in kpis.rage_inputs) with their level, time, key and, for a game that sends positions, where the player stood. With by, each level per value of what describes the attempt: an attribute the game passed to levelStart ("tier", "difficulty", "party_size"; a list such as "build" counts under each element), a session property ("$class") or a split ("$platform"): clears and wipes by difficulty, by group size, by class; level keeps one level; count "runs" counts each run once at each level it reached (a roguelite\'s biomes). Also retention: of the players first seen each day, the share back 1, 7 and 30 days later (D1, D7, D30; hours of 48 or more for D1), and with by_prop per value of a session property (spenders against the rest). Retention needs player IDs: status "anonymous" means the game sends none, and privacy "install" in the SDK turns them on. With hotspots, for a game that sends positions: where players die instead, on one level (level), in one zone (zone, as the game passes it to setZone) or, with neither, anywhere in the game (a hub or lobby with no level set): clustered death positions in world coordinates (x range, share of the place\'s deaths, top cause, rage quits at that spot), the bounds and the place\'s stats (a level\'s completion; a zone\'s sessions, deaths and rage quits), to find a difficulty spike and then the level data around it.',
|
|
109
110
|
{
|
|
110
111
|
...common,
|
|
111
|
-
by: z.string().optional().describe('Split each level\'s attempts: an attribute of its levelStart ("tier"), a session property ("$class") or $platform, $browser, $device_tier, $link'),
|
|
112
|
+
by: z.string().optional().describe('Split each level\'s attempts: an attribute of its levelStart ("tier"), a session property ("$class") or $platform, $browser, $device_tier, $link, $graphics'),
|
|
112
113
|
level: z.string().optional().describe('With by or count: only this level; with hotspots: the level, e.g. "level-3"'),
|
|
113
114
|
zone: z.string().optional().describe('With hotspots: the zone instead of a level, e.g. "hall" (neither: the whole game)'),
|
|
114
115
|
count: z.enum(['runs']).optional().describe('"runs": each run (setGroup("run")) counted once at each level it reached'),
|
package/src/tools/dashboard.js
CHANGED
|
@@ -5,7 +5,7 @@ import { saveBackground, listBackgrounds, backgroundSchema, saveBrandImage, logo
|
|
|
5
5
|
|
|
6
6
|
tool(
|
|
7
7
|
'glitchless_dashboard',
|
|
8
|
-
"The game's dashboard: its pages in order, each a board (panels in the game's own terms) or a built-in view (events, performance, errors, players, heatmaps, sessions, versions, live, reports, servers, matches), and one board's panels with their numbers for the window. A board page with `where` shows only the sessions with those property values. `page` picks the board (default: the first). `source` says whether the dashboard was saved (by an agent or a person) or made automatically from what the game sends; `spec` (its pages, and its currency if it has one) is what to edit and send back to glitchless_set_dashboard. Money panels answer their `currency` (an ISO code, or ROBUX), and `mismatch` lists amounts sent in another currency, which are left out; a Robux panel with devex answers `devex`, an estimate in US dollars at Roblox's DevEx rate (never money). `brand` is the game's branding on its boards and share links: its accent colour (set with glitchless_set_dashboard's accent) and whether it has a logo and a banner (
|
|
8
|
+
"The game's dashboard: its pages in order, each a board (panels in the game's own terms) or a built-in view (events, performance, errors, players, heatmaps, sessions, versions, live, reports, servers, matches), and one board's panels with their numbers for the window. A board page with `where` shows only the sessions with those property values. `page` picks the board (default: the first). `source` says whether the dashboard was saved (by an agent or a person) or made automatically from what the game sends; `spec` (its pages, and its currency if it has one) is what to edit and send back to glitchless_set_dashboard. Money panels answer their `currency` (an ISO code, or ROBUX), and `mismatch` lists amounts sent in another currency, which are left out; a Robux panel with devex answers `devex`, an estimate in US dollars at Roblox's DevEx rate (never money). `brand` is the game's branding on its boards and share links: its accent colour (set with glitchless_set_dashboard's accent) and whether it has a logo and a banner (set with glitchless_set_dashboard's logo and banner, or by people in the dashboard: Edit pages → Look).",
|
|
9
9
|
{ ...common, page: z.string().optional().describe('Id of the board page to evaluate (default: the first board)') },
|
|
10
10
|
async ({ service, hours, page, ...f }) => {
|
|
11
11
|
const svc = await resolveService(service);
|
|
@@ -44,7 +44,7 @@ const panelSchema = z
|
|
|
44
44
|
size: z.enum(['s', 'm', 'l']).optional().describe('s = a quarter row (stats), m = half, l = full width'),
|
|
45
45
|
metric: z.string().optional().describe('stat: sessions, players, avg_session_s, median_session_s, crash_free_pct, error_free_pct, frame_p95, avg_fps, hitches_per_min, errors, deaths, rage_quit_pct, hours_played (the time the game was on screen), players_now (sessions playing in the last two minutes, whatever the range), runs (each run once). Network (multiplayer): ping_p50, ping_p95 (ms), loss_pct, disconnects_per_hour, disconnect_pct (level attempts a disconnect ended). Servers (from the game\'s servers in server mode): servers_now (running now, with the players connected to them), server_tick_p95, server_crash_free_pct, players_per_server. Zones (a game that sets them with setZone; give zone): zone_time_pct (the zone\'s share of play time), zone_median_s (the median time in it of the sessions that went there). deaths and errors take per "$hours": deaths per hour played'),
|
|
46
46
|
zone: z.string().optional().describe('stat with metric zone_time_pct or zone_median_s: the zone, as the game names it with setZone ("hall")'),
|
|
47
|
-
event: z.string().optional().describe('stat, series, breakdown, distribution, table: one event, "name", "name=value" or "name:key=value". A list attribute (a deck, a build) matches when it has the value, and "battle_end:deck=hog_rider+ice_spirit" when it has all of them (any pair or trio). A series or breakdown by $platform, $browser or $
|
|
47
|
+
event: z.string().optional().describe('stat, series, breakdown, distribution, table: one event, "name", "name=value" or "name:key=value". A list attribute (a deck, a build) matches when it has the value, and "battle_end:deck=hog_rider+ice_spirit" when it has all of them (any pair or trio). A series or breakdown by $platform, $browser, $device_tier, $link or $graphics can leave it out: then it counts sessions (and players, with player IDs) in each. A breakdown by $zone without it is the time played in each zone (frame time drawn there, paused in the background): each row\'s seconds, share_pct of all play, the sessions that went there (sessions_pct of all), players and median_s, their median time in it; time outside every zone is "(none)"'),
|
|
48
48
|
sum: z.string().optional().describe('stat, series, breakdown: add up this numeric attribute instead of counting events, e.g. "amount" of "purchase" for revenue. Money (events with a currency, an ISO code or "ROBUX") shows in the game\'s currency; amounts in another currency are named, never added (Robux are never added to dollars). The event can be filtered, also split by an attribute: revenue of completed purchases by item is event "purchase:result=done", by "item", sum "amount" (read from each session\'s first 16 of the event), so cancelled purchases can carry their amount too'),
|
|
49
49
|
devex: z.boolean().optional().describe('stat, series, breakdown with sum, in Robux: also give what the Robux would be worth in US dollars at Roblox\'s DevEx rate (devex: {estimate: true, robux, usd, rate, since, source}; a breakdown\'s rows each get usd). Always an estimate: it is the price players paid at DevEx\'s standard rate, and what the experience can cash out is less. Other currencies get devex null'),
|
|
50
50
|
per: z.string().optional().describe('stat: divide by this event to get a percentage (event "buy=done" per "paywall"); or "$players" / "$sessions": the share of them that sent the event (conversion), or with sum, the sum per player or session (revenue per player); or "$hours": per hour played (matches per hour, with sum XP or gold per hour). series, breakdown: "$hours", each bucket or row per hour played (by $version or $level each over its own hours, by an attribute every row over the window\'s)'),
|
|
@@ -59,7 +59,7 @@ const panelSchema = z
|
|
|
59
59
|
never: z.string().optional().describe('stat, instead of event: the share of the window\'s ended sessions that never sent this event (ended: sent session_end, or nothing for 30 minutes), with count and base: players who never left the lobby (never "hall_left"), never bought. Sessions still playing aren\'t counted. Over 31 days or less'),
|
|
60
60
|
bins: z.number().int().optional().describe('distribution: how many histogram bars, 2 to 40 (default 20). Bars are equal round steps from the 1st to the 99th percentile; under and over count what falls outside'),
|
|
61
61
|
unit: z.string().optional().describe('distribution, stat with of: what the numbers are in, shown after them ("s" reads as minutes or hours when large, or the game\'s own word: "floors")'),
|
|
62
|
-
by: z.string().optional().describe('series, breakdown, distribution: the attribute to split by, e.g. "mode" or "what" (a list attribute splits by element: each card of a deck gets a row, and an event counts once under each), or $version / $level / $zone (where the player was in an open world, setZone), or a split of the sessions that sent the event: $platform (Windows, macOS, Linux, Steam Deck, iOS, Android, Web
|
|
62
|
+
by: z.string().optional().describe('series, breakdown, distribution: the attribute to split by, e.g. "mode" or "what" (a list attribute splits by element: each card of a deck gets a row, and an event counts once under each), or $version / $level / $zone (where the player was in an open world, setZone), or a split of the sessions that sent the event: $platform (Windows, macOS, Linux, Steam Deck, iOS, Android, Web…; a Roblox game\'s Computer, Phone, Tablet, Xbox, PlayStation, VR), $browser (Chrome, Safari, Firefox, Edge…; a native build is "Godot app", "Unity app" and so on, a web build "Unity web build"), $device_tier (High-end, Mid-range, Low-end GPU, Software rendering: the tiers the Performance view uses, high to low), $link (Wi-Fi, Mobile data, Wired), $graphics (the graphics setting the session played at: a `graphics` property the game sets, else what the SDK read itself, Roblox\'s Graphics Quality as Automatic or 1 to 10; Automatic first, then lowest to highest, "(none)" without one), or a session property the game sets with setProperties ($rank, $class, $region: sessions without it are "(none)", 40 values at most); counts only, no sum, over 31 days or less. levels and deaths: an attribute of the level\'s start ("tier", "party_size", a list such as "build"), a property or a split. net: $version, $level, $zone, a split or a property. servers: "players" (connected, in tenths of capacity), $level or $version. retention: a property ($spender). frame_time: $zone or $level, a row per value with frame time p50, p95, p99, frames over budget, hitches per minute played and its share of play time. versions: also a property ($class), its values side by side. A breakdown (by count) can also split by a Steam fact of the sessions that sent the event: $steam_branch, $steam_build, $steam_hardware, $steam_controller, $steam_language, $proton, $big_picture, $family_shared, $timed_trial. versions: $steam_branch or $steam_build compares Steam branches or builds on this page\'s stats instead of versions (the beta against "public"); needs a game that uses Steamworks'),
|
|
63
63
|
limit: z.number().int().optional().describe('How many: errors, findings, reports and breakdown rows up to 20, sessions up to 50, series lines up to 8, distribution rows up to 8, retention days up to 90 (default 14), table rows per group up to 100 (default 20; at most 30 groups, the rest counted in more_groups)'),
|
|
64
64
|
steps: z.string().optional().describe('funnel: events in order, comma-separated, e.g. "paywall,buy=tapped,buy=done"'),
|
|
65
65
|
label: z.string().optional().describe('levels: what the game calls a level, e.g. "Stop" or "Puzzle"'),
|
|
@@ -117,7 +117,7 @@ define(
|
|
|
117
117
|
{
|
|
118
118
|
title: 'Save dashboard',
|
|
119
119
|
description:
|
|
120
|
-
"Save the game's dashboard: its pages, in the order the sidebar shows them. Each page is a board of panels in the game's own words, or a built-in view (events, performance, errors, players, heatmaps, sessions, versions, live, reports, servers, matches) the game keeps, renames or drops. Design it for this game, not for a genre it isn't: a puzzle game cares about solve time and hints, a mobile game about opens, modes, the paywall and purchases (revenue: a stat with sum \"amount\" of \"purchase\"; revenue per player: per \"$players\"; conversion: event \"purchase\" per \"$players\"; revenue by item: a breakdown with sum, of completed ones only with event \"purchase:result=done\"; a Roblox game's money is in Robux: currency \"ROBUX\", and devex true on a panel adds an estimate in dollars), a platformer about deaths per level (and a positions panel for where on a level they die). For a game on several platforms, a breakdown by $platform splits players or an event between them (iOS vs Android, PC vs Mac vs Steam Deck); a web game splits by $browser,
|
|
120
|
+
"Save the game's dashboard: its pages, in the order the sidebar shows them. Each page is a board of panels in the game's own words, or a built-in view (events, performance, errors, players, heatmaps, sessions, versions, live, reports, servers, matches) the game keeps, renames or drops. Design it for this game, not for a genre it isn't: a puzzle game cares about solve time and hints, a mobile game about opens, modes, the paywall and purchases (revenue: a stat with sum \"amount\" of \"purchase\"; revenue per player: per \"$players\"; conversion: event \"purchase\" per \"$players\"; revenue by item: a breakdown with sum, of completed ones only with event \"purchase:result=done\"; a Roblox game's money is in Robux: currency \"ROBUX\", and devex true on a panel adds an estimate in dollars), a platformer about deaths per level (and a positions panel for where on a level they die). For a game on several platforms, a breakdown by $platform splits players or an event between them (iOS vs Android, PC vs Mac vs Steam Deck); a web game splits by $browser, any game by $device_tier, and by $graphics to see whether a lower graphics setting holds the frame rate (a Roblox game gets it without code; another engine sets a `graphics` property with its preset). For balance and outcomes, a breakdown with rate gives each row its rate and interval next to the overall one (win rate by hero: event \"match_end\", by \"hero\", rate \"won\"); per \"$hours\" turns counts and sums into rates per hour played (gold per hour); a distribution panel or a stat with of and quantile shows how long matches or runs last; a stat with first gives the median seconds from a session's start to its first event of a kind (time in the lobby: first \"hall_left\"), and one with never the share of ended sessions that never sent it (never left the lobby), so the game needn't time it by hand; a breakdown of steps or days takes order \"value\" (day 1 to 7 in order); a table lists an event's events one by one, grouped and sorted (daily runs by day, best score first: type \"table\", event \"daily_run\", group_by \"day_label\", sort \"-score\", of \"score\"); a list attribute (deck, build, boons) splits by element. Split by what the game set for the session with setProperties ($rank, $class, $region), and give a page where to show only some sessions (a page for the high ranks); a levels panel by a levelStart attribute shows clears by tier or difficulty, and count \"runs\" runs per biome. A multiplayer game gets a Network page (ping_p95 and disconnect_pct stats, net panels by $region or $link), and one whose dedicated servers run the SDK in server mode a Servers page (servers_now, server_tick_p95, a servers panel by players) or the built-in servers view; a game that sets match groups can keep the built-in matches view. An open world or an avatar hub that names its zones (setZone) gets where play time goes and how each zone runs: a breakdown by $zone without event (time in each zone), zone_time_pct and zone_median_s stats with zone, and frame_time by $zone (hitches per zone); don't send zone timing as custom events. The first page opens first. Use the events the game sends (glitchless_events lists them, with their attributes); on a board, stats first, then the game's own events and funnels, then levels, frame_time and errors. Leave out what the game has no data for (no Heatmaps page for a game without positions, no reports page for a game that doesn't turn bug reports on). Send every page: read the current ones with glitchless_dashboard (its spec), change them, send them all back. Pass reset: true to go back to the automatic dashboard. accent sets the colour of the game's boards and share links (links, the selected page, stats, the main chart series, the map), logo and banner their logo and header picture (the game's key art, behind each board's title), and background gives a level, a zone or the whole game a heatmap background (a top-down picture and its world bounds); each can be sent alone. A picture is a file on this computer, which the local server (npx glitchless-mcp) reads, or base64. The hosted server can't read your files: for file (or upload: true on any server) it answers with an upload link instead, and you send the picture with one curl (curl -X PUT --data-binary @file '<link>', no key). A link lasts 10 minutes, takes one picture for its one slot (the logo, the banner, or one place's background with the bounds it was made with) and then stops working; a picture refused for its size or type can be sent again until it expires, and a game gets at most 30 links an hour. Each slot's limit: a logo at most 100 KB and 1024 × 1024 pixels, a banner 300 KB and 4096 × 2048, a background 256 KB and 4096 × 4096, all PNG, JPEG or WebP. Needs a secret key with the dashboard scope.",
|
|
121
121
|
inputSchema: {
|
|
122
122
|
service: z.string().optional().describe('Game service name (defaults to the most recently active game)'),
|
|
123
123
|
pages: z.array(pageSchema).max(20).optional().describe('Every page, in order: at most 20 (boards and built-in views together)'),
|
|
@@ -138,13 +138,18 @@ define(
|
|
|
138
138
|
},
|
|
139
139
|
async ({ service, pages, currency, reset, accent, logo, banner, background }) => {
|
|
140
140
|
const svc = await resolveService(service);
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
//
|
|
141
|
+
if (!reset && !pages?.length && accent === undefined && !logo && !banner && !background) throw new Error('give pages, accent, logo, banner, background, or reset: true');
|
|
142
|
+
// The look (accent, logo, banner) and a background are kept apart from the pages, so each can go alone. A picture
|
|
143
|
+
// that goes by an upload link changes nothing yet: the line says how to send it.
|
|
144
144
|
const said = [];
|
|
145
|
+
let look = accent !== undefined;
|
|
145
146
|
if (accent !== undefined) said.push(`Accent: ${(await write('PUT', `/v1/brand?service=${encodeURIComponent(svc)}`, { accent })).brand?.accent ?? 'none'}.`);
|
|
146
|
-
|
|
147
|
-
|
|
147
|
+
for (const [kind, picture] of [['logo', logo], ['banner', banner]]) {
|
|
148
|
+
if (!picture) continue;
|
|
149
|
+
const { text, saved } = await saveBrandImage(svc, kind, picture);
|
|
150
|
+
said.push(text);
|
|
151
|
+
look ||= saved;
|
|
152
|
+
}
|
|
148
153
|
const bg = background ? await saveBackground(svc, background) : null;
|
|
149
154
|
if (bg) said.push(bg.text);
|
|
150
155
|
const colour = said.length ? ` ${said.join(' ')}` : '';
|