@team-antioch/sc2-adjutant 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/README.md +2 -0
  2. package/data/blizzard-baseline.json +3061 -0
  3. package/data/button-hotkeys.json +5722 -0
  4. package/data/game-assets.json +50909 -0
  5. package/data/package-entries.json +32361 -2
  6. package/dist/capture/bank-fixtures.d.ts +13 -0
  7. package/dist/capture/bank-fixtures.js +35 -0
  8. package/dist/capture/bank-snapshots.d.ts +95 -0
  9. package/dist/capture/bank-snapshots.js +302 -0
  10. package/dist/capture/editor-broker-client.d.ts +27 -4
  11. package/dist/capture/editor-broker-client.js +3 -3
  12. package/dist/capture/editor-broker.js +154 -9
  13. package/dist/capture/effect-tour.d.ts +113 -0
  14. package/dist/capture/effect-tour.js +283 -0
  15. package/dist/capture/effect-video.d.ts +74 -0
  16. package/dist/capture/effect-video.js +173 -0
  17. package/dist/capture/exemplar-capture.d.ts +4 -0
  18. package/dist/capture/exemplar-capture.js +4 -1
  19. package/dist/capture/shots.d.ts +6 -1
  20. package/dist/capture/shots.js +1 -1
  21. package/dist/capture/stop-tour.d.ts +3 -1
  22. package/dist/capture/stop-tour.js +1 -1
  23. package/dist/capture/style-pack-captures.d.ts +67 -0
  24. package/dist/capture/style-pack-captures.js +172 -0
  25. package/dist/catalog/stock-catalog.d.ts +8 -0
  26. package/dist/catalog/stock-catalog.js +13 -0
  27. package/dist/cli/capture-exemplars.js +18 -32
  28. package/dist/cli/effect-tour.d.ts +2 -0
  29. package/dist/cli/effect-tour.js +378 -0
  30. package/dist/cli/make-frames.d.ts +1 -0
  31. package/dist/cli/make-frames.js +21 -0
  32. package/dist/cli/sound-mix.d.ts +1 -0
  33. package/dist/cli/sound-mix.js +75 -0
  34. package/dist/cli/study.js +6 -26
  35. package/dist/domain/blueprint-trigger.d.ts +355 -3
  36. package/dist/domain/blueprint-trigger.js +149 -8
  37. package/dist/domain/library-interface.d.ts +50 -29
  38. package/dist/domain/library-interface.js +54 -41
  39. package/dist/domain/mission-blueprint.d.ts +13 -6
  40. package/dist/domain/mission-blueprint.js +6 -0
  41. package/dist/domain/mod-blueprint.d.ts +4 -4
  42. package/dist/host/game-logs.d.ts +63 -0
  43. package/dist/host/game-logs.js +178 -0
  44. package/dist/host/game-ownership.d.ts +37 -0
  45. package/dist/host/game-ownership.js +84 -0
  46. package/dist/host/game-run-report.d.ts +63 -0
  47. package/dist/host/game-run-report.js +119 -0
  48. package/dist/host/known-errors.d.ts +34 -0
  49. package/dist/host/known-errors.js +73 -0
  50. package/dist/init/init-workspace.d.ts +3 -1
  51. package/dist/init/init-workspace.js +10 -1
  52. package/dist/map/convert-mission-triggers.d.ts +115 -7
  53. package/dist/map/convert-mission-triggers.js +527 -47
  54. package/dist/map/editor-changes.d.ts +1 -1
  55. package/dist/map/editor-form.d.ts +5 -0
  56. package/dist/map/editor-form.js +72 -0
  57. package/dist/map/game-packages.d.ts +3 -2
  58. package/dist/map/game-packages.js +5 -2
  59. package/dist/map/kept-references.js +47 -1
  60. package/dist/map/kept-session.js +3 -1
  61. package/dist/map/outline-diff.d.ts +24 -0
  62. package/dist/map/outline-diff.js +95 -0
  63. package/dist/map/outline-trigger.d.ts +7 -0
  64. package/dist/map/outline-trigger.js +29 -20
  65. package/dist/map/ownership-plan.d.ts +6 -2
  66. package/dist/map/ownership-plan.js +1 -1
  67. package/dist/map/package-output.js +13 -8
  68. package/dist/map/tune-kept-triggers.d.ts +7 -0
  69. package/dist/map/tune-kept-triggers.js +33 -6
  70. package/dist/map/write-blueprint-trigger.d.ts +9 -4
  71. package/dist/map/write-blueprint-trigger.js +46 -13
  72. package/dist/map/write-map-package.js +20 -9
  73. package/dist/mcp/capture-jobs.d.ts +2 -0
  74. package/dist/mcp/capture-jobs.js +2 -0
  75. package/dist/mcp/server.d.ts +11 -2
  76. package/dist/mcp/server.js +17 -4
  77. package/dist/mcp/tools/bank-report.d.ts +19 -0
  78. package/dist/mcp/tools/bank-report.js +51 -0
  79. package/dist/mcp/tools/blueprint.js +18 -14
  80. package/dist/mcp/tools/capture.d.ts +4 -0
  81. package/dist/mcp/tools/capture.js +22 -5
  82. package/dist/mcp/tools/catalog.d.ts +1 -1
  83. package/dist/mcp/tools/catalog.js +30 -1
  84. package/dist/mcp/tools/compile.d.ts +1 -1
  85. package/dist/mcp/tools/compile.js +100 -9
  86. package/dist/mcp/tools/editor-handoff.d.ts +4 -1
  87. package/dist/mcp/tools/editor-handoff.js +6 -3
  88. package/dist/mcp/tools/style-pack.d.ts +11 -0
  89. package/dist/mcp/tools/style-pack.js +245 -0
  90. package/dist/mcp/tools/tool-group.d.ts +9 -0
  91. package/dist/mods/button-hotkeys.d.ts +45 -0
  92. package/dist/mods/button-hotkeys.js +185 -0
  93. package/dist/mods/compile-mod.js +19 -5
  94. package/dist/mods/custom-doodads.d.ts +21 -1
  95. package/dist/mods/custom-doodads.js +53 -7
  96. package/dist/mods/data-rules.js +8 -1
  97. package/dist/mods/effective-entry.d.ts +18 -0
  98. package/dist/mods/effective-entry.js +52 -0
  99. package/dist/mods/function-search.js +12 -0
  100. package/dist/mods/library-xml.d.ts +34 -5
  101. package/dist/mods/library-xml.js +94 -22
  102. package/dist/mods/sound-mix.d.ts +92 -0
  103. package/dist/mods/sound-mix.js +195 -0
  104. package/dist/plugins/check-workspace.js +22 -3
  105. package/dist/plugins/plugin-api.d.ts +59 -5
  106. package/dist/plugins/plugin-api.js +6 -0
  107. package/dist/plugins/plugin-sdk.d.ts +13 -1
  108. package/dist/plugins/plugin-sdk.js +16 -1
  109. package/dist/plugins/plugin-sources.js +1 -0
  110. package/dist/plugins/registry.d.ts +4 -0
  111. package/dist/plugins/registry.js +6 -2
  112. package/dist/plugins/workspace.d.ts +5 -0
  113. package/dist/plugins/workspace.js +10 -2
  114. package/dist/study/blizzard-baseline.d.ts +76 -0
  115. package/dist/study/blizzard-baseline.js +137 -0
  116. package/dist/study/exemplar-report.d.ts +71 -0
  117. package/dist/study/exemplar-report.js +163 -0
  118. package/dist/study/find-places.d.ts +127 -0
  119. package/dist/study/find-places.js +306 -0
  120. package/dist/study/load-map-package.d.ts +3 -0
  121. package/dist/study/load-map-package.js +11 -0
  122. package/dist/study/map-study.d.ts +1 -0
  123. package/dist/study/map-study.js +3 -0
  124. package/dist/study/measure-lighting.d.ts +6 -0
  125. package/dist/study/measure-lighting.js +1 -1
  126. package/dist/study/measures.d.ts +225 -0
  127. package/dist/study/measures.js +366 -0
  128. package/dist/study/scaffold-style-pack.d.ts +58 -0
  129. package/dist/study/scaffold-style-pack.js +261 -0
  130. package/dist/study/study-exemplars.d.ts +67 -0
  131. package/dist/study/study-exemplars.js +133 -0
  132. package/dist/triggers/blueprint-triggers.d.ts +71 -11
  133. package/dist/triggers/blueprint-triggers.js +403 -48
  134. package/dist/triggers/kept-trigger-galaxy.d.ts +29 -0
  135. package/dist/triggers/kept-trigger-galaxy.js +103 -7
  136. package/dist/triggers/splice-map-script.d.ts +2 -0
  137. package/dist/triggers/splice-map-script.js +309 -8
  138. package/dist/triggers/write-triggers-xml.js +20 -5
  139. package/dist/ui/frame-path-check.d.ts +43 -4
  140. package/dist/ui/frame-path-check.js +121 -13
  141. package/dist/ui/frame-paths.d.ts +21 -1
  142. package/dist/ui/frame-paths.js +26 -6
  143. package/dist/ui/toast.d.ts +4 -5
  144. package/dist/ui/toast.js +6 -10
  145. package/examples/example-campaign/README.md +27 -0
  146. package/examples/example-campaign/missions/ashfall-relay/blueprint.json +11 -1
  147. package/examples/example-campaign/missions/ashfall-relay/triggers/ash-tremors.json +69 -0
  148. package/examples/example-campaign/missions/ashfall-relay/triggers/start-ash-tremors.json +31 -0
  149. package/package.json +3 -3
