@diffenderfer-games/hub 2.0.0-next.0 → 2.0.0-next.10
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/CHANGELOG.md +163 -0
- package/LICENSE +21 -21
- package/README.md +203 -139
- package/dist/auto.d.ts +8 -8
- package/dist/auto.js +3 -3
- package/dist/avatar-pixi.d.ts +165 -0
- package/dist/avatar-pixi.d.ts.map +1 -0
- package/dist/avatar-pixi.js +299 -0
- package/dist/avatar-pixi.js.map +1 -0
- package/dist/avatar-svg.d.ts +4 -0
- package/dist/avatar-svg.js +5 -0
- package/dist/avatar-three.d.ts +69 -0
- package/dist/avatar-three.d.ts.map +1 -0
- package/dist/avatar-three.js +49 -0
- package/dist/avatar-three.js.map +1 -0
- package/dist/avatar.d.ts +7 -0
- package/dist/avatar.js +500 -0
- package/dist/avatar.js.map +1 -0
- package/dist/daily.d.ts +2 -2
- package/dist/doctor/cli.mjs +119 -28
- package/dist/doctor/cli.mjs.map +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.js +3 -3
- package/dist/input.d.ts +2 -2
- package/dist/input.js +2 -2
- package/dist/mp.d.ts +3 -3
- package/dist/race.d.ts +1 -1
- package/dist/rooms.d.ts +3 -3
- package/dist/rooms.js +1 -1
- package/dist/shared/animator.d.ts +104 -0
- package/dist/shared/animator.d.ts.map +1 -0
- package/dist/shared/art.js +1946 -0
- package/dist/shared/art.js.map +1 -0
- package/dist/shared/atlas.d.ts +138 -0
- package/dist/shared/atlas.d.ts.map +1 -0
- package/dist/shared/avatar.d.ts +123 -0
- package/dist/shared/avatar.d.ts.map +1 -0
- package/dist/shared/bridge.js +18 -4
- package/dist/shared/bridge.js.map +1 -1
- package/dist/shared/client-version.gen.js +1 -1
- package/dist/shared/daily.d.ts +145 -19
- package/dist/shared/daily.d.ts.map +1 -1
- package/dist/shared/daily.js +138 -25
- package/dist/shared/daily.js.map +1 -1
- package/dist/shared/defineProperty.js +39 -0
- package/dist/shared/describe.d.ts +32 -0
- package/dist/shared/describe.d.ts.map +1 -0
- package/dist/shared/describe.js +109 -0
- package/dist/shared/describe.js.map +1 -0
- package/dist/shared/globals.js +9 -42
- package/dist/shared/globals.js.map +1 -1
- package/dist/shared/index.d.ts +1122 -46
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/input.d.ts +74 -14
- package/dist/shared/input.d.ts.map +1 -1
- package/dist/shared/input.js +179 -25
- package/dist/shared/input.js.map +1 -1
- package/dist/shared/json-guards.js +48 -0
- package/dist/shared/json-guards.js.map +1 -0
- package/dist/shared/latest-state.js +1 -1
- package/dist/shared/live-canvas.js +62 -0
- package/dist/shared/live-canvas.js.map +1 -0
- package/dist/shared/mp.js +10 -2
- package/dist/shared/mp.js.map +1 -1
- package/dist/shared/multiplayer-types.d.ts +15 -2
- package/dist/shared/multiplayer-types.d.ts.map +1 -1
- package/dist/shared/overlays.js +800 -0
- package/dist/shared/overlays.js.map +1 -0
- package/dist/shared/page-stack.js +2 -1
- package/dist/shared/page-stack.js.map +1 -1
- package/dist/shared/pose-key.js +249 -0
- package/dist/shared/pose-key.js.map +1 -0
- package/dist/shared/race-types.d.ts +1 -1
- package/dist/shared/race.js +1 -1
- package/dist/shared/room-types.d.ts +28 -3
- package/dist/shared/room-types.d.ts.map +1 -1
- package/dist/shared/rooms.d.ts.map +1 -1
- package/dist/shared/rooms.js +23 -4
- package/dist/shared/rooms.js.map +1 -1
- package/dist/shared/runtime-opener.js +1 -1
- package/dist/shared/scene.d.ts +90 -0
- package/dist/shared/scene.d.ts.map +1 -0
- package/dist/shared/social.d.ts +90 -9
- package/dist/shared/social.d.ts.map +1 -1
- package/dist/shared/social.js +6 -1
- package/dist/shared/social.js.map +1 -1
- package/dist/shared/src.js +4563 -667
- package/dist/shared/src.js.map +1 -1
- package/dist/shared/svg-markup.js +2354 -0
- package/dist/shared/svg-markup.js.map +1 -0
- package/dist/shared/svg.js +27 -0
- package/dist/shared/svg.js.map +1 -0
- package/dist/shared/types.d.ts +174 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/wire-types.d.ts +6 -2
- package/dist/shared/wire-types.d.ts.map +1 -1
- package/dist/social.d.ts +5 -5
- package/dist/social.js +2 -2
- package/dist/turns-rules.d.ts +2 -0
- package/dist/turns-rules.js +1 -0
- package/dist/turns.d.ts +61 -0
- package/dist/turns.d.ts.map +1 -0
- package/dist/turns.js +183 -0
- package/dist/turns.js.map +1 -0
- package/package.json +125 -89
- package/src/auto.ts +39 -39
- package/src/avatar/adapters/pixi-avatar.ts +73 -0
- package/src/avatar/adapters/pixi-crowd.ts +329 -0
- package/src/avatar/adapters/pixi-types.ts +84 -0
- package/src/avatar/adapters/three.ts +126 -0
- package/src/avatar/animator/animator.ts +285 -0
- package/src/avatar/animator/reactions.ts +44 -0
- package/src/avatar/animator/schedule.ts +73 -0
- package/src/avatar/art/beard.ts +49 -0
- package/src/avatar/art/glasses.ts +67 -0
- package/src/avatar/art/hair.ts +254 -0
- package/src/avatar/art/headwear.ts +75 -0
- package/src/avatar/art/index.ts +21 -0
- package/src/avatar/art/shape.ts +87 -0
- package/src/avatar/art-store.ts +36 -0
- package/src/avatar/atlas.ts +246 -0
- package/src/avatar/catalog-view.ts +14 -0
- package/src/avatar/colour.ts +109 -0
- package/src/avatar/describe.ts +79 -0
- package/src/avatar/face.ts +187 -0
- package/src/avatar/geom.ts +173 -0
- package/src/avatar/layout.ts +47 -0
- package/src/avatar/look-like.ts +52 -0
- package/src/avatar/outputs/bitmap.ts +75 -0
- package/src/avatar/outputs/canvas-paint.ts +177 -0
- package/src/avatar/outputs/canvas.ts +62 -0
- package/src/avatar/outputs/custom-element.ts +140 -0
- package/src/avatar/outputs/element.ts +58 -0
- package/src/avatar/outputs/live-canvas.ts +57 -0
- package/src/avatar/outputs/overlay-svg.ts +22 -0
- package/src/avatar/outputs/pose-key.ts +30 -0
- package/src/avatar/outputs/svg-markup.ts +113 -0
- package/src/avatar/outputs/svg.ts +41 -0
- package/src/avatar/overlays.ts +128 -0
- package/src/avatar/render/body.ts +116 -0
- package/src/avatar/render/colours.ts +81 -0
- package/src/avatar/render/compose.ts +320 -0
- package/src/avatar/render/context.ts +117 -0
- package/src/avatar/render/eyes.ts +78 -0
- package/src/avatar/render/eyewear.ts +118 -0
- package/src/avatar/render/frame.ts +73 -0
- package/src/avatar/render/head.ts +81 -0
- package/src/avatar/render/mouth.ts +86 -0
- package/src/avatar/render/props.ts +91 -0
- package/src/avatar/render/types.ts +93 -0
- package/src/avatar/render/walker-parts.ts +121 -0
- package/src/avatar/render/walker.ts +199 -0
- package/src/avatar/scene.ts +119 -0
- package/src/avatar-pixi.ts +20 -0
- package/src/avatar-svg.ts +21 -0
- package/src/avatar-three.ts +18 -0
- package/src/avatar.ts +63 -0
- package/src/core/avatar/avatar-cache.ts +95 -0
- package/src/core/avatar/avatar-ref.ts +34 -0
- package/src/core/avatar/avatar-types.ts +43 -0
- package/src/core/avatar/hub-avatar.ts +308 -0
- package/src/core/connection.ts +408 -299
- package/src/core/errors.ts +160 -147
- package/src/core/game-data.ts +40 -38
- package/src/core/hub-economy.ts +216 -179
- package/src/core/hub-progress.ts +269 -205
- package/src/core/hub.ts +352 -131
- package/src/core/menu-control.ts +61 -61
- package/src/core/offline/cloud-saves.ts +62 -0
- package/src/core/offline/events.ts +50 -50
- package/src/core/offline/favorites.ts +21 -21
- package/src/core/offline/hub-kinds/avatar-kind.ts +42 -0
- package/src/core/offline/hub-kinds/daily-kind.ts +68 -0
- package/src/core/offline/hub-kinds/economy-kinds.ts +86 -0
- package/src/core/offline/hub-kinds/game-fields.ts +2 -0
- package/src/core/offline/hub-kinds/index.ts +52 -0
- package/src/core/offline/hub-kinds/legacy-ops.ts +37 -0
- package/src/core/offline/hub-kinds/progress-kinds.ts +165 -0
- package/src/core/offline/hub-kinds/resume-kind.ts +108 -0
- package/src/core/offline/hub-kinds/saved-kind.ts +93 -0
- package/src/core/offline/kind-adapters.ts +48 -0
- package/src/core/offline/local-inventory.ts +64 -0
- package/src/core/offline/local-store.ts +304 -261
- package/src/core/offline/offline-api.ts +65 -0
- package/src/core/offline/outbox-entry.ts +59 -0
- package/src/core/offline/outbox-kinds.ts +78 -0
- package/src/core/offline/outbox-merge.ts +39 -0
- package/src/core/offline/outbox-replayer.ts +141 -0
- package/src/core/offline/outbox-store.ts +85 -0
- package/src/core/offline/outbox.ts +232 -0
- package/src/core/offline/queue.ts +126 -171
- package/src/core/offline/replay-lease.ts +87 -0
- package/src/core/offline/replay-policy.ts +52 -0
- package/src/core/page-account.ts +121 -0
- package/src/core/page.ts +87 -74
- package/src/core/rest/endpoint-types.ts +22 -22
- package/src/core/rest/rest-client.ts +163 -152
- package/src/core/rest/routes.gen.ts +144 -88
- package/src/core/resume/hub-resume.ts +286 -0
- package/src/core/resume/local-resume.ts +130 -0
- package/src/core/resume/resume-list.ts +65 -0
- package/src/core/resume/resume-request.ts +52 -0
- package/src/core/resume/resume-types.ts +64 -0
- package/src/core/saved/daily-saves.ts +196 -0
- package/src/core/saved/daily-seed.ts +16 -0
- package/src/core/saved/hub-saved.ts +221 -0
- package/src/core/saved/local-saved.ts +122 -0
- package/src/core/saved/saved-list.ts +129 -0
- package/src/core/saved/saved-open.ts +104 -0
- package/src/core/saved/saved-order.ts +49 -0
- package/src/core/saved/saved-types.ts +24 -0
- package/src/core/storage/json-guards.ts +80 -74
- package/src/core/storage/key-value.ts +66 -66
- package/src/core/ticket.ts +43 -43
- package/src/core/turns/hub-turns.ts +161 -0
- package/src/core/turns/turn-game.ts +510 -0
- package/src/core/turns/your-turn-buzz.ts +69 -0
- package/src/core/types.ts +134 -134
- package/src/core/version/client-version.gen.ts +2 -2
- package/src/core/version/hub-version.ts +62 -62
- package/src/core/version/semver.ts +97 -97
- package/src/daily/daily-system.ts +276 -161
- package/src/daily/page-daily.ts +36 -36
- package/src/daily/types.ts +105 -67
- package/src/daily.ts +10 -10
- package/src/doctor/checks.ts +86 -76
- package/src/doctor/cli.ts +101 -106
- package/src/doctor/hub-version-fetch.ts +43 -0
- package/src/doctor/tsconfig.json +12 -12
- package/src/doctor/world-check.ts +61 -0
- package/src/globals.ts +115 -110
- package/src/index.ts +68 -50
- package/src/input/device-state.ts +146 -146
- package/src/input/edges.ts +55 -55
- package/src/input/focus-ring.ts +13 -0
- package/src/input/gamepad.ts +61 -61
- package/src/input/input-events.ts +32 -32
- package/src/input/input-registry.ts +171 -164
- package/src/input/input-system.ts +406 -393
- package/src/input/legacy-controls.ts +64 -64
- package/src/input/modality.ts +122 -0
- package/src/input/nav-state.ts +200 -191
- package/src/input/navigator.ts +182 -171
- package/src/input/on-screen-controls.ts +101 -101
- package/src/input/page-control.ts +43 -43
- package/src/input/page-input.ts +193 -193
- package/src/input/player-remaps.ts +77 -77
- package/src/input/source-values.ts +116 -116
- package/src/input/spatial.ts +47 -47
- package/src/input/types.ts +331 -331
- package/src/input/zero-config.ts +164 -177
- package/src/input.ts +26 -22
- package/src/mp.ts +10 -10
- package/src/overlay/controls-panel.ts +163 -163
- package/src/overlay/dom.ts +46 -46
- package/src/overlay/layout-clusters.ts +162 -162
- package/src/overlay/layout-geometry.ts +136 -136
- package/src/overlay/layout.ts +203 -203
- package/src/overlay/listener-scope.ts +23 -23
- package/src/overlay/on-screen-keyboard.ts +137 -137
- package/src/overlay/overlay.ts +234 -208
- package/src/overlay/styles.ts +13 -12
- package/src/overlay/virtual-controls.ts +262 -262
- package/src/race.ts +10 -10
- package/src/realtime/bridge.ts +126 -121
- package/src/realtime/cross-bundle.ts +29 -29
- package/src/realtime/fallback-notice.ts +48 -48
- package/src/realtime/hub-link.ts +65 -65
- package/src/realtime/latest-state.ts +33 -33
- package/src/realtime/multiplayer-forwarder.ts +40 -28
- package/src/realtime/multiplayer-types.ts +66 -52
- package/src/realtime/page-runtime.ts +60 -60
- package/src/realtime/race-forwarder.ts +59 -59
- package/src/realtime/race-types.ts +132 -132
- package/src/realtime/room-types.ts +151 -125
- package/src/realtime/rooms-forwarder.ts +104 -79
- package/src/realtime/runtime-api.ts +74 -49
- package/src/realtime/runtime-opener.ts +61 -61
- package/src/realtime/social-forwarder.ts +77 -72
- package/src/realtime/social-types.ts +86 -78
- package/src/realtime/types.ts +54 -53
- package/src/realtime/wire-types.ts +79 -72
- package/src/realtime/world-types.ts +20 -0
- package/src/rooms.ts +10 -10
- package/src/social.ts +19 -18
- package/src/turns-kit/check-rules.ts +281 -0
- package/src/turns-rules.ts +12 -0
- package/src/turns.ts +14 -0
- package/src/types.ts +13 -13
- package/src/uistack/page-stack.ts +45 -45
- package/src/uistack/play-suspension.ts +82 -82
- package/src/uistack/types.ts +76 -76
- package/src/uistack/ui-stack.ts +144 -144
package/dist/doctor/cli.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
3
3
|
import { join, resolve } from "node:path";
|
|
4
4
|
import { parseArgs } from "node:util";
|
|
5
|
-
import { GamePackageJson, HubVersion } from "@diffenderfer-games/hub-contract";
|
|
5
|
+
import { GAME_LABELS, GamePackageJson, HubVersion, splitGameLabels } from "@diffenderfer-games/hub-contract";
|
|
6
|
+
import { BUILT_IN_WORLD_TYPES, WORLD_LIMITS, parseWorldMapText } from "@diffenderfer-games/world";
|
|
6
7
|
//#region src/core/version/client-version.gen.ts
|
|
7
8
|
/** This client's package version, sent as `x-hub-client` on REST calls and `client` in `hello`. */
|
|
8
|
-
const HUB_CLIENT_VERSION = "2.0.0-next.
|
|
9
|
+
const HUB_CLIENT_VERSION = "2.0.0-next.10";
|
|
9
10
|
//#endregion
|
|
10
11
|
//#region src/core/version/semver.ts
|
|
11
12
|
const VERSION_PATTERN = /^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
@@ -81,6 +82,39 @@ function clientSupport(hubVersion, version = HUB_CLIENT_VERSION) {
|
|
|
81
82
|
return satisfiesRange(version, hubVersion.deprecated) ? "deprecated" : "supported";
|
|
82
83
|
}
|
|
83
84
|
//#endregion
|
|
85
|
+
//#region src/doctor/hub-version-fetch.ts
|
|
86
|
+
/**
|
|
87
|
+
* Reading the hub's `GET /_api/version` for `hub-doctor`, with a timeout so a
|
|
88
|
+
* hung or unreachable hub fails a game's CI quickly instead of stalling it.
|
|
89
|
+
*/
|
|
90
|
+
/** How long the doctor waits for the hub by default, ms. */
|
|
91
|
+
const DEFAULT_HUB_TIMEOUT_MS = 1e4;
|
|
92
|
+
/** Whether a version lookup failed. */
|
|
93
|
+
function isHubUnreachable(lookup) {
|
|
94
|
+
return lookup !== null && "unreachableUrl" in lookup;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The hub's version: `null` for a hub from before versioning (404), a
|
|
98
|
+
* {@link HubUnreachable} when it can't be read within `timeoutMs`.
|
|
99
|
+
*/
|
|
100
|
+
async function fetchHubVersion(hubUrl, timeoutMs = DEFAULT_HUB_TIMEOUT_MS) {
|
|
101
|
+
const url = new URL("/_api/version", hubUrl).toString();
|
|
102
|
+
try {
|
|
103
|
+
const response = await fetch(url, { signal: AbortSignal.timeout(timeoutMs) });
|
|
104
|
+
if (response.status === 404) return null;
|
|
105
|
+
if (!response.ok) return {
|
|
106
|
+
unreachableUrl: url,
|
|
107
|
+
reason: `HTTP ${String(response.status)}`
|
|
108
|
+
};
|
|
109
|
+
return HubVersion.parse(await response.json());
|
|
110
|
+
} catch (failure) {
|
|
111
|
+
return {
|
|
112
|
+
unreachableUrl: url,
|
|
113
|
+
reason: failure instanceof Error && (failure.name === "TimeoutError" || failure.name === "AbortError") ? `timed out after ${String(timeoutMs)} ms` : failure instanceof Error ? failure.message : String(failure)
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
84
118
|
//#region src/doctor/checks.ts
|
|
85
119
|
/**
|
|
86
120
|
* The checks `hub-doctor` runs on a game (plan §4.3.7). Each returns
|
|
@@ -90,14 +124,15 @@ function clientSupport(hubVersion, version = HUB_CLIENT_VERSION) {
|
|
|
90
124
|
const UPDATE_FIX = "run `npm update @diffenderfer-games/hub`";
|
|
91
125
|
/**
|
|
92
126
|
* The installed client against the hub's `/_api/version`: outside
|
|
93
|
-
* `supported` is an error, `deprecated` a warning
|
|
94
|
-
* versioning)
|
|
127
|
+
* `supported` is an error, `deprecated` a warning, `null` (a hub from before
|
|
128
|
+
* versioning) is only reported. An unreachable or slow hub is an error, so a
|
|
129
|
+
* game's CI notices (`--offline` skips the check).
|
|
95
130
|
*/
|
|
96
131
|
function checkClientVersion(installedVersion, hubVersion) {
|
|
97
|
-
if (hubVersion
|
|
98
|
-
level: "
|
|
132
|
+
if (isHubUnreachable(hubVersion)) return [{
|
|
133
|
+
level: "error",
|
|
99
134
|
check: "version",
|
|
100
|
-
message: `
|
|
135
|
+
message: `hub unreachable at ${hubVersion.unreachableUrl} (${hubVersion.reason}); check --hub, or pass --offline to skip the version check`
|
|
101
136
|
}];
|
|
102
137
|
switch (clientSupport(hubVersion, installedVersion)) {
|
|
103
138
|
case "unsupported": return [{
|
|
@@ -140,11 +175,18 @@ function checkVendoredCopies(gameDir) {
|
|
|
140
175
|
/** The `package.json` `game.*` block against the contract's manifest schema. */
|
|
141
176
|
function checkManifest(packageJson) {
|
|
142
177
|
const parsed = GamePackageJson.safeParse(packageJson);
|
|
143
|
-
if (parsed.success)
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
178
|
+
if (parsed.success) {
|
|
179
|
+
const unknownLabels = splitGameLabels(parsed.data.game.labels ?? []).unknown;
|
|
180
|
+
return [{
|
|
181
|
+
level: "info",
|
|
182
|
+
check: "manifest",
|
|
183
|
+
message: `the game.* block is valid (${parsed.data.game.type})`
|
|
184
|
+
}, ...unknownLabels.map((label) => ({
|
|
185
|
+
level: "warning",
|
|
186
|
+
check: "manifest",
|
|
187
|
+
message: `game.labels: "${label}" is not a known label (the catalog ignores it); use any of ${GAME_LABELS.join(", ")}`
|
|
188
|
+
}))];
|
|
189
|
+
}
|
|
148
190
|
return parsed.error.issues.map((issue) => ({
|
|
149
191
|
level: "error",
|
|
150
192
|
check: "manifest",
|
|
@@ -152,20 +194,72 @@ function checkManifest(packageJson) {
|
|
|
152
194
|
}));
|
|
153
195
|
}
|
|
154
196
|
//#endregion
|
|
197
|
+
//#region src/doctor/world-check.ts
|
|
198
|
+
/**
|
|
199
|
+
* `hub-doctor`'s world check (docs/plans/world.md §14.6): a `game.world.map`
|
|
200
|
+
* file must exist inside the game, be within the size limit and be a valid
|
|
201
|
+
* `dg-world@1` map (the same `parseWorldMapText` the hub runs at load); a
|
|
202
|
+
* `game.world.generate.type` the hub doesn't know is a warning.
|
|
203
|
+
*/
|
|
204
|
+
/** The most map problems listed (the rest are counted). */
|
|
205
|
+
const MAX_LISTED_PROBLEMS = 20;
|
|
206
|
+
/** Checks the map file and world type `game.world` names. A manifest that doesn't parse is left to `checkManifest`. */
|
|
207
|
+
function checkWorld(gameDir, packageJson) {
|
|
208
|
+
const parsed = GamePackageJson.safeParse(packageJson);
|
|
209
|
+
const world = parsed.success ? parsed.data.game.world : void 0;
|
|
210
|
+
if (world === void 0) return [];
|
|
211
|
+
const findings = [];
|
|
212
|
+
const type = world.generate?.type;
|
|
213
|
+
if (type !== void 0 && !BUILT_IN_WORLD_TYPES.some((known) => known.id === type)) findings.push({
|
|
214
|
+
level: "warning",
|
|
215
|
+
check: "world",
|
|
216
|
+
message: `game.world.generate.type: the hub has no world type "${type}"; use one of ${BUILT_IN_WORLD_TYPES.map((known) => known.id).join(", ")}`
|
|
217
|
+
});
|
|
218
|
+
return world.map === void 0 ? findings : [...findings, ...checkMapFile(gameDir, world.map)];
|
|
219
|
+
}
|
|
220
|
+
/** One map file's findings. */
|
|
221
|
+
function checkMapFile(gameDir, mapFile) {
|
|
222
|
+
const path = join(gameDir, mapFile);
|
|
223
|
+
const error = (message) => ({
|
|
224
|
+
level: "error",
|
|
225
|
+
check: "world",
|
|
226
|
+
message: `game.world.map (${mapFile}): ${message}`
|
|
227
|
+
});
|
|
228
|
+
if (!existsSync(path) || !statSync(path).isFile()) return [error("the file does not exist (build or commit it)")];
|
|
229
|
+
const bytes = statSync(path).size;
|
|
230
|
+
if (bytes > WORLD_LIMITS.bytes) return [error(`${String(bytes)} bytes is over the ${String(WORLD_LIMITS.bytes)}-byte limit (save layers as "rle")`)];
|
|
231
|
+
const result = parseWorldMapText(readFileSync(path, "utf8"));
|
|
232
|
+
const listed = result.problems.slice(0, MAX_LISTED_PROBLEMS).map((problem) => ({
|
|
233
|
+
level: problem.severity === "error" ? "error" : "warning",
|
|
234
|
+
check: "world",
|
|
235
|
+
message: `game.world.map (${mapFile}): ${problem.message}`
|
|
236
|
+
}));
|
|
237
|
+
const more = result.problems.length - listed.length;
|
|
238
|
+
if (more > 0) listed.push(error(`and ${String(more)} more problems`));
|
|
239
|
+
if (!result.ok) return listed;
|
|
240
|
+
const { map } = result;
|
|
241
|
+
return [...listed, {
|
|
242
|
+
level: "info",
|
|
243
|
+
check: "world",
|
|
244
|
+
message: `game.world.map (${mapFile}) is a valid dg-world@1 map: ${map.title}, ${String(map.width)} × ${String(map.height)}, ${String(map.objects.length)} objects, ${String(bytes)} bytes`
|
|
245
|
+
}];
|
|
246
|
+
}
|
|
247
|
+
//#endregion
|
|
155
248
|
//#region src/doctor/cli.ts
|
|
156
249
|
/**
|
|
157
250
|
* `hub-doctor`: checks a game against the hub (plan §4.3.7). Run it in a
|
|
158
251
|
* game's folder, in CI and before pushing:
|
|
159
252
|
*
|
|
160
253
|
* ```sh
|
|
161
|
-
* npx hub-doctor [--dir <game folder>] [--hub <url>] [--offline] [--json]
|
|
254
|
+
* npx hub-doctor [--dir <game folder>] [--hub <url>] [--timeout <ms>] [--offline] [--json]
|
|
162
255
|
* ```
|
|
163
256
|
*
|
|
164
257
|
* - the installed `@diffenderfer-games/hub` against the hub's
|
|
165
258
|
* `/_api/version` (`--hub`, default `https://diffenderfer.games`): outside
|
|
166
259
|
* `supported` fails, `deprecated` warns (`--offline` skips this check);
|
|
167
260
|
* - a stale vendored `src/hub/` copy or `scripts/sync-hub.mjs` warns;
|
|
168
|
-
* - the `package.json` `game.*` block must match the contract's schema
|
|
261
|
+
* - the `package.json` `game.*` block must match the contract's schema;
|
|
262
|
+
* - a `game.world.map` file must exist and be a valid `dg-world@1` map within the size limit.
|
|
169
263
|
*
|
|
170
264
|
* Exits 1 when any check fails.
|
|
171
265
|
*/
|
|
@@ -174,6 +268,7 @@ function readOptions() {
|
|
|
174
268
|
const { values } = parseArgs({ options: {
|
|
175
269
|
dir: { type: "string" },
|
|
176
270
|
hub: { type: "string" },
|
|
271
|
+
timeout: { type: "string" },
|
|
177
272
|
offline: {
|
|
178
273
|
type: "boolean",
|
|
179
274
|
default: false
|
|
@@ -183,9 +278,15 @@ function readOptions() {
|
|
|
183
278
|
default: false
|
|
184
279
|
}
|
|
185
280
|
} });
|
|
281
|
+
const timeoutMs = values.timeout === void 0 ? DEFAULT_HUB_TIMEOUT_MS : Number(values.timeout);
|
|
282
|
+
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
|
|
283
|
+
process.stderr.write("hub-doctor: --timeout must be a positive number of milliseconds\n");
|
|
284
|
+
process.exit(2);
|
|
285
|
+
}
|
|
186
286
|
return {
|
|
187
287
|
gameDir: resolve(values.dir ?? "."),
|
|
188
288
|
hubUrl: values.hub ?? DEFAULT_HUB_URL,
|
|
289
|
+
timeoutMs,
|
|
189
290
|
isOffline: values.offline,
|
|
190
291
|
isJson: values.json
|
|
191
292
|
};
|
|
@@ -201,23 +302,13 @@ function installedClientVersion(gameDir) {
|
|
|
201
302
|
} catch {}
|
|
202
303
|
return HUB_CLIENT_VERSION;
|
|
203
304
|
}
|
|
204
|
-
/** The hub's `/_api/version`: `null` for a hub without it, an `Error` when unreachable. */
|
|
205
|
-
async function fetchHubVersion(hubUrl) {
|
|
206
|
-
try {
|
|
207
|
-
const response = await fetch(new URL("/_api/version", hubUrl));
|
|
208
|
-
if (response.status === 404) return null;
|
|
209
|
-
if (!response.ok) return /* @__PURE__ */ new Error(`HTTP ${String(response.status)}`);
|
|
210
|
-
return HubVersion.parse(await response.json());
|
|
211
|
-
} catch (failure) {
|
|
212
|
-
return failure instanceof Error ? failure : new Error(String(failure));
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
305
|
async function runDoctor(options) {
|
|
216
306
|
const findings = [];
|
|
217
|
-
if (!options.isOffline) findings.push(...checkClientVersion(installedClientVersion(options.gameDir), await fetchHubVersion(options.hubUrl)));
|
|
307
|
+
if (!options.isOffline) findings.push(...checkClientVersion(installedClientVersion(options.gameDir), await fetchHubVersion(options.hubUrl, options.timeoutMs)));
|
|
218
308
|
findings.push(...checkVendoredCopies(options.gameDir));
|
|
219
309
|
try {
|
|
220
|
-
|
|
310
|
+
const packageJson = readJsonFile(join(options.gameDir, "package.json"));
|
|
311
|
+
findings.push(...checkManifest(packageJson), ...checkWorld(options.gameDir, packageJson));
|
|
221
312
|
} catch (failure) {
|
|
222
313
|
findings.push({
|
|
223
314
|
level: "error",
|
package/dist/doctor/cli.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.mjs","names":[],"sources":["../../src/core/version/client-version.gen.ts","../../src/core/version/semver.ts","../../src/core/version/hub-version.ts","../../src/doctor/checks.ts","../../src/doctor/cli.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.mjs","names":[],"sources":["../../src/core/version/client-version.gen.ts","../../src/core/version/semver.ts","../../src/core/version/hub-version.ts","../../src/doctor/hub-version-fetch.ts","../../src/doctor/checks.ts","../../src/doctor/world-check.ts","../../src/doctor/cli.ts"],"mappings":";;;;;;;;AAEA,MAAa,qBAAqB;;;ACclC,MAAM,kBAAkB;;AAGxB,SAAgB,aAAa,MAAyC;CACpE,MAAM,QAAQ,gBAAgB,KAAK,KAA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,CAAC;CAC1F,SAAS,SAAS;EAChB,SAAS,KAAK;GAAE,OAAO;GAAS,OAAO;GAAY,SAAS,gCAAgC,mBAAmB,QAAQ,QAAQ,UAAU,OAAO,OAAO;EAAI,CAAC;CAC9J;CACA,OAAO;AACT;AAEA,MAAM,UAAU,YAAY;AAC5B,MAAM,WAAW,MAAM,UAAU,OAAO;AACxC,IAAI,QAAQ,QACV,QAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,EAAE,SAAS,GAAG,MAAM,CAAC,EAAE,GAAG;KAEjE,KAAK,MAAM,WAAW,UACpB,QAAQ,OAAO,MAAM,GAAG,QAAQ,MAAM,OAAO,CAAC,EAAE,GAAG,QAAQ,MAAM,IAAI,QAAQ,QAAQ,GAAG;AAG5F,QAAQ,WAAW,SAAS,MAAM,YAAY,QAAQ,UAAU,OAAO,IAAI,IAAI"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import {
|
|
3
|
-
import { $ as
|
|
4
|
-
import { a as
|
|
1
|
+
import { A as SAVED_OPEN_EVENT, C as SavedKind, D as TurnSummary, E as SavedStatus, M as SavedOpened, N as savedGameUrl, O as SAVED_CHANGE_EVENT, S as SavedEntry, T as SavedProgress, _ as DailyStartResponse, a as isDailySystem, b as SavedCounts, c as DailyAll, d as DailyCompletionMeta, f as DailyDefinition, g as DailySaveInput, h as DailyHost, i as getDaily, j as SAVED_OPEN_PARAM, k as SAVED_KIND_PARAM, l as DailyChallenge, m as DailyGameStatus, n as DailyCompletions, o as DAILY_START_EVENT, p as DailyEventDetail, r as DAILY_SINGLETON_API, s as DailySystem, t as DailyCompletion, u as DailyCompleteResponse, v as DailyStatus, w as SavedListOptions, x as SavedDaily, y as GamePayload } from "./shared/daily.js";
|
|
2
|
+
import { a as RaceRecordPlayer, c as RealtimeErrorShape, d as RoomSeat, f as RoomSeatChange, g as Snapshot, h as ServerEvents, i as RaceHistory, l as RoomChatLine, m as SchemaOutput, n as InviteLink, o as RaceResultPlayer, p as RoomStateChange, r as Notice, s as RaceStatusEvent, t as InviteCreated, u as RoomMessage } from "./shared/wire-types.js";
|
|
3
|
+
import { $ as NavTarget, A as PageInputControl, B as InputConfig, C as INPUT_SINGLETON_API, D as parseInputOverrides, E as isInputSystem, F as AxisSide, G as InputReading, H as InputEvents, I as DraggedSpot, J as MouseMapping, K as InputSource, L as EdgeOffsets, M as AutoNavigateTarget, N as Anchor, O as InputSystem, P as AxisDef, Q as NavFocusEvent, R as GamepadMapping, S as FOCUS_RING_SHADOW, T as getInput, U as InputHost, V as InputDef, W as InputOverrides, X as NavElement, Y as NavBlurEvent, Z as NavElementKind, _ as boxesTouch, a as OverlayEdge, at as VirtualDef, b as MODALITY_ATTRIBUTE, c as OverlayReason, d as LayoutOptions, et as NavigableDef, f as layoutControls, g as LayoutItem, h as LayoutBox, i as AutoPauseOptions, it as VirtualControlType, j as isPageInputControl, k as InputSystemOptions, l as UiStack, m as Insets, n as getUiStack, nt as TouchMapping, o as OverlayEvent, ot as VirtualInputs, p as Overlay, q as MenuBridge, r as isUiStack, rt as Vector, s as OverlayListener, st as VirtualOverride, t as UI_STACK_VERSION, tt as Rect, u as UiStackHandoff, v as controlSize, w as InputOptions, x as trackInputModality, y as InputModality, z as GroupDef } from "./shared/input.js";
|
|
4
|
+
import { a as InviteResult, i as InviteOptions, n as HubMpApi, o as JoinInfoEvent, r as InviteLinkMethods, t as BusyOptions } from "./shared/multiplayer-types.js";
|
|
5
5
|
import { o as multiplayerForwarder } from "./shared/mp.js";
|
|
6
|
-
import { a as RoomEvents, c as
|
|
6
|
+
import { a as RoomEvents, c as RoomSelf, d as RoomStateOptions, i as RoomCreateOptions, l as RoomSendOptions, n as HubRoomsApi, o as RoomListOptions, r as JoinOptions, s as RoomReclaimMethods, t as HubRoom, u as RoomState } from "./shared/room-types.js";
|
|
7
7
|
import { a as RaceHistoryQuery, c as RaceRuntimeApi, i as RaceEvents, l as RaceStart, n as RaceCreateOptions, o as RaceHistoryViewOptions, r as RaceDefinition, s as RaceHudPlace, t as HubRaceApi } from "./shared/race-types.js";
|
|
8
8
|
import { f as raceForwarder } from "./shared/race.js";
|
|
9
9
|
import { n as roomsForwarder } from "./shared/rooms.js";
|
|
10
|
-
import { $ as
|
|
11
|
-
import { $ as
|
|
12
|
-
export { type Anchor, type Audience, type AuthResponse, type AutoPauseOptions, type AxisDef, type AxisSide, type Board, type BoardWithTop, type BufferedEvent, type BusyOptions, CLIENT_VERSION_HEADER, type ChatMode, type ClientSupport, ContentRejectedError, type Conversation, type Counts, DAILY_SINGLETON_API, DAILY_START_EVENT, type DailyAll, type DailyChallenge, type DailyCompleteResponse, type DailyCompletion, type DailyCompletionMeta, type DailyCompletions, type DailyDefinition, type DailyEventDetail, type DailyGameStatus, type DailyHost, type DailyStartResponse, type DailyStatus, DailySystem, type DraggedSpot, type EdgeOffsets, type EndpointFields, type EndpointName, type EndpointReply, type ErrorBody, type FriendEntry, type GameAnalytics, type GameInfo, type GameLeaderboards, type GamePayload, type GameRecords, type GamepadMapping, type GlobalAnalytics, type GrantBundle, type GroupDef, HUB_CLIENT_VERSION, Hub, HubError, type HubErrorCode, type HubErrorDetails, type HubMenuControl, type HubMpApi, type HubNotifyApi, type HubOptions, type HubPresenceApi, type HubRaceApi, type HubRoom, type HubRoomsApi, type HubSocialApi, type HubStatus, INPUT_SINGLETON_API, type InputConfig, type InputDef, type InputEvents, type InputHost, type InputOptions, type InputOverrides, type InputReading, type InputSource, InputSystem, type InputSystemOptions, type Insets, type Inventory, type InventorySnapshot, type Invite, type InviteCreated, type InviteOptions, type InviteResult, type JoinInfo, type JoinInfoEvent, type JoinOptions, type Json, type Launch, type LaunchTicket, type LayoutBox, type LayoutItem, type LayoutOptions, type LeaderboardEntry, type LeaderboardResult, type MeResponse, type MenuBridge, type Message, type MessagesPage, type Metrics, type MouseMapping, type NavBlurEvent, type NavElement, type NavElementKind, type NavFocusEvent, type NavTarget, type NavigableDef, type Notice, type NotifyChange, type NotifyPrefs, OfflineError, type OpenInviteOptions, Overlay, type OverlayEdge, type OverlayEvent, type OverlayListener, type OverlayReason, type PageInputControl, type Party, type PlayerCard, type PlayerLite, type PlayerRef, type Presence, type PresenceInput, type PresenceKind, type Profile, type ProfilePatch, type ProfileSummary, type ProfileUpdate, type QueueOp, type QueueOpInput, type QueuedScoreOptions, type REALTIME_FAILED_EVENT, type REALTIME_FEATURE_VERSION, type REALTIME_READY_EVENT, type REALTIME_SINGLETON_API, type RaceCreateOptions, type RaceDefinition, type RaceEvents, type RaceHistory, type RaceHistoryQuery, type RaceHistoryViewOptions, type RaceHudPlace, type RaceOutcome, type RaceParams, type RaceRecord, type RaceRecordPlayer, type RaceResult, type RaceResultPlayer, type RaceRuntimeApi, type RaceStart, type RaceStatValue, type RaceState, type RaceStats, type RaceStatusEvent, type Racer, type RacerResult, type RacerState, type RealtimeApi, type RealtimeErrorShape, type RealtimeHubLink, type RecentPlayer, type Rect, type Relation, type ReportInput, type ReportKind, type ReportReason, type RoomChatLine, type RoomCreateOptions, type RoomEvents, type RoomInfo, type RoomListOptions, type RoomMessage, type RoomSeat, type RoomSelf, type RoomSendOptions, type RoomState, type RoomStateChange, type RoomStateOptions, type Save, type SaveMeta, type SchemaOutput, type ServerEvents, type Snapshot, type SnapshotResponse, type SocialConfig, type SocialCounts, type SocialEvents, type SocialMe, type SortDir, type StatResult, type Stats, type SubmitScoreOptions, type SubmitScoreResult, type Suggestion, type SuggestionStatus, type SyncConflict, type SyncResult, type TouchMapping, type TradeBundle, type TradeId, type TradeListOptions, type TradeNoteOptions, UI_STACK_VERSION, UNSUPPORTED_BY_HUB, type UiStack, type UiStackHandoff, type User, type Vector, type VirtualControlType, type VirtualDef, type VirtualInputs, type VirtualOverride, boxesTouch, controlSize, createHub, type findRealtimeApi, getDaily, getInput, getUiStack, hub, isDailySystem, isInputSystem, isPageInputControl, type isRealtimeApi, isUiStack, layoutControls, type linkRealtimeToHub, type multiplayerForwarder as mp, type notifyForwarder as notify, parseInputOverrides, type presenceForwarder as presence, type raceForwarder as race, type roomsForwarder as rooms, type socialForwarder as social };
|
|
10
|
+
import { $ as AvatarRef, A as RacerState, B as SuggestionStatus, C as RaceRecord, D as RaceStats, E as RaceState, F as ReportReason, G as REALTIME_READY_EVENT, H as isRealtimeApi, I as RoomInfo, J as SESSION_EVENT, K as REALTIME_SINGLETON_API, L as SocialConfig, M as Relation, N as ReportInput, O as Racer, P as ReportKind, Q as AvatarChange, R as SocialMe, S as RaceParams, T as RaceStatValue, U as REALTIME_FAILED_EVENT, V as findRealtimeApi, W as REALTIME_FEATURE_VERSION, X as WorldEventName, Y as RuntimeWorldApi, Z as WorldOpName, _ as PlayerLite, a as ErrorBody, at as notifyForwarder, b as PresenceKind, c as JoinInfo, ct as HubNotifyApi, d as Message, dt as OpenInviteOptions, et as DesignerResult, f as MessagesPage, ft as PlayOnlineMethods, g as PlayerCard, h as Party, ht as SocialEvents, i as Counts, it as linkRealtimeToHub, j as RecentPlayer, k as RacerResult, l as Launch, lt as HubPresenceApi, m as NotifyPrefs, mt as SocialCounts, n as ChatMode, nt as RuntimeAvatarApi, o as FriendEntry, ot as presenceForwarder, p as NotifyChange, pt as PlayerRef, q as RealtimeApi, r as Conversation, rt as RealtimeHubLink, s as Invite, st as socialForwarder, t as Audience, tt as OpenDesignerOptions, u as LaunchTicket, ut as HubSocialApi, v as Presence, w as RaceResult, x as RaceOutcome, y as PresenceInput, z as Suggestion } from "./shared/social.js";
|
|
11
|
+
import { $ as TradeListOptions, $t as AvatarModule, A as TurnGame, At as HubOptions, B as HubResume, Bt as ProfileSummary, C as TURN_LINK_PARAM, Ct as Board, D as TURN_POLL_MS, Dt as GameLeaderboards, E as TURN_EVENT, Et as GameInfo, F as HubSaved, Ft as LeaderboardEntry, G as ResumeLoadOptions, Gt as Stats, H as RESUME_MAX_STATE_BYTES, Ht as SaveMeta, I as SAVED_CHANGE_QUIET_MS, It as LeaderboardResult, J as ResumeSaveInput, Jt as User, K as ResumeProgress, Kt as SubmitScoreOptions, L as SavedChangeListener, Lt as MeResponse, M as TurnGameOptions, Mt as Inventory, N as TurnMoveEvent, Nt as InventorySnapshot, O as TURN_QUIET_MS, Ot as GameRecords, P as TurnOutcome, Pt as Json, Q as TradeId, Qt as AvatarHost, R as SavedOpenDetail, Rt as Metrics, S as HubTurns, St as BufferedEvent, T as TURN_CHAT_EVENT, Tt as GameAnalytics, U as ResumeBlocker, Ut as SnapshotResponse, V as RESUME_DEBOUNCE_MS, Vt as Save, W as ResumeEntry, Wt as SortDir, X as GrantBundle, Xt as EndpointName, Y as HubMenuControl, Yt as EndpointFields, Z as TradeBundle, Zt as EndpointReply, _ as UNSUPPORTED_BY_HUB, _t as CLIENT_VERSION_HEADER, a as HUB_CLIENT_VERSION, at as SyncResult, b as hub, bt as QueueOpInput, c as isNewlyDue, ct as OfflineEventDetails, d as ContentRejectedError, dt as OfflineOp, en as HubAvatar, et as TradeNoteOptions, f as HubError, ft as OUTBOX_MAX_CHARS, g as SAVE_UNKNOWN_CODE, gt as ReplayContext, h as OfflineError, ht as OfflineKindDefinition, i as TurnGameView, it as SyncConflict, j as TurnGameEvents, jt as HubStatus, k as TURN_RESYNC_EVENT, kt as GlobalAnalytics, l as readYourTurnBuzz, lt as OfflineEventName, m as HubErrorDetails, mt as OfflineHandler, n as TurnChatLine, nt as ProfileUpdate, o as YOUR_TURN_BUZZ, ot as OfflineApi, p as HubErrorCode, pt as OUTBOX_MAX_ENTRIES, q as ResumeRun, qt as SubmitScoreResult, r as TurnDeadline, rt as StatResult, s as YOUR_TURN_BUZZ_KEY, st as OUTBOX_FULL_CODE, t as OpenTurnGame, tn as CarriesLook, tt as AuthResponse, u as saveYourTurnBuzz, ut as OfflineListener, v as Hub, vt as ProfilePatch, w as TurnCreateOptions, wt as BoardWithTop, x as ClientSupport, xt as QueuedScoreOptions, y as createHub, yt as QueueOp, z as SavedOpenHandler, zt as Profile } from "./shared/index.js";
|
|
12
|
+
export { type Anchor, type Audience, type AuthResponse, type AutoNavigateTarget, type AutoPauseOptions, type AvatarChange, type AvatarHost, type AvatarModule, type AvatarRef, type AxisDef, type AxisSide, type Board, type BoardWithTop, type BufferedEvent, type BusyOptions, CLIENT_VERSION_HEADER, type CarriesLook, type ChatMode, type ClientSupport, ContentRejectedError, type Conversation, type Counts, DAILY_SINGLETON_API, DAILY_START_EVENT, type DailyAll, type DailyChallenge, type DailyCompleteResponse, type DailyCompletion, type DailyCompletionMeta, type DailyCompletions, type DailyDefinition, type DailyEventDetail, type DailyGameStatus, type DailyHost, type DailySaveInput, type DailyStartResponse, type DailyStatus, DailySystem, type DesignerResult, type DraggedSpot, type EdgeOffsets, type EndpointFields, type EndpointName, type EndpointReply, type ErrorBody, FOCUS_RING_SHADOW, type FriendEntry, type GameAnalytics, type GameInfo, type GameLeaderboards, type GamePayload, type GameRecords, type GamepadMapping, type GlobalAnalytics, type GrantBundle, type GroupDef, HUB_CLIENT_VERSION, Hub, HubAvatar, HubError, type HubErrorCode, type HubErrorDetails, type HubMenuControl, type HubMpApi, type HubNotifyApi, type HubOptions, type HubPresenceApi, type HubRaceApi, HubResume, type HubRoom, type HubRoomsApi, HubSaved, type HubSocialApi, type HubStatus, HubTurns, INPUT_SINGLETON_API, type InputConfig, type InputDef, type InputEvents, type InputHost, type InputModality, type InputOptions, type InputOverrides, type InputReading, type InputSource, InputSystem, type InputSystemOptions, type Insets, type Inventory, type InventorySnapshot, type Invite, type InviteCreated, type InviteLink, type InviteLinkMethods, type InviteOptions, type InviteResult, type JoinInfo, type JoinInfoEvent, type JoinOptions, type Json, type Launch, type LaunchTicket, type LayoutBox, type LayoutItem, type LayoutOptions, type LeaderboardEntry, type LeaderboardResult, MODALITY_ATTRIBUTE, type MeResponse, type MenuBridge, type Message, type MessagesPage, type Metrics, type MouseMapping, type NavBlurEvent, type NavElement, type NavElementKind, type NavFocusEvent, type NavTarget, type NavigableDef, type Notice, type NotifyChange, type NotifyPrefs, OUTBOX_FULL_CODE, OUTBOX_MAX_CHARS, OUTBOX_MAX_ENTRIES, OfflineApi, OfflineError, type OfflineEventDetails, type OfflineEventName, type OfflineHandler, type OfflineKindDefinition, type OfflineListener, type OfflineOp, type OpenDesignerOptions, type OpenInviteOptions, type OpenTurnGame, Overlay, type OverlayEdge, type OverlayEvent, type OverlayListener, type OverlayReason, type PageInputControl, type Party, type PlayOnlineMethods, type PlayerCard, type PlayerLite, type PlayerRef, type Presence, type PresenceInput, type PresenceKind, type Profile, type ProfilePatch, type ProfileSummary, type ProfileUpdate, type QueueOp, type QueueOpInput, type QueuedScoreOptions, type REALTIME_FAILED_EVENT, type REALTIME_FEATURE_VERSION, type REALTIME_READY_EVENT, type REALTIME_SINGLETON_API, RESUME_DEBOUNCE_MS, RESUME_MAX_STATE_BYTES, type RaceCreateOptions, type RaceDefinition, type RaceEvents, type RaceHistory, type RaceHistoryQuery, type RaceHistoryViewOptions, type RaceHudPlace, type RaceOutcome, type RaceParams, type RaceRecord, type RaceRecordPlayer, type RaceResult, type RaceResultPlayer, type RaceRuntimeApi, type RaceStart, type RaceStatValue, type RaceState, type RaceStats, type RaceStatusEvent, type Racer, type RacerResult, type RacerState, type RealtimeApi, type RealtimeErrorShape, type RealtimeHubLink, type RecentPlayer, type Rect, type Relation, type ReplayContext, type ReportInput, type ReportKind, type ReportReason, type ResumeBlocker, type ResumeEntry, type ResumeLoadOptions, type ResumeProgress, type ResumeRun, type ResumeSaveInput, type RoomChatLine, type RoomCreateOptions, type RoomEvents, type RoomInfo, type RoomListOptions, type RoomMessage, type RoomReclaimMethods, type RoomSeat, type RoomSeatChange, type RoomSelf, type RoomSendOptions, type RoomState, type RoomStateChange, type RoomStateOptions, type RuntimeAvatarApi, type RuntimeWorldApi, SAVED_CHANGE_EVENT, SAVED_CHANGE_QUIET_MS, SAVED_KIND_PARAM, SAVED_OPEN_EVENT, SAVED_OPEN_PARAM, SAVE_UNKNOWN_CODE, type SESSION_EVENT, type Save, type SaveMeta, type SavedChangeListener, type SavedCounts, type SavedDaily, type SavedEntry, type SavedKind, type SavedListOptions, type SavedOpenDetail, type SavedOpenHandler, type SavedOpened, type SavedProgress, type SavedStatus, type SchemaOutput, type ServerEvents, type Snapshot, type SnapshotResponse, type SocialConfig, type SocialCounts, type SocialEvents, type SocialMe, type SortDir, type StatResult, type Stats, type SubmitScoreOptions, type SubmitScoreResult, type Suggestion, type SuggestionStatus, type SyncConflict, type SyncResult, TURN_CHAT_EVENT, TURN_EVENT, TURN_LINK_PARAM, TURN_POLL_MS, TURN_QUIET_MS, TURN_RESYNC_EVENT, type TouchMapping, type TradeBundle, type TradeId, type TradeListOptions, type TradeNoteOptions, type TurnChatLine, type TurnCreateOptions, type TurnDeadline, TurnGame, type TurnGameEvents, type TurnGameOptions, type TurnGameView, type TurnMoveEvent, type TurnOutcome, type TurnSummary, UI_STACK_VERSION, UNSUPPORTED_BY_HUB, type UiStack, type UiStackHandoff, type User, type Vector, type VirtualControlType, type VirtualDef, type VirtualInputs, type VirtualOverride, type WorldEventName, type WorldOpName, YOUR_TURN_BUZZ, YOUR_TURN_BUZZ_KEY, boxesTouch, controlSize, createHub, type findRealtimeApi, getDaily, getInput, getUiStack, hub, isDailySystem, isInputSystem, isNewlyDue, isPageInputControl, type isRealtimeApi, isUiStack, layoutControls, type linkRealtimeToHub, type multiplayerForwarder as mp, type notifyForwarder as notify, parseInputOverrides, type presenceForwarder as presence, type raceForwarder as race, readYourTurnBuzz, type roomsForwarder as rooms, saveYourTurnBuzz, savedGameUrl, type socialForwarder as social, trackInputModality };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as DailySystem, i as DAILY_START_EVENT, n as getDaily, r as isDailySystem, t as DAILY_SINGLETON_API } from "./shared/daily.js";
|
|
2
2
|
import { t as HUB_CLIENT_VERSION } from "./shared/client-version.gen.js";
|
|
3
|
-
import { a as isPageInputControl, c as layoutControls, i as parseInputOverrides, l as boxesTouch, n as getInput, o as InputSystem, r as isInputSystem, s as Overlay, t as INPUT_SINGLETON_API, u as controlSize } from "./shared/input.js";
|
|
3
|
+
import { a as isPageInputControl, c as layoutControls, d as MODALITY_ATTRIBUTE, f as trackInputModality, i as parseInputOverrides, l as boxesTouch, n as getInput, o as InputSystem, p as FOCUS_RING_SHADOW, r as isInputSystem, s as Overlay, t as INPUT_SINGLETON_API, u as controlSize } from "./shared/input.js";
|
|
4
4
|
import { n as isUiStack, r as UI_STACK_VERSION, t as getUiStack } from "./shared/page-stack.js";
|
|
5
|
-
import {
|
|
6
|
-
export { CLIENT_VERSION_HEADER, ContentRejectedError, DAILY_SINGLETON_API, DAILY_START_EVENT, DailySystem, HUB_CLIENT_VERSION, Hub, HubError, INPUT_SINGLETON_API, InputSystem, OfflineError, Overlay, UI_STACK_VERSION, UNSUPPORTED_BY_HUB, boxesTouch, controlSize, createHub, getDaily, getInput, getUiStack, hub, isDailySystem, isInputSystem, isPageInputControl, isUiStack, layoutControls, parseInputOverrides };
|
|
5
|
+
import { A as OUTBOX_MAX_ENTRIES, C as savedGameUrl, D as CLIENT_VERSION_HEADER, E as RESUME_MAX_STATE_BYTES, F as SAVE_UNKNOWN_CODE, I as UNSUPPORTED_BY_HUB, L as HubAvatar, M as ContentRejectedError, N as HubError, O as OUTBOX_FULL_CODE, P as OfflineError, S as SAVED_OPEN_PARAM, T as RESUME_DEBOUNCE_MS, _ as HubSaved, a as TURN_LINK_PARAM, b as SAVED_KIND_PARAM, c as TURN_POLL_MS, d as TurnGame, f as YOUR_TURN_BUZZ, g as saveYourTurnBuzz, h as readYourTurnBuzz, i as HubTurns, j as OfflineApi, k as OUTBOX_MAX_CHARS, l as TURN_QUIET_MS, m as isNewlyDue, n as createHub, o as TURN_CHAT_EVENT, p as YOUR_TURN_BUZZ_KEY, r as hub, s as TURN_EVENT, t as Hub, u as TURN_RESYNC_EVENT, v as SAVED_CHANGE_QUIET_MS, w as HubResume, x as SAVED_OPEN_EVENT, y as SAVED_CHANGE_EVENT } from "./shared/src.js";
|
|
6
|
+
export { CLIENT_VERSION_HEADER, ContentRejectedError, DAILY_SINGLETON_API, DAILY_START_EVENT, DailySystem, FOCUS_RING_SHADOW, HUB_CLIENT_VERSION, Hub, HubAvatar, HubError, HubResume, HubSaved, HubTurns, INPUT_SINGLETON_API, InputSystem, MODALITY_ATTRIBUTE, OUTBOX_FULL_CODE, OUTBOX_MAX_CHARS, OUTBOX_MAX_ENTRIES, OfflineApi, OfflineError, Overlay, RESUME_DEBOUNCE_MS, RESUME_MAX_STATE_BYTES, SAVED_CHANGE_EVENT, SAVED_CHANGE_QUIET_MS, SAVED_KIND_PARAM, SAVED_OPEN_EVENT, SAVED_OPEN_PARAM, SAVE_UNKNOWN_CODE, TURN_CHAT_EVENT, TURN_EVENT, TURN_LINK_PARAM, TURN_POLL_MS, TURN_QUIET_MS, TURN_RESYNC_EVENT, TurnGame, UI_STACK_VERSION, UNSUPPORTED_BY_HUB, YOUR_TURN_BUZZ, YOUR_TURN_BUZZ_KEY, boxesTouch, controlSize, createHub, getDaily, getInput, getUiStack, hub, isDailySystem, isInputSystem, isNewlyDue, isPageInputControl, isUiStack, layoutControls, parseInputOverrides, readYourTurnBuzz, saveYourTurnBuzz, savedGameUrl, trackInputModality };
|
package/dist/input.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { type Anchor, type AutoPauseOptions, type AxisDef, type AxisSide, type DraggedSpot, type EdgeOffsets, type GamepadMapping, type GroupDef, INPUT_SINGLETON_API, type InputConfig, type InputDef, type InputEvents, type InputHost, type InputOptions, type InputOverrides, type InputReading, type InputSource, InputSystem, type InputSystemOptions, type Insets, type LayoutBox, type LayoutItem, type LayoutOptions, type MenuBridge, type MouseMapping, type NavBlurEvent, type NavElement, type NavElementKind, type NavFocusEvent, type NavTarget, type NavigableDef, Overlay, type OverlayEdge, type OverlayEvent, type OverlayListener, type OverlayReason, type PageInputControl, type Rect, type TouchMapping, UI_STACK_VERSION, type UiStack, type UiStackHandoff, type Vector, type VirtualControlType, type VirtualDef, type VirtualInputs, type VirtualOverride, boxesTouch, controlSize, getInput, getUiStack, isInputSystem, isPageInputControl, isUiStack, layoutControls, parseInputOverrides };
|
|
1
|
+
import { $ as NavTarget, A as PageInputControl, B as InputConfig, C as INPUT_SINGLETON_API, D as parseInputOverrides, E as isInputSystem, F as AxisSide, G as InputReading, H as InputEvents, I as DraggedSpot, J as MouseMapping, K as InputSource, L as EdgeOffsets, M as AutoNavigateTarget, N as Anchor, O as InputSystem, P as AxisDef, Q as NavFocusEvent, R as GamepadMapping, S as FOCUS_RING_SHADOW, T as getInput, U as InputHost, V as InputDef, W as InputOverrides, X as NavElement, Y as NavBlurEvent, Z as NavElementKind, _ as boxesTouch, a as OverlayEdge, at as VirtualDef, b as MODALITY_ATTRIBUTE, c as OverlayReason, d as LayoutOptions, et as NavigableDef, f as layoutControls, g as LayoutItem, h as LayoutBox, i as AutoPauseOptions, it as VirtualControlType, j as isPageInputControl, k as InputSystemOptions, l as UiStack, m as Insets, n as getUiStack, nt as TouchMapping, o as OverlayEvent, ot as VirtualInputs, p as Overlay, q as MenuBridge, r as isUiStack, rt as Vector, s as OverlayListener, st as VirtualOverride, t as UI_STACK_VERSION, tt as Rect, u as UiStackHandoff, v as controlSize, w as InputOptions, x as trackInputModality, y as InputModality, z as GroupDef } from "./shared/input.js";
|
|
2
|
+
export { type Anchor, type AutoNavigateTarget, type AutoPauseOptions, type AxisDef, type AxisSide, type DraggedSpot, type EdgeOffsets, FOCUS_RING_SHADOW, type GamepadMapping, type GroupDef, INPUT_SINGLETON_API, type InputConfig, type InputDef, type InputEvents, type InputHost, type InputModality, type InputOptions, type InputOverrides, type InputReading, type InputSource, InputSystem, type InputSystemOptions, type Insets, type LayoutBox, type LayoutItem, type LayoutOptions, MODALITY_ATTRIBUTE, type MenuBridge, type MouseMapping, type NavBlurEvent, type NavElement, type NavElementKind, type NavFocusEvent, type NavTarget, type NavigableDef, Overlay, type OverlayEdge, type OverlayEvent, type OverlayListener, type OverlayReason, type PageInputControl, type Rect, type TouchMapping, UI_STACK_VERSION, type UiStack, type UiStackHandoff, type Vector, type VirtualControlType, type VirtualDef, type VirtualInputs, type VirtualOverride, boxesTouch, controlSize, getInput, getUiStack, isInputSystem, isPageInputControl, isUiStack, layoutControls, parseInputOverrides, trackInputModality };
|
package/dist/input.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as isPageInputControl, c as layoutControls, i as parseInputOverrides, l as boxesTouch, n as getInput, o as InputSystem, r as isInputSystem, s as Overlay, t as INPUT_SINGLETON_API, u as controlSize } from "./shared/input.js";
|
|
1
|
+
import { a as isPageInputControl, c as layoutControls, d as MODALITY_ATTRIBUTE, f as trackInputModality, i as parseInputOverrides, l as boxesTouch, n as getInput, o as InputSystem, p as FOCUS_RING_SHADOW, r as isInputSystem, s as Overlay, t as INPUT_SINGLETON_API, u as controlSize } from "./shared/input.js";
|
|
2
2
|
import { n as isUiStack, r as UI_STACK_VERSION, t as getUiStack } from "./shared/page-stack.js";
|
|
3
|
-
export { INPUT_SINGLETON_API, InputSystem, Overlay, UI_STACK_VERSION, boxesTouch, controlSize, getInput, getUiStack, isInputSystem, isPageInputControl, isUiStack, layoutControls, parseInputOverrides };
|
|
3
|
+
export { FOCUS_RING_SHADOW, INPUT_SINGLETON_API, InputSystem, MODALITY_ATTRIBUTE, Overlay, UI_STACK_VERSION, boxesTouch, controlSize, getInput, getUiStack, isInputSystem, isPageInputControl, isUiStack, layoutControls, parseInputOverrides, trackInputModality };
|
package/dist/mp.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as InviteCreated } from "./shared/wire-types.js";
|
|
2
|
-
import { a as
|
|
1
|
+
import { n as InviteLink, t as InviteCreated } from "./shared/wire-types.js";
|
|
2
|
+
import { a as InviteResult, i as InviteOptions, n as HubMpApi, o as JoinInfoEvent, r as InviteLinkMethods, t as BusyOptions } from "./shared/multiplayer-types.js";
|
|
3
3
|
import { a as Party, i as LaunchTicket, n as JoinInfo, o as multiplayerForwarder, r as Launch, t as Invite } from "./shared/mp.js";
|
|
4
|
-
export { type BusyOptions, type HubMpApi, type Invite, type InviteCreated, type InviteOptions, type InviteResult, type JoinInfo, type JoinInfoEvent, type Launch, type LaunchTicket, type Party, multiplayerForwarder as mp };
|
|
4
|
+
export { type BusyOptions, type HubMpApi, type Invite, type InviteCreated, type InviteLink, type InviteLinkMethods, type InviteOptions, type InviteResult, type JoinInfo, type JoinInfoEvent, type Launch, type LaunchTicket, type Party, multiplayerForwarder as mp };
|
package/dist/race.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as RaceRecordPlayer, i as RaceHistory, o as RaceResultPlayer, s as RaceStatusEvent } from "./shared/wire-types.js";
|
|
2
2
|
import { a as RaceHistoryQuery, c as RaceRuntimeApi, i as RaceEvents, l as RaceStart, n as RaceCreateOptions, o as RaceHistoryViewOptions, r as RaceDefinition, s as RaceHudPlace, t as HubRaceApi } from "./shared/race-types.js";
|
|
3
3
|
import { a as RaceStatValue, c as Racer, d as RoomInfo, f as raceForwarder, i as RaceResult, l as RacerResult, n as RaceParams, o as RaceState, r as RaceRecord, s as RaceStats, t as RaceOutcome, u as RacerState } from "./shared/race.js";
|
|
4
4
|
export { type HubRaceApi, type RaceCreateOptions, type RaceDefinition, type RaceEvents, type RaceHistory, type RaceHistoryQuery, type RaceHistoryViewOptions, type RaceHudPlace, type RaceOutcome, type RaceParams, type RaceRecord, type RaceRecordPlayer, type RaceResult, type RaceResultPlayer, type RaceRuntimeApi, type RaceStart, type RaceStatValue, type RaceState, type RaceStats, type RaceStatusEvent, type Racer, type RacerResult, type RacerState, type RoomInfo, raceForwarder as race };
|
package/dist/rooms.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as RoomEvents, c as
|
|
1
|
+
import { d as RoomSeat, f as RoomSeatChange, l as RoomChatLine, p as RoomStateChange, u as RoomMessage } from "./shared/wire-types.js";
|
|
2
|
+
import { a as RoomEvents, c as RoomSelf, d as RoomStateOptions, i as RoomCreateOptions, l as RoomSendOptions, n as HubRoomsApi, o as RoomListOptions, r as JoinOptions, s as RoomReclaimMethods, t as HubRoom, u as RoomState } from "./shared/room-types.js";
|
|
3
3
|
import { n as roomsForwarder, t as RoomInfo } from "./shared/rooms.js";
|
|
4
|
-
export { type HubRoom, type HubRoomsApi, type JoinOptions, type RoomChatLine, type RoomCreateOptions, type RoomEvents, type RoomInfo, type RoomListOptions, type RoomMessage, type RoomSeat, type RoomSelf, type RoomSendOptions, type RoomState, type RoomStateChange, type RoomStateOptions, roomsForwarder as rooms };
|
|
4
|
+
export { type HubRoom, type HubRoomsApi, type JoinOptions, type RoomChatLine, type RoomCreateOptions, type RoomEvents, type RoomInfo, type RoomListOptions, type RoomMessage, type RoomReclaimMethods, type RoomSeat, type RoomSeatChange, type RoomSelf, type RoomSendOptions, type RoomState, type RoomStateChange, type RoomStateOptions, roomsForwarder as rooms };
|
package/dist/rooms.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { n as rooms } from "./shared/rooms.js";
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { c as Point, d as StatusProp, g as Expression, l as Pose, n as BodyPose, o as LookDir, s as LookLike, v as FaceParams } from "./types.js";
|
|
2
|
+
//#region src/avatar/animator/reactions.d.ts
|
|
3
|
+
/** A reaction name. */
|
|
4
|
+
type Reaction = 'nod' | 'shake' | 'bounce' | 'cheer' | 'gasp' | 'flinch' | 'shrug' | 'sleep' | 'wave';
|
|
5
|
+
/** What a reaction adds at a moment. */
|
|
6
|
+
interface ReactionFrame {
|
|
7
|
+
readonly bob: Point;
|
|
8
|
+
readonly tilt: number;
|
|
9
|
+
readonly squash: number;
|
|
10
|
+
}
|
|
11
|
+
/** A reaction's track. */
|
|
12
|
+
interface ReactionTrack {
|
|
13
|
+
readonly ms: number;
|
|
14
|
+
readonly expression?: Expression;
|
|
15
|
+
readonly body?: BodyPose;
|
|
16
|
+
readonly at: (u: number) => ReactionFrame;
|
|
17
|
+
}
|
|
18
|
+
/** Every reaction's track; `u` runs 0 … 1 over `ms`. */
|
|
19
|
+
declare const REACTIONS: Readonly<Record<Reaction, ReactionTrack>>;
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/avatar/animator/animator.d.ts
|
|
22
|
+
/** Options for {@link animator}. */
|
|
23
|
+
interface AnimatorOptions {
|
|
24
|
+
/** Seeds blinks and idle motion (a user id is ideal). */
|
|
25
|
+
readonly seed?: string | number;
|
|
26
|
+
/** `'auto'` reads `prefers-reduced-motion`; `true` forces it. */
|
|
27
|
+
readonly reducedMotion?: 'auto' | boolean;
|
|
28
|
+
/** Idle bob, sway, wandering gaze and micro expressions (default on). */
|
|
29
|
+
readonly idle?: boolean;
|
|
30
|
+
/** The resting expression (default `neutral`). */
|
|
31
|
+
readonly base?: Expression;
|
|
32
|
+
/** The time source for calls without `at` (default `performance.now()`). */
|
|
33
|
+
readonly clock?: () => number;
|
|
34
|
+
}
|
|
35
|
+
/** When a call happens; defaults to the animator's clock. */
|
|
36
|
+
interface At {
|
|
37
|
+
readonly at?: number;
|
|
38
|
+
}
|
|
39
|
+
/** Game events mapped to tuned faces, so every game feels the same. */
|
|
40
|
+
type Feeling = 'win' | 'lose' | 'bigPlay' | 'victim' | 'waiting' | 'yourTurn' | 'idle';
|
|
41
|
+
/** A face and body driver for one avatar. */
|
|
42
|
+
declare class Animator {
|
|
43
|
+
/** Reduced motion: no idle bob, sway or reaction movement; quick cross-fades; a static open mouth when talking. */
|
|
44
|
+
readonly reducedMotion: boolean;
|
|
45
|
+
private readonly seed;
|
|
46
|
+
private readonly idle;
|
|
47
|
+
private readonly clock;
|
|
48
|
+
private readonly bases;
|
|
49
|
+
private readonly expresses;
|
|
50
|
+
private readonly looks;
|
|
51
|
+
private readonly talks;
|
|
52
|
+
private readonly reacts;
|
|
53
|
+
private readonly bodies;
|
|
54
|
+
private readonly statuses;
|
|
55
|
+
private current;
|
|
56
|
+
constructor(look: LookLike, opts?: AnimatorOptions);
|
|
57
|
+
/** The look this animator drives (adapters render it with each pose). */
|
|
58
|
+
get look(): LookLike;
|
|
59
|
+
/** Swaps the look (an `ev:avatar` change) without resetting the schedule. */
|
|
60
|
+
setLook(look: LookLike): this;
|
|
61
|
+
private now;
|
|
62
|
+
private fade;
|
|
63
|
+
/** Shows an expression (or raw parameters), then returns to the base. */
|
|
64
|
+
express(e: Expression | FaceParams, o?: At & {
|
|
65
|
+
readonly fadeMs?: number;
|
|
66
|
+
readonly holdMs?: number;
|
|
67
|
+
}): this;
|
|
68
|
+
/** Sets the resting expression. */
|
|
69
|
+
setBase(e: Expression | FaceParams, o?: At & {
|
|
70
|
+
readonly fadeMs?: number;
|
|
71
|
+
}): this;
|
|
72
|
+
/** Eases the gaze toward a direction; `null` goes back to wandering (or the centre with `idle: false`). */
|
|
73
|
+
lookAt(target: LookDir | null, o?: At & {
|
|
74
|
+
readonly speed?: number;
|
|
75
|
+
}): this;
|
|
76
|
+
/** Flaps the mouth until `talk(false)`. */
|
|
77
|
+
talk(isOn: boolean, o?: At): this;
|
|
78
|
+
/** Talks for a duration. */
|
|
79
|
+
talkFor(ms: number, o?: At): this;
|
|
80
|
+
/** Drives the mouth from audio amplitude (0 … 1). */
|
|
81
|
+
talkLevel(level: number, o?: At): this;
|
|
82
|
+
/** Plays a one-shot reaction. */
|
|
83
|
+
react(reaction: Reaction, o?: At): this;
|
|
84
|
+
/** Sets the body pose; cycle poses (`walk`, `run`, `dance`) loop every `cycleMs`. */
|
|
85
|
+
setBody(body: BodyPose, o?: At & {
|
|
86
|
+
readonly cycleMs?: number;
|
|
87
|
+
}): this;
|
|
88
|
+
/** Sets or clears the status prop. */
|
|
89
|
+
setStatus(status: StatusProp | null, o?: At): this;
|
|
90
|
+
/** Plays the tuned face and reaction for a game event. */
|
|
91
|
+
feel(feeling: Feeling, o?: At): this;
|
|
92
|
+
private faceAt;
|
|
93
|
+
private gazeAt;
|
|
94
|
+
private approach;
|
|
95
|
+
private talkAt;
|
|
96
|
+
private reactionAt;
|
|
97
|
+
/** The pose at time `t` (same clock as the calls). Pure: the same schedule and `t` give the same pose. */
|
|
98
|
+
pose(t?: number): Pose;
|
|
99
|
+
}
|
|
100
|
+
/** A new animator for a look: `animator(look, { seed: userId })`. */
|
|
101
|
+
declare function animator(look: LookLike, opts?: AnimatorOptions): Animator;
|
|
102
|
+
//#endregion
|
|
103
|
+
export { animator as a, Feeling as i, AnimatorOptions as n, REACTIONS as o, At as r, Reaction as s, Animator as t };
|
|
104
|
+
//# sourceMappingURL=animator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animator.d.ts","names":[],"sources":["../../src/avatar/animator/reactions.ts","../../src/avatar/animator/animator.ts"],"mappings":";;;KASY;;UAGK;WACN,KAAK;WACL;WACA;;;UAIM;WACN;WACA,aAAa;WACb,OAAO;WACP,KAAK,cAAc;;;cAOjB,WAAW,SAAS,OAAO,UAAU;;;;UChBjC;;WAEN;;WAEA;;WAEA;;WAEA,OAAO;;WAEP;;;UAIM;WACN;;;KAIC;;cAkCC;;WAEF;mBACQ;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;UACT;EAEI,YAAA,MAAM,UAAU,OAAM;;MAU9B,QAAQ;;EAKZ,QAAQ,MAAM;UAKN;UAIA;;EAKR,QAAQ,GAAG,aAAa,YAAY,IAAG;aAAgB;aAA0B;;;EAMjF,QAAQ,GAAG,aAAa,YAAY,IAAG;aAAgB;;;EAMvD,OAAO,QAAQ,gBAAgB,IAAG;aAAgB;;;EAMlD,KAAK,eAAe,IAAG;;EAOvB,QAAQ,YAAY,IAAG;;EAOvB,UAAU,eAAe,IAAG;;EAM5B,MAAM,UAAU,UAAU,IAAG;;EAM7B,QAAQ,MAAM,UAAU,IAAG;aAAgB;;;EAM3C,UAAU,QAAQ,mBAAmB,IAAG;;EAMxC,KAAK,SAAS,SAAS,IAAG;UAalB;UA2BA;UAmBA;UAMA;UAYA;;EAcR,KAAK,aAA2B;;;iBAwBlB,SAAS,MAAM,UAAU,OAAM,kBAAuB"}
|