@illalabs/sdk 0.1.0 → 0.3.0
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 +258 -0
- package/dist/src/chat/Chat.d.ts +3 -0
- package/dist/src/chat/Chat.d.ts.map +1 -1
- package/dist/src/chat/Chat.js +14 -2
- package/dist/src/chat/Chat.js.map +1 -1
- package/dist/src/chat/errors/UserContextMissing.d.ts +10 -0
- package/dist/src/chat/errors/UserContextMissing.d.ts.map +1 -0
- package/dist/src/chat/errors/UserContextMissing.js +13 -0
- package/dist/src/chat/errors/UserContextMissing.js.map +1 -0
- package/dist/src/chat/errors/index.d.ts +1 -0
- package/dist/src/chat/errors/index.d.ts.map +1 -1
- package/dist/src/chat/errors/index.js +1 -0
- package/dist/src/chat/errors/index.js.map +1 -1
- package/dist/src/external.d.ts +2 -9
- package/dist/src/external.d.ts.map +1 -1
- package/dist/src/external.js +2 -8
- package/dist/src/external.js.map +1 -1
- package/dist/src/interfaces/chat.interface.d.ts +12 -2
- package/dist/src/interfaces/chat.interface.d.ts.map +1 -1
- package/dist/src/interfaces/coreApiProvider.interface.d.ts +7 -1
- package/dist/src/interfaces/coreApiProvider.interface.d.ts.map +1 -1
- package/dist/src/internal.d.ts +2 -1
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +2 -1
- package/dist/src/internal.js.map +1 -1
- package/dist/src/providers/coreApiProvider/CoreApiErrorHandler.d.ts +13 -0
- package/dist/src/providers/coreApiProvider/CoreApiErrorHandler.d.ts.map +1 -0
- package/dist/src/providers/coreApiProvider/CoreApiErrorHandler.js +67 -0
- package/dist/src/providers/coreApiProvider/CoreApiErrorHandler.js.map +1 -0
- package/dist/src/providers/coreApiProvider/CoreApiProvider.d.ts +9 -2
- package/dist/src/providers/coreApiProvider/CoreApiProvider.d.ts.map +1 -1
- package/dist/src/providers/coreApiProvider/CoreApiProvider.js +40 -36
- package/dist/src/providers/coreApiProvider/CoreApiProvider.js.map +1 -1
- package/dist/src/providers/coreApiProvider/errors/CoreApiAuthenticationMissing.d.ts +2 -4
- package/dist/src/providers/coreApiProvider/errors/CoreApiAuthenticationMissing.d.ts.map +1 -1
- package/dist/src/providers/coreApiProvider/errors/CoreApiAuthenticationMissing.js +7 -6
- package/dist/src/providers/coreApiProvider/errors/CoreApiAuthenticationMissing.js.map +1 -1
- package/dist/src/providers/coreApiProvider/index.d.ts +2 -3
- package/dist/src/providers/coreApiProvider/index.d.ts.map +1 -1
- package/dist/src/providers/coreApiProvider/index.js.map +1 -1
- package/dist/src/providers/coreApiProvider/{CoreApiProviderConfig.d.ts → interfaces/CoreApiProviderConfig.interface.d.ts} +7 -2
- package/dist/src/providers/coreApiProvider/interfaces/CoreApiProviderConfig.interface.d.ts.map +1 -0
- package/dist/src/providers/coreApiProvider/interfaces/CoreApiProviderConfig.interface.js +2 -0
- package/dist/src/providers/coreApiProvider/interfaces/CoreApiProviderConfig.interface.js.map +1 -0
- package/dist/src/providers/coreApiProvider/interfaces/CoreApiProviderRoutes.interface.d.ts +14 -0
- package/dist/src/providers/coreApiProvider/interfaces/CoreApiProviderRoutes.interface.d.ts.map +1 -0
- package/dist/src/providers/coreApiProvider/interfaces/CoreApiProviderRoutes.interface.js +2 -0
- package/dist/src/providers/coreApiProvider/interfaces/CoreApiProviderRoutes.interface.js.map +1 -0
- package/dist/src/providers/coreApiProvider/interfaces/index.d.ts +3 -0
- package/dist/src/providers/coreApiProvider/interfaces/index.d.ts.map +1 -0
- package/dist/src/providers/coreApiProvider/interfaces/index.js +2 -0
- package/dist/src/providers/coreApiProvider/interfaces/index.js.map +1 -0
- package/dist/src/providers/coreApiProvider/types.d.ts +9 -0
- package/dist/src/providers/coreApiProvider/types.d.ts.map +1 -1
- package/dist/src/sdk.d.ts +289 -0
- package/dist/src/sdk.d.ts.map +1 -0
- package/dist/src/sdk.js +288 -0
- package/dist/src/sdk.js.map +1 -0
- package/package.json +9 -3
- package/dist/src/providers/coreApiProvider/CoreApiProviderConfig.d.ts.map +0 -1
- package/dist/src/providers/coreApiProvider/CoreApiProviderConfig.js +0 -2
- package/dist/src/providers/coreApiProvider/CoreApiProviderConfig.js.map +0 -1
- package/dist/src/providers/coreApiProvider/RequestOptions.d.ts +0 -10
- package/dist/src/providers/coreApiProvider/RequestOptions.d.ts.map +0 -1
- package/dist/src/providers/coreApiProvider/RequestOptions.js +0 -2
- package/dist/src/providers/coreApiProvider/RequestOptions.js.map +0 -1
package/dist/src/sdk.js
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
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
|
+
personalityContext: options.personalityContext,
|
|
167
|
+
});
|
|
168
|
+
this.chats.set(chat.getId(), chat);
|
|
169
|
+
return chat;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Sends a message to a chat session. This is the primary method for interacting with the AI.
|
|
173
|
+
* If a chatId is provided, the message will be sent to the existing chat.
|
|
174
|
+
* If a chatId is not provided, a new chat will be created with the provided userContext.
|
|
175
|
+
*
|
|
176
|
+
* @param msg - The message text to send
|
|
177
|
+
* @param context - Context containing either chatId for existing chat or userContext for new chat
|
|
178
|
+
* @returns {Promise<SendMessageResult>} The AI's response including chat ID, response text, and any pending tools
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* ```typescript
|
|
182
|
+
* const sdk = new IllaSDK({ apiKey: 'your-api-key' });
|
|
183
|
+
*
|
|
184
|
+
* // Start a new conversation
|
|
185
|
+
* const result1 = await sdk.sendMessage(
|
|
186
|
+
* "What can you help me with?",
|
|
187
|
+
* { userContext: { address: "0x1234..." } }
|
|
188
|
+
* );
|
|
189
|
+
* console.log(result1.response.text);
|
|
190
|
+
* console.log("Chat ID:", result1.chatId);
|
|
191
|
+
*
|
|
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
|
+
* );
|
|
197
|
+
*
|
|
198
|
+
* // Check if there are tools to execute
|
|
199
|
+
* if (result2.response.pendingTools && result2.response.pendingTools.length > 0) {
|
|
200
|
+
* console.log("Tool to execute:", result2.response.pendingTools[0]);
|
|
201
|
+
* }
|
|
202
|
+
* ```
|
|
203
|
+
*/
|
|
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 }));
|
|
207
|
+
}
|
|
208
|
+
if (!context.userContext) {
|
|
209
|
+
throw new UserContextMissing();
|
|
210
|
+
}
|
|
211
|
+
const chat = this.createChat({ userContext: context.userContext });
|
|
212
|
+
this.chats.set(chat.getId(), chat);
|
|
213
|
+
return chat.sendMessage(new Prompt({ text: msg }));
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Sends the result of a tool execution back to the AI. This method is used to complete
|
|
217
|
+
* the tool execution loop when the AI requests a tool to be executed.
|
|
218
|
+
*
|
|
219
|
+
* @param chatId - The ID of the chat to send the tool result to
|
|
220
|
+
* @param toolResult - The result of the tool execution
|
|
221
|
+
* @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
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* ```typescript
|
|
226
|
+
* const sdk = new IllaSDK({ apiKey: 'your-api-key' });
|
|
227
|
+
*
|
|
228
|
+
* // Start a conversation that will request a tool execution
|
|
229
|
+
* const result1 = await sdk.sendMessage(
|
|
230
|
+
* "Swap 1 ETH for USDC on Base",
|
|
231
|
+
* { userContext: { address: "0x1234..." } }
|
|
232
|
+
* );
|
|
233
|
+
*
|
|
234
|
+
* // Check if there are pending tools to execute
|
|
235
|
+
* if (result1.response.pendingTools && result1.response.pendingTools.length > 0) {
|
|
236
|
+
* const tool = result1.response.pendingTools[0];
|
|
237
|
+
*
|
|
238
|
+
* // Execute the tool (e.g., send a transaction)
|
|
239
|
+
* const executionResult = await executeTool(tool);
|
|
240
|
+
*
|
|
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);
|
|
250
|
+
* console.log(result2.response.text); // ILLA's response after processing the tool result
|
|
251
|
+
* }
|
|
252
|
+
* ```
|
|
253
|
+
*/
|
|
254
|
+
async sendToolResult(chatId, toolResult) {
|
|
255
|
+
if (this.chats.get(chatId) === undefined) {
|
|
256
|
+
throw new ChatNotFound(chatId);
|
|
257
|
+
}
|
|
258
|
+
return await this.chats.get(chatId).sendMessage(new Prompt({ toolResult }));
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Gets the messages for a given chat ID.
|
|
262
|
+
*
|
|
263
|
+
* @param chatId - The ID of the chat to get the messages for
|
|
264
|
+
* @returns {Promise<MessageHistoryType>} The messages for the chat
|
|
265
|
+
* @throws {ChatNotFound} If the chat with the specified chatId is not found
|
|
266
|
+
*/
|
|
267
|
+
async getMessages(chatId) {
|
|
268
|
+
const chat = this.chats.get(chatId);
|
|
269
|
+
if (!chat) {
|
|
270
|
+
throw new ChatNotFound(chatId);
|
|
271
|
+
}
|
|
272
|
+
return chat.messages;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Exports the public API of the SDK.
|
|
277
|
+
* A user could import IllaSDK as a single entry point to the SDK.
|
|
278
|
+
* Or they could import the individual components of the SDK for advanced usage.
|
|
279
|
+
*/
|
|
280
|
+
export { IllaSDK, ChatNotFound };
|
|
281
|
+
export { InMemoryCache } from "./caching/index.js";
|
|
282
|
+
export { Prompt } from "./prompt/index.js";
|
|
283
|
+
export { Chat } from "./chat/index.js";
|
|
284
|
+
export { ContextManager } from "./context/index.js";
|
|
285
|
+
export { AsyncToolChecker } from "./asyncToolChecker/index.js";
|
|
286
|
+
export { CoreApiProvider } from "./providers/index.js";
|
|
287
|
+
export { UserContextMissing } from "./chat/errors/index.js";
|
|
288
|
+
//# sourceMappingURL=sdk.js.map
|
|
@@ -0,0 +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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AI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC;QACD,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC,WAAW,CAAC,IAAI,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;IACjF,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,WAAW,CAAC,MAAc;QACnC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,MAAM,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,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
|
+
"version": "0.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "TypeScript SDK for interacting with Illa's Core API",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,12 +23,16 @@
|
|
|
23
23
|
"axios": "1.12.2",
|
|
24
24
|
"uuid": "13.0.0",
|
|
25
25
|
"viem": "2.37.13",
|
|
26
|
-
"@illalabs/interfaces": "0.
|
|
26
|
+
"@illalabs/interfaces": "0.2.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"zod": "4.1.12"
|
|
27
30
|
},
|
|
28
31
|
"publishConfig": {
|
|
29
32
|
"access": "public"
|
|
30
33
|
},
|
|
31
34
|
"scripts": {
|
|
35
|
+
"anvil": "./scripts/start-anvil.sh",
|
|
32
36
|
"build": "tsc -p tsconfig.build.json",
|
|
33
37
|
"check-types": "tsc --noEmit -p tsconfig.json",
|
|
34
38
|
"clean": "rm -rf dist",
|
|
@@ -37,6 +41,8 @@
|
|
|
37
41
|
"lint": "eslint \"{src,test}/**/*.{ts,js,json}\"",
|
|
38
42
|
"lint:fix": "pnpm lint --fix",
|
|
39
43
|
"test": "vitest run --config vitest.config.ts --passWithNoTests",
|
|
40
|
-
"test:cov": "vitest run --config vitest.config.ts --coverage"
|
|
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"
|
|
41
47
|
}
|
|
42
48
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CoreApiProviderConfig.d.ts","sourceRoot":"","sources":["../../../../src/providers/coreApiProvider/CoreApiProviderConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAEtC;;OAEG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CAClD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CoreApiProviderConfig.js","sourceRoot":"","sources":["../../../../src/providers/coreApiProvider/CoreApiProviderConfig.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequestOptions.d.ts","sourceRoot":"","sources":["../../../../src/providers/coreApiProvider/RequestOptions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CACjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequestOptions.js","sourceRoot":"","sources":["../../../../src/providers/coreApiProvider/RequestOptions.ts"],"names":[],"mappings":""}
|