glitchless-mcp 0.5.0 → 0.7.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 +3 -0
- package/package.json +2 -1
- package/src/context.js +12 -2
- package/src/index.js +1 -0
- package/src/tools/analytics.js +7 -5
- package/src/tools/core.js +14 -13
- package/src/tools/dashboard.js +8 -6
- package/src/tools/revenue.js +40 -0
package/README.md
CHANGED
|
@@ -91,10 +91,13 @@ above go in its environment.
|
|
|
91
91
|
| `glitchless_bug_reports` | Bug reports players sent from inside the game: their notes, levels, positions and sessions, and one report's screenshot when asked |
|
|
92
92
|
| `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 |
|
|
93
93
|
| `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 |
|
|
94
|
+
| `glitchless_revenue` | For a game connected to RevenueCat (Glitchless Cloud): its real revenue (production purchases only) by day, installs (new customers) and active users, MRR, active subscriptions and trials, revenue per player measured, and revenue by version where RevenueCat splits it, next to the sessions, players and new players Glitchless measured and what the game's own purchase events add up to |
|
|
94
95
|
| `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) |
|
|
95
96
|
| `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`) |
|
|
96
97
|
| `glitchless_deck_measure` | Measure a Unity, Godot or Unreal build on the Steam Deck and compare it with a saved run |
|
|
97
98
|
|
|
99
|
+
The reads take `hours`, `version`, `env` (e.g. `prod`) and `session_type` (`user` for players only, `tester` for people on TestFlight and other test builds, `synthetic` for bots, playtests and store test devices, `all`). 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.
|
|
100
|
+
|
|
98
101
|
To let the agent drive the running game as well (measure frame times, inspect the scene, load a
|
|
99
102
|
level), add the WebMCP server beside this one: `npx -y @jason.today/webmcp@latest --mcp`.
|
|
100
103
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glitchless-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"mcpName": "io.github.glitchless-gg/glitchless",
|
|
5
5
|
"description": "Game observability MCP server: lets coding agents (Claude Code, Codex, Cursor and others) read your game's player telemetry and ranked findings, design its own dashboard, and run playtest bots.",
|
|
6
6
|
"keywords": [
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"node": ">=20"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
|
+
"test": "node --test test/*.test.js",
|
|
49
50
|
"bundle": "esbuild src/index.js --bundle --platform=node --format=esm --target=node20 --external:playwright --outfile=../../plugin/glitchless/mcp/glitchless-mcp.mjs --banner:js=\"import { createRequire as __cr } from 'module'; const require = __cr(import.meta.url);\""
|
|
50
51
|
},
|
|
51
52
|
"dependencies": {
|
package/src/context.js
CHANGED
|
@@ -34,10 +34,10 @@ export function useCredentials({ url, token }) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export const server = new McpServer(
|
|
37
|
-
{ name: 'glitchless', version: '0.
|
|
37
|
+
{ name: 'glitchless', version: '0.7.0' },
|
|
38
38
|
{
|
|
39
39
|
instructions:
|
|
40
|
-
'Glitchless is observability for games made with Three.js, Phaser, Babylon.js, PlayCanvas, Unity, Godot, Unreal or GameMaker. 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. 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. 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. 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. 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. 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. Before changing game code, run glitchless_playtest with save_as "baseline"; after the change, run glitchless_playtest again to compare, and treat a FAIL as unfinished work. After shipping a fix (bump the version passed to Glitchless.init), use glitchless_compare_versions to confirm it with real players. If the game is running in a browser with WebMCP connected, its live tools (glitchless_live_performance, glitchless_measure, glitchless_inspect_scene, and game tools such as zoomies_load_level) let you reproduce and measure issues directly. Unity, Godot, Unreal and GameMaker builds measure themselves when run with --glitchless-measure=SECONDS (-glitchless-measure in Unreal and GameMaker); in the Unreal editor, Unreal MCP with the Glitchless Toolset has a Measure tool.',
|
|
40
|
+
'Glitchless is observability for games made with Three.js, Phaser, Babylon.js, PlayCanvas, Unity, Godot, Unreal or GameMaker. 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. 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. 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. 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. 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. For a game connected to RevenueCat, glitchless_revenue reads its real revenue (production purchases only) by day and by version, installs and active users, next to the sessions, players and new players Glitchless measured and what the game\'s own purchase events add up to. 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. Before changing game code, run glitchless_playtest with save_as "baseline"; after the change, run glitchless_playtest again to compare, and treat a FAIL as unfinished work. After shipping a fix (bump the version passed to Glitchless.init), use glitchless_compare_versions to confirm it with real players. If the game is running in a browser with WebMCP connected, its live tools (glitchless_live_performance, glitchless_measure, glitchless_inspect_scene, and game tools such as zoomies_load_level) let you reproduce and measure issues directly. Unity, Godot, Unreal and GameMaker builds measure themselves when run with --glitchless-measure=SECONDS (-glitchless-measure in Unreal and GameMaker); in the Unreal editor, Unreal MCP with the Glitchless Toolset has a Measure tool.',
|
|
41
41
|
},
|
|
42
42
|
);
|
|
43
43
|
|
|
@@ -154,8 +154,18 @@ export const common = {
|
|
|
154
154
|
.describe("Look-back window in hours (default 24). Up to the plan's retention on Glitchless Cloud: 336 (14 days) on Free, 2160 (90 days) on Indie, 9600 (400 days) on Studio. Past 744 (31 days) answers are by day."),
|
|
155
155
|
version: z.string().optional().describe('Only include sessions from this game version'),
|
|
156
156
|
steam_branch: z.string().optional().describe('Only include sessions that ran this Steam branch ("public", or a beta\'s name); games that use Steamworks send it'),
|
|
157
|
+
env: z.string().optional().describe('Only include sessions from this environment, e.g. "prod" (what the game passes to init; builds a developer runs usually send "dev")'),
|
|
158
|
+
session_type: z
|
|
159
|
+
.enum(['user', 'tester', 'synthetic', 'all'])
|
|
160
|
+
.optional()
|
|
161
|
+
.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'),
|
|
157
162
|
};
|
|
158
163
|
|
|
164
|
+
// The filters every read passes on to the Glitchless API.
|
|
165
|
+
export function filters({ version, steam_branch, env, session_type } = {}) {
|
|
166
|
+
return { version, steam_branch, env, type: session_type };
|
|
167
|
+
}
|
|
168
|
+
|
|
159
169
|
// Every tool takes `game` (by name or id): with a workspace key it picks the game, with a game key it's ignored.
|
|
160
170
|
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. Ignored with a key for one game.');
|
|
161
171
|
const register = server.registerTool.bind(server);
|
package/src/index.js
CHANGED
|
@@ -28,6 +28,7 @@ await import('./tools/playtest.js');
|
|
|
28
28
|
await import('./tools/reports.js');
|
|
29
29
|
await import('./tools/deck.js');
|
|
30
30
|
await import('./tools/store-reviews.js');
|
|
31
|
+
await import('./tools/revenue.js');
|
|
31
32
|
await import('./tools/workspace.js');
|
|
32
33
|
|
|
33
34
|
await server.connect(new StdioServerTransport());
|
package/src/tools/analytics.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// The game's own metrics: its custom events and funnels, and versions compared in its own terms.
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { query, resolveService, range, reply, common, tool } from '../context.js';
|
|
3
|
+
import { query, resolveService, range, reply, common, tool, filters } from '../context.js';
|
|
4
4
|
|
|
5
5
|
tool(
|
|
6
6
|
'glitchless_events',
|
|
@@ -10,9 +10,9 @@ tool(
|
|
|
10
10
|
name: z.string().optional().describe('Only this event, e.g. "paywall"'),
|
|
11
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"'),
|
|
12
12
|
},
|
|
13
|
-
async ({ service, hours,
|
|
13
|
+
async ({ service, hours, name, funnel, ...f }) => {
|
|
14
14
|
const svc = await resolveService(service);
|
|
15
|
-
const d = await query('events', { service: svc,
|
|
15
|
+
const d = await query('events', { service: svc, ...filters(f), name, funnel, ...range(hours) });
|
|
16
16
|
const brief = d.events
|
|
17
17
|
.slice(0, 15)
|
|
18
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(', ')}` : ''}`)
|
|
@@ -30,14 +30,16 @@ tool(
|
|
|
30
30
|
{
|
|
31
31
|
service: common.service,
|
|
32
32
|
hours: common.hours,
|
|
33
|
+
env: common.env,
|
|
34
|
+
session_type: common.session_type,
|
|
33
35
|
a: z.string().optional().describe('Baseline version, branch or build (default: second newest)'),
|
|
34
36
|
b: z.string().optional().describe('New version, branch or build (default: newest)'),
|
|
35
37
|
by: z.enum(['version', 'steam_branch', 'steam_build']).optional().describe('What to compare (default version). steam_branch and steam_build need a game that uses Steamworks'),
|
|
36
38
|
},
|
|
37
|
-
async ({ service, hours, a, b, by }) => {
|
|
39
|
+
async ({ service, hours, a, b, by, env, session_type }) => {
|
|
38
40
|
const svc = await resolveService(service);
|
|
39
41
|
const steam = by && by !== 'version' ? by : null;
|
|
40
|
-
const { versions, has = {}, board = [] } = await query('versions', { service: svc, ...(steam ? { by: steam } : {}), ...range(hours || 72) });
|
|
42
|
+
const { versions, has = {}, board = [] } = await query('versions', { service: svc, ...filters({ env, session_type }), ...(steam ? { by: steam } : {}), ...range(hours || 72) });
|
|
41
43
|
const what = steam === 'steam_branch' ? 'Steam branch' : steam === 'steam_build' ? 'Steam build' : 'version';
|
|
42
44
|
if (steam && !versions.length) return reply(`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);
|
|
43
45
|
if (versions.length < 2 && !(a && b)) return reply(`Only one ${what} of ${svc} has reported in this window`, versions);
|
package/src/tools/core.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The built-in reads: which games report, findings, headline numbers, frame time, errors, levels,
|
|
2
2
|
// death hotspots and one session in detail.
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { BASE, query, resolveService, range, reply, common, tool, slimIssue, slimGroup, isWorkspace, workspaceGames } from '../context.js';
|
|
4
|
+
import { BASE, query, resolveService, range, reply, common, tool, slimIssue, slimGroup, filters, isWorkspace, workspaceGames } from '../context.js';
|
|
5
5
|
|
|
6
6
|
tool('glitchless_list_games', 'List the games: with a workspace key, every game in the workspace (its id, name, client token and the services reporting to it); with a key for one game, its services, versions, environments and when they were last seen.', {}, async () => {
|
|
7
7
|
if (isWorkspace()) {
|
|
@@ -16,17 +16,18 @@ tool(
|
|
|
16
16
|
'glitchless_triage',
|
|
17
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 and version regressions — ranked by severity and player impact, each with evidence and a suggested fix. Start here when asked 'what's wrong with my game?'.",
|
|
18
18
|
{ ...common },
|
|
19
|
-
async ({ service, hours,
|
|
19
|
+
async ({ service, hours, ...f }) => {
|
|
20
20
|
const svc = await resolveService(service);
|
|
21
|
-
const {
|
|
21
|
+
const { version } = f;
|
|
22
|
+
const { findings, meta } = await query('findings', { service: svc, ...filters(f), ...range(hours) });
|
|
22
23
|
const brief = findings.map((f, i) => `${i + 1}. [${f.severity.toUpperCase()}] ${f.title}`).join('\n');
|
|
23
24
|
return reply(`Findings for ${svc} (${hours || 24}h${version ? `, ${version}` : ''}):\n${brief || 'Nothing unusual.'}\n\nFull findings with evidence (window ${new Date(meta?.from).toISOString()} → now):`, findings);
|
|
24
25
|
},
|
|
25
26
|
);
|
|
26
27
|
|
|
27
|
-
tool('glitchless_overview', 'Headline KPIs for a game: sessions, players, crash-free and error-free sessions, frame-time p50/p95/p99 vs budget, hitches per minute, rage quits, top errors and the level funnel.', { ...common }, async ({ service, hours,
|
|
28
|
+
tool('glitchless_overview', 'Headline KPIs for a game: sessions, players, crash-free and error-free sessions, frame-time p50/p95/p99 vs budget, hitches per minute, rage quits, top errors and the level funnel.', { ...common }, async ({ service, hours, ...f }) => {
|
|
28
29
|
const svc = await resolveService(service);
|
|
29
|
-
const d = await query('overview', { service: svc,
|
|
30
|
+
const d = await query('overview', { service: svc, ...filters(f), ...range(hours) });
|
|
30
31
|
return reply(`Overview for ${svc}`, { kpis: d.kpis, deployments: d.deployments, top_errors: d.top_errors.map(slimIssue), funnel: d.funnel });
|
|
31
32
|
});
|
|
32
33
|
|
|
@@ -34,9 +35,9 @@ tool(
|
|
|
34
35
|
'glitchless_performance',
|
|
35
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.',
|
|
36
37
|
{ ...common, level: z.string().optional().describe('Focus on one level id, e.g. "level-2"') },
|
|
37
|
-
async ({ service, hours,
|
|
38
|
+
async ({ service, hours, level, ...f }) => {
|
|
38
39
|
const svc = await resolveService(service);
|
|
39
|
-
const d = await query('performance', { service: svc,
|
|
40
|
+
const d = await query('performance', { service: svc, ...filters(f), ...range(hours) });
|
|
40
41
|
const hitches = (level ? d.hitches.filter((h) => h.level === level) : d.hitches).slice(0, 12);
|
|
41
42
|
return reply(`Frame performance for ${svc}${level ? ` (${level})` : ''}`, {
|
|
42
43
|
kpis: d.kpis,
|
|
@@ -57,9 +58,9 @@ tool(
|
|
|
57
58
|
'glitchless_get_error',
|
|
58
59
|
'Error Tracking for a game. Without a fingerprint: the list of error issues ranked by sessions affected. With a fingerprint: the full issue — message, location, stack trace, affected levels/versions, occurrence counts and breadcrumbs (the game events right before it fired). For a minified web build whose source maps were uploaded (glitchless-sourcemaps), location and stack are the original ones, `frames` gives each frame with its line of code, and `minified` what the browser reported.',
|
|
59
60
|
{ ...common, fingerprint: z.string().optional().describe('Issue fingerprint from the list or from glitchless_triage') },
|
|
60
|
-
async ({ service, hours,
|
|
61
|
+
async ({ service, hours, fingerprint, ...f }) => {
|
|
61
62
|
const svc = await resolveService(service);
|
|
62
|
-
const { issues } = await query('errors', { service: svc,
|
|
63
|
+
const { issues } = await query('errors', { service: svc, ...filters(f), ...range(hours) });
|
|
63
64
|
if (!fingerprint) return reply(`${issues.length} error issue(s) in ${svc}`, issues.map(slimIssue));
|
|
64
65
|
const issue = issues.find((i) => i.fingerprint === fingerprint || i.fingerprint?.startsWith(fingerprint));
|
|
65
66
|
if (!issue) return reply(`No issue ${fingerprint} in ${svc} in this window. Known issues:`, issues.map(slimIssue));
|
|
@@ -68,9 +69,9 @@ tool(
|
|
|
68
69
|
},
|
|
69
70
|
);
|
|
70
71
|
|
|
71
|
-
tool('glitchless_player_funnel', 'Player experience per level: sessions that started vs completed each level, attempts, deaths per session and their causes, average clear time, rage quits (quit ≤20s after dying), session length distribution and recent rage quits with positions. 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). Retention needs player IDs: status "anonymous" means the game sends none, and privacy "install" in the SDK turns them on.', { ...common }, async ({ service, hours,
|
|
72
|
+
tool('glitchless_player_funnel', 'Player experience per level: sessions that started vs completed each level, attempts, deaths per session and their causes, average clear time, rage quits (quit ≤20s after dying), session length distribution and recent rage quits with positions. 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). Retention needs player IDs: status "anonymous" means the game sends none, and privacy "install" in the SDK turns them on.', { ...common }, async ({ service, hours, ...f }) => {
|
|
72
73
|
const svc = await resolveService(service);
|
|
73
|
-
const d = await query('players', { service: svc,
|
|
74
|
+
const d = await query('players', { service: svc, ...filters(f), ...range(hours) });
|
|
74
75
|
return reply(`Player funnel for ${svc}`, { kpis: d.kpis, funnel: d.funnel, session_length: d.session_length, recent_rage_quits: d.rage_quits.slice(0, 15), retention: d.retention });
|
|
75
76
|
});
|
|
76
77
|
|
|
@@ -78,9 +79,9 @@ tool(
|
|
|
78
79
|
'glitchless_death_hotspots',
|
|
79
80
|
'Where players die on a level: clustered death positions in world coordinates (x range, share of the level’s deaths, top cause, rage quits at that spot), plus the level bounds and completion stats. Use it to find difficulty spikes, then look up the level data around those coordinates.',
|
|
80
81
|
{ ...common, level: z.string().describe('Level id, e.g. "level-3"') },
|
|
81
|
-
async ({ service, hours,
|
|
82
|
+
async ({ service, hours, level, ...f }) => {
|
|
82
83
|
const svc = await resolveService(service);
|
|
83
|
-
const d = await query('heatmap', { service: svc,
|
|
84
|
+
const d = await query('heatmap', { service: svc, ...filters(f), level, ...range(hours) });
|
|
84
85
|
return reply(`Death hotspots on ${level} in ${svc}`, { level: d.level, axis: d.axis, bounds: d.bounds, hotspots: d.hotspots, level_stats: d.stats, total_deaths: d.deaths?.length ?? 0, position_samples: d.density?.samples ?? 0 });
|
|
85
86
|
},
|
|
86
87
|
);
|
package/src/tools/dashboard.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// The game's own dashboard: read its pages and one board's numbers, and save a new design.
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { server, query, write, resolveService, range, reply, fail, common, tool } from '../context.js';
|
|
3
|
+
import { server, query, write, resolveService, range, reply, fail, common, tool, filters } from '../context.js';
|
|
4
4
|
|
|
5
5
|
tool(
|
|
6
6
|
'glitchless_dashboard',
|
|
7
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.",
|
|
8
8
|
{ ...common, page: z.string().optional().describe('Id of the board page to evaluate (default: the first board)') },
|
|
9
|
-
async ({ service, hours,
|
|
9
|
+
async ({ service, hours, page, ...f }) => {
|
|
10
10
|
const svc = await resolveService(service);
|
|
11
|
-
const { dashboard } = await query('dashboard', { service: svc,
|
|
11
|
+
const { dashboard } = await query('dashboard', { service: svc, ...filters(f), ...range(hours) });
|
|
12
12
|
if (!dashboard) return reply(`${svc} has sent no data yet`, {});
|
|
13
|
-
const b = await query('board', { service: svc,
|
|
13
|
+
const b = await query('board', { service: svc, ...filters(f), page, ...range(hours) });
|
|
14
14
|
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 }) }));
|
|
15
15
|
// A positions panel can hold thousands of bins: its busiest ten say where players die.
|
|
16
16
|
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);
|
|
@@ -47,12 +47,14 @@ const STORE_PANELS = {
|
|
|
47
47
|
store_vitals: "the store's own vitals by version (Google Play: slow rendering, crashes, ANRs; the App Store: hangs, launch, hitches) next to what Glitchless measured, with where they disagree",
|
|
48
48
|
store_players: 'players online next to the sessions measured: telemetry coverage',
|
|
49
49
|
store_sales: 'units, returns and wishlists by day; on Steam needs the Financial API key',
|
|
50
|
+
store_revenue: "real revenue from RevenueCat (store revenuecat; give measure): revenue in the window, revenue per player measured, installs (RevenueCat's new customers) next to Glitchless's new players, active users a day, MRR, active subscriptions, active trials, revenue per day next to the game's own purchase events, installs and active users per day, or revenue by version next to what Glitchless measured",
|
|
50
51
|
};
|
|
51
52
|
const withStores = (panel) =>
|
|
52
53
|
panel
|
|
53
54
|
.extend({
|
|
54
55
|
type: z.enum([...panel.shape.type.options, ...Object.keys(STORE_PANELS)]).describe(`${panel.shape.type.description} For a game connected to a store (Steam; give store): ${Object.entries(STORE_PANELS).map(([t, d]) => `${t} (${d})`).join(', ')}`),
|
|
55
|
-
store: z.enum(['steam', 'app_store', 'google_play']).optional().describe("store_reviews, store_players, store_sales: the store (default: the game's first connected one)"),
|
|
56
|
+
store: z.enum(['steam', 'app_store', 'google_play', 'revenuecat']).optional().describe("store_reviews, store_players, store_sales, store_vitals: the store (default: the game's first connected one); store_revenue: revenuecat"),
|
|
57
|
+
measure: z.enum(['revenue', 'per_player', 'installs', 'active_users', 'mrr', 'actives', 'trials', 'by_day', 'players_by_day', 'by_version']).optional().describe('store_revenue (required): revenue (in the window), per_player (over the players Glitchless measured), installs (new customers, next to Glitchless\'s new players), active_users (a day), mrr, actives (active subscriptions), trials (active trials), by_day (revenue), players_by_day (installs and active users), by_version'),
|
|
56
58
|
})
|
|
57
59
|
.describe('One panel');
|
|
58
60
|
|
|
@@ -60,7 +62,7 @@ const pageSchema = z
|
|
|
60
62
|
.object({
|
|
61
63
|
id: z.string().optional().describe('Short id used in the page address, e.g. "money" (default: from the title)'),
|
|
62
64
|
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)'),
|
|
63
|
-
icon: z.enum(['board', 'overview', 'events', 'perf', 'errors', 'players', 'heatmap', 'sessions', 'versions', 'live', 'flag', 'bolt', 'play', 'clock', 'bug']).optional(),
|
|
65
|
+
icon: z.enum(['board', 'overview', 'events', 'perf', 'errors', 'players', 'heatmap', 'sessions', 'versions', 'live', 'flag', 'bolt', 'play', 'clock', 'bug', 'money']).optional(),
|
|
64
66
|
panels: z.array(withStores(panelSchema)).optional().describe('A board: its panels, in order'),
|
|
65
67
|
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)'),
|
|
66
68
|
options: z.object({ events: z.array(z.string()).optional() }).optional().describe('live view: events, only these event names or types'),
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// A game's real revenue from RevenueCat (Glitchless Cloud: Settings → Integrations → RevenueCat), by day and by app
|
|
2
|
+
// version where RevenueCat splits it, next to the sessions and players Glitchless measured and what the game's own
|
|
3
|
+
// purchase events add up to.
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { query, resolveService, range, reply, common, filters, tool } from '../context.js';
|
|
6
|
+
|
|
7
|
+
tool(
|
|
8
|
+
'glitchless_revenue',
|
|
9
|
+
"The game's real revenue, installs and active users as RevenueCat counts them, for a game connected to RevenueCat in Glitchless Cloud (Settings → Integrations). RevenueCat counts production purchases only, never sandbox, TestFlight or licence-tester ones. It gives, for the window, revenue and transactions by UTC day, MRR, active subscriptions and trials, and revenue per player Glitchless measured. It also gives installs (RevenueCat's new customers: the first time its SDK starts on a device) next to the new players Glitchless saw, and active users a day next to Glitchless's players a day. Where RevenueCat splits revenue by the app version purchases were made on, it gives revenue by version too. Each day sits next to its sessions and players, and each version next to its players, crash-free sessions and frame-time p95. It also says what the game's own purchase events (track('purchase', { amount, currency })) add up to and how much of RevenueCat's revenue that is: the gap is purchases that never reach Glitchless. Use it for money questions, e.g. whether 1.4.2 earns more per player than 1.4.1. Use glitchless_events for purchases by item, level or player.",
|
|
10
|
+
{
|
|
11
|
+
service: common.service,
|
|
12
|
+
hours: z.number().min(24).max(9600).optional().describe('Look-back window in hours (default 720, 30 days), read as whole UTC days'),
|
|
13
|
+
version: z.string().optional().describe("Only this version: its revenue (where RevenueCat splits revenue by version) over its players. MRR, subscriptions and trials stay the whole game's"),
|
|
14
|
+
env: common.env,
|
|
15
|
+
session_type: common.session_type,
|
|
16
|
+
},
|
|
17
|
+
async ({ service, hours, version, env, session_type }) => {
|
|
18
|
+
const svc = await resolveService(service);
|
|
19
|
+
const r = await query('store_revenue', { service: svc, ...filters({ version, env, session_type }), ...range(hours || 720) });
|
|
20
|
+
if (r.connected === false) return reply(`${svc}: ${r.why}`, {});
|
|
21
|
+
if (r.empty) return reply(`${r.store_name} revenue of ${svc}: ${r.why}`, { overview: r.overview?.metrics ?? null });
|
|
22
|
+
const money = (v) => (v == null ? '–' : r.currency ? new Intl.NumberFormat('en-US', { style: 'currency', currency: r.currency }).format(v) : String(v));
|
|
23
|
+
const n = (v) => (v == null ? '–' : v.toLocaleString('en-US'));
|
|
24
|
+
const t = r.totals;
|
|
25
|
+
const stock = (x, label, isMoney = false) => (x ? `${isMoney ? money(x.value) : n(x.value)} ${label}${x.change != null ? ` (${x.change >= 0 ? '+' : '−'}${isMoney ? money(Math.abs(x.change)) : n(Math.abs(x.change))} since ${x.since})` : ''}` : null);
|
|
26
|
+
const g = r.glitchless;
|
|
27
|
+
const lines = [
|
|
28
|
+
`${r.store_name} revenue of ${svc} (project ${r.app_id}), ${r.from_day} to ${r.to_day} (UTC days)${r.version ? `, version ${r.version}` : ''}: ${money(t.revenue)}${t.transactions != null ? ` from ${n(t.transactions)} transactions` : ''}${t.incomplete ? ' (today so far included)' : ''}.`,
|
|
29
|
+
r.per_player != null ? `Revenue per player: ${money(r.per_player)} over ${n(r.players)} ${r.players_are_sessions ? 'sessions (no player IDs)' : 'players'} Glitchless measured (${n(r.sessions)} sessions).` : `Glitchless measured no players in this window.`,
|
|
30
|
+
`Installs (${r.store_name}'s new customers): ${n(t.installs)}${r.new_players != null ? `; Glitchless saw ${n(r.new_players)} new players (${r.new_players_pct ?? '–'}%)` : '; Glitchless counts new players only with player IDs'}. Active users: ${t.active_users_per_day != null ? `${n(t.active_users_per_day)} a day` : '–'}${r.players_per_day != null ? `; Glitchless measured ${n(r.players_per_day)} players a day` : ''}.`,
|
|
31
|
+
`Now: ${[stock(r.latest.mrr, 'MRR', true), stock(r.latest.actives, 'active subscriptions'), stock(r.latest.trials, 'active trials')].filter(Boolean).join(', ') || 'no MRR, subscriptions or trials yet'}.`,
|
|
32
|
+
g ? `The game's own purchase events: ${g.comparable ? money(g.purchases) : `${g.purchases} ${g.currency ?? ''}`.trim()} from ${n(g.events)} events${g.coverage_pct != null ? ` (${g.coverage_pct}% of ${r.store_name}'s)` : ''}${g.sandbox ? `; ${n(g.sandbox)} sandbox purchases left out` : ''}.` : 'The game sends no purchase events with an amount.',
|
|
33
|
+
r.versions?.length
|
|
34
|
+
? `By version:\n${r.versions.map((v) => `- ${v.version}: ${money(v.revenue)} (${v.share_pct}%), ${n(v.transactions)} transactions; ${v.players != null ? `${n(v.players)} players, ${money(v.per_player)} per player, crash-free ${v.crash_free_pct ?? '–'}%, frame p95 ${v.frame_p95 ?? '–'}ms` : 'no sessions of it in the window'}${v.purchases != null ? `; purchase events ${money(v.purchases)}` : ''}`).join('\n')}`
|
|
35
|
+
: `By version: ${r.versions_why ?? 'none in this window'}`,
|
|
36
|
+
...(r.notes?.length ? [`Notes:\n${r.notes.map((x) => `- ${x}`).join('\n')}`] : []),
|
|
37
|
+
];
|
|
38
|
+
return reply(lines.join('\n'), { days: r.days, versions: r.versions, overview: r.overview?.metrics ?? null });
|
|
39
|
+
},
|
|
40
|
+
);
|