@intelliweave/embedded 2.0.72-beta.7 → 2.0.72-beta.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.
@@ -123,6 +123,8 @@ interface TokenWindowGroupItem<DataType> {
123
123
  /** Total token usage */
124
124
  totalTokens: number;
125
125
  };
126
+ /** True if this item is still being streamed */
127
+ streamingInProgress?: boolean;
126
128
  }
127
129
  /** A section of a message returned by the AI */
128
130
  interface TokenWindowGroupItemSection {
@@ -179,6 +181,17 @@ declare class MCPKnowledgeClient {
179
181
  searchToolName?: string;
180
182
  /** Keep search function available for the AI to use. */
181
183
  searchToolVisible?: boolean;
184
+ /** Use the IntelliWeave proxy */
185
+ proxy?: {
186
+ /** If true, will send requests via the IntelliWeave MCP proxy */
187
+ enabled?: boolean;
188
+ /** The URL of the proxy server, defaults to the standard IntelliWeave proxy */
189
+ url?: string;
190
+ /** IntelliWeave API key */
191
+ apiKey?: string;
192
+ };
193
+ /** Pass extra headers to the MCP server */
194
+ headers?: Record<string, string>;
182
195
  };
183
196
  /** Constructor */
184
197
  constructor(config: MCPKnowledgeClient['config']);
@@ -189,16 +202,10 @@ declare class MCPKnowledgeClient {
189
202
  method: string;
190
203
  params?: {
191
204
  [x: string]: unknown;
192
- task?: {
193
- [x: string]: unknown;
194
- ttl?: number | null | undefined;
195
- pollInterval?: number | undefined;
196
- } | undefined;
197
205
  _meta?: {
198
206
  [x: string]: unknown;
199
207
  progressToken?: string | number | undefined;
200
208
  "io.modelcontextprotocol/related-task"?: {
201
- [x: string]: unknown;
202
209
  taskId: string;
203
210
  } | undefined;
204
211
  } | undefined;
@@ -209,8 +216,8 @@ declare class MCPKnowledgeClient {
209
216
  [x: string]: unknown;
210
217
  _meta?: {
211
218
  [x: string]: unknown;
219
+ progressToken?: string | number | undefined;
212
220
  "io.modelcontextprotocol/related-task"?: {
213
- [x: string]: unknown;
214
221
  taskId: string;
215
222
  } | undefined;
216
223
  } | undefined;
@@ -219,8 +226,8 @@ declare class MCPKnowledgeClient {
219
226
  [x: string]: unknown;
220
227
  _meta?: {
221
228
  [x: string]: unknown;
229
+ progressToken?: string | number | undefined;
222
230
  "io.modelcontextprotocol/related-task"?: {
223
- [x: string]: unknown;
224
231
  taskId: string;
225
232
  } | undefined;
226
233
  } | undefined;
@@ -229,16 +236,10 @@ declare class MCPKnowledgeClient {
229
236
  method: string;
230
237
  params?: {
231
238
  [x: string]: unknown;
232
- task?: {
233
- [x: string]: unknown;
234
- ttl?: number | null | undefined;
235
- pollInterval?: number | undefined;
236
- } | undefined;
237
239
  _meta?: {
238
240
  [x: string]: unknown;
239
241
  progressToken?: string | number | undefined;
240
242
  "io.modelcontextprotocol/related-task"?: {
241
- [x: string]: unknown;
242
243
  taskId: string;
243
244
  } | undefined;
244
245
  } | undefined;
@@ -249,8 +250,8 @@ declare class MCPKnowledgeClient {
249
250
  [x: string]: unknown;
250
251
  _meta?: {
251
252
  [x: string]: unknown;
253
+ progressToken?: string | number | undefined;
252
254
  "io.modelcontextprotocol/related-task"?: {
253
- [x: string]: unknown;
254
255
  taskId: string;
255
256
  } | undefined;
256
257
  } | undefined;
@@ -259,8 +260,8 @@ declare class MCPKnowledgeClient {
259
260
  [x: string]: unknown;
260
261
  _meta?: {
261
262
  [x: string]: unknown;
263
+ progressToken?: string | number | undefined;
262
264
  "io.modelcontextprotocol/related-task"?: {
263
- [x: string]: unknown;
264
265
  taskId: string;
265
266
  } | undefined;
266
267
  } | undefined;
@@ -1031,10 +1032,16 @@ declare class IntelliWeave extends EventTarget {
1031
1032
  declare class WebWeaverSpeechOutput extends EventTarget {
1032
1033
  /** Reference to the AI */
1033
1034
  private ai?;
1035
+ /** Automatically speak output from the AI */
1036
+ autoSpeak: boolean;
1037
+ /** If enabled, connections will be pre-emptively opened to speed up text-to-speech response times, if possible */
1038
+ preemptiveConnection: boolean;
1034
1039
  /** Constructor */
1035
1040
  constructor(ai: IntelliWeave);
1036
- /** Called when the AI speaks */
1037
- onTextOutputFromAI(e: CustomEvent): void;
1041
+ /** Message IDs we've processed */
1042
+ private processedMessages;
1043
+ /** Called when the AI responds */
1044
+ onOutputFromAI(e: CustomEvent): void;
1038
1045
  /** Current player vars */
1039
1046
  private currentPlayerVolume?;
1040
1047
  private currentPlayer?;
@@ -1046,8 +1053,15 @@ declare class WebWeaverSpeechOutput extends EventTarget {
1046
1053
  private maxVolumeHeard;
1047
1054
  /** Get current (realtime) audio output volume level, from 0 to 1 */
1048
1055
  get volumeLevel(): number;
1056
+ /** Queued messages to speak next */
1057
+ private _queuedText;
1049
1058
  /** Speak the text */
1050
1059
  speak(text: string): Promise<void>;
1060
+ private _queueActive;
1061
+ _runQueue(): Promise<void>;
1062
+ /** ElevenLabs connection pre-cache */
1063
+ private _elevenLabsPrecachedConnection?;
1064
+ private _getElevenLabsConnection;
1051
1065
  private _speakWithLock;
1052
1066
  /** True if currently playing audio */
1053
1067
  get isSpeaking(): boolean;
@@ -1317,6 +1331,20 @@ declare class PCMPlayerNode extends AudioWorkletNode {
1317
1331
  stop(): void;
1318
1332
  }
1319
1333
 
1334
+ /** Return value of createElevenLabsTextToSpeechStream() */
1335
+ interface ElevenLabsTextToSpeechStream {
1336
+ /** Audio data output stream */
1337
+ stream: ReadableStream<Uint8Array>;
1338
+ /** Function to send text to be spoken */
1339
+ sendText: (text: string) => void;
1340
+ /** Function to signal there will be no more text */
1341
+ endText: () => void;
1342
+ /** True if this connection is closed */
1343
+ isClosed?: boolean;
1344
+ }
1345
+ /** This creates a two-way connection to ElevenLabs that allows for realtime text upload and realtime speech download. */
1346
+ declare function createElevenLabsTextToSpeechStream(apiKey: string, voiceID: string, format?: string): ElevenLabsTextToSpeechStream;
1347
+
1320
1348
  /**
1321
1349
  * This is a utility class for dealing with the ONNX runtime and model loading.
1322
1350
  */
@@ -1918,7 +1946,7 @@ declare class AnthropicChat extends ChatBase<DataType> {
1918
1946
  /** Send a message, and get the response string. */
1919
1947
  sendMessage(message: string, onPartial?: (items: TokenWindowGroupItemParams<DataType>[]) => void): Promise<TokenWindowGroupItemParams<any>[]>;
1920
1948
  /** Parse a message block into our format */
1921
- protected parseMessageBlock(message: Anthropic.Messages.Message): TokenWindowGroupItemParams<DataType>;
1949
+ protected parseMessageBlock(message: Anthropic.Messages.Message, isPartial: boolean): TokenWindowGroupItemParams<DataType>;
1922
1950
  /** Trim message list */
1923
1951
  trimMessages(): Promise<void>;
1924
1952
  }
@@ -2177,4 +2205,4 @@ declare function useIntelliWeave(): IntelliWeave | undefined;
2177
2205
  /** React hook to add an external KB search hook. This can provide static KB entries, or perform an async search and return dynamic entries. */
2178
2206
  declare function useIntelliWeaveKnowledge(query: KnowledgeBaseSource['query'], dependencies?: any[]): void;
2179
2207
 
2180
- export { AILogic, AnthropicChat, AudioSystem, type BaseStatisticsEvent, type BufferType, BufferedWebSocket, type BuiltInActionFlags, ChatBase, type ChatBaseConfig, type ChatBaseToolConfig, ChatGPT, FixedBufferStream, type InputStatisticsEvent, IntelliWeave, type IntelliWeaveGlobalConfig, type IntelliWeaveInstructConfig, IntelliWeaveMessageParser, type IntelliWeaveParameterDefinition, IntelliWeaveProvider, IntelliWeaveTranscriptionNode, KnowledgeBase, type KnowledgeBaseActionParameterSchema, type KnowledgeBaseItem, type KnowledgeBaseItemAttachment, type KnowledgeBaseSearchEvent, type KnowledgeBaseSource, type KnowledgeBaseWebhookActionResponse, type KnowledgeBaseWebhookRequest, type KnowledgeBaseWebhookSearchResponse, type KnowledgeFetcher, Logging, MCPKnowledgeClient, type MessageReceiveEvent, type MessageSendEvent, ONNXModel, type ONNXTensors, OpenAITranscriptionNode, PCMPlayerNode, PCMReceiverNode, Resampler, type SessionStartEvent, type StatisticsEvent, type StatisticsEventType, type SubAgentConfig, SubAgents, type SupportedArrayBuffers, TokenWindow, TokenWindowGroup, type TokenWindowGroupItem, type TokenWindowGroupItemParams, type TokenWindowGroupItemSection, TokenWindowGroupItemSectionType, type ToolCallEvent, type UICloseEvent, type UIOpenEvent, VoiceChunkOutputNode, VoiceDetectionNode, type VoiceEndEvent, type VoiceStartEvent, type VoiceSubmitEvent, WebWeaverEmbed, type WebWeaverGPTConfig, WebWeaverSpeechOutput, WebWeaverSpeechRecognition, WebWeaverUI, audioToWav, convertParamsToJSONSchema, floatTo16BitPCM, floatTo64BitPCM, getDefaultUserID, int16ToFloat32BitPCM, intelliweaveConfig, intelliweaveGlobalThis, sseEvents, track, trimWhitespaceInText, useIntelliWeave, useIntelliWeaveKnowledge };
2208
+ export { AILogic, AnthropicChat, AudioSystem, type BaseStatisticsEvent, type BufferType, BufferedWebSocket, type BuiltInActionFlags, ChatBase, type ChatBaseConfig, type ChatBaseToolConfig, ChatGPT, type ElevenLabsTextToSpeechStream, FixedBufferStream, type InputStatisticsEvent, IntelliWeave, type IntelliWeaveGlobalConfig, type IntelliWeaveInstructConfig, IntelliWeaveMessageParser, type IntelliWeaveParameterDefinition, IntelliWeaveProvider, IntelliWeaveTranscriptionNode, KnowledgeBase, type KnowledgeBaseActionParameterSchema, type KnowledgeBaseItem, type KnowledgeBaseItemAttachment, type KnowledgeBaseSearchEvent, type KnowledgeBaseSource, type KnowledgeBaseWebhookActionResponse, type KnowledgeBaseWebhookRequest, type KnowledgeBaseWebhookSearchResponse, type KnowledgeFetcher, Logging, MCPKnowledgeClient, type MessageReceiveEvent, type MessageSendEvent, ONNXModel, type ONNXTensors, OpenAITranscriptionNode, PCMPlayerNode, PCMReceiverNode, Resampler, type SessionStartEvent, type StatisticsEvent, type StatisticsEventType, type SubAgentConfig, SubAgents, type SupportedArrayBuffers, TokenWindow, TokenWindowGroup, type TokenWindowGroupItem, type TokenWindowGroupItemParams, type TokenWindowGroupItemSection, TokenWindowGroupItemSectionType, type ToolCallEvent, type UICloseEvent, type UIOpenEvent, VoiceChunkOutputNode, VoiceDetectionNode, type VoiceEndEvent, type VoiceStartEvent, type VoiceSubmitEvent, WebWeaverEmbed, type WebWeaverGPTConfig, WebWeaverSpeechOutput, WebWeaverSpeechRecognition, WebWeaverUI, audioToWav, convertParamsToJSONSchema, createElevenLabsTextToSpeechStream, floatTo16BitPCM, floatTo64BitPCM, getDefaultUserID, int16ToFloat32BitPCM, intelliweaveConfig, intelliweaveGlobalThis, sseEvents, track, trimWhitespaceInText, useIntelliWeave, useIntelliWeaveKnowledge };