@shadowob/sdk 1.1.3 → 1.1.5

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.cts CHANGED
@@ -1,6 +1,7 @@
1
- import { MessageMention, MentionSuggestionTrigger, MentionSuggestion } from '@shadowob/shared';
1
+ import { MessageMention, OAuthLinkCard, MentionSuggestionTrigger, MentionSuggestion } from '@shadowob/shared';
2
2
  export { CLIENT_EVENTS, ClientEvent, SERVER_EVENTS, ServerEvent } from '@shadowob/shared';
3
3
  import { Socket } from 'socket.io-client';
4
+ import { IRemoteAudioTrack, IRemoteVideoTrack } from 'agora-rtc-sdk-ng';
4
5
 
5
6
  /** Message returned by the Shadow REST API and Socket.IO broadcasts */
6
7
  interface ShadowMessage {
@@ -94,6 +95,7 @@ interface ShadowMessageMetadata {
94
95
  interactiveResponse?: ShadowInteractiveResponse;
95
96
  interactiveState?: ShadowInteractiveState;
96
97
  commerceCards?: Array<ShadowCommerceProductCard | ShadowCommerceOfferCardInput>;
98
+ oauthLinkCards?: ShadowOAuthLinkCard[];
97
99
  [key: string]: unknown;
98
100
  }
99
101
  interface ShadowCommerceOfferCardInput {
@@ -102,6 +104,7 @@ interface ShadowCommerceOfferCardInput {
102
104
  offerId: string;
103
105
  }
104
106
  type ShadowMessageMention = MessageMention;
107
+ type ShadowOAuthLinkCard = OAuthLinkCard;
105
108
  type ShadowMentionSuggestion = MentionSuggestion;
106
109
  type ShadowMentionSuggestionTrigger = MentionSuggestionTrigger;
107
110
  interface ShadowAttachment {
@@ -118,6 +121,149 @@ interface ShadowSignedMediaUrl {
118
121
  url: string;
119
122
  expiresAt: string;
120
123
  }
124
+ type ShadowMediaVariant = 'avatar' | 'preview' | 'banner';
125
+ type ShadowServerAppAction = 'read' | 'write' | 'manage' | 'delete' | 'generate';
126
+ type ShadowServerAppDataClass = 'public' | 'server-private' | 'channel-private' | 'financial' | 'secret' | 'cloud-secret';
127
+ interface ShadowServerAppCommand {
128
+ name: string;
129
+ title?: string;
130
+ description?: string;
131
+ path: string;
132
+ method?: 'POST';
133
+ input?: 'json' | 'multipart';
134
+ inputSchema?: Record<string, unknown>;
135
+ permission: string;
136
+ action: ShadowServerAppAction;
137
+ dataClass: ShadowServerAppDataClass;
138
+ approvalMode?: 'none' | 'first_time' | 'every_time' | 'policy';
139
+ binary?: {
140
+ supported?: boolean;
141
+ field?: string;
142
+ maxBytes?: number;
143
+ contentTypes?: string[];
144
+ };
145
+ }
146
+ interface ShadowServerAppManifest {
147
+ schemaVersion: 'shadow.app/1';
148
+ appKey: string;
149
+ name: string;
150
+ description?: string;
151
+ version?: string;
152
+ iconUrl: string;
153
+ iframe?: {
154
+ entry: string;
155
+ allowedOrigins: string[];
156
+ };
157
+ api: {
158
+ baseUrl: string;
159
+ auth?: {
160
+ type: 'oauth2-bearer';
161
+ };
162
+ };
163
+ commands: ShadowServerAppCommand[];
164
+ skills?: Array<{
165
+ name: string;
166
+ description: string;
167
+ commandHints?: string[];
168
+ }>;
169
+ events?: string[];
170
+ binary?: {
171
+ supported: boolean;
172
+ maxBytes?: number;
173
+ contentTypes?: string[];
174
+ };
175
+ }
176
+ interface ShadowServerAppIntegration {
177
+ id: string;
178
+ serverId: string;
179
+ appKey: string;
180
+ name: string;
181
+ description?: string | null;
182
+ iconUrl?: string | null;
183
+ manifestUrl?: string | null;
184
+ manifest: ShadowServerAppManifest;
185
+ iframeEntry?: string | null;
186
+ allowedOrigins: string[];
187
+ apiBaseUrl: string;
188
+ status: string;
189
+ installedByUserId: string;
190
+ createdAt: string;
191
+ updatedAt: string;
192
+ }
193
+ interface ShadowServerAppDiscovery {
194
+ manifest: ShadowServerAppManifest;
195
+ installed: ShadowServerAppIntegration | null;
196
+ permissions: Array<{
197
+ name: string;
198
+ title: string;
199
+ description?: string | null;
200
+ permission: string;
201
+ action: ShadowServerAppAction;
202
+ dataClass: ShadowServerAppDataClass;
203
+ approvalMode: 'none' | 'first_time' | 'every_time' | 'policy';
204
+ }>;
205
+ }
206
+ interface ShadowServerAppCatalogEntry {
207
+ id: string;
208
+ appKey: string;
209
+ name: string;
210
+ description?: string | null;
211
+ iconUrl?: string | null;
212
+ manifestUrl?: string | null;
213
+ manifest: ShadowServerAppManifest;
214
+ status: string;
215
+ installed?: ShadowServerAppIntegration | null;
216
+ permissions?: ShadowServerAppDiscovery['permissions'];
217
+ createdAt: string;
218
+ updatedAt: string;
219
+ }
220
+ interface ShadowServerAppLaunchContext {
221
+ serverId: string;
222
+ serverAppId: string;
223
+ appKey: string;
224
+ iframeEntry: string | null;
225
+ allowedOrigins: string[];
226
+ launchToken: string;
227
+ eventStreamPath: string;
228
+ expiresIn: number;
229
+ }
230
+ interface ShadowServerAppSkillDocument {
231
+ appKey: string;
232
+ markdown: string;
233
+ skills: Array<{
234
+ name: string;
235
+ description: string;
236
+ commandHints?: string[];
237
+ }>;
238
+ }
239
+ interface ShadowServerAppTokenIntrospection {
240
+ active: boolean;
241
+ token_type?: 'Bearer';
242
+ iss?: string;
243
+ aud?: string;
244
+ sub?: string;
245
+ scope?: string;
246
+ client_id?: string;
247
+ exp?: number;
248
+ iat?: number;
249
+ shadow?: {
250
+ protocol: 'shadow.app/1';
251
+ serverId: string;
252
+ serverAppId: string;
253
+ appKey: string;
254
+ command?: string;
255
+ actor: {
256
+ kind?: string;
257
+ userId?: string | null;
258
+ buddyAgentId?: string | null;
259
+ ownerId?: string | null;
260
+ };
261
+ channelId?: string | null;
262
+ permission?: string;
263
+ action?: string;
264
+ dataClass?: string;
265
+ };
266
+ }
121
267
  interface ShadowChannel {
122
268
  id: string;
123
269
  name: string;
@@ -146,6 +292,65 @@ interface ShadowChannelJoinRequestResult {
146
292
  status: ShadowChannelJoinRequestStatus;
147
293
  requestId?: string;
148
294
  }
295
+ interface ShadowVoiceParticipant {
296
+ id: string;
297
+ channelId: string;
298
+ userId: string;
299
+ uid: number;
300
+ screenUid: number;
301
+ username: string;
302
+ displayName: string | null;
303
+ avatarUrl: string | null;
304
+ isBot: boolean;
305
+ isMuted: boolean;
306
+ isDeafened: boolean;
307
+ isSpeaking: boolean;
308
+ isScreenSharing: boolean;
309
+ joinedAt: string;
310
+ updatedAt: string;
311
+ clientId: string | null;
312
+ }
313
+ interface ShadowVoiceCredentials {
314
+ appId: string;
315
+ channelId: string;
316
+ agoraChannelName: string;
317
+ uid: number;
318
+ screenUid: number;
319
+ token: string | null;
320
+ screenToken: string | null;
321
+ expiresAt: string | null;
322
+ }
323
+ interface ShadowVoiceState {
324
+ channelId: string;
325
+ agoraChannelName: string;
326
+ participants: ShadowVoiceParticipant[];
327
+ participantCount: number;
328
+ emptySince: string | null;
329
+ graceEndsAt: string | null;
330
+ }
331
+ interface ShadowVoiceJoinResult {
332
+ credentials: ShadowVoiceCredentials;
333
+ participant: ShadowVoiceParticipant;
334
+ state: ShadowVoiceState;
335
+ }
336
+ interface ShadowVoiceLeaveResult {
337
+ participant: ShadowVoiceParticipant | null;
338
+ state: ShadowVoiceState;
339
+ left?: boolean;
340
+ }
341
+ interface ShadowVoiceRenewResult {
342
+ credentials: ShadowVoiceCredentials;
343
+ state: ShadowVoiceState;
344
+ }
345
+ interface ShadowVoicePolicy {
346
+ agentId: string;
347
+ channelId: string;
348
+ listen: boolean;
349
+ autoJoin: boolean;
350
+ consumeAudio: boolean;
351
+ consumeScreenShare: boolean;
352
+ screenshotIntervalSeconds: number | null;
353
+ }
149
354
  type ShadowServerJoinRequestStatus = 'pending' | 'approved' | 'rejected';
150
355
  interface ShadowServerAccess {
151
356
  server: ShadowServer;
@@ -215,7 +420,6 @@ interface ShadowServer {
215
420
  description: string | null;
216
421
  iconUrl: string | null;
217
422
  bannerUrl: string | null;
218
- homepageHtml: string | null;
219
423
  isPublic: boolean;
220
424
  }
221
425
  interface ShadowUser {
@@ -385,7 +589,15 @@ interface ShadowChannelPolicy {
385
589
  listen: boolean;
386
590
  reply: boolean;
387
591
  mentionOnly: boolean;
388
- config: Record<string, unknown>;
592
+ config: ShadowChannelPolicyConfig;
593
+ }
594
+ interface ShadowChannelPolicyConfig {
595
+ allowedTriggerUserIds?: string[];
596
+ triggerUserIds?: string[];
597
+ ownerId?: string;
598
+ activeTenantIds?: string[];
599
+ replyRequiresMention?: boolean;
600
+ [key: string]: unknown;
389
601
  }
390
602
  interface ShadowSlashCommand {
391
603
  name: string;
@@ -401,6 +613,20 @@ interface ShadowChannelSlashCommand extends ShadowSlashCommand {
401
613
  botUsername: string;
402
614
  botDisplayName?: string | null;
403
615
  }
616
+ interface ShadowChannelBootstrap {
617
+ access: ShadowChannelAccess;
618
+ channel: ShadowChannel;
619
+ server: ShadowServer | null;
620
+ channels: ShadowChannel[];
621
+ members: ShadowMember[];
622
+ messages: {
623
+ messages: ShadowMessage[];
624
+ hasMore: boolean;
625
+ };
626
+ slashCommands: {
627
+ commands: ShadowChannelSlashCommand[];
628
+ };
629
+ }
404
630
  interface ShadowRemoteChannel {
405
631
  id: string;
406
632
  name: string;
@@ -418,6 +644,11 @@ interface ShadowRemoteServer {
418
644
  interface ShadowRemoteConfig {
419
645
  agentId: string;
420
646
  botUserId: string;
647
+ ownerId?: string;
648
+ buddyMode?: 'private' | 'shareable';
649
+ allowedServerIds?: string[];
650
+ activeTenantIds?: string[];
651
+ allowedTriggerUserIds?: string[];
421
652
  slashCommands?: ShadowSlashCommand[];
422
653
  servers: ShadowRemoteServer[];
423
654
  }
@@ -510,6 +741,15 @@ interface PolicyChangedPayload {
510
741
  serverId: string;
511
742
  channelId?: string | null;
512
743
  }
744
+ interface VoiceParticipantPayload {
745
+ channelId: string;
746
+ participant: ShadowVoiceParticipant | null;
747
+ state: ShadowVoiceState;
748
+ }
749
+ interface VoicePolicyUpdatedPayload {
750
+ channelId: string;
751
+ agentId: string;
752
+ }
513
753
  interface ShadowFriendship {
514
754
  id: string;
515
755
  userId: string;
@@ -668,6 +908,8 @@ interface ShadowCommerceProductCard {
668
908
  name: string;
669
909
  summary?: string | null;
670
910
  imageUrl?: string | null;
911
+ shopName?: string | null;
912
+ deliveryPromise?: string | null;
671
913
  price: number;
672
914
  currency: string;
673
915
  productType: 'physical' | 'entitlement';
@@ -761,6 +1003,68 @@ interface ShadowEntitlement {
761
1003
  sizeBytes?: number | null;
762
1004
  previewUrl?: string | null;
763
1005
  } | null;
1006
+ buyer?: {
1007
+ id: string;
1008
+ username: string;
1009
+ displayName?: string | null;
1010
+ avatarUrl?: string | null;
1011
+ } | null;
1012
+ order?: (Omit<ShadowOrder, 'items' | 'currency'> & {
1013
+ currency?: string | null;
1014
+ items?: ShadowOrder['items'];
1015
+ }) | null;
1016
+ fulfillmentJobs?: Array<Record<string, unknown>>;
1017
+ }
1018
+ interface ShadowOAuthCommerceEntitlementSummary {
1019
+ id: string;
1020
+ status: string;
1021
+ capability: string;
1022
+ resourceType: string;
1023
+ resourceId: string;
1024
+ productId?: string | null;
1025
+ shopId?: string | null;
1026
+ orderId?: string | null;
1027
+ offerId?: string | null;
1028
+ expiresAt?: string | null;
1029
+ }
1030
+ interface ShadowOAuthCommerceEntitlementAccess {
1031
+ allowed: boolean;
1032
+ status: string;
1033
+ reasonCode?: string | null;
1034
+ resourceType: string;
1035
+ resourceId: string;
1036
+ capability: string;
1037
+ app: {
1038
+ id: string;
1039
+ };
1040
+ entitlement?: ShadowOAuthCommerceEntitlementSummary | null;
1041
+ }
1042
+ interface ShadowOAuthCommerceEntitlementRedeemInput {
1043
+ idempotencyKey: string;
1044
+ resourceType?: string;
1045
+ resourceId?: string;
1046
+ capability?: string;
1047
+ metadata?: Record<string, string | number | boolean | null>;
1048
+ }
1049
+ interface ShadowOAuthCommerceEntitlementRedemption {
1050
+ appId: string;
1051
+ resourceType: string;
1052
+ resourceId: string;
1053
+ capability: string;
1054
+ idempotencyKey: string;
1055
+ redeemedAt: string;
1056
+ metadata?: Record<string, string | number | boolean | null>;
1057
+ }
1058
+ interface ShadowOAuthCommerceEntitlementRedeemResult {
1059
+ redeemed: true;
1060
+ resourceType: string;
1061
+ resourceId: string;
1062
+ capability: string;
1063
+ app: {
1064
+ id: string;
1065
+ };
1066
+ entitlement: ShadowOAuthCommerceEntitlementSummary;
1067
+ redemption: ShadowOAuthCommerceEntitlementRedemption;
764
1068
  }
765
1069
  interface ShadowEntitlementPurchaseResult {
766
1070
  order: {
@@ -842,6 +1146,80 @@ interface ShadowCommerceCheckoutPreview {
842
1146
  };
843
1147
  nextAction: 'purchase' | 'open_paid_file' | 'view_entitlement' | string;
844
1148
  }
1149
+ interface ShadowCommerceProductContext {
1150
+ product: ShadowProduct;
1151
+ shop: ShadowShop & {
1152
+ logoUrl?: string | null;
1153
+ bannerUrl?: string | null;
1154
+ };
1155
+ server: {
1156
+ id: string;
1157
+ name: string;
1158
+ slug?: string | null;
1159
+ description?: string | null;
1160
+ iconUrl?: string | null;
1161
+ bannerUrl?: string | null;
1162
+ ownerId?: string | null;
1163
+ } | null;
1164
+ provider: {
1165
+ id: string;
1166
+ username: string;
1167
+ displayName?: string | null;
1168
+ avatarUrl?: string | null;
1169
+ isBot?: boolean;
1170
+ } | null;
1171
+ buddy: {
1172
+ id: string;
1173
+ userId: string;
1174
+ ownerId: string;
1175
+ status: string;
1176
+ totalOnlineSeconds?: number | null;
1177
+ lastHeartbeat?: string | null;
1178
+ } | null;
1179
+ offer: {
1180
+ id: string;
1181
+ status: string;
1182
+ priceOverride?: number | null;
1183
+ currency: string;
1184
+ allowedSurfaces?: string[] | null;
1185
+ sellerUserId?: string | null;
1186
+ sellerBuddyUserId?: string | null;
1187
+ } | null;
1188
+ fulfillment: {
1189
+ status: string;
1190
+ resourceType?: string | null;
1191
+ resourceId?: string | null;
1192
+ capability?: string | null;
1193
+ deliverables: Array<{
1194
+ id: string;
1195
+ kind: string;
1196
+ resourceType?: string | null;
1197
+ resourceId?: string | null;
1198
+ deliveryTiming?: string | null;
1199
+ status: string;
1200
+ }>;
1201
+ };
1202
+ refund: {
1203
+ policy: string;
1204
+ status: string;
1205
+ supportPath?: string | null;
1206
+ };
1207
+ credit: {
1208
+ salesCount: number;
1209
+ avgRating: number;
1210
+ ratingCount: number;
1211
+ completedOrders: number;
1212
+ };
1213
+ links: {
1214
+ product: string;
1215
+ shop?: string | null;
1216
+ server?: string | null;
1217
+ providerProfile?: string | null;
1218
+ buddyProfile?: string | null;
1219
+ assetHome?: string | null;
1220
+ checkoutPreview?: string | null;
1221
+ };
1222
+ }
845
1223
  interface ShadowPaidFileOpenResult {
846
1224
  grant: {
847
1225
  id: string;
@@ -858,18 +1236,54 @@ interface ShadowCategory {
858
1236
  description?: string | null;
859
1237
  position: number;
860
1238
  }
1239
+ interface ShadowProductMedia {
1240
+ id?: string;
1241
+ type?: 'image' | 'video' | string;
1242
+ url: string;
1243
+ thumbnailUrl?: string | null;
1244
+ position?: number;
1245
+ }
1246
+ interface ShadowProductSku {
1247
+ id: string;
1248
+ specValues: string[];
1249
+ price: number;
1250
+ stock: number;
1251
+ imageUrl?: string | null;
1252
+ skuCode?: string | null;
1253
+ isActive?: boolean;
1254
+ }
1255
+ interface ShadowProductEntitlementConfig {
1256
+ resourceType?: string;
1257
+ resourceId?: string;
1258
+ capability?: string;
1259
+ durationSeconds?: number | null;
1260
+ renewalPeriodSeconds?: number | null;
1261
+ privilegeDescription?: string;
1262
+ }
861
1263
  interface ShadowProduct {
862
1264
  id: string;
863
1265
  shopId: string;
864
1266
  categoryId?: string | null;
865
1267
  name: string;
1268
+ slug?: string;
1269
+ type?: 'physical' | 'entitlement' | string;
866
1270
  description?: string | null;
867
- price: number;
1271
+ summary?: string | null;
1272
+ price?: number;
1273
+ basePrice?: number;
868
1274
  currency: string;
869
- stock: number;
1275
+ stock?: number;
870
1276
  status: string;
1277
+ specNames?: string[];
1278
+ tags?: string[];
1279
+ salesCount?: number;
1280
+ avgRating?: number;
1281
+ ratingCount?: number;
871
1282
  billingMode?: 'one_time' | 'fixed_duration' | 'subscription';
872
- images: string[];
1283
+ entitlementConfig?: ShadowProductEntitlementConfig | ShadowProductEntitlementConfig[] | null;
1284
+ media?: ShadowProductMedia[];
1285
+ skus?: ShadowProductSku[];
1286
+ images?: string[];
873
1287
  createdAt: string;
874
1288
  }
875
1289
  interface ShadowCartItem {
@@ -880,17 +1294,29 @@ interface ShadowCartItem {
880
1294
  }
881
1295
  interface ShadowOrder {
882
1296
  id: string;
1297
+ orderNo?: string;
883
1298
  shopId: string;
884
1299
  buyerId: string;
885
- status: string;
1300
+ status: 'pending' | 'paid' | 'processing' | 'shipped' | 'delivered' | 'completed' | 'cancelled' | 'refunded' | string;
886
1301
  totalAmount: number;
887
1302
  currency: string;
888
- items: {
1303
+ trackingNo?: string | null;
1304
+ buyerNote?: string | null;
1305
+ sellerNote?: string | null;
1306
+ paidAt?: string | null;
1307
+ shippedAt?: string | null;
1308
+ completedAt?: string | null;
1309
+ cancelledAt?: string | null;
1310
+ items: Array<{
1311
+ id?: string;
889
1312
  productId: string;
890
1313
  skuId?: string | null;
1314
+ productName?: string;
1315
+ specValues?: string[];
891
1316
  quantity: number;
892
1317
  price: number;
893
- }[];
1318
+ imageUrl?: string | null;
1319
+ }>;
894
1320
  createdAt: string;
895
1321
  }
896
1322
  interface ShadowReview {
@@ -1328,6 +1754,11 @@ interface ServerEventMap {
1328
1754
  'channel:member-added': (payload: ChannelMemberAddedPayload) => void;
1329
1755
  'channel:member-removed': (payload: ChannelMemberRemovedPayload) => void;
1330
1756
  'channel:slash-commands-updated': (payload: SlashCommandsUpdatedPayload) => void;
1757
+ 'voice:state': (payload: ShadowVoiceState) => void;
1758
+ 'voice:participant-joined': (payload: VoiceParticipantPayload) => void;
1759
+ 'voice:participant-left': (payload: VoiceParticipantPayload) => void;
1760
+ 'voice:participant-updated': (payload: VoiceParticipantPayload) => void;
1761
+ 'voice:policy-updated': (payload: VoicePolicyUpdatedPayload) => void;
1331
1762
  'server:joined': (payload: ServerJoinedPayload) => void;
1332
1763
  'agent:policy-changed': (payload: PolicyChangedPayload) => void;
1333
1764
  error: (payload: {
@@ -1344,6 +1775,52 @@ interface ClientEventMap {
1344
1775
  'channel:leave': (data: {
1345
1776
  channelId: string;
1346
1777
  }) => void;
1778
+ 'voice:join': (data: {
1779
+ channelId: string;
1780
+ clientId?: string;
1781
+ muted?: boolean;
1782
+ deafened?: boolean;
1783
+ }, ack?: (res: {
1784
+ ok: boolean;
1785
+ data?: ShadowVoiceJoinResult;
1786
+ error?: string;
1787
+ code?: string;
1788
+ }) => void) => void;
1789
+ 'voice:leave': (data: {
1790
+ channelId: string;
1791
+ clientId?: string | null;
1792
+ }, ack?: (res: {
1793
+ ok: boolean;
1794
+ data?: ShadowVoiceLeaveResult;
1795
+ error?: string;
1796
+ code?: string;
1797
+ }) => void) => void;
1798
+ 'voice:state:update': (data: {
1799
+ channelId: string;
1800
+ clientId?: string | null;
1801
+ muted?: boolean;
1802
+ deafened?: boolean;
1803
+ speaking?: boolean;
1804
+ screenSharing?: boolean;
1805
+ }, ack?: (res: {
1806
+ ok: boolean;
1807
+ data?: unknown;
1808
+ error?: string;
1809
+ code?: string;
1810
+ }) => void) => void;
1811
+ 'voice:token:renew': (data: {
1812
+ channelId: string;
1813
+ clientId?: string | null;
1814
+ }, ack?: (res: {
1815
+ ok: boolean;
1816
+ data?: ShadowVoiceRenewResult;
1817
+ error?: string;
1818
+ code?: string;
1819
+ }) => void) => void;
1820
+ 'voice:heartbeat': (data: {
1821
+ channelId: string;
1822
+ clientId?: string | null;
1823
+ }) => void;
1347
1824
  'message:send': (data: {
1348
1825
  channelId: string;
1349
1826
  content: string;
@@ -1426,10 +1903,15 @@ declare class ShadowClient {
1426
1903
  getOfficialModelProxyBilling(): Promise<ShadowModelProxyBilling>;
1427
1904
  createOfficialChatCompletion(data: ShadowModelProxyChatCompletionRequest): Promise<ShadowModelProxyChatCompletionResponse>;
1428
1905
  createOfficialChatCompletionStream(data: ShadowModelProxyChatCompletionRequest): Promise<Response>;
1429
- listAgents(): Promise<{
1906
+ listAgents(options?: {
1907
+ includeRentals?: boolean;
1908
+ }): Promise<{
1430
1909
  id: string;
1431
- name: string;
1910
+ name?: string;
1432
1911
  status: string;
1912
+ accessRole?: 'owner' | 'tenant';
1913
+ activeContractId?: string | null;
1914
+ config?: Record<string, unknown>;
1433
1915
  }[]>;
1434
1916
  createAgent(data: {
1435
1917
  name: string;
@@ -1439,6 +1921,8 @@ declare class ShadowClient {
1439
1921
  avatarUrl?: string | null;
1440
1922
  kernelType?: string;
1441
1923
  config?: Record<string, unknown>;
1924
+ buddyMode?: 'private' | 'shareable';
1925
+ allowedServerIds?: string[];
1442
1926
  }): Promise<{
1443
1927
  id: string;
1444
1928
  token: string;
@@ -1454,6 +1938,8 @@ declare class ShadowClient {
1454
1938
  name?: string;
1455
1939
  displayName?: string;
1456
1940
  avatarUrl?: string | null;
1941
+ buddyMode?: 'private' | 'shareable';
1942
+ allowedServerIds?: string[];
1457
1943
  }): Promise<{
1458
1944
  id: string;
1459
1945
  name: string;
@@ -1524,14 +2010,50 @@ declare class ShadowClient {
1524
2010
  listServers(): Promise<ShadowServer[]>;
1525
2011
  getServer(serverIdOrSlug: string): Promise<ShadowServer>;
1526
2012
  getServerAccess(serverIdOrSlug: string): Promise<ShadowServerAccess>;
2013
+ listServerApps(serverIdOrSlug: string): Promise<ShadowServerAppIntegration[]>;
2014
+ listServerAppCatalog(serverIdOrSlug: string): Promise<ShadowServerAppCatalogEntry[]>;
2015
+ discoverServerApp(serverIdOrSlug: string, data: {
2016
+ manifestUrl?: string;
2017
+ manifest?: ShadowServerAppManifest;
2018
+ }): Promise<ShadowServerAppDiscovery>;
2019
+ installServerApp(serverIdOrSlug: string, data: {
2020
+ manifestUrl?: string;
2021
+ manifest?: ShadowServerAppManifest;
2022
+ }): Promise<ShadowServerAppIntegration>;
2023
+ installServerAppFromCatalog(serverIdOrSlug: string, catalogEntryId: string, data?: Record<string, never>): Promise<ShadowServerAppIntegration>;
2024
+ getServerApp(serverIdOrSlug: string, appKey: string): Promise<ShadowServerAppIntegration & {
2025
+ grants?: Record<string, unknown>[];
2026
+ }>;
2027
+ deleteServerApp(serverIdOrSlug: string, appKey: string): Promise<{
2028
+ ok: boolean;
2029
+ }>;
2030
+ grantServerAppToBuddy(serverIdOrSlug: string, appKey: string, data: {
2031
+ buddyAgentId: string;
2032
+ permissions: string[];
2033
+ resourceRules?: Record<string, unknown>;
2034
+ approvalMode?: 'none' | 'first_time' | 'every_time' | 'policy';
2035
+ expiresAt?: string;
2036
+ }): Promise<Record<string, unknown>>;
2037
+ getServerAppSkills(serverIdOrSlug: string, appKey: string): Promise<ShadowServerAppSkillDocument>;
2038
+ createServerAppLaunch(serverIdOrSlug: string, appKey: string): Promise<ShadowServerAppLaunchContext>;
2039
+ introspectServerAppToken(serverIdOrSlug: string, appKey: string, token: string): Promise<ShadowServerAppTokenIntrospection>;
2040
+ callServerAppCommand(serverIdOrSlug: string, appKey: string, commandName: string, data?: {
2041
+ input?: unknown;
2042
+ channelId?: string;
2043
+ }): Promise<unknown>;
2044
+ callServerAppCommandMultipart(serverIdOrSlug: string, appKey: string, commandName: string, data: {
2045
+ input?: unknown;
2046
+ channelId?: string;
2047
+ file: Blob;
2048
+ filename: string;
2049
+ field?: string;
2050
+ }): Promise<unknown>;
1527
2051
  updateServer(serverIdOrSlug: string, data: {
1528
2052
  name?: string;
1529
2053
  description?: string | null;
1530
2054
  slug?: string | null;
1531
- homepageHtml?: string | null;
1532
2055
  isPublic?: boolean;
1533
2056
  }): Promise<ShadowServer>;
1534
- updateServerHomepage(serverIdOrSlug: string, homepageHtml: string | null): Promise<ShadowServer>;
1535
2057
  deleteServer(serverId: string): Promise<{
1536
2058
  success: boolean;
1537
2059
  }>;
@@ -1564,6 +2086,9 @@ declare class ShadowClient {
1564
2086
  isPrivate?: boolean;
1565
2087
  }): Promise<ShadowChannel>;
1566
2088
  getChannel(channelId: string): Promise<ShadowChannel>;
2089
+ getChannelBootstrap(channelId: string, options?: {
2090
+ messagesLimit?: number;
2091
+ }): Promise<ShadowChannelBootstrap>;
1567
2092
  getChannelAccess(channelId: string): Promise<ShadowChannelAccess>;
1568
2093
  getChannelMembers(channelId: string): Promise<ShadowMember[]>;
1569
2094
  updateChannel(channelId: string, data: {
@@ -1586,6 +2111,37 @@ declare class ShadowClient {
1586
2111
  removeChannelMember(channelId: string, userId: string): Promise<{
1587
2112
  success: boolean;
1588
2113
  }>;
2114
+ getVoiceState(channelId: string): Promise<ShadowVoiceState>;
2115
+ joinVoiceChannel(channelId: string, options?: {
2116
+ clientId?: string | null;
2117
+ muted?: boolean;
2118
+ deafened?: boolean;
2119
+ }): Promise<ShadowVoiceJoinResult>;
2120
+ renewVoiceCredentials(channelId: string, options?: {
2121
+ clientId?: string | null;
2122
+ }): Promise<ShadowVoiceRenewResult>;
2123
+ leaveVoiceChannel(channelId: string, options?: {
2124
+ clientId?: string | null;
2125
+ }): Promise<ShadowVoiceLeaveResult>;
2126
+ updateVoiceState(channelId: string, data: {
2127
+ clientId?: string | null;
2128
+ muted?: boolean;
2129
+ deafened?: boolean;
2130
+ speaking?: boolean;
2131
+ screenSharing?: boolean;
2132
+ }): Promise<{
2133
+ participant: unknown;
2134
+ state: ShadowVoiceState;
2135
+ }>;
2136
+ getVoicePolicy(channelId: string, agentId: string): Promise<ShadowVoicePolicy>;
2137
+ updateVoicePolicy(channelId: string, data: {
2138
+ agentId: string;
2139
+ listen?: boolean;
2140
+ autoJoin?: boolean;
2141
+ consumeAudio?: boolean;
2142
+ consumeScreenShare?: boolean;
2143
+ screenshotIntervalSeconds?: number | null;
2144
+ }): Promise<ShadowVoicePolicy>;
1589
2145
  setBuddyPolicy(channelId: string, agentId: string, data: {
1590
2146
  mentionOnly?: boolean;
1591
2147
  reply?: boolean;
@@ -1699,6 +2255,11 @@ declare class ShadowClient {
1699
2255
  }>;
1700
2256
  resolveAttachmentMediaUrl(attachmentId: string, options?: {
1701
2257
  disposition?: 'inline' | 'attachment';
2258
+ variant?: ShadowMediaVariant;
2259
+ }): Promise<ShadowSignedMediaUrl>;
2260
+ resolveWorkspaceMediaUrl(serverId: string, fileId: string, options?: {
2261
+ disposition?: 'inline' | 'attachment';
2262
+ contentRef?: string;
1702
2263
  }): Promise<ShadowSignedMediaUrl>;
1703
2264
  /**
1704
2265
  * Download a file from a URL and upload it to the Shadow media service.
@@ -1788,11 +2349,28 @@ declare class ShadowClient {
1788
2349
  listOAuthAccounts(): Promise<{
1789
2350
  id: string;
1790
2351
  provider: string;
1791
- providerAccountId: string;
2352
+ providerEmail: string | null;
2353
+ createdAt: string;
1792
2354
  }[]>;
2355
+ createOAuthConnectUrl(provider: 'google' | 'github', redirect?: string): Promise<{
2356
+ url: string;
2357
+ }>;
1793
2358
  unlinkOAuthAccount(accountId: string): Promise<{
1794
2359
  success: boolean;
1795
2360
  }>;
2361
+ listAuthSessions(): Promise<Array<{
2362
+ id: string;
2363
+ deviceName: string | null;
2364
+ userAgent: string | null;
2365
+ ipAddress: string | null;
2366
+ lastSeenAt: string;
2367
+ createdAt: string;
2368
+ revokedAt: string | null;
2369
+ current: boolean;
2370
+ }>>;
2371
+ revokeAuthSession(sessionId: string): Promise<{
2372
+ ok: boolean;
2373
+ }>;
1796
2374
  changePassword(data: {
1797
2375
  currentPassword: string;
1798
2376
  newPassword: string;
@@ -1883,6 +2461,18 @@ declare class ShadowClient {
1883
2461
  revokeOAuthConsent(appId: string): Promise<{
1884
2462
  success: boolean;
1885
2463
  }>;
2464
+ sendOAuthChannelMessage(channelId: string, content: string, opts?: {
2465
+ metadata?: {
2466
+ oauthLinkCards?: ShadowOAuthLinkCard[];
2467
+ };
2468
+ }): Promise<ShadowMessage>;
2469
+ sendOAuthBuddyMessage(buddyId: string, data: {
2470
+ channelId: string;
2471
+ content: string;
2472
+ metadata?: {
2473
+ oauthLinkCards?: ShadowOAuthLinkCard[];
2474
+ };
2475
+ }): Promise<ShadowMessage>;
1886
2476
  browseListings(params?: {
1887
2477
  search?: string;
1888
2478
  tags?: string[];
@@ -1954,6 +2544,7 @@ declare class ShadowClient {
1954
2544
  products: ShadowProduct[];
1955
2545
  }>;
1956
2546
  getScopeNeutralProduct(productId: string): Promise<ShadowProduct>;
2547
+ getCommerceProductContext(productId: string): Promise<ShadowCommerceProductContext>;
1957
2548
  getShopProduct(shopId: string, productId: string): Promise<ShadowProduct>;
1958
2549
  createShopProduct(shopId: string, data: Partial<ShadowProduct> & Record<string, unknown>): Promise<ShadowProduct>;
1959
2550
  updateShopProduct(shopId: string, productId: string, data: Partial<ShadowProduct> & Record<string, unknown>): Promise<ShadowProduct>;
@@ -2048,14 +2639,8 @@ declare class ShadowClient {
2048
2639
  total: number;
2049
2640
  }>;
2050
2641
  getProduct(serverId: string, productId: string): Promise<ShadowProduct>;
2051
- createProduct(serverId: string, data: {
2642
+ createProduct(serverId: string, data: Partial<ShadowProduct> & {
2052
2643
  name: string;
2053
- description?: string;
2054
- price: number;
2055
- currency?: string;
2056
- stock: number;
2057
- categoryId?: string;
2058
- images?: string[];
2059
2644
  }): Promise<ShadowProduct>;
2060
2645
  updateProduct(serverId: string, productId: string, data: Partial<{
2061
2646
  name: string;
@@ -2065,6 +2650,7 @@ declare class ShadowClient {
2065
2650
  status: string;
2066
2651
  categoryId: string | null;
2067
2652
  images: string[];
2653
+ media: ShadowProduct['media'];
2068
2654
  }>): Promise<ShadowProduct>;
2069
2655
  deleteProduct(serverId: string, productId: string): Promise<{
2070
2656
  success: boolean;
@@ -2085,12 +2671,14 @@ declare class ShadowClient {
2085
2671
  skuId?: string;
2086
2672
  quantity: number;
2087
2673
  }[];
2674
+ buyerNote?: string;
2088
2675
  }): Promise<ShadowOrder>;
2089
2676
  listOrders(serverId: string): Promise<ShadowOrder[]>;
2090
2677
  listShopOrders(serverId: string): Promise<ShadowOrder[]>;
2091
2678
  getOrder(serverId: string, orderId: string): Promise<ShadowOrder>;
2092
2679
  updateOrderStatus(serverId: string, orderId: string, status: string): Promise<ShadowOrder>;
2093
2680
  cancelOrder(serverId: string, orderId: string): Promise<ShadowOrder>;
2681
+ completeOrder(serverId: string, orderId: string): Promise<ShadowOrder>;
2094
2682
  getProductReviews(serverId: string, productId: string): Promise<ShadowReview[]>;
2095
2683
  createReview(serverId: string, orderId: string, data: {
2096
2684
  productId: string;
@@ -2294,12 +2882,20 @@ declare class ShadowClient {
2294
2882
  confirmRechargePayment(paymentIntentId: string): Promise<ShadowPaymentOrder>;
2295
2883
  getEntitlements(serverId: string): Promise<ShadowEntitlement[]>;
2296
2884
  getAllEntitlements(): Promise<ShadowEntitlement[]>;
2885
+ getEntitlement(entitlementId: string): Promise<ShadowEntitlement>;
2886
+ getOAuthCommerceEntitlementAccess(params?: {
2887
+ resourceType?: string;
2888
+ resourceId?: string;
2889
+ capability?: string;
2890
+ }): Promise<ShadowOAuthCommerceEntitlementAccess>;
2891
+ redeemOAuthCommerceEntitlement(data: ShadowOAuthCommerceEntitlementRedeemInput): Promise<ShadowOAuthCommerceEntitlementRedeemResult>;
2297
2892
  verifyEntitlement(entitlementId: string): Promise<{
2298
2893
  active: boolean;
2299
2894
  entitlement: Record<string, unknown>;
2300
2895
  provisioning: ShadowEntitlementProvisioning;
2301
2896
  }>;
2302
2897
  cancelEntitlement(entitlementId: string, reason?: string): Promise<Record<string, unknown>>;
2898
+ cancelEntitlementRenewal(entitlementId: string, reason?: string): Promise<Record<string, unknown>>;
2303
2899
  getTaskCenter(): Promise<{
2304
2900
  tasks: ShadowTask[];
2305
2901
  }>;
@@ -2357,6 +2953,14 @@ declare class ShadowClient {
2357
2953
  items: Record<string, unknown>[];
2358
2954
  total: number;
2359
2955
  }>;
2956
+ discoverCommerce(params?: {
2957
+ q?: string;
2958
+ limit?: number;
2959
+ }): Promise<Record<string, unknown>>;
2960
+ discoverBusinessHub(params?: {
2961
+ q?: string;
2962
+ limit?: number;
2963
+ }): Promise<Record<string, unknown>>;
2360
2964
  enhanceVoice(data: {
2361
2965
  transcript: string;
2362
2966
  language?: string;
@@ -2485,6 +3089,47 @@ declare class ShadowSocket {
2485
3089
  }>;
2486
3090
  /** Leave a channel room */
2487
3091
  leaveChannel(channelId: string): void;
3092
+ joinVoiceChannel(channelId: string, options?: {
3093
+ clientId?: string;
3094
+ muted?: boolean;
3095
+ deafened?: boolean;
3096
+ }): Promise<{
3097
+ ok: boolean;
3098
+ data?: ShadowVoiceJoinResult;
3099
+ error?: string;
3100
+ code?: string;
3101
+ }>;
3102
+ leaveVoiceChannel(channelId: string, options?: {
3103
+ clientId?: string | null;
3104
+ }): Promise<{
3105
+ ok: boolean;
3106
+ data?: ShadowVoiceLeaveResult;
3107
+ error?: string;
3108
+ code?: string;
3109
+ }>;
3110
+ renewVoiceCredentials(channelId: string, options?: {
3111
+ clientId?: string | null;
3112
+ }): Promise<{
3113
+ ok: boolean;
3114
+ data?: ShadowVoiceRenewResult;
3115
+ error?: string;
3116
+ code?: string;
3117
+ }>;
3118
+ updateVoiceState(channelId: string, data: {
3119
+ clientId?: string | null;
3120
+ muted?: boolean;
3121
+ deafened?: boolean;
3122
+ speaking?: boolean;
3123
+ screenSharing?: boolean;
3124
+ }): Promise<{
3125
+ ok: boolean;
3126
+ data?: unknown;
3127
+ error?: string;
3128
+ code?: string;
3129
+ }>;
3130
+ sendVoiceHeartbeat(channelId: string, options?: {
3131
+ clientId?: string | null;
3132
+ }): void;
2488
3133
  /** Send a message via WebSocket (text-only; for file attachments use REST) */
2489
3134
  sendMessage(data: {
2490
3135
  channelId: string;
@@ -2502,4 +3147,40 @@ declare class ShadowSocket {
2502
3147
  updateActivity(channelId: string, activity: string | null): void;
2503
3148
  }
2504
3149
 
2505
- 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 };
3150
+ interface ShadowVoiceConsumerOptions {
3151
+ client: ShadowClient;
3152
+ channelId: string;
3153
+ clientId?: string;
3154
+ muted?: boolean;
3155
+ onRemoteAudio?: (input: {
3156
+ uid: string | number;
3157
+ track: IRemoteAudioTrack;
3158
+ }) => void;
3159
+ onRemoteScreen?: (input: {
3160
+ uid: string | number;
3161
+ track: IRemoteVideoTrack;
3162
+ }) => void;
3163
+ }
3164
+ declare class ShadowVoiceConsumer {
3165
+ private options;
3166
+ private rtc;
3167
+ private screenRtc;
3168
+ private audioTrack;
3169
+ private screenTrack;
3170
+ private session;
3171
+ private readonly clientId;
3172
+ private tokenRenewTimer;
3173
+ constructor(options: ShadowVoiceConsumerOptions);
3174
+ get joinResult(): ShadowVoiceJoinResult | null;
3175
+ join(): Promise<ShadowVoiceJoinResult>;
3176
+ setMuted(muted: boolean): Promise<void>;
3177
+ startScreenShare(): Promise<void>;
3178
+ stopScreenShare(): Promise<void>;
3179
+ leave(): Promise<void>;
3180
+ private bindTokenRenewal;
3181
+ private scheduleTokenRenewal;
3182
+ private clearTokenRenewal;
3183
+ private renewTokens;
3184
+ }
3185
+
3186
+ 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 ShadowChannelBootstrap, type ShadowChannelJoinRequestResult, type ShadowChannelJoinRequestStatus, type ShadowChannelPolicy, type ShadowChannelSlashCommand, ShadowClient, type ShadowCloudDeploymentBackup, type ShadowCloudDeploymentRuntimeResponse, type ShadowCloudDeploymentStatus, type ShadowCloudProviderCatalog, type ShadowCloudProviderEnvVar, type ShadowCloudProviderModel, type ShadowCloudProviderProfile, type ShadowCommerceCheckoutPreview, type ShadowCommerceProductCard, type ShadowCommerceProductContext, type ShadowCommerceProductPickerGroup, type ShadowCommerceProductPickerResponse, type ShadowCommunityAsset, type ShadowCommunityAssetDefinition, type ShadowCommunityAssetGrant, 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 ShadowMediaVariant, 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 ShadowOAuthCommerceEntitlementAccess, type ShadowOAuthCommerceEntitlementRedeemInput, type ShadowOAuthCommerceEntitlementRedeemResult, type ShadowOAuthCommerceEntitlementRedemption, type ShadowOAuthCommerceEntitlementSummary, type ShadowOAuthConsent, type ShadowOAuthToken, type ShadowOrder, type ShadowPaidFileOpenResult, type ShadowProduct, type ShadowProductEntitlementConfig, type ShadowProductMedia, type ShadowProductSku, type ShadowRemoteChannel, type ShadowRemoteConfig, type ShadowRemoteServer, type ShadowReview, type ShadowServer, type ShadowServerAccess, type ShadowServerAppCatalogEntry, type ShadowServerAppCommand, type ShadowServerAppDiscovery, type ShadowServerAppIntegration, type ShadowServerAppLaunchContext, type ShadowServerAppManifest, type ShadowServerAppSkillDocument, type ShadowServerAppTokenIntrospection, type ShadowServerJoinRequestResult, type ShadowServerJoinRequestStatus, type ShadowSettlementLine, type ShadowShop, type ShadowSlashCommand, ShadowSocket, type ShadowSocketOptions, type ShadowTask, type ShadowThread, type ShadowTransaction, type ShadowUsageProviderSnapshot, type ShadowUser, ShadowVoiceConsumer, type ShadowVoiceConsumerOptions, type ShadowVoiceCredentials, type ShadowVoiceJoinResult, type ShadowVoiceLeaveResult, type ShadowVoiceParticipant, type ShadowVoicePolicy, type ShadowVoiceState, type ShadowWallet, type TypingPayload, type VoiceParticipantPayload, type VoicePolicyUpdatedPayload, channelRoom, threadRoom, userRoom };