stelo 1.0.1

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 (141) hide show
  1. package/LICENSE +184 -0
  2. package/README.md +853 -0
  3. package/dist/accessibility.d.ts +227 -0
  4. package/dist/accessibility.d.ts.map +1 -0
  5. package/dist/accessibility.js +602 -0
  6. package/dist/accessibility.js.map +1 -0
  7. package/dist/agent.d.ts +870 -0
  8. package/dist/agent.d.ts.map +1 -0
  9. package/dist/agent.js +1107 -0
  10. package/dist/agent.js.map +1 -0
  11. package/dist/audio-stream.d.ts +114 -0
  12. package/dist/audio-stream.d.ts.map +1 -0
  13. package/dist/audio-stream.js +167 -0
  14. package/dist/audio-stream.js.map +1 -0
  15. package/dist/clipboard.d.ts +99 -0
  16. package/dist/clipboard.d.ts.map +1 -0
  17. package/dist/clipboard.js +352 -0
  18. package/dist/clipboard.js.map +1 -0
  19. package/dist/config.d.ts +183 -0
  20. package/dist/config.d.ts.map +1 -0
  21. package/dist/config.js +477 -0
  22. package/dist/config.js.map +1 -0
  23. package/dist/context.d.ts +213 -0
  24. package/dist/context.d.ts.map +1 -0
  25. package/dist/context.js +387 -0
  26. package/dist/context.js.map +1 -0
  27. package/dist/cortex.d.ts +548 -0
  28. package/dist/cortex.d.ts.map +1 -0
  29. package/dist/cortex.js +1479 -0
  30. package/dist/cortex.js.map +1 -0
  31. package/dist/errors.d.ts +133 -0
  32. package/dist/errors.d.ts.map +1 -0
  33. package/dist/errors.js +278 -0
  34. package/dist/errors.js.map +1 -0
  35. package/dist/events.d.ts +227 -0
  36. package/dist/events.d.ts.map +1 -0
  37. package/dist/events.js +429 -0
  38. package/dist/events.js.map +1 -0
  39. package/dist/executor.d.ts +212 -0
  40. package/dist/executor.d.ts.map +1 -0
  41. package/dist/executor.js +545 -0
  42. package/dist/executor.js.map +1 -0
  43. package/dist/index.d.ts +69 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +167 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/integration.d.ts +159 -0
  48. package/dist/integration.d.ts.map +1 -0
  49. package/dist/integration.js +533 -0
  50. package/dist/integration.js.map +1 -0
  51. package/dist/keyboard.d.ts +276 -0
  52. package/dist/keyboard.d.ts.map +1 -0
  53. package/dist/keyboard.js +404 -0
  54. package/dist/keyboard.js.map +1 -0
  55. package/dist/logger.d.ts +198 -0
  56. package/dist/logger.d.ts.map +1 -0
  57. package/dist/logger.js +516 -0
  58. package/dist/logger.js.map +1 -0
  59. package/dist/middleware.d.ts +183 -0
  60. package/dist/middleware.d.ts.map +1 -0
  61. package/dist/middleware.js +493 -0
  62. package/dist/middleware.js.map +1 -0
  63. package/dist/monitor.d.ts +136 -0
  64. package/dist/monitor.d.ts.map +1 -0
  65. package/dist/monitor.js +341 -0
  66. package/dist/monitor.js.map +1 -0
  67. package/dist/mouse.d.ts +290 -0
  68. package/dist/mouse.d.ts.map +1 -0
  69. package/dist/mouse.js +466 -0
  70. package/dist/mouse.js.map +1 -0
  71. package/dist/plugin.d.ts +157 -0
  72. package/dist/plugin.d.ts.map +1 -0
  73. package/dist/plugin.js +409 -0
  74. package/dist/plugin.js.map +1 -0
  75. package/dist/process.d.ts +106 -0
  76. package/dist/process.d.ts.map +1 -0
  77. package/dist/process.js +326 -0
  78. package/dist/process.js.map +1 -0
  79. package/dist/recorder.d.ts +100 -0
  80. package/dist/recorder.d.ts.map +1 -0
  81. package/dist/recorder.js +258 -0
  82. package/dist/recorder.js.map +1 -0
  83. package/dist/safety.d.ts +59 -0
  84. package/dist/safety.d.ts.map +1 -0
  85. package/dist/safety.js +98 -0
  86. package/dist/safety.js.map +1 -0
  87. package/dist/scheduler.d.ts +152 -0
  88. package/dist/scheduler.d.ts.map +1 -0
  89. package/dist/scheduler.js +615 -0
  90. package/dist/scheduler.js.map +1 -0
  91. package/dist/screen.d.ts +96 -0
  92. package/dist/screen.d.ts.map +1 -0
  93. package/dist/screen.js +154 -0
  94. package/dist/screen.js.map +1 -0
  95. package/dist/session.d.ts +209 -0
  96. package/dist/session.d.ts.map +1 -0
  97. package/dist/session.js +479 -0
  98. package/dist/session.js.map +1 -0
  99. package/dist/stream.d.ts +168 -0
  100. package/dist/stream.d.ts.map +1 -0
  101. package/dist/stream.js +298 -0
  102. package/dist/stream.js.map +1 -0
  103. package/dist/telemetry.d.ts +223 -0
  104. package/dist/telemetry.d.ts.map +1 -0
  105. package/dist/telemetry.js +433 -0
  106. package/dist/telemetry.js.map +1 -0
  107. package/dist/types.d.ts +165 -0
  108. package/dist/types.d.ts.map +1 -0
  109. package/dist/types.js +8 -0
  110. package/dist/types.js.map +1 -0
  111. package/dist/utils/bezier.d.ts +51 -0
  112. package/dist/utils/bezier.d.ts.map +1 -0
  113. package/dist/utils/bezier.js +117 -0
  114. package/dist/utils/bezier.js.map +1 -0
  115. package/dist/utils/helpers.d.ts +90 -0
  116. package/dist/utils/helpers.d.ts.map +1 -0
  117. package/dist/utils/helpers.js +143 -0
  118. package/dist/utils/helpers.js.map +1 -0
  119. package/dist/utils/index.d.ts +4 -0
  120. package/dist/utils/index.d.ts.map +1 -0
  121. package/dist/utils/index.js +18 -0
  122. package/dist/utils/index.js.map +1 -0
  123. package/dist/validation.d.ts +254 -0
  124. package/dist/validation.d.ts.map +1 -0
  125. package/dist/validation.js +478 -0
  126. package/dist/validation.js.map +1 -0
  127. package/dist/vision.d.ts +719 -0
  128. package/dist/vision.d.ts.map +1 -0
  129. package/dist/vision.js +1197 -0
  130. package/dist/vision.js.map +1 -0
  131. package/dist/window.d.ts +80 -0
  132. package/dist/window.d.ts.map +1 -0
  133. package/dist/window.js +170 -0
  134. package/dist/window.js.map +1 -0
  135. package/dist/workflow.d.ts +224 -0
  136. package/dist/workflow.d.ts.map +1 -0
  137. package/dist/workflow.js +578 -0
  138. package/dist/workflow.js.map +1 -0
  139. package/index.d.ts +840 -0
  140. package/index.js +495 -0
  141. package/package.json +91 -0
