@illalabs/sdk 0.3.3-canary.b7f69a88 → 0.4.0-canary.361ed2fa

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 (68) hide show
  1. package/README.md +15 -9
  2. package/dist/src/chat/Chat.d.ts +6 -3
  3. package/dist/src/chat/Chat.d.ts.map +1 -1
  4. package/dist/src/chat/Chat.js +54 -22
  5. package/dist/src/chat/Chat.js.map +1 -1
  6. package/dist/src/chat/errors/ChatInvalidMultiplePromptsKind.d.ts +22 -0
  7. package/dist/src/chat/errors/ChatInvalidMultiplePromptsKind.d.ts.map +1 -0
  8. package/dist/src/chat/errors/ChatInvalidMultiplePromptsKind.js +31 -0
  9. package/dist/src/chat/errors/ChatInvalidMultiplePromptsKind.js.map +1 -0
  10. package/dist/src/chat/errors/ChatInvalidPromptSnapshot.d.ts +19 -0
  11. package/dist/src/chat/errors/ChatInvalidPromptSnapshot.d.ts.map +1 -0
  12. package/dist/src/chat/errors/ChatInvalidPromptSnapshot.js +28 -0
  13. package/dist/src/chat/errors/ChatInvalidPromptSnapshot.js.map +1 -0
  14. package/dist/src/chat/errors/ChatInvalidSinglePromptKind.d.ts +22 -0
  15. package/dist/src/chat/errors/ChatInvalidSinglePromptKind.d.ts.map +1 -0
  16. package/dist/src/chat/errors/ChatInvalidSinglePromptKind.js +31 -0
  17. package/dist/src/chat/errors/ChatInvalidSinglePromptKind.js.map +1 -0
  18. package/dist/src/chat/errors/index.d.ts +3 -0
  19. package/dist/src/chat/errors/index.d.ts.map +1 -1
  20. package/dist/src/chat/errors/index.js +3 -0
  21. package/dist/src/chat/errors/index.js.map +1 -1
  22. package/dist/src/chat/utils/prompt.d.ts +3 -0
  23. package/dist/src/chat/utils/prompt.d.ts.map +1 -0
  24. package/dist/src/chat/utils/prompt.js +5 -0
  25. package/dist/src/chat/utils/prompt.js.map +1 -0
  26. package/dist/src/context/ContextManager.d.ts +2 -0
  27. package/dist/src/context/ContextManager.d.ts.map +1 -1
  28. package/dist/src/context/ContextManager.js +7 -0
  29. package/dist/src/context/ContextManager.js.map +1 -1
  30. package/dist/src/errors/SdkEmptyToolsResultsError.d.ts +19 -0
  31. package/dist/src/errors/SdkEmptyToolsResultsError.d.ts.map +1 -0
  32. package/dist/src/errors/SdkEmptyToolsResultsError.js +28 -0
  33. package/dist/src/errors/SdkEmptyToolsResultsError.js.map +1 -0
  34. package/dist/src/interfaces/chat.interface.d.ts +3 -2
  35. package/dist/src/interfaces/chat.interface.d.ts.map +1 -1
  36. package/dist/src/interfaces/contextManager.interface.d.ts +7 -1
  37. package/dist/src/interfaces/contextManager.interface.d.ts.map +1 -1
  38. package/dist/src/prompt/Prompt.d.ts +2 -10
  39. package/dist/src/prompt/Prompt.d.ts.map +1 -1
  40. package/dist/src/prompt/Prompt.js +9 -22
  41. package/dist/src/prompt/Prompt.js.map +1 -1
  42. package/dist/src/prompt/types.d.ts +7 -9
  43. package/dist/src/prompt/types.d.ts.map +1 -1
  44. package/dist/src/prompt/utils/cloneToolResult.d.ts +6 -6
  45. package/dist/src/prompt/utils/cloneToolResult.d.ts.map +1 -1
  46. package/dist/src/prompt/utils/cloneToolResult.js +11 -16
  47. package/dist/src/prompt/utils/cloneToolResult.js.map +1 -1
  48. package/dist/src/prompt/utils/index.d.ts +1 -3
  49. package/dist/src/prompt/utils/index.d.ts.map +1 -1
  50. package/dist/src/prompt/utils/index.js +1 -3
  51. package/dist/src/prompt/utils/index.js.map +1 -1
  52. package/dist/src/sdk.d.ts +251 -25
  53. package/dist/src/sdk.d.ts.map +1 -1
  54. package/dist/src/sdk.js +312 -26
  55. package/dist/src/sdk.js.map +1 -1
  56. package/package.json +2 -2
  57. package/dist/src/chat/errors/ChatInvalidModelContext.d.ts +0 -15
  58. package/dist/src/chat/errors/ChatInvalidModelContext.d.ts.map +0 -1
  59. package/dist/src/chat/errors/ChatInvalidModelContext.js +0 -24
  60. package/dist/src/chat/errors/ChatInvalidModelContext.js.map +0 -1
  61. package/dist/src/prompt/utils/normalizeTextPrompt.d.ts +0 -14
  62. package/dist/src/prompt/utils/normalizeTextPrompt.d.ts.map +0 -1
  63. package/dist/src/prompt/utils/normalizeTextPrompt.js +0 -22
  64. package/dist/src/prompt/utils/normalizeTextPrompt.js.map +0 -1
  65. package/dist/src/prompt/utils/normalizeToolResult.d.ts +0 -14
  66. package/dist/src/prompt/utils/normalizeToolResult.d.ts.map +0 -1
  67. package/dist/src/prompt/utils/normalizeToolResult.js +0 -27
  68. package/dist/src/prompt/utils/normalizeToolResult.js.map +0 -1
