@shadowob/sdk 1.1.1 → 1.1.3-dev.261

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.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { Socket } from 'socket.io-client';
1
+ import { MessageMention, OAuthLinkCard, MentionSuggestionTrigger, MentionSuggestion } from '@shadowob/shared';
2
2
  export { CLIENT_EVENTS, ClientEvent, SERVER_EVENTS, ServerEvent } from '@shadowob/shared';
3
+ import { Socket } from 'socket.io-client';
3
4
 
4
5
  /** Message returned by the Shadow REST API and Socket.IO broadcasts */
5
6
  interface ShadowMessage {
@@ -20,7 +21,91 @@ interface ShadowMessage {
20
21
  isBot?: boolean;
21
22
  };
22
23
  attachments?: ShadowAttachment[];
24
+ metadata?: ShadowMessageMetadata | null;
25
+ }
26
+ interface ShadowInteractiveButtonItem {
27
+ id: string;
28
+ label: string;
29
+ style?: 'primary' | 'secondary' | 'destructive';
30
+ value?: string;
31
+ }
32
+ interface ShadowInteractiveSelectItem {
33
+ id: string;
34
+ label: string;
35
+ value: string;
36
+ }
37
+ interface ShadowInteractiveFormField {
38
+ id: string;
39
+ kind: 'text' | 'textarea' | 'number' | 'checkbox' | 'select';
40
+ label: string;
41
+ placeholder?: string;
42
+ defaultValue?: string;
43
+ required?: boolean;
44
+ options?: ShadowInteractiveSelectItem[];
45
+ maxLength?: number;
46
+ min?: number;
47
+ max?: number;
48
+ }
49
+ interface ShadowInteractiveBlock {
50
+ id: string;
51
+ kind: 'buttons' | 'select' | 'form' | 'approval';
52
+ prompt?: string;
53
+ buttons?: ShadowInteractiveButtonItem[];
54
+ options?: ShadowInteractiveSelectItem[];
55
+ fields?: ShadowInteractiveFormField[];
56
+ submitLabel?: string;
57
+ responsePrompt?: string;
58
+ approvalCommentLabel?: string;
59
+ oneShot?: boolean;
60
+ }
61
+ interface ShadowInteractiveResponse {
62
+ blockId: string;
63
+ sourceMessageId: string;
64
+ actionId: string;
65
+ value: string;
66
+ values?: Record<string, string>;
67
+ submissionId?: string;
68
+ responseMessageId?: string | null;
69
+ submittedAt?: string;
70
+ }
71
+ interface ShadowInteractiveState {
72
+ sourceMessageId: string;
73
+ blockId: string;
74
+ submitted: boolean;
75
+ response?: ShadowInteractiveResponse;
76
+ }
77
+ interface ShadowInteractiveActionInput {
78
+ blockId: string;
79
+ actionId: string;
80
+ value?: string;
81
+ label?: string;
82
+ values?: Record<string, string>;
23
83
  }
