@ikonai/sdk 0.0.34 → 0.0.37

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.
@@ -187,6 +187,50 @@ export interface TimeoutConfig {
187
187
  */
188
188
  maxReconnectAttempts?: number;
189
189
  }
190
+ /**
191
+ * Media Session metadata for OS-level media controls (lock screen, notifications).
192
+ * Shared across audio and video playback.
193
+ */
194
+ export interface MediaSessionConfig {
195
+ /** Title shown in media notifications. Default: 'Audio' */
196
+ title?: string;
197
+ /** Artist shown in media notifications. Default: 'Ikon AI App' */
198
+ artist?: string;
199
+ }
200
+ /**
201
+ * Audio playback pipeline configuration.
202
+ */
203
+ export interface AudioConfig {
204
+ /**
205
+ * When enabled, the SDK prepares the audio pipeline and starts decoding as soon as possible.
206
+ *
207
+ * Audio output still depends on browser autoplay policies. The SDK automatically resumes
208
+ * the AudioContext on the first user gesture (click, touch, keypress, etc.).
209
+ */
210
+ enabled?: boolean;
211
+ /**
212
+ * Threading and capability preferences for audio.
213
+ */
214
+ threading?: IkonAudioPlaybackConfig['threading'];
215
+ /**
216
+ * Background audio playback configuration.
217
+ */
218
+ background?: IkonAudioPlaybackConfig['background'];
219
+ /**
220
+ * Audio debugging/diagnostics configuration.
221
+ */
222
+ diagnostics?: IkonAudioPlaybackConfig['diagnostics'];
223
+ }
224
+ /**
225
+ * Video playback pipeline configuration.
226
+ *
227
+ * Video rendering requires an explicit surface (canvas) provided by the app.
228
+ * The SDK can still prepare worker/decoder plumbing to reduce time-to-first-frame.
229
+ */
230
+ export interface VideoConfig {
231
+ enabled?: boolean;
232
+ threading?: IkonVideoPlaybackConfig['threading'];
233
+ }
190
234
  /**
191
235
  * Configuration for IkonClient.
192
236
  */
@@ -216,63 +260,18 @@ export interface IkonClientConfig {
216
260
  */
217
261
  debug?: DebugConfig;
218
262
  /**
219
- * Threading and worker configuration.
263
+ * Audio playback pipeline configuration.
220
264
  */
221
- threading?: {
222
- /**
223
- * Move protocol send/receive to a WebWorker when possible.
224
- * - 'auto': try to use a worker and fall back to main thread on failure
225
- * - 'disabled': always use main thread transports
226
- */
227
- protocolWorker?: 'auto' | 'disabled';
228
- };
265
+ audio?: AudioConfig;
229
266
  /**
230
- * Media (audio/video) playback configuration.
231
- *
232
- * The SDK treats protocol messages as the canonical representation of streams.
233
- * This section controls whether the SDK should create and prepare media pipelines
234
- * (workers, decoders, AudioWorklet) to reduce time-to-first-audio/video.
235
- */
236
- media?: {
237
- /**
238
- * Audio playback pipeline.
239
- */
240
- audio?: {
241
- /**
242
- * When enabled, the SDK prepares the audio pipeline and starts decoding as soon as possible.
243
- *
244
- * Audio output still depends on browser autoplay policies. The SDK automatically resumes
245
- * the AudioContext on the first user gesture (click, touch, keypress, etc.).
246
- */
247
- enabled?: boolean;
248
- /**
249
- * Threading and capability preferences for audio.
250
- */
251
- threading?: IkonAudioPlaybackConfig['threading'];
252
- /**
253
- * Background audio playback configuration.
254
- */
255
- background?: IkonAudioPlaybackConfig['background'];
256
- /**
257
- * Media Session metadata for notifications/lock screen.
258
- */
259
- mediaSession?: IkonAudioPlaybackConfig['mediaSession'];
260
- /**
261
- * Audio debugging/diagnostics configuration.
262
- */
263
- diagnostics?: IkonAudioPlaybackConfig['diagnostics'];
264
- };
265
- /**
266
- * Video playback pipeline.
267
- *
268
- * Video rendering requires an explicit surface (canvas) provided by the app.
269
- * The SDK can still prepare worker/decoder plumbing to reduce time-to-first-frame.
270
- */
271
- video?: {
272
- enabled?: boolean;
273
- threading?: IkonVideoPlaybackConfig['threading'];
274
- };
275
- };
267
+ * Video playback pipeline configuration.
268
+ */
269
+ video?: VideoConfig;
270
+ /**
271
+ * Media Session metadata for OS-level media controls (lock screen, notifications).
272
+ * Shared across audio and video playback.
273
+ */
274
+ mediaSession?: MediaSessionConfig;
276
275
  /**
277
276
  * Callback when a protocol message is received.
278
277
  * The SDK handles keepalive internally; other messages are passed to this callback.
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { IkonClient, type ProtocolMessageHandler, type StateHandler, type ProtocolMessageSubscriptionOptions, type ProtocolMessagePort, type ProtocolSendPort } from './client/ikon-client';
2
- export type { IkonClientConfig, LocalConfig, ApiKeyConfig, SessionTokenConfig, CloudConnectionConfig, CommonConnectionConfig, TimeoutConfig, DebugConfig, BackendType } from './client/ikon-client-config';
2
+ export type { IkonClientConfig, LocalConfig, ApiKeyConfig, SessionTokenConfig, CloudConnectionConfig, CommonConnectionConfig, TimeoutConfig, DebugConfig, BackendType, AudioConfig, VideoConfig, MediaSessionConfig } 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';
@@ -13,8 +13,8 @@ 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';
15
15
  export { getOpcodeName } from './utils/opcode-names';
16
- export { initializeLogSink, setSendLogsCallback, getBufferedLogs, takeBufferedLogs, flushLogs, clearLogBuffer, getLogBufferSize } from './utils/logSink';
17
- export type { LogSinkConfig } from './utils/logSink';
16
+ export { initializeLogSink, setSendLogsCallback, getBufferedLogs, takeBufferedLogs, flushLogs, clearLogBuffer, getLogBufferSize } from './utils/log-sink';
17
+ export type { LogSinkConfig } from './utils/log-sink';
18
18
  export { FunctionRegistry, registerBrowserFunctions, isBrowserEnvironment, type FunctionRegistryConfig } from './functions';
19
19
  export { withResultData } from './functions';
20
20
  export type { ValueDescriptor, NormalizedValueDescriptor, PrimitiveValueKind, FunctionParameterDefinition, FunctionDefinition, FunctionHandler, FunctionResultWithData } from './functions';