package/dist/src/sdk.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { normalizePrompt } from "./chat/utils/prompt.js";
2
+ import { SdkEmptyToolsResultsError } from "./errors/SdkEmptyToolsResultsError.js";
1
3
  import { AsyncToolChecker, Chat, ContextManager, CoreApiProvider, InMemoryCache, Prompt, UserContextMissing, } from "./internal.js";
2
4
  /**
3
5
  * Error raised when attempting to interact with a chat that doesn't exist.
@@ -77,9 +79,13 @@ class IllaSDK {
77
79
  constructor(config, options) {
78
80
  this.coreApiProvider = new CoreApiProvider({
79
81
  baseURL: config.baseURL,
82
+ timeout: config.timeout,
80
83
  headers: {
81
84
  "x-api-key": config.apiKey,
85
+ ...config.headers,
82
86
  },
87
+ httpClientFactory: config.httpClientFactory,
88
+ routes: config.routes,
83
89
  });
84
90
  if (options && options.contextManager) {
85
91
  this.contextManager = options.contextManager;
@@ -164,6 +170,7 @@ class IllaSDK {
164
170
  coreApiProvider: this.coreApiProvider,
165
171
  }),
166
172
  personalityContext: options.personalityContext,
173
+ modelContext: options.modelContext,
167
174
  });
168
175
  this.chats.set(chat.getId(), chat);
169
176
  return chat;
@@ -173,15 +180,16 @@ class IllaSDK {
173
180
  * If a chatId is provided, the message will be sent to the existing chat.
174
181
  * If a chatId is not provided, a new chat will be created with the provided userContext.
175
182
  *
176
- * @param msg - The message text to send
183
+ * @param msg - The message to send (can be a string or Prompt object)
177
184
  * @param context - Context containing either chatId for existing chat or userContext for new chat
185
+ * @param chatOptions - Optional chat configuration when creating a new chat
178
186
  * @returns {Promise<SendMessageResult>} The AI's response including chat ID, response text, and any pending tools
179
187
  *
180
188
  * @example
181
189
  * ```typescript
182
190
  * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
183
191
  *
184
- * // Start a new conversation
192
+ * // Start a new conversation with a string
185
193
  * const result1 = await sdk.sendMessage(
186
194
  * "What can you help me with?",
187
195
  * { userContext: { address: "0x1234..." } }
@@ -189,11 +197,9 @@ class IllaSDK {
189
197
  * console.log(result1.response.text);
190
198
  * console.log("Chat ID:", result1.chatId);
191
199
  *
192
- * // Continue the conversation using the chat ID
193
- * const result2 = await sdk.sendMessage(
194
- * "I want to swap 1 ETH for USDC on Base",
195
- * { chatId: result1.chatId }
196
- * );
200
+ * // Continue the conversation with a Prompt object
201
+ * const prompt = new Prompt({ text: "I want to swap 1 ETH for USDC on Base" });
202
+ * const result2 = await sdk.sendMessage(prompt, { chatId: result1.chatId });
197
203
  *
198
204
  * // Check if there are tools to execute
199
205
  * if (result2.response.pendingTools && result2.response.pendingTools.length > 0) {
@@ -201,16 +207,32 @@ class IllaSDK {
201
207
  * }
202
208
  * ```
203
209
  */
