@usewhisper/sdk 1.0.0 → 1.0.1

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/index.mjs ADDED
@@ -0,0 +1,566 @@
1
+ // ../src/sdk/index.ts
2
+ var WhisperError = class extends Error {
3
+ code;
4
+ status;
5
+ retryable;
6
+ details;
7
+ constructor(args) {
8
+ super(args.message);
9
+ this.name = "WhisperError";
10
+ this.code = args.code;
11
+ this.status = args.status;
12
+ this.retryable = args.retryable ?? false;
13
+ this.details = args.details;
14
+ }
15
+ };
16
+ var DEFAULT_MAX_ATTEMPTS = 3;
17
+ var DEFAULT_BASE_DELAY_MS = 250;
18
+ var DEFAULT_MAX_DELAY_MS = 2e3;
19
+ var DEFAULT_TIMEOUT_MS = 15e3;
20
+ var PROJECT_CACHE_TTL_MS = 3e4;
21
+ function sleep(ms) {
22
+ return new Promise((resolve) => setTimeout(resolve, ms));
23
+ }
24
+ function getBackoffDelay(attempt, base, max) {
25
+ const jitter = 0.8 + Math.random() * 0.4;
26
+ return Math.min(max, Math.floor(base * Math.pow(2, attempt) * jitter));
27
+ }
28
+ function isLikelyProjectId(projectRef) {
29
+ return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(projectRef);
30
+ }
31
+ var WhisperContext = class _WhisperContext {
32
+ apiKey;
33
+ baseUrl;
34
+ defaultProject;
35
+ orgId;
36
+ timeoutMs;
37
+ retryConfig;
38
+ projectRefToId = /* @__PURE__ */ new Map();
39
+ projectCache = [];
40
+ projectCacheExpiresAt = 0;
41
+ constructor(config) {
42
+ if (!config.apiKey) {
43
+ throw new WhisperError({
44
+ code: "INVALID_API_KEY",
45
+ message: "API key is required"
46
+ });
47
+ }
48
+ this.apiKey = config.apiKey;
49
+ this.baseUrl = config.baseUrl || "https://context.usewhisper.dev";
50
+ this.defaultProject = config.project;
51
+ this.orgId = config.orgId;
52
+ this.timeoutMs = config.timeoutMs ?? DEFAULT_TIMEOUT_MS;
53
+ this.retryConfig = {
54
+ maxAttempts: config.retry?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
55
+ baseDelayMs: config.retry?.baseDelayMs ?? DEFAULT_BASE_DELAY_MS,
56
+ maxDelayMs: config.retry?.maxDelayMs ?? DEFAULT_MAX_DELAY_MS
57
+ };
58
+ }
59
+ withProject(project) {
60
+ return new _WhisperContext({
61
+ apiKey: this.apiKey,
62
+ baseUrl: this.baseUrl,
63
+ project,
64
+ orgId: this.orgId,
65
+ timeoutMs: this.timeoutMs,
66
+ retry: this.retryConfig
67
+ });
68
+ }
69
+ getRequiredProject(project) {
70
+ const resolved = project || this.defaultProject;
71
+ if (!resolved) {
72
+ throw new WhisperError({
73
+ code: "MISSING_PROJECT",
74
+ message: "Project is required. Pass project in params or set a default project in WhisperContext config."
75
+ });
76
+ }
77
+ return resolved;
78
+ }
79
+ async refreshProjectCache(force = false) {
80
+ if (!force && Date.now() < this.projectCacheExpiresAt && this.projectCache.length > 0) {
81
+ return this.projectCache;
82
+ }
83
+ const response = await this.request("/v1/projects", { method: "GET" });
84
+ this.projectRefToId.clear();
85
+ this.projectCache = response.projects || [];
86
+ for (const p of this.projectCache) {
87
+ this.projectRefToId.set(p.id, p.id);
88
+ this.projectRefToId.set(p.slug, p.id);
89
+ this.projectRefToId.set(p.name, p.id);
90
+ }
91
+ this.projectCacheExpiresAt = Date.now() + PROJECT_CACHE_TTL_MS;
92
+ return this.projectCache;
93
+ }
94
+ async resolveProjectId(projectRef) {
95
+ if (this.projectRefToId.has(projectRef)) {
96
+ return this.projectRefToId.get(projectRef);
97
+ }
98
+ const projects = await this.refreshProjectCache(true);
99
+ const byDirect = projects.find((p) => p.id === projectRef);
100
+ if (byDirect) return byDirect.id;
101
+ const matches = projects.filter((p) => p.slug === projectRef || p.name === projectRef);
102
+ if (matches.length === 1) {
103
+ return matches[0].id;
104
+ }
105
+ if (matches.length > 1) {
106
+ throw new WhisperError({
107
+ code: "PROJECT_AMBIGUOUS",
108
+ message: `Project reference '${projectRef}' matched multiple projects. Use project id instead.`
109
+ });
110
+ }
111
+ if (isLikelyProjectId(projectRef)) {
112
+ return projectRef;
113
+ }
114
+ throw new WhisperError({
115
+ code: "PROJECT_NOT_FOUND",
116
+ message: `Project '${projectRef}' not found`
117
+ });
118
+ }
119
+ async getProjectRefCandidates(projectRef) {
120
+ const candidates = /* @__PURE__ */ new Set([projectRef]);
121
+ try {
122
+ const projects = await this.refreshProjectCache(false);
123
+ const match = projects.find((p) => p.id === projectRef || p.slug === projectRef || p.name === projectRef);
124
+ if (match) {
125
+ candidates.add(match.id);
126
+ candidates.add(match.slug);
127
+ candidates.add(match.name);
128
+ } else if (isLikelyProjectId(projectRef)) {
129
+ const byId = projects.find((p) => p.id === projectRef);
130
+ if (byId) {
131
+ candidates.add(byId.slug);
132
+ candidates.add(byId.name);
133
+ }
134
+ }
135
+ } catch {
136
+ }
137
+ return Array.from(candidates).filter(Boolean);
138
+ }
139
+ async withProjectRefFallback(projectRef, execute) {
140
+ const refs = await this.getProjectRefCandidates(projectRef);
141
+ let lastError;
142
+ for (const ref of refs) {
143
+ try {
144
+ return await execute(ref);
145
+ } catch (error) {
146
+ lastError = error;
147
+ if (error instanceof WhisperError && error.code === "PROJECT_NOT_FOUND") {
148
+ continue;
149
+ }
150
+ throw error;
151
+ }
152
+ }
153
+ if (lastError instanceof Error) {
154
+ throw lastError;
155
+ }
156
+ throw new WhisperError({
157
+ code: "PROJECT_NOT_FOUND",
158
+ message: `Project '${projectRef}' not found`
159
+ });
160
+ }
161
+ classifyError(status, message) {
162
+ if (status === 401 || /api key|unauthorized|forbidden/i.test(message)) {
163
+ return { code: "INVALID_API_KEY", retryable: false };
164
+ }
165
+ if (status === 404 || /project not found/i.test(message)) {
166
+ return { code: "PROJECT_NOT_FOUND", retryable: false };
167
+ }
168
+ if (status === 408) {
169
+ return { code: "TIMEOUT", retryable: true };
170
+ }
171
+ if (status === 429) {
172
+ return { code: "RATE_LIMITED", retryable: true };
173
+ }
174
+ if (status !== void 0 && status >= 500) {
175
+ return { code: "TEMPORARY_UNAVAILABLE", retryable: true };
176
+ }
177
+ return { code: "REQUEST_FAILED", retryable: false };
178
+ }
179
+ async request(endpoint, options = {}) {
180
+ const maxAttempts = Math.max(1, this.retryConfig.maxAttempts);
181
+ let lastError;
182
+ for (let attempt = 0; attempt < maxAttempts; attempt++) {
183
+ const controller = new AbortController();
184
+ const timeout = setTimeout(() => controller.abort(), this.timeoutMs);
185
+ try {
186
+ const response = await fetch(`${this.baseUrl}${endpoint}`, {
187
+ ...options,
188
+ signal: controller.signal,
189
+ headers: {
190
+ Authorization: `Bearer ${this.apiKey}`,
191
+ "Content-Type": "application/json",
192
+ ...this.orgId ? { "X-Whisper-Org-Id": this.orgId } : {},
193
+ ...options.headers
194
+ }
195
+ });
196
+ clearTimeout(timeout);
197
+ if (!response.ok) {
198
+ let payload = null;
199
+ try {
200
+ payload = await response.json();
201
+ } catch {
202
+ payload = await response.text().catch(() => "");
203
+ }
204
+ const message = typeof payload === "string" ? payload : payload?.error || payload?.message || `HTTP ${response.status}: ${response.statusText}`;
205
+ const { code, retryable } = this.classifyError(response.status, message);
206
+ const err = new WhisperError({
207
+ code,
208
+ message,
209
+ status: response.status,
210
+ retryable,
211
+ details: payload
212
+ });
213
+ if (!retryable || attempt === maxAttempts - 1) {
214
+ throw err;
215
+ }
216
+ await sleep(getBackoffDelay(attempt, this.retryConfig.baseDelayMs, this.retryConfig.maxDelayMs));
217
+ continue;
218
+ }
219
+ return response.json();
220
+ } catch (error) {
221
+ clearTimeout(timeout);
222
+ const isAbort = error?.name === "AbortError";
223
+ const mapped = error instanceof WhisperError ? error : new WhisperError({
224
+ code: isAbort ? "TIMEOUT" : "NETWORK_ERROR",
225
+ message: isAbort ? "Request timed out" : error?.message || "Network request failed",
226
+ retryable: true,
227
+ details: error
228
+ });
229
+ lastError = mapped;
230
+ if (!mapped.retryable || attempt === maxAttempts - 1) {
231
+ throw mapped;
232
+ }
233
+ await sleep(getBackoffDelay(attempt, this.retryConfig.baseDelayMs, this.retryConfig.maxDelayMs));
234
+ }
235
+ }
236
+ throw lastError instanceof Error ? lastError : new WhisperError({ code: "REQUEST_FAILED", message: "Request failed" });
237
+ }
238
+ async query(params) {
239
+ const projectRef = this.getRequiredProject(params.project);
240
+ return this.withProjectRefFallback(projectRef, (project) => this.request("/v1/context/query", {
241
+ method: "POST",
242
+ body: JSON.stringify({ ...params, project })
243
+ }));
244
+ }
245
+ async createProject(params) {
246
+ const project = await this.request("/v1/projects", {
247
+ method: "POST",
248
+ body: JSON.stringify(params)
249
+ });
250
+ this.projectRefToId.set(project.id, project.id);
251
+ this.projectRefToId.set(project.slug, project.id);
252
+ this.projectRefToId.set(project.name, project.id);
253
+ this.projectCache = [
254
+ ...this.projectCache.filter((p) => p.id !== project.id),
255
+ project
256
+ ];
257
+ this.projectCacheExpiresAt = Date.now() + PROJECT_CACHE_TTL_MS;
258
+ return project;
259
+ }
260
+ async listProjects() {
261
+ const projects = await this.request("/v1/projects", { method: "GET" });
262
+ this.projectCache = projects.projects || [];
263
+ for (const p of projects.projects || []) {
264
+ this.projectRefToId.set(p.id, p.id);
265
+ this.projectRefToId.set(p.slug, p.id);
266
+ this.projectRefToId.set(p.name, p.id);
267
+ }
268
+ this.projectCacheExpiresAt = Date.now() + PROJECT_CACHE_TTL_MS;
269
+ return projects;
270
+ }
271
+ async getProject(id) {
272
+ const projectId = await this.resolveProjectId(id);
273
+ return this.request(`/v1/projects/${projectId}`);
274
+ }
275
+ async deleteProject(id) {
276
+ const projectId = await this.resolveProjectId(id);
277
+ return this.request(`/v1/projects/${projectId}`, { method: "DELETE" });
278
+ }
279
+ async addSource(projectId, params) {
280
+ const resolvedProjectId = await this.resolveProjectId(projectId);
281
+ return this.request(`/v1/projects/${resolvedProjectId}/sources`, {
282
+ method: "POST",
283
+ body: JSON.stringify(params)
284
+ });
285
+ }
286
+ async syncSource(sourceId) {
287
+ return this.request(`/v1/sources/${sourceId}/sync`, { method: "POST" });
288
+ }
289
+ async ingest(projectId, documents) {
290
+ const resolvedProjectId = await this.resolveProjectId(projectId);
291
+ return this.request(`/v1/projects/${resolvedProjectId}/ingest`, {
292
+ method: "POST",
293
+ body: JSON.stringify({ documents })
294
+ });
295
+ }
296
+ async addContext(params) {
297
+ const projectId = await this.resolveProjectId(this.getRequiredProject(params.project));
298
+ return this.ingest(projectId, [
299
+ {
300
+ title: params.title || "Context",
301
+ content: params.content,
302
+ metadata: params.metadata || { source: "addContext" }
303
+ }
304
+ ]);
305
+ }
306
+ async addMemory(params) {
307
+ const projectRef = this.getRequiredProject(params.project);
308
+ return this.withProjectRefFallback(projectRef, async (project) => {
309
+ try {
310
+ const direct = await this.request("/v1/memory", {
311
+ method: "POST",
312
+ body: JSON.stringify({
313
+ project,
314
+ content: params.content,
315
+ memory_type: params.memory_type,
316
+ user_id: params.user_id,
317
+ session_id: params.session_id,
318
+ agent_id: params.agent_id,
319
+ importance: params.importance,
320
+ metadata: params.metadata
321
+ })
322
+ });
323
+ const id = direct?.memory?.id || direct?.id || direct?.memory_id;
324
+ if (id) {
325
+ return { id, success: true };
326
+ }
327
+ } catch {
328
+ }
329
+ await this.request("/v1/memory/ingest/session", {
330
+ method: "POST",
331
+ body: JSON.stringify({
332
+ project,
333
+ session_id: params.session_id || `single-${Date.now()}`,
334
+ user_id: params.user_id,
335
+ messages: [
336
+ {
337
+ role: "user",
338
+ content: params.content,
339
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
340
+ }
341
+ ]
342
+ })
343
+ });
344
+ return { id: `session-${Date.now()}`, success: true };
345
+ });
346
+ }
347
+ async searchMemories(params) {
348
+ const projectRef = this.getRequiredProject(params.project);
349
+ return this.withProjectRefFallback(projectRef, (project) => this.request("/v1/memory/search", {
350
+ method: "POST",
351
+ body: JSON.stringify({
352
+ query: params.query,
353
+ project,
354
+ user_id: params.user_id,
355
+ session_id: params.session_id,
356
+ memory_types: params.memory_type ? [params.memory_type] : void 0,
357
+ top_k: params.top_k || 10
358
+ })
359
+ }));
360
+ }
361
+ async createApiKey(params) {
362
+ return this.request("/v1/keys", {
363
+ method: "POST",
364
+ body: JSON.stringify(params)
365
+ });
366
+ }
367
+ async listApiKeys() {
368
+ return this.request("/v1/keys");
369
+ }
370
+ async getUsage(days = 30) {
371
+ return this.request(`/v1/usage?days=${days}`);
372
+ }
373
+ async searchMemoriesSOTA(params) {
374
+ const projectRef = this.getRequiredProject(params.project);
375
+ return this.withProjectRefFallback(projectRef, (project) => this.request("/v1/memory/search", {
376
+ method: "POST",
377
+ body: JSON.stringify({ ...params, project })
378
+ }));
379
+ }
380
+ async ingestSession(params) {
381
+ const projectRef = this.getRequiredProject(params.project);
382
+ return this.withProjectRefFallback(projectRef, (project) => this.request("/v1/memory/ingest/session", {
383
+ method: "POST",
384
+ body: JSON.stringify({ ...params, project })
385
+ }));
386
+ }
387
+ async getSessionMemories(params) {
388
+ const project = await this.resolveProjectId(this.getRequiredProject(params.project));
389
+ const query = new URLSearchParams({
390
+ project,
391
+ ...params.limit && { limit: params.limit.toString() },
392
+ ...params.since_date && { since_date: params.since_date }
393
+ });
394
+ return this.request(`/v1/memory/session/${params.session_id}?${query}`);
395
+ }
396
+ async getUserProfile(params) {
397
+ const project = await this.resolveProjectId(this.getRequiredProject(params.project));
398
+ const query = new URLSearchParams({
399
+ project,
400
+ ...params.memory_types && { memory_types: params.memory_types }
401
+ });
402
+ return this.request(`/v1/memory/profile/${params.user_id}?${query}`);
403
+ }
404
+ async getMemoryVersions(memoryId) {
405
+ return this.request(`/v1/memory/${memoryId}/versions`);
406
+ }
407
+ async updateMemory(memoryId, params) {
408
+ return this.request(`/v1/memory/${memoryId}`, {
409
+ method: "PUT",
410
+ body: JSON.stringify(params)
411
+ });
412
+ }
413
+ async deleteMemory(memoryId) {
414
+ return this.request(`/v1/memory/${memoryId}`, { method: "DELETE" });
415
+ }
416
+ async getMemoryRelations(memoryId) {
417
+ return this.request(`/v1/memory/${memoryId}/relations`);
418
+ }
419
+ async oracleSearch(params) {
420
+ const project = await this.resolveProjectId(this.getRequiredProject(params.project));
421
+ return this.request("/v1/oracle/search", {
422
+ method: "POST",
423
+ body: JSON.stringify({ ...params, project })
424
+ });
425
+ }
426
+ async autosubscribe(params) {
427
+ const project = await this.resolveProjectId(this.getRequiredProject(params.project));
428
+ return this.request("/v1/autosubscribe", {
429
+ method: "POST",
430
+ body: JSON.stringify({ ...params, project })
431
+ });
432
+ }
433
+ async createSharedContext(params) {
434
+ const project = await this.resolveProjectId(this.getRequiredProject(params.project));
435
+ return this.request("/v1/context/share", {
436
+ method: "POST",
437
+ body: JSON.stringify({ ...params, project })
438
+ });
439
+ }
440
+ async loadSharedContext(shareId) {
441
+ return this.request(`/v1/context/shared/${shareId}`);
442
+ }
443
+ async resumeFromSharedContext(params) {
444
+ const project = await this.resolveProjectId(this.getRequiredProject(params.project));
445
+ return this.request("/v1/context/resume", {
446
+ method: "POST",
447
+ body: JSON.stringify({ ...params, project })
448
+ });
449
+ }
450
+ async consolidateMemories(params) {
451
+ const project = await this.resolveProjectId(this.getRequiredProject(params.project));
452
+ return this.request("/v1/memory/consolidate", {
453
+ method: "POST",
454
+ body: JSON.stringify({ ...params, project })
455
+ });
456
+ }
457
+ async updateImportanceDecay(params) {
458
+ const project = await this.resolveProjectId(this.getRequiredProject(params.project));
459
+ return this.request("/v1/memory/decay/update", {
460
+ method: "POST",
461
+ body: JSON.stringify({ ...params, project })
462
+ });
463
+ }
464
+ async getImportanceStats(project) {
465
+ const resolvedProject = await this.resolveProjectId(this.getRequiredProject(project));
466
+ return this.request(`/v1/memory/decay/stats?project=${resolvedProject}`);
467
+ }
468
+ async getCacheStats() {
469
+ return this.request("/v1/cache/stats");
470
+ }
471
+ async warmCache(params) {
472
+ const project = await this.resolveProjectId(this.getRequiredProject(params.project));
473
+ return this.request("/v1/cache/warm", {
474
+ method: "POST",
475
+ body: JSON.stringify({ ...params, project })
476
+ });
477
+ }
478
+ async clearCache(params) {
479
+ return this.request("/v1/cache/clear", {
480
+ method: "DELETE",
481
+ body: JSON.stringify(params)
482
+ });
483
+ }
484
+ async getCostSummary(params = {}) {
485
+ const resolvedProject = params.project ? await this.resolveProjectId(params.project) : void 0;
486
+ const query = new URLSearchParams({
487
+ ...resolvedProject && { project: resolvedProject },
488
+ ...params.start_date && { start_date: params.start_date },
489
+ ...params.end_date && { end_date: params.end_date }
490
+ });
491
+ return this.request(`/v1/cost/summary?${query}`);
492
+ }
493
+ async getCostBreakdown(params = {}) {
494
+ const resolvedProject = params.project ? await this.resolveProjectId(params.project) : void 0;
495
+ const query = new URLSearchParams({
496
+ ...resolvedProject && { project: resolvedProject },
497
+ ...params.group_by && { group_by: params.group_by },
498
+ ...params.start_date && { start_date: params.start_date },
499
+ ...params.end_date && { end_date: params.end_date }
500
+ });
501
+ return this.request(`/v1/cost/breakdown?${query}`);
502
+ }
503
+ async getCostSavings(params = {}) {
504
+ const resolvedProject = params.project ? await this.resolveProjectId(params.project) : void 0;
505
+ const query = new URLSearchParams({
506
+ ...resolvedProject && { project: resolvedProject },
507
+ ...params.start_date && { start_date: params.start_date },
508
+ ...params.end_date && { end_date: params.end_date }
509
+ });
510
+ return this.request(`/v1/cost/savings?${query}`);
511
+ }
512
+ // Backward-compatible grouped namespaces.
513
+ projects = {
514
+ create: (params) => this.createProject(params),
515
+ list: () => this.listProjects(),
516
+ get: (id) => this.getProject(id),
517
+ delete: (id) => this.deleteProject(id)
518
+ };
519
+ sources = {
520
+ add: (projectId, params) => this.addSource(projectId, params),
521
+ sync: (sourceId) => this.syncSource(sourceId),
522
+ syncSource: (sourceId) => this.syncSource(sourceId)
523
+ };
524
+ memory = {
525
+ add: (params) => this.addMemory(params),
526
+ search: (params) => this.searchMemories(params),
527
+ searchSOTA: (params) => this.searchMemoriesSOTA(params),
528
+ ingestSession: (params) => this.ingestSession(params),
529
+ getSessionMemories: (params) => this.getSessionMemories(params),
530
+ getUserProfile: (params) => this.getUserProfile(params),
531
+ getVersions: (memoryId) => this.getMemoryVersions(memoryId),
532
+ update: (memoryId, params) => this.updateMemory(memoryId, params),
533
+ delete: (memoryId) => this.deleteMemory(memoryId),
534
+ getRelations: (memoryId) => this.getMemoryRelations(memoryId),
535
+ consolidate: (params) => this.consolidateMemories(params),
536
+ updateDecay: (params) => this.updateImportanceDecay(params),
537
+ getImportanceStats: (project) => this.getImportanceStats(project)
538
+ };
539
+ keys = {
540
+ create: (params) => this.createApiKey(params),
541
+ list: () => this.listApiKeys(),
542
+ getUsage: (days) => this.getUsage(days)
543
+ };
544
+ oracle = {
545
+ search: (params) => this.oracleSearch(params)
546
+ };
547
+ context = {
548
+ createShare: (params) => this.createSharedContext(params),
549
+ loadShare: (shareId) => this.loadSharedContext(shareId),
550
+ resumeShare: (params) => this.resumeFromSharedContext(params)
551
+ };
552
+ optimization = {
553
+ getCacheStats: () => this.getCacheStats(),
554
+ warmCache: (params) => this.warmCache(params),
555
+ clearCache: (params) => this.clearCache(params),
556
+ getCostSummary: (params) => this.getCostSummary(params),
557
+ getCostBreakdown: (params) => this.getCostBreakdown(params),
558
+ getCostSavings: (params) => this.getCostSavings(params)
559
+ };
560
+ };
561
+ var index_default = WhisperContext;
562
+ export {
563
+ WhisperContext,
564
+ WhisperError,
565
+ index_default as default
566
+ };
package/package.json CHANGED
@@ -1,26 +1,26 @@
1
1
  {
2
2
  "name": "@usewhisper/sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "scripts": {
5
5
  "build": "tsup ../src/sdk/index.ts --format esm,cjs --dts --out-dir .",
6
6
  "prepublishOnly": "npm run build"
7
7
  },
8
8
  "description": "TypeScript SDK for Whisper Context API - Add reliable context to your AI agents",
9
- "main": "index.cjs",
10
- "module": "index.js",
9
+ "main": "index.js",
10
+ "module": "index.mjs",
11
11
  "types": "index.d.ts",
12
12
  "exports": {
13
13
  ".": {
14
14
  "types": "./index.d.ts",
15
- "import": "./index.js",
16
- "require": "./index.cjs"
15
+ "import": "./index.mjs",
16
+ "require": "./index.js"
17
17
  }
18
18
  },
19
19
  "files": [
20
20
  "index.js",
21
- "index.cjs",
21
+ "index.mjs",
22
22
  "index.d.ts",
23
- "index.d.cts",
23
+ "index.d.mts",
24
24
  "README.md"
25
25
  ],
26
26
  "keywords": [