@hypersoniclabs/helix-sdk 0.1.2 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/README.md +859 -8
  2. package/dist/action-surface.d.ts +182 -0
  3. package/dist/action-surface.js +1032 -0
  4. package/dist/action-surface.js.map +1 -0
  5. package/dist/camera.d.ts +65 -1
  6. package/dist/camera.js +568 -0
  7. package/dist/camera.js.map +1 -1
  8. package/dist/dev-shell/criteria.d.ts +46 -0
  9. package/dist/dev-shell/criteria.js +98 -0
  10. package/dist/dev-shell/criteria.js.map +1 -0
  11. package/dist/dev-shell/index.d.ts +189 -0
  12. package/dist/dev-shell/index.js +287 -0
  13. package/dist/dev-shell/index.js.map +1 -0
  14. package/dist/dev-shell/keys.d.ts +14 -0
  15. package/dist/dev-shell/keys.js +78 -0
  16. package/dist/dev-shell/keys.js.map +1 -0
  17. package/dist/dev-shell/simulator.d.ts +436 -0
  18. package/dist/dev-shell/simulator.js +1634 -0
  19. package/dist/dev-shell/simulator.js.map +1 -0
  20. package/dist/dev-shell/state.d.ts +148 -0
  21. package/dist/dev-shell/state.js +196 -0
  22. package/dist/dev-shell/state.js.map +1 -0
  23. package/dist/device-definition-resolver.d.ts +34 -0
  24. package/dist/device-definition-resolver.js +172 -0
  25. package/dist/device-definition-resolver.js.map +1 -0
  26. package/dist/device-trial.d.ts +3 -0
  27. package/dist/device-trial.js +132 -0
  28. package/dist/device-trial.js.map +1 -0
  29. package/dist/devices.d.ts +228 -0
  30. package/dist/devices.js +198 -0
  31. package/dist/devices.js.map +1 -0
  32. package/dist/dreamerAudio.d.ts +126 -0
  33. package/dist/dreamerAudio.js +135 -0
  34. package/dist/dreamerAudio.js.map +1 -0
  35. package/dist/generated/runtime-contract.d.ts +15529 -0
  36. package/dist/generated/runtime-contract.js +20470 -0
  37. package/dist/generated/runtime-contract.js.map +1 -0
  38. package/dist/index.d.ts +272 -15
  39. package/dist/index.js +1401 -91
  40. package/dist/index.js.map +1 -1
  41. package/dist/interaction-mode.d.ts +172 -0
  42. package/dist/interaction-mode.js +553 -0
  43. package/dist/interaction-mode.js.map +1 -0
  44. package/dist/internal/avatar-pose.d.ts +25 -0
  45. package/dist/internal/avatar-pose.js +46 -0
  46. package/dist/internal/avatar-pose.js.map +1 -0
  47. package/dist/internal/keyed-collection.d.ts +2 -0
  48. package/dist/internal/keyed-collection.js +12 -0
  49. package/dist/internal/keyed-collection.js.map +1 -0
  50. package/dist/internal/vehicle-detach-action.d.ts +2 -0
  51. package/dist/internal/vehicle-detach-action.js +6 -0
  52. package/dist/internal/vehicle-detach-action.js.map +1 -0
  53. package/dist/matchmaking.d.ts +433 -0
  54. package/dist/matchmaking.js +1487 -0
  55. package/dist/matchmaking.js.map +1 -0
  56. package/dist/materials.d.ts +122 -0
  57. package/dist/materials.js +217 -0
  58. package/dist/materials.js.map +1 -0
  59. package/dist/multiplayer-accessors.d.ts +100 -0
  60. package/dist/multiplayer-accessors.js +200 -0
  61. package/dist/multiplayer-accessors.js.map +1 -0
  62. package/dist/multiplayer-contract/avatar-pose.d.ts +112 -0
  63. package/dist/multiplayer-contract/avatar-pose.js +250 -0
  64. package/dist/multiplayer-contract/avatar-pose.js.map +1 -0
  65. package/dist/multiplayer-contract/credential.d.ts +38 -0
  66. package/dist/multiplayer-contract/final-rest.d.ts +66 -0
  67. package/dist/multiplayer-contract/final-rest.js +38 -0
  68. package/dist/multiplayer-contract/final-rest.js.map +1 -0
  69. package/dist/multiplayer-contract/index.d.ts +11 -5
  70. package/dist/multiplayer-contract/index.js +16 -5
  71. package/dist/multiplayer-contract/index.js.map +1 -1
  72. package/dist/multiplayer-contract/messages.d.ts +461 -14
  73. package/dist/multiplayer-contract/messages.js +141 -15
  74. package/dist/multiplayer-contract/messages.js.map +1 -1
  75. package/dist/multiplayer-contract/room.d.ts +55 -4
  76. package/dist/multiplayer-contract/state.d.ts +181 -1
  77. package/dist/multiplayer-contract/state.js.map +1 -1
  78. package/dist/multiplayer-final-rest.d.ts +32 -0
  79. package/dist/multiplayer-final-rest.js +217 -0
  80. package/dist/multiplayer-final-rest.js.map +1 -0
  81. package/dist/multiplayer.d.ts +507 -16
  82. package/dist/multiplayer.js +2242 -73
  83. package/dist/multiplayer.js.map +1 -1
  84. package/dist/package.json +3 -0
  85. package/dist/protocol.d.ts +668 -5
  86. package/dist/protocol.js +101 -1
  87. package/dist/protocol.js.map +1 -1
  88. package/dist/runtime-contract/index.d.ts +15 -0
  89. package/dist/runtime-contract/index.js +12 -0
  90. package/dist/runtime-contract/index.js.map +1 -0
  91. package/dist/server-clock.d.ts +25 -0
  92. package/dist/server-clock.js +88 -0
  93. package/dist/server-clock.js.map +1 -0
  94. package/dist/tsconfig.build.tsbuildinfo +1 -1
  95. package/dist/universal-vehicles.d.ts +111 -0
  96. package/dist/universal-vehicles.js +2 -0
  97. package/dist/universal-vehicles.js.map +1 -0
  98. package/dist/vault.d.ts +562 -0
  99. package/dist/vault.js +365 -0
  100. package/dist/vault.js.map +1 -0
  101. package/dist/vehicle-specialty-placement.d.ts +28 -0
  102. package/dist/vehicle-specialty-placement.js +154 -0
  103. package/dist/vehicle-specialty-placement.js.map +1 -0
  104. package/dist/vehicle-specialty-transport.d.ts +78 -0
  105. package/dist/vehicle-specialty-transport.js +183 -0
  106. package/dist/vehicle-specialty-transport.js.map +1 -0
  107. package/dist/voice.d.ts +229 -0
  108. package/dist/voice.js +1348 -0
  109. package/dist/voice.js.map +1 -0
  110. package/generated/runtime-contract/helix-runtime-contract.json +13332 -0
  111. package/generated/runtime-contract/known-answer.json +20471 -0
  112. package/generated/runtime-contract/known-answer.schema.json +630 -0
  113. package/generated/runtime-contract/runtime-contract.schema.json +607 -0
  114. package/generated/runtime-contract/unreal/HelixRuntimeContract.generated.h +908 -0
  115. package/package.json +32 -6
