@illalabs/sdk 0.4.0-canary.56299752 → 0.4.0-canary.842eb5db
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/README.md +68 -9
- package/dist/src/chat/Chat.d.ts +31 -2
- package/dist/src/chat/Chat.d.ts.map +1 -1
- package/dist/src/chat/Chat.js +87 -28
- package/dist/src/chat/Chat.js.map +1 -1
- package/dist/src/context/ContextManager.js +1 -1
- package/dist/src/context/ContextManager.js.map +1 -1
- package/dist/src/interfaces/chat.interface.d.ts +52 -1
- package/dist/src/interfaces/chat.interface.d.ts.map +1 -1
- package/dist/src/interfaces/coreApiProvider.interface.d.ts +13 -1
- package/dist/src/interfaces/coreApiProvider.interface.d.ts.map +1 -1
- package/dist/src/interfaces/index.d.ts +1 -1
- package/dist/src/interfaces/index.d.ts.map +1 -1
- package/dist/src/internal.d.ts +1 -0
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +1 -0
- package/dist/src/internal.js.map +1 -1
- package/dist/src/prompt/Prompt.d.ts +2 -10
- package/dist/src/prompt/Prompt.d.ts.map +1 -1
- package/dist/src/prompt/Prompt.js +9 -22
- package/dist/src/prompt/Prompt.js.map +1 -1
- package/dist/src/prompt/index.d.ts +1 -1
- package/dist/src/prompt/index.d.ts.map +1 -1
- package/dist/src/prompt/types.d.ts +7 -9
- package/dist/src/prompt/types.d.ts.map +1 -1
- package/dist/src/prompt/utils/cloneToolResult.d.ts +6 -6
- package/dist/src/prompt/utils/cloneToolResult.d.ts.map +1 -1
- package/dist/src/prompt/utils/cloneToolResult.js +11 -16
- package/dist/src/prompt/utils/cloneToolResult.js.map +1 -1
- package/dist/src/prompt/utils/index.d.ts +1 -3
- package/dist/src/prompt/utils/index.d.ts.map +1 -1
- package/dist/src/prompt/utils/index.js +1 -3
- package/dist/src/prompt/utils/index.js.map +1 -1
- package/dist/src/providers/coreApiProvider/CoreApiProvider.d.ts +40 -1
- package/dist/src/providers/coreApiProvider/CoreApiProvider.d.ts.map +1 -1
- package/dist/src/providers/coreApiProvider/CoreApiProvider.js +124 -2
- package/dist/src/providers/coreApiProvider/CoreApiProvider.js.map +1 -1
- package/dist/src/providers/coreApiProvider/index.d.ts +1 -1
- package/dist/src/providers/coreApiProvider/index.d.ts.map +1 -1
- package/dist/src/providers/coreApiProvider/types.d.ts +44 -0
- package/dist/src/providers/coreApiProvider/types.d.ts.map +1 -1
- package/dist/src/sdk.d.ts +102 -28
- package/dist/src/sdk.d.ts.map +1 -1
- package/dist/src/sdk.js +90 -23
- package/dist/src/sdk.js.map +1 -1
- package/dist/src/streaming/errors/SSEParse.d.ts +15 -0
- package/dist/src/streaming/errors/SSEParse.d.ts.map +1 -0
- package/dist/src/streaming/errors/SSEParse.js +23 -0
- package/dist/src/streaming/errors/SSEParse.js.map +1 -0
- package/dist/src/streaming/errors/StreamingHttpError.d.ts +18 -0
- package/dist/src/streaming/errors/StreamingHttpError.d.ts.map +1 -0
- package/dist/src/streaming/errors/StreamingHttpError.js +27 -0
- package/dist/src/streaming/errors/StreamingHttpError.js.map +1 -0
- package/dist/src/streaming/errors/StreamingResponseBodyNull.d.ts +13 -0
- package/dist/src/streaming/errors/StreamingResponseBodyNull.d.ts.map +1 -0
- package/dist/src/streaming/errors/StreamingResponseBodyNull.js +21 -0
- package/dist/src/streaming/errors/StreamingResponseBodyNull.js.map +1 -0
- package/dist/src/streaming/errors/StreamingServerError.d.ts +23 -0
- package/dist/src/streaming/errors/StreamingServerError.d.ts.map +1 -0
- package/dist/src/streaming/errors/StreamingServerError.js +33 -0
- package/dist/src/streaming/errors/StreamingServerError.js.map +1 -0
- package/dist/src/streaming/errors/index.d.ts +5 -0
- package/dist/src/streaming/errors/index.d.ts.map +1 -0
- package/dist/src/streaming/errors/index.js +5 -0
- package/dist/src/streaming/errors/index.js.map +1 -0
- package/dist/src/streaming/index.d.ts +4 -0
- package/dist/src/streaming/index.d.ts.map +1 -0
- package/dist/src/streaming/index.js +3 -0
- package/dist/src/streaming/index.js.map +1 -0
- package/dist/src/streaming/parseSSE.d.ts +23 -0
- package/dist/src/streaming/parseSSE.d.ts.map +1 -0
- package/dist/src/streaming/parseSSE.js +152 -0
- package/dist/src/streaming/parseSSE.js.map +1 -0
- package/dist/src/streaming/types.d.ts +6 -0
- package/dist/src/streaming/types.d.ts.map +1 -0
- package/dist/src/streaming/types.js +6 -0
- package/dist/src/streaming/types.js.map +1 -0
- package/dist/src/telemetry/TelemetryClient.d.ts +140 -0
- package/dist/src/telemetry/TelemetryClient.d.ts.map +1 -0
- package/dist/src/telemetry/TelemetryClient.js +225 -0
- package/dist/src/telemetry/TelemetryClient.js.map +1 -0
- package/dist/src/telemetry/index.d.ts +2 -0
- package/dist/src/telemetry/index.d.ts.map +1 -0
- package/dist/src/telemetry/index.js +2 -0
- package/dist/src/telemetry/index.js.map +1 -0
- package/package.json +3 -5
- package/dist/src/prompt/utils/normalizeTextPrompt.d.ts +0 -14
- package/dist/src/prompt/utils/normalizeTextPrompt.d.ts.map +0 -1
- package/dist/src/prompt/utils/normalizeTextPrompt.js +0 -22
- package/dist/src/prompt/utils/normalizeTextPrompt.js.map +0 -1
- package/dist/src/prompt/utils/normalizeToolResult.d.ts +0 -14
- package/dist/src/prompt/utils/normalizeToolResult.d.ts.map +0 -1
- package/dist/src/prompt/utils/normalizeToolResult.js +0 -27
- package/dist/src/prompt/utils/normalizeToolResult.js.map +0 -1
package/dist/src/sdk.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CoreApiChatErrorResponse, MessageHistoryType, ModelContext, PendingToolCallType, PersonalityContext,
|
|
2
|
-
import type { AsyncCheckerEvents, AsyncToolCheckerCheckParams, AwaitableActionDescriptor, AwaitActionResult, CacheEntryOptions, ChatContextSnapshot, ContextManagerOptions, CoreApiProviderConfig, CoreApiProviderRoutes, EventSubscription, HttpClientFactory, ICache, IContextManager, PollingConfig, SendMessageResult } from "./internal.js";
|
|
1
|
+
import type { CoreApiChatErrorResponse, IllaToolErrorJSON, IllaToolOutcomeJSON, MessageHistoryType, ModelContext, PendingToolCallType, PersonalityContext, UserContext } from "@illalabs/interfaces";
|
|
2
|
+
import type { AsyncCheckerEvents, AsyncToolCheckerCheckParams, AwaitableActionDescriptor, AwaitActionResult, CacheEntryOptions, ChatContextSnapshot, ContextManagerOptions, CoreApiProviderConfig, CoreApiProviderRoutes, EventSubscription, HttpClientFactory, ICache, IContextManager, PollingConfig, SendMessageResult, SendMessageStreamingOptions } from "./internal.js";
|
|
3
3
|
import { Chat, ContextManager, Prompt } from "./internal.js";
|
|
4
4
|
/**
|
|
5
5
|
* Configuration options for initializing the IllaSDK.
|
|
@@ -63,17 +63,27 @@ type SendMessageContext = {
|
|
|
63
63
|
chatId?: never;
|
|
64
64
|
userContext: UserContext;
|
|
65
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* Options for sending a message via the SDK.
|
|
68
|
+
*
|
|
69
|
+
* @property signal - Abort signal used to cancel the request
|
|
70
|
+
* @property onRequestId - Callback invoked with the requestId after the request is initiated,
|
|
71
|
+
* enabling real-time telemetry streaming
|
|
72
|
+
*/
|
|
73
|
+
type SdkSendMessageOptions = {
|
|
74
|
+
signal?: AbortSignal;
|
|
75
|
+
onRequestId?: (requestId: string) => void;
|
|
76
|
+
};
|
|
66
77
|
/**
|
|
67
78
|
* Metadata extracted from a SendMessageResult response.
|
|
68
|
-
* Provides detailed information about the response including errors, pending tools, and
|
|
79
|
+
* Provides detailed information about the response including errors, pending tools, and tool errors.
|
|
69
80
|
*/
|
|
70
81
|
type ResponseMetadata = {
|
|
71
82
|
isError: boolean;
|
|
72
83
|
text?: string;
|
|
73
84
|
messages?: MessageHistoryType;
|
|
74
85
|
pendingTools?: ReadonlyArray<PendingToolCallType>;
|
|
75
|
-
|
|
76
|
-
toolErrors?: ReadonlyArray<ToolErrorPartType>;
|
|
86
|
+
toolErrors?: ReadonlyArray<IllaToolErrorJSON>;
|
|
77
87
|
error?: CoreApiChatErrorResponse;
|
|
78
88
|
};
|
|
79
89
|
/**
|
|
@@ -241,9 +251,57 @@ declare class IllaSDK {
|
|
|
241
251
|
* if (result2.response.pendingTools && result2.response.pendingTools.length > 0) {
|
|
242
252
|
* console.log("Tool to execute:", result2.response.pendingTools[0]);
|
|
243
253
|
* }
|
|
254
|
+
*
|
|
255
|
+
* // With telemetry callback for real-time events
|
|
256
|
+
* const result3 = await sdk.sendMessage(
|
|
257
|
+
* "Show me my balance",
|
|
258
|
+
* { chatId: result1.chatId },
|
|
259
|
+
* undefined,
|
|
260
|
+
* {
|
|
261
|
+
* onRequestId: (requestId) => {
|
|
262
|
+
* // Connect to telemetry stream
|
|
263
|
+
* telemetryClient.connect(requestId);
|
|
264
|
+
* }
|
|
265
|
+
* }
|
|
266
|
+
* );
|
|
244
267
|
* ```
|
|
245
268
|
*/
|
|
246
|
-
sendMessage(msg: string | Prompt, context: SendMessageContext, chatOptions?: Omit<ChatOptions, "userContext"
|
|
269
|
+
sendMessage(msg: string | Prompt, context: SendMessageContext, chatOptions?: Omit<ChatOptions, "userContext">, options?: SdkSendMessageOptions): Promise<SendMessageResult>;
|
|
270
|
+
/**
|
|
271
|
+
* Sends a message with streaming response via SSE.
|
|
272
|
+
*
|
|
273
|
+
* Instead of waiting for the full response, this method streams telemetry events
|
|
274
|
+
* in real-time as they occur during orchestration. The final result is delivered
|
|
275
|
+
* through the `onComplete` callback.
|
|
276
|
+
*
|
|
277
|
+
* This eliminates the need for a separate telemetry subscription - events and
|
|
278
|
+
* the result are delivered through a single HTTP connection.
|
|
279
|
+
*
|
|
280
|
+
* @param msg - The message to send (can be a string or Prompt object)
|
|
281
|
+
* @param context - Context containing either chatId for existing chat or userContext for new chat
|
|
282
|
+
* @param options - Streaming options with event callbacks
|
|
283
|
+
* @param chatOptions - Optional chat configuration when creating a new chat
|
|
284
|
+
* @returns {Promise<void>} A promise that resolves when the stream ends
|
|
285
|
+
*
|
|
286
|
+
* @example
|
|
287
|
+
* ```typescript
|
|
288
|
+
* const sdk = new IllaSDK({ apiKey: 'your-api-key' });
|
|
289
|
+
*
|
|
290
|
+
* await sdk.sendMessageStreaming(
|
|
291
|
+
* "What can you help me with?",
|
|
292
|
+
* { userContext: { address: "0x1234..." } },
|
|
293
|
+
* {
|
|
294
|
+
* onEvent: (event) => console.log('Event:', event.type),
|
|
295
|
+
* onComplete: (result) => {
|
|
296
|
+
* console.log('Response:', result.text);
|
|
297
|
+
* console.log('Pending tools:', result.pendingTools?.length ?? 0);
|
|
298
|
+
* },
|
|
299
|
+
* onError: (error) => console.error('Error:', error),
|
|
300
|
+
* }
|
|
301
|
+
* );
|
|
302
|
+
* ```
|
|
303
|
+
*/
|
|
304
|
+
sendMessageStreaming(msg: string | Prompt, context: SendMessageContext, options?: SendMessageStreamingOptions, chatOptions?: Omit<ChatOptions, "userContext">): Promise<void>;
|
|
247
305
|
/**
|
|
248
306
|
* Gets an existing chat or creates a new one if it doesn't exist.
|
|
249
307
|
*
|
|
@@ -263,6 +321,8 @@ declare class IllaSDK {
|
|
|
263
321
|
*
|
|
264
322
|
* @example
|
|
265
323
|
* ```typescript
|
|
324
|
+
* import { IllaToolOutcome, IllaToolError } from '@illalabs/interfaces';
|
|
325
|
+
*
|
|
266
326
|
* const sdk = new IllaSDK({ apiKey: 'your-api-key' });
|
|
267
327
|
*
|
|
268
328
|
* // Start a conversation that will request a tool execution
|
|
@@ -275,23 +335,26 @@ declare class IllaSDK {
|
|
|
275
335
|
* if (result1.response.pendingTools && result1.response.pendingTools.length > 0) {
|
|
276
336
|
* const tool = result1.response.pendingTools[0];
|
|
277
337
|
*
|
|
278
|
-
* // Execute the tool
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
*
|
|
338
|
+
* // Execute the tool and create the outcome
|
|
339
|
+
* let toolResult: IllaToolOutcome<unknown>;
|
|
340
|
+
* try {
|
|
341
|
+
* const executionResult = await executeTool(tool);
|
|
342
|
+
* toolResult = IllaToolOutcome.success(tool.toolCallId, tool.toolName, executionResult);
|
|
343
|
+
* } catch (error) {
|
|
344
|
+
* toolResult = IllaToolOutcome.error(
|
|
345
|
+
* tool.toolCallId,
|
|
346
|
+
* tool.toolName,
|
|
347
|
+
* IllaToolError.execution(tool.toolCallId, tool.toolName, error.message)
|
|
348
|
+
* );
|
|
349
|
+
* }
|
|
350
|
+
*
|
|
351
|
+
* // Send the result back to ILLA
|
|
352
|
+
* const result2 = await sdk.sendToolResult(result1.chatId, toolResult.toJSON());
|
|
290
353
|
* console.log(result2.response.text); // ILLA's response after processing the tool result
|
|
291
354
|
* }
|
|
292
355
|
* ```
|
|
293
356
|
*/
|
|
294
|
-
sendToolResult(chatId: string, toolResult:
|
|
357
|
+
sendToolResult(chatId: string, toolResult: IllaToolOutcomeJSON): Promise<SendMessageResult>;
|
|
295
358
|
/**
|
|
296
359
|
* Gets the messages for a given chat ID.
|
|
297
360
|
*
|
|
@@ -362,19 +425,28 @@ declare class IllaSDK {
|
|
|
362
425
|
*
|
|
363
426
|
* @example
|
|
364
427
|
* ```typescript
|
|
428
|
+
* import { IllaToolOutcome, IllaToolError } from '@illalabs/interfaces';
|
|
429
|
+
*
|
|
365
430
|
* const sdk = new IllaSDK({ apiKey: 'your-api-key' });
|
|
366
431
|
*
|
|
367
432
|
* // Execute multiple tools and send results together
|
|
368
|
-
* const toolResults
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
*
|
|
433
|
+
* const toolResults = pendingTools.map(tool => {
|
|
434
|
+
* try {
|
|
435
|
+
* const result = executeToolSync(tool);
|
|
436
|
+
* return IllaToolOutcome.success(tool.toolCallId, tool.toolName, result);
|
|
437
|
+
* } catch (error) {
|
|
438
|
+
* return IllaToolOutcome.error(
|
|
439
|
+
* tool.toolCallId,
|
|
440
|
+
* tool.toolName,
|
|
441
|
+
* IllaToolError.execution(tool.toolCallId, tool.toolName, error.message)
|
|
442
|
+
* );
|
|
443
|
+
* }
|
|
444
|
+
* });
|
|
373
445
|
*
|
|
374
|
-
* const response = await sdk.sendToolResults(chatId, toolResults);
|
|
446
|
+
* const response = await sdk.sendToolResults(chatId, toolResults.map(r => r.toJSON()));
|
|
375
447
|
* ```
|
|
376
448
|
*/
|
|
377
|
-
sendToolResults(chatId: string, toolResults:
|
|
449
|
+
sendToolResults(chatId: string, toolResults: IllaToolOutcomeJSON[]): Promise<SendMessageResult>;
|
|
378
450
|
/**
|
|
379
451
|
* Subscribes to status updates for a long-running tool execution.
|
|
380
452
|
*
|
|
@@ -497,6 +569,8 @@ export { ContextManager } from "./context/index.js";
|
|
|
497
569
|
export { AsyncToolChecker } from "./asyncToolChecker/index.js";
|
|
498
570
|
export { CoreApiProvider } from "./providers/index.js";
|
|
499
571
|
export { UserContextMissing } from "./chat/errors/index.js";
|
|
500
|
-
export
|
|
501
|
-
export
|
|
572
|
+
export { TelemetryClient, TelemetryStreamFailed, type TelemetryClientConfig, type TelemetryStreamState, } from "./telemetry/index.js";
|
|
573
|
+
export { parseSSEStream, SSEParse, StreamingHttpError, StreamingResponseBodyNull, StreamingServerError, type ErrorStreamEvent, type ResultStreamEvent, type SSEStreamEndEvent, type SSEStreamEvent, type StreamEventType, type TelemetryStreamEvent, } from "./streaming/index.js";
|
|
574
|
+
export type { illaSDKConfig, illaSDKOptions, ChatOptions, ChatContextSnapshot, CacheEntryOptions, ICache, IContextManager, SendMessageContext, SendMessageResult, SendMessageStreamingOptions, SdkSendMessageOptions, ResponseMetadata, AsyncCheckerEvents, AsyncToolCheckerCheckParams, AwaitableActionDescriptor, AwaitActionResult, CoreApiProviderConfig, CoreApiProviderRoutes, EventSubscription, HttpClientFactory, PollingConfig, ContextManagerOptions, };
|
|
575
|
+
export type { MessageHistoryType, IllaToolOutcomeJSON, IllaToolErrorJSON, UserContext, ModelContext, PersonalityContext, CoreApiChatErrorResponse, CoreApiChatSuccessResponse, PendingToolCallType, TelemetryEvent, TelemetryEventType, OrchestratorPhase, OrchestratorObserver, BaseTelemetryEvent, ToolResultStatus, TelemetryEnabledResponse, } from "@illalabs/interfaces";
|
|
502
576
|
//# sourceMappingURL=sdk.d.ts.map
|
package/dist/src/sdk.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,wBAAwB,EAGxB,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,wBAAwB,EAGxB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACd,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EACR,kBAAkB,EAClB,2BAA2B,EAC3B,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,EACN,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,2BAA2B,EAC9B,MAAM,eAAe,CAAC;AAGvB,OAAO,EAEH,IAAI,EACJ,cAAc,EAGd,MAAM,EAET,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;GASG;AACH,KAAK,aAAa,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACt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kB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,GAC3B,MAAM,sBAAsB,CAAC"}
|
package/dist/src/sdk.js
CHANGED
|
@@ -205,12 +205,64 @@ class IllaSDK {
|
|
|
205
205
|
* if (result2.response.pendingTools && result2.response.pendingTools.length > 0) {
|
|
206
206
|
* console.log("Tool to execute:", result2.response.pendingTools[0]);
|
|
207
207
|
* }
|
|
208
|
+
*
|
|
209
|
+
* // With telemetry callback for real-time events
|
|
210
|
+
* const result3 = await sdk.sendMessage(
|
|
211
|
+
* "Show me my balance",
|
|
212
|
+
* { chatId: result1.chatId },
|
|
213
|
+
* undefined,
|
|
214
|
+
* {
|
|
215
|
+
* onRequestId: (requestId) => {
|
|
216
|
+
* // Connect to telemetry stream
|
|
217
|
+
* telemetryClient.connect(requestId);
|
|
218
|
+
* }
|
|
219
|
+
* }
|
|
220
|
+
* );
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
sendMessage(msg, context, chatOptions, options) {
|
|
224
|
+
const prompt = normalizePrompt(msg);
|
|
225
|
+
const chat = this.getOrCreateChat(context, chatOptions);
|
|
226
|
+
return chat.sendMessage(prompt, options);
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Sends a message with streaming response via SSE.
|
|
230
|
+
*
|
|
231
|
+
* Instead of waiting for the full response, this method streams telemetry events
|
|
232
|
+
* in real-time as they occur during orchestration. The final result is delivered
|
|
233
|
+
* through the `onComplete` callback.
|
|
234
|
+
*
|
|
235
|
+
* This eliminates the need for a separate telemetry subscription - events and
|
|
236
|
+
* the result are delivered through a single HTTP connection.
|
|
237
|
+
*
|
|
238
|
+
* @param msg - The message to send (can be a string or Prompt object)
|
|
239
|
+
* @param context - Context containing either chatId for existing chat or userContext for new chat
|
|
240
|
+
* @param options - Streaming options with event callbacks
|
|
241
|
+
* @param chatOptions - Optional chat configuration when creating a new chat
|
|
242
|
+
* @returns {Promise<void>} A promise that resolves when the stream ends
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
* ```typescript
|
|
246
|
+
* const sdk = new IllaSDK({ apiKey: 'your-api-key' });
|
|
247
|
+
*
|
|
248
|
+
* await sdk.sendMessageStreaming(
|
|
249
|
+
* "What can you help me with?",
|
|
250
|
+
* { userContext: { address: "0x1234..." } },
|
|
251
|
+
* {
|
|
252
|
+
* onEvent: (event) => console.log('Event:', event.type),
|
|
253
|
+
* onComplete: (result) => {
|
|
254
|
+
* console.log('Response:', result.text);
|
|
255
|
+
* console.log('Pending tools:', result.pendingTools?.length ?? 0);
|
|
256
|
+
* },
|
|
257
|
+
* onError: (error) => console.error('Error:', error),
|
|
258
|
+
* }
|
|
259
|
+
* );
|
|
208
260
|
* ```
|
|
209
261
|
*/
|
|
210
|
-
|
|
262
|
+
sendMessageStreaming(msg, context, options = {}, chatOptions) {
|
|
211
263
|
const prompt = normalizePrompt(msg);
|
|
212
264
|
const chat = this.getOrCreateChat(context, chatOptions);
|
|
213
|
-
return chat.
|
|
265
|
+
return chat.sendMessageStreaming(prompt, options);
|
|
214
266
|
}
|
|
215
267
|
/**
|
|
216
268
|
* Gets an existing chat or creates a new one if it doesn't exist.
|
|
@@ -245,6 +297,8 @@ class IllaSDK {
|
|
|
245
297
|
*
|
|
246
298
|
* @example
|
|
247
299
|
* ```typescript
|
|
300
|
+
* import { IllaToolOutcome, IllaToolError } from '@illalabs/interfaces';
|
|
301
|
+
*
|
|
248
302
|
* const sdk = new IllaSDK({ apiKey: 'your-api-key' });
|
|
249
303
|
*
|
|
250
304
|
* // Start a conversation that will request a tool execution
|
|
@@ -257,18 +311,21 @@ class IllaSDK {
|
|
|
257
311
|
* if (result1.response.pendingTools && result1.response.pendingTools.length > 0) {
|
|
258
312
|
* const tool = result1.response.pendingTools[0];
|
|
259
313
|
*
|
|
260
|
-
* // Execute the tool
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
*
|
|
271
|
-
*
|
|
314
|
+
* // Execute the tool and create the outcome
|
|
315
|
+
* let toolResult: IllaToolOutcome<unknown>;
|
|
316
|
+
* try {
|
|
317
|
+
* const executionResult = await executeTool(tool);
|
|
318
|
+
* toolResult = IllaToolOutcome.success(tool.toolCallId, tool.toolName, executionResult);
|
|
319
|
+
* } catch (error) {
|
|
320
|
+
* toolResult = IllaToolOutcome.error(
|
|
321
|
+
* tool.toolCallId,
|
|
322
|
+
* tool.toolName,
|
|
323
|
+
* IllaToolError.execution(tool.toolCallId, tool.toolName, error.message)
|
|
324
|
+
* );
|
|
325
|
+
* }
|
|
326
|
+
*
|
|
327
|
+
* // Send the result back to ILLA
|
|
328
|
+
* const result2 = await sdk.sendToolResult(result1.chatId, toolResult.toJSON());
|
|
272
329
|
* console.log(result2.response.text); // ILLA's response after processing the tool result
|
|
273
330
|
* }
|
|
274
331
|
* ```
|
|
@@ -277,7 +334,7 @@ class IllaSDK {
|
|
|
277
334
|
if (!this.chats.has(chatId)) {
|
|
278
335
|
throw new ChatNotFound(chatId);
|
|
279
336
|
}
|
|
280
|
-
return this.chats.get(chatId).sendMessage(new Prompt({ toolResult }));
|
|
337
|
+
return this.chats.get(chatId).sendMessage([new Prompt({ toolResult: [toolResult] })]);
|
|
281
338
|
}
|
|
282
339
|
/**
|
|
283
340
|
* Gets the messages for a given chat ID.
|
|
@@ -371,16 +428,25 @@ class IllaSDK {
|
|
|
371
428
|
*
|
|
372
429
|
* @example
|
|
373
430
|
* ```typescript
|
|
431
|
+
* import { IllaToolOutcome, IllaToolError } from '@illalabs/interfaces';
|
|
432
|
+
*
|
|
374
433
|
* const sdk = new IllaSDK({ apiKey: 'your-api-key' });
|
|
375
434
|
*
|
|
376
435
|
* // Execute multiple tools and send results together
|
|
377
|
-
* const toolResults
|
|
378
|
-
*
|
|
379
|
-
*
|
|
380
|
-
*
|
|
381
|
-
*
|
|
436
|
+
* const toolResults = pendingTools.map(tool => {
|
|
437
|
+
* try {
|
|
438
|
+
* const result = executeToolSync(tool);
|
|
439
|
+
* return IllaToolOutcome.success(tool.toolCallId, tool.toolName, result);
|
|
440
|
+
* } catch (error) {
|
|
441
|
+
* return IllaToolOutcome.error(
|
|
442
|
+
* tool.toolCallId,
|
|
443
|
+
* tool.toolName,
|
|
444
|
+
* IllaToolError.execution(tool.toolCallId, tool.toolName, error.message)
|
|
445
|
+
* );
|
|
446
|
+
* }
|
|
447
|
+
* });
|
|
382
448
|
*
|
|
383
|
-
* const response = await sdk.sendToolResults(chatId, toolResults);
|
|
449
|
+
* const response = await sdk.sendToolResults(chatId, toolResults.map(r => r.toJSON()));
|
|
384
450
|
* ```
|
|
385
451
|
*/
|
|
386
452
|
async sendToolResults(chatId, toolResults) {
|
|
@@ -391,7 +457,7 @@ class IllaSDK {
|
|
|
391
457
|
throw new SdkEmptyToolsResultsError({ chatId });
|
|
392
458
|
}
|
|
393
459
|
const chat = this.chats.get(chatId);
|
|
394
|
-
return await chat.sendMessage(toolResults.map((toolResult) => new Prompt({ toolResult })));
|
|
460
|
+
return await chat.sendMessage(toolResults.map((toolResult) => new Prompt({ toolResult: [toolResult] })));
|
|
395
461
|
}
|
|
396
462
|
/**
|
|
397
463
|
* Subscribes to status updates for a long-running tool execution.
|
|
@@ -537,7 +603,6 @@ class IllaSDK {
|
|
|
537
603
|
text: data.text,
|
|
538
604
|
messages: data.messages,
|
|
539
605
|
pendingTools: data.pendingTools,
|
|
540
|
-
incompleteTools: data.incompleteTools,
|
|
541
606
|
toolErrors: data.toolErrors,
|
|
542
607
|
};
|
|
543
608
|
}
|
|
@@ -558,4 +623,6 @@ export { ContextManager } from "./context/index.js";
|
|
|
558
623
|
export { AsyncToolChecker } from "./asyncToolChecker/index.js";
|
|
559
624
|
export { CoreApiProvider } from "./providers/index.js";
|
|
560
625
|
export { UserContextMissing } from "./chat/errors/index.js";
|
|
626
|
+
export { TelemetryClient, TelemetryStreamFailed, } from "./telemetry/index.js";
|
|
627
|
+
export { parseSSEStream, SSEParse, StreamingHttpError, StreamingResponseBodyNull, StreamingServerError, } from "./streaming/index.js";
|
|
561
628
|
//# sourceMappingURL=sdk.js.map
|
package/dist/src/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EACH,gBAAgB,EAChB,IAAI,EACJ,cAAc,EACd,eAAe,EACf,aAAa,EACb,MAAM,EACN,kBAAkB,GACrB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EACH,gBAAgB,EAChB,IAAI,EACJ,cAAc,EACd,eAAe,EACf,aAAa,EACb,MAAM,EACN,kBAAkB,GACrB,MAAM,eAAe,CAAC;AA2FvB;;;;;GAKG;AACH,MAAM,YAAa,SAAQ,KAAK;IAC5B;;OAEG;IACa,MAAM,CAAS;IAE/B;;;;;OAKG;IACH,YAAmB,MAAc,EAAE,OAAsB;QACrD,KAAK,CAAC,gBAAgB,MAAM,YAAY,EAAE,OAAO,CAAC,CAAC;QACnD,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;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C;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EACH,eAAe,EACf,qBAAqB,GAGxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,cAAc,EACd,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,oBAAoB,GAOvB,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown when SSE parsing fails.
|
|
3
|
+
*
|
|
4
|
+
* This error is emitted when the SSE stream contains malformed data
|
|
5
|
+
* that cannot be parsed as valid JSON or event format.
|
|
6
|
+
*/
|
|
7
|
+
export declare class SSEParse extends Error {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new SSEParse error
|
|
10
|
+
* @param message - Description of the parse error
|
|
11
|
+
* @param cause - Optional underlying error that caused the parse failure
|
|
12
|
+
*/
|
|
13
|
+
constructor(message: string, cause?: unknown);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=SSEParse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SSEParse.d.ts","sourceRoot":"","sources":["../../../../src/streaming/errors/SSEParse.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,qBAAa,QAAS,SAAQ,KAAK;IAC/B;;;;OAIG;gBACS,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAW/C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown when SSE parsing fails.
|
|
3
|
+
*
|
|
4
|
+
* This error is emitted when the SSE stream contains malformed data
|
|
5
|
+
* that cannot be parsed as valid JSON or event format.
|
|
6
|
+
*/
|
|
7
|
+
export class SSEParse extends Error {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new SSEParse error
|
|
10
|
+
* @param message - Description of the parse error
|
|
11
|
+
* @param cause - Optional underlying error that caused the parse failure
|
|
12
|
+
*/
|
|
13
|
+
constructor(message, cause) {
|
|
14
|
+
super(`SSE parse error: ${message}`, { cause });
|
|
15
|
+
this.name = "SSEParse";
|
|
16
|
+
// Restore the prototype chain for proper Error subclassing in TypeScript
|
|
17
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
18
|
+
if (Error.captureStackTrace) {
|
|
19
|
+
Error.captureStackTrace(this, SSEParse);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=SSEParse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SSEParse.js","sourceRoot":"","sources":["../../../../src/streaming/errors/SSEParse.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,OAAO,QAAS,SAAQ,KAAK;IAC/B;;;;OAIG;IACH,YAAY,OAAe,EAAE,KAAe;QACxC,KAAK,CAAC,oBAAoB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAChD,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QAEvB,yEAAyE;QACzE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAElD,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC1B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC5C,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown when the streaming request receives an HTTP error response.
|
|
3
|
+
*
|
|
4
|
+
* This error captures the HTTP status code and error message from the server.
|
|
5
|
+
*/
|
|
6
|
+
export declare class StreamingHttpError extends Error {
|
|
7
|
+
/**
|
|
8
|
+
* The HTTP status code from the failed request.
|
|
9
|
+
*/
|
|
10
|
+
readonly statusCode: number;
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new StreamingHttpError.
|
|
13
|
+
* @param statusCode - The HTTP status code from the response
|
|
14
|
+
* @param message - The error message from the server or a default message
|
|
15
|
+
*/
|
|
16
|
+
constructor(statusCode: number, message: string);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=StreamingHttpError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StreamingHttpError.d.ts","sourceRoot":"","sources":["../../../../src/streaming/errors/StreamingHttpError.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IACzC;;OAEG;IACH,SAAgB,UAAU,EAAE,MAAM,CAAC;IAEnC;;;;OAIG;gBACS,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAYlD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown when the streaming request receives an HTTP error response.
|
|
3
|
+
*
|
|
4
|
+
* This error captures the HTTP status code and error message from the server.
|
|
5
|
+
*/
|
|
6
|
+
export class StreamingHttpError extends Error {
|
|
7
|
+
/**
|
|
8
|
+
* The HTTP status code from the failed request.
|
|
9
|
+
*/
|
|
10
|
+
statusCode;
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new StreamingHttpError.
|
|
13
|
+
* @param statusCode - The HTTP status code from the response
|
|
14
|
+
* @param message - The error message from the server or a default message
|
|
15
|
+
*/
|
|
16
|
+
constructor(statusCode, message) {
|
|
17
|
+
super(message);
|
|
18
|
+
this.name = "StreamingHttpError";
|
|
19
|
+
this.statusCode = statusCode;
|
|
20
|
+
// Restore the prototype chain for proper Error subclassing in TypeScript
|
|
21
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
22
|
+
if (Error.captureStackTrace) {
|
|
23
|
+
Error.captureStackTrace(this, StreamingHttpError);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=StreamingHttpError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StreamingHttpError.js","sourceRoot":"","sources":["../../../../src/streaming/errors/StreamingHttpError.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IACzC;;OAEG;IACa,UAAU,CAAS;IAEnC;;;;OAIG;IACH,YAAY,UAAkB,EAAE,OAAe;QAC3C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAE7B,yEAAyE;QACzE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAElD,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC1B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QACtD,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown when the streaming response body is null.
|
|
3
|
+
*
|
|
4
|
+
* This typically indicates the server did not return a streaming response
|
|
5
|
+
* when one was expected.
|
|
6
|
+
*/
|
|
7
|
+
export declare class StreamingResponseBodyNull extends Error {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new StreamingResponseBodyNull error.
|
|
10
|
+
*/
|
|
11
|
+
constructor();
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=StreamingResponseBodyNull.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StreamingResponseBodyNull.d.ts","sourceRoot":"","sources":["../../../../src/streaming/errors/StreamingResponseBodyNull.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;IAChD;;OAEG;;CAYN"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown when the streaming response body is null.
|
|
3
|
+
*
|
|
4
|
+
* This typically indicates the server did not return a streaming response
|
|
5
|
+
* when one was expected.
|
|
6
|
+
*/
|
|
7
|
+
export class StreamingResponseBodyNull extends Error {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new StreamingResponseBodyNull error.
|
|
10
|
+
*/
|
|
11
|
+
constructor() {
|
|
12
|
+
super("Response body is null - streaming not available");
|
|
13
|
+
this.name = "StreamingResponseBodyNull";
|
|
14
|
+
// Restore the prototype chain for proper Error subclassing in TypeScript
|
|
15
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
16
|
+
if (Error.captureStackTrace) {
|
|
17
|
+
Error.captureStackTrace(this, StreamingResponseBodyNull);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=StreamingResponseBodyNull.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StreamingResponseBodyNull.js","sourceRoot":"","sources":["../../../../src/streaming/errors/StreamingResponseBodyNull.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAChD;;OAEG;IACH;QACI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACzD,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;QAExC,yEAAyE;QACzE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAElD,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC1B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAC;QAC7D,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown when the server sends an error event through the SSE stream.
|
|
3
|
+
*
|
|
4
|
+
* This error captures the error code and message from the stream error event.
|
|
5
|
+
*/
|
|
6
|
+
export declare class StreamingServerError extends Error {
|
|
7
|
+
/**
|
|
8
|
+
* The request ID associated with the failed stream.
|
|
9
|
+
*/
|
|
10
|
+
readonly requestId: string;
|
|
11
|
+
/**
|
|
12
|
+
* Optional error code from the server.
|
|
13
|
+
*/
|
|
14
|
+
readonly code?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new StreamingServerError.
|
|
17
|
+
* @param requestId - The request ID from the error event
|
|
18
|
+
* @param message - The error message from the server
|
|
19
|
+
* @param code - Optional error code from the server
|
|
20
|
+
*/
|
|
21
|
+
constructor(requestId: string, message: string, code?: string);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=StreamingServerError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StreamingServerError.d.ts","sourceRoot":"","sources":["../../../../src/streaming/errors/StreamingServerError.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC3C;;OAEG;IACH,SAAgB,SAAS,EAAE,MAAM,CAAC;IAElC;;OAEG;IACH,SAAgB,IAAI,CAAC,EAAE,MAAM,CAAC;IAE9B;;;;;OAKG;gBACS,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;CAahE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown when the server sends an error event through the SSE stream.
|
|
3
|
+
*
|
|
4
|
+
* This error captures the error code and message from the stream error event.
|
|
5
|
+
*/
|
|
6
|
+
export class StreamingServerError extends Error {
|
|
7
|
+
/**
|
|
8
|
+
* The request ID associated with the failed stream.
|
|
9
|
+
*/
|
|
10
|
+
requestId;
|
|
11
|
+
/**
|
|
12
|
+
* Optional error code from the server.
|
|
13
|
+
*/
|
|
14
|
+
code;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new StreamingServerError.
|
|
17
|
+
* @param requestId - The request ID from the error event
|
|
18
|
+
* @param message - The error message from the server
|
|
19
|
+
* @param code - Optional error code from the server
|
|
20
|
+
*/
|
|
21
|
+
constructor(requestId, message, code) {
|
|
22
|
+
super(message);
|
|
23
|
+
this.name = "StreamingServerError";
|
|
24
|
+
this.requestId = requestId;
|
|
25
|
+
this.code = code;
|
|
26
|
+
// Restore the prototype chain for proper Error subclassing in TypeScript
|
|
27
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
28
|
+
if (Error.captureStackTrace) {
|
|
29
|
+
Error.captureStackTrace(this, StreamingServerError);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=StreamingServerError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StreamingServerError.js","sourceRoot":"","sources":["../../../../src/streaming/errors/StreamingServerError.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC3C;;OAEG;IACa,SAAS,CAAS;IAElC;;OAEG;IACa,IAAI,CAAU;IAE9B;;;;;OAKG;IACH,YAAY,SAAiB,EAAE,OAAe,EAAE,IAAa;QACzD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAEjB,yEAAyE;QACzE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAElD,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC1B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;QACxD,CAAC;IACL,CAAC;CACJ"}
|