@sovant/sdk 1.0.0 → 1.0.2
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/LICENSE +1 -1
- package/README.md +17 -357
- package/dist/index.d.ts +45 -367
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +101 -458
- package/dist/index.js.map +1 -0
- package/package.json +20 -38
- package/dist/index.d.mts +0 -369
- package/dist/index.mjs +0 -430
package/dist/index.js
CHANGED
|
@@ -1,463 +1,106 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var index_exports = {};
|
|
22
|
-
__export(index_exports, {
|
|
23
|
-
AuthenticationError: () => AuthenticationError,
|
|
24
|
-
NetworkError: () => NetworkError,
|
|
25
|
-
NotFoundError: () => NotFoundError,
|
|
26
|
-
RateLimitError: () => RateLimitError,
|
|
27
|
-
SovantClient: () => SovantClient,
|
|
28
|
-
SovantError: () => SovantError,
|
|
29
|
-
ValidationError: () => ValidationError,
|
|
30
|
-
default: () => index_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(index_exports);
|
|
33
|
-
|
|
34
|
-
// src/errors.ts
|
|
35
|
-
var SovantError = class extends Error {
|
|
36
|
-
constructor(message, statusCode, details) {
|
|
37
|
-
super(message);
|
|
38
|
-
this.name = "SovantError";
|
|
39
|
-
this.statusCode = statusCode;
|
|
40
|
-
this.details = details;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
var AuthenticationError = class extends SovantError {
|
|
44
|
-
constructor(message = "Authentication failed") {
|
|
45
|
-
super(message, 401);
|
|
46
|
-
this.name = "AuthenticationError";
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var RateLimitError = class extends SovantError {
|
|
50
|
-
constructor(message = "Rate limit exceeded", retryAfter) {
|
|
51
|
-
super(message, 429);
|
|
52
|
-
this.name = "RateLimitError";
|
|
53
|
-
this.retryAfter = retryAfter;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
var ValidationError = class extends SovantError {
|
|
57
|
-
constructor(message = "Validation failed", errors) {
|
|
58
|
-
super(message, 400);
|
|
59
|
-
this.name = "ValidationError";
|
|
60
|
-
this.errors = errors;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
var NotFoundError = class extends SovantError {
|
|
64
|
-
constructor(message = "Resource not found") {
|
|
65
|
-
super(message, 404);
|
|
66
|
-
this.name = "NotFoundError";
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
var NetworkError = class extends SovantError {
|
|
70
|
-
constructor(message = "Network request failed") {
|
|
71
|
-
super(message);
|
|
72
|
-
this.name = "NetworkError";
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
// src/client.ts
|
|
77
|
-
var BaseClient = class {
|
|
78
|
-
constructor(config) {
|
|
79
|
-
this.config = {
|
|
80
|
-
apiKey: config.apiKey,
|
|
81
|
-
baseUrl: config.baseUrl || "https://api.sovant.ai/v1",
|
|
82
|
-
timeout: config.timeout || 3e4,
|
|
83
|
-
maxRetries: config.maxRetries || 3,
|
|
84
|
-
retryDelay: config.retryDelay || 1e3
|
|
85
|
-
};
|
|
86
|
-
if (!this.config.apiKey) {
|
|
87
|
-
throw new AuthenticationError("API key is required");
|
|
88
|
-
}
|
|
89
|
-
if (!this.config.baseUrl.startsWith("https://")) {
|
|
90
|
-
throw new SovantError("API base URL must use HTTPS for security");
|
|
1
|
+
export class Sovant {
|
|
2
|
+
apiKey;
|
|
3
|
+
baseUrl;
|
|
4
|
+
timeout;
|
|
5
|
+
constructor(opts) {
|
|
6
|
+
if (!opts?.apiKey)
|
|
7
|
+
throw new Error("Missing apiKey");
|
|
8
|
+
this.apiKey = opts.apiKey;
|
|
9
|
+
this.baseUrl = (opts.baseUrl ?? process.env.SOVANT_BASE_URL ?? "https://api.sovant.ai").replace(/\/+$/, "");
|
|
10
|
+
this.timeout = opts.timeoutMs ?? 30000;
|
|
91
11
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
if (error instanceof Error) {
|
|
121
|
-
if (error.name === "AbortError") {
|
|
122
|
-
throw new NetworkError("Request timeout");
|
|
12
|
+
async req(path, init) {
|
|
13
|
+
const ctl = new AbortController();
|
|
14
|
+
const id = setTimeout(() => ctl.abort(), this.timeout);
|
|
15
|
+
try {
|
|
16
|
+
const res = await fetch(`${this.baseUrl}${path}`, {
|
|
17
|
+
...init,
|
|
18
|
+
headers: {
|
|
19
|
+
"content-type": "application/json",
|
|
20
|
+
"authorization": `Bearer ${this.apiKey}`,
|
|
21
|
+
...(init.headers || {})
|
|
22
|
+
},
|
|
23
|
+
signal: ctl.signal
|
|
24
|
+
});
|
|
25
|
+
const text = await res.text();
|
|
26
|
+
let body;
|
|
27
|
+
try {
|
|
28
|
+
body = text ? JSON.parse(text) : undefined;
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
body = text;
|
|
32
|
+
}
|
|
33
|
+
if (!res.ok) {
|
|
34
|
+
const msg = body?.message || res.statusText;
|
|
35
|
+
const code = body?.code || `HTTP_${res.status}`;
|
|
36
|
+
throw new SovantError(msg, code, res.status, body);
|
|
37
|
+
}
|
|
38
|
+
return body;
|
|
123
39
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
return this.request(method, path, data, retryCount + 1);
|
|
40
|
+
finally {
|
|
41
|
+
clearTimeout(id);
|
|
127
42
|
}
|
|
128
|
-
throw new NetworkError(error.message);
|
|
129
|
-
}
|
|
130
|
-
throw new SovantError("Unknown error occurred");
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
async handleErrorResponse(response) {
|
|
134
|
-
let errorData;
|
|
135
|
-
try {
|
|
136
|
-
errorData = await response.json();
|
|
137
|
-
} catch {
|
|
138
|
-
errorData = {
|
|
139
|
-
error: "unknown_error",
|
|
140
|
-
message: `HTTP ${response.status} ${response.statusText}`,
|
|
141
|
-
status_code: response.status
|
|
142
|
-
};
|
|
143
43
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Delete a memory
|
|
207
|
-
*/
|
|
208
|
-
async delete(id) {
|
|
209
|
-
await this.request("DELETE", `/memory/${id}`);
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* List memories with pagination
|
|
213
|
-
*/
|
|
214
|
-
async list(options) {
|
|
215
|
-
const queryString = this.buildQueryString(options || {});
|
|
216
|
-
return this.request(
|
|
217
|
-
"GET",
|
|
218
|
-
`/memory${queryString}`
|
|
219
|
-
);
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Search memories
|
|
223
|
-
*/
|
|
224
|
-
async search(options) {
|
|
225
|
-
const queryString = this.buildQueryString({
|
|
226
|
-
q: options.query,
|
|
227
|
-
limit: options.limit,
|
|
228
|
-
offset: options.offset,
|
|
229
|
-
type: options.type,
|
|
230
|
-
tags: options.tags,
|
|
231
|
-
created_after: options.created_after,
|
|
232
|
-
created_before: options.created_before,
|
|
233
|
-
search_type: options.search_type,
|
|
234
|
-
include_archived: options.include_archived,
|
|
235
|
-
sort_by: options.sort_by,
|
|
236
|
-
sort_order: options.sort_order
|
|
237
|
-
});
|
|
238
|
-
const response = await this.request(
|
|
239
|
-
"GET",
|
|
240
|
-
`/memory/search${queryString}`
|
|
241
|
-
);
|
|
242
|
-
return response.results;
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Batch create memories
|
|
246
|
-
*/
|
|
247
|
-
async createBatch(memories) {
|
|
248
|
-
return this.request("POST", "/memory/batch", {
|
|
249
|
-
memories
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Batch delete memories
|
|
254
|
-
*/
|
|
255
|
-
async deleteBatch(ids) {
|
|
256
|
-
return this.request("POST", "/memory/batch/delete", {
|
|
257
|
-
ids
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Get memory insights and analytics
|
|
262
|
-
*/
|
|
263
|
-
async getInsights(options) {
|
|
264
|
-
const queryString = this.buildQueryString(options || {});
|
|
265
|
-
return this.request("GET", `/memory/insights${queryString}`);
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Archive a memory
|
|
269
|
-
*/
|
|
270
|
-
async archive(id) {
|
|
271
|
-
return this.update(id, { is_archived: true });
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* Unarchive a memory
|
|
275
|
-
*/
|
|
276
|
-
async unarchive(id) {
|
|
277
|
-
return this.update(id, { is_archived: false });
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Pin a memory
|
|
281
|
-
*/
|
|
282
|
-
async pin(id) {
|
|
283
|
-
return this.update(id, { is_pinned: true });
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Unpin a memory
|
|
287
|
-
*/
|
|
288
|
-
async unpin(id) {
|
|
289
|
-
return this.update(id, { is_pinned: false });
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* Get related memories
|
|
293
|
-
*/
|
|
294
|
-
async getRelated(id, options) {
|
|
295
|
-
const queryString = this.buildQueryString(options || {});
|
|
296
|
-
const response = await this.request(
|
|
297
|
-
"GET",
|
|
298
|
-
`/memory/${id}/related${queryString}`
|
|
299
|
-
);
|
|
300
|
-
return response.results;
|
|
301
|
-
}
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
// src/resources/threads.ts
|
|
305
|
-
var Threads = class extends BaseClient {
|
|
306
|
-
/**
|
|
307
|
-
* Create a new thread
|
|
308
|
-
*/
|
|
309
|
-
async create(data) {
|
|
310
|
-
return this.request("POST", "/threads", data);
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Get a thread by ID
|
|
314
|
-
*/
|
|
315
|
-
async get(id, includeMemories = false) {
|
|
316
|
-
const queryString = includeMemories ? "?include_memories=true" : "";
|
|
317
|
-
return this.request(
|
|
318
|
-
"GET",
|
|
319
|
-
`/threads/${id}${queryString}`
|
|
320
|
-
);
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* Update a thread
|
|
324
|
-
*/
|
|
325
|
-
async update(id, data) {
|
|
326
|
-
return this.request("PUT", `/threads/${id}`, data);
|
|
327
|
-
}
|
|
328
|
-
/**
|
|
329
|
-
* Delete a thread
|
|
330
|
-
*/
|
|
331
|
-
async delete(id, deleteMemories = false) {
|
|
332
|
-
const queryString = deleteMemories ? "?delete_memories=true" : "";
|
|
333
|
-
await this.request("DELETE", `/threads/${id}${queryString}`);
|
|
334
|
-
}
|
|
335
|
-
/**
|
|
336
|
-
* List threads with pagination
|
|
337
|
-
*/
|
|
338
|
-
async list(options) {
|
|
339
|
-
const queryString = this.buildQueryString(options || {});
|
|
340
|
-
return this.request(
|
|
341
|
-
"GET",
|
|
342
|
-
`/threads${queryString}`
|
|
343
|
-
);
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* Add memories to a thread
|
|
347
|
-
*/
|
|
348
|
-
async addMemories(id, memoryIds) {
|
|
349
|
-
return this.request("POST", `/threads/${id}/memories`, {
|
|
350
|
-
add: memoryIds
|
|
351
|
-
});
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* Remove memories from a thread
|
|
355
|
-
*/
|
|
356
|
-
async removeMemories(id, memoryIds) {
|
|
357
|
-
return this.request("POST", `/threads/${id}/memories`, {
|
|
358
|
-
remove: memoryIds
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
/**
|
|
362
|
-
* Get memories in a thread
|
|
363
|
-
*/
|
|
364
|
-
async getMemories(id, options) {
|
|
365
|
-
const queryString = this.buildQueryString(options || {});
|
|
366
|
-
return this.request(
|
|
367
|
-
"GET",
|
|
368
|
-
`/threads/${id}/memories${queryString}`
|
|
369
|
-
);
|
|
370
|
-
}
|
|
371
|
-
/**
|
|
372
|
-
* Get thread statistics
|
|
373
|
-
*/
|
|
374
|
-
async getStats(id) {
|
|
375
|
-
return this.request("GET", `/threads/${id}/stats`);
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
* Archive a thread
|
|
379
|
-
*/
|
|
380
|
-
async archive(id) {
|
|
381
|
-
return this.update(id, { status: "archived" });
|
|
382
|
-
}
|
|
383
|
-
/**
|
|
384
|
-
* Unarchive a thread
|
|
385
|
-
*/
|
|
386
|
-
async unarchive(id) {
|
|
387
|
-
return this.update(id, { status: "active" });
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Complete a thread
|
|
391
|
-
*/
|
|
392
|
-
async complete(id) {
|
|
393
|
-
return this.update(id, { status: "completed" });
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* Search threads
|
|
397
|
-
*/
|
|
398
|
-
async search(options) {
|
|
399
|
-
const queryString = this.buildQueryString({
|
|
400
|
-
q: options.query,
|
|
401
|
-
limit: options.limit,
|
|
402
|
-
offset: options.offset,
|
|
403
|
-
status: options.status,
|
|
404
|
-
tags: options.tags
|
|
405
|
-
});
|
|
406
|
-
return this.request(
|
|
407
|
-
"GET",
|
|
408
|
-
`/threads/search${queryString}`
|
|
409
|
-
);
|
|
410
|
-
}
|
|
411
|
-
/**
|
|
412
|
-
* Merge multiple threads into one
|
|
413
|
-
*/
|
|
414
|
-
async merge(targetId, sourceIds) {
|
|
415
|
-
return this.request("POST", `/threads/${targetId}/merge`, {
|
|
416
|
-
source_thread_ids: sourceIds
|
|
417
|
-
});
|
|
418
|
-
}
|
|
419
|
-
/**
|
|
420
|
-
* Clone a thread
|
|
421
|
-
*/
|
|
422
|
-
async clone(id, options) {
|
|
423
|
-
return this.request("POST", `/threads/${id}/clone`, options);
|
|
424
|
-
}
|
|
425
|
-
};
|
|
426
|
-
|
|
427
|
-
// src/index.ts
|
|
428
|
-
var SovantClient = class {
|
|
429
|
-
constructor(apiKeyOrConfig) {
|
|
430
|
-
if (typeof apiKeyOrConfig === "string") {
|
|
431
|
-
this.config = { apiKey: apiKeyOrConfig };
|
|
432
|
-
} else {
|
|
433
|
-
this.config = apiKeyOrConfig;
|
|
44
|
+
memory = {
|
|
45
|
+
create: (input) => this.req("/v1/memory", {
|
|
46
|
+
method: "POST",
|
|
47
|
+
body: JSON.stringify({
|
|
48
|
+
content: typeof input.data === 'string' ? input.data : JSON.stringify(input.data),
|
|
49
|
+
type: input.type || 'journal',
|
|
50
|
+
ttl: input.ttl,
|
|
51
|
+
tags: input.tags,
|
|
52
|
+
metadata: input.metadata,
|
|
53
|
+
thread_id: input.thread_id
|
|
54
|
+
})
|
|
55
|
+
}),
|
|
56
|
+
get: (id) => this.req(`/v1/memories/${encodeURIComponent(id)}`, {
|
|
57
|
+
method: "GET"
|
|
58
|
+
}),
|
|
59
|
+
search: (q) => {
|
|
60
|
+
const params = new URLSearchParams();
|
|
61
|
+
if (q.query)
|
|
62
|
+
params.append('query', q.query);
|
|
63
|
+
if (q.type)
|
|
64
|
+
params.append('type', q.type);
|
|
65
|
+
if (q.tags)
|
|
66
|
+
params.append('tags', q.tags.join(','));
|
|
67
|
+
if (q.thread_id)
|
|
68
|
+
params.append('thread_id', q.thread_id);
|
|
69
|
+
if (q.limit)
|
|
70
|
+
params.append('limit', q.limit.toString());
|
|
71
|
+
if (q.from_date)
|
|
72
|
+
params.append('from_date', q.from_date);
|
|
73
|
+
if (q.to_date)
|
|
74
|
+
params.append('to_date', q.to_date);
|
|
75
|
+
return this.req(`/v1/memory/search?${params.toString()}`, {
|
|
76
|
+
method: "GET"
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
update: (id, patch) => this.req(`/v1/memories/${encodeURIComponent(id)}`, {
|
|
80
|
+
method: "PATCH",
|
|
81
|
+
body: JSON.stringify({
|
|
82
|
+
content: patch.data ? (typeof patch.data === 'string' ? patch.data : JSON.stringify(patch.data)) : undefined,
|
|
83
|
+
type: patch.type,
|
|
84
|
+
ttl: patch.ttl,
|
|
85
|
+
tags: patch.tags,
|
|
86
|
+
metadata: patch.metadata
|
|
87
|
+
})
|
|
88
|
+
}),
|
|
89
|
+
delete: (id) => this.req(`/v1/memories/${encodeURIComponent(id)}`, {
|
|
90
|
+
method: "DELETE"
|
|
91
|
+
})
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export class SovantError extends Error {
|
|
95
|
+
code;
|
|
96
|
+
status;
|
|
97
|
+
details;
|
|
98
|
+
constructor(message, code, status, details) {
|
|
99
|
+
super(message);
|
|
100
|
+
this.name = "SovantError";
|
|
101
|
+
this.code = code;
|
|
102
|
+
this.status = status;
|
|
103
|
+
this.details = details;
|
|
434
104
|
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
}
|
|
438
|
-
/**
|
|
439
|
-
* Test API connection
|
|
440
|
-
*/
|
|
441
|
-
async ping() {
|
|
442
|
-
const client = new BaseClient(this.config);
|
|
443
|
-
return client.request("GET", "/health");
|
|
444
|
-
}
|
|
445
|
-
/**
|
|
446
|
-
* Get current API usage and quota
|
|
447
|
-
*/
|
|
448
|
-
async getUsage() {
|
|
449
|
-
const client = new BaseClient(this.config);
|
|
450
|
-
return client.request("GET", "/usage");
|
|
451
|
-
}
|
|
452
|
-
};
|
|
453
|
-
var index_default = SovantClient;
|
|
454
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
455
|
-
0 && (module.exports = {
|
|
456
|
-
AuthenticationError,
|
|
457
|
-
NetworkError,
|
|
458
|
-
NotFoundError,
|
|
459
|
-
RateLimitError,
|
|
460
|
-
SovantClient,
|
|
461
|
-
SovantError,
|
|
462
|
-
ValidationError
|
|
463
|
-
});
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js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CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;gBAC5G,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,GAAG,EAAE,KAAK,CAAC,GAAG;gBACd,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ;aACzB,CAAC;SACH,CAAC;QAEF,MAAM,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE;YACzE,MAAM,EAAE,QAAQ;SACjB,CAAC;KACH,CAAC;CACH;AAED,MAAM,OAAO,WAAY,SAAQ,KAAK;IACpC,IAAI,CAAS;IACb,MAAM,CAAU;IAChB,OAAO,CAAO;IAEd,YAAY,OAAe,EAAE,IAAY,EAAE,MAAe,EAAE,OAAa;QACvE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,56 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sovant/sdk",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Sovant Memory-as-a-Service TypeScript SDK",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "dist/index.js",
|
|
6
|
-
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
8
14
|
"files": [
|
|
9
15
|
"dist",
|
|
10
16
|
"README.md",
|
|
11
17
|
"LICENSE"
|
|
12
18
|
],
|
|
13
19
|
"scripts": {
|
|
14
|
-
"build": "
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"prepublishOnly": "npm run build"
|
|
20
|
+
"build": "tsc -p tsconfig.build.json",
|
|
21
|
+
"prepublishOnly": "npm run build",
|
|
22
|
+
"lint": "eslint .",
|
|
23
|
+
"format": "prettier -w ."
|
|
19
24
|
},
|
|
20
25
|
"keywords": [
|
|
21
26
|
"sovant",
|
|
22
27
|
"memory",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"sdk",
|
|
26
|
-
"typescript",
|
|
27
|
-
"javascript"
|
|
28
|
+
"maas",
|
|
29
|
+
"sdk"
|
|
28
30
|
],
|
|
29
|
-
"author": "Sovant
|
|
31
|
+
"author": "Sovant",
|
|
30
32
|
"license": "MIT",
|
|
31
|
-
"repository": {
|
|
32
|
-
"type": "git",
|
|
33
|
-
"url": "git+https://github.com/sovant-ai/javascript-sdk.git"
|
|
34
|
-
},
|
|
35
|
-
"bugs": {
|
|
36
|
-
"url": "https://github.com/sovant-ai/javascript-sdk/issues"
|
|
37
|
-
},
|
|
38
|
-
"homepage": "https://sovant.ai",
|
|
39
33
|
"devDependencies": {
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"@typescript-eslint/parser": "^6.18.1",
|
|
44
|
-
"eslint": "^8.56.0",
|
|
45
|
-
"jest": "^29.7.0",
|
|
46
|
-
"ts-jest": "^29.1.1",
|
|
47
|
-
"tsup": "^8.0.1",
|
|
48
|
-
"typescript": "^5.3.3"
|
|
49
|
-
},
|
|
50
|
-
"engines": {
|
|
51
|
-
"node": ">=14.0.0"
|
|
52
|
-
},
|
|
53
|
-
"publishConfig": {
|
|
54
|
-
"access": "public"
|
|
34
|
+
"typescript": "^5.6.2",
|
|
35
|
+
"eslint": "^9.9.0",
|
|
36
|
+
"prettier": "^3.3.3"
|
|
55
37
|
}
|
|
56
|
-
}
|
|
38
|
+
}
|