package/dist/index.d.ts CHANGED
@@ -1,15 +1,65 @@
1
- import { HelixInteractionPrompt, HelixNotification, HelixWorldContext, HelixUser, DebugLogEntry, Balance, PurchaseResult, PurchaseContext, InventoryItem, EquippedAvatar, AvatarLoadout, AvatarLoadoutPatch, HelixPresenceActivity, MarketplaceListing, MarketplaceQuery, CameraAspect, SavedPhoto } from './protocol';
2
- import { HelixMultiplayer } from './multiplayer';
3
- import { CaptureOptions } from './camera';
4
- export type { HelixInteractionPrompt, HelixNotification, HelixNotificationKind, HelixPromptState, HelixDeviceFormFactor, HelixWorldContext, HelixSession, HelixUser, DebugLogEntry, DebugLogLevel, Balance, PurchaseResult, PurchaseStatus, PurchaseContext, InventoryItem, EquippedAvatar, AvatarLoadout, AvatarLoadoutPatch, HelixPresenceActivity, MarketplaceListing, MarketplaceQuery, CameraAspect, SavedPhoto, } from './protocol';
5
- export type { CaptureOptions, CropRect } from './camera';
6
- export { cropRectForAspect, captureCanvas } from './camera';
7
- export type { HelixRoom, JoinRoomOptions, ReplicaInput } from './multiplayer';
8
- export * from './multiplayer-contract';
1
+ import { HelixInteractionPrompt, HelixNotification, HelixDeviceState, HelixWorldContext, HelixUser, DebugLogEntry, Balance, PurchaseResult, PurchaseContext, PurchaseOptions, Entitlements, ConsumeResult, InventoryItem, EquippedAvatar, EquippedEmotes, EquippedLocomotionPack, AvatarLoadout, AvatarLoadoutPatch, HelixPresenceActivity, DataStoreListPage, LeaderboardPage, LeaderboardSubmitResult, LeaderboardSubmitOptions, LeaderboardTopOptions, DataStoreWriteOptions, DataStoreListOptions, AchievementListResult, AchievementMineResult, MarketplaceListing, MarketplaceQuery, CameraAspect, SavedPhoto, HelixCameraCapability, HelixCameraControl, HelixCameraDroneCommand, HelixCameraDroneState, HelixCameraState, RuntimeFidelityIntent, PackageCustomizerSubject, PackageCustomizerSource, PackageCustomizerContext, DeviceTrialSpawn } from './protocol.js';
2
+ import { HelixMultiplayer } from './multiplayer.js';
3
+ import { HelixVoice } from './voice.js';
4
+ import { HelixMatchmaking, HelixParty } from './matchmaking.js';
5
+ import { CaptureOptions } from './camera.js';
6
+ import type { WorldSpawn } from './universal-vehicles.js';
7
+ export { WorldDeviceHost, deviceRuntimeModuleId as worldDeviceRuntimeModuleId, } from './devices.js';
8
+ export type { DeviceDefinitionReference, DeviceBusBudgetsV1, DeviceAppDefinitionV1, DeviceAppPermissionV1, DeviceAppTypeV1, DeviceBusEnvelopeV1, DeviceDefinitionV1, DevicePortAddressV1, DevicePortAuthorityV1, DevicePortDataTypeV1, DevicePortDirectionV1, DevicePortKindV1, DevicePortV1, DeviceStreamHandleV1, DeviceStreamRoutabilityV1, WorldDeviceDefinitionResolver, WorldDevicePresentation, WorldDevicePresentationAdapter, } from './devices.js';
9
+ export { createSealedDeviceDefinitionResolver, normalizeSealedDeviceDefinitionProjection, } from './device-definition-resolver.js';
10
+ export type { SealedDeviceDefinitionPin, SealedDeviceDefinitionProjection, SealedDeviceDefinitionResolver, SealedDeviceDefinitionResolverOptions, } from './device-definition-resolver.js';
11
+ export type { HelixInteractionPrompt, HelixNotification, HelixNotificationKind, HelixPromptState, HelixDeviceFormFactor, HelixDeviceState, HelixWorldContext, HelixSession, HelixUser, DebugLogEntry, DebugLogLevel, Balance, PurchaseResult, PurchaseStatus, PurchaseContext, PurchaseOptions, ItemEditionMode, AccountVerificationLevel, ProductGrant, Entitlements, ConsumeResult, InventoryItem, EquippedAvatar, AvatarComposition, EquippedEmote, EquippedEmotes, EquippedLocomotionPack, AvatarLoadout, AvatarLoadoutPatch, HelixPresenceActivity, HelixMultiplayerState, HelixMultiplayerRosterEntry, HelixVoiceState, HelixVoiceSettings, HelixVoiceMicMode, HelixVoicePermission, HelixVoiceDevice, DataStoreListPage, DataStoreListPayload, LeaderboardEntry, LeaderboardOrder, LeaderboardPage, LeaderboardSubmitResult, LeaderboardSubmitOptions, LeaderboardTopOptions, DataStoreWriteOptions, DataStoreListOptions, AchievementSummary, AchievementListResult, AchievementMineResult, MarketplaceListing, MarketplaceQuery, CameraAspect, SavedPhoto, CameraSessionState, CameraMediaMode, CameraSpatialMode, CameraControlTarget, CameraLensPreset, CameraFilterId, CameraTimerSeconds, CameraAim, CameraFocusPoint, CameraVector3, CameraDroneLockMode, HelixCameraCapability, HelixCameraShutter, HelixCameraState, HelixCameraControl, HelixCameraDroneTransform, HelixCameraDroneState, HelixCameraDroneCommand, RuntimeFidelityIntent, RuntimeFidelityVisualTier, RuntimeFidelityRenderScale, RuntimeProfileQuality, PackageCustomizerSubject, PackageCustomizerSource, PackageCustomizerContext, DeviceTrialSpawn, } from './protocol.js';
12
+ export { normalizeDeviceTrialSpawn } from './device-trial.js';
13
+ export { CAMERA_LENS_PRESETS, RUNTIME_FIDELITY_VERSION, RUNTIME_FIDELITY_VISUAL_TIERS, RUNTIME_FIDELITY_RENDER_SCALES, RUNTIME_PROFILE_QUALITIES, normalizeRuntimeFidelityIntent, XR_INTERACTION_PROMPT_EVENT, XR_SESSION_EVENT, } from './protocol.js';
14
+ export type { CaptureOptions, CropRect, CameraCapabilityFlag } from './camera.js';
15
+ export { cropRectForAspect, captureCanvas, CAMERA_MIN_ZOOM, CAMERA_MAX_ZOOM, clampCameraZoom, nearestLensPreset, defaultCameraCapability, defaultCameraState, cloneCameraState, cloneCameraCapability, intersectCameraCapability, CAMERA_CAPABILITY_FLAGS, normalizeCameraCapability, normalizeCameraState, validateCameraControl, cameraCapabilityGate, isCameraSessionState, isCameraMediaMode, isCameraSpatialMode, isCameraControlTarget, isCameraFilterId, isCameraTimerSeconds, isCameraDroneLockMode, } from './camera.js';
16
+ export { createMaterialLibrary, createMaterialsNamespace, DEFAULT_MATERIAL_PACK_SLUG, } from './materials.js';
17
+ export type { HelixMaterialCatalog, HelixMaterialDefinition, HelixMaterialKind, HelixMaterialLibrary, HelixMaterialMapPaths, HelixMaterialQuery, HelixMaterialResolutionOption, HelixMaterialResolutionTier, HelixMaterialResolutionVariant, ResolvedHelixMaterial, } from './materials.js';
18
+ export type { HelixRoom, JoinRoomOptions, ReplicaInput } from './multiplayer.js';
19
+ export type { SwitchRoomTarget, SwitchRoomOptions, RoomTicket, HelixRoomJoinErrorCode, HelixRoomLeaveReason } from './multiplayer.js';
20
+ export { HelixRoomJoinError } from './multiplayer.js';
21
+ export { HelixMatchmakingError, HelixPartyError } from './matchmaking.js';
22
+ export type { QueueStatus, QueueWaiting, QueueEndReason, MatchFound, Party, PartyMember, PartyCode, PartyInvite, PartyState, PartyInviteReceipt, HelixMatchmakingErrorCode, HelixPartyErrorCode, } from './matchmaking.js';
23
+ export type { VehiclePackageArtifact, WorldSpawn, ModuleIdentity, ModuleActionRequest, VehicleComponentActionRequest, VehicleDetachActionDescriptor, VehicleDetachActions, VehicleDetachActionRequest, VehicleRole, ModuleStateSnapshot, ModuleEffect, } from './universal-vehicles.js';
24
+ export type { JoinVoiceOptions, HelixVoiceVec3, HelixVoiceAudioFeatures } from './voice.js';
25
+ export { DEFAULT_PUSH_TO_TALK_KEY } from './voice.js';
26
+ export { createVarsView, createRoomAccessors, createModuleAccessors } from './multiplayer-accessors.js';
27
+ export type { VarsView, RoomAccessors, ModuleAccessors, AccessorRoomState, AccessorModuleState } from './multiplayer-accessors.js';
28
+ export { createVaultClient, createVaultLoadPlan, VAULT_ASSET_KINDS, VaultApiError, VaultArtifactUnavailableError, VaultCapabilityUnavailableError, VaultChecksumMismatchError, VaultUnsupportedRuntimeError, } from './vault.js';
29
+ export type { VaultAnimationMetadata, VaultArtifactMetadata, VaultArtifactReference, VaultAssetDetail, VaultAssetHandle, VaultAssetKind, VaultAssetSummary, VaultAssetVersion, VaultAudioGenerationMode, VaultAudioMetadata, VaultCanonicalThumbnail, VaultCharacterMetadata, VaultClient, VaultClientOptions, VaultCompatibility, VaultDecalMetadata, VaultDownloadedArtifact, VaultEnvironmentMetadata, VaultGaussianSplatMetadata, VaultInstallOptions, VaultInstallResult, VaultImmutableArtifactReference, VaultLoadPlan, VaultMaterialMetadata, VaultMetadataByKind, VaultPerformanceMetadata, VaultPerformanceTier, VaultPropMetadata, VaultRankMode, VaultRelatedArtifact, VaultResolvedArtifact, VaultResolvedAsset, VaultRuntime, VaultSceneMetadata, VaultSearchQuery, VaultSearchResult, VaultSelectionExplanation, VaultSkyMetadata, VaultSplatScope, VaultTerrainMetadata, VaultTextureMetadata, VaultUnrealPackageMetadata, VaultVfxMetadata, } from './vault.js';
30
+ export { createDreamerAudioClient, DREAMER_AUDIO_TIMEOUT_MS, DreamerAudioApiError, DreamerAudioCapabilityUnavailableError, DreamerAudioJobFailedError, DreamerAudioJobTimeoutError, DreamerAudioVaultUnavailableError, } from './dreamerAudio.js';
31
+ export { ANY_VERB, ModeStack, bindStackSafety, normaliseTouch, validateInputMap, } from './interaction-mode.js';
32
+ export type { CameraIntent, Capability, InputLeaseHandle, InputLeaseRequest, InputMap, InteractionMode, ModeCapability, ModeContext, ModeEndReason, ModeHost, ModePhase, ModeResult, PushOptions, PushOutcome, StandardModeAction, Suppression, TouchPresentation, TouchPresentationKind, TouchPresentationZone, TouchBinding, TouchKind, VerbBinding, VerbEvent, VerbHandler, VerbPhase, VerbSink, } from './interaction-mode.js';
33
+ export { UniversalActionSurface, createActionSurfaceInputMap, createActionSurfaceMode, validateActionSurfaceSnapshot, } from './action-surface.js';
34
+ export type { ActionSurfaceAction, ActionSurfaceAvailability, ActionSurfaceDevice, ActionSurfaceHintSource, ActionSurfaceInvocation, ActionSurfaceKind, ActionSurfaceModeOptions, ActionSurfaceOption, ActionSurfaceOptionsFrom, ActionSurfaceSnapshot, UniversalActionSurfaceOptions, } from './action-surface.js';
35
+ export type { DreamerAudioArtifact, DreamerAudioClient, DreamerAudioClientOptions, DreamerAudioGenerateRequest, DreamerAudioGenerationMode, DreamerAudioJob, DreamerAudioPendingJob, DreamerAudioPollOptions, DreamerAudioSucceededJob, DreamerAudioFailedJob, DreamerAudioVoiceSettings, DreamerGeneratedVaultAudio, DreamerMusicRequest, DreamerSoundEffectRequest, DreamerTextToSpeechRequest, } from './dreamerAudio.js';
36
+ export * from './multiplayer-contract/index.js';
37
+ export * from './vehicle-specialty-transport.js';
38
+ export * from './vehicle-specialty-placement.js';
39
+ /**
40
+ * A shell-mediated request that failed. `code` classifies it when the shell could —
41
+ * `'version-conflict'` (an optimistic-concurrency clash), `'rate-limited'`, or a Data Store
42
+ * key-policy rule such as `'session-sub-key'` — so a world branches on the code instead of
43
+ * matching error prose. Undefined when the shell is older than the code it would have sent,
44
+ * or the failure has no classification.
45
+ */
46
+ export declare class HelixRequestError extends Error {
47
+ readonly code?: string;
48
+ constructor(message: string, code?: string);
49
+ }
9
50
  export type HelixInitResult = {
10
51
  embedded: boolean;
11
52
  world: HelixWorldContext | null;
12
53
  user: HelixUser | null;
54
+ /**
55
+ * Validated presentation intent frozen by the shell for this World load.
56
+ * Null means an older shell or invalid payload; resolve through engine Auto.
57
+ */
58
+ runtimeFidelity: RuntimeFidelityIntent | null;
59
+ /** Validated, immutable local package configuration sealed into this trial session. */
60
+ customizerSubject: PackageCustomizerSubject | null;
61
+ /** Trial provenance retained when its subject expires or fails validation. */
62
+ customizerSource: PackageCustomizerSource | null;
13
63
  };
