@illalabs/sdk 0.0.0 → 0.1.0-canary.9fc2c20f

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 (221) hide show
  1. package/LICENSE +17 -2
  2. package/README.md +256 -1
  3. package/dist/src/asyncToolChecker/AsyncToolChecker.d.ts +39 -0
  4. package/dist/src/asyncToolChecker/AsyncToolChecker.d.ts.map +1 -0
  5. package/dist/src/asyncToolChecker/AsyncToolChecker.js +209 -0
  6. package/dist/src/asyncToolChecker/AsyncToolChecker.js.map +1 -0
  7. package/dist/src/asyncToolChecker/errors/AsyncToolCheckerMaxRetriesExceeded.d.ts +23 -0
  8. package/dist/src/asyncToolChecker/errors/AsyncToolCheckerMaxRetriesExceeded.d.ts.map +1 -0
  9. package/dist/src/asyncToolChecker/errors/AsyncToolCheckerMaxRetriesExceeded.js +30 -0
  10. package/dist/src/asyncToolChecker/errors/AsyncToolCheckerMaxRetriesExceeded.js.map +1 -0
  11. package/dist/src/asyncToolChecker/errors/AsyncToolCheckerMethodNotImplemented.d.ts +17 -0
  12. package/dist/src/asyncToolChecker/errors/AsyncToolCheckerMethodNotImplemented.d.ts.map +1 -0
  13. package/dist/src/asyncToolChecker/errors/AsyncToolCheckerMethodNotImplemented.js +26 -0
  14. package/dist/src/asyncToolChecker/errors/AsyncToolCheckerMethodNotImplemented.js.map +1 -0
  15. package/dist/src/asyncToolChecker/errors/AsyncToolCheckerTimeout.d.ts +17 -0
  16. package/dist/src/asyncToolChecker/errors/AsyncToolCheckerTimeout.d.ts.map +1 -0
  17. package/dist/src/asyncToolChecker/errors/AsyncToolCheckerTimeout.js +21 -0
  18. package/dist/src/asyncToolChecker/errors/AsyncToolCheckerTimeout.js.map +1 -0
  19. package/dist/src/asyncToolChecker/errors/index.d.ts +4 -0
  20. package/dist/src/asyncToolChecker/errors/index.d.ts.map +1 -0
  21. package/dist/src/asyncToolChecker/errors/index.js +4 -0
  22. package/dist/src/asyncToolChecker/errors/index.js.map +1 -0
  23. package/dist/src/asyncToolChecker/index.d.ts +6 -0
  24. package/dist/src/asyncToolChecker/index.d.ts.map +1 -0
  25. package/dist/src/asyncToolChecker/index.js +5 -0
  26. package/dist/src/asyncToolChecker/index.js.map +1 -0
  27. package/dist/src/asyncToolChecker/types.d.ts +24 -0
  28. package/dist/src/asyncToolChecker/types.d.ts.map +1 -0
  29. package/dist/src/asyncToolChecker/types.js +2 -0
  30. package/dist/src/asyncToolChecker/types.js.map +1 -0
  31. package/dist/src/asyncToolChecker/utils/index.d.ts +3 -0
  32. package/dist/src/asyncToolChecker/utils/index.d.ts.map +1 -0
  33. package/dist/src/asyncToolChecker/utils/index.js +3 -0
  34. package/dist/src/asyncToolChecker/utils/index.js.map +1 -0
  35. package/dist/src/asyncToolChecker/utils/isErrorResponse.d.ts +11 -0
  36. package/dist/src/asyncToolChecker/utils/isErrorResponse.d.ts.map +1 -0
  37. package/dist/src/asyncToolChecker/utils/isErrorResponse.js +12 -0
  38. package/dist/src/asyncToolChecker/utils/isErrorResponse.js.map +1 -0
  39. package/dist/src/asyncToolChecker/utils/normalizeTimeout.d.ts +9 -0
  40. package/dist/src/asyncToolChecker/utils/normalizeTimeout.d.ts.map +1 -0
  41. package/dist/src/asyncToolChecker/utils/normalizeTimeout.js +14 -0
  42. package/dist/src/asyncToolChecker/utils/normalizeTimeout.js.map +1 -0
  43. package/dist/src/caching/InMemoryCache.d.ts +14 -0
  44. package/dist/src/caching/InMemoryCache.d.ts.map +1 -0
  45. package/dist/src/caching/InMemoryCache.js +31 -0
  46. package/dist/src/caching/InMemoryCache.js.map +1 -0
  47. package/dist/src/caching/index.d.ts +3 -0
  48. package/dist/src/caching/index.d.ts.map +1 -0
  49. package/dist/src/caching/index.js +2 -0
  50. package/dist/src/caching/index.js.map +1 -0
  51. package/dist/src/chat/Chat.d.ts +64 -0
  52. package/dist/src/chat/Chat.d.ts.map +1 -0
  53. package/dist/src/chat/Chat.js +129 -0
  54. package/dist/src/chat/Chat.js.map +1 -0
  55. package/dist/src/chat/errors/ChatAsyncToolCheckerUnavailable.d.ts +19 -0
  56. package/dist/src/chat/errors/ChatAsyncToolCheckerUnavailable.d.ts.map +1 -0
  57. package/dist/src/chat/errors/ChatAsyncToolCheckerUnavailable.js +28 -0
  58. package/dist/src/chat/errors/ChatAsyncToolCheckerUnavailable.js.map +1 -0
  59. package/dist/src/chat/errors/UserContextMissing.d.ts +10 -0
  60. package/dist/src/chat/errors/UserContextMissing.d.ts.map +1 -0
  61. package/dist/src/chat/errors/UserContextMissing.js +13 -0
  62. package/dist/src/chat/errors/UserContextMissing.js.map +1 -0
  63. package/dist/src/chat/errors/index.d.ts +3 -0
  64. package/dist/src/chat/errors/index.d.ts.map +1 -0
  65. package/dist/src/chat/errors/index.js +3 -0
  66. package/dist/src/chat/errors/index.js.map +1 -0
  67. package/dist/src/chat/index.d.ts +5 -0
  68. package/dist/src/chat/index.d.ts.map +1 -0
  69. package/dist/src/chat/index.js +3 -0
  70. package/dist/src/chat/index.js.map +1 -0
  71. package/dist/src/chat/types.d.ts +9 -0
  72. package/dist/src/chat/types.d.ts.map +1 -0
  73. package/dist/src/chat/types.js +2 -0
  74. package/dist/src/chat/types.js.map +1 -0
  75. package/dist/src/chat/utils/index.d.ts +2 -0
  76. package/dist/src/chat/utils/index.d.ts.map +1 -0
  77. package/dist/src/chat/utils/index.js +2 -0
  78. package/dist/src/chat/utils/index.js.map +1 -0
  79. package/dist/src/chat/utils/uuid.d.ts +12 -0
  80. package/dist/src/chat/utils/uuid.d.ts.map +1 -0
  81. package/dist/src/chat/utils/uuid.js +19 -0
  82. package/dist/src/chat/utils/uuid.js.map +1 -0
  83. package/dist/src/context/ContextManager.d.ts +26 -0
  84. package/dist/src/context/ContextManager.d.ts.map +1 -0
  85. package/dist/src/context/ContextManager.js +93 -0
  86. package/dist/src/context/ContextManager.js.map +1 -0
  87. package/dist/src/context/index.d.ts +2 -0
  88. package/dist/src/context/index.d.ts.map +1 -0
  89. package/dist/src/context/index.js +2 -0
  90. package/dist/src/context/index.js.map +1 -0
  91. package/dist/src/context/types.d.ts +17 -0
  92. package/dist/src/context/types.d.ts.map +1 -0
  93. package/dist/src/context/types.js +2 -0
  94. package/dist/src/context/types.js.map +1 -0
  95. package/dist/src/external.d.ts +7 -0
  96. package/dist/src/external.d.ts.map +1 -0
  97. package/dist/src/external.js +7 -0
  98. package/dist/src/external.js.map +1 -0
  99. package/dist/src/index.d.ts +8 -0
  100. package/dist/src/index.d.ts.map +1 -0
  101. package/dist/src/index.js +8 -0
  102. package/dist/src/index.js.map +1 -0
  103. package/dist/src/interfaces/asyncToolChecker.interface.d.ts +85 -0
  104. package/dist/src/interfaces/asyncToolChecker.interface.d.ts.map +1 -0
  105. package/dist/src/interfaces/asyncToolChecker.interface.js +2 -0
  106. package/dist/src/interfaces/asyncToolChecker.interface.js.map +1 -0
  107. package/dist/src/interfaces/cache.interface.d.ts +35 -0
  108. package/dist/src/interfaces/cache.interface.d.ts.map +1 -0
  109. package/dist/src/interfaces/cache.interface.js +2 -0
  110. package/dist/src/interfaces/cache.interface.js.map +1 -0
  111. package/dist/src/interfaces/chat.interface.d.ts +84 -0
  112. package/dist/src/interfaces/chat.interface.d.ts.map +1 -0
  113. package/dist/src/interfaces/chat.interface.js +2 -0
  114. package/dist/src/interfaces/chat.interface.js.map +1 -0
  115. package/dist/src/interfaces/contextManager.interface.d.ts +86 -0
  116. package/dist/src/interfaces/contextManager.interface.d.ts.map +1 -0
  117. package/dist/src/interfaces/contextManager.interface.js +2 -0
  118. package/dist/src/interfaces/contextManager.interface.js.map +1 -0
  119. package/dist/src/interfaces/coreApiProvider.interface.d.ts +32 -0
  120. package/dist/src/interfaces/coreApiProvider.interface.d.ts.map +1 -0
  121. package/dist/src/interfaces/coreApiProvider.interface.js +2 -0
  122. package/dist/src/interfaces/coreApiProvider.interface.js.map +1 -0
  123. package/dist/src/interfaces/index.d.ts +7 -0
  124. package/dist/src/interfaces/index.d.ts.map +1 -0
  125. package/dist/src/interfaces/index.js +2 -0
  126. package/dist/src/interfaces/index.js.map +1 -0
  127. package/dist/src/internal.d.ts +15 -0
  128. package/dist/src/internal.d.ts.map +1 -0
  129. package/dist/src/internal.js +15 -0
  130. package/dist/src/internal.js.map +1 -0
  131. package/dist/src/prompt/Prompt.d.ts +61 -0
  132. package/dist/src/prompt/Prompt.d.ts.map +1 -0
  133. package/dist/src/prompt/Prompt.js +118 -0
  134. package/dist/src/prompt/Prompt.js.map +1 -0
  135. package/dist/src/prompt/errors/PromptConfigurationConflict.d.ts +10 -0
  136. package/dist/src/prompt/errors/PromptConfigurationConflict.d.ts.map +1 -0
  137. package/dist/src/prompt/errors/PromptConfigurationConflict.js +13 -0
  138. package/dist/src/prompt/errors/PromptConfigurationConflict.js.map +1 -0
  139. package/dist/src/prompt/errors/index.d.ts +2 -0
  140. package/dist/src/prompt/errors/index.d.ts.map +1 -0
  141. package/dist/src/prompt/errors/index.js +2 -0
  142. package/dist/src/prompt/errors/index.js.map +1 -0
  143. package/dist/src/prompt/index.d.ts +4 -0
  144. package/dist/src/prompt/index.d.ts.map +1 -0
  145. package/dist/src/prompt/index.js +3 -0
  146. package/dist/src/prompt/index.js.map +1 -0
  147. package/dist/src/prompt/types.d.ts +57 -0
  148. package/dist/src/prompt/types.d.ts.map +1 -0
  149. package/dist/src/prompt/types.js +2 -0
  150. package/dist/src/prompt/types.js.map +1 -0
  151. package/dist/src/prompt/utils/cloneToolResult.d.ts +12 -0
  152. package/dist/src/prompt/utils/cloneToolResult.d.ts.map +1 -0
  153. package/dist/src/prompt/utils/cloneToolResult.js +28 -0
  154. package/dist/src/prompt/utils/cloneToolResult.js.map +1 -0
  155. package/dist/src/prompt/utils/deepClone.d.ts +9 -0
  156. package/dist/src/prompt/utils/deepClone.d.ts.map +1 -0
  157. package/dist/src/prompt/utils/deepClone.js +15 -0
  158. package/dist/src/prompt/utils/deepClone.js.map +1 -0
  159. package/dist/src/prompt/utils/index.d.ts +5 -0
  160. package/dist/src/prompt/utils/index.d.ts.map +1 -0
  161. package/dist/src/prompt/utils/index.js +5 -0
  162. package/dist/src/prompt/utils/index.js.map +1 -0
  163. package/dist/src/prompt/utils/normalizeTextPrompt.d.ts +14 -0
  164. package/dist/src/prompt/utils/normalizeTextPrompt.d.ts.map +1 -0
  165. package/dist/src/prompt/utils/normalizeTextPrompt.js +22 -0
  166. package/dist/src/prompt/utils/normalizeTextPrompt.js.map +1 -0
  167. package/dist/src/prompt/utils/normalizeToolResult.d.ts +14 -0
  168. package/dist/src/prompt/utils/normalizeToolResult.d.ts.map +1 -0
  169. package/dist/src/prompt/utils/normalizeToolResult.js +27 -0
  170. package/dist/src/prompt/utils/normalizeToolResult.js.map +1 -0
  171. package/dist/src/providers/coreApiProvider/CoreApiErrorHandler.d.ts +13 -0
  172. package/dist/src/providers/coreApiProvider/CoreApiErrorHandler.d.ts.map +1 -0
  173. package/dist/src/providers/coreApiProvider/CoreApiErrorHandler.js +67 -0
  174. package/dist/src/providers/coreApiProvider/CoreApiErrorHandler.js.map +1 -0
  175. package/dist/src/providers/coreApiProvider/CoreApiProvider.d.ts +42 -0
  176. package/dist/src/providers/coreApiProvider/CoreApiProvider.d.ts.map +1 -0
  177. package/dist/src/providers/coreApiProvider/CoreApiProvider.js +97 -0
  178. package/dist/src/providers/coreApiProvider/CoreApiProvider.js.map +1 -0
  179. package/dist/src/providers/coreApiProvider/errors/CoreApiAuthenticationMissing.d.ts +8 -0
  180. package/dist/src/providers/coreApiProvider/errors/CoreApiAuthenticationMissing.d.ts.map +1 -0
  181. package/dist/src/providers/coreApiProvider/errors/CoreApiAuthenticationMissing.js +15 -0
  182. package/dist/src/providers/coreApiProvider/errors/CoreApiAuthenticationMissing.js.map +1 -0
  183. package/dist/src/providers/coreApiProvider/errors/CoreApiMethodNotImplemented.d.ts +9 -0
  184. package/dist/src/providers/coreApiProvider/errors/CoreApiMethodNotImplemented.d.ts.map +1 -0
  185. package/dist/src/providers/coreApiProvider/errors/CoreApiMethodNotImplemented.js +19 -0
  186. package/dist/src/providers/coreApiProvider/errors/CoreApiMethodNotImplemented.js.map +1 -0
  187. package/dist/src/providers/coreApiProvider/errors/index.d.ts +3 -0
  188. package/dist/src/providers/coreApiProvider/errors/index.d.ts.map +1 -0
  189. package/dist/src/providers/coreApiProvider/errors/index.js +3 -0
  190. package/dist/src/providers/coreApiProvider/errors/index.js.map +1 -0
  191. package/dist/src/providers/coreApiProvider/index.d.ts +6 -0
  192. package/dist/src/providers/coreApiProvider/index.d.ts.map +1 -0
  193. package/dist/src/providers/coreApiProvider/index.js +3 -0
  194. package/dist/src/providers/coreApiProvider/index.js.map +1 -0
  195. package/dist/src/providers/coreApiProvider/interfaces/CoreApiProviderConfig.interface.d.ts +29 -0
  196. package/dist/src/providers/coreApiProvider/interfaces/CoreApiProviderConfig.interface.d.ts.map +1 -0
  197. package/dist/src/providers/coreApiProvider/interfaces/CoreApiProviderConfig.interface.js +2 -0
  198. package/dist/src/providers/coreApiProvider/interfaces/CoreApiProviderConfig.interface.js.map +1 -0
  199. package/dist/src/providers/coreApiProvider/interfaces/CoreApiProviderRoutes.interface.d.ts +14 -0
  200. package/dist/src/providers/coreApiProvider/interfaces/CoreApiProviderRoutes.interface.d.ts.map +1 -0
  201. package/dist/src/providers/coreApiProvider/interfaces/CoreApiProviderRoutes.interface.js +2 -0
  202. package/dist/src/providers/coreApiProvider/interfaces/CoreApiProviderRoutes.interface.js.map +1 -0
  203. package/dist/src/providers/coreApiProvider/interfaces/index.d.ts +3 -0
  204. package/dist/src/providers/coreApiProvider/interfaces/index.d.ts.map +1 -0
  205. package/dist/src/providers/coreApiProvider/interfaces/index.js +2 -0
  206. package/dist/src/providers/coreApiProvider/interfaces/index.js.map +1 -0
  207. package/dist/src/providers/coreApiProvider/types.d.ts +16 -0
  208. package/dist/src/providers/coreApiProvider/types.d.ts.map +1 -0
  209. package/dist/src/providers/coreApiProvider/types.js +2 -0
  210. package/dist/src/providers/coreApiProvider/types.js.map +1 -0
  211. package/dist/src/providers/index.d.ts +2 -0
  212. package/dist/src/providers/index.d.ts.map +1 -0
  213. package/dist/src/providers/index.js +2 -0
  214. package/dist/src/providers/index.js.map +1 -0
  215. package/dist/src/sdk.d.ts +288 -0
  216. package/dist/src/sdk.d.ts.map +1 -0
  217. package/dist/src/sdk.js +287 -0
  218. package/dist/src/sdk.js.map +1 -0
  219. package/package.json +42 -5
  220. package/index.d.ts +0 -1
  221. package/index.js +0 -1
