@speechos/client 0.2.0

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.
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Form field focus detection for SpeechOS Client SDK
3
+ * Detects when users focus on form fields and manages widget visibility
4
+ */
5
+ /**
6
+ * Form detector class that manages focus tracking
7
+ */
8
+ export declare class FormDetector {
9
+ private isActive;
10
+ private focusHandler;
11
+ private blurHandler;
12
+ /**
13
+ * Start detecting form field focus events
14
+ */
15
+ start(): void;
16
+ /**
17
+ * Stop detecting form field focus events
18
+ */
19
+ stop(): void;
20
+ /**
21
+ * Check if the detector is currently active
22
+ */
23
+ get active(): boolean;
24
+ }
25
+ export declare const formDetector: FormDetector;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Form field focus detection for SpeechOS Client SDK
3
+ * Detects when users focus on form fields and manages widget visibility
4
+ */
5
+ /**
6
+ * Form detector class that manages focus tracking
7
+ */
8
+ export declare class FormDetector {
9
+ private isActive;
10
+ private focusHandler;
11
+ private blurHandler;
12
+ /**
13
+ * Start detecting form field focus events
14
+ */
15
+ start(): void;
16
+ /**
17
+ * Stop detecting form field focus events
18
+ */
19
+ stop(): void;
20
+ /**
21
+ * Check if the detector is currently active
22
+ */
23
+ get active(): boolean;
24
+ }
25
+ export declare const formDetector: FormDetector;
package/dist/index.cjs ADDED
@@ -0,0 +1,335 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+ //#region rolldown:runtime
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
+ get: ((k) => from[k]).bind(null, key),
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
20
+ value: mod,
21
+ enumerable: true
22
+ }) : target, mod));
23
+
24
+ //#endregion
25
+ const __speechos_core = __toESM(require("@speechos/core"));
26
+
27
+ //#region src/form-detector.ts
28
+ /**
29
+ * Check if an element is a form field that we should track
30
+ */
31
+ function isFormField(element) {
32
+ if (!element || !(element instanceof HTMLElement)) return false;
33
+ const tagName = element.tagName.toLowerCase();
34
+ if (tagName === "input" || tagName === "textarea") {
35
+ if (tagName === "input") {
36
+ const type = element.type.toLowerCase();
37
+ const excludedTypes = [
38
+ "checkbox",
39
+ "radio",
40
+ "submit",
41
+ "button",
42
+ "reset",
43
+ "file",
44
+ "hidden"
45
+ ];
46
+ if (excludedTypes.includes(type)) return false;
47
+ }
48
+ return true;
49
+ }
50
+ if (element.isContentEditable || element.getAttribute("contenteditable") === "true") return true;
51
+ return false;
52
+ }
53
+ /**
54
+ * Form detector class that manages focus tracking
55
+ */
56
+ var FormDetector = class {
57
+ isActive = false;
58
+ focusHandler = null;
59
+ blurHandler = null;
60
+ /**
61
+ * Start detecting form field focus events
62
+ */
63
+ start() {
64
+ if (this.isActive) {
65
+ console.warn("FormDetector is already active");
66
+ return;
67
+ }
68
+ this.focusHandler = (event) => {
69
+ const target = event.target;
70
+ if (isFormField(target)) {
71
+ __speechos_core.state.setFocusedElement(target);
72
+ __speechos_core.state.show();
73
+ __speechos_core.events.emit("form:focus", { element: target });
74
+ }
75
+ };
76
+ this.blurHandler = (event) => {
77
+ const target = event.target;
78
+ if (isFormField(target)) {
79
+ const relatedTarget = event.relatedTarget;
80
+ const widget = document.querySelector("speechos-widget");
81
+ const goingToFormField = isFormField(relatedTarget);
82
+ const goingToWidget = widget && (widget.contains(relatedTarget) || widget.shadowRoot?.contains(relatedTarget) || relatedTarget === widget);
83
+ if (goingToFormField || goingToWidget) return;
84
+ setTimeout(() => {
85
+ const activeElement = document.activeElement;
86
+ const isWidgetFocused = widget && (widget.contains(activeElement) || widget.shadowRoot?.contains(activeElement));
87
+ if (!isFormField(activeElement) && !isWidgetFocused) {
88
+ __speechos_core.state.setFocusedElement(null);
89
+ __speechos_core.state.hide();
90
+ __speechos_core.events.emit("form:blur", { element: null });
91
+ }
92
+ }, 150);
93
+ }
94
+ };
95
+ document.addEventListener("focusin", this.focusHandler, true);
96
+ document.addEventListener("focusout", this.blurHandler, true);
97
+ this.isActive = true;
98
+ }
99
+ /**
100
+ * Stop detecting form field focus events
101
+ */
102
+ stop() {
103
+ if (!this.isActive) return;
104
+ if (this.focusHandler) {
105
+ document.removeEventListener("focusin", this.focusHandler, true);
106
+ this.focusHandler = null;
107
+ }
108
+ if (this.blurHandler) {
109
+ document.removeEventListener("focusout", this.blurHandler, true);
110
+ this.blurHandler = null;
111
+ }
112
+ __speechos_core.state.setFocusedElement(null);
113
+ __speechos_core.state.hide();
114
+ this.isActive = false;
115
+ }
116
+ /**
117
+ * Check if the detector is currently active
118
+ */
119
+ get active() {
120
+ return this.isActive;
121
+ }
122
+ };
123
+ const formDetector = new FormDetector();
124
+
125
+ //#endregion
126
+ //#region src/speechos.ts
127
+ /**
128
+ * Main SpeechOS class for initializing and managing the SDK with UI
129
+ */
130
+ var SpeechOS = class SpeechOS {
131
+ static instance = null;
132
+ static widgetElement = null;
133
+ static isInitialized = false;
134
+ /**
135
+ * Initialize the SpeechOS SDK
136
+ * @param config - Configuration options
137
+ * @returns Promise that resolves when initialization is complete
138
+ * @throws Error if configuration is invalid (e.g., missing apiKey)
139
+ */
140
+ static async init(config = {}) {
141
+ if (this.isInitialized) {
142
+ console.warn("SpeechOS is already initialized");
143
+ return;
144
+ }
145
+ try {
146
+ (0, __speechos_core.setConfig)(config);
147
+ } catch (error) {
148
+ const errorMessage = error instanceof Error ? error.message : "Invalid configuration";
149
+ console.error(`[SpeechOS] Error: ${errorMessage} (init_config)`);
150
+ __speechos_core.events.emit("error", {
151
+ code: "init_config",
152
+ message: errorMessage,
153
+ source: "init"
154
+ });
155
+ throw error;
156
+ }
157
+ const finalConfig = (0, __speechos_core.getConfig)();
158
+ this.instance = new SpeechOS();
159
+ try {
160
+ if (finalConfig.debug) console.log("[SpeechOS] Fetching LiveKit token...");
161
+ await __speechos_core.livekit.fetchToken();
162
+ if (finalConfig.debug) console.log("[SpeechOS] LiveKit token fetched successfully");
163
+ } catch (error) {
164
+ const errorMessage = error instanceof Error ? error.message : "Failed to fetch token";
165
+ console.error(`[SpeechOS] Error: ${errorMessage} (init_token_fetch)`);
166
+ __speechos_core.events.emit("error", {
167
+ code: "init_token_fetch",
168
+ message: errorMessage,
169
+ source: "init"
170
+ });
171
+ }
172
+ formDetector.start();
173
+ this.mountWidget();
174
+ this.isInitialized = true;
175
+ if (finalConfig.debug) console.log("[SpeechOS] Initialized with config:", finalConfig);
176
+ }
177
+ /**
178
+ * Destroy the SpeechOS SDK and clean up resources
179
+ */
180
+ static async destroy() {
181
+ if (!this.isInitialized) {
182
+ console.warn("SpeechOS is not initialized");
183
+ return;
184
+ }
185
+ formDetector.stop();
186
+ await __speechos_core.livekit.disconnect();
187
+ this.unmountWidget();
188
+ __speechos_core.events.clear();
189
+ __speechos_core.state.reset();
190
+ this.instance = null;
191
+ this.isInitialized = false;
192
+ const config = (0, __speechos_core.getConfig)();
193
+ if (config.debug) console.log("[SpeechOS] Destroyed and cleaned up");
194
+ }
195
+ /**
196
+ * Check if SpeechOS is initialized
197
+ */
198
+ static get initialized() {
199
+ return this.isInitialized;
200
+ }
201
+ /**
202
+ * Get the current state
203
+ */
204
+ static getState() {
205
+ return __speechos_core.state.getState();
206
+ }
207
+ /**
208
+ * Get the event emitter for external listeners
209
+ */
210
+ static get events() {
211
+ return __speechos_core.events;
212
+ }
213
+ /**
214
+ * Mount the widget to the DOM
215
+ */
216
+ static mountWidget() {
217
+ if (this.widgetElement) {
218
+ console.warn("Widget is already mounted");
219
+ return;
220
+ }
221
+ const widget = document.createElement("speechos-widget");
222
+ this.widgetElement = widget;
223
+ document.body.appendChild(widget);
224
+ }
225
+ /**
226
+ * Unmount the widget from the DOM
227
+ */
228
+ static unmountWidget() {
229
+ if (this.widgetElement) {
230
+ this.widgetElement.remove();
231
+ this.widgetElement = null;
232
+ }
233
+ }
234
+ /**
235
+ * Show the widget programmatically
236
+ */
237
+ static show() {
238
+ __speechos_core.state.show();
239
+ }
240
+ /**
241
+ * Hide the widget programmatically
242
+ */
243
+ static hide() {
244
+ __speechos_core.state.hide();
245
+ }
246
+ /**
247
+ * Identify the current user
248
+ * Can be called after init() to associate sessions with a user identifier.
249
+ * Clears the cached token so the next voice session uses the new userId.
250
+ *
251
+ * @param userId - User identifier from your system (e.g., user ID, email)
252
+ *
253
+ * @example
254
+ * // Initialize SDK early
255
+ * SpeechOS.init({ apiKey: 'xxx' });
256
+ *
257
+ * // Later, after user logs in
258
+ * SpeechOS.identify('user_123');
259
+ */
260
+ static identify(userId) {
261
+ if (!this.isInitialized) {
262
+ console.warn("SpeechOS.identify() called before init(). Call init() first.");
263
+ return;
264
+ }
265
+ const config = (0, __speechos_core.getConfig)();
266
+ (0, __speechos_core.updateUserId)(userId);
267
+ __speechos_core.livekit.clearToken();
268
+ if (config.debug) console.log(`[SpeechOS] User identified: ${userId}`);
269
+ }
270
+ /**
271
+ * Private constructor to prevent direct instantiation
272
+ */
273
+ constructor() {}
274
+ };
275
+
276
+ //#endregion
277
+ //#region src/index.ts
278
+ const VERSION = "0.1.0";
279
+ var src_default = SpeechOS;
280
+
281
+ //#endregion
282
+ Object.defineProperty(exports, 'DEFAULT_HOST', {
283
+ enumerable: true,
284
+ get: function () {
285
+ return __speechos_core.DEFAULT_HOST;
286
+ }
287
+ });
288
+ exports.FormDetector = FormDetector;
289
+ exports.SpeechOS = SpeechOS;
290
+ exports.VERSION = VERSION;
291
+ exports.default = src_default;
292
+ Object.defineProperty(exports, 'events', {
293
+ enumerable: true,
294
+ get: function () {
295
+ return __speechos_core.events;
296
+ }
297
+ });
298
+ exports.formDetector = formDetector;
299
+ Object.defineProperty(exports, 'getConfig', {
300
+ enumerable: true,
301
+ get: function () {
302
+ return __speechos_core.getConfig;
303
+ }
304
+ });
305
+ Object.defineProperty(exports, 'livekit', {
306
+ enumerable: true,
307
+ get: function () {
308
+ return __speechos_core.livekit;
309
+ }
310
+ });
311
+ Object.defineProperty(exports, 'resetConfig', {
312
+ enumerable: true,
313
+ get: function () {
314
+ return __speechos_core.resetConfig;
315
+ }
316
+ });
317
+ Object.defineProperty(exports, 'setConfig', {
318
+ enumerable: true,
319
+ get: function () {
320
+ return __speechos_core.setConfig;
321
+ }
322
+ });
323
+ Object.defineProperty(exports, 'state', {
324
+ enumerable: true,
325
+ get: function () {
326
+ return __speechos_core.state;
327
+ }
328
+ });
329
+ Object.defineProperty(exports, 'transcriptStore', {
330
+ enumerable: true,
331
+ get: function () {
332
+ return __speechos_core.transcriptStore;
333
+ }
334
+ });
335
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["element: Element | null","event: FocusEvent","formDetector: FormDetector","config: SpeechOSConfig","events","userId: string","SpeechOSClass"],"sources":["../src/form-detector.ts","../src/speechos.ts","../src/index.ts"],"sourcesContent":["/**\n * Form field focus detection for SpeechOS Client SDK\n * Detects when users focus on form fields and manages widget visibility\n */\n\nimport { events, state } from \"@speechos/core\";\n\n/**\n * Check if an element is a form field that we should track\n */\nfunction isFormField(element: Element | null): element is HTMLElement {\n if (!element || !(element instanceof HTMLElement)) {\n return false;\n }\n\n const tagName = element.tagName.toLowerCase();\n\n // Check for input, textarea\n if (tagName === \"input\" || tagName === \"textarea\") {\n // Exclude certain input types that don't accept text\n if (tagName === \"input\") {\n const type = (element as HTMLInputElement).type.toLowerCase();\n const excludedTypes = [\n \"checkbox\",\n \"radio\",\n \"submit\",\n \"button\",\n \"reset\",\n \"file\",\n \"hidden\",\n ];\n if (excludedTypes.includes(type)) {\n return false;\n }\n }\n return true;\n }\n\n // Check for contenteditable\n if (\n element.isContentEditable ||\n element.getAttribute(\"contenteditable\") === \"true\"\n ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Form detector class that manages focus tracking\n */\nexport class FormDetector {\n private isActive = false;\n private focusHandler: ((event: FocusEvent) => void) | null = null;\n private blurHandler: ((event: FocusEvent) => void) | null = null;\n\n /**\n * Start detecting form field focus events\n */\n start(): void {\n if (this.isActive) {\n console.warn(\"FormDetector is already active\");\n return;\n }\n\n // Create event handlers\n this.focusHandler = (event: FocusEvent) => {\n const target = event.target as Element | null;\n\n if (isFormField(target)) {\n state.setFocusedElement(target);\n state.show();\n events.emit(\"form:focus\", { element: target });\n }\n };\n\n this.blurHandler = (event: FocusEvent) => {\n const target = event.target as Element | null;\n\n if (isFormField(target)) {\n // Check relatedTarget (where focus is going) immediately\n const relatedTarget = event.relatedTarget as Element | null;\n const widget = document.querySelector(\"speechos-widget\");\n\n // If focus is going to another form field or the widget, don't hide\n const goingToFormField = isFormField(relatedTarget);\n const goingToWidget =\n widget &&\n (widget.contains(relatedTarget) ||\n widget.shadowRoot?.contains(relatedTarget) ||\n relatedTarget === widget);\n\n if (goingToFormField || goingToWidget) {\n return;\n }\n\n // Delay hiding to allow for any edge cases\n setTimeout(() => {\n // Double-check: verify focus is still not on a form field or widget\n const activeElement = document.activeElement;\n const isWidgetFocused =\n widget &&\n (widget.contains(activeElement) ||\n widget.shadowRoot?.contains(activeElement));\n\n // Only hide if no form field is focused AND widget isn't focused\n if (!isFormField(activeElement) && !isWidgetFocused) {\n state.setFocusedElement(null);\n state.hide();\n events.emit(\"form:blur\", { element: null });\n }\n }, 150);\n }\n };\n\n // Attach listeners to document\n document.addEventListener(\"focusin\", this.focusHandler, true);\n document.addEventListener(\"focusout\", this.blurHandler, true);\n\n this.isActive = true;\n }\n\n /**\n * Stop detecting form field focus events\n */\n stop(): void {\n if (!this.isActive) {\n return;\n }\n\n // Remove event listeners\n if (this.focusHandler) {\n document.removeEventListener(\"focusin\", this.focusHandler, true);\n this.focusHandler = null;\n }\n\n if (this.blurHandler) {\n document.removeEventListener(\"focusout\", this.blurHandler, true);\n this.blurHandler = null;\n }\n\n // Reset state\n state.setFocusedElement(null);\n state.hide();\n\n this.isActive = false;\n }\n\n /**\n * Check if the detector is currently active\n */\n get active(): boolean {\n return this.isActive;\n }\n}\n\n// Export singleton instance\nexport const formDetector: FormDetector = new FormDetector();\n","/**\n * Main SpeechOS Client SDK class\n * Composes core logic with UI components\n */\n\nimport type { SpeechOSConfig, SpeechOSState, SpeechOSEventMap } from \"@speechos/core\";\nimport {\n setConfig,\n getConfig,\n updateUserId,\n state,\n events,\n livekit,\n SpeechOSEventEmitter,\n} from \"@speechos/core\";\nimport { formDetector } from \"./form-detector.js\";\nimport \"./ui/index.js\"; // Auto-registers components\n\n/**\n * Main SpeechOS class for initializing and managing the SDK with UI\n */\nexport class SpeechOS {\n private static instance: SpeechOS | null = null;\n private static widgetElement: HTMLElement | null = null;\n private static isInitialized = false;\n\n /**\n * Initialize the SpeechOS SDK\n * @param config - Configuration options\n * @returns Promise that resolves when initialization is complete\n * @throws Error if configuration is invalid (e.g., missing apiKey)\n */\n static async init(config: SpeechOSConfig = {}): Promise<void> {\n if (this.isInitialized) {\n console.warn(\"SpeechOS is already initialized\");\n return;\n }\n\n try {\n // Validate and set configuration\n setConfig(config);\n } catch (error) {\n // Configuration errors are fatal - log and re-throw\n const errorMessage =\n error instanceof Error ? error.message : \"Invalid configuration\";\n console.error(`[SpeechOS] Error: ${errorMessage} (init_config)`);\n\n // Emit error event before throwing\n events.emit(\"error\", {\n code: \"init_config\",\n message: errorMessage,\n source: \"init\",\n });\n\n throw error;\n }\n\n const finalConfig = getConfig();\n\n // Create singleton instance\n this.instance = new SpeechOS();\n\n // Fetch LiveKit token\n try {\n if (finalConfig.debug) {\n console.log(\"[SpeechOS] Fetching LiveKit token...\");\n }\n await livekit.fetchToken();\n if (finalConfig.debug) {\n console.log(\"[SpeechOS] LiveKit token fetched successfully\");\n }\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : \"Failed to fetch token\";\n console.error(`[SpeechOS] Error: ${errorMessage} (init_token_fetch)`);\n\n // Emit error event for consumers\n events.emit(\"error\", {\n code: \"init_token_fetch\",\n message: errorMessage,\n source: \"init\",\n });\n\n // Continue initialization even if token fetch fails\n // The token will be fetched again when needed\n }\n\n // Start form detection\n formDetector.start();\n\n // Create and mount widget\n this.mountWidget();\n\n this.isInitialized = true;\n\n // Log initialization in debug mode\n if (finalConfig.debug) {\n console.log(\"[SpeechOS] Initialized with config:\", finalConfig);\n }\n }\n\n /**\n * Destroy the SpeechOS SDK and clean up resources\n */\n static async destroy(): Promise<void> {\n if (!this.isInitialized) {\n console.warn(\"SpeechOS is not initialized\");\n return;\n }\n\n // Stop form detection\n formDetector.stop();\n\n // Disconnect from LiveKit (also clears token)\n await livekit.disconnect();\n\n // Remove widget from DOM\n this.unmountWidget();\n\n // Clear all event listeners\n events.clear();\n\n // Reset state\n state.reset();\n\n // Clear instance\n this.instance = null;\n this.isInitialized = false;\n\n const config = getConfig();\n if (config.debug) {\n console.log(\"[SpeechOS] Destroyed and cleaned up\");\n }\n }\n\n /**\n * Check if SpeechOS is initialized\n */\n static get initialized(): boolean {\n return this.isInitialized;\n }\n\n /**\n * Get the current state\n */\n static getState(): SpeechOSState {\n return state.getState();\n }\n\n /**\n * Get the event emitter for external listeners\n */\n static get events(): SpeechOSEventEmitter {\n return events;\n }\n\n /**\n * Mount the widget to the DOM\n */\n private static mountWidget(): void {\n if (this.widgetElement) {\n console.warn(\"Widget is already mounted\");\n return;\n }\n\n // Create widget element\n const widget = document.createElement(\"speechos-widget\");\n this.widgetElement = widget;\n\n // Append to body\n document.body.appendChild(widget);\n }\n\n /**\n * Unmount the widget from the DOM\n */\n private static unmountWidget(): void {\n if (this.widgetElement) {\n this.widgetElement.remove();\n this.widgetElement = null;\n }\n }\n\n /**\n * Show the widget programmatically\n */\n static show(): void {\n state.show();\n }\n\n /**\n * Hide the widget programmatically\n */\n static hide(): void {\n state.hide();\n }\n\n /**\n * Identify the current user\n * Can be called after init() to associate sessions with a user identifier.\n * Clears the cached token so the next voice session uses the new userId.\n *\n * @param userId - User identifier from your system (e.g., user ID, email)\n *\n * @example\n * // Initialize SDK early\n * SpeechOS.init({ apiKey: 'xxx' });\n *\n * // Later, after user logs in\n * SpeechOS.identify('user_123');\n */\n static identify(userId: string): void {\n if (!this.isInitialized) {\n console.warn(\n \"SpeechOS.identify() called before init(). Call init() first.\"\n );\n return;\n }\n\n const config = getConfig();\n\n // Update the userId in config\n updateUserId(userId);\n\n // Clear cached token so next session gets a fresh one with the new userId\n livekit.clearToken();\n\n if (config.debug) {\n console.log(`[SpeechOS] User identified: ${userId}`);\n }\n }\n\n /**\n * Private constructor to prevent direct instantiation\n */\n private constructor() {\n // Singleton pattern - use SpeechOS.init() instead\n }\n}\n\n// Export singleton class as default\nexport default SpeechOS;\n","/**\n * @speechos/client\n *\n * Vanilla JS client SDK for embedding SpeechOS into web applications.\n * Includes Web Components UI and DOM-based form detection.\n */\n\nimport { SpeechOS as SpeechOSClass } from \"./speechos.js\";\n\n// Re-export everything from core\nexport {\n events,\n state,\n getConfig,\n setConfig,\n resetConfig,\n livekit,\n transcriptStore,\n DEFAULT_HOST,\n} from \"@speechos/core\";\n\nexport type {\n SpeechOSConfig,\n SpeechOSState,\n SpeechOSAction,\n SpeechOSEventMap,\n StateChangeCallback,\n UnsubscribeFn,\n RecordingState,\n TranscriptEntry,\n TranscriptAction,\n} from \"@speechos/core\";\n\n// Client-specific exports\nexport { formDetector, FormDetector } from \"./form-detector.js\";\n\n// Version\nexport const VERSION = \"0.1.0\";\n\n// Main SDK class\nexport { SpeechO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;;;;;;;;;CAgBD,OAAO,SAASC,QAAsB;AACpC,OAAK,KAAK,eAAe;AACvB,WAAQ,KACN,+DACD;AACD;EACD;EAED,MAAM,SAAS,gCAAW;AAG1B,oCAAa,OAAO;AAGpB,0BAAQ,YAAY;AAEpB,MAAI,OAAO,MACT,SAAQ,KAAK,8BAA8B,OAAO,EAAE;CAEvD;;;;CAKD,AAAQ,cAAc,CAErB;AACF;;;;ACzMD,MAAa,UAAU;AAIvB,kBAAeC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @speechos/client
3
+ *
4
+ * Vanilla JS client SDK for embedding SpeechOS into web applications.
5
+ * Includes Web Components UI and DOM-based form detection.
6
+ */
7
+ import { SpeechOS as SpeechOSClass } from "./speechos.js";
8
+ export { events, state, getConfig, setConfig, resetConfig, livekit, transcriptStore, DEFAULT_HOST, } from "@speechos/core";
9
+ export type { SpeechOSConfig, SpeechOSState, SpeechOSAction, SpeechOSEventMap, StateChangeCallback, UnsubscribeFn, RecordingState, TranscriptEntry, TranscriptAction, } from "@speechos/core";
10
+ export { formDetector, FormDetector } from "./form-detector.js";
11
+ export declare const VERSION = "0.1.0";
12
+ export { SpeechOSClass as SpeechOS };
13
+ export default SpeechOSClass;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @speechos/client
3
+ *
4
+ * Vanilla JS client SDK for embedding SpeechOS into web applications.
5
+ * Includes Web Components UI and DOM-based form detection.
6
+ */
7
+ import { SpeechOS as SpeechOSClass } from "./speechos.js";
8
+ export { events, state, getConfig, setConfig, resetConfig, livekit, transcriptStore, DEFAULT_HOST, } from "@speechos/core";
9
+ export type { SpeechOSConfig, SpeechOSState, SpeechOSAction, SpeechOSEventMap, StateChangeCallback, UnsubscribeFn, RecordingState, TranscriptEntry, TranscriptAction, } from "@speechos/core";
10
+ export { formDetector, FormDetector } from "./form-detector.js";
11
+ export declare const VERSION = "0.1.0";
12
+ export { SpeechOSClass as SpeechOS };
13
+ export default SpeechOSClass;