@ikonai/sdk 0.0.28 → 0.0.31

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 (32) hide show
  1. package/assets/audio-capture-worker-DINNsNmH.js +933 -0
  2. package/assets/audio-playback-worker-C4Eyhfrh.js +1323 -0
  3. package/assets/protocol-worker-E7o-6_bZ.js +1422 -0
  4. package/assets/video-capture-worker-CTRX9PKp.js +843 -0
  5. package/assets/video-playback-worker-CIuL9Crw.js +875 -0
  6. package/channel/channel-manager.d.ts +1 -1
  7. package/channel/channel.d.ts +1 -1
  8. package/client/endpoint-selector.d.ts +1 -1
  9. package/client/ikon-client-config.d.ts +4 -9
  10. package/client/ikon-client.d.ts +5 -1
  11. package/connection/authenticator.d.ts +1 -1
  12. package/functions/function-registry.d.ts +1 -1
  13. package/functions/index.d.ts +1 -1
  14. package/functions/types.d.ts +1 -1
  15. package/index.d.ts +8 -8
  16. package/index.js +3884 -15843
  17. package/media/audio-constants.d.ts +20 -0
  18. package/media/ikon-audio-playback.d.ts +1 -1
  19. package/media/ikon-video-playback.d.ts +0 -8
  20. package/package.json +2 -1
  21. package/transport/transport.d.ts +1 -1
  22. package/transport/web-socket-transport.d.ts +6 -1
  23. package/transport/web-transport-transport.d.ts +17 -2
  24. package/{media/audio-worker-messages.d.ts → worker/audio-playback-worker.d.ts} +10 -10
  25. package/worker/video-playback-worker.d.ts +59 -0
  26. package/assets/audio-capture-worker-C5hNMTF7.js +0 -14835
  27. package/assets/audio-worker-Ci3tYX2B.js +0 -15121
  28. package/assets/protocol-worker-DXLojSe-.js +0 -15288
  29. package/assets/video-capture-worker-OBl3bsvx.js +0 -14733
  30. package/assets/video-worker-BoOfB8qz.js +0 -14761
  31. package/worker/audio-worker.d.ts +0 -1
  32. package/worker/video-worker.d.ts +0 -1
@@ -1,5 +1,5 @@
1
1
  import { EndpointSelector } from '../client/endpoint-selector';
2
- import { Entrypoint, EntrypointType, ProtocolMessage } from '../../../../shared/generated/src/index.ts';
2
+ import { Entrypoint, EntrypointType, ProtocolMessage } from '../../../../shared/protocol/src/index.ts';
3
3
  /**
4
4
  * ChannelManager state.
5
5
  */
@@ -1,4 +1,4 @@
1
- import { Entrypoint, EntrypointType, ProtocolMessage } from '../../../../shared/generated/src/index.ts';
1
+ import { Entrypoint, EntrypointType, ProtocolMessage } from '../../../../shared/protocol/src/index.ts';
2
2
  /**
3
3
  * Channel state.
4
4
  */
@@ -1,4 +1,4 @@
1
- import { Entrypoint, EntrypointType } from '../../../../shared/generated/src/index.ts';
1
+ import { Entrypoint, EntrypointType } from '../../../../shared/protocol/src/index.ts';
2
2
  import { LocalConfig } from './ikon-client-config';
3
3
  /**
4
4
  * EndpointSelector handles ordering and selection of endpoint types.
@@ -1,4 +1,4 @@
1
- import { ProtocolMessage } from '../../../../shared/generated/src/index.ts';
1
+ import { ProtocolMessage } from '../../../../shared/protocol/src/index.ts';
2
2
  import { BackendType } from '../connection/urls';
3
3
  import { ConnectionState } from './connection-state';
4
4
  import { IkonAudioOutputConfig, IkonAudioPlaybackConfig } from '../media/ikon-audio-playback';
@@ -151,15 +151,10 @@ export interface SessionTokenConfig extends CloudConnectionConfig {
151
151
  */
152
152
  export interface DebugConfig {
153
153
  /**
154
- * Log sent protocol messages.
155
- * Format: "Sent {OPCODE_NAME} {senderId} -> {targets}"
154
+ * Enable the Ikon DevTools extension bridge.
155
+ * When true, protocol messages are emitted as CustomEvents for the browser extension.
156
156
  */
157
- logSentMessages?: boolean;
158
- /**
159
- * Log received protocol messages.
160
- * Format: "Received {senderId} -> {OPCODE_NAME}"
161
- */
162
- logReceivedMessages?: boolean;
157
+ devtools?: boolean;
163
158
  }