@@ -0,0 +1,548 @@
1
+ /** Conversation state machine states. */
2
+ export type ConversationState = 'disconnected' | 'idle' | 'listening' | 'thinking' | 'speaking' | 'acting' | 'interrupted';
3
+ /** Who is currently "holding the floor" in the conversation. */
4
+ export type TurnOwner = 'user' | 'model' | 'system' | 'none';
5
+ /** A tool the model can call. */
6
+ export interface ToolDefinition {
7
+ name: string;
8
+ description: string;
9
+ parameters?: Record<string, {
10
+ type: string;
11
+ description?: string;
12
+ enum?: string[];
13
+ required?: boolean;
14
+ }>;
15
+ /** If true, model continues talking while tool runs (async). */
16
+ nonBlocking?: boolean;
17
+ }
18
+ /** Configuration passed to the provider when connecting. */
19
+ export interface ProviderConfig {
20
+ apiKey: string;
21
+ model: string;
22
+ systemInstruction?: string;
23
+ voice?: string;
24
+ responseModalities?: Array<'audio' | 'text'>;
25
+ tools?: ToolDefinition[];
26
+ /** Enable input audio transcription. */
27
+ transcribeInput?: boolean;
28
+ /** Enable output audio transcription. */
29
+ transcribeOutput?: boolean;
30
+ /** Provider-specific extensions (e.g. Gemini's affective_dialog, proactive_audio). */
31
+ providerOptions?: Record<string, any>;
32
+ }
33
+ /**
34
+ * The transport layer between Cortex and a model provider.
35
+ * Implement this for Gemini Live, OpenAI Realtime, xAI, or any other.
36
+ */
37
+ export interface CortexTransport {
38
+ /** Send raw PCM audio to the model. */
39
+ sendAudio(pcm: Buffer, sampleRate: number): void;
40
+ /** Send a video frame (JPEG) to the model. */
41
+ sendVideo(jpeg: Buffer): void;
42
+ /** Send text input to the model. */
43
+ sendText(text: string, role?: 'user' | 'system'): void;
44
+ /** Send a tool/function response back to the model. */
45
+ sendToolResponse(callId: string, result: any, scheduling?: 'interrupt' | 'when_idle' | 'silent'): void;
46
+ /** Signal user speaking started (manual VAD). */
47
+ sendActivityStart(): void;
48
+ /** Signal user speaking ended (manual VAD). */
49
+ sendActivityEnd(): void;
50
+ /** Interrupt the model's current generation. */
51
+ interrupt(): void;
52
+ /** Close the connection. */
53
+ close(): Promise<void>;
54
+ }
55
+ /**
56
+ * Events emitted by the transport from the model.
57
+ * The Cortex listens to these and updates its state machine.
58
+ */
59
+ export interface TransportEvents {
60
+ /** Model is sending audio output. */
61
+ audio: (data: Buffer, sampleRate: number) => void;
62
+ /** Model is sending text output. */
63
+ text: (text: string, isFinal: boolean) => void;
64
+ /** Transcription available (input or output). */
65
+ transcript: (text: string, source: 'user' | 'model', isFinal: boolean) => void;
66
+ /** Model wants to call a tool/function. */
67
+ toolCall: (id: string, name: string, args: any) => void;
68
+ /** Model's current turn is complete. */
69
+ turnComplete: () => void;
70
+ /** Generation was complete (model done with all output). */
71
+ generationComplete: () => void;
72
+ /** Model was interrupted (by user speech or explicit interrupt). */
73
+ interrupted: () => void;
74
+ /** Model's thinking/reasoning trace. */
75
+ thought: (text: string) => void;
76
+ /** Session token usage update. */
77
+ usage: (totalTokens: number, inputTokens: number, outputTokens: number) => void;
78
+ /** Transport error. */
79
+ error: (err: Error) => void;
80
+ /** Connection closed. */
81
+ close: (reason?: string) => void;
82
+ /** Session can be resumed with this handle. */
83
+ resumeToken: (token: string) => void;
84
+ }
85
+ /** Factory interface that creates a transport from config. */
86
+ export interface CortexProvider {
87
+ readonly name: string;
88
+ connect(config: ProviderConfig, handlers: TransportEvents): Promise<CortexTransport>;
89
+ }
90
+ /** Configuration for automatic screen feed to the model. */
91
+ export interface ScreenFeedConfig {
92
+ /** Frames per second to send (max 1 for most models). Default: 1 */
93
+ fps?: number;
94
+ /** Region to capture. Default: full screen. */
95
+ region?: {
96
+ x: number;
97
+ y: number;
98
+ width: number;
99
+ height: number;
100
+ };
101
+ /** JPEG quality (1-100). Default: 60 */
102
+ quality?: number;
103
+ /** Scale factor (0-1). Default: 0.5 */
104
+ scale?: number;
105
+ }
106
+ /** Configuration for automatic audio feed to the model. */
107
+ export interface AudioFeedConfig {
108
+ /** 'system' = desktop audio (WASAPI), 'mic' = microphone input. */
109
+ source: 'system' | 'mic';
110
+ /** Target sample rate for model (usually 16000). Default: 16000 */
111
+ targetSampleRate?: number;
112
+ }
113
+ /** Full Cortex configuration. */
114
+ export interface CortexConfig {
115
+ /** The provider to use. */
116
+ provider: CortexProvider;
117
+ /** Provider connection config. */
118
+ connection: ProviderConfig;
119
+ /** Auto-start screen feed on connect. */
120
+ screenFeed?: ScreenFeedConfig | boolean;
121
+ /** Auto-start audio feed on connect. */
122
+ audioFeed?: AudioFeedConfig | boolean;
123
+ /** Auto-register all Stelo tools for the model. */
124
+ autoRegisterSteloTools?: boolean;
125
+ /** Custom tools to register. */
126
+ tools?: Array<ToolDefinition & {
127
+ handler: (...args: any[]) => any;
128
+ }>;
129
+ /** Use manual VAD instead of model's built-in. */
130
+ manualVAD?: boolean;
131
+ /** Max idle time before auto-disconnect (ms). 0 = never. */
132
+ idleTimeoutMs?: number;
133
+ /** Enable auto-reconnection on disconnect. */
134
+ autoReconnect?: boolean;
135
+ /** Session resume token from a previous session. */
136
+ resumeToken?: string;
137
+ }
138
+ /** All events the Cortex emits. */
139
+ export interface CortexEvents {
140
+ /** Conversation state changed. */
141
+ stateChange: (newState: ConversationState, oldState: ConversationState) => void;
142
+ /** Turn ownership changed. */
143
+ turnChange: (owner: TurnOwner) => void;
144
+ /** Model is speaking (audio chunks). */
145
+ modelAudio: (pcm: Buffer, sampleRate: number) => void;
146
+ /** Model text response (streaming). */
147
+ modelText: (text: string, isFinal: boolean) => void;
148
+ /** Transcript of speech (user or model). */
149
+ transcript: (text: string, source: 'user' | 'model', isFinal: boolean) => void;
150
+ /** Model's reasoning/thinking. */
151
+ thought: (text: string) => void;
152
+ /** A tool was called by the model. */
153
+ toolCall: (name: string, args: any, id: string) => void;
154
+ /** A tool call completed. */
155
+ toolResult: (name: string, result: any, durationMs: number) => void;
156
+ /** User interrupted the model. */
157
+ interrupted: () => void;
158
+ /** Session can be resumed with this token. */
159
+ resumeToken: (token: string) => void;
160
+ /** Token usage update. */
161
+ usage: (totalTokens: number, inputTokens: number, outputTokens: number) => void;
162
+ /** Error occurred. */
163
+ error: (err: Error) => void;
164
+ /** Connected to model. */
165
+ connected: () => void;
166
+ /** Disconnected from model. */
167
+ disconnected: (reason?: string) => void;
168
+ /** Screen frame sent to model. */
169
+ screenFrameSent: (bytesSent: number) => void;
170
+ /** Audio chunk sent to model. */
171
+ audioChunkSent: (durationMs: number) => void;
172
+ }
173
+ export declare class Cortex {
174
+ private config;
175
+ private transport;
176
+ private _state;
177
+ private _turn;
178
+ private _connected;
179
+ private listeners;
180
+ private tools;
181
+ private pendingToolCalls;
182
+ private screenFeedInterval;
183
+ private audioFeedInterval;
184
+ private _screenFeedActive;
185
+ private _audioFeedActive;
186
+ private idleTimer;
187
+ private lastActivityTime;
188
+ private _resumeToken;
189
+ private _totalTokensUsed;
190
+ private modelTextBuffer;
191
+ private userTranscriptBuffer;
192
+ /**
193
+ * Connect to a real-time AI model through a provider.
194
+ *
195
+ * @example
196
+ * ```typescript
197
+ * const cortex = new Cortex();
198
+ * await cortex.connect({
199
+ * provider: geminiLiveProvider(),
200
+ * connection: {
201
+ * apiKey: process.env.GEMINI_API_KEY!,
202
+ * model: 'gemini-3.1-flash-live-preview',
203
+ * systemInstruction: 'You are a desktop assistant. Use tools to interact with the computer.',
204
+ * responseModalities: ['audio'],
205
+ * voice: 'Kore',
206
+ * },
207
+ * screenFeed: { fps: 1, quality: 60, scale: 0.5 },
208
+ * audioFeed: { source: 'system' },
209
+ * autoRegisterSteloTools: true,
210
+ * });
211
+ * ```
212
+ */
213
+ connect(config: CortexConfig): Promise<void>;
214
+ /**
215
+ * Disconnect from the model and stop all feeds.
216
+ */
217
+ disconnect(): Promise<void>;
218
+ /**
219
+ * Say something to the model (text).
220
+ *
221
+ * @example
222
+ * ```typescript
223
+ * cortex.say("Click the Save button");
224
+ * cortex.say("What do you see on the screen?");
225
+ * ```
226
+ */
227
+ say(text: string): void;
228
+ /**
229
+ * Send raw audio to the model (PCM).
230
+ */
231
+ sendAudio(pcm: Buffer, sampleRate?: number): void;
232
+ /**
233
+ * Send a screenshot to the model right now.
234
+ *
235
+ * @example
236
+ * ```typescript
237
+ * cortex.sendScreenshot(); // sends current screen as JPEG
238
+ * ```
239
+ */
240
+ sendScreenshot(region?: {
241
+ x: number;
242
+ y: number;
243
+ width: number;
244
+ height: number;
245
+ }): void;
246
+ /**
247
+ * Send a system instruction mid-session.
248
+ */
249
+ instruct(text: string): void;
250
+ /**
251
+ * Interrupt the model's current output.
252
+ * Stops any audio/text generation in progress.
253
+ *
254
+ * @example
255
+ * ```typescript
256
+ * cortex.on('modelAudio', () => {
257
+ * if (userPressedStop) cortex.interrupt();
258
+ * });
259
+ * ```
260
+ */
261
+ interrupt(): void;
262
+ /**
263
+ * Signal that the user started speaking (manual VAD).
264
+ */
265
+ activityStart(): void;
266
+ /**
267
+ * Signal that the user stopped speaking (manual VAD).
268
+ */
269
+ activityEnd(): void;
270
+ /**
271
+ * Start streaming screen frames to the model.
272
+ * The model "sees" the screen in real-time.
273
+ *
274
+ * @example
275
+ * ```typescript
276
+ * cortex.startScreenFeed({ fps: 1, quality: 60 });
277
+ * // Model now receives a screenshot every second
278
+ * ```
279
+ */
280
+ startScreenFeed(config?: ScreenFeedConfig): void;
281
+ /**
282
+ * Stop the automatic screen feed.
283
+ */
284
+ stopScreenFeed(): void;
285
+ /**
286
+ * Start streaming audio to the model.
287
+ * Uses WASAPI loopback (system audio) or microphone.
288
+ *
289
+ * @example
290
+ * ```typescript
291
+ * cortex.startAudioFeed({ source: 'system', targetSampleRate: 16000 });
292
+ * // Model now hears everything playing on the desktop
293
+ * ```
294
+ */
295
+ startAudioFeed(config?: AudioFeedConfig): void;
296
+ /**
297
+ * Stop the automatic audio feed.
298
+ */
299
+ stopAudioFeed(): void;
300
+ /**
301
+ * Register a tool the model can call.
302
+ *
303
+ * @example
304
+ * ```typescript
305
+ * cortex.registerTool('get_weather', async (city: string) => {
306
+ * return { temp: 72, condition: 'sunny' };
307
+ * }, {
308
+ * name: 'get_weather',
309
+ * description: 'Get current weather for a city',
310
+ * parameters: { city: { type: 'string', description: 'City name', required: true } },
311
+ * });
312
+ * ```
313
+ */
314
+ registerTool(name: string, handler: (...args: any[]) => any, definition?: Partial<ToolDefinition>): void;
315
+ /**
316
+ * Auto-register Stelo SDK functions as model-callable tools.
317
+ * Gives the model hands to control the computer.
318
+ *
319
+ * @example
320
+ * ```typescript
321
+ * cortex.registerSteloTools();
322
+ * // Now the model can call: mouse_click, keyboard_type, screen_capture, etc.
323
+ * ```
324
+ */
325
+ registerSteloTools(): void;
326
+ /**
327
+ * Get all registered tool names.
328
+ */
329
+ get registeredTools(): string[];
330
+ /**
331
+ * Listen for Cortex events.
332
+ *
333
+ * @example
334
+ * ```typescript
335
+ * cortex.on('stateChange', (state, prev) => {
336
+ * console.log(`${prev} → ${state}`);
337
+ * });
338
+ *
339
+ * cortex.on('modelText', (text, isFinal) => {
340
+ * if (isFinal) console.log('Model said:', text);
341
+ * });
342
+ *
343
+ * cortex.on('toolCall', (name, args) => {
344
+ * console.log(`Model calling: ${name}(${JSON.stringify(args)})`);
345
+ * });
346
+ *
347
+ * cortex.on('transcript', (text, source, isFinal) => {
348
+ * if (source === 'user' && isFinal) console.log('User said:', text);
349
+ * });
350
+ * ```
351
+ */
352
+ on<K extends keyof CortexEvents>(event: K, handler: CortexEvents[K]): () => void;
353
+ /**
354
+ * Listen for an event once.
355
+ */
356
+ once<K extends keyof CortexEvents>(event: K, handler: CortexEvents[K]): () => void;
357
+ /**
358
+ * Wait for a specific event. Returns a promise that resolves with the event args.
359
+ *
360
+ * @example
361
+ * ```typescript
362
+ * cortex.say("What's on the screen?");
363
+ * const [text] = await cortex.waitFor('modelText', 10000);
364
+ * console.log('Model responded:', text);
365
+ * ```
366
+ */
367
+ waitFor<K extends keyof CortexEvents>(event: K, timeoutMs?: number): Promise<Parameters<CortexEvents[K]>>;
368
+ /** Current conversation state. */
369
+ get state(): ConversationState;
370
+ /** Who currently holds the conversational floor. */
371
+ get turn(): TurnOwner;
372
+ /** Whether connected to a model. */
373
+ get isConnected(): boolean;
374
+ /** Whether screen feed is active. */
375
+ get isScreenFeedActive(): boolean;
376
+ /** Whether audio feed is active. */
377
+ get isAudioFeedActive(): boolean;
378
+ /** Last session resume token for reconnection. */
379
+ get resumeToken(): string | null;
380
+ /** Total tokens consumed this session. */
381
+ get totalTokensUsed(): number;
382
+ /** Number of pending (in-flight) tool calls. */
383
+ get pendingToolCallCount(): number;
384
+ /**
385
+ * Send text and wait for the model's complete text response.
386
+ * This is the simplest way to have a conversation turn.
387
+ *
388
+ * @example
389
+ * ```typescript
390
+ * const response = await cortex.ask("What application is currently focused?");
391
+ * console.log(response); // "I can see that Notepad is currently focused..."
392
+ * ```
393
+ */
394
+ ask(text: string, timeoutMs?: number): Promise<string>;
395
+ /**
396
+ * Tell the model to perform an action and wait for tool execution to complete.
397
+ *
398
+ * @example
399
+ * ```typescript
400
+ * await cortex.command("Click on the Start menu");
401
+ * // Model calls mouse_click tool, Cortex executes it
402
+ * await cortex.command("Type 'notepad' and press Enter");
403
+ * // Model calls keyboard_type then keyboard_press
404
+ * ```
405
+ */
406
+ command(instruction: string, timeoutMs?: number): Promise<void>;
407
+ private handleModelAudio;
408
+ private handleModelText;
409
+ private handleTranscript;
410
+ private handleToolCall;
411
+ private handleTurnComplete;
412
+ private handleGenerationComplete;
413
+ private handleInterrupted;
414
+ private handleDisconnect;
415
+ private setState;
416
+ private setTurn;
417
+ private emit;
418
+ private ensureConnected;
419
+ private touchActivity;
420
+ private startIdleTimer;
421
+ private stopIdleTimer;
422
+ }
423
+ /**
424
+ * Create a Gemini Live API provider.
425
+ *
426
+ * @example
427
+ * ```typescript
428
+ * const cortex = new Cortex();
429
+ * await cortex.connect({
430
+ * provider: geminiLiveProvider(),
431
+ * connection: {
432
+ * apiKey: 'YOUR_API_KEY',
433
+ * model: 'gemini-3.1-flash-live-preview',
434
+ * responseModalities: ['audio'],
435
+ * voice: 'Kore',
436
+ * systemInstruction: 'You are a desktop assistant.',
437
+ * transcribeInput: true,
438
+ * transcribeOutput: true,
439
+ * providerOptions: {
440
+ * // Gemini-specific
441
+ * enableAffectiveDialog: true,
442
+ * proactiveAudio: true,
443
+ * thinkingLevel: 'low',
444
+ * contextWindowCompression: true,
445
+ * },
446
+ * },
447
+ * });
448
+ * ```
449
+ */
450
+ export declare function geminiLiveProvider(): CortexProvider;
451
+ /**
452
+ * Create an OpenAI Realtime API provider.
453
+ *
454
+ * @example
455
+ * ```typescript
456
+ * await cortex.connect({
457
+ * provider: openAIRealtimeProvider(),
458
+ * connection: {
459
+ * apiKey: 'YOUR_OPENAI_KEY',
460
+ * model: 'gpt-4o-realtime-preview',
461
+ * responseModalities: ['audio', 'text'],
462
+ * voice: 'alloy',
463
+ * },
464
+ * });
465
+ * ```
466
+ */
467
+ export declare function openAIRealtimeProvider(): CortexProvider;
468
+ /**
469
+ * Create a custom provider from a WebSocket URL and message adapters.
470
+ * Use this for xAI, Claude, local models, or any other real-time API.
471
+ *
472
+ * @example
473
+ * ```typescript
474
+ * const myProvider = customProvider({
475
+ * name: 'my-model',
476
+ * buildUrl: (config) => `wss://my-api.com/v1/realtime?key=${config.apiKey}`,
477
+ * buildSetupMessage: (config) => ({ type: 'session.init', model: config.model }),
478
+ * parseMessage: (raw) => {
479
+ * const msg = JSON.parse(raw);
480
+ * if (msg.type === 'audio') return { kind: 'audio', data: Buffer.from(msg.data, 'base64'), sampleRate: 24000 };
481
+ * if (msg.type === 'text') return { kind: 'text', text: msg.content, isFinal: msg.done };
482
+ * if (msg.type === 'tool') return { kind: 'toolCall', id: msg.id, name: msg.name, args: msg.args };
483
+ * return null;
484
+ * },
485
+ * formatAudio: (pcm, rate) => JSON.stringify({ type: 'audio', data: pcm.toString('base64'), rate }),
486
+ * formatText: (text, role) => JSON.stringify({ type: 'text', content: text, role }),
487
+ * formatToolResponse: (id, result) => JSON.stringify({ type: 'tool_result', id, result }),
488
+ * });
489
+ * ```
490
+ */
491
+ export interface CustomProviderConfig {
492
+ name: string;
493
+ buildUrl: (config: ProviderConfig) => string;
494
+ buildSetupMessage?: (config: ProviderConfig) => any;
495
+ buildHeaders?: (config: ProviderConfig) => Record<string, string>;
496
+ parseMessage: (raw: string) => ParsedMessage | null;
497
+ formatAudio: (pcm: Buffer, sampleRate: number) => string;
498
+ formatText: (text: string, role?: string) => string;
499
+ formatVideo?: (jpeg: Buffer) => string;
500
+ formatToolResponse: (callId: string, result: any, scheduling?: string) => string;
501
+ formatInterrupt?: () => string;
502
+ formatActivityStart?: () => string;
503
+ formatActivityEnd?: () => string;
504
+ }
505
+ export type ParsedMessage = {
506
+ kind: 'audio';
507
+ data: Buffer;
508
+ sampleRate: number;
509
+ } | {
510
+ kind: 'text';
511
+ text: string;
512
+ isFinal: boolean;
513
+ } | {
514
+ kind: 'transcript';
515
+ text: string;
516
+ source: 'user' | 'model';
517
+ isFinal: boolean;
518
+ } | {
519
+ kind: 'toolCall';
520
+ id: string;
521
+ name: string;
522
+ args: any;
523
+ } | {
524
+ kind: 'turnComplete';
525
+ } | {
526
+ kind: 'interrupted';
527
+ } | {
528
+ kind: 'thought';
529
+ text: string;
530
+ } | {
531
+ kind: 'usage';
532
+ total: number;
533
+ input: number;
534
+ output: number;
535
+ } | {
536
+ kind: 'error';
537
+ message: string;
538
+ } | {
539
+ kind: 'close';
540
+ reason?: string;
541
+ } | {
542
+ kind: 'resumeToken';
543
+ token: string;
544
+ };
545
+ export declare function customProvider(custom: CustomProviderConfig): CortexProvider;
546
+ /** Create a new Cortex instance. */
547
+ export declare function createCortex(): Cortex;
548
+ //# sourceMappingURL=cortex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cortex.d.ts","sourceRoot":"","sources":["../ts/cortex.ts"],"names":[],"mappings":"AA0BA,yCAAyC;AACzC,MAAM,MAAM,iBAAiB,GACzB,cAAc,GACd,MAAM,GACN,WAAW,GACX,UAAU,GACV,UAAU,GACV,QAAQ,GACR,aAAa,CAAC;AAElB,gEAAgE;AAChE,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MA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