@spawnco/sdk-types 0.0.51 → 0.0.53

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/dist/index.d.mts CHANGED
@@ -207,6 +207,16 @@ interface SpawnServerSDK__V1<TConfig = any> {
207
207
  /** Returns true if the user is currently muted (and not expired) */
208
208
  checkIsMuted(userId: string): Promise<boolean>;
209
209
  };
210
+ studioChat: {
211
+ /** Send a hidden DM-style notification to Savi for this variant's app. */
212
+ notifyDm(options: {
213
+ message: string;
214
+ source?: string;
215
+ entityId?: string;
216
+ }): Promise<{
217
+ success: boolean;
218
+ }>;
219
+ };
210
220
  sparks: {
211
221
  verifyPurchase({ purchaseId, price }: {
212
222
  purchaseId: string;
@@ -271,7 +281,7 @@ interface SpawnServerSDK__V1<TConfig = any> {
271
281
  getClaimsToday(userId: string): Promise<{
272
282
  claimedIds: ('A' | 'B' | 'C')[];
273
283
  }>;
274
- /** Claim a dew plant for a user. Returns random 10-20 dew amount. */
284
+ /** Claim a dew plant for a user. Returns random 5-10 dew amount. */
275
285
  claim(userId: string, plantId: 'A' | 'B' | 'C'): Promise<{
276
286
  success: boolean;
277
287
  amount?: number;
@@ -460,7 +470,26 @@ interface LeaderboardEntry {
460
470
  isMe?: boolean;
461
471
  timestamp: number;
462
472
  }
473
+ interface JobDewEnv {
474
+ /** Get today's plant claims for a user in this variant */
475
+ getClaimsToday(userId: string): Promise<{
476
+ claimedIds: ('A' | 'B' | 'C')[];
477
+ }>;
478
+ /** Claim a dew plant for a user. Returns random 5-10 dew amount. */
479
+ claim(userId: string, plantId: 'A' | 'B' | 'C'): Promise<{
480
+ success: boolean;
481
+ amount?: number;
482
+ new_balance?: number;
483
+ duplicate?: boolean;
484
+ claim_id?: string;
485
+ error?: string;
486
+ }>;
487
+ }
488
+ interface JobFnEnv {
489
+ /** Dew economy API for claiming plants */
490
+ dew: JobDewEnv;
491
+ }
463
492
  type SpawnClientSDK__V0<TConfig = any> = Omit<SpawnClientSDK__V1<TConfig>, 'economy'>;
464
493
  type SpawnServerSDK__V0<TConfig = any> = Omit<SpawnServerSDK__V1<TConfig>, 'economy' | 'room' | 'llm'>;
465
494
 
466
- export type { ClipDescriptor, ClipFormat, ClipKind, ClipListOptions, ClipLookupOptions, ClipStatus, ClipThumbnailDescriptor, InventoryItem, Item, LeaderboardEntry, LlmApi, LlmChatOptions, LlmChatResponse, LlmModel, Room, RoomInfo, RoomVisibility, SoundSettings, SpawnClientSDK__V0, SpawnClientSDK__V1, SpawnServerSDK__V0, SpawnServerSDK__V1, TokenPayload, UploadClipOptions, User };
495
+ export type { ClipDescriptor, ClipFormat, ClipKind, ClipListOptions, ClipLookupOptions, ClipStatus, ClipThumbnailDescriptor, InventoryItem, Item, JobDewEnv, JobFnEnv, LeaderboardEntry, LlmApi, LlmChatOptions, LlmChatResponse, LlmModel, Room, RoomInfo, RoomVisibility, SoundSettings, SpawnClientSDK__V0, SpawnClientSDK__V1, SpawnServerSDK__V0, SpawnServerSDK__V1, TokenPayload, UploadClipOptions, User };
package/dist/index.d.ts CHANGED
@@ -207,6 +207,16 @@ interface SpawnServerSDK__V1<TConfig = any> {
207
207
  /** Returns true if the user is currently muted (and not expired) */
208
208
  checkIsMuted(userId: string): Promise<boolean>;
209
209
  };
210
+ studioChat: {
211
+ /** Send a hidden DM-style notification to Savi for this variant's app. */
212
+ notifyDm(options: {
213
+ message: string;
214
+ source?: string;
215
+ entityId?: string;
216
+ }): Promise<{
217
+ success: boolean;
218
+ }>;
219
+ };
210
220
  sparks: {
211
221
  verifyPurchase({ purchaseId, price }: {
212
222
  purchaseId: string;
@@ -271,7 +281,7 @@ interface SpawnServerSDK__V1<TConfig = any> {
271
281
  getClaimsToday(userId: string): Promise<{
272
282
  claimedIds: ('A' | 'B' | 'C')[];
273
283
  }>;
274
- /** Claim a dew plant for a user. Returns random 10-20 dew amount. */
284
+ /** Claim a dew plant for a user. Returns random 5-10 dew amount. */
275
285
  claim(userId: string, plantId: 'A' | 'B' | 'C'): Promise<{
276
286
  success: boolean;
277
287
  amount?: number;
@@ -460,7 +470,26 @@ interface LeaderboardEntry {
460
470
  isMe?: boolean;
461
471
  timestamp: number;
462
472
  }
473
+ interface JobDewEnv {
474
+ /** Get today's plant claims for a user in this variant */
475
+ getClaimsToday(userId: string): Promise<{
476
+ claimedIds: ('A' | 'B' | 'C')[];
477
+ }>;
478
+ /** Claim a dew plant for a user. Returns random 5-10 dew amount. */
479
+ claim(userId: string, plantId: 'A' | 'B' | 'C'): Promise<{
480
+ success: boolean;
481
+ amount?: number;
482
+ new_balance?: number;
483
+ duplicate?: boolean;
484
+ claim_id?: string;
485
+ error?: string;
486
+ }>;
487
+ }
488
+ interface JobFnEnv {
489
+ /** Dew economy API for claiming plants */
490
+ dew: JobDewEnv;
491
+ }
463
492
  type SpawnClientSDK__V0<TConfig = any> = Omit<SpawnClientSDK__V1<TConfig>, 'economy'>;
464
493
  type SpawnServerSDK__V0<TConfig = any> = Omit<SpawnServerSDK__V1<TConfig>, 'economy' | 'room' | 'llm'>;
465
494
 
466
- export type { ClipDescriptor, ClipFormat, ClipKind, ClipListOptions, ClipLookupOptions, ClipStatus, ClipThumbnailDescriptor, InventoryItem, Item, LeaderboardEntry, LlmApi, LlmChatOptions, LlmChatResponse, LlmModel, Room, RoomInfo, RoomVisibility, SoundSettings, SpawnClientSDK__V0, SpawnClientSDK__V1, SpawnServerSDK__V0, SpawnServerSDK__V1, TokenPayload, UploadClipOptions, User };
495
+ export type { ClipDescriptor, ClipFormat, ClipKind, ClipListOptions, ClipLookupOptions, ClipStatus, ClipThumbnailDescriptor, InventoryItem, Item, JobDewEnv, JobFnEnv, LeaderboardEntry, LlmApi, LlmChatOptions, LlmChatResponse, LlmModel, Room, RoomInfo, RoomVisibility, SoundSettings, SpawnClientSDK__V0, SpawnClientSDK__V1, SpawnServerSDK__V0, SpawnServerSDK__V1, TokenPayload, UploadClipOptions, User };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spawnco/sdk-types",
3
- "version": "0.0.51",
3
+ "version": "0.0.53",
4
4
  "description": "TypeScript type definitions for Spawn SDK",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
package/src/v1.ts CHANGED
@@ -230,6 +230,11 @@ export interface SpawnServerSDK__V1<TConfig = any> {
230
230
  checkIsMuted(userId: string): Promise<boolean>;
231
231
  };
232
232
 
233
+ studioChat: {
234
+ /** Send a hidden DM-style notification to Savi for this variant's app. */
235
+ notifyDm(options: { message: string; source?: string; entityId?: string }): Promise<{ success: boolean }>;
236
+ };
237
+
233
238
  sparks: {
234
239
  verifyPurchase({ purchaseId, price }: { purchaseId: string; price: number }): Promise<boolean>;
235
240
  };
@@ -301,7 +306,7 @@ export interface SpawnServerSDK__V1<TConfig = any> {
301
306
  /** Get today's plant claims for a user in this variant */
302
307
  getClaimsToday(userId: string): Promise<{ claimedIds: ('A' | 'B' | 'C')[] }>;
303
308
 
304
- /** Claim a dew plant for a user. Returns random 10-20 dew amount. */
309
+ /** Claim a dew plant for a user. Returns random 5-10 dew amount. */
305
310
  claim(
306
311
  userId: string,
307
312
  plantId: 'A' | 'B' | 'C'
@@ -545,5 +550,30 @@ export interface LeaderboardEntry {
545
550
 
546
551
  // v0 sdk types for testing
547
552
 
553
+ // Job environment types for worker jobs
554
+ export interface JobDewEnv {
555
+ /** Get today's plant claims for a user in this variant */
556
+ getClaimsToday(userId: string): Promise<{ claimedIds: ('A' | 'B' | 'C')[] }>;
557
+
558
+ /** Claim a dew plant for a user. Returns random 5-10 dew amount. */
559
+ claim(
560
+ userId: string,
561
+ plantId: 'A' | 'B' | 'C'
562
+ ): Promise<{
563
+ success: boolean;
564
+ amount?: number;
565
+ new_balance?: number;
566
+ duplicate?: boolean;
567
+ claim_id?: string;
568
+ error?: string;
569
+ }>;
570
+ }
571
+
572
+ export interface JobFnEnv {
573
+ /** Dew economy API for claiming plants */
574
+ dew: JobDewEnv;
575
+ }
576
+
577
+ // v0 sdk types for testing
548
578
  export type SpawnClientSDK__V0<TConfig = any> = Omit<SpawnClientSDK__V1<TConfig>, 'economy'>;
549
579
  export type SpawnServerSDK__V0<TConfig = any> = Omit<SpawnServerSDK__V1<TConfig>, 'economy' | 'room' | 'llm'>;