glitchless-mcp 0.9.0 → 0.10.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 +7 -4
- package/package.json +1 -1
- package/src/context.js +12 -5
- package/src/hosted-tools.js +1 -0
- package/src/login.js +1 -1
- package/src/tools/analytics.js +40 -18
- package/src/tools/core.js +34 -12
- package/src/tools/dashboard.js +30 -13
- package/src/tools/multiplayer.js +153 -0
- package/src/tools/workspace.js +1 -1
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ It prints a link and a code; you approve the code in the Glitchless dashboard, a
|
|
|
26
26
|
workspace: `glitchless_list_games` lists them, `glitchless_create_game` makes one and returns its client token, and
|
|
27
27
|
every tool takes `game` (a name or id). The key acts as you, with your role in the workspace, and never deletes data
|
|
28
28
|
or touches billing or people. `npx -y glitchless-mcp whoami` shows where you're signed in, `logout` deletes the saved
|
|
29
|
-
key, and Settings →
|
|
29
|
+
key, and Settings → Keys & access in the dashboard lists and revokes keys. An agent can also sign in from inside a
|
|
30
30
|
chat with the `glitchless_sign_in` tool: it shows the link and code, and the running server switches over once you
|
|
31
31
|
approve.
|
|
32
32
|
|
|
@@ -97,9 +97,9 @@ above go in its environment.
|
|
|
97
97
|
| `glitchless_overview` | Headline numbers: sessions, players, crash-free sessions, frame time against the budget, rage quits |
|
|
98
98
|
| `glitchless_performance` | Frame time per level, with draw calls, geometry counts and game gauges |
|
|
99
99
|
| `glitchless_get_error` | One error issue, with its stack and the gameplay before it |
|
|
100
|
-
| `glitchless_player_funnel` | Per level: starts, completions, deaths and their causes, rage quits |
|
|
100
|
+
| `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 |
|
|
101
101
|
| `glitchless_death_hotspots` | Where players die on a level, clustered in world coordinates |
|
|
102
|
-
| `glitchless_events` | The game's own events (whatever it sends with `track`): counts, attribute breakdowns and funnels |
|
|
102
|
+
| `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 |
|
|
103
103
|
| `glitchless_dashboard` | The game's dashboard: its pages, and one board's panels with their numbers |
|
|
104
104
|
| `glitchless_set_dashboard` | Save the game's pages: boards of panels in its own words, and the built-in views it keeps. Needs a key with the dashboard scope |
|
|
105
105
|
| `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,11 +108,14 @@ above go in its environment.
|
|
|
108
108
|
| `glitchless_store_reviews` | For a game connected to a store (Glitchless Cloud: Steam, Google Play, the App Store): what players wrote there, by store, build or version, sentiment, topic (stutter, lag, fps, freeze, crash), device and, on Steam, Steam Deck, each build with the frame-time p95 and crash-free sessions measured on it |
|
|
109
109
|
| `glitchless_store_vitals` | What Google Play (slow rendering, crash and ANR rates, the slowest devices and GPUs) or the App Store (hang rate, launch time, animation hitches, hang signatures) measured of each version, next to what Glitchless measured, and where the two disagree |
|
|
110
110
|
| `glitchless_revenue` | For a game connected to RevenueCat or to its own Stripe account (Glitchless Cloud; `source` picks one, else both): its real revenue by day and revenue per player measured. RevenueCat's (production purchases only): installs (new customers) and active users, MRR, active subscriptions and trials, and revenue by version where RevenueCat splits it. Stripe's: refunds, disputes, fees and net, new paying customers, revenue by product, and by version and platform for purchases the game tied to a session. All next to the sessions, players and new players Glitchless measured and what the game's own purchase events add up to |
|
|
111
|
+
| `glitchless_match` | A multiplayer game's matches (the worst by lag or disconnects on request), or one match from every side, 30 seconds at a time: each player's ping, frame time and outcome, the server's ticks, and whether the whole lobby lagged at once (the server) or one player did (their connection) |
|
|
112
|
+
| `glitchless_network` | Ping, lag (play over 150 ms), packet loss and disconnects by level, version, platform, kind of connection and region, with the worst matches and the network findings |
|
|
113
|
+
| `glitchless_servers` | A game's dedicated servers in server mode: servers running now and their players, tick time against its budget by players connected, map and version, crashes with the matches they ended, and memory that climbs. Every other tool reads them with service `<game>.server` |
|
|
111
114
|
| `glitchless_playtest` | Autoplay bots play the game and compare with a saved baseline ([glitchless-playtest](https://www.npmjs.com/package/glitchless-playtest); needs Playwright in the game project) |
|
|
112
115
|
| `glitchless_deck_send` | Build the game, send it to the paired Steam Deck, add it to the Deck's library and optionally start it ([glitchless-deck](https://www.npmjs.com/package/glitchless-deck); pair once with `npx glitchless-deck pair`) |
|
|
113
116
|
| `glitchless_deck_measure` | Measure a Unity, Godot or Unreal build on the Steam Deck and compare it with a saved run |
|
|
114
117
|
|
|
115
|
-
The reads take `hours`, `version`, `env` (e.g. `prod`)
|
|
118
|
+
The reads take `hours`, `version`, `env` (e.g. `prod`), `session_type` (`user` for players only, `tester` for people on TestFlight and other test builds, `synthetic` for bots, playtests and store test devices, `all`) and `props`, the session properties the game sets (`{ rank: "diamond" }`, or a list of values). Unless `env` or `session_type` is given, findings read the production sessions of players and say so; the other numbers count every session in the window.
|
|
116
119
|
|
|
117
120
|
To let the agent drive the running game as well (measure frame times, inspect the scene, load a
|
|
118
121
|
level), add the WebMCP server beside this one: `npx -y @jason.today/webmcp@latest --mcp`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glitchless-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"mcpName": "io.github.glitchless-gg/glitchless",
|
|
5
5
|
"description": "Game observability and analytics MCP server for Unity, Godot, Unreal, Three.js, Phaser and GameMaker games. Coding agents (Claude Code, Codex, Cursor and others) read your players' stutters, crashes, custom metrics and ranked findings, 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.10.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');
|
|
@@ -169,11 +169,17 @@ export const common = {
|
|
|
169
169
|
.enum(['user', 'tester', 'synthetic', 'all'])
|
|
170
170
|
.optional()
|
|
171
171
|
.describe('"user": players only; "tester": people on TestFlight and other test builds only; "synthetic": bots, playtests and store test devices only; "all" or unset: every session. Findings (glitchless_triage, and the overview\'s) read the production sessions of players unless env or session_type is given'),
|
|
172
|
+
props: z
|
|
173
|
+
.record(z.string(), z.union([z.string(), z.number(), z.boolean(), z.array(z.union([z.string(), z.number(), z.boolean()]))]))
|
|
174
|
+
.optional()
|
|
175
|
+
.describe('Only sessions with these session properties (what the game set with setProperties): { rank: "diamond" }, or a list of values for any of them, { rank: ["diamond", "master"] }; "(none)" keeps the sessions without one. glitchless_events lists the properties and their values. Read from the sessions, so over 31 days or less'),
|
|
172
176
|
};
|
|
173
177
|
|
|
174
|
-
// The filters every read passes on to the Glitchless API.
|
|
175
|
-
export function filters({ version, steam_branch, env, session_type } = {}) {
|
|
176
|
-
|
|
178
|
+
// The filters every read passes on to the Glitchless API: a session property becomes prop.<key>=<value>[,<value>…].
|
|
179
|
+
export function filters({ version, steam_branch, env, session_type, props } = {}) {
|
|
180
|
+
const out = { version, steam_branch, env, type: session_type };
|
|
181
|
+
for (const [key, value] of Object.entries(props || {})) out[`prop.${key}`] = (Array.isArray(value) ? value : [value]).map(String).join(',');
|
|
182
|
+
return out;
|
|
177
183
|
}
|
|
178
184
|
|
|
179
185
|
// ── the tools ─────────────────────────────────────────────────────
|
|
@@ -238,7 +244,8 @@ function instructions(remote) {
|
|
|
238
244
|
: "On Glitchless Cloud, glitchless_sign_in connects you to the person's whole workspace (they approve a code in the browser): then glitchless_list_games lists every game, glitchless_create_game makes one and hands back its client token, every tool takes game (by name), and glitchless_share_board makes a read-only link to a board.",
|
|
239
245
|
'Start with glitchless_triage to get ranked, evidence-backed findings for a game, then drill in with glitchless_performance, glitchless_get_error, glitchless_death_hotspots or glitchless_session.',
|
|
240
246
|
'When players or playtesters send bug reports from inside the game (an F8 form or a button), glitchless_bug_reports lists them with what they wrote, the level and where they stood, and opens one with its screenshot.',
|
|
241
|
-
'For metrics the game defines itself (what it sends with track(): plays, purchases, paywall views and so on) and funnels between them, use glitchless_events.',
|
|
247
|
+
'For metrics the game defines itself (what it sends with track() and count(): plays, purchases, paywall views, kills and gold, and so on) and funnels between them, use glitchless_events; it also lists the session properties the game sets (rank, class, region), which every read tool takes as props.',
|
|
248
|
+
'For a multiplayer game, glitchless_network gives ping, packet loss and disconnects by level, region, platform, kind of connection and version; glitchless_match lists matches or opens one from every side, telling a whole lobby lagging (the server) from one player lagging (their connection); and glitchless_servers reads the game\'s dedicated servers (tick time against its budget by players connected, crashes that ended matches, memory that climbs).',
|
|
242
249
|
'For a game connected to a store (Steam, Google Play, the App Store), glitchless_store_reviews reads what players wrote there by build, with the hardware and Steam Deck playtime reviewers show, next to what Glitchless measured on that build, and glitchless_store_vitals what the store itself measured (slow rendering, crashes, ANRs, hangs) next to Glitchless, version by version.',
|
|
243
250
|
"For a game connected to RevenueCat or to its own Stripe account, glitchless_revenue reads its real revenue by day, version and country (RevenueCat: production purchases only, by store too, installs and active users; Stripe: refunds, fees, net, new paying customers and revenue by product), next to the sessions, players and new players Glitchless measured and what the game's own purchase events add up to.",
|
|
244
251
|
"Each game has its own dashboard, a list of pages (boards of panels, and built-in views such as Errors, Sessions and Live Tail): read it with glitchless_dashboard, and after instrumenting a game, design one that fits it with glitchless_set_dashboard.",
|
package/src/hosted-tools.js
CHANGED
package/src/login.js
CHANGED
|
@@ -66,7 +66,7 @@ export async function cli(argv) {
|
|
|
66
66
|
};
|
|
67
67
|
if (command === 'logout') {
|
|
68
68
|
fs.rmSync(CREDENTIALS_FILE, { force: true });
|
|
69
|
-
console.log('Signed out: the saved workspace key is deleted. Revoke it in Settings →
|
|
69
|
+
console.log('Signed out: the saved workspace key is deleted. Revoke it in Settings → Keys & access if it may have leaked.');
|
|
70
70
|
return 0;
|
|
71
71
|
}
|
|
72
72
|
if (command === 'whoami') {
|
package/src/tools/analytics.js
CHANGED
|
@@ -1,50 +1,72 @@
|
|
|
1
|
-
// The game's own metrics: its custom events and funnels,
|
|
1
|
+
// The game's own metrics: its custom events, counters and funnels, the session properties it sets, and versions (or
|
|
2
|
+
// Steam branches, or a property's values) compared in its own terms.
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { query, resolveService, range, reply, common, tool, filters } from '../context.js';
|
|
4
5
|
|
|
5
6
|
tool(
|
|
6
7
|
'glitchless_events',
|
|
7
|
-
"The game's own metrics, from the custom events it sends with track(): each event's count in the window, the sessions and players that sent it, how its attribute values break down (for example plays by mode, paywall views by placement, purchases started vs done),
|
|
8
|
+
"The game's own metrics, from the custom events it sends with track() and the streams it counts with count() (marked counted: summed on the device per window, so their numbers have sums and averages but no spread): each event's count in the window, the sessions and players that sent it, how its attribute values break down (for example plays by mode, paywall views by placement, purchases started vs done; a list attribute such as a deck by element, each event counted once under each), the sums of its numeric attributes per currency (revenue: the amount of purchase events) and their p50, p90 and p99, and `hours`, the hours played in the window, to turn any count into a rate per hour. Give `funnel` to count the sessions that went from one event to the next, in that order. With name and `rate` (a flag such as \"won\", or a word outcome \"result=win\") or `avg` (a numeric attribute), it measures that event: overall, or with `by` per value (win rate by hero, with a 95% interval for each, next to the overall rate). With name and `of` (a numeric attribute), it gives that attribute's distribution: percentiles and a histogram, optionally `by` a split. `properties` lists what the game set for its sessions with setProperties (rank, class, region, a preset), each with its values and their sessions and players; identifier_like marks one with more than 200 values a day, which is an ID rather than a property. Every read tool filters by them (props) and splits by them (by \"$rank\").",
|
|
8
9
|
{
|
|
9
10
|
...common,
|
|
10
|
-
name: z.string().optional().describe('Only this event, e.g. "paywall"'),
|
|
11
|
-
funnel: z.string().optional().describe('Steps in order, comma-separated: "open,paywall,buy". A step can require a value: "buy=done" (any attribute) or "buy:step=done"'),
|
|
11
|
+
name: z.string().optional().describe('Only this event, e.g. "paywall". With rate, avg or of, the event to measure; it can carry a filter like a panel\'s event: "match_end:mode=ranked", or "battle_end:deck=hog_rider+ice_spirit" for decks with both'),
|
|
12
|
+
funnel: z.string().optional().describe('Steps in order, comma-separated: "open,paywall,buy". A step can require a value: "buy=done" (any attribute) or "buy:step=done"; a list matches when it has the value'),
|
|
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
|
+
avg: z.string().optional().describe('A numeric attribute\'s mean per event, e.g. "duration_s"'),
|
|
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")'),
|
|
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'),
|
|
12
18
|
},
|
|
13
|
-
async ({ service, hours, name, funnel, ...f }) => {
|
|
19
|
+
async ({ service, hours, name, funnel, rate, avg, of, by, min, ...f }) => {
|
|
14
20
|
const svc = await resolveService(service);
|
|
15
|
-
const d = await query('events', { service: svc, ...filters(f), name, funnel, ...range(hours) });
|
|
21
|
+
const d = await query('events', { service: svc, ...filters(f), name: name?.split(/[:=]/)[0].trim(), event: name, funnel, rate, avg, of, by, min, ...range(hours) });
|
|
16
22
|
const brief = d.events
|
|
17
23
|
.slice(0, 15)
|
|
18
|
-
.map((e) => `${e.name}: ${e.count} in ${e.sessions} session(s)${(e.sums || []).length ? `; ${e.sums.map((x) => `${x.attr} sum ${x.sum}${x.currency ? ` ${x.currency}` : ''}`).join(', ')}` : ''}`)
|
|
24
|
+
.map((e) => `${e.name}${e.counted ? ' (counted)' : ''}: ${e.count} in ${e.sessions} session(s)${(e.sums || []).length ? `; ${e.sums.map((x) => `${x.attr} sum ${x.sum}${x.currency ? ` ${x.currency}` : ''}`).join(', ')}` : ''}`)
|
|
19
25
|
.join('\n');
|
|
20
|
-
|
|
26
|
+
const props = d.properties || [];
|
|
27
|
+
const propLine = props.length ? `\nSession properties: ${props.map((p) => (p.identifier_like ? `${p.key} (an ID: too many values)` : `${p.key} (${p.values.slice(0, 5).map((v) => v.value).join(', ')}${p.values.length > 5 ? ', …' : ''})`)).join('; ')}` : '';
|
|
28
|
+
const m = d.measure;
|
|
29
|
+
const measured = m ? `\n${m.event} ${m.rate ? `rate of ${m.rate}` : `average ${m.avg}`}${m.by ? ` by ${m.by}` : ''}: ${m.empty ? m.why : m.rows ? `${m.rows.length} rows, overall ${m.overall}${m.rate ? '%' : ''}` : `${m.value}${m.unit === '%' ? '%' : ''} of ${m.events} events`}` : '';
|
|
30
|
+
const dist = d.distribution ? `\n${d.distribution.event} ${d.distribution.of}: ${d.distribution.empty ? d.distribution.why : `p50 ${d.distribution.p50}, p90 ${d.distribution.p90} of ${d.distribution.count}`}` : '';
|
|
31
|
+
return reply(`Custom events for ${svc} (${hours || 24}h, ${d.sessions} sessions, ${d.hours ?? 0} hours played):\n${brief || 'None in this window. A game sends them with track(name, attrs), and streams with count(name, attrs).'}${propLine}${measured}${dist}`, {
|
|
21
32
|
events: d.events.map(({ series, ...e }) => e),
|
|
33
|
+
hours_played: d.hours ?? null,
|
|
34
|
+
properties: props,
|
|
22
35
|
...(d.funnel ? { funnel: d.funnel } : {}),
|
|
36
|
+
...(m ? { measure: (({ ts, series, ...x }) => x)(m) } : {}),
|
|
37
|
+
...(d.distribution ? { distribution: d.distribution } : {}),
|
|
23
38
|
});
|
|
24
39
|
},
|
|
25
40
|
);
|
|
26
41
|
|
|
27
42
|
tool(
|
|
28
43
|
'glitchless_compare_versions',
|
|
29
|
-
'Compare game versions side by side, in the game\'s own terms first: the stats on its boards (glitchless_dashboard) and its own events per session, then the built-in measures it reports (frame time overall and per level, hitches/min, crash-free and error-free sessions, errors per session, level completion, rage-quit rate, deaths per session, geometry growth). Use it to confirm a fix or a design change after shipping a new version. Versions come in release order (when each first showed up at all, not in this window), so by default it compares the newest with the one before it, also while players of older versions still play. For a game on Steam, by "steam_branch" compares Steam branches instead (a beta against "public"), and by "steam_build" Steam builds: a and b are then branch names or build ids.',
|
|
44
|
+
'Compare game versions side by side, in the game\'s own terms first: the stats on its boards (glitchless_dashboard) and its own events per session, then the built-in measures it reports (frame time overall and per level, hitches/min, crash-free and error-free sessions, errors per session, level completion, rage-quit rate, deaths per session, geometry growth). Use it to confirm a fix or a design change after shipping a new version. Versions come in release order (when each first showed up at all, not in this window), so by default it compares the newest with the one before it, also while players of older versions still play. For a game on Steam, by "steam_branch" compares Steam branches instead (a beta against "public"), and by "steam_build" Steam builds: a and b are then branch names or build ids. By a session property ("class", "spender"; glitchless_events lists them) it compares that property\'s values the same way, the most sessions first (over 31 days or less): a and b are then values.',
|
|
30
45
|
{
|
|
31
46
|
service: common.service,
|
|
32
47
|
hours: common.hours,
|
|
33
48
|
env: common.env,
|
|
34
49
|
session_type: common.session_type,
|
|
50
|
+
props: common.props,
|
|
35
51
|
a: z.string().optional().describe('Baseline version, branch or build (default: the one before the newest)'),
|
|
36
52
|
b: z.string().optional().describe('New version, branch or build (default: newest)'),
|
|
37
|
-
by: z.
|
|
53
|
+
by: z.string().optional().describe('What to compare (default version): steam_branch or steam_build (a game that uses Steamworks), or a session property\'s key, e.g. "class"'),
|
|
38
54
|
},
|
|
39
|
-
async ({ service, hours, a, b, by, env, session_type }) => {
|
|
55
|
+
async ({ service, hours, a, b, by, env, session_type, props }) => {
|
|
40
56
|
const svc = await resolveService(service);
|
|
41
|
-
const steam = by && by !== 'version' ? by : null;
|
|
42
|
-
const { versions, has = {}, board = [] } = await query('versions', { service: svc, ...filters({ env, session_type }), ...(steam ? { by: steam } : {}), ...range(hours || 72) });
|
|
43
|
-
const
|
|
44
|
-
|
|
57
|
+
const steam = by && by !== 'version' ? by.replace(/^\$/, '') : null;
|
|
58
|
+
const { versions, has = {}, board = [] } = await query('versions', { service: svc, ...filters({ env, session_type, props }), ...(steam ? { by: steam } : {}), ...range(hours || 72) });
|
|
59
|
+
const prop = steam && steam !== 'steam_branch' && steam !== 'steam_build';
|
|
60
|
+
const what = steam === 'steam_branch' ? 'Steam branch' : steam === 'steam_build' ? 'Steam build' : prop ? `${steam} value` : 'version';
|
|
61
|
+
if (steam && !versions.length) return reply(prop ? `No session of ${svc} has the property ${steam} in this window: the game sets it with setProperties (glitchless_events lists the properties it sends)` : `No session of ${svc} sent its ${what} in this window: the SDKs read it from Steamworks when the game uses it and runs from Steam`, versions);
|
|
45
62
|
if (versions.length < 2 && !(a && b)) return reply(`Only one ${what} of ${svc} has reported in this window`, versions);
|
|
46
|
-
|
|
47
|
-
const
|
|
63
|
+
// A version asked for by name is that one or none: never quietly another.
|
|
64
|
+
const va = a ? versions.find((v) => v.version === a) : versions.at(-2);
|
|
65
|
+
const vb = b ? versions.find((v) => v.version === b) : versions.at(-1);
|
|
66
|
+
if (!va || !vb) {
|
|
67
|
+
const missing = [!va && (a ?? 'an older one'), !vb && (b ?? 'a newer one')].filter(Boolean).join(' and ');
|
|
68
|
+
return reply(`No sessions of ${svc} from ${what} ${missing} in this window (${hours || 72}h); the ${what}s that reported in it: ${versions.map((v) => v.version).join(', ') || 'none'}. Try a longer window with hours`, versions);
|
|
69
|
+
}
|
|
48
70
|
const pair = (x, y) => ({ [va.version]: x ?? null, [vb.version]: y ?? null, change: x != null && y != null ? Math.round((y - x) * 100) / 100 : null });
|
|
49
71
|
// Only the measures this game reports: no frame times for a game that sends none.
|
|
50
72
|
const keys = [...(has.frames ? ['frame_p50', 'frame_p95', 'frame_p99', 'hitches_per_min'] : []), 'crash_free_pct', 'error_free_pct', 'errors_per_session', ...(has.levels ? ['level_completion_pct'] : []), ...(has.deaths || has.fails ? ['rage_quit_pct'] : []), ...(has.deaths ? ['deaths_per_session'] : []), ...(has.geometry ? ['geometries_growth_per_level_load'] : [])];
|
|
@@ -54,6 +76,6 @@ tool(
|
|
|
54
76
|
const levels = [...new Set([...Object.keys(va.level_p95 || {}), ...Object.keys(vb.level_p95 || {})])];
|
|
55
77
|
const level_p95 = Object.fromEntries(levels.map((l) => [l, { [va.version]: va.level_p95?.[l] ?? null, [vb.version]: vb.level_p95?.[l] ?? null }]));
|
|
56
78
|
// Branches and builds are compared from the sessions' own frame windows, which carry no level: no level_p95.
|
|
57
|
-
return reply(`${svc}: ${steam ? `${what} ` : ''}${va.version} (${va.sessions} sessions) vs ${vb.version} (${vb.sessions} sessions)`, { board: own, events_per_session: events, delta, ...(steam ? {} : { level_p95 }), [steam ? `all_${steam === 'steam_branch' ? 'branches' : 'builds'}` : 'all_versions']: versions.map((v) => ({ [steam || 'version']: v.version, sessions: v.sessions, first_seen: new Date(v.first_seen).toISOString(), ...(steam ? {} : { first_seen_ever: v.first_seen_ever == null ? null : new Date(v.first_seen_ever).toISOString() }) })) });
|
|
79
|
+
return reply(`${svc}: ${steam ? `${what} ` : ''}${va.version} (${va.sessions} sessions) vs ${vb.version} (${vb.sessions} sessions)`, { board: own, events_per_session: events, delta, ...(steam ? {} : { level_p95 }), [steam ? `all_${steam === 'steam_branch' ? 'branches' : steam === 'steam_build' ? 'builds' : 'values'}` : 'all_versions']: versions.map((v) => ({ [steam || 'version']: v.version, sessions: v.sessions, first_seen: new Date(v.first_seen).toISOString(), ...(steam ? {} : { first_seen_ever: v.first_seen_ever == null ? null : new Date(v.first_seen_ever).toISOString() }) })) });
|
|
58
80
|
},
|
|
59
81
|
);
|
package/src/tools/core.js
CHANGED
|
@@ -14,7 +14,7 @@ tool('glitchless_list_games', 'List the games: with a workspace key, every game
|
|
|
14
14
|
|
|
15
15
|
tool(
|
|
16
16
|
'glitchless_triage',
|
|
17
|
-
"Ranked findings for a game: performance spikes per level (with the gauges and events they correlate with), memory leaks, top errors, difficulty spikes / rage-quit hotspots
|
|
17
|
+
"Ranked findings for a game: performance spikes per level (with the gauges, counter bursts and events they correlate with), memory leaks, top errors, difficulty spikes / rage-quit hotspots, walls (a level, or one value of a level start's attribute such as a tier), version regressions, settings that run slow (a session property), the network (a whole lobby lagging at once: the server; one kind of connection, platform or region lagging; disconnects rising in a release) and the game's dedicated servers (falling behind when full, a crash that ends matches, memory that keeps climbing) — ranked by severity and player impact, each with evidence and a suggested fix, and naming a session property when most of a problem falls on one value. Start here when asked 'what's wrong with my game?'.",
|
|
18
18
|
{ ...common },
|
|
19
19
|
async ({ service, hours, ...f }) => {
|
|
20
20
|
const svc = await resolveService(service);
|
|
@@ -33,11 +33,15 @@ tool('glitchless_overview', 'Headline KPIs for a game: sessions, players, crash-
|
|
|
33
33
|
|
|
34
34
|
tool(
|
|
35
35
|
'glitchless_performance',
|
|
36
|
-
'Frame-time breakdown for a game: global percentiles vs the frame budget, 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 / version, memory growth per level load and the slowest recent hitches with script attribution.',
|
|
37
|
-
{
|
|
38
|
-
|
|
36
|
+
'Frame-time breakdown for a game: global percentiles vs the frame budget, 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 zone for an open-world game that sets them, memory growth per level load and the slowest recent hitches with script attribution. 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).',
|
|
37
|
+
{
|
|
38
|
+
...common,
|
|
39
|
+
level: z.string().optional().describe('Focus on one level id, e.g. "level-2"'),
|
|
40
|
+
by_prop: z.string().optional().describe('A session property (glitchless_events lists them), e.g. "preset": frame time, hitches and crash-free sessions per value, over 31 days or less'),
|
|
41
|
+
},
|
|
42
|
+
async ({ service, hours, level, by_prop, ...f }) => {
|
|
39
43
|
const svc = await resolveService(service);
|
|
40
|
-
const d = await query('performance', { service: svc, ...filters(f), ...range(hours) });
|
|
44
|
+
const d = await query('performance', { service: svc, ...filters(f), by_prop, ...range(hours) });
|
|
41
45
|
const hitches = (level ? d.hitches.filter((h) => h.level === level) : d.hitches).slice(0, 12);
|
|
42
46
|
return reply(`Frame performance for ${svc}${level ? ` (${level})` : ''}`, {
|
|
43
47
|
kpis: d.kpis,
|
|
@@ -47,6 +51,10 @@ tool(
|
|
|
47
51
|
by_gpu_tier: d.by_gpu_tier.map(slimGroup),
|
|
48
52
|
by_browser: d.by_browser.map(slimGroup),
|
|
49
53
|
by_version: d.by_version.map(slimGroup),
|
|
54
|
+
by_platform: (d.by_platform || []).map(slimGroup),
|
|
55
|
+
...(d.by_zone ? { by_zone: d.by_zone.map(slimGroup) } : {}),
|
|
56
|
+
...(d.by_prop ? { by_prop: { key: d.by_prop.key, ...(d.by_prop.why ? { why: d.by_prop.why } : {}), rows: d.by_prop.rows.map((r) => ({ ...slimGroup(r), all_sessions: r.all_sessions, crash_free_pct: r.crash_free_pct })) } } : {}),
|
|
57
|
+
...(d.network ? { network: d.network.kpis } : {}),
|
|
50
58
|
memory: d.memory,
|
|
51
59
|
load: d.load,
|
|
52
60
|
slowest_recent_hitches: hitches,
|
|
@@ -69,11 +77,22 @@ tool(
|
|
|
69
77
|
},
|
|
70
78
|
);
|
|
71
79
|
|
|
72
|
-
tool(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
80
|
+
tool(
|
|
81
|
+
'glitchless_player_funnel',
|
|
82
|
+
'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 and recent rage quits with positions. 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.',
|
|
83
|
+
{
|
|
84
|
+
...common,
|
|
85
|
+
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'),
|
|
86
|
+
level: z.string().optional().describe('With by or count: only this level'),
|
|
87
|
+
count: z.enum(['runs']).optional().describe('"runs": each run (setGroup("run")) counted once at each level it reached'),
|
|
88
|
+
by_prop: z.string().optional().describe('Retention per value of this session property, e.g. "spender"'),
|
|
89
|
+
},
|
|
90
|
+
async ({ service, hours, by, level, count, by_prop, ...f }) => {
|
|
91
|
+
const svc = await resolveService(service);
|
|
92
|
+
const d = await query('players', { service: svc, ...filters(f), by, level, count, by_prop, ...range(hours) });
|
|
93
|
+
return reply(`Player funnel for ${svc}${by ? ` by ${by}` : ''}${count ? ', counting runs' : ''}`, { kpis: d.kpis, funnel: d.funnel, ...(d.funnel_by ? { funnel_by: d.funnel_by } : {}), session_length: d.session_length, recent_rage_quits: d.rage_quits.slice(0, 15), retention: d.retention });
|
|
94
|
+
},
|
|
95
|
+
);
|
|
77
96
|
|
|
78
97
|
tool(
|
|
79
98
|
'glitchless_death_hotspots',
|
|
@@ -88,12 +107,15 @@ tool(
|
|
|
88
107
|
|
|
89
108
|
tool(
|
|
90
109
|
'glitchless_session',
|
|
91
|
-
'One play session in detail: device/GPU, outcome (crashed, rage quit), and the full event timeline (levels, deaths with positions, errors, hitches with causes, agent annotations) plus per-5s frame stats. Use with session ids from errors, hitches or
|
|
110
|
+
'One play session in detail: device/GPU, outcome (crashed, rage quit), its properties and its groups (the matches, parties and runs it was in), and the full event timeline (levels with their attributes, deaths with positions, errors, hitches with causes, counters once a window, disconnects, agent annotations) plus per-5s frame stats. Use with session ids from errors, hitches, rage quits or a match. A game server\'s session (service "<game>.server") gives its tick windows instead of frames.',
|
|
92
111
|
{ service: common.service, session_id: z.string().describe('Session id (s_…)') },
|
|
93
112
|
async ({ service, session_id }) => {
|
|
94
113
|
const svc = await resolveService(service);
|
|
95
114
|
const d = await query('session', { service: svc, id: session_id });
|
|
96
115
|
if (d.error) return reply(`Session ${session_id} not found in ${svc}`, {});
|
|
97
|
-
|
|
116
|
+
// A server's windows (A9) come every 5 s: they go in a list of their own, not the timeline.
|
|
117
|
+
const ticks = d.timeline.filter((e) => e.type === 'server_window').map(({ ts, level, ticks, tick_hz, tick_p50, tick_p95, late, players, net_objects, cpu_pct, mem_mb, match }) => ({ ts, level, ticks, tick_hz, tick_p50, tick_p95, late, players, net_objects, cpu_pct, mem_mb, ...(match ? { match } : {}) }));
|
|
118
|
+
const timeline = d.timeline.filter((e) => e.type !== 'server_window').map(({ tick, ...e }) => e);
|
|
119
|
+
return reply(`Session ${session_id}`, { session: d.session, timeline: timeline.slice(0, 150), frames: d.frames.map(({ ctx, ...f }) => ({ ...f, ...ctx })).slice(0, 120), ...(ticks.length ? { server_windows: ticks.slice(0, 120) } : {}) });
|
|
98
120
|
},
|
|
99
121
|
);
|
package/src/tools/dashboard.js
CHANGED
|
@@ -4,7 +4,7 @@ import { define, query, write, resolveService, range, reply, common, tool, filte
|
|
|
4
4
|
|
|
5
5
|
tool(
|
|
6
6
|
'glitchless_dashboard',
|
|
7
|
-
"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), and one board's panels with their numbers for the window. `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`, and `mismatch` lists amounts sent in another currency, which are left out. `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 (people upload those in the dashboard: Edit pages → Look).",
|
|
7
|
+
"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`, and `mismatch` lists amounts sent in another currency, which are left out. `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 (people upload those in the dashboard: Edit pages → Look).",
|
|
8
8
|
{ ...common, page: z.string().optional().describe('Id of the board page to evaluate (default: the first board)') },
|
|
9
9
|
async ({ service, hours, page, ...f }) => {
|
|
10
10
|
const svc = await resolveService(service);
|
|
@@ -13,32 +13,45 @@ tool(
|
|
|
13
13
|
const b = await query('board', { service: svc, ...filters(f), page, ...range(hours) });
|
|
14
14
|
// A server without branding (501), or none set: no brand.
|
|
15
15
|
const brand = (await write('GET', `/v1/brand?service=${encodeURIComponent(svc)}`).catch(() => null))?.brand;
|
|
16
|
-
const pages = dashboard.pages.map((p) => ({ id: p.id, title: p.title, ...(p.view ? { view: p.view, ...(p.options ? { options: p.options } : {}) } : { panels: p.panels }) }));
|
|
16
|
+
const pages = dashboard.pages.map((p) => ({ id: p.id, title: p.title, ...(p.view ? { view: p.view, ...(p.options ? { options: p.options } : {}) } : { panels: p.panels, ...(p.where ? { where: p.where } : {}) }) }));
|
|
17
17
|
// A positions panel can hold thousands of bins: its busiest ten say where players die.
|
|
18
18
|
const brief = (p) => (p.type === 'positions' && !p.empty ? { ...p, deaths: p.deaths?.slice(0, 10), path: p.path && { ...p.path, cells: p.path.cells.slice(0, 10) } } : p);
|
|
19
|
-
|
|
19
|
+
// Charts over time are left out (their numbers are in the panel's own fields, a net or servers panel's in kpis and
|
|
20
|
+
// rows): any list as long as the panel's buckets goes; a distribution keeps its percentiles.
|
|
21
|
+
const overTime = ({ ts, series, ...p }) => (Array.isArray(ts) ? Object.fromEntries(Object.entries(p).filter(([, v]) => !(Array.isArray(v) && v.length === ts.length))) : p);
|
|
22
|
+
const board = b.board ? { page: b.board.page, title: b.board.title, panels: b.board.panels.map((p) => brief(overTime(p))) } : { error: b.error };
|
|
20
23
|
return reply(`Dashboard for ${svc} (${dashboard.source}${dashboard.updated_by ? `, saved by ${dashboard.updated_by}` : ''}):`, { pages, board, spec: dashboard.spec, brand: brand ? { accent: brand.accent, logo: !!brand.logo, banner: !!brand.banner } : null });
|
|
21
24
|
},
|
|
22
25
|
);
|
|
23
26
|
|
|
24
27
|
const panelSchema = z
|
|
25
28
|
.object({
|
|
26
|
-
type: z.enum(['stat', 'series', 'breakdown', 'funnel', 'levels', 'frame_time', 'errors', 'deaths', 'events', 'findings', 'sessions', 'versions', 'live', 'reports', 'retention', 'positions']).describe('retention: D1, D7 and D30 by the day players were first seen; needs player IDs (privacy install or full). positions: where players died on one level (and where they went), as counts per bin: safe on a shared board, and a game can poll it through a share link to draw its own dead'),
|
|
29
|
+
type: z.enum(['stat', 'series', 'breakdown', 'distribution', 'funnel', 'levels', 'frame_time', 'errors', 'deaths', 'events', 'findings', 'sessions', 'versions', 'live', 'reports', 'retention', 'positions', 'net', 'servers']).describe('distribution: how a numeric attribute (of) spreads, as percentiles (p50, p90, p99) and a histogram, optionally by a split: match length, time in queue, placement, floors reached. levels: starts, completions, fails, deaths and disconnects per level, with the median and p90 clear time; by splits each level\'s attempts (clears by tier, by class), count "runs" counts runs per biome. retention: D1, D7 and D30 by the day players were first seen; needs player IDs (privacy install or full); by a property, per value. positions: where players died on one level (and where they went), as counts per bin: safe on a shared board, and a game can poll it through a share link to draw its own dead. net (a multiplayer game): show ping (p50 and p95 over time, and the share of play over 150 ms), loss, or disconnects (per hour played, by reason), optionally by a split ($region, $link, $level, $version). servers (a game whose dedicated servers run the SDK in server mode): show ticks (tick time against its budget, by "players" connected, $level or $version), players, or crashes (with the matches and players each ended)'),
|
|
27
30
|
title: z.string().optional().describe("In the game's own words, e.g. \"Stops won vs lost\""),
|
|
28
31
|
note: z.string().optional().describe("One line on why this panel matters: people read it behind the info icon next to the panel's title"),
|
|
29
32
|
size: z.enum(['s', 'm', 'l']).optional().describe('s = a quarter row (stats), m = half, l = full width'),
|
|
30
|
-
metric: z.string().optional().describe('stat: sessions, players, avg_session_s, crash_free_pct, error_free_pct, frame_p95, avg_fps, hitches_per_min, errors, deaths, rage_quit_pct
|
|
31
|
-
event: z.string().optional().describe('stat, series, breakdown: one event, "name", "name=value" or "name:key=value". A series or breakdown by $platform, $browser or $device_tier can leave it out: then it counts sessions (and players, with player IDs) in each'),
|
|
33
|
+
metric: z.string().optional().describe('stat: sessions, players, avg_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. deaths and errors take per "$hours": deaths per hour played'),
|
|
34
|
+
event: z.string().optional().describe('stat, series, breakdown, distribution: 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 $device_tier can leave it out: then it counts sessions (and players, with player IDs) in each'),
|
|
32
35
|
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) shows in the game\'s currency; amounts in another currency are named, not added'),
|
|
33
|
-
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)'),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
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)'),
|
|
37
|
+
rate: z.string().optional().describe('stat, series, breakdown: the share of the event\'s events where a flag holds, "won" (a boolean, or a number that is only 1 or 0), or a word outcome holds, "result=win". A breakdown gives each row its rate with a 95% interval (low, high) next to the overall rate: win rate by hero, by heat, of decks with each card (by a list), boons taken when offered. Send outcomes as booleans where you can: a word outcome split by another attribute reads the first 16 of each session\'s events'),
|
|
38
|
+
avg: z.string().optional().describe('stat, series, breakdown: a numeric attribute\'s mean per event instead of a count, e.g. "duration_s" by mode'),
|
|
39
|
+
min: z.number().int().optional().describe('breakdown with rate or avg: rows with fewer events are left out and counted in small (default 30 for a rate, 10 for an average)'),
|
|
40
|
+
expect: z.number().optional().describe('breakdown or stat with rate: the percentage the game intends, such as a gacha\'s published odds (0.6 for 0.6%). Rows whose interval misses it are marked, and a finding names them'),
|
|
41
|
+
order: z.enum(['rate', 'avg', 'count', 'value']).optional().describe('breakdown with rate or avg: rate or avg (default, the highest first), count (most events first) or value (in the values\' own order: heat 0, 1, 2)'),
|
|
42
|
+
of: z.string().optional().describe('distribution (required), stat: the numeric attribute whose spread to show, e.g. "duration_s". A stat with of and quantile shows one percentile: the median match'),
|
|
43
|
+
quantile: z.number().int().optional().describe('stat with of: the percentile, 1 to 99 (50: the median, 90: 1 in 10 is over it)'),
|
|
44
|
+
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'),
|
|
45
|
+
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")'),
|
|
46
|
+
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…), $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), 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). versions: also a property ($class), its values side by side. With sum and an attribute, event is a name only. 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'),
|
|
47
|
+
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)'),
|
|
36
48
|
steps: z.string().optional().describe('funnel: events in order, comma-separated, e.g. "paywall,buy=tapped,buy=done"'),
|
|
37
49
|
label: z.string().optional().describe('levels: what the game calls a level, e.g. "Stop" or "Puzzle"'),
|
|
38
50
|
sent: z.string().optional().describe('sessions: only sessions that sent this event, e.g. "buy=done"'),
|
|
39
51
|
events: z.array(z.string()).optional().describe('live: only these event names or types, e.g. ["buy", "paywall", "error"]'),
|
|
40
|
-
level: z.string().optional().describe('positions (required): the level id, as the game passes it to levelStart'),
|
|
41
|
-
|
|
52
|
+
level: z.string().optional().describe('positions (required): the level id, as the game passes it to levelStart. levels and deaths: only this level\'s rows'),
|
|
53
|
+
count: z.enum(['runs']).optional().describe('levels: "runs" counts each run (setGroup("run")) once at each level it reached, however many sessions it spanned: a roguelite\'s runs that reach each biome'),
|
|
54
|
+
show: z.enum(['deaths', 'path', 'both', 'installs', 'revenue', 'ping', 'loss', 'disconnects', 'ticks', 'players', 'crashes']).optional().describe('positions: deaths (default), path (where players went, on a coarser grid) or both. store_revenue by_country: installs (default) or revenue, what its map shows first (people can switch). net: ping (default), loss or disconnects. servers: ticks (default), players or crashes'),
|
|
42
55
|
bin: z.number().positive().optional().describe("positions: a bin's width in world units (default about a hundredth of the level). Fix it when a game draws the panel, so bins don't move as the level fills in"),
|
|
43
56
|
})
|
|
44
57
|
.describe('One panel');
|
|
@@ -67,7 +80,11 @@ const pageSchema = z
|
|
|
67
80
|
title: z.string().optional().describe('The name in the sidebar, in the words the game uses (a view keeps its built-in name without one)'),
|
|
68
81
|
icon: z.enum(['board', 'overview', 'events', 'perf', 'errors', 'players', 'heatmap', 'sessions', 'versions', 'live', 'flag', 'bolt', 'play', 'clock', 'bug', 'money']).optional(),
|
|
69
82
|
panels: z.array(withStores(panelSchema)).optional().describe('A board: its panels, in order'),
|
|
70
|
-
view: z.enum(['events', 'performance', 'errors', 'players', 'heatmaps', 'sessions', 'versions', 'live', 'reports']).optional().describe('A built-in view instead of panels (reports: the bug reports players sent, with their screenshots)'),
|
|
83
|
+
view: z.enum(['events', 'performance', 'errors', 'players', 'heatmaps', 'sessions', 'versions', 'live', 'reports', 'servers', 'matches']).optional().describe('A built-in view instead of panels (reports: the bug reports players sent, with their screenshots; servers: the game\'s dedicated servers in server mode, their ticks by map and players connected, crashes and memory; matches: the range\'s matches, each opening a match page with every player\'s ping slot by slot and the server\'s ticks under them)'),
|
|
84
|
+
where: z
|
|
85
|
+
.record(z.string(), z.union([z.string(), z.number(), z.boolean(), z.array(z.union([z.string(), z.number(), z.boolean()]))]))
|
|
86
|
+
.optional()
|
|
87
|
+
.describe('A board page only: the session properties its sessions must have, "$<key>" → a value or a list of up to 20 (at most 4 properties), e.g. { "$rank": ["diamond", "master"] }: every panel on the page reads only those sessions (a "Diamond and up" page)'),
|
|
71
88
|
options: z.object({ events: z.array(z.string()).optional() }).optional().describe('live view: events, only these event names or types'),
|
|
72
89
|
})
|
|
73
90
|
.describe('One page: either panels (a board) or view (a built-in view)');
|
|
@@ -77,7 +94,7 @@ define(
|
|
|
77
94
|
{
|
|
78
95
|
title: 'Save dashboard',
|
|
79
96
|
description:
|
|
80
|
-
"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) 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), 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, and any game by $device_tier. 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); it can be sent alone. Needs a secret key with the dashboard scope.",
|
|
97
|
+
"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), 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, and any game by $device_tier. 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 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. 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); it can be sent alone. Needs a secret key with the dashboard scope.",
|
|
81
98
|
inputSchema: {
|
|
82
99
|
service: z.string().optional().describe('Game service name (defaults to the most recently active game)'),
|
|
83
100
|
pages: z.array(pageSchema).optional(),
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// Multiplayer: matches from every side, the network players play over, and the game's dedicated servers
|
|
2
|
+
// (docs/design/genre-coverage.md A7, A8, A9). A match is a group ID the game's server made, shared by everyone in it;
|
|
3
|
+
// network quality comes from each frame window's `net` and the disconnects the SDKs send; a server runs the SDK in
|
|
4
|
+
// server mode and its sessions are kept under the game's companion service, "<game>.server".
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { query, resolveService, range, reply, common, tool, filters, slimIssue } from '../context.js';
|
|
7
|
+
|
|
8
|
+
// "<game>.server" → "<game>": these tools read a game's servers through the game itself.
|
|
9
|
+
const gameOf = (svc) => (svc.endsWith('.server') ? svc.slice(0, -'.server'.length) : svc);
|
|
10
|
+
|
|
11
|
+
// Seconds into a match as m:ss.
|
|
12
|
+
const clock = (s) => `${Math.floor(s / 60)}:${String(Math.round(s % 60)).padStart(2, '0')}`;
|
|
13
|
+
|
|
14
|
+
// Slot starts (seconds) → stretches "3:00–4:00", each slot `step` seconds long.
|
|
15
|
+
function stretches(ts, step) {
|
|
16
|
+
const out = [];
|
|
17
|
+
for (const t of [...ts].sort((a, b) => a - b)) {
|
|
18
|
+
const last = out.at(-1);
|
|
19
|
+
if (last && t - last[1] <= step) last[1] = t;
|
|
20
|
+
else out.push([t, t]);
|
|
21
|
+
}
|
|
22
|
+
return out.map(([a, b]) => `${clock(a)}–${clock(b + step)}`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const median = (xs) => {
|
|
26
|
+
const s = xs.filter((v) => v != null).sort((a, b) => a - b);
|
|
27
|
+
return s.length ? s[Math.floor(s.length / 2)] : null;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// What a match page says first: whether the whole lobby lagged at once (the server or its network) or players lagged
|
|
31
|
+
// on their own (their connections), and what the server's ticks did then.
|
|
32
|
+
function verdict(m) {
|
|
33
|
+
const step = m.slot_s || 30;
|
|
34
|
+
const lobby = new Set(m.lobby_spikes || []);
|
|
35
|
+
const ticks = (m.server || []).flatMap((s) => s.slots);
|
|
36
|
+
const budget = (m.server || []).find((s) => s.budget_ms != null)?.budget_ms ?? null;
|
|
37
|
+
const during = median(ticks.filter((x) => lobby.has(x.t)).map((x) => x.tick_p95));
|
|
38
|
+
const otherwise = median(ticks.filter((x) => !lobby.has(x.t)).map((x) => x.tick_p95));
|
|
39
|
+
const alone = m.sessions.map((s) => ({ s, at: s.slots.filter((x) => x.spike && !lobby.has(x.t)).map((x) => x.t) })).filter((x) => x.at.length);
|
|
40
|
+
const parts = [];
|
|
41
|
+
if (lobby.size) {
|
|
42
|
+
parts.push(`The whole lobby lagged at once at ${stretches(lobby, step).join(', ')}: that's the server or its network, not players' connections.`);
|
|
43
|
+
if (during != null) parts.push(`The server's slowest ticks then: ${during} ms${budget ? ` against a ${budget} ms budget` : ''} (${otherwise ?? '?'} ms the rest of the match).`);
|
|
44
|
+
} else parts.push('No moment where the whole lobby lagged at once.');
|
|
45
|
+
if (alone.length) parts.push(`${alone.length} ${alone.length === 1 ? 'player' : 'players'} lagged on their own (their connection): ${alone.slice(0, 5).map((x) => `${x.s.session_id} at ${stretches(x.at, step).join(', ')}`).join('; ')}.`);
|
|
46
|
+
if (m.disconnects) parts.push(`${m.disconnects} disconnected (${Object.entries(m.disconnect_reasons || {}).map(([r, n]) => `${n} ${r.replace('_', ' ')}`).join(', ')}).`);
|
|
47
|
+
return parts.join(' ');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
tool(
|
|
51
|
+
'glitchless_match',
|
|
52
|
+
"Matches of a multiplayer game, from every side (the game marks a match with setGroup('match', id), the ID its server made; every SDK hashes it the same way, so its players and its server join up). Without id: the window's matches, the most recent first, or the worst by lag (ping) or disconnects (sort), each with its level, players, outcomes, disconnects, ping and lag (the share of connected play over 150 ms), and its server's tick. With id: one match slot by slot (30 seconds) from its start, with a verdict that tells a whole lobby lagging at once (the server or its network) from one player lagging (their connection): each player's ping, frame time, outcome and disconnects, the server's ticks against its budget and the players connected in the same slots, and the match's events. slots: true gives every slot of every player.",
|
|
53
|
+
{
|
|
54
|
+
...common,
|
|
55
|
+
id: z.string().optional().describe('A match id (h_… or the game\'s own), from the list or a finding'),
|
|
56
|
+
sort: z.enum(['recent', 'lag', 'disconnects']).optional().describe('Without id: recent (default), lag (the worst ping p95 first) or disconnects'),
|
|
57
|
+
limit: z.number().int().min(1).max(200).optional().describe('Without id: how many matches (default 20)'),
|
|
58
|
+
slots: z.boolean().optional().describe('With id: every 30-second slot of every player and server (long for a big match); by default only the slots that lagged'),
|
|
59
|
+
},
|
|
60
|
+
async ({ service, hours, id, sort, limit, slots, ...f }) => {
|
|
61
|
+
const svc = gameOf(await resolveService(service));
|
|
62
|
+
if (!id) {
|
|
63
|
+
const d = await query('matches', { service: svc, ...filters(f), sort, limit: limit || 20, ...range(hours) });
|
|
64
|
+
const brief = d.matches
|
|
65
|
+
.map((m, i) => `${i + 1}. ${m.id}${m.level ? ` on ${m.level}` : ''}: ${m.sessions} players, ${clock(m.duration_s)}, ping p95 ${m.ping_p95 ?? '–'} ms${m.lag_pct != null ? ` (${m.lag_pct}% of play over 150 ms)` : ''}, ${m.disconnects} disconnects${m.server?.tick_p95 != null ? `, server tick p95 ${m.server.tick_p95} ms` : ''}`)
|
|
66
|
+
.join('\n');
|
|
67
|
+
return reply(`${d.total} match(es) in ${svc}${d.sort !== 'recent' ? `, the worst by ${d.sort} first` : ''}:\n${brief || 'None in this window: the game marks a match with setGroup("match", id).'}`, d.matches);
|
|
68
|
+
}
|
|
69
|
+
const d = await query('matches', { service: svc, ...filters(f), id, ...range(hours) });
|
|
70
|
+
if (d.error || !d.match) return reply(`No match ${id} in ${svc} in this window (${hours || 24}h): glitchless_match without id lists them`, {});
|
|
71
|
+
const m = d.match;
|
|
72
|
+
const lobby = new Set(m.lobby_spikes || []);
|
|
73
|
+
const players = m.sessions.map(({ slots: list, ...s }) => ({
|
|
74
|
+
...s,
|
|
75
|
+
lagged_alone_at: list.filter((x) => x.spike && !lobby.has(x.t)).map((x) => x.t),
|
|
76
|
+
frame_p95_worst: Math.max(...list.map((x) => x.frame_p95 ?? 0)) || null,
|
|
77
|
+
hitches: list.reduce((n, x) => n + (x.hitches || 0), 0),
|
|
78
|
+
...(slots ? { slots: list } : {}),
|
|
79
|
+
}));
|
|
80
|
+
const servers = (m.server || []).map((s) => {
|
|
81
|
+
const usual = median(s.slots.map((x) => x.tick_p95));
|
|
82
|
+
const over = s.slots.filter((x) => x.tick_p95 != null && (s.budget_ms != null ? x.tick_p95 > s.budget_ms : usual != null && x.tick_p95 > usual * 1.5));
|
|
83
|
+
return { session_id: s.session_id, budget_ms: s.budget_ms ?? null, tick_p95_usual: usual, players_max: Math.max(0, ...s.slots.map((x) => x.players ?? 0)), slow_slots: over.slice(0, 20), ...(slots ? { slots: s.slots } : {}) };
|
|
84
|
+
});
|
|
85
|
+
const { sessions: _, server: __, events, slots: starts, ...head } = m;
|
|
86
|
+
return reply(`Match ${m.id} in ${svc}: ${m.sessions.length} players on ${m.level ?? 'no level'}, ${clock(m.duration_s)}. ${verdict(m)}`, { ...head, ...(slots ? { slots: starts } : {}), players, servers, events: events.slice(0, 80) });
|
|
87
|
+
},
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
// One table's rows as an agent reads them.
|
|
91
|
+
const netRow = (r) => ({ key: r.key ?? r.value, sessions: r.sessions ?? null, ping_p50: r.ping_p50, ping_p95: r.ping_p95, lag_pct: r.lag_pct, loss_pct: r.loss_pct, disconnects: r.disconnects, disconnects_per_hour: r.disconnects_per_hour, disconnect_pct: r.disconnect_pct, disconnect_reasons: r.disconnect_reasons });
|
|
92
|
+
|
|
93
|
+
tool(
|
|
94
|
+
'glitchless_network',
|
|
95
|
+
"Network quality of a multiplayer game: ping (median and the slowest 5%), lag (the share of connected play with a round trip over 150 ms), packet loss and jitter, and disconnects (per hour played, by reason, and the share of level attempts a disconnect ended: never counted as fails), overall and by level, version, platform and kind of connection (Wi-Fi, mobile data, wired), and by region when the game sets a region property (or by any property given as by). Also the worst matches by ping (glitchless_match opens one), and the network findings: a whole lobby lagging at once (the server), one kind of connection or region lagging (players' connections, or no server near them), disconnects rising in a release. The SDKs read it from the engine's netcode (Netcode for GameObjects, Mirror, Godot's ENet, Unreal's net driver, WebRTC) or the game's netSample calls.",
|
|
96
|
+
{
|
|
97
|
+
...common,
|
|
98
|
+
by: z.string().optional().describe('A session property to split by besides the built-in ones, e.g. "region" (the default when the game sets one) or "$play": each of its values (up to 8) read on its own'),
|
|
99
|
+
},
|
|
100
|
+
async ({ service, hours, by, ...f }) => {
|
|
101
|
+
const svc = gameOf(await resolveService(service));
|
|
102
|
+
const ask = { service: svc, ...filters(f), ...range(hours) };
|
|
103
|
+
const ev = await query('events', ask);
|
|
104
|
+
// A property to split by: the one asked for, else the region where the game sets one (the performance query's
|
|
105
|
+
// by_prop gives its network rows in the same call).
|
|
106
|
+
const key = by ? by.replace(/^\$/, '') : (ev.properties || []).some((p) => p.key === 'region') ? 'region' : null;
|
|
107
|
+
const prop = key && (ev.properties || []).find((p) => p.key === key);
|
|
108
|
+
const [perf, worst, found] = await Promise.all([query('performance', { ...ask, ...(prop && !prop.identifier_like ? { by_prop: key } : {}) }), query('matches', { ...ask, sort: 'lag', limit: 5 }), query('findings', ask)]);
|
|
109
|
+
const net = perf.network;
|
|
110
|
+
if (!net) return reply(`No network data from ${svc} in this window: the SDKs read it from the game's netcode, or the game calls netSample about once a second while connected (the instrument skill says how for each engine)`, {});
|
|
111
|
+
const byProp = net.by_prop ? net.by_prop.rows.map(netRow) : null;
|
|
112
|
+
const k = net.kpis;
|
|
113
|
+
const title = `Network for ${svc} (${hours || 24}h): ping ${k.ping_p50} ms median, ${k.ping_p95} ms for the slowest 5%; ${k.lag_pct ?? 0}% of connected play over 150 ms; ${k.loss_pct ?? 0}% packet loss; ${k.disconnects} disconnects (${k.disconnects_per_hour ?? '–'} per hour played${k.disconnect_pct != null ? `, ${k.disconnect_pct}% of attempts` : ''})`;
|
|
114
|
+
return reply(title, {
|
|
115
|
+
kpis: k,
|
|
116
|
+
by_level: net.by_level.map(netRow),
|
|
117
|
+
by_version: net.by_version.map(netRow),
|
|
118
|
+
by_platform: net.by_platform.map(netRow),
|
|
119
|
+
by_link: net.by_link.map(netRow),
|
|
120
|
+
...(byProp ? { [`by_${key}`]: byProp } : key && !prop ? { note: `No session property ${key} in this window (glitchless_events lists the ones the game sets)` } : {}),
|
|
121
|
+
worst_matches: worst.matches,
|
|
122
|
+
findings: found.findings.filter((x) => x.category === 'network'),
|
|
123
|
+
});
|
|
124
|
+
},
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
tool(
|
|
128
|
+
'glitchless_servers',
|
|
129
|
+
"A multiplayer game's dedicated servers, when they run the Glitchless SDK in server mode (Node glitchless/server, or the Unity, Godot or Unreal server role): servers running now and the players connected to them; tick time against its budget (the slowest 5% of ticks, and the share of windows over budget) by players connected, by map and by version; CPU, memory and networked objects; crashes, each with the matches it ended and the players it dropped; long-running servers whose memory or objects keep climbing; the latest server runs; and the server findings (falling behind when full, a crash that ends matches, a leak). A server's sessions are kept apart from players' under the companion service \"<game>.server\": every other tool reads them with service \"<game>.server\" (glitchless_session for one server run, glitchless_get_error for a server crash's stack). Server sessions count as sessions like any other.",
|
|
130
|
+
{ ...common },
|
|
131
|
+
async ({ service, hours, ...f }) => {
|
|
132
|
+
const svc = gameOf(await resolveService(service));
|
|
133
|
+
const ask = { service: svc, ...filters(f), ...range(hours) };
|
|
134
|
+
const [d, found] = await Promise.all([query('servers', ask), query('findings', ask)]);
|
|
135
|
+
const now = d.servers_now != null ? `${d.servers_now} running now with ${d.players_on_servers} players connected` : null;
|
|
136
|
+
if (!d.kpis) return reply(`${d.why || `No server of ${svc} sent anything in this window.`}${now ? ` (${now})` : ''}`, {});
|
|
137
|
+
const k = d.kpis;
|
|
138
|
+
const title = `Servers of ${svc} (${hours || 24}h): ${k.servers} server runs${now ? `, ${now}` : ''}; tick p95 ${k.tick_p95} ms${k.budget_ms ? ` against a ${k.budget_ms} ms budget (in ${k.over_budget_pct}% of 5-second windows, 5% or more of the ticks went over it)` : ''}; ${k.players ?? 0} players per server on average; ${k.crashed} crashed (${k.crash_free_pct}% crash-free). Their sessions: service "${svc}.server"`;
|
|
139
|
+
return reply(title, {
|
|
140
|
+
servers_now: d.servers_now ?? null,
|
|
141
|
+
players_on_servers: d.players_on_servers ?? null,
|
|
142
|
+
kpis: k,
|
|
143
|
+
by_players: d.by_players,
|
|
144
|
+
by_level: d.by_level,
|
|
145
|
+
by_version: d.by_version,
|
|
146
|
+
crashes: d.crashes.map((c) => ({ ...slimIssue(c), crashed_servers: c.crashed_servers, matches_ended: c.matches_ended, players_dropped: c.players_dropped, breadcrumbs: c.breadcrumbs?.slice(-6) })),
|
|
147
|
+
memory: d.memory,
|
|
148
|
+
climbing: d.climbing,
|
|
149
|
+
recent_runs: d.sessions.slice(0, 15),
|
|
150
|
+
findings: found.findings.filter((x) => x.id.startsWith('server-')),
|
|
151
|
+
});
|
|
152
|
+
},
|
|
153
|
+
);
|
package/src/tools/workspace.js
CHANGED
|
@@ -80,7 +80,7 @@ act(
|
|
|
80
80
|
|
|
81
81
|
act(
|
|
82
82
|
'glitchless_list_share_links',
|
|
83
|
-
"A game's share links: which page each shows, when it expires, and whether it's revoked.",
|
|
83
|
+
"A game's share links: which page each shows, when it expires, when it was last opened (lastUsedAt, to about ten minutes), and whether it's revoked.",
|
|
84
84
|
{},
|
|
85
85
|
async ({ game }) => {
|
|
86
86
|
const pid = await projectFor(game);
|