@seriousgaming/sdk-tools 1.2.0 → 1.4.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/dist/cli.js +3582 -2834
- package/dist/client.js +1145 -543
- package/dist/core/participant-registry.d.ts +6 -0
- package/dist/core/session-host.d.ts +4 -2
- package/dist/core/session-roster.d.ts +4 -1
- package/dist/core/settings-locks.d.ts +27 -2
- package/dist/dev/console/assets/{index-BNLEVOQA.js → index-BvB-LFQZ.js} +47 -47
- package/dist/dev/console/index.html +1 -1
- package/dist/dev/routes.d.ts +4 -0
- package/dist/dev/view/batch.d.ts +24 -10
- package/dist/dev/view/view.d.ts +2 -1
- package/dist/docs/api/index.md +2 -2
- package/dist/docs/api/sdk-commands.md +4 -0
- package/dist/docs/api/sdk-e2e.md +4 -0
- package/dist/docs/api/sdk-tools-client.md +5 -0
- package/dist/docs/api/sdk-ui-testing.md +1 -0
- package/dist/docs/api/sdk-ui.md +33 -1
- package/dist/docs/api/sdk.md +82 -3
- package/dist/docs/changelog.md +41 -0
- package/dist/docs/concepts/terminology.md +1 -1
- package/dist/docs/guides/capabilities.md +2 -0
- package/dist/docs/guides/endpoints.md +2 -2
- package/dist/docs/guides/engine-testing.md +1 -1
- package/dist/docs/guides/file-handling.md +113 -21
- package/dist/docs/guides/llm-integration.md +1 -1
- package/dist/docs/guides/presentation.md +23 -9
- package/dist/docs/guides/scenario-editor.md +1 -1
- package/dist/docs/guides/scenarios.md +9 -1
- package/dist/docs/guides/session.md +47 -8
- package/dist/docs/guides/settings.md +62 -2
- package/dist/docs/guides/testing.md +9 -0
- package/dist/docs/guides/ui.md +33 -0
- package/dist/docs/guides/upgrading.md +11 -0
- package/dist/docs/guides/validators.md +62 -4
- package/dist/docs/guides/waiting-room.md +2 -0
- package/dist/docs/recipes/upload-and-display-files.md +7 -7
- package/dist/docs/recipes/validate-scenarios.md +4 -1
- package/dist/execution/endpoint-runner.d.ts +6 -0
- package/dist/execution/logic-calls.d.ts +7 -2
- package/dist/execution/scenario-gates.d.ts +21 -1
- package/dist/guide/settings.d.ts +1 -1
- package/dist/host/protocol.d.ts +27 -2
- package/dist/host.js +64 -2
- package/dist/runtime/manifest-version.d.ts +1 -1
- package/dist/runtime.js +9 -2
- package/dist/storage/asset-resolver.d.ts +24 -1
- package/dist/storage/blob-store.d.ts +7 -0
- package/dist/utils/local-refs.d.ts +40 -0
- package/dist/utils/schema-members.d.ts +19 -0
- package/package.json +3 -3
|
@@ -26,6 +26,12 @@
|
|
|
26
26
|
* (§14).
|
|
27
27
|
*/
|
|
28
28
|
import { EventEmitter } from 'events';
|
|
29
|
+
/**
|
|
30
|
+
* Longest name a participant may give themselves (§12.5). Their name reaches
|
|
31
|
+
* the host's own chrome and every roster, as a team's does, so it takes the
|
|
32
|
+
* team name's ceiling.
|
|
33
|
+
*/
|
|
34
|
+
export declare const MAX_PARTICIPANT_NAME_LENGTH = 60;
|
|
29
35
|
export interface ParticipantRecord {
|
|
30
36
|
id: string;
|
|
31
37
|
teamId: string;
|
|
@@ -55,12 +55,14 @@ 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,
|
|
59
|
-
* names the one in
|
|
58
|
+
* settings, the `game` settings included, its display name, and the
|
|
59
|
+
* root its `asset:` references resolve against. Absent names the one in
|
|
60
|
+
* force.
|
|
60
61
|
*/
|
|
61
62
|
scenarioBeingEdited(scenarioId: string | null | undefined): {
|
|
62
63
|
settings: Record<string, Record<string, unknown>>;
|
|
63
64
|
scenarioName: string | null;
|
|
65
|
+
scenarioRoot: string | null;
|
|
64
66
|
};
|
|
65
67
|
teamBounds(): TeamBounds;
|
|
66
68
|
tickLimit(): number | null;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import type { Participant } from '@seriousgaming/sdk';
|
|
14
14
|
import type { ResolvedGameSettings } from './game-settings';
|
|
15
|
-
import type
|
|
15
|
+
import { type ParticipantRecord } from './participant-registry';
|
|
16
16
|
import type { MutationCommand } from './protocol';
|
|
17
17
|
import type { SessionHost, TeamBounds } from './session-host';
|
|
18
18
|
/**
|
|
@@ -105,6 +105,9 @@ export declare class SessionRoster {
|
|
|
105
105
|
renameOwnTeam(command: Extract<MutationCommand, {
|
|
106
106
|
type: 'renameOwnTeam';
|
|
107
107
|
}>): undefined;
|
|
108
|
+
renameSelf(command: Extract<MutationCommand, {
|
|
109
|
+
type: 'renameSelf';
|
|
110
|
+
}>): undefined;
|
|
108
111
|
addParticipant(teamId: string, name?: string): Promise<undefined>;
|
|
109
112
|
renameParticipant(participantId: string, name: string): undefined;
|
|
110
113
|
moveParticipant(participantId: string, toTeamId: string): Promise<undefined>;
|
|
@@ -6,11 +6,36 @@ import type { JSONSchema7 } from 'json-schema';
|
|
|
6
6
|
* resolve: an override naming a locked value is refused, so none ever reaches
|
|
7
7
|
* the resolver. A locked object locks everything under it.
|
|
8
8
|
*/
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* The paths a settings schema locks, each as its keys below the resource.
|
|
11
|
+
* Locks sit on named properties alone (§6.1a), reached through a local
|
|
12
|
+
* `$ref` as through one written in place. A shape that holds itself through
|
|
13
|
+
* named properties is followed once along any path, since a schema alone
|
|
14
|
+
* cannot say how deep a value will go; {@link lockedPathsNamed} follows the
|
|
15
|
+
* value instead.
|
|
16
|
+
*/
|
|
10
17
|
export declare function lockedPaths(schema: JSONSchema7 | undefined): string[][];
|
|
11
18
|
/** The locked paths an override of one settings resource names. */
|
|
12
19
|
export declare function lockedPathsNamed(override: unknown, schema: JSONSchema7 | undefined): string[][];
|
|
13
|
-
/** A
|
|
20
|
+
/** A `readOnly` the runtime cannot enforce, inside a list's items or a map's entries. */
|
|
21
|
+
export interface UnenforceableLock {
|
|
22
|
+
/** Where the lock sits: `[]` steps into a list's items, `*` or `/pattern/` into a map's entries. */
|
|
23
|
+
path: string[];
|
|
24
|
+
/** The list or map to lock instead. */
|
|
25
|
+
container: string[];
|
|
26
|
+
kind: 'list' | 'map';
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Every `readOnly` beneath `items`, `additionalProperties` or
|
|
30
|
+
* `patternProperties` (§6.1a). Scenarios add and remove a list's items and a
|
|
31
|
+
* map's entries, so there is no single game value for such a lock to keep;
|
|
32
|
+
* the build refuses it, and the list or map is locked whole instead. A lock
|
|
33
|
+
* on the list or map itself covers all beneath it, so the walk stops there.
|
|
34
|
+
*/
|
|
35
|
+
export declare function unenforceableLocks(schema: JSONSchema7): UnenforceableLock[];
|
|
36
|
+
/** An {@link UnenforceableLock} as a build error line. */
|
|
37
|
+
export declare function unenforceableLockMessage(identifier: string, lock: UnenforceableLock): string;
|
|
38
|
+
/** A locked value as a facilitator or an author reads it, as a setting path (§6.1a): `engine.Rate`. */
|
|
14
39
|
export declare function lockedSettingName(identifier: string, path: readonly string[]): string;
|
|
15
40
|
export declare function lockedSettingMessage(identifier: string, path: readonly string[]): string;
|
|
16
41
|
/**
|