14
64
  type AuthListener = (user: HelixUser | null) => void;
15
65
  type AnalyticsEventName = 'world_entered' | 'world_loaded' | 'world_load_failed' | 'world_exited' | 'world_heartbeat' | 'instance_joined' | 'instance_left' | 'creator_product_viewed' | 'client_error_seen' | 'api_error_seen';
@@ -21,10 +71,54 @@ type AnalyticsTrackInput = {
21
71
  referrer?: string | null;
22
72
  properties?: Record<string, string | number | boolean | null | undefined>;
23
73
  };
74
+ /**
75
+ * Result of a listen host admitting one joiner's single-use join token. The player-owned host
76
+ * (profile `listen`) presents the joiner's token + a per-peer connection id; the shell holds the
77
+ * host capability and account JWT and performs the backend consume, returning this correlated result.
78
+ * The host admits the peer's connection ONLY when `admitted` is true.
79
+ *
80
+ * Identity, not seat, is what admission certifies: on `admitted: true` the backend has verified the
81
+ * token and its ListenSeatRecord names the REAL HELIX user behind the join — returned here as
82
+ * `joinerUserId`. That field is REQUIRED when `admitted` is true, and a consuming runtime that
83
+ * receives an admitted receipt without it must FAIL CLOSED: treat the connection as unadmitted and
84
+ * never substitute an assumed identity (a seat id is not a user id). Refused receipts keep their
85
+ * shape — `admitted: false` + `reason?`, never a seatId or joinerUserId.
86
+ */
87
+ export type ListenAdmissionResult = {
88
+ admitted: boolean;
89
+ seatId?: string;
90
+ joinerUserId?: string;
91
+ reason?: string;
92
+ };
93
+ /** Result of a listen host session heartbeat (session-level; the shell holds the capability). */
94
+ export type ListenHeartbeatResult = {
95
+ status: 'open' | 'closed';
96
+ expiresAt: string;
97
+ };
98
+ /** Result of a listen host closing its session (host departure closes the world; no migration). */
99
+ export type ListenCloseResult = {
100
+ closed: boolean;
101
+ releasedSeatIds: string[];
102
+ };
103
+ /**
104
+ * Result of a listen host reporting one admitted joiner's departure so the backend frees the seat.
105
+ * The shell authenticates the owning host and addresses the canonical disconnect route; `released`
106
+ * is the backend's verdict for THIS (seatId, connectionId) pair — false when the pair did not match
107
+ * an admission still standing (already departed, wrong connection, or session gone). Not an error:
108
+ * a departed peer is departed, and the host drops the peer either way.
109
+ */
110
+ export type ListenReleaseResult = {
111
+ released: boolean;
112
+ };
24
113
  declare class HelixSdk {
25
114
  private shellOrigin;
26
115
  private session;
27
- private world;
116
+ private worldContext;
117
+ private runtimeFidelityIntent;
118
+ private customizerSubject;
119
+ private customizerSource;
120
+ private deviceTrialSpawn;
121
+ private requestedInstanceId;
28
122
  private initialized;
29
123
  private listeners;
30
124
  private debugEnabled;
@@ -35,15 +129,50 @@ declare class HelixSdk {
35
129
  private pendingRequests;
36
130
  private balanceListeners;
37
131
  private inventoryListeners;
132
+ private entitlementListeners;
38
133
  private avatarListeners;
134
+ private emoteListeners;
135
+ private deviceState;
136
+ private deviceListeners;
137
+ private deviceGlobalShortcutEnabled;
138
+ private cameraState;
139
+ private cameraRuntimeCapability;
140
+ private cameraShellCapability;
141
+ private cameraListeners;
142
+ private autoPurchaseAttempts;
143
+ private left;
144
+ private leaveListeners;
145
+ /** Code-free default material packs resolved from their platform CDN base. */
146
+ readonly materials: {
147
+ load(assetBaseUrl: string): Promise<import("./materials.js").HelixMaterialLibrary>;
148
+ fromCatalog(assetBaseUrl: string, catalog: import("./materials.js").HelixMaterialCatalog): import("./materials.js").HelixMaterialLibrary;
149
+ clearCache(): void;
150
+ };
151
+ /** Authoritative owned item instances currently standing in this World. */
152
+ readonly world: {
153
+ getSpawns: () => Promise<WorldSpawn[]>;
154
+ };
39
155
  init(): Promise<HelixInitResult>;
156
+ private readonly serverClock;
40
157
  readonly multiplayer: HelixMultiplayer;
158
+ readonly voice: HelixVoice;
159
+ private readonly socialHost;
160
+ readonly party: HelixParty;
161
+ readonly matchmaking: HelixMatchmaking;
41
162
  readonly debug: {
42
163
  enabled: () => boolean;
43
164
  log: (...args: unknown[]) => void;
44
165
  onLog: (cb: (entry: DebugLogEntry) => void) => (() => void);
45
166
  recent: () => DebugLogEntry[];
46
167
  };
168
+ /** Live, read-only access to the current trial customizer projection. */
169
+ readonly customizer: {
170
+ getContext: () => PackageCustomizerContext;
171
+ };
172
+ /** Live, read-only access to the authenticated session's ephemeral Device trial. */
173
+ readonly trial: {
174
+ getDeviceSpawn: () => DeviceTrialSpawn | null;
175
+ };
47
176
  readonly auth: {
48
177
  getUser: () => Promise<HelixUser | null>;
49
178
  isAuthenticated: () => boolean;
@@ -64,17 +193,64 @@ declare class HelixSdk {
64
193
  readonly device: {
65
194
  openTablet: () => boolean;
66
195
  openPhone: () => boolean;
196
+ /**
197
+ * Enable or disable the SDK-owned Tab shortcut. Enabled by default.
198
+ * An earlier key handler may override one event with `preventDefault()`; a World-level
199
+ * window handler registered after `Helix.init()` should disable this shortcut instead.
200
+ */
201
+ setGlobalShortcutEnabled: (enabled: boolean) => void;
202
+ getState: () => HelixDeviceState;
203
+ onStateChanged: (cb: (state: HelixDeviceState) => void) => (() => void);
67
204
  };
68
205
  getSessionToken(): string | null;
206
+ /**
207
+ * True once the player has left this world: the shell's Exit button, the browser's Back off the play page,
208
+ * and, for some worlds, the play page being unloaded (all reach the SDK as helix:leave). From then on the SDK leaves the
209
+ * room and voice, matchmaking and parties stop, and `Helix.multiplayer.joinRoom()` / `switchRoom()` reject
210
+ * with code `left` — whether or not the world held a room when the leave came. A world that runs its own
211
+ * room lifecycle (bot matches, its own rejoin retries) checks this before it rejoins.
212
+ *
213
+ * It stays true for the rest of this world document. The shell never re-enters a world in the same
214
+ * document: entering again is a new iframe document, so a new SDK instance and a new helix:init, which
215
+ * starts at false. The one way the same document comes back is a back/forward-cache restore of the play
216
+ * page (the page is shown again without a new handshake); then this is false again and rooms can be joined.
217
+ *
218
+ * Only the shell that initialised this world can end it: a helix:leave that arrives before helix:init (or
219
+ * from another origin) does not count.
220
+ */
221
+ hasLeft(): boolean;
222
+ /**
223
+ * Called once, synchronously, when the player leaves this world (see hasLeft(), which is already true by
224
+ * then). A subscriber registered after the leave is not called; read hasLeft() instead. Returns an
225
+ * unsubscribe function. A throwing subscriber is logged and does not stop the others. The subscribers are
226
+ * taken as a snapshot when the leave arrives: unsubscribing another one from inside a callback does not
227
+ * stop it being called for this leave.
228
+ */
229
+ onLeave(cb: () => void): () => void;
69
230
  readonly wallet: {
70
231
  getBalance: () => Promise<Balance>;
71
232
  onBalanceChanged: (cb: (b: Balance) => void) => (() => void);
72
233
  };
234
+ readonly listen: {
235
+ consume: (sessionId: string, listenJoinToken: string, connectionId: string) => Promise<ListenAdmissionResult>;
236
+ release: (sessionId: string, seatId: string, connectionId: string) => Promise<ListenReleaseResult>;
237
+ heartbeat: (sessionId: string) => Promise<ListenHeartbeatResult>;
238
+ close: (sessionId: string) => Promise<ListenCloseResult>;
239
+ };
73
240
  readonly marketplace: {
74
- purchaseItem: (itemId: string) => Promise<PurchaseResult>;
75
- purchaseProduct: (productId: string) => Promise<PurchaseResult>;
241
+ purchaseProduct: (productKey: string, options?: PurchaseOptions | number) => Promise<PurchaseResult>;
242
+ purchaseDistributionKey: (key: string, options?: PurchaseOptions | number) => Promise<PurchaseResult>;
243
+ purchaseDistribution: (distributionId: string, options?: PurchaseOptions | number) => Promise<PurchaseResult>;
244
+ purchaseListing: (listingId: string, options?: PurchaseOptions) => Promise<PurchaseResult>;
245
+ getPurchase: (idempotencyKey: string, ref?: string) => Promise<PurchaseResult | null>;
76
246
  getListings: (query?: MarketplaceQuery) => Promise<MarketplaceListing[]>;
77
- getPurchaseContext: (ref: string) => Promise<PurchaseContext | null>;
247
+ getPurchaseContext: (ref: string, options?: PurchaseOptions | number) => Promise<PurchaseContext | null>;
248
+ };
249
+ readonly purchases: {
250
+ getEntitlements: () => Promise<Entitlements>;
251
+ consume: (code: string, amount: number) => Promise<ConsumeResult>;
252
+ getPurchase: (idempotencyKey: string, ref?: string) => Promise<PurchaseResult | null>;
253
+ onEntitlementsChanged: (cb: () => void) => (() => void);
78
254
  };
79
255
  readonly analytics: {
80
256
  track: (eventName: AnalyticsEventName, input?: AnalyticsTrackInput) => Promise<void>;
@@ -88,9 +264,21 @@ declare class HelixSdk {
88
264
  };
89
265
  readonly dataStore: {
90
266
  get: <T = unknown>(key: string) => Promise<T | null>;
91
- set: <T = unknown>(key: string, value: T) => Promise<void>;
92
- delete: (key: string) => Promise<void>;
93
- list: (prefix?: string) => Promise<string[]>;
267
+ getEntry: <T = unknown>(key: string) => Promise<{
268
+ value: T;
269
+ version: number;
270
+ } | null>;
271
+ set: <T = unknown>(key: string, value: T, options?: DataStoreWriteOptions) => Promise<void>;
272
+ delete: (key: string, options?: DataStoreWriteOptions) => Promise<void>;
273
+ list: (prefix?: string, opts?: DataStoreListOptions) => Promise<DataStoreListPage>;
274
+ };
275
+ readonly leaderboard: {
276
+ submit: (board: string, score: number, options?: LeaderboardSubmitOptions) => Promise<LeaderboardSubmitResult>;
277
+ top: (board: string, options?: LeaderboardTopOptions) => Promise<LeaderboardPage>;
278
+ };
279
+ readonly achievements: {
280
+ list: () => Promise<AchievementListResult>;
281
+ mine: () => Promise<AchievementMineResult>;
94
282
  };
95
283
  readonly camera: {
96
284
  available: () => boolean;
@@ -100,36 +288,105 @@ declare class HelixSdk {
100
288
  aspect?: CameraAspect;
101
289
  contentType?: string;
102
290
  }) => Promise<SavedPhoto | null>;
291
+ getState: () => HelixCameraState;
292
+ onStateChanged: (cb: (state: HelixCameraState) => void) => (() => void);
293
+ capabilities: () => HelixCameraCapability;
294
+ reportCapability: (capability: HelixCameraCapability) => boolean;
295
+ control: (control: HelixCameraControl) => Promise<HelixCameraState>;
296
+ flyDrone: (command: HelixCameraDroneCommand) => Promise<HelixCameraDroneState>;
103
297
  };
104
298
  readonly avatar: {
105
299
  openCreator: () => Promise<boolean>;
106
300
  getLoadout: () => Promise<AvatarLoadout | null>;
107
301
  updateLoadout: (patch: AvatarLoadoutPatch) => Promise<AvatarLoadout | null>;
108
302
  getEquipped: () => Promise<EquippedAvatar | null>;
303
+ /** Resolve another joined player's public configured avatar for replica rendering. */
304
+ getEquippedForUser: (userId: string) => Promise<EquippedAvatar | null>;
109
305
  onAvatarChanged: (cb: () => void) => (() => void);
110
306
  };
307
+ readonly emotes: {
308
+ getEquipped: () => Promise<EquippedEmotes | null>;
309
+ /**
310
+ * Fires after the shell has settled and closed an emote-customizer session. A joined room uses the
311
+ * same cue to re-resolve its authoritative seat; a join:false world re-fetches getEquipped instead.
312
+ */
313
+ onChanged: (cb: () => void) => (() => void);
314
+ /**
315
+ * Raise the platform's emote-wheel customizer over this world.
316
+ *
317
+ * Routed through the `helix:request` bridge, unlike `getEquipped()` above, which deliberately
318
+ * calls the public platform API directly. The difference is that this one CHANGES something and
319
+ * needs the player's own credential: the shell owns the session, so the shell owns the editor.
320
+ * A world can ask for the door to be opened and learns only whether it was.
321
+ *
322
+ * Resolves `false` when the player is signed out (the shell routes them to auth instead) or when
323
+ * the host has no customizer mounted — never throws for either, because "the editor did not open"
324
+ * is a normal outcome a world should handle, not an exception.
325
+ */
326
+ openCustomizer: () => Promise<boolean>;
327
+ };
328
+ readonly locomotion: {
329
+ /**
330
+ * The locomotion pack the local player MOVES on — read off the seat, not an endpoint.
331
+ *
332
+ * Deliberately unlike `avatar.getEquipped` / `emotes.getEquipped`, which resolve through the shell
333
+ * bridge or a public platform endpoint: a locomotion pack is resolved SERVER-SIDE by the ROOM at join
334
+ * (and re-resolved on the `avatarRefresh` hint) and written onto PlayerState.locomotionPack — contract
335
+ * v34 — so the replicated seat is the only place a client can honestly learn which pack landed on it.
336
+ * Asking the platform directly would answer "what is equipped", which is not the same question as
337
+ * "what is this seat playing".
338
+ *
339
+ * Returns null when there is no seat to read (no room joined, or this session's player has not
340
+ * replicated yet) — the same "could not resolve at all" null its siblings return. An EMPTY `pack` is a
341
+ * real answer: the seat moves on the platform locomotion set, which is equally what a room predating
342
+ * v34, an unresolvable pack and an unservable URL replicate. Never throws.
343
+ */
344
+ getEquipped: () => Promise<EquippedLocomotionPack | null>;
345
+ };
111
346
  readonly presence: {
112
347
  setActivity: (activity: HelixPresenceActivity) => Promise<boolean>;
113
348
  clearActivity: () => Promise<boolean>;
114
349
  };
115
350
  private purchase;
351
+ private purchaseQuantity;
352
+ private purchaseAttemptSlot;
353
+ private readPersistedPurchaseAttempts;
354
+ private writePersistedPurchaseAttempts;
355
+ private autoPurchaseKey;
356
+ private clearAutoPurchaseAttempt;
357
+ private settlePurchaseResult;
116
358
  private trackAnalytics;
117
359
  private safeAnalyticsProperties;
118
360
  private openDevice;
119
361
  private onKeyDown;
362
+ private isInteractiveUiEvent;
120
363
  private request;
121
364
  private newId;
122
365
  private fetchAvatarLoadout;
366
+ private fetchEquippedAvatar;
123
367
  private emitAvatarChanged;
124
368
  private snapshot;
125
369
  private assertInitialized;
126
370
  private waitForInit;
127
371
  private onMessage;
372
+ private markLeft;
373
+ private onPageRestored;
374
+ private emitLeave;
375
+ private setDeviceState;
376
+ private setCameraState;
377
+ private effectiveCameraCapability;
378
+ private cameraCapabilityRefusal;
379
+ private adoptShellCameraState;
128
380
  private setSession;
381
+ private currentCustomizerContext;
129
382
  private enableDebug;
130
383
  private hookConsole;
384
+ private notePreview;
131
385
  private captureLog;
132
386
  private post;
133
387
  private postToShell;
388
+ private xrSessionBridgeAttached;
389
+ private attachXrSessionBridge;
390
+ private onXrSession;
134
391
  }
135
392
  export declare const Helix: HelixSdk;