84
+ interface ShadowInteractiveSubmissionPending {
85
+ ok: true;
86
+ pending: true;
87
+ interactiveState?: ShadowInteractiveState;
88
+ }
89
+ type ShadowInteractiveActionResult = ShadowMessage | ShadowInteractiveSubmissionPending;
90
+ interface ShadowMessageMetadata {
91
+ mentions?: ShadowMessageMention[];
92
+ agentChain?: Record<string, unknown>;
93
+ interactive?: ShadowInteractiveBlock;
94
+ interactiveResponse?: ShadowInteractiveResponse;
95
+ interactiveState?: ShadowInteractiveState;
96
+ commerceCards?: Array<ShadowCommerceProductCard | ShadowCommerceOfferCardInput>;
97
+ oauthLinkCards?: ShadowOAuthLinkCard[];
98
+ [key: string]: unknown;
99
+ }
100
+ interface ShadowCommerceOfferCardInput {
101
+ id?: string;
102
+ kind: 'offer';
103
+ offerId: string;
104
+ }
105
+ type ShadowMessageMention = MessageMention;
106
+ type ShadowOAuthLinkCard = OAuthLinkCard;
107
+ type ShadowMentionSuggestion = MentionSuggestion;
108
+ type ShadowMentionSuggestionTrigger = MentionSuggestionTrigger;
24
109
  interface ShadowAttachment {
25
110
  id: string;
26
111
  filename: string;
@@ -29,20 +114,54 @@ interface ShadowAttachment {
29
114
  size: number;
30
115
  width?: number | null;
31
116
  height?: number | null;
117
+ workspaceNodeId?: string | null;
118
+ }
119
+ interface ShadowSignedMediaUrl {
120
+ url: string;
121
+ expiresAt: string;
32
122
  }
33
123
  interface ShadowChannel {
34
124
  id: string;
35
125
  name: string;
36
126
  type: string;
37
- serverId: string;
127
+ kind: 'server' | 'dm';
128
+ serverId: string | null;
38
129
  description?: string | null;
39
130
  position?: number;
131
+ isPrivate?: boolean;
132
+ isMember?: boolean;
133
+ otherUser?: ShadowUser | null;
40
134
  }
41
- interface ShadowDmChannel {
42
- id: string;
43
- user1Id: string;
44
- user2Id: string;
45
- createdAt: string;
135
+ type ShadowChannelJoinRequestStatus = 'pending' | 'approved' | 'rejected';
136
+ interface ShadowChannelAccess {
137
+ channel: ShadowChannel;
138
+ isServerMember: boolean;
139
+ isChannelMember: boolean;
140
+ canManage: boolean;
141
+ canAccess: boolean;
142
+ requiresApproval: boolean;
143
+ joinRequestStatus: ShadowChannelJoinRequestStatus | null;
144
+ joinRequestId: string | null;
145
+ }
146
+ interface ShadowChannelJoinRequestResult {
147
+ ok: boolean;
148
+ status: ShadowChannelJoinRequestStatus;
149
+ requestId?: string;
150
+ }
151
+ type ShadowServerJoinRequestStatus = 'pending' | 'approved' | 'rejected';
152
+ interface ShadowServerAccess {
153
+ server: ShadowServer;
154
+ isMember: boolean;
155
+ canManage: boolean;
156
+ canAccess: boolean;
157
+ requiresApproval: boolean;
158
+ joinRequestStatus: ShadowServerJoinRequestStatus | null;
159
+ joinRequestId: string | null;
160
+ }
161
+ interface ShadowServerJoinRequestResult {
162
+ ok: boolean;
163
+ status: ShadowServerJoinRequestStatus;
164
+ requestId?: string;
46
165
  }
47
166
  interface ShadowThread {
48
167
  id: string;
@@ -55,8 +174,32 @@ interface ShadowMember {
55
174
  userId: string;
56
175
  serverId: string;
57
176
  role: string;
177
+ isBot?: boolean;
178
+ uid?: string;
179
+ nickname?: string;
180
+ avatar?: string | null;
181
+ status?: 'online' | 'idle' | 'dnd' | 'offline';
182
+ membershipTier?: string;
183
+ membershipLevel?: number;
184
+ isMember?: boolean;
185
+ totalOnlineSeconds?: number;
186
+ buddyTag?: string | null;
187
+ creator?: {
188
+ uid: string;
189
+ nickname: string;
190
+ username?: string;
191
+ displayName?: string | null;
192
+ avatarUrl?: string | null;
193
+ } | null;
58
194
  user?: ShadowUser;
59
195
  }
196
+ interface ShadowAddAgentsToServerResult {
197
+ added: string[];
198
+ failed: Array<{
199
+ agentId: string;
200
+ error: string;
201
+ }>;
202
+ }
60
203
  interface ShadowInviteCode {
61
204
  id: string;
62
205
  code: string;
@@ -79,28 +222,194 @@ interface ShadowServer {
79
222
  }
80
223
  interface ShadowUser {
81
224
  id: string;
225
+ email?: string;
82
226
  username: string;
83
227
  displayName?: string;
84
228
  avatarUrl?: string;
85
229
  isBot?: boolean;
86
230
  agentId?: string;
231
+ membership?: ShadowMembership;
232
+ }
233
+ interface ShadowMembership {
234
+ status: string;
235
+ tier: {
236
+ id: string;
237
+ level: number;
238
+ label: string;
239
+ capabilities: string[];
240
+ };
241
+ level: number;
242
+ isMember: boolean;
243
+ memberSince?: string | null;
244
+ inviteCodeId?: string | null;
245
+ capabilities: string[];
246
+ }
247
+ interface ShadowAuthResponse {
248
+ user: ShadowUser;
249
+ accessToken: string;
250
+ refreshToken: string;
251
+ }
252
+ type ShadowPlayAction = {
253
+ kind: 'public_channel';
254
+ serverId?: string;
255
+ serverSlug?: string;
256
+ channelId?: string;
257
+ channelName?: string;
258
+ inviteCode?: string;
259
+ buddyUserIds?: string[];
260
+ buddyTemplateSlug?: string;
261
+ greeting?: string;
262
+ } | {
263
+ kind: 'private_room';
264
+ serverId?: string;
265
+ serverSlug?: string;
266
+ namePrefix?: string;
267
+ buddyUserIds?: string[];
268
+ buddyTemplateSlug?: string;
269
+ greeting?: string;
270
+ } | {
271
+ kind: 'cloud_deploy';
272
+ templateSlug: string;
273
+ buddyTemplateSlug?: string;
274
+ buddyUserIds?: string[];
275
+ greeting?: string;
276
+ resourceTier?: 'lightweight' | 'standard' | 'pro';
277
+ defaultChannelName?: string;
278
+ } | {
279
+ kind: 'external_oauth_app';
280
+ clientId: string;
281
+ redirectUri: string;
282
+ scopes?: string[];
283
+ state?: string;
284
+ } | {
285
+ kind: 'landing_page';
286
+ url: string;
287
+ };
288
+ type ShadowPlayAvailability = 'available' | 'gated' | 'coming_soon' | 'misconfigured';
289
+ interface ShadowHomePlayCatalogItem {
290
+ id: string;
291
+ image: string;
292
+ title: string;
293
+ titleEn: string;
294
+ desc: string;
295
+ descEn: string;
296
+ category: string;
297
+ categoryEn: string;
298
+ starts: string;
299
+ accentColor: string;
300
+ hot?: boolean;
301
+ status: ShadowPlayAvailability;
302
+ action?: ShadowPlayAction;
303
+ gates?: {
304
+ auth?: 'optional' | 'required';
305
+ membership?: 'none' | 'required';
306
+ profile?: 'optional' | 'required';
307
+ };
308
+ template?: {
309
+ kind: 'cloud';
310
+ slug: string;
311
+ path: string;
312
+ };
313
+ materials?: {
314
+ cover: string;
315
+ };
87
316
  }
317
+ interface ShadowPlayLaunchResult {
318
+ ok: boolean;
319
+ status: string;
320
+ playId?: string | null;
321
+ redirectUrl?: string;
322
+ serverId?: string;
323
+ channelId?: string;
324
+ deploymentId?: string;
325
+ deploymentStatus?: string;
326
+ templateSlug?: string;
327
+ }
328
+ interface ShadowModelProxyModel {
329
+ id: string;
330
+ object: 'model';
331
+ created: number;
332
+ owned_by: string;
333
+ }
334
+ interface ShadowModelProxyModelsResponse {
335
+ object: 'list';
336
+ data: ShadowModelProxyModel[];
337
+ }
338
+ interface ShadowModelProxyBilling {
339
+ enabled: boolean;
340
+ currency: 'shrimp';
341
+ model: string;
342
+ models: string[];
343
+ shrimpMicrosPerCoin: number;
344
+ shrimpPerCny: number;
345
+ inputTokensPerShrimp: number | null;
346
+ outputTokensPerShrimp: number | null;
347
+ inputCacheHitCnyPerMillionTokens: number;
348
+ inputCacheMissCnyPerMillionTokens: number;
349
+ outputCnyPerMillionTokens: number;
350
+ inputCacheHitShrimpPerMillionTokens: number;
351
+ inputCacheMissShrimpPerMillionTokens: number;
352
+ outputShrimpPerMillionTokens: number;
353
+ }
354
+ type ShadowModelProxyChatCompletionRequest = Record<string, unknown> & {
355
+ model?: string;
356
+ messages: unknown[];
357
+ stream?: boolean;
358
+ };
359
+ type ShadowModelProxyChatCompletionResponse = Record<string, unknown>;
88
360
  interface ShadowNotification {
89
361
  id: string;
90
362
  userId: string;
91
363
  type: string;
364
+ kind?: string | null;
92
365
  title: string;
93
- body: string;
94
- referenceId?: string;
95
- referenceType?: string;
366
+ body: string | null;
367
+ referenceId?: string | null;
368
+ referenceType?: string | null;
369
+ senderId?: string | null;
370
+ senderAvatarUrl?: string | null;
371
+ scopeServerId?: string | null;
372
+ scopeChannelId?: string | null;
373
+ aggregationKey?: string | null;
374
+ aggregatedCount?: number | null;
375
+ lastAggregatedAt?: string | null;
376
+ metadata?: Record<string, unknown> | null;
96
377
  isRead: boolean;
97
378
  createdAt: string;
379
+ expiresAt?: string | null;
380
+ }
381
+ interface ShadowScopedUnread {
382
+ channelUnread: Record<string, number>;
383
+ serverUnread: Record<string, number>;
384
+ dmUnread?: Record<string, number>;
98
385
  }
99
386
  interface ShadowChannelPolicy {
100
387
  listen: boolean;
101
388
  reply: boolean;
102
389
  mentionOnly: boolean;
103
- config: Record<string, unknown>;
390
+ config: ShadowChannelPolicyConfig;
391
+ }
392
+ interface ShadowChannelPolicyConfig {
393
+ allowedTriggerUserIds?: string[];
394
+ triggerUserIds?: string[];
395
+ ownerId?: string;
396
+ activeTenantIds?: string[];
397
+ replyRequiresMention?: boolean;
398
+ [key: string]: unknown;
399
+ }
400
+ interface ShadowSlashCommand {
401
+ name: string;
402
+ description?: string;
403
+ aliases?: string[];
404
+ packId?: string;
405
+ sourcePath?: string;
406
+ interaction?: ShadowInteractiveBlock;
407
+ }
408
+ interface ShadowChannelSlashCommand extends ShadowSlashCommand {
409
+ agentId: string;
410
+ botUserId: string;
411
+ botUsername: string;
412
+ botDisplayName?: string | null;
104
413
  }
105
414
  interface ShadowRemoteChannel {
106
415
  id: string;
@@ -119,12 +428,42 @@ interface ShadowRemoteServer {
119
428
  interface ShadowRemoteConfig {
120
429
  agentId: string;
121
430
  botUserId: string;
431
+ ownerId?: string;
432
+ buddyMode?: 'private' | 'shareable';
433
+ allowedServerIds?: string[];
434
+ activeTenantIds?: string[];
435
+ allowedTriggerUserIds?: string[];
436
+ slashCommands?: ShadowSlashCommand[];
122
437
  servers: ShadowRemoteServer[];
123
438
  }
439
+ interface ShadowUsageProviderSnapshot {
440
+ provider: string;
441
+ amountUsd?: number | null;
442
+ usageLabel?: string | null;
443
+ raw?: string | null;
444
+ inputTokens?: number | null;
445
+ outputTokens?: number | null;
446
+ totalTokens?: number | null;
447
+ }
448
+ interface ShadowAgentUsageSnapshotInput {
449
+ source?: string;
450
+ model?: string | null;
451
+ totalUsd?: number | null;
452
+ inputTokens?: number | null;
453
+ outputTokens?: number | null;
454
+ cacheReadTokens?: number | null;
455
+ cacheWriteTokens?: number | null;
456
+ totalTokens?: number | null;
457
+ providers?: ShadowUsageProviderSnapshot[];
458
+ raw?: Record<string, unknown>;
459
+ generatedAt?: string;
460
+ }
124
461
  interface TypingPayload {
125
462
  channelId: string;
126
463
  userId: string;
127
464
  username: string;
465
+ displayName?: string | null;
466
+ typing?: boolean;
128
467
  }
129
468
  interface PresenceChangePayload {
130
469
  userId: string;
@@ -134,6 +473,8 @@ interface PresenceActivityPayload {
134
473
  userId: string;
135
474
  activity: string | null;
136
475
  channelId: string;
476
+ username?: string;
477
+ displayName?: string | null;
137
478
  }
138
479
  interface MemberJoinPayload {
139
480
  channelId: string;
@@ -143,6 +484,13 @@ interface MemberLeavePayload {
143
484
  channelId: string;
144
485
  userId: string;
145
486
  }
487
+ interface SlashCommandsUpdatedPayload {
488
+ channelId: string;
489
+ serverId?: string;
490
+ agentId?: string;
491
+ botUserId?: string;
492
+ commandCount?: number;
493
+ }
146
494
  interface ReactionPayload {
147
495
  messageId: string;
148
496
  userId: string;
@@ -160,11 +508,13 @@ interface ChannelCreatedPayload {
160
508
  }
161
509
  interface ChannelMemberAddedPayload {
162
510
  channelId: string;
163
- userId: string;
511
+ serverId?: string;
512
+ userId?: string;
164
513
  }
165
514
  interface ChannelMemberRemovedPayload {
166
515
  channelId: string;
167
- userId: string;
516
+ serverId?: string;
517
+ userId?: string;
168
518
  }
169
519
  interface ServerJoinedPayload {
170
520
  serverId: string;
@@ -175,23 +525,6 @@ interface PolicyChangedPayload {
175
525
  serverId: string;
176
526
  channelId?: string | null;
177
527
  }
178
- interface DmMessage {
179
- id: string;
180
- content: string;
181
- senderId: string;
182
- receiverId: string;
183
- dmChannelId: string;
184
- channelId: string;
185
- authorId: string;
186
- author?: {
187
- id: string;
188
- username: string;
189
- displayName?: string;
190
- avatarUrl?: string;
191
- isBot?: boolean;
192
- };
193
- createdAt: string;
194
- }
195
528
  interface ShadowFriendship {
196
529
  id: string;
197
530
  userId: string;
@@ -253,11 +586,286 @@ interface ShadowContract {
253
586
  }
254
587
  interface ShadowShop {
255
588
  id: string;
256
- serverId: string;
589
+ scopeKind?: 'server' | 'user';
590
+ serverId?: string | null;
591
+ ownerUserId?: string | null;
592
+ visibility?: string;
257
593
  name: string;
258
594
  description?: string | null;
259
595
  isEnabled: boolean;
260
596
  }
597
+ type ShadowCommunityAssetType = 'badge' | 'gift' | 'coupon' | 'service_ticket' | 'collectible' | 'content_pass' | 'reward';
598
+ interface ShadowCommunityAssetDefinition {
599
+ id: string;
600
+ issuerKind: 'platform' | 'server' | 'user' | 'shop';
601
+ issuerId?: string | null;
602
+ shopId?: string | null;
603
+ assetType: ShadowCommunityAssetType;
604
+ name: string;
605
+ description?: string | null;
606
+ imageUrl?: string | null;
607
+ giftable: boolean;
608
+ transferable: boolean;
609
+ consumable: boolean;
610
+ revocable: boolean;
611
+ expiresAfterDays?: number | null;
612
+ status: 'draft' | 'active' | 'paused' | 'archived';
613
+ metadata?: Record<string, unknown> | null;
614
+ createdAt?: string;
615
+ updatedAt?: string;
616
+ }
617
+ interface ShadowCommunityAssetGrant {
618
+ id: string;
619
+ definitionId: string;
620
+ ownerUserId: string;
621
+ sourceKind: string;
622
+ sourceId?: string | null;
623
+ quantity: number;
624
+ remainingQuantity: number;
625
+ status: 'active' | 'locked' | 'consumed' | 'revoked' | 'expired';
626
+ expiresAt?: string | null;
627
+ metadata?: Record<string, unknown> | null;
628
+ createdAt?: string;
629
+ updatedAt?: string;
630
+ }
631
+ interface ShadowCommunityAsset {
632
+ grant: ShadowCommunityAssetGrant;
633
+ definition: ShadowCommunityAssetDefinition;
634
+ }
635
+ interface ShadowEconomyTip {
636
+ id: string;
637
+ senderUserId: string;
638
+ recipientUserId: string;
639
+ amount: number;
640
+ sellerNet: number;
641
+ status: 'succeeded' | 'failed' | 'reversed' | 'held';
642
+ contextKind?: string | null;
643
+ contextId?: string | null;
644
+ message?: string | null;
645
+ createdAt?: string;
646
+ }
647
+ interface ShadowEconomyGift {
648
+ id: string;
649
+ senderUserId: string;
650
+ recipientUserId: string;
651
+ status: 'succeeded' | 'failed' | 'reversed' | 'held';
652
+ message?: string | null;
653
+ metadata?: Record<string, unknown> | null;
654
+ createdAt?: string;
655
+ }
656
+ interface ShadowSettlementLine {
657
+ id: string;
658
+ sellerUserId: string;
659
+ shopId?: string | null;
660
+ sourceType: 'order' | 'tip' | 'gift' | 'adjustment';
661
+ sourceId: string;
662
+ grossAmount: number;
663
+ platformFee: number;
664
+ netAmount: number;
665
+ status: 'pending' | 'available' | 'settled' | 'failed' | 'held' | 'reversed';
666
+ availableAt?: string | null;
667
+ settledAt?: string | null;
668
+ createdAt?: string;
669
+ updatedAt?: string;
670
+ }
671
+ interface ShadowCommerceProductCard {
672
+ id: string;
673
+ kind: 'offer' | 'product';
674
+ offerId?: string;
675
+ shopId: string;
676
+ shopScope: {
677
+ kind: 'server' | 'user';
678
+ id: string;
679
+ };
680
+ productId: string;
681
+ skuId?: string;
682
+ snapshot: {
683
+ name: string;
684
+ summary?: string | null;
685
+ imageUrl?: string | null;
686
+ price: number;
687
+ currency: string;
688
+ productType: 'physical' | 'entitlement';
689
+ billingMode?: 'one_time' | 'fixed_duration' | 'subscription';
690
+ durationSeconds?: number | null;
691
+ resourceType?: string;
692
+ resourceId?: string;
693
+ capability?: string;
694
+ };
695
+ purchase: {
696
+ mode: 'direct' | 'select_sku' | 'open_detail';
697
+ };
698
+ }
699
+ interface ShadowCommerceProductPickerGroup {
700
+ key: string;
701
+ labelKey: string;
702
+ shopId: string;
703
+ shopName: string;
704
+ shopScope: {
705
+ kind: 'server' | 'user';
706
+ id: string;
707
+ };
708
+ cards: ShadowCommerceProductCard[];
709
+ }
710
+ interface ShadowCommerceProductPickerResponse {
711
+ cards: ShadowCommerceProductCard[];
712
+ groups?: ShadowCommerceProductPickerGroup[];
713
+ }
714
+ interface ShadowEntitlementProvisioning {
715
+ status: 'provisioned' | 'manual_pending' | 'failed' | string;
716
+ code: string;
717
+ provisionedAt?: string;
718
+ checkedAt?: string;
719
+ resourceType?: string | null;
720
+ resourceId?: string | null;
721
+ capability?: string | null;
722
+ }
723
+ interface ShadowEntitlement {
724
+ id: string;
725
+ userId: string;
726
+ serverId?: string | null;
727
+ shopId?: string | null;
728
+ orderId?: string | null;
729
+ productId?: string | null;
730
+ offerId?: string | null;
731
+ scopeKind?: 'server' | 'user' | string;
732
+ resourceType: string;
733
+ resourceId: string;
734
+ capability: string;
735
+ status: string;
736
+ isActive: boolean;
737
+ startsAt?: string;
738
+ expiresAt?: string | null;
739
+ nextRenewalAt?: string | null;
740
+ cancelledAt?: string | null;
741
+ revokedAt?: string | null;
742
+ metadata?: Record<string, unknown> | null;
743
+ createdAt?: string;
744
+ updatedAt?: string;
745
+ shop?: {
746
+ id: string;
747
+ scopeKind: 'server' | 'user' | string;
748
+ serverId?: string | null;
749
+ ownerUserId?: string | null;
750
+ name: string;
751
+ logoUrl?: string | null;
752
+ } | null;
753
+ product?: {
754
+ id: string;
755
+ shopId: string;
756
+ name: string;
757
+ summary?: string | null;
758
+ type: 'physical' | 'entitlement' | string;
759
+ basePrice: number;
760
+ currency: string;
761
+ billingMode: 'one_time' | 'fixed_duration' | 'subscription' | string;
762
+ entitlementConfig?: Record<string, unknown> | Record<string, unknown>[] | null;
763
+ } | null;
764
+ offer?: {
765
+ id: string;
766
+ shopId: string;
767
+ productId: string;
768
+ priceOverride?: number | null;
769
+ currency: string;
770
+ status: string;
771
+ } | null;
772
+ paidFile?: {
773
+ id: string;
774
+ name: string;
775
+ mime?: string | null;
776
+ sizeBytes?: number | null;
777
+ previewUrl?: string | null;
778
+ } | null;
779
+ }
780
+ interface ShadowEntitlementPurchaseResult {
781
+ order: {
782
+ id: string;
783
+ orderNo: string;
784
+ status: string;
785
+ totalAmount: number;
786
+ };
787
+ entitlement: Record<string, unknown>;
788
+ provisioning?: ShadowEntitlementProvisioning;
789
+ fulfillmentJobs?: Record<string, unknown>[];
790
+ nextAction?: 'open_paid_file' | 'view_entitlement' | string;
791
+ }
792
+ interface ShadowCommerceCheckoutPreview {
793
+ offer: {
794
+ id: string;
795
+ status: string;
796
+ available: boolean;
797
+ allowedSurfaces?: string[] | null;
798
+ };
799
+ shop: {
800
+ id: string;
801
+ name: string;
802
+ scopeKind: 'server' | 'user' | string;
803
+ logoUrl?: string | null;
804
+ };
805
+ product: {
806
+ id: string;
807
+ name: string;
808
+ summary?: string | null;
809
+ imageUrl?: string | null;
810
+ type: 'physical' | 'entitlement' | string;
811
+ billingMode?: 'one_time' | 'fixed_duration' | 'subscription' | string;
812
+ price: number;
813
+ currency: string;
814
+ durationSeconds?: number | null;
815
+ };
816
+ entitlement?: {
817
+ resourceType: string;
818
+ resourceId: string;
819
+ capability: string;
820
+ access: {
821
+ allowed: boolean;
822
+ status: string;
823
+ reasonCode?: string | null;
824
+ entitlement?: Record<string, unknown> | null;
825
+ };
826
+ } | null;
827
+ paidFile?: {
828
+ id: string;
829
+ name: string;
830
+ mime?: string | null;
831
+ sizeBytes?: number | null;
832
+ previewUrl?: string | null;
833
+ } | null;
834
+ deliverables?: Record<string, unknown>[];
835
+ viewerState: 'not_purchased' | 'active' | 'expired' | 'revoked' | 'cancelled' | 'unavailable';
836
+ primaryAction?: 'purchase' | 'open_content' | 'renew' | 'view_detail' | 'view_progress' | 'unavailable' | string;
837
+ displayState?: {
838
+ viewerState: string;
839
+ primaryAction: string;
840
+ price: {
841
+ amount: number;
842
+ currency: string;
843
+ };
844
+ balance?: {
845
+ current: number;
846
+ afterPurchase?: number;
847
+ shortfall?: number;
848
+ } | null;
849
+ seller?: {
850
+ shopId: string;
851
+ shopName: string;
852
+ buddyUserId?: string | null;
853
+ };
854
+ entitlement?: Record<string, unknown> | null;
855
+ delivery?: Record<string, unknown> | null;
856
+ content?: Record<string, unknown> | null;
857
+ };
858
+ nextAction: 'purchase' | 'open_paid_file' | 'view_entitlement' | string;
859
+ }
860
+ interface ShadowPaidFileOpenResult {
861
+ grant: {
862
+ id: string;
863
+ fileId: string;
864
+ status: string;
865
+ expiresAt: string;
866
+ };
867
+ viewerUrl: string;
868
+ }
261
869
  interface ShadowCategory {
262
870
  id: string;
263
871
  shopId: string;
@@ -275,6 +883,7 @@ interface ShadowProduct {
275
883
  currency: string;
276
884
  stock: number;
277
885
  status: string;
886
+ billingMode?: 'one_time' | 'fixed_duration' | 'subscription';
278
887
  images: string[];
279
888
  createdAt: string;
280
889
  }
@@ -293,6 +902,7 @@ interface ShadowOrder {
293
902
  currency: string;
294
903
  items: {
295
904
  productId: string;
905
+ skuId?: string | null;
296
906
  quantity: number;
297
907
  price: number;
298
908
  }[];
@@ -319,9 +929,346 @@ interface ShadowTransaction {
319
929
  walletId: string;
320
930
  type: string;
321
931
  amount: number;
932
+ balanceAfter?: number;
933
+ currency?: string;
934
+ referenceId?: string | null;
935
+ referenceType?: string | null;
936
+ note?: string | null;
322
937
  description?: string | null;
938
+ display?: {
939
+ title?: string | null;
940
+ subtitle?: string | null;
941
+ } | null;
942
+ order?: Record<string, unknown> | null;
943
+ counterparty?: Record<string, unknown> | null;
323
944
  createdAt: string;
324
945
  }
946
+ type ShadowDiyCloudStepId = 'think' | 'search' | 'generate' | 'validate' | 'review';
947
+ interface ShadowDiyCloudGenerateInput {
948
+ prompt: string;
949
+ feedback?: string;
950
+ previousConfig?: Record<string, unknown>;
951
+ locale?: string;
952
+ timezone?: string;
953
+ }
954
+ interface ShadowDiyCloudAgentStepOutput {
955
+ type: 'agent_step_output';
956
+ schemaVersion: 1;
957
+ step: ShadowDiyCloudStepId;
958
+ status: ShadowDiyCloudProgressStatus;
959
+ title: string;
960
+ locale: string;
961
+ timezone: string;
962
+ generatedAt: string;
963
+ result: Record<string, unknown>;
964
+ reasons: string[];
965
+ confidence?: number;
966
+ }
967
+ interface ShadowDiyCloudDraft {
968
+ slug: string;
969
+ title: string;
970
+ description: string;
971
+ score: number;
972
+ steps: Array<{
973
+ id: ShadowDiyCloudStepId;
974
+ title: string;
975
+ detail: string;
976
+ }>;
977
+ matchedPlugins: Array<{
978
+ id: string;
979
+ name: string;
980
+ description: string;
981
+ reason: string;
982
+ capabilities: string[];
983
+ requiredKeys: string[];
984
+ matchedTerms: string[];
985
+ }>;
986
+ referenceTemplates: Array<{
987
+ slug: string;
988
+ title: string;
989
+ description: string;
990
+ category: string;
991
+ plugins: string[];
992
+ channels: string[];
993
+ buddyNames: string[];
994
+ reason: string;
995
+ }>;
996
+ suggestedSkills: string[];
997
+ requiredKeys: Array<{
998
+ key: string;
999
+ label: string;
1000
+ description: string;
1001
+ source: string;
1002
+ sourcePluginId: string;
1003
+ sensitive: boolean;
1004
+ setupSteps: string[];
1005
+ skipImpact: string;
1006
+ }>;
1007
+ toolTrace: Array<{
1008
+ tool: 'search_plugins' | 'inspect_plugin' | 'search_templates' | 'inspect_template' | 'compile_template_dsl' | 'validate_template_dsl' | 'collect_required_keys';
1009
+ query?: string;
1010
+ resultIds: string[];
1011
+ }>;
1012
+ agentOutputs: ShadowDiyCloudAgentStepOutput[];
1013
+ agentReport: {
1014
+ objective: string;
1015
+ assumptions: string[];
1016
+ reasoning: Array<{
1017
+ step: ShadowDiyCloudStepId;
1018
+ title: string;
1019
+ detail: string;
1020
+ evidence: string[];
1021
+ }>;
1022
+ pluginDecisions: Array<{
1023
+ id: string;
1024
+ name: string;
1025
+ reason: string;
1026
+ capabilities: string[];
1027
+ matchedTerms: string[];
1028
+ requiredKeys: string[];
1029
+ }>;
1030
+ templateDecisions: Array<{
1031
+ slug: string;
1032
+ title: string;
1033
+ reason: string;
1034
+ plugins: string[];
1035
+ channels: string[];
1036
+ }>;
1037
+ validationChecks: Array<{
1038
+ name: string;
1039
+ status: 'passed' | 'warning' | 'failed';
1040
+ detail: string;
1041
+ }>;
1042
+ repairNotes: string[];
1043
+ };
1044
+ guidebook: {
1045
+ summary: string;
1046
+ beforeDeploy: string[];
1047
+ howToUse: string[];
1048
+ reviewNotes: string[];
1049
+ };
1050
+ template: Record<string, unknown>;
1051
+ validation: {
1052
+ valid: boolean;
1053
+ agents: number;
1054
+ configurations: number;
1055
+ violations: Array<{
1056
+ path: string;
1057
+ prefix: string;
1058
+ }>;
1059
+ extendsErrors: string[];
1060
+ templateRefs: {
1061
+ env: number;
1062
+ secret: number;
1063
+ file: number;
1064
+ };
1065
+ };
1066
+ }
1067
+ type ShadowDiyCloudProgressStatus = 'running' | 'completed' | 'warning' | 'error';
1068
+ type ShadowDiyCloudRunStatus = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
1069
+ interface ShadowDiyCloudRun {
1070
+ runId: string;
1071
+ input: ShadowDiyCloudGenerateInput;
1072
+ status: ShadowDiyCloudRunStatus;
1073
+ createdAt: string;
1074
+ updatedAt: string;
1075
+ expiresAt: string;
1076
+ draft?: ShadowDiyCloudDraft;
1077
+ error?: string;
1078
+ }
1079
+ type ShadowDiyCloudRunEvent = {
1080
+ schemaVersion: 2;
1081
+ seq: number;
1082
+ runId: string;
1083
+ eventId: string;
1084
+ timestamp: string;
1085
+ type: 'run.created' | 'run.started' | 'run.cancelled';
1086
+ status?: ShadowDiyCloudRunStatus;
1087
+ input?: ShadowDiyCloudGenerateInput;
1088
+ expiresAt?: string;
1089
+ } | {
1090
+ schemaVersion: 2;
1091
+ seq: number;
1092
+ runId: string;
1093
+ eventId: string;
1094
+ timestamp: string;
1095
+ type: 'step.created';
1096
+ stepId: ShadowDiyCloudStepId;
1097
+ title: string;
1098
+ intent: string;
1099
+ order: number;
1100
+ iconHint?: string;
1101
+ } | {
1102
+ schemaVersion: 2;
1103
+ seq: number;
1104
+ runId: string;
1105
+ eventId: string;
1106
+ timestamp: string;
1107
+ type: 'step.delta';
1108
+ stepId: ShadowDiyCloudStepId;
1109
+ channel: 'summary' | 'rationale' | 'status';
1110
+ delta: string;
1111
+ status?: ShadowDiyCloudProgressStatus;
1112
+ title?: string;
1113
+ meta?: Record<string, unknown>;
1114
+ } | {
1115
+ schemaVersion: 2;
1116
+ seq: number;
1117
+ runId: string;
1118
+ eventId: string;
1119
+ timestamp: string;
1120
+ type: 'decision';
1121
+ stepId: ShadowDiyCloudStepId;
1122
+ decisionId: string;
1123
+ title: string;
1124
+ selected: string;
1125
+ basis: {
1126
+ observations: string[];
1127
+ constraints: string[];
1128
+ evidence: Array<{
1129
+ source: string;
1130
+ ref: string;
1131
+ summary: string;
1132
+ }>;
1133
+ rejectedOptions: Array<{
1134
+ option: string;
1135
+ reason: string;
1136
+ }>;
1137
+ confidence?: number | null;
1138
+ needsUserReview: boolean;
1139
+ };
1140
+ output?: ShadowDiyCloudAgentStepOutput;
1141
+ } | {
1142
+ schemaVersion: 2;
1143
+ seq: number;
1144
+ runId: string;
1145
+ eventId: string;
1146
+ timestamp: string;
1147
+ type: 'artifact.patch';
1148
+ stepId: ShadowDiyCloudStepId;
1149
+ artifact: 'templateDsl' | 'cloudConfig' | 'guidebook' | 'requiredKeys';
1150
+ patch: unknown;
1151
+ } | {
1152
+ schemaVersion: 2;
1153
+ seq: number;
1154
+ runId: string;
1155
+ eventId: string;
1156
+ timestamp: string;
1157
+ type: 'guardrail.result';
1158
+ stepId: ShadowDiyCloudStepId;
1159
+ name: string;
1160
+ status: 'passed' | 'warning' | 'failed' | 'error';
1161
+ detail: string;
1162
+ blocksRun: boolean;
1163
+ } | {
1164
+ schemaVersion: 2;
1165
+ seq: number;
1166
+ runId: string;
1167
+ eventId: string;
1168
+ timestamp: string;
1169
+ type: 'draft.completed';
1170
+ draft: ShadowDiyCloudDraft;
1171
+ } | {
1172
+ schemaVersion: 2;
1173
+ seq: number;
1174
+ runId: string;
1175
+ eventId: string;
1176
+ timestamp: string;
1177
+ type: 'run.failed';
1178
+ error: string;
1179
+ code?: string;
1180
+ retryable: boolean;
1181
+ };
1182
+ type ShadowCloudDeploymentStatus = 'pending' | 'deploying' | 'cancelling' | 'deployed' | 'paused' | 'resuming' | 'failed' | 'destroying' | 'destroyed';
1183
+ interface ShadowCloudDeploymentRuntimeResponse {
1184
+ ok: boolean;
1185
+ status: ShadowCloudDeploymentStatus;
1186
+ deployment?: Record<string, unknown>;
1187
+ }
1188
+ interface ShadowCloudDeploymentManifest {
1189
+ deploymentId: string;
1190
+ namespace: string;
1191
+ name: string;
1192
+ templateSlug: string | null;
1193
+ template: Record<string, unknown> | null;
1194
+ manifest: Record<string, unknown> | null;
1195
+ drift: {
1196
+ status: 'up-to-date' | 'template-updated' | 'missing-template' | 'unlinked' | 'unknown';
1197
+ templateAvailable: boolean;
1198
+ templateChanged: boolean;
1199
+ deployedTemplateHash: string | null;
1200
+ currentTemplateHash: string | null;
1201
+ configHash: string | null;
1202
+ };
1203
+ configSnapshot: Record<string, unknown> | null;
1204
+ }
1205
+ interface ShadowCloudDeploymentTemplateSyncResult {
1206
+ ok: boolean;
1207
+ action: 'updated' | 'forked';
1208
+ template: Record<string, unknown>;
1209
+ manifest: ShadowCloudDeploymentManifest;
1210
+ }
1211
+ interface ShadowCloudDeploymentBackup {
1212
+ id: string;
1213
+ deploymentId: string;
1214
+ namespace: string;
1215
+ agentId: string;
1216
+ sandboxName: string | null;
1217
+ pvcName: string;
1218
+ driver: 'volumeSnapshot' | 'restic' | string;
1219
+ snapshotName: string | null;
1220
+ objectKey: string | null;
1221
+ status: 'pending' | 'running' | 'succeeded' | 'failed' | 'expired' | string;
1222
+ phase: string;
1223
+ error: string | null;
1224
+ expiresAt: string | null;
1225
+ createdAt: string;
1226
+ updatedAt: string;
1227
+ }
1228
+ interface ShadowCloudProviderCatalog {
1229
+ pluginId: string;
1230
+ pluginName: string;
1231
+ provider: Record<string, unknown>;
1232
+ secretFields?: Record<string, unknown>[];
1233
+ }
1234
+ interface ShadowCloudProviderEnvVar {
1235
+ key: string;
1236
+ maskedValue: string;
1237
+ isSecret: boolean;
1238
+ }
1239
+ interface ShadowCloudProviderModel {
1240
+ id: string;
1241
+ name?: string;
1242
+ tags?: string[];
1243
+ contextWindow?: number;
1244
+ maxTokens?: number;
1245
+ cost?: {
1246
+ input?: number;
1247
+ output?: number;
1248
+ };
1249
+ capabilities?: {
1250
+ vision?: boolean;
1251
+ tools?: boolean;
1252
+ reasoning?: boolean;
1253
+ };
1254
+ }
1255
+ interface ShadowCloudProviderProfile {
1256
+ id: string;
1257
+ providerId: string;
1258
+ name: string;
1259
+ scope: string;
1260
+ enabled: boolean;
1261
+ config: {
1262
+ baseUrl?: string;
1263
+ apiFormat?: 'openai' | 'anthropic' | 'gemini';
1264
+ authType?: 'api_key';
1265
+ discoveredAt?: string;
1266
+ models?: ShadowCloudProviderModel[];
1267
+ [key: string]: unknown;
1268
+ };
1269
+ envVars: ShadowCloudProviderEnvVar[];
1270
+ updatedAt?: string;
1271
+ }
325
1272
  interface ShadowTask {
326
1273
  key: string;
327
1274
  title: string;
@@ -330,15 +1277,44 @@ interface ShadowTask {
330
1277
  status: string;
331
1278
  claimedAt?: string | null;
332
1279
  }
333
- interface ShadowApp {
1280
+ interface ShadowRechargeTier {
1281
+ key: string;
1282
+ shrimpCoins: number;
1283
+ usdCents: number;
1284
+ label: string;
1285
+ }
1286
+ interface ShadowRechargeConfig {
1287
+ tiers: ShadowRechargeTier[];
1288
+ customAmountMin: number;
1289
+ customAmountMax: number;
1290
+ exchangeRate: number;
1291
+ stripePublishableKey: string;
1292
+ }
1293
+ interface ShadowRechargeIntent {
1294
+ clientSecret: string;
1295
+ paymentIntentId: string;
1296
+ orderNo: string;
1297
+ amount: {
1298
+ shrimpCoins: number;
1299
+ usdCents: number;
1300
+ };
1301
+ }
1302
+ interface ShadowPaymentOrder {
334
1303
  id: string;
335
- serverId: string;
336
- name: string;
337
- slug: string;
338
- type: string;
339
- url?: string | null;
1304
+ orderNo: string;
1305
+ shrimpCoinAmount: number;
1306
+ usdAmount: number;
340
1307
  status: string;
1308
+ localCurrencyAmount?: number | null;
1309
+ localCurrency?: string | null;
341
1310
  createdAt: string;
1311
+ paidAt?: string | null;
1312
+ }
1313
+ interface ShadowRechargeHistory {
1314
+ items: ShadowPaymentOrder[];
1315
+ total: number;
1316
+ limit: number;
1317
+ offset: number;
342
1318
  }
343
1319
  interface ShadowNotificationPreferences {
344
1320
  strategy: 'all' | 'mention_only' | 'none';
@@ -350,18 +1326,23 @@ interface ServerEventMap {
350
1326
  'message:new': (message: ShadowMessage) => void;
351
1327
  'message:updated': (message: ShadowMessage) => void;
352
1328
  'message:deleted': (payload: MessageDeletedPayload) => void;
1329
+ 'message:typing': (payload: TypingPayload) => void;
353
1330
  'member:typing': (payload: TypingPayload) => void;
354
1331
  'member:join': (payload: MemberJoinPayload) => void;
1332
+ 'member:joined': (payload: MemberJoinPayload & {
1333
+ isBot?: boolean;
1334
+ }) => void;
355
1335
  'member:leave': (payload: MemberLeavePayload) => void;
1336
+ 'member:left': (payload: MemberLeavePayload) => void;
356
1337
  'presence:change': (payload: PresenceChangePayload) => void;
357
1338
  'presence:activity': (payload: PresenceActivityPayload) => void;
358
1339
  'reaction:add': (payload: ReactionPayload) => void;
359
1340
  'reaction:remove': (payload: ReactionPayload) => void;
360
1341
  'notification:new': (notification: ShadowNotification) => void;
361
- 'dm:message:new': (message: DmMessage) => void;
362
1342
  'channel:created': (payload: ChannelCreatedPayload) => void;
363
1343
  'channel:member-added': (payload: ChannelMemberAddedPayload) => void;
364
1344
  'channel:member-removed': (payload: ChannelMemberRemovedPayload) => void;
1345
+ 'channel:slash-commands-updated': (payload: SlashCommandsUpdatedPayload) => void;
365
1346
  'server:joined': (payload: ServerJoinedPayload) => void;
366
1347
  'agent:policy-changed': (payload: PolicyChangedPayload) => void;
367
1348
  error: (payload: {
@@ -383,9 +1364,12 @@ interface ClientEventMap {
383
1364
  content: string;
384
1365
  threadId?: string;
385
1366
  replyToId?: string;
1367
+ mentions?: ShadowMessageMention[];
1368
+ metadata?: Record<string, unknown>;
386
1369
  }) => void;
387
1370
  'message:typing': (data: {
388
1371
  channelId: string;
1372
+ typing?: boolean;
389
1373
  }) => void;
390
1374
  'presence:update': (data: {
391
1375
  status: 'online' | 'idle' | 'dnd' | 'offline';
@@ -405,27 +1389,36 @@ declare class ShadowClient {
405
1389
  private token;
406
1390
  private baseUrl;
407
1391
  constructor(baseUrl: string, token: string);
1392
+ private isShadowPrivateMediaUrl;
408
1393
  private request;
409
1394
  private requestRaw;
410
1395
  register(data: {
411
1396
  email: string;
412
1397
  password: string;
413
- username: string;
1398
+ username?: string;
414
1399
  displayName?: string;
415
- inviteCode: string;
416
- }): Promise<{
417
- token: string;
418
- user: ShadowUser;
419
- }>;
1400
+ inviteCode?: string;
1401
+ }): Promise<ShadowAuthResponse>;
420
1402
  login(data: {
421
1403
  email: string;
422
1404
  password: string;
1405
+ }): Promise<ShadowAuthResponse>;
1406
+ startEmailLogin(data: {
1407
+ email: string;
1408
+ locale?: string;
423
1409
  }): Promise<{
424
- token: string;
425
- user: ShadowUser;
1410
+ ok: true;
1411
+ expiresIn: number;
1412
+ devCode?: string;
426
1413
  }>;
427
- refreshToken(): Promise<{
428
- token: string;
1414
+ verifyEmailLogin(data: {
1415
+ email: string;
1416
+ code: string;
1417
+ displayName?: string;
1418
+ }): Promise<ShadowAuthResponse>;
1419
+ refreshToken(refreshToken: string): Promise<{
1420
+ accessToken: string;
1421
+ refreshToken: string;
429
1422
  }>;
430
1423
  getMe(): Promise<ShadowUser>;
431
1424
  updateProfile(data: {
@@ -435,15 +1428,39 @@ declare class ShadowClient {
435
1428
  disconnect(): Promise<{
436
1429
  success: boolean;
437
1430
  }>;
438
- listAgents(): Promise<{
1431
+ getMembership(): Promise<ShadowMembership>;
1432
+ redeemInviteCode(code: string): Promise<ShadowMembership>;
1433
+ launchPlay(data: {
1434
+ playId?: string;
1435
+ launchSessionId?: string;
1436
+ inviteCode?: string;
1437
+ locale?: string;
1438
+ }): Promise<ShadowPlayLaunchResult>;
1439
+ getPlayCatalog(): Promise<ShadowHomePlayCatalogItem[]>;
1440
+ listOfficialModelProxyModels(): Promise<ShadowModelProxyModelsResponse>;
1441
+ getOfficialModelProxyBilling(): Promise<ShadowModelProxyBilling>;
1442
+ createOfficialChatCompletion(data: ShadowModelProxyChatCompletionRequest): Promise<ShadowModelProxyChatCompletionResponse>;
1443
+ createOfficialChatCompletionStream(data: ShadowModelProxyChatCompletionRequest): Promise<Response>;
1444
+ listAgents(options?: {
1445
+ includeRentals?: boolean;
1446
+ }): Promise<{
439
1447
  id: string;
440
- name: string;
1448
+ name?: string;
441
1449
  status: string;
1450
+ accessRole?: 'owner' | 'tenant';
1451
+ activeContractId?: string | null;
1452
+ config?: Record<string, unknown>;
442
1453
  }[]>;
443
1454
  createAgent(data: {
444
1455
  name: string;
1456
+ username: string;
1457
+ description?: string;
445
1458
  displayName?: string;
446
1459
  avatarUrl?: string | null;
1460
+ kernelType?: string;
1461
+ config?: Record<string, unknown>;
1462
+ buddyMode?: 'private' | 'shareable';
1463
+ allowedServerIds?: string[];
447
1464
  }): Promise<{
448
1465
  id: string;
449
1466
  token: string;
@@ -459,6 +1476,8 @@ declare class ShadowClient {
459
1476
  name?: string;
460
1477
  displayName?: string;
461
1478
  avatarUrl?: string | null;
1479
+ buddyMode?: 'private' | 'shareable';
1480
+ allowedServerIds?: string[];
462
1481
  }): Promise<{
463
1482
  id: string;
464
1483
  name: string;
@@ -478,9 +1497,25 @@ declare class ShadowClient {
478
1497
  sendHeartbeat(agentId: string): Promise<{
479
1498
  ok: boolean;
480
1499
  }>;
1500
+ reportAgentUsageSnapshot(agentId: string, snapshot: ShadowAgentUsageSnapshotInput): Promise<{
1501
+ ok: boolean;
1502
+ }>;
481
1503
  getAgentConfig(agentId: string): Promise<ShadowRemoteConfig>;
482
- listPolicies(agentId: string, serverId: string): Promise<{
1504
+ updateAgentSlashCommands(agentId: string, commands: ShadowSlashCommand[]): Promise<{
1505
+ ok: boolean;
1506
+ commands: ShadowSlashCommand[];
1507
+ }>;
1508
+ getAgentSlashCommands(agentId: string): Promise<{
1509
+ commands: ShadowSlashCommand[];
1510
+ }>;
1511
+ listChannelSlashCommands(channelId: string): Promise<{
1512
+ commands: ShadowChannelSlashCommand[];
1513
+ }>;
1514
+ listPolicies(agentId: string, serverId?: string): Promise<{
1515
+ id: string;
1516
+ serverId: string;
483
1517
  channelId: string | null;
1518
+ listen?: boolean;
484
1519
  mentionOnly: boolean;
485
1520
  reply: boolean;
486
1521
  config: Record<string, unknown>;
@@ -491,9 +1526,13 @@ declare class ShadowClient {
491
1526
  reply?: boolean;
492
1527
  config?: Record<string, unknown>;
493
1528
  }): Promise<{
1529
+ id: string;
1530
+ serverId: string;
494
1531
  channelId: string | null;
1532
+ listen?: boolean;
495
1533
  mentionOnly: boolean;
496
1534
  reply: boolean;
1535
+ config?: Record<string, unknown>;
497
1536
  }>;
498
1537
  deletePolicy(agentId: string, serverId: string, channelId: string): Promise<{
499
1538
  success: boolean;
@@ -508,6 +1547,7 @@ declare class ShadowClient {
508
1547
  }): Promise<ShadowServer>;
509
1548
  listServers(): Promise<ShadowServer[]>;
510
1549
  getServer(serverIdOrSlug: string): Promise<ShadowServer>;
1550
+ getServerAccess(serverIdOrSlug: string): Promise<ShadowServerAccess>;
511
1551
  updateServer(serverIdOrSlug: string, data: {
512
1552
  name?: string;
513
1553
  description?: string | null;
@@ -522,6 +1562,10 @@ declare class ShadowClient {
522
1562
  joinServer(serverId: string, inviteCode?: string): Promise<{
523
1563
  success: boolean;
524
1564
  }>;
1565
+ requestServerAccess(serverIdOrSlug: string): Promise<ShadowServerJoinRequestResult>;
1566
+ reviewServerJoinRequest(requestId: string, status: Exclude<ShadowServerJoinRequestStatus, 'pending'>): Promise<{
1567
+ ok: boolean;
1568
+ }>;
525
1569
  leaveServer(serverId: string): Promise<{
526
1570
  success: boolean;
527
1571
  }>;
@@ -535,16 +1579,16 @@ declare class ShadowClient {
535
1579
  regenerateInviteCode(serverId: string): Promise<{
536
1580
  inviteCode: string;
537
1581
  }>;
538
- addAgentsToServer(serverId: string, agentIds: string[]): Promise<{
539
- added: string[];
540
- }>;
1582
+ addAgentsToServer(serverId: string, agentIds: string[]): Promise<ShadowAddAgentsToServerResult>;
541
1583
  getServerChannels(serverId: string): Promise<ShadowChannel[]>;
542
1584
  createChannel(serverId: string, data: {
543
1585
  name: string;
544
1586
  type?: string;
545
1587
  description?: string;
1588
+ isPrivate?: boolean;
546
1589
  }): Promise<ShadowChannel>;
547
1590
  getChannel(channelId: string): Promise<ShadowChannel>;
1591
+ getChannelAccess(channelId: string): Promise<ShadowChannelAccess>;
548
1592
  getChannelMembers(channelId: string): Promise<ShadowMember[]>;
549
1593
  updateChannel(channelId: string, data: {
550
1594
  name?: string;
@@ -559,37 +1603,62 @@ declare class ShadowClient {
559
1603
  addChannelMember(channelId: string, userId: string): Promise<{
560
1604
  success: boolean;
561
1605
  }>;
1606
+ requestChannelAccess(channelId: string): Promise<ShadowChannelJoinRequestResult>;
1607
+ reviewChannelJoinRequest(requestId: string, status: Exclude<ShadowChannelJoinRequestStatus, 'pending'>): Promise<{
1608
+ ok: boolean;
1609
+ }>;
562
1610
  removeChannelMember(channelId: string, userId: string): Promise<{
563
1611
  success: boolean;
564
1612
  }>;
565
- setBuddyPolicy(channelId: string, data: {
566
- buddyUserId: string;
1613
+ setBuddyPolicy(channelId: string, agentId: string, data: {
567
1614
  mentionOnly?: boolean;
568
1615
  reply?: boolean;
1616
+ mode?: string;
1617
+ config?: Record<string, unknown>;
569
1618
  }): Promise<{
570
1619
  success: boolean;
571
1620
  }>;
572
- getBuddyPolicy(channelId: string): Promise<{
573
- buddyUserId: string | null;
574
- mentionOnly: boolean;
575
- reply: boolean;
576
- } | null>;
1621
+ getBuddyPolicy(channelId: string, agentId: string): Promise<Record<string, unknown> | null>;
577
1622
  sendMessage(channelId: string, content: string, opts?: {
578
1623
  threadId?: string;
579
1624
  replyToId?: string;
1625
+ mentions?: ShadowMessageMention[];
580
1626
  metadata?: Record<string, unknown>;
1627
+ attachments?: {
1628
+ filename: string;
1629
+ url: string;
1630
+ contentType: string;
1631
+ size: number;
1632
+ }[];
581
1633
  }): Promise<ShadowMessage>;
1634
+ suggestMentions(input: {
1635
+ channelId: string;
1636
+ trigger: ShadowMentionSuggestionTrigger;
1637
+ query?: string;
1638
+ limit?: number;
1639
+ }): Promise<{
1640
+ suggestions: ShadowMentionSuggestion[];
1641
+ }>;
1642
+ resolveMentions(input: {
1643
+ channelId: string;
1644
+ content: string;
1645
+ mentions?: ShadowMessageMention[];
1646
+ }): Promise<{
1647
+ mentions: ShadowMessageMention[];
1648
+ }>;
582
1649
  getMessages(channelId: string, limit?: number, cursor?: string): Promise<{
583
1650
  messages: ShadowMessage[];
584
1651
  hasMore: boolean;
585
1652
  }>;
586
1653
  getMessage(messageId: string): Promise<ShadowMessage>;
1654
+ submitInteractiveAction(messageId: string, input: ShadowInteractiveActionInput): Promise<ShadowInteractiveActionResult>;
1655
+ getInteractiveState(messageId: string, blockId?: string): Promise<ShadowInteractiveState>;
587
1656
  editMessage(messageId: string, content: string): Promise<ShadowMessage>;
588
1657
  deleteMessage(messageId: string): Promise<void>;
589
- pinMessage(messageId: string, channelId?: string): Promise<{
1658
+ pinMessage(messageId: string, channelId: string): Promise<{
590
1659
  success: boolean;
591
1660
  }>;
592
- unpinMessage(messageId: string, channelId?: string): Promise<{
1661
+ unpinMessage(messageId: string, channelId: string): Promise<{
593
1662
  success: boolean;
594
1663
  }>;
595
1664
  getPinnedMessages(channelId: string): Promise<ShadowMessage[]>;
@@ -613,20 +1682,17 @@ declare class ShadowClient {
613
1682
  success: boolean;
614
1683
  }>;
615
1684
  getThreadMessages(threadId: string, limit?: number, cursor?: string): Promise<ShadowMessage[]>;
616
- sendToThread(threadId: string, content: string): Promise<ShadowMessage>;
617
- createDmChannel(userId: string): Promise<ShadowDmChannel>;
618
- listDmChannels(): Promise<ShadowDmChannel[]>;
619
- getDmMessages(channelId: string, limit?: number, cursor?: string): Promise<ShadowMessage[]>;
620
- sendDmMessage(channelId: string, content: string, options?: {
1685
+ sendToThread(threadId: string, content: string, options?: {
621
1686
  replyToId?: string;
622
1687
  metadata?: Record<string, unknown>;
1688
+ mentions?: ShadowMessageMention[];
623
1689
  }): Promise<ShadowMessage>;
1690
+ createDirectChannel(userId: string): Promise<ShadowChannel>;
1691
+ listDirectChannels(): Promise<ShadowChannel[]>;
624
1692
  listNotifications(limit?: number, offset?: number): Promise<ShadowNotification[]>;
625
- markNotificationRead(notificationId: string): Promise<{
626
- success: boolean;
627
- }>;
1693
+ markNotificationRead(notificationId: string): Promise<ShadowNotification>;
628
1694
  markAllNotificationsRead(): Promise<{
629
- success: boolean;
1695
+ ok: boolean;
630
1696
  }>;
631
1697
  getUnreadCount(): Promise<{
632
1698
  count: number;
@@ -648,16 +1714,27 @@ declare class ShadowClient {
648
1714
  deleteInvite(inviteId: string): Promise<{
649
1715
  success: boolean;
650
1716
  }>;
651
- uploadMedia(file: Blob | ArrayBuffer, filename: string, contentType: string, messageId?: string): Promise<{
1717
+ uploadMedia(file: Blob | ArrayBuffer, filename: string, contentType: string, messageId?: string | {
1718
+ messageId?: string;
1719
+ }): Promise<{
652
1720
  url: string;
653
1721
  key: string;
654
1722
  size: number;
655
1723
  }>;
1724
+ resolveAttachmentMediaUrl(attachmentId: string, options?: {
1725
+ disposition?: 'inline' | 'attachment';
1726
+ }): Promise<ShadowSignedMediaUrl>;
1727
+ resolveWorkspaceMediaUrl(serverId: string, fileId: string, options?: {
1728
+ disposition?: 'inline' | 'attachment';
1729
+ contentRef?: string;
1730
+ }): Promise<ShadowSignedMediaUrl>;
656
1731
  /**
657
1732
  * Download a file from a URL and upload it to the Shadow media service.
658
1733
  * Supports local filesystem paths, file:// URLs, tilde paths, and HTTP(S) URLs.
659
1734
  */
660
- uploadMediaFromUrl(mediaUrl: string, messageId?: string): Promise<{
1735
+ uploadMediaFromUrl(mediaUrl: string, messageId?: string | {
1736
+ messageId?: string;
1737
+ }): Promise<{
661
1738
  url: string;
662
1739
  key: string;
663
1740
  size: number;
@@ -744,6 +1821,14 @@ declare class ShadowClient {
744
1821
  unlinkOAuthAccount(accountId: string): Promise<{
745
1822
  success: boolean;
746
1823
  }>;
1824
+ changePassword(data: {
1825
+ currentPassword: string;
1826
+ newPassword: string;
1827
+ }): Promise<{
1828
+ ok: boolean;
1829
+ }>;
1830
+ getDashboard(): Promise<Record<string, unknown>>;
1831
+ loginWithGoogleIdToken(idToken: string): Promise<ShadowAuthResponse>;
747
1832
  sendFriendRequest(username: string): Promise<ShadowFriendship>;
748
1833
  acceptFriendRequest(requestId: string): Promise<ShadowFriendship>;
749
1834
  rejectFriendRequest(requestId: string): Promise<ShadowFriendship>;
@@ -757,11 +1842,30 @@ declare class ShadowClient {
757
1842
  serverId?: string;
758
1843
  channelId?: string;
759
1844
  }): Promise<{
760
- success: boolean;
1845
+ updated: number;
761
1846
  }>;
762
- getScopedUnread(): Promise<Record<string, number>>;
1847
+ getScopedUnread(): Promise<ShadowScopedUnread>;
763
1848
  getNotificationPreferences(): Promise<ShadowNotificationPreferences>;
764
1849
  updateNotificationPreferences(data: Partial<ShadowNotificationPreferences>): Promise<ShadowNotificationPreferences>;
1850
+ getNotificationChannelPreferences(): Promise<Record<string, unknown>[]>;
1851
+ updateNotificationChannelPreference(data: {
1852
+ kind: string;
1853
+ channel: string;
1854
+ enabled: boolean;
1855
+ }): Promise<Record<string, unknown>>;
1856
+ registerPushToken(data: {
1857
+ platform: 'ios' | 'android' | 'web' | string;
1858
+ token: string;
1859
+ deviceName?: string | null;
1860
+ }): Promise<Record<string, unknown>>;
1861
+ registerWebPushSubscription(data: {
1862
+ endpoint: string;
1863
+ keys: {
1864
+ p256dh: string;
1865
+ auth: string;
1866
+ };
1867
+ userAgent?: string | null;
1868
+ }): Promise<Record<string, unknown>>;
765
1869
  createOAuthApp(data: {
766
1870
  name: string;
767
1871
  redirectUris: string[];
@@ -807,6 +1911,18 @@ declare class ShadowClient {
807
1911
  revokeOAuthConsent(appId: string): Promise<{
808
1912
  success: boolean;
809
1913
  }>;
1914
+ sendOAuthChannelMessage(channelId: string, content: string, opts?: {
1915
+ metadata?: {
1916
+ oauthLinkCards?: ShadowOAuthLinkCard[];
1917
+ };
1918
+ }): Promise<ShadowMessage>;
1919
+ sendOAuthBuddyMessage(buddyId: string, data: {
1920
+ channelId: string;
1921
+ content: string;
1922
+ metadata?: {
1923
+ oauthLinkCards?: ShadowOAuthLinkCard[];
1924
+ };
1925
+ }): Promise<ShadowMessage>;
810
1926
  browseListings(params?: {
811
1927
  search?: string;
812
1928
  tags?: string[];
@@ -864,6 +1980,85 @@ declare class ShadowClient {
864
1980
  success: boolean;
865
1981
  }>;
866
1982
  getShop(serverId: string): Promise<ShadowShop>;
1983
+ getMyShop(): Promise<ShadowShop>;
1984
+ upsertMyShop(data: Partial<ShadowShop>): Promise<ShadowShop>;
1985
+ getUserShop(userId: string): Promise<ShadowShop>;
1986
+ getManagedUserShop(userId: string): Promise<ShadowShop>;
1987
+ upsertManagedUserShop(userId: string, data: Partial<ShadowShop>): Promise<ShadowShop>;
1988
+ getShopById(shopId: string): Promise<ShadowShop>;
1989
+ listShopProducts(shopId: string, params?: {
1990
+ keyword?: string;
1991
+ limit?: number;
1992
+ offset?: number;
1993
+ }): Promise<{
1994
+ products: ShadowProduct[];
1995
+ }>;
1996
+ getScopeNeutralProduct(productId: string): Promise<ShadowProduct>;
1997
+ getShopProduct(shopId: string, productId: string): Promise<ShadowProduct>;
1998
+ createShopProduct(shopId: string, data: Partial<ShadowProduct> & Record<string, unknown>): Promise<ShadowProduct>;
1999
+ updateShopProduct(shopId: string, productId: string, data: Partial<ShadowProduct> & Record<string, unknown>): Promise<ShadowProduct>;
2000
+ deleteShopProduct(shopId: string, productId: string): Promise<{
2001
+ ok: boolean;
2002
+ }>;
2003
+ purchaseShopProduct(shopId: string, productId: string, data: {
2004
+ idempotencyKey: string;
2005
+ skuId?: string;
2006
+ }): Promise<ShadowEntitlementPurchaseResult>;
2007
+ purchaseCommerceOffer(offerId: string, data: {
2008
+ idempotencyKey: string;
2009
+ skuId?: string;
2010
+ destinationKind?: 'channel' | 'dm';
2011
+ destinationId?: string;
2012
+ }): Promise<ShadowEntitlementPurchaseResult>;
2013
+ getCommerceOfferCheckoutPreview(offerId: string, params?: {
2014
+ skuId?: string;
2015
+ viewerUserId?: string;
2016
+ }): Promise<ShadowCommerceCheckoutPreview>;
2017
+ createCommerceOffer(shopId: string, data: {
2018
+ productId: string;
2019
+ allowedSurfaces?: Array<'channel' | 'dm'>;
2020
+ priceOverride?: number | null;
2021
+ sellerBuddyUserId?: string | null;
2022
+ status?: 'draft' | 'active' | 'paused' | 'archived';
2023
+ metadata?: Record<string, unknown>;
2024
+ }): Promise<Record<string, unknown>>;
2025
+ listCommerceOffers(shopId: string, params?: {
2026
+ keyword?: string;
2027
+ limit?: number;
2028
+ }): Promise<{
2029
+ offers: Record<string, unknown>[];
2030
+ }>;
2031
+ createCommerceDeliverable(shopId: string, offerId: string, data: {
2032
+ kind?: 'paid_file' | 'message' | 'external' | 'entitlement' | 'community_asset' | 'currency';
2033
+ resourceType?: string;
2034
+ resourceId: string;
2035
+ senderBuddyUserId?: string | null;
2036
+ messageTemplateKey?: string | null;
2037
+ metadata?: Record<string, unknown>;
2038
+ }): Promise<Record<string, unknown>>;
2039
+ listShopAssetDefinitions(shopId: string): Promise<{
2040
+ assets: ShadowCommunityAssetDefinition[];
2041
+ }>;
2042
+ createShopAssetDefinition(shopId: string, data: Partial<ShadowCommunityAssetDefinition> & {
2043
+ assetType: ShadowCommunityAssetDefinition['assetType'];
2044
+ name: string;
2045
+ }): Promise<ShadowCommunityAssetDefinition>;
2046
+ updateShopAssetDefinition(shopId: string, assetDefinitionId: string, data: Partial<Omit<ShadowCommunityAssetDefinition, 'id' | 'assetType'>>): Promise<ShadowCommunityAssetDefinition>;
2047
+ purchaseMessageCommerceCard(messageId: string, cardId: string, data: {
2048
+ idempotencyKey: string;
2049
+ skuId?: string;
2050
+ }): Promise<ShadowEntitlementPurchaseResult>;
2051
+ listCommerceProductCards(params: {
2052
+ target: 'channel';
2053
+ channelId: string;
2054
+ keyword?: string;
2055
+ limit?: number;
2056
+ }): Promise<ShadowCommerceProductPickerResponse>;
2057
+ openPaidFile(fileId: string): Promise<ShadowPaidFileOpenResult>;
2058
+ listShopEntitlements(shopId: string, params?: {
2059
+ limit?: number;
2060
+ offset?: number;
2061
+ }): Promise<Record<string, unknown>[]>;
867
2062
  updateShop(serverId: string, data: Partial<{
868
2063
  name: string;
869
2064
  description: string | null;
@@ -923,9 +2118,11 @@ declare class ShadowClient {
923
2118
  removeCartItem(serverId: string, itemId: string): Promise<{
924
2119
  success: boolean;
925
2120
  }>;
926
- createOrder(serverId: string, data?: {
2121
+ createOrder(serverId: string, data: {
2122
+ idempotencyKey: string;
927
2123
  items?: {
928
2124
  productId: string;
2125
+ skuId?: string;
929
2126
  quantity: number;
930
2127
  }[];
931
2128
  }): Promise<ShadowOrder>;
@@ -942,9 +2139,207 @@ declare class ShadowClient {
942
2139
  }): Promise<ShadowReview>;
943
2140
  replyToReview(serverId: string, reviewId: string, reply: string): Promise<ShadowReview>;
944
2141
  getWallet(): Promise<ShadowWallet>;
945
- topUpWallet(amount: number): Promise<ShadowWallet>;
946
- getWalletTransactions(): Promise<ShadowTransaction[]>;
947
- getEntitlements(serverId: string): Promise<Record<string, unknown>[]>;
2142
+ topUpWallet(_amount: number): Promise<ShadowWallet>;
2143
+ getWalletTransactions(params?: {
2144
+ audience?: 'ledger' | 'consumer';
2145
+ direction?: 'all' | 'income' | 'expense';
2146
+ limit?: number;
2147
+ offset?: number;
2148
+ }): Promise<ShadowTransaction[]>;
2149
+ listCommunityAssets(): Promise<{
2150
+ assets: ShadowCommunityAsset[];
2151
+ }>;
2152
+ getCommunityAsset(grantId: string): Promise<ShadowCommunityAsset>;
2153
+ consumeCommunityAsset(grantId: string, data: {
2154
+ idempotencyKey: string;
2155
+ }): Promise<{
2156
+ grant: ShadowCommunityAssetGrant;
2157
+ }>;
2158
+ lockCommunityAsset(grantId: string, data: {
2159
+ idempotencyKey: string;
2160
+ }): Promise<{
2161
+ grant: ShadowCommunityAssetGrant;
2162
+ }>;
2163
+ unlockCommunityAsset(grantId: string, data: {
2164
+ idempotencyKey: string;
2165
+ }): Promise<{
2166
+ grant: ShadowCommunityAssetGrant;
2167
+ }>;
2168
+ revokeCommunityAsset(grantId: string, data: {
2169
+ idempotencyKey: string;
2170
+ reason?: string;
2171
+ }): Promise<{
2172
+ grant: ShadowCommunityAssetGrant;
2173
+ }>;
2174
+ sendTip(data: {
2175
+ recipientUserId: string;
2176
+ amount: number;
2177
+ message?: string;
2178
+ context?: {
2179
+ kind: string;
2180
+ id: string;
2181
+ };
2182
+ idempotencyKey: string;
2183
+ }): Promise<{
2184
+ tip: ShadowEconomyTip;
2185
+ }>;
2186
+ listTips(): Promise<{
2187
+ tips: ShadowEconomyTip[];
2188
+ }>;
2189
+ sendGift(data: {
2190
+ recipientUserId: string;
2191
+ assets?: Array<{
2192
+ assetGrantId: string;
2193
+ quantity?: number;
2194
+ }>;
2195
+ currencies?: Array<{
2196
+ currencyCode: 'shrimp_coin';
2197
+ amount: number;
2198
+ }>;
2199
+ message?: string;
2200
+ idempotencyKey: string;
2201
+ }): Promise<{
2202
+ gift: ShadowEconomyGift;
2203
+ }>;
2204
+ listGifts(): Promise<{
2205
+ gifts: ShadowEconomyGift[];
2206
+ }>;
2207
+ listSettlements(params?: {
2208
+ limit?: number;
2209
+ offset?: number;
2210
+ }): Promise<{
2211
+ settlements: ShadowSettlementLine[];
2212
+ }>;
2213
+ settleAvailableSettlements(): Promise<{
2214
+ settlements: ShadowSettlementLine[];
2215
+ }>;
2216
+ createDiyCloudRun(data: ShadowDiyCloudGenerateInput): Promise<{
2217
+ runId: string;
2218
+ status: ShadowDiyCloudRunStatus;
2219
+ createdAt: string;
2220
+ expiresAt: string;
2221
+ streamUrl: string;
2222
+ }>;
2223
+ getDiyCloudRun(runId: string): Promise<{
2224
+ run: ShadowDiyCloudRun;
2225
+ events: ShadowDiyCloudRunEvent[];
2226
+ }>;
2227
+ createDiyCloudFeedbackRun(runId: string, data: {
2228
+ feedback: string;
2229
+ prompt?: string;
2230
+ locale?: string;
2231
+ timezone?: string;
2232
+ }): Promise<{
2233
+ runId: string;
2234
+ sourceRunId: string;
2235
+ status: ShadowDiyCloudRunStatus;
2236
+ createdAt: string;
2237
+ expiresAt: string;
2238
+ streamUrl: string;
2239
+ }>;
2240
+ streamDiyCloudRun(runId: string, options?: {
2241
+ afterSeq?: number;
2242
+ }): Promise<Response>;
2243
+ cancelDiyCloudRun(runId: string): Promise<{
2244
+ ok: boolean;
2245
+ status: ShadowDiyCloudRunStatus;
2246
+ }>;
2247
+ getCloudDeploymentManifest(deploymentId: string): Promise<ShadowCloudDeploymentManifest>;
2248
+ syncCloudDeploymentTemplate(deploymentId: string, data?: {
2249
+ name?: string;
2250
+ description?: string;
2251
+ content?: Record<string, unknown>;
2252
+ tags?: string[];
2253
+ category?: string;
2254
+ baseCost?: number;
2255
+ }): Promise<ShadowCloudDeploymentTemplateSyncResult>;
2256
+ redeployCloudDeployment(deploymentId: string, data?: {
2257
+ mode?: 'snapshot' | 'template';
2258
+ templateSlug?: string;
2259
+ configSnapshot?: Record<string, unknown>;
2260
+ envVars?: Record<string, string>;
2261
+ runtimeContext?: {
2262
+ locale?: string;
2263
+ timezone?: string;
2264
+ };
2265
+ }): Promise<Record<string, unknown>>;
2266
+ pauseCloudDeployment(deploymentId: string, data?: {
2267
+ agentId?: string;
2268
+ }): Promise<ShadowCloudDeploymentRuntimeResponse>;
2269
+ resumeCloudDeployment(deploymentId: string, data?: {
2270
+ agentId?: string;
2271
+ }): Promise<ShadowCloudDeploymentRuntimeResponse>;
2272
+ listCloudDeploymentBackups(deploymentId: string, params?: {
2273
+ agentId?: string;
2274
+ }): Promise<{
2275
+ deploymentId: string;
2276
+ backups: ShadowCloudDeploymentBackup[];
2277
+ }>;
2278
+ createCloudDeploymentBackup(deploymentId: string, data?: {
2279
+ agentId?: string;
2280
+ driver?: 'volumeSnapshot' | 'restic';
2281
+ retentionDays?: number;
2282
+ }): Promise<{
2283
+ ok: boolean;
2284
+ backup: ShadowCloudDeploymentBackup;
2285
+ }>;
2286
+ restoreCloudDeploymentBackup(deploymentId: string, data?: {
2287
+ agentId?: string;
2288
+ backupId?: string;
2289
+ }): Promise<ShadowCloudDeploymentRuntimeResponse & {
2290
+ backup: ShadowCloudDeploymentBackup;
2291
+ }>;
2292
+ listCloudProviderCatalogs(): Promise<{
2293
+ providers: ShadowCloudProviderCatalog[];
2294
+ }>;
2295
+ listCloudProviderProfiles(): Promise<{
2296
+ profiles: ShadowCloudProviderProfile[];
2297
+ }>;
2298
+ upsertCloudProviderProfile(data: {
2299
+ id?: string;
2300
+ providerId: string;
2301
+ name: string;
2302
+ enabled?: boolean;
2303
+ config?: Record<string, unknown>;
2304
+ envVars?: Record<string, string>;
2305
+ }): Promise<{
2306
+ ok: boolean;
2307
+ success?: boolean;
2308
+ profile?: ShadowCloudProviderProfile;
2309
+ }>;
2310
+ testCloudProviderProfile(profileId: string): Promise<Record<string, unknown>>;
2311
+ refreshCloudProviderProfileModels(profileId: string): Promise<{
2312
+ ok: boolean;
2313
+ success?: boolean;
2314
+ status?: number | null;
2315
+ message?: string;
2316
+ models?: ShadowCloudProviderModel[];
2317
+ profile?: ShadowCloudProviderProfile;
2318
+ }>;
2319
+ deleteCloudProviderProfile(profileId: string): Promise<{
2320
+ ok: boolean;
2321
+ success?: boolean;
2322
+ }>;
2323
+ getRechargeConfig(): Promise<ShadowRechargeConfig>;
2324
+ createRechargeIntent(params: {
2325
+ tier: '1000' | '3000' | '5000' | 'custom';
2326
+ idempotencyKey: string;
2327
+ customAmount?: number;
2328
+ currency?: string;
2329
+ }): Promise<ShadowRechargeIntent>;
2330
+ getRechargeHistory(params?: {
2331
+ limit?: number;
2332
+ offset?: number;
2333
+ }): Promise<ShadowRechargeHistory>;
2334
+ confirmRechargePayment(paymentIntentId: string): Promise<ShadowPaymentOrder>;
2335
+ getEntitlements(serverId: string): Promise<ShadowEntitlement[]>;
2336
+ getAllEntitlements(): Promise<ShadowEntitlement[]>;
2337
+ verifyEntitlement(entitlementId: string): Promise<{
2338
+ active: boolean;
2339
+ entitlement: Record<string, unknown>;
2340
+ provisioning: ShadowEntitlementProvisioning;
2341
+ }>;
2342
+ cancelEntitlement(entitlementId: string, reason?: string): Promise<Record<string, unknown>>;
948
2343
  getTaskCenter(): Promise<{
949
2344
  tasks: ShadowTask[];
950
2345
  }>;
@@ -963,36 +2358,111 @@ declare class ShadowClient {
963
2358
  createdAt: string;
964
2359
  }[];
965
2360
  }>;
966
- listApps(serverId: string, params?: {
967
- status?: string;
2361
+ createApiToken(data: {
2362
+ name: string;
2363
+ scope?: string;
2364
+ expiresInDays?: number;
2365
+ }): Promise<{
2366
+ id: string;
2367
+ name: string;
2368
+ token: string;
2369
+ scope?: string;
2370
+ expiresAt?: string | null;
2371
+ createdAt: string;
2372
+ }>;
2373
+ listApiTokens(): Promise<{
2374
+ id: string;
2375
+ name: string;
2376
+ scope?: string;
2377
+ expiresAt?: string | null;
2378
+ createdAt: string;
2379
+ }[]>;
2380
+ deleteApiToken(tokenId: string): Promise<{
2381
+ ok: boolean;
2382
+ }>;
2383
+ discoverFeed(params?: {
2384
+ type?: 'all' | 'servers' | 'channels' | 'rentals';
968
2385
  limit?: number;
969
2386
  offset?: number;
970
2387
  }): Promise<{
971
- apps: ShadowApp[];
2388
+ items: Record<string, unknown>[];
972
2389
  total: number;
2390
+ hasMore: boolean;
973
2391
  }>;
974
- getHomepageApp(serverId: string): Promise<ShadowApp | null>;
975
- getApp(serverId: string, appId: string): Promise<ShadowApp>;
976
- createApp(serverId: string, data: {
977
- name: string;
978
- slug: string;
979
- type: string;
980
- url?: string;
981
- }): Promise<ShadowApp>;
982
- updateApp(serverId: string, appId: string, data: Partial<{
983
- name: string;
984
- slug: string;
985
- type: string;
986
- url: string;
987
- status: string;
988
- }>): Promise<ShadowApp>;
989
- deleteApp(serverId: string, appId: string): Promise<{
990
- success: boolean;
2392
+ discoverSearch(params: {
2393
+ q: string;
2394
+ type?: 'all' | 'servers' | 'channels' | 'rentals';
2395
+ limit?: number;
2396
+ }): Promise<{
2397
+ items: Record<string, unknown>[];
2398
+ total: number;
991
2399
  }>;
992
- publishApp(serverId: string, data: {
993
- name: string;
994
- slug: string;
995
- }): Promise<ShadowApp>;
2400
+ enhanceVoice(data: {
2401
+ transcript: string;
2402
+ language?: string;
2403
+ options?: {
2404
+ enableSelfCorrection?: boolean;
2405
+ enableListFormatting?: boolean;
2406
+ enableFillerRemoval?: boolean;
2407
+ enableToneAdjustment?: boolean;
2408
+ targetTone?: 'formal' | 'casual' | 'professional';
2409
+ };
2410
+ }): Promise<Record<string, unknown>>;
2411
+ enhanceVoiceQuery(params: {
2412
+ transcript: string;
2413
+ language?: string;
2414
+ enableSelfCorrection?: boolean;
2415
+ enableListFormatting?: boolean;
2416
+ enableFillerRemoval?: boolean;
2417
+ enableToneAdjustment?: boolean;
2418
+ targetTone?: 'formal' | 'casual' | 'professional';
2419
+ }): Promise<Record<string, unknown>>;
2420
+ getVoiceConfig(): Promise<Record<string, unknown>>;
2421
+ updateVoiceConfig(data: {
2422
+ provider: 'openai' | 'anthropic' | 'alibaba' | 'custom';
2423
+ apiKey: string;
2424
+ baseUrl?: string;
2425
+ model?: string;
2426
+ temperature?: number;
2427
+ maxTokens?: number;
2428
+ timeout?: number;
2429
+ enabled?: boolean;
2430
+ }): Promise<{
2431
+ ok: boolean;
2432
+ message: string;
2433
+ }>;
2434
+ voiceHealthCheck(): Promise<Record<string, unknown>>;
2435
+ getProfileComments(profileUserId: string, params?: {
2436
+ limit?: number;
2437
+ offset?: number;
2438
+ }): Promise<Record<string, unknown>[]>;
2439
+ getProfileCommentStats(profileUserId: string): Promise<Record<string, unknown>>;
2440
+ getCommentReplies(parentId: string, params?: {
2441
+ limit?: number;
2442
+ offset?: number;
2443
+ }): Promise<Record<string, unknown>[]>;
2444
+ createProfileComment(data: {
2445
+ profileUserId: string;
2446
+ content: string;
2447
+ parentId?: string;
2448
+ }): Promise<Record<string, unknown>>;
2449
+ deleteProfileComment(commentId: string): Promise<{
2450
+ ok: boolean;
2451
+ }>;
2452
+ addProfileCommentReaction(commentId: string, emoji: string): Promise<Record<string, unknown>>;
2453
+ removeProfileCommentReaction(commentId: string, emoji: string): Promise<{
2454
+ ok: boolean;
2455
+ }>;
2456
+ getAgentDashboard(agentId: string): Promise<Record<string, unknown>>;
2457
+ addAgentDashboardEvent(agentId: string, data: {
2458
+ eventType: string;
2459
+ eventData?: Record<string, unknown>;
2460
+ }): Promise<{
2461
+ ok: boolean;
2462
+ }>;
2463
+ archiveChannel(channelId: string, reason?: string): Promise<Record<string, unknown>>;
2464
+ unarchiveChannel(channelId: string): Promise<Record<string, unknown>>;
2465
+ getArchivedChannels(serverId: string): Promise<Record<string, unknown>[]>;
996
2466
  }
997
2467
 
998
2468
  /** Build a Socket.IO room name for a channel */
@@ -1061,25 +2531,15 @@ declare class ShadowSocket {
1061
2531
  content: string;
1062
2532
  threadId?: string;
1063
2533
  replyToId?: string;
2534
+ mentions?: ShadowMessageMention[];
2535
+ metadata?: Record<string, unknown>;
1064
2536
  }): void;
1065
- /** Send a typing indicator */
1066
- sendTyping(channelId: string): void;
2537
+ /** Send or clear a typing indicator */
2538
+ sendTyping(channelId: string, typing?: boolean): void;
1067
2539
  /** Update user presence status */
1068
2540
  updatePresence(status: 'online' | 'idle' | 'dnd' | 'offline'): void;
1069
2541
  /** Update activity status in a channel (e.g. 'thinking', 'working', null) */
1070
2542
  updateActivity(channelId: string, activity: string | null): void;
1071
- /** Join a DM channel room */
1072
- joinDmChannel(dmChannelId: string): void;
1073
- /** Leave a DM channel room */
1074
- leaveDmChannel(dmChannelId: string): void;
1075
- /** Send a DM message via WebSocket */
1076
- sendDmMessage(data: {
1077
- dmChannelId: string;
1078
- content: string;
1079
- replyToId?: string;
1080
- }): void;
1081
- /** Send a DM typing indicator */
1082
- sendDmTyping(dmChannelId: string): void;
1083
2543
  }
1084
2544
 
1085
- export { type ChannelCreatedPayload, type ChannelMemberAddedPayload, type ChannelMemberRemovedPayload, type ClientEventMap, type DmMessage, type MemberJoinPayload, type MemberLeavePayload, type MessageDeletedPayload, type PolicyChangedPayload, type PresenceActivityPayload, type PresenceChangePayload, type ReactionPayload, type ServerEventMap, type ServerJoinedPayload, type ShadowApp, type ShadowAttachment, type ShadowCartItem, type ShadowCategory, type ShadowChannel, type ShadowChannelPolicy, ShadowClient, type ShadowContract, type ShadowDmChannel, type ShadowFriendship, type ShadowInviteCode, type ShadowListing, type ShadowMember, type ShadowMessage, type ShadowNotification, type ShadowNotificationPreferences, type ShadowOAuthApp, type ShadowOAuthConsent, type ShadowOAuthToken, type ShadowOrder, type ShadowProduct, type ShadowRemoteChannel, type ShadowRemoteConfig, type ShadowRemoteServer, type ShadowReview, type ShadowServer, type ShadowShop, ShadowSocket, type ShadowSocketOptions, type ShadowTask, type ShadowThread, type ShadowTransaction, type ShadowUser, type ShadowWallet, type TypingPayload, channelRoom, threadRoom, userRoom };
2545
+ export { type ChannelCreatedPayload, type ChannelMemberAddedPayload, type ChannelMemberRemovedPayload, type ClientEventMap, type MemberJoinPayload, type MemberLeavePayload, type MessageDeletedPayload, type PolicyChangedPayload, type PresenceActivityPayload, type PresenceChangePayload, type ReactionPayload, type ServerEventMap, type ServerJoinedPayload, type ShadowAddAgentsToServerResult, type ShadowAgentUsageSnapshotInput, type ShadowAttachment, type ShadowCartItem, type ShadowCategory, type ShadowChannel, type ShadowChannelAccess, type ShadowChannelJoinRequestResult, type ShadowChannelJoinRequestStatus, type ShadowChannelPolicy, type ShadowChannelSlashCommand, ShadowClient, type ShadowCloudDeploymentBackup, type ShadowCloudDeploymentRuntimeResponse, type ShadowCloudDeploymentStatus, type ShadowCloudProviderCatalog, type ShadowCloudProviderEnvVar, type ShadowCloudProviderModel, type ShadowCloudProviderProfile, type ShadowContract, type ShadowDiyCloudRun, type ShadowDiyCloudRunEvent, type ShadowDiyCloudRunStatus, type ShadowFriendship, type ShadowInteractiveActionInput, type ShadowInteractiveActionResult, type ShadowInteractiveBlock, type ShadowInteractiveResponse, type ShadowInteractiveState, type ShadowInteractiveSubmissionPending, type ShadowInviteCode, type ShadowListing, type ShadowMember, type ShadowMentionSuggestion, type ShadowMentionSuggestionTrigger, type ShadowMessage, type ShadowMessageMention, type ShadowModelProxyBilling, type ShadowModelProxyChatCompletionRequest, type ShadowModelProxyChatCompletionResponse, type ShadowModelProxyModel, type ShadowModelProxyModelsResponse, type ShadowNotification, type ShadowNotificationPreferences, type ShadowOAuthApp, type ShadowOAuthConsent, type ShadowOAuthToken, type ShadowOrder, type ShadowProduct, type ShadowRemoteChannel, type ShadowRemoteConfig, type ShadowRemoteServer, type ShadowReview, type ShadowServer, type ShadowServerAccess, type ShadowServerJoinRequestResult, type ShadowServerJoinRequestStatus, type ShadowShop, type ShadowSlashCommand, ShadowSocket, type ShadowSocketOptions, type ShadowTask, type ShadowThread, type ShadowTransaction, type ShadowUsageProviderSnapshot, type ShadowUser, type ShadowWallet, type TypingPayload, channelRoom, threadRoom, userRoom };