@@ -0,0 +1,195 @@
1
+ // Sound mixes: several CSounds played as one sound, each from its own time after the mix starts,
2
+ // as the actor data of one CActorSound (docs/reference/sound-mixes.md). A CSound's AssetArray plays
3
+ // one of its files a time, so it can't layer; a CActorSound's Layers can, each layer its own CSound
4
+ // (with its own variations) after its own PlayDelay. Blizzard's co-op data builds layered sounds
5
+ // this way (DehakaGlevigBase_UnBurrow_AS, SIMissileTurret_AttackLaunchSound).
6
+ //
7
+ // A mix is one actor, created with `Create <id>` from the actor of the unit it's for (on its
8
+ // death, an attack, a hit). It takes its place from that actor once and lets go of it
9
+ // (`RefClear ::Host`, as the game's UnitDeathSound does), so it plays on where the unit was after
10
+ // the unit dies. A layer with a stop time can't be one of its Layers, which all end together:
11
+ // each such layer is an actor of its own, created with the mix, that stops itself with a timer,
12
+ // fading out first if it has a fade.
13
+ //
14
+ // The main sound of a CActorSound plays at once, so it's the mix's first layer when that starts
15
+ // at 0 and has no stop. Otherwise it's a silent CSound, as Blizzard's layered sounds with nothing
16
+ // at 0 use Nova_SniperRifleTail_Dummy (Chance 0, -90 dB).
17
+ import { existsSync } from "node:fs";
18
+ import { readdir, readFile, stat } from "node:fs/promises";
19
+ import path from "node:path";
20
+ import { z } from "zod";
21
+ import { packageEntries, packageName } from "../map/game-packages.js";
22
+ import { schemaProblems } from "./catalog-schema.js";
23
+ import { entryXml } from "./generic-entries.js";
24
+ import { modDir, readWorkspaceModWithBlueprint } from "./workspace-mods.js";
25
+ /** Blizzard's silent CSound for a layered actor sound with nothing at 0 (in void.sc2mod). */
26
+ export const SILENT_SOUND = "Nova_SniperRifleTail_Dummy";
27
+ const ID = /^[A-Za-z_][\w]*$/;
28
+ const seconds = z.number().finite().nonnegative();
29
+ export const SoundMixLayerSchema = z
30
+ .object({
31
+ /** The CSound this layer plays. */
32
+ sound: z.string().regex(ID, "A CSound id is letters, digits and underscores"),
33
+ /** When it starts, in seconds after the mix is created. */
34
+ at: seconds,
35
+ /** When it stops, in seconds after the mix is created; it plays to its end without one. */
36
+ stop: seconds.optional(),
37
+ /** How long it fades out over from its stop, in seconds; it cuts off without one. */
38
+ fade: seconds.optional(),
39
+ })
40
+ .strict()
41
+ .refine((layer) => layer.stop === undefined || layer.stop > layer.at, { message: "A layer stops after it starts", path: ["stop"] })
42
+ .refine((layer) => layer.fade === undefined || layer.stop !== undefined, { message: "A fade is how a layer stops: give its stop too", path: ["fade"] });
43
+ export const SoundMixSchema = z
44
+ .object({
45
+ /** The mix's actor, created with `Create <id>`. A layer with a stop is the actor `<id>_<n>`, n its place in `layers` from 1. */
46
+ id: z.string().regex(ID, "An actor id is letters, digits and underscores"),
47
+ layers: z.array(SoundMixLayerSchema).min(1),
48
+ /** The silent CSound the actor plays as its main sound when no layer can be; Blizzard's by default. */
49
+ silent: z.string().regex(ID).optional(),
50
+ })
51
+ .strict();
52
+ /** One mix or a list of them, as a mix file holds them. */
53
+ export const SoundMixFileSchema = z.union([SoundMixSchema, z.array(SoundMixSchema).min(1)]).transform((read) => (Array.isArray(read) ? read : [read]));
54
+ /** Seconds as Blizzard's actor messages write them. */
55
+ const secs = (value) => value.toFixed(6);
56
+ /** Seconds as a layer's PlayDelay range (milliseconds, min and max), the same both ends. */
57
+ const delay = (value) => {
58
+ const ms = Math.round(value * 1000);
59
+ return `${ms},${ms}`;
60
+ };
61
+ /** A layer of a CActorSound: its CSound after its delay, at the CSound's own volume and pitch. */
62
+ function layerField(layer) {
63
+ return {
64
+ Sound: { value: layer.sound },
65
+ PitchSource: { value: "Sound" },
66
+ PlayDelaySource: { value: "Actor" },
67
+ VolumeSource: { value: "Sound" },
68
+ Chance: { value: 100 },
69
+ PlayDelay: { value: delay(layer.at) },
70
+ };
71
+ }
72
+ /** A sound actor that takes its creator's place once and keeps it, as the game's UnitDeathSound does. */
73
+ function placedSound(id, main, layers, on) {
74
+ const fields = {
75
+ Sound: main,
76
+ ...(layers.length > 0 ? { Layers: layers.map(layerField) } : {}),
77
+ Host: { Subject: "::Creator" },
78
+ SoundFlags: { index: "UpdateVisibility", value: 0 },
79
+ On: [...on, { Terms: "ActorCreation", Send: "RefClear ::Host" }],
80
+ };
81
+ return { catalog: "Actor", class: "CActorSound", id, parent: "SoundOneShot", fields };
82
+ }
83
+ /** The actor entries that play `mix`: its actor, then one for each layer with a stop. */
84
+ export function soundMixEntries(mix) {
85
+ const silent = mix.silent ?? SILENT_SOUND;
86
+ const numbered = mix.layers.map((layer, index) => ({ layer, actor: `${mix.id}_${index + 1}` }));
87
+ const stopped = numbered.filter(({ layer }) => layer.stop !== undefined);
88
+ const free = numbered.filter(({ layer }) => layer.stop === undefined).map(({ layer }) => layer);
89
+ // The first free layer at 0 plays as the actor's own sound; every other one is a Layer.
90
+ const first = free.findIndex((layer) => layer.at === 0);
91
+ const main = first === -1 ? silent : free[first].sound;
92
+ const layers = free.filter((_, index) => index !== first);
93
+ const out = [placedSound(mix.id, main, layers, stopped.map(({ actor }) => ({ Terms: "ActorCreation", Send: `Create ${actor}` })))];
94
+ for (const { layer, actor } of stopped) {
95
+ const atZero = layer.at === 0;
96
+ const timers = [{ Terms: "ActorCreation", Send: `TimerSet ${secs(layer.stop)} Stop` }];
97
+ if (layer.fade !== undefined && layer.fade > 0) {
98
+ const ms = Math.round(layer.fade * 1000).toFixed(6);
99
+ timers.push({ Terms: "TimerExpired; TimerName Stop", Send: `SoundSetVolume Logarithmic 0.000000@0.000000,-96.000000@${ms}` }, { Terms: "TimerExpired; TimerName Stop", Send: `TimerSet ${secs(layer.fade)} End` }, { Terms: "TimerExpired; TimerName End", Send: "Destroy" });
100
+ }
101
+ else
102
+ timers.push({ Terms: "TimerExpired; TimerName Stop", Send: "Destroy" });
103
+ out.push(placedSound(actor, atZero ? layer.sound : silent, atZero ? [] : [layer], timers));
104
+ }
105
+ return out;
106
+ }
107
+ /** `entries` as the elements of an ActorData.xml, for a map's own data. */
108
+ export const soundMixXml = (entries) => entries.map(entryXml).join("\n");
109
+ /** The CSound ids defined in a file or folder: a GameData XML file, a JSON file of Generic Entries, or every such file in a folder (a .SC2Map, a .SC2Mod, a Mod Blueprint's entries). */
110
+ export async function definedSounds(where) {
111
+ const found = new Set();
112
+ const files = (await stat(where)).isDirectory() ? (await readdir(where, { recursive: true })).map((name) => path.join(where, name)) : [where];
113
+ for (const file of files) {
114
+ const ext = path.extname(file).toLowerCase();
115
+ if (ext !== ".xml" && ext !== ".json")
116
+ continue;
117
+ if (!(await stat(file)).isFile())
118
+ continue;
119
+ const text = await readFile(file, "utf8");
120
+ if (ext === ".xml")
121
+ for (const [, id] of text.matchAll(/<CSound\b[^>]*?\bid="([^"]+)"/g))
122
+ found.add(id);
123
+ else {
124
+ let parsed;
125
+ try {
126
+ parsed = JSON.parse(text);
127
+ }
128
+ catch {
129
+ continue;
130
+ }
131
+ for (const entry of Array.isArray(parsed) ? parsed : []) {
132
+ if (entry && typeof entry === "object" && entry.class === "CSound" && typeof entry.id === "string")
133
+ found.add(entry.id);
134
+ }
135
+ }
136
+ }
137
+ return found;
138
+ }
139
+ /** The CSounds a Workspace's own mods define: in each mod's package, and in its Blueprint's Generic Entries. */
140
+ export async function workspaceSounds(workspace) {
141
+ const found = new Set();
142
+ for (const id of workspace.mods) {
143
+ let read;
144
+ try {
145
+ read = await readWorkspaceModWithBlueprint(workspace, id);
146
+ }
147
+ catch {
148
+ continue;
149
+ }
150
+ const places = [read.mod.modPackage, ...read.blueprint.entries.map((entries) => path.resolve(modDir(workspace, id), entries.source))];
151
+ for (const place of places)
152
+ if (existsSync(place))
153
+ for (const sound of await definedSounds(place))
154
+ found.add(sound);
155
+ }
156
+ return found;
157
+ }
158
+ /**
159
+ * Checks `mixes`: every CSound a layer plays (and the silent one where it's used) is the game's
160
+ * (data/package-entries.json) or one of `own` (the map's or mod's own), and every entry they make
161
+ * passes the game's data schema.
162
+ */
163
+ export function checkSoundMixes(mixes, own) {
164
+ const stock = packageEntries().sounds;
165
+ const lower = new Map([...stock.keys(), ...own].map((id) => [id.toLowerCase(), id]));
166
+ const found = new Map();
167
+ const problems = [];
168
+ const ids = new Set();
169
+ for (const mix of mixes) {
170
+ if (ids.has(mix.id))
171
+ problems.push(`${mix.id}: two mixes have this id`);
172
+ ids.add(mix.id);
173
+ const entries = soundMixEntries(mix);
174
+ const played = new Set(entries.map((entry) => String(entry.fields.Sound)));
175
+ for (const layer of mix.layers)
176
+ played.add(layer.sound);
177
+ for (const sound of played) {
178
+ if (found.has(sound))
179
+ continue;
180
+ if (own.has(sound))
181
+ found.set(sound, ["own"]);
182
+ else if (stock.has(sound))
183
+ found.set(sound, stock.get(sound).map(packageName));
184
+ else {
185
+ const near = lower.get(sound.toLowerCase());
186
+ problems.push(`${mix.id}: no CSound ${sound} in the game's data or the own data given${near ? ` (did you mean ${near}?)` : ""}; it would play nothing`);
187
+ }
188
+ }
189
+ for (const entry of entries)
190
+ problems.push(...schemaProblems(entry));
191
+ }
192
+ return { found, problems };
193
+ }
194
+ /** The line to add to the actor of the unit a mix is for: it creates the mix on `terms` (an actor event such as UnitDeath). */
195
+ export const soundMixWiring = (mix, terms = "UnitDeath") => `<On Terms="${terms}" Send="Create ${mix.id}"/>`;
@@ -46,13 +46,25 @@ import { campaignModPackages, MOD_PACKAGE_EXTENSION, ModBlueprintError, modDir,
46
46
  import { readMissionScript } from "../script/name-script.js";
47
47
  import { sceneLineProblems, scenePartProblems } from "../script/scene-parts.js";
48
48
  import { isInside } from "../util/inside.js";
49
+ import { bankFixtureProblem } from "../capture/bank-fixtures.js";
49
50
  import { workspaceLibrary } from "../mods/library.js";
50
51
  import { modUi, uiComponentsOn } from "../ui/components.js";
51
- import { componentUi, modFramePathWarnings } from "../ui/frame-path-check.js";
52
+ import { componentUi, modFrameWarnings } from "../ui/frame-path-check.js";
52
53
  import { UI_COMPONENTS } from "../ui/core-components.js";
54
+ import { KNOWN_ERRORS_FILE, readKnownErrors } from "../host/known-errors.js";
53
55
  import { BLUEPRINT_FILE, campaignModName, loadWorkspace, missionIds, readRawBlueprint, validateMissionBlueprint, WORKSPACE_FILE } from "./workspace.js";
54
56
  /** Whether a problem fails the check: every one but a warning, a review item or a note. */
55
57
  export const isError = (problem) => isCinematicError(problem);
58
+ /** A known-errors list's problems: the file that doesn't read or fit its format, and a pattern whose reason is still the placeholder a tool proposed. */
59
+ async function knownErrorsProblems(absolute, file, mission) {
60
+ try {
61
+ const patterns = await readKnownErrors(absolute, file);
62
+ return patterns.flatMap((pattern, index) => (/^TODO/i.test(pattern.reason.trim()) ? [{ ...(mission ? { mission } : {}), file, path: `patterns.${index}.reason`, message: `the pattern "${pattern.match}" still has a placeholder for its reason: say why it's known`, severity: "warning" }] : []));
63
+ }
64
+ catch (error) {
65
+ return [{ ...(mission ? { mission } : {}), file, message: messageOf(error) }];
66
+ }
67
+ }
56
68
  /** Why a Mission's UI action can't be called as its compile would call it, or undefined when it can. */
57
69
  function uiActionProblem(library, blueprint, action, params) {
58
70
  try {
@@ -82,7 +94,7 @@ export async function checkWorkspace(root, options = {}) {
82
94
  catch (error) {
83
95
  return { root: absolute, missions: [], problems: [{ file: relative(workspace.missionsDir), message: messageOf(error) }, ...(await modProblems(workspace, relative, sc2Path, options.modelFootprints, options.uiComponents ?? UI_COMPONENTS))] };
84
96
  }
85
- const problems = [];
97
+ const problems = [...(await knownErrorsProblems(path.join(absolute, KNOWN_ERRORS_FILE), KNOWN_ERRORS_FILE))];
86
98
  const footprints = options.modelFootprints ?? (await bundledModelFootprints());
87
99
  const uiComponents = options.uiComponents ?? UI_COMPONENTS;
88
100
  /** The Campaign Mod's library, read once a Mission has a UI action to check. */
@@ -99,6 +111,7 @@ export async function checkWorkspace(root, options = {}) {
99
111
  problems.push({ mission, file, message: messageOf(error) });
100
112
  continue;
101
113
  }
114
+ problems.push(...(await knownErrorsProblems(path.join(path.dirname(blueprintPath), KNOWN_ERRORS_FILE), relative(path.join(path.dirname(blueprintPath), KNOWN_ERRORS_FILE)), mission)));
102
115
  // The Mission's own Map Package; a folder holding two is a problem, and the rest of the Mission is still checked.
103
116
  let mapDir;
104
117
  try {
@@ -203,6 +216,12 @@ export async function checkWorkspace(root, options = {}) {
203
216
  catch (error) {
204
217
  problems.push({ mission, file, message: `The static shadow bake wasn't checked: ${messageOf(error)}`, severity: "warning" });
205
218
  }
219
+ // A bank fixture (#55) that names no usable folder: test_mission would refuse to play it.
220
+ if (result.blueprint.bankFixture !== undefined) {
221
+ const problem = await bankFixtureProblem(absolute, blueprintPath, result.blueprint.bankFixture);
222
+ if (problem)
223
+ problems.push({ mission, file, path: "bankFixture", message: problem });
224
+ }
206
225
  const reference = result.blueprint.screenplay.script;
207
226
  let script;
208
227
  if (reference) {
@@ -352,7 +371,7 @@ async function modProblems(workspace, relative, sc2Path, footprints, uiComponent
352
371
  // A `ui` that doesn't read is reported above, and its components' layouts left out here.
353
372
  try {
354
373
  const generated = componentUi(on, found.blueprintPath, blueprint.library?.id);
355
- for (const warning of await modFramePathWarnings(found.modPackage, generated))
374
+ for (const warning of await modFrameWarnings(found.modPackage, generated))
356
375
  problems.push({ mod, file: relative(warning.file), path: warning.where, message: warning.message, severity: "warning" });
357
376
  }
358
377
  catch (error) {
@@ -491,7 +491,7 @@ export type StyleRule = StyleRuleSlots & {
491
491
  * Core asks whether one exists: a tool in the co-design loop hands the step to the author as
492
492
  * instructions when it doesn't, and a bulk tool with no manual form isn't listed at all.
493
493
  */
494
- export declare const HOST_CAPABILITIES: readonly ["editor.open", "editor.checkClosed", "editor.refresh", "editor.testDocument", "editor.save", "editor.captureTour", "editor.closeCaptureCopies", "game.running", "screen.capture", "tts.speak", "model.render", "model.rendererKey", "model.export", "model.exportGltf", "game.launch"];
494
+ export declare const HOST_CAPABILITIES: readonly ["editor.open", "editor.checkClosed", "editor.refresh", "editor.testDocument", "editor.save", "editor.captureTour", "editor.closeCaptureCopies", "game.running", "game.banksDir", "game.list", "game.quit", "game.logsFolder", "screen.capture", "tts.speak", "model.render", "model.rendererKey", "model.export", "model.exportGltf", "game.launch"];
495
495
  export type HostCapabilityName = (typeof HOST_CAPABILITIES)[number];
496
496
  /** The machine settings a Host Adapter can read; paths are absolute. */
497
497
  export type MachineSettings = {
@@ -518,6 +518,17 @@ export type HostContext = {
518
518
  * without saving, so it only takes maps from here.
519
519
  */
520
520
  export declare const CAPTURE_MAPS_FOLDER = "capture/maps";
521
+ /**
522
+ * A running game, named by its process id and when that process started. A process id is reused
523
+ * once its process exits, so the start time (as the host reads it; compared only for equality) says
524
+ * whether a recorded game is still the one that was started.
525
+ */
526
+ export type GameProcess = {
527
+ readonly pid: number;
528
+ readonly startedAt: string;
529
+ };
530
+ /** What a capture says when another game is running: one it didn't start isn't its to quit. */
531
+ export declare const FOREIGN_GAME_REFUSAL = "A game is running that this tool didn't start. Quit it, or capture with `attach`.";
521
532
  /** A camera tour to capture: see `editor.captureTour`. */
522
533
  export type CaptureTourRequest = {
523
534
  /** A Map Package inside `<cacheDir>/capture/maps/`, whose script announces each stop in a bank. */
@@ -535,6 +546,18 @@ export type CaptureTourRequest = {
535
546
  readonly quality: number;
536
547
  /** How long to wait for the first stop once the game runs, in seconds, before giving up. */
537
548
  readonly startSeconds: number;
549
+ /**
550
+ * Records the game window as well, from when it appears until the tour ends: `video.mp4` in
551
+ * `outputDir`, `width` pixels wide at up to `fps` frames a second, at `quality` (0-1, the
552
+ * encoder's constant-quality setting; the Host Adapter picks one when it isn't given), with `video-stops.txt` giving
553
+ * each stop's time into it (`<stop> <seconds>` per line), and the time of each change of the bank's int key `mark`, if the map saves one (`m<mark> <seconds>`). For what a screenshot misses: a burst
554
+ * of particles that is over before the frame is taken. A Host Adapter that can't record ignores it.
555
+ */
556
+ readonly video?: {
557
+ readonly width: number;
558
+ readonly fps: number;
559
+ readonly quality?: number;
560
+ };
538
561
  /**
539
562
  * After this many seconds with no stop, press Space now and then, for a loading screen that waits
540
563
  * for it. Pressing takes focus from whoever is using the machine, so not too soon.
@@ -547,6 +570,11 @@ export type CaptureTourRequest = {
547
570
  readonly writeMap?: () => Promise<unknown>;
548
571
  /** The game is already running the map (the author started it): only watch, and leave the Editor alone. */
549
572
  readonly attach?: boolean;
573
+ /**
574
+ * Called once with the game this tour started, as soon as it is found, so the Editor Broker
575
+ * records it as the tool's to quit (and quits it if the tour fails or is cancelled).
576
+ */
577
+ readonly onGameStarted?: (game: GameProcess) => void;
550
578
  /** Progress lines for the author. */
551
579
  readonly log?: (line: string) => void;
552
580
  /**
@@ -615,17 +643,43 @@ export type HostCapabilities = {
615
643
  readonly "editor.captureTour": (request: CaptureTourRequest, context: HostContext) => Promise<CaptureTourResult>;
616
644
  /**
617
645
  * Closes, without saving, every map in `<cacheDir>/capture/maps/` the Editor has open, and quits
618
- * a game it may be testing. The Editor Broker runs it as it starts and after a failed tour, so a
619
- * copy an earlier run left open is never tested in place of a new one. Never touches another map.
646
+ * the `games` the broker recorded as the tool's own (never another game: the author may be playing).
647
+ * The Editor Broker runs it as it starts and after a failed tour, so a copy an earlier run left
648
+ * open is never tested in place of a new one. Never touches another map.
620
649
  */
621
650
  readonly "editor.closeCaptureCopies": (request: {
622
651
  readonly log?: (line: string) => void;
652
+ readonly games?: readonly GameProcess[];
623
653
  }, context: HostContext) => Promise<void>;
624
654
  /**
625
- * Whether a StarCraft II game is running. The Editor Broker asks it after a Test Document it ran,
626
- * and starts no capture until the game has quit, since a capture quits any game it finds.
655
+ * Whether a StarCraft II game is running. The Editor Broker asks it, when the host has no
656
+ * `game.list`, after a Test Document it ran, and starts no capture until that game has quit.
627
657
  */
628
658
  readonly "game.running": (request: Record<string, never>, context: HostContext) => Promise<boolean>;
659
+ /**
660
+ * The folder the game keeps its banks in (`Banks/` of the StarCraft II documents folder). The
661
+ * Editor Broker snapshots it around a test game (#54) to report what the run changed; it only
662
+ * reads the folder, and writes into it only when the author asks to roll a bank back.
663
+ */
664
+ readonly "game.banksDir": (request: Record<string, never>, context: HostContext) => Promise<string>;
665
+ /** Every running StarCraft II game, so the Editor Broker can tell the one a job started from any other. */
666
+ readonly "game.list": (request: Record<string, never>, context: HostContext) => Promise<GameProcess[]>;
667
+ /**
668
+ * Quits this game and no other: the quit key and its Yes (Mac: Cmd+Option+Q; Windows: close the
669
+ * window), so the game writes its logs, then ends the process only if it hasn't exited within a
670
+ * timeout. Resolves "gone" without touching anything when no process matches both the pid and
671
+ * the start time (it exited, or its pid was reused), else how it ended, which it also logs.
672
+ */
673
+ readonly "game.quit": (request: {
674
+ readonly game: GameProcess;
675
+ readonly log?: (line: string) => void;
676
+ }, context: HostContext) => Promise<"closed" | "killed" | "gone">;
677
+ /**
678
+ * The folder the game writes its log files to (GameLogs): where core reads a run's errors and
679
+ * crashes from (host/game-logs.ts). Each Host Adapter names its machine's; the game writes the
680
+ * files as it exits, so they're read after a quit.
681
+ */
682
+ readonly "game.logsFolder": (request: Record<string, never>, context: HostContext) => Promise<string>;
629
683
  /** Captures the game window (else the Editor's) to an image, JPEG or PNG by the path's extension. */
630
684
  readonly "screen.capture": (request: {
631
685
  readonly outputPath: string;
@@ -23,6 +23,10 @@ export const HOST_CAPABILITIES = [
23
23
  "editor.captureTour",
24
24
  "editor.closeCaptureCopies",
25
25
  "game.running",
26
+ "game.banksDir",
27
+ "game.list",
28
+ "game.quit",
29
+ "game.logsFolder",
26
30
  "screen.capture",
27
31
  "tts.speak",
28
32
  "model.render",
@@ -36,6 +40,8 @@ export const HOST_CAPABILITIES = [
36
40
  * without saving, so it only takes maps from here.
37
41
  */
38
42
  export const CAPTURE_MAPS_FOLDER = "capture/maps";
43
+ /** What a capture says when another game is running: one it didn't start isn't its to quit. */
44
+ export const FOREIGN_GAME_REFUSAL = "A game is running that this tool didn't start. Quit it, or capture with `attach`.";
39
45
  /** The error `model.render` rejects with when the game has no model at that path. */
40
46
  export function modelNotFound(model) {
41
47
  return Object.assign(new Error(`model not found: ${model}`), { code: "model-not-found" });
@@ -1,4 +1,5 @@
1
- export { CAPTURE_MAPS_FOLDER, type CaptureTourRequest, type CaptureTourResult, type HostContext, modelNotFound, type ChoosePieces, type CliffPileShape, type CliffTexturePair, type ConnectionState, type CutsceneSourceKind, defineMechanic, type Footprint, type LineNamingContext, type Mechanic, type MechanicConnectionChange, type MechanicContext, type MechanicEntryContext, type MechanicGameData, type MechanicMomentRef, type MechanicIssue, type MechanicPlacedUnit, type MechanicPrimitives, type MechanicThreat, type MechanicThreatContext, type MechanicTriggerContext, type MechanicTriggers, type NamingTemplate, type PilePiece, type PileRole, type PluginCode, type PluginLight, type ScaleRange, type ScreenplayNamingContext, type ScreenplayRequest, type ScreenplaySource, type Schedule, type ShorePileShape, type StampedComposite, type StyleRandom, type StyleRule, type StyleRuleSlot, type StyleRuleSlots, type ThreatConsequence, } from "./plugin-api.js";
1
+ export { type GameSystem, ownedGame, QUIT_GRACE_SECONDS, quitOwnedGame, refuseForeignGame, sameGame, stillRuns } from "../host/game-ownership.js";
2
+ export { CAPTURE_MAPS_FOLDER, FOREIGN_GAME_REFUSAL, type GameProcess, type CaptureTourRequest, type CaptureTourResult, type HostContext, modelNotFound, type ChoosePieces, type CliffPileShape, type CliffTexturePair, type ConnectionState, type CutsceneSourceKind, defineMechanic, type Footprint, type LineNamingContext, type Mechanic, type MechanicConnectionChange, type MechanicContext, type MechanicEntryContext, type MechanicGameData, type MechanicMomentRef, type MechanicIssue, type MechanicPlacedUnit, type MechanicPrimitives, type MechanicThreat, type MechanicThreatContext, type MechanicTriggerContext, type MechanicTriggers, type NamingTemplate, type PilePiece, type PileRole, type PluginCode, type PluginLight, type ScaleRange, type ScreenplayNamingContext, type ScreenplayRequest, type ScreenplaySource, type Schedule, type ShorePileShape, type StampedComposite, type StyleRandom, type StyleRule, type StyleRuleSlot, type StyleRuleSlots, type ThreatConsequence, } from "./plugin-api.js";
2
3
  export type { CliffPile, DressingMember } from "../domain/mission-blueprint.js";
3
4
  export { slugId } from "../domain/mission-blueprint.js";
4
5
  export { COUNTDOWN_TELEGRAPH } from "../domain/threat.js";
@@ -13,3 +14,14 @@ export { behaviorLink, block, call, callValue, pickedUnit, setLighting, stableEl
13
14
  export { compare, debugMessage, type DebugPiece, ifThen, runTrigger, titleWords, unitIsAlive } from "../triggers/trigger-builders.js";
14
15
  export { NTVE_FUNCTIONS, NTVE_PRESETS, SUB_FUNCTIONS, type FunctionDef, type ParamDef, type PresetDef, type SubFunctionDef } from "../triggers/trigger-catalog.js";
15
16
  export type { ElementId, Trigger, TriggerBlock, TriggerCall, TriggerParam, TriggerVariable } from "../triggers/trigger-model.js";
17
+ export { packageEntries, packageName, type PackageEntries } from "../map/game-packages.js";
18
+ export { gameUnitIds } from "../catalog/tech-catalog.js";
19
+ export { readM3Sequences, type M3Sequence } from "../catalog/m3-sequences.js";
20
+ export { catalogModelAnims, type ModelAnims } from "../catalog/model-anims.js";
21
+ export { definedSounds, workspaceSounds } from "../mods/sound-mix.js";
22
+ export { withCustomScript, withCustomScriptInMapScript } from "../triggers/custom-script.js";
23
+ export { writeMapScript } from "../triggers/write-map-script.js";
24
+ export { workspaceFor, workspaceRootFor, type Workspace } from "./workspace.js";
25
+ export { loadHost, requireCapability } from "../host/host.js";
26
+ export { loadMachineConfig } from "../host/machine-config.js";
27
+ export { runBrokeredCapture } from "../capture/editor-broker-client.js";
@@ -4,7 +4,8 @@
4
4
  // types a Style Pack's rules fill the dresser's and painter's slots with, and what a Host
5
5
  // Adapter's capabilities take, return and read and write images with, and the WhiteoutFlakes
6
6
  // viewer driver the macOS and Windows Host Adapters render and export models with.
7
- export { CAPTURE_MAPS_FOLDER, modelNotFound, defineMechanic, } from "./plugin-api.js";
7
+ export { ownedGame, QUIT_GRACE_SECONDS, quitOwnedGame, refuseForeignGame, sameGame, stillRuns } from "../host/game-ownership.js";
8
+ export { CAPTURE_MAPS_FOLDER, FOREIGN_GAME_REFUSAL, modelNotFound, defineMechanic, } from "./plugin-api.js";
8
9
  export { slugId } from "../domain/mission-blueprint.js";
9
10
  export { COUNTDOWN_TELEGRAPH } from "../domain/threat.js";
10
11
  export { findPackageFile, packageAssetRoots } from "../catalog/package-files.js";
@@ -17,3 +18,17 @@ export { stableObjectId } from "../map/stable-object-id.js";
17
18
  export { behaviorLink, block, call, callValue, pickedUnit, setLighting, stableElementId, triggeringUnit, triggerVariable, turnOffCurrentTrigger, USER_PLAYER, } from "../triggers/build-mission-triggers.js";
18
19
  export { compare, debugMessage, ifThen, runTrigger, titleWords, unitIsAlive } from "../triggers/trigger-builders.js";
19
20
  export { NTVE_FUNCTIONS, NTVE_PRESETS, SUB_FUNCTIONS } from "../triggers/trigger-catalog.js";
21
+ // For a Utility that builds test maps (anim-testbed): the game's packages' ids, the Workspace's own
22
+ // sounds and recorded animations, a model's clips, writing a script into a map, and running a
23
+ // capture tour through the Editor Broker.
24
+ export { packageEntries, packageName } from "../map/game-packages.js";
25
+ export { gameUnitIds } from "../catalog/tech-catalog.js";
26
+ export { readM3Sequences } from "../catalog/m3-sequences.js";
27
+ export { catalogModelAnims } from "../catalog/model-anims.js";
28
+ export { definedSounds, workspaceSounds } from "../mods/sound-mix.js";
29
+ export { withCustomScript, withCustomScriptInMapScript } from "../triggers/custom-script.js";
30
+ export { writeMapScript } from "../triggers/write-map-script.js";
31
+ export { workspaceFor, workspaceRootFor } from "./workspace.js";
32
+ export { loadHost, requireCapability } from "../host/host.js";
33
+ export { loadMachineConfig } from "../host/machine-config.js";
34
+ export { runBrokeredCapture } from "../capture/editor-broker-client.js";
@@ -18,6 +18,7 @@ export const BUNDLED_PACKAGES = {
18
18
  "host-macos": "@team-antioch/sc2-adjutant-host-macos",
19
19
  "host-windows": "@team-antioch/sc2-adjutant-host-windows",
20
20
  "style-antioch": "@team-antioch/sc2-adjutant-style-antioch",
21
+ "anim-testbed": "@team-antioch/sc2-adjutant-anim-testbed",
21
22
  };
22
23
  /** A `bundled:<name>` Plugin whose package isn't installed where core can resolve it. */
23
24
  export class MissingPluginPackageError extends Error {
@@ -1,5 +1,9 @@
1
1
  import { type PluginRegistry } from "./plugin-api.js";
2
2
  import { type PluginRequest } from "./plugin-sources.js";
3
3
  export { isLocalPluginSource, localPluginFolder, MANIFEST_FILE, MissingPluginPackageError, type PluginRequest } from "./plugin-sources.js";
4
+ /** A Plugin's name, as its manifest gives it: lowercase, like an npm package name. */
5
+ export declare const PLUGIN_NAME_PATTERN: RegExp;
6
+ /** An Exemplar Map's id in a Style Pack's list. */
7
+ export declare const EXEMPLAR_ID_PATTERN: RegExp;
4
8
  /** Loads each Plugin in order, relative to the Workspace root, and indexes its Contributions. */
5
9
  export declare function loadPlugins(root: string, requests: readonly PluginRequest[]): Promise<PluginRegistry>;
@@ -45,9 +45,13 @@ const PromptEntrySchema = z
45
45
  file: z.string().min(1),
46
46
  })
47
47
  .strict();
48
+ /** A Plugin's name, as its manifest gives it: lowercase, like an npm package name. */
49
+ export const PLUGIN_NAME_PATTERN = /^[a-z0-9@][a-z0-9@/._-]*$/;
50
+ /** An Exemplar Map's id in a Style Pack's list. */
51
+ export const EXEMPLAR_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
48
52
  const ManifestSchema = z
49
53
  .object({
50
- name: z.string().regex(/^[a-z0-9@][a-z0-9@/._-]*$/, "A Plugin name is lowercase, like an npm package name"),
54
+ name: z.string().regex(PLUGIN_NAME_PATTERN, "A Plugin name is lowercase, like an npm package name"),
51
55
  version: z.string().min(1),
52
56
  /** The plugin API version the Plugin was built for. */
53
57
  pluginApi: z.number().int().positive(),
@@ -94,7 +98,7 @@ const ManifestSchema = z
94
98
  .strict();
95
99
  const ExemplarListSchema = z.object({
96
100
  exemplars: z.array(z.looseObject({
97
- id: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/, "An Exemplar Map id is letters, digits, dots, hyphens or underscores"),
101
+ id: z.string().regex(EXEMPLAR_ID_PATTERN, "An Exemplar Map id is letters, digits, dots, hyphens or underscores"),
98
102
  /** The source map, inside the Workspace's Exemplar Map folder (or absolute). */
99
103
  map: z.string().min(1),
100
104
  provenance: z.enum(EXEMPLAR_PROVENANCES),
@@ -47,6 +47,11 @@ export type ExemplarMapSource = ExemplarMap & {
47
47
  * the Workspace has no Style Pack, or no folder is set.
48
48
  */
49
49
  export declare function exemplarMapSources(workspace: Workspace, machine?: Pick<MachineConfig, "file" | "exemplarMaps">): Promise<ExemplarMapSource[]>;
50
+ /**
51
+ * The folder an Exemplar Map's `map` is found in, as `exemplarMapSources` resolves it: the machine
52
+ * config's `exemplarMaps`, else the Workspace config's. Refused when neither is set.
53
+ */
54
+ export declare function exemplarSourceFolder(workspace: Pick<Workspace, "root" | "exemplarMaps">, machine?: Pick<MachineConfig, "file" | "exemplarMaps">): Promise<string>;
50
55
  /**
51
56
  * Where the active Style Pack keeps the data the exemplar scripts regenerate: the folder of its
52
57
  * Exemplar Maps list (each map's study and layer images, and the mixtures, sit there; their frames are in the research archive) and its Doodad Composites
@@ -119,13 +119,21 @@ export async function exemplarMapSources(workspace, machine) {
119
119
  if (!pack)
120
120
  throw new Error(`The Workspace names no Style Pack (stylePack in ${configPath}), so it has no Exemplar Maps`);
121
121
  const exemplars = workspace.registry.contributions("exemplarMaps").filter((exemplar) => exemplar.plugin === pack);
122
+ const root = await exemplarSourceFolder(workspace, machine);
123
+ return exemplars.map((exemplar) => ({ ...exemplar, source: path.resolve(root, exemplar.map) }));
124
+ }
125
+ /**
126
+ * The folder an Exemplar Map's `map` is found in, as `exemplarMapSources` resolves it: the machine
127
+ * config's `exemplarMaps`, else the Workspace config's. Refused when neither is set.
128
+ */
129
+ export async function exemplarSourceFolder(workspace, machine) {
122
130
  const settings = machine ?? (await loadMachineConfig());
123
131
  const fromWorkspace = workspace.exemplarMaps && path.resolve(workspace.root, workspace.exemplarMaps.replace(/^~(?=$|[\\/])/, os.homedir()));
124
132
  const root = settings.exemplarMaps ?? fromWorkspace;
125
133
  if (!root) {
126
- throw new Error(`No folder for the Exemplar Maps' source maps: set exemplarMaps in the machine config ${settings.file}, or ${MACHINE_ENV.exemplarMaps}`);
134
+ throw new Error(`No folder for the Exemplar Maps' source maps: set exemplarMaps in the machine config ${settings.file}, or ${MACHINE_ENV.exemplarMaps}, or exemplarMaps in the Workspace config ${path.join(workspace.root, WORKSPACE_FILE)} for a folder that travels with the Workspace`);
127
135
  }
128
- return exemplars.map((exemplar) => ({ ...exemplar, source: path.resolve(root, exemplar.map) }));
136
+ return root;
129
137
  }
130
138
  /**
131
139
  * Where the active Style Pack keeps the data the exemplar scripts regenerate: the folder of its
@@ -0,0 +1,76 @@
1
+ import { type MapMeasures, type MeasureId } from "./measures.js";
2
+ export declare const BLIZZARD_CAMPAIGNS: readonly ["Wings of Liberty", "Heart of the Swarm", "Legacy of the Void", "Nova Covert Ops"];
3
+ export type BlizzardCampaign = (typeof BLIZZARD_CAMPAIGNS)[number];
4
+ /** A campaign mission's map: its id (the map file's name), campaign, and folder in the game's storage. */
5
+ export type BlizzardMission = {
6
+ readonly id: string;
7
+ readonly campaign: BlizzardCampaign;
8
+ readonly storagePath: string;
9
+ };
10
+ /**
11
+ * Every map a campaign mission plays on: the main missions with each branch's alternative and the
12
+ * secret mission, Heart of the Swarm's evolution missions, Legacy of the Void's prologue (Whispers of
13
+ * Oblivion, shipped in the Swarm campaign's folder) and epilogue. Left out: the story rooms between
14
+ * missions, the tutorials, the test map, the Lost Viking arcade and the challenge maps, none of
15
+ * which is a mission's battlefield.
16
+ */
17
+ export declare const BLIZZARD_CAMPAIGN_MISSIONS: readonly BlizzardMission[];
18
+ /** How a measure's values spread over the maps that have one: percentiles interpolate between neighbouring values. */
19
+ export type MeasureSpread = {
20
+ readonly maps: number;
21
+ readonly min: number;
22
+ readonly p10: number;
23
+ readonly p25: number;
24
+ readonly median: number;
25
+ readonly p75: number;
26
+ readonly p90: number;
27
+ readonly max: number;
28
+ readonly mean: number;
29
+ };
30
+ /**
31
+ * The spread of `values`, nulls left out; null when none has a value. Unlike a Map Study's
32
+ * quantiles (stats.ts, nearest rank, for reading one map's numbers), the percentiles interpolate:
33
+ * a consistency report compares a mapper's few maps against them, where a step from one map's
34
+ * value to the next would move the edge of the spread.
35
+ */
36
+ export declare function measureSpread(values: readonly (number | null)[]): MeasureSpread | null;
37
+ /** One map the baseline measured. */
38
+ export type BaselineMap = {
39
+ readonly id: string;
40
+ readonly campaign: BlizzardCampaign;
41
+ readonly name?: string;
42
+ };
43
+ /** One measure across the baseline's maps. */
44
+ export type BaselineMeasure = {
45
+ /** What it measures, as MEASURES says. */
46
+ readonly description: string;
47
+ readonly spread: MeasureSpread | null;
48
+ /** Every map's value by its id; null where the map has nothing to measure. */
49
+ readonly maps: Readonly<Record<string, number | null>>;
50
+ };
51
+ /** A campaign mission the install the baseline was built from didn't hold, and why. */
52
+ export type UnavailableMap = {
53
+ readonly id: string;
54
+ readonly campaign: BlizzardCampaign;
55
+ readonly reason: string;
56
+ };
57
+ export type BlizzardBaseline = {
58
+ readonly baselineVersion: number;
59
+ readonly note: string;
60
+ readonly maps: readonly BaselineMap[];
61
+ /** Missions left out because the install held no data for them; a rebuild from a fuller install measures them. */
62
+ readonly unavailable: readonly UnavailableMap[];
63
+ readonly measures: Readonly<Record<MeasureId, BaselineMeasure>>;
64
+ };
65
+ export declare const BLIZZARD_BASELINE_VERSION = 1;
66
+ /** The baseline over `maps`, each with its measures, naming the missions it couldn't measure. */
67
+ export declare function buildBlizzardBaseline(maps: readonly (BaselineMap & {
68
+ readonly measures: MapMeasures;
69
+ })[], unavailable?: readonly UnavailableMap[]): BlizzardBaseline;
70
+ export declare const BLIZZARD_BASELINE_PATH: string;
71
+ /**
72
+ * The shipped baseline. Refused when its file doesn't parse, or its measures aren't the ones core
73
+ * gives (one missing, or one core no longer has), which means core's measures changed without
74
+ * the maintainer rebuilding it.
75
+ */
76
+ export declare function readBlizzardBaseline(file?: string): BlizzardBaseline;