@seriousgaming/sdk 0.0.0-stage → 1.0.0-alpha.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.
- package/LICENSE +202 -0
- package/NOTICE +1 -0
- package/README.md +29 -2
- package/lib/build/callbacks.d.ts +998 -0
- package/lib/build/callbacks.js +32 -0
- package/lib/build/context-merge.d.ts +59 -0
- package/lib/build/context-merge.js +118 -0
- package/lib/build/document.d.ts +36 -0
- package/lib/build/document.js +8 -0
- package/lib/build/encoding.d.ts +26 -0
- package/lib/build/encoding.js +78 -0
- package/lib/build/endpoints.d.ts +421 -0
- package/lib/build/endpoints.js +46 -0
- package/lib/build/hooks.d.ts +74 -0
- package/lib/build/hooks.js +1 -0
- package/lib/build/index.d.ts +18 -0
- package/lib/build/index.js +16 -0
- package/lib/build/llm.d.ts +166 -0
- package/lib/build/llm.js +17 -0
- package/lib/build/resource-schema.d.ts +1048 -0
- package/lib/build/resource-schema.js +7 -0
- package/lib/build/scheduling.d.ts +112 -0
- package/lib/build/scheduling.js +217 -0
- package/lib/build/seed.d.ts +51 -0
- package/lib/build/seed.js +89 -0
- package/lib/build/signatures.d.ts +372 -0
- package/lib/build/signatures.js +1 -0
- package/lib/build/speech.d.ts +102 -0
- package/lib/build/speech.js +11 -0
- package/lib/build/tick-validation.d.ts +23 -0
- package/lib/build/tick-validation.js +96 -0
- package/lib/build/timer.d.ts +74 -0
- package/lib/build/timer.js +1 -0
- package/lib/build/validators.d.ts +116 -0
- package/lib/build/validators.js +1 -0
- package/lib/commands.d.ts +357 -0
- package/lib/commands.js +14 -0
- package/lib/e2e.d.ts +238 -0
- package/lib/e2e.js +248 -0
- package/lib/projection.d.ts +266 -0
- package/lib/projection.js +23 -0
- package/lib/testing/index.d.ts +13 -0
- package/lib/testing/index.js +13 -0
- package/lib/testing/logic-args.d.ts +177 -0
- package/lib/testing/logic-args.js +229 -0
- package/lib/testing/stub-services.d.ts +41 -0
- package/lib/testing/stub-services.js +176 -0
- package/lib/ui/CrossTeamDataContext.d.ts +36 -0
- package/lib/ui/CrossTeamDataContext.js +32 -0
- package/lib/ui/PresentationContext.d.ts +72 -0
- package/lib/ui/PresentationContext.js +13 -0
- package/lib/ui/PresentationWrapper.d.ts +12 -0
- package/lib/ui/PresentationWrapper.js +78 -0
- package/lib/ui/SessionUserInterfaceCallbacksContext.d.ts +3 -0
- package/lib/ui/SessionUserInterfaceCallbacksContext.js +7 -0
- package/lib/ui/SessionUserInterfaceDataContext.d.ts +103 -0
- package/lib/ui/SessionUserInterfaceDataContext.js +17 -0
- package/lib/ui/SessionUserInterfaceHookFailuresContext.d.ts +44 -0
- package/lib/ui/SessionUserInterfaceHookFailuresContext.js +15 -0
- package/lib/ui/SessionUserInterfaceHostOverlaysContext.d.ts +23 -0
- package/lib/ui/SessionUserInterfaceHostOverlaysContext.js +23 -0
- package/lib/ui/SessionUserInterfaceLocaleContext.d.ts +11 -0
- package/lib/ui/SessionUserInterfaceLocaleContext.js +13 -0
- package/lib/ui/SessionUserInterfaceMetaContext.d.ts +39 -0
- package/lib/ui/SessionUserInterfaceMetaContext.js +13 -0
- package/lib/ui/SessionUserInterfaceParticipantsContext.d.ts +12 -0
- package/lib/ui/SessionUserInterfaceParticipantsContext.js +16 -0
- package/lib/ui/SessionUserInterfaceTeamConfigurationContext.d.ts +53 -0
- package/lib/ui/SessionUserInterfaceTeamConfigurationContext.js +23 -0
- package/lib/ui/SessionUserInterfaceTeamLinksContext.d.ts +56 -0
- package/lib/ui/SessionUserInterfaceTeamLinksContext.js +12 -0
- package/lib/ui/SessionUserInterfaceTeamsContext.d.ts +13 -0
- package/lib/ui/SessionUserInterfaceTeamsContext.js +13 -0
- package/lib/ui/SessionUserInterfaceThemeContext.d.ts +9 -0
- package/lib/ui/SessionUserInterfaceThemeContext.js +7 -0
- package/lib/ui/SessionUserInterfaceThemePreferenceContext.d.ts +3 -0
- package/lib/ui/SessionUserInterfaceThemePreferenceContext.js +7 -0
- package/lib/ui/SessionUserInterfaceWalkthroughLinkContext.d.ts +42 -0
- package/lib/ui/SessionUserInterfaceWalkthroughLinkContext.js +26 -0
- package/lib/ui/SessionUserInterfaceWrapper.d.ts +8 -0
- package/lib/ui/SessionUserInterfaceWrapper.js +321 -0
- package/lib/ui/SettingsEditorCallbacksContext.d.ts +3 -0
- package/lib/ui/SettingsEditorCallbacksContext.js +7 -0
- package/lib/ui/SettingsEditorContext.d.ts +33 -0
- package/lib/ui/SettingsEditorContext.js +16 -0
- package/lib/ui/SettingsEditorLocaleContext.d.ts +13 -0
- package/lib/ui/SettingsEditorLocaleContext.js +15 -0
- package/lib/ui/SettingsEditorThemeContext.d.ts +9 -0
- package/lib/ui/SettingsEditorThemeContext.js +7 -0
- package/lib/ui/SettingsEditorThemePreferenceContext.d.ts +3 -0
- package/lib/ui/SettingsEditorThemePreferenceContext.js +7 -0
- package/lib/ui/SettingsEditorWrapper.d.ts +13 -0
- package/lib/ui/SettingsEditorWrapper.js +74 -0
- package/lib/ui/UserInterfaceCallbacksContext.d.ts +3 -0
- package/lib/ui/UserInterfaceCallbacksContext.js +7 -0
- package/lib/ui/UserInterfaceDataContext.d.ts +78 -0
- package/lib/ui/UserInterfaceDataContext.js +11 -0
- package/lib/ui/UserInterfaceLocaleContext.d.ts +13 -0
- package/lib/ui/UserInterfaceLocaleContext.js +15 -0
- package/lib/ui/UserInterfaceOwnTeamContext.d.ts +25 -0
- package/lib/ui/UserInterfaceOwnTeamContext.js +26 -0
- package/lib/ui/UserInterfaceOwnTeamJoinLinkContext.d.ts +52 -0
- package/lib/ui/UserInterfaceOwnTeamJoinLinkContext.js +13 -0
- package/lib/ui/UserInterfaceParticipantContext.d.ts +16 -0
- package/lib/ui/UserInterfaceParticipantContext.js +24 -0
- package/lib/ui/UserInterfaceParticipantsContext.d.ts +12 -0
- package/lib/ui/UserInterfaceParticipantsContext.js +13 -0
- package/lib/ui/UserInterfaceRunKindContext.d.ts +31 -0
- package/lib/ui/UserInterfaceRunKindContext.js +31 -0
- package/lib/ui/UserInterfaceTeamsContext.d.ts +12 -0
- package/lib/ui/UserInterfaceTeamsContext.js +13 -0
- package/lib/ui/UserInterfaceThemeContext.d.ts +9 -0
- package/lib/ui/UserInterfaceThemeContext.js +7 -0
- package/lib/ui/UserInterfaceThemePreferenceContext.d.ts +3 -0
- package/lib/ui/UserInterfaceThemePreferenceContext.js +7 -0
- package/lib/ui/UserInterfaceTimerContext.d.ts +10 -0
- package/lib/ui/UserInterfaceTimerContext.js +12 -0
- package/lib/ui/UserInterfaceValidationContext.d.ts +25 -0
- package/lib/ui/UserInterfaceValidationContext.js +14 -0
- package/lib/ui/UserInterfaceViewerRoleContext.d.ts +14 -0
- package/lib/ui/UserInterfaceViewerRoleContext.js +17 -0
- package/lib/ui/UserInterfaceWrapper.d.ts +8 -0
- package/lib/ui/UserInterfaceWrapper.js +219 -0
- package/lib/ui/expectedParentOrigin.d.ts +10 -0
- package/lib/ui/expectedParentOrigin.js +32 -0
- package/lib/ui/index.d.ts +50 -0
- package/lib/ui/index.js +52 -0
- package/lib/ui/internal/SurfaceGate.d.ts +19 -0
- package/lib/ui/internal/SurfaceGate.js +17 -0
- package/lib/ui/internal/SurfaceScope.d.ts +17 -0
- package/lib/ui/internal/SurfaceScope.js +16 -0
- package/lib/ui/internal/createContexts.d.ts +50 -0
- package/lib/ui/internal/createContexts.js +32 -0
- package/lib/ui/internal/document-attributes.d.ts +9 -0
- package/lib/ui/internal/document-attributes.js +87 -0
- package/lib/ui/internal/surface-timer.d.ts +3 -0
- package/lib/ui/internal/surface-timer.js +11 -0
- package/lib/ui/internal/useLatestRef.d.ts +7 -0
- package/lib/ui/internal/useLatestRef.js +11 -0
- package/lib/ui/internal/useOptimisticMerge.d.ts +19 -0
- package/lib/ui/internal/useOptimisticMerge.js +28 -0
- package/lib/ui/internal/useSurfaceControls.d.ts +52 -0
- package/lib/ui/internal/useSurfaceControls.js +19 -0
- package/lib/ui/internal/useTypedPastState.d.ts +17 -0
- package/lib/ui/internal/useTypedPastState.js +17 -0
- package/lib/ui/mutation-commit.d.ts +32 -0
- package/lib/ui/mutation-commit.js +1 -0
- package/lib/ui/mutation-outcome.d.ts +66 -0
- package/lib/ui/mutation-outcome.js +49 -0
- package/lib/ui/request-id.d.ts +18 -0
- package/lib/ui/request-id.js +44 -0
- package/lib/ui/testing.d.ts +365 -0
- package/lib/ui/testing.js +572 -0
- package/lib/ui/tick-snapshot.d.ts +28 -0
- package/lib/ui/tick-snapshot.js +34 -0
- package/lib/ui/ui-protocol.d.ts +799 -0
- package/lib/ui/ui-protocol.js +50 -0
- package/lib/ui/useAsset.d.ts +80 -0
- package/lib/ui/useAsset.js +139 -0
- package/lib/ui/useEndpointCallbacks.d.ts +31 -0
- package/lib/ui/useEndpointCallbacks.js +68 -0
- package/lib/ui/useHostChannel.d.ts +90 -0
- package/lib/ui/useHostChannel.js +338 -0
- package/lib/ui/useMutationReporter.d.ts +100 -0
- package/lib/ui/useMutationReporter.js +97 -0
- package/lib/ui/usePastState.d.ts +39 -0
- package/lib/ui/usePastState.js +63 -0
- package/lib/ui/useViewerStorage.d.ts +54 -0
- package/lib/ui/useViewerStorage.js +141 -0
- package/package.json +83 -3
|
@@ -0,0 +1,1048 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
3
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
4
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Runtime callback API (a service) a logic-bearing resource is permitted to invoke. A declared API is always present for that resource, and a runtime that cannot provide one a package declares refuses the package at load. Calling an undeclared API throws at runtime, in both dev and production. Resources that omit `uses` (or declare an empty array) cannot call any callbacks.
|
|
8
|
+
*/
|
|
9
|
+
export type ApiUse = "generateText" | "extractText" | "generateSpeech" | "writeBlob";
|
|
10
|
+
/**
|
|
11
|
+
* List of locales supported by this game (e.g., ['en', 'es', 'fr'])
|
|
12
|
+
*
|
|
13
|
+
* @minItems 1
|
|
14
|
+
*/
|
|
15
|
+
export type GameSupportedLocales = [string, ...string[]];
|
|
16
|
+
/**
|
|
17
|
+
* Interaction mode this game runs in. 'independent' = teams are isolated with independent tick progression. 'shared-state' = teams interact via shared capabilities with synchronized ticks. If omitted, defaults to 'independent'. Fixed at authoring time: no scenario or session varies it.
|
|
18
|
+
*/
|
|
19
|
+
export type GameTeamMode = "independent" | "shared-state";
|
|
20
|
+
/**
|
|
21
|
+
* Whether a new session starts with the waiting room open, holding participants on this screen until the facilitator closes it. Seeds the session flag at creation only: the facilitator owns it from then on, and neither a reset nor a restart reapplies it.
|
|
22
|
+
*/
|
|
23
|
+
export type GameWaitingRoomOpenOnStart = boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Optional runtime features the game depends on, by name. A runtime that does not support every listed feature refuses the package at load, naming the feature, rather than running it half-working. This is how a feature arrives within a manifest version without a new one. Absent or empty means the game needs nothing beyond its manifest version.
|
|
26
|
+
*/
|
|
27
|
+
export type RequiredFeatures = string[];
|
|
28
|
+
/**
|
|
29
|
+
* The format of the game's scenarios, which the author bumps whenever a custom scenario saved against an earlier value may no longer be correct: a setting removed, renamed or reshaped, a change in what a value means, or a change in how the game loads scenario assets. A purely additive change, such as a new setting with a default, needs no bump. A runtime stores it with each custom scenario it persists and refuses to apply a saved scenario whose format differs from the package's. Absent means 1.
|
|
30
|
+
*/
|
|
31
|
+
export type ScenarioFormat = number;
|
|
32
|
+
/**
|
|
33
|
+
* A participant action a validator can gate, named after the surface message it gates: a context write, or a request for the next tick
|
|
34
|
+
*/
|
|
35
|
+
export type ValidatorGate = "updateData" | "requestTick";
|
|
36
|
+
/**
|
|
37
|
+
* A session action an endpoint may return for the runtime to carry out after its write. Each is the operation a facilitator's session surface can perform, held to the same rules; an endpoint may return only the actions it declares.
|
|
38
|
+
*/
|
|
39
|
+
export type EndpointActionType = "tick" | "setWaitingRoom" | "pauseTimer" | "resumeTimer" | "extendTick" | "renameTeam" | "moveParticipant" | "addTeam" | "setLocale";
|
|
40
|
+
/**
|
|
41
|
+
* Lifecycle signal a hook subscribes to. Hooks fire on out-of-tick events emitted by the runtime, after the runtime applies the change.
|
|
42
|
+
*/
|
|
43
|
+
export type HookSignal = "participantJoin" | "participantMove";
|
|
44
|
+
export interface Schema {
|
|
45
|
+
PackageDefinition?: PackageDefinition;
|
|
46
|
+
EngineDefinition?: EngineDefinition;
|
|
47
|
+
CapabilityDefinition?: CapabilityDefinition;
|
|
48
|
+
SettingsDefinition?: SettingsDefinition;
|
|
49
|
+
SDKSettings?: SDKSettings;
|
|
50
|
+
SetupDefinition?: SetupDefinition;
|
|
51
|
+
ScenarioEditorDefinition?: ScenarioEditorDefinition;
|
|
52
|
+
ScenarioDefinition?: ScenarioDefinition;
|
|
53
|
+
UserInterfaceDefinition?: UserInterfaceDefinition;
|
|
54
|
+
GameDefinition?: GameDefinition;
|
|
55
|
+
SessionUserInterfaceDefinition?: SessionUserInterfaceDefinition;
|
|
56
|
+
SDKSessionUserInterface?: SDKSessionUserInterface;
|
|
57
|
+
WaitingRoomUserInterfaceDefinition?: WaitingRoomUserInterfaceDefinition;
|
|
58
|
+
SDKWaitingRoomUserInterface?: SDKWaitingRoomUserInterface;
|
|
59
|
+
PresentationDefinition?: PresentationDefinition;
|
|
60
|
+
SDKPresentation?: SDKPresentation;
|
|
61
|
+
GameSupportedLocales?: GameSupportedLocales;
|
|
62
|
+
GameLocales?: GameLocales;
|
|
63
|
+
GameCustomScenarios?: GameCustomScenarios;
|
|
64
|
+
GameTeams?: GameTeams;
|
|
65
|
+
GameTeamMode?: GameTeamMode;
|
|
66
|
+
GameSettings?: GameSettings;
|
|
67
|
+
GameSettingConstraint?: GameSettingConstraint;
|
|
68
|
+
GameSettingsConstraints?: GameSettingsConstraints;
|
|
69
|
+
GameWaitingRoomOpenOnStart?: GameWaitingRoomOpenOnStart;
|
|
70
|
+
GameWaitingRoomSettings?: GameWaitingRoomSettings;
|
|
71
|
+
FacilitatorGuideDefinition?: FacilitatorGuideDefinition;
|
|
72
|
+
SDKFacilitatorGuide?: SDKFacilitatorGuide;
|
|
73
|
+
ResolvedPackageManifest?: ResolvedPackageManifest;
|
|
74
|
+
LogicLayout?: LogicLayout;
|
|
75
|
+
SDKPackage?: SDKPackage;
|
|
76
|
+
SDKEngine?: SDKEngine;
|
|
77
|
+
SDKCapability?: SDKCapability;
|
|
78
|
+
SDKScenario?: SDKScenario;
|
|
79
|
+
SDKUserInterface?: SDKUserInterface;
|
|
80
|
+
SDKSetup?: SDKSetup;
|
|
81
|
+
SDKScenarioEditor?: SDKScenarioEditor;
|
|
82
|
+
SDKGame?: SDKGame;
|
|
83
|
+
PackageManifest?: PackageManifest;
|
|
84
|
+
TickControllerDefinition?: TickControllerDefinition;
|
|
85
|
+
SDKTickController?: SDKTickController;
|
|
86
|
+
ApiUse?: ApiUse;
|
|
87
|
+
EndpointActionType?: EndpointActionType;
|
|
88
|
+
GlobalSettings?: GlobalSettings;
|
|
89
|
+
HookSignal?: HookSignal;
|
|
90
|
+
HookDefinition?: HookDefinition;
|
|
91
|
+
SDKHook?: SDKHook;
|
|
92
|
+
ValidatorDefinition?: ValidatorDefinition;
|
|
93
|
+
SDKValidator?: SDKValidator;
|
|
94
|
+
EndpointDefinition?: EndpointDefinition;
|
|
95
|
+
SDKEndpoint?: SDKEndpoint;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Definition of a package
|
|
99
|
+
*/
|
|
100
|
+
export interface PackageDefinition {
|
|
101
|
+
/**
|
|
102
|
+
* Namespace-style identifier for the package
|
|
103
|
+
*/
|
|
104
|
+
identifier: string;
|
|
105
|
+
/**
|
|
106
|
+
* Name of the package
|
|
107
|
+
*/
|
|
108
|
+
name: string;
|
|
109
|
+
/**
|
|
110
|
+
* Semantic version of the package
|
|
111
|
+
*/
|
|
112
|
+
version: string;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Definition of a game's engine: the logic that computes each tick
|
|
116
|
+
*/
|
|
117
|
+
export interface EngineDefinition {
|
|
118
|
+
/**
|
|
119
|
+
* Identifier for the engine. A game holds one, in the `engine` slot, and the slot is the identifier.
|
|
120
|
+
*/
|
|
121
|
+
identifier: string;
|
|
122
|
+
/**
|
|
123
|
+
* Identifiers of the capabilities this engine reads
|
|
124
|
+
*/
|
|
125
|
+
reads?: string[];
|
|
126
|
+
/**
|
|
127
|
+
* Identifiers of the capabilities this engine writes
|
|
128
|
+
*/
|
|
129
|
+
writes?: string[];
|
|
130
|
+
/**
|
|
131
|
+
* Runtime callback APIs this engine is permitted to invoke. The runtime throws when this engine calls a callback whose name is not listed here.
|
|
132
|
+
*/
|
|
133
|
+
uses?: ApiUse[];
|
|
134
|
+
/**
|
|
135
|
+
* Identifiers of the settings resources this engine reads. It receives exactly these, read-only, as settings.<identifier>
|
|
136
|
+
*/
|
|
137
|
+
settings?: string[];
|
|
138
|
+
/**
|
|
139
|
+
* Generated, not authored. True when the engine's logic exports InitAggregate and RunAggregate, in which case it runs once across all teams rather than per-team via Run, and may write to shared capabilities. The build derives this from the exports and writes it into the bundled manifest; authoring it in engine.sdk.json is an error.
|
|
140
|
+
*/
|
|
141
|
+
aggregate?: boolean;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Definition of a capability
|
|
145
|
+
*/
|
|
146
|
+
export interface CapabilityDefinition {
|
|
147
|
+
/**
|
|
148
|
+
* Namespace-style identifier for the capability
|
|
149
|
+
*/
|
|
150
|
+
identifier: string;
|
|
151
|
+
/**
|
|
152
|
+
* JSON Schema describing the variables provided by this capability
|
|
153
|
+
*/
|
|
154
|
+
variablesSchema: {
|
|
155
|
+
[k: string]: unknown;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Visibility of this capability's state. 'team' (default): per team, delivered to that team's surfaces. 'team-readable': each team writes only its own copy, but user interfaces on other teams may observe every team's value live in shared-state games. 'shared': one value for all teams, written by an aggregate engine, a facilitator's shared write or a session-scoped endpoint, and synchronised between teams by the production coordinator. 'private': per team like 'team', but never delivered to any user interface, never included in session data or cross-team data; for engine bookkeeping no surface should depend on. A user interface declaring one in reads or writes fails the build.
|
|
159
|
+
*/
|
|
160
|
+
scope?: "team" | "team-readable" | "shared" | "private";
|
|
161
|
+
/**
|
|
162
|
+
* How long a value lasts. 'tick' (default): part of each tick snapshot, so undo and reset rewind it with the round. 'session': kept out of tick snapshots, so neither undo nor reset touches it; seeded from its defaults once, when the session (or a team added later) is created, and persisted across restarts. For facilitator state such as setup completed, pacing gates, or an announcement. Read and written by surfaces, endpoints, hooks and validators; the build refuses one in the engine's reads or writes, because a tick must be replayable from its snapshot
|
|
163
|
+
*/
|
|
164
|
+
lifetime?: "tick" | "session";
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Definition of a settings resource: named, read-only parameters a game declares once and any resource may read by listing it in its settings. Overridden only by the active scenario and by the session's setup step, and fixed when play starts.
|
|
168
|
+
*/
|
|
169
|
+
export interface SettingsDefinition {
|
|
170
|
+
/**
|
|
171
|
+
* Namespace-style identifier for the settings resource
|
|
172
|
+
*/
|
|
173
|
+
identifier: string;
|
|
174
|
+
/**
|
|
175
|
+
* JSON Schema describing these settings. A full object schema, and every property MUST declare a default. `readOnly: true` on a property, at any depth, fixes it and everything under it at the default: no scenario or session may change it
|
|
176
|
+
*/
|
|
177
|
+
settingsSchema: {
|
|
178
|
+
[k: string]: unknown;
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Bundle containing a settings definition
|
|
183
|
+
*/
|
|
184
|
+
export interface SDKSettings {
|
|
185
|
+
definition: SettingsDefinition;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Definition of the game's setup user interface: a small form shown at session creation, whose changes become session overrides for that session only (§8.2, §8.3). Its presence is what gives a session its configuration step
|
|
189
|
+
*/
|
|
190
|
+
export interface SetupDefinition {
|
|
191
|
+
/**
|
|
192
|
+
* The slot, `setup`. A game holds one setup user interface, so it carries no name of its own
|
|
193
|
+
*/
|
|
194
|
+
identifier: string;
|
|
195
|
+
/**
|
|
196
|
+
* Identifiers of the settings resources this setup user interface edits, the built-in `game` included. It is sent their resolved values through `setSettings`, keyed by identifier, and writes changes to them through `updateSettings`
|
|
197
|
+
*/
|
|
198
|
+
configures?: string[];
|
|
199
|
+
/**
|
|
200
|
+
* Endpoint identifiers this setup user interface is permitted to call via `callbacks.endpoints[<identifier>]`. The host throws when this UI requests an endpoint whose identifier is not listed here.
|
|
201
|
+
*/
|
|
202
|
+
endpoints?: string[];
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Definition of the game's scenario editor: an authoring screen, used at any time and with no session, whose output is a lasting scenario (§6.7.1). Optional: `customScenarios.supported` is what switches custom scenarios on
|
|
206
|
+
*/
|
|
207
|
+
export interface ScenarioEditorDefinition {
|
|
208
|
+
/**
|
|
209
|
+
* The slot, `scenario_editor`. A game holds one scenario editor, so it carries no name of its own
|
|
210
|
+
*/
|
|
211
|
+
identifier: string;
|
|
212
|
+
/**
|
|
213
|
+
* Identifiers of the settings resources this scenario editor edits, the built-in `game` included. It is sent their resolved values through `setSettings`, keyed by identifier, and writes changes to them through `updateSettings`
|
|
214
|
+
*/
|
|
215
|
+
configures?: string[];
|
|
216
|
+
/**
|
|
217
|
+
* Endpoint identifiers this scenario editor is permitted to call via `callbacks.endpoints[<identifier>]`. The host throws when this UI requests an endpoint whose identifier is not listed here.
|
|
218
|
+
*/
|
|
219
|
+
endpoints?: string[];
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Definition of a scenario — a named flavour of a game bundling settings overrides and static assets
|
|
223
|
+
*/
|
|
224
|
+
export interface ScenarioDefinition {
|
|
225
|
+
/**
|
|
226
|
+
* Namespace-style identifier for the scenario
|
|
227
|
+
*/
|
|
228
|
+
identifier: string;
|
|
229
|
+
/**
|
|
230
|
+
* Localized scenario fields with one entry per supported locale
|
|
231
|
+
*/
|
|
232
|
+
locales: {
|
|
233
|
+
/**
|
|
234
|
+
* Localized fields for this locale
|
|
235
|
+
*
|
|
236
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
237
|
+
* via the `patternProperty` "^[a-z]{2}(-[A-Z]{2})?$".
|
|
238
|
+
*/
|
|
239
|
+
[k: string]: {
|
|
240
|
+
/**
|
|
241
|
+
* Display name for this locale
|
|
242
|
+
*/
|
|
243
|
+
name: string;
|
|
244
|
+
/**
|
|
245
|
+
* Short description for this locale
|
|
246
|
+
*/
|
|
247
|
+
description?: string;
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
* If true, this scenario is selected when no explicit scenario is chosen at init time. At most one scenario per package should set it.
|
|
252
|
+
*/
|
|
253
|
+
default?: boolean;
|
|
254
|
+
/**
|
|
255
|
+
* If true, this scenario is built for a particular audience and a runtime must not offer, list, resolve or serve it to a caller it has not granted it to. The package never names that audience. Cannot be combined with `default`.
|
|
256
|
+
*/
|
|
257
|
+
restricted?: boolean;
|
|
258
|
+
/**
|
|
259
|
+
* Settings overrides applied when this scenario is selected, keyed by settings identifier. Each value is a partial object of that settings resource's properties. The game-level settings (the number of rounds, the team bounds and names, and whether the waiting room opens with the session) are the built-in `game` settings resource, overridden here under `game` like any other.
|
|
260
|
+
*/
|
|
261
|
+
settings?: {
|
|
262
|
+
[k: string]: {
|
|
263
|
+
[k: string]: unknown;
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Definition of a user interface with internationalization support
|
|
269
|
+
*/
|
|
270
|
+
export interface UserInterfaceDefinition {
|
|
271
|
+
/**
|
|
272
|
+
* Namespace-style identifier for the user interface
|
|
273
|
+
*/
|
|
274
|
+
identifier: string;
|
|
275
|
+
/**
|
|
276
|
+
* Identifiers of the capabilities this user interface reads
|
|
277
|
+
*/
|
|
278
|
+
reads?: string[];
|
|
279
|
+
/**
|
|
280
|
+
* Identifiers of the capabilities this user interface receives every team's value of, live, rather than its own team's alone. Every entry MUST also appear in `reads`, and MUST name a capability with scope 'team-readable'. Only meaningful in shared-state games.
|
|
281
|
+
*/
|
|
282
|
+
crossTeamReads?: string[];
|
|
283
|
+
/**
|
|
284
|
+
* Identifiers of the capabilities this user interface writes
|
|
285
|
+
*/
|
|
286
|
+
writes?: string[];
|
|
287
|
+
/**
|
|
288
|
+
* Endpoint identifiers this user interface is permitted to call via `callbacks.endpoints[<identifier>]`. The host throws when this UI requests an endpoint whose identifier is not listed here.
|
|
289
|
+
*/
|
|
290
|
+
endpoints?: string[];
|
|
291
|
+
/**
|
|
292
|
+
* If true, this user interface may read the participant roster of every team via `callbacks.getAllTeamsParticipants()`, not just its own team. Only meaningful in shared-state games; a game that is not shared-state and references a UI declaring this MUST fail the build.
|
|
293
|
+
*/
|
|
294
|
+
crossTeamParticipants?: boolean;
|
|
295
|
+
/**
|
|
296
|
+
* Identifiers of the settings resources this user interface reads. It receives exactly these, read-only, as settings.<identifier>
|
|
297
|
+
*/
|
|
298
|
+
settings?: string[];
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Definition of a game with internationalization support
|
|
302
|
+
*/
|
|
303
|
+
export interface GameDefinition {
|
|
304
|
+
/**
|
|
305
|
+
* Namespace-style identifier for the game
|
|
306
|
+
*/
|
|
307
|
+
identifier: string;
|
|
308
|
+
supportedLocales: GameSupportedLocales;
|
|
309
|
+
locales: GameLocales;
|
|
310
|
+
customScenarios?: GameCustomScenarios;
|
|
311
|
+
/**
|
|
312
|
+
* The game's interaction mode, fixed at authoring time. The team bounds, participant guidance and default names are game settings, in the built-in `game` settings resource.
|
|
313
|
+
*/
|
|
314
|
+
teams?: {
|
|
315
|
+
mode?: GameTeamMode;
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Localized game fields with one entry per supported locale
|
|
320
|
+
*/
|
|
321
|
+
export interface GameLocales {
|
|
322
|
+
/**
|
|
323
|
+
* Localized fields for this locale
|
|
324
|
+
*
|
|
325
|
+
* This interface was referenced by `GameLocales`'s JSON-Schema definition
|
|
326
|
+
* via the `patternProperty` "^[a-z]{2}(-[A-Z]{2})?$".
|
|
327
|
+
*/
|
|
328
|
+
[k: string]: {
|
|
329
|
+
/**
|
|
330
|
+
* Display name for this locale
|
|
331
|
+
*/
|
|
332
|
+
name: string;
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Production-policy signal opting in to facilitator-authored, runtime-persisted scenarios. When supported is true, runtime hosts offer 'save as scenario' from the game's scenario editor, or through whatever other authoring route they provide, such as an agent editing the settings schemas directly, and list the resulting scenarios alongside built-in ones at init time. The scenario editor is optional: this flag, not the editor, is what switches custom scenarios on. Author-time hosts (e.g. the SDK dev server) surface their own save affordance regardless.
|
|
337
|
+
*/
|
|
338
|
+
export interface GameCustomScenarios {
|
|
339
|
+
/**
|
|
340
|
+
* If true, the runtime MAY persist scenarios authored at session time.
|
|
341
|
+
*/
|
|
342
|
+
supported: boolean;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Definition of a session user interface with internationalization support
|
|
346
|
+
*/
|
|
347
|
+
export interface SessionUserInterfaceDefinition {
|
|
348
|
+
/**
|
|
349
|
+
* Namespace-style identifier for the session user interface
|
|
350
|
+
*/
|
|
351
|
+
identifier: string;
|
|
352
|
+
/**
|
|
353
|
+
* Identifiers of the capabilities this session user interface reads
|
|
354
|
+
*/
|
|
355
|
+
reads?: string[];
|
|
356
|
+
/**
|
|
357
|
+
* Identifiers of the capabilities this session user interface writes
|
|
358
|
+
*/
|
|
359
|
+
writes?: string[];
|
|
360
|
+
/**
|
|
361
|
+
* Endpoint identifiers this session user interface is permitted to call via `callbacks.endpoints[<identifier>]`. The host throws when this UI requests an endpoint whose identifier is not listed here.
|
|
362
|
+
*/
|
|
363
|
+
endpoints?: string[];
|
|
364
|
+
/**
|
|
365
|
+
* Identifiers of the settings resources this session user interface reads. It receives exactly these, read-only, as settings.<identifier>
|
|
366
|
+
*/
|
|
367
|
+
settings?: string[];
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Bundle containing a session user interface definition and entrypoint
|
|
371
|
+
*/
|
|
372
|
+
export interface SDKSessionUserInterface {
|
|
373
|
+
definition: SessionUserInterfaceDefinition;
|
|
374
|
+
/**
|
|
375
|
+
* Directory containing this resource's files, relative to the bundle file. Must use forward slashes, not Windows separators
|
|
376
|
+
*/
|
|
377
|
+
rootDirectory: string;
|
|
378
|
+
/**
|
|
379
|
+
* Where this surface's entrypoint is. A UI's web files sit in the resource's own directory, so only the entrypoint's name varies
|
|
380
|
+
*/
|
|
381
|
+
ui: {
|
|
382
|
+
/**
|
|
383
|
+
* Entrypoint file, in the resource's own directory (e.g., 'index.html')
|
|
384
|
+
*/
|
|
385
|
+
entrypoint: string;
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Definition of a waiting room user interface (the holding screen shown to players while the session's waiting room is open)
|
|
390
|
+
*/
|
|
391
|
+
export interface WaitingRoomUserInterfaceDefinition {
|
|
392
|
+
/**
|
|
393
|
+
* Namespace-style identifier for the waiting room user interface
|
|
394
|
+
*/
|
|
395
|
+
identifier: string;
|
|
396
|
+
/**
|
|
397
|
+
* Identifiers of the capabilities this waiting room user interface reads
|
|
398
|
+
*/
|
|
399
|
+
reads?: string[];
|
|
400
|
+
/**
|
|
401
|
+
* Identifiers of the capabilities this waiting room user interface receives every team's value of, live, rather than its own team's alone. Every entry MUST also appear in `reads`, and MUST name a capability with scope 'team-readable'. Only meaningful in shared-state games.
|
|
402
|
+
*/
|
|
403
|
+
crossTeamReads?: string[];
|
|
404
|
+
/**
|
|
405
|
+
* Identifiers of the capabilities this waiting room user interface writes
|
|
406
|
+
*/
|
|
407
|
+
writes?: string[];
|
|
408
|
+
/**
|
|
409
|
+
* Endpoint identifiers this waiting room user interface is permitted to call via `callbacks.endpoints[<identifier>]`. The host throws when this UI requests an endpoint whose identifier is not listed here.
|
|
410
|
+
*/
|
|
411
|
+
endpoints?: string[];
|
|
412
|
+
/**
|
|
413
|
+
* If true, this waiting room user interface may read the participant roster of every team via `callbacks.getAllTeamsParticipants()`, not just its own team. Only meaningful in shared-state games; a game that is not shared-state and references a UI declaring this MUST fail the build.
|
|
414
|
+
*/
|
|
415
|
+
crossTeamParticipants?: boolean;
|
|
416
|
+
/**
|
|
417
|
+
* Identifiers of the settings resources this waiting room user interface reads. It receives exactly these, read-only, as settings.<identifier>
|
|
418
|
+
*/
|
|
419
|
+
settings?: string[];
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Bundle containing a waiting room user interface definition and entrypoint
|
|
423
|
+
*/
|
|
424
|
+
export interface SDKWaitingRoomUserInterface {
|
|
425
|
+
definition: WaitingRoomUserInterfaceDefinition;
|
|
426
|
+
/**
|
|
427
|
+
* Directory containing this resource's files, relative to the bundle file. Must use forward slashes, not Windows separators
|
|
428
|
+
*/
|
|
429
|
+
rootDirectory: string;
|
|
430
|
+
/**
|
|
431
|
+
* Where this surface's entrypoint is. A UI's web files sit in the resource's own directory, so only the entrypoint's name varies
|
|
432
|
+
*/
|
|
433
|
+
ui: {
|
|
434
|
+
/**
|
|
435
|
+
* Entrypoint file, in the resource's own directory (e.g., 'index.html')
|
|
436
|
+
*/
|
|
437
|
+
entrypoint: string;
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Definition of a presentation: the slides a facilitator shows the room, rendered from a UI bundle of the game's own. Read-only by construction: it declares no writes, no endpoints and no callback uses, and it may be shown with no session at all
|
|
442
|
+
*/
|
|
443
|
+
export interface PresentationDefinition {
|
|
444
|
+
/**
|
|
445
|
+
* Namespace-style identifier for the presentation
|
|
446
|
+
*/
|
|
447
|
+
identifier: string;
|
|
448
|
+
/**
|
|
449
|
+
* Display name per locale, for the host to label the presentation with
|
|
450
|
+
*/
|
|
451
|
+
locales?: {
|
|
452
|
+
[k: string]: {
|
|
453
|
+
name: string;
|
|
454
|
+
};
|
|
455
|
+
};
|
|
456
|
+
/**
|
|
457
|
+
* Identifiers of the capabilities this presentation reads, from every team and the shared store, when it is shown during a session
|
|
458
|
+
*/
|
|
459
|
+
reads?: string[];
|
|
460
|
+
/**
|
|
461
|
+
* Identifiers of the settings resources this presentation reads. It receives exactly these, read-only, as settings.<identifier>, with or without a session
|
|
462
|
+
*/
|
|
463
|
+
settings?: string[];
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Bundle containing a presentation definition and entrypoint
|
|
467
|
+
*/
|
|
468
|
+
export interface SDKPresentation {
|
|
469
|
+
definition: PresentationDefinition;
|
|
470
|
+
/**
|
|
471
|
+
* Directory containing this resource's files, relative to the bundle file. Must use forward slashes, not Windows separators
|
|
472
|
+
*/
|
|
473
|
+
rootDirectory: string;
|
|
474
|
+
/**
|
|
475
|
+
* Where this surface's entrypoint is. A UI's web files sit in the resource's own directory, so only the entrypoint's name varies
|
|
476
|
+
*/
|
|
477
|
+
ui: {
|
|
478
|
+
/**
|
|
479
|
+
* Entrypoint file, in the resource's own directory (e.g., 'index.html')
|
|
480
|
+
*/
|
|
481
|
+
entrypoint: string;
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Team configuration: the interaction mode, fixed at authoring time, and the game's own values for the team settings, which are the defaults of the built-in `game` settings resource. All fields are optional.
|
|
486
|
+
*/
|
|
487
|
+
export interface GameTeams {
|
|
488
|
+
mode?: GameTeamMode;
|
|
489
|
+
/**
|
|
490
|
+
* Minimum number of teams this game is designed for. The default for the `game` settings' `teams.min`
|
|
491
|
+
*/
|
|
492
|
+
min?: number;
|
|
493
|
+
/**
|
|
494
|
+
* Maximum number of teams this game is designed for. The default for the `game` settings' `teams.max`
|
|
495
|
+
*/
|
|
496
|
+
max?: number;
|
|
497
|
+
/**
|
|
498
|
+
* Per-team participant guidance. The default for the `game` settings' `teams.perTeam`
|
|
499
|
+
*/
|
|
500
|
+
perTeam?: {
|
|
501
|
+
/**
|
|
502
|
+
* Minimum participants per team
|
|
503
|
+
*/
|
|
504
|
+
minParticipants?: number;
|
|
505
|
+
/**
|
|
506
|
+
* Maximum participants per team
|
|
507
|
+
*/
|
|
508
|
+
maxParticipants?: number;
|
|
509
|
+
};
|
|
510
|
+
/**
|
|
511
|
+
* Ordered, localised default names for teams. Entry N seeds the default name for the Nth team (team-1, team-2, …). Advisory: operators may rename teams at session setup, and teams beyond the list fall back to the runtime default. The default for the `game` settings' `teams.defaultNames`
|
|
512
|
+
*
|
|
513
|
+
* Items: Localised default name for one team, with one entry per supported locale
|
|
514
|
+
*/
|
|
515
|
+
defaultNames?: {
|
|
516
|
+
/**
|
|
517
|
+
* Localised fields for this locale
|
|
518
|
+
*
|
|
519
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
520
|
+
* via the `patternProperty` "^[a-z]{2}(-[A-Z]{2})?$".
|
|
521
|
+
*/
|
|
522
|
+
[k: string]: {
|
|
523
|
+
/**
|
|
524
|
+
* Display name for this locale
|
|
525
|
+
*/
|
|
526
|
+
name: string;
|
|
527
|
+
};
|
|
528
|
+
}[];
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* The values of the built-in `game` settings resource: the game-level settings every game has. Its schema is the SDK's, not the game's: a game sets its own values in its manifest, which become this resource's defaults, and a scenario or a session overrides them under the identifier `game` like any other settings resource. Null means 'no limit' or 'no guidance'. A new game-level setting joins as a new optional property with a default.
|
|
532
|
+
*/
|
|
533
|
+
export interface GameSettings {
|
|
534
|
+
/**
|
|
535
|
+
* The number of ticks the game plays before it is complete. Null means no fixed limit: the game ends by its tick controller or its engine
|
|
536
|
+
*/
|
|
537
|
+
maxTicks?: number | null;
|
|
538
|
+
/**
|
|
539
|
+
* How many teams a session may hold, how many participants each is meant for, and what the teams are called to begin with
|
|
540
|
+
*/
|
|
541
|
+
teams?: {
|
|
542
|
+
/**
|
|
543
|
+
* The fewest teams a session may start play with. Null means no minimum
|
|
544
|
+
*/
|
|
545
|
+
min?: number | null;
|
|
546
|
+
/**
|
|
547
|
+
* The most teams a session may hold at any point. Null means no maximum beyond the runtime's own ceiling
|
|
548
|
+
*/
|
|
549
|
+
max?: number | null;
|
|
550
|
+
/**
|
|
551
|
+
* Advisory guidance on how many participants each team is meant for, shown to the facilitator. Never a gate on joining
|
|
552
|
+
*/
|
|
553
|
+
perTeam?: {
|
|
554
|
+
/**
|
|
555
|
+
* The fewest participants a team is meant for. Null means no guidance
|
|
556
|
+
*/
|
|
557
|
+
minParticipants?: number | null;
|
|
558
|
+
/**
|
|
559
|
+
* The most participants a team is meant for. Null means no guidance
|
|
560
|
+
*/
|
|
561
|
+
maxParticipants?: number | null;
|
|
562
|
+
};
|
|
563
|
+
/**
|
|
564
|
+
* Ordered, localised default names for teams. Entry N names the team whose index is N; a team beyond the list is named by position. A facilitator or the team's players may rename it
|
|
565
|
+
*
|
|
566
|
+
* Items: Localised default name for one team, with one entry per supported locale
|
|
567
|
+
*/
|
|
568
|
+
defaultNames?: {
|
|
569
|
+
/**
|
|
570
|
+
* Localised fields for this locale
|
|
571
|
+
*
|
|
572
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
573
|
+
* via the `patternProperty` "^[a-z]{2}(-[A-Z]{2})?$".
|
|
574
|
+
*/
|
|
575
|
+
[k: string]: {
|
|
576
|
+
/**
|
|
577
|
+
* Display name for this locale
|
|
578
|
+
*/
|
|
579
|
+
name: string;
|
|
580
|
+
};
|
|
581
|
+
}[];
|
|
582
|
+
};
|
|
583
|
+
/**
|
|
584
|
+
* How the waiting room starts
|
|
585
|
+
*/
|
|
586
|
+
waitingRoom?: {
|
|
587
|
+
/**
|
|
588
|
+
* Whether a new session starts with the waiting room open. Seeds the session flag at creation, before any setup step, so only the game and its scenarios set it
|
|
589
|
+
*/
|
|
590
|
+
openOnStart?: boolean;
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* How a game narrows one of its `game` settings. Each keyword may only narrow the SDK's schema: a `minimum` or `maximum` applies to a number and also rules out null, an `enum` lists values the SDK's schema accepts, and `readOnly` fixes the value at the game's own, so no scenario or session may change it.
|
|
595
|
+
*/
|
|
596
|
+
export interface GameSettingConstraint {
|
|
597
|
+
/**
|
|
598
|
+
* The smallest value a scenario or session may set. At or above the SDK's own minimum
|
|
599
|
+
*/
|
|
600
|
+
minimum?: number;
|
|
601
|
+
/**
|
|
602
|
+
* The largest value a scenario or session may set. At or below the SDK's own maximum
|
|
603
|
+
*/
|
|
604
|
+
maximum?: number;
|
|
605
|
+
/**
|
|
606
|
+
* The only values a scenario or session may set, each one the SDK's schema accepts
|
|
607
|
+
*
|
|
608
|
+
* @minItems 1
|
|
609
|
+
*/
|
|
610
|
+
enum?: [unknown, ...unknown[]];
|
|
611
|
+
/**
|
|
612
|
+
* True fixes the value at the game's own: a scenario or session that sets it is refused
|
|
613
|
+
*/
|
|
614
|
+
readOnly?: boolean;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* Narrowing for the built-in `game` settings, in their shape. The build merges each constraint into the `game` settings schema it emits, so a runtime sees one ordinary schema. Adding a constraint is a scenario-format change.
|
|
618
|
+
*/
|
|
619
|
+
export interface GameSettingsConstraints {
|
|
620
|
+
maxTicks?: GameSettingConstraint;
|
|
621
|
+
teams?: {
|
|
622
|
+
min?: GameSettingConstraint;
|
|
623
|
+
max?: GameSettingConstraint;
|
|
624
|
+
perTeam?: {
|
|
625
|
+
minParticipants?: GameSettingConstraint;
|
|
626
|
+
maxParticipants?: GameSettingConstraint;
|
|
627
|
+
};
|
|
628
|
+
defaultNames?: GameSettingConstraint;
|
|
629
|
+
};
|
|
630
|
+
waitingRoom?: {
|
|
631
|
+
openOnStart?: GameSettingConstraint;
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
/**
|
|
635
|
+
* Waiting room settings. Which user interface fills the waiting room is the package's waiting room user interface; only its settings are authored.
|
|
636
|
+
*/
|
|
637
|
+
export interface GameWaitingRoomSettings {
|
|
638
|
+
openOnStart?: GameWaitingRoomOpenOnStart;
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Definition of a facilitator guide — bundled markdown content rendered natively by the host on the facilitator's page
|
|
642
|
+
*/
|
|
643
|
+
export interface FacilitatorGuideDefinition {
|
|
644
|
+
/**
|
|
645
|
+
* Namespace-style identifier for the facilitator guide
|
|
646
|
+
*/
|
|
647
|
+
identifier: string;
|
|
648
|
+
/**
|
|
649
|
+
* Localized facilitator guide fields with one entry per supported locale. Each declared locale must have a matching content/<locale>/ directory.
|
|
650
|
+
*/
|
|
651
|
+
locales: {
|
|
652
|
+
/**
|
|
653
|
+
* Localized fields for this locale
|
|
654
|
+
*
|
|
655
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
656
|
+
* via the `patternProperty` "^[a-z]{2}(-[A-Z]{2})?$".
|
|
657
|
+
*/
|
|
658
|
+
[k: string]: {
|
|
659
|
+
/**
|
|
660
|
+
* Display name for this locale, shown as the guide's title
|
|
661
|
+
*/
|
|
662
|
+
name: string;
|
|
663
|
+
};
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* Bundle containing a facilitator guide definition and root directory for content and assets
|
|
668
|
+
*/
|
|
669
|
+
export interface SDKFacilitatorGuide {
|
|
670
|
+
definition: FacilitatorGuideDefinition;
|
|
671
|
+
/**
|
|
672
|
+
* Root directory where guide content and assets are located. Must use forward slashes, not Windows separators
|
|
673
|
+
*/
|
|
674
|
+
rootDirectory: string;
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Every resource a package holds: the shape the loader builds from disk and the shape the build writes to seriousgaming.json. A game holds one of nine kinds, each in its own field; everything a package may hold more than one of is an array.
|
|
678
|
+
*/
|
|
679
|
+
export interface ResolvedPackageManifest {
|
|
680
|
+
/**
|
|
681
|
+
* Format version of this manifest. Absent means 1. Runtimes MUST treat an absent value as 1 and MUST reject a version they do not implement.
|
|
682
|
+
*/
|
|
683
|
+
manifestVersion?: number;
|
|
684
|
+
requires?: RequiredFeatures;
|
|
685
|
+
scenarioFormat?: ScenarioFormat;
|
|
686
|
+
package: SDKPackage;
|
|
687
|
+
game: SDKGame;
|
|
688
|
+
engine?: SDKEngine;
|
|
689
|
+
ui?: SDKUserInterface;
|
|
690
|
+
session?: SDKSessionUserInterface;
|
|
691
|
+
waiting_room?: SDKWaitingRoomUserInterface;
|
|
692
|
+
presentation?: SDKPresentation;
|
|
693
|
+
setup?: SDKSetup;
|
|
694
|
+
scenario_editor?: SDKScenarioEditor;
|
|
695
|
+
tick_controller?: SDKTickController;
|
|
696
|
+
guide?: SDKFacilitatorGuide;
|
|
697
|
+
capabilities?: SDKCapability[];
|
|
698
|
+
settings?: SDKSettings[];
|
|
699
|
+
scenarios?: SDKScenario[];
|
|
700
|
+
hooks?: SDKHook[];
|
|
701
|
+
validators?: SDKValidator[];
|
|
702
|
+
endpoints?: SDKEndpoint[];
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* Bundle containing a package definition
|
|
706
|
+
*/
|
|
707
|
+
export interface SDKPackage {
|
|
708
|
+
definition: PackageDefinition;
|
|
709
|
+
}
|
|
710
|
+
/**
|
|
711
|
+
* Bundle containing a game definition
|
|
712
|
+
*/
|
|
713
|
+
export interface SDKGame {
|
|
714
|
+
definition: GameDefinition;
|
|
715
|
+
/**
|
|
716
|
+
* Root directory where game files are located (e.g., '.'). Must use forward slashes, not Windows separators
|
|
717
|
+
*/
|
|
718
|
+
rootDirectory: string;
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* Bundle containing an engine definition and its logic layout
|
|
722
|
+
*/
|
|
723
|
+
export interface SDKEngine {
|
|
724
|
+
definition: EngineDefinition;
|
|
725
|
+
logic: LogicLayout;
|
|
726
|
+
/**
|
|
727
|
+
* Directory containing this resource's files, relative to the bundle file. Must use forward slashes, not Windows separators
|
|
728
|
+
*/
|
|
729
|
+
rootDirectory: string;
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Where a logic-bearing resource keeps its code, and what its entrypoint is called
|
|
733
|
+
*/
|
|
734
|
+
export interface LogicLayout {
|
|
735
|
+
/**
|
|
736
|
+
* Subdirectory containing logic files
|
|
737
|
+
*/
|
|
738
|
+
directory: string;
|
|
739
|
+
/**
|
|
740
|
+
* Path to the TypeScript entrypoint file (e.g., logic.ts)
|
|
741
|
+
*/
|
|
742
|
+
entrypoint: string;
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* Bundle containing a user interface definition and entrypoint
|
|
746
|
+
*/
|
|
747
|
+
export interface SDKUserInterface {
|
|
748
|
+
definition: UserInterfaceDefinition;
|
|
749
|
+
/**
|
|
750
|
+
* Directory containing this resource's files, relative to the bundle file. Must use forward slashes, not Windows separators
|
|
751
|
+
*/
|
|
752
|
+
rootDirectory: string;
|
|
753
|
+
/**
|
|
754
|
+
* Where this surface's entrypoint is. A UI's web files sit in the resource's own directory, so only the entrypoint's name varies
|
|
755
|
+
*/
|
|
756
|
+
ui: {
|
|
757
|
+
/**
|
|
758
|
+
* Entrypoint file, in the resource's own directory (e.g., 'index.html')
|
|
759
|
+
*/
|
|
760
|
+
entrypoint: string;
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* Bundle containing the setup user interface definition and entrypoint
|
|
765
|
+
*/
|
|
766
|
+
export interface SDKSetup {
|
|
767
|
+
definition: SetupDefinition;
|
|
768
|
+
/**
|
|
769
|
+
* Directory containing this resource's files, relative to the bundle file. Must use forward slashes, not Windows separators
|
|
770
|
+
*/
|
|
771
|
+
rootDirectory: string;
|
|
772
|
+
/**
|
|
773
|
+
* Where this surface's entrypoint is. A UI's web files sit in the resource's own directory, so only the entrypoint's name varies
|
|
774
|
+
*/
|
|
775
|
+
ui: {
|
|
776
|
+
/**
|
|
777
|
+
* Entrypoint file, in the resource's own directory (e.g., 'index.html')
|
|
778
|
+
*/
|
|
779
|
+
entrypoint: string;
|
|
780
|
+
};
|
|
781
|
+
}
|
|
782
|
+
/**
|
|
783
|
+
* Bundle containing the scenario editor definition and entrypoint
|
|
784
|
+
*/
|
|
785
|
+
export interface SDKScenarioEditor {
|
|
786
|
+
definition: ScenarioEditorDefinition;
|
|
787
|
+
/**
|
|
788
|
+
* Directory containing this resource's files, relative to the bundle file. Must use forward slashes, not Windows separators
|
|
789
|
+
*/
|
|
790
|
+
rootDirectory: string;
|
|
791
|
+
/**
|
|
792
|
+
* Where this surface's entrypoint is. A UI's web files sit in the resource's own directory, so only the entrypoint's name varies
|
|
793
|
+
*/
|
|
794
|
+
ui: {
|
|
795
|
+
/**
|
|
796
|
+
* Entrypoint file, in the resource's own directory (e.g., 'index.html')
|
|
797
|
+
*/
|
|
798
|
+
entrypoint: string;
|
|
799
|
+
};
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* Bundle containing a tick controller definition and its logic layout
|
|
803
|
+
*/
|
|
804
|
+
export interface SDKTickController {
|
|
805
|
+
definition: TickControllerDefinition;
|
|
806
|
+
logic: LogicLayout;
|
|
807
|
+
/**
|
|
808
|
+
* Directory containing this resource's files, relative to the bundle file. Must use forward slashes, not Windows separators
|
|
809
|
+
*/
|
|
810
|
+
rootDirectory: string;
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* Definition of a tick controller that determines automatic tick timing
|
|
814
|
+
*/
|
|
815
|
+
export interface TickControllerDefinition {
|
|
816
|
+
/**
|
|
817
|
+
* Namespace-style identifier for the tick controller
|
|
818
|
+
*/
|
|
819
|
+
identifier: string;
|
|
820
|
+
/**
|
|
821
|
+
* Identifiers of the capabilities this tick controller reads
|
|
822
|
+
*/
|
|
823
|
+
reads?: string[];
|
|
824
|
+
/**
|
|
825
|
+
* Runtime callback APIs this tick controller is permitted to invoke. The runtime throws when this tick controller calls a callback whose name is not listed here.
|
|
826
|
+
*/
|
|
827
|
+
uses?: ApiUse[];
|
|
828
|
+
/**
|
|
829
|
+
* Identifiers of the settings resources this tick controller reads. It receives exactly these, read-only, as settings.<identifier>
|
|
830
|
+
*/
|
|
831
|
+
settings?: string[];
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* Bundle containing a capability definition
|
|
835
|
+
*/
|
|
836
|
+
export interface SDKCapability {
|
|
837
|
+
definition: CapabilityDefinition;
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Bundle containing a scenario definition and root directory for assets
|
|
841
|
+
*/
|
|
842
|
+
export interface SDKScenario {
|
|
843
|
+
definition: ScenarioDefinition;
|
|
844
|
+
/**
|
|
845
|
+
* Root directory where scenario assets are located. Must use forward slashes, not Windows separators
|
|
846
|
+
*/
|
|
847
|
+
rootDirectory: string;
|
|
848
|
+
}
|
|
849
|
+
/**
|
|
850
|
+
* Bundle containing a hook definition and its logic layout
|
|
851
|
+
*/
|
|
852
|
+
export interface SDKHook {
|
|
853
|
+
definition: HookDefinition;
|
|
854
|
+
logic: LogicLayout;
|
|
855
|
+
/**
|
|
856
|
+
* Directory containing this resource's files, relative to the bundle file. Must use forward slashes, not Windows separators
|
|
857
|
+
*/
|
|
858
|
+
rootDirectory: string;
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* Definition of a hook — a single-signal handler that runs in response to an out-of-tick lifecycle event
|
|
862
|
+
*/
|
|
863
|
+
export interface HookDefinition {
|
|
864
|
+
/**
|
|
865
|
+
* Namespace-style identifier for the hook
|
|
866
|
+
*/
|
|
867
|
+
identifier: string;
|
|
868
|
+
/**
|
|
869
|
+
* Lifecycle signal this hook fires on
|
|
870
|
+
*/
|
|
871
|
+
signal: "participantJoin" | "participantMove";
|
|
872
|
+
/**
|
|
873
|
+
* Identifiers of the capabilities this hook reads
|
|
874
|
+
*/
|
|
875
|
+
reads?: string[];
|
|
876
|
+
/**
|
|
877
|
+
* Identifiers of the capabilities this hook writes
|
|
878
|
+
*/
|
|
879
|
+
writes?: string[];
|
|
880
|
+
/**
|
|
881
|
+
* Runtime callback APIs this hook is permitted to invoke. The runtime throws when this hook calls a callback whose name is not listed here.
|
|
882
|
+
*/
|
|
883
|
+
uses?: ApiUse[];
|
|
884
|
+
/**
|
|
885
|
+
* Identifiers of the settings resources this hook reads. It receives exactly these, read-only, as settings.<identifier>
|
|
886
|
+
*/
|
|
887
|
+
settings?: string[];
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* Bundle containing a validator definition and its logic layout
|
|
891
|
+
*/
|
|
892
|
+
export interface SDKValidator {
|
|
893
|
+
definition: ValidatorDefinition;
|
|
894
|
+
logic: LogicLayout;
|
|
895
|
+
/**
|
|
896
|
+
* Directory containing this resource's files, relative to the bundle file. Must use forward slashes, not Windows separators
|
|
897
|
+
*/
|
|
898
|
+
rootDirectory: string;
|
|
899
|
+
}
|
|
900
|
+
/**
|
|
901
|
+
* Definition of a validator — a standalone, read-only gate on what a participant does from a player surface: a context write, or a request for the next tick. Reject-only; never modifies state.
|
|
902
|
+
*/
|
|
903
|
+
export interface ValidatorDefinition {
|
|
904
|
+
/**
|
|
905
|
+
* Namespace-style identifier for the validator
|
|
906
|
+
*/
|
|
907
|
+
identifier: string;
|
|
908
|
+
/**
|
|
909
|
+
* Identifiers of the capabilities this validator reads. Also its trigger set: a validator runs when a mutation changes one of them, and one declaring none runs on every mutation
|
|
910
|
+
*/
|
|
911
|
+
reads?: string[];
|
|
912
|
+
/**
|
|
913
|
+
* Generated, not authored. The participant actions this validator gates, one per gate function its logic exports: 'updateData' for an UpdateData export (a context write), 'requestTick' for a RequestTick export (a request for the next tick). The build derives this from the exports and writes it into the bundled manifest, and a runtime calls only these; authoring it in validator.sdk.json is an error
|
|
914
|
+
*/
|
|
915
|
+
gates?: ValidatorGate[];
|
|
916
|
+
/**
|
|
917
|
+
* Identifiers of the settings resources this validator reads. It receives exactly these, read-only, as settings.<identifier>
|
|
918
|
+
*/
|
|
919
|
+
settings?: string[];
|
|
920
|
+
}
|
|
921
|
+
/**
|
|
922
|
+
* Bundle containing an endpoint definition and its logic layout
|
|
923
|
+
*/
|
|
924
|
+
export interface SDKEndpoint {
|
|
925
|
+
definition: EndpointDefinition;
|
|
926
|
+
logic: LogicLayout;
|
|
927
|
+
/**
|
|
928
|
+
* Directory containing this resource's files, relative to the bundle file. Must use forward slashes, not Windows separators
|
|
929
|
+
*/
|
|
930
|
+
rootDirectory: string;
|
|
931
|
+
}
|
|
932
|
+
/**
|
|
933
|
+
* Definition of an endpoint — a named, server-side handler that user interfaces, and callers outside the game when its visibility is external, invoke by identifier. Endpoints validate structured requests and responses against declared schemas, and operate strictly within the bounds of their declared `reads`, `writes` and `uses`.
|
|
934
|
+
*/
|
|
935
|
+
export interface EndpointDefinition {
|
|
936
|
+
/**
|
|
937
|
+
* Namespace-style identifier for the endpoint
|
|
938
|
+
*/
|
|
939
|
+
identifier: string;
|
|
940
|
+
/**
|
|
941
|
+
* Human-readable name for author-time tools
|
|
942
|
+
*/
|
|
943
|
+
displayName?: string;
|
|
944
|
+
/**
|
|
945
|
+
* Short description of what this endpoint does, surfaced in author-time tools. Required when `visibility` is `external`, where it is also the text an outside caller, such as a facilitator's AI agent, reads to decide whether to call this endpoint.
|
|
946
|
+
*/
|
|
947
|
+
description?: string;
|
|
948
|
+
/**
|
|
949
|
+
* Whether this endpoint acts on one team or on the session as a whole. A team-scoped endpoint receives that team's context and a `team` naming it, whoever calls it; a session-scoped one has neither. Absent means `team`.
|
|
950
|
+
*/
|
|
951
|
+
scope?: "session" | "team";
|
|
952
|
+
/**
|
|
953
|
+
* JSON Schema describing the request payload accepted by this endpoint
|
|
954
|
+
*/
|
|
955
|
+
requestSchema: {
|
|
956
|
+
[k: string]: unknown;
|
|
957
|
+
};
|
|
958
|
+
/**
|
|
959
|
+
* JSON Schema describing the response payload returned by this endpoint
|
|
960
|
+
*/
|
|
961
|
+
responseSchema: {
|
|
962
|
+
[k: string]: unknown;
|
|
963
|
+
};
|
|
964
|
+
/**
|
|
965
|
+
* Identifiers of the capabilities this endpoint reads. The handler receives a scoped snapshot of these capabilities under `context`.
|
|
966
|
+
*/
|
|
967
|
+
reads?: string[];
|
|
968
|
+
/**
|
|
969
|
+
* Identifiers of the settings resources this endpoint reads. It receives exactly these, read-only, as settings.<identifier>
|
|
970
|
+
*/
|
|
971
|
+
settings?: string[];
|
|
972
|
+
/**
|
|
973
|
+
* Identifiers of the capabilities this endpoint may change. The context patch a handler returns is held to this list, and an endpoint declaring none cannot change state at all.
|
|
974
|
+
*/
|
|
975
|
+
writes?: string[];
|
|
976
|
+
/**
|
|
977
|
+
* Runtime callback APIs this endpoint is permitted to invoke. The runtime throws when this endpoint calls a callback whose name is not listed here.
|
|
978
|
+
*/
|
|
979
|
+
uses?: ApiUse[];
|
|
980
|
+
/**
|
|
981
|
+
* Session actions this endpoint may return beside its response, such as closing the waiting room or advancing a tick. The runtime carries them out, in order, after the endpoint's write.
|
|
982
|
+
*/
|
|
983
|
+
actions?: EndpointActionType[];
|
|
984
|
+
/**
|
|
985
|
+
* Generated, not authored. Whether the endpoint answers in two phases: its logic exports `Plan`, which returns the effects alone, and `Respond`, which the runtime calls once they have been applied to write the response from the state they left. An endpoint that answers in one exports `Handle`. The build derives this from the exports and writes it into the bundled manifest; authoring it in endpoint.sdk.json is an error
|
|
986
|
+
*/
|
|
987
|
+
responds?: boolean;
|
|
988
|
+
/**
|
|
989
|
+
* Whether the handler's `session` argument lists each team's participants. Off by default, because the list grows with the cohort and most endpoints do not need it.
|
|
990
|
+
*/
|
|
991
|
+
roster?: boolean;
|
|
992
|
+
/**
|
|
993
|
+
* Who may invoke this endpoint. `internal` endpoints are reached only by the game's own user interfaces; `external` ones may also be invoked by callers outside the game, such as a facilitator's AI agent or a platform API, subject to the platform's own authorisation. Absent means `internal`, so an endpoint written for a game's own screens is never published unless its author says so.
|
|
994
|
+
*/
|
|
995
|
+
visibility?: "internal" | "external";
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* A package, which is a game: its identifier and the game's settings. What it declares are the resources on disk under the conventional directories beside this file. The version comes from package.json, and the game's identifier is the package identifier with `.game` appended.
|
|
999
|
+
*/
|
|
1000
|
+
export interface PackageManifest {
|
|
1001
|
+
/**
|
|
1002
|
+
* Namespace-style identifier for the package. Every resource identifier sits under it, and the game's identifier is it with `.game` appended.
|
|
1003
|
+
*/
|
|
1004
|
+
identifier: string;
|
|
1005
|
+
requires?: RequiredFeatures;
|
|
1006
|
+
scenarioFormat?: ScenarioFormat;
|
|
1007
|
+
supportedLocales: GameSupportedLocales;
|
|
1008
|
+
locales: GameLocales;
|
|
1009
|
+
/**
|
|
1010
|
+
* The number of ticks (rounds) the game plays before it is complete. A tick can stand for an hour, a day, a week, or something more abstract. Omit it when the game ends by its tick controller or its engine instead. The default for the `game` settings' `maxTicks`, which a scenario or a session may override
|
|
1011
|
+
*/
|
|
1012
|
+
maxTicks?: number;
|
|
1013
|
+
teams?: GameTeams;
|
|
1014
|
+
waitingRoom?: GameWaitingRoomSettings;
|
|
1015
|
+
gameSettingsConstraints?: GameSettingsConstraints;
|
|
1016
|
+
customScenarios?: GameCustomScenarios;
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* User-owned global settings file (~/.seriousgaming-sdk/config.json). Stores API keys and defaults once so every project picks them up. This is the lowest-priority configuration source: .env files, environment variables, and CLI flags all override it. The file is plaintext and must not be committed to git.
|
|
1020
|
+
*/
|
|
1021
|
+
export interface GlobalSettings {
|
|
1022
|
+
/**
|
|
1023
|
+
* ElevenLabs integration settings.
|
|
1024
|
+
*/
|
|
1025
|
+
elevenLabs?: {
|
|
1026
|
+
/**
|
|
1027
|
+
* ElevenLabs API key.
|
|
1028
|
+
*/
|
|
1029
|
+
apiKey?: string;
|
|
1030
|
+
};
|
|
1031
|
+
/**
|
|
1032
|
+
* Serious Gaming platform settings used by `package publish` and LLM text generation.
|
|
1033
|
+
*/
|
|
1034
|
+
platform?: {
|
|
1035
|
+
/**
|
|
1036
|
+
* Serious Gaming platform API host.
|
|
1037
|
+
*/
|
|
1038
|
+
apiHost?: string;
|
|
1039
|
+
/**
|
|
1040
|
+
* Serious Gaming platform API key.
|
|
1041
|
+
*/
|
|
1042
|
+
apiKey?: string;
|
|
1043
|
+
/**
|
|
1044
|
+
* Default publisher identifier used when publishing packages.
|
|
1045
|
+
*/
|
|
1046
|
+
defaultPublisher?: string;
|
|
1047
|
+
};
|
|
1048
|
+
}
|