204
- sendMessage(msg, context) {
205
- if (context.chatId && this.chats.get(context.chatId) !== undefined) {
206
- return this.chats.get(context.chatId).sendMessage(new Prompt({ text: msg }));
210
+ sendMessage(msg, context, chatOptions) {
211
+ const prompt = normalizePrompt(msg);
212
+ const chat = this.getOrCreateChat(context, chatOptions);
213
+ return chat.sendMessage(prompt);
214
+ }
215
+ /**
216
+ * Gets an existing chat or creates a new one if it doesn't exist.
217
+ *
218
+ * @param context - Context containing either chatId for existing chat or userContext for new chat
219
+ * @param chatOptions - Optional chat configuration when creating a new chat
220
+ * @returns {Chat} The chat instance
221
+ */
222
+ getOrCreateChat(context, chatOptions) {
223
+ if (context.chatId) {
224
+ const existingChat = this.chats.get(context.chatId);
225
+ if (existingChat) {
226
+ return existingChat;
227
+ }
207
228
  }
229
+ // If no chatId is provided, create a new chat
208
230
  if (!context.userContext) {
209
231
  throw new UserContextMissing();
210
232
  }
211
- const chat = this.createChat({ userContext: context.userContext });
233
+ const chat = this.createChat({ userContext: context.userContext, ...chatOptions });
212
234
  this.chats.set(chat.getId(), chat);
213
- return chat.sendMessage(new Prompt({ text: msg }));
235
+ return chat;
214
236
  }
215
237
  /**
216
238
  * Sends the result of a tool execution back to the AI. This method is used to complete
@@ -219,10 +241,12 @@ class IllaSDK {
219
241
  * @param chatId - The ID of the chat to send the tool result to
220
242
  * @param toolResult - The result of the tool execution
221
243
  * @returns {Promise<SendMessageResult>} The AI's response after processing the tool result
222
- * @throws {Error} If the chat with the specified chatId is not found
244
+ * @throws {ChatNotFound} If the chat with the specified chatId is not found
223
245
  *
224
246
  * @example
225
247
  * ```typescript
248
+ * import { IllaToolOutcome, IllaToolError } from '@illalabs/interfaces';
249
+ *
226
250
  * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
227
251
  *
228
252
  * // Start a conversation that will request a tool execution
@@ -235,27 +259,30 @@ class IllaSDK {
235
259
  * if (result1.response.pendingTools && result1.response.pendingTools.length > 0) {
236
260
  * const tool = result1.response.pendingTools[0];
237
261
  *
238
- * // Execute the tool (e.g., send a transaction)
239
- * const executionResult = await executeTool(tool);
262
+ * // Execute the tool and create the outcome
263
+ * let toolResult: IllaToolOutcome<unknown>;
264
+ * try {
265
+ * const executionResult = await executeTool(tool);
266
+ * toolResult = IllaToolOutcome.success(tool.toolCallId, tool.toolName, executionResult);
267
+ * } catch (error) {
268
+ * toolResult = IllaToolOutcome.error(
269
+ * tool.toolCallId,
270
+ * tool.toolName,
271
+ * IllaToolError.execution(tool.toolCallId, tool.toolName, error.message)
272
+ * );
273
+ * }
240
274
  *
241
- * // Send the result back to the ILLA
242
- * const toolResult: ToolResultType = {
243
- * toolCallId: tool.toolCallId,
244
- * toolName: tool.toolName,
245
- * result?: executionResult,
246
- * error?: executionResult.error,
247
- * };
248
- *
249
- * const result2 = await sdk.sendToolResult(result1.chatId, toolResult);
275
+ * // Send the result back to ILLA
276
+ * const result2 = await sdk.sendToolResult(result1.chatId, toolResult.toJSON());
250
277
  * console.log(result2.response.text); // ILLA's response after processing the tool result
251
278
  * }
252
279
  * ```
253
280
  */
254
281
  async sendToolResult(chatId, toolResult) {
255
- if (this.chats.get(chatId) === undefined) {
282
+ if (!this.chats.has(chatId)) {
256
283
  throw new ChatNotFound(chatId);
257
284
  }
258
- return await this.chats.get(chatId).sendMessage(new Prompt({ toolResult }));
285
+ return this.chats.get(chatId).sendMessage(new Prompt({ toolResult: [toolResult] }));
259
286
  }
260
287
  /**
261
288
  * Gets the messages for a given chat ID.
@@ -271,6 +298,265 @@ class IllaSDK {
271
298
  }
272
299
  return chat.messages;
273
300
  }
301
+ /**
302
+ * Appends messages to an existing chat's message history.
303
+ *
304
+ * @param chatId - The ID of the chat to append messages to
305
+ * @param messages - The messages to append to the chat history
306
+ * @throws {ChatNotFound} If the chat with the specified chatId is not found
307
+ *
308
+ * @example
309
+ * ```typescript
310
+ * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
311
+ *
312
+ * // Append synthetic messages for testing or prompting
313
+ * await sdk.appendMessages(chatId, [
314
+ * { role: "user", content: "Previous context..." },
315
+ * { role: "assistant", content: "Understood..." }
316
+ * ]);
317
+ * ```
318
+ */
319
+ async appendMessages(chatId, messages) {
320
+ if (!this.chats.has(chatId)) {
321
+ throw new ChatNotFound(chatId);
322
+ }
323
+ await this.contextManager.appendMessages(chatId, messages);
324
+ }
325
+ /**
326
+ * Clears the message history for a chat while keeping the chat instance.
327
+ *
328
+ * @param chatId - The ID of the chat to clear
329
+ * @throws {ChatNotFound} If the chat with the specified chatId is not found
330
+ *
331
+ * @example
332
+ * ```typescript
333
+ * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
334
+ *
335
+ * // Clear chat history to start fresh
336
+ * await sdk.clearContext(chatId);
337
+ * ```
338
+ */
339
+ async clearContext(chatId) {
340
+ if (!this.chats.has(chatId)) {
341
+ throw new ChatNotFound(chatId);
342
+ }
343
+ await this.contextManager.clearContext(chatId);
344
+ }
345
+ /**
346
+ * Deletes a chat and removes all associated data.
347
+ *
348
+ * @param chatId - The ID of the chat to delete
349
+ * @throws {ChatNotFound} If the chat with the specified chatId is not found
350
+ *
351
+ * @example
352
+ * ```typescript
353
+ * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
354
+ *
355
+ * // Clean up chat when done
356
+ * await sdk.deleteChat(chatId);
357
+ * ```
358
+ */
359
+ async deleteChat(chatId) {
360
+ if (!this.chats.has(chatId)) {
361
+ throw new ChatNotFound(chatId);
362
+ }
363
+ await this.contextManager.deleteContext(chatId);
364
+ this.chats.delete(chatId);
365
+ }
366
+ /**
367
+ * Sends multiple tool results back to the AI in a single request.
368
+ * This method is used when multiple tools need to be executed and their results
369
+ * sent back together.
370
+ *
371
+ * @param chatId - The ID of the chat to send the tool results to
372
+ * @param toolResults - Array of tool execution results
373
+ * @param options - Optional parameters including AbortSignal
374
+ * @returns {Promise<SendMessageResult>} The AI's response after processing all tool results
375
+ * @throws {ChatNotFound} If the chat with the specified chatId is not found
376
+ *
377
+ * @example
378
+ * ```typescript
379
+ * import { IllaToolOutcome, IllaToolError } from '@illalabs/interfaces';
380
+ *
381
+ * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
382
+ *
383
+ * // Execute multiple tools and send results together
384
+ * const toolResults = pendingTools.map(tool => {
385
+ * try {
386
+ * const result = executeToolSync(tool);
387
+ * return IllaToolOutcome.success(tool.toolCallId, tool.toolName, result);
388
+ * } catch (error) {
389
+ * return IllaToolOutcome.error(
390
+ * tool.toolCallId,
391
+ * tool.toolName,
392
+ * IllaToolError.execution(tool.toolCallId, tool.toolName, error.message)
393
+ * );
394
+ * }
395
+ * });
396
+ *
397
+ * const response = await sdk.sendToolResults(chatId, toolResults.map(r => r.toJSON()));
398
+ * ```
399
+ */
400
+ async sendToolResults(chatId, toolResults) {
401
+ if (!this.chats.has(chatId)) {
402
+ throw new ChatNotFound(chatId);
403
+ }
404
+ if (toolResults.length === 0) {
405
+ throw new SdkEmptyToolsResultsError({ chatId });
406
+ }
407
+ const chat = this.chats.get(chatId);
408
+ return await chat.sendMessage(new Prompt({ toolResult: toolResults }));
409
+ }
410
+ /**
411
+ * Subscribes to status updates for a long-running tool execution.
412
+ *
413
+ * @param params - Parameters identifying the tool execution to monitor
414
+ * @param callbacks - Event handlers for status changes and errors
415
+ * @param config - Optional polling configuration
416
+ * @returns {EventSubscription} Subscription handle to cancel monitoring
417
+ *
418
+ * @example
419
+ * ```typescript
420
+ * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
421
+ *
422
+ * const subscription = sdk.subscribeToToolStatus(
423
+ * { toolName: "swap", protocol: "li.fi", args: txHash },
424
+ * {
425
+ * onStatusChange: (event) => console.log("Status:", event.status),
426
+ * onError: (error) => console.error("Error:", error)
427
+ * },
428
+ * { interval: 2000, maxDuration: 300, maxRetries: 3 }
429
+ * );
430
+ *
431
+ * // Later, cancel the subscription
432
+ * subscription.unsubscribe();
433
+ * ```
434
+ */
435
+ subscribeToToolStatus(params, callbacks, config) {
436
+ const asyncToolChecker = new AsyncToolChecker({
437
+ coreApiProvider: this.coreApiProvider,
438
+ });
439
+ const defaultConfig = {
440
+ interval: config?.interval ?? 5000,
441
+ maxDuration: config?.maxDuration ?? 300,
442
+ retryThreshold: config?.retryThreshold ?? 30000,
443
+ maxRetries: config?.maxRetries ?? 3,
444
+ };
445
+ return asyncToolChecker.subscribe(params, callbacks, defaultConfig);
446
+ }
447
+ /**
448
+ * Awaits the completion of a long-running action triggered by a chat.
449
+ *
450
+ * @param chatId - The ID of the chat that triggered the action
451
+ * @param descriptor - Descriptor identifying the action to track
452
+ * @returns {Promise<AwaitActionResult>} The final status of the action
453
+ * @throws {ChatNotFound} If the chat with the specified chatId is not found
454
+ *
455
+ * @example
456
+ * ```typescript
457
+ * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
458
+ *
459
+ * const result = await sdk.awaitAction(chatId, {
460
+ * toolName: "swap",
461
+ * protocol: "li.fi",
462
+ * args: { txHash: "0x..." }
463
+ * });
464
+ *
465
+ * if (result.isError) {
466
+ * console.error("Action failed:", result.error);
467
+ * } else {
468
+ * console.log("Action completed:", result.response);
469
+ * }
470
+ * ```
471
+ */
472
+ async awaitAction(chatId, descriptor) {
473
+ const chat = this.chats.get(chatId);
474
+ if (!chat) {
475
+ throw new ChatNotFound(chatId);
476
+ }
477
+ return chat.awaitAction(descriptor);
478
+ }
479
+ /**
480
+ * Gets the underlying Chat instance for advanced operations.
481
+ *
482
+ * @param chatId - The ID of the chat to retrieve
483
+ * @returns {Chat} The Chat instance
484
+ * @throws {ChatNotFound} If the chat with the specified chatId is not found
485
+ *
486
+ * @example
487
+ * ```typescript
488
+ * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
489
+ *
490
+ * const chat = sdk.getChat(chatId);
491
+ * // Now you can use advanced Chat methods directly
492
+ * const context = await chat.getContext();
493
+ * ```
494
+ */
495
+ getChat(chatId) {
496
+ const chat = this.chats.get(chatId);
497
+ if (!chat) {
498
+ throw new ChatNotFound(chatId);
499
+ }
500
+ return chat;
501
+ }
502
+ /**
503
+ * Gets all active chat IDs as an array.
504
+ * Alias for the chatIds getter property.
505
+ *
506
+ * @returns {string[]} Array of active chat IDs
507
+ *
508
+ * @example
509
+ * ```typescript
510
+ * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
511
+ *
512
+ * const ids = sdk.getChatIds();
513
+ * console.log("Active chats:", ids);
514
+ * ```
515
+ */
516
+ getChatIds() {
517
+ return this.chatIds;
518
+ }
519
+ /**
520
+ * Helper method to extract detailed response metadata from a SendMessageResult.
521
+ * Provides access to incompleteTools, toolErrors, and other response details.
522
+ *
523
+ * @param result - The SendMessageResult to extract metadata from
524
+ * @returns {ResponseMetadata} Extracted response metadata
525
+ *
526
+ * @example
527
+ * ```typescript
528
+ * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
529
+ *
530
+ * const result = await sdk.sendMessage("Hello", { chatId });
531
+ * const metadata = sdk.getResponseMetadata(result);
532
+ *
533
+ * if (metadata.incompleteTools?.length > 0) {
534
+ * console.log("Incomplete tools:", metadata.incompleteTools);
535
+ * }
536
+ * if (metadata.toolErrors?.length > 0) {
537
+ * console.log("Tool errors:", metadata.toolErrors);
538
+ * }
539
+ * ```
540
+ */
541
+ getResponseMetadata(result) {
542
+ if (result.response.isError) {
543
+ return {
544
+ isError: true,
545
+ error: result.response.error,
546
+ };
547
+ }
548
+ const data = result.response.data;
549
+ return {
550
+ isError: false,
551
+ text: data.text,
552
+ messages: data.messages,
553
+ pendingTools: data.pendingTools,
554
+ toolErrors: data.toolErrors,
555
+ };
556
+ }
557
+ isSuccessResponse(response) {
558
+ return "status" in response && response.status === 200;
559
+ }
274
560
  }
275
561
  /**
276
562
  * Exports the public API of the SDK.
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAeA,OAAO,EACH,gBAAgB,EAChB,IAAI,EACJ,cAAc,EACd,eAAe,EACf,aAAa,EACb,MAAM,EACN,kBAAkB,GACrB,MAAM,eAAe,CAAC;AAyDvB;;;;;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;CACJ;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO;IACD,eAAe,CAAkB;IACjC,cAAc,CAAkB;IAEhC,KAAK,GAAsB,IAAI,GAAG,EAAE,CAAC;IAE7C;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,YAA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AM,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YAC1B,OAAO;gBACH,OAAO,EAAE,IAAI;gBACb,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK;aAC/B,CAAC;QACN,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAkC,CAAC;QAChE,OAAO;YACH,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,UAAU,EAAE,IAAI,CAAC,UAAU;SAC9B,CAAC;IACN,CAAC;IAEO,iBAAiB,CACrB,QAA6B;QAE7B,OAAO,QAAQ,IAAI,QAAQ,IAAK,QAAuC,CAAC,MAAM,KAAK,GAAG,CAAC;IAC3F,CAAC;CACJ;AAED;;;;GAIG;AACH,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@illalabs/sdk",
3
- "version": "0.3.3-canary.b7f69a88",
3
+ "version": "0.4.0-canary.361ed2fa",
4
4
  "private": false,
5
5
  "description": "TypeScript SDK for interacting with Illa's Core API",
6
6
  "license": "MIT",
@@ -23,7 +23,7 @@
23
23
  "axios": "1.12.2",
24
24
  "uuid": "13.0.0",
25
25
  "viem": "2.37.13",
26
- "@illalabs/interfaces": "0.3.0-canary.b7f69a88"
26
+ "@illalabs/interfaces": "0.3.0-canary.361ed2fa"
27
27
  },
28
28
  "devDependencies": {
29
29
  "zod": "4.1.12"
@@ -1,15 +0,0 @@
1
- /**
2
- * Error emitted when attempting to create a chat with an invalid model context.
3
- *
4
- * The error may include a `context` property with additional debugging information
5
- * such as the `modelContext` that was invalid.
6
- */
7
- export declare class ChatInvalidModelContext extends Error {
8
- /**
9
- * Creates a new {@link ChatInvalidModelContext} instance.
10
- *
11
- * @param context Additional context useful for debugging, e.g. `{ modelContext: unknown }`.
12
- */
13
- constructor(context?: unknown);
14
- }
15
- //# sourceMappingURL=ChatInvalidModelContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatInvalidModelContext.d.ts","sourceRoot":"","sources":["../../../../src/chat/errors/ChatInvalidModelContext.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAC9C;;;;OAIG;gBACgB,OAAO,CAAC,EAAE,OAAO;CAUvC"}
@@ -1,24 +0,0 @@
1
- /**
2
- * Error emitted when attempting to create a chat with an invalid model context.
3
- *
4
- * The error may include a `context` property with additional debugging information
5
- * such as the `modelContext` that was invalid.
6
- */
7
- export class ChatInvalidModelContext extends Error {
8
- /**
9
- * Creates a new {@link ChatInvalidModelContext} instance.
10
- *
11
- * @param context Additional context useful for debugging, e.g. `{ modelContext: unknown }`.
12
- */
13
- constructor(context) {
14
- super("Invalid model context.");
15
- this.name = "ChatInvalidModelContext";
16
- if (context !== undefined) {
17
- Object.defineProperty(this, "context", {
18
- value: context,
19
- enumerable: true,
20
- });
21
- }
22
- }
23
- }
24
- //# sourceMappingURL=ChatInvalidModelContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatInvalidModelContext.js","sourceRoot":"","sources":["../../../../src/chat/errors/ChatInvalidModelContext.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAC9C;;;;OAIG;IACH,YAAmB,OAAiB;QAChC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;QACtC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE;gBACnC,KAAK,EAAE,OAAO;gBACd,UAAU,EAAE,IAAI;aACnB,CAAC,CAAC;QACP,CAAC;IACL,CAAC;CACJ"}
@@ -1,14 +0,0 @@
1
- import type { MessageType } from "@illalabs/interfaces";
2
- import type { PromptRole } from "../types.js";
3
- /**
4
- * Transforms a text prompt into both prompt and message formats for API communication.
5
- *
6
- * @param text The text prompt to normalize.
7
- * @param role The role to assign to the generated message.
8
- * @returns An object containing the prompt payload and formatted message.
9
- */
10
- export declare function normalizeTextPrompt(text: string, role: PromptRole): {
11
- readonly prompt: string;
12
- readonly message: MessageType;
13
- };
14
- //# sourceMappingURL=normalizeTextPrompt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalizeTextPrompt.d.ts","sourceRoot":"","sources":["../../../../src/prompt/utils/normalizeTextPrompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAC/B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,UAAU,GACjB;IACC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;CACjC,CAaA"}
@@ -1,22 +0,0 @@
1
- /**
2
- * Transforms a text prompt into both prompt and message formats for API communication.
3
- *
4
- * @param text The text prompt to normalize.
5
- * @param role The role to assign to the generated message.
6
- * @returns An object containing the prompt payload and formatted message.
7
- */
8
- export function normalizeTextPrompt(text, role) {
9
- return {
10
- prompt: text,
11
- message: {
12
- role,
13
- content: [
14
- {
15
- type: "text",
16
- text,
17
- },
18
- ],
19
- },
20
- };
21
- }
22
- //# sourceMappingURL=normalizeTextPrompt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalizeTextPrompt.js","sourceRoot":"","sources":["../../../../src/prompt/utils/normalizeTextPrompt.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAC/B,IAAY,EACZ,IAAgB;IAKhB,OAAO;QACH,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE;YACL,IAAI;YACJ,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,MAAM;oBACZ,IAAI;iBACP;aACJ;SACJ;KACJ,CAAC;AACN,CAAC"}
@@ -1,14 +0,0 @@
1
- import type { MessageType, ToolResultType } from "@illalabs/interfaces";
2
- import type { PromptRole } from "../types.js";
3
- /**
4
- * Transforms a tool result into both prompt and message formats for API communication.
5
- *
6
- * @param toolResult The tool result to normalize.
7
- * @param role The role to assign to the generated message.
8
- * @returns An object containing the prompt payload and formatted message.
9
- */
10
- export declare function normalizeToolResult(toolResult: ToolResultType, role: PromptRole): {
11
- readonly prompt: ToolResultType;
12
- readonly message: MessageType;
13
- };
14
- //# sourceMappingURL=normalizeToolResult.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalizeToolResult.d.ts","sourceRoot":"","sources":["../../../../src/prompt/utils/normalizeToolResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAExE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9C;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAC/B,UAAU,EAAE,cAAc,EAC1B,IAAI,EAAE,UAAU,GACjB;IACC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;CACjC,CAkBA"}
@@ -1,27 +0,0 @@
1
- import { cloneToolResult } from "./cloneToolResult.js";
2
- /**
3
- * Transforms a tool result into both prompt and message formats for API communication.
4
- *
5
- * @param toolResult The tool result to normalize.
6
- * @param role The role to assign to the generated message.
7
- * @returns An object containing the prompt payload and formatted message.
8
- */
9
- export function normalizeToolResult(toolResult, role) {
10
- const promptPayload = cloneToolResult(toolResult);
11
- return {
12
- prompt: promptPayload,
13
- message: {
14
- role,
15
- content: [
16
- {
17
- type: "tool-result",
18
- toolCallId: promptPayload.toolCallId,
19
- toolName: promptPayload.toolName,
20
- result: promptPayload.result,
21
- ...(promptPayload.error !== undefined && { error: promptPayload.error }),
22
- },
23
- ],
24
- },
25
- };
26
- }
27
- //# sourceMappingURL=normalizeToolResult.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalizeToolResult.js","sourceRoot":"","sources":["../../../../src/prompt/utils/normalizeToolResult.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAC/B,UAA0B,EAC1B,IAAgB;IAKhB,MAAM,aAAa,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;IAElD,OAAO;QACH,MAAM,EAAE,aAAa;QACrB,OAAO,EAAE;YACL,IAAI;YACJ,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,aAAa;oBACnB,UAAU,EAAE,aAAa,CAAC,UAAU;oBACpC,QAAQ,EAAE,aAAa,CAAC,QAAQ;oBAChC,MAAM,EAAE,aAAa,CAAC,MAAM;oBAC5B,GAAG,CAAC,aAAa,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,aAAa,CAAC,KAAK,EAAE,CAAC;iBAC3E;aACJ;SACJ;KACJ,CAAC;AACN,CAAC"}