@seriousgaming/sdk-tools 1.0.0-alpha.4 → 1.1.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 +4 -4
- package/dist/brands/awkward/brand.json +16 -0
- package/dist/brands/awkward/logo-on-light.svg +4 -0
- package/dist/brands/serious-gaming/brand.json +42 -0
- package/dist/brands/serious-gaming/fonts/OFL-sora.txt +93 -0
- package/dist/brands/serious-gaming/fonts/OFL-work-sans.txt +93 -0
- package/dist/brands/serious-gaming/fonts/sora-latin-400-normal.woff2 +0 -0
- package/dist/brands/serious-gaming/fonts/sora-latin-600-normal.woff2 +0 -0
- package/dist/brands/serious-gaming/fonts/sora-latin-700-normal.woff2 +0 -0
- package/dist/brands/serious-gaming/fonts/work-sans-latin-wght-normal.woff2 +0 -0
- package/dist/brands/serious-gaming/icon.svg +24 -0
- package/dist/brands/serious-gaming/loader-on-dark.svg +25 -0
- package/dist/brands/serious-gaming/loader-on-light.svg +25 -0
- package/dist/brands/serious-gaming/logo-on-dark.svg +38 -0
- package/dist/brands/serious-gaming/logo-on-light.svg +42 -0
- package/dist/cli.js +20003 -5523
- package/dist/client.js +15534 -1134
- package/dist/core/save-scenario.d.ts +25 -0
- package/dist/core/session-endpoints.d.ts +12 -13
- package/dist/core/session-host.d.ts +9 -1
- package/dist/core/session-writes.d.ts +2 -2
- package/dist/core/session.d.ts +9 -1
- package/dist/dev/brand-summary.d.ts +16 -0
- package/dist/dev/brands.d.ts +213 -0
- package/dist/dev/console/assets/icon-CRaj5uhr.svg +24 -0
- package/dist/dev/console/assets/index-q6-lvlN3.css +1 -0
- package/dist/dev/console/assets/index-qxHcu9fJ.js +204 -0
- package/dist/dev/console/assets/sora-latin-400-normal-CRt88UEn.woff2 +0 -0
- package/dist/dev/console/assets/sora-latin-600-normal-Cdg4DaK0.woff2 +0 -0
- package/dist/dev/console/assets/sora-latin-700-normal-9waGdLWo.woff2 +0 -0
- package/dist/dev/console/assets/work-sans-latin-wght-normal-Bl-S9Xys.woff2 +0 -0
- package/dist/dev/console/index.html +3 -1
- package/dist/dev/routes.d.ts +9 -0
- package/dist/dev/shell.d.ts +14 -0
- package/dist/dev/view/batch.d.ts +0 -2
- package/dist/docs/ai-agents.md +75 -0
- package/dist/docs/api/deck.md +38 -0
- package/dist/docs/api/index.md +5 -5
- package/dist/docs/api/sdk-commands.md +1 -1
- package/dist/docs/api/sdk-e2e.md +1 -0
- package/dist/docs/api/sdk-projection.md +1 -0
- package/dist/docs/api/sdk-testing.md +52 -1
- package/dist/docs/api/sdk-tools-client.md +1 -0
- package/dist/docs/api/sdk-ui-testing.md +30 -4
- package/dist/docs/api/sdk-ui.md +166 -0
- package/dist/docs/api/sdk.md +70 -4
- package/dist/docs/changelog.md +64 -6
- package/dist/docs/cli-and-dev-server.md +2 -0
- package/dist/docs/cli-error-codes.md +65 -59
- package/dist/docs/cli-reference.md +84 -45
- package/dist/docs/concepts/index.md +74 -6
- package/dist/docs/concepts/terminology.md +17 -11
- package/dist/docs/getting-started.md +30 -11
- package/dist/docs/guides/ai-facilitation.md +5 -1
- package/dist/docs/guides/capabilities.md +3 -1
- package/dist/docs/guides/designing-a-game.md +85 -0
- package/dist/docs/guides/endpoints.md +57 -13
- package/dist/docs/guides/engine-testing.md +4 -13
- package/dist/docs/guides/engine.md +14 -2
- package/dist/docs/guides/file-handling.md +14 -10
- package/dist/docs/guides/games.md +2 -8
- package/dist/docs/guides/guide.md +64 -3
- package/dist/docs/guides/index.md +3 -4
- package/dist/docs/guides/internationalization.md +8 -14
- package/dist/docs/guides/llm-integration.md +19 -31
- package/dist/docs/guides/multi-team-games.md +9 -14
- package/dist/docs/guides/patterns.md +0 -6
- package/dist/docs/guides/presentation.md +6 -10
- package/dist/docs/guides/production-constraints.md +2 -9
- package/dist/docs/guides/scenario-editor.md +11 -11
- package/dist/docs/guides/scenarios.md +26 -14
- package/dist/docs/guides/session.md +29 -35
- package/dist/docs/guides/settings.md +28 -2
- package/dist/docs/guides/setup.md +2 -7
- package/dist/docs/guides/speech-generation.md +8 -17
- package/dist/docs/guides/starter-game.md +2 -1
- package/dist/docs/guides/testing.md +45 -43
- package/dist/docs/guides/theming-and-branding.md +194 -0
- package/dist/docs/guides/tick-controller.md +8 -4
- package/dist/docs/guides/type-safety.md +8 -6
- package/dist/docs/guides/ui.md +41 -62
- package/dist/docs/guides/upgrading.md +28 -3
- package/dist/docs/guides/validators.md +64 -3
- package/dist/docs/guides/waiting-room.md +3 -10
- package/dist/docs/index.md +40 -10
- package/dist/docs/recipes/adapt-ui-for-observers.md +1 -1
- package/dist/docs/recipes/call-endpoint-from-ui.md +2 -0
- package/dist/docs/recipes/create-capability.md +1 -1
- package/dist/docs/recipes/create-endpoint.md +7 -2
- package/dist/docs/recipes/create-engine.md +1 -1
- package/dist/docs/recipes/create-guide.md +2 -2
- package/dist/docs/recipes/create-hook.md +1 -1
- package/dist/docs/recipes/create-session-ui.md +1 -1
- package/dist/docs/recipes/create-settings.md +1 -1
- package/dist/docs/recipes/create-tick-controller.md +1 -1
- package/dist/docs/recipes/create-user-interface.md +1 -1
- package/dist/docs/recipes/create-validator.md +1 -1
- package/dist/docs/recipes/declare-api-uses.md +2 -2
- package/dist/docs/recipes/design-state-for-concurrent-writes.md +2 -2
- package/dist/docs/recipes/distribute-package.md +3 -3
- package/dist/docs/recipes/e2e-testing.md +11 -9
- package/dist/docs/recipes/index.md +6 -2
- package/dist/docs/recipes/make-a-guide-follow-the-scenario.md +89 -0
- package/dist/docs/recipes/make-an-endpoint-external.md +1 -1
- package/dist/docs/recipes/publish-a-package.md +1 -1
- package/dist/docs/recipes/remember-a-viewers-choice.md +1 -1
- package/dist/docs/recipes/review-a-past-day.md +4 -2
- package/dist/docs/recipes/share-assets-across-scenarios.md +3 -3
- package/dist/docs/recipes/share-logic-between-engine-and-ui.md +1 -1
- package/dist/docs/recipes/test-a-multi-role-game.md +1 -1
- package/dist/docs/recipes/test-user-interface.md +13 -2
- package/dist/docs/recipes/validate-scenarios.md +91 -0
- package/dist/docs/troubleshooting.md +44 -2
- package/dist/execution/blob-inputs.d.ts +7 -2
- package/dist/execution/config-resolver.d.ts +10 -0
- package/dist/execution/endpoint-runner.d.ts +8 -1
- package/dist/execution/executor-callbacks.d.ts +7 -0
- package/dist/execution/executor.d.ts +11 -0
- package/dist/execution/logic-calls.d.ts +8 -1
- package/dist/execution/scenario-gates.d.ts +34 -0
- package/dist/guide/effective-guide.d.ts +20 -0
- package/dist/guide/locale.d.ts +12 -0
- package/dist/guide/settings.d.ts +67 -0
- package/dist/host/host-channel.d.ts +11 -2
- package/dist/host/index.d.ts +7 -1
- package/dist/host/protocol.d.ts +49 -5
- package/dist/host/theme.d.ts +28 -2
- package/dist/host.js +11490 -15
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/manifest-version.d.ts +17 -0
- package/dist/runtime.js +12 -1
- package/dist/schema.json +32 -4
- package/dist/storage/blob-store.d.ts +3 -2
- package/dist/templates/endpoint/logic.test.ts.liquid +19 -1
- package/dist/templates/endpoint/logic.ts.liquid +18 -0
- package/dist/templates/hook/logic.test.ts.liquid +2 -2
- package/dist/templates/package/CLAUDE.md.template +5 -2
- package/dist/templates/package/README.md.liquid +2 -0
- package/dist/templates/package/claude/rules/workflow-create-endpoint.md +5 -4
- package/dist/templates/package/claude/rules/workflow-create-guide.md +1 -0
- package/dist/templates/presentation/src/App.tsx.liquid +5 -11
- package/dist/templates/session/src/App.test.tsx.liquid +2 -4
- package/dist/templates/session/src/theme.ts.liquid +26 -33
- package/dist/templates/settings-editor/src/theme.ts.liquid +13 -18
- package/dist/templates/starter-game/hooks/assignproducts/logic/logic.test.ts +2 -8
- package/dist/templates/starter-game/session/src/App.test.tsx +6 -10
- package/dist/templates/starter-game/session/src/theme.ts +26 -33
- package/dist/templates/starter-game/ui/src/App.tsx +2 -0
- package/dist/templates/starter-game/ui/src/HostLogo.test.tsx +25 -0
- package/dist/templates/starter-game/ui/src/HostLogo.tsx +38 -0
- package/dist/templates/starter-game/ui/src/theme.ts +26 -33
- package/dist/templates/starter-game/validators/capacity/types.ts +2 -0
- package/dist/templates/starter-game/waiting_room/src/theme.ts +26 -33
- package/dist/templates/ui/src/App.test.tsx.liquid +7 -19
- package/dist/templates/ui/src/theme.ts.liquid +26 -33
- package/dist/templates/validator/logic.ts.liquid +4 -0
- package/dist/templates/waiting-room/src/App.test.tsx.liquid +17 -31
- package/dist/templates/waiting-room/src/theme.ts.liquid +26 -33
- package/dist/utils/error-codes.d.ts +15 -3
- package/dist/validation/ajv.d.ts +9 -5
- package/dist/validation/facilitator-guide-validator.d.ts +6 -0
- package/dist/validation/file-settings.d.ts +49 -0
- package/dist/validation/guide-settings-validator.d.ts +26 -0
- package/package.json +6 -5
- package/dist/dev/console/assets/index-DgFglsnA.js +0 -204
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Save-as-scenario for the dev server (§6.7.1, §6.7.2): the session's resolved
|
|
3
|
+
* settings, or the scenario editor's draft, captured as a package scenario.
|
|
4
|
+
*
|
|
5
|
+
* Kept apart from the HTTP route so a caller with no transport, the core
|
|
6
|
+
* conformance driver, saves through the same code the console does.
|
|
7
|
+
*/
|
|
8
|
+
import { type PackageScenarioErrorCode } from './package-scenario';
|
|
9
|
+
import type { Session } from './session';
|
|
10
|
+
export interface SaveScenarioRequest {
|
|
11
|
+
identifier: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
overwrite?: boolean;
|
|
14
|
+
/** Save the scenario editor's draft of `identifier` over it, rather than the session. */
|
|
15
|
+
draft?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export type SaveScenarioErrorCode = PackageScenarioErrorCode | 'no-draft' | 'denied';
|
|
18
|
+
export declare class SaveScenarioError extends Error {
|
|
19
|
+
readonly code: SaveScenarioErrorCode;
|
|
20
|
+
constructor(code: SaveScenarioErrorCode, message: string);
|
|
21
|
+
}
|
|
22
|
+
/** Throws a {@link SaveScenarioError} for a save refused before anything is written. */
|
|
23
|
+
export declare function saveSessionScenario(session: Session, packagePath: string, request: SaveScenarioRequest): Promise<{
|
|
24
|
+
identifier: string;
|
|
25
|
+
}>;
|
|
@@ -37,23 +37,22 @@ export declare class SessionEndpoints {
|
|
|
37
37
|
* failure; {@link answer} turns the throw into an `EndpointFailure`.
|
|
38
38
|
*/
|
|
39
39
|
private call;
|
|
40
|
-
/** Whether the scenario editor made this call, which runs with no session (§6.5). */
|
|
41
|
-
private fromScenarioEditor;
|
|
42
40
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* roster, and a caller with no session. The build refuses an editor that
|
|
48
|
-
* lists an endpoint needing more, but the dev server runs a package the
|
|
49
|
-
* build refuses, so the call is refused here as well.
|
|
41
|
+
* Whether this call is made on a scenario draft rather than the session
|
|
42
|
+
* (§6.12): the scenario editor's always, since it has no session, and any
|
|
43
|
+
* other caller's when it names the scenario whose draft it is writing, as
|
|
44
|
+
* an authoring agent does.
|
|
50
45
|
*/
|
|
51
|
-
private
|
|
46
|
+
private onDraft;
|
|
47
|
+
/** Whether the scenario editor made this call (§6.5). */
|
|
48
|
+
private fromScenarioEditor;
|
|
52
49
|
/**
|
|
53
|
-
*
|
|
54
|
-
* the
|
|
50
|
+
* A call to a scenario-scoped endpoint, on a draft (§6.12). The handler is
|
|
51
|
+
* given the settings as the draft resolves them and nothing of the session
|
|
52
|
+
* this host happens to be running beside it. Whoever makes the call is the
|
|
53
|
+
* scenario's author, an agent calling from outside the game included.
|
|
55
54
|
*/
|
|
56
|
-
private
|
|
55
|
+
private callOnDraft;
|
|
57
56
|
/**
|
|
58
57
|
* Carry out what an endpoint returned (§6.12): its write, then its per-team
|
|
59
58
|
* writes, then its actions, as one job on the queue, so no other mutation
|
|
@@ -55,10 +55,12 @@ export interface SessionHost {
|
|
|
55
55
|
/**
|
|
56
56
|
* What a call from the scenario editor resolves against (§6.5, §6.12):
|
|
57
57
|
* the scenario it is editing, and its draft over that scenario's
|
|
58
|
-
* settings, the `game` settings included
|
|
58
|
+
* settings, the `game` settings included, and its display name. Absent
|
|
59
|
+
* names the one in force.
|
|
59
60
|
*/
|
|
60
61
|
scenarioBeingEdited(scenarioId: string | null | undefined): {
|
|
61
62
|
settings: Record<string, Record<string, unknown>>;
|
|
63
|
+
scenarioName: string | null;
|
|
62
64
|
};
|
|
63
65
|
teamBounds(): TeamBounds;
|
|
64
66
|
tickLimit(): number | null;
|
|
@@ -83,6 +85,12 @@ export interface SessionHost {
|
|
|
83
85
|
applyPendingChanges(): Promise<number>;
|
|
84
86
|
/** Delete this run's blobs of the given retentions (§16.2). */
|
|
85
87
|
clearBlobs(retentions: readonly BlobRetention[]): Promise<void>;
|
|
88
|
+
/** A stored blob's type, size and retention, by `blob:` reference, or undefined for none. */
|
|
89
|
+
describeBlob(reference: string): Promise<{
|
|
90
|
+
mimeType: string;
|
|
91
|
+
size: number;
|
|
92
|
+
retention: BlobRetention;
|
|
93
|
+
} | undefined>;
|
|
86
94
|
/** Queue `work` as one operation (§9.7, §10.2). */
|
|
87
95
|
enqueue<T>(work: () => Promise<T>): Promise<T>;
|
|
88
96
|
/** Run one command now, inside whatever job is already running. */
|
|
@@ -25,7 +25,7 @@ export declare function updateSharedContext(host: WriteHost, command: Extract<Mu
|
|
|
25
25
|
type: 'updateSharedContext';
|
|
26
26
|
}>): Promise<number>;
|
|
27
27
|
/** A change to the session's settings layer (§8.2). */
|
|
28
|
-
export declare function updateSettings(host: Pick<SessionHost, 'executor' | 'declaredSurface'>, command: Extract<MutationCommand, {
|
|
28
|
+
export declare function updateSettings(host: Pick<SessionHost, 'executor' | 'declaredSurface' | 'describeBlob'>, command: Extract<MutationCommand, {
|
|
29
29
|
type: 'updateSettings';
|
|
30
30
|
}>): Promise<undefined>;
|
|
31
31
|
/**
|
|
@@ -34,7 +34,7 @@ export declare function updateSettings(host: Pick<SessionHost, 'executor' | 'dec
|
|
|
34
34
|
* Reduced to what changed against the draft as it resolves now, as the
|
|
35
35
|
* session layer is, so an editor echoing back what it was sent stores nothing.
|
|
36
36
|
*/
|
|
37
|
-
export declare function updateScenarioDraft(host: Pick<SessionHost, 'executor' | 'declaredSurface'>, drafts: ScenarioDrafts, command: Extract<MutationCommand, {
|
|
37
|
+
export declare function updateScenarioDraft(host: Pick<SessionHost, 'executor' | 'declaredSurface' | 'describeBlob'>, drafts: ScenarioDrafts, command: Extract<MutationCommand, {
|
|
38
38
|
type: 'updateScenarioDraft';
|
|
39
39
|
}>): Promise<undefined>;
|
|
40
40
|
export {};
|
package/dist/core/session.d.ts
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
*/
|
|
28
28
|
import type { ResolvedPackageManifest, RunKind, SDKFacilitatorGuide, SDKScenario, SignatureCallbacks } from '@seriousgaming/sdk';
|
|
29
29
|
import { type EndpointAuditEntry, type MutationResult, type ResolvedSettings, type StateProjection } from '@seriousgaming/sdk/projection';
|
|
30
|
+
import { type EffectiveGuide } from '../guide/effective-guide';
|
|
30
31
|
import { type Clock } from './clock';
|
|
31
32
|
import { type PendingChanges } from './pending-changes';
|
|
32
33
|
import { type Command, type Event, type MutationCommand, type QueryCommand, type QueryResult } from './protocol';
|
|
@@ -104,6 +105,7 @@ export declare class Session {
|
|
|
104
105
|
private readonly clock;
|
|
105
106
|
private options;
|
|
106
107
|
private readonly listeners;
|
|
108
|
+
private guideCache;
|
|
107
109
|
/** Operator-facing failures, oldest first (§14.5, and tick failures). */
|
|
108
110
|
private readonly errors;
|
|
109
111
|
private seed;
|
|
@@ -264,8 +266,14 @@ export declare class Session {
|
|
|
264
266
|
* one (§8.3).
|
|
265
267
|
*/
|
|
266
268
|
private applyPendingChanges;
|
|
267
|
-
/** The facilitator guide this package declares, or null (§6.
|
|
269
|
+
/** The facilitator guide this package declares, or null (§6.13). */
|
|
268
270
|
guide(): SDKFacilitatorGuide | null;
|
|
271
|
+
/**
|
|
272
|
+
* The guide as this session reads it: its declared settings resolved, and
|
|
273
|
+
* the chapters they leave empty dropped. Null when the package declares no
|
|
274
|
+
* guide or none of its chapters is left to show (§6.13.5).
|
|
275
|
+
*/
|
|
276
|
+
effectiveGuide(): EffectiveGuide | null;
|
|
269
277
|
subscribe(listener: (event: Event) => void): () => void;
|
|
270
278
|
private apply;
|
|
271
279
|
/** Returns the tick a write committed into, where that is meaningful. */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ThemeInput } from '../host';
|
|
2
|
+
/**
|
|
3
|
+
* A brand as the console is handed it: its theme before `contrastText`, every
|
|
4
|
+
* file it names a URL on the asset origin (§12.3). Apart from `brands.ts` so
|
|
5
|
+
* the console, which runs in a browser, can name it without reading Node.
|
|
6
|
+
*/
|
|
7
|
+
export interface DevBrandSummary {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
/** The host's loading animation for each background, for the console's own loading screen. */
|
|
11
|
+
loader?: {
|
|
12
|
+
onLight?: string;
|
|
13
|
+
onDark?: string;
|
|
14
|
+
};
|
|
15
|
+
theme: Omit<ThemeInput, 'mode'>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The brands the dev server can dress a game in (§12.3): Serious Gaming, no
|
|
3
|
+
* brand at all, an awkward test brand, and any brand file passed with
|
|
4
|
+
* `--brand`.
|
|
5
|
+
*
|
|
6
|
+
* A brand file is JSON beside the files it names, which are relative to it.
|
|
7
|
+
* The server serves those files from the asset origin, as a real host has to
|
|
8
|
+
* under the bundle policy (§16.5), and hands the console a theme whose URLs
|
|
9
|
+
* point there. The console gives the colours their `contrastText`.
|
|
10
|
+
*/
|
|
11
|
+
import type { Brand, BrandFont } from '@seriousgaming/sdk/ui';
|
|
12
|
+
import type { ModeColoursInput } from '../host';
|
|
13
|
+
import type { DevBrandSummary } from './brand-summary';
|
|
14
|
+
export type { DevBrandSummary };
|
|
15
|
+
declare const ROLES: readonly ["primary", "secondary", "success", "error", "warning", "info"];
|
|
16
|
+
declare const NEUTRALS: readonly ["background", "surface", "text"];
|
|
17
|
+
/** What a brand file may hold. Exported so the docs and an editor can use it. */
|
|
18
|
+
export declare const BRAND_FILE_SCHEMA: {
|
|
19
|
+
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
20
|
+
readonly title: "Serious Gaming dev server brand";
|
|
21
|
+
readonly type: "object";
|
|
22
|
+
readonly required: readonly ["name"];
|
|
23
|
+
readonly properties: {
|
|
24
|
+
readonly $schema: {
|
|
25
|
+
readonly type: "string";
|
|
26
|
+
};
|
|
27
|
+
readonly name: {
|
|
28
|
+
readonly type: "string";
|
|
29
|
+
readonly minLength: 1;
|
|
30
|
+
};
|
|
31
|
+
readonly light: {
|
|
32
|
+
readonly type: "object";
|
|
33
|
+
readonly properties: {
|
|
34
|
+
[k: string]: {
|
|
35
|
+
readonly type: "string";
|
|
36
|
+
readonly minLength: 1;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
readonly additionalProperties: false;
|
|
40
|
+
};
|
|
41
|
+
readonly dark: {
|
|
42
|
+
readonly type: "object";
|
|
43
|
+
readonly properties: {
|
|
44
|
+
[k: string]: {
|
|
45
|
+
readonly type: "string";
|
|
46
|
+
readonly minLength: 1;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
readonly additionalProperties: false;
|
|
50
|
+
};
|
|
51
|
+
readonly logo: {
|
|
52
|
+
readonly type: "object";
|
|
53
|
+
readonly properties: {
|
|
54
|
+
readonly onLight: {
|
|
55
|
+
readonly type: "string";
|
|
56
|
+
};
|
|
57
|
+
readonly onDark: {
|
|
58
|
+
readonly type: "string";
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
readonly additionalProperties: false;
|
|
62
|
+
};
|
|
63
|
+
readonly loader: {
|
|
64
|
+
readonly type: "object";
|
|
65
|
+
readonly properties: {
|
|
66
|
+
readonly onLight: {
|
|
67
|
+
readonly type: "string";
|
|
68
|
+
};
|
|
69
|
+
readonly onDark: {
|
|
70
|
+
readonly type: "string";
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
readonly additionalProperties: false;
|
|
74
|
+
};
|
|
75
|
+
readonly icon: {
|
|
76
|
+
readonly type: "string";
|
|
77
|
+
readonly minLength: 1;
|
|
78
|
+
};
|
|
79
|
+
readonly fonts: {
|
|
80
|
+
readonly type: "object";
|
|
81
|
+
readonly properties: {
|
|
82
|
+
readonly heading: {
|
|
83
|
+
readonly type: "object";
|
|
84
|
+
readonly required: readonly ["family", "sources"];
|
|
85
|
+
readonly properties: {
|
|
86
|
+
readonly family: {
|
|
87
|
+
readonly type: "string";
|
|
88
|
+
readonly minLength: 1;
|
|
89
|
+
};
|
|
90
|
+
readonly sources: {
|
|
91
|
+
readonly type: "array";
|
|
92
|
+
readonly minItems: 1;
|
|
93
|
+
readonly items: {
|
|
94
|
+
readonly type: "object";
|
|
95
|
+
readonly required: readonly ["url"];
|
|
96
|
+
readonly properties: {
|
|
97
|
+
readonly url: {
|
|
98
|
+
readonly type: "string";
|
|
99
|
+
readonly minLength: 1;
|
|
100
|
+
};
|
|
101
|
+
readonly weight: {
|
|
102
|
+
readonly type: "string";
|
|
103
|
+
readonly minLength: 1;
|
|
104
|
+
};
|
|
105
|
+
readonly style: {
|
|
106
|
+
readonly type: "string";
|
|
107
|
+
readonly minLength: 1;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
readonly additionalProperties: false;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
readonly additionalProperties: false;
|
|
115
|
+
};
|
|
116
|
+
readonly body: {
|
|
117
|
+
readonly type: "object";
|
|
118
|
+
readonly required: readonly ["family", "sources"];
|
|
119
|
+
readonly properties: {
|
|
120
|
+
readonly family: {
|
|
121
|
+
readonly type: "string";
|
|
122
|
+
readonly minLength: 1;
|
|
123
|
+
};
|
|
124
|
+
readonly sources: {
|
|
125
|
+
readonly type: "array";
|
|
126
|
+
readonly minItems: 1;
|
|
127
|
+
readonly items: {
|
|
128
|
+
readonly type: "object";
|
|
129
|
+
readonly required: readonly ["url"];
|
|
130
|
+
readonly properties: {
|
|
131
|
+
readonly url: {
|
|
132
|
+
readonly type: "string";
|
|
133
|
+
readonly minLength: 1;
|
|
134
|
+
};
|
|
135
|
+
readonly weight: {
|
|
136
|
+
readonly type: "string";
|
|
137
|
+
readonly minLength: 1;
|
|
138
|
+
};
|
|
139
|
+
readonly style: {
|
|
140
|
+
readonly type: "string";
|
|
141
|
+
readonly minLength: 1;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
readonly additionalProperties: false;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
readonly additionalProperties: false;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
readonly additionalProperties: false;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
readonly additionalProperties: false;
|
|
155
|
+
};
|
|
156
|
+
type ModeFile = Partial<Record<(typeof ROLES)[number] | (typeof NEUTRALS)[number], string>>;
|
|
157
|
+
/** A brand file, as {@link BRAND_FILE_SCHEMA} admits it. */
|
|
158
|
+
export interface BrandFile {
|
|
159
|
+
name: string;
|
|
160
|
+
light?: ModeFile;
|
|
161
|
+
dark?: ModeFile;
|
|
162
|
+
logo?: {
|
|
163
|
+
onLight?: string;
|
|
164
|
+
onDark?: string;
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* An animation for the dev server's own loading screen, as a white-label
|
|
168
|
+
* host would show its own. Never sent to a game.
|
|
169
|
+
*/
|
|
170
|
+
loader?: {
|
|
171
|
+
onLight?: string;
|
|
172
|
+
onDark?: string;
|
|
173
|
+
};
|
|
174
|
+
icon?: string;
|
|
175
|
+
fonts?: {
|
|
176
|
+
heading?: BrandFont;
|
|
177
|
+
body?: BrandFont;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/** One brand the console can pick. */
|
|
181
|
+
export interface DevBrand {
|
|
182
|
+
/** Stable for the life of the server, and the brand's path on the asset origin. */
|
|
183
|
+
id: string;
|
|
184
|
+
name: string;
|
|
185
|
+
/** The directory its files are served from; absent for a brand with none. */
|
|
186
|
+
root?: string;
|
|
187
|
+
light: ModeColoursInput;
|
|
188
|
+
dark: ModeColoursInput;
|
|
189
|
+
/** The brand as sent, its file paths still relative to `root`. */
|
|
190
|
+
brand: Brand;
|
|
191
|
+
/** The host's loading animation, relative to `root`, which the console alone shows. */
|
|
192
|
+
loader?: {
|
|
193
|
+
onLight?: string;
|
|
194
|
+
onDark?: string;
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
export declare const SERIOUS_GAMING = "serious-gaming";
|
|
198
|
+
export declare const PLAIN = "plain";
|
|
199
|
+
/**
|
|
200
|
+
* Where the built-in brands' files are: beside this module from source
|
|
201
|
+
* (`cli/dev/brands/`), and beside the bundled entry point once published
|
|
202
|
+
* (`dist/brands/`, which the build copies).
|
|
203
|
+
*/
|
|
204
|
+
export declare function builtInBrandsDirectory(): string;
|
|
205
|
+
/** Read and check one brand file, throwing a {@link CliError} that names what is wrong. */
|
|
206
|
+
export declare function readBrandFile(path: string, id: string, defaults: DevBrand): DevBrand;
|
|
207
|
+
/**
|
|
208
|
+
* Every brand the console offers, the ones passed with `--brand` first, in
|
|
209
|
+
* the order given, then the built-in three.
|
|
210
|
+
*/
|
|
211
|
+
export declare function loadBrands(brandFiles?: readonly string[]): DevBrand[];
|
|
212
|
+
/** A brand as the console needs it: every file it names a URL on the asset origin. */
|
|
213
|
+
export declare function summarise(brand: DevBrand, assetOrigin: string): DevBrandSummary;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg id="logos" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300">
|
|
3
|
+
<defs>
|
|
4
|
+
<style>
|
|
5
|
+
.cls-1 {
|
|
6
|
+
fill: #414042;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.cls-2 {
|
|
10
|
+
fill: #6b00ff;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@media (prefers-color-scheme: dark) {
|
|
14
|
+
.cls-1 {
|
|
15
|
+
fill: #fff;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
</style>
|
|
19
|
+
</defs>
|
|
20
|
+
<path class="cls-1" d="M134.97,39.43v40.1H60.92v17.38h39.03c12.03,0,22.19,4.28,30.48,12.56s12.56,18.18,12.56,30.21v17.38c0,12.03-4.28,22.19-12.56,30.48-8.29,8.29-18.18,12.3-30.21,12.3H20.82v-40.1h79.4v-20.05h-39.03c-12.03,0-22.19-4.01-30.74-12.3-8.29-8.29-12.56-18.45-12.56-30.21v-14.7c0-12.03,4.28-22.19,12.56-30.48,8.29-8.29,18.45-12.56,30.47-12.56h74.05Z"/>
|
|
21
|
+
<rect class="cls-2" x="21.19" y="221.8" width="209.84" height="35.87"/>
|
|
22
|
+
<path class="cls-1" d="M276.82,39.43v42.77h-74.85v74.85h37.42v-17.38h-21.12v-31.81h63.89v49.19c0,12.03-4.28,22.19-12.56,30.47-8.29,8.29-18.18,12.3-30.21,12.3h-37.16c-12.03,0-22.19-4.28-30.47-12.56-8.29-8.29-12.56-18.45-12.56-30.48v-74.58c0-12.03,4.01-21.92,12.3-30.21,8.29-8.29,18.45-12.56,30.47-12.56h74.85Z"/>
|
|
23
|
+
<path class="cls-1" d="M273.16,228.24v23.32H26.88v-23.32h246.28ZM282.16,219.24H17.88v41.32h264.28v-41.32h0Z"/>
|
|
24
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@font-face{font-family:Work Sans;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/work-sans-latin-wght-normal-Bl-S9Xys.woff2)format("woff2")}@font-face{font-family:Sora;font-style:normal;font-weight:400;font-display:swap;src:url(/assets/sora-latin-400-normal-CRt88UEn.woff2)format("woff2")}@font-face{font-family:Sora;font-style:normal;font-weight:600;font-display:swap;src:url(/assets/sora-latin-600-normal-Cdg4DaK0.woff2)format("woff2")}@font-face{font-family:Sora;font-style:normal;font-weight:700;font-display:swap;src:url(/assets/sora-latin-700-normal-9waGdLWo.woff2)format("woff2")}
|