@speechos/core 0.2.8 → 0.2.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.
package/dist/index.d.cts CHANGED
@@ -7,10 +7,10 @@
7
7
  export { speechOS } from "./speechos.js";
8
8
  export { events, SpeechOSEventEmitter } from "./events.js";
9
9
  export { state, createStateManager } from "./state.js";
10
- export { getConfig, setConfig, resetConfig, updateUserId, validateConfig, getSettingsToken, clearSettingsToken, getFetchHandler, DEFAULT_HOST, } from "./config.js";
10
+ export { getConfig, setConfig, resetConfig, updateUserId, validateConfig, getSettingsToken, clearSettingsToken, DEFAULT_HOST, } from "./config.js";
11
11
  export { livekit, Deferred } from "./livekit.js";
12
12
  export { websocket } from "./websocket.js";
13
13
  export { getBackend } from "./backend.js";
14
14
  export type { VoiceBackend } from "./backend.js";
15
- export type { SpeechOSCoreConfig, SpeechOSState, SpeechOSAction, SpeechOSEventMap, StateChangeCallback, UnsubscribeFn, RecordingState, LiveKitTokenResponse, ServerErrorMessage, ErrorSource, UserVocabularyData, CommandArgument, CommandDefinition, CommandResult, SessionSettings, VoiceSessionOptions, WebSocketLike, WebSocketFactory, FetchOptions, FetchResponse, FetchHandler, } from "./types.js";
15
+ export type { SpeechOSCoreConfig, SpeechOSState, SpeechOSAction, SpeechOSEventMap, StateChangeCallback, UnsubscribeFn, RecordingState, LiveKitTokenResponse, ServerErrorMessage, ErrorSource, UserVocabularyData, CommandArgument, CommandDefinition, CommandResult, SessionSettings, VoiceSessionOptions, WebSocketLike, WebSocketFactory, } from "./types.js";
16
16
  export declare const VERSION = "0.1.0";
package/dist/index.d.ts CHANGED
@@ -7,10 +7,10 @@
7
7
  export { speechOS } from "./speechos.js";
8
8
  export { events, SpeechOSEventEmitter } from "./events.js";
9
9
  export { state, createStateManager } from "./state.js";
10
- export { getConfig, setConfig, resetConfig, updateUserId, validateConfig, getSettingsToken, clearSettingsToken, getFetchHandler, DEFAULT_HOST, } from "./config.js";
10
+ export { getConfig, setConfig, resetConfig, updateUserId, validateConfig, getSettingsToken, clearSettingsToken, DEFAULT_HOST, } from "./config.js";
11
11
  export { livekit, Deferred } from "./livekit.js";
12
12
  export { websocket } from "./websocket.js";
13
13
  export { getBackend } from "./backend.js";
14
14
  export type { VoiceBackend } from "./backend.js";
15
- export type { SpeechOSCoreConfig, SpeechOSState, SpeechOSAction, SpeechOSEventMap, StateChangeCallback, UnsubscribeFn, RecordingState, LiveKitTokenResponse, ServerErrorMessage, ErrorSource, UserVocabularyData, CommandArgument, CommandDefinition, CommandResult, SessionSettings, VoiceSessionOptions, WebSocketLike, WebSocketFactory, FetchOptions, FetchResponse, FetchHandler, } from "./types.js";
15
+ export type { SpeechOSCoreConfig, SpeechOSState, SpeechOSAction, SpeechOSEventMap, StateChangeCallback, UnsubscribeFn, RecordingState, LiveKitTokenResponse, ServerErrorMessage, ErrorSource, UserVocabularyData, CommandArgument, CommandDefinition, CommandResult, SessionSettings, VoiceSessionOptions, WebSocketLike, WebSocketFactory, } from "./types.js";
16
16
  export declare const VERSION = "0.1.0";
package/dist/index.js CHANGED
@@ -14,7 +14,6 @@ const defaultConfig = {
14
14
  host: DEFAULT_HOST,
15
15
  debug: false,
16
16
  webSocketFactory: void 0,
17
- fetchHandler: void 0,
18
17
  settingsToken: void 0
19
18
  };
20
19
  /**
@@ -23,14 +22,13 @@ const defaultConfig = {
23
22
  * @returns Validated and merged configuration
24
23
  */
25
24
  function validateConfig(userConfig) {
26
- if (!userConfig.apiKey) throw new Error("SpeechOS requires an apiKey. Get one from your team dashboard at /a/<team-slug>/.");
25
+ if (!userConfig.apiKey) throw new Error("SpeechOS requires an apiKey. Get one from your team dashboard at /a/.");
27
26
  return {
28
27
  apiKey: userConfig.apiKey,
29
28
  userId: userConfig.userId ?? defaultConfig.userId,
30
29
  host: userConfig.host ?? defaultConfig.host,
31
30
  debug: userConfig.debug ?? defaultConfig.debug,
32
31
  webSocketFactory: userConfig.webSocketFactory ?? defaultConfig.webSocketFactory,
33
- fetchHandler: userConfig.fetchHandler ?? defaultConfig.fetchHandler,
34
32
  settingsToken: userConfig.settingsToken ?? defaultConfig.settingsToken
35
33
  };
36
34
  }
@@ -84,13 +82,6 @@ function clearSettingsToken() {
84
82
  };
85
83
  }
86
84
  /**
87
- * Get the fetch handler from the current configuration
88
- * @returns The fetch handler or undefined if not configured
89
- */
90
- function getFetchHandler() {
91
- return currentConfig.fetchHandler;
92
- }
93
- /**
94
85
  * LocalStorage key for anonymous ID persistence
95
86
  */
96
87
  const ANONYMOUS_ID_KEY = "speechos_anonymous_id";
@@ -2270,5 +2261,5 @@ function getBackend() {
2270
2261
  const VERSION = "0.1.0";
2271
2262
 
2272
2263
  //#endregion
2273
- export { DEFAULT_HOST, Deferred, SpeechOSEventEmitter, VERSION, clearSettingsToken, createStateManager, events, getBackend, getConfig, getFetchHandler, getSettingsToken, livekit, resetConfig, setConfig, speechOS, state, updateUserId, validateConfig, websocket };
2264
+ export { DEFAULT_HOST, Deferred, SpeechOSEventEmitter, VERSION, clearSettingsToken, createStateManager, events, getBackend, getConfig, getSettingsToken, livekit, resetConfig, setConfig, speechOS, state, updateUserId, validateConfig, websocket };
2274
2265
  //# sourceMappingURL=index.js.map