@@ -0,0 +1,288 @@
1
+ import type { MessageHistoryType, ToolResultType, UserContext } from "@illalabs/interfaces";
2
+ import type { CacheEntryOptions, ChatContextSnapshot, ContextManagerOptions, ICache, IContextManager, SendMessageResult } from "./internal.js";
3
+ import { Chat, ContextManager } from "./internal.js";
4
+ /**
5
+ * Configuration options for initializing the IllaSDK.
6
+ *
7
+ * @property apiKey - Your ILLA API key for authentication
8
+ * @property baseURL - Optional custom base URL for the ILLA API (defaults to production API)
9
+ */
10
+ type illaSDKConfig = {
11
+ apiKey: string;
12
+ baseURL?: string;
13
+ };
14
+ /**
15
+ * Optional configuration for the IllaSDK instance.
16
+ * You can either provide a custom cache and context manager options,
17
+ * or provide a complete custom context manager implementation.
18
+ *
19
+ * @property cache - Optional custom cache implementation (used with contextManagerOptions)
20
+ * @property contextManagerOptions - Optional configuration for the default context manager
21
+ * @property contextManager - Optional custom context manager implementation (mutually exclusive with cache/contextManagerOptions)
22
+ */
23
+ type illaSDKOptions = {
24
+ cache?: ICache;
25
+ contextManagerOptions?: ContextManagerOptions;
26
+ contextManager?: never;
27
+ } | {
28
+ contextManager: IContextManager;
29
+ cache?: never;
30
+ contextManagerOptions?: never;
31
+ };
32
+ /**
33
+ * Options for creating a new chat instance.
34
+ *
35
+ * @property userContext - The user's context information { address: `0x${string}` }
36
+ * @property id - Optional custom ID for the chat. If not provided, a UUID will be generated
37
+ */
38
+ type ChatOptions = {
39
+ userContext: UserContext;
40
+ id?: string;
41
+ };
42
+ /**
43
+ * Context for sending a message. Requires either a chatId (to use an existing chat)
44
+ * or a userContext (to create a new chat).
45
+ *
46
+ * @property chatId - ID of an existing chat to send the message to
47
+ * @property userContext - User context for creating a new chat (required if chatId is not provided)
48
+ */
49
+ type SendMessageContext = {
50
+ chatId: string;
51
+ userContext?: never;
52
+ } | {
53
+ chatId?: never;
54
+ userContext: UserContext;
55
+ };
56
+ /**
57
+ * Error raised when attempting to interact with a chat that doesn't exist.
58
+ *
59
+ * This typically occurs when using an invalid or expired chat ID with methods
60
+ * like {@link IllaSDK.sendToolResult}.
61
+ */
62
+ declare class ChatNotFound extends Error {
63
+ /**
64
+ * The ID of the chat that was not found.
65
+ */
66
+ readonly chatId: string;
67
+ /**
68
+ * Creates a new {@link ChatNotFound} instance.
69
+ *
70
+ * @param chatId The ID of the chat that was not found.
71
+ * @param options Error options for error chaining.
72
+ */
73
+ constructor(chatId: string, options?: ErrorOptions);
74
+ }
75
+ /**
76
+ * The main entry point for interacting with the ILLA AI SDK.
77
+ * This class provides methods for creating and managing chat sessions,
78
+ * sending messages, handling tool results, and configuring async tool checkers.
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * import { IllaSDK } from '@illalabs/sdk';
83
+ *
84
+ * const sdk = new IllaSDK({
85
+ * apiKey: 'your-api-key'
86
+ * });
87
+ *
88
+ * // Start a conversation
89
+ * const result = await sdk.sendMessage(
90
+ * "What can you help me with?",
91
+ * { userContext: { address: "0x1234..." } }
92
+ * );
93
+ *
94
+ * console.log(result.response.text);
95
+ * ```
96
+ */
97
+ declare class IllaSDK {
98
+ private coreApiProvider;
99
+ private contextManager;
100
+ private chats;
101
+ /**
102
+ * Creates a new instance of the IllaSDK.
103
+ *
104
+ * @param config - Configuration object containing API key and optional base URL
105
+ * @param options - Optional configuration for cache and context manager
106
+ *
107
+ * @example
108
+ * ```typescript
109
+ * // Basic initialization
110
+ * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
111
+ *
112
+ * // With custom cache
113
+ * const cache = new InMemoryCache();
114
+ * const sdk = new IllaSDK(
115
+ * { apiKey: 'your-api-key' },
116
+ * { cache }
117
+ * );
118
+ *
119
+ * // With custom context manager
120
+ * const contextManager = new ContextManager(cache, { defaultToolsConfig: { autoRouter: { swapOrBridge: 'lifi' } } });
121
+ * const sdk = new IllaSDK(
122
+ * { apiKey: 'your-api-key' },
123
+ * { contextManager }
124
+ * );
125
+ * ```
126
+ */
127
+ constructor(config: illaSDKConfig, options?: illaSDKOptions);
128
+ /**
129
+ * Gets an array of all active chat IDs managed by this SDK instance.
130
+ *
131
+ * @returns {string[]} Array of chat IDs
132
+ *
133
+ * @example
134
+ * ```typescript
135
+ * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
136
+ *
137
+ * await sdk.sendMessage("Hello", { userContext: { address: "0x123" } });
138
+ * await sdk.sendMessage("Hi", { userContext: { address: "0x456" } });
139
+ *
140
+ * const chatIds = sdk.chatIds;
141
+ * console.log(chatIds); // ['chat-id-1', 'chat-id-2']
142
+ * ```
143
+ */
144
+ get chatIds(): string[];
145
+ /**
146
+ * Creates a new ContextManager instance. This is a factory method for creating
147
+ * context managers with custom configurations.
148
+ *
149
+ * @param cache - The cache implementation to use for storing context
150
+ * @param options - Configuration options for the context manager
151
+ * @returns {ContextManager} A new ContextManager instance
152
+ *
153
+ * @example
154
+ * ```typescript
155
+ * const cache = new InMemoryCache();
156
+ * const contextManager = IllaSDK.createNewContextManager(cache, {
157
+ * defaultToolsConfig: {
158
+ * autoRouter: { swapOrBridge: 'lifi' }
159
+ * }
160
+ * });
161
+ *
162
+ * const sdk = new IllaSDK(
163
+ * { apiKey: 'your-api-key' },
164
+ * { contextManager }
165
+ * );
166
+ * ```
167
+ */
168
+ static createNewContextManager(cache: ICache, options: ContextManagerOptions): ContextManager;
169
+ /**
170
+ * Creates a new Chat instance with the specified options.
171
+ * The chat is automatically registered with this SDK instance.
172
+ *
173
+ * @param options - Options for creating the chat, including user context and optional ID
174
+ * @param contextManager - Optional custom context manager for this chat. If not provided, uses the SDK's default
175
+ * @returns {Chat} A new Chat instance
176
+ *
177
+ * @example
178
+ * ```typescript
179
+ * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
180
+ *
181
+ * // Create a new chat
182
+ * const chat = sdk.createChat({
183
+ * userContext: { address: "0x1234..." }
184
+ * });
185
+ *
186
+ * // Send messages directly through the chat instance
187
+ * const result = await chat.sendMessage(new Prompt({ text: "Hello!" }));
188
+ * ```
189
+ */
190
+ createChat(options: ChatOptions, contextManager?: ContextManager): Chat;
191
+ /**
192
+ * Sends a message to a chat session. This is the primary method for interacting with the AI.
193
+ * If a chatId is provided, the message will be sent to the existing chat.
194
+ * If a chatId is not provided, a new chat will be created with the provided userContext.
195
+ *
196
+ * @param msg - The message text to send
197
+ * @param context - Context containing either chatId for existing chat or userContext for new chat
198
+ * @returns {Promise<SendMessageResult>} The AI's response including chat ID, response text, and any pending tools
199
+ *
200
+ * @example
201
+ * ```typescript
202
+ * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
203
+ *
204
+ * // Start a new conversation
205
+ * const result1 = await sdk.sendMessage(
206
+ * "What can you help me with?",
207
+ * { userContext: { address: "0x1234..." } }
208
+ * );
209
+ * console.log(result1.response.text);
210
+ * console.log("Chat ID:", result1.chatId);
211
+ *
212
+ * // Continue the conversation using the chat ID
213
+ * const result2 = await sdk.sendMessage(
214
+ * "I want to swap 1 ETH for USDC on Base",
215
+ * { chatId: result1.chatId }
216
+ * );
217
+ *
218
+ * // Check if there are tools to execute
219
+ * if (result2.response.pendingTools && result2.response.pendingTools.length > 0) {
220
+ * console.log("Tool to execute:", result2.response.pendingTools[0]);
221
+ * }
222
+ * ```
223
+ */
224
+ sendMessage(msg: string, context: SendMessageContext): Promise<SendMessageResult>;
225
+ /**
226
+ * Sends the result of a tool execution back to the AI. This method is used to complete
227
+ * the tool execution loop when the AI requests a tool to be executed.
228
+ *
229
+ * @param chatId - The ID of the chat to send the tool result to
230
+ * @param toolResult - The result of the tool execution
231
+ * @returns {Promise<SendMessageResult>} The AI's response after processing the tool result
232
+ * @throws {Error} If the chat with the specified chatId is not found
233
+ *
234
+ * @example
235
+ * ```typescript
236
+ * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
237
+ *
238
+ * // Start a conversation that will request a tool execution
239
+ * const result1 = await sdk.sendMessage(
240
+ * "Swap 1 ETH for USDC on Base",
241
+ * { userContext: { address: "0x1234..." } }
242
+ * );
243
+ *
244
+ * // Check if there are pending tools to execute
245
+ * if (result1.response.pendingTools && result1.response.pendingTools.length > 0) {
246
+ * const tool = result1.response.pendingTools[0];
247
+ *
248
+ * // Execute the tool (e.g., send a transaction)
249
+ * const executionResult = await executeTool(tool);
250
+ *
251
+ * // Send the result back to the ILLA
252
+ * const toolResult: ToolResultType = {
253
+ * toolCallId: tool.toolCallId,
254
+ * toolName: tool.toolName,
255
+ * result?: executionResult,
256
+ * error?: executionResult.error,
257
+ * };
258
+ *
259
+ * const result2 = await sdk.sendToolResult(result1.chatId, toolResult);
260
+ * console.log(result2.response.text); // ILLA's response after processing the tool result
261
+ * }
262
+ * ```
263
+ */
264
+ sendToolResult(chatId: string, toolResult: ToolResultType): Promise<SendMessageResult>;
265
+ /**
266
+ * Gets the messages for a given chat ID.
267
+ *
268
+ * @param chatId - The ID of the chat to get the messages for
269
+ * @returns {Promise<MessageHistoryType>} The messages for the chat
270
+ * @throws {ChatNotFound} If the chat with the specified chatId is not found
271
+ */
272
+ getMessages(chatId: string): Promise<MessageHistoryType>;
273
+ }
274
+ /**
275
+ * Exports the public API of the SDK.
276
+ * A user could import IllaSDK as a single entry point to the SDK.
277
+ * Or they could import the individual components of the SDK for advanced usage.
278
+ */
279
+ export { IllaSDK, ChatNotFound };
280
+ export { InMemoryCache } from "./caching/index.js";
281
+ export { Prompt } from "./prompt/index.js";
282
+ export { Chat } from "./chat/index.js";
283
+ export { ContextManager } from "./context/index.js";
284
+ export { AsyncToolChecker } from "./asyncToolChecker/index.js";
285
+ export { CoreApiProvider } from "./providers/index.js";
286
+ export { UserContextMissing } from "./chat/errors/index.js";
287
+ export type { illaSDKConfig, ChatContextSnapshot, CacheEntryOptions, ICache, IContextManager, SendMessageContext, };
288
+ //# sourceMappingURL=sdk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAE5F,OAAO,KAAK,EACR,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,MAAM,EACN,eAAe,EACf,iBAAiB,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAEH,IAAI,EACJ,cAAc,EAKjB,MAAM,eAAe,CAAC;AAEvB;;;;;GAKG;AACH,KAAK,aAAa,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;GAQG;AACH,KAAK,cAAc,GACb;IACI,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,cAAc,CAAC,EAAE,KAAK,CAAC;CAC1B,GACD;IACI,cAAc,EAAE,eAAe,CAAC;IAChC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,qBAAqB,CAAC,EAAE,KAAK,CAAC;CACjC,CAAC;AAER;;;;;GAKG;AACH,KAAK,WAAW,GAAG;IACf,WAAW,EAAE,WAAW,CAAC;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;GAMG;AACH,KAAK,kBAAkB,GACjB;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,KAAK,CAAA;CAAE,GACvC;IAAE,MAAM,CAAC,EAAE,KAAK,CAAC;IAAC,WAAW,EAAE,WAAW,CAAA;CAAE,CAAC;AAEnD;;;;;GAKG;AACH,cAAM,YAAa,SAAQ,KAAK;IAC5B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O,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;AAC5D,YAAY,EACR,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,MAAM,EACN,eAAe,EACf,kBAAkB,GACrB,CAAC"}
@@ -0,0 +1,287 @@
1
+ import { AsyncToolChecker, Chat, ContextManager, CoreApiProvider, InMemoryCache, Prompt, UserContextMissing, } from "./internal.js";
2
+ /**
3
+ * Error raised when attempting to interact with a chat that doesn't exist.
4
+ *
5
+ * This typically occurs when using an invalid or expired chat ID with methods
6
+ * like {@link IllaSDK.sendToolResult}.
7
+ */
8
+ class ChatNotFound extends Error {
9
+ /**
10
+ * The ID of the chat that was not found.
11
+ */
12
+ chatId;
13
+ /**
14
+ * Creates a new {@link ChatNotFound} instance.
15
+ *
16
+ * @param chatId The ID of the chat that was not found.
17
+ * @param options Error options for error chaining.
18
+ */
19
+ constructor(chatId, options) {
20
+ super(`Chat with ID ${chatId} not found`, options);
21
+ this.name = "ChatNotFound";
22
+ this.chatId = chatId;
23
+ }
24
+ }
25
+ /**
26
+ * The main entry point for interacting with the ILLA AI SDK.
27
+ * This class provides methods for creating and managing chat sessions,
28
+ * sending messages, handling tool results, and configuring async tool checkers.
29
+ *
30
+ * @example
31
+ * ```typescript
32
+ * import { IllaSDK } from '@illalabs/sdk';
33
+ *
34
+ * const sdk = new IllaSDK({
35
+ * apiKey: 'your-api-key'
36
+ * });
37
+ *
38
+ * // Start a conversation
39
+ * const result = await sdk.sendMessage(
40
+ * "What can you help me with?",
41
+ * { userContext: { address: "0x1234..." } }
42
+ * );
43
+ *
44
+ * console.log(result.response.text);
45
+ * ```
46
+ */
47
+ class IllaSDK {
48
+ coreApiProvider;
49
+ contextManager;
50
+ chats = new Map();
51
+ /**
52
+ * Creates a new instance of the IllaSDK.
53
+ *
54
+ * @param config - Configuration object containing API key and optional base URL
55
+ * @param options - Optional configuration for cache and context manager
56
+ *
57
+ * @example
58
+ * ```typescript
59
+ * // Basic initialization
60
+ * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
61
+ *
62
+ * // With custom cache
63
+ * const cache = new InMemoryCache();
64
+ * const sdk = new IllaSDK(
65
+ * { apiKey: 'your-api-key' },
66
+ * { cache }
67
+ * );
68
+ *
69
+ * // With custom context manager
70
+ * const contextManager = new ContextManager(cache, { defaultToolsConfig: { autoRouter: { swapOrBridge: 'lifi' } } });
71
+ * const sdk = new IllaSDK(
72
+ * { apiKey: 'your-api-key' },
73
+ * { contextManager }
74
+ * );
75
+ * ```
76
+ */
77
+ constructor(config, options) {
78
+ this.coreApiProvider = new CoreApiProvider({
79
+ baseURL: config.baseURL,
80
+ headers: {
81
+ "x-api-key": config.apiKey,
82
+ },
83
+ });
84
+ if (options && options.contextManager) {
85
+ this.contextManager = options.contextManager;
86
+ }
87
+ else {
88
+ this.contextManager = new ContextManager(options?.cache ?? new InMemoryCache(), options?.contextManagerOptions ?? {});
89
+ }
90
+ }
91
+ /**
92
+ * Gets an array of all active chat IDs managed by this SDK instance.
93
+ *
94
+ * @returns {string[]} Array of chat IDs
95
+ *
96
+ * @example
97
+ * ```typescript
98
+ * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
99
+ *
100
+ * await sdk.sendMessage("Hello", { userContext: { address: "0x123" } });
101
+ * await sdk.sendMessage("Hi", { userContext: { address: "0x456" } });
102
+ *
103
+ * const chatIds = sdk.chatIds;
104
+ * console.log(chatIds); // ['chat-id-1', 'chat-id-2']
105
+ * ```
106
+ */
107
+ get chatIds() {
108
+ return Array.from(this.chats.keys());
109
+ }
110
+ /**
111
+ * Creates a new ContextManager instance. This is a factory method for creating
112
+ * context managers with custom configurations.
113
+ *
114
+ * @param cache - The cache implementation to use for storing context
115
+ * @param options - Configuration options for the context manager
116
+ * @returns {ContextManager} A new ContextManager instance
117
+ *
118
+ * @example
119
+ * ```typescript
120
+ * const cache = new InMemoryCache();
121
+ * const contextManager = IllaSDK.createNewContextManager(cache, {
122
+ * defaultToolsConfig: {
123
+ * autoRouter: { swapOrBridge: 'lifi' }
124
+ * }
125
+ * });
126
+ *
127
+ * const sdk = new IllaSDK(
128
+ * { apiKey: 'your-api-key' },
129
+ * { contextManager }
130
+ * );
131
+ * ```
132
+ */
133
+ static createNewContextManager(cache, options) {
134
+ return new ContextManager(cache, options);
135
+ }
136
+ /**
137
+ * Creates a new Chat instance with the specified options.
138
+ * The chat is automatically registered with this SDK instance.
139
+ *
140
+ * @param options - Options for creating the chat, including user context and optional ID
141
+ * @param contextManager - Optional custom context manager for this chat. If not provided, uses the SDK's default
142
+ * @returns {Chat} A new Chat instance
143
+ *
144
+ * @example
145
+ * ```typescript
146
+ * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
147
+ *
148
+ * // Create a new chat
149
+ * const chat = sdk.createChat({
150
+ * userContext: { address: "0x1234..." }
151
+ * });
152
+ *
153
+ * // Send messages directly through the chat instance
154
+ * const result = await chat.sendMessage(new Prompt({ text: "Hello!" }));
155
+ * ```
156
+ */
157
+ createChat(options, contextManager) {
158
+ const chat = new Chat({
159
+ coreApiProvider: this.coreApiProvider,
160
+ contextManager: contextManager ?? this.contextManager,
161
+ userContext: options.userContext,
162
+ id: options.id,
163
+ asyncToolChecker: new AsyncToolChecker({
164
+ coreApiProvider: this.coreApiProvider,
165
+ }),
166
+ });
167
+ this.chats.set(chat.getId(), chat);
168
+ return chat;
169
+ }
170
+ /**
171
+ * Sends a message to a chat session. This is the primary method for interacting with the AI.
172
+ * If a chatId is provided, the message will be sent to the existing chat.
173
+ * If a chatId is not provided, a new chat will be created with the provided userContext.
174
+ *
175
+ * @param msg - The message text to send
176
+ * @param context - Context containing either chatId for existing chat or userContext for new chat
177
+ * @returns {Promise<SendMessageResult>} The AI's response including chat ID, response text, and any pending tools
178
+ *
179
+ * @example
180
+ * ```typescript
181
+ * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
182
+ *
183
+ * // Start a new conversation
184
+ * const result1 = await sdk.sendMessage(
185
+ * "What can you help me with?",
186
+ * { userContext: { address: "0x1234..." } }
187
+ * );
188
+ * console.log(result1.response.text);
189
+ * console.log("Chat ID:", result1.chatId);
190
+ *
191
+ * // Continue the conversation using the chat ID
192
+ * const result2 = await sdk.sendMessage(
193
+ * "I want to swap 1 ETH for USDC on Base",
194
+ * { chatId: result1.chatId }
195
+ * );
196
+ *
197
+ * // Check if there are tools to execute
198
+ * if (result2.response.pendingTools && result2.response.pendingTools.length > 0) {
199
+ * console.log("Tool to execute:", result2.response.pendingTools[0]);
200
+ * }
201
+ * ```
202
+ */
203
+ sendMessage(msg, context) {
204
+ if (context.chatId && this.chats.get(context.chatId) !== undefined) {
205
+ return this.chats.get(context.chatId).sendMessage(new Prompt({ text: msg }));
206
+ }
207
+ if (!context.userContext) {
208
+ throw new UserContextMissing();
209
+ }
210
+ const chat = this.createChat({ userContext: context.userContext });
211
+ this.chats.set(chat.getId(), chat);
212
+ return chat.sendMessage(new Prompt({ text: msg }));
213
+ }
214
+ /**
215
+ * Sends the result of a tool execution back to the AI. This method is used to complete
216
+ * the tool execution loop when the AI requests a tool to be executed.
217
+ *
218
+ * @param chatId - The ID of the chat to send the tool result to
219
+ * @param toolResult - The result of the tool execution
220
+ * @returns {Promise<SendMessageResult>} The AI's response after processing the tool result
221
+ * @throws {Error} If the chat with the specified chatId is not found
222
+ *
223
+ * @example
224
+ * ```typescript
225
+ * const sdk = new IllaSDK({ apiKey: 'your-api-key' });
226
+ *
227
+ * // Start a conversation that will request a tool execution
228
+ * const result1 = await sdk.sendMessage(
229
+ * "Swap 1 ETH for USDC on Base",
230
+ * { userContext: { address: "0x1234..." } }
231
+ * );
232
+ *
233
+ * // Check if there are pending tools to execute
234
+ * if (result1.response.pendingTools && result1.response.pendingTools.length > 0) {
235
+ * const tool = result1.response.pendingTools[0];
236
+ *
237
+ * // Execute the tool (e.g., send a transaction)
238
+ * const executionResult = await executeTool(tool);
239
+ *
240
+ * // Send the result back to the ILLA
241
+ * const toolResult: ToolResultType = {
242
+ * toolCallId: tool.toolCallId,
243
+ * toolName: tool.toolName,
244
+ * result?: executionResult,
245
+ * error?: executionResult.error,
246
+ * };
247
+ *
248
+ * const result2 = await sdk.sendToolResult(result1.chatId, toolResult);
249
+ * console.log(result2.response.text); // ILLA's response after processing the tool result
250
+ * }
251
+ * ```
252
+ */
253
+ async sendToolResult(chatId, toolResult) {
254
+ if (this.chats.get(chatId) === undefined) {
255
+ throw new ChatNotFound(chatId);
256
+ }
257
+ return await this.chats.get(chatId).sendMessage(new Prompt({ toolResult }));
258
+ }
259
+ /**
260
+ * Gets the messages for a given chat ID.
261
+ *
262
+ * @param chatId - The ID of the chat to get the messages for
263
+ * @returns {Promise<MessageHistoryType>} The messages for the chat
264
+ * @throws {ChatNotFound} If the chat with the specified chatId is not found
265
+ */
266
+ async getMessages(chatId) {
267
+ const chat = this.chats.get(chatId);
268
+ if (!chat) {
269
+ throw new ChatNotFound(chatId);
270
+ }
271
+ return chat.messages;
272
+ }
273
+ }
274
+ /**
275
+ * Exports the public API of the SDK.
276
+ * A user could import IllaSDK as a single entry point to the SDK.
277
+ * Or they could import the individual components of the SDK for advanced usage.
278
+ */
279
+ export { IllaSDK, ChatNotFound };
280
+ export { InMemoryCache } from "./caching/index.js";
281
+ export { Prompt } from "./prompt/index.js";
282
+ export { Chat } from "./chat/index.js";
283
+ export { ContextManager } from "./context/index.js";
284
+ export { AsyncToolChecker } from "./asyncToolChecker/index.js";
285
+ export { CoreApiProvider } from "./providers/index.js";
286
+ export { UserContextMissing } from "./chat/errors/index.js";
287
+ //# sourceMappingURL=sdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"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MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC"}
package/package.json CHANGED
@@ -1,11 +1,48 @@
1
1
  {
2
2
  "name": "@illalabs/sdk",
3
- "version": "0.0.0",
4
- "description": "Placeholder package. Real code coming soon.",
3
+ "version": "0.1.0-canary.9fc2c20f",
4
+ "private": false,
5
+ "description": "TypeScript SDK for interacting with Illa's Core API",
5
6
  "license": "MIT",
6
- "main": "index.js",
7
- "types": "index.d.ts",
7
+ "author": "Wonderland",
8
+ "type": "module",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/src/index.d.ts",
12
+ "default": "./dist/src/index.js"
13
+ }
14
+ },
15
+ "main": "./dist/src/index.js",
16
+ "types": "./dist/src/index.d.ts",
17
+ "files": [
18
+ "dist",
19
+ "package.json",
20
+ "!**/*.tsbuildinfo"
21
+ ],
22
+ "dependencies": {
23
+ "axios": "1.12.2",
24
+ "uuid": "13.0.0",
25
+ "viem": "2.37.13",
26
+ "@illalabs/interfaces": "0.1.0-canary.9fc2c20f"
27
+ },
28
+ "devDependencies": {
29
+ "zod": "4.1.12"
30
+ },
8
31
  "publishConfig": {
9
32
  "access": "public"
33
+ },
34
+ "scripts": {
35
+ "anvil": "./scripts/start-anvil.sh",
36
+ "build": "tsc -p tsconfig.build.json",
37
+ "check-types": "tsc --noEmit -p tsconfig.json",
38
+ "clean": "rm -rf dist",
39
+ "format": "prettier --check \"{src,test}/**/*.{ts,js,json}\"",
40
+ "format:fix": "prettier --write \"{src,test}/**/*.{ts,js,json}\"",
41
+ "lint": "eslint \"{src,test}/**/*.{ts,js,json}\"",
42
+ "lint:fix": "pnpm lint --fix",
43
+ "test": "vitest run --config vitest.config.ts --passWithNoTests",
44
+ "test:cov": "vitest run --config vitest.config.ts --coverage",
45
+ "test:e2e": "vitest run --config vitest.e2e.config.ts",
46
+ "test:e2e:anvil": "./scripts/test-with-anvil.sh"
10
47
  }
11
- }
48
+ }
package/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
package/index.js DELETED
@@ -1 +0,0 @@
1
- export {};