164
159
  /**
165
160
  * Timeout configuration for the SDK.
@@ -1,4 +1,4 @@
1
- import { GlobalState, ProtocolMessage } from '../../../../shared/generated/src/index.ts';
1
+ import { GlobalState, ProtocolMessage } from '../../../../shared/protocol/src/index.ts';
2
2
  import { FunctionRegistry } from '../functions/function-registry';
3
3
  import { IkonMedia } from '../media/ikon-media';
4
4
  import { IkonMediaCapture } from '../media/ikon-media-capture';
@@ -86,6 +86,9 @@ export declare class IkonClient {
86
86
  private slowConnectionTimer;
87
87
  private connectionTimer;
88
88
  private messageSubscribers;
89
+ private subscriberHandlers;
90
+ private subscriberOptions;
91
+ private subscriberHandlerToIndex;
89
92
  private stateSubscribers;
90
93
  private abortController;
91
94
  private readonly config;
@@ -208,6 +211,7 @@ export declare class IkonClient {
208
211
  private handleProtocolMessage;
209
212
  /**
210
213
  * Notify config callback and message subscribers.
214
+ * Uses indexed array iteration to avoid Map.entries() allocation in hot path.
211
215
  */
212
216
  private notifyMessageSubscribers;
213
217
  /**
@@ -1,4 +1,4 @@
1
- import { AuthResponse } from '../../../../shared/generated/src/index.ts';
1
+ import { AuthResponse } from '../../../../shared/protocol/src/index.ts';
2
2
  import { ApiKeyConfig, LocalConfig, SessionTokenConfig } from '../client/ikon-client-config';
3
3
  /**
4
4
  * Result of authentication - contains the AuthResponse from the server.
@@ -1,4 +1,4 @@
1
- import { ProtocolMessage } from '../../../../shared/generated/src/index.ts';
1
+ import { ProtocolMessage } from '../../../../shared/protocol/src/index.ts';
2
2
  import { FunctionDefinition, FunctionHandler, NormalizedFunction } from './types';
3
3
  export interface FunctionRegistryConfig {
4
4
  sendProtocolMessage: (message: ProtocolMessage) => void;
@@ -1,4 +1,4 @@
1
- export type { ValueDescriptor, NormalizedValueDescriptor, PrimitiveValueKind, FunctionParameterDefinition, FunctionDefinition, FunctionHandler, FunctionResultWithData, } from './types';
1
+ export type { ValueDescriptor, NormalizedValueDescriptor, PrimitiveValueKind, FunctionParameterDefinition, FunctionDefinition, FunctionHandler, FunctionResultWithData } from './types';
2
2
  export { withResultData } from './types';
3
3
  export { FunctionRegistry, type FunctionRegistryConfig } from './function-registry';
4
4
  export { registerBrowserFunctions, isBrowserEnvironment } from './browser-functions';
@@ -1,4 +1,4 @@
1
- import { ActionFunctionRegister } from '../../../../shared/generated/src/index.ts';
1
+ import { ActionFunctionRegister } from '../../../../shared/protocol/src/index.ts';
2
2
  export type PrimitiveValueKind = 'boolean' | 'number' | 'string';
3
3
  type PrimitiveDescriptor = {
4
4
  kind: PrimitiveValueKind;
package/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- export { IkonClient, type ProtocolMessageHandler, type StateHandler, type ProtocolMessageSubscriptionOptions, type ProtocolMessagePort, type ProtocolSendPort, } from './client/ikon-client';
1
+ export { IkonClient, type ProtocolMessageHandler, type StateHandler, type ProtocolMessageSubscriptionOptions, type ProtocolMessagePort, type ProtocolSendPort } from './client/ikon-client';
2
2
  export type { IkonClientConfig, LocalConfig, ApiKeyConfig, SessionTokenConfig, CloudConnectionConfig, CommonConnectionConfig, TimeoutConfig, DebugConfig, BackendType } from './client/ikon-client-config';
3
3
  export type { ConnectionState } from './client/connection-state';
4
4
  export { isConnecting, isConnected, isOffline, isError } from './client/connection-state';
5
5
  export { ChannelManager, type ChannelManagerConfig, type ChannelManagerState } from './channel/channel-manager';
6
6
  export { Channel, type ChannelConfig, type ChannelState } from './channel/channel';
7
7
  export { EndpointSelector } from './client/endpoint-selector';
8
- export { ConnectionError, AuthenticationError, TransportError, KeepaliveTimeoutError, MaxRetriesExceededError, ProvisioningTimeoutError, ChannelNotFoundError, SpaceNotFoundError, NoChannelsError, } from './errors';
9
- export { Opcode, EntrypointType, ClientReady, UserType, ClientType, ContextType, GlobalState } from '../../../shared/generated/src/index.ts';
10
- export type { ProtocolMessage, ProtocolMessageHeaders } from '../../../shared/generated/src/index.ts';
11
- export { teleportReadOpcode as readOpcode, teleportReadOpcodeGroup as readOpcodeGroup, asProtocolMessage, readProtocolMessageHeaders } from '../../../shared/generated/src/index.ts';
8
+ export { ConnectionError, AuthenticationError, TransportError, KeepaliveTimeoutError, MaxRetriesExceededError, ProvisioningTimeoutError, ChannelNotFoundError, SpaceNotFoundError, NoChannelsError } from './errors';
9
+ export { Opcode, EntrypointType, UserType, ClientType, ContextType } from '../../../shared/protocol/src/index.ts';
10
+ export type { ClientReady, GlobalState, ProtocolMessage, ProtocolMessageHeaders } from '../../../shared/protocol/src/index.ts';
11
+ export { teleportReadOpcode as readOpcode, teleportReadOpcodeGroup as readOpcodeGroup, asProtocolMessage, readProtocolMessageHeaders } from '../../../shared/protocol/src/index.ts';
12
12
  export { isWebTransportSupported } from './transport/web-transport-transport';
13
13
  export { setLogLevel, setLogSink, getLogLevel, getLogSink, createLogger, LogLevel } from './utils/logger';
14
14
  export type { LogEntry, LogSink, Logger } from './utils/logger';
@@ -17,8 +17,8 @@ export { initializeLogSink, setSendLogsCallback, getBufferedLogs, takeBufferedLo
17
17
  export type { LogSinkConfig } from './utils/logSink';
18
18
  export { FunctionRegistry, registerBrowserFunctions, isBrowserEnvironment, type FunctionRegistryConfig } from './functions';
19
19
  export { withResultData } from './functions';
20
- export type { ValueDescriptor, NormalizedValueDescriptor, PrimitiveValueKind, FunctionParameterDefinition, FunctionDefinition, FunctionHandler, FunctionResultWithData, } from './functions';
20
+ export type { ValueDescriptor, NormalizedValueDescriptor, PrimitiveValueKind, FunctionParameterDefinition, FunctionDefinition, FunctionHandler, FunctionResultWithData } from './functions';
21
21
  export { IKON_AUTH_BASE_URL, IKON_AUTH_URL_PROD, IKON_AUTH_URL_DEV, IKON_BACKEND_URL_PROD, IKON_BACKEND_URL_DEV, deriveAuthUrl, deriveBackendUrl, deriveBackendType, parseUrlParams, isCloudEnvironment, type UrlParams } from './connection/urls';
22
22
  export { getOrCreateDeviceId, clearDeviceId, extractUserIdFromToken } from './storage';
23
- export { IkonMedia, IkonAudioPlayback, IkonVideoPlayback, isSharedArrayBufferSupported, isAudioWorkletSupported, IkonMediaCapture, IkonVideoCapture, IkonAudioCapture, IkonImageCapture, } from './media';
24
- export type { IkonMediaConfig, IkonAudioPlaybackConfig, IkonAudioOutputConfig, IkonVideoPlaybackConfig, IkonVideoCaptureHandle, IkonVideoCaptureRequest, VideoCaptureSource, IkonAudioCaptureHandle, IkonAudioCaptureRequest, IkonImageCaptureRequest, IkonImageCaptureResult, } from './media';
23
+ export { IkonMedia, IkonAudioPlayback, IkonVideoPlayback, isSharedArrayBufferSupported, isAudioWorkletSupported, IkonMediaCapture, IkonVideoCapture, IkonAudioCapture, IkonImageCapture } from './media';
24
+ export type { IkonMediaConfig, IkonAudioPlaybackConfig, IkonAudioOutputConfig, IkonVideoPlaybackConfig, IkonVideoCaptureHandle, IkonVideoCaptureRequest, VideoCaptureSource, IkonAudioCaptureHandle, IkonAudioCaptureRequest, IkonImageCaptureRequest, IkonImageCaptureResult } from './media';