@gameslate/sdk 0.3.10 → 0.3.12
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/bin/gameslate-plugin.mjs +65 -0
- package/build/verify-effects.mjs +18 -2
- package/lib/game-support-yaml.d.ts +5 -0
- package/lib/game-support-yaml.js +124 -0
- package/lib/game-support.d.ts +400 -0
- package/lib/game-support.js +306 -0
- package/lib/host/addresses.d.ts +47 -0
- package/lib/host/addresses.js +79 -3
- package/lib/host/game-support.d.ts +27 -0
- package/lib/host/game-support.js +101 -0
- package/lib/host/index.d.ts +2 -0
- package/lib/host/index.js +2 -0
- package/lib/host/live-sandbox.d.ts +1 -0
- package/lib/host/live-sandbox.js +19 -0
- package/lib/host/udp-ports.d.ts +4 -0
- package/lib/host/udp-ports.js +26 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/pack.d.ts +15 -0
- package/lib/pack.js +14 -1
- package/lib/plugin/contract.d.ts +5 -0
- package/lib/plugin/sandbox-guest.js +3 -0
- package/lib/sandbox-protocol.d.ts +21 -0
- package/package.json +1 -1
- package/template/claude/skills/build-gameslate-plugin/SKILL.md +330 -9
- package/template/claude/skills/verify-gameslate-plugin/SKILL.md +76 -3
- package/template/{test → plugin}/live.test.ts +1 -1
- package/template/tsconfig.json +1 -1
package/README.md
CHANGED
|
@@ -61,6 +61,9 @@ validates it and writes every file.
|
|
|
61
61
|
|
|
62
62
|
`0.3.x` speaks plugin contract (`sdkApi`) 3: new 0.3 versions add tools, never change the contract. The core refuses a plugin built for another contract.
|
|
63
63
|
|
|
64
|
+
- **Next** (not yet published): `gameslate-plugin addresses` takes `statics`, file-static
|
|
65
|
+
variables placed at their object's section base in the ld map plus the offset their accessor
|
|
66
|
+
shows (IDO keeps statics out of the map), each with its `evidence`.
|
|
64
67
|
- **0.3.9** (not yet published): `gameslate-plugin addresses` takes `expectSizes` and fails
|
|
65
68
|
when the probe disagrees with a size the decomp states. `verify.json`'s `expect` also checks the inventory (`has`,
|
|
66
69
|
`lacks`, `exactly`), the equipped item (`null` for nothing) and flags; a flag the state doesn't
|
package/bin/gameslate-plugin.mjs
CHANGED
|
@@ -19,6 +19,8 @@ import { initPlugin } from '../build/init-plugin.mjs';
|
|
|
19
19
|
* gameslate-plugin addresses <spec.json> [--out <file.ts>]
|
|
20
20
|
* A game's address table from its decompilation: symbols from its maps, struct offsets,
|
|
21
21
|
* sizes and constants from a clang probe against its headers (src/host/addresses.ts).
|
|
22
|
+
* gameslate-plugin names <map or symbol file> …
|
|
23
|
+
* Triage before writing a reader: how many symbols name the game, and its named globals.
|
|
22
24
|
*/
|
|
23
25
|
const { values, positionals } = parseArgs({
|
|
24
26
|
options: {
|
|
@@ -27,6 +29,9 @@ const { values, positionals } = parseArgs({
|
|
|
27
29
|
'core-version': { type: 'string' },
|
|
28
30
|
id: { type: 'string' },
|
|
29
31
|
name: { type: 'string' },
|
|
32
|
+
readme: { type: 'string' },
|
|
33
|
+
built: { type: 'string' },
|
|
34
|
+
write: { type: 'boolean' },
|
|
30
35
|
},
|
|
31
36
|
allowPositionals: true,
|
|
32
37
|
});
|
|
@@ -37,6 +42,8 @@ const USAGE = [
|
|
|
37
42
|
' gameslate-plugin validate <builtDir> [--core-version <version>]',
|
|
38
43
|
' gameslate-plugin verify <verify.json>',
|
|
39
44
|
' gameslate-plugin addresses <spec.json> [--out <file.ts>]',
|
|
45
|
+
' gameslate-plugin support <gamesDir> [--readme README.md] [--built <builtDir>] [--write]',
|
|
46
|
+
' gameslate-plugin names <map or symbol file> … does the decomp name the game? (triage)',
|
|
40
47
|
].join('\n');
|
|
41
48
|
|
|
42
49
|
async function validate(builtDir) {
|
|
@@ -151,6 +158,64 @@ if (command === 'build' && dir && values.out) {
|
|
|
151
158
|
const text = addressModule(table, provenance);
|
|
152
159
|
if (values.out) fs.writeFileSync(path.resolve(values.out), text);
|
|
153
160
|
else process.stdout.write(text);
|
|
161
|
+
} else if (command === 'support' && dir) {
|
|
162
|
+
const {
|
|
163
|
+
inspectPlugin,
|
|
164
|
+
loadQuickJs,
|
|
165
|
+
readPluginManifest,
|
|
166
|
+
supportContextsFromPlugin,
|
|
167
|
+
verifyOrWriteSupportDocs,
|
|
168
|
+
} = await import('../lib/host/index.js');
|
|
169
|
+
const gamesDir = path.resolve(dir);
|
|
170
|
+
const topReadmePath = path.resolve(values.readme ?? 'README.md');
|
|
171
|
+
let expectedGameIds;
|
|
172
|
+
let codeByGame;
|
|
173
|
+
if (values.built) {
|
|
174
|
+
const builtDir = path.resolve(values.built);
|
|
175
|
+
const read = readPluginManifest(builtDir);
|
|
176
|
+
if ('problem' in read) {
|
|
177
|
+
console.error(`refused: ${read.problem}`);
|
|
178
|
+
process.exit(1);
|
|
179
|
+
}
|
|
180
|
+
expectedGameIds = read.manifest.games.map(g => g.id);
|
|
181
|
+
const coreVersion = values['core-version'] ?? read.manifest.testedWith[0] ?? '0.0.0';
|
|
182
|
+
const inspected = inspectPlugin(await loadQuickJs(), builtDir, read.manifest, {
|
|
183
|
+
coreVersion,
|
|
184
|
+
log: line => console.error(line),
|
|
185
|
+
});
|
|
186
|
+
if (typeof inspected === 'string') {
|
|
187
|
+
console.error(`refused: ${inspected}`);
|
|
188
|
+
process.exit(1);
|
|
189
|
+
}
|
|
190
|
+
codeByGame = supportContextsFromPlugin(inspected);
|
|
191
|
+
}
|
|
192
|
+
const { entries, problems } = verifyOrWriteSupportDocs({
|
|
193
|
+
gamesDir,
|
|
194
|
+
topReadmePath,
|
|
195
|
+
expectedGameIds,
|
|
196
|
+
codeByGame,
|
|
197
|
+
write: Boolean(values.write),
|
|
198
|
+
});
|
|
199
|
+
for (const p of problems) console.error(`refused: ${p}`);
|
|
200
|
+
if (problems.length === 0) {
|
|
201
|
+
console.log(
|
|
202
|
+
`support docs OK (${entries.length} games -> ${path.relative(process.cwd(), topReadmePath) || path.basename(topReadmePath)})`,
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
process.exit(problems.length ? 1 : 0);
|
|
206
|
+
} else if (command === 'names' && dir) {
|
|
207
|
+
const { parseSymbolFile, triageNames } = await import('../lib/host/index.js');
|
|
208
|
+
const symbols = new Map(
|
|
209
|
+
positionals.slice(1).flatMap(f => [...parseSymbolFile(fs.readFileSync(f, 'utf8'))]),
|
|
210
|
+
);
|
|
211
|
+
const { placeholders, library, game } = triageNames(symbols);
|
|
212
|
+
console.log(
|
|
213
|
+
`${symbols.size} symbols: ${game.length} name the game, ${placeholders} placeholders (func_/D_), ${library} library`,
|
|
214
|
+
);
|
|
215
|
+
const globals = game.filter(n => /^g[A-Z_]/.test(n));
|
|
216
|
+
console.log(`globals (g…): ${globals.length ? globals.slice(0, 60).join(' ') : 'none'}`);
|
|
217
|
+
if (globals.length === 0)
|
|
218
|
+
console.log("No named globals: read the skill's first pitfall before writing a reader.");
|
|
154
219
|
} else {
|
|
155
220
|
console.error(USAGE);
|
|
156
221
|
process.exit(1);
|
package/build/verify-effects.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { execFile, spawn } from 'node:child_process';
|
|
|
2
2
|
import dgram from 'node:dgram';
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import path from 'node:path';
|
|
5
|
+
import { firstBusyUdpPort, RETROARCH_UDP_PORTS } from '../lib/host/index.js';
|
|
5
6
|
|
|
6
7
|
/*
|
|
7
8
|
* The real effects of `gameslate-plugin verify` (src/host/verify.ts has the steps and their
|
|
@@ -17,8 +18,10 @@ const COMMAND_TIMEOUT_MS = 2000;
|
|
|
17
18
|
export function verifyEffects(specDir, log = line => console.error(line)) {
|
|
18
19
|
const at = p => path.resolve(specDir, p);
|
|
19
20
|
return {
|
|
20
|
-
launch: spec =>
|
|
21
|
-
|
|
21
|
+
launch: async spec => {
|
|
22
|
+
await refuseBusyRetroArchPorts(spec);
|
|
23
|
+
return spec.emulator ? launchEmulator(spec, at, log) : launchRetroArch(spec, at, log);
|
|
24
|
+
},
|
|
22
25
|
drive: (spec, args) => drive(spec, at, args),
|
|
23
26
|
wait: ms => new Promise(resolve => setTimeout(resolve, ms)),
|
|
24
27
|
state: spec => nextState(spec),
|
|
@@ -27,6 +30,19 @@ export function verifyEffects(specDir, log = line => console.error(line)) {
|
|
|
27
30
|
};
|
|
28
31
|
}
|
|
29
32
|
|
|
33
|
+
/* A RetroArch run needs its UDP ports to itself: another RetroArch still holding them would take
|
|
34
|
+
* the route's presses and commands (udp-ports.ts). */
|
|
35
|
+
async function refuseBusyRetroArchPorts(spec) {
|
|
36
|
+
const usesRetroArch = !spec.emulator || /retroarch/i.test(spec.emulator.command.join(' '));
|
|
37
|
+
if (!usesRetroArch) return;
|
|
38
|
+
const busy = await firstBusyUdpPort(RETROARCH_UDP_PORTS);
|
|
39
|
+
if (busy !== null) {
|
|
40
|
+
throw new Error(
|
|
41
|
+
`UDP port ${busy} is in use (another RetroArch running?): close it before verifying`,
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
30
46
|
/* a started process, once it has run STARTUP_MS without exiting */
|
|
31
47
|
function started(child, stop) {
|
|
32
48
|
return new Promise((resolve, reject) => {
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Minimal strict YAML parser for `<game>/README.md` support frontmatter: nested mappings,
|
|
3
|
+
* scalars (`true`/`false`/strings), inline `[a, b]` arrays, and `- key: val` object lists.
|
|
4
|
+
*/
|
|
5
|
+
function stripComment(raw) {
|
|
6
|
+
let inSingle = false;
|
|
7
|
+
let inDouble = false;
|
|
8
|
+
for (let i = 0; i < raw.length; i++) {
|
|
9
|
+
const ch = raw[i];
|
|
10
|
+
if (ch === "'" && !inDouble)
|
|
11
|
+
inSingle = !inSingle;
|
|
12
|
+
else if (ch === '"' && !inSingle)
|
|
13
|
+
inDouble = !inDouble;
|
|
14
|
+
else if (ch === '#' && !inSingle && !inDouble && (i === 0 || raw[i - 1] === ' ')) {
|
|
15
|
+
return raw.slice(0, i).trimEnd();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return raw.trimEnd();
|
|
19
|
+
}
|
|
20
|
+
function parseScalar(raw) {
|
|
21
|
+
const s = raw.trim();
|
|
22
|
+
if (s === 'true')
|
|
23
|
+
return true;
|
|
24
|
+
if (s === 'false')
|
|
25
|
+
return false;
|
|
26
|
+
if ((s.startsWith('"') && s.endsWith('"')) || (s.startsWith("'") && s.endsWith("'"))) {
|
|
27
|
+
return s.slice(1, -1);
|
|
28
|
+
}
|
|
29
|
+
return s;
|
|
30
|
+
}
|
|
31
|
+
function parseInlineArray(raw) {
|
|
32
|
+
const inner = raw.slice(1, -1).trim();
|
|
33
|
+
if (!inner)
|
|
34
|
+
return [];
|
|
35
|
+
return inner.split(',').map(part => parseScalar(part));
|
|
36
|
+
}
|
|
37
|
+
function tokenizeYaml(yamlText) {
|
|
38
|
+
const out = [];
|
|
39
|
+
const rawLines = yamlText.split(/\r?\n/);
|
|
40
|
+
rawLines.forEach((raw, idx) => {
|
|
41
|
+
if (raw.includes('\t'))
|
|
42
|
+
throw new Error(`YAML line ${idx + 1}: tabs are not allowed`);
|
|
43
|
+
const cleaned = stripComment(raw);
|
|
44
|
+
if (!cleaned.trim())
|
|
45
|
+
return;
|
|
46
|
+
const indent = cleaned.length - cleaned.trimStart().length;
|
|
47
|
+
out.push({ num: idx + 1, indent, text: cleaned.trim() });
|
|
48
|
+
});
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
function parseSequenceOfObjects(lines, start, baseIndent) {
|
|
52
|
+
const items = [];
|
|
53
|
+
let i = start;
|
|
54
|
+
while (i < lines.length) {
|
|
55
|
+
const line = lines[i];
|
|
56
|
+
if (!line || line.indent < baseIndent || !line.text.startsWith('- '))
|
|
57
|
+
break;
|
|
58
|
+
if (line.indent !== baseIndent)
|
|
59
|
+
throw new Error(`YAML line ${line.num}: unexpected list indentation`);
|
|
60
|
+
const obj = {};
|
|
61
|
+
const firstRest = line.text.slice(2).trim();
|
|
62
|
+
const colon = firstRest.indexOf(':');
|
|
63
|
+
if (colon <= 0)
|
|
64
|
+
throw new Error(`YAML line ${line.num}: expected "- key: value"`);
|
|
65
|
+
obj[firstRest.slice(0, colon).trim()] = parseScalar(firstRest.slice(colon + 1));
|
|
66
|
+
i++;
|
|
67
|
+
while (i < lines.length) {
|
|
68
|
+
const sub = lines[i];
|
|
69
|
+
if (!sub || sub.indent <= baseIndent)
|
|
70
|
+
break;
|
|
71
|
+
const sc = sub.text.indexOf(':');
|
|
72
|
+
if (sc <= 0)
|
|
73
|
+
throw new Error(`YAML line ${sub.num}: expected "key: value"`);
|
|
74
|
+
obj[sub.text.slice(0, sc).trim()] = parseScalar(sub.text.slice(sc + 1));
|
|
75
|
+
i++;
|
|
76
|
+
}
|
|
77
|
+
items.push(obj);
|
|
78
|
+
}
|
|
79
|
+
return { value: items, next: i };
|
|
80
|
+
}
|
|
81
|
+
function parseMapping(lines, start, baseIndent) {
|
|
82
|
+
const map = {};
|
|
83
|
+
let i = start;
|
|
84
|
+
while (i < lines.length) {
|
|
85
|
+
const line = lines[i];
|
|
86
|
+
if (!line || line.indent < baseIndent)
|
|
87
|
+
break;
|
|
88
|
+
if (line.indent !== baseIndent)
|
|
89
|
+
throw new Error(`YAML line ${line.num}: unexpected indentation`);
|
|
90
|
+
const colon = line.text.indexOf(':');
|
|
91
|
+
if (colon <= 0)
|
|
92
|
+
throw new Error(`YAML line ${line.num}: expected "key: value"`);
|
|
93
|
+
const key = line.text.slice(0, colon).trim();
|
|
94
|
+
const rest = line.text.slice(colon + 1).trim();
|
|
95
|
+
if (rest.startsWith('[') && rest.endsWith(']')) {
|
|
96
|
+
map[key] = parseInlineArray(rest);
|
|
97
|
+
i++;
|
|
98
|
+
}
|
|
99
|
+
else if (rest.length > 0) {
|
|
100
|
+
map[key] = parseScalar(rest);
|
|
101
|
+
i++;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
const child = lines[i + 1];
|
|
105
|
+
if (!child || child.indent <= baseIndent) {
|
|
106
|
+
throw new Error(`YAML line ${line.num}: "${key}:" has no nested block`);
|
|
107
|
+
}
|
|
108
|
+
const parsed = child.text.startsWith('- ')
|
|
109
|
+
? parseSequenceOfObjects(lines, i + 1, child.indent)
|
|
110
|
+
: parseMapping(lines, i + 1, child.indent);
|
|
111
|
+
map[key] = parsed.value;
|
|
112
|
+
i = parsed.next;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return { value: map, next: i };
|
|
116
|
+
}
|
|
117
|
+
export function parseSupportYaml(yamlBlock) {
|
|
118
|
+
const tokens = tokenizeYaml(yamlBlock);
|
|
119
|
+
const { value, next } = parseMapping(tokens, 0, 0);
|
|
120
|
+
if (next < tokens.length) {
|
|
121
|
+
throw new Error(`YAML line ${tokens[next]?.num ?? 0}: trailing content`);
|
|
122
|
+
}
|
|
123
|
+
return value;
|
|
124
|
+
}
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { GameCapability } from './types.js';
|
|
3
|
+
import type { GamePack } from './pack.js';
|
|
4
|
+
export declare const SUPPORT_TABLE_START = "<!-- gameslate:support-table:start -->";
|
|
5
|
+
export declare const SUPPORT_TABLE_END = "<!-- gameslate:support-table:end -->";
|
|
6
|
+
export declare const REQUIRED_SUPPORT_HEADINGS: readonly ["## Builds & Asset Extraction", "## Map", "## Vitals, Inventory, Missions & Reference", "## Known Gaps", "## Verification"];
|
|
7
|
+
export declare const SupportBuildSchema: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
label: z.ZodString;
|
|
10
|
+
verification: z.ZodEnum<["live_played", "live_route", "tas_verified", "attract_only", "unit_only"]>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
label: string;
|
|
13
|
+
id: string;
|
|
14
|
+
verification: "live_played" | "live_route" | "tas_verified" | "attract_only" | "unit_only";
|
|
15
|
+
}, {
|
|
16
|
+
label: string;
|
|
17
|
+
id: string;
|
|
18
|
+
verification: "live_played" | "live_route" | "tas_verified" | "attract_only" | "unit_only";
|
|
19
|
+
}>;
|
|
20
|
+
export declare const GameSupportSchema: z.ZodObject<{
|
|
21
|
+
gameId: z.ZodString;
|
|
22
|
+
title: z.ZodString;
|
|
23
|
+
builds: z.ZodArray<z.ZodObject<{
|
|
24
|
+
id: z.ZodString;
|
|
25
|
+
label: z.ZodString;
|
|
26
|
+
verification: z.ZodEnum<["live_played", "live_route", "tas_verified", "attract_only", "unit_only"]>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
label: string;
|
|
29
|
+
id: string;
|
|
30
|
+
verification: "live_played" | "live_route" | "tas_verified" | "attract_only" | "unit_only";
|
|
31
|
+
}, {
|
|
32
|
+
label: string;
|
|
33
|
+
id: string;
|
|
34
|
+
verification: "live_played" | "live_route" | "tas_verified" | "attract_only" | "unit_only";
|
|
35
|
+
}>, "many">;
|
|
36
|
+
map: z.ZodObject<{
|
|
37
|
+
status: z.ZodEnum<["done", "partial", "puzzle_panel", "open"]>;
|
|
38
|
+
assetSource: z.ZodEnum<["local_rom", "local_files", "registry", "none"]>;
|
|
39
|
+
geometry: z.ZodEnum<["3d_mesh", "textured_2d", "vector_surfaces", "vector_walls", "route_lanes", "none"]>;
|
|
40
|
+
layers: z.ZodEnum<["multi_floor", "per_room", "mode_switched", "single", "none"]>;
|
|
41
|
+
controls: z.ZodObject<{
|
|
42
|
+
panZoom: z.ZodBoolean;
|
|
43
|
+
rotate2d: z.ZodBoolean;
|
|
44
|
+
tilt3d: z.ZodBoolean;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
panZoom: boolean;
|
|
47
|
+
rotate2d: boolean;
|
|
48
|
+
tilt3d: boolean;
|
|
49
|
+
}, {
|
|
50
|
+
panZoom: boolean;
|
|
51
|
+
rotate2d: boolean;
|
|
52
|
+
tilt3d: boolean;
|
|
53
|
+
}>;
|
|
54
|
+
player: z.ZodObject<{
|
|
55
|
+
position: z.ZodBoolean;
|
|
56
|
+
heading: z.ZodBoolean;
|
|
57
|
+
roomOrFloor: z.ZodBoolean;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
position: boolean;
|
|
60
|
+
heading: boolean;
|
|
61
|
+
roomOrFloor: boolean;
|
|
62
|
+
}, {
|
|
63
|
+
position: boolean;
|
|
64
|
+
heading: boolean;
|
|
65
|
+
roomOrFloor: boolean;
|
|
66
|
+
}>;
|
|
67
|
+
actors: z.ZodObject<{
|
|
68
|
+
enemies: z.ZodEnum<["tokens", "dots", "none"]>;
|
|
69
|
+
npcs: z.ZodEnum<["tokens", "dots", "none"]>;
|
|
70
|
+
rivalsOrPlayers: z.ZodEnum<["dots", "none"]>;
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
enemies: "none" | "tokens" | "dots";
|
|
73
|
+
npcs: "none" | "tokens" | "dots";
|
|
74
|
+
rivalsOrPlayers: "none" | "dots";
|
|
75
|
+
}, {
|
|
76
|
+
enemies: "none" | "tokens" | "dots";
|
|
77
|
+
npcs: "none" | "tokens" | "dots";
|
|
78
|
+
rivalsOrPlayers: "none" | "dots";
|
|
79
|
+
}>;
|
|
80
|
+
pins: z.ZodObject<{
|
|
81
|
+
exits: z.ZodBoolean;
|
|
82
|
+
collectiblesOrItems: z.ZodBoolean;
|
|
83
|
+
objectives: z.ZodBoolean;
|
|
84
|
+
autoHideCollected: z.ZodBoolean;
|
|
85
|
+
customNotes: z.ZodBoolean;
|
|
86
|
+
wayfinding: z.ZodBoolean;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
objectives: boolean;
|
|
89
|
+
exits: boolean;
|
|
90
|
+
collectiblesOrItems: boolean;
|
|
91
|
+
autoHideCollected: boolean;
|
|
92
|
+
customNotes: boolean;
|
|
93
|
+
wayfinding: boolean;
|
|
94
|
+
}, {
|
|
95
|
+
objectives: boolean;
|
|
96
|
+
exits: boolean;
|
|
97
|
+
collectiblesOrItems: boolean;
|
|
98
|
+
autoHideCollected: boolean;
|
|
99
|
+
customNotes: boolean;
|
|
100
|
+
wayfinding: boolean;
|
|
101
|
+
}>;
|
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
status: "done" | "partial" | "puzzle_panel" | "open";
|
|
104
|
+
layers: "none" | "multi_floor" | "per_room" | "mode_switched" | "single";
|
|
105
|
+
assetSource: "local_rom" | "local_files" | "registry" | "none";
|
|
106
|
+
geometry: "none" | "3d_mesh" | "textured_2d" | "vector_surfaces" | "vector_walls" | "route_lanes";
|
|
107
|
+
controls: {
|
|
108
|
+
panZoom: boolean;
|
|
109
|
+
rotate2d: boolean;
|
|
110
|
+
tilt3d: boolean;
|
|
111
|
+
};
|
|
112
|
+
player: {
|
|
113
|
+
position: boolean;
|
|
114
|
+
heading: boolean;
|
|
115
|
+
roomOrFloor: boolean;
|
|
116
|
+
};
|
|
117
|
+
actors: {
|
|
118
|
+
enemies: "none" | "tokens" | "dots";
|
|
119
|
+
npcs: "none" | "tokens" | "dots";
|
|
120
|
+
rivalsOrPlayers: "none" | "dots";
|
|
121
|
+
};
|
|
122
|
+
pins: {
|
|
123
|
+
objectives: boolean;
|
|
124
|
+
exits: boolean;
|
|
125
|
+
collectiblesOrItems: boolean;
|
|
126
|
+
autoHideCollected: boolean;
|
|
127
|
+
customNotes: boolean;
|
|
128
|
+
wayfinding: boolean;
|
|
129
|
+
};
|
|
130
|
+
}, {
|
|
131
|
+
status: "done" | "partial" | "puzzle_panel" | "open";
|
|
132
|
+
layers: "none" | "multi_floor" | "per_room" | "mode_switched" | "single";
|
|
133
|
+
assetSource: "local_rom" | "local_files" | "registry" | "none";
|
|
134
|
+
geometry: "none" | "3d_mesh" | "textured_2d" | "vector_surfaces" | "vector_walls" | "route_lanes";
|
|
135
|
+
controls: {
|
|
136
|
+
panZoom: boolean;
|
|
137
|
+
rotate2d: boolean;
|
|
138
|
+
tilt3d: boolean;
|
|
139
|
+
};
|
|
140
|
+
player: {
|
|
141
|
+
position: boolean;
|
|
142
|
+
heading: boolean;
|
|
143
|
+
roomOrFloor: boolean;
|
|
144
|
+
};
|
|
145
|
+
actors: {
|
|
146
|
+
enemies: "none" | "tokens" | "dots";
|
|
147
|
+
npcs: "none" | "tokens" | "dots";
|
|
148
|
+
rivalsOrPlayers: "none" | "dots";
|
|
149
|
+
};
|
|
150
|
+
pins: {
|
|
151
|
+
objectives: boolean;
|
|
152
|
+
exits: boolean;
|
|
153
|
+
collectiblesOrItems: boolean;
|
|
154
|
+
autoHideCollected: boolean;
|
|
155
|
+
customNotes: boolean;
|
|
156
|
+
wayfinding: boolean;
|
|
157
|
+
};
|
|
158
|
+
}>;
|
|
159
|
+
panels: z.ZodObject<{
|
|
160
|
+
vitals: z.ZodArray<z.ZodString, "many">;
|
|
161
|
+
inventory: z.ZodObject<{
|
|
162
|
+
items: z.ZodEnum<["full", "partial", "none"]>;
|
|
163
|
+
equipment: z.ZodBoolean;
|
|
164
|
+
counters: z.ZodBoolean;
|
|
165
|
+
icons: z.ZodEnum<["extracted_hd", "glyphs", "none"]>;
|
|
166
|
+
}, "strip", z.ZodTypeAny, {
|
|
167
|
+
counters: boolean;
|
|
168
|
+
items: "partial" | "none" | "full";
|
|
169
|
+
equipment: boolean;
|
|
170
|
+
icons: "none" | "extracted_hd" | "glyphs";
|
|
171
|
+
}, {
|
|
172
|
+
counters: boolean;
|
|
173
|
+
items: "partial" | "none" | "full";
|
|
174
|
+
equipment: boolean;
|
|
175
|
+
icons: "none" | "extracted_hd" | "glyphs";
|
|
176
|
+
}>;
|
|
177
|
+
missions: z.ZodObject<{
|
|
178
|
+
main: z.ZodBoolean;
|
|
179
|
+
side: z.ZodBoolean;
|
|
180
|
+
collectibles: z.ZodBoolean;
|
|
181
|
+
}, "strip", z.ZodTypeAny, {
|
|
182
|
+
main: boolean;
|
|
183
|
+
side: boolean;
|
|
184
|
+
collectibles: boolean;
|
|
185
|
+
}, {
|
|
186
|
+
main: boolean;
|
|
187
|
+
side: boolean;
|
|
188
|
+
collectibles: boolean;
|
|
189
|
+
}>;
|
|
190
|
+
reference: z.ZodArray<z.ZodString, "many">;
|
|
191
|
+
timelines: z.ZodBoolean;
|
|
192
|
+
ai: z.ZodObject<{
|
|
193
|
+
stateFacts: z.ZodBoolean;
|
|
194
|
+
chips: z.ZodBoolean;
|
|
195
|
+
curatedHints: z.ZodBoolean;
|
|
196
|
+
wayfindNudges: z.ZodBoolean;
|
|
197
|
+
}, "strip", z.ZodTypeAny, {
|
|
198
|
+
chips: boolean;
|
|
199
|
+
stateFacts: boolean;
|
|
200
|
+
curatedHints: boolean;
|
|
201
|
+
wayfindNudges: boolean;
|
|
202
|
+
}, {
|
|
203
|
+
chips: boolean;
|
|
204
|
+
stateFacts: boolean;
|
|
205
|
+
curatedHints: boolean;
|
|
206
|
+
wayfindNudges: boolean;
|
|
207
|
+
}>;
|
|
208
|
+
}, "strip", z.ZodTypeAny, {
|
|
209
|
+
timelines: boolean;
|
|
210
|
+
inventory: {
|
|
211
|
+
counters: boolean;
|
|
212
|
+
items: "partial" | "none" | "full";
|
|
213
|
+
equipment: boolean;
|
|
214
|
+
icons: "none" | "extracted_hd" | "glyphs";
|
|
215
|
+
};
|
|
216
|
+
missions: {
|
|
217
|
+
main: boolean;
|
|
218
|
+
side: boolean;
|
|
219
|
+
collectibles: boolean;
|
|
220
|
+
};
|
|
221
|
+
reference: string[];
|
|
222
|
+
vitals: string[];
|
|
223
|
+
ai: {
|
|
224
|
+
chips: boolean;
|
|
225
|
+
stateFacts: boolean;
|
|
226
|
+
curatedHints: boolean;
|
|
227
|
+
wayfindNudges: boolean;
|
|
228
|
+
};
|
|
229
|
+
}, {
|
|
230
|
+
timelines: boolean;
|
|
231
|
+
inventory: {
|
|
232
|
+
counters: boolean;
|
|
233
|
+
items: "partial" | "none" | "full";
|
|
234
|
+
equipment: boolean;
|
|
235
|
+
icons: "none" | "extracted_hd" | "glyphs";
|
|
236
|
+
};
|
|
237
|
+
missions: {
|
|
238
|
+
main: boolean;
|
|
239
|
+
side: boolean;
|
|
240
|
+
collectibles: boolean;
|
|
241
|
+
};
|
|
242
|
+
reference: string[];
|
|
243
|
+
vitals: string[];
|
|
244
|
+
ai: {
|
|
245
|
+
chips: boolean;
|
|
246
|
+
stateFacts: boolean;
|
|
247
|
+
curatedHints: boolean;
|
|
248
|
+
wayfindNudges: boolean;
|
|
249
|
+
};
|
|
250
|
+
}>;
|
|
251
|
+
}, "strip", z.ZodTypeAny, {
|
|
252
|
+
map: {
|
|
253
|
+
status: "done" | "partial" | "puzzle_panel" | "open";
|
|
254
|
+
layers: "none" | "multi_floor" | "per_room" | "mode_switched" | "single";
|
|
255
|
+
assetSource: "local_rom" | "local_files" | "registry" | "none";
|
|
256
|
+
geometry: "none" | "3d_mesh" | "textured_2d" | "vector_surfaces" | "vector_walls" | "route_lanes";
|
|
257
|
+
controls: {
|
|
258
|
+
panZoom: boolean;
|
|
259
|
+
rotate2d: boolean;
|
|
260
|
+
tilt3d: boolean;
|
|
261
|
+
};
|
|
262
|
+
player: {
|
|
263
|
+
position: boolean;
|
|
264
|
+
heading: boolean;
|
|
265
|
+
roomOrFloor: boolean;
|
|
266
|
+
};
|
|
267
|
+
actors: {
|
|
268
|
+
enemies: "none" | "tokens" | "dots";
|
|
269
|
+
npcs: "none" | "tokens" | "dots";
|
|
270
|
+
rivalsOrPlayers: "none" | "dots";
|
|
271
|
+
};
|
|
272
|
+
pins: {
|
|
273
|
+
objectives: boolean;
|
|
274
|
+
exits: boolean;
|
|
275
|
+
collectiblesOrItems: boolean;
|
|
276
|
+
autoHideCollected: boolean;
|
|
277
|
+
customNotes: boolean;
|
|
278
|
+
wayfinding: boolean;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
title: string;
|
|
282
|
+
gameId: string;
|
|
283
|
+
panels: {
|
|
284
|
+
timelines: boolean;
|
|
285
|
+
inventory: {
|
|
286
|
+
counters: boolean;
|
|
287
|
+
items: "partial" | "none" | "full";
|
|
288
|
+
equipment: boolean;
|
|
289
|
+
icons: "none" | "extracted_hd" | "glyphs";
|
|
290
|
+
};
|
|
291
|
+
missions: {
|
|
292
|
+
main: boolean;
|
|
293
|
+
side: boolean;
|
|
294
|
+
collectibles: boolean;
|
|
295
|
+
};
|
|
296
|
+
reference: string[];
|
|
297
|
+
vitals: string[];
|
|
298
|
+
ai: {
|
|
299
|
+
chips: boolean;
|
|
300
|
+
stateFacts: boolean;
|
|
301
|
+
curatedHints: boolean;
|
|
302
|
+
wayfindNudges: boolean;
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
builds: {
|
|
306
|
+
label: string;
|
|
307
|
+
id: string;
|
|
308
|
+
verification: "live_played" | "live_route" | "tas_verified" | "attract_only" | "unit_only";
|
|
309
|
+
}[];
|
|
310
|
+
}, {
|
|
311
|
+
map: {
|
|
312
|
+
status: "done" | "partial" | "puzzle_panel" | "open";
|
|
313
|
+
layers: "none" | "multi_floor" | "per_room" | "mode_switched" | "single";
|
|
314
|
+
assetSource: "local_rom" | "local_files" | "registry" | "none";
|
|
315
|
+
geometry: "none" | "3d_mesh" | "textured_2d" | "vector_surfaces" | "vector_walls" | "route_lanes";
|
|
316
|
+
controls: {
|
|
317
|
+
panZoom: boolean;
|
|
318
|
+
rotate2d: boolean;
|
|
319
|
+
tilt3d: boolean;
|
|
320
|
+
};
|
|
321
|
+
player: {
|
|
322
|
+
position: boolean;
|
|
323
|
+
heading: boolean;
|
|
324
|
+
roomOrFloor: boolean;
|
|
325
|
+
};
|
|
326
|
+
actors: {
|
|
327
|
+
enemies: "none" | "tokens" | "dots";
|
|
328
|
+
npcs: "none" | "tokens" | "dots";
|
|
329
|
+
rivalsOrPlayers: "none" | "dots";
|
|
330
|
+
};
|
|
331
|
+
pins: {
|
|
332
|
+
objectives: boolean;
|
|
333
|
+
exits: boolean;
|
|
334
|
+
collectiblesOrItems: boolean;
|
|
335
|
+
autoHideCollected: boolean;
|
|
336
|
+
customNotes: boolean;
|
|
337
|
+
wayfinding: boolean;
|
|
338
|
+
};
|
|
339
|
+
};
|
|
340
|
+
title: string;
|
|
341
|
+
gameId: string;
|
|
342
|
+
panels: {
|
|
343
|
+
timelines: boolean;
|
|
344
|
+
inventory: {
|
|
345
|
+
counters: boolean;
|
|
346
|
+
items: "partial" | "none" | "full";
|
|
347
|
+
equipment: boolean;
|
|
348
|
+
icons: "none" | "extracted_hd" | "glyphs";
|
|
349
|
+
};
|
|
350
|
+
missions: {
|
|
351
|
+
main: boolean;
|
|
352
|
+
side: boolean;
|
|
353
|
+
collectibles: boolean;
|
|
354
|
+
};
|
|
355
|
+
reference: string[];
|
|
356
|
+
vitals: string[];
|
|
357
|
+
ai: {
|
|
358
|
+
chips: boolean;
|
|
359
|
+
stateFacts: boolean;
|
|
360
|
+
curatedHints: boolean;
|
|
361
|
+
wayfindNudges: boolean;
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
builds: {
|
|
365
|
+
label: string;
|
|
366
|
+
id: string;
|
|
367
|
+
verification: "live_played" | "live_route" | "tas_verified" | "attract_only" | "unit_only";
|
|
368
|
+
}[];
|
|
369
|
+
}>;
|
|
370
|
+
export type GameSupport = z.infer<typeof GameSupportSchema>;
|
|
371
|
+
/** Parses a per-game `<game>/README.md` into its validated `GameSupport` spec and checks required headings. */
|
|
372
|
+
export declare function parseGameSupportReadme(markdown: string): {
|
|
373
|
+
support: GameSupport;
|
|
374
|
+
body: string;
|
|
375
|
+
problems: string[];
|
|
376
|
+
};
|
|
377
|
+
export interface SupportCodeContext {
|
|
378
|
+
pack: GamePack;
|
|
379
|
+
sources: ReadonlyArray<{
|
|
380
|
+
capabilities: readonly GameCapability[];
|
|
381
|
+
supportedBuildIds: ReadonlyMap<string, {
|
|
382
|
+
region: string;
|
|
383
|
+
}>;
|
|
384
|
+
}>;
|
|
385
|
+
hasAssetExtractor: boolean;
|
|
386
|
+
/** Optional explicit timeline check (omitted for sandboxed packs whose `ui.timelines` is a host proxy). */
|
|
387
|
+
hasTimelines?: boolean;
|
|
388
|
+
}
|
|
389
|
+
/** Verifies that a game's README support spec agrees with its actual pack, sources, and extractor. */
|
|
390
|
+
export declare function checkSupportAgainstCode(support: GameSupport, ctx: SupportCodeContext): string[];
|
|
391
|
+
/** Renders a standard Markdown support table from a list of per-game support entries. */
|
|
392
|
+
export declare function renderSupportTable(entries: ReadonlyArray<{
|
|
393
|
+
support: GameSupport;
|
|
394
|
+
readmeRelPath: string;
|
|
395
|
+
}>): string;
|
|
396
|
+
/** Replaces the region between SUPPORT_TABLE_START and SUPPORT_TABLE_END in a top-level README. */
|
|
397
|
+
export declare function spliceSupportTable(readmeMarkdown: string, entries: ReadonlyArray<{
|
|
398
|
+
support: GameSupport;
|
|
399
|
+
readmeRelPath: string;
|
|
400
|
+
}>): string;
|